diff options
author | Eliad Peller <eliad@wizery.com> | 2011-10-05 05:56:03 -0400 |
---|---|---|
committer | Luciano Coelho <coelho@ti.com> | 2011-10-07 01:32:53 -0400 |
commit | 04324d99818d16da4f64e266b45cad2e5803b961 (patch) | |
tree | 00dc7ecd6bd37c050f0760fe417035823179687c /drivers/net | |
parent | 74ec839557878007c3f97d1bc89e09fde5d0f3fa (diff) |
wl12xx: move rssi_thold and last_rssi_event into wlvif
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>
Diffstat (limited to 'drivers/net')
-rw-r--r-- | drivers/net/wireless/wl12xx/acx.c | 2 | ||||
-rw-r--r-- | drivers/net/wireless/wl12xx/debugfs.c | 2 | ||||
-rw-r--r-- | drivers/net/wireless/wl12xx/event.c | 12 | ||||
-rw-r--r-- | drivers/net/wireless/wl12xx/main.c | 2 | ||||
-rw-r--r-- | drivers/net/wireless/wl12xx/wl12xx.h | 6 |
5 files changed, 12 insertions, 12 deletions
diff --git a/drivers/net/wireless/wl12xx/acx.c b/drivers/net/wireless/wl12xx/acx.c index 9b4eef61bd01..5b70cc19e1d4 100644 --- a/drivers/net/wireless/wl12xx/acx.c +++ b/drivers/net/wireless/wl12xx/acx.c | |||
@@ -1274,7 +1274,7 @@ int wl1271_acx_rssi_snr_trigger(struct wl1271 *wl, struct wl12xx_vif *wlvif, | |||
1274 | goto out; | 1274 | goto out; |
1275 | } | 1275 | } |
1276 | 1276 | ||
1277 | wl->last_rssi_event = -1; | 1277 | wlvif->last_rssi_event = -1; |
1278 | 1278 | ||
1279 | acx->role_id = wlvif->role_id; | 1279 | acx->role_id = wlvif->role_id; |
1280 | acx->pacing = cpu_to_le16(wl->conf.roam_trigger.trigger_pacing); | 1280 | acx->pacing = cpu_to_le16(wl->conf.roam_trigger.trigger_pacing); |
diff --git a/drivers/net/wireless/wl12xx/debugfs.c b/drivers/net/wireless/wl12xx/debugfs.c index cd390e0da51d..e53f96830c2f 100644 --- a/drivers/net/wireless/wl12xx/debugfs.c +++ b/drivers/net/wireless/wl12xx/debugfs.c | |||
@@ -352,8 +352,6 @@ static ssize_t driver_state_read(struct file *file, char __user *user_buf, | |||
352 | DRIVER_STATE_PRINT_INT(channel); | 352 | DRIVER_STATE_PRINT_INT(channel); |
353 | DRIVER_STATE_PRINT_INT(band); | 353 | DRIVER_STATE_PRINT_INT(band); |
354 | DRIVER_STATE_PRINT_INT(power_level); | 354 | DRIVER_STATE_PRINT_INT(power_level); |
355 | DRIVER_STATE_PRINT_INT(rssi_thold); | ||
356 | DRIVER_STATE_PRINT_INT(last_rssi_event); | ||
357 | DRIVER_STATE_PRINT_INT(sg_enabled); | 355 | DRIVER_STATE_PRINT_INT(sg_enabled); |
358 | DRIVER_STATE_PRINT_INT(enable_11a); | 356 | DRIVER_STATE_PRINT_INT(enable_11a); |
359 | DRIVER_STATE_PRINT_INT(noise); | 357 | DRIVER_STATE_PRINT_INT(noise); |
diff --git a/drivers/net/wireless/wl12xx/event.c b/drivers/net/wireless/wl12xx/event.c index 6c48b8c3f5bb..775ad952ac8f 100644 --- a/drivers/net/wireless/wl12xx/event.c +++ b/drivers/net/wireless/wl12xx/event.c | |||
@@ -162,21 +162,23 @@ static int wl1271_event_ps_report(struct wl1271 *wl, | |||
162 | } | 162 | } |
163 | 163 | ||
164 | static void wl1271_event_rssi_trigger(struct wl1271 *wl, | 164 | static void wl1271_event_rssi_trigger(struct wl1271 *wl, |
165 | struct ieee80211_vif *vif, | ||
165 | struct event_mailbox *mbox) | 166 | struct event_mailbox *mbox) |
166 | { | 167 | { |
168 | struct wl12xx_vif *wlvif = wl12xx_vif_to_data(vif); | ||
167 | enum nl80211_cqm_rssi_threshold_event event; | 169 | enum nl80211_cqm_rssi_threshold_event event; |
168 | s8 metric = mbox->rssi_snr_trigger_metric[0]; | 170 | s8 metric = mbox->rssi_snr_trigger_metric[0]; |
169 | 171 | ||
170 | wl1271_debug(DEBUG_EVENT, "RSSI trigger metric: %d", metric); | 172 | wl1271_debug(DEBUG_EVENT, "RSSI trigger metric: %d", metric); |
171 | 173 | ||
172 | if (metric <= wl->rssi_thold) | 174 | if (metric <= wlvif->rssi_thold) |
173 | event = NL80211_CQM_RSSI_THRESHOLD_EVENT_LOW; | 175 | event = NL80211_CQM_RSSI_THRESHOLD_EVENT_LOW; |
174 | else | 176 | else |
175 | event = NL80211_CQM_RSSI_THRESHOLD_EVENT_HIGH; | 177 | event = NL80211_CQM_RSSI_THRESHOLD_EVENT_HIGH; |
176 | 178 | ||
177 | if (event != wl->last_rssi_event) | 179 | if (event != wlvif->last_rssi_event) |
178 | ieee80211_cqm_rssi_notify(wl->vif, event, GFP_KERNEL); | 180 | ieee80211_cqm_rssi_notify(vif, event, GFP_KERNEL); |
179 | wl->last_rssi_event = event; | 181 | wlvif->last_rssi_event = event; |
180 | } | 182 | } |
181 | 183 | ||
182 | static void wl1271_stop_ba_event(struct wl1271 *wl, struct wl12xx_vif *wlvif) | 184 | 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) | |||
297 | if (vector & RSSI_SNR_TRIGGER_0_EVENT_ID) { | 299 | if (vector & RSSI_SNR_TRIGGER_0_EVENT_ID) { |
298 | wl1271_debug(DEBUG_EVENT, "RSSI_SNR_TRIGGER_0_EVENT"); | 300 | wl1271_debug(DEBUG_EVENT, "RSSI_SNR_TRIGGER_0_EVENT"); |
299 | if (wl->vif) | 301 | if (wl->vif) |
300 | wl1271_event_rssi_trigger(wl, mbox); | 302 | wl1271_event_rssi_trigger(wl, vif, mbox); |
301 | } | 303 | } |
302 | 304 | ||
303 | if ((vector & BA_SESSION_RX_CONSTRAINT_EVENT_ID)) { | 305 | if ((vector & BA_SESSION_RX_CONSTRAINT_EVENT_ID)) { |
diff --git a/drivers/net/wireless/wl12xx/main.c b/drivers/net/wireless/wl12xx/main.c index fd2b9f21acff..72ab25657dab 100644 --- a/drivers/net/wireless/wl12xx/main.c +++ b/drivers/net/wireless/wl12xx/main.c | |||
@@ -3497,7 +3497,7 @@ static void wl1271_bss_info_changed_sta(struct wl1271 *wl, | |||
3497 | bss_conf->cqm_rssi_hyst); | 3497 | bss_conf->cqm_rssi_hyst); |
3498 | if (ret < 0) | 3498 | if (ret < 0) |
3499 | goto out; | 3499 | goto out; |
3500 | wl->rssi_thold = bss_conf->cqm_rssi_thold; | 3500 | wlvif->rssi_thold = bss_conf->cqm_rssi_thold; |
3501 | } | 3501 | } |
3502 | 3502 | ||
3503 | if (changed & BSS_CHANGED_BSSID) | 3503 | if (changed & BSS_CHANGED_BSSID) |
diff --git a/drivers/net/wireless/wl12xx/wl12xx.h b/drivers/net/wireless/wl12xx/wl12xx.h index 9d9d3fbd14e5..5a82450d8c70 100644 --- a/drivers/net/wireless/wl12xx/wl12xx.h +++ b/drivers/net/wireless/wl12xx/wl12xx.h | |||
@@ -514,9 +514,6 @@ struct wl1271 { | |||
514 | /* in dBm */ | 514 | /* in dBm */ |
515 | int power_level; | 515 | int power_level; |
516 | 516 | ||
517 | int rssi_thold; | ||
518 | int last_rssi_event; | ||
519 | |||
520 | struct wl1271_stats stats; | 517 | struct wl1271_stats stats; |
521 | 518 | ||
522 | __le32 buffer_32; | 519 | __le32 buffer_32; |
@@ -652,6 +649,9 @@ struct wl12xx_vif { | |||
652 | 649 | ||
653 | /* retry counter for PSM entries */ | 650 | /* retry counter for PSM entries */ |
654 | u8 psm_entry_retry; | 651 | u8 psm_entry_retry; |
652 | |||
653 | int rssi_thold; | ||
654 | int last_rssi_event; | ||
655 | }; | 655 | }; |
656 | 656 | ||
657 | static inline struct wl12xx_vif *wl12xx_vif_to_data(struct ieee80211_vif *vif) | 657 | static inline struct wl12xx_vif *wl12xx_vif_to_data(struct ieee80211_vif *vif) |