qcacmn: Data path changes for Dynamic Mode Change FR. Changes include-
1. Move all LMAC rings to SOC from pDEV 2. Dynamically obtain lmac->pdev mapping while handling LMAC interrupts Change-Id: Ib017d49243405b62fc34099c01a2b898b25341d0
This commit is contained in:
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2011-2019 The Linux Foundation. All rights reserved.
|
* Copyright (c) 2011-2020 The Linux Foundation. All rights reserved.
|
||||||
*
|
*
|
||||||
* Permission to use, copy, modify, and/or distribute this software for
|
* Permission to use, copy, modify, and/or distribute this software for
|
||||||
* any purpose with or without fee is hereby granted, provided that the
|
* any purpose with or without fee is hereby granted, provided that the
|
||||||
@@ -1929,12 +1929,12 @@ cdp_soc_set_dp_txrx_handle(ol_txrx_soc_handle soc, void *dp_handle)
|
|||||||
* @soc: opaque soc handle
|
* @soc: opaque soc handle
|
||||||
* @pdev_id: id of data path pdev handle
|
* @pdev_id: id of data path pdev handle
|
||||||
* @lmac_id: lmac id
|
* @lmac_id: lmac id
|
||||||
*
|
* @mode_change: flag to indicate mode change (true) or init (false)
|
||||||
* Return: QDF_STATUS
|
* Return: QDF_STATUS
|
||||||
*/
|
*/
|
||||||
static inline QDF_STATUS
|
static inline QDF_STATUS
|
||||||
cdp_soc_map_pdev_to_lmac(ol_txrx_soc_handle soc, uint8_t pdev_id,
|
cdp_soc_map_pdev_to_lmac(ol_txrx_soc_handle soc, uint8_t pdev_id,
|
||||||
uint32_t lmac_id)
|
uint32_t lmac_id, bool mode_change)
|
||||||
{
|
{
|
||||||
if (!soc || !soc->ops) {
|
if (!soc || !soc->ops) {
|
||||||
QDF_TRACE(QDF_MODULE_ID_CDP, QDF_TRACE_LEVEL_DEBUG,
|
QDF_TRACE(QDF_MODULE_ID_CDP, QDF_TRACE_LEVEL_DEBUG,
|
||||||
@@ -1948,7 +1948,7 @@ cdp_soc_map_pdev_to_lmac(ol_txrx_soc_handle soc, uint8_t pdev_id,
|
|||||||
return QDF_STATUS_E_FAILURE;
|
return QDF_STATUS_E_FAILURE;
|
||||||
|
|
||||||
return soc->ops->cmn_drv_ops->map_pdev_to_lmac(soc, pdev_id,
|
return soc->ops->cmn_drv_ops->map_pdev_to_lmac(soc, pdev_id,
|
||||||
lmac_id);
|
lmac_id, mode_change);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@@ -447,7 +447,7 @@ struct cdp_cmn_ops {
|
|||||||
void *dp_txrx_handle);
|
void *dp_txrx_handle);
|
||||||
|
|
||||||
QDF_STATUS (*map_pdev_to_lmac)(ol_txrx_soc_handle soc, uint8_t pdev_id,
|
QDF_STATUS (*map_pdev_to_lmac)(ol_txrx_soc_handle soc, uint8_t pdev_id,
|
||||||
uint32_t lmac_id);
|
uint32_t lmac_id, bool mode_change);
|
||||||
|
|
||||||
QDF_STATUS (*set_pdev_status_down)(struct cdp_soc_t *soc_handle,
|
QDF_STATUS (*set_pdev_status_down)(struct cdp_soc_t *soc_handle,
|
||||||
uint8_t pdev_id, bool is_pdev_down);
|
uint8_t pdev_id, bool is_pdev_down);
|
||||||
|
@@ -765,6 +765,8 @@ int htt_srng_setup(struct htt_soc *soc, int mac_id,
|
|||||||
hal_srng_get_entrysize(soc->hal_soc, hal_ring_type);
|
hal_srng_get_entrysize(soc->hal_soc, hal_ring_type);
|
||||||
int htt_ring_type, htt_ring_id;
|
int htt_ring_type, htt_ring_id;
|
||||||
uint8_t *htt_logger_bufp;
|
uint8_t *htt_logger_bufp;
|
||||||
|
int target_pdev_id;
|
||||||
|
int lmac_id = dp_get_lmac_id_for_pdev_id(soc->dp_soc, 0, mac_id);
|
||||||
|
|
||||||
/* Sizes should be set in 4-byte words */
|
/* Sizes should be set in 4-byte words */
|
||||||
ring_entry_size = ring_entry_size >> 2;
|
ring_entry_size = ring_entry_size >> 2;
|
||||||
@@ -796,7 +798,7 @@ int htt_srng_setup(struct htt_soc *soc, int mac_id,
|
|||||||
#else
|
#else
|
||||||
if (srng_params.ring_id ==
|
if (srng_params.ring_id ==
|
||||||
(HAL_SRNG_WMAC1_SW2RXDMA0_BUF0 +
|
(HAL_SRNG_WMAC1_SW2RXDMA0_BUF0 +
|
||||||
(mac_id * HAL_MAX_RINGS_PER_LMAC))) {
|
(lmac_id * HAL_MAX_RINGS_PER_LMAC))) {
|
||||||
htt_ring_id = HTT_RXDMA_HOST_BUF_RING;
|
htt_ring_id = HTT_RXDMA_HOST_BUF_RING;
|
||||||
htt_ring_type = HTT_SW_TO_HW_RING;
|
htt_ring_type = HTT_SW_TO_HW_RING;
|
||||||
#endif
|
#endif
|
||||||
@@ -806,7 +808,7 @@ int htt_srng_setup(struct htt_soc *soc, int mac_id,
|
|||||||
#else
|
#else
|
||||||
(HAL_SRNG_WMAC1_SW2RXDMA1_BUF +
|
(HAL_SRNG_WMAC1_SW2RXDMA1_BUF +
|
||||||
#endif
|
#endif
|
||||||
(mac_id * HAL_MAX_RINGS_PER_LMAC))) {
|
(lmac_id * HAL_MAX_RINGS_PER_LMAC))) {
|
||||||
htt_ring_id = HTT_RXDMA_HOST_BUF_RING;
|
htt_ring_id = HTT_RXDMA_HOST_BUF_RING;
|
||||||
htt_ring_type = HTT_SW_TO_HW_RING;
|
htt_ring_type = HTT_SW_TO_HW_RING;
|
||||||
} else {
|
} else {
|
||||||
@@ -870,11 +872,12 @@ int htt_srng_setup(struct htt_soc *soc, int mac_id,
|
|||||||
*msg_word = 0;
|
*msg_word = 0;
|
||||||
htt_logger_bufp = (uint8_t *)msg_word;
|
htt_logger_bufp = (uint8_t *)msg_word;
|
||||||
HTT_H2T_MSG_TYPE_SET(*msg_word, HTT_H2T_MSG_TYPE_SRING_SETUP);
|
HTT_H2T_MSG_TYPE_SET(*msg_word, HTT_H2T_MSG_TYPE_SRING_SETUP);
|
||||||
|
target_pdev_id =
|
||||||
|
dp_get_target_pdev_id_for_host_pdev_id(soc->dp_soc, mac_id);
|
||||||
|
|
||||||
if ((htt_ring_type == HTT_SW_TO_HW_RING) ||
|
if ((htt_ring_type == HTT_SW_TO_HW_RING) ||
|
||||||
(htt_ring_type == HTT_HW_TO_SW_RING))
|
(htt_ring_type == HTT_HW_TO_SW_RING))
|
||||||
HTT_SRING_SETUP_PDEV_ID_SET(*msg_word,
|
HTT_SRING_SETUP_PDEV_ID_SET(*msg_word, target_pdev_id);
|
||||||
DP_SW2HW_MACID(mac_id));
|
|
||||||
else
|
else
|
||||||
HTT_SRING_SETUP_PDEV_ID_SET(*msg_word, mac_id);
|
HTT_SRING_SETUP_PDEV_ID_SET(*msg_word, mac_id);
|
||||||
|
|
||||||
@@ -1011,7 +1014,7 @@ fail0:
|
|||||||
* htt_h2t_rx_ring_cfg() - Send SRNG packet and TLV filter
|
* htt_h2t_rx_ring_cfg() - Send SRNG packet and TLV filter
|
||||||
* config message to target
|
* config message to target
|
||||||
* @htt_soc: HTT SOC handle
|
* @htt_soc: HTT SOC handle
|
||||||
* @pdev_id: PDEV Id
|
* @pdev_id: WIN- PDEV Id, MCL- mac id
|
||||||
* @hal_srng: Opaque HAL SRNG pointer
|
* @hal_srng: Opaque HAL SRNG pointer
|
||||||
* @hal_ring_type: SRNG ring type
|
* @hal_ring_type: SRNG ring type
|
||||||
* @ring_buf_size: SRNG buffer size
|
* @ring_buf_size: SRNG buffer size
|
||||||
@@ -1033,6 +1036,7 @@ int htt_h2t_rx_ring_cfg(struct htt_soc *htt_soc, int pdev_id,
|
|||||||
uint8_t *htt_logger_bufp;
|
uint8_t *htt_logger_bufp;
|
||||||
struct wlan_cfg_dp_soc_ctxt *wlan_cfg_ctx = soc->dp_soc->wlan_cfg_ctx;
|
struct wlan_cfg_dp_soc_ctxt *wlan_cfg_ctx = soc->dp_soc->wlan_cfg_ctx;
|
||||||
uint32_t mon_drop_th = wlan_cfg_get_mon_drop_thresh(wlan_cfg_ctx);
|
uint32_t mon_drop_th = wlan_cfg_get_mon_drop_thresh(wlan_cfg_ctx);
|
||||||
|
int target_pdev_id;
|
||||||
|
|
||||||
htt_msg = qdf_nbuf_alloc(soc->osdev,
|
htt_msg = qdf_nbuf_alloc(soc->osdev,
|
||||||
HTT_MSG_BUF_SIZE(HTT_RX_RING_SELECTION_CFG_SZ),
|
HTT_MSG_BUF_SIZE(HTT_RX_RING_SELECTION_CFG_SZ),
|
||||||
@@ -1102,10 +1106,13 @@ int htt_h2t_rx_ring_cfg(struct htt_soc *htt_soc, int pdev_id,
|
|||||||
* pdev_id is indexed from 0 whereas mac_id is indexed from 1
|
* pdev_id is indexed from 0 whereas mac_id is indexed from 1
|
||||||
* SW_TO_SW and SW_TO_HW rings are unaffected by this
|
* SW_TO_SW and SW_TO_HW rings are unaffected by this
|
||||||
*/
|
*/
|
||||||
|
target_pdev_id =
|
||||||
|
dp_get_target_pdev_id_for_host_pdev_id(soc->dp_soc, pdev_id);
|
||||||
|
|
||||||
if (htt_ring_type == HTT_SW_TO_SW_RING ||
|
if (htt_ring_type == HTT_SW_TO_SW_RING ||
|
||||||
htt_ring_type == HTT_SW_TO_HW_RING)
|
htt_ring_type == HTT_SW_TO_HW_RING)
|
||||||
HTT_RX_RING_SELECTION_CFG_PDEV_ID_SET(*msg_word,
|
HTT_RX_RING_SELECTION_CFG_PDEV_ID_SET(*msg_word,
|
||||||
DP_SW2HW_MACID(pdev_id));
|
target_pdev_id);
|
||||||
|
|
||||||
/* TODO: Discuss with FW on changing this to unique ID and using
|
/* TODO: Discuss with FW on changing this to unique ID and using
|
||||||
* htt_ring_type to send the type of ring
|
* htt_ring_type to send the type of ring
|
||||||
@@ -3656,10 +3663,12 @@ dp_ppdu_stats_ind_handler(struct htt_soc *soc,
|
|||||||
qdf_nbuf_t htt_t2h_msg)
|
qdf_nbuf_t htt_t2h_msg)
|
||||||
{
|
{
|
||||||
u_int8_t pdev_id;
|
u_int8_t pdev_id;
|
||||||
|
u_int8_t target_pdev_id;
|
||||||
bool free_buf;
|
bool free_buf;
|
||||||
qdf_nbuf_set_pktlen(htt_t2h_msg, HTT_T2H_MAX_MSG_SIZE);
|
qdf_nbuf_set_pktlen(htt_t2h_msg, HTT_T2H_MAX_MSG_SIZE);
|
||||||
pdev_id = HTT_T2H_PPDU_STATS_PDEV_ID_GET(*msg_word);
|
target_pdev_id = HTT_T2H_PPDU_STATS_PDEV_ID_GET(*msg_word);
|
||||||
pdev_id = DP_HW2SW_MACID(pdev_id);
|
pdev_id = dp_get_host_pdev_id_for_target_pdev_id(soc->dp_soc,
|
||||||
|
target_pdev_id);
|
||||||
free_buf = dp_txrx_ppdu_stats_handler(soc->dp_soc, pdev_id,
|
free_buf = dp_txrx_ppdu_stats_handler(soc->dp_soc, pdev_id,
|
||||||
htt_t2h_msg);
|
htt_t2h_msg);
|
||||||
dp_wdi_event_handler(WDI_EVENT_LITE_T2H, soc->dp_soc,
|
dp_wdi_event_handler(WDI_EVENT_LITE_T2H, soc->dp_soc,
|
||||||
@@ -3691,10 +3700,12 @@ dp_pktlog_msg_handler(struct htt_soc *soc,
|
|||||||
uint32_t *msg_word)
|
uint32_t *msg_word)
|
||||||
{
|
{
|
||||||
uint8_t pdev_id;
|
uint8_t pdev_id;
|
||||||
|
uint8_t target_pdev_id;
|
||||||
uint32_t *pl_hdr;
|
uint32_t *pl_hdr;
|
||||||
|
|
||||||
pdev_id = HTT_T2H_PKTLOG_PDEV_ID_GET(*msg_word);
|
target_pdev_id = HTT_T2H_PKTLOG_PDEV_ID_GET(*msg_word);
|
||||||
pdev_id = DP_HW2SW_MACID(pdev_id);
|
pdev_id = dp_get_host_pdev_id_for_target_pdev_id(soc->dp_soc,
|
||||||
|
target_pdev_id);
|
||||||
pl_hdr = (msg_word + 1);
|
pl_hdr = (msg_word + 1);
|
||||||
dp_wdi_event_handler(WDI_EVENT_OFFLOAD_ALL, soc->dp_soc,
|
dp_wdi_event_handler(WDI_EVENT_OFFLOAD_ALL, soc->dp_soc,
|
||||||
pl_hdr, HTT_INVALID_PEER, WDI_NO_VAL,
|
pl_hdr, HTT_INVALID_PEER, WDI_NO_VAL,
|
||||||
@@ -3761,6 +3772,7 @@ static void dp_htt_bkp_event_alert(u_int32_t *msg_word, struct htt_soc *soc)
|
|||||||
{
|
{
|
||||||
u_int8_t ring_type;
|
u_int8_t ring_type;
|
||||||
u_int8_t pdev_id;
|
u_int8_t pdev_id;
|
||||||
|
uint8_t target_pdev_id;
|
||||||
u_int8_t ring_id;
|
u_int8_t ring_id;
|
||||||
u_int16_t hp_idx;
|
u_int16_t hp_idx;
|
||||||
u_int16_t tp_idx;
|
u_int16_t tp_idx;
|
||||||
@@ -3776,8 +3788,9 @@ static void dp_htt_bkp_event_alert(u_int32_t *msg_word, struct htt_soc *soc)
|
|||||||
dpsoc = (struct dp_soc *)soc->dp_soc;
|
dpsoc = (struct dp_soc *)soc->dp_soc;
|
||||||
msg_type = HTT_T2H_MSG_TYPE_GET(*msg_word);
|
msg_type = HTT_T2H_MSG_TYPE_GET(*msg_word);
|
||||||
ring_type = HTT_T2H_RX_BKPRESSURE_RING_TYPE_GET(*msg_word);
|
ring_type = HTT_T2H_RX_BKPRESSURE_RING_TYPE_GET(*msg_word);
|
||||||
pdev_id = HTT_T2H_RX_BKPRESSURE_PDEV_ID_GET(*msg_word);
|
target_pdev_id = HTT_T2H_RX_BKPRESSURE_PDEV_ID_GET(*msg_word);
|
||||||
pdev_id = DP_HW2SW_MACID(pdev_id);
|
pdev_id = dp_get_host_pdev_id_for_target_pdev_id(soc->dp_soc,
|
||||||
|
target_pdev_id);
|
||||||
pdev = (struct dp_pdev *)dpsoc->pdev_list[pdev_id];
|
pdev = (struct dp_pdev *)dpsoc->pdev_list[pdev_id];
|
||||||
ring_id = HTT_T2H_RX_BKPRESSURE_RINGID_GET(*msg_word);
|
ring_id = HTT_T2H_RX_BKPRESSURE_RINGID_GET(*msg_word);
|
||||||
hp_idx = HTT_T2H_RX_BKPRESSURE_HEAD_IDX_GET(*(msg_word + 1));
|
hp_idx = HTT_T2H_RX_BKPRESSURE_HEAD_IDX_GET(*(msg_word + 1));
|
||||||
@@ -4268,6 +4281,8 @@ QDF_STATUS dp_h2t_ext_stats_msg_send(struct dp_pdev *pdev,
|
|||||||
uint32_t *msg_word;
|
uint32_t *msg_word;
|
||||||
uint8_t pdev_mask = 0;
|
uint8_t pdev_mask = 0;
|
||||||
uint8_t *htt_logger_bufp;
|
uint8_t *htt_logger_bufp;
|
||||||
|
int mac_for_pdev;
|
||||||
|
int target_pdev_id;
|
||||||
|
|
||||||
msg = qdf_nbuf_alloc(
|
msg = qdf_nbuf_alloc(
|
||||||
soc->osdev,
|
soc->osdev,
|
||||||
@@ -4283,9 +4298,11 @@ QDF_STATUS dp_h2t_ext_stats_msg_send(struct dp_pdev *pdev,
|
|||||||
* Bit 2: Pdev stats for pdev id 1
|
* Bit 2: Pdev stats for pdev id 1
|
||||||
* Bit 3: Pdev stats for pdev id 2
|
* Bit 3: Pdev stats for pdev id 2
|
||||||
*/
|
*/
|
||||||
mac_id = dp_get_mac_id_for_pdev(mac_id, pdev->pdev_id);
|
mac_for_pdev = dp_get_mac_id_for_pdev(mac_id, pdev->pdev_id);
|
||||||
|
target_pdev_id =
|
||||||
|
dp_get_target_pdev_id_for_host_pdev_id(pdev->soc, mac_for_pdev);
|
||||||
|
|
||||||
pdev_mask = 1 << DP_SW2HW_MACID(mac_id);
|
pdev_mask = 1 << target_pdev_id;
|
||||||
/*
|
/*
|
||||||
* Set the length of the message.
|
* Set the length of the message.
|
||||||
* The contribution from the HTC_HDR_ALIGNMENT_PADDING is added
|
* The contribution from the HTC_HDR_ALIGNMENT_PADDING is added
|
||||||
@@ -4412,7 +4429,8 @@ QDF_STATUS dp_h2t_cfg_stats_msg_send(struct dp_pdev *pdev,
|
|||||||
* Bit 2: Pdev stats for pdev id 1
|
* Bit 2: Pdev stats for pdev id 1
|
||||||
* Bit 3: Pdev stats for pdev id 2
|
* Bit 3: Pdev stats for pdev id 2
|
||||||
*/
|
*/
|
||||||
pdev_mask = 1 << DP_SW2HW_MACID(mac_id);
|
pdev_mask = 1 << dp_get_target_pdev_id_for_host_pdev_id(pdev->soc,
|
||||||
|
mac_id);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Set the length of the message.
|
* Set the length of the message.
|
||||||
|
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2016-2019 The Linux Foundation. All rights reserved.
|
* Copyright (c) 2016-2020 The Linux Foundation. All rights reserved.
|
||||||
*
|
*
|
||||||
* Permission to use, copy, modify, and/or distribute this software for
|
* Permission to use, copy, modify, and/or distribute this software for
|
||||||
* any purpose with or without fee is hereby granted, provided that the
|
* any purpose with or without fee is hereby granted, provided that the
|
||||||
@@ -1202,6 +1202,121 @@ static inline int dp_get_mac_id_for_pdev(uint32_t mac_id, uint32_t pdev_id)
|
|||||||
return (mac_id + pdev_id);
|
return (mac_id + pdev_id);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* dp_get_lmac_id_for_pdev_id() - Return lmac id corresponding to host pdev id
|
||||||
|
* @soc: soc pointer
|
||||||
|
* @mac_id: MAC id
|
||||||
|
* @pdev_id: pdev_id corresponding to pdev, 0 for MCL
|
||||||
|
*
|
||||||
|
* For MCL, Single pdev using both MACs will operate on both MAC rings.
|
||||||
|
*
|
||||||
|
* For WIN, each PDEV will operate one ring.
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
static inline int
|
||||||
|
dp_get_lmac_id_for_pdev_id
|
||||||
|
(struct dp_soc *soc, uint32_t mac_id, uint32_t pdev_id)
|
||||||
|
{
|
||||||
|
if (!wlan_cfg_per_pdev_lmac_ring(soc->wlan_cfg_ctx)) {
|
||||||
|
if (mac_id && pdev_id) {
|
||||||
|
qdf_print("Both mac_id and pdev_id cannot be non zero");
|
||||||
|
QDF_BUG(0);
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
return (mac_id + pdev_id);
|
||||||
|
}
|
||||||
|
|
||||||
|
return soc->pdev_list[pdev_id]->lmac_id;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* dp_get_pdev_for_lmac_id() - Return pdev pointer corresponding to lmac id
|
||||||
|
* @soc: soc pointer
|
||||||
|
* @lmac_id: LMAC id
|
||||||
|
*
|
||||||
|
* For MCL, Single pdev exists
|
||||||
|
*
|
||||||
|
* For WIN, each PDEV will operate one ring.
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
static inline struct dp_pdev *
|
||||||
|
dp_get_pdev_for_lmac_id(struct dp_soc *soc, uint32_t lmac_id)
|
||||||
|
{
|
||||||
|
int i = 0;
|
||||||
|
|
||||||
|
if (wlan_cfg_per_pdev_lmac_ring(soc->wlan_cfg_ctx)) {
|
||||||
|
i = wlan_cfg_get_pdev_idx(soc->wlan_cfg_ctx, lmac_id);
|
||||||
|
qdf_assert_always(i < MAX_PDEV_CNT);
|
||||||
|
|
||||||
|
return soc->pdev_list[i];
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Typically for MCL as there only 1 PDEV*/
|
||||||
|
return soc->pdev_list[0];
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* dp_get_target_pdev_id_for_host_pdev_id() - Return target pdev corresponding
|
||||||
|
* to host pdev id
|
||||||
|
* @soc: soc pointer
|
||||||
|
* @mac_for_pdev: pdev_id corresponding to host pdev for WIN, mac id for MCL
|
||||||
|
*
|
||||||
|
* returns target pdev_id for host pdev id. For WIN, this is derived through
|
||||||
|
* a two step process:
|
||||||
|
* 1. Get lmac_id corresponding to host pdev_id (lmac_id can change
|
||||||
|
* during mode switch)
|
||||||
|
* 2. Get target pdev_id (set up during WMI ready) from lmac_id
|
||||||
|
*
|
||||||
|
* For MCL, return the offset-1 translated mac_id
|
||||||
|
*/
|
||||||
|
static inline int
|
||||||
|
dp_get_target_pdev_id_for_host_pdev_id
|
||||||
|
(struct dp_soc *soc, uint32_t mac_for_pdev)
|
||||||
|
{
|
||||||
|
struct dp_pdev *pdev;
|
||||||
|
|
||||||
|
if (!wlan_cfg_per_pdev_lmac_ring(soc->wlan_cfg_ctx))
|
||||||
|
return DP_SW2HW_MACID(mac_for_pdev);
|
||||||
|
|
||||||
|
pdev = soc->pdev_list[mac_for_pdev];
|
||||||
|
|
||||||
|
/*non-MCL case, get original target_pdev mapping*/
|
||||||
|
return wlan_cfg_get_target_pdev_id(soc->wlan_cfg_ctx, pdev->lmac_id);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* dp_get_host_pdev_id_for_target_pdev_id() - Return host pdev corresponding
|
||||||
|
* to target pdev id
|
||||||
|
* @soc: soc pointer
|
||||||
|
* @pdev_id: pdev_id corresponding to target pdev
|
||||||
|
*
|
||||||
|
* returns host pdev_id for target pdev id. For WIN, this is derived through
|
||||||
|
* a two step process:
|
||||||
|
* 1. Get lmac_id corresponding to target pdev_id
|
||||||
|
* 2. Get host pdev_id (set up during WMI ready) from lmac_id
|
||||||
|
*
|
||||||
|
* For MCL, return the 0-offset pdev_id
|
||||||
|
*/
|
||||||
|
static inline int
|
||||||
|
dp_get_host_pdev_id_for_target_pdev_id
|
||||||
|
(struct dp_soc *soc, uint32_t pdev_id)
|
||||||
|
{
|
||||||
|
struct dp_pdev *pdev;
|
||||||
|
int lmac_id;
|
||||||
|
|
||||||
|
if (!wlan_cfg_per_pdev_lmac_ring(soc->wlan_cfg_ctx))
|
||||||
|
return DP_HW2SW_MACID(pdev_id);
|
||||||
|
|
||||||
|
/*non-MCL case, get original target_lmac mapping from target pdev*/
|
||||||
|
lmac_id = wlan_cfg_get_hw_mac_idx(soc->wlan_cfg_ctx,
|
||||||
|
DP_HW2SW_MACID(pdev_id));
|
||||||
|
|
||||||
|
/*Get host pdev from lmac*/
|
||||||
|
pdev = dp_get_pdev_for_lmac_id(soc, lmac_id);
|
||||||
|
|
||||||
|
return pdev->pdev_id;
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* dp_get_mac_id_for_mac() - Return mac corresponding WIN and MCL mac_ids
|
* dp_get_mac_id_for_mac() - Return mac corresponding WIN and MCL mac_ids
|
||||||
*
|
*
|
||||||
|
@@ -340,24 +340,20 @@ uint32_t dp_soc_get_mon_mask_for_interrupt_mode(struct dp_soc *soc, int intr_ctx
|
|||||||
static void dp_service_mon_rings(void *arg)
|
static void dp_service_mon_rings(void *arg)
|
||||||
{
|
{
|
||||||
struct dp_soc *soc = (struct dp_soc *)arg;
|
struct dp_soc *soc = (struct dp_soc *)arg;
|
||||||
int ring = 0, work_done, mac_id;
|
int ring = 0, work_done;
|
||||||
struct dp_pdev *pdev = NULL;
|
struct dp_pdev *pdev = NULL;
|
||||||
|
|
||||||
for (ring = 0 ; ring < MAX_PDEV_CNT; ring++) {
|
for (ring = 0 ; ring < MAX_NUM_LMAC_HW; ring++) {
|
||||||
pdev = soc->pdev_list[ring];
|
pdev = dp_get_pdev_for_lmac_id(soc, ring);
|
||||||
if (!pdev)
|
if (!pdev)
|
||||||
continue;
|
continue;
|
||||||
for (mac_id = 0; mac_id < NUM_RXDMA_RINGS_PER_PDEV; mac_id++) {
|
work_done = dp_mon_process(soc, ring,
|
||||||
int mac_for_pdev = dp_get_mac_id_for_pdev(mac_id,
|
|
||||||
pdev->pdev_id);
|
|
||||||
work_done = dp_mon_process(soc, mac_for_pdev,
|
|
||||||
QCA_NAPI_BUDGET);
|
QCA_NAPI_BUDGET);
|
||||||
|
|
||||||
QDF_TRACE(QDF_MODULE_ID_DP, QDF_TRACE_LEVEL_DEBUG,
|
QDF_TRACE(QDF_MODULE_ID_DP, QDF_TRACE_LEVEL_DEBUG,
|
||||||
FL("Reaped %d descs from Monitor rings"),
|
FL("Reaped %d descs from Monitor rings"),
|
||||||
work_done);
|
work_done);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
qdf_timer_mod(&soc->mon_reap_timer, DP_INTR_POLL_TIMER_MS);
|
qdf_timer_mod(&soc->mon_reap_timer, DP_INTR_POLL_TIMER_MS);
|
||||||
}
|
}
|
||||||
@@ -486,37 +482,38 @@ uint32_t dp_soc_get_mon_mask_for_interrupt_mode(struct dp_soc *soc, int intr_ctx
|
|||||||
static void dp_service_lmac_rings(void *arg)
|
static void dp_service_lmac_rings(void *arg)
|
||||||
{
|
{
|
||||||
struct dp_soc *soc = (struct dp_soc *)arg;
|
struct dp_soc *soc = (struct dp_soc *)arg;
|
||||||
int ring = 0, mac_id, i;
|
int ring = 0, i;
|
||||||
struct dp_pdev *pdev = NULL;
|
struct dp_pdev *pdev = NULL;
|
||||||
union dp_rx_desc_list_elem_t *desc_list = NULL;
|
union dp_rx_desc_list_elem_t *desc_list = NULL;
|
||||||
union dp_rx_desc_list_elem_t *tail = NULL;
|
union dp_rx_desc_list_elem_t *tail = NULL;
|
||||||
|
|
||||||
/* Process LMAC interrupts */
|
/* Process LMAC interrupts */
|
||||||
for (ring = 0 ; ring < MAX_PDEV_CNT; ring++) {
|
for (ring = 0 ; ring < MAX_NUM_LMAC_HW; ring++) {
|
||||||
pdev = soc->pdev_list[ring];
|
int mac_for_pdev = ring;
|
||||||
|
struct dp_srng *rx_refill_buf_ring;
|
||||||
|
|
||||||
|
pdev = dp_get_pdev_for_lmac_id(soc, mac_for_pdev);
|
||||||
if (!pdev)
|
if (!pdev)
|
||||||
continue;
|
continue;
|
||||||
for (mac_id = 0; mac_id < NUM_RXDMA_RINGS_PER_PDEV; mac_id++) {
|
|
||||||
int mac_for_pdev = dp_get_mac_id_for_pdev(mac_id,
|
rx_refill_buf_ring = &soc->rx_refill_buf_ring[mac_for_pdev];
|
||||||
pdev->pdev_id);
|
|
||||||
struct dp_srng *rx_refill_buf_ring =
|
|
||||||
&pdev->rx_refill_buf_ring;
|
|
||||||
|
|
||||||
dp_mon_process(soc, mac_for_pdev,
|
dp_mon_process(soc, mac_for_pdev,
|
||||||
QCA_NAPI_BUDGET);
|
QCA_NAPI_BUDGET);
|
||||||
|
|
||||||
for (i = 0; i < wlan_cfg_get_num_contexts(soc->wlan_cfg_ctx); i++)
|
for (i = 0;
|
||||||
|
i < wlan_cfg_get_num_contexts(soc->wlan_cfg_ctx); i++)
|
||||||
dp_rxdma_err_process(&soc->intr_ctx[i], soc,
|
dp_rxdma_err_process(&soc->intr_ctx[i], soc,
|
||||||
mac_for_pdev,
|
mac_for_pdev,
|
||||||
QCA_NAPI_BUDGET);
|
QCA_NAPI_BUDGET);
|
||||||
|
|
||||||
if (!dp_soc_ring_if_nss_offloaded(soc, RXDMA_BUF, mac_id))
|
if (!dp_soc_ring_if_nss_offloaded(soc, RXDMA_BUF,
|
||||||
|
mac_for_pdev))
|
||||||
dp_rx_buffers_replenish(soc, mac_for_pdev,
|
dp_rx_buffers_replenish(soc, mac_for_pdev,
|
||||||
rx_refill_buf_ring,
|
rx_refill_buf_ring,
|
||||||
&soc->rx_desc_buf[mac_for_pdev],
|
&soc->rx_desc_buf[mac_for_pdev],
|
||||||
0, &desc_list, &tail);
|
0, &desc_list, &tail);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
qdf_timer_mod(&soc->lmac_reap_timer, DP_INTR_POLL_TIMER_MS);
|
qdf_timer_mod(&soc->lmac_reap_timer, DP_INTR_POLL_TIMER_MS);
|
||||||
}
|
}
|
||||||
@@ -1513,7 +1510,6 @@ static uint32_t dp_service_srngs(void *dp_ctx, uint32_t dp_budget)
|
|||||||
uint8_t reo_status_mask = int_ctx->reo_status_ring_mask;
|
uint8_t reo_status_mask = int_ctx->reo_status_ring_mask;
|
||||||
uint32_t remaining_quota = dp_budget;
|
uint32_t remaining_quota = dp_budget;
|
||||||
struct dp_pdev *pdev = NULL;
|
struct dp_pdev *pdev = NULL;
|
||||||
int mac_id;
|
|
||||||
|
|
||||||
dp_verbose_debug("tx %x rx %x rx_err %x rx_wbm_rel %x reo_status %x rx_mon_ring %x host2rxdma %x rxdma2host %x\n",
|
dp_verbose_debug("tx %x rx %x rx_err %x rx_wbm_rel %x reo_status %x rx_mon_ring %x host2rxdma %x rxdma2host %x\n",
|
||||||
tx_mask, rx_mask, rx_err_mask, rx_wbm_rel_mask,
|
tx_mask, rx_mask, rx_err_mask, rx_wbm_rel_mask,
|
||||||
@@ -1613,13 +1609,12 @@ static uint32_t dp_service_srngs(void *dp_ctx, uint32_t dp_budget)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* Process LMAC interrupts */
|
/* Process LMAC interrupts */
|
||||||
for (ring = 0 ; ring < MAX_PDEV_CNT; ring++) {
|
for (ring = 0 ; ring < MAX_NUM_LMAC_HW; ring++) {
|
||||||
pdev = soc->pdev_list[ring];
|
int mac_for_pdev = ring;
|
||||||
|
|
||||||
|
pdev = dp_get_pdev_for_lmac_id(soc, mac_for_pdev);
|
||||||
if (!pdev)
|
if (!pdev)
|
||||||
continue;
|
continue;
|
||||||
for (mac_id = 0; mac_id < NUM_RXDMA_RINGS_PER_PDEV; mac_id++) {
|
|
||||||
int mac_for_pdev = dp_get_mac_id_for_pdev(mac_id,
|
|
||||||
pdev->pdev_id);
|
|
||||||
if (int_ctx->rx_mon_ring_mask & (1 << mac_for_pdev)) {
|
if (int_ctx->rx_mon_ring_mask & (1 << mac_for_pdev)) {
|
||||||
work_done = dp_mon_process(soc, mac_for_pdev,
|
work_done = dp_mon_process(soc, mac_for_pdev,
|
||||||
remaining_quota);
|
remaining_quota);
|
||||||
@@ -1649,7 +1644,7 @@ static uint32_t dp_service_srngs(void *dp_ctx, uint32_t dp_budget)
|
|||||||
union dp_rx_desc_list_elem_t *desc_list = NULL;
|
union dp_rx_desc_list_elem_t *desc_list = NULL;
|
||||||
union dp_rx_desc_list_elem_t *tail = NULL;
|
union dp_rx_desc_list_elem_t *tail = NULL;
|
||||||
struct dp_srng *rx_refill_buf_ring =
|
struct dp_srng *rx_refill_buf_ring =
|
||||||
&pdev->rx_refill_buf_ring;
|
&soc->rx_refill_buf_ring[mac_for_pdev];
|
||||||
|
|
||||||
intr_stats->num_host2rxdma_ring_masks++;
|
intr_stats->num_host2rxdma_ring_masks++;
|
||||||
DP_STATS_INC(pdev, replenish.low_thresh_intrs,
|
DP_STATS_INC(pdev, replenish.low_thresh_intrs,
|
||||||
@@ -1658,7 +1653,7 @@ static uint32_t dp_service_srngs(void *dp_ctx, uint32_t dp_budget)
|
|||||||
rx_refill_buf_ring,
|
rx_refill_buf_ring,
|
||||||
&soc->rx_desc_buf[mac_for_pdev],
|
&soc->rx_desc_buf[mac_for_pdev],
|
||||||
0, &desc_list, &tail);
|
0, &desc_list, &tail);
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1849,29 +1844,24 @@ static void dp_soc_interrupt_map_calculate_integrated(struct dp_soc *soc,
|
|||||||
|
|
||||||
if (rxdma2host_ring_mask & (1 << j)) {
|
if (rxdma2host_ring_mask & (1 << j)) {
|
||||||
irq_id_map[num_irq++] =
|
irq_id_map[num_irq++] =
|
||||||
rxdma2host_destination_ring_mac1 -
|
rxdma2host_destination_ring_mac1 - j;
|
||||||
wlan_cfg_get_hw_mac_idx(soc->wlan_cfg_ctx, j);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (host2rxdma_ring_mask & (1 << j)) {
|
if (host2rxdma_ring_mask & (1 << j)) {
|
||||||
irq_id_map[num_irq++] =
|
irq_id_map[num_irq++] =
|
||||||
host2rxdma_host_buf_ring_mac1 -
|
host2rxdma_host_buf_ring_mac1 - j;
|
||||||
wlan_cfg_get_hw_mac_idx(soc->wlan_cfg_ctx, j);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (host2rxdma_mon_ring_mask & (1 << j)) {
|
if (host2rxdma_mon_ring_mask & (1 << j)) {
|
||||||
irq_id_map[num_irq++] =
|
irq_id_map[num_irq++] =
|
||||||
host2rxdma_monitor_ring1 -
|
host2rxdma_monitor_ring1 - j;
|
||||||
wlan_cfg_get_hw_mac_idx(soc->wlan_cfg_ctx, j);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (rx_mon_mask & (1 << j)) {
|
if (rx_mon_mask & (1 << j)) {
|
||||||
irq_id_map[num_irq++] =
|
irq_id_map[num_irq++] =
|
||||||
ppdu_end_interrupts_mac1 -
|
ppdu_end_interrupts_mac1 - j;
|
||||||
wlan_cfg_get_hw_mac_idx(soc->wlan_cfg_ctx, j);
|
|
||||||
irq_id_map[num_irq++] =
|
irq_id_map[num_irq++] =
|
||||||
rxdma2host_monitor_status_ring_mac1 -
|
rxdma2host_monitor_status_ring_mac1 - j;
|
||||||
wlan_cfg_get_hw_mac_idx(soc->wlan_cfg_ctx, j);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (rx_wbm_rel_ring_mask & (1 << j))
|
if (rx_wbm_rel_ring_mask & (1 << j))
|
||||||
@@ -3009,11 +2999,9 @@ static int dp_soc_cmn_setup(struct dp_soc *soc)
|
|||||||
entries = wlan_cfg_get_dp_soc_rxdma_err_dst_ring_size(soc_cfg_ctx);
|
entries = wlan_cfg_get_dp_soc_rxdma_err_dst_ring_size(soc_cfg_ctx);
|
||||||
/* LMAC RxDMA to SW Rings configuration */
|
/* LMAC RxDMA to SW Rings configuration */
|
||||||
if (!wlan_cfg_per_pdev_lmac_ring(soc_cfg_ctx)) {
|
if (!wlan_cfg_per_pdev_lmac_ring(soc_cfg_ctx)) {
|
||||||
/* Only valid for MCL */
|
|
||||||
struct dp_pdev *pdev = soc->pdev_list[0];
|
|
||||||
|
|
||||||
for (i = 0; i < MAX_RX_MAC_RINGS; i++) {
|
for (i = 0; i < MAX_RX_MAC_RINGS; i++) {
|
||||||
if (dp_srng_setup(soc, &pdev->rxdma_err_dst_ring[i],
|
if (dp_srng_setup(soc, &soc->rxdma_err_dst_ring[i],
|
||||||
RXDMA_DST, 0, i, entries, 0)) {
|
RXDMA_DST, 0, i, entries, 0)) {
|
||||||
QDF_TRACE(QDF_MODULE_ID_DP,
|
QDF_TRACE(QDF_MODULE_ID_DP,
|
||||||
QDF_TRACE_LEVEL_ERROR,
|
QDF_TRACE_LEVEL_ERROR,
|
||||||
@@ -3394,14 +3382,14 @@ QDF_STATUS dp_mon_rings_setup(struct dp_soc *soc, struct dp_pdev *pdev)
|
|||||||
pdev_cfg_ctx = pdev->wlan_cfg_ctx;
|
pdev_cfg_ctx = pdev->wlan_cfg_ctx;
|
||||||
|
|
||||||
for (mac_id = 0; mac_id < NUM_RXDMA_RINGS_PER_PDEV; mac_id++) {
|
for (mac_id = 0; mac_id < NUM_RXDMA_RINGS_PER_PDEV; mac_id++) {
|
||||||
int mac_for_pdev = dp_get_mac_id_for_pdev(mac_id, pdev_id);
|
int lmac_id = dp_get_lmac_id_for_pdev_id(soc, mac_id, pdev_id);
|
||||||
|
|
||||||
if (soc->wlan_cfg_ctx->rxdma1_enable) {
|
if (soc->wlan_cfg_ctx->rxdma1_enable) {
|
||||||
entries =
|
entries =
|
||||||
wlan_cfg_get_dma_mon_buf_ring_size(pdev_cfg_ctx);
|
wlan_cfg_get_dma_mon_buf_ring_size(pdev_cfg_ctx);
|
||||||
if (dp_srng_setup(soc,
|
if (dp_srng_setup(soc,
|
||||||
&pdev->rxdma_mon_buf_ring[mac_id],
|
&soc->rxdma_mon_buf_ring[lmac_id],
|
||||||
RXDMA_MONITOR_BUF, 0, mac_for_pdev,
|
RXDMA_MONITOR_BUF, 0, lmac_id,
|
||||||
entries, 0)) {
|
entries, 0)) {
|
||||||
QDF_TRACE(QDF_MODULE_ID_DP,
|
QDF_TRACE(QDF_MODULE_ID_DP,
|
||||||
QDF_TRACE_LEVEL_ERROR,
|
QDF_TRACE_LEVEL_ERROR,
|
||||||
@@ -3412,8 +3400,8 @@ QDF_STATUS dp_mon_rings_setup(struct dp_soc *soc, struct dp_pdev *pdev)
|
|||||||
entries =
|
entries =
|
||||||
wlan_cfg_get_dma_mon_dest_ring_size(pdev_cfg_ctx);
|
wlan_cfg_get_dma_mon_dest_ring_size(pdev_cfg_ctx);
|
||||||
if (dp_srng_setup(soc,
|
if (dp_srng_setup(soc,
|
||||||
&pdev->rxdma_mon_dst_ring[mac_id],
|
&soc->rxdma_mon_dst_ring[lmac_id],
|
||||||
RXDMA_MONITOR_DST, 0, mac_for_pdev,
|
RXDMA_MONITOR_DST, 0, lmac_id,
|
||||||
entries, 0)) {
|
entries, 0)) {
|
||||||
QDF_TRACE(QDF_MODULE_ID_DP,
|
QDF_TRACE(QDF_MODULE_ID_DP,
|
||||||
QDF_TRACE_LEVEL_ERROR,
|
QDF_TRACE_LEVEL_ERROR,
|
||||||
@@ -3424,8 +3412,8 @@ QDF_STATUS dp_mon_rings_setup(struct dp_soc *soc, struct dp_pdev *pdev)
|
|||||||
entries =
|
entries =
|
||||||
wlan_cfg_get_dma_mon_stat_ring_size(pdev_cfg_ctx);
|
wlan_cfg_get_dma_mon_stat_ring_size(pdev_cfg_ctx);
|
||||||
if (dp_srng_setup(soc,
|
if (dp_srng_setup(soc,
|
||||||
&pdev->rxdma_mon_status_ring[mac_id],
|
&soc->rxdma_mon_status_ring[lmac_id],
|
||||||
RXDMA_MONITOR_STATUS, 0, mac_for_pdev,
|
RXDMA_MONITOR_STATUS, 0, lmac_id,
|
||||||
entries, 0)) {
|
entries, 0)) {
|
||||||
QDF_TRACE(QDF_MODULE_ID_DP,
|
QDF_TRACE(QDF_MODULE_ID_DP,
|
||||||
QDF_TRACE_LEVEL_ERROR,
|
QDF_TRACE_LEVEL_ERROR,
|
||||||
@@ -3436,8 +3424,8 @@ QDF_STATUS dp_mon_rings_setup(struct dp_soc *soc, struct dp_pdev *pdev)
|
|||||||
entries =
|
entries =
|
||||||
wlan_cfg_get_dma_mon_desc_ring_size(pdev_cfg_ctx);
|
wlan_cfg_get_dma_mon_desc_ring_size(pdev_cfg_ctx);
|
||||||
if (dp_srng_setup(soc,
|
if (dp_srng_setup(soc,
|
||||||
&pdev->rxdma_mon_desc_ring[mac_id],
|
&soc->rxdma_mon_desc_ring[lmac_id],
|
||||||
RXDMA_MONITOR_DESC, 0, mac_for_pdev,
|
RXDMA_MONITOR_DESC, 0, lmac_id,
|
||||||
entries, 0)) {
|
entries, 0)) {
|
||||||
QDF_TRACE(QDF_MODULE_ID_DP,
|
QDF_TRACE(QDF_MODULE_ID_DP,
|
||||||
QDF_TRACE_LEVEL_ERROR,
|
QDF_TRACE_LEVEL_ERROR,
|
||||||
@@ -3448,8 +3436,8 @@ QDF_STATUS dp_mon_rings_setup(struct dp_soc *soc, struct dp_pdev *pdev)
|
|||||||
entries =
|
entries =
|
||||||
wlan_cfg_get_dma_mon_stat_ring_size(pdev_cfg_ctx);
|
wlan_cfg_get_dma_mon_stat_ring_size(pdev_cfg_ctx);
|
||||||
if (dp_srng_setup(soc,
|
if (dp_srng_setup(soc,
|
||||||
&pdev->rxdma_mon_status_ring[mac_id],
|
&soc->rxdma_mon_status_ring[lmac_id],
|
||||||
RXDMA_MONITOR_STATUS, 0, mac_for_pdev,
|
RXDMA_MONITOR_STATUS, 0, lmac_id,
|
||||||
entries, 0)) {
|
entries, 0)) {
|
||||||
QDF_TRACE(QDF_MODULE_ID_DP,
|
QDF_TRACE(QDF_MODULE_ID_DP,
|
||||||
QDF_TRACE_LEVEL_ERROR,
|
QDF_TRACE_LEVEL_ERROR,
|
||||||
@@ -3651,8 +3639,8 @@ static struct cdp_pdev *dp_pdev_attach_wifi3(struct cdp_soc_t *txrx_soc,
|
|||||||
ring_size =
|
ring_size =
|
||||||
wlan_cfg_get_dp_soc_rxdma_refill_ring_size(soc->wlan_cfg_ctx);
|
wlan_cfg_get_dp_soc_rxdma_refill_ring_size(soc->wlan_cfg_ctx);
|
||||||
|
|
||||||
if (dp_srng_setup(soc, &pdev->rx_refill_buf_ring, RXDMA_BUF, 0, pdev_id,
|
if (dp_srng_setup(soc, &soc->rx_refill_buf_ring[pdev->lmac_id],
|
||||||
ring_size, 0)) {
|
RXDMA_BUF, 0, pdev->lmac_id, ring_size, 0)) {
|
||||||
QDF_TRACE(QDF_MODULE_ID_DP, QDF_TRACE_LEVEL_ERROR,
|
QDF_TRACE(QDF_MODULE_ID_DP, QDF_TRACE_LEVEL_ERROR,
|
||||||
FL("dp_srng_setup failed rx refill ring"));
|
FL("dp_srng_setup failed rx refill ring"));
|
||||||
goto fail1;
|
goto fail1;
|
||||||
@@ -3672,8 +3660,10 @@ static struct cdp_pdev *dp_pdev_attach_wifi3(struct cdp_soc_t *txrx_soc,
|
|||||||
|
|
||||||
entries = wlan_cfg_get_dp_soc_rxdma_err_dst_ring_size(soc_cfg_ctx);
|
entries = wlan_cfg_get_dp_soc_rxdma_err_dst_ring_size(soc_cfg_ctx);
|
||||||
if (wlan_cfg_per_pdev_lmac_ring(soc->wlan_cfg_ctx)) {
|
if (wlan_cfg_per_pdev_lmac_ring(soc->wlan_cfg_ctx)) {
|
||||||
if (dp_srng_setup(soc, &pdev->rxdma_err_dst_ring[0], RXDMA_DST,
|
if (dp_srng_setup(soc,
|
||||||
0, pdev_id, entries, 0)) {
|
&soc->rxdma_err_dst_ring[pdev->lmac_id],
|
||||||
|
RXDMA_DST,
|
||||||
|
0, pdev->lmac_id, entries, 0)) {
|
||||||
QDF_TRACE(QDF_MODULE_ID_DP, QDF_TRACE_LEVEL_ERROR,
|
QDF_TRACE(QDF_MODULE_ID_DP, QDF_TRACE_LEVEL_ERROR,
|
||||||
FL(RNG_ERR "rxdma_err_dst_ring"));
|
FL(RNG_ERR "rxdma_err_dst_ring"));
|
||||||
goto fail1;
|
goto fail1;
|
||||||
@@ -3873,31 +3863,31 @@ void dp_mon_ring_cleanup(struct dp_soc *soc, struct dp_pdev *pdev,
|
|||||||
{
|
{
|
||||||
if (soc->wlan_cfg_ctx->rxdma1_enable) {
|
if (soc->wlan_cfg_ctx->rxdma1_enable) {
|
||||||
dp_srng_cleanup(soc,
|
dp_srng_cleanup(soc,
|
||||||
&pdev->rxdma_mon_buf_ring[mac_id],
|
&soc->rxdma_mon_buf_ring[mac_id],
|
||||||
RXDMA_MONITOR_BUF, 0);
|
RXDMA_MONITOR_BUF, 0);
|
||||||
|
|
||||||
dp_srng_cleanup(soc,
|
dp_srng_cleanup(soc,
|
||||||
&pdev->rxdma_mon_dst_ring[mac_id],
|
&soc->rxdma_mon_dst_ring[mac_id],
|
||||||
RXDMA_MONITOR_DST, 0);
|
RXDMA_MONITOR_DST, 0);
|
||||||
|
|
||||||
dp_srng_cleanup(soc,
|
dp_srng_cleanup(soc,
|
||||||
&pdev->rxdma_mon_status_ring[mac_id],
|
&soc->rxdma_mon_status_ring[mac_id],
|
||||||
RXDMA_MONITOR_STATUS, 0);
|
RXDMA_MONITOR_STATUS, 0);
|
||||||
|
|
||||||
dp_srng_cleanup(soc,
|
dp_srng_cleanup(soc,
|
||||||
&pdev->rxdma_mon_desc_ring[mac_id],
|
&soc->rxdma_mon_desc_ring[mac_id],
|
||||||
RXDMA_MONITOR_DESC, 0);
|
RXDMA_MONITOR_DESC, 0);
|
||||||
|
|
||||||
dp_srng_cleanup(soc,
|
dp_srng_cleanup(soc,
|
||||||
&pdev->rxdma_err_dst_ring[mac_id],
|
&soc->rxdma_err_dst_ring[mac_id],
|
||||||
RXDMA_DST, 0);
|
RXDMA_DST, 0);
|
||||||
} else {
|
} else {
|
||||||
dp_srng_cleanup(soc,
|
dp_srng_cleanup(soc,
|
||||||
&pdev->rxdma_mon_status_ring[mac_id],
|
&soc->rxdma_mon_status_ring[mac_id],
|
||||||
RXDMA_MONITOR_STATUS, 0);
|
RXDMA_MONITOR_STATUS, 0);
|
||||||
|
|
||||||
dp_srng_cleanup(soc,
|
dp_srng_cleanup(soc,
|
||||||
&pdev->rxdma_err_dst_ring[mac_id],
|
&soc->rxdma_err_dst_ring[mac_id],
|
||||||
RXDMA_DST, 0);
|
RXDMA_DST, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -4039,13 +4029,18 @@ static void dp_pdev_deinit(struct cdp_pdev *txrx_pdev, int force)
|
|||||||
REO_DST, pdev->pdev_id);
|
REO_DST, pdev->pdev_id);
|
||||||
}
|
}
|
||||||
|
|
||||||
dp_srng_deinit(soc, &pdev->rx_refill_buf_ring, RXDMA_BUF, 0);
|
dp_srng_deinit(soc, &soc->rx_refill_buf_ring[pdev->lmac_id],
|
||||||
|
RXDMA_BUF, 0);
|
||||||
|
|
||||||
dp_rxdma_ring_cleanup(soc, pdev);
|
dp_rxdma_ring_cleanup(soc, pdev);
|
||||||
|
|
||||||
for (mac_id = 0; mac_id < NUM_RXDMA_RINGS_PER_PDEV; mac_id++) {
|
for (mac_id = 0; mac_id < NUM_RXDMA_RINGS_PER_PDEV; mac_id++) {
|
||||||
dp_mon_ring_deinit(soc, pdev, mac_id);
|
int lmac_id =
|
||||||
dp_srng_deinit(soc, &pdev->rxdma_err_dst_ring[mac_id],
|
dp_get_lmac_id_for_pdev_id(soc, pdev->pdev_id, mac_id);
|
||||||
|
|
||||||
|
dp_mon_ring_deinit(soc, pdev, lmac_id);
|
||||||
|
|
||||||
|
dp_srng_deinit(soc, &soc->rxdma_err_dst_ring[lmac_id],
|
||||||
RXDMA_DST, 0);
|
RXDMA_DST, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -4120,6 +4115,7 @@ static void dp_pdev_detach(struct cdp_pdev *txrx_pdev, int force)
|
|||||||
struct dp_soc *soc = pdev->soc;
|
struct dp_soc *soc = pdev->soc;
|
||||||
struct rx_desc_pool *rx_desc_pool;
|
struct rx_desc_pool *rx_desc_pool;
|
||||||
int mac_id, mac_for_pdev;
|
int mac_id, mac_for_pdev;
|
||||||
|
int lmac_id;
|
||||||
|
|
||||||
if (wlan_cfg_per_pdev_tx_ring(soc->wlan_cfg_ctx)) {
|
if (wlan_cfg_per_pdev_tx_ring(soc->wlan_cfg_ctx)) {
|
||||||
dp_srng_cleanup(soc, &soc->tcl_data_ring[pdev->pdev_id],
|
dp_srng_cleanup(soc, &soc->tcl_data_ring[pdev->pdev_id],
|
||||||
@@ -4138,15 +4134,20 @@ static void dp_pdev_detach(struct cdp_pdev *txrx_pdev, int force)
|
|||||||
dp_rxdma_ring_cleanup(soc, pdev);
|
dp_rxdma_ring_cleanup(soc, pdev);
|
||||||
wlan_cfg_pdev_detach(pdev->wlan_cfg_ctx);
|
wlan_cfg_pdev_detach(pdev->wlan_cfg_ctx);
|
||||||
|
|
||||||
dp_srng_cleanup(soc, &pdev->rx_refill_buf_ring, RXDMA_BUF, 0);
|
dp_srng_cleanup(soc, &soc->rx_refill_buf_ring[pdev->lmac_id],
|
||||||
|
RXDMA_BUF, 0);
|
||||||
dp_cleanup_ipa_rx_refill_buf_ring(soc, pdev);
|
dp_cleanup_ipa_rx_refill_buf_ring(soc, pdev);
|
||||||
|
|
||||||
for (mac_id = 0; mac_id < NUM_RXDMA_RINGS_PER_PDEV; mac_id++) {
|
for (mac_id = 0; mac_id < NUM_RXDMA_RINGS_PER_PDEV; mac_id++) {
|
||||||
dp_mon_ring_cleanup(soc, pdev, mac_id);
|
lmac_id =
|
||||||
dp_srng_cleanup(soc, &pdev->rxdma_err_dst_ring[mac_id],
|
dp_get_lmac_id_for_pdev_id(soc, mac_id, pdev->pdev_id);
|
||||||
|
dp_mon_ring_cleanup(soc, pdev, lmac_id);
|
||||||
|
dp_srng_cleanup(soc, &soc->rxdma_err_dst_ring[lmac_id],
|
||||||
RXDMA_DST, 0);
|
RXDMA_DST, 0);
|
||||||
|
|
||||||
if (dp_is_soc_reinit(soc)) {
|
if (dp_is_soc_reinit(soc)) {
|
||||||
mac_for_pdev = dp_get_mac_id_for_pdev(mac_id,
|
mac_for_pdev =
|
||||||
|
dp_get_lmac_id_for_pdev_id(soc, mac_id,
|
||||||
pdev->pdev_id);
|
pdev->pdev_id);
|
||||||
rx_desc_pool = &soc->rx_desc_status[mac_for_pdev];
|
rx_desc_pool = &soc->rx_desc_status[mac_for_pdev];
|
||||||
dp_rx_desc_pool_free(soc, rx_desc_pool);
|
dp_rx_desc_pool_free(soc, rx_desc_pool);
|
||||||
@@ -4465,7 +4466,7 @@ static QDF_STATUS dp_mon_htt_srng_setup(struct dp_soc *soc,
|
|||||||
|
|
||||||
if (soc->wlan_cfg_ctx->rxdma1_enable) {
|
if (soc->wlan_cfg_ctx->rxdma1_enable) {
|
||||||
status = htt_srng_setup(soc->htt_handle, mac_for_pdev,
|
status = htt_srng_setup(soc->htt_handle, mac_for_pdev,
|
||||||
pdev->rxdma_mon_buf_ring[mac_id]
|
soc->rxdma_mon_buf_ring[mac_id]
|
||||||
.hal_srng,
|
.hal_srng,
|
||||||
RXDMA_MONITOR_BUF);
|
RXDMA_MONITOR_BUF);
|
||||||
|
|
||||||
@@ -4475,7 +4476,7 @@ static QDF_STATUS dp_mon_htt_srng_setup(struct dp_soc *soc,
|
|||||||
}
|
}
|
||||||
|
|
||||||
status = htt_srng_setup(soc->htt_handle, mac_for_pdev,
|
status = htt_srng_setup(soc->htt_handle, mac_for_pdev,
|
||||||
pdev->rxdma_mon_dst_ring[mac_id]
|
soc->rxdma_mon_dst_ring[mac_id]
|
||||||
.hal_srng,
|
.hal_srng,
|
||||||
RXDMA_MONITOR_DST);
|
RXDMA_MONITOR_DST);
|
||||||
|
|
||||||
@@ -4485,7 +4486,7 @@ static QDF_STATUS dp_mon_htt_srng_setup(struct dp_soc *soc,
|
|||||||
}
|
}
|
||||||
|
|
||||||
status = htt_srng_setup(soc->htt_handle, mac_for_pdev,
|
status = htt_srng_setup(soc->htt_handle, mac_for_pdev,
|
||||||
pdev->rxdma_mon_status_ring[mac_id]
|
soc->rxdma_mon_status_ring[mac_id]
|
||||||
.hal_srng,
|
.hal_srng,
|
||||||
RXDMA_MONITOR_STATUS);
|
RXDMA_MONITOR_STATUS);
|
||||||
|
|
||||||
@@ -4495,7 +4496,7 @@ static QDF_STATUS dp_mon_htt_srng_setup(struct dp_soc *soc,
|
|||||||
}
|
}
|
||||||
|
|
||||||
status = htt_srng_setup(soc->htt_handle, mac_for_pdev,
|
status = htt_srng_setup(soc->htt_handle, mac_for_pdev,
|
||||||
pdev->rxdma_mon_desc_ring[mac_id]
|
soc->rxdma_mon_desc_ring[mac_id]
|
||||||
.hal_srng,
|
.hal_srng,
|
||||||
RXDMA_MONITOR_DESC);
|
RXDMA_MONITOR_DESC);
|
||||||
|
|
||||||
@@ -4505,7 +4506,7 @@ static QDF_STATUS dp_mon_htt_srng_setup(struct dp_soc *soc,
|
|||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
status = htt_srng_setup(soc->htt_handle, mac_for_pdev,
|
status = htt_srng_setup(soc->htt_handle, mac_for_pdev,
|
||||||
pdev->rxdma_mon_status_ring[mac_id]
|
soc->rxdma_mon_status_ring[mac_id]
|
||||||
.hal_srng,
|
.hal_srng,
|
||||||
RXDMA_MONITOR_STATUS);
|
RXDMA_MONITOR_STATUS);
|
||||||
|
|
||||||
@@ -4554,9 +4555,11 @@ static QDF_STATUS dp_rxdma_ring_config(struct dp_soc *soc)
|
|||||||
int max_mac_rings =
|
int max_mac_rings =
|
||||||
wlan_cfg_get_num_mac_rings
|
wlan_cfg_get_num_mac_rings
|
||||||
(pdev->wlan_cfg_ctx);
|
(pdev->wlan_cfg_ctx);
|
||||||
|
int lmac_id = dp_get_lmac_id_for_pdev_id(soc, 0, i);
|
||||||
|
|
||||||
htt_srng_setup(soc->htt_handle, 0,
|
htt_srng_setup(soc->htt_handle, 0,
|
||||||
pdev->rx_refill_buf_ring.hal_srng,
|
soc->rx_refill_buf_ring[lmac_id]
|
||||||
|
.hal_srng,
|
||||||
RXDMA_BUF);
|
RXDMA_BUF);
|
||||||
|
|
||||||
if (pdev->rx_refill_buf_ring2.hal_srng)
|
if (pdev->rx_refill_buf_ring2.hal_srng)
|
||||||
@@ -4589,9 +4592,17 @@ static QDF_STATUS dp_rxdma_ring_config(struct dp_soc *soc)
|
|||||||
pdev->pdev_id, max_mac_rings);
|
pdev->pdev_id, max_mac_rings);
|
||||||
|
|
||||||
for (mac_id = 0; mac_id < max_mac_rings; mac_id++) {
|
for (mac_id = 0; mac_id < max_mac_rings; mac_id++) {
|
||||||
int mac_for_pdev = dp_get_mac_id_for_pdev(
|
int mac_for_pdev =
|
||||||
mac_id, pdev->pdev_id);
|
dp_get_mac_id_for_pdev(mac_id,
|
||||||
|
pdev->pdev_id);
|
||||||
|
/*
|
||||||
|
* Obtain lmac id from pdev to access the LMAC
|
||||||
|
* ring in soc context
|
||||||
|
*/
|
||||||
|
lmac_id =
|
||||||
|
dp_get_lmac_id_for_pdev_id(soc,
|
||||||
|
mac_id,
|
||||||
|
pdev->pdev_id);
|
||||||
QDF_TRACE(QDF_MODULE_ID_TXRX,
|
QDF_TRACE(QDF_MODULE_ID_TXRX,
|
||||||
QDF_TRACE_LEVEL_ERROR,
|
QDF_TRACE_LEVEL_ERROR,
|
||||||
FL("mac_id %d"), mac_for_pdev);
|
FL("mac_id %d"), mac_for_pdev);
|
||||||
@@ -4601,13 +4612,13 @@ static QDF_STATUS dp_rxdma_ring_config(struct dp_soc *soc)
|
|||||||
.hal_srng,
|
.hal_srng,
|
||||||
RXDMA_BUF);
|
RXDMA_BUF);
|
||||||
htt_srng_setup(soc->htt_handle, mac_for_pdev,
|
htt_srng_setup(soc->htt_handle, mac_for_pdev,
|
||||||
pdev->rxdma_err_dst_ring[mac_id]
|
soc->rxdma_err_dst_ring[lmac_id]
|
||||||
.hal_srng,
|
.hal_srng,
|
||||||
RXDMA_DST);
|
RXDMA_DST);
|
||||||
|
|
||||||
/* Configure monitor mode rings */
|
/* Configure monitor mode rings */
|
||||||
status = dp_mon_htt_srng_setup(soc, pdev,
|
status = dp_mon_htt_srng_setup(soc, pdev,
|
||||||
mac_id,
|
lmac_id,
|
||||||
mac_for_pdev);
|
mac_for_pdev);
|
||||||
if (status != QDF_STATUS_SUCCESS) {
|
if (status != QDF_STATUS_SUCCESS) {
|
||||||
dp_err("Failed to send htt monitor messages to target");
|
dp_err("Failed to send htt monitor messages to target");
|
||||||
@@ -4633,8 +4644,9 @@ static QDF_STATUS dp_rxdma_ring_config(struct dp_soc *soc)
|
|||||||
static QDF_STATUS dp_rxdma_ring_config(struct dp_soc *soc)
|
static QDF_STATUS dp_rxdma_ring_config(struct dp_soc *soc)
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
int mac_id;
|
|
||||||
QDF_STATUS status = QDF_STATUS_SUCCESS;
|
QDF_STATUS status = QDF_STATUS_SUCCESS;
|
||||||
|
int mac_for_pdev;
|
||||||
|
int lmac_id;
|
||||||
|
|
||||||
for (i = 0; i < MAX_PDEV_CNT; i++) {
|
for (i = 0; i < MAX_PDEV_CNT; i++) {
|
||||||
struct dp_pdev *pdev = soc->pdev_list[i];
|
struct dp_pdev *pdev = soc->pdev_list[i];
|
||||||
@@ -4642,30 +4654,31 @@ static QDF_STATUS dp_rxdma_ring_config(struct dp_soc *soc)
|
|||||||
if (!pdev)
|
if (!pdev)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
for (mac_id = 0; mac_id < NUM_RXDMA_RINGS_PER_PDEV; mac_id++) {
|
mac_for_pdev = i;
|
||||||
int mac_for_pdev = dp_get_mac_id_for_pdev(mac_id, i);
|
lmac_id = dp_get_lmac_id_for_pdev_id(soc, 0, i);
|
||||||
|
|
||||||
htt_srng_setup(soc->htt_handle, mac_for_pdev,
|
htt_srng_setup(soc->htt_handle, mac_for_pdev,
|
||||||
pdev->rx_refill_buf_ring.hal_srng, RXDMA_BUF);
|
soc->rx_refill_buf_ring[lmac_id].
|
||||||
|
hal_srng, RXDMA_BUF);
|
||||||
#ifndef DISABLE_MON_CONFIG
|
#ifndef DISABLE_MON_CONFIG
|
||||||
|
|
||||||
htt_srng_setup(soc->htt_handle, mac_for_pdev,
|
htt_srng_setup(soc->htt_handle, mac_for_pdev,
|
||||||
pdev->rxdma_mon_buf_ring[mac_id].hal_srng,
|
soc->rxdma_mon_buf_ring[lmac_id].hal_srng,
|
||||||
RXDMA_MONITOR_BUF);
|
RXDMA_MONITOR_BUF);
|
||||||
htt_srng_setup(soc->htt_handle, mac_for_pdev,
|
htt_srng_setup(soc->htt_handle, mac_for_pdev,
|
||||||
pdev->rxdma_mon_dst_ring[mac_id].hal_srng,
|
soc->rxdma_mon_dst_ring[lmac_id].hal_srng,
|
||||||
RXDMA_MONITOR_DST);
|
RXDMA_MONITOR_DST);
|
||||||
htt_srng_setup(soc->htt_handle, mac_for_pdev,
|
htt_srng_setup(soc->htt_handle, mac_for_pdev,
|
||||||
pdev->rxdma_mon_status_ring[mac_id].hal_srng,
|
soc->rxdma_mon_status_ring[lmac_id].hal_srng,
|
||||||
RXDMA_MONITOR_STATUS);
|
RXDMA_MONITOR_STATUS);
|
||||||
htt_srng_setup(soc->htt_handle, mac_for_pdev,
|
htt_srng_setup(soc->htt_handle, mac_for_pdev,
|
||||||
pdev->rxdma_mon_desc_ring[mac_id].hal_srng,
|
soc->rxdma_mon_desc_ring[lmac_id].hal_srng,
|
||||||
RXDMA_MONITOR_DESC);
|
RXDMA_MONITOR_DESC);
|
||||||
#endif
|
#endif
|
||||||
htt_srng_setup(soc->htt_handle, mac_for_pdev,
|
htt_srng_setup(soc->htt_handle, mac_for_pdev,
|
||||||
pdev->rxdma_err_dst_ring[mac_id].hal_srng,
|
soc->rxdma_err_dst_ring[lmac_id].hal_srng,
|
||||||
RXDMA_DST);
|
RXDMA_DST);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
/* Configure LMAC rings in Polled mode */
|
/* Configure LMAC rings in Polled mode */
|
||||||
if (soc->lmac_polled_mode) {
|
if (soc->lmac_polled_mode) {
|
||||||
@@ -4742,11 +4755,19 @@ dp_rxdma_ring_sel_cfg(struct dp_soc *soc)
|
|||||||
continue;
|
continue;
|
||||||
|
|
||||||
for (mac_id = 0; mac_id < NUM_RXDMA_RINGS_PER_PDEV; mac_id++) {
|
for (mac_id = 0; mac_id < NUM_RXDMA_RINGS_PER_PDEV; mac_id++) {
|
||||||
int mac_for_pdev = dp_get_mac_id_for_pdev(mac_id,
|
int mac_for_pdev =
|
||||||
|
dp_get_mac_id_for_pdev(mac_id, pdev->pdev_id);
|
||||||
|
/*
|
||||||
|
* Obtain lmac id from pdev to access the LMAC ring
|
||||||
|
* in soc context
|
||||||
|
*/
|
||||||
|
int lmac_id =
|
||||||
|
dp_get_lmac_id_for_pdev_id(soc, mac_id,
|
||||||
pdev->pdev_id);
|
pdev->pdev_id);
|
||||||
|
|
||||||
htt_h2t_rx_ring_cfg(soc->htt_handle, mac_for_pdev,
|
htt_h2t_rx_ring_cfg(soc->htt_handle, mac_for_pdev,
|
||||||
pdev->rx_refill_buf_ring.hal_srng,
|
soc->rx_refill_buf_ring[lmac_id].
|
||||||
|
hal_srng,
|
||||||
RXDMA_BUF, RX_BUFFER_SIZE,
|
RXDMA_BUF, RX_BUFFER_SIZE,
|
||||||
&htt_tlv_filter);
|
&htt_tlv_filter);
|
||||||
}
|
}
|
||||||
@@ -6494,7 +6515,7 @@ static struct cdp_cfg *dp_get_ctrl_pdev_from_vdev_wifi3(
|
|||||||
* dp_monitor_mode_ring_config() - Send the tlv config to fw for monitor buffer
|
* dp_monitor_mode_ring_config() - Send the tlv config to fw for monitor buffer
|
||||||
* ring based on target
|
* ring based on target
|
||||||
* @soc: soc handle
|
* @soc: soc handle
|
||||||
* @mac_for_pdev: pdev_id
|
* @mac_for_pdev: WIN- pdev_id, MCL- mac id
|
||||||
* @pdev: physical device handle
|
* @pdev: physical device handle
|
||||||
* @ring_num: mac id
|
* @ring_num: mac id
|
||||||
* @htt_tlv_filter: tlv filter
|
* @htt_tlv_filter: tlv filter
|
||||||
@@ -6510,7 +6531,7 @@ QDF_STATUS dp_monitor_mode_ring_config(struct dp_soc *soc, uint8_t mac_for_pdev,
|
|||||||
|
|
||||||
if (soc->wlan_cfg_ctx->rxdma1_enable)
|
if (soc->wlan_cfg_ctx->rxdma1_enable)
|
||||||
status = htt_h2t_rx_ring_cfg(soc->htt_handle, mac_for_pdev,
|
status = htt_h2t_rx_ring_cfg(soc->htt_handle, mac_for_pdev,
|
||||||
pdev->rxdma_mon_buf_ring[ring_num]
|
soc->rxdma_mon_buf_ring[ring_num]
|
||||||
.hal_srng,
|
.hal_srng,
|
||||||
RXDMA_MONITOR_BUF, RX_BUFFER_SIZE,
|
RXDMA_MONITOR_BUF, RX_BUFFER_SIZE,
|
||||||
&htt_tlv_filter);
|
&htt_tlv_filter);
|
||||||
@@ -6555,9 +6576,13 @@ QDF_STATUS dp_reset_monitor_mode(struct cdp_pdev *pdev_handle)
|
|||||||
|
|
||||||
for (mac_id = 0; mac_id < NUM_RXDMA_RINGS_PER_PDEV; mac_id++) {
|
for (mac_id = 0; mac_id < NUM_RXDMA_RINGS_PER_PDEV; mac_id++) {
|
||||||
int mac_for_pdev = dp_get_mac_id_for_pdev(mac_id, pdev_id);
|
int mac_for_pdev = dp_get_mac_id_for_pdev(mac_id, pdev_id);
|
||||||
|
/*
|
||||||
|
* Obtain lmac id from pdev to access the ring in soc
|
||||||
|
* context
|
||||||
|
*/
|
||||||
|
int lmac_id = dp_get_lmac_id_for_pdev_id(soc, mac_id, pdev_id);
|
||||||
status = dp_monitor_mode_ring_config(soc, mac_for_pdev,
|
status = dp_monitor_mode_ring_config(soc, mac_for_pdev,
|
||||||
pdev, mac_id,
|
pdev, lmac_id,
|
||||||
htt_tlv_filter);
|
htt_tlv_filter);
|
||||||
|
|
||||||
if (status != QDF_STATUS_SUCCESS) {
|
if (status != QDF_STATUS_SUCCESS) {
|
||||||
@@ -6567,7 +6592,8 @@ QDF_STATUS dp_reset_monitor_mode(struct cdp_pdev *pdev_handle)
|
|||||||
}
|
}
|
||||||
|
|
||||||
htt_h2t_rx_ring_cfg(soc->htt_handle, mac_for_pdev,
|
htt_h2t_rx_ring_cfg(soc->htt_handle, mac_for_pdev,
|
||||||
pdev->rxdma_mon_status_ring[mac_id].hal_srng,
|
soc->rxdma_mon_status_ring[lmac_id]
|
||||||
|
.hal_srng,
|
||||||
RXDMA_MONITOR_STATUS, RX_BUFFER_SIZE,
|
RXDMA_MONITOR_STATUS, RX_BUFFER_SIZE,
|
||||||
&htt_tlv_filter);
|
&htt_tlv_filter);
|
||||||
}
|
}
|
||||||
@@ -6719,9 +6745,14 @@ QDF_STATUS dp_pdev_configure_monitor_rings(struct dp_pdev *pdev)
|
|||||||
|
|
||||||
for (mac_id = 0; mac_id < NUM_RXDMA_RINGS_PER_PDEV; mac_id++) {
|
for (mac_id = 0; mac_id < NUM_RXDMA_RINGS_PER_PDEV; mac_id++) {
|
||||||
int mac_for_pdev = dp_get_mac_id_for_pdev(mac_id, pdev_id);
|
int mac_for_pdev = dp_get_mac_id_for_pdev(mac_id, pdev_id);
|
||||||
|
/*
|
||||||
|
* Obtain lmac id from pdev to access the LMAC ring in soc
|
||||||
|
* context
|
||||||
|
*/
|
||||||
|
int lmac_id = dp_get_lmac_id_for_pdev_id(soc, mac_id, pdev_id);
|
||||||
|
|
||||||
status = dp_monitor_mode_ring_config(soc, mac_for_pdev,
|
status = dp_monitor_mode_ring_config(soc, mac_for_pdev,
|
||||||
pdev, mac_id,
|
pdev, lmac_id,
|
||||||
htt_tlv_filter);
|
htt_tlv_filter);
|
||||||
|
|
||||||
if (status != QDF_STATUS_SUCCESS) {
|
if (status != QDF_STATUS_SUCCESS) {
|
||||||
@@ -6778,8 +6809,13 @@ QDF_STATUS dp_pdev_configure_monitor_rings(struct dp_pdev *pdev)
|
|||||||
htt_tlv_filter.offset_valid = false;
|
htt_tlv_filter.offset_valid = false;
|
||||||
|
|
||||||
for (mac_id = 0; mac_id < NUM_RXDMA_RINGS_PER_PDEV; mac_id++) {
|
for (mac_id = 0; mac_id < NUM_RXDMA_RINGS_PER_PDEV; mac_id++) {
|
||||||
int mac_for_pdev = dp_get_mac_id_for_pdev(mac_id,
|
int mac_for_pdev = dp_get_mac_id_for_pdev(mac_id, pdev_id);
|
||||||
pdev->pdev_id);
|
/*
|
||||||
|
* Obtain lmac id from pdev to access the LMAC ring in soc
|
||||||
|
* context
|
||||||
|
*/
|
||||||
|
int lmac_id = dp_get_lmac_id_for_pdev_id(soc, mac_id, pdev_id);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* If two back to back HTT msg sending happened in
|
* If two back to back HTT msg sending happened in
|
||||||
* short time, the second HTT msg source SRNG HP
|
* short time, the second HTT msg source SRNG HP
|
||||||
@@ -6795,8 +6831,10 @@ QDF_STATUS dp_pdev_configure_monitor_rings(struct dp_pdev *pdev)
|
|||||||
qdf_udelay(100);
|
qdf_udelay(100);
|
||||||
|
|
||||||
htt_h2t_rx_ring_cfg(soc->htt_handle, mac_for_pdev,
|
htt_h2t_rx_ring_cfg(soc->htt_handle, mac_for_pdev,
|
||||||
pdev->rxdma_mon_status_ring[mac_id].hal_srng,
|
soc->rxdma_mon_status_ring[lmac_id]
|
||||||
RXDMA_MONITOR_STATUS, RX_BUFFER_SIZE, &htt_tlv_filter);
|
.hal_srng,
|
||||||
|
RXDMA_MONITOR_STATUS,
|
||||||
|
RX_BUFFER_SIZE, &htt_tlv_filter);
|
||||||
}
|
}
|
||||||
|
|
||||||
return status;
|
return status;
|
||||||
@@ -6906,9 +6944,14 @@ dp_pdev_set_advance_monitor_filter(struct cdp_pdev *pdev_handle,
|
|||||||
|
|
||||||
for (mac_id = 0; mac_id < NUM_RXDMA_RINGS_PER_PDEV; mac_id++) {
|
for (mac_id = 0; mac_id < NUM_RXDMA_RINGS_PER_PDEV; mac_id++) {
|
||||||
int mac_for_pdev = dp_get_mac_id_for_pdev(mac_id, pdev_id);
|
int mac_for_pdev = dp_get_mac_id_for_pdev(mac_id, pdev_id);
|
||||||
|
/*
|
||||||
|
* Obtain lmac id from pdev to access the LMAC ring in soc
|
||||||
|
* context
|
||||||
|
*/
|
||||||
|
int lmac_id = dp_get_lmac_id_for_pdev_id(soc, mac_id, pdev_id);
|
||||||
|
|
||||||
status = dp_monitor_mode_ring_config(soc, mac_for_pdev,
|
status = dp_monitor_mode_ring_config(soc, mac_for_pdev,
|
||||||
pdev, mac_id,
|
pdev, lmac_id,
|
||||||
htt_tlv_filter);
|
htt_tlv_filter);
|
||||||
|
|
||||||
if (status != QDF_STATUS_SUCCESS) {
|
if (status != QDF_STATUS_SUCCESS) {
|
||||||
@@ -6917,7 +6960,7 @@ dp_pdev_set_advance_monitor_filter(struct cdp_pdev *pdev_handle,
|
|||||||
}
|
}
|
||||||
|
|
||||||
htt_h2t_rx_ring_cfg(soc->htt_handle, mac_for_pdev,
|
htt_h2t_rx_ring_cfg(soc->htt_handle, mac_for_pdev,
|
||||||
pdev->rxdma_mon_status_ring[mac_id].hal_srng,
|
soc->rxdma_mon_status_ring[lmac_id].hal_srng,
|
||||||
RXDMA_MONITOR_STATUS, RX_BUFFER_SIZE, &htt_tlv_filter);
|
RXDMA_MONITOR_STATUS, RX_BUFFER_SIZE, &htt_tlv_filter);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -6952,9 +6995,14 @@ dp_pdev_set_advance_monitor_filter(struct cdp_pdev *pdev_handle,
|
|||||||
|
|
||||||
for (mac_id = 0; mac_id < NUM_RXDMA_RINGS_PER_PDEV; mac_id++) {
|
for (mac_id = 0; mac_id < NUM_RXDMA_RINGS_PER_PDEV; mac_id++) {
|
||||||
int mac_for_pdev = dp_get_mac_id_for_pdev(mac_id, pdev_id);
|
int mac_for_pdev = dp_get_mac_id_for_pdev(mac_id, pdev_id);
|
||||||
|
/*
|
||||||
|
* Obtain lmac id from pdev to access the LMAC ring in soc
|
||||||
|
* context
|
||||||
|
*/
|
||||||
|
int lmac_id = dp_get_lmac_id_for_pdev_id(soc, mac_id, pdev_id);
|
||||||
|
|
||||||
status = dp_monitor_mode_ring_config(soc, mac_for_pdev,
|
status = dp_monitor_mode_ring_config(soc, mac_for_pdev,
|
||||||
pdev, mac_id,
|
pdev, lmac_id,
|
||||||
htt_tlv_filter);
|
htt_tlv_filter);
|
||||||
|
|
||||||
if (status != QDF_STATUS_SUCCESS) {
|
if (status != QDF_STATUS_SUCCESS) {
|
||||||
@@ -6991,11 +7039,19 @@ dp_pdev_set_advance_monitor_filter(struct cdp_pdev *pdev_handle,
|
|||||||
htt_tlv_filter.offset_valid = false;
|
htt_tlv_filter.offset_valid = false;
|
||||||
|
|
||||||
for (mac_id = 0; mac_id < NUM_RXDMA_RINGS_PER_PDEV; mac_id++) {
|
for (mac_id = 0; mac_id < NUM_RXDMA_RINGS_PER_PDEV; mac_id++) {
|
||||||
int mac_for_pdev = dp_get_mac_id_for_pdev(mac_id,
|
int mac_for_pdev =
|
||||||
|
dp_get_mac_id_for_pdev(mac_id,
|
||||||
pdev->pdev_id);
|
pdev->pdev_id);
|
||||||
|
/*
|
||||||
|
* Obtain lmac id from pdev to access the LMAC ring in soc
|
||||||
|
* context
|
||||||
|
*/
|
||||||
|
int lmac_id =
|
||||||
|
dp_get_lmac_id_for_pdev_id(soc,
|
||||||
|
mac_id, pdev->pdev_id);
|
||||||
|
|
||||||
htt_h2t_rx_ring_cfg(soc->htt_handle, mac_for_pdev,
|
htt_h2t_rx_ring_cfg(soc->htt_handle, mac_for_pdev,
|
||||||
pdev->rxdma_mon_status_ring[mac_id].hal_srng,
|
soc->rxdma_mon_status_ring[lmac_id].hal_srng,
|
||||||
RXDMA_MONITOR_STATUS, RX_BUFFER_SIZE, &htt_tlv_filter);
|
RXDMA_MONITOR_STATUS, RX_BUFFER_SIZE, &htt_tlv_filter);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -7685,11 +7741,18 @@ dp_ppdu_ring_reset(struct dp_pdev *pdev)
|
|||||||
qdf_mem_zero(&(htt_tlv_filter), sizeof(htt_tlv_filter));
|
qdf_mem_zero(&(htt_tlv_filter), sizeof(htt_tlv_filter));
|
||||||
|
|
||||||
for (mac_id = 0; mac_id < NUM_RXDMA_RINGS_PER_PDEV; mac_id++) {
|
for (mac_id = 0; mac_id < NUM_RXDMA_RINGS_PER_PDEV; mac_id++) {
|
||||||
int mac_for_pdev = dp_get_mac_id_for_pdev(mac_id,
|
int mac_for_pdev =
|
||||||
pdev->pdev_id);
|
dp_get_mac_id_for_pdev(mac_id, pdev->pdev_id);
|
||||||
|
/*
|
||||||
|
* Obtain lmac id from pdev to access the LMAC ring in soc
|
||||||
|
* context
|
||||||
|
*/
|
||||||
|
int lmac_id =
|
||||||
|
dp_get_lmac_id_for_pdev_id(pdev->soc,
|
||||||
|
mac_id, pdev->pdev_id);
|
||||||
|
|
||||||
htt_h2t_rx_ring_cfg(pdev->soc->htt_handle, mac_for_pdev,
|
htt_h2t_rx_ring_cfg(pdev->soc->htt_handle, mac_for_pdev,
|
||||||
pdev->rxdma_mon_status_ring[mac_id].hal_srng,
|
pdev->soc->rxdma_mon_status_ring[lmac_id].hal_srng,
|
||||||
RXDMA_MONITOR_STATUS, RX_BUFFER_SIZE, &htt_tlv_filter);
|
RXDMA_MONITOR_STATUS, RX_BUFFER_SIZE, &htt_tlv_filter);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -7743,9 +7806,16 @@ dp_ppdu_ring_cfg(struct dp_pdev *pdev)
|
|||||||
for (mac_id = 0; mac_id < NUM_RXDMA_RINGS_PER_PDEV; mac_id++) {
|
for (mac_id = 0; mac_id < NUM_RXDMA_RINGS_PER_PDEV; mac_id++) {
|
||||||
int mac_for_pdev = dp_get_mac_id_for_pdev(mac_id,
|
int mac_for_pdev = dp_get_mac_id_for_pdev(mac_id,
|
||||||
pdev->pdev_id);
|
pdev->pdev_id);
|
||||||
|
/*
|
||||||
|
* Obtain lmac id from pdev to access the LMAC ring in soc
|
||||||
|
* context
|
||||||
|
*/
|
||||||
|
int lmac_id =
|
||||||
|
dp_get_lmac_id_for_pdev_id(pdev->soc,
|
||||||
|
mac_id, pdev->pdev_id);
|
||||||
|
|
||||||
htt_h2t_rx_ring_cfg(pdev->soc->htt_handle, mac_for_pdev,
|
htt_h2t_rx_ring_cfg(pdev->soc->htt_handle, mac_for_pdev,
|
||||||
pdev->rxdma_mon_status_ring[mac_id].hal_srng,
|
pdev->soc->rxdma_mon_status_ring[lmac_id].hal_srng,
|
||||||
RXDMA_MONITOR_STATUS, RX_BUFFER_SIZE, &htt_tlv_filter);
|
RXDMA_MONITOR_STATUS, RX_BUFFER_SIZE, &htt_tlv_filter);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -9072,24 +9142,48 @@ dp_soc_set_dp_txrx_handle(struct cdp_soc *soc_handle, void *txrx_handle)
|
|||||||
* @soc_hdl: datapath soc handle
|
* @soc_hdl: datapath soc handle
|
||||||
* @pdev_id: id of the datapath pdev handle
|
* @pdev_id: id of the datapath pdev handle
|
||||||
* @lmac_id: lmac id
|
* @lmac_id: lmac id
|
||||||
|
* @mode_change: flag to indicate a mode change
|
||||||
*
|
*
|
||||||
* Return: QDF_STATUS
|
* Return: QDF_STATUS
|
||||||
*/
|
*/
|
||||||
static QDF_STATUS
|
static QDF_STATUS
|
||||||
dp_soc_map_pdev_to_lmac(struct cdp_soc_t *soc_hdl, uint8_t pdev_id,
|
dp_soc_map_pdev_to_lmac
|
||||||
uint32_t lmac_id)
|
(struct cdp_soc_t *soc_hdl, uint8_t pdev_id,
|
||||||
|
uint32_t lmac_id, bool mode_change)
|
||||||
{
|
{
|
||||||
struct dp_soc *soc = (struct dp_soc *)soc_hdl;
|
struct dp_soc *soc = (struct dp_soc *)soc_hdl;
|
||||||
struct dp_pdev *pdev = dp_get_pdev_from_soc_pdev_id_wifi3(soc,
|
struct dp_pdev *pdev = dp_get_pdev_from_soc_pdev_id_wifi3(soc,
|
||||||
pdev_id);
|
pdev_id);
|
||||||
|
struct dp_vdev *vdev = NULL;
|
||||||
|
int hw_pdev_id;
|
||||||
|
|
||||||
if (qdf_unlikely(!pdev))
|
if (qdf_unlikely(!pdev))
|
||||||
return QDF_STATUS_E_FAILURE;
|
return QDF_STATUS_E_FAILURE;
|
||||||
|
|
||||||
pdev->lmac_id = lmac_id;
|
pdev->lmac_id = lmac_id;
|
||||||
wlan_cfg_set_hw_macid(soc->wlan_cfg_ctx,
|
dp_info(" mode change %d %d\n", pdev->pdev_id, pdev->lmac_id);
|
||||||
pdev_id,
|
|
||||||
(lmac_id + 1));
|
if (!mode_change) {
|
||||||
|
wlan_cfg_set_hw_mac_idx(soc->wlan_cfg_ctx,
|
||||||
|
pdev->pdev_id,
|
||||||
|
lmac_id);
|
||||||
|
}
|
||||||
|
|
||||||
|
/*Set host PDEV ID for lmac_id*/
|
||||||
|
wlan_cfg_set_pdev_idx(soc->wlan_cfg_ctx,
|
||||||
|
pdev->pdev_id,
|
||||||
|
lmac_id);
|
||||||
|
|
||||||
|
hw_pdev_id =
|
||||||
|
dp_get_target_pdev_id_for_host_pdev_id(soc,
|
||||||
|
pdev->pdev_id);
|
||||||
|
|
||||||
|
qdf_spin_lock_bh(&pdev->vdev_list_lock);
|
||||||
|
TAILQ_FOREACH(vdev, &pdev->vdev_list, vdev_list_elem) {
|
||||||
|
HTT_TX_TCL_METADATA_PDEV_ID_SET(vdev->htt_tcl_metadata,
|
||||||
|
hw_pdev_id);
|
||||||
|
}
|
||||||
|
qdf_spin_unlock_bh(&pdev->vdev_list_lock);
|
||||||
|
|
||||||
return QDF_STATUS_SUCCESS;
|
return QDF_STATUS_SUCCESS;
|
||||||
}
|
}
|
||||||
@@ -10934,13 +11028,22 @@ int dp_set_pktlog_wifi3(struct dp_pdev *pdev, uint32_t event,
|
|||||||
|
|
||||||
for (mac_id = 0; mac_id < max_mac_rings;
|
for (mac_id = 0; mac_id < max_mac_rings;
|
||||||
mac_id++) {
|
mac_id++) {
|
||||||
|
int pdev_id = pdev->pdev_id;
|
||||||
int mac_for_pdev =
|
int mac_for_pdev =
|
||||||
dp_get_mac_id_for_pdev(mac_id,
|
dp_get_mac_id_for_pdev(mac_id,
|
||||||
pdev->pdev_id);
|
pdev_id);
|
||||||
|
/*
|
||||||
|
* Obtain LMAC id from pdev for
|
||||||
|
* accessing LMAC ring from SOC
|
||||||
|
*/
|
||||||
|
int lmac_id =
|
||||||
|
dp_get_lmac_id_for_pdev_id(soc,
|
||||||
|
mac_id,
|
||||||
|
pdev_id);
|
||||||
|
|
||||||
htt_h2t_rx_ring_cfg(soc->htt_handle,
|
htt_h2t_rx_ring_cfg(soc->htt_handle,
|
||||||
mac_for_pdev,
|
mac_for_pdev,
|
||||||
pdev->rxdma_mon_status_ring[mac_id]
|
soc->rxdma_mon_status_ring[lmac_id]
|
||||||
.hal_srng,
|
.hal_srng,
|
||||||
RXDMA_MONITOR_STATUS,
|
RXDMA_MONITOR_STATUS,
|
||||||
RX_BUFFER_SIZE,
|
RX_BUFFER_SIZE,
|
||||||
@@ -10982,13 +11085,22 @@ int dp_set_pktlog_wifi3(struct dp_pdev *pdev, uint32_t event,
|
|||||||
|
|
||||||
for (mac_id = 0; mac_id < max_mac_rings;
|
for (mac_id = 0; mac_id < max_mac_rings;
|
||||||
mac_id++) {
|
mac_id++) {
|
||||||
|
int pdev_id = pdev->pdev_id;
|
||||||
int mac_for_pdev =
|
int mac_for_pdev =
|
||||||
dp_get_mac_id_for_pdev(mac_id,
|
dp_get_mac_id_for_pdev(mac_id,
|
||||||
pdev->pdev_id);
|
pdev_id);
|
||||||
|
/*
|
||||||
|
* Obtain lmac id from pdev to access
|
||||||
|
* the LMAC ring in soc context
|
||||||
|
*/
|
||||||
|
int lmac_id =
|
||||||
|
dp_get_lmac_id_for_pdev_id(soc,
|
||||||
|
mac_id,
|
||||||
|
pdev_id);
|
||||||
|
|
||||||
htt_h2t_rx_ring_cfg(soc->htt_handle,
|
htt_h2t_rx_ring_cfg(soc->htt_handle,
|
||||||
mac_for_pdev,
|
mac_for_pdev,
|
||||||
pdev->rxdma_mon_status_ring[mac_id]
|
soc->rxdma_mon_status_ring[lmac_id]
|
||||||
.hal_srng,
|
.hal_srng,
|
||||||
RXDMA_MONITOR_STATUS,
|
RXDMA_MONITOR_STATUS,
|
||||||
RX_BUFFER_SIZE_PKTLOG_LITE,
|
RX_BUFFER_SIZE_PKTLOG_LITE,
|
||||||
@@ -11039,13 +11151,22 @@ int dp_set_pktlog_wifi3(struct dp_pdev *pdev, uint32_t event,
|
|||||||
|
|
||||||
for (mac_id = 0; mac_id < max_mac_rings;
|
for (mac_id = 0; mac_id < max_mac_rings;
|
||||||
mac_id++) {
|
mac_id++) {
|
||||||
|
int pdev_id = pdev->pdev_id;
|
||||||
int mac_for_pdev =
|
int mac_for_pdev =
|
||||||
dp_get_mac_id_for_pdev(mac_id,
|
dp_get_mac_id_for_pdev(mac_id,
|
||||||
pdev->pdev_id);
|
pdev_id);
|
||||||
|
/*
|
||||||
|
* Obtain lmac id from pdev to access
|
||||||
|
* the LMAC ring in soc context
|
||||||
|
*/
|
||||||
|
int lmac_id =
|
||||||
|
dp_get_lmac_id_for_pdev_id(soc,
|
||||||
|
mac_id,
|
||||||
|
pdev_id);
|
||||||
|
|
||||||
htt_h2t_rx_ring_cfg(soc->htt_handle,
|
htt_h2t_rx_ring_cfg(soc->htt_handle,
|
||||||
mac_for_pdev,
|
mac_for_pdev,
|
||||||
pdev->rxdma_mon_status_ring[mac_id]
|
soc->rxdma_mon_status_ring[lmac_id]
|
||||||
.hal_srng,
|
.hal_srng,
|
||||||
RXDMA_MONITOR_STATUS,
|
RXDMA_MONITOR_STATUS,
|
||||||
RX_BUFFER_SIZE,
|
RX_BUFFER_SIZE,
|
||||||
|
@@ -114,7 +114,7 @@ QDF_STATUS dp_rx_buffers_replenish(struct dp_soc *dp_soc, uint32_t mac_id,
|
|||||||
{
|
{
|
||||||
uint32_t num_alloc_desc;
|
uint32_t num_alloc_desc;
|
||||||
uint16_t num_desc_to_free = 0;
|
uint16_t num_desc_to_free = 0;
|
||||||
struct dp_pdev *dp_pdev = dp_get_pdev_for_mac_id(dp_soc, mac_id);
|
struct dp_pdev *dp_pdev = dp_get_pdev_for_lmac_id(dp_soc, mac_id);
|
||||||
uint32_t num_entries_avail;
|
uint32_t num_entries_avail;
|
||||||
uint32_t count;
|
uint32_t count;
|
||||||
int sync_hw_ptr = 1;
|
int sync_hw_ptr = 1;
|
||||||
@@ -761,7 +761,7 @@ uint8_t dp_rx_process_invalid_peer(struct dp_soc *soc, qdf_nbuf_t mpdu,
|
|||||||
goto free;
|
goto free;
|
||||||
}
|
}
|
||||||
|
|
||||||
pdev = dp_get_pdev_for_mac_id(soc, mac_id);
|
pdev = dp_get_pdev_for_lmac_id(soc, mac_id);
|
||||||
|
|
||||||
if (!pdev || qdf_unlikely(pdev->is_pdev_down)) {
|
if (!pdev || qdf_unlikely(pdev->is_pdev_down)) {
|
||||||
QDF_TRACE(QDF_MODULE_ID_DP, QDF_TRACE_LEVEL_ERROR,
|
QDF_TRACE(QDF_MODULE_ID_DP, QDF_TRACE_LEVEL_ERROR,
|
||||||
@@ -863,7 +863,7 @@ uint8_t dp_rx_process_invalid_peer(struct dp_soc *soc, qdf_nbuf_t mpdu,
|
|||||||
goto free;
|
goto free;
|
||||||
}
|
}
|
||||||
|
|
||||||
pdev = dp_get_pdev_for_mac_id(soc, mac_id);
|
pdev = dp_get_pdev_for_lmac_id(soc, mac_id);
|
||||||
if (!pdev) {
|
if (!pdev) {
|
||||||
QDF_TRACE(QDF_MODULE_ID_DP,
|
QDF_TRACE(QDF_MODULE_ID_DP,
|
||||||
QDF_TRACE_LEVEL_ERROR,
|
QDF_TRACE_LEVEL_ERROR,
|
||||||
@@ -891,6 +891,13 @@ out:
|
|||||||
if (soc->cdp_soc.ol_ops->rx_invalid_peer)
|
if (soc->cdp_soc.ol_ops->rx_invalid_peer)
|
||||||
soc->cdp_soc.ol_ops->rx_invalid_peer(vdev->vdev_id, wh);
|
soc->cdp_soc.ol_ops->rx_invalid_peer(vdev->vdev_id, wh);
|
||||||
free:
|
free:
|
||||||
|
/* reset the head and tail pointers */
|
||||||
|
pdev = dp_get_pdev_for_lmac_id(soc, mac_id);
|
||||||
|
if (pdev) {
|
||||||
|
pdev->invalid_peer_head_msdu = NULL;
|
||||||
|
pdev->invalid_peer_tail_msdu = NULL;
|
||||||
|
}
|
||||||
|
|
||||||
/* Drop and free packet */
|
/* Drop and free packet */
|
||||||
curr_nbuf = mpdu;
|
curr_nbuf = mpdu;
|
||||||
while (curr_nbuf) {
|
while (curr_nbuf) {
|
||||||
@@ -1725,7 +1732,6 @@ uint32_t dp_rx_process(struct dp_intr *int_ctx, hal_ring_handle_t hal_ring_hdl,
|
|||||||
uint8_t *rx_tlv_hdr;
|
uint8_t *rx_tlv_hdr;
|
||||||
uint32_t rx_bufs_reaped[MAX_PDEV_CNT];
|
uint32_t rx_bufs_reaped[MAX_PDEV_CNT];
|
||||||
uint8_t mac_id = 0;
|
uint8_t mac_id = 0;
|
||||||
struct dp_pdev *pdev;
|
|
||||||
struct dp_pdev *rx_pdev;
|
struct dp_pdev *rx_pdev;
|
||||||
struct dp_srng *dp_rxdma_srng;
|
struct dp_srng *dp_rxdma_srng;
|
||||||
struct rx_desc_pool *rx_desc_pool;
|
struct rx_desc_pool *rx_desc_pool;
|
||||||
@@ -1960,8 +1966,8 @@ done:
|
|||||||
if (!rx_bufs_reaped[mac_id])
|
if (!rx_bufs_reaped[mac_id])
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
pdev = soc->pdev_list[mac_id];
|
dp_rxdma_srng = &soc->rx_refill_buf_ring[mac_id];
|
||||||
dp_rxdma_srng = &pdev->rx_refill_buf_ring;
|
|
||||||
rx_desc_pool = &soc->rx_desc_buf[mac_id];
|
rx_desc_pool = &soc->rx_desc_buf[mac_id];
|
||||||
|
|
||||||
dp_rx_buffers_replenish(soc, mac_id, dp_rxdma_srng,
|
dp_rx_buffers_replenish(soc, mac_id, dp_rxdma_srng,
|
||||||
@@ -2312,15 +2318,15 @@ QDF_STATUS dp_rx_vdev_detach(struct dp_vdev *vdev)
|
|||||||
void
|
void
|
||||||
dp_rx_pdev_detach(struct dp_pdev *pdev)
|
dp_rx_pdev_detach(struct dp_pdev *pdev)
|
||||||
{
|
{
|
||||||
uint8_t pdev_id = pdev->pdev_id;
|
uint8_t mac_for_pdev = pdev->lmac_id;
|
||||||
struct dp_soc *soc = pdev->soc;
|
struct dp_soc *soc = pdev->soc;
|
||||||
struct rx_desc_pool *rx_desc_pool;
|
struct rx_desc_pool *rx_desc_pool;
|
||||||
|
|
||||||
rx_desc_pool = &soc->rx_desc_buf[pdev_id];
|
rx_desc_pool = &soc->rx_desc_buf[mac_for_pdev];
|
||||||
|
|
||||||
if (rx_desc_pool->pool_size != 0) {
|
if (rx_desc_pool->pool_size != 0) {
|
||||||
if (!dp_is_soc_reinit(soc))
|
if (!dp_is_soc_reinit(soc))
|
||||||
dp_rx_desc_nbuf_and_pool_free(soc, pdev_id,
|
dp_rx_desc_nbuf_and_pool_free(soc, mac_for_pdev,
|
||||||
rx_desc_pool);
|
rx_desc_pool);
|
||||||
else
|
else
|
||||||
dp_rx_desc_nbuf_free(soc, rx_desc_pool);
|
dp_rx_desc_nbuf_free(soc, rx_desc_pool);
|
||||||
@@ -2375,7 +2381,7 @@ dp_pdev_rx_buffers_attach(struct dp_soc *dp_soc, uint32_t mac_id,
|
|||||||
struct rx_desc_pool *rx_desc_pool,
|
struct rx_desc_pool *rx_desc_pool,
|
||||||
uint32_t num_req_buffers)
|
uint32_t num_req_buffers)
|
||||||
{
|
{
|
||||||
struct dp_pdev *dp_pdev = dp_get_pdev_for_mac_id(dp_soc, mac_id);
|
struct dp_pdev *dp_pdev = dp_get_pdev_for_lmac_id(dp_soc, mac_id);
|
||||||
hal_ring_handle_t rxdma_srng = dp_rxdma_srng->hal_srng;
|
hal_ring_handle_t rxdma_srng = dp_rxdma_srng->hal_srng;
|
||||||
union dp_rx_desc_list_elem_t *next;
|
union dp_rx_desc_list_elem_t *next;
|
||||||
void *rxdma_ring_entry;
|
void *rxdma_ring_entry;
|
||||||
@@ -2513,7 +2519,7 @@ dp_rx_pdev_attach(struct dp_pdev *pdev)
|
|||||||
struct dp_srng *dp_rxdma_srng;
|
struct dp_srng *dp_rxdma_srng;
|
||||||
struct rx_desc_pool *rx_desc_pool;
|
struct rx_desc_pool *rx_desc_pool;
|
||||||
QDF_STATUS ret_val;
|
QDF_STATUS ret_val;
|
||||||
|
int mac_for_pdev;
|
||||||
|
|
||||||
if (wlan_cfg_get_dp_pdev_nss_enabled(pdev->wlan_cfg_ctx)) {
|
if (wlan_cfg_get_dp_pdev_nss_enabled(pdev->wlan_cfg_ctx)) {
|
||||||
QDF_TRACE(QDF_MODULE_ID_DP, QDF_TRACE_LEVEL_INFO,
|
QDF_TRACE(QDF_MODULE_ID_DP, QDF_TRACE_LEVEL_INFO,
|
||||||
@@ -2522,15 +2528,17 @@ dp_rx_pdev_attach(struct dp_pdev *pdev)
|
|||||||
}
|
}
|
||||||
|
|
||||||
pdev = soc->pdev_list[pdev_id];
|
pdev = soc->pdev_list[pdev_id];
|
||||||
dp_rxdma_srng = &pdev->rx_refill_buf_ring;
|
mac_for_pdev = pdev->lmac_id;
|
||||||
|
dp_rxdma_srng = &soc->rx_refill_buf_ring[mac_for_pdev];
|
||||||
|
|
||||||
rxdma_entries = dp_rxdma_srng->num_entries;
|
rxdma_entries = dp_rxdma_srng->num_entries;
|
||||||
|
|
||||||
soc->process_rx_status = CONFIG_PROCESS_RX_STATUS;
|
soc->process_rx_status = CONFIG_PROCESS_RX_STATUS;
|
||||||
|
|
||||||
rx_desc_pool = &soc->rx_desc_buf[pdev_id];
|
rx_desc_pool = &soc->rx_desc_buf[mac_for_pdev];
|
||||||
rx_sw_desc_weight = wlan_cfg_get_dp_soc_rx_sw_desc_weight(soc->wlan_cfg_ctx);
|
rx_sw_desc_weight = wlan_cfg_get_dp_soc_rx_sw_desc_weight(soc->wlan_cfg_ctx);
|
||||||
|
|
||||||
dp_rx_desc_pool_alloc(soc, pdev_id,
|
dp_rx_desc_pool_alloc(soc, mac_for_pdev,
|
||||||
rx_sw_desc_weight * rxdma_entries,
|
rx_sw_desc_weight * rxdma_entries,
|
||||||
rx_desc_pool);
|
rx_desc_pool);
|
||||||
|
|
||||||
@@ -2546,7 +2554,7 @@ dp_rx_pdev_attach(struct dp_pdev *pdev)
|
|||||||
return ret_val;
|
return ret_val;
|
||||||
}
|
}
|
||||||
|
|
||||||
return dp_pdev_rx_buffers_attach(soc, pdev_id, dp_rxdma_srng,
|
return dp_pdev_rx_buffers_attach(soc, mac_for_pdev, dp_rxdma_srng,
|
||||||
rx_desc_pool, rxdma_entries - 1);
|
rx_desc_pool, rxdma_entries - 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -730,15 +730,16 @@ void *dp_rx_cookie_2_mon_link_desc_va(struct dp_pdev *pdev,
|
|||||||
int mac_id)
|
int mac_id)
|
||||||
{
|
{
|
||||||
void *link_desc_va;
|
void *link_desc_va;
|
||||||
int mac_for_pdev = dp_get_mac_id_for_mac(pdev->soc, mac_id);
|
|
||||||
|
|
||||||
/* TODO */
|
/* TODO */
|
||||||
/* Add sanity for cookie */
|
/* Add sanity for cookie */
|
||||||
|
|
||||||
link_desc_va =
|
link_desc_va =
|
||||||
pdev->link_desc_banks[mac_for_pdev][buf_info->sw_cookie].base_vaddr +
|
pdev->soc->mon_link_desc_banks[mac_id][buf_info->sw_cookie]
|
||||||
|
.base_vaddr +
|
||||||
(buf_info->paddr -
|
(buf_info->paddr -
|
||||||
pdev->link_desc_banks[mac_for_pdev][buf_info->sw_cookie].base_paddr);
|
pdev->soc->mon_link_desc_banks[mac_id][buf_info->sw_cookie]
|
||||||
|
.base_paddr);
|
||||||
|
|
||||||
return link_desc_va;
|
return link_desc_va;
|
||||||
}
|
}
|
||||||
|
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2017-2019 The Linux Foundation. All rights reserved.
|
* Copyright (c) 2017-2020 The Linux Foundation. All rights reserved.
|
||||||
*
|
*
|
||||||
* Permission to use, copy, modify, and/or distribute this software for
|
* Permission to use, copy, modify, and/or distribute this software for
|
||||||
* any purpose with or without fee is hereby granted, provided that the
|
* any purpose with or without fee is hereby granted, provided that the
|
||||||
@@ -96,13 +96,15 @@ static void dp_rx_return_head_frag_desc(struct dp_peer *peer,
|
|||||||
struct rx_desc_pool *rx_desc_pool;
|
struct rx_desc_pool *rx_desc_pool;
|
||||||
union dp_rx_desc_list_elem_t *head = NULL;
|
union dp_rx_desc_list_elem_t *head = NULL;
|
||||||
union dp_rx_desc_list_elem_t *tail = NULL;
|
union dp_rx_desc_list_elem_t *tail = NULL;
|
||||||
|
uint8_t pool_id;
|
||||||
|
|
||||||
pdev = peer->vdev->pdev;
|
pdev = peer->vdev->pdev;
|
||||||
soc = pdev->soc;
|
soc = pdev->soc;
|
||||||
|
|
||||||
if (peer->rx_tid[tid].head_frag_desc) {
|
if (peer->rx_tid[tid].head_frag_desc) {
|
||||||
dp_rxdma_srng = &pdev->rx_refill_buf_ring;
|
pool_id = peer->rx_tid[tid].head_frag_desc->pool_id;
|
||||||
rx_desc_pool = &soc->rx_desc_buf[pdev->pdev_id];
|
dp_rxdma_srng = &soc->rx_refill_buf_ring[pool_id];
|
||||||
|
rx_desc_pool = &soc->rx_desc_buf[pool_id];
|
||||||
|
|
||||||
dp_rx_add_to_free_desc_list(&head, &tail,
|
dp_rx_add_to_free_desc_list(&head, &tail,
|
||||||
peer->rx_tid[tid].head_frag_desc);
|
peer->rx_tid[tid].head_frag_desc);
|
||||||
|
@@ -1303,7 +1303,7 @@ dp_rx_err_process(struct dp_intr *int_ctx, struct dp_soc *soc,
|
|||||||
reo_error[HAL_REO_ERR_PN_CHECK_FAILED],
|
reo_error[HAL_REO_ERR_PN_CHECK_FAILED],
|
||||||
1);
|
1);
|
||||||
/* increment @pdev level */
|
/* increment @pdev level */
|
||||||
dp_pdev = dp_get_pdev_for_mac_id(soc, mac_id);
|
dp_pdev = dp_get_pdev_for_lmac_id(soc, mac_id);
|
||||||
if (dp_pdev)
|
if (dp_pdev)
|
||||||
DP_STATS_INC(dp_pdev, err.reo_error, 1);
|
DP_STATS_INC(dp_pdev, err.reo_error, 1);
|
||||||
count = dp_rx_pn_error_handle(soc,
|
count = dp_rx_pn_error_handle(soc,
|
||||||
@@ -1322,7 +1322,7 @@ dp_rx_err_process(struct dp_intr *int_ctx, struct dp_soc *soc,
|
|||||||
reo_error[HAL_REO_ERR_REGULAR_FRAME_2K_JUMP],
|
reo_error[HAL_REO_ERR_REGULAR_FRAME_2K_JUMP],
|
||||||
1);
|
1);
|
||||||
/* increment @pdev level */
|
/* increment @pdev level */
|
||||||
dp_pdev = dp_get_pdev_for_mac_id(soc, mac_id);
|
dp_pdev = dp_get_pdev_for_lmac_id(soc, mac_id);
|
||||||
if (dp_pdev)
|
if (dp_pdev)
|
||||||
DP_STATS_INC(dp_pdev, err.reo_error, 1);
|
DP_STATS_INC(dp_pdev, err.reo_error, 1);
|
||||||
|
|
||||||
@@ -1348,8 +1348,8 @@ done:
|
|||||||
|
|
||||||
for (mac_id = 0; mac_id < MAX_PDEV_CNT; mac_id++) {
|
for (mac_id = 0; mac_id < MAX_PDEV_CNT; mac_id++) {
|
||||||
if (rx_bufs_reaped[mac_id]) {
|
if (rx_bufs_reaped[mac_id]) {
|
||||||
dp_pdev = soc->pdev_list[mac_id];
|
dp_pdev = dp_get_pdev_for_lmac_id(soc, mac_id);
|
||||||
dp_rxdma_srng = &dp_pdev->rx_refill_buf_ring;
|
dp_rxdma_srng = &soc->rx_refill_buf_ring[mac_id];
|
||||||
rx_desc_pool = &soc->rx_desc_buf[mac_id];
|
rx_desc_pool = &soc->rx_desc_buf[mac_id];
|
||||||
|
|
||||||
dp_rx_buffers_replenish(soc, mac_id, dp_rxdma_srng,
|
dp_rx_buffers_replenish(soc, mac_id, dp_rxdma_srng,
|
||||||
@@ -1489,8 +1489,8 @@ done:
|
|||||||
|
|
||||||
for (mac_id = 0; mac_id < MAX_PDEV_CNT; mac_id++) {
|
for (mac_id = 0; mac_id < MAX_PDEV_CNT; mac_id++) {
|
||||||
if (rx_bufs_reaped[mac_id]) {
|
if (rx_bufs_reaped[mac_id]) {
|
||||||
dp_pdev = soc->pdev_list[mac_id];
|
dp_pdev = dp_get_pdev_for_lmac_id(soc, mac_id);
|
||||||
dp_rxdma_srng = &dp_pdev->rx_refill_buf_ring;
|
dp_rxdma_srng = &soc->rx_refill_buf_ring[mac_id];
|
||||||
rx_desc_pool = &soc->rx_desc_buf[mac_id];
|
rx_desc_pool = &soc->rx_desc_buf[mac_id];
|
||||||
|
|
||||||
dp_rx_buffers_replenish(soc, mac_id, dp_rxdma_srng,
|
dp_rx_buffers_replenish(soc, mac_id, dp_rxdma_srng,
|
||||||
@@ -1537,7 +1537,7 @@ done:
|
|||||||
[wbm_err_info.reo_err_code], 1);
|
[wbm_err_info.reo_err_code], 1);
|
||||||
/* increment @pdev level */
|
/* increment @pdev level */
|
||||||
pool_id = wbm_err_info.pool_id;
|
pool_id = wbm_err_info.pool_id;
|
||||||
dp_pdev = dp_get_pdev_for_mac_id(soc, pool_id);
|
dp_pdev = dp_get_pdev_for_lmac_id(soc, pool_id);
|
||||||
if (dp_pdev)
|
if (dp_pdev)
|
||||||
DP_STATS_INC(dp_pdev, err.reo_error,
|
DP_STATS_INC(dp_pdev, err.reo_error,
|
||||||
1);
|
1);
|
||||||
@@ -1600,7 +1600,7 @@ done:
|
|||||||
[wbm_err_info.rxdma_err_code], 1);
|
[wbm_err_info.rxdma_err_code], 1);
|
||||||
/* increment @pdev level */
|
/* increment @pdev level */
|
||||||
pool_id = wbm_err_info.pool_id;
|
pool_id = wbm_err_info.pool_id;
|
||||||
dp_pdev = dp_get_pdev_for_mac_id(soc, pool_id);
|
dp_pdev = dp_get_pdev_for_lmac_id(soc, pool_id);
|
||||||
if (dp_pdev)
|
if (dp_pdev)
|
||||||
DP_STATS_INC(dp_pdev,
|
DP_STATS_INC(dp_pdev,
|
||||||
err.rxdma_error, 1);
|
err.rxdma_error, 1);
|
||||||
@@ -1728,7 +1728,7 @@ dp_rx_err_mpdu_pop(struct dp_soc *soc, uint32_t mac_id,
|
|||||||
uint8_t push_reason;
|
uint8_t push_reason;
|
||||||
uint8_t rxdma_error_code = 0;
|
uint8_t rxdma_error_code = 0;
|
||||||
uint8_t bm_action = HAL_BM_ACTION_PUT_IN_IDLE_LIST;
|
uint8_t bm_action = HAL_BM_ACTION_PUT_IN_IDLE_LIST;
|
||||||
struct dp_pdev *pdev = dp_get_pdev_for_mac_id(soc, mac_id);
|
struct dp_pdev *pdev = dp_get_pdev_for_lmac_id(soc, mac_id);
|
||||||
uint32_t rx_link_buf_info[HAL_RX_BUFFINFO_NUM_DWORDS];
|
uint32_t rx_link_buf_info[HAL_RX_BUFFINFO_NUM_DWORDS];
|
||||||
hal_rxdma_desc_t ring_desc;
|
hal_rxdma_desc_t ring_desc;
|
||||||
|
|
||||||
@@ -1843,8 +1843,7 @@ uint32_t
|
|||||||
dp_rxdma_err_process(struct dp_intr *int_ctx, struct dp_soc *soc,
|
dp_rxdma_err_process(struct dp_intr *int_ctx, struct dp_soc *soc,
|
||||||
uint32_t mac_id, uint32_t quota)
|
uint32_t mac_id, uint32_t quota)
|
||||||
{
|
{
|
||||||
struct dp_pdev *pdev = dp_get_pdev_for_mac_id(soc, mac_id);
|
struct dp_pdev *pdev = dp_get_pdev_for_lmac_id(soc, mac_id);
|
||||||
int mac_for_pdev = dp_get_mac_id_for_mac(soc, mac_id);
|
|
||||||
hal_rxdma_desc_t rxdma_dst_ring_desc;
|
hal_rxdma_desc_t rxdma_dst_ring_desc;
|
||||||
hal_soc_handle_t hal_soc;
|
hal_soc_handle_t hal_soc;
|
||||||
void *err_dst_srng;
|
void *err_dst_srng;
|
||||||
@@ -1858,7 +1857,7 @@ dp_rxdma_err_process(struct dp_intr *int_ctx, struct dp_soc *soc,
|
|||||||
if (!pdev)
|
if (!pdev)
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
err_dst_srng = pdev->rxdma_err_dst_ring[mac_for_pdev].hal_srng;
|
err_dst_srng = soc->rxdma_err_dst_ring[mac_id].hal_srng;
|
||||||
|
|
||||||
if (!err_dst_srng) {
|
if (!err_dst_srng) {
|
||||||
QDF_TRACE(QDF_MODULE_ID_DP, QDF_TRACE_LEVEL_ERROR,
|
QDF_TRACE(QDF_MODULE_ID_DP, QDF_TRACE_LEVEL_ERROR,
|
||||||
@@ -1891,7 +1890,7 @@ dp_rxdma_err_process(struct dp_intr *int_ctx, struct dp_soc *soc,
|
|||||||
dp_srng_access_end(int_ctx, soc, err_dst_srng);
|
dp_srng_access_end(int_ctx, soc, err_dst_srng);
|
||||||
|
|
||||||
if (rx_bufs_used) {
|
if (rx_bufs_used) {
|
||||||
dp_rxdma_srng = &pdev->rx_refill_buf_ring;
|
dp_rxdma_srng = &soc->rx_refill_buf_ring[mac_id];
|
||||||
rx_desc_pool = &soc->rx_desc_buf[mac_id];
|
rx_desc_pool = &soc->rx_desc_buf[mac_id];
|
||||||
|
|
||||||
dp_rx_buffers_replenish(soc, mac_id, dp_rxdma_srng,
|
dp_rx_buffers_replenish(soc, mac_id, dp_rxdma_srng,
|
||||||
@@ -2044,7 +2043,7 @@ dp_handle_wbm_internal_error(struct dp_soc *soc, void *hal_desc,
|
|||||||
|
|
||||||
DP_STATS_INC(soc, tx.wbm_internal_error[WBM_INT_ERROR_REO_BUFF_REAPED], 1);
|
DP_STATS_INC(soc, tx.wbm_internal_error[WBM_INT_ERROR_REO_BUFF_REAPED], 1);
|
||||||
dp_pdev = soc->pdev_list[pool_id];
|
dp_pdev = soc->pdev_list[pool_id];
|
||||||
dp_rxdma_srng = &dp_pdev->rx_refill_buf_ring;
|
dp_rxdma_srng = &soc->rx_refill_buf_ring[pool_id];
|
||||||
rx_desc_pool = &soc->rx_desc_buf[pool_id];
|
rx_desc_pool = &soc->rx_desc_buf[pool_id];
|
||||||
|
|
||||||
dp_rx_buffers_replenish(soc, pool_id, dp_rxdma_srng,
|
dp_rx_buffers_replenish(soc, pool_id, dp_rxdma_srng,
|
||||||
|
@@ -62,11 +62,10 @@ dp_rx_mon_link_desc_return(struct dp_pdev *dp_pdev,
|
|||||||
hal_soc_handle_t hal_soc;
|
hal_soc_handle_t hal_soc;
|
||||||
QDF_STATUS status = QDF_STATUS_E_FAILURE;
|
QDF_STATUS status = QDF_STATUS_E_FAILURE;
|
||||||
void *src_srng_desc;
|
void *src_srng_desc;
|
||||||
int mac_for_pdev = dp_get_mac_id_for_mac(dp_pdev->soc, mac_id);
|
|
||||||
|
|
||||||
hal_soc = dp_pdev->soc->hal_soc;
|
hal_soc = dp_pdev->soc->hal_soc;
|
||||||
|
|
||||||
dp_srng = &dp_pdev->rxdma_mon_desc_ring[mac_for_pdev];
|
dp_srng = &dp_pdev->soc->rxdma_mon_desc_ring[mac_id];
|
||||||
hal_ring_hdl = dp_srng->hal_srng;
|
hal_ring_hdl = dp_srng->hal_srng;
|
||||||
|
|
||||||
qdf_assert(hal_ring_hdl);
|
qdf_assert(hal_ring_hdl);
|
||||||
@@ -178,9 +177,9 @@ void *dp_rxdma_get_mon_dst_ring(struct dp_pdev *pdev,
|
|||||||
uint8_t mac_for_pdev)
|
uint8_t mac_for_pdev)
|
||||||
{
|
{
|
||||||
if (pdev->soc->wlan_cfg_ctx->rxdma1_enable)
|
if (pdev->soc->wlan_cfg_ctx->rxdma1_enable)
|
||||||
return pdev->rxdma_mon_dst_ring[mac_for_pdev].hal_srng;
|
return pdev->soc->rxdma_mon_dst_ring[mac_for_pdev].hal_srng;
|
||||||
|
|
||||||
return pdev->rxdma_err_dst_ring[mac_for_pdev].hal_srng;
|
return pdev->soc->rxdma_err_dst_ring[mac_for_pdev].hal_srng;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -196,9 +195,9 @@ struct dp_srng *dp_rxdma_get_mon_buf_ring(struct dp_pdev *pdev,
|
|||||||
uint8_t mac_for_pdev)
|
uint8_t mac_for_pdev)
|
||||||
{
|
{
|
||||||
if (pdev->soc->wlan_cfg_ctx->rxdma1_enable)
|
if (pdev->soc->wlan_cfg_ctx->rxdma1_enable)
|
||||||
return &pdev->rxdma_mon_buf_ring[mac_for_pdev];
|
return &pdev->soc->rxdma_mon_buf_ring[mac_for_pdev];
|
||||||
|
|
||||||
return &pdev->rx_refill_buf_ring;
|
return &pdev->soc->rx_refill_buf_ring[mac_for_pdev];
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -261,7 +260,7 @@ dp_rx_mon_mpdu_pop(struct dp_soc *soc, uint32_t mac_id,
|
|||||||
union dp_rx_desc_list_elem_t **head,
|
union dp_rx_desc_list_elem_t **head,
|
||||||
union dp_rx_desc_list_elem_t **tail)
|
union dp_rx_desc_list_elem_t **tail)
|
||||||
{
|
{
|
||||||
struct dp_pdev *dp_pdev = dp_get_pdev_for_mac_id(soc, mac_id);
|
struct dp_pdev *dp_pdev = dp_get_pdev_for_lmac_id(soc, mac_id);
|
||||||
void *rx_desc_tlv;
|
void *rx_desc_tlv;
|
||||||
void *rx_msdu_link_desc;
|
void *rx_msdu_link_desc;
|
||||||
qdf_nbuf_t msdu;
|
qdf_nbuf_t msdu;
|
||||||
@@ -557,7 +556,7 @@ qdf_nbuf_t dp_rx_mon_restitch_mpdu_from_msdus(struct dp_soc *soc,
|
|||||||
unsigned char *dest;
|
unsigned char *dest;
|
||||||
struct ieee80211_frame *wh;
|
struct ieee80211_frame *wh;
|
||||||
struct ieee80211_qoscntl *qos;
|
struct ieee80211_qoscntl *qos;
|
||||||
struct dp_pdev *dp_pdev = dp_get_pdev_for_mac_id(soc, mac_id);
|
struct dp_pdev *dp_pdev = dp_get_pdev_for_lmac_id(soc, mac_id);
|
||||||
head_frag_list = NULL;
|
head_frag_list = NULL;
|
||||||
mpdu_buf = NULL;
|
mpdu_buf = NULL;
|
||||||
|
|
||||||
@@ -936,7 +935,7 @@ void dp_rx_extract_radiotap_info(struct cdp_mon_status *rx_status,
|
|||||||
QDF_STATUS dp_rx_mon_deliver(struct dp_soc *soc, uint32_t mac_id,
|
QDF_STATUS dp_rx_mon_deliver(struct dp_soc *soc, uint32_t mac_id,
|
||||||
qdf_nbuf_t head_msdu, qdf_nbuf_t tail_msdu)
|
qdf_nbuf_t head_msdu, qdf_nbuf_t tail_msdu)
|
||||||
{
|
{
|
||||||
struct dp_pdev *pdev = dp_get_pdev_for_mac_id(soc, mac_id);
|
struct dp_pdev *pdev = dp_get_pdev_for_lmac_id(soc, mac_id);
|
||||||
struct cdp_mon_status *rs = &pdev->rx_mon_recv_status;
|
struct cdp_mon_status *rs = &pdev->rx_mon_recv_status;
|
||||||
qdf_nbuf_t mon_skb, skb_next;
|
qdf_nbuf_t mon_skb, skb_next;
|
||||||
qdf_nbuf_t mon_mpdu = NULL;
|
qdf_nbuf_t mon_mpdu = NULL;
|
||||||
@@ -1011,7 +1010,7 @@ mon_deliver_fail:
|
|||||||
QDF_STATUS dp_rx_mon_deliver_non_std(struct dp_soc *soc,
|
QDF_STATUS dp_rx_mon_deliver_non_std(struct dp_soc *soc,
|
||||||
uint32_t mac_id)
|
uint32_t mac_id)
|
||||||
{
|
{
|
||||||
struct dp_pdev *pdev = dp_get_pdev_for_mac_id(soc, mac_id);
|
struct dp_pdev *pdev = dp_get_pdev_for_lmac_id(soc, mac_id);
|
||||||
ol_txrx_rx_mon_fp osif_rx_mon;
|
ol_txrx_rx_mon_fp osif_rx_mon;
|
||||||
qdf_nbuf_t dummy_msdu;
|
qdf_nbuf_t dummy_msdu;
|
||||||
|
|
||||||
@@ -1073,7 +1072,7 @@ mon_deliver_non_std_fail:
|
|||||||
*/
|
*/
|
||||||
void dp_rx_mon_dest_process(struct dp_soc *soc, uint32_t mac_id, uint32_t quota)
|
void dp_rx_mon_dest_process(struct dp_soc *soc, uint32_t mac_id, uint32_t quota)
|
||||||
{
|
{
|
||||||
struct dp_pdev *pdev = dp_get_pdev_for_mac_id(soc, mac_id);
|
struct dp_pdev *pdev = dp_get_pdev_for_lmac_id(soc, mac_id);
|
||||||
uint8_t pdev_id;
|
uint8_t pdev_id;
|
||||||
hal_rxdma_desc_t rxdma_dst_ring_desc;
|
hal_rxdma_desc_t rxdma_dst_ring_desc;
|
||||||
hal_soc_handle_t hal_soc;
|
hal_soc_handle_t hal_soc;
|
||||||
@@ -1083,7 +1082,7 @@ void dp_rx_mon_dest_process(struct dp_soc *soc, uint32_t mac_id, uint32_t quota)
|
|||||||
uint32_t ppdu_id;
|
uint32_t ppdu_id;
|
||||||
uint32_t rx_bufs_used;
|
uint32_t rx_bufs_used;
|
||||||
uint32_t mpdu_rx_bufs_used;
|
uint32_t mpdu_rx_bufs_used;
|
||||||
int mac_for_pdev = dp_get_mac_id_for_mac(soc, mac_id);
|
int mac_for_pdev = mac_id;
|
||||||
struct cdp_pdev_mon_stats *rx_mon_stats;
|
struct cdp_pdev_mon_stats *rx_mon_stats;
|
||||||
|
|
||||||
mon_dst_srng = dp_rxdma_get_mon_dst_ring(pdev, mac_for_pdev);
|
mon_dst_srng = dp_rxdma_get_mon_dst_ring(pdev, mac_for_pdev);
|
||||||
@@ -1205,10 +1204,9 @@ dp_rx_pdev_mon_buf_attach(struct dp_pdev *pdev, int mac_id) {
|
|||||||
uint32_t num_entries;
|
uint32_t num_entries;
|
||||||
struct rx_desc_pool *rx_desc_pool;
|
struct rx_desc_pool *rx_desc_pool;
|
||||||
QDF_STATUS status = QDF_STATUS_SUCCESS;
|
QDF_STATUS status = QDF_STATUS_SUCCESS;
|
||||||
uint8_t mac_for_pdev = dp_get_mac_id_for_mac(soc, mac_id);
|
|
||||||
uint32_t rx_desc_pool_size, replenish_size;
|
uint32_t rx_desc_pool_size, replenish_size;
|
||||||
|
|
||||||
mon_buf_ring = &pdev->rxdma_mon_buf_ring[mac_for_pdev];
|
mon_buf_ring = &soc->rxdma_mon_buf_ring[mac_id];
|
||||||
|
|
||||||
num_entries = mon_buf_ring->num_entries;
|
num_entries = mon_buf_ring->num_entries;
|
||||||
|
|
||||||
@@ -1264,8 +1262,6 @@ dp_rx_pdev_mon_buf_detach(struct dp_pdev *pdev, int mac_id)
|
|||||||
static
|
static
|
||||||
QDF_STATUS dp_mon_link_desc_pool_setup(struct dp_soc *soc, uint32_t mac_id)
|
QDF_STATUS dp_mon_link_desc_pool_setup(struct dp_soc *soc, uint32_t mac_id)
|
||||||
{
|
{
|
||||||
struct dp_pdev *dp_pdev = dp_get_pdev_for_mac_id(soc, mac_id);
|
|
||||||
int mac_for_pdev = dp_get_mac_id_for_mac(soc, mac_id);
|
|
||||||
int link_desc_size = hal_get_link_desc_size(soc->hal_soc);
|
int link_desc_size = hal_get_link_desc_size(soc->hal_soc);
|
||||||
int link_desc_align = hal_get_link_desc_align(soc->hal_soc);
|
int link_desc_align = hal_get_link_desc_align(soc->hal_soc);
|
||||||
uint32_t max_alloc_size = wlan_cfg_max_alloc_size(soc->wlan_cfg_ctx);
|
uint32_t max_alloc_size = wlan_cfg_max_alloc_size(soc->wlan_cfg_ctx);
|
||||||
@@ -1279,7 +1275,7 @@ QDF_STATUS dp_mon_link_desc_pool_setup(struct dp_soc *soc, uint32_t mac_id)
|
|||||||
int i;
|
int i;
|
||||||
qdf_dma_addr_t *baseaddr = NULL;
|
qdf_dma_addr_t *baseaddr = NULL;
|
||||||
|
|
||||||
dp_srng = &dp_pdev->rxdma_mon_desc_ring[mac_for_pdev];
|
dp_srng = &soc->rxdma_mon_desc_ring[mac_id];
|
||||||
|
|
||||||
num_entries = dp_srng->alloc_size/hal_srng_get_entrysize(
|
num_entries = dp_srng->alloc_size/hal_srng_get_entrysize(
|
||||||
soc->hal_soc, RXDMA_MONITOR_DESC);
|
soc->hal_soc, RXDMA_MONITOR_DESC);
|
||||||
@@ -1315,17 +1311,17 @@ QDF_STATUS dp_mon_link_desc_pool_setup(struct dp_soc *soc, uint32_t mac_id)
|
|||||||
__func__, max_alloc_size, last_bank_size);
|
__func__, max_alloc_size, last_bank_size);
|
||||||
|
|
||||||
for (i = 0; i < num_link_desc_banks; i++) {
|
for (i = 0; i < num_link_desc_banks; i++) {
|
||||||
baseaddr = &dp_pdev->link_desc_banks[mac_for_pdev][i].
|
baseaddr = &soc->mon_link_desc_banks[mac_id][i].
|
||||||
base_paddr_unaligned;
|
base_paddr_unaligned;
|
||||||
if (!dp_is_soc_reinit(soc)) {
|
if (!dp_is_soc_reinit(soc)) {
|
||||||
dp_pdev->link_desc_banks[mac_for_pdev][i].
|
soc->mon_link_desc_banks[mac_id][i].
|
||||||
base_vaddr_unaligned =
|
base_vaddr_unaligned =
|
||||||
qdf_mem_alloc_consistent(soc->osdev,
|
qdf_mem_alloc_consistent(soc->osdev,
|
||||||
soc->osdev->dev,
|
soc->osdev->dev,
|
||||||
max_alloc_size,
|
max_alloc_size,
|
||||||
baseaddr);
|
baseaddr);
|
||||||
|
|
||||||
if (!dp_pdev->link_desc_banks[mac_for_pdev][i].
|
if (!soc->mon_link_desc_banks[mac_id][i].
|
||||||
base_vaddr_unaligned) {
|
base_vaddr_unaligned) {
|
||||||
QDF_TRACE(QDF_MODULE_ID_TXRX,
|
QDF_TRACE(QDF_MODULE_ID_TXRX,
|
||||||
QDF_TRACE_LEVEL_ERROR,
|
QDF_TRACE_LEVEL_ERROR,
|
||||||
@@ -1334,25 +1330,25 @@ QDF_STATUS dp_mon_link_desc_pool_setup(struct dp_soc *soc, uint32_t mac_id)
|
|||||||
goto fail;
|
goto fail;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
dp_pdev->link_desc_banks[mac_for_pdev][i].size = max_alloc_size;
|
soc->mon_link_desc_banks[mac_id][i].size = max_alloc_size;
|
||||||
|
|
||||||
dp_pdev->link_desc_banks[mac_for_pdev][i].base_vaddr =
|
soc->mon_link_desc_banks[mac_id][i].base_vaddr =
|
||||||
(void *)((unsigned long)
|
(void *)((unsigned long)
|
||||||
(dp_pdev->link_desc_banks[mac_for_pdev][i].
|
(soc->mon_link_desc_banks[mac_id][i].
|
||||||
base_vaddr_unaligned) +
|
base_vaddr_unaligned) +
|
||||||
((unsigned long)
|
((unsigned long)
|
||||||
(dp_pdev->link_desc_banks[mac_for_pdev][i].
|
(soc->mon_link_desc_banks[mac_id][i].
|
||||||
base_vaddr_unaligned) %
|
base_vaddr_unaligned) %
|
||||||
link_desc_align));
|
link_desc_align));
|
||||||
|
|
||||||
dp_pdev->link_desc_banks[mac_for_pdev][i].base_paddr =
|
soc->mon_link_desc_banks[mac_id][i].base_paddr =
|
||||||
(unsigned long)
|
(unsigned long)
|
||||||
(dp_pdev->link_desc_banks[mac_for_pdev][i].
|
(soc->mon_link_desc_banks[mac_id][i].
|
||||||
base_paddr_unaligned) +
|
base_paddr_unaligned) +
|
||||||
((unsigned long)
|
((unsigned long)
|
||||||
(dp_pdev->link_desc_banks[mac_for_pdev][i].base_vaddr) -
|
(soc->mon_link_desc_banks[mac_id][i].base_vaddr) -
|
||||||
(unsigned long)
|
(unsigned long)
|
||||||
(dp_pdev->link_desc_banks[mac_for_pdev][i].
|
(soc->mon_link_desc_banks[mac_id][i].
|
||||||
base_vaddr_unaligned));
|
base_vaddr_unaligned));
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1360,17 +1356,17 @@ QDF_STATUS dp_mon_link_desc_pool_setup(struct dp_soc *soc, uint32_t mac_id)
|
|||||||
/* Allocate last bank in case total memory required is not exact
|
/* Allocate last bank in case total memory required is not exact
|
||||||
* multiple of max_alloc_size
|
* multiple of max_alloc_size
|
||||||
*/
|
*/
|
||||||
baseaddr = &dp_pdev->link_desc_banks[mac_for_pdev][i].
|
baseaddr = &soc->mon_link_desc_banks[mac_id][i].
|
||||||
base_paddr_unaligned;
|
base_paddr_unaligned;
|
||||||
if (!dp_is_soc_reinit(soc)) {
|
if (!dp_is_soc_reinit(soc)) {
|
||||||
dp_pdev->link_desc_banks[mac_for_pdev][i].
|
soc->mon_link_desc_banks[mac_id][i].
|
||||||
base_vaddr_unaligned =
|
base_vaddr_unaligned =
|
||||||
qdf_mem_alloc_consistent(soc->osdev,
|
qdf_mem_alloc_consistent(soc->osdev,
|
||||||
soc->osdev->dev,
|
soc->osdev->dev,
|
||||||
last_bank_size,
|
last_bank_size,
|
||||||
baseaddr);
|
baseaddr);
|
||||||
|
|
||||||
if (!dp_pdev->link_desc_banks[mac_for_pdev][i].
|
if (!soc->mon_link_desc_banks[mac_id][i].
|
||||||
base_vaddr_unaligned) {
|
base_vaddr_unaligned) {
|
||||||
QDF_TRACE(QDF_MODULE_ID_TXRX,
|
QDF_TRACE(QDF_MODULE_ID_TXRX,
|
||||||
QDF_TRACE_LEVEL_ERROR,
|
QDF_TRACE_LEVEL_ERROR,
|
||||||
@@ -1379,25 +1375,26 @@ QDF_STATUS dp_mon_link_desc_pool_setup(struct dp_soc *soc, uint32_t mac_id)
|
|||||||
goto fail;
|
goto fail;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
dp_pdev->link_desc_banks[mac_for_pdev][i].size = last_bank_size;
|
soc->mon_link_desc_banks[mac_id][i].size =
|
||||||
|
last_bank_size;
|
||||||
|
|
||||||
dp_pdev->link_desc_banks[mac_for_pdev][i].base_vaddr =
|
soc->mon_link_desc_banks[mac_id][i].base_vaddr =
|
||||||
(void *)((unsigned long)
|
(void *)((unsigned long)
|
||||||
(dp_pdev->link_desc_banks[mac_for_pdev][i].
|
(soc->mon_link_desc_banks[mac_id][i].
|
||||||
base_vaddr_unaligned) +
|
base_vaddr_unaligned) +
|
||||||
((unsigned long)
|
((unsigned long)
|
||||||
(dp_pdev->link_desc_banks[mac_for_pdev][i].
|
(soc->mon_link_desc_banks[mac_id][i].
|
||||||
base_vaddr_unaligned) %
|
base_vaddr_unaligned) %
|
||||||
link_desc_align));
|
link_desc_align));
|
||||||
|
|
||||||
dp_pdev->link_desc_banks[mac_for_pdev][i].base_paddr =
|
soc->mon_link_desc_banks[mac_id][i].base_paddr =
|
||||||
(unsigned long)
|
(unsigned long)
|
||||||
(dp_pdev->link_desc_banks[mac_for_pdev][i].
|
(soc->mon_link_desc_banks[mac_id][i].
|
||||||
base_paddr_unaligned) +
|
base_paddr_unaligned) +
|
||||||
((unsigned long)
|
((unsigned long)
|
||||||
(dp_pdev->link_desc_banks[mac_for_pdev][i].base_vaddr) -
|
(soc->mon_link_desc_banks[mac_id][i].base_vaddr) -
|
||||||
(unsigned long)
|
(unsigned long)
|
||||||
(dp_pdev->link_desc_banks[mac_for_pdev][i].
|
(soc->mon_link_desc_banks[mac_id][i].
|
||||||
base_vaddr_unaligned));
|
base_vaddr_unaligned));
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1405,7 +1402,7 @@ QDF_STATUS dp_mon_link_desc_pool_setup(struct dp_soc *soc, uint32_t mac_id)
|
|||||||
entry_size = hal_srng_get_entrysize(soc->hal_soc, RXDMA_MONITOR_DESC);
|
entry_size = hal_srng_get_entrysize(soc->hal_soc, RXDMA_MONITOR_DESC);
|
||||||
total_mem_size = entry_size * total_link_descs;
|
total_mem_size = entry_size * total_link_descs;
|
||||||
|
|
||||||
mon_desc_srng = dp_pdev->rxdma_mon_desc_ring[mac_for_pdev].hal_srng;
|
mon_desc_srng = soc->rxdma_mon_desc_ring[mac_id].hal_srng;
|
||||||
|
|
||||||
num_replenish_buf = 0;
|
num_replenish_buf = 0;
|
||||||
|
|
||||||
@@ -1415,21 +1412,21 @@ QDF_STATUS dp_mon_link_desc_pool_setup(struct dp_soc *soc, uint32_t mac_id)
|
|||||||
|
|
||||||
for (i = 0;
|
for (i = 0;
|
||||||
i < MAX_MON_LINK_DESC_BANKS &&
|
i < MAX_MON_LINK_DESC_BANKS &&
|
||||||
dp_pdev->link_desc_banks[mac_for_pdev][i].base_paddr;
|
soc->mon_link_desc_banks[mac_id][i].base_paddr;
|
||||||
i++) {
|
i++) {
|
||||||
uint32_t num_entries =
|
uint32_t num_entries =
|
||||||
(dp_pdev->link_desc_banks[mac_for_pdev][i].size -
|
(soc->mon_link_desc_banks[mac_id][i].size -
|
||||||
(unsigned long)
|
(unsigned long)
|
||||||
(dp_pdev->link_desc_banks[mac_for_pdev][i].base_vaddr) -
|
(soc->mon_link_desc_banks[mac_id][i].base_vaddr) -
|
||||||
(unsigned long)
|
(unsigned long)
|
||||||
(dp_pdev->link_desc_banks[mac_for_pdev][i].
|
(soc->mon_link_desc_banks[mac_id][i].
|
||||||
base_vaddr_unaligned)) / link_desc_size;
|
base_vaddr_unaligned)) / link_desc_size;
|
||||||
unsigned long paddr =
|
unsigned long paddr =
|
||||||
(unsigned long)
|
(unsigned long)
|
||||||
(dp_pdev->link_desc_banks[mac_for_pdev][i].base_paddr);
|
(soc->mon_link_desc_banks[mac_id][i].base_paddr);
|
||||||
unsigned long vaddr =
|
unsigned long vaddr =
|
||||||
(unsigned long)
|
(unsigned long)
|
||||||
(dp_pdev->link_desc_banks[mac_for_pdev][i].base_vaddr);
|
(soc->mon_link_desc_banks[mac_id][i].base_vaddr);
|
||||||
|
|
||||||
hal_srng_access_start_unlocked(soc->hal_soc,
|
hal_srng_access_start_unlocked(soc->hal_soc,
|
||||||
mon_desc_srng);
|
mon_desc_srng);
|
||||||
@@ -1459,15 +1456,16 @@ QDF_STATUS dp_mon_link_desc_pool_setup(struct dp_soc *soc, uint32_t mac_id)
|
|||||||
|
|
||||||
fail:
|
fail:
|
||||||
for (i = 0; i < MAX_MON_LINK_DESC_BANKS; i++) {
|
for (i = 0; i < MAX_MON_LINK_DESC_BANKS; i++) {
|
||||||
if (dp_pdev->link_desc_banks[mac_for_pdev][i].
|
if (soc->mon_link_desc_banks[mac_id][i].
|
||||||
base_vaddr_unaligned) {
|
base_vaddr_unaligned) {
|
||||||
qdf_mem_free_consistent(soc->osdev, soc->osdev->dev,
|
qdf_mem_free_consistent(soc->osdev, soc->osdev->dev,
|
||||||
dp_pdev->link_desc_banks[mac_for_pdev][i].size,
|
soc->mon_link_desc_banks[mac_id][i].
|
||||||
dp_pdev->link_desc_banks[mac_for_pdev][i].
|
size,
|
||||||
|
soc->mon_link_desc_banks[mac_id][i].
|
||||||
base_vaddr_unaligned,
|
base_vaddr_unaligned,
|
||||||
dp_pdev->link_desc_banks[mac_for_pdev][i].
|
soc->mon_link_desc_banks[mac_id][i].
|
||||||
base_paddr_unaligned, 0);
|
base_paddr_unaligned, 0);
|
||||||
dp_pdev->link_desc_banks[mac_for_pdev][i].
|
soc->mon_link_desc_banks[mac_id][i].
|
||||||
base_vaddr_unaligned = NULL;
|
base_vaddr_unaligned = NULL;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1480,20 +1478,19 @@ fail:
|
|||||||
static
|
static
|
||||||
void dp_mon_link_desc_pool_cleanup(struct dp_soc *soc, uint32_t mac_id)
|
void dp_mon_link_desc_pool_cleanup(struct dp_soc *soc, uint32_t mac_id)
|
||||||
{
|
{
|
||||||
struct dp_pdev *dp_pdev = dp_get_pdev_for_mac_id(soc, mac_id);
|
|
||||||
int mac_for_pdev = dp_get_mac_id_for_mac(soc, mac_id);
|
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
for (i = 0; i < MAX_MON_LINK_DESC_BANKS; i++) {
|
for (i = 0; i < MAX_MON_LINK_DESC_BANKS; i++) {
|
||||||
if (dp_pdev->link_desc_banks[mac_for_pdev][i].
|
if (soc->mon_link_desc_banks[mac_id][i].
|
||||||
base_vaddr_unaligned) {
|
base_vaddr_unaligned) {
|
||||||
qdf_mem_free_consistent(soc->osdev, soc->osdev->dev,
|
qdf_mem_free_consistent(soc->osdev, soc->osdev->dev,
|
||||||
dp_pdev->link_desc_banks[mac_for_pdev][i].size,
|
soc->mon_link_desc_banks[mac_id][i].
|
||||||
dp_pdev->link_desc_banks[mac_for_pdev][i].
|
size,
|
||||||
|
soc->mon_link_desc_banks[mac_id][i].
|
||||||
base_vaddr_unaligned,
|
base_vaddr_unaligned,
|
||||||
dp_pdev->link_desc_banks[mac_for_pdev][i].
|
soc->mon_link_desc_banks[mac_id][i].
|
||||||
base_paddr_unaligned, 0);
|
base_paddr_unaligned, 0);
|
||||||
dp_pdev->link_desc_banks[mac_for_pdev][i].
|
soc->mon_link_desc_banks[mac_id][i].
|
||||||
base_vaddr_unaligned = NULL;
|
base_vaddr_unaligned = NULL;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1512,27 +1509,25 @@ void dp_mon_buf_delayed_replenish(struct dp_pdev *pdev)
|
|||||||
union dp_rx_desc_list_elem_t *tail = NULL;
|
union dp_rx_desc_list_elem_t *tail = NULL;
|
||||||
union dp_rx_desc_list_elem_t *desc_list = NULL;
|
union dp_rx_desc_list_elem_t *desc_list = NULL;
|
||||||
uint32_t num_entries;
|
uint32_t num_entries;
|
||||||
uint32_t mac_id, id;
|
uint32_t id;
|
||||||
|
|
||||||
soc = pdev->soc;
|
soc = pdev->soc;
|
||||||
num_entries = wlan_cfg_get_dma_mon_buf_ring_size(pdev->wlan_cfg_ctx);
|
num_entries = wlan_cfg_get_dma_mon_buf_ring_size(pdev->wlan_cfg_ctx);
|
||||||
|
|
||||||
for (id = 0; id < NUM_RXDMA_RINGS_PER_PDEV; id++) {
|
for (id = 0; id < NUM_RXDMA_RINGS_PER_PDEV; id++) {
|
||||||
mac_for_pdev = dp_get_mac_id_for_pdev(id,
|
|
||||||
pdev->pdev_id);
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Map mac_for_pdev appropriately for both MCL & WIN,
|
* Get mac_for_pdev appropriately for both MCL & WIN,
|
||||||
* since MCL have multiple mon buf rings and WIN just
|
* since MCL have multiple mon buf rings and WIN just
|
||||||
* has one mon buffer ring, below API helps identify
|
* has one mon buffer ring mapped per pdev, below API
|
||||||
* accurate buffer_ring for both cases
|
* helps identify accurate buffer_ring for both cases
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
mac_id = dp_get_mac_id_for_mac(soc, mac_for_pdev);
|
mac_for_pdev =
|
||||||
|
dp_get_lmac_id_for_pdev_id(soc, id, pdev->pdev_id);
|
||||||
|
|
||||||
dp_rx_buffers_replenish(soc, mac_for_pdev,
|
dp_rx_buffers_replenish(soc, mac_for_pdev,
|
||||||
dp_rxdma_get_mon_buf_ring(pdev,
|
dp_rxdma_get_mon_buf_ring(pdev,
|
||||||
mac_id),
|
mac_for_pdev),
|
||||||
dp_rx_get_mon_desc_pool(soc,
|
dp_rx_get_mon_desc_pool(soc,
|
||||||
mac_for_pdev,
|
mac_for_pdev,
|
||||||
pdev->pdev_id),
|
pdev->pdev_id),
|
||||||
@@ -1582,7 +1577,7 @@ static QDF_STATUS
|
|||||||
dp_rx_pdev_mon_cmn_detach(struct dp_pdev *pdev, int mac_id) {
|
dp_rx_pdev_mon_cmn_detach(struct dp_pdev *pdev, int mac_id) {
|
||||||
struct dp_soc *soc = pdev->soc;
|
struct dp_soc *soc = pdev->soc;
|
||||||
uint8_t pdev_id = pdev->pdev_id;
|
uint8_t pdev_id = pdev->pdev_id;
|
||||||
int mac_for_pdev = dp_get_mac_id_for_pdev(mac_id, pdev_id);
|
int mac_for_pdev = dp_get_lmac_id_for_pdev_id(soc, mac_id, pdev_id);
|
||||||
|
|
||||||
dp_mon_link_desc_pool_cleanup(soc, mac_for_pdev);
|
dp_mon_link_desc_pool_cleanup(soc, mac_for_pdev);
|
||||||
dp_rx_pdev_mon_status_detach(pdev, mac_for_pdev);
|
dp_rx_pdev_mon_status_detach(pdev, mac_for_pdev);
|
||||||
@@ -1606,7 +1601,7 @@ static QDF_STATUS
|
|||||||
dp_rx_pdev_mon_cmn_attach(struct dp_pdev *pdev, int mac_id) {
|
dp_rx_pdev_mon_cmn_attach(struct dp_pdev *pdev, int mac_id) {
|
||||||
struct dp_soc *soc = pdev->soc;
|
struct dp_soc *soc = pdev->soc;
|
||||||
uint8_t pdev_id = pdev->pdev_id;
|
uint8_t pdev_id = pdev->pdev_id;
|
||||||
int mac_for_pdev = dp_get_mac_id_for_pdev(mac_id, pdev_id);
|
int mac_for_pdev = dp_get_lmac_id_for_pdev_id(soc, mac_id, pdev_id);
|
||||||
QDF_STATUS status;
|
QDF_STATUS status;
|
||||||
|
|
||||||
status = dp_rx_pdev_mon_buf_attach(pdev, mac_for_pdev);
|
status = dp_rx_pdev_mon_buf_attach(pdev, mac_for_pdev);
|
||||||
@@ -1688,7 +1683,8 @@ dp_mon_link_free(struct dp_pdev *pdev) {
|
|||||||
int mac_id;
|
int mac_id;
|
||||||
|
|
||||||
for (mac_id = 0; mac_id < NUM_RXDMA_RINGS_PER_PDEV; mac_id++) {
|
for (mac_id = 0; mac_id < NUM_RXDMA_RINGS_PER_PDEV; mac_id++) {
|
||||||
int mac_for_pdev = dp_get_mac_id_for_pdev(mac_id, pdev_id);
|
int mac_for_pdev = dp_get_lmac_id_for_pdev_id(soc,
|
||||||
|
mac_id, pdev_id);
|
||||||
|
|
||||||
dp_mon_link_desc_pool_cleanup(soc, mac_for_pdev);
|
dp_mon_link_desc_pool_cleanup(soc, mac_for_pdev);
|
||||||
}
|
}
|
||||||
@@ -1713,7 +1709,8 @@ dp_rx_pdev_mon_detach(struct dp_pdev *pdev) {
|
|||||||
|
|
||||||
qdf_spinlock_destroy(&pdev->mon_lock);
|
qdf_spinlock_destroy(&pdev->mon_lock);
|
||||||
for (mac_id = 0; mac_id < NUM_RXDMA_RINGS_PER_PDEV; mac_id++) {
|
for (mac_id = 0; mac_id < NUM_RXDMA_RINGS_PER_PDEV; mac_id++) {
|
||||||
int mac_for_pdev = dp_get_mac_id_for_pdev(mac_id, pdev_id);
|
int mac_for_pdev = dp_get_lmac_id_for_pdev_id(pdev->soc,
|
||||||
|
mac_id, pdev_id);
|
||||||
|
|
||||||
dp_rx_pdev_mon_status_detach(pdev, mac_for_pdev);
|
dp_rx_pdev_mon_status_detach(pdev, mac_for_pdev);
|
||||||
dp_rx_pdev_mon_buf_detach(pdev, mac_for_pdev);
|
dp_rx_pdev_mon_buf_detach(pdev, mac_for_pdev);
|
||||||
|
@@ -1370,7 +1370,7 @@ static inline void
|
|||||||
dp_rx_mon_status_process_tlv(struct dp_soc *soc, uint32_t mac_id,
|
dp_rx_mon_status_process_tlv(struct dp_soc *soc, uint32_t mac_id,
|
||||||
uint32_t quota)
|
uint32_t quota)
|
||||||
{
|
{
|
||||||
struct dp_pdev *pdev = dp_get_pdev_for_mac_id(soc, mac_id);
|
struct dp_pdev *pdev = dp_get_pdev_for_lmac_id(soc, mac_id);
|
||||||
struct hal_rx_ppdu_info *ppdu_info;
|
struct hal_rx_ppdu_info *ppdu_info;
|
||||||
qdf_nbuf_t status_nbuf;
|
qdf_nbuf_t status_nbuf;
|
||||||
uint8_t *rx_tlv;
|
uint8_t *rx_tlv;
|
||||||
@@ -1522,15 +1522,14 @@ static inline uint32_t
|
|||||||
dp_rx_mon_status_srng_process(struct dp_soc *soc, uint32_t mac_id,
|
dp_rx_mon_status_srng_process(struct dp_soc *soc, uint32_t mac_id,
|
||||||
uint32_t quota)
|
uint32_t quota)
|
||||||
{
|
{
|
||||||
struct dp_pdev *pdev = dp_get_pdev_for_mac_id(soc, mac_id);
|
struct dp_pdev *pdev = dp_get_pdev_for_lmac_id(soc, mac_id);
|
||||||
hal_soc_handle_t hal_soc;
|
hal_soc_handle_t hal_soc;
|
||||||
void *mon_status_srng;
|
void *mon_status_srng;
|
||||||
void *rxdma_mon_status_ring_entry;
|
void *rxdma_mon_status_ring_entry;
|
||||||
QDF_STATUS status;
|
QDF_STATUS status;
|
||||||
uint32_t work_done = 0;
|
uint32_t work_done = 0;
|
||||||
int mac_for_pdev = dp_get_mac_id_for_mac(soc, mac_id);
|
|
||||||
|
|
||||||
mon_status_srng = pdev->rxdma_mon_status_ring[mac_for_pdev].hal_srng;
|
mon_status_srng = soc->rxdma_mon_status_ring[mac_id].hal_srng;
|
||||||
|
|
||||||
qdf_assert(mon_status_srng);
|
qdf_assert(mon_status_srng);
|
||||||
if (!mon_status_srng || !hal_srng_initialized(mon_status_srng)) {
|
if (!mon_status_srng || !hal_srng_initialized(mon_status_srng)) {
|
||||||
@@ -1782,7 +1781,7 @@ QDF_STATUS dp_rx_mon_status_buffers_replenish(struct dp_soc *dp_soc,
|
|||||||
void *rxdma_ring_entry;
|
void *rxdma_ring_entry;
|
||||||
union dp_rx_desc_list_elem_t *next;
|
union dp_rx_desc_list_elem_t *next;
|
||||||
void *rxdma_srng;
|
void *rxdma_srng;
|
||||||
struct dp_pdev *dp_pdev = dp_get_pdev_for_mac_id(dp_soc, mac_id);
|
struct dp_pdev *dp_pdev = dp_get_pdev_for_lmac_id(dp_soc, mac_id);
|
||||||
|
|
||||||
rxdma_srng = dp_rxdma_srng->hal_srng;
|
rxdma_srng = dp_rxdma_srng->hal_srng;
|
||||||
|
|
||||||
@@ -1917,9 +1916,8 @@ dp_rx_pdev_mon_status_attach(struct dp_pdev *pdev, int ring_id) {
|
|||||||
uint32_t i;
|
uint32_t i;
|
||||||
struct rx_desc_pool *rx_desc_pool;
|
struct rx_desc_pool *rx_desc_pool;
|
||||||
QDF_STATUS status;
|
QDF_STATUS status;
|
||||||
int mac_for_pdev = dp_get_mac_id_for_mac(soc, ring_id);
|
|
||||||
|
|
||||||
mon_status_ring = &pdev->rxdma_mon_status_ring[mac_for_pdev];
|
mon_status_ring = &soc->rxdma_mon_status_ring[ring_id];
|
||||||
|
|
||||||
num_entries = mon_status_ring->num_entries;
|
num_entries = mon_status_ring->num_entries;
|
||||||
|
|
||||||
|
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2017-2019 The Linux Foundation. All rights reserved.
|
* Copyright (c) 2017-2020 The Linux Foundation. All rights reserved.
|
||||||
*
|
*
|
||||||
* Permission to use, copy, modify, and/or distribute this software for
|
* Permission to use, copy, modify, and/or distribute this software for
|
||||||
* any purpose with or without fee is hereby granted, provided that the
|
* any purpose with or without fee is hereby granted, provided that the
|
||||||
@@ -4750,18 +4750,18 @@ void dp_print_mon_ring_stat_from_hal(struct dp_pdev *pdev, uint8_t mac_id)
|
|||||||
{
|
{
|
||||||
if (pdev->soc->wlan_cfg_ctx->rxdma1_enable) {
|
if (pdev->soc->wlan_cfg_ctx->rxdma1_enable) {
|
||||||
dp_print_ring_stat_from_hal(pdev->soc,
|
dp_print_ring_stat_from_hal(pdev->soc,
|
||||||
&pdev->rxdma_mon_buf_ring[mac_id],
|
&pdev->soc->rxdma_mon_buf_ring[mac_id],
|
||||||
RXDMA_MONITOR_BUF);
|
RXDMA_MONITOR_BUF);
|
||||||
dp_print_ring_stat_from_hal(pdev->soc,
|
dp_print_ring_stat_from_hal(pdev->soc,
|
||||||
&pdev->rxdma_mon_dst_ring[mac_id],
|
&pdev->soc->rxdma_mon_dst_ring[mac_id],
|
||||||
RXDMA_MONITOR_DST);
|
RXDMA_MONITOR_DST);
|
||||||
dp_print_ring_stat_from_hal(pdev->soc,
|
dp_print_ring_stat_from_hal(pdev->soc,
|
||||||
&pdev->rxdma_mon_desc_ring[mac_id],
|
&pdev->soc->rxdma_mon_desc_ring[mac_id],
|
||||||
RXDMA_MONITOR_DESC);
|
RXDMA_MONITOR_DESC);
|
||||||
}
|
}
|
||||||
|
|
||||||
dp_print_ring_stat_from_hal(pdev->soc,
|
dp_print_ring_stat_from_hal(pdev->soc,
|
||||||
&pdev->rxdma_mon_status_ring[mac_id],
|
&pdev->soc->rxdma_mon_status_ring[mac_id],
|
||||||
RXDMA_MONITOR_STATUS);
|
RXDMA_MONITOR_STATUS);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -4770,6 +4770,7 @@ dp_print_ring_stats(struct dp_pdev *pdev)
|
|||||||
{
|
{
|
||||||
uint32_t i;
|
uint32_t i;
|
||||||
int mac_id;
|
int mac_id;
|
||||||
|
int lmac_id;
|
||||||
|
|
||||||
if (hif_pm_runtime_get_sync(pdev->soc->hif_handle))
|
if (hif_pm_runtime_get_sync(pdev->soc->hif_handle))
|
||||||
return;
|
return;
|
||||||
@@ -4812,8 +4813,9 @@ dp_print_ring_stats(struct dp_pdev *pdev)
|
|||||||
&pdev->soc->tx_comp_ring[i],
|
&pdev->soc->tx_comp_ring[i],
|
||||||
WBM2SW_RELEASE);
|
WBM2SW_RELEASE);
|
||||||
|
|
||||||
|
lmac_id = dp_get_lmac_id_for_pdev_id(pdev->soc, 0, pdev->pdev_id);
|
||||||
dp_print_ring_stat_from_hal(pdev->soc,
|
dp_print_ring_stat_from_hal(pdev->soc,
|
||||||
&pdev->rx_refill_buf_ring,
|
&pdev->soc->rx_refill_buf_ring[lmac_id],
|
||||||
RXDMA_BUF);
|
RXDMA_BUF);
|
||||||
|
|
||||||
dp_print_ring_stat_from_hal(pdev->soc,
|
dp_print_ring_stat_from_hal(pdev->soc,
|
||||||
@@ -4825,14 +4827,22 @@ dp_print_ring_stats(struct dp_pdev *pdev)
|
|||||||
&pdev->rx_mac_buf_ring[i],
|
&pdev->rx_mac_buf_ring[i],
|
||||||
RXDMA_BUF);
|
RXDMA_BUF);
|
||||||
|
|
||||||
for (mac_id = 0; mac_id < NUM_RXDMA_RINGS_PER_PDEV; mac_id++)
|
for (mac_id = 0; mac_id < NUM_RXDMA_RINGS_PER_PDEV; mac_id++) {
|
||||||
dp_print_mon_ring_stat_from_hal(pdev, mac_id);
|
lmac_id = dp_get_lmac_id_for_pdev_id(pdev->soc,
|
||||||
|
mac_id, pdev->pdev_id);
|
||||||
|
|
||||||
|
dp_print_mon_ring_stat_from_hal(pdev, lmac_id);
|
||||||
|
}
|
||||||
|
|
||||||
|
for (i = 0; i < NUM_RXDMA_RINGS_PER_PDEV; i++) {
|
||||||
|
lmac_id = dp_get_lmac_id_for_pdev_id(pdev->soc,
|
||||||
|
i, pdev->pdev_id);
|
||||||
|
|
||||||
for (i = 0; i < NUM_RXDMA_RINGS_PER_PDEV; i++)
|
|
||||||
dp_print_ring_stat_from_hal(pdev->soc,
|
dp_print_ring_stat_from_hal(pdev->soc,
|
||||||
&pdev->rxdma_err_dst_ring[i],
|
&pdev->soc->rxdma_err_dst_ring
|
||||||
|
[lmac_id],
|
||||||
RXDMA_DST);
|
RXDMA_DST);
|
||||||
|
}
|
||||||
hif_pm_runtime_put(pdev->soc->hif_handle);
|
hif_pm_runtime_put(pdev->soc->hif_handle);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -3722,6 +3722,7 @@ qdf_nbuf_t dp_tx_non_std(struct cdp_soc_t *soc_hdl, uint8_t vdev_id,
|
|||||||
*/
|
*/
|
||||||
QDF_STATUS dp_tx_vdev_attach(struct dp_vdev *vdev)
|
QDF_STATUS dp_tx_vdev_attach(struct dp_vdev *vdev)
|
||||||
{
|
{
|
||||||
|
int pdev_id;
|
||||||
/*
|
/*
|
||||||
* Fill HTT TCL Metadata with Vdev ID and MAC ID
|
* Fill HTT TCL Metadata with Vdev ID and MAC ID
|
||||||
*/
|
*/
|
||||||
@@ -3731,8 +3732,10 @@ QDF_STATUS dp_tx_vdev_attach(struct dp_vdev *vdev)
|
|||||||
HTT_TX_TCL_METADATA_VDEV_ID_SET(vdev->htt_tcl_metadata,
|
HTT_TX_TCL_METADATA_VDEV_ID_SET(vdev->htt_tcl_metadata,
|
||||||
vdev->vdev_id);
|
vdev->vdev_id);
|
||||||
|
|
||||||
HTT_TX_TCL_METADATA_PDEV_ID_SET(vdev->htt_tcl_metadata,
|
pdev_id =
|
||||||
DP_SW2HW_MACID(vdev->pdev->pdev_id));
|
dp_get_target_pdev_id_for_host_pdev_id(vdev->pdev->soc,
|
||||||
|
vdev->pdev->pdev_id);
|
||||||
|
HTT_TX_TCL_METADATA_PDEV_ID_SET(vdev->htt_tcl_metadata, pdev_id);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Set HTT Extension Valid bit to 0 by default
|
* Set HTT Extension Valid bit to 0 by default
|
||||||
|
@@ -907,6 +907,32 @@ struct dp_soc {
|
|||||||
/* PDEVs on this SOC */
|
/* PDEVs on this SOC */
|
||||||
struct dp_pdev *pdev_list[MAX_PDEV_CNT];
|
struct dp_pdev *pdev_list[MAX_PDEV_CNT];
|
||||||
|
|
||||||
|
/* Ring used to replenish rx buffers (maybe to the firmware of MAC) */
|
||||||
|
struct dp_srng rx_refill_buf_ring[MAX_PDEV_CNT];
|
||||||
|
|
||||||
|
struct dp_srng rxdma_mon_desc_ring[MAX_NUM_LMAC_HW];
|
||||||
|
|
||||||
|
/* RXDMA error destination ring */
|
||||||
|
struct dp_srng rxdma_err_dst_ring[MAX_NUM_LMAC_HW];
|
||||||
|
|
||||||
|
/* Link descriptor memory banks */
|
||||||
|
struct {
|
||||||
|
void *base_vaddr_unaligned;
|
||||||
|
void *base_vaddr;
|
||||||
|
qdf_dma_addr_t base_paddr_unaligned;
|
||||||
|
qdf_dma_addr_t base_paddr;
|
||||||
|
uint32_t size;
|
||||||
|
} mon_link_desc_banks[MAX_NUM_LMAC_HW][MAX_MON_LINK_DESC_BANKS];
|
||||||
|
|
||||||
|
/* RXDMA monitor buffer replenish ring */
|
||||||
|
struct dp_srng rxdma_mon_buf_ring[MAX_NUM_LMAC_HW];
|
||||||
|
|
||||||
|
/* RXDMA monitor destination ring */
|
||||||
|
struct dp_srng rxdma_mon_dst_ring[MAX_NUM_LMAC_HW];
|
||||||
|
|
||||||
|
/* RXDMA monitor status ring. TBD: Check format of this ring */
|
||||||
|
struct dp_srng rxdma_mon_status_ring[MAX_NUM_LMAC_HW];
|
||||||
|
|
||||||
/* Number of PDEVs */
|
/* Number of PDEVs */
|
||||||
uint8_t pdev_count;
|
uint8_t pdev_count;
|
||||||
|
|
||||||
@@ -1407,32 +1433,6 @@ struct dp_pdev {
|
|||||||
/* TXRX SOC handle */
|
/* TXRX SOC handle */
|
||||||
struct dp_soc *soc;
|
struct dp_soc *soc;
|
||||||
|
|
||||||
/* Ring used to replenish rx buffers (maybe to the firmware of MAC) */
|
|
||||||
struct dp_srng rx_refill_buf_ring;
|
|
||||||
|
|
||||||
/* RXDMA error destination ring */
|
|
||||||
struct dp_srng rxdma_err_dst_ring[NUM_RXDMA_RINGS_PER_PDEV];
|
|
||||||
|
|
||||||
/* Link descriptor memory banks */
|
|
||||||
struct {
|
|
||||||
void *base_vaddr_unaligned;
|
|
||||||
void *base_vaddr;
|
|
||||||
qdf_dma_addr_t base_paddr_unaligned;
|
|
||||||
qdf_dma_addr_t base_paddr;
|
|
||||||
uint32_t size;
|
|
||||||
} link_desc_banks[NUM_RXDMA_RINGS_PER_PDEV][MAX_MON_LINK_DESC_BANKS];
|
|
||||||
|
|
||||||
/* RXDMA monitor buffer replenish ring */
|
|
||||||
struct dp_srng rxdma_mon_buf_ring[NUM_RXDMA_RINGS_PER_PDEV];
|
|
||||||
|
|
||||||
/* RXDMA monitor destination ring */
|
|
||||||
struct dp_srng rxdma_mon_dst_ring[NUM_RXDMA_RINGS_PER_PDEV];
|
|
||||||
|
|
||||||
/* RXDMA monitor status ring. TBD: Check format of this ring */
|
|
||||||
struct dp_srng rxdma_mon_status_ring[NUM_RXDMA_RINGS_PER_PDEV];
|
|
||||||
|
|
||||||
struct dp_srng rxdma_mon_desc_ring[NUM_RXDMA_RINGS_PER_PDEV];
|
|
||||||
|
|
||||||
/* Stuck count on monitor destination ring MPDU process */
|
/* Stuck count on monitor destination ring MPDU process */
|
||||||
uint32_t mon_dest_ring_stuck_cnt;
|
uint32_t mon_dest_ring_stuck_cnt;
|
||||||
|
|
||||||
|
@@ -476,11 +476,11 @@ wlan_cfg_soc_attach(struct cdp_ctrl_objmgr_psoc *psoc)
|
|||||||
|
|
||||||
/* This is default mapping and can be overridden by HW config
|
/* This is default mapping and can be overridden by HW config
|
||||||
* received from FW */
|
* received from FW */
|
||||||
wlan_cfg_set_hw_macid(wlan_cfg_ctx, 0, 1);
|
wlan_cfg_set_hw_mac_idx(wlan_cfg_ctx, 0, 0);
|
||||||
if (MAX_PDEV_CNT > 1)
|
if (MAX_PDEV_CNT > 1)
|
||||||
wlan_cfg_set_hw_macid(wlan_cfg_ctx, 1, 3);
|
wlan_cfg_set_hw_mac_idx(wlan_cfg_ctx, 1, 2);
|
||||||
if (MAX_PDEV_CNT > 2)
|
if (MAX_PDEV_CNT > 2)
|
||||||
wlan_cfg_set_hw_macid(wlan_cfg_ctx, 2, 2);
|
wlan_cfg_set_hw_mac_idx(wlan_cfg_ctx, 2, 1);
|
||||||
|
|
||||||
wlan_cfg_ctx->base_hw_macid = cfg_get(psoc, CFG_DP_BASE_HW_MAC_ID);
|
wlan_cfg_ctx->base_hw_macid = cfg_get(psoc, CFG_DP_BASE_HW_MAC_ID);
|
||||||
|
|
||||||
@@ -685,23 +685,45 @@ int wlan_cfg_get_host2rxdma_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg,
|
|||||||
return cfg->int_host2rxdma_ring_mask[context];
|
return cfg->int_host2rxdma_ring_mask[context];
|
||||||
}
|
}
|
||||||
|
|
||||||
void wlan_cfg_set_hw_macid(struct wlan_cfg_dp_soc_ctxt *cfg, int pdev_idx,
|
void wlan_cfg_set_hw_mac_idx(struct wlan_cfg_dp_soc_ctxt *cfg, int pdev_idx,
|
||||||
int hw_macid)
|
int hw_macid)
|
||||||
{
|
{
|
||||||
qdf_assert_always(pdev_idx < MAX_PDEV_CNT);
|
qdf_assert_always(pdev_idx < MAX_PDEV_CNT);
|
||||||
cfg->hw_macid[pdev_idx] = hw_macid;
|
cfg->hw_macid[pdev_idx] = hw_macid;
|
||||||
}
|
}
|
||||||
|
|
||||||
int wlan_cfg_get_hw_macid(struct wlan_cfg_dp_soc_ctxt *cfg, int pdev_idx)
|
int wlan_cfg_get_hw_mac_idx(struct wlan_cfg_dp_soc_ctxt *cfg, int pdev_idx)
|
||||||
{
|
{
|
||||||
qdf_assert_always(pdev_idx < MAX_PDEV_CNT);
|
qdf_assert_always(pdev_idx < MAX_PDEV_CNT);
|
||||||
return cfg->hw_macid[pdev_idx];
|
return cfg->hw_macid[pdev_idx];
|
||||||
}
|
}
|
||||||
|
|
||||||
int wlan_cfg_get_hw_mac_idx(struct wlan_cfg_dp_soc_ctxt *cfg, int pdev_idx)
|
int wlan_cfg_get_target_pdev_id(struct wlan_cfg_dp_soc_ctxt *cfg,
|
||||||
|
int hw_macid)
|
||||||
|
{
|
||||||
|
int idx;
|
||||||
|
|
||||||
|
for (idx = 0; idx < MAX_NUM_LMAC_HW; idx++) {
|
||||||
|
if (cfg->hw_macid[idx] == hw_macid)
|
||||||
|
return (idx + 1);
|
||||||
|
}
|
||||||
|
qdf_assert_always(idx < MAX_PDEV_CNT);
|
||||||
|
return WLAN_INVALID_PDEV_ID;
|
||||||
|
}
|
||||||
|
|
||||||
|
void wlan_cfg_set_pdev_idx(struct wlan_cfg_dp_soc_ctxt *cfg, int pdev_idx,
|
||||||
|
int hw_macid)
|
||||||
{
|
{
|
||||||
qdf_assert_always(pdev_idx < MAX_PDEV_CNT);
|
qdf_assert_always(pdev_idx < MAX_PDEV_CNT);
|
||||||
return cfg->hw_macid[pdev_idx] - cfg->base_hw_macid;
|
qdf_assert_always(hw_macid < MAX_NUM_LMAC_HW);
|
||||||
|
|
||||||
|
cfg->hw_macid_pdev_id_map[hw_macid] = pdev_idx;
|
||||||
|
}
|
||||||
|
|
||||||
|
int wlan_cfg_get_pdev_idx(struct wlan_cfg_dp_soc_ctxt *cfg, int hw_macid)
|
||||||
|
{
|
||||||
|
qdf_assert_always(hw_macid < MAX_NUM_LMAC_HW);
|
||||||
|
return cfg->hw_macid_pdev_id_map[hw_macid];
|
||||||
}
|
}
|
||||||
|
|
||||||
void wlan_cfg_set_ce_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg,
|
void wlan_cfg_set_ce_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg,
|
||||||
|
@@ -38,11 +38,16 @@
|
|||||||
#define DP_PPDU_TXLITE_STATS_BITMASK_CFG 0x3FFF
|
#define DP_PPDU_TXLITE_STATS_BITMASK_CFG 0x3FFF
|
||||||
|
|
||||||
#define NUM_RXDMA_RINGS_PER_PDEV 2
|
#define NUM_RXDMA_RINGS_PER_PDEV 2
|
||||||
|
|
||||||
|
/*Maximum Number of LMAC instances*/
|
||||||
|
#define MAX_NUM_LMAC_HW 2
|
||||||
#else
|
#else
|
||||||
#define WLAN_CFG_DST_RING_CACHED_DESC 1
|
#define WLAN_CFG_DST_RING_CACHED_DESC 1
|
||||||
#define MAX_PDEV_CNT 3
|
#define MAX_PDEV_CNT 3
|
||||||
#define WLAN_CFG_INT_NUM_CONTEXTS 11
|
#define WLAN_CFG_INT_NUM_CONTEXTS 11
|
||||||
#define NUM_RXDMA_RINGS_PER_PDEV 1
|
#define NUM_RXDMA_RINGS_PER_PDEV 1
|
||||||
|
#define MAX_NUM_LMAC_HW 3
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#define WLAN_CFG_INT_NUM_CONTEXTS_MAX 11
|
#define WLAN_CFG_INT_NUM_CONTEXTS_MAX 11
|
||||||
@@ -213,6 +218,7 @@ struct wlan_cfg_dp_soc_ctxt {
|
|||||||
int int_rxdma2host_ring_mask[WLAN_CFG_INT_NUM_CONTEXTS];
|
int int_rxdma2host_ring_mask[WLAN_CFG_INT_NUM_CONTEXTS];
|
||||||
int int_host2rxdma_ring_mask[WLAN_CFG_INT_NUM_CONTEXTS];
|
int int_host2rxdma_ring_mask[WLAN_CFG_INT_NUM_CONTEXTS];
|
||||||
int hw_macid[MAX_PDEV_CNT];
|
int hw_macid[MAX_PDEV_CNT];
|
||||||
|
int hw_macid_pdev_id_map[MAX_PDEV_CNT];
|
||||||
int base_hw_macid;
|
int base_hw_macid;
|
||||||
bool rx_hash;
|
bool rx_hash;
|
||||||
bool tso_enabled;
|
bool tso_enabled;
|
||||||
@@ -486,25 +492,15 @@ int wlan_cfg_get_rxdma2host_mon_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg,
|
|||||||
int context);
|
int context);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* wlan_cfg_set_hw_macid() - Set HW MAC Id for the given PDEV index
|
* wlan_cfg_set_hw_macidx() - Set HW MAC Idx for the given PDEV index
|
||||||
*
|
*
|
||||||
* @wlan_cfg_ctx - Configuration Handle
|
* @wlan_cfg_ctx - Configuration Handle
|
||||||
* @pdev_idx - Index of SW PDEV
|
* @pdev_idx - Index of SW PDEV
|
||||||
* @hw_macid - HW MAC Id
|
* @hw_macid - HW MAC Id
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
void wlan_cfg_set_hw_macid(struct wlan_cfg_dp_soc_ctxt *cfg, int pdev_idx,
|
void wlan_cfg_set_hw_mac_idx
|
||||||
int hw_macid);
|
(struct wlan_cfg_dp_soc_ctxt *cfg, int pdev_idx, int hw_macid);
|
||||||
|
|
||||||
/**
|
|
||||||
* wlan_cfg_get_hw_macid() - Get HW MAC Id for the given PDEV index
|
|
||||||
*
|
|
||||||
* @wlan_cfg_ctx - Configuration Handle
|
|
||||||
* @pdev_idx - Index of SW PDEV
|
|
||||||
*
|
|
||||||
* Return: HW MAC Id
|
|
||||||
*/
|
|
||||||
int wlan_cfg_get_hw_macid(struct wlan_cfg_dp_soc_ctxt *cfg, int pdev_idx);
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* wlan_cfg_get_hw_mac_idx() - Get 0 based HW MAC index for the given
|
* wlan_cfg_get_hw_mac_idx() - Get 0 based HW MAC index for the given
|
||||||
@@ -517,6 +513,41 @@ int wlan_cfg_get_hw_macid(struct wlan_cfg_dp_soc_ctxt *cfg, int pdev_idx);
|
|||||||
*/
|
*/
|
||||||
int wlan_cfg_get_hw_mac_idx(struct wlan_cfg_dp_soc_ctxt *cfg, int pdev_idx);
|
int wlan_cfg_get_hw_mac_idx(struct wlan_cfg_dp_soc_ctxt *cfg, int pdev_idx);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* wlan_cfg_get_target_pdev_id() - Get target PDEV ID for HW MAC ID
|
||||||
|
*
|
||||||
|
* @wlan_cfg_ctx - Configuration Handle
|
||||||
|
* @hw_macid - Index of hw mac
|
||||||
|
*
|
||||||
|
* Return: PDEV ID
|
||||||
|
*/
|
||||||
|
int
|
||||||
|
wlan_cfg_get_target_pdev_id(struct wlan_cfg_dp_soc_ctxt *cfg, int hw_macid);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* wlan_cfg_set_pdev_idx() - Set 0 based host PDEV index for the given
|
||||||
|
* hw mac index
|
||||||
|
*
|
||||||
|
* @wlan_cfg_ctx - Configuration Handle
|
||||||
|
* @pdev_idx - Index of SW PDEV
|
||||||
|
* @hw_macid - Index of hw mac
|
||||||
|
*
|
||||||
|
* Return: PDEV index
|
||||||
|
*/
|
||||||
|
void wlan_cfg_set_pdev_idx
|
||||||
|
(struct wlan_cfg_dp_soc_ctxt *cfg, int pdev_idx, int hw_macid);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* wlan_cfg_get_pdev_idx() - Get 0 based PDEV index for the given
|
||||||
|
* hw mac index
|
||||||
|
*
|
||||||
|
* @wlan_cfg_ctx - Configuration Handle
|
||||||
|
* @hw_macid - Index of hw mac
|
||||||
|
*
|
||||||
|
* Return: PDEV index
|
||||||
|
*/
|
||||||
|
int wlan_cfg_get_pdev_idx(struct wlan_cfg_dp_soc_ctxt *cfg, int hw_macid);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* wlan_cfg_get_rx_err_ring_mask() - Return Rx monitor ring interrupt mask
|
* wlan_cfg_get_rx_err_ring_mask() - Return Rx monitor ring interrupt mask
|
||||||
* mapped to an interrupt context
|
* mapped to an interrupt context
|
||||||
|
Reference in New Issue
Block a user