.. | .. |
---|
| 1 | +// SPDX-License-Identifier: GPL-2.0-only |
---|
1 | 2 | /* |
---|
2 | 3 | * Linux device driver for RTL8187 |
---|
3 | 4 | * |
---|
.. | .. |
---|
14 | 15 | * |
---|
15 | 16 | * Magic delays and register offsets below are taken from the original |
---|
16 | 17 | * r8187 driver sources. Thanks to Realtek for their support! |
---|
17 | | - * |
---|
18 | | - * This program is free software; you can redistribute it and/or modify |
---|
19 | | - * it under the terms of the GNU General Public License version 2 as |
---|
20 | | - * published by the Free Software Foundation. |
---|
21 | 18 | */ |
---|
22 | 19 | |
---|
23 | 20 | #include <linux/usb.h> |
---|
.. | .. |
---|
500 | 497 | if (cmd_type == 1) { |
---|
501 | 498 | unsigned int pkt_rc, seq_no; |
---|
502 | 499 | bool tok; |
---|
503 | | - struct sk_buff *skb; |
---|
| 500 | + struct sk_buff *skb, *iter; |
---|
504 | 501 | struct ieee80211_hdr *ieee80211hdr; |
---|
505 | 502 | unsigned long flags; |
---|
506 | 503 | |
---|
.. | .. |
---|
509 | 506 | seq_no = (val >> 16) & 0xFFF; |
---|
510 | 507 | |
---|
511 | 508 | spin_lock_irqsave(&priv->b_tx_status.queue.lock, flags); |
---|
512 | | - skb_queue_reverse_walk(&priv->b_tx_status.queue, skb) { |
---|
513 | | - ieee80211hdr = (struct ieee80211_hdr *)skb->data; |
---|
| 509 | + skb = NULL; |
---|
| 510 | + skb_queue_reverse_walk(&priv->b_tx_status.queue, iter) { |
---|
| 511 | + ieee80211hdr = (struct ieee80211_hdr *)iter->data; |
---|
514 | 512 | |
---|
515 | 513 | /* |
---|
516 | 514 | * While testing, it was discovered that the seq_no |
---|
.. | .. |
---|
523 | 521 | * it's unlikely we wrongly ack some sent data |
---|
524 | 522 | */ |
---|
525 | 523 | if ((le16_to_cpu(ieee80211hdr->seq_ctrl) |
---|
526 | | - & 0xFFF) == seq_no) |
---|
| 524 | + & 0xFFF) == seq_no) { |
---|
| 525 | + skb = iter; |
---|
527 | 526 | break; |
---|
| 527 | + } |
---|
528 | 528 | } |
---|
529 | | - if (skb != (struct sk_buff *) &priv->b_tx_status.queue) { |
---|
| 529 | + if (skb) { |
---|
530 | 530 | struct ieee80211_tx_info *info = IEEE80211_SKB_CB(skb); |
---|
531 | 531 | |
---|
532 | 532 | __skb_unlink(skb, &priv->b_tx_status.queue); |
---|