qcacmn: Don't set up second Rx refill ring for WIN

Set up second Rx refill ring only when IPA offload is enabled.

Change-Id: Icc8c4e2eb42dced3ae9293f33b6446b14093da0f
CRs-Fixed: 2160070
This commit is contained in:
Yun Park
2018-01-17 12:15:01 -08:00
committed by nshrivas
parent 77ba8f42ca
commit 47e6af8c98
2 changed files with 56 additions and 8 deletions

View File

@@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2017, The Linux Foundation. All rights reserved. * Copyright (c) 2017-2018, The Linux Foundation. All rights reserved.
* *
* Permission to use, copy, modify, and/or distribute this software for any * Permission to use, copy, modify, and/or distribute this software for any
* purpose with or without fee is hereby granted, provided that the above * purpose with or without fee is hereby granted, provided that the above
@@ -22,6 +22,7 @@
#define IPA_TCL_DATA_RING_IDX 2 #define IPA_TCL_DATA_RING_IDX 2
#define IPA_TX_COMP_RING_IDX 2 #define IPA_TX_COMP_RING_IDX 2
#define IPA_REO_DEST_RING_IDX 3 #define IPA_REO_DEST_RING_IDX 3
#define IPA_RX_REFILL_BUF_RING_IDX 2
/** /**
* struct dp_ipa_uc_tx_hdr - full tx header registered to IPA hardware * struct dp_ipa_uc_tx_hdr - full tx header registered to IPA hardware

View File

@@ -2358,6 +2358,58 @@ void dp_free_inact_timer(struct dp_soc *soc)
#endif #endif
#ifdef IPA_OFFLOAD
/**
* dp_setup_ipa_rx_refill_buf_ring - Setup second Rx refill buffer ring
* @soc: data path instance
* @pdev: core txrx pdev context
*
* Return: QDF_STATUS_SUCCESS: success
* QDF_STATUS_E_RESOURCES: Error return
*/
static int dp_setup_ipa_rx_refill_buf_ring(struct dp_soc *soc,
struct dp_pdev *pdev)
{
/* Setup second Rx refill buffer ring */
if (dp_srng_setup(soc, &pdev->rx_refill_buf_ring2, RXDMA_BUF,
IPA_RX_REFILL_BUF_RING_IDX,
pdev->pdev_id, RXDMA_REFILL_RING_SIZE)) {
QDF_TRACE(QDF_MODULE_ID_DP, QDF_TRACE_LEVEL_ERROR,
FL("dp_srng_setup failed second rx refill ring"));
return QDF_STATUS_E_FAILURE;
}
return QDF_STATUS_SUCCESS;
}
/**
* dp_cleanup_ipa_rx_refill_buf_ring - Cleanup second Rx refill buffer ring
* @soc: data path instance
* @pdev: core txrx pdev context
*
* Return: void
*/
static void dp_cleanup_ipa_rx_refill_buf_ring(struct dp_soc *soc,
struct dp_pdev *pdev)
{
dp_srng_cleanup(soc, &pdev->rx_refill_buf_ring2, RXDMA_BUF,
IPA_RX_REFILL_BUF_RING_IDX);
}
#else
static int dp_setup_ipa_rx_refill_buf_ring(struct dp_soc *soc,
struct dp_pdev *pdev)
{
return QDF_STATUS_SUCCESS;
}
static void dp_cleanup_ipa_rx_refill_buf_ring(struct dp_soc *soc,
struct dp_pdev *pdev)
{
}
#endif
/* /*
* dp_pdev_attach_wifi3() - attach txrx pdev * dp_pdev_attach_wifi3() - attach txrx pdev
* @ctrl_pdev: Opaque PDEV object * @ctrl_pdev: Opaque PDEV object
@@ -2511,13 +2563,8 @@ static struct cdp_pdev *dp_pdev_attach_wifi3(struct cdp_soc_t *txrx_soc,
} }
} }
/* Setup second Rx refill buffer ring */ if (dp_setup_ipa_rx_refill_buf_ring(soc, pdev))
if (dp_srng_setup(soc, &pdev->rx_refill_buf_ring2, RXDMA_BUF, 2,
pdev->pdev_id, RXDMA_REFILL_RING_SIZE)) {
QDF_TRACE(QDF_MODULE_ID_DP, QDF_TRACE_LEVEL_ERROR,
FL("dp_srng_setup failed second rx refill ring"));
goto fail1; goto fail1;
}
if (dp_ipa_ring_resource_setup(soc, pdev)) if (dp_ipa_ring_resource_setup(soc, pdev))
goto fail1; goto fail1;
@@ -2662,7 +2709,7 @@ static void dp_pdev_detach_wifi3(struct cdp_pdev *txrx_pdev, int force)
dp_ipa_uc_detach(soc, pdev); dp_ipa_uc_detach(soc, pdev);
dp_srng_cleanup(soc, &pdev->rx_refill_buf_ring2, RXDMA_BUF, 2); dp_cleanup_ipa_rx_refill_buf_ring(soc, pdev);
/* Cleanup per PDEV REO rings if configured */ /* Cleanup per PDEV REO rings if configured */
if (wlan_cfg_per_pdev_rx_ring(soc->wlan_cfg_ctx)) { if (wlan_cfg_per_pdev_rx_ring(soc->wlan_cfg_ctx)) {