2
0

032-rt2x00-do-not-increment-sequence-number-while-re-tra.patch 3.7 KB

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