qcacmn: Add support to include ACK status and tx retry count
Extend radiotap header to append ACK status and tx retry count for packets sent to virtual mon interface. Change-Id: I51037ffd11dfdee49278d43643fb7861a514ee18 CRs-Fixed: 2627710
This commit is contained in:

committed by
nshrivas

parent
5ad9b66679
commit
616976e2ce
@@ -242,6 +242,9 @@
|
|||||||
* @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
|
* @rssi_chain: Rssi chain per nss per bw
|
||||||
|
* @tx_status: packet tx status
|
||||||
|
* @tx_retry_cnt: tx retry count
|
||||||
|
* @add_rtap_ext: add radio tap extension
|
||||||
*/
|
*/
|
||||||
struct mon_rx_status {
|
struct mon_rx_status {
|
||||||
uint64_t tsft;
|
uint64_t tsft;
|
||||||
@@ -323,6 +326,9 @@ struct mon_rx_status {
|
|||||||
uint8_t rxpcu_filter_pass;
|
uint8_t rxpcu_filter_pass;
|
||||||
int8_t rssi_chain[8][8];
|
int8_t rssi_chain[8][8];
|
||||||
uint32_t rx_antenna;
|
uint32_t rx_antenna;
|
||||||
|
uint8_t tx_status;
|
||||||
|
uint8_t tx_retry_cnt;
|
||||||
|
bool add_rtap_ext;
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@@ -4067,6 +4067,8 @@ qdf_nbuf_update_radiotap_he_mu_other_flags(struct mon_rx_status *rx_status,
|
|||||||
return rtap_len;
|
return rtap_len;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#define IEEE80211_RADIOTAP_TX_STATUS 0
|
||||||
|
#define IEEE80211_RADIOTAP_RETRY_COUNT 1
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This is the length for radiotap, combined length
|
* This is the length for radiotap, combined length
|
||||||
@@ -4085,6 +4087,11 @@ qdf_nbuf_update_radiotap_he_mu_other_flags(struct mon_rx_status *rx_status,
|
|||||||
#define RADIOTAP_AMPDU_STATUS_LEN (8 + 3)
|
#define RADIOTAP_AMPDU_STATUS_LEN (8 + 3)
|
||||||
#define RADIOTAP_VENDOR_NS_LEN \
|
#define RADIOTAP_VENDOR_NS_LEN \
|
||||||
(sizeof(struct qdf_radiotap_vendor_ns_ath) + 1)
|
(sizeof(struct qdf_radiotap_vendor_ns_ath) + 1)
|
||||||
|
/* This is Radio Tap Header Extension Length.
|
||||||
|
* 4 Bytes for Extended it_present bit map +
|
||||||
|
* 4 bytes padding for alignment
|
||||||
|
*/
|
||||||
|
#define RADIOTAP_HEADER_EXT_LEN (2 * sizeof(uint32_t))
|
||||||
#define RADIOTAP_HEADER_LEN (sizeof(struct ieee80211_radiotap_header) + \
|
#define RADIOTAP_HEADER_LEN (sizeof(struct ieee80211_radiotap_header) + \
|
||||||
RADIOTAP_FIXED_HEADER_LEN + \
|
RADIOTAP_FIXED_HEADER_LEN + \
|
||||||
RADIOTAP_HT_FLAGS_LEN + \
|
RADIOTAP_HT_FLAGS_LEN + \
|
||||||
@@ -4093,7 +4100,8 @@ qdf_nbuf_update_radiotap_he_mu_other_flags(struct mon_rx_status *rx_status,
|
|||||||
RADIOTAP_HE_FLAGS_LEN + \
|
RADIOTAP_HE_FLAGS_LEN + \
|
||||||
RADIOTAP_HE_MU_FLAGS_LEN + \
|
RADIOTAP_HE_MU_FLAGS_LEN + \
|
||||||
RADIOTAP_HE_MU_OTHER_FLAGS_LEN + \
|
RADIOTAP_HE_MU_OTHER_FLAGS_LEN + \
|
||||||
RADIOTAP_VENDOR_NS_LEN)
|
RADIOTAP_VENDOR_NS_LEN + \
|
||||||
|
RADIOTAP_HEADER_EXT_LEN)
|
||||||
|
|
||||||
#define IEEE80211_RADIOTAP_HE 23
|
#define IEEE80211_RADIOTAP_HE 23
|
||||||
#define IEEE80211_RADIOTAP_HE_MU 24
|
#define IEEE80211_RADIOTAP_HE_MU 24
|
||||||
@@ -4152,6 +4160,14 @@ unsigned int qdf_nbuf_update_radiotap(struct mon_rx_status *rx_status,
|
|||||||
uint32_t rtap_len = rtap_hdr_len;
|
uint32_t rtap_len = rtap_hdr_len;
|
||||||
uint8_t length = rtap_len;
|
uint8_t length = rtap_len;
|
||||||
struct qdf_radiotap_vendor_ns_ath *radiotap_vendor_ns_ath;
|
struct qdf_radiotap_vendor_ns_ath *radiotap_vendor_ns_ath;
|
||||||
|
uint32_t *rtap_ext = NULL;
|
||||||
|
|
||||||
|
/* Adding Extended Header space */
|
||||||
|
if (rx_status->add_rtap_ext) {
|
||||||
|
rtap_hdr_len += RADIOTAP_HEADER_EXT_LEN;
|
||||||
|
rtap_len = rtap_hdr_len;
|
||||||
|
}
|
||||||
|
length = rtap_len;
|
||||||
|
|
||||||
/* IEEE80211_RADIOTAP_TSFT __le64 microseconds*/
|
/* IEEE80211_RADIOTAP_TSFT __le64 microseconds*/
|
||||||
rthdr->it_present = (1 << IEEE80211_RADIOTAP_TSFT);
|
rthdr->it_present = (1 << IEEE80211_RADIOTAP_TSFT);
|
||||||
@@ -4335,6 +4351,20 @@ unsigned int qdf_nbuf_update_radiotap(struct mon_rx_status *rx_status,
|
|||||||
cpu_to_le32(rx_status->ppdu_timestamp);
|
cpu_to_le32(rx_status->ppdu_timestamp);
|
||||||
rtap_len += sizeof(*radiotap_vendor_ns_ath);
|
rtap_len += sizeof(*radiotap_vendor_ns_ath);
|
||||||
|
|
||||||
|
/* Add Extension to Radiotap Header & corresponding data */
|
||||||
|
if (rx_status->add_rtap_ext) {
|
||||||
|
rthdr->it_present |= cpu_to_le32(1 << IEEE80211_RADIOTAP_EXT);
|
||||||
|
rtap_ext = (uint32_t *)&rthdr->it_present;
|
||||||
|
rtap_ext++;
|
||||||
|
*rtap_ext = cpu_to_le32(1 << IEEE80211_RADIOTAP_TX_STATUS);
|
||||||
|
*rtap_ext |= cpu_to_le32(1 << IEEE80211_RADIOTAP_RETRY_COUNT);
|
||||||
|
|
||||||
|
rtap_buf[rtap_len] = rx_status->tx_status;
|
||||||
|
rtap_len += 1;
|
||||||
|
rtap_buf[rtap_len] = rx_status->tx_retry_cnt;
|
||||||
|
rtap_len += 1;
|
||||||
|
}
|
||||||
|
|
||||||
rthdr->it_len = cpu_to_le16(rtap_len);
|
rthdr->it_len = cpu_to_le16(rtap_len);
|
||||||
rthdr->it_present = cpu_to_le32(rthdr->it_present);
|
rthdr->it_present = cpu_to_le32(rthdr->it_present);
|
||||||
|
|
||||||
|
@@ -13251,6 +13251,7 @@ extract_vdev_mgmt_offload_event_tlv(void *handle, void *evt_buf,
|
|||||||
params->buf_len = hdr->buf_len;
|
params->buf_len = hdr->buf_len;
|
||||||
params->tx_status = hdr->tx_status;
|
params->tx_status = hdr->tx_status;
|
||||||
params->buf = param_tlvs->bufp;
|
params->buf = param_tlvs->bufp;
|
||||||
|
params->tx_retry_cnt = hdr->tx_retry_cnt;
|
||||||
return QDF_STATUS_SUCCESS;
|
return QDF_STATUS_SUCCESS;
|
||||||
}
|
}
|
||||||
#endif /* WLAN_FEATURE_PKT_CAPTURE */
|
#endif /* WLAN_FEATURE_PKT_CAPTURE */
|
||||||
|
Reference in New Issue
Block a user