diff options
author | Benjamin Herrenschmidt <benh@kernel.crashing.org> | 2009-06-16 20:24:53 -0400 |
---|---|---|
committer | Benjamin Herrenschmidt <benh@kernel.crashing.org> | 2009-06-16 20:24:53 -0400 |
commit | 492b057c426e4aa747484958e18e9da29003985d (patch) | |
tree | 34e08c24618688d8bcc190523028b5f94cce0c0b /drivers/net/wireless/rt2x00/rt2400pci.c | |
parent | 313485175da221c388f6a8ecf4c30062ba9bea17 (diff) | |
parent | 300df7dc89cc276377fc020704e34875d5c473b6 (diff) |
Merge commit 'origin/master' into next
Diffstat (limited to 'drivers/net/wireless/rt2x00/rt2400pci.c')
-rw-r--r-- | drivers/net/wireless/rt2x00/rt2400pci.c | 35 |
1 files changed, 10 insertions, 25 deletions
diff --git a/drivers/net/wireless/rt2x00/rt2400pci.c b/drivers/net/wireless/rt2x00/rt2400pci.c index 0f08773328c6..435f945fe64d 100644 --- a/drivers/net/wireless/rt2x00/rt2400pci.c +++ b/drivers/net/wireless/rt2x00/rt2400pci.c | |||
@@ -335,10 +335,11 @@ static void rt2400pci_config_erp(struct rt2x00_dev *rt2x00dev, | |||
335 | preamble_mask = erp->short_preamble << 3; | 335 | preamble_mask = erp->short_preamble << 3; |
336 | 336 | ||
337 | rt2x00pci_register_read(rt2x00dev, TXCSR1, ®); | 337 | rt2x00pci_register_read(rt2x00dev, TXCSR1, ®); |
338 | rt2x00_set_field32(®, TXCSR1_ACK_TIMEOUT, | 338 | rt2x00_set_field32(®, TXCSR1_ACK_TIMEOUT, erp->ack_timeout); |
339 | erp->ack_timeout); | ||
340 | rt2x00_set_field32(®, TXCSR1_ACK_CONSUME_TIME, | 339 | rt2x00_set_field32(®, TXCSR1_ACK_CONSUME_TIME, |
341 | erp->ack_consume_time); | 340 | erp->ack_consume_time); |
341 | rt2x00_set_field32(®, TXCSR1_TSF_OFFSET, IEEE80211_HEADER); | ||
342 | rt2x00_set_field32(®, TXCSR1_AUTORESPONDER, 1); | ||
342 | rt2x00pci_register_write(rt2x00dev, TXCSR1, reg); | 343 | rt2x00pci_register_write(rt2x00dev, TXCSR1, reg); |
343 | 344 | ||
344 | rt2x00pci_register_read(rt2x00dev, ARCSR2, ®); | 345 | rt2x00pci_register_read(rt2x00dev, ARCSR2, ®); |
@@ -371,6 +372,11 @@ static void rt2400pci_config_erp(struct rt2x00_dev *rt2x00dev, | |||
371 | rt2x00_set_field32(®, CSR11_SLOT_TIME, erp->slot_time); | 372 | rt2x00_set_field32(®, CSR11_SLOT_TIME, erp->slot_time); |
372 | rt2x00pci_register_write(rt2x00dev, CSR11, reg); | 373 | rt2x00pci_register_write(rt2x00dev, CSR11, reg); |
373 | 374 | ||
375 | rt2x00pci_register_read(rt2x00dev, CSR12, ®); | ||
376 | rt2x00_set_field32(®, CSR12_BEACON_INTERVAL, erp->beacon_int * 16); | ||
377 | rt2x00_set_field32(®, CSR12_CFP_MAX_DURATION, erp->beacon_int * 16); | ||
378 | rt2x00pci_register_write(rt2x00dev, CSR12, reg); | ||
379 | |||
374 | rt2x00pci_register_read(rt2x00dev, CSR18, ®); | 380 | rt2x00pci_register_read(rt2x00dev, CSR18, ®); |
375 | rt2x00_set_field32(®, CSR18_SIFS, erp->sifs); | 381 | rt2x00_set_field32(®, CSR18_SIFS, erp->sifs); |
376 | rt2x00_set_field32(®, CSR18_PIFS, erp->pifs); | 382 | rt2x00_set_field32(®, CSR18_PIFS, erp->pifs); |
@@ -503,24 +509,6 @@ static void rt2400pci_config_retry_limit(struct rt2x00_dev *rt2x00dev, | |||
503 | rt2x00pci_register_write(rt2x00dev, CSR11, reg); | 509 | rt2x00pci_register_write(rt2x00dev, CSR11, reg); |
504 | } | 510 | } |
505 | 511 | ||
506 | static void rt2400pci_config_duration(struct rt2x00_dev *rt2x00dev, | ||
507 | struct rt2x00lib_conf *libconf) | ||
508 | { | ||
509 | u32 reg; | ||
510 | |||
511 | rt2x00pci_register_read(rt2x00dev, TXCSR1, ®); | ||
512 | rt2x00_set_field32(®, TXCSR1_TSF_OFFSET, IEEE80211_HEADER); | ||
513 | rt2x00_set_field32(®, TXCSR1_AUTORESPONDER, 1); | ||
514 | rt2x00pci_register_write(rt2x00dev, TXCSR1, reg); | ||
515 | |||
516 | rt2x00pci_register_read(rt2x00dev, CSR12, ®); | ||
517 | rt2x00_set_field32(®, CSR12_BEACON_INTERVAL, | ||
518 | libconf->conf->beacon_int * 16); | ||
519 | rt2x00_set_field32(®, CSR12_CFP_MAX_DURATION, | ||
520 | libconf->conf->beacon_int * 16); | ||
521 | rt2x00pci_register_write(rt2x00dev, CSR12, reg); | ||
522 | } | ||
523 | |||
524 | static void rt2400pci_config_ps(struct rt2x00_dev *rt2x00dev, | 512 | static void rt2400pci_config_ps(struct rt2x00_dev *rt2x00dev, |
525 | struct rt2x00lib_conf *libconf) | 513 | struct rt2x00lib_conf *libconf) |
526 | { | 514 | { |
@@ -532,7 +520,7 @@ static void rt2400pci_config_ps(struct rt2x00_dev *rt2x00dev, | |||
532 | if (state == STATE_SLEEP) { | 520 | if (state == STATE_SLEEP) { |
533 | rt2x00pci_register_read(rt2x00dev, CSR20, ®); | 521 | rt2x00pci_register_read(rt2x00dev, CSR20, ®); |
534 | rt2x00_set_field32(®, CSR20_DELAY_AFTER_TBCN, | 522 | rt2x00_set_field32(®, CSR20_DELAY_AFTER_TBCN, |
535 | (libconf->conf->beacon_int - 20) * 16); | 523 | (rt2x00dev->beacon_int - 20) * 16); |
536 | rt2x00_set_field32(®, CSR20_TBCN_BEFORE_WAKEUP, | 524 | rt2x00_set_field32(®, CSR20_TBCN_BEFORE_WAKEUP, |
537 | libconf->conf->listen_interval - 1); | 525 | libconf->conf->listen_interval - 1); |
538 | 526 | ||
@@ -558,8 +546,6 @@ static void rt2400pci_config(struct rt2x00_dev *rt2x00dev, | |||
558 | libconf->conf->power_level); | 546 | libconf->conf->power_level); |
559 | if (flags & IEEE80211_CONF_CHANGE_RETRY_LIMITS) | 547 | if (flags & IEEE80211_CONF_CHANGE_RETRY_LIMITS) |
560 | rt2400pci_config_retry_limit(rt2x00dev, libconf); | 548 | rt2400pci_config_retry_limit(rt2x00dev, libconf); |
561 | if (flags & IEEE80211_CONF_CHANGE_BEACON_INTERVAL) | ||
562 | rt2400pci_config_duration(rt2x00dev, libconf); | ||
563 | if (flags & IEEE80211_CONF_CHANGE_PS) | 549 | if (flags & IEEE80211_CONF_CHANGE_PS) |
564 | rt2400pci_config_ps(rt2x00dev, libconf); | 550 | rt2400pci_config_ps(rt2x00dev, libconf); |
565 | } | 551 | } |
@@ -1361,7 +1347,7 @@ static int rt2400pci_init_eeprom(struct rt2x00_dev *rt2x00dev) | |||
1361 | */ | 1347 | */ |
1362 | value = rt2x00_get_field16(eeprom, EEPROM_ANTENNA_RF_TYPE); | 1348 | value = rt2x00_get_field16(eeprom, EEPROM_ANTENNA_RF_TYPE); |
1363 | rt2x00pci_register_read(rt2x00dev, CSR0, ®); | 1349 | rt2x00pci_register_read(rt2x00dev, CSR0, ®); |
1364 | rt2x00_set_chip(rt2x00dev, RT2460, value, reg); | 1350 | rt2x00_set_chip_rf(rt2x00dev, value, reg); |
1365 | 1351 | ||
1366 | if (!rt2x00_rf(&rt2x00dev->chip, RF2420) && | 1352 | if (!rt2x00_rf(&rt2x00dev->chip, RF2420) && |
1367 | !rt2x00_rf(&rt2x00dev->chip, RF2421)) { | 1353 | !rt2x00_rf(&rt2x00dev->chip, RF2421)) { |
@@ -1580,7 +1566,6 @@ static const struct ieee80211_ops rt2400pci_mac80211_ops = { | |||
1580 | .add_interface = rt2x00mac_add_interface, | 1566 | .add_interface = rt2x00mac_add_interface, |
1581 | .remove_interface = rt2x00mac_remove_interface, | 1567 | .remove_interface = rt2x00mac_remove_interface, |
1582 | .config = rt2x00mac_config, | 1568 | .config = rt2x00mac_config, |
1583 | .config_interface = rt2x00mac_config_interface, | ||
1584 | .configure_filter = rt2x00mac_configure_filter, | 1569 | .configure_filter = rt2x00mac_configure_filter, |
1585 | .get_stats = rt2x00mac_get_stats, | 1570 | .get_stats = rt2x00mac_get_stats, |
1586 | .bss_info_changed = rt2x00mac_bss_info_changed, | 1571 | .bss_info_changed = rt2x00mac_bss_info_changed, |