Deleted Added
full compact
ieee80211_ht.c (287948) ieee80211_ht.c (288085)
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 287948 2015-09-18 05:01:05Z adrian $");
28__FBSDID("$FreeBSD: head/sys/net80211/ieee80211_ht.c 288085 2015-09-22 02:25:29Z adrian $");
29#endif
30
31/*
32 * IEEE 802.11n protocol support.
33 */
34
35#include "opt_inet.h"
36#include "opt_wlan.h"

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

1410 IEEE80211_NOTE(vap, IEEE80211_MSG_11N, ni,
1411 "%s", "time out non-HT STA present on channel");
1412#endif
1413 ic->ic_flags_ht &= ~IEEE80211_FHT_NONHT_PR;
1414 htinfo_update(ic);
1415 }
1416}
1417
29#endif
30
31/*
32 * IEEE 802.11n protocol support.
33 */
34
35#include "opt_inet.h"
36#include "opt_wlan.h"

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

1410 IEEE80211_NOTE(vap, IEEE80211_MSG_11N, ni,
1411 "%s", "time out non-HT STA present on channel");
1412#endif
1413 ic->ic_flags_ht &= ~IEEE80211_FHT_NONHT_PR;
1414 htinfo_update(ic);
1415 }
1416}
1417
1418/* unalligned little endian access */
1419#define LE_READ_2(p) \
1420 ((uint16_t) \
1421 ((((const uint8_t *)(p))[0] ) | \
1422 (((const uint8_t *)(p))[1] << 8)))
1423
1424/*
1425 * Process an 802.11n HT capabilities ie.
1426 */
1427void
1428ieee80211_parse_htcap(struct ieee80211_node *ni, const uint8_t *ie)
1429{
1430 if (ie[0] == IEEE80211_ELEMID_VENDOR) {
1431 /*

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

1828 bufsiz = MS(baparamset, IEEE80211_BAPS_BUFSIZ);
1829 tap->txa_wnd = (bufsiz == 0) ?
1830 IEEE80211_AGGR_BAWMAX : min(bufsiz, IEEE80211_AGGR_BAWMAX);
1831 addba_start_timeout(tap);
1832 return 1;
1833}
1834
1835/*
1418/*
1419 * Process an 802.11n HT capabilities ie.
1420 */
1421void
1422ieee80211_parse_htcap(struct ieee80211_node *ni, const uint8_t *ie)
1423{
1424 if (ie[0] == IEEE80211_ELEMID_VENDOR) {
1425 /*

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

1822 bufsiz = MS(baparamset, IEEE80211_BAPS_BUFSIZ);
1823 tap->txa_wnd = (bufsiz == 0) ?
1824 IEEE80211_AGGR_BAWMAX : min(bufsiz, IEEE80211_AGGR_BAWMAX);
1825 addba_start_timeout(tap);
1826 return 1;
1827}
1828
1829/*
1830 * Called by drivers that wish to request an ADDBA session be
1831 * setup. This brings it up and starts the request timer.
1832 */
1833int
1834ieee80211_ampdu_tx_request_ext(struct ieee80211_node *ni, int tid)
1835{
1836 struct ieee80211_tx_ampdu *tap;
1837
1838 if (tid < 0 || tid > 15)
1839 return (0);
1840 tap = &ni->ni_tx_ampdu[tid];
1841
1842 /* XXX locking */
1843 if ((tap->txa_flags & IEEE80211_AGGR_SETUP) == 0) {
1844 /* do deferred setup of state */
1845 ampdu_tx_setup(tap);
1846 }
1847 /* XXX hack for not doing proper locking */
1848 tap->txa_flags &= ~IEEE80211_AGGR_NAK;
1849 addba_start_timeout(tap);
1850 return (1);
1851}
1852
1853/*
1854 * Called by drivers that have marked a session as active.
1855 */
1856int
1857ieee80211_ampdu_tx_request_active_ext(struct ieee80211_node *ni, int tid,
1858 int status)
1859{
1860 struct ieee80211_tx_ampdu *tap;
1861
1862 if (tid < 0 || tid > 15)
1863 return (0);
1864 tap = &ni->ni_tx_ampdu[tid];
1865
1866 /* XXX locking */
1867 addba_stop_timeout(tap);
1868 if (status == 1) {
1869 tap->txa_flags |= IEEE80211_AGGR_RUNNING;
1870 tap->txa_attempts = 0;
1871 } else {
1872 /* mark tid so we don't try again */
1873 tap->txa_flags |= IEEE80211_AGGR_NAK;
1874 }
1875 return (1);
1876}
1877
1878/*
1836 * Default method for processing an A-MPDU tx aggregation
1837 * response. We shutdown any pending timer and update the
1838 * state block according to the reply.
1839 */
1840static int
1841ieee80211_addba_response(struct ieee80211_node *ni,
1842 struct ieee80211_tx_ampdu *tap,
1843 int status, int baparamset, int batimeout)

--- 1093 unchanged lines hidden ---
1879 * Default method for processing an A-MPDU tx aggregation
1880 * response. We shutdown any pending timer and update the
1881 * state block according to the reply.
1882 */
1883static int
1884ieee80211_addba_response(struct ieee80211_node *ni,
1885 struct ieee80211_tx_ampdu *tap,
1886 int status, int baparamset, int batimeout)

--- 1093 unchanged lines hidden ---