wl12xx: make WL1271_FLAG_AP_STARTED flag per-vif
authorEliad Peller <eliad@wizery.com>
Mon, 10 Oct 2011 08:13:02 +0000 (10:13 +0200)
committerLuciano Coelho <coelho@ti.com>
Tue, 11 Oct 2011 12:09:57 +0000 (15:09 +0300)
This flag should be set per-vif, rather than globally.

Signed-off-by: Eliad Peller <eliad@wizery.com>
Signed-off-by: Luciano Coelho <coelho@ti.com>
drivers/net/wireless/wl12xx/main.c
drivers/net/wireless/wl12xx/tx.c
drivers/net/wireless/wl12xx/wl12xx.h

index ac5be73234052be7ece17cf935ece36965f9b750..41cc5fe27d87b6d65cfee5aef5093e2c1a9b595b 100644 (file)
@@ -1235,7 +1235,7 @@ static void wl1271_recovery_work(struct work_struct *work)
         */
        wl12xx_for_each_wlvif(wl, wlvif) {
                if (test_bit(WLVIF_FLAG_STA_ASSOCIATED, &wlvif->flags) ||
-                   test_bit(WL1271_FLAG_AP_STARTED, &wl->flags))
+                   test_bit(WLVIF_FLAG_AP_STARTED, &wlvif->flags))
                        wlvif->tx_security_seq +=
                                WL1271_TX_SQN_POST_RECOVERY_PADDING;
        }
@@ -1662,7 +1662,7 @@ static int wl1271_configure_suspend_ap(struct wl1271 *wl,
 
        mutex_lock(&wl->mutex);
 
-       if (!test_bit(WL1271_FLAG_AP_STARTED, &wl->flags))
+       if (!test_bit(WLVIF_FLAG_AP_STARTED, &wlvif->flags))
                goto out_unlock;
 
        ret = wl1271_ps_elp_wakeup(wl);
@@ -2768,7 +2768,7 @@ static int wl1271_set_key(struct wl1271 *wl, struct wl12xx_vif *wlvif,
                        hlid = wlvif->ap.bcast_hlid;
                }
 
-               if (!test_bit(WL1271_FLAG_AP_STARTED, &wl->flags)) {
+               if (!test_bit(WLVIF_FLAG_AP_STARTED, &wlvif->flags)) {
                        /*
                         * We do not support removing keys after AP shutdown.
                         * Pretend we do to make mac80211 happy.
@@ -3426,7 +3426,7 @@ static void wl1271_bss_info_changed_ap(struct wl1271 *wl,
 
        if ((changed & BSS_CHANGED_BEACON_ENABLED)) {
                if (bss_conf->enable_beacon) {
-                       if (!test_bit(WL1271_FLAG_AP_STARTED, &wl->flags)) {
+                       if (!test_bit(WLVIF_FLAG_AP_STARTED, &wlvif->flags)) {
                                ret = wl12xx_cmd_role_start_ap(wl, wlvif);
                                if (ret < 0)
                                        goto out;
@@ -3435,16 +3435,16 @@ static void wl1271_bss_info_changed_ap(struct wl1271 *wl,
                                if (ret < 0)
                                        goto out;
 
-                               set_bit(WL1271_FLAG_AP_STARTED, &wl->flags);
+                               set_bit(WLVIF_FLAG_AP_STARTED, &wlvif->flags);
                                wl1271_debug(DEBUG_AP, "started AP");
                        }
                } else {
-                       if (test_bit(WL1271_FLAG_AP_STARTED, &wl->flags)) {
+                       if (test_bit(WLVIF_FLAG_AP_STARTED, &wlvif->flags)) {
                                ret = wl12xx_cmd_role_stop_ap(wl, wlvif);
                                if (ret < 0)
                                        goto out;
 
-                               clear_bit(WL1271_FLAG_AP_STARTED, &wl->flags);
+                               clear_bit(WLVIF_FLAG_AP_STARTED, &wlvif->flags);
                                wl1271_debug(DEBUG_AP, "stopped AP");
                        }
                }
index 8965fd1384dd4fa03ed1dd71604e49f0f65b7888..a60d8feb69e43922f9e465ecf51c237ff828d308 100644 (file)
@@ -168,7 +168,7 @@ u8 wl12xx_tx_get_hlid_ap(struct wl1271 *wl, struct wl12xx_vif *wlvif,
        } else {
                struct ieee80211_hdr *hdr;
 
-               if (!test_bit(WL1271_FLAG_AP_STARTED, &wl->flags))
+               if (!test_bit(WLVIF_FLAG_AP_STARTED, &wlvif->flags))
                        return wl->system_hlid;
 
                hdr = (struct ieee80211_hdr *)skb->data;
index 489c20555dffff762cc4f776827b5530441b6214..9b28e478930e2976a65ad6301eb4ad150c4bfd28 100644 (file)
@@ -325,7 +325,6 @@ enum wl12xx_flags {
        WL1271_FLAG_PSPOLL_FAILURE,
        WL1271_FLAG_STA_STATE_SENT,
        WL1271_FLAG_FW_TX_BUSY,
-       WL1271_FLAG_AP_STARTED,
        WL1271_FLAG_IF_INITIALIZED,
        WL1271_FLAG_DUMMY_PACKET_PENDING,
        WL1271_FLAG_SUSPENDED,
@@ -339,6 +338,7 @@ enum wl12xx_flags {
 enum wl12xx_vif_flags {
        WLVIF_FLAG_STA_ASSOCIATED,
        WLVIF_FLAG_IBSS_JOINED,
+       WLVIF_FLAG_AP_STARTED,
 };
 
 struct wl1271_link {