Deleted Added
full compact
ieee80211_ht.c (222683) ieee80211_ht.c (223331)
1/*-
2 * Copyright (c) 2007-2008 Sam Leffler, Errno Consulting
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 * 1. Redistributions of source code must retain the above copyright

--- 11 unchanged lines hidden (view full) ---

20 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
21 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
22 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
23 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
24 */
25
26#include <sys/cdefs.h>
27#ifdef __FreeBSD__
1/*-
2 * Copyright (c) 2007-2008 Sam Leffler, Errno Consulting
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 * 1. Redistributions of source code must retain the above copyright

--- 11 unchanged lines hidden (view full) ---

20 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
21 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
22 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
23 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
24 */
25
26#include <sys/cdefs.h>
27#ifdef __FreeBSD__
28__FBSDID("$FreeBSD: head/sys/net80211/ieee80211_ht.c 222683 2011-06-04 15:05:32Z bschmidt $");
28__FBSDID("$FreeBSD: head/sys/net80211/ieee80211_ht.c 223331 2011-06-20 11:46:03Z adrian $");
29#endif
30
31/*
32 * IEEE 802.11n protocol support.
33 */
34
35#include "opt_inet.h"
36#include "opt_wlan.h"

--- 175 unchanged lines hidden (view full) ---

212static int ieee80211_addba_request(struct ieee80211_node *ni,
213 struct ieee80211_tx_ampdu *tap,
214 int dialogtoken, int baparamset, int batimeout);
215static int ieee80211_addba_response(struct ieee80211_node *ni,
216 struct ieee80211_tx_ampdu *tap,
217 int code, int baparamset, int batimeout);
218static void ieee80211_addba_stop(struct ieee80211_node *ni,
219 struct ieee80211_tx_ampdu *tap);
29#endif
30
31/*
32 * IEEE 802.11n protocol support.
33 */
34
35#include "opt_inet.h"
36#include "opt_wlan.h"

--- 175 unchanged lines hidden (view full) ---

212static int ieee80211_addba_request(struct ieee80211_node *ni,
213 struct ieee80211_tx_ampdu *tap,
214 int dialogtoken, int baparamset, int batimeout);
215static int ieee80211_addba_response(struct ieee80211_node *ni,
216 struct ieee80211_tx_ampdu *tap,
217 int code, int baparamset, int batimeout);
218static void ieee80211_addba_stop(struct ieee80211_node *ni,
219 struct ieee80211_tx_ampdu *tap);
220static void null_addba_response_timeout(struct ieee80211_node *ni,
221 struct ieee80211_tx_ampdu *tap);
222
220static void ieee80211_bar_response(struct ieee80211_node *ni,
221 struct ieee80211_tx_ampdu *tap, int status);
222static void ampdu_tx_stop(struct ieee80211_tx_ampdu *tap);
223static void bar_stop_timer(struct ieee80211_tx_ampdu *tap);
224static int ampdu_rx_start(struct ieee80211_node *, struct ieee80211_rx_ampdu *,
225 int baparamset, int batimeout, int baseqctl);
226static void ampdu_rx_stop(struct ieee80211_node *, struct ieee80211_rx_ampdu *);
227
228void
229ieee80211_ht_attach(struct ieee80211com *ic)
230{
231 /* setup default aggregation policy */
232 ic->ic_recv_action = ieee80211_recv_action;
233 ic->ic_send_action = ieee80211_send_action;
234 ic->ic_ampdu_enable = ieee80211_ampdu_enable;
235 ic->ic_addba_request = ieee80211_addba_request;
236 ic->ic_addba_response = ieee80211_addba_response;
223static void ieee80211_bar_response(struct ieee80211_node *ni,
224 struct ieee80211_tx_ampdu *tap, int status);
225static void ampdu_tx_stop(struct ieee80211_tx_ampdu *tap);
226static void bar_stop_timer(struct ieee80211_tx_ampdu *tap);
227static int ampdu_rx_start(struct ieee80211_node *, struct ieee80211_rx_ampdu *,
228 int baparamset, int batimeout, int baseqctl);
229static void ampdu_rx_stop(struct ieee80211_node *, struct ieee80211_rx_ampdu *);
230
231void
232ieee80211_ht_attach(struct ieee80211com *ic)
233{
234 /* setup default aggregation policy */
235 ic->ic_recv_action = ieee80211_recv_action;
236 ic->ic_send_action = ieee80211_send_action;
237 ic->ic_ampdu_enable = ieee80211_ampdu_enable;
238 ic->ic_addba_request = ieee80211_addba_request;
239 ic->ic_addba_response = ieee80211_addba_response;
240 ic->ic_addba_response_timeout = null_addba_response_timeout;
237 ic->ic_addba_stop = ieee80211_addba_stop;
238 ic->ic_bar_response = ieee80211_bar_response;
239 ic->ic_ampdu_rx_start = ampdu_rx_start;
240 ic->ic_ampdu_rx_stop = ampdu_rx_stop;
241
242 ic->ic_htprotmode = IEEE80211_PROT_RTSCTS;
243 ic->ic_curhtprotmode = IEEE80211_HTINFO_OPMODE_PURE;
244}

--- 1441 unchanged lines hidden (view full) ---

1686 bar_stop_timer(tap);
1687
1688 tap->txa_lastsample = 0;
1689 tap->txa_avgpps = 0;
1690 /* NB: clearing NAK means we may re-send ADDBA */
1691 tap->txa_flags &= ~(IEEE80211_AGGR_SETUP | IEEE80211_AGGR_NAK);
1692}
1693
241 ic->ic_addba_stop = ieee80211_addba_stop;
242 ic->ic_bar_response = ieee80211_bar_response;
243 ic->ic_ampdu_rx_start = ampdu_rx_start;
244 ic->ic_ampdu_rx_stop = ampdu_rx_stop;
245
246 ic->ic_htprotmode = IEEE80211_PROT_RTSCTS;
247 ic->ic_curhtprotmode = IEEE80211_HTINFO_OPMODE_PURE;
248}

--- 1441 unchanged lines hidden (view full) ---

1690 bar_stop_timer(tap);
1691
1692 tap->txa_lastsample = 0;
1693 tap->txa_avgpps = 0;
1694 /* NB: clearing NAK means we may re-send ADDBA */
1695 tap->txa_flags &= ~(IEEE80211_AGGR_SETUP | IEEE80211_AGGR_NAK);
1696}
1697
1698/*
1699 * ADDBA response timeout.
1700 *
1701 * If software aggregation and per-TID queue management was done here,
1702 * that queue would be unpaused after the ADDBA timeout occurs.
1703 */
1694static void
1695addba_timeout(void *arg)
1696{
1697 struct ieee80211_tx_ampdu *tap = arg;
1704static void
1705addba_timeout(void *arg)
1706{
1707 struct ieee80211_tx_ampdu *tap = arg;
1708 struct ieee80211_node *ni = tap->txa_ni;
1709 struct ieee80211com *ic = ni->ni_ic;
1698
1699 /* XXX ? */
1700 tap->txa_flags &= ~IEEE80211_AGGR_XCHGPEND;
1701 tap->txa_attempts++;
1710
1711 /* XXX ? */
1712 tap->txa_flags &= ~IEEE80211_AGGR_XCHGPEND;
1713 tap->txa_attempts++;
1714 ic->ic_addba_response_timeout(ni, tap);
1702}
1703
1704static void
1705addba_start_timeout(struct ieee80211_tx_ampdu *tap)
1706{
1707 /* XXX use CALLOUT_PENDING instead? */
1708 callout_reset(&tap->txa_timer, ieee80211_addba_timeout,
1709 addba_timeout, tap);

--- 6 unchanged lines hidden (view full) ---

1716{
1717 /* XXX use CALLOUT_PENDING instead? */
1718 if (tap->txa_flags & IEEE80211_AGGR_XCHGPEND) {
1719 callout_stop(&tap->txa_timer);
1720 tap->txa_flags &= ~IEEE80211_AGGR_XCHGPEND;
1721 }
1722}
1723
1715}
1716
1717static void
1718addba_start_timeout(struct ieee80211_tx_ampdu *tap)
1719{
1720 /* XXX use CALLOUT_PENDING instead? */
1721 callout_reset(&tap->txa_timer, ieee80211_addba_timeout,
1722 addba_timeout, tap);

--- 6 unchanged lines hidden (view full) ---

1729{
1730 /* XXX use CALLOUT_PENDING instead? */
1731 if (tap->txa_flags & IEEE80211_AGGR_XCHGPEND) {
1732 callout_stop(&tap->txa_timer);
1733 tap->txa_flags &= ~IEEE80211_AGGR_XCHGPEND;
1734 }
1735}
1736
1737static void
1738null_addba_response_timeout(struct ieee80211_node *ni,
1739 struct ieee80211_tx_ampdu *tap)
1740{
1741}
1742
1724/*
1725 * Default method for requesting A-MPDU tx aggregation.
1726 * We setup the specified state block and start a timer
1727 * to wait for an ADDBA response frame.
1728 */
1729static int
1730ieee80211_addba_request(struct ieee80211_node *ni,
1731 struct ieee80211_tx_ampdu *tap,

--- 1027 unchanged lines hidden ---
1743/*
1744 * Default method for requesting A-MPDU tx aggregation.
1745 * We setup the specified state block and start a timer
1746 * to wait for an ADDBA response frame.
1747 */
1748static int
1749ieee80211_addba_request(struct ieee80211_node *ni,
1750 struct ieee80211_tx_ampdu *tap,

--- 1027 unchanged lines hidden ---