qcacmn: Add support to handle frames with HT/VHT/HE control field

Add support to handle the case where the peer transmits a frame
with HT/VHT/HE control field included.

Change-Id: I2b0d04ffa12a983a6c22e0a0bcbdfffa8fd48dcb
CRs-fixed: 2754234
This commit is contained in:
Rhythm Patwa
2020-06-14 18:28:26 -07:00
کامیت شده توسط snandini
والد 63c499059f
کامیت 360f0419df
3فایلهای تغییر یافته به همراه22 افزوده شده و 1 حذف شده

مشاهده پرونده

@@ -26,10 +26,12 @@
#include <osdep.h>
#define IEEE80211_CCMP_HEADERLEN 8
#define IEEE80211_HT_CTRL_LEN 4
#define IEEE80211_CCMP_MICLEN 8
#define WLAN_IEEE80211_GCMP_HEADERLEN 8
#define WLAN_IEEE80211_GCMP_MICLEN 16
#define IEEE80211_FC1_WEP 0x40
#define IEEE80211_FC1_ORDER 0x80
#define WLAN_HDR_IV_LEN 3
#define WLAN_HDR_EXT_IV_BIT 0x20
#define WLAN_HDR_EXT_IV_LEN 4

مشاهده پرونده

@@ -523,6 +523,12 @@ static inline uint8_t ieee80211_hdrsize(const void *data)
if (hdr->i_fc[1] & WLAN_FC1_ORDER)
size += (sizeof(uint8_t)*4);
}
if (((WLAN_FC0_GET_STYPE(hdr->i_fc[0])
== WLAN_FC0_STYPE_ACTION))) {
/* Action frame with Order bit set indicates an HTC frame */
if (hdr->i_fc[1] & WLAN_FC1_ORDER)
size += (sizeof(uint8_t)*4);
}
return size;
}

مشاهده پرونده

@@ -1036,6 +1036,7 @@ QDF_STATUS tgt_mgmt_txrx_rx_frame_handler(
struct mgmt_rx_handler *rx_handler_head = NULL, *rx_handler_tail = NULL;
u_int8_t *data, *ivp = NULL;
uint16_t buflen;
uint16_t len = 0;
QDF_STATUS status = QDF_STATUS_SUCCESS;
bool is_from_addr_valid, is_bssid_valid;
@@ -1099,13 +1100,25 @@ QDF_STATUS tgt_mgmt_txrx_rx_frame_handler(
/* mpdu_data_ptr is pointer to action header */
mpdu_data_ptr = (uint8_t *)qdf_nbuf_data(buf) +
sizeof(struct ieee80211_frame);
if (wh->i_fc[1] & IEEE80211_FC1_ORDER) {
/* Adjust the offset taking into consideration HT control field
* length, in the case when peer sends a frame with HT/VHT/HE
* ctrl field in the header(when frame is transmitted in TB
* PPDU format).
*/
mpdu_data_ptr += IEEE80211_HT_CTRL_LEN;
len = IEEE80211_HT_CTRL_LEN;
mgmt_txrx_debug_rl("HT control field present!");
}
if ((wh->i_fc[1] & IEEE80211_FC1_WEP) &&
!qdf_is_macaddr_group((struct qdf_mac_addr *)wh->i_addr1) &&
!qdf_is_macaddr_broadcast((struct qdf_mac_addr *)wh->i_addr1)) {
if (buflen > (sizeof(struct ieee80211_frame) +
WLAN_HDR_EXT_IV_LEN))
ivp = data + sizeof(struct ieee80211_frame);
ivp = data + sizeof(struct ieee80211_frame) + len;
/* Set mpdu_data_ptr based on EXT IV bit
* if EXT IV bit set, CCMP using PMF 8 bytes of IV is present