From owner-svn-src-head@freebsd.org Tue Sep 22 02:25:30 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8530EA059C1; Tue, 22 Sep 2015 02:25:30 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 698C2124E; Tue, 22 Sep 2015 02:25:30 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t8M2PUwI075565; Tue, 22 Sep 2015 02:25:30 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t8M2PTrR075563; Tue, 22 Sep 2015 02:25:29 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201509220225.t8M2PTrR075563@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Tue, 22 Sep 2015 02:25:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r288085 - 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-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 22 Sep 2015 02:25:30 -0000 Author: adrian Date: Tue Sep 22 02:25:29 2015 New Revision: 288085 URL: https://svnweb.freebsd.org/changeset/base/288085 Log: Add external facing methods to control TX A-MPDU negotiaton. Some fullmac devices may rely on the stack starting it but not doing it. Whilst here, remove a duplicate LE_* macro definition, thanks to Andriy Voskoboinyk . Modified: head/sys/net80211/ieee80211_ht.c head/sys/net80211/ieee80211_ht.h Modified: head/sys/net80211/ieee80211_ht.c ============================================================================== --- head/sys/net80211/ieee80211_ht.c Tue Sep 22 02:24:13 2015 (r288084) +++ head/sys/net80211/ieee80211_ht.c Tue Sep 22 02:25:29 2015 (r288085) @@ -1415,12 +1415,6 @@ ieee80211_ht_timeout(struct ieee80211com } } -/* unalligned little endian access */ -#define LE_READ_2(p) \ - ((uint16_t) \ - ((((const uint8_t *)(p))[0] ) | \ - (((const uint8_t *)(p))[1] << 8))) - /* * Process an 802.11n HT capabilities ie. */ @@ -1833,6 +1827,55 @@ ieee80211_addba_request(struct ieee80211 } /* + * Called by drivers that wish to request an ADDBA session be + * setup. This brings it up and starts the request timer. + */ +int +ieee80211_ampdu_tx_request_ext(struct ieee80211_node *ni, int tid) +{ + struct ieee80211_tx_ampdu *tap; + + if (tid < 0 || tid > 15) + return (0); + tap = &ni->ni_tx_ampdu[tid]; + + /* XXX locking */ + if ((tap->txa_flags & IEEE80211_AGGR_SETUP) == 0) { + /* do deferred setup of state */ + ampdu_tx_setup(tap); + } + /* XXX hack for not doing proper locking */ + tap->txa_flags &= ~IEEE80211_AGGR_NAK; + addba_start_timeout(tap); + return (1); +} + +/* + * Called by drivers that have marked a session as active. + */ +int +ieee80211_ampdu_tx_request_active_ext(struct ieee80211_node *ni, int tid, + int status) +{ + struct ieee80211_tx_ampdu *tap; + + if (tid < 0 || tid > 15) + return (0); + tap = &ni->ni_tx_ampdu[tid]; + + /* XXX locking */ + addba_stop_timeout(tap); + if (status == 1) { + tap->txa_flags |= IEEE80211_AGGR_RUNNING; + tap->txa_attempts = 0; + } else { + /* mark tid so we don't try again */ + tap->txa_flags |= IEEE80211_AGGR_NAK; + } + return (1); +} + +/* * Default method for processing an A-MPDU tx aggregation * response. We shutdown any pending timer and update the * state block according to the reply. Modified: head/sys/net80211/ieee80211_ht.h ============================================================================== --- head/sys/net80211/ieee80211_ht.h Tue Sep 22 02:24:13 2015 (r288084) +++ head/sys/net80211/ieee80211_ht.h Tue Sep 22 02:25:29 2015 (r288085) @@ -202,5 +202,8 @@ void ieee80211_ht_update_beacon(struct i struct ieee80211_beacon_offsets *); int ieee80211_ampdu_rx_start_ext(struct ieee80211_node *ni, int tid, int seq, int baw); +int ieee80211_ampdu_tx_request_ext(struct ieee80211_node *ni, int tid); +int ieee80211_ampdu_tx_request_active_ext(struct ieee80211_node *ni, + int tid, int status); #endif /* _NET80211_IEEE80211_HT_H_ */