aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/rt2x00/rt73usb.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net/wireless/rt2x00/rt73usb.c')
-rw-r--r--drivers/net/wireless/rt2x00/rt73usb.c34
1 files changed, 10 insertions, 24 deletions
diff --git a/drivers/net/wireless/rt2x00/rt73usb.c b/drivers/net/wireless/rt2x00/rt73usb.c
index 853b2b279b64..c18848836f2d 100644
--- a/drivers/net/wireless/rt2x00/rt73usb.c
+++ b/drivers/net/wireless/rt2x00/rt73usb.c
@@ -566,15 +566,22 @@ static void rt73usb_config_erp(struct rt2x00_dev *rt2x00dev,
566 566
567 rt2x00usb_register_read(rt2x00dev, TXRX_CSR0, &reg); 567 rt2x00usb_register_read(rt2x00dev, TXRX_CSR0, &reg);
568 rt2x00_set_field32(&reg, TXRX_CSR0_RX_ACK_TIMEOUT, erp->ack_timeout); 568 rt2x00_set_field32(&reg, TXRX_CSR0_RX_ACK_TIMEOUT, erp->ack_timeout);
569 rt2x00_set_field32(&reg, TXRX_CSR0_TSF_OFFSET, IEEE80211_HEADER);
569 rt2x00usb_register_write(rt2x00dev, TXRX_CSR0, reg); 570 rt2x00usb_register_write(rt2x00dev, TXRX_CSR0, reg);
570 571
571 rt2x00usb_register_read(rt2x00dev, TXRX_CSR4, &reg); 572 rt2x00usb_register_read(rt2x00dev, TXRX_CSR4, &reg);
573 rt2x00_set_field32(&reg, TXRX_CSR4_AUTORESPOND_ENABLE, 1);
572 rt2x00_set_field32(&reg, TXRX_CSR4_AUTORESPOND_PREAMBLE, 574 rt2x00_set_field32(&reg, TXRX_CSR4_AUTORESPOND_PREAMBLE,
573 !!erp->short_preamble); 575 !!erp->short_preamble);
574 rt2x00usb_register_write(rt2x00dev, TXRX_CSR4, reg); 576 rt2x00usb_register_write(rt2x00dev, TXRX_CSR4, reg);
575 577
576 rt2x00usb_register_write(rt2x00dev, TXRX_CSR5, erp->basic_rates); 578 rt2x00usb_register_write(rt2x00dev, TXRX_CSR5, erp->basic_rates);
577 579
580 rt2x00usb_register_read(rt2x00dev, TXRX_CSR9, &reg);
581 rt2x00_set_field32(&reg, TXRX_CSR9_BEACON_INTERVAL,
582 erp->beacon_int * 16);
583 rt2x00usb_register_write(rt2x00dev, TXRX_CSR9, reg);
584
578 rt2x00usb_register_read(rt2x00dev, MAC_CSR9, &reg); 585 rt2x00usb_register_read(rt2x00dev, MAC_CSR9, &reg);
579 rt2x00_set_field32(&reg, MAC_CSR9_SLOT_TIME, erp->slot_time); 586 rt2x00_set_field32(&reg, MAC_CSR9_SLOT_TIME, erp->slot_time);
580 rt2x00usb_register_write(rt2x00dev, MAC_CSR9, reg); 587 rt2x00usb_register_write(rt2x00dev, MAC_CSR9, reg);
@@ -834,25 +841,6 @@ static void rt73usb_config_retry_limit(struct rt2x00_dev *rt2x00dev,
834 rt2x00usb_register_write(rt2x00dev, TXRX_CSR4, reg); 841 rt2x00usb_register_write(rt2x00dev, TXRX_CSR4, reg);
835} 842}
836 843
837static void rt73usb_config_duration(struct rt2x00_dev *rt2x00dev,
838 struct rt2x00lib_conf *libconf)
839{
840 u32 reg;
841
842 rt2x00usb_register_read(rt2x00dev, TXRX_CSR0, &reg);
843 rt2x00_set_field32(&reg, TXRX_CSR0_TSF_OFFSET, IEEE80211_HEADER);
844 rt2x00usb_register_write(rt2x00dev, TXRX_CSR0, reg);
845
846 rt2x00usb_register_read(rt2x00dev, TXRX_CSR4, &reg);
847 rt2x00_set_field32(&reg, TXRX_CSR4_AUTORESPOND_ENABLE, 1);
848 rt2x00usb_register_write(rt2x00dev, TXRX_CSR4, reg);
849
850 rt2x00usb_register_read(rt2x00dev, TXRX_CSR9, &reg);
851 rt2x00_set_field32(&reg, TXRX_CSR9_BEACON_INTERVAL,
852 libconf->conf->beacon_int * 16);
853 rt2x00usb_register_write(rt2x00dev, TXRX_CSR9, reg);
854}
855
856static void rt73usb_config_ps(struct rt2x00_dev *rt2x00dev, 844static void rt73usb_config_ps(struct rt2x00_dev *rt2x00dev,
857 struct rt2x00lib_conf *libconf) 845 struct rt2x00lib_conf *libconf)
858{ 846{
@@ -864,7 +852,7 @@ static void rt73usb_config_ps(struct rt2x00_dev *rt2x00dev,
864 if (state == STATE_SLEEP) { 852 if (state == STATE_SLEEP) {
865 rt2x00usb_register_read(rt2x00dev, MAC_CSR11, &reg); 853 rt2x00usb_register_read(rt2x00dev, MAC_CSR11, &reg);
866 rt2x00_set_field32(&reg, MAC_CSR11_DELAY_AFTER_TBCN, 854 rt2x00_set_field32(&reg, MAC_CSR11_DELAY_AFTER_TBCN,
867 libconf->conf->beacon_int - 10); 855 rt2x00dev->beacon_int - 10);
868 rt2x00_set_field32(&reg, MAC_CSR11_TBCN_BEFORE_WAKEUP, 856 rt2x00_set_field32(&reg, MAC_CSR11_TBCN_BEFORE_WAKEUP,
869 libconf->conf->listen_interval - 1); 857 libconf->conf->listen_interval - 1);
870 rt2x00_set_field32(&reg, MAC_CSR11_WAKEUP_LATENCY, 5); 858 rt2x00_set_field32(&reg, MAC_CSR11_WAKEUP_LATENCY, 5);
@@ -906,8 +894,6 @@ static void rt73usb_config(struct rt2x00_dev *rt2x00dev,
906 rt73usb_config_txpower(rt2x00dev, libconf->conf->power_level); 894 rt73usb_config_txpower(rt2x00dev, libconf->conf->power_level);
907 if (flags & IEEE80211_CONF_CHANGE_RETRY_LIMITS) 895 if (flags & IEEE80211_CONF_CHANGE_RETRY_LIMITS)
908 rt73usb_config_retry_limit(rt2x00dev, libconf); 896 rt73usb_config_retry_limit(rt2x00dev, libconf);
909 if (flags & IEEE80211_CONF_CHANGE_BEACON_INTERVAL)
910 rt73usb_config_duration(rt2x00dev, libconf);
911 if (flags & IEEE80211_CONF_CHANGE_PS) 897 if (flags & IEEE80211_CONF_CHANGE_PS)
912 rt73usb_config_ps(rt2x00dev, libconf); 898 rt73usb_config_ps(rt2x00dev, libconf);
913} 899}
@@ -1846,7 +1832,8 @@ static int rt73usb_init_eeprom(struct rt2x00_dev *rt2x00dev)
1846 rt2x00usb_register_read(rt2x00dev, MAC_CSR0, &reg); 1832 rt2x00usb_register_read(rt2x00dev, MAC_CSR0, &reg);
1847 rt2x00_set_chip(rt2x00dev, RT2571, value, reg); 1833 rt2x00_set_chip(rt2x00dev, RT2571, value, reg);
1848 1834
1849 if (!rt2x00_check_rev(&rt2x00dev->chip, 0x25730)) { 1835 if (!rt2x00_check_rev(&rt2x00dev->chip, 0x000ffff0, 0x25730) ||
1836 rt2x00_check_rev(&rt2x00dev->chip, 0x0000000f, 0)) {
1850 ERROR(rt2x00dev, "Invalid RT chipset detected.\n"); 1837 ERROR(rt2x00dev, "Invalid RT chipset detected.\n");
1851 return -ENODEV; 1838 return -ENODEV;
1852 } 1839 }
@@ -2259,7 +2246,6 @@ static const struct ieee80211_ops rt73usb_mac80211_ops = {
2259 .add_interface = rt2x00mac_add_interface, 2246 .add_interface = rt2x00mac_add_interface,
2260 .remove_interface = rt2x00mac_remove_interface, 2247 .remove_interface = rt2x00mac_remove_interface,
2261 .config = rt2x00mac_config, 2248 .config = rt2x00mac_config,
2262 .config_interface = rt2x00mac_config_interface,
2263 .configure_filter = rt2x00mac_configure_filter, 2249 .configure_filter = rt2x00mac_configure_filter,
2264 .set_key = rt2x00mac_set_key, 2250 .set_key = rt2x00mac_set_key,
2265 .get_stats = rt2x00mac_get_stats, 2251 .get_stats = rt2x00mac_get_stats,