rt2x00: bss_info_changed() callback is allowed to sleep
authorIvo van Doorn <ivdoorn@gmail.com>
Tue, 18 Aug 2009 18:33:12 +0000 (20:33 +0200)
committerJohn W. Linville <linville@tuxdriver.com>
Thu, 20 Aug 2009 15:36:05 +0000 (11:36 -0400)
The bss_info_changed() callback function no longer needs
to be atomic. Remove the scheduled work structure and
call into the driver directly.

Additionaly this makes the DRIVER_REQUIRE_SCHEDULED
flag redundant so it can be removed.

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

index 09a589432dabf11731aef04318c42e7c5f576a69..b04f59bab3b06a2dd81f78f3dc84ff3af79ff2b4 100644 (file)
@@ -1874,7 +1874,6 @@ static int rt2500usb_probe_hw(struct rt2x00_dev *rt2x00dev)
         */
        __set_bit(DRIVER_REQUIRE_ATIM_QUEUE, &rt2x00dev->flags);
        __set_bit(DRIVER_REQUIRE_BEACON_GUARD, &rt2x00dev->flags);
-       __set_bit(DRIVER_REQUIRE_SCHEDULED, &rt2x00dev->flags);
        if (!modparam_nohwcrypt) {
                __set_bit(CONFIG_SUPPORT_HW_CRYPTO, &rt2x00dev->flags);
                __set_bit(DRIVER_REQUIRE_COPY_IV, &rt2x00dev->flags);
index 45e02f16d75bea185d9728092ee7224ee1ad308b..639dc6cc04b98f0c038e99c88c8a79653e1e2498 100644 (file)
@@ -2634,7 +2634,6 @@ static int rt2800usb_probe_hw(struct rt2x00_dev *rt2x00dev)
         * This device requires firmware.
         */
        __set_bit(DRIVER_REQUIRE_FIRMWARE, &rt2x00dev->flags);
-       __set_bit(DRIVER_REQUIRE_SCHEDULED, &rt2x00dev->flags);
        __set_bit(DRIVER_REQUIRE_L2PAD, &rt2x00dev->flags);
        if (!modparam_nohwcrypt)
                __set_bit(CONFIG_SUPPORT_HW_CRYPTO, &rt2x00dev->flags);
index ad70946c3b5f5a2dfc62c848b655a8161fbe55c3..555a777db6df1ed6a795a790fb25edf822bd6f0a 100644 (file)
@@ -350,8 +350,6 @@ struct rt2x00_intf {
         */
        unsigned int delayed_flags;
 #define DELAYED_UPDATE_BEACON          0x00000001
-#define DELAYED_CONFIG_ERP             0x00000002
-#define DELAYED_LED_ASSOC              0x00000004
 
        /*
         * Software sequence counter, this is only required
@@ -614,7 +612,6 @@ enum rt2x00_flags {
        DRIVER_REQUIRE_FIRMWARE,
        DRIVER_REQUIRE_BEACON_GUARD,
        DRIVER_REQUIRE_ATIM_QUEUE,
-       DRIVER_REQUIRE_SCHEDULED,
        DRIVER_REQUIRE_DMA,
        DRIVER_REQUIRE_COPY_IV,
        DRIVER_REQUIRE_L2PAD,
index 16b560a661e3a39904fca85a088819a867b3fd2c..3f8c70ebe9ad9dd485811ac9ff675ba0894be1ff 100644 (file)
@@ -123,7 +123,6 @@ static void rt2x00lib_intf_scheduled_iter(void *data, u8 *mac,
 {
        struct rt2x00_dev *rt2x00dev = data;
        struct rt2x00_intf *intf = vif_to_intf(vif);
-       struct ieee80211_bss_conf conf;
        int delayed_flags;
 
        /*
@@ -133,7 +132,6 @@ static void rt2x00lib_intf_scheduled_iter(void *data, u8 *mac,
         */
        spin_lock(&intf->lock);
 
-       memcpy(&conf, &vif->bss_conf, sizeof(conf));
        delayed_flags = intf->delayed_flags;
        intf->delayed_flags = 0;
 
@@ -150,12 +148,6 @@ static void rt2x00lib_intf_scheduled_iter(void *data, u8 *mac,
 
        if (delayed_flags & DELAYED_UPDATE_BEACON)
                rt2x00queue_update_beacon(rt2x00dev, vif, true);
-
-       if (delayed_flags & DELAYED_CONFIG_ERP)
-               rt2x00lib_config_erp(rt2x00dev, intf, &conf);
-
-       if (delayed_flags & DELAYED_LED_ASSOC)
-               rt2x00leds_led_assoc(rt2x00dev, !!rt2x00dev->intf_associated);
 }
 
 static void rt2x00lib_intf_scheduled(struct work_struct *work)
index 967d3b55c89723f291c0b244f12ca477a9129ad7..a91f316cd45291ea2e270f932467748f30dd8a85 100644 (file)
@@ -636,23 +636,15 @@ void rt2x00mac_bss_info_changed(struct ieee80211_hw *hw,
                else
                        rt2x00dev->intf_associated--;
 
-               if (!test_bit(DRIVER_REQUIRE_SCHEDULED, &rt2x00dev->flags))
-                       rt2x00leds_led_assoc(rt2x00dev,
-                                            !!rt2x00dev->intf_associated);
-               else
-                       delayed |= DELAYED_LED_ASSOC;
+               rt2x00leds_led_assoc(rt2x00dev, !!rt2x00dev->intf_associated);
        }
 
        /*
         * When the erp information has changed, we should perform
         * additional configuration steps. For all other changes we are done.
         */
-       if (changes & ~(BSS_CHANGED_ASSOC | BSS_CHANGED_HT)) {
-               if (!test_bit(DRIVER_REQUIRE_SCHEDULED, &rt2x00dev->flags))
-                       rt2x00lib_config_erp(rt2x00dev, intf, bss_conf);
-               else
-                       delayed |= DELAYED_CONFIG_ERP;
-       }
+       if (changes & ~(BSS_CHANGED_ASSOC | BSS_CHANGED_HT))
+               rt2x00lib_config_erp(rt2x00dev, intf, bss_conf);
 
        spin_lock(&intf->lock);
        if (delayed) {
index 4d94b65943f19b71e798fc26d2b30cffab32cdb5..90e11726305128c60208306a1490c1b097685f0c 100644 (file)
@@ -2151,7 +2151,6 @@ static int rt73usb_probe_hw(struct rt2x00_dev *rt2x00dev)
         * This device requires firmware.
         */
        __set_bit(DRIVER_REQUIRE_FIRMWARE, &rt2x00dev->flags);
-       __set_bit(DRIVER_REQUIRE_SCHEDULED, &rt2x00dev->flags);
        if (!modparam_nohwcrypt)
                __set_bit(CONFIG_SUPPORT_HW_CRYPTO, &rt2x00dev->flags);