summaryrefslogtreecommitdiffstats
path: root/net/mac80211/mlme.c
diff options
context:
space:
mode:
authorJouni Malinen <jouni@codeaurora.org>2019-02-14 19:14:33 -0500
committerJohannes Berg <johannes.berg@intel.com>2019-02-22 07:35:09 -0500
commit4d9ec73d2b78daf70477aadc50eb4d2186c8b62f (patch)
treed551f1a96cfcfa40b2604980098c8cce0ae8c6e3 /net/mac80211/mlme.c
parent767637416e218d2d3ba7e1697b8a72a375797866 (diff)
cfg80211: Report Association Request frame IEs in association events
This extends the NL80211_CMD_ASSOCIATE event case to report NL80211_ATTR_REQ_IE similarly to what is already done with the NL80211_CMD_CONNECT events if the driver provides this information. In practice, this adds (Re)Association Request frame information element reporting to mac80211 drivers for the cases where user space SME is used. This provides more information for user space to figure out which capabilities were negotiated for the association. For example, this can be used to determine whether HT, VHT, or HE is used. Signed-off-by: Jouni Malinen <jouni@codeaurora.org> Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Diffstat (limited to 'net/mac80211/mlme.c')
-rw-r--r--net/mac80211/mlme.c14
1 files changed, 12 insertions, 2 deletions
diff --git a/net/mac80211/mlme.c b/net/mac80211/mlme.c
index a49fbb3f3ed7..df5d4b90616d 100644
--- a/net/mac80211/mlme.c
+++ b/net/mac80211/mlme.c
@@ -644,7 +644,7 @@ static void ieee80211_send_assoc(struct ieee80211_sub_if_data *sdata)
644 struct ieee80211_mgd_assoc_data *assoc_data = ifmgd->assoc_data; 644 struct ieee80211_mgd_assoc_data *assoc_data = ifmgd->assoc_data;
645 struct sk_buff *skb; 645 struct sk_buff *skb;
646 struct ieee80211_mgmt *mgmt; 646 struct ieee80211_mgmt *mgmt;
647 u8 *pos, qos_info; 647 u8 *pos, qos_info, *ie_start;
648 size_t offset = 0, noffset; 648 size_t offset = 0, noffset;
649 int i, count, rates_len, supp_rates_len, shift; 649 int i, count, rates_len, supp_rates_len, shift;
650 u16 capab; 650 u16 capab;
@@ -752,6 +752,7 @@ static void ieee80211_send_assoc(struct ieee80211_sub_if_data *sdata)
752 752
753 /* SSID */ 753 /* SSID */
754 pos = skb_put(skb, 2 + assoc_data->ssid_len); 754 pos = skb_put(skb, 2 + assoc_data->ssid_len);
755 ie_start = pos;
755 *pos++ = WLAN_EID_SSID; 756 *pos++ = WLAN_EID_SSID;
756 *pos++ = assoc_data->ssid_len; 757 *pos++ = assoc_data->ssid_len;
757 memcpy(pos, assoc_data->ssid, assoc_data->ssid_len); 758 memcpy(pos, assoc_data->ssid, assoc_data->ssid_len);
@@ -976,6 +977,11 @@ static void ieee80211_send_assoc(struct ieee80211_sub_if_data *sdata)
976 return; 977 return;
977 } 978 }
978 979
980 pos = skb_tail_pointer(skb);
981 kfree(ifmgd->assoc_req_ies);
982 ifmgd->assoc_req_ies = kmemdup(ie_start, pos - ie_start, GFP_ATOMIC);
983 ifmgd->assoc_req_ies_len = pos - ie_start;
984
979 drv_mgd_prepare_tx(local, sdata, 0); 985 drv_mgd_prepare_tx(local, sdata, 0);
980 986
981 IEEE80211_SKB_CB(skb)->flags |= IEEE80211_TX_INTFL_DONT_ENCRYPT; 987 IEEE80211_SKB_CB(skb)->flags |= IEEE80211_TX_INTFL_DONT_ENCRYPT;
@@ -3544,7 +3550,8 @@ static void ieee80211_rx_mgmt_assoc_resp(struct ieee80211_sub_if_data *sdata,
3544 uapsd_queues |= ieee80211_ac_to_qos_mask[ac]; 3550 uapsd_queues |= ieee80211_ac_to_qos_mask[ac];
3545 } 3551 }
3546 3552
3547 cfg80211_rx_assoc_resp(sdata->dev, bss, (u8 *)mgmt, len, uapsd_queues); 3553 cfg80211_rx_assoc_resp(sdata->dev, bss, (u8 *)mgmt, len, uapsd_queues,
3554 ifmgd->assoc_req_ies, ifmgd->assoc_req_ies_len);
3548} 3555}
3549 3556
3550static void ieee80211_rx_bss_info(struct ieee80211_sub_if_data *sdata, 3557static void ieee80211_rx_bss_info(struct ieee80211_sub_if_data *sdata,
@@ -5576,6 +5583,9 @@ void ieee80211_mgd_stop(struct ieee80211_sub_if_data *sdata)
5576 ifmgd->teardown_skb = NULL; 5583 ifmgd->teardown_skb = NULL;
5577 ifmgd->orig_teardown_skb = NULL; 5584 ifmgd->orig_teardown_skb = NULL;
5578 } 5585 }
5586 kfree(ifmgd->assoc_req_ies);
5587 ifmgd->assoc_req_ies = NULL;
5588 ifmgd->assoc_req_ies_len = 0;
5579 spin_unlock_bh(&ifmgd->teardown_lock); 5589 spin_unlock_bh(&ifmgd->teardown_lock);
5580 del_timer_sync(&ifmgd->timer); 5590 del_timer_sync(&ifmgd->timer);
5581 sdata_unlock(sdata); 5591 sdata_unlock(sdata);