Deleted Added
full compact
ieee80211_ht.c (183256) ieee80211_ht.c (183257)
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 183256 2008-09-22 00:10:22Z sam $");
28__FBSDID("$FreeBSD: head/sys/net80211/ieee80211_ht.c 183257 2008-09-22 00:14:50Z sam $");
29#endif
30
31/*
32 * IEEE 802.11n protocol support.
33 */
34
35#include "opt_inet.h"
36#include "opt_wlan.h"

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

1265 ni->ni_flags &= ~IEEE80211_NODE_MIMO_PS;
1266 ni->ni_flags &= ~IEEE80211_NODE_MIMO_RTS;
1267 break;
1268 }
1269 return (oflags ^ ni->ni_flags);
1270}
1271
1272/*
29#endif
30
31/*
32 * IEEE 802.11n protocol support.
33 */
34
35#include "opt_inet.h"
36#include "opt_wlan.h"

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

1265 ni->ni_flags &= ~IEEE80211_NODE_MIMO_PS;
1266 ni->ni_flags &= ~IEEE80211_NODE_MIMO_RTS;
1267 break;
1268 }
1269 return (oflags ^ ni->ni_flags);
1270}
1271
1272/*
1273 * Update short GI state according to received htcap
1274 * and local settings.
1275 */
1276static __inline void
1277htcap_update_shortgi(struct ieee80211_node *ni)
1278{
1279 struct ieee80211vap *vap = ni->ni_vap;
1280
1281 ni->ni_flags &= ~(IEEE80211_NODE_SGI20|IEEE80211_NODE_SGI40);
1282 if ((ni->ni_htcap & IEEE80211_HTCAP_SHORTGI20) &&
1283 (vap->iv_flags_ext & IEEE80211_FEXT_SHORTGI20))
1284 ni->ni_flags |= IEEE80211_NODE_SGI20;
1285 if ((ni->ni_htcap & IEEE80211_HTCAP_SHORTGI40) &&
1286 (vap->iv_flags_ext & IEEE80211_FEXT_SHORTGI40))
1287 ni->ni_flags |= IEEE80211_NODE_SGI40;
1288}
1289
1290/*
1273 * Parse and update HT-related state extracted from
1274 * the HT cap and info ie's.
1275 */
1276void
1277ieee80211_ht_updateparams(struct ieee80211_node *ni,
1278 const uint8_t *htcapie, const uint8_t *htinfoie)
1279{
1280 struct ieee80211vap *vap = ni->ni_vap;
1281 const struct ieee80211_ie_htinfo *htinfo;
1282 int htflags;
1283
1284 ieee80211_parse_htcap(ni, htcapie);
1285 if (vap->iv_htcaps & IEEE80211_HTCAP_SMPS)
1286 htcap_update_mimo_ps(ni);
1291 * Parse and update HT-related state extracted from
1292 * the HT cap and info ie's.
1293 */
1294void
1295ieee80211_ht_updateparams(struct ieee80211_node *ni,
1296 const uint8_t *htcapie, const uint8_t *htinfoie)
1297{
1298 struct ieee80211vap *vap = ni->ni_vap;
1299 const struct ieee80211_ie_htinfo *htinfo;
1300 int htflags;
1301
1302 ieee80211_parse_htcap(ni, htcapie);
1303 if (vap->iv_htcaps & IEEE80211_HTCAP_SMPS)
1304 htcap_update_mimo_ps(ni);
1305 htcap_update_shortgi(ni);
1287
1288 if (htinfoie[0] == IEEE80211_ELEMID_VENDOR)
1289 htinfoie += 4;
1290 htinfo = (const struct ieee80211_ie_htinfo *) htinfoie;
1291 htinfo_parse(ni, htinfo);
1292
1293 htflags = (vap->iv_flags_ext & IEEE80211_FEXT_HT) ?
1294 IEEE80211_CHAN_HT20 : 0;

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

1317ieee80211_ht_updatehtcap(struct ieee80211_node *ni, const uint8_t *htcapie)
1318{
1319 struct ieee80211vap *vap = ni->ni_vap;
1320 int htflags;
1321
1322 ieee80211_parse_htcap(ni, htcapie);
1323 if (vap->iv_htcaps & IEEE80211_HTCAP_SMPS)
1324 htcap_update_mimo_ps(ni);
1306
1307 if (htinfoie[0] == IEEE80211_ELEMID_VENDOR)
1308 htinfoie += 4;
1309 htinfo = (const struct ieee80211_ie_htinfo *) htinfoie;
1310 htinfo_parse(ni, htinfo);
1311
1312 htflags = (vap->iv_flags_ext & IEEE80211_FEXT_HT) ?
1313 IEEE80211_CHAN_HT20 : 0;

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

1336ieee80211_ht_updatehtcap(struct ieee80211_node *ni, const uint8_t *htcapie)
1337{
1338 struct ieee80211vap *vap = ni->ni_vap;
1339 int htflags;
1340
1341 ieee80211_parse_htcap(ni, htcapie);
1342 if (vap->iv_htcaps & IEEE80211_HTCAP_SMPS)
1343 htcap_update_mimo_ps(ni);
1344 htcap_update_shortgi(ni);
1325
1326 /* NB: honor operating mode constraint */
1327 /* XXX 40 MHZ intolerant */
1328 htflags = (vap->iv_flags_ext & IEEE80211_FEXT_HT) ?
1329 IEEE80211_CHAN_HT20 : 0;
1330 if ((ni->ni_htcap & IEEE80211_HTCAP_CHWIDTH40) &&
1331 (vap->iv_flags_ext & IEEE80211_FEXT_USEHT40)) {
1332 if (IEEE80211_IS_CHAN_HT40U(vap->iv_bss->ni_chan))

--- 983 unchanged lines hidden ---
1345
1346 /* NB: honor operating mode constraint */
1347 /* XXX 40 MHZ intolerant */
1348 htflags = (vap->iv_flags_ext & IEEE80211_FEXT_HT) ?
1349 IEEE80211_CHAN_HT20 : 0;
1350 if ((ni->ni_htcap & IEEE80211_HTCAP_CHWIDTH40) &&
1351 (vap->iv_flags_ext & IEEE80211_FEXT_USEHT40)) {
1352 if (IEEE80211_IS_CHAN_HT40U(vap->iv_bss->ni_chan))

--- 983 unchanged lines hidden ---