wl12xx: move rssi_thold and last_rssi_event into wlvif
authorEliad Peller <eliad@wizery.com>
Wed, 5 Oct 2011 09:56:03 +0000 (11:56 +0200)
committerLuciano Coelho <coelho@ti.com>
Fri, 7 Oct 2011 05:32:53 +0000 (08:32 +0300)
move rssi_thold and last_rssi_event into the per-interface
data, rather than being global.

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

index 9b4eef61bd010b52441ed0db5ccbb6c3c9bddcd5..5b70cc19e1d4ea105c1e25f9b3420d0b1f89d2dd 100644 (file)
@@ -1274,7 +1274,7 @@ int wl1271_acx_rssi_snr_trigger(struct wl1271 *wl, struct wl12xx_vif *wlvif,
                goto out;
        }
 
-       wl->last_rssi_event = -1;
+       wlvif->last_rssi_event = -1;
 
        acx->role_id = wlvif->role_id;
        acx->pacing = cpu_to_le16(wl->conf.roam_trigger.trigger_pacing);
index cd390e0da51dbc009e223cbb54066bf8670ae2a9..e53f96830c2f2214cee5148a73c673d49b214ee7 100644 (file)
@@ -352,8 +352,6 @@ static ssize_t driver_state_read(struct file *file, char __user *user_buf,
        DRIVER_STATE_PRINT_INT(channel);
        DRIVER_STATE_PRINT_INT(band);
        DRIVER_STATE_PRINT_INT(power_level);
-       DRIVER_STATE_PRINT_INT(rssi_thold);
-       DRIVER_STATE_PRINT_INT(last_rssi_event);
        DRIVER_STATE_PRINT_INT(sg_enabled);
        DRIVER_STATE_PRINT_INT(enable_11a);
        DRIVER_STATE_PRINT_INT(noise);
index 6c48b8c3f5bbb1999c2fa6c57c26f7944be36863..775ad952ac8fe297529f5d62976d2b4af439856e 100644 (file)
@@ -162,21 +162,23 @@ static int wl1271_event_ps_report(struct wl1271 *wl,
 }
 
 static void wl1271_event_rssi_trigger(struct wl1271 *wl,
+                                     struct ieee80211_vif *vif,
                                      struct event_mailbox *mbox)
 {
+       struct wl12xx_vif *wlvif = wl12xx_vif_to_data(vif);
        enum nl80211_cqm_rssi_threshold_event event;
        s8 metric = mbox->rssi_snr_trigger_metric[0];
 
        wl1271_debug(DEBUG_EVENT, "RSSI trigger metric: %d", metric);
 
-       if (metric <= wl->rssi_thold)
+       if (metric <= wlvif->rssi_thold)
                event = NL80211_CQM_RSSI_THRESHOLD_EVENT_LOW;
        else
                event = NL80211_CQM_RSSI_THRESHOLD_EVENT_HIGH;
 
-       if (event != wl->last_rssi_event)
-               ieee80211_cqm_rssi_notify(wl->vif, event, GFP_KERNEL);
-       wl->last_rssi_event = event;
+       if (event != wlvif->last_rssi_event)
+               ieee80211_cqm_rssi_notify(vif, event, GFP_KERNEL);
+       wlvif->last_rssi_event = event;
 }
 
 static void wl1271_stop_ba_event(struct wl1271 *wl, struct wl12xx_vif *wlvif)
@@ -297,7 +299,7 @@ static int wl1271_event_process(struct wl1271 *wl, struct event_mailbox *mbox)
        if (vector & RSSI_SNR_TRIGGER_0_EVENT_ID) {
                wl1271_debug(DEBUG_EVENT, "RSSI_SNR_TRIGGER_0_EVENT");
                if (wl->vif)
-                       wl1271_event_rssi_trigger(wl, mbox);
+                       wl1271_event_rssi_trigger(wl, vif, mbox);
        }
 
        if ((vector & BA_SESSION_RX_CONSTRAINT_EVENT_ID)) {
index fd2b9f21acff0c83c0d75825f08b3bb0ec0fb0d6..72ab25657dab900559cc6f8ae490b382a8e92719 100644 (file)
@@ -3497,7 +3497,7 @@ static void wl1271_bss_info_changed_sta(struct wl1271 *wl,
                                                  bss_conf->cqm_rssi_hyst);
                if (ret < 0)
                        goto out;
-               wl->rssi_thold = bss_conf->cqm_rssi_thold;
+               wlvif->rssi_thold = bss_conf->cqm_rssi_thold;
        }
 
        if (changed & BSS_CHANGED_BSSID)
index 9d9d3fbd14e54b7933ce1f7b4b555dcd77b636fd..5a82450d8c70270fafcc2c4ab57f8fa93d71cf65 100644 (file)
@@ -514,9 +514,6 @@ struct wl1271 {
        /* in dBm */
        int power_level;
 
-       int rssi_thold;
-       int last_rssi_event;
-
        struct wl1271_stats stats;
 
        __le32 buffer_32;
@@ -652,6 +649,9 @@ struct wl12xx_vif {
 
        /* retry counter for PSM entries */
        u8 psm_entry_retry;
+
+       int rssi_thold;
+       int last_rssi_event;
 };
 
 static inline struct wl12xx_vif *wl12xx_vif_to_data(struct ieee80211_vif *vif)