ieee80211_tdma.c (189980) | ieee80211_tdma.c (189981) |
---|---|
1/*- 2 * Copyright (c) 2007-2009 Sam Leffler, Errno Consulting 3 * Copyright (c) 2007-2009 Intel Corporation 4 * All rights reserved. 5 * 6 * Redistribution and use in source and binary forms, with or without 7 * modification, are permitted provided that the following conditions 8 * are met: --- 12 unchanged lines hidden (view full) --- 21 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 22 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 23 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 24 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 25 */ 26 27#include <sys/cdefs.h> 28#ifdef __FreeBSD__ | 1/*- 2 * Copyright (c) 2007-2009 Sam Leffler, Errno Consulting 3 * Copyright (c) 2007-2009 Intel Corporation 4 * All rights reserved. 5 * 6 * Redistribution and use in source and binary forms, with or without 7 * modification, are permitted provided that the following conditions 8 * are met: --- 12 unchanged lines hidden (view full) --- 21 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 22 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 23 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 24 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 25 */ 26 27#include <sys/cdefs.h> 28#ifdef __FreeBSD__ |
29__FBSDID("$FreeBSD: head/sys/net80211/ieee80211_tdma.c 189980 2009-03-18 19:28:17Z sam $"); | 29__FBSDID("$FreeBSD: head/sys/net80211/ieee80211_tdma.c 189981 2009-03-18 19:38:39Z sam $"); |
30#endif 31 32/* 33 * IEEE 802.11 TDMA mode support. 34 */ 35#include "opt_inet.h" 36#include "opt_wlan.h" 37 --- 344 unchanged lines hidden (view full) --- 382 int slot, slotlen, update; 383 384 KASSERT(vap->iv_caps & IEEE80211_C_TDMA, 385 ("not a tdma vap, caps 0x%x", vap->iv_caps)); 386 387 update = 0; 388 if (tdma->tdma_slotcnt != ts->tdma_slotcnt) { 389 if (!TDMA_SLOTCNT_VALID(tdma->tdma_slotcnt)) { | 30#endif 31 32/* 33 * IEEE 802.11 TDMA mode support. 34 */ 35#include "opt_inet.h" 36#include "opt_wlan.h" 37 --- 344 unchanged lines hidden (view full) --- 382 int slot, slotlen, update; 383 384 KASSERT(vap->iv_caps & IEEE80211_C_TDMA, 385 ("not a tdma vap, caps 0x%x", vap->iv_caps)); 386 387 update = 0; 388 if (tdma->tdma_slotcnt != ts->tdma_slotcnt) { 389 if (!TDMA_SLOTCNT_VALID(tdma->tdma_slotcnt)) { |
390 printf("%s: bad slot cnt %u\n", 391 __func__, tdma->tdma_slotcnt); | 390 if (ppsratecheck(&ts->tdma_lastprint, &ts->tdma_fails, 1)) 391 printf("%s: bad slot cnt %u\n", 392 __func__, tdma->tdma_slotcnt); |
392 return 0; 393 } 394 update |= TDMA_UPDATE_SLOTCNT; 395 } 396 slotlen = le16toh(tdma->tdma_slotlen) * 100; 397 if (slotlen != ts->tdma_slotlen) { 398 if (!TDMA_SLOTLEN_VALID(slotlen)) { | 393 return 0; 394 } 395 update |= TDMA_UPDATE_SLOTCNT; 396 } 397 slotlen = le16toh(tdma->tdma_slotlen) * 100; 398 if (slotlen != ts->tdma_slotlen) { 399 if (!TDMA_SLOTLEN_VALID(slotlen)) { |
399 printf("%s: bad slot len %u\n", 400 __func__, slotlen); | 400 if (ppsratecheck(&ts->tdma_lastprint, &ts->tdma_fails, 1)) 401 printf("%s: bad slot len %u\n", 402 __func__, slotlen); |
401 return 0; 402 } 403 update |= TDMA_UPDATE_SLOTLEN; 404 } 405 if (tdma->tdma_bintval != ts->tdma_bintval) { 406 if (!TDMA_BINTVAL_VALID(tdma->tdma_bintval)) { | 403 return 0; 404 } 405 update |= TDMA_UPDATE_SLOTLEN; 406 } 407 if (tdma->tdma_bintval != ts->tdma_bintval) { 408 if (!TDMA_BINTVAL_VALID(tdma->tdma_bintval)) { |
407 printf("%s: bad beacon interval %u\n", 408 __func__, tdma->tdma_bintval); | 409 if (ppsratecheck(&ts->tdma_lastprint, &ts->tdma_fails, 1)) 410 printf("%s: bad beacon interval %u\n", 411 __func__, tdma->tdma_bintval); |
409 return 0; 410 } 411 update |= TDMA_UPDATE_BINTVAL; 412 } 413 slot = ts->tdma_slot; 414 if (pickslot) { 415 /* 416 * Pick unoccupied slot. Note we never choose slot 0. --- 371 unchanged lines hidden --- | 412 return 0; 413 } 414 update |= TDMA_UPDATE_BINTVAL; 415 } 416 slot = ts->tdma_slot; 417 if (pickslot) { 418 /* 419 * Pick unoccupied slot. Note we never choose slot 0. --- 371 unchanged lines hidden --- |