diff options
| author | Juuso Oikarinen <juuso.oikarinen@nokia.com> | 2009-10-08 14:56:34 -0400 |
|---|---|---|
| committer | John W. Linville <linville@tuxdriver.com> | 2009-10-27 16:47:54 -0400 |
| commit | b771eee583343782c8b44d2b78cf53c29d0f3303 (patch) | |
| tree | 46f851a5ebe61d838bb38153f5926deffc69f59f | |
| parent | 344152361e6d14ade61d7f43678db7418cb445db (diff) | |
wl1271: Enable beacon filtering with the stack
Enable beacon filtering with the mac80211 stack.
Signed-off-by: Juuso Oikarinen <juuso.oikarinen@nokia.com>
Reviewed-by: Luciano Coelho <luciano.coelho@nokia.com>
Signed-off-by: Luciano Coelho <luciano.coelho@nokia.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
| -rw-r--r-- | drivers/net/wireless/wl12xx/wl1271.h | 2 | ||||
| -rw-r--r-- | drivers/net/wireless/wl12xx/wl1271_event.c | 14 | ||||
| -rw-r--r-- | drivers/net/wireless/wl12xx/wl1271_main.c | 12 |
3 files changed, 22 insertions, 6 deletions
diff --git a/drivers/net/wireless/wl12xx/wl1271.h b/drivers/net/wireless/wl12xx/wl1271.h index 34a52b33bf5d..96a581316941 100644 --- a/drivers/net/wireless/wl12xx/wl1271.h +++ b/drivers/net/wireless/wl12xx/wl1271.h | |||
| @@ -420,6 +420,8 @@ struct wl1271 { | |||
| 420 | 420 | ||
| 421 | struct wl1271_fw_status *fw_status; | 421 | struct wl1271_fw_status *fw_status; |
| 422 | struct wl1271_tx_hw_res_if *tx_res_if; | 422 | struct wl1271_tx_hw_res_if *tx_res_if; |
| 423 | |||
| 424 | struct ieee80211_vif *vif; | ||
| 423 | }; | 425 | }; |
| 424 | 426 | ||
| 425 | int wl1271_plt_start(struct wl1271 *wl); | 427 | int wl1271_plt_start(struct wl1271 *wl); |
diff --git a/drivers/net/wireless/wl12xx/wl1271_event.c b/drivers/net/wireless/wl12xx/wl1271_event.c index 87055f7996bc..f32927650af4 100644 --- a/drivers/net/wireless/wl12xx/wl1271_event.c +++ b/drivers/net/wireless/wl12xx/wl1271_event.c | |||
| @@ -70,14 +70,16 @@ static int wl1271_event_process(struct wl1271 *wl, struct event_mailbox *mbox) | |||
| 70 | return ret; | 70 | return ret; |
| 71 | } | 71 | } |
| 72 | 72 | ||
| 73 | if (vector & BSS_LOSE_EVENT_ID) { | 73 | /* |
| 74 | * The BSS_LOSE_EVENT_ID is only needed while psm (and hence beacon | ||
| 75 | * filtering) is enabled. Without PSM, the stack will receive all | ||
| 76 | * beacons and can detect beacon loss by itself. | ||
| 77 | */ | ||
| 78 | if (vector & BSS_LOSE_EVENT_ID && wl->psm) { | ||
| 74 | wl1271_debug(DEBUG_EVENT, "BSS_LOSE_EVENT"); | 79 | wl1271_debug(DEBUG_EVENT, "BSS_LOSE_EVENT"); |
| 75 | 80 | ||
| 76 | if (wl->psm_requested && wl->psm) { | 81 | /* indicate to the stack, that beacons have been lost */ |
| 77 | ret = wl1271_ps_set_mode(wl, STATION_ACTIVE_MODE); | 82 | ieee80211_beacon_loss(wl->vif); |
| 78 | if (ret < 0) | ||
| 79 | return ret; | ||
| 80 | } | ||
| 81 | } | 83 | } |
| 82 | 84 | ||
| 83 | return 0; | 85 | return 0; |
diff --git a/drivers/net/wireless/wl12xx/wl1271_main.c b/drivers/net/wireless/wl12xx/wl1271_main.c index d22de23f0bce..e6f9e9b57037 100644 --- a/drivers/net/wireless/wl12xx/wl1271_main.c +++ b/drivers/net/wireless/wl12xx/wl1271_main.c | |||
| @@ -665,6 +665,12 @@ static int wl1271_op_add_interface(struct ieee80211_hw *hw, | |||
| 665 | conf->type, conf->mac_addr); | 665 | conf->type, conf->mac_addr); |
| 666 | 666 | ||
| 667 | mutex_lock(&wl->mutex); | 667 | mutex_lock(&wl->mutex); |
| 668 | if (wl->vif) { | ||
| 669 | ret = -EBUSY; | ||
| 670 | goto out; | ||
| 671 | } | ||
| 672 | |||
| 673 | wl->vif = conf->vif; | ||
| 668 | 674 | ||
| 669 | switch (conf->type) { | 675 | switch (conf->type) { |
| 670 | case NL80211_IFTYPE_STATION: | 676 | case NL80211_IFTYPE_STATION: |
| @@ -688,7 +694,12 @@ out: | |||
| 688 | static void wl1271_op_remove_interface(struct ieee80211_hw *hw, | 694 | static void wl1271_op_remove_interface(struct ieee80211_hw *hw, |
| 689 | struct ieee80211_if_init_conf *conf) | 695 | struct ieee80211_if_init_conf *conf) |
| 690 | { | 696 | { |
| 697 | struct wl1271 *wl = hw->priv; | ||
| 698 | |||
| 699 | mutex_lock(&wl->mutex); | ||
| 691 | wl1271_debug(DEBUG_MAC80211, "mac80211 remove interface"); | 700 | wl1271_debug(DEBUG_MAC80211, "mac80211 remove interface"); |
| 701 | wl->vif = NULL; | ||
| 702 | mutex_unlock(&wl->mutex); | ||
| 692 | } | 703 | } |
| 693 | 704 | ||
| 694 | #if 0 | 705 | #if 0 |
| @@ -1382,6 +1393,7 @@ static int __devinit wl1271_probe(struct spi_device *spi) | |||
| 1382 | wl->dtim_period = WL1271_DEFAULT_DTIM_PERIOD; | 1393 | wl->dtim_period = WL1271_DEFAULT_DTIM_PERIOD; |
| 1383 | wl->basic_rate_set = WL1271_DEFAULT_BASIC_RATE_SET; | 1394 | wl->basic_rate_set = WL1271_DEFAULT_BASIC_RATE_SET; |
| 1384 | wl->band = IEEE80211_BAND_2GHZ; | 1395 | wl->band = IEEE80211_BAND_2GHZ; |
| 1396 | wl->vif = NULL; | ||
| 1385 | 1397 | ||
| 1386 | for (i = 0; i < ACX_TX_DESCRIPTORS; i++) | 1398 | for (i = 0; i < ACX_TX_DESCRIPTORS; i++) |
| 1387 | wl->tx_frames[i] = NULL; | 1399 | wl->tx_frames[i] = NULL; |
