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>
This commit is contained in:
parent
25b3f57c1f
commit
914233d68f
|
@ -2539,6 +2539,11 @@ static int iwl3945_get_sta_id(struct iwl3945_priv *priv, struct ieee80211_hdr *h
|
||||||
iwl3945_print_hex_dump(IWL_DL_DROP, (u8 *) hdr, sizeof(*hdr));
|
iwl3945_print_hex_dump(IWL_DL_DROP, (u8 *) hdr, sizeof(*hdr));
|
||||||
return priv->hw_setting.bcast_sta_id;
|
return priv->hw_setting.bcast_sta_id;
|
||||||
}
|
}
|
||||||
|
/* If we are in monitor mode, use BCAST. This is required for
|
||||||
|
* packet injection. */
|
||||||
|
case IEEE80211_IF_TYPE_MNTR:
|
||||||
|
return priv->hw_setting.bcast_sta_id;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
IWL_WARNING("Unknown mode of operation: %d", priv->iw_mode);
|
IWL_WARNING("Unknown mode of operation: %d", priv->iw_mode);
|
||||||
return priv->hw_setting.bcast_sta_id;
|
return priv->hw_setting.bcast_sta_id;
|
||||||
|
@ -2578,11 +2583,6 @@ static int iwl3945_tx_skb(struct iwl3945_priv *priv, struct sk_buff *skb)
|
||||||
goto drop_unlock;
|
goto drop_unlock;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!priv->vif) {
|
|
||||||
IWL_DEBUG_DROP("Dropping - !priv->vif\n");
|
|
||||||
goto drop_unlock;
|
|
||||||
}
|
|
||||||
|
|
||||||
if ((ieee80211_get_tx_rate(priv->hw, info)->hw_value & 0xFF) == IWL_INVALID_RATE) {
|
if ((ieee80211_get_tx_rate(priv->hw, info)->hw_value & 0xFF) == IWL_INVALID_RATE) {
|
||||||
IWL_ERROR("ERROR: No TX rate available.\n");
|
IWL_ERROR("ERROR: No TX rate available.\n");
|
||||||
goto drop_unlock;
|
goto drop_unlock;
|
||||||
|
@ -2603,9 +2603,10 @@ static int iwl3945_tx_skb(struct iwl3945_priv *priv, struct sk_buff *skb)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* drop all data frame if we are not associated */
|
/* drop all data frame if we are not associated */
|
||||||
if ((!iwl3945_is_associated(priv) ||
|
if (ieee80211_is_data(fc) &&
|
||||||
((priv->iw_mode == IEEE80211_IF_TYPE_STA) && !priv->assoc_id)) &&
|
(priv->iw_mode != IEEE80211_IF_TYPE_MNTR) && /* packet injection */
|
||||||
ieee80211_is_data(fc)) {
|
(!iwl3945_is_associated(priv) ||
|
||||||
|
((priv->iw_mode == IEEE80211_IF_TYPE_STA) && !priv->assoc_id))) {
|
||||||
IWL_DEBUG_DROP("Dropping - !iwl3945_is_associated\n");
|
IWL_DEBUG_DROP("Dropping - !iwl3945_is_associated\n");
|
||||||
goto drop_unlock;
|
goto drop_unlock;
|
||||||
}
|
}
|
||||||
|
@ -6693,11 +6694,6 @@ static int iwl3945_mac_tx(struct ieee80211_hw *hw, struct sk_buff *skb)
|
||||||
|
|
||||||
IWL_DEBUG_MAC80211("enter\n");
|
IWL_DEBUG_MAC80211("enter\n");
|
||||||
|
|
||||||
if (priv->iw_mode == IEEE80211_IF_TYPE_MNTR) {
|
|
||||||
IWL_DEBUG_MAC80211("leave - monitor\n");
|
|
||||||
return -1;
|
|
||||||
}
|
|
||||||
|
|
||||||
IWL_DEBUG_TX("dev->xmit(%d bytes) at rate 0x%02x\n", skb->len,
|
IWL_DEBUG_TX("dev->xmit(%d bytes) at rate 0x%02x\n", skb->len,
|
||||||
ieee80211_get_tx_rate(hw, IEEE80211_SKB_CB(skb))->bitrate);
|
ieee80211_get_tx_rate(hw, IEEE80211_SKB_CB(skb))->bitrate);
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue