qcacmn: Add rssi_chain support for lithium

Read rssi_chain per nss per bw and from rx status TLVs
and update to host data structures.

CRs-Fixed: 2445933
Change-Id: I275e9e502a0a724410fc189ac293cadc8f2981e0
This commit is contained in:
Amir Patel
2019-04-25 11:49:01 +05:30
committed by nshrivas
parent dd382b0d49
commit 1d4ac98ffe
5 changed files with 73 additions and 2 deletions

View File

@@ -1513,7 +1513,7 @@ struct cdp_rx_indication_ppdu {
uint8_t rx_ratecode; uint8_t rx_ratecode;
uint8_t fcs_error_mpdus; uint8_t fcs_error_mpdus;
uint16_t frame_ctrl; uint16_t frame_ctrl;
uint32_t rssi_chain[SS_COUNT][MAX_BW]; int8_t rssi_chain[SS_COUNT][MAX_BW];
struct cdp_stats_cookie *cookie; struct cdp_stats_cookie *cookie;
}; };

View File

@@ -24,6 +24,7 @@
#define RX_BUFFER_SIZE_PKTLOG_LITE 1024 #define RX_BUFFER_SIZE_PKTLOG_LITE 1024
#define DP_RSSI_INVAL 0x80
#define DP_RSSI_AVG_WEIGHT 2 #define DP_RSSI_AVG_WEIGHT 2
/* /*
* Formula to derive avg_rssi is taken from wifi2.o firmware * Formula to derive avg_rssi is taken from wifi2.o firmware

View File

@@ -51,6 +51,25 @@ dp_rx_mon_enh_capture_process(struct dp_pdev *pdev, uint32_t tlv_status,
} }
#endif #endif
#ifdef FEATURE_PERPKT_INFO
static inline void
dp_rx_populate_rx_rssi_chain(struct hal_rx_ppdu_info *ppdu_info,
struct cdp_rx_indication_ppdu *cdp_rx_ppdu)
{
uint8_t chain, bw;
int8_t rssi;
for (chain = 0; chain < SS_COUNT; chain++) {
for (bw = 0; bw < MAX_BW; bw++) {
rssi = ppdu_info->rx_status.rssi_chain[chain][bw];
if (rssi != DP_RSSI_INVAL)
cdp_rx_ppdu->rssi_chain[chain][bw] = rssi;
else
cdp_rx_ppdu->rssi_chain[chain][bw] = 0;
}
}
}
/** /**
* dp_rx_populate_cdp_indication_ppdu() - Populate cdp rx indication structure * dp_rx_populate_cdp_indication_ppdu() - Populate cdp rx indication structure
* @pdev: pdev ctx * @pdev: pdev ctx
@@ -59,7 +78,6 @@ dp_rx_mon_enh_capture_process(struct dp_pdev *pdev, uint32_t tlv_status,
* *
* Return: none * Return: none
*/ */
#ifdef FEATURE_PERPKT_INFO
static inline void static inline void
dp_rx_populate_cdp_indication_ppdu(struct dp_pdev *pdev, dp_rx_populate_cdp_indication_ppdu(struct dp_pdev *pdev,
struct hal_rx_ppdu_info *ppdu_info, struct hal_rx_ppdu_info *ppdu_info,
@@ -138,6 +156,8 @@ dp_rx_populate_cdp_indication_ppdu(struct dp_pdev *pdev,
cdp_rx_ppdu->peer_id = peer->peer_ids[0]; cdp_rx_ppdu->peer_id = peer->peer_ids[0];
cdp_rx_ppdu->vdev_id = peer->vdev->vdev_id; cdp_rx_ppdu->vdev_id = peer->vdev->vdev_id;
cdp_rx_ppdu->u.ltf_size = ppdu_info->rx_status.ltf_size; cdp_rx_ppdu->u.ltf_size = ppdu_info->rx_status.ltf_size;
dp_rx_populate_rx_rssi_chain(ppdu_info, cdp_rx_ppdu);
} }
#else #else
static inline void static inline void

View File

@@ -265,6 +265,53 @@ hal_rx_handle_ofdma_info(void *rx_tlv,
} }
#endif #endif
#define HAL_RX_UPDATE_RSSI_PER_CHAIN_BW(chain, word_1, word_2, \
ppdu_info, rssi_info_tlv) \
{ \
ppdu_info->rx_status.rssi_chain[chain][0] = \
HAL_RX_GET(rssi_info_tlv, RECEIVE_RSSI_INFO_##word_1,\
RSSI_PRI20_CHAIN##chain); \
ppdu_info->rx_status.rssi_chain[chain][1] = \
HAL_RX_GET(rssi_info_tlv, RECEIVE_RSSI_INFO_##word_1,\
RSSI_EXT20_CHAIN##chain); \
ppdu_info->rx_status.rssi_chain[chain][2] = \
HAL_RX_GET(rssi_info_tlv, RECEIVE_RSSI_INFO_##word_1,\
RSSI_EXT40_LOW20_CHAIN##chain); \
ppdu_info->rx_status.rssi_chain[chain][3] = \
HAL_RX_GET(rssi_info_tlv, RECEIVE_RSSI_INFO_##word_1,\
RSSI_EXT40_HIGH20_CHAIN##chain); \
ppdu_info->rx_status.rssi_chain[chain][4] = \
HAL_RX_GET(rssi_info_tlv, RECEIVE_RSSI_INFO_##word_2,\
RSSI_EXT80_LOW20_CHAIN##chain); \
ppdu_info->rx_status.rssi_chain[chain][5] = \
HAL_RX_GET(rssi_info_tlv, RECEIVE_RSSI_INFO_##word_2,\
RSSI_EXT80_LOW_HIGH20_CHAIN##chain); \
ppdu_info->rx_status.rssi_chain[chain][6] = \
HAL_RX_GET(rssi_info_tlv, RECEIVE_RSSI_INFO_##word_2,\
RSSI_EXT80_HIGH_LOW20_CHAIN##chain); \
ppdu_info->rx_status.rssi_chain[chain][7] = \
HAL_RX_GET(rssi_info_tlv, RECEIVE_RSSI_INFO_##word_2,\
RSSI_EXT80_HIGH20_CHAIN##chain); \
} \
#define HAL_RX_PPDU_UPDATE_RSSI(ppdu_info, rssi_info_tlv) \
{HAL_RX_UPDATE_RSSI_PER_CHAIN_BW(0, 0, 1, ppdu_info, rssi_info_tlv) \
HAL_RX_UPDATE_RSSI_PER_CHAIN_BW(1, 2, 3, ppdu_info, rssi_info_tlv) \
HAL_RX_UPDATE_RSSI_PER_CHAIN_BW(2, 4, 5, ppdu_info, rssi_info_tlv) \
HAL_RX_UPDATE_RSSI_PER_CHAIN_BW(3, 6, 7, ppdu_info, rssi_info_tlv) \
HAL_RX_UPDATE_RSSI_PER_CHAIN_BW(4, 8, 9, ppdu_info, rssi_info_tlv) \
HAL_RX_UPDATE_RSSI_PER_CHAIN_BW(5, 10, 11, ppdu_info, rssi_info_tlv) \
HAL_RX_UPDATE_RSSI_PER_CHAIN_BW(6, 12, 13, ppdu_info, rssi_info_tlv) \
HAL_RX_UPDATE_RSSI_PER_CHAIN_BW(7, 14, 15, ppdu_info, rssi_info_tlv)} \
static inline uint32_t
hal_rx_update_rssi_chain(struct hal_rx_ppdu_info *ppdu_info,
uint8_t *rssi_info_tlv)
{
HAL_RX_PPDU_UPDATE_RSSI(ppdu_info, rssi_info_tlv)
return 0;
}
/** /**
* hal_rx_status_get_tlv_info() - process receive info TLV * hal_rx_status_get_tlv_info() - process receive info TLV
* @rx_tlv_hdr: pointer to TLV header * @rx_tlv_hdr: pointer to TLV header
@@ -1103,6 +1150,7 @@ hal_rx_status_get_tlv_info_generic(void *rx_tlv_hdr, void *ppduinfo,
default: default:
break; break;
} }
hal_rx_update_rssi_chain(ppdu_info, rssi_info_tlv);
value = HAL_RX_GET(rssi_info_tlv, value = HAL_RX_GET(rssi_info_tlv,
RECEIVE_RSSI_INFO_0, RSSI_PRI20_CHAIN0); RECEIVE_RSSI_INFO_0, RSSI_PRI20_CHAIN0);
ppdu_info->rx_status.rssi[0] = value; ppdu_info->rx_status.rssi[0] = value;

View File

@@ -236,6 +236,7 @@
* @first_data_seq_ctrl: Sequence ctrl field of first data frame * @first_data_seq_ctrl: Sequence ctrl field of first data frame
* @rxpcu_filter_pass: Flag which indicates whether RX packets are received in * @rxpcu_filter_pass: Flag which indicates whether RX packets are received in
* BSS mode(not in promisc mode) * BSS mode(not in promisc mode)
* @rssi_chain: Rssi chain per nss per bw
*/ */
struct mon_rx_status { struct mon_rx_status {
uint64_t tsft; uint64_t tsft;
@@ -315,6 +316,7 @@ struct mon_rx_status {
uint16_t first_data_seq_ctrl; uint16_t first_data_seq_ctrl;
uint8_t ltf_size; uint8_t ltf_size;
uint8_t rxpcu_filter_pass; uint8_t rxpcu_filter_pass;
int8_t rssi_chain[8][8];
}; };
/** /**