[OpenWrt-Devel] [PATCH] mac80211: Update to version 5.2-rc7

Hauke Mehrtens hauke at hauke-m.de
Sun Jul 7 13:04:11 EDT 2019


This updates mac80211 to version 5.2-rc7, this contains all the changes
to the wireless subsystem up to Linux 5.2-rc7.

* The removed patches are applied upstream
* b43 now uses kmod-lib-cordic
* Update the nl80211.h file in iw to match backports version.
* Remove the two backports from kernel 4.9, they were needed for mt76,
  but that can use the version from backports now, otherwise they
  collide and cause compile errors.

Signed-off-by: Hauke Mehrtens <hauke at hauke-m.de>
---

This patch is also available in my git tree at:
https://git.openwrt.org/?p=openwrt/staging/hauke.git;a=shortlog;h=refs/heads/mac80211-5.2

I plan to create a backports-5.3-rcX release in about 4 weeks and would 
like to use that also in OpenWrt master after it was released. I think 
backports-5.2-rc7-1 should already be integrated, so we can already the 
new changes.

OpenWrt 19.07 will get an update to backports-4.19.57.


 package/kernel/mac80211/Makefile              |    8 +-
 package/kernel/mac80211/broadcom.mk           |    2 +-
 .../patches/ath/070-ath_common_config.patch   |    3 +-
 .../ath/080-ath10k_thermal_config.patch       |    4 +-
 ...erpret-requested-txpower-in-EIRP-dom.patch |    4 +-
 ...power-reduction-for-US-regulatory-do.patch |    2 +-
 ...fix-tx99-with-monitor-mode-interface.patch |   92 -
 ...upport-for-using-active-monitor-inte.patch |   96 -
 .../patches/ath/402-ath_regd_optional.patch   |    2 +-
 .../patches/ath/404-regd_no_assoc_hints.patch |   10 +-
 .../patches/ath/405-ath_regd_us.patch         |    4 +-
 .../407-regd_add_extra_country_codes.patch    |   35 -
 .../ath/410-ath9k_allow_adhoc_and_ap.patch    |    2 +-
 .../ath/411-ath5k_allow_adhoc_and_ap.patch    |    6 +-
 .../ath/500-ath9k_eeprom_debugfs.patch        |    4 +-
 .../patches/ath/501-ath9k_ahb_init.patch      |    2 +-
 .../ath/512-ath9k_channelbw_debugfs.patch     |    4 +-
 .../patches/ath/530-ath9k_extra_leds.patch    |   16 +-
 .../patches/ath/542-ath9k_debugfs_diag.patch  |    4 +-
 .../ath/543-ath9k_entropy_from_adc.patch      |   12 +-
 .../patches/ath/545-ath9k_ani_ws_detect.patch |    2 +-
 .../ath/548-ath9k_enable_gpio_chip.patch      |    4 +-
 .../ath/549-ath9k_enable_gpio_buttons.patch   |    2 +-
 .../ath/551-ath9k_ubnt_uap_plus_hsr.patch     |    2 +-
 .../mac80211/patches/ath/552-ahb_of.patch     |    2 +-
 ...ve-debug-log-after-buffer-increments.patch |   88 -
 ...ath9k-dynack-remove-experimental-tag.patch |   22 -
 ...21-ath10k_init_devices_synchronously.patch |    4 +-
 .../ath/930-ath10k_add_tpt_led_trigger.patch  |    6 +-
 ...0-0010-ath10k-limit-htt-rx-ring-size.patch |    2 +-
 ...60-0011-ath10k-limit-pci-buffer-size.patch |    8 +-
 ...-of-peer_bw_rxnss_override-parameter.patch |   10 +-
 ...dling-for-VHT160-in-recent-firmwares.patch |    4 +-
 ...rolling-support-for-various-chipsets.patch |   72 +-
 ...75-ath10k-use-tpt-trigger-by-default.patch |    8 +-
 ...ilable-channels-via-DT-ieee80211-fre.patch |   39 -
 ...rt-for-configuring-management-packet.patch |   89 -
 ...ble-out-of-bound-access-of-ath10k_ra.patch |   66 -
 ...rect-multicast-broadcast-rate-settin.patch |    6 +-
 ...980-ath10k-fix-max-antenna-gain-unit.patch |    6 +-
 ...-power-reduction-for-US-regulatory-d.patch |   10 +-
 .../patches/brcm/040-brcmutil_option.patch    |    3 +-
 ...cmfmac-add-CYW89342-mini-PCIe-device.patch |   25 -
 ...001-brcmfmac-fix-wrong-strnchr-usage.patch |   38 -
 ...e-buffer-for-obtaining-firmware-capa.patch |   28 -
 ...set-but-not-used-variables-sfdoff-an.patch |   57 -
 ...reduce-timeout-for-action-frame-scan.patch |   67 -
 ...l-timeout-waiting-for-action-frame-o.patch |   79 -
 ...ve-firmware-loading-code-duplication.patch |  102 -
 ...recursion-from-firmware-load-error-h.patch |  127 -
 ...port-for-first-trying-to-get-a-board.patch |   77 -
 ...rd_type-used-for-nvram-file-selectio.patch |   77 -
 ...rd_type-from-DMI-on-x86-based-machin.patch |  179 --
 ...cmfmac-Cleanup-brcmf_fw_request_done.patch |   41 -
 ...port-for-getting-nvram-contents-from.patch |  132 -
 ...-ccode-from-EFI-nvram-when-necessary.patch |   97 -
 ...elling-mistake-Retreiving-Retrieving.patch |   34 -
 ...print-invalid-chanspec-when-WARN-ing.patch |   83 -
 ...-brcmfmac-support-STA-info-struct-v7.patch |   80 -
 ...rcmf_dmi_probe-before-brcmf_of_probe.patch |   39 -
 ...-add-credit-numbers-updating-support.patch |   95 -
 ...frameburst-mode-in-default-firmware-.patch |   42 -
 ...c-handle-compressed-tx-status-signal.patch |  229 --
 ...brcmfmac-add-4354-raw-pcie-device-id.patch |   36 -
 ...mac-set-F2-watermark-to-256-for-4373.patch |   73 -
 ...-set-SDIO-F1-MesBusyCtrl-for-CYW4373.patch |   55 -
 ...dd-support-for-CYW43012-SDIO-chipset.patch |  253 --
 ...-brcmfmac-allow-GCI-core-enumuration.patch |   60 -
 ...43012-F2-watermark-setting-to-fix-DM.patch |   49 -
 ...7-brcmfmac-4373-save-restore-support.patch |   57 -
 ...c-disable-command-decode-in-sdio_aos.patch |   45 -
 ...se-positive-Wmaybe-unintialized-warn.patch |   34 -
 ...-0001-brcmfmac-Fix-access-point-mode.patch |   41 -
 ...-nvram-filename-quirk-for-PoV-TAB-P1.patch |   51 -
 ...check-for-the-status-of-usb_register.patch |   28 -
 ...tem-warning-message-during-wowl-susp.patch |   33 -
 ...__brcmf_err-to-take-bus-as-a-paramet.patch |  104 -
 ...ass-bus-to-the-__brcmf_err-in-pcie.c.patch |  266 --
 ...phy_err-and-use-it-in-the-cfg80211.c.patch | 2025 ---------------
 .../brcm/347-v5.1-brcmfmac-fix-typos.patch    |   62 -
 ...-monitor-frames-with-the-hardware-uc.patch |  143 -
 ...SSID-length-from-firmware-is-limited.patch |   28 -
 ...type-check-for-event-handling-in-dat.patch |   96 -
 ...debugfs-files-for-bus-specific-layer.patch |  101 -
 ...able-MBSS-feature-for-bcm4330-device.patch |   41 -
 ...and-dump-trap-info-during-sdio-probe.patch |  121 -
 ...pname-in-brcmf_fw_alloc_request-for-.patch |   42 -
 ...firmware-reported-ring-status-errors.patch |   67 -
 ...-code-handling-bandwidth-of-firmware.patch |   42 -
 ...-firmware-reporting-160-MHz-channels.patch |   30 -
 ...bphy_err-to-take-struct-brcmf_pub-ar.patch | 2290 -----------------
 ...-set-but-not-used-variable-old_state.patch |   38 -
 ...e-bphy_err-in-all-wiphy-related-code.patch | 1707 ------------
 ...sic-validation-of-shared-RAM-address.patch |   38 -
 ...ize-of-the-struct-msgbuf_ring_status.patch |   29 -
 ...irmware-reported-general-status-erro.patch |   69 -
 ...-repeated-brcmf_fw_alloc_request-cal.patch |   32 -
 ...unction-designated-for-handling-firm.patch |   79 -
 ...c-reset-PCIe-bus-on-a-firmware-crash.patch |  153 --
 ...NING-during-USB-disconnect-in-case-o.patch |  124 -
 ...L-pointer-derefence-during-USB-disco.patch |  217 --
 ...e-during-disconnect-when-USB-complet.patch |   84 -
 ...pending-parameter-from-brcmf_usb_fre.patch |   54 -
 ...unused-variable-i-from-brcmf_usb_fre.patch |   29 -
 ...s-when-bringing-up-interface-during-.patch |  123 -
 ...rt-dev_init_lock-mutex-to-completion.patch |  182 --
 ...mfmac-fix-missing-checks-for-kmemdup.patch |   35 -
 ...-brcmfmac-Use-struct_size-in-kzalloc.patch |   53 -
 ...g-the-correct-firmware-for-brcm43456.patch |   35 -
 ...x-leak-of-mypkt-on-error-return-path.patch |   41 -
 ...-nvram-filename-quirk-for-ACEPC-T8-a.patch |   70 -
 ...ilbox-interrupt-twice-for-specific-h.patch |   32 -
 ...send-mailbox-interrupt-twice-for-spe.patch |   30 -
 ...ilbox-interrupt-twice-for-specific-h.patch |   39 -
 ...ial-NULL-dereference-in-brcmf_cfg802.patch |   50 -
 ...low-request-id-from-1-to-pktids-arra.patch |   49 -
 ...irmware-messages-after-a-firmware-cr.patch |   90 -
 .../810-b43-gpio-mask-module-option.patch     |    4 +-
 .../patches/brcm/811-b43_no_pio.patch         |    4 +-
 .../brcm/812-b43-add-antenna-control.patch    |   18 +-
 .../814-b43-only-use-gpio-0-1-for-led.patch   |    2 +-
 ...815-b43-always-take-overlapping-devs.patch |    2 +-
 ...62-brcmfmac-Disable-power-management.patch |    2 +-
 .../patches/build/015-ipw200-mtu.patch        |    4 +-
 .../patches/build/050-lib80211_option.patch   |    4 +-
 .../patches/build/060-no_local_ssb_bcma.patch |   28 +-
 ...700-mwl8k-missing-pci-id-for-WNR854T.patch |    2 +-
 .../801-libertas-configure-sysfs-links.patch  |    2 +-
 ...940-mwl8k_init_devices_synchronously.patch |    4 +-
 .../941-mwl8k-Fix-rate_idx-underflow.patch    |   75 -
 ...1-rt2x00-use-simple_read_from_buffer.patch |   59 -
 ...specific-txdone-txstatus-routines-to.patch |  357 ---
 ...se-txdone-txstatus-routines-from-lib.patch |  244 --
 ...eck-for-txstatus-timeout-every-time-.patch |   72 -
 ...rent-txstatus-timeouts-when-flushing.patch |  112 -
 ...h-and-txstatus-rework-for-rt2800mmio.patch |  238 --
 ...ci-mark-expected-switch-fall-through.patch |   25 -
 ...ci-mark-expected-switch-fall-through.patch |   25 -
 ...b-mark-expected-switch-fall-throughs.patch |   44 -
 ...ci-mark-expected-switch-fall-through.patch |   25 -
 ...s-tree-phase-out-dma_zalloc_coherent.patch |   40 -
 ...-tx-power-to-nominal-level-on-RT6352.patch |   32 -
 ...ound-a-firmware-bug-with-shared-keys.patch |  143 -
 ...o-check-return-value-of-debugfs_crea.patch |  107 -
 .../015-rt2x00-remove-unneeded-check.patch    |  137 -
 ...rt2x00-remove-confusing-AGC-register.patch |   34 -
 ...ble-TX_PIN_CFG_LNA_PE_-bits-per-band.patch |   47 -
 ...e-TX_PIN_CFG_RFRX_EN-only-for-MT7620.patch |   41 -
 ...ent-and-simplify-AGC-init-for-RT6352.patch |   33 -
 ...ratelimited-variants-of-err-and-warn.patch |   39 -
 ...atelimited-variants-dev_warn-dev_err.patch |   42 -
 ...rt2x00-check-number-of-EPROTO-errors.patch |   96 -
 ...o-not-print-error-when-queue-is-full.patch |   43 -
 ...-restore-old-mmio-txstatus-behaviour.patch |  128 -
 ...flush-implementation-for-SoC-devices.patch |   27 -
 ...rt2800-move-txstatus-pending-routine.patch |  106 -
 ...7-rt2800mmio-fetch-tx-status-changes.patch |   61 -
 ...imer-and-work-for-handling-tx-status.patch |  194 --
 ...29-rt2x00-remove-last_nostatus_check.patch |   57 -
 ...0-rt2x00-remove-not-used-entry-field.patch |   34 -
 ...031-rt2x00mmio-remove-legacy-comment.patch |   26 -
 ...crement-sequence-number-while-re-tra.patch |   94 -
 .../050-rt2x00-add-RT3883-support.patch       |  959 -------
 .../patches/rt2x00/100-rt2x00_options.patch   |    2 +-
 ...to-build-rt2800soc-module-for-RT3883.patch |    4 +-
 ...1-rt2x00-introduce-rt2x00_platform_h.patch |    2 +-
 .../602-rt2x00-introduce-rt2x00eeprom.patch   |   28 +-
 ...om-on-SoC-from-a-mtd-device-defines-.patch |    2 +-
 ...isabling_bands_through_platform_data.patch |    4 +-
 ...07-rt2x00-add_platform_data_mac_addr.patch |    4 +-
 ...00-allow_disabling_bands_through_dts.patch |    2 +-
 ...c-loadable-via-OF-on-rt288x-305x-SoC.patch |    2 +-
 ...0-rt2x00-change-led-polarity-from-OF.patch |    6 +-
 .../611-rt2x00-add-AP+STA-support.patch       |    2 +-
 ...dd-support-for-external-PA-on-MT7620.patch |    8 +-
 ...-rt2x00-add-rf-self-txdc-calibration.patch |    8 +-
 .../rt2x00/983-rt2x00-add-r-calibration.patch |    8 +-
 .../984-rt2x00-add-rxdcoc-calibration.patch   |    8 +-
 .../985-rt2x00-add-rxiq-calibration.patch     |    8 +-
 .../986-rt2x00-add-TX-LOFT-calibration.patch  |   10 +-
 .../100-remove-cryptoapi-dependencies.patch   |   49 +-
 .../110-mac80211_keep_keys_on_stop_ap.patch   |    4 +-
 .../120-cfg80211_allow_perm_addr_change.patch |    2 +-
 .../patches/subsys/130-disable-fils.patch     |    4 +-
 ...aes-cmac-switch-to-shash-CMAC-driver.patch |    6 +-
 .../132-mac80211-remove-cmac-dependency.patch |    2 +-
 .../subsys/140-tweak-TSQ-setting.patch        |    2 +-
 .../subsys/150-disable_addr_notifier.patch    |   10 +-
 .../mac80211/patches/subsys/210-ap_scan.patch |    2 +-
 ...d-stop-start-logic-for-software-TXQs.patch |  272 --
 ...call-driver-wake_tx_queue-op-during-.patch |   33 -
 ...l-Enable-STBC-and-LDPC-for-VHT-Rates.patch |   82 -
 ...l-remove-unnecessary-debugfs-cleanup.patch |  150 --
 ...l-merge-with-minstrel_ht-always-enab.patch |  575 -----
 ...trel-reduce-minstrel_mcs_groups-size.patch |  368 ---
 ...l-fix-using-short-preamble-CCK-rates.patch |   31 -
 ...rel-fix-CCK-rate-group-streams-value.patch |   20 -
 ...l-fix-sampling-reporting-of-CCK-rate.patch |   58 -
 ...l-do-not-sample-rates-3-times-slower.patch |   40 -
 ...ory-accounting-with-A-MSDU-aggregati.patch |   58 -
 ...l_ht-add-flag-to-indicate-missing-in.patch |  122 -
 ...ligned-access-in-mesh-table-hash-fun.patch |   21 -
 .../320-mac80211-Add-TXQ-scheduling-API.patch |  292 ---
 ...-Add-airtime-statistics-and-settings.patch |  202 --
 ...time-accounting-and-scheduling-to-TX.patch |  522 ----
 ...pose-ieee80211_schedule_txq-function.patch |   73 -
 ...0211-add-hdrlen-to-ieee80211_tx_data.patch |   44 +-
 ...1-add-TX_NEEDS_ALIGNED4_SKBS-hw-flag.patch |   60 +-
 ...locking-for-txq-scheduling-airtime-f.patch |  214 --
 ...op-redundant-rcu_read_lock-unlock-ca.patch |   96 -
 ...te-hash-for-fq-without-holding-fq-lo.patch |  124 -
 ...e-dequeue-late-tx-handlers-without-h.patch |   55 -
 ...IF_F_LLTX-when-using-intermediate-tx.patch |   22 -
 .../357-mac80211-optimize-skb-resizing.patch  |   18 +-
 ...ee80211_schedule_txq-schedule-empty-.patch |  105 -
 ...-un-schedule-TXQs-on-powersave-start.patch |   31 -
 ...ing-iTXQ-select-the-queue-in-ieee802.patch |  183 --
 ...l_ht-add-support-for-rates-with-4-sp.patch |   78 -
 ...l_ht-automatically-calculate-rate-du.patch |  189 --
 ...ow-4addr-AP-operation-on-crypto-cont.patch |  103 -
 .../522-mac80211_configure_antenna_gain.patch |   40 +-
 .../utils/iw/patches/001-nl80211_h_sync.patch |  246 +-
 ...c_page_frag-to-page_frag_alloc-and-_.patch |  137 -
 ..._frag-functions-to-__page_frag_cache.patch |   79 -
 ...e_mem_map-with-ARCH_PFN_OFFSET-calcu.patch |    2 +-
 225 files changed, 570 insertions(+), 20486 deletions(-)
 delete mode 100644 package/kernel/mac80211/patches/ath/381-ath9k-fix-tx99-with-monitor-mode-interface.patch
 delete mode 100644 package/kernel/mac80211/patches/ath/395-ath9k-add-back-support-for-using-active-monitor-inte.patch
 delete mode 100644 package/kernel/mac80211/patches/ath/407-regd_add_extra_country_codes.patch
 delete mode 100644 package/kernel/mac80211/patches/ath/554-ath9k-dynack-move-debug-log-after-buffer-increments.patch
 delete mode 100644 package/kernel/mac80211/patches/ath/557-ath9k-dynack-remove-experimental-tag.patch
 delete mode 100644 package/kernel/mac80211/patches/ath/976-ath10k-Limit-available-channels-via-DT-ieee80211-fre.patch
 delete mode 100644 package/kernel/mac80211/patches/ath/977-ath10k-add-support-for-configuring-management-packet.patch
 delete mode 100644 package/kernel/mac80211/patches/ath/978-ath10k-fix-possible-out-of-bound-access-of-ath10k_ra.patch
 delete mode 100644 package/kernel/mac80211/patches/brcm/300-v4.20-0001-brcmfmac-add-CYW89342-mini-PCIe-device.patch
 delete mode 100644 package/kernel/mac80211/patches/brcm/302-v4.20-0001-brcmfmac-fix-wrong-strnchr-usage.patch
 delete mode 100644 package/kernel/mac80211/patches/brcm/304-v4.20-0002-brcmfmac-increase-buffer-for-obtaining-firmware-capa.patch
 delete mode 100644 package/kernel/mac80211/patches/brcm/305-v4.20-0001-brcmfmac-remove-set-but-not-used-variables-sfdoff-an.patch
 delete mode 100644 package/kernel/mac80211/patches/brcm/306-v4.20-0001-brcmfmac-reduce-timeout-for-action-frame-scan.patch
 delete mode 100644 package/kernel/mac80211/patches/brcm/306-v4.20-0002-brcmfmac-fix-full-timeout-waiting-for-action-frame-o.patch
 delete mode 100644 package/kernel/mac80211/patches/brcm/320-v5.0-0001-brcmfmac-Remove-firmware-loading-code-duplication.patch
 delete mode 100644 package/kernel/mac80211/patches/brcm/320-v5.0-0002-brcmfmac-Remove-recursion-from-firmware-load-error-h.patch
 delete mode 100644 package/kernel/mac80211/patches/brcm/320-v5.0-0003-brcmfmac-Add-support-for-first-trying-to-get-a-board.patch
 delete mode 100644 package/kernel/mac80211/patches/brcm/320-v5.0-0004-brcmfmac-Set-board_type-used-for-nvram-file-selectio.patch
 delete mode 100644 package/kernel/mac80211/patches/brcm/320-v5.0-0005-brcmfmac-Set-board_type-from-DMI-on-x86-based-machin.patch
 delete mode 100644 package/kernel/mac80211/patches/brcm/320-v5.0-0006-brcmfmac-Cleanup-brcmf_fw_request_done.patch
 delete mode 100644 package/kernel/mac80211/patches/brcm/321-v5.0-0001-brcmfmac-Add-support-for-getting-nvram-contents-from.patch
 delete mode 100644 package/kernel/mac80211/patches/brcm/321-v5.0-0002-brcmfmac-Fix-ccode-from-EFI-nvram-when-necessary.patch
 delete mode 100644 package/kernel/mac80211/patches/brcm/322-v5.0-0001-brcmfmac-fix-spelling-mistake-Retreiving-Retrieving.patch
 delete mode 100644 package/kernel/mac80211/patches/brcm/323-v5.0-0001-brcmutil-print-invalid-chanspec-when-WARN-ing.patch
 delete mode 100644 package/kernel/mac80211/patches/brcm/325-v5.0-brcmfmac-support-STA-info-struct-v7.patch
 delete mode 100644 package/kernel/mac80211/patches/brcm/326-v5.0-brcmfmac-Call-brcmf_dmi_probe-before-brcmf_of_probe.patch
 delete mode 100644 package/kernel/mac80211/patches/brcm/328-v5.0-0001-brcmfmac-add-credit-numbers-updating-support.patch
 delete mode 100644 package/kernel/mac80211/patches/brcm/328-v5.0-0002-brcmfmac-enable-frameburst-mode-in-default-firmware-.patch
 delete mode 100644 package/kernel/mac80211/patches/brcm/328-v5.0-0003-brcmfmac-handle-compressed-tx-status-signal.patch
 delete mode 100644 package/kernel/mac80211/patches/brcm/329-v5.0-0001-brcmfmac-add-4354-raw-pcie-device-id.patch
 delete mode 100644 package/kernel/mac80211/patches/brcm/329-v5.0-0002-brcmfmac-set-F2-watermark-to-256-for-4373.patch
 delete mode 100644 package/kernel/mac80211/patches/brcm/329-v5.0-0003-brcmfmac-set-SDIO-F1-MesBusyCtrl-for-CYW4373.patch
 delete mode 100644 package/kernel/mac80211/patches/brcm/329-v5.0-0004-brcmfmac-add-support-for-CYW43012-SDIO-chipset.patch
 delete mode 100644 package/kernel/mac80211/patches/brcm/329-v5.0-0005-brcmfmac-allow-GCI-core-enumuration.patch
 delete mode 100644 package/kernel/mac80211/patches/brcm/329-v5.0-0006-brcmfmac-update-43012-F2-watermark-setting-to-fix-DM.patch
 delete mode 100644 package/kernel/mac80211/patches/brcm/329-v5.0-0007-brcmfmac-4373-save-restore-support.patch
 delete mode 100644 package/kernel/mac80211/patches/brcm/329-v5.0-0008-brcmfmac-disable-command-decode-in-sdio_aos.patch
 delete mode 100644 package/kernel/mac80211/patches/brcm/330-v5.0-0001-brcmfmac-fix-false-positive-Wmaybe-unintialized-warn.patch
 delete mode 100644 package/kernel/mac80211/patches/brcm/332-v5.0-0001-brcmfmac-Fix-access-point-mode.patch
 delete mode 100644 package/kernel/mac80211/patches/brcm/340-v5.1-brcmfmac-Add-DMI-nvram-filename-quirk-for-PoV-TAB-P1.patch
 delete mode 100644 package/kernel/mac80211/patches/brcm/341-v5.1-brcmfmac-add-a-check-for-the-status-of-usb_register.patch
 delete mode 100644 package/kernel/mac80211/patches/brcm/342-v5.1-brcmfmac-fix-system-warning-message-during-wowl-susp.patch
 delete mode 100644 package/kernel/mac80211/patches/brcm/344-v5.1-brcmfmac-modify-__brcmf_err-to-take-bus-as-a-paramet.patch
 delete mode 100644 package/kernel/mac80211/patches/brcm/345-v5.1-brcmfmac-pass-bus-to-the-__brcmf_err-in-pcie.c.patch
 delete mode 100644 package/kernel/mac80211/patches/brcm/346-v5.1-brcmfmac-add-bphy_err-and-use-it-in-the-cfg80211.c.patch
 delete mode 100644 package/kernel/mac80211/patches/brcm/347-v5.1-brcmfmac-fix-typos.patch
 delete mode 100644 package/kernel/mac80211/patches/brcm/348-v5.1-brcmfmac-support-monitor-frames-with-the-hardware-uc.patch
 delete mode 100644 package/kernel/mac80211/patches/brcm/349-v5.1-0001-brcmfmac-assure-SSID-length-from-firmware-is-limited.patch
 delete mode 100644 package/kernel/mac80211/patches/brcm/349-v5.1-0002-brcmfmac-add-subtype-check-for-event-handling-in-dat.patch
 delete mode 100644 package/kernel/mac80211/patches/brcm/349-v5.1-0003-brcmfmac-create-debugfs-files-for-bus-specific-layer.patch
 delete mode 100644 package/kernel/mac80211/patches/brcm/349-v5.1-0004-brcmfmac-disable-MBSS-feature-for-bcm4330-device.patch
 delete mode 100644 package/kernel/mac80211/patches/brcm/349-v5.1-0005-brcmfmac-check-and-dump-trap-info-during-sdio-probe.patch
 delete mode 100644 package/kernel/mac80211/patches/brcm/349-v5.1-0006-brcmfmac-use-chipname-in-brcmf_fw_alloc_request-for-.patch
 delete mode 100644 package/kernel/mac80211/patches/brcm/350-v5.1-brcmfmac-print-firmware-reported-ring-status-errors.patch
 delete mode 100644 package/kernel/mac80211/patches/brcm/351-v5.1-0001-brcmfmac-improve-code-handling-bandwidth-of-firmware.patch
 delete mode 100644 package/kernel/mac80211/patches/brcm/351-v5.1-0002-brcmfmac-support-firmware-reporting-160-MHz-channels.patch
 delete mode 100644 package/kernel/mac80211/patches/brcm/352-v5.1-brcmfmac-rework-bphy_err-to-take-struct-brcmf_pub-ar.patch
 delete mode 100644 package/kernel/mac80211/patches/brcm/353-v5.1-brcmfmac-remove-set-but-not-used-variable-old_state.patch
 delete mode 100644 package/kernel/mac80211/patches/brcm/354-v5.1-brcmfmac-use-bphy_err-in-all-wiphy-related-code.patch
 delete mode 100644 package/kernel/mac80211/patches/brcm/355-v5.1-brcmfmac-add-basic-validation-of-shared-RAM-address.patch
 delete mode 100644 package/kernel/mac80211/patches/brcm/356-v5.1-0001-brcmfmac-fix-size-of-the-struct-msgbuf_ring_status.patch
 delete mode 100644 package/kernel/mac80211/patches/brcm/356-v5.1-0002-brcmfmac-print-firmware-reported-general-status-erro.patch
 delete mode 100644 package/kernel/mac80211/patches/brcm/360-v5.2-0001-brcmfmac-support-repeated-brcmf_fw_alloc_request-cal.patch
 delete mode 100644 package/kernel/mac80211/patches/brcm/360-v5.2-0002-brcmfmac-add-a-function-designated-for-handling-firm.patch
 delete mode 100644 package/kernel/mac80211/patches/brcm/360-v5.2-0003-brcmfmac-reset-PCIe-bus-on-a-firmware-crash.patch
 delete mode 100644 package/kernel/mac80211/patches/brcm/361-v5.2-0001-brcmfmac-fix-WARNING-during-USB-disconnect-in-case-o.patch
 delete mode 100644 package/kernel/mac80211/patches/brcm/361-v5.2-0002-brcmfmac-fix-NULL-pointer-derefence-during-USB-disco.patch
 delete mode 100644 package/kernel/mac80211/patches/brcm/362-v5.2-0001-brcmfmac-fix-race-during-disconnect-when-USB-complet.patch
 delete mode 100644 package/kernel/mac80211/patches/brcm/362-v5.2-0002-brcmfmac-remove-pending-parameter-from-brcmf_usb_fre.patch
 delete mode 100644 package/kernel/mac80211/patches/brcm/362-v5.2-0003-brcmfmac-remove-unused-variable-i-from-brcmf_usb_fre.patch
 delete mode 100644 package/kernel/mac80211/patches/brcm/363-v5.2-brcmfmac-fix-Oops-when-bringing-up-interface-during-.patch
 delete mode 100644 package/kernel/mac80211/patches/brcm/364-v5.2-brcmfmac-convert-dev_init_lock-mutex-to-completion.patch
 delete mode 100644 package/kernel/mac80211/patches/brcm/365-v5.2-brcmfmac-fix-missing-checks-for-kmemdup.patch
 delete mode 100644 package/kernel/mac80211/patches/brcm/366-v5.2-brcmfmac-Use-struct_size-in-kzalloc.patch
 delete mode 100644 package/kernel/mac80211/patches/brcm/367-v5.2-brcmfmac-Loading-the-correct-firmware-for-brcm43456.patch
 delete mode 100644 package/kernel/mac80211/patches/brcm/368-v5.2-brcmfmac-fix-leak-of-mypkt-on-error-return-path.patch
 delete mode 100644 package/kernel/mac80211/patches/brcm/369-v5.2-brcmfmac-Add-DMI-nvram-filename-quirk-for-ACEPC-T8-a.patch
 delete mode 100644 package/kernel/mac80211/patches/brcm/370-v5.2-brcmfmac-send-mailbox-interrupt-twice-for-specific-h.patch
 delete mode 100644 package/kernel/mac80211/patches/brcm/371-v5.2-Revert-brcmfmac-send-mailbox-interrupt-twice-for-spe.patch
 delete mode 100644 package/kernel/mac80211/patches/brcm/372-v5.2-brcmfmac-send-mailbox-interrupt-twice-for-specific-h.patch
 delete mode 100644 package/kernel/mac80211/patches/brcm/373-v5.2-brcm80211-potential-NULL-dereference-in-brcmf_cfg802.patch
 delete mode 100644 package/kernel/mac80211/patches/brcm/374-v5.2-brcmfmac-set-txflow-request-id-from-1-to-pktids-arra.patch
 delete mode 100644 package/kernel/mac80211/patches/brcm/375-v5.2-brcmfmac-print-firmware-messages-after-a-firmware-cr.patch
 delete mode 100644 package/kernel/mac80211/patches/mwl/941-mwl8k-Fix-rate_idx-underflow.patch
 delete mode 100644 package/kernel/mac80211/patches/rt2x00/001-rt2x00-use-simple_read_from_buffer.patch
 delete mode 100644 package/kernel/mac80211/patches/rt2x00/002-rt2800-move-usb-specific-txdone-txstatus-routines-to.patch
 delete mode 100644 package/kernel/mac80211/patches/rt2x00/003-rt2800mmio-use-txdone-txstatus-routines-from-lib.patch
 delete mode 100644 package/kernel/mac80211/patches/rt2x00/004-rt2x00-do-not-check-for-txstatus-timeout-every-time-.patch
 delete mode 100644 package/kernel/mac80211/patches/rt2x00/005-rt2x00-use-different-txstatus-timeouts-when-flushing.patch
 delete mode 100644 package/kernel/mac80211/patches/rt2x00/006-rt2800-flush-and-txstatus-rework-for-rt2800mmio.patch
 delete mode 100644 package/kernel/mac80211/patches/rt2x00/007-rt2x00-rt2400pci-mark-expected-switch-fall-through.patch
 delete mode 100644 package/kernel/mac80211/patches/rt2x00/008-rt2x00-rt2500pci-mark-expected-switch-fall-through.patch
 delete mode 100644 package/kernel/mac80211/patches/rt2x00/009-rt2x00-rt2800lib-mark-expected-switch-fall-throughs.patch
 delete mode 100644 package/kernel/mac80211/patches/rt2x00/010-rt2x00-rt61pci-mark-expected-switch-fall-through.patch
 delete mode 100644 package/kernel/mac80211/patches/rt2x00/011-cross-tree-phase-out-dma_zalloc_coherent.patch
 delete mode 100644 package/kernel/mac80211/patches/rt2x00/012-rt2x00-reduce-tx-power-to-nominal-level-on-RT6352.patch
 delete mode 100644 package/kernel/mac80211/patches/rt2x00/013-rt2x00-Work-around-a-firmware-bug-with-shared-keys.patch
 delete mode 100644 package/kernel/mac80211/patches/rt2x00/014-rt2x00-no-need-to-check-return-value-of-debugfs_crea.patch
 delete mode 100644 package/kernel/mac80211/patches/rt2x00/015-rt2x00-remove-unneeded-check.patch
 delete mode 100644 package/kernel/mac80211/patches/rt2x00/016-rt2x00-remove-confusing-AGC-register.patch
 delete mode 100644 package/kernel/mac80211/patches/rt2x00/017-rt2800-enable-TX_PIN_CFG_LNA_PE_-bits-per-band.patch
 delete mode 100644 package/kernel/mac80211/patches/rt2x00/018-rt2800-enable-TX_PIN_CFG_RFRX_EN-only-for-MT7620.patch
 delete mode 100644 package/kernel/mac80211/patches/rt2x00/019-rt2800-comment-and-simplify-AGC-init-for-RT6352.patch
 delete mode 100644 package/kernel/mac80211/patches/rt2x00/020-cfg80211-add-ratelimited-variants-of-err-and-warn.patch
 delete mode 100644 package/kernel/mac80211/patches/rt2x00/021-rt2x00-use-ratelimited-variants-dev_warn-dev_err.patch
 delete mode 100644 package/kernel/mac80211/patches/rt2x00/022-rt2x00-check-number-of-EPROTO-errors.patch
 delete mode 100644 package/kernel/mac80211/patches/rt2x00/023-rt2x00-do-not-print-error-when-queue-is-full.patch
 delete mode 100644 package/kernel/mac80211/patches/rt2x00/024-rt2800-partially-restore-old-mmio-txstatus-behaviour.patch
 delete mode 100644 package/kernel/mac80211/patches/rt2x00/025-rt2800-new-flush-implementation-for-SoC-devices.patch
 delete mode 100644 package/kernel/mac80211/patches/rt2x00/026-rt2800-move-txstatus-pending-routine.patch
 delete mode 100644 package/kernel/mac80211/patches/rt2x00/027-rt2800mmio-fetch-tx-status-changes.patch
 delete mode 100644 package/kernel/mac80211/patches/rt2x00/028-rt2800mmio-use-timer-and-work-for-handling-tx-status.patch
 delete mode 100644 package/kernel/mac80211/patches/rt2x00/029-rt2x00-remove-last_nostatus_check.patch
 delete mode 100644 package/kernel/mac80211/patches/rt2x00/030-rt2x00-remove-not-used-entry-field.patch
 delete mode 100644 package/kernel/mac80211/patches/rt2x00/031-rt2x00mmio-remove-legacy-comment.patch
 delete mode 100644 package/kernel/mac80211/patches/rt2x00/032-rt2x00-do-not-increment-sequence-number-while-re-tra.patch
 delete mode 100644 package/kernel/mac80211/patches/rt2x00/050-rt2x00-add-RT3883-support.patch
 delete mode 100644 package/kernel/mac80211/patches/subsys/300-mac80211-add-stop-start-logic-for-software-TXQs.patch
 delete mode 100644 package/kernel/mac80211/patches/subsys/301-mac80211-do-not-call-driver-wake_tx_queue-op-during-.patch
 delete mode 100644 package/kernel/mac80211/patches/subsys/303-mac80211-minstrel-Enable-STBC-and-LDPC-for-VHT-Rates.patch
 delete mode 100644 package/kernel/mac80211/patches/subsys/304-mac80211-minstrel-remove-unnecessary-debugfs-cleanup.patch
 delete mode 100644 package/kernel/mac80211/patches/subsys/305-mac80211-minstrel-merge-with-minstrel_ht-always-enab.patch
 delete mode 100644 package/kernel/mac80211/patches/subsys/306-mac80211-minstrel-reduce-minstrel_mcs_groups-size.patch
 delete mode 100644 package/kernel/mac80211/patches/subsys/307-mac80211-minstrel-fix-using-short-preamble-CCK-rates.patch
 delete mode 100644 package/kernel/mac80211/patches/subsys/308-mac80211-minstrel-fix-CCK-rate-group-streams-value.patch
 delete mode 100644 package/kernel/mac80211/patches/subsys/309-mac80211-minstrel-fix-sampling-reporting-of-CCK-rate.patch
 delete mode 100644 package/kernel/mac80211/patches/subsys/310-mac80211-minstrel-do-not-sample-rates-3-times-slower.patch
 delete mode 100644 package/kernel/mac80211/patches/subsys/311-mac80211-fix-memory-accounting-with-A-MSDU-aggregati.patch
 delete mode 100644 package/kernel/mac80211/patches/subsys/312-mac80211-minstrel_ht-add-flag-to-indicate-missing-in.patch
 delete mode 100644 package/kernel/mac80211/patches/subsys/313-mac80211-fix-unaligned-access-in-mesh-table-hash-fun.patch
 delete mode 100644 package/kernel/mac80211/patches/subsys/320-mac80211-Add-TXQ-scheduling-API.patch
 delete mode 100644 package/kernel/mac80211/patches/subsys/321-cfg80211-Add-airtime-statistics-and-settings.patch
 delete mode 100644 package/kernel/mac80211/patches/subsys/322-mac80211-Add-airtime-accounting-and-scheduling-to-TX.patch
 delete mode 100644 package/kernel/mac80211/patches/subsys/323-mac80211-Expose-ieee80211_schedule_txq-function.patch
 delete mode 100644 package/kernel/mac80211/patches/subsys/352-mac80211-rework-locking-for-txq-scheduling-airtime-f.patch
 delete mode 100644 package/kernel/mac80211/patches/subsys/353-mac80211-mesh-drop-redundant-rcu_read_lock-unlock-ca.patch
 delete mode 100644 package/kernel/mac80211/patches/subsys/354-mac80211-calculate-hash-for-fq-without-holding-fq-lo.patch
 delete mode 100644 package/kernel/mac80211/patches/subsys/355-mac80211-run-late-dequeue-late-tx-handlers-without-h.patch
 delete mode 100644 package/kernel/mac80211/patches/subsys/356-mac80211-set-NETIF_F_LLTX-when-using-intermediate-tx.patch
 delete mode 100644 package/kernel/mac80211/patches/subsys/358-mac80211-make-ieee80211_schedule_txq-schedule-empty-.patch
 delete mode 100644 package/kernel/mac80211/patches/subsys/359-mac80211-un-schedule-TXQs-on-powersave-start.patch
 delete mode 100644 package/kernel/mac80211/patches/subsys/360-mac80211-when-using-iTXQ-select-the-queue-in-ieee802.patch
 delete mode 100644 package/kernel/mac80211/patches/subsys/361-mac80211-minstrel_ht-add-support-for-rates-with-4-sp.patch
 delete mode 100644 package/kernel/mac80211/patches/subsys/362-mac80211-minstrel_ht-automatically-calculate-rate-du.patch
 delete mode 100644 package/kernel/mac80211/patches/subsys/390-nl-mac-80211-allow-4addr-AP-operation-on-crypto-cont.patch
 delete mode 100644 target/linux/generic/backport-4.9/041-mm-rename-__alloc_page_frag-to-page_frag_alloc-and-_.patch
 delete mode 100644 target/linux/generic/backport-4.9/042-mm-rename-__page_frag-functions-to-__page_frag_cache.patch

diff --git a/package/kernel/mac80211/Makefile b/package/kernel/mac80211/Makefile
index 20258fd662..3ae39888e1 100644
--- a/package/kernel/mac80211/Makefile
+++ b/package/kernel/mac80211/Makefile
@@ -10,10 +10,10 @@ include $(INCLUDE_DIR)/kernel.mk
 
 PKG_NAME:=mac80211
 
-PKG_VERSION:=4.19.32-1
-PKG_RELEASE:=2
-PKG_SOURCE_URL:=@KERNEL/linux/kernel/projects/backports/stable/v4.19.32/
-PKG_HASH:=838db1565b54fe4bd1e769c54f30c65c9ea2fb5e99a0cddb7910561794ae317a
+PKG_VERSION:=5.2-rc7-1
+PKG_RELEASE:=1
+PKG_SOURCE_URL:=@KERNEL/linux/kernel/projects/backports/stable/v5.2-rc7/
+PKG_HASH:=3179a4ec398bd6366a4fd8a44b311a57f8da87ad10720baf7c17aef9c8ec2983
 
 PKG_SOURCE:=backports-$(PKG_VERSION).tar.xz
 PKG_BUILD_DIR:=$(KERNEL_BUILD_DIR)/backports-$(PKG_VERSION)
diff --git a/package/kernel/mac80211/broadcom.mk b/package/kernel/mac80211/broadcom.mk
index 4b05c13dba..d2422257d9 100644
--- a/package/kernel/mac80211/broadcom.mk
+++ b/package/kernel/mac80211/broadcom.mk
@@ -105,7 +105,7 @@ define KernelPackage/b43
   	CONFIG_HW_RANDOM=y
   # Depend on PCI_SUPPORT to make sure we can select kmod-bcma or kmod-ssb
   DEPENDS += \
-	@PCI_SUPPORT +kmod-mac80211 \
+	@PCI_SUPPORT +kmod-mac80211 +kmod-lib-cordic \
 	$(if $(CONFIG_PACKAGE_B43_USE_SSB),+kmod-ssb) \
 	$(if $(CONFIG_PACKAGE_B43_USE_BCMA),+kmod-bcma)
   FILES:=$(PKG_BUILD_DIR)/drivers/net/wireless/broadcom/b43/b43.ko
diff --git a/package/kernel/mac80211/patches/ath/070-ath_common_config.patch b/package/kernel/mac80211/patches/ath/070-ath_common_config.patch
index 41774fe53e..cc84c1b5de 100644
--- a/package/kernel/mac80211/patches/ath/070-ath_common_config.patch
+++ b/package/kernel/mac80211/patches/ath/070-ath_common_config.patch
@@ -1,6 +1,7 @@
 --- a/drivers/net/wireless/ath/Kconfig
 +++ b/drivers/net/wireless/ath/Kconfig
-@@ -1,5 +1,5 @@
+@@ -1,6 +1,6 @@
+ # SPDX-License-Identifier: GPL-2.0-only
  config ATH_COMMON
 -	tristate
 +	tristate "ath.ko"
diff --git a/package/kernel/mac80211/patches/ath/080-ath10k_thermal_config.patch b/package/kernel/mac80211/patches/ath/080-ath10k_thermal_config.patch
index a86cbc6e54..cef57f09c9 100644
--- a/package/kernel/mac80211/patches/ath/080-ath10k_thermal_config.patch
+++ b/package/kernel/mac80211/patches/ath/080-ath10k_thermal_config.patch
@@ -1,6 +1,6 @@
 --- a/drivers/net/wireless/ath/ath10k/Kconfig
 +++ b/drivers/net/wireless/ath/ath10k/Kconfig
-@@ -85,6 +85,12 @@ config ATH10K_TRACING
+@@ -87,6 +87,12 @@ config ATH10K_TRACING
  	---help---
  	  Select this to ath10k use tracing infrastructure.
  
@@ -26,7 +26,7 @@
  ath10k_core-$(CONFIG_DEV_COREDUMP) += coredump.o
 --- a/drivers/net/wireless/ath/ath10k/thermal.h
 +++ b/drivers/net/wireless/ath/ath10k/thermal.h
-@@ -36,7 +36,7 @@ struct ath10k_thermal {
+@@ -25,7 +25,7 @@ struct ath10k_thermal {
  	int temperature;
  };
  
diff --git a/package/kernel/mac80211/patches/ath/356-Revert-ath9k-interpret-requested-txpower-in-EIRP-dom.patch b/package/kernel/mac80211/patches/ath/356-Revert-ath9k-interpret-requested-txpower-in-EIRP-dom.patch
index 3adcb8b796..38b5c51302 100644
--- a/package/kernel/mac80211/patches/ath/356-Revert-ath9k-interpret-requested-txpower-in-EIRP-dom.patch
+++ b/package/kernel/mac80211/patches/ath/356-Revert-ath9k-interpret-requested-txpower-in-EIRP-dom.patch
@@ -8,7 +8,7 @@ This reverts commit 71f5137bf010c6faffab50c0ec15374c59c4a411.
 
 --- a/drivers/net/wireless/ath/ath9k/hw.c
 +++ b/drivers/net/wireless/ath/ath9k/hw.c
-@@ -2962,7 +2962,8 @@ void ath9k_hw_apply_txpower(struct ath_h
+@@ -2963,7 +2963,8 @@ void ath9k_hw_apply_txpower(struct ath_h
  {
  	struct ath_regulatory *reg = ath9k_hw_regulatory(ah);
  	struct ieee80211_channel *channel;
@@ -18,7 +18,7 @@ This reverts commit 71f5137bf010c6faffab50c0ec15374c59c4a411.
  	u16 ctl = NO_CTL;
  
  	if (!chan)
-@@ -2974,9 +2975,14 @@ void ath9k_hw_apply_txpower(struct ath_h
+@@ -2975,9 +2976,14 @@ void ath9k_hw_apply_txpower(struct ath_h
  	channel = chan->chan;
  	chan_pwr = min_t(int, channel->max_power * 2, MAX_RATE_POWER);
  	new_pwr = min_t(int, chan_pwr, reg->power_limit);
diff --git a/package/kernel/mac80211/patches/ath/365-ath9k-adjust-tx-power-reduction-for-US-regulatory-do.patch b/package/kernel/mac80211/patches/ath/365-ath9k-adjust-tx-power-reduction-for-US-regulatory-do.patch
index 363e9aa9a3..4b458f74ab 100644
--- a/package/kernel/mac80211/patches/ath/365-ath9k-adjust-tx-power-reduction-for-US-regulatory-do.patch
+++ b/package/kernel/mac80211/patches/ath/365-ath9k-adjust-tx-power-reduction-for-US-regulatory-do.patch
@@ -11,7 +11,7 @@ Signed-off-by: Felix Fietkau <nbd at nbd.name>
 
 --- a/drivers/net/wireless/ath/ath9k/hw.c
 +++ b/drivers/net/wireless/ath/ath9k/hw.c
-@@ -2981,6 +2981,10 @@ void ath9k_hw_apply_txpower(struct ath_h
+@@ -2982,6 +2982,10 @@ void ath9k_hw_apply_txpower(struct ath_h
  	if (ant_gain > max_gain)
  		ant_reduction = ant_gain - max_gain;
  
diff --git a/package/kernel/mac80211/patches/ath/381-ath9k-fix-tx99-with-monitor-mode-interface.patch b/package/kernel/mac80211/patches/ath/381-ath9k-fix-tx99-with-monitor-mode-interface.patch
deleted file mode 100644
index d5c37825fd..0000000000
--- a/package/kernel/mac80211/patches/ath/381-ath9k-fix-tx99-with-monitor-mode-interface.patch
+++ /dev/null
@@ -1,92 +0,0 @@
-From: Felix Fietkau <nbd at nbd.name>
-Date: Mon, 20 Aug 2018 11:35:05 +0200
-Subject: [PATCH] ath9k: fix tx99 with monitor mode interface
-
-Tx99 is typically configured via a monitor mode interface, which does
-not get added to the driver as a vif. Since the code currently expects
-a configured virtual interface for tx99, enabling tx99 via debugfs fails.
-Since the vif is not needed anyway, remove all checks for it.
-
-Signed-off-by: Felix Fietkau <nbd at nbd.name>
----
-
---- a/drivers/net/wireless/ath/ath9k/ath9k.h
-+++ b/drivers/net/wireless/ath/ath9k/ath9k.h
-@@ -1074,7 +1074,6 @@ struct ath_softc {
- 
- 	struct ath_spec_scan_priv spec_priv;
- 
--	struct ieee80211_vif *tx99_vif;
- 	struct sk_buff *tx99_skb;
- 	bool tx99_state;
- 	s16 tx99_power;
---- a/drivers/net/wireless/ath/ath9k/main.c
-+++ b/drivers/net/wireless/ath/ath9k/main.c
-@@ -1251,15 +1251,10 @@ static int ath9k_add_interface(struct ie
- 	struct ath_vif *avp = (void *)vif->drv_priv;
- 	struct ath_node *an = &avp->mcast_node;
- 
--	mutex_lock(&sc->mutex);
-+	if (IS_ENABLED(CPTCFG_ATH9K_TX99))
-+		return -EOPNOTSUPP;
- 
--	if (IS_ENABLED(CPTCFG_ATH9K_TX99)) {
--		if (sc->cur_chan->nvifs >= 1) {
--			mutex_unlock(&sc->mutex);
--			return -EOPNOTSUPP;
--		}
--		sc->tx99_vif = vif;
--	}
-+	mutex_lock(&sc->mutex);
- 
- 	ath_dbg(common, CONFIG, "Attach a VIF of type: %d\n", vif->type);
- 	sc->cur_chan->nvifs++;
-@@ -1342,7 +1337,6 @@ static void ath9k_remove_interface(struc
- 	ath9k_p2p_remove_vif(sc, vif);
- 
- 	sc->cur_chan->nvifs--;
--	sc->tx99_vif = NULL;
- 	if (!ath9k_is_chanctx_enabled())
- 		list_del(&avp->list);
- 
---- a/drivers/net/wireless/ath/ath9k/tx99.c
-+++ b/drivers/net/wireless/ath/ath9k/tx99.c
-@@ -54,12 +54,6 @@ static struct sk_buff *ath9k_build_tx99_
- 	struct ieee80211_hdr *hdr;
- 	struct ieee80211_tx_info *tx_info;
- 	struct sk_buff *skb;
--	struct ath_vif *avp;
--
--	if (!sc->tx99_vif)
--		return NULL;
--
--	avp = (struct ath_vif *)sc->tx99_vif->drv_priv;
- 
- 	skb = alloc_skb(len, GFP_KERNEL);
- 	if (!skb)
-@@ -77,14 +71,11 @@ static struct sk_buff *ath9k_build_tx99_
- 	memcpy(hdr->addr2, hw->wiphy->perm_addr, ETH_ALEN);
- 	memcpy(hdr->addr3, hw->wiphy->perm_addr, ETH_ALEN);
- 
--	hdr->seq_ctrl |= cpu_to_le16(avp->seq_no);
--
- 	tx_info = IEEE80211_SKB_CB(skb);
- 	memset(tx_info, 0, sizeof(*tx_info));
- 	rate = &tx_info->control.rates[0];
- 	tx_info->band = sc->cur_chan->chandef.chan->band;
- 	tx_info->flags = IEEE80211_TX_CTL_NO_ACK;
--	tx_info->control.vif = sc->tx99_vif;
- 	rate->count = 1;
- 	if (ah->curchan && IS_CHAN_HT(ah->curchan)) {
- 		rate->flags |= IEEE80211_TX_RC_MCS;
---- a/drivers/net/wireless/ath/ath9k/xmit.c
-+++ b/drivers/net/wireless/ath/ath9k/xmit.c
-@@ -2974,7 +2974,7 @@ int ath9k_tx99_send(struct ath_softc *sc
- 		return -EINVAL;
- 	}
- 
--	ath_set_rates(sc->tx99_vif, NULL, bf);
-+	ath_set_rates(NULL, NULL, bf);
- 
- 	ath9k_hw_set_desc_link(sc->sc_ah, bf->bf_desc, bf->bf_daddr);
- 	ath9k_hw_tx99_start(sc->sc_ah, txctl->txq->axq_qnum);
diff --git a/package/kernel/mac80211/patches/ath/395-ath9k-add-back-support-for-using-active-monitor-inte.patch b/package/kernel/mac80211/patches/ath/395-ath9k-add-back-support-for-using-active-monitor-inte.patch
deleted file mode 100644
index 7f30de9862..0000000000
--- a/package/kernel/mac80211/patches/ath/395-ath9k-add-back-support-for-using-active-monitor-inte.patch
+++ /dev/null
@@ -1,96 +0,0 @@
-From: Felix Fietkau <nbd at nbd.name>
-Date: Sat, 22 Sep 2018 15:20:50 +0200
-Subject: [PATCH] ath9k: add back support for using active monitor interfaces
- for tx99
-
-Various documented examples on how to set up tx99 with ath9k rely
-on setting up a regular monitor interface for setting the channel.
-My previous patch "ath9k: fix tx99 with monitor mode interface" made
-it possible to set it up this way again. However, it was removing support
-for using an active monitor interface, which is required for controlling
-the bitrate as well, since the bitrate is not passed down with a regular
-monitor interface.
-
-This patch partially reverts the previous one, but keeps support for using
-a regular monitor interface to keep documented steps working in cases
-where the bitrate does not matter
-
-Fixes: d9c52fd17cb48 ("ath9k: fix tx99 with monitor mode interface")
-Signed-off-by: Felix Fietkau <nbd at nbd.name>
----
-
---- a/drivers/net/wireless/ath/ath9k/ath9k.h
-+++ b/drivers/net/wireless/ath/ath9k/ath9k.h
-@@ -1074,6 +1074,7 @@ struct ath_softc {
- 
- 	struct ath_spec_scan_priv spec_priv;
- 
-+	struct ieee80211_vif *tx99_vif;
- 	struct sk_buff *tx99_skb;
- 	bool tx99_state;
- 	s16 tx99_power;
---- a/drivers/net/wireless/ath/ath9k/main.c
-+++ b/drivers/net/wireless/ath/ath9k/main.c
-@@ -1251,8 +1251,13 @@ static int ath9k_add_interface(struct ie
- 	struct ath_vif *avp = (void *)vif->drv_priv;
- 	struct ath_node *an = &avp->mcast_node;
- 
--	if (IS_ENABLED(CPTCFG_ATH9K_TX99))
--		return -EOPNOTSUPP;
-+	if (IS_ENABLED(CPTCFG_ATH9K_TX99)) {
-+		if (sc->cur_chan->nvifs >= 1) {
-+			mutex_unlock(&sc->mutex);
-+			return -EOPNOTSUPP;
-+		}
-+		sc->tx99_vif = vif;
-+	}
- 
- 	mutex_lock(&sc->mutex);
- 
-@@ -1337,6 +1342,7 @@ static void ath9k_remove_interface(struc
- 	ath9k_p2p_remove_vif(sc, vif);
- 
- 	sc->cur_chan->nvifs--;
-+	sc->tx99_vif = NULL;
- 	if (!ath9k_is_chanctx_enabled())
- 		list_del(&avp->list);
- 
---- a/drivers/net/wireless/ath/ath9k/tx99.c
-+++ b/drivers/net/wireless/ath/ath9k/tx99.c
-@@ -54,6 +54,7 @@ static struct sk_buff *ath9k_build_tx99_
- 	struct ieee80211_hdr *hdr;
- 	struct ieee80211_tx_info *tx_info;
- 	struct sk_buff *skb;
-+	struct ath_vif *avp;
- 
- 	skb = alloc_skb(len, GFP_KERNEL);
- 	if (!skb)
-@@ -71,11 +72,17 @@ static struct sk_buff *ath9k_build_tx99_
- 	memcpy(hdr->addr2, hw->wiphy->perm_addr, ETH_ALEN);
- 	memcpy(hdr->addr3, hw->wiphy->perm_addr, ETH_ALEN);
- 
-+	if (sc->tx99_vif) {
-+		avp = (struct ath_vif *) sc->tx99_vif->drv_priv;
-+		hdr->seq_ctrl |= cpu_to_le16(avp->seq_no);
-+	}
-+
- 	tx_info = IEEE80211_SKB_CB(skb);
- 	memset(tx_info, 0, sizeof(*tx_info));
- 	rate = &tx_info->control.rates[0];
- 	tx_info->band = sc->cur_chan->chandef.chan->band;
- 	tx_info->flags = IEEE80211_TX_CTL_NO_ACK;
-+	tx_info->control.vif = sc->tx99_vif;
- 	rate->count = 1;
- 	if (ah->curchan && IS_CHAN_HT(ah->curchan)) {
- 		rate->flags |= IEEE80211_TX_RC_MCS;
---- a/drivers/net/wireless/ath/ath9k/xmit.c
-+++ b/drivers/net/wireless/ath/ath9k/xmit.c
-@@ -2974,7 +2974,7 @@ int ath9k_tx99_send(struct ath_softc *sc
- 		return -EINVAL;
- 	}
- 
--	ath_set_rates(NULL, NULL, bf);
-+	ath_set_rates(sc->tx99_vif, NULL, bf);
- 
- 	ath9k_hw_set_desc_link(sc->sc_ah, bf->bf_desc, bf->bf_daddr);
- 	ath9k_hw_tx99_start(sc->sc_ah, txctl->txq->axq_qnum);
diff --git a/package/kernel/mac80211/patches/ath/402-ath_regd_optional.patch b/package/kernel/mac80211/patches/ath/402-ath_regd_optional.patch
index 03c12df1a8..cae3c5c0dd 100644
--- a/package/kernel/mac80211/patches/ath/402-ath_regd_optional.patch
+++ b/package/kernel/mac80211/patches/ath/402-ath_regd_optional.patch
@@ -70,7 +70,7 @@
  
 --- a/drivers/net/wireless/ath/Kconfig
 +++ b/drivers/net/wireless/ath/Kconfig
-@@ -23,6 +23,9 @@ config WLAN_VENDOR_ATH
+@@ -24,6 +24,9 @@ config WLAN_VENDOR_ATH
  
  if WLAN_VENDOR_ATH
  
diff --git a/package/kernel/mac80211/patches/ath/404-regd_no_assoc_hints.patch b/package/kernel/mac80211/patches/ath/404-regd_no_assoc_hints.patch
index ec95206acb..e4d1a6daab 100644
--- a/package/kernel/mac80211/patches/ath/404-regd_no_assoc_hints.patch
+++ b/package/kernel/mac80211/patches/ath/404-regd_no_assoc_hints.patch
@@ -1,6 +1,6 @@
 --- a/net/wireless/reg.c
 +++ b/net/wireless/reg.c
-@@ -2982,6 +2982,8 @@ void regulatory_hint_country_ie(struct w
+@@ -3032,6 +3032,8 @@ void regulatory_hint_country_ie(struct w
  	enum environment_cap env = ENVIRON_ANY;
  	struct regulatory_request *request = NULL, *lr;
  
@@ -9,11 +9,11 @@
  	/* IE len must be evenly divisible by 2 */
  	if (country_ie_len & 0x01)
  		return;
-@@ -3188,6 +3190,7 @@ static void restore_regulatory_settings(
+@@ -3283,6 +3285,7 @@ static bool is_wiphy_all_set_reg_flag(en
  
  void regulatory_hint_disconnect(void)
  {
 +	return;
- 	pr_debug("All devices are disconnected, going to restore regulatory settings\n");
- 	restore_regulatory_settings(false);
- }
+ 	/* Restore of regulatory settings is not required when wiphy(s)
+ 	 * ignore IE from connected access point but clearance of beacon hints
+ 	 * is required when wiphy(s) supports beacon hints.
diff --git a/package/kernel/mac80211/patches/ath/405-ath_regd_us.patch b/package/kernel/mac80211/patches/ath/405-ath_regd_us.patch
index 8cb7f00ff9..088833199d 100644
--- a/package/kernel/mac80211/patches/ath/405-ath_regd_us.patch
+++ b/package/kernel/mac80211/patches/ath/405-ath_regd_us.patch
@@ -21,6 +21,6 @@
  	{CTRY_UNITED_KINGDOM, ETSI1_WORLD, "GB"},
  	{CTRY_UNITED_STATES, FCC3_FCCA, "US"},
 +	{CTRY_UNITED_STATES, FCC3_FCCA_2, "US"},
+ 	{CTRY_UNITED_STATES2, FCC3_FCCA, "US"},
+ 	{CTRY_UNITED_STATES3, FCC3_FCCA, "US"},
  	/* This "PS" is for US public safety actually... to support this we
- 	 * would need to assign new special alpha2 to CRDA db as with the world
- 	 * regdomain and use another alpha2 */
diff --git a/package/kernel/mac80211/patches/ath/407-regd_add_extra_country_codes.patch b/package/kernel/mac80211/patches/ath/407-regd_add_extra_country_codes.patch
deleted file mode 100644
index 8f621002fe..0000000000
--- a/package/kernel/mac80211/patches/ath/407-regd_add_extra_country_codes.patch
+++ /dev/null
@@ -1,35 +0,0 @@
-From: Oever Gonzalez <notengobattery at gmail.com>
-Date: Mon, 7 Jan 2019 01:07:12 +0200
-Subject: [PATCH] ath: regd: add extra coutry codes
-
-This patch adds several country codes to the regd.h and regd_common.h
-files in order to support devices whose country codes are not present in
-the original list. Without this patch, all devices whose manufacturer
-programmed any of these code in their EEPROM will not work.
-
-Signed-off-by: Oever Gonzalez <notengobattery at gmail.com>
----
-
---- a/drivers/net/wireless/ath/regd.h
-+++ b/drivers/net/wireless/ath/regd.h
-@@ -185,7 +185,9 @@ enum CountryCode {
- 	CTRY_UKRAINE = 804,
- 	CTRY_UNITED_KINGDOM = 826,
- 	CTRY_UNITED_STATES = 840,
-+	CTRY_UNITED_STATES2 = 841,
- 	CTRY_UNITED_STATES_FCC49 = 842,
-+	CTRY_UNITED_STATES3 = 843,
- 	CTRY_URUGUAY = 858,
- 	CTRY_UZBEKISTAN = 860,
- 	CTRY_VENEZUELA = 862,
---- a/drivers/net/wireless/ath/regd_common.h
-+++ b/drivers/net/wireless/ath/regd_common.h
-@@ -486,6 +486,8 @@ static struct country_code_to_enum_rd al
- 	{CTRY_UNITED_KINGDOM, ETSI1_WORLD, "GB"},
- 	{CTRY_UNITED_STATES, FCC3_FCCA, "US"},
- 	{CTRY_UNITED_STATES, FCC3_FCCA_2, "US"},
-+	{CTRY_UNITED_STATES2, FCC3_FCCA, "US"},
-+	{CTRY_UNITED_STATES3, FCC3_FCCA, "US"},
- 	/* This "PS" is for US public safety actually... to support this we
- 	 * would need to assign new special alpha2 to CRDA db as with the world
- 	 * regdomain and use another alpha2 */
diff --git a/package/kernel/mac80211/patches/ath/410-ath9k_allow_adhoc_and_ap.patch b/package/kernel/mac80211/patches/ath/410-ath9k_allow_adhoc_and_ap.patch
index 25c236b12c..bdf784968f 100644
--- a/package/kernel/mac80211/patches/ath/410-ath9k_allow_adhoc_and_ap.patch
+++ b/package/kernel/mac80211/patches/ath/410-ath9k_allow_adhoc_and_ap.patch
@@ -1,6 +1,6 @@
 --- a/drivers/net/wireless/ath/ath9k/init.c
 +++ b/drivers/net/wireless/ath/ath9k/init.c
-@@ -833,6 +833,7 @@ static const struct ieee80211_iface_limi
+@@ -831,6 +831,7 @@ static const struct ieee80211_iface_limi
  				 BIT(NL80211_IFTYPE_AP) },
  	{ .max = 1,	.types = BIT(NL80211_IFTYPE_P2P_CLIENT) |
  				 BIT(NL80211_IFTYPE_P2P_GO) },
diff --git a/package/kernel/mac80211/patches/ath/411-ath5k_allow_adhoc_and_ap.patch b/package/kernel/mac80211/patches/ath/411-ath5k_allow_adhoc_and_ap.patch
index 2a5ab3d428..9dbe047c9a 100644
--- a/package/kernel/mac80211/patches/ath/411-ath5k_allow_adhoc_and_ap.patch
+++ b/package/kernel/mac80211/patches/ath/411-ath5k_allow_adhoc_and_ap.patch
@@ -18,7 +18,7 @@
  		goto end;
 --- a/drivers/net/wireless/ath/ath5k/base.c
 +++ b/drivers/net/wireless/ath/ath5k/base.c
-@@ -1965,7 +1965,7 @@ ath5k_beacon_send(struct ath5k_hw *ah)
+@@ -1964,7 +1964,7 @@ ath5k_beacon_send(struct ath5k_hw *ah)
  	}
  
  	if ((ah->opmode == NL80211_IFTYPE_AP && ah->num_ap_vifs +
@@ -27,7 +27,7 @@
  			ah->opmode == NL80211_IFTYPE_MESH_POINT) {
  		u64 tsf = ath5k_hw_get_tsf64(ah);
  		u32 tsftu = TSF_TO_TU(tsf);
-@@ -2051,7 +2051,7 @@ ath5k_beacon_update_timers(struct ath5k_
+@@ -2050,7 +2050,7 @@ ath5k_beacon_update_timers(struct ath5k_
  
  	intval = ah->bintval & AR5K_BEACON_PERIOD;
  	if (ah->opmode == NL80211_IFTYPE_AP && ah->num_ap_vifs
@@ -36,7 +36,7 @@
  		intval /= ATH_BCBUF;	/* staggered multi-bss beacons */
  		if (intval < 15)
  			ATH5K_WARN(ah, "intval %u is too low, min 15\n",
-@@ -2518,6 +2518,7 @@ static const struct ieee80211_iface_limi
+@@ -2516,6 +2516,7 @@ static const struct ieee80211_iface_limi
  				 BIT(NL80211_IFTYPE_MESH_POINT) |
  #endif
  				 BIT(NL80211_IFTYPE_AP) },
diff --git a/package/kernel/mac80211/patches/ath/500-ath9k_eeprom_debugfs.patch b/package/kernel/mac80211/patches/ath/500-ath9k_eeprom_debugfs.patch
index b6dc45cd96..786a3ed3fb 100644
--- a/package/kernel/mac80211/patches/ath/500-ath9k_eeprom_debugfs.patch
+++ b/package/kernel/mac80211/patches/ath/500-ath9k_eeprom_debugfs.patch
@@ -1,6 +1,6 @@
 --- a/drivers/net/wireless/ath/ath9k/debug.c
 +++ b/drivers/net/wireless/ath/ath9k/debug.c
-@@ -1374,6 +1374,53 @@ void ath9k_deinit_debug(struct ath_softc
+@@ -1361,6 +1361,53 @@ void ath9k_deinit_debug(struct ath_softc
  	ath9k_cmn_spectral_deinit_debug(&sc->spec_priv);
  }
  
@@ -54,7 +54,7 @@
  int ath9k_init_debug(struct ath_hw *ah)
  {
  	struct ath_common *common = ath9k_hw_common(ah);
-@@ -1393,6 +1440,8 @@ int ath9k_init_debug(struct ath_hw *ah)
+@@ -1380,6 +1427,8 @@ int ath9k_init_debug(struct ath_hw *ah)
  	ath9k_tx99_init_debug(sc);
  	ath9k_cmn_spectral_init_debug(&sc->spec_priv, sc->debug.debugfs_phy);
  
diff --git a/package/kernel/mac80211/patches/ath/501-ath9k_ahb_init.patch b/package/kernel/mac80211/patches/ath/501-ath9k_ahb_init.patch
index 5fc60dd0ae..b9c784eb25 100644
--- a/package/kernel/mac80211/patches/ath/501-ath9k_ahb_init.patch
+++ b/package/kernel/mac80211/patches/ath/501-ath9k_ahb_init.patch
@@ -1,6 +1,6 @@
 --- a/drivers/net/wireless/ath/ath9k/init.c
 +++ b/drivers/net/wireless/ath/ath9k/init.c
-@@ -1144,25 +1144,25 @@ static int __init ath9k_init(void)
+@@ -1143,25 +1143,25 @@ static int __init ath9k_init(void)
  {
  	int error;
  
diff --git a/package/kernel/mac80211/patches/ath/512-ath9k_channelbw_debugfs.patch b/package/kernel/mac80211/patches/ath/512-ath9k_channelbw_debugfs.patch
index 2d4a5688c8..80e33182f7 100644
--- a/package/kernel/mac80211/patches/ath/512-ath9k_channelbw_debugfs.patch
+++ b/package/kernel/mac80211/patches/ath/512-ath9k_channelbw_debugfs.patch
@@ -1,6 +1,6 @@
 --- a/drivers/net/wireless/ath/ath9k/debug.c
 +++ b/drivers/net/wireless/ath/ath9k/debug.c
-@@ -1421,6 +1421,52 @@ static const struct file_operations fops
+@@ -1408,6 +1408,52 @@ static const struct file_operations fops
  	.owner = THIS_MODULE
  };
  
@@ -53,7 +53,7 @@
  int ath9k_init_debug(struct ath_hw *ah)
  {
  	struct ath_common *common = ath9k_hw_common(ah);
-@@ -1442,6 +1488,8 @@ int ath9k_init_debug(struct ath_hw *ah)
+@@ -1429,6 +1475,8 @@ int ath9k_init_debug(struct ath_hw *ah)
  
  	debugfs_create_file("eeprom", S_IRUSR, sc->debug.debugfs_phy, sc,
  			    &fops_eeprom);
diff --git a/package/kernel/mac80211/patches/ath/530-ath9k_extra_leds.patch b/package/kernel/mac80211/patches/ath/530-ath9k_extra_leds.patch
index c13a72cbb0..1f19483064 100644
--- a/package/kernel/mac80211/patches/ath/530-ath9k_extra_leds.patch
+++ b/package/kernel/mac80211/patches/ath/530-ath9k_extra_leds.patch
@@ -1,6 +1,6 @@
 --- a/drivers/net/wireless/ath/ath9k/ath9k.h
 +++ b/drivers/net/wireless/ath/ath9k/ath9k.h
-@@ -850,6 +850,9 @@ static inline int ath9k_dump_btcoex(stru
+@@ -843,6 +843,9 @@ static inline int ath9k_dump_btcoex(stru
  #ifdef CPTCFG_MAC80211_LEDS
  void ath_init_leds(struct ath_softc *sc);
  void ath_deinit_leds(struct ath_softc *sc);
@@ -10,9 +10,9 @@
  #else
  static inline void ath_init_leds(struct ath_softc *sc)
  {
-@@ -991,6 +994,13 @@ void ath_ant_comb_scan(struct ath_softc
- #define AIRTIME_USE_NEW_QUEUES	BIT(2)
- #define AIRTIME_ACTIVE(flags) (!!(flags & (AIRTIME_USE_TX|AIRTIME_USE_RX)))
+@@ -979,6 +982,13 @@ void ath_ant_comb_scan(struct ath_softc
+ 
+ #define ATH9K_NUM_CHANCTX  2 /* supports 2 operating channels */
  
 +struct ath_led {
 +	struct list_head list;
@@ -24,7 +24,7 @@
  struct ath_softc {
  	struct ieee80211_hw *hw;
  	struct device *dev;
-@@ -1046,9 +1056,8 @@ struct ath_softc {
+@@ -1032,9 +1042,8 @@ struct ath_softc {
  	spinlock_t chan_lock;
  
  #ifdef CPTCFG_MAC80211_LEDS
@@ -181,7 +181,7 @@
  
 --- a/drivers/net/wireless/ath/ath9k/init.c
 +++ b/drivers/net/wireless/ath/ath9k/init.c
-@@ -1056,7 +1056,7 @@ int ath9k_init_device(u16 devid, struct
+@@ -1055,7 +1055,7 @@ int ath9k_init_device(u16 devid, struct
  
  #ifdef CPTCFG_MAC80211_LEDS
  	/* must be initialized before ieee80211_register_hw */
@@ -192,7 +192,7 @@
  #endif
 --- a/drivers/net/wireless/ath/ath9k/debug.c
 +++ b/drivers/net/wireless/ath/ath9k/debug.c
-@@ -1466,6 +1466,61 @@ static const struct file_operations fops
+@@ -1453,6 +1453,61 @@ static const struct file_operations fops
  	.llseek = default_llseek,
  };
  
@@ -254,7 +254,7 @@
  
  int ath9k_init_debug(struct ath_hw *ah)
  {
-@@ -1490,6 +1545,10 @@ int ath9k_init_debug(struct ath_hw *ah)
+@@ -1477,6 +1532,10 @@ int ath9k_init_debug(struct ath_hw *ah)
  			    &fops_eeprom);
  	debugfs_create_file("chanbw", S_IRUSR | S_IWUSR, sc->debug.debugfs_phy,
  			    sc, &fops_chanbw);
diff --git a/package/kernel/mac80211/patches/ath/542-ath9k_debugfs_diag.patch b/package/kernel/mac80211/patches/ath/542-ath9k_debugfs_diag.patch
index 55896c834b..e9ba4a9483 100644
--- a/package/kernel/mac80211/patches/ath/542-ath9k_debugfs_diag.patch
+++ b/package/kernel/mac80211/patches/ath/542-ath9k_debugfs_diag.patch
@@ -1,6 +1,6 @@
 --- a/drivers/net/wireless/ath/ath9k/debug.c
 +++ b/drivers/net/wireless/ath/ath9k/debug.c
-@@ -1522,6 +1522,50 @@ static const struct file_operations fops
+@@ -1509,6 +1509,50 @@ static const struct file_operations fops
  #endif
  
  
@@ -51,7 +51,7 @@
  int ath9k_init_debug(struct ath_hw *ah)
  {
  	struct ath_common *common = ath9k_hw_common(ah);
-@@ -1549,6 +1593,8 @@ int ath9k_init_debug(struct ath_hw *ah)
+@@ -1536,6 +1580,8 @@ int ath9k_init_debug(struct ath_hw *ah)
  	debugfs_create_file("gpio_led", S_IWUSR,
  			   sc->debug.debugfs_phy, sc, &fops_gpio_led);
  #endif
diff --git a/package/kernel/mac80211/patches/ath/543-ath9k_entropy_from_adc.patch b/package/kernel/mac80211/patches/ath/543-ath9k_entropy_from_adc.patch
index b0a027564a..2e44b0095f 100644
--- a/package/kernel/mac80211/patches/ath/543-ath9k_entropy_from_adc.patch
+++ b/package/kernel/mac80211/patches/ath/543-ath9k_entropy_from_adc.patch
@@ -55,7 +55,7 @@
  	ops->spectral_scan_config = ar9003_hw_spectral_scan_config;
 --- a/drivers/net/wireless/ath/ath9k/init.c
 +++ b/drivers/net/wireless/ath/ath9k/init.c
-@@ -821,7 +821,8 @@ static void ath9k_init_txpower_limits(st
+@@ -819,7 +819,8 @@ static void ath9k_init_txpower_limits(st
  	if (ah->caps.hw_caps & ATH9K_HW_CAP_5GHZ)
  		ath9k_init_band_txpower(sc, NL80211_BAND_5GHZ);
  
@@ -65,8 +65,8 @@
  }
  
  static const struct ieee80211_iface_limit if_limits[] = {
-@@ -1016,6 +1017,18 @@ static void ath9k_set_hw_capab(struct at
- 	wiphy_ext_feature_set(hw->wiphy, NL80211_EXT_FEATURE_CQM_RSSI_LIST);
+@@ -1015,6 +1016,18 @@ static void ath9k_set_hw_capab(struct at
+ 	wiphy_ext_feature_set(hw->wiphy, NL80211_EXT_FEATURE_AIRTIME_FAIRNESS);
  }
  
 +static void ath_get_initial_entropy(struct ath_softc *sc)
@@ -84,7 +84,7 @@
  int ath9k_init_device(u16 devid, struct ath_softc *sc,
  		    const struct ath_bus_ops *bus_ops)
  {
-@@ -1061,6 +1074,8 @@ int ath9k_init_device(u16 devid, struct
+@@ -1060,6 +1073,8 @@ int ath9k_init_device(u16 devid, struct
  		ARRAY_SIZE(ath9k_tpt_blink));
  #endif
  
@@ -110,7 +110,7 @@
  static inline void ath9k_hw_set_bt_ant_diversity(struct ath_hw *ah, bool enable)
 --- a/drivers/net/wireless/ath/ath9k/ar5008_phy.c
 +++ b/drivers/net/wireless/ath/ath9k/ar5008_phy.c
-@@ -1324,9 +1324,30 @@ void ar5008_hw_init_rate_txpower(struct
+@@ -1320,9 +1320,30 @@ void ar5008_hw_init_rate_txpower(struct
  	}
  }
  
@@ -141,7 +141,7 @@
  	static const u32 ar5416_cca_regs[6] = {
  		AR_PHY_CCA,
  		AR_PHY_CH1_CCA,
-@@ -1341,6 +1362,8 @@ int ar5008_hw_attach_phy_ops(struct ath_
+@@ -1337,6 +1358,8 @@ int ar5008_hw_attach_phy_ops(struct ath_
  	if (ret)
  	    return ret;
  
diff --git a/package/kernel/mac80211/patches/ath/545-ath9k_ani_ws_detect.patch b/package/kernel/mac80211/patches/ath/545-ath9k_ani_ws_detect.patch
index 3a3f244b9d..70db82a21e 100644
--- a/package/kernel/mac80211/patches/ath/545-ath9k_ani_ws_detect.patch
+++ b/package/kernel/mac80211/patches/ath/545-ath9k_ani_ws_detect.patch
@@ -1,6 +1,6 @@
 --- a/drivers/net/wireless/ath/ath9k/ar5008_phy.c
 +++ b/drivers/net/wireless/ath/ath9k/ar5008_phy.c
-@@ -953,55 +953,6 @@ static bool ar5008_hw_ani_control_new(st
+@@ -949,55 +949,6 @@ static bool ar5008_hw_ani_control_new(st
  		 * on == 0 means more noise imm
  		 */
  		u32 on = param ? 1 : 0;
diff --git a/package/kernel/mac80211/patches/ath/548-ath9k_enable_gpio_chip.patch b/package/kernel/mac80211/patches/ath/548-ath9k_enable_gpio_chip.patch
index eb9eb26a74..78206d2860 100644
--- a/package/kernel/mac80211/patches/ath/548-ath9k_enable_gpio_chip.patch
+++ b/package/kernel/mac80211/patches/ath/548-ath9k_enable_gpio_chip.patch
@@ -18,7 +18,7 @@ Signed-off-by: Felix Fietkau <nbd at nbd.name>
  
  #include "common.h"
  #include "debug.h"
-@@ -1001,6 +1002,14 @@ struct ath_led {
+@@ -989,6 +990,14 @@ struct ath_led {
  	struct led_classdev cdev;
  };
  
@@ -33,7 +33,7 @@ Signed-off-by: Felix Fietkau <nbd at nbd.name>
  struct ath_softc {
  	struct ieee80211_hw *hw;
  	struct device *dev;
-@@ -1058,6 +1067,9 @@ struct ath_softc {
+@@ -1044,6 +1053,9 @@ struct ath_softc {
  #ifdef CPTCFG_MAC80211_LEDS
  	const char *led_default_trigger;
  	struct list_head leds;
diff --git a/package/kernel/mac80211/patches/ath/549-ath9k_enable_gpio_buttons.patch b/package/kernel/mac80211/patches/ath/549-ath9k_enable_gpio_buttons.patch
index bd71b75e76..716e09f351 100644
--- a/package/kernel/mac80211/patches/ath/549-ath9k_enable_gpio_buttons.patch
+++ b/package/kernel/mac80211/patches/ath/549-ath9k_enable_gpio_buttons.patch
@@ -10,7 +10,7 @@ Signed-off-by: Felix Fietkau <nbd at nbd.name>
 ---
 --- a/drivers/net/wireless/ath/ath9k/ath9k.h
 +++ b/drivers/net/wireless/ath/ath9k/ath9k.h
-@@ -1069,6 +1069,7 @@ struct ath_softc {
+@@ -1055,6 +1055,7 @@ struct ath_softc {
  	struct list_head leds;
  #ifdef CONFIG_GPIOLIB
  	struct ath9k_gpio_chip *gpiochip;
diff --git a/package/kernel/mac80211/patches/ath/551-ath9k_ubnt_uap_plus_hsr.patch b/package/kernel/mac80211/patches/ath/551-ath9k_ubnt_uap_plus_hsr.patch
index 30eba27137..c28054d58d 100644
--- a/package/kernel/mac80211/patches/ath/551-ath9k_ubnt_uap_plus_hsr.patch
+++ b/package/kernel/mac80211/patches/ath/551-ath9k_ubnt_uap_plus_hsr.patch
@@ -396,7 +396,7 @@
  ATH9K_HWRNG=
 --- a/drivers/net/wireless/ath/ath9k/Kconfig
 +++ b/drivers/net/wireless/ath/ath9k/Kconfig
-@@ -59,6 +59,19 @@ config ATH9K_AHB
+@@ -60,6 +60,19 @@ config ATH9K_AHB
  	  Say Y, if you have a SoC with a compatible built-in
  	  wireless MAC. Say N if unsure.
  
diff --git a/package/kernel/mac80211/patches/ath/552-ahb_of.patch b/package/kernel/mac80211/patches/ath/552-ahb_of.patch
index 08735d2871..1170fc64bd 100644
--- a/package/kernel/mac80211/patches/ath/552-ahb_of.patch
+++ b/package/kernel/mac80211/patches/ath/552-ahb_of.patch
@@ -318,7 +318,7 @@
  
  #include "common.h"
  #include "debug.h"
-@@ -1023,6 +1024,9 @@ struct ath_softc {
+@@ -1011,6 +1012,9 @@ struct ath_softc {
  	struct ath_hw *sc_ah;
  	void __iomem *mem;
  	int irq;
diff --git a/package/kernel/mac80211/patches/ath/554-ath9k-dynack-move-debug-log-after-buffer-increments.patch b/package/kernel/mac80211/patches/ath/554-ath9k-dynack-move-debug-log-after-buffer-increments.patch
deleted file mode 100644
index 607722cc3d..0000000000
--- a/package/kernel/mac80211/patches/ath/554-ath9k-dynack-move-debug-log-after-buffer-increments.patch
+++ /dev/null
@@ -1,88 +0,0 @@
-From: Lorenzo Bianconi <lorenzo.bianconi at redhat.com>
-Date: Fri, 2 Nov 2018 21:49:56 +0100
-Subject: [PATCH] ath9k: dynack: move debug log after buffer increments
-
-Move debug log in ath_dynack_sample_tx_ts and ath_dynack_sample_ack_ts
-after timestamp buffer head/tail increments in order to make debugging
-more user friendly
-
-Tested-by: Koen Vandeputte <koen.vandeputte at ncentric.com>
-Signed-off-by: Lorenzo Bianconi <lorenzo.bianconi at redhat.com>
----
-
---- a/drivers/net/wireless/ath/ath9k/dynack.c
-+++ b/drivers/net/wireless/ath/ath9k/dynack.c
-@@ -178,11 +178,12 @@ void ath_dynack_sample_tx_ts(struct ath_
- 			     struct ath_tx_status *ts,
- 			     struct ieee80211_sta *sta)
- {
--	u8 ridx;
- 	struct ieee80211_hdr *hdr;
- 	struct ath_dynack *da = &ah->dynack;
- 	struct ath_common *common = ath9k_hw_common(ah);
- 	struct ieee80211_tx_info *info = IEEE80211_SKB_CB(skb);
-+	u32 dur = ts->duration;
-+	u8 ridx;
- 
- 	if (!da->enabled || (info->flags & IEEE80211_TX_CTL_NO_ACK))
- 		return;
-@@ -217,14 +218,13 @@ void ath_dynack_sample_tx_ts(struct ath_
- 	ridx = ts->ts_rateindex;
- 
- 	da->st_rbf.ts[da->st_rbf.t_rb].tstamp = ts->ts_tstamp;
--	da->st_rbf.ts[da->st_rbf.t_rb].dur = ts->duration;
- 	ether_addr_copy(da->st_rbf.addr[da->st_rbf.t_rb].h_dest, hdr->addr1);
- 	ether_addr_copy(da->st_rbf.addr[da->st_rbf.t_rb].h_src, hdr->addr2);
- 
- 	if (!(info->status.rates[ridx].flags & IEEE80211_TX_RC_MCS)) {
--		u32 phy, sifs;
- 		const struct ieee80211_rate *rate;
- 		struct ieee80211_tx_rate *rates = info->status.rates;
-+		u32 phy;
- 
- 		rate = &common->sbands[info->band].bitrates[rates[ridx].idx];
- 		if (info->band == NL80211_BAND_2GHZ &&
-@@ -233,19 +233,18 @@ void ath_dynack_sample_tx_ts(struct ath_
- 		else
- 			phy = WLAN_RC_PHY_OFDM;
- 
--		sifs = ath_dynack_get_sifs(ah, phy);
--		da->st_rbf.ts[da->st_rbf.t_rb].dur -= sifs;
-+		dur -= ath_dynack_get_sifs(ah, phy);
- 	}
--
--	ath_dbg(common, DYNACK, "{%pM} tx sample %u [dur %u][h %u-t %u]\n",
--		hdr->addr1, da->st_rbf.ts[da->st_rbf.t_rb].tstamp,
--		da->st_rbf.ts[da->st_rbf.t_rb].dur, da->st_rbf.h_rb,
--		(da->st_rbf.t_rb + 1) % ATH_DYN_BUF);
-+	da->st_rbf.ts[da->st_rbf.t_rb].dur = dur;
- 
- 	INCR(da->st_rbf.t_rb, ATH_DYN_BUF);
- 	if (da->st_rbf.t_rb == da->st_rbf.h_rb)
- 		INCR(da->st_rbf.h_rb, ATH_DYN_BUF);
- 
-+	ath_dbg(common, DYNACK, "{%pM} tx sample %u [dur %u][h %u-t %u]\n",
-+		hdr->addr1, ts->ts_tstamp, dur, da->st_rbf.h_rb,
-+		da->st_rbf.t_rb);
-+
- 	ath_dynack_compute_to(ah);
- 
- 	spin_unlock_bh(&da->qlock);
-@@ -272,14 +271,13 @@ void ath_dynack_sample_ack_ts(struct ath
- 	spin_lock_bh(&da->qlock);
- 	da->ack_rbf.tstamp[da->ack_rbf.t_rb] = ts;
- 
--	ath_dbg(common, DYNACK, "rx sample %u [h %u-t %u]\n",
--		da->ack_rbf.tstamp[da->ack_rbf.t_rb],
--		da->ack_rbf.h_rb, (da->ack_rbf.t_rb + 1) % ATH_DYN_BUF);
--
- 	INCR(da->ack_rbf.t_rb, ATH_DYN_BUF);
- 	if (da->ack_rbf.t_rb == da->ack_rbf.h_rb)
- 		INCR(da->ack_rbf.h_rb, ATH_DYN_BUF);
- 
-+	ath_dbg(common, DYNACK, "rx sample %u [h %u-t %u]\n",
-+		ts, da->ack_rbf.h_rb, da->ack_rbf.t_rb);
-+
- 	ath_dynack_compute_to(ah);
- 
- 	spin_unlock_bh(&da->qlock);
diff --git a/package/kernel/mac80211/patches/ath/557-ath9k-dynack-remove-experimental-tag.patch b/package/kernel/mac80211/patches/ath/557-ath9k-dynack-remove-experimental-tag.patch
deleted file mode 100644
index 2e4cffd1fa..0000000000
--- a/package/kernel/mac80211/patches/ath/557-ath9k-dynack-remove-experimental-tag.patch
+++ /dev/null
@@ -1,22 +0,0 @@
-From: Lorenzo Bianconi <lorenzo.bianconi at redhat.com>
-Date: Fri, 2 Nov 2018 21:49:59 +0100
-Subject: [PATCH] ath9k: dynack: remove 'experimental' tag
-
-Remove experimental tag from dynack Kconfig entry since it has
-been tested on outdoor 25Km links
-
-Tested-by: Koen Vandeputte <koen.vandeputte at ncentric.com>
-Signed-off-by: Lorenzo Bianconi <lorenzo.bianconi at redhat.com>
----
-
---- a/drivers/net/wireless/ath/ath9k/Kconfig
-+++ b/drivers/net/wireless/ath/ath9k/Kconfig
-@@ -132,7 +132,7 @@ config ATH9K_DFS_CERTIFIED
- 	  except increase code size.
- 
- config ATH9K_DYNACK
--	bool "Atheros ath9k ACK timeout estimation algorithm (EXPERIMENTAL)"
-+	bool "Atheros ath9k ACK timeout estimation algorithm"
- 	depends on ATH9K
- 	default n
- 	---help---
diff --git a/package/kernel/mac80211/patches/ath/921-ath10k_init_devices_synchronously.patch b/package/kernel/mac80211/patches/ath/921-ath10k_init_devices_synchronously.patch
index 47ecc9c655..3a16b08a44 100644
--- a/package/kernel/mac80211/patches/ath/921-ath10k_init_devices_synchronously.patch
+++ b/package/kernel/mac80211/patches/ath/921-ath10k_init_devices_synchronously.patch
@@ -14,8 +14,8 @@ Signed-off-by: Sven Eckelmann <sven at open-mesh.com>
 
 --- a/drivers/net/wireless/ath/ath10k/core.c
 +++ b/drivers/net/wireless/ath/ath10k/core.c
-@@ -2720,6 +2720,16 @@ int ath10k_core_register(struct ath10k *
- 	ar->chip_id = chip_id;
+@@ -3003,6 +3003,16 @@ int ath10k_core_register(struct ath10k *
+ 
  	queue_work(ar->workqueue, &ar->register_work);
  
 +	/* OpenWrt requires all PHYs to be initialized to create the
diff --git a/package/kernel/mac80211/patches/ath/930-ath10k_add_tpt_led_trigger.patch b/package/kernel/mac80211/patches/ath/930-ath10k_add_tpt_led_trigger.patch
index 3fd6bca819..352a49c4c3 100644
--- a/package/kernel/mac80211/patches/ath/930-ath10k_add_tpt_led_trigger.patch
+++ b/package/kernel/mac80211/patches/ath/930-ath10k_add_tpt_led_trigger.patch
@@ -1,6 +1,6 @@
 --- a/drivers/net/wireless/ath/ath10k/mac.c
 +++ b/drivers/net/wireless/ath/ath10k/mac.c
-@@ -8282,6 +8282,21 @@ static int ath10k_mac_init_rd(struct ath
+@@ -8483,6 +8483,21 @@ static int ath10k_mac_init_rd(struct ath
  	return 0;
  }
  
@@ -22,9 +22,9 @@
  int ath10k_mac_register(struct ath10k *ar)
  {
  	static const u32 cipher_suites[] = {
-@@ -8571,6 +8586,12 @@ int ath10k_mac_register(struct ath10k *a
+@@ -8806,6 +8821,12 @@ int ath10k_mac_register(struct ath10k *a
  
- 	wiphy_ext_feature_set(ar->hw->wiphy, NL80211_EXT_FEATURE_CQM_RSSI_LIST);
+ 	ar->hw->weight_multiplier = ATH10K_AIRTIME_WEIGHT_MULTIPLIER;
  
 +#ifdef CPTCFG_MAC80211_LEDS
 +	ieee80211_create_tpt_led_trigger(ar->hw,
diff --git a/package/kernel/mac80211/patches/ath/960-0010-ath10k-limit-htt-rx-ring-size.patch b/package/kernel/mac80211/patches/ath/960-0010-ath10k-limit-htt-rx-ring-size.patch
index 810e97a783..05fce6a168 100644
--- a/package/kernel/mac80211/patches/ath/960-0010-ath10k-limit-htt-rx-ring-size.patch
+++ b/package/kernel/mac80211/patches/ath/960-0010-ath10k-limit-htt-rx-ring-size.patch
@@ -1,6 +1,6 @@
 --- a/drivers/net/wireless/ath/ath10k/htt.h
 +++ b/drivers/net/wireless/ath/ath10k/htt.h
-@@ -238,7 +238,7 @@ enum htt_rx_ring_flags {
+@@ -226,7 +226,7 @@ enum htt_rx_ring_flags {
  };
  
  #define HTT_RX_RING_SIZE_MIN 128
diff --git a/package/kernel/mac80211/patches/ath/960-0011-ath10k-limit-pci-buffer-size.patch b/package/kernel/mac80211/patches/ath/960-0011-ath10k-limit-pci-buffer-size.patch
index 283f4d819f..0c25fb3f04 100644
--- a/package/kernel/mac80211/patches/ath/960-0011-ath10k-limit-pci-buffer-size.patch
+++ b/package/kernel/mac80211/patches/ath/960-0011-ath10k-limit-pci-buffer-size.patch
@@ -1,6 +1,6 @@
 --- a/drivers/net/wireless/ath/ath10k/pci.c
 +++ b/drivers/net/wireless/ath/ath10k/pci.c
-@@ -142,7 +142,7 @@ static struct ce_attr host_ce_config_wla
+@@ -131,7 +131,7 @@ static struct ce_attr host_ce_config_wla
  		.flags = CE_ATTR_FLAGS,
  		.src_nentries = 0,
  		.src_sz_max = 2048,
@@ -9,7 +9,7 @@
  		.recv_cb = ath10k_pci_htt_htc_rx_cb,
  	},
  
-@@ -151,7 +151,7 @@ static struct ce_attr host_ce_config_wla
+@@ -140,7 +140,7 @@ static struct ce_attr host_ce_config_wla
  		.flags = CE_ATTR_FLAGS,
  		.src_nentries = 0,
  		.src_sz_max = 2048,
@@ -18,7 +18,7 @@
  		.recv_cb = ath10k_pci_htc_rx_cb,
  	},
  
-@@ -178,7 +178,7 @@ static struct ce_attr host_ce_config_wla
+@@ -167,7 +167,7 @@ static struct ce_attr host_ce_config_wla
  		.flags = CE_ATTR_FLAGS,
  		.src_nentries = 0,
  		.src_sz_max = 512,
@@ -27,7 +27,7 @@
  		.recv_cb = ath10k_pci_htt_rx_cb,
  	},
  
-@@ -203,7 +203,7 @@ static struct ce_attr host_ce_config_wla
+@@ -192,7 +192,7 @@ static struct ce_attr host_ce_config_wla
  		.flags = CE_ATTR_FLAGS,
  		.src_nentries = 0,
  		.src_sz_max = 2048,
diff --git a/package/kernel/mac80211/patches/ath/972-ath10k_fix-crash-due-to-wrong-handling-of-peer_bw_rxnss_override-parameter.patch b/package/kernel/mac80211/patches/ath/972-ath10k_fix-crash-due-to-wrong-handling-of-peer_bw_rxnss_override-parameter.patch
index d8f6887cd0..df4223fcb8 100644
--- a/package/kernel/mac80211/patches/ath/972-ath10k_fix-crash-due-to-wrong-handling-of-peer_bw_rxnss_override-parameter.patch
+++ b/package/kernel/mac80211/patches/ath/972-ath10k_fix-crash-due-to-wrong-handling-of-peer_bw_rxnss_override-parameter.patch
@@ -23,7 +23,7 @@ v9: use SM/MS macros from code.h to simplify shift/mask handling
  3 files changed, 52 insertions(+), 23 deletions(-)
 --- a/drivers/net/wireless/ath/ath10k/mac.c
 +++ b/drivers/net/wireless/ath/ath10k/mac.c
-@@ -2469,7 +2469,7 @@ static void ath10k_peer_assoc_h_vht(stru
+@@ -2475,7 +2475,7 @@ static void ath10k_peer_assoc_h_vht(stru
  	const u16 *vht_mcs_mask;
  	u8 ampdu_factor;
  	u8 max_nss, vht_mcs;
@@ -32,7 +32,7 @@ v9: use SM/MS macros from code.h to simplify shift/mask handling
  
  	if (WARN_ON(ath10k_mac_vif_chan(vif, &def)))
  		return;
-@@ -2529,23 +2529,45 @@ static void ath10k_peer_assoc_h_vht(stru
+@@ -2535,23 +2535,45 @@ static void ath10k_peer_assoc_h_vht(stru
  		__le16_to_cpu(vht_cap->vht_mcs.tx_highest);
  	arg->peer_vht_rates.tx_mcs_set = ath10k_peer_assoc_h_vht_limit(
  		__le16_to_cpu(vht_cap->vht_mcs.tx_mcs_map), vht_mcs_mask);
@@ -92,7 +92,7 @@ v9: use SM/MS macros from code.h to simplify shift/mask handling
  }
  
  static void ath10k_peer_assoc_h_qos(struct ath10k *ar,
-@@ -2697,9 +2719,9 @@ static int ath10k_peer_assoc_prepare(str
+@@ -2703,9 +2725,9 @@ static int ath10k_peer_assoc_prepare(str
  	ath10k_peer_assoc_h_crypto(ar, vif, sta, arg);
  	ath10k_peer_assoc_h_rates(ar, vif, sta, arg);
  	ath10k_peer_assoc_h_ht(ar, vif, sta, arg);
@@ -105,7 +105,7 @@ v9: use SM/MS macros from code.h to simplify shift/mask handling
  }
 --- a/drivers/net/wireless/ath/ath10k/wmi.c
 +++ b/drivers/net/wireless/ath/ath10k/wmi.c
-@@ -7357,12 +7357,7 @@ ath10k_wmi_peer_assoc_fill_10_4(struct a
+@@ -7552,12 +7552,7 @@ ath10k_wmi_peer_assoc_fill_10_4(struct a
  	struct wmi_10_4_peer_assoc_complete_cmd *cmd = buf;
  
  	ath10k_wmi_peer_assoc_fill_10_2(ar, buf, arg);
@@ -121,7 +121,7 @@ v9: use SM/MS macros from code.h to simplify shift/mask handling
  static int
 --- a/drivers/net/wireless/ath/ath10k/wmi.h
 +++ b/drivers/net/wireless/ath/ath10k/wmi.h
-@@ -6357,7 +6357,19 @@ struct wmi_10_2_peer_assoc_complete_cmd
+@@ -6468,7 +6468,19 @@ struct wmi_10_2_peer_assoc_complete_cmd
  	__le32 info0; /* WMI_PEER_ASSOC_INFO0_ */
  } __packed;
  
diff --git a/package/kernel/mac80211/patches/ath/973-ath10k_fix-band_center_freq-handling-for-VHT160-in-recent-firmwares.patch b/package/kernel/mac80211/patches/ath/973-ath10k_fix-band_center_freq-handling-for-VHT160-in-recent-firmwares.patch
index 9a7c749cb1..2863e4b4b6 100644
--- a/package/kernel/mac80211/patches/ath/973-ath10k_fix-band_center_freq-handling-for-VHT160-in-recent-firmwares.patch
+++ b/package/kernel/mac80211/patches/ath/973-ath10k_fix-band_center_freq-handling-for-VHT160-in-recent-firmwares.patch
@@ -13,7 +13,7 @@ v2: fix trailing whitespace issue and fix some typos within the commit note
  2 files changed, 8 insertions(+), 10 deletions(-)
 --- a/drivers/net/wireless/ath/ath10k/mac.c
 +++ b/drivers/net/wireless/ath/ath10k/mac.c
-@@ -4473,13 +4473,6 @@ static struct ieee80211_sta_vht_cap ath1
+@@ -4533,13 +4533,6 @@ static struct ieee80211_sta_vht_cap ath1
  		vht_cap.cap |= val;
  	}
  
@@ -29,7 +29,7 @@ v2: fix trailing whitespace issue and fix some typos within the commit note
  		if ((i < ar->num_rf_chains) && (ar->cfg_tx_chainmask & BIT(i)))
 --- a/drivers/net/wireless/ath/ath10k/wmi.c
 +++ b/drivers/net/wireless/ath/ath10k/wmi.c
-@@ -1677,13 +1677,18 @@ void ath10k_wmi_put_wmi_channel(struct w
+@@ -1700,13 +1700,18 @@ void ath10k_wmi_put_wmi_channel(struct w
  		flags |= WMI_CHAN_FLAG_HT40_PLUS;
  	if (arg->chan_radar)
  		flags |= WMI_CHAN_FLAG_DFS;
diff --git a/package/kernel/mac80211/patches/ath/974-ath10k_add-LED-and-GPIO-controlling-support-for-various-chipsets.patch b/package/kernel/mac80211/patches/ath/974-ath10k_add-LED-and-GPIO-controlling-support-for-various-chipsets.patch
index 50ed63b065..1fd255b121 100644
--- a/package/kernel/mac80211/patches/ath/974-ath10k_add-LED-and-GPIO-controlling-support-for-various-chipsets.patch
+++ b/package/kernel/mac80211/patches/ath/974-ath10k_add-LED-and-GPIO-controlling-support-for-various-chipsets.patch
@@ -85,7 +85,7 @@ v13:
  create mode 100644 drivers/net/wireless/ath/ath10k/leds.h
 --- a/drivers/net/wireless/ath/ath10k/Kconfig
 +++ b/drivers/net/wireless/ath/ath10k/Kconfig
-@@ -69,6 +69,16 @@ config ATH10K_DEBUGFS
+@@ -71,6 +71,16 @@ config ATH10K_DEBUGFS
  
  	  If unsure, say Y to make it easier to debug problems.
  
@@ -124,7 +124,7 @@ v13:
  WCN36XX=
 --- a/drivers/net/wireless/ath/ath10k/core.c
 +++ b/drivers/net/wireless/ath/ath10k/core.c
-@@ -34,6 +34,7 @@
+@@ -24,6 +24,7 @@
  #include "testmode.h"
  #include "wmi-ops.h"
  #include "coredump.h"
@@ -132,47 +132,47 @@ v13:
  
  unsigned int ath10k_debug_mask;
  static unsigned int ath10k_cryptmode_param;
-@@ -64,6 +65,7 @@ static const struct ath10k_hw_params ath
- 		.id = QCA988X_HW_2_0_VERSION,
+@@ -55,6 +56,7 @@ static const struct ath10k_hw_params ath
  		.dev_id = QCA988X_2_0_DEVICE_ID,
+ 		.bus = ATH10K_BUS_PCI,
  		.name = "qca988x hw2.0",
 +		.led_pin = 1,
  		.patch_load_addr = QCA988X_HW_2_0_PATCH_LOAD_ADDR,
  		.uart_pin = 7,
  		.cc_wraparound_type = ATH10K_HW_CC_WRAP_SHIFTED_ALL,
-@@ -129,6 +131,7 @@ static const struct ath10k_hw_params ath
- 		.id = QCA9887_HW_1_0_VERSION,
+@@ -123,6 +125,7 @@ static const struct ath10k_hw_params ath
  		.dev_id = QCA9887_1_0_DEVICE_ID,
+ 		.bus = ATH10K_BUS_PCI,
  		.name = "qca9887 hw1.0",
 +		.led_pin = 1,
  		.patch_load_addr = QCA9887_HW_1_0_PATCH_LOAD_ADDR,
  		.uart_pin = 7,
  		.cc_wraparound_type = ATH10K_HW_CC_WRAP_SHIFTED_ALL,
-@@ -293,6 +296,7 @@ static const struct ath10k_hw_params ath
- 		.id = QCA99X0_HW_2_0_DEV_VERSION,
+@@ -297,6 +300,7 @@ static const struct ath10k_hw_params ath
  		.dev_id = QCA99X0_2_0_DEVICE_ID,
+ 		.bus = ATH10K_BUS_PCI,
  		.name = "qca99x0 hw2.0",
 +		.led_pin = 17,
  		.patch_load_addr = QCA99X0_HW_2_0_PATCH_LOAD_ADDR,
  		.uart_pin = 7,
  		.otp_exe_param = 0x00000700,
-@@ -331,6 +335,7 @@ static const struct ath10k_hw_params ath
- 		.id = QCA9984_HW_1_0_DEV_VERSION,
+@@ -337,6 +341,7 @@ static const struct ath10k_hw_params ath
  		.dev_id = QCA9984_1_0_DEVICE_ID,
+ 		.bus = ATH10K_BUS_PCI,
  		.name = "qca9984/qca9994 hw1.0",
 +		.led_pin = 17,
  		.patch_load_addr = QCA9984_HW_1_0_PATCH_LOAD_ADDR,
  		.uart_pin = 7,
  		.cc_wraparound_type = ATH10K_HW_CC_WRAP_SHIFTED_EACH,
-@@ -374,6 +379,7 @@ static const struct ath10k_hw_params ath
- 		.id = QCA9888_HW_2_0_DEV_VERSION,
+@@ -384,6 +389,7 @@ static const struct ath10k_hw_params ath
  		.dev_id = QCA9888_2_0_DEVICE_ID,
+ 		.bus = ATH10K_BUS_PCI,
  		.name = "qca9888 hw2.0",
 +		.led_pin = 17,
  		.patch_load_addr = QCA9888_HW_2_0_PATCH_LOAD_ADDR,
  		.uart_pin = 7,
  		.cc_wraparound_type = ATH10K_HW_CC_WRAP_SHIFTED_EACH,
-@@ -2441,6 +2447,10 @@ int ath10k_core_start(struct ath10k *ar,
+@@ -2720,6 +2726,10 @@ int ath10k_core_start(struct ath10k *ar,
  	if (status)
  		goto err_hif_stop;
  
@@ -183,7 +183,7 @@ v13:
  	return 0;
  
  err_hif_stop:
-@@ -2695,9 +2705,18 @@ static void ath10k_core_register_work(st
+@@ -2976,9 +2986,18 @@ static void ath10k_core_register_work(st
  		goto err_spectral_destroy;
  	}
  
@@ -202,7 +202,7 @@ v13:
  err_spectral_destroy:
  	ath10k_spectral_destroy(ar);
  err_debug_destroy:
-@@ -2741,6 +2760,8 @@ void ath10k_core_unregister(struct ath10
+@@ -3024,6 +3043,8 @@ void ath10k_core_unregister(struct ath10
  	if (!test_bit(ATH10K_FLAG_CORE_REGISTERED, &ar->dev_flags))
  		return;
  
@@ -213,7 +213,7 @@ v13:
  	 * relayfs debugfs file cleanly. Otherwise the parent debugfs tree
 --- a/drivers/net/wireless/ath/ath10k/core.h
 +++ b/drivers/net/wireless/ath/ath10k/core.h
-@@ -25,6 +25,7 @@
+@@ -14,6 +14,7 @@
  #include <linux/pci.h>
  #include <linux/uuid.h>
  #include <linux/time.h>
@@ -221,15 +221,7 @@ v13:
  
  #include "htt.h"
  #include "htc.h"
-@@ -908,7 +909,6 @@ struct ath10k {
- 	u32 low_5ghz_chan;
- 	u32 high_5ghz_chan;
- 	bool ani_enabled;
--
- 	bool p2p;
- 
- 	struct {
-@@ -1099,6 +1099,13 @@ struct ath10k {
+@@ -1150,6 +1151,13 @@ struct ath10k {
  	} testmode;
  
  	struct {
@@ -245,7 +237,7 @@ v13:
  		u32 fw_warm_reset_counter;
 --- a/drivers/net/wireless/ath/ath10k/hw.h
 +++ b/drivers/net/wireless/ath/ath10k/hw.h
-@@ -504,6 +504,7 @@ struct ath10k_hw_params {
+@@ -511,6 +511,7 @@ struct ath10k_hw_params {
  	const char *name;
  	u32 patch_load_addr;
  	int uart_pin;
@@ -405,7 +397,7 @@ v13:
 +#endif /* _LEDS_H_ */
 --- a/drivers/net/wireless/ath/ath10k/mac.c
 +++ b/drivers/net/wireless/ath/ath10k/mac.c
-@@ -33,6 +33,7 @@
+@@ -23,6 +23,7 @@
  #include "wmi-tlv.h"
  #include "wmi-ops.h"
  #include "wow.h"
@@ -416,9 +408,9 @@ v13:
 --- a/drivers/net/wireless/ath/ath10k/wmi-ops.h
 +++ b/drivers/net/wireless/ath/ath10k/wmi-ops.h
 @@ -216,7 +216,10 @@ struct wmi_ops {
- 	struct sk_buff *(*gen_echo)(struct ath10k *ar, u32 value);
- 	struct sk_buff *(*gen_pdev_get_tpc_table_cmdid)(struct ath10k *ar,
- 							u32 param);
+ 	struct sk_buff *(*gen_bb_timing)
+ 			(struct ath10k *ar,
+ 			 const struct wmi_bb_timing_cfg_arg *arg);
 +	struct sk_buff *(*gen_gpio_config)(struct ath10k *ar, u32 gpio_num,
 +					   u32 input, u32 pull_type, u32 intr_mode);
  
@@ -426,7 +418,7 @@ v13:
  };
  
  int ath10k_wmi_cmd_send(struct ath10k *ar, struct sk_buff *skb, u32 cmd_id);
-@@ -1054,6 +1057,35 @@ ath10k_wmi_force_fw_hang(struct ath10k *
+@@ -1080,6 +1083,35 @@ ath10k_wmi_force_fw_hang(struct ath10k *
  	return ath10k_wmi_cmd_send(ar, skb, ar->wmi.cmd->force_fw_hang_cmdid);
  }
  
@@ -464,7 +456,7 @@ v13:
  {
 --- a/drivers/net/wireless/ath/ath10k/wmi-tlv.c
 +++ b/drivers/net/wireless/ath/ath10k/wmi-tlv.c
-@@ -3976,6 +3976,8 @@ static const struct wmi_ops wmi_tlv_ops
+@@ -4309,6 +4309,8 @@ static const struct wmi_ops wmi_tlv_ops
  	.gen_echo = ath10k_wmi_tlv_op_gen_echo,
  	.gen_vdev_spectral_conf = ath10k_wmi_tlv_op_gen_vdev_spectral_conf,
  	.gen_vdev_spectral_enable = ath10k_wmi_tlv_op_gen_vdev_spectral_enable,
@@ -475,7 +467,7 @@ v13:
  static const struct wmi_peer_flags_map wmi_tlv_peer_flags_map = {
 --- a/drivers/net/wireless/ath/ath10k/wmi.c
 +++ b/drivers/net/wireless/ath/ath10k/wmi.c
-@@ -7177,6 +7177,49 @@ ath10k_wmi_op_gen_peer_set_param(struct
+@@ -7372,6 +7372,49 @@ ath10k_wmi_op_gen_peer_set_param(struct
  	return skb;
  }
  
@@ -525,7 +517,7 @@ v13:
  static struct sk_buff *
  ath10k_wmi_op_gen_set_psmode(struct ath10k *ar, u32 vdev_id,
  			     enum wmi_sta_ps_mode psmode)
-@@ -8788,6 +8831,9 @@ static const struct wmi_ops wmi_ops = {
+@@ -9004,6 +9047,9 @@ static const struct wmi_ops wmi_ops = {
  	.fw_stats_fill = ath10k_wmi_main_op_fw_stats_fill,
  	.get_vdev_subtype = ath10k_wmi_op_get_vdev_subtype,
  	.gen_echo = ath10k_wmi_op_gen_echo,
@@ -535,7 +527,7 @@ v13:
  	/* .gen_bcn_tmpl not implemented */
  	/* .gen_prb_tmpl not implemented */
  	/* .gen_p2p_go_bcn_ie not implemented */
-@@ -8858,6 +8904,8 @@ static const struct wmi_ops wmi_10_1_ops
+@@ -9074,6 +9120,8 @@ static const struct wmi_ops wmi_10_1_ops
  	.fw_stats_fill = ath10k_wmi_10x_op_fw_stats_fill,
  	.get_vdev_subtype = ath10k_wmi_op_get_vdev_subtype,
  	.gen_echo = ath10k_wmi_op_gen_echo,
@@ -544,7 +536,7 @@ v13:
  	/* .gen_bcn_tmpl not implemented */
  	/* .gen_prb_tmpl not implemented */
  	/* .gen_p2p_go_bcn_ie not implemented */
-@@ -8929,6 +8977,8 @@ static const struct wmi_ops wmi_10_2_ops
+@@ -9146,6 +9194,8 @@ static const struct wmi_ops wmi_10_2_ops
  	.gen_delba_send = ath10k_wmi_op_gen_delba_send,
  	.fw_stats_fill = ath10k_wmi_10x_op_fw_stats_fill,
  	.get_vdev_subtype = ath10k_wmi_op_get_vdev_subtype,
@@ -553,16 +545,16 @@ v13:
  	/* .gen_pdev_enable_adaptive_cca not implemented */
  };
  
-@@ -8999,6 +9049,8 @@ static const struct wmi_ops wmi_10_2_4_o
- 	.gen_pdev_enable_adaptive_cca =
+@@ -9217,6 +9267,8 @@ static const struct wmi_ops wmi_10_2_4_o
  		ath10k_wmi_op_gen_pdev_enable_adaptive_cca,
  	.get_vdev_subtype = ath10k_wmi_10_2_4_op_get_vdev_subtype,
+ 	.gen_bb_timing = ath10k_wmi_10_2_4_op_gen_bb_timing,
 +	.gen_gpio_config = ath10k_wmi_op_gen_gpio_config,
 +	.gen_gpio_output = ath10k_wmi_op_gen_gpio_output,
  	/* .gen_bcn_tmpl not implemented */
  	/* .gen_prb_tmpl not implemented */
  	/* .gen_p2p_go_bcn_ie not implemented */
-@@ -9078,6 +9130,8 @@ static const struct wmi_ops wmi_10_4_ops
+@@ -9297,6 +9349,8 @@ static const struct wmi_ops wmi_10_4_ops
  	.gen_pdev_bss_chan_info_req = ath10k_wmi_10_2_op_gen_pdev_bss_chan_info,
  	.gen_echo = ath10k_wmi_op_gen_echo,
  	.gen_pdev_get_tpc_config = ath10k_wmi_10_2_4_op_gen_pdev_get_tpc_config,
@@ -573,7 +565,7 @@ v13:
  int ath10k_wmi_attach(struct ath10k *ar)
 --- a/drivers/net/wireless/ath/ath10k/wmi.h
 +++ b/drivers/net/wireless/ath/ath10k/wmi.h
-@@ -2942,6 +2942,41 @@ enum wmi_10_4_feature_mask {
+@@ -2998,6 +2998,41 @@ enum wmi_10_4_feature_mask {
  
  };
  
diff --git a/package/kernel/mac80211/patches/ath/975-ath10k-use-tpt-trigger-by-default.patch b/package/kernel/mac80211/patches/ath/975-ath10k-use-tpt-trigger-by-default.patch
index dfe2829468..60801243fb 100644
--- a/package/kernel/mac80211/patches/ath/975-ath10k-use-tpt-trigger-by-default.patch
+++ b/package/kernel/mac80211/patches/ath/975-ath10k-use-tpt-trigger-by-default.patch
@@ -16,9 +16,9 @@ Signed-off-by: Mathias Kresin <dev at kresin.me>
 
 --- a/drivers/net/wireless/ath/ath10k/core.h
 +++ b/drivers/net/wireless/ath/ath10k/core.h
-@@ -1144,6 +1144,10 @@ struct ath10k {
- 	struct ath10k_radar_found_info last_radar_info;
+@@ -1198,6 +1198,10 @@ struct ath10k {
  	struct work_struct radar_confirmation_work;
+ 	struct ath10k_bus_params bus_param;
  
 +#ifdef CPTCFG_MAC80211_LEDS
 +	const char *led_default_trigger;
@@ -42,8 +42,8 @@ Signed-off-by: Mathias Kresin <dev at kresin.me>
  	if (ret)
 --- a/drivers/net/wireless/ath/ath10k/mac.c
 +++ b/drivers/net/wireless/ath/ath10k/mac.c
-@@ -8603,7 +8603,7 @@ int ath10k_mac_register(struct ath10k *a
- 	wiphy_ext_feature_set(ar->hw->wiphy, NL80211_EXT_FEATURE_CQM_RSSI_LIST);
+@@ -8838,7 +8838,7 @@ int ath10k_mac_register(struct ath10k *a
+ 	ar->hw->weight_multiplier = ATH10K_AIRTIME_WEIGHT_MULTIPLIER;
  
  #ifdef CPTCFG_MAC80211_LEDS
 -	ieee80211_create_tpt_led_trigger(ar->hw,
diff --git a/package/kernel/mac80211/patches/ath/976-ath10k-Limit-available-channels-via-DT-ieee80211-fre.patch b/package/kernel/mac80211/patches/ath/976-ath10k-Limit-available-channels-via-DT-ieee80211-fre.patch
deleted file mode 100644
index 260c0c7867..0000000000
--- a/package/kernel/mac80211/patches/ath/976-ath10k-Limit-available-channels-via-DT-ieee80211-fre.patch
+++ /dev/null
@@ -1,39 +0,0 @@
-From bbf0a8af2261bc7ae39b227ff6a1e9f45a008c27 Mon Sep 17 00:00:00 2001
-From: Sven Eckelmann <sven.eckelmann at openmesh.com>
-Date: Mon, 30 Jul 2018 17:31:41 +0200
-Subject: [PATCH] ath10k: Limit available channels via DT ieee80211-freq-limit
-
-Tri-band devices (1x 2.4GHz + 2x 5GHz) often incorporate special filters in
-the RX and TX path. These filtered channel can in theory still be used by
-the hardware but the signal strength is reduced so much that it makes no
-sense.
-
-There is already a DT property to limit the available channels but ath10k
-has to manually call this functionality to limit the currrently set wiphy
-channels further.
-
-Signed-off-by: Sven Eckelmann <sven.eckelmann at openmesh.com>
-
-Forwarded: https://patchwork.kernel.org/patch/10549245/
----
- drivers/net/wireless/ath/ath10k/mac.c | 2 ++
- 1 file changed, 2 insertions(+)
-
---- a/drivers/net/wireless/ath/ath10k/mac.c
-+++ b/drivers/net/wireless/ath/ath10k/mac.c
-@@ -18,6 +18,7 @@
- 
- #include "mac.h"
- 
-+#include <net/cfg80211.h>
- #include <net/mac80211.h>
- #include <linux/etherdevice.h>
- #include <linux/acpi.h>
-@@ -8390,6 +8391,7 @@ int ath10k_mac_register(struct ath10k *a
- 		ar->hw->wiphy->bands[NL80211_BAND_5GHZ] = band;
- 	}
- 
-+	wiphy_read_of_freq_limits(ar->hw->wiphy);
- 	ath10k_mac_setup_ht_vht_cap(ar);
- 
- 	ar->hw->wiphy->interface_modes =
diff --git a/package/kernel/mac80211/patches/ath/977-ath10k-add-support-for-configuring-management-packet.patch b/package/kernel/mac80211/patches/ath/977-ath10k-add-support-for-configuring-management-packet.patch
deleted file mode 100644
index 4f2f64a60a..0000000000
--- a/package/kernel/mac80211/patches/ath/977-ath10k-add-support-for-configuring-management-packet.patch
+++ /dev/null
@@ -1,89 +0,0 @@
-From: Sriram R <srirrama at codeaurora.org>
-Date: Mon, 10 Sep 2018 11:09:40 +0530
-Subject: [PATCH] ath10k: add support for configuring management packet rate
-
-By default the firmware uses 1Mbps and 6Mbps rate for management packets
-in 2G and 5G bands respectively. But when the user selects different
-basic rates from the userspace, we need to send the management
-packets at the lowest basic rate selected by the user.
-
-This change makes use of WMI_VDEV_PARAM_MGMT_RATE param for configuring the
-management packets rate to the firmware.
-
-Chipsets Tested : QCA988X, QCA9887, QCA9984
-FW Tested 	: 10.2.4-1.0-41, 10.4-3.6.104
-
-Signed-off-by: Sriram R <srirrama at codeaurora.org>
-Signed-off-by: Kalle Valo <kvalo at codeaurora.org>
-
-Origin: backport, https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=f279294e9ee22a8f306fdc8e4181cf555e6f0f70
----
---- a/drivers/net/wireless/ath/ath10k/mac.c
-+++ b/drivers/net/wireless/ath/ath10k/mac.c
-@@ -158,6 +158,22 @@ u8 ath10k_mac_bitrate_to_idx(const struc
- 	return 0;
- }
- 
-+static int ath10k_mac_get_rate_hw_value(int bitrate)
-+{
-+	int i;
-+	u8 hw_value_prefix = 0;
-+
-+	if (ath10k_mac_bitrate_is_cck(bitrate))
-+		hw_value_prefix = WMI_RATE_PREAMBLE_CCK << 6;
-+
-+	for (i = 0; i < sizeof(ath10k_rates); i++) {
-+		if (ath10k_rates[i].bitrate == bitrate)
-+			return hw_value_prefix | ath10k_rates[i].hw_value;
-+	}
-+
-+	return -EINVAL;
-+}
-+
- static int ath10k_mac_get_max_vht_mcs_map(u16 mcs_map, int nss)
- {
- 	switch ((mcs_map >> (2 * nss)) & 0x3) {
-@@ -5468,9 +5484,10 @@ static void ath10k_bss_info_changed(stru
- 	struct cfg80211_chan_def def;
- 	u32 vdev_param, pdev_param, slottime, preamble;
- 	u16 bitrate, hw_value;
--	u8 rate;
--	int rateidx, ret = 0;
-+	u8 rate, basic_rate_idx;
-+	int rateidx, ret = 0, hw_rate_code;
- 	enum nl80211_band band;
-+	const struct ieee80211_supported_band *sband;
- 
- 	mutex_lock(&ar->conf_mutex);
- 
-@@ -5676,6 +5693,30 @@ static void ath10k_bss_info_changed(stru
- 				    arvif->vdev_id,  ret);
- 	}
- 
-+	if (changed & BSS_CHANGED_BASIC_RATES) {
-+		if (WARN_ON(ath10k_mac_vif_chan(vif, &def))) {
-+			mutex_unlock(&ar->conf_mutex);
-+			return;
-+		}
-+
-+	sband = ar->hw->wiphy->bands[def.chan->band];
-+	basic_rate_idx = ffs(vif->bss_conf.basic_rates) - 1;
-+	bitrate = sband->bitrates[basic_rate_idx].bitrate;
-+
-+	hw_rate_code = ath10k_mac_get_rate_hw_value(bitrate);
-+	if (hw_rate_code < 0) {
-+		ath10k_warn(ar, "bitrate not supported %d\n", bitrate);
-+		mutex_unlock(&ar->conf_mutex);
-+		return;
-+	}
-+
-+	vdev_param = ar->wmi.vdev_param->mgmt_rate;
-+	ret = ath10k_wmi_vdev_set_param(ar, arvif->vdev_id, vdev_param,
-+					hw_rate_code);
-+	if (ret)
-+		ath10k_warn(ar, "failed to set mgmt tx rate %d\n", ret);
-+	}
-+
- 	mutex_unlock(&ar->conf_mutex);
- }
- 
diff --git a/package/kernel/mac80211/patches/ath/978-ath10k-fix-possible-out-of-bound-access-of-ath10k_ra.patch b/package/kernel/mac80211/patches/ath/978-ath10k-fix-possible-out-of-bound-access-of-ath10k_ra.patch
deleted file mode 100644
index b82b16a92b..0000000000
--- a/package/kernel/mac80211/patches/ath/978-ath10k-fix-possible-out-of-bound-access-of-ath10k_ra.patch
+++ /dev/null
@@ -1,66 +0,0 @@
-From: Sriram R <srirrama at codeaurora.org>
-Date: Wed, 3 Oct 2018 08:43:50 +0530
-Subject: [PATCH] ath10k: fix possible out of bound access of ath10k_rates array
-
-While using 'ath10k_mac_get_rate_hw_value()' to obtain the hw value
-from the passed bitrate, there is a chance of out of bound array access
-when wrong bitrate is passed. This is fixed by comparing the bitrates
-within the correct size of the ath10k_rates array.
-
-Fixes commit f279294e9ee2 ("ath10k: add support for configuring management
-packet rate"). Also correction made to some indents used in the above commit.
-
-Signed-off-by: Sriram R <srirrama at codeaurora.org>
-Signed-off-by: Kalle Valo <kvalo at codeaurora.org>
-
-Origin: backport, https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=34e141eea7dd8525dd1ef7a925459e455b4d307f
----
---- a/drivers/net/wireless/ath/ath10k/mac.c
-+++ b/drivers/net/wireless/ath/ath10k/mac.c
-@@ -166,7 +166,7 @@ static int ath10k_mac_get_rate_hw_value(
- 	if (ath10k_mac_bitrate_is_cck(bitrate))
- 		hw_value_prefix = WMI_RATE_PREAMBLE_CCK << 6;
- 
--	for (i = 0; i < sizeof(ath10k_rates); i++) {
-+	for (i = 0; i < ARRAY_SIZE(ath10k_rates); i++) {
- 		if (ath10k_rates[i].bitrate == bitrate)
- 			return hw_value_prefix | ath10k_rates[i].hw_value;
- 	}
-@@ -5699,22 +5699,22 @@ static void ath10k_bss_info_changed(stru
- 			return;
- 		}
- 
--	sband = ar->hw->wiphy->bands[def.chan->band];
--	basic_rate_idx = ffs(vif->bss_conf.basic_rates) - 1;
--	bitrate = sband->bitrates[basic_rate_idx].bitrate;
--
--	hw_rate_code = ath10k_mac_get_rate_hw_value(bitrate);
--	if (hw_rate_code < 0) {
--		ath10k_warn(ar, "bitrate not supported %d\n", bitrate);
--		mutex_unlock(&ar->conf_mutex);
--		return;
--	}
-+		sband = ar->hw->wiphy->bands[def.chan->band];
-+		basic_rate_idx = ffs(vif->bss_conf.basic_rates) - 1;
-+		bitrate = sband->bitrates[basic_rate_idx].bitrate;
-+
-+		hw_rate_code = ath10k_mac_get_rate_hw_value(bitrate);
-+		if (hw_rate_code < 0) {
-+			ath10k_warn(ar, "bitrate not supported %d\n", bitrate);
-+			mutex_unlock(&ar->conf_mutex);
-+			return;
-+		}
- 
--	vdev_param = ar->wmi.vdev_param->mgmt_rate;
--	ret = ath10k_wmi_vdev_set_param(ar, arvif->vdev_id, vdev_param,
--					hw_rate_code);
--	if (ret)
--		ath10k_warn(ar, "failed to set mgmt tx rate %d\n", ret);
-+		vdev_param = ar->wmi.vdev_param->mgmt_rate;
-+		ret = ath10k_wmi_vdev_set_param(ar, arvif->vdev_id, vdev_param,
-+						hw_rate_code);
-+		if (ret)
-+			ath10k_warn(ar, "failed to set mgmt tx rate %d\n", ret);
- 	}
- 
- 	mutex_unlock(&ar->conf_mutex);
diff --git a/package/kernel/mac80211/patches/ath/979-ath10k-fix-incorrect-multicast-broadcast-rate-settin.patch b/package/kernel/mac80211/patches/ath/979-ath10k-fix-incorrect-multicast-broadcast-rate-settin.patch
index 8695b7e094..0c98be2ada 100644
--- a/package/kernel/mac80211/patches/ath/979-ath10k-fix-incorrect-multicast-broadcast-rate-settin.patch
+++ b/package/kernel/mac80211/patches/ath/979-ath10k-fix-incorrect-multicast-broadcast-rate-settin.patch
@@ -17,7 +17,7 @@ Origin: other, https://patchwork.kernel.org/patch/10723033/
 
 --- a/drivers/net/wireless/ath/ath10k/mac.c
 +++ b/drivers/net/wireless/ath/ath10k/mac.c
-@@ -5484,8 +5484,8 @@ static void ath10k_bss_info_changed(stru
+@@ -5604,8 +5604,8 @@ static void ath10k_bss_info_changed(stru
  	struct cfg80211_chan_def def;
  	u32 vdev_param, pdev_param, slottime, preamble;
  	u16 bitrate, hw_value;
@@ -28,9 +28,9 @@ Origin: other, https://patchwork.kernel.org/patch/10723033/
  	enum nl80211_band band;
  	const struct ieee80211_supported_band *sband;
  
-@@ -5658,7 +5658,11 @@ static void ath10k_bss_info_changed(stru
+@@ -5792,7 +5792,11 @@ static void ath10k_bss_info_changed(stru
  	if (changed & BSS_CHANGED_MCAST_RATE &&
- 	    !WARN_ON(ath10k_mac_vif_chan(arvif->vif, &def))) {
+ 	    !ath10k_mac_vif_chan(arvif->vif, &def)) {
  		band = def.chan->band;
 -		rateidx = vif->bss_conf.mcast_rate[band] - 1;
 +		mcast_rate = vif->bss_conf.mcast_rate[band];
diff --git a/package/kernel/mac80211/patches/ath/980-ath10k-fix-max-antenna-gain-unit.patch b/package/kernel/mac80211/patches/ath/980-ath10k-fix-max-antenna-gain-unit.patch
index 9cd23ce1b7..49f6057799 100644
--- a/package/kernel/mac80211/patches/ath/980-ath10k-fix-max-antenna-gain-unit.patch
+++ b/package/kernel/mac80211/patches/ath/980-ath10k-fix-max-antenna-gain-unit.patch
@@ -20,7 +20,7 @@ Forwarded: https://patchwork.kernel.org/patch/10986723/
 
 --- a/drivers/net/wireless/ath/ath10k/mac.c
 +++ b/drivers/net/wireless/ath/ath10k/mac.c
-@@ -1020,7 +1020,7 @@ static int ath10k_monitor_vdev_start(str
+@@ -1009,7 +1009,7 @@ static int ath10k_monitor_vdev_start(str
  	arg.channel.min_power = 0;
  	arg.channel.max_power = channel->max_power * 2;
  	arg.channel.max_reg_power = channel->max_reg_power * 2;
@@ -29,7 +29,7 @@ Forwarded: https://patchwork.kernel.org/patch/10986723/
  
  	reinit_completion(&ar->vdev_setup_done);
  
-@@ -1462,7 +1462,7 @@ static int ath10k_vdev_start_restart(str
+@@ -1451,7 +1451,7 @@ static int ath10k_vdev_start_restart(str
  	arg.channel.min_power = 0;
  	arg.channel.max_power = chandef->chan->max_power * 2;
  	arg.channel.max_reg_power = chandef->chan->max_reg_power * 2;
@@ -38,7 +38,7 @@ Forwarded: https://patchwork.kernel.org/patch/10986723/
  
  	if (arvif->vdev_type == WMI_VDEV_TYPE_AP) {
  		arg.ssid = arvif->u.ap.ssid;
-@@ -3139,7 +3139,7 @@ static int ath10k_update_channel_list(st
+@@ -3128,7 +3128,7 @@ static int ath10k_update_channel_list(st
  			ch->min_power = 0;
  			ch->max_power = channel->max_power * 2;
  			ch->max_reg_power = channel->max_reg_power * 2;
diff --git a/package/kernel/mac80211/patches/ath/981-ath10k-adjust-tx-power-reduction-for-US-regulatory-d.patch b/package/kernel/mac80211/patches/ath/981-ath10k-adjust-tx-power-reduction-for-US-regulatory-d.patch
index 07247a0577..bea5eaa7ae 100644
--- a/package/kernel/mac80211/patches/ath/981-ath10k-adjust-tx-power-reduction-for-US-regulatory-d.patch
+++ b/package/kernel/mac80211/patches/ath/981-ath10k-adjust-tx-power-reduction-for-US-regulatory-d.patch
@@ -28,8 +28,8 @@ Forwarded: no
 
 --- a/drivers/net/wireless/ath/ath10k/mac.c
 +++ b/drivers/net/wireless/ath/ath10k/mac.c
-@@ -988,6 +988,40 @@ static inline int ath10k_vdev_setup_sync
- 	return 0;
+@@ -977,6 +977,40 @@ static inline int ath10k_vdev_setup_sync
+ 	return ar->last_wmi_vdev_start_status;
  }
  
 +static u32 ath10k_get_max_antenna_gain(struct ath10k *ar,
@@ -69,7 +69,7 @@ Forwarded: no
  static int ath10k_monitor_vdev_start(struct ath10k *ar, int vdev_id)
  {
  	struct cfg80211_chan_def *chandef = NULL;
-@@ -1020,7 +1054,8 @@ static int ath10k_monitor_vdev_start(str
+@@ -1009,7 +1043,8 @@ static int ath10k_monitor_vdev_start(str
  	arg.channel.min_power = 0;
  	arg.channel.max_power = channel->max_power * 2;
  	arg.channel.max_reg_power = channel->max_reg_power * 2;
@@ -79,7 +79,7 @@ Forwarded: no
  
  	reinit_completion(&ar->vdev_setup_done);
  
-@@ -1462,7 +1497,8 @@ static int ath10k_vdev_start_restart(str
+@@ -1451,7 +1486,8 @@ static int ath10k_vdev_start_restart(str
  	arg.channel.min_power = 0;
  	arg.channel.max_power = chandef->chan->max_power * 2;
  	arg.channel.max_reg_power = chandef->chan->max_reg_power * 2;
@@ -89,7 +89,7 @@ Forwarded: no
  
  	if (arvif->vdev_type == WMI_VDEV_TYPE_AP) {
  		arg.ssid = arvif->u.ap.ssid;
-@@ -3139,7 +3175,8 @@ static int ath10k_update_channel_list(st
+@@ -3128,7 +3164,8 @@ static int ath10k_update_channel_list(st
  			ch->min_power = 0;
  			ch->max_power = channel->max_power * 2;
  			ch->max_reg_power = channel->max_reg_power * 2;
diff --git a/package/kernel/mac80211/patches/brcm/040-brcmutil_option.patch b/package/kernel/mac80211/patches/brcm/040-brcmutil_option.patch
index 167332d916..3e8505b5b4 100644
--- a/package/kernel/mac80211/patches/brcm/040-brcmutil_option.patch
+++ b/package/kernel/mac80211/patches/brcm/040-brcmutil_option.patch
@@ -1,6 +1,7 @@
 --- a/drivers/net/wireless/broadcom/brcm80211/Kconfig
 +++ b/drivers/net/wireless/broadcom/brcm80211/Kconfig
-@@ -1,5 +1,5 @@
+@@ -1,6 +1,6 @@
+ # SPDX-License-Identifier: GPL-2.0-only
  config BRCMUTIL
 -	tristate
 +	tristate "Broadcom 802.11 driver utility functions"
diff --git a/package/kernel/mac80211/patches/brcm/300-v4.20-0001-brcmfmac-add-CYW89342-mini-PCIe-device.patch b/package/kernel/mac80211/patches/brcm/300-v4.20-0001-brcmfmac-add-CYW89342-mini-PCIe-device.patch
deleted file mode 100644
index d0d9b20373..0000000000
--- a/package/kernel/mac80211/patches/brcm/300-v4.20-0001-brcmfmac-add-CYW89342-mini-PCIe-device.patch
+++ /dev/null
@@ -1,25 +0,0 @@
.....
diff --git a/package/kernel/mac80211/patches/brcm/302-v4.20-0001-brcmfmac-fix-wrong-strnchr-usage.patch b/package/kernel/mac80211/patches/brcm/302-v4.20-0001-brcmfmac-fix-wrong-strnchr-usage.patch
deleted file mode 100644
index 8267b37864..0000000000
--- a/package/kernel/mac80211/patches/brcm/302-v4.20-0001-brcmfmac-fix-wrong-strnchr-usage.patch
+++ /dev/null
@@ -1,38 +0,0 @@
.....
diff --git a/package/kernel/mac80211/patches/brcm/304-v4.20-0002-brcmfmac-increase-buffer-for-obtaining-firmware-capa.patch b/package/kernel/mac80211/patches/brcm/304-v4.20-0002-brcmfmac-increase-buffer-for-obtaining-firmware-capa.patch
deleted file mode 100644
index 11fb4bce45..0000000000
--- a/package/kernel/mac80211/patches/brcm/304-v4.20-0002-brcmfmac-increase-buffer-for-obtaining-firmware-capa.patch
+++ /dev/null
@@ -1,28 +0,0 @@
.....
diff --git a/package/kernel/mac80211/patches/brcm/305-v4.20-0001-brcmfmac-remove-set-but-not-used-variables-sfdoff-an.patch b/package/kernel/mac80211/patches/brcm/305-v4.20-0001-brcmfmac-remove-set-but-not-used-variables-sfdoff-an.patch
deleted file mode 100644
index 192ed1a770..0000000000
--- a/package/kernel/mac80211/patches/brcm/305-v4.20-0001-brcmfmac-remove-set-but-not-used-variables-sfdoff-an.patch
+++ /dev/null
@@ -1,57 +0,0 @@
.....
diff --git a/package/kernel/mac80211/patches/brcm/306-v4.20-0001-brcmfmac-reduce-timeout-for-action-frame-scan.patch b/package/kernel/mac80211/patches/brcm/306-v4.20-0001-brcmfmac-reduce-timeout-for-action-frame-scan.patch
deleted file mode 100644
index a71c1aee03..0000000000
--- a/package/kernel/mac80211/patches/brcm/306-v4.20-0001-brcmfmac-reduce-timeout-for-action-frame-scan.patch
+++ /dev/null
@@ -1,67 +0,0 @@
.....
diff --git a/package/kernel/mac80211/patches/brcm/306-v4.20-0002-brcmfmac-fix-full-timeout-waiting-for-action-frame-o.patch b/package/kernel/mac80211/patches/brcm/306-v4.20-0002-brcmfmac-fix-full-timeout-waiting-for-action-frame-o.patch
deleted file mode 100644
index ef2d0934fc..0000000000
--- a/package/kernel/mac80211/patches/brcm/306-v4.20-0002-brcmfmac-fix-full-timeout-waiting-for-action-frame-o.patch
+++ /dev/null
@@ -1,79 +0,0 @@
.....
diff --git a/package/kernel/mac80211/patches/brcm/320-v5.0-0001-brcmfmac-Remove-firmware-loading-code-duplication.patch b/package/kernel/mac80211/patches/brcm/320-v5.0-0001-brcmfmac-Remove-firmware-loading-code-duplication.patch
deleted file mode 100644
index eca15a516e..0000000000
--- a/package/kernel/mac80211/patches/brcm/320-v5.0-0001-brcmfmac-Remove-firmware-loading-code-duplication.patch
+++ /dev/null
@@ -1,102 +0,0 @@
.....
diff --git a/package/kernel/mac80211/patches/brcm/320-v5.0-0002-brcmfmac-Remove-recursion-from-firmware-load-error-h.patch b/package/kernel/mac80211/patches/brcm/320-v5.0-0002-brcmfmac-Remove-recursion-from-firmware-load-error-h.patch
deleted file mode 100644
index 1a4a1ec348..0000000000
--- a/package/kernel/mac80211/patches/brcm/320-v5.0-0002-brcmfmac-Remove-recursion-from-firmware-load-error-h.patch
+++ /dev/null
@@ -1,127 +0,0 @@
.....
diff --git a/package/kernel/mac80211/patches/brcm/320-v5.0-0003-brcmfmac-Add-support-for-first-trying-to-get-a-board.patch b/package/kernel/mac80211/patches/brcm/320-v5.0-0003-brcmfmac-Add-support-for-first-trying-to-get-a-board.patch
deleted file mode 100644
index 727dcbe85a..0000000000
--- a/package/kernel/mac80211/patches/brcm/320-v5.0-0003-brcmfmac-Add-support-for-first-trying-to-get-a-board.patch
+++ /dev/null
@@ -1,77 +0,0 @@
.....
diff --git a/package/kernel/mac80211/patches/brcm/320-v5.0-0004-brcmfmac-Set-board_type-used-for-nvram-file-selectio.patch b/package/kernel/mac80211/patches/brcm/320-v5.0-0004-brcmfmac-Set-board_type-used-for-nvram-file-selectio.patch
deleted file mode 100644
index a33ceaa21e..0000000000
--- a/package/kernel/mac80211/patches/brcm/320-v5.0-0004-brcmfmac-Set-board_type-used-for-nvram-file-selectio.patch
+++ /dev/null
@@ -1,77 +0,0 @@
.....
diff --git a/package/kernel/mac80211/patches/brcm/320-v5.0-0005-brcmfmac-Set-board_type-from-DMI-on-x86-based-machin.patch b/package/kernel/mac80211/patches/brcm/320-v5.0-0005-brcmfmac-Set-board_type-from-DMI-on-x86-based-machin.patch
deleted file mode 100644
index 25426e3f10..0000000000
--- a/package/kernel/mac80211/patches/brcm/320-v5.0-0005-brcmfmac-Set-board_type-from-DMI-on-x86-based-machin.patch
+++ /dev/null
@@ -1,179 +0,0 @@
.....
diff --git a/package/kernel/mac80211/patches/brcm/320-v5.0-0006-brcmfmac-Cleanup-brcmf_fw_request_done.patch b/package/kernel/mac80211/patches/brcm/320-v5.0-0006-brcmfmac-Cleanup-brcmf_fw_request_done.patch
deleted file mode 100644
index 211e9e4a9f..0000000000
--- a/package/kernel/mac80211/patches/brcm/320-v5.0-0006-brcmfmac-Cleanup-brcmf_fw_request_done.patch
+++ /dev/null
@@ -1,41 +0,0 @@
.....
diff --git a/package/kernel/mac80211/patches/brcm/321-v5.0-0001-brcmfmac-Add-support-for-getting-nvram-contents-from.patch b/package/kernel/mac80211/patches/brcm/321-v5.0-0001-brcmfmac-Add-support-for-getting-nvram-contents-from.patch
deleted file mode 100644
index 88e5c67735..0000000000
--- a/package/kernel/mac80211/patches/brcm/321-v5.0-0001-brcmfmac-Add-support-for-getting-nvram-contents-from.patch
+++ /dev/null
@@ -1,132 +0,0 @@
.....
diff --git a/package/kernel/mac80211/patches/brcm/321-v5.0-0002-brcmfmac-Fix-ccode-from-EFI-nvram-when-necessary.patch b/package/kernel/mac80211/patches/brcm/321-v5.0-0002-brcmfmac-Fix-ccode-from-EFI-nvram-when-necessary.patch
deleted file mode 100644
index c2fd620d6c..0000000000
--- a/package/kernel/mac80211/patches/brcm/321-v5.0-0002-brcmfmac-Fix-ccode-from-EFI-nvram-when-necessary.patch
+++ /dev/null
@@ -1,97 +0,0 @@
.....
diff --git a/package/kernel/mac80211/patches/brcm/322-v5.0-0001-brcmfmac-fix-spelling-mistake-Retreiving-Retrieving.patch b/package/kernel/mac80211/patches/brcm/322-v5.0-0001-brcmfmac-fix-spelling-mistake-Retreiving-Retrieving.patch
deleted file mode 100644
index c1aea25cba..0000000000
--- a/package/kernel/mac80211/patches/brcm/322-v5.0-0001-brcmfmac-fix-spelling-mistake-Retreiving-Retrieving.patch
+++ /dev/null
@@ -1,34 +0,0 @@
.....
diff --git a/package/kernel/mac80211/patches/brcm/323-v5.0-0001-brcmutil-print-invalid-chanspec-when-WARN-ing.patch b/package/kernel/mac80211/patches/brcm/323-v5.0-0001-brcmutil-print-invalid-chanspec-when-WARN-ing.patch
deleted file mode 100644
index 566336cbc3..0000000000
--- a/package/kernel/mac80211/patches/brcm/323-v5.0-0001-brcmutil-print-invalid-chanspec-when-WARN-ing.patch
+++ /dev/null
@@ -1,83 +0,0 @@
.....
diff --git a/package/kernel/mac80211/patches/brcm/325-v5.0-brcmfmac-support-STA-info-struct-v7.patch b/package/kernel/mac80211/patches/brcm/325-v5.0-brcmfmac-support-STA-info-struct-v7.patch
deleted file mode 100644
index 8ff42462b0..0000000000
--- a/package/kernel/mac80211/patches/brcm/325-v5.0-brcmfmac-support-STA-info-struct-v7.patch
+++ /dev/null
@@ -1,80 +0,0 @@
.....
diff --git a/package/kernel/mac80211/patches/brcm/326-v5.0-brcmfmac-Call-brcmf_dmi_probe-before-brcmf_of_probe.patch b/package/kernel/mac80211/patches/brcm/326-v5.0-brcmfmac-Call-brcmf_dmi_probe-before-brcmf_of_probe.patch
deleted file mode 100644
index 01621561c1..0000000000
--- a/package/kernel/mac80211/patches/brcm/326-v5.0-brcmfmac-Call-brcmf_dmi_probe-before-brcmf_of_probe.patch
+++ /dev/null
@@ -1,39 +0,0 @@
.....
diff --git a/package/kernel/mac80211/patches/brcm/328-v5.0-0001-brcmfmac-add-credit-numbers-updating-support.patch b/package/kernel/mac80211/patches/brcm/328-v5.0-0001-brcmfmac-add-credit-numbers-updating-support.patch
deleted file mode 100644
index dd40ee2b1f..0000000000
--- a/package/kernel/mac80211/patches/brcm/328-v5.0-0001-brcmfmac-add-credit-numbers-updating-support.patch
+++ /dev/null
@@ -1,95 +0,0 @@
.....
diff --git a/package/kernel/mac80211/patches/brcm/328-v5.0-0002-brcmfmac-enable-frameburst-mode-in-default-firmware-.patch b/package/kernel/mac80211/patches/brcm/328-v5.0-0002-brcmfmac-enable-frameburst-mode-in-default-firmware-.patch
deleted file mode 100644
index 9602792d4f..0000000000
--- a/package/kernel/mac80211/patches/brcm/328-v5.0-0002-brcmfmac-enable-frameburst-mode-in-default-firmware-.patch
+++ /dev/null
@@ -1,42 +0,0 @@
.....
diff --git a/package/kernel/mac80211/patches/brcm/328-v5.0-0003-brcmfmac-handle-compressed-tx-status-signal.patch b/package/kernel/mac80211/patches/brcm/328-v5.0-0003-brcmfmac-handle-compressed-tx-status-signal.patch
deleted file mode 100644
index d44c8737ad..0000000000
--- a/package/kernel/mac80211/patches/brcm/328-v5.0-0003-brcmfmac-handle-compressed-tx-status-signal.patch
+++ /dev/null
@@ -1,229 +0,0 @@
.....
diff --git a/package/kernel/mac80211/patches/brcm/329-v5.0-0001-brcmfmac-add-4354-raw-pcie-device-id.patch b/package/kernel/mac80211/patches/brcm/329-v5.0-0001-brcmfmac-add-4354-raw-pcie-device-id.patch
deleted file mode 100644
index ead33db0d5..0000000000
--- a/package/kernel/mac80211/patches/brcm/329-v5.0-0001-brcmfmac-add-4354-raw-pcie-device-id.patch
+++ /dev/null
@@ -1,36 +0,0 @@
.....
diff --git a/package/kernel/mac80211/patches/brcm/329-v5.0-0002-brcmfmac-set-F2-watermark-to-256-for-4373.patch b/package/kernel/mac80211/patches/brcm/329-v5.0-0002-brcmfmac-set-F2-watermark-to-256-for-4373.patch
deleted file mode 100644
index a915473b8c..0000000000
--- a/package/kernel/mac80211/patches/brcm/329-v5.0-0002-brcmfmac-set-F2-watermark-to-256-for-4373.patch
+++ /dev/null
@@ -1,73 +0,0 @@
.....
diff --git a/package/kernel/mac80211/patches/brcm/329-v5.0-0003-brcmfmac-set-SDIO-F1-MesBusyCtrl-for-CYW4373.patch b/package/kernel/mac80211/patches/brcm/329-v5.0-0003-brcmfmac-set-SDIO-F1-MesBusyCtrl-for-CYW4373.patch
deleted file mode 100644
index 0e22a1545e..0000000000
--- a/package/kernel/mac80211/patches/brcm/329-v5.0-0003-brcmfmac-set-SDIO-F1-MesBusyCtrl-for-CYW4373.patch
+++ /dev/null
@@ -1,55 +0,0 @@
.....
diff --git a/package/kernel/mac80211/patches/brcm/329-v5.0-0004-brcmfmac-add-support-for-CYW43012-SDIO-chipset.patch b/package/kernel/mac80211/patches/brcm/329-v5.0-0004-brcmfmac-add-support-for-CYW43012-SDIO-chipset.patch
deleted file mode 100644
index e53d4bafa0..0000000000
--- a/package/kernel/mac80211/patches/brcm/329-v5.0-0004-brcmfmac-add-support-for-CYW43012-SDIO-chipset.patch
+++ /dev/null
@@ -1,253 +0,0 @@
.....
diff --git a/package/kernel/mac80211/patches/brcm/329-v5.0-0005-brcmfmac-allow-GCI-core-enumuration.patch b/package/kernel/mac80211/patches/brcm/329-v5.0-0005-brcmfmac-allow-GCI-core-enumuration.patch
deleted file mode 100644
index 809ee9a516..0000000000
--- a/package/kernel/mac80211/patches/brcm/329-v5.0-0005-brcmfmac-allow-GCI-core-enumuration.patch
+++ /dev/null
@@ -1,60 +0,0 @@
.....
diff --git a/package/kernel/mac80211/patches/brcm/329-v5.0-0006-brcmfmac-update-43012-F2-watermark-setting-to-fix-DM.patch b/package/kernel/mac80211/patches/brcm/329-v5.0-0006-brcmfmac-update-43012-F2-watermark-setting-to-fix-DM.patch
deleted file mode 100644
index 3b44952af4..0000000000
--- a/package/kernel/mac80211/patches/brcm/329-v5.0-0006-brcmfmac-update-43012-F2-watermark-setting-to-fix-DM.patch
+++ /dev/null
@@ -1,49 +0,0 @@
.....
diff --git a/package/kernel/mac80211/patches/brcm/329-v5.0-0007-brcmfmac-4373-save-restore-support.patch b/package/kernel/mac80211/patches/brcm/329-v5.0-0007-brcmfmac-4373-save-restore-support.patch
deleted file mode 100644
index 61c65692de..0000000000
--- a/package/kernel/mac80211/patches/brcm/329-v5.0-0007-brcmfmac-4373-save-restore-support.patch
+++ /dev/null
@@ -1,57 +0,0 @@
.....
diff --git a/package/kernel/mac80211/patches/brcm/329-v5.0-0008-brcmfmac-disable-command-decode-in-sdio_aos.patch b/package/kernel/mac80211/patches/brcm/329-v5.0-0008-brcmfmac-disable-command-decode-in-sdio_aos.patch
deleted file mode 100644
index a1125e588d..0000000000
--- a/package/kernel/mac80211/patches/brcm/329-v5.0-0008-brcmfmac-disable-command-decode-in-sdio_aos.patch
+++ /dev/null
@@ -1,45 +0,0 @@
.....
diff --git a/package/kernel/mac80211/patches/brcm/330-v5.0-0001-brcmfmac-fix-false-positive-Wmaybe-unintialized-warn.patch b/package/kernel/mac80211/patches/brcm/330-v5.0-0001-brcmfmac-fix-false-positive-Wmaybe-unintialized-warn.patch
deleted file mode 100644
index 5d454fd3ee..0000000000
--- a/package/kernel/mac80211/patches/brcm/330-v5.0-0001-brcmfmac-fix-false-positive-Wmaybe-unintialized-warn.patch
+++ /dev/null
@@ -1,34 +0,0 @@
.....
diff --git a/package/kernel/mac80211/patches/brcm/332-v5.0-0001-brcmfmac-Fix-access-point-mode.patch b/package/kernel/mac80211/patches/brcm/332-v5.0-0001-brcmfmac-Fix-access-point-mode.patch
deleted file mode 100644
index acf587676e..0000000000
--- a/package/kernel/mac80211/patches/brcm/332-v5.0-0001-brcmfmac-Fix-access-point-mode.patch
+++ /dev/null
@@ -1,41 +0,0 @@
.....
diff --git a/package/kernel/mac80211/patches/brcm/340-v5.1-brcmfmac-Add-DMI-nvram-filename-quirk-for-PoV-TAB-P1.patch b/package/kernel/mac80211/patches/brcm/340-v5.1-brcmfmac-Add-DMI-nvram-filename-quirk-for-PoV-TAB-P1.patch
deleted file mode 100644
index 4cb3a4243a..0000000000
--- a/package/kernel/mac80211/patches/brcm/340-v5.1-brcmfmac-Add-DMI-nvram-filename-quirk-for-PoV-TAB-P1.patch
+++ /dev/null
@@ -1,51 +0,0 @@
.....
diff --git a/package/kernel/mac80211/patches/brcm/341-v5.1-brcmfmac-add-a-check-for-the-status-of-usb_register.patch b/package/kernel/mac80211/patches/brcm/341-v5.1-brcmfmac-add-a-check-for-the-status-of-usb_register.patch
deleted file mode 100644
index 3568910678..0000000000
--- a/package/kernel/mac80211/patches/brcm/341-v5.1-brcmfmac-add-a-check-for-the-status-of-usb_register.patch
+++ /dev/null
@@ -1,28 +0,0 @@
.....
diff --git a/package/kernel/mac80211/patches/brcm/342-v5.1-brcmfmac-fix-system-warning-message-during-wowl-susp.patch b/package/kernel/mac80211/patches/brcm/342-v5.1-brcmfmac-fix-system-warning-message-during-wowl-susp.patch
deleted file mode 100644
index 9115373add..0000000000
--- a/package/kernel/mac80211/patches/brcm/342-v5.1-brcmfmac-fix-system-warning-message-during-wowl-susp.patch
+++ /dev/null
@@ -1,33 +0,0 @@
.....
diff --git a/package/kernel/mac80211/patches/brcm/344-v5.1-brcmfmac-modify-__brcmf_err-to-take-bus-as-a-paramet.patch b/package/kernel/mac80211/patches/brcm/344-v5.1-brcmfmac-modify-__brcmf_err-to-take-bus-as-a-paramet.patch
deleted file mode 100644
index f83f38f274..0000000000
--- a/package/kernel/mac80211/patches/brcm/344-v5.1-brcmfmac-modify-__brcmf_err-to-take-bus-as-a-paramet.patch
+++ /dev/null
@@ -1,104 +0,0 @@
.....
diff --git a/package/kernel/mac80211/patches/brcm/345-v5.1-brcmfmac-pass-bus-to-the-__brcmf_err-in-pcie.c.patch b/package/kernel/mac80211/patches/brcm/345-v5.1-brcmfmac-pass-bus-to-the-__brcmf_err-in-pcie.c.patch
deleted file mode 100644
index 8eceee6859..0000000000
--- a/package/kernel/mac80211/patches/brcm/345-v5.1-brcmfmac-pass-bus-to-the-__brcmf_err-in-pcie.c.patch
+++ /dev/null
@@ -1,266 +0,0 @@
.....
diff --git a/package/kernel/mac80211/patches/brcm/346-v5.1-brcmfmac-add-bphy_err-and-use-it-in-the-cfg80211.c.patch b/package/kernel/mac80211/patches/brcm/346-v5.1-brcmfmac-add-bphy_err-and-use-it-in-the-cfg80211.c.patch
deleted file mode 100644
index efd77d4c00..0000000000
--- a/package/kernel/mac80211/patches/brcm/346-v5.1-brcmfmac-add-bphy_err-and-use-it-in-the-cfg80211.c.patch
+++ /dev/null
@@ -1,2025 +0,0 @@
.....
diff --git a/package/kernel/mac80211/patches/brcm/347-v5.1-brcmfmac-fix-typos.patch b/package/kernel/mac80211/patches/brcm/347-v5.1-brcmfmac-fix-typos.patch
deleted file mode 100644
index e21c1ee60a..0000000000
--- a/package/kernel/mac80211/patches/brcm/347-v5.1-brcmfmac-fix-typos.patch
+++ /dev/null
@@ -1,62 +0,0 @@
.....
diff --git a/package/kernel/mac80211/patches/brcm/348-v5.1-brcmfmac-support-monitor-frames-with-the-hardware-uc.patch b/package/kernel/mac80211/patches/brcm/348-v5.1-brcmfmac-support-monitor-frames-with-the-hardware-uc.patch
deleted file mode 100644
index c93bcf0ce9..0000000000
--- a/package/kernel/mac80211/patches/brcm/348-v5.1-brcmfmac-support-monitor-frames-with-the-hardware-uc.patch
+++ /dev/null
@@ -1,143 +0,0 @@
.....
diff --git a/package/kernel/mac80211/patches/brcm/349-v5.1-0001-brcmfmac-assure-SSID-length-from-firmware-is-limited.patch b/package/kernel/mac80211/patches/brcm/349-v5.1-0001-brcmfmac-assure-SSID-length-from-firmware-is-limited.patch
deleted file mode 100644
index 78db26870b..0000000000
--- a/package/kernel/mac80211/patches/brcm/349-v5.1-0001-brcmfmac-assure-SSID-length-from-firmware-is-limited.patch
+++ /dev/null
@@ -1,28 +0,0 @@
.....
diff --git a/package/kernel/mac80211/patches/brcm/349-v5.1-0002-brcmfmac-add-subtype-check-for-event-handling-in-dat.patch b/package/kernel/mac80211/patches/brcm/349-v5.1-0002-brcmfmac-add-subtype-check-for-event-handling-in-dat.patch
deleted file mode 100644
index 57946dabed..0000000000
--- a/package/kernel/mac80211/patches/brcm/349-v5.1-0002-brcmfmac-add-subtype-check-for-event-handling-in-dat.patch
+++ /dev/null
@@ -1,96 +0,0 @@
.....
diff --git a/package/kernel/mac80211/patches/brcm/349-v5.1-0003-brcmfmac-create-debugfs-files-for-bus-specific-layer.patch b/package/kernel/mac80211/patches/brcm/349-v5.1-0003-brcmfmac-create-debugfs-files-for-bus-specific-layer.patch
deleted file mode 100644
index b58ec4b7e9..0000000000
--- a/package/kernel/mac80211/patches/brcm/349-v5.1-0003-brcmfmac-create-debugfs-files-for-bus-specific-layer.patch
+++ /dev/null
@@ -1,101 +0,0 @@
.....
diff --git a/package/kernel/mac80211/patches/brcm/349-v5.1-0004-brcmfmac-disable-MBSS-feature-for-bcm4330-device.patch b/package/kernel/mac80211/patches/brcm/349-v5.1-0004-brcmfmac-disable-MBSS-feature-for-bcm4330-device.patch
deleted file mode 100644
index e6602d7900..0000000000
--- a/package/kernel/mac80211/patches/brcm/349-v5.1-0004-brcmfmac-disable-MBSS-feature-for-bcm4330-device.patch
+++ /dev/null
@@ -1,41 +0,0 @@
.....
diff --git a/package/kernel/mac80211/patches/brcm/349-v5.1-0005-brcmfmac-check-and-dump-trap-info-during-sdio-probe.patch b/package/kernel/mac80211/patches/brcm/349-v5.1-0005-brcmfmac-check-and-dump-trap-info-during-sdio-probe.patch
deleted file mode 100644
index dce4331585..0000000000
--- a/package/kernel/mac80211/patches/brcm/349-v5.1-0005-brcmfmac-check-and-dump-trap-info-during-sdio-probe.patch
+++ /dev/null
@@ -1,121 +0,0 @@
.....
diff --git a/package/kernel/mac80211/patches/brcm/349-v5.1-0006-brcmfmac-use-chipname-in-brcmf_fw_alloc_request-for-.patch b/package/kernel/mac80211/patches/brcm/349-v5.1-0006-brcmfmac-use-chipname-in-brcmf_fw_alloc_request-for-.patch
deleted file mode 100644
index 23180c7236..0000000000
--- a/package/kernel/mac80211/patches/brcm/349-v5.1-0006-brcmfmac-use-chipname-in-brcmf_fw_alloc_request-for-.patch
+++ /dev/null
@@ -1,42 +0,0 @@
.....
diff --git a/package/kernel/mac80211/patches/brcm/350-v5.1-brcmfmac-print-firmware-reported-ring-status-errors.patch b/package/kernel/mac80211/patches/brcm/350-v5.1-brcmfmac-print-firmware-reported-ring-status-errors.patch
deleted file mode 100644
index b41b9cebf4..0000000000
--- a/package/kernel/mac80211/patches/brcm/350-v5.1-brcmfmac-print-firmware-reported-ring-status-errors.patch
+++ /dev/null
@@ -1,67 +0,0 @@
.....
diff --git a/package/kernel/mac80211/patches/brcm/351-v5.1-0001-brcmfmac-improve-code-handling-bandwidth-of-firmware.patch b/package/kernel/mac80211/patches/brcm/351-v5.1-0001-brcmfmac-improve-code-handling-bandwidth-of-firmware.patch
deleted file mode 100644
index 4e49246554..0000000000
--- a/package/kernel/mac80211/patches/brcm/351-v5.1-0001-brcmfmac-improve-code-handling-bandwidth-of-firmware.patch
+++ /dev/null
@@ -1,42 +0,0 @@
.....
diff --git a/package/kernel/mac80211/patches/brcm/351-v5.1-0002-brcmfmac-support-firmware-reporting-160-MHz-channels.patch b/package/kernel/mac80211/patches/brcm/351-v5.1-0002-brcmfmac-support-firmware-reporting-160-MHz-channels.patch
deleted file mode 100644
index a809378d13..0000000000
--- a/package/kernel/mac80211/patches/brcm/351-v5.1-0002-brcmfmac-support-firmware-reporting-160-MHz-channels.patch
+++ /dev/null
@@ -1,30 +0,0 @@
.....
diff --git a/package/kernel/mac80211/patches/brcm/352-v5.1-brcmfmac-rework-bphy_err-to-take-struct-brcmf_pub-ar.patch b/package/kernel/mac80211/patches/brcm/352-v5.1-brcmfmac-rework-bphy_err-to-take-struct-brcmf_pub-ar.patch
deleted file mode 100644
index 27931db840..0000000000
--- a/package/kernel/mac80211/patches/brcm/352-v5.1-brcmfmac-rework-bphy_err-to-take-struct-brcmf_pub-ar.patch
+++ /dev/null
@@ -1,2290 +0,0 @@
.....
diff --git a/package/kernel/mac80211/patches/brcm/353-v5.1-brcmfmac-remove-set-but-not-used-variable-old_state.patch b/package/kernel/mac80211/patches/brcm/353-v5.1-brcmfmac-remove-set-but-not-used-variable-old_state.patch
deleted file mode 100644
index 2a46378e73..0000000000
--- a/package/kernel/mac80211/patches/brcm/353-v5.1-brcmfmac-remove-set-but-not-used-variable-old_state.patch
+++ /dev/null
@@ -1,38 +0,0 @@
.....
diff --git a/package/kernel/mac80211/patches/brcm/354-v5.1-brcmfmac-use-bphy_err-in-all-wiphy-related-code.patch b/package/kernel/mac80211/patches/brcm/354-v5.1-brcmfmac-use-bphy_err-in-all-wiphy-related-code.patch
deleted file mode 100644
index 5836f6ab87..0000000000
--- a/package/kernel/mac80211/patches/brcm/354-v5.1-brcmfmac-use-bphy_err-in-all-wiphy-related-code.patch
+++ /dev/null
@@ -1,1707 +0,0 @@
.....
diff --git a/package/kernel/mac80211/patches/brcm/355-v5.1-brcmfmac-add-basic-validation-of-shared-RAM-address.patch b/package/kernel/mac80211/patches/brcm/355-v5.1-brcmfmac-add-basic-validation-of-shared-RAM-address.patch
deleted file mode 100644
index 323e93354c..0000000000
--- a/package/kernel/mac80211/patches/brcm/355-v5.1-brcmfmac-add-basic-validation-of-shared-RAM-address.patch
+++ /dev/null
@@ -1,38 +0,0 @@
.....
diff --git a/package/kernel/mac80211/patches/brcm/356-v5.1-0001-brcmfmac-fix-size-of-the-struct-msgbuf_ring_status.patch b/package/kernel/mac80211/patches/brcm/356-v5.1-0001-brcmfmac-fix-size-of-the-struct-msgbuf_ring_status.patch
deleted file mode 100644
index 10834db608..0000000000
--- a/package/kernel/mac80211/patches/brcm/356-v5.1-0001-brcmfmac-fix-size-of-the-struct-msgbuf_ring_status.patch
+++ /dev/null
@@ -1,29 +0,0 @@
.....
diff --git a/package/kernel/mac80211/patches/brcm/356-v5.1-0002-brcmfmac-print-firmware-reported-general-status-erro.patch b/package/kernel/mac80211/patches/brcm/356-v5.1-0002-brcmfmac-print-firmware-reported-general-status-erro.patch
deleted file mode 100644
index 313d501e82..0000000000
--- a/package/kernel/mac80211/patches/brcm/356-v5.1-0002-brcmfmac-print-firmware-reported-general-status-erro.patch
+++ /dev/null
@@ -1,69 +0,0 @@
.....
diff --git a/package/kernel/mac80211/patches/brcm/360-v5.2-0001-brcmfmac-support-repeated-brcmf_fw_alloc_request-cal.patch b/package/kernel/mac80211/patches/brcm/360-v5.2-0001-brcmfmac-support-repeated-brcmf_fw_alloc_request-cal.patch
deleted file mode 100644
index ef694f079f..0000000000
--- a/package/kernel/mac80211/patches/brcm/360-v5.2-0001-brcmfmac-support-repeated-brcmf_fw_alloc_request-cal.patch
+++ /dev/null
@@ -1,32 +0,0 @@
.....
diff --git a/package/kernel/mac80211/patches/brcm/360-v5.2-0002-brcmfmac-add-a-function-designated-for-handling-firm.patch b/package/kernel/mac80211/patches/brcm/360-v5.2-0002-brcmfmac-add-a-function-designated-for-handling-firm.patch
deleted file mode 100644
index 595b8948c7..0000000000
--- a/package/kernel/mac80211/patches/brcm/360-v5.2-0002-brcmfmac-add-a-function-designated-for-handling-firm.patch
+++ /dev/null
@@ -1,79 +0,0 @@
.....
diff --git a/package/kernel/mac80211/patches/brcm/360-v5.2-0003-brcmfmac-reset-PCIe-bus-on-a-firmware-crash.patch b/package/kernel/mac80211/patches/brcm/360-v5.2-0003-brcmfmac-reset-PCIe-bus-on-a-firmware-crash.patch
deleted file mode 100644
index 5617d141b3..0000000000
--- a/package/kernel/mac80211/patches/brcm/360-v5.2-0003-brcmfmac-reset-PCIe-bus-on-a-firmware-crash.patch
+++ /dev/null
@@ -1,153 +0,0 @@
.....
diff --git a/package/kernel/mac80211/patches/brcm/361-v5.2-0001-brcmfmac-fix-WARNING-during-USB-disconnect-in-case-o.patch b/package/kernel/mac80211/patches/brcm/361-v5.2-0001-brcmfmac-fix-WARNING-during-USB-disconnect-in-case-o.patch
deleted file mode 100644
index cb4b5c924f..0000000000
--- a/package/kernel/mac80211/patches/brcm/361-v5.2-0001-brcmfmac-fix-WARNING-during-USB-disconnect-in-case-o.patch
+++ /dev/null
@@ -1,124 +0,0 @@
.....
diff --git a/package/kernel/mac80211/patches/brcm/361-v5.2-0002-brcmfmac-fix-NULL-pointer-derefence-during-USB-disco.patch b/package/kernel/mac80211/patches/brcm/361-v5.2-0002-brcmfmac-fix-NULL-pointer-derefence-during-USB-disco.patch
deleted file mode 100644
index e45288b63b..0000000000
--- a/package/kernel/mac80211/patches/brcm/361-v5.2-0002-brcmfmac-fix-NULL-pointer-derefence-during-USB-disco.patch
+++ /dev/null
@@ -1,217 +0,0 @@
.....
diff --git a/package/kernel/mac80211/patches/brcm/362-v5.2-0001-brcmfmac-fix-race-during-disconnect-when-USB-complet.patch b/package/kernel/mac80211/patches/brcm/362-v5.2-0001-brcmfmac-fix-race-during-disconnect-when-USB-complet.patch
deleted file mode 100644
index b6a11d6793..0000000000
--- a/package/kernel/mac80211/patches/brcm/362-v5.2-0001-brcmfmac-fix-race-during-disconnect-when-USB-complet.patch
+++ /dev/null
@@ -1,84 +0,0 @@
.....
diff --git a/package/kernel/mac80211/patches/brcm/362-v5.2-0002-brcmfmac-remove-pending-parameter-from-brcmf_usb_fre.patch b/package/kernel/mac80211/patches/brcm/362-v5.2-0002-brcmfmac-remove-pending-parameter-from-brcmf_usb_fre.patch
deleted file mode 100644
index 088e731322..0000000000
--- a/package/kernel/mac80211/patches/brcm/362-v5.2-0002-brcmfmac-remove-pending-parameter-from-brcmf_usb_fre.patch
+++ /dev/null
@@ -1,54 +0,0 @@
.....
diff --git a/package/kernel/mac80211/patches/brcm/362-v5.2-0003-brcmfmac-remove-unused-variable-i-from-brcmf_usb_fre.patch b/package/kernel/mac80211/patches/brcm/362-v5.2-0003-brcmfmac-remove-unused-variable-i-from-brcmf_usb_fre.patch
deleted file mode 100644
index 4c8d073914..0000000000
--- a/package/kernel/mac80211/patches/brcm/362-v5.2-0003-brcmfmac-remove-unused-variable-i-from-brcmf_usb_fre.patch
+++ /dev/null
@@ -1,29 +0,0 @@
.....
diff --git a/package/kernel/mac80211/patches/brcm/363-v5.2-brcmfmac-fix-Oops-when-bringing-up-interface-during-.patch b/package/kernel/mac80211/patches/brcm/363-v5.2-brcmfmac-fix-Oops-when-bringing-up-interface-during-.patch
deleted file mode 100644
index 01e9bf076d..0000000000
--- a/package/kernel/mac80211/patches/brcm/363-v5.2-brcmfmac-fix-Oops-when-bringing-up-interface-during-.patch
+++ /dev/null
@@ -1,123 +0,0 @@
.....
diff --git a/package/kernel/mac80211/patches/brcm/364-v5.2-brcmfmac-convert-dev_init_lock-mutex-to-completion.patch b/package/kernel/mac80211/patches/brcm/364-v5.2-brcmfmac-convert-dev_init_lock-mutex-to-completion.patch
deleted file mode 100644
index e6ecd2215f..0000000000
--- a/package/kernel/mac80211/patches/brcm/364-v5.2-brcmfmac-convert-dev_init_lock-mutex-to-completion.patch
+++ /dev/null
@@ -1,182 +0,0 @@
.....
diff --git a/package/kernel/mac80211/patches/brcm/365-v5.2-brcmfmac-fix-missing-checks-for-kmemdup.patch b/package/kernel/mac80211/patches/brcm/365-v5.2-brcmfmac-fix-missing-checks-for-kmemdup.patch
deleted file mode 100644
index 87974dcc6f..0000000000
--- a/package/kernel/mac80211/patches/brcm/365-v5.2-brcmfmac-fix-missing-checks-for-kmemdup.patch
+++ /dev/null
@@ -1,35 +0,0 @@
.....
diff --git a/package/kernel/mac80211/patches/brcm/366-v5.2-brcmfmac-Use-struct_size-in-kzalloc.patch b/package/kernel/mac80211/patches/brcm/366-v5.2-brcmfmac-Use-struct_size-in-kzalloc.patch
deleted file mode 100644
index d00a9d7964..0000000000
--- a/package/kernel/mac80211/patches/brcm/366-v5.2-brcmfmac-Use-struct_size-in-kzalloc.patch
+++ /dev/null
@@ -1,53 +0,0 @@
.....
diff --git a/package/kernel/mac80211/patches/brcm/367-v5.2-brcmfmac-Loading-the-correct-firmware-for-brcm43456.patch b/package/kernel/mac80211/patches/brcm/367-v5.2-brcmfmac-Loading-the-correct-firmware-for-brcm43456.patch
deleted file mode 100644
index d19284e672..0000000000
--- a/package/kernel/mac80211/patches/brcm/367-v5.2-brcmfmac-Loading-the-correct-firmware-for-brcm43456.patch
+++ /dev/null
@@ -1,35 +0,0 @@
.....
diff --git a/package/kernel/mac80211/patches/brcm/368-v5.2-brcmfmac-fix-leak-of-mypkt-on-error-return-path.patch b/package/kernel/mac80211/patches/brcm/368-v5.2-brcmfmac-fix-leak-of-mypkt-on-error-return-path.patch
deleted file mode 100644
index a9a9d74c10..0000000000
--- a/package/kernel/mac80211/patches/brcm/368-v5.2-brcmfmac-fix-leak-of-mypkt-on-error-return-path.patch
+++ /dev/null
@@ -1,41 +0,0 @@
.....
diff --git a/package/kernel/mac80211/patches/brcm/369-v5.2-brcmfmac-Add-DMI-nvram-filename-quirk-for-ACEPC-T8-a.patch b/package/kernel/mac80211/patches/brcm/369-v5.2-brcmfmac-Add-DMI-nvram-filename-quirk-for-ACEPC-T8-a.patch
deleted file mode 100644
index b0207d8e10..0000000000
--- a/package/kernel/mac80211/patches/brcm/369-v5.2-brcmfmac-Add-DMI-nvram-filename-quirk-for-ACEPC-T8-a.patch
+++ /dev/null
@@ -1,70 +0,0 @@
.....
diff --git a/package/kernel/mac80211/patches/brcm/370-v5.2-brcmfmac-send-mailbox-interrupt-twice-for-specific-h.patch b/package/kernel/mac80211/patches/brcm/370-v5.2-brcmfmac-send-mailbox-interrupt-twice-for-specific-h.patch
deleted file mode 100644
index c0a1fcd615..0000000000
--- a/package/kernel/mac80211/patches/brcm/370-v5.2-brcmfmac-send-mailbox-interrupt-twice-for-specific-h.patch
+++ /dev/null
@@ -1,32 +0,0 @@
.....
diff --git a/package/kernel/mac80211/patches/brcm/371-v5.2-Revert-brcmfmac-send-mailbox-interrupt-twice-for-spe.patch b/package/kernel/mac80211/patches/brcm/371-v5.2-Revert-brcmfmac-send-mailbox-interrupt-twice-for-spe.patch
deleted file mode 100644
index 8c7e6a8b93..0000000000
--- a/package/kernel/mac80211/patches/brcm/371-v5.2-Revert-brcmfmac-send-mailbox-interrupt-twice-for-spe.patch
+++ /dev/null
@@ -1,30 +0,0 @@
.....
diff --git a/package/kernel/mac80211/patches/brcm/372-v5.2-brcmfmac-send-mailbox-interrupt-twice-for-specific-h.patch b/package/kernel/mac80211/patches/brcm/372-v5.2-brcmfmac-send-mailbox-interrupt-twice-for-specific-h.patch
deleted file mode 100644
index 1fcf8c70c7..0000000000
--- a/package/kernel/mac80211/patches/brcm/372-v5.2-brcmfmac-send-mailbox-interrupt-twice-for-specific-h.patch
+++ /dev/null
@@ -1,39 +0,0 @@
.....
diff --git a/package/kernel/mac80211/patches/brcm/373-v5.2-brcm80211-potential-NULL-dereference-in-brcmf_cfg802.patch b/package/kernel/mac80211/patches/brcm/373-v5.2-brcm80211-potential-NULL-dereference-in-brcmf_cfg802.patch
deleted file mode 100644
index b4d56c34bc..0000000000
--- a/package/kernel/mac80211/patches/brcm/373-v5.2-brcm80211-potential-NULL-dereference-in-brcmf_cfg802.patch
+++ /dev/null
@@ -1,50 +0,0 @@
.....
diff --git a/package/kernel/mac80211/patches/brcm/374-v5.2-brcmfmac-set-txflow-request-id-from-1-to-pktids-arra.patch b/package/kernel/mac80211/patches/brcm/374-v5.2-brcmfmac-set-txflow-request-id-from-1-to-pktids-arra.patch
deleted file mode 100644
index 6702dd57b6..0000000000
--- a/package/kernel/mac80211/patches/brcm/374-v5.2-brcmfmac-set-txflow-request-id-from-1-to-pktids-arra.patch
+++ /dev/null
@@ -1,49 +0,0 @@
.....
diff --git a/package/kernel/mac80211/patches/brcm/375-v5.2-brcmfmac-print-firmware-messages-after-a-firmware-cr.patch b/package/kernel/mac80211/patches/brcm/375-v5.2-brcmfmac-print-firmware-messages-after-a-firmware-cr.patch
deleted file mode 100644
index ceb85055d5..0000000000
--- a/package/kernel/mac80211/patches/brcm/375-v5.2-brcmfmac-print-firmware-messages-after-a-firmware-cr.patch
+++ /dev/null
@@ -1,90 +0,0 @@
.....
diff --git a/package/kernel/mac80211/patches/brcm/810-b43-gpio-mask-module-option.patch b/package/kernel/mac80211/patches/brcm/810-b43-gpio-mask-module-option.patch
index 6861667b2b..a5706374f1 100644
--- a/package/kernel/mac80211/patches/brcm/810-b43-gpio-mask-module-option.patch
+++ b/package/kernel/mac80211/patches/brcm/810-b43-gpio-mask-module-option.patch
@@ -10,7 +10,7 @@
  	struct b43_phy phy;
 --- a/drivers/net/wireless/broadcom/b43/main.c
 +++ b/drivers/net/wireless/broadcom/b43/main.c
-@@ -85,6 +85,11 @@ MODULE_FIRMWARE("b43/ucode40.fw");
+@@ -72,6 +72,11 @@ MODULE_FIRMWARE("b43/ucode40.fw");
  MODULE_FIRMWARE("b43/ucode42.fw");
  MODULE_FIRMWARE("b43/ucode9.fw");
  
@@ -22,7 +22,7 @@
  static int modparam_bad_frames_preempt;
  module_param_named(bad_frames_preempt, modparam_bad_frames_preempt, int, 0444);
  MODULE_PARM_DESC(bad_frames_preempt,
-@@ -2892,10 +2897,10 @@ static int b43_gpio_init(struct b43_wlde
+@@ -2872,10 +2877,10 @@ static int b43_gpio_init(struct b43_wlde
  	u32 mask, set;
  
  	b43_maskset32(dev, B43_MMIO_MACCTL, ~B43_MACCTL_GPOUTSMSK, 0);
diff --git a/package/kernel/mac80211/patches/brcm/811-b43_no_pio.patch b/package/kernel/mac80211/patches/brcm/811-b43_no_pio.patch
index 5eb1dc550a..a8dbefb5d9 100644
--- a/package/kernel/mac80211/patches/brcm/811-b43_no_pio.patch
+++ b/package/kernel/mac80211/patches/brcm/811-b43_no_pio.patch
@@ -11,7 +11,7 @@
  b43-$(CPTCFG_B43_LEDS)		+= leds.o
 --- a/drivers/net/wireless/broadcom/b43/main.c
 +++ b/drivers/net/wireless/broadcom/b43/main.c
-@@ -2018,10 +2018,12 @@ static void b43_do_interrupt_thread(stru
+@@ -2000,10 +2000,12 @@ static void b43_do_interrupt_thread(stru
  			dma_reason[0], dma_reason[1],
  			dma_reason[2], dma_reason[3],
  			dma_reason[4], dma_reason[5]);
@@ -75,7 +75,7 @@
  #endif /* B43_PIO_H_ */
 --- a/drivers/net/wireless/broadcom/b43/Kconfig
 +++ b/drivers/net/wireless/broadcom/b43/Kconfig
-@@ -98,7 +98,7 @@ config B43_BCMA_PIO
+@@ -100,7 +100,7 @@ config B43_BCMA_PIO
  	default y
  
  config B43_PIO
diff --git a/package/kernel/mac80211/patches/brcm/812-b43-add-antenna-control.patch b/package/kernel/mac80211/patches/brcm/812-b43-add-antenna-control.patch
index d643d2f82c..6e3554701b 100644
--- a/package/kernel/mac80211/patches/brcm/812-b43-add-antenna-control.patch
+++ b/package/kernel/mac80211/patches/brcm/812-b43-add-antenna-control.patch
@@ -1,6 +1,6 @@
 --- a/drivers/net/wireless/broadcom/b43/main.c
 +++ b/drivers/net/wireless/broadcom/b43/main.c
-@@ -1658,7 +1658,7 @@ static void b43_write_beacon_template(st
+@@ -1642,7 +1642,7 @@ static void b43_write_beacon_template(st
  				  len, ram_offset, shm_size_offset, rate);
  
  	/* Write the PHY TX control parameters. */
@@ -9,7 +9,7 @@
  	antenna = b43_antenna_to_phyctl(antenna);
  	ctl = b43_shm_read16(dev, B43_SHM_SHARED, B43_SHM_SH_BEACPHYCTL);
  	/* We can't send beacons with short preamble. Would get PHY errors. */
-@@ -3307,8 +3307,8 @@ static int b43_chip_init(struct b43_wlde
+@@ -3287,8 +3287,8 @@ static int b43_chip_init(struct b43_wlde
  
  	/* Select the antennae */
  	if (phy->ops->set_rx_antenna)
@@ -20,7 +20,7 @@
  
  	if (phy->type == B43_PHYTYPE_B) {
  		value16 = b43_read16(dev, 0x005E);
-@@ -4008,7 +4008,6 @@ static int b43_op_config(struct ieee8021
+@@ -3988,7 +3988,6 @@ static int b43_op_config(struct ieee8021
  	struct b43_wldev *dev = wl->current_dev;
  	struct b43_phy *phy = &dev->phy;
  	struct ieee80211_conf *conf = &hw->conf;
@@ -28,7 +28,7 @@
  	int err = 0;
  
  	mutex_lock(&wl->mutex);
-@@ -4051,11 +4050,9 @@ static int b43_op_config(struct ieee8021
+@@ -4031,11 +4030,9 @@ static int b43_op_config(struct ieee8021
  	}
  
  	/* Antennas for RX and management frame TX. */
@@ -42,7 +42,7 @@
  
  	if (wl->radio_enabled != phy->radio_on) {
  		if (wl->radio_enabled) {
-@@ -5199,6 +5196,47 @@ static int b43_op_get_survey(struct ieee
+@@ -5179,6 +5176,47 @@ static int b43_op_get_survey(struct ieee
  	return 0;
  }
  
@@ -90,7 +90,7 @@
  static const struct ieee80211_ops b43_hw_ops = {
  	.tx			= b43_op_tx,
  	.conf_tx		= b43_op_conf_tx,
-@@ -5220,6 +5258,8 @@ static const struct ieee80211_ops b43_hw
+@@ -5200,6 +5238,8 @@ static const struct ieee80211_ops b43_hw
  	.sw_scan_complete	= b43_op_sw_scan_complete_notifier,
  	.get_survey		= b43_op_get_survey,
  	.rfkill_poll		= b43_rfkill_poll,
@@ -99,7 +99,7 @@
  };
  
  /* Hard-reset the chip. Do not call this directly.
-@@ -5523,6 +5563,8 @@ static int b43_one_core_attach(struct b4
+@@ -5501,6 +5541,8 @@ static int b43_one_core_attach(struct b4
  	if (!wldev)
  		goto out;
  
@@ -108,14 +108,14 @@
  	wldev->use_pio = b43_modparam_pio;
  	wldev->dev = dev;
  	wldev->wl = wl;
-@@ -5617,6 +5659,9 @@ static struct b43_wl *b43_wireless_init(
+@@ -5595,6 +5637,9 @@ static struct b43_wl *b43_wireless_init(
  
  	wiphy_ext_feature_set(hw->wiphy, NL80211_EXT_FEATURE_CQM_RSSI_LIST);
  
 +	hw->wiphy->available_antennas_rx = 0x3;
 +	hw->wiphy->available_antennas_tx = 0x3;
 +
- 	wl->hw_registred = false;
+ 	wl->hw_registered = false;
  	hw->max_rates = 2;
  	SET_IEEE80211_DEV(hw, dev->dev);
 --- a/drivers/net/wireless/broadcom/b43/b43.h
diff --git a/package/kernel/mac80211/patches/brcm/814-b43-only-use-gpio-0-1-for-led.patch b/package/kernel/mac80211/patches/brcm/814-b43-only-use-gpio-0-1-for-led.patch
index 03f4524c88..bd163be960 100644
--- a/package/kernel/mac80211/patches/brcm/814-b43-only-use-gpio-0-1-for-led.patch
+++ b/package/kernel/mac80211/patches/brcm/814-b43-only-use-gpio-0-1-for-led.patch
@@ -1,6 +1,6 @@
 --- a/drivers/net/wireless/broadcom/b43/main.c
 +++ b/drivers/net/wireless/broadcom/b43/main.c
-@@ -2909,6 +2909,14 @@ static int b43_gpio_init(struct b43_wlde
+@@ -2889,6 +2889,14 @@ static int b43_gpio_init(struct b43_wlde
  	} else if (dev->dev->chip_id == 0x5354) {
  		/* Don't allow overtaking buttons GPIOs */
  		set &= 0x2; /* 0x2 is LED GPIO on BCM5354 */
diff --git a/package/kernel/mac80211/patches/brcm/815-b43-always-take-overlapping-devs.patch b/package/kernel/mac80211/patches/brcm/815-b43-always-take-overlapping-devs.patch
index f07151aa4e..a8eae19413 100644
--- a/package/kernel/mac80211/patches/brcm/815-b43-always-take-overlapping-devs.patch
+++ b/package/kernel/mac80211/patches/brcm/815-b43-always-take-overlapping-devs.patch
@@ -1,6 +1,6 @@
 --- a/drivers/net/wireless/broadcom/b43/main.c
 +++ b/drivers/net/wireless/broadcom/b43/main.c
-@@ -127,7 +127,7 @@ static int b43_modparam_pio = 0;
+@@ -114,7 +114,7 @@ static int b43_modparam_pio = 0;
  module_param_named(pio, b43_modparam_pio, int, 0644);
  MODULE_PARM_DESC(pio, "Use PIO accesses by default: 0=DMA, 1=PIO");
  
diff --git a/package/kernel/mac80211/patches/brcm/862-brcmfmac-Disable-power-management.patch b/package/kernel/mac80211/patches/brcm/862-brcmfmac-Disable-power-management.patch
index 5cbc48f76a..a7d000ee9d 100644
--- a/package/kernel/mac80211/patches/brcm/862-brcmfmac-Disable-power-management.patch
+++ b/package/kernel/mac80211/patches/brcm/862-brcmfmac-Disable-power-management.patch
@@ -14,7 +14,7 @@ Signed-off-by: Phil Elwell <phil at raspberrypi.org>
 
 --- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c
 +++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c
-@@ -2774,6 +2774,10 @@ brcmf_cfg80211_set_power_mgmt(struct wip
+@@ -2782,6 +2782,10 @@ brcmf_cfg80211_set_power_mgmt(struct wip
  	 * preference in cfg struct to apply this to
  	 * FW later while initializing the dongle
  	 */
diff --git a/package/kernel/mac80211/patches/build/015-ipw200-mtu.patch b/package/kernel/mac80211/patches/build/015-ipw200-mtu.patch
index d57d821fea..68dd821331 100644
--- a/package/kernel/mac80211/patches/build/015-ipw200-mtu.patch
+++ b/package/kernel/mac80211/patches/build/015-ipw200-mtu.patch
@@ -1,6 +1,6 @@
 --- a/drivers/net/wireless/intel/ipw2x00/ipw2200.c
 +++ b/drivers/net/wireless/intel/ipw2x00/ipw2200.c
-@@ -11498,6 +11498,15 @@ static const struct attribute_group ipw_
+@@ -11481,6 +11481,15 @@ static const struct attribute_group ipw_
  	.attrs = ipw_sysfs_entries,
  };
  
@@ -16,7 +16,7 @@
  #ifdef CPTCFG_IPW2200_PROMISCUOUS
  static int ipw_prom_open(struct net_device *dev)
  {
-@@ -11546,15 +11555,6 @@ static netdev_tx_t ipw_prom_hard_start_x
+@@ -11529,15 +11538,6 @@ static netdev_tx_t ipw_prom_hard_start_x
  	return NETDEV_TX_OK;
  }
  
diff --git a/package/kernel/mac80211/patches/build/050-lib80211_option.patch b/package/kernel/mac80211/patches/build/050-lib80211_option.patch
index 6282cdab5f..f6e1f9be07 100644
--- a/package/kernel/mac80211/patches/build/050-lib80211_option.patch
+++ b/package/kernel/mac80211/patches/build/050-lib80211_option.patch
@@ -1,6 +1,6 @@
 --- a/net/wireless/Kconfig
 +++ b/net/wireless/Kconfig
-@@ -185,7 +185,7 @@ config CFG80211_WEXT_EXPORT
+@@ -186,7 +186,7 @@ config CFG80211_WEXT_EXPORT
  endif # CFG80211
  
  config LIB80211
@@ -9,7 +9,7 @@
  	depends on m
  	default n
  	help
-@@ -195,15 +195,15 @@ config LIB80211
+@@ -196,15 +196,15 @@ config LIB80211
  	  Drivers should select this themselves if needed.
  
  config LIB80211_CRYPT_WEP
diff --git a/package/kernel/mac80211/patches/build/060-no_local_ssb_bcma.patch b/package/kernel/mac80211/patches/build/060-no_local_ssb_bcma.patch
index 06636060f7..5ef01cc61e 100644
--- a/package/kernel/mac80211/patches/build/060-no_local_ssb_bcma.patch
+++ b/package/kernel/mac80211/patches/build/060-no_local_ssb_bcma.patch
@@ -1,9 +1,9 @@
 --- a/local-symbols
 +++ b/local-symbols
-@@ -396,43 +396,6 @@ USB_IPHETH=
- USB_SIERRA_NET=
+@@ -410,43 +410,6 @@ USB_SIERRA_NET=
  USB_VL600=
  USB_NET_CH9200=
+ USB_NET_AQC111=
 -SSB_POSSIBLE=
 -SSB=
 -SSB_SPROM=
@@ -46,7 +46,7 @@
  USB_WDM=
 --- a/drivers/net/wireless/broadcom/b43/Kconfig
 +++ b/drivers/net/wireless/broadcom/b43/Kconfig
-@@ -61,21 +61,21 @@ endchoice
+@@ -63,21 +63,21 @@ endchoice
  config B43_PCI_AUTOSELECT
  	bool
  	depends on B43 && SSB_PCIHOST_POSSIBLE
@@ -72,7 +72,7 @@
  	---help---
  	  Broadcom 43xx device support for Soft-MAC SDIO devices.
  
-@@ -94,13 +94,13 @@ config B43_SDIO
+@@ -96,13 +96,13 @@ config B43_SDIO
  config B43_BCMA_PIO
  	bool
  	depends on B43 && B43_BCMA
@@ -90,7 +90,7 @@
  config B43_PHY_G
 --- a/drivers/net/wireless/broadcom/b43/main.c
 +++ b/drivers/net/wireless/broadcom/b43/main.c
-@@ -2876,7 +2876,7 @@ static struct ssb_device *b43_ssb_gpio_d
+@@ -2856,7 +2856,7 @@ static struct ssb_device *b43_ssb_gpio_d
  {
  	struct ssb_bus *bus = dev->dev->sdev->bus;
  
@@ -99,7 +99,7 @@
  	return (bus->chipco.dev ? bus->chipco.dev : bus->pcicore.dev);
  #else
  	return bus->chipco.dev;
-@@ -4893,7 +4893,7 @@ static int b43_wireless_core_init(struct
+@@ -4873,7 +4873,7 @@ static int b43_wireless_core_init(struct
  	}
  	if (sprom->boardflags_lo & B43_BFL_XTAL_NOSLOW)
  		hf |= B43_HF_DSCRQ; /* Disable slowclock requests from ucode. */
@@ -110,7 +110,7 @@
  	    dev->dev->sdev->bus->pcicore.dev->id.revision <= 10)
 --- a/drivers/net/wireless/broadcom/b43legacy/Kconfig
 +++ b/drivers/net/wireless/broadcom/b43legacy/Kconfig
-@@ -2,7 +2,7 @@ config B43LEGACY
+@@ -3,7 +3,7 @@ config B43LEGACY
  	tristate "Broadcom 43xx-legacy wireless support (mac80211 stack)"
  	depends on m
  	depends on SSB_POSSIBLE && MAC80211 && HAS_DMA
@@ -119,7 +119,7 @@
  	depends on FW_LOADER
  	---help---
  	  b43legacy is a driver for 802.11b devices from Broadcom (BCM4301 and
-@@ -24,15 +24,15 @@ config B43LEGACY
+@@ -25,15 +25,15 @@ config B43LEGACY
  config B43LEGACY_PCI_AUTOSELECT
  	bool
  	depends on B43LEGACY && SSB_PCIHOST_POSSIBLE
@@ -140,7 +140,7 @@
  # LED support
 --- a/drivers/net/wireless/broadcom/b43legacy/main.c
 +++ b/drivers/net/wireless/broadcom/b43legacy/main.c
-@@ -1937,7 +1937,7 @@ static int b43legacy_gpio_init(struct b4
+@@ -1905,7 +1905,7 @@ static int b43legacy_gpio_init(struct b4
  	if (dev->dev->id.revision >= 2)
  		mask  |= 0x0010; /* FIXME: This is redundant. */
  
@@ -149,7 +149,7 @@
  	pcidev = bus->pcicore.dev;
  #endif
  	gpiodev = bus->chipco.dev ? : pcidev;
-@@ -1956,7 +1956,7 @@ static void b43legacy_gpio_cleanup(struc
+@@ -1924,7 +1924,7 @@ static void b43legacy_gpio_cleanup(struc
  	struct ssb_bus *bus = dev->dev->bus;
  	struct ssb_device *gpiodev, *pcidev = NULL;
  
@@ -181,7 +181,7 @@
  obj-$(CPTCFG_BRCMSMAC)	+= brcmsmac.o
 --- a/drivers/net/wireless/broadcom/brcm80211/Kconfig
 +++ b/drivers/net/wireless/broadcom/brcm80211/Kconfig
-@@ -7,7 +7,7 @@ config BRCMSMAC
+@@ -8,7 +8,7 @@ config BRCMSMAC
  	depends on m
  	depends on MAC80211
  	depends on BCMA_POSSIBLE
@@ -192,10 +192,10 @@
  	select BRCMUTIL
 --- a/Kconfig.local
 +++ b/Kconfig.local
-@@ -1192,117 +1192,6 @@ config BACKPORTED_USB_VL600
- config BACKPORTED_USB_NET_CH9200
+@@ -1234,117 +1234,6 @@ config BACKPORTED_USB_NET_CH9200
+ config BACKPORTED_USB_NET_AQC111
  	tristate
- 	default USB_NET_CH9200
+ 	default USB_NET_AQC111
 -config BACKPORTED_SSB_POSSIBLE
 -	tristate
 -	default SSB_POSSIBLE
diff --git a/package/kernel/mac80211/patches/mwl/700-mwl8k-missing-pci-id-for-WNR854T.patch b/package/kernel/mac80211/patches/mwl/700-mwl8k-missing-pci-id-for-WNR854T.patch
index f3e311a2e9..cfa40e1bd2 100644
--- a/package/kernel/mac80211/patches/mwl/700-mwl8k-missing-pci-id-for-WNR854T.patch
+++ b/package/kernel/mac80211/patches/mwl/700-mwl8k-missing-pci-id-for-WNR854T.patch
@@ -1,6 +1,6 @@
 --- a/drivers/net/wireless/marvell/mwl8k.c
 +++ b/drivers/net/wireless/marvell/mwl8k.c
-@@ -5686,6 +5686,7 @@ MODULE_FIRMWARE("mwl8k/fmimage_8366.fw")
+@@ -5694,6 +5694,7 @@ MODULE_FIRMWARE("mwl8k/fmimage_8366.fw")
  MODULE_FIRMWARE(MWL8K_8366_AP_FW(MWL8K_8366_AP_FW_API));
  
  static const struct pci_device_id mwl8k_pci_id_table[] = {
diff --git a/package/kernel/mac80211/patches/mwl/801-libertas-configure-sysfs-links.patch b/package/kernel/mac80211/patches/mwl/801-libertas-configure-sysfs-links.patch
index c3e6db8f05..90adb66bb1 100644
--- a/package/kernel/mac80211/patches/mwl/801-libertas-configure-sysfs-links.patch
+++ b/package/kernel/mac80211/patches/mwl/801-libertas-configure-sysfs-links.patch
@@ -11,7 +11,7 @@
   err_wiphy_new:
 --- a/drivers/net/wireless/marvell/libertas/main.c
 +++ b/drivers/net/wireless/marvell/libertas/main.c
-@@ -930,6 +930,7 @@ struct lbs_private *lbs_add_card(void *c
+@@ -935,6 +935,7 @@ struct lbs_private *lbs_add_card(void *c
  		goto err_adapter;
  	}
  
diff --git a/package/kernel/mac80211/patches/mwl/940-mwl8k_init_devices_synchronously.patch b/package/kernel/mac80211/patches/mwl/940-mwl8k_init_devices_synchronously.patch
index 61a6c4c70f..f3130f7ae7 100644
--- a/package/kernel/mac80211/patches/mwl/940-mwl8k_init_devices_synchronously.patch
+++ b/package/kernel/mac80211/patches/mwl/940-mwl8k_init_devices_synchronously.patch
@@ -1,6 +1,6 @@
 --- a/drivers/net/wireless/marvell/mwl8k.c
 +++ b/drivers/net/wireless/marvell/mwl8k.c
-@@ -6271,6 +6271,8 @@ static int mwl8k_probe(struct pci_dev *p
+@@ -6279,6 +6279,8 @@ static int mwl8k_probe(struct pci_dev *p
  
  	priv->running_bsses = 0;
  
@@ -9,7 +9,7 @@
  	return rc;
  
  err_stop_firmware:
-@@ -6304,8 +6306,6 @@ static void mwl8k_remove(struct pci_dev
+@@ -6312,8 +6314,6 @@ static void mwl8k_remove(struct pci_dev
  		return;
  	priv = hw->priv;
  
diff --git a/package/kernel/mac80211/patches/mwl/941-mwl8k-Fix-rate_idx-underflow.patch b/package/kernel/mac80211/patches/mwl/941-mwl8k-Fix-rate_idx-underflow.patch
deleted file mode 100644
index d034dcf51f..0000000000
--- a/package/kernel/mac80211/patches/mwl/941-mwl8k-Fix-rate_idx-underflow.patch
+++ /dev/null
@@ -1,75 +0,0 @@
.....
diff --git a/package/kernel/mac80211/patches/rt2x00/001-rt2x00-use-simple_read_from_buffer.patch b/package/kernel/mac80211/patches/rt2x00/001-rt2x00-use-simple_read_from_buffer.patch
deleted file mode 100644
index 1319cc244c..0000000000
--- a/package/kernel/mac80211/patches/rt2x00/001-rt2x00-use-simple_read_from_buffer.patch
+++ /dev/null
@@ -1,59 +0,0 @@
-From f483039cf51acf30494cd754194562c22cf98764 Mon Sep 17 00:00:00 2001
-From: Dan Carpenter <dan.carpenter at 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 at oracle.com>
-Acked-by: Stanislaw Gruszka <sgruszka at redhat.com>
-Signed-off-by: Kalle Valo <kvalo at 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 = {
diff --git a/package/kernel/mac80211/patches/rt2x00/002-rt2800-move-usb-specific-txdone-txstatus-routines-to.patch b/package/kernel/mac80211/patches/rt2x00/002-rt2800-move-usb-specific-txdone-txstatus-routines-to.patch
deleted file mode 100644
index a883258a4c..0000000000
--- a/package/kernel/mac80211/patches/rt2x00/002-rt2800-move-usb-specific-txdone-txstatus-routines-to.patch
+++ /dev/null
@@ -1,357 +0,0 @@
-From 5c656c71b1bf5611ce8262bab338104e04d10b8d Mon Sep 17 00:00:00 2001
-From: Stanislaw Gruszka <sgruszka at redhat.com>
-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 at redhat.com>
-Signed-off-by: Kalle Valo <kvalo at codeaurora.org>
----
- .../net/wireless/ralink/rt2x00/rt2800lib.c    | 138 +++++++++++++++++
- .../net/wireless/ralink/rt2x00/rt2800lib.h    |   3 +
- .../net/wireless/ralink/rt2x00/rt2800usb.c    | 143 +-----------------
- 3 files changed, 145 insertions(+), 139 deletions(-)
-
---- a/drivers/net/wireless/ralink/rt2x00/rt2800lib.c
-+++ b/drivers/net/wireless/ralink/rt2x00/rt2800lib.c
-@@ -957,6 +957,47 @@ static void rt2800_rate_from_status(stru
- 	skbdesc->tx_rate_flags = flags;
- }
- 
-+static bool rt2800_txdone_entry_check(struct queue_entry *entry, u32 reg)
-+{
-+	__le32 *txwi;
-+	u32 word;
-+	int wcid, ack, pid;
-+	int tx_wcid, tx_ack, tx_pid, is_agg;
-+
-+	/*
-+	 * This frames has returned with an IO error,
-+	 * so the status report is not intended for this
-+	 * frame.
-+	 */
-+	if (test_bit(ENTRY_DATA_IO_FAILED, &entry->flags))
-+		return false;
-+
-+	wcid	= rt2x00_get_field32(reg, TX_STA_FIFO_WCID);
-+	ack	= rt2x00_get_field32(reg, TX_STA_FIFO_TX_ACK_REQUIRED);
-+	pid	= rt2x00_get_field32(reg, TX_STA_FIFO_PID_TYPE);
-+	is_agg	= rt2x00_get_field32(reg, TX_STA_FIFO_TX_AGGRE);
-+
-+	/*
-+	 * Validate if this TX status report is intended for
-+	 * this entry by comparing the WCID/ACK/PID fields.
-+	 */
-+	txwi = rt2800_drv_get_txwi(entry);
-+
-+	word = rt2x00_desc_read(txwi, 1);
-+	tx_wcid = rt2x00_get_field32(word, TXWI_W1_WIRELESS_CLI_ID);
-+	tx_ack  = rt2x00_get_field32(word, TXWI_W1_ACK);
-+	tx_pid  = rt2x00_get_field32(word, TXWI_W1_PACKETID);
-+
-+	if (wcid != tx_wcid || ack != tx_ack || (!is_agg && pid != tx_pid)) {
-+		rt2x00_dbg(entry->queue->rt2x00dev,
-+			   "TX status report missed for queue %d entry %d\n",
-+			   entry->queue->qid, entry->entry_idx);
-+		return false;
-+	}
-+
-+	return true;
-+}
-+
- void rt2800_txdone_entry(struct queue_entry *entry, u32 status, __le32 *txwi,
- 			 bool match)
- {
-@@ -1059,6 +1100,103 @@ void rt2800_txdone_entry(struct queue_en
- }
- EXPORT_SYMBOL_GPL(rt2800_txdone_entry);
- 
-+void rt2800_txdone(struct rt2x00_dev *rt2x00dev)
-+{
-+	struct data_queue *queue;
-+	struct queue_entry *entry;
-+	u32 reg;
-+	u8 qid;
-+	bool match;
-+
-+	while (kfifo_get(&rt2x00dev->txstatus_fifo, &reg)) {
-+		/*
-+		 * TX_STA_FIFO_PID_QUEUE is a 2-bit field, thus qid is
-+		 * guaranteed to be one of the TX QIDs .
-+		 */
-+		qid = rt2x00_get_field32(reg, TX_STA_FIFO_PID_QUEUE);
-+		queue = rt2x00queue_get_tx_queue(rt2x00dev, qid);
-+
-+		if (unlikely(rt2x00queue_empty(queue))) {
-+			rt2x00_dbg(rt2x00dev, "Got TX status for an empty queue %u, dropping\n",
-+				   qid);
-+			break;
-+		}
-+
-+		entry = rt2x00queue_get_entry(queue, Q_INDEX_DONE);
-+
-+		if (unlikely(test_bit(ENTRY_OWNER_DEVICE_DATA, &entry->flags) ||
-+			     !test_bit(ENTRY_DATA_STATUS_PENDING, &entry->flags))) {
-+			rt2x00_warn(rt2x00dev, "Data pending for entry %u in queue %u\n",
-+				    entry->entry_idx, qid);
-+			break;
-+		}
-+
-+		match = rt2800_txdone_entry_check(entry, reg);
-+		rt2800_txdone_entry(entry, reg, rt2800_drv_get_txwi(entry), match);
-+	}
-+}
-+EXPORT_SYMBOL_GPL(rt2800_txdone);
-+
-+static inline bool rt2800_entry_txstatus_timeout(struct queue_entry *entry)
-+{
-+	bool tout;
-+
-+	if (!test_bit(ENTRY_DATA_STATUS_PENDING, &entry->flags))
-+		return false;
-+
-+	tout = time_after(jiffies, entry->last_action + msecs_to_jiffies(500));
-+	if (unlikely(tout))
-+		rt2x00_dbg(entry->queue->rt2x00dev,
-+			   "TX status timeout for entry %d in queue %d\n",
-+			   entry->entry_idx, entry->queue->qid);
-+	return tout;
-+
-+}
-+
-+bool rt2800_txstatus_timeout(struct rt2x00_dev *rt2x00dev)
-+{
-+	struct data_queue *queue;
-+	struct queue_entry *entry;
-+
-+	tx_queue_for_each(rt2x00dev, queue) {
-+		entry = rt2x00queue_get_entry(queue, Q_INDEX_DONE);
-+		if (rt2800_entry_txstatus_timeout(entry))
-+			return true;
-+	}
-+	return false;
-+}
-+EXPORT_SYMBOL_GPL(rt2800_txstatus_timeout);
-+
-+void rt2800_txdone_nostatus(struct rt2x00_dev *rt2x00dev)
-+{
-+	struct data_queue *queue;
-+	struct queue_entry *entry;
-+
-+	/*
-+	 * Process any trailing TX status reports for IO failures,
-+	 * we loop until we find the first non-IO error entry. This
-+	 * can either be a frame which is free, is being uploaded,
-+	 * or has completed the upload but didn't have an entry
-+	 * in the TX_STAT_FIFO register yet.
-+	 */
-+	tx_queue_for_each(rt2x00dev, queue) {
-+		while (!rt2x00queue_empty(queue)) {
-+			entry = rt2x00queue_get_entry(queue, Q_INDEX_DONE);
-+
-+			if (test_bit(ENTRY_OWNER_DEVICE_DATA, &entry->flags) ||
-+			    !test_bit(ENTRY_DATA_STATUS_PENDING, &entry->flags))
-+				break;
-+
-+			if (test_bit(ENTRY_DATA_IO_FAILED, &entry->flags) ||
-+			    rt2800_entry_txstatus_timeout(entry))
-+				rt2x00lib_txdone_noinfo(entry, TXDONE_FAILURE);
-+			else
-+				break;
-+		}
-+	}
-+}
-+EXPORT_SYMBOL_GPL(rt2800_txdone_nostatus);
-+
- static unsigned int rt2800_hw_beacon_base(struct rt2x00_dev *rt2x00dev,
- 					  unsigned int index)
- {
---- a/drivers/net/wireless/ralink/rt2x00/rt2800lib.h
-+++ b/drivers/net/wireless/ralink/rt2x00/rt2800lib.h
-@@ -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);
-+void rt2800_txdone(struct rt2x00_dev *rt2x00dev);
-+void rt2800_txdone_nostatus(struct rt2x00_dev *rt2x00dev);
-+bool rt2800_txstatus_timeout(struct rt2x00_dev *rt2x00dev);
- 
- void rt2800_write_beacon(struct queue_entry *entry, struct txentry_desc *txdesc);
- void rt2800_clear_beacon(struct queue_entry *entry);
---- a/drivers/net/wireless/ralink/rt2x00/rt2800usb.c
-+++ b/drivers/net/wireless/ralink/rt2x00/rt2800usb.c
-@@ -116,35 +116,6 @@ static bool rt2800usb_txstatus_pending(s
- 	return false;
- }
- 
--static inline bool rt2800usb_entry_txstatus_timeout(struct queue_entry *entry)
--{
--	bool tout;
--
--	if (!test_bit(ENTRY_DATA_STATUS_PENDING, &entry->flags))
--		return false;
--
--	tout = time_after(jiffies, entry->last_action + msecs_to_jiffies(500));
--	if (unlikely(tout))
--		rt2x00_dbg(entry->queue->rt2x00dev,
--			   "TX status timeout for entry %d in queue %d\n",
--			   entry->entry_idx, entry->queue->qid);
--	return tout;
--
--}
--
--static bool rt2800usb_txstatus_timeout(struct rt2x00_dev *rt2x00dev)
--{
--	struct data_queue *queue;
--	struct queue_entry *entry;
--
--	tx_queue_for_each(rt2x00dev, queue) {
--		entry = rt2x00queue_get_entry(queue, Q_INDEX_DONE);
--		if (rt2800usb_entry_txstatus_timeout(entry))
--			return true;
--	}
--	return false;
--}
--
- #define TXSTATUS_READ_INTERVAL 1000000
- 
- static bool rt2800usb_tx_sta_fifo_read_completed(struct rt2x00_dev *rt2x00dev,
-@@ -171,7 +142,7 @@ static bool rt2800usb_tx_sta_fifo_read_c
- 	}
- 
- 	/* Check if there is any entry that timedout waiting on TX status */
--	if (rt2800usb_txstatus_timeout(rt2x00dev))
-+	if (rt2800_txstatus_timeout(rt2x00dev))
- 		queue_work(rt2x00dev->workqueue, &rt2x00dev->txdone_work);
- 
- 	if (rt2800usb_txstatus_pending(rt2x00dev)) {
-@@ -501,123 +472,17 @@ static int rt2800usb_get_tx_data_len(str
- /*
-  * TX control handlers
-  */
--static bool rt2800usb_txdone_entry_check(struct queue_entry *entry, u32 reg)
--{
--	__le32 *txwi;
--	u32 word;
--	int wcid, ack, pid;
--	int tx_wcid, tx_ack, tx_pid, is_agg;
--
--	/*
--	 * This frames has returned with an IO error,
--	 * so the status report is not intended for this
--	 * frame.
--	 */
--	if (test_bit(ENTRY_DATA_IO_FAILED, &entry->flags))
--		return false;
--
--	wcid	= rt2x00_get_field32(reg, TX_STA_FIFO_WCID);
--	ack	= rt2x00_get_field32(reg, TX_STA_FIFO_TX_ACK_REQUIRED);
--	pid	= rt2x00_get_field32(reg, TX_STA_FIFO_PID_TYPE);
--	is_agg	= rt2x00_get_field32(reg, TX_STA_FIFO_TX_AGGRE);
--
--	/*
--	 * Validate if this TX status report is intended for
--	 * this entry by comparing the WCID/ACK/PID fields.
--	 */
--	txwi = rt2800usb_get_txwi(entry);
--
--	word = rt2x00_desc_read(txwi, 1);
--	tx_wcid = rt2x00_get_field32(word, TXWI_W1_WIRELESS_CLI_ID);
--	tx_ack  = rt2x00_get_field32(word, TXWI_W1_ACK);
--	tx_pid  = rt2x00_get_field32(word, TXWI_W1_PACKETID);
--
--	if (wcid != tx_wcid || ack != tx_ack || (!is_agg && pid != tx_pid)) {
--		rt2x00_dbg(entry->queue->rt2x00dev,
--			   "TX status report missed for queue %d entry %d\n",
--			   entry->queue->qid, entry->entry_idx);
--		return false;
--	}
--
--	return true;
--}
--
--static void rt2800usb_txdone(struct rt2x00_dev *rt2x00dev)
--{
--	struct data_queue *queue;
--	struct queue_entry *entry;
--	u32 reg;
--	u8 qid;
--	bool match;
--
--	while (kfifo_get(&rt2x00dev->txstatus_fifo, &reg)) {
--		/*
--		 * TX_STA_FIFO_PID_QUEUE is a 2-bit field, thus qid is
--		 * guaranteed to be one of the TX QIDs .
--		 */
--		qid = rt2x00_get_field32(reg, TX_STA_FIFO_PID_QUEUE);
--		queue = rt2x00queue_get_tx_queue(rt2x00dev, qid);
--
--		if (unlikely(rt2x00queue_empty(queue))) {
--			rt2x00_dbg(rt2x00dev, "Got TX status for an empty queue %u, dropping\n",
--				   qid);
--			break;
--		}
--
--		entry = rt2x00queue_get_entry(queue, Q_INDEX_DONE);
--
--		if (unlikely(test_bit(ENTRY_OWNER_DEVICE_DATA, &entry->flags) ||
--			     !test_bit(ENTRY_DATA_STATUS_PENDING, &entry->flags))) {
--			rt2x00_warn(rt2x00dev, "Data pending for entry %u in queue %u\n",
--				    entry->entry_idx, qid);
--			break;
--		}
--
--		match = rt2800usb_txdone_entry_check(entry, reg);
--		rt2800_txdone_entry(entry, reg, rt2800usb_get_txwi(entry), match);
--	}
--}
--
--static void rt2800usb_txdone_nostatus(struct rt2x00_dev *rt2x00dev)
--{
--	struct data_queue *queue;
--	struct queue_entry *entry;
--
--	/*
--	 * Process any trailing TX status reports for IO failures,
--	 * we loop until we find the first non-IO error entry. This
--	 * can either be a frame which is free, is being uploaded,
--	 * or has completed the upload but didn't have an entry
--	 * in the TX_STAT_FIFO register yet.
--	 */
--	tx_queue_for_each(rt2x00dev, queue) {
--		while (!rt2x00queue_empty(queue)) {
--			entry = rt2x00queue_get_entry(queue, Q_INDEX_DONE);
--
--			if (test_bit(ENTRY_OWNER_DEVICE_DATA, &entry->flags) ||
--			    !test_bit(ENTRY_DATA_STATUS_PENDING, &entry->flags))
--				break;
--
--			if (test_bit(ENTRY_DATA_IO_FAILED, &entry->flags) ||
--			    rt2800usb_entry_txstatus_timeout(entry))
--				rt2x00lib_txdone_noinfo(entry, TXDONE_FAILURE);
--			else
--				break;
--		}
--	}
--}
--
- static void rt2800usb_work_txdone(struct work_struct *work)
- {
- 	struct rt2x00_dev *rt2x00dev =
- 	    container_of(work, struct rt2x00_dev, txdone_work);
- 
- 	while (!kfifo_is_empty(&rt2x00dev->txstatus_fifo) ||
--	       rt2800usb_txstatus_timeout(rt2x00dev)) {
-+	       rt2800_txstatus_timeout(rt2x00dev)) {
- 
--		rt2800usb_txdone(rt2x00dev);
-+		rt2800_txdone(rt2x00dev);
- 
--		rt2800usb_txdone_nostatus(rt2x00dev);
-+		rt2800_txdone_nostatus(rt2x00dev);
- 
- 		/*
- 		 * The hw may delay sending the packet after DMA complete
diff --git a/package/kernel/mac80211/patches/rt2x00/003-rt2800mmio-use-txdone-txstatus-routines-from-lib.patch b/package/kernel/mac80211/patches/rt2x00/003-rt2800mmio-use-txdone-txstatus-routines-from-lib.patch
deleted file mode 100644
index 48f0c27011..0000000000
--- a/package/kernel/mac80211/patches/rt2x00/003-rt2800mmio-use-txdone-txstatus-routines-from-lib.patch
+++ /dev/null
@@ -1,244 +0,0 @@
-From 0b0d556e0ebb6c966bc993e21a22a156812d8fdf Mon Sep 17 00:00:00 2001
-From: Stanislaw Gruszka <sgruszka at redhat.com>
-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.
-
-Note this also change how we handle INT_SOURCE_CSR_TX_FIFO_STATUS
-interrupt. Now it is disabled since IRQ routine till end of the txstatus
-tasklet (the same behaviour like others interrupts). Reason to do not
-disable this interrupt was not to miss any tx status from 16 entries
-FIFO register. Now, since we check for tx status timeout, we can
-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 at redhat.com>
-Signed-off-by: Kalle Valo <kvalo at codeaurora.org>
----
- .../net/wireless/ralink/rt2x00/rt2800mmio.c   | 180 +-----------------
- .../net/wireless/ralink/rt2x00/rt2x00queue.c  |   1 +
- 2 files changed, 9 insertions(+), 172 deletions(-)
-
---- a/drivers/net/wireless/ralink/rt2x00/rt2800mmio.c
-+++ b/drivers/net/wireless/ralink/rt2x00/rt2800mmio.c
-@@ -175,161 +175,6 @@ static void rt2800mmio_wakeup(struct rt2
- 	rt2800_config(rt2x00dev, &libconf, IEEE80211_CONF_CHANGE_PS);
- }
- 
--static bool rt2800mmio_txdone_entry_check(struct queue_entry *entry, u32 status)
--{
--	__le32 *txwi;
--	u32 word;
--	int wcid, tx_wcid;
--
--	wcid = rt2x00_get_field32(status, TX_STA_FIFO_WCID);
--
--	txwi = rt2800_drv_get_txwi(entry);
--	word = rt2x00_desc_read(txwi, 1);
--	tx_wcid = rt2x00_get_field32(word, TXWI_W1_WIRELESS_CLI_ID);
--
--	return (tx_wcid == wcid);
--}
--
--static bool rt2800mmio_txdone_find_entry(struct queue_entry *entry, void *data)
--{
--	u32 status = *(u32 *)data;
--
--	/*
--	 * rt2800pci hardware might reorder frames when exchanging traffic
--	 * with multiple BA enabled STAs.
--	 *
--	 * For example, a tx queue
--	 *    [ STA1 | STA2 | STA1 | STA2 ]
--	 * can result in tx status reports
--	 *    [ STA1 | STA1 | STA2 | STA2 ]
--	 * when the hw decides to aggregate the frames for STA1 into one AMPDU.
--	 *
--	 * To mitigate this effect, associate the tx status to the first frame
--	 * in the tx queue with a matching wcid.
--	 */
--	if (rt2800mmio_txdone_entry_check(entry, status) &&
--	    !test_bit(ENTRY_DATA_STATUS_SET, &entry->flags)) {
--		/*
--		 * Got a matching frame, associate the tx status with
--		 * the frame
--		 */
--		entry->status = status;
--		set_bit(ENTRY_DATA_STATUS_SET, &entry->flags);
--		return true;
--	}
--
--	/* Check the next frame */
--	return false;
--}
--
--static bool rt2800mmio_txdone_match_first(struct queue_entry *entry, void *data)
--{
--	u32 status = *(u32 *)data;
--
--	/*
--	 * Find the first frame without tx status and assign this status to it
--	 * regardless if it matches or not.
--	 */
--	if (!test_bit(ENTRY_DATA_STATUS_SET, &entry->flags)) {
--		/*
--		 * Got a matching frame, associate the tx status with
--		 * the frame
--		 */
--		entry->status = status;
--		set_bit(ENTRY_DATA_STATUS_SET, &entry->flags);
--		return true;
--	}
--
--	/* Check the next frame */
--	return false;
--}
--static bool rt2800mmio_txdone_release_entries(struct queue_entry *entry,
--					      void *data)
--{
--	if (test_bit(ENTRY_DATA_STATUS_SET, &entry->flags)) {
--		rt2800_txdone_entry(entry, entry->status,
--				    rt2800mmio_get_txwi(entry), true);
--		return false;
--	}
--
--	/* No more frames to release */
--	return true;
--}
--
--static bool rt2800mmio_txdone(struct rt2x00_dev *rt2x00dev)
--{
--	struct data_queue *queue;
--	u32 status;
--	u8 qid;
--	int max_tx_done = 16;
--
--	while (kfifo_get(&rt2x00dev->txstatus_fifo, &status)) {
--		qid = rt2x00_get_field32(status, TX_STA_FIFO_PID_QUEUE);
--		if (unlikely(qid >= QID_RX)) {
--			/*
--			 * Unknown queue, this shouldn't happen. Just drop
--			 * this tx status.
--			 */
--			rt2x00_warn(rt2x00dev, "Got TX status report with unexpected pid %u, dropping\n",
--				    qid);
--			break;
--		}
--
--		queue = rt2x00queue_get_tx_queue(rt2x00dev, qid);
--		if (unlikely(queue == NULL)) {
--			/*
--			 * The queue is NULL, this shouldn't happen. Stop
--			 * processing here and drop the tx status
--			 */
--			rt2x00_warn(rt2x00dev, "Got TX status for an unavailable queue %u, dropping\n",
--				    qid);
--			break;
--		}
--
--		if (unlikely(rt2x00queue_empty(queue))) {
--			/*
--			 * The queue is empty. Stop processing here
--			 * and drop the tx status.
--			 */
--			rt2x00_warn(rt2x00dev, "Got TX status for an empty queue %u, dropping\n",
--				    qid);
--			break;
--		}
--
--		/*
--		 * Let's associate this tx status with the first
--		 * matching frame.
--		 */
--		if (!rt2x00queue_for_each_entry(queue, Q_INDEX_DONE,
--						Q_INDEX, &status,
--						rt2800mmio_txdone_find_entry)) {
--			/*
--			 * We cannot match the tx status to any frame, so just
--			 * use the first one.
--			 */
--			if (!rt2x00queue_for_each_entry(queue, Q_INDEX_DONE,
--							Q_INDEX, &status,
--							rt2800mmio_txdone_match_first)) {
--				rt2x00_warn(rt2x00dev, "No frame found for TX status on queue %u, dropping\n",
--					    qid);
--				break;
--			}
--		}
--
--		/*
--		 * Release all frames with a valid tx status.
--		 */
--		rt2x00queue_for_each_entry(queue, Q_INDEX_DONE,
--					   Q_INDEX, NULL,
--					   rt2800mmio_txdone_release_entries);
--
--		if (--max_tx_done == 0)
--			break;
--	}
--
--	return !max_tx_done;
--}
--
- static inline void rt2800mmio_enable_interrupt(struct rt2x00_dev *rt2x00dev,
- 					       struct rt2x00_field32 irq_field)
- {
-@@ -349,14 +194,14 @@ static inline void rt2800mmio_enable_int
- void rt2800mmio_txstatus_tasklet(unsigned long data)
- {
- 	struct rt2x00_dev *rt2x00dev = (struct rt2x00_dev *)data;
--	if (rt2800mmio_txdone(rt2x00dev))
--		tasklet_schedule(&rt2x00dev->txstatus_tasklet);
- 
--	/*
--	 * No need to enable the tx status interrupt here as we always
--	 * leave it enabled to minimize the possibility of a tx status
--	 * register overflow. See comment in interrupt handler.
--	 */
-+	rt2800_txdone(rt2x00dev);
-+
-+	rt2800_txdone_nostatus(rt2x00dev);
-+
-+	if (test_bit(DEVICE_STATE_ENABLED_RADIO, &rt2x00dev->flags))
-+		rt2800mmio_enable_interrupt(rt2x00dev,
-+					    INT_SOURCE_CSR_TX_FIFO_STATUS);
- }
- EXPORT_SYMBOL_GPL(rt2800mmio_txstatus_tasklet);
- 
-@@ -440,10 +285,6 @@ static void rt2800mmio_txstatus_interrup
- 	 * because we can schedule the tasklet multiple times (when the
- 	 * interrupt fires again during tx status processing).
- 	 *
--	 * Furthermore we don't disable the TX_FIFO_STATUS
--	 * interrupt here but leave it enabled so that the TX_STA_FIFO
--	 * can also be read while the tx status tasklet gets executed.
--	 *
- 	 * Since we have only one producer and one consumer we don't
- 	 * need to lock the kfifo.
- 	 */
-@@ -485,13 +326,8 @@ irqreturn_t rt2800mmio_interrupt(int irq
- 	 */
- 	mask = ~reg;
- 
--	if (rt2x00_get_field32(reg, INT_SOURCE_CSR_TX_FIFO_STATUS)) {
-+	if (rt2x00_get_field32(reg, INT_SOURCE_CSR_TX_FIFO_STATUS))
- 		rt2800mmio_txstatus_interrupt(rt2x00dev);
--		/*
--		 * Never disable the TX_FIFO_STATUS interrupt.
--		 */
--		rt2x00_set_field32(&mask, INT_MASK_CSR_TX_FIFO_STATUS, 1);
--	}
- 
- 	if (rt2x00_get_field32(reg, INT_SOURCE_CSR_PRE_TBTT))
- 		tasklet_hi_schedule(&rt2x00dev->pretbtt_tasklet);
---- a/drivers/net/wireless/ralink/rt2x00/rt2x00queue.c
-+++ b/drivers/net/wireless/ralink/rt2x00/rt2x00queue.c
-@@ -113,6 +113,7 @@ int rt2x00queue_map_txskb(struct queue_e
- 		return -ENOMEM;
- 
- 	skbdesc->flags |= SKBDESC_DMA_MAPPED_TX;
-+	rt2x00lib_dmadone(entry);
- 	return 0;
- }
- EXPORT_SYMBOL_GPL(rt2x00queue_map_txskb);
diff --git a/package/kernel/mac80211/patches/rt2x00/004-rt2x00-do-not-check-for-txstatus-timeout-every-time-.patch b/package/kernel/mac80211/patches/rt2x00/004-rt2x00-do-not-check-for-txstatus-timeout-every-time-.patch
deleted file mode 100644
index 832768d042..0000000000
--- a/package/kernel/mac80211/patches/rt2x00/004-rt2x00-do-not-check-for-txstatus-timeout-every-time-.patch
+++ /dev/null
@@ -1,72 +0,0 @@
-From 5022efb50f625d11fdf18b1fee0f64ebb1863664 Mon Sep 17 00:00:00 2001
-From: Stanislaw Gruszka <sgruszka at redhat.com>
-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 at redhat.com>
-Signed-off-by: Kalle Valo <kvalo at codeaurora.org>
----
- drivers/net/wireless/ralink/rt2x00/rt2800lib.c   | 7 +++++++
- drivers/net/wireless/ralink/rt2x00/rt2800mmio.c  | 3 ++-
- drivers/net/wireless/ralink/rt2x00/rt2x00.h      | 2 ++
- drivers/net/wireless/ralink/rt2x00/rt2x00queue.c | 1 +
- 4 files changed, 12 insertions(+), 1 deletion(-)
-
---- a/drivers/net/wireless/ralink/rt2x00/rt2800lib.c
-+++ b/drivers/net/wireless/ralink/rt2x00/rt2800lib.c
-@@ -1158,11 +1158,18 @@ bool rt2800_txstatus_timeout(struct rt2x
- 	struct data_queue *queue;
- 	struct queue_entry *entry;
- 
-+	if (time_before(jiffies,
-+			rt2x00dev->last_nostatus_check + msecs_to_jiffies(500)))
-+		return false;
-+
-+	rt2x00dev->last_nostatus_check = jiffies;
-+
- 	tx_queue_for_each(rt2x00dev, queue) {
- 		entry = rt2x00queue_get_entry(queue, Q_INDEX_DONE);
- 		if (rt2800_entry_txstatus_timeout(entry))
- 			return true;
- 	}
-+
- 	return false;
- }
- EXPORT_SYMBOL_GPL(rt2800_txstatus_timeout);
---- a/drivers/net/wireless/ralink/rt2x00/rt2800mmio.c
-+++ b/drivers/net/wireless/ralink/rt2x00/rt2800mmio.c
-@@ -197,7 +197,8 @@ void rt2800mmio_txstatus_tasklet(unsigne
- 
- 	rt2800_txdone(rt2x00dev);
- 
--	rt2800_txdone_nostatus(rt2x00dev);
-+	if (rt2800_txstatus_timeout(rt2x00dev))
-+		rt2800_txdone_nostatus(rt2x00dev);
- 
- 	if (test_bit(DEVICE_STATE_ENABLED_RADIO, &rt2x00dev->flags))
- 		rt2800mmio_enable_interrupt(rt2x00dev,
---- a/drivers/net/wireless/ralink/rt2x00/rt2x00.h
-+++ b/drivers/net/wireless/ralink/rt2x00/rt2x00.h
-@@ -980,6 +980,8 @@ struct rt2x00_dev {
- 	 */
- 	DECLARE_KFIFO_PTR(txstatus_fifo, u32);
- 
-+	unsigned long last_nostatus_check;
-+
- 	/*
- 	 * Timer to ensure tx status reports are read (rt2800usb).
- 	 */
---- a/drivers/net/wireless/ralink/rt2x00/rt2x00queue.c
-+++ b/drivers/net/wireless/ralink/rt2x00/rt2x00queue.c
-@@ -1039,6 +1039,7 @@ void rt2x00queue_start_queues(struct rt2
- 	 */
- 	tx_queue_for_each(rt2x00dev, queue)
- 		rt2x00queue_start_queue(queue);
-+	rt2x00dev->last_nostatus_check = jiffies;
- 
- 	rt2x00queue_start_queue(rt2x00dev->rx);
- }
diff --git a/package/kernel/mac80211/patches/rt2x00/005-rt2x00-use-different-txstatus-timeouts-when-flushing.patch b/package/kernel/mac80211/patches/rt2x00/005-rt2x00-use-different-txstatus-timeouts-when-flushing.patch
deleted file mode 100644
index 0f29026373..0000000000
--- a/package/kernel/mac80211/patches/rt2x00/005-rt2x00-use-different-txstatus-timeouts-when-flushing.patch
+++ /dev/null
@@ -1,112 +0,0 @@
-From adf26a356f132e35093585521ea3e36cd185af83 Mon Sep 17 00:00:00 2001
-From: Stanislaw Gruszka <sgruszka at redhat.com>
-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
-radio conditions and frames are reposted many times device can not provide
-the status for quite long. With new timeout we can still get valid status
-on such bad conditions.
-
-Signed-off-by: Stanislaw Gruszka <sgruszka at redhat.com>
-Signed-off-by: Kalle Valo <kvalo at codeaurora.org>
----
- .../net/wireless/ralink/rt2x00/rt2800lib.c    | 31 +++++++++++++------
- drivers/net/wireless/ralink/rt2x00/rt2x00.h   |  1 +
- .../net/wireless/ralink/rt2x00/rt2x00mac.c    |  4 +++
- 3 files changed, 26 insertions(+), 10 deletions(-)
-
---- a/drivers/net/wireless/ralink/rt2x00/rt2800lib.c
-+++ b/drivers/net/wireless/ralink/rt2x00/rt2800lib.c
-@@ -1137,36 +1137,47 @@ void rt2800_txdone(struct rt2x00_dev *rt
- }
- EXPORT_SYMBOL_GPL(rt2800_txdone);
- 
--static inline bool rt2800_entry_txstatus_timeout(struct queue_entry *entry)
-+static inline bool rt2800_entry_txstatus_timeout(struct rt2x00_dev *rt2x00dev,
-+						 struct queue_entry *entry)
- {
--	bool tout;
-+	bool ret;
-+	unsigned long tout;
- 
- 	if (!test_bit(ENTRY_DATA_STATUS_PENDING, &entry->flags))
- 		return false;
- 
--	tout = time_after(jiffies, entry->last_action + msecs_to_jiffies(500));
--	if (unlikely(tout))
-+	if (test_bit(DEVICE_STATE_FLUSHING, &rt2x00dev->flags))
-+		tout = msecs_to_jiffies(100);
-+	else
-+		tout = msecs_to_jiffies(2000);
-+
-+	ret = time_after(jiffies, entry->last_action + tout);
-+	if (unlikely(ret))
- 		rt2x00_dbg(entry->queue->rt2x00dev,
- 			   "TX status timeout for entry %d in queue %d\n",
- 			   entry->entry_idx, entry->queue->qid);
--	return tout;
--
-+	return ret;
- }
- 
- bool rt2800_txstatus_timeout(struct rt2x00_dev *rt2x00dev)
- {
- 	struct data_queue *queue;
- 	struct queue_entry *entry;
-+	unsigned long tout;
-+
-+	if (test_bit(DEVICE_STATE_FLUSHING, &rt2x00dev->flags))
-+		tout = msecs_to_jiffies(50);
-+	else
-+		tout = msecs_to_jiffies(1000);
- 
--	if (time_before(jiffies,
--			rt2x00dev->last_nostatus_check + msecs_to_jiffies(500)))
-+	if (time_before(jiffies, rt2x00dev->last_nostatus_check + tout))
- 		return false;
- 
- 	rt2x00dev->last_nostatus_check = jiffies;
- 
- 	tx_queue_for_each(rt2x00dev, queue) {
- 		entry = rt2x00queue_get_entry(queue, Q_INDEX_DONE);
--		if (rt2800_entry_txstatus_timeout(entry))
-+		if (rt2800_entry_txstatus_timeout(rt2x00dev, entry))
- 			return true;
- 	}
- 
-@@ -1195,7 +1206,7 @@ void rt2800_txdone_nostatus(struct rt2x0
- 				break;
- 
- 			if (test_bit(ENTRY_DATA_IO_FAILED, &entry->flags) ||
--			    rt2800_entry_txstatus_timeout(entry))
-+			    rt2800_entry_txstatus_timeout(rt2x00dev, entry))
- 				rt2x00lib_txdone_noinfo(entry, TXDONE_FAILURE);
- 			else
- 				break;
---- a/drivers/net/wireless/ralink/rt2x00/rt2x00.h
-+++ b/drivers/net/wireless/ralink/rt2x00/rt2x00.h
-@@ -665,6 +665,7 @@ enum rt2x00_state_flags {
- 	DEVICE_STATE_STARTED,
- 	DEVICE_STATE_ENABLED_RADIO,
- 	DEVICE_STATE_SCANNING,
-+	DEVICE_STATE_FLUSHING,
- 
- 	/*
- 	 * Driver configuration
---- a/drivers/net/wireless/ralink/rt2x00/rt2x00mac.c
-+++ b/drivers/net/wireless/ralink/rt2x00/rt2x00mac.c
-@@ -720,8 +720,12 @@ void rt2x00mac_flush(struct ieee80211_hw
- 	if (!test_bit(DEVICE_STATE_PRESENT, &rt2x00dev->flags))
- 		return;
- 
-+	set_bit(DEVICE_STATE_FLUSHING, &rt2x00dev->flags);
-+
- 	tx_queue_for_each(rt2x00dev, queue)
- 		rt2x00queue_flush_queue(queue, drop);
-+
-+	clear_bit(DEVICE_STATE_FLUSHING, &rt2x00dev->flags);
- }
- EXPORT_SYMBOL_GPL(rt2x00mac_flush);
- 
diff --git a/package/kernel/mac80211/patches/rt2x00/006-rt2800-flush-and-txstatus-rework-for-rt2800mmio.patch b/package/kernel/mac80211/patches/rt2x00/006-rt2800-flush-and-txstatus-rework-for-rt2800mmio.patch
deleted file mode 100644
index 784fbb16f1..0000000000
--- a/package/kernel/mac80211/patches/rt2x00/006-rt2800-flush-and-txstatus-rework-for-rt2800mmio.patch
+++ /dev/null
@@ -1,238 +0,0 @@
-From 0240564430c0697d8fde3743d70346a922466b36 Mon Sep 17 00:00:00 2001
-From: Stanislaw Gruszka <sgruszka at redhat.com>
-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 at redhat.com>
-Signed-off-by: Kalle Valo <kvalo at codeaurora.org>
----
- .../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, 97 insertions(+), 38 deletions(-)
-
---- a/drivers/net/wireless/ralink/rt2x00/rt2800lib.c
-+++ b/drivers/net/wireless/ralink/rt2x00/rt2800lib.c
-@@ -1147,7 +1147,7 @@ static inline bool rt2800_entry_txstatus
- 		return false;
- 
- 	if (test_bit(DEVICE_STATE_FLUSHING, &rt2x00dev->flags))
--		tout = msecs_to_jiffies(100);
-+		tout = msecs_to_jiffies(50);
- 	else
- 		tout = msecs_to_jiffies(2000);
- 
-@@ -1163,15 +1163,13 @@ bool rt2800_txstatus_timeout(struct rt2x
- {
- 	struct data_queue *queue;
- 	struct queue_entry *entry;
--	unsigned long tout;
- 
--	if (test_bit(DEVICE_STATE_FLUSHING, &rt2x00dev->flags))
--		tout = msecs_to_jiffies(50);
--	else
--		tout = msecs_to_jiffies(1000);
-+	if (!test_bit(DEVICE_STATE_FLUSHING, &rt2x00dev->flags)) {
-+		unsigned long tout = msecs_to_jiffies(1000);
- 
--	if (time_before(jiffies, rt2x00dev->last_nostatus_check + tout))
--		return false;
-+		if (time_before(jiffies, rt2x00dev->last_nostatus_check + tout))
-+			return false;
-+	}
- 
- 	rt2x00dev->last_nostatus_check = jiffies;
- 
---- a/drivers/net/wireless/ralink/rt2x00/rt2800mmio.c
-+++ b/drivers/net/wireless/ralink/rt2x00/rt2800mmio.c
-@@ -191,21 +191,6 @@ static inline void rt2800mmio_enable_int
- 	spin_unlock_irq(&rt2x00dev->irqmask_lock);
- }
- 
--void rt2800mmio_txstatus_tasklet(unsigned long data)
--{
--	struct rt2x00_dev *rt2x00dev = (struct rt2x00_dev *)data;
--
--	rt2800_txdone(rt2x00dev);
--
--	if (rt2800_txstatus_timeout(rt2x00dev))
--		rt2800_txdone_nostatus(rt2x00dev);
--
--	if (test_bit(DEVICE_STATE_ENABLED_RADIO, &rt2x00dev->flags))
--		rt2800mmio_enable_interrupt(rt2x00dev,
--					    INT_SOURCE_CSR_TX_FIFO_STATUS);
--}
--EXPORT_SYMBOL_GPL(rt2800mmio_txstatus_tasklet);
--
- void rt2800mmio_pretbtt_tasklet(unsigned long data)
- {
- 	struct rt2x00_dev *rt2x00dev = (struct rt2x00_dev *)data;
-@@ -270,12 +255,26 @@ void rt2800mmio_autowake_tasklet(unsigne
- }
- EXPORT_SYMBOL_GPL(rt2800mmio_autowake_tasklet);
- 
--static void rt2800mmio_txstatus_interrupt(struct rt2x00_dev *rt2x00dev)
-+static void rt2800mmio_txdone(struct rt2x00_dev *rt2x00dev)
-+{
-+	bool timeout = false;
-+
-+	while (!kfifo_is_empty(&rt2x00dev->txstatus_fifo) ||
-+	       (timeout = rt2800_txstatus_timeout(rt2x00dev))) {
-+
-+		rt2800_txdone(rt2x00dev);
-+
-+		if (timeout)
-+			rt2800_txdone_nostatus(rt2x00dev);
-+	}
-+}
-+
-+static bool rt2800mmio_fetch_txstatus(struct rt2x00_dev *rt2x00dev)
- {
- 	u32 status;
--	int i;
-+	bool more = false;
- 
--	/*
-+	/* FIXEME: rewrite this comment
- 	 * The TX_FIFO_STATUS interrupt needs special care. We should
- 	 * read TX_STA_FIFO but we should do it immediately as otherwise
- 	 * the register can overflow and we would lose status reports.
-@@ -286,25 +285,37 @@ static void rt2800mmio_txstatus_interrup
- 	 * because we can schedule the tasklet multiple times (when the
- 	 * interrupt fires again during tx status processing).
- 	 *
--	 * Since we have only one producer and one consumer we don't
-+	 * txstatus tasklet is called with INT_SOURCE_CSR_TX_FIFO_STATUS
-+	 * disabled so have only one producer and one consumer - we don't
- 	 * need to lock the kfifo.
- 	 */
--	for (i = 0; i < rt2x00dev->tx->limit; i++) {
-+	while (!kfifo_is_full(&rt2x00dev->txstatus_fifo)) {
- 		status = rt2x00mmio_register_read(rt2x00dev, TX_STA_FIFO);
--
- 		if (!rt2x00_get_field32(status, TX_STA_FIFO_VALID))
- 			break;
- 
--		if (!kfifo_put(&rt2x00dev->txstatus_fifo, status)) {
--			rt2x00_warn(rt2x00dev, "TX status FIFO overrun, drop tx status report\n");
--			break;
--		}
-+		kfifo_put(&rt2x00dev->txstatus_fifo, status);
-+		more = true;
- 	}
- 
--	/* Schedule the tasklet for processing the tx status. */
--	tasklet_schedule(&rt2x00dev->txstatus_tasklet);
-+	return more;
- }
- 
-+void rt2800mmio_txstatus_tasklet(unsigned long data)
-+{
-+	struct rt2x00_dev *rt2x00dev = (struct rt2x00_dev *)data;
-+
-+	do {
-+		rt2800mmio_txdone(rt2x00dev);
-+
-+	} while (rt2800mmio_fetch_txstatus(rt2x00dev));
-+
-+	if (test_bit(DEVICE_STATE_ENABLED_RADIO, &rt2x00dev->flags))
-+		rt2800mmio_enable_interrupt(rt2x00dev,
-+					    INT_SOURCE_CSR_TX_FIFO_STATUS);
-+}
-+EXPORT_SYMBOL_GPL(rt2800mmio_txstatus_tasklet);
-+
- irqreturn_t rt2800mmio_interrupt(int irq, void *dev_instance)
- {
- 	struct rt2x00_dev *rt2x00dev = dev_instance;
-@@ -327,8 +338,10 @@ irqreturn_t rt2800mmio_interrupt(int irq
- 	 */
- 	mask = ~reg;
- 
--	if (rt2x00_get_field32(reg, INT_SOURCE_CSR_TX_FIFO_STATUS))
--		rt2800mmio_txstatus_interrupt(rt2x00dev);
-+	if (rt2x00_get_field32(reg, INT_SOURCE_CSR_TX_FIFO_STATUS)) {
-+		rt2800mmio_fetch_txstatus(rt2x00dev);
-+		tasklet_schedule(&rt2x00dev->txstatus_tasklet);
-+	}
- 
- 	if (rt2x00_get_field32(reg, INT_SOURCE_CSR_PRE_TBTT))
- 		tasklet_hi_schedule(&rt2x00dev->pretbtt_tasklet);
-@@ -453,6 +466,53 @@ void rt2800mmio_kick_queue(struct data_q
- }
- EXPORT_SYMBOL_GPL(rt2800mmio_kick_queue);
- 
-+void rt2800mmio_flush_queue(struct data_queue *queue, bool drop)
-+{
-+	struct rt2x00_dev *rt2x00dev = queue->rt2x00dev;
-+	bool tx_queue = false;
-+	unsigned int i;
-+
-+	switch (queue->qid) {
-+	case QID_AC_VO:
-+	case QID_AC_VI:
-+	case QID_AC_BE:
-+	case QID_AC_BK:
-+		tx_queue = true;
-+		break;
-+	case QID_RX:
-+		break;
-+	default:
-+		return;
-+	}
-+
-+	for (i = 0; i < 5; i++) {
-+		/*
-+		 * Check if the driver is already done, otherwise we
-+		 * have to sleep a little while to give the driver/hw
-+		 * the oppurtunity to complete interrupt process itself.
-+		 */
-+		if (rt2x00queue_empty(queue))
-+			break;
-+
-+		/*
-+		 * For TX queues schedule completion tasklet to catch
-+		 * tx status timeouts, othewise just wait.
-+		 */
-+		if (tx_queue) {
-+			tasklet_disable(&rt2x00dev->txstatus_tasklet);
-+			rt2800mmio_txdone(rt2x00dev);
-+			tasklet_enable(&rt2x00dev->txstatus_tasklet);
-+		}
-+
-+		/*
-+		 * Wait for a little while to give the driver
-+		 * the oppurtunity to recover itself.
-+		 */
-+		msleep(50);
-+	}
-+}
-+EXPORT_SYMBOL_GPL(rt2800mmio_flush_queue);
-+
- void rt2800mmio_stop_queue(struct data_queue *queue)
- {
- 	struct rt2x00_dev *rt2x00dev = queue->rt2x00dev;
---- a/drivers/net/wireless/ralink/rt2x00/rt2800mmio.h
-+++ b/drivers/net/wireless/ralink/rt2x00/rt2800mmio.h
-@@ -148,6 +148,7 @@ void rt2800mmio_toggle_irq(struct rt2x00
- /* Queue handlers */
- void rt2800mmio_start_queue(struct data_queue *queue);
- void rt2800mmio_kick_queue(struct data_queue *queue);
-+void rt2800mmio_flush_queue(struct data_queue *queue, bool drop);
- void rt2800mmio_stop_queue(struct data_queue *queue);
- void rt2800mmio_queue_init(struct data_queue *queue);
- 
---- a/drivers/net/wireless/ralink/rt2x00/rt2800pci.c
-+++ b/drivers/net/wireless/ralink/rt2x00/rt2800pci.c
-@@ -364,7 +364,7 @@ static const struct rt2x00lib_ops rt2800
- 	.start_queue		= rt2800mmio_start_queue,
- 	.kick_queue		= rt2800mmio_kick_queue,
- 	.stop_queue		= rt2800mmio_stop_queue,
--	.flush_queue		= rt2x00mmio_flush_queue,
-+	.flush_queue		= rt2800mmio_flush_queue,
- 	.write_tx_desc		= rt2800mmio_write_tx_desc,
- 	.write_tx_data		= rt2800_write_tx_data,
- 	.write_beacon		= rt2800_write_beacon,
diff --git a/package/kernel/mac80211/patches/rt2x00/007-rt2x00-rt2400pci-mark-expected-switch-fall-through.patch b/package/kernel/mac80211/patches/rt2x00/007-rt2x00-rt2400pci-mark-expected-switch-fall-through.patch
deleted file mode 100644
index 2161ad9ef3..0000000000
--- a/package/kernel/mac80211/patches/rt2x00/007-rt2x00-rt2400pci-mark-expected-switch-fall-through.patch
+++ /dev/null
@@ -1,25 +0,0 @@
-From 6eba8fd2235237784dfd01da55c3210d493aebdb Mon Sep 17 00:00:00 2001
-From: "Gustavo A. R. Silva" <gustavo at 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 at embeddedor.com>
-Signed-off-by: Kalle Valo <kvalo at 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);
- 		}
diff --git a/package/kernel/mac80211/patches/rt2x00/008-rt2x00-rt2500pci-mark-expected-switch-fall-through.patch b/package/kernel/mac80211/patches/rt2x00/008-rt2x00-rt2500pci-mark-expected-switch-fall-through.patch
deleted file mode 100644
index d10de6b0e5..0000000000
--- a/package/kernel/mac80211/patches/rt2x00/008-rt2x00-rt2500pci-mark-expected-switch-fall-through.patch
+++ /dev/null
@@ -1,25 +0,0 @@
-From 10bb92217747c3384a01ebec005faa2f5e72bbd8 Mon Sep 17 00:00:00 2001
-From: "Gustavo A. R. Silva" <gustavo at 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 at embeddedor.com>
-Signed-off-by: Kalle Valo <kvalo at 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);
- 		}
diff --git a/package/kernel/mac80211/patches/rt2x00/009-rt2x00-rt2800lib-mark-expected-switch-fall-throughs.patch b/package/kernel/mac80211/patches/rt2x00/009-rt2x00-rt2800lib-mark-expected-switch-fall-throughs.patch
deleted file mode 100644
index 99f971b95f..0000000000
--- a/package/kernel/mac80211/patches/rt2x00/009-rt2x00-rt2800lib-mark-expected-switch-fall-throughs.patch
+++ /dev/null
@@ -1,44 +0,0 @@
-From 916e6bbcfcff6cc5d7d33bba8557a30f3af50326 Mon Sep 17 00:00:00 2001
-From: "Gustavo A. R. Silva" <gustavo at 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 at embeddedor.com>
-Signed-off-by: Kalle Valo <kvalo at 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 */
diff --git a/package/kernel/mac80211/patches/rt2x00/010-rt2x00-rt61pci-mark-expected-switch-fall-through.patch b/package/kernel/mac80211/patches/rt2x00/010-rt2x00-rt61pci-mark-expected-switch-fall-through.patch
deleted file mode 100644
index 5b0f96d293..0000000000
--- a/package/kernel/mac80211/patches/rt2x00/010-rt2x00-rt61pci-mark-expected-switch-fall-through.patch
+++ /dev/null
@@ -1,25 +0,0 @@
-From 641dd8068ecb078e7d12efe465df202bc16ca5eb Mon Sep 17 00:00:00 2001
-From: "Gustavo A. R. Silva" <gustavo at embeddedor.com>
-Date: Mon, 22 Oct 2018 22:46:47 +0200
-Subject: [PATCH 10/28] rt2x00: rt61pci: 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 at embeddedor.com>
-Signed-off-by: Kalle Valo <kvalo at codeaurora.org>
----
- drivers/net/wireless/ralink/rt2x00/rt61pci.c | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
---- a/drivers/net/wireless/ralink/rt2x00/rt61pci.c
-+++ b/drivers/net/wireless/ralink/rt2x00/rt61pci.c
-@@ -2226,7 +2226,7 @@ static void rt61pci_txdone(struct rt2x00
- 			break;
- 		case 6: /* 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);
- 		}
diff --git a/package/kernel/mac80211/patches/rt2x00/011-cross-tree-phase-out-dma_zalloc_coherent.patch b/package/kernel/mac80211/patches/rt2x00/011-cross-tree-phase-out-dma_zalloc_coherent.patch
deleted file mode 100644
index 8100eb063b..0000000000
--- a/package/kernel/mac80211/patches/rt2x00/011-cross-tree-phase-out-dma_zalloc_coherent.patch
+++ /dev/null
@@ -1,40 +0,0 @@
-From 750afb08ca71310fcf0c4e2cb1565c63b8235b60 Mon Sep 17 00:00:00 2001
-From: Luis Chamberlain <mcgrof at kernel.org>
-Date: Fri, 4 Jan 2019 09:23:09 +0100
-Subject: [PATCH 11/28] cross-tree: phase out dma_zalloc_coherent()
-
-We already need to zero out memory for dma_alloc_coherent(), as such
-using dma_zalloc_coherent() is superflous. Phase it out.
-
-This change was generated with the following Coccinelle SmPL patch:
-
-@ replace_dma_zalloc_coherent @
-expression dev, size, data, handle, flags;
-@@
-
--dma_zalloc_coherent(dev, size, handle, flags)
-+dma_alloc_coherent(dev, size, handle, flags)
-
-Suggested-by: Christoph Hellwig <hch at lst.de>
-Signed-off-by: Luis Chamberlain <mcgrof at kernel.org>
-[hch: re-ran the script on the latest tree]
-Signed-off-by: Christoph Hellwig <hch at lst.de>
----
- drivers/net/wireless/ralink/rt2x00/rt2x00mmio.c | 6 +++---
- 1 file changed, 3 insertions(+), 3 deletions(-)
-
---- a/drivers/net/wireless/ralink/rt2x00/rt2x00mmio.c
-+++ b/drivers/net/wireless/ralink/rt2x00/rt2x00mmio.c
-@@ -119,9 +119,9 @@ static int rt2x00mmio_alloc_queue_dma(st
- 	/*
- 	 * Allocate DMA memory for descriptor and buffer.
- 	 */
--	addr = dma_zalloc_coherent(rt2x00dev->dev,
--				   queue->limit * queue->desc_size, &dma,
--				   GFP_KERNEL);
-+	addr = dma_alloc_coherent(rt2x00dev->dev,
-+				  queue->limit * queue->desc_size, &dma,
-+				  GFP_KERNEL);
- 	if (!addr)
- 		return -ENOMEM;
- 
diff --git a/package/kernel/mac80211/patches/rt2x00/012-rt2x00-reduce-tx-power-to-nominal-level-on-RT6352.patch b/package/kernel/mac80211/patches/rt2x00/012-rt2x00-reduce-tx-power-to-nominal-level-on-RT6352.patch
deleted file mode 100644
index a07832e97c..0000000000
--- a/package/kernel/mac80211/patches/rt2x00/012-rt2x00-reduce-tx-power-to-nominal-level-on-RT6352.patch
+++ /dev/null
@@ -1,32 +0,0 @@
-From c2e28ef7711ffcb083474ee5f154264c6ec1ec07 Mon Sep 17 00:00:00 2001
-From: =?UTF-8?q?Tomislav=20Po=C5=BEega?= <pozega.tomislav at gmail.com>
-Date: Thu, 27 Dec 2018 15:05:25 +0100
-Subject: [PATCH 12/28] rt2x00: reduce tx power to nominal level on RT6352
-MIME-Version: 1.0
-Content-Type: text/plain; charset=UTF-8
-Content-Transfer-Encoding: 8bit
-
-Current implementation of RT6352 support provides too high tx power
-at least on iPA/eLNA devices. Reduce amplification of variable gain
-amplifier by 6dB to match board target power of 17dBm.
-Transmited signal strength with this patch is similar to that of
-stock firmware or pandorabox firmware. Throughput measured with iperf
-improves. Device tested: Xiaomi Miwifi Mini.
-
-Signed-off-by: Tomislav Požega <pozega.tomislav at gmail.com>
-Signed-off-by: Kalle Valo <kvalo at codeaurora.org>
----
- drivers/net/wireless/ralink/rt2x00/rt2800lib.c | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
---- a/drivers/net/wireless/ralink/rt2x00/rt2800lib.c
-+++ b/drivers/net/wireless/ralink/rt2x00/rt2800lib.c
-@@ -5477,7 +5477,7 @@ static int rt2800_init_registers(struct
- 		rt2800_register_write(rt2x00dev, TX_SW_CFG2, 0x00000000);
- 		rt2800_register_write(rt2x00dev, MIMO_PS_CFG, 0x00000002);
- 		rt2800_register_write(rt2x00dev, TX_PIN_CFG, 0x00150F0F);
--		rt2800_register_write(rt2x00dev, TX_ALC_VGA3, 0x06060606);
-+		rt2800_register_write(rt2x00dev, TX_ALC_VGA3, 0x00000000);
- 		rt2800_register_write(rt2x00dev, TX0_BB_GAIN_ATTEN, 0x0);
- 		rt2800_register_write(rt2x00dev, TX1_BB_GAIN_ATTEN, 0x0);
- 		rt2800_register_write(rt2x00dev, TX0_RF_GAIN_ATTEN, 0x6C6C666C);
diff --git a/package/kernel/mac80211/patches/rt2x00/013-rt2x00-Work-around-a-firmware-bug-with-shared-keys.patch b/package/kernel/mac80211/patches/rt2x00/013-rt2x00-Work-around-a-firmware-bug-with-shared-keys.patch
deleted file mode 100644
index dc884c17d2..0000000000
--- a/package/kernel/mac80211/patches/rt2x00/013-rt2x00-Work-around-a-firmware-bug-with-shared-keys.patch
+++ /dev/null
@@ -1,143 +0,0 @@
-From a4296994eb8061ee3455721a296c387c639bf635 Mon Sep 17 00:00:00 2001
-From: Bernd Edlinger <bernd.edlinger at hotmail.de>
-Date: Tue, 15 Jan 2019 14:01:29 +0000
-Subject: [PATCH 13/28] rt2x00: Work around a firmware bug with shared keys
-
-Apparently the rt2x61 firmware fails temporarily to decode
-broadcast packets if the shared keys are not assigned
-in the "correct" sequence. At the same time unicast
-packets work fine, since they are encrypted with the
-pairwise key.
-
-At least with WPA2 CCMP mode the shared keys are
-set in the following sequence: keyidx=1, 2, 1, 2.
-After a while only keyidx 2 gets decrypted, and
-keyidx 1 is ignored, probably because there is never
-a keyidx 3.
-
-Symptoms are arping -b works for 10 minutes, since
-keyidx=2 is used for broadcast, and then it stops
-working for 10 minutes, because keyidx=1 is used.
-That failure mode repeats forever.
-
-Note, the firmware does not even know which keyidx
-corresponds to which hw_key_idx so the firmware is
-trying to be smarter than the driver, which is bound
-to fail.
-
-As workaround the function rt61pci_config_shared_key
-requests software decryption of the shared keys,
-by returning EOPNOTSUPP. However, pairwise keys are
-still handled by hardware which works just fine.
-
-Signed-off-by: Bernd Edlinger <bernd.edlinger at hotmail.de>
-Acked-by: Stanislaw Gruszka <sgruszka at redhat.com>
-Signed-off-by: Kalle Valo <kvalo at codeaurora.org>
----
- drivers/net/wireless/ralink/rt2x00/rt61pci.c | 93 +-------------------
- 1 file changed, 4 insertions(+), 89 deletions(-)
-
---- a/drivers/net/wireless/ralink/rt2x00/rt61pci.c
-+++ b/drivers/net/wireless/ralink/rt2x00/rt61pci.c
-@@ -321,97 +321,12 @@ static int rt61pci_config_shared_key(str
- 				     struct rt2x00lib_crypto *crypto,
- 				     struct ieee80211_key_conf *key)
- {
--	struct hw_key_entry key_entry;
--	struct rt2x00_field32 field;
--	u32 mask;
--	u32 reg;
--
--	if (crypto->cmd == SET_KEY) {
--		/*
--		 * rt2x00lib can't determine the correct free
--		 * key_idx for shared keys. We have 1 register
--		 * with key valid bits. The goal is simple, read
--		 * the register, if that is full we have no slots
--		 * left.
--		 * Note that each BSS is allowed to have up to 4
--		 * shared keys, so put a mask over the allowed
--		 * entries.
--		 */
--		mask = (0xf << crypto->bssidx);
--
--		reg = rt2x00mmio_register_read(rt2x00dev, SEC_CSR0);
--		reg &= mask;
--
--		if (reg && reg == mask)
--			return -ENOSPC;
--
--		key->hw_key_idx += reg ? ffz(reg) : 0;
--
--		/*
--		 * Upload key to hardware
--		 */
--		memcpy(key_entry.key, crypto->key,
--		       sizeof(key_entry.key));
--		memcpy(key_entry.tx_mic, crypto->tx_mic,
--		       sizeof(key_entry.tx_mic));
--		memcpy(key_entry.rx_mic, crypto->rx_mic,
--		       sizeof(key_entry.rx_mic));
--
--		reg = SHARED_KEY_ENTRY(key->hw_key_idx);
--		rt2x00mmio_register_multiwrite(rt2x00dev, reg,
--					       &key_entry, sizeof(key_entry));
--
--		/*
--		 * The cipher types are stored over 2 registers.
--		 * bssidx 0 and 1 keys are stored in SEC_CSR1 and
--		 * bssidx 1 and 2 keys are stored in SEC_CSR5.
--		 * Using the correct defines correctly will cause overhead,
--		 * so just calculate the correct offset.
--		 */
--		if (key->hw_key_idx < 8) {
--			field.bit_offset = (3 * key->hw_key_idx);
--			field.bit_mask = 0x7 << field.bit_offset;
--
--			reg = rt2x00mmio_register_read(rt2x00dev, SEC_CSR1);
--			rt2x00_set_field32(&reg, field, crypto->cipher);
--			rt2x00mmio_register_write(rt2x00dev, SEC_CSR1, reg);
--		} else {
--			field.bit_offset = (3 * (key->hw_key_idx - 8));
--			field.bit_mask = 0x7 << field.bit_offset;
--
--			reg = rt2x00mmio_register_read(rt2x00dev, SEC_CSR5);
--			rt2x00_set_field32(&reg, field, crypto->cipher);
--			rt2x00mmio_register_write(rt2x00dev, SEC_CSR5, reg);
--		}
--
--		/*
--		 * The driver does not support the IV/EIV generation
--		 * in hardware. However it doesn't support the IV/EIV
--		 * inside the ieee80211 frame either, but requires it
--		 * to be provided separately for the descriptor.
--		 * rt2x00lib will cut the IV/EIV data out of all frames
--		 * given to us by mac80211, but we must tell mac80211
--		 * to generate the IV/EIV data.
--		 */
--		key->flags |= IEEE80211_KEY_FLAG_GENERATE_IV;
--	}
--
- 	/*
--	 * SEC_CSR0 contains only single-bit fields to indicate
--	 * a particular key is valid. Because using the FIELD32()
--	 * defines directly will cause a lot of overhead, we use
--	 * a calculation to determine the correct bit directly.
-+	 * Let the software handle the shared keys,
-+	 * since the hardware decryption does not work reliably,
-+	 * because the firmware does not know the key's keyidx.
- 	 */
--	mask = 1 << key->hw_key_idx;
--
--	reg = rt2x00mmio_register_read(rt2x00dev, SEC_CSR0);
--	if (crypto->cmd == SET_KEY)
--		reg |= mask;
--	else if (crypto->cmd == DISABLE_KEY)
--		reg &= ~mask;
--	rt2x00mmio_register_write(rt2x00dev, SEC_CSR0, reg);
--
--	return 0;
-+	return -EOPNOTSUPP;
- }
- 
- static int rt61pci_config_pairwise_key(struct rt2x00_dev *rt2x00dev,
diff --git a/package/kernel/mac80211/patches/rt2x00/014-rt2x00-no-need-to-check-return-value-of-debugfs_crea.patch b/package/kernel/mac80211/patches/rt2x00/014-rt2x00-no-need-to-check-return-value-of-debugfs_crea.patch
deleted file mode 100644
index 26f2df10e0..0000000000
--- a/package/kernel/mac80211/patches/rt2x00/014-rt2x00-no-need-to-check-return-value-of-debugfs_crea.patch
+++ /dev/null
@@ -1,107 +0,0 @@
-From 2587791d57588562c21e5ef7e678f02ab2f3eb82 Mon Sep 17 00:00:00 2001
-From: Greg Kroah-Hartman <gregkh at linuxfoundation.org>
-Date: Tue, 22 Jan 2019 16:21:34 +0100
-Subject: [PATCH 14/28] rt2x00: no need to check return value of debugfs_create
- functions
-
-When calling debugfs functions, there is no need to ever check the
-return value.  The function can work or not, but the code logic should
-never do something different based on this.
-
-Cc: Stanislaw Gruszka <sgruszka at redhat.com>
-Cc: Helmut Schaa <helmut.schaa at googlemail.com>
-Cc: Kalle Valo <kvalo at codeaurora.org>
-Cc: linux-wireless at vger.kernel.org
-Signed-off-by: Greg Kroah-Hartman <gregkh at linuxfoundation.org>
-Acked-by: Stanislaw Gruszka <sgruszka at redhat.com>
-Signed-off-by: Kalle Valo <kvalo at codeaurora.org>
----
- .../net/wireless/ralink/rt2x00/rt2x00debug.c  | 27 -------------------
- 1 file changed, 27 deletions(-)
-
---- a/drivers/net/wireless/ralink/rt2x00/rt2x00debug.c
-+++ b/drivers/net/wireless/ralink/rt2x00/rt2x00debug.c
-@@ -656,36 +656,24 @@ void rt2x00debug_register(struct rt2x00_
- 	intf->driver_folder =
- 	    debugfs_create_dir(intf->rt2x00dev->ops->name,
- 			       rt2x00dev->hw->wiphy->debugfsdir);
--	if (IS_ERR(intf->driver_folder) || !intf->driver_folder)
--		goto exit;
- 
- 	intf->driver_entry =
- 	    rt2x00debug_create_file_driver("driver", intf, &intf->driver_blob);
--	if (IS_ERR(intf->driver_entry) || !intf->driver_entry)
--		goto exit;
- 
- 	intf->chipset_entry =
- 	    rt2x00debug_create_file_chipset("chipset",
- 					    intf, &intf->chipset_blob);
--	if (IS_ERR(intf->chipset_entry) || !intf->chipset_entry)
--		goto exit;
- 
- 	intf->dev_flags = debugfs_create_file("dev_flags", 0400,
- 					      intf->driver_folder, intf,
- 					      &rt2x00debug_fop_dev_flags);
--	if (IS_ERR(intf->dev_flags) || !intf->dev_flags)
--		goto exit;
- 
- 	intf->cap_flags = debugfs_create_file("cap_flags", 0400,
- 					      intf->driver_folder, intf,
- 					      &rt2x00debug_fop_cap_flags);
--	if (IS_ERR(intf->cap_flags) || !intf->cap_flags)
--		goto exit;
- 
- 	intf->register_folder =
- 	    debugfs_create_dir("register", intf->driver_folder);
--	if (IS_ERR(intf->register_folder) || !intf->register_folder)
--		goto exit;
- 
- #define RT2X00DEBUGFS_CREATE_REGISTER_ENTRY(__intf, __name)		\
- ({									\
-@@ -695,9 +683,6 @@ void rt2x00debug_register(struct rt2x00_
- 					   0600,			\
- 					   (__intf)->register_folder,	\
- 					   &(__intf)->offset_##__name);	\
--		if (IS_ERR((__intf)->__name##_off_entry) ||		\
--		    !(__intf)->__name##_off_entry)			\
--			goto exit;					\
- 									\
- 		(__intf)->__name##_val_entry =				\
- 			debugfs_create_file(__stringify(__name) "_value", \
-@@ -705,9 +690,6 @@ void rt2x00debug_register(struct rt2x00_
- 					    (__intf)->register_folder,	\
- 					    (__intf),			\
- 					    &rt2x00debug_fop_##__name); \
--		if (IS_ERR((__intf)->__name##_val_entry) ||		\
--		    !(__intf)->__name##_val_entry)			\
--			goto exit;					\
- 	}								\
- })
- 
-@@ -721,15 +703,10 @@ void rt2x00debug_register(struct rt2x00_
- 
- 	intf->queue_folder =
- 	    debugfs_create_dir("queue", intf->driver_folder);
--	if (IS_ERR(intf->queue_folder) || !intf->queue_folder)
--		goto exit;
- 
- 	intf->queue_frame_dump_entry =
- 		debugfs_create_file("dump", 0400, intf->queue_folder,
- 				    intf, &rt2x00debug_fop_queue_dump);
--	if (IS_ERR(intf->queue_frame_dump_entry)
--		|| !intf->queue_frame_dump_entry)
--		goto exit;
- 
- 	skb_queue_head_init(&intf->frame_dump_skbqueue);
- 	init_waitqueue_head(&intf->frame_dump_waitqueue);
-@@ -747,10 +724,6 @@ void rt2x00debug_register(struct rt2x00_
- #endif
- 
- 	return;
--
--exit:
--	rt2x00debug_deregister(rt2x00dev);
--	rt2x00_err(rt2x00dev, "Failed to register debug handler\n");
- }
- 
- void rt2x00debug_deregister(struct rt2x00_dev *rt2x00dev)
diff --git a/package/kernel/mac80211/patches/rt2x00/015-rt2x00-remove-unneeded-check.patch b/package/kernel/mac80211/patches/rt2x00/015-rt2x00-remove-unneeded-check.patch
deleted file mode 100644
index 50e7de0855..0000000000
--- a/package/kernel/mac80211/patches/rt2x00/015-rt2x00-remove-unneeded-check.patch
+++ /dev/null
@@ -1,137 +0,0 @@
-From 17ae2acd1a6f5148edd80d84194e5d7c80be360e Mon Sep 17 00:00:00 2001
-From: =?UTF-8?q?Tomislav=20Po=C5=BEega?= <pozega.tomislav at gmail.com>
-Date: Wed, 13 Feb 2019 11:09:12 +0100
-Subject: [PATCH 15/28] rt2x00: remove unneeded check
-MIME-Version: 1.0
-Content-Type: text/plain; charset=UTF-8
-Content-Transfer-Encoding: 8bit
-
-Remove band check from rf53xx channel config routine since all chips
-using it are single band.
-
-Signed-off-by: Tomislav Požega <pozega.tomislav at gmail.com>
-Signed-off-by: Stanislaw Gruszka <sgruszka at redhat.com>
-Signed-off-by: Kalle Valo <kvalo at codeaurora.org>
----
- .../net/wireless/ralink/rt2x00/rt2800lib.c    | 103 +++++++++---------
- 1 file changed, 50 insertions(+), 53 deletions(-)
-
---- a/drivers/net/wireless/ralink/rt2x00/rt2800lib.c
-+++ b/drivers/net/wireless/ralink/rt2x00/rt2800lib.c
-@@ -2966,6 +2966,7 @@ static void rt2800_config_channel_rf53xx
- 					 struct channel_info *info)
- {
- 	u8 rfcsr;
-+	int idx = rf->channel-1;
- 
- 	rt2800_rfcsr_write(rt2x00dev, 8, rf->rf1);
- 	rt2800_rfcsr_write(rt2x00dev, 9, rf->rf3);
-@@ -3003,60 +3004,56 @@ static void rt2800_config_channel_rf53xx
- 
- 	rt2800_freq_cal_mode1(rt2x00dev);
- 
--	if (rf->channel <= 14) {
--		int idx = rf->channel-1;
-+	if (rt2x00_has_cap_bt_coexist(rt2x00dev)) {
-+		if (rt2x00_rt_rev_gte(rt2x00dev, RT5390, REV_RT5390F)) {
-+			/* r55/r59 value array of channel 1~14 */
-+			static const char r55_bt_rev[] = {0x83, 0x83,
-+				0x83, 0x73, 0x73, 0x63, 0x53, 0x53,
-+				0x53, 0x43, 0x43, 0x43, 0x43, 0x43};
-+			static const char r59_bt_rev[] = {0x0e, 0x0e,
-+				0x0e, 0x0e, 0x0e, 0x0b, 0x0a, 0x09,
-+				0x07, 0x07, 0x07, 0x07, 0x07, 0x07};
-+
-+			rt2800_rfcsr_write(rt2x00dev, 55,
-+					   r55_bt_rev[idx]);
-+			rt2800_rfcsr_write(rt2x00dev, 59,
-+					   r59_bt_rev[idx]);
-+		} else {
-+			static const char r59_bt[] = {0x8b, 0x8b, 0x8b,
-+				0x8b, 0x8b, 0x8b, 0x8b, 0x8a, 0x89,
-+				0x88, 0x88, 0x86, 0x85, 0x84};
- 
--		if (rt2x00_has_cap_bt_coexist(rt2x00dev)) {
--			if (rt2x00_rt_rev_gte(rt2x00dev, RT5390, REV_RT5390F)) {
--				/* r55/r59 value array of channel 1~14 */
--				static const char r55_bt_rev[] = {0x83, 0x83,
--					0x83, 0x73, 0x73, 0x63, 0x53, 0x53,
--					0x53, 0x43, 0x43, 0x43, 0x43, 0x43};
--				static const char r59_bt_rev[] = {0x0e, 0x0e,
--					0x0e, 0x0e, 0x0e, 0x0b, 0x0a, 0x09,
--					0x07, 0x07, 0x07, 0x07, 0x07, 0x07};
--
--				rt2800_rfcsr_write(rt2x00dev, 55,
--						   r55_bt_rev[idx]);
--				rt2800_rfcsr_write(rt2x00dev, 59,
--						   r59_bt_rev[idx]);
--			} else {
--				static const char r59_bt[] = {0x8b, 0x8b, 0x8b,
--					0x8b, 0x8b, 0x8b, 0x8b, 0x8a, 0x89,
--					0x88, 0x88, 0x86, 0x85, 0x84};
-+			rt2800_rfcsr_write(rt2x00dev, 59, r59_bt[idx]);
-+		}
-+	} else {
-+		if (rt2x00_rt_rev_gte(rt2x00dev, RT5390, REV_RT5390F)) {
-+			static const char r55_nonbt_rev[] = {0x23, 0x23,
-+				0x23, 0x23, 0x13, 0x13, 0x03, 0x03,
-+				0x03, 0x03, 0x03, 0x03, 0x03, 0x03};
-+			static const char r59_nonbt_rev[] = {0x07, 0x07,
-+				0x07, 0x07, 0x07, 0x07, 0x07, 0x07,
-+				0x07, 0x07, 0x06, 0x05, 0x04, 0x04};
-+
-+			rt2800_rfcsr_write(rt2x00dev, 55,
-+					   r55_nonbt_rev[idx]);
-+			rt2800_rfcsr_write(rt2x00dev, 59,
-+					   r59_nonbt_rev[idx]);
-+		} else if (rt2x00_rt(rt2x00dev, RT5390) ||
-+			   rt2x00_rt(rt2x00dev, RT5392) ||
-+			   rt2x00_rt(rt2x00dev, RT6352)) {
-+			static const char r59_non_bt[] = {0x8f, 0x8f,
-+				0x8f, 0x8f, 0x8f, 0x8f, 0x8f, 0x8d,
-+				0x8a, 0x88, 0x88, 0x87, 0x87, 0x86};
-+
-+			rt2800_rfcsr_write(rt2x00dev, 59,
-+					   r59_non_bt[idx]);
-+		} else if (rt2x00_rt(rt2x00dev, RT5350)) {
-+			static const char r59_non_bt[] = {0x0b, 0x0b,
-+				0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0a,
-+				0x0a, 0x09, 0x08, 0x07, 0x07, 0x06};
- 
--				rt2800_rfcsr_write(rt2x00dev, 59, r59_bt[idx]);
--			}
--		} else {
--			if (rt2x00_rt_rev_gte(rt2x00dev, RT5390, REV_RT5390F)) {
--				static const char r55_nonbt_rev[] = {0x23, 0x23,
--					0x23, 0x23, 0x13, 0x13, 0x03, 0x03,
--					0x03, 0x03, 0x03, 0x03, 0x03, 0x03};
--				static const char r59_nonbt_rev[] = {0x07, 0x07,
--					0x07, 0x07, 0x07, 0x07, 0x07, 0x07,
--					0x07, 0x07, 0x06, 0x05, 0x04, 0x04};
--
--				rt2800_rfcsr_write(rt2x00dev, 55,
--						   r55_nonbt_rev[idx]);
--				rt2800_rfcsr_write(rt2x00dev, 59,
--						   r59_nonbt_rev[idx]);
--			} else if (rt2x00_rt(rt2x00dev, RT5390) ||
--				   rt2x00_rt(rt2x00dev, RT5392) ||
--				   rt2x00_rt(rt2x00dev, RT6352)) {
--				static const char r59_non_bt[] = {0x8f, 0x8f,
--					0x8f, 0x8f, 0x8f, 0x8f, 0x8f, 0x8d,
--					0x8a, 0x88, 0x88, 0x87, 0x87, 0x86};
--
--				rt2800_rfcsr_write(rt2x00dev, 59,
--						   r59_non_bt[idx]);
--			} else if (rt2x00_rt(rt2x00dev, RT5350)) {
--				static const char r59_non_bt[] = {0x0b, 0x0b,
--					0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0a,
--					0x0a, 0x09, 0x08, 0x07, 0x07, 0x06};
--
--				rt2800_rfcsr_write(rt2x00dev, 59,
--						   r59_non_bt[idx]);
--			}
-+			rt2800_rfcsr_write(rt2x00dev, 59,
-+					   r59_non_bt[idx]);
- 		}
- 	}
- }
diff --git a/package/kernel/mac80211/patches/rt2x00/016-rt2x00-remove-confusing-AGC-register.patch b/package/kernel/mac80211/patches/rt2x00/016-rt2x00-remove-confusing-AGC-register.patch
deleted file mode 100644
index 8f3791d2ce..0000000000
--- a/package/kernel/mac80211/patches/rt2x00/016-rt2x00-remove-confusing-AGC-register.patch
+++ /dev/null
@@ -1,34 +0,0 @@
-From 5991a2ecd070ce5ef646b4e8e0bc8d99110604ed Mon Sep 17 00:00:00 2001
-From: =?UTF-8?q?Tomislav=20Po=C5=BEega?= <pozega.tomislav at gmail.com>
-Date: Wed, 13 Feb 2019 11:09:13 +0100
-Subject: [PATCH 16/28] rt2x00: remove confusing AGC register
-MIME-Version: 1.0
-Content-Type: text/plain; charset=UTF-8
-Content-Transfer-Encoding: 8bit
-
-Register 66 was causing issues on RT6352 if set to the same value as
-in MTK driver. With 1c reg value device was working fine in both HT20
-and HT40 modes.
-
-Signed-off-by: Tomislav Požega <pozega.tomislav at gmail.com>
-Signed-off-by: Stanislaw Gruszka <sgruszka at redhat.com>
-Signed-off-by: Kalle Valo <kvalo at codeaurora.org>
----
- drivers/net/wireless/ralink/rt2x00/rt2800lib.c | 6 +-----
- 1 file changed, 1 insertion(+), 5 deletions(-)
-
---- a/drivers/net/wireless/ralink/rt2x00/rt2800lib.c
-+++ b/drivers/net/wireless/ralink/rt2x00/rt2800lib.c
-@@ -3983,11 +3983,7 @@ static void rt2800_config_channel(struct
- 		rt2800_bbp_write(rt2x00dev, 196, reg);
- 
- 		/* AGC init */
--		if (rt2x00_rt(rt2x00dev, RT6352))
--			reg = 0x04;
--		else
--			reg = rf->channel <= 14 ? 0x1c : 0x24;
--
-+		reg = rf->channel <= 14 ? 0x1c : 0x24;
- 		reg += 2 * rt2x00dev->lna_gain;
- 		rt2800_bbp_write_with_rx_chain(rt2x00dev, 66, reg);
- 
diff --git a/package/kernel/mac80211/patches/rt2x00/017-rt2800-enable-TX_PIN_CFG_LNA_PE_-bits-per-band.patch b/package/kernel/mac80211/patches/rt2x00/017-rt2800-enable-TX_PIN_CFG_LNA_PE_-bits-per-band.patch
deleted file mode 100644
index eb82d6275b..0000000000
--- a/package/kernel/mac80211/patches/rt2x00/017-rt2800-enable-TX_PIN_CFG_LNA_PE_-bits-per-band.patch
+++ /dev/null
@@ -1,47 +0,0 @@
-From 9ad3b55654455258a9463384edb40077439d879f Mon Sep 17 00:00:00 2001
-From: Stanislaw Gruszka <sgruszka at redhat.com>
-Date: Wed, 13 Feb 2019 11:09:14 +0100
-Subject: [PATCH 17/28] rt2800: enable TX_PIN_CFG_LNA_PE_ bits per band
-
-Do not enable TX_PIN_CFG_LNA_PE_A* bits for 2.4GHz band and
-vice versa TX_PIN_CFG_LNA_PE_G* bits for 5GHz.
-
-Signed-off-by: Stanislaw Gruszka <sgruszka at redhat.com>
-Signed-off-by: Kalle Valo <kvalo at codeaurora.org>
----
- drivers/net/wireless/ralink/rt2x00/rt2800lib.c | 18 ++++++++++++------
- 1 file changed, 12 insertions(+), 6 deletions(-)
-
---- a/drivers/net/wireless/ralink/rt2x00/rt2800lib.c
-+++ b/drivers/net/wireless/ralink/rt2x00/rt2800lib.c
-@@ -3893,18 +3893,24 @@ static void rt2800_config_channel(struct
- 	switch (rt2x00dev->default_ant.rx_chain_num) {
- 	case 3:
- 		/* Turn on tertiary LNAs */
--		rt2x00_set_field32(&tx_pin, TX_PIN_CFG_LNA_PE_A2_EN, 1);
--		rt2x00_set_field32(&tx_pin, TX_PIN_CFG_LNA_PE_G2_EN, 1);
-+		rt2x00_set_field32(&tx_pin, TX_PIN_CFG_LNA_PE_A2_EN,
-+				   rf->channel > 14);
-+		rt2x00_set_field32(&tx_pin, TX_PIN_CFG_LNA_PE_G2_EN,
-+				   rf->channel <= 14);
- 		/* fall-through */
- 	case 2:
- 		/* Turn on secondary LNAs */
--		rt2x00_set_field32(&tx_pin, TX_PIN_CFG_LNA_PE_A1_EN, 1);
--		rt2x00_set_field32(&tx_pin, TX_PIN_CFG_LNA_PE_G1_EN, 1);
-+		rt2x00_set_field32(&tx_pin, TX_PIN_CFG_LNA_PE_A1_EN,
-+				   rf->channel > 14);
-+		rt2x00_set_field32(&tx_pin, TX_PIN_CFG_LNA_PE_G1_EN,
-+				   rf->channel <= 14);
- 		/* fall-through */
- 	case 1:
- 		/* Turn on primary LNAs */
--		rt2x00_set_field32(&tx_pin, TX_PIN_CFG_LNA_PE_A0_EN, 1);
--		rt2x00_set_field32(&tx_pin, TX_PIN_CFG_LNA_PE_G0_EN, 1);
-+		rt2x00_set_field32(&tx_pin, TX_PIN_CFG_LNA_PE_A0_EN,
-+				   rf->channel > 14);
-+		rt2x00_set_field32(&tx_pin, TX_PIN_CFG_LNA_PE_G0_EN,
-+				   rf->channel <= 14);
- 		break;
- 	}
- 
diff --git a/package/kernel/mac80211/patches/rt2x00/018-rt2800-enable-TX_PIN_CFG_RFRX_EN-only-for-MT7620.patch b/package/kernel/mac80211/patches/rt2x00/018-rt2800-enable-TX_PIN_CFG_RFRX_EN-only-for-MT7620.patch
deleted file mode 100644
index 3a4c2cd8e5..0000000000
--- a/package/kernel/mac80211/patches/rt2x00/018-rt2800-enable-TX_PIN_CFG_RFRX_EN-only-for-MT7620.patch
+++ /dev/null
@@ -1,41 +0,0 @@
-From 7aca14885edeab536a8cbe1e7cfeadd4c3310b9b Mon Sep 17 00:00:00 2001
-From: Stanislaw Gruszka <sgruszka at redhat.com>
-Date: Wed, 13 Feb 2019 11:09:15 +0100
-Subject: [PATCH 18/28] rt2800: enable TX_PIN_CFG_RFRX_EN only for MT7620
-
-The TX_PIN_CFG_RFRX_EN bit was not set on other devices than MT7620,
-restore old behavaviour since setting this bit maight not be
-correct for older devices.
-
-Fixes: 41977e86c984 ("rt2x00: add support for MT7620")
-Signed-off-by: Stanislaw Gruszka <sgruszka at redhat.com>
-Signed-off-by: Kalle Valo <kvalo at codeaurora.org>
----
- drivers/net/wireless/ralink/rt2x00/rt2800lib.c | 7 ++++---
- 1 file changed, 4 insertions(+), 3 deletions(-)
-
---- a/drivers/net/wireless/ralink/rt2x00/rt2800lib.c
-+++ b/drivers/net/wireless/ralink/rt2x00/rt2800lib.c
-@@ -3858,10 +3858,12 @@ static void rt2800_config_channel(struct
- 	if (rt2x00_rt(rt2x00dev, RT3572))
- 		rt2800_rfcsr_write(rt2x00dev, 8, 0);
- 
--	if (rt2x00_rt(rt2x00dev, RT6352))
-+	if (rt2x00_rt(rt2x00dev, RT6352)) {
- 		tx_pin = rt2800_register_read(rt2x00dev, TX_PIN_CFG);
--	else
-+		rt2x00_set_field32(&tx_pin, TX_PIN_CFG_RFRX_EN, 1);
-+	} else {
- 		tx_pin = 0;
-+	}
- 
- 	switch (rt2x00dev->default_ant.tx_chain_num) {
- 	case 3:
-@@ -3916,7 +3918,6 @@ static void rt2800_config_channel(struct
- 
- 	rt2x00_set_field32(&tx_pin, TX_PIN_CFG_RFTR_EN, 1);
- 	rt2x00_set_field32(&tx_pin, TX_PIN_CFG_TRSW_EN, 1);
--	rt2x00_set_field32(&tx_pin, TX_PIN_CFG_RFRX_EN, 1); /* mt7620 */
- 
- 	rt2800_register_write(rt2x00dev, TX_PIN_CFG, tx_pin);
- 
diff --git a/package/kernel/mac80211/patches/rt2x00/019-rt2800-comment-and-simplify-AGC-init-for-RT6352.patch b/package/kernel/mac80211/patches/rt2x00/019-rt2800-comment-and-simplify-AGC-init-for-RT6352.patch
deleted file mode 100644
index 4d0beb263d..0000000000
--- a/package/kernel/mac80211/patches/rt2x00/019-rt2800-comment-and-simplify-AGC-init-for-RT6352.patch
+++ /dev/null
@@ -1,33 +0,0 @@
-From c7ff1bfeaf1ca69e3e401be211b55d1738d0c5fc Mon Sep 17 00:00:00 2001
-From: Stanislaw Gruszka <sgruszka at redhat.com>
-Date: Wed, 13 Feb 2019 11:09:16 +0100
-Subject: [PATCH 19/28] rt2800: comment and simplify AGC init for RT6352
-
-We do not need separate lines for calculating register values.
-Also add comment that value is different than in vendor driver.
-
-Suggested-by: Daniel Golle <daniel at makrotopia.org>
-Signed-off-by: Stanislaw Gruszka <sgruszka at redhat.com>
-Signed-off-by: Kalle Valo <kvalo at codeaurora.org>
----
- drivers/net/wireless/ralink/rt2x00/rt2800lib.c | 9 ++++++---
- 1 file changed, 6 insertions(+), 3 deletions(-)
-
---- a/drivers/net/wireless/ralink/rt2x00/rt2800lib.c
-+++ b/drivers/net/wireless/ralink/rt2x00/rt2800lib.c
-@@ -3989,9 +3989,12 @@ static void rt2800_config_channel(struct
- 		rt2800_bbp_write(rt2x00dev, 195, 141);
- 		rt2800_bbp_write(rt2x00dev, 196, reg);
- 
--		/* AGC init */
--		reg = rf->channel <= 14 ? 0x1c : 0x24;
--		reg += 2 * rt2x00dev->lna_gain;
-+		/* AGC init.
-+		 * Despite the vendor driver using different values here for
-+		 * RT6352 chip, we use 0x1c for now. This may have to be changed
-+		 * once TSSI got implemented.
-+		 */
-+		reg = (rf->channel <= 14 ? 0x1c : 0x24) + 2*rt2x00dev->lna_gain;
- 		rt2800_bbp_write_with_rx_chain(rt2x00dev, 66, reg);
- 
- 		rt2800_iq_calibrate(rt2x00dev, rf->channel);
diff --git a/package/kernel/mac80211/patches/rt2x00/020-cfg80211-add-ratelimited-variants-of-err-and-warn.patch b/package/kernel/mac80211/patches/rt2x00/020-cfg80211-add-ratelimited-variants-of-err-and-warn.patch
deleted file mode 100644
index bea1884489..0000000000
--- a/package/kernel/mac80211/patches/rt2x00/020-cfg80211-add-ratelimited-variants-of-err-and-warn.patch
+++ /dev/null
@@ -1,39 +0,0 @@
-From patchwork Tue Mar 12 09:51:40 2019
-Content-Type: text/plain; charset="utf-8"
-MIME-Version: 1.0
-Content-Transfer-Encoding: 7bit
-X-Patchwork-Submitter: Stanislaw Gruszka <sgruszka at redhat.com>
-X-Patchwork-Id: 10848957
-X-Patchwork-Delegate: johannes at sipsolutions.net
-From: Stanislaw Gruszka <sgruszka at redhat.com>
-To: linux-wireless at vger.kernel.org
-Cc: =?utf-8?q?Tomislav_Po=C5=BEega?= <pozega.tomislav at gmail.com>,
- Daniel Golle <daniel at makrotopia.org>, Felix Fietkau <nbd at nbd.name>,
- Mathias Kresin <dev at kresin.me>
-Subject: [PATCH v3 1/4] cfg80211: add ratelimited variants of err and warn
-Date: Tue, 12 Mar 2019 10:51:40 +0100
-Message-Id: <1552384303-29529-2-git-send-email-sgruszka at redhat.com>
-In-Reply-To: <1552384303-29529-1-git-send-email-sgruszka at redhat.com>
-References: <1552384303-29529-1-git-send-email-sgruszka at redhat.com>
-
-wiphy_{err,warn}_ratelimited will be used by rt2x00
-
-Signed-off-by: Stanislaw Gruszka <sgruszka at redhat.com>
----
- include/net/cfg80211.h | 5 +++++
- 1 file changed, 5 insertions(+)
-
---- a/include/net/cfg80211.h
-+++ b/include/net/cfg80211.h
-@@ -6597,6 +6597,11 @@ int cfg80211_external_auth_request(struc
- #define wiphy_info(wiphy, format, args...)			\
- 	dev_info(&(wiphy)->dev, format, ##args)
- 
-+#define wiphy_err_ratelimited(wiphy, format, args...)		\
-+	dev_err_ratelimited(&(wiphy)->dev, format, ##args)
-+#define wiphy_warn_ratelimited(wiphy, format, args...)		\
-+	dev_warn_ratelimited(&(wiphy)->dev, format, ##args)
-+
- #define wiphy_debug(wiphy, format, args...)			\
- 	wiphy_printk(KERN_DEBUG, wiphy, format, ##args)
- 
diff --git a/package/kernel/mac80211/patches/rt2x00/021-rt2x00-use-ratelimited-variants-dev_warn-dev_err.patch b/package/kernel/mac80211/patches/rt2x00/021-rt2x00-use-ratelimited-variants-dev_warn-dev_err.patch
deleted file mode 100644
index 2d74a71e1f..0000000000
--- a/package/kernel/mac80211/patches/rt2x00/021-rt2x00-use-ratelimited-variants-dev_warn-dev_err.patch
+++ /dev/null
@@ -1,42 +0,0 @@
-From patchwork Tue Mar 12 09:51:41 2019
-Content-Type: text/plain; charset="utf-8"
-MIME-Version: 1.0
-Content-Transfer-Encoding: 7bit
-X-Patchwork-Submitter: Stanislaw Gruszka <sgruszka at redhat.com>
-X-Patchwork-Id: 10848959
-X-Patchwork-Delegate: kvalo at adurom.com
-From: Stanislaw Gruszka <sgruszka at redhat.com>
-To: linux-wireless at vger.kernel.org
-Cc: =?utf-8?q?Tomislav_Po=C5=BEega?= <pozega.tomislav at gmail.com>,
- Daniel Golle <daniel at makrotopia.org>, Felix Fietkau <nbd at nbd.name>,
- Mathias Kresin <dev at kresin.me>
-Subject: [PATCH v3 2/4] rt2x00: use ratelimited variants dev_warn/dev_err
-Date: Tue, 12 Mar 2019 10:51:41 +0100
-Message-Id: <1552384303-29529-3-git-send-email-sgruszka at redhat.com>
-In-Reply-To: <1552384303-29529-1-git-send-email-sgruszka at redhat.com>
-References: <1552384303-29529-1-git-send-email-sgruszka at redhat.com>
-
-As reported by Randy we can overwhelm logs on some USB error conditions.
-To avoid that use dev_warn_ratelimited() and dev_err_ratelimitd().
-
-Reported-and-tested-by: Randy Oostdyk <linux-kernel at oostdyk.com>
-Signed-off-by: Stanislaw Gruszka <sgruszka at redhat.com>
----
- drivers/net/wireless/ralink/rt2x00/rt2x00.h | 4 ++--
- 1 file changed, 2 insertions(+), 2 deletions(-)
-
---- a/drivers/net/wireless/ralink/rt2x00/rt2x00.h
-+++ b/drivers/net/wireless/ralink/rt2x00/rt2x00.h
-@@ -69,10 +69,10 @@
- 	printk(KERN_ERR KBUILD_MODNAME ": %s: Error - " fmt,		\
- 	       __func__, ##__VA_ARGS__)
- #define rt2x00_err(dev, fmt, ...)					\
--	wiphy_err((dev)->hw->wiphy, "%s: Error - " fmt,			\
-+	wiphy_err_ratelimited((dev)->hw->wiphy, "%s: Error - " fmt,	\
- 		  __func__, ##__VA_ARGS__)
- #define rt2x00_warn(dev, fmt, ...)					\
--	wiphy_warn((dev)->hw->wiphy, "%s: Warning - " fmt,		\
-+	wiphy_warn_ratelimited((dev)->hw->wiphy, "%s: Warning - " fmt,	\
- 		   __func__, ##__VA_ARGS__)
- #define rt2x00_info(dev, fmt, ...)					\
- 	wiphy_info((dev)->hw->wiphy, "%s: Info - " fmt,			\
diff --git a/package/kernel/mac80211/patches/rt2x00/022-rt2x00-check-number-of-EPROTO-errors.patch b/package/kernel/mac80211/patches/rt2x00/022-rt2x00-check-number-of-EPROTO-errors.patch
deleted file mode 100644
index 251ac287bf..0000000000
--- a/package/kernel/mac80211/patches/rt2x00/022-rt2x00-check-number-of-EPROTO-errors.patch
+++ /dev/null
@@ -1,96 +0,0 @@
-From patchwork Tue Mar 12 09:51:42 2019
-Content-Type: text/plain; charset="utf-8"
-MIME-Version: 1.0
-Content-Transfer-Encoding: 7bit
-X-Patchwork-Submitter: Stanislaw Gruszka <sgruszka at redhat.com>
-X-Patchwork-Id: 10848961
-X-Patchwork-Delegate: kvalo at adurom.com
-From: Stanislaw Gruszka <sgruszka at redhat.com>
-To: linux-wireless at vger.kernel.org
-Cc: =?utf-8?q?Tomislav_Po=C5=BEega?= <pozega.tomislav at gmail.com>,
- Daniel Golle <daniel at makrotopia.org>, Felix Fietkau <nbd at nbd.name>,
- Mathias Kresin <dev at kresin.me>
-Subject: [PATCH v3 3/4] rt2x00: check number of EPROTO errors
-Date: Tue, 12 Mar 2019 10:51:42 +0100
-Message-Id: <1552384303-29529-4-git-send-email-sgruszka at redhat.com>
-In-Reply-To: <1552384303-29529-1-git-send-email-sgruszka at redhat.com>
-References: <1552384303-29529-1-git-send-email-sgruszka at redhat.com>
-
-Some USB host devices/drivers on some conditions can always return
-EPROTO error on submitted URBs. That can cause infinity loop in the
-rt2x00 driver.
-
-Since we can have single EPROTO errors we can not mark as device as
-removed to avoid infinity loop. However we can count consecutive
-EPROTO errors and mark device as removed if get lot of it.
-I choose number 10 as threshold.
-
-Reported-and-tested-by: Randy Oostdyk <linux-kernel at oostdyk.com>
-Signed-off-by: Stanislaw Gruszka <sgruszka at redhat.com>
----
- drivers/net/wireless/ralink/rt2x00/rt2x00.h    |  1 +
- drivers/net/wireless/ralink/rt2x00/rt2x00usb.c | 22 +++++++++++++++++++---
- 2 files changed, 20 insertions(+), 3 deletions(-)
-
---- a/drivers/net/wireless/ralink/rt2x00/rt2x00.h
-+++ b/drivers/net/wireless/ralink/rt2x00/rt2x00.h
-@@ -1017,6 +1017,7 @@ struct rt2x00_dev {
- 	unsigned int extra_tx_headroom;
- 
- 	struct usb_anchor *anchor;
-+	unsigned int num_proto_errs;
- 
- 	/* Clock for System On Chip devices. */
- 	struct clk *clk;
---- a/drivers/net/wireless/ralink/rt2x00/rt2x00usb.c
-+++ b/drivers/net/wireless/ralink/rt2x00/rt2x00usb.c
-@@ -31,6 +31,22 @@
- #include "rt2x00.h"
- #include "rt2x00usb.h"
- 
-+static bool rt2x00usb_check_usb_error(struct rt2x00_dev *rt2x00dev, int status)
-+{
-+	if (status == -ENODEV || status == -ENOENT)
-+		return true;
-+
-+	if (status == -EPROTO || status == -ETIMEDOUT)
-+		rt2x00dev->num_proto_errs++;
-+	else
-+		rt2x00dev->num_proto_errs = 0;
-+
-+	if (rt2x00dev->num_proto_errs > 3)
-+		return true;
-+
-+	return false;
-+}
-+
- /*
-  * Interfacing with the HW.
-  */
-@@ -57,7 +73,7 @@ int rt2x00usb_vendor_request(struct rt2x
- 		if (status >= 0)
- 			return 0;
- 
--		if (status == -ENODEV || status == -ENOENT) {
-+		if (rt2x00usb_check_usb_error(rt2x00dev, status)) {
- 			/* Device has disappeared. */
- 			clear_bit(DEVICE_STATE_PRESENT, &rt2x00dev->flags);
- 			break;
-@@ -321,7 +337,7 @@ static bool rt2x00usb_kick_tx_entry(stru
- 
- 	status = usb_submit_urb(entry_priv->urb, GFP_ATOMIC);
- 	if (status) {
--		if (status == -ENODEV || status == -ENOENT)
-+		if (rt2x00usb_check_usb_error(rt2x00dev, status))
- 			clear_bit(DEVICE_STATE_PRESENT, &rt2x00dev->flags);
- 		set_bit(ENTRY_DATA_IO_FAILED, &entry->flags);
- 		rt2x00lib_dmadone(entry);
-@@ -410,7 +426,7 @@ static bool rt2x00usb_kick_rx_entry(stru
- 
- 	status = usb_submit_urb(entry_priv->urb, GFP_ATOMIC);
- 	if (status) {
--		if (status == -ENODEV || status == -ENOENT)
-+		if (rt2x00usb_check_usb_error(rt2x00dev, status))
- 			clear_bit(DEVICE_STATE_PRESENT, &rt2x00dev->flags);
- 		set_bit(ENTRY_DATA_IO_FAILED, &entry->flags);
- 		rt2x00lib_dmadone(entry);
diff --git a/package/kernel/mac80211/patches/rt2x00/023-rt2x00-do-not-print-error-when-queue-is-full.patch b/package/kernel/mac80211/patches/rt2x00/023-rt2x00-do-not-print-error-when-queue-is-full.patch
deleted file mode 100644
index 7e2f2193be..0000000000
--- a/package/kernel/mac80211/patches/rt2x00/023-rt2x00-do-not-print-error-when-queue-is-full.patch
+++ /dev/null
@@ -1,43 +0,0 @@
-From patchwork Tue Mar 12 09:51:43 2019
-Content-Type: text/plain; charset="utf-8"
-MIME-Version: 1.0
-Content-Transfer-Encoding: 7bit
-X-Patchwork-Submitter: Stanislaw Gruszka <sgruszka at redhat.com>
-X-Patchwork-Id: 10848963
-X-Patchwork-Delegate: kvalo at adurom.com
-From: Stanislaw Gruszka <sgruszka at redhat.com>
-To: linux-wireless at vger.kernel.org
-Cc: =?utf-8?q?Tomislav_Po=C5=BEega?= <pozega.tomislav at gmail.com>,
- Daniel Golle <daniel at makrotopia.org>, Felix Fietkau <nbd at nbd.name>,
- Mathias Kresin <dev at kresin.me>
-Subject: [PATCH v3 4/4] rt2x00: do not print error when queue is full
-Date: Tue, 12 Mar 2019 10:51:43 +0100
-Message-Id: <1552384303-29529-5-git-send-email-sgruszka at redhat.com>
-In-Reply-To: <1552384303-29529-1-git-send-email-sgruszka at redhat.com>
-References: <1552384303-29529-1-git-send-email-sgruszka at redhat.com>
-
-For unknown reasons printk() on some context can cause CPU hung on
-embedded MT7620 AP/router MIPS platforms. What can result on wifi
-disconnects.
-
-This patch move queue full messages to debug level what is consistent
-with other mac80211 drivers which drop packet silently if tx queue is
-full. This make MT7620 OpenWRT routers more stable, what was reported
-by various users.
-
-Signed-off-by: Stanislaw Gruszka <sgruszka at redhat.com>
----
- drivers/net/wireless/ralink/rt2x00/rt2x00queue.c | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
---- a/drivers/net/wireless/ralink/rt2x00/rt2x00queue.c
-+++ b/drivers/net/wireless/ralink/rt2x00/rt2x00queue.c
-@@ -671,7 +671,7 @@ int rt2x00queue_write_tx_frame(struct da
- 	spin_lock(&queue->tx_lock);
- 
- 	if (unlikely(rt2x00queue_full(queue))) {
--		rt2x00_err(queue->rt2x00dev, "Dropping frame due to full tx queue %d\n",
-+		rt2x00_dbg(queue->rt2x00dev, "Dropping frame due to full tx queue %d\n",
- 			   queue->qid);
- 		ret = -ENOBUFS;
- 		goto out;
diff --git a/package/kernel/mac80211/patches/rt2x00/024-rt2800-partially-restore-old-mmio-txstatus-behaviour.patch b/package/kernel/mac80211/patches/rt2x00/024-rt2800-partially-restore-old-mmio-txstatus-behaviour.patch
deleted file mode 100644
index 52314a79ae..0000000000
--- a/package/kernel/mac80211/patches/rt2x00/024-rt2800-partially-restore-old-mmio-txstatus-behaviour.patch
+++ /dev/null
@@ -1,128 +0,0 @@
-From 91a5340db0526b7263bc8da14b120ea3129b5f28 Mon Sep 17 00:00:00 2001
-From: Stanislaw Gruszka <sgruszka at redhat.com>
-Date: Sat, 9 Feb 2019 12:08:31 +0100
-X-Patchwork-Submitter: Stanislaw Gruszka <sgruszka at redhat.com>
-X-Patchwork-Id: 10804437
-X-Patchwork-Delegate: kvalo at adurom.com
-Subject: [PATCH 21/28] rt2800: partially restore old mmio txstatus behaviour
-
-Do not disable txstatus interrupt and add quota of processed tx statuses in
-one tasklet. Quota is needed to allow to fed device with new frames during
-processing of tx statuses.
-
-Patch fixes about 15% performance degradation on some scenarios coused by
-0b0d556e0ebb ("rt2800mmio: use txdone/txstatus routines from lib").
-
-Signed-off-by: Stanislaw Gruszka <sgruszka at redhat.com>
----
- .../net/wireless/ralink/rt2x00/rt2800lib.c    |  4 +--
- .../net/wireless/ralink/rt2x00/rt2800lib.h    |  2 +-
- .../net/wireless/ralink/rt2x00/rt2800mmio.c   | 30 +++++--------------
- .../net/wireless/ralink/rt2x00/rt2800usb.c    |  2 +-
- 4 files changed, 12 insertions(+), 26 deletions(-)
-
---- a/drivers/net/wireless/ralink/rt2x00/rt2800lib.c
-+++ b/drivers/net/wireless/ralink/rt2x00/rt2800lib.c
-@@ -1100,7 +1100,7 @@ void rt2800_txdone_entry(struct queue_en
- }
- EXPORT_SYMBOL_GPL(rt2800_txdone_entry);
- 
--void rt2800_txdone(struct rt2x00_dev *rt2x00dev)
-+void rt2800_txdone(struct rt2x00_dev *rt2x00dev, unsigned int quota)
- {
- 	struct data_queue *queue;
- 	struct queue_entry *entry;
-@@ -1108,7 +1108,7 @@ void rt2800_txdone(struct rt2x00_dev *rt
- 	u8 qid;
- 	bool match;
- 
--	while (kfifo_get(&rt2x00dev->txstatus_fifo, &reg)) {
-+	while (quota-- > 0 && kfifo_get(&rt2x00dev->txstatus_fifo, &reg)) {
- 		/*
- 		 * TX_STA_FIFO_PID_QUEUE is a 2-bit field, thus qid is
- 		 * guaranteed to be one of the TX QIDs .
---- a/drivers/net/wireless/ralink/rt2x00/rt2800lib.h
-+++ b/drivers/net/wireless/ralink/rt2x00/rt2800lib.h
-@@ -195,7 +195,7 @@ void rt2800_process_rxwi(struct queue_en
- 
- void rt2800_txdone_entry(struct queue_entry *entry, u32 status, __le32 *txwi,
- 			 bool match);
--void rt2800_txdone(struct rt2x00_dev *rt2x00dev);
-+void rt2800_txdone(struct rt2x00_dev *rt2x00dev, unsigned int quota);
- void rt2800_txdone_nostatus(struct rt2x00_dev *rt2x00dev);
- bool rt2800_txstatus_timeout(struct rt2x00_dev *rt2x00dev);
- 
---- a/drivers/net/wireless/ralink/rt2x00/rt2800mmio.c
-+++ b/drivers/net/wireless/ralink/rt2x00/rt2800mmio.c
-@@ -255,20 +255,6 @@ void rt2800mmio_autowake_tasklet(unsigne
- }
- EXPORT_SYMBOL_GPL(rt2800mmio_autowake_tasklet);
- 
--static void rt2800mmio_txdone(struct rt2x00_dev *rt2x00dev)
--{
--	bool timeout = false;
--
--	while (!kfifo_is_empty(&rt2x00dev->txstatus_fifo) ||
--	       (timeout = rt2800_txstatus_timeout(rt2x00dev))) {
--
--		rt2800_txdone(rt2x00dev);
--
--		if (timeout)
--			rt2800_txdone_nostatus(rt2x00dev);
--	}
--}
--
- static bool rt2800mmio_fetch_txstatus(struct rt2x00_dev *rt2x00dev)
- {
- 	u32 status;
-@@ -305,14 +291,11 @@ void rt2800mmio_txstatus_tasklet(unsigne
- {
- 	struct rt2x00_dev *rt2x00dev = (struct rt2x00_dev *)data;
- 
--	do {
--		rt2800mmio_txdone(rt2x00dev);
-+	rt2800_txdone(rt2x00dev, 16);
- 
--	} while (rt2800mmio_fetch_txstatus(rt2x00dev));
-+	if (!kfifo_is_empty(&rt2x00dev->txstatus_fifo))
-+		tasklet_schedule(&rt2x00dev->txstatus_tasklet);
- 
--	if (test_bit(DEVICE_STATE_ENABLED_RADIO, &rt2x00dev->flags))
--		rt2800mmio_enable_interrupt(rt2x00dev,
--					    INT_SOURCE_CSR_TX_FIFO_STATUS);
- }
- EXPORT_SYMBOL_GPL(rt2800mmio_txstatus_tasklet);
- 
-@@ -339,8 +322,10 @@ irqreturn_t rt2800mmio_interrupt(int irq
- 	mask = ~reg;
- 
- 	if (rt2x00_get_field32(reg, INT_SOURCE_CSR_TX_FIFO_STATUS)) {
-+		rt2x00_set_field32(&mask, INT_MASK_CSR_TX_FIFO_STATUS, 1);
- 		rt2800mmio_fetch_txstatus(rt2x00dev);
--		tasklet_schedule(&rt2x00dev->txstatus_tasklet);
-+		if (!kfifo_is_empty(&rt2x00dev->txstatus_fifo))
-+			tasklet_schedule(&rt2x00dev->txstatus_tasklet);
- 	}
- 
- 	if (rt2x00_get_field32(reg, INT_SOURCE_CSR_PRE_TBTT))
-@@ -500,7 +485,8 @@ void rt2800mmio_flush_queue(struct data_
- 		 */
- 		if (tx_queue) {
- 			tasklet_disable(&rt2x00dev->txstatus_tasklet);
--			rt2800mmio_txdone(rt2x00dev);
-+			rt2800_txdone(rt2x00dev, UINT_MAX);
-+			rt2800_txdone_nostatus(rt2x00dev);
- 			tasklet_enable(&rt2x00dev->txstatus_tasklet);
- 		}
- 
---- a/drivers/net/wireless/ralink/rt2x00/rt2800usb.c
-+++ b/drivers/net/wireless/ralink/rt2x00/rt2800usb.c
-@@ -480,7 +480,7 @@ static void rt2800usb_work_txdone(struct
- 	while (!kfifo_is_empty(&rt2x00dev->txstatus_fifo) ||
- 	       rt2800_txstatus_timeout(rt2x00dev)) {
- 
--		rt2800_txdone(rt2x00dev);
-+		rt2800_txdone(rt2x00dev, UINT_MAX);
- 
- 		rt2800_txdone_nostatus(rt2x00dev);
- 
diff --git a/package/kernel/mac80211/patches/rt2x00/025-rt2800-new-flush-implementation-for-SoC-devices.patch b/package/kernel/mac80211/patches/rt2x00/025-rt2800-new-flush-implementation-for-SoC-devices.patch
deleted file mode 100644
index e3a914a0fa..0000000000
--- a/package/kernel/mac80211/patches/rt2x00/025-rt2800-new-flush-implementation-for-SoC-devices.patch
+++ /dev/null
@@ -1,27 +0,0 @@
-From 11f8ad1656035176bad9d89de7ea0e7fe6d82c32 Mon Sep 17 00:00:00 2001
-From: Stanislaw Gruszka <sgruszka at redhat.com>
-Date: Sat, 9 Feb 2019 12:08:32 +0100
-X-Patchwork-Submitter: Stanislaw Gruszka <sgruszka at redhat.com>
-X-Patchwork-Id: 10804439
-X-Patchwork-Delegate: kvalo at adurom.com
-Subject: [PATCH 22/28] rt2800: new flush implementation for SoC devices
-
-Use new flush_queue() calback for SoC devices, what was already done for
-PCIe devices.
-
-Signed-off-by: Stanislaw Gruszka <sgruszka at redhat.com>
----
- drivers/net/wireless/ralink/rt2x00/rt2800soc.c | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
---- a/drivers/net/wireless/ralink/rt2x00/rt2800soc.c
-+++ b/drivers/net/wireless/ralink/rt2x00/rt2800soc.c
-@@ -203,7 +203,7 @@ static const struct rt2x00lib_ops rt2800
- 	.start_queue		= rt2800mmio_start_queue,
- 	.kick_queue		= rt2800mmio_kick_queue,
- 	.stop_queue		= rt2800mmio_stop_queue,
--	.flush_queue		= rt2x00mmio_flush_queue,
-+	.flush_queue		= rt2800mmio_flush_queue,
- 	.write_tx_desc		= rt2800mmio_write_tx_desc,
- 	.write_tx_data		= rt2800_write_tx_data,
- 	.write_beacon		= rt2800_write_beacon,
diff --git a/package/kernel/mac80211/patches/rt2x00/026-rt2800-move-txstatus-pending-routine.patch b/package/kernel/mac80211/patches/rt2x00/026-rt2800-move-txstatus-pending-routine.patch
deleted file mode 100644
index e5bfbecd1e..0000000000
--- a/package/kernel/mac80211/patches/rt2x00/026-rt2800-move-txstatus-pending-routine.patch
+++ /dev/null
@@ -1,106 +0,0 @@
-From 2bbea7645c3d095014a080db170941818650e141 Mon Sep 17 00:00:00 2001
-From: Stanislaw Gruszka <sgruszka at redhat.com>
-Date: Sat, 9 Feb 2019 12:08:33 +0100
-X-Patchwork-Submitter: Stanislaw Gruszka <sgruszka at redhat.com>
-X-Patchwork-Id: 10804441
-X-Patchwork-Delegate: kvalo at adurom.com
-Subject: [PATCH 23/28] rt2800: move txstatus pending routine
-
-Move rt2800usb_txstatus_pending routine to rt2800lib. It will be reused
-by rt2800mmio code.
-
-Signed-off-by: Stanislaw Gruszka <sgruszka at redhat.com>
----
- .../net/wireless/ralink/rt2x00/rt2800lib.c    | 17 ++++++++++++++
- .../net/wireless/ralink/rt2x00/rt2800lib.h    |  1 +
- .../net/wireless/ralink/rt2x00/rt2800usb.c    | 22 +++----------------
- 3 files changed, 21 insertions(+), 19 deletions(-)
-
---- a/drivers/net/wireless/ralink/rt2x00/rt2800lib.c
-+++ b/drivers/net/wireless/ralink/rt2x00/rt2800lib.c
-@@ -1183,6 +1183,23 @@ bool rt2800_txstatus_timeout(struct rt2x
- }
- EXPORT_SYMBOL_GPL(rt2800_txstatus_timeout);
- 
-+/*
-+ * test if there is an entry in any TX queue for which DMA is done
-+ * but the TX status has not been returned yet
-+ */
-+bool rt2800_txstatus_pending(struct rt2x00_dev *rt2x00dev)
-+{
-+	struct data_queue *queue;
-+
-+	tx_queue_for_each(rt2x00dev, queue) {
-+		if (rt2x00queue_get_entry(queue, Q_INDEX_DMA_DONE) !=
-+		    rt2x00queue_get_entry(queue, Q_INDEX_DONE))
-+			return true;
-+	}
-+	return false;
-+}
-+EXPORT_SYMBOL_GPL(rt2800_txstatus_pending);
-+
- void rt2800_txdone_nostatus(struct rt2x00_dev *rt2x00dev)
- {
- 	struct data_queue *queue;
---- a/drivers/net/wireless/ralink/rt2x00/rt2800lib.h
-+++ b/drivers/net/wireless/ralink/rt2x00/rt2800lib.h
-@@ -198,6 +198,7 @@ void rt2800_txdone_entry(struct queue_en
- void rt2800_txdone(struct rt2x00_dev *rt2x00dev, unsigned int quota);
- void rt2800_txdone_nostatus(struct rt2x00_dev *rt2x00dev);
- bool rt2800_txstatus_timeout(struct rt2x00_dev *rt2x00dev);
-+bool rt2800_txstatus_pending(struct rt2x00_dev *rt2x00dev);
- 
- void rt2800_write_beacon(struct queue_entry *entry, struct txentry_desc *txdesc);
- void rt2800_clear_beacon(struct queue_entry *entry);
---- a/drivers/net/wireless/ralink/rt2x00/rt2800usb.c
-+++ b/drivers/net/wireless/ralink/rt2x00/rt2800usb.c
-@@ -100,22 +100,6 @@ static void rt2800usb_stop_queue(struct
- 	}
- }
- 
--/*
-- * test if there is an entry in any TX queue for which DMA is done
-- * but the TX status has not been returned yet
-- */
--static bool rt2800usb_txstatus_pending(struct rt2x00_dev *rt2x00dev)
--{
--	struct data_queue *queue;
--
--	tx_queue_for_each(rt2x00dev, queue) {
--		if (rt2x00queue_get_entry(queue, Q_INDEX_DMA_DONE) !=
--		    rt2x00queue_get_entry(queue, Q_INDEX_DONE))
--			return true;
--	}
--	return false;
--}
--
- #define TXSTATUS_READ_INTERVAL 1000000
- 
- static bool rt2800usb_tx_sta_fifo_read_completed(struct rt2x00_dev *rt2x00dev,
-@@ -145,7 +129,7 @@ static bool rt2800usb_tx_sta_fifo_read_c
- 	if (rt2800_txstatus_timeout(rt2x00dev))
- 		queue_work(rt2x00dev->workqueue, &rt2x00dev->txdone_work);
- 
--	if (rt2800usb_txstatus_pending(rt2x00dev)) {
-+	if (rt2800_txstatus_pending(rt2x00dev)) {
- 		/* Read register after 1 ms */
- 		hrtimer_start(&rt2x00dev->txstatus_timer,
- 			      TXSTATUS_READ_INTERVAL,
-@@ -160,7 +144,7 @@ stop_reading:
- 	 * clear_bit someone could do rt2x00usb_interrupt_txdone, so recheck
- 	 * here again if status reading is needed.
- 	 */
--	if (rt2800usb_txstatus_pending(rt2x00dev) &&
-+	if (rt2800_txstatus_pending(rt2x00dev) &&
- 	    !test_and_set_bit(TX_STATUS_READING, &rt2x00dev->flags))
- 		return true;
- 	else
-@@ -489,7 +473,7 @@ static void rt2800usb_work_txdone(struct
- 		 * if the medium is busy, thus the TX_STA_FIFO entry is
- 		 * also delayed -> use a timer to retrieve it.
- 		 */
--		if (rt2800usb_txstatus_pending(rt2x00dev))
-+		if (rt2800_txstatus_pending(rt2x00dev))
- 			rt2800usb_async_read_tx_status(rt2x00dev);
- 	}
- }
diff --git a/package/kernel/mac80211/patches/rt2x00/027-rt2800mmio-fetch-tx-status-changes.patch b/package/kernel/mac80211/patches/rt2x00/027-rt2800mmio-fetch-tx-status-changes.patch
deleted file mode 100644
index 4bb62c2288..0000000000
--- a/package/kernel/mac80211/patches/rt2x00/027-rt2800mmio-fetch-tx-status-changes.patch
+++ /dev/null
@@ -1,61 +0,0 @@
-From f6a9618198e190a2ba09ce3f0aa8e9ee1763bd38 Mon Sep 17 00:00:00 2001
-From: Stanislaw Gruszka <sgruszka at redhat.com>
-Date: Sat, 9 Feb 2019 12:08:34 +0100
-X-Patchwork-Submitter: Stanislaw Gruszka <sgruszka at redhat.com>
-X-Patchwork-Id: 10804443
-X-Patchwork-Delegate: kvalo at adurom.com
-Subject: [PATCH 24/28] rt2800mmio: fetch tx status changes
-
-Prepare to use rt2800mmio_fetch_txstatus() in concurrent manner and drop
-return value since is not longer needed.
-
-Signed-off-by: Stanislaw Gruszka <sgruszka at redhat.com>
----
- drivers/net/wireless/ralink/rt2x00/rt2800mmio.c | 17 +++++++++--------
- 1 file changed, 9 insertions(+), 8 deletions(-)
-
---- a/drivers/net/wireless/ralink/rt2x00/rt2800mmio.c
-+++ b/drivers/net/wireless/ralink/rt2x00/rt2800mmio.c
-@@ -255,12 +255,12 @@ void rt2800mmio_autowake_tasklet(unsigne
- }
- EXPORT_SYMBOL_GPL(rt2800mmio_autowake_tasklet);
- 
--static bool rt2800mmio_fetch_txstatus(struct rt2x00_dev *rt2x00dev)
-+static void rt2800mmio_fetch_txstatus(struct rt2x00_dev *rt2x00dev)
- {
- 	u32 status;
--	bool more = false;
-+	unsigned long flags;
- 
--	/* FIXEME: rewrite this comment
-+	/*
- 	 * The TX_FIFO_STATUS interrupt needs special care. We should
- 	 * read TX_STA_FIFO but we should do it immediately as otherwise
- 	 * the register can overflow and we would lose status reports.
-@@ -271,20 +271,21 @@ static bool rt2800mmio_fetch_txstatus(st
- 	 * because we can schedule the tasklet multiple times (when the
- 	 * interrupt fires again during tx status processing).
- 	 *
--	 * txstatus tasklet is called with INT_SOURCE_CSR_TX_FIFO_STATUS
--	 * disabled so have only one producer and one consumer - we don't
--	 * need to lock the kfifo.
-+	 * We also read statuses from tx status timeout timer, use
-+	 * lock to prevent concurent writes to fifo.
- 	 */
-+
-+	spin_lock_irqsave(&rt2x00dev->irqmask_lock, flags);
-+
- 	while (!kfifo_is_full(&rt2x00dev->txstatus_fifo)) {
- 		status = rt2x00mmio_register_read(rt2x00dev, TX_STA_FIFO);
- 		if (!rt2x00_get_field32(status, TX_STA_FIFO_VALID))
- 			break;
- 
- 		kfifo_put(&rt2x00dev->txstatus_fifo, status);
--		more = true;
- 	}
- 
--	return more;
-+	spin_unlock_irqrestore(&rt2x00dev->irqmask_lock, flags);
- }
- 
- void rt2800mmio_txstatus_tasklet(unsigned long data)
diff --git a/package/kernel/mac80211/patches/rt2x00/028-rt2800mmio-use-timer-and-work-for-handling-tx-status.patch b/package/kernel/mac80211/patches/rt2x00/028-rt2800mmio-use-timer-and-work-for-handling-tx-status.patch
deleted file mode 100644
index bf038a5991..0000000000
--- a/package/kernel/mac80211/patches/rt2x00/028-rt2800mmio-use-timer-and-work-for-handling-tx-status.patch
+++ /dev/null
@@ -1,194 +0,0 @@
-From 175c2548332b45b144af673e70fdbb1a947d7aba Mon Sep 17 00:00:00 2001
-From: Stanislaw Gruszka <sgruszka at redhat.com>
-Date: Sat, 9 Feb 2019 12:08:35 +0100
-X-Patchwork-Submitter: Stanislaw Gruszka <sgruszka at redhat.com>
-X-Patchwork-Id: 10804445
-X-Patchwork-Delegate: kvalo at adurom.com
-Subject: [PATCH 25/28] rt2800mmio: use timer and work for handling tx statuses
- timeouts
-
-Sometimes we can get into situation when there are pending statuses,
-but we do not get INT_SOURCE_CSR_TX_FIFO_STATUS. Handle this situation
-by arming timeout timer and read statuses (it will fix case when
-we just do not have irq) and queue work to handle case we missed
-statues from hardware FIFO.
-
-Signed-off-by: Stanislaw Gruszka <sgruszka at redhat.com>
----
- .../net/wireless/ralink/rt2x00/rt2800mmio.c   | 81 +++++++++++++++++--
- .../net/wireless/ralink/rt2x00/rt2800mmio.h   |  1 +
- .../net/wireless/ralink/rt2x00/rt2800pci.c    |  2 +-
- .../net/wireless/ralink/rt2x00/rt2800soc.c    |  2 +-
- .../net/wireless/ralink/rt2x00/rt2x00dev.c    |  4 +
- 5 files changed, 82 insertions(+), 8 deletions(-)
-
---- a/drivers/net/wireless/ralink/rt2x00/rt2800mmio.c
-+++ b/drivers/net/wireless/ralink/rt2x00/rt2800mmio.c
-@@ -426,6 +426,9 @@ void rt2800mmio_start_queue(struct data_
- }
- EXPORT_SYMBOL_GPL(rt2800mmio_start_queue);
- 
-+/* 200 ms */
-+#define TXSTATUS_TIMEOUT 200000000
-+
- void rt2800mmio_kick_queue(struct data_queue *queue)
- {
- 	struct rt2x00_dev *rt2x00dev = queue->rt2x00dev;
-@@ -440,6 +443,8 @@ void rt2800mmio_kick_queue(struct data_q
- 		entry = rt2x00queue_get_entry(queue, Q_INDEX);
- 		rt2x00mmio_register_write(rt2x00dev, TX_CTX_IDX(queue->qid),
- 					  entry->entry_idx);
-+		hrtimer_start(&rt2x00dev->txstatus_timer,
-+			      TXSTATUS_TIMEOUT, HRTIMER_MODE_REL);
- 		break;
- 	case QID_MGMT:
- 		entry = rt2x00queue_get_entry(queue, Q_INDEX);
-@@ -484,12 +489,8 @@ void rt2800mmio_flush_queue(struct data_
- 		 * For TX queues schedule completion tasklet to catch
- 		 * tx status timeouts, othewise just wait.
- 		 */
--		if (tx_queue) {
--			tasklet_disable(&rt2x00dev->txstatus_tasklet);
--			rt2800_txdone(rt2x00dev, UINT_MAX);
--			rt2800_txdone_nostatus(rt2x00dev);
--			tasklet_enable(&rt2x00dev->txstatus_tasklet);
--		}
-+		if (tx_queue)
-+			queue_work(rt2x00dev->workqueue, &rt2x00dev->txdone_work);
- 
- 		/*
- 		 * Wait for a little while to give the driver
-@@ -627,6 +628,10 @@ void rt2800mmio_clear_entry(struct queue
- 		word = rt2x00_desc_read(entry_priv->desc, 1);
- 		rt2x00_set_field32(&word, TXD_W1_DMA_DONE, 1);
- 		rt2x00_desc_write(entry_priv->desc, 1, word);
-+
-+		/* If last entry stop txstatus timer */
-+		if (entry->queue->length == 1)
-+			hrtimer_cancel(&rt2x00dev->txstatus_timer);
- 	}
- }
- EXPORT_SYMBOL_GPL(rt2800mmio_clear_entry);
-@@ -759,6 +764,70 @@ int rt2800mmio_enable_radio(struct rt2x0
- }
- EXPORT_SYMBOL_GPL(rt2800mmio_enable_radio);
- 
-+static void rt2800mmio_work_txdone(struct work_struct *work)
-+{
-+	struct rt2x00_dev *rt2x00dev =
-+	    container_of(work, struct rt2x00_dev, txdone_work);
-+
-+	if (!test_bit(DEVICE_STATE_ENABLED_RADIO, &rt2x00dev->flags))
-+		return;
-+
-+	while (!kfifo_is_empty(&rt2x00dev->txstatus_fifo) ||
-+	       rt2800_txstatus_timeout(rt2x00dev)) {
-+
-+		tasklet_disable(&rt2x00dev->txstatus_tasklet);
-+		rt2800_txdone(rt2x00dev, UINT_MAX);
-+		rt2800_txdone_nostatus(rt2x00dev);
-+		tasklet_enable(&rt2x00dev->txstatus_tasklet);
-+	}
-+
-+	if (rt2800_txstatus_pending(rt2x00dev))
-+		hrtimer_start(&rt2x00dev->txstatus_timer,
-+			      TXSTATUS_TIMEOUT, HRTIMER_MODE_REL);
-+}
-+
-+static enum hrtimer_restart rt2800mmio_tx_sta_fifo_timeout(struct hrtimer *timer)
-+{
-+	struct rt2x00_dev *rt2x00dev =
-+	    container_of(timer, struct rt2x00_dev, txstatus_timer);
-+
-+	if (!test_bit(DEVICE_STATE_ENABLED_RADIO, &rt2x00dev->flags))
-+		goto out;
-+
-+	if (!rt2800_txstatus_pending(rt2x00dev))
-+		goto out;
-+
-+	rt2800mmio_fetch_txstatus(rt2x00dev);
-+	if (!kfifo_is_empty(&rt2x00dev->txstatus_fifo))
-+		tasklet_schedule(&rt2x00dev->txstatus_tasklet);
-+	else
-+		queue_work(rt2x00dev->workqueue, &rt2x00dev->txdone_work);
-+out:
-+	return HRTIMER_NORESTART;
-+}
-+
-+int rt2800mmio_probe_hw(struct rt2x00_dev *rt2x00dev)
-+{
-+	int retval;
-+
-+	retval = rt2800_probe_hw(rt2x00dev);
-+	if (retval)
-+		return retval;
-+
-+	/*
-+	 * Set txstatus timer function.
-+	 */
-+	rt2x00dev->txstatus_timer.function = rt2800mmio_tx_sta_fifo_timeout;
-+
-+	/*
-+	 * Overwrite TX done handler
-+	 */
-+	INIT_WORK(&rt2x00dev->txdone_work, rt2800mmio_work_txdone);
-+
-+	return 0;
-+}
-+EXPORT_SYMBOL_GPL(rt2800mmio_probe_hw);
-+
- MODULE_AUTHOR(DRV_PROJECT);
- MODULE_VERSION(DRV_VERSION);
- MODULE_DESCRIPTION("rt2800 MMIO library");
---- a/drivers/net/wireless/ralink/rt2x00/rt2800mmio.h
-+++ b/drivers/net/wireless/ralink/rt2x00/rt2800mmio.h
-@@ -153,6 +153,7 @@ void rt2800mmio_stop_queue(struct data_q
- void rt2800mmio_queue_init(struct data_queue *queue);
- 
- /* Initialization functions */
-+int rt2800mmio_probe_hw(struct rt2x00_dev *rt2x00dev);
- bool rt2800mmio_get_entry_state(struct queue_entry *entry);
- void rt2800mmio_clear_entry(struct queue_entry *entry);
- int rt2800mmio_init_queues(struct rt2x00_dev *rt2x00dev);
---- a/drivers/net/wireless/ralink/rt2x00/rt2800pci.c
-+++ b/drivers/net/wireless/ralink/rt2x00/rt2800pci.c
-@@ -346,7 +346,7 @@ static const struct rt2x00lib_ops rt2800
- 	.tbtt_tasklet		= rt2800mmio_tbtt_tasklet,
- 	.rxdone_tasklet		= rt2800mmio_rxdone_tasklet,
- 	.autowake_tasklet	= rt2800mmio_autowake_tasklet,
--	.probe_hw		= rt2800_probe_hw,
-+	.probe_hw		= rt2800mmio_probe_hw,
- 	.get_firmware_name	= rt2800pci_get_firmware_name,
- 	.check_firmware		= rt2800_check_firmware,
- 	.load_firmware		= rt2800_load_firmware,
---- a/drivers/net/wireless/ralink/rt2x00/rt2800soc.c
-+++ b/drivers/net/wireless/ralink/rt2x00/rt2800soc.c
-@@ -185,7 +185,7 @@ static const struct rt2x00lib_ops rt2800
- 	.tbtt_tasklet		= rt2800mmio_tbtt_tasklet,
- 	.rxdone_tasklet		= rt2800mmio_rxdone_tasklet,
- 	.autowake_tasklet	= rt2800mmio_autowake_tasklet,
--	.probe_hw		= rt2800_probe_hw,
-+	.probe_hw		= rt2800mmio_probe_hw,
- 	.get_firmware_name	= rt2800soc_get_firmware_name,
- 	.check_firmware		= rt2800soc_check_firmware,
- 	.load_firmware		= rt2800soc_load_firmware,
---- a/drivers/net/wireless/ralink/rt2x00/rt2x00dev.c
-+++ b/drivers/net/wireless/ralink/rt2x00/rt2x00dev.c
-@@ -1391,6 +1391,8 @@ int rt2x00lib_probe_dev(struct rt2x00_de
- 	mutex_init(&rt2x00dev->conf_mutex);
- 	INIT_LIST_HEAD(&rt2x00dev->bar_list);
- 	spin_lock_init(&rt2x00dev->bar_list_lock);
-+	hrtimer_init(&rt2x00dev->txstatus_timer, CLOCK_MONOTONIC,
-+		     HRTIMER_MODE_REL);
- 
- 	set_bit(DEVICE_STATE_PRESENT, &rt2x00dev->flags);
- 
-@@ -1515,6 +1517,8 @@ void rt2x00lib_remove_dev(struct rt2x00_
- 	cancel_delayed_work_sync(&rt2x00dev->autowakeup_work);
- 	cancel_work_sync(&rt2x00dev->sleep_work);
- 
-+	hrtimer_cancel(&rt2x00dev->txstatus_timer);
-+
- 	/*
- 	 * Kill the tx status tasklet.
- 	 */
diff --git a/package/kernel/mac80211/patches/rt2x00/029-rt2x00-remove-last_nostatus_check.patch b/package/kernel/mac80211/patches/rt2x00/029-rt2x00-remove-last_nostatus_check.patch
deleted file mode 100644
index 0daaef5e8b..0000000000
--- a/package/kernel/mac80211/patches/rt2x00/029-rt2x00-remove-last_nostatus_check.patch
+++ /dev/null
@@ -1,57 +0,0 @@
-From 6013a91f15c9dabd668d5736652b9bcfb0ef0378 Mon Sep 17 00:00:00 2001
-From: Stanislaw Gruszka <sgruszka at redhat.com>
-Date: Sat, 9 Feb 2019 12:08:36 +0100
-X-Patchwork-Submitter: Stanislaw Gruszka <sgruszka at redhat.com>
-X-Patchwork-Id: 10804447
-X-Patchwork-Delegate: kvalo at adurom.com
-Subject: [PATCH 26/28] rt2x00: remove last_nostatus_check
-
-We do not any longer check txstatus timeout from tasklet, so do not need
-this optimization.
-
-Signed-off-by: Stanislaw Gruszka <sgruszka at redhat.com>
----
- drivers/net/wireless/ralink/rt2x00/rt2800lib.c   | 9 ---------
- drivers/net/wireless/ralink/rt2x00/rt2x00.h      | 2 --
- drivers/net/wireless/ralink/rt2x00/rt2x00queue.c | 1 -
- 3 files changed, 12 deletions(-)
-
---- a/drivers/net/wireless/ralink/rt2x00/rt2800lib.c
-+++ b/drivers/net/wireless/ralink/rt2x00/rt2800lib.c
-@@ -1164,15 +1164,6 @@ bool rt2800_txstatus_timeout(struct rt2x
- 	struct data_queue *queue;
- 	struct queue_entry *entry;
- 
--	if (!test_bit(DEVICE_STATE_FLUSHING, &rt2x00dev->flags)) {
--		unsigned long tout = msecs_to_jiffies(1000);
--
--		if (time_before(jiffies, rt2x00dev->last_nostatus_check + tout))
--			return false;
--	}
--
--	rt2x00dev->last_nostatus_check = jiffies;
--
- 	tx_queue_for_each(rt2x00dev, queue) {
- 		entry = rt2x00queue_get_entry(queue, Q_INDEX_DONE);
- 		if (rt2800_entry_txstatus_timeout(rt2x00dev, entry))
---- a/drivers/net/wireless/ralink/rt2x00/rt2x00.h
-+++ b/drivers/net/wireless/ralink/rt2x00/rt2x00.h
-@@ -981,8 +981,6 @@ struct rt2x00_dev {
- 	 */
- 	DECLARE_KFIFO_PTR(txstatus_fifo, u32);
- 
--	unsigned long last_nostatus_check;
--
- 	/*
- 	 * Timer to ensure tx status reports are read (rt2800usb).
- 	 */
---- a/drivers/net/wireless/ralink/rt2x00/rt2x00queue.c
-+++ b/drivers/net/wireless/ralink/rt2x00/rt2x00queue.c
-@@ -1039,7 +1039,6 @@ void rt2x00queue_start_queues(struct rt2
- 	 */
- 	tx_queue_for_each(rt2x00dev, queue)
- 		rt2x00queue_start_queue(queue);
--	rt2x00dev->last_nostatus_check = jiffies;
- 
- 	rt2x00queue_start_queue(rt2x00dev->rx);
- }
diff --git a/package/kernel/mac80211/patches/rt2x00/030-rt2x00-remove-not-used-entry-field.patch b/package/kernel/mac80211/patches/rt2x00/030-rt2x00-remove-not-used-entry-field.patch
deleted file mode 100644
index 53134a5bc3..0000000000
--- a/package/kernel/mac80211/patches/rt2x00/030-rt2x00-remove-not-used-entry-field.patch
+++ /dev/null
@@ -1,34 +0,0 @@
-From 2758f09b22bc08e89e0391486b2d707ad2479599 Mon Sep 17 00:00:00 2001
-From: Stanislaw Gruszka <sgruszka at redhat.com>
-Date: Sat, 9 Feb 2019 12:08:37 +0100
-X-Patchwork-Submitter: Stanislaw Gruszka <sgruszka at redhat.com>
-X-Patchwork-Id: 10804449
-X-Patchwork-Delegate: kvalo at adurom.com
-Subject: [PATCH 27/28] rt2x00: remove not used entry field
-
-Remove not used any longer queue_entry field and flag.
-
-Signed-off-by: Stanislaw Gruszka <sgruszka at redhat.com>
----
- drivers/net/wireless/ralink/rt2x00/rt2x00queue.h | 3 ---
- 1 file changed, 3 deletions(-)
-
---- a/drivers/net/wireless/ralink/rt2x00/rt2x00queue.h
-+++ b/drivers/net/wireless/ralink/rt2x00/rt2x00queue.h
-@@ -361,7 +361,6 @@ enum queue_entry_flags {
- 	ENTRY_DATA_PENDING,
- 	ENTRY_DATA_IO_FAILED,
- 	ENTRY_DATA_STATUS_PENDING,
--	ENTRY_DATA_STATUS_SET,
- };
- 
- /**
-@@ -387,8 +386,6 @@ struct queue_entry {
- 
- 	unsigned int entry_idx;
- 
--	u32 status;
--
- 	void *priv_data;
- };
- 
diff --git a/package/kernel/mac80211/patches/rt2x00/031-rt2x00mmio-remove-legacy-comment.patch b/package/kernel/mac80211/patches/rt2x00/031-rt2x00mmio-remove-legacy-comment.patch
deleted file mode 100644
index 199a6e3255..0000000000
--- a/package/kernel/mac80211/patches/rt2x00/031-rt2x00mmio-remove-legacy-comment.patch
+++ /dev/null
@@ -1,26 +0,0 @@
-From f44e145869bb517460648e4ed71b7e9001964d06 Mon Sep 17 00:00:00 2001
-From: Stanislaw Gruszka <sgruszka at redhat.com>
-Date: Sat, 9 Feb 2019 12:08:38 +0100
-X-Patchwork-Submitter: Stanislaw Gruszka <sgruszka at redhat.com>
-X-Patchwork-Id: 10804451
-X-Patchwork-Delegate: kvalo at adurom.com
-Subject: [PATCH 28/28] rt2x00mmio: remove legacy comment
-
-Remove comment about fields that ware removed.
-
-Signed-off-by: Stanislaw Gruszka <sgruszka at redhat.com>
----
- drivers/net/wireless/ralink/rt2x00/rt2x00mmio.h | 2 --
- 1 file changed, 2 deletions(-)
-
---- a/drivers/net/wireless/ralink/rt2x00/rt2x00mmio.h
-+++ b/drivers/net/wireless/ralink/rt2x00/rt2x00mmio.h
-@@ -80,8 +80,6 @@ int rt2x00mmio_regbusy_read(struct rt2x0
-  *
-  * @desc: Pointer to device descriptor
-  * @desc_dma: DMA pointer to &desc.
-- * @data: Pointer to device's entry memory.
-- * @data_dma: DMA pointer to &data.
-  */
- struct queue_entry_priv_mmio {
- 	__le32 *desc;
diff --git a/package/kernel/mac80211/patches/rt2x00/032-rt2x00-do-not-increment-sequence-number-while-re-tra.patch b/package/kernel/mac80211/patches/rt2x00/032-rt2x00-do-not-increment-sequence-number-while-re-tra.patch
deleted file mode 100644
index c1f3815998..0000000000
--- a/package/kernel/mac80211/patches/rt2x00/032-rt2x00-do-not-increment-sequence-number-while-re-tra.patch
+++ /dev/null
@@ -1,94 +0,0 @@
-From 746ba11f170603bf1eaade817553a6c2e9135bbe Mon Sep 17 00:00:00 2001
-From: Vijayakumar Durai <vijayakumar.durai1 at vivint.com>
-Date: Wed, 27 Mar 2019 11:03:17 +0100
-Subject: [PATCH] rt2x00: do not increment sequence number while
- re-transmitting
-
-Currently rt2x00 devices retransmit the management frames with
-incremented sequence number if hardware is assigning the sequence.
-
-This is HW bug fixed already for non-QOS data frames, but it should
-be fixed for management frames except beacon.
-
-Without fix retransmitted frames have wrong SN:
-
- AlphaNet_e8:fb:36 Vivotek_52:31:51 Authentication, SN=1648, FN=0, Flags=........C Frame is not being retransmitted 1648 1
- AlphaNet_e8:fb:36 Vivotek_52:31:51 Authentication, SN=1649, FN=0, Flags=....R...C Frame is being retransmitted 1649 1
- AlphaNet_e8:fb:36 Vivotek_52:31:51 Authentication, SN=1650, FN=0, Flags=....R...C Frame is being retransmitted 1650 1
-
-With the fix SN stays correctly the same:
-
- 88:6a:e3:e8:f9:a2 8c:f5:a3:88:76:87 Authentication, SN=1450, FN=0, Flags=........C
- 88:6a:e3:e8:f9:a2 8c:f5:a3:88:76:87 Authentication, SN=1450, FN=0, Flags=....R...C
- 88:6a:e3:e8:f9:a2 8c:f5:a3:88:76:87 Authentication, SN=1450, FN=0, Flags=....R...C
-
-Cc: stable at vger.kernel.org
-Signed-off-by: Vijayakumar Durai <vijayakumar.durai1 at vivint.com>
-[sgruszka: simplify code, change comments and changelog]
-Signed-off-by: Stanislaw Gruszka <sgruszka at redhat.com>
-Signed-off-by: Kalle Valo <kvalo at codeaurora.org>
----
- drivers/net/wireless/ralink/rt2x00/rt2x00.h      |  1 -
- drivers/net/wireless/ralink/rt2x00/rt2x00mac.c   | 10 ----------
- drivers/net/wireless/ralink/rt2x00/rt2x00queue.c | 15 +++++++++------
- 3 files changed, 9 insertions(+), 17 deletions(-)
-
---- a/drivers/net/wireless/ralink/rt2x00/rt2x00.h
-+++ b/drivers/net/wireless/ralink/rt2x00/rt2x00.h
-@@ -673,7 +673,6 @@ enum rt2x00_state_flags {
- 	CONFIG_CHANNEL_HT40,
- 	CONFIG_POWERSAVING,
- 	CONFIG_HT_DISABLED,
--	CONFIG_QOS_DISABLED,
- 	CONFIG_MONITORING,
- 
- 	/*
---- a/drivers/net/wireless/ralink/rt2x00/rt2x00mac.c
-+++ b/drivers/net/wireless/ralink/rt2x00/rt2x00mac.c
-@@ -642,19 +642,9 @@ void rt2x00mac_bss_info_changed(struct i
- 			rt2x00dev->intf_associated--;
- 
- 		rt2x00leds_led_assoc(rt2x00dev, !!rt2x00dev->intf_associated);
--
--		clear_bit(CONFIG_QOS_DISABLED, &rt2x00dev->flags);
- 	}
- 
- 	/*
--	 * Check for access point which do not support 802.11e . We have to
--	 * generate data frames sequence number in S/W for such AP, because
--	 * of H/W bug.
--	 */
--	if (changes & BSS_CHANGED_QOS && !bss_conf->qos)
--		set_bit(CONFIG_QOS_DISABLED, &rt2x00dev->flags);
--
--	/*
- 	 * When the erp information has changed, we should perform
- 	 * additional configuration steps. For all other changes we are done.
- 	 */
---- a/drivers/net/wireless/ralink/rt2x00/rt2x00queue.c
-+++ b/drivers/net/wireless/ralink/rt2x00/rt2x00queue.c
-@@ -201,15 +201,18 @@ static void rt2x00queue_create_tx_descri
- 	if (!rt2x00_has_cap_flag(rt2x00dev, REQUIRE_SW_SEQNO)) {
- 		/*
- 		 * rt2800 has a H/W (or F/W) bug, device incorrectly increase
--		 * seqno on retransmited data (non-QOS) frames. To workaround
--		 * the problem let's generate seqno in software if QOS is
--		 * disabled.
-+		 * seqno on retransmitted data (non-QOS) and management frames.
-+		 * To workaround the problem let's generate seqno in software.
-+		 * Except for beacons which are transmitted periodically by H/W
-+		 * hence hardware has to assign seqno for them.
- 		 */
--		if (test_bit(CONFIG_QOS_DISABLED, &rt2x00dev->flags))
--			__clear_bit(ENTRY_TXD_GENERATE_SEQ, &txdesc->flags);
--		else
-+	    	if (ieee80211_is_beacon(hdr->frame_control)) {
-+			__set_bit(ENTRY_TXD_GENERATE_SEQ, &txdesc->flags);
- 			/* H/W will generate sequence number */
- 			return;
-+		}
-+
-+		__clear_bit(ENTRY_TXD_GENERATE_SEQ, &txdesc->flags);
- 	}
- 
- 	/*
diff --git a/package/kernel/mac80211/patches/rt2x00/050-rt2x00-add-RT3883-support.patch b/package/kernel/mac80211/patches/rt2x00/050-rt2x00-add-RT3883-support.patch
deleted file mode 100644
index 162a20155d..0000000000
--- a/package/kernel/mac80211/patches/rt2x00/050-rt2x00-add-RT3883-support.patch
+++ /dev/null
@@ -1,959 +0,0 @@
-From d0e61a0f7cca51ce340a5a73595189972122ff25 Mon Sep 17 00:00:00 2001
-From: Gabor Juhos <juhosg at openwrt.org>
-Date: Wed, 24 Apr 2019 09:49:24 +0200
-Subject: [PATCH] rt2x00: add RT3883 support
-
-Patch add support for RT3883 chip. Code was taken direclty
-from openwrt project and merge into one patch.
-
-Signed-off-by: Gabor Juhos <juhosg at openwrt.org>
-Signed-off-by: Stanislaw Gruszka <sgruszka at redhat.com>
-Signed-off-by: Kalle Valo <kvalo at codeaurora.org>
----
- drivers/net/wireless/ralink/rt2x00/rt2800.h   |  19 +-
- .../net/wireless/ralink/rt2x00/rt2800lib.c    | 598 +++++++++++++++++-
- .../net/wireless/ralink/rt2x00/rt2800soc.c    |   9 +-
- 3 files changed, 607 insertions(+), 19 deletions(-)
-
---- a/drivers/net/wireless/ralink/rt2x00/rt2800.h
-+++ b/drivers/net/wireless/ralink/rt2x00/rt2800.h
-@@ -48,7 +48,8 @@
-  * RF2853 2.4G/5G 3T3R
-  * RF3320 2.4G 1T1R(RT3350/RT3370/RT3390)
-  * RF3322 2.4G 2T2R(RT3352/RT3371/RT3372/RT3391/RT3392)
-- * RF3053 2.4G/5G 3T3R(RT3883/RT3563/RT3573/RT3593/RT3662)
-+ * RF3053 2.4G/5G 3T3R(RT3563/RT3573/RT3593)
-+ * RF3853 2.4G/5G 3T3R(RT3883/RT3662)
-  * RF5592 2.4G/5G 2T2R
-  * RF3070 2.4G 1T1R
-  * RF5360 2.4G 1T1R
-@@ -72,6 +73,7 @@
- #define RF5592				0x000f
- #define RF3070				0x3070
- #define RF3290				0x3290
-+#define RF3853				0x3853
- #define RF5350				0x5350
- #define RF5360				0x5360
- #define RF5362				0x5362
-@@ -1726,6 +1728,20 @@
- #define TX_PWR_CFG_9B_STBC_MCS7		FIELD32(0x000000ff)
- 
- /*
-+ * TX_TXBF_CFG:
-+ */
-+#define TX_TXBF_CFG_0			0x138c
-+#define TX_TXBF_CFG_1			0x13a4
-+#define TX_TXBF_CFG_2			0x13a8
-+#define TX_TXBF_CFG_3			0x13ac
-+
-+/*
-+ * TX_FBK_CFG_3S:
-+ */
-+#define TX_FBK_CFG_3S_0			0x13c4
-+#define TX_FBK_CFG_3S_1			0x13c8
-+
-+/*
-  * RX_FILTER_CFG: RX configuration register.
-  */
- #define RX_FILTER_CFG			0x1400
-@@ -2296,6 +2312,7 @@ struct mac_iveiv_entry {
- /*
-  * RFCSR 2:
-  */
-+#define RFCSR2_RESCAL_BP		FIELD8(0x40)
- #define RFCSR2_RESCAL_EN		FIELD8(0x80)
- #define RFCSR2_RX2_EN_MT7620		FIELD8(0x02)
- #define RFCSR2_TX2_EN_MT7620		FIELD8(0x20)
---- a/drivers/net/wireless/ralink/rt2x00/rt2800lib.c
-+++ b/drivers/net/wireless/ralink/rt2x00/rt2800lib.c
-@@ -381,7 +381,8 @@ static unsigned int rt2800_eeprom_word_i
- 		      wiphy_name(rt2x00dev->hw->wiphy), word))
- 		return 0;
- 
--	if (rt2x00_rt(rt2x00dev, RT3593))
-+	if (rt2x00_rt(rt2x00dev, RT3593) ||
-+	    rt2x00_rt(rt2x00dev, RT3883))
- 		map = rt2800_eeprom_map_ext;
- 	else
- 		map = rt2800_eeprom_map;
-@@ -590,6 +591,7 @@ void rt2800_get_txwi_rxwi_size(struct rt
- {
- 	switch (rt2x00dev->chip.rt) {
- 	case RT3593:
-+	case RT3883:
- 		*txwi_size = TXWI_DESC_SIZE_4WORDS;
- 		*rxwi_size = RXWI_DESC_SIZE_5WORDS;
- 		break;
-@@ -2180,7 +2182,8 @@ void rt2800_config_ant(struct rt2x00_dev
- 	rt2800_bbp_write(rt2x00dev, 3, r3);
- 	rt2800_bbp_write(rt2x00dev, 1, r1);
- 
--	if (rt2x00_rt(rt2x00dev, RT3593)) {
-+	if (rt2x00_rt(rt2x00dev, RT3593) ||
-+	    rt2x00_rt(rt2x00dev, RT3883)) {
- 		if (ant->rx_chain_num == 1)
- 			rt2800_bbp_write(rt2x00dev, 86, 0x00);
- 		else
-@@ -2202,7 +2205,8 @@ static void rt2800_config_lna_gain(struc
- 		eeprom = rt2800_eeprom_read(rt2x00dev, EEPROM_LNA);
- 		lna_gain = rt2x00_get_field16(eeprom, EEPROM_LNA_A0);
- 	} else if (libconf->rf.channel <= 128) {
--		if (rt2x00_rt(rt2x00dev, RT3593)) {
-+		if (rt2x00_rt(rt2x00dev, RT3593) ||
-+		    rt2x00_rt(rt2x00dev, RT3883)) {
- 			eeprom = rt2800_eeprom_read(rt2x00dev, EEPROM_EXT_LNA2);
- 			lna_gain = rt2x00_get_field16(eeprom,
- 						      EEPROM_EXT_LNA2_A1);
-@@ -2212,7 +2216,8 @@ static void rt2800_config_lna_gain(struc
- 						      EEPROM_RSSI_BG2_LNA_A1);
- 		}
- 	} else {
--		if (rt2x00_rt(rt2x00dev, RT3593)) {
-+		if (rt2x00_rt(rt2x00dev, RT3593) ||
-+		    rt2x00_rt(rt2x00dev, RT3883)) {
- 			eeprom = rt2800_eeprom_read(rt2x00dev, EEPROM_EXT_LNA2);
- 			lna_gain = rt2x00_get_field16(eeprom,
- 						      EEPROM_EXT_LNA2_A2);
-@@ -2880,6 +2885,211 @@ static void rt2800_config_channel_rf3053
- 	}
- }
- 
-+static void rt2800_config_channel_rf3853(struct rt2x00_dev *rt2x00dev,
-+					 struct ieee80211_conf *conf,
-+					 struct rf_channel *rf,
-+					 struct channel_info *info)
-+{
-+	u8 rfcsr;
-+	u8 bbp;
-+	u8 pwr1, pwr2, pwr3;
-+
-+	const bool txbf_enabled = false; /* TODO */
-+
-+	/* TODO: add band selection */
-+
-+	if (rf->channel <= 14)
-+		rt2800_rfcsr_write(rt2x00dev, 6, 0x40);
-+	else if (rf->channel < 132)
-+		rt2800_rfcsr_write(rt2x00dev, 6, 0x80);
-+	else
-+		rt2800_rfcsr_write(rt2x00dev, 6, 0x40);
-+
-+	rt2800_rfcsr_write(rt2x00dev, 8, rf->rf1);
-+	rt2800_rfcsr_write(rt2x00dev, 9, rf->rf3);
-+
-+	if (rf->channel <= 14)
-+		rt2800_rfcsr_write(rt2x00dev, 11, 0x46);
-+	else
-+		rt2800_rfcsr_write(rt2x00dev, 11, 0x48);
-+
-+	if (rf->channel <= 14)
-+		rt2800_rfcsr_write(rt2x00dev, 12, 0x1a);
-+	else
-+		rt2800_rfcsr_write(rt2x00dev, 12, 0x52);
-+
-+	rt2800_rfcsr_write(rt2x00dev, 13, 0x12);
-+
-+	rfcsr = rt2800_rfcsr_read(rt2x00dev, 1);
-+	rt2x00_set_field8(&rfcsr, RFCSR1_RX0_PD, 0);
-+	rt2x00_set_field8(&rfcsr, RFCSR1_TX0_PD, 0);
-+	rt2x00_set_field8(&rfcsr, RFCSR1_RX1_PD, 0);
-+	rt2x00_set_field8(&rfcsr, RFCSR1_TX1_PD, 0);
-+	rt2x00_set_field8(&rfcsr, RFCSR1_RX2_PD, 0);
-+	rt2x00_set_field8(&rfcsr, RFCSR1_TX2_PD, 0);
-+	rt2x00_set_field8(&rfcsr, RFCSR1_RF_BLOCK_EN, 1);
-+	rt2x00_set_field8(&rfcsr, RFCSR1_PLL_PD, 1);
-+
-+	switch (rt2x00dev->default_ant.tx_chain_num) {
-+	case 3:
-+		rt2x00_set_field8(&rfcsr, RFCSR1_TX2_PD, 1);
-+		/* fallthrough */
-+	case 2:
-+		rt2x00_set_field8(&rfcsr, RFCSR1_TX1_PD, 1);
-+		/* fallthrough */
-+	case 1:
-+		rt2x00_set_field8(&rfcsr, RFCSR1_TX0_PD, 1);
-+		break;
-+	}
-+
-+	switch (rt2x00dev->default_ant.rx_chain_num) {
-+	case 3:
-+		rt2x00_set_field8(&rfcsr, RFCSR1_RX2_PD, 1);
-+		/* fallthrough */
-+	case 2:
-+		rt2x00_set_field8(&rfcsr, RFCSR1_RX1_PD, 1);
-+		/* fallthrough */
-+	case 1:
-+		rt2x00_set_field8(&rfcsr, RFCSR1_RX0_PD, 1);
-+		break;
-+	}
-+	rt2800_rfcsr_write(rt2x00dev, 1, rfcsr);
-+
-+	rt2800_freq_cal_mode1(rt2x00dev);
-+
-+	rfcsr = rt2800_rfcsr_read(rt2x00dev, 30);
-+	if (!conf_is_ht40(conf))
-+		rfcsr &= ~(0x06);
-+	else
-+		rfcsr |= 0x06;
-+	rt2800_rfcsr_write(rt2x00dev, 30, rfcsr);
-+
-+	if (rf->channel <= 14)
-+		rt2800_rfcsr_write(rt2x00dev, 31, 0xa0);
-+	else
-+		rt2800_rfcsr_write(rt2x00dev, 31, 0x80);
-+
-+	if (conf_is_ht40(conf))
-+		rt2800_rfcsr_write(rt2x00dev, 32, 0x80);
-+	else
-+		rt2800_rfcsr_write(rt2x00dev, 32, 0xd8);
-+
-+	if (rf->channel <= 14)
-+		rt2800_rfcsr_write(rt2x00dev, 34, 0x3c);
-+	else
-+		rt2800_rfcsr_write(rt2x00dev, 34, 0x20);
-+
-+	/* loopback RF_BS */
-+	rfcsr = rt2800_rfcsr_read(rt2x00dev, 36);
-+	if (rf->channel <= 14)
-+		rt2x00_set_field8(&rfcsr, RFCSR36_RF_BS, 1);
-+	else
-+		rt2x00_set_field8(&rfcsr, RFCSR36_RF_BS, 0);
-+	rt2800_rfcsr_write(rt2x00dev, 36, rfcsr);
-+
-+	if (rf->channel <= 14)
-+		rfcsr = 0x23;
-+	else if (rf->channel < 100)
-+		rfcsr = 0x36;
-+	else if (rf->channel < 132)
-+		rfcsr = 0x32;
-+	else
-+		rfcsr = 0x30;
-+
-+	if (txbf_enabled)
-+		rfcsr |= 0x40;
-+
-+	rt2800_rfcsr_write(rt2x00dev, 39, rfcsr);
-+
-+	if (rf->channel <= 14)
-+		rt2800_rfcsr_write(rt2x00dev, 44, 0x93);
-+	else
-+		rt2800_rfcsr_write(rt2x00dev, 44, 0x9b);
-+
-+	if (rf->channel <= 14)
-+		rfcsr = 0xbb;
-+	else if (rf->channel < 100)
-+		rfcsr = 0xeb;
-+	else if (rf->channel < 132)
-+		rfcsr = 0xb3;
-+	else
-+		rfcsr = 0x9b;
-+	rt2800_rfcsr_write(rt2x00dev, 45, rfcsr);
-+
-+	if (rf->channel <= 14)
-+		rfcsr = 0x8e;
-+	else
-+		rfcsr = 0x8a;
-+
-+	if (txbf_enabled)
-+		rfcsr |= 0x20;
-+
-+	rt2800_rfcsr_write(rt2x00dev, 49, rfcsr);
-+
-+	rt2800_rfcsr_write(rt2x00dev, 50, 0x86);
-+
-+	rfcsr = rt2800_rfcsr_read(rt2x00dev, 51);
-+	if (rf->channel <= 14)
-+		rt2800_rfcsr_write(rt2x00dev, 51, 0x75);
-+	else
-+		rt2800_rfcsr_write(rt2x00dev, 51, 0x51);
-+
-+	rfcsr = rt2800_rfcsr_read(rt2x00dev, 52);
-+	if (rf->channel <= 14)
-+		rt2800_rfcsr_write(rt2x00dev, 52, 0x45);
-+	else
-+		rt2800_rfcsr_write(rt2x00dev, 52, 0x05);
-+
-+	if (rf->channel <= 14) {
-+		pwr1 = info->default_power1 & 0x1f;
-+		pwr2 = info->default_power2 & 0x1f;
-+		pwr3 = info->default_power3 & 0x1f;
-+	} else {
-+		pwr1 = 0x48 | ((info->default_power1 & 0x18) << 1) |
-+			(info->default_power1 & 0x7);
-+		pwr2 = 0x48 | ((info->default_power2 & 0x18) << 1) |
-+			(info->default_power2 & 0x7);
-+		pwr3 = 0x48 | ((info->default_power3 & 0x18) << 1) |
-+			(info->default_power3 & 0x7);
-+	}
-+
-+	rt2800_rfcsr_write(rt2x00dev, 53, pwr1);
-+	rt2800_rfcsr_write(rt2x00dev, 54, pwr2);
-+	rt2800_rfcsr_write(rt2x00dev, 55, pwr3);
-+
-+	rt2x00_dbg(rt2x00dev, "Channel:%d, pwr1:%02x, pwr2:%02x, pwr3:%02x\n",
-+		   rf->channel, pwr1, pwr2, pwr3);
-+
-+	bbp = (info->default_power1 >> 5) |
-+	      ((info->default_power2 & 0xe0) >> 1);
-+	rt2800_bbp_write(rt2x00dev, 109, bbp);
-+
-+	bbp = rt2800_bbp_read(rt2x00dev, 110);
-+	bbp &= 0x0f;
-+	bbp |= (info->default_power3 & 0xe0) >> 1;
-+	rt2800_bbp_write(rt2x00dev, 110, bbp);
-+
-+	rfcsr = rt2800_rfcsr_read(rt2x00dev, 57);
-+	if (rf->channel <= 14)
-+		rt2800_rfcsr_write(rt2x00dev, 57, 0x6e);
-+	else
-+		rt2800_rfcsr_write(rt2x00dev, 57, 0x3e);
-+
-+	/* Enable RF tuning */
-+	rfcsr = rt2800_rfcsr_read(rt2x00dev, 3);
-+	rt2x00_set_field8(&rfcsr, RFCSR3_VCOCAL_EN, 1);
-+	rt2800_rfcsr_write(rt2x00dev, 3, rfcsr);
-+
-+	udelay(2000);
-+
-+	bbp = rt2800_bbp_read(rt2x00dev, 49);
-+	/* clear update flag */
-+	rt2800_bbp_write(rt2x00dev, 49, bbp & 0xfe);
-+	rt2800_bbp_write(rt2x00dev, 49, bbp);
-+
-+	/* TODO: add calibration for TxBF */
-+}
-+
- #define POWER_BOUND		0x27
- #define POWER_BOUND_5G		0x2b
- 
-@@ -3683,19 +3893,51 @@ static char rt2800_txpower_to_dev(struct
- 				  unsigned int channel,
- 				  char txpower)
- {
--	if (rt2x00_rt(rt2x00dev, RT3593))
-+	if (rt2x00_rt(rt2x00dev, RT3593) ||
-+	    rt2x00_rt(rt2x00dev, RT3883))
- 		txpower = rt2x00_get_field8(txpower, EEPROM_TXPOWER_ALC);
- 
- 	if (channel <= 14)
- 		return clamp_t(char, txpower, MIN_G_TXPOWER, MAX_G_TXPOWER);
- 
--	if (rt2x00_rt(rt2x00dev, RT3593))
-+	if (rt2x00_rt(rt2x00dev, RT3593) ||
-+	    rt2x00_rt(rt2x00dev, RT3883))
- 		return clamp_t(char, txpower, MIN_A_TXPOWER_3593,
- 			       MAX_A_TXPOWER_3593);
- 	else
- 		return clamp_t(char, txpower, MIN_A_TXPOWER, MAX_A_TXPOWER);
- }
- 
-+static void rt3883_bbp_adjust(struct rt2x00_dev *rt2x00dev,
-+			      struct rf_channel *rf)
-+{
-+	u8 bbp;
-+
-+	bbp = (rf->channel > 14) ? 0x48 : 0x38;
-+	rt2800_bbp_write_with_rx_chain(rt2x00dev, 66, bbp);
-+
-+	rt2800_bbp_write(rt2x00dev, 69, 0x12);
-+
-+	if (rf->channel <= 14) {
-+		rt2800_bbp_write(rt2x00dev, 70, 0x0a);
-+	} else {
-+		/* Disable CCK packet detection */
-+		rt2800_bbp_write(rt2x00dev, 70, 0x00);
-+	}
-+
-+	rt2800_bbp_write(rt2x00dev, 73, 0x10);
-+
-+	if (rf->channel > 14) {
-+		rt2800_bbp_write(rt2x00dev, 62, 0x1d);
-+		rt2800_bbp_write(rt2x00dev, 63, 0x1d);
-+		rt2800_bbp_write(rt2x00dev, 64, 0x1d);
-+	} else {
-+		rt2800_bbp_write(rt2x00dev, 62, 0x2d);
-+		rt2800_bbp_write(rt2x00dev, 63, 0x2d);
-+		rt2800_bbp_write(rt2x00dev, 64, 0x2d);
-+	}
-+}
-+
- static void rt2800_config_channel(struct rt2x00_dev *rt2x00dev,
- 				  struct ieee80211_conf *conf,
- 				  struct rf_channel *rf,
-@@ -3714,6 +3956,12 @@ static void rt2800_config_channel(struct
- 			rt2800_txpower_to_dev(rt2x00dev, rf->channel,
- 					      info->default_power3);
- 
-+	switch (rt2x00dev->chip.rt) {
-+	case RT3883:
-+		rt3883_bbp_adjust(rt2x00dev, rf);
-+		break;
-+	}
-+
- 	switch (rt2x00dev->chip.rf) {
- 	case RF2020:
- 	case RF3020:
-@@ -3734,6 +3982,9 @@ static void rt2800_config_channel(struct
- 	case RF3322:
- 		rt2800_config_channel_rf3322(rt2x00dev, conf, rf, info);
- 		break;
-+	case RF3853:
-+		rt2800_config_channel_rf3853(rt2x00dev, conf, rf, info);
-+		break;
- 	case RF3070:
- 	case RF5350:
- 	case RF5360:
-@@ -3815,6 +4066,15 @@ static void rt2800_config_channel(struct
- 		rt2800_bbp_write(rt2x00dev, 63, 0x37 - rt2x00dev->lna_gain);
- 		rt2800_bbp_write(rt2x00dev, 64, 0x37 - rt2x00dev->lna_gain);
- 		rt2800_bbp_write(rt2x00dev, 77, 0x98);
-+	} else if (rt2x00_rt(rt2x00dev, RT3883)) {
-+		rt2800_bbp_write(rt2x00dev, 62, 0x37 - rt2x00dev->lna_gain);
-+		rt2800_bbp_write(rt2x00dev, 63, 0x37 - rt2x00dev->lna_gain);
-+		rt2800_bbp_write(rt2x00dev, 64, 0x37 - rt2x00dev->lna_gain);
-+
-+		if (rt2x00dev->default_ant.rx_chain_num > 1)
-+			rt2800_bbp_write(rt2x00dev, 86, 0x46);
-+		else
-+			rt2800_bbp_write(rt2x00dev, 86, 0);
- 	} else {
- 		rt2800_bbp_write(rt2x00dev, 62, 0x37 - rt2x00dev->lna_gain);
- 		rt2800_bbp_write(rt2x00dev, 63, 0x37 - rt2x00dev->lna_gain);
-@@ -3828,6 +4088,7 @@ static void rt2800_config_channel(struct
- 		    !rt2x00_rt(rt2x00dev, RT6352)) {
- 			if (rt2x00_has_cap_external_lna_bg(rt2x00dev)) {
- 				rt2800_bbp_write(rt2x00dev, 82, 0x62);
-+				rt2800_bbp_write(rt2x00dev, 82, 0x62);
- 				rt2800_bbp_write(rt2x00dev, 75, 0x46);
- 			} else {
- 				if (rt2x00_rt(rt2x00dev, RT3593))
-@@ -3836,19 +4097,22 @@ static void rt2800_config_channel(struct
- 					rt2800_bbp_write(rt2x00dev, 82, 0x84);
- 				rt2800_bbp_write(rt2x00dev, 75, 0x50);
- 			}
--			if (rt2x00_rt(rt2x00dev, RT3593))
-+			if (rt2x00_rt(rt2x00dev, RT3593) ||
-+			    rt2x00_rt(rt2x00dev, RT3883))
- 				rt2800_bbp_write(rt2x00dev, 83, 0x8a);
- 		}
- 
- 	} else {
- 		if (rt2x00_rt(rt2x00dev, RT3572))
- 			rt2800_bbp_write(rt2x00dev, 82, 0x94);
--		else if (rt2x00_rt(rt2x00dev, RT3593))
-+		else if (rt2x00_rt(rt2x00dev, RT3593) ||
-+			 rt2x00_rt(rt2x00dev, RT3883))
- 			rt2800_bbp_write(rt2x00dev, 82, 0x82);
- 		else if (!rt2x00_rt(rt2x00dev, RT6352))
- 			rt2800_bbp_write(rt2x00dev, 82, 0xf2);
- 
--		if (rt2x00_rt(rt2x00dev, RT3593))
-+		if (rt2x00_rt(rt2x00dev, RT3593) ||
-+		    rt2x00_rt(rt2x00dev, RT3883))
- 			rt2800_bbp_write(rt2x00dev, 83, 0x9a);
- 
- 		if (rt2x00_has_cap_external_lna_a(rt2x00dev))
-@@ -3984,6 +4248,23 @@ static void rt2800_config_channel(struct
- 		usleep_range(1000, 1500);
- 	}
- 
-+	if (rt2x00_rt(rt2x00dev, RT3883)) {
-+		if (!conf_is_ht40(conf))
-+			rt2800_bbp_write(rt2x00dev, 105, 0x34);
-+		else
-+			rt2800_bbp_write(rt2x00dev, 105, 0x04);
-+
-+		/* AGC init */
-+		if (rf->channel <= 14)
-+			reg = 0x2e + rt2x00dev->lna_gain;
-+		else
-+			reg = 0x20 + ((rt2x00dev->lna_gain * 5) / 3);
-+
-+		rt2800_bbp_write_with_rx_chain(rt2x00dev, 66, reg);
-+
-+		usleep_range(1000, 1500);
-+	}
-+
- 	if (rt2x00_rt(rt2x00dev, RT5592) || rt2x00_rt(rt2x00dev, RT6352)) {
- 		reg = 0x10;
- 		if (!conf_is_ht40(conf)) {
-@@ -4243,6 +4524,9 @@ static u8 rt2800_compensate_txpower(stru
- 	if (rt2x00_rt(rt2x00dev, RT3593))
- 		return min_t(u8, txpower, 0xc);
- 
-+	if (rt2x00_rt(rt2x00dev, RT3883))
-+		return min_t(u8, txpower, 0xf);
-+
- 	if (rt2x00_has_cap_power_limit(rt2x00dev)) {
- 		/*
- 		 * Check if eirp txpower exceed txpower_limit.
-@@ -5004,7 +5288,8 @@ static void rt2800_config_txpower(struct
- 				  struct ieee80211_channel *chan,
- 				  int power_level)
- {
--	if (rt2x00_rt(rt2x00dev, RT3593))
-+	if (rt2x00_rt(rt2x00dev, RT3593) ||
-+	    rt2x00_rt(rt2x00dev, RT3883))
- 		rt2800_config_txpower_rt3593(rt2x00dev, chan, power_level);
- 	else if (rt2x00_rt(rt2x00dev, RT6352))
- 		rt2800_config_txpower_rt6352(rt2x00dev, chan, power_level);
-@@ -5051,6 +5336,7 @@ void rt2800_vco_calibration(struct rt2x0
- 	case RF3053:
- 	case RF3070:
- 	case RF3290:
-+	case RF3853:
- 	case RF5350:
- 	case RF5360:
- 	case RF5362:
-@@ -5251,7 +5537,8 @@ static u8 rt2800_get_default_vgc(struct
- 		else
- 			vgc = 0x2e + rt2x00dev->lna_gain;
- 	} else { /* 5GHZ band */
--		if (rt2x00_rt(rt2x00dev, RT3593))
-+		if (rt2x00_rt(rt2x00dev, RT3593) ||
-+		    rt2x00_rt(rt2x00dev, RT3883))
- 			vgc = 0x20 + (rt2x00dev->lna_gain * 5) / 3;
- 		else if (rt2x00_rt(rt2x00dev, RT5592))
- 			vgc = 0x24 + (2 * rt2x00dev->lna_gain);
-@@ -5271,7 +5558,8 @@ static inline void rt2800_set_vgc(struct
- {
- 	if (qual->vgc_level != vgc_level) {
- 		if (rt2x00_rt(rt2x00dev, RT3572) ||
--		    rt2x00_rt(rt2x00dev, RT3593)) {
-+		    rt2x00_rt(rt2x00dev, RT3593) ||
-+		    rt2x00_rt(rt2x00dev, RT3883)) {
- 			rt2800_bbp_write_with_rx_chain(rt2x00dev, 66,
- 						       vgc_level);
- 		} else if (rt2x00_rt(rt2x00dev, RT5592)) {
-@@ -5318,6 +5606,11 @@ void rt2800_link_tuner(struct rt2x00_dev
- 		}
- 		break;
- 
-+	case RT3883:
-+		if (qual->rssi > -65)
-+			vgc += 0x10;
-+		break;
-+
- 	case RT5592:
- 		if (qual->rssi > -65)
- 			vgc += 0x20;
-@@ -5470,6 +5763,12 @@ static int rt2800_init_registers(struct
- 			rt2800_register_write(rt2x00dev, TX_SW_CFG2,
- 					      0x00000000);
- 		}
-+	} else if (rt2x00_rt(rt2x00dev, RT3883)) {
-+		rt2800_register_write(rt2x00dev, TX_SW_CFG0, 0x00000402);
-+		rt2800_register_write(rt2x00dev, TX_SW_CFG1, 0x00000000);
-+		rt2800_register_write(rt2x00dev, TX_SW_CFG2, 0x00040000);
-+		rt2800_register_write(rt2x00dev, TX_TXBF_CFG_0, 0x8000fc21);
-+		rt2800_register_write(rt2x00dev, TX_TXBF_CFG_3, 0x00009c40);
- 	} else if (rt2x00_rt(rt2x00dev, RT5390) ||
- 		   rt2x00_rt(rt2x00dev, RT5392) ||
- 		   rt2x00_rt(rt2x00dev, RT6352)) {
-@@ -5683,6 +5982,11 @@ static int rt2800_init_registers(struct
- 	reg = rt2x00_rt(rt2x00dev, RT5592) ? 0x00000082 : 0x00000002;
- 	rt2800_register_write(rt2x00dev, TXOP_HLDR_ET, reg);
- 
-+	if (rt2x00_rt(rt2x00dev, RT3883)) {
-+		rt2800_register_write(rt2x00dev, TX_FBK_CFG_3S_0, 0x12111008);
-+		rt2800_register_write(rt2x00dev, TX_FBK_CFG_3S_1, 0x16151413);
-+	}
-+
- 	reg = rt2800_register_read(rt2x00dev, TX_RTS_CFG);
- 	rt2x00_set_field32(&reg, TX_RTS_CFG_AUTO_RTS_RETRY_LIMIT, 7);
- 	rt2x00_set_field32(&reg, TX_RTS_CFG_RTS_THRES,
-@@ -6299,6 +6603,47 @@ static void rt2800_init_bbp_3593(struct
- 		rt2800_bbp_write(rt2x00dev, 103, 0xc0);
- }
- 
-+static void rt2800_init_bbp_3883(struct rt2x00_dev *rt2x00dev)
-+{
-+	rt2800_init_bbp_early(rt2x00dev);
-+
-+	rt2800_bbp_write(rt2x00dev, 4, 0x50);
-+	rt2800_bbp_write(rt2x00dev, 47, 0x48);
-+
-+	rt2800_bbp_write(rt2x00dev, 86, 0x46);
-+	rt2800_bbp_write(rt2x00dev, 88, 0x90);
-+
-+	rt2800_bbp_write(rt2x00dev, 92, 0x02);
-+
-+	rt2800_bbp_write(rt2x00dev, 103, 0xc0);
-+	rt2800_bbp_write(rt2x00dev, 104, 0x92);
-+	rt2800_bbp_write(rt2x00dev, 105, 0x34);
-+	rt2800_bbp_write(rt2x00dev, 106, 0x12);
-+	rt2800_bbp_write(rt2x00dev, 120, 0x50);
-+	rt2800_bbp_write(rt2x00dev, 137, 0x0f);
-+	rt2800_bbp_write(rt2x00dev, 163, 0x9d);
-+
-+	/* Set ITxBF timeout to 0x9C40=1000msec */
-+	rt2800_bbp_write(rt2x00dev, 179, 0x02);
-+	rt2800_bbp_write(rt2x00dev, 180, 0x00);
-+	rt2800_bbp_write(rt2x00dev, 182, 0x40);
-+	rt2800_bbp_write(rt2x00dev, 180, 0x01);
-+	rt2800_bbp_write(rt2x00dev, 182, 0x9c);
-+
-+	rt2800_bbp_write(rt2x00dev, 179, 0x00);
-+
-+	/* Reprogram the inband interface to put right values in RXWI */
-+	rt2800_bbp_write(rt2x00dev, 142, 0x04);
-+	rt2800_bbp_write(rt2x00dev, 143, 0x3b);
-+	rt2800_bbp_write(rt2x00dev, 142, 0x06);
-+	rt2800_bbp_write(rt2x00dev, 143, 0xa0);
-+	rt2800_bbp_write(rt2x00dev, 142, 0x07);
-+	rt2800_bbp_write(rt2x00dev, 143, 0xa1);
-+	rt2800_bbp_write(rt2x00dev, 142, 0x08);
-+	rt2800_bbp_write(rt2x00dev, 143, 0xa2);
-+	rt2800_bbp_write(rt2x00dev, 148, 0xc8);
-+}
-+
- static void rt2800_init_bbp_53xx(struct rt2x00_dev *rt2x00dev)
- {
- 	int ant, div_mode;
-@@ -6743,6 +7088,9 @@ static void rt2800_init_bbp(struct rt2x0
- 	case RT3593:
- 		rt2800_init_bbp_3593(rt2x00dev);
- 		return;
-+	case RT3883:
-+		rt2800_init_bbp_3883(rt2x00dev);
-+		return;
- 	case RT5390:
- 	case RT5392:
- 		rt2800_init_bbp_53xx(rt2x00dev);
-@@ -7614,6 +7962,144 @@ static void rt2800_init_rfcsr_5350(struc
- 	rt2800_rfcsr_write(rt2x00dev, 63, 0x00);
- }
- 
-+static void rt2800_init_rfcsr_3883(struct rt2x00_dev *rt2x00dev)
-+{
-+	u8 rfcsr;
-+
-+	/* TODO: get the actual ECO value from the SoC */
-+	const unsigned int eco = 5;
-+
-+	rt2800_rf_init_calibration(rt2x00dev, 2);
-+
-+	rt2800_rfcsr_write(rt2x00dev, 0, 0xe0);
-+	rt2800_rfcsr_write(rt2x00dev, 1, 0x03);
-+	rt2800_rfcsr_write(rt2x00dev, 2, 0x50);
-+	rt2800_rfcsr_write(rt2x00dev, 3, 0x20);
-+	rt2800_rfcsr_write(rt2x00dev, 4, 0x00);
-+	rt2800_rfcsr_write(rt2x00dev, 5, 0x00);
-+	rt2800_rfcsr_write(rt2x00dev, 6, 0x40);
-+	rt2800_rfcsr_write(rt2x00dev, 7, 0x00);
-+	rt2800_rfcsr_write(rt2x00dev, 8, 0x5b);
-+	rt2800_rfcsr_write(rt2x00dev, 9, 0x08);
-+	rt2800_rfcsr_write(rt2x00dev, 10, 0xd3);
-+	rt2800_rfcsr_write(rt2x00dev, 11, 0x48);
-+	rt2800_rfcsr_write(rt2x00dev, 12, 0x1a);
-+	rt2800_rfcsr_write(rt2x00dev, 13, 0x12);
-+	rt2800_rfcsr_write(rt2x00dev, 14, 0x00);
-+	rt2800_rfcsr_write(rt2x00dev, 15, 0x00);
-+	rt2800_rfcsr_write(rt2x00dev, 16, 0x00);
-+
-+	/* RFCSR 17 will be initialized later based on the
-+	 * frequency offset stored in the EEPROM
-+	 */
-+
-+	rt2800_rfcsr_write(rt2x00dev, 18, 0x40);
-+	rt2800_rfcsr_write(rt2x00dev, 19, 0x00);
-+	rt2800_rfcsr_write(rt2x00dev, 20, 0x00);
-+	rt2800_rfcsr_write(rt2x00dev, 21, 0x00);
-+	rt2800_rfcsr_write(rt2x00dev, 22, 0x20);
-+	rt2800_rfcsr_write(rt2x00dev, 23, 0xc0);
-+	rt2800_rfcsr_write(rt2x00dev, 24, 0x00);
-+	rt2800_rfcsr_write(rt2x00dev, 25, 0x00);
-+	rt2800_rfcsr_write(rt2x00dev, 26, 0x00);
-+	rt2800_rfcsr_write(rt2x00dev, 27, 0x00);
-+	rt2800_rfcsr_write(rt2x00dev, 28, 0x00);
-+	rt2800_rfcsr_write(rt2x00dev, 29, 0x00);
-+	rt2800_rfcsr_write(rt2x00dev, 30, 0x10);
-+	rt2800_rfcsr_write(rt2x00dev, 31, 0x80);
-+	rt2800_rfcsr_write(rt2x00dev, 32, 0x80);
-+	rt2800_rfcsr_write(rt2x00dev, 33, 0x00);
-+	rt2800_rfcsr_write(rt2x00dev, 34, 0x20);
-+	rt2800_rfcsr_write(rt2x00dev, 35, 0x00);
-+	rt2800_rfcsr_write(rt2x00dev, 36, 0x00);
-+	rt2800_rfcsr_write(rt2x00dev, 37, 0x00);
-+	rt2800_rfcsr_write(rt2x00dev, 38, 0x86);
-+	rt2800_rfcsr_write(rt2x00dev, 39, 0x23);
-+	rt2800_rfcsr_write(rt2x00dev, 40, 0x00);
-+	rt2800_rfcsr_write(rt2x00dev, 41, 0x00);
-+	rt2800_rfcsr_write(rt2x00dev, 42, 0x00);
-+	rt2800_rfcsr_write(rt2x00dev, 43, 0x00);
-+	rt2800_rfcsr_write(rt2x00dev, 44, 0x93);
-+	rt2800_rfcsr_write(rt2x00dev, 45, 0xbb);
-+	rt2800_rfcsr_write(rt2x00dev, 46, 0x60);
-+	rt2800_rfcsr_write(rt2x00dev, 47, 0x00);
-+	rt2800_rfcsr_write(rt2x00dev, 48, 0x00);
-+	rt2800_rfcsr_write(rt2x00dev, 49, 0x8e);
-+	rt2800_rfcsr_write(rt2x00dev, 50, 0x86);
-+	rt2800_rfcsr_write(rt2x00dev, 51, 0x51);
-+	rt2800_rfcsr_write(rt2x00dev, 52, 0x05);
-+	rt2800_rfcsr_write(rt2x00dev, 53, 0x76);
-+	rt2800_rfcsr_write(rt2x00dev, 54, 0x76);
-+	rt2800_rfcsr_write(rt2x00dev, 55, 0x76);
-+	rt2800_rfcsr_write(rt2x00dev, 56, 0xdb);
-+	rt2800_rfcsr_write(rt2x00dev, 57, 0x3e);
-+	rt2800_rfcsr_write(rt2x00dev, 58, 0x00);
-+	rt2800_rfcsr_write(rt2x00dev, 59, 0x00);
-+	rt2800_rfcsr_write(rt2x00dev, 60, 0x00);
-+	rt2800_rfcsr_write(rt2x00dev, 61, 0x00);
-+	rt2800_rfcsr_write(rt2x00dev, 62, 0x00);
-+	rt2800_rfcsr_write(rt2x00dev, 63, 0x00);
-+
-+	/* TODO: rx filter calibration? */
-+
-+	rt2800_bbp_write(rt2x00dev, 137, 0x0f);
-+
-+	rt2800_bbp_write(rt2x00dev, 163, 0x9d);
-+
-+	rt2800_bbp_write(rt2x00dev, 105, 0x05);
-+
-+	rt2800_bbp_write(rt2x00dev, 179, 0x02);
-+	rt2800_bbp_write(rt2x00dev, 180, 0x00);
-+	rt2800_bbp_write(rt2x00dev, 182, 0x40);
-+	rt2800_bbp_write(rt2x00dev, 180, 0x01);
-+	rt2800_bbp_write(rt2x00dev, 182, 0x9c);
-+
-+	rt2800_bbp_write(rt2x00dev, 179, 0x00);
-+
-+	rt2800_bbp_write(rt2x00dev, 142, 0x04);
-+	rt2800_bbp_write(rt2x00dev, 143, 0x3b);
-+	rt2800_bbp_write(rt2x00dev, 142, 0x06);
-+	rt2800_bbp_write(rt2x00dev, 143, 0xa0);
-+	rt2800_bbp_write(rt2x00dev, 142, 0x07);
-+	rt2800_bbp_write(rt2x00dev, 143, 0xa1);
-+	rt2800_bbp_write(rt2x00dev, 142, 0x08);
-+	rt2800_bbp_write(rt2x00dev, 143, 0xa2);
-+	rt2800_bbp_write(rt2x00dev, 148, 0xc8);
-+
-+	if (eco == 5) {
-+		rt2800_rfcsr_write(rt2x00dev, 32, 0xd8);
-+		rt2800_rfcsr_write(rt2x00dev, 33, 0x32);
-+	}
-+
-+	rfcsr = rt2800_rfcsr_read(rt2x00dev, 2);
-+	rt2x00_set_field8(&rfcsr, RFCSR2_RESCAL_BP, 0);
-+	rt2x00_set_field8(&rfcsr, RFCSR2_RESCAL_EN, 1);
-+	rt2800_rfcsr_write(rt2x00dev, 2, rfcsr);
-+	msleep(1);
-+	rt2x00_set_field8(&rfcsr, RFCSR2_RESCAL_EN, 0);
-+	rt2800_rfcsr_write(rt2x00dev, 2, rfcsr);
-+
-+	rfcsr = rt2800_rfcsr_read(rt2x00dev, 1);
-+	rt2x00_set_field8(&rfcsr, RFCSR1_RF_BLOCK_EN, 1);
-+	rt2800_rfcsr_write(rt2x00dev, 1, rfcsr);
-+
-+	rfcsr = rt2800_rfcsr_read(rt2x00dev, 6);
-+	rfcsr |= 0xc0;
-+	rt2800_rfcsr_write(rt2x00dev, 6, rfcsr);
-+
-+	rfcsr = rt2800_rfcsr_read(rt2x00dev, 22);
-+	rfcsr |= 0x20;
-+	rt2800_rfcsr_write(rt2x00dev, 22, rfcsr);
-+
-+	rfcsr = rt2800_rfcsr_read(rt2x00dev, 46);
-+	rfcsr |= 0x20;
-+	rt2800_rfcsr_write(rt2x00dev, 46, rfcsr);
-+
-+	rfcsr = rt2800_rfcsr_read(rt2x00dev, 20);
-+	rfcsr &= ~0xee;
-+	rt2800_rfcsr_write(rt2x00dev, 20, rfcsr);
-+}
-+
- static void rt2800_init_rfcsr_5390(struct rt2x00_dev *rt2x00dev)
- {
- 	rt2800_rf_init_calibration(rt2x00dev, 2);
-@@ -8456,6 +8942,9 @@ static void rt2800_init_rfcsr(struct rt2
- 	case RT3390:
- 		rt2800_init_rfcsr_3390(rt2x00dev);
- 		break;
-+	case RT3883:
-+		rt2800_init_rfcsr_3883(rt2x00dev);
-+		break;
- 	case RT3572:
- 		rt2800_init_rfcsr_3572(rt2x00dev);
- 		break;
-@@ -8661,7 +9150,8 @@ static u8 rt2800_get_txmixer_gain_24g(st
- {
- 	u16 word;
- 
--	if (rt2x00_rt(rt2x00dev, RT3593))
-+	if (rt2x00_rt(rt2x00dev, RT3593) ||
-+	    rt2x00_rt(rt2x00dev, RT3883))
- 		return 0;
- 
- 	word = rt2800_eeprom_read(rt2x00dev, EEPROM_TXMIXER_GAIN_BG);
-@@ -8675,7 +9165,8 @@ static u8 rt2800_get_txmixer_gain_5g(str
- {
- 	u16 word;
- 
--	if (rt2x00_rt(rt2x00dev, RT3593))
-+	if (rt2x00_rt(rt2x00dev, RT3593) ||
-+	    rt2x00_rt(rt2x00dev, RT3883))
- 		return 0;
- 
- 	word = rt2800_eeprom_read(rt2x00dev, EEPROM_TXMIXER_GAIN_A);
-@@ -8781,7 +9272,8 @@ static int rt2800_validate_eeprom(struct
- 	word = rt2800_eeprom_read(rt2x00dev, EEPROM_RSSI_BG2);
- 	if (abs(rt2x00_get_field16(word, EEPROM_RSSI_BG2_OFFSET2)) > 10)
- 		rt2x00_set_field16(&word, EEPROM_RSSI_BG2_OFFSET2, 0);
--	if (!rt2x00_rt(rt2x00dev, RT3593)) {
-+	if (!rt2x00_rt(rt2x00dev, RT3593) &&
-+	    !rt2x00_rt(rt2x00dev, RT3883)) {
- 		if (rt2x00_get_field16(word, EEPROM_RSSI_BG2_LNA_A1) == 0x00 ||
- 		    rt2x00_get_field16(word, EEPROM_RSSI_BG2_LNA_A1) == 0xff)
- 			rt2x00_set_field16(&word, EEPROM_RSSI_BG2_LNA_A1,
-@@ -8801,7 +9293,8 @@ static int rt2800_validate_eeprom(struct
- 	word = rt2800_eeprom_read(rt2x00dev, EEPROM_RSSI_A2);
- 	if (abs(rt2x00_get_field16(word, EEPROM_RSSI_A2_OFFSET2)) > 10)
- 		rt2x00_set_field16(&word, EEPROM_RSSI_A2_OFFSET2, 0);
--	if (!rt2x00_rt(rt2x00dev, RT3593)) {
-+	if (!rt2x00_rt(rt2x00dev, RT3593) &&
-+	    !rt2x00_rt(rt2x00dev, RT3883)) {
- 		if (rt2x00_get_field16(word, EEPROM_RSSI_A2_LNA_A2) == 0x00 ||
- 		    rt2x00_get_field16(word, EEPROM_RSSI_A2_LNA_A2) == 0xff)
- 			rt2x00_set_field16(&word, EEPROM_RSSI_A2_LNA_A2,
-@@ -8809,7 +9302,8 @@ static int rt2800_validate_eeprom(struct
- 	}
- 	rt2800_eeprom_write(rt2x00dev, EEPROM_RSSI_A2, word);
- 
--	if (rt2x00_rt(rt2x00dev, RT3593)) {
-+	if (rt2x00_rt(rt2x00dev, RT3593) ||
-+	    rt2x00_rt(rt2x00dev, RT3883)) {
- 		word = rt2800_eeprom_read(rt2x00dev, EEPROM_EXT_LNA2);
- 		if (rt2x00_get_field16(word, EEPROM_EXT_LNA2_A1) == 0x00 ||
- 		    rt2x00_get_field16(word, EEPROM_EXT_LNA2_A1) == 0xff)
-@@ -8848,6 +9342,8 @@ static int rt2800_init_eeprom(struct rt2
- 		rf = rt2800_eeprom_read(rt2x00dev, EEPROM_CHIP_ID);
- 	else if (rt2x00_rt(rt2x00dev, RT3352))
- 		rf = RF3322;
-+	else if (rt2x00_rt(rt2x00dev, RT3883))
-+		rf = RF3853;
- 	else if (rt2x00_rt(rt2x00dev, RT5350))
- 		rf = RF5350;
- 	else
-@@ -8868,6 +9364,7 @@ static int rt2800_init_eeprom(struct rt2
- 	case RF3290:
- 	case RF3320:
- 	case RF3322:
-+	case RF3853:
- 	case RF5350:
- 	case RF5360:
- 	case RF5362:
-@@ -9154,6 +9651,66 @@ static const struct rf_channel rf_vals_3
- 	{14,   0xF0,	 2,  0x18},
- };
- 
-+static const struct rf_channel rf_vals_3853[] = {
-+	{1,  241, 6, 2},
-+	{2,  241, 6, 7},
-+	{3,  242, 6, 2},
-+	{4,  242, 6, 7},
-+	{5,  243, 6, 2},
-+	{6,  243, 6, 7},
-+	{7,  244, 6, 2},
-+	{8,  244, 6, 7},
-+	{9,  245, 6, 2},
-+	{10, 245, 6, 7},
-+	{11, 246, 6, 2},
-+	{12, 246, 6, 7},
-+	{13, 247, 6, 2},
-+	{14, 248, 6, 4},
-+
-+	{36, 0x56, 8, 4},
-+	{38, 0x56, 8, 6},
-+	{40, 0x56, 8, 8},
-+	{44, 0x57, 8, 0},
-+	{46, 0x57, 8, 2},
-+	{48, 0x57, 8, 4},
-+	{52, 0x57, 8, 8},
-+	{54, 0x57, 8, 10},
-+	{56, 0x58, 8, 0},
-+	{60, 0x58, 8, 4},
-+	{62, 0x58, 8, 6},
-+	{64, 0x58, 8, 8},
-+
-+	{100, 0x5b, 8, 8},
-+	{102, 0x5b, 8, 10},
-+	{104, 0x5c, 8, 0},
-+	{108, 0x5c, 8, 4},
-+	{110, 0x5c, 8, 6},
-+	{112, 0x5c, 8, 8},
-+	{114, 0x5c, 8, 10},
-+	{116, 0x5d, 8, 0},
-+	{118, 0x5d, 8, 2},
-+	{120, 0x5d, 8, 4},
-+	{124, 0x5d, 8, 8},
-+	{126, 0x5d, 8, 10},
-+	{128, 0x5e, 8, 0},
-+	{132, 0x5e, 8, 4},
-+	{134, 0x5e, 8, 6},
-+	{136, 0x5e, 8, 8},
-+	{140, 0x5f, 8, 0},
-+
-+	{149, 0x5f, 8, 9},
-+	{151, 0x5f, 8, 11},
-+	{153, 0x60, 8, 1},
-+	{157, 0x60, 8, 5},
-+	{159, 0x60, 8, 7},
-+	{161, 0x60, 8, 9},
-+	{165, 0x61, 8, 1},
-+	{167, 0x61, 8, 3},
-+	{169, 0x61, 8, 5},
-+	{171, 0x61, 8, 7},
-+	{173, 0x61, 8, 9},
-+};
-+
- static const struct rf_channel rf_vals_5592_xtal20[] = {
- 	/* Channel, N, K, mod, R */
- 	{1, 482, 4, 10, 3},
-@@ -9417,6 +9974,11 @@ static int rt2800_probe_hw_mode(struct r
- 		spec->channels = rf_vals_3x;
- 		break;
- 
-+	case RF3853:
-+		spec->num_channels = ARRAY_SIZE(rf_vals_3853);
-+		spec->channels = rf_vals_3853;
-+		break;
-+
- 	case RF5592:
- 		reg = rt2800_register_read(rt2x00dev, MAC_DEBUG_INDEX);
- 		if (rt2x00_get_field32(reg, MAC_DEBUG_INDEX_XTAL)) {
-@@ -9536,6 +10098,7 @@ static int rt2800_probe_hw_mode(struct r
- 	case RF3053:
- 	case RF3070:
- 	case RF3290:
-+	case RF3853:
- 	case RF5350:
- 	case RF5360:
- 	case RF5362:
-@@ -9578,6 +10141,7 @@ static int rt2800_probe_rt(struct rt2x00
- 	case RT3390:
- 	case RT3572:
- 	case RT3593:
-+	case RT3883:
- 	case RT5350:
- 	case RT5390:
- 	case RT5392:
---- a/drivers/net/wireless/ralink/rt2x00/rt2800soc.c
-+++ b/drivers/net/wireless/ralink/rt2x00/rt2800soc.c
-@@ -51,9 +51,16 @@ static bool rt2800soc_hwcrypt_disabled(s
- 
- static void rt2800soc_disable_radio(struct rt2x00_dev *rt2x00dev)
- {
-+	u32 reg;
-+
- 	rt2800_disable_radio(rt2x00dev);
- 	rt2x00mmio_register_write(rt2x00dev, PWR_PIN_CFG, 0);
--	rt2x00mmio_register_write(rt2x00dev, TX_PIN_CFG, 0);
-+
-+	reg = 0;
-+	if (rt2x00_rt(rt2x00dev, RT3883))
-+		rt2x00_set_field32(&reg, TX_PIN_CFG_RFTR_EN, 1);
-+
-+	rt2x00mmio_register_write(rt2x00dev, TX_PIN_CFG, reg);
- }
- 
- static int rt2800soc_set_device_state(struct rt2x00_dev *rt2x00dev,
diff --git a/package/kernel/mac80211/patches/rt2x00/100-rt2x00_options.patch b/package/kernel/mac80211/patches/rt2x00/100-rt2x00_options.patch
index 9dd348151c..295904c64e 100644
--- a/package/kernel/mac80211/patches/rt2x00/100-rt2x00_options.patch
+++ b/package/kernel/mac80211/patches/rt2x00/100-rt2x00_options.patch
@@ -1,6 +1,6 @@
 --- a/drivers/net/wireless/ralink/rt2x00/Kconfig
 +++ b/drivers/net/wireless/ralink/rt2x00/Kconfig
-@@ -225,36 +225,37 @@ config RT2800SOC
+@@ -226,36 +226,37 @@ config RT2800SOC
  
  
  config RT2800_LIB
diff --git a/package/kernel/mac80211/patches/rt2x00/501-rt2x00-allow-to-build-rt2800soc-module-for-RT3883.patch b/package/kernel/mac80211/patches/rt2x00/501-rt2x00-allow-to-build-rt2800soc-module-for-RT3883.patch
index 699989baa0..b4106b0197 100644
--- a/package/kernel/mac80211/patches/rt2x00/501-rt2x00-allow-to-build-rt2800soc-module-for-RT3883.patch
+++ b/package/kernel/mac80211/patches/rt2x00/501-rt2x00-allow-to-build-rt2800soc-module-for-RT3883.patch
@@ -10,7 +10,7 @@ Signed-off-by: Gabor Juhos <juhosg at openwrt.org>
 
 --- a/drivers/net/wireless/ralink/rt2x00/Kconfig
 +++ b/drivers/net/wireless/ralink/rt2x00/Kconfig
-@@ -210,7 +210,7 @@ endif
+@@ -211,7 +211,7 @@ endif
  config RT2800SOC
  	tristate "Ralink WiSoC support"
  	depends on m
@@ -19,7 +19,7 @@ Signed-off-by: Gabor Juhos <juhosg at openwrt.org>
  	select RT2X00_LIB_SOC
  	select RT2X00_LIB_MMIO
  	select RT2X00_LIB_CRYPTO
-@@ -245,7 +245,7 @@ config RT2X00_LIB_PCI
+@@ -246,7 +246,7 @@ config RT2X00_LIB_PCI
  
  config RT2X00_LIB_SOC
  	tristate "RT2x00 SoC support"
diff --git a/package/kernel/mac80211/patches/rt2x00/601-rt2x00-introduce-rt2x00_platform_h.patch b/package/kernel/mac80211/patches/rt2x00/601-rt2x00-introduce-rt2x00_platform_h.patch
index 9d47076ff6..f9d48b2b31 100644
--- a/package/kernel/mac80211/patches/rt2x00/601-rt2x00-introduce-rt2x00_platform_h.patch
+++ b/package/kernel/mac80211/patches/rt2x00/601-rt2x00-introduce-rt2x00_platform_h.patch
@@ -22,7 +22,7 @@
 +#endif /* _RT2X00_PLATFORM_H */
 --- a/drivers/net/wireless/ralink/rt2x00/rt2x00.h
 +++ b/drivers/net/wireless/ralink/rt2x00/rt2x00.h
-@@ -40,6 +40,7 @@
+@@ -29,6 +29,7 @@
  #include <linux/average.h>
  #include <linux/usb.h>
  #include <linux/clk.h>
diff --git a/package/kernel/mac80211/patches/rt2x00/602-rt2x00-introduce-rt2x00eeprom.patch b/package/kernel/mac80211/patches/rt2x00/602-rt2x00-introduce-rt2x00eeprom.patch
index 697d8188f0..417ef32b3d 100644
--- a/package/kernel/mac80211/patches/rt2x00/602-rt2x00-introduce-rt2x00eeprom.patch
+++ b/package/kernel/mac80211/patches/rt2x00/602-rt2x00-introduce-rt2x00eeprom.patch
@@ -1,6 +1,6 @@
 --- a/local-symbols
 +++ b/local-symbols
-@@ -305,6 +305,7 @@ RT2X00_LIB_FIRMWARE=
+@@ -311,6 +311,7 @@ RT2X00_LIB_FIRMWARE=
  RT2X00_LIB_CRYPTO=
  RT2X00_LIB_LEDS=
  RT2X00_LIB_DEBUGFS=
@@ -10,7 +10,7 @@
  RTL8180=
 --- a/drivers/net/wireless/ralink/rt2x00/Kconfig
 +++ b/drivers/net/wireless/ralink/rt2x00/Kconfig
-@@ -69,6 +69,7 @@ config RT2800PCI
+@@ -70,6 +70,7 @@ config RT2800PCI
  	select RT2X00_LIB_MMIO
  	select RT2X00_LIB_PCI
  	select RT2X00_LIB_FIRMWARE
@@ -18,7 +18,7 @@
  	select RT2X00_LIB_CRYPTO
  	depends on CRC_CCITT
  	depends on EEPROM_93CX6
-@@ -215,6 +216,7 @@ config RT2800SOC
+@@ -216,6 +217,7 @@ config RT2800SOC
  	select RT2X00_LIB_MMIO
  	select RT2X00_LIB_CRYPTO
  	select RT2X00_LIB_FIRMWARE
@@ -26,7 +26,7 @@
  	select RT2800_LIB
  	select RT2800_LIB_MMIO
  	---help---
-@@ -265,6 +267,9 @@ config RT2X00_LIB_FIRMWARE
+@@ -266,6 +268,9 @@ config RT2X00_LIB_FIRMWARE
  config RT2X00_LIB_CRYPTO
  	bool
  
@@ -48,7 +48,7 @@
  obj-$(CPTCFG_RT2X00_LIB_MMIO)		+= rt2x00mmio.o
 --- a/drivers/net/wireless/ralink/rt2x00/rt2800lib.h
 +++ b/drivers/net/wireless/ralink/rt2x00/rt2800lib.h
-@@ -48,6 +48,8 @@ struct rt2800_drv_data {
+@@ -37,6 +37,8 @@ struct rt2800_drv_data {
  	struct ieee80211_sta *wcid_to_sta[STA_IDS_SIZE];
  };
  
@@ -57,7 +57,7 @@
  struct rt2800_ops {
  	u32 (*register_read)(struct rt2x00_dev *rt2x00dev,
  			      const unsigned int offset);
-@@ -145,6 +147,15 @@ static inline int rt2800_read_eeprom(str
+@@ -134,6 +136,15 @@ static inline int rt2800_read_eeprom(str
  {
  	const struct rt2800_ops *rt2800ops = rt2x00dev->ops->drv;
  
@@ -75,7 +75,7 @@
  
 --- a/drivers/net/wireless/ralink/rt2x00/rt2800soc.c
 +++ b/drivers/net/wireless/ralink/rt2x00/rt2800soc.c
-@@ -102,19 +102,6 @@ static int rt2800soc_set_device_state(st
+@@ -90,19 +90,6 @@ static int rt2800soc_set_device_state(st
  	return retval;
  }
  
@@ -95,7 +95,7 @@
  /* Firmware functions */
  static char *rt2800soc_get_firmware_name(struct rt2x00_dev *rt2x00dev)
  {
-@@ -178,7 +165,6 @@ static const struct rt2800_ops rt2800soc
+@@ -166,7 +153,6 @@ static const struct rt2800_ops rt2800soc
  	.register_multiread	= rt2x00mmio_register_multiread,
  	.register_multiwrite	= rt2x00mmio_register_multiwrite,
  	.regbusy_read		= rt2x00mmio_regbusy_read,
@@ -105,7 +105,7 @@
  	.drv_init_registers	= rt2800mmio_init_registers,
 --- a/drivers/net/wireless/ralink/rt2x00/rt2x00.h
 +++ b/drivers/net/wireless/ralink/rt2x00/rt2x00.h
-@@ -702,6 +702,7 @@ enum rt2x00_capability_flags {
+@@ -691,6 +691,7 @@ enum rt2x00_capability_flags {
  	REQUIRE_HT_TX_DESC,
  	REQUIRE_PS_AUTOWAKE,
  	REQUIRE_DELAYED_RFKILL,
@@ -113,7 +113,7 @@
  
  	/*
  	 * Capabilities
-@@ -977,6 +978,11 @@ struct rt2x00_dev {
+@@ -966,6 +967,11 @@ struct rt2x00_dev {
  	const struct firmware *fw;
  
  	/*
@@ -127,7 +127,7 @@
  	DECLARE_KFIFO_PTR(txstatus_fifo, u32);
 --- a/drivers/net/wireless/ralink/rt2x00/rt2x00dev.c
 +++ b/drivers/net/wireless/ralink/rt2x00/rt2x00dev.c
-@@ -1423,6 +1423,10 @@ int rt2x00lib_probe_dev(struct rt2x00_de
+@@ -1412,6 +1412,10 @@ int rt2x00lib_probe_dev(struct rt2x00_de
  	INIT_DELAYED_WORK(&rt2x00dev->autowakeup_work, rt2x00lib_autowakeup);
  	INIT_WORK(&rt2x00dev->sleep_work, rt2x00lib_sleep);
  
@@ -138,7 +138,7 @@
  	/*
  	 * Let the driver probe the device to detect the capabilities.
  	 */
-@@ -1566,6 +1570,11 @@ void rt2x00lib_remove_dev(struct rt2x00_
+@@ -1555,6 +1559,11 @@ void rt2x00lib_remove_dev(struct rt2x00_
  	 * Free the driver data.
  	 */
  	kfree(rt2x00dev->drv_data);
@@ -261,7 +261,7 @@
 +}
 --- a/drivers/net/wireless/ralink/rt2x00/rt2x00lib.h
 +++ b/drivers/net/wireless/ralink/rt2x00/rt2x00lib.h
-@@ -297,6 +297,22 @@ static inline void rt2x00lib_free_firmwa
+@@ -286,6 +286,22 @@ static inline void rt2x00lib_free_firmwa
  #endif /* CPTCFG_RT2X00_LIB_FIRMWARE */
  
  /*
@@ -286,7 +286,7 @@
  #ifdef CPTCFG_RT2X00_LIB_DEBUGFS
 --- a/drivers/net/wireless/ralink/rt2x00/rt2x00soc.c
 +++ b/drivers/net/wireless/ralink/rt2x00/rt2x00soc.c
-@@ -97,6 +97,7 @@ int rt2x00soc_probe(struct platform_devi
+@@ -86,6 +86,7 @@ int rt2x00soc_probe(struct platform_devi
  	if (IS_ERR(rt2x00dev->clk))
  		rt2x00dev->clk = NULL;
  
diff --git a/package/kernel/mac80211/patches/rt2x00/604-rt2x00-load-eeprom-on-SoC-from-a-mtd-device-defines-.patch b/package/kernel/mac80211/patches/rt2x00/604-rt2x00-load-eeprom-on-SoC-from-a-mtd-device-defines-.patch
index b3e1220b60..08ca7c96fd 100644
--- a/package/kernel/mac80211/patches/rt2x00/604-rt2x00-load-eeprom-on-SoC-from-a-mtd-device-defines-.patch
+++ b/package/kernel/mac80211/patches/rt2x00/604-rt2x00-load-eeprom-on-SoC-from-a-mtd-device-defines-.patch
@@ -12,7 +12,7 @@ Signed-off-by: John Crispin <blogic at openwrt.org>
 
 --- a/drivers/net/wireless/ralink/rt2x00/Kconfig
 +++ b/drivers/net/wireless/ralink/rt2x00/Kconfig
-@@ -219,6 +219,7 @@ config RT2800SOC
+@@ -220,6 +220,7 @@ config RT2800SOC
  	select RT2X00_LIB_EEPROM
  	select RT2800_LIB
  	select RT2800_LIB_MMIO
diff --git a/package/kernel/mac80211/patches/rt2x00/606-rt2x00-allow_disabling_bands_through_platform_data.patch b/package/kernel/mac80211/patches/rt2x00/606-rt2x00-allow_disabling_bands_through_platform_data.patch
index 202dfc0b89..3372e0b3ab 100644
--- a/package/kernel/mac80211/patches/rt2x00/606-rt2x00-allow_disabling_bands_through_platform_data.patch
+++ b/package/kernel/mac80211/patches/rt2x00/606-rt2x00-allow_disabling_bands_through_platform_data.patch
@@ -12,7 +12,7 @@
  #endif /* _RT2X00_PLATFORM_H */
 --- a/drivers/net/wireless/ralink/rt2x00/rt2x00dev.c
 +++ b/drivers/net/wireless/ralink/rt2x00/rt2x00dev.c
-@@ -1026,6 +1026,22 @@ static int rt2x00lib_probe_hw_modes(stru
+@@ -1015,6 +1015,22 @@ static int rt2x00lib_probe_hw_modes(stru
  	unsigned int num_rates;
  	unsigned int i;
  
@@ -37,7 +37,7 @@
  		num_rates += 4;
 --- a/drivers/net/wireless/ralink/rt2x00/rt2x00.h
 +++ b/drivers/net/wireless/ralink/rt2x00/rt2x00.h
-@@ -409,6 +409,7 @@ struct hw_mode_spec {
+@@ -398,6 +398,7 @@ struct hw_mode_spec {
  	unsigned int supported_bands;
  #define SUPPORT_BAND_2GHZ	0x00000001
  #define SUPPORT_BAND_5GHZ	0x00000002
diff --git a/package/kernel/mac80211/patches/rt2x00/607-rt2x00-add_platform_data_mac_addr.patch b/package/kernel/mac80211/patches/rt2x00/607-rt2x00-add_platform_data_mac_addr.patch
index b8b0188040..f694b061d8 100644
--- a/package/kernel/mac80211/patches/rt2x00/607-rt2x00-add_platform_data_mac_addr.patch
+++ b/package/kernel/mac80211/patches/rt2x00/607-rt2x00-add_platform_data_mac_addr.patch
@@ -1,6 +1,6 @@
 --- a/drivers/net/wireless/ralink/rt2x00/rt2x00dev.c
 +++ b/drivers/net/wireless/ralink/rt2x00/rt2x00dev.c
-@@ -1004,8 +1004,13 @@ static void rt2x00lib_rate(struct ieee80
+@@ -993,8 +993,13 @@ static void rt2x00lib_rate(struct ieee80
  
  void rt2x00lib_set_mac_address(struct rt2x00_dev *rt2x00dev, u8 *eeprom_mac_addr)
  {
@@ -12,7 +12,7 @@
 +		ether_addr_copy(eeprom_mac_addr, pdata->mac_address);
 +
  	mac_addr = of_get_mac_address(rt2x00dev->dev->of_node);
- 	if (mac_addr)
+ 	if (!IS_ERR(mac_addr))
  		ether_addr_copy(eeprom_mac_addr, mac_addr);
 --- a/include/linux/rt2x00_platform.h
 +++ b/include/linux/rt2x00_platform.h
diff --git a/package/kernel/mac80211/patches/rt2x00/608-rt2x00-allow_disabling_bands_through_dts.patch b/package/kernel/mac80211/patches/rt2x00/608-rt2x00-allow_disabling_bands_through_dts.patch
index ca66aa8e3b..07f7d34941 100644
--- a/package/kernel/mac80211/patches/rt2x00/608-rt2x00-allow_disabling_bands_through_dts.patch
+++ b/package/kernel/mac80211/patches/rt2x00/608-rt2x00-allow_disabling_bands_through_dts.patch
@@ -1,6 +1,6 @@
 --- a/drivers/net/wireless/ralink/rt2x00/rt2x00dev.c
 +++ b/drivers/net/wireless/ralink/rt2x00/rt2x00dev.c
-@@ -1030,6 +1030,16 @@ static int rt2x00lib_probe_hw_modes(stru
+@@ -1019,6 +1019,16 @@ static int rt2x00lib_probe_hw_modes(stru
  	struct ieee80211_rate *rates;
  	unsigned int num_rates;
  	unsigned int i;
diff --git a/package/kernel/mac80211/patches/rt2x00/609-rt2x00-make-wmac-loadable-via-OF-on-rt288x-305x-SoC.patch b/package/kernel/mac80211/patches/rt2x00/609-rt2x00-make-wmac-loadable-via-OF-on-rt288x-305x-SoC.patch
index ed219c801e..4cb892b3df 100644
--- a/package/kernel/mac80211/patches/rt2x00/609-rt2x00-make-wmac-loadable-via-OF-on-rt288x-305x-SoC.patch
+++ b/package/kernel/mac80211/patches/rt2x00/609-rt2x00-make-wmac-loadable-via-OF-on-rt288x-305x-SoC.patch
@@ -13,7 +13,7 @@ Signed-off-by: John Crispin <blogic at openwrt.org>
 
 --- a/drivers/net/wireless/ralink/rt2x00/rt2800soc.c
 +++ b/drivers/net/wireless/ralink/rt2x00/rt2800soc.c
-@@ -232,10 +232,17 @@ static int rt2800soc_probe(struct platfo
+@@ -220,10 +220,17 @@ static int rt2800soc_probe(struct platfo
  	return rt2x00soc_probe(pdev, &rt2800soc_ops);
  }
  
diff --git a/package/kernel/mac80211/patches/rt2x00/610-rt2x00-change-led-polarity-from-OF.patch b/package/kernel/mac80211/patches/rt2x00/610-rt2x00-change-led-polarity-from-OF.patch
index f0c079b62b..5ea402f5da 100644
--- a/package/kernel/mac80211/patches/rt2x00/610-rt2x00-change-led-polarity-from-OF.patch
+++ b/package/kernel/mac80211/patches/rt2x00/610-rt2x00-change-led-polarity-from-OF.patch
@@ -1,6 +1,6 @@
 --- a/drivers/net/wireless/ralink/rt2x00/rt2800lib.c
 +++ b/drivers/net/wireless/ralink/rt2x00/rt2800lib.c
-@@ -36,6 +36,7 @@
+@@ -25,6 +25,7 @@
  #include <linux/kernel.h>
  #include <linux/module.h>
  #include <linux/slab.h>
@@ -8,7 +8,7 @@
  
  #include "rt2x00.h"
  #include "rt2800lib.h"
-@@ -9458,6 +9459,17 @@ static int rt2800_init_eeprom(struct rt2
+@@ -9447,6 +9448,17 @@ static int rt2800_init_eeprom(struct rt2
  	rt2800_init_led(rt2x00dev, &rt2x00dev->led_assoc, LED_TYPE_ASSOC);
  	rt2800_init_led(rt2x00dev, &rt2x00dev->led_qual, LED_TYPE_QUALITY);
  
@@ -28,7 +28,7 @@
  
 --- a/drivers/net/wireless/ralink/rt2x00/rt2x00leds.c
 +++ b/drivers/net/wireless/ralink/rt2x00/rt2x00leds.c
-@@ -109,6 +109,9 @@ static int rt2x00leds_register_led(struc
+@@ -98,6 +98,9 @@ static int rt2x00leds_register_led(struc
  	led->led_dev.name = name;
  	led->led_dev.brightness = LED_OFF;
  
diff --git a/package/kernel/mac80211/patches/rt2x00/611-rt2x00-add-AP+STA-support.patch b/package/kernel/mac80211/patches/rt2x00/611-rt2x00-add-AP+STA-support.patch
index 062b18a63b..453129d66a 100644
--- a/package/kernel/mac80211/patches/rt2x00/611-rt2x00-add-AP+STA-support.patch
+++ b/package/kernel/mac80211/patches/rt2x00/611-rt2x00-add-AP+STA-support.patch
@@ -1,6 +1,6 @@
 --- a/drivers/net/wireless/ralink/rt2x00/rt2x00dev.c
 +++ b/drivers/net/wireless/ralink/rt2x00/rt2x00dev.c
-@@ -1361,7 +1361,7 @@ static inline void rt2x00lib_set_if_comb
+@@ -1350,7 +1350,7 @@ static inline void rt2x00lib_set_if_comb
  	 */
  	if_limit = &rt2x00dev->if_limits_ap;
  	if_limit->max = rt2x00dev->ops->max_ap_intf;
diff --git a/package/kernel/mac80211/patches/rt2x00/650-rt2x00-add-support-for-external-PA-on-MT7620.patch b/package/kernel/mac80211/patches/rt2x00/650-rt2x00-add-support-for-external-PA-on-MT7620.patch
index 2b6aa43c2d..98eb8c0b7e 100644
--- a/package/kernel/mac80211/patches/rt2x00/650-rt2x00-add-support-for-external-PA-on-MT7620.patch
+++ b/package/kernel/mac80211/patches/rt2x00/650-rt2x00-add-support-for-external-PA-on-MT7620.patch
@@ -20,7 +20,7 @@ Signed-off-by: Tomislav Po=C5=BEega <pozega.tomislav at gmail.com>
 
 --- a/drivers/net/wireless/ralink/rt2x00/rt2800.h
 +++ b/drivers/net/wireless/ralink/rt2x00/rt2800.h
-@@ -2750,6 +2750,7 @@ enum rt2800_eeprom_word {
+@@ -2739,6 +2739,7 @@ enum rt2800_eeprom_word {
  #define EEPROM_NIC_CONF2_RX_STREAM	FIELD16(0x000f)
  #define EEPROM_NIC_CONF2_TX_STREAM	FIELD16(0x00f0)
  #define EEPROM_NIC_CONF2_CRYSTAL	FIELD16(0x0600)
@@ -30,7 +30,7 @@ Signed-off-by: Tomislav Po=C5=BEega <pozega.tomislav at gmail.com>
   * EEPROM LNA
 --- a/drivers/net/wireless/ralink/rt2x00/rt2800lib.c
 +++ b/drivers/net/wireless/ralink/rt2x00/rt2800lib.c
-@@ -4290,6 +4290,45 @@ static void rt2800_config_channel(struct
+@@ -4279,6 +4279,45 @@ static void rt2800_config_channel(struct
  		rt2800_iq_calibrate(rt2x00dev, rf->channel);
  	}
  
@@ -76,7 +76,7 @@ Signed-off-by: Tomislav Po=C5=BEega <pozega.tomislav at gmail.com>
  	bbp = rt2800_bbp_read(rt2x00dev, 4);
  	rt2x00_set_field8(&bbp, BBP4_BANDWIDTH, 2 * conf_is_ht40(conf));
  	rt2800_bbp_write(rt2x00dev, 4, bbp);
-@@ -9487,7 +9526,8 @@ static int rt2800_init_eeprom(struct rt2
+@@ -9476,7 +9515,8 @@ static int rt2800_init_eeprom(struct rt2
  	 */
  	eeprom = rt2800_eeprom_read(rt2x00dev, EEPROM_NIC_CONF1);
  
@@ -86,7 +86,7 @@ Signed-off-by: Tomislav Po=C5=BEega <pozega.tomislav at gmail.com>
  		if (rt2x00_get_field16(eeprom,
  		    EEPROM_NIC_CONF1_EXTERNAL_TX0_PA_3352))
  		    __set_bit(CAPABILITY_EXTERNAL_PA_TX0,
-@@ -9498,6 +9538,18 @@ static int rt2800_init_eeprom(struct rt2
+@@ -9487,6 +9527,18 @@ static int rt2800_init_eeprom(struct rt2
  			      &rt2x00dev->cap_flags);
  	}
  
diff --git a/package/kernel/mac80211/patches/rt2x00/982-rt2x00-add-rf-self-txdc-calibration.patch b/package/kernel/mac80211/patches/rt2x00/982-rt2x00-add-rf-self-txdc-calibration.patch
index 454f55b1cf..ceec92d928 100644
--- a/package/kernel/mac80211/patches/rt2x00/982-rt2x00-add-rf-self-txdc-calibration.patch
+++ b/package/kernel/mac80211/patches/rt2x00/982-rt2x00-add-rf-self-txdc-calibration.patch
@@ -1,6 +1,6 @@
 --- a/drivers/net/wireless/ralink/rt2x00/rt2800lib.c
 +++ b/drivers/net/wireless/ralink/rt2x00/rt2800lib.c
-@@ -8349,6 +8349,58 @@ static void rt2800_init_rfcsr_5592(struc
+@@ -8338,6 +8338,58 @@ static void rt2800_init_rfcsr_5592(struc
  	rt2800_led_open_drain_enable(rt2x00dev);
  }
  
@@ -59,7 +59,7 @@
  static void rt2800_bbp_core_soft_reset(struct rt2x00_dev *rt2x00dev,
  				       bool set_bw, bool is_ht40)
  {
-@@ -8956,6 +9008,7 @@ static void rt2800_init_rfcsr_6352(struc
+@@ -8945,6 +8997,7 @@ static void rt2800_init_rfcsr_6352(struc
  	rt2800_rfcsr_write_dccal(rt2x00dev, 5, 0x00);
  	rt2800_rfcsr_write_dccal(rt2x00dev, 17, 0x7C);
  
@@ -69,7 +69,7 @@
  }
 --- a/drivers/net/wireless/ralink/rt2x00/rt2800lib.h
 +++ b/drivers/net/wireless/ralink/rt2x00/rt2800lib.h
-@@ -243,6 +243,7 @@ void rt2800_link_tuner(struct rt2x00_dev
+@@ -232,6 +232,7 @@ void rt2800_link_tuner(struct rt2x00_dev
  		       const u32 count);
  void rt2800_gain_calibration(struct rt2x00_dev *rt2x00dev);
  void rt2800_vco_calibration(struct rt2x00_dev *rt2x00dev);
@@ -79,7 +79,7 @@
  void rt2800_disable_radio(struct rt2x00_dev *rt2x00dev);
 --- a/drivers/net/wireless/ralink/rt2x00/rt2x00.h
 +++ b/drivers/net/wireless/ralink/rt2x00/rt2x00.h
-@@ -572,6 +572,7 @@ struct rt2x00lib_ops {
+@@ -561,6 +561,7 @@ struct rt2x00lib_ops {
  			    struct link_qual *qual, const u32 count);
  	void (*gain_calibration) (struct rt2x00_dev *rt2x00dev);
  	void (*vco_calibration) (struct rt2x00_dev *rt2x00dev);
diff --git a/package/kernel/mac80211/patches/rt2x00/983-rt2x00-add-r-calibration.patch b/package/kernel/mac80211/patches/rt2x00/983-rt2x00-add-r-calibration.patch
index 6f0d5b577f..45edee8644 100644
--- a/package/kernel/mac80211/patches/rt2x00/983-rt2x00-add-r-calibration.patch
+++ b/package/kernel/mac80211/patches/rt2x00/983-rt2x00-add-r-calibration.patch
@@ -1,6 +1,6 @@
 --- a/drivers/net/wireless/ralink/rt2x00/rt2800lib.c
 +++ b/drivers/net/wireless/ralink/rt2x00/rt2800lib.c
-@@ -8401,6 +8401,160 @@ void rt2800_rf_self_txdc_cal(struct rt2x
+@@ -8390,6 +8390,160 @@ void rt2800_rf_self_txdc_cal(struct rt2x
  }
  EXPORT_SYMBOL_GPL(rt2800_rf_self_txdc_cal);
  
@@ -161,7 +161,7 @@
  static void rt2800_bbp_core_soft_reset(struct rt2x00_dev *rt2x00dev,
  				       bool set_bw, bool is_ht40)
  {
-@@ -9008,6 +9162,7 @@ static void rt2800_init_rfcsr_6352(struc
+@@ -8997,6 +9151,7 @@ static void rt2800_init_rfcsr_6352(struc
  	rt2800_rfcsr_write_dccal(rt2x00dev, 5, 0x00);
  	rt2800_rfcsr_write_dccal(rt2x00dev, 17, 0x7C);
  
@@ -171,7 +171,7 @@
  	rt2800_bw_filter_calibration(rt2x00dev, false);
 --- a/drivers/net/wireless/ralink/rt2x00/rt2800lib.h
 +++ b/drivers/net/wireless/ralink/rt2x00/rt2800lib.h
-@@ -244,6 +244,8 @@ void rt2800_link_tuner(struct rt2x00_dev
+@@ -233,6 +233,8 @@ void rt2800_link_tuner(struct rt2x00_dev
  void rt2800_gain_calibration(struct rt2x00_dev *rt2x00dev);
  void rt2800_vco_calibration(struct rt2x00_dev *rt2x00dev);
  void rt2800_rf_self_txdc_cal(struct rt2x00_dev *rt2x00dev);
@@ -182,7 +182,7 @@
  void rt2800_disable_radio(struct rt2x00_dev *rt2x00dev);
 --- a/drivers/net/wireless/ralink/rt2x00/rt2x00.h
 +++ b/drivers/net/wireless/ralink/rt2x00/rt2x00.h
-@@ -573,6 +573,8 @@ struct rt2x00lib_ops {
+@@ -562,6 +562,8 @@ struct rt2x00lib_ops {
  	void (*gain_calibration) (struct rt2x00_dev *rt2x00dev);
  	void (*vco_calibration) (struct rt2x00_dev *rt2x00dev);
  	void (*rf_self_txdc_cal) (struct rt2x00_dev *rt2x00dev);
diff --git a/package/kernel/mac80211/patches/rt2x00/984-rt2x00-add-rxdcoc-calibration.patch b/package/kernel/mac80211/patches/rt2x00/984-rt2x00-add-rxdcoc-calibration.patch
index fbeace27da..c6b996782c 100644
--- a/package/kernel/mac80211/patches/rt2x00/984-rt2x00-add-rxdcoc-calibration.patch
+++ b/package/kernel/mac80211/patches/rt2x00/984-rt2x00-add-rxdcoc-calibration.patch
@@ -1,6 +1,6 @@
 --- a/drivers/net/wireless/ralink/rt2x00/rt2800lib.c
 +++ b/drivers/net/wireless/ralink/rt2x00/rt2800lib.c
-@@ -8555,6 +8555,71 @@ void rt2800_r_calibration(struct rt2x00_
+@@ -8544,6 +8544,71 @@ void rt2800_r_calibration(struct rt2x00_
  }
  EXPORT_SYMBOL_GPL(rt2800_r_calibration);
  
@@ -72,7 +72,7 @@
  static void rt2800_bbp_core_soft_reset(struct rt2x00_dev *rt2x00dev,
  				       bool set_bw, bool is_ht40)
  {
-@@ -9164,6 +9229,7 @@ static void rt2800_init_rfcsr_6352(struc
+@@ -9153,6 +9218,7 @@ static void rt2800_init_rfcsr_6352(struc
  
  	rt2800_r_calibration(rt2x00dev);
  	rt2800_rf_self_txdc_cal(rt2x00dev);
@@ -82,7 +82,7 @@
  }
 --- a/drivers/net/wireless/ralink/rt2x00/rt2800lib.h
 +++ b/drivers/net/wireless/ralink/rt2x00/rt2800lib.h
-@@ -246,6 +246,7 @@ void rt2800_vco_calibration(struct rt2x0
+@@ -235,6 +235,7 @@ void rt2800_vco_calibration(struct rt2x0
  void rt2800_rf_self_txdc_cal(struct rt2x00_dev *rt2x00dev);
  int rt2800_calcrcalibrationcode(struct rt2x00_dev *rt2x00dev, int d1, int d2);
  void rt2800_r_calibration(struct rt2x00_dev *rt2x00dev);
@@ -92,7 +92,7 @@
  void rt2800_disable_radio(struct rt2x00_dev *rt2x00dev);
 --- a/drivers/net/wireless/ralink/rt2x00/rt2x00.h
 +++ b/drivers/net/wireless/ralink/rt2x00/rt2x00.h
-@@ -575,6 +575,7 @@ struct rt2x00lib_ops {
+@@ -564,6 +564,7 @@ struct rt2x00lib_ops {
  	void (*rf_self_txdc_cal) (struct rt2x00_dev *rt2x00dev);
  	int (*calcrcalibrationcode) (struct rt2x00_dev *rt2x00dev, int d1, int d2);
  	void (*r_calibration) (struct rt2x00_dev *rt2x00dev);
diff --git a/package/kernel/mac80211/patches/rt2x00/985-rt2x00-add-rxiq-calibration.patch b/package/kernel/mac80211/patches/rt2x00/985-rt2x00-add-rxiq-calibration.patch
index f469c4ebc7..9881469d99 100644
--- a/package/kernel/mac80211/patches/rt2x00/985-rt2x00-add-rxiq-calibration.patch
+++ b/package/kernel/mac80211/patches/rt2x00/985-rt2x00-add-rxiq-calibration.patch
@@ -1,6 +1,6 @@
 --- a/drivers/net/wireless/ralink/rt2x00/rt2800lib.c
 +++ b/drivers/net/wireless/ralink/rt2x00/rt2800lib.c
-@@ -8620,6 +8620,386 @@ void rt2800_rxdcoc_calibration(struct rt
+@@ -8609,6 +8609,386 @@ void rt2800_rxdcoc_calibration(struct rt
  }
  EXPORT_SYMBOL_GPL(rt2800_rxdcoc_calibration);
  
@@ -387,7 +387,7 @@
  static void rt2800_bbp_core_soft_reset(struct rt2x00_dev *rt2x00dev,
  				       bool set_bw, bool is_ht40)
  {
-@@ -9232,6 +9612,7 @@ static void rt2800_init_rfcsr_6352(struc
+@@ -9221,6 +9601,7 @@ static void rt2800_init_rfcsr_6352(struc
  	rt2800_rxdcoc_calibration(rt2x00dev);
  	rt2800_bw_filter_calibration(rt2x00dev, true);
  	rt2800_bw_filter_calibration(rt2x00dev, false);
@@ -397,7 +397,7 @@
  static void rt2800_init_rfcsr(struct rt2x00_dev *rt2x00dev)
 --- a/drivers/net/wireless/ralink/rt2x00/rt2800lib.h
 +++ b/drivers/net/wireless/ralink/rt2x00/rt2800lib.h
-@@ -247,6 +247,7 @@ void rt2800_rf_self_txdc_cal(struct rt2x
+@@ -236,6 +236,7 @@ void rt2800_rf_self_txdc_cal(struct rt2x
  int rt2800_calcrcalibrationcode(struct rt2x00_dev *rt2x00dev, int d1, int d2);
  void rt2800_r_calibration(struct rt2x00_dev *rt2x00dev);
  void rt2800_rxdcoc_calibration(struct rt2x00_dev *rt2x00dev);
@@ -407,7 +407,7 @@
  void rt2800_disable_radio(struct rt2x00_dev *rt2x00dev);
 --- a/drivers/net/wireless/ralink/rt2x00/rt2x00.h
 +++ b/drivers/net/wireless/ralink/rt2x00/rt2x00.h
-@@ -576,6 +576,7 @@ struct rt2x00lib_ops {
+@@ -565,6 +565,7 @@ struct rt2x00lib_ops {
  	int (*calcrcalibrationcode) (struct rt2x00_dev *rt2x00dev, int d1, int d2);
  	void (*r_calibration) (struct rt2x00_dev *rt2x00dev);
  	void (*rxdcoc_calibration) (struct rt2x00_dev *rt2x00dev);
diff --git a/package/kernel/mac80211/patches/rt2x00/986-rt2x00-add-TX-LOFT-calibration.patch b/package/kernel/mac80211/patches/rt2x00/986-rt2x00-add-TX-LOFT-calibration.patch
index 31a860c1a7..d3118ebb3b 100644
--- a/package/kernel/mac80211/patches/rt2x00/986-rt2x00-add-TX-LOFT-calibration.patch
+++ b/package/kernel/mac80211/patches/rt2x00/986-rt2x00-add-TX-LOFT-calibration.patch
@@ -1,6 +1,6 @@
 --- a/drivers/net/wireless/ralink/rt2x00/rt2800lib.c
 +++ b/drivers/net/wireless/ralink/rt2x00/rt2800lib.c
-@@ -9000,6 +9000,954 @@ restore_value:
+@@ -8989,6 +8989,954 @@ restore_value:
  }
  EXPORT_SYMBOL_GPL(rt2800_rxiq_calibration);
  
@@ -955,7 +955,7 @@
  static void rt2800_bbp_core_soft_reset(struct rt2x00_dev *rt2x00dev,
  				       bool set_bw, bool is_ht40)
  {
-@@ -9612,6 +10560,7 @@ static void rt2800_init_rfcsr_6352(struc
+@@ -9601,6 +10549,7 @@ static void rt2800_init_rfcsr_6352(struc
  	rt2800_rxdcoc_calibration(rt2x00dev);
  	rt2800_bw_filter_calibration(rt2x00dev, true);
  	rt2800_bw_filter_calibration(rt2x00dev, false);
@@ -965,7 +965,7 @@
  
 --- a/drivers/net/wireless/ralink/rt2x00/rt2800lib.h
 +++ b/drivers/net/wireless/ralink/rt2x00/rt2800lib.h
-@@ -28,6 +28,16 @@
+@@ -17,6 +17,16 @@
  #define WCID_START	33
  #define WCID_END	222
  #define STA_IDS_SIZE	(WCID_END - WCID_START + 2)
@@ -982,7 +982,7 @@
  
  /* RT2800 driver data structure */
  struct rt2800_drv_data {
-@@ -248,6 +258,7 @@ int rt2800_calcrcalibrationcode(struct r
+@@ -237,6 +247,7 @@ int rt2800_calcrcalibrationcode(struct r
  void rt2800_r_calibration(struct rt2x00_dev *rt2x00dev);
  void rt2800_rxdcoc_calibration(struct rt2x00_dev *rt2x00dev);
  void rt2800_rxiq_calibration(struct rt2x00_dev *rt2x00dev);
@@ -992,7 +992,7 @@
  void rt2800_disable_radio(struct rt2x00_dev *rt2x00dev);
 --- a/drivers/net/wireless/ralink/rt2x00/rt2x00.h
 +++ b/drivers/net/wireless/ralink/rt2x00/rt2x00.h
-@@ -577,6 +577,7 @@ struct rt2x00lib_ops {
+@@ -566,6 +566,7 @@ struct rt2x00lib_ops {
  	void (*r_calibration) (struct rt2x00_dev *rt2x00dev);
  	void (*rxdcoc_calibration) (struct rt2x00_dev *rt2x00dev);
  	void (*rxiq_calibration) (struct rt2x00_dev *rt2x00dev);
diff --git a/package/kernel/mac80211/patches/subsys/100-remove-cryptoapi-dependencies.patch b/package/kernel/mac80211/patches/subsys/100-remove-cryptoapi-dependencies.patch
index 0fe6ee196c..1a13fdc56f 100644
--- a/package/kernel/mac80211/patches/subsys/100-remove-cryptoapi-dependencies.patch
+++ b/package/kernel/mac80211/patches/subsys/100-remove-cryptoapi-dependencies.patch
@@ -20,17 +20,14 @@
  	ethtool.o \
 --- a/net/mac80211/aead_api.c
 +++ /dev/null
-@@ -1,115 +0,0 @@
+@@ -1,112 +0,0 @@
+-// SPDX-License-Identifier: GPL-2.0-only
 -/*
 - * Copyright 2003-2004, Instant802 Networks, Inc.
 - * Copyright 2005-2006, Devicescape Software, Inc.
 - * Copyright 2014-2015, Qualcomm Atheros, Inc.
 - *
 - * Rewrite: Copyright (C) 2013 Linaro Ltd <ard.biesheuvel at linaro.org>
-- *
-- * This program is free software; you can redistribute it and/or modify
-- * it under the terms of the GNU General Public License version 2 as
-- * published by the Free Software Foundation.
 - */
 -
 -#include <linux/kernel.h>
@@ -138,12 +135,8 @@
 -}
 --- a/net/mac80211/aead_api.h
 +++ /dev/null
-@@ -1,27 +0,0 @@
--/*
-- * This program is free software; you can redistribute it and/or modify
-- * it under the terms of the GNU General Public License version 2 as
-- * published by the Free Software Foundation.
-- */
+@@ -1,23 +0,0 @@
+-/* SPDX-License-Identifier: GPL-2.0-only */
 -
 -#ifndef _AEAD_API_H
 -#define _AEAD_API_H
@@ -168,7 +161,7 @@
 -#endif /* _AEAD_API_H */
 --- a/net/mac80211/aes_ccm.h
 +++ b/net/mac80211/aes_ccm.h
-@@ -10,39 +10,17 @@
+@@ -7,39 +7,17 @@
  #ifndef AES_CCM_H
  #define AES_CCM_H
  
@@ -333,7 +326,7 @@
 +}
 --- a/net/mac80211/aes_gcm.h
 +++ b/net/mac80211/aes_gcm.h
-@@ -9,38 +9,30 @@
+@@ -6,38 +6,30 @@
  #ifndef AES_GCM_H
  #define AES_GCM_H
  
@@ -385,7 +378,7 @@
  #endif /* AES_GCM_H */
 --- a/net/mac80211/wpa.c
 +++ b/net/mac80211/wpa.c
-@@ -314,7 +314,8 @@ ieee80211_crypto_tkip_decrypt(struct iee
+@@ -311,7 +311,8 @@ ieee80211_crypto_tkip_decrypt(struct iee
  }
  
  
@@ -395,7 +388,7 @@
  {
  	__le16 mask_fc;
  	int a4_included, mgmt;
-@@ -344,14 +345,8 @@ static void ccmp_special_blocks(struct s
+@@ -341,14 +342,8 @@ static void ccmp_special_blocks(struct s
  	else
  		qos_tid = 0;
  
@@ -412,7 +405,7 @@
  
  	/* Nonce: Nonce Flags | A2 | PN
  	 * Nonce Flags: Priority (b0..b3) | Management (b4) | Reserved (b5..b7)
-@@ -359,6 +354,8 @@ static void ccmp_special_blocks(struct s
+@@ -356,6 +351,8 @@ static void ccmp_special_blocks(struct s
  	b_0[1] = qos_tid | (mgmt << 4);
  	memcpy(&b_0[2], hdr->addr2, ETH_ALEN);
  	memcpy(&b_0[8], pn, IEEE80211_CCMP_PN_LEN);
@@ -421,7 +414,7 @@
  
  	/* AAD (extra authenticate-only data) / masked 802.11 header
  	 * FC | A1 | A2 | A3 | SC | [A4] | [QC] */
-@@ -415,7 +412,7 @@ static int ccmp_encrypt_skb(struct ieee8
+@@ -412,7 +409,7 @@ static int ccmp_encrypt_skb(struct ieee8
  	u8 *pos;
  	u8 pn[6];
  	u64 pn64;
@@ -430,7 +423,7 @@
  	u8 b_0[AES_BLOCK_SIZE];
  
  	if (info->control.hw_key &&
-@@ -470,9 +467,11 @@ static int ccmp_encrypt_skb(struct ieee8
+@@ -467,9 +464,11 @@ static int ccmp_encrypt_skb(struct ieee8
  		return 0;
  
  	pos += IEEE80211_CCMP_HDR_LEN;
@@ -445,7 +438,7 @@
  }
  
  
-@@ -545,13 +544,13 @@ ieee80211_crypto_ccmp_decrypt(struct iee
+@@ -542,13 +541,13 @@ ieee80211_crypto_ccmp_decrypt(struct iee
  			u8 aad[2 * AES_BLOCK_SIZE];
  			u8 b_0[AES_BLOCK_SIZE];
  			/* hardware didn't decrypt/verify MIC */
@@ -461,7 +454,7 @@
  				return RX_DROP_UNUSABLE;
  		}
  
-@@ -646,7 +645,7 @@ static int gcmp_encrypt_skb(struct ieee8
+@@ -643,7 +642,7 @@ static int gcmp_encrypt_skb(struct ieee8
  	u8 *pos;
  	u8 pn[6];
  	u64 pn64;
@@ -470,7 +463,7 @@
  	u8 j_0[AES_BLOCK_SIZE];
  
  	if (info->control.hw_key &&
-@@ -703,8 +702,10 @@ static int gcmp_encrypt_skb(struct ieee8
+@@ -700,8 +699,10 @@ static int gcmp_encrypt_skb(struct ieee8
  
  	pos += IEEE80211_GCMP_HDR_LEN;
  	gcmp_special_blocks(skb, pn, j_0, aad);
@@ -483,7 +476,7 @@
  }
  
  ieee80211_tx_result
-@@ -1127,9 +1128,9 @@ ieee80211_crypto_aes_gmac_encrypt(struct
+@@ -1124,9 +1125,9 @@ ieee80211_crypto_aes_gmac_encrypt(struct
  	struct ieee80211_key *key = tx->key;
  	struct ieee80211_mmie_16 *mmie;
  	struct ieee80211_hdr *hdr;
@@ -495,12 +488,12 @@
  
  	if (WARN_ON(skb_queue_len(&tx->skbs) != 1))
  		return TX_DROP;
-@@ -1175,7 +1176,7 @@ ieee80211_crypto_aes_gmac_decrypt(struct
+@@ -1172,7 +1173,7 @@ ieee80211_crypto_aes_gmac_decrypt(struct
  	struct ieee80211_rx_status *status = IEEE80211_SKB_RXCB(skb);
  	struct ieee80211_key *key = rx->key;
  	struct ieee80211_mmie_16 *mmie;
--	u8 aad[GMAC_AAD_LEN], mic[GMAC_MIC_LEN], ipn[6], nonce[GMAC_NONCE_LEN];
-+	u8 aad[20], mic[16], ipn[6], nonce[12];
+-	u8 aad[GMAC_AAD_LEN], *mic, ipn[6], nonce[GMAC_NONCE_LEN];
++	u8 aad[20], *mic, ipn[6], nonce[12];
  	struct ieee80211_hdr *hdr = (struct ieee80211_hdr *)skb->data;
  
  	if (!ieee80211_is_mgmt(hdr->frame_control))
@@ -653,7 +646,7 @@
 +}
 --- a/net/mac80211/Kconfig
 +++ b/net/mac80211/Kconfig
-@@ -5,8 +5,6 @@ config MAC80211
+@@ -6,8 +6,6 @@ config MAC80211
  	depends on CRYPTO
  	depends on CRYPTO_ARC4
  	depends on CRYPTO_AES
@@ -664,7 +657,7 @@
  	---help---
 --- a/net/mac80211/aes_gmac.h
 +++ b/net/mac80211/aes_gmac.h
-@@ -15,10 +15,22 @@
+@@ -12,10 +12,22 @@
  #define GMAC_MIC_LEN	16
  #define GMAC_NONCE_LEN	12
  
@@ -694,7 +687,7 @@
  #endif /* AES_GMAC_H */
 --- a/net/mac80211/key.h
 +++ b/net/mac80211/key.h
-@@ -88,7 +88,7 @@ struct ieee80211_key {
+@@ -86,7 +86,7 @@ struct ieee80211_key {
  			 * Management frames.
  			 */
  			u8 rx_pn[IEEE80211_NUM_TIDS + 1][IEEE80211_CCMP_PN_LEN];
diff --git a/package/kernel/mac80211/patches/subsys/110-mac80211_keep_keys_on_stop_ap.patch b/package/kernel/mac80211/patches/subsys/110-mac80211_keep_keys_on_stop_ap.patch
index 6775884a34..59144f7310 100644
--- a/package/kernel/mac80211/patches/subsys/110-mac80211_keep_keys_on_stop_ap.patch
+++ b/package/kernel/mac80211/patches/subsys/110-mac80211_keep_keys_on_stop_ap.patch
@@ -2,8 +2,8 @@ Used for AP+STA support in OpenWrt - preserve AP mode keys across STA reconnects
 
 --- a/net/mac80211/cfg.c
 +++ b/net/mac80211/cfg.c
-@@ -1067,7 +1067,6 @@ static int ieee80211_stop_ap(struct wiph
- 	sdata->u.ap.driver_smps_mode = IEEE80211_SMPS_OFF;
+@@ -1162,7 +1162,6 @@ static int ieee80211_stop_ap(struct wiph
+ 	sdata->vif.bss_conf.ftmr_params = NULL;
  
  	__sta_info_flush(sdata, true);
 -	ieee80211_free_keys(sdata, true);
diff --git a/package/kernel/mac80211/patches/subsys/120-cfg80211_allow_perm_addr_change.patch b/package/kernel/mac80211/patches/subsys/120-cfg80211_allow_perm_addr_change.patch
index ffd8807ccc..172e5b04fd 100644
--- a/package/kernel/mac80211/patches/subsys/120-cfg80211_allow_perm_addr_change.patch
+++ b/package/kernel/mac80211/patches/subsys/120-cfg80211_allow_perm_addr_change.patch
@@ -1,6 +1,6 @@
 --- a/net/wireless/sysfs.c
 +++ b/net/wireless/sysfs.c
-@@ -24,18 +24,35 @@ static inline struct cfg80211_registered
+@@ -23,18 +23,35 @@ static inline struct cfg80211_registered
  	return container_of(dev, struct cfg80211_registered_device, wiphy.dev);
  }
  
diff --git a/package/kernel/mac80211/patches/subsys/130-disable-fils.patch b/package/kernel/mac80211/patches/subsys/130-disable-fils.patch
index f1163764a0..dd1ccc8597 100644
--- a/package/kernel/mac80211/patches/subsys/130-disable-fils.patch
+++ b/package/kernel/mac80211/patches/subsys/130-disable-fils.patch
@@ -2,7 +2,7 @@ Disable FILS support, since it pulls in crypto hash support
 
 --- a/net/mac80211/fils_aead.h
 +++ b/net/mac80211/fils_aead.h
-@@ -10,7 +10,7 @@
+@@ -7,7 +7,7 @@
  #ifndef FILS_AEAD_H
  #define FILS_AEAD_H
  
@@ -16,9 +16,9 @@ Disable FILS support, since it pulls in crypto hash support
 @@ -1,4 +1,4 @@
 -#if LINUX_VERSION_IS_GEQ(4,3,0)
 +#if 0 /* LINUX_VERSION_IS_GEQ(4,3,0) */
+ // SPDX-License-Identifier: GPL-2.0-only
  /*
   * FILS AEAD for (Re)Association Request/Response frames
-  * Copyright 2016, Qualcomm Atheros, Inc.
 --- a/net/mac80211/main.c
 +++ b/net/mac80211/main.c
 @@ -570,7 +570,7 @@ struct ieee80211_hw *ieee80211_alloc_hw_
diff --git a/package/kernel/mac80211/patches/subsys/131-Revert-mac80211-aes-cmac-switch-to-shash-CMAC-driver.patch b/package/kernel/mac80211/patches/subsys/131-Revert-mac80211-aes-cmac-switch-to-shash-CMAC-driver.patch
index d138b2c5ac..0c5f85236e 100644
--- a/package/kernel/mac80211/patches/subsys/131-Revert-mac80211-aes-cmac-switch-to-shash-CMAC-driver.patch
+++ b/package/kernel/mac80211/patches/subsys/131-Revert-mac80211-aes-cmac-switch-to-shash-CMAC-driver.patch
@@ -11,7 +11,7 @@ Signed-off-by: Felix Fietkau <nbd at nbd.name>
 
 --- a/net/mac80211/aes_cmac.c
 +++ b/net/mac80211/aes_cmac.c
-@@ -22,50 +22,126 @@
+@@ -19,50 +19,126 @@
  #define CMAC_TLEN_256 16 /* CMAC TLen = 128 bits (16 octets) */
  #define AAD_LEN 20
  
@@ -166,7 +166,7 @@ Signed-off-by: Felix Fietkau <nbd at nbd.name>
  }
 --- a/net/mac80211/aes_cmac.h
 +++ b/net/mac80211/aes_cmac.h
-@@ -10,14 +10,13 @@
+@@ -7,14 +7,13 @@
  #define AES_CMAC_H
  
  #include <linux/crypto.h>
@@ -188,7 +188,7 @@ Signed-off-by: Felix Fietkau <nbd at nbd.name>
  #endif /* AES_CMAC_H */
 --- a/net/mac80211/key.h
 +++ b/net/mac80211/key.h
-@@ -93,7 +93,7 @@ struct ieee80211_key {
+@@ -91,7 +91,7 @@ struct ieee80211_key {
  		} ccmp;
  		struct {
  			u8 rx_pn[IEEE80211_CMAC_PN_LEN];
diff --git a/package/kernel/mac80211/patches/subsys/132-mac80211-remove-cmac-dependency.patch b/package/kernel/mac80211/patches/subsys/132-mac80211-remove-cmac-dependency.patch
index 9d185e61e7..a259d5816b 100644
--- a/package/kernel/mac80211/patches/subsys/132-mac80211-remove-cmac-dependency.patch
+++ b/package/kernel/mac80211/patches/subsys/132-mac80211-remove-cmac-dependency.patch
@@ -1,6 +1,6 @@
 --- a/net/mac80211/Kconfig
 +++ b/net/mac80211/Kconfig
-@@ -5,7 +5,6 @@ config MAC80211
+@@ -6,7 +6,6 @@ config MAC80211
  	depends on CRYPTO
  	depends on CRYPTO_ARC4
  	depends on CRYPTO_AES
diff --git a/package/kernel/mac80211/patches/subsys/140-tweak-TSQ-setting.patch b/package/kernel/mac80211/patches/subsys/140-tweak-TSQ-setting.patch
index 42a6382209..449179a962 100644
--- a/package/kernel/mac80211/patches/subsys/140-tweak-TSQ-setting.patch
+++ b/package/kernel/mac80211/patches/subsys/140-tweak-TSQ-setting.patch
@@ -1,6 +1,6 @@
 --- a/net/mac80211/tx.c
 +++ b/net/mac80211/tx.c
-@@ -3797,6 +3797,12 @@ out:
+@@ -4012,6 +4012,12 @@ out:
  netdev_tx_t ieee80211_subif_start_xmit(struct sk_buff *skb,
  				       struct net_device *dev)
  {
diff --git a/package/kernel/mac80211/patches/subsys/150-disable_addr_notifier.patch b/package/kernel/mac80211/patches/subsys/150-disable_addr_notifier.patch
index 1581b3400b..39000e4f05 100644
--- a/package/kernel/mac80211/patches/subsys/150-disable_addr_notifier.patch
+++ b/package/kernel/mac80211/patches/subsys/150-disable_addr_notifier.patch
@@ -1,6 +1,6 @@
 --- a/net/mac80211/main.c
 +++ b/net/mac80211/main.c
-@@ -315,7 +315,7 @@ void ieee80211_restart_hw(struct ieee802
+@@ -313,7 +313,7 @@ void ieee80211_restart_hw(struct ieee802
  }
  EXPORT_SYMBOL(ieee80211_restart_hw);
  
@@ -9,7 +9,7 @@
  static int ieee80211_ifa_changed(struct notifier_block *nb,
  				 unsigned long data, void *arg)
  {
-@@ -374,7 +374,7 @@ static int ieee80211_ifa_changed(struct
+@@ -372,7 +372,7 @@ static int ieee80211_ifa_changed(struct
  }
  #endif
  
@@ -18,7 +18,7 @@
  static int ieee80211_ifa6_changed(struct notifier_block *nb,
  				  unsigned long data, void *arg)
  {
-@@ -1168,14 +1168,14 @@ int ieee80211_register_hw(struct ieee802
+@@ -1269,14 +1269,14 @@ int ieee80211_register_hw(struct ieee802
  
  	rtnl_unlock();
  
@@ -35,7 +35,7 @@
  	local->ifa6_notifier.notifier_call = ieee80211_ifa6_changed;
  	result = register_inet6addr_notifier(&local->ifa6_notifier);
  	if (result)
-@@ -1184,13 +1184,13 @@ int ieee80211_register_hw(struct ieee802
+@@ -1285,13 +1285,13 @@ int ieee80211_register_hw(struct ieee802
  
  	return 0;
  
@@ -52,7 +52,7 @@
   fail_ifa:
  #endif
  	rtnl_lock();
-@@ -1219,10 +1219,10 @@ void ieee80211_unregister_hw(struct ieee
+@@ -1320,10 +1320,10 @@ void ieee80211_unregister_hw(struct ieee
  	tasklet_kill(&local->tx_pending_tasklet);
  	tasklet_kill(&local->tasklet);
  
diff --git a/package/kernel/mac80211/patches/subsys/210-ap_scan.patch b/package/kernel/mac80211/patches/subsys/210-ap_scan.patch
index fcc173da69..7e237a443e 100644
--- a/package/kernel/mac80211/patches/subsys/210-ap_scan.patch
+++ b/package/kernel/mac80211/patches/subsys/210-ap_scan.patch
@@ -1,6 +1,6 @@
 --- a/net/mac80211/cfg.c
 +++ b/net/mac80211/cfg.c
-@@ -2237,7 +2237,7 @@ static int ieee80211_scan(struct wiphy *
+@@ -2312,7 +2312,7 @@ static int ieee80211_scan(struct wiphy *
  		 * the  frames sent while scanning on other channel will be
  		 * lost)
  		 */
diff --git a/package/kernel/mac80211/patches/subsys/300-mac80211-add-stop-start-logic-for-software-TXQs.patch b/package/kernel/mac80211/patches/subsys/300-mac80211-add-stop-start-logic-for-software-TXQs.patch
deleted file mode 100644
index 422e9c2977..0000000000
--- a/package/kernel/mac80211/patches/subsys/300-mac80211-add-stop-start-logic-for-software-TXQs.patch
+++ /dev/null
@@ -1,272 +0,0 @@
-From: Manikanta Pubbisetty <mpubbise at codeaurora.org>
-Date: Wed, 11 Jul 2018 00:12:53 +0530
-Subject: [PATCH] mac80211: add stop/start logic for software TXQs
-
-Sometimes, it is required to stop the transmissions momentarily and
-resume it later; stopping the txqs becomes very critical in scenarios where
-the packet transmission has to be ceased completely. For example, during
-the hardware restart, during off channel operations,
-when initiating CSA(upon detecting a radar on the DFS channel), etc.
-
-The TX queue stop/start logic in mac80211 works well in stopping the TX
-when drivers make use of netdev queues, i.e, when Qdiscs in network layer
-take care of traffic scheduling. Since the devices implementing
-wake_tx_queue can run without Qdiscs, packets will be handed to mac80211
-directly without queueing them in the netdev queues.
-
-Also, mac80211 does not invoke any of the
-netif_stop_*/netif_wake_* APIs if wake_tx_queue is implemented.
-Since the queues are not stopped in this case, transmissions can continue
-and this will impact negatively on the operation of the wireless device.
-
-For example,
-During hardware restart, we stop the netdev queues so that packets are
-not sent to the driver. Since ath10k implements wake_tx_queue,
-TX queues will not be stopped and packets might reach the hardware while
-it is restarting; this can make hardware unresponsive and the only
-possible option for recovery is to reboot the entire system.
-
-There is another problem to this, it is observed that the packets
-were sent on the DFS channel for a prolonged duration after radar
-detection impacting the channel closing time.
-
-We can still invoke netif stop/wake APIs when wake_tx_queue is implemented
-but this could lead to packet drops in network layer; adding stop/start
-logic for software TXQs in mac80211 instead makes more sense; the change
-proposed adds the same in mac80211.
-
-Signed-off-by: Manikanta Pubbisetty <mpubbise at codeaurora.org>
-Signed-off-by: Johannes Berg <johannes.berg at intel.com>
----
-
---- a/include/net/mac80211.h
-+++ b/include/net/mac80211.h
-@@ -1504,6 +1504,8 @@ enum ieee80211_vif_flags {
-  * @drv_priv: data area for driver use, will always be aligned to
-  *	sizeof(void \*).
-  * @txq: the multicast data TX queue (if driver uses the TXQ abstraction)
-+ * @txqs_stopped: per AC flag to indicate that intermediate TXQs are stopped,
-+ *	protected by fq->lock.
-  */
- struct ieee80211_vif {
- 	enum nl80211_iftype type;
-@@ -1528,6 +1530,8 @@ struct ieee80211_vif {
- 
- 	unsigned int probe_req_reg;
- 
-+	bool txqs_stopped[IEEE80211_NUM_ACS];
-+
- 	/* must be last */
- 	u8 drv_priv[0] __aligned(sizeof(void *));
- };
---- a/net/mac80211/ieee80211_i.h
-+++ b/net/mac80211/ieee80211_i.h
-@@ -818,6 +818,7 @@ enum txq_info_flags {
- 	IEEE80211_TXQ_STOP,
- 	IEEE80211_TXQ_AMPDU,
- 	IEEE80211_TXQ_NO_AMSDU,
-+	IEEE80211_TXQ_STOP_NETIF_TX,
- };
- 
- /**
-@@ -1226,6 +1227,7 @@ struct ieee80211_local {
- 
- 	struct sk_buff_head pending[IEEE80211_MAX_QUEUES];
- 	struct tasklet_struct tx_pending_tasklet;
-+	struct tasklet_struct wake_txqs_tasklet;
- 
- 	atomic_t agg_queue_stop[IEEE80211_MAX_QUEUES];
- 
-@@ -2039,6 +2041,7 @@ void ieee80211_txq_remove_vlan(struct ie
- 			       struct ieee80211_sub_if_data *sdata);
- void ieee80211_fill_txq_stats(struct cfg80211_txq_stats *txqstats,
- 			      struct txq_info *txqi);
-+void ieee80211_wake_txqs(unsigned long data);
- void ieee80211_send_auth(struct ieee80211_sub_if_data *sdata,
- 			 u16 transaction, u16 auth_alg, u16 status,
- 			 const u8 *extra, size_t extra_len, const u8 *bssid,
---- a/net/mac80211/main.c
-+++ b/net/mac80211/main.c
-@@ -686,6 +686,10 @@ struct ieee80211_hw *ieee80211_alloc_hw_
- 	tasklet_init(&local->tx_pending_tasklet, ieee80211_tx_pending,
- 		     (unsigned long)local);
- 
-+	if (ops->wake_tx_queue)
-+		tasklet_init(&local->wake_txqs_tasklet, ieee80211_wake_txqs,
-+			     (unsigned long)local);
-+
- 	tasklet_init(&local->tasklet,
- 		     ieee80211_tasklet_handler,
- 		     (unsigned long) local);
---- a/net/mac80211/tx.c
-+++ b/net/mac80211/tx.c
-@@ -3482,13 +3482,19 @@ struct sk_buff *ieee80211_tx_dequeue(str
- 	struct ieee80211_tx_info *info;
- 	struct ieee80211_tx_data tx;
- 	ieee80211_tx_result r;
--	struct ieee80211_vif *vif;
-+	struct ieee80211_vif *vif = txq->vif;
- 
- 	spin_lock_bh(&fq->lock);
- 
--	if (test_bit(IEEE80211_TXQ_STOP, &txqi->flags))
-+	if (test_bit(IEEE80211_TXQ_STOP, &txqi->flags) ||
-+	    test_bit(IEEE80211_TXQ_STOP_NETIF_TX, &txqi->flags))
- 		goto out;
- 
-+	if (vif->txqs_stopped[ieee80211_ac_from_tid(txq->tid)]) {
-+		set_bit(IEEE80211_TXQ_STOP_NETIF_TX, &txqi->flags);
-+		goto out;
-+	}
-+
- 	/* Make sure fragments stay together. */
- 	skb = __skb_dequeue(&txqi->frags);
- 	if (skb)
-@@ -3583,6 +3589,7 @@ begin:
- 	}
- 
- 	IEEE80211_SKB_CB(skb)->control.vif = vif;
-+
- out:
- 	spin_unlock_bh(&fq->lock);
- 
---- a/net/mac80211/util.c
-+++ b/net/mac80211/util.c
-@@ -240,6 +240,99 @@ __le16 ieee80211_ctstoself_duration(stru
- }
- EXPORT_SYMBOL(ieee80211_ctstoself_duration);
- 
-+static void __ieee80211_wake_txqs(struct ieee80211_sub_if_data *sdata, int ac)
-+{
-+	struct ieee80211_local *local = sdata->local;
-+	struct ieee80211_vif *vif = &sdata->vif;
-+	struct fq *fq = &local->fq;
-+	struct ps_data *ps = NULL;
-+	struct txq_info *txqi;
-+	struct sta_info *sta;
-+	int i;
-+
-+	spin_lock_bh(&fq->lock);
-+
-+	if (sdata->vif.type == NL80211_IFTYPE_AP)
-+		ps = &sdata->bss->ps;
-+
-+	sdata->vif.txqs_stopped[ac] = false;
-+
-+	list_for_each_entry_rcu(sta, &local->sta_list, list) {
-+		if (sdata != sta->sdata)
-+			continue;
-+
-+		for (i = 0; i < ARRAY_SIZE(sta->sta.txq); i++) {
-+			struct ieee80211_txq *txq = sta->sta.txq[i];
-+
-+			txqi = to_txq_info(txq);
-+
-+			if (ac != txq->ac)
-+				continue;
-+
-+			if (!test_and_clear_bit(IEEE80211_TXQ_STOP_NETIF_TX,
-+						&txqi->flags))
-+				continue;
-+
-+			spin_unlock_bh(&fq->lock);
-+			drv_wake_tx_queue(local, txqi);
-+			spin_lock_bh(&fq->lock);
-+		}
-+	}
-+
-+	if (!vif->txq)
-+		goto out;
-+
-+	txqi = to_txq_info(vif->txq);
-+
-+	if (!test_and_clear_bit(IEEE80211_TXQ_STOP_NETIF_TX, &txqi->flags) ||
-+	    (ps && atomic_read(&ps->num_sta_ps)) || ac != vif->txq->ac)
-+		goto out;
-+
-+	spin_unlock_bh(&fq->lock);
-+
-+	drv_wake_tx_queue(local, txqi);
-+	return;
-+out:
-+	spin_unlock_bh(&fq->lock);
-+}
-+
-+void ieee80211_wake_txqs(unsigned long data)
-+{
-+	struct ieee80211_local *local = (struct ieee80211_local *)data;
-+	struct ieee80211_sub_if_data *sdata;
-+	int n_acs = IEEE80211_NUM_ACS;
-+	unsigned long flags;
-+	int i;
-+
-+	rcu_read_lock();
-+	spin_lock_irqsave(&local->queue_stop_reason_lock, flags);
-+
-+	if (local->hw.queues < IEEE80211_NUM_ACS)
-+		n_acs = 1;
-+
-+	for (i = 0; i < local->hw.queues; i++) {
-+		if (local->queue_stop_reasons[i])
-+			continue;
-+
-+		spin_unlock_irqrestore(&local->queue_stop_reason_lock, flags);
-+		list_for_each_entry_rcu(sdata, &local->interfaces, list) {
-+			int ac;
-+
-+			for (ac = 0; ac < n_acs; ac++) {
-+				int ac_queue = sdata->vif.hw_queue[ac];
-+
-+				if (ac_queue == i ||
-+				    sdata->vif.cab_queue == i)
-+					__ieee80211_wake_txqs(sdata, ac);
-+			}
-+		}
-+		spin_lock_irqsave(&local->queue_stop_reason_lock, flags);
-+	}
-+
-+	spin_unlock_irqrestore(&local->queue_stop_reason_lock, flags);
-+	rcu_read_unlock();
-+}
-+
- void ieee80211_propagate_queue_wake(struct ieee80211_local *local, int queue)
- {
- 	struct ieee80211_sub_if_data *sdata;
-@@ -308,6 +401,9 @@ static void __ieee80211_wake_queue(struc
- 		rcu_read_unlock();
- 	} else
- 		tasklet_schedule(&local->tx_pending_tasklet);
-+
-+	if (local->ops->wake_tx_queue)
-+		tasklet_schedule(&local->wake_txqs_tasklet);
- }
- 
- void ieee80211_wake_queue_by_reason(struct ieee80211_hw *hw, int queue,
-@@ -351,9 +447,6 @@ static void __ieee80211_stop_queue(struc
- 	if (__test_and_set_bit(reason, &local->queue_stop_reasons[queue]))
- 		return;
- 
--	if (local->ops->wake_tx_queue)
--		return;
--
- 	if (local->hw.queues < IEEE80211_NUM_ACS)
- 		n_acs = 1;
- 
-@@ -366,8 +459,15 @@ static void __ieee80211_stop_queue(struc
- 
- 		for (ac = 0; ac < n_acs; ac++) {
- 			if (sdata->vif.hw_queue[ac] == queue ||
--			    sdata->vif.cab_queue == queue)
--				netif_stop_subqueue(sdata->dev, ac);
-+			    sdata->vif.cab_queue == queue) {
-+				if (!local->ops->wake_tx_queue) {
-+					netif_stop_subqueue(sdata->dev, ac);
-+					continue;
-+				}
-+				spin_lock(&local->fq.lock);
-+				sdata->vif.txqs_stopped[ac] = true;
-+				spin_unlock(&local->fq.lock);
-+			}
- 		}
- 	}
- 	rcu_read_unlock();
diff --git a/package/kernel/mac80211/patches/subsys/301-mac80211-do-not-call-driver-wake_tx_queue-op-during-.patch b/package/kernel/mac80211/patches/subsys/301-mac80211-do-not-call-driver-wake_tx_queue-op-during-.patch
deleted file mode 100644
index 5bbf4db23b..0000000000
--- a/package/kernel/mac80211/patches/subsys/301-mac80211-do-not-call-driver-wake_tx_queue-op-during-.patch
+++ /dev/null
@@ -1,33 +0,0 @@
-From: Felix Fietkau <nbd at nbd.name>
-Date: Fri, 1 Mar 2019 14:42:56 +0100
-Subject: [PATCH] mac80211: do not call driver wake_tx_queue op during reconfig
-
-There are several scenarios in which mac80211 can call drv_wake_tx_queue
-after ieee80211_restart_hw has been called and has not yet completed.
-Driver private structs are considered uninitialized until mac80211 has
-uploaded the vifs, stations and keys again, so using private tx queue
-data during that time is not safe.
-
-The driver can also not rely on drv_reconfig_complete to figure out when
-it is safe to accept drv_wake_tx_queue calls again, because it is only
-called after all tx queues are woken again.
-
-To fix this, bail out early in drv_wake_tx_queue if local->in_reconfig
-is set.
-
-Cc: stable at vger.kernel.org
-Signed-off-by: Felix Fietkau <nbd at nbd.name>
----
-
---- a/net/mac80211/driver-ops.h
-+++ b/net/mac80211/driver-ops.h
-@@ -1166,6 +1166,9 @@ static inline void drv_wake_tx_queue(str
- {
- 	struct ieee80211_sub_if_data *sdata = vif_to_sdata(txq->txq.vif);
- 
-+	if (local->in_reconfig)
-+		return;
-+
- 	if (!check_sdata_in_driver(sdata))
- 		return;
- 
diff --git a/package/kernel/mac80211/patches/subsys/303-mac80211-minstrel-Enable-STBC-and-LDPC-for-VHT-Rates.patch b/package/kernel/mac80211/patches/subsys/303-mac80211-minstrel-Enable-STBC-and-LDPC-for-VHT-Rates.patch
deleted file mode 100644
index 661fb46ea4..0000000000
--- a/package/kernel/mac80211/patches/subsys/303-mac80211-minstrel-Enable-STBC-and-LDPC-for-VHT-Rates.patch
+++ /dev/null
@@ -1,82 +0,0 @@
-From: Chaitanya T K <chaitanya.mgit at gmail.com>
-Date: Mon, 27 Jun 2016 15:23:26 +0530
-Subject: [PATCH] mac80211: minstrel: Enable STBC and LDPC for VHT Rates
-
-If peer support reception of STBC and LDPC, enable them for better
-performance.
-
-Signed-off-by: Chaitanya TK <chaitanya.mgit at gmail.com>
----
-
---- a/include/linux/ieee80211.h
-+++ b/include/linux/ieee80211.h
-@@ -1659,6 +1659,7 @@ struct ieee80211_mu_edca_param_set {
- #define IEEE80211_VHT_CAP_RXSTBC_3				0x00000300
- #define IEEE80211_VHT_CAP_RXSTBC_4				0x00000400
- #define IEEE80211_VHT_CAP_RXSTBC_MASK				0x00000700
-+#define IEEE80211_VHT_CAP_RXSTBC_SHIFT				8
- #define IEEE80211_VHT_CAP_SU_BEAMFORMER_CAPABLE			0x00000800
- #define IEEE80211_VHT_CAP_SU_BEAMFORMEE_CAPABLE			0x00001000
- #define IEEE80211_VHT_CAP_BEAMFORMEE_STS_SHIFT                  13
---- a/net/mac80211/rc80211_minstrel_ht.c
-+++ b/net/mac80211/rc80211_minstrel_ht.c
-@@ -1130,7 +1130,7 @@ minstrel_ht_update_caps(void *priv, stru
- 	struct minstrel_ht_sta_priv *msp = priv_sta;
- 	struct minstrel_ht_sta *mi = &msp->ht;
- 	struct ieee80211_mcs_info *mcs = &sta->ht_cap.mcs;
--	u16 sta_cap = sta->ht_cap.cap;
-+	u16 ht_cap = sta->ht_cap.cap;
- 	struct ieee80211_sta_vht_cap *vht_cap = &sta->vht_cap;
- 	struct sta_info *sinfo = container_of(sta, struct sta_info, sta);
- 	int use_vht;
-@@ -1138,6 +1138,7 @@ minstrel_ht_update_caps(void *priv, stru
- 	int ack_dur;
- 	int stbc;
- 	int i;
-+	bool ldpc = false;
- 
- 	/* fall back to the old minstrel for legacy stations */
- 	if (!sta->ht_cap.ht_supported)
-@@ -1175,16 +1176,24 @@ minstrel_ht_update_caps(void *priv, stru
- 	}
- 	mi->sample_tries = 4;
- 
--	/* TODO tx_flags for vht - ATM the RC API is not fine-grained enough */
- 	if (!use_vht) {
--		stbc = (sta_cap & IEEE80211_HT_CAP_RX_STBC) >>
-+		stbc = (ht_cap & IEEE80211_HT_CAP_RX_STBC) >>
- 			IEEE80211_HT_CAP_RX_STBC_SHIFT;
--		mi->tx_flags |= stbc << IEEE80211_TX_CTL_STBC_SHIFT;
- 
--		if (sta_cap & IEEE80211_HT_CAP_LDPC_CODING)
--			mi->tx_flags |= IEEE80211_TX_CTL_LDPC;
-+		if (ht_cap & IEEE80211_HT_CAP_LDPC_CODING)
-+			ldpc = true;
-+	} else {
-+		stbc = (vht_cap->cap & IEEE80211_VHT_CAP_RXSTBC_MASK) >>
-+			IEEE80211_VHT_CAP_RXSTBC_SHIFT;
-+
-+		if (vht_cap->cap & IEEE80211_VHT_CAP_RXLDPC)
-+			ldpc = true;
- 	}
- 
-+	mi->tx_flags |= stbc << IEEE80211_TX_CTL_STBC_SHIFT;
-+	if (ldpc)
-+		mi->tx_flags |= IEEE80211_TX_CTL_LDPC;
-+
- 	for (i = 0; i < ARRAY_SIZE(mi->groups); i++) {
- 		u32 gflags = minstrel_mcs_groups[i].flags;
- 		int bw, nss;
-@@ -1197,10 +1206,10 @@ minstrel_ht_update_caps(void *priv, stru
- 
- 		if (gflags & IEEE80211_TX_RC_SHORT_GI) {
- 			if (gflags & IEEE80211_TX_RC_40_MHZ_WIDTH) {
--				if (!(sta_cap & IEEE80211_HT_CAP_SGI_40))
-+				if (!(ht_cap & IEEE80211_HT_CAP_SGI_40))
- 					continue;
- 			} else {
--				if (!(sta_cap & IEEE80211_HT_CAP_SGI_20))
-+				if (!(ht_cap & IEEE80211_HT_CAP_SGI_20))
- 					continue;
- 			}
- 		}
diff --git a/package/kernel/mac80211/patches/subsys/304-mac80211-minstrel-remove-unnecessary-debugfs-cleanup.patch b/package/kernel/mac80211/patches/subsys/304-mac80211-minstrel-remove-unnecessary-debugfs-cleanup.patch
deleted file mode 100644
index 95d4f294aa..0000000000
--- a/package/kernel/mac80211/patches/subsys/304-mac80211-minstrel-remove-unnecessary-debugfs-cleanup.patch
+++ /dev/null
@@ -1,150 +0,0 @@
-From: Felix Fietkau <nbd at nbd.name>
-Date: Sat, 10 Feb 2018 12:41:51 +0100
-Subject: [PATCH] mac80211: minstrel: remove unnecessary debugfs cleanup
- code
-
-debugfs entries are cleaned up by debugfs_remove_recursive already.
-
-Signed-off-by: Felix Fietkau <nbd at nbd.name>
----
-
---- a/net/mac80211/rc80211_minstrel.c
-+++ b/net/mac80211/rc80211_minstrel.c
-@@ -689,8 +689,8 @@ minstrel_alloc(struct ieee80211_hw *hw,
- 
- #ifdef CPTCFG_MAC80211_DEBUGFS
- 	mp->fixed_rate_idx = (u32) -1;
--	mp->dbg_fixed_rate = debugfs_create_u32("fixed_rate_idx",
--			0666, debugfsdir, &mp->fixed_rate_idx);
-+	debugfs_create_u32("fixed_rate_idx", S_IRUGO | S_IWUGO, debugfsdir,
-+			   &mp->fixed_rate_idx);
- #endif
- 
- 	minstrel_init_cck_rates(mp);
-@@ -701,9 +701,6 @@ minstrel_alloc(struct ieee80211_hw *hw,
- static void
- minstrel_free(void *priv)
- {
--#ifdef CPTCFG_MAC80211_DEBUGFS
--	debugfs_remove(((struct minstrel_priv *)priv)->dbg_fixed_rate);
--#endif
- 	kfree(priv);
- }
- 
-@@ -735,7 +732,6 @@ const struct rate_control_ops mac80211_m
- 	.free_sta = minstrel_free_sta,
- #ifdef CPTCFG_MAC80211_DEBUGFS
- 	.add_sta_debugfs = minstrel_add_sta_debugfs,
--	.remove_sta_debugfs = minstrel_remove_sta_debugfs,
- #endif
- 	.get_expected_throughput = minstrel_get_expected_throughput,
- };
---- a/net/mac80211/rc80211_minstrel.h
-+++ b/net/mac80211/rc80211_minstrel.h
-@@ -109,11 +109,6 @@ struct minstrel_sta_info {
- 
- 	/* sampling table */
- 	u8 *sample_table;
--
--#ifdef CPTCFG_MAC80211_DEBUGFS
--	struct dentry *dbg_stats;
--	struct dentry *dbg_stats_csv;
--#endif
- };
- 
- struct minstrel_priv {
-@@ -137,7 +132,6 @@ struct minstrel_priv {
- 	 *   - setting will be applied on next update
- 	 */
- 	u32 fixed_rate_idx;
--	struct dentry *dbg_fixed_rate;
- #endif
- };
- 
-@@ -156,7 +150,6 @@ minstrel_get_ewmsd10(struct minstrel_rat
- 
- extern const struct rate_control_ops mac80211_minstrel;
- void minstrel_add_sta_debugfs(void *priv, void *priv_sta, struct dentry *dir);
--void minstrel_remove_sta_debugfs(void *priv, void *priv_sta);
- 
- /* Recalculate success probabilities and counters for a given rate using EWMA */
- void minstrel_calc_rate_stats(struct minstrel_rate_stats *mrs);
---- a/net/mac80211/rc80211_minstrel_debugfs.c
-+++ b/net/mac80211/rc80211_minstrel_debugfs.c
-@@ -214,19 +214,7 @@ minstrel_add_sta_debugfs(void *priv, voi
- {
- 	struct minstrel_sta_info *mi = priv_sta;
- 
--	mi->dbg_stats = debugfs_create_file("rc_stats", 0444, dir, mi,
--					    &minstrel_stat_fops);
--
--	mi->dbg_stats_csv = debugfs_create_file("rc_stats_csv", 0444, dir, mi,
--						&minstrel_stat_csv_fops);
--}
--
--void
--minstrel_remove_sta_debugfs(void *priv, void *priv_sta)
--{
--	struct minstrel_sta_info *mi = priv_sta;
--
--	debugfs_remove(mi->dbg_stats);
--
--	debugfs_remove(mi->dbg_stats_csv);
-+	debugfs_create_file("rc_stats", S_IRUGO, dir, mi, &minstrel_stat_fops);
-+	debugfs_create_file("rc_stats_csv", S_IRUGO, dir, mi,
-+			    &minstrel_stat_csv_fops);
- }
---- a/net/mac80211/rc80211_minstrel_ht.c
-+++ b/net/mac80211/rc80211_minstrel_ht.c
-@@ -1393,7 +1393,6 @@ static const struct rate_control_ops mac
- 	.free = minstrel_ht_free,
- #ifdef CPTCFG_MAC80211_DEBUGFS
- 	.add_sta_debugfs = minstrel_ht_add_sta_debugfs,
--	.remove_sta_debugfs = minstrel_ht_remove_sta_debugfs,
- #endif
- 	.get_expected_throughput = minstrel_ht_get_expected_throughput,
- };
---- a/net/mac80211/rc80211_minstrel_ht.h
-+++ b/net/mac80211/rc80211_minstrel_ht.h
-@@ -110,17 +110,12 @@ struct minstrel_ht_sta_priv {
- 		struct minstrel_ht_sta ht;
- 		struct minstrel_sta_info legacy;
- 	};
--#ifdef CPTCFG_MAC80211_DEBUGFS
--	struct dentry *dbg_stats;
--	struct dentry *dbg_stats_csv;
--#endif
- 	void *ratelist;
- 	void *sample_table;
- 	bool is_ht;
- };
- 
- void minstrel_ht_add_sta_debugfs(void *priv, void *priv_sta, struct dentry *dir);
--void minstrel_ht_remove_sta_debugfs(void *priv, void *priv_sta);
- int minstrel_ht_get_tp_avg(struct minstrel_ht_sta *mi, int group, int rate,
- 			   int prob_ewma);
- 
---- a/net/mac80211/rc80211_minstrel_ht_debugfs.c
-+++ b/net/mac80211/rc80211_minstrel_ht_debugfs.c
-@@ -303,17 +303,8 @@ minstrel_ht_add_sta_debugfs(void *priv,
- {
- 	struct minstrel_ht_sta_priv *msp = priv_sta;
- 
--	msp->dbg_stats = debugfs_create_file("rc_stats", 0444, dir, msp,
--					     &minstrel_ht_stat_fops);
--	msp->dbg_stats_csv = debugfs_create_file("rc_stats_csv", 0444, dir, msp,
--						 &minstrel_ht_stat_csv_fops);
--}
--
--void
--minstrel_ht_remove_sta_debugfs(void *priv, void *priv_sta)
--{
--	struct minstrel_ht_sta_priv *msp = priv_sta;
--
--	debugfs_remove(msp->dbg_stats);
--	debugfs_remove(msp->dbg_stats_csv);
-+	debugfs_create_file("rc_stats", S_IRUGO, dir, msp,
-+			    &minstrel_ht_stat_fops);
-+	debugfs_create_file("rc_stats_csv", S_IRUGO, dir, msp,
-+			    &minstrel_ht_stat_csv_fops);
- }
diff --git a/package/kernel/mac80211/patches/subsys/305-mac80211-minstrel-merge-with-minstrel_ht-always-enab.patch b/package/kernel/mac80211/patches/subsys/305-mac80211-minstrel-merge-with-minstrel_ht-always-enab.patch
deleted file mode 100644
index 9a233753ad..0000000000
--- a/package/kernel/mac80211/patches/subsys/305-mac80211-minstrel-merge-with-minstrel_ht-always-enab.patch
+++ /dev/null
@@ -1,575 +0,0 @@
-From: Felix Fietkau <nbd at nbd.name>
-Date: Sat, 10 Feb 2018 12:43:30 +0100
-Subject: [PATCH] mac80211: minstrel: merge with minstrel_ht, always enable
- VHT support
-
-Legacy-only devices are not very common and the overhead of the extra
-code for HT and VHT rates is not big enough to justify all those extra
-lines of code to make it optional.
-
-Signed-off-by: Felix Fietkau <nbd at nbd.name>
----
-
---- a/net/mac80211/Kconfig
-+++ b/net/mac80211/Kconfig
-@@ -25,20 +25,6 @@ config MAC80211_RC_MINSTREL
- 	---help---
- 	  This option enables the 'minstrel' TX rate control algorithm
- 
--config MAC80211_RC_MINSTREL_HT
--	bool "Minstrel 802.11n support" if EXPERT
--	depends on MAC80211_RC_MINSTREL
--	default y
--	---help---
--	  This option enables the 'minstrel_ht' TX rate control algorithm
--
--config MAC80211_RC_MINSTREL_VHT
--	bool "Minstrel 802.11ac support" if EXPERT
--	depends on MAC80211_RC_MINSTREL_HT
--	default n
--	---help---
--	  This option enables VHT in the 'minstrel_ht' TX rate control algorithm
--
- choice
- 	prompt "Default rate control algorithm"
- 	depends on MAC80211_HAS_RC
-@@ -60,8 +46,7 @@ endchoice
- 
- config MAC80211_RC_DEFAULT
- 	string
--	default "minstrel_ht" if MAC80211_RC_DEFAULT_MINSTREL && MAC80211_RC_MINSTREL_HT
--	default "minstrel" if MAC80211_RC_DEFAULT_MINSTREL
-+	default "minstrel_ht" if MAC80211_RC_DEFAULT_MINSTREL
- 	default ""
- 
- endif
---- a/net/mac80211/Makefile
-+++ b/net/mac80211/Makefile
-@@ -52,13 +52,14 @@ mac80211-$(CONFIG_PM) += pm.o
- 
- CFLAGS_trace.o := -I$(src)
- 
--rc80211_minstrel-y := rc80211_minstrel.o
--rc80211_minstrel-$(CPTCFG_MAC80211_DEBUGFS) += rc80211_minstrel_debugfs.o
-+rc80211_minstrel-y := \
-+	rc80211_minstrel.o \
-+	rc80211_minstrel_ht.o
- 
--rc80211_minstrel_ht-y := rc80211_minstrel_ht.o
--rc80211_minstrel_ht-$(CPTCFG_MAC80211_DEBUGFS) += rc80211_minstrel_ht_debugfs.o
-+rc80211_minstrel-$(CPTCFG_MAC80211_DEBUGFS) += \
-+	rc80211_minstrel_debugfs.o \
-+	rc80211_minstrel_ht_debugfs.o
- 
- mac80211-$(CPTCFG_MAC80211_RC_MINSTREL) += $(rc80211_minstrel-y)
--mac80211-$(CPTCFG_MAC80211_RC_MINSTREL_HT) += $(rc80211_minstrel_ht-y)
- 
- ccflags-y += -DDEBUG
---- a/net/mac80211/main.c
-+++ b/net/mac80211/main.c
-@@ -1308,18 +1308,12 @@ static int __init ieee80211_init(void)
- 	if (ret)
- 		return ret;
- 
--	ret = rc80211_minstrel_ht_init();
--	if (ret)
--		goto err_minstrel;
--
- 	ret = ieee80211_iface_init();
- 	if (ret)
- 		goto err_netdev;
- 
- 	return 0;
-  err_netdev:
--	rc80211_minstrel_ht_exit();
-- err_minstrel:
- 	rc80211_minstrel_exit();
- 
- 	return ret;
-@@ -1327,7 +1321,6 @@ static int __init ieee80211_init(void)
- 
- static void __exit ieee80211_exit(void)
- {
--	rc80211_minstrel_ht_exit();
- 	rc80211_minstrel_exit();
- 
- 	ieee80211s_stop();
---- a/net/mac80211/rate.h
-+++ b/net/mac80211/rate.h
-@@ -95,18 +95,5 @@ static inline void rc80211_minstrel_exit
- }
- #endif
- 
--#ifdef CPTCFG_MAC80211_RC_MINSTREL_HT
--int rc80211_minstrel_ht_init(void);
--void rc80211_minstrel_ht_exit(void);
--#else
--static inline int rc80211_minstrel_ht_init(void)
--{
--	return 0;
--}
--static inline void rc80211_minstrel_ht_exit(void)
--{
--}
--#endif
--
- 
- #endif /* IEEE80211_RATE_H */
---- a/net/mac80211/rc80211_minstrel.c
-+++ b/net/mac80211/rc80211_minstrel.c
-@@ -572,138 +572,6 @@ minstrel_rate_init(void *priv, struct ie
- 	minstrel_update_rates(mp, mi);
- }
- 
--static void *
--minstrel_alloc_sta(void *priv, struct ieee80211_sta *sta, gfp_t gfp)
--{
--	struct ieee80211_supported_band *sband;
--	struct minstrel_sta_info *mi;
--	struct minstrel_priv *mp = priv;
--	struct ieee80211_hw *hw = mp->hw;
--	int max_rates = 0;
--	int i;
--
--	mi = kzalloc(sizeof(struct minstrel_sta_info), gfp);
--	if (!mi)
--		return NULL;
--
--	for (i = 0; i < NUM_NL80211_BANDS; i++) {
--		sband = hw->wiphy->bands[i];
--		if (sband && sband->n_bitrates > max_rates)
--			max_rates = sband->n_bitrates;
--	}
--
--	mi->r = kcalloc(max_rates, sizeof(struct minstrel_rate), gfp);
--	if (!mi->r)
--		goto error;
--
--	mi->sample_table = kmalloc_array(max_rates, SAMPLE_COLUMNS, gfp);
--	if (!mi->sample_table)
--		goto error1;
--
--	mi->last_stats_update = jiffies;
--	return mi;
--
--error1:
--	kfree(mi->r);
--error:
--	kfree(mi);
--	return NULL;
--}
--
--static void
--minstrel_free_sta(void *priv, struct ieee80211_sta *sta, void *priv_sta)
--{
--	struct minstrel_sta_info *mi = priv_sta;
--
--	kfree(mi->sample_table);
--	kfree(mi->r);
--	kfree(mi);
--}
--
--static void
--minstrel_init_cck_rates(struct minstrel_priv *mp)
--{
--	static const int bitrates[4] = { 10, 20, 55, 110 };
--	struct ieee80211_supported_band *sband;
--	u32 rate_flags = ieee80211_chandef_rate_flags(&mp->hw->conf.chandef);
--	int i, j;
--
--	sband = mp->hw->wiphy->bands[NL80211_BAND_2GHZ];
--	if (!sband)
--		return;
--
--	for (i = 0, j = 0; i < sband->n_bitrates; i++) {
--		struct ieee80211_rate *rate = &sband->bitrates[i];
--
--		if (rate->flags & IEEE80211_RATE_ERP_G)
--			continue;
--
--		if ((rate_flags & sband->bitrates[i].flags) != rate_flags)
--			continue;
--
--		for (j = 0; j < ARRAY_SIZE(bitrates); j++) {
--			if (rate->bitrate != bitrates[j])
--				continue;
--
--			mp->cck_rates[j] = i;
--			break;
--		}
--	}
--}
--
--static void *
--minstrel_alloc(struct ieee80211_hw *hw, struct dentry *debugfsdir)
--{
--	struct minstrel_priv *mp;
--
--	mp = kzalloc(sizeof(struct minstrel_priv), GFP_ATOMIC);
--	if (!mp)
--		return NULL;
--
--	/* contention window settings
--	 * Just an approximation. Using the per-queue values would complicate
--	 * the calculations and is probably unnecessary */
--	mp->cw_min = 15;
--	mp->cw_max = 1023;
--
--	/* number of packets (in %) to use for sampling other rates
--	 * sample less often for non-mrr packets, because the overhead
--	 * is much higher than with mrr */
--	mp->lookaround_rate = 5;
--	mp->lookaround_rate_mrr = 10;
--
--	/* maximum time that the hw is allowed to stay in one MRR segment */
--	mp->segment_size = 6000;
--
--	if (hw->max_rate_tries > 0)
--		mp->max_retry = hw->max_rate_tries;
--	else
--		/* safe default, does not necessarily have to match hw properties */
--		mp->max_retry = 7;
--
--	if (hw->max_rates >= 4)
--		mp->has_mrr = true;
--
--	mp->hw = hw;
--	mp->update_interval = 100;
--
--#ifdef CPTCFG_MAC80211_DEBUGFS
--	mp->fixed_rate_idx = (u32) -1;
--	debugfs_create_u32("fixed_rate_idx", S_IRUGO | S_IWUGO, debugfsdir,
--			   &mp->fixed_rate_idx);
--#endif
--
--	minstrel_init_cck_rates(mp);
--
--	return mp;
--}
--
--static void
--minstrel_free(void *priv)
--{
--	kfree(priv);
--}
--
- static u32 minstrel_get_expected_throughput(void *priv_sta)
- {
- 	struct minstrel_sta_info *mi = priv_sta;
-@@ -722,28 +590,8 @@ static u32 minstrel_get_expected_through
- }
- 
- const struct rate_control_ops mac80211_minstrel = {
--	.name = "minstrel",
- 	.tx_status_ext = minstrel_tx_status,
- 	.get_rate = minstrel_get_rate,
- 	.rate_init = minstrel_rate_init,
--	.alloc = minstrel_alloc,
--	.free = minstrel_free,
--	.alloc_sta = minstrel_alloc_sta,
--	.free_sta = minstrel_free_sta,
--#ifdef CPTCFG_MAC80211_DEBUGFS
--	.add_sta_debugfs = minstrel_add_sta_debugfs,
--#endif
- 	.get_expected_throughput = minstrel_get_expected_throughput,
- };
--
--int __init
--rc80211_minstrel_init(void)
--{
--	return ieee80211_rate_control_register(&mac80211_minstrel);
--}
--
--void
--rc80211_minstrel_exit(void)
--{
--	ieee80211_rate_control_unregister(&mac80211_minstrel);
--}
---- a/net/mac80211/rc80211_minstrel.h
-+++ b/net/mac80211/rc80211_minstrel.h
-@@ -158,7 +158,5 @@ int minstrel_get_tp_avg(struct minstrel_
- /* debugfs */
- int minstrel_stats_open(struct inode *inode, struct file *file);
- int minstrel_stats_csv_open(struct inode *inode, struct file *file);
--ssize_t minstrel_stats_read(struct file *file, char __user *buf, size_t len, loff_t *ppos);
--int minstrel_stats_release(struct inode *inode, struct file *file);
- 
- #endif
---- a/net/mac80211/rc80211_minstrel_debugfs.c
-+++ b/net/mac80211/rc80211_minstrel_debugfs.c
-@@ -54,22 +54,6 @@
- #include <net/mac80211.h>
- #include "rc80211_minstrel.h"
- 
--ssize_t
--minstrel_stats_read(struct file *file, char __user *buf, size_t len, loff_t *ppos)
--{
--	struct minstrel_debugfs_info *ms;
--
--	ms = file->private_data;
--	return simple_read_from_buffer(buf, len, ppos, ms->buf, ms->len);
--}
--
--int
--minstrel_stats_release(struct inode *inode, struct file *file)
--{
--	kfree(file->private_data);
--	return 0;
--}
--
- int
- minstrel_stats_open(struct inode *inode, struct file *file)
- {
-@@ -135,14 +119,6 @@ minstrel_stats_open(struct inode *inode,
- 	return 0;
- }
- 
--static const struct file_operations minstrel_stat_fops = {
--	.owner = THIS_MODULE,
--	.open = minstrel_stats_open,
--	.read = minstrel_stats_read,
--	.release = minstrel_stats_release,
--	.llseek = default_llseek,
--};
--
- int
- minstrel_stats_csv_open(struct inode *inode, struct file *file)
- {
-@@ -200,21 +176,3 @@ minstrel_stats_csv_open(struct inode *in
- 
- 	return 0;
- }
--
--static const struct file_operations minstrel_stat_csv_fops = {
--	.owner = THIS_MODULE,
--	.open = minstrel_stats_csv_open,
--	.read = minstrel_stats_read,
--	.release = minstrel_stats_release,
--	.llseek = default_llseek,
--};
--
--void
--minstrel_add_sta_debugfs(void *priv, void *priv_sta, struct dentry *dir)
--{
--	struct minstrel_sta_info *mi = priv_sta;
--
--	debugfs_create_file("rc_stats", S_IRUGO, dir, mi, &minstrel_stat_fops);
--	debugfs_create_file("rc_stats_csv", S_IRUGO, dir, mi,
--			    &minstrel_stat_csv_fops);
--}
---- a/net/mac80211/rc80211_minstrel_ht.c
-+++ b/net/mac80211/rc80211_minstrel_ht.c
-@@ -137,12 +137,10 @@
- 		}					\
- 	}
- 
--#ifdef CPTCFG_MAC80211_RC_MINSTREL_VHT
- static bool minstrel_vht_only = true;
- module_param(minstrel_vht_only, bool, 0644);
- MODULE_PARM_DESC(minstrel_vht_only,
- 		 "Use only VHT rates when VHT is supported by sta.");
--#endif
- 
- /*
-  * To enable sufficiently targeted rate sampling, MCS rates are divided into
-@@ -171,7 +169,6 @@ const struct mcs_group minstrel_mcs_grou
- 
- 	CCK_GROUP,
- 
--#ifdef CPTCFG_MAC80211_RC_MINSTREL_VHT
- 	VHT_GROUP(1, 0, BW_20),
- 	VHT_GROUP(2, 0, BW_20),
- 	VHT_GROUP(3, 0, BW_20),
-@@ -195,7 +192,6 @@ const struct mcs_group minstrel_mcs_grou
- 	VHT_GROUP(1, 1, BW_80),
- 	VHT_GROUP(2, 1, BW_80),
- 	VHT_GROUP(3, 1, BW_80),
--#endif
- };
- 
- static u8 sample_table[SAMPLE_COLUMNS][MCS_GROUP_RATES] __read_mostly;
-@@ -1146,12 +1142,10 @@ minstrel_ht_update_caps(void *priv, stru
- 
- 	BUILD_BUG_ON(ARRAY_SIZE(minstrel_mcs_groups) != MINSTREL_GROUPS_NB);
- 
--#ifdef CPTCFG_MAC80211_RC_MINSTREL_VHT
- 	if (vht_cap->vht_supported)
- 		use_vht = vht_cap->vht_mcs.tx_mcs_map != cpu_to_le16(~0);
- 	else
--#endif
--	use_vht = 0;
-+		use_vht = 0;
- 
- 	msp->is_ht = true;
- 	memset(mi, 0, sizeof(*mi));
-@@ -1226,10 +1220,9 @@ minstrel_ht_update_caps(void *priv, stru
- 
- 		/* HT rate */
- 		if (gflags & IEEE80211_TX_RC_MCS) {
--#ifdef CPTCFG_MAC80211_RC_MINSTREL_VHT
- 			if (use_vht && minstrel_vht_only)
- 				continue;
--#endif
-+
- 			mi->supported[i] = mcs->rx_mask[nss - 1];
- 			if (mi->supported[i])
- 				n_supported++;
-@@ -1349,16 +1342,88 @@ minstrel_ht_free_sta(void *priv, struct
- 	kfree(msp);
- }
- 
-+static void
-+minstrel_ht_init_cck_rates(struct minstrel_priv *mp)
-+{
-+	static const int bitrates[4] = { 10, 20, 55, 110 };
-+	struct ieee80211_supported_band *sband;
-+	u32 rate_flags = ieee80211_chandef_rate_flags(&mp->hw->conf.chandef);
-+	int i, j;
-+
-+	sband = mp->hw->wiphy->bands[NL80211_BAND_2GHZ];
-+	if (!sband)
-+		return;
-+
-+	for (i = 0, j = 0; i < sband->n_bitrates; i++) {
-+		struct ieee80211_rate *rate = &sband->bitrates[i];
-+
-+		if (rate->flags & IEEE80211_RATE_ERP_G)
-+			continue;
-+
-+		if ((rate_flags & sband->bitrates[i].flags) != rate_flags)
-+			continue;
-+
-+		for (j = 0; j < ARRAY_SIZE(bitrates); j++) {
-+			if (rate->bitrate != bitrates[j])
-+				continue;
-+
-+			mp->cck_rates[j] = i;
-+			break;
-+		}
-+	}
-+}
-+
- static void *
- minstrel_ht_alloc(struct ieee80211_hw *hw, struct dentry *debugfsdir)
- {
--	return mac80211_minstrel.alloc(hw, debugfsdir);
-+	struct minstrel_priv *mp;
-+
-+	mp = kzalloc(sizeof(struct minstrel_priv), GFP_ATOMIC);
-+	if (!mp)
-+		return NULL;
-+
-+	/* contention window settings
-+	 * Just an approximation. Using the per-queue values would complicate
-+	 * the calculations and is probably unnecessary */
-+	mp->cw_min = 15;
-+	mp->cw_max = 1023;
-+
-+	/* number of packets (in %) to use for sampling other rates
-+	 * sample less often for non-mrr packets, because the overhead
-+	 * is much higher than with mrr */
-+	mp->lookaround_rate = 5;
-+	mp->lookaround_rate_mrr = 10;
-+
-+	/* maximum time that the hw is allowed to stay in one MRR segment */
-+	mp->segment_size = 6000;
-+
-+	if (hw->max_rate_tries > 0)
-+		mp->max_retry = hw->max_rate_tries;
-+	else
-+		/* safe default, does not necessarily have to match hw properties */
-+		mp->max_retry = 7;
-+
-+	if (hw->max_rates >= 4)
-+		mp->has_mrr = true;
-+
-+	mp->hw = hw;
-+	mp->update_interval = 100;
-+
-+#ifdef CPTCFG_MAC80211_DEBUGFS
-+	mp->fixed_rate_idx = (u32) -1;
-+	debugfs_create_u32("fixed_rate_idx", S_IRUGO | S_IWUGO, debugfsdir,
-+			   &mp->fixed_rate_idx);
-+#endif
-+
-+	minstrel_ht_init_cck_rates(mp);
-+
-+	return mp;
- }
- 
- static void
- minstrel_ht_free(void *priv)
- {
--	mac80211_minstrel.free(priv);
-+	kfree(priv);
- }
- 
- static u32 minstrel_ht_get_expected_throughput(void *priv_sta)
-@@ -1417,14 +1482,14 @@ static void __init init_sample_table(voi
- }
- 
- int __init
--rc80211_minstrel_ht_init(void)
-+rc80211_minstrel_init(void)
- {
- 	init_sample_table();
- 	return ieee80211_rate_control_register(&mac80211_minstrel_ht);
- }
- 
- void
--rc80211_minstrel_ht_exit(void)
-+rc80211_minstrel_exit(void)
- {
- 	ieee80211_rate_control_unregister(&mac80211_minstrel_ht);
- }
---- a/net/mac80211/rc80211_minstrel_ht.h
-+++ b/net/mac80211/rc80211_minstrel_ht.h
-@@ -15,11 +15,7 @@
-  */
- #define MINSTREL_MAX_STREAMS		3
- #define MINSTREL_HT_STREAM_GROUPS	4 /* BW(=2) * SGI(=2) */
--#ifdef CPTCFG_MAC80211_RC_MINSTREL_VHT
- #define MINSTREL_VHT_STREAM_GROUPS	6 /* BW(=3) * SGI(=2) */
--#else
--#define MINSTREL_VHT_STREAM_GROUPS	0
--#endif
- 
- #define MINSTREL_HT_GROUPS_NB	(MINSTREL_MAX_STREAMS *		\
- 				 MINSTREL_HT_STREAM_GROUPS)
-@@ -34,11 +30,7 @@
- #define MINSTREL_CCK_GROUP	(MINSTREL_HT_GROUP_0 + MINSTREL_HT_GROUPS_NB)
- #define MINSTREL_VHT_GROUP_0	(MINSTREL_CCK_GROUP + 1)
- 
--#ifdef CPTCFG_MAC80211_RC_MINSTREL_VHT
- #define MCS_GROUP_RATES		10
--#else
--#define MCS_GROUP_RATES		8
--#endif
- 
- struct mcs_group {
- 	u32 flags;
---- a/net/mac80211/rc80211_minstrel_ht_debugfs.c
-+++ b/net/mac80211/rc80211_minstrel_ht_debugfs.c
-@@ -15,6 +15,22 @@
- #include "rc80211_minstrel.h"
- #include "rc80211_minstrel_ht.h"
- 
-+static ssize_t
-+minstrel_stats_read(struct file *file, char __user *buf, size_t len, loff_t *ppos)
-+{
-+	struct minstrel_debugfs_info *ms;
-+
-+	ms = file->private_data;
-+	return simple_read_from_buffer(buf, len, ppos, ms->buf, ms->len);
-+}
-+
-+static int
-+minstrel_stats_release(struct inode *inode, struct file *file)
-+{
-+	kfree(file->private_data);
-+	return 0;
-+}
-+
- static char *
- minstrel_ht_stats_dump(struct minstrel_ht_sta *mi, int i, char *p)
- {
diff --git a/package/kernel/mac80211/patches/subsys/306-mac80211-minstrel-reduce-minstrel_mcs_groups-size.patch b/package/kernel/mac80211/patches/subsys/306-mac80211-minstrel-reduce-minstrel_mcs_groups-size.patch
deleted file mode 100644
index 02a0ca0a52..0000000000
--- a/package/kernel/mac80211/patches/subsys/306-mac80211-minstrel-reduce-minstrel_mcs_groups-size.patch
+++ /dev/null
@@ -1,368 +0,0 @@
-From: Felix Fietkau <nbd at nbd.name>
-Date: Sat, 10 Feb 2018 12:45:47 +0100
-Subject: [PATCH] mac80211: minstrel: reduce minstrel_mcs_groups size
-
-By storing a shift value for all duration values of a group, we can
-reduce precision by a neglegible amount to make it fit into a u16 value.
-This improves cache footprint and reduces size:
-
-Before:
-   text    data     bss     dec     hex filename
-  10024     116       0   10140    279c rc80211_minstrel_ht.o
-
-After:
-   text    data     bss     dec     hex filename
-   9368     116       0    9484    250c rc80211_minstrel_ht.o
-
-Signed-off-by: Felix Fietkau <nbd at nbd.name>
----
-
---- a/net/mac80211/rc80211_minstrel_ht.c
-+++ b/net/mac80211/rc80211_minstrel_ht.c
-@@ -52,22 +52,23 @@
- 	_streams - 1
- 
- /* MCS rate information for an MCS group */
--#define MCS_GROUP(_streams, _sgi, _ht40)				\
-+#define MCS_GROUP(_streams, _sgi, _ht40, _s)				\
- 	[GROUP_IDX(_streams, _sgi, _ht40)] = {				\
- 	.streams = _streams,						\
-+	.shift = _s,							\
- 	.flags =							\
- 		IEEE80211_TX_RC_MCS |					\
- 		(_sgi ? IEEE80211_TX_RC_SHORT_GI : 0) |			\
- 		(_ht40 ? IEEE80211_TX_RC_40_MHZ_WIDTH : 0),		\
- 	.duration = {							\
--		MCS_DURATION(_streams, _sgi, _ht40 ? 54 : 26),		\
--		MCS_DURATION(_streams, _sgi, _ht40 ? 108 : 52),		\
--		MCS_DURATION(_streams, _sgi, _ht40 ? 162 : 78),		\
--		MCS_DURATION(_streams, _sgi, _ht40 ? 216 : 104),	\
--		MCS_DURATION(_streams, _sgi, _ht40 ? 324 : 156),	\
--		MCS_DURATION(_streams, _sgi, _ht40 ? 432 : 208),	\
--		MCS_DURATION(_streams, _sgi, _ht40 ? 486 : 234),	\
--		MCS_DURATION(_streams, _sgi, _ht40 ? 540 : 260)		\
-+		MCS_DURATION(_streams, _sgi, _ht40 ? 54 : 26) >> _s,	\
-+		MCS_DURATION(_streams, _sgi, _ht40 ? 108 : 52) >> _s,	\
-+		MCS_DURATION(_streams, _sgi, _ht40 ? 162 : 78) >> _s,	\
-+		MCS_DURATION(_streams, _sgi, _ht40 ? 216 : 104) >> _s,	\
-+		MCS_DURATION(_streams, _sgi, _ht40 ? 324 : 156) >> _s,	\
-+		MCS_DURATION(_streams, _sgi, _ht40 ? 432 : 208) >> _s,	\
-+		MCS_DURATION(_streams, _sgi, _ht40 ? 486 : 234) >> _s,	\
-+		MCS_DURATION(_streams, _sgi, _ht40 ? 540 : 260) >> _s	\
- 	}								\
- }
- 
-@@ -80,9 +81,10 @@
- #define BW2VBPS(_bw, r3, r2, r1)					\
- 	(_bw == BW_80 ? r3 : _bw == BW_40 ? r2 : r1)
- 
--#define VHT_GROUP(_streams, _sgi, _bw)					\
-+#define VHT_GROUP(_streams, _sgi, _bw, _s)				\
- 	[VHT_GROUP_IDX(_streams, _sgi, _bw)] = {			\
- 	.streams = _streams,						\
-+	.shift = _s,							\
- 	.flags =							\
- 		IEEE80211_TX_RC_VHT_MCS |				\
- 		(_sgi ? IEEE80211_TX_RC_SHORT_GI : 0) |			\
-@@ -90,25 +92,25 @@
- 		 _bw == BW_40 ? IEEE80211_TX_RC_40_MHZ_WIDTH : 0),	\
- 	.duration = {							\
- 		MCS_DURATION(_streams, _sgi,				\
--			     BW2VBPS(_bw,  117,  54,  26)),		\
-+			     BW2VBPS(_bw,  117,  54,  26)) >> _s,	\
- 		MCS_DURATION(_streams, _sgi,				\
--			     BW2VBPS(_bw,  234, 108,  52)),		\
-+			     BW2VBPS(_bw,  234, 108,  52)) >> _s,	\
- 		MCS_DURATION(_streams, _sgi,				\
--			     BW2VBPS(_bw,  351, 162,  78)),		\
-+			     BW2VBPS(_bw,  351, 162,  78)) >> _s,	\
- 		MCS_DURATION(_streams, _sgi,				\
--			     BW2VBPS(_bw,  468, 216, 104)),		\
-+			     BW2VBPS(_bw,  468, 216, 104)) >> _s,	\
- 		MCS_DURATION(_streams, _sgi,				\
--			     BW2VBPS(_bw,  702, 324, 156)),		\
-+			     BW2VBPS(_bw,  702, 324, 156)) >> _s,	\
- 		MCS_DURATION(_streams, _sgi,				\
--			     BW2VBPS(_bw,  936, 432, 208)),		\
-+			     BW2VBPS(_bw,  936, 432, 208)) >> _s,	\
- 		MCS_DURATION(_streams, _sgi,				\
--			     BW2VBPS(_bw, 1053, 486, 234)),		\
-+			     BW2VBPS(_bw, 1053, 486, 234)) >> _s,	\
- 		MCS_DURATION(_streams, _sgi,				\
--			     BW2VBPS(_bw, 1170, 540, 260)),		\
-+			     BW2VBPS(_bw, 1170, 540, 260)) >> _s,	\
- 		MCS_DURATION(_streams, _sgi,				\
--			     BW2VBPS(_bw, 1404, 648, 312)),		\
-+			     BW2VBPS(_bw, 1404, 648, 312)) >> _s,	\
- 		MCS_DURATION(_streams, _sgi,				\
--			     BW2VBPS(_bw, 1560, 720, 346))		\
-+			     BW2VBPS(_bw, 1560, 720, 346)) >> _s	\
- 	}								\
- }
- 
-@@ -121,19 +123,20 @@
- 	(CCK_DURATION((_bitrate > 10 ? 20 : 10), false, 60) +	\
- 	 CCK_DURATION(_bitrate, _short, AVG_PKT_SIZE))
- 
--#define CCK_DURATION_LIST(_short)			\
--	CCK_ACK_DURATION(10, _short),			\
--	CCK_ACK_DURATION(20, _short),			\
--	CCK_ACK_DURATION(55, _short),			\
--	CCK_ACK_DURATION(110, _short)
-+#define CCK_DURATION_LIST(_short, _s)			\
-+	CCK_ACK_DURATION(10, _short) >> _s,		\
-+	CCK_ACK_DURATION(20, _short) >> _s,		\
-+	CCK_ACK_DURATION(55, _short) >> _s,		\
-+	CCK_ACK_DURATION(110, _short) >> _s
- 
--#define CCK_GROUP					\
-+#define CCK_GROUP(_s)					\
- 	[MINSTREL_CCK_GROUP] = {			\
- 		.streams = 0,				\
- 		.flags = 0,				\
-+		.shift = _s,				\
- 		.duration = {				\
--			CCK_DURATION_LIST(false),	\
--			CCK_DURATION_LIST(true)		\
-+			CCK_DURATION_LIST(false, _s),	\
-+			CCK_DURATION_LIST(true, _s)	\
- 		}					\
- 	}
- 
-@@ -151,47 +154,47 @@ MODULE_PARM_DESC(minstrel_vht_only,
-  * BW -> SGI -> #streams
-  */
- const struct mcs_group minstrel_mcs_groups[] = {
--	MCS_GROUP(1, 0, BW_20),
--	MCS_GROUP(2, 0, BW_20),
--	MCS_GROUP(3, 0, BW_20),
--
--	MCS_GROUP(1, 1, BW_20),
--	MCS_GROUP(2, 1, BW_20),
--	MCS_GROUP(3, 1, BW_20),
--
--	MCS_GROUP(1, 0, BW_40),
--	MCS_GROUP(2, 0, BW_40),
--	MCS_GROUP(3, 0, BW_40),
--
--	MCS_GROUP(1, 1, BW_40),
--	MCS_GROUP(2, 1, BW_40),
--	MCS_GROUP(3, 1, BW_40),
--
--	CCK_GROUP,
--
--	VHT_GROUP(1, 0, BW_20),
--	VHT_GROUP(2, 0, BW_20),
--	VHT_GROUP(3, 0, BW_20),
--
--	VHT_GROUP(1, 1, BW_20),
--	VHT_GROUP(2, 1, BW_20),
--	VHT_GROUP(3, 1, BW_20),
--
--	VHT_GROUP(1, 0, BW_40),
--	VHT_GROUP(2, 0, BW_40),
--	VHT_GROUP(3, 0, BW_40),
--
--	VHT_GROUP(1, 1, BW_40),
--	VHT_GROUP(2, 1, BW_40),
--	VHT_GROUP(3, 1, BW_40),
--
--	VHT_GROUP(1, 0, BW_80),
--	VHT_GROUP(2, 0, BW_80),
--	VHT_GROUP(3, 0, BW_80),
--
--	VHT_GROUP(1, 1, BW_80),
--	VHT_GROUP(2, 1, BW_80),
--	VHT_GROUP(3, 1, BW_80),
-+	MCS_GROUP(1, 0, BW_20, 5),
-+	MCS_GROUP(2, 0, BW_20, 4),
-+	MCS_GROUP(3, 0, BW_20, 4),
-+
-+	MCS_GROUP(1, 1, BW_20, 5),
-+	MCS_GROUP(2, 1, BW_20, 4),
-+	MCS_GROUP(3, 1, BW_20, 4),
-+
-+	MCS_GROUP(1, 0, BW_40, 4),
-+	MCS_GROUP(2, 0, BW_40, 4),
-+	MCS_GROUP(3, 0, BW_40, 4),
-+
-+	MCS_GROUP(1, 1, BW_40, 4),
-+	MCS_GROUP(2, 1, BW_40, 4),
-+	MCS_GROUP(3, 1, BW_40, 4),
-+
-+	CCK_GROUP(8),
-+
-+	VHT_GROUP(1, 0, BW_20, 5),
-+	VHT_GROUP(2, 0, BW_20, 4),
-+	VHT_GROUP(3, 0, BW_20, 4),
-+
-+	VHT_GROUP(1, 1, BW_20, 5),
-+	VHT_GROUP(2, 1, BW_20, 4),
-+	VHT_GROUP(3, 1, BW_20, 4),
-+
-+	VHT_GROUP(1, 0, BW_40, 4),
-+	VHT_GROUP(2, 0, BW_40, 4),
-+	VHT_GROUP(3, 0, BW_40, 4),
-+
-+	VHT_GROUP(1, 1, BW_40, 4),
-+	VHT_GROUP(2, 1, BW_40, 4),
-+	VHT_GROUP(3, 1, BW_40, 4),
-+
-+	VHT_GROUP(1, 0, BW_80, 4),
-+	VHT_GROUP(2, 0, BW_80, 4),
-+	VHT_GROUP(3, 0, BW_80, 4),
-+
-+	VHT_GROUP(1, 1, BW_80, 4),
-+	VHT_GROUP(2, 1, BW_80, 4),
-+	VHT_GROUP(3, 1, BW_80, 4),
- };
- 
- static u8 sample_table[SAMPLE_COLUMNS][MCS_GROUP_RATES] __read_mostly;
-@@ -307,7 +310,8 @@ minstrel_ht_get_tp_avg(struct minstrel_h
- 	if (group != MINSTREL_CCK_GROUP)
- 		nsecs = 1000 * mi->overhead / MINSTREL_TRUNC(mi->avg_ampdu_len);
- 
--	nsecs += minstrel_mcs_groups[group].duration[rate];
-+	nsecs += minstrel_mcs_groups[group].duration[rate] <<
-+		 minstrel_mcs_groups[group].shift;
- 
- 	/*
- 	 * For the throughput calculation, limit the probability value to 90% to
-@@ -755,12 +759,19 @@ minstrel_ht_tx_status(void *priv, struct
- 		minstrel_ht_update_rates(mp, mi);
- }
- 
-+static inline int
-+minstrel_get_duration(int index)
-+{
-+	const struct mcs_group *group = &minstrel_mcs_groups[index / MCS_GROUP_RATES];
-+	unsigned int duration = group->duration[index % MCS_GROUP_RATES];
-+	return duration << group->shift;
-+}
-+
- static void
- minstrel_calc_retransmit(struct minstrel_priv *mp, struct minstrel_ht_sta *mi,
-                          int index)
- {
- 	struct minstrel_rate_stats *mrs;
--	const struct mcs_group *group;
- 	unsigned int tx_time, tx_time_rtscts, tx_time_data;
- 	unsigned int cw = mp->cw_min;
- 	unsigned int ctime = 0;
-@@ -779,8 +790,7 @@ minstrel_calc_retransmit(struct minstrel
- 	mrs->retry_count_rtscts = 2;
- 	mrs->retry_updated = true;
- 
--	group = &minstrel_mcs_groups[index / MCS_GROUP_RATES];
--	tx_time_data = group->duration[index % MCS_GROUP_RATES] * ampdu_len / 1000;
-+	tx_time_data = minstrel_get_duration(index) * ampdu_len / 1000;
- 
- 	/* Contention time for first 2 tries */
- 	ctime = (t_slot * cw) >> 1;
-@@ -874,20 +884,24 @@ minstrel_ht_get_max_amsdu_len(struct min
- 	int group = mi->max_prob_rate / MCS_GROUP_RATES;
- 	const struct mcs_group *g = &minstrel_mcs_groups[group];
- 	int rate = mi->max_prob_rate % MCS_GROUP_RATES;
-+	unsigned int duration;
- 
- 	/* Disable A-MSDU if max_prob_rate is bad */
- 	if (mi->groups[group].rates[rate].prob_ewma < MINSTREL_FRAC(50, 100))
- 		return 1;
- 
-+	duration = g->duration[rate];
-+	duration <<= g->shift;
-+
- 	/* If the rate is slower than single-stream MCS1, make A-MSDU limit small */
--	if (g->duration[rate] > MCS_DURATION(1, 0, 52))
-+	if (duration > MCS_DURATION(1, 0, 52))
- 		return 500;
- 
- 	/*
- 	 * If the rate is slower than single-stream MCS4, limit A-MSDU to usual
- 	 * data packet size
- 	 */
--	if (g->duration[rate] > MCS_DURATION(1, 0, 104))
-+	if (duration > MCS_DURATION(1, 0, 104))
- 		return 1600;
- 
- 	/*
-@@ -895,7 +909,7 @@ minstrel_ht_get_max_amsdu_len(struct min
- 	 * rate success probability is less than 75%, limit A-MSDU to twice the usual
- 	 * data packet size
- 	 */
--	if (g->duration[rate] > MCS_DURATION(1, 0, 260) ||
-+	if (duration > MCS_DURATION(1, 0, 260) ||
- 	    (minstrel_ht_get_prob_ewma(mi, mi->max_tp_rate[0]) <
- 	     MINSTREL_FRAC(75, 100)))
- 		return 3200;
-@@ -942,13 +956,6 @@ minstrel_ht_update_rates(struct minstrel
- 	rate_control_set_rates(mp->hw, mi->sta, rates);
- }
- 
--static inline int
--minstrel_get_duration(int index)
--{
--	const struct mcs_group *group = &minstrel_mcs_groups[index / MCS_GROUP_RATES];
--	return group->duration[index % MCS_GROUP_RATES];
--}
--
- static int
- minstrel_get_sample_rate(struct minstrel_priv *mp, struct minstrel_ht_sta *mi)
- {
---- a/net/mac80211/rc80211_minstrel_ht.h
-+++ b/net/mac80211/rc80211_minstrel_ht.h
-@@ -33,9 +33,10 @@
- #define MCS_GROUP_RATES		10
- 
- struct mcs_group {
--	u32 flags;
--	unsigned int streams;
--	unsigned int duration[MCS_GROUP_RATES];
-+	u16 flags;
-+	u8 streams;
-+	u8 shift;
-+	u16 duration[MCS_GROUP_RATES];
- };
- 
- extern const struct mcs_group minstrel_mcs_groups[];
---- a/net/mac80211/rc80211_minstrel_ht_debugfs.c
-+++ b/net/mac80211/rc80211_minstrel_ht_debugfs.c
-@@ -58,6 +58,7 @@ minstrel_ht_stats_dump(struct minstrel_h
- 		static const int bitrates[4] = { 10, 20, 55, 110 };
- 		int idx = i * MCS_GROUP_RATES + j;
- 		unsigned int prob_ewmsd;
-+		unsigned int duration;
- 
- 		if (!(mi->supported[i] & BIT(j)))
- 			continue;
-@@ -95,7 +96,9 @@ minstrel_ht_stats_dump(struct minstrel_h
- 		p += sprintf(p, "  %3u  ", idx);
- 
- 		/* tx_time[rate(i)] in usec */
--		tx_time = DIV_ROUND_CLOSEST(mg->duration[j], 1000);
-+		duration = mg->duration[j];
-+		duration <<= mg->shift;
-+		tx_time = DIV_ROUND_CLOSEST(duration, 1000);
- 		p += sprintf(p, "%6u  ", tx_time);
- 
- 		tp_max = minstrel_ht_get_tp_avg(mi, i, j, MINSTREL_FRAC(100, 100));
-@@ -204,6 +207,7 @@ minstrel_ht_stats_csv_dump(struct minstr
- 		static const int bitrates[4] = { 10, 20, 55, 110 };
- 		int idx = i * MCS_GROUP_RATES + j;
- 		unsigned int prob_ewmsd;
-+		unsigned int duration;
- 
- 		if (!(mi->supported[i] & BIT(j)))
- 			continue;
-@@ -238,7 +242,10 @@ minstrel_ht_stats_csv_dump(struct minstr
- 		}
- 
- 		p += sprintf(p, "%u,", idx);
--		tx_time = DIV_ROUND_CLOSEST(mg->duration[j], 1000);
-+
-+		duration = mg->duration[j];
-+		duration <<= mg->shift;
-+		tx_time = DIV_ROUND_CLOSEST(duration, 1000);
- 		p += sprintf(p, "%u,", tx_time);
- 
- 		tp_max = minstrel_ht_get_tp_avg(mi, i, j, MINSTREL_FRAC(100, 100));
diff --git a/package/kernel/mac80211/patches/subsys/307-mac80211-minstrel-fix-using-short-preamble-CCK-rates.patch b/package/kernel/mac80211/patches/subsys/307-mac80211-minstrel-fix-using-short-preamble-CCK-rates.patch
deleted file mode 100644
index 502d8c7768..0000000000
--- a/package/kernel/mac80211/patches/subsys/307-mac80211-minstrel-fix-using-short-preamble-CCK-rates.patch
+++ /dev/null
@@ -1,31 +0,0 @@
-From: Felix Fietkau <nbd at nbd.name>
-Date: Sat, 10 Feb 2018 13:43:07 +0100
-Subject: [PATCH] mac80211: minstrel: fix using short preamble CCK rates on
- HT clients
-
-mi->supported[MINSTREL_CCK_GROUP] needs to be updated
-
-Fixes: 782dda00ab8e ("mac80211: minstrel_ht: move short preamble check out of get_rate")
-Signed-off-by: Felix Fietkau <nbd at nbd.name>
----
-
---- a/net/mac80211/rc80211_minstrel_ht.c
-+++ b/net/mac80211/rc80211_minstrel_ht.c
-@@ -1135,7 +1135,6 @@ minstrel_ht_update_caps(void *priv, stru
- 	struct ieee80211_mcs_info *mcs = &sta->ht_cap.mcs;
- 	u16 ht_cap = sta->ht_cap.cap;
- 	struct ieee80211_sta_vht_cap *vht_cap = &sta->vht_cap;
--	struct sta_info *sinfo = container_of(sta, struct sta_info, sta);
- 	int use_vht;
- 	int n_supported = 0;
- 	int ack_dur;
-@@ -1267,8 +1266,7 @@ minstrel_ht_update_caps(void *priv, stru
- 	if (!n_supported)
- 		goto use_legacy;
- 
--	if (test_sta_flag(sinfo, WLAN_STA_SHORT_PREAMBLE))
--		mi->cck_supported_short |= mi->cck_supported_short << 4;
-+	mi->supported[MINSTREL_CCK_GROUP] |= mi->cck_supported_short << 4;
- 
- 	/* create an initial rate table with the lowest supported rates */
- 	minstrel_ht_update_stats(mp, mi);
diff --git a/package/kernel/mac80211/patches/subsys/308-mac80211-minstrel-fix-CCK-rate-group-streams-value.patch b/package/kernel/mac80211/patches/subsys/308-mac80211-minstrel-fix-CCK-rate-group-streams-value.patch
deleted file mode 100644
index f0ffcd9655..0000000000
--- a/package/kernel/mac80211/patches/subsys/308-mac80211-minstrel-fix-CCK-rate-group-streams-value.patch
+++ /dev/null
@@ -1,20 +0,0 @@
-From: Felix Fietkau <nbd at nbd.name>
-Date: Thu, 1 Mar 2018 13:27:54 +0100
-Subject: [PATCH] mac80211: minstrel: fix CCK rate group streams value
-
-Fixes a harmless underflow issue when CCK rates are actively being used
-
-Signed-off-by: Felix Fietkau <nbd at nbd.name>
----
-
---- a/net/mac80211/rc80211_minstrel_ht.c
-+++ b/net/mac80211/rc80211_minstrel_ht.c
-@@ -131,7 +131,7 @@
- 
- #define CCK_GROUP(_s)					\
- 	[MINSTREL_CCK_GROUP] = {			\
--		.streams = 0,				\
-+		.streams = 1,				\
- 		.flags = 0,				\
- 		.shift = _s,				\
- 		.duration = {				\
diff --git a/package/kernel/mac80211/patches/subsys/309-mac80211-minstrel-fix-sampling-reporting-of-CCK-rate.patch b/package/kernel/mac80211/patches/subsys/309-mac80211-minstrel-fix-sampling-reporting-of-CCK-rate.patch
deleted file mode 100644
index e0049c36eb..0000000000
--- a/package/kernel/mac80211/patches/subsys/309-mac80211-minstrel-fix-sampling-reporting-of-CCK-rate.patch
+++ /dev/null
@@ -1,58 +0,0 @@
-From: Felix Fietkau <nbd at nbd.name>
-Date: Thu, 1 Mar 2018 13:28:48 +0100
-Subject: [PATCH] mac80211: minstrel: fix sampling/reporting of CCK rates
- in HT mode
-
-Long/short preamble selection cannot be sampled separately, since it
-depends on the BSS state. Because of that, sampling attempts to
-currently not used preamble modes are not counted in the statistics,
-which leads to CCK rates being sampled too often.
-
-Fix statistics accounting for long/short preamble by increasing the
-index where necessary.
-Fix excessive CCK rate sampling by dropping unsupported sample attempts.
-
-This improves throughput on 2.4 GHz channels
-
-Signed-off-by: Felix Fietkau <nbd at nbd.name>
----
-
---- a/net/mac80211/rc80211_minstrel_ht.c
-+++ b/net/mac80211/rc80211_minstrel_ht.c
-@@ -281,7 +281,8 @@ minstrel_ht_get_stats(struct minstrel_pr
- 				break;
- 
- 		/* short preamble */
--		if (!(mi->supported[group] & BIT(idx)))
-+		if ((mi->supported[group] & BIT(idx + 4)) &&
-+		    (rate->flags & IEEE80211_TX_RC_USE_SHORT_PREAMBLE))
- 			idx += 4;
- 	}
- 	return &mi->groups[group].rates[idx];
-@@ -1080,18 +1081,23 @@ minstrel_ht_get_rate(void *priv, struct
- 		return;
- 
- 	sample_group = &minstrel_mcs_groups[sample_idx / MCS_GROUP_RATES];
-+	sample_idx %= MCS_GROUP_RATES;
-+
-+	if (sample_group == &minstrel_mcs_groups[MINSTREL_CCK_GROUP] &&
-+	    (sample_idx >= 4) != txrc->short_preamble)
-+		return;
-+
- 	info->flags |= IEEE80211_TX_CTL_RATE_CTRL_PROBE;
- 	rate->count = 1;
- 
--	if (sample_idx / MCS_GROUP_RATES == MINSTREL_CCK_GROUP) {
-+	if (sample_group == &minstrel_mcs_groups[MINSTREL_CCK_GROUP]) {
- 		int idx = sample_idx % ARRAY_SIZE(mp->cck_rates);
- 		rate->idx = mp->cck_rates[idx];
- 	} else if (sample_group->flags & IEEE80211_TX_RC_VHT_MCS) {
- 		ieee80211_rate_set_vht(rate, sample_idx % MCS_GROUP_RATES,
- 				       sample_group->streams);
- 	} else {
--		rate->idx = sample_idx % MCS_GROUP_RATES +
--			    (sample_group->streams - 1) * 8;
-+		rate->idx = sample_idx + (sample_group->streams - 1) * 8;
- 	}
- 
- 	rate->flags = sample_group->flags;
diff --git a/package/kernel/mac80211/patches/subsys/310-mac80211-minstrel-do-not-sample-rates-3-times-slower.patch b/package/kernel/mac80211/patches/subsys/310-mac80211-minstrel-do-not-sample-rates-3-times-slower.patch
deleted file mode 100644
index 414cb137de..0000000000
--- a/package/kernel/mac80211/patches/subsys/310-mac80211-minstrel-do-not-sample-rates-3-times-slower.patch
+++ /dev/null
@@ -1,40 +0,0 @@
-From: Felix Fietkau <nbd at nbd.name>
-Date: Sat, 3 Mar 2018 18:48:58 +0100
-Subject: [PATCH] mac80211: minstrel: do not sample rates 3 times slower than
- max_prob_rate
-
-These rates are highly unlikely to be used quickly, even if the link
-deteriorates rapidly. This improves throughput in cases where CCK rates
-are not reliable enough to be skipped entirely during sampling.
-Sampling these rates regularly can cost a lot of airtime.
-
-Signed-off-by: Felix Fietkau <nbd at nbd.name>
----
-
---- a/net/mac80211/rc80211_minstrel_ht.c
-+++ b/net/mac80211/rc80211_minstrel_ht.c
-@@ -1004,10 +1004,13 @@ minstrel_get_sample_rate(struct minstrel
- 		return -1;
- 
- 	/*
--	 * Do not sample if the probability is already higher than 95%
--	 * to avoid wasting airtime.
-+	 * Do not sample if the probability is already higher than 95%,
-+	 * or if the rate is 3 times slower than the current max probability
-+	 * rate, to avoid wasting airtime.
- 	 */
--	if (mrs->prob_ewma > MINSTREL_FRAC(95, 100))
-+	sample_dur = minstrel_get_duration(sample_idx);
-+	if (mrs->prob_ewma > MINSTREL_FRAC(95, 100) ||
-+	    minstrel_get_duration(mi->max_prob_rate) * 3 < sample_dur)
- 		return -1;
- 
- 	/*
-@@ -1017,7 +1020,6 @@ minstrel_get_sample_rate(struct minstrel
- 
- 	cur_max_tp_streams = minstrel_mcs_groups[tp_rate1 /
- 		MCS_GROUP_RATES].streams;
--	sample_dur = minstrel_get_duration(sample_idx);
- 	if (sample_dur >= minstrel_get_duration(tp_rate2) &&
- 	    (cur_max_tp_streams - 1 <
- 	     minstrel_mcs_groups[sample_group].streams ||
diff --git a/package/kernel/mac80211/patches/subsys/311-mac80211-fix-memory-accounting-with-A-MSDU-aggregati.patch b/package/kernel/mac80211/patches/subsys/311-mac80211-fix-memory-accounting-with-A-MSDU-aggregati.patch
deleted file mode 100644
index 1fd2b25271..0000000000
--- a/package/kernel/mac80211/patches/subsys/311-mac80211-fix-memory-accounting-with-A-MSDU-aggregati.patch
+++ /dev/null
@@ -1,58 +0,0 @@
-From: Felix Fietkau <nbd at nbd.name>
-Date: Thu, 8 Mar 2018 21:00:56 +0100
-Subject: [PATCH] mac80211: fix memory accounting with A-MSDU aggregation
-
-fq uses skb->truesize for memory usage tracking. Increments/decrements
-are done on enqueue/dequeue.
-When A-MSDU aggregation is performed on tx side, the packet is
-aggregated with the last packet in the queue belonging to the same flow.
-There are multiple bugs here:
-- The truesize field of the aggregated packet isn't updated, so memory
-usage is underestimated
-- fq->memory_usage isn't adjusted.
-
-Because of the combination of both bugs, this only causes tx issues in
-rare cases, mainly when the A-MSDU head needs to be reallocated.
-
-Fix this by adjusting both truesize of the A-MSDU head and adding the
-truesize delta to fq->memory_usage.
-
-Signed-off-by: Felix Fietkau <nbd at nbd.name>
----
-
---- a/net/mac80211/tx.c
-+++ b/net/mac80211/tx.c
-@@ -3185,6 +3185,7 @@ static bool ieee80211_amsdu_aggregate(st
- 	u8 max_subframes = sta->sta.max_amsdu_subframes;
- 	int max_frags = local->hw.max_tx_fragments;
- 	int max_amsdu_len = sta->sta.max_amsdu_len;
-+	int orig_truesize;
- 	__be16 len;
- 	void *data;
- 	bool ret = false;
-@@ -3216,12 +3217,13 @@ static bool ieee80211_amsdu_aggregate(st
- 	flow = fq_flow_classify(fq, tin, skb, fq_flow_get_default_func);
- 	head = skb_peek_tail(&flow->queue);
- 	if (!head)
--		goto out;
-+		goto unlock;
- 
-+	orig_truesize = head->truesize;
- 	orig_len = head->len;
- 
- 	if (skb->len + head->len > max_amsdu_len)
--		goto out;
-+		goto unlock;
- 
- 	nfrags = 1 + skb_shinfo(skb)->nr_frags;
- 	nfrags += 1 + skb_shinfo(head)->nr_frags;
-@@ -3279,6 +3281,9 @@ out_recalc:
- 		fq_recalc_backlog(fq, tin, flow);
- 	}
- out:
-+	fq->memory_usage += head->truesize - orig_truesize;
-+
-+unlock:
- 	spin_unlock_bh(&fq->lock);
- 
- 	return ret;
diff --git a/package/kernel/mac80211/patches/subsys/312-mac80211-minstrel_ht-add-flag-to-indicate-missing-in.patch b/package/kernel/mac80211/patches/subsys/312-mac80211-minstrel_ht-add-flag-to-indicate-missing-in.patch
deleted file mode 100644
index f221d36bf8..0000000000
--- a/package/kernel/mac80211/patches/subsys/312-mac80211-minstrel_ht-add-flag-to-indicate-missing-in.patch
+++ /dev/null
@@ -1,122 +0,0 @@
-From: Felix Fietkau <nbd at nbd.name>
-Date: Wed, 16 Jan 2019 22:32:12 +0100
-Subject: [PATCH] mac80211: minstrel_ht: add flag to indicate
- missing/inaccurate tx A-MPDU length
-
-Some hardware (e.g. MediaTek MT7603) cannot report A-MPDU length in tx status
-information. Add support for a flag to indicate that, to allow minstrel_ht
-to use a fixed value in its internal calculation (which gives better results
-than just defaulting to 1).
-
-Signed-off-by: Felix Fietkau <nbd at nbd.name>
-Signed-off-by: Johannes Berg <johannes.berg at intel.com>
----
-
---- a/include/net/mac80211.h
-+++ b/include/net/mac80211.h
-@@ -2131,6 +2131,9 @@ struct ieee80211_txq {
-  * @IEEE80211_HW_DOESNT_SUPPORT_QOS_NDP: The driver (or firmware) doesn't
-  *	support QoS NDP for AP probing - that's most likely a driver bug.
-  *
-+ * @IEEE80211_HW_TX_STATUS_NO_AMPDU_LEN: Driver does not report accurate A-MPDU
-+ *	length in tx status information
-+ *
-  * @NUM_IEEE80211_HW_FLAGS: number of hardware flags, used for sizing arrays
-  */
- enum ieee80211_hw_flags {
-@@ -2176,6 +2179,7 @@ enum ieee80211_hw_flags {
- 	IEEE80211_HW_SUPPORTS_TDLS_BUFFER_STA,
- 	IEEE80211_HW_DEAUTH_NEED_MGD_TX_PREP,
- 	IEEE80211_HW_DOESNT_SUPPORT_QOS_NDP,
-+	IEEE80211_HW_TX_STATUS_NO_AMPDU_LEN,
- 
- 	/* keep last, obviously */
- 	NUM_IEEE80211_HW_FLAGS
---- a/net/mac80211/debugfs.c
-+++ b/net/mac80211/debugfs.c
-@@ -214,6 +214,7 @@ static const char *hw_flag_names[] = {
- 	FLAG(SUPPORTS_TDLS_BUFFER_STA),
- 	FLAG(DEAUTH_NEED_MGD_TX_PREP),
- 	FLAG(DOESNT_SUPPORT_QOS_NDP),
-+	FLAG(TX_STATUS_NO_AMPDU_LEN),
- #undef FLAG
- };
- 
---- a/net/mac80211/rc80211_minstrel_ht.c
-+++ b/net/mac80211/rc80211_minstrel_ht.c
-@@ -294,6 +294,15 @@ minstrel_get_ratestats(struct minstrel_h
- 	return &mi->groups[index / MCS_GROUP_RATES].rates[index % MCS_GROUP_RATES];
- }
- 
-+static unsigned int
-+minstrel_ht_avg_ampdu_len(struct minstrel_ht_sta *mi)
-+{
-+	if (!mi->avg_ampdu_len)
-+		return AVG_AMPDU_SIZE;
-+
-+	return MINSTREL_TRUNC(mi->avg_ampdu_len);
-+}
-+
- /*
-  * Return current throughput based on the average A-MPDU length, taking into
-  * account the expected number of retransmissions and their expected length
-@@ -309,7 +318,7 @@ minstrel_ht_get_tp_avg(struct minstrel_h
- 		return 0;
- 
- 	if (group != MINSTREL_CCK_GROUP)
--		nsecs = 1000 * mi->overhead / MINSTREL_TRUNC(mi->avg_ampdu_len);
-+		nsecs = 1000 * mi->overhead / minstrel_ht_avg_ampdu_len(mi);
- 
- 	nsecs += minstrel_mcs_groups[group].duration[rate] <<
- 		 minstrel_mcs_groups[group].shift;
-@@ -503,8 +512,12 @@ minstrel_ht_update_stats(struct minstrel
- 	u16 tmp_cck_tp_rate[MAX_THR_RATES], index;
- 
- 	if (mi->ampdu_packets > 0) {
--		mi->avg_ampdu_len = minstrel_ewma(mi->avg_ampdu_len,
--			MINSTREL_FRAC(mi->ampdu_len, mi->ampdu_packets), EWMA_LEVEL);
-+		if (!ieee80211_hw_check(mp->hw, TX_STATUS_NO_AMPDU_LEN))
-+			mi->avg_ampdu_len = minstrel_ewma(mi->avg_ampdu_len,
-+				MINSTREL_FRAC(mi->ampdu_len, mi->ampdu_packets),
-+					      EWMA_LEVEL);
-+		else
-+			mi->avg_ampdu_len = 0;
- 		mi->ampdu_len = 0;
- 		mi->ampdu_packets = 0;
- 	}
-@@ -709,7 +722,9 @@ minstrel_ht_tx_status(void *priv, struct
- 	mi->ampdu_len += info->status.ampdu_len;
- 
- 	if (!mi->sample_wait && !mi->sample_tries && mi->sample_count > 0) {
--		mi->sample_wait = 16 + 2 * MINSTREL_TRUNC(mi->avg_ampdu_len);
-+		int avg_ampdu_len = minstrel_ht_avg_ampdu_len(mi);
-+
-+		mi->sample_wait = 16 + 2 * avg_ampdu_len;
- 		mi->sample_tries = 1;
- 		mi->sample_count--;
- 	}
-@@ -777,7 +792,7 @@ minstrel_calc_retransmit(struct minstrel
- 	unsigned int cw = mp->cw_min;
- 	unsigned int ctime = 0;
- 	unsigned int t_slot = 9; /* FIXME */
--	unsigned int ampdu_len = MINSTREL_TRUNC(mi->avg_ampdu_len);
-+	unsigned int ampdu_len = minstrel_ht_avg_ampdu_len(mi);
- 	unsigned int overhead = 0, overhead_rtscts = 0;
- 
- 	mrs = minstrel_get_ratestats(mi, index);
---- a/net/mac80211/rc80211_minstrel_ht_debugfs.c
-+++ b/net/mac80211/rc80211_minstrel_ht_debugfs.c
-@@ -163,9 +163,10 @@ minstrel_ht_stats_open(struct inode *ino
- 			"lookaround %d\n",
- 			max(0, (int) mi->total_packets - (int) mi->sample_packets),
- 			mi->sample_packets);
--	p += sprintf(p, "Average # of aggregated frames per A-MPDU: %d.%d\n",
--		MINSTREL_TRUNC(mi->avg_ampdu_len),
--		MINSTREL_TRUNC(mi->avg_ampdu_len * 10) % 10);
-+	if (mi->avg_ampdu_len)
-+		p += sprintf(p, "Average # of aggregated frames per A-MPDU: %d.%d\n",
-+			MINSTREL_TRUNC(mi->avg_ampdu_len),
-+			MINSTREL_TRUNC(mi->avg_ampdu_len * 10) % 10);
- 	ms->len = p - ms->buf;
- 	WARN_ON(ms->len + sizeof(*ms) > 32768);
- 
diff --git a/package/kernel/mac80211/patches/subsys/313-mac80211-fix-unaligned-access-in-mesh-table-hash-fun.patch b/package/kernel/mac80211/patches/subsys/313-mac80211-fix-unaligned-access-in-mesh-table-hash-fun.patch
deleted file mode 100644
index 2ce23586ca..0000000000
--- a/package/kernel/mac80211/patches/subsys/313-mac80211-fix-unaligned-access-in-mesh-table-hash-fun.patch
+++ /dev/null
@@ -1,21 +0,0 @@
-From: Felix Fietkau <nbd at nbd.name>
-Date: Wed, 13 Mar 2019 18:52:56 +0100
-Subject: [PATCH] mac80211: fix unaligned access in mesh table hash function
-
-The pointer to the last four bytes of the address is not guaranteed to be
-aligned, so we need to use __get_unaligned_cpu32 here
-
-Signed-off-by: Felix Fietkau <nbd at nbd.name>
----
-
---- a/net/mac80211/mesh_pathtbl.c
-+++ b/net/mac80211/mesh_pathtbl.c
-@@ -23,7 +23,7 @@ static void mesh_path_free_rcu(struct me
- static u32 mesh_table_hash(const void *addr, u32 len, u32 seed)
- {
- 	/* Use last four bytes of hw addr as hash index */
--	return jhash_1word(*(u32 *)(addr+2), seed);
-+	return jhash_1word(__get_unaligned_cpu32(addr+2), seed);
- }
- 
- static const struct rhashtable_params mesh_rht_params = {
diff --git a/package/kernel/mac80211/patches/subsys/320-mac80211-Add-TXQ-scheduling-API.patch b/package/kernel/mac80211/patches/subsys/320-mac80211-Add-TXQ-scheduling-API.patch
deleted file mode 100644
index 0f7d9e1506..0000000000
--- a/package/kernel/mac80211/patches/subsys/320-mac80211-Add-TXQ-scheduling-API.patch
+++ /dev/null
@@ -1,292 +0,0 @@
-From: =?UTF-8?q?Toke=20H=C3=B8iland-J=C3=B8rgensen?= <toke at toke.dk>
-Date: Tue, 18 Dec 2018 17:02:06 -0800
-Subject: [PATCH] mac80211: Add TXQ scheduling API
-MIME-Version: 1.0
-Content-Type: text/plain; charset=UTF-8
-Content-Transfer-Encoding: 8bit
-
-This adds an API to mac80211 to handle scheduling of TXQs. The interface
-between driver and mac80211 for TXQ handling is changed by adding two new
-functions: ieee80211_next_txq(), which will return the next TXQ to schedule
-in the current round-robin rotation, and ieee80211_return_txq(), which the
-driver uses to indicate that it has finished scheduling a TXQ (which will
-then be put back in the scheduling rotation if it isn't empty).
-
-The driver must call ieee80211_txq_schedule_start() at the start of each
-scheduling session, and ieee80211_txq_schedule_end() at the end. The API
-then guarantees that the same TXQ is not returned twice in the same
-session (so a driver can loop on ieee80211_next_txq() without worrying
-about breaking the loop.
-
-Usage of the new API is optional, so drivers can be ported one at a time.
-In this patch, the actual scheduling performed by mac80211 is simple
-round-robin, but a subsequent commit adds airtime fairness awareness to the
-scheduler.
-
-Signed-off-by: Toke Høiland-Jørgensen <toke at toke.dk>
-[minor kernel-doc fix, propagate sparse locking checks out]
-Signed-off-by: Johannes Berg <johannes.berg at intel.com>
----
-
---- a/include/net/mac80211.h
-+++ b/include/net/mac80211.h
-@@ -107,9 +107,15 @@
-  * The driver is expected to initialize its private per-queue data for stations
-  * and interfaces in the .add_interface and .sta_add ops.
-  *
-- * The driver can't access the queue directly. To dequeue a frame, it calls
-- * ieee80211_tx_dequeue(). Whenever mac80211 adds a new frame to a queue, it
-- * calls the .wake_tx_queue driver op.
-+ * The driver can't access the queue directly. To dequeue a frame from a
-+ * txq, it calls ieee80211_tx_dequeue(). Whenever mac80211 adds a new frame to a
-+ * queue, it calls the .wake_tx_queue driver op.
-+ *
-+ * Drivers can optionally delegate responsibility for scheduling queues to
-+ * mac80211, to take advantage of airtime fairness accounting. In this case, to
-+ * obtain the next queue to pull frames from, the driver calls
-+ * ieee80211_next_txq(). The driver is then expected to return the txq using
-+ * ieee80211_return_txq().
-  *
-  * For AP powersave TIM handling, the driver only needs to indicate if it has
-  * buffered packets in the driver specific data structures by calling
-@@ -5979,7 +5985,8 @@ void ieee80211_unreserve_tid(struct ieee
-  * ieee80211_tx_dequeue - dequeue a packet from a software tx queue
-  *
-  * @hw: pointer as obtained from ieee80211_alloc_hw()
-- * @txq: pointer obtained from station or virtual interface
-+ * @txq: pointer obtained from station or virtual interface, or from
-+ *	ieee80211_next_txq()
-  *
-  * Returns the skb if successful, %NULL if no frame was available.
-  */
-@@ -5987,6 +5994,54 @@ struct sk_buff *ieee80211_tx_dequeue(str
- 				     struct ieee80211_txq *txq);
- 
- /**
-+ * ieee80211_next_txq - get next tx queue to pull packets from
-+ *
-+ * @hw: pointer as obtained from ieee80211_alloc_hw()
-+ * @ac: AC number to return packets from.
-+ *
-+ * Should only be called between calls to ieee80211_txq_schedule_start()
-+ * and ieee80211_txq_schedule_end().
-+ * Returns the next txq if successful, %NULL if no queue is eligible. If a txq
-+ * is returned, it should be returned with ieee80211_return_txq() after the
-+ * driver has finished scheduling it.
-+ */
-+struct ieee80211_txq *ieee80211_next_txq(struct ieee80211_hw *hw, u8 ac);
-+
-+/**
-+ * ieee80211_return_txq - return a TXQ previously acquired by ieee80211_next_txq()
-+ *
-+ * @hw: pointer as obtained from ieee80211_alloc_hw()
-+ * @txq: pointer obtained from station or virtual interface
-+ *
-+ * Should only be called between calls to ieee80211_txq_schedule_start()
-+ * and ieee80211_txq_schedule_end().
-+ */
-+void ieee80211_return_txq(struct ieee80211_hw *hw, struct ieee80211_txq *txq);
-+
-+/**
-+ * ieee80211_txq_schedule_start - acquire locks for safe scheduling of an AC
-+ *
-+ * @hw: pointer as obtained from ieee80211_alloc_hw()
-+ * @ac: AC number to acquire locks for
-+ *
-+ * Acquire locks needed to schedule TXQs from the given AC. Should be called
-+ * before ieee80211_next_txq() or ieee80211_return_txq().
-+ */
-+void ieee80211_txq_schedule_start(struct ieee80211_hw *hw, u8 ac)
-+	__acquires(txq_lock);
-+
-+/**
-+ * ieee80211_txq_schedule_end - release locks for safe scheduling of an AC
-+ *
-+ * @hw: pointer as obtained from ieee80211_alloc_hw()
-+ * @ac: AC number to acquire locks for
-+ *
-+ * Release locks previously acquired by ieee80211_txq_schedule_end().
-+ */
-+void ieee80211_txq_schedule_end(struct ieee80211_hw *hw, u8 ac)
-+	__releases(txq_lock);
-+
-+/**
-  * ieee80211_txq_get_depth - get pending frame/byte count of given txq
-  *
-  * The values are not guaranteed to be coherent with regard to each other, i.e.
---- a/net/mac80211/agg-tx.c
-+++ b/net/mac80211/agg-tx.c
-@@ -229,7 +229,7 @@ ieee80211_agg_start_txq(struct sta_info
- 	clear_bit(IEEE80211_TXQ_STOP, &txqi->flags);
- 	local_bh_disable();
- 	rcu_read_lock();
--	drv_wake_tx_queue(sta->sdata->local, txqi);
-+	schedule_and_wake_txq(sta->sdata->local, txqi);
- 	rcu_read_unlock();
- 	local_bh_enable();
- }
---- a/net/mac80211/driver-ops.h
-+++ b/net/mac80211/driver-ops.h
-@@ -1176,6 +1176,15 @@ static inline void drv_wake_tx_queue(str
- 	local->ops->wake_tx_queue(&local->hw, &txq->txq);
- }
- 
-+static inline void schedule_and_wake_txq(struct ieee80211_local *local,
-+					 struct txq_info *txqi)
-+{
-+	spin_lock_bh(&local->active_txq_lock[txqi->txq.ac]);
-+	ieee80211_return_txq(&local->hw, &txqi->txq);
-+	spin_unlock_bh(&local->active_txq_lock[txqi->txq.ac]);
-+	drv_wake_tx_queue(local, txqi);
-+}
-+
- static inline int drv_start_nan(struct ieee80211_local *local,
- 				struct ieee80211_sub_if_data *sdata,
- 				struct cfg80211_nan_conf *conf)
---- a/net/mac80211/ieee80211_i.h
-+++ b/net/mac80211/ieee80211_i.h
-@@ -829,6 +829,8 @@ enum txq_info_flags {
-  *	a fq_flow which is already owned by a different tin
-  * @def_cvars: codel vars for @def_flow
-  * @frags: used to keep fragments created after dequeue
-+ * @schedule_order: used with ieee80211_local->active_txqs
-+ * @schedule_round: counter to prevent infinite loops on TXQ scheduling
-  */
- struct txq_info {
- 	struct fq_tin tin;
-@@ -836,6 +838,8 @@ struct txq_info {
- 	struct codel_vars def_cvars;
- 	struct codel_stats cstats;
- 	struct sk_buff_head frags;
-+	struct list_head schedule_order;
-+	u16 schedule_round;
- 	unsigned long flags;
- 
- 	/* keep last! */
-@@ -1127,6 +1131,11 @@ struct ieee80211_local {
- 	struct codel_vars *cvars;
- 	struct codel_params cparams;
- 
-+	/* protects active_txqs and txqi->schedule_order */
-+	spinlock_t active_txq_lock[IEEE80211_NUM_ACS];
-+	struct list_head active_txqs[IEEE80211_NUM_ACS];
-+	u16 schedule_round[IEEE80211_NUM_ACS];
-+
- 	const struct ieee80211_ops *ops;
- 
- 	/*
---- a/net/mac80211/main.c
-+++ b/net/mac80211/main.c
-@@ -652,6 +652,11 @@ struct ieee80211_hw *ieee80211_alloc_hw_
- 	spin_lock_init(&local->rx_path_lock);
- 	spin_lock_init(&local->queue_stop_reason_lock);
- 
-+	for (i = 0; i < IEEE80211_NUM_ACS; i++) {
-+		INIT_LIST_HEAD(&local->active_txqs[i]);
-+		spin_lock_init(&local->active_txq_lock[i]);
-+	}
-+
- 	INIT_LIST_HEAD(&local->chanctx_list);
- 	mutex_init(&local->chanctx_mtx);
- 
---- a/net/mac80211/sta_info.c
-+++ b/net/mac80211/sta_info.c
-@@ -1244,7 +1244,7 @@ void ieee80211_sta_ps_deliver_wakeup(str
- 			if (!txq_has_queue(sta->sta.txq[i]))
- 				continue;
- 
--			drv_wake_tx_queue(local, to_txq_info(sta->sta.txq[i]));
-+			schedule_and_wake_txq(local, to_txq_info(sta->sta.txq[i]));
- 		}
- 	}
- 
---- a/net/mac80211/tx.c
-+++ b/net/mac80211/tx.c
-@@ -1441,6 +1441,7 @@ void ieee80211_txq_init(struct ieee80211
- 	codel_vars_init(&txqi->def_cvars);
- 	codel_stats_init(&txqi->cstats);
- 	__skb_queue_head_init(&txqi->frags);
-+	INIT_LIST_HEAD(&txqi->schedule_order);
- 
- 	txqi->txq.vif = &sdata->vif;
- 
-@@ -1464,6 +1465,9 @@ void ieee80211_txq_purge(struct ieee8021
- 
- 	fq_tin_reset(fq, tin, fq_skb_free_func);
- 	ieee80211_purge_tx_queue(&local->hw, &txqi->frags);
-+	spin_lock_bh(&local->active_txq_lock[txqi->txq.ac]);
-+	list_del_init(&txqi->schedule_order);
-+	spin_unlock_bh(&local->active_txq_lock[txqi->txq.ac]);
- }
- 
- void ieee80211_txq_set_params(struct ieee80211_local *local)
-@@ -1580,7 +1584,7 @@ static bool ieee80211_queue_skb(struct i
- 	ieee80211_txq_enqueue(local, txqi, skb);
- 	spin_unlock_bh(&fq->lock);
- 
--	drv_wake_tx_queue(local, txqi);
-+	schedule_and_wake_txq(local, txqi);
- 
- 	return true;
- }
-@@ -3602,6 +3606,60 @@ out:
- }
- EXPORT_SYMBOL(ieee80211_tx_dequeue);
- 
-+struct ieee80211_txq *ieee80211_next_txq(struct ieee80211_hw *hw, u8 ac)
-+{
-+	struct ieee80211_local *local = hw_to_local(hw);
-+	struct txq_info *txqi = NULL;
-+
-+	lockdep_assert_held(&local->active_txq_lock[ac]);
-+
-+	txqi = list_first_entry_or_null(&local->active_txqs[ac],
-+					struct txq_info,
-+					schedule_order);
-+
-+	if (!txqi || txqi->schedule_round == local->schedule_round[ac])
-+		return NULL;
-+
-+	list_del_init(&txqi->schedule_order);
-+	txqi->schedule_round = local->schedule_round[ac];
-+	return &txqi->txq;
-+}
-+EXPORT_SYMBOL(ieee80211_next_txq);
-+
-+void ieee80211_return_txq(struct ieee80211_hw *hw,
-+			  struct ieee80211_txq *txq)
-+{
-+	struct ieee80211_local *local = hw_to_local(hw);
-+	struct txq_info *txqi = to_txq_info(txq);
-+
-+	lockdep_assert_held(&local->active_txq_lock[txq->ac]);
-+
-+	if (list_empty(&txqi->schedule_order) &&
-+	    (!skb_queue_empty(&txqi->frags) || txqi->tin.backlog_packets))
-+		list_add_tail(&txqi->schedule_order,
-+			      &local->active_txqs[txq->ac]);
-+}
-+EXPORT_SYMBOL(ieee80211_return_txq);
-+
-+void ieee80211_txq_schedule_start(struct ieee80211_hw *hw, u8 ac)
-+	__acquires(txq_lock)
-+{
-+	struct ieee80211_local *local = hw_to_local(hw);
-+
-+	spin_lock_bh(&local->active_txq_lock[ac]);
-+	local->schedule_round[ac]++;
-+}
-+EXPORT_SYMBOL(ieee80211_txq_schedule_start);
-+
-+void ieee80211_txq_schedule_end(struct ieee80211_hw *hw, u8 ac)
-+	__releases(txq_lock)
-+{
-+	struct ieee80211_local *local = hw_to_local(hw);
-+
-+	spin_unlock_bh(&local->active_txq_lock[ac]);
-+}
-+EXPORT_SYMBOL(ieee80211_txq_schedule_end);
-+
- void __ieee80211_subif_start_xmit(struct sk_buff *skb,
- 				  struct net_device *dev,
- 				  u32 info_flags)
diff --git a/package/kernel/mac80211/patches/subsys/321-cfg80211-Add-airtime-statistics-and-settings.patch b/package/kernel/mac80211/patches/subsys/321-cfg80211-Add-airtime-statistics-and-settings.patch
deleted file mode 100644
index 7eb64c4251..0000000000
--- a/package/kernel/mac80211/patches/subsys/321-cfg80211-Add-airtime-statistics-and-settings.patch
+++ /dev/null
@@ -1,202 +0,0 @@
-From: =?UTF-8?q?Toke=20H=C3=B8iland-J=C3=B8rgensen?= <toke at toke.dk>
-Date: Tue, 18 Dec 2018 17:02:07 -0800
-Subject: [PATCH] cfg80211: Add airtime statistics and settings
-MIME-Version: 1.0
-Content-Type: text/plain; charset=UTF-8
-Content-Transfer-Encoding: 8bit
-
-This adds TX airtime statistics to the cfg80211 station dump (to go along
-with the RX info already present), and adds a new parameter to set the
-airtime weight of each station. The latter allows userspace to implement
-policies for different stations by varying their weights.
-
-Signed-off-by: Toke Høiland-Jørgensen <toke at toke.dk>
-[rmanohar at codeaurora.org: fixed checkpatch warnings]
-Signed-off-by: Rajkumar Manoharan <rmanohar at codeaurora.org>
-[move airtime weight != 0 check into policy]
-Signed-off-by: Johannes Berg <johannes.berg at intel.com>
----
-
---- a/include/net/cfg80211.h
-+++ b/include/net/cfg80211.h
-@@ -988,6 +988,7 @@ enum station_parameters_apply_mask {
-  * @support_p2p_ps: information if station supports P2P PS mechanism
-  * @he_capa: HE capabilities of station
-  * @he_capa_len: the length of the HE capabilities
-+ * @airtime_weight: airtime scheduler weight for this station
-  */
- struct station_parameters {
- 	const u8 *supported_rates;
-@@ -1017,6 +1018,7 @@ struct station_parameters {
- 	int support_p2p_ps;
- 	const struct ieee80211_he_cap_elem *he_capa;
- 	u8 he_capa_len;
-+	u16 airtime_weight;
- };
- 
- /**
-@@ -1284,6 +1286,8 @@ struct cfg80211_tid_stats {
-  * @rx_beacon_signal_avg: signal strength average (in dBm) for beacons received
-  *	from this peer
-  * @rx_duration: aggregate PPDU duration(usecs) for all the frames from a peer
-+ * @tx_duration: aggregate PPDU duration(usecs) for all the frames to a peer
-+ * @airtime_weight: current airtime scheduling weight
-  * @pertid: per-TID statistics, see &struct cfg80211_tid_stats, using the last
-  *	(IEEE80211_NUM_TIDS) index for MSDUs not encapsulated in QoS-MPDUs.
-  *	Note that this doesn't use the @filled bit, but is used if non-NULL.
-@@ -1330,12 +1334,15 @@ struct station_info {
- 
- 	u32 expected_throughput;
- 
--	u64 rx_beacon;
-+	u64 tx_duration;
- 	u64 rx_duration;
-+	u64 rx_beacon;
- 	u8 rx_beacon_signal_avg;
- 	struct cfg80211_tid_stats *pertid;
- 	s8 ack_signal;
- 	s8 avg_ack_signal;
-+
-+	u16 airtime_weight;
- };
- 
- #if IS_ENABLED(CPTCFG_CFG80211)
-@@ -2361,6 +2368,8 @@ enum wiphy_params_flags {
- 	WIPHY_PARAM_TXQ_QUANTUM		= 1 << 8,
- };
- 
-+#define IEEE80211_DEFAULT_AIRTIME_WEIGHT	256
-+
- /**
-  * struct cfg80211_pmksa - PMK Security Association
-  *
---- a/include/uapi/linux/nl80211.h
-+++ b/include/uapi/linux/nl80211.h
-@@ -2241,6 +2241,9 @@ enum nl80211_commands {
-  *	association request when used with NL80211_CMD_NEW_STATION). Can be set
-  *	only if %NL80211_STA_FLAG_WME is set.
-  *
-+ * @NL80211_ATTR_AIRTIME_WEIGHT: Station's weight when scheduled by the airtime
-+ *	scheduler.
-+ *
-  * @NUM_NL80211_ATTR: total number of nl80211_attrs available
-  * @NL80211_ATTR_MAX: highest attribute number currently defined
-  * @__NL80211_ATTR_AFTER_LAST: internal use
-@@ -2682,6 +2685,14 @@ enum nl80211_attrs {
- 
- 	NL80211_ATTR_HE_CAPABILITY,
- 
-+	/* not backported yet */
-+	NL80211_ATTR_FTM_RESPONDER,
-+	NL80211_ATTR_FTM_RESPONDER_STATS,
-+	NL80211_ATTR_TIMEOUT,
-+	NL80211_ATTR_PEER_MEASUREMENTS,
-+
-+	NL80211_ATTR_AIRTIME_WEIGHT,
-+
- 	/* add attributes here, update the policy in nl80211.c */
- 
- 	__NL80211_ATTR_AFTER_LAST,
-@@ -3052,6 +3063,9 @@ enum nl80211_sta_bss_param {
-  * @NL80211_STA_INFO_ACK_SIGNAL: signal strength of the last ACK frame(u8, dBm)
-  * @NL80211_STA_INFO_DATA_ACK_SIGNAL_AVG: avg signal strength of (data)
-  *	ACK frame (s8, dBm)
-+ * @NL80211_STA_INFO_TX_DURATION: aggregate PPDU duration for all frames
-+ *	sent to the station (u64, usec)
-+ * @NL80211_STA_INFO_AIRTIME_WEIGHT: current airtime weight for station (u16)
-  * @__NL80211_STA_INFO_AFTER_LAST: internal
-  * @NL80211_STA_INFO_MAX: highest possible station info attribute
-  */
-@@ -3093,6 +3107,14 @@ enum nl80211_sta_info {
- 	NL80211_STA_INFO_ACK_SIGNAL,
- 	NL80211_STA_INFO_DATA_ACK_SIGNAL_AVG,
- 
-+	/* not backported yet */
-+	NL80211_STA_INFO_RX_MPDUS,
-+	NL80211_STA_INFO_FCS_ERROR_COUNT,
-+	NL80211_STA_INFO_CONNECTED_TO_GATE,
-+
-+	NL80211_STA_INFO_TX_DURATION,
-+	NL80211_STA_INFO_AIRTIME_WEIGHT,
-+
- 	/* keep last */
- 	__NL80211_STA_INFO_AFTER_LAST,
- 	NL80211_STA_INFO_MAX = __NL80211_STA_INFO_AFTER_LAST - 1
-@@ -5224,6 +5246,10 @@ enum nl80211_feature_flags {
-  *	except for supported rates from the probe request content if requested
-  *	by the %NL80211_SCAN_FLAG_MIN_PREQ_CONTENT flag.
-  *
-+ * @NL80211_EXT_FEATURE_AIRTIME_FAIRNESS: Driver supports getting airtime
-+ *	fairness for transmitted packets and has enabled airtime fairness
-+ *	scheduling.
-+ *
-  * @NUM_NL80211_EXT_FEATURES: number of extended features.
-  * @MAX_NL80211_EXT_FEATURES: highest extended feature index.
-  */
-@@ -5260,6 +5286,12 @@ enum nl80211_ext_feature_index {
- 	NL80211_EXT_FEATURE_SCAN_RANDOM_SN,
- 	NL80211_EXT_FEATURE_SCAN_MIN_PREQ_CONTENT,
- 
-+	/* --- not backported yet --- */
-+	NL80211_EXT_FEATURE_CAN_REPLACE_PTK0,
-+	NL80211_EXT_FEATURE_ENABLE_FTM_RESPONDER,
-+
-+	NL80211_EXT_FEATURE_AIRTIME_FAIRNESS,
-+
- 	/* add new features before the definition below */
- 	NUM_NL80211_EXT_FEATURES,
- 	MAX_NL80211_EXT_FEATURES = NUM_NL80211_EXT_FEATURES - 1
---- a/net/wireless/nl80211.c
-+++ b/net/wireless/nl80211.c
-@@ -430,6 +430,7 @@ static const struct nla_policy nl80211_p
- 	[NL80211_ATTR_TXQ_QUANTUM] = { .type = NLA_U32 },
- 	[NL80211_ATTR_HE_CAPABILITY] = { .type = NLA_BINARY,
- 					 .len = NL80211_HE_MAX_CAPABILITY_LEN },
-+	[NL80211_ATTR_AIRTIME_WEIGHT] = NLA_POLICY_MIN(NLA_U16, 1),
- };
- 
- /* policy for the key attributes */
-@@ -4658,6 +4659,11 @@ static int nl80211_send_station(struct s
- 	PUT_SINFO(PLID, plid, u16);
- 	PUT_SINFO(PLINK_STATE, plink_state, u8);
- 	PUT_SINFO_U64(RX_DURATION, rx_duration);
-+	PUT_SINFO_U64(TX_DURATION, tx_duration);
-+
-+	if (wiphy_ext_feature_isset(&rdev->wiphy,
-+				    NL80211_EXT_FEATURE_AIRTIME_FAIRNESS))
-+		PUT_SINFO(AIRTIME_WEIGHT, airtime_weight, u16);
- 
- 	switch (rdev->wiphy.signal_type) {
- 	case CFG80211_SIGNAL_TYPE_MBM:
-@@ -5294,6 +5300,15 @@ static int nl80211_set_station(struct sk
- 			nla_get_u8(info->attrs[NL80211_ATTR_OPMODE_NOTIF]);
- 	}
- 
-+	if (info->attrs[NL80211_ATTR_AIRTIME_WEIGHT])
-+		params.airtime_weight =
-+			nla_get_u16(info->attrs[NL80211_ATTR_AIRTIME_WEIGHT]);
-+
-+	if (params.airtime_weight &&
-+	    !wiphy_ext_feature_isset(&rdev->wiphy,
-+				     NL80211_EXT_FEATURE_AIRTIME_FAIRNESS))
-+		return -EOPNOTSUPP;
-+
- 	/* Include parameters for TDLS peer (will check later) */
- 	err = nl80211_set_station_tdls(info, &params);
- 	if (err)
-@@ -5432,6 +5447,15 @@ static int nl80211_new_station(struct sk
- 			return -EINVAL;
- 	}
- 
-+	if (info->attrs[NL80211_ATTR_AIRTIME_WEIGHT])
-+		params.airtime_weight =
-+			nla_get_u16(info->attrs[NL80211_ATTR_AIRTIME_WEIGHT]);
-+
-+	if (params.airtime_weight &&
-+	    !wiphy_ext_feature_isset(&rdev->wiphy,
-+				     NL80211_EXT_FEATURE_AIRTIME_FAIRNESS))
-+		return -EOPNOTSUPP;
-+
- 	err = nl80211_parse_sta_channel_info(info, &params);
- 	if (err)
- 		return err;
diff --git a/package/kernel/mac80211/patches/subsys/322-mac80211-Add-airtime-accounting-and-scheduling-to-TX.patch b/package/kernel/mac80211/patches/subsys/322-mac80211-Add-airtime-accounting-and-scheduling-to-TX.patch
deleted file mode 100644
index d4176eb491..0000000000
--- a/package/kernel/mac80211/patches/subsys/322-mac80211-Add-airtime-accounting-and-scheduling-to-TX.patch
+++ /dev/null
@@ -1,522 +0,0 @@
-From: =?UTF-8?q?Toke=20H=C3=B8iland-J=C3=B8rgensen?= <toke at toke.dk>
-Date: Tue, 18 Dec 2018 17:02:08 -0800
-Subject: [PATCH] mac80211: Add airtime accounting and scheduling to TXQs
-MIME-Version: 1.0
-Content-Type: text/plain; charset=UTF-8
-Content-Transfer-Encoding: 8bit
-
-This adds airtime accounting and scheduling to the mac80211 TXQ
-scheduler. A new callback, ieee80211_sta_register_airtime(), is added
-that drivers can call to report airtime usage for stations.
-
-When airtime information is present, mac80211 will schedule TXQs
-(through ieee80211_next_txq()) in a way that enforces airtime fairness
-between active stations. This scheduling works the same way as the ath9k
-in-driver airtime fairness scheduling. If no airtime usage is reported
-by the driver, the scheduler will default to round-robin scheduling.
-
-For drivers that don't control TXQ scheduling in software, a new API
-function, ieee80211_txq_may_transmit(), is added which the driver can use
-to check if the TXQ is eligible for transmission, or should be throttled to
-enforce fairness. Calls to this function must also be enclosed in
-ieee80211_txq_schedule_{start,end}() calls to ensure proper locking.
-
-The API ieee80211_txq_may_transmit() also ensures that TXQ list will be
-aligned aginst driver's own round-robin scheduler list. i.e it rotates
-the TXQ list till it makes the requested node becomes the first entry
-in TXQ list. Thus both the TXQ list and driver's list are in sync.
-
-Co-developed-by: Rajkumar Manoharan <rmanohar at codeaurora.org>
-Signed-off-by: Louie Lu <git at louie.lu>
-[added debugfs write op to reset airtime counter]
-Signed-off-by: Toke Høiland-Jørgensen <toke at toke.dk>
-Signed-off-by: Rajkumar Manoharan <rmanohar at codeaurora.org>
-Signed-off-by: Johannes Berg <johannes.berg at intel.com>
----
-
---- a/include/net/mac80211.h
-+++ b/include/net/mac80211.h
-@@ -2304,6 +2304,9 @@ enum ieee80211_hw_flags {
-  *	supported by HW.
-  * @max_nan_de_entries: maximum number of NAN DE functions supported by the
-  *	device.
-+ *
-+ * @weight_multipler: Driver specific airtime weight multiplier used while
-+ *	refilling deficit of each TXQ.
-  */
- struct ieee80211_hw {
- 	struct ieee80211_conf conf;
-@@ -2339,6 +2342,7 @@ struct ieee80211_hw {
- 	u8 n_cipher_schemes;
- 	const struct ieee80211_cipher_scheme *cipher_schemes;
- 	u8 max_nan_de_entries;
-+	u8 weight_multiplier;
- };
- 
- static inline bool _ieee80211_hw_check(struct ieee80211_hw *hw,
-@@ -5299,6 +5303,34 @@ void ieee80211_sta_eosp(struct ieee80211
- void ieee80211_send_eosp_nullfunc(struct ieee80211_sta *pubsta, int tid);
- 
- /**
-+ * ieee80211_sta_register_airtime - register airtime usage for a sta/tid
-+ *
-+ * Register airtime usage for a given sta on a given tid. The driver can call
-+ * this function to notify mac80211 that a station used a certain amount of
-+ * airtime. This information will be used by the TXQ scheduler to schedule
-+ * stations in a way that ensures airtime fairness.
-+ *
-+ * The reported airtime should as a minimum include all time that is spent
-+ * transmitting to the remote station, including overhead and padding, but not
-+ * including time spent waiting for a TXOP. If the time is not reported by the
-+ * hardware it can in some cases be calculated from the rate and known frame
-+ * composition. When possible, the time should include any failed transmission
-+ * attempts.
-+ *
-+ * The driver can either call this function synchronously for every packet or
-+ * aggregate, or asynchronously as airtime usage information becomes available.
-+ * TX and RX airtime can be reported together, or separately by setting one of
-+ * them to 0.
-+ *
-+ * @pubsta: the station
-+ * @tid: the TID to register airtime for
-+ * @tx_airtime: airtime used during TX (in usec)
-+ * @rx_airtime: airtime used during RX (in usec)
-+ */
-+void ieee80211_sta_register_airtime(struct ieee80211_sta *pubsta, u8 tid,
-+				    u32 tx_airtime, u32 rx_airtime);
-+
-+/**
-  * ieee80211_iter_keys - iterate keys programmed into the device
-  * @hw: pointer obtained from ieee80211_alloc_hw()
-  * @vif: virtual interface to iterate, may be %NULL for all
-@@ -6042,6 +6074,33 @@ void ieee80211_txq_schedule_end(struct i
- 	__releases(txq_lock);
- 
- /**
-+ * ieee80211_txq_may_transmit - check whether TXQ is allowed to transmit
-+ *
-+ * This function is used to check whether given txq is allowed to transmit by
-+ * the airtime scheduler, and can be used by drivers to access the airtime
-+ * fairness accounting without going using the scheduling order enfored by
-+ * next_txq().
-+ *
-+ * Returns %true if the airtime scheduler thinks the TXQ should be allowed to
-+ * transmit, and %false if it should be throttled. This function can also have
-+ * the side effect of rotating the TXQ in the scheduler rotation, which will
-+ * eventually bring the deficit to positive and allow the station to transmit
-+ * again.
-+ *
-+ * The API ieee80211_txq_may_transmit() also ensures that TXQ list will be
-+ * aligned aginst driver's own round-robin scheduler list. i.e it rotates
-+ * the TXQ list till it makes the requested node becomes the first entry
-+ * in TXQ list. Thus both the TXQ list and driver's list are in sync. If this
-+ * function returns %true, the driver is expected to schedule packets
-+ * for transmission, and then return the TXQ through ieee80211_return_txq().
-+ *
-+ * @hw: pointer as obtained from ieee80211_alloc_hw()
-+ * @txq: pointer obtained from station or virtual interface
-+ */
-+bool ieee80211_txq_may_transmit(struct ieee80211_hw *hw,
-+				struct ieee80211_txq *txq);
-+
-+/**
-  * ieee80211_txq_get_depth - get pending frame/byte count of given txq
-  *
-  * The values are not guaranteed to be coherent with regard to each other, i.e.
---- a/net/mac80211/cfg.c
-+++ b/net/mac80211/cfg.c
-@@ -1434,6 +1434,9 @@ static int sta_apply_parameters(struct i
- 	if (ieee80211_vif_is_mesh(&sdata->vif))
- 		sta_apply_mesh_params(local, sta, params);
- 
-+	if (params->airtime_weight)
-+		sta->airtime_weight = params->airtime_weight;
-+
- 	/* set the STA state after all sta info from usermode has been set */
- 	if (test_sta_flag(sta, WLAN_STA_TDLS_PEER) ||
- 	    set & BIT(NL80211_STA_FLAG_ASSOCIATED)) {
---- a/net/mac80211/debugfs.c
-+++ b/net/mac80211/debugfs.c
-@@ -380,6 +380,9 @@ void debugfs_hw_add(struct ieee80211_loc
- 	if (local->ops->wake_tx_queue)
- 		DEBUGFS_ADD_MODE(aqm, 0600);
- 
-+	debugfs_create_u16("airtime_flags", 0600,
-+			   phyd, &local->airtime_flags);
-+
- 	statsd = debugfs_create_dir("statistics", phyd);
- 
- 	/* if the dir failed, don't put all the other things into the root! */
---- a/net/mac80211/debugfs_sta.c
-+++ b/net/mac80211/debugfs_sta.c
-@@ -178,9 +178,9 @@ static ssize_t sta_aqm_read(struct file
- 			       txqi->tin.tx_bytes,
- 			       txqi->tin.tx_packets,
- 			       txqi->flags,
--			       txqi->flags & (1<<IEEE80211_TXQ_STOP) ? "STOP" : "RUN",
--			       txqi->flags & (1<<IEEE80211_TXQ_AMPDU) ? " AMPDU" : "",
--			       txqi->flags & (1<<IEEE80211_TXQ_NO_AMSDU) ? " NO-AMSDU" : "");
-+			       test_bit(IEEE80211_TXQ_STOP, &txqi->flags) ? "STOP" : "RUN",
-+			       test_bit(IEEE80211_TXQ_AMPDU, &txqi->flags) ? " AMPDU" : "",
-+			       test_bit(IEEE80211_TXQ_NO_AMSDU, &txqi->flags) ? " NO-AMSDU" : "");
- 	}
- 
- 	rcu_read_unlock();
-@@ -192,6 +192,64 @@ static ssize_t sta_aqm_read(struct file
- }
- STA_OPS(aqm);
- 
-+static ssize_t sta_airtime_read(struct file *file, char __user *userbuf,
-+				size_t count, loff_t *ppos)
-+{
-+	struct sta_info *sta = file->private_data;
-+	struct ieee80211_local *local = sta->sdata->local;
-+	size_t bufsz = 200;
-+	char *buf = kzalloc(bufsz, GFP_KERNEL), *p = buf;
-+	u64 rx_airtime = 0, tx_airtime = 0;
-+	s64 deficit[IEEE80211_NUM_ACS];
-+	ssize_t rv;
-+	int ac;
-+
-+	if (!buf)
-+		return -ENOMEM;
-+
-+	for (ac = 0; ac < IEEE80211_NUM_ACS; ac++) {
-+		spin_lock_bh(&local->active_txq_lock[ac]);
-+		rx_airtime += sta->airtime[ac].rx_airtime;
-+		tx_airtime += sta->airtime[ac].tx_airtime;
-+		deficit[ac] = sta->airtime[ac].deficit;
-+		spin_unlock_bh(&local->active_txq_lock[ac]);
-+	}
-+
-+	p += scnprintf(p, bufsz + buf - p,
-+		"RX: %llu us\nTX: %llu us\nWeight: %u\n"
-+		"Deficit: VO: %lld us VI: %lld us BE: %lld us BK: %lld us\n",
-+		rx_airtime,
-+		tx_airtime,
-+		sta->airtime_weight,
-+		deficit[0],
-+		deficit[1],
-+		deficit[2],
-+		deficit[3]);
-+
-+	rv = simple_read_from_buffer(userbuf, count, ppos, buf, p - buf);
-+	kfree(buf);
-+	return rv;
-+}
-+
-+static ssize_t sta_airtime_write(struct file *file, const char __user *userbuf,
-+				 size_t count, loff_t *ppos)
-+{
-+	struct sta_info *sta = file->private_data;
-+	struct ieee80211_local *local = sta->sdata->local;
-+	int ac;
-+
-+	for (ac = 0; ac < IEEE80211_NUM_ACS; ac++) {
-+		spin_lock_bh(&local->active_txq_lock[ac]);
-+		sta->airtime[ac].rx_airtime = 0;
-+		sta->airtime[ac].tx_airtime = 0;
-+		sta->airtime[ac].deficit = sta->airtime_weight;
-+		spin_unlock_bh(&local->active_txq_lock[ac]);
-+	}
-+
-+	return count;
-+}
-+STA_OPS_RW(airtime);
-+
- static ssize_t sta_agg_status_read(struct file *file, char __user *userbuf,
- 					size_t count, loff_t *ppos)
- {
-@@ -546,6 +604,10 @@ void ieee80211_sta_debugfs_add(struct st
- 	if (local->ops->wake_tx_queue)
- 		DEBUGFS_ADD(aqm);
- 
-+	if (wiphy_ext_feature_isset(local->hw.wiphy,
-+				    NL80211_EXT_FEATURE_AIRTIME_FAIRNESS))
-+		DEBUGFS_ADD(airtime);
-+
- 	if (sizeof(sta->driver_buffered_tids) == sizeof(u32))
- 		debugfs_create_x32("driver_buffered_tids", 0400,
- 				   sta->debugfs_dir,
---- a/net/mac80211/ieee80211_i.h
-+++ b/net/mac80211/ieee80211_i.h
-@@ -1136,6 +1136,8 @@ struct ieee80211_local {
- 	struct list_head active_txqs[IEEE80211_NUM_ACS];
- 	u16 schedule_round[IEEE80211_NUM_ACS];
- 
-+	u16 airtime_flags;
-+
- 	const struct ieee80211_ops *ops;
- 
- 	/*
---- a/net/mac80211/main.c
-+++ b/net/mac80211/main.c
-@@ -656,6 +656,7 @@ struct ieee80211_hw *ieee80211_alloc_hw_
- 		INIT_LIST_HEAD(&local->active_txqs[i]);
- 		spin_lock_init(&local->active_txq_lock[i]);
- 	}
-+	local->airtime_flags = AIRTIME_USE_TX | AIRTIME_USE_RX;
- 
- 	INIT_LIST_HEAD(&local->chanctx_list);
- 	mutex_init(&local->chanctx_mtx);
-@@ -1142,6 +1143,9 @@ int ieee80211_register_hw(struct ieee802
- 	if (!local->hw.max_nan_de_entries)
- 		local->hw.max_nan_de_entries = IEEE80211_MAX_NAN_INSTANCE_ID;
- 
-+	if (!local->hw.weight_multiplier)
-+		local->hw.weight_multiplier = 1;
-+
- 	result = ieee80211_wep_init(local);
- 	if (result < 0)
- 		wiphy_debug(local->hw.wiphy, "Failed to initialize wep: %d\n",
---- a/net/mac80211/sta_info.c
-+++ b/net/mac80211/sta_info.c
-@@ -90,7 +90,6 @@ static void __cleanup_single_sta(struct
- 	struct tid_ampdu_tx *tid_tx;
- 	struct ieee80211_sub_if_data *sdata = sta->sdata;
- 	struct ieee80211_local *local = sdata->local;
--	struct fq *fq = &local->fq;
- 	struct ps_data *ps;
- 
- 	if (test_sta_flag(sta, WLAN_STA_PS_STA) ||
-@@ -115,9 +114,7 @@ static void __cleanup_single_sta(struct
- 		for (i = 0; i < ARRAY_SIZE(sta->sta.txq); i++) {
- 			struct txq_info *txqi = to_txq_info(sta->sta.txq[i]);
- 
--			spin_lock_bh(&fq->lock);
- 			ieee80211_txq_purge(local, txqi);
--			spin_unlock_bh(&fq->lock);
- 		}
- 	}
- 
-@@ -381,9 +378,12 @@ struct sta_info *sta_info_alloc(struct i
- 	if (sta_prepare_rate_control(local, sta, gfp))
- 		goto free_txq;
- 
-+	sta->airtime_weight = IEEE80211_DEFAULT_AIRTIME_WEIGHT;
-+
- 	for (i = 0; i < IEEE80211_NUM_ACS; i++) {
- 		skb_queue_head_init(&sta->ps_tx_buf[i]);
- 		skb_queue_head_init(&sta->tx_filtered[i]);
-+		sta->airtime[i].deficit = sta->airtime_weight;
- 	}
- 
- 	for (i = 0; i < IEEE80211_NUM_TIDS; i++)
-@@ -1821,6 +1821,27 @@ void ieee80211_sta_set_buffered(struct i
- }
- EXPORT_SYMBOL(ieee80211_sta_set_buffered);
- 
-+void ieee80211_sta_register_airtime(struct ieee80211_sta *pubsta, u8 tid,
-+				    u32 tx_airtime, u32 rx_airtime)
-+{
-+	struct sta_info *sta = container_of(pubsta, struct sta_info, sta);
-+	struct ieee80211_local *local = sta->sdata->local;
-+	u8 ac = ieee80211_ac_from_tid(tid);
-+	u32 airtime = 0;
-+
-+	if (sta->local->airtime_flags & AIRTIME_USE_TX)
-+		airtime += tx_airtime;
-+	if (sta->local->airtime_flags & AIRTIME_USE_RX)
-+		airtime += rx_airtime;
-+
-+	spin_lock_bh(&local->active_txq_lock[ac]);
-+	sta->airtime[ac].tx_airtime += tx_airtime;
-+	sta->airtime[ac].rx_airtime += rx_airtime;
-+	sta->airtime[ac].deficit -= airtime;
-+	spin_unlock_bh(&local->active_txq_lock[ac]);
-+}
-+EXPORT_SYMBOL(ieee80211_sta_register_airtime);
-+
- int sta_info_move_state(struct sta_info *sta,
- 			enum ieee80211_sta_state new_state)
- {
-@@ -2183,6 +2204,23 @@ void sta_set_sinfo(struct sta_info *sta,
- 		sinfo->filled |= BIT_ULL(NL80211_STA_INFO_TX_FAILED);
- 	}
- 
-+	if (!(sinfo->filled & BIT_ULL(NL80211_STA_INFO_RX_DURATION))) {
-+		for (ac = 0; ac < IEEE80211_NUM_ACS; ac++)
-+			sinfo->rx_duration += sta->airtime[ac].rx_airtime;
-+		sinfo->filled |= BIT_ULL(NL80211_STA_INFO_RX_DURATION);
-+	}
-+
-+	if (!(sinfo->filled & BIT_ULL(NL80211_STA_INFO_TX_DURATION))) {
-+		for (ac = 0; ac < IEEE80211_NUM_ACS; ac++)
-+			sinfo->tx_duration += sta->airtime[ac].tx_airtime;
-+		sinfo->filled |= BIT_ULL(NL80211_STA_INFO_TX_DURATION);
-+	}
-+
-+	if (!(sinfo->filled & BIT_ULL(NL80211_STA_INFO_AIRTIME_WEIGHT))) {
-+		sinfo->airtime_weight = sta->airtime_weight;
-+		sinfo->filled |= BIT_ULL(NL80211_STA_INFO_AIRTIME_WEIGHT);
-+	}
-+
- 	sinfo->rx_dropped_misc = sta->rx_stats.dropped;
- 	if (sta->pcpu_rx_stats) {
- 		for_each_possible_cpu(cpu) {
---- a/net/mac80211/sta_info.h
-+++ b/net/mac80211/sta_info.h
-@@ -127,6 +127,16 @@ enum ieee80211_agg_stop_reason {
- 	AGG_STOP_DESTROY_STA,
- };
- 
-+/* Debugfs flags to enable/disable use of RX/TX airtime in scheduler */
-+#define AIRTIME_USE_TX		BIT(0)
-+#define AIRTIME_USE_RX		BIT(1)
-+
-+struct airtime_info {
-+	u64 rx_airtime;
-+	u64 tx_airtime;
-+	s64 deficit;
-+};
-+
- struct sta_info;
- 
- /**
-@@ -563,6 +573,9 @@ struct sta_info {
- 	} tx_stats;
- 	u16 tid_seq[IEEE80211_QOS_CTL_TID_MASK + 1];
- 
-+	struct airtime_info airtime[IEEE80211_NUM_ACS];
-+	u16 airtime_weight;
-+
- 	/*
- 	 * Aggregation information, locked with lock.
- 	 */
---- a/net/mac80211/status.c
-+++ b/net/mac80211/status.c
-@@ -825,6 +825,12 @@ static void __ieee80211_tx_status(struct
- 			ieee80211_sta_tx_notify(sta->sdata, (void *) skb->data,
- 						acked, info->status.tx_time);
- 
-+		if (info->status.tx_time &&
-+		    wiphy_ext_feature_isset(local->hw.wiphy,
-+					    NL80211_EXT_FEATURE_AIRTIME_FAIRNESS))
-+			ieee80211_sta_register_airtime(&sta->sta, tid,
-+						       info->status.tx_time, 0);
-+
- 		if (ieee80211_hw_check(&local->hw, REPORTS_TX_ACK_STATUS)) {
- 			if (info->flags & IEEE80211_TX_STAT_ACK) {
- 				if (sta->status_stats.lost_packets)
---- a/net/mac80211/tx.c
-+++ b/net/mac80211/tx.c
-@@ -1463,8 +1463,11 @@ void ieee80211_txq_purge(struct ieee8021
- 	struct fq *fq = &local->fq;
- 	struct fq_tin *tin = &txqi->tin;
- 
-+	spin_lock_bh(&fq->lock);
- 	fq_tin_reset(fq, tin, fq_skb_free_func);
- 	ieee80211_purge_tx_queue(&local->hw, &txqi->frags);
-+	spin_unlock_bh(&fq->lock);
-+
- 	spin_lock_bh(&local->active_txq_lock[txqi->txq.ac]);
- 	list_del_init(&txqi->schedule_order);
- 	spin_unlock_bh(&local->active_txq_lock[txqi->txq.ac]);
-@@ -3613,11 +3616,28 @@ struct ieee80211_txq *ieee80211_next_txq
- 
- 	lockdep_assert_held(&local->active_txq_lock[ac]);
- 
-+ begin:
- 	txqi = list_first_entry_or_null(&local->active_txqs[ac],
- 					struct txq_info,
- 					schedule_order);
-+	if (!txqi)
-+		return NULL;
-+
-+	if (txqi->txq.sta) {
-+		struct sta_info *sta = container_of(txqi->txq.sta,
-+						struct sta_info, sta);
-+
-+		if (sta->airtime[txqi->txq.ac].deficit < 0) {
-+			sta->airtime[txqi->txq.ac].deficit +=
-+				sta->airtime_weight;
-+			list_move_tail(&txqi->schedule_order,
-+				       &local->active_txqs[txqi->txq.ac]);
-+			goto begin;
-+		}
-+	}
-+
- 
--	if (!txqi || txqi->schedule_round == local->schedule_round[ac])
-+	if (txqi->schedule_round == local->schedule_round[ac])
- 		return NULL;
- 
- 	list_del_init(&txqi->schedule_order);
-@@ -3635,12 +3655,74 @@ void ieee80211_return_txq(struct ieee802
- 	lockdep_assert_held(&local->active_txq_lock[txq->ac]);
- 
- 	if (list_empty(&txqi->schedule_order) &&
--	    (!skb_queue_empty(&txqi->frags) || txqi->tin.backlog_packets))
--		list_add_tail(&txqi->schedule_order,
--			      &local->active_txqs[txq->ac]);
-+	    (!skb_queue_empty(&txqi->frags) || txqi->tin.backlog_packets)) {
-+		/* If airtime accounting is active, always enqueue STAs at the
-+		 * head of the list to ensure that they only get moved to the
-+		 * back by the airtime DRR scheduler once they have a negative
-+		 * deficit. A station that already has a negative deficit will
-+		 * get immediately moved to the back of the list on the next
-+		 * call to ieee80211_next_txq().
-+		 */
-+		if (txqi->txq.sta &&
-+		    wiphy_ext_feature_isset(local->hw.wiphy,
-+					    NL80211_EXT_FEATURE_AIRTIME_FAIRNESS))
-+			list_add(&txqi->schedule_order,
-+				 &local->active_txqs[txq->ac]);
-+		else
-+			list_add_tail(&txqi->schedule_order,
-+				      &local->active_txqs[txq->ac]);
-+	}
- }
- EXPORT_SYMBOL(ieee80211_return_txq);
- 
-+bool ieee80211_txq_may_transmit(struct ieee80211_hw *hw,
-+				struct ieee80211_txq *txq)
-+{
-+	struct ieee80211_local *local = hw_to_local(hw);
-+	struct txq_info *iter, *tmp, *txqi = to_txq_info(txq);
-+	struct sta_info *sta;
-+	u8 ac = txq->ac;
-+
-+	lockdep_assert_held(&local->active_txq_lock[ac]);
-+
-+	if (!txqi->txq.sta)
-+		goto out;
-+
-+	if (list_empty(&txqi->schedule_order))
-+		goto out;
-+
-+	list_for_each_entry_safe(iter, tmp, &local->active_txqs[ac],
-+				 schedule_order) {
-+		if (iter == txqi)
-+			break;
-+
-+		if (!iter->txq.sta) {
-+			list_move_tail(&iter->schedule_order,
-+				       &local->active_txqs[ac]);
-+			continue;
-+		}
-+		sta = container_of(iter->txq.sta, struct sta_info, sta);
-+		if (sta->airtime[ac].deficit < 0)
-+			sta->airtime[ac].deficit += sta->airtime_weight;
-+		list_move_tail(&iter->schedule_order, &local->active_txqs[ac]);
-+	}
-+
-+	sta = container_of(txqi->txq.sta, struct sta_info, sta);
-+	if (sta->airtime[ac].deficit >= 0)
-+		goto out;
-+
-+	sta->airtime[ac].deficit += sta->airtime_weight;
-+	list_move_tail(&txqi->schedule_order, &local->active_txqs[ac]);
-+
-+	return false;
-+out:
-+	if (!list_empty(&txqi->schedule_order))
-+		list_del_init(&txqi->schedule_order);
-+
-+	return true;
-+}
-+EXPORT_SYMBOL(ieee80211_txq_may_transmit);
-+
- void ieee80211_txq_schedule_start(struct ieee80211_hw *hw, u8 ac)
- 	__acquires(txq_lock)
- {
diff --git a/package/kernel/mac80211/patches/subsys/323-mac80211-Expose-ieee80211_schedule_txq-function.patch b/package/kernel/mac80211/patches/subsys/323-mac80211-Expose-ieee80211_schedule_txq-function.patch
deleted file mode 100644
index 573f9bd135..0000000000
--- a/package/kernel/mac80211/patches/subsys/323-mac80211-Expose-ieee80211_schedule_txq-function.patch
+++ /dev/null
@@ -1,73 +0,0 @@
-From: =?UTF-8?q?Toke=20H=C3=B8iland-J=C3=B8rgensen?= <toke at redhat.com>
-Date: Tue, 22 Jan 2019 15:20:16 +0100
-Subject: [PATCH] mac80211: Expose ieee80211_schedule_txq() function
-MIME-Version: 1.0
-Content-Type: text/plain; charset=UTF-8
-Content-Transfer-Encoding: 8bit
-
-Since we reworked ieee80211_return_txq() so it assumes that the caller
-takes care of logging, we need another function that can be called without
-holding any locks. Introduce ieee80211_schedule_txq() which serves this
-purpose.
-
-Signed-off-by: Toke Høiland-Jørgensen <toke at redhat.com>
-Signed-off-by: Johannes Berg <johannes.berg at intel.com>
----
-
---- a/include/net/mac80211.h
-+++ b/include/net/mac80211.h
-@@ -6074,6 +6074,19 @@ void ieee80211_txq_schedule_end(struct i
- 	__releases(txq_lock);
- 
- /**
-+ * ieee80211_schedule_txq - schedule a TXQ for transmission
-+ *
-+ * @hw: pointer as obtained from ieee80211_alloc_hw()
-+ * @txq: pointer obtained from station or virtual interface
-+ *
-+ * Schedules a TXQ for transmission if it is not already scheduled. Takes a
-+ * lock, which means it must *not* be called between
-+ * ieee80211_txq_schedule_start() and ieee80211_txq_schedule_end()
-+ */
-+void ieee80211_schedule_txq(struct ieee80211_hw *hw, struct ieee80211_txq *txq)
-+	__acquires(txq_lock) __releases(txq_lock);
-+
-+/**
-  * ieee80211_txq_may_transmit - check whether TXQ is allowed to transmit
-  *
-  * This function is used to check whether given txq is allowed to transmit by
---- a/net/mac80211/driver-ops.h
-+++ b/net/mac80211/driver-ops.h
-@@ -1179,9 +1179,7 @@ static inline void drv_wake_tx_queue(str
- static inline void schedule_and_wake_txq(struct ieee80211_local *local,
- 					 struct txq_info *txqi)
- {
--	spin_lock_bh(&local->active_txq_lock[txqi->txq.ac]);
--	ieee80211_return_txq(&local->hw, &txqi->txq);
--	spin_unlock_bh(&local->active_txq_lock[txqi->txq.ac]);
-+	ieee80211_schedule_txq(&local->hw, &txqi->txq);
- 	drv_wake_tx_queue(local, txqi);
- }
- 
---- a/net/mac80211/tx.c
-+++ b/net/mac80211/tx.c
-@@ -3675,6 +3675,19 @@ void ieee80211_return_txq(struct ieee802
- }
- EXPORT_SYMBOL(ieee80211_return_txq);
- 
-+void ieee80211_schedule_txq(struct ieee80211_hw *hw,
-+			    struct ieee80211_txq *txq)
-+	__acquires(txq_lock) __releases(txq_lock)
-+{
-+	struct ieee80211_local *local = hw_to_local(hw);
-+	struct txq_info *txqi = to_txq_info(txq);
-+
-+	spin_lock_bh(&local->active_txq_lock[txq->ac]);
-+	ieee80211_return_txq(hw, txq);
-+	spin_unlock_bh(&local->active_txq_lock[txq->ac]);
-+}
-+EXPORT_SYMBOL(ieee80211_schedule_txq);
-+
- bool ieee80211_txq_may_transmit(struct ieee80211_hw *hw,
- 				struct ieee80211_txq *txq)
- {
diff --git a/package/kernel/mac80211/patches/subsys/350-mac80211-add-hdrlen-to-ieee80211_tx_data.patch b/package/kernel/mac80211/patches/subsys/350-mac80211-add-hdrlen-to-ieee80211_tx_data.patch
index 2759895c98..e88163eb5d 100644
--- a/package/kernel/mac80211/patches/subsys/350-mac80211-add-hdrlen-to-ieee80211_tx_data.patch
+++ b/package/kernel/mac80211/patches/subsys/350-mac80211-add-hdrlen-to-ieee80211_tx_data.patch
@@ -11,7 +11,7 @@ Signed-off-by: Felix Fietkau <nbd at nbd.name>
 
 --- a/net/mac80211/ieee80211_i.h
 +++ b/net/mac80211/ieee80211_i.h
-@@ -179,6 +179,7 @@ struct ieee80211_tx_data {
+@@ -176,6 +176,7 @@ struct ieee80211_tx_data {
  	struct ieee80211_tx_rate rate;
  
  	unsigned int flags;
@@ -21,7 +21,7 @@ Signed-off-by: Felix Fietkau <nbd at nbd.name>
  
 --- a/net/mac80211/tx.c
 +++ b/net/mac80211/tx.c
-@@ -925,7 +925,7 @@ ieee80211_tx_h_fragment(struct ieee80211
+@@ -921,7 +921,7 @@ ieee80211_tx_h_fragment(struct ieee80211
  	struct ieee80211_tx_info *info = IEEE80211_SKB_CB(skb);
  	struct ieee80211_hdr *hdr = (void *)skb->data;
  	int frag_threshold = tx->local->hw.wiphy->frag_threshold;
@@ -30,7 +30,7 @@ Signed-off-by: Felix Fietkau <nbd at nbd.name>
  	int fragnum;
  
  	/* no matter what happens, tx->skb moves to tx->skbs */
-@@ -946,8 +946,6 @@ ieee80211_tx_h_fragment(struct ieee80211
+@@ -942,8 +942,6 @@ ieee80211_tx_h_fragment(struct ieee80211
  	if (WARN_ON(info->flags & IEEE80211_TX_CTL_AMPDU))
  		return TX_DROP;
  
@@ -39,7 +39,7 @@ Signed-off-by: Felix Fietkau <nbd at nbd.name>
  	/* internal error, why isn't DONTFRAG set? */
  	if (WARN_ON(skb->len + FCS_LEN <= frag_threshold))
  		return TX_DROP;
-@@ -1178,6 +1176,8 @@ ieee80211_tx_prepare(struct ieee80211_su
+@@ -1174,6 +1172,8 @@ ieee80211_tx_prepare(struct ieee80211_su
  
  	hdr = (struct ieee80211_hdr *) skb->data;
  
@@ -48,7 +48,7 @@ Signed-off-by: Felix Fietkau <nbd at nbd.name>
  	if (likely(sta)) {
  		if (!IS_ERR(sta))
  			tx->sta = sta;
-@@ -3525,6 +3525,7 @@ begin:
+@@ -3577,6 +3577,7 @@ begin:
  	tx.local = local;
  	tx.skb = skb;
  	tx.sdata = vif_to_sdata(info->control.vif);
@@ -56,7 +56,7 @@ Signed-off-by: Felix Fietkau <nbd at nbd.name>
  
  	if (txq->sta)
  		tx.sta = container_of(txq->sta, struct sta_info, sta);
-@@ -3551,7 +3552,7 @@ begin:
+@@ -3603,7 +3604,7 @@ begin:
  
  		if (tx.key &&
  		    (tx.key->conf.flags & IEEE80211_KEY_FLAG_GENERATE_IV))
@@ -65,7 +65,7 @@ Signed-off-by: Felix Fietkau <nbd at nbd.name>
  
  		ieee80211_xmit_fast_finish(sta->sdata, sta, pn_offs,
  					   tx.key, skb);
-@@ -4008,6 +4009,7 @@ ieee80211_build_data_template(struct iee
+@@ -4058,6 +4059,7 @@ ieee80211_build_data_template(struct iee
  	hdr = (void *)skb->data;
  	tx.sta = sta_info_get(sdata, hdr->addr1);
  	tx.skb = skb;
@@ -75,7 +75,7 @@ Signed-off-by: Felix Fietkau <nbd at nbd.name>
  		rcu_read_unlock();
 --- a/net/mac80211/util.c
 +++ b/net/mac80211/util.c
-@@ -1390,6 +1390,7 @@ void ieee80211_send_auth(struct ieee8021
+@@ -1538,6 +1538,7 @@ void ieee80211_send_auth(struct ieee8021
  	struct ieee80211_local *local = sdata->local;
  	struct sk_buff *skb;
  	struct ieee80211_mgmt *mgmt;
@@ -83,7 +83,7 @@ Signed-off-by: Felix Fietkau <nbd at nbd.name>
  	int err;
  
  	/* 24 + 6 = header + auth_algo + auth_transaction + status_code */
-@@ -1413,8 +1414,10 @@ void ieee80211_send_auth(struct ieee8021
+@@ -1561,8 +1562,10 @@ void ieee80211_send_auth(struct ieee8021
  		skb_put_data(skb, extra, extra_len);
  
  	if (auth_alg == WLAN_AUTH_SHARED_KEY && transaction == 3) {
@@ -97,7 +97,7 @@ Signed-off-by: Felix Fietkau <nbd at nbd.name>
  
 --- a/net/mac80211/wep.c
 +++ b/net/mac80211/wep.c
-@@ -89,11 +89,11 @@ static void ieee80211_wep_get_iv(struct
+@@ -86,11 +86,11 @@ static void ieee80211_wep_get_iv(struct
  
  static u8 *ieee80211_wep_add_iv(struct ieee80211_local *local,
  				struct sk_buff *skb,
@@ -110,7 +110,7 @@ Signed-off-by: Felix Fietkau <nbd at nbd.name>
  	u8 *newhdr;
  
  	hdr->frame_control |= cpu_to_le16(IEEE80211_FCTL_PROTECTED);
-@@ -101,7 +101,6 @@ static u8 *ieee80211_wep_add_iv(struct i
+@@ -98,7 +98,6 @@ static u8 *ieee80211_wep_add_iv(struct i
  	if (WARN_ON(skb_headroom(skb) < IEEE80211_WEP_IV_LEN))
  		return NULL;
  
@@ -118,7 +118,7 @@ Signed-off-by: Felix Fietkau <nbd at nbd.name>
  	newhdr = skb_push(skb, IEEE80211_WEP_IV_LEN);
  	memmove(newhdr, newhdr + IEEE80211_WEP_IV_LEN, hdrlen);
  
-@@ -160,6 +159,7 @@ int ieee80211_wep_encrypt_data(struct cr
+@@ -157,6 +156,7 @@ int ieee80211_wep_encrypt_data(struct cr
   */
  int ieee80211_wep_encrypt(struct ieee80211_local *local,
  			  struct sk_buff *skb,
@@ -126,7 +126,7 @@ Signed-off-by: Felix Fietkau <nbd at nbd.name>
  			  const u8 *key, int keylen, int keyidx)
  {
  	u8 *iv;
-@@ -169,7 +169,7 @@ int ieee80211_wep_encrypt(struct ieee802
+@@ -166,7 +166,7 @@ int ieee80211_wep_encrypt(struct ieee802
  	if (WARN_ON(skb_tailroom(skb) < IEEE80211_WEP_ICV_LEN))
  		return -1;
  
@@ -135,7 +135,7 @@ Signed-off-by: Felix Fietkau <nbd at nbd.name>
  	if (!iv)
  		return -1;
  
-@@ -307,13 +307,14 @@ static int wep_encrypt_skb(struct ieee80
+@@ -304,13 +304,14 @@ static int wep_encrypt_skb(struct ieee80
  	struct ieee80211_key_conf *hw_key = info->control.hw_key;
  
  	if (!hw_key) {
@@ -154,7 +154,7 @@ Signed-off-by: Felix Fietkau <nbd at nbd.name>
  			return -1;
 --- a/net/mac80211/wep.h
 +++ b/net/mac80211/wep.h
-@@ -22,6 +22,7 @@ int ieee80211_wep_encrypt_data(struct cr
+@@ -19,6 +19,7 @@ int ieee80211_wep_encrypt_data(struct cr
  				size_t klen, u8 *data, size_t data_len);
  int ieee80211_wep_encrypt(struct ieee80211_local *local,
  			  struct sk_buff *skb,
@@ -164,7 +164,7 @@ Signed-off-by: Felix Fietkau <nbd at nbd.name>
  			       size_t klen, u8 *data, size_t data_len);
 --- a/net/mac80211/wpa.c
 +++ b/net/mac80211/wpa.c
-@@ -44,7 +44,7 @@ ieee80211_tx_h_michael_mic_add(struct ie
+@@ -41,7 +41,7 @@ ieee80211_tx_h_michael_mic_add(struct ie
  	    skb->len < 24 || !ieee80211_is_data_present(hdr->frame_control))
  		return TX_CONTINUE;
  
@@ -173,7 +173,7 @@ Signed-off-by: Felix Fietkau <nbd at nbd.name>
  	if (skb->len < hdrlen)
  		return TX_DROP;
  
-@@ -195,7 +195,6 @@ mic_fail_no_key:
+@@ -192,7 +192,6 @@ mic_fail_no_key:
  
  static int tkip_encrypt_skb(struct ieee80211_tx_data *tx, struct sk_buff *skb)
  {
@@ -181,7 +181,7 @@ Signed-off-by: Felix Fietkau <nbd at nbd.name>
  	struct ieee80211_key *key = tx->key;
  	struct ieee80211_tx_info *info = IEEE80211_SKB_CB(skb);
  	unsigned int hdrlen;
-@@ -210,7 +209,7 @@ static int tkip_encrypt_skb(struct ieee8
+@@ -207,7 +206,7 @@ static int tkip_encrypt_skb(struct ieee8
  		return 0;
  	}
  
@@ -190,7 +190,7 @@ Signed-off-by: Felix Fietkau <nbd at nbd.name>
  	len = skb->len - hdrlen;
  
  	if (info->control.hw_key)
-@@ -428,7 +427,7 @@ static int ccmp_encrypt_skb(struct ieee8
+@@ -425,7 +424,7 @@ static int ccmp_encrypt_skb(struct ieee8
  		return 0;
  	}
  
@@ -199,7 +199,7 @@ Signed-off-by: Felix Fietkau <nbd at nbd.name>
  	len = skb->len - hdrlen;
  
  	if (info->control.hw_key)
-@@ -660,7 +659,7 @@ static int gcmp_encrypt_skb(struct ieee8
+@@ -657,7 +656,7 @@ static int gcmp_encrypt_skb(struct ieee8
  		return 0;
  	}
  
@@ -208,7 +208,7 @@ Signed-off-by: Felix Fietkau <nbd at nbd.name>
  	len = skb->len - hdrlen;
  
  	if (info->control.hw_key)
-@@ -800,7 +799,6 @@ static ieee80211_tx_result
+@@ -797,7 +796,6 @@ static ieee80211_tx_result
  ieee80211_crypto_cs_encrypt(struct ieee80211_tx_data *tx,
  			    struct sk_buff *skb)
  {
@@ -216,7 +216,7 @@ Signed-off-by: Felix Fietkau <nbd at nbd.name>
  	struct ieee80211_key *key = tx->key;
  	struct ieee80211_tx_info *info = IEEE80211_SKB_CB(skb);
  	int hdrlen;
-@@ -816,8 +814,7 @@ ieee80211_crypto_cs_encrypt(struct ieee8
+@@ -813,8 +811,7 @@ ieee80211_crypto_cs_encrypt(struct ieee8
  		     pskb_expand_head(skb, iv_len, 0, GFP_ATOMIC)))
  		return TX_DROP;
  
diff --git a/package/kernel/mac80211/patches/subsys/351-mac80211-add-TX_NEEDS_ALIGNED4_SKBS-hw-flag.patch b/package/kernel/mac80211/patches/subsys/351-mac80211-add-TX_NEEDS_ALIGNED4_SKBS-hw-flag.patch
index d8dbecca1b..8d9b6e7de9 100644
--- a/package/kernel/mac80211/patches/subsys/351-mac80211-add-TX_NEEDS_ALIGNED4_SKBS-hw-flag.patch
+++ b/package/kernel/mac80211/patches/subsys/351-mac80211-add-TX_NEEDS_ALIGNED4_SKBS-hw-flag.patch
@@ -20,9 +20,9 @@ Signed-off-by: Felix Fietkau <nbd at nbd.name>
 
 --- a/include/net/mac80211.h
 +++ b/include/net/mac80211.h
-@@ -2140,6 +2140,9 @@ struct ieee80211_txq {
-  * @IEEE80211_HW_TX_STATUS_NO_AMPDU_LEN: Driver does not report accurate A-MPDU
-  *	length in tx status information
+@@ -2266,6 +2266,9 @@ struct ieee80211_txq {
+  * @IEEE80211_HW_EXT_KEY_ID_NATIVE: Driver and hardware are supporting Extended
+  *	Key ID and can handle two unicast keys per station for Rx and Tx.
   *
 + * @IEEE80211_HW_TX_NEEDS_ALIGNED4_SKBS: Driver need aligned skbs to four-byte.
 + *	Padding will be added after ieee80211_hdr, before IV/LLC.
@@ -30,15 +30,15 @@ Signed-off-by: Felix Fietkau <nbd at nbd.name>
   * @NUM_IEEE80211_HW_FLAGS: number of hardware flags, used for sizing arrays
   */
  enum ieee80211_hw_flags {
-@@ -2186,6 +2189,7 @@ enum ieee80211_hw_flags {
- 	IEEE80211_HW_DEAUTH_NEED_MGD_TX_PREP,
- 	IEEE80211_HW_DOESNT_SUPPORT_QOS_NDP,
- 	IEEE80211_HW_TX_STATUS_NO_AMPDU_LEN,
+@@ -2318,6 +2321,7 @@ enum ieee80211_hw_flags {
+ 	IEEE80211_HW_SUPPORTS_MULTI_BSSID,
+ 	IEEE80211_HW_SUPPORTS_ONLY_HE_MULTI_BSSID,
+ 	IEEE80211_HW_EXT_KEY_ID_NATIVE,
 +	IEEE80211_HW_TX_NEEDS_ALIGNED4_SKBS,
  
  	/* keep last, obviously */
  	NUM_IEEE80211_HW_FLAGS
-@@ -2472,6 +2476,40 @@ ieee80211_get_alt_retry_rate(const struc
+@@ -2611,6 +2615,40 @@ ieee80211_get_alt_retry_rate(const struc
  void ieee80211_free_txskb(struct ieee80211_hw *hw, struct sk_buff *skb);
  
  /**
@@ -81,7 +81,7 @@ Signed-off-by: Felix Fietkau <nbd at nbd.name>
   * mac80211 is capable of taking advantage of many hardware
 --- a/net/mac80211/iface.c
 +++ b/net/mac80211/iface.c
-@@ -1871,6 +1871,10 @@ int ieee80211_if_add(struct ieee80211_lo
+@@ -1877,6 +1877,10 @@ int ieee80211_if_add(struct ieee80211_lo
  					+ 8 /* rfc1042/bridge tunnel */
  					- ETH_HLEN /* ethernet hard_header_len */
  					+ IEEE80211_ENCRYPT_HEADROOM;
@@ -94,7 +94,7 @@ Signed-off-by: Felix Fietkau <nbd at nbd.name>
  		ret = dev_alloc_name(ndev, ndev->name);
 --- a/net/mac80211/mesh_pathtbl.c
 +++ b/net/mac80211/mesh_pathtbl.c
-@@ -105,13 +105,15 @@ void mesh_path_assign_nexthop(struct mes
+@@ -102,13 +102,15 @@ void mesh_path_assign_nexthop(struct mes
  static void prepare_for_gate(struct sk_buff *skb, char *dst_addr,
  			     struct mesh_path *gate_mpath)
  {
@@ -113,7 +113,7 @@ Signed-off-by: Felix Fietkau <nbd at nbd.name>
  	if (!(mshdr->flags & MESH_FLAGS_AE)) {
 --- a/net/mac80211/rx.c
 +++ b/net/mac80211/rx.c
-@@ -2597,7 +2597,7 @@ ieee80211_rx_h_mesh_fwding(struct ieee80
+@@ -2673,7 +2673,7 @@ ieee80211_rx_h_mesh_fwding(struct ieee80
  	struct ieee80211_local *local = rx->local;
  	struct ieee80211_sub_if_data *sdata = rx->sdata;
  	struct ieee80211_if_mesh *ifmsh = &sdata->u.mesh;
@@ -122,7 +122,7 @@ Signed-off-by: Felix Fietkau <nbd at nbd.name>
  	int tailroom = 0;
  
  	hdr = (struct ieee80211_hdr *) skb->data;
-@@ -2690,7 +2690,9 @@ ieee80211_rx_h_mesh_fwding(struct ieee80
+@@ -2766,7 +2766,9 @@ ieee80211_rx_h_mesh_fwding(struct ieee80
  	if (sdata->crypto_tx_tailroom_needed_cnt)
  		tailroom = IEEE80211_ENCRYPT_TAILROOM;
  
@@ -133,7 +133,7 @@ Signed-off-by: Felix Fietkau <nbd at nbd.name>
  				       sdata->encrypt_headroom,
  				  tailroom, GFP_ATOMIC);
  	if (!fwd_skb)
-@@ -2722,6 +2724,12 @@ ieee80211_rx_h_mesh_fwding(struct ieee80
+@@ -2798,6 +2800,12 @@ ieee80211_rx_h_mesh_fwding(struct ieee80
  		return RX_DROP_MONITOR;
  	}
  
@@ -148,7 +148,7 @@ Signed-off-by: Felix Fietkau <nbd at nbd.name>
   out:
 --- a/net/mac80211/sta_info.h
 +++ b/net/mac80211/sta_info.h
-@@ -311,7 +311,7 @@ struct ieee80211_fast_tx {
+@@ -308,7 +308,7 @@ struct ieee80211_fast_tx {
  	u8 hdr_len;
  	u8 sa_offs, da_offs, pn_offs;
  	u8 band;
@@ -159,7 +159,7 @@ Signed-off-by: Felix Fietkau <nbd at nbd.name>
  	struct rcu_head rcu_head;
 --- a/net/mac80211/status.c
 +++ b/net/mac80211/status.c
-@@ -515,6 +515,7 @@ static void ieee80211_report_used_skb(st
+@@ -512,6 +512,7 @@ static void ieee80211_report_used_skb(st
  {
  	struct ieee80211_tx_info *info = IEEE80211_SKB_CB(skb);
  	struct ieee80211_hdr *hdr = (void *)skb->data;
@@ -167,7 +167,7 @@ Signed-off-by: Felix Fietkau <nbd at nbd.name>
  	bool acked = info->flags & IEEE80211_TX_STAT_ACK;
  
  	if (dropped)
-@@ -531,7 +532,7 @@ static void ieee80211_report_used_skb(st
+@@ -528,7 +529,7 @@ static void ieee80211_report_used_skb(st
  			skb->dev = NULL;
  		} else {
  			unsigned int hdr_size =
@@ -176,7 +176,7 @@ Signed-off-by: Felix Fietkau <nbd at nbd.name>
  
  			/* Check to see if packet is a TDLS teardown packet */
  			if (ieee80211_is_data(hdr->frame_control) &&
-@@ -655,9 +656,22 @@ void ieee80211_tx_monitor(struct ieee802
+@@ -652,9 +653,22 @@ void ieee80211_tx_monitor(struct ieee802
  	struct sk_buff *skb2;
  	struct ieee80211_tx_info *info = IEEE80211_SKB_CB(skb);
  	struct ieee80211_sub_if_data *sdata;
@@ -201,7 +201,7 @@ Signed-off-by: Felix Fietkau <nbd at nbd.name>
  	if (WARN_ON_ONCE(skb_headroom(skb) < rtap_len)) {
 --- a/net/mac80211/tkip.c
 +++ b/net/mac80211/tkip.c
-@@ -201,10 +201,12 @@ void ieee80211_get_tkip_p2k(struct ieee8
+@@ -198,10 +198,12 @@ void ieee80211_get_tkip_p2k(struct ieee8
  {
  	struct ieee80211_key *key = (struct ieee80211_key *)
  			container_of(keyconf, struct ieee80211_key, conf);
@@ -217,7 +217,7 @@ Signed-off-by: Felix Fietkau <nbd at nbd.name>
  
 --- a/net/mac80211/tx.c
 +++ b/net/mac80211/tx.c
-@@ -1175,8 +1175,7 @@ ieee80211_tx_prepare(struct ieee80211_su
+@@ -1171,8 +1171,7 @@ ieee80211_tx_prepare(struct ieee80211_su
  	info->flags &= ~IEEE80211_TX_INTFL_NEED_TXPROCESSING;
  
  	hdr = (struct ieee80211_hdr *) skb->data;
@@ -227,7 +227,7 @@ Signed-off-by: Felix Fietkau <nbd at nbd.name>
  
  	if (likely(sta)) {
  		if (!IS_ERR(sta))
-@@ -2222,7 +2221,7 @@ netdev_tx_t ieee80211_monitor_start_xmit
+@@ -2244,7 +2243,7 @@ netdev_tx_t ieee80211_monitor_start_xmit
  		goto fail;
  
  	hdr = (struct ieee80211_hdr *)(skb->data + len_rthdr);
@@ -236,7 +236,7 @@ Signed-off-by: Felix Fietkau <nbd at nbd.name>
  
  	if (skb->len < len_rthdr + hdrlen)
  		goto fail;
-@@ -2440,7 +2439,7 @@ static struct sk_buff *ieee80211_build_h
+@@ -2463,7 +2462,7 @@ static struct sk_buff *ieee80211_build_h
  	struct ieee80211_chanctx_conf *chanctx_conf;
  	struct ieee80211_sub_if_data *ap_sdata;
  	enum nl80211_band band;
@@ -245,7 +245,7 @@ Signed-off-by: Felix Fietkau <nbd at nbd.name>
  
  	if (IS_ERR(sta))
  		sta = NULL;
-@@ -2739,7 +2738,9 @@ static struct sk_buff *ieee80211_build_h
+@@ -2774,7 +2773,9 @@ static struct sk_buff *ieee80211_build_h
  	}
  
  	skb_pull(skb, skip_header_bytes);
@@ -255,7 +255,7 @@ Signed-off-by: Felix Fietkau <nbd at nbd.name>
  
  	/*
  	 * So we need to modify the skb header and hence need a copy of
-@@ -2772,6 +2773,9 @@ static struct sk_buff *ieee80211_build_h
+@@ -2807,6 +2808,9 @@ static struct sk_buff *ieee80211_build_h
  		memcpy(skb_push(skb, meshhdrlen), &mesh_hdr, meshhdrlen);
  #endif
  
@@ -265,7 +265,7 @@ Signed-off-by: Felix Fietkau <nbd at nbd.name>
  	if (ieee80211_is_data_qos(fc)) {
  		__le16 *qos_control;
  
-@@ -2947,6 +2951,8 @@ void ieee80211_check_fast_xmit(struct st
+@@ -2983,6 +2987,8 @@ void ieee80211_check_fast_xmit(struct st
  		fc |= cpu_to_le16(IEEE80211_STYPE_QOS_DATA);
  	}
  
@@ -274,7 +274,7 @@ Signed-off-by: Felix Fietkau <nbd at nbd.name>
  	/* We store the key here so there's no point in using rcu_dereference()
  	 * but that's fine because the code that changes the pointers will call
  	 * this function after doing so. For a single CPU that would be enough,
-@@ -3525,7 +3531,7 @@ begin:
+@@ -3577,7 +3583,7 @@ begin:
  	tx.local = local;
  	tx.skb = skb;
  	tx.sdata = vif_to_sdata(info->control.vif);
@@ -283,7 +283,7 @@ Signed-off-by: Felix Fietkau <nbd at nbd.name>
  
  	if (txq->sta)
  		tx.sta = container_of(txq->sta, struct sta_info, sta);
-@@ -4009,7 +4015,7 @@ ieee80211_build_data_template(struct iee
+@@ -4059,7 +4065,7 @@ ieee80211_build_data_template(struct iee
  	hdr = (void *)skb->data;
  	tx.sta = sta_info_get(sdata, hdr->addr1);
  	tx.skb = skb;
@@ -294,10 +294,10 @@ Signed-off-by: Felix Fietkau <nbd at nbd.name>
  		rcu_read_unlock();
 --- a/net/mac80211/debugfs.c
 +++ b/net/mac80211/debugfs.c
-@@ -215,6 +215,7 @@ static const char *hw_flag_names[] = {
- 	FLAG(DEAUTH_NEED_MGD_TX_PREP),
- 	FLAG(DOESNT_SUPPORT_QOS_NDP),
- 	FLAG(TX_STATUS_NO_AMPDU_LEN),
+@@ -272,6 +272,7 @@ static const char *hw_flag_names[] = {
+ 	FLAG(SUPPORTS_MULTI_BSSID),
+ 	FLAG(SUPPORTS_ONLY_HE_MULTI_BSSID),
+ 	FLAG(EXT_KEY_ID_NATIVE),
 +	FLAG(TX_NEEDS_ALIGNED4_SKBS),
  #undef FLAG
  };
diff --git a/package/kernel/mac80211/patches/subsys/352-mac80211-rework-locking-for-txq-scheduling-airtime-f.patch b/package/kernel/mac80211/patches/subsys/352-mac80211-rework-locking-for-txq-scheduling-airtime-f.patch
deleted file mode 100644
index ef67dd1977..0000000000
--- a/package/kernel/mac80211/patches/subsys/352-mac80211-rework-locking-for-txq-scheduling-airtime-f.patch
+++ /dev/null
@@ -1,214 +0,0 @@
-From: Felix Fietkau <nbd at nbd.name>
-Date: Wed, 13 Mar 2019 19:09:22 +0100
-Subject: [PATCH] mac80211: rework locking for txq scheduling / airtime
- fairness
-
-Holding the lock around the entire duration of tx scheduling can create
-some nasty lock contention, especially when processing airtime information
-from the tx status or the rx path.
-Improve locking by only holding the active_txq_lock for lookups / scheduling
-list modifications.
-
-Signed-off-by: Felix Fietkau <nbd at nbd.name>
----
-
---- a/include/net/mac80211.h
-+++ b/include/net/mac80211.h
-@@ -6069,8 +6069,6 @@ struct sk_buff *ieee80211_tx_dequeue(str
-  * @hw: pointer as obtained from ieee80211_alloc_hw()
-  * @ac: AC number to return packets from.
-  *
-- * Should only be called between calls to ieee80211_txq_schedule_start()
-- * and ieee80211_txq_schedule_end().
-  * Returns the next txq if successful, %NULL if no queue is eligible. If a txq
-  * is returned, it should be returned with ieee80211_return_txq() after the
-  * driver has finished scheduling it.
-@@ -6078,51 +6076,41 @@ struct sk_buff *ieee80211_tx_dequeue(str
- struct ieee80211_txq *ieee80211_next_txq(struct ieee80211_hw *hw, u8 ac);
- 
- /**
-- * ieee80211_return_txq - return a TXQ previously acquired by ieee80211_next_txq()
-- *
-- * @hw: pointer as obtained from ieee80211_alloc_hw()
-- * @txq: pointer obtained from station or virtual interface
-- *
-- * Should only be called between calls to ieee80211_txq_schedule_start()
-- * and ieee80211_txq_schedule_end().
-- */
--void ieee80211_return_txq(struct ieee80211_hw *hw, struct ieee80211_txq *txq);
--
--/**
-- * ieee80211_txq_schedule_start - acquire locks for safe scheduling of an AC
-+ * ieee80211_txq_schedule_start - start new scheduling round for TXQs
-  *
-  * @hw: pointer as obtained from ieee80211_alloc_hw()
-  * @ac: AC number to acquire locks for
-  *
-- * Acquire locks needed to schedule TXQs from the given AC. Should be called
-- * before ieee80211_next_txq() or ieee80211_return_txq().
-+ * Should be called before ieee80211_next_txq() or ieee80211_return_txq().
-  */
--void ieee80211_txq_schedule_start(struct ieee80211_hw *hw, u8 ac)
--	__acquires(txq_lock);
-+void ieee80211_txq_schedule_start(struct ieee80211_hw *hw, u8 ac);
-+
-+/* (deprecated) */
-+static inline void ieee80211_txq_schedule_end(struct ieee80211_hw *hw, u8 ac)
-+{
-+}
- 
- /**
-- * ieee80211_txq_schedule_end - release locks for safe scheduling of an AC
-+ * ieee80211_schedule_txq - schedule a TXQ for transmission
-  *
-  * @hw: pointer as obtained from ieee80211_alloc_hw()
-- * @ac: AC number to acquire locks for
-+ * @txq: pointer obtained from station or virtual interface
-  *
-- * Release locks previously acquired by ieee80211_txq_schedule_end().
-+ * Schedules a TXQ for transmission if it is not already scheduled.
-  */
--void ieee80211_txq_schedule_end(struct ieee80211_hw *hw, u8 ac)
--	__releases(txq_lock);
-+void ieee80211_schedule_txq(struct ieee80211_hw *hw, struct ieee80211_txq *txq);
- 
- /**
-- * ieee80211_schedule_txq - schedule a TXQ for transmission
-+ * ieee80211_return_txq - return a TXQ previously acquired by ieee80211_next_txq()
-  *
-  * @hw: pointer as obtained from ieee80211_alloc_hw()
-  * @txq: pointer obtained from station or virtual interface
-- *
-- * Schedules a TXQ for transmission if it is not already scheduled. Takes a
-- * lock, which means it must *not* be called between
-- * ieee80211_txq_schedule_start() and ieee80211_txq_schedule_end()
-  */
--void ieee80211_schedule_txq(struct ieee80211_hw *hw, struct ieee80211_txq *txq)
--	__acquires(txq_lock) __releases(txq_lock);
-+static inline void
-+ieee80211_return_txq(struct ieee80211_hw *hw, struct ieee80211_txq *txq)
-+{
-+	ieee80211_schedule_txq(hw, txq);
-+}
- 
- /**
-  * ieee80211_txq_may_transmit - check whether TXQ is allowed to transmit
---- a/net/mac80211/tx.c
-+++ b/net/mac80211/tx.c
-@@ -3619,16 +3619,17 @@ EXPORT_SYMBOL(ieee80211_tx_dequeue);
- struct ieee80211_txq *ieee80211_next_txq(struct ieee80211_hw *hw, u8 ac)
- {
- 	struct ieee80211_local *local = hw_to_local(hw);
-+	struct ieee80211_txq *ret = NULL;
- 	struct txq_info *txqi = NULL;
- 
--	lockdep_assert_held(&local->active_txq_lock[ac]);
-+	spin_lock_bh(&local->active_txq_lock[ac]);
- 
-  begin:
- 	txqi = list_first_entry_or_null(&local->active_txqs[ac],
- 					struct txq_info,
- 					schedule_order);
- 	if (!txqi)
--		return NULL;
-+		goto out;
- 
- 	if (txqi->txq.sta) {
- 		struct sta_info *sta = container_of(txqi->txq.sta,
-@@ -3645,21 +3646,25 @@ struct ieee80211_txq *ieee80211_next_txq
- 
- 
- 	if (txqi->schedule_round == local->schedule_round[ac])
--		return NULL;
-+		goto out;
- 
- 	list_del_init(&txqi->schedule_order);
- 	txqi->schedule_round = local->schedule_round[ac];
--	return &txqi->txq;
-+	ret = &txqi->txq;
-+
-+out:
-+	spin_unlock_bh(&local->active_txq_lock[ac]);
-+	return ret;
- }
- EXPORT_SYMBOL(ieee80211_next_txq);
- 
--void ieee80211_return_txq(struct ieee80211_hw *hw,
--			  struct ieee80211_txq *txq)
-+void ieee80211_schedule_txq(struct ieee80211_hw *hw,
-+			    struct ieee80211_txq *txq)
- {
- 	struct ieee80211_local *local = hw_to_local(hw);
- 	struct txq_info *txqi = to_txq_info(txq);
- 
--	lockdep_assert_held(&local->active_txq_lock[txq->ac]);
-+	spin_lock_bh(&local->active_txq_lock[txq->ac]);
- 
- 	if (list_empty(&txqi->schedule_order) &&
- 	    (!skb_queue_empty(&txqi->frags) || txqi->tin.backlog_packets)) {
-@@ -3679,18 +3684,7 @@ void ieee80211_return_txq(struct ieee802
- 			list_add_tail(&txqi->schedule_order,
- 				      &local->active_txqs[txq->ac]);
- 	}
--}
--EXPORT_SYMBOL(ieee80211_return_txq);
- 
--void ieee80211_schedule_txq(struct ieee80211_hw *hw,
--			    struct ieee80211_txq *txq)
--	__acquires(txq_lock) __releases(txq_lock)
--{
--	struct ieee80211_local *local = hw_to_local(hw);
--	struct txq_info *txqi = to_txq_info(txq);
--
--	spin_lock_bh(&local->active_txq_lock[txq->ac]);
--	ieee80211_return_txq(hw, txq);
- 	spin_unlock_bh(&local->active_txq_lock[txq->ac]);
- }
- EXPORT_SYMBOL(ieee80211_schedule_txq);
-@@ -3703,7 +3697,7 @@ bool ieee80211_txq_may_transmit(struct i
- 	struct sta_info *sta;
- 	u8 ac = txq->ac;
- 
--	lockdep_assert_held(&local->active_txq_lock[ac]);
-+	spin_lock_bh(&local->active_txq_lock[ac]);
- 
- 	if (!txqi->txq.sta)
- 		goto out;
-@@ -3733,34 +3727,27 @@ bool ieee80211_txq_may_transmit(struct i
- 
- 	sta->airtime[ac].deficit += sta->airtime_weight;
- 	list_move_tail(&txqi->schedule_order, &local->active_txqs[ac]);
-+	spin_unlock_bh(&local->active_txq_lock[ac]);
- 
- 	return false;
- out:
- 	if (!list_empty(&txqi->schedule_order))
- 		list_del_init(&txqi->schedule_order);
-+	spin_unlock_bh(&local->active_txq_lock[ac]);
- 
- 	return true;
- }
- EXPORT_SYMBOL(ieee80211_txq_may_transmit);
- 
- void ieee80211_txq_schedule_start(struct ieee80211_hw *hw, u8 ac)
--	__acquires(txq_lock)
- {
- 	struct ieee80211_local *local = hw_to_local(hw);
- 
- 	spin_lock_bh(&local->active_txq_lock[ac]);
- 	local->schedule_round[ac]++;
--}
--EXPORT_SYMBOL(ieee80211_txq_schedule_start);
--
--void ieee80211_txq_schedule_end(struct ieee80211_hw *hw, u8 ac)
--	__releases(txq_lock)
--{
--	struct ieee80211_local *local = hw_to_local(hw);
--
- 	spin_unlock_bh(&local->active_txq_lock[ac]);
- }
--EXPORT_SYMBOL(ieee80211_txq_schedule_end);
-+EXPORT_SYMBOL(ieee80211_txq_schedule_start);
- 
- void __ieee80211_subif_start_xmit(struct sk_buff *skb,
- 				  struct net_device *dev,
diff --git a/package/kernel/mac80211/patches/subsys/353-mac80211-mesh-drop-redundant-rcu_read_lock-unlock-ca.patch b/package/kernel/mac80211/patches/subsys/353-mac80211-mesh-drop-redundant-rcu_read_lock-unlock-ca.patch
deleted file mode 100644
index 86300be4ed..0000000000
--- a/package/kernel/mac80211/patches/subsys/353-mac80211-mesh-drop-redundant-rcu_read_lock-unlock-ca.patch
+++ /dev/null
@@ -1,96 +0,0 @@
-From: Felix Fietkau <nbd at nbd.name>
-Date: Sat, 16 Mar 2019 17:43:58 +0100
-Subject: [PATCH] mac80211: mesh: drop redundant rcu_read_lock/unlock calls
-
-The callers of these functions are all within RCU locked sections
-
-Signed-off-by: Felix Fietkau <nbd at nbd.name>
----
-
---- a/net/mac80211/mesh_hwmp.c
-+++ b/net/mac80211/mesh_hwmp.c
-@@ -1112,16 +1112,13 @@ int mesh_nexthop_resolve(struct ieee8021
- 	struct mesh_path *mpath;
- 	struct sk_buff *skb_to_free = NULL;
- 	u8 *target_addr = hdr->addr3;
--	int err = 0;
- 
- 	/* Nulls are only sent to peers for PS and should be pre-addressed */
- 	if (ieee80211_is_qos_nullfunc(hdr->frame_control))
- 		return 0;
- 
--	rcu_read_lock();
--	err = mesh_nexthop_lookup(sdata, skb);
--	if (!err)
--		goto endlookup;
-+	if (!mesh_nexthop_lookup(sdata, skb))
-+		return 0;
- 
- 	/* no nexthop found, start resolving */
- 	mpath = mesh_path_lookup(sdata, target_addr);
-@@ -1129,8 +1126,7 @@ int mesh_nexthop_resolve(struct ieee8021
- 		mpath = mesh_path_add(sdata, target_addr);
- 		if (IS_ERR(mpath)) {
- 			mesh_path_discard_frame(sdata, skb);
--			err = PTR_ERR(mpath);
--			goto endlookup;
-+			return PTR_ERR(mpath);
- 		}
- 	}
- 
-@@ -1143,13 +1139,10 @@ int mesh_nexthop_resolve(struct ieee8021
- 	info->flags |= IEEE80211_TX_INTFL_NEED_TXPROCESSING;
- 	ieee80211_set_qos_hdr(sdata, skb);
- 	skb_queue_tail(&mpath->frame_queue, skb);
--	err = -ENOENT;
- 	if (skb_to_free)
- 		mesh_path_discard_frame(sdata, skb_to_free);
- 
--endlookup:
--	rcu_read_unlock();
--	return err;
-+	return -ENOENT;
- }
- 
- /**
-@@ -1169,13 +1162,10 @@ int mesh_nexthop_lookup(struct ieee80211
- 	struct sta_info *next_hop;
- 	struct ieee80211_hdr *hdr = (struct ieee80211_hdr *) skb->data;
- 	u8 *target_addr = hdr->addr3;
--	int err = -ENOENT;
- 
--	rcu_read_lock();
- 	mpath = mesh_path_lookup(sdata, target_addr);
--
- 	if (!mpath || !(mpath->flags & MESH_PATH_ACTIVE))
--		goto endlookup;
-+		return -ENOENT;
- 
- 	if (time_after(jiffies,
- 		       mpath->exp_time -
-@@ -1190,12 +1180,10 @@ int mesh_nexthop_lookup(struct ieee80211
- 		memcpy(hdr->addr1, next_hop->sta.addr, ETH_ALEN);
- 		memcpy(hdr->addr2, sdata->vif.addr, ETH_ALEN);
- 		ieee80211_mps_set_frame_flags(sdata, next_hop, hdr);
--		err = 0;
-+		return 0;
- 	}
- 
--endlookup:
--	rcu_read_unlock();
--	return err;
-+	return -ENOENT;
- }
- 
- void mesh_path_timer(struct timer_list *t)
---- a/net/mac80211/mesh_pathtbl.c
-+++ b/net/mac80211/mesh_pathtbl.c
-@@ -219,7 +219,7 @@ static struct mesh_path *mpath_lookup(st
- {
- 	struct mesh_path *mpath;
- 
--	mpath = rhashtable_lookup_fast(&tbl->rhead, dst, mesh_rht_params);
-+	mpath = rhashtable_lookup(&tbl->rhead, dst, mesh_rht_params);
- 
- 	if (mpath && mpath_expired(mpath)) {
- 		spin_lock_bh(&mpath->state_lock);
diff --git a/package/kernel/mac80211/patches/subsys/354-mac80211-calculate-hash-for-fq-without-holding-fq-lo.patch b/package/kernel/mac80211/patches/subsys/354-mac80211-calculate-hash-for-fq-without-holding-fq-lo.patch
deleted file mode 100644
index 2b6d8ab525..0000000000
--- a/package/kernel/mac80211/patches/subsys/354-mac80211-calculate-hash-for-fq-without-holding-fq-lo.patch
+++ /dev/null
@@ -1,124 +0,0 @@
-From: Felix Fietkau <nbd at nbd.name>
-Date: Sat, 16 Mar 2019 17:57:38 +0100
-Subject: [PATCH] mac80211: calculate hash for fq without holding fq->lock
- in itxq enqueue
-
-Reduces lock contention on enqueue/dequeue of iTXQ packets
-
-Signed-off-by: Felix Fietkau <nbd at nbd.name>
----
-
---- a/include/net/fq_impl.h
-+++ b/include/net/fq_impl.h
-@@ -107,21 +107,23 @@ begin:
- 	return skb;
- }
- 
-+static u32 fq_flow_idx(struct fq *fq, struct sk_buff *skb)
-+{
-+	u32 hash = skb_get_hash_perturb(skb, fq->perturbation);
-+
-+	return reciprocal_scale(hash, fq->flows_cnt);
-+}
-+
- static struct fq_flow *fq_flow_classify(struct fq *fq,
--					struct fq_tin *tin,
-+					struct fq_tin *tin, u32 idx,
- 					struct sk_buff *skb,
- 					fq_flow_get_default_t get_default_func)
- {
- 	struct fq_flow *flow;
--	u32 hash;
--	u32 idx;
- 
- 	lockdep_assert_held(&fq->lock);
- 
--	hash = skb_get_hash_perturb(skb, fq->perturbation);
--	idx = reciprocal_scale(hash, fq->flows_cnt);
- 	flow = &fq->flows[idx];
--
- 	if (flow->tin && flow->tin != tin) {
- 		flow = get_default_func(fq, tin, idx, skb);
- 		tin->collisions++;
-@@ -153,7 +155,7 @@ static void fq_recalc_backlog(struct fq
- }
- 
- static void fq_tin_enqueue(struct fq *fq,
--			   struct fq_tin *tin,
-+			   struct fq_tin *tin, u32 idx,
- 			   struct sk_buff *skb,
- 			   fq_skb_free_t free_func,
- 			   fq_flow_get_default_t get_default_func)
-@@ -163,7 +165,7 @@ static void fq_tin_enqueue(struct fq *fq
- 
- 	lockdep_assert_held(&fq->lock);
- 
--	flow = fq_flow_classify(fq, tin, skb, get_default_func);
-+	flow = fq_flow_classify(fq, tin, idx, skb, get_default_func);
- 
- 	flow->tin = tin;
- 	flow->backlog += skb->len;
---- a/net/mac80211/tx.c
-+++ b/net/mac80211/tx.c
-@@ -1390,11 +1390,15 @@ static void ieee80211_txq_enqueue(struct
- {
- 	struct fq *fq = &local->fq;
- 	struct fq_tin *tin = &txqi->tin;
-+	u32 flow_idx = fq_flow_idx(fq, skb);
- 
- 	ieee80211_set_skb_enqueue_time(skb);
--	fq_tin_enqueue(fq, tin, skb,
-+
-+	spin_lock_bh(&fq->lock);
-+	fq_tin_enqueue(fq, tin, flow_idx, skb,
- 		       fq_skb_free_func,
- 		       fq_flow_get_default_func);
-+	spin_unlock_bh(&fq->lock);
- }
- 
- static bool fq_vlan_filter_func(struct fq *fq, struct fq_tin *tin,
-@@ -1564,7 +1568,6 @@ static bool ieee80211_queue_skb(struct i
- 				struct sta_info *sta,
- 				struct sk_buff *skb)
- {
--	struct fq *fq = &local->fq;
- 	struct ieee80211_vif *vif;
- 	struct txq_info *txqi;
- 
-@@ -1582,9 +1585,7 @@ static bool ieee80211_queue_skb(struct i
- 	if (!txqi)
- 		return false;
- 
--	spin_lock_bh(&fq->lock);
- 	ieee80211_txq_enqueue(local, txqi, skb);
--	spin_unlock_bh(&fq->lock);
- 
- 	schedule_and_wake_txq(local, txqi);
- 
-@@ -3198,6 +3199,7 @@ static bool ieee80211_amsdu_aggregate(st
- 	u8 max_subframes = sta->sta.max_amsdu_subframes;
- 	int max_frags = local->hw.max_tx_fragments;
- 	int max_amsdu_len = sta->sta.max_amsdu_len;
-+	u32 flow_idx;
- 	int orig_truesize;
- 	__be16 len;
- 	void *data;
-@@ -3220,6 +3222,8 @@ static bool ieee80211_amsdu_aggregate(st
- 		max_amsdu_len = min_t(int, max_amsdu_len,
- 				      sta->sta.max_rc_amsdu_len);
- 
-+	flow_idx = fq_flow_idx(fq, skb);
-+
- 	spin_lock_bh(&fq->lock);
- 
- 	/* TODO: Ideally aggregation should be done on dequeue to remain
-@@ -3227,7 +3231,8 @@ static bool ieee80211_amsdu_aggregate(st
- 	 */
- 
- 	tin = &txqi->tin;
--	flow = fq_flow_classify(fq, tin, skb, fq_flow_get_default_func);
-+	flow = fq_flow_classify(fq, tin, flow_idx, skb,
-+				fq_flow_get_default_func);
- 	head = skb_peek_tail(&flow->queue);
- 	if (!head)
- 		goto unlock;
diff --git a/package/kernel/mac80211/patches/subsys/355-mac80211-run-late-dequeue-late-tx-handlers-without-h.patch b/package/kernel/mac80211/patches/subsys/355-mac80211-run-late-dequeue-late-tx-handlers-without-h.patch
deleted file mode 100644
index 3127c86822..0000000000
--- a/package/kernel/mac80211/patches/subsys/355-mac80211-run-late-dequeue-late-tx-handlers-without-h.patch
+++ /dev/null
@@ -1,55 +0,0 @@
-From: Felix Fietkau <nbd at nbd.name>
-Date: Sat, 16 Mar 2019 18:00:12 +0100
-Subject: [PATCH] mac80211: run late dequeue late tx handlers without
- holding fq->lock
-
-Reduces lock contention on enqueue/dequeue of iTXQ packets
-
-Signed-off-by: Felix Fietkau <nbd at nbd.name>
----
-
---- a/net/mac80211/tx.c
-+++ b/net/mac80211/tx.c
-@@ -3507,6 +3507,7 @@ struct sk_buff *ieee80211_tx_dequeue(str
- 	ieee80211_tx_result r;
- 	struct ieee80211_vif *vif = txq->vif;
- 
-+begin:
- 	spin_lock_bh(&fq->lock);
- 
- 	if (test_bit(IEEE80211_TXQ_STOP, &txqi->flags) ||
-@@ -3523,11 +3524,12 @@ struct sk_buff *ieee80211_tx_dequeue(str
- 	if (skb)
- 		goto out;
- 
--begin:
- 	skb = fq_tin_dequeue(fq, tin, fq_tin_dequeue_func);
- 	if (!skb)
- 		goto out;
- 
-+	spin_unlock_bh(&fq->lock);
-+
- 	hdr = (struct ieee80211_hdr *)skb->data;
- 	info = IEEE80211_SKB_CB(skb);
- 
-@@ -3573,8 +3575,11 @@ begin:
- 
- 		skb = __skb_dequeue(&tx.skbs);
- 
--		if (!skb_queue_empty(&tx.skbs))
-+		if (!skb_queue_empty(&tx.skbs)) {
-+			spin_lock_bh(&fq->lock);
- 			skb_queue_splice_tail(&tx.skbs, &txqi->frags);
-+			spin_unlock_bh(&fq->lock);
-+		}
- 	}
- 
- 	if (skb && skb_has_frag_list(skb) &&
-@@ -3613,6 +3618,7 @@ begin:
- 	}
- 
- 	IEEE80211_SKB_CB(skb)->control.vif = vif;
-+	return skb;
- 
- out:
- 	spin_unlock_bh(&fq->lock);
diff --git a/package/kernel/mac80211/patches/subsys/356-mac80211-set-NETIF_F_LLTX-when-using-intermediate-tx.patch b/package/kernel/mac80211/patches/subsys/356-mac80211-set-NETIF_F_LLTX-when-using-intermediate-tx.patch
deleted file mode 100644
index 95ab3ab9fb..0000000000
--- a/package/kernel/mac80211/patches/subsys/356-mac80211-set-NETIF_F_LLTX-when-using-intermediate-tx.patch
+++ /dev/null
@@ -1,22 +0,0 @@
-From: Felix Fietkau <nbd at nbd.name>
-Date: Sat, 16 Mar 2019 18:01:53 +0100
-Subject: [PATCH] mac80211: set NETIF_F_LLTX when using intermediate tx
- queues
-
-When using iTXQ, tx sequence number allocation and statistics are run at
-dequeue time. Because of that, it is safe to enable NETIF_F_LLTX, which
-allows tx handlers to run on multiple CPUs in parallel.
-
-Signed-off-by: Felix Fietkau <nbd at nbd.name>
----
-
---- a/net/mac80211/iface.c
-+++ b/net/mac80211/iface.c
-@@ -1301,6 +1301,7 @@ static void ieee80211_if_setup(struct ne
- static void ieee80211_if_setup_no_queue(struct net_device *dev)
- {
- 	ieee80211_if_setup(dev);
-+	dev->features |= NETIF_F_LLTX;
- #if LINUX_VERSION_IS_GEQ(4,3,0)
- 	dev->priv_flags |= IFF_NO_QUEUE;
- #else
diff --git a/package/kernel/mac80211/patches/subsys/357-mac80211-optimize-skb-resizing.patch b/package/kernel/mac80211/patches/subsys/357-mac80211-optimize-skb-resizing.patch
index 82ed1723c0..6ed2884d5e 100644
--- a/package/kernel/mac80211/patches/subsys/357-mac80211-optimize-skb-resizing.patch
+++ b/package/kernel/mac80211/patches/subsys/357-mac80211-optimize-skb-resizing.patch
@@ -24,10 +24,10 @@ Signed-off-by: Felix Fietkau <nbd at nbd.name>
 
 --- a/net/mac80211/ieee80211_i.h
 +++ b/net/mac80211/ieee80211_i.h
-@@ -1761,6 +1761,9 @@ void ieee80211_clear_fast_xmit(struct st
- int ieee80211_tx_control_port(struct wiphy *wiphy, struct net_device *dev,
- 			      const u8 *buf, size_t len,
+@@ -1780,6 +1780,9 @@ int ieee80211_tx_control_port(struct wip
  			      const u8 *dest, __be16 proto, bool unencrypted);
+ int ieee80211_probe_mesh_link(struct wiphy *wiphy, struct net_device *dev,
+ 			      const u8 *buf, size_t len);
 +int ieee80211_skb_resize(struct ieee80211_local *local,
 +			 struct ieee80211_sub_if_data *sdata,
 +			 struct sk_buff *skb, int hdrlen, int hdr_add);
@@ -36,7 +36,7 @@ Signed-off-by: Felix Fietkau <nbd at nbd.name>
  void ieee80211_apply_htcap_overrides(struct ieee80211_sub_if_data *sdata,
 --- a/net/mac80211/status.c
 +++ b/net/mac80211/status.c
-@@ -672,6 +672,11 @@ void ieee80211_tx_monitor(struct ieee802
+@@ -669,6 +669,11 @@ void ieee80211_tx_monitor(struct ieee802
  		}
  	}
  
@@ -50,7 +50,7 @@ Signed-off-by: Felix Fietkau <nbd at nbd.name>
  	if (WARN_ON_ONCE(skb_headroom(skb) < rtap_len)) {
 --- a/net/mac80211/tx.c
 +++ b/net/mac80211/tx.c
-@@ -1914,37 +1914,53 @@ static bool ieee80211_tx(struct ieee8021
+@@ -1935,37 +1935,53 @@ static bool ieee80211_tx(struct ieee8021
  }
  
  /* device xmit handlers */
@@ -123,7 +123,7 @@ Signed-off-by: Felix Fietkau <nbd at nbd.name>
  		wiphy_debug(local->hw.wiphy,
  			    "failed to reallocate TX buffer\n");
  		return -ENOMEM;
-@@ -1960,18 +1976,8 @@ void ieee80211_xmit(struct ieee80211_sub
+@@ -1981,18 +1997,8 @@ void ieee80211_xmit(struct ieee80211_sub
  	struct ieee80211_local *local = sdata->local;
  	struct ieee80211_tx_info *info = IEEE80211_SKB_CB(skb);
  	struct ieee80211_hdr *hdr;
@@ -143,7 +143,7 @@ Signed-off-by: Felix Fietkau <nbd at nbd.name>
  		ieee80211_free_txskb(&local->hw, skb);
  		return;
  	}
-@@ -2740,30 +2746,14 @@ static struct sk_buff *ieee80211_build_h
+@@ -2774,30 +2780,14 @@ static struct sk_buff *ieee80211_build_h
  
  	skb_pull(skb, skip_header_bytes);
  	padsize = ieee80211_hdr_padsize(&local->hw, hdrlen);
@@ -180,7 +180,7 @@ Signed-off-by: Felix Fietkau <nbd at nbd.name>
  	}
  
  	if (encaps_data)
-@@ -3377,7 +3367,6 @@ static bool ieee80211_xmit_fast(struct i
+@@ -3417,7 +3407,6 @@ static bool ieee80211_xmit_fast(struct i
  	struct ieee80211_local *local = sdata->local;
  	u16 ethertype = (skb->data[12] << 8) | skb->data[13];
  	int extra_head = fast_tx->hdr_len - (ETH_HLEN - 2);
@@ -188,7 +188,7 @@ Signed-off-by: Felix Fietkau <nbd at nbd.name>
  	struct ethhdr eth;
  	struct ieee80211_tx_info *info;
  	struct ieee80211_hdr *hdr = (void *)fast_tx->hdr;
-@@ -3429,10 +3418,7 @@ static bool ieee80211_xmit_fast(struct i
+@@ -3469,10 +3458,7 @@ static bool ieee80211_xmit_fast(struct i
  	 * as the may-encrypt argument for the resize to not account for
  	 * more room than we already have in 'extra_head'
  	 */
diff --git a/package/kernel/mac80211/patches/subsys/358-mac80211-make-ieee80211_schedule_txq-schedule-empty-.patch b/package/kernel/mac80211/patches/subsys/358-mac80211-make-ieee80211_schedule_txq-schedule-empty-.patch
deleted file mode 100644
index a0a65f35a8..0000000000
--- a/package/kernel/mac80211/patches/subsys/358-mac80211-make-ieee80211_schedule_txq-schedule-empty-.patch
+++ /dev/null
@@ -1,105 +0,0 @@
-From: Felix Fietkau <nbd at nbd.name>
-Date: Sun, 17 Mar 2019 14:26:59 +0100
-Subject: [PATCH] mac80211: make ieee80211_schedule_txq schedule empty TXQs
-
-Currently there is no way for the driver to signal to mac80211 that it should
-schedule a TXQ even if there are no packets on the mac80211 part of that queue.
-This is problematic if the driver has an internal retry queue to deal with
-software A-MPDU retry.
-
-This patch changes the behavior of ieee80211_schedule_txq to always schedule
-the queue, as its only user (ath9k) seems to expect such behavior already:
-it calls this function on tx status and on powersave wakeup whenever its
-internal retry queue is not empty.
-
-Also add an extra argument to ieee80211_return_txq to get the same behavior.
-
-This fixes an issue on ath9k where tx queues with packets to retry (and no
-new packets in mac80211) would not get serviced.
-
-Fixes: 89cea7493a346 ("ath9k: Switch to mac80211 TXQ scheduling and airtime APIs")
-Signed-off-by: Felix Fietkau <nbd at nbd.name>
----
-
---- a/include/net/mac80211.h
-+++ b/include/net/mac80211.h
-@@ -6090,26 +6090,42 @@ static inline void ieee80211_txq_schedul
- {
- }
- 
-+void __ieee80211_schedule_txq(struct ieee80211_hw *hw,
-+			      struct ieee80211_txq *txq, bool force);
-+
- /**
-  * ieee80211_schedule_txq - schedule a TXQ for transmission
-  *
-  * @hw: pointer as obtained from ieee80211_alloc_hw()
-  * @txq: pointer obtained from station or virtual interface
-  *
-- * Schedules a TXQ for transmission if it is not already scheduled.
-+ * Schedules a TXQ for transmission if it is not already scheduled,
-+ * even if mac80211 does not have any packets buffered.
-+ *
-+ * The driver may call this function if it has buffered packets for
-+ * this TXQ internally.
-  */
--void ieee80211_schedule_txq(struct ieee80211_hw *hw, struct ieee80211_txq *txq);
-+static inline void
-+ieee80211_schedule_txq(struct ieee80211_hw *hw, struct ieee80211_txq *txq)
-+{
-+	__ieee80211_schedule_txq(hw, txq, true);
-+}
- 
- /**
-  * ieee80211_return_txq - return a TXQ previously acquired by ieee80211_next_txq()
-  *
-  * @hw: pointer as obtained from ieee80211_alloc_hw()
-  * @txq: pointer obtained from station or virtual interface
-+ * @force: schedule txq even if mac80211 does not have any buffered packets.
-+ *
-+ * The driver may set force=true if it has buffered packets for this TXQ
-+ * internally.
-  */
- static inline void
--ieee80211_return_txq(struct ieee80211_hw *hw, struct ieee80211_txq *txq)
-+ieee80211_return_txq(struct ieee80211_hw *hw, struct ieee80211_txq *txq,
-+		     bool force)
- {
--	ieee80211_schedule_txq(hw, txq);
-+	__ieee80211_schedule_txq(hw, txq, force);
- }
- 
- /**
---- a/net/mac80211/tx.c
-+++ b/net/mac80211/tx.c
-@@ -3655,8 +3655,9 @@ out:
- }
- EXPORT_SYMBOL(ieee80211_next_txq);
- 
--void ieee80211_schedule_txq(struct ieee80211_hw *hw,
--			    struct ieee80211_txq *txq)
-+void __ieee80211_schedule_txq(struct ieee80211_hw *hw,
-+			      struct ieee80211_txq *txq,
-+			      bool force)
- {
- 	struct ieee80211_local *local = hw_to_local(hw);
- 	struct txq_info *txqi = to_txq_info(txq);
-@@ -3664,7 +3665,8 @@ void ieee80211_schedule_txq(struct ieee8
- 	spin_lock_bh(&local->active_txq_lock[txq->ac]);
- 
- 	if (list_empty(&txqi->schedule_order) &&
--	    (!skb_queue_empty(&txqi->frags) || txqi->tin.backlog_packets)) {
-+	    (force || !skb_queue_empty(&txqi->frags) ||
-+	     txqi->tin.backlog_packets)) {
- 		/* If airtime accounting is active, always enqueue STAs at the
- 		 * head of the list to ensure that they only get moved to the
- 		 * back by the airtime DRR scheduler once they have a negative
-@@ -3684,7 +3686,7 @@ void ieee80211_schedule_txq(struct ieee8
- 
- 	spin_unlock_bh(&local->active_txq_lock[txq->ac]);
- }
--EXPORT_SYMBOL(ieee80211_schedule_txq);
-+EXPORT_SYMBOL(__ieee80211_schedule_txq);
- 
- bool ieee80211_txq_may_transmit(struct ieee80211_hw *hw,
- 				struct ieee80211_txq *txq)
diff --git a/package/kernel/mac80211/patches/subsys/359-mac80211-un-schedule-TXQs-on-powersave-start.patch b/package/kernel/mac80211/patches/subsys/359-mac80211-un-schedule-TXQs-on-powersave-start.patch
deleted file mode 100644
index 1abb2db7c2..0000000000
--- a/package/kernel/mac80211/patches/subsys/359-mac80211-un-schedule-TXQs-on-powersave-start.patch
+++ /dev/null
@@ -1,31 +0,0 @@
-From: Felix Fietkau <nbd at nbd.name>
-Date: Tue, 19 Mar 2019 11:36:12 +0100
-Subject: [PATCH] mac80211: un-schedule TXQs on powersave start
-
-Once a station enters powersave, its queues should not be returned by
-ieee80211_next_txq() anymore. They will be re-scheduled again after the
-station has woken up again
-
-Fixes: 1866760096bf4 ("mac80211: Add TXQ scheduling API")
-Signed-off-by: Felix Fietkau <nbd at nbd.name>
----
-
---- a/net/mac80211/rx.c
-+++ b/net/mac80211/rx.c
-@@ -1508,7 +1508,15 @@ static void sta_ps_start(struct sta_info
- 		return;
- 
- 	for (tid = 0; tid < ARRAY_SIZE(sta->sta.txq); tid++) {
--		if (txq_has_queue(sta->sta.txq[tid]))
-+		struct ieee80211_txq *txq = sta->sta.txq[tid];
-+		struct txq_info *txqi = to_txq_info(txq);
-+
-+		spin_lock(&local->active_txq_lock[txq->ac]);
-+		if (!list_empty(&txqi->schedule_order))
-+			list_del_init(&txqi->schedule_order);
-+		spin_unlock(&local->active_txq_lock[txq->ac]);
-+
-+		if (txq_has_queue(txq))
- 			set_bit(tid, &sta->txq_buffered_tids);
- 		else
- 			clear_bit(tid, &sta->txq_buffered_tids);
diff --git a/package/kernel/mac80211/patches/subsys/360-mac80211-when-using-iTXQ-select-the-queue-in-ieee802.patch b/package/kernel/mac80211/patches/subsys/360-mac80211-when-using-iTXQ-select-the-queue-in-ieee802.patch
deleted file mode 100644
index bb3af7317a..0000000000
--- a/package/kernel/mac80211/patches/subsys/360-mac80211-when-using-iTXQ-select-the-queue-in-ieee802.patch
+++ /dev/null
@@ -1,183 +0,0 @@
-From: Felix Fietkau <nbd at nbd.name>
-Date: Fri, 22 Mar 2019 18:06:03 +0100
-Subject: [PATCH] mac80211: when using iTXQ, select the queue in
- ieee80211_subif_start_xmit
-
-When using iTXQ, the network stack does not need the real queue number, since
-mac80211 is using its internal queues anyway. In that case we can defer
-selecting the queue and remove a redundant station lookup in the tx path to save
-some CPU cycles.
-
-Signed-off-by: Felix Fietkau <nbd at nbd.name>
----
-
---- a/net/mac80211/tx.c
-+++ b/net/mac80211/tx.c
-@@ -3753,6 +3753,7 @@ void __ieee80211_subif_start_xmit(struct
- 				  u32 info_flags)
- {
- 	struct ieee80211_sub_if_data *sdata = IEEE80211_DEV_TO_SUB_IF(dev);
-+	struct ieee80211_local *local = sdata->local;
- 	struct sta_info *sta;
- 	struct sk_buff *next;
- 
-@@ -3766,7 +3767,15 @@ void __ieee80211_subif_start_xmit(struct
- 	if (ieee80211_lookup_ra_sta(sdata, skb, &sta))
- 		goto out_free;
- 
--	if (!IS_ERR_OR_NULL(sta)) {
-+	if (IS_ERR(sta))
-+		sta = NULL;
-+
-+	if (local->ops->wake_tx_queue) {
-+		u16 queue = __ieee80211_select_queue(sdata, sta, skb);
-+		skb_set_queue_mapping(skb, queue);
-+	}
-+
-+	if (sta) {
- 		struct ieee80211_fast_tx *fast_tx;
- 
- 		/* We need a bit of data queued to build aggregates properly, so
---- a/net/mac80211/wme.c
-+++ b/net/mac80211/wme.c
-@@ -141,6 +141,42 @@ u16 ieee80211_select_queue_80211(struct
- 	return ieee80211_downgrade_queue(sdata, NULL, skb);
- }
- 
-+u16 __ieee80211_select_queue(struct ieee80211_sub_if_data *sdata,
-+			     struct sta_info *sta, struct sk_buff *skb)
-+{
-+	struct mac80211_qos_map *qos_map;
-+	bool qos;
-+
-+	/* all mesh/ocb stations are required to support WME */
-+	if (sdata->vif.type == NL80211_IFTYPE_MESH_POINT ||
-+	    sdata->vif.type == NL80211_IFTYPE_OCB)
-+		qos = true;
-+	else if (sta)
-+		qos = sta->sta.wme;
-+	else
-+		qos = false;
-+
-+	if (!qos) {
-+		skb->priority = 0; /* required for correct WPA/11i MIC */
-+		return IEEE80211_AC_BE;
-+	}
-+
-+	if (skb->protocol == sdata->control_port_protocol) {
-+		skb->priority = 7;
-+		goto downgrade;
-+	}
-+
-+	/* use the data classifier to determine what 802.1d tag the
-+	 * data frame has */
-+	qos_map = rcu_dereference(sdata->qos_map);
-+	skb->priority = cfg80211_classify8021d(skb, qos_map ?
-+					       &qos_map->qos_map : NULL);
-+
-+ downgrade:
-+	return ieee80211_downgrade_queue(sdata, sta, skb);
-+}
-+
-+
- /* Indicate which queue to use. */
- u16 ieee80211_select_queue(struct ieee80211_sub_if_data *sdata,
- 			   struct sk_buff *skb)
-@@ -148,10 +184,12 @@ u16 ieee80211_select_queue(struct ieee80
- 	struct ieee80211_local *local = sdata->local;
- 	struct sta_info *sta = NULL;
- 	const u8 *ra = NULL;
--	bool qos = false;
--	struct mac80211_qos_map *qos_map;
- 	u16 ret;
- 
-+	/* when using iTXQ, we can do this later */
-+	if (local->ops->wake_tx_queue)
-+		return 0;
-+
- 	if (local->hw.queues < IEEE80211_NUM_ACS || skb->len < 6) {
- 		skb->priority = 0; /* required for correct WPA/11i MIC */
- 		return 0;
-@@ -161,10 +199,8 @@ u16 ieee80211_select_queue(struct ieee80
- 	switch (sdata->vif.type) {
- 	case NL80211_IFTYPE_AP_VLAN:
- 		sta = rcu_dereference(sdata->u.vlan.sta);
--		if (sta) {
--			qos = sta->sta.wme;
-+		if (sta)
- 			break;
--		}
- 		/* fall through */
- 	case NL80211_IFTYPE_AP:
- 		ra = skb->data;
-@@ -172,56 +208,26 @@ u16 ieee80211_select_queue(struct ieee80
- 	case NL80211_IFTYPE_WDS:
- 		ra = sdata->u.wds.remote_addr;
- 		break;
--#ifdef CPTCFG_MAC80211_MESH
--	case NL80211_IFTYPE_MESH_POINT:
--		qos = true;
--		break;
--#endif
- 	case NL80211_IFTYPE_STATION:
- 		/* might be a TDLS station */
- 		sta = sta_info_get(sdata, skb->data);
- 		if (sta)
--			qos = sta->sta.wme;
-+			break;
- 
- 		ra = sdata->u.mgd.bssid;
- 		break;
- 	case NL80211_IFTYPE_ADHOC:
- 		ra = skb->data;
- 		break;
--	case NL80211_IFTYPE_OCB:
--		/* all stations are required to support WME */
--		qos = true;
--		break;
- 	default:
- 		break;
- 	}
- 
--	if (!sta && ra && !is_multicast_ether_addr(ra)) {
-+	if (!sta && ra && !is_multicast_ether_addr(ra))
- 		sta = sta_info_get(sdata, ra);
--		if (sta)
--			qos = sta->sta.wme;
--	}
- 
--	if (!qos) {
--		skb->priority = 0; /* required for correct WPA/11i MIC */
--		ret = IEEE80211_AC_BE;
--		goto out;
--	}
-+	ret = __ieee80211_select_queue(sdata, sta, skb);
- 
--	if (skb->protocol == sdata->control_port_protocol) {
--		skb->priority = 7;
--		goto downgrade;
--	}
--
--	/* use the data classifier to determine what 802.1d tag the
--	 * data frame has */
--	qos_map = rcu_dereference(sdata->qos_map);
--	skb->priority = cfg80211_classify8021d(skb, qos_map ?
--					       &qos_map->qos_map : NULL);
--
-- downgrade:
--	ret = ieee80211_downgrade_queue(sdata, sta, skb);
-- out:
- 	rcu_read_unlock();
- 	return ret;
- }
---- a/net/mac80211/wme.h
-+++ b/net/mac80211/wme.h
-@@ -16,6 +16,8 @@
- u16 ieee80211_select_queue_80211(struct ieee80211_sub_if_data *sdata,
- 				 struct sk_buff *skb,
- 				 struct ieee80211_hdr *hdr);
-+u16 __ieee80211_select_queue(struct ieee80211_sub_if_data *sdata,
-+			     struct sta_info *sta, struct sk_buff *skb);
- u16 ieee80211_select_queue(struct ieee80211_sub_if_data *sdata,
- 			   struct sk_buff *skb);
- void ieee80211_set_qos_hdr(struct ieee80211_sub_if_data *sdata,
diff --git a/package/kernel/mac80211/patches/subsys/361-mac80211-minstrel_ht-add-support-for-rates-with-4-sp.patch b/package/kernel/mac80211/patches/subsys/361-mac80211-minstrel_ht-add-support-for-rates-with-4-sp.patch
deleted file mode 100644
index 07b30dfbf7..0000000000
--- a/package/kernel/mac80211/patches/subsys/361-mac80211-minstrel_ht-add-support-for-rates-with-4-sp.patch
+++ /dev/null
@@ -1,78 +0,0 @@
-From: Felix Fietkau <nbd at nbd.name>
-Date: Mon, 25 Mar 2019 09:02:13 +0100
-Subject: [PATCH] mac80211: minstrel_ht: add support for rates with 4
- spatial streams
-
-This is needed for the upcoming driver for MT7615 4x4 802.11ac chipsets
-
-Signed-off-by: Felix Fietkau <nbd at nbd.name>
----
-
---- a/net/mac80211/rc80211_minstrel_ht.c
-+++ b/net/mac80211/rc80211_minstrel_ht.c
-@@ -157,44 +157,54 @@ const struct mcs_group minstrel_mcs_grou
- 	MCS_GROUP(1, 0, BW_20, 5),
- 	MCS_GROUP(2, 0, BW_20, 4),
- 	MCS_GROUP(3, 0, BW_20, 4),
-+	MCS_GROUP(4, 0, BW_20, 4),
- 
- 	MCS_GROUP(1, 1, BW_20, 5),
- 	MCS_GROUP(2, 1, BW_20, 4),
- 	MCS_GROUP(3, 1, BW_20, 4),
-+	MCS_GROUP(4, 1, BW_20, 4),
- 
- 	MCS_GROUP(1, 0, BW_40, 4),
- 	MCS_GROUP(2, 0, BW_40, 4),
- 	MCS_GROUP(3, 0, BW_40, 4),
-+	MCS_GROUP(4, 0, BW_40, 4),
- 
- 	MCS_GROUP(1, 1, BW_40, 4),
- 	MCS_GROUP(2, 1, BW_40, 4),
- 	MCS_GROUP(3, 1, BW_40, 4),
-+	MCS_GROUP(4, 1, BW_40, 4),
- 
- 	CCK_GROUP(8),
- 
- 	VHT_GROUP(1, 0, BW_20, 5),
- 	VHT_GROUP(2, 0, BW_20, 4),
- 	VHT_GROUP(3, 0, BW_20, 4),
-+	VHT_GROUP(4, 0, BW_20, 4),
- 
- 	VHT_GROUP(1, 1, BW_20, 5),
- 	VHT_GROUP(2, 1, BW_20, 4),
- 	VHT_GROUP(3, 1, BW_20, 4),
-+	VHT_GROUP(4, 1, BW_20, 4),
- 
- 	VHT_GROUP(1, 0, BW_40, 4),
- 	VHT_GROUP(2, 0, BW_40, 4),
- 	VHT_GROUP(3, 0, BW_40, 4),
-+	VHT_GROUP(4, 0, BW_40, 3),
- 
- 	VHT_GROUP(1, 1, BW_40, 4),
- 	VHT_GROUP(2, 1, BW_40, 4),
- 	VHT_GROUP(3, 1, BW_40, 4),
-+	VHT_GROUP(4, 1, BW_40, 3),
- 
- 	VHT_GROUP(1, 0, BW_80, 4),
- 	VHT_GROUP(2, 0, BW_80, 4),
- 	VHT_GROUP(3, 0, BW_80, 4),
-+	VHT_GROUP(4, 0, BW_80, 2),
- 
- 	VHT_GROUP(1, 1, BW_80, 4),
- 	VHT_GROUP(2, 1, BW_80, 4),
- 	VHT_GROUP(3, 1, BW_80, 4),
-+	VHT_GROUP(4, 1, BW_80, 2),
- };
- 
- static u8 sample_table[SAMPLE_COLUMNS][MCS_GROUP_RATES] __read_mostly;
---- a/net/mac80211/rc80211_minstrel_ht.h
-+++ b/net/mac80211/rc80211_minstrel_ht.h
-@@ -13,7 +13,7 @@
-  * The number of streams can be changed to 2 to reduce code
-  * size and memory footprint.
-  */
--#define MINSTREL_MAX_STREAMS		3
-+#define MINSTREL_MAX_STREAMS		4
- #define MINSTREL_HT_STREAM_GROUPS	4 /* BW(=2) * SGI(=2) */
- #define MINSTREL_VHT_STREAM_GROUPS	6 /* BW(=3) * SGI(=2) */
- 
diff --git a/package/kernel/mac80211/patches/subsys/362-mac80211-minstrel_ht-automatically-calculate-rate-du.patch b/package/kernel/mac80211/patches/subsys/362-mac80211-minstrel_ht-automatically-calculate-rate-du.patch
deleted file mode 100644
index 81d14966f7..0000000000
--- a/package/kernel/mac80211/patches/subsys/362-mac80211-minstrel_ht-automatically-calculate-rate-du.patch
+++ /dev/null
@@ -1,189 +0,0 @@
-From: Felix Fietkau <nbd at nbd.name>
-Date: Mon, 25 Mar 2019 09:02:52 +0100
-Subject: [PATCH] mac80211: minstrel_ht: automatically calculate rate
- duration shift
-
-A per-group shift was added to reduce the size of the per-rate transmit
-duration field to u16 without sacrificing a lot of precision
-This patch changes the macros to automatically calculate the best value for
-this shift based on the lowest rate within the group.
-This simplifies adding more groups and slightly improves accuracy for some of
-the existing groups.
-
-Signed-off-by: Felix Fietkau <nbd at nbd.name>
----
-
---- a/net/mac80211/rc80211_minstrel_ht.c
-+++ b/net/mac80211/rc80211_minstrel_ht.c
-@@ -51,8 +51,11 @@
- 	MINSTREL_MAX_STREAMS * _sgi +	\
- 	_streams - 1
- 
-+#define GROUP_SHIFT(duration)						\
-+	(16 - __builtin_clz(duration))
-+
- /* MCS rate information for an MCS group */
--#define MCS_GROUP(_streams, _sgi, _ht40, _s)				\
-+#define __MCS_GROUP(_streams, _sgi, _ht40, _s)				\
- 	[GROUP_IDX(_streams, _sgi, _ht40)] = {				\
- 	.streams = _streams,						\
- 	.shift = _s,							\
-@@ -72,6 +75,13 @@
- 	}								\
- }
- 
-+#define MCS_GROUP_SHIFT(_streams, _sgi, _ht40)				\
-+	GROUP_SHIFT(MCS_DURATION(_streams, _sgi, _ht40 ? 54 : 26))
-+
-+#define MCS_GROUP(_streams, _sgi, _ht40)				\
-+	__MCS_GROUP(_streams, _sgi, _ht40,				\
-+		    MCS_GROUP_SHIFT(_streams, _sgi, _ht40))
-+
- #define VHT_GROUP_IDX(_streams, _sgi, _bw)				\
- 	(MINSTREL_VHT_GROUP_0 +						\
- 	 MINSTREL_MAX_STREAMS * 2 * (_bw) +				\
-@@ -81,7 +91,7 @@
- #define BW2VBPS(_bw, r3, r2, r1)					\
- 	(_bw == BW_80 ? r3 : _bw == BW_40 ? r2 : r1)
- 
--#define VHT_GROUP(_streams, _sgi, _bw, _s)				\
-+#define __VHT_GROUP(_streams, _sgi, _bw, _s)				\
- 	[VHT_GROUP_IDX(_streams, _sgi, _bw)] = {			\
- 	.streams = _streams,						\
- 	.shift = _s,							\
-@@ -114,6 +124,14 @@
- 	}								\
- }
- 
-+#define VHT_GROUP_SHIFT(_streams, _sgi, _bw)				\
-+	GROUP_SHIFT(MCS_DURATION(_streams, _sgi,			\
-+				 BW2VBPS(_bw,  117,  54,  26)))
-+
-+#define VHT_GROUP(_streams, _sgi, _bw)					\
-+	__VHT_GROUP(_streams, _sgi, _bw,				\
-+		    VHT_GROUP_SHIFT(_streams, _sgi, _bw))
-+
- #define CCK_DURATION(_bitrate, _short, _len)		\
- 	(1000 * (10 /* SIFS */ +			\
- 	 (_short ? 72 + 24 : 144 + 48) +		\
-@@ -129,7 +147,7 @@
- 	CCK_ACK_DURATION(55, _short) >> _s,		\
- 	CCK_ACK_DURATION(110, _short) >> _s
- 
--#define CCK_GROUP(_s)					\
-+#define __CCK_GROUP(_s)					\
- 	[MINSTREL_CCK_GROUP] = {			\
- 		.streams = 1,				\
- 		.flags = 0,				\
-@@ -140,6 +158,12 @@
- 		}					\
- 	}
- 
-+#define CCK_GROUP_SHIFT					\
-+	GROUP_SHIFT(CCK_ACK_DURATION(10, false))
-+
-+#define CCK_GROUP __CCK_GROUP(CCK_GROUP_SHIFT)
-+
-+
- static bool minstrel_vht_only = true;
- module_param(minstrel_vht_only, bool, 0644);
- MODULE_PARM_DESC(minstrel_vht_only,
-@@ -154,57 +178,57 @@ MODULE_PARM_DESC(minstrel_vht_only,
-  * BW -> SGI -> #streams
-  */
- const struct mcs_group minstrel_mcs_groups[] = {
--	MCS_GROUP(1, 0, BW_20, 5),
--	MCS_GROUP(2, 0, BW_20, 4),
--	MCS_GROUP(3, 0, BW_20, 4),
--	MCS_GROUP(4, 0, BW_20, 4),
-+	MCS_GROUP(1, 0, BW_20),
-+	MCS_GROUP(2, 0, BW_20),
-+	MCS_GROUP(3, 0, BW_20),
-+	MCS_GROUP(4, 0, BW_20),
- 
--	MCS_GROUP(1, 1, BW_20, 5),
--	MCS_GROUP(2, 1, BW_20, 4),
--	MCS_GROUP(3, 1, BW_20, 4),
--	MCS_GROUP(4, 1, BW_20, 4),
-+	MCS_GROUP(1, 1, BW_20),
-+	MCS_GROUP(2, 1, BW_20),
-+	MCS_GROUP(3, 1, BW_20),
-+	MCS_GROUP(4, 1, BW_20),
- 
--	MCS_GROUP(1, 0, BW_40, 4),
--	MCS_GROUP(2, 0, BW_40, 4),
--	MCS_GROUP(3, 0, BW_40, 4),
--	MCS_GROUP(4, 0, BW_40, 4),
-+	MCS_GROUP(1, 0, BW_40),
-+	MCS_GROUP(2, 0, BW_40),
-+	MCS_GROUP(3, 0, BW_40),
-+	MCS_GROUP(4, 0, BW_40),
- 
--	MCS_GROUP(1, 1, BW_40, 4),
--	MCS_GROUP(2, 1, BW_40, 4),
--	MCS_GROUP(3, 1, BW_40, 4),
--	MCS_GROUP(4, 1, BW_40, 4),
-+	MCS_GROUP(1, 1, BW_40),
-+	MCS_GROUP(2, 1, BW_40),
-+	MCS_GROUP(3, 1, BW_40),
-+	MCS_GROUP(4, 1, BW_40),
- 
--	CCK_GROUP(8),
-+	CCK_GROUP,
- 
--	VHT_GROUP(1, 0, BW_20, 5),
--	VHT_GROUP(2, 0, BW_20, 4),
--	VHT_GROUP(3, 0, BW_20, 4),
--	VHT_GROUP(4, 0, BW_20, 4),
-+	VHT_GROUP(1, 0, BW_20),
-+	VHT_GROUP(2, 0, BW_20),
-+	VHT_GROUP(3, 0, BW_20),
-+	VHT_GROUP(4, 0, BW_20),
- 
--	VHT_GROUP(1, 1, BW_20, 5),
--	VHT_GROUP(2, 1, BW_20, 4),
--	VHT_GROUP(3, 1, BW_20, 4),
--	VHT_GROUP(4, 1, BW_20, 4),
-+	VHT_GROUP(1, 1, BW_20),
-+	VHT_GROUP(2, 1, BW_20),
-+	VHT_GROUP(3, 1, BW_20),
-+	VHT_GROUP(4, 1, BW_20),
- 
--	VHT_GROUP(1, 0, BW_40, 4),
--	VHT_GROUP(2, 0, BW_40, 4),
--	VHT_GROUP(3, 0, BW_40, 4),
--	VHT_GROUP(4, 0, BW_40, 3),
-+	VHT_GROUP(1, 0, BW_40),
-+	VHT_GROUP(2, 0, BW_40),
-+	VHT_GROUP(3, 0, BW_40),
-+	VHT_GROUP(4, 0, BW_40),
- 
--	VHT_GROUP(1, 1, BW_40, 4),
--	VHT_GROUP(2, 1, BW_40, 4),
--	VHT_GROUP(3, 1, BW_40, 4),
--	VHT_GROUP(4, 1, BW_40, 3),
-+	VHT_GROUP(1, 1, BW_40),
-+	VHT_GROUP(2, 1, BW_40),
-+	VHT_GROUP(3, 1, BW_40),
-+	VHT_GROUP(4, 1, BW_40),
- 
--	VHT_GROUP(1, 0, BW_80, 4),
--	VHT_GROUP(2, 0, BW_80, 4),
--	VHT_GROUP(3, 0, BW_80, 4),
--	VHT_GROUP(4, 0, BW_80, 2),
-+	VHT_GROUP(1, 0, BW_80),
-+	VHT_GROUP(2, 0, BW_80),
-+	VHT_GROUP(3, 0, BW_80),
-+	VHT_GROUP(4, 0, BW_80),
- 
--	VHT_GROUP(1, 1, BW_80, 4),
--	VHT_GROUP(2, 1, BW_80, 4),
--	VHT_GROUP(3, 1, BW_80, 4),
--	VHT_GROUP(4, 1, BW_80, 2),
-+	VHT_GROUP(1, 1, BW_80),
-+	VHT_GROUP(2, 1, BW_80),
-+	VHT_GROUP(3, 1, BW_80),
-+	VHT_GROUP(4, 1, BW_80),
- };
- 
- static u8 sample_table[SAMPLE_COLUMNS][MCS_GROUP_RATES] __read_mostly;
diff --git a/package/kernel/mac80211/patches/subsys/390-nl-mac-80211-allow-4addr-AP-operation-on-crypto-cont.patch b/package/kernel/mac80211/patches/subsys/390-nl-mac-80211-allow-4addr-AP-operation-on-crypto-cont.patch
deleted file mode 100644
index d5b08b4410..0000000000
--- a/package/kernel/mac80211/patches/subsys/390-nl-mac-80211-allow-4addr-AP-operation-on-crypto-cont.patch
+++ /dev/null
@@ -1,103 +0,0 @@
-From 33d915d9e8ce811d8958915ccd18d71a66c7c495 Mon Sep 17 00:00:00 2001
-From: Manikanta Pubbisetty <mpubbise at codeaurora.org>
-Date: Wed, 8 May 2019 14:55:33 +0530
-Subject: [PATCH] {nl,mac}80211: allow 4addr AP operation on crypto controlled
- devices
-
-As per the current design, in the case of sw crypto controlled devices,
-it is the device which advertises the support for AP/VLAN iftype based
-on it's ability to tranmsit packets encrypted in software
-(In VLAN functionality, group traffic generated for a specific
-VLAN group is always encrypted in software). Commit db3bdcb9c3ff
-("mac80211: allow AP_VLAN operation on crypto controlled devices")
-has introduced this change.
-
-Since 4addr AP operation also uses AP/VLAN iftype, this conditional
-way of advertising AP/VLAN support has broken 4addr AP mode operation on
-crypto controlled devices which do not support VLAN functionality.
-
-In the case of ath10k driver, not all firmwares have support for VLAN
-functionality but all can support 4addr AP operation. Because AP/VLAN
-support is not advertised for these devices, 4addr AP operations are
-also blocked.
-
-Fix this by allowing 4addr operation on devices which do not support
-AP/VLAN iftype but can support 4addr AP operation (decision is based on
-the wiphy flag WIPHY_FLAG_4ADDR_AP).
-
-Cc: stable at vger.kernel.org
-Fixes: db3bdcb9c3ff ("mac80211: allow AP_VLAN operation on crypto controlled devices")
-Signed-off-by: Manikanta Pubbisetty <mpubbise at codeaurora.org>
-Signed-off-by: Johannes Berg <johannes.berg at intel.com>
----
- include/net/cfg80211.h | 3 ++-
- net/mac80211/util.c    | 4 +++-
- net/wireless/core.c    | 6 +++++-
- net/wireless/nl80211.c | 8 ++++++--
- 4 files changed, 16 insertions(+), 5 deletions(-)
-
---- a/include/net/cfg80211.h
-+++ b/include/net/cfg80211.h
-@@ -3457,7 +3457,8 @@ struct cfg80211_ops {
-  *	on wiphy_new(), but can be changed by the driver if it has a good
-  *	reason to override the default
-  * @WIPHY_FLAG_4ADDR_AP: supports 4addr mode even on AP (with a single station
-- *	on a VLAN interface)
-+ *	on a VLAN interface). This flag also serves an extra purpose of
-+ *	supporting 4ADDR AP mode on devices which do not support AP/VLAN iftype.
-  * @WIPHY_FLAG_4ADDR_STATION: supports 4addr mode even as a station
-  * @WIPHY_FLAG_CONTROL_PORT_PROTOCOL: This device supports setting the
-  *	control port protocol ethertype. The device also honours the
---- a/net/mac80211/util.c
-+++ b/net/mac80211/util.c
-@@ -3626,7 +3626,9 @@ int ieee80211_check_combinations(struct
- 	}
- 
- 	/* Always allow software iftypes */
--	if (local->hw.wiphy->software_iftypes & BIT(iftype)) {
-+	if (local->hw.wiphy->software_iftypes & BIT(iftype) ||
-+	    (iftype == NL80211_IFTYPE_AP_VLAN &&
-+	     local->hw.wiphy->flags & WIPHY_FLAG_4ADDR_AP)) {
- 		if (radar_detect)
- 			return -EINVAL;
- 		return 0;
---- a/net/wireless/core.c
-+++ b/net/wireless/core.c
-@@ -1351,8 +1351,12 @@ static int cfg80211_netdev_notifier_call
- 		}
- 		break;
- 	case NETDEV_PRE_UP:
--		if (!(wdev->wiphy->interface_modes & BIT(wdev->iftype)))
-+		if (!(wdev->wiphy->interface_modes & BIT(wdev->iftype)) &&
-+		    !(wdev->iftype == NL80211_IFTYPE_AP_VLAN &&
-+		      rdev->wiphy.flags & WIPHY_FLAG_4ADDR_AP &&
-+		      wdev->use_4addr))
- 			return notifier_from_errno(-EOPNOTSUPP);
-+
- 		if (rfkill_blocked(rdev->rfkill))
- 			return notifier_from_errno(-ERFKILL);
- 		break;
---- a/net/wireless/nl80211.c
-+++ b/net/wireless/nl80211.c
-@@ -3194,8 +3194,7 @@ static int nl80211_new_interface(struct
- 			return -EINVAL;
- 	}
- 
--	if (!rdev->ops->add_virtual_intf ||
--	    !(rdev->wiphy.interface_modes & (1 << type)))
-+	if (!rdev->ops->add_virtual_intf)
- 		return -EOPNOTSUPP;
- 
- 	if ((type == NL80211_IFTYPE_P2P_DEVICE || type == NL80211_IFTYPE_NAN ||
-@@ -3214,6 +3213,11 @@ static int nl80211_new_interface(struct
- 			return err;
- 	}
- 
-+	if (!(rdev->wiphy.interface_modes & (1 << type)) &&
-+	    !(type == NL80211_IFTYPE_AP_VLAN && params.use_4addr &&
-+	      rdev->wiphy.flags & WIPHY_FLAG_4ADDR_AP))
-+		return -EOPNOTSUPP;
-+
- 	err = nl80211_parse_mon_options(rdev, type, info, &params);
- 	if (err < 0)
- 		return err;
diff --git a/package/kernel/mac80211/patches/subsys/522-mac80211_configure_antenna_gain.patch b/package/kernel/mac80211/patches/subsys/522-mac80211_configure_antenna_gain.patch
index 4dcd7b5fcc..7960039fd7 100644
--- a/package/kernel/mac80211/patches/subsys/522-mac80211_configure_antenna_gain.patch
+++ b/package/kernel/mac80211/patches/subsys/522-mac80211_configure_antenna_gain.patch
@@ -1,6 +1,6 @@
 --- a/include/net/cfg80211.h
 +++ b/include/net/cfg80211.h
-@@ -2968,6 +2968,7 @@ struct cfg80211_external_auth_params {
+@@ -3322,6 +3322,7 @@ struct cfg80211_update_owe_info {
   *	(as advertised by the nl80211 feature flag.)
   * @get_tx_power: store the current TX power into the dbm variable;
   *	return 0 if successful
@@ -8,7 +8,7 @@
   *
   * @set_wds_peer: set the WDS peer for a WDS interface
   *
-@@ -3268,6 +3269,7 @@ struct cfg80211_ops {
+@@ -3634,6 +3635,7 @@ struct cfg80211_ops {
  				enum nl80211_tx_power_setting type, int mbm);
  	int	(*get_tx_power)(struct wiphy *wiphy, struct wireless_dev *wdev,
  				int *dbm);
@@ -18,7 +18,7 @@
  				const u8 *addr);
 --- a/include/net/mac80211.h
 +++ b/include/net/mac80211.h
-@@ -1395,6 +1395,7 @@ enum ieee80211_smps_mode {
+@@ -1471,6 +1471,7 @@ enum ieee80211_smps_mode {
   *
   * @power_level: requested transmit power (in dBm), backward compatibility
   *	value only that is set to the minimum of all interfaces
@@ -26,7 +26,7 @@
   *
   * @chandef: the channel definition to tune to
   * @radar_enabled: whether radar detection is enabled
-@@ -1415,6 +1416,7 @@ enum ieee80211_smps_mode {
+@@ -1491,6 +1492,7 @@ enum ieee80211_smps_mode {
  struct ieee80211_conf {
  	u32 flags;
  	int power_level, dynamic_ps_timeout;
@@ -36,9 +36,9 @@
  	u8 ps_dtim_period;
 --- a/include/uapi/linux/nl80211.h
 +++ b/include/uapi/linux/nl80211.h
-@@ -2244,6 +2244,9 @@ enum nl80211_commands {
-  * @NL80211_ATTR_AIRTIME_WEIGHT: Station's weight when scheduled by the airtime
-  *	scheduler.
+@@ -2341,6 +2341,9 @@ enum nl80211_commands {
+  *	should be picking up the lowest tx power, either tx power per-interface
+  *	or per-station.
   *
 + * @NL80211_ATTR_WIPHY_ANTENNA_GAIN: Configured antenna gain. Used to reduce
 + *	transmit power to stay within regulatory limits. u32, dBi.
@@ -46,9 +46,9 @@
   * @NUM_NL80211_ATTR: total number of nl80211_attrs available
   * @NL80211_ATTR_MAX: highest attribute number currently defined
   * @__NL80211_ATTR_AFTER_LAST: internal use
-@@ -2693,6 +2696,8 @@ enum nl80211_attrs {
- 
- 	NL80211_ATTR_AIRTIME_WEIGHT,
+@@ -2794,6 +2797,8 @@ enum nl80211_attrs {
+ 	NL80211_ATTR_STA_TX_POWER_SETTING,
+ 	NL80211_ATTR_STA_TX_POWER,
  
 +	NL80211_ATTR_WIPHY_ANTENNA_GAIN,
 +
@@ -57,7 +57,7 @@
  	__NL80211_ATTR_AFTER_LAST,
 --- a/net/mac80211/cfg.c
 +++ b/net/mac80211/cfg.c
-@@ -2505,6 +2505,19 @@ static int ieee80211_get_tx_power(struct
+@@ -2577,6 +2577,19 @@ static int ieee80211_get_tx_power(struct
  	return 0;
  }
  
@@ -77,7 +77,7 @@
  static int ieee80211_set_wds_peer(struct wiphy *wiphy, struct net_device *dev,
  				  const u8 *addr)
  {
-@@ -3872,6 +3885,7 @@ const struct cfg80211_ops mac80211_confi
+@@ -3990,6 +4003,7 @@ const struct cfg80211_ops mac80211_confi
  	.set_wiphy_params = ieee80211_set_wiphy_params,
  	.set_tx_power = ieee80211_set_tx_power,
  	.get_tx_power = ieee80211_get_tx_power,
@@ -87,7 +87,7 @@
  	CFG80211_TESTMODE_CMD(ieee80211_testmode_cmd)
 --- a/net/mac80211/ieee80211_i.h
 +++ b/net/mac80211/ieee80211_i.h
-@@ -1365,6 +1365,7 @@ struct ieee80211_local {
+@@ -1373,6 +1373,7 @@ struct ieee80211_local {
  	int dynamic_ps_forced_timeout;
  
  	int user_power_level; /* in dBm, for all interfaces */
@@ -97,7 +97,7 @@
  
 --- a/net/mac80211/main.c
 +++ b/net/mac80211/main.c
-@@ -94,7 +94,7 @@ static u32 ieee80211_hw_conf_chan(struct
+@@ -92,7 +92,7 @@ static u32 ieee80211_hw_conf_chan(struct
  	struct ieee80211_sub_if_data *sdata;
  	struct cfg80211_chan_def chandef = {};
  	u32 changed = 0;
@@ -106,7 +106,7 @@
  	u32 offchannel_flag;
  
  	offchannel_flag = local->hw.conf.flags & IEEE80211_CONF_OFFCHANNEL;
-@@ -151,6 +151,12 @@ static u32 ieee80211_hw_conf_chan(struct
+@@ -149,6 +149,12 @@ static u32 ieee80211_hw_conf_chan(struct
  	}
  	rcu_read_unlock();
  
@@ -119,7 +119,7 @@
  	if (local->hw.conf.power_level != power) {
  		changed |= IEEE80211_CONF_CHANGE_POWER;
  		local->hw.conf.power_level = power;
-@@ -626,6 +632,7 @@ struct ieee80211_hw *ieee80211_alloc_hw_
+@@ -638,6 +644,7 @@ struct ieee80211_hw *ieee80211_alloc_hw_
  					 IEEE80211_RADIOTAP_MCS_HAVE_BW;
  	local->hw.radiotap_vht_details = IEEE80211_RADIOTAP_VHT_KNOWN_GI |
  					 IEEE80211_RADIOTAP_VHT_KNOWN_BANDWIDTH;
@@ -129,15 +129,15 @@
  	local->user_power_level = IEEE80211_UNSET_POWER_LEVEL;
 --- a/net/wireless/nl80211.c
 +++ b/net/wireless/nl80211.c
-@@ -431,6 +431,7 @@ static const struct nla_policy nl80211_p
- 	[NL80211_ATTR_HE_CAPABILITY] = { .type = NLA_BINARY,
- 					 .len = NL80211_HE_MAX_CAPABILITY_LEN },
+@@ -571,6 +571,7 @@ const struct nla_policy nl80211_policy[N
+ 	[NL80211_ATTR_PEER_MEASUREMENTS] =
+ 		NLA_POLICY_NESTED(nl80211_pmsr_attr_policy),
  	[NL80211_ATTR_AIRTIME_WEIGHT] = NLA_POLICY_MIN(NLA_U16, 1),
 +	[NL80211_ATTR_WIPHY_ANTENNA_GAIN] = { .type = NLA_U32 },
  };
  
  /* policy for the key attributes */
-@@ -2588,6 +2589,20 @@ static int nl80211_set_wiphy(struct sk_b
+@@ -2866,6 +2867,20 @@ static int nl80211_set_wiphy(struct sk_b
  		if (result)
  			return result;
  	}
diff --git a/package/network/utils/iw/patches/001-nl80211_h_sync.patch b/package/network/utils/iw/patches/001-nl80211_h_sync.patch
index 5f15684d30..5c0993a7b7 100644
--- a/package/network/utils/iw/patches/001-nl80211_h_sync.patch
+++ b/package/network/utils/iw/patches/001-nl80211_h_sync.patch
@@ -1,45 +1,283 @@
+diff --git a/nl80211.h b/nl80211.h
+index 31ae5c7..9fb7370 100644
 --- a/nl80211.h
 +++ b/nl80211.h
-@@ -2299,6 +2299,12 @@ enum nl80211_commands {
+@@ -11,7 +11,7 @@
+  * Copyright 2008 Jouni Malinen <jouni.malinen at atheros.com>
+  * Copyright 2008 Colin McCabe <colin at cozybit.com>
+  * Copyright 2015-2017	Intel Deutschland GmbH
+- * Copyright (C) 2018 Intel Corporation
++ * Copyright (C) 2018-2019 Intel Corporation
+  *
+  * Permission to use, copy, modify, and/or distribute this software for any
+  * purpose with or without fee is hereby granted, provided that the above
+@@ -1065,6 +1065,26 @@
+  *	indicated by %NL80211_ATTR_WIPHY_FREQ and other attributes
+  *	determining the width and type.
+  *
++ * @NL80211_CMD_UPDATE_OWE_INFO: This interface allows the host driver to
++ *	offload OWE processing to user space. This intends to support
++ *	OWE AKM by the host drivers that implement SME but rely
++ *	on the user space for the cryptographic/DH IE processing in AP mode.
++ *
++ * @NL80211_CMD_PROBE_MESH_LINK: The requirement for mesh link metric
++ *	refreshing, is that from one mesh point we be able to send some data
++ *	frames to other mesh points which are not currently selected as a
++ *	primary traffic path, but which are only 1 hop away. The absence of
++ *	the primary path to the chosen node makes it necessary to apply some
++ *	form of marking on a chosen packet stream so that the packets can be
++ *	properly steered to the selected node for testing, and not by the
++ *	regular mesh path lookup. Further, the packets must be of type data
++ *	so that the rate control (often embedded in firmware) is used for
++ *	rate selection.
++ *
++ *	Here attribute %NL80211_ATTR_MAC is used to specify connected mesh
++ *	peer MAC address and %NL80211_ATTR_FRAME is used to specify the frame
++ *	content. The frame is ethernet data.
++ *
+  * @NL80211_CMD_MAX: highest used command number
+  * @__NL80211_CMD_AFTER_LAST: internal use
+  */
+@@ -1285,6 +1305,10 @@ enum nl80211_commands {
+ 
+ 	NL80211_CMD_NOTIFY_RADAR,
+ 
++	NL80211_CMD_UPDATE_OWE_INFO,
++
++	NL80211_CMD_PROBE_MESH_LINK,
++
+ 	/* add new commands above here */
+ 
+ 	/* used to define NL80211_CMD_MAX below */
+@@ -1565,6 +1589,12 @@ enum nl80211_commands {
+  *	(a u32 with flags from &enum nl80211_wpa_versions).
+  * @NL80211_ATTR_AKM_SUITES: Used with CONNECT, ASSOCIATE, and NEW_BEACON to
+  *	indicate which key management algorithm(s) to use (an array of u32).
++ *	This attribute is also sent in response to @NL80211_CMD_GET_WIPHY,
++ *	indicating the supported AKM suites, intended for specific drivers which
++ *	implement SME and have constraints on which AKMs are supported and also
++ *	the cases where an AKM support is offloaded to the driver/firmware.
++ *	If there is no such notification from the driver, user space should
++ *	assume the driver supports all the AKM suites.
+  *
+  * @NL80211_ATTR_REQ_IE: (Re)association request information elements as
+  *	sent out by the card, for ROAM and successful CONNECT events.
+@@ -2260,10 +2290,10 @@ enum nl80211_commands {
+  *     &enum nl80211_external_auth_action value). This is used with the
+  *     %NL80211_CMD_EXTERNAL_AUTH request event.
+  * @NL80211_ATTR_EXTERNAL_AUTH_SUPPORT: Flag attribute indicating that the user
+- *     space supports external authentication. This attribute shall be used
+- *     only with %NL80211_CMD_CONNECT request. The driver may offload
+- *     authentication processing to user space if this capability is indicated
+- *     in NL80211_CMD_CONNECT requests from the user space.
++ *	space supports external authentication. This attribute shall be used
++ *	with %NL80211_CMD_CONNECT and %NL80211_CMD_START_AP request. The driver
++ *	may offload authentication processing to user space if this capability
++ *	is indicated in the respective requests from the user space.
+  *
+  * @NL80211_ATTR_NSS: Station's New/updated  RX_NSS value notified using this
+  *	u8 attribute. This is used with %NL80211_CMD_STA_OPMODE_CHANGED.
+@@ -2299,6 +2329,21 @@ enum nl80211_commands {
   *	This is also used for capability advertisement in the wiphy information,
   *	with the appropriate sub-attributes.
   *
 + * @NL80211_ATTR_AIRTIME_WEIGHT: Station's weight when scheduled by the airtime
 + *	scheduler.
 + *
++ * @NL80211_ATTR_STA_TX_POWER_SETTING: Transmit power setting type (u8) for
++ *	station associated with the AP. See &enum nl80211_tx_power_setting for
++ *	possible values.
++ * @NL80211_ATTR_STA_TX_POWER: Transmit power level (s16) in dBm units. This
++ *	allows to set Tx power for a station. If this attribute is not included,
++ *	the default per-interface tx power setting will be overriding. Driver
++ *	should be picking up the lowest tx power, either tx power per-interface
++ *	or per-station.
++ *
 + * @NL80211_ATTR_WIPHY_ANTENNA_GAIN: Configured antenna gain. Used to reduce
 + *	transmit power to stay within regulatory limits. u32, dBi.
 + *
   * @NUM_NL80211_ATTR: total number of nl80211_attrs available
   * @NL80211_ATTR_MAX: highest attribute number currently defined
   * @__NL80211_ATTR_AFTER_LAST: internal use
-@@ -2748,6 +2754,10 @@ enum nl80211_attrs {
+@@ -2748,6 +2793,12 @@ enum nl80211_attrs {
  
  	NL80211_ATTR_PEER_MEASUREMENTS,
  
 +	NL80211_ATTR_AIRTIME_WEIGHT,
++	NL80211_ATTR_STA_TX_POWER_SETTING,
++	NL80211_ATTR_STA_TX_POWER,
 +
 +	NL80211_ATTR_WIPHY_ANTENNA_GAIN,
 +
  	/* add attributes here, update the policy in nl80211.c */
  
  	__NL80211_ATTR_AFTER_LAST,
-@@ -3125,6 +3135,9 @@ enum nl80211_sta_bss_param {
+@@ -2791,7 +2842,7 @@ enum nl80211_attrs {
+ 
+ #define NL80211_MAX_SUPP_RATES			32
+ #define NL80211_MAX_SUPP_HT_RATES		77
+-#define NL80211_MAX_SUPP_REG_RULES		64
++#define NL80211_MAX_SUPP_REG_RULES		128
+ #define NL80211_TKIP_DATA_OFFSET_ENCR_KEY	0
+ #define NL80211_TKIP_DATA_OFFSET_TX_MIC_KEY	16
+ #define NL80211_TKIP_DATA_OFFSET_RX_MIC_KEY	24
+@@ -3125,6 +3176,10 @@ enum nl80211_sta_bss_param {
   *	might not be fully accurate.
   * @NL80211_STA_INFO_CONNECTED_TO_GATE: set to true if STA has a path to a
   *	mesh gate (u8, 0 or 1)
 + * @NL80211_STA_INFO_TX_DURATION: aggregate PPDU duration for all frames
 + *	sent to the station (u64, usec)
 + * @NL80211_STA_INFO_AIRTIME_WEIGHT: current airtime weight for station (u16)
++ * @NL80211_STA_INFO_AIRTIME_LINK_METRIC: airtime link metric for mesh station
   * @__NL80211_STA_INFO_AFTER_LAST: internal
   * @NL80211_STA_INFO_MAX: highest possible station info attribute
   */
-@@ -3168,6 +3181,8 @@ enum nl80211_sta_info {
+@@ -3168,6 +3223,9 @@ enum nl80211_sta_info {
  	NL80211_STA_INFO_RX_MPDUS,
  	NL80211_STA_INFO_FCS_ERROR_COUNT,
  	NL80211_STA_INFO_CONNECTED_TO_GATE,
 +	NL80211_STA_INFO_TX_DURATION,
 +	NL80211_STA_INFO_AIRTIME_WEIGHT,
++	NL80211_STA_INFO_AIRTIME_LINK_METRIC,
  
  	/* keep last */
  	__NL80211_STA_INFO_AFTER_LAST,
+@@ -3277,8 +3335,10 @@ enum nl80211_mpath_flags {
+  * 	&enum nl80211_mpath_flags;
+  * @NL80211_MPATH_INFO_DISCOVERY_TIMEOUT: total path discovery timeout, in msec
+  * @NL80211_MPATH_INFO_DISCOVERY_RETRIES: mesh path discovery retries
++ * @NL80211_MPATH_INFO_HOP_COUNT: hop count to destination
++ * @NL80211_MPATH_INFO_PATH_CHANGE: total number of path changes to destination
+  * @NL80211_MPATH_INFO_MAX: highest mesh path information attribute number
+- *	currently defind
++ *	currently defined
+  * @__NL80211_MPATH_INFO_AFTER_LAST: internal use
+  */
+ enum nl80211_mpath_info {
+@@ -3290,6 +3350,8 @@ enum nl80211_mpath_info {
+ 	NL80211_MPATH_INFO_FLAGS,
+ 	NL80211_MPATH_INFO_DISCOVERY_TIMEOUT,
+ 	NL80211_MPATH_INFO_DISCOVERY_RETRIES,
++	NL80211_MPATH_INFO_HOP_COUNT,
++	NL80211_MPATH_INFO_PATH_CHANGE,
+ 
+ 	/* keep last */
+ 	__NL80211_MPATH_INFO_AFTER_LAST,
+@@ -3618,6 +3680,14 @@ enum nl80211_reg_rule_attr {
+  *	value as specified by &struct nl80211_bss_select_rssi_adjust.
+  * @NL80211_SCHED_SCAN_MATCH_ATTR_BSSID: BSSID to be used for matching
+  *	(this cannot be used together with SSID).
++ * @NL80211_SCHED_SCAN_MATCH_PER_BAND_RSSI: Nested attribute that carries the
++ *	band specific minimum rssi thresholds for the bands defined in
++ *	enum nl80211_band. The minimum rssi threshold value(s32) specific to a
++ *	band shall be encapsulated in attribute with type value equals to one
++ *	of the NL80211_BAND_* defined in enum nl80211_band. For example, the
++ *	minimum rssi threshold value for 2.4GHZ band shall be encapsulated
++ *	within an attribute of type NL80211_BAND_2GHZ. And one or more of such
++ *	attributes will be nested within this attribute.
+  * @NL80211_SCHED_SCAN_MATCH_ATTR_MAX: highest scheduled scan filter
+  *	attribute number currently defined
+  * @__NL80211_SCHED_SCAN_MATCH_ATTR_AFTER_LAST: internal use
+@@ -3630,6 +3700,7 @@ enum nl80211_sched_scan_match_attr {
+ 	NL80211_SCHED_SCAN_MATCH_ATTR_RELATIVE_RSSI,
+ 	NL80211_SCHED_SCAN_MATCH_ATTR_RSSI_ADJUST,
+ 	NL80211_SCHED_SCAN_MATCH_ATTR_BSSID,
++	NL80211_SCHED_SCAN_MATCH_PER_BAND_RSSI,
+ 
+ 	/* keep last */
+ 	__NL80211_SCHED_SCAN_MATCH_ATTR_AFTER_LAST,
+@@ -4114,6 +4185,27 @@ enum nl80211_channel_type {
+ 	NL80211_CHAN_HT40PLUS
+ };
+ 
++/**
++ * enum nl80211_key_mode - Key mode
++ *
++ * @NL80211_KEY_RX_TX: (Default)
++ *	Key can be used for Rx and Tx immediately
++ *
++ * The following modes can only be selected for unicast keys and when the
++ * driver supports @NL80211_EXT_FEATURE_EXT_KEY_ID:
++ *
++ * @NL80211_KEY_NO_TX: Only allowed in combination with @NL80211_CMD_NEW_KEY:
++ *	Unicast key can only be used for Rx, Tx not allowed, yet
++ * @NL80211_KEY_SET_TX: Only allowed in combination with @NL80211_CMD_SET_KEY:
++ *	The unicast key identified by idx and mac is cleared for Tx and becomes
++ *	the preferred Tx key for the station.
++ */
++enum nl80211_key_mode {
++	NL80211_KEY_RX_TX,
++	NL80211_KEY_NO_TX,
++	NL80211_KEY_SET_TX
++};
++
+ /**
+  * enum nl80211_chan_width - channel width definitions
+  *
+@@ -4357,6 +4449,9 @@ enum nl80211_key_default_types {
+  * @NL80211_KEY_DEFAULT_TYPES: A nested attribute containing flags
+  *	attributes, specifying what a key should be set as default as.
+  *	See &enum nl80211_key_default_types.
++ * @NL80211_KEY_MODE: the mode from enum nl80211_key_mode.
++ *	Defaults to @NL80211_KEY_RX_TX.
++ *
+  * @__NL80211_KEY_AFTER_LAST: internal
+  * @NL80211_KEY_MAX: highest key attribute
+  */
+@@ -4370,6 +4465,7 @@ enum nl80211_key_attributes {
+ 	NL80211_KEY_DEFAULT_MGMT,
+ 	NL80211_KEY_TYPE,
+ 	NL80211_KEY_DEFAULT_TYPES,
++	NL80211_KEY_MODE,
+ 
+ 	/* keep last */
+ 	__NL80211_KEY_AFTER_LAST,
+@@ -5315,6 +5411,21 @@ enum nl80211_feature_flags {
+  *      able to rekey an in-use key correctly. Userspace must not rekey PTK keys
+  *      if this flag is not set. Ignoring this can leak clear text packets and/or
+  *      freeze the connection.
++ * @NL80211_EXT_FEATURE_EXT_KEY_ID: Driver supports "Extended Key ID for
++ *      Individually Addressed Frames" from IEEE802.11-2016.
++ *
++ * @NL80211_EXT_FEATURE_AIRTIME_FAIRNESS: Driver supports getting airtime
++ *	fairness for transmitted packets and has enabled airtime fairness
++ *	scheduling.
++ *
++ * @NL80211_EXT_FEATURE_AP_PMKSA_CACHING: Driver/device supports PMKSA caching
++ *	(set/del PMKSA operations) in AP mode.
++ *
++ * @NL80211_EXT_FEATURE_SCHED_SCAN_BAND_SPECIFIC_RSSI_THOLD: Driver supports
++ *	filtering of sched scan results using band specific RSSI thresholds.
++ *
++ * @NL80211_EXT_FEATURE_STA_TX_PWR: This driver supports controlling tx power
++ *	to a station.
+  *
+  * @NUM_NL80211_EXT_FEATURES: number of extended features.
+  * @MAX_NL80211_EXT_FEATURES: highest extended feature index.
+@@ -5355,6 +5466,11 @@ enum nl80211_ext_feature_index {
+ 	NL80211_EXT_FEATURE_SCAN_MIN_PREQ_CONTENT,
+ 	NL80211_EXT_FEATURE_CAN_REPLACE_PTK0,
+ 	NL80211_EXT_FEATURE_ENABLE_FTM_RESPONDER,
++	NL80211_EXT_FEATURE_AIRTIME_FAIRNESS,
++	NL80211_EXT_FEATURE_AP_PMKSA_CACHING,
++	NL80211_EXT_FEATURE_SCHED_SCAN_BAND_SPECIFIC_RSSI_THOLD,
++	NL80211_EXT_FEATURE_EXT_KEY_ID,
++	NL80211_EXT_FEATURE_STA_TX_PWR,
+ 
+ 	/* add new features before the definition below */
+ 	NUM_NL80211_EXT_FEATURES,
+@@ -5606,9 +5722,14 @@ enum nl80211_crit_proto_id {
+  * Used by cfg80211_rx_mgmt()
+  *
+  * @NL80211_RXMGMT_FLAG_ANSWERED: frame was answered by device/driver.
++ * @NL80211_RXMGMT_FLAG_EXTERNAL_AUTH: Host driver intends to offload
++ *	the authentication. Exclusively defined for host drivers that
++ *	advertises the SME functionality but would like the userspace
++ *	to handle certain authentication algorithms (e.g. SAE).
+  */
+ enum nl80211_rxmgmt_flags {
+ 	NL80211_RXMGMT_FLAG_ANSWERED = 1 << 0,
++	NL80211_RXMGMT_FLAG_EXTERNAL_AUTH = 1 << 1,
+ };
+ 
+ /*
diff --git a/target/linux/generic/backport-4.9/041-mm-rename-__alloc_page_frag-to-page_frag_alloc-and-_.patch b/target/linux/generic/backport-4.9/041-mm-rename-__alloc_page_frag-to-page_frag_alloc-and-_.patch
deleted file mode 100644
index facc43004e..0000000000
--- a/target/linux/generic/backport-4.9/041-mm-rename-__alloc_page_frag-to-page_frag_alloc-and-_.patch
+++ /dev/null
@@ -1,137 +0,0 @@
-From: Alexander Duyck <alexander.h.duyck at intel.com>
-Date: Tue, 10 Jan 2017 16:58:06 -0800
-Subject: [PATCH] mm: rename __alloc_page_frag to page_frag_alloc and
- __free_page_frag to page_frag_free
-
-Patch series "Page fragment updates", v4.
-
-This patch series takes care of a few cleanups for the page fragments
-API.
-
-First we do some renames so that things are much more consistent.  First
-we move the page_frag_ portion of the name to the front of the functions
-names.  Secondly we split out the cache specific functions from the
-other page fragment functions by adding the word "cache" to the name.
-
-Finally I added a bit of documentation that will hopefully help to
-explain some of this.  I plan to revisit this later as we get things
-more ironed out in the near future with the changes planned for the DMA
-setup to support eXpress Data Path.
-
-This patch (of 3):
-
-This patch renames the page frag functions to be more consistent with
-other APIs.  Specifically we place the name page_frag first in the name
-and then have either an alloc or free call name that we append as the
-suffix.  This makes it a bit clearer in terms of naming.
-
-In addition we drop the leading double underscores since we are
-technically no longer a backing interface and instead the front end that
-is called from the networking APIs.
-
-Link: http://lkml.kernel.org/r/20170104023854.13451.67390.stgit@localhost.localdomain
-Signed-off-by: Alexander Duyck <alexander.h.duyck at intel.com>
-Signed-off-by: Andrew Morton <akpm at linux-foundation.org>
-Signed-off-by: Linus Torvalds <torvalds at linux-foundation.org>
----
-
---- a/include/linux/gfp.h
-+++ b/include/linux/gfp.h
-@@ -508,9 +508,9 @@ extern void free_hot_cold_page_list(stru
- struct page_frag_cache;
- extern void __page_frag_drain(struct page *page, unsigned int order,
- 			      unsigned int count);
--extern void *__alloc_page_frag(struct page_frag_cache *nc,
--			       unsigned int fragsz, gfp_t gfp_mask);
--extern void __free_page_frag(void *addr);
-+extern void *page_frag_alloc(struct page_frag_cache *nc,
-+			     unsigned int fragsz, gfp_t gfp_mask);
-+extern void page_frag_free(void *addr);
- 
- #define __free_page(page) __free_pages((page), 0)
- #define free_page(addr) free_pages((addr), 0)
---- a/include/linux/skbuff.h
-+++ b/include/linux/skbuff.h
-@@ -2476,7 +2476,7 @@ static inline struct sk_buff *netdev_all
- 
- static inline void skb_free_frag(void *addr)
- {
--	__free_page_frag(addr);
-+	page_frag_free(addr);
- }
- 
- void *napi_alloc_frag(unsigned int fragsz);
---- a/mm/page_alloc.c
-+++ b/mm/page_alloc.c
-@@ -3949,8 +3949,8 @@ void __page_frag_drain(struct page *page
- }
- EXPORT_SYMBOL(__page_frag_drain);
- 
--void *__alloc_page_frag(struct page_frag_cache *nc,
--			unsigned int fragsz, gfp_t gfp_mask)
-+void *page_frag_alloc(struct page_frag_cache *nc,
-+		      unsigned int fragsz, gfp_t gfp_mask)
- {
- 	unsigned int size = PAGE_SIZE;
- 	struct page *page;
-@@ -4001,19 +4001,19 @@ refill:
- 
- 	return nc->va + offset;
- }
--EXPORT_SYMBOL(__alloc_page_frag);
-+EXPORT_SYMBOL(page_frag_alloc);
- 
- /*
-  * Frees a page fragment allocated out of either a compound or order 0 page.
-  */
--void __free_page_frag(void *addr)
-+void page_frag_free(void *addr)
- {
- 	struct page *page = virt_to_head_page(addr);
- 
- 	if (unlikely(put_page_testzero(page)))
- 		__free_pages_ok(page, compound_order(page));
- }
--EXPORT_SYMBOL(__free_page_frag);
-+EXPORT_SYMBOL(page_frag_free);
- 
- static void *make_alloc_exact(unsigned long addr, unsigned int order,
- 		size_t size)
---- a/net/core/skbuff.c
-+++ b/net/core/skbuff.c
-@@ -369,7 +369,7 @@ static void *__netdev_alloc_frag(unsigne
- 
- 	local_irq_save(flags);
- 	nc = this_cpu_ptr(&netdev_alloc_cache);
--	data = __alloc_page_frag(nc, fragsz, gfp_mask);
-+	data = page_frag_alloc(nc, fragsz, gfp_mask);
- 	local_irq_restore(flags);
- 	return data;
- }
-@@ -393,7 +393,7 @@ static void *__napi_alloc_frag(unsigned
- {
- 	struct napi_alloc_cache *nc = this_cpu_ptr(&napi_alloc_cache);
- 
--	return __alloc_page_frag(&nc->page, fragsz, gfp_mask);
-+	return page_frag_alloc(&nc->page, fragsz, gfp_mask);
- }
- 
- void *napi_alloc_frag(unsigned int fragsz)
-@@ -445,7 +445,7 @@ struct sk_buff *__netdev_alloc_skb(struc
- 	local_irq_save(flags);
- 
- 	nc = this_cpu_ptr(&netdev_alloc_cache);
--	data = __alloc_page_frag(nc, len, gfp_mask);
-+	data = page_frag_alloc(nc, len, gfp_mask);
- 	pfmemalloc = nc->pfmemalloc;
- 
- 	local_irq_restore(flags);
-@@ -509,7 +509,7 @@ struct sk_buff *__napi_alloc_skb(struct
- 	if (sk_memalloc_socks())
- 		gfp_mask |= __GFP_MEMALLOC;
- 
--	data = __alloc_page_frag(&nc->page, len, gfp_mask);
-+	data = page_frag_alloc(&nc->page, len, gfp_mask);
- 	if (unlikely(!data))
- 		return NULL;
- 
diff --git a/target/linux/generic/backport-4.9/042-mm-rename-__page_frag-functions-to-__page_frag_cache.patch b/target/linux/generic/backport-4.9/042-mm-rename-__page_frag-functions-to-__page_frag_cache.patch
deleted file mode 100644
index 31b57167b4..0000000000
--- a/target/linux/generic/backport-4.9/042-mm-rename-__page_frag-functions-to-__page_frag_cache.patch
+++ /dev/null
@@ -1,79 +0,0 @@
-From: Alexander Duyck <alexander.h.duyck at intel.com>
-Date: Tue, 10 Jan 2017 16:58:09 -0800
-Subject: [PATCH] mm: rename __page_frag functions to __page_frag_cache, drop
- order from drain
-
-This patch does two things.
-
-First it goes through and renames the __page_frag prefixed functions to
-__page_frag_cache so that we can be clear that we are draining or
-refilling the cache, not the frags themselves.
-
-Second we drop the order parameter from __page_frag_cache_drain since we
-don't actually need to pass it since all fragments are either order 0 or
-must be a compound page.
-
-Link: http://lkml.kernel.org/r/20170104023954.13451.5678.stgit@localhost.localdomain
-Signed-off-by: Alexander Duyck <alexander.h.duyck at intel.com>
-Signed-off-by: Andrew Morton <akpm at linux-foundation.org>
-Signed-off-by: Linus Torvalds <torvalds at linux-foundation.org>
----
-
---- a/include/linux/gfp.h
-+++ b/include/linux/gfp.h
-@@ -506,8 +506,7 @@ extern void free_hot_cold_page(struct pa
- extern void free_hot_cold_page_list(struct list_head *list, bool cold);
- 
- struct page_frag_cache;
--extern void __page_frag_drain(struct page *page, unsigned int order,
--			      unsigned int count);
-+extern void __page_frag_cache_drain(struct page *page, unsigned int count);
- extern void *page_frag_alloc(struct page_frag_cache *nc,
- 			     unsigned int fragsz, gfp_t gfp_mask);
- extern void page_frag_free(void *addr);
---- a/mm/page_alloc.c
-+++ b/mm/page_alloc.c
-@@ -3914,8 +3914,8 @@ EXPORT_SYMBOL(free_pages);
-  * drivers to provide a backing region of memory for use as either an
-  * sk_buff->head, or to be used in the "frags" portion of skb_shared_info.
-  */
--static struct page *__page_frag_refill(struct page_frag_cache *nc,
--				       gfp_t gfp_mask)
-+static struct page *__page_frag_cache_refill(struct page_frag_cache *nc,
-+					     gfp_t gfp_mask)
- {
- 	struct page *page = NULL;
- 	gfp_t gfp = gfp_mask;
-@@ -3935,19 +3935,20 @@ static struct page *__page_frag_refill(s
- 	return page;
- }
- 
--void __page_frag_drain(struct page *page, unsigned int order,
--		       unsigned int count)
-+void __page_frag_cache_drain(struct page *page, unsigned int count)
- {
- 	VM_BUG_ON_PAGE(page_ref_count(page) == 0, page);
- 
- 	if (page_ref_sub_and_test(page, count)) {
-+		unsigned int order = compound_order(page);
-+
- 		if (order == 0)
- 			free_hot_cold_page(page, false);
- 		else
- 			__free_pages_ok(page, order);
- 	}
- }
--EXPORT_SYMBOL(__page_frag_drain);
-+EXPORT_SYMBOL(__page_frag_cache_drain);
- 
- void *page_frag_alloc(struct page_frag_cache *nc,
- 		      unsigned int fragsz, gfp_t gfp_mask)
-@@ -3958,7 +3959,7 @@ void *page_frag_alloc(struct page_frag_c
- 
- 	if (unlikely(!nc->va)) {
- refill:
--		page = __page_frag_refill(nc, gfp_mask);
-+		page = __page_frag_cache_refill(nc, gfp_mask);
- 		if (!page)
- 			return NULL;
- 
diff --git a/target/linux/generic/pending-4.9/120-Fix-alloc_node_mem_map-with-ARCH_PFN_OFFSET-calcu.patch b/target/linux/generic/pending-4.9/120-Fix-alloc_node_mem_map-with-ARCH_PFN_OFFSET-calcu.patch
index 0f6ce1f802..794280eec9 100644
--- a/target/linux/generic/pending-4.9/120-Fix-alloc_node_mem_map-with-ARCH_PFN_OFFSET-calcu.patch
+++ b/target/linux/generic/pending-4.9/120-Fix-alloc_node_mem_map-with-ARCH_PFN_OFFSET-calcu.patch
@@ -71,7 +71,7 @@ Signed-off-by: Tobias Wolf <dev-NTEO at vplace.de>
 
 --- a/mm/page_alloc.c
 +++ b/mm/page_alloc.c
-@@ -5924,7 +5924,7 @@ static void __ref alloc_node_mem_map(str
+@@ -5923,7 +5923,7 @@ static void __ref alloc_node_mem_map(str
  		mem_map = NODE_DATA(0)->node_mem_map;
  #if defined(CONFIG_HAVE_MEMBLOCK_NODE_MAP) || defined(CONFIG_FLATMEM)
  		if (page_to_pfn(mem_map) != pgdat->node_start_pfn)
-- 
2.20.1


_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel


More information about the openwrt-devel mailing list