diff options
-rw-r--r-- | drivers/net/wireless/iwlwifi/iwl-4965.c | 24 | ||||
-rw-r--r-- | drivers/net/wireless/iwlwifi/iwl-agn.c | 16 | ||||
-rw-r--r-- | drivers/net/wireless/iwlwifi/iwl-commands.h | 7 |
3 files changed, 39 insertions, 8 deletions
diff --git a/drivers/net/wireless/iwlwifi/iwl-4965.c b/drivers/net/wireless/iwlwifi/iwl-4965.c index ace0b98d91ae..8998ed134d1a 100644 --- a/drivers/net/wireless/iwlwifi/iwl-4965.c +++ b/drivers/net/wireless/iwlwifi/iwl-4965.c | |||
@@ -2266,6 +2266,29 @@ static void iwl4965_rx_reply_tx(struct iwl_priv *priv, | |||
2266 | spin_unlock_irqrestore(&priv->sta_lock, flags); | 2266 | spin_unlock_irqrestore(&priv->sta_lock, flags); |
2267 | } | 2267 | } |
2268 | 2268 | ||
2269 | static void iwl4965_rx_beacon_notif(struct iwl_priv *priv, | ||
2270 | struct iwl_rx_mem_buffer *rxb) | ||
2271 | { | ||
2272 | struct iwl_rx_packet *pkt = rxb_addr(rxb); | ||
2273 | struct iwl4965_beacon_notif *beacon = (void *)pkt->u.raw; | ||
2274 | #ifdef CONFIG_IWLWIFI_DEBUG | ||
2275 | u8 rate = iwl_hw_get_rate(beacon->beacon_notify_hdr.rate_n_flags); | ||
2276 | |||
2277 | IWL_DEBUG_RX(priv, "beacon status %#x, retries:%d ibssmgr:%d " | ||
2278 | "tsf:0x%.8x%.8x rate:%d\n", | ||
2279 | le32_to_cpu(beacon->beacon_notify_hdr.u.status) & TX_STATUS_MSK, | ||
2280 | beacon->beacon_notify_hdr.failure_frame, | ||
2281 | le32_to_cpu(beacon->ibss_mgr_status), | ||
2282 | le32_to_cpu(beacon->high_tsf), | ||
2283 | le32_to_cpu(beacon->low_tsf), rate); | ||
2284 | #endif | ||
2285 | |||
2286 | priv->ibss_manager = le32_to_cpu(beacon->ibss_mgr_status); | ||
2287 | |||
2288 | if (!test_bit(STATUS_EXIT_PENDING, &priv->status)) | ||
2289 | queue_work(priv->workqueue, &priv->beacon_update); | ||
2290 | } | ||
2291 | |||
2269 | static int iwl4965_calc_rssi(struct iwl_priv *priv, | 2292 | static int iwl4965_calc_rssi(struct iwl_priv *priv, |
2270 | struct iwl_rx_phy_res *rx_resp) | 2293 | struct iwl_rx_phy_res *rx_resp) |
2271 | { | 2294 | { |
@@ -2308,6 +2331,7 @@ static void iwl4965_rx_handler_setup(struct iwl_priv *priv) | |||
2308 | priv->rx_handlers[REPLY_RX] = iwlagn_rx_reply_rx; | 2331 | priv->rx_handlers[REPLY_RX] = iwlagn_rx_reply_rx; |
2309 | /* Tx response */ | 2332 | /* Tx response */ |
2310 | priv->rx_handlers[REPLY_TX] = iwl4965_rx_reply_tx; | 2333 | priv->rx_handlers[REPLY_TX] = iwl4965_rx_reply_tx; |
2334 | priv->rx_handlers[BEACON_NOTIFICATION] = iwl4965_rx_beacon_notif; | ||
2311 | 2335 | ||
2312 | /* set up notification wait support */ | 2336 | /* set up notification wait support */ |
2313 | spin_lock_init(&priv->_agn.notif_wait_lock); | 2337 | spin_lock_init(&priv->_agn.notif_wait_lock); |
diff --git a/drivers/net/wireless/iwlwifi/iwl-agn.c b/drivers/net/wireless/iwlwifi/iwl-agn.c index cf285f53ad1d..d62e59249667 100644 --- a/drivers/net/wireless/iwlwifi/iwl-agn.c +++ b/drivers/net/wireless/iwlwifi/iwl-agn.c | |||
@@ -704,18 +704,18 @@ static void iwl_bg_ucode_trace(unsigned long data) | |||
704 | } | 704 | } |
705 | } | 705 | } |
706 | 706 | ||
707 | static void iwl_rx_beacon_notif(struct iwl_priv *priv, | 707 | static void iwlagn_rx_beacon_notif(struct iwl_priv *priv, |
708 | struct iwl_rx_mem_buffer *rxb) | 708 | struct iwl_rx_mem_buffer *rxb) |
709 | { | 709 | { |
710 | struct iwl_rx_packet *pkt = rxb_addr(rxb); | 710 | struct iwl_rx_packet *pkt = rxb_addr(rxb); |
711 | struct iwl4965_beacon_notif *beacon = | 711 | struct iwlagn_beacon_notif *beacon = (void *)pkt->u.raw; |
712 | (struct iwl4965_beacon_notif *)pkt->u.raw; | ||
713 | #ifdef CONFIG_IWLWIFI_DEBUG | 712 | #ifdef CONFIG_IWLWIFI_DEBUG |
713 | u16 status = le16_to_cpu(beacon->beacon_notify_hdr.status.status); | ||
714 | u8 rate = iwl_hw_get_rate(beacon->beacon_notify_hdr.rate_n_flags); | 714 | u8 rate = iwl_hw_get_rate(beacon->beacon_notify_hdr.rate_n_flags); |
715 | 715 | ||
716 | IWL_DEBUG_RX(priv, "beacon status %x retries %d iss %d " | 716 | IWL_DEBUG_RX(priv, "beacon status %#x, retries:%d ibssmgr:%d " |
717 | "tsf %d %d rate %d\n", | 717 | "tsf:0x%.8x%.8x rate:%d\n", |
718 | le32_to_cpu(beacon->beacon_notify_hdr.u.status) & TX_STATUS_MSK, | 718 | status & TX_STATUS_MSK, |
719 | beacon->beacon_notify_hdr.failure_frame, | 719 | beacon->beacon_notify_hdr.failure_frame, |
720 | le32_to_cpu(beacon->ibss_mgr_status), | 720 | le32_to_cpu(beacon->ibss_mgr_status), |
721 | le32_to_cpu(beacon->high_tsf), | 721 | le32_to_cpu(beacon->high_tsf), |
@@ -818,7 +818,7 @@ static void iwl_setup_rx_handlers(struct iwl_priv *priv) | |||
818 | priv->rx_handlers[PM_SLEEP_NOTIFICATION] = iwl_rx_pm_sleep_notif; | 818 | priv->rx_handlers[PM_SLEEP_NOTIFICATION] = iwl_rx_pm_sleep_notif; |
819 | priv->rx_handlers[PM_DEBUG_STATISTIC_NOTIFIC] = | 819 | priv->rx_handlers[PM_DEBUG_STATISTIC_NOTIFIC] = |
820 | iwl_rx_pm_debug_statistics_notif; | 820 | iwl_rx_pm_debug_statistics_notif; |
821 | priv->rx_handlers[BEACON_NOTIFICATION] = iwl_rx_beacon_notif; | 821 | priv->rx_handlers[BEACON_NOTIFICATION] = iwlagn_rx_beacon_notif; |
822 | 822 | ||
823 | /* | 823 | /* |
824 | * The same handler is used for both the REPLY to a discrete | 824 | * The same handler is used for both the REPLY to a discrete |
diff --git a/drivers/net/wireless/iwlwifi/iwl-commands.h b/drivers/net/wireless/iwlwifi/iwl-commands.h index 935b19e2c260..c3ab6ba5b45a 100644 --- a/drivers/net/wireless/iwlwifi/iwl-commands.h +++ b/drivers/net/wireless/iwlwifi/iwl-commands.h | |||
@@ -3083,6 +3083,13 @@ struct iwl4965_beacon_notif { | |||
3083 | __le32 ibss_mgr_status; | 3083 | __le32 ibss_mgr_status; |
3084 | } __packed; | 3084 | } __packed; |
3085 | 3085 | ||
3086 | struct iwlagn_beacon_notif { | ||
3087 | struct iwlagn_tx_resp beacon_notify_hdr; | ||
3088 | __le32 low_tsf; | ||
3089 | __le32 high_tsf; | ||
3090 | __le32 ibss_mgr_status; | ||
3091 | } __packed; | ||
3092 | |||
3086 | /* | 3093 | /* |
3087 | * REPLY_TX_BEACON = 0x91 (command, has simple generic response) | 3094 | * REPLY_TX_BEACON = 0x91 (command, has simple generic response) |
3088 | */ | 3095 | */ |