From owner-svn-src-all@FreeBSD.ORG Sun Dec 9 22:56:30 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 91428AC1; Sun, 9 Dec 2012 22:56:30 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 6BFC68FC08; Sun, 9 Dec 2012 22:56:30 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qB9MuUqP053075; Sun, 9 Dec 2012 22:56:30 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qB9MuTRc053071; Sun, 9 Dec 2012 22:56:29 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201212092256.qB9MuTRc053071@svn.freebsd.org> From: Adrian Chadd Date: Sun, 9 Dec 2012 22:56:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r244060 - head/sys/net80211 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 09 Dec 2012 22:56:30 -0000 Author: adrian Date: Sun Dec 9 22:56:29 2012 New Revision: 244060 URL: http://svnweb.freebsd.org/changeset/base/244060 Log: Handle ath-specific and WME IE's in adhoc mode. The Adhoc support wasn't parsing and handling the ath specific and WME IEs, thus the atheros vendor support and WME TXOP parameters aren't being copied from the peer. It copies the WME parameters from whichever adhoc node it decides to associate to, rather than just having them be statically configured per adhoc node. This may or may not be exactly "right", but it's certainly going to be more convienent for people - they just have to ensure their adhoc nodes are setup with correct WME parameters. Since WME parameters aren't per-node but are configured on hardware TX queues, if some nodes support WME and some don't - or perhaps, have different WME parameters - things will get quite quirky. So ensure that you configure your adhoc nodes with the same WME parameters. Secondly - the Atheros Vendor IE is parsed and operated on per-node, so this should work out ok between nodes that do and don't do Atheros extensions. Once you see a becaon from that node and you setup the association state, it _should_ parse things correctly. TODO: * I do need to ensure that both adhoc setup paths are correctly updating the IE stuff. Ie, if the adhoc node is created by a data frame instead of a beacon frame, it'll come up with no WME/ath IE config. The next beacon frame that it receives from that node will update the state. I just need to sit down and better understand how that's suppose to work in IBSS mode. Tested: * AR5416 <-> AR9280 - fast frames and the WME configuration both popped up. (This is with a local HAL patch that enables the fast frames capability on the AR5416 chipsets.) PR: kern/165969 Modified: head/sys/net80211/ieee80211_adhoc.c head/sys/net80211/ieee80211_sta.c head/sys/net80211/ieee80211_sta.h Modified: head/sys/net80211/ieee80211_adhoc.c ============================================================================== --- head/sys/net80211/ieee80211_adhoc.c Sun Dec 9 22:55:51 2012 (r244059) +++ head/sys/net80211/ieee80211_adhoc.c Sun Dec 9 22:56:29 2012 (r244060) @@ -63,6 +63,7 @@ __FBSDID("$FreeBSD$"); #ifdef IEEE80211_SUPPORT_TDMA #include #endif +#include #define IEEE80211_RATE2MBS(r) (((r) & IEEE80211_RATE_VAL) / 2) @@ -745,6 +746,16 @@ adhoc_recv_mgmt(struct ieee80211_node *n memcpy(ni->ni_tstamp.data, scan.tstamp, sizeof(ni->ni_tstamp)); } + if (scan.wme != NULL && + (ni->ni_flags & IEEE80211_NODE_QOS) && + ieee80211_parse_wmeparams(vap, scan.wme, wh) > 0) { + ieee80211_wme_updateparams(vap); + } +#ifdef IEEE80211_SUPPORT_SUPERG + if (scan.ath != NULL) { + ieee80211_parse_athparams(ni, scan.ath, wh); + } +#endif if (ni != NULL) { IEEE80211_RSSI_LPF(ni->ni_avgrssi, rssi); ni->ni_noise = nf; Modified: head/sys/net80211/ieee80211_sta.c ============================================================================== --- head/sys/net80211/ieee80211_sta.c Sun Dec 9 22:55:51 2012 (r244059) +++ head/sys/net80211/ieee80211_sta.c Sun Dec 9 22:56:29 2012 (r244060) @@ -63,6 +63,7 @@ __FBSDID("$FreeBSD$"); #include #endif #include +#include #define IEEE80211_RATE2MBS(r) (((r) & IEEE80211_RATE_VAL) / 2) @@ -1086,7 +1087,7 @@ bad: IEEE80211_SCAN_FAIL_STATUS); } -static int +int ieee80211_parse_wmeparams(struct ieee80211vap *vap, uint8_t *frm, const struct ieee80211_frame *wh) { Modified: head/sys/net80211/ieee80211_sta.h ============================================================================== --- head/sys/net80211/ieee80211_sta.h Sun Dec 9 22:55:51 2012 (r244059) +++ head/sys/net80211/ieee80211_sta.h Sun Dec 9 22:56:29 2012 (r244060) @@ -33,4 +33,10 @@ void ieee80211_sta_attach(struct ieee80211com *); void ieee80211_sta_detach(struct ieee80211com *); void ieee80211_sta_vattach(struct ieee80211vap *); + +/* + * Used by the adhoc/mesh/tdma paths. + */ +extern int ieee80211_parse_wmeparams(struct ieee80211vap *vap, uint8_t *frm, + const struct ieee80211_frame *wh); #endif /* !_NET80211_IEEE80211_STA_H_ */