diff options
author | Stefanik Gábor <netrolller.3d@gmail.com> | 2008-09-02 23:26:59 -0400 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2008-09-08 14:23:22 -0400 |
commit | d10c4ec8b4bc02f3874c7ef3c3539e4e7e123969 (patch) | |
tree | cbde295d509015ed5dfa6e6281db0ba128d4c0ec /drivers | |
parent | f93405206557077d6508682b624117ec68ea48f6 (diff) |
iwlwifi: enable packet injection for iwlagn
Handle station IDs of transmitted packets when in monitor mode, and
remove the various anti-injection checks from the iwl4965 driver.
This makes injection work on iwl4965 and iwl5000. Tested on both cards.
Note: To inject management frames with encryption, HW crypto support
must be disabled using the "swcrypto=1" modparam (or "swcrypto50=1"
for iwl5000). Otherwise most management frames won't be transmitted.
Signed-off-by: Gábor Stefanik <netrolller.3d@gmail.com>
Signed-off-by: Zhu Yi <yi.zhu@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/net/wireless/iwlwifi/iwl-agn.c | 6 | ||||
-rw-r--r-- | drivers/net/wireless/iwlwifi/iwl-sta.c | 5 | ||||
-rw-r--r-- | drivers/net/wireless/iwlwifi/iwl-tx.c | 13 |
3 files changed, 10 insertions, 14 deletions
diff --git a/drivers/net/wireless/iwlwifi/iwl-agn.c b/drivers/net/wireless/iwlwifi/iwl-agn.c index ab92e19f0b6c..5cce894dc1f9 100644 --- a/drivers/net/wireless/iwlwifi/iwl-agn.c +++ b/drivers/net/wireless/iwlwifi/iwl-agn.c | |||
@@ -2722,12 +2722,6 @@ static int iwl4965_mac_tx(struct ieee80211_hw *hw, struct sk_buff *skb) | |||
2722 | 2722 | ||
2723 | IWL_DEBUG_MACDUMP("enter\n"); | 2723 | IWL_DEBUG_MACDUMP("enter\n"); |
2724 | 2724 | ||
2725 | if (priv->iw_mode == IEEE80211_IF_TYPE_MNTR) { | ||
2726 | IWL_DEBUG_MAC80211("leave - monitor\n"); | ||
2727 | dev_kfree_skb_any(skb); | ||
2728 | return 0; | ||
2729 | } | ||
2730 | |||
2731 | IWL_DEBUG_TX("dev->xmit(%d bytes) at rate 0x%02x\n", skb->len, | 2725 | IWL_DEBUG_TX("dev->xmit(%d bytes) at rate 0x%02x\n", skb->len, |
2732 | ieee80211_get_tx_rate(hw, IEEE80211_SKB_CB(skb))->bitrate); | 2726 | ieee80211_get_tx_rate(hw, IEEE80211_SKB_CB(skb))->bitrate); |
2733 | 2727 | ||
diff --git a/drivers/net/wireless/iwlwifi/iwl-sta.c b/drivers/net/wireless/iwlwifi/iwl-sta.c index 6283a3a707f5..5b7b05c8773f 100644 --- a/drivers/net/wireless/iwlwifi/iwl-sta.c +++ b/drivers/net/wireless/iwlwifi/iwl-sta.c | |||
@@ -968,6 +968,11 @@ int iwl_get_sta_id(struct iwl_priv *priv, struct ieee80211_hdr *hdr) | |||
968 | iwl_print_hex_dump(priv, IWL_DL_DROP, (u8 *) hdr, sizeof(*hdr)); | 968 | iwl_print_hex_dump(priv, IWL_DL_DROP, (u8 *) hdr, sizeof(*hdr)); |
969 | return priv->hw_params.bcast_sta_id; | 969 | return priv->hw_params.bcast_sta_id; |
970 | 970 | ||
971 | /* If we are in monitor mode, use BCAST. This is required for | ||
972 | * packet injection. */ | ||
973 | case IEEE80211_IF_TYPE_MNTR: | ||
974 | return priv->hw_params.bcast_sta_id; | ||
975 | |||
971 | default: | 976 | default: |
972 | IWL_WARNING("Unknown mode of operation: %d\n", priv->iw_mode); | 977 | IWL_WARNING("Unknown mode of operation: %d\n", priv->iw_mode); |
973 | return priv->hw_params.bcast_sta_id; | 978 | return priv->hw_params.bcast_sta_id; |
diff --git a/drivers/net/wireless/iwlwifi/iwl-tx.c b/drivers/net/wireless/iwlwifi/iwl-tx.c index a004cc8ab8f5..452938c299af 100644 --- a/drivers/net/wireless/iwlwifi/iwl-tx.c +++ b/drivers/net/wireless/iwlwifi/iwl-tx.c | |||
@@ -789,11 +789,6 @@ int iwl_tx_skb(struct iwl_priv *priv, struct sk_buff *skb) | |||
789 | goto drop_unlock; | 789 | goto drop_unlock; |
790 | } | 790 | } |
791 | 791 | ||
792 | if (!priv->vif) { | ||
793 | IWL_DEBUG_DROP("Dropping - !priv->vif\n"); | ||
794 | goto drop_unlock; | ||
795 | } | ||
796 | |||
797 | if ((ieee80211_get_tx_rate(priv->hw, info)->hw_value & 0xFF) == | 792 | if ((ieee80211_get_tx_rate(priv->hw, info)->hw_value & 0xFF) == |
798 | IWL_INVALID_RATE) { | 793 | IWL_INVALID_RATE) { |
799 | IWL_ERROR("ERROR: No TX rate available.\n"); | 794 | IWL_ERROR("ERROR: No TX rate available.\n"); |
@@ -815,9 +810,11 @@ int iwl_tx_skb(struct iwl_priv *priv, struct sk_buff *skb) | |||
815 | 810 | ||
816 | /* drop all data frame if we are not associated */ | 811 | /* drop all data frame if we are not associated */ |
817 | if (ieee80211_is_data(fc) && | 812 | if (ieee80211_is_data(fc) && |
818 | (!iwl_is_associated(priv) || | 813 | (priv->iw_mode != IEEE80211_IF_TYPE_MNTR || |
819 | ((priv->iw_mode == IEEE80211_IF_TYPE_STA) && !priv->assoc_id) || | 814 | !(info->flags & IEEE80211_TX_CTL_INJECTED)) && /* packet injection */ |
820 | !priv->assoc_station_added)) { | 815 | (!iwl_is_associated(priv) || |
816 | ((priv->iw_mode == IEEE80211_IF_TYPE_STA) && !priv->assoc_id) || | ||
817 | !priv->assoc_station_added)) { | ||
821 | IWL_DEBUG_DROP("Dropping - !iwl_is_associated\n"); | 818 | IWL_DEBUG_DROP("Dropping - !iwl_is_associated\n"); |
822 | goto drop_unlock; | 819 | goto drop_unlock; |
823 | } | 820 | } |