From 6772e2d6fd92124a28c770b56e4df480fa6dc983 Mon Sep 17 00:00:00 2001 From: Himani Gupta Date: Tue, 3 Jul 2018 12:02:52 +0530 Subject: [PATCH] [7880][7872][7885][9610] wlbt:SPP A-MSDU Capable in RSN capabilites. Set SPP A-MSDU capable and Extended Key ID MASK bit in RSN capabilites to 1 for AP mode.Which indicate support for signaling and payload protected A-MSDUs. Change-Id: Icb1e3ab2a055f1a424321ee2a5d078cf6b2dfb6d SCSC-Bug-ID: SSB-41417 Signed-off-by: Himani Gupta --- drivers/net/wireless/scsc/mlme.c | 20 +++++++++++++++++++- drivers/net/wireless/scsc/mlme.h | 4 ++++ 2 files changed, 23 insertions(+), 1 deletion(-) diff --git a/drivers/net/wireless/scsc/mlme.c b/drivers/net/wireless/scsc/mlme.c index 3a170080a47e..07ed3fa5ffe8 100755 --- a/drivers/net/wireless/scsc/mlme.c +++ b/drivers/net/wireless/scsc/mlme.c @@ -1585,6 +1585,7 @@ int slsi_modify_ies(struct net_device *dev, u8 eid, u8 *ies, int ies_len, u8 ie_ break; case WLAN_EID_DS_PARAMS: case WLAN_EID_HT_OPERATION: + case WLAN_EID_RSN: if (ie_index == 2) ie[ie_index] = ie_value; else @@ -1604,7 +1605,7 @@ static void slsi_mlme_start_prepare_ies(struct sk_buff *req, struct netdev_vif * { const u8 *wps_ie, *vht_capab_ie, *tail_pos = NULL, *ext_capab_ie; size_t beacon_ie_len = 0, tail_length = 0; - u8 *country_ie; + u8 *country_ie, *rsn_ie; const u8 *beacon_tail = settings->beacon.tail; size_t beacon_tail_len = settings->beacon.tail_len; @@ -1635,7 +1636,24 @@ static void slsi_mlme_start_prepare_ies(struct sk_buff *req, struct netdev_vif * beacon_tail_len -= (country_ie[1] + 2); } } + rsn_ie = (u8 *)cfg80211_find_ie(WLAN_EID_RSN, beacon_tail, beacon_tail_len); + if (rsn_ie) { + u8 rsn_capab = SLSI_WLAN_RSN_CAP_AMSDU | SLSI_WLAN_RSN_CAP_EXTENDED_ID_MASK; + /* 9=1(length)+2(version)+4(Group data cipher suite)+ + * 2(Pairwise cipher suite count) + */ + int rsn_capab_idx = 9, akm_count; + int pcs_count = rsn_ie[9] << 8 | rsn_ie[8]; + /* Added bytes for Pairwise cipher suite list*/ + rsn_capab_idx = 9 + 4 * pcs_count; + akm_count = rsn_ie[rsn_capab_idx + 2] << 8 | rsn_ie[rsn_capab_idx + 1]; + /*Added bytes for AKM suite count and list*/ + rsn_capab_idx = rsn_capab_idx + 2 + 4 * akm_count + 1; + + slsi_modify_ies(ndev_vif->wdev.netdev, WLAN_EID_RSN, (u8 *)settings->beacon.tail, + settings->beacon.tail_len, rsn_capab_idx + 1, rsn_capab); + } /* Modify HT IE based on OBSS scan data */ if (ndev_vif->ap.non_ht_bss_present) { u8 op_mode = 1; diff --git a/drivers/net/wireless/scsc/mlme.h b/drivers/net/wireless/scsc/mlme.h index 1d2c9437c145..f8774c005063 100755 --- a/drivers/net/wireless/scsc/mlme.h +++ b/drivers/net/wireless/scsc/mlme.h @@ -28,6 +28,10 @@ enum slsi_ac_index_wmm_pe { #define SLSI_WLAN_OUI_TYPE_WFA_HS20_IND 0x10 #define SLSI_WLAN_OUI_TYPE_WFA_OSEN 0x12 +/*RSN capabilities bytes*/ +#define SLSI_WLAN_RSN_CAP_AMSDU BIT(2) +#define SLSI_WLAN_RSN_CAP_EXTENDED_ID_MASK BIT(5) + /*Extended capabilities bytes*/ #define SLSI_WLAN_EXT_CAPA2_BSS_TRANSISITION_ENABLED (1 << 3) #define SLSI_WLAN_EXT_CAPA3_INTERWORKING_ENABLED (1 << 7) -- 2.20.1