wl1251: Enable beacon filtering with the stack
authorJuuso Oikarinen <juuso.oikarinen@nokia.com>
Tue, 17 Nov 2009 16:48:23 +0000 (18:48 +0200)
committerJohn W. Linville <linville@tuxdriver.com>
Wed, 18 Nov 2009 22:09:19 +0000 (17:09 -0500)
Enable beacon filtering with the mac80211 stack.

Signed-off-by: Juuso Oikarinen <juuso.oikarinen@nokia.com>
Signed-off-by: Kalle Valo <kalle.valo@nokia.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
drivers/net/wireless/wl12xx/wl1251.h
drivers/net/wireless/wl12xx/wl1251_event.c
drivers/net/wireless/wl12xx/wl1251_main.c

index 998e4b6252bd4bbbe088c9770d8e032d7af75f48..fc2871c5a25b03c90961922d1b35ddcb7c728320 100644 (file)
@@ -374,6 +374,8 @@ struct wl1251 {
        u8 buffer_busyword[WL1251_BUSY_WORD_LEN];
        struct wl1251_rx_descriptor *rx_descriptor;
 
+       struct ieee80211_vif *vif;
+
        u32 chip_id;
        char fw_ver[21];
 };
index 00076c4a8a21debeb99c925dff82056990ba823d..18c301ddcd7467e25d46c83a5c7ade3b472f037a 100644 (file)
@@ -79,6 +79,13 @@ static int wl1251_event_process(struct wl1251 *wl, struct event_mailbox *mbox)
                }
        }
 
+       if (vector & SYNCHRONIZATION_TIMEOUT_EVENT_ID && wl->psm) {
+               wl1251_debug(DEBUG_EVENT, "SYNCHRONIZATION_TIMEOUT_EVENT");
+
+               /* indicate to the stack, that beacons have been lost */
+               ieee80211_beacon_loss(wl->vif);
+       }
+
        return 0;
 }
 
index d03a07e1be7c768f4db452bf6f2f863a6dd098d8..601c430702965ae5fbb9344753e8c3930161f0f9 100644 (file)
@@ -509,6 +509,12 @@ static int wl1251_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:
@@ -538,7 +544,12 @@ out:
 static void wl1251_op_remove_interface(struct ieee80211_hw *hw,
                                         struct ieee80211_if_init_conf *conf)
 {
+       struct wl1251 *wl = hw->priv;
+
+       mutex_lock(&wl->mutex);
        wl1251_debug(DEBUG_MAC80211, "mac80211 remove interface");
+       wl->vif = NULL;
+       mutex_unlock(&wl->mutex);
 }
 
 static int wl1251_build_null_data(struct wl1251 *wl)
@@ -1372,6 +1383,7 @@ struct ieee80211_hw *wl1251_alloc_hw(void)
        wl->power_level = WL1251_DEFAULT_POWER_LEVEL;
        wl->beacon_int = WL1251_DEFAULT_BEACON_INT;
        wl->dtim_period = WL1251_DEFAULT_DTIM_PERIOD;
+       wl->vif = NULL;
 
        for (i = 0; i < FW_TX_CMPLT_BLOCK_SIZE; i++)
                wl->tx_frames[i] = NULL;