qcacmn: Get dp vdev from HTT vdev id in MEC notify
In HTT MEC notification, wifi vdev should be mapped from vdev_id provided in HTT WBM completion status word Change-Id: Ic0a440efdbdc1ee99f27fb4797ee068599d06268
This commit is contained in:
@@ -4305,6 +4305,7 @@ dp_tx_comp_process_desc_list(struct dp_soc *soc,
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* dp_tx_process_htt_completion() - Tx HTT Completion Indication Handler
|
* dp_tx_process_htt_completion() - Tx HTT Completion Indication Handler
|
||||||
|
* @soc: Handle to DP soc structure
|
||||||
* @tx_desc: software descriptor head pointer
|
* @tx_desc: software descriptor head pointer
|
||||||
* @status : Tx completion status from HTT descriptor
|
* @status : Tx completion status from HTT descriptor
|
||||||
* @ring_id: ring number
|
* @ring_id: ring number
|
||||||
@@ -4314,18 +4315,47 @@ dp_tx_comp_process_desc_list(struct dp_soc *soc,
|
|||||||
* Return: none
|
* Return: none
|
||||||
*/
|
*/
|
||||||
static
|
static
|
||||||
void dp_tx_process_htt_completion(struct dp_tx_desc_s *tx_desc, uint8_t *status,
|
void dp_tx_process_htt_completion(struct dp_soc *soc,
|
||||||
|
struct dp_tx_desc_s *tx_desc, uint8_t *status,
|
||||||
uint8_t ring_id)
|
uint8_t ring_id)
|
||||||
{
|
{
|
||||||
uint8_t tx_status;
|
uint8_t tx_status;
|
||||||
struct dp_pdev *pdev;
|
struct dp_pdev *pdev;
|
||||||
struct dp_vdev *vdev;
|
struct dp_vdev *vdev;
|
||||||
struct dp_soc *soc;
|
|
||||||
struct hal_tx_completion_status ts = {0};
|
struct hal_tx_completion_status ts = {0};
|
||||||
uint32_t *htt_desc = (uint32_t *)status;
|
uint32_t *htt_desc = (uint32_t *)status;
|
||||||
struct dp_peer *peer;
|
struct dp_peer *peer;
|
||||||
struct cdp_tid_tx_stats *tid_stats = NULL;
|
struct cdp_tid_tx_stats *tid_stats = NULL;
|
||||||
struct htt_soc *htt_handle;
|
struct htt_soc *htt_handle;
|
||||||
|
uint8_t vdev_id;
|
||||||
|
|
||||||
|
tx_status = HTT_TX_WBM_COMPLETION_V2_TX_STATUS_GET(htt_desc[0]);
|
||||||
|
htt_handle = (struct htt_soc *)soc->htt_handle;
|
||||||
|
htt_wbm_event_record(htt_handle->htt_logger_handle, tx_status, status);
|
||||||
|
|
||||||
|
/*
|
||||||
|
* There can be scenario where WBM consuming descriptor enqueued
|
||||||
|
* from TQM2WBM first and TQM completion can happen before MEC
|
||||||
|
* notification comes from FW2WBM. Avoid access any field of tx
|
||||||
|
* descriptor in case of MEC notify.
|
||||||
|
*/
|
||||||
|
if (tx_status == HTT_TX_FW2WBM_TX_STATUS_MEC_NOTIFY) {
|
||||||
|
/*
|
||||||
|
* Get vdev id from HTT status word in case of MEC
|
||||||
|
* notification
|
||||||
|
*/
|
||||||
|
vdev_id = HTT_TX_WBM_COMPLETION_V2_VDEV_ID_GET(htt_desc[3]);
|
||||||
|
if (qdf_unlikely(vdev_id >= MAX_VDEV_CNT))
|
||||||
|
return;
|
||||||
|
|
||||||
|
vdev = dp_vdev_get_ref_by_id(soc, vdev_id,
|
||||||
|
DP_MOD_ID_HTT_COMP);
|
||||||
|
if (!vdev)
|
||||||
|
return;
|
||||||
|
dp_tx_mec_handler(vdev, status);
|
||||||
|
dp_vdev_unref_delete(soc, vdev, DP_MOD_ID_HTT_COMP);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* If the descriptor is already freed in vdev_detach,
|
* If the descriptor is already freed in vdev_detach,
|
||||||
@@ -4333,20 +4363,19 @@ void dp_tx_process_htt_completion(struct dp_tx_desc_s *tx_desc, uint8_t *status,
|
|||||||
*/
|
*/
|
||||||
if ((tx_desc->vdev_id == DP_INVALID_VDEV_ID) && !tx_desc->flags) {
|
if ((tx_desc->vdev_id == DP_INVALID_VDEV_ID) && !tx_desc->flags) {
|
||||||
QDF_TRACE(QDF_MODULE_ID_DP,
|
QDF_TRACE(QDF_MODULE_ID_DP,
|
||||||
QDF_TRACE_LEVEL_INFO,
|
QDF_TRACE_LEVEL_INFO,
|
||||||
"Descriptor freed in vdev_detach %d",
|
"Descriptor freed in vdev_detach %d",
|
||||||
tx_desc->id);
|
tx_desc->id);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
pdev = tx_desc->pdev;
|
pdev = tx_desc->pdev;
|
||||||
soc = pdev->soc;
|
|
||||||
|
|
||||||
if (qdf_unlikely(tx_desc->pdev->is_pdev_down)) {
|
if (qdf_unlikely(tx_desc->pdev->is_pdev_down)) {
|
||||||
QDF_TRACE(QDF_MODULE_ID_DP,
|
QDF_TRACE(QDF_MODULE_ID_DP,
|
||||||
QDF_TRACE_LEVEL_INFO,
|
QDF_TRACE_LEVEL_INFO,
|
||||||
"pdev in down state %d",
|
"pdev in down state %d",
|
||||||
tx_desc->id);
|
tx_desc->id);
|
||||||
dp_tx_comp_free_buf(soc, tx_desc);
|
dp_tx_comp_free_buf(soc, tx_desc);
|
||||||
dp_tx_desc_release(tx_desc, tx_desc->pool_id);
|
dp_tx_desc_release(tx_desc, tx_desc->pool_id);
|
||||||
return;
|
return;
|
||||||
@@ -4354,14 +4383,12 @@ void dp_tx_process_htt_completion(struct dp_tx_desc_s *tx_desc, uint8_t *status,
|
|||||||
|
|
||||||
qdf_assert(tx_desc->pdev);
|
qdf_assert(tx_desc->pdev);
|
||||||
|
|
||||||
vdev = dp_vdev_get_ref_by_id(soc, tx_desc->vdev_id,
|
vdev_id = tx_desc->vdev_id;
|
||||||
DP_MOD_ID_HTT_COMP);
|
vdev = dp_vdev_get_ref_by_id(soc, vdev_id,
|
||||||
|
DP_MOD_ID_HTT_COMP);
|
||||||
|
|
||||||
if (!vdev)
|
if (!vdev)
|
||||||
return;
|
return;
|
||||||
tx_status = HTT_TX_WBM_COMPLETION_V2_TX_STATUS_GET(htt_desc[0]);
|
|
||||||
htt_handle = (struct htt_soc *)soc->htt_handle;
|
|
||||||
htt_wbm_event_record(htt_handle->htt_logger_handle, tx_status, status);
|
|
||||||
|
|
||||||
switch (tx_status) {
|
switch (tx_status) {
|
||||||
case HTT_TX_FW2WBM_TX_STATUS_OK:
|
case HTT_TX_FW2WBM_TX_STATUS_OK:
|
||||||
@@ -4424,11 +4451,6 @@ void dp_tx_process_htt_completion(struct dp_tx_desc_s *tx_desc, uint8_t *status,
|
|||||||
dp_tx_inspect_handler(soc, vdev, tx_desc, status);
|
dp_tx_inspect_handler(soc, vdev, tx_desc, status);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case HTT_TX_FW2WBM_TX_STATUS_MEC_NOTIFY:
|
|
||||||
{
|
|
||||||
dp_tx_mec_handler(vdev, status);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
default:
|
default:
|
||||||
QDF_TRACE(QDF_MODULE_ID_DP, QDF_TRACE_LEVEL_DEBUG,
|
QDF_TRACE(QDF_MODULE_ID_DP, QDF_TRACE_LEVEL_DEBUG,
|
||||||
"%s Invalid HTT tx_status %d\n",
|
"%s Invalid HTT tx_status %d\n",
|
||||||
@@ -4582,7 +4604,7 @@ more_data:
|
|||||||
uint8_t htt_tx_status[HAL_TX_COMP_HTT_STATUS_LEN];
|
uint8_t htt_tx_status[HAL_TX_COMP_HTT_STATUS_LEN];
|
||||||
hal_tx_comp_get_htt_desc(tx_comp_hal_desc,
|
hal_tx_comp_get_htt_desc(tx_comp_hal_desc,
|
||||||
htt_tx_status);
|
htt_tx_status);
|
||||||
dp_tx_process_htt_completion(tx_desc,
|
dp_tx_process_htt_completion(soc, tx_desc,
|
||||||
htt_tx_status, ring_id);
|
htt_tx_status, ring_id);
|
||||||
} else {
|
} else {
|
||||||
tx_desc->peer_id =
|
tx_desc->peer_id =
|
||||||
|
Reference in New Issue
Block a user