ieee80211_ht.c (205281) | ieee80211_ht.c (205513) |
---|---|
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 205281 2010-03-18 15:28:17Z rpaulo $"); | 28__FBSDID("$FreeBSD: head/sys/net80211/ieee80211_ht.c 205513 2010-03-23 12:03:09Z rpaulo $"); |
29#endif 30 31/* 32 * IEEE 802.11n protocol support. 33 */ 34 35#include "opt_inet.h" 36#include "opt_wlan.h" --- 2304 unchanged lines hidden (view full) --- 2341ieee80211_add_htcap_body(uint8_t *frm, struct ieee80211_node *ni) 2342{ 2343#define ADDSHORT(frm, v) do { \ 2344 frm[0] = (v) & 0xff; \ 2345 frm[1] = (v) >> 8; \ 2346 frm += 2; \ 2347} while (0) 2348 struct ieee80211vap *vap = ni->ni_vap; | 29#endif 30 31/* 32 * IEEE 802.11n protocol support. 33 */ 34 35#include "opt_inet.h" 36#include "opt_wlan.h" --- 2304 unchanged lines hidden (view full) --- 2341ieee80211_add_htcap_body(uint8_t *frm, struct ieee80211_node *ni) 2342{ 2343#define ADDSHORT(frm, v) do { \ 2344 frm[0] = (v) & 0xff; \ 2345 frm[1] = (v) >> 8; \ 2346 frm += 2; \ 2347} while (0) 2348 struct ieee80211vap *vap = ni->ni_vap; |
2349 uint16_t caps; | 2349 uint16_t caps, extcaps; |
2350 int rxmax, density; 2351 2352 /* HT capabilities */ 2353 caps = vap->iv_htcaps & 0xffff; 2354 /* 2355 * Note channel width depends on whether we are operating as 2356 * a sta or not. When operating as a sta we are generating 2357 * a request based on our desired configuration. Otherwise --- 41 unchanged lines hidden (view full) --- 2399 /* 2400 * XXX it would better to get the rate set from ni_htrates 2401 * so we can restrict it but for sta mode ni_htrates isn't 2402 * setup when we're called to form an AssocReq frame so for 2403 * now we're restricted to the default HT rate set. 2404 */ 2405 ieee80211_set_htrates(frm, &ieee80211_rateset_11n); 2406 | 2350 int rxmax, density; 2351 2352 /* HT capabilities */ 2353 caps = vap->iv_htcaps & 0xffff; 2354 /* 2355 * Note channel width depends on whether we are operating as 2356 * a sta or not. When operating as a sta we are generating 2357 * a request based on our desired configuration. Otherwise --- 41 unchanged lines hidden (view full) --- 2399 /* 2400 * XXX it would better to get the rate set from ni_htrates 2401 * so we can restrict it but for sta mode ni_htrates isn't 2402 * setup when we're called to form an AssocReq frame so for 2403 * now we're restricted to the default HT rate set. 2404 */ 2405 ieee80211_set_htrates(frm, &ieee80211_rateset_11n); 2406 |
2407 frm += sizeof(struct ieee80211_ie_htcap) - | 2407 frm += __offsetof(struct ieee80211_ie_htcap, hc_extcap) - |
2408 __offsetof(struct ieee80211_ie_htcap, hc_mcsset); | 2408 __offsetof(struct ieee80211_ie_htcap, hc_mcsset); |
2409 2410 /* HT extended capabilities */ 2411 extcaps = vap->iv_htextcaps & 0xffff; 2412 2413 ADDSHORT(frm, extcaps); 2414 2415 frm += sizeof(struct ieee80211_ie_htcap) - 2416 __offsetof(struct ieee80211_ie_htcap, hc_txbf); 2417 |
|
2409 return frm; 2410#undef ADDSHORT 2411} 2412 2413/* 2414 * Add 802.11n HT capabilities information element 2415 */ 2416uint8_t * --- 146 unchanged lines hidden --- | 2418 return frm; 2419#undef ADDSHORT 2420} 2421 2422/* 2423 * Add 802.11n HT capabilities information element 2424 */ 2425uint8_t * --- 146 unchanged lines hidden --- |