From patchwork Fri Oct 1 08:48:43 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bruno Randolf X-Patchwork-Id: 223082 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter1.kernel.org (8.14.4/8.14.3) with ESMTP id o918nCMA020851 for ; Fri, 1 Oct 2010 08:49:12 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754898Ab0JAItK (ORCPT ); Fri, 1 Oct 2010 04:49:10 -0400 Received: from mail30g.wh2.ocn.ne.jp ([220.111.41.239]:25220 "HELO mail30g.wh2.ocn.ne.jp" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with SMTP id S1751899Ab0JAItJ (ORCPT ); Fri, 1 Oct 2010 04:49:09 -0400 Received: from vs3004.wh2.ocn.ne.jp (125.206.180.167) by mail30g.wh2.ocn.ne.jp (RS ver 1.0.95vs) with SMTP id 0-089502946 for ; Fri, 1 Oct 2010 17:49:07 +0900 (JST) Received: (qmail 97300 invoked from network); 1 Oct 2010 08:49:06 -0000 Received: from unknown (HELO ?192.168.3.123?) (220.110.201.18) by with SMTP; 1 Oct 2010 08:49:06 -0000 Subject: [PATCH v2] mac80211: Add WME information element for IBSS To: johannes@sipsolutions.net, linville@tuxdriver.com From: Bruno Randolf Cc: linux-wireless@vger.kernel.org Date: Fri, 01 Oct 2010 17:48:43 +0900 Message-ID: <20101001084842.13117.16614.stgit@tt-desk> User-Agent: StGit/0.15 MIME-Version: 1.0 X-SF-Loop: 1 Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.3 (demeter1.kernel.org [140.211.167.41]); Fri, 01 Oct 2010 08:49:12 +0000 (UTC) diff --git a/net/mac80211/ibss.c b/net/mac80211/ibss.c index 1a3aae5..546693e 100644 --- a/net/mac80211/ibss.c +++ b/net/mac80211/ibss.c @@ -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,