mac80211: Add WME information element for IBSS
PATCH v2 1/1 mac80211: Add WME information element for IBSS
Enable WME QoS in IBSS mode by adding a WME information element to beacons and probe respones and by checking for it and marking stations as WME capable if it is present.
Signed-off-by Bruno Randolf <[email protected]>
--- net/mac80211/ibss.c | 24 ++++++++++++++++++++---- 1 files changed, 20 insertions(+), 4 deletions(-)
net/mac80211/ibss.c +20 -4
@@ -173,6 +173,19 @@ static void __ieee80211_sta_join_ibss(struct ieee80211_sub_if_data *sdata,memcpy (skb_put (skb, ifibss->ie_len), ifibss->ie, ifibss->ie_len); +if (local->hw.queues >=4 ) { + pos =skb_put (skb,9 ); + *pos++ =WLAN_EID_VENDOR_SPECIFIC ; + *pos++ =7 ;/* len */ + *pos++ =0x00 ;/* Microsoft OUI 00:50:F2 */ + *pos++ =0x50 ; + *pos++ =0xf2 ; + *pos++ =2 ;/* WME */ + *pos++ =0 ;/* WME info */ + *pos++ =1 ;/* WME ver */ + *pos++ =0 ;/* U-APSD no in use */ + } +rcu_assign_pointer (ifibss->presp, skb); sdata->vif.bss_conf.beacon_int = beacon_int;
@@ -291,12 +304,15 @@ static void ieee80211_rx_bss_info(struct ieee80211_sub_if_data *sdata,#endif rate_control_rate_init (sta); } -rcu_read_unlock (); }else { -rcu_read_unlock (); -ieee80211_ibss_add_sta (sdata, mgmt->bssid, mgmt->sa, - supp_rates,GFP_KERNEL ); + sta =ieee80211_ibss_add_sta (sdata, mgmt->bssid, + mgmt->sa, supp_rates,GFP_KERNEL ); } + +if (sta && elems->wmm_info) +set_sta_flags (sta,WLAN_STA_WME ); + +rcu_read_unlock (); } bss = ieee80211_bss_info_update(local, rx_status, mgmt, len, elems,
net/mac80211/ibss.c static void ieee80211_rx_bss_info(struct ieee80211_sub_if_data *sdata, · line 309
Quoted 5 lines · Bruno Randolf
net/mac80211/ibss.c +2
-3-rcu_read_unlock (); -ieee80211_ibss_add_sta (sdata, mgmt->bssid, mgmt->sa, - supp_rates,GFP_KERNEL ); + sta =ieee80211_ibss_add_sta (sdata, mgmt->bssid, + mgmt->sa, supp_rates,GFP_KERNEL );
Guess you were a bit too quick -- GFP_ATOMIC, but with that change you get
Reviewed-by Johannes Berg <[email protected]>
johannes