aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStefanik Gábor <netrolller.3d@gmail.com>2008-06-30 05:23:30 -0400
committerJohn W. Linville <linville@tuxdriver.com>2008-07-02 15:48:32 -0400
commit914233d68f07d5d9c22630cd5a84fdfd98f39da2 (patch)
tree7b1b7c571641b9f97c26f72211deec18cd11396f
parent25b3f57c1f4572d9b2d5671d60e99f26d2a7a26b (diff)
iwlwifi: enable packet injection for iwl3945
This patch enables packet injection on iwl3945 devices. Tested with packetspammer and aireplay-ng. 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>
-rw-r--r--drivers/net/wireless/iwlwifi/iwl3945-base.c22
1 files changed, 9 insertions, 13 deletions
diff --git a/drivers/net/wireless/iwlwifi/iwl3945-base.c b/drivers/net/wireless/iwlwifi/iwl3945-base.c
index 4f0a18a0e664..73942a4f215e 100644
--- a/drivers/net/wireless/iwlwifi/iwl3945-base.c
+++ b/drivers/net/wireless/iwlwifi/iwl3945-base.c
@@ -2539,6 +2539,11 @@ static int iwl3945_get_sta_id(struct iwl3945_priv *priv, struct ieee80211_hdr *h
2539 iwl3945_print_hex_dump(IWL_DL_DROP, (u8 *) hdr, sizeof(*hdr)); 2539 iwl3945_print_hex_dump(IWL_DL_DROP, (u8 *) hdr, sizeof(*hdr));
2540 return priv->hw_setting.bcast_sta_id; 2540 return priv->hw_setting.bcast_sta_id;
2541 } 2541 }
2542 /* If we are in monitor mode, use BCAST. This is required for
2543 * packet injection. */
2544 case IEEE80211_IF_TYPE_MNTR:
2545 return priv->hw_setting.bcast_sta_id;
2546
2542 default: 2547 default:
2543 IWL_WARNING("Unknown mode of operation: %d", priv->iw_mode); 2548 IWL_WARNING("Unknown mode of operation: %d", priv->iw_mode);
2544 return priv->hw_setting.bcast_sta_id; 2549 return priv->hw_setting.bcast_sta_id;
@@ -2578,11 +2583,6 @@ static int iwl3945_tx_skb(struct iwl3945_priv *priv, struct sk_buff *skb)
2578 goto drop_unlock; 2583 goto drop_unlock;
2579 } 2584 }
2580 2585
2581 if (!priv->vif) {
2582 IWL_DEBUG_DROP("Dropping - !priv->vif\n");
2583 goto drop_unlock;
2584 }
2585
2586 if ((ieee80211_get_tx_rate(priv->hw, info)->hw_value & 0xFF) == IWL_INVALID_RATE) { 2586 if ((ieee80211_get_tx_rate(priv->hw, info)->hw_value & 0xFF) == IWL_INVALID_RATE) {
2587 IWL_ERROR("ERROR: No TX rate available.\n"); 2587 IWL_ERROR("ERROR: No TX rate available.\n");
2588 goto drop_unlock; 2588 goto drop_unlock;
@@ -2603,9 +2603,10 @@ static int iwl3945_tx_skb(struct iwl3945_priv *priv, struct sk_buff *skb)
2603#endif 2603#endif
2604 2604
2605 /* drop all data frame if we are not associated */ 2605 /* drop all data frame if we are not associated */
2606 if ((!iwl3945_is_associated(priv) || 2606 if (ieee80211_is_data(fc) &&
2607 ((priv->iw_mode == IEEE80211_IF_TYPE_STA) && !priv->assoc_id)) && 2607 (priv->iw_mode != IEEE80211_IF_TYPE_MNTR) && /* packet injection */
2608 ieee80211_is_data(fc)) { 2608 (!iwl3945_is_associated(priv) ||
2609 ((priv->iw_mode == IEEE80211_IF_TYPE_STA) && !priv->assoc_id))) {
2609 IWL_DEBUG_DROP("Dropping - !iwl3945_is_associated\n"); 2610 IWL_DEBUG_DROP("Dropping - !iwl3945_is_associated\n");
2610 goto drop_unlock; 2611 goto drop_unlock;
2611 } 2612 }
@@ -6693,11 +6694,6 @@ static int iwl3945_mac_tx(struct ieee80211_hw *hw, struct sk_buff *skb)
6693 6694
6694 IWL_DEBUG_MAC80211("enter\n"); 6695 IWL_DEBUG_MAC80211("enter\n");
6695 6696
6696 if (priv->iw_mode == IEEE80211_IF_TYPE_MNTR) {
6697 IWL_DEBUG_MAC80211("leave - monitor\n");
6698 return -1;
6699 }
6700
6701 IWL_DEBUG_TX("dev->xmit(%d bytes) at rate 0x%02x\n", skb->len, 6697 IWL_DEBUG_TX("dev->xmit(%d bytes) at rate 0x%02x\n", skb->len,
6702 ieee80211_get_tx_rate(hw, IEEE80211_SKB_CB(skb))->bitrate); 6698 ieee80211_get_tx_rate(hw, IEEE80211_SKB_CB(skb))->bitrate);
6703 6699