193
193
* Determine if software diversity is enabled for
194
194
* either the TX or RX antenna (or both).
195
* Always perform this check since within the link
196
* tuner interval the configuration might have changed.
198
ant->flags &= ~ANTENNA_RX_DIVERSITY;
199
ant->flags &= ~ANTENNA_TX_DIVERSITY;
201
if (rt2x00dev->default_ant.rx == ANTENNA_SW_DIVERSITY)
202
ant->flags |= ANTENNA_RX_DIVERSITY;
203
if (rt2x00dev->default_ant.tx == ANTENNA_SW_DIVERSITY)
204
ant->flags |= ANTENNA_TX_DIVERSITY;
206
196
if (!(ant->flags & ANTENNA_RX_DIVERSITY) &&
207
197
!(ant->flags & ANTENNA_TX_DIVERSITY)) {
284
274
* While scanning, link tuning is disabled. By default
285
275
* the most sensitive settings will be used to make sure
286
* that all beacons and probe responses will be recieved
276
* that all beacons and probe responses will be received
287
277
* during the scan.
289
279
if (test_bit(DEVICE_STATE_SCANNING, &rt2x00dev->flags))
383
373
* do not support link tuning at all, while other devices can disable
384
374
* the feature from the EEPROM.
386
if (test_bit(DRIVER_SUPPORT_LINK_TUNING, &rt2x00dev->flags))
376
if (test_bit(CAPABILITY_LINK_TUNING, &rt2x00dev->cap_flags))
387
377
rt2x00dev->ops->lib->link_tuner(rt2x00dev, qual, link->count);
414
404
struct link *link = &rt2x00dev->link;
416
if (!test_bit(DEVICE_STATE_PRESENT, &rt2x00dev->flags) ||
417
!test_bit(DRIVER_SUPPORT_WATCHDOG, &rt2x00dev->flags))
420
schedule_delayed_work(&link->watchdog_work, WATCHDOG_INTERVAL);
406
if (test_bit(DEVICE_STATE_PRESENT, &rt2x00dev->flags) &&
407
rt2x00dev->ops->lib->watchdog)
408
ieee80211_queue_delayed_work(rt2x00dev->hw,
409
&link->watchdog_work,
423
413
void rt2x00link_stop_watchdog(struct rt2x00_dev *rt2x00dev)
441
431
rt2x00dev->ops->lib->watchdog(rt2x00dev);
443
433
if (test_bit(DEVICE_STATE_PRESENT, &rt2x00dev->flags))
444
schedule_delayed_work(&link->watchdog_work, WATCHDOG_INTERVAL);
434
ieee80211_queue_delayed_work(rt2x00dev->hw,
435
&link->watchdog_work,
439
void rt2x00link_start_agc(struct rt2x00_dev *rt2x00dev)
441
struct link *link = &rt2x00dev->link;
443
if (test_bit(DEVICE_STATE_PRESENT, &rt2x00dev->flags) &&
444
rt2x00dev->ops->lib->gain_calibration)
445
ieee80211_queue_delayed_work(rt2x00dev->hw,
450
void rt2x00link_stop_agc(struct rt2x00_dev *rt2x00dev)
452
cancel_delayed_work_sync(&rt2x00dev->link.agc_work);
455
static void rt2x00link_agc(struct work_struct *work)
457
struct rt2x00_dev *rt2x00dev =
458
container_of(work, struct rt2x00_dev, link.agc_work.work);
459
struct link *link = &rt2x00dev->link;
462
* When the radio is shutting down we should
463
* immediately cease the watchdog monitoring.
465
if (!test_bit(DEVICE_STATE_ENABLED_RADIO, &rt2x00dev->flags))
468
rt2x00dev->ops->lib->gain_calibration(rt2x00dev);
470
if (test_bit(DEVICE_STATE_PRESENT, &rt2x00dev->flags))
471
ieee80211_queue_delayed_work(rt2x00dev->hw,
447
476
void rt2x00link_register(struct rt2x00_dev *rt2x00dev)
478
INIT_DELAYED_WORK(&rt2x00dev->link.agc_work, rt2x00link_agc);
449
479
INIT_DELAYED_WORK(&rt2x00dev->link.watchdog_work, rt2x00link_watchdog);
450
480
INIT_DELAYED_WORK(&rt2x00dev->link.work, rt2x00link_tuner);