Skip to content

Commit

Permalink
wl12xx: move rssi_thold and last_rssi_event into wlvif
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Eliad Peller authored and Luciano Coelho committed Oct 7, 2011
1 parent 74ec839 commit 04324d9
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 12 deletions.
2 changes: 1 addition & 1 deletion drivers/net/wireless/wl12xx/acx.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
2 changes: 0 additions & 2 deletions drivers/net/wireless/wl12xx/debugfs.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
12 changes: 7 additions & 5 deletions drivers/net/wireless/wl12xx/event.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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)) {
Expand Down
2 changes: 1 addition & 1 deletion drivers/net/wireless/wl12xx/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
6 changes: 3 additions & 3 deletions drivers/net/wireless/wl12xx/wl12xx.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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)
Expand Down

0 comments on commit 04324d9

Please sign in to comment.