diff options
author | Wey-Yi Guy <wey-yi.w.guy@intel.com> | 2009-04-20 17:37:00 -0400 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2009-04-22 16:57:19 -0400 |
commit | 279b05d4362472ae9269f982f00e644265bdbf94 (patch) | |
tree | ab919727ebb69a6d88e4285beb45254a0891eae0 /drivers/net/wireless | |
parent | 86ddbf62c2daefebba13e3c79f88cbdfde766176 (diff) |
iwlwifi: clean up unused NL80211_IFTYPE_MONITOR for Monitor mode
This patch clean up the code for NL80211_IFTYPE_MONITOR mode,
priv->iw_mode is set in add_interface, but add_interface is never called
for monitor mode.
The only way mac80211 informs us about monitor mode is through
configuring filter; since iw_mode will never set to
NL80211_IFTYPE_MONITOR, modify and remove all the code refer to
NL80211_IFTYPE_MONITOR and replace with iwl_is_monitor_mode() function
call.
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
Signed-off-by: Reinette Chatre <reinette.chatre@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless')
-rw-r--r-- | drivers/net/wireless/iwlwifi/iwl-agn.c | 2 | ||||
-rw-r--r-- | drivers/net/wireless/iwlwifi/iwl-core.c | 8 | ||||
-rw-r--r-- | drivers/net/wireless/iwlwifi/iwl-core.h | 1 | ||||
-rw-r--r-- | drivers/net/wireless/iwlwifi/iwl-rx.c | 7 | ||||
-rw-r--r-- | drivers/net/wireless/iwlwifi/iwl-scan.c | 2 | ||||
-rw-r--r-- | drivers/net/wireless/iwlwifi/iwl-sta.c | 5 | ||||
-rw-r--r-- | drivers/net/wireless/iwlwifi/iwl-tx.c | 2 | ||||
-rw-r--r-- | drivers/net/wireless/iwlwifi/iwl3945-base.c | 4 |
8 files changed, 7 insertions, 24 deletions
diff --git a/drivers/net/wireless/iwlwifi/iwl-agn.c b/drivers/net/wireless/iwlwifi/iwl-agn.c index 2751736b0b64..fc52d3229d66 100644 --- a/drivers/net/wireless/iwlwifi/iwl-agn.c +++ b/drivers/net/wireless/iwlwifi/iwl-agn.c | |||
@@ -2001,8 +2001,6 @@ static int iwl_mac_start(struct ieee80211_hw *hw) | |||
2001 | 2001 | ||
2002 | out: | 2002 | out: |
2003 | priv->is_open = 1; | 2003 | priv->is_open = 1; |
2004 | /* default to MONITOR mode */ | ||
2005 | priv->iw_mode = NL80211_IFTYPE_MONITOR; | ||
2006 | IWL_DEBUG_MAC80211(priv, "leave\n"); | 2004 | IWL_DEBUG_MAC80211(priv, "leave\n"); |
2007 | return 0; | 2005 | return 0; |
2008 | } | 2006 | } |
diff --git a/drivers/net/wireless/iwlwifi/iwl-core.c b/drivers/net/wireless/iwlwifi/iwl-core.c index c43c57d7a4cb..bf7ad515e6a0 100644 --- a/drivers/net/wireless/iwlwifi/iwl-core.c +++ b/drivers/net/wireless/iwlwifi/iwl-core.c | |||
@@ -904,10 +904,11 @@ static u8 iwl_count_chain_bitmap(u32 chain_bitmap) | |||
904 | * never called for monitor mode. The only way mac80211 informs us about | 904 | * never called for monitor mode. The only way mac80211 informs us about |
905 | * monitor mode is through configuring filters (call to configure_filter). | 905 | * monitor mode is through configuring filters (call to configure_filter). |
906 | */ | 906 | */ |
907 | static bool iwl_is_monitor_mode(struct iwl_priv *priv) | 907 | bool iwl_is_monitor_mode(struct iwl_priv *priv) |
908 | { | 908 | { |
909 | return !!(priv->staging_rxon.filter_flags & RXON_FILTER_PROMISC_MSK); | 909 | return !!(priv->staging_rxon.filter_flags & RXON_FILTER_PROMISC_MSK); |
910 | } | 910 | } |
911 | EXPORT_SYMBOL(iwl_is_monitor_mode); | ||
911 | 912 | ||
912 | /** | 913 | /** |
913 | * iwl_set_rxon_chain - Set up Rx chain usage in "staging" RXON image | 914 | * iwl_set_rxon_chain - Set up Rx chain usage in "staging" RXON image |
@@ -1071,11 +1072,6 @@ void iwl_connection_init_rx_config(struct iwl_priv *priv, int mode) | |||
1071 | RXON_FILTER_ACCEPT_GRP_MSK; | 1072 | RXON_FILTER_ACCEPT_GRP_MSK; |
1072 | break; | 1073 | break; |
1073 | 1074 | ||
1074 | case NL80211_IFTYPE_MONITOR: | ||
1075 | priv->staging_rxon.dev_type = RXON_DEV_TYPE_SNIFFER; | ||
1076 | priv->staging_rxon.filter_flags = RXON_FILTER_PROMISC_MSK | | ||
1077 | RXON_FILTER_CTL2HOST_MSK | RXON_FILTER_ACCEPT_GRP_MSK; | ||
1078 | break; | ||
1079 | default: | 1075 | default: |
1080 | IWL_ERR(priv, "Unsupported interface type %d\n", mode); | 1076 | IWL_ERR(priv, "Unsupported interface type %d\n", mode); |
1081 | break; | 1077 | break; |
diff --git a/drivers/net/wireless/iwlwifi/iwl-core.h b/drivers/net/wireless/iwlwifi/iwl-core.h index 8ab60df48d56..3bc2f6c3e8b9 100644 --- a/drivers/net/wireless/iwlwifi/iwl-core.h +++ b/drivers/net/wireless/iwlwifi/iwl-core.h | |||
@@ -267,6 +267,7 @@ int iwl_setup_mac(struct iwl_priv *priv); | |||
267 | int iwl_set_hw_params(struct iwl_priv *priv); | 267 | int iwl_set_hw_params(struct iwl_priv *priv); |
268 | int iwl_init_drv(struct iwl_priv *priv); | 268 | int iwl_init_drv(struct iwl_priv *priv); |
269 | void iwl_uninit_drv(struct iwl_priv *priv); | 269 | void iwl_uninit_drv(struct iwl_priv *priv); |
270 | bool iwl_is_monitor_mode(struct iwl_priv *priv); | ||
270 | void iwl_post_associate(struct iwl_priv *priv); | 271 | void iwl_post_associate(struct iwl_priv *priv); |
271 | void iwl_bss_info_changed(struct ieee80211_hw *hw, | 272 | void iwl_bss_info_changed(struct ieee80211_hw *hw, |
272 | struct ieee80211_vif *vif, | 273 | struct ieee80211_vif *vif, |
diff --git a/drivers/net/wireless/iwlwifi/iwl-rx.c b/drivers/net/wireless/iwlwifi/iwl-rx.c index 8f65908f66f1..fae84262efb6 100644 --- a/drivers/net/wireless/iwlwifi/iwl-rx.c +++ b/drivers/net/wireless/iwlwifi/iwl-rx.c | |||
@@ -1102,13 +1102,6 @@ void iwl_rx_reply_rx(struct iwl_priv *priv, | |||
1102 | if (rx_start->phy_flags & RX_RES_PHY_FLAGS_SHORT_PREAMBLE_MSK) | 1102 | if (rx_start->phy_flags & RX_RES_PHY_FLAGS_SHORT_PREAMBLE_MSK) |
1103 | rx_status.flag |= RX_FLAG_SHORTPRE; | 1103 | rx_status.flag |= RX_FLAG_SHORTPRE; |
1104 | 1104 | ||
1105 | /* Take shortcut when only in monitor mode */ | ||
1106 | if (priv->iw_mode == NL80211_IFTYPE_MONITOR) { | ||
1107 | iwl_pass_packet_to_mac80211(priv, include_phy, | ||
1108 | rxb, &rx_status); | ||
1109 | return; | ||
1110 | } | ||
1111 | |||
1112 | network_packet = iwl_is_network_packet(priv, header); | 1105 | network_packet = iwl_is_network_packet(priv, header); |
1113 | if (network_packet) { | 1106 | if (network_packet) { |
1114 | priv->last_rx_rssi = rx_status.signal; | 1107 | priv->last_rx_rssi = rx_status.signal; |
diff --git a/drivers/net/wireless/iwlwifi/iwl-scan.c b/drivers/net/wireless/iwlwifi/iwl-scan.c index 25311e1ceed7..799f5eb61ece 100644 --- a/drivers/net/wireless/iwlwifi/iwl-scan.c +++ b/drivers/net/wireless/iwlwifi/iwl-scan.c | |||
@@ -747,7 +747,7 @@ static void iwl_bg_request_scan(struct work_struct *data) | |||
747 | 747 | ||
748 | scan->tx_cmd.len = cpu_to_le16(cmd_len); | 748 | scan->tx_cmd.len = cpu_to_le16(cmd_len); |
749 | 749 | ||
750 | if (priv->iw_mode == NL80211_IFTYPE_MONITOR) | 750 | if (iwl_is_monitor_mode(priv)) |
751 | scan->filter_flags = RXON_FILTER_PROMISC_MSK; | 751 | scan->filter_flags = RXON_FILTER_PROMISC_MSK; |
752 | 752 | ||
753 | scan->filter_flags |= (RXON_FILTER_ACCEPT_GRP_MSK | | 753 | scan->filter_flags |= (RXON_FILTER_ACCEPT_GRP_MSK | |
diff --git a/drivers/net/wireless/iwlwifi/iwl-sta.c b/drivers/net/wireless/iwlwifi/iwl-sta.c index b8f18c697888..17a4dd2be1f2 100644 --- a/drivers/net/wireless/iwlwifi/iwl-sta.c +++ b/drivers/net/wireless/iwlwifi/iwl-sta.c | |||
@@ -1078,11 +1078,6 @@ int iwl_get_sta_id(struct iwl_priv *priv, struct ieee80211_hdr *hdr) | |||
1078 | iwl_print_hex_dump(priv, IWL_DL_DROP, (u8 *) hdr, sizeof(*hdr)); | 1078 | iwl_print_hex_dump(priv, IWL_DL_DROP, (u8 *) hdr, sizeof(*hdr)); |
1079 | return priv->hw_params.bcast_sta_id; | 1079 | return priv->hw_params.bcast_sta_id; |
1080 | 1080 | ||
1081 | /* If we are in monitor mode, use BCAST. This is required for | ||
1082 | * packet injection. */ | ||
1083 | case NL80211_IFTYPE_MONITOR: | ||
1084 | return priv->hw_params.bcast_sta_id; | ||
1085 | |||
1086 | default: | 1081 | default: |
1087 | IWL_WARN(priv, "Unknown mode of operation: %d\n", | 1082 | IWL_WARN(priv, "Unknown mode of operation: %d\n", |
1088 | priv->iw_mode); | 1083 | priv->iw_mode); |
diff --git a/drivers/net/wireless/iwlwifi/iwl-tx.c b/drivers/net/wireless/iwlwifi/iwl-tx.c index c734c5f7e976..58cdd3294216 100644 --- a/drivers/net/wireless/iwlwifi/iwl-tx.c +++ b/drivers/net/wireless/iwlwifi/iwl-tx.c | |||
@@ -728,7 +728,7 @@ int iwl_tx_skb(struct iwl_priv *priv, struct sk_buff *skb) | |||
728 | 728 | ||
729 | /* drop all data frame if we are not associated */ | 729 | /* drop all data frame if we are not associated */ |
730 | if (ieee80211_is_data(fc) && | 730 | if (ieee80211_is_data(fc) && |
731 | (priv->iw_mode != NL80211_IFTYPE_MONITOR || | 731 | (!iwl_is_monitor_mode(priv) || |
732 | !(info->flags & IEEE80211_TX_CTL_INJECTED)) && /* packet injection */ | 732 | !(info->flags & IEEE80211_TX_CTL_INJECTED)) && /* packet injection */ |
733 | (!iwl_is_associated(priv) || | 733 | (!iwl_is_associated(priv) || |
734 | ((priv->iw_mode == NL80211_IFTYPE_STATION) && !priv->assoc_id) || | 734 | ((priv->iw_mode == NL80211_IFTYPE_STATION) && !priv->assoc_id) || |
diff --git a/drivers/net/wireless/iwlwifi/iwl3945-base.c b/drivers/net/wireless/iwlwifi/iwl3945-base.c index 562dd76226cc..c9fde0e0c982 100644 --- a/drivers/net/wireless/iwlwifi/iwl3945-base.c +++ b/drivers/net/wireless/iwlwifi/iwl3945-base.c | |||
@@ -729,7 +729,7 @@ static int iwl3945_tx_skb(struct iwl_priv *priv, struct sk_buff *skb) | |||
729 | 729 | ||
730 | /* drop all data frame if we are not associated */ | 730 | /* drop all data frame if we are not associated */ |
731 | if (ieee80211_is_data(fc) && | 731 | if (ieee80211_is_data(fc) && |
732 | (priv->iw_mode != NL80211_IFTYPE_MONITOR) && /* packet injection */ | 732 | (!iwl_is_monitor_mode(priv)) && /* packet injection */ |
733 | (!iwl_is_associated(priv) || | 733 | (!iwl_is_associated(priv) || |
734 | ((priv->iw_mode == NL80211_IFTYPE_STATION) && !priv->assoc_id))) { | 734 | ((priv->iw_mode == NL80211_IFTYPE_STATION) && !priv->assoc_id))) { |
735 | IWL_DEBUG_DROP(priv, "Dropping - !iwl_is_associated\n"); | 735 | IWL_DEBUG_DROP(priv, "Dropping - !iwl_is_associated\n"); |
@@ -3113,7 +3113,7 @@ static void iwl3945_bg_request_scan(struct work_struct *data) | |||
3113 | /* select Rx antennas */ | 3113 | /* select Rx antennas */ |
3114 | scan->flags |= iwl3945_get_antenna_flags(priv); | 3114 | scan->flags |= iwl3945_get_antenna_flags(priv); |
3115 | 3115 | ||
3116 | if (priv->iw_mode == NL80211_IFTYPE_MONITOR) | 3116 | if (iwl_is_monitor_mode(priv)) |
3117 | scan->filter_flags = RXON_FILTER_PROMISC_MSK; | 3117 | scan->filter_flags = RXON_FILTER_PROMISC_MSK; |
3118 | 3118 | ||
3119 | scan->channel_count = | 3119 | scan->channel_count = |