diff options
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/net/wireless/mac80211_hwsim.c | 3 | ||||
-rw-r--r-- | drivers/net/wireless/rt2x00/rt2x00queue.c | 21 |
2 files changed, 15 insertions, 9 deletions
diff --git a/drivers/net/wireless/mac80211_hwsim.c b/drivers/net/wireless/mac80211_hwsim.c index da8aa83481f7..631d65b73edf 100644 --- a/drivers/net/wireless/mac80211_hwsim.c +++ b/drivers/net/wireless/mac80211_hwsim.c | |||
@@ -258,7 +258,8 @@ static int mac80211_hwsim_tx(struct ieee80211_hw *hw, struct sk_buff *skb) | |||
258 | 258 | ||
259 | txi = IEEE80211_SKB_CB(skb); | 259 | txi = IEEE80211_SKB_CB(skb); |
260 | 260 | ||
261 | hwsim_check_magic(txi->control.vif); | 261 | if (txi->control.vif) |
262 | hwsim_check_magic(txi->control.vif); | ||
262 | if (txi->control.sta) | 263 | if (txi->control.sta) |
263 | hwsim_check_sta_magic(txi->control.sta); | 264 | hwsim_check_sta_magic(txi->control.sta); |
264 | 265 | ||
diff --git a/drivers/net/wireless/rt2x00/rt2x00queue.c b/drivers/net/wireless/rt2x00/rt2x00queue.c index a5e965068c83..b7f4fe8fba6e 100644 --- a/drivers/net/wireless/rt2x00/rt2x00queue.c +++ b/drivers/net/wireless/rt2x00/rt2x00queue.c | |||
@@ -155,7 +155,6 @@ static void rt2x00queue_create_tx_descriptor(struct queue_entry *entry, | |||
155 | { | 155 | { |
156 | struct rt2x00_dev *rt2x00dev = entry->queue->rt2x00dev; | 156 | struct rt2x00_dev *rt2x00dev = entry->queue->rt2x00dev; |
157 | struct ieee80211_tx_info *tx_info = IEEE80211_SKB_CB(entry->skb); | 157 | struct ieee80211_tx_info *tx_info = IEEE80211_SKB_CB(entry->skb); |
158 | struct rt2x00_intf *intf = vif_to_intf(tx_info->control.vif); | ||
159 | struct ieee80211_hdr *hdr = (struct ieee80211_hdr *)entry->skb->data; | 158 | struct ieee80211_hdr *hdr = (struct ieee80211_hdr *)entry->skb->data; |
160 | struct ieee80211_rate *rate = | 159 | struct ieee80211_rate *rate = |
161 | ieee80211_get_tx_rate(rt2x00dev->hw, tx_info); | 160 | ieee80211_get_tx_rate(rt2x00dev->hw, tx_info); |
@@ -278,16 +277,22 @@ static void rt2x00queue_create_tx_descriptor(struct queue_entry *entry, | |||
278 | * sequence counter given by mac80211. | 277 | * sequence counter given by mac80211. |
279 | */ | 278 | */ |
280 | if (tx_info->flags & IEEE80211_TX_CTL_ASSIGN_SEQ) { | 279 | if (tx_info->flags & IEEE80211_TX_CTL_ASSIGN_SEQ) { |
281 | spin_lock_irqsave(&intf->seqlock, irqflags); | 280 | if (likely(tx_info->control.vif)) { |
281 | struct rt2x00_intf *intf; | ||
282 | 282 | ||
283 | if (test_bit(ENTRY_TXD_FIRST_FRAGMENT, &txdesc->flags)) | 283 | intf = vif_to_intf(tx_info->control.vif); |
284 | intf->seqno += 0x10; | ||
285 | hdr->seq_ctrl &= cpu_to_le16(IEEE80211_SCTL_FRAG); | ||
286 | hdr->seq_ctrl |= cpu_to_le16(intf->seqno); | ||
287 | 284 | ||
288 | spin_unlock_irqrestore(&intf->seqlock, irqflags); | 285 | spin_lock_irqsave(&intf->seqlock, irqflags); |
289 | 286 | ||
290 | __set_bit(ENTRY_TXD_GENERATE_SEQ, &txdesc->flags); | 287 | if (test_bit(ENTRY_TXD_FIRST_FRAGMENT, &txdesc->flags)) |
288 | intf->seqno += 0x10; | ||
289 | hdr->seq_ctrl &= cpu_to_le16(IEEE80211_SCTL_FRAG); | ||
290 | hdr->seq_ctrl |= cpu_to_le16(intf->seqno); | ||
291 | |||
292 | spin_unlock_irqrestore(&intf->seqlock, irqflags); | ||
293 | |||
294 | __set_bit(ENTRY_TXD_GENERATE_SEQ, &txdesc->flags); | ||
295 | } | ||
291 | } | 296 | } |
292 | 297 | ||
293 | /* | 298 | /* |