Skip to content
Permalink
Browse files

mac80211: rt2x00: backport accepted and pending patches from upstream

backport from wireless-drivers-next, replacing some existing patches in
our tree (marked with '=' are those which were already present):
 f483039cf51a rt2x00: use simple_read_from_buffer()
=5c656c71b1bf rt2800: move usb specific txdone/txstatus routines to rt2800lib
=0b0d556e0ebb rt2800mmio: use txdone/txstatus routines from lib
=5022efb50f62 rt2x00: do not check for txstatus timeout every time on tasklet
=adf26a356f13 rt2x00: use different txstatus timeouts when flushing
=0240564430c0 rt2800: flush and txstatus rework for rt2800mmio
 6eba8fd22352 rt2x00: rt2400pci: mark expected switch fall-through
 10bb92217747 rt2x00: rt2500pci: mark expected switch fall-through
 916e6bbcfcff rt2x00: rt2800lib: mark expected switch fall-throughs
 641dd8068ecb rt2x00: rt61pci: mark expected switch fall-through
 750afb08ca71 cross-tree: phase out dma_zalloc_coherent()
=c2e28ef7711f rt2x00: reduce tx power to nominal level on RT6352
 a4296994eb80 rt2x00: Work around a firmware bug with shared keys
 2587791d5758 rt2x00: no need to check return value of debugfs_create functions

pending on linux-wireless:
 rt2x00: remove unneeded check
 rt2x00: remove confusing AGC register
 rt2800: enable TX_PIN_CFG_LNA_PE_ bits per band
 rt2800: enable TX_PIN_CFG_RFRX_EN only for MT7620
 rt2800: comment and simplify AGC init for RT6352
 rt2x00: do not print error when queue is full
 rt2800: partially restore old mmio txstatus behaviour
 rt2800: new flush implementation for SoC devices
 rt2800: move txstatus pending routine
 rt2800mmio: fetch tx status changes
 rt2800mmio: use timer and work for handling tx statuses timeouts
 rt2x00: remove last_nostatus_check
 rt2x00: remove not used entry field
 rt2x00mmio: remove legacy comment

While at it also rename some existing patches now that there are
separate folders with patches for each driver to make things a bit
nicer to handle.

Signed-off-by: Daniel Golle <daniel@makrotopia.org>
  • Loading branch information...
dangowrt committed Feb 13, 2019
1 parent 3319637 commit d4c999bb891725b71ae38416cc6d5cfa99938ae4
Showing with 1,516 additions and 201 deletions.
  1. +1 −1 package/kernel/mac80211/Makefile
  2. +59 −0 package/kernel/mac80211/patches/rt2x00/001-rt2x00-use-simple_read_from_buffer.patch
  3. +7 −6 ...done-txstatus-routines-to.patch → 002-rt2800-move-usb-specific-txdone-txstatus-routines-to.patch}
  4. +4 −3 ...ne-txstatus-routines-from-lib.patch → 003-rt2800mmio-use-txdone-txstatus-routines-from-lib.patch}
  5. +6 −5 ...tatus-timeout-every-time-.patch → 004-rt2x00-do-not-check-for-txstatus-timeout-every-time-.patch}
  6. +7 −6 ...us-timeouts-when-flushing.patch → 005-rt2x00-use-different-txstatus-timeouts-when-flushing.patch}
  7. +11 −12 ...txstatus-rework-for-rt2800mmio.patch → 006-rt2800-flush-and-txstatus-rework-for-rt2800mmio.patch}
  8. +25 −0 package/kernel/mac80211/patches/rt2x00/007-rt2x00-rt2400pci-mark-expected-switch-fall-through.patch
  9. +25 −0 package/kernel/mac80211/patches/rt2x00/008-rt2x00-rt2500pci-mark-expected-switch-fall-through.patch
  10. +44 −0 package/kernel/mac80211/patches/rt2x00/009-rt2x00-rt2800lib-mark-expected-switch-fall-throughs.patch
  11. +25 −0 package/kernel/mac80211/patches/rt2x00/010-rt2x00-rt61pci-mark-expected-switch-fall-through.patch
  12. +40 −0 package/kernel/mac80211/patches/rt2x00/011-cross-tree-phase-out-dma_zalloc_coherent.patch
  13. +32 −0 package/kernel/mac80211/patches/rt2x00/012-rt2x00-reduce-tx-power-to-nominal-level-on-RT6352.patch
  14. +143 −0 package/kernel/mac80211/patches/rt2x00/013-rt2x00-Work-around-a-firmware-bug-with-shared-keys.patch
  15. +107 −0 ...age/kernel/mac80211/patches/rt2x00/014-rt2x00-no-need-to-check-return-value-of-debugfs_crea.patch
  16. +136 −0 package/kernel/mac80211/patches/rt2x00/015-rt2x00-remove-unneeded-check.patch
  17. +33 −0 package/kernel/mac80211/patches/rt2x00/016-rt2x00-remove-confusing-AGC-register.patch
  18. +46 −0 package/kernel/mac80211/patches/rt2x00/017-rt2800-enable-TX_PIN_CFG_LNA_PE_-bits-per-band.patch
  19. +40 −0 package/kernel/mac80211/patches/rt2x00/018-rt2800-enable-TX_PIN_CFG_RFRX_EN-only-for-MT7620.patch
  20. +32 −0 package/kernel/mac80211/patches/rt2x00/019-rt2800-comment-and-simplify-AGC-init-for-RT6352.patch
  21. +30 −0 package/kernel/mac80211/patches/rt2x00/020-rt2x00-do-not-print-error-when-queue-is-full.patch
  22. +125 −0 ...age/kernel/mac80211/patches/rt2x00/021-rt2800-partially-restore-old-mmio-txstatus-behaviour.patch
  23. +24 −0 package/kernel/mac80211/patches/rt2x00/022-rt2800-new-flush-implementation-for-SoC-devices.patch
  24. +103 −0 package/kernel/mac80211/patches/rt2x00/023-rt2800-move-txstatus-pending-routine.patch
  25. +58 −0 package/kernel/mac80211/patches/rt2x00/024-rt2800mmio-fetch-tx-status-changes.patch
  26. +191 −0 ...age/kernel/mac80211/patches/rt2x00/025-rt2800mmio-use-timer-and-work-for-handling-tx-status.patch
  27. +54 −0 package/kernel/mac80211/patches/rt2x00/026-rt2x00-remove-last_nostatus_check.patch
  28. +31 −0 package/kernel/mac80211/patches/rt2x00/027-rt2x00-remove-not-used-entry-field.patch
  29. +23 −0 package/kernel/mac80211/patches/rt2x00/028-rt2x00mmio-remove-legacy-comment.patch
  30. 0 package/kernel/mac80211/patches/rt2x00/{030-rt2x00_options.patch → 100-rt2x00_options.patch}
  31. 0 ...-rt2800soc-module-for-RT3883.patch → 501-rt2x00-allow-to-build-rt2800soc-module-for-RT3883.patch}
  32. +1 −1 ...rt2800lib-enable-support-for-RT3883.patch → 502-rt2x00-rt2800lib-enable-support-for-RT3883.patch}
  33. +2 −2 ...t2x00-rt2800lib-add-rf_vals-for-RF3853.patch → 503-rt2x00-rt2800lib-add-rf_vals-for-RF3853.patch}
  34. +2 −2 ...-VCO-calibration-for-RF3853.patch → 504-rt2x00-rt2800lib-enable-VCO-calibration-for-RF3853.patch}
  35. +2 −2 ...l-configuration-function-.patch → 505-rt2x00-rt2800lib-add-channel-configuration-function-.patch}
  36. +1 −1 ...-rt2x00-rt2800lib-enable-RF3853-support.patch → 506-rt2x00-rt2800lib-enable-RF3853-support.patch}
  37. +2 −2 ...gister-initialization-for.patch → 507-rt2x00-rt2800lib-add-MAC-register-initialization-for.patch}
  38. 0 ...soc_disable_radio-for-RT3.patch → 508-rt2x00-rt2800soc-fix-rt2800soc_disable_radio-for-RT3.patch}
  39. +2 −2 ...gister-initialization-for.patch → 509-rt2x00-rt2800lib-add-BBP-register-initialization-for.patch}
  40. +2 −2 ...initialization-for-RT3883.patch → 510-rt2x00-rt2800lib-add-RFCSR-initialization-for-RT3883.patch}
  41. 0 ...tended-EEPROM-map-for-RT3.patch → 511-rt2x00-rt2800lib-use-the-extended-EEPROM-map-for-RT3.patch}
  42. +1 −1 ...rf-type-to-RF3853-on-RT3883.patch → 512-rt2x00-rt2800lib-force-rf-type-to-RF3853-on-RT3883.patch}
  43. +6 −6 ...l-configuration-code-for-.patch → 513-rt2x00-rt2800lib-add-channel-configuration-code-for-.patch}
  44. +1 −1 ...r_to_dev-function-for-RT3.patch → 514-rt2x00-rt2800lib-fix-txpower_to_dev-function-for-RT3.patch}
  45. +1 −1 ...t-txpower-calculation-fun.patch → 515-rt2x00-rt2800lib-use-correct-txpower-calculation-fun.patch}
  46. +2 −2 ...xmixer-gain-values-to-zer.patch → 516-rt2x00-rt2800lib-hardcode-txmixer-gain-values-to-zer.patch}
  47. 0 ...ect-RT-XWI-size-for-RT3883.patch → 517-rt2x00-rt2800lib-use-correct-RT-XWI-size-for-RT3883.patch}
  48. +1 −1 ...a-configuration-for-RT388.patch → 518-rt2x00-rt2800lib-fix-antenna-configuration-for-RT388.patch}
  49. +2 −2 ...in-configuration-for-RT38.patch → 519-rt2x00-rt2800lib-fix-LNA-gain-configuration-for-RT38.patch}
  50. +3 −3 ...0-rt2800lib-fix-VGC-setup-for-RT3883.patch → 520-rt2x00-rt2800lib-fix-VGC-setup-for-RT3883.patch}
  51. +3 −3 ...-LNA-validation-for-RT388.patch → 521-rt2x00-rt2800lib-fix-EEPROM-LNA-validation-for-RT388.patch}
  52. +1 −1 ...r-compensation-for-RT3883.patch → 522-rt2x00-rt2800lib-fix-txpower-compensation-for-RT3883.patch}
  53. +4 −4 package/kernel/mac80211/patches/rt2x00/602-rt2x00-introduce-rt2x00eeprom.patch
  54. +1 −1 package/kernel/mac80211/patches/rt2x00/610-rt2x00-change-led-polarity-from-OF.patch
  55. +3 −3 package/kernel/mac80211/patches/rt2x00/650-rt2x00-add-support-for-external-PA-on-MT7620.patch
  56. +1 −1 package/kernel/mac80211/patches/rt2x00/651-rt2x00-remove-unneccesary-code.patch
  57. +2 −2 package/kernel/mac80211/patches/rt2x00/982-rt2x00-add-rf-self-txdc-calibration.patch
  58. +2 −2 package/kernel/mac80211/patches/rt2x00/983-rt2x00-add-r-calibration.patch
  59. +2 −2 package/kernel/mac80211/patches/rt2x00/984-rt2x00-add-rxdcoc-calibration.patch
  60. +2 −2 package/kernel/mac80211/patches/rt2x00/985-rt2x00-add-rxiq-calibration.patch
  61. +2 −2 package/kernel/mac80211/patches/rt2x00/986-rt2x00-add-TX-LOFT-calibration.patch
  62. +0 −114 package/kernel/mac80211/patches/rt2x00/987-rt2x00-reduce-tx-power-to-nominal-level-on-RT6352.patch
@@ -11,7 +11,7 @@ include $(INCLUDE_DIR)/kernel.mk
PKG_NAME:=mac80211

PKG_VERSION:=4.19.23-1
PKG_RELEASE:=1
PKG_RELEASE:=2
PKG_SOURCE_URL:=@KERNEL/linux/kernel/projects/backports/stable/v4.19.23/
PKG_HASH:=703e940b542eb56067fcd847a7c69398dcc9829f34472647eea4211cb2ab3b83

@@ -0,0 +1,59 @@
From f483039cf51acf30494cd754194562c22cf98764 Mon Sep 17 00:00:00 2001
From: Dan Carpenter <dan.carpenter@oracle.com>
Date: Wed, 22 Aug 2018 13:41:26 +0300
Subject: [PATCH 01/28] rt2x00: use simple_read_from_buffer()

The problem with this copy_to_user() calls is that they don't ensure
that "size" is less than the "length" which the user provided.

Obviously, this is debugfs and "size" is normally going to be very small
so it probably doesn't matter, but this is the correct thing to do.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Acked-by: Stanislaw Gruszka <sgruszka@redhat.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
---
.../net/wireless/ralink/rt2x00/rt2x00debug.c | 18 +++---------------
1 file changed, 3 insertions(+), 15 deletions(-)

--- a/drivers/net/wireless/ralink/rt2x00/rt2x00debug.c
+++ b/drivers/net/wireless/ralink/rt2x00/rt2x00debug.c
@@ -464,11 +464,7 @@ static ssize_t rt2x00debug_read_##__name
\
size = sprintf(line, __format, value); \
\
- if (copy_to_user(buf, line, size)) \
- return -EFAULT; \
- \
- *offset += size; \
- return size; \
+ return simple_read_from_buffer(buf, length, offset, line, size); \
}

#define RT2X00DEBUGFS_OPS_WRITE(__name, __type) \
@@ -545,11 +541,7 @@ static ssize_t rt2x00debug_read_dev_flag

size = sprintf(line, "0x%.8x\n", (unsigned int)intf->rt2x00dev->flags);

- if (copy_to_user(buf, line, size))
- return -EFAULT;
-
- *offset += size;
- return size;
+ return simple_read_from_buffer(buf, length, offset, line, size);
}

static const struct file_operations rt2x00debug_fop_dev_flags = {
@@ -574,11 +566,7 @@ static ssize_t rt2x00debug_read_cap_flag

size = sprintf(line, "0x%.8x\n", (unsigned int)intf->rt2x00dev->cap_flags);

- if (copy_to_user(buf, line, size))
- return -EFAULT;
-
- *offset += size;
- return size;
+ return simple_read_from_buffer(buf, length, offset, line, size);
}

static const struct file_operations rt2x00debug_fop_cap_flags = {
@@ -1,13 +1,14 @@
From 0381bfbc400ce4c3000b0b31c577ad9e8071e4f6 Mon Sep 17 00:00:00 2001
From 5c656c71b1bf5611ce8262bab338104e04d10b8d Mon Sep 17 00:00:00 2001
From: Stanislaw Gruszka <sgruszka@redhat.com>
Date: Fri, 18 May 2018 12:25:08 +0200
Subject: [PATCH 1/5] rt2800: move usb specific txdone/txstatus routines to
Date: Wed, 26 Sep 2018 12:24:53 +0200
Subject: [PATCH 02/28] rt2800: move usb specific txdone/txstatus routines to
rt2800lib

In order to reuse usb txdone/txstatus routines for mmio, move them
to common rt2800lib.c file.

Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
---
.../net/wireless/ralink/rt2x00/rt2800lib.c | 138 +++++++++++++++++
.../net/wireless/ralink/rt2x00/rt2800lib.h | 3 +
@@ -16,7 +17,7 @@ Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com>

--- a/drivers/net/wireless/ralink/rt2x00/rt2800lib.c
+++ b/drivers/net/wireless/ralink/rt2x00/rt2800lib.c
@@ -960,6 +960,47 @@ static void rt2800_rate_from_status(stru
@@ -957,6 +957,47 @@ static void rt2800_rate_from_status(stru
skbdesc->tx_rate_flags = flags;
}

@@ -64,7 +65,7 @@ Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com>
void rt2800_txdone_entry(struct queue_entry *entry, u32 status, __le32 *txwi,
bool match)
{
@@ -1062,6 +1103,103 @@ void rt2800_txdone_entry(struct queue_en
@@ -1059,6 +1100,103 @@ void rt2800_txdone_entry(struct queue_en
}
EXPORT_SYMBOL_GPL(rt2800_txdone_entry);

@@ -170,7 +171,7 @@ Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com>
{
--- a/drivers/net/wireless/ralink/rt2x00/rt2800lib.h
+++ b/drivers/net/wireless/ralink/rt2x00/rt2800lib.h
@@ -206,6 +206,9 @@ void rt2800_process_rxwi(struct queue_en
@@ -195,6 +195,9 @@ void rt2800_process_rxwi(struct queue_en

void rt2800_txdone_entry(struct queue_entry *entry, u32 status, __le32 *txwi,
bool match);
@@ -1,7 +1,7 @@
From 7993486bbab17f8916993710a8660eb47fd991e9 Mon Sep 17 00:00:00 2001
From 0b0d556e0ebb6c966bc993e21a22a156812d8fdf Mon Sep 17 00:00:00 2001
From: Stanislaw Gruszka <sgruszka@redhat.com>
Date: Mon, 9 Jul 2018 16:07:42 +0200
Subject: [PATCH 2/5] rt2800mmio: use txdone/txstatus routines from lib
Date: Wed, 26 Sep 2018 12:24:54 +0200
Subject: [PATCH 03/28] rt2800mmio: use txdone/txstatus routines from lib

Use usb txdone/txstatus routines (now in rt2800libc) for mmio devices.

@@ -14,6 +14,7 @@ allow to miss some tx statuses. However this will be improved in further
patch where I also implement read status FIFO register in the tasklet.

Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
---
.../net/wireless/ralink/rt2x00/rt2800mmio.c | 180 +-----------------
.../net/wireless/ralink/rt2x00/rt2x00queue.c | 1 +
@@ -1,13 +1,14 @@
From b5d6e37ea15949a126907050d8cfa4408153a0cd Mon Sep 17 00:00:00 2001
From 5022efb50f625d11fdf18b1fee0f64ebb1863664 Mon Sep 17 00:00:00 2001
From: Stanislaw Gruszka <sgruszka@redhat.com>
Date: Fri, 18 May 2018 12:25:10 +0200
Subject: [PATCH 3/5] rt2x00: do not check for txstatus timeout every time on
Date: Wed, 26 Sep 2018 12:24:55 +0200
Subject: [PATCH 04/28] rt2x00: do not check for txstatus timeout every time on
tasklet

Do not check for tx status timeout everytime we perform txstatus tasklet.
Perform check once per half a second.

Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
---
drivers/net/wireless/ralink/rt2x00/rt2800lib.c | 7 +++++++
drivers/net/wireless/ralink/rt2x00/rt2800mmio.c | 3 ++-
@@ -17,7 +18,7 @@ Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com>

--- a/drivers/net/wireless/ralink/rt2x00/rt2800lib.c
+++ b/drivers/net/wireless/ralink/rt2x00/rt2800lib.c
@@ -1161,11 +1161,18 @@ bool rt2800_txstatus_timeout(struct rt2x
@@ -1158,11 +1158,18 @@ bool rt2800_txstatus_timeout(struct rt2x
struct data_queue *queue;
struct queue_entry *entry;

@@ -50,7 +51,7 @@ Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com>
rt2800mmio_enable_interrupt(rt2x00dev,
--- a/drivers/net/wireless/ralink/rt2x00/rt2x00.h
+++ b/drivers/net/wireless/ralink/rt2x00/rt2x00.h
@@ -988,6 +988,8 @@ struct rt2x00_dev {
@@ -980,6 +980,8 @@ struct rt2x00_dev {
*/
DECLARE_KFIFO_PTR(txstatus_fifo, u32);

@@ -1,7 +1,7 @@
From feb87977b6d251fb01a329905719e45908f6c939 Mon Sep 17 00:00:00 2001
From adf26a356f132e35093585521ea3e36cd185af83 Mon Sep 17 00:00:00 2001
From: Stanislaw Gruszka <sgruszka@redhat.com>
Date: Fri, 10 Aug 2018 12:31:55 +0200
Subject: [PATCH 4/5] rt2x00: use different txstatus timeouts when flushing
Date: Wed, 26 Sep 2018 12:24:56 +0200
Subject: [PATCH 05/28] rt2x00: use different txstatus timeouts when flushing

Use different tx status timeouts for normal operation and when flushing.
This increase timeout to 2s for normal operation as when there are bad
@@ -10,6 +10,7 @@ the status for quite long. With new timeout we can still get valid status
on such bad conditions.

Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
---
.../net/wireless/ralink/rt2x00/rt2800lib.c | 31 +++++++++++++------
drivers/net/wireless/ralink/rt2x00/rt2x00.h | 1 +
@@ -18,7 +19,7 @@ Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com>

--- a/drivers/net/wireless/ralink/rt2x00/rt2800lib.c
+++ b/drivers/net/wireless/ralink/rt2x00/rt2800lib.c
@@ -1140,36 +1140,47 @@ void rt2800_txdone(struct rt2x00_dev *rt
@@ -1137,36 +1137,47 @@ void rt2800_txdone(struct rt2x00_dev *rt
}
EXPORT_SYMBOL_GPL(rt2800_txdone);

@@ -75,7 +76,7 @@ Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com>
return true;
}

@@ -1198,7 +1209,7 @@ void rt2800_txdone_nostatus(struct rt2x0
@@ -1195,7 +1206,7 @@ void rt2800_txdone_nostatus(struct rt2x0
break;

if (test_bit(ENTRY_DATA_IO_FAILED, &entry->flags) ||
@@ -86,7 +87,7 @@ Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com>
break;
--- a/drivers/net/wireless/ralink/rt2x00/rt2x00.h
+++ b/drivers/net/wireless/ralink/rt2x00/rt2x00.h
@@ -667,6 +667,7 @@ enum rt2x00_state_flags {
@@ -665,6 +665,7 @@ enum rt2x00_state_flags {
DEVICE_STATE_STARTED,
DEVICE_STATE_ENABLED_RADIO,
DEVICE_STATE_SCANNING,
@@ -1,22 +1,23 @@
From 0d9fbb738a5eadc7abc8060f43ebcc71f6324c07 Mon Sep 17 00:00:00 2001
From 0240564430c0697d8fde3743d70346a922466b36 Mon Sep 17 00:00:00 2001
From: Stanislaw Gruszka <sgruszka@redhat.com>
Date: Tue, 14 Aug 2018 08:58:48 +0200
Subject: [PATCH 5/5] rt2800: flush and txstatus rework for rt2800mmio
Date: Wed, 26 Sep 2018 12:24:57 +0200
Subject: [PATCH 06/28] rt2800: flush and txstatus rework for rt2800mmio

Implement custom rt2800mmio flush routine and change txstatus
routine to read TX_STA_FIFO also in the tasklet.

Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
---
.../net/wireless/ralink/rt2x00/rt2800lib.c | 14 +-
.../net/wireless/ralink/rt2x00/rt2800mmio.c | 120 +++++++++++++-----
.../net/wireless/ralink/rt2x00/rt2800lib.c | 14 +--
.../net/wireless/ralink/rt2x00/rt2800mmio.c | 118 +++++++++++++-----
.../net/wireless/ralink/rt2x00/rt2800mmio.h | 1 +
.../net/wireless/ralink/rt2x00/rt2800pci.c | 2 +-
4 files changed, 99 insertions(+), 38 deletions(-)
4 files changed, 97 insertions(+), 38 deletions(-)

--- a/drivers/net/wireless/ralink/rt2x00/rt2800lib.c
+++ b/drivers/net/wireless/ralink/rt2x00/rt2800lib.c
@@ -1150,7 +1150,7 @@ static inline bool rt2800_entry_txstatus
@@ -1147,7 +1147,7 @@ static inline bool rt2800_entry_txstatus
return false;

if (test_bit(DEVICE_STATE_FLUSHING, &rt2x00dev->flags))
@@ -25,7 +26,7 @@ Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com>
else
tout = msecs_to_jiffies(2000);

@@ -1166,15 +1166,13 @@ bool rt2800_txstatus_timeout(struct rt2x
@@ -1163,15 +1163,13 @@ bool rt2800_txstatus_timeout(struct rt2x
{
struct data_queue *queue;
struct queue_entry *entry;
@@ -160,7 +161,7 @@ Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com>

if (rt2x00_get_field32(reg, INT_SOURCE_CSR_PRE_TBTT))
tasklet_hi_schedule(&rt2x00dev->pretbtt_tasklet);
@@ -453,6 +466,55 @@ void rt2800mmio_kick_queue(struct data_q
@@ -453,6 +466,53 @@ void rt2800mmio_kick_queue(struct data_q
}
EXPORT_SYMBOL_GPL(rt2800mmio_kick_queue);

@@ -170,8 +171,6 @@ Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com>
+ bool tx_queue = false;
+ unsigned int i;
+
+ //printk("FLUSH queue %d len %d drop %d\n", queue->qid, queue->length, drop);
+
+ switch (queue->qid) {
+ case QID_AC_VO:
+ case QID_AC_VI:
@@ -202,7 +201,7 @@ Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com>
+ tasklet_disable(&rt2x00dev->txstatus_tasklet);
+ rt2800mmio_txdone(rt2x00dev);
+ tasklet_enable(&rt2x00dev->txstatus_tasklet);
+ }
+ }
+
+ /*
+ * Wait for a little while to give the driver
@@ -0,0 +1,25 @@
From 6eba8fd2235237784dfd01da55c3210d493aebdb Mon Sep 17 00:00:00 2001
From: "Gustavo A. R. Silva" <gustavo@embeddedor.com>
Date: Mon, 22 Oct 2018 22:44:34 +0200
Subject: [PATCH 07/28] rt2x00: rt2400pci: mark expected switch fall-through

In preparation to enabling -Wimplicit-fallthrough, mark switch cases
where we are expecting to fall through.

Signed-off-by: Gustavo A. R. Silva <gustavo@embeddedor.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
---
drivers/net/wireless/ralink/rt2x00/rt2400pci.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

--- a/drivers/net/wireless/ralink/rt2x00/rt2400pci.c
+++ b/drivers/net/wireless/ralink/rt2x00/rt2400pci.c
@@ -1302,7 +1302,7 @@ static void rt2400pci_txdone(struct rt2x
break;
case 2: /* Failure, excessive retries */
__set_bit(TXDONE_EXCESSIVE_RETRY, &txdesc.flags);
- /* Don't break, this is a failed frame! */
+ /* Fall through - this is a failed frame! */
default: /* Failure */
__set_bit(TXDONE_FAILURE, &txdesc.flags);
}
@@ -0,0 +1,25 @@
From 10bb92217747c3384a01ebec005faa2f5e72bbd8 Mon Sep 17 00:00:00 2001
From: "Gustavo A. R. Silva" <gustavo@embeddedor.com>
Date: Mon, 22 Oct 2018 22:45:19 +0200
Subject: [PATCH 08/28] rt2x00: rt2500pci: mark expected switch fall-through

In preparation to enabling -Wimplicit-fallthrough, mark switch cases
where we are expecting to fall through.

Signed-off-by: Gustavo A. R. Silva <gustavo@embeddedor.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
---
drivers/net/wireless/ralink/rt2x00/rt2500pci.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

--- a/drivers/net/wireless/ralink/rt2x00/rt2500pci.c
+++ b/drivers/net/wireless/ralink/rt2x00/rt2500pci.c
@@ -1430,7 +1430,7 @@ static void rt2500pci_txdone(struct rt2x
break;
case 2: /* Failure, excessive retries */
__set_bit(TXDONE_EXCESSIVE_RETRY, &txdesc.flags);
- /* Don't break, this is a failed frame! */
+ /* Fall through - this is a failed frame! */
default: /* Failure */
__set_bit(TXDONE_FAILURE, &txdesc.flags);
}
@@ -0,0 +1,44 @@
From 916e6bbcfcff6cc5d7d33bba8557a30f3af50326 Mon Sep 17 00:00:00 2001
From: "Gustavo A. R. Silva" <gustavo@embeddedor.com>
Date: Mon, 22 Oct 2018 22:46:03 +0200
Subject: [PATCH 09/28] rt2x00: rt2800lib: mark expected switch fall-throughs

In preparation to enabling -Wimplicit-fallthrough, mark switch cases
where we are expecting to fall through.

Addresses-Coverity-ID: 145198 ("Missing break in switch")
Signed-off-by: Gustavo A. R. Silva <gustavo@embeddedor.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
---
drivers/net/wireless/ralink/rt2x00/rt2800lib.c | 4 ++++
1 file changed, 4 insertions(+)

--- a/drivers/net/wireless/ralink/rt2x00/rt2800lib.c
+++ b/drivers/net/wireless/ralink/rt2x00/rt2800lib.c
@@ -2482,6 +2482,7 @@ static void rt2800_config_channel_rf3052
switch (rt2x00dev->default_ant.tx_chain_num) {
case 1:
rt2x00_set_field8(&rfcsr, RFCSR1_TX1_PD, 1);
+ /* fall through */
case 2:
rt2x00_set_field8(&rfcsr, RFCSR1_TX2_PD, 1);
break;
@@ -2490,6 +2491,7 @@ static void rt2800_config_channel_rf3052
switch (rt2x00dev->default_ant.rx_chain_num) {
case 1:
rt2x00_set_field8(&rfcsr, RFCSR1_RX1_PD, 1);
+ /* fall through */
case 2:
rt2x00_set_field8(&rfcsr, RFCSR1_RX2_PD, 1);
break;
@@ -9457,8 +9459,10 @@ static int rt2800_probe_hw_mode(struct r
switch (rx_chains) {
case 3:
spec->ht.mcs.rx_mask[2] = 0xff;
+ /* fall through */
case 2:
spec->ht.mcs.rx_mask[1] = 0xff;
+ /* fall through */
case 1:
spec->ht.mcs.rx_mask[0] = 0xff;
spec->ht.mcs.rx_mask[4] = 0x1; /* MCS32 */

0 comments on commit d4c999b

Please sign in to comment.
You can’t perform that action at this time.