提交 b771eee5 编写于 作者: J Juuso Oikarinen 提交者: John W. Linville

wl1271: Enable beacon filtering with the stack

Enable beacon filtering with the mac80211 stack.
Signed-off-by: NJuuso Oikarinen <juuso.oikarinen@nokia.com>
Reviewed-by: NLuciano Coelho <luciano.coelho@nokia.com>
Signed-off-by: NLuciano Coelho <luciano.coelho@nokia.com>
Signed-off-by: NJohn W. Linville <linville@tuxdriver.com>
上级 34415236
...@@ -420,6 +420,8 @@ struct wl1271 { ...@@ -420,6 +420,8 @@ struct wl1271 {
struct wl1271_fw_status *fw_status; struct wl1271_fw_status *fw_status;
struct wl1271_tx_hw_res_if *tx_res_if; struct wl1271_tx_hw_res_if *tx_res_if;
struct ieee80211_vif *vif;
}; };
int wl1271_plt_start(struct wl1271 *wl); int wl1271_plt_start(struct wl1271 *wl);
......
...@@ -70,14 +70,16 @@ static int wl1271_event_process(struct wl1271 *wl, struct event_mailbox *mbox) ...@@ -70,14 +70,16 @@ static int wl1271_event_process(struct wl1271 *wl, struct event_mailbox *mbox)
return ret; return ret;
} }
if (vector & BSS_LOSE_EVENT_ID) { /*
* The BSS_LOSE_EVENT_ID is only needed while psm (and hence beacon
* filtering) is enabled. Without PSM, the stack will receive all
* beacons and can detect beacon loss by itself.
*/
if (vector & BSS_LOSE_EVENT_ID && wl->psm) {
wl1271_debug(DEBUG_EVENT, "BSS_LOSE_EVENT"); wl1271_debug(DEBUG_EVENT, "BSS_LOSE_EVENT");
if (wl->psm_requested && wl->psm) { /* indicate to the stack, that beacons have been lost */
ret = wl1271_ps_set_mode(wl, STATION_ACTIVE_MODE); ieee80211_beacon_loss(wl->vif);
if (ret < 0)
return ret;
}
} }
return 0; return 0;
......
...@@ -665,6 +665,12 @@ static int wl1271_op_add_interface(struct ieee80211_hw *hw, ...@@ -665,6 +665,12 @@ static int wl1271_op_add_interface(struct ieee80211_hw *hw,
conf->type, conf->mac_addr); conf->type, conf->mac_addr);
mutex_lock(&wl->mutex); mutex_lock(&wl->mutex);
if (wl->vif) {
ret = -EBUSY;
goto out;
}
wl->vif = conf->vif;
switch (conf->type) { switch (conf->type) {
case NL80211_IFTYPE_STATION: case NL80211_IFTYPE_STATION:
...@@ -688,7 +694,12 @@ static int wl1271_op_add_interface(struct ieee80211_hw *hw, ...@@ -688,7 +694,12 @@ static int wl1271_op_add_interface(struct ieee80211_hw *hw,
static void wl1271_op_remove_interface(struct ieee80211_hw *hw, static void wl1271_op_remove_interface(struct ieee80211_hw *hw,
struct ieee80211_if_init_conf *conf) struct ieee80211_if_init_conf *conf)
{ {
struct wl1271 *wl = hw->priv;
mutex_lock(&wl->mutex);
wl1271_debug(DEBUG_MAC80211, "mac80211 remove interface"); wl1271_debug(DEBUG_MAC80211, "mac80211 remove interface");
wl->vif = NULL;
mutex_unlock(&wl->mutex);
} }
#if 0 #if 0
...@@ -1382,6 +1393,7 @@ static int __devinit wl1271_probe(struct spi_device *spi) ...@@ -1382,6 +1393,7 @@ static int __devinit wl1271_probe(struct spi_device *spi)
wl->dtim_period = WL1271_DEFAULT_DTIM_PERIOD; wl->dtim_period = WL1271_DEFAULT_DTIM_PERIOD;
wl->basic_rate_set = WL1271_DEFAULT_BASIC_RATE_SET; wl->basic_rate_set = WL1271_DEFAULT_BASIC_RATE_SET;
wl->band = IEEE80211_BAND_2GHZ; wl->band = IEEE80211_BAND_2GHZ;
wl->vif = NULL;
for (i = 0; i < ACX_TX_DESCRIPTORS; i++) for (i = 0; i < ACX_TX_DESCRIPTORS; i++)
wl->tx_frames[i] = NULL; wl->tx_frames[i] = NULL;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册