mac80211: rt2x00: replace patch with upstream version
[openwrt/openwrt.git] / package / kernel / mac80211 / patches / rt2x00 / 032-rt2x00-do-not-increment-sequence-number-while-re-tra.patch
1 From 746ba11f170603bf1eaade817553a6c2e9135bbe Mon Sep 17 00:00:00 2001
2 From: Vijayakumar Durai <vijayakumar.durai1@vivint.com>
3 Date: Wed, 27 Mar 2019 11:03:17 +0100
4 Subject: [PATCH] rt2x00: do not increment sequence number while
5 re-transmitting
6
7 Currently rt2x00 devices retransmit the management frames with
8 incremented sequence number if hardware is assigning the sequence.
9
10 This is HW bug fixed already for non-QOS data frames, but it should
11 be fixed for management frames except beacon.
12
13 Without fix retransmitted frames have wrong SN:
14
15 AlphaNet_e8:fb:36 Vivotek_52:31:51 Authentication, SN=1648, FN=0, Flags=........C Frame is not being retransmitted 1648 1
16 AlphaNet_e8:fb:36 Vivotek_52:31:51 Authentication, SN=1649, FN=0, Flags=....R...C Frame is being retransmitted 1649 1
17 AlphaNet_e8:fb:36 Vivotek_52:31:51 Authentication, SN=1650, FN=0, Flags=....R...C Frame is being retransmitted 1650 1
18
19 With the fix SN stays correctly the same:
20
21 88:6a:e3:e8:f9:a2 8c:f5:a3:88:76:87 Authentication, SN=1450, FN=0, Flags=........C
22 88:6a:e3:e8:f9:a2 8c:f5:a3:88:76:87 Authentication, SN=1450, FN=0, Flags=....R...C
23 88:6a:e3:e8:f9:a2 8c:f5:a3:88:76:87 Authentication, SN=1450, FN=0, Flags=....R...C
24
25 Cc: stable@vger.kernel.org
26 Signed-off-by: Vijayakumar Durai <vijayakumar.durai1@vivint.com>
27 [sgruszka: simplify code, change comments and changelog]
28 Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com>
29 Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
30 ---
31 drivers/net/wireless/ralink/rt2x00/rt2x00.h | 1 -
32 drivers/net/wireless/ralink/rt2x00/rt2x00mac.c | 10 ----------
33 drivers/net/wireless/ralink/rt2x00/rt2x00queue.c | 15 +++++++++------
34 3 files changed, 9 insertions(+), 17 deletions(-)
35
36 --- a/drivers/net/wireless/ralink/rt2x00/rt2x00.h
37 +++ b/drivers/net/wireless/ralink/rt2x00/rt2x00.h
38 @@ -673,7 +673,6 @@ enum rt2x00_state_flags {
39 CONFIG_CHANNEL_HT40,
40 CONFIG_POWERSAVING,
41 CONFIG_HT_DISABLED,
42 - CONFIG_QOS_DISABLED,
43 CONFIG_MONITORING,
44
45 /*
46 --- a/drivers/net/wireless/ralink/rt2x00/rt2x00mac.c
47 +++ b/drivers/net/wireless/ralink/rt2x00/rt2x00mac.c
48 @@ -642,19 +642,9 @@ void rt2x00mac_bss_info_changed(struct i
49 rt2x00dev->intf_associated--;
50
51 rt2x00leds_led_assoc(rt2x00dev, !!rt2x00dev->intf_associated);
52 -
53 - clear_bit(CONFIG_QOS_DISABLED, &rt2x00dev->flags);
54 }
55
56 /*
57 - * Check for access point which do not support 802.11e . We have to
58 - * generate data frames sequence number in S/W for such AP, because
59 - * of H/W bug.
60 - */
61 - if (changes & BSS_CHANGED_QOS && !bss_conf->qos)
62 - set_bit(CONFIG_QOS_DISABLED, &rt2x00dev->flags);
63 -
64 - /*
65 * When the erp information has changed, we should perform
66 * additional configuration steps. For all other changes we are done.
67 */
68 --- a/drivers/net/wireless/ralink/rt2x00/rt2x00queue.c
69 +++ b/drivers/net/wireless/ralink/rt2x00/rt2x00queue.c
70 @@ -201,15 +201,18 @@ static void rt2x00queue_create_tx_descri
71 if (!rt2x00_has_cap_flag(rt2x00dev, REQUIRE_SW_SEQNO)) {
72 /*
73 * rt2800 has a H/W (or F/W) bug, device incorrectly increase
74 - * seqno on retransmited data (non-QOS) frames. To workaround
75 - * the problem let's generate seqno in software if QOS is
76 - * disabled.
77 + * seqno on retransmitted data (non-QOS) and management frames.
78 + * To workaround the problem let's generate seqno in software.
79 + * Except for beacons which are transmitted periodically by H/W
80 + * hence hardware has to assign seqno for them.
81 */
82 - if (test_bit(CONFIG_QOS_DISABLED, &rt2x00dev->flags))
83 - __clear_bit(ENTRY_TXD_GENERATE_SEQ, &txdesc->flags);
84 - else
85 + if (ieee80211_is_beacon(hdr->frame_control)) {
86 + __set_bit(ENTRY_TXD_GENERATE_SEQ, &txdesc->flags);
87 /* H/W will generate sequence number */
88 return;
89 + }
90 +
91 + __clear_bit(ENTRY_TXD_GENERATE_SEQ, &txdesc->flags);
92 }
93
94 /*