From d7ea2583667c717d121ce3d197a3887ecc92adb3 Mon Sep 17 00:00:00 2001 From: Juuso Oikarinen Date: Thu, 8 Oct 2009 21:56:34 +0300 Subject: [PATCH] --- yaml --- r: 170919 b: refs/heads/master c: b771eee583343782c8b44d2b78cf53c29d0f3303 h: refs/heads/master i: 170917: 268caa1bdfaef40866f88b982a08d25582c017cd 170915: 2cffc9d347df3962ec3d416ad68680b058e1f4fc 170911: 3653ad8a623e53d13d26e05fece11b1b7287a436 v: v3 --- [refs] | 2 +- trunk/drivers/net/wireless/wl12xx/wl1271.h | 2 ++ trunk/drivers/net/wireless/wl12xx/wl1271_event.c | 14 ++++++++------ trunk/drivers/net/wireless/wl12xx/wl1271_main.c | 12 ++++++++++++ 4 files changed, 23 insertions(+), 7 deletions(-) diff --git a/[refs] b/[refs] index 33af8fbe67ed..8f5227013e58 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 344152361e6d14ade61d7f43678db7418cb445db +refs/heads/master: b771eee583343782c8b44d2b78cf53c29d0f3303 diff --git a/trunk/drivers/net/wireless/wl12xx/wl1271.h b/trunk/drivers/net/wireless/wl12xx/wl1271.h index 34a52b33bf5d..96a581316941 100644 --- a/trunk/drivers/net/wireless/wl12xx/wl1271.h +++ b/trunk/drivers/net/wireless/wl12xx/wl1271.h @@ -420,6 +420,8 @@ struct wl1271 { struct wl1271_fw_status *fw_status; struct wl1271_tx_hw_res_if *tx_res_if; + + struct ieee80211_vif *vif; }; int wl1271_plt_start(struct wl1271 *wl); diff --git a/trunk/drivers/net/wireless/wl12xx/wl1271_event.c b/trunk/drivers/net/wireless/wl12xx/wl1271_event.c index 87055f7996bc..f32927650af4 100644 --- a/trunk/drivers/net/wireless/wl12xx/wl1271_event.c +++ b/trunk/drivers/net/wireless/wl12xx/wl1271_event.c @@ -70,14 +70,16 @@ static int wl1271_event_process(struct wl1271 *wl, struct event_mailbox *mbox) 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"); - if (wl->psm_requested && wl->psm) { - ret = wl1271_ps_set_mode(wl, STATION_ACTIVE_MODE); - if (ret < 0) - return ret; - } + /* indicate to the stack, that beacons have been lost */ + ieee80211_beacon_loss(wl->vif); } return 0; diff --git a/trunk/drivers/net/wireless/wl12xx/wl1271_main.c b/trunk/drivers/net/wireless/wl12xx/wl1271_main.c index d22de23f0bce..e6f9e9b57037 100644 --- a/trunk/drivers/net/wireless/wl12xx/wl1271_main.c +++ b/trunk/drivers/net/wireless/wl12xx/wl1271_main.c @@ -665,6 +665,12 @@ static int wl1271_op_add_interface(struct ieee80211_hw *hw, conf->type, conf->mac_addr); mutex_lock(&wl->mutex); + if (wl->vif) { + ret = -EBUSY; + goto out; + } + + wl->vif = conf->vif; switch (conf->type) { case NL80211_IFTYPE_STATION: @@ -688,7 +694,12 @@ static int wl1271_op_add_interface(struct ieee80211_hw *hw, static void wl1271_op_remove_interface(struct ieee80211_hw *hw, struct ieee80211_if_init_conf *conf) { + struct wl1271 *wl = hw->priv; + + mutex_lock(&wl->mutex); wl1271_debug(DEBUG_MAC80211, "mac80211 remove interface"); + wl->vif = NULL; + mutex_unlock(&wl->mutex); } #if 0 @@ -1382,6 +1393,7 @@ static int __devinit wl1271_probe(struct spi_device *spi) wl->dtim_period = WL1271_DEFAULT_DTIM_PERIOD; wl->basic_rate_set = WL1271_DEFAULT_BASIC_RATE_SET; wl->band = IEEE80211_BAND_2GHZ; + wl->vif = NULL; for (i = 0; i < ACX_TX_DESCRIPTORS; i++) wl->tx_frames[i] = NULL;