Ticket #848: madwifi-sta-discs.patch
| File madwifi-sta-discs.patch, 3.6 kB (added by espy@pepper.com, 2 years ago) |
|---|
-
ath/if_ath.c
old new 264 264 static int outdoor = -1; 265 265 static int xchanmode = -1; 266 266 267 static int bmiss_thresh = -1; 268 static int beacon_sleep = -1; 269 267 270 static const char *hal_status_desc[] = { 268 271 "No error", 269 272 "No hardware present or device not yet supported", … … 294 297 MODULE_PARM(rfkill, "i"); 295 298 MODULE_PARM(autocreate, "s"); 296 299 MODULE_PARM(ratectl, "s"); 300 MODULE_PARAM(bmiss_thresh, "i"); 301 MODULE_PARAM(beacon_sleep, "i"); 297 302 #else 298 303 #include <linux/moduleparam.h> 299 304 module_param(countrycode, int, 0600); … … 302 307 module_param(rfkill, int, 0600); 303 308 module_param(autocreate, charp, 0600); 304 309 module_param(ratectl, charp, 0600); 310 module_param(bmiss_thresh, int, 0600); 311 module_param(beacon_sleep, int, 0600); 305 312 #endif 306 313 MODULE_PARM_DESC(countrycode, "Override default country code"); 307 314 MODULE_PARM_DESC(outdoor, "Enable/disable outdoor use"); … … 309 316 MODULE_PARM_DESC(rfkill, "Enable/disable RFKILL capability"); 310 317 MODULE_PARM_DESC(autocreate, "Create ath device in [sta|ap|wds|adhoc|ahdemo|monitor] mode. defaults to sta, use 'none' to disable"); 311 318 MODULE_PARM_DESC(ratectl, "Rate control algorithm [amrr|onoe|sample], defaults to '" DEF_RATE_CTL "'"); 319 MODULE_PARM_DESC(bmiss_thresh, "Override beacon miss threshold"); 320 MODULE_PARM_DESC(beacon_sleep, "Override beacon sleep duration"); 312 321 313 322 static int ath_debug = 0; 314 323 #ifdef AR_DEBUG … … 4514 4523 * is specified in TU so we only need calculate based 4515 4524 * on the beacon interval. Note that we clamp the 4516 4525 * result to at most 10 beacons. 4526 * 4527 * Pepper: added module parameter control of bmissthreshold. 4528 * If param *is* specified, don't clamp values. 4517 4529 */ 4518 bs.bs_bmissthreshold = howmany(ic->ic_bmisstimeout, intval); 4519 if (bs.bs_bmissthreshold > 10) 4520 bs.bs_bmissthreshold = 10; 4521 else if (bs.bs_bmissthreshold <= 0) 4522 bs.bs_bmissthreshold = 1; 4530 if (bmiss_thresh > -1) { 4531 bs.bs_bmissthreshold = bmiss_thresh; 4532 4533 DPRINTF(sc, ATH_DEBUG_BEACON, "%s: bmiss_thresh override - %d\n", 4534 __func__, 4535 bmiss_thresh); 4523 4536 4537 } else { 4538 bs.bs_bmissthreshold = howmany(ic->ic_bmisstimeout, intval); 4539 4540 if (bs.bs_bmissthreshold > 10) 4541 bs.bs_bmissthreshold = 10; 4542 else if (bs.bs_bmissthreshold <= 0) 4543 bs.bs_bmissthreshold = 1; 4544 } 4545 4524 4546 /* 4525 4547 * Calculate sleep duration. The configuration is 4526 4548 * given in ms. We ensure a multiple of the beacon … … 4529 4551 * to make it a multiple of that. 4530 4552 * 4531 4553 * XXX fixed at 100ms 4554 * Pepper: added module param control of sleepduration. 4532 4555 */ 4533 bs.bs_sleepduration = 4534 roundup(IEEE80211_MS_TO_TU(100), bs.bs_intval); 4535 if (bs.bs_sleepduration > bs.bs_dtimperiod) 4536 bs.bs_sleepduration = roundup(bs.bs_sleepduration, bs.bs_dtimperiod); 4556 if (beacon_sleep > -1) { 4557 bs.bs_sleepduration = beacon_sleep; 4558 DPRINTF(sc, ATH_DEBUG_BEACON, "%s: beacon_sleep override - %d\n", 4559 __func__, 4560 beacon_sleep); 4561 } else 4562 bs.bs_sleepduration = 4563 roundup(IEEE80211_MS_TO_TU(100), bs.bs_intval); 4537 4564 4538 4565 DPRINTF(sc, ATH_DEBUG_BEACON, 4539 4566 "%s: tsf %llu tsf:tu %u intval %u nexttbtt %u dtim %u nextdtim %u bmiss %u sleep %u cfp:period %u maxdur %u next %u timoffset %u\n" … … 4553 4580 4554 4581 ath_hal_intrset(ah, 0); 4555 4582 ath_hal_beacontimers(ah, &bs); 4556 sc->sc_imask |= HAL_INT_BMISS; 4583 4584 /* 'bmiss_thresh == 0' disables beacon miss interrupts completely */ 4585 if (bmiss_thresh != 0) 4586 sc->sc_imask |= HAL_INT_BMISS; 4587 4557 4588 ath_hal_intrset(ah, sc->sc_imask); 4558 4589 } else { 4559 4590 ath_hal_intrset(ah, 0);
