qcacmn: Fix wrong rssi in monitor mode
If ppdu rssi unit is dbm, need convert to db for API: qdf_nbuf_update_radiotap, only need convert once for first mdpu in the ppdu. if convert for each mpdu, wrong rssi will be saved. Change-Id: I85e92121ddb289e3513022ff092083825197efb4 CRs-Fixed: 3057041
This commit is contained in:

committed by
Madan Koyyalamudi

parent
a317f7c615
commit
fb1db30308
@@ -1419,8 +1419,6 @@ QDF_STATUS dp_rx_mon_deliver(struct dp_soc *soc, uint32_t mac_id,
|
|||||||
mon_pdev->ppdu_info.rx_status.device_id = soc->device_id;
|
mon_pdev->ppdu_info.rx_status.device_id = soc->device_id;
|
||||||
mon_pdev->ppdu_info.rx_status.chan_noise_floor =
|
mon_pdev->ppdu_info.rx_status.chan_noise_floor =
|
||||||
pdev->chan_noise_floor;
|
pdev->chan_noise_floor;
|
||||||
/* convert rssi_comb from dBm to positive dB value */
|
|
||||||
dp_rx_mon_rssi_convert(&mon_pdev->ppdu_info.rx_status);
|
|
||||||
|
|
||||||
dp_handle_tx_capture(soc, pdev, mon_mpdu);
|
dp_handle_tx_capture(soc, pdev, mon_mpdu);
|
||||||
|
|
||||||
|
@@ -581,28 +581,6 @@ dp_cfr_rcc_mode_status(struct dp_pdev *pdev)
|
|||||||
}
|
}
|
||||||
#endif /* WLAN_CFR_ENABLE && WLAN_ENH_CFR_ENABLE */
|
#endif /* WLAN_CFR_ENABLE && WLAN_ENH_CFR_ENABLE */
|
||||||
|
|
||||||
|
|
||||||
#ifdef DP_MON_RSSI_IN_DBM
|
|
||||||
/*
|
|
||||||
* dp_rx_mon_rssi_convert(): convert rssi_comb from unit dBm to dB
|
|
||||||
* to match with radiotap further conversion requirement
|
|
||||||
* @rx_status: monitor mode rx status pointer
|
|
||||||
*
|
|
||||||
* Return: none
|
|
||||||
*/
|
|
||||||
static inline
|
|
||||||
void dp_rx_mon_rssi_convert(struct mon_rx_status *rx_status)
|
|
||||||
{
|
|
||||||
rx_status->rssi_comb = rx_status->rssi_comb -
|
|
||||||
rx_status->chan_noise_floor;
|
|
||||||
}
|
|
||||||
#else
|
|
||||||
static inline
|
|
||||||
void dp_rx_mon_rssi_convert(struct mon_rx_status *rx_status)
|
|
||||||
{
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* dp_rx_mon_deliver(): function to deliver packets to stack
|
* dp_rx_mon_deliver(): function to deliver packets to stack
|
||||||
* @soc: DP soc
|
* @soc: DP soc
|
||||||
|
@@ -4630,6 +4630,14 @@ static unsigned int qdf_nbuf_update_radiotap_ampdu_flags(
|
|||||||
return rtap_len;
|
return rtap_len;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifdef DP_MON_RSSI_IN_DBM
|
||||||
|
#define QDF_MON_STATUS_GET_RSSI_IN_DBM(rx_status) \
|
||||||
|
(rx_status->rssi_comb)
|
||||||
|
#else
|
||||||
|
#define QDF_MON_STATUS_GET_RSSI_IN_DBM(rx_status) \
|
||||||
|
(rx_status->rssi_comb + rx_status->chan_noise_floor)
|
||||||
|
#endif
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* qdf_nbuf_update_radiotap() - Update radiotap header from rx_status
|
* qdf_nbuf_update_radiotap() - Update radiotap header from rx_status
|
||||||
* @rx_status: Pointer to rx_status.
|
* @rx_status: Pointer to rx_status.
|
||||||
@@ -4705,7 +4713,7 @@ unsigned int qdf_nbuf_update_radiotap(struct mon_rx_status *rx_status,
|
|||||||
* rssi_comb is int dB, need to convert it to dBm.
|
* rssi_comb is int dB, need to convert it to dBm.
|
||||||
* normalize value to noise floor of -96 dBm
|
* normalize value to noise floor of -96 dBm
|
||||||
*/
|
*/
|
||||||
rtap_buf[rtap_len] = rx_status->rssi_comb + rx_status->chan_noise_floor;
|
rtap_buf[rtap_len] = QDF_MON_STATUS_GET_RSSI_IN_DBM(rx_status);
|
||||||
rtap_len += 1;
|
rtap_len += 1;
|
||||||
|
|
||||||
/* RX signal noise floor */
|
/* RX signal noise floor */
|
||||||
|
Reference in New Issue
Block a user