aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net
diff options
context:
space:
mode:
authorGábor Stefanik <netrolller.3d@gmail.com>2009-08-21 14:44:09 -0400
committerJohn W. Linville <linville@tuxdriver.com>2009-08-28 14:40:36 -0400
commitaa065263ecb0b0df096ff4b02b2fb88060dd2d45 (patch)
treeeb7651be8bd3512fca72db8c915287500b63e32b /drivers/net
parent9d45368a3825349d8ba686bc36df589d16577dd4 (diff)
iwlwifi: Make injection of non-broadcast frames work again
Commit 1ccb84d87d04df3c76cd4352fe69786d8c7cf016 by Wey-Yi Guy ("iwlwifi: clean up unused NL80211_IFTYPE_MONITOR for Monitor mode") broke injection of non-broadcast frames to unassociated stations (causing a SYSASSERT for all such injected frames), due to injected frames no longer automatically getting a broadcast station ID assigned. This patch restores the old behavior, fixing the aforementioned regression. Also, consistently check for IEEE80211_TX_CTL_INJECTED instead of iwl_is_monitor_mode in the TX path, as TX_CTL_INJECTED specifically means that a given packet is coming from a monitor interface, while iwl_is_monitor_mode only shows whether a monitor interface exists on the device. Signed-off-by: Gábor Stefanik <netrolller.3d@gmail.com> Acked-by: Reinette Chatre <reinette.chatre@intel.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net')
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-tx.c10
-rw-r--r--drivers/net/wireless/iwlwifi/iwl3945-base.c9
2 files changed, 12 insertions, 7 deletions
diff --git a/drivers/net/wireless/iwlwifi/iwl-tx.c b/drivers/net/wireless/iwlwifi/iwl-tx.c
index 7686fc72eb89..7bc9c0039f79 100644
--- a/drivers/net/wireless/iwlwifi/iwl-tx.c
+++ b/drivers/net/wireless/iwlwifi/iwl-tx.c
@@ -718,10 +718,9 @@ int iwl_tx_skb(struct iwl_priv *priv, struct sk_buff *skb)
718 IWL_DEBUG_TX(priv, "Sending REASSOC frame\n"); 718 IWL_DEBUG_TX(priv, "Sending REASSOC frame\n");
719#endif 719#endif
720 720
721 /* drop all data frame if we are not associated */ 721 /* drop all non-injected data frame if we are not associated */
722 if (ieee80211_is_data(fc) && 722 if (ieee80211_is_data(fc) &&
723 (!iwl_is_monitor_mode(priv) || 723 !(info->flags & IEEE80211_TX_CTL_INJECTED) &&
724 !(info->flags & IEEE80211_TX_CTL_INJECTED)) && /* packet injection */
725 (!iwl_is_associated(priv) || 724 (!iwl_is_associated(priv) ||
726 ((priv->iw_mode == NL80211_IFTYPE_STATION) && !priv->assoc_id) || 725 ((priv->iw_mode == NL80211_IFTYPE_STATION) && !priv->assoc_id) ||
727 !priv->assoc_station_added)) { 726 !priv->assoc_station_added)) {
@@ -732,7 +731,10 @@ int iwl_tx_skb(struct iwl_priv *priv, struct sk_buff *skb)
732 hdr_len = ieee80211_hdrlen(fc); 731 hdr_len = ieee80211_hdrlen(fc);
733 732
734 /* Find (or create) index into station table for destination station */ 733 /* Find (or create) index into station table for destination station */
735 sta_id = iwl_get_sta_id(priv, hdr); 734 if (info->flags & IEEE80211_TX_CTL_INJECTED)
735 sta_id = priv->hw_params.bcast_sta_id;
736 else
737 sta_id = iwl_get_sta_id(priv, hdr);
736 if (sta_id == IWL_INVALID_STATION) { 738 if (sta_id == IWL_INVALID_STATION) {
737 IWL_DEBUG_DROP(priv, "Dropping - INVALID STATION: %pM\n", 739 IWL_DEBUG_DROP(priv, "Dropping - INVALID STATION: %pM\n",
738 hdr->addr1); 740 hdr->addr1);
diff --git a/drivers/net/wireless/iwlwifi/iwl3945-base.c b/drivers/net/wireless/iwlwifi/iwl3945-base.c
index f339c5bd1fde..34790413eadd 100644
--- a/drivers/net/wireless/iwlwifi/iwl3945-base.c
+++ b/drivers/net/wireless/iwlwifi/iwl3945-base.c
@@ -518,9 +518,9 @@ static int iwl3945_tx_skb(struct iwl_priv *priv, struct sk_buff *skb)
518 IWL_DEBUG_TX(priv, "Sending REASSOC frame\n"); 518 IWL_DEBUG_TX(priv, "Sending REASSOC frame\n");
519#endif 519#endif
520 520
521 /* drop all data frame if we are not associated */ 521 /* drop all non-injected data frame if we are not associated */
522 if (ieee80211_is_data(fc) && 522 if (ieee80211_is_data(fc) &&
523 (!iwl_is_monitor_mode(priv)) && /* packet injection */ 523 !(info->flags & IEEE80211_TX_CTL_INJECTED) &&
524 (!iwl_is_associated(priv) || 524 (!iwl_is_associated(priv) ||
525 ((priv->iw_mode == NL80211_IFTYPE_STATION) && !priv->assoc_id))) { 525 ((priv->iw_mode == NL80211_IFTYPE_STATION) && !priv->assoc_id))) {
526 IWL_DEBUG_DROP(priv, "Dropping - !iwl_is_associated\n"); 526 IWL_DEBUG_DROP(priv, "Dropping - !iwl_is_associated\n");
@@ -532,7 +532,10 @@ static int iwl3945_tx_skb(struct iwl_priv *priv, struct sk_buff *skb)
532 hdr_len = ieee80211_hdrlen(fc); 532 hdr_len = ieee80211_hdrlen(fc);
533 533
534 /* Find (or create) index into station table for destination station */ 534 /* Find (or create) index into station table for destination station */
535 sta_id = iwl_get_sta_id(priv, hdr); 535 if (info->flags & IEEE80211_TX_CTL_INJECTED)
536 sta_id = priv->hw_params.bcast_sta_id;
537 else
538 sta_id = iwl_get_sta_id(priv, hdr);
536 if (sta_id == IWL_INVALID_STATION) { 539 if (sta_id == IWL_INVALID_STATION) {
537 IWL_DEBUG_DROP(priv, "Dropping - INVALID STATION: %pM\n", 540 IWL_DEBUG_DROP(priv, "Dropping - INVALID STATION: %pM\n",
538 hdr->addr1); 541 hdr->addr1);