rt2x00: Remove last usage of beacon_int from ieee80211_config
authorIvo van Doorn <ivdoorn@gmail.com>
Sat, 23 May 2009 19:09:28 +0000 (21:09 +0200)
committerJohn W. Linville <linville@tuxdriver.com>
Wed, 3 Jun 2009 18:05:10 +0000 (14:05 -0400)
This removes the last usage of beacon_int inside the iee80211_config
structure from rt2x00. The attempt is a bit hackish, and subject to
change in the future when the entire rt2x00_dev structure is
cleaned up and restructured.

Signed-off-by: Ivo van Doorn <IvDoorn@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
drivers/net/wireless/rt2x00/rt2400pci.c
drivers/net/wireless/rt2x00/rt2500pci.c
drivers/net/wireless/rt2x00/rt2500usb.c
drivers/net/wireless/rt2x00/rt2x00.h
drivers/net/wireless/rt2x00/rt2x00config.c
drivers/net/wireless/rt2x00/rt61pci.c
drivers/net/wireless/rt2x00/rt73usb.c

index 0197531bd88c60f8cdfcf2a8be12d189120ea32a..435f945fe64dff87cf602250adbcbc512ed98667 100644 (file)
@@ -520,7 +520,7 @@ static void rt2400pci_config_ps(struct rt2x00_dev *rt2x00dev,
        if (state == STATE_SLEEP) {
                rt2x00pci_register_read(rt2x00dev, CSR20, &reg);
                rt2x00_set_field32(&reg, CSR20_DELAY_AFTER_TBCN,
-                                  (libconf->conf->beacon_int - 20) * 16);
+                                  (rt2x00dev->beacon_int - 20) * 16);
                rt2x00_set_field32(&reg, CSR20_TBCN_BEFORE_WAKEUP,
                                   libconf->conf->listen_interval - 1);
 
index f95cb646f85a4e42ece05f446759aeb78e366560..08b30d01e67d8d378b91c90dd7d04027f79e3b21 100644 (file)
@@ -569,7 +569,7 @@ static void rt2500pci_config_ps(struct rt2x00_dev *rt2x00dev,
        if (state == STATE_SLEEP) {
                rt2x00pci_register_read(rt2x00dev, CSR20, &reg);
                rt2x00_set_field32(&reg, CSR20_DELAY_AFTER_TBCN,
-                                  (libconf->conf->beacon_int - 20) * 16);
+                                  (rt2x00dev->beacon_int - 20) * 16);
                rt2x00_set_field32(&reg, CSR20_TBCN_BEFORE_WAKEUP,
                                   libconf->conf->listen_interval - 1);
 
index 69f966f1ce5428f4c4bd1cdb2bd5f876b961d495..66daf68ff0ee9e35de4d0933413198432381cfbf 100644 (file)
@@ -647,7 +647,7 @@ static void rt2500usb_config_ps(struct rt2x00_dev *rt2x00dev,
        if (state == STATE_SLEEP) {
                rt2500usb_register_read(rt2x00dev, MAC_CSR18, &reg);
                rt2x00_set_field16(&reg, MAC_CSR18_DELAY_AFTER_BEACON,
-                                  libconf->conf->beacon_int - 20);
+                                  rt2x00dev->beacon_int - 20);
                rt2x00_set_field16(&reg, MAC_CSR18_BEACONS_BEFORE_WAKEUP,
                                   libconf->conf->listen_interval - 1);
 
index 2b64a6198698225d74e48ee7688a668680572158..a498dde024e1b58c55555e00d349a5cc28846218 100644 (file)
@@ -801,6 +801,11 @@ struct rt2x00_dev {
         */
        u8 calibration[2];
 
+       /*
+        * Beacon interval.
+        */
+       u16 beacon_int;
+
        /*
         * Low level statistics which will have
         * to be kept up to date while device is running.
index c5bbf0b6e20765de3b935118615f212c8143b3c5..3e019a12df2e092ec783630df7f457556768887f 100644 (file)
@@ -108,6 +108,9 @@ void rt2x00lib_config_erp(struct rt2x00_dev *rt2x00dev,
        erp.basic_rates = bss_conf->basic_rates;
        erp.beacon_int = bss_conf->beacon_int;
 
+       /* Update global beacon interval time, this is needed for PS support */
+       rt2x00dev->beacon_int = bss_conf->beacon_int;
+
        rt2x00dev->ops->lib->config_erp(rt2x00dev, &erp);
 }
 
index a8bf5c43285884b0bd16f85ef039a55fdfff4141..49b29ff90c47acdf70dfaf06c01f02036d6916d3 100644 (file)
@@ -956,7 +956,7 @@ static void rt61pci_config_ps(struct rt2x00_dev *rt2x00dev,
        if (state == STATE_SLEEP) {
                rt2x00pci_register_read(rt2x00dev, MAC_CSR11, &reg);
                rt2x00_set_field32(&reg, MAC_CSR11_DELAY_AFTER_TBCN,
-                                  libconf->conf->beacon_int - 10);
+                                  rt2x00dev->beacon_int - 10);
                rt2x00_set_field32(&reg, MAC_CSR11_TBCN_BEFORE_WAKEUP,
                                   libconf->conf->listen_interval - 1);
                rt2x00_set_field32(&reg, MAC_CSR11_WAKEUP_LATENCY, 5);
index 211a3d6bc054e9b659dcf7c2ba7ad50acb14df7f..c18848836f2dac86e9abb0289175bfcb0712cbc6 100644 (file)
@@ -852,7 +852,7 @@ static void rt73usb_config_ps(struct rt2x00_dev *rt2x00dev,
        if (state == STATE_SLEEP) {
                rt2x00usb_register_read(rt2x00dev, MAC_CSR11, &reg);
                rt2x00_set_field32(&reg, MAC_CSR11_DELAY_AFTER_TBCN,
-                                  libconf->conf->beacon_int - 10);
+                                  rt2x00dev->beacon_int - 10);
                rt2x00_set_field32(&reg, MAC_CSR11_TBCN_BEFORE_WAKEUP,
                                   libconf->conf->listen_interval - 1);
                rt2x00_set_field32(&reg, MAC_CSR11_WAKEUP_LATENCY, 5);