Skip to contentSkip to conversation

mac80211: scan result IEs in one block

RFC In review Jouni Malinen 2 participants 4 messages Aug 14, 2008 – Aug 15, 2008 mac80211

lore
Share & tools
lore
#0 lore raw

RFC 1/1 mac80211: scan result IEs in one block

Change to how IEs from scan results are reported to user space (and stored internally) has been discussed couple of times earlier. In order to be able to support new protocols (e.g., IEEE 802.11r) that add new IEs without requiring changes in mac80211/WEXT event structures, the full set of all IEs from Beacon/ProbeResp frames should be sent as a single block into user space. However, no one seems to have had enough interest to actually do something concrete to get this change in, so looks like I have to start.. ;-)

The patch below does the initial step by adding a new buffer for all IEs. I verified that this worked fine with wpa_supplicant when associating with WPA-PSK.

I haven't yet finished the patch to avoid using duplicate buffers for the IEs that were previously stored (RSN, WPA, WMM, HT), but that will hopefully be quite simple change to remove those from struct ieee80211_sta_bss and instead use simple helper functions that allow a specific IE to be fetched from the buffer containing all IEs (this design is already used in wpa_supplicant and I'll just copy the code from there).

I'll finish the work on this and submit a more complete version for inclusion after some more testing. Though, any comments on the design would be welcome at this point.

net/mac80211/ieee80211_i.h +7 -0
Index: wireless-testing/net/mac80211/ieee80211_i.h
===================================================================
@@ -87,6 +87,10 @@ struct ieee80211_sta_bss {
 	enum ieee80211_band band;
 	int freq;
 	int signal, noise, qual;
+	u8 *ies; /* all information elements from the last Beacon or Probe
+		  * Response frames; note Beacon frame is not allowed to
+		  * override values from Probe Response */
+	size_t ies_len;
 	u8 *wpa_ie;
 	size_t wpa_ie_len;
 	u8 *rsn_ie;
@@ -775,6 +779,9 @@ struct ieee80211_ra_tid {
 
 /* Parsed Information Elements */
 struct ieee802_11_elems {
+	u8 *ie_start;
+	size_t total_len;
+
 	/* pointers to IEs */
 	u8 *ssid;
 	u8 *supp_rates;
net/mac80211/mlme.c +23 -19

69 lines not on this page · raw message

Signature · 1 line
Jouni Malinen                                            PGP id EFC895FA
#1 lore raw
Quoted 5 lines · Jouni Malinen

I haven't yet finished the patch to avoid using duplicate buffers for the IEs that were previously stored (RSN, WPA, WMM, HT), but that will hopefully be quite simple change to remove those from struct ieee80211_sta_bss and instead use simple helper functions that allow a specific IE to be fetched from the buffer containing all IEs

This was actually simpler for most parts since number of the separate stored IEs were not really used for anything apart from filling in WEXT scan results. It looks like the contents of none of the IEs was used at all.. There were some odd comments (reference to a patent as a way of referring WMM spec?!) and some comments about broken APs. I don't think either of those was really needed since the only real use here was to figure out whether WMM was being used or not and that can be done in a much simpler way of just storing whether WMM info or WMM param IE was there..

Here's an updated and closer to finished patch (could add support for fragmenting IE data since WEXT seems to have an unfortunate limit on the event message size.. urg). This gets rid of lots of unnecessary and over complex code in scan result processing and makes it easier to support new protocols in the future.

net/mac80211/ieee80211_i.h +8 -10
Index: wireless-testing/net/mac80211/ieee80211_i.h
===================================================================
@@ -87,16 +87,11 @@ struct ieee80211_sta_bss {
 	enum ieee80211_band band;
 	int freq;
 	int signal, noise, qual;
-	u8 *wpa_ie;
-	size_t wpa_ie_len;
-	u8 *rsn_ie;
-	size_t rsn_ie_len;
-	u8 *wmm_ie;
-	size_t wmm_ie_len;
-	u8 *ht_ie;
-	size_t ht_ie_len;
-	u8 *ht_add_ie;
-	size_t ht_add_ie_len;
+	u8 *ies; /* all information elements from the last Beacon or Probe
+		  * Response frames; note Beacon frame is not allowed to
+		  * override values from Probe Response */
+	size_t ies_len;
+	bool wmm_used;
 #ifdef CONFIG_MAC80211_MESH
 	u8 *mesh_id;
 	size_t mesh_id_len;
@@ -775,6 +770,9 @@ struct ieee80211_ra_tid {
 
 /* Parsed Information Elements */
 struct ieee802_11_elems {
+	u8 *ie_start;
+	size_t total_len;
+
 	/* pointers to IEs */
 	u8 *ssid;
 	u8 *supp_rates;
net/mac80211/mlme.c +49 -146

254 lines not on this page · raw message

Signature · 1 line
Jouni Malinen                                            PGP id EFC895FA
#2 lore raw

net/mac80211/mlme.c static void ieee80211_rx_bss_info(struct · line 2730

Quoted 3 lines · Jouni Malinen
net/mac80211/mlme.c +3 -0
+       if (bss->ies == NULL || bss->ies_len < elems->total_len) {
+               kfree(bss->ies);
+               bss->ies = kmalloc(elems->total_len, GFP_ATOMIC);

Typo here on check for NULL ?

Luis

#3 lore raw
Quoted 7 lines · Luis R. Rodriguez

net/mac80211/mlme.c static void ieee80211_rx_bss_info(struct · line 2730

Quoted 3 lines · Jouni Malinen
net/mac80211/mlme.c +3 -0
+       if (bss->ies == NULL || bss->ies_len < elems->total_len) {
+               kfree(bss->ies);
+               bss->ies = kmalloc(elems->total_len, GFP_ATOMIC);

Typo here on check for NULL ?

Where? That looks correct to me.

Signature · 1 line
Jouni Malinen                                            PGP id EFC895FA