diff options
author | Rajkumar Manoharan <rmanoharan@atheros.com> | 2010-08-11 10:57:43 -0400 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2010-08-11 16:24:43 -0400 |
commit | da93f10684bfba2983a70c10b5d417232b6a5245 (patch) | |
tree | 3fe5d3ec67657920a9763fd8c2fdb744b3c1e728 /drivers/net | |
parent | 2f81b47135a971a22ccad9f3cc8c68a583b93ea4 (diff) |
ath9k_htc: fix panic on packet injection using airbase-ng tool.
This should fix the oops which occurs during the packet injection
on monitor interface.
EIP is at ath9k_htc_tx_start+0x69/0x220 [ath9k_htc]
[<f84dc8ea>] ? invoke_tx_handlers+0xa5a/0xee0 [mac80211]
[<f82c84f4>] ? ath9k_htc_tx+0x44/0xe0 [ath9k_htc]
[<f84db7b8>] ? __ieee80211_tx+0xf8/0x190 [mac80211]
[<f84dce0d>] ? ieee80211_tx+0x9d/0x1a0 [mac80211]
[<f84dcfac>] ? ieee80211_xmit+0x9c/0x1c0 [mac80211]
[<f84dd1b5>] ? ieee80211_monitor_start_xmit+0x85/0xb0 [mac80211]
[<c04c30cd>] ? dev_hard_start_xmit+0x1ad/0x210
[<c04b97c2>] ? __alloc_skb+0x52/0x130
[<c04d7cd5>] ? sch_direct_xmit+0x105/0x170
[<c04c5e9f>] ? dev_queue_xmit+0x37f/0x4b0
[<c0567e1e>] ? packet_snd+0x21e/0x250
[<c05684a2>] ? packet_sendmsg+0x32/0x40
[<c04b4c63>] ? sock_aio_write+0x113/0x130
[<c0207934>] ? do_sync_write+0xc4/0x100
[<c0167740>] ? autoremove_wake_function+0x0/0x50
[<c02f4414>] ? security_file_permission+0x14/0x20
[<c0207ad4>] ? rw_verify_area+0x64/0xe0
[<c01e6458>] ? handle_mm_fault+0x338/0x390
[<c0207cd5>] ? vfs_write+0x185/0x1a0
[<c058db20>] ? do_page_fault+0x160/0x3a0
[<c0208512>] ? sys_write+0x42/0x70
[<c01033ec>] ? syscall_call+0x7/0xb
Signed-off-by: Rajkumar Manoharan <rmanoharan@atheros.com>
Cc: stable@kernel.org
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net')
-rw-r--r-- | drivers/net/wireless/ath/ath9k/htc_drv_txrx.c | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/drivers/net/wireless/ath/ath9k/htc_drv_txrx.c b/drivers/net/wireless/ath/ath9k/htc_drv_txrx.c index bd0b4acc3ece..2a6e45a293a9 100644 --- a/drivers/net/wireless/ath/ath9k/htc_drv_txrx.c +++ b/drivers/net/wireless/ath/ath9k/htc_drv_txrx.c | |||
@@ -78,18 +78,23 @@ int ath9k_htc_tx_start(struct ath9k_htc_priv *priv, struct sk_buff *skb) | |||
78 | struct ieee80211_tx_info *tx_info = IEEE80211_SKB_CB(skb); | 78 | struct ieee80211_tx_info *tx_info = IEEE80211_SKB_CB(skb); |
79 | struct ieee80211_sta *sta = tx_info->control.sta; | 79 | struct ieee80211_sta *sta = tx_info->control.sta; |
80 | struct ath9k_htc_sta *ista; | 80 | struct ath9k_htc_sta *ista; |
81 | struct ath9k_htc_vif *avp; | ||
82 | struct ath9k_htc_tx_ctl tx_ctl; | 81 | struct ath9k_htc_tx_ctl tx_ctl; |
83 | enum htc_endpoint_id epid; | 82 | enum htc_endpoint_id epid; |
84 | u16 qnum; | 83 | u16 qnum; |
85 | __le16 fc; | 84 | __le16 fc; |
86 | u8 *tx_fhdr; | 85 | u8 *tx_fhdr; |
87 | u8 sta_idx; | 86 | u8 sta_idx, vif_idx; |
88 | 87 | ||
89 | hdr = (struct ieee80211_hdr *) skb->data; | 88 | hdr = (struct ieee80211_hdr *) skb->data; |
90 | fc = hdr->frame_control; | 89 | fc = hdr->frame_control; |
91 | 90 | ||
92 | avp = (struct ath9k_htc_vif *) tx_info->control.vif->drv_priv; | 91 | if (tx_info->control.vif && |
92 | (struct ath9k_htc_vif *) tx_info->control.vif->drv_priv) | ||
93 | vif_idx = ((struct ath9k_htc_vif *) | ||
94 | tx_info->control.vif->drv_priv)->index; | ||
95 | else | ||
96 | vif_idx = priv->nvifs; | ||
97 | |||
93 | if (sta) { | 98 | if (sta) { |
94 | ista = (struct ath9k_htc_sta *) sta->drv_priv; | 99 | ista = (struct ath9k_htc_sta *) sta->drv_priv; |
95 | sta_idx = ista->index; | 100 | sta_idx = ista->index; |
@@ -106,7 +111,7 @@ int ath9k_htc_tx_start(struct ath9k_htc_priv *priv, struct sk_buff *skb) | |||
106 | memset(&tx_hdr, 0, sizeof(struct tx_frame_hdr)); | 111 | memset(&tx_hdr, 0, sizeof(struct tx_frame_hdr)); |
107 | 112 | ||
108 | tx_hdr.node_idx = sta_idx; | 113 | tx_hdr.node_idx = sta_idx; |
109 | tx_hdr.vif_idx = avp->index; | 114 | tx_hdr.vif_idx = vif_idx; |
110 | 115 | ||
111 | if (tx_info->flags & IEEE80211_TX_CTL_AMPDU) { | 116 | if (tx_info->flags & IEEE80211_TX_CTL_AMPDU) { |
112 | tx_ctl.type = ATH9K_HTC_AMPDU; | 117 | tx_ctl.type = ATH9K_HTC_AMPDU; |
@@ -169,7 +174,7 @@ int ath9k_htc_tx_start(struct ath9k_htc_priv *priv, struct sk_buff *skb) | |||
169 | tx_ctl.type = ATH9K_HTC_NORMAL; | 174 | tx_ctl.type = ATH9K_HTC_NORMAL; |
170 | 175 | ||
171 | mgmt_hdr.node_idx = sta_idx; | 176 | mgmt_hdr.node_idx = sta_idx; |
172 | mgmt_hdr.vif_idx = avp->index; | 177 | mgmt_hdr.vif_idx = vif_idx; |
173 | mgmt_hdr.tidno = 0; | 178 | mgmt_hdr.tidno = 0; |
174 | mgmt_hdr.flags = 0; | 179 | mgmt_hdr.flags = 0; |
175 | 180 | ||