qcacmn: Ensure the mac id sent to firmware starts at 1

Firmware expects the following:
- mac id for the refill ring configuration should be 0 (soc)
- mac id for the rx dma rings should be 1, 2 (mac 0 and mac 1)

Change-Id: I23c652e2e1f8e2fca69647906321e4d867a42609
CRs-Fixed: 2003050
This commit is contained in:
Dhanashri Atre
2017-02-08 11:09:56 -08:00
committad av qcabuildsw
förälder 801426b7c2
incheckning 2ea8c0fe00
3 ändrade filer med 74 tillägg och 60 borttagningar

Visa fil

@@ -20,6 +20,7 @@
#include <hal_api.h>
#include "dp_htt.h"
#include "dp_peer.h"
#include "dp_types.h"
#define HTT_HTC_PKT_POOL_INIT_SIZE 64
@@ -328,7 +329,13 @@ int htt_srng_setup(void *htt_soc, int mac_id, void *hal_srng,
/* word 0 */
*msg_word = 0;
HTT_H2T_MSG_TYPE_SET(*msg_word, HTT_H2T_MSG_TYPE_SRING_SETUP);
HTT_SRING_SETUP_PDEV_ID_SET(*msg_word, mac_id);
if (htt_ring_type == HTT_SW_TO_HW_RING)
HTT_SRING_SETUP_PDEV_ID_SET(*msg_word,
DP_SW2HW_MACID(mac_id));
else
HTT_SRING_SETUP_PDEV_ID_SET(*msg_word, mac_id);
QDF_TRACE(QDF_MODULE_ID_TXRX, QDF_TRACE_LEVEL_ERROR,
"%s: mac_id %d\n", __func__, mac_id);
HTT_SRING_SETUP_RING_TYPE_SET(*msg_word, htt_ring_type);

Visa fil

@@ -1207,52 +1207,68 @@ static void dp_soc_detach_wifi3(void *txrx_soc)
* Return: void
*/
#ifdef QCA_HOST2FW_RXBUF_RING
static void dp_rxdma_ring_config(struct dp_soc *soc,
struct dp_pdev *pdev)
static void dp_rxdma_ring_config(struct dp_soc *soc)
{
int mac_id = 0;
int j;
int max_mac_rings =
wlan_cfg_get_num_mac_rings
(pdev->wlan_cfg_ctx);
int i;
max_mac_rings =
max_mac_rings < MAX_RX_MAC_RINGS ?
max_mac_rings : MAX_RX_MAC_RINGS;
for (i = 0; i < MAX_PDEV_CNT; i++) {
struct dp_pdev *pdev = soc->pdev_list[i];
if (!soc->cdp_soc.ol_ops->
is_hw_dbs_2x2_capable()) {
max_mac_rings = 1;
QDF_TRACE(QDF_MODULE_ID_TXRX,
QDF_TRACE_LEVEL_ERROR,
FL("DBS enabled, max_mac_rings %d\n"),
max_mac_rings);
} else {
QDF_TRACE(QDF_MODULE_ID_TXRX,
QDF_TRACE_LEVEL_ERROR,
FL("DBS disabled max_mac_rings %d\n"),
max_mac_rings);
}
if (pdev) {
int mac_id = 0;
int j;
int max_mac_rings =
wlan_cfg_get_num_mac_rings
(pdev->wlan_cfg_ctx);
QDF_TRACE(QDF_MODULE_ID_TXRX, QDF_TRACE_LEVEL_ERROR,
FL("pdev_id %d max_mac_rings %d\n"),
pdev->pdev_id, max_mac_rings);
htt_srng_setup(soc->htt_handle, 0,
pdev->rx_refill_buf_ring.hal_srng,
RXDMA_BUF);
for (j = 0; j < max_mac_rings; j++) {
QDF_TRACE(QDF_MODULE_ID_TXRX,
QDF_TRACE_LEVEL_ERROR,
FL("mac_id %d\n"), mac_id);
htt_srng_setup(soc->htt_handle, mac_id,
pdev->rx_mac_buf_ring[j]
.hal_srng,
RXDMA_BUF);
mac_id++;
if (!soc->cdp_soc.ol_ops->
is_hw_dbs_2x2_capable()) {
max_mac_rings = 1;
QDF_TRACE(QDF_MODULE_ID_TXRX,
QDF_TRACE_LEVEL_ERROR,
FL("DBS enabled, max_mac_rings %d\n"),
max_mac_rings);
} else {
QDF_TRACE(QDF_MODULE_ID_TXRX,
QDF_TRACE_LEVEL_ERROR,
FL("DBS disabled max_mac_rings %d\n"),
max_mac_rings);
}
QDF_TRACE(QDF_MODULE_ID_TXRX, QDF_TRACE_LEVEL_ERROR,
FL("pdev_id %d max_mac_rings %d\n"),
pdev->pdev_id, max_mac_rings);
for (j = 0; j < max_mac_rings; j++) {
QDF_TRACE(QDF_MODULE_ID_TXRX,
QDF_TRACE_LEVEL_ERROR,
FL("mac_id %d\n"), mac_id);
htt_srng_setup(soc->htt_handle, mac_id,
pdev->rx_mac_buf_ring[j]
.hal_srng,
RXDMA_BUF);
mac_id++;
}
}
}
}
#else
static void dp_rxdma_ring_config(struct dp_soc *soc,
struct dp_pdev *pdev)
static void dp_rxdma_ring_config(struct dp_soc *soc)
{
int i;
for (i = 0; i < MAX_PDEV_CNT; i++) {
struct dp_pdev *pdev = soc->pdev_list[i];
if (pdev) {
htt_srng_setup(soc->htt_handle, i,
pdev->rx_refill_buf_ring.hal_srng, RXDMA_BUF);
}
}
}
#endif
@@ -1263,32 +1279,11 @@ static void dp_rxdma_ring_config(struct dp_soc *soc,
static int dp_soc_attach_target_wifi3(struct cdp_soc_t *cdp_soc)
{
struct dp_soc *soc = (struct dp_soc *)cdp_soc;
int i; /* variable to track the pdev number */
htt_soc_attach_target(soc->htt_handle);
for (i = 0; i < MAX_PDEV_CNT; i++) {
struct dp_pdev *pdev = soc->pdev_list[i];
dp_rxdma_ring_config(soc);
if (pdev) {
htt_srng_setup(soc->htt_handle, i,
pdev->rx_refill_buf_ring.hal_srng, RXDMA_BUF);
dp_rxdma_ring_config(soc, pdev);
#ifdef notyet /* FW doesn't handle monitor rings yet */
htt_srng_setup(soc->htt_handle, i,
pdev->rxdma_mon_buf_ring.hal_srng,
RXDMA_MONITOR_BUF);
htt_srng_setup(soc->htt_handle, i,
pdev->rxdma_mon_dst_ring.hal_srng,
RXDMA_MONITOR_DST);
htt_srng_setup(soc->htt_handle, i,
pdev->rxdma_mon_status_ring.hal_srng,
RXDMA_MONITOR_STATUS);
#endif
}
}
return 0;
}

Visa fil

@@ -83,6 +83,18 @@ union dp_rx_desc_list_elem_t;
#define DP_TRACE(LVL, fmt, args ...) \
QDF_TRACE(QDF_MODULE_ID_DP, QDF_TRACE_LEVEL_##LVL, \
"%s:%d: "fmt, __func__, __LINE__, ## args)
/**
* macros to convert hw mac id to sw mac id:
* mac ids used by hardware start from a value of 1 while
* those in host software start from a value of 0. Use the
* macros below to convert between mac ids used by software and
* hardware
*/
#define DP_SW2HW_MACID(id) ((id) + 1)
#define DP_HW2SW_MACID(id) ((id) > 0 ? ((id) - 1) : 0)
/**
* enum dp_tx_frm_type
* @dp_tx_frm_std: Regular frame, no added header fragments