提交 04324d99 编写于 作者: E Eliad Peller 提交者: Luciano Coelho

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: NEliad Peller <eliad@wizery.com>
Signed-off-by: NLuciano Coelho <coelho@ti.com>
上级 74ec8395
......@@ -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);
......
......@@ -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);
......
......@@ -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)) {
......
......@@ -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)
......
......@@ -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)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册