aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorAbhijeet Kolekar <abhijeet.kolekar@intel.com>2008-05-04 22:22:47 -0400
committerJohn W. Linville <linville@tuxdriver.com>2008-05-14 16:29:46 -0400
commit4419e39b6041b213e49bb13fd40fb267de0eb568 (patch)
treec4abd586184316ca3eaafc35de7f9c060f916314 /drivers
parentf3ccc08c8cdeb784087348e67f41a779c787fa0e (diff)
iwlwifi : Set monitor mode for 4965
The patch leverages mac80211 configure_filter to enable iwl4965 monitor mode. Signed-off-by: Abhijeet Kolekar <abhijeet.kolekar@intel.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-4965.c11
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-dev.h1
-rw-r--r--drivers/net/wireless/iwlwifi/iwl4965-base.c36
3 files changed, 46 insertions, 2 deletions
diff --git a/drivers/net/wireless/iwlwifi/iwl-4965.c b/drivers/net/wireless/iwlwifi/iwl-4965.c
index f56b9a91d78a..866a93e3de91 100644
--- a/drivers/net/wireless/iwlwifi/iwl-4965.c
+++ b/drivers/net/wireless/iwlwifi/iwl-4965.c
@@ -2617,7 +2617,9 @@ static void iwl4965_handle_data_packet(struct iwl_priv *priv, int is_data,
2617 rx_start->byte_count = amsdu->byte_count; 2617 rx_start->byte_count = amsdu->byte_count;
2618 rx_end = (__le32 *) (((u8 *) hdr) + len); 2618 rx_end = (__le32 *) (((u8 *) hdr) + len);
2619 } 2619 }
2620 if (len > priv->hw_params.max_pkt_size || len < 16) { 2620 /* In monitor mode allow 802.11 ACk frames (10 bytes) */
2621 if (len > priv->hw_params.max_pkt_size ||
2622 len < ((priv->iw_mode == IEEE80211_IF_TYPE_MNTR) ? 10 : 16)) {
2621 IWL_WARNING("byte count out of range [16,4K] : %d\n", len); 2623 IWL_WARNING("byte count out of range [16,4K] : %d\n", len);
2622 return; 2624 return;
2623 } 2625 }
@@ -2989,6 +2991,13 @@ static void iwl4965_rx_reply_rx(struct iwl_priv *priv,
2989 rx_status.ssi, rx_status.noise, rx_status.signal, 2991 rx_status.ssi, rx_status.noise, rx_status.signal,
2990 (unsigned long long)rx_status.mactime); 2992 (unsigned long long)rx_status.mactime);
2991 2993
2994
2995 if (priv->iw_mode == IEEE80211_IF_TYPE_MNTR) {
2996 iwl4965_handle_data_packet(priv, 1, include_phy,
2997 rxb, &rx_status);
2998 return;
2999 }
3000
2992 network_packet = iwl4965_is_network_packet(priv, header); 3001 network_packet = iwl4965_is_network_packet(priv, header);
2993 if (network_packet) { 3002 if (network_packet) {
2994 priv->last_rx_rssi = rx_status.ssi; 3003 priv->last_rx_rssi = rx_status.ssi;
diff --git a/drivers/net/wireless/iwlwifi/iwl-dev.h b/drivers/net/wireless/iwlwifi/iwl-dev.h
index e730583d88cc..25dce14c87d8 100644
--- a/drivers/net/wireless/iwlwifi/iwl-dev.h
+++ b/drivers/net/wireless/iwlwifi/iwl-dev.h
@@ -1163,6 +1163,7 @@ struct iwl_priv {
1163 struct work_struct report_work; 1163 struct work_struct report_work;
1164 struct work_struct request_scan; 1164 struct work_struct request_scan;
1165 struct work_struct beacon_update; 1165 struct work_struct beacon_update;
1166 struct work_struct set_monitor;
1166 1167
1167 struct tasklet_struct irq_tasklet; 1168 struct tasklet_struct irq_tasklet;
1168 1169
diff --git a/drivers/net/wireless/iwlwifi/iwl4965-base.c b/drivers/net/wireless/iwlwifi/iwl4965-base.c
index 2e976c3881e6..88f3554c0fbc 100644
--- a/drivers/net/wireless/iwlwifi/iwl4965-base.c
+++ b/drivers/net/wireless/iwlwifi/iwl4965-base.c
@@ -4539,6 +4539,24 @@ static void iwl4965_bg_rf_kill(struct work_struct *work)
4539 mutex_unlock(&priv->mutex); 4539 mutex_unlock(&priv->mutex);
4540} 4540}
4541 4541
4542static void iwl4965_bg_set_monitor(struct work_struct *work)
4543{
4544 struct iwl_priv *priv = container_of(work,
4545 struct iwl_priv, set_monitor);
4546
4547 IWL_DEBUG(IWL_DL_STATE, "setting monitor mode\n");
4548
4549 mutex_lock(&priv->mutex);
4550
4551 if (!iwl_is_ready(priv))
4552 IWL_DEBUG(IWL_DL_STATE, "leave - not ready\n");
4553 else
4554 if (iwl4965_set_mode(priv, IEEE80211_IF_TYPE_MNTR) != 0)
4555 IWL_ERROR("iwl4965_set_mode() failed\n");
4556
4557 mutex_unlock(&priv->mutex);
4558}
4559
4542#define IWL_SCAN_CHECK_WATCHDOG (7 * HZ) 4560#define IWL_SCAN_CHECK_WATCHDOG (7 * HZ)
4543 4561
4544static void iwl4965_bg_scan_check(struct work_struct *data) 4562static void iwl4965_bg_scan_check(struct work_struct *data)
@@ -5428,7 +5446,22 @@ static void iwl4965_configure_filter(struct ieee80211_hw *hw,
5428 * XXX: dummy 5446 * XXX: dummy
5429 * see also iwl4965_connection_init_rx_config 5447 * see also iwl4965_connection_init_rx_config
5430 */ 5448 */
5431 *total_flags = 0; 5449 struct iwl_priv *priv = hw->priv;
5450 int new_flags = 0;
5451 if (changed_flags & (FIF_PROMISC_IN_BSS | FIF_OTHER_BSS)) {
5452 if (*total_flags & (FIF_PROMISC_IN_BSS | FIF_OTHER_BSS)) {
5453 IWL_DEBUG_MAC80211("Enter: type %d (0x%x, 0x%x)\n",
5454 IEEE80211_IF_TYPE_MNTR,
5455 changed_flags, *total_flags);
5456 /* queue work 'cuz mac80211 is holding a lock which
5457 * prevents us from issuing (synchronous) f/w cmds */
5458 queue_work(priv->workqueue, &priv->set_monitor);
5459 new_flags &= FIF_PROMISC_IN_BSS |
5460 FIF_OTHER_BSS |
5461 FIF_ALLMULTI;
5462 }
5463 }
5464 *total_flags = new_flags;
5432} 5465}
5433 5466
5434static void iwl4965_mac_remove_interface(struct ieee80211_hw *hw, 5467static void iwl4965_mac_remove_interface(struct ieee80211_hw *hw,
@@ -6359,6 +6392,7 @@ static void iwl4965_setup_deferred_work(struct iwl_priv *priv)
6359 INIT_WORK(&priv->abort_scan, iwl4965_bg_abort_scan); 6392 INIT_WORK(&priv->abort_scan, iwl4965_bg_abort_scan);
6360 INIT_WORK(&priv->rf_kill, iwl4965_bg_rf_kill); 6393 INIT_WORK(&priv->rf_kill, iwl4965_bg_rf_kill);
6361 INIT_WORK(&priv->beacon_update, iwl4965_bg_beacon_update); 6394 INIT_WORK(&priv->beacon_update, iwl4965_bg_beacon_update);
6395 INIT_WORK(&priv->set_monitor, iwl4965_bg_set_monitor);
6362 INIT_DELAYED_WORK(&priv->post_associate, iwl4965_bg_post_associate); 6396 INIT_DELAYED_WORK(&priv->post_associate, iwl4965_bg_post_associate);
6363 INIT_DELAYED_WORK(&priv->init_alive_start, iwl4965_bg_init_alive_start); 6397 INIT_DELAYED_WORK(&priv->init_alive_start, iwl4965_bg_init_alive_start);
6364 INIT_DELAYED_WORK(&priv->alive_start, iwl4965_bg_alive_start); 6398 INIT_DELAYED_WORK(&priv->alive_start, iwl4965_bg_alive_start);