mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-11 07:03:09 -04:00
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:
parent
3bd491ab96
commit
871a0512ab
2 changed files with 9 additions and 24 deletions
|
|
@ -1411,27 +1411,6 @@ qdf_nbuf_t dp_rx_mon_restitch_mpdu(struct dp_soc *soc, uint32_t mac_id,
|
|||
}
|
||||
#endif
|
||||
|
||||
#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
|
||||
* @soc: DP soc
|
||||
|
|
@ -1469,8 +1448,6 @@ QDF_STATUS dp_rx_mon_deliver(struct dp_soc *soc, uint32_t mac_id,
|
|||
pdev->ppdu_info.rx_status.device_id = soc->device_id;
|
||||
pdev->ppdu_info.rx_status.chan_noise_floor =
|
||||
pdev->chan_noise_floor;
|
||||
/* convert rssi_comb from dBm to positive dB value */
|
||||
dp_rx_mon_rssi_convert(&pdev->ppdu_info.rx_status);
|
||||
|
||||
dp_handle_tx_capture(soc, pdev, mon_mpdu);
|
||||
|
||||
|
|
|
|||
|
|
@ -4504,6 +4504,14 @@ static unsigned int qdf_nbuf_update_radiotap_ampdu_flags(
|
|||
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
|
||||
* @rx_status: Pointer to rx_status.
|
||||
|
|
@ -4579,7 +4587,7 @@ unsigned int qdf_nbuf_update_radiotap(struct mon_rx_status *rx_status,
|
|||
* rssi_comb is int dB, need to convert it to 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;
|
||||
|
||||
/* RX signal noise floor */
|
||||
|
|
|
|||
Loading…
Reference in a new issue