aboutsummaryrefslogtreecommitdiffstats
path: root/package/kernel/mac80211/patches
diff options
context:
space:
mode:
authorJohn Crispin <john@phrozen.org>2018-08-02 08:44:29 +0200
committerJohn Crispin <john@phrozen.org>2018-09-26 16:35:33 +0200
commitd9eefa7a7031543571d434693c7f984dfbdc990d (patch)
tree73ac027ccf6cdb6fd209a83e7e25c3d0472d46b4 /package/kernel/mac80211/patches
parente9d92bf1e1af71ff19e4cdc753de3f65963c58a5 (diff)
downloadupstream-d9eefa7a7031543571d434693c7f984dfbdc990d.tar.gz
upstream-d9eefa7a7031543571d434693c7f984dfbdc990d.tar.bz2
upstream-d9eefa7a7031543571d434693c7f984dfbdc990d.zip
mac80211: rebase ontop of v4.18.5
Signed-off-by: John Crispin <john@phrozen.org>
Diffstat (limited to 'package/kernel/mac80211/patches')
-rw-r--r--package/kernel/mac80211/patches/007-fix-linux-verification-h.patch11
-rw-r--r--package/kernel/mac80211/patches/008-fix-genl-family-id.patch10
-rw-r--r--package/kernel/mac80211/patches/015-ipw200-mtu.patch34
-rw-r--r--package/kernel/mac80211/patches/080-ath10k_thermal_config.patch47
-rw-r--r--package/kernel/mac80211/patches/081-ath10k-calibration-variant.patch111
-rw-r--r--package/kernel/mac80211/patches/082-ath10k-suppress-Unknown-eventid-36925-warnings.patch36
-rw-r--r--package/kernel/mac80211/patches/090-Revert-rt2800-use-TXOP_BACKOFF-for-probe-frames.patch45
-rw-r--r--package/kernel/mac80211/patches/160-ath10k-search-all-IEs-for-variant-before-falling-back.patch237
-rw-r--r--package/kernel/mac80211/patches/300-v4.15-ath10k-fix-build-errors-with-CONFIG_PM.patch72
-rw-r--r--package/kernel/mac80211/patches/301-v4.15-mac80211-properly-free-requested-but-not-started-TX-.patch37
-rw-r--r--package/kernel/mac80211/patches/302-v4.15-mac80211-mesh-drop-frames-appearing-to-be-from-us.patch25
-rw-r--r--package/kernel/mac80211/patches/303-v4.15-0001-brcmfmac-handle-FWHALT-mailbox-indication.patch60
-rw-r--r--package/kernel/mac80211/patches/303-v4.15-0002-brcmfmac-disable-packet-filtering-in-promiscuous-mod.patch133
-rw-r--r--package/kernel/mac80211/patches/303-v4.15-0003-brcmfmac-cleanup-brcmf_cfg80211_escan-function.patch133
-rw-r--r--package/kernel/mac80211/patches/303-v4.15-0004-brcmfmac-use-msecs_to_jiffies-instead-of-calculation.patch31
-rw-r--r--package/kernel/mac80211/patches/303-v4.15-0005-brcmfmac-get-rid-of-brcmf_cfg80211_escan-function.patch83
-rw-r--r--package/kernel/mac80211/patches/303-v4.15-0006-brcmfmac-get-rid-of-struct-brcmf_cfg80211_info-activ.patch86
-rw-r--r--package/kernel/mac80211/patches/303-v4.15-0007-brcmfmac-move-configuration-of-probe-request-IEs.patch55
-rw-r--r--package/kernel/mac80211/patches/304-v4.15-brcmfmac-add-CLM-download-support.patch434
-rw-r--r--package/kernel/mac80211/patches/305-v4.15-brcmfmac-change-driver-unbind-order-of-the-sdio-func.patch37
-rw-r--r--package/kernel/mac80211/patches/306-v4.15-brcmfmac-Avoid-build-error-with-make-W-1.patch33
-rw-r--r--package/kernel/mac80211/patches/307-v4.15-brcmfmac-fix-CLM-load-error-for-legacy-chips-when-us.patch40
-rw-r--r--package/kernel/mac80211/patches/308-v4.16-0001-ath9k-move-spectral-scan-support-under-a-separate-co.patch103
-rw-r--r--package/kernel/mac80211/patches/309-v4.16-0002-ath10k-move-spectral-scan-support-under-a-separate-c.patch91
-rw-r--r--package/kernel/mac80211/patches/310-v4.16-ath9k-discard-undersized-packets.patch25
-rw-r--r--package/kernel/mac80211/patches/311-v4.16-0001-brcmfmac-Fix-parameter-order-in-brcmf_sdiod_f0_write.patch39
-rw-r--r--package/kernel/mac80211/patches/311-v4.16-0002-brcmfmac-Register-sizes-on-hardware-are-not-dependen.patch105
-rw-r--r--package/kernel/mac80211/patches/311-v4.16-0003-brcmfmac-Split-brcmf_sdiod_regrw_helper-up.patch179
-rw-r--r--package/kernel/mac80211/patches/311-v4.16-0004-brcmfmac-Clean-up-brcmf_sdiod_set_sbaddr_window.patch62
-rw-r--r--package/kernel/mac80211/patches/311-v4.16-0005-brcmfmac-Remove-dead-IO-code.patch91
-rw-r--r--package/kernel/mac80211/patches/311-v4.16-0006-brcmfmac-Remove-bandaid-for-SleepCSR.patch61
-rw-r--r--package/kernel/mac80211/patches/311-v4.16-0007-brcmfmac-Remove-brcmf_sdiod_request_data.patch344
-rw-r--r--package/kernel/mac80211/patches/311-v4.16-0008-brcmfmac-Fix-asymmetric-IO-functions.patch28
-rw-r--r--package/kernel/mac80211/patches/311-v4.16-0009-brcmfmac-Remove-noisy-debugging.patch53
-rw-r--r--package/kernel/mac80211/patches/311-v4.16-0010-brcmfmac-Rename-bcmerror-to-err.patch58
-rw-r--r--package/kernel/mac80211/patches/312-v4.16-0001-brcmfmac-Split-brcmf_sdiod_buffrw-function-up.patch143
-rw-r--r--package/kernel/mac80211/patches/312-v4.16-0002-brcmfmac-whitespace-fixes-in-brcmf_sdiod_send_buf.patch34
-rw-r--r--package/kernel/mac80211/patches/312-v4.16-0003-brcmfmac-Clarify-if-using-braces.patch36
-rw-r--r--package/kernel/mac80211/patches/312-v4.16-0004-brcmfmac-Rename-replace-old-IO-functions-with-simple.patch831
-rw-r--r--package/kernel/mac80211/patches/312-v4.16-0005-brcmfmac-Tidy-register-definitions-a-little.patch59
-rw-r--r--package/kernel/mac80211/patches/312-v4.16-0006-brcmfmac-Remove-brcmf_sdiod_addrprep.patch190
-rw-r--r--package/kernel/mac80211/patches/312-v4.16-0007-brcmfmac-remove-unnecessary-call-to-brcmf_sdiod_set_.patch32
-rw-r--r--package/kernel/mac80211/patches/312-v4.16-0008-brcmfmac-Cleanup-offsetof.patch134
-rw-r--r--package/kernel/mac80211/patches/312-v4.16-0009-brcmfmac-Remove-unused-macro.patch26
-rw-r--r--package/kernel/mac80211/patches/312-v4.16-0010-brcmfmac-Remove-repeated-calls-to-brcmf_chip_get_cor.patch128
-rw-r--r--package/kernel/mac80211/patches/313-v4.16-0001-brcmfmac-enlarge-buffer-size-of-caps-to-512-bytes.patch44
-rw-r--r--package/kernel/mac80211/patches/314-v4.16-0001-brcmfmac-Remove-r-w-_sdreg32.patch227
-rw-r--r--package/kernel/mac80211/patches/314-v4.16-0002-brcmfmac-Rename-buscore-to-core-for-consistency.patch33
-rw-r--r--package/kernel/mac80211/patches/314-v4.16-0003-brcmfmac-stabilise-the-value-of-sbwad-in-use-for-som.patch82
-rw-r--r--package/kernel/mac80211/patches/314-v4.16-0004-brcmfmac-Correctly-handle-accesses-to-SDIO-func0.patch45
-rw-r--r--package/kernel/mac80211/patches/314-v4.16-0005-brcmfmac-Remove-func0-from-function-array.patch111
-rw-r--r--package/kernel/mac80211/patches/314-v4.16-0006-brcmfmac-More-efficient-and-slightly-easier-to-read-.patch40
-rw-r--r--package/kernel/mac80211/patches/314-v4.16-0007-brcmfmac-Replace-function-index-with-function-pointe.patch347
-rw-r--r--package/kernel/mac80211/patches/314-v4.16-0008-brcmfmac-Clean-up-interrupt-macros.patch53
-rw-r--r--package/kernel/mac80211/patches/315-v4.16-0001-brcmfmac-Support-43455-save-restore-SR-feature-if-FW.patch27
-rw-r--r--package/kernel/mac80211/patches/316-v4.16-0001-brcmfmac-Remove-array-of-functions.patch1043
-rw-r--r--package/kernel/mac80211/patches/316-v4.16-0002-brcmfmac-add-comment-block-in-brcmf_sdio_buscore_rea.patch31
-rw-r--r--package/kernel/mac80211/patches/316-v4.16-0003-brcmfmac-rename-brcmf_sdiod_buff_-read-write-functio.patch137
-rw-r--r--package/kernel/mac80211/patches/317-v4.16-0001-brcmfmac-Use-zeroing-memory-allocator-than-allocator.patch59
-rw-r--r--package/kernel/mac80211/patches/318-v4.17-mac80211-round-IEEE80211_TX_STATUS_HEADROOM-up-to-mu.patch26
-rw-r--r--package/kernel/mac80211/patches/319-v4.17-0001-mac80211-drop-frames-with-unexpected-DS-bits-from-fa.patch21
-rw-r--r--package/kernel/mac80211/patches/319-v4.17-0002-mac80211-support-AP-4-addr-mode-fast-rx.patch25
-rw-r--r--package/kernel/mac80211/patches/319-v4.17-0003-mac80211-support-fast-rx-with-incompatible-PS-capabi.patch53
-rw-r--r--package/kernel/mac80211/patches/319-v4.17-0004-mac80211-support-station-4-addr-mode-fast-rx.patch34
-rw-r--r--package/kernel/mac80211/patches/320-v4.17-mac80211-support-A-MSDU-in-fast-rx.patch256
-rw-r--r--package/kernel/mac80211/patches/321-v4.16-0001-brcmfmac-assure-bcdc-dcmd-api-does-not-return-value-.patch68
-rw-r--r--package/kernel/mac80211/patches/321-v4.16-0002-brcmfmac-separate-firmware-errors-from-i-o-errors.patch186
-rw-r--r--package/kernel/mac80211/patches/322-v4.16-0001-brcmfmac-add-possibility-to-obtain-firmware-error.patch92
-rw-r--r--package/kernel/mac80211/patches/322-v4.16-0002-brcmfmac-fix-P2P_DEVICE-ethernet-address-generation.patch64
-rw-r--r--package/kernel/mac80211/patches/323-v4.16-0001-brcmfmac-drop-Inter-Access-Point-Protocol-packets-by.patch157
-rw-r--r--package/kernel/mac80211/patches/324-v4.16-0001-brcmfmac-Fix-check-for-ISO3166-code.patch29
-rw-r--r--package/kernel/mac80211/patches/325-v4.17-0001-brcmfmac-move-brcmf_bus_preinit-call-just-after-chan.patch45
-rw-r--r--package/kernel/mac80211/patches/325-v4.17-0002-brcmfmac-move-allocation-of-control-rx-buffer-to-brc.patch69
-rw-r--r--package/kernel/mac80211/patches/325-v4.17-0003-brcmfmac-call-brcmf_attach-just-before-calling-brcmf.patch106
-rw-r--r--package/kernel/mac80211/patches/325-v4.17-0004-brcmfmac-usb-call-brcmf_usb_up-during-brcmf_bus_prei.patch41
-rw-r--r--package/kernel/mac80211/patches/325-v4.17-0005-brcmfmac-move-brcmf_attach-function-in-core.c.patch130
-rw-r--r--package/kernel/mac80211/patches/325-v4.17-0006-brcmfmac-remove-brcmf_bus_started-from-bus-api.patch190
-rw-r--r--package/kernel/mac80211/patches/325-v4.17-0007-brcmfmac-change-log-level-for-some-low-level-sdio-fu.patch64
-rw-r--r--package/kernel/mac80211/patches/325-v4.17-0008-brcmfmac-remove-duplicate-pointer-variable-from-brcm.patch126
-rw-r--r--package/kernel/mac80211/patches/326-v4.17-0001-brcmfmac-reject-too-long-PSK.patch27
-rw-r--r--package/kernel/mac80211/patches/327-v4.17-0001-brcmfmac-do-not-convert-linux-error-to-firmware-erro.patch31
-rw-r--r--package/kernel/mac80211/patches/327-v4.17-0002-brcmfmac-use-brcmf_chip_name-to-store-name-in-revinf.patch203
-rw-r--r--package/kernel/mac80211/patches/327-v4.17-0003-brcmfmac-use-brcmf_chip_name-for-consistency.patch69
-rw-r--r--package/kernel/mac80211/patches/327-v4.17-0004-brcmfmac-allocate-struct-brcmf_pub-instance-using-wi.patch452
-rw-r--r--package/kernel/mac80211/patches/327-v4.17-0005-brcmfmac-use-wiphy-debugfs-dir-entry.patch349
-rw-r--r--package/kernel/mac80211/patches/327-v4.17-0006-brcmfmac-derive-firmware-filenames-from-basename-map.patch286
-rw-r--r--package/kernel/mac80211/patches/327-v4.17-0007-brcmfmac-pass-struct-in-brcmf_fw_get_firmwares.patch574
-rw-r--r--package/kernel/mac80211/patches/327-v4.17-0008-brcmfmac-introduce-brcmf_fw_alloc_request-function.patch328
-rw-r--r--package/kernel/mac80211/patches/327-v4.17-0009-brcmfmac-add-extension-to-.get_fwname-callbacks.patch231
-rw-r--r--package/kernel/mac80211/patches/327-v4.17-0010-brcmfmac-get-rid-of-brcmf_fw_map_chip_to_name.patch92
-rw-r--r--package/kernel/mac80211/patches/327-v4.17-0011-brcmfmac-get-rid-of-brcmf_fw_get_full_name.patch44
-rw-r--r--package/kernel/mac80211/patches/327-v4.17-0012-brcmfmac-add-kerneldoc-for-struct-brcmf_bus-msgbuf.patch23
-rw-r--r--package/kernel/mac80211/patches/328-v4.17-0001-brcmfmac-fix-firmware-request-processing-if-nvram-lo.patch81
-rw-r--r--package/kernel/mac80211/patches/329-v4.18-0001-brcmfmac-add-support-for-BCM4366E-chipset.patch48
-rw-r--r--package/kernel/mac80211/patches/330-v4.18-0001-brcmfmac-check-p2pdev-mac-address-uniqueness.patch34
-rw-r--r--package/kernel/mac80211/patches/330-v4.18-0002-brcmfmac-reports-boottime_ns-while-informing-bss.patch76
-rw-r--r--package/kernel/mac80211/patches/330-v4.18-0003-brcmfmac-use-nl80211_band-directly-to-get-ieee80211-.patch43
-rw-r--r--package/kernel/mac80211/patches/330-v4.18-0004-brcmfmac-constify-firmware-mapping-tables.patch76
-rw-r--r--package/kernel/mac80211/patches/330-v4.18-0005-brcmfmac-add-hostready-indication.patch74
-rw-r--r--package/kernel/mac80211/patches/330-v4.18-0006-brcmfmac-coarse-support-for-PCIe-shared-structure-re.patch97
-rw-r--r--package/kernel/mac80211/patches/331-v4.18-0001-brcmfmac-Add-support-for-bcm43364-wireless-chipset.patch45
-rw-r--r--package/kernel/mac80211/patches/332-v4.18-0001-brcmfmac-set-WIPHY_FLAG_HAVE_AP_SME-flag.patch34
-rw-r--r--package/kernel/mac80211/patches/333-v4.18-0001-brcmfmac-fix-initialization-of-struct-cfg80211_infor.patch29
-rw-r--r--package/kernel/mac80211/patches/334-v4.18-0001-brcmfmac-add-debugfs-entry-for-reading-firmware-capa.patch75
-rw-r--r--package/kernel/mac80211/patches/335-v4.18-0001-brcmfmac-move-ALLFFMAC-variable-in-flowring-module.patch52
-rw-r--r--package/kernel/mac80211/patches/335-v4.18-0002-brcmfmac-add-support-for-sysfs-initiated-coredump.patch76
-rw-r--r--package/kernel/mac80211/patches/335-v4.18-0004-brcmfmac-validate-user-provided-data-for-memdump-bef.patch32
-rw-r--r--package/kernel/mac80211/patches/335-v4.18-0005-brcmfmac-trigger-memory-dump-upon-firmware-halt-sign.patch38
-rw-r--r--package/kernel/mac80211/patches/335-v4.18-0006-brcmfmac-trigger-memory-dump-on-SDIO-firmware-halt-m.patch30
-rw-r--r--package/kernel/mac80211/patches/336-v4.18-brcmfmac-stop-watchdog-before-detach-and-free-everyt.patch70
-rw-r--r--package/kernel/mac80211/patches/337-v4.18-brcmfmac-fix-regression-in-parsing-NVRAM-for-multipl.patch41
-rw-r--r--package/kernel/mac80211/patches/338-v4.19-0001-brcmfmac-detect-firmware-support-for-monitor-interfa.patch59
-rw-r--r--package/kernel/mac80211/patches/338-v4.19-0002-brcmfmac-detect-firmware-support-for-radiotap-monito.patch51
-rw-r--r--package/kernel/mac80211/patches/338-v4.19-0003-brcmfmac-handle-msgbuf-packets-marked-with-monitor-m.patch137
-rw-r--r--package/kernel/mac80211/patches/339-v4.19-brcmfmac-define-more-bits-for-the-flags-of-struct-br.patch60
-rw-r--r--package/kernel/mac80211/patches/340-v4.19-brcmfmac-update-STA-info-struct-to-the-v5.patch75
-rw-r--r--package/kernel/mac80211/patches/341-v4.19-brcmfmac-specify-some-features-per-firmware-version.patch84
-rw-r--r--package/kernel/mac80211/patches/367-Revert-ath10k-disable-wake_tx_queue-for-older-device.patch27
-rw-r--r--package/kernel/mac80211/patches/368-ath10k-fix-recent-bandwidth-conversion-bug.patch61
-rw-r--r--package/kernel/mac80211/patches/369-cfg80211-use-only-1Mbps-for-basic-rates-in-mesh.patch55
-rw-r--r--package/kernel/mac80211/patches/374-ath9k-Protect-queue-draining-by-rcu_read_lock.patch43
-rw-r--r--package/kernel/mac80211/patches/380-0000-ath10k-handle-tdls-peer-events.patch115
-rw-r--r--package/kernel/mac80211/patches/380-0001-ath10k-wmi-modify-svc-bitmap-parsing-for-wcn3990.patch215
-rw-r--r--package/kernel/mac80211/patches/380-0002-ath10k-advertise-TDLS-wider-bandwidth-support-for-5G.patch64
-rw-r--r--package/kernel/mac80211/patches/380-0003-ath10k-debugfs-support-to-get-final-TPC-stats-for-10.patch824
-rw-r--r--package/kernel/mac80211/patches/380-0004-ath10k-Fix-kernel-panic-while-using-worker-ath10k_st.patch99
-rw-r--r--package/kernel/mac80211/patches/380-0005-ath10k-fix-kernel-panic-while-reading-tpc_stats.patch119
-rw-r--r--package/kernel/mac80211/patches/380-0006-ath10k-add-support-to-configure-channel-dwell-time.patch92
-rw-r--r--package/kernel/mac80211/patches/380-0007-ath-add-support-to-get-the-detected-radar-specificat.patch94
-rw-r--r--package/kernel/mac80211/patches/380-0008-ath10k-DFS-Host-Confirmation.patch546
-rw-r--r--package/kernel/mac80211/patches/380-0009-ath10k-fix-memory-leak-of-tpc_stats.patch43
-rw-r--r--package/kernel/mac80211/patches/380-0010-ath10k-support-use-of-channel-173.patch52
-rw-r--r--package/kernel/mac80211/patches/380-0011-ath10k-fix-spectral-scan-for-QCA9984-and-QCA9888-chi.patch156
-rw-r--r--package/kernel/mac80211/patches/941-mwl8k-add-non-DFS-5G-upper-channels.patch37
-rw-r--r--package/kernel/mac80211/patches/960-0010-ath10k-limit-htt-rx-ring-size.patch11
-rw-r--r--package/kernel/mac80211/patches/970-rsi-fix-kbuild-reported-build-errors-with-CONFIG_PM-off93
-rw-r--r--package/kernel/mac80211/patches/971-rsi-move-rsi_sdio_reinit_device-out-of-CONFIG_PM.patch96
-rw-r--r--package/kernel/mac80211/patches/ath/070-ath_common_config.patch (renamed from package/kernel/mac80211/patches/070-ath_common_config.patch)0
-rw-r--r--package/kernel/mac80211/patches/ath/080-ath10k_thermal_config.patch55
-rw-r--r--package/kernel/mac80211/patches/ath/201-ath5k-WAR-for-AR71xx-PCI-bug.patch (renamed from package/kernel/mac80211/patches/201-ath5k-WAR-for-AR71xx-PCI-bug.patch)0
-rw-r--r--package/kernel/mac80211/patches/ath/350-ath9k_hw-reset-AHB-WMAC-interface-on-AR91xx.patch (renamed from package/kernel/mac80211/patches/350-ath9k_hw-reset-AHB-WMAC-interface-on-AR91xx.patch)0
-rw-r--r--package/kernel/mac80211/patches/ath/351-ath9k_hw-issue-external-reset-for-QCA955x.patch (renamed from package/kernel/mac80211/patches/351-ath9k_hw-issue-external-reset-for-QCA955x.patch)0
-rw-r--r--package/kernel/mac80211/patches/ath/352-ath9k_hw-set-spectral-scan-enable-bit-on-trigger-for.patch (renamed from package/kernel/mac80211/patches/352-ath9k_hw-set-spectral-scan-enable-bit-on-trigger-for.patch)0
-rw-r--r--package/kernel/mac80211/patches/ath/353-ath9k-don-t-run-periodic-and-nf-calibation-at-the-sa.patch (renamed from package/kernel/mac80211/patches/353-ath9k-don-t-run-periodic-and-nf-calibation-at-the-sa.patch)0
-rw-r--r--package/kernel/mac80211/patches/ath/354-ath9k-force-rx_clear-when-disabling-rx.patch (renamed from package/kernel/mac80211/patches/354-ath9k-force-rx_clear-when-disabling-rx.patch)0
-rw-r--r--package/kernel/mac80211/patches/ath/356-Revert-ath9k-interpret-requested-txpower-in-EIRP-dom.patch (renamed from package/kernel/mac80211/patches/356-Revert-ath9k-interpret-requested-txpower-in-EIRP-dom.patch)0
-rw-r--r--package/kernel/mac80211/patches/ath/360-ath9k-fix-moredata-bit-in-PS-buffered-frame-release.patch (renamed from package/kernel/mac80211/patches/360-ath9k-fix-moredata-bit-in-PS-buffered-frame-release.patch)0
-rw-r--r--package/kernel/mac80211/patches/ath/361-ath9k-clear-potentially-stale-EOSP-status-bit-in-int.patch (renamed from package/kernel/mac80211/patches/361-ath9k-clear-potentially-stale-EOSP-status-bit-in-int.patch)0
-rw-r--r--package/kernel/mac80211/patches/ath/362-ath9k-report-tx-status-on-EOSP.patch (renamed from package/kernel/mac80211/patches/362-ath9k-report-tx-status-on-EOSP.patch)0
-rw-r--r--package/kernel/mac80211/patches/ath/363-ath9k-fix-block-ack-window-tracking-issues.patch (renamed from package/kernel/mac80211/patches/363-ath9k-fix-block-ack-window-tracking-issues.patch)0
-rw-r--r--package/kernel/mac80211/patches/ath/364-ath9k_hw-fix-channel-maximum-power-level-test.patch (renamed from package/kernel/mac80211/patches/364-ath9k_hw-fix-channel-maximum-power-level-test.patch)0
-rw-r--r--package/kernel/mac80211/patches/ath/365-ath9k-adjust-tx-power-reduction-for-US-regulatory-do.patch (renamed from package/kernel/mac80211/patches/365-ath9k-adjust-tx-power-reduction-for-US-regulatory-do.patch)0
-rw-r--r--package/kernel/mac80211/patches/ath/366-ath9k-fix-more-data-flag-for-buffered-multicast-pack.patch (renamed from package/kernel/mac80211/patches/366-ath9k-fix-more-data-flag-for-buffered-multicast-pack.patch)0
-rw-r--r--package/kernel/mac80211/patches/ath/381-ath9k-fix-tx99-with-monitor-mode-interface.patch (renamed from package/kernel/mac80211/patches/381-ath9k-fix-tx99-with-monitor-mode-interface.patch)0
-rw-r--r--package/kernel/mac80211/patches/ath/400-ath_move_debug_code.patch (renamed from package/kernel/mac80211/patches/400-ath_move_debug_code.patch)0
-rw-r--r--package/kernel/mac80211/patches/ath/401-ath9k_blink_default.patch (renamed from package/kernel/mac80211/patches/401-ath9k_blink_default.patch)0
-rw-r--r--package/kernel/mac80211/patches/ath/402-ath_regd_optional.patch (renamed from package/kernel/mac80211/patches/402-ath_regd_optional.patch)0
-rw-r--r--package/kernel/mac80211/patches/ath/403-world_regd_fixup.patch (renamed from package/kernel/mac80211/patches/403-world_regd_fixup.patch)0
-rw-r--r--package/kernel/mac80211/patches/ath/404-regd_no_assoc_hints.patch (renamed from package/kernel/mac80211/patches/404-regd_no_assoc_hints.patch)0
-rw-r--r--package/kernel/mac80211/patches/ath/405-ath_regd_us.patch (renamed from package/kernel/mac80211/patches/405-ath_regd_us.patch)0
-rw-r--r--package/kernel/mac80211/patches/ath/406-ath_relax_default_regd.patch (renamed from package/kernel/mac80211/patches/406-ath_relax_default_regd.patch)0
-rw-r--r--package/kernel/mac80211/patches/ath/410-ath9k_allow_adhoc_and_ap.patch (renamed from package/kernel/mac80211/patches/410-ath9k_allow_adhoc_and_ap.patch)0
-rw-r--r--package/kernel/mac80211/patches/ath/411-ath5k_allow_adhoc_and_ap.patch (renamed from package/kernel/mac80211/patches/411-ath5k_allow_adhoc_and_ap.patch)0
-rw-r--r--package/kernel/mac80211/patches/ath/420-ath5k_disable_fast_cc.patch (renamed from package/kernel/mac80211/patches/420-ath5k_disable_fast_cc.patch)0
-rw-r--r--package/kernel/mac80211/patches/ath/430-add_ath5k_platform.patch (renamed from package/kernel/mac80211/patches/430-add_ath5k_platform.patch)0
-rw-r--r--package/kernel/mac80211/patches/ath/431-add_platform_eeprom_support_to_ath5k.patch (renamed from package/kernel/mac80211/patches/431-add_platform_eeprom_support_to_ath5k.patch)0
-rw-r--r--package/kernel/mac80211/patches/ath/432-ath5k_add_pciids.patch (renamed from package/kernel/mac80211/patches/432-ath5k_add_pciids.patch)0
-rw-r--r--package/kernel/mac80211/patches/ath/440-ath5k_channel_bw_debugfs.patch (renamed from package/kernel/mac80211/patches/440-ath5k_channel_bw_debugfs.patch)31
-rw-r--r--package/kernel/mac80211/patches/ath/500-ath9k_eeprom_debugfs.patch (renamed from package/kernel/mac80211/patches/500-ath9k_eeprom_debugfs.patch)0
-rw-r--r--package/kernel/mac80211/patches/ath/501-ath9k_ahb_init.patch (renamed from package/kernel/mac80211/patches/501-ath9k_ahb_init.patch)10
-rw-r--r--package/kernel/mac80211/patches/ath/510-ath9k_intr_mitigation_tweak.patch (renamed from package/kernel/mac80211/patches/510-ath9k_intr_mitigation_tweak.patch)0
-rw-r--r--package/kernel/mac80211/patches/ath/511-ath9k_reduce_rxbuf.patch (renamed from package/kernel/mac80211/patches/511-ath9k_reduce_rxbuf.patch)0
-rw-r--r--package/kernel/mac80211/patches/ath/512-ath9k_channelbw_debugfs.patch (renamed from package/kernel/mac80211/patches/512-ath9k_channelbw_debugfs.patch)0
-rw-r--r--package/kernel/mac80211/patches/ath/513-ath9k_add_pci_ids.patch (renamed from package/kernel/mac80211/patches/513-ath9k_add_pci_ids.patch)0
-rw-r--r--package/kernel/mac80211/patches/ath/530-ath9k_extra_leds.patch (renamed from package/kernel/mac80211/patches/530-ath9k_extra_leds.patch)0
-rw-r--r--package/kernel/mac80211/patches/ath/531-ath9k_extra_platform_leds.patch (renamed from package/kernel/mac80211/patches/531-ath9k_extra_platform_leds.patch)0
-rw-r--r--package/kernel/mac80211/patches/ath/540-ath9k_reduce_ani_interval.patch (renamed from package/kernel/mac80211/patches/540-ath9k_reduce_ani_interval.patch)0
-rw-r--r--package/kernel/mac80211/patches/ath/542-ath9k_debugfs_diag.patch (renamed from package/kernel/mac80211/patches/542-ath9k_debugfs_diag.patch)0
-rw-r--r--package/kernel/mac80211/patches/ath/543-ath9k_entropy_from_adc.patch (renamed from package/kernel/mac80211/patches/543-ath9k_entropy_from_adc.patch)0
-rw-r--r--package/kernel/mac80211/patches/ath/544-ath9k-ar933x-usb-hang-workaround.patch (renamed from package/kernel/mac80211/patches/544-ath9k-ar933x-usb-hang-workaround.patch)0
-rw-r--r--package/kernel/mac80211/patches/ath/545-ath9k_ani_ws_detect.patch (renamed from package/kernel/mac80211/patches/545-ath9k_ani_ws_detect.patch)0
-rw-r--r--package/kernel/mac80211/patches/ath/547-ath9k_led_defstate_fix.patch (renamed from package/kernel/mac80211/patches/547-ath9k_led_defstate_fix.patch)0
-rw-r--r--package/kernel/mac80211/patches/ath/548-ath9k_enable_gpio_chip.patch (renamed from package/kernel/mac80211/patches/548-ath9k_enable_gpio_chip.patch)0
-rw-r--r--package/kernel/mac80211/patches/ath/549-ath9k_enable_gpio_buttons.patch (renamed from package/kernel/mac80211/patches/549-ath9k_enable_gpio_buttons.patch)0
-rw-r--r--package/kernel/mac80211/patches/ath/550-ath9k-disable-bands-via-dt.patch (renamed from package/kernel/mac80211/patches/550-ath9k-disable-bands-via-dt.patch)0
-rw-r--r--package/kernel/mac80211/patches/ath/551-ath9k_ubnt_uap_plus_hsr.patch (renamed from package/kernel/mac80211/patches/551-ath9k_ubnt_uap_plus_hsr.patch)0
-rw-r--r--package/kernel/mac80211/patches/ath/552-ahb_of.patch (renamed from package/kernel/mac80211/patches/552-ahb_of.patch)0
-rw-r--r--package/kernel/mac80211/patches/ath/921-ath10k_init_devices_synchronously.patch (renamed from package/kernel/mac80211/patches/921-ath10k_init_devices_synchronously.patch)0
-rw-r--r--package/kernel/mac80211/patches/ath/930-ath10k_add_tpt_led_trigger.patch (renamed from package/kernel/mac80211/patches/930-ath10k_add_tpt_led_trigger.patch)0
-rw-r--r--package/kernel/mac80211/patches/ath/936-ath10k-fix-otp-failure-result.patch (renamed from package/kernel/mac80211/patches/936-ath10k-fix-otp-failure-result.patch)0
-rw-r--r--package/kernel/mac80211/patches/ath/960-0010-ath10k-limit-htt-rx-ring-size.patch13
-rw-r--r--package/kernel/mac80211/patches/ath/960-0011-ath10k-limit-pci-buffer-size.patch (renamed from package/kernel/mac80211/patches/960-0011-ath10k-limit-pci-buffer-size.patch)0
-rw-r--r--package/kernel/mac80211/patches/ath/972-ath10k_fix-crash-due-to-wrong-handling-of-peer_bw_rxnss_override-parameter.patch (renamed from package/kernel/mac80211/patches/972-ath10k_fix-crash-due-to-wrong-handling-of-peer_bw_rxnss_override-parameter.patch)0
-rw-r--r--package/kernel/mac80211/patches/ath/973-ath10k_fix-band_center_freq-handling-for-VHT160-in-recent-firmwares.patch (renamed from package/kernel/mac80211/patches/973-ath10k_fix-band_center_freq-handling-for-VHT160-in-recent-firmwares.patch)0
-rw-r--r--package/kernel/mac80211/patches/ath/974-ath10k_add-LED-and-GPIO-controlling-support-for-various-chipsets.patch (renamed from package/kernel/mac80211/patches/974-ath10k_add-LED-and-GPIO-controlling-support-for-various-chipsets.patch)132
-rw-r--r--package/kernel/mac80211/patches/ath/975-ath10k-use-tpt-trigger-by-default.patch (renamed from package/kernel/mac80211/patches/975-ath10k-use-tpt-trigger-by-default.patch)0
-rw-r--r--package/kernel/mac80211/patches/ath/976-ath10k-Limit-available-channels-via-DT-ieee80211-fre.patch (renamed from package/kernel/mac80211/patches/976-ath10k-Limit-available-channels-via-DT-ieee80211-fre.patch)0
-rw-r--r--package/kernel/mac80211/patches/brcm/040-brcmutil_option.patch (renamed from package/kernel/mac80211/patches/040-brcmutil_option.patch)0
-rw-r--r--package/kernel/mac80211/patches/brcm/810-b43-gpio-mask-module-option.patch (renamed from package/kernel/mac80211/patches/810-b43-gpio-mask-module-option.patch)0
-rw-r--r--package/kernel/mac80211/patches/brcm/811-b43_no_pio.patch (renamed from package/kernel/mac80211/patches/811-b43_no_pio.patch)0
-rw-r--r--package/kernel/mac80211/patches/brcm/812-b43-add-antenna-control.patch (renamed from package/kernel/mac80211/patches/812-b43-add-antenna-control.patch)0
-rw-r--r--package/kernel/mac80211/patches/brcm/813-b43-reduce-number-of-RX-slots.patch (renamed from package/kernel/mac80211/patches/813-b43-reduce-number-of-RX-slots.patch)0
-rw-r--r--package/kernel/mac80211/patches/brcm/814-b43-only-use-gpio-0-1-for-led.patch (renamed from package/kernel/mac80211/patches/814-b43-only-use-gpio-0-1-for-led.patch)0
-rw-r--r--package/kernel/mac80211/patches/brcm/815-b43-always-take-overlapping-devs.patch (renamed from package/kernel/mac80211/patches/815-b43-always-take-overlapping-devs.patch)0
-rw-r--r--package/kernel/mac80211/patches/brcm/850-brcmsmac-remove-extra-regulation-restriction.patch (renamed from package/kernel/mac80211/patches/850-brcmsmac-remove-extra-regulation-restriction.patch)0
-rw-r--r--package/kernel/mac80211/patches/brcm/860-brcmfmac-register-wiphy-s-during-module_init.patch (renamed from package/kernel/mac80211/patches/860-brcmfmac-register-wiphy-s-during-module_init.patch)0
-rw-r--r--package/kernel/mac80211/patches/brcm/861-brcmfmac-workaround-bug-with-some-inconsistent-BSSes.patch (renamed from package/kernel/mac80211/patches/861-brcmfmac-workaround-bug-with-some-inconsistent-BSSes.patch)0
-rw-r--r--package/kernel/mac80211/patches/brcm/862-brcmfmac-Disable-power-management.patch (renamed from package/kernel/mac80211/patches/862-brcmfmac-Disable-power-management.patch)0
-rw-r--r--package/kernel/mac80211/patches/brcm/863-brcmfmac-add-in-driver-tables-with-country-codes.patch (renamed from package/kernel/mac80211/patches/863-brcmfmac-add-in-driver-tables-with-country-codes.patch)0
-rw-r--r--package/kernel/mac80211/patches/brcm/864-brcmfmac-do-not-use-internal-roaming-engine-by-default.patch (renamed from package/kernel/mac80211/patches/864-brcmfmac-do-not-use-internal-roaming-engine-by-default.patch)8
-rw-r--r--package/kernel/mac80211/patches/build/000-fix_kconfig.patch (renamed from package/kernel/mac80211/patches/000-fix_kconfig.patch)0
-rw-r--r--package/kernel/mac80211/patches/build/001-fix_build.patch (renamed from package/kernel/mac80211/patches/001-fix_build.patch)0
-rw-r--r--package/kernel/mac80211/patches/build/002-change_allconfig.patch (renamed from package/kernel/mac80211/patches/002-change_allconfig.patch)0
-rw-r--r--package/kernel/mac80211/patches/build/003-remove_bogus_modparams.patch (renamed from package/kernel/mac80211/patches/003-remove_bogus_modparams.patch)0
-rw-r--r--package/kernel/mac80211/patches/build/004-kconfig_backport_fix.patch (renamed from package/kernel/mac80211/patches/004-kconfig_backport_fix.patch)0
-rw-r--r--package/kernel/mac80211/patches/build/005-revert-devcoredump.patch (renamed from package/kernel/mac80211/patches/005-revert-devcoredump.patch)8
-rw-r--r--package/kernel/mac80211/patches/build/006-fix-genl-multicast.patch (renamed from package/kernel/mac80211/patches/006-fix-genl-multicast.patch)0
-rw-r--r--package/kernel/mac80211/patches/build/010-disable_rfkill.patch (renamed from package/kernel/mac80211/patches/010-disable_rfkill.patch)0
-rw-r--r--package/kernel/mac80211/patches/build/012-kernel_build_check.patch (renamed from package/kernel/mac80211/patches/012-kernel_build_check.patch)0
-rw-r--r--package/kernel/mac80211/patches/build/050-lib80211_option.patch (renamed from package/kernel/mac80211/patches/050-lib80211_option.patch)0
-rw-r--r--package/kernel/mac80211/patches/build/060-no_local_ssb_bcma.patch (renamed from package/kernel/mac80211/patches/060-no_local_ssb_bcma.patch)0
-rw-r--r--package/kernel/mac80211/patches/mwl/700-mwl8k-missing-pci-id-for-WNR854T.patch (renamed from package/kernel/mac80211/patches/700-mwl8k-missing-pci-id-for-WNR854T.patch)0
-rw-r--r--package/kernel/mac80211/patches/mwl/801-libertas-configure-sysfs-links.patch (renamed from package/kernel/mac80211/patches/801-libertas-configure-sysfs-links.patch)0
-rw-r--r--package/kernel/mac80211/patches/mwl/802-libertas-set-wireless-macaddr.patch (renamed from package/kernel/mac80211/patches/802-libertas-set-wireless-macaddr.patch)0
-rw-r--r--package/kernel/mac80211/patches/mwl/940-mwl8k_init_devices_synchronously.patch (renamed from package/kernel/mac80211/patches/940-mwl8k_init_devices_synchronously.patch)0
-rw-r--r--package/kernel/mac80211/patches/rt2x00/030-rt2x00_options.patch (renamed from package/kernel/mac80211/patches/030-rt2x00_options.patch)0
-rw-r--r--package/kernel/mac80211/patches/rt2x00/600-01-rt2x00-allow-to-build-rt2800soc-module-for-RT3883.patch (renamed from package/kernel/mac80211/patches/600-01-rt2x00-allow-to-build-rt2800soc-module-for-RT3883.patch)0
-rw-r--r--package/kernel/mac80211/patches/rt2x00/600-02-rt2x00-rt2800lib-enable-support-for-RT3883.patch (renamed from package/kernel/mac80211/patches/600-02-rt2x00-rt2800lib-enable-support-for-RT3883.patch)0
-rw-r--r--package/kernel/mac80211/patches/rt2x00/600-03-rt2x00-rt2800lib-add-rf_vals-for-RF3853.patch (renamed from package/kernel/mac80211/patches/600-03-rt2x00-rt2800lib-add-rf_vals-for-RF3853.patch)0
-rw-r--r--package/kernel/mac80211/patches/rt2x00/600-04-rt2x00-rt2800lib-enable-VCO-calibration-for-RF3853.patch (renamed from package/kernel/mac80211/patches/600-04-rt2x00-rt2800lib-enable-VCO-calibration-for-RF3853.patch)0
-rw-r--r--package/kernel/mac80211/patches/rt2x00/600-05-rt2x00-rt2800lib-add-channel-configuration-function-.patch (renamed from package/kernel/mac80211/patches/600-05-rt2x00-rt2800lib-add-channel-configuration-function-.patch)0
-rw-r--r--package/kernel/mac80211/patches/rt2x00/600-06-rt2x00-rt2800lib-enable-RF3853-support.patch (renamed from package/kernel/mac80211/patches/600-06-rt2x00-rt2800lib-enable-RF3853-support.patch)0
-rw-r--r--package/kernel/mac80211/patches/rt2x00/600-07-rt2x00-rt2800lib-add-MAC-register-initialization-for.patch (renamed from package/kernel/mac80211/patches/600-07-rt2x00-rt2800lib-add-MAC-register-initialization-for.patch)0
-rw-r--r--package/kernel/mac80211/patches/rt2x00/600-08-rt2x00-rt2800soc-fix-rt2800soc_disable_radio-for-RT3.patch (renamed from package/kernel/mac80211/patches/600-08-rt2x00-rt2800soc-fix-rt2800soc_disable_radio-for-RT3.patch)0
-rw-r--r--package/kernel/mac80211/patches/rt2x00/600-09-rt2x00-rt2800lib-add-BBP-register-initialization-for.patch (renamed from package/kernel/mac80211/patches/600-09-rt2x00-rt2800lib-add-BBP-register-initialization-for.patch)0
-rw-r--r--package/kernel/mac80211/patches/rt2x00/600-10-rt2x00-rt2800lib-add-RFCSR-initialization-for-RT3883.patch (renamed from package/kernel/mac80211/patches/600-10-rt2x00-rt2800lib-add-RFCSR-initialization-for-RT3883.patch)0
-rw-r--r--package/kernel/mac80211/patches/rt2x00/600-11-rt2x00-rt2800lib-use-the-extended-EEPROM-map-for-RT3.patch (renamed from package/kernel/mac80211/patches/600-11-rt2x00-rt2800lib-use-the-extended-EEPROM-map-for-RT3.patch)0
-rw-r--r--package/kernel/mac80211/patches/rt2x00/600-12-rt2x00-rt2800lib-force-rf-type-to-RF3853-on-RT3883.patch (renamed from package/kernel/mac80211/patches/600-12-rt2x00-rt2800lib-force-rf-type-to-RF3853-on-RT3883.patch)0
-rw-r--r--package/kernel/mac80211/patches/rt2x00/600-13-rt2x00-rt2800lib-add-channel-configuration-code-for-.patch (renamed from package/kernel/mac80211/patches/600-13-rt2x00-rt2800lib-add-channel-configuration-code-for-.patch)0
-rw-r--r--package/kernel/mac80211/patches/rt2x00/600-14-rt2x00-rt2800lib-fix-txpower_to_dev-function-for-RT3.patch (renamed from package/kernel/mac80211/patches/600-14-rt2x00-rt2800lib-fix-txpower_to_dev-function-for-RT3.patch)0
-rw-r--r--package/kernel/mac80211/patches/rt2x00/600-15-rt2x00-rt2800lib-use-correct-txpower-calculation-fun.patch (renamed from package/kernel/mac80211/patches/600-15-rt2x00-rt2800lib-use-correct-txpower-calculation-fun.patch)0
-rw-r--r--package/kernel/mac80211/patches/rt2x00/600-16-rt2x00-rt2800lib-hardcode-txmixer-gain-values-to-zer.patch (renamed from package/kernel/mac80211/patches/600-16-rt2x00-rt2800lib-hardcode-txmixer-gain-values-to-zer.patch)0
-rw-r--r--package/kernel/mac80211/patches/rt2x00/600-17-rt2x00-rt2800lib-use-correct-RT-XWI-size-for-RT3883.patch (renamed from package/kernel/mac80211/patches/600-17-rt2x00-rt2800lib-use-correct-RT-XWI-size-for-RT3883.patch)0
-rw-r--r--package/kernel/mac80211/patches/rt2x00/600-18-rt2x00-rt2800lib-fix-antenna-configuration-for-RT388.patch (renamed from package/kernel/mac80211/patches/600-18-rt2x00-rt2800lib-fix-antenna-configuration-for-RT388.patch)0
-rw-r--r--package/kernel/mac80211/patches/rt2x00/600-19-rt2x00-rt2800lib-fix-LNA-gain-configuration-for-RT38.patch (renamed from package/kernel/mac80211/patches/600-19-rt2x00-rt2800lib-fix-LNA-gain-configuration-for-RT38.patch)0
-rw-r--r--package/kernel/mac80211/patches/rt2x00/600-20-rt2x00-rt2800lib-fix-VGC-setup-for-RT3883.patch (renamed from package/kernel/mac80211/patches/600-20-rt2x00-rt2800lib-fix-VGC-setup-for-RT3883.patch)0
-rw-r--r--package/kernel/mac80211/patches/rt2x00/600-21-rt2x00-rt2800lib-fix-EEPROM-LNA-validation-for-RT388.patch (renamed from package/kernel/mac80211/patches/600-21-rt2x00-rt2800lib-fix-EEPROM-LNA-validation-for-RT388.patch)0
-rw-r--r--package/kernel/mac80211/patches/rt2x00/600-22-rt2x00-rt2800lib-fix-txpower-compensation-for-RT3883.patch (renamed from package/kernel/mac80211/patches/600-22-rt2x00-rt2800lib-fix-txpower-compensation-for-RT3883.patch)0
-rw-r--r--package/kernel/mac80211/patches/rt2x00/600-23-rt2x00-rt2800mmio-add-a-workaround-for-spurious-TX_F.patch (renamed from package/kernel/mac80211/patches/600-23-rt2x00-rt2800mmio-add-a-workaround-for-spurious-TX_F.patch)0
-rw-r--r--package/kernel/mac80211/patches/rt2x00/601-rt2x00-introduce-rt2x00_platform_h.patch (renamed from package/kernel/mac80211/patches/601-rt2x00-introduce-rt2x00_platform_h.patch)0
-rw-r--r--package/kernel/mac80211/patches/rt2x00/602-rt2x00-introduce-rt2x00eeprom.patch (renamed from package/kernel/mac80211/patches/602-rt2x00-introduce-rt2x00eeprom.patch)0
-rw-r--r--package/kernel/mac80211/patches/rt2x00/603-rt2x00-of_load_eeprom_filename.patch (renamed from package/kernel/mac80211/patches/603-rt2x00-of_load_eeprom_filename.patch)0
-rw-r--r--package/kernel/mac80211/patches/rt2x00/604-rt2x00-load-eeprom-on-SoC-from-a-mtd-device-defines-.patch (renamed from package/kernel/mac80211/patches/604-rt2x00-load-eeprom-on-SoC-from-a-mtd-device-defines-.patch)0
-rw-r--r--package/kernel/mac80211/patches/rt2x00/606-rt2x00-allow_disabling_bands_through_platform_data.patch (renamed from package/kernel/mac80211/patches/606-rt2x00-allow_disabling_bands_through_platform_data.patch)0
-rw-r--r--package/kernel/mac80211/patches/rt2x00/607-rt2x00-add_platform_data_mac_addr.patch (renamed from package/kernel/mac80211/patches/607-rt2x00-add_platform_data_mac_addr.patch)0
-rw-r--r--package/kernel/mac80211/patches/rt2x00/608-rt2x00-allow_disabling_bands_through_dts.patch (renamed from package/kernel/mac80211/patches/608-rt2x00-allow_disabling_bands_through_dts.patch)0
-rw-r--r--package/kernel/mac80211/patches/rt2x00/609-rt2x00-make-wmac-loadable-via-OF-on-rt288x-305x-SoC.patch (renamed from package/kernel/mac80211/patches/609-rt2x00-make-wmac-loadable-via-OF-on-rt288x-305x-SoC.patch)0
-rw-r--r--package/kernel/mac80211/patches/rt2x00/610-rt2x00-change-led-polarity-from-OF.patch (renamed from package/kernel/mac80211/patches/610-rt2x00-change-led-polarity-from-OF.patch)0
-rw-r--r--package/kernel/mac80211/patches/rt2x00/611-rt2x00-add-AP+STA-support.patch (renamed from package/kernel/mac80211/patches/611-rt2x00-add-AP+STA-support.patch)0
-rw-r--r--package/kernel/mac80211/patches/rt2x00/650-rt2x00-add-support-for-external-PA-on-MT7620.patch (renamed from package/kernel/mac80211/patches/650-rt2x00-add-support-for-external-PA-on-MT7620.patch)0
-rw-r--r--package/kernel/mac80211/patches/rt2x00/651-rt2x00-remove-unneccesary-code.patch (renamed from package/kernel/mac80211/patches/651-rt2x00-remove-unneccesary-code.patch)0
-rw-r--r--package/kernel/mac80211/patches/subsys/100-remove-cryptoapi-dependencies.patch (renamed from package/kernel/mac80211/patches/100-remove-cryptoapi-dependencies.patch)0
-rw-r--r--package/kernel/mac80211/patches/subsys/110-mac80211_keep_keys_on_stop_ap.patch (renamed from package/kernel/mac80211/patches/110-mac80211_keep_keys_on_stop_ap.patch)0
-rw-r--r--package/kernel/mac80211/patches/subsys/120-cfg80211_allow_perm_addr_change.patch (renamed from package/kernel/mac80211/patches/120-cfg80211_allow_perm_addr_change.patch)0
-rw-r--r--package/kernel/mac80211/patches/subsys/130-disable-fils.patch (renamed from package/kernel/mac80211/patches/130-disable-fils.patch)0
-rw-r--r--package/kernel/mac80211/patches/subsys/131-Revert-mac80211-aes-cmac-switch-to-shash-CMAC-driver.patch (renamed from package/kernel/mac80211/patches/131-Revert-mac80211-aes-cmac-switch-to-shash-CMAC-driver.patch)0
-rw-r--r--package/kernel/mac80211/patches/subsys/132-mac80211-remove-cmac-dependency.patch (renamed from package/kernel/mac80211/patches/132-mac80211-remove-cmac-dependency.patch)0
-rw-r--r--package/kernel/mac80211/patches/subsys/140-tweak-TSQ-setting.patch (renamed from package/kernel/mac80211/patches/140-tweak-TSQ-setting.patch)0
-rw-r--r--package/kernel/mac80211/patches/subsys/150-disable_addr_notifier.patch (renamed from package/kernel/mac80211/patches/150-disable_addr_notifier.patch)0
-rw-r--r--package/kernel/mac80211/patches/subsys/210-ap_scan.patch (renamed from package/kernel/mac80211/patches/210-ap_scan.patch)0
-rw-r--r--package/kernel/mac80211/patches/subsys/357-mac80211-add-hdrlen-to-ieee80211_tx_data.patch (renamed from package/kernel/mac80211/patches/357-mac80211-add-hdrlen-to-ieee80211_tx_data.patch)0
-rw-r--r--package/kernel/mac80211/patches/subsys/358-mac80211-add-NEED_ALIGNED4_SKBS-hw-flag.patch (renamed from package/kernel/mac80211/patches/358-mac80211-add-NEED_ALIGNED4_SKBS-hw-flag.patch)92
-rw-r--r--package/kernel/mac80211/patches/subsys/359-mac80211-minstrel-Enable-STBC-and-LDPC-for-VHT-Rates.patch (renamed from package/kernel/mac80211/patches/359-mac80211-minstrel-Enable-STBC-and-LDPC-for-VHT-Rates.patch)0
-rw-r--r--package/kernel/mac80211/patches/subsys/370-mac80211-minstrel-remove-unnecessary-debugfs-cleanup.patch (renamed from package/kernel/mac80211/patches/370-mac80211-minstrel-remove-unnecessary-debugfs-cleanup.patch)54
-rw-r--r--package/kernel/mac80211/patches/subsys/371-mac80211-minstrel-merge-with-minstrel_ht-always-enab.patch (renamed from package/kernel/mac80211/patches/371-mac80211-minstrel-merge-with-minstrel_ht-always-enab.patch)70
-rw-r--r--package/kernel/mac80211/patches/subsys/372-mac80211-minstrel-reduce-minstrel_mcs_groups-size.patch (renamed from package/kernel/mac80211/patches/372-mac80211-minstrel-reduce-minstrel_mcs_groups-size.patch)0
-rw-r--r--package/kernel/mac80211/patches/subsys/373-mac80211-minstrel-fix-using-short-preamble-CCK-rates.patch (renamed from package/kernel/mac80211/patches/373-mac80211-minstrel-fix-using-short-preamble-CCK-rates.patch)6
-rw-r--r--package/kernel/mac80211/patches/subsys/375-mac80211-minstrel-fix-CCK-rate-group-streams-value.patch (renamed from package/kernel/mac80211/patches/375-mac80211-minstrel-fix-CCK-rate-group-streams-value.patch)0
-rw-r--r--package/kernel/mac80211/patches/subsys/376-mac80211-minstrel-fix-sampling-reporting-of-CCK-rate.patch (renamed from package/kernel/mac80211/patches/376-mac80211-minstrel-fix-sampling-reporting-of-CCK-rate.patch)0
-rw-r--r--package/kernel/mac80211/patches/subsys/377-mac80211-minstrel-do-not-sample-rates-3-times-slower.patch (renamed from package/kernel/mac80211/patches/377-mac80211-minstrel-do-not-sample-rates-3-times-slower.patch)0
-rw-r--r--package/kernel/mac80211/patches/subsys/378-mac80211-fix-memory-accounting-with-A-MSDU-aggregati.patch (renamed from package/kernel/mac80211/patches/378-mac80211-fix-memory-accounting-with-A-MSDU-aggregati.patch)0
-rw-r--r--package/kernel/mac80211/patches/subsys/379-cfg80211-initialize-sinfo-in-cfg80211_get_station.patch (renamed from package/kernel/mac80211/patches/379-cfg80211-initialize-sinfo-in-cfg80211_get_station.patch)0
-rw-r--r--package/kernel/mac80211/patches/subsys/522-mac80211_configure_antenna_gain.patch (renamed from package/kernel/mac80211/patches/522-mac80211_configure_antenna_gain.patch)78
283 files changed, 364 insertions, 15964 deletions
diff --git a/package/kernel/mac80211/patches/007-fix-linux-verification-h.patch b/package/kernel/mac80211/patches/007-fix-linux-verification-h.patch
deleted file mode 100644
index 4011f1d3ba..0000000000
--- a/package/kernel/mac80211/patches/007-fix-linux-verification-h.patch
+++ /dev/null
@@ -1,11 +0,0 @@
---- a/backport-include/linux/verification.h
-+++ b/backport-include/linux/verification.h
-@@ -1,7 +1,7 @@
- #ifndef __BP_VERIFICATION_H
- #define __BP_VERIFICATION_H
- #include <linux/version.h>
--#ifndef CPTCFG_BPAUTO_BUILD_SYSTEM_DATA_VERIFICATION
-+#if LINUX_VERSION_IS_GEQ(4,7,0) && !defined(CPTCFG_BPAUTO_BUILD_SYSTEM_DATA_VERIFICATION)
- #include_next <linux/verification.h>
- #else
- #include <linux/key.h>
diff --git a/package/kernel/mac80211/patches/008-fix-genl-family-id.patch b/package/kernel/mac80211/patches/008-fix-genl-family-id.patch
deleted file mode 100644
index ee8fa6c2bc..0000000000
--- a/package/kernel/mac80211/patches/008-fix-genl-family-id.patch
+++ /dev/null
@@ -1,10 +0,0 @@
---- a/compat/backport-4.12.c
-+++ b/compat/backport-4.12.c
-@@ -224,6 +224,7 @@ int bp_extack_genl_register_family(struc
- }
-
- /* copy this since the family might access it directly */
-+ family->id = copy->family.id;
- family->attrbuf = copy->family.attrbuf;
- family->mcgrp_offset = copy->family.mcgrp_offset;
-
diff --git a/package/kernel/mac80211/patches/015-ipw200-mtu.patch b/package/kernel/mac80211/patches/015-ipw200-mtu.patch
deleted file mode 100644
index 8d273a095b..0000000000
--- a/package/kernel/mac80211/patches/015-ipw200-mtu.patch
+++ /dev/null
@@ -1,34 +0,0 @@
---- a/drivers/net/wireless/intel/ipw2x00/ipw2200.c
-+++ b/drivers/net/wireless/intel/ipw2x00/ipw2200.c
-@@ -11506,6 +11506,15 @@ static const struct attribute_group ipw_
- .attrs = ipw_sysfs_entries,
- };
-
-+#if LINUX_VERSION_IS_LESS(4,10,0)
-+static int __change_mtu(struct net_device *ndev, int new_mtu){
-+ if (new_mtu < 68 || new_mtu > LIBIPW_DATA_LEN)
-+ return -EINVAL;
-+ ndev->mtu = new_mtu;
-+ return 0;
-+}
-+#endif
-+
- #ifdef CPTCFG_IPW2200_PROMISCUOUS
- static int ipw_prom_open(struct net_device *dev)
- {
-@@ -11554,15 +11563,6 @@ static netdev_tx_t ipw_prom_hard_start_x
- return NETDEV_TX_OK;
- }
-
--#if LINUX_VERSION_IS_LESS(4,10,0)
--static int __change_mtu(struct net_device *ndev, int new_mtu){
-- if (new_mtu < 68 || new_mtu > LIBIPW_DATA_LEN)
-- return -EINVAL;
-- ndev->mtu = new_mtu;
-- return 0;
--}
--#endif
--
- static const struct net_device_ops ipw_prom_netdev_ops = {
- #if LINUX_VERSION_IS_LESS(4,10,0)
- .ndo_change_mtu = __change_mtu,
diff --git a/package/kernel/mac80211/patches/080-ath10k_thermal_config.patch b/package/kernel/mac80211/patches/080-ath10k_thermal_config.patch
deleted file mode 100644
index adcd788bd3..0000000000
--- a/package/kernel/mac80211/patches/080-ath10k_thermal_config.patch
+++ /dev/null
@@ -1,47 +0,0 @@
---- a/drivers/net/wireless/ath/ath10k/Kconfig
-+++ b/drivers/net/wireless/ath/ath10k/Kconfig
-@@ -65,6 +65,12 @@ config ATH10K_TRACING
- ---help---
- Select this to ath10k use tracing infrastructure.
-
-+config ATH10K_THERMAL
-+ bool "Atheros ath10k thermal monitoring support"
-+ depends on THERMAL
-+ ---help---
-+ Select this to ath10k use hwmon for thermal measurement.
-+
- config ATH10K_DFS_CERTIFIED
- bool "Atheros DFS support for certified platforms"
- depends on ATH10K && CFG80211_CERTIFICATION_ONUS
---- a/drivers/net/wireless/ath/ath10k/Makefile
-+++ b/drivers/net/wireless/ath/ath10k/Makefile
-@@ -17,7 +17,7 @@ ath10k_core-y += mac.o \
- ath10k_core-$(CPTCFG_ATH10K_DEBUGFS) += spectral.o
- ath10k_core-$(CPTCFG_NL80211_TESTMODE) += testmode.o
- ath10k_core-$(CPTCFG_ATH10K_TRACING) += trace.o
--ath10k_core-$(CONFIG_THERMAL) += thermal.o
-+ath10k_core-$(CPTCFG_ATH10K_THERMAL) += thermal.o
- ath10k_core-$(CPTCFG_MAC80211_DEBUGFS) += debugfs_sta.o
- ath10k_core-$(CONFIG_PM) += wow.o
-
---- a/drivers/net/wireless/ath/ath10k/thermal.h
-+++ b/drivers/net/wireless/ath/ath10k/thermal.h
-@@ -36,7 +36,7 @@ struct ath10k_thermal {
- int temperature;
- };
-
--#if IS_REACHABLE(CONFIG_THERMAL)
-+#if IS_REACHABLE(CPTCFG_ATH10K_THERMAL)
- int ath10k_thermal_register(struct ath10k *ar);
- void ath10k_thermal_unregister(struct ath10k *ar);
- void ath10k_thermal_event_temperature(struct ath10k *ar, int temperature);
---- a/local-symbols
-+++ b/local-symbols
-@@ -139,6 +139,7 @@ ATH10K_SDIO=
- ATH10K_USB=
- ATH10K_DEBUG=
- ATH10K_DEBUGFS=
-+ATH10K_THERMAL=
- ATH10K_TRACING=
- ATH10K_DFS_CERTIFIED=
- WCN36XX=
diff --git a/package/kernel/mac80211/patches/081-ath10k-calibration-variant.patch b/package/kernel/mac80211/patches/081-ath10k-calibration-variant.patch
deleted file mode 100644
index 2724027866..0000000000
--- a/package/kernel/mac80211/patches/081-ath10k-calibration-variant.patch
+++ /dev/null
@@ -1,111 +0,0 @@
-From d06f26c5c8a41f246a9c40862a77a55725cedbd3 Mon Sep 17 00:00:00 2001
-From: Sven Eckelmann <sven.eckelmann@openmesh.com>
-Date: Fri, 8 Dec 2017 11:37:42 +0100
-Subject: ath10k: search DT for qcom,ath10k-calibration-variant
-
-Board Data File (BDF) is loaded upon driver boot-up procedure. The right
-board data file is identified on QCA4019 using bus, bmi-chip-id and
-bmi-board-id.
-
-The problem, however, can occur when the (default) board data file cannot
-fulfill with the vendor requirements and it is necessary to use a different
-board data file.
-
-This problem was solved for SMBIOS by adding a special SMBIOS type 0xF8.
-Something similar has to be provided for systems without SMBIOS but with
-device trees. No solution was specified by QCA and therefore a new one has
-to be found for ath10k.
-
-The device tree requires addition strings to define the variant name
-
- wifi@a000000 {
- status = "okay";
- qcom,ath10k-calibration-variant = "RT-AC58U";
- };
-
- wifi@a800000 {
- status = "okay";
- qcom,ath10k-calibration-variant = "RT-AC58U";
- };
-
-This would create the boarddata identifiers for the board-2.bin search
-
- * bus=ahb,bmi-chip-id=0,bmi-board-id=16,variant=RT-AC58U
- * bus=ahb,bmi-chip-id=0,bmi-board-id=17,variant=RT-AC58U
-
-Signed-off-by: Sven Eckelmann <sven.eckelmann@openmesh.com>
-Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
----
- drivers/net/wireless/ath/ath10k/core.c | 40 ++++++++++++++++++++++++++++------
- 1 file changed, 33 insertions(+), 7 deletions(-)
-
---- a/drivers/net/wireless/ath/ath10k/core.c
-+++ b/drivers/net/wireless/ath/ath10k/core.c
-@@ -860,6 +860,28 @@ static int ath10k_core_check_smbios(stru
- return 0;
- }
-
-+static int ath10k_core_check_dt(struct ath10k *ar)
-+{
-+ struct device_node *node;
-+ const char *variant = NULL;
-+
-+ node = ar->dev->of_node;
-+ if (!node)
-+ return -ENOENT;
-+
-+ of_property_read_string(node, "qcom,ath10k-calibration-variant",
-+ &variant);
-+ if (!variant)
-+ return -ENODATA;
-+
-+ if (strscpy(ar->id.bdf_ext, variant, sizeof(ar->id.bdf_ext)) < 0)
-+ ath10k_dbg(ar, ATH10K_DBG_BOOT,
-+ "bdf variant string is longer than the buffer can accommodate (variant: %s)\n",
-+ variant);
-+
-+ return 0;
-+}
-+
- static int ath10k_download_and_run_otp(struct ath10k *ar)
- {
- u32 result, address = ar->hw_params.patch_load_addr;
-@@ -1231,19 +1253,19 @@ static int ath10k_core_create_board_name
- /* strlen(',variant=') + strlen(ar->id.bdf_ext) */
- char variant[9 + ATH10K_SMBIOS_BDF_EXT_STR_LENGTH] = { 0 };
-
-+ if (ar->id.bdf_ext[0] != '\0')
-+ scnprintf(variant, sizeof(variant), ",variant=%s",
-+ ar->id.bdf_ext);
-+
- if (ar->id.bmi_ids_valid) {
- scnprintf(name, name_len,
-- "bus=%s,bmi-chip-id=%d,bmi-board-id=%d",
-+ "bus=%s,bmi-chip-id=%d,bmi-board-id=%d%s",
- ath10k_bus_str(ar->hif.bus),
- ar->id.bmi_chip_id,
-- ar->id.bmi_board_id);
-+ ar->id.bmi_board_id, variant);
- goto out;
- }
-
-- if (ar->id.bdf_ext[0] != '\0')
-- scnprintf(variant, sizeof(variant), ",variant=%s",
-- ar->id.bdf_ext);
--
- scnprintf(name, name_len,
- "bus=%s,vendor=%04x,device=%04x,subsystem-vendor=%04x,subsystem-device=%04x%s",
- ath10k_bus_str(ar->hif.bus),
-@@ -2343,7 +2365,11 @@ static int ath10k_core_probe_fw(struct a
-
- ret = ath10k_core_check_smbios(ar);
- if (ret)
-- ath10k_dbg(ar, ATH10K_DBG_BOOT, "bdf variant name not set.\n");
-+ ath10k_dbg(ar, ATH10K_DBG_BOOT, "SMBIOS bdf variant name not set.\n");
-+
-+ ret = ath10k_core_check_dt(ar);
-+ if (ret)
-+ ath10k_dbg(ar, ATH10K_DBG_BOOT, "DT bdf variant name not set.\n");
-
- ret = ath10k_core_fetch_board_file(ar);
- if (ret) {
diff --git a/package/kernel/mac80211/patches/082-ath10k-suppress-Unknown-eventid-36925-warnings.patch b/package/kernel/mac80211/patches/082-ath10k-suppress-Unknown-eventid-36925-warnings.patch
deleted file mode 100644
index 9ddede3a67..0000000000
--- a/package/kernel/mac80211/patches/082-ath10k-suppress-Unknown-eventid-36925-warnings.patch
+++ /dev/null
@@ -1,36 +0,0 @@
-From 606204bb863fa3b0bb54929d79b4dc46338f9180 Mon Sep 17 00:00:00 2001
-From: Sathishkumar Muruganandam <murugana@codeaurora.org>
-Date: Tue, 27 Mar 2018 11:26:46 +0300
-Subject: [PATCH] ath10k: suppress "Unknown eventid: 36925" warnings
-
-FW has Smart Logging feature enabled by default for detecting failures
-and processing FATAL_CONDITION_EVENTID (36925 - 0x903D) back to host.
-
-Since ath10k doesn't implement the Smart Logging and FATAL CONDITION
-EVENT processing yet, suppressing the unknown event ID warning by moving
-this under ATH10K_DBG_WMI.
-
-Simulated the same issue by having associated STA powered off when
-ping flood was running from AP backbone. This triggerd STA KICKOUT
-in AP followed by FATAL CONDITION event 36925.
-
-Issue was reproduced and verified in below DUT
-------------------------------------------------
-AP mode of OpenWRT QCA9984 running 6.0.8 with FW ver 10.4-3.5.3-00053
-
-Signed-off-by: Sathishkumar Muruganandam <murugana@codeaurora.org>
-Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
----
- drivers/net/wireless/ath/ath10k/wmi.c | 1 +
- 1 file changed, 1 insertion(+)
-
---- a/drivers/net/wireless/ath/ath10k/wmi.c
-+++ b/drivers/net/wireless/ath/ath10k/wmi.c
-@@ -5462,6 +5462,7 @@ static void ath10k_wmi_10_4_op_rx(struct
- case WMI_10_4_WOW_WAKEUP_HOST_EVENTID:
- case WMI_10_4_PEER_RATECODE_LIST_EVENTID:
- case WMI_10_4_WDS_PEER_EVENTID:
-+ case WMI_10_4_DEBUG_FATAL_CONDITION_EVENTID:
- ath10k_dbg(ar, ATH10K_DBG_WMI,
- "received event id %d not implemented\n", id);
- break;
diff --git a/package/kernel/mac80211/patches/090-Revert-rt2800-use-TXOP_BACKOFF-for-probe-frames.patch b/package/kernel/mac80211/patches/090-Revert-rt2800-use-TXOP_BACKOFF-for-probe-frames.patch
deleted file mode 100644
index 95feffa0ee..0000000000
--- a/package/kernel/mac80211/patches/090-Revert-rt2800-use-TXOP_BACKOFF-for-probe-frames.patch
+++ /dev/null
@@ -1,45 +0,0 @@
-From patchwork Mon May 28 11:25:06 2018
-Content-Type: text/plain; charset="utf-8"
-MIME-Version: 1.0
-Content-Transfer-Encoding: 7bit
-Subject: Revert "rt2800: use TXOP_BACKOFF for probe frames"
-From: Stanislaw Gruszka <sgruszka@redhat.com>
-X-Patchwork-Id: 10431861
-Message-Id: <1527506706-6488-1-git-send-email-sgruszka@redhat.com>
-To: linux-wireless@vger.kernel.org
-Date: Mon, 28 May 2018 13:25:06 +0200
-
-This reverts commit fb47ada8dc3c30c8e7b415da155742b49536c61e.
-
-In some situations when we set TXOP_BACKOFF, the probe frame is
-not sent at all. What it worse then sending probe frame as part
-of AMPDU and can degrade 11n performance to 11g rates.
-
-Cc: stable@vger.kernel.org
-Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com>
----
- drivers/net/wireless/ralink/rt2x00/rt2x00queue.c | 7 +++----
- 1 file changed, 3 insertions(+), 4 deletions(-)
-
---- a/drivers/net/wireless/ralink/rt2x00/rt2x00queue.c
-+++ b/drivers/net/wireless/ralink/rt2x00/rt2x00queue.c
-@@ -372,16 +372,15 @@ static void rt2x00queue_create_tx_descri
-
- /*
- * Determine IFS values
-- * - Use TXOP_BACKOFF for probe and management frames except beacons
-+ * - Use TXOP_BACKOFF for management frames except beacons
- * - Use TXOP_SIFS for fragment bursts
- * - Use TXOP_HTTXOP for everything else
- *
- * Note: rt2800 devices won't use CTS protection (if used)
- * for frames not transmitted with TXOP_HTTXOP
- */
-- if ((ieee80211_is_mgmt(hdr->frame_control) &&
-- !ieee80211_is_beacon(hdr->frame_control)) ||
-- (tx_info->flags & IEEE80211_TX_CTL_RATE_CTRL_PROBE))
-+ if (ieee80211_is_mgmt(hdr->frame_control) &&
-+ !ieee80211_is_beacon(hdr->frame_control))
- txdesc->u.ht.txop = TXOP_BACKOFF;
- else if (!(tx_info->flags & IEEE80211_TX_CTL_FIRST_FRAGMENT))
- txdesc->u.ht.txop = TXOP_SIFS;
diff --git a/package/kernel/mac80211/patches/160-ath10k-search-all-IEs-for-variant-before-falling-back.patch b/package/kernel/mac80211/patches/160-ath10k-search-all-IEs-for-variant-before-falling-back.patch
deleted file mode 100644
index 357b006bcc..0000000000
--- a/package/kernel/mac80211/patches/160-ath10k-search-all-IEs-for-variant-before-falling-back.patch
+++ /dev/null
@@ -1,237 +0,0 @@
-From: Thomas Hebb <tommyhebb@gmail.com>
-Subject: [PATCH] ath10k: search all IEs for variant before falling back
-Date: Wed, 21 Feb 2018 11:43:39 -0500
-
-commit f2593cb1b291 ("ath10k: Search SMBIOS for OEM board file
-extension") added a feature to ath10k that allows Board Data File
-(BDF) conflicts between multiple devices that use the same device IDs
-but have different calibration requirements to be resolved by allowing
-a "variant" string to be stored in SMBIOS [and later device tree, added
-by commit d06f26c5c8a4 ("ath10k: search DT for qcom,ath10k-calibration-
-variant")] that gets appended to the ID stored in board-2.bin.
-
-This original patch had a regression, however. Namely that devices with
-a variant present in SMBIOS that didn't need custom BDFs could no longer
-find the default BDF, which has no variant appended. The patch was
-reverted and re-applied with a fix for this issue in commit 1657b8f84ed9
-("search SMBIOS for OEM board file extension").
-
-But the fix to fall back to a default BDF introduced another issue: the
-driver currently parses IEs in board-2.bin one by one, and for each one
-it first checks to see if it matches the ID with the variant appended.
-If it doesn't, it checks to see if it matches the "fallback" ID with no
-variant. If a matching BDF is found at any point during this search, the
-search is terminated and that BDF is used. The issue is that it's very
-possible (and is currently the case for board-2.bin files present in the
-ath10k-firmware repository) for the default BDF to occur in an earlier
-IE than the variant-specific BDF. In this case, the current code will
-happily choose the default BDF even though a better-matching BDF is
-present later in the file.
-
-This patch fixes the issue by first searching the entire file for the ID
-with variant, and searching for the fallback ID only if that search
-fails. It also includes some code cleanup in the area, as
-ath10k_core_fetch_board_data_api_n() no longer does its own string
-mangling to remove the variant from an ID, instead leaving that job to a
-new flag passed to ath10k_core_create_board_name().
-
-I've tested this patch on a QCA4019 and verified that the driver behaves
-correctly for 1) both fallback and variant BDFs present, 2) only fallback
-BDF present, and 3) no matching BDFs present.
-
-Fixes: 1657b8f84ed9 ("ath10k: search SMBIOS for OEM board file extension")
-Signed-off-by: Thomas Hebb <tommyhebb@gmail.com>
----
- drivers/net/wireless/ath/ath10k/core.c | 134 ++++++++++++++++++---------------
- 1 file changed, 72 insertions(+), 62 deletions(-)
-
---- a/drivers/net/wireless/ath/ath10k/core.c
-+++ b/drivers/net/wireless/ath/ath10k/core.c
-@@ -1132,14 +1132,61 @@ out:
- return ret;
- }
-
-+static int ath10k_core_search_bd(struct ath10k *ar,
-+ const char *boardname,
-+ const u8 *data,
-+ size_t len)
-+{
-+ size_t ie_len;
-+ struct ath10k_fw_ie *hdr;
-+ int ret = -ENOENT, ie_id;
-+
-+ while (len > sizeof(struct ath10k_fw_ie)) {
-+ hdr = (struct ath10k_fw_ie *)data;
-+ ie_id = le32_to_cpu(hdr->id);
-+ ie_len = le32_to_cpu(hdr->len);
-+
-+ len -= sizeof(*hdr);
-+ data = hdr->data;
-+
-+ if (len < ALIGN(ie_len, 4)) {
-+ ath10k_err(ar, "invalid length for board ie_id %d ie_len %zu len %zu\n",
-+ ie_id, ie_len, len);
-+ return -EINVAL;
-+ }
-+
-+ switch (ie_id) {
-+ case ATH10K_BD_IE_BOARD:
-+ ret = ath10k_core_parse_bd_ie_board(ar, data, ie_len,
-+ boardname);
-+ if (ret == -ENOENT)
-+ /* no match found, continue */
-+ break;
-+
-+ /* either found or error, so stop searching */
-+ goto out;
-+ }
-+
-+ /* jump over the padding */
-+ ie_len = ALIGN(ie_len, 4);
-+
-+ len -= ie_len;
-+ data += ie_len;
-+ }
-+
-+out:
-+ /* return result of parse_bd_ie_board() or -ENOENT */
-+ return ret;
-+}
-+
- static int ath10k_core_fetch_board_data_api_n(struct ath10k *ar,
- const char *boardname,
-+ const char *fallback_boardname,
- const char *filename)
- {
-- size_t len, magic_len, ie_len;
-- struct ath10k_fw_ie *hdr;
-+ size_t len, magic_len;
- const u8 *data;
-- int ret, ie_id;
-+ int ret;
-
- ar->normal_mode_fw.board = ath10k_fetch_fw_file(ar,
- ar->hw_params.fw.dir,
-@@ -1177,69 +1224,23 @@ static int ath10k_core_fetch_board_data_
- data += magic_len;
- len -= magic_len;
-
-- while (len > sizeof(struct ath10k_fw_ie)) {
-- hdr = (struct ath10k_fw_ie *)data;
-- ie_id = le32_to_cpu(hdr->id);
-- ie_len = le32_to_cpu(hdr->len);
--
-- len -= sizeof(*hdr);
-- data = hdr->data;
--
-- if (len < ALIGN(ie_len, 4)) {
-- ath10k_err(ar, "invalid length for board ie_id %d ie_len %zu len %zu\n",
-- ie_id, ie_len, len);
-- ret = -EINVAL;
-- goto err;
-- }
-+ /* attempt to find boardname in the IE list */
-+ ret = ath10k_core_search_bd(ar, boardname, data, len);
-
-- switch (ie_id) {
-- case ATH10K_BD_IE_BOARD:
-- ret = ath10k_core_parse_bd_ie_board(ar, data, ie_len,
-- boardname);
-- if (ret == -ENOENT && ar->id.bdf_ext[0] != '\0') {
-- /* try default bdf if variant was not found */
-- char *s, *v = ",variant=";
-- char boardname2[100];
--
-- strlcpy(boardname2, boardname,
-- sizeof(boardname2));
--
-- s = strstr(boardname2, v);
-- if (s)
-- *s = '\0'; /* strip ",variant=%s" */
--
-- ret = ath10k_core_parse_bd_ie_board(ar, data,
-- ie_len,
-- boardname2);
-- }
-+ /* if we didn't find it and have a fallback name, try that */
-+ if (ret == -ENOENT && fallback_boardname)
-+ ret = ath10k_core_search_bd(ar, fallback_boardname, data, len);
-
-- if (ret == -ENOENT)
-- /* no match found, continue */
-- break;
-- else if (ret)
-- /* there was an error, bail out */
-- goto err;
--
-- /* board data found */
-- goto out;
-- }
--
-- /* jump over the padding */
-- ie_len = ALIGN(ie_len, 4);
--
-- len -= ie_len;
-- data += ie_len;
-- }
--
--out:
-- if (!ar->normal_mode_fw.board_data || !ar->normal_mode_fw.board_len) {
-+ if (ret == -ENOENT) {
- ath10k_err(ar,
- "failed to fetch board data for %s from %s/%s\n",
- boardname, ar->hw_params.fw.dir, filename);
- ret = -ENODATA;
-- goto err;
- }
-
-+ if (ret)
-+ goto err;
-+
- return 0;
-
- err:
-@@ -1248,12 +1249,12 @@ err:
- }
-
- static int ath10k_core_create_board_name(struct ath10k *ar, char *name,
-- size_t name_len)
-+ size_t name_len, bool with_variant)
- {
- /* strlen(',variant=') + strlen(ar->id.bdf_ext) */
- char variant[9 + ATH10K_SMBIOS_BDF_EXT_STR_LENGTH] = { 0 };
-
-- if (ar->id.bdf_ext[0] != '\0')
-+ if (with_variant && ar->id.bdf_ext[0] != '\0')
- scnprintf(variant, sizeof(variant), ",variant=%s",
- ar->id.bdf_ext);
-
-@@ -1279,17 +1280,26 @@ out:
-
- static int ath10k_core_fetch_board_file(struct ath10k *ar)
- {
-- char boardname[100];
-+ char boardname[100], fallback_boardname[100];
- int ret;
-
-- ret = ath10k_core_create_board_name(ar, boardname, sizeof(boardname));
-+ ret = ath10k_core_create_board_name(ar, boardname,
-+ sizeof(boardname), true);
- if (ret) {
- ath10k_err(ar, "failed to create board name: %d", ret);
- return ret;
- }
-
-+ ret = ath10k_core_create_board_name(ar, fallback_boardname,
-+ sizeof(boardname), false);
-+ if (ret) {
-+ ath10k_err(ar, "failed to create fallback board name: %d", ret);
-+ return ret;
-+ }
-+
- ar->bd_api = 2;
- ret = ath10k_core_fetch_board_data_api_n(ar, boardname,
-+ fallback_boardname,
- ATH10K_BOARD_API2_FILE);
- if (!ret)
- goto success;
diff --git a/package/kernel/mac80211/patches/300-v4.15-ath10k-fix-build-errors-with-CONFIG_PM.patch b/package/kernel/mac80211/patches/300-v4.15-ath10k-fix-build-errors-with-CONFIG_PM.patch
deleted file mode 100644
index 2aeb49dc16..0000000000
--- a/package/kernel/mac80211/patches/300-v4.15-ath10k-fix-build-errors-with-CONFIG_PM.patch
+++ /dev/null
@@ -1,72 +0,0 @@
-From: Brian Norris <briannorris@chromium.org>
-Date: Thu, 19 Oct 2017 11:45:19 -0700
-Subject: [PATCH] ath10k: fix build errors with !CONFIG_PM
-
-Build errors have been reported with CONFIG_PM=n:
-
-drivers/net/wireless/ath/ath10k/pci.c:3416:8: error: implicit
-declaration of function 'ath10k_pci_suspend'
-[-Werror=implicit-function-declaration]
-
-drivers/net/wireless/ath/ath10k/pci.c:3428:8: error: implicit
-declaration of function 'ath10k_pci_resume'
-[-Werror=implicit-function-declaration]
-
-These are caused by the combination of the following two commits:
-
-6af1de2e4ec4 ("ath10k: mark PM functions as __maybe_unused")
-96378bd2c6cd ("ath10k: fix core PCI suspend when WoWLAN is supported but
-disabled")
-
-Both build fine on their own.
-
-But now that ath10k_pci_pm_{suspend,resume}() is compiled
-unconditionally, we should also compile ath10k_pci_{suspend,resume}()
-unconditionally.
-
-And drop the #ifdef around ath10k_pci_hif_{suspend,resume}() too; they
-are trivial (empty), so we're not saving much space by compiling them
-out. And the alternatives would be to sprinkle more __maybe_unused, or
-spread the #ifdef's further.
-
-Build tested with the following combinations:
-CONFIG_PM=y && CONFIG_PM_SLEEP=y
-CONFIG_PM=y && CONFIG_PM_SLEEP=n
-CONFIG_PM=n
-
-Fixes: 96378bd2c6cd ("ath10k: fix core PCI suspend when WoWLAN is supported but disabled")
-Fixes: 096ad2a15fd8 ("Merge branch 'ath-next'")
-Signed-off-by: Brian Norris <briannorris@chromium.org>
-Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
----
-
---- a/drivers/net/wireless/ath/ath10k/pci.c
-+++ b/drivers/net/wireless/ath/ath10k/pci.c
-@@ -2577,8 +2577,6 @@ void ath10k_pci_hif_power_down(struct at
- */
- }
-
--#ifdef CONFIG_PM
--
- static int ath10k_pci_hif_suspend(struct ath10k *ar)
- {
- /* Nothing to do; the important stuff is in the driver suspend. */
-@@ -2627,7 +2625,6 @@ static int ath10k_pci_resume(struct ath1
-
- return ret;
- }
--#endif
-
- static bool ath10k_pci_validate_cal(void *data, size_t size)
- {
-@@ -2782,10 +2779,8 @@ static const struct ath10k_hif_ops ath10
- .power_down = ath10k_pci_hif_power_down,
- .read32 = ath10k_pci_read32,
- .write32 = ath10k_pci_write32,
--#ifdef CONFIG_PM
- .suspend = ath10k_pci_hif_suspend,
- .resume = ath10k_pci_hif_resume,
--#endif
- .fetch_cal_eeprom = ath10k_pci_hif_fetch_cal_eeprom,
- };
-
diff --git a/package/kernel/mac80211/patches/301-v4.15-mac80211-properly-free-requested-but-not-started-TX-.patch b/package/kernel/mac80211/patches/301-v4.15-mac80211-properly-free-requested-but-not-started-TX-.patch
deleted file mode 100644
index ecc5e49120..0000000000
--- a/package/kernel/mac80211/patches/301-v4.15-mac80211-properly-free-requested-but-not-started-TX-.patch
+++ /dev/null
@@ -1,37 +0,0 @@
-From: Johannes Berg <johannes.berg@intel.com>
-Date: Mon, 20 Nov 2017 17:01:44 +0100
-Subject: [PATCH] mac80211: properly free requested-but-not-started TX agg
- sessions
-
-When deleting a station or otherwise tearing down all aggregation
-sessions, make sure to delete requested but not yet started ones,
-to avoid the following scenario:
-
- * session is requested, added to tid_start_tx[]
- * ieee80211_ba_session_work() runs, gets past BLOCK_BA check
- * ieee80211_sta_tear_down_BA_sessions() runs, locks &sta->ampdu_mlme.mtx,
- e.g. while deleting the station - deleting all active sessions
- * ieee80211_ba_session_work() continues since tear down flushes it, and
- calls ieee80211_tx_ba_session_handle_start() for the new session, arms
- the timer for it
- * station deletion continues to __cleanup_single_sta() and frees the
- session struct, while the timer is armed
-
-Reported-by: Fengguang Wu <fengguang.wu@intel.com>
-Signed-off-by: Johannes Berg <johannes.berg@intel.com>
----
-
---- a/net/mac80211/agg-tx.c
-+++ b/net/mac80211/agg-tx.c
-@@ -330,6 +330,11 @@ int ___ieee80211_stop_tx_ba_session(stru
-
- spin_lock_bh(&sta->lock);
-
-+ /* free struct pending for start, if present */
-+ tid_tx = sta->ampdu_mlme.tid_start_tx[tid];
-+ kfree(tid_tx);
-+ sta->ampdu_mlme.tid_start_tx[tid] = NULL;
-+
- tid_tx = rcu_dereference_protected_tid_tx(sta, tid);
- if (!tid_tx) {
- spin_unlock_bh(&sta->lock);
diff --git a/package/kernel/mac80211/patches/302-v4.15-mac80211-mesh-drop-frames-appearing-to-be-from-us.patch b/package/kernel/mac80211/patches/302-v4.15-mac80211-mesh-drop-frames-appearing-to-be-from-us.patch
deleted file mode 100644
index 839e927880..0000000000
--- a/package/kernel/mac80211/patches/302-v4.15-mac80211-mesh-drop-frames-appearing-to-be-from-us.patch
+++ /dev/null
@@ -1,25 +0,0 @@
-From: Johannes Berg <johannes.berg@intel.com>
-Date: Thu, 4 Jan 2018 15:51:53 +0100
-Subject: [PATCH] mac80211: mesh: drop frames appearing to be from us
-
-If there are multiple mesh stations with the same MAC address,
-they will both get confused and start throwing warnings.
-
-Obviously in this case nothing can actually work anyway, so just
-drop frames that look like they're from ourselves early on.
-
-Reported-by: Gui Iribarren <gui@altermundi.net>
-Signed-off-by: Johannes Berg <johannes.berg@intel.com>
----
-
---- a/net/mac80211/rx.c
-+++ b/net/mac80211/rx.c
-@@ -3632,6 +3632,8 @@ static bool ieee80211_accept_frame(struc
- }
- return true;
- case NL80211_IFTYPE_MESH_POINT:
-+ if (ether_addr_equal(sdata->vif.addr, hdr->addr2))
-+ return false;
- if (multicast)
- return true;
- return ether_addr_equal(sdata->vif.addr, hdr->addr1);
diff --git a/package/kernel/mac80211/patches/303-v4.15-0001-brcmfmac-handle-FWHALT-mailbox-indication.patch b/package/kernel/mac80211/patches/303-v4.15-0001-brcmfmac-handle-FWHALT-mailbox-indication.patch
deleted file mode 100644
index b8f3be1c8b..0000000000
--- a/package/kernel/mac80211/patches/303-v4.15-0001-brcmfmac-handle-FWHALT-mailbox-indication.patch
+++ /dev/null
@@ -1,60 +0,0 @@
-From 2fd3877b5bb7d39782c3205a1dcda02023b8514a Mon Sep 17 00:00:00 2001
-From: Arend Van Spriel <arend.vanspriel@broadcom.com>
-Date: Wed, 8 Nov 2017 14:36:31 +0100
-Subject: [PATCH] brcmfmac: handle FWHALT mailbox indication
-
-The firmware uses a mailbox to communicate to the host what is going
-on. In the driver we validate the bit received. Various people seen
-the following message:
-
- brcmfmac: brcmf_sdio_hostmail: Unknown mailbox data content: 0x40012
-
-Bit 4 is cause of this message, but this actually indicates the firmware
-has halted. Handle this bit by giving a more meaningful error message.
-
-Reviewed-by: Hante Meuleman <hante.meuleman@broadcom.com>
-Reviewed-by: Pieter-Paul Giesberts <pieter-paul.giesberts@broadcom.com>
-Reviewed-by: Franky Lin <franky.lin@broadcom.com>
-Signed-off-by: Arend van Spriel <arend.vanspriel@broadcom.com>
-Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
----
- drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c | 14 ++++++++++----
- 1 file changed, 10 insertions(+), 4 deletions(-)
-
---- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c
-+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c
-@@ -260,10 +260,11 @@ struct rte_console {
- #define I_HMB_HOST_INT I_HMB_SW3 /* Miscellaneous Interrupt */
-
- /* tohostmailboxdata */
--#define HMB_DATA_NAKHANDLED 1 /* retransmit NAK'd frame */
--#define HMB_DATA_DEVREADY 2 /* talk to host after enable */
--#define HMB_DATA_FC 4 /* per prio flowcontrol update flag */
--#define HMB_DATA_FWREADY 8 /* fw ready for protocol activity */
-+#define HMB_DATA_NAKHANDLED 0x0001 /* retransmit NAK'd frame */
-+#define HMB_DATA_DEVREADY 0x0002 /* talk to host after enable */
-+#define HMB_DATA_FC 0x0004 /* per prio flowcontrol update flag */
-+#define HMB_DATA_FWREADY 0x0008 /* fw ready for protocol activity */
-+#define HMB_DATA_FWHALT 0x0010 /* firmware halted */
-
- #define HMB_DATA_FCDATA_MASK 0xff000000
- #define HMB_DATA_FCDATA_SHIFT 24
-@@ -1094,6 +1095,10 @@ static u32 brcmf_sdio_hostmail(struct br
- offsetof(struct sdpcmd_regs, tosbmailbox));
- bus->sdcnt.f1regdata += 2;
-
-+ /* dongle indicates the firmware has halted/crashed */
-+ if (hmb_data & HMB_DATA_FWHALT)
-+ brcmf_err("mailbox indicates firmware halted\n");
-+
- /* Dongle recomposed rx frames, accept them again */
- if (hmb_data & HMB_DATA_NAKHANDLED) {
- brcmf_dbg(SDIO, "Dongle reports NAK handled, expect rtx of %d\n",
-@@ -1151,6 +1156,7 @@ static u32 brcmf_sdio_hostmail(struct br
- HMB_DATA_NAKHANDLED |
- HMB_DATA_FC |
- HMB_DATA_FWREADY |
-+ HMB_DATA_FWHALT |
- HMB_DATA_FCDATA_MASK | HMB_DATA_VERSION_MASK))
- brcmf_err("Unknown mailbox data content: 0x%02x\n",
- hmb_data);
diff --git a/package/kernel/mac80211/patches/303-v4.15-0002-brcmfmac-disable-packet-filtering-in-promiscuous-mod.patch b/package/kernel/mac80211/patches/303-v4.15-0002-brcmfmac-disable-packet-filtering-in-promiscuous-mod.patch
deleted file mode 100644
index 901663193a..0000000000
--- a/package/kernel/mac80211/patches/303-v4.15-0002-brcmfmac-disable-packet-filtering-in-promiscuous-mod.patch
+++ /dev/null
@@ -1,133 +0,0 @@
-From 6c219b0088158da839a5be63c5b3d96c145501d2 Mon Sep 17 00:00:00 2001
-From: Franky Lin <franky.lin@broadcom.com>
-Date: Wed, 8 Nov 2017 14:36:32 +0100
-Subject: [PATCH] brcmfmac: disable packet filtering in promiscuous mode
-
-Disable arp and nd offload to allow all packets sending to host.
-
-Reported-by: Phil Elwell <phil@raspberrypi.org>
-Tested-by: Phil Elwell <phil@raspberrypi.org>
-Reviewed-by: Arend Van Spriel <arend.vanspriel@broadcom.com>
-Signed-off-by: Franky Lin <franky.lin@broadcom.com>
-Signed-off-by: Arend van Spriel <arend.vanspriel@broadcom.com>
-Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
----
- .../broadcom/brcm80211/brcmfmac/cfg80211.c | 41 ----------------------
- .../wireless/broadcom/brcm80211/brcmfmac/core.c | 38 ++++++++++++++++++++
- .../wireless/broadcom/brcm80211/brcmfmac/core.h | 1 +
- 3 files changed, 39 insertions(+), 41 deletions(-)
-
---- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c
-+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c
-@@ -472,47 +472,6 @@ send_key_to_dongle(struct brcmf_if *ifp,
- return err;
- }
-
--static s32
--brcmf_configure_arp_nd_offload(struct brcmf_if *ifp, bool enable)
--{
-- s32 err;
-- u32 mode;
--
-- if (enable)
-- mode = BRCMF_ARP_OL_AGENT | BRCMF_ARP_OL_PEER_AUTO_REPLY;
-- else
-- mode = 0;
--
-- /* Try to set and enable ARP offload feature, this may fail, then it */
-- /* is simply not supported and err 0 will be returned */
-- err = brcmf_fil_iovar_int_set(ifp, "arp_ol", mode);
-- if (err) {
-- brcmf_dbg(TRACE, "failed to set ARP offload mode to 0x%x, err = %d\n",
-- mode, err);
-- err = 0;
-- } else {
-- err = brcmf_fil_iovar_int_set(ifp, "arpoe", enable);
-- if (err) {
-- brcmf_dbg(TRACE, "failed to configure (%d) ARP offload err = %d\n",
-- enable, err);
-- err = 0;
-- } else
-- brcmf_dbg(TRACE, "successfully configured (%d) ARP offload to 0x%x\n",
-- enable, mode);
-- }
--
-- err = brcmf_fil_iovar_int_set(ifp, "ndoe", enable);
-- if (err) {
-- brcmf_dbg(TRACE, "failed to configure (%d) ND offload err = %d\n",
-- enable, err);
-- err = 0;
-- } else
-- brcmf_dbg(TRACE, "successfully configured (%d) ND offload to 0x%x\n",
-- enable, mode);
--
-- return err;
--}
--
- static void
- brcmf_cfg80211_update_proto_addr_mode(struct wireless_dev *wdev)
- {
---- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/core.c
-+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/core.c
-@@ -71,6 +71,43 @@ struct brcmf_if *brcmf_get_ifp(struct br
- return ifp;
- }
-
-+void brcmf_configure_arp_nd_offload(struct brcmf_if *ifp, bool enable)
-+{
-+ s32 err;
-+ u32 mode;
-+
-+ if (enable)
-+ mode = BRCMF_ARP_OL_AGENT | BRCMF_ARP_OL_PEER_AUTO_REPLY;
-+ else
-+ mode = 0;
-+
-+ /* Try to set and enable ARP offload feature, this may fail, then it */
-+ /* is simply not supported and err 0 will be returned */
-+ err = brcmf_fil_iovar_int_set(ifp, "arp_ol", mode);
-+ if (err) {
-+ brcmf_dbg(TRACE, "failed to set ARP offload mode to 0x%x, err = %d\n",
-+ mode, err);
-+ } else {
-+ err = brcmf_fil_iovar_int_set(ifp, "arpoe", enable);
-+ if (err) {
-+ brcmf_dbg(TRACE, "failed to configure (%d) ARP offload err = %d\n",
-+ enable, err);
-+ } else {
-+ brcmf_dbg(TRACE, "successfully configured (%d) ARP offload to 0x%x\n",
-+ enable, mode);
-+ }
-+ }
-+
-+ err = brcmf_fil_iovar_int_set(ifp, "ndoe", enable);
-+ if (err) {
-+ brcmf_dbg(TRACE, "failed to configure (%d) ND offload err = %d\n",
-+ enable, err);
-+ } else {
-+ brcmf_dbg(TRACE, "successfully configured (%d) ND offload to 0x%x\n",
-+ enable, mode);
-+ }
-+}
-+
- static void _brcmf_set_multicast_list(struct work_struct *work)
- {
- struct brcmf_if *ifp;
-@@ -134,6 +171,7 @@ static void _brcmf_set_multicast_list(st
- if (err < 0)
- brcmf_err("Setting BRCMF_C_SET_PROMISC failed, %d\n",
- err);
-+ brcmf_configure_arp_nd_offload(ifp, !cmd_value);
- }
-
- #if IS_ENABLED(CONFIG_IPV6)
---- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/core.h
-+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/core.h
-@@ -203,6 +203,7 @@ int brcmf_netdev_wait_pend8021x(struct b
- /* Return pointer to interface name */
- char *brcmf_ifname(struct brcmf_if *ifp);
- struct brcmf_if *brcmf_get_ifp(struct brcmf_pub *drvr, int ifidx);
-+void brcmf_configure_arp_nd_offload(struct brcmf_if *ifp, bool enable);
- int brcmf_net_attach(struct brcmf_if *ifp, bool rtnl_locked);
- struct brcmf_if *brcmf_add_if(struct brcmf_pub *drvr, s32 bsscfgidx, s32 ifidx,
- bool is_p2pdev, const char *name, u8 *mac_addr);
diff --git a/package/kernel/mac80211/patches/303-v4.15-0003-brcmfmac-cleanup-brcmf_cfg80211_escan-function.patch b/package/kernel/mac80211/patches/303-v4.15-0003-brcmfmac-cleanup-brcmf_cfg80211_escan-function.patch
deleted file mode 100644
index b6f3d0c697..0000000000
--- a/package/kernel/mac80211/patches/303-v4.15-0003-brcmfmac-cleanup-brcmf_cfg80211_escan-function.patch
+++ /dev/null
@@ -1,133 +0,0 @@
-From 8c6efda22f5f9f73fc948f517424466be01ae84d Mon Sep 17 00:00:00 2001
-From: Arend Van Spriel <arend.vanspriel@broadcom.com>
-Date: Wed, 8 Nov 2017 14:36:33 +0100
-Subject: [PATCH] brcmfmac: cleanup brcmf_cfg80211_escan() function
-
-The function brcmf_cfg80211_escan() was always called with a non-null
-request parameter and null pointer for this_ssid parameter. Clean up
-the function removing the dead code path.
-
-Reviewed-by: Hante Meuleman <hante.meuleman@broadcom.com>
-Reviewed-by: Pieter-Paul Giesberts <pieter-paul.giesberts@broadcom.com>
-Reviewed-by: Franky Lin <franky.lin@broadcom.com>
-Signed-off-by: Arend van Spriel <arend.vanspriel@broadcom.com>
-Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
----
- .../broadcom/brcm80211/brcmfmac/cfg80211.c | 76 ++++------------------
- 1 file changed, 11 insertions(+), 65 deletions(-)
-
---- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c
-+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c
-@@ -1072,18 +1072,10 @@ brcmf_do_escan(struct brcmf_if *ifp, str
-
- static s32
- brcmf_cfg80211_escan(struct wiphy *wiphy, struct brcmf_cfg80211_vif *vif,
-- struct cfg80211_scan_request *request,
-- struct cfg80211_ssid *this_ssid)
-+ struct cfg80211_scan_request *request)
- {
-- struct brcmf_if *ifp = vif->ifp;
- struct brcmf_cfg80211_info *cfg = wiphy_to_cfg(wiphy);
-- struct cfg80211_ssid *ssids;
-- u32 passive_scan;
-- bool escan_req;
-- bool spec_scan;
- s32 err;
-- struct brcmf_ssid_le ssid_le;
-- u32 SSID_len;
-
- brcmf_dbg(SCAN, "START ESCAN\n");
-
-@@ -1101,8 +1093,8 @@ brcmf_cfg80211_escan(struct wiphy *wiphy
- cfg->scan_status);
- return -EAGAIN;
- }
-- if (test_bit(BRCMF_VIF_STATUS_CONNECTING, &ifp->vif->sme_state)) {
-- brcmf_err("Connecting: status (%lu)\n", ifp->vif->sme_state);
-+ if (test_bit(BRCMF_VIF_STATUS_CONNECTING, &vif->sme_state)) {
-+ brcmf_err("Connecting: status (%lu)\n", vif->sme_state);
- return -EAGAIN;
- }
-
-@@ -1110,63 +1102,17 @@ brcmf_cfg80211_escan(struct wiphy *wiphy
- if (vif == cfg->p2p.bss_idx[P2PAPI_BSSCFG_DEVICE].vif)
- vif = cfg->p2p.bss_idx[P2PAPI_BSSCFG_PRIMARY].vif;
-
-- escan_req = false;
-- if (request) {
-- /* scan bss */
-- ssids = request->ssids;
-- escan_req = true;
-- } else {
-- /* scan in ibss */
-- /* we don't do escan in ibss */
-- ssids = this_ssid;
-- }
--
- cfg->scan_request = request;
- set_bit(BRCMF_SCAN_STATUS_BUSY, &cfg->scan_status);
-- if (escan_req) {
-- cfg->escan_info.run = brcmf_run_escan;
-- err = brcmf_p2p_scan_prep(wiphy, request, vif);
-- if (err)
-- goto scan_out;
--
-- err = brcmf_do_escan(vif->ifp, request);
-- if (err)
-- goto scan_out;
-- } else {
-- brcmf_dbg(SCAN, "ssid \"%s\", ssid_len (%d)\n",
-- ssids->ssid, ssids->ssid_len);
-- memset(&ssid_le, 0, sizeof(ssid_le));
-- SSID_len = min_t(u8, sizeof(ssid_le.SSID), ssids->ssid_len);
-- ssid_le.SSID_len = cpu_to_le32(0);
-- spec_scan = false;
-- if (SSID_len) {
-- memcpy(ssid_le.SSID, ssids->ssid, SSID_len);
-- ssid_le.SSID_len = cpu_to_le32(SSID_len);
-- spec_scan = true;
-- } else
-- brcmf_dbg(SCAN, "Broadcast scan\n");
--
-- passive_scan = cfg->active_scan ? 0 : 1;
-- err = brcmf_fil_cmd_int_set(ifp, BRCMF_C_SET_PASSIVE_SCAN,
-- passive_scan);
-- if (err) {
-- brcmf_err("WLC_SET_PASSIVE_SCAN error (%d)\n", err);
-- goto scan_out;
-- }
-- brcmf_scan_config_mpc(ifp, 0);
-- err = brcmf_fil_cmd_data_set(ifp, BRCMF_C_SCAN, &ssid_le,
-- sizeof(ssid_le));
-- if (err) {
-- if (err == -EBUSY)
-- brcmf_dbg(INFO, "BUSY: scan for \"%s\" canceled\n",
-- ssid_le.SSID);
-- else
-- brcmf_err("WLC_SCAN error (%d)\n", err);
--
-- brcmf_scan_config_mpc(ifp, 1);
-- goto scan_out;
-- }
-- }
-+
-+ cfg->escan_info.run = brcmf_run_escan;
-+ err = brcmf_p2p_scan_prep(wiphy, request, vif);
-+ if (err)
-+ goto scan_out;
-+
-+ err = brcmf_do_escan(vif->ifp, request);
-+ if (err)
-+ goto scan_out;
-
- /* Arm scan timeout timer */
- mod_timer(&cfg->escan_timeout, jiffies +
-@@ -1191,7 +1137,7 @@ brcmf_cfg80211_scan(struct wiphy *wiphy,
- if (!check_vif_up(vif))
- return -EIO;
-
-- err = brcmf_cfg80211_escan(wiphy, vif, request, NULL);
-+ err = brcmf_cfg80211_escan(wiphy, vif, request);
-
- if (err)
- brcmf_err("scan error (%d)\n", err);
diff --git a/package/kernel/mac80211/patches/303-v4.15-0004-brcmfmac-use-msecs_to_jiffies-instead-of-calculation.patch b/package/kernel/mac80211/patches/303-v4.15-0004-brcmfmac-use-msecs_to_jiffies-instead-of-calculation.patch
deleted file mode 100644
index c2e3cba52d..0000000000
--- a/package/kernel/mac80211/patches/303-v4.15-0004-brcmfmac-use-msecs_to_jiffies-instead-of-calculation.patch
+++ /dev/null
@@ -1,31 +0,0 @@
-From df2d8388bc96c0f29d27d121f2a4cd054f8b3900 Mon Sep 17 00:00:00 2001
-From: Arend Van Spriel <arend.vanspriel@broadcom.com>
-Date: Wed, 8 Nov 2017 14:36:34 +0100
-Subject: [PATCH] brcmfmac: use msecs_to_jiffies() instead of calculation using
- HZ
-
-Minor cleanup using provided macro to convert milliseconds interval
-to jiffies in brcmf_cfg80211_escan().
-
-Reviewed-by: Hante Meuleman <hante.meuleman@broadcom.com>
-Reviewed-by: Pieter-Paul Giesberts <pieter-paul.giesberts@broadcom.com>
-Reviewed-by: Franky Lin <franky.lin@broadcom.com>
-Signed-off-by: Arend van Spriel <arend.vanspriel@broadcom.com>
-Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
----
- drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c | 4 ++--
- 1 file changed, 2 insertions(+), 2 deletions(-)
-
---- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c
-+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c
-@@ -1115,8 +1115,8 @@ brcmf_cfg80211_escan(struct wiphy *wiphy
- goto scan_out;
-
- /* Arm scan timeout timer */
-- mod_timer(&cfg->escan_timeout, jiffies +
-- BRCMF_ESCAN_TIMER_INTERVAL_MS * HZ / 1000);
-+ mod_timer(&cfg->escan_timeout,
-+ jiffies + msecs_to_jiffies(BRCMF_ESCAN_TIMER_INTERVAL_MS));
-
- return 0;
-
diff --git a/package/kernel/mac80211/patches/303-v4.15-0005-brcmfmac-get-rid-of-brcmf_cfg80211_escan-function.patch b/package/kernel/mac80211/patches/303-v4.15-0005-brcmfmac-get-rid-of-brcmf_cfg80211_escan-function.patch
deleted file mode 100644
index 575ffb0183..0000000000
--- a/package/kernel/mac80211/patches/303-v4.15-0005-brcmfmac-get-rid-of-brcmf_cfg80211_escan-function.patch
+++ /dev/null
@@ -1,83 +0,0 @@
-From 588378f15cff285ac81c929239ccba01d7f71d50 Mon Sep 17 00:00:00 2001
-From: Arend Van Spriel <arend.vanspriel@broadcom.com>
-Date: Wed, 8 Nov 2017 14:36:35 +0100
-Subject: [PATCH] brcmfmac: get rid of brcmf_cfg80211_escan() function
-
-The function brcmf_cfg80211_escan() is only called by brcmf_cfg80211_scan()
-so there is no reason to split in two function especially since the latter
-does not do an awful lot.
-
-Reviewed-by: Hante Meuleman <hante.meuleman@broadcom.com>
-Reviewed-by: Pieter-Paul Giesberts <pieter-paul.giesberts@broadcom.com>
-Reviewed-by: Franky Lin <franky.lin@broadcom.com>
-Signed-off-by: Arend van Spriel <arend.vanspriel@broadcom.com>
-Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
----
- .../broadcom/brcm80211/brcmfmac/cfg80211.c | 34 +++++++---------------
- 1 file changed, 10 insertions(+), 24 deletions(-)
-
---- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c
-+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c
-@@ -1071,13 +1071,16 @@ brcmf_do_escan(struct brcmf_if *ifp, str
- }
-
- static s32
--brcmf_cfg80211_escan(struct wiphy *wiphy, struct brcmf_cfg80211_vif *vif,
-- struct cfg80211_scan_request *request)
-+brcmf_cfg80211_scan(struct wiphy *wiphy, struct cfg80211_scan_request *request)
- {
- struct brcmf_cfg80211_info *cfg = wiphy_to_cfg(wiphy);
-- s32 err;
-+ struct brcmf_cfg80211_vif *vif;
-+ s32 err = 0;
-
-- brcmf_dbg(SCAN, "START ESCAN\n");
-+ brcmf_dbg(TRACE, "Enter\n");
-+ vif = container_of(request->wdev, struct brcmf_cfg80211_vif, wdev);
-+ if (!check_vif_up(vif))
-+ return -EIO;
-
- if (test_bit(BRCMF_SCAN_STATUS_BUSY, &cfg->scan_status)) {
- brcmf_err("Scanning already: status (%lu)\n", cfg->scan_status);
-@@ -1102,6 +1105,8 @@ brcmf_cfg80211_escan(struct wiphy *wiphy
- if (vif == cfg->p2p.bss_idx[P2PAPI_BSSCFG_DEVICE].vif)
- vif = cfg->p2p.bss_idx[P2PAPI_BSSCFG_PRIMARY].vif;
-
-+ brcmf_dbg(SCAN, "START ESCAN\n");
-+
- cfg->scan_request = request;
- set_bit(BRCMF_SCAN_STATUS_BUSY, &cfg->scan_status);
-
-@@ -1121,31 +1126,12 @@ brcmf_cfg80211_escan(struct wiphy *wiphy
- return 0;
-
- scan_out:
-+ brcmf_err("scan error (%d)\n", err);
- clear_bit(BRCMF_SCAN_STATUS_BUSY, &cfg->scan_status);
- cfg->scan_request = NULL;
- return err;
- }
-
--static s32
--brcmf_cfg80211_scan(struct wiphy *wiphy, struct cfg80211_scan_request *request)
--{
-- struct brcmf_cfg80211_vif *vif;
-- s32 err = 0;
--
-- brcmf_dbg(TRACE, "Enter\n");
-- vif = container_of(request->wdev, struct brcmf_cfg80211_vif, wdev);
-- if (!check_vif_up(vif))
-- return -EIO;
--
-- err = brcmf_cfg80211_escan(wiphy, vif, request);
--
-- if (err)
-- brcmf_err("scan error (%d)\n", err);
--
-- brcmf_dbg(TRACE, "Exit\n");
-- return err;
--}
--
- static s32 brcmf_set_rts(struct net_device *ndev, u32 rts_threshold)
- {
- s32 err = 0;
diff --git a/package/kernel/mac80211/patches/303-v4.15-0006-brcmfmac-get-rid-of-struct-brcmf_cfg80211_info-activ.patch b/package/kernel/mac80211/patches/303-v4.15-0006-brcmfmac-get-rid-of-struct-brcmf_cfg80211_info-activ.patch
deleted file mode 100644
index 4d4235f4b0..0000000000
--- a/package/kernel/mac80211/patches/303-v4.15-0006-brcmfmac-get-rid-of-struct-brcmf_cfg80211_info-activ.patch
+++ /dev/null
@@ -1,86 +0,0 @@
-From bbf35414cd23a9d7230bfd7046e1e2c26020e7eb Mon Sep 17 00:00:00 2001
-From: Arend Van Spriel <arend.vanspriel@broadcom.com>
-Date: Wed, 8 Nov 2017 14:36:36 +0100
-Subject: [PATCH] brcmfmac: get rid of struct brcmf_cfg80211_info::active_scan
- field
-
-The field struct brcmf_cfg80211_info::active_scan is set to true upon
-initializing the driver instance, but it is never changed so simply
-get rid of it.
-
-Reviewed-by: Hante Meuleman <hante.meuleman@broadcom.com>
-Reviewed-by: Pieter-Paul Giesberts <pieter-paul.giesberts@broadcom.com>
-Reviewed-by: Franky Lin <franky.lin@broadcom.com>
-Signed-off-by: Arend van Spriel <arend.vanspriel@broadcom.com>
-Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
----
- drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c | 10 +---------
- drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.h | 2 --
- drivers/net/wireless/broadcom/brcm80211/brcmfmac/p2p.c | 5 +----
- 3 files changed, 2 insertions(+), 15 deletions(-)
-
---- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c
-+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c
-@@ -1043,7 +1043,6 @@ brcmf_do_escan(struct brcmf_if *ifp, str
- {
- struct brcmf_cfg80211_info *cfg = ifp->drvr->config;
- s32 err;
-- u32 passive_scan;
- struct brcmf_scan_results *results;
- struct escan_info *escan = &cfg->escan_info;
-
-@@ -1051,13 +1050,7 @@ brcmf_do_escan(struct brcmf_if *ifp, str
- escan->ifp = ifp;
- escan->wiphy = cfg->wiphy;
- escan->escan_state = WL_ESCAN_STATE_SCANNING;
-- passive_scan = cfg->active_scan ? 0 : 1;
-- err = brcmf_fil_cmd_int_set(ifp, BRCMF_C_SET_PASSIVE_SCAN,
-- passive_scan);
-- if (err) {
-- brcmf_err("error (%d)\n", err);
-- return err;
-- }
-+
- brcmf_scan_config_mpc(ifp, 0);
- results = (struct brcmf_scan_results *)cfg->escan_info.escan_buf;
- results->version = 0;
-@@ -5767,7 +5760,6 @@ static s32 wl_init_priv(struct brcmf_cfg
-
- cfg->scan_request = NULL;
- cfg->pwr_save = true;
-- cfg->active_scan = true; /* we do active scan per default */
- cfg->dongle_up = false; /* dongle is not up yet */
- err = brcmf_init_priv_mem(cfg);
- if (err)
---- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.h
-+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.h
-@@ -283,7 +283,6 @@ struct brcmf_cfg80211_wowl {
- * @scan_status: scan activity on the dongle.
- * @pub: common driver information.
- * @channel: current channel.
-- * @active_scan: current scan mode.
- * @int_escan_map: bucket map for which internal e-scan is done.
- * @ibss_starter: indicates this sta is ibss starter.
- * @pwr_save: indicate whether dongle to support power save mode.
-@@ -316,7 +315,6 @@ struct brcmf_cfg80211_info {
- unsigned long scan_status;
- struct brcmf_pub *pub;
- u32 channel;
-- bool active_scan;
- u32 int_escan_map;
- bool ibss_starter;
- bool pwr_save;
---- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/p2p.c
-+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/p2p.c
-@@ -692,10 +692,7 @@ static s32 brcmf_p2p_escan(struct brcmf_
-
- /* determine the scan engine parameters */
- sparams->bss_type = DOT11_BSSTYPE_ANY;
-- if (p2p->cfg->active_scan)
-- sparams->scan_type = 0;
-- else
-- sparams->scan_type = 1;
-+ sparams->scan_type = BRCMF_SCANTYPE_ACTIVE;
-
- eth_broadcast_addr(sparams->bssid);
- sparams->home_time = cpu_to_le32(P2PAPI_SCAN_HOME_TIME_MS);
diff --git a/package/kernel/mac80211/patches/303-v4.15-0007-brcmfmac-move-configuration-of-probe-request-IEs.patch b/package/kernel/mac80211/patches/303-v4.15-0007-brcmfmac-move-configuration-of-probe-request-IEs.patch
deleted file mode 100644
index 3ad6e79db7..0000000000
--- a/package/kernel/mac80211/patches/303-v4.15-0007-brcmfmac-move-configuration-of-probe-request-IEs.patch
+++ /dev/null
@@ -1,55 +0,0 @@
-From bd99a3013bdc00f8fc7534c657b39616792b4467 Mon Sep 17 00:00:00 2001
-From: Arend Van Spriel <arend.vanspriel@broadcom.com>
-Date: Wed, 8 Nov 2017 14:36:37 +0100
-Subject: [PATCH] brcmfmac: move configuration of probe request IEs
-
-The configuration of the IEs for probe requests was done in a P2P
-related function, which is not very obvious. Moving it to
-.scan callback function, ie. brcmf_cfg80211_scan().
-
-Reviewed-by: Hante Meuleman <hante.meuleman@broadcom.com>
-Reviewed-by: Pieter-Paul Giesberts <pieter-paul.giesberts@broadcom.com>
-Reviewed-by: Franky Lin <franky.lin@broadcom.com>
-Signed-off-by: Arend van Spriel <arend.vanspriel@broadcom.com>
-Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
----
- drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c | 5 +++++
- drivers/net/wireless/broadcom/brcm80211/brcmfmac/p2p.c | 6 ++----
- 2 files changed, 7 insertions(+), 4 deletions(-)
-
---- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c
-+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c
-@@ -1108,6 +1108,11 @@ brcmf_cfg80211_scan(struct wiphy *wiphy,
- if (err)
- goto scan_out;
-
-+ err = brcmf_vif_set_mgmt_ie(vif, BRCMF_VNDR_IE_PRBREQ_FLAG,
-+ request->ie, request->ie_len);
-+ if (err)
-+ goto scan_out;
-+
- err = brcmf_do_escan(vif->ifp, request);
- if (err)
- goto scan_out;
---- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/p2p.c
-+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/p2p.c
-@@ -881,7 +881,7 @@ int brcmf_p2p_scan_prep(struct wiphy *wi
- {
- struct brcmf_cfg80211_info *cfg = wiphy_to_cfg(wiphy);
- struct brcmf_p2p_info *p2p = &cfg->p2p;
-- int err = 0;
-+ int err;
-
- if (brcmf_p2p_scan_is_p2p_request(request)) {
- /* find my listen channel */
-@@ -904,9 +904,7 @@ int brcmf_p2p_scan_prep(struct wiphy *wi
- /* override .run_escan() callback. */
- cfg->escan_info.run = brcmf_p2p_run_escan;
- }
-- err = brcmf_vif_set_mgmt_ie(vif, BRCMF_VNDR_IE_PRBREQ_FLAG,
-- request->ie, request->ie_len);
-- return err;
-+ return 0;
- }
-
-
diff --git a/package/kernel/mac80211/patches/304-v4.15-brcmfmac-add-CLM-download-support.patch b/package/kernel/mac80211/patches/304-v4.15-brcmfmac-add-CLM-download-support.patch
deleted file mode 100644
index 2cd5f73126..0000000000
--- a/package/kernel/mac80211/patches/304-v4.15-brcmfmac-add-CLM-download-support.patch
+++ /dev/null
@@ -1,434 +0,0 @@
-From fdd0bd88ceaecf729db103ac8836af5805dd2dc1 Mon Sep 17 00:00:00 2001
-From: Chung-Hsien Hsu <stanley.hsu@cypress.com>
-Date: Fri, 10 Nov 2017 17:27:15 +0800
-Subject: [PATCH] brcmfmac: add CLM download support
-
-The firmware for brcmfmac devices includes information regarding
-regulatory constraints. For certain devices this information is kept
-separately in a binary form that needs to be downloaded to the device.
-This patch adds support to download this so-called CLM blob file. It
-uses the same naming scheme as the other firmware files with extension
-of .clm_blob.
-
-The CLM blob file is optional. If the file does not exist, the download
-process will be bypassed. It will not affect the driver loading.
-
-Reviewed-by: Arend van Spriel <arend.vanspriel@broadcom.com>
-Signed-off-by: Chung-Hsien Hsu <stanley.hsu@cypress.com>
-Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
----
- .../net/wireless/broadcom/brcm80211/brcmfmac/bus.h | 10 ++
- .../wireless/broadcom/brcm80211/brcmfmac/common.c | 157 +++++++++++++++++++++
- .../wireless/broadcom/brcm80211/brcmfmac/core.c | 2 +
- .../wireless/broadcom/brcm80211/brcmfmac/core.h | 2 +
- .../broadcom/brcm80211/brcmfmac/fwil_types.h | 31 ++++
- .../wireless/broadcom/brcm80211/brcmfmac/pcie.c | 19 +++
- .../wireless/broadcom/brcm80211/brcmfmac/sdio.c | 19 +++
- .../net/wireless/broadcom/brcm80211/brcmfmac/usb.c | 18 +++
- 8 files changed, 258 insertions(+)
-
---- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/bus.h
-+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/bus.h
-@@ -71,6 +71,7 @@ struct brcmf_bus_dcmd {
- * @wowl_config: specify if dongle is configured for wowl when going to suspend
- * @get_ramsize: obtain size of device memory.
- * @get_memdump: obtain device memory dump in provided buffer.
-+ * @get_fwname: obtain firmware name.
- *
- * This structure provides an abstract interface towards the
- * bus specific driver. For control messages to common driver
-@@ -87,6 +88,8 @@ struct brcmf_bus_ops {
- void (*wowl_config)(struct device *dev, bool enabled);
- size_t (*get_ramsize)(struct device *dev);
- int (*get_memdump)(struct device *dev, void *data, size_t len);
-+ int (*get_fwname)(struct device *dev, uint chip, uint chiprev,
-+ unsigned char *fw_name);
- };
-
-
-@@ -224,6 +227,13 @@ int brcmf_bus_get_memdump(struct brcmf_b
- return bus->ops->get_memdump(bus->dev, data, len);
- }
-
-+static inline
-+int brcmf_bus_get_fwname(struct brcmf_bus *bus, uint chip, uint chiprev,
-+ unsigned char *fw_name)
-+{
-+ return bus->ops->get_fwname(bus->dev, chip, chiprev, fw_name);
-+}
-+
- /*
- * interface functions from common layer
- */
---- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/common.c
-+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/common.c
-@@ -18,6 +18,7 @@
- #include <linux/string.h>
- #include <linux/netdevice.h>
- #include <linux/module.h>
-+#include <linux/firmware.h>
- #include <brcmu_wifi.h>
- #include <brcmu_utils.h>
- #include "core.h"
-@@ -28,6 +29,7 @@
- #include "tracepoint.h"
- #include "common.h"
- #include "of.h"
-+#include "firmware.h"
-
- MODULE_AUTHOR("Broadcom Corporation");
- MODULE_DESCRIPTION("Broadcom 802.11 wireless LAN fullmac driver.");
-@@ -104,12 +106,140 @@ void brcmf_c_set_joinpref_default(struct
- brcmf_err("Set join_pref error (%d)\n", err);
- }
-
-+static int brcmf_c_download(struct brcmf_if *ifp, u16 flag,
-+ struct brcmf_dload_data_le *dload_buf,
-+ u32 len)
-+{
-+ s32 err;
-+
-+ flag |= (DLOAD_HANDLER_VER << DLOAD_FLAG_VER_SHIFT);
-+ dload_buf->flag = cpu_to_le16(flag);
-+ dload_buf->dload_type = cpu_to_le16(DL_TYPE_CLM);
-+ dload_buf->len = cpu_to_le32(len);
-+ dload_buf->crc = cpu_to_le32(0);
-+ len = sizeof(*dload_buf) + len - 1;
-+
-+ err = brcmf_fil_iovar_data_set(ifp, "clmload", dload_buf, len);
-+
-+ return err;
-+}
-+
-+static int brcmf_c_get_clm_name(struct brcmf_if *ifp, u8 *clm_name)
-+{
-+ struct brcmf_bus *bus = ifp->drvr->bus_if;
-+ struct brcmf_rev_info *ri = &ifp->drvr->revinfo;
-+ u8 fw_name[BRCMF_FW_NAME_LEN];
-+ u8 *ptr;
-+ size_t len;
-+ s32 err;
-+
-+ memset(fw_name, 0, BRCMF_FW_NAME_LEN);
-+ err = brcmf_bus_get_fwname(bus, ri->chipnum, ri->chiprev, fw_name);
-+ if (err) {
-+ brcmf_err("get firmware name failed (%d)\n", err);
-+ goto done;
-+ }
-+
-+ /* generate CLM blob file name */
-+ ptr = strrchr(fw_name, '.');
-+ if (!ptr) {
-+ err = -ENOENT;
-+ goto done;
-+ }
-+
-+ len = ptr - fw_name + 1;
-+ if (len + strlen(".clm_blob") > BRCMF_FW_NAME_LEN) {
-+ err = -E2BIG;
-+ } else {
-+ strlcpy(clm_name, fw_name, len);
-+ strlcat(clm_name, ".clm_blob", BRCMF_FW_NAME_LEN);
-+ }
-+done:
-+ return err;
-+}
-+
-+static int brcmf_c_process_clm_blob(struct brcmf_if *ifp)
-+{
-+ struct device *dev = ifp->drvr->bus_if->dev;
-+ struct brcmf_dload_data_le *chunk_buf;
-+ const struct firmware *clm = NULL;
-+ u8 clm_name[BRCMF_FW_NAME_LEN];
-+ u32 chunk_len;
-+ u32 datalen;
-+ u32 cumulative_len;
-+ u16 dl_flag = DL_BEGIN;
-+ u32 status;
-+ s32 err;
-+
-+ brcmf_dbg(TRACE, "Enter\n");
-+
-+ memset(clm_name, 0, BRCMF_FW_NAME_LEN);
-+ err = brcmf_c_get_clm_name(ifp, clm_name);
-+ if (err) {
-+ brcmf_err("get CLM blob file name failed (%d)\n", err);
-+ return err;
-+ }
-+
-+ err = request_firmware(&clm, clm_name, dev);
-+ if (err) {
-+ if (err == -ENOENT) {
-+ brcmf_dbg(INFO, "continue with CLM data currently present in firmware\n");
-+ return 0;
-+ }
-+ brcmf_err("request CLM blob file failed (%d)\n", err);
-+ return err;
-+ }
-+
-+ chunk_buf = kzalloc(sizeof(*chunk_buf) + MAX_CHUNK_LEN - 1, GFP_KERNEL);
-+ if (!chunk_buf) {
-+ err = -ENOMEM;
-+ goto done;
-+ }
-+
-+ datalen = clm->size;
-+ cumulative_len = 0;
-+ do {
-+ if (datalen > MAX_CHUNK_LEN) {
-+ chunk_len = MAX_CHUNK_LEN;
-+ } else {
-+ chunk_len = datalen;
-+ dl_flag |= DL_END;
-+ }
-+ memcpy(chunk_buf->data, clm->data + cumulative_len, chunk_len);
-+
-+ err = brcmf_c_download(ifp, dl_flag, chunk_buf, chunk_len);
-+
-+ dl_flag &= ~DL_BEGIN;
-+
-+ cumulative_len += chunk_len;
-+ datalen -= chunk_len;
-+ } while ((datalen > 0) && (err == 0));
-+
-+ if (err) {
-+ brcmf_err("clmload (%zu byte file) failed (%d); ",
-+ clm->size, err);
-+ /* Retrieve clmload_status and print */
-+ err = brcmf_fil_iovar_int_get(ifp, "clmload_status", &status);
-+ if (err)
-+ brcmf_err("get clmload_status failed (%d)\n", err);
-+ else
-+ brcmf_dbg(INFO, "clmload_status=%d\n", status);
-+ err = -EIO;
-+ }
-+
-+ kfree(chunk_buf);
-+done:
-+ release_firmware(clm);
-+ return err;
-+}
-+
- int brcmf_c_preinit_dcmds(struct brcmf_if *ifp)
- {
- s8 eventmask[BRCMF_EVENTING_MASK_LEN];
- u8 buf[BRCMF_DCMD_SMLEN];
- struct brcmf_rev_info_le revinfo;
- struct brcmf_rev_info *ri;
-+ char *clmver;
- char *ptr;
- s32 err;
-
-@@ -148,6 +278,13 @@ int brcmf_c_preinit_dcmds(struct brcmf_i
- }
- ri->result = err;
-
-+ /* Do any CLM downloading */
-+ err = brcmf_c_process_clm_blob(ifp);
-+ if (err < 0) {
-+ brcmf_err("download CLM blob file failed, %d\n", err);
-+ goto done;
-+ }
-+
- /* query for 'ver' to get version info from firmware */
- memset(buf, 0, sizeof(buf));
- strcpy(buf, "ver");
-@@ -167,6 +304,26 @@ int brcmf_c_preinit_dcmds(struct brcmf_i
- ptr = strrchr(buf, ' ') + 1;
- strlcpy(ifp->drvr->fwver, ptr, sizeof(ifp->drvr->fwver));
-
-+ /* Query for 'clmver' to get CLM version info from firmware */
-+ memset(buf, 0, sizeof(buf));
-+ err = brcmf_fil_iovar_data_get(ifp, "clmver", buf, sizeof(buf));
-+ if (err) {
-+ brcmf_dbg(TRACE, "retrieving clmver failed, %d\n", err);
-+ } else {
-+ clmver = (char *)buf;
-+ /* store CLM version for adding it to revinfo debugfs file */
-+ memcpy(ifp->drvr->clmver, clmver, sizeof(ifp->drvr->clmver));
-+
-+ /* Replace all newline/linefeed characters with space
-+ * character
-+ */
-+ ptr = clmver;
-+ while ((ptr = strnchr(ptr, '\n', sizeof(buf))) != NULL)
-+ *ptr = ' ';
-+
-+ brcmf_dbg(INFO, "CLM version = %s\n", clmver);
-+ }
-+
- /* set mpc */
- err = brcmf_fil_iovar_int_set(ifp, "mpc", 1);
- if (err) {
---- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/core.c
-+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/core.c
-@@ -1009,6 +1009,8 @@ static int brcmf_revinfo_read(struct seq
- seq_printf(s, "anarev: %u\n", ri->anarev);
- seq_printf(s, "nvramrev: %08x\n", ri->nvramrev);
-
-+ seq_printf(s, "clmver: %s\n", bus_if->drvr->clmver);
-+
- return 0;
- }
-
---- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/core.h
-+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/core.h
-@@ -141,6 +141,8 @@ struct brcmf_pub {
- struct notifier_block inetaddr_notifier;
- struct notifier_block inet6addr_notifier;
- struct brcmf_mp_device *settings;
-+
-+ u8 clmver[BRCMF_DCMD_SMLEN];
- };
-
- /* forward declarations */
---- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/fwil_types.h
-+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/fwil_types.h
-@@ -155,6 +155,21 @@
- #define BRCMF_MFP_CAPABLE 1
- #define BRCMF_MFP_REQUIRED 2
-
-+/* MAX_CHUNK_LEN is the maximum length for data passing to firmware in each
-+ * ioctl. It is relatively small because firmware has small maximum size input
-+ * playload restriction for ioctls.
-+ */
-+#define MAX_CHUNK_LEN 1400
-+
-+#define DLOAD_HANDLER_VER 1 /* Downloader version */
-+#define DLOAD_FLAG_VER_MASK 0xf000 /* Downloader version mask */
-+#define DLOAD_FLAG_VER_SHIFT 12 /* Downloader version shift */
-+
-+#define DL_BEGIN 0x0002
-+#define DL_END 0x0004
-+
-+#define DL_TYPE_CLM 2
-+
- /* join preference types for join_pref iovar */
- enum brcmf_join_pref_types {
- BRCMF_JOIN_PREF_RSSI = 1,
-@@ -827,6 +842,22 @@ struct brcmf_pno_macaddr_le {
- };
-
- /**
-+ * struct brcmf_dload_data_le - data passing to firmware for downloading
-+ * @flag: flags related to download data.
-+ * @dload_type: type of download data.
-+ * @len: length in bytes of download data.
-+ * @crc: crc of download data.
-+ * @data: download data.
-+ */
-+struct brcmf_dload_data_le {
-+ __le16 flag;
-+ __le16 dload_type;
-+ __le32 len;
-+ __le32 crc;
-+ u8 data[1];
-+};
-+
-+/**
- * struct brcmf_pno_bssid_le - bssid configuration for PNO scan.
- *
- * @bssid: BSS network identifier.
---- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/pcie.c
-+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/pcie.c
-@@ -1350,6 +1350,24 @@ static int brcmf_pcie_get_memdump(struct
- return 0;
- }
-
-+static int brcmf_pcie_get_fwname(struct device *dev, u32 chip, u32 chiprev,
-+ u8 *fw_name)
-+{
-+ struct brcmf_bus *bus_if = dev_get_drvdata(dev);
-+ struct brcmf_pciedev *buspub = bus_if->bus_priv.pcie;
-+ struct brcmf_pciedev_info *devinfo = buspub->devinfo;
-+ int ret = 0;
-+
-+ if (devinfo->fw_name[0] != '\0')
-+ strlcpy(fw_name, devinfo->fw_name, BRCMF_FW_NAME_LEN);
-+ else
-+ ret = brcmf_fw_map_chip_to_name(chip, chiprev,
-+ brcmf_pcie_fwnames,
-+ ARRAY_SIZE(brcmf_pcie_fwnames),
-+ fw_name, NULL);
-+
-+ return ret;
-+}
-
- static const struct brcmf_bus_ops brcmf_pcie_bus_ops = {
- .txdata = brcmf_pcie_tx,
-@@ -1359,6 +1377,7 @@ static const struct brcmf_bus_ops brcmf_
- .wowl_config = brcmf_pcie_wowl_config,
- .get_ramsize = brcmf_pcie_get_ramsize,
- .get_memdump = brcmf_pcie_get_memdump,
-+ .get_fwname = brcmf_pcie_get_fwname,
- };
-
-
---- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c
-+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c
-@@ -3985,6 +3985,24 @@ brcmf_sdio_watchdog(unsigned long data)
- }
- }
-
-+static int brcmf_sdio_get_fwname(struct device *dev, u32 chip, u32 chiprev,
-+ u8 *fw_name)
-+{
-+ struct brcmf_bus *bus_if = dev_get_drvdata(dev);
-+ struct brcmf_sdio_dev *sdiodev = bus_if->bus_priv.sdio;
-+ int ret = 0;
-+
-+ if (sdiodev->fw_name[0] != '\0')
-+ strlcpy(fw_name, sdiodev->fw_name, BRCMF_FW_NAME_LEN);
-+ else
-+ ret = brcmf_fw_map_chip_to_name(chip, chiprev,
-+ brcmf_sdio_fwnames,
-+ ARRAY_SIZE(brcmf_sdio_fwnames),
-+ fw_name, NULL);
-+
-+ return ret;
-+}
-+
- static const struct brcmf_bus_ops brcmf_sdio_bus_ops = {
- .stop = brcmf_sdio_bus_stop,
- .preinit = brcmf_sdio_bus_preinit,
-@@ -3995,6 +4013,7 @@ static const struct brcmf_bus_ops brcmf_
- .wowl_config = brcmf_sdio_wowl_config,
- .get_ramsize = brcmf_sdio_bus_get_ramsize,
- .get_memdump = brcmf_sdio_bus_get_memdump,
-+ .get_fwname = brcmf_sdio_get_fwname,
- };
-
- static void brcmf_sdio_firmware_callback(struct device *dev, int err,
---- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/usb.c
-+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/usb.c
-@@ -1128,12 +1128,30 @@ static void brcmf_usb_wowl_config(struct
- device_set_wakeup_enable(devinfo->dev, false);
- }
-
-+static int brcmf_usb_get_fwname(struct device *dev, u32 chip, u32 chiprev,
-+ u8 *fw_name)
-+{
-+ struct brcmf_usbdev_info *devinfo = brcmf_usb_get_businfo(dev);
-+ int ret = 0;
-+
-+ if (devinfo->fw_name[0] != '\0')
-+ strlcpy(fw_name, devinfo->fw_name, BRCMF_FW_NAME_LEN);
-+ else
-+ ret = brcmf_fw_map_chip_to_name(chip, chiprev,
-+ brcmf_usb_fwnames,
-+ ARRAY_SIZE(brcmf_usb_fwnames),
-+ fw_name, NULL);
-+
-+ return ret;
-+}
-+
- static const struct brcmf_bus_ops brcmf_usb_bus_ops = {
- .txdata = brcmf_usb_tx,
- .stop = brcmf_usb_down,
- .txctl = brcmf_usb_tx_ctlpkt,
- .rxctl = brcmf_usb_rx_ctlpkt,
- .wowl_config = brcmf_usb_wowl_config,
-+ .get_fwname = brcmf_usb_get_fwname,
- };
-
- static int brcmf_usb_bus_setup(struct brcmf_usbdev_info *devinfo)
diff --git a/package/kernel/mac80211/patches/305-v4.15-brcmfmac-change-driver-unbind-order-of-the-sdio-func.patch b/package/kernel/mac80211/patches/305-v4.15-brcmfmac-change-driver-unbind-order-of-the-sdio-func.patch
deleted file mode 100644
index 3649bdda49..0000000000
--- a/package/kernel/mac80211/patches/305-v4.15-brcmfmac-change-driver-unbind-order-of-the-sdio-func.patch
+++ /dev/null
@@ -1,37 +0,0 @@
-From 5c3de777bdaf48bd0cfb43097c0d0fb85056cab7 Mon Sep 17 00:00:00 2001
-From: Arend Van Spriel <arend.vanspriel@broadcom.com>
-Date: Sat, 25 Nov 2017 21:39:25 +0100
-Subject: [PATCH] brcmfmac: change driver unbind order of the sdio function
- devices
-
-In the function brcmf_sdio_firmware_callback() the driver is
-unbound from the sdio function devices in the error path.
-However, the order in which it is done resulted in a use-after-free
-issue (see brcmf_ops_sdio_remove() in bcmsdh.c). Hence change
-the order and first unbind sdio function #2 device and then
-unbind sdio function #1 device.
-
-Cc: stable@vger.kernel.org # v4.12.x
-Fixes: 7a51461fc2da ("brcmfmac: unbind all devices upon failure in firmware callback")
-Reported-by: Stefan Wahren <stefan.wahren@i2se.com>
-Reviewed-by: Hante Meuleman <hante.meuleman@broadcom.com>
-Reviewed-by: Pieter-Paul Giesberts <pieter-paul.giesberts@broadcom.com>
-Reviewed-by: Franky Lin <franky.lin@broadcom.com>
-Signed-off-by: Arend van Spriel <arend.vanspriel@broadcom.com>
-Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
----
- drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
---- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c
-+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c
-@@ -4121,8 +4121,8 @@ release:
- sdio_release_host(sdiodev->func[1]);
- fail:
- brcmf_dbg(TRACE, "failed: dev=%s, err=%d\n", dev_name(dev), err);
-- device_release_driver(dev);
- device_release_driver(&sdiodev->func[2]->dev);
-+ device_release_driver(dev);
- }
-
- struct brcmf_sdio *brcmf_sdio_probe(struct brcmf_sdio_dev *sdiodev)
diff --git a/package/kernel/mac80211/patches/306-v4.15-brcmfmac-Avoid-build-error-with-make-W-1.patch b/package/kernel/mac80211/patches/306-v4.15-brcmfmac-Avoid-build-error-with-make-W-1.patch
deleted file mode 100644
index 7344580d34..0000000000
--- a/package/kernel/mac80211/patches/306-v4.15-brcmfmac-Avoid-build-error-with-make-W-1.patch
+++ /dev/null
@@ -1,33 +0,0 @@
-From 51ef7925e10688c57186d438e784532e063492e4 Mon Sep 17 00:00:00 2001
-From: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
-Date: Thu, 23 Nov 2017 17:57:04 +0200
-Subject: [PATCH] brcmfmac: Avoid build error with make W=1
-
-When I run make W=1 on gcc (Debian 7.2.0-16) 7.2.0 I got an error for
-the first run, all next ones are okay.
-
- CC [M] drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.o
-drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c:2078: error: Cannot parse struct or union!
-scripts/Makefile.build:310: recipe for target 'drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.o' failed
-
-Seems like something happened with W=1 and wrong kernel doc format.
-As a quick fix remove dubious /** in the code.
-
-Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
-Acked-by: Arend van Spriel <arend.vanspriel@broadcom.com>
-Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
----
- drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
---- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c
-+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c
-@@ -2070,7 +2070,7 @@ static int brcmf_sdio_txpkt_hdalign(stru
- return head_pad;
- }
-
--/**
-+/*
- * struct brcmf_skbuff_cb reserves first two bytes in sk_buff::cb for
- * bus layer usage.
- */
diff --git a/package/kernel/mac80211/patches/307-v4.15-brcmfmac-fix-CLM-load-error-for-legacy-chips-when-us.patch b/package/kernel/mac80211/patches/307-v4.15-brcmfmac-fix-CLM-load-error-for-legacy-chips-when-us.patch
deleted file mode 100644
index ead5e72145..0000000000
--- a/package/kernel/mac80211/patches/307-v4.15-brcmfmac-fix-CLM-load-error-for-legacy-chips-when-us.patch
+++ /dev/null
@@ -1,40 +0,0 @@
-From cc124d5cc8d81985c3511892d7a6d546552ff754 Mon Sep 17 00:00:00 2001
-From: Wright Feng <wright.feng@cypress.com>
-Date: Tue, 16 Jan 2018 17:26:50 +0800
-Subject: [PATCH] brcmfmac: fix CLM load error for legacy chips when user
- helper is enabled
-
-For legacy chips without CLM blob files, kernel with user helper function
-returns -EAGAIN when we request_firmware(), and then driver got failed
-when bringing up legacy chips. We expect the CLM blob file for legacy chip
-is not existence in firmware path, but the -ENOENT error is transferred to
--EAGAIN in firmware_class.c with user helper.
-Because of that, we continue with CLM data currently present in firmware
-if getting error from doing request_firmware().
-
-Cc: stable@vger.kernel.org # v4.15.y
-Reviewed-by: Arend van Spriel <arend.vanspriel@broadcom.com>
-Signed-off-by: Wright Feng <wright.feng@cypress.com>
-Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
----
- drivers/net/wireless/broadcom/brcm80211/brcmfmac/common.c | 9 +++------
- 1 file changed, 3 insertions(+), 6 deletions(-)
-
---- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/common.c
-+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/common.c
-@@ -182,12 +182,9 @@ static int brcmf_c_process_clm_blob(stru
-
- err = request_firmware(&clm, clm_name, dev);
- if (err) {
-- if (err == -ENOENT) {
-- brcmf_dbg(INFO, "continue with CLM data currently present in firmware\n");
-- return 0;
-- }
-- brcmf_err("request CLM blob file failed (%d)\n", err);
-- return err;
-+ brcmf_info("no clm_blob available(err=%d), device may have limited channels available\n",
-+ err);
-+ return 0;
- }
-
- chunk_buf = kzalloc(sizeof(*chunk_buf) + MAX_CHUNK_LEN - 1, GFP_KERNEL);
diff --git a/package/kernel/mac80211/patches/308-v4.16-0001-ath9k-move-spectral-scan-support-under-a-separate-co.patch b/package/kernel/mac80211/patches/308-v4.16-0001-ath9k-move-spectral-scan-support-under-a-separate-co.patch
deleted file mode 100644
index 703051fe19..0000000000
--- a/package/kernel/mac80211/patches/308-v4.16-0001-ath9k-move-spectral-scan-support-under-a-separate-co.patch
+++ /dev/null
@@ -1,103 +0,0 @@
-From 9df7ddc3ed25b7d3473f117a0680b9418adb5753 Mon Sep 17 00:00:00 2001
-Message-Id: <9df7ddc3ed25b7d3473f117a0680b9418adb5753.1515610034.git.mschiffer@universe-factory.net>
-From: Matthias Schiffer <mschiffer@universe-factory.net>
-Date: Mon, 27 Nov 2017 18:56:22 +0100
-Subject: [PATCH 1/2] ath9k: move spectral scan support under a separate config
- symbol
-
-At the moment, spectral scan support, and with it RELAY, is always enabled
-with ATH9K[_HTC]_DEBUGFS. Spectral scan support is currently the only user
-of RELAY in ath9k, and it unconditionally reserves a relay channel.
-
-Having debugfs support in ath9k is often useful even on very small embedded
-routers, where we'd rather like to avoid the code size and RAM usage of the
-relay support.
-
-Signed-off-by: Matthias Schiffer <mschiffer@universe-factory.net>
-Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
----
- drivers/net/wireless/ath/ath9k/Kconfig | 14 ++++++++++----
- drivers/net/wireless/ath/ath9k/Makefile | 4 ++--
- drivers/net/wireless/ath/ath9k/common-spectral.h | 4 ++--
- 3 files changed, 14 insertions(+), 8 deletions(-)
-
---- a/drivers/net/wireless/ath/ath9k/Kconfig
-+++ b/drivers/net/wireless/ath/ath9k/Kconfig
-@@ -64,13 +64,12 @@ config ATH9K_DEBUGFS
- depends on ATH9K && DEBUG_FS
- select MAC80211_DEBUGFS
- select ATH9K_COMMON_DEBUG
-- depends on RELAY
- ---help---
- Say Y, if you need access to ath9k's statistics for
- interrupts, rate control, etc.
-
-- Also required for changing debug message flags at run time.
-- As well as access to the FFT/spectral data and TX99.
-+ Also required for changing debug message flags at run time and for
-+ TX99.
-
- config ATH9K_STATION_STATISTICS
- bool "Detailed station statistics"
-@@ -181,7 +180,6 @@ config ATH9K_HTC_DEBUGFS
- bool "Atheros ath9k_htc debugging"
- depends on ATH9K_HTC && DEBUG_FS
- select ATH9K_COMMON_DEBUG
-- depends on RELAY
- ---help---
- Say Y, if you need access to ath9k_htc's statistics.
- As well as access to the FFT/spectral data.
-@@ -197,3 +195,11 @@ config ATH9K_HWRNG
-
- Say Y, feeds the entropy directly from the WiFi driver to the input
- pool.
-+
-+config ATH9K_COMMON_SPECTRAL
-+ bool "Atheros ath9k/ath9k_htc spectral scan support"
-+ depends on ATH9K_DEBUGFS || ATH9K_HTC_DEBUGFS
-+ depends on RELAY
-+ default n
-+ ---help---
-+ Say Y to enable access to the FFT/spectral data via debugfs.
---- a/drivers/net/wireless/ath/ath9k/Makefile
-+++ b/drivers/net/wireless/ath/ath9k/Makefile
-@@ -61,8 +61,8 @@ ath9k_common-y:= common.o \
- common-init.o \
- common-beacon.o \
-
--ath9k_common-$(CPTCFG_ATH9K_COMMON_DEBUG) += common-debug.o \
-- common-spectral.o
-+ath9k_common-$(CPTCFG_ATH9K_COMMON_DEBUG) += common-debug.o
-+ath9k_common-$(CPTCFG_ATH9K_COMMON_SPECTRAL) += common-spectral.o
-
- ath9k_htc-y += htc_hst.o \
- hif_usb.o \
---- a/drivers/net/wireless/ath/ath9k/common-spectral.h
-+++ b/drivers/net/wireless/ath/ath9k/common-spectral.h
-@@ -151,7 +151,7 @@ static inline u8 spectral_bitmap_weight(
- return bins[0] & 0x3f;
- }
-
--#ifdef CPTCFG_ATH9K_COMMON_DEBUG
-+#ifdef CPTCFG_ATH9K_COMMON_SPECTRAL
- void ath9k_cmn_spectral_init_debug(struct ath_spec_scan_priv *spec_priv, struct dentry *debugfs_phy);
- void ath9k_cmn_spectral_deinit_debug(struct ath_spec_scan_priv *spec_priv);
-
-@@ -183,6 +183,6 @@ static inline int ath_cmn_process_fft(st
- {
- return 0;
- }
--#endif /* CPTCFG_ATH9K_COMMON_DEBUG */
-+#endif /* CPTCFG_ATH9K_COMMON_SPECTRAL */
-
- #endif /* SPECTRAL_H */
---- a/local-symbols
-+++ b/local-symbols
-@@ -116,6 +116,7 @@ ATH9K_PCOEM=
- ATH9K_HTC=
- ATH9K_HTC_DEBUGFS=
- ATH9K_HWRNG=
-+ATH9K_COMMON_SPECTRAL=
- CARL9170=
- CARL9170_LEDS=
- CARL9170_DEBUGFS=
diff --git a/package/kernel/mac80211/patches/309-v4.16-0002-ath10k-move-spectral-scan-support-under-a-separate-c.patch b/package/kernel/mac80211/patches/309-v4.16-0002-ath10k-move-spectral-scan-support-under-a-separate-c.patch
deleted file mode 100644
index 9eefdbce67..0000000000
--- a/package/kernel/mac80211/patches/309-v4.16-0002-ath10k-move-spectral-scan-support-under-a-separate-c.patch
+++ /dev/null
@@ -1,91 +0,0 @@
-From 42e01cb9cb109fb0bb4743f6c54d6aa67ac39b61 Mon Sep 17 00:00:00 2001
-Message-Id: <42e01cb9cb109fb0bb4743f6c54d6aa67ac39b61.1515610034.git.mschiffer@universe-factory.net>
-In-Reply-To: <9df7ddc3ed25b7d3473f117a0680b9418adb5753.1515610034.git.mschiffer@universe-factory.net>
-References: <9df7ddc3ed25b7d3473f117a0680b9418adb5753.1515610034.git.mschiffer@universe-factory.net>
-From: Matthias Schiffer <mschiffer@universe-factory.net>
-Date: Mon, 27 Nov 2017 18:56:23 +0100
-Subject: [PATCH 2/2] ath10k: move spectral scan support under a separate
- config symbol
-
-At the moment, spectral scan support, and with it RELAY, is always enabled
-with ATH10K_DEBUGFS. Spectral scan support is currently the only user of
-RELAY in ath10k, and it unconditionally reserves a relay channel.
-
-Having debugfs support in ath10k is often useful even on very small
-embedded routers, where we'd rather like to avoid the code size and RAM
-usage of the relay support. While ath10k-based devices usually have more
-resources than ath9k-based ones, it makes sense to keep the configuration
-symmetric to ath9k, so the same base kernel without RELAY can be used for
-both ath9k and ath10k hardware.
-
-Signed-off-by: Matthias Schiffer <mschiffer@universe-factory.net>
-Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
----
- drivers/net/wireless/ath/ath10k/Kconfig | 9 ++++++++-
- drivers/net/wireless/ath/ath10k/Makefile | 2 +-
- drivers/net/wireless/ath/ath10k/spectral.h | 4 ++--
- 3 files changed, 11 insertions(+), 4 deletions(-)
-
---- a/drivers/net/wireless/ath/ath10k/Kconfig
-+++ b/drivers/net/wireless/ath/ath10k/Kconfig
-@@ -51,12 +51,19 @@ config ATH10K_DEBUG
- config ATH10K_DEBUGFS
- bool "Atheros ath10k debugfs support"
- depends on ATH10K && DEBUG_FS
-- depends on RELAY
- ---help---
- Enabled debugfs support
-
- If unsure, say Y to make it easier to debug problems.
-
-+config ATH10K_SPECTRAL
-+ bool "Atheros ath10k spectral scan support"
-+ depends on ATH10K_DEBUGFS
-+ depends on RELAY
-+ default n
-+ ---help---
-+ Say Y to enable access to the FFT/spectral data via debugfs.
-+
- config ATH10K_TRACING
- depends on !KERNEL_3_4
- bool "Atheros ath10k tracing support"
---- a/drivers/net/wireless/ath/ath10k/Makefile
-+++ b/drivers/net/wireless/ath/ath10k/Makefile
-@@ -14,7 +14,7 @@ ath10k_core-y += mac.o \
- p2p.o \
- swap.o
-
--ath10k_core-$(CPTCFG_ATH10K_DEBUGFS) += spectral.o
-+ath10k_core-$(CPTCFG_ATH10K_SPECTRAL) += spectral.o
- ath10k_core-$(CPTCFG_NL80211_TESTMODE) += testmode.o
- ath10k_core-$(CPTCFG_ATH10K_TRACING) += trace.o
- ath10k_core-$(CPTCFG_ATH10K_THERMAL) += thermal.o
---- a/drivers/net/wireless/ath/ath10k/spectral.h
-+++ b/drivers/net/wireless/ath/ath10k/spectral.h
-@@ -44,7 +44,7 @@ enum ath10k_spectral_mode {
- SPECTRAL_MANUAL,
- };
-
--#ifdef CPTCFG_ATH10K_DEBUGFS
-+#ifdef CPTCFG_ATH10K_SPECTRAL
-
- int ath10k_spectral_process_fft(struct ath10k *ar,
- struct wmi_phyerr_ev_arg *phyerr,
-@@ -85,6 +85,6 @@ static inline void ath10k_spectral_destr
- {
- }
-
--#endif /* CPTCFG_ATH10K_DEBUGFS */
-+#endif /* CPTCFG_ATH10K_SPECTRAL */
-
- #endif /* SPECTRAL_H */
---- a/local-symbols
-+++ b/local-symbols
-@@ -140,6 +140,7 @@ ATH10K_SDIO=
- ATH10K_USB=
- ATH10K_DEBUG=
- ATH10K_DEBUGFS=
-+ATH10K_SPECTRAL=
- ATH10K_THERMAL=
- ATH10K_TRACING=
- ATH10K_DFS_CERTIFIED=
diff --git a/package/kernel/mac80211/patches/310-v4.16-ath9k-discard-undersized-packets.patch b/package/kernel/mac80211/patches/310-v4.16-ath9k-discard-undersized-packets.patch
deleted file mode 100644
index b2b2fcf4aa..0000000000
--- a/package/kernel/mac80211/patches/310-v4.16-ath9k-discard-undersized-packets.patch
+++ /dev/null
@@ -1,25 +0,0 @@
-From: Felix Fietkau <nbd@nbd.name>
-Date: Wed, 17 Jan 2018 11:11:17 +0100
-Subject: [PATCH] ath9k: discard undersized packets
-
-Sometimes the hardware will push small packets that trigger a WARN_ON
-in mac80211. Discard them early to avoid this issue.
-
-Reported-by: Stijn Tintel <stijn@linux-ipv6.be>
-Signed-off-by: Felix Fietkau <nbd@nbd.name>
----
-
---- a/drivers/net/wireless/ath/ath9k/recv.c
-+++ b/drivers/net/wireless/ath/ath9k/recv.c
-@@ -826,9 +826,9 @@ static int ath9k_rx_skb_preprocess(struc
- sc->rx.discard_next = false;
-
- /*
-- * Discard zero-length packets.
-+ * Discard zero-length packets and packets smaller than an ACK
- */
-- if (!rx_stats->rs_datalen) {
-+ if (rx_stats->rs_datalen < 10) {
- RX_STAT_INC(rx_len_err);
- goto corrupt;
- }
diff --git a/package/kernel/mac80211/patches/311-v4.16-0001-brcmfmac-Fix-parameter-order-in-brcmf_sdiod_f0_write.patch b/package/kernel/mac80211/patches/311-v4.16-0001-brcmfmac-Fix-parameter-order-in-brcmf_sdiod_f0_write.patch
deleted file mode 100644
index 616a82119f..0000000000
--- a/package/kernel/mac80211/patches/311-v4.16-0001-brcmfmac-Fix-parameter-order-in-brcmf_sdiod_f0_write.patch
+++ /dev/null
@@ -1,39 +0,0 @@
-From 1fd3ae124d5e675f57cf7e3c601fb8f7712e0329 Mon Sep 17 00:00:00 2001
-From: Ian Molton <ian@mnementh.co.uk>
-Date: Mon, 13 Nov 2017 21:35:38 +0100
-Subject: [PATCH] brcmfmac: Fix parameter order in brcmf_sdiod_f0_writeb()
-
-All the other IO functions are the other way round in this
-driver. Make this one match.
-
-Signed-off-by: Ian Molton <ian@mnementh.co.uk>
-Signed-off-by: Arend van Spriel <arend.vanspriel@broadcom.com>
-Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
----
- drivers/net/wireless/broadcom/brcm80211/brcmfmac/bcmsdh.c | 8 ++++----
- 1 file changed, 4 insertions(+), 4 deletions(-)
-
---- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/bcmsdh.c
-+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/bcmsdh.c
-@@ -230,8 +230,8 @@ void brcmf_sdiod_change_state(struct brc
- sdiodev->state = state;
- }
-
--static inline int brcmf_sdiod_f0_writeb(struct sdio_func *func,
-- uint regaddr, u8 byte)
-+static inline int brcmf_sdiod_f0_writeb(struct sdio_func *func, u8 byte,
-+ uint regaddr)
- {
- int err_ret;
-
-@@ -269,8 +269,8 @@ static int brcmf_sdiod_request_data(stru
- if (fn)
- sdio_writeb(func, *(u8 *)data, addr, &ret);
- else
-- ret = brcmf_sdiod_f0_writeb(func, addr,
-- *(u8 *)data);
-+ ret = brcmf_sdiod_f0_writeb(func, *(u8 *)data,
-+ addr);
- } else {
- if (fn)
- *(u8 *)data = sdio_readb(func, addr, &ret);
diff --git a/package/kernel/mac80211/patches/311-v4.16-0002-brcmfmac-Register-sizes-on-hardware-are-not-dependen.patch b/package/kernel/mac80211/patches/311-v4.16-0002-brcmfmac-Register-sizes-on-hardware-are-not-dependen.patch
deleted file mode 100644
index 719268f8fe..0000000000
--- a/package/kernel/mac80211/patches/311-v4.16-0002-brcmfmac-Register-sizes-on-hardware-are-not-dependen.patch
+++ /dev/null
@@ -1,105 +0,0 @@
-From 1e6f676f43aa4270ebc5cff8e32a55f72362e042 Mon Sep 17 00:00:00 2001
-From: Ian Molton <ian@mnementh.co.uk>
-Date: Mon, 13 Nov 2017 21:35:39 +0100
-Subject: [PATCH] brcmfmac: Register sizes on hardware are not dependent on
- compiler types
-
-The 4 IO functions in this patch are incorrect as they use compiler types
-to determine how many bytes to send to the hardware.
-
-Signed-off-by: Ian Molton <ian@mnementh.co.uk>
-Signed-off-by: Arend van Spriel <arend.vanspriel@broadcom.com>
-Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
----
- .../wireless/broadcom/brcm80211/brcmfmac/bcmsdh.c | 22 +++++++++++-----------
- 1 file changed, 11 insertions(+), 11 deletions(-)
-
---- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/bcmsdh.c
-+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/bcmsdh.c
-@@ -264,7 +264,7 @@ static int brcmf_sdiod_request_data(stru
- func = sdiodev->func[fn];
-
- switch (regsz) {
-- case sizeof(u8):
-+ case 1:
- if (write) {
- if (fn)
- sdio_writeb(func, *(u8 *)data, addr, &ret);
-@@ -278,13 +278,13 @@ static int brcmf_sdiod_request_data(stru
- *(u8 *)data = sdio_f0_readb(func, addr, &ret);
- }
- break;
-- case sizeof(u16):
-+ case 2:
- if (write)
- sdio_writew(func, *(u16 *)data, addr, &ret);
- else
- *(u16 *)data = sdio_readw(func, addr, &ret);
- break;
-- case sizeof(u32):
-+ case 4:
- if (write)
- sdio_writel(func, *(u32 *)data, addr, &ret);
- else
-@@ -368,7 +368,7 @@ brcmf_sdiod_set_sbaddr_window(struct brc
- for (i = 0; i < 3; i++) {
- err = brcmf_sdiod_regrw_helper(sdiodev,
- SBSDIO_FUNC1_SBADDRLOW + i,
-- sizeof(u8), &addr[i], true);
-+ 1, &addr[i], true);
- if (err) {
- brcmf_err("failed at addr: 0x%0x\n",
- SBSDIO_FUNC1_SBADDRLOW + i);
-@@ -407,7 +407,7 @@ u8 brcmf_sdiod_regrb(struct brcmf_sdio_d
- int retval;
-
- brcmf_dbg(SDIO, "addr:0x%08x\n", addr);
-- retval = brcmf_sdiod_regrw_helper(sdiodev, addr, sizeof(data), &data,
-+ retval = brcmf_sdiod_regrw_helper(sdiodev, addr, 1, &data,
- false);
- brcmf_dbg(SDIO, "data:0x%02x\n", data);
-
-@@ -423,10 +423,10 @@ u32 brcmf_sdiod_regrl(struct brcmf_sdio_
- int retval;
-
- brcmf_dbg(SDIO, "addr:0x%08x\n", addr);
-- retval = brcmf_sdiod_addrprep(sdiodev, sizeof(data), &addr);
-+ retval = brcmf_sdiod_addrprep(sdiodev, 4, &addr);
- if (retval)
- goto done;
-- retval = brcmf_sdiod_regrw_helper(sdiodev, addr, sizeof(data), &data,
-+ retval = brcmf_sdiod_regrw_helper(sdiodev, addr, 4, &data,
- false);
- brcmf_dbg(SDIO, "data:0x%08x\n", data);
-
-@@ -443,7 +443,7 @@ void brcmf_sdiod_regwb(struct brcmf_sdio
- int retval;
-
- brcmf_dbg(SDIO, "addr:0x%08x, data:0x%02x\n", addr, data);
-- retval = brcmf_sdiod_regrw_helper(sdiodev, addr, sizeof(data), &data,
-+ retval = brcmf_sdiod_regrw_helper(sdiodev, addr, 1, &data,
- true);
- if (ret)
- *ret = retval;
-@@ -455,10 +455,10 @@ void brcmf_sdiod_regwl(struct brcmf_sdio
- int retval;
-
- brcmf_dbg(SDIO, "addr:0x%08x, data:0x%08x\n", addr, data);
-- retval = brcmf_sdiod_addrprep(sdiodev, sizeof(data), &addr);
-+ retval = brcmf_sdiod_addrprep(sdiodev, 4, &addr);
- if (retval)
- goto done;
-- retval = brcmf_sdiod_regrw_helper(sdiodev, addr, sizeof(data), &data,
-+ retval = brcmf_sdiod_regrw_helper(sdiodev, addr, 4, &data,
- true);
-
- done:
-@@ -876,7 +876,7 @@ int brcmf_sdiod_abort(struct brcmf_sdio_
-
- /* issue abort cmd52 command through F0 */
- brcmf_sdiod_request_data(sdiodev, SDIO_FUNC_0, SDIO_CCCR_ABORT,
-- sizeof(t_func), &t_func, true);
-+ 1, &t_func, true);
-
- brcmf_dbg(SDIO, "Exit\n");
- return 0;
diff --git a/package/kernel/mac80211/patches/311-v4.16-0003-brcmfmac-Split-brcmf_sdiod_regrw_helper-up.patch b/package/kernel/mac80211/patches/311-v4.16-0003-brcmfmac-Split-brcmf_sdiod_regrw_helper-up.patch
deleted file mode 100644
index b04465ae4f..0000000000
--- a/package/kernel/mac80211/patches/311-v4.16-0003-brcmfmac-Split-brcmf_sdiod_regrw_helper-up.patch
+++ /dev/null
@@ -1,179 +0,0 @@
-From 0fcc9fe0048422d66bb906eaa73cc75e11ff7345 Mon Sep 17 00:00:00 2001
-From: Ian Molton <ian@mnementh.co.uk>
-Date: Mon, 13 Nov 2017 21:35:40 +0100
-Subject: [PATCH] brcmfmac: Split brcmf_sdiod_regrw_helper() up.
-
-This large function is concealing a LOT of obscure logic about
-how the hardware functions. Time to split it up.
-
-This first patch splits the function into two pieces - read and write,
-doing away with the rw flag in the process.
-
-Signed-off-by: Ian Molton <ian@mnementh.co.uk>
-Signed-off-by: Arend van Spriel <arend.vanspriel@broadcom.com>
-Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
----
- .../wireless/broadcom/brcm80211/brcmfmac/bcmsdh.c | 94 +++++++++++++++++-----
- 1 file changed, 73 insertions(+), 21 deletions(-)
-
---- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/bcmsdh.c
-+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/bcmsdh.c
-@@ -302,8 +302,8 @@ static int brcmf_sdiod_request_data(stru
- return ret;
- }
-
--static int brcmf_sdiod_regrw_helper(struct brcmf_sdio_dev *sdiodev, u32 addr,
-- u8 regsz, void *data, bool write)
-+static int brcmf_sdiod_reg_write(struct brcmf_sdio_dev *sdiodev, u32 addr,
-+ u8 regsz, void *data)
- {
- u8 func;
- s32 retry = 0;
-@@ -324,13 +324,66 @@ static int brcmf_sdiod_regrw_helper(stru
- func = SDIO_FUNC_1;
-
- do {
-- if (!write)
-- memset(data, 0, regsz);
- /* for retry wait for 1 ms till bus get settled down */
- if (retry)
- usleep_range(1000, 2000);
-+
-+ ret = brcmf_sdiod_request_data(sdiodev, func, addr, regsz,
-+ data, true);
-+
-+ } while (ret != 0 && ret != -ENOMEDIUM &&
-+ retry++ < SDIOH_API_ACCESS_RETRY_LIMIT);
-+
-+ if (ret == -ENOMEDIUM) {
-+ brcmf_sdiod_change_state(sdiodev, BRCMF_SDIOD_NOMEDIUM);
-+ } else if (ret != 0) {
-+ /*
-+ * SleepCSR register access can fail when
-+ * waking up the device so reduce this noise
-+ * in the logs.
-+ */
-+ if (addr != SBSDIO_FUNC1_SLEEPCSR)
-+ brcmf_err("failed to write data F%d@0x%05x, err: %d\n",
-+ func, addr, ret);
-+ else
-+ brcmf_dbg(SDIO, "failed to write data F%d@0x%05x, err: %d\n",
-+ func, addr, ret);
-+ }
-+
-+ return ret;
-+}
-+
-+static int brcmf_sdiod_reg_read(struct brcmf_sdio_dev *sdiodev, u32 addr,
-+ u8 regsz, void *data)
-+{
-+ u8 func;
-+ s32 retry = 0;
-+ int ret;
-+
-+ if (sdiodev->state == BRCMF_SDIOD_NOMEDIUM)
-+ return -ENOMEDIUM;
-+
-+ /*
-+ * figure out how to read the register based on address range
-+ * 0x00 ~ 0x7FF: function 0 CCCR and FBR
-+ * 0x10000 ~ 0x1FFFF: function 1 miscellaneous registers
-+ * The rest: function 1 silicon backplane core registers
-+ */
-+ if ((addr & ~REG_F0_REG_MASK) == 0)
-+ func = SDIO_FUNC_0;
-+ else
-+ func = SDIO_FUNC_1;
-+
-+ do {
-+ memset(data, 0, regsz);
-+
-+ /* for retry wait for 1 ms till bus get settled down */
-+ if (retry)
-+ usleep_range(1000, 2000);
-+
- ret = brcmf_sdiod_request_data(sdiodev, func, addr, regsz,
-- data, write);
-+ data, false);
-+
- } while (ret != 0 && ret != -ENOMEDIUM &&
- retry++ < SDIOH_API_ACCESS_RETRY_LIMIT);
-
-@@ -343,12 +396,13 @@ static int brcmf_sdiod_regrw_helper(stru
- * in the logs.
- */
- if (addr != SBSDIO_FUNC1_SLEEPCSR)
-- brcmf_err("failed to %s data F%d@0x%05x, err: %d\n",
-- write ? "write" : "read", func, addr, ret);
-+ brcmf_err("failed to read data F%d@0x%05x, err: %d\n",
-+ func, addr, ret);
- else
-- brcmf_dbg(SDIO, "failed to %s data F%d@0x%05x, err: %d\n",
-- write ? "write" : "read", func, addr, ret);
-+ brcmf_dbg(SDIO, "failed to read data F%d@0x%05x, err: %d\n",
-+ func, addr, ret);
- }
-+
- return ret;
- }
-
-@@ -366,13 +420,11 @@ brcmf_sdiod_set_sbaddr_window(struct brc
- addr[2] = (address >> 24) & SBSDIO_SBADDRHIGH_MASK;
-
- for (i = 0; i < 3; i++) {
-- err = brcmf_sdiod_regrw_helper(sdiodev,
-- SBSDIO_FUNC1_SBADDRLOW + i,
-- 1, &addr[i], true);
-+ brcmf_sdiod_regwb(sdiodev, SBSDIO_FUNC1_SBADDRLOW + i, addr[i],
-+ &err);
- if (err) {
- brcmf_err("failed at addr: 0x%0x\n",
- SBSDIO_FUNC1_SBADDRLOW + i);
-- break;
- }
- }
-
-@@ -407,8 +459,7 @@ u8 brcmf_sdiod_regrb(struct brcmf_sdio_d
- int retval;
-
- brcmf_dbg(SDIO, "addr:0x%08x\n", addr);
-- retval = brcmf_sdiod_regrw_helper(sdiodev, addr, 1, &data,
-- false);
-+ retval = brcmf_sdiod_reg_read(sdiodev, addr, 1, &data);
- brcmf_dbg(SDIO, "data:0x%02x\n", data);
-
- if (ret)
-@@ -426,8 +477,9 @@ u32 brcmf_sdiod_regrl(struct brcmf_sdio_
- retval = brcmf_sdiod_addrprep(sdiodev, 4, &addr);
- if (retval)
- goto done;
-- retval = brcmf_sdiod_regrw_helper(sdiodev, addr, 4, &data,
-- false);
-+
-+ retval = brcmf_sdiod_reg_read(sdiodev, addr, 4, &data);
-+
- brcmf_dbg(SDIO, "data:0x%08x\n", data);
-
- done:
-@@ -443,8 +495,8 @@ void brcmf_sdiod_regwb(struct brcmf_sdio
- int retval;
-
- brcmf_dbg(SDIO, "addr:0x%08x, data:0x%02x\n", addr, data);
-- retval = brcmf_sdiod_regrw_helper(sdiodev, addr, 1, &data,
-- true);
-+ retval = brcmf_sdiod_reg_write(sdiodev, addr, 1, &data);
-+
- if (ret)
- *ret = retval;
- }
-@@ -458,8 +510,8 @@ void brcmf_sdiod_regwl(struct brcmf_sdio
- retval = brcmf_sdiod_addrprep(sdiodev, 4, &addr);
- if (retval)
- goto done;
-- retval = brcmf_sdiod_regrw_helper(sdiodev, addr, 4, &data,
-- true);
-+
-+ retval = brcmf_sdiod_reg_write(sdiodev, addr, 4, &data);
-
- done:
- if (ret)
diff --git a/package/kernel/mac80211/patches/311-v4.16-0004-brcmfmac-Clean-up-brcmf_sdiod_set_sbaddr_window.patch b/package/kernel/mac80211/patches/311-v4.16-0004-brcmfmac-Clean-up-brcmf_sdiod_set_sbaddr_window.patch
deleted file mode 100644
index 1f0488a621..0000000000
--- a/package/kernel/mac80211/patches/311-v4.16-0004-brcmfmac-Clean-up-brcmf_sdiod_set_sbaddr_window.patch
+++ /dev/null
@@ -1,62 +0,0 @@
-From b9b0d290bc0c90a5a262bc89c9d995988ea98669 Mon Sep 17 00:00:00 2001
-From: Ian Molton <ian@mnementh.co.uk>
-Date: Mon, 13 Nov 2017 21:35:41 +0100
-Subject: [PATCH] brcmfmac: Clean up brcmf_sdiod_set_sbaddr_window()
-
-This function sets the address of the IO window used for
-SDIO accesses onto the backplane of the chip.
-
-It currently uses 3 separate masks despite the full mask being
-defined in the code already. Remove the separate masks and clean up.
-
-Signed-off-by: Ian Molton <ian@mnementh.co.uk>
-Signed-off-by: Arend van Spriel <arend.vanspriel@broadcom.com>
-Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
----
- .../net/wireless/broadcom/brcm80211/brcmfmac/bcmsdh.c | 17 +++++------------
- drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.h | 3 ---
- 2 files changed, 5 insertions(+), 15 deletions(-)
-
---- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/bcmsdh.c
-+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/bcmsdh.c
-@@ -410,23 +410,16 @@ static int
- brcmf_sdiod_set_sbaddr_window(struct brcmf_sdio_dev *sdiodev, u32 address)
- {
- int err = 0, i;
-- u8 addr[3];
-+ u32 addr;
-
- if (sdiodev->state == BRCMF_SDIOD_NOMEDIUM)
- return -ENOMEDIUM;
-
-- addr[0] = (address >> 8) & SBSDIO_SBADDRLOW_MASK;
-- addr[1] = (address >> 16) & SBSDIO_SBADDRMID_MASK;
-- addr[2] = (address >> 24) & SBSDIO_SBADDRHIGH_MASK;
-+ addr = (address & SBSDIO_SBWINDOW_MASK) >> 8;
-
-- for (i = 0; i < 3; i++) {
-- brcmf_sdiod_regwb(sdiodev, SBSDIO_FUNC1_SBADDRLOW + i, addr[i],
-- &err);
-- if (err) {
-- brcmf_err("failed at addr: 0x%0x\n",
-- SBSDIO_FUNC1_SBADDRLOW + i);
-- }
-- }
-+ for (i = 0 ; i < 3 && !err ; i++, addr >>= 8)
-+ brcmf_sdiod_regwb(sdiodev, SBSDIO_FUNC1_SBADDRLOW + i,
-+ addr & 0xff, &err);
-
- return err;
- }
---- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.h
-+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.h
-@@ -133,9 +133,6 @@
-
- /* valid bits in SBSDIO_FUNC1_SBADDRxxx regs */
-
--#define SBSDIO_SBADDRLOW_MASK 0x80 /* Valid bits in SBADDRLOW */
--#define SBSDIO_SBADDRMID_MASK 0xff /* Valid bits in SBADDRMID */
--#define SBSDIO_SBADDRHIGH_MASK 0xffU /* Valid bits in SBADDRHIGH */
- /* Address bits from SBADDR regs */
- #define SBSDIO_SBWINDOW_MASK 0xffff8000
-
diff --git a/package/kernel/mac80211/patches/311-v4.16-0005-brcmfmac-Remove-dead-IO-code.patch b/package/kernel/mac80211/patches/311-v4.16-0005-brcmfmac-Remove-dead-IO-code.patch
deleted file mode 100644
index 7d50ce923d..0000000000
--- a/package/kernel/mac80211/patches/311-v4.16-0005-brcmfmac-Remove-dead-IO-code.patch
+++ /dev/null
@@ -1,91 +0,0 @@
-From ea243e9077b3545f20d93884e91c50ac0719685a Mon Sep 17 00:00:00 2001
-From: Ian Molton <ian@mnementh.co.uk>
-Date: Mon, 13 Nov 2017 21:35:42 +0100
-Subject: [PATCH] brcmfmac: Remove dead IO code
-
-The value passed to brcmf_sdiod_addrprep() is *always* 4
-remove this parameter and the unused code to handle it.
-
-Signed-off-by: Ian Molton <ian@mnementh.co.uk>
-Signed-off-by: Arend van Spriel <arend.vanspriel@broadcom.com>
-Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
----
- .../net/wireless/broadcom/brcm80211/brcmfmac/bcmsdh.c | 18 ++++++++----------
- 1 file changed, 8 insertions(+), 10 deletions(-)
-
---- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/bcmsdh.c
-+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/bcmsdh.c
-@@ -425,7 +425,7 @@ brcmf_sdiod_set_sbaddr_window(struct brc
- }
-
- static int
--brcmf_sdiod_addrprep(struct brcmf_sdio_dev *sdiodev, uint width, u32 *addr)
-+brcmf_sdiod_addrprep(struct brcmf_sdio_dev *sdiodev, u32 *addr)
- {
- uint bar0 = *addr & ~SBSDIO_SB_OFT_ADDR_MASK;
- int err = 0;
-@@ -439,9 +439,7 @@ brcmf_sdiod_addrprep(struct brcmf_sdio_d
- }
-
- *addr &= SBSDIO_SB_OFT_ADDR_MASK;
--
-- if (width == 4)
-- *addr |= SBSDIO_SB_ACCESS_2_4B_FLAG;
-+ *addr |= SBSDIO_SB_ACCESS_2_4B_FLAG;
-
- return 0;
- }
-@@ -467,7 +465,7 @@ u32 brcmf_sdiod_regrl(struct brcmf_sdio_
- int retval;
-
- brcmf_dbg(SDIO, "addr:0x%08x\n", addr);
-- retval = brcmf_sdiod_addrprep(sdiodev, 4, &addr);
-+ retval = brcmf_sdiod_addrprep(sdiodev, &addr);
- if (retval)
- goto done;
-
-@@ -500,7 +498,7 @@ void brcmf_sdiod_regwl(struct brcmf_sdio
- int retval;
-
- brcmf_dbg(SDIO, "addr:0x%08x, data:0x%08x\n", addr, data);
-- retval = brcmf_sdiod_addrprep(sdiodev, 4, &addr);
-+ retval = brcmf_sdiod_addrprep(sdiodev, &addr);
- if (retval)
- goto done;
-
-@@ -736,7 +734,7 @@ int brcmf_sdiod_recv_pkt(struct brcmf_sd
-
- brcmf_dbg(SDIO, "addr = 0x%x, size = %d\n", addr, pkt->len);
-
-- err = brcmf_sdiod_addrprep(sdiodev, 4, &addr);
-+ err = brcmf_sdiod_addrprep(sdiodev, &addr);
- if (err)
- goto done;
-
-@@ -757,7 +755,7 @@ int brcmf_sdiod_recv_chain(struct brcmf_
- brcmf_dbg(SDIO, "addr = 0x%x, size = %d\n",
- addr, pktq->qlen);
-
-- err = brcmf_sdiod_addrprep(sdiodev, 4, &addr);
-+ err = brcmf_sdiod_addrprep(sdiodev, &addr);
- if (err)
- goto done;
-
-@@ -801,7 +799,7 @@ int brcmf_sdiod_send_buf(struct brcmf_sd
-
- memcpy(mypkt->data, buf, nbytes);
-
-- err = brcmf_sdiod_addrprep(sdiodev, 4, &addr);
-+ err = brcmf_sdiod_addrprep(sdiodev, &addr);
-
- if (!err)
- err = brcmf_sdiod_buffrw(sdiodev, SDIO_FUNC_2, true, addr,
-@@ -821,7 +819,7 @@ int brcmf_sdiod_send_pkt(struct brcmf_sd
-
- brcmf_dbg(SDIO, "addr = 0x%x, size = %d\n", addr, pktq->qlen);
-
-- err = brcmf_sdiod_addrprep(sdiodev, 4, &addr);
-+ err = brcmf_sdiod_addrprep(sdiodev, &addr);
- if (err)
- return err;
-
diff --git a/package/kernel/mac80211/patches/311-v4.16-0006-brcmfmac-Remove-bandaid-for-SleepCSR.patch b/package/kernel/mac80211/patches/311-v4.16-0006-brcmfmac-Remove-bandaid-for-SleepCSR.patch
deleted file mode 100644
index fef29fc715..0000000000
--- a/package/kernel/mac80211/patches/311-v4.16-0006-brcmfmac-Remove-bandaid-for-SleepCSR.patch
+++ /dev/null
@@ -1,61 +0,0 @@
-From 4a3338ba2a7421db2260159cca5a27bd2ee36d00 Mon Sep 17 00:00:00 2001
-From: Ian Molton <ian@mnementh.co.uk>
-Date: Mon, 13 Nov 2017 21:35:43 +0100
-Subject: [PATCH] brcmfmac: Remove bandaid for SleepCSR
-
-Register access code is not the place for band-aid fixes like this.
-If this is a genuine problem, it should be fixed further up in the driver
-stack.
-
-Signed-off-by: Ian Molton <ian@mnementh.co.uk>
-Signed-off-by: Arend van Spriel <arend.vanspriel@broadcom.com>
-Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
----
- .../wireless/broadcom/brcm80211/brcmfmac/bcmsdh.c | 28 +---------------------
- 1 file changed, 1 insertion(+), 27 deletions(-)
-
---- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/bcmsdh.c
-+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/bcmsdh.c
-@@ -334,21 +334,8 @@ static int brcmf_sdiod_reg_write(struct
- } while (ret != 0 && ret != -ENOMEDIUM &&
- retry++ < SDIOH_API_ACCESS_RETRY_LIMIT);
-
-- if (ret == -ENOMEDIUM) {
-+ if (ret == -ENOMEDIUM)
- brcmf_sdiod_change_state(sdiodev, BRCMF_SDIOD_NOMEDIUM);
-- } else if (ret != 0) {
-- /*
-- * SleepCSR register access can fail when
-- * waking up the device so reduce this noise
-- * in the logs.
-- */
-- if (addr != SBSDIO_FUNC1_SLEEPCSR)
-- brcmf_err("failed to write data F%d@0x%05x, err: %d\n",
-- func, addr, ret);
-- else
-- brcmf_dbg(SDIO, "failed to write data F%d@0x%05x, err: %d\n",
-- func, addr, ret);
-- }
-
- return ret;
- }
-@@ -389,19 +376,6 @@ static int brcmf_sdiod_reg_read(struct b
-
- if (ret == -ENOMEDIUM)
- brcmf_sdiod_change_state(sdiodev, BRCMF_SDIOD_NOMEDIUM);
-- else if (ret != 0) {
-- /*
-- * SleepCSR register access can fail when
-- * waking up the device so reduce this noise
-- * in the logs.
-- */
-- if (addr != SBSDIO_FUNC1_SLEEPCSR)
-- brcmf_err("failed to read data F%d@0x%05x, err: %d\n",
-- func, addr, ret);
-- else
-- brcmf_dbg(SDIO, "failed to read data F%d@0x%05x, err: %d\n",
-- func, addr, ret);
-- }
-
- return ret;
- }
diff --git a/package/kernel/mac80211/patches/311-v4.16-0007-brcmfmac-Remove-brcmf_sdiod_request_data.patch b/package/kernel/mac80211/patches/311-v4.16-0007-brcmfmac-Remove-brcmf_sdiod_request_data.patch
deleted file mode 100644
index 552f9fb443..0000000000
--- a/package/kernel/mac80211/patches/311-v4.16-0007-brcmfmac-Remove-brcmf_sdiod_request_data.patch
+++ /dev/null
@@ -1,344 +0,0 @@
-From 993a98a42e6e790fd0d2bf7d55a031513c7ba7dc Mon Sep 17 00:00:00 2001
-From: Ian Molton <ian@mnementh.co.uk>
-Date: Mon, 13 Nov 2017 21:35:44 +0100
-Subject: [PATCH] brcmfmac: Remove brcmf_sdiod_request_data()
-
-This function is obfuscating how IO works on this chip. Remove it
-and push its logic into brcmf_sdiod_reg_{read,write}().
-
-Handling of -ENOMEDIUM is altered, but as that's pretty much broken anyway
-we can ignore that.
-
-Signed-off-by: Ian Molton <ian@mnementh.co.uk>
-Signed-off-by: Arend van Spriel <arend.vanspriel@broadcom.com>
-Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
----
- .../wireless/broadcom/brcm80211/brcmfmac/bcmsdh.c | 237 ++++++++-------------
- .../wireless/broadcom/brcm80211/brcmfmac/sdio.h | 2 +-
- 2 files changed, 87 insertions(+), 152 deletions(-)
-
---- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/bcmsdh.c
-+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/bcmsdh.c
-@@ -230,6 +230,43 @@ void brcmf_sdiod_change_state(struct brc
- sdiodev->state = state;
- }
-
-+static int brcmf_sdiod_set_sbaddr_window(struct brcmf_sdio_dev *sdiodev,
-+ u32 address)
-+{
-+ int err = 0, i;
-+ u32 addr;
-+
-+ if (sdiodev->state == BRCMF_SDIOD_NOMEDIUM)
-+ return -ENOMEDIUM;
-+
-+ addr = (address & SBSDIO_SBWINDOW_MASK) >> 8;
-+
-+ for (i = 0 ; i < 3 && !err ; i++, addr >>= 8)
-+ brcmf_sdiod_regwb(sdiodev, SBSDIO_FUNC1_SBADDRLOW + i,
-+ addr & 0xff, &err);
-+
-+ return err;
-+}
-+
-+static int brcmf_sdiod_addrprep(struct brcmf_sdio_dev *sdiodev, u32 *addr)
-+{
-+ uint bar0 = *addr & ~SBSDIO_SB_OFT_ADDR_MASK;
-+ int err = 0;
-+
-+ if (bar0 != sdiodev->sbwad) {
-+ err = brcmf_sdiod_set_sbaddr_window(sdiodev, bar0);
-+ if (err)
-+ return err;
-+
-+ sdiodev->sbwad = bar0;
-+ }
-+
-+ *addr &= SBSDIO_SB_OFT_ADDR_MASK;
-+ *addr |= SBSDIO_SB_ACCESS_2_4B_FLAG;
-+
-+ return 0;
-+}
-+
- static inline int brcmf_sdiod_f0_writeb(struct sdio_func *func, u8 byte,
- uint regaddr)
- {
-@@ -249,173 +286,84 @@ static inline int brcmf_sdiod_f0_writeb(
- return err_ret;
- }
-
--static int brcmf_sdiod_request_data(struct brcmf_sdio_dev *sdiodev, u8 fn,
-- u32 addr, u8 regsz, void *data, bool write)
--{
-- struct sdio_func *func;
-- int ret = -EINVAL;
--
-- brcmf_dbg(SDIO, "rw=%d, func=%d, addr=0x%05x, nbytes=%d\n",
-- write, fn, addr, regsz);
--
-- /* only allow byte access on F0 */
-- if (WARN_ON(regsz > 1 && !fn))
-- return -EINVAL;
-- func = sdiodev->func[fn];
--
-- switch (regsz) {
-- case 1:
-- if (write) {
-- if (fn)
-- sdio_writeb(func, *(u8 *)data, addr, &ret);
-- else
-- ret = brcmf_sdiod_f0_writeb(func, *(u8 *)data,
-- addr);
-- } else {
-- if (fn)
-- *(u8 *)data = sdio_readb(func, addr, &ret);
-- else
-- *(u8 *)data = sdio_f0_readb(func, addr, &ret);
-- }
-- break;
-- case 2:
-- if (write)
-- sdio_writew(func, *(u16 *)data, addr, &ret);
-- else
-- *(u16 *)data = sdio_readw(func, addr, &ret);
-- break;
-- case 4:
-- if (write)
-- sdio_writel(func, *(u32 *)data, addr, &ret);
-- else
-- *(u32 *)data = sdio_readl(func, addr, &ret);
-- break;
-- default:
-- brcmf_err("invalid size: %d\n", regsz);
-- break;
-- }
--
-- if (ret)
-- brcmf_dbg(SDIO, "failed to %s data F%d@0x%05x, err: %d\n",
-- write ? "write" : "read", fn, addr, ret);
--
-- return ret;
--}
--
- static int brcmf_sdiod_reg_write(struct brcmf_sdio_dev *sdiodev, u32 addr,
- u8 regsz, void *data)
- {
-- u8 func;
-- s32 retry = 0;
- int ret;
-
-- if (sdiodev->state == BRCMF_SDIOD_NOMEDIUM)
-- return -ENOMEDIUM;
--
- /*
- * figure out how to read the register based on address range
- * 0x00 ~ 0x7FF: function 0 CCCR and FBR
- * 0x10000 ~ 0x1FFFF: function 1 miscellaneous registers
- * The rest: function 1 silicon backplane core registers
-+ * f0 writes must be bytewise
- */
-- if ((addr & ~REG_F0_REG_MASK) == 0)
-- func = SDIO_FUNC_0;
-- else
-- func = SDIO_FUNC_1;
--
-- do {
-- /* for retry wait for 1 ms till bus get settled down */
-- if (retry)
-- usleep_range(1000, 2000);
-
-- ret = brcmf_sdiod_request_data(sdiodev, func, addr, regsz,
-- data, true);
--
-- } while (ret != 0 && ret != -ENOMEDIUM &&
-- retry++ < SDIOH_API_ACCESS_RETRY_LIMIT);
-+ if ((addr & ~REG_F0_REG_MASK) == 0) {
-+ if (WARN_ON(regsz > 1))
-+ return -EINVAL;
-+ ret = brcmf_sdiod_f0_writeb(sdiodev->func[0],
-+ *(u8 *)data, addr);
-+ } else {
-+ switch (regsz) {
-+ case 1:
-+ sdio_writeb(sdiodev->func[1], *(u8 *)data, addr, &ret);
-+ break;
-+ case 4:
-+ ret = brcmf_sdiod_addrprep(sdiodev, &addr);
-+ if (ret)
-+ goto done;
-
-- if (ret == -ENOMEDIUM)
-- brcmf_sdiod_change_state(sdiodev, BRCMF_SDIOD_NOMEDIUM);
-+ sdio_writel(sdiodev->func[1], *(u32 *)data, addr, &ret);
-+ break;
-+ default:
-+ WARN(1, "Invalid reg size\n");
-+ ret = -EINVAL;
-+ break;
-+ }
-+ }
-
-+done:
- return ret;
- }
-
- static int brcmf_sdiod_reg_read(struct brcmf_sdio_dev *sdiodev, u32 addr,
- u8 regsz, void *data)
- {
-- u8 func;
-- s32 retry = 0;
- int ret;
-
-- if (sdiodev->state == BRCMF_SDIOD_NOMEDIUM)
-- return -ENOMEDIUM;
--
- /*
- * figure out how to read the register based on address range
- * 0x00 ~ 0x7FF: function 0 CCCR and FBR
- * 0x10000 ~ 0x1FFFF: function 1 miscellaneous registers
- * The rest: function 1 silicon backplane core registers
-+ * f0 reads must be bytewise
- */
-- if ((addr & ~REG_F0_REG_MASK) == 0)
-- func = SDIO_FUNC_0;
-- else
-- func = SDIO_FUNC_1;
--
-- do {
-- memset(data, 0, regsz);
--
-- /* for retry wait for 1 ms till bus get settled down */
-- if (retry)
-- usleep_range(1000, 2000);
--
-- ret = brcmf_sdiod_request_data(sdiodev, func, addr, regsz,
-- data, false);
--
-- } while (ret != 0 && ret != -ENOMEDIUM &&
-- retry++ < SDIOH_API_ACCESS_RETRY_LIMIT);
--
-- if (ret == -ENOMEDIUM)
-- brcmf_sdiod_change_state(sdiodev, BRCMF_SDIOD_NOMEDIUM);
--
-- return ret;
--}
--
--static int
--brcmf_sdiod_set_sbaddr_window(struct brcmf_sdio_dev *sdiodev, u32 address)
--{
-- int err = 0, i;
-- u32 addr;
--
-- if (sdiodev->state == BRCMF_SDIOD_NOMEDIUM)
-- return -ENOMEDIUM;
--
-- addr = (address & SBSDIO_SBWINDOW_MASK) >> 8;
--
-- for (i = 0 ; i < 3 && !err ; i++, addr >>= 8)
-- brcmf_sdiod_regwb(sdiodev, SBSDIO_FUNC1_SBADDRLOW + i,
-- addr & 0xff, &err);
--
-- return err;
--}
--
--static int
--brcmf_sdiod_addrprep(struct brcmf_sdio_dev *sdiodev, u32 *addr)
--{
-- uint bar0 = *addr & ~SBSDIO_SB_OFT_ADDR_MASK;
-- int err = 0;
--
-- if (bar0 != sdiodev->sbwad) {
-- err = brcmf_sdiod_set_sbaddr_window(sdiodev, bar0);
-- if (err)
-- return err;
-+ if ((addr & ~REG_F0_REG_MASK) == 0) {
-+ if (WARN_ON(regsz > 1))
-+ return -EINVAL;
-+ *(u8 *)data = sdio_f0_readb(sdiodev->func[0], addr, &ret);
-+ } else {
-+ switch (regsz) {
-+ case 1:
-+ *(u8 *)data = sdio_readb(sdiodev->func[1], addr, &ret);
-+ break;
-+ case 4:
-+ ret = brcmf_sdiod_addrprep(sdiodev, &addr);
-+ if (ret)
-+ goto done;
-
-- sdiodev->sbwad = bar0;
-+ *(u32 *)data = sdio_readl(sdiodev->func[1], addr, &ret);
-+ break;
-+ default:
-+ WARN(1, "Invalid reg size\n");
-+ ret = -EINVAL;
-+ break;
-+ }
- }
-
-- *addr &= SBSDIO_SB_OFT_ADDR_MASK;
-- *addr |= SBSDIO_SB_ACCESS_2_4B_FLAG;
--
-- return 0;
-+done:
-+ return ret;
- }
-
- u8 brcmf_sdiod_regrb(struct brcmf_sdio_dev *sdiodev, u32 addr, int *ret)
-@@ -439,15 +387,9 @@ u32 brcmf_sdiod_regrl(struct brcmf_sdio_
- int retval;
-
- brcmf_dbg(SDIO, "addr:0x%08x\n", addr);
-- retval = brcmf_sdiod_addrprep(sdiodev, &addr);
-- if (retval)
-- goto done;
--
- retval = brcmf_sdiod_reg_read(sdiodev, addr, 4, &data);
--
- brcmf_dbg(SDIO, "data:0x%08x\n", data);
-
--done:
- if (ret)
- *ret = retval;
-
-@@ -472,13 +414,8 @@ void brcmf_sdiod_regwl(struct brcmf_sdio
- int retval;
-
- brcmf_dbg(SDIO, "addr:0x%08x, data:0x%08x\n", addr, data);
-- retval = brcmf_sdiod_addrprep(sdiodev, &addr);
-- if (retval)
-- goto done;
--
- retval = brcmf_sdiod_reg_write(sdiodev, addr, 4, &data);
-
--done:
- if (ret)
- *ret = retval;
- }
-@@ -886,14 +823,12 @@ brcmf_sdiod_ramrw(struct brcmf_sdio_dev
- return bcmerror;
- }
-
--int brcmf_sdiod_abort(struct brcmf_sdio_dev *sdiodev, uint fn)
-+int brcmf_sdiod_abort(struct brcmf_sdio_dev *sdiodev, u8 fn)
- {
-- char t_func = (char)fn;
- brcmf_dbg(SDIO, "Enter\n");
-
- /* issue abort cmd52 command through F0 */
-- brcmf_sdiod_request_data(sdiodev, SDIO_FUNC_0, SDIO_CCCR_ABORT,
-- 1, &t_func, true);
-+ brcmf_sdiod_reg_write(sdiodev, SDIO_CCCR_ABORT, 1, &fn);
-
- brcmf_dbg(SDIO, "Exit\n");
- return 0;
---- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.h
-+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.h
-@@ -339,7 +339,7 @@ int brcmf_sdiod_ramrw(struct brcmf_sdio_
- u8 *data, uint size);
-
- /* Issue an abort to the specified function */
--int brcmf_sdiod_abort(struct brcmf_sdio_dev *sdiodev, uint fn);
-+int brcmf_sdiod_abort(struct brcmf_sdio_dev *sdiodev, u8 fn);
- void brcmf_sdiod_sgtable_alloc(struct brcmf_sdio_dev *sdiodev);
- void brcmf_sdiod_change_state(struct brcmf_sdio_dev *sdiodev,
- enum brcmf_sdiod_state state);
diff --git a/package/kernel/mac80211/patches/311-v4.16-0008-brcmfmac-Fix-asymmetric-IO-functions.patch b/package/kernel/mac80211/patches/311-v4.16-0008-brcmfmac-Fix-asymmetric-IO-functions.patch
deleted file mode 100644
index bcf59722b2..0000000000
--- a/package/kernel/mac80211/patches/311-v4.16-0008-brcmfmac-Fix-asymmetric-IO-functions.patch
+++ /dev/null
@@ -1,28 +0,0 @@
-From 3508a056a1f45d95c874fc9af8748bf4229432b6 Mon Sep 17 00:00:00 2001
-From: Ian Molton <ian@mnementh.co.uk>
-Date: Mon, 13 Nov 2017 21:35:45 +0100
-Subject: [PATCH] brcmfmac: Fix asymmetric IO functions.
-
-Unlikely to be a problem, but brcmf_sdiod_regrl() is
-not symmetric with brcmf_sdiod_regrb() in initializing
-the data value on stack. Fix that.
-
-Signed-off-by: Ian Molton <ian@mnementh.co.uk>
-[arend: reword the commit message a bit]
-Signed-off-by: Arend van Spriel <arend.vanspriel@broadcom.com>
-Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
----
- drivers/net/wireless/broadcom/brcm80211/brcmfmac/bcmsdh.c | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
---- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/bcmsdh.c
-+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/bcmsdh.c
-@@ -383,7 +383,7 @@ u8 brcmf_sdiod_regrb(struct brcmf_sdio_d
-
- u32 brcmf_sdiod_regrl(struct brcmf_sdio_dev *sdiodev, u32 addr, int *ret)
- {
-- u32 data = 0;
-+ u32 data;
- int retval;
-
- brcmf_dbg(SDIO, "addr:0x%08x\n", addr);
diff --git a/package/kernel/mac80211/patches/311-v4.16-0009-brcmfmac-Remove-noisy-debugging.patch b/package/kernel/mac80211/patches/311-v4.16-0009-brcmfmac-Remove-noisy-debugging.patch
deleted file mode 100644
index 9a570450a7..0000000000
--- a/package/kernel/mac80211/patches/311-v4.16-0009-brcmfmac-Remove-noisy-debugging.patch
+++ /dev/null
@@ -1,53 +0,0 @@
-From 12e3e74e2820e11d91ee44fd3a190cd80d109faa Mon Sep 17 00:00:00 2001
-From: Ian Molton <ian@mnementh.co.uk>
-Date: Mon, 13 Nov 2017 21:35:46 +0100
-Subject: [PATCH] brcmfmac: Remove noisy debugging.
-
-If you need debugging this low level, you're doing something wrong.
-Remove these noisy debug statements so the code is more readable.
-
-Signed-off-by: Ian Molton <ian@mnementh.co.uk>
-Signed-off-by: Arend van Spriel <arend.vanspriel@broadcom.com>
-Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
----
- drivers/net/wireless/broadcom/brcm80211/brcmfmac/bcmsdh.c | 6 ------
- 1 file changed, 6 deletions(-)
-
---- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/bcmsdh.c
-+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/bcmsdh.c
-@@ -371,9 +371,7 @@ u8 brcmf_sdiod_regrb(struct brcmf_sdio_d
- u8 data;
- int retval;
-
-- brcmf_dbg(SDIO, "addr:0x%08x\n", addr);
- retval = brcmf_sdiod_reg_read(sdiodev, addr, 1, &data);
-- brcmf_dbg(SDIO, "data:0x%02x\n", data);
-
- if (ret)
- *ret = retval;
-@@ -386,9 +384,7 @@ u32 brcmf_sdiod_regrl(struct brcmf_sdio_
- u32 data;
- int retval;
-
-- brcmf_dbg(SDIO, "addr:0x%08x\n", addr);
- retval = brcmf_sdiod_reg_read(sdiodev, addr, 4, &data);
-- brcmf_dbg(SDIO, "data:0x%08x\n", data);
-
- if (ret)
- *ret = retval;
-@@ -401,7 +397,6 @@ void brcmf_sdiod_regwb(struct brcmf_sdio
- {
- int retval;
-
-- brcmf_dbg(SDIO, "addr:0x%08x, data:0x%02x\n", addr, data);
- retval = brcmf_sdiod_reg_write(sdiodev, addr, 1, &data);
-
- if (ret)
-@@ -413,7 +408,6 @@ void brcmf_sdiod_regwl(struct brcmf_sdio
- {
- int retval;
-
-- brcmf_dbg(SDIO, "addr:0x%08x, data:0x%08x\n", addr, data);
- retval = brcmf_sdiod_reg_write(sdiodev, addr, 4, &data);
-
- if (ret)
diff --git a/package/kernel/mac80211/patches/311-v4.16-0010-brcmfmac-Rename-bcmerror-to-err.patch b/package/kernel/mac80211/patches/311-v4.16-0010-brcmfmac-Rename-bcmerror-to-err.patch
deleted file mode 100644
index dd153fe6cc..0000000000
--- a/package/kernel/mac80211/patches/311-v4.16-0010-brcmfmac-Rename-bcmerror-to-err.patch
+++ /dev/null
@@ -1,58 +0,0 @@
-From dd8a2d49e4ed321ab8e7b679499c3a98ccc5ca24 Mon Sep 17 00:00:00 2001
-From: Ian Molton <ian@mnementh.co.uk>
-Date: Mon, 13 Nov 2017 21:35:47 +0100
-Subject: [PATCH] brcmfmac: Rename bcmerror to err
-
-Trivial cleanup of nasty variable name
-
-Signed-off-by: Ian Molton <ian@mnementh.co.uk>
-Signed-off-by: Arend van Spriel <arend.vanspriel@broadcom.com>
-Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
----
- drivers/net/wireless/broadcom/brcm80211/brcmfmac/bcmsdh.c | 14 +++++++-------
- 1 file changed, 7 insertions(+), 7 deletions(-)
-
---- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/bcmsdh.c
-+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/bcmsdh.c
-@@ -746,7 +746,7 @@ int
- brcmf_sdiod_ramrw(struct brcmf_sdio_dev *sdiodev, bool write, u32 address,
- u8 *data, uint size)
- {
-- int bcmerror = 0;
-+ int err = 0;
- struct sk_buff *pkt;
- u32 sdaddr;
- uint dsize;
-@@ -771,8 +771,8 @@ brcmf_sdiod_ramrw(struct brcmf_sdio_dev
- /* Do the transfer(s) */
- while (size) {
- /* Set the backplane window to include the start address */
-- bcmerror = brcmf_sdiod_set_sbaddr_window(sdiodev, address);
-- if (bcmerror)
-+ err = brcmf_sdiod_set_sbaddr_window(sdiodev, address);
-+ if (err)
- break;
-
- brcmf_dbg(SDIO, "%s %d bytes at offset 0x%08x in window 0x%08x\n",
-@@ -785,9 +785,9 @@ brcmf_sdiod_ramrw(struct brcmf_sdio_dev
- skb_put(pkt, dsize);
- if (write)
- memcpy(pkt->data, data, dsize);
-- bcmerror = brcmf_sdiod_buffrw(sdiodev, SDIO_FUNC_1, write,
-- sdaddr, pkt);
-- if (bcmerror) {
-+ err = brcmf_sdiod_buffrw(sdiodev, SDIO_FUNC_1, write, sdaddr,
-+ pkt);
-+ if (err) {
- brcmf_err("membytes transfer failed\n");
- break;
- }
-@@ -814,7 +814,7 @@ brcmf_sdiod_ramrw(struct brcmf_sdio_dev
-
- sdio_release_host(sdiodev->func[1]);
-
-- return bcmerror;
-+ return err;
- }
-
- int brcmf_sdiod_abort(struct brcmf_sdio_dev *sdiodev, u8 fn)
diff --git a/package/kernel/mac80211/patches/312-v4.16-0001-brcmfmac-Split-brcmf_sdiod_buffrw-function-up.patch b/package/kernel/mac80211/patches/312-v4.16-0001-brcmfmac-Split-brcmf_sdiod_buffrw-function-up.patch
deleted file mode 100644
index c260b96550..0000000000
--- a/package/kernel/mac80211/patches/312-v4.16-0001-brcmfmac-Split-brcmf_sdiod_buffrw-function-up.patch
+++ /dev/null
@@ -1,143 +0,0 @@
-From 8f13c87ccc495e30de5f58bbda967f6edd5bec53 Mon Sep 17 00:00:00 2001
-From: Ian Molton <ian@mnementh.co.uk>
-Date: Fri, 8 Dec 2017 13:10:26 +0100
-Subject: [PATCH] brcmfmac: Split brcmf_sdiod_buffrw function up.
-
-This function needs to be split up into separate read / write variants
-for clarity.
-
-Signed-off-by: Ian Molton <ian@mnementh.co.uk>
-Reviewed-by: Arend van Spriel <arend.vanspriel@broadcom.com>
-Signed-off-by: Arend van Spriel <arend.vanspriel@broadcom.com>
-Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
----
- .../wireless/broadcom/brcm80211/brcmfmac/bcmsdh.c | 67 +++++++++++++++-------
- 1 file changed, 45 insertions(+), 22 deletions(-)
-
---- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/bcmsdh.c
-+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/bcmsdh.c
-@@ -414,8 +414,8 @@ void brcmf_sdiod_regwl(struct brcmf_sdio
- *ret = retval;
- }
-
--static int brcmf_sdiod_buffrw(struct brcmf_sdio_dev *sdiodev, uint fn,
-- bool write, u32 addr, struct sk_buff *pkt)
-+static int brcmf_sdiod_buff_read(struct brcmf_sdio_dev *sdiodev, uint fn,
-+ u32 addr, struct sk_buff *pkt)
- {
- unsigned int req_sz;
- int err;
-@@ -424,18 +424,36 @@ static int brcmf_sdiod_buffrw(struct brc
- req_sz = pkt->len + 3;
- req_sz &= (uint)~3;
-
-- if (write)
-- err = sdio_memcpy_toio(sdiodev->func[fn], addr,
-- ((u8 *)(pkt->data)), req_sz);
-- else if (fn == 1)
-- err = sdio_memcpy_fromio(sdiodev->func[fn], ((u8 *)(pkt->data)),
-- addr, req_sz);
-+ if (fn == 1)
-+ err = sdio_memcpy_fromio(sdiodev->func[fn],
-+ ((u8 *)(pkt->data)), addr, req_sz);
- else
- /* function 2 read is FIFO operation */
-- err = sdio_readsb(sdiodev->func[fn], ((u8 *)(pkt->data)), addr,
-- req_sz);
-+ err = sdio_readsb(sdiodev->func[fn],
-+ ((u8 *)(pkt->data)), addr, req_sz);
-+
-+ if (err == -ENOMEDIUM)
-+ brcmf_sdiod_change_state(sdiodev, BRCMF_SDIOD_NOMEDIUM);
-+
-+ return err;
-+}
-+
-+static int brcmf_sdiod_buff_write(struct brcmf_sdio_dev *sdiodev, uint fn,
-+ u32 addr, struct sk_buff *pkt)
-+{
-+ unsigned int req_sz;
-+ int err;
-+
-+ /* Single skb use the standard mmc interface */
-+ req_sz = pkt->len + 3;
-+ req_sz &= (uint)~3;
-+
-+ err = sdio_memcpy_toio(sdiodev->func[fn], addr,
-+ ((u8 *)(pkt->data)), req_sz);
-+
- if (err == -ENOMEDIUM)
- brcmf_sdiod_change_state(sdiodev, BRCMF_SDIOD_NOMEDIUM);
-+
- return err;
- }
-
-@@ -643,7 +661,7 @@ int brcmf_sdiod_recv_pkt(struct brcmf_sd
- if (err)
- goto done;
-
-- err = brcmf_sdiod_buffrw(sdiodev, SDIO_FUNC_2, false, addr, pkt);
-+ err = brcmf_sdiod_buff_read(sdiodev, SDIO_FUNC_2, addr, pkt);
-
- done:
- return err;
-@@ -665,14 +683,14 @@ int brcmf_sdiod_recv_chain(struct brcmf_
- goto done;
-
- if (pktq->qlen == 1)
-- err = brcmf_sdiod_buffrw(sdiodev, SDIO_FUNC_2, false, addr,
-- pktq->next);
-+ err = brcmf_sdiod_buff_read(sdiodev, SDIO_FUNC_2, addr,
-+ pktq->next);
- else if (!sdiodev->sg_support) {
- glom_skb = brcmu_pkt_buf_get_skb(totlen);
- if (!glom_skb)
- return -ENOMEM;
-- err = brcmf_sdiod_buffrw(sdiodev, SDIO_FUNC_2, false, addr,
-- glom_skb);
-+ err = brcmf_sdiod_buff_read(sdiodev, SDIO_FUNC_2, addr,
-+ glom_skb);
- if (err)
- goto done;
-
-@@ -707,8 +725,7 @@ int brcmf_sdiod_send_buf(struct brcmf_sd
- err = brcmf_sdiod_addrprep(sdiodev, &addr);
-
- if (!err)
-- err = brcmf_sdiod_buffrw(sdiodev, SDIO_FUNC_2, true, addr,
-- mypkt);
-+ err = brcmf_sdiod_buff_write(sdiodev, SDIO_FUNC_2, addr, mypkt);
-
- brcmu_pkt_buf_free_skb(mypkt);
- return err;
-@@ -730,8 +747,8 @@ int brcmf_sdiod_send_pkt(struct brcmf_sd
-
- if (pktq->qlen == 1 || !sdiodev->sg_support)
- skb_queue_walk(pktq, skb) {
-- err = brcmf_sdiod_buffrw(sdiodev, SDIO_FUNC_2, true,
-- addr, skb);
-+ err = brcmf_sdiod_buff_write(sdiodev, SDIO_FUNC_2,
-+ addr, skb);
- if (err)
- break;
- }
-@@ -783,10 +800,16 @@ brcmf_sdiod_ramrw(struct brcmf_sdio_dev
- sdaddr |= SBSDIO_SB_ACCESS_2_4B_FLAG;
-
- skb_put(pkt, dsize);
-- if (write)
-+
-+ if (write) {
- memcpy(pkt->data, data, dsize);
-- err = brcmf_sdiod_buffrw(sdiodev, SDIO_FUNC_1, write, sdaddr,
-- pkt);
-+ err = brcmf_sdiod_buff_write(sdiodev, SDIO_FUNC_1,
-+ sdaddr, pkt);
-+ } else {
-+ err = brcmf_sdiod_buff_read(sdiodev, SDIO_FUNC_1,
-+ sdaddr, pkt);
-+ }
-+
- if (err) {
- brcmf_err("membytes transfer failed\n");
- break;
diff --git a/package/kernel/mac80211/patches/312-v4.16-0002-brcmfmac-whitespace-fixes-in-brcmf_sdiod_send_buf.patch b/package/kernel/mac80211/patches/312-v4.16-0002-brcmfmac-whitespace-fixes-in-brcmf_sdiod_send_buf.patch
deleted file mode 100644
index 088a6169fd..0000000000
--- a/package/kernel/mac80211/patches/312-v4.16-0002-brcmfmac-whitespace-fixes-in-brcmf_sdiod_send_buf.patch
+++ /dev/null
@@ -1,34 +0,0 @@
-From 6e24dd012bfda479d0046f7995058f167e1923bc Mon Sep 17 00:00:00 2001
-From: Ian Molton <ian@mnementh.co.uk>
-Date: Fri, 8 Dec 2017 13:10:27 +0100
-Subject: [PATCH] brcmfmac: whitespace fixes in brcmf_sdiod_send_buf()
-
-Signed-off-by: Ian Molton <ian@mnementh.co.uk>
-Reviewed-by: Arend van Spriel <arend.vanspriel@broadcom.com>
-[arend: mention function in patch subject]
-Signed-off-by: Arend van Spriel <arend.vanspriel@broadcom.com>
-Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
----
- drivers/net/wireless/broadcom/brcm80211/brcmfmac/bcmsdh.c | 3 ++-
- 1 file changed, 2 insertions(+), 1 deletion(-)
-
---- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/bcmsdh.c
-+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/bcmsdh.c
-@@ -714,6 +714,7 @@ int brcmf_sdiod_send_buf(struct brcmf_sd
- int err;
-
- mypkt = brcmu_pkt_buf_get_skb(nbytes);
-+
- if (!mypkt) {
- brcmf_err("brcmu_pkt_buf_get_skb failed: len %d\n",
- nbytes);
-@@ -728,8 +729,8 @@ int brcmf_sdiod_send_buf(struct brcmf_sd
- err = brcmf_sdiod_buff_write(sdiodev, SDIO_FUNC_2, addr, mypkt);
-
- brcmu_pkt_buf_free_skb(mypkt);
-- return err;
-
-+ return err;
- }
-
- int brcmf_sdiod_send_pkt(struct brcmf_sdio_dev *sdiodev,
diff --git a/package/kernel/mac80211/patches/312-v4.16-0003-brcmfmac-Clarify-if-using-braces.patch b/package/kernel/mac80211/patches/312-v4.16-0003-brcmfmac-Clarify-if-using-braces.patch
deleted file mode 100644
index a44155b61a..0000000000
--- a/package/kernel/mac80211/patches/312-v4.16-0003-brcmfmac-Clarify-if-using-braces.patch
+++ /dev/null
@@ -1,36 +0,0 @@
-From a7323378dcf1f10a98f47b744e6f65e6fd671d84 Mon Sep 17 00:00:00 2001
-From: Ian Molton <ian@mnementh.co.uk>
-Date: Fri, 8 Dec 2017 13:10:28 +0100
-Subject: [PATCH] brcmfmac: Clarify if using braces.
-
-Whilst this if () statement is technically correct, it lacks clarity.
-
-Signed-off-by: Ian Molton <ian@mnementh.co.uk>
-Signed-off-by: Arend van Spriel <arend.vanspriel@broadcom.com>
-Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
----
- drivers/net/wireless/broadcom/brcm80211/brcmfmac/bcmsdh.c | 5 +++--
- 1 file changed, 3 insertions(+), 2 deletions(-)
-
---- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/bcmsdh.c
-+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/bcmsdh.c
-@@ -746,16 +746,17 @@ int brcmf_sdiod_send_pkt(struct brcmf_sd
- if (err)
- return err;
-
-- if (pktq->qlen == 1 || !sdiodev->sg_support)
-+ if (pktq->qlen == 1 || !sdiodev->sg_support) {
- skb_queue_walk(pktq, skb) {
- err = brcmf_sdiod_buff_write(sdiodev, SDIO_FUNC_2,
- addr, skb);
- if (err)
- break;
- }
-- else
-+ } else {
- err = brcmf_sdiod_sglist_rw(sdiodev, SDIO_FUNC_2, true, addr,
- pktq);
-+ }
-
- return err;
- }
diff --git a/package/kernel/mac80211/patches/312-v4.16-0004-brcmfmac-Rename-replace-old-IO-functions-with-simple.patch b/package/kernel/mac80211/patches/312-v4.16-0004-brcmfmac-Rename-replace-old-IO-functions-with-simple.patch
deleted file mode 100644
index 7c27e17775..0000000000
--- a/package/kernel/mac80211/patches/312-v4.16-0004-brcmfmac-Rename-replace-old-IO-functions-with-simple.patch
+++ /dev/null
@@ -1,831 +0,0 @@
-From 71bd508d7ded8c504ef05d1b4befecfe25e54cb1 Mon Sep 17 00:00:00 2001
-From: Ian Molton <ian@mnementh.co.uk>
-Date: Fri, 8 Dec 2017 13:10:29 +0100
-Subject: [PATCH] brcmfmac: Rename / replace old IO functions with simpler
- ones.
-
-Primarily this patch removes:
-
-brcmf_sdiod_f0_writeb()
-brcmf_sdiod_reg_write()
-brcmf_sdiod_reg_read()
-
-Since we no longer use the quirky method of deciding which function to
-address via the address being accessed, take the opportunity to rename
-some IO functions more in line with common kernel code. We also convert
-those that map directly to sdio_{read,write}*() to macros.
-
-Signed-off-by: Ian Molton <ian@mnementh.co.uk>
-Reviewed-by: Arend van Spriel <arend.vanspriel@broadcom.com>
-Signed-off-by: Arend van Spriel <arend.vanspriel@broadcom.com>
-Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
----
- .../wireless/broadcom/brcm80211/brcmfmac/bcmsdh.c | 169 +++----------------
- .../wireless/broadcom/brcm80211/brcmfmac/sdio.c | 186 ++++++++++-----------
- .../wireless/broadcom/brcm80211/brcmfmac/sdio.h | 28 +++-
- 3 files changed, 138 insertions(+), 245 deletions(-)
-
---- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/bcmsdh.c
-+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/bcmsdh.c
-@@ -137,27 +137,27 @@ int brcmf_sdiod_intr_register(struct brc
- if (sdiodev->bus_if->chip == BRCM_CC_43362_CHIP_ID) {
- /* assign GPIO to SDIO core */
- addr = CORE_CC_REG(SI_ENUM_BASE, gpiocontrol);
-- gpiocontrol = brcmf_sdiod_regrl(sdiodev, addr, &ret);
-+ gpiocontrol = brcmf_sdiod_readl(sdiodev, addr, &ret);
- gpiocontrol |= 0x2;
-- brcmf_sdiod_regwl(sdiodev, addr, gpiocontrol, &ret);
-+ brcmf_sdiod_writel(sdiodev, addr, gpiocontrol, &ret);
-
-- brcmf_sdiod_regwb(sdiodev, SBSDIO_GPIO_SELECT, 0xf,
-- &ret);
-- brcmf_sdiod_regwb(sdiodev, SBSDIO_GPIO_OUT, 0, &ret);
-- brcmf_sdiod_regwb(sdiodev, SBSDIO_GPIO_EN, 0x2, &ret);
-+ brcmf_sdiod_writeb(sdiodev, SBSDIO_GPIO_SELECT,
-+ 0xf, &ret);
-+ brcmf_sdiod_writeb(sdiodev, SBSDIO_GPIO_OUT, 0, &ret);
-+ brcmf_sdiod_writeb(sdiodev, SBSDIO_GPIO_EN, 0x2, &ret);
- }
-
- /* must configure SDIO_CCCR_IENx to enable irq */
-- data = brcmf_sdiod_regrb(sdiodev, SDIO_CCCR_IENx, &ret);
-+ data = brcmf_sdiod_func0_rb(sdiodev, SDIO_CCCR_IENx, &ret);
- data |= 1 << SDIO_FUNC_1 | 1 << SDIO_FUNC_2 | 1;
-- brcmf_sdiod_regwb(sdiodev, SDIO_CCCR_IENx, data, &ret);
-+ brcmf_sdiod_func0_wb(sdiodev, SDIO_CCCR_IENx, data, &ret);
-
- /* redirect, configure and enable io for interrupt signal */
- data = SDIO_SEPINT_MASK | SDIO_SEPINT_OE;
- if (pdata->oob_irq_flags & IRQF_TRIGGER_HIGH)
- data |= SDIO_SEPINT_ACT_HI;
-- brcmf_sdiod_regwb(sdiodev, SDIO_CCCR_BRCM_SEPINT, data, &ret);
--
-+ brcmf_sdiod_func0_wb(sdiodev, SDIO_CCCR_BRCM_SEPINT,
-+ data, &ret);
- sdio_release_host(sdiodev->func[1]);
- } else {
- brcmf_dbg(SDIO, "Entering\n");
-@@ -183,8 +183,8 @@ void brcmf_sdiod_intr_unregister(struct
-
- pdata = &sdiodev->settings->bus.sdio;
- sdio_claim_host(sdiodev->func[1]);
-- brcmf_sdiod_regwb(sdiodev, SDIO_CCCR_BRCM_SEPINT, 0, NULL);
-- brcmf_sdiod_regwb(sdiodev, SDIO_CCCR_IENx, 0, NULL);
-+ brcmf_sdiod_func0_wb(sdiodev, SDIO_CCCR_BRCM_SEPINT, 0, NULL);
-+ brcmf_sdiod_func0_wb(sdiodev, SDIO_CCCR_IENx, 0, NULL);
- sdio_release_host(sdiodev->func[1]);
-
- sdiodev->oob_irq_requested = false;
-@@ -242,8 +242,8 @@ static int brcmf_sdiod_set_sbaddr_window
- addr = (address & SBSDIO_SBWINDOW_MASK) >> 8;
-
- for (i = 0 ; i < 3 && !err ; i++, addr >>= 8)
-- brcmf_sdiod_regwb(sdiodev, SBSDIO_FUNC1_SBADDRLOW + i,
-- addr & 0xff, &err);
-+ brcmf_sdiod_writeb(sdiodev, SBSDIO_FUNC1_SBADDRLOW + i,
-+ addr & 0xff, &err);
-
- return err;
- }
-@@ -267,124 +267,15 @@ static int brcmf_sdiod_addrprep(struct b
- return 0;
- }
-
--static inline int brcmf_sdiod_f0_writeb(struct sdio_func *func, u8 byte,
-- uint regaddr)
--{
-- int err_ret;
--
-- /*
-- * Can only directly write to some F0 registers.
-- * Handle CCCR_IENx and CCCR_ABORT command
-- * as a special case.
-- */
-- if ((regaddr == SDIO_CCCR_ABORT) ||
-- (regaddr == SDIO_CCCR_IENx))
-- sdio_writeb(func, byte, regaddr, &err_ret);
-- else
-- sdio_f0_writeb(func, byte, regaddr, &err_ret);
--
-- return err_ret;
--}
--
--static int brcmf_sdiod_reg_write(struct brcmf_sdio_dev *sdiodev, u32 addr,
-- u8 regsz, void *data)
--{
-- int ret;
--
-- /*
-- * figure out how to read the register based on address range
-- * 0x00 ~ 0x7FF: function 0 CCCR and FBR
-- * 0x10000 ~ 0x1FFFF: function 1 miscellaneous registers
-- * The rest: function 1 silicon backplane core registers
-- * f0 writes must be bytewise
-- */
--
-- if ((addr & ~REG_F0_REG_MASK) == 0) {
-- if (WARN_ON(regsz > 1))
-- return -EINVAL;
-- ret = brcmf_sdiod_f0_writeb(sdiodev->func[0],
-- *(u8 *)data, addr);
-- } else {
-- switch (regsz) {
-- case 1:
-- sdio_writeb(sdiodev->func[1], *(u8 *)data, addr, &ret);
-- break;
-- case 4:
-- ret = brcmf_sdiod_addrprep(sdiodev, &addr);
-- if (ret)
-- goto done;
--
-- sdio_writel(sdiodev->func[1], *(u32 *)data, addr, &ret);
-- break;
-- default:
-- WARN(1, "Invalid reg size\n");
-- ret = -EINVAL;
-- break;
-- }
-- }
--
--done:
-- return ret;
--}
--
--static int brcmf_sdiod_reg_read(struct brcmf_sdio_dev *sdiodev, u32 addr,
-- u8 regsz, void *data)
--{
-- int ret;
--
-- /*
-- * figure out how to read the register based on address range
-- * 0x00 ~ 0x7FF: function 0 CCCR and FBR
-- * 0x10000 ~ 0x1FFFF: function 1 miscellaneous registers
-- * The rest: function 1 silicon backplane core registers
-- * f0 reads must be bytewise
-- */
-- if ((addr & ~REG_F0_REG_MASK) == 0) {
-- if (WARN_ON(regsz > 1))
-- return -EINVAL;
-- *(u8 *)data = sdio_f0_readb(sdiodev->func[0], addr, &ret);
-- } else {
-- switch (regsz) {
-- case 1:
-- *(u8 *)data = sdio_readb(sdiodev->func[1], addr, &ret);
-- break;
-- case 4:
-- ret = brcmf_sdiod_addrprep(sdiodev, &addr);
-- if (ret)
-- goto done;
--
-- *(u32 *)data = sdio_readl(sdiodev->func[1], addr, &ret);
-- break;
-- default:
-- WARN(1, "Invalid reg size\n");
-- ret = -EINVAL;
-- break;
-- }
-- }
--
--done:
-- return ret;
--}
--
--u8 brcmf_sdiod_regrb(struct brcmf_sdio_dev *sdiodev, u32 addr, int *ret)
-+u32 brcmf_sdiod_readl(struct brcmf_sdio_dev *sdiodev, u32 addr, int *ret)
- {
-- u8 data;
-+ u32 data = 0;
- int retval;
-
-- retval = brcmf_sdiod_reg_read(sdiodev, addr, 1, &data);
--
-- if (ret)
-- *ret = retval;
--
-- return data;
--}
-+ retval = brcmf_sdiod_addrprep(sdiodev, &addr);
-
--u32 brcmf_sdiod_regrl(struct brcmf_sdio_dev *sdiodev, u32 addr, int *ret)
--{
-- u32 data;
-- int retval;
--
-- retval = brcmf_sdiod_reg_read(sdiodev, addr, 4, &data);
-+ if (!retval)
-+ data = sdio_readl(sdiodev->func[1], addr, &retval);
-
- if (ret)
- *ret = retval;
-@@ -392,23 +283,15 @@ u32 brcmf_sdiod_regrl(struct brcmf_sdio_
- return data;
- }
-
--void brcmf_sdiod_regwb(struct brcmf_sdio_dev *sdiodev, u32 addr,
-- u8 data, int *ret)
-+void brcmf_sdiod_writel(struct brcmf_sdio_dev *sdiodev, u32 addr,
-+ u32 data, int *ret)
- {
- int retval;
-
-- retval = brcmf_sdiod_reg_write(sdiodev, addr, 1, &data);
--
-- if (ret)
-- *ret = retval;
--}
--
--void brcmf_sdiod_regwl(struct brcmf_sdio_dev *sdiodev, u32 addr,
-- u32 data, int *ret)
--{
-- int retval;
-+ retval = brcmf_sdiod_addrprep(sdiodev, &addr);
-
-- retval = brcmf_sdiod_reg_write(sdiodev, addr, 4, &data);
-+ if (!retval)
-+ sdio_writel(sdiodev->func[1], data, addr, &retval);
-
- if (ret)
- *ret = retval;
-@@ -846,8 +729,8 @@ int brcmf_sdiod_abort(struct brcmf_sdio_
- {
- brcmf_dbg(SDIO, "Enter\n");
-
-- /* issue abort cmd52 command through F0 */
-- brcmf_sdiod_reg_write(sdiodev, SDIO_CCCR_ABORT, 1, &fn);
-+ /* Issue abort cmd52 command through F0 */
-+ brcmf_sdiod_func0_wb(sdiodev, SDIO_CCCR_ABORT, fn, NULL);
-
- brcmf_dbg(SDIO, "Exit\n");
- return 0;
---- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c
-+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c
-@@ -669,7 +669,7 @@ static int r_sdreg32(struct brcmf_sdio *
- int ret;
-
- core = brcmf_chip_get_core(bus->ci, BCMA_CORE_SDIO_DEV);
-- *regvar = brcmf_sdiod_regrl(bus->sdiodev, core->base + offset, &ret);
-+ *regvar = brcmf_sdiod_readl(bus->sdiodev, core->base + offset, &ret);
-
- return ret;
- }
-@@ -680,7 +680,7 @@ static int w_sdreg32(struct brcmf_sdio *
- int ret;
-
- core = brcmf_chip_get_core(bus->ci, BCMA_CORE_SDIO_DEV);
-- brcmf_sdiod_regwl(bus->sdiodev, core->base + reg_offset, regval, &ret);
-+ brcmf_sdiod_writel(bus->sdiodev, core->base + reg_offset, regval, &ret);
-
- return ret;
- }
-@@ -697,8 +697,7 @@ brcmf_sdio_kso_control(struct brcmf_sdio
-
- wr_val = (on << SBSDIO_FUNC1_SLEEPCSR_KSO_SHIFT);
- /* 1st KSO write goes to AOS wake up core if device is asleep */
-- brcmf_sdiod_regwb(bus->sdiodev, SBSDIO_FUNC1_SLEEPCSR,
-- wr_val, &err);
-+ brcmf_sdiod_writeb(bus->sdiodev, SBSDIO_FUNC1_SLEEPCSR, wr_val, &err);
-
- if (on) {
- /* device WAKEUP through KSO:
-@@ -724,7 +723,7 @@ brcmf_sdio_kso_control(struct brcmf_sdio
- * just one write attempt may fail,
- * read it back until it matches written value
- */
-- rd_val = brcmf_sdiod_regrb(bus->sdiodev, SBSDIO_FUNC1_SLEEPCSR,
-+ rd_val = brcmf_sdiod_readb(bus->sdiodev, SBSDIO_FUNC1_SLEEPCSR,
- &err);
- if (!err) {
- if ((rd_val & bmask) == cmp_val)
-@@ -734,9 +733,11 @@ brcmf_sdio_kso_control(struct brcmf_sdio
- /* bail out upon subsequent access errors */
- if (err && (err_cnt++ > BRCMF_SDIO_MAX_ACCESS_ERRORS))
- break;
-+
- udelay(KSO_WAIT_US);
-- brcmf_sdiod_regwb(bus->sdiodev, SBSDIO_FUNC1_SLEEPCSR,
-- wr_val, &err);
-+ brcmf_sdiod_writeb(bus->sdiodev, SBSDIO_FUNC1_SLEEPCSR, wr_val,
-+ &err);
-+
- } while (try_cnt++ < MAX_KSO_ATTEMPTS);
-
- if (try_cnt > 2)
-@@ -772,15 +773,15 @@ static int brcmf_sdio_htclk(struct brcmf
- clkreq =
- bus->alp_only ? SBSDIO_ALP_AVAIL_REQ : SBSDIO_HT_AVAIL_REQ;
-
-- brcmf_sdiod_regwb(bus->sdiodev, SBSDIO_FUNC1_CHIPCLKCSR,
-- clkreq, &err);
-+ brcmf_sdiod_writeb(bus->sdiodev, SBSDIO_FUNC1_CHIPCLKCSR,
-+ clkreq, &err);
- if (err) {
- brcmf_err("HT Avail request error: %d\n", err);
- return -EBADE;
- }
-
- /* Check current status */
-- clkctl = brcmf_sdiod_regrb(bus->sdiodev,
-+ clkctl = brcmf_sdiod_readb(bus->sdiodev,
- SBSDIO_FUNC1_CHIPCLKCSR, &err);
- if (err) {
- brcmf_err("HT Avail read error: %d\n", err);
-@@ -790,35 +791,34 @@ static int brcmf_sdio_htclk(struct brcmf
- /* Go to pending and await interrupt if appropriate */
- if (!SBSDIO_CLKAV(clkctl, bus->alp_only) && pendok) {
- /* Allow only clock-available interrupt */
-- devctl = brcmf_sdiod_regrb(bus->sdiodev,
-+ devctl = brcmf_sdiod_readb(bus->sdiodev,
- SBSDIO_DEVICE_CTL, &err);
- if (err) {
-- brcmf_err("Devctl error setting CA: %d\n",
-- err);
-+ brcmf_err("Devctl error setting CA: %d\n", err);
- return -EBADE;
- }
-
- devctl |= SBSDIO_DEVCTL_CA_INT_ONLY;
-- brcmf_sdiod_regwb(bus->sdiodev, SBSDIO_DEVICE_CTL,
-- devctl, &err);
-+ brcmf_sdiod_writeb(bus->sdiodev, SBSDIO_DEVICE_CTL,
-+ devctl, &err);
- brcmf_dbg(SDIO, "CLKCTL: set PENDING\n");
- bus->clkstate = CLK_PENDING;
-
- return 0;
- } else if (bus->clkstate == CLK_PENDING) {
- /* Cancel CA-only interrupt filter */
-- devctl = brcmf_sdiod_regrb(bus->sdiodev,
-+ devctl = brcmf_sdiod_readb(bus->sdiodev,
- SBSDIO_DEVICE_CTL, &err);
- devctl &= ~SBSDIO_DEVCTL_CA_INT_ONLY;
-- brcmf_sdiod_regwb(bus->sdiodev, SBSDIO_DEVICE_CTL,
-- devctl, &err);
-+ brcmf_sdiod_writeb(bus->sdiodev, SBSDIO_DEVICE_CTL,
-+ devctl, &err);
- }
-
- /* Otherwise, wait here (polling) for HT Avail */
- timeout = jiffies +
- msecs_to_jiffies(PMU_MAX_TRANSITION_DLY/1000);
- while (!SBSDIO_CLKAV(clkctl, bus->alp_only)) {
-- clkctl = brcmf_sdiod_regrb(bus->sdiodev,
-+ clkctl = brcmf_sdiod_readb(bus->sdiodev,
- SBSDIO_FUNC1_CHIPCLKCSR,
- &err);
- if (time_after(jiffies, timeout))
-@@ -852,16 +852,16 @@ static int brcmf_sdio_htclk(struct brcmf
-
- if (bus->clkstate == CLK_PENDING) {
- /* Cancel CA-only interrupt filter */
-- devctl = brcmf_sdiod_regrb(bus->sdiodev,
-+ devctl = brcmf_sdiod_readb(bus->sdiodev,
- SBSDIO_DEVICE_CTL, &err);
- devctl &= ~SBSDIO_DEVCTL_CA_INT_ONLY;
-- brcmf_sdiod_regwb(bus->sdiodev, SBSDIO_DEVICE_CTL,
-- devctl, &err);
-+ brcmf_sdiod_writeb(bus->sdiodev, SBSDIO_DEVICE_CTL,
-+ devctl, &err);
- }
-
- bus->clkstate = CLK_SDONLY;
-- brcmf_sdiod_regwb(bus->sdiodev, SBSDIO_FUNC1_CHIPCLKCSR,
-- clkreq, &err);
-+ brcmf_sdiod_writeb(bus->sdiodev, SBSDIO_FUNC1_CHIPCLKCSR,
-+ clkreq, &err);
- brcmf_dbg(SDIO, "CLKCTL: turned OFF\n");
- if (err) {
- brcmf_err("Failed access turning clock off: %d\n",
-@@ -951,14 +951,14 @@ brcmf_sdio_bus_sleep(struct brcmf_sdio *
-
- /* Going to sleep */
- if (sleep) {
-- clkcsr = brcmf_sdiod_regrb(bus->sdiodev,
-+ clkcsr = brcmf_sdiod_readb(bus->sdiodev,
- SBSDIO_FUNC1_CHIPCLKCSR,
- &err);
- if ((clkcsr & SBSDIO_CSR_MASK) == 0) {
- brcmf_dbg(SDIO, "no clock, set ALP\n");
-- brcmf_sdiod_regwb(bus->sdiodev,
-- SBSDIO_FUNC1_CHIPCLKCSR,
-- SBSDIO_ALP_AVAIL_REQ, &err);
-+ brcmf_sdiod_writeb(bus->sdiodev,
-+ SBSDIO_FUNC1_CHIPCLKCSR,
-+ SBSDIO_ALP_AVAIL_REQ, &err);
- }
- err = brcmf_sdio_kso_control(bus, false);
- } else {
-@@ -1178,16 +1178,16 @@ static void brcmf_sdio_rxfail(struct brc
- if (abort)
- brcmf_sdiod_abort(bus->sdiodev, SDIO_FUNC_2);
-
-- brcmf_sdiod_regwb(bus->sdiodev, SBSDIO_FUNC1_FRAMECTRL,
-- SFC_RF_TERM, &err);
-+ brcmf_sdiod_writeb(bus->sdiodev, SBSDIO_FUNC1_FRAMECTRL, SFC_RF_TERM,
-+ &err);
- bus->sdcnt.f1regdata++;
-
- /* Wait until the packet has been flushed (device/FIFO stable) */
- for (lastrbc = retries = 0xffff; retries > 0; retries--) {
-- hi = brcmf_sdiod_regrb(bus->sdiodev,
-- SBSDIO_FUNC1_RFRAMEBCHI, &err);
-- lo = brcmf_sdiod_regrb(bus->sdiodev,
-- SBSDIO_FUNC1_RFRAMEBCLO, &err);
-+ hi = brcmf_sdiod_readb(bus->sdiodev, SBSDIO_FUNC1_RFRAMEBCHI,
-+ &err);
-+ lo = brcmf_sdiod_readb(bus->sdiodev, SBSDIO_FUNC1_RFRAMEBCLO,
-+ &err);
- bus->sdcnt.f1regdata += 2;
-
- if ((hi == 0) && (lo == 0))
-@@ -1229,12 +1229,12 @@ static void brcmf_sdio_txfail(struct brc
- bus->sdcnt.tx_sderrs++;
-
- brcmf_sdiod_abort(sdiodev, SDIO_FUNC_2);
-- brcmf_sdiod_regwb(sdiodev, SBSDIO_FUNC1_FRAMECTRL, SFC_WF_TERM, NULL);
-+ brcmf_sdiod_writeb(sdiodev, SBSDIO_FUNC1_FRAMECTRL, SFC_WF_TERM, NULL);
- bus->sdcnt.f1regdata++;
-
- for (i = 0; i < 3; i++) {
-- hi = brcmf_sdiod_regrb(sdiodev, SBSDIO_FUNC1_WFRAMEBCHI, NULL);
-- lo = brcmf_sdiod_regrb(sdiodev, SBSDIO_FUNC1_WFRAMEBCLO, NULL);
-+ hi = brcmf_sdiod_readb(sdiodev, SBSDIO_FUNC1_WFRAMEBCHI, NULL);
-+ lo = brcmf_sdiod_readb(sdiodev, SBSDIO_FUNC1_WFRAMEBCLO, NULL);
- bus->sdcnt.f1regdata += 2;
- if ((hi == 0) && (lo == 0))
- break;
-@@ -2446,11 +2446,11 @@ static void brcmf_sdio_bus_stop(struct d
- bus->hostintmask = 0;
-
- /* Force backplane clocks to assure F2 interrupt propagates */
-- saveclk = brcmf_sdiod_regrb(sdiodev, SBSDIO_FUNC1_CHIPCLKCSR,
-+ saveclk = brcmf_sdiod_readb(sdiodev, SBSDIO_FUNC1_CHIPCLKCSR,
- &err);
- if (!err)
-- brcmf_sdiod_regwb(sdiodev, SBSDIO_FUNC1_CHIPCLKCSR,
-- (saveclk | SBSDIO_FORCE_HT), &err);
-+ brcmf_sdiod_writeb(sdiodev, SBSDIO_FUNC1_CHIPCLKCSR,
-+ (saveclk | SBSDIO_FORCE_HT), &err);
- if (err)
- brcmf_err("Failed to force clock for F2: err %d\n",
- err);
-@@ -2509,7 +2509,7 @@ static int brcmf_sdio_intr_rstatus(struc
- buscore = brcmf_chip_get_core(bus->ci, BCMA_CORE_SDIO_DEV);
- addr = buscore->base + offsetof(struct sdpcmd_regs, intstatus);
-
-- val = brcmf_sdiod_regrl(bus->sdiodev, addr, &ret);
-+ val = brcmf_sdiod_readl(bus->sdiodev, addr, &ret);
- bus->sdcnt.f1regdata++;
- if (ret != 0)
- return ret;
-@@ -2519,7 +2519,7 @@ static int brcmf_sdio_intr_rstatus(struc
-
- /* Clear interrupts */
- if (val) {
-- brcmf_sdiod_regwl(bus->sdiodev, addr, val, &ret);
-+ brcmf_sdiod_writel(bus->sdiodev, addr, val, &ret);
- bus->sdcnt.f1regdata++;
- atomic_or(val, &bus->intstatus);
- }
-@@ -2545,23 +2545,23 @@ static void brcmf_sdio_dpc(struct brcmf_
-
- #ifdef DEBUG
- /* Check for inconsistent device control */
-- devctl = brcmf_sdiod_regrb(bus->sdiodev,
-- SBSDIO_DEVICE_CTL, &err);
-+ devctl = brcmf_sdiod_readb(bus->sdiodev, SBSDIO_DEVICE_CTL,
-+ &err);
- #endif /* DEBUG */
-
- /* Read CSR, if clock on switch to AVAIL, else ignore */
-- clkctl = brcmf_sdiod_regrb(bus->sdiodev,
-+ clkctl = brcmf_sdiod_readb(bus->sdiodev,
- SBSDIO_FUNC1_CHIPCLKCSR, &err);
-
- brcmf_dbg(SDIO, "DPC: PENDING, devctl 0x%02x clkctl 0x%02x\n",
- devctl, clkctl);
-
- if (SBSDIO_HTAV(clkctl)) {
-- devctl = brcmf_sdiod_regrb(bus->sdiodev,
-+ devctl = brcmf_sdiod_readb(bus->sdiodev,
- SBSDIO_DEVICE_CTL, &err);
- devctl &= ~SBSDIO_DEVCTL_CA_INT_ONLY;
-- brcmf_sdiod_regwb(bus->sdiodev, SBSDIO_DEVICE_CTL,
-- devctl, &err);
-+ brcmf_sdiod_writeb(bus->sdiodev,
-+ SBSDIO_DEVICE_CTL, devctl, &err);
- bus->clkstate = CLK_AVAIL;
- }
- }
-@@ -3347,31 +3347,31 @@ static void brcmf_sdio_sr_init(struct br
-
- brcmf_dbg(TRACE, "Enter\n");
-
-- val = brcmf_sdiod_regrb(bus->sdiodev, SBSDIO_FUNC1_WAKEUPCTRL, &err);
-+ val = brcmf_sdiod_readb(bus->sdiodev, SBSDIO_FUNC1_WAKEUPCTRL, &err);
- if (err) {
- brcmf_err("error reading SBSDIO_FUNC1_WAKEUPCTRL\n");
- return;
- }
-
- val |= 1 << SBSDIO_FUNC1_WCTRL_HTWAIT_SHIFT;
-- brcmf_sdiod_regwb(bus->sdiodev, SBSDIO_FUNC1_WAKEUPCTRL, val, &err);
-+ brcmf_sdiod_writeb(bus->sdiodev, SBSDIO_FUNC1_WAKEUPCTRL, val, &err);
- if (err) {
- brcmf_err("error writing SBSDIO_FUNC1_WAKEUPCTRL\n");
- return;
- }
-
- /* Add CMD14 Support */
-- brcmf_sdiod_regwb(bus->sdiodev, SDIO_CCCR_BRCM_CARDCAP,
-- (SDIO_CCCR_BRCM_CARDCAP_CMD14_SUPPORT |
-- SDIO_CCCR_BRCM_CARDCAP_CMD14_EXT),
-- &err);
-+ brcmf_sdiod_func0_wb(bus->sdiodev, SDIO_CCCR_BRCM_CARDCAP,
-+ (SDIO_CCCR_BRCM_CARDCAP_CMD14_SUPPORT |
-+ SDIO_CCCR_BRCM_CARDCAP_CMD14_EXT),
-+ &err);
- if (err) {
- brcmf_err("error writing SDIO_CCCR_BRCM_CARDCAP\n");
- return;
- }
-
-- brcmf_sdiod_regwb(bus->sdiodev, SBSDIO_FUNC1_CHIPCLKCSR,
-- SBSDIO_FORCE_HT, &err);
-+ brcmf_sdiod_writeb(bus->sdiodev, SBSDIO_FUNC1_CHIPCLKCSR,
-+ SBSDIO_FORCE_HT, &err);
- if (err) {
- brcmf_err("error writing SBSDIO_FUNC1_CHIPCLKCSR\n");
- return;
-@@ -3394,7 +3394,7 @@ static int brcmf_sdio_kso_init(struct br
- if (brcmf_chip_get_core(bus->ci, BCMA_CORE_SDIO_DEV)->rev < 12)
- return 0;
-
-- val = brcmf_sdiod_regrb(bus->sdiodev, SBSDIO_FUNC1_SLEEPCSR, &err);
-+ val = brcmf_sdiod_readb(bus->sdiodev, SBSDIO_FUNC1_SLEEPCSR, &err);
- if (err) {
- brcmf_err("error reading SBSDIO_FUNC1_SLEEPCSR\n");
- return err;
-@@ -3403,8 +3403,8 @@ static int brcmf_sdio_kso_init(struct br
- if (!(val & SBSDIO_FUNC1_SLEEPCSR_KSO_MASK)) {
- val |= (SBSDIO_FUNC1_SLEEPCSR_KSO_EN <<
- SBSDIO_FUNC1_SLEEPCSR_KSO_SHIFT);
-- brcmf_sdiod_regwb(bus->sdiodev, SBSDIO_FUNC1_SLEEPCSR,
-- val, &err);
-+ brcmf_sdiod_writeb(bus->sdiodev, SBSDIO_FUNC1_SLEEPCSR,
-+ val, &err);
- if (err) {
- brcmf_err("error writing SBSDIO_FUNC1_SLEEPCSR\n");
- return err;
-@@ -3565,9 +3565,9 @@ static void brcmf_sdio_bus_watchdog(stru
- u8 devpend;
-
- sdio_claim_host(bus->sdiodev->func[1]);
-- devpend = brcmf_sdiod_regrb(bus->sdiodev,
-- SDIO_CCCR_INTx,
-- NULL);
-+ devpend = brcmf_sdiod_func0_rb(bus->sdiodev,
-+ SDIO_CCCR_INTx,
-+ NULL);
- sdio_release_host(bus->sdiodev->func[1]);
- intstatus = devpend & (INTR_STATUS_FUNC1 |
- INTR_STATUS_FUNC2);
-@@ -3705,12 +3705,12 @@ brcmf_sdio_drivestrengthinit(struct brcm
- }
- }
- addr = CORE_CC_REG(pmu->base, chipcontrol_addr);
-- brcmf_sdiod_regwl(sdiodev, addr, 1, NULL);
-- cc_data_temp = brcmf_sdiod_regrl(sdiodev, addr, NULL);
-+ brcmf_sdiod_writel(sdiodev, addr, 1, NULL);
-+ cc_data_temp = brcmf_sdiod_readl(sdiodev, addr, NULL);
- cc_data_temp &= ~str_mask;
- drivestrength_sel <<= str_shift;
- cc_data_temp |= drivestrength_sel;
-- brcmf_sdiod_regwl(sdiodev, addr, cc_data_temp, NULL);
-+ brcmf_sdiod_writel(sdiodev, addr, cc_data_temp, NULL);
-
- brcmf_dbg(INFO, "SDIO: %d mA (req=%d mA) drive strength selected, set to 0x%08x\n",
- str_tab[i].strength, drivestrength, cc_data_temp);
-@@ -3725,7 +3725,7 @@ static int brcmf_sdio_buscoreprep(void *
-
- /* Try forcing SDIO core to do ALPAvail request only */
- clkset = SBSDIO_FORCE_HW_CLKREQ_OFF | SBSDIO_ALP_AVAIL_REQ;
-- brcmf_sdiod_regwb(sdiodev, SBSDIO_FUNC1_CHIPCLKCSR, clkset, &err);
-+ brcmf_sdiod_writeb(sdiodev, SBSDIO_FUNC1_CHIPCLKCSR, clkset, &err);
- if (err) {
- brcmf_err("error writing for HT off\n");
- return err;
-@@ -3733,8 +3733,7 @@ static int brcmf_sdio_buscoreprep(void *
-
- /* If register supported, wait for ALPAvail and then force ALP */
- /* This may take up to 15 milliseconds */
-- clkval = brcmf_sdiod_regrb(sdiodev,
-- SBSDIO_FUNC1_CHIPCLKCSR, NULL);
-+ clkval = brcmf_sdiod_readb(sdiodev, SBSDIO_FUNC1_CHIPCLKCSR, NULL);
-
- if ((clkval & ~SBSDIO_AVBITS) != clkset) {
- brcmf_err("ChipClkCSR access: wrote 0x%02x read 0x%02x\n",
-@@ -3742,10 +3741,11 @@ static int brcmf_sdio_buscoreprep(void *
- return -EACCES;
- }
-
-- SPINWAIT(((clkval = brcmf_sdiod_regrb(sdiodev,
-- SBSDIO_FUNC1_CHIPCLKCSR, NULL)),
-- !SBSDIO_ALPAV(clkval)),
-- PMU_MAX_TRANSITION_DLY);
-+ SPINWAIT(((clkval = brcmf_sdiod_readb(sdiodev, SBSDIO_FUNC1_CHIPCLKCSR,
-+ NULL)),
-+ !SBSDIO_ALPAV(clkval)),
-+ PMU_MAX_TRANSITION_DLY);
-+
- if (!SBSDIO_ALPAV(clkval)) {
- brcmf_err("timeout on ALPAV wait, clkval 0x%02x\n",
- clkval);
-@@ -3753,11 +3753,11 @@ static int brcmf_sdio_buscoreprep(void *
- }
-
- clkset = SBSDIO_FORCE_HW_CLKREQ_OFF | SBSDIO_FORCE_ALP;
-- brcmf_sdiod_regwb(sdiodev, SBSDIO_FUNC1_CHIPCLKCSR, clkset, &err);
-+ brcmf_sdiod_writeb(sdiodev, SBSDIO_FUNC1_CHIPCLKCSR, clkset, &err);
- udelay(65);
-
- /* Also, disable the extra SDIO pull-ups */
-- brcmf_sdiod_regwb(sdiodev, SBSDIO_FUNC1_SDIOPULLUP, 0, NULL);
-+ brcmf_sdiod_writeb(sdiodev, SBSDIO_FUNC1_SDIOPULLUP, 0, NULL);
-
- return 0;
- }
-@@ -3772,7 +3772,7 @@ static void brcmf_sdio_buscore_activate(
- /* clear all interrupts */
- core = brcmf_chip_get_core(chip, BCMA_CORE_SDIO_DEV);
- reg_addr = core->base + offsetof(struct sdpcmd_regs, intstatus);
-- brcmf_sdiod_regwl(sdiodev, reg_addr, 0xFFFFFFFF, NULL);
-+ brcmf_sdiod_writel(sdiodev, reg_addr, 0xFFFFFFFF, NULL);
-
- if (rstvec)
- /* Write reset vector to address 0 */
-@@ -3785,7 +3785,7 @@ static u32 brcmf_sdio_buscore_read32(voi
- struct brcmf_sdio_dev *sdiodev = ctx;
- u32 val, rev;
-
-- val = brcmf_sdiod_regrl(sdiodev, addr, NULL);
-+ val = brcmf_sdiod_readl(sdiodev, addr, NULL);
- if ((sdiodev->func[0]->device == SDIO_DEVICE_ID_BROADCOM_4335_4339 ||
- sdiodev->func[0]->device == SDIO_DEVICE_ID_BROADCOM_4339) &&
- addr == CORE_CC_REG(SI_ENUM_BASE, chipid)) {
-@@ -3802,7 +3802,7 @@ static void brcmf_sdio_buscore_write32(v
- {
- struct brcmf_sdio_dev *sdiodev = ctx;
-
-- brcmf_sdiod_regwl(sdiodev, addr, val, NULL);
-+ brcmf_sdiod_writel(sdiodev, addr, val, NULL);
- }
-
- static const struct brcmf_buscore_ops brcmf_sdio_buscore_ops = {
-@@ -3826,18 +3826,18 @@ brcmf_sdio_probe_attach(struct brcmf_sdi
- sdio_claim_host(sdiodev->func[1]);
-
- pr_debug("F1 signature read @0x18000000=0x%4x\n",
-- brcmf_sdiod_regrl(sdiodev, SI_ENUM_BASE, NULL));
-+ brcmf_sdiod_readl(sdiodev, SI_ENUM_BASE, NULL));
-
- /*
- * Force PLL off until brcmf_chip_attach()
- * programs PLL control regs
- */
-
-- brcmf_sdiod_regwb(sdiodev, SBSDIO_FUNC1_CHIPCLKCSR,
-- BRCMF_INIT_CLKCTL1, &err);
-+ brcmf_sdiod_writeb(sdiodev, SBSDIO_FUNC1_CHIPCLKCSR, BRCMF_INIT_CLKCTL1,
-+ &err);
- if (!err)
-- clkctl = brcmf_sdiod_regrb(sdiodev,
-- SBSDIO_FUNC1_CHIPCLKCSR, &err);
-+ clkctl = brcmf_sdiod_readb(sdiodev, SBSDIO_FUNC1_CHIPCLKCSR,
-+ &err);
-
- if (err || ((clkctl & ~SBSDIO_AVBITS) != BRCMF_INIT_CLKCTL1)) {
- brcmf_err("ChipClkCSR access: err %d wrote 0x%02x read 0x%02x\n",
-@@ -3897,25 +3897,25 @@ brcmf_sdio_probe_attach(struct brcmf_sdi
- brcmf_sdio_drivestrengthinit(sdiodev, bus->ci, drivestrength);
-
- /* Set card control so an SDIO card reset does a WLAN backplane reset */
-- reg_val = brcmf_sdiod_regrb(sdiodev, SDIO_CCCR_BRCM_CARDCTRL, &err);
-+ reg_val = brcmf_sdiod_func0_rb(sdiodev, SDIO_CCCR_BRCM_CARDCTRL, &err);
- if (err)
- goto fail;
-
- reg_val |= SDIO_CCCR_BRCM_CARDCTRL_WLANRESET;
-
-- brcmf_sdiod_regwb(sdiodev, SDIO_CCCR_BRCM_CARDCTRL, reg_val, &err);
-+ brcmf_sdiod_func0_wb(sdiodev, SDIO_CCCR_BRCM_CARDCTRL, reg_val, &err);
- if (err)
- goto fail;
-
- /* set PMUControl so a backplane reset does PMU state reload */
- reg_addr = CORE_CC_REG(brcmf_chip_get_pmu(bus->ci)->base, pmucontrol);
-- reg_val = brcmf_sdiod_regrl(sdiodev, reg_addr, &err);
-+ reg_val = brcmf_sdiod_readl(sdiodev, reg_addr, &err);
- if (err)
- goto fail;
-
- reg_val |= (BCMA_CC_PMU_CTL_RES_RELOAD << BCMA_CC_PMU_CTL_RES_SHIFT);
-
-- brcmf_sdiod_regwl(sdiodev, reg_addr, reg_val, &err);
-+ brcmf_sdiod_writel(sdiodev, reg_addr, reg_val, &err);
- if (err)
- goto fail;
-
-@@ -4055,10 +4055,10 @@ static void brcmf_sdio_firmware_callback
- goto release;
-
- /* Force clocks on backplane to be sure F2 interrupt propagates */
-- saveclk = brcmf_sdiod_regrb(sdiodev, SBSDIO_FUNC1_CHIPCLKCSR, &err);
-+ saveclk = brcmf_sdiod_readb(sdiodev, SBSDIO_FUNC1_CHIPCLKCSR, &err);
- if (!err) {
-- brcmf_sdiod_regwb(sdiodev, SBSDIO_FUNC1_CHIPCLKCSR,
-- (saveclk | SBSDIO_FORCE_HT), &err);
-+ brcmf_sdiod_writeb(sdiodev, SBSDIO_FUNC1_CHIPCLKCSR,
-+ (saveclk | SBSDIO_FORCE_HT), &err);
- }
- if (err) {
- brcmf_err("Failed to force clock for F2: err %d\n", err);
-@@ -4080,7 +4080,7 @@ static void brcmf_sdio_firmware_callback
- w_sdreg32(bus, bus->hostintmask,
- offsetof(struct sdpcmd_regs, hostintmask));
-
-- brcmf_sdiod_regwb(sdiodev, SBSDIO_WATERMARK, 8, &err);
-+ brcmf_sdiod_writeb(sdiodev, SBSDIO_WATERMARK, 8, &err);
- } else {
- /* Disable F2 again */
- sdio_disable_func(sdiodev->func[SDIO_FUNC_2]);
-@@ -4091,8 +4091,8 @@ static void brcmf_sdio_firmware_callback
- brcmf_sdio_sr_init(bus);
- } else {
- /* Restore previous clock setting */
-- brcmf_sdiod_regwb(sdiodev, SBSDIO_FUNC1_CHIPCLKCSR,
-- saveclk, &err);
-+ brcmf_sdiod_writeb(sdiodev, SBSDIO_FUNC1_CHIPCLKCSR,
-+ saveclk, &err);
- }
-
- if (err == 0) {
-@@ -4225,7 +4225,7 @@ struct brcmf_sdio *brcmf_sdio_probe(stru
- bus->rxflow = false;
-
- /* Done with backplane-dependent accesses, can drop clock... */
-- brcmf_sdiod_regwb(bus->sdiodev, SBSDIO_FUNC1_CHIPCLKCSR, 0, NULL);
-+ brcmf_sdiod_writeb(bus->sdiodev, SBSDIO_FUNC1_CHIPCLKCSR, 0, NULL);
-
- sdio_release_host(bus->sdiodev->func[1]);
-
---- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.h
-+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.h
-@@ -50,6 +50,7 @@
- #define SBSDIO_NUM_FUNCTION 3
-
- /* function 0 vendor specific CCCR registers */
-+
- #define SDIO_CCCR_BRCM_CARDCAP 0xf0
- #define SDIO_CCCR_BRCM_CARDCAP_CMD14_SUPPORT 0x02
- #define SDIO_CCCR_BRCM_CARDCAP_CMD14_EXT 0x04
-@@ -131,8 +132,6 @@
- /* with b15, maps to 32-bit SB access */
- #define SBSDIO_SB_ACCESS_2_4B_FLAG 0x08000
-
--/* valid bits in SBSDIO_FUNC1_SBADDRxxx regs */
--
- /* Address bits from SBADDR regs */
- #define SBSDIO_SBWINDOW_MASK 0xffff8000
-
-@@ -293,13 +292,24 @@ struct sdpcmd_regs {
- int brcmf_sdiod_intr_register(struct brcmf_sdio_dev *sdiodev);
- void brcmf_sdiod_intr_unregister(struct brcmf_sdio_dev *sdiodev);
-
--/* sdio device register access interface */
--u8 brcmf_sdiod_regrb(struct brcmf_sdio_dev *sdiodev, u32 addr, int *ret);
--u32 brcmf_sdiod_regrl(struct brcmf_sdio_dev *sdiodev, u32 addr, int *ret);
--void brcmf_sdiod_regwb(struct brcmf_sdio_dev *sdiodev, u32 addr, u8 data,
-- int *ret);
--void brcmf_sdiod_regwl(struct brcmf_sdio_dev *sdiodev, u32 addr, u32 data,
-- int *ret);
-+/* SDIO device register access interface */
-+/* Accessors for SDIO Function 0 */
-+#define brcmf_sdiod_func0_rb(sdiodev, addr, r) \
-+ sdio_readb((sdiodev)->func[0], (addr), (r))
-+
-+#define brcmf_sdiod_func0_wb(sdiodev, addr, v, ret) \
-+ sdio_writeb((sdiodev)->func[0], (v), (addr), (ret))
-+
-+/* Accessors for SDIO Function 1 */
-+#define brcmf_sdiod_readb(sdiodev, addr, r) \
-+ sdio_readb((sdiodev)->func[1], (addr), (r))
-+
-+#define brcmf_sdiod_writeb(sdiodev, addr, v, ret) \
-+ sdio_writeb((sdiodev)->func[1], (v), (addr), (ret))
-+
-+u32 brcmf_sdiod_readl(struct brcmf_sdio_dev *sdiodev, u32 addr, int *ret);
-+void brcmf_sdiod_writel(struct brcmf_sdio_dev *sdiodev, u32 addr, u32 data,
-+ int *ret);
-
- /* Buffer transfer to/from device (client) core via cmd53.
- * fn: function number
diff --git a/package/kernel/mac80211/patches/312-v4.16-0005-brcmfmac-Tidy-register-definitions-a-little.patch b/package/kernel/mac80211/patches/312-v4.16-0005-brcmfmac-Tidy-register-definitions-a-little.patch
deleted file mode 100644
index e77d601a81..0000000000
--- a/package/kernel/mac80211/patches/312-v4.16-0005-brcmfmac-Tidy-register-definitions-a-little.patch
+++ /dev/null
@@ -1,59 +0,0 @@
-From eeef8a5da781e11746347b3cd9f1942be48ebaf0 Mon Sep 17 00:00:00 2001
-From: Ian Molton <ian@mnementh.co.uk>
-Date: Fri, 8 Dec 2017 13:10:30 +0100
-Subject: [PATCH] brcmfmac: Tidy register definitions a little
-
-Trivial tidy of register definitions.
-
-Signed-off-by: Ian Molton <ian@mnementh.co.uk>
-Acked-by: Arend van Spriel <arend.vanspriel@broadcom.com>
-Signed-off-by: Arend van Spriel <arend.vanspriel@broadcom.com>
-Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
----
- .../net/wireless/broadcom/brcm80211/brcmfmac/bcmsdh.c | 4 ++--
- .../net/wireless/broadcom/brcm80211/brcmfmac/sdio.h | 19 ++++++++++---------
- 2 files changed, 12 insertions(+), 11 deletions(-)
-
---- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/bcmsdh.c
-+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/bcmsdh.c
-@@ -153,9 +153,9 @@ int brcmf_sdiod_intr_register(struct brc
- brcmf_sdiod_func0_wb(sdiodev, SDIO_CCCR_IENx, data, &ret);
-
- /* redirect, configure and enable io for interrupt signal */
-- data = SDIO_SEPINT_MASK | SDIO_SEPINT_OE;
-+ data = SDIO_CCCR_BRCM_SEPINT_MASK | SDIO_CCCR_BRCM_SEPINT_OE;
- if (pdata->oob_irq_flags & IRQF_TRIGGER_HIGH)
-- data |= SDIO_SEPINT_ACT_HI;
-+ data |= SDIO_CCCR_BRCM_SEPINT_ACT_HI;
- brcmf_sdiod_func0_wb(sdiodev, SDIO_CCCR_BRCM_SEPINT,
- data, &ret);
- sdio_release_host(sdiodev->func[1]);
---- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.h
-+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.h
-@@ -52,16 +52,17 @@
- /* function 0 vendor specific CCCR registers */
-
- #define SDIO_CCCR_BRCM_CARDCAP 0xf0
--#define SDIO_CCCR_BRCM_CARDCAP_CMD14_SUPPORT 0x02
--#define SDIO_CCCR_BRCM_CARDCAP_CMD14_EXT 0x04
--#define SDIO_CCCR_BRCM_CARDCAP_CMD_NODEC 0x08
--#define SDIO_CCCR_BRCM_CARDCTRL 0xf1
--#define SDIO_CCCR_BRCM_CARDCTRL_WLANRESET 0x02
--#define SDIO_CCCR_BRCM_SEPINT 0xf2
-+#define SDIO_CCCR_BRCM_CARDCAP_CMD14_SUPPORT BIT(1)
-+#define SDIO_CCCR_BRCM_CARDCAP_CMD14_EXT BIT(2)
-+#define SDIO_CCCR_BRCM_CARDCAP_CMD_NODEC BIT(3)
-+
-+#define SDIO_CCCR_BRCM_CARDCTRL 0xf1
-+#define SDIO_CCCR_BRCM_CARDCTRL_WLANRESET BIT(1)
-
--#define SDIO_SEPINT_MASK 0x01
--#define SDIO_SEPINT_OE 0x02
--#define SDIO_SEPINT_ACT_HI 0x04
-+#define SDIO_CCCR_BRCM_SEPINT 0xf2
-+#define SDIO_CCCR_BRCM_SEPINT_MASK BIT(0)
-+#define SDIO_CCCR_BRCM_SEPINT_OE BIT(1)
-+#define SDIO_CCCR_BRCM_SEPINT_ACT_HI BIT(2)
-
- /* function 1 miscellaneous registers */
-
diff --git a/package/kernel/mac80211/patches/312-v4.16-0006-brcmfmac-Remove-brcmf_sdiod_addrprep.patch b/package/kernel/mac80211/patches/312-v4.16-0006-brcmfmac-Remove-brcmf_sdiod_addrprep.patch
deleted file mode 100644
index dc598aa471..0000000000
--- a/package/kernel/mac80211/patches/312-v4.16-0006-brcmfmac-Remove-brcmf_sdiod_addrprep.patch
+++ /dev/null
@@ -1,190 +0,0 @@
-From a7c3aa1509e243a09c5b1660c8702d792ca76aed Mon Sep 17 00:00:00 2001
-From: Ian Molton <ian@mnementh.co.uk>
-Date: Fri, 8 Dec 2017 13:10:31 +0100
-Subject: [PATCH] brcmfmac: Remove brcmf_sdiod_addrprep()
-
-This function has become trivial enough that it may as well be pushed into
-its callers, which has the side-benefit of clarifying what's going on.
-
-Remove it, and rename brcmf_sdiod_set_sbaddr_window() to
-brcmf_sdiod_set_backplane_window() as it's easier to understand.
-
-Signed-off-by: Ian Molton <ian@mnementh.co.uk>
-Reviewed-by: Arend van Spriel <arend.vanspriel@broadcom.com>
-Signed-off-by: Arend van Spriel <arend.vanspriel@broadcom.com>
-Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
----
- .../wireless/broadcom/brcm80211/brcmfmac/bcmsdh.c | 84 ++++++++++++----------
- 1 file changed, 46 insertions(+), 38 deletions(-)
-
---- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/bcmsdh.c
-+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/bcmsdh.c
-@@ -230,41 +230,25 @@ void brcmf_sdiod_change_state(struct brc
- sdiodev->state = state;
- }
-
--static int brcmf_sdiod_set_sbaddr_window(struct brcmf_sdio_dev *sdiodev,
-- u32 address)
-+static int brcmf_sdiod_set_backplane_window(struct brcmf_sdio_dev *sdiodev,
-+ u32 addr)
- {
-+ u32 v, bar0 = addr & SBSDIO_SBWINDOW_MASK;
- int err = 0, i;
-- u32 addr;
-
-- if (sdiodev->state == BRCMF_SDIOD_NOMEDIUM)
-- return -ENOMEDIUM;
-+ if (bar0 == sdiodev->sbwad)
-+ return 0;
-
-- addr = (address & SBSDIO_SBWINDOW_MASK) >> 8;
-+ v = bar0 >> 8;
-
-- for (i = 0 ; i < 3 && !err ; i++, addr >>= 8)
-+ for (i = 0 ; i < 3 && !err ; i++, v >>= 8)
- brcmf_sdiod_writeb(sdiodev, SBSDIO_FUNC1_SBADDRLOW + i,
-- addr & 0xff, &err);
--
-- return err;
--}
--
--static int brcmf_sdiod_addrprep(struct brcmf_sdio_dev *sdiodev, u32 *addr)
--{
-- uint bar0 = *addr & ~SBSDIO_SB_OFT_ADDR_MASK;
-- int err = 0;
--
-- if (bar0 != sdiodev->sbwad) {
-- err = brcmf_sdiod_set_sbaddr_window(sdiodev, bar0);
-- if (err)
-- return err;
-+ v & 0xff, &err);
-
-+ if (!err)
- sdiodev->sbwad = bar0;
-- }
-
-- *addr &= SBSDIO_SB_OFT_ADDR_MASK;
-- *addr |= SBSDIO_SB_ACCESS_2_4B_FLAG;
--
-- return 0;
-+ return err;
- }
-
- u32 brcmf_sdiod_readl(struct brcmf_sdio_dev *sdiodev, u32 addr, int *ret)
-@@ -272,11 +256,16 @@ u32 brcmf_sdiod_readl(struct brcmf_sdio_
- u32 data = 0;
- int retval;
-
-- retval = brcmf_sdiod_addrprep(sdiodev, &addr);
-+ retval = brcmf_sdiod_set_backplane_window(sdiodev, addr);
-+ if (retval)
-+ goto out;
-+
-+ addr &= SBSDIO_SB_OFT_ADDR_MASK;
-+ addr |= SBSDIO_SB_ACCESS_2_4B_FLAG;
-
-- if (!retval)
-- data = sdio_readl(sdiodev->func[1], addr, &retval);
-+ data = sdio_readl(sdiodev->func[1], addr, &retval);
-
-+out:
- if (ret)
- *ret = retval;
-
-@@ -288,11 +277,16 @@ void brcmf_sdiod_writel(struct brcmf_sdi
- {
- int retval;
-
-- retval = brcmf_sdiod_addrprep(sdiodev, &addr);
-+ retval = brcmf_sdiod_set_backplane_window(sdiodev, addr);
-+ if (retval)
-+ goto out;
-
-- if (!retval)
-- sdio_writel(sdiodev->func[1], data, addr, &retval);
-+ addr &= SBSDIO_SB_OFT_ADDR_MASK;
-+ addr |= SBSDIO_SB_ACCESS_2_4B_FLAG;
-
-+ sdio_writel(sdiodev->func[1], data, addr, &retval);
-+
-+out:
- if (ret)
- *ret = retval;
- }
-@@ -540,10 +534,13 @@ int brcmf_sdiod_recv_pkt(struct brcmf_sd
-
- brcmf_dbg(SDIO, "addr = 0x%x, size = %d\n", addr, pkt->len);
-
-- err = brcmf_sdiod_addrprep(sdiodev, &addr);
-+ err = brcmf_sdiod_set_backplane_window(sdiodev, addr);
- if (err)
- goto done;
-
-+ addr &= SBSDIO_SB_OFT_ADDR_MASK;
-+ addr |= SBSDIO_SB_ACCESS_2_4B_FLAG;
-+
- err = brcmf_sdiod_buff_read(sdiodev, SDIO_FUNC_2, addr, pkt);
-
- done:
-@@ -561,10 +558,13 @@ int brcmf_sdiod_recv_chain(struct brcmf_
- brcmf_dbg(SDIO, "addr = 0x%x, size = %d\n",
- addr, pktq->qlen);
-
-- err = brcmf_sdiod_addrprep(sdiodev, &addr);
-+ err = brcmf_sdiod_set_backplane_window(sdiodev, addr);
- if (err)
- goto done;
-
-+ addr &= SBSDIO_SB_OFT_ADDR_MASK;
-+ addr |= SBSDIO_SB_ACCESS_2_4B_FLAG;
-+
- if (pktq->qlen == 1)
- err = brcmf_sdiod_buff_read(sdiodev, SDIO_FUNC_2, addr,
- pktq->next);
-@@ -606,7 +606,12 @@ int brcmf_sdiod_send_buf(struct brcmf_sd
-
- memcpy(mypkt->data, buf, nbytes);
-
-- err = brcmf_sdiod_addrprep(sdiodev, &addr);
-+ err = brcmf_sdiod_set_backplane_window(sdiodev, addr);
-+ if (err)
-+ return err;
-+
-+ addr &= SBSDIO_SB_OFT_ADDR_MASK;
-+ addr |= SBSDIO_SB_ACCESS_2_4B_FLAG;
-
- if (!err)
- err = brcmf_sdiod_buff_write(sdiodev, SDIO_FUNC_2, addr, mypkt);
-@@ -625,10 +630,13 @@ int brcmf_sdiod_send_pkt(struct brcmf_sd
-
- brcmf_dbg(SDIO, "addr = 0x%x, size = %d\n", addr, pktq->qlen);
-
-- err = brcmf_sdiod_addrprep(sdiodev, &addr);
-+ err = brcmf_sdiod_set_backplane_window(sdiodev, addr);
- if (err)
- return err;
-
-+ addr &= SBSDIO_SB_OFT_ADDR_MASK;
-+ addr |= SBSDIO_SB_ACCESS_2_4B_FLAG;
-+
- if (pktq->qlen == 1 || !sdiodev->sg_support) {
- skb_queue_walk(pktq, skb) {
- err = brcmf_sdiod_buff_write(sdiodev, SDIO_FUNC_2,
-@@ -673,7 +681,7 @@ brcmf_sdiod_ramrw(struct brcmf_sdio_dev
- /* Do the transfer(s) */
- while (size) {
- /* Set the backplane window to include the start address */
-- err = brcmf_sdiod_set_sbaddr_window(sdiodev, address);
-+ err = brcmf_sdiod_set_backplane_window(sdiodev, address);
- if (err)
- break;
-
-@@ -716,7 +724,7 @@ brcmf_sdiod_ramrw(struct brcmf_sdio_dev
- dev_kfree_skb(pkt);
-
- /* Return the window to backplane enumeration space for core access */
-- if (brcmf_sdiod_set_sbaddr_window(sdiodev, sdiodev->sbwad))
-+ if (brcmf_sdiod_set_backplane_window(sdiodev, sdiodev->sbwad))
- brcmf_err("FAILED to set window back to 0x%x\n",
- sdiodev->sbwad);
-
diff --git a/package/kernel/mac80211/patches/312-v4.16-0007-brcmfmac-remove-unnecessary-call-to-brcmf_sdiod_set_.patch b/package/kernel/mac80211/patches/312-v4.16-0007-brcmfmac-remove-unnecessary-call-to-brcmf_sdiod_set_.patch
deleted file mode 100644
index b9410dd7d0..0000000000
--- a/package/kernel/mac80211/patches/312-v4.16-0007-brcmfmac-remove-unnecessary-call-to-brcmf_sdiod_set_.patch
+++ /dev/null
@@ -1,32 +0,0 @@
-From c900072bd6faff089aa4fb7b19136a2a0fe3baf0 Mon Sep 17 00:00:00 2001
-From: Ian Molton <ian@mnementh.co.uk>
-Date: Fri, 8 Dec 2017 13:10:32 +0100
-Subject: [PATCH] brcmfmac: remove unnecessary call to
- brcmf_sdiod_set_backplane_window()
-
-All functions that might require the window address changing call
-brcmf_sdiod_set_backplane_window() prior to access. Thus resetting
-the window is not required.
-
-Signed-off-by: Ian Molton <ian@mnementh.co.uk>
-[arend: corrected the driver prefix in the subject]
-Signed-off-by: Arend van Spriel <arend.vanspriel@broadcom.com>
-Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
----
- drivers/net/wireless/broadcom/brcm80211/brcmfmac/bcmsdh.c | 5 -----
- 1 file changed, 5 deletions(-)
-
---- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/bcmsdh.c
-+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/bcmsdh.c
-@@ -723,11 +723,6 @@ brcmf_sdiod_ramrw(struct brcmf_sdio_dev
-
- dev_kfree_skb(pkt);
-
-- /* Return the window to backplane enumeration space for core access */
-- if (brcmf_sdiod_set_backplane_window(sdiodev, sdiodev->sbwad))
-- brcmf_err("FAILED to set window back to 0x%x\n",
-- sdiodev->sbwad);
--
- sdio_release_host(sdiodev->func[1]);
-
- return err;
diff --git a/package/kernel/mac80211/patches/312-v4.16-0008-brcmfmac-Cleanup-offsetof.patch b/package/kernel/mac80211/patches/312-v4.16-0008-brcmfmac-Cleanup-offsetof.patch
deleted file mode 100644
index f9e5df550f..0000000000
--- a/package/kernel/mac80211/patches/312-v4.16-0008-brcmfmac-Cleanup-offsetof.patch
+++ /dev/null
@@ -1,134 +0,0 @@
-From e4c05fc3c0a6c79376f72f17d08014477e962ada Mon Sep 17 00:00:00 2001
-From: Ian Molton <ian@mnementh.co.uk>
-Date: Fri, 8 Dec 2017 13:10:33 +0100
-Subject: [PATCH] brcmfmac: Cleanup offsetof()
-
-Create a macro to make the code a bit more readable, whilst we're stuck
-with using struct element offsets as register offsets.
-
-Signed-off-by: Ian Molton <ian@mnementh.co.uk>
-Reviewed-by: Arend van Spriel <arend.vanspriel@broadcom.com>
-[arend: rename macro to SD_REG]
-Signed-off-by: Arend van Spriel <arend.vanspriel@broadcom.com>
-Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
----
- .../wireless/broadcom/brcm80211/brcmfmac/sdio.c | 35 +++++++++-------------
- 1 file changed, 14 insertions(+), 21 deletions(-)
-
---- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c
-+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c
-@@ -161,6 +161,8 @@ struct rte_console {
-
- #define CORE_BUS_REG(base, field) \
- (base + offsetof(struct sdpcmd_regs, field))
-+#define SD_REG(field) \
-+ (offsetof(struct sdpcmd_regs, field))
-
- /* SDIO function 1 register CHIPCLKCSR */
- /* Force ALP request to backplane */
-@@ -1087,12 +1089,10 @@ static u32 brcmf_sdio_hostmail(struct br
- brcmf_dbg(SDIO, "Enter\n");
-
- /* Read mailbox data and ack that we did so */
-- ret = r_sdreg32(bus, &hmb_data,
-- offsetof(struct sdpcmd_regs, tohostmailboxdata));
-+ ret = r_sdreg32(bus, &hmb_data, SD_REG(tohostmailboxdata));
-
- if (ret == 0)
-- w_sdreg32(bus, SMB_INT_ACK,
-- offsetof(struct sdpcmd_regs, tosbmailbox));
-+ w_sdreg32(bus, SMB_INT_ACK, SD_REG(tosbmailbox));
- bus->sdcnt.f1regdata += 2;
-
- /* dongle indicates the firmware has halted/crashed */
-@@ -1207,8 +1207,7 @@ static void brcmf_sdio_rxfail(struct brc
-
- if (rtx) {
- bus->sdcnt.rxrtx++;
-- err = w_sdreg32(bus, SMB_NAK,
-- offsetof(struct sdpcmd_regs, tosbmailbox));
-+ err = w_sdreg32(bus, SMB_NAK, SD_REG(tosbmailbox));
-
- bus->sdcnt.f1regdata++;
- if (err == 0)
-@@ -2333,9 +2332,7 @@ static uint brcmf_sdio_sendfromq(struct
- if (!bus->intr) {
- /* Check device status, signal pending interrupt */
- sdio_claim_host(bus->sdiodev->func[1]);
-- ret = r_sdreg32(bus, &intstatus,
-- offsetof(struct sdpcmd_regs,
-- intstatus));
-+ ret = r_sdreg32(bus, &intstatus, SD_REG(intstatus));
- sdio_release_host(bus->sdiodev->func[1]);
- bus->sdcnt.f2txdata++;
- if (ret != 0)
-@@ -2441,7 +2438,7 @@ static void brcmf_sdio_bus_stop(struct d
- brcmf_sdio_bus_sleep(bus, false, false);
-
- /* Disable and clear interrupts at the chip level also */
-- w_sdreg32(bus, 0, offsetof(struct sdpcmd_regs, hostintmask));
-+ w_sdreg32(bus, 0, SD_REG(hostintmask));
- local_hostintmask = bus->hostintmask;
- bus->hostintmask = 0;
-
-@@ -2460,8 +2457,7 @@ static void brcmf_sdio_bus_stop(struct d
- sdio_disable_func(sdiodev->func[SDIO_FUNC_2]);
-
- /* Clear any pending interrupts now that F2 is disabled */
-- w_sdreg32(bus, local_hostintmask,
-- offsetof(struct sdpcmd_regs, intstatus));
-+ w_sdreg32(bus, local_hostintmask, SD_REG(intstatus));
-
- sdio_release_host(sdiodev->func[1]);
- }
-@@ -2507,7 +2503,7 @@ static int brcmf_sdio_intr_rstatus(struc
- int ret;
-
- buscore = brcmf_chip_get_core(bus->ci, BCMA_CORE_SDIO_DEV);
-- addr = buscore->base + offsetof(struct sdpcmd_regs, intstatus);
-+ addr = buscore->base + SD_REG(intstatus);
-
- val = brcmf_sdiod_readl(bus->sdiodev, addr, &ret);
- bus->sdcnt.f1regdata++;
-@@ -2584,11 +2580,9 @@ static void brcmf_sdio_dpc(struct brcmf_
- */
- if (intstatus & I_HMB_FC_CHANGE) {
- intstatus &= ~I_HMB_FC_CHANGE;
-- err = w_sdreg32(bus, I_HMB_FC_CHANGE,
-- offsetof(struct sdpcmd_regs, intstatus));
-+ err = w_sdreg32(bus, I_HMB_FC_CHANGE, SD_REG(intstatus));
-
-- err = r_sdreg32(bus, &newstatus,
-- offsetof(struct sdpcmd_regs, intstatus));
-+ err = r_sdreg32(bus, &newstatus, SD_REG(intstatus));
- bus->sdcnt.f1regdata += 2;
- atomic_set(&bus->fcstate,
- !!(newstatus & (I_HMB_FC_STATE | I_HMB_FC_CHANGE)));
-@@ -3771,7 +3765,7 @@ static void brcmf_sdio_buscore_activate(
-
- /* clear all interrupts */
- core = brcmf_chip_get_core(chip, BCMA_CORE_SDIO_DEV);
-- reg_addr = core->base + offsetof(struct sdpcmd_regs, intstatus);
-+ reg_addr = core->base + SD_REG(intstatus);
- brcmf_sdiod_writel(sdiodev, reg_addr, 0xFFFFFFFF, NULL);
-
- if (rstvec)
-@@ -4067,7 +4061,7 @@ static void brcmf_sdio_firmware_callback
-
- /* Enable function 2 (frame transfers) */
- w_sdreg32(bus, SDPCM_PROT_VERSION << SMB_DATA_VERSION_SHIFT,
-- offsetof(struct sdpcmd_regs, tosbmailboxdata));
-+ SD_REG(tosbmailboxdata));
- err = sdio_enable_func(sdiodev->func[SDIO_FUNC_2]);
-
-
-@@ -4077,8 +4071,7 @@ static void brcmf_sdio_firmware_callback
- if (!err) {
- /* Set up the interrupt mask and enable interrupts */
- bus->hostintmask = HOSTINTMASK;
-- w_sdreg32(bus, bus->hostintmask,
-- offsetof(struct sdpcmd_regs, hostintmask));
-+ w_sdreg32(bus, bus->hostintmask, SD_REG(hostintmask));
-
- brcmf_sdiod_writeb(sdiodev, SBSDIO_WATERMARK, 8, &err);
- } else {
diff --git a/package/kernel/mac80211/patches/312-v4.16-0009-brcmfmac-Remove-unused-macro.patch b/package/kernel/mac80211/patches/312-v4.16-0009-brcmfmac-Remove-unused-macro.patch
deleted file mode 100644
index df72a70b3b..0000000000
--- a/package/kernel/mac80211/patches/312-v4.16-0009-brcmfmac-Remove-unused-macro.patch
+++ /dev/null
@@ -1,26 +0,0 @@
-From 5cfe38f1f8d3c6b98e15b8cfde05028a3c79930b Mon Sep 17 00:00:00 2001
-From: Ian Molton <ian@mnementh.co.uk>
-Date: Fri, 8 Dec 2017 13:10:34 +0100
-Subject: [PATCH] brcmfmac: Remove unused macro.
-
-This macro is used exactly nowhere in the code. Delete it.
-
-Signed-off-by: Ian Molton <ian@mnementh.co.uk>
-Reviewed-by: Arend van Spriel <arend.vanspriel@broadcom.com>
-Signed-off-by: Arend van Spriel <arend.vanspriel@broadcom.com>
-Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
----
- drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c | 2 --
- 1 file changed, 2 deletions(-)
-
---- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c
-+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c
-@@ -159,8 +159,6 @@ struct rte_console {
- /* manfid tuple length, include tuple, link bytes */
- #define SBSDIO_CIS_MANFID_TUPLE_LEN 6
-
--#define CORE_BUS_REG(base, field) \
-- (base + offsetof(struct sdpcmd_regs, field))
- #define SD_REG(field) \
- (offsetof(struct sdpcmd_regs, field))
-
diff --git a/package/kernel/mac80211/patches/312-v4.16-0010-brcmfmac-Remove-repeated-calls-to-brcmf_chip_get_cor.patch b/package/kernel/mac80211/patches/312-v4.16-0010-brcmfmac-Remove-repeated-calls-to-brcmf_chip_get_cor.patch
deleted file mode 100644
index 69fbf5c80f..0000000000
--- a/package/kernel/mac80211/patches/312-v4.16-0010-brcmfmac-Remove-repeated-calls-to-brcmf_chip_get_cor.patch
+++ /dev/null
@@ -1,128 +0,0 @@
-From 21a10846d09db3c5e3bdfb0be0fc7aa9fdc7000a Mon Sep 17 00:00:00 2001
-From: Ian Molton <ian@mnementh.co.uk>
-Date: Fri, 8 Dec 2017 13:10:35 +0100
-Subject: [PATCH] brcmfmac: Remove repeated calls to brcmf_chip_get_core()
-
-There is no need to repeatdly call brcmf_chip_get_core(), which
-traverses a list of cores every time its called (including during
-register access code!).
-
-Call it once, and store a pointer to the core structure. The existing
-code does nto keep track of users of the cores anyway, and even so, this
-will allow for easier refcounting in future.
-
-Signed-off-by: Ian Molton <ian@mnementh.co.uk>
-Reviewed-by: Arend van Spriel <arend.vanspriel@broadcom.com>
-Signed-off-by: Arend van Spriel <arend.vanspriel@broadcom.com>
-Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
----
- .../wireless/broadcom/brcm80211/brcmfmac/sdio.c | 25 +++++++++++++---------
- 1 file changed, 15 insertions(+), 10 deletions(-)
-
---- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c
-+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c
-@@ -436,6 +436,7 @@ struct brcmf_sdio_count {
- struct brcmf_sdio {
- struct brcmf_sdio_dev *sdiodev; /* sdio device handler */
- struct brcmf_chip *ci; /* Chip info struct */
-+ struct brcmf_core *sdio_core; /* sdio core info struct */
-
- u32 hostintmask; /* Copy of Host Interrupt Mask */
- atomic_t intstatus; /* Intstatus bits (events) pending */
-@@ -665,10 +666,9 @@ static bool data_ok(struct brcmf_sdio *b
- */
- static int r_sdreg32(struct brcmf_sdio *bus, u32 *regvar, u32 offset)
- {
-- struct brcmf_core *core;
-+ struct brcmf_core *core = bus->sdio_core;
- int ret;
-
-- core = brcmf_chip_get_core(bus->ci, BCMA_CORE_SDIO_DEV);
- *regvar = brcmf_sdiod_readl(bus->sdiodev, core->base + offset, &ret);
-
- return ret;
-@@ -676,10 +676,9 @@ static int r_sdreg32(struct brcmf_sdio *
-
- static int w_sdreg32(struct brcmf_sdio *bus, u32 regval, u32 reg_offset)
- {
-- struct brcmf_core *core;
-+ struct brcmf_core *core = bus->sdio_core;
- int ret;
-
-- core = brcmf_chip_get_core(bus->ci, BCMA_CORE_SDIO_DEV);
- brcmf_sdiod_writel(bus->sdiodev, core->base + reg_offset, regval, &ret);
-
- return ret;
-@@ -2495,12 +2494,11 @@ static inline void brcmf_sdio_clrintr(st
-
- static int brcmf_sdio_intr_rstatus(struct brcmf_sdio *bus)
- {
-- struct brcmf_core *buscore;
-+ struct brcmf_core *buscore = bus->sdio_core;
- u32 addr;
- unsigned long val;
- int ret;
-
-- buscore = brcmf_chip_get_core(bus->ci, BCMA_CORE_SDIO_DEV);
- addr = buscore->base + SD_REG(intstatus);
-
- val = brcmf_sdiod_readl(bus->sdiodev, addr, &ret);
-@@ -3377,13 +3375,14 @@ static void brcmf_sdio_sr_init(struct br
- /* enable KSO bit */
- static int brcmf_sdio_kso_init(struct brcmf_sdio *bus)
- {
-+ struct brcmf_core *core = bus->sdio_core;
- u8 val;
- int err = 0;
-
- brcmf_dbg(TRACE, "Enter\n");
-
- /* KSO bit added in SDIO core rev 12 */
-- if (brcmf_chip_get_core(bus->ci, BCMA_CORE_SDIO_DEV)->rev < 12)
-+ if (core->rev < 12)
- return 0;
-
- val = brcmf_sdiod_readb(bus->sdiodev, SBSDIO_FUNC1_SLEEPCSR, &err);
-@@ -3412,6 +3411,7 @@ static int brcmf_sdio_bus_preinit(struct
- struct brcmf_bus *bus_if = dev_get_drvdata(dev);
- struct brcmf_sdio_dev *sdiodev = bus_if->bus_priv.sdio;
- struct brcmf_sdio *bus = sdiodev->bus;
-+ struct brcmf_core *core = bus->sdio_core;
- uint pad_size;
- u32 value;
- int err;
-@@ -3420,7 +3420,7 @@ static int brcmf_sdio_bus_preinit(struct
- * a device perspective, ie. bus:txglom affects the
- * bus transfers from device to host.
- */
-- if (brcmf_chip_get_core(bus->ci, BCMA_CORE_SDIO_DEV)->rev < 12) {
-+ if (core->rev < 12) {
- /* for sdio core rev < 12, disable txgloming */
- value = 0;
- err = brcmf_iovar_data_set(dev, "bus:txglom", &value,
-@@ -3758,11 +3758,10 @@ static void brcmf_sdio_buscore_activate(
- u32 rstvec)
- {
- struct brcmf_sdio_dev *sdiodev = ctx;
-- struct brcmf_core *core;
-+ struct brcmf_core *core = sdiodev->bus->sdio_core;
- u32 reg_addr;
-
- /* clear all interrupts */
-- core = brcmf_chip_get_core(chip, BCMA_CORE_SDIO_DEV);
- reg_addr = core->base + SD_REG(intstatus);
- brcmf_sdiod_writel(sdiodev, reg_addr, 0xFFFFFFFF, NULL);
-
-@@ -3843,6 +3842,12 @@ brcmf_sdio_probe_attach(struct brcmf_sdi
- bus->ci = NULL;
- goto fail;
- }
-+
-+ /* Pick up the SDIO core info struct from chip.c */
-+ bus->sdio_core = brcmf_chip_get_core(bus->ci, BCMA_CORE_SDIO_DEV);
-+ if (!bus->sdio_core)
-+ goto fail;
-+
- sdiodev->settings = brcmf_get_module_param(sdiodev->dev,
- BRCMF_BUSTYPE_SDIO,
- bus->ci->chip,
diff --git a/package/kernel/mac80211/patches/313-v4.16-0001-brcmfmac-enlarge-buffer-size-of-caps-to-512-bytes.patch b/package/kernel/mac80211/patches/313-v4.16-0001-brcmfmac-enlarge-buffer-size-of-caps-to-512-bytes.patch
deleted file mode 100644
index 731b7eda1b..0000000000
--- a/package/kernel/mac80211/patches/313-v4.16-0001-brcmfmac-enlarge-buffer-size-of-caps-to-512-bytes.patch
+++ /dev/null
@@ -1,44 +0,0 @@
-From 7762bb134e3b40e8ee2611365775b7432190a9c7 Mon Sep 17 00:00:00 2001
-From: Wright Feng <wright.feng@cypress.com>
-Date: Mon, 11 Dec 2017 15:38:21 +0800
-Subject: [PATCH] brcmfmac: enlarge buffer size of caps to 512 bytes
-
-The buffer size of return of cap iovar is greater than 256 bytes in some
-firmwares. For instance, the return size of cap iovar is 271 bytes in 4373
-13.10.246.79 firmare. It makes feature capability parsing failed because
-caps buffer is default value.
-So we enlarge caps buffer size to 512 bytes and add the error print for
-cap iovar error.
-
-Signed-off-by: Wright Feng <wright.feng@cypress.com>
-Acked-by: Arend van Spriel <arend.vanspriel@broadcom.com>
-Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
----
- drivers/net/wireless/broadcom/brcm80211/brcmfmac/feature.c | 12 +++++++++---
- 1 file changed, 9 insertions(+), 3 deletions(-)
-
---- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/feature.c
-+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/feature.c
-@@ -130,13 +130,19 @@ static void brcmf_feat_iovar_data_set(st
- }
- }
-
-+#define MAX_CAPS_BUFFER_SIZE 512
- static void brcmf_feat_firmware_capabilities(struct brcmf_if *ifp)
- {
-- char caps[256];
-+ char caps[MAX_CAPS_BUFFER_SIZE];
- enum brcmf_feat_id id;
-- int i;
-+ int i, err;
-+
-+ err = brcmf_fil_iovar_data_get(ifp, "cap", caps, sizeof(caps));
-+ if (err) {
-+ brcmf_err("could not get firmware cap (%d)\n", err);
-+ return;
-+ }
-
-- brcmf_fil_iovar_data_get(ifp, "cap", caps, sizeof(caps));
- brcmf_dbg(INFO, "[ %s]\n", caps);
-
- for (i = 0; i < ARRAY_SIZE(brcmf_fwcap_map); i++) {
diff --git a/package/kernel/mac80211/patches/314-v4.16-0001-brcmfmac-Remove-r-w-_sdreg32.patch b/package/kernel/mac80211/patches/314-v4.16-0001-brcmfmac-Remove-r-w-_sdreg32.patch
deleted file mode 100644
index 291cd5d787..0000000000
--- a/package/kernel/mac80211/patches/314-v4.16-0001-brcmfmac-Remove-r-w-_sdreg32.patch
+++ /dev/null
@@ -1,227 +0,0 @@
-From 3d110df8f74781354051e4bb1e3e97fa368b2f80 Mon Sep 17 00:00:00 2001
-From: Ian Molton <ian@mnementh.co.uk>
-Date: Tue, 19 Dec 2017 13:47:07 +0100
-Subject: [PATCH] brcmfmac: Remove {r,w}_sdreg32
-
-Remove yet another IO function from the code and replace with one
-that already exists.
-
-Signed-off-by: Ian Molton <ian@mnementh.co.uk>
-Reviewed-by: Arend van Spriel <arend.vanspriel@broadcom.com>
-[arend: keep address calculation, ie. (base + offset) in one line]
-Signed-off-by: Arend van Spriel <arend.vanspriel@broadcom.com>
-Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
----
- .../wireless/broadcom/brcm80211/brcmfmac/sdio.c | 88 +++++++++++-----------
- 1 file changed, 42 insertions(+), 46 deletions(-)
-
---- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c
-+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c
-@@ -660,30 +660,6 @@ static bool data_ok(struct brcmf_sdio *b
- ((u8)(bus->tx_max - bus->tx_seq) & 0x80) == 0;
- }
-
--/*
-- * Reads a register in the SDIO hardware block. This block occupies a series of
-- * adresses on the 32 bit backplane bus.
-- */
--static int r_sdreg32(struct brcmf_sdio *bus, u32 *regvar, u32 offset)
--{
-- struct brcmf_core *core = bus->sdio_core;
-- int ret;
--
-- *regvar = brcmf_sdiod_readl(bus->sdiodev, core->base + offset, &ret);
--
-- return ret;
--}
--
--static int w_sdreg32(struct brcmf_sdio *bus, u32 regval, u32 reg_offset)
--{
-- struct brcmf_core *core = bus->sdio_core;
-- int ret;
--
-- brcmf_sdiod_writel(bus->sdiodev, core->base + reg_offset, regval, &ret);
--
-- return ret;
--}
--
- static int
- brcmf_sdio_kso_control(struct brcmf_sdio *bus, bool on)
- {
-@@ -1078,6 +1054,8 @@ static void brcmf_sdio_get_console_addr(
-
- static u32 brcmf_sdio_hostmail(struct brcmf_sdio *bus)
- {
-+ struct brcmf_sdio_dev *sdiod = bus->sdiodev;
-+ struct brcmf_core *core = bus->sdio_core;
- u32 intstatus = 0;
- u32 hmb_data;
- u8 fcbits;
-@@ -1086,10 +1064,14 @@ static u32 brcmf_sdio_hostmail(struct br
- brcmf_dbg(SDIO, "Enter\n");
-
- /* Read mailbox data and ack that we did so */
-- ret = r_sdreg32(bus, &hmb_data, SD_REG(tohostmailboxdata));
-+ hmb_data = brcmf_sdiod_readl(sdiod,
-+ core->base + SD_REG(tohostmailboxdata),
-+ &ret);
-+
-+ if (!ret)
-+ brcmf_sdiod_writel(sdiod, core->base + SD_REG(tosbmailbox),
-+ SMB_INT_ACK, &ret);
-
-- if (ret == 0)
-- w_sdreg32(bus, SMB_INT_ACK, SD_REG(tosbmailbox));
- bus->sdcnt.f1regdata += 2;
-
- /* dongle indicates the firmware has halted/crashed */
-@@ -1163,6 +1145,8 @@ static u32 brcmf_sdio_hostmail(struct br
-
- static void brcmf_sdio_rxfail(struct brcmf_sdio *bus, bool abort, bool rtx)
- {
-+ struct brcmf_sdio_dev *sdiod = bus->sdiodev;
-+ struct brcmf_core *core = bus->sdio_core;
- uint retries = 0;
- u16 lastrbc;
- u8 hi, lo;
-@@ -1204,7 +1188,8 @@ static void brcmf_sdio_rxfail(struct brc
-
- if (rtx) {
- bus->sdcnt.rxrtx++;
-- err = w_sdreg32(bus, SMB_NAK, SD_REG(tosbmailbox));
-+ brcmf_sdiod_writel(sdiod, core->base + SD_REG(tosbmailbox),
-+ SMB_NAK, &err);
-
- bus->sdcnt.f1regdata++;
- if (err == 0)
-@@ -2291,6 +2276,7 @@ static uint brcmf_sdio_sendfromq(struct
- {
- struct sk_buff *pkt;
- struct sk_buff_head pktq;
-+ u32 intstat_addr = bus->sdio_core->base + SD_REG(intstatus);
- u32 intstatus = 0;
- int ret = 0, prec_out, i;
- uint cnt = 0;
-@@ -2329,7 +2315,8 @@ static uint brcmf_sdio_sendfromq(struct
- if (!bus->intr) {
- /* Check device status, signal pending interrupt */
- sdio_claim_host(bus->sdiodev->func[1]);
-- ret = r_sdreg32(bus, &intstatus, SD_REG(intstatus));
-+ intstatus = brcmf_sdiod_readl(bus->sdiodev,
-+ intstat_addr, &ret);
- sdio_release_host(bus->sdiodev->func[1]);
- bus->sdcnt.f2txdata++;
- if (ret != 0)
-@@ -2413,12 +2400,13 @@ static int brcmf_sdio_tx_ctrlframe(struc
-
- static void brcmf_sdio_bus_stop(struct device *dev)
- {
-- u32 local_hostintmask;
-- u8 saveclk;
-- int err;
- struct brcmf_bus *bus_if = dev_get_drvdata(dev);
- struct brcmf_sdio_dev *sdiodev = bus_if->bus_priv.sdio;
- struct brcmf_sdio *bus = sdiodev->bus;
-+ struct brcmf_core *core = bus->sdio_core;
-+ u32 local_hostintmask;
-+ u8 saveclk;
-+ int err;
-
- brcmf_dbg(TRACE, "Enter\n");
-
-@@ -2435,7 +2423,9 @@ static void brcmf_sdio_bus_stop(struct d
- brcmf_sdio_bus_sleep(bus, false, false);
-
- /* Disable and clear interrupts at the chip level also */
-- w_sdreg32(bus, 0, SD_REG(hostintmask));
-+ brcmf_sdiod_writel(sdiodev, core->base + SD_REG(hostintmask),
-+ 0, NULL);
-+
- local_hostintmask = bus->hostintmask;
- bus->hostintmask = 0;
-
-@@ -2454,7 +2444,8 @@ static void brcmf_sdio_bus_stop(struct d
- sdio_disable_func(sdiodev->func[SDIO_FUNC_2]);
-
- /* Clear any pending interrupts now that F2 is disabled */
-- w_sdreg32(bus, local_hostintmask, SD_REG(intstatus));
-+ brcmf_sdiod_writel(sdiodev, core->base + SD_REG(intstatus),
-+ local_hostintmask, NULL);
-
- sdio_release_host(sdiodev->func[1]);
- }
-@@ -2521,7 +2512,9 @@ static int brcmf_sdio_intr_rstatus(struc
-
- static void brcmf_sdio_dpc(struct brcmf_sdio *bus)
- {
-+ struct brcmf_sdio_dev *sdiod = bus->sdiodev;
- u32 newstatus = 0;
-+ u32 intstat_addr = bus->sdio_core->base + SD_REG(intstatus);
- unsigned long intstatus;
- uint txlimit = bus->txbound; /* Tx frames to send before resched */
- uint framecnt; /* Temporary counter of tx/rx frames */
-@@ -2576,9 +2569,10 @@ static void brcmf_sdio_dpc(struct brcmf_
- */
- if (intstatus & I_HMB_FC_CHANGE) {
- intstatus &= ~I_HMB_FC_CHANGE;
-- err = w_sdreg32(bus, I_HMB_FC_CHANGE, SD_REG(intstatus));
-+ brcmf_sdiod_writel(sdiod, intstat_addr, I_HMB_FC_CHANGE, &err);
-+
-+ newstatus = brcmf_sdiod_readl(sdiod, intstat_addr, &err);
-
-- err = r_sdreg32(bus, &newstatus, SD_REG(intstatus));
- bus->sdcnt.f1regdata += 2;
- atomic_set(&bus->fcstate,
- !!(newstatus & (I_HMB_FC_STATE | I_HMB_FC_CHANGE)));
-@@ -4017,22 +4011,21 @@ static void brcmf_sdio_firmware_callback
- const struct firmware *code,
- void *nvram, u32 nvram_len)
- {
-- struct brcmf_bus *bus_if;
-- struct brcmf_sdio_dev *sdiodev;
-- struct brcmf_sdio *bus;
-+ struct brcmf_bus *bus_if = dev_get_drvdata(dev);
-+ struct brcmf_sdio_dev *sdiodev = bus_if->bus_priv.sdio;
-+ struct brcmf_sdio *bus = sdiodev->bus;
-+ struct brcmf_sdio_dev *sdiod = bus->sdiodev;
-+ struct brcmf_core *core = bus->sdio_core;
- u8 saveclk;
-
- brcmf_dbg(TRACE, "Enter: dev=%s, err=%d\n", dev_name(dev), err);
-- bus_if = dev_get_drvdata(dev);
-- sdiodev = bus_if->bus_priv.sdio;
-+
- if (err)
- goto fail;
-
- if (!bus_if->drvr)
- return;
-
-- bus = sdiodev->bus;
--
- /* try to download image and nvram to the dongle */
- bus->alp_only = true;
- err = brcmf_sdio_download_firmware(bus, code, nvram, nvram_len);
-@@ -4063,8 +4056,9 @@ static void brcmf_sdio_firmware_callback
- }
-
- /* Enable function 2 (frame transfers) */
-- w_sdreg32(bus, SDPCM_PROT_VERSION << SMB_DATA_VERSION_SHIFT,
-- SD_REG(tosbmailboxdata));
-+ brcmf_sdiod_writel(sdiod, core->base + SD_REG(tosbmailboxdata),
-+ SDPCM_PROT_VERSION << SMB_DATA_VERSION_SHIFT, NULL);
-+
- err = sdio_enable_func(sdiodev->func[SDIO_FUNC_2]);
-
-
-@@ -4074,7 +4068,9 @@ static void brcmf_sdio_firmware_callback
- if (!err) {
- /* Set up the interrupt mask and enable interrupts */
- bus->hostintmask = HOSTINTMASK;
-- w_sdreg32(bus, bus->hostintmask, SD_REG(hostintmask));
-+ brcmf_sdiod_writel(sdiod, core->base + SD_REG(hostintmask),
-+ bus->hostintmask, NULL);
-+
-
- brcmf_sdiod_writeb(sdiodev, SBSDIO_WATERMARK, 8, &err);
- } else {
diff --git a/package/kernel/mac80211/patches/314-v4.16-0002-brcmfmac-Rename-buscore-to-core-for-consistency.patch b/package/kernel/mac80211/patches/314-v4.16-0002-brcmfmac-Rename-buscore-to-core-for-consistency.patch
deleted file mode 100644
index e9b5628309..0000000000
--- a/package/kernel/mac80211/patches/314-v4.16-0002-brcmfmac-Rename-buscore-to-core-for-consistency.patch
+++ /dev/null
@@ -1,33 +0,0 @@
-From dbda7dacb79a377e8ed9d38ce0e4a58b70aa9060 Mon Sep 17 00:00:00 2001
-From: Arend Van Spriel <arend.vanspriel@broadcom.com>
-Date: Tue, 19 Dec 2017 13:47:08 +0100
-Subject: [PATCH] brcmfmac: Rename buscore to core for consistency
-
-Avoid confusion with unrelated _buscore labels.
-
-Signed-off-by: Ian Molton <ian@mnementh.co.uk>
-Acked-by: Arend van Spriel <arend.vanspriel@broadcom.com>
-[arend: only do the rename]
-Signed-off-by: Arend van Spriel <arend.vanspriel@broadcom.com>
-Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
----
- drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c | 4 ++--
- 1 file changed, 2 insertions(+), 2 deletions(-)
-
---- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c
-+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c
-@@ -2485,12 +2485,12 @@ static inline void brcmf_sdio_clrintr(st
-
- static int brcmf_sdio_intr_rstatus(struct brcmf_sdio *bus)
- {
-- struct brcmf_core *buscore = bus->sdio_core;
-+ struct brcmf_core *core = bus->sdio_core;
- u32 addr;
- unsigned long val;
- int ret;
-
-- addr = buscore->base + SD_REG(intstatus);
-+ addr = core->base + SD_REG(intstatus);
-
- val = brcmf_sdiod_readl(bus->sdiodev, addr, &ret);
- bus->sdcnt.f1regdata++;
diff --git a/package/kernel/mac80211/patches/314-v4.16-0003-brcmfmac-stabilise-the-value-of-sbwad-in-use-for-som.patch b/package/kernel/mac80211/patches/314-v4.16-0003-brcmfmac-stabilise-the-value-of-sbwad-in-use-for-som.patch
deleted file mode 100644
index 3828c320f4..0000000000
--- a/package/kernel/mac80211/patches/314-v4.16-0003-brcmfmac-stabilise-the-value-of-sbwad-in-use-for-som.patch
+++ /dev/null
@@ -1,82 +0,0 @@
-From 874bb8e49b7c6368f8ff9f2566c7bd06a2249be0 Mon Sep 17 00:00:00 2001
-From: Ian Molton <ian@mnementh.co.uk>
-Date: Tue, 19 Dec 2017 13:47:09 +0100
-Subject: [PATCH] brcmfmac: stabilise the value of ->sbwad in use for some xfer
- routines.
-
-The IO functions operate within the Chipcommon IO window. Explicitly
-set this, rather than relying on the last initialisation IO access to
-leave it set to the right value by chance.
-
-Signed-off-by: Ian Molton <ian@mnementh.co.uk>
-Acked-by: Arend van Spriel <arend.vanspriel@broadcom.com>
-Signed-off-by: Arend van Spriel <arend.vanspriel@broadcom.com>
-Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
----
- drivers/net/wireless/broadcom/brcm80211/brcmfmac/bcmsdh.c | 8 ++++----
- drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c | 5 +++++
- drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.h | 1 +
- 3 files changed, 10 insertions(+), 4 deletions(-)
-
---- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/bcmsdh.c
-+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/bcmsdh.c
-@@ -529,7 +529,7 @@ int brcmf_sdiod_recv_buf(struct brcmf_sd
-
- int brcmf_sdiod_recv_pkt(struct brcmf_sdio_dev *sdiodev, struct sk_buff *pkt)
- {
-- u32 addr = sdiodev->sbwad;
-+ u32 addr = sdiodev->cc_core->base;
- int err = 0;
-
- brcmf_dbg(SDIO, "addr = 0x%x, size = %d\n", addr, pkt->len);
-@@ -552,7 +552,7 @@ int brcmf_sdiod_recv_chain(struct brcmf_
- {
- struct sk_buff *glom_skb = NULL;
- struct sk_buff *skb;
-- u32 addr = sdiodev->sbwad;
-+ u32 addr = sdiodev->cc_core->base;
- int err = 0;
-
- brcmf_dbg(SDIO, "addr = 0x%x, size = %d\n",
-@@ -593,7 +593,7 @@ done:
- int brcmf_sdiod_send_buf(struct brcmf_sdio_dev *sdiodev, u8 *buf, uint nbytes)
- {
- struct sk_buff *mypkt;
-- u32 addr = sdiodev->sbwad;
-+ u32 addr = sdiodev->cc_core->base;
- int err;
-
- mypkt = brcmu_pkt_buf_get_skb(nbytes);
-@@ -625,7 +625,7 @@ int brcmf_sdiod_send_pkt(struct brcmf_sd
- struct sk_buff_head *pktq)
- {
- struct sk_buff *skb;
-- u32 addr = sdiodev->sbwad;
-+ u32 addr = sdiodev->cc_core->base;
- int err;
-
- brcmf_dbg(SDIO, "addr = 0x%x, size = %d\n", addr, pktq->qlen);
---- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c
-+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c
-@@ -3842,6 +3842,11 @@ brcmf_sdio_probe_attach(struct brcmf_sdi
- if (!bus->sdio_core)
- goto fail;
-
-+ /* Pick up the CHIPCOMMON core info struct, for bulk IO in bcmsdh.c */
-+ sdiodev->cc_core = brcmf_chip_get_core(bus->ci, BCMA_CORE_CHIPCOMMON);
-+ if (!sdiodev->cc_core)
-+ goto fail;
-+
- sdiodev->settings = brcmf_get_module_param(sdiodev->dev,
- BRCMF_BUSTYPE_SDIO,
- bus->ci->chip,
---- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.h
-+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.h
-@@ -178,6 +178,7 @@ struct brcmf_sdio_dev {
- struct sdio_func *func[SDIO_MAX_FUNCS];
- u8 num_funcs; /* Supported funcs on client */
- u32 sbwad; /* Save backplane window address */
-+ struct brcmf_core *cc_core; /* chipcommon core info struct */
- struct brcmf_sdio *bus;
- struct device *dev;
- struct brcmf_bus *bus_if;
diff --git a/package/kernel/mac80211/patches/314-v4.16-0004-brcmfmac-Correctly-handle-accesses-to-SDIO-func0.patch b/package/kernel/mac80211/patches/314-v4.16-0004-brcmfmac-Correctly-handle-accesses-to-SDIO-func0.patch
deleted file mode 100644
index 86b269a348..0000000000
--- a/package/kernel/mac80211/patches/314-v4.16-0004-brcmfmac-Correctly-handle-accesses-to-SDIO-func0.patch
+++ /dev/null
@@ -1,45 +0,0 @@
-From 508422f3695bf66f7b85fb4723c22f5166003ec6 Mon Sep 17 00:00:00 2001
-From: Ian Molton <ian@mnementh.co.uk>
-Date: Tue, 19 Dec 2017 13:47:10 +0100
-Subject: [PATCH] brcmfmac: Correctly handle accesses to SDIO func0
-
-Rather than workaround the restrictions on func0 addressing in the
-driver, set MMC_QUIRK_LENIENT_FN0
-
-Signed-off-by: Ian Molton <ian@mnementh.co.uk>
-Acked-by: Arend van Spriel <arend.vanspriel@broadcom.com>
-Signed-off-by: Arend van Spriel <arend.vanspriel@broadcom.com>
-Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
----
- drivers/net/wireless/broadcom/brcm80211/brcmfmac/bcmsdh.c | 4 ++++
- drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.h | 4 ++--
- 2 files changed, 6 insertions(+), 2 deletions(-)
-
---- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/bcmsdh.c
-+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/bcmsdh.c
-@@ -995,6 +995,10 @@ static int brcmf_ops_sdio_probe(struct s
- brcmf_dbg(SDIO, "Function#: %d\n", func->num);
-
- dev = &func->dev;
-+
-+ /* Set MMC_QUIRK_LENIENT_FN0 for this card */
-+ func->card->quirks |= MMC_QUIRK_LENIENT_FN0;
-+
- /* prohibit ACPI power management for this device */
- brcmf_sdiod_acpi_set_power_manageable(dev, 0);
-
---- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.h
-+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.h
-@@ -297,10 +297,10 @@ void brcmf_sdiod_intr_unregister(struct
- /* SDIO device register access interface */
- /* Accessors for SDIO Function 0 */
- #define brcmf_sdiod_func0_rb(sdiodev, addr, r) \
-- sdio_readb((sdiodev)->func[0], (addr), (r))
-+ sdio_f0_readb((sdiodev)->func[0], (addr), (r))
-
- #define brcmf_sdiod_func0_wb(sdiodev, addr, v, ret) \
-- sdio_writeb((sdiodev)->func[0], (v), (addr), (ret))
-+ sdio_f0_writeb((sdiodev)->func[0], (v), (addr), (ret))
-
- /* Accessors for SDIO Function 1 */
- #define brcmf_sdiod_readb(sdiodev, addr, r) \
diff --git a/package/kernel/mac80211/patches/314-v4.16-0005-brcmfmac-Remove-func0-from-function-array.patch b/package/kernel/mac80211/patches/314-v4.16-0005-brcmfmac-Remove-func0-from-function-array.patch
deleted file mode 100644
index 715b865619..0000000000
--- a/package/kernel/mac80211/patches/314-v4.16-0005-brcmfmac-Remove-func0-from-function-array.patch
+++ /dev/null
@@ -1,111 +0,0 @@
-From 99d7b6fdfc8c24052c92c720330d31ca1332f996 Mon Sep 17 00:00:00 2001
-From: Ian Molton <ian@mnementh.co.uk>
-Date: Tue, 19 Dec 2017 13:47:11 +0100
-Subject: [PATCH] brcmfmac: Remove func0 from function array
-
-func0 is not provided by the mmc stack as a function when probing.
-Instead providing specific access functions to read/write it.
-
-This prepares for a patch to remove the actual array entry itself.
-
-Signed-off-by: Ian Molton <ian@mnementh.co.uk>
-Acked-by: Arend van Spriel <arend.vanspriel@broadcom.com>
-[arend: rephrased the commit message]
-[arend: removed unrelated comment for which separate patch is warranted]
-Signed-off-by: Arend van Spriel <arend.vanspriel@broadcom.com>
-Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
----
- drivers/net/wireless/broadcom/brcm80211/brcmfmac/bcmsdh.c | 5 +----
- drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c | 7 ++++---
- drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.h | 13 ++++++-------
- 3 files changed, 11 insertions(+), 14 deletions(-)
-
---- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/bcmsdh.c
-+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/bcmsdh.c
-@@ -1022,8 +1022,7 @@ static int brcmf_ops_sdio_probe(struct s
- /* store refs to functions used. mmc_card does
- * not hold the F0 function pointer.
- */
-- sdiodev->func[0] = kmemdup(func, sizeof(*func), GFP_KERNEL);
-- sdiodev->func[0]->num = 0;
-+ sdiodev->func[0] = NULL;
- sdiodev->func[1] = func->card->sdio_func[0];
- sdiodev->func[2] = func;
-
-@@ -1049,7 +1048,6 @@ static int brcmf_ops_sdio_probe(struct s
- fail:
- dev_set_drvdata(&func->dev, NULL);
- dev_set_drvdata(&sdiodev->func[1]->dev, NULL);
-- kfree(sdiodev->func[0]);
- kfree(sdiodev);
- kfree(bus_if);
- return err;
-@@ -1082,7 +1080,6 @@ static void brcmf_ops_sdio_remove(struct
- dev_set_drvdata(&sdiodev->func[2]->dev, NULL);
-
- kfree(bus_if);
-- kfree(sdiodev->func[0]);
- kfree(sdiodev);
- }
-
---- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c
-+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c
-@@ -3771,9 +3771,10 @@ static u32 brcmf_sdio_buscore_read32(voi
- u32 val, rev;
-
- val = brcmf_sdiod_readl(sdiodev, addr, NULL);
-- if ((sdiodev->func[0]->device == SDIO_DEVICE_ID_BROADCOM_4335_4339 ||
-- sdiodev->func[0]->device == SDIO_DEVICE_ID_BROADCOM_4339) &&
-- addr == CORE_CC_REG(SI_ENUM_BASE, chipid)) {
-+
-+ if ((sdiodev->func[1]->device == SDIO_DEVICE_ID_BROADCOM_4335_4339 ||
-+ sdiodev->func[1]->device == SDIO_DEVICE_ID_BROADCOM_4339) &&
-+ addr == CORE_CC_REG(SI_ENUM_BASE, chipid)) {
- rev = (val & CID_REV_MASK) >> CID_REV_SHIFT;
- if (rev >= 2) {
- val &= ~CID_ID_MASK;
---- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.h
-+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.h
-@@ -21,7 +21,9 @@
- #include <linux/firmware.h>
- #include "firmware.h"
-
--#define SDIO_FUNC_0 0
-+/* Maximum number of I/O funcs */
-+#define NUM_SDIO_FUNCS 3
-+
- #define SDIO_FUNC_1 1
- #define SDIO_FUNC_2 2
-
-@@ -39,9 +41,6 @@
- #define INTR_STATUS_FUNC1 0x2
- #define INTR_STATUS_FUNC2 0x4
-
--/* Maximum number of I/O funcs */
--#define SDIOD_MAX_IOFUNCS 7
--
- /* mask of register map */
- #define REG_F0_REG_MASK 0x7FF
- #define REG_F1_MISC_MASK 0x1FFFF
-@@ -175,7 +174,7 @@ struct brcmf_sdio;
- struct brcmf_sdiod_freezer;
-
- struct brcmf_sdio_dev {
-- struct sdio_func *func[SDIO_MAX_FUNCS];
-+ struct sdio_func *func[NUM_SDIO_FUNCS];
- u8 num_funcs; /* Supported funcs on client */
- u32 sbwad; /* Save backplane window address */
- struct brcmf_core *cc_core; /* chipcommon core info struct */
-@@ -297,10 +296,10 @@ void brcmf_sdiod_intr_unregister(struct
- /* SDIO device register access interface */
- /* Accessors for SDIO Function 0 */
- #define brcmf_sdiod_func0_rb(sdiodev, addr, r) \
-- sdio_f0_readb((sdiodev)->func[0], (addr), (r))
-+ sdio_f0_readb((sdiodev)->func[1], (addr), (r))
-
- #define brcmf_sdiod_func0_wb(sdiodev, addr, v, ret) \
-- sdio_f0_writeb((sdiodev)->func[0], (v), (addr), (ret))
-+ sdio_f0_writeb((sdiodev)->func[1], (v), (addr), (ret))
-
- /* Accessors for SDIO Function 1 */
- #define brcmf_sdiod_readb(sdiodev, addr, r) \
diff --git a/package/kernel/mac80211/patches/314-v4.16-0006-brcmfmac-More-efficient-and-slightly-easier-to-read-.patch b/package/kernel/mac80211/patches/314-v4.16-0006-brcmfmac-More-efficient-and-slightly-easier-to-read-.patch
deleted file mode 100644
index 71e4894b06..0000000000
--- a/package/kernel/mac80211/patches/314-v4.16-0006-brcmfmac-More-efficient-and-slightly-easier-to-read-.patch
+++ /dev/null
@@ -1,40 +0,0 @@
-From bcadaaa097c7ec103fe75f9da41f8fe52693b644 Mon Sep 17 00:00:00 2001
-From: Arend Van Spriel <arend.vanspriel@broadcom.com>
-Date: Tue, 19 Dec 2017 13:47:12 +0100
-Subject: [PATCH] brcmfmac: More efficient and slightly easier to read fixup
- for 4339 chips
-
-Its more efficient to test the register we're interested in first,
-potentially avoiding two more comparisons, and therefore always avoiding
-one comparison per call on all other chips.
-
-Signed-off-by: Ian Molton <ian@mnementh.co.uk>
-[arend: fix some checkpatch warnings]
-Signed-off-by: Arend van Spriel <arend.vanspriel@broadcom.com>
-Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
----
- drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c | 7 ++++---
- 1 file changed, 4 insertions(+), 3 deletions(-)
-
---- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c
-+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c
-@@ -3772,15 +3772,16 @@ static u32 brcmf_sdio_buscore_read32(voi
-
- val = brcmf_sdiod_readl(sdiodev, addr, NULL);
-
-- if ((sdiodev->func[1]->device == SDIO_DEVICE_ID_BROADCOM_4335_4339 ||
-- sdiodev->func[1]->device == SDIO_DEVICE_ID_BROADCOM_4339) &&
-- addr == CORE_CC_REG(SI_ENUM_BASE, chipid)) {
-+ if (addr == CORE_CC_REG(SI_ENUM_BASE, chipid) &&
-+ (sdiodev->func[1]->device == SDIO_DEVICE_ID_BROADCOM_4339 ||
-+ sdiodev->func[1]->device == SDIO_DEVICE_ID_BROADCOM_4335_4339)) {
- rev = (val & CID_REV_MASK) >> CID_REV_SHIFT;
- if (rev >= 2) {
- val &= ~CID_ID_MASK;
- val |= BRCM_CC_4339_CHIP_ID;
- }
- }
-+
- return val;
- }
-
diff --git a/package/kernel/mac80211/patches/314-v4.16-0007-brcmfmac-Replace-function-index-with-function-pointe.patch b/package/kernel/mac80211/patches/314-v4.16-0007-brcmfmac-Replace-function-index-with-function-pointe.patch
deleted file mode 100644
index 4354a7081c..0000000000
--- a/package/kernel/mac80211/patches/314-v4.16-0007-brcmfmac-Replace-function-index-with-function-pointe.patch
+++ /dev/null
@@ -1,347 +0,0 @@
-From 00eb62cfc5f806b003fe5d54c8b5fe9a9665482f Mon Sep 17 00:00:00 2001
-From: Ian Molton <ian@mnementh.co.uk>
-Date: Tue, 19 Dec 2017 13:47:13 +0100
-Subject: [PATCH] brcmfmac: Replace function index with function pointer
-
-In preparation for removing the function array, remove all code that
-refers to function by index and replace with pointers to the function
-itself.
-
-Signed-off-by: Ian Molton <ian@mnementh.co.uk>
-Reviewed-by: Arend van Spriel <arend.vanspriel@broadcom.com>
-[arend: replace BUG() with WARN() macro]
-Signed-off-by: Arend van Spriel <arend.vanspriel@broadcom.com>
-Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
----
- .../wireless/broadcom/brcm80211/brcmfmac/bcmsdh.c | 85 ++++++++++++----------
- .../wireless/broadcom/brcm80211/brcmfmac/sdio.c | 15 ++--
- .../wireless/broadcom/brcm80211/brcmfmac/sdio.h | 6 +-
- 3 files changed, 56 insertions(+), 50 deletions(-)
-
---- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/bcmsdh.c
-+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/bcmsdh.c
-@@ -291,8 +291,9 @@ out:
- *ret = retval;
- }
-
--static int brcmf_sdiod_buff_read(struct brcmf_sdio_dev *sdiodev, uint fn,
-- u32 addr, struct sk_buff *pkt)
-+static int brcmf_sdiod_buff_read(struct brcmf_sdio_dev *sdiodev,
-+ struct sdio_func *func, u32 addr,
-+ struct sk_buff *pkt)
- {
- unsigned int req_sz;
- int err;
-@@ -301,13 +302,19 @@ static int brcmf_sdiod_buff_read(struct
- req_sz = pkt->len + 3;
- req_sz &= (uint)~3;
-
-- if (fn == 1)
-- err = sdio_memcpy_fromio(sdiodev->func[fn],
-- ((u8 *)(pkt->data)), addr, req_sz);
-- else
-- /* function 2 read is FIFO operation */
-- err = sdio_readsb(sdiodev->func[fn],
-- ((u8 *)(pkt->data)), addr, req_sz);
-+ switch (func->num) {
-+ case 1:
-+ err = sdio_memcpy_fromio(func, ((u8 *)(pkt->data)), addr,
-+ req_sz);
-+ break;
-+ case 2:
-+ err = sdio_readsb(func, ((u8 *)(pkt->data)), addr, req_sz);
-+ break;
-+ default:
-+ /* bail out as things are really fishy here */
-+ WARN(1, "invalid sdio function number: %d\n", func->num);
-+ err = -ENOMEDIUM;
-+ };
-
- if (err == -ENOMEDIUM)
- brcmf_sdiod_change_state(sdiodev, BRCMF_SDIOD_NOMEDIUM);
-@@ -315,8 +322,9 @@ static int brcmf_sdiod_buff_read(struct
- return err;
- }
-
--static int brcmf_sdiod_buff_write(struct brcmf_sdio_dev *sdiodev, uint fn,
-- u32 addr, struct sk_buff *pkt)
-+static int brcmf_sdiod_buff_write(struct brcmf_sdio_dev *sdiodev,
-+ struct sdio_func *func, u32 addr,
-+ struct sk_buff *pkt)
- {
- unsigned int req_sz;
- int err;
-@@ -325,8 +333,7 @@ static int brcmf_sdiod_buff_write(struct
- req_sz = pkt->len + 3;
- req_sz &= (uint)~3;
-
-- err = sdio_memcpy_toio(sdiodev->func[fn], addr,
-- ((u8 *)(pkt->data)), req_sz);
-+ err = sdio_memcpy_toio(func, addr, ((u8 *)(pkt->data)), req_sz);
-
- if (err == -ENOMEDIUM)
- brcmf_sdiod_change_state(sdiodev, BRCMF_SDIOD_NOMEDIUM);
-@@ -337,7 +344,7 @@ static int brcmf_sdiod_buff_write(struct
- /**
- * brcmf_sdiod_sglist_rw - SDIO interface function for block data access
- * @sdiodev: brcmfmac sdio device
-- * @fn: SDIO function number
-+ * @func: SDIO function
- * @write: direction flag
- * @addr: dongle memory address as source/destination
- * @pkt: skb pointer
-@@ -346,7 +353,8 @@ static int brcmf_sdiod_buff_write(struct
- * stack for block data access. It assumes that the skb passed down by the
- * caller has already been padded and aligned.
- */
--static int brcmf_sdiod_sglist_rw(struct brcmf_sdio_dev *sdiodev, uint fn,
-+static int brcmf_sdiod_sglist_rw(struct brcmf_sdio_dev *sdiodev,
-+ struct sdio_func *func,
- bool write, u32 addr,
- struct sk_buff_head *pktlist)
- {
-@@ -372,7 +380,7 @@ static int brcmf_sdiod_sglist_rw(struct
- req_sz = 0;
- skb_queue_walk(pktlist, pkt_next)
- req_sz += pkt_next->len;
-- req_sz = ALIGN(req_sz, sdiodev->func[fn]->cur_blksize);
-+ req_sz = ALIGN(req_sz, func->cur_blksize);
- while (req_sz > PAGE_SIZE) {
- pkt_next = brcmu_pkt_buf_get_skb(PAGE_SIZE);
- if (pkt_next == NULL) {
-@@ -391,7 +399,7 @@ static int brcmf_sdiod_sglist_rw(struct
- target_list = &local_list;
- }
-
-- func_blk_sz = sdiodev->func[fn]->cur_blksize;
-+ func_blk_sz = func->cur_blksize;
- max_req_sz = sdiodev->max_request_size;
- max_seg_cnt = min_t(unsigned short, sdiodev->max_segment_count,
- target_list->qlen);
-@@ -408,10 +416,10 @@ static int brcmf_sdiod_sglist_rw(struct
- mmc_dat.flags = write ? MMC_DATA_WRITE : MMC_DATA_READ;
- mmc_cmd.opcode = SD_IO_RW_EXTENDED;
- mmc_cmd.arg = write ? 1<<31 : 0; /* write flag */
-- mmc_cmd.arg |= (fn & 0x7) << 28; /* SDIO func num */
-- mmc_cmd.arg |= 1<<27; /* block mode */
-+ mmc_cmd.arg |= (func->num & 0x7) << 28; /* SDIO func num */
-+ mmc_cmd.arg |= 1 << 27; /* block mode */
- /* for function 1 the addr will be incremented */
-- mmc_cmd.arg |= (fn == 1) ? 1<<26 : 0;
-+ mmc_cmd.arg |= (func->num == 1) ? 1 << 26 : 0;
- mmc_cmd.flags = MMC_RSP_SPI_R5 | MMC_RSP_R5 | MMC_CMD_ADTC;
- mmc_req.cmd = &mmc_cmd;
- mmc_req.data = &mmc_dat;
-@@ -457,11 +465,11 @@ static int brcmf_sdiod_sglist_rw(struct
- mmc_cmd.arg |= (addr & 0x1FFFF) << 9; /* address */
- mmc_cmd.arg |= mmc_dat.blocks & 0x1FF; /* block count */
- /* incrementing addr for function 1 */
-- if (fn == 1)
-+ if (func->num == 1)
- addr += req_sz;
-
-- mmc_set_data_timeout(&mmc_dat, sdiodev->func[fn]->card);
-- mmc_wait_for_req(sdiodev->func[fn]->card->host, &mmc_req);
-+ mmc_set_data_timeout(&mmc_dat, func->card);
-+ mmc_wait_for_req(func->card->host, &mmc_req);
-
- ret = mmc_cmd.error ? mmc_cmd.error : mmc_dat.error;
- if (ret == -ENOMEDIUM) {
-@@ -541,7 +549,7 @@ int brcmf_sdiod_recv_pkt(struct brcmf_sd
- addr &= SBSDIO_SB_OFT_ADDR_MASK;
- addr |= SBSDIO_SB_ACCESS_2_4B_FLAG;
-
-- err = brcmf_sdiod_buff_read(sdiodev, SDIO_FUNC_2, addr, pkt);
-+ err = brcmf_sdiod_buff_read(sdiodev, sdiodev->func[2], addr, pkt);
-
- done:
- return err;
-@@ -566,13 +574,13 @@ int brcmf_sdiod_recv_chain(struct brcmf_
- addr |= SBSDIO_SB_ACCESS_2_4B_FLAG;
-
- if (pktq->qlen == 1)
-- err = brcmf_sdiod_buff_read(sdiodev, SDIO_FUNC_2, addr,
-+ err = brcmf_sdiod_buff_read(sdiodev, sdiodev->func[2], addr,
- pktq->next);
- else if (!sdiodev->sg_support) {
- glom_skb = brcmu_pkt_buf_get_skb(totlen);
- if (!glom_skb)
- return -ENOMEM;
-- err = brcmf_sdiod_buff_read(sdiodev, SDIO_FUNC_2, addr,
-+ err = brcmf_sdiod_buff_read(sdiodev, sdiodev->func[2], addr,
- glom_skb);
- if (err)
- goto done;
-@@ -582,8 +590,8 @@ int brcmf_sdiod_recv_chain(struct brcmf_
- skb_pull(glom_skb, skb->len);
- }
- } else
-- err = brcmf_sdiod_sglist_rw(sdiodev, SDIO_FUNC_2, false, addr,
-- pktq);
-+ err = brcmf_sdiod_sglist_rw(sdiodev, sdiodev->func[2], false,
-+ addr, pktq);
-
- done:
- brcmu_pkt_buf_free_skb(glom_skb);
-@@ -614,7 +622,8 @@ int brcmf_sdiod_send_buf(struct brcmf_sd
- addr |= SBSDIO_SB_ACCESS_2_4B_FLAG;
-
- if (!err)
-- err = brcmf_sdiod_buff_write(sdiodev, SDIO_FUNC_2, addr, mypkt);
-+ err = brcmf_sdiod_buff_write(sdiodev, sdiodev->func[2], addr,
-+ mypkt);
-
- brcmu_pkt_buf_free_skb(mypkt);
-
-@@ -639,14 +648,14 @@ int brcmf_sdiod_send_pkt(struct brcmf_sd
-
- if (pktq->qlen == 1 || !sdiodev->sg_support) {
- skb_queue_walk(pktq, skb) {
-- err = brcmf_sdiod_buff_write(sdiodev, SDIO_FUNC_2,
-+ err = brcmf_sdiod_buff_write(sdiodev, sdiodev->func[2],
- addr, skb);
- if (err)
- break;
- }
- } else {
-- err = brcmf_sdiod_sglist_rw(sdiodev, SDIO_FUNC_2, true, addr,
-- pktq);
-+ err = brcmf_sdiod_sglist_rw(sdiodev, sdiodev->func[2], true,
-+ addr, pktq);
- }
-
- return err;
-@@ -696,10 +705,10 @@ brcmf_sdiod_ramrw(struct brcmf_sdio_dev
-
- if (write) {
- memcpy(pkt->data, data, dsize);
-- err = brcmf_sdiod_buff_write(sdiodev, SDIO_FUNC_1,
-+ err = brcmf_sdiod_buff_write(sdiodev, sdiodev->func[1],
- sdaddr, pkt);
- } else {
-- err = brcmf_sdiod_buff_read(sdiodev, SDIO_FUNC_1,
-+ err = brcmf_sdiod_buff_read(sdiodev, sdiodev->func[1],
- sdaddr, pkt);
- }
-
-@@ -728,12 +737,12 @@ brcmf_sdiod_ramrw(struct brcmf_sdio_dev
- return err;
- }
-
--int brcmf_sdiod_abort(struct brcmf_sdio_dev *sdiodev, u8 fn)
-+int brcmf_sdiod_abort(struct brcmf_sdio_dev *sdiodev, struct sdio_func *func)
- {
- brcmf_dbg(SDIO, "Enter\n");
-
- /* Issue abort cmd52 command through F0 */
-- brcmf_sdiod_func0_wb(sdiodev, SDIO_CCCR_ABORT, fn, NULL);
-+ brcmf_sdiod_func0_wb(sdiodev, SDIO_CCCR_ABORT, func->num, NULL);
-
- brcmf_dbg(SDIO, "Exit\n");
- return 0;
-@@ -1105,7 +1114,7 @@ static int brcmf_ops_sdio_suspend(struct
-
- func = container_of(dev, struct sdio_func, dev);
- brcmf_dbg(SDIO, "Enter: F%d\n", func->num);
-- if (func->num != SDIO_FUNC_1)
-+ if (func->num != 1)
- return 0;
-
-
-@@ -1134,7 +1143,7 @@ static int brcmf_ops_sdio_resume(struct
- struct sdio_func *func = container_of(dev, struct sdio_func, dev);
-
- brcmf_dbg(SDIO, "Enter: F%d\n", func->num);
-- if (func->num != SDIO_FUNC_2)
-+ if (func->num != 2)
- return 0;
-
- brcmf_sdiod_freezer_off(sdiodev);
---- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c
-+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c
-@@ -1157,7 +1157,7 @@ static void brcmf_sdio_rxfail(struct brc
- rtx ? ", send NAK" : "");
-
- if (abort)
-- brcmf_sdiod_abort(bus->sdiodev, SDIO_FUNC_2);
-+ brcmf_sdiod_abort(bus->sdiodev, bus->sdiodev->func[2]);
-
- brcmf_sdiod_writeb(bus->sdiodev, SBSDIO_FUNC1_FRAMECTRL, SFC_RF_TERM,
- &err);
-@@ -1209,7 +1209,7 @@ static void brcmf_sdio_txfail(struct brc
- brcmf_err("sdio error, abort command and terminate frame\n");
- bus->sdcnt.tx_sderrs++;
-
-- brcmf_sdiod_abort(sdiodev, SDIO_FUNC_2);
-+ brcmf_sdiod_abort(sdiodev, sdiodev->func[2]);
- brcmf_sdiod_writeb(sdiodev, SBSDIO_FUNC1_FRAMECTRL, SFC_WF_TERM, NULL);
- bus->sdcnt.f1regdata++;
-
-@@ -2072,7 +2072,7 @@ static int brcmf_sdio_txpkt_prep_sg(stru
- int ntail, ret;
-
- sdiodev = bus->sdiodev;
-- blksize = sdiodev->func[SDIO_FUNC_2]->cur_blksize;
-+ blksize = sdiodev->func[2]->cur_blksize;
- /* sg entry alignment should be a divisor of block size */
- WARN_ON(blksize % bus->sgentry_align);
-
-@@ -2441,7 +2441,7 @@ static void brcmf_sdio_bus_stop(struct d
-
- /* Turn off the bus (F2), free any pending packets */
- brcmf_dbg(INTR, "disable SDIO interrupts\n");
-- sdio_disable_func(sdiodev->func[SDIO_FUNC_2]);
-+ sdio_disable_func(sdiodev->func[2]);
-
- /* Clear any pending interrupts now that F2 is disabled */
- brcmf_sdiod_writel(sdiodev, core->base + SD_REG(intstatus),
-@@ -4066,8 +4066,7 @@ static void brcmf_sdio_firmware_callback
- brcmf_sdiod_writel(sdiod, core->base + SD_REG(tosbmailboxdata),
- SDPCM_PROT_VERSION << SMB_DATA_VERSION_SHIFT, NULL);
-
-- err = sdio_enable_func(sdiodev->func[SDIO_FUNC_2]);
--
-+ err = sdio_enable_func(sdiodev->func[2]);
-
- brcmf_dbg(INFO, "enable F2: err=%d\n", err);
-
-@@ -4082,7 +4081,7 @@ static void brcmf_sdio_firmware_callback
- brcmf_sdiod_writeb(sdiodev, SBSDIO_WATERMARK, 8, &err);
- } else {
- /* Disable F2 again */
-- sdio_disable_func(sdiodev->func[SDIO_FUNC_2]);
-+ sdio_disable_func(sdiodev->func[2]);
- goto release;
- }
-
-@@ -4219,7 +4218,7 @@ struct brcmf_sdio *brcmf_sdio_probe(stru
- sdio_claim_host(bus->sdiodev->func[1]);
-
- /* Disable F2 to clear any intermediate frame state on the dongle */
-- sdio_disable_func(bus->sdiodev->func[SDIO_FUNC_2]);
-+ sdio_disable_func(bus->sdiodev->func[2]);
-
- bus->rxflow = false;
-
---- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.h
-+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.h
-@@ -45,9 +45,6 @@
- #define REG_F0_REG_MASK 0x7FF
- #define REG_F1_MISC_MASK 0x1FFFF
-
--/* as of sdiod rev 0, supports 3 functions */
--#define SBSDIO_NUM_FUNCTION 3
--
- /* function 0 vendor specific CCCR registers */
-
- #define SDIO_CCCR_BRCM_CARDCAP 0xf0
-@@ -350,7 +347,8 @@ int brcmf_sdiod_ramrw(struct brcmf_sdio_
- u8 *data, uint size);
-
- /* Issue an abort to the specified function */
--int brcmf_sdiod_abort(struct brcmf_sdio_dev *sdiodev, u8 fn);
-+int brcmf_sdiod_abort(struct brcmf_sdio_dev *sdiodev, struct sdio_func *func);
-+
- void brcmf_sdiod_sgtable_alloc(struct brcmf_sdio_dev *sdiodev);
- void brcmf_sdiod_change_state(struct brcmf_sdio_dev *sdiodev,
- enum brcmf_sdiod_state state);
diff --git a/package/kernel/mac80211/patches/314-v4.16-0008-brcmfmac-Clean-up-interrupt-macros.patch b/package/kernel/mac80211/patches/314-v4.16-0008-brcmfmac-Clean-up-interrupt-macros.patch
deleted file mode 100644
index d732c8e58a..0000000000
--- a/package/kernel/mac80211/patches/314-v4.16-0008-brcmfmac-Clean-up-interrupt-macros.patch
+++ /dev/null
@@ -1,53 +0,0 @@
-From 9c3438ed215adba7025268ee1f0b6f7a2af12316 Mon Sep 17 00:00:00 2001
-From: Ian Molton <ian@mnementh.co.uk>
-Date: Tue, 19 Dec 2017 13:47:14 +0100
-Subject: [PATCH] brcmfmac: Clean up interrupt macros
-
-Make it more obvious that this code acually enables interrupts, and
-provide nice definitions for the bits in the register.
-
-Signed-off-by: Ian Molton <ian@mnementh.co.uk>
-Acked-by: Arend van Spriel <arend.vanspriel@broadcom.com>
-Signed-off-by: Arend van Spriel <arend.vanspriel@broadcom.com>
-Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
----
- drivers/net/wireless/broadcom/brcm80211/brcmfmac/bcmsdh.c | 3 ++-
- drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.h | 8 +++++---
- 2 files changed, 7 insertions(+), 4 deletions(-)
-
---- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/bcmsdh.c
-+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/bcmsdh.c
-@@ -149,7 +149,8 @@ int brcmf_sdiod_intr_register(struct brc
-
- /* must configure SDIO_CCCR_IENx to enable irq */
- data = brcmf_sdiod_func0_rb(sdiodev, SDIO_CCCR_IENx, &ret);
-- data |= 1 << SDIO_FUNC_1 | 1 << SDIO_FUNC_2 | 1;
-+ data |= SDIO_CCCR_IEN_FUNC1 | SDIO_CCCR_IEN_FUNC2 |
-+ SDIO_CCCR_IEN_FUNC0;
- brcmf_sdiod_func0_wb(sdiodev, SDIO_CCCR_IENx, data, &ret);
-
- /* redirect, configure and enable io for interrupt signal */
---- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.h
-+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.h
-@@ -24,9 +24,6 @@
- /* Maximum number of I/O funcs */
- #define NUM_SDIO_FUNCS 3
-
--#define SDIO_FUNC_1 1
--#define SDIO_FUNC_2 2
--
- #define SDIOD_FBR_SIZE 0x100
-
- /* io_en */
-@@ -52,6 +49,11 @@
- #define SDIO_CCCR_BRCM_CARDCAP_CMD14_EXT BIT(2)
- #define SDIO_CCCR_BRCM_CARDCAP_CMD_NODEC BIT(3)
-
-+/* Interrupt enable bits for each function */
-+#define SDIO_CCCR_IEN_FUNC0 BIT(0)
-+#define SDIO_CCCR_IEN_FUNC1 BIT(1)
-+#define SDIO_CCCR_IEN_FUNC2 BIT(2)
-+
- #define SDIO_CCCR_BRCM_CARDCTRL 0xf1
- #define SDIO_CCCR_BRCM_CARDCTRL_WLANRESET BIT(1)
-
diff --git a/package/kernel/mac80211/patches/315-v4.16-0001-brcmfmac-Support-43455-save-restore-SR-feature-if-FW.patch b/package/kernel/mac80211/patches/315-v4.16-0001-brcmfmac-Support-43455-save-restore-SR-feature-if-FW.patch
deleted file mode 100644
index d010d23f01..0000000000
--- a/package/kernel/mac80211/patches/315-v4.16-0001-brcmfmac-Support-43455-save-restore-SR-feature-if-FW.patch
+++ /dev/null
@@ -1,27 +0,0 @@
-From e3720dad99859251a8b0fe2807275a8afcfb560d Mon Sep 17 00:00:00 2001
-From: Double Lo <double.lo@cypress.com>
-Date: Tue, 19 Dec 2017 14:56:44 +0800
-Subject: [PATCH] brcmfmac: Support 43455 save-restore (SR) feature if FW
- include -sr
-
-This patch will add 43455 into the save-restore(SR) capable chip list, so
-the SR engine will be enabled with 43455 FW which built-in the -sr
-function.
-
-Signed-off-by: Double Lo <double.lo@cypress.com>
-Signed-off-by: Wright Feng <wright.feng@cypress.com>
-Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
----
- drivers/net/wireless/broadcom/brcm80211/brcmfmac/chip.c | 1 +
- 1 file changed, 1 insertion(+)
-
---- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/chip.c
-+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/chip.c
-@@ -1338,6 +1338,7 @@ bool brcmf_chip_sr_capable(struct brcmf_
- switch (pub->chip) {
- case BRCM_CC_4354_CHIP_ID:
- case BRCM_CC_4356_CHIP_ID:
-+ case BRCM_CC_4345_CHIP_ID:
- /* explicitly check SR engine enable bit */
- pmu_cc3_mask = BIT(2);
- /* fall-through */
diff --git a/package/kernel/mac80211/patches/316-v4.16-0001-brcmfmac-Remove-array-of-functions.patch b/package/kernel/mac80211/patches/316-v4.16-0001-brcmfmac-Remove-array-of-functions.patch
deleted file mode 100644
index bd9de13d7a..0000000000
--- a/package/kernel/mac80211/patches/316-v4.16-0001-brcmfmac-Remove-array-of-functions.patch
+++ /dev/null
@@ -1,1043 +0,0 @@
-From c9aa7a91de740c537dc8c2f9f3d36fc651371b13 Mon Sep 17 00:00:00 2001
-From: Arend Van Spriel <arend.vanspriel@broadcom.com>
-Date: Tue, 9 Jan 2018 13:22:52 +0100
-Subject: [PATCH] brcmfmac: Remove array of functions
-
-Replace the array of functions with a pair of pointers to the
-relevant functions.
-
-Signed-off-by: Ian Molton <ian@mnementh.co.uk>
-Acked-by: Arend van Spriel <arend.vanspriel@broadcom.com>
-Signed-off-by: Arend van Spriel <arend.vanspriel@broadcom.com>
-Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
----
- .../wireless/broadcom/brcm80211/brcmfmac/bcmsdh.c | 115 +++++++-------
- .../wireless/broadcom/brcm80211/brcmfmac/sdio.c | 168 ++++++++++-----------
- .../wireless/broadcom/brcm80211/brcmfmac/sdio.h | 15 +-
- 3 files changed, 146 insertions(+), 152 deletions(-)
-
---- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/bcmsdh.c
-+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/bcmsdh.c
-@@ -118,7 +118,7 @@ int brcmf_sdiod_intr_register(struct brc
-
- ret = request_irq(pdata->oob_irq_nr, brcmf_sdiod_oob_irqhandler,
- pdata->oob_irq_flags, "brcmf_oob_intr",
-- &sdiodev->func[1]->dev);
-+ &sdiodev->func1->dev);
- if (ret != 0) {
- brcmf_err("request_irq failed %d\n", ret);
- return ret;
-@@ -132,7 +132,7 @@ int brcmf_sdiod_intr_register(struct brc
- }
- sdiodev->irq_wake = true;
-
-- sdio_claim_host(sdiodev->func[1]);
-+ sdio_claim_host(sdiodev->func1);
-
- if (sdiodev->bus_if->chip == BRCM_CC_43362_CHIP_ID) {
- /* assign GPIO to SDIO core */
-@@ -159,13 +159,13 @@ int brcmf_sdiod_intr_register(struct brc
- data |= SDIO_CCCR_BRCM_SEPINT_ACT_HI;
- brcmf_sdiod_func0_wb(sdiodev, SDIO_CCCR_BRCM_SEPINT,
- data, &ret);
-- sdio_release_host(sdiodev->func[1]);
-+ sdio_release_host(sdiodev->func1);
- } else {
- brcmf_dbg(SDIO, "Entering\n");
-- sdio_claim_host(sdiodev->func[1]);
-- sdio_claim_irq(sdiodev->func[1], brcmf_sdiod_ib_irqhandler);
-- sdio_claim_irq(sdiodev->func[2], brcmf_sdiod_dummy_irqhandler);
-- sdio_release_host(sdiodev->func[1]);
-+ sdio_claim_host(sdiodev->func1);
-+ sdio_claim_irq(sdiodev->func1, brcmf_sdiod_ib_irqhandler);
-+ sdio_claim_irq(sdiodev->func2, brcmf_sdiod_dummy_irqhandler);
-+ sdio_release_host(sdiodev->func1);
- sdiodev->sd_irq_requested = true;
- }
-
-@@ -183,26 +183,26 @@ void brcmf_sdiod_intr_unregister(struct
- struct brcmfmac_sdio_pd *pdata;
-
- pdata = &sdiodev->settings->bus.sdio;
-- sdio_claim_host(sdiodev->func[1]);
-+ sdio_claim_host(sdiodev->func1);
- brcmf_sdiod_func0_wb(sdiodev, SDIO_CCCR_BRCM_SEPINT, 0, NULL);
- brcmf_sdiod_func0_wb(sdiodev, SDIO_CCCR_IENx, 0, NULL);
-- sdio_release_host(sdiodev->func[1]);
-+ sdio_release_host(sdiodev->func1);
-
- sdiodev->oob_irq_requested = false;
- if (sdiodev->irq_wake) {
- disable_irq_wake(pdata->oob_irq_nr);
- sdiodev->irq_wake = false;
- }
-- free_irq(pdata->oob_irq_nr, &sdiodev->func[1]->dev);
-+ free_irq(pdata->oob_irq_nr, &sdiodev->func1->dev);
- sdiodev->irq_en = false;
- sdiodev->oob_irq_requested = false;
- }
-
- if (sdiodev->sd_irq_requested) {
-- sdio_claim_host(sdiodev->func[1]);
-- sdio_release_irq(sdiodev->func[2]);
-- sdio_release_irq(sdiodev->func[1]);
-- sdio_release_host(sdiodev->func[1]);
-+ sdio_claim_host(sdiodev->func1);
-+ sdio_release_irq(sdiodev->func2);
-+ sdio_release_irq(sdiodev->func1);
-+ sdio_release_host(sdiodev->func1);
- sdiodev->sd_irq_requested = false;
- }
- }
-@@ -264,7 +264,7 @@ u32 brcmf_sdiod_readl(struct brcmf_sdio_
- addr &= SBSDIO_SB_OFT_ADDR_MASK;
- addr |= SBSDIO_SB_ACCESS_2_4B_FLAG;
-
-- data = sdio_readl(sdiodev->func[1], addr, &retval);
-+ data = sdio_readl(sdiodev->func1, addr, &retval);
-
- out:
- if (ret)
-@@ -285,7 +285,7 @@ void brcmf_sdiod_writel(struct brcmf_sdi
- addr &= SBSDIO_SB_OFT_ADDR_MASK;
- addr |= SBSDIO_SB_ACCESS_2_4B_FLAG;
-
-- sdio_writel(sdiodev->func[1], data, addr, &retval);
-+ sdio_writel(sdiodev->func1, data, addr, &retval);
-
- out:
- if (ret)
-@@ -550,7 +550,7 @@ int brcmf_sdiod_recv_pkt(struct brcmf_sd
- addr &= SBSDIO_SB_OFT_ADDR_MASK;
- addr |= SBSDIO_SB_ACCESS_2_4B_FLAG;
-
-- err = brcmf_sdiod_buff_read(sdiodev, sdiodev->func[2], addr, pkt);
-+ err = brcmf_sdiod_buff_read(sdiodev, sdiodev->func2, addr, pkt);
-
- done:
- return err;
-@@ -575,13 +575,13 @@ int brcmf_sdiod_recv_chain(struct brcmf_
- addr |= SBSDIO_SB_ACCESS_2_4B_FLAG;
-
- if (pktq->qlen == 1)
-- err = brcmf_sdiod_buff_read(sdiodev, sdiodev->func[2], addr,
-+ err = brcmf_sdiod_buff_read(sdiodev, sdiodev->func2, addr,
- pktq->next);
- else if (!sdiodev->sg_support) {
- glom_skb = brcmu_pkt_buf_get_skb(totlen);
- if (!glom_skb)
- return -ENOMEM;
-- err = brcmf_sdiod_buff_read(sdiodev, sdiodev->func[2], addr,
-+ err = brcmf_sdiod_buff_read(sdiodev, sdiodev->func2, addr,
- glom_skb);
- if (err)
- goto done;
-@@ -591,7 +591,7 @@ int brcmf_sdiod_recv_chain(struct brcmf_
- skb_pull(glom_skb, skb->len);
- }
- } else
-- err = brcmf_sdiod_sglist_rw(sdiodev, sdiodev->func[2], false,
-+ err = brcmf_sdiod_sglist_rw(sdiodev, sdiodev->func2, false,
- addr, pktq);
-
- done:
-@@ -623,7 +623,7 @@ int brcmf_sdiod_send_buf(struct brcmf_sd
- addr |= SBSDIO_SB_ACCESS_2_4B_FLAG;
-
- if (!err)
-- err = brcmf_sdiod_buff_write(sdiodev, sdiodev->func[2], addr,
-+ err = brcmf_sdiod_buff_write(sdiodev, sdiodev->func2, addr,
- mypkt);
-
- brcmu_pkt_buf_free_skb(mypkt);
-@@ -649,13 +649,13 @@ int brcmf_sdiod_send_pkt(struct brcmf_sd
-
- if (pktq->qlen == 1 || !sdiodev->sg_support) {
- skb_queue_walk(pktq, skb) {
-- err = brcmf_sdiod_buff_write(sdiodev, sdiodev->func[2],
-+ err = brcmf_sdiod_buff_write(sdiodev, sdiodev->func2,
- addr, skb);
- if (err)
- break;
- }
- } else {
-- err = brcmf_sdiod_sglist_rw(sdiodev, sdiodev->func[2], true,
-+ err = brcmf_sdiod_sglist_rw(sdiodev, sdiodev->func2, true,
- addr, pktq);
- }
-
-@@ -686,7 +686,7 @@ brcmf_sdiod_ramrw(struct brcmf_sdio_dev
- else
- dsize = size;
-
-- sdio_claim_host(sdiodev->func[1]);
-+ sdio_claim_host(sdiodev->func1);
-
- /* Do the transfer(s) */
- while (size) {
-@@ -706,10 +706,10 @@ brcmf_sdiod_ramrw(struct brcmf_sdio_dev
-
- if (write) {
- memcpy(pkt->data, data, dsize);
-- err = brcmf_sdiod_buff_write(sdiodev, sdiodev->func[1],
-+ err = brcmf_sdiod_buff_write(sdiodev, sdiodev->func1,
- sdaddr, pkt);
- } else {
-- err = brcmf_sdiod_buff_read(sdiodev, sdiodev->func[1],
-+ err = brcmf_sdiod_buff_read(sdiodev, sdiodev->func1,
- sdaddr, pkt);
- }
-
-@@ -733,7 +733,7 @@ brcmf_sdiod_ramrw(struct brcmf_sdio_dev
-
- dev_kfree_skb(pkt);
-
-- sdio_release_host(sdiodev->func[1]);
-+ sdio_release_host(sdiodev->func1);
-
- return err;
- }
-@@ -757,7 +757,7 @@ void brcmf_sdiod_sgtable_alloc(struct br
- uint nents;
- int err;
-
-- func = sdiodev->func[2];
-+ func = sdiodev->func2;
- host = func->card->host;
- sdiodev->sg_support = host->max_segs > 1;
- max_blocks = min_t(uint, host->max_blk_count, 511u);
-@@ -818,17 +818,17 @@ static int brcmf_sdiod_freezer_on(struct
- brcmf_sdio_trigger_dpc(sdiodev->bus);
- wait_event(sdiodev->freezer->thread_freeze,
- atomic_read(expect) == sdiodev->freezer->frozen_count);
-- sdio_claim_host(sdiodev->func[1]);
-+ sdio_claim_host(sdiodev->func1);
- res = brcmf_sdio_sleep(sdiodev->bus, true);
-- sdio_release_host(sdiodev->func[1]);
-+ sdio_release_host(sdiodev->func1);
- return res;
- }
-
- static void brcmf_sdiod_freezer_off(struct brcmf_sdio_dev *sdiodev)
- {
-- sdio_claim_host(sdiodev->func[1]);
-+ sdio_claim_host(sdiodev->func1);
- brcmf_sdio_sleep(sdiodev->bus, false);
-- sdio_release_host(sdiodev->func[1]);
-+ sdio_release_host(sdiodev->func1);
- atomic_set(&sdiodev->freezer->freezing, 0);
- complete_all(&sdiodev->freezer->resumed);
- }
-@@ -878,19 +878,19 @@ static int brcmf_sdiod_remove(struct brc
- brcmf_sdiod_freezer_detach(sdiodev);
-
- /* Disable Function 2 */
-- sdio_claim_host(sdiodev->func[2]);
-- sdio_disable_func(sdiodev->func[2]);
-- sdio_release_host(sdiodev->func[2]);
-+ sdio_claim_host(sdiodev->func2);
-+ sdio_disable_func(sdiodev->func2);
-+ sdio_release_host(sdiodev->func2);
-
- /* Disable Function 1 */
-- sdio_claim_host(sdiodev->func[1]);
-- sdio_disable_func(sdiodev->func[1]);
-- sdio_release_host(sdiodev->func[1]);
-+ sdio_claim_host(sdiodev->func1);
-+ sdio_disable_func(sdiodev->func1);
-+ sdio_release_host(sdiodev->func1);
-
- sg_free_table(&sdiodev->sgtable);
- sdiodev->sbwad = 0;
-
-- pm_runtime_allow(sdiodev->func[1]->card->host->parent);
-+ pm_runtime_allow(sdiodev->func1->card->host->parent);
- return 0;
- }
-
-@@ -906,29 +906,27 @@ static int brcmf_sdiod_probe(struct brcm
- {
- int ret = 0;
-
-- sdiodev->num_funcs = 2;
-+ sdio_claim_host(sdiodev->func1);
-
-- sdio_claim_host(sdiodev->func[1]);
--
-- ret = sdio_set_block_size(sdiodev->func[1], SDIO_FUNC1_BLOCKSIZE);
-+ ret = sdio_set_block_size(sdiodev->func1, SDIO_FUNC1_BLOCKSIZE);
- if (ret) {
- brcmf_err("Failed to set F1 blocksize\n");
-- sdio_release_host(sdiodev->func[1]);
-+ sdio_release_host(sdiodev->func1);
- goto out;
- }
-- ret = sdio_set_block_size(sdiodev->func[2], SDIO_FUNC2_BLOCKSIZE);
-+ ret = sdio_set_block_size(sdiodev->func2, SDIO_FUNC2_BLOCKSIZE);
- if (ret) {
- brcmf_err("Failed to set F2 blocksize\n");
-- sdio_release_host(sdiodev->func[1]);
-+ sdio_release_host(sdiodev->func1);
- goto out;
- }
-
- /* increase F2 timeout */
-- sdiodev->func[2]->enable_timeout = SDIO_WAIT_F2RDY;
-+ sdiodev->func2->enable_timeout = SDIO_WAIT_F2RDY;
-
- /* Enable Function 1 */
-- ret = sdio_enable_func(sdiodev->func[1]);
-- sdio_release_host(sdiodev->func[1]);
-+ ret = sdio_enable_func(sdiodev->func1);
-+ sdio_release_host(sdiodev->func1);
- if (ret) {
- brcmf_err("Failed to enable F1: err=%d\n", ret);
- goto out;
-@@ -944,7 +942,7 @@ static int brcmf_sdiod_probe(struct brcm
- ret = -ENODEV;
- goto out;
- }
-- brcmf_sdiod_host_fixup(sdiodev->func[2]->card->host);
-+ brcmf_sdiod_host_fixup(sdiodev->func2->card->host);
- out:
- if (ret)
- brcmf_sdiod_remove(sdiodev);
-@@ -1032,16 +1030,15 @@ static int brcmf_ops_sdio_probe(struct s
- /* store refs to functions used. mmc_card does
- * not hold the F0 function pointer.
- */
-- sdiodev->func[0] = NULL;
-- sdiodev->func[1] = func->card->sdio_func[0];
-- sdiodev->func[2] = func;
-+ sdiodev->func1 = func->card->sdio_func[0];
-+ sdiodev->func2 = func;
-
- sdiodev->bus_if = bus_if;
- bus_if->bus_priv.sdio = sdiodev;
- bus_if->proto_type = BRCMF_PROTO_BCDC;
- dev_set_drvdata(&func->dev, bus_if);
-- dev_set_drvdata(&sdiodev->func[1]->dev, bus_if);
-- sdiodev->dev = &sdiodev->func[1]->dev;
-+ dev_set_drvdata(&sdiodev->func1->dev, bus_if);
-+ sdiodev->dev = &sdiodev->func1->dev;
-
- brcmf_sdiod_change_state(sdiodev, BRCMF_SDIOD_DOWN);
-
-@@ -1057,7 +1054,7 @@ static int brcmf_ops_sdio_probe(struct s
-
- fail:
- dev_set_drvdata(&func->dev, NULL);
-- dev_set_drvdata(&sdiodev->func[1]->dev, NULL);
-+ dev_set_drvdata(&sdiodev->func1->dev, NULL);
- kfree(sdiodev);
- kfree(bus_if);
- return err;
-@@ -1086,8 +1083,8 @@ static void brcmf_ops_sdio_remove(struct
- /* only proceed with rest of cleanup if func 1 */
- brcmf_sdiod_remove(sdiodev);
-
-- dev_set_drvdata(&sdiodev->func[1]->dev, NULL);
-- dev_set_drvdata(&sdiodev->func[2]->dev, NULL);
-+ dev_set_drvdata(&sdiodev->func1->dev, NULL);
-+ dev_set_drvdata(&sdiodev->func2->dev, NULL);
-
- kfree(bus_if);
- kfree(sdiodev);
-@@ -1132,7 +1129,7 @@ static int brcmf_ops_sdio_suspend(struct
- else
- sdio_flags |= MMC_PM_WAKE_SDIO_IRQ;
- }
-- if (sdio_set_host_pm_flags(sdiodev->func[1], sdio_flags))
-+ if (sdio_set_host_pm_flags(sdiodev->func1, sdio_flags))
- brcmf_err("Failed to set pm_flags %x\n", sdio_flags);
- return 0;
- }
---- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c
-+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c
-@@ -979,7 +979,7 @@ static int brcmf_sdio_readshared(struct
- struct sdpcm_shared_le sh_le;
- __le32 addr_le;
-
-- sdio_claim_host(bus->sdiodev->func[1]);
-+ sdio_claim_host(bus->sdiodev->func1);
- brcmf_sdio_bus_sleep(bus, false, false);
-
- /*
-@@ -1013,7 +1013,7 @@ static int brcmf_sdio_readshared(struct
- if (rv < 0)
- goto fail;
-
-- sdio_release_host(bus->sdiodev->func[1]);
-+ sdio_release_host(bus->sdiodev->func1);
-
- /* Endianness */
- sh->flags = le32_to_cpu(sh_le.flags);
-@@ -1035,7 +1035,7 @@ static int brcmf_sdio_readshared(struct
- fail:
- brcmf_err("unable to obtain sdpcm_shared info: rv=%d (addr=0x%x)\n",
- rv, addr);
-- sdio_release_host(bus->sdiodev->func[1]);
-+ sdio_release_host(bus->sdiodev->func1);
- return rv;
- }
-
-@@ -1157,7 +1157,7 @@ static void brcmf_sdio_rxfail(struct brc
- rtx ? ", send NAK" : "");
-
- if (abort)
-- brcmf_sdiod_abort(bus->sdiodev, bus->sdiodev->func[2]);
-+ brcmf_sdiod_abort(bus->sdiodev, bus->sdiodev->func2);
-
- brcmf_sdiod_writeb(bus->sdiodev, SBSDIO_FUNC1_FRAMECTRL, SFC_RF_TERM,
- &err);
-@@ -1209,7 +1209,7 @@ static void brcmf_sdio_txfail(struct brc
- brcmf_err("sdio error, abort command and terminate frame\n");
- bus->sdcnt.tx_sderrs++;
-
-- brcmf_sdiod_abort(sdiodev, sdiodev->func[2]);
-+ brcmf_sdiod_abort(sdiodev, sdiodev->func2);
- brcmf_sdiod_writeb(sdiodev, SBSDIO_FUNC1_FRAMECTRL, SFC_WF_TERM, NULL);
- bus->sdcnt.f1regdata++;
-
-@@ -1565,10 +1565,10 @@ static u8 brcmf_sdio_rxglom(struct brcmf
- * read directly into the chained packet, or allocate a large
- * packet and and copy into the chain.
- */
-- sdio_claim_host(bus->sdiodev->func[1]);
-+ sdio_claim_host(bus->sdiodev->func1);
- errcode = brcmf_sdiod_recv_chain(bus->sdiodev,
- &bus->glom, dlen);
-- sdio_release_host(bus->sdiodev->func[1]);
-+ sdio_release_host(bus->sdiodev->func1);
- bus->sdcnt.f2rxdata++;
-
- /* On failure, kill the superframe */
-@@ -1576,11 +1576,11 @@ static u8 brcmf_sdio_rxglom(struct brcmf
- brcmf_err("glom read of %d bytes failed: %d\n",
- dlen, errcode);
-
-- sdio_claim_host(bus->sdiodev->func[1]);
-+ sdio_claim_host(bus->sdiodev->func1);
- brcmf_sdio_rxfail(bus, true, false);
- bus->sdcnt.rxglomfail++;
- brcmf_sdio_free_glom(bus);
-- sdio_release_host(bus->sdiodev->func[1]);
-+ sdio_release_host(bus->sdiodev->func1);
- return 0;
- }
-
-@@ -1590,10 +1590,10 @@ static u8 brcmf_sdio_rxglom(struct brcmf
-
- rd_new.seq_num = rxseq;
- rd_new.len = dlen;
-- sdio_claim_host(bus->sdiodev->func[1]);
-+ sdio_claim_host(bus->sdiodev->func1);
- errcode = brcmf_sdio_hdparse(bus, pfirst->data, &rd_new,
- BRCMF_SDIO_FT_SUPER);
-- sdio_release_host(bus->sdiodev->func[1]);
-+ sdio_release_host(bus->sdiodev->func1);
- bus->cur_read.len = rd_new.len_nxtfrm << 4;
-
- /* Remove superframe header, remember offset */
-@@ -1609,10 +1609,10 @@ static u8 brcmf_sdio_rxglom(struct brcmf
-
- rd_new.len = pnext->len;
- rd_new.seq_num = rxseq++;
-- sdio_claim_host(bus->sdiodev->func[1]);
-+ sdio_claim_host(bus->sdiodev->func1);
- errcode = brcmf_sdio_hdparse(bus, pnext->data, &rd_new,
- BRCMF_SDIO_FT_SUB);
-- sdio_release_host(bus->sdiodev->func[1]);
-+ sdio_release_host(bus->sdiodev->func1);
- brcmf_dbg_hex_dump(BRCMF_GLOM_ON(),
- pnext->data, 32, "subframe:\n");
-
-@@ -1621,11 +1621,11 @@ static u8 brcmf_sdio_rxglom(struct brcmf
-
- if (errcode) {
- /* Terminate frame on error */
-- sdio_claim_host(bus->sdiodev->func[1]);
-+ sdio_claim_host(bus->sdiodev->func1);
- brcmf_sdio_rxfail(bus, true, false);
- bus->sdcnt.rxglomfail++;
- brcmf_sdio_free_glom(bus);
-- sdio_release_host(bus->sdiodev->func[1]);
-+ sdio_release_host(bus->sdiodev->func1);
- bus->cur_read.len = 0;
- return 0;
- }
-@@ -1833,7 +1833,7 @@ static uint brcmf_sdio_readframes(struct
-
- rd->len_left = rd->len;
- /* read header first for unknow frame length */
-- sdio_claim_host(bus->sdiodev->func[1]);
-+ sdio_claim_host(bus->sdiodev->func1);
- if (!rd->len) {
- ret = brcmf_sdiod_recv_buf(bus->sdiodev,
- bus->rxhdr, BRCMF_FIRSTREAD);
-@@ -1843,7 +1843,7 @@ static uint brcmf_sdio_readframes(struct
- ret);
- bus->sdcnt.rx_hdrfail++;
- brcmf_sdio_rxfail(bus, true, true);
-- sdio_release_host(bus->sdiodev->func[1]);
-+ sdio_release_host(bus->sdiodev->func1);
- continue;
- }
-
-@@ -1853,7 +1853,7 @@ static uint brcmf_sdio_readframes(struct
-
- if (brcmf_sdio_hdparse(bus, bus->rxhdr, rd,
- BRCMF_SDIO_FT_NORMAL)) {
-- sdio_release_host(bus->sdiodev->func[1]);
-+ sdio_release_host(bus->sdiodev->func1);
- if (!bus->rxpending)
- break;
- else
-@@ -1869,7 +1869,7 @@ static uint brcmf_sdio_readframes(struct
- rd->len_nxtfrm = 0;
- /* treat all packet as event if we don't know */
- rd->channel = SDPCM_EVENT_CHANNEL;
-- sdio_release_host(bus->sdiodev->func[1]);
-+ sdio_release_host(bus->sdiodev->func1);
- continue;
- }
- rd->len_left = rd->len > BRCMF_FIRSTREAD ?
-@@ -1886,7 +1886,7 @@ static uint brcmf_sdio_readframes(struct
- brcmf_err("brcmu_pkt_buf_get_skb failed\n");
- brcmf_sdio_rxfail(bus, false,
- RETRYCHAN(rd->channel));
-- sdio_release_host(bus->sdiodev->func[1]);
-+ sdio_release_host(bus->sdiodev->func1);
- continue;
- }
- skb_pull(pkt, head_read);
-@@ -1894,16 +1894,16 @@ static uint brcmf_sdio_readframes(struct
-
- ret = brcmf_sdiod_recv_pkt(bus->sdiodev, pkt);
- bus->sdcnt.f2rxdata++;
-- sdio_release_host(bus->sdiodev->func[1]);
-+ sdio_release_host(bus->sdiodev->func1);
-
- if (ret < 0) {
- brcmf_err("read %d bytes from channel %d failed: %d\n",
- rd->len, rd->channel, ret);
- brcmu_pkt_buf_free_skb(pkt);
-- sdio_claim_host(bus->sdiodev->func[1]);
-+ sdio_claim_host(bus->sdiodev->func1);
- brcmf_sdio_rxfail(bus, true,
- RETRYCHAN(rd->channel));
-- sdio_release_host(bus->sdiodev->func[1]);
-+ sdio_release_host(bus->sdiodev->func1);
- continue;
- }
-
-@@ -1914,7 +1914,7 @@ static uint brcmf_sdio_readframes(struct
- } else {
- memcpy(bus->rxhdr, pkt->data, SDPCM_HDRLEN);
- rd_new.seq_num = rd->seq_num;
-- sdio_claim_host(bus->sdiodev->func[1]);
-+ sdio_claim_host(bus->sdiodev->func1);
- if (brcmf_sdio_hdparse(bus, bus->rxhdr, &rd_new,
- BRCMF_SDIO_FT_NORMAL)) {
- rd->len = 0;
-@@ -1927,11 +1927,11 @@ static uint brcmf_sdio_readframes(struct
- roundup(rd_new.len, 16) >> 4);
- rd->len = 0;
- brcmf_sdio_rxfail(bus, true, true);
-- sdio_release_host(bus->sdiodev->func[1]);
-+ sdio_release_host(bus->sdiodev->func1);
- brcmu_pkt_buf_free_skb(pkt);
- continue;
- }
-- sdio_release_host(bus->sdiodev->func[1]);
-+ sdio_release_host(bus->sdiodev->func1);
- rd->len_nxtfrm = rd_new.len_nxtfrm;
- rd->channel = rd_new.channel;
- rd->dat_offset = rd_new.dat_offset;
-@@ -1947,9 +1947,9 @@ static uint brcmf_sdio_readframes(struct
- rd_new.seq_num);
- /* Force retry w/normal header read */
- rd->len = 0;
-- sdio_claim_host(bus->sdiodev->func[1]);
-+ sdio_claim_host(bus->sdiodev->func1);
- brcmf_sdio_rxfail(bus, false, true);
-- sdio_release_host(bus->sdiodev->func[1]);
-+ sdio_release_host(bus->sdiodev->func1);
- brcmu_pkt_buf_free_skb(pkt);
- continue;
- }
-@@ -1972,9 +1972,9 @@ static uint brcmf_sdio_readframes(struct
- } else {
- brcmf_err("%s: glom superframe w/o "
- "descriptor!\n", __func__);
-- sdio_claim_host(bus->sdiodev->func[1]);
-+ sdio_claim_host(bus->sdiodev->func1);
- brcmf_sdio_rxfail(bus, false, false);
-- sdio_release_host(bus->sdiodev->func[1]);
-+ sdio_release_host(bus->sdiodev->func1);
- }
- /* prepare the descriptor for the next read */
- rd->len = rd->len_nxtfrm << 4;
-@@ -2072,7 +2072,7 @@ static int brcmf_sdio_txpkt_prep_sg(stru
- int ntail, ret;
-
- sdiodev = bus->sdiodev;
-- blksize = sdiodev->func[2]->cur_blksize;
-+ blksize = sdiodev->func2->cur_blksize;
- /* sg entry alignment should be a divisor of block size */
- WARN_ON(blksize % bus->sgentry_align);
-
-@@ -2251,14 +2251,14 @@ static int brcmf_sdio_txpkt(struct brcmf
- if (ret)
- goto done;
-
-- sdio_claim_host(bus->sdiodev->func[1]);
-+ sdio_claim_host(bus->sdiodev->func1);
- ret = brcmf_sdiod_send_pkt(bus->sdiodev, pktq);
- bus->sdcnt.f2txdata++;
-
- if (ret < 0)
- brcmf_sdio_txfail(bus);
-
-- sdio_release_host(bus->sdiodev->func[1]);
-+ sdio_release_host(bus->sdiodev->func1);
-
- done:
- brcmf_sdio_txpkt_postp(bus, pktq);
-@@ -2314,10 +2314,11 @@ static uint brcmf_sdio_sendfromq(struct
- /* In poll mode, need to check for other events */
- if (!bus->intr) {
- /* Check device status, signal pending interrupt */
-- sdio_claim_host(bus->sdiodev->func[1]);
-+ sdio_claim_host(bus->sdiodev->func1);
- intstatus = brcmf_sdiod_readl(bus->sdiodev,
- intstat_addr, &ret);
-- sdio_release_host(bus->sdiodev->func[1]);
-+ sdio_release_host(bus->sdiodev->func1);
-+
- bus->sdcnt.f2txdata++;
- if (ret != 0)
- break;
-@@ -2417,7 +2418,7 @@ static void brcmf_sdio_bus_stop(struct d
- }
-
- if (sdiodev->state != BRCMF_SDIOD_NOMEDIUM) {
-- sdio_claim_host(sdiodev->func[1]);
-+ sdio_claim_host(sdiodev->func1);
-
- /* Enable clock for device interrupts */
- brcmf_sdio_bus_sleep(bus, false, false);
-@@ -2441,13 +2442,13 @@ static void brcmf_sdio_bus_stop(struct d
-
- /* Turn off the bus (F2), free any pending packets */
- brcmf_dbg(INTR, "disable SDIO interrupts\n");
-- sdio_disable_func(sdiodev->func[2]);
-+ sdio_disable_func(sdiodev->func2);
-
- /* Clear any pending interrupts now that F2 is disabled */
- brcmf_sdiod_writel(sdiodev, core->base + SD_REG(intstatus),
- local_hostintmask, NULL);
-
-- sdio_release_host(sdiodev->func[1]);
-+ sdio_release_host(sdiodev->func1);
- }
- /* Clear the data packet queues */
- brcmu_pktq_flush(&bus->txq, true, NULL, NULL);
-@@ -2522,7 +2523,7 @@ static void brcmf_sdio_dpc(struct brcmf_
-
- brcmf_dbg(TRACE, "Enter\n");
-
-- sdio_claim_host(bus->sdiodev->func[1]);
-+ sdio_claim_host(bus->sdiodev->func1);
-
- /* If waiting for HTAVAIL, check status */
- if (!bus->sr_enabled && bus->clkstate == CLK_PENDING) {
-@@ -2585,7 +2586,7 @@ static void brcmf_sdio_dpc(struct brcmf_
- intstatus |= brcmf_sdio_hostmail(bus);
- }
-
-- sdio_release_host(bus->sdiodev->func[1]);
-+ sdio_release_host(bus->sdiodev->func1);
-
- /* Generally don't ask for these, can get CRC errors... */
- if (intstatus & I_WR_OOSYNC) {
-@@ -2628,7 +2629,7 @@ static void brcmf_sdio_dpc(struct brcmf_
-
- if (bus->ctrl_frame_stat && (bus->clkstate == CLK_AVAIL) &&
- data_ok(bus)) {
-- sdio_claim_host(bus->sdiodev->func[1]);
-+ sdio_claim_host(bus->sdiodev->func1);
- if (bus->ctrl_frame_stat) {
- err = brcmf_sdio_tx_ctrlframe(bus, bus->ctrl_frame_buf,
- bus->ctrl_frame_len);
-@@ -2636,7 +2637,7 @@ static void brcmf_sdio_dpc(struct brcmf_
- wmb();
- bus->ctrl_frame_stat = false;
- }
-- sdio_release_host(bus->sdiodev->func[1]);
-+ sdio_release_host(bus->sdiodev->func1);
- brcmf_sdio_wait_event_wakeup(bus);
- }
- /* Send queued frames (limit 1 if rx may still be pending) */
-@@ -2652,14 +2653,14 @@ static void brcmf_sdio_dpc(struct brcmf_
- brcmf_err("failed backplane access over SDIO, halting operation\n");
- atomic_set(&bus->intstatus, 0);
- if (bus->ctrl_frame_stat) {
-- sdio_claim_host(bus->sdiodev->func[1]);
-+ sdio_claim_host(bus->sdiodev->func1);
- if (bus->ctrl_frame_stat) {
- bus->ctrl_frame_err = -ENODEV;
- wmb();
- bus->ctrl_frame_stat = false;
- brcmf_sdio_wait_event_wakeup(bus);
- }
-- sdio_release_host(bus->sdiodev->func[1]);
-+ sdio_release_host(bus->sdiodev->func1);
- }
- } else if (atomic_read(&bus->intstatus) ||
- atomic_read(&bus->ipend) > 0 ||
-@@ -2874,13 +2875,13 @@ brcmf_sdio_bus_txctl(struct device *dev,
- CTL_DONE_TIMEOUT);
- ret = 0;
- if (bus->ctrl_frame_stat) {
-- sdio_claim_host(bus->sdiodev->func[1]);
-+ sdio_claim_host(bus->sdiodev->func1);
- if (bus->ctrl_frame_stat) {
- brcmf_dbg(SDIO, "ctrl_frame timeout\n");
- bus->ctrl_frame_stat = false;
- ret = -ETIMEDOUT;
- }
-- sdio_release_host(bus->sdiodev->func[1]);
-+ sdio_release_host(bus->sdiodev->func1);
- }
- if (!ret) {
- brcmf_dbg(SDIO, "ctrl_frame complete, err=%d\n",
-@@ -3004,7 +3005,7 @@ static int brcmf_sdio_assert_info(struct
- return 0;
- }
-
-- sdio_claim_host(bus->sdiodev->func[1]);
-+ sdio_claim_host(bus->sdiodev->func1);
- if (sh->assert_file_addr != 0) {
- error = brcmf_sdiod_ramrw(bus->sdiodev, false,
- sh->assert_file_addr, (u8 *)file, 80);
-@@ -3017,7 +3018,7 @@ static int brcmf_sdio_assert_info(struct
- if (error < 0)
- return error;
- }
-- sdio_release_host(bus->sdiodev->func[1]);
-+ sdio_release_host(bus->sdiodev->func1);
-
- seq_printf(seq, "dongle assert: %s:%d: assert(%s)\n",
- file, sh->assert_line, expr);
-@@ -3291,7 +3292,7 @@ static int brcmf_sdio_download_firmware(
- int bcmerror;
- u32 rstvec;
-
-- sdio_claim_host(bus->sdiodev->func[1]);
-+ sdio_claim_host(bus->sdiodev->func1);
- brcmf_sdio_clkctl(bus, CLK_AVAIL, false);
-
- rstvec = get_unaligned_le32(fw->data);
-@@ -3320,7 +3321,7 @@ static int brcmf_sdio_download_firmware(
-
- err:
- brcmf_sdio_clkctl(bus, CLK_SDONLY, false);
-- sdio_release_host(bus->sdiodev->func[1]);
-+ sdio_release_host(bus->sdiodev->func1);
- return bcmerror;
- }
-
-@@ -3435,7 +3436,7 @@ static int brcmf_sdio_bus_preinit(struct
- if (sdiodev->sg_support) {
- bus->txglom = false;
- value = 1;
-- pad_size = bus->sdiodev->func[2]->cur_blksize << 1;
-+ pad_size = bus->sdiodev->func2->cur_blksize << 1;
- err = brcmf_iovar_data_set(bus->sdiodev->dev, "bus:rxglom",
- &value, sizeof(u32));
- if (err < 0) {
-@@ -3477,7 +3478,7 @@ static int brcmf_sdio_bus_get_memdump(st
-
- address = bus->ci->rambase;
- offset = err = 0;
-- sdio_claim_host(sdiodev->func[1]);
-+ sdio_claim_host(sdiodev->func1);
- while (offset < mem_size) {
- len = ((offset + MEMBLOCK) < mem_size) ? MEMBLOCK :
- mem_size - offset;
-@@ -3493,7 +3494,7 @@ static int brcmf_sdio_bus_get_memdump(st
- }
-
- done:
-- sdio_release_host(sdiodev->func[1]);
-+ sdio_release_host(sdiodev->func1);
- return err;
- }
-
-@@ -3550,11 +3551,10 @@ static void brcmf_sdio_bus_watchdog(stru
- if (!bus->dpc_triggered) {
- u8 devpend;
-
-- sdio_claim_host(bus->sdiodev->func[1]);
-+ sdio_claim_host(bus->sdiodev->func1);
- devpend = brcmf_sdiod_func0_rb(bus->sdiodev,
-- SDIO_CCCR_INTx,
-- NULL);
-- sdio_release_host(bus->sdiodev->func[1]);
-+ SDIO_CCCR_INTx, NULL);
-+ sdio_release_host(bus->sdiodev->func1);
- intstatus = devpend & (INTR_STATUS_FUNC1 |
- INTR_STATUS_FUNC2);
- }
-@@ -3580,13 +3580,13 @@ static void brcmf_sdio_bus_watchdog(stru
- bus->console.count += jiffies_to_msecs(BRCMF_WD_POLL);
- if (bus->console.count >= bus->console_interval) {
- bus->console.count -= bus->console_interval;
-- sdio_claim_host(bus->sdiodev->func[1]);
-+ sdio_claim_host(bus->sdiodev->func1);
- /* Make sure backplane clock is on */
- brcmf_sdio_bus_sleep(bus, false, false);
- if (brcmf_sdio_readconsole(bus) < 0)
- /* stop on error */
- bus->console_interval = 0;
-- sdio_release_host(bus->sdiodev->func[1]);
-+ sdio_release_host(bus->sdiodev->func1);
- }
- }
- #endif /* DEBUG */
-@@ -3599,11 +3599,11 @@ static void brcmf_sdio_bus_watchdog(stru
- bus->idlecount++;
- if (bus->idlecount > bus->idletime) {
- brcmf_dbg(SDIO, "idle\n");
-- sdio_claim_host(bus->sdiodev->func[1]);
-+ sdio_claim_host(bus->sdiodev->func1);
- brcmf_sdio_wd_timer(bus, false);
- bus->idlecount = 0;
- brcmf_sdio_bus_sleep(bus, true, false);
-- sdio_release_host(bus->sdiodev->func[1]);
-+ sdio_release_host(bus->sdiodev->func1);
- }
- } else {
- bus->idlecount = 0;
-@@ -3773,8 +3773,8 @@ static u32 brcmf_sdio_buscore_read32(voi
- val = brcmf_sdiod_readl(sdiodev, addr, NULL);
-
- if (addr == CORE_CC_REG(SI_ENUM_BASE, chipid) &&
-- (sdiodev->func[1]->device == SDIO_DEVICE_ID_BROADCOM_4339 ||
-- sdiodev->func[1]->device == SDIO_DEVICE_ID_BROADCOM_4335_4339)) {
-+ (sdiodev->func1->device == SDIO_DEVICE_ID_BROADCOM_4339 ||
-+ sdiodev->func1->device == SDIO_DEVICE_ID_BROADCOM_4335_4339)) {
- rev = (val & CID_REV_MASK) >> CID_REV_SHIFT;
- if (rev >= 2) {
- val &= ~CID_ID_MASK;
-@@ -3810,7 +3810,7 @@ brcmf_sdio_probe_attach(struct brcmf_sdi
- u32 drivestrength;
-
- sdiodev = bus->sdiodev;
-- sdio_claim_host(sdiodev->func[1]);
-+ sdio_claim_host(sdiodev->func1);
-
- pr_debug("F1 signature read @0x18000000=0x%4x\n",
- brcmf_sdiod_readl(sdiodev, SI_ENUM_BASE, NULL));
-@@ -3877,8 +3877,8 @@ brcmf_sdio_probe_attach(struct brcmf_sdi
- /* wowl can be supported when KEEP_POWER is true and (WAKE_SDIO_IRQ
- * is true or when platform data OOB irq is true).
- */
-- if ((sdio_get_host_pm_caps(sdiodev->func[1]) & MMC_PM_KEEP_POWER) &&
-- ((sdio_get_host_pm_caps(sdiodev->func[1]) & MMC_PM_WAKE_SDIO_IRQ) ||
-+ if ((sdio_get_host_pm_caps(sdiodev->func1) & MMC_PM_KEEP_POWER) &&
-+ ((sdio_get_host_pm_caps(sdiodev->func1) & MMC_PM_WAKE_SDIO_IRQ) ||
- (sdiodev->settings->bus.sdio.oob_irq_supported)))
- sdiodev->bus_if->wowl_supported = true;
- #endif
-@@ -3917,7 +3917,7 @@ brcmf_sdio_probe_attach(struct brcmf_sdi
- if (err)
- goto fail;
-
-- sdio_release_host(sdiodev->func[1]);
-+ sdio_release_host(sdiodev->func1);
-
- brcmu_pktq_init(&bus->txq, (PRIOMASK + 1), TXQLEN);
-
-@@ -3938,7 +3938,7 @@ brcmf_sdio_probe_attach(struct brcmf_sdi
- return true;
-
- fail:
-- sdio_release_host(sdiodev->func[1]);
-+ sdio_release_host(sdiodev->func1);
- return false;
- }
-
-@@ -4044,7 +4044,7 @@ static void brcmf_sdio_firmware_callback
- bus->sdcnt.tickcnt = 0;
- brcmf_sdio_wd_timer(bus, true);
-
-- sdio_claim_host(sdiodev->func[1]);
-+ sdio_claim_host(sdiodev->func1);
-
- /* Make sure backplane clock is on, needed to generate F2 interrupt */
- brcmf_sdio_clkctl(bus, CLK_AVAIL, false);
-@@ -4066,7 +4066,7 @@ static void brcmf_sdio_firmware_callback
- brcmf_sdiod_writel(sdiod, core->base + SD_REG(tosbmailboxdata),
- SDPCM_PROT_VERSION << SMB_DATA_VERSION_SHIFT, NULL);
-
-- err = sdio_enable_func(sdiodev->func[2]);
-+ err = sdio_enable_func(sdiodev->func2);
-
- brcmf_dbg(INFO, "enable F2: err=%d\n", err);
-
-@@ -4081,7 +4081,7 @@ static void brcmf_sdio_firmware_callback
- brcmf_sdiod_writeb(sdiodev, SBSDIO_WATERMARK, 8, &err);
- } else {
- /* Disable F2 again */
-- sdio_disable_func(sdiodev->func[2]);
-+ sdio_disable_func(sdiodev->func2);
- goto release;
- }
-
-@@ -4106,7 +4106,7 @@ static void brcmf_sdio_firmware_callback
- if (err != 0)
- brcmf_sdio_clkctl(bus, CLK_NONE, false);
-
-- sdio_release_host(sdiodev->func[1]);
-+ sdio_release_host(sdiodev->func1);
-
- err = brcmf_bus_started(dev);
- if (err != 0) {
-@@ -4116,10 +4116,10 @@ static void brcmf_sdio_firmware_callback
- return;
-
- release:
-- sdio_release_host(sdiodev->func[1]);
-+ sdio_release_host(sdiodev->func1);
- fail:
- brcmf_dbg(TRACE, "failed: dev=%s, err=%d\n", dev_name(dev), err);
-- device_release_driver(&sdiodev->func[2]->dev);
-+ device_release_driver(&sdiodev->func2->dev);
- device_release_driver(dev);
- }
-
-@@ -4146,7 +4146,7 @@ struct brcmf_sdio *brcmf_sdio_probe(stru
-
- /* single-threaded workqueue */
- wq = alloc_ordered_workqueue("brcmf_wq/%s", WQ_MEM_RECLAIM,
-- dev_name(&sdiodev->func[1]->dev));
-+ dev_name(&sdiodev->func1->dev));
- if (!wq) {
- brcmf_err("insufficient memory to create txworkqueue\n");
- goto fail;
-@@ -4173,7 +4173,7 @@ struct brcmf_sdio *brcmf_sdio_probe(stru
- init_completion(&bus->watchdog_wait);
- bus->watchdog_tsk = kthread_run(brcmf_sdio_watchdog_thread,
- bus, "brcmf_wdog/%s",
-- dev_name(&sdiodev->func[1]->dev));
-+ dev_name(&sdiodev->func1->dev));
- if (IS_ERR(bus->watchdog_tsk)) {
- pr_warn("brcmf_watchdog thread failed to start\n");
- bus->watchdog_tsk = NULL;
-@@ -4199,7 +4199,7 @@ struct brcmf_sdio *brcmf_sdio_probe(stru
- }
-
- /* Query the F2 block size, set roundup accordingly */
-- bus->blocksize = bus->sdiodev->func[2]->cur_blksize;
-+ bus->blocksize = bus->sdiodev->func2->cur_blksize;
- bus->roundup = min(max_roundup, bus->blocksize);
-
- /* Allocate buffers */
-@@ -4215,17 +4215,17 @@ struct brcmf_sdio *brcmf_sdio_probe(stru
- }
- }
-
-- sdio_claim_host(bus->sdiodev->func[1]);
-+ sdio_claim_host(bus->sdiodev->func1);
-
- /* Disable F2 to clear any intermediate frame state on the dongle */
-- sdio_disable_func(bus->sdiodev->func[2]);
-+ sdio_disable_func(bus->sdiodev->func2);
-
- bus->rxflow = false;
-
- /* Done with backplane-dependent accesses, can drop clock... */
- brcmf_sdiod_writeb(bus->sdiodev, SBSDIO_FUNC1_CHIPCLKCSR, 0, NULL);
-
-- sdio_release_host(bus->sdiodev->func[1]);
-+ sdio_release_host(bus->sdiodev->func1);
-
- /* ...and initialize clock/power states */
- bus->clkstate = CLK_SDONLY;
-@@ -4277,7 +4277,7 @@ void brcmf_sdio_remove(struct brcmf_sdio
-
- if (bus->ci) {
- if (bus->sdiodev->state != BRCMF_SDIOD_NOMEDIUM) {
-- sdio_claim_host(bus->sdiodev->func[1]);
-+ sdio_claim_host(bus->sdiodev->func1);
- brcmf_sdio_wd_timer(bus, false);
- brcmf_sdio_clkctl(bus, CLK_AVAIL, false);
- /* Leave the device in state where it is
-@@ -4287,7 +4287,7 @@ void brcmf_sdio_remove(struct brcmf_sdio
- msleep(20);
- brcmf_chip_set_passive(bus->ci);
- brcmf_sdio_clkctl(bus, CLK_NONE, false);
-- sdio_release_host(bus->sdiodev->func[1]);
-+ sdio_release_host(bus->sdiodev->func1);
- }
- brcmf_chip_detach(bus->ci);
- }
-@@ -4334,9 +4334,9 @@ int brcmf_sdio_sleep(struct brcmf_sdio *
- {
- int ret;
-
-- sdio_claim_host(bus->sdiodev->func[1]);
-+ sdio_claim_host(bus->sdiodev->func1);
- ret = brcmf_sdio_bus_sleep(bus, sleep, false);
-- sdio_release_host(bus->sdiodev->func[1]);
-+ sdio_release_host(bus->sdiodev->func1);
-
- return ret;
- }
---- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.h
-+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.h
-@@ -21,9 +21,6 @@
- #include <linux/firmware.h>
- #include "firmware.h"
-
--/* Maximum number of I/O funcs */
--#define NUM_SDIO_FUNCS 3
--
- #define SDIOD_FBR_SIZE 0x100
-
- /* io_en */
-@@ -173,8 +170,8 @@ struct brcmf_sdio;
- struct brcmf_sdiod_freezer;
-
- struct brcmf_sdio_dev {
-- struct sdio_func *func[NUM_SDIO_FUNCS];
-- u8 num_funcs; /* Supported funcs on client */
-+ struct sdio_func *func1;
-+ struct sdio_func *func2;
- u32 sbwad; /* Save backplane window address */
- struct brcmf_core *cc_core; /* chipcommon core info struct */
- struct brcmf_sdio *bus;
-@@ -295,17 +292,17 @@ void brcmf_sdiod_intr_unregister(struct
- /* SDIO device register access interface */
- /* Accessors for SDIO Function 0 */
- #define brcmf_sdiod_func0_rb(sdiodev, addr, r) \
-- sdio_f0_readb((sdiodev)->func[1], (addr), (r))
-+ sdio_f0_readb((sdiodev)->func1, (addr), (r))
-
- #define brcmf_sdiod_func0_wb(sdiodev, addr, v, ret) \
-- sdio_f0_writeb((sdiodev)->func[1], (v), (addr), (ret))
-+ sdio_f0_writeb((sdiodev)->func1, (v), (addr), (ret))
-
- /* Accessors for SDIO Function 1 */
- #define brcmf_sdiod_readb(sdiodev, addr, r) \
-- sdio_readb((sdiodev)->func[1], (addr), (r))
-+ sdio_readb((sdiodev)->func1, (addr), (r))
-
- #define brcmf_sdiod_writeb(sdiodev, addr, v, ret) \
-- sdio_writeb((sdiodev)->func[1], (v), (addr), (ret))
-+ sdio_writeb((sdiodev)->func1, (v), (addr), (ret))
-
- u32 brcmf_sdiod_readl(struct brcmf_sdio_dev *sdiodev, u32 addr, int *ret);
- void brcmf_sdiod_writel(struct brcmf_sdio_dev *sdiodev, u32 addr, u32 data,
diff --git a/package/kernel/mac80211/patches/316-v4.16-0002-brcmfmac-add-comment-block-in-brcmf_sdio_buscore_rea.patch b/package/kernel/mac80211/patches/316-v4.16-0002-brcmfmac-add-comment-block-in-brcmf_sdio_buscore_rea.patch
deleted file mode 100644
index dc78000be1..0000000000
--- a/package/kernel/mac80211/patches/316-v4.16-0002-brcmfmac-add-comment-block-in-brcmf_sdio_buscore_rea.patch
+++ /dev/null
@@ -1,31 +0,0 @@
-From 32adbcaa5df49f1977441f7a4bf180a0bcfe9966 Mon Sep 17 00:00:00 2001
-From: Arend Van Spriel <arend.vanspriel@broadcom.com>
-Date: Tue, 9 Jan 2018 13:22:53 +0100
-Subject: [PATCH] brcmfmac: add comment block in brcmf_sdio_buscore_read()
-
-In brcmf_sdio_buscore_read() there is some special handling upon
-register access to chipid register of the chipcommon core. Add
-comment explaining why it is done here.
-
-Signed-off-by: Arend van Spriel <arend.vanspriel@broadcom.com>
-Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
----
- drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c | 7 +++++++
- 1 file changed, 7 insertions(+)
-
---- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c
-+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c
-@@ -3772,6 +3772,13 @@ static u32 brcmf_sdio_buscore_read32(voi
-
- val = brcmf_sdiod_readl(sdiodev, addr, NULL);
-
-+ /*
-+ * this is a bit of special handling if reading the chipcommon chipid
-+ * register. The 4339 is a next-gen of the 4335. It uses the same
-+ * SDIO device id as 4335 and the chipid register returns 4335 as well.
-+ * It can be identified as 4339 by looking at the chip revision. It
-+ * is corrected here so the chip.c module has the right info.
-+ */
- if (addr == CORE_CC_REG(SI_ENUM_BASE, chipid) &&
- (sdiodev->func1->device == SDIO_DEVICE_ID_BROADCOM_4339 ||
- sdiodev->func1->device == SDIO_DEVICE_ID_BROADCOM_4335_4339)) {
diff --git a/package/kernel/mac80211/patches/316-v4.16-0003-brcmfmac-rename-brcmf_sdiod_buff_-read-write-functio.patch b/package/kernel/mac80211/patches/316-v4.16-0003-brcmfmac-rename-brcmf_sdiod_buff_-read-write-functio.patch
deleted file mode 100644
index c587f413d5..0000000000
--- a/package/kernel/mac80211/patches/316-v4.16-0003-brcmfmac-rename-brcmf_sdiod_buff_-read-write-functio.patch
+++ /dev/null
@@ -1,137 +0,0 @@
-From 378f6a16043e5d3346301fc618f503e97aea335b Mon Sep 17 00:00:00 2001
-From: Arend Van Spriel <arend.vanspriel@broadcom.com>
-Date: Tue, 9 Jan 2018 13:22:54 +0100
-Subject: [PATCH] brcmfmac: rename brcmf_sdiod_buff_{read,write}() functions
-
-Rename functions to brcmf_sdio_skbuff_{read,write}() as we pass an
-skbuff to this function.
-
-Signed-off-by: Arend van Spriel <arend.vanspriel@broadcom.com>
-Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
----
- .../wireless/broadcom/brcm80211/brcmfmac/bcmsdh.c | 48 +++++++++++-----------
- 1 file changed, 24 insertions(+), 24 deletions(-)
-
---- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/bcmsdh.c
-+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/bcmsdh.c
-@@ -292,24 +292,24 @@ out:
- *ret = retval;
- }
-
--static int brcmf_sdiod_buff_read(struct brcmf_sdio_dev *sdiodev,
-- struct sdio_func *func, u32 addr,
-- struct sk_buff *pkt)
-+static int brcmf_sdiod_skbuff_read(struct brcmf_sdio_dev *sdiodev,
-+ struct sdio_func *func, u32 addr,
-+ struct sk_buff *skb)
- {
- unsigned int req_sz;
- int err;
-
- /* Single skb use the standard mmc interface */
-- req_sz = pkt->len + 3;
-+ req_sz = skb->len + 3;
- req_sz &= (uint)~3;
-
- switch (func->num) {
- case 1:
-- err = sdio_memcpy_fromio(func, ((u8 *)(pkt->data)), addr,
-+ err = sdio_memcpy_fromio(func, ((u8 *)(skb->data)), addr,
- req_sz);
- break;
- case 2:
-- err = sdio_readsb(func, ((u8 *)(pkt->data)), addr, req_sz);
-+ err = sdio_readsb(func, ((u8 *)(skb->data)), addr, req_sz);
- break;
- default:
- /* bail out as things are really fishy here */
-@@ -323,18 +323,18 @@ static int brcmf_sdiod_buff_read(struct
- return err;
- }
-
--static int brcmf_sdiod_buff_write(struct brcmf_sdio_dev *sdiodev,
-- struct sdio_func *func, u32 addr,
-- struct sk_buff *pkt)
-+static int brcmf_sdiod_skbuff_write(struct brcmf_sdio_dev *sdiodev,
-+ struct sdio_func *func, u32 addr,
-+ struct sk_buff *skb)
- {
- unsigned int req_sz;
- int err;
-
- /* Single skb use the standard mmc interface */
-- req_sz = pkt->len + 3;
-+ req_sz = skb->len + 3;
- req_sz &= (uint)~3;
-
-- err = sdio_memcpy_toio(func, addr, ((u8 *)(pkt->data)), req_sz);
-+ err = sdio_memcpy_toio(func, addr, ((u8 *)(skb->data)), req_sz);
-
- if (err == -ENOMEDIUM)
- brcmf_sdiod_change_state(sdiodev, BRCMF_SDIOD_NOMEDIUM);
-@@ -550,7 +550,7 @@ int brcmf_sdiod_recv_pkt(struct brcmf_sd
- addr &= SBSDIO_SB_OFT_ADDR_MASK;
- addr |= SBSDIO_SB_ACCESS_2_4B_FLAG;
-
-- err = brcmf_sdiod_buff_read(sdiodev, sdiodev->func2, addr, pkt);
-+ err = brcmf_sdiod_skbuff_read(sdiodev, sdiodev->func2, addr, pkt);
-
- done:
- return err;
-@@ -575,14 +575,14 @@ int brcmf_sdiod_recv_chain(struct brcmf_
- addr |= SBSDIO_SB_ACCESS_2_4B_FLAG;
-
- if (pktq->qlen == 1)
-- err = brcmf_sdiod_buff_read(sdiodev, sdiodev->func2, addr,
-- pktq->next);
-+ err = brcmf_sdiod_skbuff_read(sdiodev, sdiodev->func2, addr,
-+ pktq->next);
- else if (!sdiodev->sg_support) {
- glom_skb = brcmu_pkt_buf_get_skb(totlen);
- if (!glom_skb)
- return -ENOMEM;
-- err = brcmf_sdiod_buff_read(sdiodev, sdiodev->func2, addr,
-- glom_skb);
-+ err = brcmf_sdiod_skbuff_read(sdiodev, sdiodev->func2, addr,
-+ glom_skb);
- if (err)
- goto done;
-
-@@ -623,8 +623,8 @@ int brcmf_sdiod_send_buf(struct brcmf_sd
- addr |= SBSDIO_SB_ACCESS_2_4B_FLAG;
-
- if (!err)
-- err = brcmf_sdiod_buff_write(sdiodev, sdiodev->func2, addr,
-- mypkt);
-+ err = brcmf_sdiod_skbuff_write(sdiodev, sdiodev->func2, addr,
-+ mypkt);
-
- brcmu_pkt_buf_free_skb(mypkt);
-
-@@ -649,8 +649,8 @@ int brcmf_sdiod_send_pkt(struct brcmf_sd
-
- if (pktq->qlen == 1 || !sdiodev->sg_support) {
- skb_queue_walk(pktq, skb) {
-- err = brcmf_sdiod_buff_write(sdiodev, sdiodev->func2,
-- addr, skb);
-+ err = brcmf_sdiod_skbuff_write(sdiodev, sdiodev->func2,
-+ addr, skb);
- if (err)
- break;
- }
-@@ -706,11 +706,11 @@ brcmf_sdiod_ramrw(struct brcmf_sdio_dev
-
- if (write) {
- memcpy(pkt->data, data, dsize);
-- err = brcmf_sdiod_buff_write(sdiodev, sdiodev->func1,
-- sdaddr, pkt);
-+ err = brcmf_sdiod_skbuff_write(sdiodev, sdiodev->func1,
-+ sdaddr, pkt);
- } else {
-- err = brcmf_sdiod_buff_read(sdiodev, sdiodev->func1,
-- sdaddr, pkt);
-+ err = brcmf_sdiod_skbuff_read(sdiodev, sdiodev->func1,
-+ sdaddr, pkt);
- }
-
- if (err) {
diff --git a/package/kernel/mac80211/patches/317-v4.16-0001-brcmfmac-Use-zeroing-memory-allocator-than-allocator.patch b/package/kernel/mac80211/patches/317-v4.16-0001-brcmfmac-Use-zeroing-memory-allocator-than-allocator.patch
deleted file mode 100644
index b60c81a3a2..0000000000
--- a/package/kernel/mac80211/patches/317-v4.16-0001-brcmfmac-Use-zeroing-memory-allocator-than-allocator.patch
+++ /dev/null
@@ -1,59 +0,0 @@
-From b7acadaf038740c43515dc1548f43d01cc92823a Mon Sep 17 00:00:00 2001
-From: Himanshu Jha <himanshujha199640@gmail.com>
-Date: Tue, 9 Jan 2018 02:15:31 +0530
-Subject: [PATCH] brcmfmac: Use zeroing memory allocator than allocator/memset
-
-Use dma_zalloc_coherent for allocating zeroed
-memory and remove unnecessary memset function.
-
-Generated-by: scripts/coccinelle/api/alloc/kzalloc-simple.cocci
-
-Suggested-by: Luis R. Rodriguez <mcgrof@kernel.org>
-Signed-off-by: Himanshu Jha <himanshujha199640@gmail.com>
-Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
----
- .../net/wireless/broadcom/brcm80211/brcmfmac/pcie.c | 20 ++++++++++----------
- 1 file changed, 10 insertions(+), 10 deletions(-)
-
---- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/pcie.c
-+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/pcie.c
-@@ -1251,14 +1251,14 @@ static int brcmf_pcie_init_scratchbuffer
- u64 address;
- u32 addr;
-
-- devinfo->shared.scratch = dma_alloc_coherent(&devinfo->pdev->dev,
-- BRCMF_DMA_D2H_SCRATCH_BUF_LEN,
-- &devinfo->shared.scratch_dmahandle, GFP_KERNEL);
-+ devinfo->shared.scratch =
-+ dma_zalloc_coherent(&devinfo->pdev->dev,
-+ BRCMF_DMA_D2H_SCRATCH_BUF_LEN,
-+ &devinfo->shared.scratch_dmahandle,
-+ GFP_KERNEL);
- if (!devinfo->shared.scratch)
- goto fail;
-
-- memset(devinfo->shared.scratch, 0, BRCMF_DMA_D2H_SCRATCH_BUF_LEN);
--
- addr = devinfo->shared.tcm_base_address +
- BRCMF_SHARED_DMA_SCRATCH_ADDR_OFFSET;
- address = (u64)devinfo->shared.scratch_dmahandle;
-@@ -1268,14 +1268,14 @@ static int brcmf_pcie_init_scratchbuffer
- BRCMF_SHARED_DMA_SCRATCH_LEN_OFFSET;
- brcmf_pcie_write_tcm32(devinfo, addr, BRCMF_DMA_D2H_SCRATCH_BUF_LEN);
-
-- devinfo->shared.ringupd = dma_alloc_coherent(&devinfo->pdev->dev,
-- BRCMF_DMA_D2H_RINGUPD_BUF_LEN,
-- &devinfo->shared.ringupd_dmahandle, GFP_KERNEL);
-+ devinfo->shared.ringupd =
-+ dma_zalloc_coherent(&devinfo->pdev->dev,
-+ BRCMF_DMA_D2H_RINGUPD_BUF_LEN,
-+ &devinfo->shared.ringupd_dmahandle,
-+ GFP_KERNEL);
- if (!devinfo->shared.ringupd)
- goto fail;
-
-- memset(devinfo->shared.ringupd, 0, BRCMF_DMA_D2H_RINGUPD_BUF_LEN);
--
- addr = devinfo->shared.tcm_base_address +
- BRCMF_SHARED_DMA_RINGUPD_ADDR_OFFSET;
- address = (u64)devinfo->shared.ringupd_dmahandle;
diff --git a/package/kernel/mac80211/patches/318-v4.17-mac80211-round-IEEE80211_TX_STATUS_HEADROOM-up-to-mu.patch b/package/kernel/mac80211/patches/318-v4.17-mac80211-round-IEEE80211_TX_STATUS_HEADROOM-up-to-mu.patch
deleted file mode 100644
index e955cb3a25..0000000000
--- a/package/kernel/mac80211/patches/318-v4.17-mac80211-round-IEEE80211_TX_STATUS_HEADROOM-up-to-mu.patch
+++ /dev/null
@@ -1,26 +0,0 @@
-From: Felix Fietkau <nbd@nbd.name>
-Date: Fri, 9 Feb 2018 19:46:54 +0100
-Subject: [PATCH] mac80211: round IEEE80211_TX_STATUS_HEADROOM up to multiple
- of 4
-
-This ensures that mac80211 allocated management frames are properly
-aligned, which makes copying them more efficient.
-For instance, mt76 uses iowrite32_copy to copy beacon frames to beacon
-template memory on the chip.
-Misaligned 32-bit accesses cause CPU exceptions on MIPS and should be
-avoided.
-
-Signed-off-by: Felix Fietkau <nbd@nbd.name>
----
-
---- a/include/net/mac80211.h
-+++ b/include/net/mac80211.h
-@@ -4145,7 +4145,7 @@ void ieee80211_sta_uapsd_trigger(struct
- * The TX headroom reserved by mac80211 for its own tx_status functions.
- * This is enough for the radiotap header.
- */
--#define IEEE80211_TX_STATUS_HEADROOM 14
-+#define IEEE80211_TX_STATUS_HEADROOM ALIGN(14, 4)
-
- /**
- * ieee80211_sta_set_buffered - inform mac80211 about driver-buffered frames
diff --git a/package/kernel/mac80211/patches/319-v4.17-0001-mac80211-drop-frames-with-unexpected-DS-bits-from-fa.patch b/package/kernel/mac80211/patches/319-v4.17-0001-mac80211-drop-frames-with-unexpected-DS-bits-from-fa.patch
deleted file mode 100644
index a7562996b1..0000000000
--- a/package/kernel/mac80211/patches/319-v4.17-0001-mac80211-drop-frames-with-unexpected-DS-bits-from-fa.patch
+++ /dev/null
@@ -1,21 +0,0 @@
-From: Felix Fietkau <nbd@nbd.name>
-Date: Fri, 23 Feb 2018 09:59:35 +0100
-Subject: [PATCH] mac80211: drop frames with unexpected DS bits from
- fast-rx to slow path
-
-Fixes rx for 4-addr packets in AP mode
-
-Signed-off-by: Felix Fietkau <nbd@nbd.name>
----
-
---- a/net/mac80211/rx.c
-+++ b/net/mac80211/rx.c
-@@ -3928,7 +3928,7 @@ static bool ieee80211_invoke_fast_rx(str
- if ((hdr->frame_control & cpu_to_le16(IEEE80211_FCTL_FROMDS |
- IEEE80211_FCTL_TODS)) !=
- fast_rx->expected_ds_bits)
-- goto drop;
-+ return false;
-
- /* assign the key to drop unencrypted frames (later)
- * and strip the IV/MIC if necessary
diff --git a/package/kernel/mac80211/patches/319-v4.17-0002-mac80211-support-AP-4-addr-mode-fast-rx.patch b/package/kernel/mac80211/patches/319-v4.17-0002-mac80211-support-AP-4-addr-mode-fast-rx.patch
deleted file mode 100644
index 3f3eb0a5e1..0000000000
--- a/package/kernel/mac80211/patches/319-v4.17-0002-mac80211-support-AP-4-addr-mode-fast-rx.patch
+++ /dev/null
@@ -1,25 +0,0 @@
-From: Felix Fietkau <nbd@nbd.name>
-Date: Fri, 23 Feb 2018 10:00:22 +0100
-Subject: [PATCH] mac80211: support AP 4-addr mode fast-rx
-
-Signed-off-by: Felix Fietkau <nbd@nbd.name>
----
-
---- a/net/mac80211/rx.c
-+++ b/net/mac80211/rx.c
-@@ -3774,6 +3774,15 @@ void ieee80211_check_fast_rx(struct sta_
- !(sdata->flags & IEEE80211_SDATA_DONT_BRIDGE_PACKETS) &&
- (sdata->vif.type != NL80211_IFTYPE_AP_VLAN ||
- !sdata->u.vlan.sta);
-+
-+ if (sdata->vif.type == NL80211_IFTYPE_AP_VLAN &&
-+ sdata->u.vlan.sta) {
-+ fastrx.expected_ds_bits |=
-+ cpu_to_le16(IEEE80211_FCTL_FROMDS);
-+ fastrx.sa_offs = offsetof(struct ieee80211_hdr, addr4);
-+ fastrx.internal_forward = 0;
-+ }
-+
- break;
- default:
- goto clear;
diff --git a/package/kernel/mac80211/patches/319-v4.17-0003-mac80211-support-fast-rx-with-incompatible-PS-capabi.patch b/package/kernel/mac80211/patches/319-v4.17-0003-mac80211-support-fast-rx-with-incompatible-PS-capabi.patch
deleted file mode 100644
index 8c4c724ef7..0000000000
--- a/package/kernel/mac80211/patches/319-v4.17-0003-mac80211-support-fast-rx-with-incompatible-PS-capabi.patch
+++ /dev/null
@@ -1,53 +0,0 @@
-From: Felix Fietkau <nbd@nbd.name>
-Date: Fri, 23 Feb 2018 10:01:53 +0100
-Subject: [PATCH] mac80211: support fast-rx with incompatible PS
- capabilities when PS is disabled
-
-When powersave is disabled for the interface, we can do fast-rx anyway.
-
-Signed-off-by: Felix Fietkau <nbd@nbd.name>
----
-
---- a/net/mac80211/cfg.c
-+++ b/net/mac80211/cfg.c
-@@ -2658,6 +2658,7 @@ static int ieee80211_set_power_mgmt(stru
-
- ieee80211_recalc_ps(local);
- ieee80211_recalc_ps_vif(sdata);
-+ ieee80211_check_fast_rx_iface(sdata);
-
- return 0;
- }
---- a/net/mac80211/rx.c
-+++ b/net/mac80211/rx.c
-@@ -3741,12 +3741,7 @@ void ieee80211_check_fast_rx(struct sta_
- /* 4-addr is harder to deal with, later maybe */
- if (sdata->u.mgd.use_4addr)
- goto clear;
-- /* software powersave is a huge mess, avoid all of it */
-- if (ieee80211_hw_check(&local->hw, PS_NULLFUNC_STACK))
-- goto clear;
-- if (ieee80211_hw_check(&local->hw, SUPPORTS_PS) &&
-- !ieee80211_hw_check(&local->hw, SUPPORTS_DYNAMIC_PS))
-- goto clear;
-+
- if (sta->sta.tdls) {
- fastrx.da_offs = offsetof(struct ieee80211_hdr, addr1);
- fastrx.sa_offs = offsetof(struct ieee80211_hdr, addr2);
-@@ -3758,6 +3753,16 @@ void ieee80211_check_fast_rx(struct sta_
- fastrx.expected_ds_bits =
- cpu_to_le16(IEEE80211_FCTL_FROMDS);
- }
-+
-+ if (!sdata->u.mgd.powersave)
-+ break;
-+
-+ /* software powersave is a huge mess, avoid all of it */
-+ if (ieee80211_hw_check(&local->hw, PS_NULLFUNC_STACK))
-+ goto clear;
-+ if (ieee80211_hw_check(&local->hw, SUPPORTS_PS) &&
-+ !ieee80211_hw_check(&local->hw, SUPPORTS_DYNAMIC_PS))
-+ goto clear;
- break;
- case NL80211_IFTYPE_AP_VLAN:
- case NL80211_IFTYPE_AP:
diff --git a/package/kernel/mac80211/patches/319-v4.17-0004-mac80211-support-station-4-addr-mode-fast-rx.patch b/package/kernel/mac80211/patches/319-v4.17-0004-mac80211-support-station-4-addr-mode-fast-rx.patch
deleted file mode 100644
index 97a5d8beba..0000000000
--- a/package/kernel/mac80211/patches/319-v4.17-0004-mac80211-support-station-4-addr-mode-fast-rx.patch
+++ /dev/null
@@ -1,34 +0,0 @@
-From: Felix Fietkau <nbd@nbd.name>
-Date: Fri, 23 Feb 2018 10:05:08 +0100
-Subject: [PATCH] mac80211: support station 4-addr mode fast-rx
-
-Signed-off-by: Felix Fietkau <nbd@nbd.name>
----
-
---- a/net/mac80211/rx.c
-+++ b/net/mac80211/rx.c
-@@ -3738,10 +3738,6 @@ void ieee80211_check_fast_rx(struct sta_
-
- switch (sdata->vif.type) {
- case NL80211_IFTYPE_STATION:
-- /* 4-addr is harder to deal with, later maybe */
-- if (sdata->u.mgd.use_4addr)
-- goto clear;
--
- if (sta->sta.tdls) {
- fastrx.da_offs = offsetof(struct ieee80211_hdr, addr1);
- fastrx.sa_offs = offsetof(struct ieee80211_hdr, addr2);
-@@ -3754,6 +3750,13 @@ void ieee80211_check_fast_rx(struct sta_
- cpu_to_le16(IEEE80211_FCTL_FROMDS);
- }
-
-+ if (sdata->u.mgd.use_4addr && !sta->sta.tdls) {
-+ fastrx.expected_ds_bits |=
-+ cpu_to_le16(IEEE80211_FCTL_TODS);
-+ fastrx.da_offs = offsetof(struct ieee80211_hdr, addr3);
-+ fastrx.sa_offs = offsetof(struct ieee80211_hdr, addr4);
-+ }
-+
- if (!sdata->u.mgd.powersave)
- break;
-
diff --git a/package/kernel/mac80211/patches/320-v4.17-mac80211-support-A-MSDU-in-fast-rx.patch b/package/kernel/mac80211/patches/320-v4.17-mac80211-support-A-MSDU-in-fast-rx.patch
deleted file mode 100644
index 3c6d342ff1..0000000000
--- a/package/kernel/mac80211/patches/320-v4.17-mac80211-support-A-MSDU-in-fast-rx.patch
+++ /dev/null
@@ -1,256 +0,0 @@
-From: Felix Fietkau <nbd@nbd.name>
-Date: Mon, 26 Feb 2018 22:09:29 +0100
-Subject: [PATCH] mac80211: support A-MSDU in fast-rx
-
-Only works if the IV was stripped from packets. Create a smaller
-variant of ieee80211_rx_h_amsdu, which bypasses checks already done
-within the fast-rx context.
-
-Signed-off-by: Felix Fietkau <nbd@nbd.name>
----
-
---- a/net/mac80211/rx.c
-+++ b/net/mac80211/rx.c
-@@ -2358,39 +2358,17 @@ ieee80211_deliver_skb(struct ieee80211_r
- }
-
- static ieee80211_rx_result debug_noinline
--ieee80211_rx_h_amsdu(struct ieee80211_rx_data *rx)
-+__ieee80211_rx_h_amsdu(struct ieee80211_rx_data *rx, u8 data_offset)
- {
- struct net_device *dev = rx->sdata->dev;
- struct sk_buff *skb = rx->skb;
- struct ieee80211_hdr *hdr = (struct ieee80211_hdr *)skb->data;
- __le16 fc = hdr->frame_control;
- struct sk_buff_head frame_list;
-- struct ieee80211_rx_status *status = IEEE80211_SKB_RXCB(rx->skb);
- struct ethhdr ethhdr;
- const u8 *check_da = ethhdr.h_dest, *check_sa = ethhdr.h_source;
-
-- if (unlikely(!ieee80211_is_data(fc)))
-- return RX_CONTINUE;
--
-- if (unlikely(!ieee80211_is_data_present(fc)))
-- return RX_DROP_MONITOR;
--
-- if (!(status->rx_flags & IEEE80211_RX_AMSDU))
-- return RX_CONTINUE;
--
- if (unlikely(ieee80211_has_a4(hdr->frame_control))) {
-- switch (rx->sdata->vif.type) {
-- case NL80211_IFTYPE_AP_VLAN:
-- if (!rx->sdata->u.vlan.sta)
-- return RX_DROP_UNUSABLE;
-- break;
-- case NL80211_IFTYPE_STATION:
-- if (!rx->sdata->u.mgd.use_4addr)
-- return RX_DROP_UNUSABLE;
-- break;
-- default:
-- return RX_DROP_UNUSABLE;
-- }
- check_da = NULL;
- check_sa = NULL;
- } else switch (rx->sdata->vif.type) {
-@@ -2410,15 +2388,13 @@ ieee80211_rx_h_amsdu(struct ieee80211_rx
- break;
- }
-
-- if (is_multicast_ether_addr(hdr->addr1))
-- return RX_DROP_UNUSABLE;
--
- skb->dev = dev;
- __skb_queue_head_init(&frame_list);
-
- if (ieee80211_data_to_8023_exthdr(skb, &ethhdr,
- rx->sdata->vif.addr,
-- rx->sdata->vif.type))
-+ rx->sdata->vif.type,
-+ data_offset))
- return RX_DROP_UNUSABLE;
-
- ieee80211_amsdu_to_8023s(skb, &frame_list, dev->dev_addr,
-@@ -2440,6 +2416,44 @@ ieee80211_rx_h_amsdu(struct ieee80211_rx
- return RX_QUEUED;
- }
-
-+static ieee80211_rx_result debug_noinline
-+ieee80211_rx_h_amsdu(struct ieee80211_rx_data *rx)
-+{
-+ struct sk_buff *skb = rx->skb;
-+ struct ieee80211_rx_status *status = IEEE80211_SKB_RXCB(skb);
-+ struct ieee80211_hdr *hdr = (struct ieee80211_hdr *)skb->data;
-+ __le16 fc = hdr->frame_control;
-+
-+ if (!(status->rx_flags & IEEE80211_RX_AMSDU))
-+ return RX_CONTINUE;
-+
-+ if (unlikely(!ieee80211_is_data(fc)))
-+ return RX_CONTINUE;
-+
-+ if (unlikely(!ieee80211_is_data_present(fc)))
-+ return RX_DROP_MONITOR;
-+
-+ if (unlikely(ieee80211_has_a4(hdr->frame_control))) {
-+ switch (rx->sdata->vif.type) {
-+ case NL80211_IFTYPE_AP_VLAN:
-+ if (!rx->sdata->u.vlan.sta)
-+ return RX_DROP_UNUSABLE;
-+ break;
-+ case NL80211_IFTYPE_STATION:
-+ if (!rx->sdata->u.mgd.use_4addr)
-+ return RX_DROP_UNUSABLE;
-+ break;
-+ default:
-+ return RX_DROP_UNUSABLE;
-+ }
-+ }
-+
-+ if (is_multicast_ether_addr(hdr->addr1))
-+ return RX_DROP_UNUSABLE;
-+
-+ return __ieee80211_rx_h_amsdu(rx, 0);
-+}
-+
- #ifdef CPTCFG_MAC80211_MESH
- static ieee80211_rx_result
- ieee80211_rx_h_mesh_fwding(struct ieee80211_rx_data *rx)
-@@ -3889,7 +3903,8 @@ static bool ieee80211_invoke_fast_rx(str
- struct ieee80211_rx_status *status = IEEE80211_SKB_RXCB(skb);
- struct sta_info *sta = rx->sta;
- int orig_len = skb->len;
-- int snap_offs = ieee80211_hdrlen(hdr->frame_control);
-+ int hdrlen = ieee80211_hdrlen(hdr->frame_control);
-+ int snap_offs = hdrlen;
- struct {
- u8 snap[sizeof(rfc1042_header)];
- __be16 proto;
-@@ -3920,10 +3935,6 @@ static bool ieee80211_invoke_fast_rx(str
- (status->flag & FAST_RX_CRYPT_FLAGS) != FAST_RX_CRYPT_FLAGS)
- return false;
-
-- /* we don't deal with A-MSDU deaggregation here */
-- if (status->rx_flags & IEEE80211_RX_AMSDU)
-- return false;
--
- if (unlikely(!ieee80211_is_data_present(hdr->frame_control)))
- return false;
-
-@@ -3955,21 +3966,24 @@ static bool ieee80211_invoke_fast_rx(str
- snap_offs += IEEE80211_CCMP_HDR_LEN;
- }
-
-- if (!pskb_may_pull(skb, snap_offs + sizeof(*payload)))
-- goto drop;
-- payload = (void *)(skb->data + snap_offs);
-+ if (!(status->rx_flags & IEEE80211_RX_AMSDU)) {
-+ if (!pskb_may_pull(skb, snap_offs + sizeof(*payload)))
-+ goto drop;
-
-- if (!ether_addr_equal(payload->snap, fast_rx->rfc1042_hdr))
-- return false;
-+ payload = (void *)(skb->data + snap_offs);
-
-- /* Don't handle these here since they require special code.
-- * Accept AARP and IPX even though they should come with a
-- * bridge-tunnel header - but if we get them this way then
-- * there's little point in discarding them.
-- */
-- if (unlikely(payload->proto == cpu_to_be16(ETH_P_TDLS) ||
-- payload->proto == fast_rx->control_port_protocol))
-- return false;
-+ if (!ether_addr_equal(payload->snap, fast_rx->rfc1042_hdr))
-+ return false;
-+
-+ /* Don't handle these here since they require special code.
-+ * Accept AARP and IPX even though they should come with a
-+ * bridge-tunnel header - but if we get them this way then
-+ * there's little point in discarding them.
-+ */
-+ if (unlikely(payload->proto == cpu_to_be16(ETH_P_TDLS) ||
-+ payload->proto == fast_rx->control_port_protocol))
-+ return false;
-+ }
-
- /* after this point, don't punt to the slowpath! */
-
-@@ -3983,12 +3997,6 @@ static bool ieee80211_invoke_fast_rx(str
- }
-
- /* statistics part of ieee80211_rx_h_sta_process() */
-- stats->last_rx = jiffies;
-- stats->last_rate = sta_stats_encode_rate(status);
--
-- stats->fragments++;
-- stats->packets++;
--
- if (!(status->flag & RX_FLAG_NO_SIGNAL_VAL)) {
- stats->last_signal = status->signal;
- if (!fast_rx->uses_rss)
-@@ -4017,6 +4025,20 @@ static bool ieee80211_invoke_fast_rx(str
- if (rx->key && !ieee80211_has_protected(hdr->frame_control))
- goto drop;
-
-+ if (status->rx_flags & IEEE80211_RX_AMSDU) {
-+ if (__ieee80211_rx_h_amsdu(rx, snap_offs - hdrlen) !=
-+ RX_QUEUED)
-+ goto drop;
-+
-+ return true;
-+ }
-+
-+ stats->last_rx = jiffies;
-+ stats->last_rate = sta_stats_encode_rate(status);
-+
-+ stats->fragments++;
-+ stats->packets++;
-+
- /* do the header conversion - first grab the addresses */
- ether_addr_copy(addrs.da, skb->data + fast_rx->da_offs);
- ether_addr_copy(addrs.sa, skb->data + fast_rx->sa_offs);
---- a/include/net/cfg80211.h
-+++ b/include/net/cfg80211.h
-@@ -4331,10 +4331,12 @@ unsigned int ieee80211_get_mesh_hdrlen(s
- * of it being pushed into the SKB
- * @addr: the device MAC address
- * @iftype: the virtual interface type
-+ * @data_offset: offset of payload after the 802.11 header
- * Return: 0 on success. Non-zero on error.
- */
- int ieee80211_data_to_8023_exthdr(struct sk_buff *skb, struct ethhdr *ehdr,
-- const u8 *addr, enum nl80211_iftype iftype);
-+ const u8 *addr, enum nl80211_iftype iftype,
-+ u8 data_offset);
-
- /**
- * ieee80211_data_to_8023 - convert an 802.11 data frame to 802.3
-@@ -4346,7 +4348,7 @@ int ieee80211_data_to_8023_exthdr(struct
- static inline int ieee80211_data_to_8023(struct sk_buff *skb, const u8 *addr,
- enum nl80211_iftype iftype)
- {
-- return ieee80211_data_to_8023_exthdr(skb, NULL, addr, iftype);
-+ return ieee80211_data_to_8023_exthdr(skb, NULL, addr, iftype, 0);
- }
-
- /**
---- a/net/wireless/util.c
-+++ b/net/wireless/util.c
-@@ -419,7 +419,8 @@ unsigned int ieee80211_get_mesh_hdrlen(s
- EXPORT_SYMBOL(ieee80211_get_mesh_hdrlen);
-
- int ieee80211_data_to_8023_exthdr(struct sk_buff *skb, struct ethhdr *ehdr,
-- const u8 *addr, enum nl80211_iftype iftype)
-+ const u8 *addr, enum nl80211_iftype iftype,
-+ u8 data_offset)
- {
- struct ieee80211_hdr *hdr = (struct ieee80211_hdr *) skb->data;
- struct {
-@@ -433,7 +434,7 @@ int ieee80211_data_to_8023_exthdr(struct
- if (unlikely(!ieee80211_is_data_present(hdr->frame_control)))
- return -1;
-
-- hdrlen = ieee80211_hdrlen(hdr->frame_control);
-+ hdrlen = ieee80211_hdrlen(hdr->frame_control) + data_offset;
- if (skb->len < hdrlen + 8)
- return -1;
-
diff --git a/package/kernel/mac80211/patches/321-v4.16-0001-brcmfmac-assure-bcdc-dcmd-api-does-not-return-value-.patch b/package/kernel/mac80211/patches/321-v4.16-0001-brcmfmac-assure-bcdc-dcmd-api-does-not-return-value-.patch
deleted file mode 100644
index 394fbfc5b2..0000000000
--- a/package/kernel/mac80211/patches/321-v4.16-0001-brcmfmac-assure-bcdc-dcmd-api-does-not-return-value-.patch
+++ /dev/null
@@ -1,68 +0,0 @@
-From 5242a5444e0b6464d7455beb55d936dd192b5e9d Mon Sep 17 00:00:00 2001
-From: Arend Van Spriel <arend.vanspriel@broadcom.com>
-Date: Mon, 22 Jan 2018 21:46:39 +0100
-Subject: [PATCH] brcmfmac: assure bcdc dcmd api does not return value > 0
-
-The protocol layer api defines callbacks for dongle commands.
-Although not really well documented these should only return an
-error code in case of an error, or 0 upon success. In the bcdc
-protocol it can return value above 0 and we carry a fix in the
-caller of the protocol layer api. This patch makes it adhere to
-the intent of the api as described above.
-
-Reviewed-by: Hante Meuleman <hante.meuleman@broadcom.com>
-Reviewed-by: Pieter-Paul Giesberts <pieter-paul.giesberts@broadcom.com>
-Reviewed-by: Franky Lin <franky.lin@broadcom.com>
-Signed-off-by: Arend van Spriel <arend.vanspriel@broadcom.com>
-Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
----
- drivers/net/wireless/broadcom/brcm80211/brcmfmac/bcdc.c | 6 +++++-
- drivers/net/wireless/broadcom/brcm80211/brcmfmac/fwil.c | 8 +++-----
- 2 files changed, 8 insertions(+), 6 deletions(-)
-
---- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/bcdc.c
-+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/bcdc.c
-@@ -211,6 +211,8 @@ retry:
- memcpy(buf, info, len);
- }
-
-+ ret = 0;
-+
- /* Check the ERROR flag */
- if (flags & BCDC_DCMD_ERROR)
- ret = le32_to_cpu(msg->status);
-@@ -225,7 +227,7 @@ brcmf_proto_bcdc_set_dcmd(struct brcmf_p
- {
- struct brcmf_bcdc *bcdc = (struct brcmf_bcdc *)drvr->proto->pd;
- struct brcmf_proto_bcdc_dcmd *msg = &bcdc->msg;
-- int ret = 0;
-+ int ret;
- u32 flags, id;
-
- brcmf_dbg(BCDC, "Enter, cmd %d len %d\n", cmd, len);
-@@ -249,6 +251,8 @@ brcmf_proto_bcdc_set_dcmd(struct brcmf_p
- goto done;
- }
-
-+ ret = 0;
-+
- /* Check the ERROR flag */
- if (flags & BCDC_DCMD_ERROR)
- ret = le32_to_cpu(msg->status);
---- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/fwil.c
-+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/fwil.c
-@@ -121,11 +121,9 @@ brcmf_fil_cmd_data(struct brcmf_if *ifp,
- else
- err = brcmf_proto_query_dcmd(drvr, ifp->ifidx, cmd, data, len);
-
-- if (err >= 0)
-- return 0;
--
-- brcmf_dbg(FIL, "Failed: %s (%d)\n",
-- brcmf_fil_get_errstr((u32)(-err)), err);
-+ if (err)
-+ brcmf_dbg(FIL, "Failed: %s (%d)\n",
-+ brcmf_fil_get_errstr((u32)(-err)), err);
-
- return err;
- }
diff --git a/package/kernel/mac80211/patches/321-v4.16-0002-brcmfmac-separate-firmware-errors-from-i-o-errors.patch b/package/kernel/mac80211/patches/321-v4.16-0002-brcmfmac-separate-firmware-errors-from-i-o-errors.patch
deleted file mode 100644
index 28e3c1a65f..0000000000
--- a/package/kernel/mac80211/patches/321-v4.16-0002-brcmfmac-separate-firmware-errors-from-i-o-errors.patch
+++ /dev/null
@@ -1,186 +0,0 @@
-From b69c1df47281ad47bd2037a42b98f5c7115b7fd5 Mon Sep 17 00:00:00 2001
-From: Arend Van Spriel <arend.vanspriel@broadcom.com>
-Date: Mon, 22 Jan 2018 21:46:40 +0100
-Subject: [PATCH] brcmfmac: separate firmware errors from i/o errors
-
-When using the firmware api it can fail simply because firmware does
-not like the request or it fails due to issues in the host interface.
-Currently, there is only a single error code which is confusing. So
-adding a parameter to pass the firmware error separately and in case
-of a firmware error always return -EBADE to user-space.
-
-Reviewed-by: Hante Meuleman <hante.meuleman@broadcom.com>
-Reviewed-by: Pieter-Paul Giesberts <pieter-paul.giesberts@broadcom.com>
-Reviewed-by: Franky Lin <franky.lin@broadcom.com>
-Signed-off-by: Arend van Spriel <arend.vanspriel@broadcom.com>
-Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
----
- drivers/net/wireless/broadcom/brcm80211/brcmfmac/bcdc.c | 11 ++++++-----
- drivers/net/wireless/broadcom/brcm80211/brcmfmac/fwil.c | 16 +++++++++++-----
- .../net/wireless/broadcom/brcm80211/brcmfmac/msgbuf.c | 10 ++++++----
- drivers/net/wireless/broadcom/brcm80211/brcmfmac/proto.h | 14 ++++++++------
- 4 files changed, 31 insertions(+), 20 deletions(-)
-
---- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/bcdc.c
-+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/bcdc.c
-@@ -165,7 +165,7 @@ static int brcmf_proto_bcdc_cmplt(struct
-
- static int
- brcmf_proto_bcdc_query_dcmd(struct brcmf_pub *drvr, int ifidx, uint cmd,
-- void *buf, uint len)
-+ void *buf, uint len, int *fwerr)
- {
- struct brcmf_bcdc *bcdc = (struct brcmf_bcdc *)drvr->proto->pd;
- struct brcmf_proto_bcdc_dcmd *msg = &bcdc->msg;
-@@ -175,6 +175,7 @@ brcmf_proto_bcdc_query_dcmd(struct brcmf
-
- brcmf_dbg(BCDC, "Enter, cmd %d len %d\n", cmd, len);
-
-+ *fwerr = 0;
- ret = brcmf_proto_bcdc_msg(drvr, ifidx, cmd, buf, len, false);
- if (ret < 0) {
- brcmf_err("brcmf_proto_bcdc_msg failed w/status %d\n",
-@@ -215,15 +216,14 @@ retry:
-
- /* Check the ERROR flag */
- if (flags & BCDC_DCMD_ERROR)
-- ret = le32_to_cpu(msg->status);
--
-+ *fwerr = le32_to_cpu(msg->status);
- done:
- return ret;
- }
-
- static int
- brcmf_proto_bcdc_set_dcmd(struct brcmf_pub *drvr, int ifidx, uint cmd,
-- void *buf, uint len)
-+ void *buf, uint len, int *fwerr)
- {
- struct brcmf_bcdc *bcdc = (struct brcmf_bcdc *)drvr->proto->pd;
- struct brcmf_proto_bcdc_dcmd *msg = &bcdc->msg;
-@@ -232,6 +232,7 @@ brcmf_proto_bcdc_set_dcmd(struct brcmf_p
-
- brcmf_dbg(BCDC, "Enter, cmd %d len %d\n", cmd, len);
-
-+ *fwerr = 0;
- ret = brcmf_proto_bcdc_msg(drvr, ifidx, cmd, buf, len, true);
- if (ret < 0)
- goto done;
-@@ -255,7 +256,7 @@ brcmf_proto_bcdc_set_dcmd(struct brcmf_p
-
- /* Check the ERROR flag */
- if (flags & BCDC_DCMD_ERROR)
-- ret = le32_to_cpu(msg->status);
-+ *fwerr = le32_to_cpu(msg->status);
-
- done:
- return ret;
---- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/fwil.c
-+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/fwil.c
-@@ -107,7 +107,7 @@ static s32
- brcmf_fil_cmd_data(struct brcmf_if *ifp, u32 cmd, void *data, u32 len, bool set)
- {
- struct brcmf_pub *drvr = ifp->drvr;
-- s32 err;
-+ s32 err, fwerr;
-
- if (drvr->bus_if->state != BRCMF_BUS_UP) {
- brcmf_err("bus is down. we have nothing to do.\n");
-@@ -117,14 +117,20 @@ brcmf_fil_cmd_data(struct brcmf_if *ifp,
- if (data != NULL)
- len = min_t(uint, len, BRCMF_DCMD_MAXLEN);
- if (set)
-- err = brcmf_proto_set_dcmd(drvr, ifp->ifidx, cmd, data, len);
-+ err = brcmf_proto_set_dcmd(drvr, ifp->ifidx, cmd,
-+ data, len, &fwerr);
- else
-- err = brcmf_proto_query_dcmd(drvr, ifp->ifidx, cmd, data, len);
-+ err = brcmf_proto_query_dcmd(drvr, ifp->ifidx, cmd,
-+ data, len, &fwerr);
-
-- if (err)
-+ if (err) {
- brcmf_dbg(FIL, "Failed: %s (%d)\n",
- brcmf_fil_get_errstr((u32)(-err)), err);
--
-+ } else if (fwerr < 0) {
-+ brcmf_dbg(FIL, "Firmware error: %s (%d)\n",
-+ brcmf_fil_get_errstr((u32)(-fwerr)), fwerr);
-+ err = -EBADE;
-+ }
- return err;
- }
-
---- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/msgbuf.c
-+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/msgbuf.c
-@@ -477,7 +477,7 @@ static void brcmf_msgbuf_ioctl_resp_wake
-
-
- static int brcmf_msgbuf_query_dcmd(struct brcmf_pub *drvr, int ifidx,
-- uint cmd, void *buf, uint len)
-+ uint cmd, void *buf, uint len, int *fwerr)
- {
- struct brcmf_msgbuf *msgbuf = (struct brcmf_msgbuf *)drvr->proto->pd;
- struct sk_buff *skb = NULL;
-@@ -485,6 +485,7 @@ static int brcmf_msgbuf_query_dcmd(struc
- int err;
-
- brcmf_dbg(MSGBUF, "ifidx=%d, cmd=%d, len=%d\n", ifidx, cmd, len);
-+ *fwerr = 0;
- msgbuf->ctl_completed = false;
- err = brcmf_msgbuf_tx_ioctl(drvr, ifidx, cmd, buf, len);
- if (err)
-@@ -508,14 +509,15 @@ static int brcmf_msgbuf_query_dcmd(struc
- }
- brcmu_pkt_buf_free_skb(skb);
-
-- return msgbuf->ioctl_resp_status;
-+ *fwerr = msgbuf->ioctl_resp_status;
-+ return 0;
- }
-
-
- static int brcmf_msgbuf_set_dcmd(struct brcmf_pub *drvr, int ifidx,
-- uint cmd, void *buf, uint len)
-+ uint cmd, void *buf, uint len, int *fwerr)
- {
-- return brcmf_msgbuf_query_dcmd(drvr, ifidx, cmd, buf, len);
-+ return brcmf_msgbuf_query_dcmd(drvr, ifidx, cmd, buf, len, fwerr);
- }
-
-
---- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/proto.h
-+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/proto.h
-@@ -30,9 +30,9 @@ struct brcmf_proto {
- int (*hdrpull)(struct brcmf_pub *drvr, bool do_fws,
- struct sk_buff *skb, struct brcmf_if **ifp);
- int (*query_dcmd)(struct brcmf_pub *drvr, int ifidx, uint cmd,
-- void *buf, uint len);
-+ void *buf, uint len, int *fwerr);
- int (*set_dcmd)(struct brcmf_pub *drvr, int ifidx, uint cmd, void *buf,
-- uint len);
-+ uint len, int *fwerr);
- int (*tx_queue_data)(struct brcmf_pub *drvr, int ifidx,
- struct sk_buff *skb);
- int (*txdata)(struct brcmf_pub *drvr, int ifidx, u8 offset,
-@@ -71,14 +71,16 @@ static inline int brcmf_proto_hdrpull(st
- return drvr->proto->hdrpull(drvr, do_fws, skb, ifp);
- }
- static inline int brcmf_proto_query_dcmd(struct brcmf_pub *drvr, int ifidx,
-- uint cmd, void *buf, uint len)
-+ uint cmd, void *buf, uint len,
-+ int *fwerr)
- {
-- return drvr->proto->query_dcmd(drvr, ifidx, cmd, buf, len);
-+ return drvr->proto->query_dcmd(drvr, ifidx, cmd, buf, len,fwerr);
- }
- static inline int brcmf_proto_set_dcmd(struct brcmf_pub *drvr, int ifidx,
-- uint cmd, void *buf, uint len)
-+ uint cmd, void *buf, uint len,
-+ int *fwerr)
- {
-- return drvr->proto->set_dcmd(drvr, ifidx, cmd, buf, len);
-+ return drvr->proto->set_dcmd(drvr, ifidx, cmd, buf, len, fwerr);
- }
-
- static inline int brcmf_proto_tx_queue_data(struct brcmf_pub *drvr, int ifidx,
diff --git a/package/kernel/mac80211/patches/322-v4.16-0001-brcmfmac-add-possibility-to-obtain-firmware-error.patch b/package/kernel/mac80211/patches/322-v4.16-0001-brcmfmac-add-possibility-to-obtain-firmware-error.patch
deleted file mode 100644
index e6486160fc..0000000000
--- a/package/kernel/mac80211/patches/322-v4.16-0001-brcmfmac-add-possibility-to-obtain-firmware-error.patch
+++ /dev/null
@@ -1,92 +0,0 @@
-From 933897342d0714ae1c10729cbaeecea0c6178db5 Mon Sep 17 00:00:00 2001
-From: Arend Van Spriel <arend.vanspriel@broadcom.com>
-Date: Wed, 28 Feb 2018 21:15:19 +0100
-Subject: [PATCH] brcmfmac: add possibility to obtain firmware error
-
-The feature module needs to evaluate the actual firmware error return
-upon a control command. This adds a flag to struct brcmf_if that the
-caller can set. This flag is checked to determine the error code that
-needs to be returned.
-
-Fixes: b69c1df47281 ("brcmfmac: separate firmware errors from i/o errors")
-Reviewed-by: Hante Meuleman <hante.meuleman@broadcom.com>
-Reviewed-by: Pieter-Paul Giesberts <pieter-paul.giesberts@broadcom.com>
-Reviewed-by: Franky Lin <franky.lin@broadcom.com>
-Signed-off-by: Arend van Spriel <arend.vanspriel@broadcom.com>
-Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
----
- drivers/net/wireless/broadcom/brcm80211/brcmfmac/core.h | 2 ++
- drivers/net/wireless/broadcom/brcm80211/brcmfmac/feature.c | 10 ++++++++++
- drivers/net/wireless/broadcom/brcm80211/brcmfmac/fwil.c | 3 +++
- 3 files changed, 15 insertions(+)
-
---- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/core.h
-+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/core.h
-@@ -181,6 +181,7 @@ enum brcmf_netif_stop_reason {
- * @netif_stop_lock: spinlock for update netif_stop from multiple sources.
- * @pend_8021x_cnt: tracks outstanding number of 802.1x frames.
- * @pend_8021x_wait: used for signalling change in count.
-+ * @fwil_fwerr: flag indicating fwil layer should return firmware error codes.
- */
- struct brcmf_if {
- struct brcmf_pub *drvr;
-@@ -198,6 +199,7 @@ struct brcmf_if {
- wait_queue_head_t pend_8021x_wait;
- struct in6_addr ipv6_addr_tbl[NDOL_MAX_ENTRIES];
- u8 ipv6addr_idx;
-+ bool fwil_fwerr;
- };
-
- int brcmf_netdev_wait_pend8021x(struct brcmf_if *ifp);
---- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/feature.c
-+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/feature.c
-@@ -104,6 +104,9 @@ static void brcmf_feat_iovar_int_get(str
- u32 data;
- int err;
-
-+ /* we need to know firmware error */
-+ ifp->fwil_fwerr = true;
-+
- err = brcmf_fil_iovar_int_get(ifp, name, &data);
- if (err == 0) {
- brcmf_dbg(INFO, "enabling feature: %s\n", brcmf_feat_names[id]);
-@@ -112,6 +115,8 @@ static void brcmf_feat_iovar_int_get(str
- brcmf_dbg(TRACE, "%s feature check failed: %d\n",
- brcmf_feat_names[id], err);
- }
-+
-+ ifp->fwil_fwerr = false;
- }
-
- static void brcmf_feat_iovar_data_set(struct brcmf_if *ifp,
-@@ -120,6 +125,9 @@ static void brcmf_feat_iovar_data_set(st
- {
- int err;
-
-+ /* we need to know firmware error */
-+ ifp->fwil_fwerr = true;
-+
- err = brcmf_fil_iovar_data_set(ifp, name, data, len);
- if (err != -BRCMF_FW_UNSUPPORTED) {
- brcmf_dbg(INFO, "enabling feature: %s\n", brcmf_feat_names[id]);
-@@ -128,6 +136,8 @@ static void brcmf_feat_iovar_data_set(st
- brcmf_dbg(TRACE, "%s feature check failed: %d\n",
- brcmf_feat_names[id], err);
- }
-+
-+ ifp->fwil_fwerr = false;
- }
-
- #define MAX_CAPS_BUFFER_SIZE 512
---- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/fwil.c
-+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/fwil.c
-@@ -131,6 +131,9 @@ brcmf_fil_cmd_data(struct brcmf_if *ifp,
- brcmf_fil_get_errstr((u32)(-fwerr)), fwerr);
- err = -EBADE;
- }
-+ if (ifp->fwil_fwerr)
-+ return fwerr;
-+
- return err;
- }
-
diff --git a/package/kernel/mac80211/patches/322-v4.16-0002-brcmfmac-fix-P2P_DEVICE-ethernet-address-generation.patch b/package/kernel/mac80211/patches/322-v4.16-0002-brcmfmac-fix-P2P_DEVICE-ethernet-address-generation.patch
deleted file mode 100644
index 20e16ad23f..0000000000
--- a/package/kernel/mac80211/patches/322-v4.16-0002-brcmfmac-fix-P2P_DEVICE-ethernet-address-generation.patch
+++ /dev/null
@@ -1,64 +0,0 @@
-From 455f3e76cfc0d893585a5f358b9ddbe9c1e1e53b Mon Sep 17 00:00:00 2001
-From: Arend Van Spriel <arend.vanspriel@broadcom.com>
-Date: Wed, 28 Feb 2018 21:15:20 +0100
-Subject: [PATCH] brcmfmac: fix P2P_DEVICE ethernet address generation
-
-The firmware has a requirement that the P2P_DEVICE address should
-be different from the address of the primary interface. When not
-specified by user-space, the driver generates the MAC address for
-the P2P_DEVICE interface using the MAC address of the primary
-interface and setting the locally administered bit. However, the MAC
-address of the primary interface may already have that bit set causing
-the creation of the P2P_DEVICE interface to fail with -EBUSY. Fix this
-by using a random address instead to determine the P2P_DEVICE address.
-
-Cc: stable@vger.kernel.org # 3.10.y
-Reported-by: Hans de Goede <hdegoede@redhat.com>
-Reviewed-by: Hante Meuleman <hante.meuleman@broadcom.com>
-Reviewed-by: Pieter-Paul Giesberts <pieter-paul.giesberts@broadcom.com>
-Reviewed-by: Franky Lin <franky.lin@broadcom.com>
-Signed-off-by: Arend van Spriel <arend.vanspriel@broadcom.com>
-Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
----
- .../net/wireless/broadcom/brcm80211/brcmfmac/p2p.c | 24 ++++++++++------------
- 1 file changed, 11 insertions(+), 13 deletions(-)
-
---- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/p2p.c
-+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/p2p.c
-@@ -462,25 +462,23 @@ static int brcmf_p2p_set_firmware(struct
- * @dev_addr: optional device address.
- *
- * P2P needs mac addresses for P2P device and interface. If no device
-- * address it specified, these are derived from the primary net device, ie.
-- * the permanent ethernet address of the device.
-+ * address it specified, these are derived from a random ethernet
-+ * address.
- */
- static void brcmf_p2p_generate_bss_mac(struct brcmf_p2p_info *p2p, u8 *dev_addr)
- {
-- struct brcmf_if *pri_ifp = p2p->bss_idx[P2PAPI_BSSCFG_PRIMARY].vif->ifp;
-- bool local_admin = false;
-+ bool random_addr = false;
-
-- if (!dev_addr || is_zero_ether_addr(dev_addr)) {
-- dev_addr = pri_ifp->mac_addr;
-- local_admin = true;
-- }
-+ if (!dev_addr || is_zero_ether_addr(dev_addr))
-+ random_addr = true;
-
-- /* Generate the P2P Device Address. This consists of the device's
-- * primary MAC address with the locally administered bit set.
-+ /* Generate the P2P Device Address obtaining a random ethernet
-+ * address with the locally administered bit set.
- */
-- memcpy(p2p->dev_addr, dev_addr, ETH_ALEN);
-- if (local_admin)
-- p2p->dev_addr[0] |= 0x02;
-+ if (random_addr)
-+ eth_random_addr(p2p->dev_addr);
-+ else
-+ memcpy(p2p->dev_addr, dev_addr, ETH_ALEN);
-
- /* Generate the P2P Interface Address. If the discovery and connection
- * BSSCFGs need to simultaneously co-exist, then this address must be
diff --git a/package/kernel/mac80211/patches/323-v4.16-0001-brcmfmac-drop-Inter-Access-Point-Protocol-packets-by.patch b/package/kernel/mac80211/patches/323-v4.16-0001-brcmfmac-drop-Inter-Access-Point-Protocol-packets-by.patch
deleted file mode 100644
index f25dea01d2..0000000000
--- a/package/kernel/mac80211/patches/323-v4.16-0001-brcmfmac-drop-Inter-Access-Point-Protocol-packets-by.patch
+++ /dev/null
@@ -1,157 +0,0 @@
-From 1259055170287a350cad453e9eac139c81609860 Mon Sep 17 00:00:00 2001
-From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= <rafal@milecki.pl>
-Date: Thu, 15 Mar 2018 08:29:09 +0100
-Subject: [PATCH] brcmfmac: drop Inter-Access Point Protocol packets by default
-MIME-Version: 1.0
-Content-Type: text/plain; charset=UTF-8
-Content-Transfer-Encoding: 8bit
-
-Testing brcmfmac with more recent firmwares resulted in AP interfaces
-not working in some specific setups. Debugging resulted in discovering
-support for IAPP in Broadcom's firmwares.
-
-Older firmwares were only generating 802.11f frames. Newer ones like:
-1) 10.10 (TOB) (r663589)
-2) 10.10.122.20 (r683106)
-for 4366b1 and 4366c0 respectively seem to also /respect/ 802.11f frames
-in the Tx path by performing a STA disassociation.
-
-This obsoleted standard and its implementation is something that:
-1) Most people don't need / want to use
-2) Can allow local DoS attacks
-3) Breaks AP interfaces in some specific bridge setups
-
-To solve issues it can cause this commit modifies brcmfmac to drop IAPP
-packets. If affects:
-1) Rx path: driver won't be sending these unwanted packets up.
-2) Tx path: driver will reject packets that would trigger STA
- disassociation perfromed by a firmware (possible local DoS attack).
-
-It appears there are some Broadcom's clients/users who care about this
-feature despite the drawbacks. They can switch it on using a new module
-param.
-
-This change results in only two more comparisons (check for module param
-and check for Ethernet packet length) for 99.9% of packets. Its overhead
-should be very minimal.
-
-Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
-Acked-by: Arend van Spriel <arend.vanspriel@broadcom.com>
-Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
----
- .../wireless/broadcom/brcm80211/brcmfmac/common.c | 5 ++
- .../wireless/broadcom/brcm80211/brcmfmac/common.h | 1 +
- .../wireless/broadcom/brcm80211/brcmfmac/core.c | 57 ++++++++++++++++++++++
- 3 files changed, 63 insertions(+)
-
---- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/common.c
-+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/common.c
-@@ -75,6 +75,10 @@ static int brcmf_roamoff;
- module_param_named(roamoff, brcmf_roamoff, int, S_IRUSR);
- MODULE_PARM_DESC(roamoff, "Do not use internal roaming engine");
-
-+static int brcmf_iapp_enable;
-+module_param_named(iapp, brcmf_iapp_enable, int, 0);
-+MODULE_PARM_DESC(iapp, "Enable partial support for the obsoleted Inter-Access Point Protocol");
-+
- #ifdef DEBUG
- /* always succeed brcmf_bus_started() */
- static int brcmf_ignore_probe_fail;
-@@ -441,6 +445,7 @@ struct brcmf_mp_device *brcmf_get_module
- settings->feature_disable = brcmf_feature_disable;
- settings->fcmode = brcmf_fcmode;
- settings->roamoff = !!brcmf_roamoff;
-+ settings->iapp = !!brcmf_iapp_enable;
- #ifdef DEBUG
- settings->ignore_probe_fail = !!brcmf_ignore_probe_fail;
- #endif
---- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/common.h
-+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/common.h
-@@ -58,6 +58,7 @@ struct brcmf_mp_device {
- unsigned int feature_disable;
- int fcmode;
- bool roamoff;
-+ bool iapp;
- bool ignore_probe_fail;
- struct brcmfmac_pd_cc *country_codes;
- union {
---- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/core.c
-+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/core.c
-@@ -230,6 +230,37 @@ static void brcmf_netdev_set_multicast_l
- schedule_work(&ifp->multicast_work);
- }
-
-+/**
-+ * brcmf_skb_is_iapp - checks if skb is an IAPP packet
-+ *
-+ * @skb: skb to check
-+ */
-+static bool brcmf_skb_is_iapp(struct sk_buff *skb)
-+{
-+ static const u8 iapp_l2_update_packet[6] __aligned(2) = {
-+ 0x00, 0x01, 0xaf, 0x81, 0x01, 0x00,
-+ };
-+ unsigned char *eth_data;
-+#if !defined(CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS)
-+ const u16 *a, *b;
-+#endif
-+
-+ if (skb->len - skb->mac_len != 6 ||
-+ !is_multicast_ether_addr(eth_hdr(skb)->h_dest))
-+ return false;
-+
-+ eth_data = skb_mac_header(skb) + ETH_HLEN;
-+#if defined(CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS)
-+ return !(((*(const u32 *)eth_data) ^ (*(const u32 *)iapp_l2_update_packet)) |
-+ ((*(const u16 *)(eth_data + 4)) ^ (*(const u16 *)(iapp_l2_update_packet + 4))));
-+#else
-+ a = (const u16 *)eth_data;
-+ b = (const u16 *)iapp_l2_update_packet;
-+
-+ return !((a[0] ^ b[0]) | (a[1] ^ b[1]) | (a[2] ^ b[2]));
-+#endif
-+}
-+
- static netdev_tx_t brcmf_netdev_start_xmit(struct sk_buff *skb,
- struct net_device *ndev)
- {
-@@ -250,6 +281,23 @@ static netdev_tx_t brcmf_netdev_start_xm
- goto done;
- }
-
-+ /* Some recent Broadcom's firmwares disassociate STA when they receive
-+ * an 802.11f ADD frame. This behavior can lead to a local DoS security
-+ * issue. Attacker may trigger disassociation of any STA by sending a
-+ * proper Ethernet frame to the wireless interface.
-+ *
-+ * Moreover this feature may break AP interfaces in some specific
-+ * setups. This applies e.g. to the bridge with hairpin mode enabled and
-+ * IFLA_BRPORT_MCAST_TO_UCAST set. IAPP packet generated by a firmware
-+ * will get passed back to the wireless interface and cause immediate
-+ * disassociation of a just-connected STA.
-+ */
-+ if (!drvr->settings->iapp && brcmf_skb_is_iapp(skb)) {
-+ dev_kfree_skb(skb);
-+ ret = -EINVAL;
-+ goto done;
-+ }
-+
- /* Make sure there's enough writeable headroom */
- if (skb_headroom(skb) < drvr->hdrlen || skb_header_cloned(skb)) {
- head_delta = max_t(int, drvr->hdrlen - skb_headroom(skb), 0);
-@@ -325,6 +373,15 @@ void brcmf_txflowblock_if(struct brcmf_i
-
- void brcmf_netif_rx(struct brcmf_if *ifp, struct sk_buff *skb)
- {
-+ /* Most of Broadcom's firmwares send 802.11f ADD frame every time a new
-+ * STA connects to the AP interface. This is an obsoleted standard most
-+ * users don't use, so don't pass these frames up unless requested.
-+ */
-+ if (!ifp->drvr->settings->iapp && brcmf_skb_is_iapp(skb)) {
-+ brcmu_pkt_buf_free_skb(skb);
-+ return;
-+ }
-+
- if (skb->pkt_type == PACKET_MULTICAST)
- ifp->ndev->stats.multicast++;
-
diff --git a/package/kernel/mac80211/patches/324-v4.16-0001-brcmfmac-Fix-check-for-ISO3166-code.patch b/package/kernel/mac80211/patches/324-v4.16-0001-brcmfmac-Fix-check-for-ISO3166-code.patch
deleted file mode 100644
index d45f64ff23..0000000000
--- a/package/kernel/mac80211/patches/324-v4.16-0001-brcmfmac-Fix-check-for-ISO3166-code.patch
+++ /dev/null
@@ -1,29 +0,0 @@
-From 9b9322db5c5a1917a66c71fe47c3848a9a31227e Mon Sep 17 00:00:00 2001
-From: Stefan Wahren <stefan.wahren@i2se.com>
-Date: Wed, 14 Mar 2018 20:02:59 +0100
-Subject: [PATCH] brcmfmac: Fix check for ISO3166 code
-
-The commit "regulatory: add NUL to request alpha2" increases the length of
-alpha2 to 3. This causes a regression on brcmfmac, because
-brcmf_cfg80211_reg_notifier() expect valid ISO3166 codes in the complete
-array. So fix this accordingly.
-
-Fixes: 657308f73e67 ("regulatory: add NUL to request alpha2")
-Signed-off-by: Stefan Wahren <stefan.wahren@i2se.com>
-Acked-by: Franky Lin <franky.lin@broadcom.com>
-Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
----
- drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
---- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c
-+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c
-@@ -6803,7 +6803,7 @@ static void brcmf_cfg80211_reg_notifier(
- return;
-
- /* ignore non-ISO3166 country codes */
-- for (i = 0; i < sizeof(req->alpha2); i++)
-+ for (i = 0; i < 2; i++)
- if (req->alpha2[i] < 'A' || req->alpha2[i] > 'Z') {
- brcmf_err("not an ISO3166 code (0x%02x 0x%02x)\n",
- req->alpha2[0], req->alpha2[1]);
diff --git a/package/kernel/mac80211/patches/325-v4.17-0001-brcmfmac-move-brcmf_bus_preinit-call-just-after-chan.patch b/package/kernel/mac80211/patches/325-v4.17-0001-brcmfmac-move-brcmf_bus_preinit-call-just-after-chan.patch
deleted file mode 100644
index f4d9a84b25..0000000000
--- a/package/kernel/mac80211/patches/325-v4.17-0001-brcmfmac-move-brcmf_bus_preinit-call-just-after-chan.patch
+++ /dev/null
@@ -1,45 +0,0 @@
-From da472385a29f1fddcac7cfa0499482704310bd16 Mon Sep 17 00:00:00 2001
-From: Arend Van Spriel <arend.vanspriel@broadcom.com>
-Date: Tue, 20 Feb 2018 00:14:18 +0100
-Subject: [PATCH] brcmfmac: move brcmf_bus_preinit() call just after changing
- bus state
-
-Moving the brcmf_bus_preinit() call allows the bus code to do some
-required initialization before handling firmware control messages.
-
-Reviewed-by: Hante Meuleman <hante.meuleman@broadcom.com>
-Reviewed-by: Pieter-Paul Giesberts <pieter-paul.giesberts@broadcom.com>
-Reviewed-by: Franky Lin <franky.lin@broadcom.com>
-Signed-off-by: Arend van Spriel <arend.vanspriel@broadcom.com>
-Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
----
- drivers/net/wireless/broadcom/brcm80211/brcmfmac/common.c | 3 ---
- drivers/net/wireless/broadcom/brcm80211/brcmfmac/core.c | 5 +++++
- 2 files changed, 5 insertions(+), 3 deletions(-)
-
---- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/common.c
-+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/common.c
-@@ -369,9 +369,6 @@ int brcmf_c_preinit_dcmds(struct brcmf_i
-
- /* Enable tx beamforming, errors can be ignored (not supported) */
- (void)brcmf_fil_iovar_int_set(ifp, "txbf", 1);
--
-- /* do bus specific preinit here */
-- err = brcmf_bus_preinit(ifp->drvr->bus_if);
- done:
- return err;
- }
---- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/core.c
-+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/core.c
-@@ -1091,6 +1091,11 @@ int brcmf_bus_started(struct device *dev
- /* signal bus ready */
- brcmf_bus_change_state(bus_if, BRCMF_BUS_UP);
-
-+ /* do bus specific preinit here */
-+ ret = brcmf_bus_preinit(ifp->drvr->bus_if);
-+ if (ret < 0)
-+ goto fail;
-+
- /* Bus is ready, do any initialization */
- ret = brcmf_c_preinit_dcmds(ifp);
- if (ret < 0)
diff --git a/package/kernel/mac80211/patches/325-v4.17-0002-brcmfmac-move-allocation-of-control-rx-buffer-to-brc.patch b/package/kernel/mac80211/patches/325-v4.17-0002-brcmfmac-move-allocation-of-control-rx-buffer-to-brc.patch
deleted file mode 100644
index 230e891cea..0000000000
--- a/package/kernel/mac80211/patches/325-v4.17-0002-brcmfmac-move-allocation-of-control-rx-buffer-to-brc.patch
+++ /dev/null
@@ -1,69 +0,0 @@
-From 4b5adc736828dc25ca33e263ad8c0b9dcd3bf325 Mon Sep 17 00:00:00 2001
-From: Arend Van Spriel <arend.vanspriel@broadcom.com>
-Date: Tue, 20 Feb 2018 00:14:19 +0100
-Subject: [PATCH] brcmfmac: move allocation of control rx buffer to
- brcmf_sdio_bus_preinit()
-
-Allocate the control rx buffer needed for firmware control interface
-during brcmf_sdio_bus_preinit(). This relies on common layer setting
-struct brcmf_bus::maxctl during brcmf_attach(). By moving the allocation
-we can move brcmf_attach() in subsequent change.
-
-Reviewed-by: Hante Meuleman <hante.meuleman@broadcom.com>
-Reviewed-by: Pieter-Paul Giesberts <pieter-paul.giesberts@broadcom.com>
-Reviewed-by: Franky Lin <franky.lin@broadcom.com>
-Signed-off-by: Arend van Spriel <arend.vanspriel@broadcom.com>
-Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
----
- .../wireless/broadcom/brcm80211/brcmfmac/sdio.c | 26 ++++++++++------------
- 1 file changed, 12 insertions(+), 14 deletions(-)
-
---- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c
-+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c
-@@ -1707,7 +1707,6 @@ brcmf_sdio_read_control(struct brcmf_sdi
- int sdret;
-
- brcmf_dbg(TRACE, "Enter\n");
--
- if (bus->rxblen)
- buf = vzalloc(bus->rxblen);
- if (!buf)
-@@ -3411,6 +3410,18 @@ static int brcmf_sdio_bus_preinit(struct
- u32 value;
- int err;
-
-+ /* maxctl provided by common layer */
-+ if (WARN_ON(!bus_if->maxctl))
-+ return -EINVAL;
-+
-+ /* Allocate control receive buffer */
-+ bus_if->maxctl += bus->roundup;
-+ value = roundup((bus_if->maxctl + SDPCM_HDRLEN), ALIGNMENT);
-+ value += bus->head_align;
-+ bus->rxbuf = kmalloc(value, GFP_ATOMIC);
-+ if (bus->rxbuf)
-+ bus->rxblen = value;
-+
- /* the commands below use the terms tx and rx from
- * a device perspective, ie. bus:txglom affects the
- * bus transfers from device to host.
-@@ -4209,19 +4220,6 @@ struct brcmf_sdio *brcmf_sdio_probe(stru
- bus->blocksize = bus->sdiodev->func2->cur_blksize;
- bus->roundup = min(max_roundup, bus->blocksize);
-
-- /* Allocate buffers */
-- if (bus->sdiodev->bus_if->maxctl) {
-- bus->sdiodev->bus_if->maxctl += bus->roundup;
-- bus->rxblen =
-- roundup((bus->sdiodev->bus_if->maxctl + SDPCM_HDRLEN),
-- ALIGNMENT) + bus->head_align;
-- bus->rxbuf = kmalloc(bus->rxblen, GFP_ATOMIC);
-- if (!(bus->rxbuf)) {
-- brcmf_err("rxbuf allocation failed\n");
-- goto fail;
-- }
-- }
--
- sdio_claim_host(bus->sdiodev->func1);
-
- /* Disable F2 to clear any intermediate frame state on the dongle */
diff --git a/package/kernel/mac80211/patches/325-v4.17-0003-brcmfmac-call-brcmf_attach-just-before-calling-brcmf.patch b/package/kernel/mac80211/patches/325-v4.17-0003-brcmfmac-call-brcmf_attach-just-before-calling-brcmf.patch
deleted file mode 100644
index a8b0171cb3..0000000000
--- a/package/kernel/mac80211/patches/325-v4.17-0003-brcmfmac-call-brcmf_attach-just-before-calling-brcmf.patch
+++ /dev/null
@@ -1,106 +0,0 @@
-From 262f2b53f67936b59cc8dfc6f3899ab8905bf1ed Mon Sep 17 00:00:00 2001
-From: Arend Van Spriel <arend.vanspriel@broadcom.com>
-Date: Tue, 20 Feb 2018 00:14:20 +0100
-Subject: [PATCH] brcmfmac: call brcmf_attach() just before calling
- brcmf_bus_started()
-
-Now we can move brcmf_attach() until after the firmware has been downloaded
-to the device. Make the call just before brcmf_bus_started().
-
-Reviewed-by: Hante Meuleman <hante.meuleman@broadcom.com>
-Reviewed-by: Pieter-Paul Giesberts <pieter-paul.giesberts@broadcom.com>
-Reviewed-by: Franky Lin <franky.lin@broadcom.com>
-Signed-off-by: Arend van Spriel <arend.vanspriel@broadcom.com>
-Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
----
- .../wireless/broadcom/brcm80211/brcmfmac/core.c | 6 ++++
- .../wireless/broadcom/brcm80211/brcmfmac/sdio.c | 34 +++++++++++-----------
- 2 files changed, 23 insertions(+), 17 deletions(-)
-
---- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/core.c
-+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/core.c
-@@ -1268,6 +1268,12 @@ void brcmf_bus_change_state(struct brcmf
- int ifidx;
-
- brcmf_dbg(TRACE, "%d -> %d\n", bus->state, state);
-+
-+ if (!drvr) {
-+ brcmf_dbg(INFO, "ignoring transition, bus not attached yet\n");
-+ return;
-+ }
-+
- bus->state = state;
-
- if (state == BRCMF_BUS_UP) {
---- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c
-+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c
-@@ -4048,9 +4048,6 @@ static void brcmf_sdio_firmware_callback
- if (err)
- goto fail;
-
-- if (!bus_if->drvr)
-- return;
--
- /* try to download image and nvram to the dongle */
- bus->alp_only = true;
- err = brcmf_sdio_download_firmware(bus, code, nvram, nvram_len);
-@@ -4126,11 +4123,28 @@ static void brcmf_sdio_firmware_callback
-
- sdio_release_host(sdiodev->func1);
-
-+ /* Assign bus interface call back */
-+ sdiodev->bus_if->dev = sdiodev->dev;
-+ sdiodev->bus_if->ops = &brcmf_sdio_bus_ops;
-+ sdiodev->bus_if->chip = bus->ci->chip;
-+ sdiodev->bus_if->chiprev = bus->ci->chiprev;
-+
-+ /* Attach to the common layer, reserve hdr space */
-+ err = brcmf_attach(sdiodev->dev, sdiodev->settings);
-+ if (err != 0) {
-+ brcmf_err("brcmf_attach failed\n");
-+ goto fail;
-+ }
-+
-+ brcmf_sdio_debugfs_create(bus);
-+
- err = brcmf_bus_started(dev);
- if (err != 0) {
- brcmf_err("dongle is not responding\n");
- goto fail;
- }
-+
-+ /* ready */
- return;
-
- release:
-@@ -4200,22 +4214,9 @@ struct brcmf_sdio *brcmf_sdio_probe(stru
- bus->dpc_triggered = false;
- bus->dpc_running = false;
-
-- /* Assign bus interface call back */
-- bus->sdiodev->bus_if->dev = bus->sdiodev->dev;
-- bus->sdiodev->bus_if->ops = &brcmf_sdio_bus_ops;
-- bus->sdiodev->bus_if->chip = bus->ci->chip;
-- bus->sdiodev->bus_if->chiprev = bus->ci->chiprev;
--
- /* default sdio bus header length for tx packet */
- bus->tx_hdrlen = SDPCM_HWHDR_LEN + SDPCM_SWHDR_LEN;
-
-- /* Attach to the common layer, reserve hdr space */
-- ret = brcmf_attach(bus->sdiodev->dev, bus->sdiodev->settings);
-- if (ret != 0) {
-- brcmf_err("brcmf_attach failed\n");
-- goto fail;
-- }
--
- /* Query the F2 block size, set roundup accordingly */
- bus->blocksize = bus->sdiodev->func2->cur_blksize;
- bus->roundup = min(max_roundup, bus->blocksize);
-@@ -4240,7 +4241,6 @@ struct brcmf_sdio *brcmf_sdio_probe(stru
- /* SR state */
- bus->sr_enabled = false;
-
-- brcmf_sdio_debugfs_create(bus);
- brcmf_dbg(INFO, "completed!!\n");
-
- ret = brcmf_fw_map_chip_to_name(bus->ci->chip, bus->ci->chiprev,
diff --git a/package/kernel/mac80211/patches/325-v4.17-0004-brcmfmac-usb-call-brcmf_usb_up-during-brcmf_bus_prei.patch b/package/kernel/mac80211/patches/325-v4.17-0004-brcmfmac-usb-call-brcmf_usb_up-during-brcmf_bus_prei.patch
deleted file mode 100644
index 00c4141cc5..0000000000
--- a/package/kernel/mac80211/patches/325-v4.17-0004-brcmfmac-usb-call-brcmf_usb_up-during-brcmf_bus_prei.patch
+++ /dev/null
@@ -1,41 +0,0 @@
-From a7f4a80c0070b673d4a4ce94b99979ea6d0c6296 Mon Sep 17 00:00:00 2001
-From: Arend Van Spriel <arend.vanspriel@broadcom.com>
-Date: Tue, 20 Feb 2018 00:14:21 +0100
-Subject: [PATCH] brcmfmac: usb: call brcmf_usb_up() during brcmf_bus_preinit()
-
-By calling brcmf_usb_up() during brcmf_bus_preinit() it does not need
-to be called in brcmf_usb_bus_setup().
-
-Reviewed-by: Hante Meuleman <hante.meuleman@broadcom.com>
-Reviewed-by: Pieter-Paul Giesberts <pieter-paul.giesberts@broadcom.com>
-Reviewed-by: Franky Lin <franky.lin@broadcom.com>
-Signed-off-by: Arend van Spriel <arend.vanspriel@broadcom.com>
-Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
----
- drivers/net/wireless/broadcom/brcm80211/brcmfmac/usb.c | 7 ++-----
- 1 file changed, 2 insertions(+), 5 deletions(-)
-
---- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/usb.c
-+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/usb.c
-@@ -1146,8 +1146,9 @@ static int brcmf_usb_get_fwname(struct d
- }
-
- static const struct brcmf_bus_ops brcmf_usb_bus_ops = {
-- .txdata = brcmf_usb_tx,
-+ .preinit = brcmf_usb_up,
- .stop = brcmf_usb_down,
-+ .txdata = brcmf_usb_tx,
- .txctl = brcmf_usb_tx_ctlpkt,
- .rxctl = brcmf_usb_rx_ctlpkt,
- .wowl_config = brcmf_usb_wowl_config,
-@@ -1165,10 +1166,6 @@ static int brcmf_usb_bus_setup(struct br
- return ret;
- }
-
-- ret = brcmf_usb_up(devinfo->dev);
-- if (ret)
-- goto fail;
--
- ret = brcmf_bus_started(devinfo->dev);
- if (ret)
- goto fail;
diff --git a/package/kernel/mac80211/patches/325-v4.17-0005-brcmfmac-move-brcmf_attach-function-in-core.c.patch b/package/kernel/mac80211/patches/325-v4.17-0005-brcmfmac-move-brcmf_attach-function-in-core.c.patch
deleted file mode 100644
index 086b5fadcc..0000000000
--- a/package/kernel/mac80211/patches/325-v4.17-0005-brcmfmac-move-brcmf_attach-function-in-core.c.patch
+++ /dev/null
@@ -1,130 +0,0 @@
-From 0542503c4c164c65cd1567b0f2b3f887af6c81eb Mon Sep 17 00:00:00 2001
-From: Arend Van Spriel <arend.vanspriel@broadcom.com>
-Date: Tue, 20 Feb 2018 00:14:22 +0100
-Subject: [PATCH] brcmfmac: move brcmf_attach() function in core.c
-
-Moving the function in preparation of subsequent patch.
-
-Reviewed-by: Hante Meuleman <hante.meuleman@broadcom.com>
-Reviewed-by: Pieter-Paul Giesberts <pieter-paul.giesberts@broadcom.com>
-Reviewed-by: Franky Lin <franky.lin@broadcom.com>
-Signed-off-by: Arend van Spriel <arend.vanspriel@broadcom.com>
-Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
----
- .../wireless/broadcom/brcm80211/brcmfmac/core.c | 98 +++++++++++-----------
- 1 file changed, 49 insertions(+), 49 deletions(-)
-
---- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/core.c
-+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/core.c
-@@ -992,55 +992,6 @@ static int brcmf_inet6addr_changed(struc
- }
- #endif
-
--int brcmf_attach(struct device *dev, struct brcmf_mp_device *settings)
--{
-- struct brcmf_pub *drvr = NULL;
-- int ret = 0;
-- int i;
--
-- brcmf_dbg(TRACE, "Enter\n");
--
-- /* Allocate primary brcmf_info */
-- drvr = kzalloc(sizeof(struct brcmf_pub), GFP_ATOMIC);
-- if (!drvr)
-- return -ENOMEM;
--
-- for (i = 0; i < ARRAY_SIZE(drvr->if2bss); i++)
-- drvr->if2bss[i] = BRCMF_BSSIDX_INVALID;
--
-- mutex_init(&drvr->proto_block);
--
-- /* Link to bus module */
-- drvr->hdrlen = 0;
-- drvr->bus_if = dev_get_drvdata(dev);
-- drvr->bus_if->drvr = drvr;
-- drvr->settings = settings;
--
-- /* attach debug facilities */
-- brcmf_debug_attach(drvr);
--
-- /* Attach and link in the protocol */
-- ret = brcmf_proto_attach(drvr);
-- if (ret != 0) {
-- brcmf_err("brcmf_prot_attach failed\n");
-- goto fail;
-- }
--
-- /* Attach to events important for core code */
-- brcmf_fweh_register(drvr, BRCMF_E_PSM_WATCHDOG,
-- brcmf_psm_watchdog_notify);
--
-- /* attach firmware event handler */
-- brcmf_fweh_attach(drvr);
--
-- return ret;
--
--fail:
-- brcmf_detach(dev);
--
-- return ret;
--}
--
- static int brcmf_revinfo_read(struct seq_file *s, void *data)
- {
- struct brcmf_bus *bus_if = dev_get_drvdata(s->private);
-@@ -1170,6 +1121,55 @@ fail:
-
- return ret;
- }
-+
-+int brcmf_attach(struct device *dev, struct brcmf_mp_device *settings)
-+{
-+ struct brcmf_pub *drvr = NULL;
-+ int ret = 0;
-+ int i;
-+
-+ brcmf_dbg(TRACE, "Enter\n");
-+
-+ /* Allocate primary brcmf_info */
-+ drvr = kzalloc(sizeof(*drvr), GFP_ATOMIC);
-+ if (!drvr)
-+ return -ENOMEM;
-+
-+ for (i = 0; i < ARRAY_SIZE(drvr->if2bss); i++)
-+ drvr->if2bss[i] = BRCMF_BSSIDX_INVALID;
-+
-+ mutex_init(&drvr->proto_block);
-+
-+ /* Link to bus module */
-+ drvr->hdrlen = 0;
-+ drvr->bus_if = dev_get_drvdata(dev);
-+ drvr->bus_if->drvr = drvr;
-+ drvr->settings = settings;
-+
-+ /* attach debug facilities */
-+ brcmf_debug_attach(drvr);
-+
-+ /* Attach and link in the protocol */
-+ ret = brcmf_proto_attach(drvr);
-+ if (ret != 0) {
-+ brcmf_err("brcmf_prot_attach failed\n");
-+ goto fail;
-+ }
-+
-+ /* Attach to events important for core code */
-+ brcmf_fweh_register(drvr, BRCMF_E_PSM_WATCHDOG,
-+ brcmf_psm_watchdog_notify);
-+
-+ /* attach firmware event handler */
-+ brcmf_fweh_attach(drvr);
-+
-+ return ret;
-+
-+fail:
-+ brcmf_detach(dev);
-+
-+ return ret;
-+}
-
- void brcmf_bus_add_txhdrlen(struct device *dev, uint len)
- {
diff --git a/package/kernel/mac80211/patches/325-v4.17-0006-brcmfmac-remove-brcmf_bus_started-from-bus-api.patch b/package/kernel/mac80211/patches/325-v4.17-0006-brcmfmac-remove-brcmf_bus_started-from-bus-api.patch
deleted file mode 100644
index 6d23ccdac2..0000000000
--- a/package/kernel/mac80211/patches/325-v4.17-0006-brcmfmac-remove-brcmf_bus_started-from-bus-api.patch
+++ /dev/null
@@ -1,190 +0,0 @@
-From de2a3027f6f15e2f6558dc4d178282ccc1f054db Mon Sep 17 00:00:00 2001
-From: Arend Van Spriel <arend.vanspriel@broadcom.com>
-Date: Tue, 20 Feb 2018 00:14:23 +0100
-Subject: [PATCH] brcmfmac: remove brcmf_bus_started() from bus api
-
-No longer needed to call this in bus layer so make it static and call
-it in the last phase of brcmf_attach() instead.
-
-Reviewed-by: Hante Meuleman <hante.meuleman@broadcom.com>
-Reviewed-by: Pieter-Paul Giesberts <pieter-paul.giesberts@broadcom.com>
-Reviewed-by: Franky Lin <franky.lin@broadcom.com>
-Signed-off-by: Arend van Spriel <arend.vanspriel@broadcom.com>
-Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
----
- .../net/wireless/broadcom/brcm80211/brcmfmac/bus.h | 1 -
- .../wireless/broadcom/brcm80211/brcmfmac/core.c | 14 +++++++----
- .../wireless/broadcom/brcm80211/brcmfmac/pcie.c | 20 +---------------
- .../wireless/broadcom/brcm80211/brcmfmac/sdio.c | 10 ++------
- .../net/wireless/broadcom/brcm80211/brcmfmac/usb.c | 28 ++++------------------
- 5 files changed, 16 insertions(+), 57 deletions(-)
-
---- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/bus.h
-+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/bus.h
-@@ -253,7 +253,6 @@ void brcmf_dev_reset(struct device *dev)
- /* Configure the "global" bus state used by upper layers */
- void brcmf_bus_change_state(struct brcmf_bus *bus, enum brcmf_bus_state state);
-
--int brcmf_bus_started(struct device *dev);
- s32 brcmf_iovar_data_set(struct device *dev, char *name, void *data, u32 len);
- void brcmf_bus_add_txhdrlen(struct device *dev, uint len);
-
---- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/core.c
-+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/core.c
-@@ -1022,11 +1022,10 @@ static int brcmf_revinfo_read(struct seq
- return 0;
- }
-
--int brcmf_bus_started(struct device *dev)
-+static int brcmf_bus_started(struct brcmf_pub *drvr)
- {
- int ret = -1;
-- struct brcmf_bus *bus_if = dev_get_drvdata(dev);
-- struct brcmf_pub *drvr = bus_if->drvr;
-+ struct brcmf_bus *bus_if = drvr->bus_if;
- struct brcmf_if *ifp;
- struct brcmf_if *p2p_ifp;
-
-@@ -1043,7 +1042,7 @@ int brcmf_bus_started(struct device *dev
- brcmf_bus_change_state(bus_if, BRCMF_BUS_UP);
-
- /* do bus specific preinit here */
-- ret = brcmf_bus_preinit(ifp->drvr->bus_if);
-+ ret = brcmf_bus_preinit(bus_if);
- if (ret < 0)
- goto fail;
-
-@@ -1163,7 +1162,12 @@ int brcmf_attach(struct device *dev, str
- /* attach firmware event handler */
- brcmf_fweh_attach(drvr);
-
-- return ret;
-+ ret = brcmf_bus_started(drvr);
-+ if (ret != 0) {
-+ brcmf_err("dongle is not responding: err=%d\n", ret);
-+ goto fail;
-+ }
-+ return 0;
-
- fail:
- brcmf_detach(dev);
---- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/pcie.c
-+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/pcie.c
-@@ -1581,24 +1581,6 @@ static void brcmf_pcie_release_resource(
- }
-
-
--static int brcmf_pcie_attach_bus(struct brcmf_pciedev_info *devinfo)
--{
-- int ret;
--
-- /* Attach to the common driver interface */
-- ret = brcmf_attach(&devinfo->pdev->dev, devinfo->settings);
-- if (ret) {
-- brcmf_err("brcmf_attach failed\n");
-- } else {
-- ret = brcmf_bus_started(&devinfo->pdev->dev);
-- if (ret)
-- brcmf_err("dongle is not responding\n");
-- }
--
-- return ret;
--}
--
--
- static u32 brcmf_pcie_buscore_prep_addr(const struct pci_dev *pdev, u32 addr)
- {
- u32 ret_addr;
-@@ -1735,7 +1717,7 @@ static void brcmf_pcie_setup(struct devi
- init_waitqueue_head(&devinfo->mbdata_resp_wait);
-
- brcmf_pcie_intr_enable(devinfo);
-- if (brcmf_pcie_attach_bus(devinfo) == 0)
-+ if (brcmf_attach(&devinfo->pdev->dev, devinfo->settings) == 0)
- return;
-
- brcmf_pcie_bus_console_read(devinfo);
---- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c
-+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c
-@@ -3422,6 +3422,8 @@ static int brcmf_sdio_bus_preinit(struct
- if (bus->rxbuf)
- bus->rxblen = value;
-
-+ brcmf_sdio_debugfs_create(bus);
-+
- /* the commands below use the terms tx and rx from
- * a device perspective, ie. bus:txglom affects the
- * bus transfers from device to host.
-@@ -4136,14 +4138,6 @@ static void brcmf_sdio_firmware_callback
- goto fail;
- }
-
-- brcmf_sdio_debugfs_create(bus);
--
-- err = brcmf_bus_started(dev);
-- if (err != 0) {
-- brcmf_err("dongle is not responding\n");
-- goto fail;
-- }
--
- /* ready */
- return;
-
---- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/usb.c
-+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/usb.c
-@@ -1155,27 +1155,6 @@ static const struct brcmf_bus_ops brcmf_
- .get_fwname = brcmf_usb_get_fwname,
- };
-
--static int brcmf_usb_bus_setup(struct brcmf_usbdev_info *devinfo)
--{
-- int ret;
--
-- /* Attach to the common driver interface */
-- ret = brcmf_attach(devinfo->dev, devinfo->settings);
-- if (ret) {
-- brcmf_err("brcmf_attach failed\n");
-- return ret;
-- }
--
-- ret = brcmf_bus_started(devinfo->dev);
-- if (ret)
-- goto fail;
--
-- return 0;
--fail:
-- brcmf_detach(devinfo->dev);
-- return ret;
--}
--
- static void brcmf_usb_probe_phase2(struct device *dev, int ret,
- const struct firmware *fw,
- void *nvram, u32 nvlen)
-@@ -1203,7 +1182,8 @@ static void brcmf_usb_probe_phase2(struc
- if (ret)
- goto error;
-
-- ret = brcmf_usb_bus_setup(devinfo);
-+ /* Attach to the common driver interface */
-+ ret = brcmf_attach(devinfo->dev, devinfo->settings);
- if (ret)
- goto error;
-
-@@ -1253,7 +1233,7 @@ static int brcmf_usb_probe_cb(struct brc
- }
-
- if (!brcmf_usb_dlneeded(devinfo)) {
-- ret = brcmf_usb_bus_setup(devinfo);
-+ ret = brcmf_attach(devinfo->dev, devinfo->settings);
- if (ret)
- goto fail;
- /* we are done */
-@@ -1456,7 +1436,7 @@ static int brcmf_usb_resume(struct usb_i
-
- brcmf_dbg(USB, "Enter\n");
- if (!devinfo->wowl_enabled)
-- return brcmf_usb_bus_setup(devinfo);
-+ return brcmf_attach(devinfo->dev, devinfo->settings);
-
- devinfo->bus_pub.state = BRCMFMAC_USB_STATE_UP;
- brcmf_usb_rx_fill_all(devinfo);
diff --git a/package/kernel/mac80211/patches/325-v4.17-0007-brcmfmac-change-log-level-for-some-low-level-sdio-fu.patch b/package/kernel/mac80211/patches/325-v4.17-0007-brcmfmac-change-log-level-for-some-low-level-sdio-fu.patch
deleted file mode 100644
index 344826912d..0000000000
--- a/package/kernel/mac80211/patches/325-v4.17-0007-brcmfmac-change-log-level-for-some-low-level-sdio-fu.patch
+++ /dev/null
@@ -1,64 +0,0 @@
-From d678296bfb9a630d0000222fc21f4ed0d0d65332 Mon Sep 17 00:00:00 2001
-From: Arend Van Spriel <arend.vanspriel@broadcom.com>
-Date: Tue, 20 Feb 2018 00:14:24 +0100
-Subject: [PATCH] brcmfmac: change log level for some low-level sdio functions
-
-Reducing the number of trace level messages in sdio code giving
-them sdio log level instead.
-
-Reviewed-by: Hante Meuleman <hante.meuleman@broadcom.com>
-Reviewed-by: Pieter-Paul Giesberts <pieter-paul.giesberts@broadcom.com>
-Reviewed-by: Franky Lin <franky.lin@broadcom.com>
-Signed-off-by: Arend van Spriel <arend.vanspriel@broadcom.com>
-Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
----
- drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c | 10 +++++-----
- 1 file changed, 5 insertions(+), 5 deletions(-)
-
---- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c
-+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c
-@@ -1706,7 +1706,7 @@ brcmf_sdio_read_control(struct brcmf_sdi
- u8 *buf = NULL, *rbuf;
- int sdret;
-
-- brcmf_dbg(TRACE, "Enter\n");
-+ brcmf_dbg(SDIO, "Enter\n");
- if (bus->rxblen)
- buf = vzalloc(bus->rxblen);
- if (!buf)
-@@ -1809,7 +1809,7 @@ static uint brcmf_sdio_readframes(struct
- struct brcmf_sdio_hdrinfo *rd = &bus->cur_read, rd_new;
- u8 head_read = 0;
-
-- brcmf_dbg(TRACE, "Enter\n");
-+ brcmf_dbg(SDIO, "Enter\n");
-
- /* Not finished unless we encounter no more frames indication */
- bus->rxpending = true;
-@@ -2344,7 +2344,7 @@ static int brcmf_sdio_tx_ctrlframe(struc
- struct brcmf_sdio_hdrinfo hd_info = {0};
- int ret;
-
-- brcmf_dbg(TRACE, "Enter\n");
-+ brcmf_dbg(SDIO, "Enter\n");
-
- /* Back the pointer to make room for bus header */
- frame -= bus->tx_hdrlen;
-@@ -2520,7 +2520,7 @@ static void brcmf_sdio_dpc(struct brcmf_
- uint framecnt; /* Temporary counter of tx/rx frames */
- int err = 0;
-
-- brcmf_dbg(TRACE, "Enter\n");
-+ brcmf_dbg(SDIO, "Enter\n");
-
- sdio_claim_host(bus->sdiodev->func1);
-
-@@ -2605,7 +2605,7 @@ static void brcmf_sdio_dpc(struct brcmf_
-
- /* Would be active due to wake-wlan in gSPI */
- if (intstatus & I_CHIPACTIVE) {
-- brcmf_dbg(INFO, "Dongle reports CHIPACTIVE\n");
-+ brcmf_dbg(SDIO, "Dongle reports CHIPACTIVE\n");
- intstatus &= ~I_CHIPACTIVE;
- }
-
diff --git a/package/kernel/mac80211/patches/325-v4.17-0008-brcmfmac-remove-duplicate-pointer-variable-from-brcm.patch b/package/kernel/mac80211/patches/325-v4.17-0008-brcmfmac-remove-duplicate-pointer-variable-from-brcm.patch
deleted file mode 100644
index 39fba211fe..0000000000
--- a/package/kernel/mac80211/patches/325-v4.17-0008-brcmfmac-remove-duplicate-pointer-variable-from-brcm.patch
+++ /dev/null
@@ -1,126 +0,0 @@
-From 2d6edad4b2da1991f74e7b02053eeb4a043b887f Mon Sep 17 00:00:00 2001
-From: Arend Van Spriel <arend.vanspriel@broadcom.com>
-Date: Tue, 20 Feb 2018 00:14:25 +0100
-Subject: [PATCH] brcmfmac: remove duplicate pointer variable from
- brcmf_sdio_firmware_callback()
-
-In brcmf_sdio_firmware_callback() two pointer variables were used
-pointing to the same construct. Get rid of sdiodev variable.
-
-Signed-off-by: Arend van Spriel <arend.vanspriel@broadcom.com>
-Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
----
- .../wireless/broadcom/brcm80211/brcmfmac/sdio.c | 37 +++++++++++-----------
- 1 file changed, 18 insertions(+), 19 deletions(-)
-
---- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c
-+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c
-@@ -4039,9 +4039,8 @@ static void brcmf_sdio_firmware_callback
- void *nvram, u32 nvram_len)
- {
- struct brcmf_bus *bus_if = dev_get_drvdata(dev);
-- struct brcmf_sdio_dev *sdiodev = bus_if->bus_priv.sdio;
-- struct brcmf_sdio *bus = sdiodev->bus;
-- struct brcmf_sdio_dev *sdiod = bus->sdiodev;
-+ struct brcmf_sdio_dev *sdiod = bus_if->bus_priv.sdio;
-+ struct brcmf_sdio *bus = sdiod->bus;
- struct brcmf_core *core = bus->sdio_core;
- u8 saveclk;
-
-@@ -4061,7 +4060,7 @@ static void brcmf_sdio_firmware_callback
- bus->sdcnt.tickcnt = 0;
- brcmf_sdio_wd_timer(bus, true);
-
-- sdio_claim_host(sdiodev->func1);
-+ sdio_claim_host(sdiod->func1);
-
- /* Make sure backplane clock is on, needed to generate F2 interrupt */
- brcmf_sdio_clkctl(bus, CLK_AVAIL, false);
-@@ -4069,9 +4068,9 @@ static void brcmf_sdio_firmware_callback
- goto release;
-
- /* Force clocks on backplane to be sure F2 interrupt propagates */
-- saveclk = brcmf_sdiod_readb(sdiodev, SBSDIO_FUNC1_CHIPCLKCSR, &err);
-+ saveclk = brcmf_sdiod_readb(sdiod, SBSDIO_FUNC1_CHIPCLKCSR, &err);
- if (!err) {
-- brcmf_sdiod_writeb(sdiodev, SBSDIO_FUNC1_CHIPCLKCSR,
-+ brcmf_sdiod_writeb(sdiod, SBSDIO_FUNC1_CHIPCLKCSR,
- (saveclk | SBSDIO_FORCE_HT), &err);
- }
- if (err) {
-@@ -4083,7 +4082,7 @@ static void brcmf_sdio_firmware_callback
- brcmf_sdiod_writel(sdiod, core->base + SD_REG(tosbmailboxdata),
- SDPCM_PROT_VERSION << SMB_DATA_VERSION_SHIFT, NULL);
-
-- err = sdio_enable_func(sdiodev->func2);
-+ err = sdio_enable_func(sdiod->func2);
-
- brcmf_dbg(INFO, "enable F2: err=%d\n", err);
-
-@@ -4095,10 +4094,10 @@ static void brcmf_sdio_firmware_callback
- bus->hostintmask, NULL);
-
-
-- brcmf_sdiod_writeb(sdiodev, SBSDIO_WATERMARK, 8, &err);
-+ brcmf_sdiod_writeb(sdiod, SBSDIO_WATERMARK, 8, &err);
- } else {
- /* Disable F2 again */
-- sdio_disable_func(sdiodev->func2);
-+ sdio_disable_func(sdiod->func2);
- goto release;
- }
-
-@@ -4106,7 +4105,7 @@ static void brcmf_sdio_firmware_callback
- brcmf_sdio_sr_init(bus);
- } else {
- /* Restore previous clock setting */
-- brcmf_sdiod_writeb(sdiodev, SBSDIO_FUNC1_CHIPCLKCSR,
-+ brcmf_sdiod_writeb(sdiod, SBSDIO_FUNC1_CHIPCLKCSR,
- saveclk, &err);
- }
-
-@@ -4114,7 +4113,7 @@ static void brcmf_sdio_firmware_callback
- /* Allow full data communication using DPC from now on. */
- brcmf_sdiod_change_state(bus->sdiodev, BRCMF_SDIOD_DATA);
-
-- err = brcmf_sdiod_intr_register(sdiodev);
-+ err = brcmf_sdiod_intr_register(sdiod);
- if (err != 0)
- brcmf_err("intr register failed:%d\n", err);
- }
-@@ -4123,16 +4122,16 @@ static void brcmf_sdio_firmware_callback
- if (err != 0)
- brcmf_sdio_clkctl(bus, CLK_NONE, false);
-
-- sdio_release_host(sdiodev->func1);
-+ sdio_release_host(sdiod->func1);
-
- /* Assign bus interface call back */
-- sdiodev->bus_if->dev = sdiodev->dev;
-- sdiodev->bus_if->ops = &brcmf_sdio_bus_ops;
-- sdiodev->bus_if->chip = bus->ci->chip;
-- sdiodev->bus_if->chiprev = bus->ci->chiprev;
-+ sdiod->bus_if->dev = sdiod->dev;
-+ sdiod->bus_if->ops = &brcmf_sdio_bus_ops;
-+ sdiod->bus_if->chip = bus->ci->chip;
-+ sdiod->bus_if->chiprev = bus->ci->chiprev;
-
- /* Attach to the common layer, reserve hdr space */
-- err = brcmf_attach(sdiodev->dev, sdiodev->settings);
-+ err = brcmf_attach(sdiod->dev, sdiod->settings);
- if (err != 0) {
- brcmf_err("brcmf_attach failed\n");
- goto fail;
-@@ -4142,10 +4141,10 @@ static void brcmf_sdio_firmware_callback
- return;
-
- release:
-- sdio_release_host(sdiodev->func1);
-+ sdio_release_host(sdiod->func1);
- fail:
- brcmf_dbg(TRACE, "failed: dev=%s, err=%d\n", dev_name(dev), err);
-- device_release_driver(&sdiodev->func2->dev);
-+ device_release_driver(&sdiod->func2->dev);
- device_release_driver(dev);
- }
-
diff --git a/package/kernel/mac80211/patches/326-v4.17-0001-brcmfmac-reject-too-long-PSK.patch b/package/kernel/mac80211/patches/326-v4.17-0001-brcmfmac-reject-too-long-PSK.patch
deleted file mode 100644
index b83f2fce8b..0000000000
--- a/package/kernel/mac80211/patches/326-v4.17-0001-brcmfmac-reject-too-long-PSK.patch
+++ /dev/null
@@ -1,27 +0,0 @@
-From 64d1519edc959f5b8f86a66a51c40971c215e4ec Mon Sep 17 00:00:00 2001
-From: Johannes Berg <johannes.berg@intel.com>
-Date: Mon, 19 Feb 2018 13:30:45 +0100
-Subject: [PATCH] brcmfmac: reject too long PSK
-
-nl80211 already allows specifying 48 bytes, but brcmfmac
-only supports 32. Reject keys that are too long.
-
-Signed-off-by: Johannes Berg <johannes.berg@intel.com>
-Acked-by: Arend van Spriel <arend.vanspriel@broadcom.com>
-Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
----
- drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c | 3 +++
- 1 file changed, 3 insertions(+)
-
---- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c
-+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c
-@@ -5125,6 +5125,9 @@ static int brcmf_cfg80211_set_pmk(struct
- if (WARN_ON(ifp->vif->profile.use_fwsup != BRCMF_PROFILE_FWSUP_1X))
- return -EINVAL;
-
-+ if (conf->pmk_len > BRCMF_WSEC_MAX_PSK_LEN)
-+ return -ERANGE;
-+
- return brcmf_set_pmk(ifp, conf->pmk, conf->pmk_len);
- }
-
diff --git a/package/kernel/mac80211/patches/327-v4.17-0001-brcmfmac-do-not-convert-linux-error-to-firmware-erro.patch b/package/kernel/mac80211/patches/327-v4.17-0001-brcmfmac-do-not-convert-linux-error-to-firmware-erro.patch
deleted file mode 100644
index 2e9ec8b963..0000000000
--- a/package/kernel/mac80211/patches/327-v4.17-0001-brcmfmac-do-not-convert-linux-error-to-firmware-erro.patch
+++ /dev/null
@@ -1,31 +0,0 @@
-From 1170f6d1be6a39e1a115a2c0f50923eb4ce2a7ec Mon Sep 17 00:00:00 2001
-From: Arend Van Spriel <arend.vanspriel@broadcom.com>
-Date: Thu, 22 Mar 2018 21:28:20 +0100
-Subject: [PATCH] brcmfmac: do not convert linux error to firmware error string
-
-In case of a linux error brcmf_fil_cmd_data() blurts an error message
-in which the error code is translated to an error string. However, it
-maps it to a firmware error string which should not happen. Simply
-print only the numeric error code and be done with it.
-
-Reviewed-by: Hante Meuleman <hante.meuleman@broadcom.com>
-Reviewed-by: Pieter-Paul Giesberts <pieter-paul.giesberts@broadcom.com>
-Reviewed-by: Franky Lin <franky.lin@broadcom.com>
-Signed-off-by: Arend van Spriel <arend.vanspriel@broadcom.com>
-Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
----
- drivers/net/wireless/broadcom/brcm80211/brcmfmac/fwil.c | 3 +--
- 1 file changed, 1 insertion(+), 2 deletions(-)
-
---- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/fwil.c
-+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/fwil.c
-@@ -124,8 +124,7 @@ brcmf_fil_cmd_data(struct brcmf_if *ifp,
- data, len, &fwerr);
-
- if (err) {
-- brcmf_dbg(FIL, "Failed: %s (%d)\n",
-- brcmf_fil_get_errstr((u32)(-err)), err);
-+ brcmf_dbg(FIL, "Failed: error=%d\n", err);
- } else if (fwerr < 0) {
- brcmf_dbg(FIL, "Firmware error: %s (%d)\n",
- brcmf_fil_get_errstr((u32)(-fwerr)), fwerr);
diff --git a/package/kernel/mac80211/patches/327-v4.17-0002-brcmfmac-use-brcmf_chip_name-to-store-name-in-revinf.patch b/package/kernel/mac80211/patches/327-v4.17-0002-brcmfmac-use-brcmf_chip_name-to-store-name-in-revinf.patch
deleted file mode 100644
index 790811957a..0000000000
--- a/package/kernel/mac80211/patches/327-v4.17-0002-brcmfmac-use-brcmf_chip_name-to-store-name-in-revinf.patch
+++ /dev/null
@@ -1,203 +0,0 @@
-From 756a2b390874d274f2f615921318ef0856ff9313 Mon Sep 17 00:00:00 2001
-From: Arend Van Spriel <arend.vanspriel@broadcom.com>
-Date: Thu, 22 Mar 2018 21:28:21 +0100
-Subject: [PATCH] brcmfmac: use brcmf_chip_name() to store name in revinfo
-
-The chip id can either be four or five digits. For the chip name either
-the hexadecimal value needs to be taken (four digits) or the decimal
-value (five digits). The function brcmf_chip_name() does this conversion
-so use it to store the name in driver revision info.
-
-Reviewed-by: Hante Meuleman <hante.meuleman@broadcom.com>
-Reviewed-by: Pieter-Paul Giesberts <pieter-paul.giesberts@broadcom.com>
-Reviewed-by: Franky Lin <franky.lin@broadcom.com>
-Signed-off-by: Arend van Spriel <arend.vanspriel@broadcom.com>
-Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
----
- .../wireless/broadcom/brcm80211/brcmfmac/chip.c | 9 +++++----
- .../wireless/broadcom/brcm80211/brcmfmac/chip.h | 3 ++-
- .../wireless/broadcom/brcm80211/brcmfmac/common.c | 23 ++++++++++++++++------
- .../wireless/broadcom/brcm80211/brcmfmac/core.c | 10 +---------
- .../wireless/broadcom/brcm80211/brcmfmac/core.h | 3 +--
- 5 files changed, 26 insertions(+), 22 deletions(-)
-
---- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/chip.c
-+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/chip.c
-@@ -464,12 +464,12 @@ static void brcmf_chip_ai_resetcore(stru
- ci->ops->read32(ci->ctx, core->wrapbase + BCMA_IOCTL);
- }
-
--static char *brcmf_chip_name(uint chipid, char *buf, uint len)
-+char *brcmf_chip_name(u32 id, u32 rev, char *buf, uint len)
- {
- const char *fmt;
-
-- fmt = ((chipid > 0xa000) || (chipid < 0x4000)) ? "%d" : "%x";
-- snprintf(buf, len, fmt, chipid);
-+ fmt = ((id > 0xa000) || (id < 0x4000)) ? "BCM%d/%u" : "BCM%x/%u";
-+ snprintf(buf, len, fmt, id, rev);
- return buf;
- }
-
-@@ -924,7 +924,8 @@ static int brcmf_chip_recognition(struct
- ci->pub.chiprev = (regdata & CID_REV_MASK) >> CID_REV_SHIFT;
- socitype = (regdata & CID_TYPE_MASK) >> CID_TYPE_SHIFT;
-
-- brcmf_chip_name(ci->pub.chip, ci->pub.name, sizeof(ci->pub.name));
-+ brcmf_chip_name(ci->pub.chip, ci->pub.chiprev,
-+ ci->pub.name, sizeof(ci->pub.name));
- brcmf_dbg(INFO, "found %s chip: BCM%s, rev=%d\n",
- socitype == SOCI_SB ? "SB" : "AXI", ci->pub.name,
- ci->pub.chiprev);
---- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/chip.h
-+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/chip.h
-@@ -45,7 +45,7 @@ struct brcmf_chip {
- u32 rambase;
- u32 ramsize;
- u32 srsize;
-- char name[8];
-+ char name[12];
- };
-
- /**
-@@ -93,5 +93,6 @@ void brcmf_chip_resetcore(struct brcmf_c
- void brcmf_chip_set_passive(struct brcmf_chip *ci);
- bool brcmf_chip_set_active(struct brcmf_chip *ci, u32 rstvec);
- bool brcmf_chip_sr_capable(struct brcmf_chip *pub);
-+char *brcmf_chip_name(u32 chipid, u32 chiprev, char *buf, uint len);
-
- #endif /* BRCMF_AXIDMP_H */
---- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/common.c
-+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/common.c
-@@ -30,6 +30,7 @@
- #include "common.h"
- #include "of.h"
- #include "firmware.h"
-+#include "chip.h"
-
- MODULE_AUTHOR("Broadcom Corporation");
- MODULE_DESCRIPTION("Broadcom 802.11 wireless LAN fullmac driver.");
-@@ -131,14 +132,13 @@ static int brcmf_c_download(struct brcmf
- static int brcmf_c_get_clm_name(struct brcmf_if *ifp, u8 *clm_name)
- {
- struct brcmf_bus *bus = ifp->drvr->bus_if;
-- struct brcmf_rev_info *ri = &ifp->drvr->revinfo;
- u8 fw_name[BRCMF_FW_NAME_LEN];
- u8 *ptr;
- size_t len;
- s32 err;
-
- memset(fw_name, 0, BRCMF_FW_NAME_LEN);
-- err = brcmf_bus_get_fwname(bus, ri->chipnum, ri->chiprev, fw_name);
-+ err = brcmf_bus_get_fwname(bus, bus->chip, bus->chiprev, fw_name);
- if (err) {
- brcmf_err("get firmware name failed (%d)\n", err);
- goto done;
-@@ -238,6 +238,7 @@ int brcmf_c_preinit_dcmds(struct brcmf_i
- {
- s8 eventmask[BRCMF_EVENTING_MASK_LEN];
- u8 buf[BRCMF_DCMD_SMLEN];
-+ struct brcmf_bus *bus;
- struct brcmf_rev_info_le revinfo;
- struct brcmf_rev_info *ri;
- char *clmver;
-@@ -253,16 +254,18 @@ int brcmf_c_preinit_dcmds(struct brcmf_i
- }
- memcpy(ifp->drvr->mac, ifp->mac_addr, sizeof(ifp->drvr->mac));
-
-+ bus = ifp->drvr->bus_if;
-+ ri = &ifp->drvr->revinfo;
-+
- err = brcmf_fil_cmd_data_get(ifp, BRCMF_C_GET_REVINFO,
- &revinfo, sizeof(revinfo));
-- ri = &ifp->drvr->revinfo;
- if (err < 0) {
- brcmf_err("retrieving revision info failed, %d\n", err);
-+ strlcpy(ri->chipname, "UNKNOWN", sizeof(ri->chipname));
- } else {
- ri->vendorid = le32_to_cpu(revinfo.vendorid);
- ri->deviceid = le32_to_cpu(revinfo.deviceid);
- ri->radiorev = le32_to_cpu(revinfo.radiorev);
-- ri->chiprev = le32_to_cpu(revinfo.chiprev);
- ri->corerev = le32_to_cpu(revinfo.corerev);
- ri->boardid = le32_to_cpu(revinfo.boardid);
- ri->boardvendor = le32_to_cpu(revinfo.boardvendor);
-@@ -270,15 +273,23 @@ int brcmf_c_preinit_dcmds(struct brcmf_i
- ri->driverrev = le32_to_cpu(revinfo.driverrev);
- ri->ucoderev = le32_to_cpu(revinfo.ucoderev);
- ri->bus = le32_to_cpu(revinfo.bus);
-- ri->chipnum = le32_to_cpu(revinfo.chipnum);
- ri->phytype = le32_to_cpu(revinfo.phytype);
- ri->phyrev = le32_to_cpu(revinfo.phyrev);
- ri->anarev = le32_to_cpu(revinfo.anarev);
- ri->chippkg = le32_to_cpu(revinfo.chippkg);
- ri->nvramrev = le32_to_cpu(revinfo.nvramrev);
-+
-+ if (!bus->chip) {
-+ bus->chip = le32_to_cpu(revinfo.chipnum);
-+ bus->chiprev = le32_to_cpu(revinfo.chiprev);
-+ }
- }
- ri->result = err;
-
-+ if (bus->chip)
-+ brcmf_chip_name(bus->chip, bus->chiprev,
-+ ri->chipname, sizeof(ri->chipname));
-+
- /* Do any CLM downloading */
- err = brcmf_c_process_clm_blob(ifp);
- if (err < 0) {
-@@ -299,7 +310,7 @@ int brcmf_c_preinit_dcmds(struct brcmf_i
- strsep(&ptr, "\n");
-
- /* Print fw version info */
-- brcmf_info("Firmware version = %s\n", buf);
-+ brcmf_info("Firmware: %s %s\n", ri->chipname, buf);
-
- /* locate firmware version number for ethtool */
- ptr = strrchr(buf, ' ') + 1;
---- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/core.c
-+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/core.c
-@@ -1002,8 +1002,7 @@ static int brcmf_revinfo_read(struct seq
- seq_printf(s, "vendorid: 0x%04x\n", ri->vendorid);
- seq_printf(s, "deviceid: 0x%04x\n", ri->deviceid);
- seq_printf(s, "radiorev: %s\n", brcmu_dotrev_str(ri->radiorev, drev));
-- seq_printf(s, "chipnum: %u (%x)\n", ri->chipnum, ri->chipnum);
-- seq_printf(s, "chiprev: %u\n", ri->chiprev);
-+ seq_printf(s, "chip: %s\n", ri->chipname);
- seq_printf(s, "chippkg: %u\n", ri->chippkg);
- seq_printf(s, "corerev: %u\n", ri->corerev);
- seq_printf(s, "boardid: 0x%04x\n", ri->boardid);
-@@ -1053,13 +1052,6 @@ static int brcmf_bus_started(struct brcm
-
- brcmf_debugfs_add_entry(drvr, "revinfo", brcmf_revinfo_read);
-
-- /* assure we have chipid before feature attach */
-- if (!bus_if->chip) {
-- bus_if->chip = drvr->revinfo.chipnum;
-- bus_if->chiprev = drvr->revinfo.chiprev;
-- brcmf_dbg(INFO, "firmware revinfo: chip %x (%d) rev %d\n",
-- bus_if->chip, bus_if->chip, bus_if->chiprev);
-- }
- brcmf_feat_attach(drvr);
-
- ret = brcmf_proto_init_done(drvr);
---- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/core.h
-+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/core.h
-@@ -87,7 +87,6 @@ struct brcmf_rev_info {
- u32 vendorid;
- u32 deviceid;
- u32 radiorev;
-- u32 chiprev;
- u32 corerev;
- u32 boardid;
- u32 boardvendor;
-@@ -95,7 +94,7 @@ struct brcmf_rev_info {
- u32 driverrev;
- u32 ucoderev;
- u32 bus;
-- u32 chipnum;
-+ char chipname[12];
- u32 phytype;
- u32 phyrev;
- u32 anarev;
diff --git a/package/kernel/mac80211/patches/327-v4.17-0003-brcmfmac-use-brcmf_chip_name-for-consistency.patch b/package/kernel/mac80211/patches/327-v4.17-0003-brcmfmac-use-brcmf_chip_name-for-consistency.patch
deleted file mode 100644
index e3d06f32cc..0000000000
--- a/package/kernel/mac80211/patches/327-v4.17-0003-brcmfmac-use-brcmf_chip_name-for-consistency.patch
+++ /dev/null
@@ -1,69 +0,0 @@
-From c88cfa075de356ddf40c668896b2126340f19ba4 Mon Sep 17 00:00:00 2001
-From: Arend Van Spriel <arend.vanspriel@broadcom.com>
-Date: Thu, 22 Mar 2018 21:28:22 +0100
-Subject: [PATCH] brcmfmac: use brcmf_chip_name() for consistency
-
-When logging the chip id/revision information make use of
-brcmf_chip_name() so it is always the same.
-
-Reviewed-by: Hante Meuleman <hante.meuleman@broadcom.com>
-Reviewed-by: Pieter-Paul Giesberts <pieter-paul.giesberts@broadcom.com>
-Reviewed-by: Franky Lin <franky.lin@broadcom.com>
-Signed-off-by: Arend van Spriel <arend.vanspriel@broadcom.com>
-Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
----
- drivers/net/wireless/broadcom/brcm80211/brcmfmac/chip.c | 5 ++---
- drivers/net/wireless/broadcom/brcm80211/brcmfmac/firmware.c | 7 +++++--
- 2 files changed, 7 insertions(+), 5 deletions(-)
-
---- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/chip.c
-+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/chip.c
-@@ -926,9 +926,8 @@ static int brcmf_chip_recognition(struct
-
- brcmf_chip_name(ci->pub.chip, ci->pub.chiprev,
- ci->pub.name, sizeof(ci->pub.name));
-- brcmf_dbg(INFO, "found %s chip: BCM%s, rev=%d\n",
-- socitype == SOCI_SB ? "SB" : "AXI", ci->pub.name,
-- ci->pub.chiprev);
-+ brcmf_dbg(INFO, "found %s chip: %s\n",
-+ socitype == SOCI_SB ? "SB" : "AXI", ci->pub.name);
-
- if (socitype == SOCI_SB) {
- if (ci->pub.chip != BRCM_CC_4329_CHIP_ID) {
---- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/firmware.c
-+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/firmware.c
-@@ -25,6 +25,7 @@
- #include "firmware.h"
- #include "core.h"
- #include "common.h"
-+#include "chip.h"
-
- #define BRCMF_FW_MAX_NVRAM_SIZE 64000
- #define BRCMF_FW_NVRAM_DEVPATH_LEN 19 /* devpath0=pcie/1/4/ */
-@@ -567,6 +568,7 @@ int brcmf_fw_map_chip_to_name(u32 chip,
- u32 table_size, char fw_name[BRCMF_FW_NAME_LEN],
- char nvram_name[BRCMF_FW_NAME_LEN])
- {
-+ char chipname[12];
- u32 i;
- char end;
-
-@@ -581,6 +583,8 @@ int brcmf_fw_map_chip_to_name(u32 chip,
- return -ENODEV;
- }
-
-+ brcmf_chip_name(chip, chiprev, chipname, sizeof(chipname));
-+
- /* check if firmware path is provided by module parameter */
- if (brcmf_mp_global.firmware_path[0] != '\0') {
- strlcpy(fw_name, brcmf_mp_global.firmware_path,
-@@ -601,8 +605,7 @@ int brcmf_fw_map_chip_to_name(u32 chip,
- if ((nvram_name) && (mapping_table[i].nvram))
- strlcat(nvram_name, mapping_table[i].nvram, BRCMF_FW_NAME_LEN);
-
-- brcmf_info("using %s for chip %#08x(%d) rev %#08x\n",
-- fw_name, chip, chip, chiprev);
-+ brcmf_info("using %s for chip %s\n", fw_name, chipname);
-
- return 0;
- }
diff --git a/package/kernel/mac80211/patches/327-v4.17-0004-brcmfmac-allocate-struct-brcmf_pub-instance-using-wi.patch b/package/kernel/mac80211/patches/327-v4.17-0004-brcmfmac-allocate-struct-brcmf_pub-instance-using-wi.patch
deleted file mode 100644
index 42adff61b9..0000000000
--- a/package/kernel/mac80211/patches/327-v4.17-0004-brcmfmac-allocate-struct-brcmf_pub-instance-using-wi.patch
+++ /dev/null
@@ -1,452 +0,0 @@
-From 856d5a011c86b59f6564be4508912fb1d866adfc Mon Sep 17 00:00:00 2001
-From: Arend Van Spriel <arend.vanspriel@broadcom.com>
-Date: Thu, 22 Mar 2018 21:28:23 +0100
-Subject: [PATCH] brcmfmac: allocate struct brcmf_pub instance using
- wiphy_new()
-
-Rework the driver so the wiphy instance holds the main driver information
-in its private buffer. Previously it held struct brcmf_cfg80211_info
-instance so a bit of reorg was needed. This was done so that the wiphy
-name or its parent device can be shown in debug output.
-
-Reviewed-by: Hante Meuleman <hante.meuleman@broadcom.com>
-Reviewed-by: Pieter-Paul Giesberts <pieter-paul.giesberts@broadcom.com>
-Reviewed-by: Franky Lin <franky.lin@broadcom.com>
-Signed-off-by: Arend van Spriel <arend.vanspriel@broadcom.com>
-Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
----
- .../wireless/broadcom/brcm80211/brcmfmac/btcoex.c | 2 +-
- .../broadcom/brcm80211/brcmfmac/cfg80211.c | 86 ++++++++++------------
- .../broadcom/brcm80211/brcmfmac/cfg80211.h | 17 +++--
- .../wireless/broadcom/brcm80211/brcmfmac/common.c | 2 +
- .../wireless/broadcom/brcm80211/brcmfmac/core.c | 27 +++++--
- .../wireless/broadcom/brcm80211/brcmfmac/core.h | 1 +
- .../net/wireless/broadcom/brcm80211/brcmfmac/p2p.c | 2 +-
- 7 files changed, 76 insertions(+), 61 deletions(-)
-
---- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/btcoex.c
-+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/btcoex.c
-@@ -462,7 +462,7 @@ static void brcmf_btcoex_dhcp_end(struct
- int brcmf_btcoex_set_mode(struct brcmf_cfg80211_vif *vif,
- enum brcmf_btcoex_mode mode, u16 duration)
- {
-- struct brcmf_cfg80211_info *cfg = wiphy_priv(vif->wdev.wiphy);
-+ struct brcmf_cfg80211_info *cfg = wiphy_to_cfg(vif->wdev.wiphy);
- struct brcmf_btcoex_info *btci = cfg->btcoex;
- struct brcmf_if *ifp = brcmf_get_ifp(cfg->pub, 0);
-
---- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c
-+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c
-@@ -753,7 +753,7 @@ s32 brcmf_notify_escan_complete(struct b
- static int brcmf_cfg80211_del_ap_iface(struct wiphy *wiphy,
- struct wireless_dev *wdev)
- {
-- struct brcmf_cfg80211_info *cfg = wiphy_priv(wiphy);
-+ struct brcmf_cfg80211_info *cfg = wiphy_to_cfg(wiphy);
- struct net_device *ndev = wdev->netdev;
- struct brcmf_if *ifp = netdev_priv(ndev);
- int ret;
-@@ -786,7 +786,7 @@ err_unarm:
- static
- int brcmf_cfg80211_del_iface(struct wiphy *wiphy, struct wireless_dev *wdev)
- {
-- struct brcmf_cfg80211_info *cfg = wiphy_priv(wiphy);
-+ struct brcmf_cfg80211_info *cfg = wiphy_to_cfg(wiphy);
- struct net_device *ndev = wdev->netdev;
-
- if (ndev && ndev == cfg_to_ndev(cfg))
-@@ -831,7 +831,7 @@ brcmf_cfg80211_change_iface(struct wiphy
- enum nl80211_iftype type,
- struct vif_params *params)
- {
-- struct brcmf_cfg80211_info *cfg = wiphy_priv(wiphy);
-+ struct brcmf_cfg80211_info *cfg = wiphy_to_cfg(wiphy);
- struct brcmf_if *ifp = netdev_priv(ndev);
- struct brcmf_cfg80211_vif *vif = ifp->vif;
- s32 infra = 0;
-@@ -2127,17 +2127,15 @@ static s32
- brcmf_cfg80211_get_tx_power(struct wiphy *wiphy, struct wireless_dev *wdev,
- s32 *dbm)
- {
-- struct brcmf_cfg80211_info *cfg = wiphy_to_cfg(wiphy);
-- struct net_device *ndev = cfg_to_ndev(cfg);
-- struct brcmf_if *ifp = netdev_priv(ndev);
-+ struct brcmf_cfg80211_vif *vif = wdev_to_vif(wdev);
- s32 qdbm = 0;
- s32 err;
-
- brcmf_dbg(TRACE, "Enter\n");
-- if (!check_vif_up(ifp->vif))
-+ if (!check_vif_up(vif))
- return -EIO;
-
-- err = brcmf_fil_iovar_int_get(ifp, "qtxpower", &qdbm);
-+ err = brcmf_fil_iovar_int_get(vif->ifp, "qtxpower", &qdbm);
- if (err) {
- brcmf_err("error (%d)\n", err);
- goto done;
-@@ -3359,7 +3357,7 @@ brcmf_cfg80211_sched_scan_start(struct w
- struct cfg80211_sched_scan_request *req)
- {
- struct brcmf_if *ifp = netdev_priv(ndev);
-- struct brcmf_cfg80211_info *cfg = wiphy_priv(wiphy);
-+ struct brcmf_cfg80211_info *cfg = wiphy_to_cfg(wiphy);
-
- brcmf_dbg(SCAN, "Enter: n_match_sets=%d n_ssids=%d\n",
- req->n_match_sets, req->n_ssids);
-@@ -5191,6 +5189,12 @@ static struct cfg80211_ops brcmf_cfg8021
- .del_pmk = brcmf_cfg80211_del_pmk,
- };
-
-+struct cfg80211_ops *brcmf_cfg80211_get_ops(void)
-+{
-+ return kmemdup(&brcmf_cfg80211_ops, sizeof(brcmf_cfg80211_ops),
-+ GFP_KERNEL);
-+}
-+
- struct brcmf_cfg80211_vif *brcmf_alloc_vif(struct brcmf_cfg80211_info *cfg,
- enum nl80211_iftype type)
- {
-@@ -5898,7 +5902,7 @@ static void brcmf_update_bw40_channel_fl
- static int brcmf_construct_chaninfo(struct brcmf_cfg80211_info *cfg,
- u32 bw_cap[])
- {
-- struct brcmf_if *ifp = netdev_priv(cfg_to_ndev(cfg));
-+ struct brcmf_if *ifp = brcmf_get_ifp(cfg->pub, 0);
- struct ieee80211_supported_band *band;
- struct ieee80211_channel *channel;
- struct wiphy *wiphy;
-@@ -6013,7 +6017,7 @@ fail_pbuf:
-
- static int brcmf_enable_bw40_2g(struct brcmf_cfg80211_info *cfg)
- {
-- struct brcmf_if *ifp = netdev_priv(cfg_to_ndev(cfg));
-+ struct brcmf_if *ifp = brcmf_get_ifp(cfg->pub, 0);
- struct ieee80211_supported_band *band;
- struct brcmf_fil_bwcap_le band_bwcap;
- struct brcmf_chanspec_list *list;
-@@ -6198,10 +6202,10 @@ static void brcmf_update_vht_cap(struct
- }
- }
-
--static int brcmf_setup_wiphybands(struct wiphy *wiphy)
-+static int brcmf_setup_wiphybands(struct brcmf_cfg80211_info *cfg)
- {
-- struct brcmf_cfg80211_info *cfg = wiphy_priv(wiphy);
-- struct brcmf_if *ifp = netdev_priv(cfg_to_ndev(cfg));
-+ struct brcmf_if *ifp = brcmf_get_ifp(cfg->pub, 0);
-+ struct wiphy *wiphy;
- u32 nmode = 0;
- u32 vhtmode = 0;
- u32 bw_cap[2] = { WLC_BW_20MHZ_BIT, WLC_BW_20MHZ_BIT };
-@@ -6795,8 +6799,8 @@ static s32 brcmf_translate_country_code(
- static void brcmf_cfg80211_reg_notifier(struct wiphy *wiphy,
- struct regulatory_request *req)
- {
-- struct brcmf_cfg80211_info *cfg = wiphy_priv(wiphy);
-- struct brcmf_if *ifp = netdev_priv(cfg_to_ndev(cfg));
-+ struct brcmf_cfg80211_info *cfg = wiphy_to_cfg(wiphy);
-+ struct brcmf_if *ifp = brcmf_get_ifp(cfg->pub, 0);
- struct brcmf_fil_country_le ccreq;
- s32 err;
- int i;
-@@ -6831,7 +6835,7 @@ static void brcmf_cfg80211_reg_notifier(
- brcmf_err("Firmware rejected country setting\n");
- return;
- }
-- brcmf_setup_wiphybands(wiphy);
-+ brcmf_setup_wiphybands(cfg);
- }
-
- static void brcmf_free_wiphy(struct wiphy *wiphy)
-@@ -6858,17 +6862,15 @@ static void brcmf_free_wiphy(struct wiph
- if (wiphy->wowlan != &brcmf_wowlan_support)
- kfree(wiphy->wowlan);
- #endif
-- wiphy_free(wiphy);
- }
-
- struct brcmf_cfg80211_info *brcmf_cfg80211_attach(struct brcmf_pub *drvr,
-- struct device *busdev,
-+ struct cfg80211_ops *ops,
- bool p2pdev_forced)
- {
-+ struct wiphy *wiphy = drvr->wiphy;
- struct net_device *ndev = brcmf_get_ifp(drvr, 0)->ndev;
- struct brcmf_cfg80211_info *cfg;
-- struct wiphy *wiphy;
-- struct cfg80211_ops *ops;
- struct brcmf_cfg80211_vif *vif;
- struct brcmf_if *ifp;
- s32 err = 0;
-@@ -6880,26 +6882,13 @@ struct brcmf_cfg80211_info *brcmf_cfg802
- return NULL;
- }
-
-- ops = kmemdup(&brcmf_cfg80211_ops, sizeof(*ops), GFP_KERNEL);
-- if (!ops)
-- return NULL;
--
-- ifp = netdev_priv(ndev);
--#ifdef CONFIG_PM
-- if (brcmf_feat_is_enabled(ifp, BRCMF_FEAT_WOWL_GTK))
-- ops->set_rekey_data = brcmf_cfg80211_set_rekey_data;
--#endif
-- wiphy = wiphy_new(ops, sizeof(struct brcmf_cfg80211_info));
-- if (!wiphy) {
-+ cfg = kzalloc(sizeof(*cfg), GFP_KERNEL);
-+ if (!cfg) {
- brcmf_err("Could not allocate wiphy device\n");
-- goto ops_out;
-+ return NULL;
- }
-- memcpy(wiphy->perm_addr, drvr->mac, ETH_ALEN);
-- set_wiphy_dev(wiphy, busdev);
-
-- cfg = wiphy_priv(wiphy);
- cfg->wiphy = wiphy;
-- cfg->ops = ops;
- cfg->pub = drvr;
- init_vif_event(&cfg->vif_event);
- INIT_LIST_HEAD(&cfg->vif_list);
-@@ -6908,6 +6897,7 @@ struct brcmf_cfg80211_info *brcmf_cfg802
- if (IS_ERR(vif))
- goto wiphy_out;
-
-+ ifp = netdev_priv(ndev);
- vif->ifp = ifp;
- vif->wdev.netdev = ndev;
- ndev->ieee80211_ptr = &vif->wdev;
-@@ -6934,6 +6924,11 @@ struct brcmf_cfg80211_info *brcmf_cfg802
- if (err < 0)
- goto priv_out;
-
-+ /* regulatory notifer below needs access to cfg so
-+ * assign it now.
-+ */
-+ drvr->config = cfg;
-+
- brcmf_dbg(INFO, "Registering custom regulatory\n");
- wiphy->reg_notifier = brcmf_cfg80211_reg_notifier;
- wiphy->regulatory_flags |= REGULATORY_CUSTOM_REG;
-@@ -6947,13 +6942,17 @@ struct brcmf_cfg80211_info *brcmf_cfg802
- cap = &wiphy->bands[NL80211_BAND_2GHZ]->ht_cap.cap;
- *cap |= IEEE80211_HT_CAP_SUP_WIDTH_20_40;
- }
-+#ifdef CONFIG_PM
-+ if (brcmf_feat_is_enabled(ifp, BRCMF_FEAT_WOWL_GTK))
-+ ops->set_rekey_data = brcmf_cfg80211_set_rekey_data;
-+#endif
- err = wiphy_register(wiphy);
- if (err < 0) {
- brcmf_err("Could not register wiphy device (%d)\n", err);
- goto priv_out;
- }
-
-- err = brcmf_setup_wiphybands(wiphy);
-+ err = brcmf_setup_wiphybands(cfg);
- if (err) {
- brcmf_err("Setting wiphy bands failed (%d)\n", err);
- goto wiphy_unreg_out;
-@@ -6970,12 +6969,7 @@ struct brcmf_cfg80211_info *brcmf_cfg802
- else
- *cap &= ~IEEE80211_HT_CAP_SUP_WIDTH_20_40;
- }
-- /* p2p might require that "if-events" get processed by fweh. So
-- * activate the already registered event handlers now and activate
-- * the rest when initialization has completed. drvr->config needs to
-- * be assigned before activating events.
-- */
-- drvr->config = cfg;
-+
- err = brcmf_fweh_activate_events(ifp);
- if (err) {
- brcmf_err("FWEH activation failed (%d)\n", err);
-@@ -7043,8 +7037,7 @@ priv_out:
- ifp->vif = NULL;
- wiphy_out:
- brcmf_free_wiphy(wiphy);
--ops_out:
-- kfree(ops);
-+ kfree(cfg);
- return NULL;
- }
-
-@@ -7059,4 +7052,5 @@ void brcmf_cfg80211_detach(struct brcmf_
- kfree(cfg->ops);
- wl_deinit_priv(cfg);
- brcmf_free_wiphy(cfg->wiphy);
-+ kfree(cfg);
- }
---- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.h
-+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.h
-@@ -355,20 +355,24 @@ static inline struct wiphy *cfg_to_wiphy
-
- static inline struct brcmf_cfg80211_info *wiphy_to_cfg(struct wiphy *w)
- {
-- return (struct brcmf_cfg80211_info *)(wiphy_priv(w));
-+ struct brcmf_pub *drvr = wiphy_priv(w);
-+ return drvr->config;
- }
-
- static inline struct brcmf_cfg80211_info *wdev_to_cfg(struct wireless_dev *wd)
- {
-- return (struct brcmf_cfg80211_info *)(wdev_priv(wd));
-+ return wiphy_to_cfg(wd->wiphy);
-+}
-+
-+static inline struct brcmf_cfg80211_vif *wdev_to_vif(struct wireless_dev *wdev)
-+{
-+ return container_of(wdev, struct brcmf_cfg80211_vif, wdev);
- }
-
- static inline
- struct net_device *cfg_to_ndev(struct brcmf_cfg80211_info *cfg)
- {
-- struct brcmf_cfg80211_vif *vif;
-- vif = list_first_entry(&cfg->vif_list, struct brcmf_cfg80211_vif, list);
-- return vif->wdev.netdev;
-+ return brcmf_get_ifp(cfg->pub, 0)->ndev;
- }
-
- static inline struct brcmf_cfg80211_info *ndev_to_cfg(struct net_device *ndev)
-@@ -395,11 +399,12 @@ brcmf_cfg80211_connect_info *cfg_to_conn
- }
-
- struct brcmf_cfg80211_info *brcmf_cfg80211_attach(struct brcmf_pub *drvr,
-- struct device *busdev,
-+ struct cfg80211_ops *ops,
- bool p2pdev_forced);
- void brcmf_cfg80211_detach(struct brcmf_cfg80211_info *cfg);
- s32 brcmf_cfg80211_up(struct net_device *ndev);
- s32 brcmf_cfg80211_down(struct net_device *ndev);
-+struct cfg80211_ops *brcmf_cfg80211_get_ops(void);
- enum nl80211_iftype brcmf_cfg80211_get_iftype(struct brcmf_if *ifp);
-
- struct brcmf_cfg80211_vif *brcmf_alloc_vif(struct brcmf_cfg80211_info *cfg,
---- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/common.c
-+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/common.c
-@@ -252,6 +252,7 @@ int brcmf_c_preinit_dcmds(struct brcmf_i
- brcmf_err("Retreiving cur_etheraddr failed, %d\n", err);
- goto done;
- }
-+ memcpy(ifp->drvr->wiphy->perm_addr, ifp->drvr->mac, ETH_ALEN);
- memcpy(ifp->drvr->mac, ifp->mac_addr, sizeof(ifp->drvr->mac));
-
- bus = ifp->drvr->bus_if;
-@@ -279,6 +280,7 @@ int brcmf_c_preinit_dcmds(struct brcmf_i
- ri->chippkg = le32_to_cpu(revinfo.chippkg);
- ri->nvramrev = le32_to_cpu(revinfo.nvramrev);
-
-+ /* use revinfo if not known yet */
- if (!bus->chip) {
- bus->chip = le32_to_cpu(revinfo.chipnum);
- bus->chiprev = le32_to_cpu(revinfo.chiprev);
---- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/core.c
-+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/core.c
-@@ -1021,7 +1021,7 @@ static int brcmf_revinfo_read(struct seq
- return 0;
- }
-
--static int brcmf_bus_started(struct brcmf_pub *drvr)
-+static int brcmf_bus_started(struct brcmf_pub *drvr, struct cfg80211_ops *ops)
- {
- int ret = -1;
- struct brcmf_bus *bus_if = drvr->bus_if;
-@@ -1060,7 +1060,7 @@ static int brcmf_bus_started(struct brcm
-
- brcmf_proto_add_if(drvr, ifp);
-
-- drvr->config = brcmf_cfg80211_attach(drvr, bus_if->dev,
-+ drvr->config = brcmf_cfg80211_attach(drvr, ops,
- drvr->settings->p2p_enable);
- if (drvr->config == NULL) {
- ret = -ENOMEM;
-@@ -1115,17 +1115,26 @@ fail:
-
- int brcmf_attach(struct device *dev, struct brcmf_mp_device *settings)
- {
-+ struct wiphy *wiphy;
-+ struct cfg80211_ops *ops;
- struct brcmf_pub *drvr = NULL;
- int ret = 0;
- int i;
-
- brcmf_dbg(TRACE, "Enter\n");
-
-- /* Allocate primary brcmf_info */
-- drvr = kzalloc(sizeof(*drvr), GFP_ATOMIC);
-- if (!drvr)
-+ ops = brcmf_cfg80211_get_ops();
-+ if (!ops)
- return -ENOMEM;
-
-+ wiphy = wiphy_new(ops, sizeof(*drvr));
-+ if (!wiphy)
-+ return -ENOMEM;
-+
-+ set_wiphy_dev(wiphy, dev);
-+ drvr = wiphy_priv(wiphy);
-+ drvr->wiphy = wiphy;
-+
- for (i = 0; i < ARRAY_SIZE(drvr->if2bss); i++)
- drvr->if2bss[i] = BRCMF_BSSIDX_INVALID;
-
-@@ -1154,15 +1163,18 @@ int brcmf_attach(struct device *dev, str
- /* attach firmware event handler */
- brcmf_fweh_attach(drvr);
-
-- ret = brcmf_bus_started(drvr);
-+ ret = brcmf_bus_started(drvr, ops);
- if (ret != 0) {
- brcmf_err("dongle is not responding: err=%d\n", ret);
- goto fail;
- }
-+
-+ drvr->config->ops = ops;
- return 0;
-
- fail:
- brcmf_detach(dev);
-+ kfree(ops);
-
- return ret;
- }
-@@ -1220,6 +1232,7 @@ void brcmf_detach(struct device *dev)
- brcmf_remove_interface(drvr->iflist[i], false);
-
- brcmf_cfg80211_detach(drvr->config);
-+ drvr->config = NULL;
-
- brcmf_bus_stop(drvr->bus_if);
-
-@@ -1227,7 +1240,7 @@ void brcmf_detach(struct device *dev)
-
- brcmf_debug_detach(drvr);
- bus_if->drvr = NULL;
-- kfree(drvr);
-+ wiphy_free(drvr->wiphy);
- }
-
- s32 brcmf_iovar_data_set(struct device *dev, char *name, void *data, u32 len)
---- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/core.h
-+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/core.h
-@@ -107,6 +107,7 @@ struct brcmf_pub {
- /* Linkage ponters */
- struct brcmf_bus *bus_if;
- struct brcmf_proto *proto;
-+ struct wiphy *wiphy;
- struct brcmf_cfg80211_info *config;
-
- /* Internal brcmf items */
---- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/p2p.c
-+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/p2p.c
-@@ -2229,7 +2229,7 @@ fail:
- */
- int brcmf_p2p_del_vif(struct wiphy *wiphy, struct wireless_dev *wdev)
- {
-- struct brcmf_cfg80211_info *cfg = wiphy_priv(wiphy);
-+ struct brcmf_cfg80211_info *cfg = wiphy_to_cfg(wiphy);
- struct brcmf_p2p_info *p2p = &cfg->p2p;
- struct brcmf_cfg80211_vif *vif;
- enum nl80211_iftype iftype;
diff --git a/package/kernel/mac80211/patches/327-v4.17-0005-brcmfmac-use-wiphy-debugfs-dir-entry.patch b/package/kernel/mac80211/patches/327-v4.17-0005-brcmfmac-use-wiphy-debugfs-dir-entry.patch
deleted file mode 100644
index c5485c390a..0000000000
--- a/package/kernel/mac80211/patches/327-v4.17-0005-brcmfmac-use-wiphy-debugfs-dir-entry.patch
+++ /dev/null
@@ -1,349 +0,0 @@
-From 34789d0cf682c643862792750a06c31ccf016cbc Mon Sep 17 00:00:00 2001
-From: Arend Van Spriel <arend.vanspriel@broadcom.com>
-Date: Thu, 22 Mar 2018 21:28:24 +0100
-Subject: [PATCH] brcmfmac: use wiphy debugfs dir entry
-
-The driver used to create a brcmfmac dir entry at the top level
-debugfs mount point. This moves the debugfs entries into the
-wiphy debugfs dir entry.
-
-Reviewed-by: Hante Meuleman <hante.meuleman@broadcom.com>
-Reviewed-by: Pieter-Paul Giesberts <pieter-paul.giesberts@broadcom.com>
-Reviewed-by: Franky Lin <franky.lin@broadcom.com>
-Signed-off-by: Arend van Spriel <arend.vanspriel@broadcom.com>
-Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
----
- .../wireless/broadcom/brcm80211/brcmfmac/bcdc.c | 6 ++++
- .../wireless/broadcom/brcm80211/brcmfmac/common.c | 5 ---
- .../wireless/broadcom/brcm80211/brcmfmac/core.c | 11 +++---
- .../wireless/broadcom/brcm80211/brcmfmac/debug.c | 42 ++--------------------
- .../wireless/broadcom/brcm80211/brcmfmac/debug.h | 17 ---------
- .../wireless/broadcom/brcm80211/brcmfmac/feature.c | 3 ++
- .../wireless/broadcom/brcm80211/brcmfmac/feature.h | 7 ++++
- .../broadcom/brcm80211/brcmfmac/fwsignal.c | 11 +++---
- .../broadcom/brcm80211/brcmfmac/fwsignal.h | 1 +
- .../wireless/broadcom/brcm80211/brcmfmac/msgbuf.c | 8 +++--
- .../wireless/broadcom/brcm80211/brcmfmac/proto.c | 3 +-
- .../wireless/broadcom/brcm80211/brcmfmac/proto.h | 7 ++++
- 12 files changed, 47 insertions(+), 74 deletions(-)
-
---- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/bcdc.c
-+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/bcdc.c
-@@ -445,6 +445,11 @@ brcmf_proto_bcdc_init_done(struct brcmf_
- return 0;
- }
-
-+static void brcmf_proto_bcdc_debugfs_create(struct brcmf_pub *drvr)
-+{
-+ brcmf_fws_debugfs_create(drvr);
-+}
-+
- int brcmf_proto_bcdc_attach(struct brcmf_pub *drvr)
- {
- struct brcmf_bcdc *bcdc;
-@@ -472,6 +477,7 @@ int brcmf_proto_bcdc_attach(struct brcmf
- drvr->proto->del_if = brcmf_proto_bcdc_del_if;
- drvr->proto->reset_if = brcmf_proto_bcdc_reset_if;
- drvr->proto->init_done = brcmf_proto_bcdc_init_done;
-+ drvr->proto->debugfs_create = brcmf_proto_bcdc_debugfs_create;
- drvr->proto->pd = bcdc;
-
- drvr->hdrlen += BCDC_HEADER_LEN + BRCMF_PROT_FW_SIGNAL_MAX_TXBYTES;
---- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/common.c
-+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/common.c
-@@ -529,9 +529,6 @@ static int __init brcmfmac_module_init(v
- {
- int err;
-
-- /* Initialize debug system first */
-- brcmf_debugfs_init();
--
- /* Get the platform data (if available) for our devices */
- err = platform_driver_probe(&brcmf_pd, brcmf_common_pd_probe);
- if (err == -ENODEV)
-@@ -543,7 +540,6 @@ static int __init brcmfmac_module_init(v
- /* Continue the initialization by registering the different busses */
- err = brcmf_core_init();
- if (err) {
-- brcmf_debugfs_exit();
- if (brcmfmac_pdata)
- platform_driver_unregister(&brcmf_pd);
- }
-@@ -556,7 +552,6 @@ static void __exit brcmfmac_module_exit(
- brcmf_core_exit();
- if (brcmfmac_pdata)
- platform_driver_unregister(&brcmf_pd);
-- brcmf_debugfs_exit();
- }
-
- module_init(brcmfmac_module_init);
---- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/core.c
-+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/core.c
-@@ -1050,8 +1050,6 @@ static int brcmf_bus_started(struct brcm
- if (ret < 0)
- goto fail;
-
-- brcmf_debugfs_add_entry(drvr, "revinfo", brcmf_revinfo_read);
--
- brcmf_feat_attach(drvr);
-
- ret = brcmf_proto_init_done(drvr);
-@@ -1094,6 +1092,11 @@ static int brcmf_bus_started(struct brcm
- #endif
- #endif /* CONFIG_INET */
-
-+ /* populate debugfs */
-+ brcmf_debugfs_add_entry(drvr, "revinfo", brcmf_revinfo_read);
-+ brcmf_feat_debugfs_create(drvr);
-+ brcmf_proto_debugfs_create(drvr);
-+
- return 0;
-
- fail:
-@@ -1146,9 +1149,6 @@ int brcmf_attach(struct device *dev, str
- drvr->bus_if->drvr = drvr;
- drvr->settings = settings;
-
-- /* attach debug facilities */
-- brcmf_debug_attach(drvr);
--
- /* Attach and link in the protocol */
- ret = brcmf_proto_attach(drvr);
- if (ret != 0) {
-@@ -1238,7 +1238,6 @@ void brcmf_detach(struct device *dev)
-
- brcmf_proto_detach(drvr);
-
-- brcmf_debug_detach(drvr);
- bus_if->drvr = NULL;
- wiphy_free(drvr->wiphy);
- }
---- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/debug.c
-+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/debug.c
-@@ -25,8 +25,6 @@
- #include "fweh.h"
- #include "debug.h"
-
--static struct dentry *root_folder;
--
- int brcmf_debug_create_memdump(struct brcmf_bus *bus, const void *data,
- size_t len)
- {
-@@ -54,44 +52,9 @@ int brcmf_debug_create_memdump(struct br
- return 0;
- }
-
--void brcmf_debugfs_init(void)
--{
-- root_folder = debugfs_create_dir(KBUILD_MODNAME, NULL);
-- if (IS_ERR(root_folder))
-- root_folder = NULL;
--}
--
--void brcmf_debugfs_exit(void)
--{
-- if (!root_folder)
-- return;
--
-- debugfs_remove_recursive(root_folder);
-- root_folder = NULL;
--}
--
--int brcmf_debug_attach(struct brcmf_pub *drvr)
--{
-- struct device *dev = drvr->bus_if->dev;
--
-- if (!root_folder)
-- return -ENODEV;
--
-- drvr->dbgfs_dir = debugfs_create_dir(dev_name(dev), root_folder);
-- return PTR_ERR_OR_ZERO(drvr->dbgfs_dir);
--}
--
--void brcmf_debug_detach(struct brcmf_pub *drvr)
--{
-- brcmf_fweh_unregister(drvr, BRCMF_E_PSM_WATCHDOG);
--
-- if (!IS_ERR_OR_NULL(drvr->dbgfs_dir))
-- debugfs_remove_recursive(drvr->dbgfs_dir);
--}
--
- struct dentry *brcmf_debugfs_get_devdir(struct brcmf_pub *drvr)
- {
-- return drvr->dbgfs_dir;
-+ return drvr->wiphy->debugfsdir;
- }
-
- int brcmf_debugfs_add_entry(struct brcmf_pub *drvr, const char *fn,
-@@ -99,7 +62,8 @@ int brcmf_debugfs_add_entry(struct brcmf
- {
- struct dentry *e;
-
-+ WARN(!drvr->wiphy->debugfsdir, "wiphy not (yet) registered\n");
- e = debugfs_create_devm_seqfile(drvr->bus_if->dev, fn,
-- drvr->dbgfs_dir, read_fn);
-+ drvr->wiphy->debugfsdir, read_fn);
- return PTR_ERR_OR_ZERO(e);
- }
---- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/debug.h
-+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/debug.h
-@@ -113,29 +113,12 @@ extern int brcmf_msg_level;
- struct brcmf_bus;
- struct brcmf_pub;
- #ifdef DEBUG
--void brcmf_debugfs_init(void);
--void brcmf_debugfs_exit(void);
--int brcmf_debug_attach(struct brcmf_pub *drvr);
--void brcmf_debug_detach(struct brcmf_pub *drvr);
- struct dentry *brcmf_debugfs_get_devdir(struct brcmf_pub *drvr);
- int brcmf_debugfs_add_entry(struct brcmf_pub *drvr, const char *fn,
- int (*read_fn)(struct seq_file *seq, void *data));
- int brcmf_debug_create_memdump(struct brcmf_bus *bus, const void *data,
- size_t len);
- #else
--static inline void brcmf_debugfs_init(void)
--{
--}
--static inline void brcmf_debugfs_exit(void)
--{
--}
--static inline int brcmf_debug_attach(struct brcmf_pub *drvr)
--{
-- return 0;
--}
--static inline void brcmf_debug_detach(struct brcmf_pub *drvr)
--{
--}
- static inline
- int brcmf_debugfs_add_entry(struct brcmf_pub *drvr, const char *fn,
- int (*read_fn)(struct seq_file *seq, void *data))
---- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/feature.c
-+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/feature.c
-@@ -228,7 +228,10 @@ void brcmf_feat_attach(struct brcmf_pub
- /* no quirks */
- break;
- }
-+}
-
-+void brcmf_feat_debugfs_create(struct brcmf_pub *drvr)
-+{
- brcmf_debugfs_add_entry(drvr, "features", brcmf_feat_debugfs_read);
- }
-
---- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/feature.h
-+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/feature.h
-@@ -90,6 +90,13 @@ enum brcmf_feat_quirk {
- void brcmf_feat_attach(struct brcmf_pub *drvr);
-
- /**
-+ * brcmf_feat_debugfs_create() - create debugfs entries.
-+ *
-+ * @drvr: driver instance.
-+ */
-+void brcmf_feat_debugfs_create(struct brcmf_pub *drvr);
-+
-+/**
- * brcmf_feat_is_enabled() - query feature.
- *
- * @ifp: interface instance.
---- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/fwsignal.c
-+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/fwsignal.c
-@@ -2399,10 +2399,6 @@ struct brcmf_fws_info *brcmf_fws_attach(
- brcmu_pktq_init(&fws->desc.other.psq, BRCMF_FWS_PSQ_PREC_COUNT,
- BRCMF_FWS_PSQ_LEN);
-
-- /* create debugfs file for statistics */
-- brcmf_debugfs_add_entry(drvr, "fws_stats",
-- brcmf_debugfs_fws_stats_read);
--
- brcmf_dbg(INFO, "%s bdcv2 tlv signaling [%x]\n",
- fws->fw_signals ? "enabled" : "disabled", tlv);
- return fws;
-@@ -2429,6 +2425,13 @@ void brcmf_fws_detach(struct brcmf_fws_i
- kfree(fws);
- }
-
-+void brcmf_fws_debugfs_create(struct brcmf_pub *drvr)
-+{
-+ /* create debugfs file for statistics */
-+ brcmf_debugfs_add_entry(drvr, "fws_stats",
-+ brcmf_debugfs_fws_stats_read);
-+}
-+
- bool brcmf_fws_queue_skbs(struct brcmf_fws_info *fws)
- {
- return !fws->avoid_queueing;
---- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/fwsignal.h
-+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/fwsignal.h
-@@ -20,6 +20,7 @@
-
- struct brcmf_fws_info *brcmf_fws_attach(struct brcmf_pub *drvr);
- void brcmf_fws_detach(struct brcmf_fws_info *fws);
-+void brcmf_fws_debugfs_create(struct brcmf_pub *drvr);
- bool brcmf_fws_queue_skbs(struct brcmf_fws_info *fws);
- bool brcmf_fws_fc_active(struct brcmf_fws_info *fws);
- void brcmf_fws_hdrpull(struct brcmf_if *ifp, s16 siglen, struct sk_buff *skb);
---- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/msgbuf.c
-+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/msgbuf.c
-@@ -1418,6 +1418,11 @@ static int brcmf_msgbuf_stats_read(struc
- }
- #endif
-
-+static void brcmf_msgbuf_debugfs_create(struct brcmf_pub *drvr)
-+{
-+ brcmf_debugfs_add_entry(drvr, "msgbuf_stats", brcmf_msgbuf_stats_read);
-+}
-+
- int brcmf_proto_msgbuf_attach(struct brcmf_pub *drvr)
- {
- struct brcmf_bus_msgbuf *if_msgbuf;
-@@ -1472,6 +1477,7 @@ int brcmf_proto_msgbuf_attach(struct brc
- drvr->proto->delete_peer = brcmf_msgbuf_delete_peer;
- drvr->proto->add_tdls_peer = brcmf_msgbuf_add_tdls_peer;
- drvr->proto->rxreorder = brcmf_msgbuf_rxreorder;
-+ drvr->proto->debugfs_create = brcmf_msgbuf_debugfs_create;
- drvr->proto->pd = msgbuf;
-
- init_waitqueue_head(&msgbuf->ioctl_resp_wait);
-@@ -1525,8 +1531,6 @@ int brcmf_proto_msgbuf_attach(struct brc
- spin_lock_init(&msgbuf->flowring_work_lock);
- INIT_LIST_HEAD(&msgbuf->work_queue);
-
-- brcmf_debugfs_add_entry(drvr, "msgbuf_stats", brcmf_msgbuf_stats_read);
--
- return 0;
-
- fail:
---- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/proto.c
-+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/proto.c
-@@ -54,7 +54,8 @@ int brcmf_proto_attach(struct brcmf_pub
- if (!proto->tx_queue_data || (proto->hdrpull == NULL) ||
- (proto->query_dcmd == NULL) || (proto->set_dcmd == NULL) ||
- (proto->configure_addr_mode == NULL) ||
-- (proto->delete_peer == NULL) || (proto->add_tdls_peer == NULL)) {
-+ (proto->delete_peer == NULL) || (proto->add_tdls_peer == NULL) ||
-+ (proto->debugfs_create == NULL)) {
- brcmf_err("Not all proto handlers have been installed\n");
- goto fail;
- }
---- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/proto.h
-+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/proto.h
-@@ -48,6 +48,7 @@ struct brcmf_proto {
- void (*del_if)(struct brcmf_if *ifp);
- void (*reset_if)(struct brcmf_if *ifp);
- int (*init_done)(struct brcmf_pub *drvr);
-+ void (*debugfs_create)(struct brcmf_pub *drvr);
- void *pd;
- };
-
-@@ -156,4 +157,10 @@ brcmf_proto_init_done(struct brcmf_pub *
- return drvr->proto->init_done(drvr);
- }
-
-+static inline void
-+brcmf_proto_debugfs_create(struct brcmf_pub *drvr)
-+{
-+ drvr->proto->debugfs_create(drvr);
-+}
-+
- #endif /* BRCMFMAC_PROTO_H */
diff --git a/package/kernel/mac80211/patches/327-v4.17-0006-brcmfmac-derive-firmware-filenames-from-basename-map.patch b/package/kernel/mac80211/patches/327-v4.17-0006-brcmfmac-derive-firmware-filenames-from-basename-map.patch
deleted file mode 100644
index 0b1ae56bc0..0000000000
--- a/package/kernel/mac80211/patches/327-v4.17-0006-brcmfmac-derive-firmware-filenames-from-basename-map.patch
+++ /dev/null
@@ -1,286 +0,0 @@
-From 41f573dbb534f14e62a4a5411f602c970cad1d77 Mon Sep 17 00:00:00 2001
-From: Arend Van Spriel <arend.vanspriel@broadcom.com>
-Date: Thu, 22 Mar 2018 21:28:25 +0100
-Subject: [PATCH] brcmfmac: derive firmware filenames from basename mapping
-
-Instead of defining individual filenames for firmware and nvram
-use a basename and derive the names from that.
-
-Reviewed-by: Hante Meuleman <hante.meuleman@broadcom.com>
-Reviewed-by: Pieter-Paul Giesberts <pieter-paul.giesberts@broadcom.com>
-Reviewed-by: Franky Lin <franky.lin@broadcom.com>
-Signed-off-by: Arend van Spriel <arend.vanspriel@broadcom.com>
-Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
----
- .../broadcom/brcm80211/brcmfmac/firmware.c | 31 ++++++---
- .../broadcom/brcm80211/brcmfmac/firmware.h | 24 ++-----
- .../wireless/broadcom/brcm80211/brcmfmac/pcie.c | 56 ++++++++---------
- .../wireless/broadcom/brcm80211/brcmfmac/sdio.c | 73 +++++++++++-----------
- .../net/wireless/broadcom/brcm80211/brcmfmac/usb.c | 10 +--
- 5 files changed, 96 insertions(+), 98 deletions(-)
-
---- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/firmware.c
-+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/firmware.c
-@@ -563,6 +563,13 @@ int brcmf_fw_get_firmwares(struct device
- 0);
- }
-
-+static void brcmf_fw_get_full_name(char fw_name[BRCMF_FW_NAME_LEN],
-+ const char *fw_base, const char *extension)
-+{
-+ strlcat(fw_name, fw_base, BRCMF_FW_NAME_LEN);
-+ strlcat(fw_name, extension, BRCMF_FW_NAME_LEN);
-+}
-+
- int brcmf_fw_map_chip_to_name(u32 chip, u32 chiprev,
- struct brcmf_firmware_mapping mapping_table[],
- u32 table_size, char fw_name[BRCMF_FW_NAME_LEN],
-@@ -587,25 +594,31 @@ int brcmf_fw_map_chip_to_name(u32 chip,
-
- /* check if firmware path is provided by module parameter */
- if (brcmf_mp_global.firmware_path[0] != '\0') {
-- strlcpy(fw_name, brcmf_mp_global.firmware_path,
-- BRCMF_FW_NAME_LEN);
-- if ((nvram_name) && (mapping_table[i].nvram))
-+ if (fw_name)
-+ strlcpy(fw_name, brcmf_mp_global.firmware_path,
-+ BRCMF_FW_NAME_LEN);
-+ if (nvram_name)
- strlcpy(nvram_name, brcmf_mp_global.firmware_path,
- BRCMF_FW_NAME_LEN);
-
- end = brcmf_mp_global.firmware_path[
- strlen(brcmf_mp_global.firmware_path) - 1];
- if (end != '/') {
-- strlcat(fw_name, "/", BRCMF_FW_NAME_LEN);
-- if ((nvram_name) && (mapping_table[i].nvram))
-+ if (fw_name)
-+ strlcat(fw_name, "/", BRCMF_FW_NAME_LEN);
-+ if (nvram_name)
- strlcat(nvram_name, "/", BRCMF_FW_NAME_LEN);
- }
- }
-- strlcat(fw_name, mapping_table[i].fw, BRCMF_FW_NAME_LEN);
-- if ((nvram_name) && (mapping_table[i].nvram))
-- strlcat(nvram_name, mapping_table[i].nvram, BRCMF_FW_NAME_LEN);
-
-- brcmf_info("using %s for chip %s\n", fw_name, chipname);
-+ brcmf_info("using %s for chip %s\n",
-+ mapping_table[i].fw_base, chipname);
-+ if (fw_name)
-+ brcmf_fw_get_full_name(fw_name,
-+ mapping_table[i].fw_base, ".bin");
-+ if (nvram_name)
-+ brcmf_fw_get_full_name(nvram_name,
-+ mapping_table[i].fw_base, ".txt");
-
- return 0;
- }
---- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/firmware.h
-+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/firmware.h
-@@ -38,28 +38,16 @@
- struct brcmf_firmware_mapping {
- u32 chipid;
- u32 revmask;
-- const char *fw;
-- const char *nvram;
-+ const char *fw_base;
- };
-
--#define BRCMF_FW_NVRAM_DEF(fw_nvram_name, fw, nvram) \
--static const char BRCM_ ## fw_nvram_name ## _FIRMWARE_NAME[] = \
-- BRCMF_FW_DEFAULT_PATH fw; \
--static const char BRCM_ ## fw_nvram_name ## _NVRAM_NAME[] = \
-- BRCMF_FW_DEFAULT_PATH nvram; \
--MODULE_FIRMWARE(BRCMF_FW_DEFAULT_PATH fw);
--
--#define BRCMF_FW_DEF(fw_name, fw) \
--static const char BRCM_ ## fw_name ## _FIRMWARE_NAME[] = \
-- BRCMF_FW_DEFAULT_PATH fw; \
--MODULE_FIRMWARE(BRCMF_FW_DEFAULT_PATH fw) \
--
--#define BRCMF_FW_NVRAM_ENTRY(chipid, mask, name) \
-- { chipid, mask, \
-- BRCM_ ## name ## _FIRMWARE_NAME, BRCM_ ## name ## _NVRAM_NAME }
-+#define BRCMF_FW_DEF(fw_name, fw_base) \
-+static const char BRCM_ ## fw_name ## _FIRMWARE_BASENAME[] = \
-+ BRCMF_FW_DEFAULT_PATH fw_base; \
-+MODULE_FIRMWARE(BRCMF_FW_DEFAULT_PATH fw_base ".bin")
-
- #define BRCMF_FW_ENTRY(chipid, mask, name) \
-- { chipid, mask, BRCM_ ## name ## _FIRMWARE_NAME, NULL }
-+ { chipid, mask, BRCM_ ## name ## _FIRMWARE_BASENAME }
-
- int brcmf_fw_map_chip_to_name(u32 chip, u32 chiprev,
- struct brcmf_firmware_mapping mapping_table[],
---- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/pcie.c
-+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/pcie.c
-@@ -46,36 +46,36 @@ enum brcmf_pcie_state {
- BRCMFMAC_PCIE_STATE_UP
- };
-
--BRCMF_FW_NVRAM_DEF(43602, "brcmfmac43602-pcie.bin", "brcmfmac43602-pcie.txt");
--BRCMF_FW_NVRAM_DEF(4350, "brcmfmac4350-pcie.bin", "brcmfmac4350-pcie.txt");
--BRCMF_FW_NVRAM_DEF(4350C, "brcmfmac4350c2-pcie.bin", "brcmfmac4350c2-pcie.txt");
--BRCMF_FW_NVRAM_DEF(4356, "brcmfmac4356-pcie.bin", "brcmfmac4356-pcie.txt");
--BRCMF_FW_NVRAM_DEF(43570, "brcmfmac43570-pcie.bin", "brcmfmac43570-pcie.txt");
--BRCMF_FW_NVRAM_DEF(4358, "brcmfmac4358-pcie.bin", "brcmfmac4358-pcie.txt");
--BRCMF_FW_NVRAM_DEF(4359, "brcmfmac4359-pcie.bin", "brcmfmac4359-pcie.txt");
--BRCMF_FW_NVRAM_DEF(4365B, "brcmfmac4365b-pcie.bin", "brcmfmac4365b-pcie.txt");
--BRCMF_FW_NVRAM_DEF(4365C, "brcmfmac4365c-pcie.bin", "brcmfmac4365c-pcie.txt");
--BRCMF_FW_NVRAM_DEF(4366B, "brcmfmac4366b-pcie.bin", "brcmfmac4366b-pcie.txt");
--BRCMF_FW_NVRAM_DEF(4366C, "brcmfmac4366c-pcie.bin", "brcmfmac4366c-pcie.txt");
--BRCMF_FW_NVRAM_DEF(4371, "brcmfmac4371-pcie.bin", "brcmfmac4371-pcie.txt");
-+BRCMF_FW_DEF(43602, "brcmfmac43602-pcie");
-+BRCMF_FW_DEF(4350, "brcmfmac4350-pcie");
-+BRCMF_FW_DEF(4350C, "brcmfmac4350c2-pcie");
-+BRCMF_FW_DEF(4356, "brcmfmac4356-pcie");
-+BRCMF_FW_DEF(43570, "brcmfmac43570-pcie");
-+BRCMF_FW_DEF(4358, "brcmfmac4358-pcie");
-+BRCMF_FW_DEF(4359, "brcmfmac4359-pcie");
-+BRCMF_FW_DEF(4365B, "brcmfmac4365b-pcie");
-+BRCMF_FW_DEF(4365C, "brcmfmac4365c-pcie");
-+BRCMF_FW_DEF(4366B, "brcmfmac4366b-pcie");
-+BRCMF_FW_DEF(4366C, "brcmfmac4366c-pcie");
-+BRCMF_FW_DEF(4371, "brcmfmac4371-pcie");
-
- static struct brcmf_firmware_mapping brcmf_pcie_fwnames[] = {
-- BRCMF_FW_NVRAM_ENTRY(BRCM_CC_43602_CHIP_ID, 0xFFFFFFFF, 43602),
-- BRCMF_FW_NVRAM_ENTRY(BRCM_CC_43465_CHIP_ID, 0xFFFFFFF0, 4366C),
-- BRCMF_FW_NVRAM_ENTRY(BRCM_CC_4350_CHIP_ID, 0x000000FF, 4350C),
-- BRCMF_FW_NVRAM_ENTRY(BRCM_CC_4350_CHIP_ID, 0xFFFFFF00, 4350),
-- BRCMF_FW_NVRAM_ENTRY(BRCM_CC_43525_CHIP_ID, 0xFFFFFFF0, 4365C),
-- BRCMF_FW_NVRAM_ENTRY(BRCM_CC_4356_CHIP_ID, 0xFFFFFFFF, 4356),
-- BRCMF_FW_NVRAM_ENTRY(BRCM_CC_43567_CHIP_ID, 0xFFFFFFFF, 43570),
-- BRCMF_FW_NVRAM_ENTRY(BRCM_CC_43569_CHIP_ID, 0xFFFFFFFF, 43570),
-- BRCMF_FW_NVRAM_ENTRY(BRCM_CC_43570_CHIP_ID, 0xFFFFFFFF, 43570),
-- BRCMF_FW_NVRAM_ENTRY(BRCM_CC_4358_CHIP_ID, 0xFFFFFFFF, 4358),
-- BRCMF_FW_NVRAM_ENTRY(BRCM_CC_4359_CHIP_ID, 0xFFFFFFFF, 4359),
-- BRCMF_FW_NVRAM_ENTRY(BRCM_CC_4365_CHIP_ID, 0x0000000F, 4365B),
-- BRCMF_FW_NVRAM_ENTRY(BRCM_CC_4365_CHIP_ID, 0xFFFFFFF0, 4365C),
-- BRCMF_FW_NVRAM_ENTRY(BRCM_CC_4366_CHIP_ID, 0x0000000F, 4366B),
-- BRCMF_FW_NVRAM_ENTRY(BRCM_CC_4366_CHIP_ID, 0xFFFFFFF0, 4366C),
-- BRCMF_FW_NVRAM_ENTRY(BRCM_CC_4371_CHIP_ID, 0xFFFFFFFF, 4371),
-+ BRCMF_FW_ENTRY(BRCM_CC_43602_CHIP_ID, 0xFFFFFFFF, 43602),
-+ BRCMF_FW_ENTRY(BRCM_CC_43465_CHIP_ID, 0xFFFFFFF0, 4366C),
-+ BRCMF_FW_ENTRY(BRCM_CC_4350_CHIP_ID, 0x000000FF, 4350C),
-+ BRCMF_FW_ENTRY(BRCM_CC_4350_CHIP_ID, 0xFFFFFF00, 4350),
-+ BRCMF_FW_ENTRY(BRCM_CC_43525_CHIP_ID, 0xFFFFFFF0, 4365C),
-+ BRCMF_FW_ENTRY(BRCM_CC_4356_CHIP_ID, 0xFFFFFFFF, 4356),
-+ BRCMF_FW_ENTRY(BRCM_CC_43567_CHIP_ID, 0xFFFFFFFF, 43570),
-+ BRCMF_FW_ENTRY(BRCM_CC_43569_CHIP_ID, 0xFFFFFFFF, 43570),
-+ BRCMF_FW_ENTRY(BRCM_CC_43570_CHIP_ID, 0xFFFFFFFF, 43570),
-+ BRCMF_FW_ENTRY(BRCM_CC_4358_CHIP_ID, 0xFFFFFFFF, 4358),
-+ BRCMF_FW_ENTRY(BRCM_CC_4359_CHIP_ID, 0xFFFFFFFF, 4359),
-+ BRCMF_FW_ENTRY(BRCM_CC_4365_CHIP_ID, 0x0000000F, 4365B),
-+ BRCMF_FW_ENTRY(BRCM_CC_4365_CHIP_ID, 0xFFFFFFF0, 4365C),
-+ BRCMF_FW_ENTRY(BRCM_CC_4366_CHIP_ID, 0x0000000F, 4366B),
-+ BRCMF_FW_ENTRY(BRCM_CC_4366_CHIP_ID, 0xFFFFFFF0, 4366C),
-+ BRCMF_FW_ENTRY(BRCM_CC_4371_CHIP_ID, 0xFFFFFFFF, 4371),
- };
-
- #define BRCMF_PCIE_FW_UP_TIMEOUT 2000 /* msec */
---- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c
-+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c
-@@ -600,47 +600,44 @@ static const struct sdiod_drive_str sdio
- {4, 0x1}
- };
-
--BRCMF_FW_NVRAM_DEF(43143, "brcmfmac43143-sdio.bin", "brcmfmac43143-sdio.txt");
--BRCMF_FW_NVRAM_DEF(43241B0, "brcmfmac43241b0-sdio.bin",
-- "brcmfmac43241b0-sdio.txt");
--BRCMF_FW_NVRAM_DEF(43241B4, "brcmfmac43241b4-sdio.bin",
-- "brcmfmac43241b4-sdio.txt");
--BRCMF_FW_NVRAM_DEF(43241B5, "brcmfmac43241b5-sdio.bin",
-- "brcmfmac43241b5-sdio.txt");
--BRCMF_FW_NVRAM_DEF(4329, "brcmfmac4329-sdio.bin", "brcmfmac4329-sdio.txt");
--BRCMF_FW_NVRAM_DEF(4330, "brcmfmac4330-sdio.bin", "brcmfmac4330-sdio.txt");
--BRCMF_FW_NVRAM_DEF(4334, "brcmfmac4334-sdio.bin", "brcmfmac4334-sdio.txt");
--BRCMF_FW_NVRAM_DEF(43340, "brcmfmac43340-sdio.bin", "brcmfmac43340-sdio.txt");
--BRCMF_FW_NVRAM_DEF(4335, "brcmfmac4335-sdio.bin", "brcmfmac4335-sdio.txt");
--BRCMF_FW_NVRAM_DEF(43362, "brcmfmac43362-sdio.bin", "brcmfmac43362-sdio.txt");
--BRCMF_FW_NVRAM_DEF(4339, "brcmfmac4339-sdio.bin", "brcmfmac4339-sdio.txt");
--BRCMF_FW_NVRAM_DEF(43430A0, "brcmfmac43430a0-sdio.bin", "brcmfmac43430a0-sdio.txt");
-+BRCMF_FW_DEF(43143, "brcmfmac43143-sdio");
-+BRCMF_FW_DEF(43241B0, "brcmfmac43241b0-sdio");
-+BRCMF_FW_DEF(43241B4, "brcmfmac43241b4-sdio");
-+BRCMF_FW_DEF(43241B5, "brcmfmac43241b5-sdio");
-+BRCMF_FW_DEF(4329, "brcmfmac4329-sdio");
-+BRCMF_FW_DEF(4330, "brcmfmac4330-sdio");
-+BRCMF_FW_DEF(4334, "brcmfmac4334-sdio");
-+BRCMF_FW_DEF(43340, "brcmfmac43340-sdio");
-+BRCMF_FW_DEF(4335, "brcmfmac4335-sdio");
-+BRCMF_FW_DEF(43362, "brcmfmac43362-sdio");
-+BRCMF_FW_DEF(4339, "brcmfmac4339-sdio");
-+BRCMF_FW_DEF(43430A0, "brcmfmac43430a0-sdio");
- /* Note the names are not postfixed with a1 for backward compatibility */
--BRCMF_FW_NVRAM_DEF(43430A1, "brcmfmac43430-sdio.bin", "brcmfmac43430-sdio.txt");
--BRCMF_FW_NVRAM_DEF(43455, "brcmfmac43455-sdio.bin", "brcmfmac43455-sdio.txt");
--BRCMF_FW_NVRAM_DEF(4354, "brcmfmac4354-sdio.bin", "brcmfmac4354-sdio.txt");
--BRCMF_FW_NVRAM_DEF(4356, "brcmfmac4356-sdio.bin", "brcmfmac4356-sdio.txt");
--BRCMF_FW_NVRAM_DEF(4373, "brcmfmac4373-sdio.bin", "brcmfmac4373-sdio.txt");
-+BRCMF_FW_DEF(43430A1, "brcmfmac43430-sdio");
-+BRCMF_FW_DEF(43455, "brcmfmac43455-sdio");
-+BRCMF_FW_DEF(4354, "brcmfmac4354-sdio");
-+BRCMF_FW_DEF(4356, "brcmfmac4356-sdio");
-+BRCMF_FW_DEF(4373, "brcmfmac4373-sdio");
-
- static struct brcmf_firmware_mapping brcmf_sdio_fwnames[] = {
-- BRCMF_FW_NVRAM_ENTRY(BRCM_CC_43143_CHIP_ID, 0xFFFFFFFF, 43143),
-- BRCMF_FW_NVRAM_ENTRY(BRCM_CC_43241_CHIP_ID, 0x0000001F, 43241B0),
-- BRCMF_FW_NVRAM_ENTRY(BRCM_CC_43241_CHIP_ID, 0x00000020, 43241B4),
-- BRCMF_FW_NVRAM_ENTRY(BRCM_CC_43241_CHIP_ID, 0xFFFFFFC0, 43241B5),
-- BRCMF_FW_NVRAM_ENTRY(BRCM_CC_4329_CHIP_ID, 0xFFFFFFFF, 4329),
-- BRCMF_FW_NVRAM_ENTRY(BRCM_CC_4330_CHIP_ID, 0xFFFFFFFF, 4330),
-- BRCMF_FW_NVRAM_ENTRY(BRCM_CC_4334_CHIP_ID, 0xFFFFFFFF, 4334),
-- BRCMF_FW_NVRAM_ENTRY(BRCM_CC_43340_CHIP_ID, 0xFFFFFFFF, 43340),
-- BRCMF_FW_NVRAM_ENTRY(BRCM_CC_43341_CHIP_ID, 0xFFFFFFFF, 43340),
-- BRCMF_FW_NVRAM_ENTRY(BRCM_CC_4335_CHIP_ID, 0xFFFFFFFF, 4335),
-- BRCMF_FW_NVRAM_ENTRY(BRCM_CC_43362_CHIP_ID, 0xFFFFFFFE, 43362),
-- BRCMF_FW_NVRAM_ENTRY(BRCM_CC_4339_CHIP_ID, 0xFFFFFFFF, 4339),
-- BRCMF_FW_NVRAM_ENTRY(BRCM_CC_43430_CHIP_ID, 0x00000001, 43430A0),
-- BRCMF_FW_NVRAM_ENTRY(BRCM_CC_43430_CHIP_ID, 0xFFFFFFFE, 43430A1),
-- BRCMF_FW_NVRAM_ENTRY(BRCM_CC_4345_CHIP_ID, 0xFFFFFFC0, 43455),
-- BRCMF_FW_NVRAM_ENTRY(BRCM_CC_4354_CHIP_ID, 0xFFFFFFFF, 4354),
-- BRCMF_FW_NVRAM_ENTRY(BRCM_CC_4356_CHIP_ID, 0xFFFFFFFF, 4356),
-- BRCMF_FW_NVRAM_ENTRY(CY_CC_4373_CHIP_ID, 0xFFFFFFFF, 4373)
-+ BRCMF_FW_ENTRY(BRCM_CC_43143_CHIP_ID, 0xFFFFFFFF, 43143),
-+ BRCMF_FW_ENTRY(BRCM_CC_43241_CHIP_ID, 0x0000001F, 43241B0),
-+ BRCMF_FW_ENTRY(BRCM_CC_43241_CHIP_ID, 0x00000020, 43241B4),
-+ BRCMF_FW_ENTRY(BRCM_CC_43241_CHIP_ID, 0xFFFFFFC0, 43241B5),
-+ BRCMF_FW_ENTRY(BRCM_CC_4329_CHIP_ID, 0xFFFFFFFF, 4329),
-+ BRCMF_FW_ENTRY(BRCM_CC_4330_CHIP_ID, 0xFFFFFFFF, 4330),
-+ BRCMF_FW_ENTRY(BRCM_CC_4334_CHIP_ID, 0xFFFFFFFF, 4334),
-+ BRCMF_FW_ENTRY(BRCM_CC_43340_CHIP_ID, 0xFFFFFFFF, 43340),
-+ BRCMF_FW_ENTRY(BRCM_CC_43341_CHIP_ID, 0xFFFFFFFF, 43340),
-+ BRCMF_FW_ENTRY(BRCM_CC_4335_CHIP_ID, 0xFFFFFFFF, 4335),
-+ BRCMF_FW_ENTRY(BRCM_CC_43362_CHIP_ID, 0xFFFFFFFE, 43362),
-+ BRCMF_FW_ENTRY(BRCM_CC_4339_CHIP_ID, 0xFFFFFFFF, 4339),
-+ BRCMF_FW_ENTRY(BRCM_CC_43430_CHIP_ID, 0x00000001, 43430A0),
-+ BRCMF_FW_ENTRY(BRCM_CC_43430_CHIP_ID, 0xFFFFFFFE, 43430A1),
-+ BRCMF_FW_ENTRY(BRCM_CC_4345_CHIP_ID, 0xFFFFFFC0, 43455),
-+ BRCMF_FW_ENTRY(BRCM_CC_4354_CHIP_ID, 0xFFFFFFFF, 4354),
-+ BRCMF_FW_ENTRY(BRCM_CC_4356_CHIP_ID, 0xFFFFFFFF, 4356),
-+ BRCMF_FW_ENTRY(CY_CC_4373_CHIP_ID, 0xFFFFFFFF, 4373)
- };
-
- static void pkt_align(struct sk_buff *p, int len, int align)
---- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/usb.c
-+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/usb.c
-@@ -46,11 +46,11 @@
- #define BRCMF_USB_CBCTL_READ 1
- #define BRCMF_USB_MAX_PKT_SIZE 1600
-
--BRCMF_FW_DEF(43143, "brcmfmac43143.bin");
--BRCMF_FW_DEF(43236B, "brcmfmac43236b.bin");
--BRCMF_FW_DEF(43242A, "brcmfmac43242a.bin");
--BRCMF_FW_DEF(43569, "brcmfmac43569.bin");
--BRCMF_FW_DEF(4373, "brcmfmac4373.bin");
-+BRCMF_FW_DEF(43143, "brcmfmac43143");
-+BRCMF_FW_DEF(43236B, "brcmfmac43236b");
-+BRCMF_FW_DEF(43242A, "brcmfmac43242a");
-+BRCMF_FW_DEF(43569, "brcmfmac43569");
-+BRCMF_FW_DEF(4373, "brcmfmac4373");
-
- static struct brcmf_firmware_mapping brcmf_usb_fwnames[] = {
- BRCMF_FW_ENTRY(BRCM_CC_43143_CHIP_ID, 0xFFFFFFFF, 43143),
diff --git a/package/kernel/mac80211/patches/327-v4.17-0007-brcmfmac-pass-struct-in-brcmf_fw_get_firmwares.patch b/package/kernel/mac80211/patches/327-v4.17-0007-brcmfmac-pass-struct-in-brcmf_fw_get_firmwares.patch
deleted file mode 100644
index a75465a893..0000000000
--- a/package/kernel/mac80211/patches/327-v4.17-0007-brcmfmac-pass-struct-in-brcmf_fw_get_firmwares.patch
+++ /dev/null
@@ -1,574 +0,0 @@
-From d09ae51a4b676151edaf572bcd5f272b5532639f Mon Sep 17 00:00:00 2001
-From: Arend Van Spriel <arend.vanspriel@broadcom.com>
-Date: Thu, 22 Mar 2018 21:28:26 +0100
-Subject: [PATCH] brcmfmac: pass struct in brcmf_fw_get_firmwares()
-
-Make the function brcmf_fw_get_firmwares() a bit more easy to extend
-using a structure to pass the request parameters.
-
-Reviewed-by: Hante Meuleman <hante.meuleman@broadcom.com>
-Reviewed-by: Pieter-Paul Giesberts <pieter-paul.giesberts@broadcom.com>
-Reviewed-by: Franky Lin <franky.lin@broadcom.com>
-Signed-off-by: Arend van Spriel <arend.vanspriel@broadcom.com>
-Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
----
- .../broadcom/brcm80211/brcmfmac/firmware.c | 175 ++++++++++++++-------
- .../broadcom/brcm80211/brcmfmac/firmware.h | 43 +++--
- .../wireless/broadcom/brcm80211/brcmfmac/pcie.c | 38 ++++-
- .../wireless/broadcom/brcm80211/brcmfmac/sdio.c | 32 +++-
- .../net/wireless/broadcom/brcm80211/brcmfmac/usb.c | 43 ++++-
- 5 files changed, 245 insertions(+), 86 deletions(-)
-
---- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/firmware.c
-+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/firmware.c
-@@ -438,18 +438,31 @@ void brcmf_fw_nvram_free(void *nvram)
-
- struct brcmf_fw {
- struct device *dev;
-- u16 flags;
-- const struct firmware *code;
-- const char *nvram_name;
-- u16 domain_nr;
-- u16 bus_nr;
-- void (*done)(struct device *dev, int err, const struct firmware *fw,
-- void *nvram_image, u32 nvram_len);
-+ struct brcmf_fw_request *req;
-+ u32 curpos;
-+ void (*done)(struct device *dev, int err, struct brcmf_fw_request *req);
- };
-
-+static void brcmf_fw_request_done(const struct firmware *fw, void *ctx);
-+
-+static void brcmf_fw_free_request(struct brcmf_fw_request *req)
-+{
-+ struct brcmf_fw_item *item;
-+ int i;
-+
-+ for (i = 0, item = &req->items[0]; i < req->n_items; i++, item++) {
-+ if (item->type == BRCMF_FW_TYPE_BINARY)
-+ release_firmware(item->binary);
-+ else if (item->type == BRCMF_FW_TYPE_NVRAM)
-+ brcmf_fw_nvram_free(item->nv_data.data);
-+ }
-+ kfree(req);
-+}
-+
- static void brcmf_fw_request_nvram_done(const struct firmware *fw, void *ctx)
- {
- struct brcmf_fw *fwctx = ctx;
-+ struct brcmf_fw_item *cur;
- u32 nvram_length = 0;
- void *nvram = NULL;
- u8 *data = NULL;
-@@ -457,83 +470,150 @@ static void brcmf_fw_request_nvram_done(
- bool raw_nvram;
-
- brcmf_dbg(TRACE, "enter: dev=%s\n", dev_name(fwctx->dev));
-+
-+ cur = &fwctx->req->items[fwctx->curpos];
-+
- if (fw && fw->data) {
- data = (u8 *)fw->data;
- data_len = fw->size;
- raw_nvram = false;
- } else {
- data = bcm47xx_nvram_get_contents(&data_len);
-- if (!data && !(fwctx->flags & BRCMF_FW_REQ_NV_OPTIONAL))
-+ if (!data && !(cur->flags & BRCMF_FW_REQF_OPTIONAL))
- goto fail;
- raw_nvram = true;
- }
-
- if (data)
- nvram = brcmf_fw_nvram_strip(data, data_len, &nvram_length,
-- fwctx->domain_nr, fwctx->bus_nr);
-+ fwctx->req->domain_nr,
-+ fwctx->req->bus_nr);
-
- if (raw_nvram)
- bcm47xx_nvram_release_contents(data);
- release_firmware(fw);
-- if (!nvram && !(fwctx->flags & BRCMF_FW_REQ_NV_OPTIONAL))
-+ if (!nvram && !(cur->flags & BRCMF_FW_REQF_OPTIONAL))
- goto fail;
-
-- fwctx->done(fwctx->dev, 0, fwctx->code, nvram, nvram_length);
-- kfree(fwctx);
-+ brcmf_dbg(TRACE, "nvram %p len %d\n", nvram, nvram_length);
-+ cur->nv_data.data = nvram;
-+ cur->nv_data.len = nvram_length;
- return;
-
- fail:
- brcmf_dbg(TRACE, "failed: dev=%s\n", dev_name(fwctx->dev));
-- release_firmware(fwctx->code);
-- fwctx->done(fwctx->dev, -ENOENT, NULL, NULL, 0);
-+ fwctx->done(fwctx->dev, -ENOENT, NULL);
-+ brcmf_fw_free_request(fwctx->req);
- kfree(fwctx);
- }
-
--static void brcmf_fw_request_code_done(const struct firmware *fw, void *ctx)
-+static int brcmf_fw_request_next_item(struct brcmf_fw *fwctx, bool async)
-+{
-+ struct brcmf_fw_item *cur;
-+ const struct firmware *fw = NULL;
-+ int ret;
-+
-+ cur = &fwctx->req->items[fwctx->curpos];
-+
-+ brcmf_dbg(TRACE, "%srequest for %s\n", async ? "async " : "",
-+ cur->path);
-+
-+ if (async)
-+ ret = request_firmware_nowait(THIS_MODULE, true, cur->path,
-+ fwctx->dev, GFP_KERNEL, fwctx,
-+ brcmf_fw_request_done);
-+ else
-+ ret = request_firmware(&fw, cur->path, fwctx->dev);
-+
-+ if (ret < 0) {
-+ brcmf_fw_request_done(NULL, fwctx);
-+ } else if (!async && fw) {
-+ brcmf_dbg(TRACE, "firmware %s %sfound\n", cur->path,
-+ fw ? "" : "not ");
-+ if (cur->type == BRCMF_FW_TYPE_BINARY)
-+ cur->binary = fw;
-+ else if (cur->type == BRCMF_FW_TYPE_NVRAM)
-+ brcmf_fw_request_nvram_done(fw, fwctx);
-+ else
-+ release_firmware(fw);
-+
-+ return -EAGAIN;
-+ }
-+ return 0;
-+}
-+
-+static void brcmf_fw_request_done(const struct firmware *fw, void *ctx)
- {
- struct brcmf_fw *fwctx = ctx;
-+ struct brcmf_fw_item *cur;
- int ret = 0;
-
-- brcmf_dbg(TRACE, "enter: dev=%s\n", dev_name(fwctx->dev));
-- if (!fw) {
-+ cur = &fwctx->req->items[fwctx->curpos];
-+
-+ brcmf_dbg(TRACE, "enter: firmware %s %sfound\n", cur->path,
-+ fw ? "" : "not ");
-+
-+ if (fw) {
-+ if (cur->type == BRCMF_FW_TYPE_BINARY)
-+ cur->binary = fw;
-+ else if (cur->type == BRCMF_FW_TYPE_NVRAM)
-+ brcmf_fw_request_nvram_done(fw, fwctx);
-+ else
-+ release_firmware(fw);
-+ } else if (cur->type == BRCMF_FW_TYPE_NVRAM) {
-+ brcmf_fw_request_nvram_done(NULL, fwctx);
-+ } else if (!(cur->flags & BRCMF_FW_REQF_OPTIONAL)) {
- ret = -ENOENT;
- goto fail;
- }
-- /* only requested code so done here */
-- if (!(fwctx->flags & BRCMF_FW_REQUEST_NVRAM))
-- goto done;
--
-- fwctx->code = fw;
-- ret = request_firmware_nowait(THIS_MODULE, true, fwctx->nvram_name,
-- fwctx->dev, GFP_KERNEL, fwctx,
-- brcmf_fw_request_nvram_done);
-
-- /* pass NULL to nvram callback for bcm47xx fallback */
-- if (ret)
-- brcmf_fw_request_nvram_done(NULL, fwctx);
-+ do {
-+ if (++fwctx->curpos == fwctx->req->n_items) {
-+ ret = 0;
-+ goto done;
-+ }
-+
-+ ret = brcmf_fw_request_next_item(fwctx, false);
-+ } while (ret == -EAGAIN);
-+
- return;
-
- fail:
-- brcmf_dbg(TRACE, "failed: dev=%s\n", dev_name(fwctx->dev));
-+ brcmf_dbg(TRACE, "failed err=%d: dev=%s, fw=%s\n", ret,
-+ dev_name(fwctx->dev), cur->path);
-+ brcmf_fw_free_request(fwctx->req);
-+ fwctx->req = NULL;
- done:
-- fwctx->done(fwctx->dev, ret, fw, NULL, 0);
-+ fwctx->done(fwctx->dev, ret, fwctx->req);
- kfree(fwctx);
- }
-
--int brcmf_fw_get_firmwares_pcie(struct device *dev, u16 flags,
-- const char *code, const char *nvram,
-- void (*fw_cb)(struct device *dev, int err,
-- const struct firmware *fw,
-- void *nvram_image, u32 nvram_len),
-- u16 domain_nr, u16 bus_nr)
-+static bool brcmf_fw_request_is_valid(struct brcmf_fw_request *req)
-+{
-+ struct brcmf_fw_item *item;
-+ int i;
-+
-+ if (!req->n_items)
-+ return false;
-+
-+ for (i = 0, item = &req->items[0]; i < req->n_items; i++, item++) {
-+ if (!item->path)
-+ return false;
-+ }
-+ return true;
-+}
-+
-+int brcmf_fw_get_firmwares(struct device *dev, struct brcmf_fw_request *req,
-+ void (*fw_cb)(struct device *dev, int err,
-+ struct brcmf_fw_request *req))
- {
- struct brcmf_fw *fwctx;
-
- brcmf_dbg(TRACE, "enter: dev=%s\n", dev_name(dev));
-- if (!fw_cb || !code)
-+ if (!fw_cb)
- return -EINVAL;
-
-- if ((flags & BRCMF_FW_REQUEST_NVRAM) && !nvram)
-+ if (!brcmf_fw_request_is_valid(req))
- return -EINVAL;
-
- fwctx = kzalloc(sizeof(*fwctx), GFP_KERNEL);
-@@ -541,26 +621,11 @@ int brcmf_fw_get_firmwares_pcie(struct d
- return -ENOMEM;
-
- fwctx->dev = dev;
-- fwctx->flags = flags;
-+ fwctx->req = req;
- fwctx->done = fw_cb;
-- if (flags & BRCMF_FW_REQUEST_NVRAM)
-- fwctx->nvram_name = nvram;
-- fwctx->domain_nr = domain_nr;
-- fwctx->bus_nr = bus_nr;
--
-- return request_firmware_nowait(THIS_MODULE, true, code, dev,
-- GFP_KERNEL, fwctx,
-- brcmf_fw_request_code_done);
--}
-
--int brcmf_fw_get_firmwares(struct device *dev, u16 flags,
-- const char *code, const char *nvram,
-- void (*fw_cb)(struct device *dev, int err,
-- const struct firmware *fw,
-- void *nvram_image, u32 nvram_len))
--{
-- return brcmf_fw_get_firmwares_pcie(dev, flags, code, nvram, fw_cb, 0,
-- 0);
-+ brcmf_fw_request_next_item(fwctx, true);
-+ return 0;
- }
-
- static void brcmf_fw_get_full_name(char fw_name[BRCMF_FW_NAME_LEN],
---- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/firmware.h
-+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/firmware.h
-@@ -16,10 +16,7 @@
- #ifndef BRCMFMAC_FIRMWARE_H
- #define BRCMFMAC_FIRMWARE_H
-
--#define BRCMF_FW_REQUEST 0x000F
--#define BRCMF_FW_REQUEST_NVRAM 0x0001
--#define BRCMF_FW_REQ_FLAGS 0x00F0
--#define BRCMF_FW_REQ_NV_OPTIONAL 0x0010
-+#define BRCMF_FW_REQF_OPTIONAL 0x0001
-
- #define BRCMF_FW_NAME_LEN 320
-
-@@ -54,21 +51,39 @@ int brcmf_fw_map_chip_to_name(u32 chip,
- u32 table_size, char fw_name[BRCMF_FW_NAME_LEN],
- char nvram_name[BRCMF_FW_NAME_LEN]);
- void brcmf_fw_nvram_free(void *nvram);
-+
-+enum brcmf_fw_type {
-+ BRCMF_FW_TYPE_BINARY,
-+ BRCMF_FW_TYPE_NVRAM
-+};
-+
-+struct brcmf_fw_item {
-+ const char *path;
-+ enum brcmf_fw_type type;
-+ u16 flags;
-+ union {
-+ const struct firmware *binary;
-+ struct {
-+ void *data;
-+ u32 len;
-+ } nv_data;
-+ };
-+};
-+
-+struct brcmf_fw_request {
-+ u16 domain_nr;
-+ u16 bus_nr;
-+ u32 n_items;
-+ struct brcmf_fw_item items[0];
-+};
-+
- /*
- * Request firmware(s) asynchronously. When the asynchronous request
- * fails it will not use the callback, but call device_release_driver()
- * instead which will call the driver .remove() callback.
- */
--int brcmf_fw_get_firmwares_pcie(struct device *dev, u16 flags,
-- const char *code, const char *nvram,
-- void (*fw_cb)(struct device *dev, int err,
-- const struct firmware *fw,
-- void *nvram_image, u32 nvram_len),
-- u16 domain_nr, u16 bus_nr);
--int brcmf_fw_get_firmwares(struct device *dev, u16 flags,
-- const char *code, const char *nvram,
-+int brcmf_fw_get_firmwares(struct device *dev, struct brcmf_fw_request *req,
- void (*fw_cb)(struct device *dev, int err,
-- const struct firmware *fw,
-- void *nvram_image, u32 nvram_len));
-+ struct brcmf_fw_request *req));
-
- #endif /* BRCMFMAC_FIRMWARE_H */
---- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/pcie.c
-+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/pcie.c
-@@ -1651,15 +1651,19 @@ static const struct brcmf_buscore_ops br
- .write32 = brcmf_pcie_buscore_write32,
- };
-
-+#define BRCMF_PCIE_FW_CODE 0
-+#define BRCMF_PCIE_FW_NVRAM 1
-+
- static void brcmf_pcie_setup(struct device *dev, int ret,
-- const struct firmware *fw,
-- void *nvram, u32 nvram_len)
-+ struct brcmf_fw_request *fwreq)
- {
-+ const struct firmware *fw;
-+ void *nvram;
- struct brcmf_bus *bus;
- struct brcmf_pciedev *pcie_bus_dev;
- struct brcmf_pciedev_info *devinfo;
- struct brcmf_commonring **flowrings;
-- u32 i;
-+ u32 i, nvram_len;
-
- /* check firmware loading result */
- if (ret)
-@@ -1670,6 +1674,11 @@ static void brcmf_pcie_setup(struct devi
- devinfo = pcie_bus_dev->devinfo;
- brcmf_pcie_attach(devinfo);
-
-+ fw = fwreq->items[BRCMF_PCIE_FW_CODE].binary;
-+ nvram = fwreq->items[BRCMF_PCIE_FW_NVRAM].nv_data.data;
-+ nvram_len = fwreq->items[BRCMF_PCIE_FW_NVRAM].nv_data.len;
-+ kfree(fwreq);
-+
- /* Some of the firmwares have the size of the memory of the device
- * defined inside the firmware. This is because part of the memory in
- * the device is shared and the devision is determined by FW. Parse
-@@ -1730,6 +1739,7 @@ static int
- brcmf_pcie_probe(struct pci_dev *pdev, const struct pci_device_id *id)
- {
- int ret;
-+ struct brcmf_fw_request *fwreq;
- struct brcmf_pciedev_info *devinfo;
- struct brcmf_pciedev *pcie_bus_dev;
- struct brcmf_bus *bus;
-@@ -1800,12 +1810,26 @@ brcmf_pcie_probe(struct pci_dev *pdev, c
- if (ret)
- goto fail_bus;
-
-- ret = brcmf_fw_get_firmwares_pcie(bus->dev, BRCMF_FW_REQUEST_NVRAM |
-- BRCMF_FW_REQ_NV_OPTIONAL,
-- devinfo->fw_name, devinfo->nvram_name,
-- brcmf_pcie_setup, domain_nr, bus_nr);
-+ fwreq = kzalloc(sizeof(*fwreq) + 2 * sizeof(struct brcmf_fw_item),
-+ GFP_KERNEL);
-+ if (!fwreq) {
-+ ret = -ENOMEM;
-+ goto fail_bus;
-+ }
-+
-+ fwreq->items[BRCMF_PCIE_FW_CODE].path = devinfo->fw_name;
-+ fwreq->items[BRCMF_PCIE_FW_CODE].type = BRCMF_FW_TYPE_BINARY;
-+ fwreq->items[BRCMF_PCIE_FW_NVRAM].path = devinfo->nvram_name;
-+ fwreq->items[BRCMF_PCIE_FW_NVRAM].type = BRCMF_FW_TYPE_NVRAM;
-+ fwreq->items[BRCMF_PCIE_FW_NVRAM].flags = BRCMF_FW_REQF_OPTIONAL;
-+ fwreq->n_items = 2;
-+ fwreq->domain_nr = domain_nr;
-+ fwreq->bus_nr = bus_nr;
-+ ret = brcmf_fw_get_firmwares(bus->dev, fwreq, brcmf_pcie_setup);
- if (ret == 0)
- return 0;
-+
-+ kfree(fwreq);
- fail_bus:
- kfree(bus->msgbuf);
- kfree(bus);
---- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c
-+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c
-@@ -4031,14 +4031,19 @@ static const struct brcmf_bus_ops brcmf_
- .get_fwname = brcmf_sdio_get_fwname,
- };
-
-+#define BRCMF_SDIO_FW_CODE 0
-+#define BRCMF_SDIO_FW_NVRAM 1
-+
- static void brcmf_sdio_firmware_callback(struct device *dev, int err,
-- const struct firmware *code,
-- void *nvram, u32 nvram_len)
-+ struct brcmf_fw_request *fwreq)
- {
- struct brcmf_bus *bus_if = dev_get_drvdata(dev);
- struct brcmf_sdio_dev *sdiod = bus_if->bus_priv.sdio;
- struct brcmf_sdio *bus = sdiod->bus;
- struct brcmf_core *core = bus->sdio_core;
-+ const struct firmware *code;
-+ void *nvram;
-+ u32 nvram_len;
- u8 saveclk;
-
- brcmf_dbg(TRACE, "Enter: dev=%s, err=%d\n", dev_name(dev), err);
-@@ -4046,6 +4051,11 @@ static void brcmf_sdio_firmware_callback
- if (err)
- goto fail;
-
-+ code = fwreq->items[BRCMF_SDIO_FW_CODE].binary;
-+ nvram = fwreq->items[BRCMF_SDIO_FW_NVRAM].nv_data.data;
-+ nvram_len = fwreq->items[BRCMF_SDIO_FW_NVRAM].nv_data.len;
-+ kfree(fwreq);
-+
- /* try to download image and nvram to the dongle */
- bus->alp_only = true;
- err = brcmf_sdio_download_firmware(bus, code, nvram, nvram_len);
-@@ -4150,6 +4160,7 @@ struct brcmf_sdio *brcmf_sdio_probe(stru
- int ret;
- struct brcmf_sdio *bus;
- struct workqueue_struct *wq;
-+ struct brcmf_fw_request *fwreq;
-
- brcmf_dbg(TRACE, "Enter\n");
-
-@@ -4240,11 +4251,24 @@ struct brcmf_sdio *brcmf_sdio_probe(stru
- if (ret)
- goto fail;
-
-- ret = brcmf_fw_get_firmwares(sdiodev->dev, BRCMF_FW_REQUEST_NVRAM,
-- sdiodev->fw_name, sdiodev->nvram_name,
-+ fwreq = kzalloc(sizeof(fwreq) + 2 * sizeof(struct brcmf_fw_item),
-+ GFP_KERNEL);
-+ if (!fwreq) {
-+ ret = -ENOMEM;
-+ goto fail;
-+ }
-+
-+ fwreq->items[BRCMF_SDIO_FW_CODE].path = sdiodev->fw_name;
-+ fwreq->items[BRCMF_SDIO_FW_CODE].type = BRCMF_FW_TYPE_BINARY;
-+ fwreq->items[BRCMF_SDIO_FW_NVRAM].path = sdiodev->nvram_name;
-+ fwreq->items[BRCMF_SDIO_FW_NVRAM].type = BRCMF_FW_TYPE_NVRAM;
-+ fwreq->n_items = 2;
-+
-+ ret = brcmf_fw_get_firmwares(sdiodev->dev, fwreq,
- brcmf_sdio_firmware_callback);
- if (ret != 0) {
- brcmf_err("async firmware request failed: %d\n", ret);
-+ kfree(fwreq);
- goto fail;
- }
-
---- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/usb.c
-+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/usb.c
-@@ -1155,18 +1155,23 @@ static const struct brcmf_bus_ops brcmf_
- .get_fwname = brcmf_usb_get_fwname,
- };
-
-+#define BRCMF_USB_FW_CODE 0
-+
- static void brcmf_usb_probe_phase2(struct device *dev, int ret,
-- const struct firmware *fw,
-- void *nvram, u32 nvlen)
-+ struct brcmf_fw_request *fwreq)
- {
- struct brcmf_bus *bus = dev_get_drvdata(dev);
- struct brcmf_usbdev_info *devinfo = bus->bus_priv.usb->devinfo;
-+ const struct firmware *fw;
-
- if (ret)
- goto error;
-
- brcmf_dbg(USB, "Start fw downloading\n");
-
-+ fw = fwreq->items[BRCMF_USB_FW_CODE].binary;
-+ kfree(fwreq);
-+
- ret = check_file(fw->data);
- if (ret < 0) {
- brcmf_err("invalid firmware\n");
-@@ -1200,6 +1205,7 @@ static int brcmf_usb_probe_cb(struct brc
- struct brcmf_bus *bus = NULL;
- struct brcmf_usbdev *bus_pub = NULL;
- struct device *dev = devinfo->dev;
-+ struct brcmf_fw_request *fwreq;
- int ret;
-
- brcmf_dbg(USB, "Enter\n");
-@@ -1250,11 +1256,22 @@ static int brcmf_usb_probe_cb(struct brc
- if (ret)
- goto fail;
-
-+ fwreq = kzalloc(sizeof(*fwreq) + sizeof(struct brcmf_fw_item),
-+ GFP_KERNEL);
-+ if (!fwreq) {
-+ ret = -ENOMEM;
-+ goto fail;
-+ }
-+
-+ fwreq->items[BRCMF_USB_FW_CODE].path = devinfo->fw_name;
-+ fwreq->items[BRCMF_USB_FW_CODE].type = BRCMF_FW_TYPE_BINARY;
-+ fwreq->n_items = 1;
-+
- /* request firmware here */
-- ret = brcmf_fw_get_firmwares(dev, 0, devinfo->fw_name, NULL,
-- brcmf_usb_probe_phase2);
-+ ret = brcmf_fw_get_firmwares(dev, fwreq, brcmf_usb_probe_phase2);
- if (ret) {
- brcmf_err("firmware request failed: %d\n", ret);
-+ kfree(fwreq);
- goto fail;
- }
-
-@@ -1447,11 +1464,25 @@ static int brcmf_usb_reset_resume(struct
- {
- struct usb_device *usb = interface_to_usbdev(intf);
- struct brcmf_usbdev_info *devinfo = brcmf_usb_get_businfo(&usb->dev);
-+ struct brcmf_fw_request *fwreq;
-+ int ret;
-
- brcmf_dbg(USB, "Enter\n");
-
-- return brcmf_fw_get_firmwares(&usb->dev, 0, devinfo->fw_name, NULL,
-- brcmf_usb_probe_phase2);
-+ fwreq = kzalloc(sizeof(*fwreq) + sizeof(struct brcmf_fw_item),
-+ GFP_KERNEL);
-+ if (!fwreq)
-+ return -ENOMEM;
-+
-+ fwreq->items[BRCMF_USB_FW_CODE].path = devinfo->fw_name;
-+ fwreq->items[BRCMF_USB_FW_CODE].type = BRCMF_FW_TYPE_BINARY;
-+ fwreq->n_items = 1;
-+
-+ ret = brcmf_fw_get_firmwares(&usb->dev, fwreq, brcmf_usb_probe_phase2);
-+ if (ret < 0)
-+ kfree(fwreq);
-+
-+ return ret;
- }
-
- #define BRCMF_USB_DEVICE(dev_id) \
diff --git a/package/kernel/mac80211/patches/327-v4.17-0008-brcmfmac-introduce-brcmf_fw_alloc_request-function.patch b/package/kernel/mac80211/patches/327-v4.17-0008-brcmfmac-introduce-brcmf_fw_alloc_request-function.patch
deleted file mode 100644
index 408154ef0f..0000000000
--- a/package/kernel/mac80211/patches/327-v4.17-0008-brcmfmac-introduce-brcmf_fw_alloc_request-function.patch
+++ /dev/null
@@ -1,328 +0,0 @@
-From 2baa3aaee27f137b8db9a9224d0fe9b281d28e34 Mon Sep 17 00:00:00 2001
-From: Arend Van Spriel <arend.vanspriel@broadcom.com>
-Date: Thu, 22 Mar 2018 21:28:27 +0100
-Subject: [PATCH] brcmfmac: introduce brcmf_fw_alloc_request() function
-
-The function brcmf_fw_alloc_request() takes a list of required files
-and allocated the struct brcmf_fw_request instance accordingly. The
-request can be modified by the caller before being passed to the
-brcmf_fw_request_firmwares() function.
-
-Reviewed-by: Hante Meuleman <hante.meuleman@broadcom.com>
-Reviewed-by: Pieter-Paul Giesberts <pieter-paul.giesberts@broadcom.com>
-Reviewed-by: Franky Lin <franky.lin@broadcom.com>
-Signed-off-by: Arend van Spriel <arend.vanspriel@broadcom.com>
-Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
----
- .../broadcom/brcm80211/brcmfmac/firmware.c | 58 ++++++++++++++++++++++
- .../broadcom/brcm80211/brcmfmac/firmware.h | 11 ++++
- .../wireless/broadcom/brcm80211/brcmfmac/pcie.c | 58 ++++++++++++----------
- .../wireless/broadcom/brcm80211/brcmfmac/sdio.c | 38 ++++++++------
- .../net/wireless/broadcom/brcm80211/brcmfmac/usb.c | 42 +++++++++-------
- 5 files changed, 147 insertions(+), 60 deletions(-)
-
---- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/firmware.c
-+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/firmware.c
-@@ -688,3 +688,61 @@ int brcmf_fw_map_chip_to_name(u32 chip,
- return 0;
- }
-
-+struct brcmf_fw_request *
-+brcmf_fw_alloc_request(u32 chip, u32 chiprev,
-+ struct brcmf_firmware_mapping mapping_table[],
-+ u32 table_size, struct brcmf_fw_name *fwnames,
-+ u32 n_fwnames)
-+{
-+ struct brcmf_fw_request *fwreq;
-+ char chipname[12];
-+ const char *mp_path;
-+ u32 i, j;
-+ char end;
-+ size_t reqsz;
-+
-+ for (i = 0; i < table_size; i++) {
-+ if (mapping_table[i].chipid == chip &&
-+ mapping_table[i].revmask & BIT(chiprev))
-+ break;
-+ }
-+
-+ if (i == table_size) {
-+ brcmf_err("Unknown chipid %d [%d]\n", chip, chiprev);
-+ return NULL;
-+ }
-+
-+ reqsz = sizeof(*fwreq) + n_fwnames * sizeof(struct brcmf_fw_item);
-+ fwreq = kzalloc(reqsz, GFP_KERNEL);
-+ if (!fwreq)
-+ return NULL;
-+
-+ brcmf_chip_name(chip, chiprev, chipname, sizeof(chipname));
-+
-+ brcmf_info("using %s for chip %s\n",
-+ mapping_table[i].fw_base, chipname);
-+
-+ mp_path = brcmf_mp_global.firmware_path;
-+ end = mp_path[strlen(mp_path) - 1];
-+ fwreq->n_items = n_fwnames;
-+
-+ for (j = 0; j < n_fwnames; j++) {
-+ fwreq->items[j].path = fwnames[j].path;
-+ /* check if firmware path is provided by module parameter */
-+ if (brcmf_mp_global.firmware_path[0] != '\0') {
-+ strlcpy(fwnames[j].path, mp_path,
-+ BRCMF_FW_NAME_LEN);
-+
-+ if (end != '/') {
-+ strlcat(fwnames[j].path, "/",
-+ BRCMF_FW_NAME_LEN);
-+ }
-+ }
-+ brcmf_fw_get_full_name(fwnames[j].path,
-+ mapping_table[i].fw_base,
-+ fwnames[j].extension);
-+ fwreq->items[j].path = fwnames[j].path;
-+ }
-+
-+ return fwreq;
-+}
---- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/firmware.h
-+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/firmware.h
-@@ -77,6 +77,17 @@ struct brcmf_fw_request {
- struct brcmf_fw_item items[0];
- };
-
-+struct brcmf_fw_name {
-+ const char *extension;
-+ char *path;
-+};
-+
-+struct brcmf_fw_request *
-+brcmf_fw_alloc_request(u32 chip, u32 chiprev,
-+ struct brcmf_firmware_mapping mapping_table[],
-+ u32 table_size, struct brcmf_fw_name *fwnames,
-+ u32 n_fwnames);
-+
- /*
- * Request firmware(s) asynchronously. When the asynchronous request
- * fails it will not use the callback, but call device_release_driver()
---- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/pcie.c
-+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/pcie.c
-@@ -1735,6 +1735,31 @@ fail:
- device_release_driver(dev);
- }
-
-+static struct brcmf_fw_request *
-+brcmf_pcie_prepare_fw_request(struct brcmf_pciedev_info *devinfo)
-+{
-+ struct brcmf_fw_request *fwreq;
-+ struct brcmf_fw_name fwnames[] = {
-+ { ".bin", devinfo->fw_name },
-+ { ".txt", devinfo->nvram_name },
-+ };
-+
-+ fwreq = brcmf_fw_alloc_request(devinfo->ci->chip, devinfo->ci->chiprev,
-+ brcmf_pcie_fwnames,
-+ ARRAY_SIZE(brcmf_pcie_fwnames),
-+ fwnames, ARRAY_SIZE(fwnames));
-+ if (!fwreq)
-+ return NULL;
-+
-+ fwreq->items[BRCMF_PCIE_FW_CODE].type = BRCMF_FW_TYPE_BINARY;
-+ fwreq->items[BRCMF_PCIE_FW_NVRAM].type = BRCMF_FW_TYPE_NVRAM;
-+ fwreq->items[BRCMF_PCIE_FW_NVRAM].flags = BRCMF_FW_REQF_OPTIONAL;
-+ fwreq->domain_nr = pci_domain_nr(devinfo->pdev->bus);
-+ fwreq->bus_nr = devinfo->pdev->bus->number;
-+
-+ return fwreq;
-+}
-+
- static int
- brcmf_pcie_probe(struct pci_dev *pdev, const struct pci_device_id *id)
- {
-@@ -1743,13 +1768,8 @@ brcmf_pcie_probe(struct pci_dev *pdev, c
- struct brcmf_pciedev_info *devinfo;
- struct brcmf_pciedev *pcie_bus_dev;
- struct brcmf_bus *bus;
-- u16 domain_nr;
-- u16 bus_nr;
-
-- domain_nr = pci_domain_nr(pdev->bus) + 1;
-- bus_nr = pdev->bus->number;
-- brcmf_dbg(PCIE, "Enter %x:%x (%d/%d)\n", pdev->vendor, pdev->device,
-- domain_nr, bus_nr);
-+ brcmf_dbg(PCIE, "Enter %x:%x\n", pdev->vendor, pdev->device);
-
- ret = -ENOMEM;
- devinfo = kzalloc(sizeof(*devinfo), GFP_KERNEL);
-@@ -1803,33 +1823,19 @@ brcmf_pcie_probe(struct pci_dev *pdev, c
- bus->wowl_supported = pci_pme_capable(pdev, PCI_D3hot);
- dev_set_drvdata(&pdev->dev, bus);
-
-- ret = brcmf_fw_map_chip_to_name(devinfo->ci->chip, devinfo->ci->chiprev,
-- brcmf_pcie_fwnames,
-- ARRAY_SIZE(brcmf_pcie_fwnames),
-- devinfo->fw_name, devinfo->nvram_name);
-- if (ret)
-- goto fail_bus;
--
-- fwreq = kzalloc(sizeof(*fwreq) + 2 * sizeof(struct brcmf_fw_item),
-- GFP_KERNEL);
-+ fwreq = brcmf_pcie_prepare_fw_request(devinfo);
- if (!fwreq) {
- ret = -ENOMEM;
- goto fail_bus;
- }
-
-- fwreq->items[BRCMF_PCIE_FW_CODE].path = devinfo->fw_name;
-- fwreq->items[BRCMF_PCIE_FW_CODE].type = BRCMF_FW_TYPE_BINARY;
-- fwreq->items[BRCMF_PCIE_FW_NVRAM].path = devinfo->nvram_name;
-- fwreq->items[BRCMF_PCIE_FW_NVRAM].type = BRCMF_FW_TYPE_NVRAM;
-- fwreq->items[BRCMF_PCIE_FW_NVRAM].flags = BRCMF_FW_REQF_OPTIONAL;
-- fwreq->n_items = 2;
-- fwreq->domain_nr = domain_nr;
-- fwreq->bus_nr = bus_nr;
- ret = brcmf_fw_get_firmwares(bus->dev, fwreq, brcmf_pcie_setup);
-- if (ret == 0)
-- return 0;
-+ if (ret < 0) {
-+ kfree(fwreq);
-+ goto fail_bus;
-+ }
-+ return 0;
-
-- kfree(fwreq);
- fail_bus:
- kfree(bus->msgbuf);
- kfree(bus);
---- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c
-+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c
-@@ -4155,6 +4155,28 @@ fail:
- device_release_driver(dev);
- }
-
-+static struct brcmf_fw_request *
-+brcmf_sdio_prepare_fw_request(struct brcmf_sdio *bus)
-+{
-+ struct brcmf_fw_request *fwreq;
-+ struct brcmf_fw_name fwnames[] = {
-+ { ".bin", bus->sdiodev->fw_name },
-+ { ".txt", bus->sdiodev->nvram_name },
-+ };
-+
-+ fwreq = brcmf_fw_alloc_request(bus->ci->chip, bus->ci->chiprev,
-+ brcmf_sdio_fwnames,
-+ ARRAY_SIZE(brcmf_sdio_fwnames),
-+ fwnames, ARRAY_SIZE(fwnames));
-+ if (!fwreq)
-+ return NULL;
-+
-+ fwreq->items[BRCMF_SDIO_FW_CODE].type = BRCMF_FW_TYPE_BINARY;
-+ fwreq->items[BRCMF_SDIO_FW_NVRAM].type = BRCMF_FW_TYPE_NVRAM;
-+
-+ return fwreq;
-+}
-+
- struct brcmf_sdio *brcmf_sdio_probe(struct brcmf_sdio_dev *sdiodev)
- {
- int ret;
-@@ -4244,26 +4266,12 @@ struct brcmf_sdio *brcmf_sdio_probe(stru
-
- brcmf_dbg(INFO, "completed!!\n");
-
-- ret = brcmf_fw_map_chip_to_name(bus->ci->chip, bus->ci->chiprev,
-- brcmf_sdio_fwnames,
-- ARRAY_SIZE(brcmf_sdio_fwnames),
-- sdiodev->fw_name, sdiodev->nvram_name);
-- if (ret)
-- goto fail;
--
-- fwreq = kzalloc(sizeof(fwreq) + 2 * sizeof(struct brcmf_fw_item),
-- GFP_KERNEL);
-+ fwreq = brcmf_sdio_prepare_fw_request(bus);
- if (!fwreq) {
- ret = -ENOMEM;
- goto fail;
- }
-
-- fwreq->items[BRCMF_SDIO_FW_CODE].path = sdiodev->fw_name;
-- fwreq->items[BRCMF_SDIO_FW_CODE].type = BRCMF_FW_TYPE_BINARY;
-- fwreq->items[BRCMF_SDIO_FW_NVRAM].path = sdiodev->nvram_name;
-- fwreq->items[BRCMF_SDIO_FW_NVRAM].type = BRCMF_FW_TYPE_NVRAM;
-- fwreq->n_items = 2;
--
- ret = brcmf_fw_get_firmwares(sdiodev->dev, fwreq,
- brcmf_sdio_firmware_callback);
- if (ret != 0) {
---- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/usb.c
-+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/usb.c
-@@ -1200,6 +1200,27 @@ error:
- device_release_driver(dev);
- }
-
-+static struct brcmf_fw_request *
-+brcmf_usb_prepare_fw_request(struct brcmf_usbdev_info *devinfo)
-+{
-+ struct brcmf_fw_request *fwreq;
-+ struct brcmf_fw_name fwnames[] = {
-+ { ".bin", devinfo->fw_name },
-+ };
-+
-+ fwreq = brcmf_fw_alloc_request(devinfo->bus_pub.devid,
-+ devinfo->bus_pub.chiprev,
-+ brcmf_usb_fwnames,
-+ ARRAY_SIZE(brcmf_usb_fwnames),
-+ fwnames, ARRAY_SIZE(fwnames));
-+ if (!fwreq)
-+ return NULL;
-+
-+ fwreq->items[BRCMF_USB_FW_CODE].type = BRCMF_FW_TYPE_BINARY;
-+
-+ return fwreq;
-+}
-+
- static int brcmf_usb_probe_cb(struct brcmf_usbdev_info *devinfo)
- {
- struct brcmf_bus *bus = NULL;
-@@ -1249,24 +1270,12 @@ static int brcmf_usb_probe_cb(struct brc
- bus->chip = bus_pub->devid;
- bus->chiprev = bus_pub->chiprev;
-
-- ret = brcmf_fw_map_chip_to_name(bus_pub->devid, bus_pub->chiprev,
-- brcmf_usb_fwnames,
-- ARRAY_SIZE(brcmf_usb_fwnames),
-- devinfo->fw_name, NULL);
-- if (ret)
-- goto fail;
--
-- fwreq = kzalloc(sizeof(*fwreq) + sizeof(struct brcmf_fw_item),
-- GFP_KERNEL);
-+ fwreq = brcmf_usb_prepare_fw_request(devinfo);
- if (!fwreq) {
- ret = -ENOMEM;
- goto fail;
- }
-
-- fwreq->items[BRCMF_USB_FW_CODE].path = devinfo->fw_name;
-- fwreq->items[BRCMF_USB_FW_CODE].type = BRCMF_FW_TYPE_BINARY;
-- fwreq->n_items = 1;
--
- /* request firmware here */
- ret = brcmf_fw_get_firmwares(dev, fwreq, brcmf_usb_probe_phase2);
- if (ret) {
-@@ -1469,15 +1478,10 @@ static int brcmf_usb_reset_resume(struct
-
- brcmf_dbg(USB, "Enter\n");
-
-- fwreq = kzalloc(sizeof(*fwreq) + sizeof(struct brcmf_fw_item),
-- GFP_KERNEL);
-+ fwreq = brcmf_usb_prepare_fw_request(devinfo);
- if (!fwreq)
- return -ENOMEM;
-
-- fwreq->items[BRCMF_USB_FW_CODE].path = devinfo->fw_name;
-- fwreq->items[BRCMF_USB_FW_CODE].type = BRCMF_FW_TYPE_BINARY;
-- fwreq->n_items = 1;
--
- ret = brcmf_fw_get_firmwares(&usb->dev, fwreq, brcmf_usb_probe_phase2);
- if (ret < 0)
- kfree(fwreq);
diff --git a/package/kernel/mac80211/patches/327-v4.17-0009-brcmfmac-add-extension-to-.get_fwname-callbacks.patch b/package/kernel/mac80211/patches/327-v4.17-0009-brcmfmac-add-extension-to-.get_fwname-callbacks.patch
deleted file mode 100644
index 391229a865..0000000000
--- a/package/kernel/mac80211/patches/327-v4.17-0009-brcmfmac-add-extension-to-.get_fwname-callbacks.patch
+++ /dev/null
@@ -1,231 +0,0 @@
-From bf7a7b37f6ef5090a2bae7e7ae23cd26b741cca4 Mon Sep 17 00:00:00 2001
-From: Arend Van Spriel <arend.vanspriel@broadcom.com>
-Date: Thu, 22 Mar 2018 21:28:28 +0100
-Subject: [PATCH] brcmfmac: add extension to .get_fwname() callbacks
-
-This changes the bus layer api by having the caller provide an
-extension. With this the callback can use brcmf_fw_alloc_request()
-to get the needed firmware name.
-
-Reviewed-by: Hante Meuleman <hante.meuleman@broadcom.com>
-Reviewed-by: Pieter-Paul Giesberts <pieter-paul.giesberts@broadcom.com>
-Reviewed-by: Franky Lin <franky.lin@broadcom.com>
-Signed-off-by: Arend van Spriel <arend.vanspriel@broadcom.com>
-Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
----
- .../net/wireless/broadcom/brcm80211/brcmfmac/bus.h | 6 +--
- .../wireless/broadcom/brcm80211/brcmfmac/common.c | 43 +++-------------------
- .../wireless/broadcom/brcm80211/brcmfmac/pcie.c | 27 +++++++-------
- .../wireless/broadcom/brcm80211/brcmfmac/sdio.c | 26 +++++++------
- .../net/wireless/broadcom/brcm80211/brcmfmac/usb.c | 27 ++++++++------
- 5 files changed, 51 insertions(+), 78 deletions(-)
-
---- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/bus.h
-+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/bus.h
-@@ -88,7 +88,7 @@ struct brcmf_bus_ops {
- void (*wowl_config)(struct device *dev, bool enabled);
- size_t (*get_ramsize)(struct device *dev);
- int (*get_memdump)(struct device *dev, void *data, size_t len);
-- int (*get_fwname)(struct device *dev, uint chip, uint chiprev,
-+ int (*get_fwname)(struct device *dev, const char *ext,
- unsigned char *fw_name);
- };
-
-@@ -228,10 +228,10 @@ int brcmf_bus_get_memdump(struct brcmf_b
- }
-
- static inline
--int brcmf_bus_get_fwname(struct brcmf_bus *bus, uint chip, uint chiprev,
-+int brcmf_bus_get_fwname(struct brcmf_bus *bus, const char *ext,
- unsigned char *fw_name)
- {
-- return bus->ops->get_fwname(bus->dev, chip, chiprev, fw_name);
-+ return bus->ops->get_fwname(bus->dev, ext, fw_name);
- }
-
- /*
---- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/common.c
-+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/common.c
-@@ -129,42 +129,9 @@ static int brcmf_c_download(struct brcmf
- return err;
- }
-
--static int brcmf_c_get_clm_name(struct brcmf_if *ifp, u8 *clm_name)
--{
-- struct brcmf_bus *bus = ifp->drvr->bus_if;
-- u8 fw_name[BRCMF_FW_NAME_LEN];
-- u8 *ptr;
-- size_t len;
-- s32 err;
--
-- memset(fw_name, 0, BRCMF_FW_NAME_LEN);
-- err = brcmf_bus_get_fwname(bus, bus->chip, bus->chiprev, fw_name);
-- if (err) {
-- brcmf_err("get firmware name failed (%d)\n", err);
-- goto done;
-- }
--
-- /* generate CLM blob file name */
-- ptr = strrchr(fw_name, '.');
-- if (!ptr) {
-- err = -ENOENT;
-- goto done;
-- }
--
-- len = ptr - fw_name + 1;
-- if (len + strlen(".clm_blob") > BRCMF_FW_NAME_LEN) {
-- err = -E2BIG;
-- } else {
-- strlcpy(clm_name, fw_name, len);
-- strlcat(clm_name, ".clm_blob", BRCMF_FW_NAME_LEN);
-- }
--done:
-- return err;
--}
--
- static int brcmf_c_process_clm_blob(struct brcmf_if *ifp)
- {
-- struct device *dev = ifp->drvr->bus_if->dev;
-+ struct brcmf_bus *bus = ifp->drvr->bus_if;
- struct brcmf_dload_data_le *chunk_buf;
- const struct firmware *clm = NULL;
- u8 clm_name[BRCMF_FW_NAME_LEN];
-@@ -177,16 +144,16 @@ static int brcmf_c_process_clm_blob(stru
-
- brcmf_dbg(TRACE, "Enter\n");
-
-- memset(clm_name, 0, BRCMF_FW_NAME_LEN);
-- err = brcmf_c_get_clm_name(ifp, clm_name);
-+ memset(clm_name, 0, sizeof(clm_name));
-+ err = brcmf_bus_get_fwname(bus, ".clm_blob", clm_name);
- if (err) {
- brcmf_err("get CLM blob file name failed (%d)\n", err);
- return err;
- }
-
-- err = request_firmware(&clm, clm_name, dev);
-+ err = request_firmware(&clm, clm_name, bus->dev);
- if (err) {
-- brcmf_info("no clm_blob available(err=%d), device may have limited channels available\n",
-+ brcmf_info("no clm_blob available (err=%d), device may have limited channels available\n",
- err);
- return 0;
- }
---- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/pcie.c
-+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/pcie.c
-@@ -1350,23 +1350,24 @@ static int brcmf_pcie_get_memdump(struct
- return 0;
- }
-
--static int brcmf_pcie_get_fwname(struct device *dev, u32 chip, u32 chiprev,
-- u8 *fw_name)
-+static
-+int brcmf_pcie_get_fwname(struct device *dev, const char *ext, u8 *fw_name)
- {
- struct brcmf_bus *bus_if = dev_get_drvdata(dev);
-- struct brcmf_pciedev *buspub = bus_if->bus_priv.pcie;
-- struct brcmf_pciedev_info *devinfo = buspub->devinfo;
-- int ret = 0;
-+ struct brcmf_fw_request *fwreq;
-+ struct brcmf_fw_name fwnames[] = {
-+ { ext, fw_name },
-+ };
-
-- if (devinfo->fw_name[0] != '\0')
-- strlcpy(fw_name, devinfo->fw_name, BRCMF_FW_NAME_LEN);
-- else
-- ret = brcmf_fw_map_chip_to_name(chip, chiprev,
-- brcmf_pcie_fwnames,
-- ARRAY_SIZE(brcmf_pcie_fwnames),
-- fw_name, NULL);
-+ fwreq = brcmf_fw_alloc_request(bus_if->chip, bus_if->chiprev,
-+ brcmf_pcie_fwnames,
-+ ARRAY_SIZE(brcmf_pcie_fwnames),
-+ fwnames, ARRAY_SIZE(fwnames));
-+ if (!fwreq)
-+ return -ENOMEM;
-
-- return ret;
-+ kfree(fwreq);
-+ return 0;
- }
-
- static const struct brcmf_bus_ops brcmf_pcie_bus_ops = {
---- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c
-+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c
-@@ -4000,22 +4000,24 @@ brcmf_sdio_watchdog(unsigned long data)
- }
- }
-
--static int brcmf_sdio_get_fwname(struct device *dev, u32 chip, u32 chiprev,
-- u8 *fw_name)
-+static
-+int brcmf_sdio_get_fwname(struct device *dev, const char *ext, u8 *fw_name)
- {
- struct brcmf_bus *bus_if = dev_get_drvdata(dev);
-- struct brcmf_sdio_dev *sdiodev = bus_if->bus_priv.sdio;
-- int ret = 0;
-+ struct brcmf_fw_request *fwreq;
-+ struct brcmf_fw_name fwnames[] = {
-+ { ext, fw_name },
-+ };
-
-- if (sdiodev->fw_name[0] != '\0')
-- strlcpy(fw_name, sdiodev->fw_name, BRCMF_FW_NAME_LEN);
-- else
-- ret = brcmf_fw_map_chip_to_name(chip, chiprev,
-- brcmf_sdio_fwnames,
-- ARRAY_SIZE(brcmf_sdio_fwnames),
-- fw_name, NULL);
-+ fwreq = brcmf_fw_alloc_request(bus_if->chip, bus_if->chiprev,
-+ brcmf_sdio_fwnames,
-+ ARRAY_SIZE(brcmf_sdio_fwnames),
-+ fwnames, ARRAY_SIZE(fwnames));
-+ if (!fwreq)
-+ return -ENOMEM;
-
-- return ret;
-+ kfree(fwreq);
-+ return 0;
- }
-
- static const struct brcmf_bus_ops brcmf_sdio_bus_ops = {
---- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/usb.c
-+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/usb.c
-@@ -1128,21 +1128,24 @@ static void brcmf_usb_wowl_config(struct
- device_set_wakeup_enable(devinfo->dev, false);
- }
-
--static int brcmf_usb_get_fwname(struct device *dev, u32 chip, u32 chiprev,
-- u8 *fw_name)
-+static
-+int brcmf_usb_get_fwname(struct device *dev, const char *ext, u8 *fw_name)
- {
-- struct brcmf_usbdev_info *devinfo = brcmf_usb_get_businfo(dev);
-- int ret = 0;
-+ struct brcmf_bus *bus = dev_get_drvdata(dev);
-+ struct brcmf_fw_request *fwreq;
-+ struct brcmf_fw_name fwnames[] = {
-+ { ext, fw_name },
-+ };
-
-- if (devinfo->fw_name[0] != '\0')
-- strlcpy(fw_name, devinfo->fw_name, BRCMF_FW_NAME_LEN);
-- else
-- ret = brcmf_fw_map_chip_to_name(chip, chiprev,
-- brcmf_usb_fwnames,
-- ARRAY_SIZE(brcmf_usb_fwnames),
-- fw_name, NULL);
-+ fwreq = brcmf_fw_alloc_request(bus->chip, bus->chiprev,
-+ brcmf_usb_fwnames,
-+ ARRAY_SIZE(brcmf_usb_fwnames),
-+ fwnames, ARRAY_SIZE(fwnames));
-+ if (!fwreq)
-+ return -ENOMEM;
-
-- return ret;
-+ kfree(fwreq);
-+ return 0;
- }
-
- static const struct brcmf_bus_ops brcmf_usb_bus_ops = {
diff --git a/package/kernel/mac80211/patches/327-v4.17-0010-brcmfmac-get-rid-of-brcmf_fw_map_chip_to_name.patch b/package/kernel/mac80211/patches/327-v4.17-0010-brcmfmac-get-rid-of-brcmf_fw_map_chip_to_name.patch
deleted file mode 100644
index becf7cf3fb..0000000000
--- a/package/kernel/mac80211/patches/327-v4.17-0010-brcmfmac-get-rid-of-brcmf_fw_map_chip_to_name.patch
+++ /dev/null
@@ -1,92 +0,0 @@
-From 18c2b20e276e04476a3350b4a92c1dfad725d45d Mon Sep 17 00:00:00 2001
-From: Arend Van Spriel <arend.vanspriel@broadcom.com>
-Date: Thu, 22 Mar 2018 21:28:29 +0100
-Subject: [PATCH] brcmfmac: get rid of brcmf_fw_map_chip_to_name()
-
-The function is no longer used so removing it.
-
-Reviewed-by: Hante Meuleman <hante.meuleman@broadcom.com>
-Reviewed-by: Pieter-Paul Giesberts <pieter-paul.giesberts@broadcom.com>
-Reviewed-by: Franky Lin <franky.lin@broadcom.com>
-Signed-off-by: Arend van Spriel <arend.vanspriel@broadcom.com>
-Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
----
- .../broadcom/brcm80211/brcmfmac/firmware.c | 53 ----------------------
- .../broadcom/brcm80211/brcmfmac/firmware.h | 4 --
- 2 files changed, 57 deletions(-)
-
---- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/firmware.c
-+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/firmware.c
-@@ -635,59 +635,6 @@ static void brcmf_fw_get_full_name(char
- strlcat(fw_name, extension, BRCMF_FW_NAME_LEN);
- }
-
--int brcmf_fw_map_chip_to_name(u32 chip, u32 chiprev,
-- struct brcmf_firmware_mapping mapping_table[],
-- u32 table_size, char fw_name[BRCMF_FW_NAME_LEN],
-- char nvram_name[BRCMF_FW_NAME_LEN])
--{
-- char chipname[12];
-- u32 i;
-- char end;
--
-- for (i = 0; i < table_size; i++) {
-- if (mapping_table[i].chipid == chip &&
-- mapping_table[i].revmask & BIT(chiprev))
-- break;
-- }
--
-- if (i == table_size) {
-- brcmf_err("Unknown chipid %d [%d]\n", chip, chiprev);
-- return -ENODEV;
-- }
--
-- brcmf_chip_name(chip, chiprev, chipname, sizeof(chipname));
--
-- /* check if firmware path is provided by module parameter */
-- if (brcmf_mp_global.firmware_path[0] != '\0') {
-- if (fw_name)
-- strlcpy(fw_name, brcmf_mp_global.firmware_path,
-- BRCMF_FW_NAME_LEN);
-- if (nvram_name)
-- strlcpy(nvram_name, brcmf_mp_global.firmware_path,
-- BRCMF_FW_NAME_LEN);
--
-- end = brcmf_mp_global.firmware_path[
-- strlen(brcmf_mp_global.firmware_path) - 1];
-- if (end != '/') {
-- if (fw_name)
-- strlcat(fw_name, "/", BRCMF_FW_NAME_LEN);
-- if (nvram_name)
-- strlcat(nvram_name, "/", BRCMF_FW_NAME_LEN);
-- }
-- }
--
-- brcmf_info("using %s for chip %s\n",
-- mapping_table[i].fw_base, chipname);
-- if (fw_name)
-- brcmf_fw_get_full_name(fw_name,
-- mapping_table[i].fw_base, ".bin");
-- if (nvram_name)
-- brcmf_fw_get_full_name(nvram_name,
-- mapping_table[i].fw_base, ".txt");
--
-- return 0;
--}
--
- struct brcmf_fw_request *
- brcmf_fw_alloc_request(u32 chip, u32 chiprev,
- struct brcmf_firmware_mapping mapping_table[],
---- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/firmware.h
-+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/firmware.h
-@@ -46,10 +46,6 @@ MODULE_FIRMWARE(BRCMF_FW_DEFAULT_PATH fw
- #define BRCMF_FW_ENTRY(chipid, mask, name) \
- { chipid, mask, BRCM_ ## name ## _FIRMWARE_BASENAME }
-
--int brcmf_fw_map_chip_to_name(u32 chip, u32 chiprev,
-- struct brcmf_firmware_mapping mapping_table[],
-- u32 table_size, char fw_name[BRCMF_FW_NAME_LEN],
-- char nvram_name[BRCMF_FW_NAME_LEN]);
- void brcmf_fw_nvram_free(void *nvram);
-
- enum brcmf_fw_type {
diff --git a/package/kernel/mac80211/patches/327-v4.17-0011-brcmfmac-get-rid-of-brcmf_fw_get_full_name.patch b/package/kernel/mac80211/patches/327-v4.17-0011-brcmfmac-get-rid-of-brcmf_fw_get_full_name.patch
deleted file mode 100644
index d831f44fcd..0000000000
--- a/package/kernel/mac80211/patches/327-v4.17-0011-brcmfmac-get-rid-of-brcmf_fw_get_full_name.patch
+++ /dev/null
@@ -1,44 +0,0 @@
-From bf291b7247e53f52a4236c0b55a5df046d6177df Mon Sep 17 00:00:00 2001
-From: Arend Van Spriel <arend.vanspriel@broadcom.com>
-Date: Thu, 22 Mar 2018 21:28:30 +0100
-Subject: [PATCH] brcmfmac: get rid of brcmf_fw_get_full_name()
-
-The function was pretty minimal and now it is called only from one
-place so just get rid of it.
-
-Signed-off-by: Arend van Spriel <arend.vanspriel@broadcom.com>
-Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
----
- .../net/wireless/broadcom/brcm80211/brcmfmac/firmware.c | 14 ++++----------
- 1 file changed, 4 insertions(+), 10 deletions(-)
-
---- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/firmware.c
-+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/firmware.c
-@@ -628,13 +628,6 @@ int brcmf_fw_get_firmwares(struct device
- return 0;
- }
-
--static void brcmf_fw_get_full_name(char fw_name[BRCMF_FW_NAME_LEN],
-- const char *fw_base, const char *extension)
--{
-- strlcat(fw_name, fw_base, BRCMF_FW_NAME_LEN);
-- strlcat(fw_name, extension, BRCMF_FW_NAME_LEN);
--}
--
- struct brcmf_fw_request *
- brcmf_fw_alloc_request(u32 chip, u32 chiprev,
- struct brcmf_firmware_mapping mapping_table[],
-@@ -685,9 +678,10 @@ brcmf_fw_alloc_request(u32 chip, u32 chi
- BRCMF_FW_NAME_LEN);
- }
- }
-- brcmf_fw_get_full_name(fwnames[j].path,
-- mapping_table[i].fw_base,
-- fwnames[j].extension);
-+ strlcat(fwnames[j].path, mapping_table[i].fw_base,
-+ BRCMF_FW_NAME_LEN);
-+ strlcat(fwnames[j].path, fwnames[j].extension,
-+ BRCMF_FW_NAME_LEN);
- fwreq->items[j].path = fwnames[j].path;
- }
-
diff --git a/package/kernel/mac80211/patches/327-v4.17-0012-brcmfmac-add-kerneldoc-for-struct-brcmf_bus-msgbuf.patch b/package/kernel/mac80211/patches/327-v4.17-0012-brcmfmac-add-kerneldoc-for-struct-brcmf_bus-msgbuf.patch
deleted file mode 100644
index 1c9c99599f..0000000000
--- a/package/kernel/mac80211/patches/327-v4.17-0012-brcmfmac-add-kerneldoc-for-struct-brcmf_bus-msgbuf.patch
+++ /dev/null
@@ -1,23 +0,0 @@
-From 48eaee3f272a5bfe6986d07c51f6975d3c2f74d1 Mon Sep 17 00:00:00 2001
-From: Arend Van Spriel <arend.vanspriel@broadcom.com>
-Date: Thu, 22 Mar 2018 21:28:31 +0100
-Subject: [PATCH] brcmfmac: add kerneldoc for struct brcmf_bus::msgbuf
-
-This field did not have kerneldoc description so adding it now.
-
-Signed-off-by: Arend van Spriel <arend.vanspriel@broadcom.com>
-Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
----
- drivers/net/wireless/broadcom/brcm80211/brcmfmac/bus.h | 1 +
- 1 file changed, 1 insertion(+)
-
---- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/bus.h
-+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/bus.h
-@@ -140,6 +140,7 @@ struct brcmf_bus_stats {
- * @always_use_fws_queue: bus wants use queue also when fwsignal is inactive.
- * @wowl_supported: is wowl supported by bus driver.
- * @chiprev: revision of the dongle chip.
-+ * @msgbuf: msgbuf protocol parameters provided by bus layer.
- */
- struct brcmf_bus {
- union {
diff --git a/package/kernel/mac80211/patches/328-v4.17-0001-brcmfmac-fix-firmware-request-processing-if-nvram-lo.patch b/package/kernel/mac80211/patches/328-v4.17-0001-brcmfmac-fix-firmware-request-processing-if-nvram-lo.patch
deleted file mode 100644
index cd2279dd65..0000000000
--- a/package/kernel/mac80211/patches/328-v4.17-0001-brcmfmac-fix-firmware-request-processing-if-nvram-lo.patch
+++ /dev/null
@@ -1,81 +0,0 @@
-From 0b5c0305e57ca940713bcb2b202fd2b412c62f31 Mon Sep 17 00:00:00 2001
-From: Arend Van Spriel <arend.vanspriel@broadcom.com>
-Date: Tue, 3 Apr 2018 10:18:15 +0200
-Subject: [PATCH] brcmfmac: fix firmware request processing if nvram load fails
-
-When nvram loading fails a double free occurred. Fix this and reorg the
-code a little.
-
-Fixes: d09ae51a4b67 ("brcmfmac: pass struct in brcmf_fw_get_firmwares()")
-Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
-Signed-off-by: Arend van Spriel <arend.vanspriel@broadcom.com>
-Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
----
- .../broadcom/brcm80211/brcmfmac/firmware.c | 36 ++++++++++++----------
- 1 file changed, 20 insertions(+), 16 deletions(-)
-
---- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/firmware.c
-+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/firmware.c
-@@ -459,7 +459,7 @@ static void brcmf_fw_free_request(struct
- kfree(req);
- }
-
--static void brcmf_fw_request_nvram_done(const struct firmware *fw, void *ctx)
-+static int brcmf_fw_request_nvram_done(const struct firmware *fw, void *ctx)
- {
- struct brcmf_fw *fwctx = ctx;
- struct brcmf_fw_item *cur;
-@@ -498,13 +498,10 @@ static void brcmf_fw_request_nvram_done(
- brcmf_dbg(TRACE, "nvram %p len %d\n", nvram, nvram_length);
- cur->nv_data.data = nvram;
- cur->nv_data.len = nvram_length;
-- return;
-+ return 0;
-
- fail:
-- brcmf_dbg(TRACE, "failed: dev=%s\n", dev_name(fwctx->dev));
-- fwctx->done(fwctx->dev, -ENOENT, NULL);
-- brcmf_fw_free_request(fwctx->req);
-- kfree(fwctx);
-+ return -ENOENT;
- }
-
- static int brcmf_fw_request_next_item(struct brcmf_fw *fwctx, bool async)
-@@ -553,20 +550,27 @@ static void brcmf_fw_request_done(const
- brcmf_dbg(TRACE, "enter: firmware %s %sfound\n", cur->path,
- fw ? "" : "not ");
-
-- if (fw) {
-- if (cur->type == BRCMF_FW_TYPE_BINARY)
-- cur->binary = fw;
-- else if (cur->type == BRCMF_FW_TYPE_NVRAM)
-- brcmf_fw_request_nvram_done(fw, fwctx);
-- else
-- release_firmware(fw);
-- } else if (cur->type == BRCMF_FW_TYPE_NVRAM) {
-- brcmf_fw_request_nvram_done(NULL, fwctx);
-- } else if (!(cur->flags & BRCMF_FW_REQF_OPTIONAL)) {
-+ if (!fw)
- ret = -ENOENT;
-+
-+ switch (cur->type) {
-+ case BRCMF_FW_TYPE_NVRAM:
-+ ret = brcmf_fw_request_nvram_done(fw, fwctx);
-+ break;
-+ case BRCMF_FW_TYPE_BINARY:
-+ cur->binary = fw;
-+ break;
-+ default:
-+ /* something fishy here so bail out early */
-+ brcmf_err("unknown fw type: %d\n", cur->type);
-+ release_firmware(fw);
-+ ret = -EINVAL;
- goto fail;
- }
-
-+ if (ret < 0 && !(cur->flags & BRCMF_FW_REQF_OPTIONAL))
-+ goto fail;
-+
- do {
- if (++fwctx->curpos == fwctx->req->n_items) {
- ret = 0;
diff --git a/package/kernel/mac80211/patches/329-v4.18-0001-brcmfmac-add-support-for-BCM4366E-chipset.patch b/package/kernel/mac80211/patches/329-v4.18-0001-brcmfmac-add-support-for-BCM4366E-chipset.patch
deleted file mode 100644
index e31d69826d..0000000000
--- a/package/kernel/mac80211/patches/329-v4.18-0001-brcmfmac-add-support-for-BCM4366E-chipset.patch
+++ /dev/null
@@ -1,48 +0,0 @@
-From 1f589e2510d5df1192dca7c089103a2cbd028101 Mon Sep 17 00:00:00 2001
-From: Dan Haab <dhaab@luxul.com>
-Date: Tue, 3 Apr 2018 10:21:56 +0200
-Subject: [PATCH] brcmfmac: add support for BCM4366E chipset
-
-BCM4366E is a wireless chipset with a BCM43664 ChipCommon. It's
-supported by the same firmware as 4366c0.
-
-Signed-off-by: Dan Haab <dan.haab@luxul.com>
-[arend: rebase patch and remove unnecessary definition]
-Signed-off-by: Arend van Spriel <arend.vanspriel@broadcom.com>
-Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
----
- drivers/net/wireless/broadcom/brcm80211/brcmfmac/chip.c | 1 +
- drivers/net/wireless/broadcom/brcm80211/brcmfmac/pcie.c | 1 +
- drivers/net/wireless/broadcom/brcm80211/include/brcm_hw_ids.h | 1 +
- 3 files changed, 3 insertions(+)
-
---- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/chip.c
-+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/chip.c
-@@ -689,6 +689,7 @@ static u32 brcmf_chip_tcm_rambase(struct
- case BRCM_CC_43525_CHIP_ID:
- case BRCM_CC_4365_CHIP_ID:
- case BRCM_CC_4366_CHIP_ID:
-+ case BRCM_CC_43664_CHIP_ID:
- return 0x200000;
- case CY_CC_4373_CHIP_ID:
- return 0x160000;
---- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/pcie.c
-+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/pcie.c
-@@ -75,6 +75,7 @@ static struct brcmf_firmware_mapping brc
- BRCMF_FW_ENTRY(BRCM_CC_4365_CHIP_ID, 0xFFFFFFF0, 4365C),
- BRCMF_FW_ENTRY(BRCM_CC_4366_CHIP_ID, 0x0000000F, 4366B),
- BRCMF_FW_ENTRY(BRCM_CC_4366_CHIP_ID, 0xFFFFFFF0, 4366C),
-+ BRCMF_FW_ENTRY(BRCM_CC_43664_CHIP_ID, 0xFFFFFFF0, 4366C),
- BRCMF_FW_ENTRY(BRCM_CC_4371_CHIP_ID, 0xFFFFFFFF, 4371),
- };
-
---- a/drivers/net/wireless/broadcom/brcm80211/include/brcm_hw_ids.h
-+++ b/drivers/net/wireless/broadcom/brcm80211/include/brcm_hw_ids.h
-@@ -57,6 +57,7 @@
- #define BRCM_CC_43602_CHIP_ID 43602
- #define BRCM_CC_4365_CHIP_ID 0x4365
- #define BRCM_CC_4366_CHIP_ID 0x4366
-+#define BRCM_CC_43664_CHIP_ID 43664
- #define BRCM_CC_4371_CHIP_ID 0x4371
- #define CY_CC_4373_CHIP_ID 0x4373
-
diff --git a/package/kernel/mac80211/patches/330-v4.18-0001-brcmfmac-check-p2pdev-mac-address-uniqueness.patch b/package/kernel/mac80211/patches/330-v4.18-0001-brcmfmac-check-p2pdev-mac-address-uniqueness.patch
deleted file mode 100644
index 909000cc59..0000000000
--- a/package/kernel/mac80211/patches/330-v4.18-0001-brcmfmac-check-p2pdev-mac-address-uniqueness.patch
+++ /dev/null
@@ -1,34 +0,0 @@
-From cb746e47837ad0f35c8ae28e9aacc8eb07916d2a Mon Sep 17 00:00:00 2001
-From: Arend Van Spriel <arend.vanspriel@broadcom.com>
-Date: Thu, 26 Apr 2018 12:16:47 +0200
-Subject: [PATCH] brcmfmac: check p2pdev mac address uniqueness
-
-The mac address for p2pdev must be different from the primary interface
-due to firmware requirement. Add an explicit check for this requirement
-if user-space provides a mac address.
-
-Reviewed-by: Hante Meuleman <hante.meuleman@broadcom.com>
-Reviewed-by: Pieter-Paul Giesberts <pieter-paul.giesberts@broadcom.com>
-Reviewed-by: Franky Lin <franky.lin@broadcom.com>
-Signed-off-by: Arend van Spriel <arend.vanspriel@broadcom.com>
-Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
----
- drivers/net/wireless/broadcom/brcm80211/brcmfmac/p2p.c | 7 +++++++
- 1 file changed, 7 insertions(+)
-
---- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/p2p.c
-+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/p2p.c
-@@ -2073,6 +2073,13 @@ static struct wireless_dev *brcmf_p2p_cr
- }
-
- pri_ifp = p2p->bss_idx[P2PAPI_BSSCFG_PRIMARY].vif->ifp;
-+
-+ /* firmware requires unique mac address for p2pdev interface */
-+ if (addr && ether_addr_equal(addr, pri_ifp->mac_addr)) {
-+ brcmf_err("discovery vif must be different from primary interface\n");
-+ return ERR_PTR(-EINVAL);
-+ }
-+
- brcmf_p2p_generate_bss_mac(p2p, addr);
- brcmf_p2p_set_firmware(pri_ifp, p2p->dev_addr);
-
diff --git a/package/kernel/mac80211/patches/330-v4.18-0002-brcmfmac-reports-boottime_ns-while-informing-bss.patch b/package/kernel/mac80211/patches/330-v4.18-0002-brcmfmac-reports-boottime_ns-while-informing-bss.patch
deleted file mode 100644
index 4f59507cab..0000000000
--- a/package/kernel/mac80211/patches/330-v4.18-0002-brcmfmac-reports-boottime_ns-while-informing-bss.patch
+++ /dev/null
@@ -1,76 +0,0 @@
-From 7742fce4c007141617dab9bcb90034b3c0fe2347 Mon Sep 17 00:00:00 2001
-From: Franky Lin <franky.lin@broadcom.com>
-Date: Thu, 26 Apr 2018 12:18:35 +0200
-Subject: [PATCH] brcmfmac: reports boottime_ns while informing bss
-
-Provides a timestamp in bss information so user space can see when the
-bss info was updated. Since tsf is not available from the dongle events
-boottime is reported instead.
-
-Reported-by: Dmitry Shmidt <dimitrysh@google.com>
-Reviewed-by: Arend van Spriel <arend.vanspriel@broadcom.com>
-Signed-off-by: Franky Lin <franky.lin@broadcom.com>
-Signed-off-by: Arend van Spriel <arend.vanspriel@broadcom.com>
-Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
----
- .../broadcom/brcm80211/brcmfmac/cfg80211.c | 26 +++++++++++-----------
- 1 file changed, 13 insertions(+), 13 deletions(-)
-
---- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c
-+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c
-@@ -2728,7 +2728,6 @@ static s32 brcmf_inform_single_bss(struc
- struct brcmf_bss_info_le *bi)
- {
- struct wiphy *wiphy = cfg_to_wiphy(cfg);
-- struct ieee80211_channel *notify_channel;
- struct cfg80211_bss *bss;
- struct ieee80211_supported_band *band;
- struct brcmu_chan ch;
-@@ -2738,7 +2737,7 @@ static s32 brcmf_inform_single_bss(struc
- u16 notify_interval;
- u8 *notify_ie;
- size_t notify_ielen;
-- s32 notify_signal;
-+ struct cfg80211_inform_bss bss_data = { 0 };
-
- if (le32_to_cpu(bi->length) > WL_BSS_INFO_MAX) {
- brcmf_err("Bss info is larger than buffer. Discarding\n");
-@@ -2758,27 +2757,28 @@ static s32 brcmf_inform_single_bss(struc
- band = wiphy->bands[NL80211_BAND_5GHZ];
-
- freq = ieee80211_channel_to_frequency(channel, band->band);
-- notify_channel = ieee80211_get_channel(wiphy, freq);
-+ bss_data.chan = ieee80211_get_channel(wiphy, freq);
-+ bss_data.scan_width = NL80211_BSS_CHAN_WIDTH_20;
-+ bss_data.boottime_ns = ktime_to_ns(ktime_get_boottime());
-
- notify_capability = le16_to_cpu(bi->capability);
- notify_interval = le16_to_cpu(bi->beacon_period);
- notify_ie = (u8 *)bi + le16_to_cpu(bi->ie_offset);
- notify_ielen = le32_to_cpu(bi->ie_length);
-- notify_signal = (s16)le16_to_cpu(bi->RSSI) * 100;
-+ bss_data.signal = (s16)le16_to_cpu(bi->RSSI) * 100;
-
- brcmf_dbg(CONN, "bssid: %pM\n", bi->BSSID);
- brcmf_dbg(CONN, "Channel: %d(%d)\n", channel, freq);
- brcmf_dbg(CONN, "Capability: %X\n", notify_capability);
- brcmf_dbg(CONN, "Beacon interval: %d\n", notify_interval);
-- brcmf_dbg(CONN, "Signal: %d\n", notify_signal);
-+ brcmf_dbg(CONN, "Signal: %d\n", bss_data.signal);
-
-- bss = cfg80211_inform_bss(wiphy, notify_channel,
-- CFG80211_BSS_FTYPE_UNKNOWN,
-- (const u8 *)bi->BSSID,
-- 0, notify_capability,
-- notify_interval, notify_ie,
-- notify_ielen, notify_signal,
-- GFP_KERNEL);
-+ bss = cfg80211_inform_bss_data(wiphy, &bss_data,
-+ CFG80211_BSS_FTYPE_UNKNOWN,
-+ (const u8 *)bi->BSSID,
-+ 0, notify_capability,
-+ notify_interval, notify_ie,
-+ notify_ielen, GFP_KERNEL);
-
- if (!bss)
- return -ENOMEM;
diff --git a/package/kernel/mac80211/patches/330-v4.18-0003-brcmfmac-use-nl80211_band-directly-to-get-ieee80211-.patch b/package/kernel/mac80211/patches/330-v4.18-0003-brcmfmac-use-nl80211_band-directly-to-get-ieee80211-.patch
deleted file mode 100644
index 2d60c0d9ee..0000000000
--- a/package/kernel/mac80211/patches/330-v4.18-0003-brcmfmac-use-nl80211_band-directly-to-get-ieee80211-.patch
+++ /dev/null
@@ -1,43 +0,0 @@
-From aed14219067ab96e5eeb7730e9bceed10d9be989 Mon Sep 17 00:00:00 2001
-From: Franky Lin <franky.lin@broadcom.com>
-Date: Thu, 26 Apr 2018 12:16:48 +0200
-Subject: [PATCH] brcmfmac: use nl80211_band directly to get ieee80211 channel
-
-The enum nl80211_band used to retrieve wiphy->bands is the same as
-wiphy->bands->band which is checked by wiphy_register(). So it can be used
-directly as parameter of ieee80211_channel_to_frequency().
-
-Reviewed-by: Arend van Spriel <arend.vanspriel@broadcom.com>
-Signed-off-by: Franky Lin <franky.lin@broadcom.com>
-Signed-off-by: Arend van Spriel <arend.vanspriel@broadcom.com>
-Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
----
- drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c | 8 ++++----
- 1 file changed, 4 insertions(+), 4 deletions(-)
-
---- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c
-+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c
-@@ -2729,7 +2729,7 @@ static s32 brcmf_inform_single_bss(struc
- {
- struct wiphy *wiphy = cfg_to_wiphy(cfg);
- struct cfg80211_bss *bss;
-- struct ieee80211_supported_band *band;
-+ enum nl80211_band band;
- struct brcmu_chan ch;
- u16 channel;
- u32 freq;
-@@ -2752,11 +2752,11 @@ static s32 brcmf_inform_single_bss(struc
- channel = bi->ctl_ch;
-
- if (channel <= CH_MAX_2G_CHANNEL)
-- band = wiphy->bands[NL80211_BAND_2GHZ];
-+ band = NL80211_BAND_2GHZ;
- else
-- band = wiphy->bands[NL80211_BAND_5GHZ];
-+ band = NL80211_BAND_5GHZ;
-
-- freq = ieee80211_channel_to_frequency(channel, band->band);
-+ freq = ieee80211_channel_to_frequency(channel, band);
- bss_data.chan = ieee80211_get_channel(wiphy, freq);
- bss_data.scan_width = NL80211_BSS_CHAN_WIDTH_20;
- bss_data.boottime_ns = ktime_to_ns(ktime_get_boottime());
diff --git a/package/kernel/mac80211/patches/330-v4.18-0004-brcmfmac-constify-firmware-mapping-tables.patch b/package/kernel/mac80211/patches/330-v4.18-0004-brcmfmac-constify-firmware-mapping-tables.patch
deleted file mode 100644
index df2648374a..0000000000
--- a/package/kernel/mac80211/patches/330-v4.18-0004-brcmfmac-constify-firmware-mapping-tables.patch
+++ /dev/null
@@ -1,76 +0,0 @@
-From ff68c9f9c06d1fd437c8f90fc05ca28c47f7d85e Mon Sep 17 00:00:00 2001
-From: Arend Van Spriel <arend.vanspriel@broadcom.com>
-Date: Thu, 26 Apr 2018 12:16:49 +0200
-Subject: [PATCH] brcmfmac: constify firmware mapping tables
-
-The information in the firmware mapping does not need to be modified
-so it can be static const.
-
-Reviewed-by: Hante Meuleman <hante.meuleman@broadcom.com>
-Reviewed-by: Pieter-Paul Giesberts <pieter-paul.giesberts@broadcom.com>
-Reviewed-by: Franky Lin <franky.lin@broadcom.com>
-Signed-off-by: Arend van Spriel <arend.vanspriel@broadcom.com>
-Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
----
- drivers/net/wireless/broadcom/brcm80211/brcmfmac/firmware.c | 2 +-
- drivers/net/wireless/broadcom/brcm80211/brcmfmac/firmware.h | 2 +-
- drivers/net/wireless/broadcom/brcm80211/brcmfmac/pcie.c | 2 +-
- drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c | 2 +-
- drivers/net/wireless/broadcom/brcm80211/brcmfmac/usb.c | 2 +-
- 5 files changed, 5 insertions(+), 5 deletions(-)
-
---- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/firmware.c
-+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/firmware.c
-@@ -634,7 +634,7 @@ int brcmf_fw_get_firmwares(struct device
-
- struct brcmf_fw_request *
- brcmf_fw_alloc_request(u32 chip, u32 chiprev,
-- struct brcmf_firmware_mapping mapping_table[],
-+ const struct brcmf_firmware_mapping mapping_table[],
- u32 table_size, struct brcmf_fw_name *fwnames,
- u32 n_fwnames)
- {
---- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/firmware.h
-+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/firmware.h
-@@ -80,7 +80,7 @@ struct brcmf_fw_name {
-
- struct brcmf_fw_request *
- brcmf_fw_alloc_request(u32 chip, u32 chiprev,
-- struct brcmf_firmware_mapping mapping_table[],
-+ const struct brcmf_firmware_mapping mapping_table[],
- u32 table_size, struct brcmf_fw_name *fwnames,
- u32 n_fwnames);
-
---- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/pcie.c
-+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/pcie.c
-@@ -59,7 +59,7 @@ BRCMF_FW_DEF(4366B, "brcmfmac4366b-pcie"
- BRCMF_FW_DEF(4366C, "brcmfmac4366c-pcie");
- BRCMF_FW_DEF(4371, "brcmfmac4371-pcie");
-
--static struct brcmf_firmware_mapping brcmf_pcie_fwnames[] = {
-+static const struct brcmf_firmware_mapping brcmf_pcie_fwnames[] = {
- BRCMF_FW_ENTRY(BRCM_CC_43602_CHIP_ID, 0xFFFFFFFF, 43602),
- BRCMF_FW_ENTRY(BRCM_CC_43465_CHIP_ID, 0xFFFFFFF0, 4366C),
- BRCMF_FW_ENTRY(BRCM_CC_4350_CHIP_ID, 0x000000FF, 4350C),
---- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c
-+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c
-@@ -619,7 +619,7 @@ BRCMF_FW_DEF(4354, "brcmfmac4354-sdio");
- BRCMF_FW_DEF(4356, "brcmfmac4356-sdio");
- BRCMF_FW_DEF(4373, "brcmfmac4373-sdio");
-
--static struct brcmf_firmware_mapping brcmf_sdio_fwnames[] = {
-+static const struct brcmf_firmware_mapping brcmf_sdio_fwnames[] = {
- BRCMF_FW_ENTRY(BRCM_CC_43143_CHIP_ID, 0xFFFFFFFF, 43143),
- BRCMF_FW_ENTRY(BRCM_CC_43241_CHIP_ID, 0x0000001F, 43241B0),
- BRCMF_FW_ENTRY(BRCM_CC_43241_CHIP_ID, 0x00000020, 43241B4),
---- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/usb.c
-+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/usb.c
-@@ -52,7 +52,7 @@ BRCMF_FW_DEF(43242A, "brcmfmac43242a");
- BRCMF_FW_DEF(43569, "brcmfmac43569");
- BRCMF_FW_DEF(4373, "brcmfmac4373");
-
--static struct brcmf_firmware_mapping brcmf_usb_fwnames[] = {
-+static const struct brcmf_firmware_mapping brcmf_usb_fwnames[] = {
- BRCMF_FW_ENTRY(BRCM_CC_43143_CHIP_ID, 0xFFFFFFFF, 43143),
- BRCMF_FW_ENTRY(BRCM_CC_43235_CHIP_ID, 0x00000008, 43236B),
- BRCMF_FW_ENTRY(BRCM_CC_43236_CHIP_ID, 0x00000008, 43236B),
diff --git a/package/kernel/mac80211/patches/330-v4.18-0005-brcmfmac-add-hostready-indication.patch b/package/kernel/mac80211/patches/330-v4.18-0005-brcmfmac-add-hostready-indication.patch
deleted file mode 100644
index e3d4441f7f..0000000000
--- a/package/kernel/mac80211/patches/330-v4.18-0005-brcmfmac-add-hostready-indication.patch
+++ /dev/null
@@ -1,74 +0,0 @@
-From 84ad327d18debe19b8d509059b61db445d048b02 Mon Sep 17 00:00:00 2001
-From: Franky Lin <franky.lin@broadcom.com>
-Date: Thu, 26 Apr 2018 12:16:50 +0200
-Subject: [PATCH] brcmfmac: add hostready indication
-
-A hostready signal is introduced to inform firmware through mailbox
-doorbell1 when common ring initialized or D3 exited.
-
-Reviewed-by: Arend van Spriel <arend.vanspriel@broadcom.com>
-Signed-off-by: Franky Lin <franky.lin@broadcom.com>
-Signed-off-by: Arend van Spriel <arend.vanspriel@broadcom.com>
-Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
----
- drivers/net/wireless/broadcom/brcm80211/brcmfmac/pcie.c | 14 ++++++++++++--
- 1 file changed, 12 insertions(+), 2 deletions(-)
-
---- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/pcie.c
-+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/pcie.c
-@@ -105,7 +105,8 @@ static const struct brcmf_firmware_mappi
- #define BRCMF_PCIE_PCIE2REG_MAILBOXMASK 0x4C
- #define BRCMF_PCIE_PCIE2REG_CONFIGADDR 0x120
- #define BRCMF_PCIE_PCIE2REG_CONFIGDATA 0x124
--#define BRCMF_PCIE_PCIE2REG_H2D_MAILBOX 0x140
-+#define BRCMF_PCIE_PCIE2REG_H2D_MAILBOX_0 0x140
-+#define BRCMF_PCIE_PCIE2REG_H2D_MAILBOX_1 0x144
-
- #define BRCMF_PCIE2_INTA 0x01
- #define BRCMF_PCIE2_INTB 0x02
-@@ -140,6 +141,7 @@ static const struct brcmf_firmware_mappi
- #define BRCMF_PCIE_SHARED_VERSION_MASK 0x00FF
- #define BRCMF_PCIE_SHARED_DMA_INDEX 0x10000
- #define BRCMF_PCIE_SHARED_DMA_2B_IDX 0x100000
-+#define BRCMF_PCIE_SHARED_HOSTRDY_DB1 0x10000000
-
- #define BRCMF_PCIE_FLAGS_HTOD_SPLIT 0x4000
- #define BRCMF_PCIE_FLAGS_DTOH_SPLIT 0x8000
-@@ -782,6 +784,12 @@ static void brcmf_pcie_intr_enable(struc
- BRCMF_PCIE_MB_INT_FN0_1);
- }
-
-+static void brcmf_pcie_hostready(struct brcmf_pciedev_info *devinfo)
-+{
-+ if (devinfo->shared.flags & BRCMF_PCIE_SHARED_HOSTRDY_DB1)
-+ brcmf_pcie_write_reg32(devinfo,
-+ BRCMF_PCIE_PCIE2REG_H2D_MAILBOX_1, 1);
-+}
-
- static irqreturn_t brcmf_pcie_quick_check_isr(int irq, void *arg)
- {
-@@ -924,7 +932,7 @@ static int brcmf_pcie_ring_mb_ring_bell(
-
- brcmf_dbg(PCIE, "RING !\n");
- /* Any arbitrary value will do, lets use 1 */
-- brcmf_pcie_write_reg32(devinfo, BRCMF_PCIE_PCIE2REG_H2D_MAILBOX, 1);
-+ brcmf_pcie_write_reg32(devinfo, BRCMF_PCIE_PCIE2REG_H2D_MAILBOX_0, 1);
-
- return 0;
- }
-@@ -1728,6 +1736,7 @@ static void brcmf_pcie_setup(struct devi
- init_waitqueue_head(&devinfo->mbdata_resp_wait);
-
- brcmf_pcie_intr_enable(devinfo);
-+ brcmf_pcie_hostready(devinfo);
- if (brcmf_attach(&devinfo->pdev->dev, devinfo->settings) == 0)
- return;
-
-@@ -1950,6 +1959,7 @@ static int brcmf_pcie_pm_leave_D3(struct
- brcmf_pcie_select_core(devinfo, BCMA_CORE_PCIE2);
- brcmf_bus_change_state(bus, BRCMF_BUS_UP);
- brcmf_pcie_intr_enable(devinfo);
-+ brcmf_pcie_hostready(devinfo);
- return 0;
- }
-
diff --git a/package/kernel/mac80211/patches/330-v4.18-0006-brcmfmac-coarse-support-for-PCIe-shared-structure-re.patch b/package/kernel/mac80211/patches/330-v4.18-0006-brcmfmac-coarse-support-for-PCIe-shared-structure-re.patch
deleted file mode 100644
index 8750037d85..0000000000
--- a/package/kernel/mac80211/patches/330-v4.18-0006-brcmfmac-coarse-support-for-PCIe-shared-structure-re.patch
+++ /dev/null
@@ -1,97 +0,0 @@
-From f56324baf329bc9362a52ad77a4a1a0f3356d1bc Mon Sep 17 00:00:00 2001
-From: Franky Lin <franky.lin@broadcom.com>
-Date: Thu, 26 Apr 2018 12:16:51 +0200
-Subject: [PATCH] brcmfmac: coarse support for PCIe shared structure rev7
-
-Revision 7 of PCIe dongle interface increases the item size of tx and rx
-complete rings to accommodate extra payload for new feature. This patch
-simply bump up the size of these two rings without adding the support
-for utilizing the new space. This makes brcmfmac compatible with rev7
-firmware.
-
-Reviewed-by: Arend van Spriel <arend.vanspriel@broadcom.com>
-Signed-off-by: Franky Lin <franky.lin@broadcom.com>
-Signed-off-by: Arend van Spriel <arend.vanspriel@broadcom.com>
-Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
----
- .../wireless/broadcom/brcm80211/brcmfmac/msgbuf.h | 6 ++++--
- .../wireless/broadcom/brcm80211/brcmfmac/pcie.c | 23 ++++++++++++++++++----
- 2 files changed, 23 insertions(+), 6 deletions(-)
-
---- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/msgbuf.h
-+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/msgbuf.h
-@@ -27,8 +27,10 @@
- #define BRCMF_H2D_MSGRING_CONTROL_SUBMIT_ITEMSIZE 40
- #define BRCMF_H2D_MSGRING_RXPOST_SUBMIT_ITEMSIZE 32
- #define BRCMF_D2H_MSGRING_CONTROL_COMPLETE_ITEMSIZE 24
--#define BRCMF_D2H_MSGRING_TX_COMPLETE_ITEMSIZE 16
--#define BRCMF_D2H_MSGRING_RX_COMPLETE_ITEMSIZE 32
-+#define BRCMF_D2H_MSGRING_TX_COMPLETE_ITEMSIZE_PRE_V7 16
-+#define BRCMF_D2H_MSGRING_TX_COMPLETE_ITEMSIZE 24
-+#define BRCMF_D2H_MSGRING_RX_COMPLETE_ITEMSIZE_PRE_V7 32
-+#define BRCMF_D2H_MSGRING_RX_COMPLETE_ITEMSIZE 40
- #define BRCMF_H2D_TXFLOWRING_ITEMSIZE 48
-
- struct msgbuf_buf_addr {
---- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/pcie.c
-+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/pcie.c
-@@ -136,8 +136,9 @@ static const struct brcmf_firmware_mappi
- BRCMF_PCIE_MB_INT_D2H3_DB0 | \
- BRCMF_PCIE_MB_INT_D2H3_DB1)
-
-+#define BRCMF_PCIE_SHARED_VERSION_7 7
- #define BRCMF_PCIE_MIN_SHARED_VERSION 5
--#define BRCMF_PCIE_MAX_SHARED_VERSION 6
-+#define BRCMF_PCIE_MAX_SHARED_VERSION BRCMF_PCIE_SHARED_VERSION_7
- #define BRCMF_PCIE_SHARED_VERSION_MASK 0x00FF
- #define BRCMF_PCIE_SHARED_DMA_INDEX 0x10000
- #define BRCMF_PCIE_SHARED_DMA_2B_IDX 0x100000
-@@ -318,6 +319,14 @@ static const u32 brcmf_ring_max_item[BRC
- BRCMF_D2H_MSGRING_RX_COMPLETE_MAX_ITEM
- };
-
-+static const u32 brcmf_ring_itemsize_pre_v7[BRCMF_NROF_COMMON_MSGRINGS] = {
-+ BRCMF_H2D_MSGRING_CONTROL_SUBMIT_ITEMSIZE,
-+ BRCMF_H2D_MSGRING_RXPOST_SUBMIT_ITEMSIZE,
-+ BRCMF_D2H_MSGRING_CONTROL_COMPLETE_ITEMSIZE,
-+ BRCMF_D2H_MSGRING_TX_COMPLETE_ITEMSIZE_PRE_V7,
-+ BRCMF_D2H_MSGRING_RX_COMPLETE_ITEMSIZE_PRE_V7
-+};
-+
- static const u32 brcmf_ring_itemsize[BRCMF_NROF_COMMON_MSGRINGS] = {
- BRCMF_H2D_MSGRING_CONTROL_SUBMIT_ITEMSIZE,
- BRCMF_H2D_MSGRING_RXPOST_SUBMIT_ITEMSIZE,
-@@ -1007,8 +1016,14 @@ brcmf_pcie_alloc_dma_and_ring(struct brc
- struct brcmf_pcie_ringbuf *ring;
- u32 size;
- u32 addr;
-+ const u32 *ring_itemsize_array;
-+
-+ if (devinfo->shared.version < BRCMF_PCIE_SHARED_VERSION_7)
-+ ring_itemsize_array = brcmf_ring_itemsize_pre_v7;
-+ else
-+ ring_itemsize_array = brcmf_ring_itemsize;
-
-- size = brcmf_ring_max_item[ring_id] * brcmf_ring_itemsize[ring_id];
-+ size = brcmf_ring_max_item[ring_id] * ring_itemsize_array[ring_id];
- dma_buf = brcmf_pcie_init_dmabuffer_for_device(devinfo, size,
- tcm_ring_phys_addr + BRCMF_RING_MEM_BASE_ADDR_OFFSET,
- &dma_handle);
-@@ -1018,7 +1033,7 @@ brcmf_pcie_alloc_dma_and_ring(struct brc
- addr = tcm_ring_phys_addr + BRCMF_RING_MAX_ITEM_OFFSET;
- brcmf_pcie_write_tcm16(devinfo, addr, brcmf_ring_max_item[ring_id]);
- addr = tcm_ring_phys_addr + BRCMF_RING_LEN_ITEMS_OFFSET;
-- brcmf_pcie_write_tcm16(devinfo, addr, brcmf_ring_itemsize[ring_id]);
-+ brcmf_pcie_write_tcm16(devinfo, addr, ring_itemsize_array[ring_id]);
-
- ring = kzalloc(sizeof(*ring), GFP_KERNEL);
- if (!ring) {
-@@ -1027,7 +1042,7 @@ brcmf_pcie_alloc_dma_and_ring(struct brc
- return NULL;
- }
- brcmf_commonring_config(&ring->commonring, brcmf_ring_max_item[ring_id],
-- brcmf_ring_itemsize[ring_id], dma_buf);
-+ ring_itemsize_array[ring_id], dma_buf);
- ring->dma_handle = dma_handle;
- ring->devinfo = devinfo;
- brcmf_commonring_register_cb(&ring->commonring,
diff --git a/package/kernel/mac80211/patches/331-v4.18-0001-brcmfmac-Add-support-for-bcm43364-wireless-chipset.patch b/package/kernel/mac80211/patches/331-v4.18-0001-brcmfmac-Add-support-for-bcm43364-wireless-chipset.patch
deleted file mode 100644
index 13f169be9f..0000000000
--- a/package/kernel/mac80211/patches/331-v4.18-0001-brcmfmac-Add-support-for-bcm43364-wireless-chipset.patch
+++ /dev/null
@@ -1,45 +0,0 @@
-From 9c4a121e82634aa000a702c98cd6f05b27d6e186 Mon Sep 17 00:00:00 2001
-From: Sean Lanigan <sean@lano.id.au>
-Date: Fri, 4 May 2018 16:48:23 +1000
-Subject: [PATCH] brcmfmac: Add support for bcm43364 wireless chipset
-
-Add support for the BCM43364 chipset via an SDIO interface, as used in
-e.g. the Murata 1FX module.
-
-The BCM43364 uses the same firmware as the BCM43430 (which is already
-included), the only difference is the omission of Bluetooth.
-
-However, the SDIO_ID for the BCM43364 is 02D0:A9A4, giving it a MODALIAS
-of sdio:c00v02D0dA9A4, which doesn't get recognised and hence doesn't
-load the brcmfmac module. Adding the 'A9A4' ID in the appropriate place
-triggers the brcmfmac driver to load, and then correctly use the
-firmware file 'brcmfmac43430-sdio.bin'.
-
-Signed-off-by: Sean Lanigan <sean@lano.id.au>
-Acked-by: Ulf Hansson <ulf.hansson@linaro.org>
-Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
----
- drivers/net/wireless/broadcom/brcm80211/brcmfmac/bcmsdh.c | 1 +
- include/linux/mmc/sdio_ids.h | 1 +
- 2 files changed, 2 insertions(+)
-
---- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/bcmsdh.c
-+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/bcmsdh.c
-@@ -963,6 +963,7 @@ static const struct sdio_device_id brcmf
- BRCMF_SDIO_DEVICE(SDIO_DEVICE_ID_BROADCOM_43340),
- BRCMF_SDIO_DEVICE(SDIO_DEVICE_ID_BROADCOM_43341),
- BRCMF_SDIO_DEVICE(SDIO_DEVICE_ID_BROADCOM_43362),
-+ BRCMF_SDIO_DEVICE(SDIO_DEVICE_ID_BROADCOM_43364),
- BRCMF_SDIO_DEVICE(SDIO_DEVICE_ID_BROADCOM_4335_4339),
- BRCMF_SDIO_DEVICE(SDIO_DEVICE_ID_BROADCOM_4339),
- BRCMF_SDIO_DEVICE(SDIO_DEVICE_ID_BROADCOM_43430),
---- a/include/linux/mmc/sdio_ids.h
-+++ b/include/linux/mmc/sdio_ids.h
-@@ -34,6 +34,7 @@
- #define SDIO_DEVICE_ID_BROADCOM_4335_4339 0x4335
- #define SDIO_DEVICE_ID_BROADCOM_4339 0x4339
- #define SDIO_DEVICE_ID_BROADCOM_43362 0xa962
-+#define SDIO_DEVICE_ID_BROADCOM_43364 0xa9a4
- #define SDIO_DEVICE_ID_BROADCOM_43430 0xa9a6
- #define SDIO_DEVICE_ID_BROADCOM_4345 0x4345
- #define SDIO_DEVICE_ID_BROADCOM_43455 0xa9bf
diff --git a/package/kernel/mac80211/patches/332-v4.18-0001-brcmfmac-set-WIPHY_FLAG_HAVE_AP_SME-flag.patch b/package/kernel/mac80211/patches/332-v4.18-0001-brcmfmac-set-WIPHY_FLAG_HAVE_AP_SME-flag.patch
deleted file mode 100644
index de41e1c453..0000000000
--- a/package/kernel/mac80211/patches/332-v4.18-0001-brcmfmac-set-WIPHY_FLAG_HAVE_AP_SME-flag.patch
+++ /dev/null
@@ -1,34 +0,0 @@
-From 1204aa17f3b4f63e67ac9b7c9afa9496485969c5 Mon Sep 17 00:00:00 2001
-From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= <rafal@milecki.pl>
-Date: Thu, 10 May 2018 15:21:39 +0200
-Subject: [PATCH] brcmfmac: set WIPHY_FLAG_HAVE_AP_SME flag
-MIME-Version: 1.0
-Content-Type: text/plain; charset=UTF-8
-Content-Transfer-Encoding: 8bit
-
-brcmfmac is a FullMAC driver and it implements/uses cfg80211 interface
-for stations management. At the same time it doesn't receive or pass up
-management frames.
-
-This flag indicates that authenticator doesn't have to subscribe to or
-handle management frames. Some authenticators (e.g. hostapd) were
-working with brcmfmac thanks to some extra assumptions. This commit
-clears up the situation.
-
-Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
-Acked-by: Arend van Spriel <arend.vanspriel@broadcom.com>
-Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
----
- drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c | 1 +
- 1 file changed, 1 insertion(+)
-
---- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c
-+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c
-@@ -6513,6 +6513,7 @@ static int brcmf_setup_wiphy(struct wiph
-
- wiphy->flags |= WIPHY_FLAG_NETNS_OK |
- WIPHY_FLAG_PS_ON_BY_DEFAULT |
-+ WIPHY_FLAG_HAVE_AP_SME |
- WIPHY_FLAG_OFFCHAN_TX |
- WIPHY_FLAG_HAS_REMAIN_ON_CHANNEL;
- if (brcmf_feat_is_enabled(ifp, BRCMF_FEAT_TDLS))
diff --git a/package/kernel/mac80211/patches/333-v4.18-0001-brcmfmac-fix-initialization-of-struct-cfg80211_infor.patch b/package/kernel/mac80211/patches/333-v4.18-0001-brcmfmac-fix-initialization-of-struct-cfg80211_infor.patch
deleted file mode 100644
index 2436bb8a8a..0000000000
--- a/package/kernel/mac80211/patches/333-v4.18-0001-brcmfmac-fix-initialization-of-struct-cfg80211_infor.patch
+++ /dev/null
@@ -1,29 +0,0 @@
-From 763ece85f45a6b93268e25a0abf02922f911dab4 Mon Sep 17 00:00:00 2001
-From: Franky Lin <franky.lin@broadcom.com>
-Date: Tue, 15 May 2018 11:14:44 +0200
-Subject: [PATCH] brcmfmac: fix initialization of struct cfg80211_inform_bss
- variable
-
-This patch fixes a sparse warning "Using plain integer as NULL pointer"
-about cfg80211_inform_bss structure initialization.
-
-Reported-by: kbuild test robot <lkp@intel.com>
-Reviewed-by: Arend van Spriel <arend.vanspriel@broadcom.com>
-Signed-off-by: Franky Lin <franky.lin@broadcom.com>
-Signed-off-by: Arend van Spriel <arend.vanspriel@broadcom.com>
-Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
----
- drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
---- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c
-+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c
-@@ -2737,7 +2737,7 @@ static s32 brcmf_inform_single_bss(struc
- u16 notify_interval;
- u8 *notify_ie;
- size_t notify_ielen;
-- struct cfg80211_inform_bss bss_data = { 0 };
-+ struct cfg80211_inform_bss bss_data = {};
-
- if (le32_to_cpu(bi->length) > WL_BSS_INFO_MAX) {
- brcmf_err("Bss info is larger than buffer. Discarding\n");
diff --git a/package/kernel/mac80211/patches/334-v4.18-0001-brcmfmac-add-debugfs-entry-for-reading-firmware-capa.patch b/package/kernel/mac80211/patches/334-v4.18-0001-brcmfmac-add-debugfs-entry-for-reading-firmware-capa.patch
deleted file mode 100644
index f350d1e819..0000000000
--- a/package/kernel/mac80211/patches/334-v4.18-0001-brcmfmac-add-debugfs-entry-for-reading-firmware-capa.patch
+++ /dev/null
@@ -1,75 +0,0 @@
-From 88001968245c42c26416476bf0ef960442371605 Mon Sep 17 00:00:00 2001
-From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= <rafal@milecki.pl>
-Date: Mon, 14 May 2018 08:48:20 +0200
-Subject: [PATCH] brcmfmac: add debugfs entry for reading firmware capabilities
-MIME-Version: 1.0
-Content-Type: text/plain; charset=UTF-8
-Content-Transfer-Encoding: 8bit
-
-This allows reading all capabilities as reported by a firmware. They are
-printed using native (raw) names, just like developers like it the most.
-It's how firmware reports support for various features, e.g. supported
-modes, supported standards, power saving details, max BSS-es.
-
-Access to all that info is useful for trying new firmwares, comparing
-them and debugging features AKA bugs.
-
-Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
-Reviewed-by: Arend van Spriel <arend.vanspriel@broadcom.com>
-Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
----
- .../wireless/broadcom/brcm80211/brcmfmac/feature.c | 36 ++++++++++++++++++++++
- 1 file changed, 36 insertions(+)
-
---- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/feature.c
-+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/feature.c
-@@ -165,6 +165,41 @@ static void brcmf_feat_firmware_capabili
- }
- }
-
-+/**
-+ * brcmf_feat_fwcap_debugfs_read() - expose firmware capabilities to debugfs.
-+ *
-+ * @seq: sequence for debugfs entry.
-+ * @data: raw data pointer.
-+ */
-+static int brcmf_feat_fwcap_debugfs_read(struct seq_file *seq, void *data)
-+{
-+ struct brcmf_bus *bus_if = dev_get_drvdata(seq->private);
-+ struct brcmf_if *ifp = brcmf_get_ifp(bus_if->drvr, 0);
-+ char caps[MAX_CAPS_BUFFER_SIZE + 1] = { };
-+ char *tmp;
-+ int err;
-+
-+ err = brcmf_fil_iovar_data_get(ifp, "cap", caps, sizeof(caps));
-+ if (err) {
-+ brcmf_err("could not get firmware cap (%d)\n", err);
-+ return err;
-+ }
-+
-+ /* Put every capability in a new line */
-+ for (tmp = caps; *tmp; tmp++) {
-+ if (*tmp == ' ')
-+ *tmp = '\n';
-+ }
-+
-+ /* Usually there is a space at the end of capabilities string */
-+ seq_printf(seq, "%s", caps);
-+ /* So make sure we don't print two line breaks */
-+ if (tmp > caps && *(tmp - 1) != '\n')
-+ seq_printf(seq, "\n");
-+
-+ return 0;
-+}
-+
- void brcmf_feat_attach(struct brcmf_pub *drvr)
- {
- struct brcmf_if *ifp = brcmf_get_ifp(drvr, 0);
-@@ -233,6 +268,7 @@ void brcmf_feat_attach(struct brcmf_pub
- void brcmf_feat_debugfs_create(struct brcmf_pub *drvr)
- {
- brcmf_debugfs_add_entry(drvr, "features", brcmf_feat_debugfs_read);
-+ brcmf_debugfs_add_entry(drvr, "fwcap", brcmf_feat_fwcap_debugfs_read);
- }
-
- bool brcmf_feat_is_enabled(struct brcmf_if *ifp, enum brcmf_feat_id id)
diff --git a/package/kernel/mac80211/patches/335-v4.18-0001-brcmfmac-move-ALLFFMAC-variable-in-flowring-module.patch b/package/kernel/mac80211/patches/335-v4.18-0001-brcmfmac-move-ALLFFMAC-variable-in-flowring-module.patch
deleted file mode 100644
index f353a60b87..0000000000
--- a/package/kernel/mac80211/patches/335-v4.18-0001-brcmfmac-move-ALLFFMAC-variable-in-flowring-module.patch
+++ /dev/null
@@ -1,52 +0,0 @@
-From f8793c26fe586659d6da3fa277e63961a69d314b Mon Sep 17 00:00:00 2001
-From: Arend Van Spriel <arend.vanspriel@broadcom.com>
-Date: Wed, 16 May 2018 14:11:58 +0200
-Subject: [PATCH] brcmfmac: move ALLFFMAC variable in flowring module
-
-The only user of ALLFFMAC is the flowring module so no need to
-expose it in a header file.
-
-Reviewed-by: Hante Meuleman <hante.meuleman@broadcom.com>
-Reviewed-by: Pieter-Paul Giesberts <pieter-paul.giesberts@broadcom.com>
-Reviewed-by: Franky Lin <franky.lin@broadcom.com>
-Signed-off-by: Arend van Spriel <arend.vanspriel@broadcom.com>
-Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
----
- drivers/net/wireless/broadcom/brcm80211/brcmfmac/common.c | 2 --
- drivers/net/wireless/broadcom/brcm80211/brcmfmac/common.h | 2 --
- drivers/net/wireless/broadcom/brcm80211/brcmfmac/flowring.c | 2 ++
- 3 files changed, 2 insertions(+), 4 deletions(-)
-
---- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/common.c
-+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/common.c
-@@ -36,8 +36,6 @@ MODULE_AUTHOR("Broadcom Corporation");
- MODULE_DESCRIPTION("Broadcom 802.11 wireless LAN fullmac driver.");
- MODULE_LICENSE("Dual BSD/GPL");
-
--const u8 ALLFFMAC[ETH_ALEN] = { 0xff, 0xff, 0xff, 0xff, 0xff, 0xff };
--
- #define BRCMF_DEFAULT_SCAN_CHANNEL_TIME 40
- #define BRCMF_DEFAULT_SCAN_UNASSOC_TIME 40
-
---- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/common.h
-+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/common.h
-@@ -19,8 +19,6 @@
- #include <linux/platform_data/brcmfmac.h>
- #include "fwil_types.h"
-
--extern const u8 ALLFFMAC[ETH_ALEN];
--
- #define BRCMF_FW_ALTPATH_LEN 256
-
- /* Definitions for the module global and device specific settings are defined
---- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/flowring.c
-+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/flowring.c
-@@ -46,6 +46,8 @@ static const u8 brcmf_flowring_prio2fifo
- 3
- };
-
-+static const u8 ALLFFMAC[ETH_ALEN] = { 0xff, 0xff, 0xff, 0xff, 0xff, 0xff };
-+
-
- static bool
- brcmf_flowring_is_tdls_mac(struct brcmf_flowring *flow, u8 mac[ETH_ALEN])
diff --git a/package/kernel/mac80211/patches/335-v4.18-0002-brcmfmac-add-support-for-sysfs-initiated-coredump.patch b/package/kernel/mac80211/patches/335-v4.18-0002-brcmfmac-add-support-for-sysfs-initiated-coredump.patch
deleted file mode 100644
index 86533b95b6..0000000000
--- a/package/kernel/mac80211/patches/335-v4.18-0002-brcmfmac-add-support-for-sysfs-initiated-coredump.patch
+++ /dev/null
@@ -1,76 +0,0 @@
-From 8e072168f75ebce85b96cbcefea2b10ddbd5913f Mon Sep 17 00:00:00 2001
-From: Arend Van Spriel <arend.vanspriel@broadcom.com>
-Date: Wed, 16 May 2018 14:11:59 +0200
-Subject: [PATCH] brcmfmac: add support for sysfs initiated coredump
-
-The driver already supports device coredump initiated by firmware
-event. Since commit 3c47d19ff4dc ("drivers: base: add coredump driver
-ops") it is also possible to initiate it from user-space through
-sysfs. This patch adds support for SDIO and PCIe devices.
-
-[rafal@milecki.pl: use LINUX_VERSION_CODE]
-Reviewed-by: Hante Meuleman <hante.meuleman@broadcom.com>
-Reviewed-by: Pieter-Paul Giesberts <pieter-paul.giesberts@broadcom.com>
-Reviewed-by: Franky Lin <franky.lin@broadcom.com>
-Signed-off-by: Arend van Spriel <arend.vanspriel@broadcom.com>
-Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
-Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
----
- drivers/net/wireless/broadcom/brcm80211/brcmfmac/bcmsdh.c | 1 +
- drivers/net/wireless/broadcom/brcm80211/brcmfmac/bus.h | 2 ++
- drivers/net/wireless/broadcom/brcm80211/brcmfmac/core.c | 8 ++++++++
- drivers/net/wireless/broadcom/brcm80211/brcmfmac/pcie.c | 1 +
- 4 files changed, 12 insertions(+)
-
---- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/bcmsdh.c
-+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/bcmsdh.c
-@@ -1165,6 +1165,9 @@ static struct sdio_driver brcmf_sdmmc_dr
- #ifdef CONFIG_PM_SLEEP
- .pm = &brcmf_sdio_pm_ops,
- #endif /* CONFIG_PM_SLEEP */
-+#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 17, 0)
-+ .coredump = brcmf_dev_coredump,
-+#endif
- },
- };
-
---- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/bus.h
-+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/bus.h
-@@ -250,6 +250,8 @@ int brcmf_attach(struct device *dev, str
- void brcmf_detach(struct device *dev);
- /* Indication from bus module that dongle should be reset */
- void brcmf_dev_reset(struct device *dev);
-+/* Request from bus module to initiate a coredump */
-+void brcmf_dev_coredump(struct device *dev);
-
- /* Configure the "global" bus state used by upper layers */
- void brcmf_bus_change_state(struct brcmf_bus *bus, enum brcmf_bus_state state);
---- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/core.c
-+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/core.c
-@@ -1201,6 +1201,14 @@ void brcmf_dev_reset(struct device *dev)
- brcmf_fil_cmd_int_set(drvr->iflist[0], BRCMF_C_TERMINATED, 1);
- }
-
-+void brcmf_dev_coredump(struct device *dev)
-+{
-+ struct brcmf_bus *bus_if = dev_get_drvdata(dev);
-+
-+ if (brcmf_debug_create_memdump(bus_if, NULL, 0) < 0)
-+ brcmf_dbg(TRACE, "failed to create coredump\n");
-+}
-+
- void brcmf_detach(struct device *dev)
- {
- s32 i;
---- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/pcie.c
-+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/pcie.c
-@@ -2044,6 +2044,9 @@ static struct pci_driver brcmf_pciedrvr
- #ifdef CONFIG_PM
- .driver.pm = &brcmf_pciedrvr_pm,
- #endif
-+#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 17, 0)
-+ .driver.coredump = brcmf_dev_coredump,
-+#endif
- };
-
-
diff --git a/package/kernel/mac80211/patches/335-v4.18-0004-brcmfmac-validate-user-provided-data-for-memdump-bef.patch b/package/kernel/mac80211/patches/335-v4.18-0004-brcmfmac-validate-user-provided-data-for-memdump-bef.patch
deleted file mode 100644
index 455009ef1d..0000000000
--- a/package/kernel/mac80211/patches/335-v4.18-0004-brcmfmac-validate-user-provided-data-for-memdump-bef.patch
+++ /dev/null
@@ -1,32 +0,0 @@
-From d2af9b566554e01f9ad67b330ce569dbc130e5d3 Mon Sep 17 00:00:00 2001
-From: Franky Lin <franky.lin@broadcom.com>
-Date: Wed, 16 May 2018 14:12:01 +0200
-Subject: [PATCH] brcmfmac: validate user provided data for memdump before
- copying
-
-In patch "brcmfmac: add support for sysfs initiated coredump", a new
-scenario of brcmf_debug_create_memdump was added in which the user of
-the function might not necessarily provide prefix data. Hence the
-function should not assume the data is always valid and should perform a
-check before copying.
-
-Reviewed-by: Arend van Spriel <arend.vanspriel@broadcom.com>
-Signed-off-by: Franky Lin <franky.lin@broadcom.com>
-Signed-off-by: Arend van Spriel <arend.vanspriel@broadcom.com>
-Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
----
- drivers/net/wireless/broadcom/brcm80211/brcmfmac/debug.c | 3 ++-
- 1 file changed, 2 insertions(+), 1 deletion(-)
-
---- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/debug.c
-+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/debug.c
-@@ -40,7 +40,8 @@ int brcmf_debug_create_memdump(struct br
- if (!dump)
- return -ENOMEM;
-
-- memcpy(dump, data, len);
-+ if (data && len > 0)
-+ memcpy(dump, data, len);
- err = brcmf_bus_get_memdump(bus, dump + len, ramsize);
- if (err) {
- vfree(dump);
diff --git a/package/kernel/mac80211/patches/335-v4.18-0005-brcmfmac-trigger-memory-dump-upon-firmware-halt-sign.patch b/package/kernel/mac80211/patches/335-v4.18-0005-brcmfmac-trigger-memory-dump-upon-firmware-halt-sign.patch
deleted file mode 100644
index b94e06fa44..0000000000
--- a/package/kernel/mac80211/patches/335-v4.18-0005-brcmfmac-trigger-memory-dump-upon-firmware-halt-sign.patch
+++ /dev/null
@@ -1,38 +0,0 @@
-From 8a3ab2f38f1669e3be6433a1f6b82a077b38c4c7 Mon Sep 17 00:00:00 2001
-From: Franky Lin <franky.lin@broadcom.com>
-Date: Wed, 16 May 2018 14:12:02 +0200
-Subject: [PATCH] brcmfmac: trigger memory dump upon firmware halt signal
-
-PCIe dongle firmware signals a halt/trap through mailbox interrupt.
-Trigger a memory dump upon receiving such signal could help to provide
-useful information for issue debug.
-
-Reviewed-by: Arend van Spriel <arend.vanspriel@broadcom.com>
-Signed-off-by: Franky Lin <franky.lin@broadcom.com>
-Signed-off-by: Arend van Spriel <arend.vanspriel@broadcom.com>
-Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
----
- drivers/net/wireless/broadcom/brcm80211/brcmfmac/pcie.c | 5 +++++
- 1 file changed, 5 insertions(+)
-
---- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/pcie.c
-+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/pcie.c
-@@ -182,6 +182,7 @@ static const struct brcmf_firmware_mappi
- #define BRCMF_D2H_DEV_D3_ACK 0x00000001
- #define BRCMF_D2H_DEV_DS_ENTER_REQ 0x00000002
- #define BRCMF_D2H_DEV_DS_EXIT_NOTE 0x00000004
-+#define BRCMF_D2H_DEV_FWHALT 0x10000000
-
- #define BRCMF_H2D_HOST_D3_INFORM 0x00000001
- #define BRCMF_H2D_HOST_DS_ACK 0x00000002
-@@ -717,6 +718,10 @@ static void brcmf_pcie_handle_mb_data(st
- devinfo->mbdata_completed = true;
- wake_up(&devinfo->mbdata_resp_wait);
- }
-+ if (dtoh_mb_data & BRCMF_D2H_DEV_FWHALT) {
-+ brcmf_dbg(PCIE, "D2H_MB_DATA: FW HALT\n");
-+ brcmf_dev_coredump(&devinfo->pdev->dev);
-+ }
- }
-
-
diff --git a/package/kernel/mac80211/patches/335-v4.18-0006-brcmfmac-trigger-memory-dump-on-SDIO-firmware-halt-m.patch b/package/kernel/mac80211/patches/335-v4.18-0006-brcmfmac-trigger-memory-dump-on-SDIO-firmware-halt-m.patch
deleted file mode 100644
index 045e20acfb..0000000000
--- a/package/kernel/mac80211/patches/335-v4.18-0006-brcmfmac-trigger-memory-dump-on-SDIO-firmware-halt-m.patch
+++ /dev/null
@@ -1,30 +0,0 @@
-From b8248236e92790ac635caeb4156e46ea2417e037 Mon Sep 17 00:00:00 2001
-From: Franky Lin <franky.lin@broadcom.com>
-Date: Wed, 16 May 2018 14:12:03 +0200
-Subject: [PATCH] brcmfmac: trigger memory dump on SDIO firmware halt message
-
-Attempt to dump dongle memory for debug upon receiving firmware halt
-message through dongle to host mail box interrupt.
-
-Reviewed-by: Arend van Spriel <arend.vanspriel@broadcom.com>
-Signed-off-by: Franky Lin <franky.lin@broadcom.com>
-Signed-off-by: Arend van Spriel <arend.vanspriel@broadcom.com>
-Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
----
- drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c | 4 +++-
- 1 file changed, 3 insertions(+), 1 deletion(-)
-
---- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c
-+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c
-@@ -1072,8 +1072,10 @@ static u32 brcmf_sdio_hostmail(struct br
- bus->sdcnt.f1regdata += 2;
-
- /* dongle indicates the firmware has halted/crashed */
-- if (hmb_data & HMB_DATA_FWHALT)
-+ if (hmb_data & HMB_DATA_FWHALT) {
- brcmf_err("mailbox indicates firmware halted\n");
-+ brcmf_dev_coredump(&sdiod->func1->dev);
-+ }
-
- /* Dongle recomposed rx frames, accept them again */
- if (hmb_data & HMB_DATA_NAKHANDLED) {
diff --git a/package/kernel/mac80211/patches/336-v4.18-brcmfmac-stop-watchdog-before-detach-and-free-everyt.patch b/package/kernel/mac80211/patches/336-v4.18-brcmfmac-stop-watchdog-before-detach-and-free-everyt.patch
deleted file mode 100644
index a478b675cc..0000000000
--- a/package/kernel/mac80211/patches/336-v4.18-brcmfmac-stop-watchdog-before-detach-and-free-everyt.patch
+++ /dev/null
@@ -1,70 +0,0 @@
-From 373c83a801f15b1e3d02d855fad89112bd4ccbe0 Mon Sep 17 00:00:00 2001
-From: Michael Trimarchi <michael@amarulasolutions.com>
-Date: Wed, 30 May 2018 11:06:34 +0200
-Subject: [PATCH] brcmfmac: stop watchdog before detach and free everything
-
-Using built-in in kernel image without a firmware in filesystem
-or in the kernel image can lead to a kernel NULL pointer deference.
-Watchdog need to be stopped in brcmf_sdio_remove
-
-The system is going down NOW!
-[ 1348.110759] Unable to handle kernel NULL pointer dereference at virtual address 000002f8
-Sent SIGTERM to all processes
-[ 1348.121412] Mem abort info:
-[ 1348.126962] ESR = 0x96000004
-[ 1348.130023] Exception class = DABT (current EL), IL = 32 bits
-[ 1348.135948] SET = 0, FnV = 0
-[ 1348.138997] EA = 0, S1PTW = 0
-[ 1348.142154] Data abort info:
-[ 1348.145045] ISV = 0, ISS = 0x00000004
-[ 1348.148884] CM = 0, WnR = 0
-[ 1348.151861] user pgtable: 4k pages, 48-bit VAs, pgdp = (____ptrval____)
-[ 1348.158475] [00000000000002f8] pgd=0000000000000000
-[ 1348.163364] Internal error: Oops: 96000004 [#1] PREEMPT SMP
-[ 1348.168927] Modules linked in: ipv6
-[ 1348.172421] CPU: 3 PID: 1421 Comm: brcmf_wdog/mmc0 Not tainted 4.17.0-rc5-next-20180517 #18
-[ 1348.180757] Hardware name: Amarula A64-Relic (DT)
-[ 1348.185455] pstate: 60000005 (nZCv daif -PAN -UAO)
-[ 1348.190251] pc : brcmf_sdiod_freezer_count+0x0/0x20
-[ 1348.195124] lr : brcmf_sdio_watchdog_thread+0x64/0x290
-[ 1348.200253] sp : ffff00000b85be30
-[ 1348.203561] x29: ffff00000b85be30 x28: 0000000000000000
-[ 1348.208868] x27: ffff00000b6cb918 x26: ffff80003b990638
-[ 1348.214176] x25: ffff0000087b1a20 x24: ffff80003b94f800
-[ 1348.219483] x23: ffff000008e620c8 x22: ffff000008f0b660
-[ 1348.224790] x21: ffff000008c6a858 x20: 00000000fffffe00
-[ 1348.230097] x19: ffff80003b94f800 x18: 0000000000000001
-[ 1348.235404] x17: 0000ffffab2e8a74 x16: ffff0000080d7de8
-[ 1348.240711] x15: 0000000000000000 x14: 0000000000000400
-[ 1348.246018] x13: 0000000000000400 x12: 0000000000000001
-[ 1348.251324] x11: 00000000000002c4 x10: 0000000000000a10
-[ 1348.256631] x9 : ffff00000b85bc40 x8 : ffff80003be11870
-[ 1348.261937] x7 : ffff80003dfc7308 x6 : 000000078ff08b55
-[ 1348.267243] x5 : 00000139e1058400 x4 : 0000000000000000
-[ 1348.272550] x3 : dead000000000100 x2 : 958f2788d6618100
-[ 1348.277856] x1 : 00000000fffffe00 x0 : 0000000000000000
-
-Signed-off-by: Michael Trimarchi <michael@amarulasolutions.com>
-Acked-by: Arend van Spriel <arend.vanspriel@broadcom.com>
-Tested-by: Andy Shevchenko <andy.shevchenko@gmail.com>
-Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
----
- drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c | 7 +++++++
- 1 file changed, 7 insertions(+)
-
---- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c
-+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c
-@@ -4297,6 +4297,13 @@ void brcmf_sdio_remove(struct brcmf_sdio
- brcmf_dbg(TRACE, "Enter\n");
-
- if (bus) {
-+ /* Stop watchdog task */
-+ if (bus->watchdog_tsk) {
-+ send_sig(SIGTERM, bus->watchdog_tsk, 1);
-+ kthread_stop(bus->watchdog_tsk);
-+ bus->watchdog_tsk = NULL;
-+ }
-+
- /* De-register interrupt handler */
- brcmf_sdiod_intr_unregister(bus->sdiodev);
-
diff --git a/package/kernel/mac80211/patches/337-v4.18-brcmfmac-fix-regression-in-parsing-NVRAM-for-multipl.patch b/package/kernel/mac80211/patches/337-v4.18-brcmfmac-fix-regression-in-parsing-NVRAM-for-multipl.patch
deleted file mode 100644
index 2e265a2f37..0000000000
--- a/package/kernel/mac80211/patches/337-v4.18-brcmfmac-fix-regression-in-parsing-NVRAM-for-multipl.patch
+++ /dev/null
@@ -1,41 +0,0 @@
-From 299b6365a3b7cf7f5ea1c945a420e9ee4841d6f7 Mon Sep 17 00:00:00 2001
-From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= <rafal@milecki.pl>
-Date: Sun, 22 Jul 2018 23:46:25 +0200
-Subject: [PATCH] brcmfmac: fix regression in parsing NVRAM for multiple
- devices
-MIME-Version: 1.0
-Content-Type: text/plain; charset=UTF-8
-Content-Transfer-Encoding: 8bit
-
-NVRAM is designed to work with Broadcom's SDK Linux kernel which fakes
-PCI domain 0 for all internal MMIO devices. Since official Linux kernel
-uses platform devices for that purpose there is a mismatch in numbering
-PCI domains.
-
-There used to be a fix for that problem but it was accidentally dropped
-during the last firmware loading rework. That resulted in brcmfmac not
-being able to extract device specific NVRAM content and all kind of
-calibration problems.
-
-Reported-by: Aditya Xavier <adityaxavier@gmail.com>
-Fixes: 2baa3aaee27f ("brcmfmac: introduce brcmf_fw_alloc_request() function")
-Cc: stable@vger.kernel.org # v4.17+
-Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
-Acked-by: Arend van Spriel <arend.vanspriel@broadcom.com>
-Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
----
- drivers/net/wireless/broadcom/brcm80211/brcmfmac/pcie.c | 3 ++-
- 1 file changed, 2 insertions(+), 1 deletion(-)
-
---- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/pcie.c
-+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/pcie.c
-@@ -1785,7 +1785,8 @@ brcmf_pcie_prepare_fw_request(struct brc
- fwreq->items[BRCMF_PCIE_FW_CODE].type = BRCMF_FW_TYPE_BINARY;
- fwreq->items[BRCMF_PCIE_FW_NVRAM].type = BRCMF_FW_TYPE_NVRAM;
- fwreq->items[BRCMF_PCIE_FW_NVRAM].flags = BRCMF_FW_REQF_OPTIONAL;
-- fwreq->domain_nr = pci_domain_nr(devinfo->pdev->bus);
-+ /* NVRAM reserves PCI domain 0 for Broadcom's SDK faked bus */
-+ fwreq->domain_nr = pci_domain_nr(devinfo->pdev->bus) + 1;
- fwreq->bus_nr = devinfo->pdev->bus->number;
-
- return fwreq;
diff --git a/package/kernel/mac80211/patches/338-v4.19-0001-brcmfmac-detect-firmware-support-for-monitor-interfa.patch b/package/kernel/mac80211/patches/338-v4.19-0001-brcmfmac-detect-firmware-support-for-monitor-interfa.patch
deleted file mode 100644
index b0eec163f1..0000000000
--- a/package/kernel/mac80211/patches/338-v4.19-0001-brcmfmac-detect-firmware-support-for-monitor-interfa.patch
+++ /dev/null
@@ -1,59 +0,0 @@
-From 01f69dfafdbe7deff58b58053bc3a4a75c6a570c Mon Sep 17 00:00:00 2001
-From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= <rafal@milecki.pl>
-Date: Sun, 24 Jun 2018 21:44:35 +0200
-Subject: [PATCH] brcmfmac: detect firmware support for monitor interface
-MIME-Version: 1.0
-Content-Type: text/plain; charset=UTF-8
-Content-Transfer-Encoding: 8bit
-
-Many/most of firmwares support creating monitor interface but only the
-most recent ones explicitly /announce/ it using a "monitor" entry in the
-list of capabilities.
-
-Check for that entry and store internally info about monitor mode
-support using a new feature flag. Once we sort out all details of
-handling monitor interface it will be used when reporting available
-interfaces to the cfg80211.
-
-Later some fallback detecion method may be added for older firmwares.
-For now just stick to the "monitor" capability which should be 100%
-reliable.
-
-Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
-Acked-by: Arend van Spriel <arend.vanspriel@broadcom.com>
-Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
----
- drivers/net/wireless/broadcom/brcm80211/brcmfmac/feature.c | 1 +
- drivers/net/wireless/broadcom/brcm80211/brcmfmac/feature.h | 4 +++-
- 2 files changed, 4 insertions(+), 1 deletion(-)
-
---- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/feature.c
-+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/feature.c
-@@ -48,6 +48,7 @@ static const struct brcmf_feat_fwcap brc
- { BRCMF_FEAT_MBSS, "mbss" },
- { BRCMF_FEAT_MCHAN, "mchan" },
- { BRCMF_FEAT_P2P, "p2p" },
-+ { BRCMF_FEAT_MONITOR, "monitor" },
- };
-
- #ifdef DEBUG
---- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/feature.h
-+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/feature.h
-@@ -33,6 +33,7 @@
- * MFP: 802.11w Management Frame Protection.
- * GSCAN: enhanced scan offload feature.
- * FWSUP: Firmware supplicant.
-+ * MONITOR: firmware can pass monitor packets to host.
- */
- #define BRCMF_FEAT_LIST \
- BRCMF_FEAT_DEF(MBSS) \
-@@ -48,7 +49,8 @@
- BRCMF_FEAT_DEF(WOWL_ARP_ND) \
- BRCMF_FEAT_DEF(MFP) \
- BRCMF_FEAT_DEF(GSCAN) \
-- BRCMF_FEAT_DEF(FWSUP)
-+ BRCMF_FEAT_DEF(FWSUP) \
-+ BRCMF_FEAT_DEF(MONITOR)
-
- /*
- * Quirks:
diff --git a/package/kernel/mac80211/patches/338-v4.19-0002-brcmfmac-detect-firmware-support-for-radiotap-monito.patch b/package/kernel/mac80211/patches/338-v4.19-0002-brcmfmac-detect-firmware-support-for-radiotap-monito.patch
deleted file mode 100644
index e733468bc3..0000000000
--- a/package/kernel/mac80211/patches/338-v4.19-0002-brcmfmac-detect-firmware-support-for-radiotap-monito.patch
+++ /dev/null
@@ -1,51 +0,0 @@
-From e63410ac65e0ead2040bbd3927c116889edf87e4 Mon Sep 17 00:00:00 2001
-From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= <rafal@milecki.pl>
-Date: Sun, 24 Jun 2018 21:44:36 +0200
-Subject: [PATCH] brcmfmac: detect firmware support for radiotap monitor frames
-MIME-Version: 1.0
-Content-Type: text/plain; charset=UTF-8
-Content-Transfer-Encoding: 8bit
-
-Depending on used build-time options some firmwares may already include
-radiotap header in passed monitor frames. Add a new feature flag to
-store info about it. It's needed for proper handling of received frames
-before passing them up.
-
-Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
-Signed-off-by: Arend van Spriel <arend.vanspriel@broadcom.com>
-Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
----
- drivers/net/wireless/broadcom/brcm80211/brcmfmac/feature.c | 1 +
- drivers/net/wireless/broadcom/brcm80211/brcmfmac/feature.h | 4 +++-
- 2 files changed, 4 insertions(+), 1 deletion(-)
-
---- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/feature.c
-+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/feature.c
-@@ -49,6 +49,7 @@ static const struct brcmf_feat_fwcap brc
- { BRCMF_FEAT_MCHAN, "mchan" },
- { BRCMF_FEAT_P2P, "p2p" },
- { BRCMF_FEAT_MONITOR, "monitor" },
-+ { BRCMF_FEAT_MONITOR_FMT_RADIOTAP, "rtap" },
- };
-
- #ifdef DEBUG
---- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/feature.h
-+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/feature.h
-@@ -34,6 +34,7 @@
- * GSCAN: enhanced scan offload feature.
- * FWSUP: Firmware supplicant.
- * MONITOR: firmware can pass monitor packets to host.
-+ * MONITOR_FMT_RADIOTAP: firmware provides monitor packets with radiotap header
- */
- #define BRCMF_FEAT_LIST \
- BRCMF_FEAT_DEF(MBSS) \
-@@ -50,7 +51,8 @@
- BRCMF_FEAT_DEF(MFP) \
- BRCMF_FEAT_DEF(GSCAN) \
- BRCMF_FEAT_DEF(FWSUP) \
-- BRCMF_FEAT_DEF(MONITOR)
-+ BRCMF_FEAT_DEF(MONITOR) \
-+ BRCMF_FEAT_DEF(MONITOR_FMT_RADIOTAP)
-
- /*
- * Quirks:
diff --git a/package/kernel/mac80211/patches/338-v4.19-0003-brcmfmac-handle-msgbuf-packets-marked-with-monitor-m.patch b/package/kernel/mac80211/patches/338-v4.19-0003-brcmfmac-handle-msgbuf-packets-marked-with-monitor-m.patch
deleted file mode 100644
index d640bcfecc..0000000000
--- a/package/kernel/mac80211/patches/338-v4.19-0003-brcmfmac-handle-msgbuf-packets-marked-with-monitor-m.patch
+++ /dev/null
@@ -1,137 +0,0 @@
-From a8d7631858aff156b72f807ee7cc062048e63836 Mon Sep 17 00:00:00 2001
-From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= <rafal@milecki.pl>
-Date: Sun, 24 Jun 2018 21:44:37 +0200
-Subject: [PATCH] brcmfmac: handle msgbuf packets marked with monitor mode flag
-MIME-Version: 1.0
-Content-Type: text/plain; charset=UTF-8
-Content-Transfer-Encoding: 8bit
-
-New Broadcom firmwares mark monitor mode packets using a newly defined
-bit in the flags field. Use it to filter them out and pass to the
-monitor interface. These defines were found in bcmmsgbuf.h from SDK.
-
-As not every firmware generates radiotap header this commit introduces
-BRCMF_FEAT_MONITOR_FMT_RADIOTAP flag. It has to be has based on firmware
-capabilities. If not present brcmf_netif_mon_rx() will assume packet is
-a raw 802.11 frame and will prepend it with an empty radiotap header.
-
-This new code is limited to the msgbuf protocol at this point. Adding
-support for SDIO/USB devices will require some extra work (possibly a
-new firmware release).
-
-Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
-Acked-by: Arend van Spriel <arend.vanspriel@broadcom.com>
-Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
----
- .../wireless/broadcom/brcm80211/brcmfmac/core.c | 25 ++++++++++++++++++++++
- .../wireless/broadcom/brcm80211/brcmfmac/core.h | 2 ++
- .../wireless/broadcom/brcm80211/brcmfmac/msgbuf.c | 18 ++++++++++++++++
- 3 files changed, 45 insertions(+)
-
---- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/core.c
-+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/core.c
-@@ -21,6 +21,7 @@
- #include <net/cfg80211.h>
- #include <net/rtnetlink.h>
- #include <net/addrconf.h>
-+#include <net/ieee80211_radiotap.h>
- #include <net/ipv6.h>
- #include <brcmu_utils.h>
- #include <brcmu_wifi.h>
-@@ -404,6 +405,30 @@ void brcmf_netif_rx(struct brcmf_if *ifp
- netif_rx_ni(skb);
- }
-
-+void brcmf_netif_mon_rx(struct brcmf_if *ifp, struct sk_buff *skb)
-+{
-+ if (brcmf_feat_is_enabled(ifp, BRCMF_FEAT_MONITOR_FMT_RADIOTAP)) {
-+ /* Do nothing */
-+ } else {
-+ struct ieee80211_radiotap_header *radiotap;
-+
-+ /* TODO: use RX status to fill some radiotap data */
-+ radiotap = skb_push(skb, sizeof(*radiotap));
-+ memset(radiotap, 0, sizeof(*radiotap));
-+ radiotap->it_len = cpu_to_le16(sizeof(*radiotap));
-+
-+ /* TODO: 4 bytes with receive status? */
-+ skb->len -= 4;
-+ }
-+
-+ skb->dev = ifp->ndev;
-+ skb_reset_mac_header(skb);
-+ skb->pkt_type = PACKET_OTHERHOST;
-+ skb->protocol = htons(ETH_P_802_2);
-+
-+ brcmf_netif_rx(ifp, skb);
-+}
-+
- static int brcmf_rx_hdrpull(struct brcmf_pub *drvr, struct sk_buff *skb,
- struct brcmf_if **ifp)
- {
---- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/core.h
-+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/core.h
-@@ -121,6 +121,7 @@ struct brcmf_pub {
-
- struct brcmf_if *iflist[BRCMF_MAX_IFS];
- s32 if2bss[BRCMF_MAX_IFS];
-+ struct brcmf_if *mon_if;
-
- struct mutex proto_block;
- unsigned char proto_buf[BRCMF_DCMD_MAXLEN];
-@@ -216,6 +217,7 @@ void brcmf_txflowblock_if(struct brcmf_i
- enum brcmf_netif_stop_reason reason, bool state);
- void brcmf_txfinalize(struct brcmf_if *ifp, struct sk_buff *txp, bool success);
- void brcmf_netif_rx(struct brcmf_if *ifp, struct sk_buff *skb);
-+void brcmf_netif_mon_rx(struct brcmf_if *ifp, struct sk_buff *skb);
- void brcmf_net_setcarrier(struct brcmf_if *ifp, bool on);
- int __init brcmf_core_init(void);
- void __exit brcmf_core_exit(void);
---- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/msgbuf.c
-+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/msgbuf.c
-@@ -69,6 +69,8 @@
- #define BRCMF_MSGBUF_MAX_EVENTBUF_POST 8
-
- #define BRCMF_MSGBUF_PKT_FLAGS_FRAME_802_3 0x01
-+#define BRCMF_MSGBUF_PKT_FLAGS_FRAME_802_11 0x02
-+#define BRCMF_MSGBUF_PKT_FLAGS_FRAME_MASK 0x07
- #define BRCMF_MSGBUF_PKT_FLAGS_PRIO_SHIFT 5
-
- #define BRCMF_MSGBUF_TX_FLUSH_CNT1 32
-@@ -1128,6 +1130,7 @@ brcmf_msgbuf_process_rx_complete(struct
- struct sk_buff *skb;
- u16 data_offset;
- u16 buflen;
-+ u16 flags;
- u32 idx;
- struct brcmf_if *ifp;
-
-@@ -1137,6 +1140,7 @@ brcmf_msgbuf_process_rx_complete(struct
- data_offset = le16_to_cpu(rx_complete->data_offset);
- buflen = le16_to_cpu(rx_complete->data_len);
- idx = le32_to_cpu(rx_complete->msg.request_id);
-+ flags = le16_to_cpu(rx_complete->flags);
-
- skb = brcmf_msgbuf_get_pktid(msgbuf->drvr->bus_if->dev,
- msgbuf->rx_pktids, idx);
-@@ -1150,6 +1154,20 @@ brcmf_msgbuf_process_rx_complete(struct
-
- skb_trim(skb, buflen);
-
-+ if ((flags & BRCMF_MSGBUF_PKT_FLAGS_FRAME_MASK) ==
-+ BRCMF_MSGBUF_PKT_FLAGS_FRAME_802_11) {
-+ ifp = msgbuf->drvr->mon_if;
-+
-+ if (!ifp) {
-+ brcmf_err("Received unexpected monitor pkt\n");
-+ brcmu_pkt_buf_free_skb(skb);
-+ return;
-+ }
-+
-+ brcmf_netif_mon_rx(ifp, skb);
-+ return;
-+ }
-+
- ifp = brcmf_get_ifp(msgbuf->drvr, rx_complete->msg.ifidx);
- if (!ifp || !ifp->ndev) {
- brcmf_err("Received pkt for invalid ifidx %d\n",
diff --git a/package/kernel/mac80211/patches/339-v4.19-brcmfmac-define-more-bits-for-the-flags-of-struct-br.patch b/package/kernel/mac80211/patches/339-v4.19-brcmfmac-define-more-bits-for-the-flags-of-struct-br.patch
deleted file mode 100644
index 050370de46..0000000000
--- a/package/kernel/mac80211/patches/339-v4.19-brcmfmac-define-more-bits-for-the-flags-of-struct-br.patch
+++ /dev/null
@@ -1,60 +0,0 @@
-From 4b4a8d808c58fc0defc32a26b2fea35d66692c45 Mon Sep 17 00:00:00 2001
-From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= <rafal@milecki.pl>
-Date: Thu, 28 Jun 2018 08:16:13 +0200
-Subject: [PATCH] brcmfmac: define more bits for the flags of struct
- brcmf_sta_info_le
-MIME-Version: 1.0
-Content-Type: text/plain; charset=UTF-8
-Content-Transfer-Encoding: 8bit
-
-That struct is passed by a firmware when querying for STA info. Flags
-are used to indicate what info could be obtained.
-
-These new defines may allow passing more info to the cfg80211 in the
-future. They had been obtained from Broadcom's SDK file wlioctl_defs.h
-used by DD-WRT.
-
-Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
-Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
----
- .../broadcom/brcm80211/brcmfmac/fwil_types.h | 29 ++++++++++++++++++----
- 1 file changed, 24 insertions(+), 5 deletions(-)
-
---- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/fwil_types.h
-+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/fwil_types.h
-@@ -32,11 +32,30 @@
- #define BRCMF_BSS_INFO_VERSION 109 /* curr ver of brcmf_bss_info_le struct */
- #define BRCMF_BSS_RSSI_ON_CHANNEL 0x0002
-
--#define BRCMF_STA_WME 0x00000002 /* WMM association */
--#define BRCMF_STA_AUTHE 0x00000008 /* Authenticated */
--#define BRCMF_STA_ASSOC 0x00000010 /* Associated */
--#define BRCMF_STA_AUTHO 0x00000020 /* Authorized */
--#define BRCMF_STA_SCBSTATS 0x00004000 /* Per STA debug stats */
-+#define BRCMF_STA_BRCM 0x00000001 /* Running a Broadcom driver */
-+#define BRCMF_STA_WME 0x00000002 /* WMM association */
-+#define BRCMF_STA_NONERP 0x00000004 /* No ERP */
-+#define BRCMF_STA_AUTHE 0x00000008 /* Authenticated */
-+#define BRCMF_STA_ASSOC 0x00000010 /* Associated */
-+#define BRCMF_STA_AUTHO 0x00000020 /* Authorized */
-+#define BRCMF_STA_WDS 0x00000040 /* Wireless Distribution System */
-+#define BRCMF_STA_WDS_LINKUP 0x00000080 /* WDS traffic/probes flowing properly */
-+#define BRCMF_STA_PS 0x00000100 /* STA is in power save mode from AP's viewpoint */
-+#define BRCMF_STA_APSD_BE 0x00000200 /* APSD delv/trigger for AC_BE is default enabled */
-+#define BRCMF_STA_APSD_BK 0x00000400 /* APSD delv/trigger for AC_BK is default enabled */
-+#define BRCMF_STA_APSD_VI 0x00000800 /* APSD delv/trigger for AC_VI is default enabled */
-+#define BRCMF_STA_APSD_VO 0x00001000 /* APSD delv/trigger for AC_VO is default enabled */
-+#define BRCMF_STA_N_CAP 0x00002000 /* STA 802.11n capable */
-+#define BRCMF_STA_SCBSTATS 0x00004000 /* Per STA debug stats */
-+#define BRCMF_STA_AMPDU_CAP 0x00008000 /* STA AMPDU capable */
-+#define BRCMF_STA_AMSDU_CAP 0x00010000 /* STA AMSDU capable */
-+#define BRCMF_STA_MIMO_PS 0x00020000 /* mimo ps mode is enabled */
-+#define BRCMF_STA_MIMO_RTS 0x00040000 /* send rts in mimo ps mode */
-+#define BRCMF_STA_RIFS_CAP 0x00080000 /* rifs enabled */
-+#define BRCMF_STA_VHT_CAP 0x00100000 /* STA VHT(11ac) capable */
-+#define BRCMF_STA_WPS 0x00200000 /* WPS state */
-+#define BRCMF_STA_DWDS_CAP 0x01000000 /* DWDS CAP */
-+#define BRCMF_STA_DWDS 0x02000000 /* DWDS active */
-
- /* size of brcmf_scan_params not including variable length array */
- #define BRCMF_SCAN_PARAMS_FIXED_SIZE 64
diff --git a/package/kernel/mac80211/patches/340-v4.19-brcmfmac-update-STA-info-struct-to-the-v5.patch b/package/kernel/mac80211/patches/340-v4.19-brcmfmac-update-STA-info-struct-to-the-v5.patch
deleted file mode 100644
index e0fd8d9ea5..0000000000
--- a/package/kernel/mac80211/patches/340-v4.19-brcmfmac-update-STA-info-struct-to-the-v5.patch
+++ /dev/null
@@ -1,75 +0,0 @@
-From 07b1ae46874949252625c96f309f96ca0f337020 Mon Sep 17 00:00:00 2001
-From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= <rafal@milecki.pl>
-Date: Thu, 28 Jun 2018 12:36:23 +0200
-Subject: [PATCH] brcmfmac: update STA info struct to the v5
-MIME-Version: 1.0
-Content-Type: text/plain; charset=UTF-8
-Content-Transfer-Encoding: 8bit
-
-That struct is used when querying firmware for the STA. It seem is has
-been changing during the time. Luckily its format seems to be backward
-compatible starting with v2 (the only breakage was v1 -> v2).
-
-The version that was supported by brcmfmac so far was v4. It was what
-43602a1 and 4366b1 firmwares (7.35.177.56 and 10.10.69.3309 accordingly)
-were using. It also seems to be used by early 4366c0 firmwares
-(10.10.69.6908 and 10.10.69.69017).
-
-The problem appears when switching to the 10.10.122.20 firmware. It uses
-v5 and instead of falling back to v4 when submitted buffer isn't big
-enough it fallbacks to the v3.
-
-To receive all v4 specific info with the newest firmware we have to
-submit a struct (buffer) that matches v5.
-
-Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
-Acked-by: Arend van Spriel <arend.vanspriel@broadcom.com>
-Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
----
- .../net/wireless/broadcom/brcm80211/brcmfmac/fwil_types.h | 14 ++++++++++++++
- 1 file changed, 14 insertions(+)
-
---- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/fwil_types.h
-+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/fwil_types.h
-@@ -174,6 +174,8 @@
- #define BRCMF_MFP_CAPABLE 1
- #define BRCMF_MFP_REQUIRED 2
-
-+#define BRCMF_VHT_CAP_MCS_MAP_NSS_MAX 8
-+
- /* MAX_CHUNK_LEN is the maximum length for data passing to firmware in each
- * ioctl. It is relatively small because firmware has small maximum size input
- * playload restriction for ioctls.
-@@ -550,6 +552,8 @@ struct brcmf_sta_info_le {
- /* w/hi bit set if basic */
- __le32 in; /* seconds elapsed since associated */
- __le32 listen_interval_inms; /* Min Listen interval in ms for STA */
-+
-+ /* Fields valid for ver >= 3 */
- __le32 tx_pkts; /* # of packets transmitted */
- __le32 tx_failures; /* # of packets failed */
- __le32 rx_ucast_pkts; /* # of unicast packets received */
-@@ -558,6 +562,8 @@ struct brcmf_sta_info_le {
- __le32 rx_rate; /* Rate of last successful rx frame */
- __le32 rx_decrypt_succeeds; /* # of packet decrypted successfully */
- __le32 rx_decrypt_failures; /* # of packet decrypted failed */
-+
-+ /* Fields valid for ver >= 4 */
- __le32 tx_tot_pkts; /* # of tx pkts (ucast + mcast) */
- __le32 rx_tot_pkts; /* # of data packets recvd (uni + mcast) */
- __le32 tx_mcast_pkts; /* # of mcast pkts txed */
-@@ -594,6 +600,14 @@ struct brcmf_sta_info_le {
- */
- __le32 rx_pkts_retried; /* # rx with retry bit set */
- __le32 tx_rate_fallback; /* lowest fallback TX rate */
-+
-+ /* Fields valid for ver >= 5 */
-+ struct {
-+ __le32 count; /* # rates in this set */
-+ u8 rates[BRCMF_MAXRATES_IN_SET]; /* rates in 500kbps units w/hi bit set if basic */
-+ u8 mcs[BRCMF_MCSSET_LEN]; /* supported mcs index bit map */
-+ __le16 vht_mcs[BRCMF_VHT_CAP_MCS_MAP_NSS_MAX]; /* supported mcs index bit map per nss */
-+ } rateset_adv;
- };
-
- struct brcmf_chanspec_list {
diff --git a/package/kernel/mac80211/patches/341-v4.19-brcmfmac-specify-some-features-per-firmware-version.patch b/package/kernel/mac80211/patches/341-v4.19-brcmfmac-specify-some-features-per-firmware-version.patch
deleted file mode 100644
index 6ebcdfdf29..0000000000
--- a/package/kernel/mac80211/patches/341-v4.19-brcmfmac-specify-some-features-per-firmware-version.patch
+++ /dev/null
@@ -1,84 +0,0 @@
-From 1e591c56a65fbbcd5754a4210a0ef0402d5e5f33 Mon Sep 17 00:00:00 2001
-From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= <rafal@milecki.pl>
-Date: Mon, 9 Jul 2018 06:55:43 +0200
-Subject: [PATCH] brcmfmac: specify some features per firmware version
-MIME-Version: 1.0
-Content-Type: text/plain; charset=UTF-8
-Content-Transfer-Encoding: 8bit
-
-Some features supported by firmware aren't advertised and there is no
-way for a driver to query them. This includes e.g. monitor mode details.
-
-Most firmwares support monitor interface but only the latest ones
-/announce/ it with a "monitor" flag in the "cap" iovar. There isn't any
-reliable detection method for older firmwares (BRCMF_C_MONITOR was tried
-but "it only indicates the core part of the stack supports").
-
-Similarly support for tagging monitor frames and building radiotap
-headers can't be reliably detected for all firmwares.
-
-This commit adds table that allows mapping features to firmware version.
-It adds mappings for 43602a1 and 4366b1 firmwares from
-linux-firmware.git. Both were confirmed to be passing monitor frames.
-
-Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
-Reviewed-by: Arend van Spriel <arend.vanspriel@broadcom.com>
-Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
----
- .../wireless/broadcom/brcm80211/brcmfmac/feature.c | 38 ++++++++++++++++++++++
- 1 file changed, 38 insertions(+)
-
---- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/feature.c
-+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/feature.c
-@@ -93,6 +93,42 @@ static int brcmf_feat_debugfs_read(struc
- }
- #endif /* DEBUG */
-
-+struct brcmf_feat_fwfeat {
-+ const char * const fwid;
-+ u32 feat_flags;
-+};
-+
-+static const struct brcmf_feat_fwfeat brcmf_feat_fwfeat_map[] = {
-+ /* brcmfmac43602-pcie.ap.bin from linux-firmware.git commit ea1178515b88 */
-+ { "01-6cb8e269", BIT(BRCMF_FEAT_MONITOR) },
-+ /* brcmfmac4366b-pcie.bin from linux-firmware.git commit 52442afee990 */
-+ { "01-c47a91a4", BIT(BRCMF_FEAT_MONITOR) },
-+};
-+
-+static void brcmf_feat_firmware_overrides(struct brcmf_pub *drv)
-+{
-+ const struct brcmf_feat_fwfeat *e;
-+ u32 feat_flags = 0;
-+ int i;
-+
-+ for (i = 0; i < ARRAY_SIZE(brcmf_feat_fwfeat_map); i++) {
-+ e = &brcmf_feat_fwfeat_map[i];
-+ if (!strcmp(e->fwid, drv->fwver)) {
-+ feat_flags = e->feat_flags;
-+ break;
-+ }
-+ }
-+
-+ if (!feat_flags)
-+ return;
-+
-+ for (i = 0; i < BRCMF_FEAT_LAST; i++)
-+ if (feat_flags & BIT(i))
-+ brcmf_dbg(INFO, "enabling firmware feature: %s\n",
-+ brcmf_feat_names[i]);
-+ drv->feat_flags |= feat_flags;
-+}
-+
- /**
- * brcmf_feat_iovar_int_get() - determine feature through iovar query.
- *
-@@ -253,6 +289,8 @@ void brcmf_feat_attach(struct brcmf_pub
- }
- brcmf_feat_iovar_int_get(ifp, BRCMF_FEAT_FWSUP, "sup_wpa");
-
-+ brcmf_feat_firmware_overrides(drvr);
-+
- /* set chip related quirks */
- switch (drvr->bus_if->chip) {
- case BRCM_CC_43236_CHIP_ID:
diff --git a/package/kernel/mac80211/patches/367-Revert-ath10k-disable-wake_tx_queue-for-older-device.patch b/package/kernel/mac80211/patches/367-Revert-ath10k-disable-wake_tx_queue-for-older-device.patch
deleted file mode 100644
index 56d86c1525..0000000000
--- a/package/kernel/mac80211/patches/367-Revert-ath10k-disable-wake_tx_queue-for-older-device.patch
+++ /dev/null
@@ -1,27 +0,0 @@
-From: dave taht <dave@taht.net>
-Date: Wed, 5 Oct 2016 20:09:15 -0700
-Subject: [PATCH] Revert "ath10k: disable wake_tx_queue for older
- devices"
-
-This reverts commit 4ca1807815aa6801aaced7fdefa9edacc2521767
-in the hope that we've fixed all the performance problems now.
----
-
---- a/drivers/net/wireless/ath/ath10k/mac.c
-+++ b/drivers/net/wireless/ath/ath10k/mac.c
-@@ -8319,15 +8319,6 @@ int ath10k_mac_register(struct ath10k *a
- ath10k_warn(ar, "failed to initialise DFS pattern detector\n");
- }
-
-- /* Current wake_tx_queue implementation imposes a significant
-- * performance penalty in some setups. The tx scheduling code needs
-- * more work anyway so disable the wake_tx_queue unless firmware
-- * supports the pull-push mechanism.
-- */
-- if (!test_bit(ATH10K_FW_FEATURE_PEER_FLOW_CONTROL,
-- ar->running_fw->fw_file.fw_features))
-- ar->ops->wake_tx_queue = NULL;
--
- ret = ath10k_mac_init_rd(ar);
- if (ret) {
- ath10k_err(ar, "failed to derive regdom: %d\n", ret);
diff --git a/package/kernel/mac80211/patches/368-ath10k-fix-recent-bandwidth-conversion-bug.patch b/package/kernel/mac80211/patches/368-ath10k-fix-recent-bandwidth-conversion-bug.patch
deleted file mode 100644
index 5d5329f27e..0000000000
--- a/package/kernel/mac80211/patches/368-ath10k-fix-recent-bandwidth-conversion-bug.patch
+++ /dev/null
@@ -1,61 +0,0 @@
-From: Christian Lamparter <chunkeey@gmail.com>
-Date: Wed, 1 Nov 2017 21:01:57 +0100
-Subject: [PATCH] ath10k: fix recent bandwidth conversion bug
-
-The commit "cfg80211: make RATE_INFO_BW_20 the default" changed
-the index of RATE_INFO_BW_20, but the updates to ath10k missed
-the special bandwidth calculation case in
-ath10k_update_per_peer_tx_stats().
-
-Fixes: 842be75c77cb ("cfg80211: make RATE_INFO_BW_20 the default")
-Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
-Patchwork-Id: 10037035
-Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
----
-
---- a/drivers/net/wireless/ath/ath10k/htt_rx.c
-+++ b/drivers/net/wireless/ath/ath10k/htt_rx.c
-@@ -592,6 +592,9 @@ struct amsdu_subframe_hdr {
-
- #define GROUP_ID_IS_SU_MIMO(x) ((x) == 0 || (x) == 63)
-
-+static const u8 ath10k_bw_to_mac80211[] = { RATE_INFO_BW_20, RATE_INFO_BW_40,
-+ RATE_INFO_BW_80, RATE_INFO_BW_160 };
-+
- static void ath10k_htt_rx_h_rates(struct ath10k *ar,
- struct ieee80211_rx_status *status,
- struct htt_rx_desc *rxd)
-@@ -694,23 +697,7 @@ static void ath10k_htt_rx_h_rates(struct
- if (sgi)
- status->enc_flags |= RX_ENC_FLAG_SHORT_GI;
-
-- switch (bw) {
-- /* 20MHZ */
-- case 0:
-- break;
-- /* 40MHZ */
-- case 1:
-- status->bw = RATE_INFO_BW_40;
-- break;
-- /* 80MHZ */
-- case 2:
-- status->bw = RATE_INFO_BW_80;
-- break;
-- case 3:
-- status->bw = RATE_INFO_BW_160;
-- break;
-- }
--
-+ status->bw = ath10k_bw_to_mac80211[bw];
- status->encoding = RX_ENC_VHT;
- break;
- default:
-@@ -2297,7 +2284,7 @@ ath10k_update_per_peer_tx_stats(struct a
- arsta->txrate.flags |= RATE_INFO_FLAGS_SHORT_GI;
-
- arsta->txrate.nss = txrate.nss;
-- arsta->txrate.bw = txrate.bw + RATE_INFO_BW_20;
-+ arsta->txrate.bw = ath10k_bw_to_mac80211[txrate.bw];
- }
-
- static void ath10k_htt_fetch_peer_stats(struct ath10k *ar,
diff --git a/package/kernel/mac80211/patches/369-cfg80211-use-only-1Mbps-for-basic-rates-in-mesh.patch b/package/kernel/mac80211/patches/369-cfg80211-use-only-1Mbps-for-basic-rates-in-mesh.patch
deleted file mode 100644
index bc4174e4c2..0000000000
--- a/package/kernel/mac80211/patches/369-cfg80211-use-only-1Mbps-for-basic-rates-in-mesh.patch
+++ /dev/null
@@ -1,55 +0,0 @@
-From: Johannes Berg <johannes.berg@intel.com>
-Date: Tue, 30 Jan 2018 13:17:38 +0100
-Subject: [PATCH] cfg80211: use only 1Mbps for basic rates in mesh
-
-Mesh used to use the mandatory rates as basic rates, but we got
-the calculation of mandatory rates wrong until some time ago.
-Fix this this broke interoperability with older versions since
-now more basic rates are required, and thus the MBSS isn't the
-same and the network stops working.
-
-Fix this by simply using only 1Mbps as the basic rate in 2.4GHz.
-Since the changed mandatory rates only affected 2.4GHz, this is
-all we need to make it work again.
-
-Reported-and-tested-by: Matthias Schiffer <mschiffer@universe-factory.net>
-Fixes: 1bd773c077de ("wireless: set correct mandatory rate flags")
-Signed-off-by: Johannes Berg <johannes.berg@intel.com>
----
- net/wireless/mesh.c | 25 ++++++++++++++++++++++---
- 1 file changed, 22 insertions(+), 3 deletions(-)
-
---- a/net/wireless/mesh.c
-+++ b/net/wireless/mesh.c
-@@ -169,9 +169,28 @@ int __cfg80211_join_mesh(struct cfg80211
- enum nl80211_bss_scan_width scan_width;
- struct ieee80211_supported_band *sband =
- rdev->wiphy.bands[setup->chandef.chan->band];
-- scan_width = cfg80211_chandef_to_scan_width(&setup->chandef);
-- setup->basic_rates = ieee80211_mandatory_rates(sband,
-- scan_width);
-+
-+ if (setup->chandef.chan->band == NL80211_BAND_2GHZ) {
-+ int i;
-+
-+ /*
-+ * Older versions selected the mandatory rates for
-+ * 2.4 GHz as well, but were broken in that only
-+ * 1 Mbps was regarded as a mandatory rate. Keep
-+ * using just 1 Mbps as the default basic rate for
-+ * mesh to be interoperable with older versions.
-+ */
-+ for (i = 0; i < sband->n_bitrates; i++) {
-+ if (sband->bitrates[i].bitrate == 10) {
-+ setup->basic_rates = BIT(i);
-+ break;
-+ }
-+ }
-+ } else {
-+ scan_width = cfg80211_chandef_to_scan_width(&setup->chandef);
-+ setup->basic_rates = ieee80211_mandatory_rates(sband,
-+ scan_width);
-+ }
- }
-
- err = cfg80211_chandef_dfs_required(&rdev->wiphy,
diff --git a/package/kernel/mac80211/patches/374-ath9k-Protect-queue-draining-by-rcu_read_lock.patch b/package/kernel/mac80211/patches/374-ath9k-Protect-queue-draining-by-rcu_read_lock.patch
deleted file mode 100644
index 0b599b73ac..0000000000
--- a/package/kernel/mac80211/patches/374-ath9k-Protect-queue-draining-by-rcu_read_lock.patch
+++ /dev/null
@@ -1,43 +0,0 @@
-From: =?UTF-8?q?Toke=20H=C3=B8iland-J=C3=B8rgensen?= <toke@toke.dk>
-Date: Fri, 2 Feb 2018 11:36:45 +0100
-Subject: [PATCH] ath9k: Protect queue draining by rcu_read_lock()
-MIME-Version: 1.0
-Content-Type: text/plain; charset=UTF-8
-Content-Transfer-Encoding: 8bit
-
-When ath9k was switched over to use the mac80211 intermediate queues,
-node cleanup now drains the mac80211 queues. However, this call path is
-not protected by rcu_read_lock() as it was previously entirely internal
-to the driver which uses its own locking.
-
-This leads to a possible rcu_dereference() without holding
-rcu_read_lock(); but only if a station is cleaned up while having
-packets queued on the TXQ. Fix this by adding the rcu_read_lock() to the
-caller in ath9k.
-
-Fixes: 50f08edf9809 ("ath9k: Switch to using mac80211 intermediate software queues.")
-Cc: stable@vger.kernel.org
-Reported-by: Ben Greear <greearb@candelatech.com>
-Signed-off-by: Toke Høiland-Jørgensen <toke@toke.dk>
----
-
---- a/drivers/net/wireless/ath/ath9k/xmit.c
-+++ b/drivers/net/wireless/ath/ath9k/xmit.c
-@@ -2915,6 +2915,8 @@ void ath_tx_node_cleanup(struct ath_soft
- struct ath_txq *txq;
- int tidno;
-
-+ rcu_read_lock();
-+
- for (tidno = 0; tidno < IEEE80211_NUM_TIDS; tidno++) {
- tid = ath_node_to_tid(an, tidno);
- txq = tid->txq;
-@@ -2932,6 +2934,8 @@ void ath_tx_node_cleanup(struct ath_soft
- if (!an->sta)
- break; /* just one multicast ath_atx_tid */
- }
-+
-+ rcu_read_unlock();
- }
-
- #ifdef CPTCFG_ATH9K_TX99
diff --git a/package/kernel/mac80211/patches/380-0000-ath10k-handle-tdls-peer-events.patch b/package/kernel/mac80211/patches/380-0000-ath10k-handle-tdls-peer-events.patch
deleted file mode 100644
index 02c54600ac..0000000000
--- a/package/kernel/mac80211/patches/380-0000-ath10k-handle-tdls-peer-events.patch
+++ /dev/null
@@ -1,115 +0,0 @@
-From 8ed05ed06fca0136cf4546e804318f57ef823348 Mon Sep 17 00:00:00 2001
-From: Manikanta Pubbisetty <mpubbise@qti.qualcomm.com>
-Date: Mon, 6 Nov 2017 13:39:32 +0530
-Subject: [PATCH] ath10k: handle tdls peer events
-
-Handle tdls peer events from the target. TDLS events for the peer
-could be discover, teardown, etc. As of now, adding the logic to
-handle tdls teardown events alone.
-
-Teardown due to peer traffic indication(PTR) timeout is one such
-teardown event from the target.
-
-Tested this change on QCA9888 with 10.4-3.5.1-00018 fw version.
-
-Signed-off-by: Manikanta Pubbisetty <mpubbise@qti.qualcomm.com>
-Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
----
- drivers/net/wireless/ath/ath10k/wmi.c | 72 +++++++++++++++++++++++++++++++++++
- 1 file changed, 72 insertions(+)
-
---- a/drivers/net/wireless/ath/ath10k/wmi.c
-+++ b/drivers/net/wireless/ath/ath10k/wmi.c
-@@ -29,6 +29,7 @@
- #include "p2p.h"
- #include "hw.h"
- #include "hif.h"
-+#include "txrx.h"
-
- #define ATH10K_WMI_BARRIER_ECHO_ID 0xBA991E9
- #define ATH10K_WMI_BARRIER_TIMEOUT_HZ (3 * HZ)
-@@ -4456,6 +4457,74 @@ void ath10k_wmi_event_pdev_tpc_config(st
- __le32_to_cpu(ev->rate_max));
- }
-
-+static void
-+ath10k_wmi_handle_tdls_peer_event(struct ath10k *ar, struct sk_buff *skb)
-+{
-+ struct wmi_tdls_peer_event *ev;
-+ struct ath10k_peer *peer;
-+ struct ath10k_vif *arvif;
-+ int vdev_id;
-+ int peer_status;
-+ int peer_reason;
-+ u8 reason;
-+
-+ if (skb->len < sizeof(*ev)) {
-+ ath10k_err(ar, "received tdls peer event with invalid size (%d bytes)\n",
-+ skb->len);
-+ return;
-+ }
-+
-+ ev = (struct wmi_tdls_peer_event *)skb->data;
-+ vdev_id = __le32_to_cpu(ev->vdev_id);
-+ peer_status = __le32_to_cpu(ev->peer_status);
-+ peer_reason = __le32_to_cpu(ev->peer_reason);
-+
-+ spin_lock_bh(&ar->data_lock);
-+ peer = ath10k_peer_find(ar, vdev_id, ev->peer_macaddr.addr);
-+ spin_unlock_bh(&ar->data_lock);
-+
-+ if (!peer) {
-+ ath10k_warn(ar, "failed to find peer entry for %pM\n",
-+ ev->peer_macaddr.addr);
-+ return;
-+ }
-+
-+ switch (peer_status) {
-+ case WMI_TDLS_SHOULD_TEARDOWN:
-+ switch (peer_reason) {
-+ case WMI_TDLS_TEARDOWN_REASON_PTR_TIMEOUT:
-+ case WMI_TDLS_TEARDOWN_REASON_NO_RESPONSE:
-+ case WMI_TDLS_TEARDOWN_REASON_RSSI:
-+ reason = WLAN_REASON_TDLS_TEARDOWN_UNREACHABLE;
-+ break;
-+ default:
-+ reason = WLAN_REASON_TDLS_TEARDOWN_UNSPECIFIED;
-+ break;
-+ }
-+
-+ arvif = ath10k_get_arvif(ar, vdev_id);
-+ if (!arvif) {
-+ ath10k_warn(ar, "received tdls peer event for invalid vdev id %u\n",
-+ vdev_id);
-+ return;
-+ }
-+
-+ ieee80211_tdls_oper_request(arvif->vif, ev->peer_macaddr.addr,
-+ NL80211_TDLS_TEARDOWN, reason,
-+ GFP_ATOMIC);
-+
-+ ath10k_dbg(ar, ATH10K_DBG_WMI,
-+ "received tdls teardown event for peer %pM reason %u\n",
-+ ev->peer_macaddr.addr, peer_reason);
-+ break;
-+ default:
-+ ath10k_dbg(ar, ATH10K_DBG_WMI,
-+ "received unknown tdls peer event %u\n",
-+ peer_status);
-+ break;
-+ }
-+}
-+
- void ath10k_wmi_event_pdev_ftm_intg(struct ath10k *ar, struct sk_buff *skb)
- {
- ath10k_dbg(ar, ATH10K_DBG_WMI, "WMI_PDEV_FTM_INTG_EVENTID\n");
-@@ -5478,6 +5547,9 @@ static void ath10k_wmi_10_4_op_rx(struct
- case WMI_10_4_PDEV_TPC_CONFIG_EVENTID:
- ath10k_wmi_event_pdev_tpc_config(ar, skb);
- break;
-+ case WMI_10_4_TDLS_PEER_EVENTID:
-+ ath10k_wmi_handle_tdls_peer_event(ar, skb);
-+ break;
- default:
- ath10k_warn(ar, "Unknown eventid: %d\n", id);
- break;
diff --git a/package/kernel/mac80211/patches/380-0001-ath10k-wmi-modify-svc-bitmap-parsing-for-wcn3990.patch b/package/kernel/mac80211/patches/380-0001-ath10k-wmi-modify-svc-bitmap-parsing-for-wcn3990.patch
deleted file mode 100644
index 6788136273..0000000000
--- a/package/kernel/mac80211/patches/380-0001-ath10k-wmi-modify-svc-bitmap-parsing-for-wcn3990.patch
+++ /dev/null
@@ -1,215 +0,0 @@
-From 229329ff345f80c95202eaf2d7a0f2910c06144e Mon Sep 17 00:00:00 2001
-From: Rakesh Pillai <pillair@qti.qualcomm.com>
-Date: Mon, 11 Dec 2017 19:52:52 +0530
-Subject: [PATCH] ath10k: wmi: modify svc bitmap parsing for wcn3990
-
-Due to the limitation of wmi tlv parsing logic, if there are
-two parameters in a wmi event with same tlv tag, we can get only
-the last value, as it overwrites the prev value of the same tlv tag.
-
-The service ready event in wcn3990 contains two parameters of the
-same tag UINT32, due to which the svc bitmap is overwritten with the
-DBS support parameter.
-
-Refactor the service ready event parsing to allow parsing two tlv
-of the same tag UINT32 for wcn3990.
-
-Signed-off-by: Rakesh Pillai <pillair@qti.qualcomm.com>
-Signed-off-by: Govind Singh <govinds@qti.qualcomm.com>
-Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
----
- drivers/net/wireless/ath/ath10k/mac.c | 4 +-
- drivers/net/wireless/ath/ath10k/wmi-tlv.c | 61 ++++++++++++++++++++++++-------
- drivers/net/wireless/ath/ath10k/wmi-tlv.h | 46 +++++++++++++++++++++++
- drivers/net/wireless/ath/ath10k/wmi.h | 1 +
- 4 files changed, 97 insertions(+), 15 deletions(-)
-
---- a/drivers/net/wireless/ath/ath10k/mac.c
-+++ b/drivers/net/wireless/ath/ath10k/mac.c
-@@ -3574,7 +3574,9 @@ ath10k_mac_tx_h_get_txpath(struct ath10k
- return ATH10K_MAC_TX_HTT;
- case ATH10K_HW_TXRX_MGMT:
- if (test_bit(ATH10K_FW_FEATURE_HAS_WMI_MGMT_TX,
-- ar->running_fw->fw_file.fw_features))
-+ ar->running_fw->fw_file.fw_features) ||
-+ test_bit(WMI_SERVICE_MGMT_TX_WMI,
-+ ar->wmi.svc_map))
- return ATH10K_MAC_TX_WMI_MGMT;
- else if (ar->htt.target_version_major >= 3)
- return ATH10K_MAC_TX_HTT;
---- a/drivers/net/wireless/ath/ath10k/wmi-tlv.c
-+++ b/drivers/net/wireless/ath/ath10k/wmi-tlv.c
-@@ -917,33 +917,69 @@ ath10k_wmi_tlv_parse_mem_reqs(struct ath
- return -ENOMEM;
- }
-
-+struct wmi_tlv_svc_rdy_parse {
-+ const struct hal_reg_capabilities *reg;
-+ const struct wmi_tlv_svc_rdy_ev *ev;
-+ const __le32 *svc_bmap;
-+ const struct wlan_host_mem_req *mem_reqs;
-+ bool svc_bmap_done;
-+ bool dbs_hw_mode_done;
-+};
-+
-+static int ath10k_wmi_tlv_svc_rdy_parse(struct ath10k *ar, u16 tag, u16 len,
-+ const void *ptr, void *data)
-+{
-+ struct wmi_tlv_svc_rdy_parse *svc_rdy = data;
-+
-+ switch (tag) {
-+ case WMI_TLV_TAG_STRUCT_SERVICE_READY_EVENT:
-+ svc_rdy->ev = ptr;
-+ break;
-+ case WMI_TLV_TAG_STRUCT_HAL_REG_CAPABILITIES:
-+ svc_rdy->reg = ptr;
-+ break;
-+ case WMI_TLV_TAG_ARRAY_STRUCT:
-+ svc_rdy->mem_reqs = ptr;
-+ break;
-+ case WMI_TLV_TAG_ARRAY_UINT32:
-+ if (!svc_rdy->svc_bmap_done) {
-+ svc_rdy->svc_bmap_done = true;
-+ svc_rdy->svc_bmap = ptr;
-+ } else if (!svc_rdy->dbs_hw_mode_done) {
-+ svc_rdy->dbs_hw_mode_done = true;
-+ }
-+ break;
-+ default:
-+ break;
-+ }
-+ return 0;
-+}
-+
- static int ath10k_wmi_tlv_op_pull_svc_rdy_ev(struct ath10k *ar,
- struct sk_buff *skb,
- struct wmi_svc_rdy_ev_arg *arg)
- {
-- const void **tb;
- const struct hal_reg_capabilities *reg;
- const struct wmi_tlv_svc_rdy_ev *ev;
- const __le32 *svc_bmap;
- const struct wlan_host_mem_req *mem_reqs;
-+ struct wmi_tlv_svc_rdy_parse svc_rdy = { };
- int ret;
-
-- tb = ath10k_wmi_tlv_parse_alloc(ar, skb->data, skb->len, GFP_ATOMIC);
-- if (IS_ERR(tb)) {
-- ret = PTR_ERR(tb);
-+ ret = ath10k_wmi_tlv_iter(ar, skb->data, skb->len,
-+ ath10k_wmi_tlv_svc_rdy_parse, &svc_rdy);
-+ if (ret) {
- ath10k_warn(ar, "failed to parse tlv: %d\n", ret);
- return ret;
- }
-
-- ev = tb[WMI_TLV_TAG_STRUCT_SERVICE_READY_EVENT];
-- reg = tb[WMI_TLV_TAG_STRUCT_HAL_REG_CAPABILITIES];
-- svc_bmap = tb[WMI_TLV_TAG_ARRAY_UINT32];
-- mem_reqs = tb[WMI_TLV_TAG_ARRAY_STRUCT];
-+ ev = svc_rdy.ev;
-+ reg = svc_rdy.reg;
-+ svc_bmap = svc_rdy.svc_bmap;
-+ mem_reqs = svc_rdy.mem_reqs;
-
-- if (!ev || !reg || !svc_bmap || !mem_reqs) {
-- kfree(tb);
-+ if (!ev || !reg || !svc_bmap || !mem_reqs)
- return -EPROTO;
-- }
-
- /* This is an internal ABI compatibility check for WMI TLV so check it
- * here instead of the generic WMI code.
-@@ -961,7 +997,6 @@ static int ath10k_wmi_tlv_op_pull_svc_rd
- __le32_to_cpu(ev->abi.abi_ver_ns1) != WMI_TLV_ABI_VER_NS1 ||
- __le32_to_cpu(ev->abi.abi_ver_ns2) != WMI_TLV_ABI_VER_NS2 ||
- __le32_to_cpu(ev->abi.abi_ver_ns3) != WMI_TLV_ABI_VER_NS3) {
-- kfree(tb);
- return -ENOTSUPP;
- }
-
-@@ -982,12 +1017,10 @@ static int ath10k_wmi_tlv_op_pull_svc_rd
- ret = ath10k_wmi_tlv_iter(ar, mem_reqs, ath10k_wmi_tlv_len(mem_reqs),
- ath10k_wmi_tlv_parse_mem_reqs, arg);
- if (ret) {
-- kfree(tb);
- ath10k_warn(ar, "failed to parse mem_reqs tlv: %d\n", ret);
- return ret;
- }
-
-- kfree(tb);
- return 0;
- }
-
---- a/drivers/net/wireless/ath/ath10k/wmi-tlv.h
-+++ b/drivers/net/wireless/ath/ath10k/wmi-tlv.h
-@@ -965,6 +965,50 @@ enum wmi_tlv_service {
- WMI_TLV_SERVICE_STA_RX_IPA_OFFLOAD_SUPPORT,
- WMI_TLV_SERVICE_MDNS_OFFLOAD,
- WMI_TLV_SERVICE_SAP_AUTH_OFFLOAD,
-+ WMI_TLV_SERVICE_DUAL_BAND_SIMULTANEOUS_SUPPORT,
-+ WMI_TLV_SERVICE_OCB,
-+ WMI_TLV_SERVICE_AP_ARPNS_OFFLOAD,
-+ WMI_TLV_SERVICE_PER_BAND_CHAINMASK_SUPPORT,
-+ WMI_TLV_SERVICE_PACKET_FILTER_OFFLOAD,
-+ WMI_TLV_SERVICE_MGMT_TX_HTT,
-+ WMI_TLV_SERVICE_MGMT_TX_WMI,
-+ WMI_TLV_SERVICE_EXT_MSG,
-+ WMI_TLV_SERVICE_MAWC,
-+ WMI_TLV_SERVICE_PEER_ASSOC_CONF,
-+ WMI_TLV_SERVICE_EGAP,
-+ WMI_TLV_SERVICE_STA_PMF_OFFLOAD,
-+ WMI_TLV_SERVICE_UNIFIED_WOW_CAPABILITY,
-+ WMI_TLV_SERVICE_ENHANCED_PROXY_STA,
-+ WMI_TLV_SERVICE_ATF,
-+ WMI_TLV_SERVICE_COEX_GPIO,
-+ WMI_TLV_SERVICE_AUX_SPECTRAL_INTF,
-+ WMI_TLV_SERVICE_AUX_CHAN_LOAD_INTF,
-+ WMI_TLV_SERVICE_BSS_CHANNEL_INFO_64,
-+ WMI_TLV_SERVICE_ENTERPRISE_MESH,
-+ WMI_TLV_SERVICE_RESTRT_CHNL_SUPPORT,
-+ WMI_TLV_SERVICE_BPF_OFFLOAD,
-+ WMI_TLV_SERVICE_SYNC_DELETE_CMDS,
-+ WMI_TLV_SERVICE_SMART_ANTENNA_SW_SUPPORT,
-+ WMI_TLV_SERVICE_SMART_ANTENNA_HW_SUPPORT,
-+ WMI_TLV_SERVICE_RATECTRL_LIMIT_MAX_MIN_RATES,
-+ WMI_TLV_SERVICE_NAN_DATA,
-+ WMI_TLV_SERVICE_NAN_RTT,
-+ WMI_TLV_SERVICE_11AX,
-+ WMI_TLV_SERVICE_DEPRECATED_REPLACE,
-+ WMI_TLV_SERVICE_TDLS_CONN_TRACKER_IN_HOST_MODE,
-+ WMI_TLV_SERVICE_ENHANCED_MCAST_FILTER,
-+ WMI_TLV_SERVICE_PERIODIC_CHAN_STAT_SUPPORT,
-+ WMI_TLV_SERVICE_MESH_11S,
-+ WMI_TLV_SERVICE_HALF_RATE_QUARTER_RATE_SUPPORT,
-+ WMI_TLV_SERVICE_VDEV_RX_FILTER,
-+ WMI_TLV_SERVICE_P2P_LISTEN_OFFLOAD_SUPPORT,
-+ WMI_TLV_SERVICE_MARK_FIRST_WAKEUP_PACKET,
-+ WMI_TLV_SERVICE_MULTIPLE_MCAST_FILTER_SET,
-+ WMI_TLV_SERVICE_HOST_MANAGED_RX_REORDER,
-+ WMI_TLV_SERVICE_FLASH_RDWR_SUPPORT,
-+ WMI_TLV_SERVICE_WLAN_STATS_REPORT,
-+ WMI_TLV_SERVICE_TX_MSDU_ID_NEW_PARTITION_SUPPORT,
-+ WMI_TLV_SERVICE_DFS_PHYERR_OFFLOAD,
- };
-
- #define WMI_SERVICE_IS_ENABLED(wmi_svc_bmap, svc_id, len) \
-@@ -1121,6 +1165,8 @@ wmi_tlv_svc_map(const __le32 *in, unsign
- WMI_SERVICE_MDNS_OFFLOAD, len);
- SVCMAP(WMI_TLV_SERVICE_SAP_AUTH_OFFLOAD,
- WMI_SERVICE_SAP_AUTH_OFFLOAD, len);
-+ SVCMAP(WMI_TLV_SERVICE_MGMT_TX_WMI,
-+ WMI_SERVICE_MGMT_TX_WMI, len);
- }
-
- #undef SVCMAP
---- a/drivers/net/wireless/ath/ath10k/wmi.h
-+++ b/drivers/net/wireless/ath/ath10k/wmi.h
-@@ -195,6 +195,7 @@ enum wmi_service {
- WMI_SERVICE_SMART_LOGGING_SUPPORT,
- WMI_SERVICE_TDLS_CONN_TRACKER_IN_HOST_MODE,
- WMI_SERVICE_TDLS_EXPLICIT_MODE_ONLY,
-+ WMI_SERVICE_MGMT_TX_WMI,
-
- /* keep last */
- WMI_SERVICE_MAX,
diff --git a/package/kernel/mac80211/patches/380-0002-ath10k-advertise-TDLS-wider-bandwidth-support-for-5G.patch b/package/kernel/mac80211/patches/380-0002-ath10k-advertise-TDLS-wider-bandwidth-support-for-5G.patch
deleted file mode 100644
index b52451c928..0000000000
--- a/package/kernel/mac80211/patches/380-0002-ath10k-advertise-TDLS-wider-bandwidth-support-for-5G.patch
+++ /dev/null
@@ -1,64 +0,0 @@
-From 14d65775687cb3a6f76a52f48f4be27a522bb396 Mon Sep 17 00:00:00 2001
-From: Balaji Pothunoori <bpothuno@qti.qualcomm.com>
-Date: Thu, 21 Dec 2017 20:00:42 +0530
-Subject: [PATCH] ath10k: advertise TDLS wider bandwidth support for 5GHz
-
-Enable TDLS wider bandwidth support for 5GHz based on firmware wmi capabilities.
-
-This patch is required for chipset QCA9888. Tested with firmware version
-10.4-3.5.1-00018.
-
-Signed-off-by: Balaji Pothunoori <bpothuno@qti.qualcomm.com>
-Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
----
- drivers/net/wireless/ath/ath10k/mac.c | 3 ++-
- drivers/net/wireless/ath/ath10k/wmi.h | 5 +++++
- 2 files changed, 7 insertions(+), 1 deletion(-)
-
---- a/drivers/net/wireless/ath/ath10k/mac.c
-+++ b/drivers/net/wireless/ath/ath10k/mac.c
-@@ -8236,7 +8236,8 @@ int ath10k_mac_register(struct ath10k *a
- if (test_bit(WMI_SERVICE_TDLS, ar->wmi.svc_map) ||
- test_bit(WMI_SERVICE_TDLS_EXPLICIT_MODE_ONLY, ar->wmi.svc_map)) {
- ar->hw->wiphy->flags |= WIPHY_FLAG_SUPPORTS_TDLS;
-- ieee80211_hw_set(ar->hw, TDLS_WIDER_BW);
-+ if (test_bit(WMI_SERVICE_TDLS_WIDER_BANDWIDTH, ar->wmi.svc_map))
-+ ieee80211_hw_set(ar->hw, TDLS_WIDER_BW);
- }
-
- ar->hw->wiphy->flags |= WIPHY_FLAG_HAS_REMAIN_ON_CHANNEL;
---- a/drivers/net/wireless/ath/ath10k/wmi.h
-+++ b/drivers/net/wireless/ath/ath10k/wmi.h
-@@ -196,6 +196,7 @@ enum wmi_service {
- WMI_SERVICE_TDLS_CONN_TRACKER_IN_HOST_MODE,
- WMI_SERVICE_TDLS_EXPLICIT_MODE_ONLY,
- WMI_SERVICE_MGMT_TX_WMI,
-+ WMI_SERVICE_TDLS_WIDER_BANDWIDTH,
-
- /* keep last */
- WMI_SERVICE_MAX,
-@@ -337,6 +338,7 @@ enum wmi_10_4_service {
- WMI_10_4_SERVICE_TDLS_UAPSD_SLEEP_STA,
- WMI_10_4_SERVICE_TDLS_CONN_TRACKER_IN_HOST_MODE,
- WMI_10_4_SERVICE_TDLS_EXPLICIT_MODE_ONLY,
-+ WMI_10_4_SERVICE_TDLS_WIDER_BANDWIDTH,
- };
-
- static inline char *wmi_service_name(int service_id)
-@@ -445,6 +447,7 @@ static inline char *wmi_service_name(int
- SVCSTR(WMI_SERVICE_SMART_LOGGING_SUPPORT);
- SVCSTR(WMI_SERVICE_TDLS_CONN_TRACKER_IN_HOST_MODE);
- SVCSTR(WMI_SERVICE_TDLS_EXPLICIT_MODE_ONLY);
-+ SVCSTR(WMI_SERVICE_TDLS_WIDER_BANDWIDTH);
- default:
- return NULL;
- }
-@@ -741,6 +744,8 @@ static inline void wmi_10_4_svc_map(cons
- WMI_SERVICE_TDLS_CONN_TRACKER_IN_HOST_MODE, len);
- SVCMAP(WMI_10_4_SERVICE_TDLS_EXPLICIT_MODE_ONLY,
- WMI_SERVICE_TDLS_EXPLICIT_MODE_ONLY, len);
-+ SVCMAP(WMI_10_4_SERVICE_TDLS_WIDER_BANDWIDTH,
-+ WMI_SERVICE_TDLS_WIDER_BANDWIDTH, len);
- }
-
- #undef SVCMAP
diff --git a/package/kernel/mac80211/patches/380-0003-ath10k-debugfs-support-to-get-final-TPC-stats-for-10.patch b/package/kernel/mac80211/patches/380-0003-ath10k-debugfs-support-to-get-final-TPC-stats-for-10.patch
deleted file mode 100644
index 2e828c4265..0000000000
--- a/package/kernel/mac80211/patches/380-0003-ath10k-debugfs-support-to-get-final-TPC-stats-for-10.patch
+++ /dev/null
@@ -1,824 +0,0 @@
-From bc64d05220f3e34cf432a166b83c8fff14cd7a3d Mon Sep 17 00:00:00 2001
-From: Maharaja Kennadyrajan <mkenna@codeaurora.org>
-Date: Wed, 14 Mar 2018 12:14:08 +0200
-Subject: [PATCH] ath10k: debugfs support to get final TPC stats for 10.4
- variants
-
-Export the final Transmit Power Control (TPC) value, which is the
-minimum of control power and existing TPC value to user space via
-a new debugfs file "tpc_stats_final" to help with debugging.
-It works with the new wmi cmd and event introduced in 10.4 firmware
-branch.
-
-WMI command ID: WMI_PDEV_GET_TPC_TABLE_CMDID
-WMI event ID: WMI_PDEV_TPC_TABLE_EVENTID
-
-cat /sys/kernel/debug/ieee80211/phyX/ath10k/tpc_stats_final
-
-$ cat /sys/kernel/debug/ieee80211/phyX/ath10k/tpc_stats_final
-
-TPC config for channel 5180 mode 10
-
-CTL = 0x 0 Reg. Domain = 58
-Antenna Gain = 0 Reg. Max Antenna Gain = 0
-Power Limit = 60 Reg. Max Power = 60
-Num tx chains = 2 Num supported rates = 109
-
-******************* CDD POWER TABLE ****************
-
-No. Preamble Rate_code tpc_value1 tpc_value2 tpc_value3
-0 CCK 0x40 0 0
-1 CCK 0x41 0 0
-[...]
-107 HTCUP 0x 0 46 46
-108 HTCUP 0x 0 46 46
-
-******************* STBC POWER TABLE ****************
-
-No. Preamble Rate_code tpc_value1 tpc_value2 tpc_value3
-0 CCK 0x40 0 0
-1 CCK 0x41 0 0
-[...]
-107 HTCUP 0x 0 46 46
-108 HTCUP 0x 0 46 46
-
-***********************************
-TXBF not supported
-**********************************
-
-The existing tpc_stats debugfs file provides the dump
-which is minimum of target power and regulatory domain.
-
-cat /sys/kernel/debug/ieee80211/phyX/ath10k/tpc_stats
-
-Hardware_used: QCA4019
-Firmware version: firmware-5.bin_10.4-3.0-00209
-
-Signed-off-by: Maharaja Kennadyrajan <mkenna@codeaurora.org>
-Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
----
- drivers/net/wireless/ath/ath10k/core.h | 22 +++
- drivers/net/wireless/ath/ath10k/debug.c | 107 +++++++++++
- drivers/net/wireless/ath/ath10k/debug.h | 10 +
- drivers/net/wireless/ath/ath10k/wmi-ops.h | 20 ++
- drivers/net/wireless/ath/ath10k/wmi.c | 308 ++++++++++++++++++++++++++++--
- drivers/net/wireless/ath/ath10k/wmi.h | 66 +++++++
- 6 files changed, 518 insertions(+), 15 deletions(-)
-
---- a/drivers/net/wireless/ath/ath10k/core.h
-+++ b/drivers/net/wireless/ath/ath10k/core.h
-@@ -322,6 +322,27 @@ struct ath10k_tpc_stats {
- struct ath10k_tpc_table tpc_table[WMI_TPC_FLAG];
- };
-
-+struct ath10k_tpc_table_final {
-+ u32 pream_idx[WMI_TPC_FINAL_RATE_MAX];
-+ u8 rate_code[WMI_TPC_FINAL_RATE_MAX];
-+ char tpc_value[WMI_TPC_FINAL_RATE_MAX][WMI_TPC_TX_N_CHAIN * WMI_TPC_BUF_SIZE];
-+};
-+
-+struct ath10k_tpc_stats_final {
-+ u32 reg_domain;
-+ u32 chan_freq;
-+ u32 phy_mode;
-+ u32 twice_antenna_reduction;
-+ u32 twice_max_rd_power;
-+ s32 twice_antenna_gain;
-+ u32 power_limit;
-+ u32 num_tx_chain;
-+ u32 ctl;
-+ u32 rate_max;
-+ u8 flag[WMI_TPC_FLAG];
-+ struct ath10k_tpc_table_final tpc_table_final[WMI_TPC_FLAG];
-+};
-+
- struct ath10k_dfs_stats {
- u32 phy_errors;
- u32 pulses_total;
-@@ -482,6 +503,7 @@ struct ath10k_debug {
-
- /* used for tpc-dump storage, protected by data-lock */
- struct ath10k_tpc_stats *tpc_stats;
-+ struct ath10k_tpc_stats_final *tpc_stats_final;
-
- struct completion tpc_complete;
-
---- a/drivers/net/wireless/ath/ath10k/debug.c
-+++ b/drivers/net/wireless/ath/ath10k/debug.c
-@@ -1737,6 +1737,19 @@ void ath10k_debug_tpc_stats_process(stru
- spin_unlock_bh(&ar->data_lock);
- }
-
-+void
-+ath10k_debug_tpc_stats_final_process(struct ath10k *ar,
-+ struct ath10k_tpc_stats_final *tpc_stats)
-+{
-+ spin_lock_bh(&ar->data_lock);
-+
-+ kfree(ar->debug.tpc_stats_final);
-+ ar->debug.tpc_stats_final = tpc_stats;
-+ complete(&ar->debug.tpc_complete);
-+
-+ spin_unlock_bh(&ar->data_lock);
-+}
-+
- static void ath10k_tpc_stats_print(struct ath10k_tpc_stats *tpc_stats,
- unsigned int j, char *buf, size_t *len)
- {
-@@ -2400,6 +2413,95 @@ static const struct file_operations fops
- .llseek = default_llseek,
- };
-
-+static int ath10k_debug_tpc_stats_final_request(struct ath10k *ar)
-+{
-+ int ret;
-+ unsigned long time_left;
-+
-+ lockdep_assert_held(&ar->conf_mutex);
-+
-+ reinit_completion(&ar->debug.tpc_complete);
-+
-+ ret = ath10k_wmi_pdev_get_tpc_table_cmdid(ar, WMI_TPC_CONFIG_PARAM);
-+ if (ret) {
-+ ath10k_warn(ar, "failed to request tpc table cmdid: %d\n", ret);
-+ return ret;
-+ }
-+
-+ time_left = wait_for_completion_timeout(&ar->debug.tpc_complete,
-+ 1 * HZ);
-+ if (time_left == 0)
-+ return -ETIMEDOUT;
-+
-+ return 0;
-+}
-+
-+static int ath10k_tpc_stats_final_open(struct inode *inode, struct file *file)
-+{
-+ struct ath10k *ar = inode->i_private;
-+ void *buf;
-+ int ret;
-+
-+ mutex_lock(&ar->conf_mutex);
-+
-+ if (ar->state != ATH10K_STATE_ON) {
-+ ret = -ENETDOWN;
-+ goto err_unlock;
-+ }
-+
-+ buf = vmalloc(ATH10K_TPC_CONFIG_BUF_SIZE);
-+ if (!buf) {
-+ ret = -ENOMEM;
-+ goto err_unlock;
-+ }
-+
-+ ret = ath10k_debug_tpc_stats_final_request(ar);
-+ if (ret) {
-+ ath10k_warn(ar, "failed to request tpc stats final: %d\n",
-+ ret);
-+ goto err_free;
-+ }
-+
-+ ath10k_tpc_stats_fill(ar, ar->debug.tpc_stats, buf);
-+ file->private_data = buf;
-+
-+ mutex_unlock(&ar->conf_mutex);
-+ return 0;
-+
-+err_free:
-+ vfree(buf);
-+
-+err_unlock:
-+ mutex_unlock(&ar->conf_mutex);
-+ return ret;
-+}
-+
-+static int ath10k_tpc_stats_final_release(struct inode *inode,
-+ struct file *file)
-+{
-+ vfree(file->private_data);
-+
-+ return 0;
-+}
-+
-+static ssize_t ath10k_tpc_stats_final_read(struct file *file,
-+ char __user *user_buf,
-+ size_t count, loff_t *ppos)
-+{
-+ const char *buf = file->private_data;
-+ unsigned int len = strlen(buf);
-+
-+ return simple_read_from_buffer(user_buf, count, ppos, buf, len);
-+}
-+
-+static const struct file_operations fops_tpc_stats_final = {
-+ .open = ath10k_tpc_stats_final_open,
-+ .release = ath10k_tpc_stats_final_release,
-+ .read = ath10k_tpc_stats_final_read,
-+ .owner = THIS_MODULE,
-+ .llseek = default_llseek,
-+};
-+
- int ath10k_debug_create(struct ath10k *ar)
- {
- ar->debug.fw_crash_data = vzalloc(sizeof(*ar->debug.fw_crash_data));
-@@ -2525,6 +2627,11 @@ int ath10k_debug_register(struct ath10k
- debugfs_create_file("fw_checksums", 0400, ar->debug.debugfs_phy, ar,
- &fops_fw_checksums);
-
-+ if (test_bit(WMI_SERVICE_TPC_STATS_FINAL, ar->wmi.svc_map))
-+ debugfs_create_file("tpc_stats_final", 0400,
-+ ar->debug.debugfs_phy, ar,
-+ &fops_tpc_stats_final);
-+
- return 0;
- }
-
---- a/drivers/net/wireless/ath/ath10k/debug.h
-+++ b/drivers/net/wireless/ath/ath10k/debug.h
-@@ -84,6 +84,9 @@ void ath10k_debug_unregister(struct ath1
- void ath10k_debug_fw_stats_process(struct ath10k *ar, struct sk_buff *skb);
- void ath10k_debug_tpc_stats_process(struct ath10k *ar,
- struct ath10k_tpc_stats *tpc_stats);
-+void
-+ath10k_debug_tpc_stats_final_process(struct ath10k *ar,
-+ struct ath10k_tpc_stats_final *tpc_stats);
- struct ath10k_fw_crash_data *
- ath10k_debug_get_new_fw_crash_data(struct ath10k *ar);
-
-@@ -151,6 +154,13 @@ static inline void ath10k_debug_tpc_stat
- {
- kfree(tpc_stats);
- }
-+
-+static inline void
-+ath10k_debug_tpc_stats_final_process(struct ath10k *ar,
-+ struct ath10k_tpc_stats_final *tpc_stats)
-+{
-+ kfree(tpc_stats);
-+}
-
- static inline void ath10k_debug_dbglog_add(struct ath10k *ar, u8 *buffer,
- int len)
---- a/drivers/net/wireless/ath/ath10k/wmi-ops.h
-+++ b/drivers/net/wireless/ath/ath10k/wmi-ops.h
-@@ -197,6 +197,9 @@ struct wmi_ops {
- (struct ath10k *ar,
- enum wmi_bss_survey_req_type type);
- struct sk_buff *(*gen_echo)(struct ath10k *ar, u32 value);
-+ struct sk_buff *(*gen_pdev_get_tpc_table_cmdid)(struct ath10k *ar,
-+ u32 param);
-+
- };
-
- int ath10k_wmi_cmd_send(struct ath10k *ar, struct sk_buff *skb, u32 cmd_id);
-@@ -1418,4 +1421,21 @@ ath10k_wmi_echo(struct ath10k *ar, u32 v
- return ath10k_wmi_cmd_send(ar, skb, wmi->cmd->echo_cmdid);
- }
-
-+static inline int
-+ath10k_wmi_pdev_get_tpc_table_cmdid(struct ath10k *ar, u32 param)
-+{
-+ struct sk_buff *skb;
-+
-+ if (!ar->wmi.ops->gen_pdev_get_tpc_table_cmdid)
-+ return -EOPNOTSUPP;
-+
-+ skb = ar->wmi.ops->gen_pdev_get_tpc_table_cmdid(ar, param);
-+
-+ if (IS_ERR(skb))
-+ return PTR_ERR(skb);
-+
-+ return ath10k_wmi_cmd_send(ar, skb,
-+ ar->wmi.cmd->pdev_get_tpc_table_cmdid);
-+}
-+
- #endif
---- a/drivers/net/wireless/ath/ath10k/wmi.c
-+++ b/drivers/net/wireless/ath/ath10k/wmi.c
-@@ -1,6 +1,7 @@
- /*
- * Copyright (c) 2005-2011 Atheros Communications Inc.
- * Copyright (c) 2011-2013 Qualcomm Atheros, Inc.
-+ * Copyright (c) 2018, The Linux Foundation. All rights reserved.
- *
- * Permission to use, copy, modify, and/or distribute this software for any
- * purpose with or without fee is hereby granted, provided that the above
-@@ -196,6 +197,7 @@ static struct wmi_cmd_map wmi_cmd_map =
- .mu_cal_start_cmdid = WMI_CMD_UNSUPPORTED,
- .set_cca_params_cmdid = WMI_CMD_UNSUPPORTED,
- .pdev_bss_chan_info_request_cmdid = WMI_CMD_UNSUPPORTED,
-+ .pdev_get_tpc_table_cmdid = WMI_CMD_UNSUPPORTED,
- };
-
- /* 10.X WMI cmd track */
-@@ -362,6 +364,7 @@ static struct wmi_cmd_map wmi_10x_cmd_ma
- .mu_cal_start_cmdid = WMI_CMD_UNSUPPORTED,
- .set_cca_params_cmdid = WMI_CMD_UNSUPPORTED,
- .pdev_bss_chan_info_request_cmdid = WMI_CMD_UNSUPPORTED,
-+ .pdev_get_tpc_table_cmdid = WMI_CMD_UNSUPPORTED,
- };
-
- /* 10.2.4 WMI cmd track */
-@@ -528,6 +531,7 @@ static struct wmi_cmd_map wmi_10_2_4_cmd
- .set_cca_params_cmdid = WMI_CMD_UNSUPPORTED,
- .pdev_bss_chan_info_request_cmdid =
- WMI_10_2_PDEV_BSS_CHAN_INFO_REQUEST_CMDID,
-+ .pdev_get_tpc_table_cmdid = WMI_CMD_UNSUPPORTED,
- };
-
- /* 10.4 WMI cmd track */
-@@ -1480,6 +1484,7 @@ static struct wmi_cmd_map wmi_10_2_cmd_m
- .pdev_get_ani_cck_config_cmdid = WMI_CMD_UNSUPPORTED,
- .pdev_get_ani_ofdm_config_cmdid = WMI_CMD_UNSUPPORTED,
- .pdev_reserve_ast_entry_cmdid = WMI_CMD_UNSUPPORTED,
-+ .pdev_get_tpc_table_cmdid = WMI_CMD_UNSUPPORTED,
- };
-
- static struct wmi_pdev_param_map wmi_10_4_pdev_param_map = {
-@@ -4313,19 +4318,11 @@ static void ath10k_tpc_config_disp_table
- }
- }
-
--void ath10k_wmi_event_pdev_tpc_config(struct ath10k *ar, struct sk_buff *skb)
-+void ath10k_wmi_tpc_config_get_rate_code(u8 *rate_code, u16 *pream_table,
-+ u32 num_tx_chain)
- {
-- u32 i, j, pream_idx, num_tx_chain;
-- u8 rate_code[WMI_TPC_RATE_MAX], rate_idx;
-- u16 pream_table[WMI_TPC_PREAM_TABLE_MAX];
-- struct wmi_pdev_tpc_config_event *ev;
-- struct ath10k_tpc_stats *tpc_stats;
--
-- ev = (struct wmi_pdev_tpc_config_event *)skb->data;
--
-- tpc_stats = kzalloc(sizeof(*tpc_stats), GFP_ATOMIC);
-- if (!tpc_stats)
-- return;
-+ u32 i, j, pream_idx;
-+ u8 rate_idx;
-
- /* Create the rate code table based on the chains supported */
- rate_idx = 0;
-@@ -4349,8 +4346,6 @@ void ath10k_wmi_event_pdev_tpc_config(st
- pream_table[pream_idx] = rate_idx;
- pream_idx++;
-
-- num_tx_chain = __le32_to_cpu(ev->num_tx_chain);
--
- /* Fill HT20 rate code */
- for (i = 0; i < num_tx_chain; i++) {
- for (j = 0; j < 8; j++) {
-@@ -4374,7 +4369,7 @@ void ath10k_wmi_event_pdev_tpc_config(st
- pream_idx++;
-
- /* Fill VHT20 rate code */
-- for (i = 0; i < __le32_to_cpu(ev->num_tx_chain); i++) {
-+ for (i = 0; i < num_tx_chain; i++) {
- for (j = 0; j < 10; j++) {
- rate_code[rate_idx] =
- ATH10K_HW_RATECODE(j, i, WMI_RATE_PREAMBLE_VHT);
-@@ -4418,6 +4413,26 @@ void ath10k_wmi_event_pdev_tpc_config(st
- ATH10K_HW_RATECODE(0, 0, WMI_RATE_PREAMBLE_OFDM);
-
- pream_table[pream_idx] = ATH10K_TPC_PREAM_TABLE_END;
-+}
-+
-+void ath10k_wmi_event_pdev_tpc_config(struct ath10k *ar, struct sk_buff *skb)
-+{
-+ u32 num_tx_chain;
-+ u8 rate_code[WMI_TPC_RATE_MAX];
-+ u16 pream_table[WMI_TPC_PREAM_TABLE_MAX];
-+ struct wmi_pdev_tpc_config_event *ev;
-+ struct ath10k_tpc_stats *tpc_stats;
-+
-+ ev = (struct wmi_pdev_tpc_config_event *)skb->data;
-+
-+ tpc_stats = kzalloc(sizeof(*tpc_stats), GFP_ATOMIC);
-+ if (!tpc_stats)
-+ return;
-+
-+ num_tx_chain = __le32_to_cpu(ev->num_tx_chain);
-+
-+ ath10k_wmi_tpc_config_get_rate_code(rate_code, pream_table,
-+ num_tx_chain);
-
- tpc_stats->chan_freq = __le32_to_cpu(ev->chan_freq);
- tpc_stats->phy_mode = __le32_to_cpu(ev->phy_mode);
-@@ -4457,6 +4472,246 @@ void ath10k_wmi_event_pdev_tpc_config(st
- __le32_to_cpu(ev->rate_max));
- }
-
-+static u8
-+ath10k_wmi_tpc_final_get_rate(struct ath10k *ar,
-+ struct wmi_pdev_tpc_final_table_event *ev,
-+ u32 rate_idx, u32 num_chains,
-+ u32 rate_code, u8 type, u32 pream_idx)
-+{
-+ u8 tpc, num_streams, preamble, ch, stm_idx;
-+ s8 pow_agcdd, pow_agstbc, pow_agtxbf;
-+ int pream;
-+
-+ num_streams = ATH10K_HW_NSS(rate_code);
-+ preamble = ATH10K_HW_PREAMBLE(rate_code);
-+ ch = num_chains - 1;
-+ stm_idx = num_streams - 1;
-+ pream = -1;
-+
-+ if (__le32_to_cpu(ev->chan_freq) <= 2483) {
-+ switch (pream_idx) {
-+ case WMI_TPC_PREAM_2GHZ_CCK:
-+ pream = 0;
-+ break;
-+ case WMI_TPC_PREAM_2GHZ_OFDM:
-+ pream = 1;
-+ break;
-+ case WMI_TPC_PREAM_2GHZ_HT20:
-+ case WMI_TPC_PREAM_2GHZ_VHT20:
-+ pream = 2;
-+ break;
-+ case WMI_TPC_PREAM_2GHZ_HT40:
-+ case WMI_TPC_PREAM_2GHZ_VHT40:
-+ pream = 3;
-+ break;
-+ case WMI_TPC_PREAM_2GHZ_VHT80:
-+ pream = 4;
-+ break;
-+ default:
-+ pream = -1;
-+ break;
-+ }
-+ }
-+
-+ if (__le32_to_cpu(ev->chan_freq) >= 5180) {
-+ switch (pream_idx) {
-+ case WMI_TPC_PREAM_5GHZ_OFDM:
-+ pream = 0;
-+ break;
-+ case WMI_TPC_PREAM_5GHZ_HT20:
-+ case WMI_TPC_PREAM_5GHZ_VHT20:
-+ pream = 1;
-+ break;
-+ case WMI_TPC_PREAM_5GHZ_HT40:
-+ case WMI_TPC_PREAM_5GHZ_VHT40:
-+ pream = 2;
-+ break;
-+ case WMI_TPC_PREAM_5GHZ_VHT80:
-+ pream = 3;
-+ break;
-+ case WMI_TPC_PREAM_5GHZ_HTCUP:
-+ pream = 4;
-+ break;
-+ default:
-+ pream = -1;
-+ break;
-+ }
-+ }
-+
-+ if (pream == 4)
-+ tpc = min_t(u8, ev->rates_array[rate_idx],
-+ ev->max_reg_allow_pow[ch]);
-+ else
-+ tpc = min_t(u8, min_t(u8, ev->rates_array[rate_idx],
-+ ev->max_reg_allow_pow[ch]),
-+ ev->ctl_power_table[0][pream][stm_idx]);
-+
-+ if (__le32_to_cpu(ev->num_tx_chain) <= 1)
-+ goto out;
-+
-+ if (preamble == WMI_RATE_PREAMBLE_CCK)
-+ goto out;
-+
-+ if (num_chains <= num_streams)
-+ goto out;
-+
-+ switch (type) {
-+ case WMI_TPC_TABLE_TYPE_STBC:
-+ pow_agstbc = ev->max_reg_allow_pow_agstbc[ch - 1][stm_idx];
-+ if (pream == 4)
-+ tpc = min_t(u8, tpc, pow_agstbc);
-+ else
-+ tpc = min_t(u8, min_t(u8, tpc, pow_agstbc),
-+ ev->ctl_power_table[0][pream][stm_idx]);
-+ break;
-+ case WMI_TPC_TABLE_TYPE_TXBF:
-+ pow_agtxbf = ev->max_reg_allow_pow_agtxbf[ch - 1][stm_idx];
-+ if (pream == 4)
-+ tpc = min_t(u8, tpc, pow_agtxbf);
-+ else
-+ tpc = min_t(u8, min_t(u8, tpc, pow_agtxbf),
-+ ev->ctl_power_table[1][pream][stm_idx]);
-+ break;
-+ case WMI_TPC_TABLE_TYPE_CDD:
-+ pow_agcdd = ev->max_reg_allow_pow_agcdd[ch - 1][stm_idx];
-+ if (pream == 4)
-+ tpc = min_t(u8, tpc, pow_agcdd);
-+ else
-+ tpc = min_t(u8, min_t(u8, tpc, pow_agcdd),
-+ ev->ctl_power_table[0][pream][stm_idx]);
-+ break;
-+ default:
-+ ath10k_warn(ar, "unknown wmi tpc final table type: %d\n", type);
-+ tpc = 0;
-+ break;
-+ }
-+
-+out:
-+ return tpc;
-+}
-+
-+static void
-+ath10k_wmi_tpc_stats_final_disp_tables(struct ath10k *ar,
-+ struct wmi_pdev_tpc_final_table_event *ev,
-+ struct ath10k_tpc_stats_final *tpc_stats,
-+ u8 *rate_code, u16 *pream_table, u8 type)
-+{
-+ u32 i, j, pream_idx, flags;
-+ u8 tpc[WMI_TPC_TX_N_CHAIN];
-+ char tpc_value[WMI_TPC_TX_N_CHAIN * WMI_TPC_BUF_SIZE];
-+ char buff[WMI_TPC_BUF_SIZE];
-+
-+ flags = __le32_to_cpu(ev->flags);
-+
-+ switch (type) {
-+ case WMI_TPC_TABLE_TYPE_CDD:
-+ if (!(flags & WMI_TPC_CONFIG_EVENT_FLAG_TABLE_CDD)) {
-+ ath10k_dbg(ar, ATH10K_DBG_WMI, "CDD not supported\n");
-+ tpc_stats->flag[type] = ATH10K_TPC_TABLE_TYPE_FLAG;
-+ return;
-+ }
-+ break;
-+ case WMI_TPC_TABLE_TYPE_STBC:
-+ if (!(flags & WMI_TPC_CONFIG_EVENT_FLAG_TABLE_STBC)) {
-+ ath10k_dbg(ar, ATH10K_DBG_WMI, "STBC not supported\n");
-+ tpc_stats->flag[type] = ATH10K_TPC_TABLE_TYPE_FLAG;
-+ return;
-+ }
-+ break;
-+ case WMI_TPC_TABLE_TYPE_TXBF:
-+ if (!(flags & WMI_TPC_CONFIG_EVENT_FLAG_TABLE_TXBF)) {
-+ ath10k_dbg(ar, ATH10K_DBG_WMI, "TXBF not supported\n");
-+ tpc_stats->flag[type] = ATH10K_TPC_TABLE_TYPE_FLAG;
-+ return;
-+ }
-+ break;
-+ default:
-+ ath10k_dbg(ar, ATH10K_DBG_WMI,
-+ "invalid table type in wmi tpc event: %d\n", type);
-+ return;
-+ }
-+
-+ pream_idx = 0;
-+ for (i = 0; i < __le32_to_cpu(ev->rate_max); i++) {
-+ memset(tpc_value, 0, sizeof(tpc_value));
-+ memset(buff, 0, sizeof(buff));
-+ if (i == pream_table[pream_idx])
-+ pream_idx++;
-+
-+ for (j = 0; j < WMI_TPC_TX_N_CHAIN; j++) {
-+ if (j >= __le32_to_cpu(ev->num_tx_chain))
-+ break;
-+
-+ tpc[j] = ath10k_wmi_tpc_final_get_rate(ar, ev, i, j + 1,
-+ rate_code[i],
-+ type, pream_idx);
-+ snprintf(buff, sizeof(buff), "%8d ", tpc[j]);
-+ strncat(tpc_value, buff, strlen(buff));
-+ }
-+ tpc_stats->tpc_table_final[type].pream_idx[i] = pream_idx;
-+ tpc_stats->tpc_table_final[type].rate_code[i] = rate_code[i];
-+ memcpy(tpc_stats->tpc_table_final[type].tpc_value[i],
-+ tpc_value, sizeof(tpc_value));
-+ }
-+}
-+
-+void ath10k_wmi_event_tpc_final_table(struct ath10k *ar, struct sk_buff *skb)
-+{
-+ u32 num_tx_chain;
-+ u8 rate_code[WMI_TPC_FINAL_RATE_MAX];
-+ u16 pream_table[WMI_TPC_PREAM_TABLE_MAX];
-+ struct wmi_pdev_tpc_final_table_event *ev;
-+ struct ath10k_tpc_stats_final *tpc_stats;
-+
-+ ev = (struct wmi_pdev_tpc_final_table_event *)skb->data;
-+
-+ tpc_stats = kzalloc(sizeof(*tpc_stats), GFP_ATOMIC);
-+ if (!tpc_stats)
-+ return;
-+
-+ num_tx_chain = __le32_to_cpu(ev->num_tx_chain);
-+
-+ ath10k_wmi_tpc_config_get_rate_code(rate_code, pream_table,
-+ num_tx_chain);
-+
-+ tpc_stats->chan_freq = __le32_to_cpu(ev->chan_freq);
-+ tpc_stats->phy_mode = __le32_to_cpu(ev->phy_mode);
-+ tpc_stats->ctl = __le32_to_cpu(ev->ctl);
-+ tpc_stats->reg_domain = __le32_to_cpu(ev->reg_domain);
-+ tpc_stats->twice_antenna_gain = a_sle32_to_cpu(ev->twice_antenna_gain);
-+ tpc_stats->twice_antenna_reduction =
-+ __le32_to_cpu(ev->twice_antenna_reduction);
-+ tpc_stats->power_limit = __le32_to_cpu(ev->power_limit);
-+ tpc_stats->twice_max_rd_power = __le32_to_cpu(ev->twice_max_rd_power);
-+ tpc_stats->num_tx_chain = __le32_to_cpu(ev->num_tx_chain);
-+ tpc_stats->rate_max = __le32_to_cpu(ev->rate_max);
-+
-+ ath10k_wmi_tpc_stats_final_disp_tables(ar, ev, tpc_stats,
-+ rate_code, pream_table,
-+ WMI_TPC_TABLE_TYPE_CDD);
-+ ath10k_wmi_tpc_stats_final_disp_tables(ar, ev, tpc_stats,
-+ rate_code, pream_table,
-+ WMI_TPC_TABLE_TYPE_STBC);
-+ ath10k_wmi_tpc_stats_final_disp_tables(ar, ev, tpc_stats,
-+ rate_code, pream_table,
-+ WMI_TPC_TABLE_TYPE_TXBF);
-+
-+ ath10k_debug_tpc_stats_final_process(ar, tpc_stats);
-+
-+ ath10k_dbg(ar, ATH10K_DBG_WMI,
-+ "wmi event tpc final table channel %d mode %d ctl %d regd %d gain %d %d limit %d max_power %d tx_chanins %d rates %d\n",
-+ __le32_to_cpu(ev->chan_freq),
-+ __le32_to_cpu(ev->phy_mode),
-+ __le32_to_cpu(ev->ctl),
-+ __le32_to_cpu(ev->reg_domain),
-+ a_sle32_to_cpu(ev->twice_antenna_gain),
-+ __le32_to_cpu(ev->twice_antenna_reduction),
-+ __le32_to_cpu(ev->power_limit),
-+ __le32_to_cpu(ev->twice_max_rd_power) / 2,
-+ __le32_to_cpu(ev->num_tx_chain),
-+ __le32_to_cpu(ev->rate_max));
-+}
-+
- static void
- ath10k_wmi_handle_tdls_peer_event(struct ath10k *ar, struct sk_buff *skb)
- {
-@@ -5550,6 +5805,9 @@ static void ath10k_wmi_10_4_op_rx(struct
- case WMI_10_4_TDLS_PEER_EVENTID:
- ath10k_wmi_handle_tdls_peer_event(ar, skb);
- break;
-+ case WMI_10_4_PDEV_TPC_TABLE_EVENTID:
-+ ath10k_wmi_event_tpc_final_table(ar, skb);
-+ break;
- default:
- ath10k_warn(ar, "Unknown eventid: %d\n", id);
- break;
-@@ -7990,6 +8248,24 @@ static u32 ath10k_wmi_prepare_peer_qos(u
- }
-
- static struct sk_buff *
-+ath10k_wmi_10_4_op_gen_pdev_get_tpc_table_cmdid(struct ath10k *ar, u32 param)
-+{
-+ struct wmi_pdev_get_tpc_table_cmd *cmd;
-+ struct sk_buff *skb;
-+
-+ skb = ath10k_wmi_alloc_skb(ar, sizeof(*cmd));
-+ if (!skb)
-+ return ERR_PTR(-ENOMEM);
-+
-+ cmd = (struct wmi_pdev_get_tpc_table_cmd *)skb->data;
-+ cmd->param = __cpu_to_le32(param);
-+
-+ ath10k_dbg(ar, ATH10K_DBG_WMI,
-+ "wmi pdev get tpc table param:%d\n", param);
-+ return skb;
-+}
-+
-+static struct sk_buff *
- ath10k_wmi_10_4_gen_tdls_peer_update(struct ath10k *ar,
- const struct wmi_tdls_peer_update_cmd_arg *arg,
- const struct wmi_tdls_peer_capab_arg *cap,
-@@ -8430,6 +8706,8 @@ static const struct wmi_ops wmi_10_4_ops
- .ext_resource_config = ath10k_wmi_10_4_ext_resource_config,
- .gen_update_fw_tdls_state = ath10k_wmi_10_4_gen_update_fw_tdls_state,
- .gen_tdls_peer_update = ath10k_wmi_10_4_gen_tdls_peer_update,
-+ .gen_pdev_get_tpc_table_cmdid =
-+ ath10k_wmi_10_4_op_gen_pdev_get_tpc_table_cmdid,
-
- /* shared with 10.2 */
- .pull_echo_ev = ath10k_wmi_op_pull_echo_ev,
---- a/drivers/net/wireless/ath/ath10k/wmi.h
-+++ b/drivers/net/wireless/ath/ath10k/wmi.h
-@@ -1,6 +1,7 @@
- /*
- * Copyright (c) 2005-2011 Atheros Communications Inc.
- * Copyright (c) 2011-2013 Qualcomm Atheros, Inc.
-+ * Copyright (c) 2018, The Linux Foundation. All rights reserved.
- *
- * Permission to use, copy, modify, and/or distribute this software for any
- * purpose with or without fee is hereby granted, provided that the above
-@@ -197,6 +198,9 @@ enum wmi_service {
- WMI_SERVICE_TDLS_EXPLICIT_MODE_ONLY,
- WMI_SERVICE_MGMT_TX_WMI,
- WMI_SERVICE_TDLS_WIDER_BANDWIDTH,
-+ WMI_SERVICE_HTT_MGMT_TX_COMP_VALID_FLAGS,
-+ WMI_SERVICE_HOST_DFS_CHECK_SUPPORT,
-+ WMI_SERVICE_TPC_STATS_FINAL,
-
- /* keep last */
- WMI_SERVICE_MAX,
-@@ -339,6 +343,9 @@ enum wmi_10_4_service {
- WMI_10_4_SERVICE_TDLS_CONN_TRACKER_IN_HOST_MODE,
- WMI_10_4_SERVICE_TDLS_EXPLICIT_MODE_ONLY,
- WMI_10_4_SERVICE_TDLS_WIDER_BANDWIDTH,
-+ WMI_10_4_SERVICE_HTT_MGMT_TX_COMP_VALID_FLAGS,
-+ WMI_10_4_SERVICE_HOST_DFS_CHECK_SUPPORT,
-+ WMI_10_4_SERVICE_TPC_STATS_FINAL,
- };
-
- static inline char *wmi_service_name(int service_id)
-@@ -448,6 +455,9 @@ static inline char *wmi_service_name(int
- SVCSTR(WMI_SERVICE_TDLS_CONN_TRACKER_IN_HOST_MODE);
- SVCSTR(WMI_SERVICE_TDLS_EXPLICIT_MODE_ONLY);
- SVCSTR(WMI_SERVICE_TDLS_WIDER_BANDWIDTH);
-+ SVCSTR(WMI_SERVICE_HTT_MGMT_TX_COMP_VALID_FLAGS);
-+ SVCSTR(WMI_SERVICE_HOST_DFS_CHECK_SUPPORT);
-+ SVCSTR(WMI_SERVICE_TPC_STATS_FINAL);
- default:
- return NULL;
- }
-@@ -746,6 +756,12 @@ static inline void wmi_10_4_svc_map(cons
- WMI_SERVICE_TDLS_EXPLICIT_MODE_ONLY, len);
- SVCMAP(WMI_10_4_SERVICE_TDLS_WIDER_BANDWIDTH,
- WMI_SERVICE_TDLS_WIDER_BANDWIDTH, len);
-+ SVCMAP(WMI_10_4_SERVICE_HTT_MGMT_TX_COMP_VALID_FLAGS,
-+ WMI_SERVICE_HTT_MGMT_TX_COMP_VALID_FLAGS, len);
-+ SVCMAP(WMI_10_4_SERVICE_HOST_DFS_CHECK_SUPPORT,
-+ WMI_SERVICE_HOST_DFS_CHECK_SUPPORT, len);
-+ SVCMAP(WMI_10_4_SERVICE_TPC_STATS_FINAL,
-+ WMI_SERVICE_TPC_STATS_FINAL, len);
- }
-
- #undef SVCMAP
-@@ -3992,10 +4008,12 @@ struct wmi_pdev_get_tpc_config_cmd {
-
- #define WMI_TPC_CONFIG_PARAM 1
- #define WMI_TPC_RATE_MAX 160
-+#define WMI_TPC_FINAL_RATE_MAX 240
- #define WMI_TPC_TX_N_CHAIN 4
- #define WMI_TPC_PREAM_TABLE_MAX 10
- #define WMI_TPC_FLAG 3
- #define WMI_TPC_BUF_SIZE 10
-+#define WMI_TPC_BEAMFORMING 2
-
- enum wmi_tpc_table_type {
- WMI_TPC_TABLE_TYPE_CDD = 0,
-@@ -4038,6 +4056,51 @@ enum wmi_tp_scale {
- WMI_TP_SCALE_SIZE = 5, /* max num of enum */
- };
-
-+struct wmi_pdev_tpc_final_table_event {
-+ __le32 reg_domain;
-+ __le32 chan_freq;
-+ __le32 phy_mode;
-+ __le32 twice_antenna_reduction;
-+ __le32 twice_max_rd_power;
-+ a_sle32 twice_antenna_gain;
-+ __le32 power_limit;
-+ __le32 rate_max;
-+ __le32 num_tx_chain;
-+ __le32 ctl;
-+ __le32 flags;
-+ s8 max_reg_allow_pow[WMI_TPC_TX_N_CHAIN];
-+ s8 max_reg_allow_pow_agcdd[WMI_TPC_TX_N_CHAIN][WMI_TPC_TX_N_CHAIN];
-+ s8 max_reg_allow_pow_agstbc[WMI_TPC_TX_N_CHAIN][WMI_TPC_TX_N_CHAIN];
-+ s8 max_reg_allow_pow_agtxbf[WMI_TPC_TX_N_CHAIN][WMI_TPC_TX_N_CHAIN];
-+ u8 rates_array[WMI_TPC_FINAL_RATE_MAX];
-+ u8 ctl_power_table[WMI_TPC_BEAMFORMING][WMI_TPC_TX_N_CHAIN]
-+ [WMI_TPC_TX_N_CHAIN];
-+} __packed;
-+
-+struct wmi_pdev_get_tpc_table_cmd {
-+ __le32 param;
-+} __packed;
-+
-+enum wmi_tpc_pream_2ghz {
-+ WMI_TPC_PREAM_2GHZ_CCK = 0,
-+ WMI_TPC_PREAM_2GHZ_OFDM,
-+ WMI_TPC_PREAM_2GHZ_HT20,
-+ WMI_TPC_PREAM_2GHZ_HT40,
-+ WMI_TPC_PREAM_2GHZ_VHT20,
-+ WMI_TPC_PREAM_2GHZ_VHT40,
-+ WMI_TPC_PREAM_2GHZ_VHT80,
-+};
-+
-+enum wmi_tpc_pream_5ghz {
-+ WMI_TPC_PREAM_5GHZ_OFDM = 1,
-+ WMI_TPC_PREAM_5GHZ_HT20,
-+ WMI_TPC_PREAM_5GHZ_HT40,
-+ WMI_TPC_PREAM_5GHZ_VHT20,
-+ WMI_TPC_PREAM_5GHZ_VHT40,
-+ WMI_TPC_PREAM_5GHZ_VHT80,
-+ WMI_TPC_PREAM_5GHZ_HTCUP,
-+};
-+
- struct wmi_pdev_chanlist_update_event {
- /* number of channels */
- __le32 num_chan;
-@@ -6977,5 +7040,8 @@ void ath10k_wmi_10_4_op_fw_stats_fill(st
- int ath10k_wmi_op_get_vdev_subtype(struct ath10k *ar,
- enum wmi_vdev_subtype subtype);
- int ath10k_wmi_barrier(struct ath10k *ar);
-+void ath10k_wmi_tpc_config_get_rate_code(u8 *rate_code, u16 *pream_table,
-+ u32 num_tx_chain);
-+void ath10k_wmi_event_tpc_final_table(struct ath10k *ar, struct sk_buff *skb);
-
- #endif /* _WMI_H_ */
diff --git a/package/kernel/mac80211/patches/380-0004-ath10k-Fix-kernel-panic-while-using-worker-ath10k_st.patch b/package/kernel/mac80211/patches/380-0004-ath10k-Fix-kernel-panic-while-using-worker-ath10k_st.patch
deleted file mode 100644
index 888cedd8d3..0000000000
--- a/package/kernel/mac80211/patches/380-0004-ath10k-Fix-kernel-panic-while-using-worker-ath10k_st.patch
+++ /dev/null
@@ -1,99 +0,0 @@
-From 8b2d93dd22615cb7f3046a5a2083a6f8bb8052ed Mon Sep 17 00:00:00 2001
-From: Karthikeyan Periyasamy <periyasa@codeaurora.org>
-Date: Mon, 12 Mar 2018 17:09:40 +0530
-Subject: [PATCH] ath10k: Fix kernel panic while using worker
- (ath10k_sta_rc_update_wk)
-
-When attempt to run worker (ath10k_sta_rc_update_wk) after the station object
-(ieee80211_sta) delete will trigger the kernel panic.
-
-This problem arise in AP + Mesh configuration, Where the current node AP VAP
-and neighbor node mesh VAP MAC address are same. When the current mesh node
-try to establish the mesh link with neighbor node, driver peer creation for
-the neighbor mesh node fails due to duplication MAC address. Already the AP
-VAP created with same MAC address.
-
-It is caused by the following scenario steps.
-
-Steps:
-1. In above condition, ath10k driver sta_state callback (ath10k_sta_state)
- fails to do the state change for a station from IEEE80211_STA_NOTEXIST
- to IEEE80211_STA_NONE due to peer creation fails. Sta_state callback is
- called from ieee80211_add_station() to handle the new station
- (neighbor mesh node) request from the wpa_supplicant.
-2. Concurrently ath10k receive the sta_rc_update callback notification from
- the mesh_neighbour_update() to handle the beacon frames of the above
- neighbor mesh node. since its atomic callback, ath10k driver queue the
- work (ath10k_sta_rc_update_wk) to handle rc update.
-3. Due to driver sta_state callback fails (step 1), mac80211 free the station
- object.
-4. When the worker (ath10k_sta_rc_update_wk) scheduled to run, it will access
- the station object which is already deleted. so it will trigger kernel
- panic.
-
-Added the peer exist check in sta_rc_update callback before queue the work.
-
-Kernel Panic log:
-
-Unable to handle kernel NULL pointer dereference at virtual address 00000000
-pgd = c0204000
-[00000000] *pgd=00000000
-Internal error: Oops: 17 [#1] PREEMPT SMP ARM
-CPU: 1 PID: 1833 Comm: kworker/u4:2 Not tainted 3.14.77 #1
-task: dcef0000 ti: d72b6000 task.ti: d72b6000
-PC is at pwq_activate_delayed_work+0x10/0x40
-LR is at pwq_activate_delayed_work+0xc/0x40
-pc : [<c023f988>] lr : [<c023f984>] psr: 40000193
-sp : d72b7f18 ip : 0000007a fp : d72b6000
-r10: 00000000 r9 : dd404414 r8 : d8c31998
-r7 : d72b6038 r6 : 00000004 r5 : d4907ec8 r4 : dcee1300
-r3 : ffffffe0 r2 : 00000000 r1 : 00000001 r0 : 00000000
-Flags: nZcv IRQs off FIQs on Mode SVC_32 ISA ARM Segment kernel
-Control: 10c5787d Table: 595bc06a DAC: 00000015
-...
-Process kworker/u4:2 (pid: 1833, stack limit = 0xd72b6238)
-Stack: (0xd72b7f18 to 0xd72b8000)
-7f00: 00000001 dcee1300
-7f20: 00000001 c02410dc d8c31980 dd404400 dd404400 c0242790 d8c31980 00000089
-7f40: 00000000 d93e1340 00000000 d8c31980 c0242568 00000000 00000000 00000000
-7f60: 00000000 c02474dc 00000000 00000000 000000f8 d8c31980 00000000 00000000
-7f80: d72b7f80 d72b7f80 00000000 00000000 d72b7f90 d72b7f90 d72b7fac d93e1340
-7fa0: c0247404 00000000 00000000 c0208d20 00000000 00000000 00000000 00000000
-7fc0: 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
-7fe0: 00000000 00000000 00000000 00000000 00000013 00000000 00000000 00000000
-[<c023f988>] (pwq_activate_delayed_work) from [<c02410dc>] (pwq_dec_nr_in_flight+0x58/0xc4)
-[<c02410dc>] (pwq_dec_nr_in_flight) from [<c0242790>] (worker_thread+0x228/0x360)
-[<c0242790>] (worker_thread) from [<c02474dc>] (kthread+0xd8/0xec)
-[<c02474dc>] (kthread) from [<c0208d20>] (ret_from_fork+0x14/0x34)
-Code: e92d4038 e1a05000 ebffffbc[69210.619376] SMP: failed to stop secondary CPUs
-Rebooting in 3 seconds..
-
-Signed-off-by: Karthikeyan Periyasamy <periyasa@codeaurora.org>
-Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
----
- drivers/net/wireless/ath/ath10k/mac.c | 10 ++++++++++
- 1 file changed, 10 insertions(+)
-
---- a/drivers/net/wireless/ath/ath10k/mac.c
-+++ b/drivers/net/wireless/ath/ath10k/mac.c
-@@ -7065,10 +7065,20 @@ static void ath10k_sta_rc_update(struct
- {
- struct ath10k *ar = hw->priv;
- struct ath10k_sta *arsta = (struct ath10k_sta *)sta->drv_priv;
-+ struct ath10k_vif *arvif = (void *)vif->drv_priv;
-+ struct ath10k_peer *peer;
- u32 bw, smps;
-
- spin_lock_bh(&ar->data_lock);
-
-+ peer = ath10k_peer_find(ar, arvif->vdev_id, sta->addr);
-+ if (!peer) {
-+ spin_unlock_bh(&ar->data_lock);
-+ ath10k_warn(ar, "mac sta rc update failed to find peer %pM on vdev %i\n",
-+ sta->addr, arvif->vdev_id);
-+ return;
-+ }
-+
- ath10k_dbg(ar, ATH10K_DBG_MAC,
- "mac sta rc update for %pM changed %08x bw %d nss %d smps %d\n",
- sta->addr, changed, sta->bandwidth, sta->rx_nss,
diff --git a/package/kernel/mac80211/patches/380-0005-ath10k-fix-kernel-panic-while-reading-tpc_stats.patch b/package/kernel/mac80211/patches/380-0005-ath10k-fix-kernel-panic-while-reading-tpc_stats.patch
deleted file mode 100644
index 5cc97efaf5..0000000000
--- a/package/kernel/mac80211/patches/380-0005-ath10k-fix-kernel-panic-while-reading-tpc_stats.patch
+++ /dev/null
@@ -1,119 +0,0 @@
-From 4b190675ad06f5a6ecbeef0b01890c5fb372e3eb Mon Sep 17 00:00:00 2001
-From: Tamizh Chelvam <tamizhr@codeaurora.org>
-Date: Wed, 25 Apr 2018 11:36:44 +0300
-Subject: [PATCH] ath10k: fix kernel panic while reading tpc_stats
-
-When attempt to read tpc_stats for the chipsets which support
-more than 3 tx chain will trigger kernel panic(kernel stack is corrupted)
-due to writing values on rate_code array out of range.
-This patch changes the array size depends on the WMI_TPC_TX_N_CHAIN and
-added check to avoid write values on the array if the num tx chain
-get in tpc config event is greater than WMI_TPC_TX_N_CHAIN.
-
-Tested on QCA9984 with firmware-5.bin_10.4-3.5.3-00057
-
-Kernel panic log :
-
-[ 323.510944] Kernel panic - not syncing: stack-protector: Kernel stack is corrupted in: bf90c654
-[ 323.510944]
-[ 323.524390] CPU: 0 PID: 1908 Comm: cat Not tainted 3.14.77 #31
-[ 323.530224] [<c021db48>] (unwind_backtrace) from [<c021ac08>] (show_stack+0x10/0x14)
-[ 323.537941] [<c021ac08>] (show_stack) from [<c03c53c0>] (dump_stack+0x80/0xa0)
-[ 323.545146] [<c03c53c0>] (dump_stack) from [<c022e4ac>] (panic+0x84/0x1e4)
-[ 323.552000] [<c022e4ac>] (panic) from [<c022e61c>] (__stack_chk_fail+0x10/0x14)
-[ 323.559350] [<c022e61c>] (__stack_chk_fail) from [<bf90c654>] (ath10k_wmi_event_pdev_tpc_config+0x424/0x438 [ath10k_core])
-[ 323.570471] [<bf90c654>] (ath10k_wmi_event_pdev_tpc_config [ath10k_core]) from [<bf90d800>] (ath10k_wmi_10_4_op_rx+0x2f0/0x39c [ath10k_core])
-[ 323.583047] [<bf90d800>] (ath10k_wmi_10_4_op_rx [ath10k_core]) from [<bf8fcc18>] (ath10k_htc_rx_completion_handler+0x170/0x1a0 [ath10k_core])
-[ 323.595702] [<bf8fcc18>] (ath10k_htc_rx_completion_handler [ath10k_core]) from [<bf961f44>] (ath10k_pci_hif_send_complete_check+0x1f0/0x220 [ath10k_pci])
-[ 323.609421] [<bf961f44>] (ath10k_pci_hif_send_complete_check [ath10k_pci]) from [<bf96562c>] (ath10k_ce_per_engine_service+0x74/0xc4 [ath10k_pci])
-[ 323.622490] [<bf96562c>] (ath10k_ce_per_engine_service [ath10k_pci]) from [<bf9656f0>] (ath10k_ce_per_engine_service_any+0x74/0x80 [ath10k_pci])
-[ 323.635423] [<bf9656f0>] (ath10k_ce_per_engine_service_any [ath10k_pci]) from [<bf96365c>] (ath10k_pci_napi_poll+0x44/0xe8 [ath10k_pci])
-[ 323.647665] [<bf96365c>] (ath10k_pci_napi_poll [ath10k_pci]) from [<c0599994>] (net_rx_action+0xac/0x160)
-[ 323.657208] [<c0599994>] (net_rx_action) from [<c02324a4>] (__do_softirq+0x104/0x294)
-[ 323.665017] [<c02324a4>] (__do_softirq) from [<c0232920>] (irq_exit+0x9c/0x11c)
-[ 323.672314] [<c0232920>] (irq_exit) from [<c0217fc0>] (handle_IRQ+0x6c/0x90)
-[ 323.679341] [<c0217fc0>] (handle_IRQ) from [<c02084e0>] (gic_handle_irq+0x3c/0x60)
-[ 323.686893] [<c02084e0>] (gic_handle_irq) from [<c02095c0>] (__irq_svc+0x40/0x70)
-[ 323.694349] Exception stack(0xdd489c58 to 0xdd489ca0)
-[ 323.699384] 9c40: 00000000 a0000013
-[ 323.707547] 9c60: 00000000 dc4bce40 60000013 ddc1d800 dd488000 00000990 00000000 c085c800
-[ 323.715707] 9c80: 00000000 dd489d44 0000092d dd489ca0 c026e664 c026e668 60000013 ffffffff
-[ 323.723877] [<c02095c0>] (__irq_svc) from [<c026e668>] (rcu_note_context_switch+0x170/0x184)
-[ 323.732298] [<c026e668>] (rcu_note_context_switch) from [<c020e928>] (__schedule+0x50/0x4d4)
-[ 323.740716] [<c020e928>] (__schedule) from [<c020e490>] (schedule_timeout+0x148/0x178)
-[ 323.748611] [<c020e490>] (schedule_timeout) from [<c020f804>] (wait_for_common+0x114/0x154)
-[ 323.756972] [<c020f804>] (wait_for_common) from [<bf8f6ef0>] (ath10k_tpc_stats_open+0xc8/0x340 [ath10k_core])
-[ 323.766873] [<bf8f6ef0>] (ath10k_tpc_stats_open [ath10k_core]) from [<c02bb598>] (do_dentry_open+0x1ac/0x274)
-[ 323.776741] [<c02bb598>] (do_dentry_open) from [<c02c838c>] (do_last+0x8c0/0xb08)
-[ 323.784201] [<c02c838c>] (do_last) from [<c02c87e4>] (path_openat+0x210/0x598)
-[ 323.791408] [<c02c87e4>] (path_openat) from [<c02c9d1c>] (do_filp_open+0x2c/0x78)
-[ 323.798873] [<c02c9d1c>] (do_filp_open) from [<c02bc85c>] (do_sys_open+0x114/0x1b4)
-[ 323.806509] [<c02bc85c>] (do_sys_open) from [<c0208c80>] (ret_fast_syscall+0x0/0x44)
-[ 323.814241] CPU1: stopping
-[ 323.816927] CPU: 1 PID: 0 Comm: swapper/1 Not tainted 3.14.77 #31
-[ 323.823008] [<c021db48>] (unwind_backtrace) from [<c021ac08>] (show_stack+0x10/0x14)
-[ 323.830731] [<c021ac08>] (show_stack) from [<c03c53c0>] (dump_stack+0x80/0xa0)
-[ 323.837934] [<c03c53c0>] (dump_stack) from [<c021cfac>] (handle_IPI+0xb8/0x140)
-[ 323.845224] [<c021cfac>] (handle_IPI) from [<c02084fc>] (gic_handle_irq+0x58/0x60)
-[ 323.852774] [<c02084fc>] (gic_handle_irq) from [<c02095c0>] (__irq_svc+0x40/0x70)
-[ 323.860233] Exception stack(0xdd499fa0 to 0xdd499fe8)
-[ 323.865273] 9fa0: ffffffed 00000000 1d3c9000 00000000 dd498000 dd498030 10c0387d c08b62c8
-[ 323.873432] 9fc0: 4220406a 512f04d0 00000000 00000000 00000001 dd499fe8 c021838c c0218390
-[ 323.881588] 9fe0: 60000013 ffffffff
-[ 323.885070] [<c02095c0>] (__irq_svc) from [<c0218390>] (arch_cpu_idle+0x30/0x50)
-[ 323.892454] [<c0218390>] (arch_cpu_idle) from [<c026500c>] (cpu_startup_entry+0xa4/0x108)
-[ 323.900690] [<c026500c>] (cpu_startup_entry) from [<422085a4>] (0x422085a4)
-
-Signed-off-by: Tamizh chelvam <tamizhr@codeaurora.org>
-Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
----
- drivers/net/wireless/ath/ath10k/debug.c | 8 +++++++-
- drivers/net/wireless/ath/ath10k/wmi.c | 6 ++++++
- drivers/net/wireless/ath/ath10k/wmi.h | 2 +-
- 3 files changed, 14 insertions(+), 2 deletions(-)
-
---- a/drivers/net/wireless/ath/ath10k/debug.c
-+++ b/drivers/net/wireless/ath/ath10k/debug.c
-@@ -1776,7 +1776,13 @@ static void ath10k_tpc_stats_print(struc
- *len += scnprintf(buf + *len, buf_len - *len,
- "********************************\n");
- *len += scnprintf(buf + *len, buf_len - *len,
-- "No. Preamble Rate_code tpc_value1 tpc_value2 tpc_value3\n");
-+ "No. Preamble Rate_code ");
-+
-+ for (i = 0; i < WMI_TPC_TX_N_CHAIN; i++)
-+ *len += scnprintf(buf + *len, buf_len - *len,
-+ "tpc_value%d ", i);
-+
-+ *len += scnprintf(buf + *len, buf_len - *len, "\n");
-
- for (i = 0; i < tpc_stats->rate_max; i++) {
- *len += scnprintf(buf + *len, buf_len - *len,
---- a/drivers/net/wireless/ath/ath10k/wmi.c
-+++ b/drivers/net/wireless/ath/ath10k/wmi.c
-@@ -4431,6 +4431,12 @@ void ath10k_wmi_event_pdev_tpc_config(st
-
- num_tx_chain = __le32_to_cpu(ev->num_tx_chain);
-
-+ if (num_tx_chain > WMI_TPC_TX_N_CHAIN) {
-+ ath10k_warn(ar, "number of tx chain is %d greater than TPC configured tx chain %d\n",
-+ num_tx_chain, WMI_TPC_TX_N_CHAIN);
-+ return;
-+ }
-+
- ath10k_wmi_tpc_config_get_rate_code(rate_code, pream_table,
- num_tx_chain);
-
---- a/drivers/net/wireless/ath/ath10k/wmi.h
-+++ b/drivers/net/wireless/ath/ath10k/wmi.h
-@@ -4007,9 +4007,9 @@ struct wmi_pdev_get_tpc_config_cmd {
- } __packed;
-
- #define WMI_TPC_CONFIG_PARAM 1
--#define WMI_TPC_RATE_MAX 160
- #define WMI_TPC_FINAL_RATE_MAX 240
- #define WMI_TPC_TX_N_CHAIN 4
-+#define WMI_TPC_RATE_MAX (WMI_TPC_TX_N_CHAIN * 65)
- #define WMI_TPC_PREAM_TABLE_MAX 10
- #define WMI_TPC_FLAG 3
- #define WMI_TPC_BUF_SIZE 10
diff --git a/package/kernel/mac80211/patches/380-0006-ath10k-add-support-to-configure-channel-dwell-time.patch b/package/kernel/mac80211/patches/380-0006-ath10k-add-support-to-configure-channel-dwell-time.patch
deleted file mode 100644
index 3451a9930b..0000000000
--- a/package/kernel/mac80211/patches/380-0006-ath10k-add-support-to-configure-channel-dwell-time.patch
+++ /dev/null
@@ -1,92 +0,0 @@
-From be8cce96f14dc925ecfb702be0392a52cf78adb5 Mon Sep 17 00:00:00 2001
-From: Pradeep Kumar Chitrapu <pradeepc@codeaurora.org>
-Date: Wed, 23 May 2018 11:09:09 +0300
-Subject: [PATCH] ath10k: add support to configure channel dwell time
-
-Configure channel dwell time from duration of the scan request
-received from mac80211 when the duration is non-zero. When the
-scan request does not have duration value, use the default ones,
-the current implementation.
-
-Corresponding flag NL80211_EXT_FEATURE_SET_SCAN_DWELL is
-advertized.
-
-Supported Chipsets:
- -QCA988X/QCA9887 PCI
- -QCA99X0/QCA9984/QCA9888/QCA4019 PCI
- -QCA6174/QCA9377 PCI/USB/SDIO
- -WCN3990 SNOC
-
-Tested on QCA9984 with firmware ver 10.4-3.6-0010
-
-Signed-off-by: Pradeep Kumar Chitrapu <pradeepc@codeaurora.org>
-Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
----
- drivers/net/wireless/ath/ath10k/core.h | 1 +
- drivers/net/wireless/ath/ath10k/mac.c | 23 ++++++++++++++++++++---
- 2 files changed, 21 insertions(+), 3 deletions(-)
-
---- a/drivers/net/wireless/ath/ath10k/core.h
-+++ b/drivers/net/wireless/ath/ath10k/core.h
-@@ -43,6 +43,7 @@
- #define WO(_f) ((_f##_OFFSET) >> 2)
-
- #define ATH10K_SCAN_ID 0
-+#define ATH10K_SCAN_CHANNEL_SWITCH_WMI_EVT_OVERHEAD 10 /* msec */
- #define WMI_READY_TIMEOUT (5 * HZ)
- #define ATH10K_FLUSH_TIMEOUT_HZ (5 * HZ)
- #define ATH10K_CONNECTION_LOSS_HZ (3 * HZ)
---- a/drivers/net/wireless/ath/ath10k/mac.c
-+++ b/drivers/net/wireless/ath/ath10k/mac.c
-@@ -5597,6 +5597,7 @@ static int ath10k_hw_scan(struct ieee802
- struct wmi_start_scan_arg arg;
- int ret = 0;
- int i;
-+ u32 scan_timeout;
-
- mutex_lock(&ar->conf_mutex);
-
-@@ -5647,6 +5648,22 @@ static int ath10k_hw_scan(struct ieee802
- arg.channels[i] = req->channels[i]->center_freq;
- }
-
-+ /* if duration is set, default dwell times will be overwritten */
-+ if (req->duration) {
-+ arg.dwell_time_active = req->duration;
-+ arg.dwell_time_passive = req->duration;
-+ arg.burst_duration_ms = req->duration;
-+
-+ scan_timeout = min_t(u32, arg.max_rest_time *
-+ (arg.n_channels - 1) + (req->duration +
-+ ATH10K_SCAN_CHANNEL_SWITCH_WMI_EVT_OVERHEAD) *
-+ arg.n_channels, arg.max_scan_time + 200);
-+
-+ } else {
-+ /* Add a 200ms margin to account for event/command processing */
-+ scan_timeout = arg.max_scan_time + 200;
-+ }
-+
- ret = ath10k_start_scan(ar, &arg);
- if (ret) {
- ath10k_warn(ar, "failed to start hw scan: %d\n", ret);
-@@ -5655,10 +5672,8 @@ static int ath10k_hw_scan(struct ieee802
- spin_unlock_bh(&ar->data_lock);
- }
-
-- /* Add a 200ms margin to account for event/command processing */
- ieee80211_queue_delayed_work(ar->hw, &ar->scan.timeout,
-- msecs_to_jiffies(arg.max_scan_time +
-- 200));
-+ msecs_to_jiffies(scan_timeout));
-
- exit:
- mutex_unlock(&ar->conf_mutex);
-@@ -8267,6 +8282,8 @@ int ath10k_mac_register(struct ath10k *a
- }
-
- wiphy_ext_feature_set(ar->hw->wiphy, NL80211_EXT_FEATURE_VHT_IBSS);
-+ wiphy_ext_feature_set(ar->hw->wiphy,
-+ NL80211_EXT_FEATURE_SET_SCAN_DWELL);
-
- /*
- * on LL hardware queues are managed entirely by the FW
diff --git a/package/kernel/mac80211/patches/380-0007-ath-add-support-to-get-the-detected-radar-specificat.patch b/package/kernel/mac80211/patches/380-0007-ath-add-support-to-get-the-detected-radar-specificat.patch
deleted file mode 100644
index 020dfbd3a2..0000000000
--- a/package/kernel/mac80211/patches/380-0007-ath-add-support-to-get-the-detected-radar-specificat.patch
+++ /dev/null
@@ -1,94 +0,0 @@
-From f40105e6747892e8edab94020567c158c9bec0df Mon Sep 17 00:00:00 2001
-From: Sriram R <srirrama@codeaurora.org>
-Date: Tue, 15 May 2018 14:39:48 +0530
-Subject: [PATCH] ath: add support to get the detected radar specifications
-
-This enables ath10k/ath9k drivers to collect the specifications of the
-radar type once it is detected by the dfs pattern detector unit.
-Usage of the collected info is specific to driver implementation.
-For example, collected radar info could be used by the host driver
-to send to co-processors for additional processing/validation.
-
-Note: 'radar_detector_specs' data containing the specifications of
-different radar types which was private within dfs_pattern_detector/
-dfs_pri_detector is now shared with drivers as well for making use
-of this information.
-
-Signed-off-by: Sriram R <srirrama@codeaurora.org>
-Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
----
- drivers/net/wireless/ath/ath10k/wmi.c | 2 +-
- drivers/net/wireless/ath/ath9k/dfs.c | 2 +-
- drivers/net/wireless/ath/dfs_pattern_detector.c | 5 ++++-
- drivers/net/wireless/ath/dfs_pattern_detector.h | 3 ++-
- drivers/net/wireless/ath/dfs_pri_detector.h | 3 ++-
- 5 files changed, 10 insertions(+), 5 deletions(-)
-
---- a/drivers/net/wireless/ath/ath10k/wmi.c
-+++ b/drivers/net/wireless/ath/ath10k/wmi.c
-@@ -3712,7 +3712,7 @@ static void ath10k_dfs_radar_report(stru
-
- ATH10K_DFS_STAT_INC(ar, pulses_detected);
-
-- if (!ar->dfs_detector->add_pulse(ar->dfs_detector, &pe)) {
-+ if (!ar->dfs_detector->add_pulse(ar->dfs_detector, &pe, NULL)) {
- ath10k_dbg(ar, ATH10K_DBG_REGULATORY,
- "dfs no pulse pattern detected, yet\n");
- return;
---- a/drivers/net/wireless/ath/ath9k/dfs.c
-+++ b/drivers/net/wireless/ath/ath9k/dfs.c
-@@ -279,7 +279,7 @@ ath9k_dfs_process_radar_pulse(struct ath
- DFS_STAT_INC(sc, pulses_processed);
- if (pd == NULL)
- return;
-- if (!pd->add_pulse(pd, pe))
-+ if (!pd->add_pulse(pd, pe, NULL))
- return;
- DFS_STAT_INC(sc, radar_detected);
- ieee80211_radar_detected(sc->hw);
---- a/drivers/net/wireless/ath/dfs_pattern_detector.c
-+++ b/drivers/net/wireless/ath/dfs_pattern_detector.c
-@@ -268,7 +268,8 @@ static void dpd_exit(struct dfs_pattern_
- }
-
- static bool
--dpd_add_pulse(struct dfs_pattern_detector *dpd, struct pulse_event *event)
-+dpd_add_pulse(struct dfs_pattern_detector *dpd, struct pulse_event *event,
-+ struct radar_detector_specs *rs)
- {
- u32 i;
- struct channel_detector *cd;
-@@ -294,6 +295,8 @@ dpd_add_pulse(struct dfs_pattern_detecto
- struct pri_detector *pd = cd->detectors[i];
- struct pri_sequence *ps = pd->add_pulse(pd, event);
- if (ps != NULL) {
-+ if (rs != NULL)
-+ memcpy(rs, pd->rs, sizeof(*rs));
- ath_dbg(dpd->common, DFS,
- "DFS: radar found on freq=%d: id=%d, pri=%d, "
- "count=%d, count_false=%d\n",
---- a/drivers/net/wireless/ath/dfs_pattern_detector.h
-+++ b/drivers/net/wireless/ath/dfs_pattern_detector.h
-@@ -97,7 +97,8 @@ struct dfs_pattern_detector {
- bool (*set_dfs_domain)(struct dfs_pattern_detector *dpd,
- enum nl80211_dfs_regions region);
- bool (*add_pulse)(struct dfs_pattern_detector *dpd,
-- struct pulse_event *pe);
-+ struct pulse_event *pe,
-+ struct radar_detector_specs *rs);
-
- struct ath_dfs_pool_stats (*get_stats)(struct dfs_pattern_detector *dpd);
- enum nl80211_dfs_regions region;
---- a/drivers/net/wireless/ath/dfs_pri_detector.h
-+++ b/drivers/net/wireless/ath/dfs_pri_detector.h
-@@ -62,8 +62,9 @@ struct pri_detector {
- (*add_pulse)(struct pri_detector *de, struct pulse_event *e);
- void (*reset) (struct pri_detector *de, u64 ts);
-
--/* private: internal use only */
- const struct radar_detector_specs *rs;
-+
-+/* private: internal use only */
- u64 last_ts;
- struct list_head sequences;
- struct list_head pulses;
diff --git a/package/kernel/mac80211/patches/380-0008-ath10k-DFS-Host-Confirmation.patch b/package/kernel/mac80211/patches/380-0008-ath10k-DFS-Host-Confirmation.patch
deleted file mode 100644
index 9e0c100851..0000000000
--- a/package/kernel/mac80211/patches/380-0008-ath10k-DFS-Host-Confirmation.patch
+++ /dev/null
@@ -1,546 +0,0 @@
-From 6f6eb1bcbeff48c875617b800f00f1c5d1b12290 Mon Sep 17 00:00:00 2001
-From: Sriram R <srirrama@codeaurora.org>
-Date: Tue, 15 May 2018 14:39:49 +0530
-Subject: [PATCH] ath10k: DFS Host Confirmation
-
-In the 10.4-3.6 firmware branch there's a new DFS Host confirmation
-feature which is advertised using WMI_SERVICE_HOST_DFS_CHECK_SUPPORT flag.
-
-This new features enables the ath10k host to send information to the
-firmware on the specifications of detected radar type. This allows the
-firmware to validate if the host's radar pattern detector unit is
-operational and check if the radar information shared by host matches
-the radar pulses sent as phy error events from firmware. If the check
-fails the firmware won't allow use of DFS channels on AP mode when using
-FCC regulatory region.
-
-Hence this patch is mandatory when using a firmware from 10.4-3.6 branch.
-Else, DFS channels on FCC regions cannot be used.
-
-Supported Chipsets : QCA9984/QCA9888/QCA4019
-Firmware Version : 10.4-3.6-00104
-
-Signed-off-by: Sriram R <srirrama@codeaurora.org>
-Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
----
- drivers/net/wireless/ath/ath10k/core.h | 21 ++++
- drivers/net/wireless/ath/ath10k/mac.c | 12 ++
- drivers/net/wireless/ath/ath10k/wmi-ops.h | 32 +++++
- drivers/net/wireless/ath/ath10k/wmi.c | 186 ++++++++++++++++++++++++++++--
- drivers/net/wireless/ath/ath10k/wmi.h | 32 +++++
- 5 files changed, 273 insertions(+), 10 deletions(-)
-
---- a/drivers/net/wireless/ath/ath10k/core.h
-+++ b/drivers/net/wireless/ath/ath10k/core.h
-@@ -171,6 +171,7 @@ struct ath10k_wmi {
- struct completion service_ready;
- struct completion unified_ready;
- struct completion barrier;
-+ struct completion radar_confirm;
- wait_queue_head_t tx_credits_wq;
- DECLARE_BITMAP(svc_map, WMI_SERVICE_MAX);
- struct wmi_cmd_map *cmd;
-@@ -352,6 +353,21 @@ struct ath10k_dfs_stats {
- u32 radar_detected;
- };
-
-+enum ath10k_radar_confirmation_state {
-+ ATH10K_RADAR_CONFIRMATION_IDLE = 0,
-+ ATH10K_RADAR_CONFIRMATION_INPROGRESS,
-+ ATH10K_RADAR_CONFIRMATION_STOPPED,
-+};
-+
-+struct ath10k_radar_found_info {
-+ u32 pri_min;
-+ u32 pri_max;
-+ u32 width_min;
-+ u32 width_max;
-+ u32 sidx_min;
-+ u32 sidx_max;
-+};
-+
- #define ATH10K_MAX_NUM_PEER_IDS (1 << 11) /* htt rx_desc limit */
-
- struct ath10k_peer {
-@@ -1026,6 +1042,11 @@ struct ath10k {
-
- void *ce_priv;
-
-+ /* protected by data_lock */
-+ enum ath10k_radar_confirmation_state radar_conf_state;
-+ struct ath10k_radar_found_info last_radar_info;
-+ struct work_struct radar_confirmation_work;
-+
- /* must be last */
- u8 drv_priv[0] __aligned(sizeof(void *));
- };
---- a/drivers/net/wireless/ath/ath10k/mac.c
-+++ b/drivers/net/wireless/ath/ath10k/mac.c
-@@ -3216,6 +3216,15 @@ static void ath10k_reg_notifier(struct w
- ar->hw->wiphy->bands[NL80211_BAND_5GHZ]);
- }
-
-+static void ath10k_stop_radar_confirmation(struct ath10k *ar)
-+{
-+ spin_lock_bh(&ar->data_lock);
-+ ar->radar_conf_state = ATH10K_RADAR_CONFIRMATION_STOPPED;
-+ spin_unlock_bh(&ar->data_lock);
-+
-+ cancel_work_sync(&ar->radar_confirmation_work);
-+}
-+
- /***************/
- /* TX handlers */
- /***************/
-@@ -4315,6 +4324,7 @@ void ath10k_halt(struct ath10k *ar)
-
- ath10k_scan_finish(ar);
- ath10k_peer_cleanup_all(ar);
-+ ath10k_stop_radar_confirmation(ar);
- ath10k_core_stop(ar);
- ath10k_hif_power_down(ar);
-
-@@ -4733,6 +4743,8 @@ static int ath10k_start(struct ieee80211
- ath10k_spectral_start(ar);
- ath10k_thermal_set_throttling(ar);
-
-+ ar->radar_conf_state = ATH10K_RADAR_CONFIRMATION_IDLE;
-+
- mutex_unlock(&ar->conf_mutex);
- return 0;
-
---- a/drivers/net/wireless/ath/ath10k/wmi-ops.h
-+++ b/drivers/net/wireless/ath/ath10k/wmi-ops.h
-@@ -53,6 +53,8 @@ struct wmi_ops {
- struct wmi_wow_ev_arg *arg);
- int (*pull_echo_ev)(struct ath10k *ar, struct sk_buff *skb,
- struct wmi_echo_ev_arg *arg);
-+ int (*pull_dfs_status_ev)(struct ath10k *ar, struct sk_buff *skb,
-+ struct wmi_dfs_status_ev_arg *arg);
- enum wmi_txbf_conf (*get_txbf_conf_scheme)(struct ath10k *ar);
-
- struct sk_buff *(*gen_pdev_suspend)(struct ath10k *ar, u32 suspend_opt);
-@@ -178,6 +180,9 @@ struct wmi_ops {
- const struct wmi_tdls_peer_update_cmd_arg *arg,
- const struct wmi_tdls_peer_capab_arg *cap,
- const struct wmi_channel_arg *chan);
-+ struct sk_buff *(*gen_radar_found)
-+ (struct ath10k *ar,
-+ const struct ath10k_radar_found_info *arg);
- struct sk_buff *(*gen_adaptive_qcs)(struct ath10k *ar, bool enable);
- struct sk_buff *(*gen_pdev_get_tpc_config)(struct ath10k *ar,
- u32 param);
-@@ -365,6 +370,16 @@ ath10k_wmi_pull_echo_ev(struct ath10k *a
- return ar->wmi.ops->pull_echo_ev(ar, skb, arg);
- }
-
-+static inline int
-+ath10k_wmi_pull_dfs_status(struct ath10k *ar, struct sk_buff *skb,
-+ struct wmi_dfs_status_ev_arg *arg)
-+{
-+ if (!ar->wmi.ops->pull_dfs_status_ev)
-+ return -EOPNOTSUPP;
-+
-+ return ar->wmi.ops->pull_dfs_status_ev(ar, skb, arg);
-+}
-+
- static inline enum wmi_txbf_conf
- ath10k_wmi_get_txbf_conf_scheme(struct ath10k *ar)
- {
-@@ -1438,4 +1453,21 @@ ath10k_wmi_pdev_get_tpc_table_cmdid(stru
- ar->wmi.cmd->pdev_get_tpc_table_cmdid);
- }
-
-+static inline int
-+ath10k_wmi_report_radar_found(struct ath10k *ar,
-+ const struct ath10k_radar_found_info *arg)
-+{
-+ struct sk_buff *skb;
-+
-+ if (!ar->wmi.ops->gen_radar_found)
-+ return -EOPNOTSUPP;
-+
-+ skb = ar->wmi.ops->gen_radar_found(ar, arg);
-+ if (IS_ERR(skb))
-+ return PTR_ERR(skb);
-+
-+ return ath10k_wmi_cmd_send(ar, skb,
-+ ar->wmi.cmd->radar_found_cmdid);
-+}
-+
- #endif
---- a/drivers/net/wireless/ath/ath10k/wmi.c
-+++ b/drivers/net/wireless/ath/ath10k/wmi.c
-@@ -34,6 +34,7 @@
-
- #define ATH10K_WMI_BARRIER_ECHO_ID 0xBA991E9
- #define ATH10K_WMI_BARRIER_TIMEOUT_HZ (3 * HZ)
-+#define ATH10K_WMI_DFS_CONF_TIMEOUT_HZ (HZ / 6)
-
- /* MAIN WMI cmd track */
- static struct wmi_cmd_map wmi_cmd_map = {
-@@ -198,6 +199,7 @@ static struct wmi_cmd_map wmi_cmd_map =
- .set_cca_params_cmdid = WMI_CMD_UNSUPPORTED,
- .pdev_bss_chan_info_request_cmdid = WMI_CMD_UNSUPPORTED,
- .pdev_get_tpc_table_cmdid = WMI_CMD_UNSUPPORTED,
-+ .radar_found_cmdid = WMI_CMD_UNSUPPORTED,
- };
-
- /* 10.X WMI cmd track */
-@@ -365,6 +367,7 @@ static struct wmi_cmd_map wmi_10x_cmd_ma
- .set_cca_params_cmdid = WMI_CMD_UNSUPPORTED,
- .pdev_bss_chan_info_request_cmdid = WMI_CMD_UNSUPPORTED,
- .pdev_get_tpc_table_cmdid = WMI_CMD_UNSUPPORTED,
-+ .radar_found_cmdid = WMI_CMD_UNSUPPORTED,
- };
-
- /* 10.2.4 WMI cmd track */
-@@ -532,6 +535,7 @@ static struct wmi_cmd_map wmi_10_2_4_cmd
- .pdev_bss_chan_info_request_cmdid =
- WMI_10_2_PDEV_BSS_CHAN_INFO_REQUEST_CMDID,
- .pdev_get_tpc_table_cmdid = WMI_CMD_UNSUPPORTED,
-+ .radar_found_cmdid = WMI_CMD_UNSUPPORTED,
- };
-
- /* 10.4 WMI cmd track */
-@@ -741,6 +745,7 @@ static struct wmi_cmd_map wmi_10_4_cmd_m
- .tdls_set_state_cmdid = WMI_10_4_TDLS_SET_STATE_CMDID,
- .tdls_peer_update_cmdid = WMI_10_4_TDLS_PEER_UPDATE_CMDID,
- .tdls_set_offchan_mode_cmdid = WMI_10_4_TDLS_SET_OFFCHAN_MODE_CMDID,
-+ .radar_found_cmdid = WMI_10_4_RADAR_FOUND_CMDID,
- };
-
- /* MAIN WMI VDEV param map */
-@@ -1485,6 +1490,7 @@ static struct wmi_cmd_map wmi_10_2_cmd_m
- .pdev_get_ani_ofdm_config_cmdid = WMI_CMD_UNSUPPORTED,
- .pdev_reserve_ast_entry_cmdid = WMI_CMD_UNSUPPORTED,
- .pdev_get_tpc_table_cmdid = WMI_CMD_UNSUPPORTED,
-+ .radar_found_cmdid = WMI_CMD_UNSUPPORTED,
- };
-
- static struct wmi_pdev_param_map wmi_10_4_pdev_param_map = {
-@@ -3638,6 +3644,68 @@ void ath10k_wmi_event_tbttoffset_update(
- ath10k_dbg(ar, ATH10K_DBG_WMI, "WMI_TBTTOFFSET_UPDATE_EVENTID\n");
- }
-
-+static void ath10k_radar_detected(struct ath10k *ar)
-+{
-+ ath10k_dbg(ar, ATH10K_DBG_REGULATORY, "dfs radar detected\n");
-+ ATH10K_DFS_STAT_INC(ar, radar_detected);
-+
-+ /* Control radar events reporting in debugfs file
-+ * dfs_block_radar_events
-+ */
-+ if (ar->dfs_block_radar_events)
-+ ath10k_info(ar, "DFS Radar detected, but ignored as requested\n");
-+ else
-+ ieee80211_radar_detected(ar->hw);
-+}
-+
-+static void ath10k_radar_confirmation_work(struct work_struct *work)
-+{
-+ struct ath10k *ar = container_of(work, struct ath10k,
-+ radar_confirmation_work);
-+ struct ath10k_radar_found_info radar_info;
-+ int ret, time_left;
-+
-+ reinit_completion(&ar->wmi.radar_confirm);
-+
-+ spin_lock_bh(&ar->data_lock);
-+ memcpy(&radar_info, &ar->last_radar_info, sizeof(radar_info));
-+ spin_unlock_bh(&ar->data_lock);
-+
-+ ret = ath10k_wmi_report_radar_found(ar, &radar_info);
-+ if (ret) {
-+ ath10k_warn(ar, "failed to send radar found %d\n", ret);
-+ goto wait_complete;
-+ }
-+
-+ time_left = wait_for_completion_timeout(&ar->wmi.radar_confirm,
-+ ATH10K_WMI_DFS_CONF_TIMEOUT_HZ);
-+ if (time_left) {
-+ /* DFS Confirmation status event received and
-+ * necessary action completed.
-+ */
-+ goto wait_complete;
-+ } else {
-+ /* DFS Confirmation event not received from FW.Considering this
-+ * as real radar.
-+ */
-+ ath10k_dbg(ar, ATH10K_DBG_REGULATORY,
-+ "dfs confirmation not received from fw, considering as radar\n");
-+ goto radar_detected;
-+ }
-+
-+radar_detected:
-+ ath10k_radar_detected(ar);
-+
-+ /* Reset state to allow sending confirmation on consecutive radar
-+ * detections, unless radar confirmation is disabled/stopped.
-+ */
-+wait_complete:
-+ spin_lock_bh(&ar->data_lock);
-+ if (ar->radar_conf_state != ATH10K_RADAR_CONFIRMATION_STOPPED)
-+ ar->radar_conf_state = ATH10K_RADAR_CONFIRMATION_IDLE;
-+ spin_unlock_bh(&ar->data_lock);
-+}
-+
- static void ath10k_dfs_radar_report(struct ath10k *ar,
- struct wmi_phyerr_ev_arg *phyerr,
- const struct phyerr_radar_report *rr,
-@@ -3646,8 +3714,10 @@ static void ath10k_dfs_radar_report(stru
- u32 reg0, reg1, tsf32l;
- struct ieee80211_channel *ch;
- struct pulse_event pe;
-+ struct radar_detector_specs rs;
- u64 tsf64;
- u8 rssi, width;
-+ struct ath10k_radar_found_info *radar_info;
-
- reg0 = __le32_to_cpu(rr->reg0);
- reg1 = __le32_to_cpu(rr->reg1);
-@@ -3712,25 +3782,46 @@ static void ath10k_dfs_radar_report(stru
-
- ATH10K_DFS_STAT_INC(ar, pulses_detected);
-
-- if (!ar->dfs_detector->add_pulse(ar->dfs_detector, &pe, NULL)) {
-+ if (!ar->dfs_detector->add_pulse(ar->dfs_detector, &pe, &rs)) {
- ath10k_dbg(ar, ATH10K_DBG_REGULATORY,
- "dfs no pulse pattern detected, yet\n");
- return;
- }
-
--radar_detected:
-- ath10k_dbg(ar, ATH10K_DBG_REGULATORY, "dfs radar detected\n");
-- ATH10K_DFS_STAT_INC(ar, radar_detected);
-+ if ((test_bit(WMI_SERVICE_HOST_DFS_CHECK_SUPPORT, ar->wmi.svc_map)) &&
-+ ar->dfs_detector->region == NL80211_DFS_FCC) {
-+ /* Consecutive radar indications need not be
-+ * sent to the firmware until we get confirmation
-+ * for the previous detected radar.
-+ */
-+ spin_lock_bh(&ar->data_lock);
-+ if (ar->radar_conf_state != ATH10K_RADAR_CONFIRMATION_IDLE) {
-+ spin_unlock_bh(&ar->data_lock);
-+ return;
-+ }
-+ ar->radar_conf_state = ATH10K_RADAR_CONFIRMATION_INPROGRESS;
-+ radar_info = &ar->last_radar_info;
-
-- /* Control radar events reporting in debugfs file
-- * dfs_block_radar_events
-- */
-- if (ar->dfs_block_radar_events) {
-- ath10k_info(ar, "DFS Radar detected, but ignored as requested\n");
-+ radar_info->pri_min = rs.pri_min;
-+ radar_info->pri_max = rs.pri_max;
-+ radar_info->width_min = rs.width_min;
-+ radar_info->width_max = rs.width_max;
-+ /*TODO Find sidx_min and sidx_max */
-+ radar_info->sidx_min = MS(reg0, RADAR_REPORT_REG0_PULSE_SIDX);
-+ radar_info->sidx_max = MS(reg0, RADAR_REPORT_REG0_PULSE_SIDX);
-+
-+ ath10k_dbg(ar, ATH10K_DBG_REGULATORY,
-+ "sending wmi radar found cmd pri_min %d pri_max %d width_min %d width_max %d sidx_min %d sidx_max %d\n",
-+ radar_info->pri_min, radar_info->pri_max,
-+ radar_info->width_min, radar_info->width_max,
-+ radar_info->sidx_min, radar_info->sidx_max);
-+ ieee80211_queue_work(ar->hw, &ar->radar_confirmation_work);
-+ spin_unlock_bh(&ar->data_lock);
- return;
- }
-
-- ieee80211_radar_detected(ar->hw);
-+radar_detected:
-+ ath10k_radar_detected(ar);
- }
-
- static int ath10k_dfs_fft_report(struct ath10k *ar,
-@@ -4080,6 +4171,47 @@ void ath10k_wmi_event_phyerr(struct ath1
- }
- }
-
-+static int
-+ath10k_wmi_10_4_op_pull_dfs_status_ev(struct ath10k *ar, struct sk_buff *skb,
-+ struct wmi_dfs_status_ev_arg *arg)
-+{
-+ struct wmi_dfs_status_ev_arg *ev = (void *)skb->data;
-+
-+ if (skb->len < sizeof(*ev))
-+ return -EPROTO;
-+
-+ arg->status = ev->status;
-+
-+ return 0;
-+}
-+
-+static void
-+ath10k_wmi_event_dfs_status_check(struct ath10k *ar, struct sk_buff *skb)
-+{
-+ struct wmi_dfs_status_ev_arg status_arg = {};
-+ int ret;
-+
-+ ret = ath10k_wmi_pull_dfs_status(ar, skb, &status_arg);
-+
-+ if (ret) {
-+ ath10k_warn(ar, "failed to parse dfs status event: %d\n", ret);
-+ return;
-+ }
-+
-+ ath10k_dbg(ar, ATH10K_DBG_REGULATORY,
-+ "dfs status event received from fw: %d\n",
-+ status_arg.status);
-+
-+ /* Even in case of radar detection failure we follow the same
-+ * behaviour as if radar is detected i.e to switch to a different
-+ * channel.
-+ */
-+ if (status_arg.status == WMI_HW_RADAR_DETECTED ||
-+ status_arg.status == WMI_RADAR_DETECTION_FAIL)
-+ ath10k_radar_detected(ar);
-+ complete(&ar->wmi.radar_confirm);
-+}
-+
- void ath10k_wmi_event_roam(struct ath10k *ar, struct sk_buff *skb)
- {
- struct wmi_roam_ev_arg arg = {};
-@@ -5814,6 +5946,9 @@ static void ath10k_wmi_10_4_op_rx(struct
- case WMI_10_4_PDEV_TPC_TABLE_EVENTID:
- ath10k_wmi_event_tpc_final_table(ar, skb);
- break;
-+ case WMI_10_4_DFS_STATUS_CHECK_EVENTID:
-+ ath10k_wmi_event_dfs_status_check(ar, skb);
-+ break;
- default:
- ath10k_warn(ar, "Unknown eventid: %d\n", id);
- break;
-@@ -8332,6 +8467,32 @@ ath10k_wmi_10_4_gen_tdls_peer_update(str
- }
-
- static struct sk_buff *
-+ath10k_wmi_10_4_gen_radar_found(struct ath10k *ar,
-+ const struct ath10k_radar_found_info *arg)
-+{
-+ struct wmi_radar_found_info *cmd;
-+ struct sk_buff *skb;
-+
-+ skb = ath10k_wmi_alloc_skb(ar, sizeof(*cmd));
-+ if (!skb)
-+ return ERR_PTR(-ENOMEM);
-+
-+ cmd = (struct wmi_radar_found_info *)skb->data;
-+ cmd->pri_min = __cpu_to_le32(arg->pri_min);
-+ cmd->pri_max = __cpu_to_le32(arg->pri_max);
-+ cmd->width_min = __cpu_to_le32(arg->width_min);
-+ cmd->width_max = __cpu_to_le32(arg->width_max);
-+ cmd->sidx_min = __cpu_to_le32(arg->sidx_min);
-+ cmd->sidx_max = __cpu_to_le32(arg->sidx_max);
-+
-+ ath10k_dbg(ar, ATH10K_DBG_WMI,
-+ "wmi radar found pri_min %d pri_max %d width_min %d width_max %d sidx_min %d sidx_max %d\n",
-+ arg->pri_min, arg->pri_max, arg->width_min,
-+ arg->width_max, arg->sidx_min, arg->sidx_max);
-+ return skb;
-+}
-+
-+static struct sk_buff *
- ath10k_wmi_op_gen_echo(struct ath10k *ar, u32 value)
- {
- struct wmi_echo_cmd *cmd;
-@@ -8668,6 +8829,7 @@ static const struct wmi_ops wmi_10_4_ops
- .pull_svc_rdy = ath10k_wmi_main_op_pull_svc_rdy_ev,
- .pull_rdy = ath10k_wmi_op_pull_rdy_ev,
- .pull_roam_ev = ath10k_wmi_op_pull_roam_ev,
-+ .pull_dfs_status_ev = ath10k_wmi_10_4_op_pull_dfs_status_ev,
- .get_txbf_conf_scheme = ath10k_wmi_10_4_txbf_conf_scheme,
-
- .gen_pdev_suspend = ath10k_wmi_op_gen_pdev_suspend,
-@@ -8714,6 +8876,7 @@ static const struct wmi_ops wmi_10_4_ops
- .gen_tdls_peer_update = ath10k_wmi_10_4_gen_tdls_peer_update,
- .gen_pdev_get_tpc_table_cmdid =
- ath10k_wmi_10_4_op_gen_pdev_get_tpc_table_cmdid,
-+ .gen_radar_found = ath10k_wmi_10_4_gen_radar_found,
-
- /* shared with 10.2 */
- .pull_echo_ev = ath10k_wmi_op_pull_echo_ev,
-@@ -8776,8 +8939,11 @@ int ath10k_wmi_attach(struct ath10k *ar)
- init_completion(&ar->wmi.service_ready);
- init_completion(&ar->wmi.unified_ready);
- init_completion(&ar->wmi.barrier);
-+ init_completion(&ar->wmi.radar_confirm);
-
- INIT_WORK(&ar->svc_rdy_work, ath10k_wmi_event_service_ready_work);
-+ INIT_WORK(&ar->radar_confirmation_work,
-+ ath10k_radar_confirmation_work);
-
- return 0;
- }
---- a/drivers/net/wireless/ath/ath10k/wmi.h
-+++ b/drivers/net/wireless/ath/ath10k/wmi.h
-@@ -959,6 +959,7 @@ struct wmi_cmd_map {
- u32 vdev_sifs_trigger_time_cmdid;
- u32 pdev_wds_entry_list_cmdid;
- u32 tdls_set_offchan_mode_cmdid;
-+ u32 radar_found_cmdid;
- };
-
- /*
-@@ -1792,6 +1793,11 @@ enum wmi_10_4_cmd_id {
- WMI_10_4_TDLS_SET_STATE_CMDID,
- WMI_10_4_TDLS_PEER_UPDATE_CMDID,
- WMI_10_4_TDLS_SET_OFFCHAN_MODE_CMDID,
-+ WMI_10_4_PDEV_SEND_FD_CMDID,
-+ WMI_10_4_ENABLE_FILS_CMDID,
-+ WMI_10_4_PDEV_SET_BRIDGE_MACADDR_CMDID,
-+ WMI_10_4_ATF_GROUP_WMM_AC_CONFIG_REQUEST_CMDID,
-+ WMI_10_4_RADAR_FOUND_CMDID,
- WMI_10_4_PDEV_UTF_CMDID = WMI_10_4_END_CMDID - 1,
- };
-
-@@ -1867,6 +1873,9 @@ enum wmi_10_4_event_id {
- WMI_10_4_PDEV_TPC_TABLE_EVENTID,
- WMI_10_4_PDEV_WDS_ENTRY_LIST_EVENTID,
- WMI_10_4_TDLS_PEER_EVENTID,
-+ WMI_10_4_HOST_SWFDA_EVENTID,
-+ WMI_10_4_ESP_ESTIMATE_EVENTID,
-+ WMI_10_4_DFS_STATUS_CHECK_EVENTID,
- WMI_10_4_PDEV_UTF_EVENTID = WMI_10_4_END_EVENTID - 1,
- };
-
-@@ -3379,6 +3388,25 @@ struct wmi_10_4_phyerr_event {
- u8 buf[0];
- } __packed;
-
-+struct wmi_radar_found_info {
-+ __le32 pri_min;
-+ __le32 pri_max;
-+ __le32 width_min;
-+ __le32 width_max;
-+ __le32 sidx_min;
-+ __le32 sidx_max;
-+} __packed;
-+
-+enum wmi_radar_confirmation_status {
-+ /* Detected radar was due to SW pulses */
-+ WMI_SW_RADAR_DETECTED = 0,
-+
-+ WMI_RADAR_DETECTION_FAIL = 1,
-+
-+ /* Real radar detected */
-+ WMI_HW_RADAR_DETECTED = 2,
-+};
-+
- #define PHYERR_TLV_SIG 0xBB
- #define PHYERR_TLV_TAG_SEARCH_FFT_REPORT 0xFB
- #define PHYERR_TLV_TAG_RADAR_PULSE_SUMMARY 0xF8
-@@ -6586,6 +6614,10 @@ struct wmi_phyerr_hdr_arg {
- const void *phyerrs;
- };
-
-+struct wmi_dfs_status_ev_arg {
-+ u32 status;
-+};
-+
- struct wmi_svc_rdy_ev_arg {
- __le32 min_tx_power;
- __le32 max_tx_power;
diff --git a/package/kernel/mac80211/patches/380-0009-ath10k-fix-memory-leak-of-tpc_stats.patch b/package/kernel/mac80211/patches/380-0009-ath10k-fix-memory-leak-of-tpc_stats.patch
deleted file mode 100644
index 196a2bc862..0000000000
--- a/package/kernel/mac80211/patches/380-0009-ath10k-fix-memory-leak-of-tpc_stats.patch
+++ /dev/null
@@ -1,43 +0,0 @@
-From 260e629bbf441585860e21d5e10d2e88437f47c8 Mon Sep 17 00:00:00 2001
-From: Colin Ian King <colin.king@canonical.com>
-Date: Sun, 27 May 2018 22:17:02 +0100
-Subject: [PATCH] ath10k: fix memory leak of tpc_stats
-
-Currently tpc_stats is allocated and is leaked on the return
-path if num_tx_chain is greater than WMI_TPC_TX_N_CHAIN. Avoid
-this leak by performing the check on num_tx_chain before the
-allocation of tpc_stats.
-
-Detected by CoverityScan, CID#1469422 ("Resource Leak")
-Fixes: 4b190675ad06 ("ath10k: fix kernel panic while reading tpc_stats")
-
-Signed-off-by: Colin Ian King <colin.king@canonical.com>
-Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
----
- drivers/net/wireless/ath/ath10k/wmi.c | 8 ++++----
- 1 file changed, 4 insertions(+), 4 deletions(-)
-
---- a/drivers/net/wireless/ath/ath10k/wmi.c
-+++ b/drivers/net/wireless/ath/ath10k/wmi.c
-@@ -4557,10 +4557,6 @@ void ath10k_wmi_event_pdev_tpc_config(st
-
- ev = (struct wmi_pdev_tpc_config_event *)skb->data;
-
-- tpc_stats = kzalloc(sizeof(*tpc_stats), GFP_ATOMIC);
-- if (!tpc_stats)
-- return;
--
- num_tx_chain = __le32_to_cpu(ev->num_tx_chain);
-
- if (num_tx_chain > WMI_TPC_TX_N_CHAIN) {
-@@ -4569,6 +4565,10 @@ void ath10k_wmi_event_pdev_tpc_config(st
- return;
- }
-
-+ tpc_stats = kzalloc(sizeof(*tpc_stats), GFP_ATOMIC);
-+ if (!tpc_stats)
-+ return;
-+
- ath10k_wmi_tpc_config_get_rate_code(rate_code, pream_table,
- num_tx_chain);
-
diff --git a/package/kernel/mac80211/patches/380-0010-ath10k-support-use-of-channel-173.patch b/package/kernel/mac80211/patches/380-0010-ath10k-support-use-of-channel-173.patch
deleted file mode 100644
index 06b68b280a..0000000000
--- a/package/kernel/mac80211/patches/380-0010-ath10k-support-use-of-channel-173.patch
+++ /dev/null
@@ -1,52 +0,0 @@
-From 38441fb6fcbb97817dff5c012609860a2b39c3e9 Mon Sep 17 00:00:00 2001
-From: Ben Greear <greearb@candelatech.com>
-Date: Tue, 2 Jan 2018 16:51:01 -0800
-Subject: [PATCH] ath10k: support use of channel 173
-
-The India regulatory domain allows CH 173, so add that to the
-available channel list. I verified basic connectivity between
-a 9880 and 9984 NIC.
-
-Signed-off-by: Ben Greear <greearb@candelatech.com>
-Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
----
- drivers/net/wireless/ath/ath10k/core.h | 3 ++-
- drivers/net/wireless/ath/ath10k/mac.c | 3 +++
- drivers/net/wireless/ath/ath10k/wmi.c | 2 +-
- 3 files changed, 6 insertions(+), 2 deletions(-)
-
---- a/drivers/net/wireless/ath/ath10k/core.h
-+++ b/drivers/net/wireless/ath/ath10k/core.h
-@@ -47,7 +47,8 @@
- #define WMI_READY_TIMEOUT (5 * HZ)
- #define ATH10K_FLUSH_TIMEOUT_HZ (5 * HZ)
- #define ATH10K_CONNECTION_LOSS_HZ (3 * HZ)
--#define ATH10K_NUM_CHANS 40
-+#define ATH10K_NUM_CHANS 41
-+#define ATH10K_MAX_5G_CHAN 173
-
- /* Antenna noise floor */
- #define ATH10K_DEFAULT_NOISE_FLOOR -95
---- a/drivers/net/wireless/ath/ath10k/mac.c
-+++ b/drivers/net/wireless/ath/ath10k/mac.c
-@@ -7766,6 +7766,9 @@ static const struct ieee80211_channel at
- CHAN5G(161, 5805, 0),
- CHAN5G(165, 5825, 0),
- CHAN5G(169, 5845, 0),
-+ CHAN5G(173, 5865, 0),
-+ /* If you add more, you may need to change ATH10K_MAX_5G_CHAN */
-+ /* And you will definitely need to change ATH10K_NUM_CHANS in core.h */
- };
-
- struct ath10k *ath10k_mac_create(size_t priv_size)
---- a/drivers/net/wireless/ath/ath10k/wmi.c
-+++ b/drivers/net/wireless/ath/ath10k/wmi.c
-@@ -2363,7 +2363,7 @@ int ath10k_wmi_event_mgmt_rx(struct ath1
- */
- if (channel >= 1 && channel <= 14) {
- status->band = NL80211_BAND_2GHZ;
-- } else if (channel >= 36 && channel <= 169) {
-+ } else if (channel >= 36 && channel <= ATH10K_MAX_5G_CHAN) {
- status->band = NL80211_BAND_5GHZ;
- } else {
- /* Shouldn't happen unless list of advertised channels to
diff --git a/package/kernel/mac80211/patches/380-0011-ath10k-fix-spectral-scan-for-QCA9984-and-QCA9888-chi.patch b/package/kernel/mac80211/patches/380-0011-ath10k-fix-spectral-scan-for-QCA9984-and-QCA9888-chi.patch
deleted file mode 100644
index b974113b5e..0000000000
--- a/package/kernel/mac80211/patches/380-0011-ath10k-fix-spectral-scan-for-QCA9984-and-QCA9888-chi.patch
+++ /dev/null
@@ -1,156 +0,0 @@
-From 2e9bcd0d73243f5e49daf92508d64cc33c30da01 Mon Sep 17 00:00:00 2001
-From: Karthikeyan Periyasamy <periyasa@codeaurora.org>
-Date: Tue, 29 May 2018 17:01:13 +0530
-Subject: [PATCH] ath10k: fix spectral scan for QCA9984 and QCA9888 chipsets
-
-The spectral scan has been always broken on QCA9984 and QCA9888.
-
-Introduce a hardware parameter 'spectral_bin_offset' to resolve this issue for
-QCA9984 and QCA9888 chipsets. For other chipsets, the hardware parameter
-'spectral_bin_offset' is zero so that existing behaviour is retained as it is.
-
-In QCA9984 and QCA9888 chipsets, hardware param value 'spectral_bin_discard'
-is 12 bytes. This 12 bytes is derived as the sum of segment index (4 bytes),
-extra bins before the actual data (4 bytes) and extra bins after the actual
-data (4 bytes). Always discarding (12 bytes) happens at end of the samples and
-incorrect samples got dumped, so that user can find incorrect arrangement
-samples in spectral scan dump.
-
-To fix this issue, we have to discard first 8 bytes and last 4 bytes in every
-samples, so totally 12 bytes are discarded. In every sample we need to consider
-the offset while taking the actual spectral data. For QCA9984, QCA9888 the
-offset is 8 bytes (segment index + extra bins before actual data).
-
-Hardware tested: QCA9984 and QCA9888
-Firmware tested: 10.4-3.5.3-00053
-
-Signed-off-by: Karthikeyan Periyasamy <periyasa@codeaurora.org>
-Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
----
- drivers/net/wireless/ath/ath10k/core.c | 13 +++++++++++++
- drivers/net/wireless/ath/ath10k/hw.h | 3 +++
- drivers/net/wireless/ath/ath10k/spectral.c | 2 +-
- 3 files changed, 17 insertions(+), 1 deletion(-)
-
---- a/drivers/net/wireless/ath/ath10k/core.c
-+++ b/drivers/net/wireless/ath/ath10k/core.c
-@@ -72,6 +72,7 @@ static const struct ath10k_hw_params ath
- .hw_ops = &qca988x_ops,
- .decap_align_bytes = 4,
- .spectral_bin_discard = 0,
-+ .spectral_bin_offset = 0,
- .vht160_mcs_rx_highest = 0,
- .vht160_mcs_tx_highest = 0,
- .n_cipher_suites = 8,
-@@ -96,6 +97,7 @@ static const struct ath10k_hw_params ath
- .hw_ops = &qca988x_ops,
- .decap_align_bytes = 4,
- .spectral_bin_discard = 0,
-+ .spectral_bin_offset = 0,
- .vht160_mcs_rx_highest = 0,
- .vht160_mcs_tx_highest = 0,
- .n_cipher_suites = 8,
-@@ -119,6 +121,7 @@ static const struct ath10k_hw_params ath
- .hw_ops = &qca988x_ops,
- .decap_align_bytes = 4,
- .spectral_bin_discard = 0,
-+ .spectral_bin_offset = 0,
- .vht160_mcs_rx_highest = 0,
- .vht160_mcs_tx_highest = 0,
- .n_cipher_suites = 8,
-@@ -142,6 +145,7 @@ static const struct ath10k_hw_params ath
- .hw_ops = &qca988x_ops,
- .decap_align_bytes = 4,
- .spectral_bin_discard = 0,
-+ .spectral_bin_offset = 0,
- .vht160_mcs_rx_highest = 0,
- .vht160_mcs_tx_highest = 0,
- .n_cipher_suites = 8,
-@@ -165,6 +169,8 @@ static const struct ath10k_hw_params ath
- .hw_ops = &qca988x_ops,
- .decap_align_bytes = 4,
- .spectral_bin_discard = 0,
-+ .spectral_bin_offset = 0,
-+ .spectral_bin_offset = 0,
- .vht160_mcs_rx_highest = 0,
- .vht160_mcs_tx_highest = 0,
- .n_cipher_suites = 8,
-@@ -191,6 +197,7 @@ static const struct ath10k_hw_params ath
- .target_cpu_freq = 176000000,
- .decap_align_bytes = 4,
- .spectral_bin_discard = 0,
-+ .spectral_bin_offset = 0,
- .vht160_mcs_rx_highest = 0,
- .vht160_mcs_tx_highest = 0,
- .n_cipher_suites = 8,
-@@ -220,6 +227,7 @@ static const struct ath10k_hw_params ath
- .hw_ops = &qca99x0_ops,
- .decap_align_bytes = 1,
- .spectral_bin_discard = 4,
-+ .spectral_bin_offset = 0,
- .vht160_mcs_rx_highest = 0,
- .vht160_mcs_tx_highest = 0,
- .n_cipher_suites = 11,
-@@ -250,6 +258,7 @@ static const struct ath10k_hw_params ath
- .hw_ops = &qca99x0_ops,
- .decap_align_bytes = 1,
- .spectral_bin_discard = 12,
-+ .spectral_bin_offset = 8,
-
- /* Can do only 2x2 VHT160 or 80+80. 1560Mbps is 4x4 80Mhz
- * or 2x2 160Mhz, long-guard-interval.
-@@ -283,6 +292,7 @@ static const struct ath10k_hw_params ath
- .hw_ops = &qca99x0_ops,
- .decap_align_bytes = 1,
- .spectral_bin_discard = 12,
-+ .spectral_bin_offset = 8,
-
- /* Can do only 1x1 VHT160 or 80+80. 780Mbps is 2x2 80Mhz or
- * 1x1 160Mhz, long-guard-interval.
-@@ -310,6 +320,7 @@ static const struct ath10k_hw_params ath
- .hw_ops = &qca988x_ops,
- .decap_align_bytes = 4,
- .spectral_bin_discard = 0,
-+ .spectral_bin_offset = 0,
- .vht160_mcs_rx_highest = 0,
- .vht160_mcs_tx_highest = 0,
- .n_cipher_suites = 8,
-@@ -335,6 +346,7 @@ static const struct ath10k_hw_params ath
- .target_cpu_freq = 176000000,
- .decap_align_bytes = 4,
- .spectral_bin_discard = 0,
-+ .spectral_bin_offset = 0,
- .vht160_mcs_rx_highest = 0,
- .vht160_mcs_tx_highest = 0,
- .n_cipher_suites = 8,
-@@ -365,6 +377,7 @@ static const struct ath10k_hw_params ath
- .hw_ops = &qca99x0_ops,
- .decap_align_bytes = 1,
- .spectral_bin_discard = 4,
-+ .spectral_bin_offset = 0,
- .vht160_mcs_rx_highest = 0,
- .vht160_mcs_tx_highest = 0,
- .n_cipher_suites = 11,
---- a/drivers/net/wireless/ath/ath10k/hw.h
-+++ b/drivers/net/wireless/ath/ath10k/hw.h
-@@ -553,6 +553,9 @@ struct ath10k_hw_params {
-
- /* Number of ciphers supported (i.e First N) in cipher_suites array */
- int n_cipher_suites;
-+
-+ /* Number of bytes to be the offset for each FFT sample */
-+ int spectral_bin_offset;
- };
-
- struct htt_rx_desc;
---- a/drivers/net/wireless/ath/ath10k/spectral.c
-+++ b/drivers/net/wireless/ath/ath10k/spectral.c
-@@ -145,7 +145,7 @@ int ath10k_spectral_process_fft(struct a
- fft_sample->noise = __cpu_to_be16(phyerr->nf_chains[chain_idx]);
-
- bins = (u8 *)fftr;
-- bins += sizeof(*fftr);
-+ bins += sizeof(*fftr) + ar->hw_params.spectral_bin_offset;
-
- fft_sample->tsf = __cpu_to_be64(tsf);
-
diff --git a/package/kernel/mac80211/patches/941-mwl8k-add-non-DFS-5G-upper-channels.patch b/package/kernel/mac80211/patches/941-mwl8k-add-non-DFS-5G-upper-channels.patch
deleted file mode 100644
index e82db4d67e..0000000000
--- a/package/kernel/mac80211/patches/941-mwl8k-add-non-DFS-5G-upper-channels.patch
+++ /dev/null
@@ -1,37 +0,0 @@
-From 4628257bf3006c18e0037459922624f02a138aed Mon Sep 17 00:00:00 2001
-From: Weixiao Zhang <waveletboy@gmail.com>
-Date: Thu, 16 Nov 2017 01:59:55 -0600
-Subject: [PATCH] mwl8k: Expand non-DFS 5G channels
-
-Add non-DFS 5G upper channels (149-165) besides existed 4 lower channels
-(36, 40, 44, 48).
-
-Signed-off-by: Weixiao Zhang <waveletboy@gmail.com>
-Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
----
- drivers/net/wireless/marvell/mwl8k.c | 7 ++++++-
- 1 file changed, 6 insertions(+), 1 deletion(-)
-
---- a/drivers/net/wireless/marvell/mwl8k.c
-+++ b/drivers/net/wireless/marvell/mwl8k.c
-@@ -199,7 +199,7 @@ struct mwl8k_priv {
- struct ieee80211_channel channels_24[14];
- struct ieee80211_rate rates_24[13];
- struct ieee80211_supported_band band_50;
-- struct ieee80211_channel channels_50[4];
-+ struct ieee80211_channel channels_50[9];
- struct ieee80211_rate rates_50[8];
- u32 ap_macids_supported;
- u32 sta_macids_supported;
-@@ -383,6 +383,11 @@ static const struct ieee80211_channel mw
- { .band = NL80211_BAND_5GHZ, .center_freq = 5200, .hw_value = 40, },
- { .band = NL80211_BAND_5GHZ, .center_freq = 5220, .hw_value = 44, },
- { .band = NL80211_BAND_5GHZ, .center_freq = 5240, .hw_value = 48, },
-+ { .band = NL80211_BAND_5GHZ, .center_freq = 5745, .hw_value = 149, },
-+ { .band = NL80211_BAND_5GHZ, .center_freq = 5765, .hw_value = 153, },
-+ { .band = NL80211_BAND_5GHZ, .center_freq = 5785, .hw_value = 157, },
-+ { .band = NL80211_BAND_5GHZ, .center_freq = 5805, .hw_value = 161, },
-+ { .band = NL80211_BAND_5GHZ, .center_freq = 5825, .hw_value = 165, },
- };
-
- static const struct ieee80211_rate mwl8k_rates_50[] = {
diff --git a/package/kernel/mac80211/patches/960-0010-ath10k-limit-htt-rx-ring-size.patch b/package/kernel/mac80211/patches/960-0010-ath10k-limit-htt-rx-ring-size.patch
deleted file mode 100644
index 914472aab9..0000000000
--- a/package/kernel/mac80211/patches/960-0010-ath10k-limit-htt-rx-ring-size.patch
+++ /dev/null
@@ -1,11 +0,0 @@
---- a/drivers/net/wireless/ath/ath10k/htt.h
-+++ b/drivers/net/wireless/ath/ath10k/htt.h
-@@ -200,7 +200,7 @@ enum htt_rx_ring_flags {
- };
-
- #define HTT_RX_RING_SIZE_MIN 128
--#define HTT_RX_RING_SIZE_MAX 2048
-+#define HTT_RX_RING_SIZE_MAX 512
-
- struct htt_rx_ring_setup_ring {
- __le32 fw_idx_shadow_reg_paddr;
diff --git a/package/kernel/mac80211/patches/970-rsi-fix-kbuild-reported-build-errors-with-CONFIG_PM-off b/package/kernel/mac80211/patches/970-rsi-fix-kbuild-reported-build-errors-with-CONFIG_PM-off
deleted file mode 100644
index 3b139ee326..0000000000
--- a/package/kernel/mac80211/patches/970-rsi-fix-kbuild-reported-build-errors-with-CONFIG_PM-off
+++ /dev/null
@@ -1,93 +0,0 @@
-From e6b3b2ed3d270b3c7080c9cf7d28636dc74b0387 Mon Sep 17 00:00:00 2001
-From: Amitkumar Karwar <amit.karwar@redpinesignals.com>
-Date: Wed, 1 Nov 2017 17:42:45 +0530
-Subject: rsi: fix kbuild reported build errors with CONFIG_PM off
-
-Some wowlan related code was outside CONFIG_PM flag which caused these
-build errors. They are fixed by moving that code under CONFIG_PM flag.
-
-Reported-by: kbuild test robot <fengguang.wu@intel.com>
-Fixes: ef71ed0608c ("rsi: sdio: Add WOWLAN support for S5 shutdown state")
-Fixes: a24e35fcee0 ("rsi: sdio: Add WOWLAN support for S4 hibernate state")
-Fixes: e1ced6422a3 ("rsi: sdio: add WOWLAN support for S3 suspend state")
-Signed-off-by: Amitkumar Karwar <amit.karwar@redpinesignals.com>
-Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
----
- drivers/net/wireless/rsi/rsi_91x_mac80211.c | 5 ++++-
- drivers/net/wireless/rsi/rsi_91x_mgmt.c | 2 ++
- drivers/net/wireless/rsi/rsi_common.h | 2 ++
- drivers/net/wireless/rsi/rsi_mgmt.h | 2 ++
- 4 files changed, 10 insertions(+), 1 deletion(-)
-
---- a/drivers/net/wireless/rsi/rsi_91x_mac80211.c
-+++ b/drivers/net/wireless/rsi/rsi_91x_mac80211.c
-@@ -1752,6 +1752,7 @@ static int rsi_mac80211_cancel_roc(struc
- return 0;
- }
-
-+#ifdef CONFIG_PM
- static const struct wiphy_wowlan_support rsi_wowlan_support = {
- .flags = WIPHY_WOWLAN_ANY |
- WIPHY_WOWLAN_MAGIC_PKT |
-@@ -1824,7 +1825,6 @@ int rsi_config_wowlan(struct rsi_hw *ada
- }
- EXPORT_SYMBOL(rsi_config_wowlan);
-
--#ifdef CONFIG_PM
- static int rsi_mac80211_suspend(struct ieee80211_hw *hw,
- struct cfg80211_wowlan *wowlan)
- {
-@@ -1977,7 +1977,10 @@ int rsi_mac80211_attach(struct rsi_commo
- wiphy->features |= NL80211_FEATURE_INACTIVITY_TIMER;
- wiphy->reg_notifier = rsi_reg_notify;
-
-+#ifdef CONFIG_PM
- wiphy->wowlan = &rsi_wowlan_support;
-+#endif
-+
- wiphy_ext_feature_set(wiphy, NL80211_EXT_FEATURE_CQM_RSSI_LIST);
-
- /* Wi-Fi direct parameters */
---- a/drivers/net/wireless/rsi/rsi_91x_mgmt.c
-+++ b/drivers/net/wireless/rsi/rsi_91x_mgmt.c
-@@ -1597,6 +1597,7 @@ static int rsi_send_beacon(struct rsi_co
- return 0;
- }
-
-+#ifdef CONFIG_PM
- int rsi_send_wowlan_request(struct rsi_common *common, u16 flags,
- u16 sleep_status)
- {
-@@ -1630,6 +1631,7 @@ int rsi_send_wowlan_request(struct rsi_c
-
- return rsi_send_internal_mgmt_frame(common, skb);
- }
-+#endif
-
- /**
- * rsi_handle_ta_confirm_type() - This function handles the confirm frames.
---- a/drivers/net/wireless/rsi/rsi_common.h
-+++ b/drivers/net/wireless/rsi/rsi_common.h
-@@ -83,7 +83,9 @@ u16 rsi_get_connected_channel(struct iee
- struct rsi_hw *rsi_91x_init(void);
- void rsi_91x_deinit(struct rsi_hw *adapter);
- int rsi_read_pkt(struct rsi_common *common, s32 rcv_pkt_len);
-+#ifdef CONFIG_PM
- int rsi_config_wowlan(struct rsi_hw *adapter, struct cfg80211_wowlan *wowlan);
-+#endif
- struct rsi_sta *rsi_find_sta(struct rsi_common *common, u8 *mac_addr);
- struct ieee80211_vif *rsi_get_vif(struct rsi_hw *adapter, u8 *mac);
- void rsi_roc_timeout(struct timer_list *t);
---- a/drivers/net/wireless/rsi/rsi_mgmt.h
-+++ b/drivers/net/wireless/rsi/rsi_mgmt.h
-@@ -668,8 +668,10 @@ int rsi_band_check(struct rsi_common *co
- int rsi_send_rx_filter_frame(struct rsi_common *common, u16 rx_filter_word);
- int rsi_send_radio_params_update(struct rsi_common *common);
- int rsi_set_antenna(struct rsi_common *common, u8 antenna);
-+#ifdef CONFIG_PM
- int rsi_send_wowlan_request(struct rsi_common *common, u16 flags,
- u16 sleep_status);
-+#endif
- int rsi_send_ps_request(struct rsi_hw *adapter, bool enable,
- struct ieee80211_vif *vif);
- #endif
diff --git a/package/kernel/mac80211/patches/971-rsi-move-rsi_sdio_reinit_device-out-of-CONFIG_PM.patch b/package/kernel/mac80211/patches/971-rsi-move-rsi_sdio_reinit_device-out-of-CONFIG_PM.patch
deleted file mode 100644
index 499b4ee7fc..0000000000
--- a/package/kernel/mac80211/patches/971-rsi-move-rsi_sdio_reinit_device-out-of-CONFIG_PM.patch
+++ /dev/null
@@ -1,96 +0,0 @@
-From 39f1332c526cd9d6de59a72520e8334e54b62cda Mon Sep 17 00:00:00 2001
-From: Amitkumar Karwar <amit.karwar@redpinesignals.com>
-Date: Wed, 1 Nov 2017 17:42:44 +0530
-Subject: rsi: move rsi_sdio_reinit_device() out of CONFIG_PM
-
-This function is generic. It doesn't contain wowlan specific code.
-It should not be under CONFIG_PM. This patch resolves compilation
-errors observed when CONFIG_PM flag is disabled.
-
-Reported-by: kbuild test robot <fengguang.wu@intel.com>
-Fixes: ef71ed0608c ("rsi: sdio: Add WOWLAN support for S5 shutdown state")
-Fixes: a24e35fcee0 ("rsi: sdio: Add WOWLAN support for S4 hibernate state")
-Fixes: e1ced6422a3 ("rsi: sdio: add WOWLAN support for S3 suspend state")
-Signed-off-by: Amitkumar Karwar <amit.karwar@redpinesignals.com>
-Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
----
- drivers/net/wireless/rsi/rsi_91x_sdio.c | 52 ++++++++++++++++-----------------
- drivers/net/wireless/rsi/rsi_sdio.h | 1 -
- 2 files changed, 26 insertions(+), 27 deletions(-)
-
---- a/drivers/net/wireless/rsi/rsi_91x_sdio.c
-+++ b/drivers/net/wireless/rsi/rsi_91x_sdio.c
-@@ -871,6 +871,32 @@ fail:
- return status;
- }
-
-+static int rsi_sdio_reinit_device(struct rsi_hw *adapter)
-+{
-+ struct rsi_91x_sdiodev *sdev = adapter->rsi_dev;
-+ struct sdio_func *pfunction = sdev->pfunction;
-+ int ii;
-+
-+ for (ii = 0; ii < NUM_SOFT_QUEUES; ii++)
-+ skb_queue_purge(&adapter->priv->tx_queue[ii]);
-+
-+ /* Initialize device again */
-+ sdio_claim_host(pfunction);
-+
-+ sdio_release_irq(pfunction);
-+ rsi_reset_card(pfunction);
-+
-+ sdio_enable_func(pfunction);
-+ rsi_setupcard(adapter);
-+ rsi_init_sdio_slave_regs(adapter);
-+ sdio_claim_irq(pfunction, rsi_handle_interrupt);
-+ rsi_hal_device_init(adapter);
-+
-+ sdio_release_host(pfunction);
-+
-+ return 0;
-+}
-+
- static struct rsi_host_intf_ops sdio_host_intf_ops = {
- .write_pkt = rsi_sdio_host_intf_write_pkt,
- .read_pkt = rsi_sdio_host_intf_read_pkt,
-@@ -1281,32 +1307,6 @@ static void rsi_shutdown(struct device *
- rsi_dbg(INFO_ZONE, "***** RSI module shut down *****\n");
- }
-
--int rsi_sdio_reinit_device(struct rsi_hw *adapter)
--{
-- struct rsi_91x_sdiodev *sdev = adapter->rsi_dev;
-- struct sdio_func *pfunction = sdev->pfunction;
-- int ii;
--
-- for (ii = 0; ii < NUM_SOFT_QUEUES; ii++)
-- skb_queue_purge(&adapter->priv->tx_queue[ii]);
--
-- /* Initialize device again */
-- sdio_claim_host(pfunction);
--
-- sdio_release_irq(pfunction);
-- rsi_reset_card(pfunction);
--
-- sdio_enable_func(pfunction);
-- rsi_setupcard(adapter);
-- rsi_init_sdio_slave_regs(adapter);
-- sdio_claim_irq(pfunction, rsi_handle_interrupt);
-- rsi_hal_device_init(adapter);
--
-- sdio_release_host(pfunction);
--
-- return 0;
--}
--
- static int rsi_restore(struct device *dev)
- {
- struct sdio_func *pfunction = dev_to_sdio_func(dev);
---- a/drivers/net/wireless/rsi/rsi_sdio.h
-+++ b/drivers/net/wireless/rsi/rsi_sdio.h
-@@ -131,5 +131,4 @@ int rsi_sdio_master_access_msword(struct
- void rsi_sdio_ack_intr(struct rsi_hw *adapter, u8 int_bit);
- int rsi_sdio_determine_event_timeout(struct rsi_hw *adapter);
- int rsi_sdio_check_buffer_status(struct rsi_hw *adapter, u8 q_num);
--int rsi_sdio_reinit_device(struct rsi_hw *adapter);
- #endif
diff --git a/package/kernel/mac80211/patches/070-ath_common_config.patch b/package/kernel/mac80211/patches/ath/070-ath_common_config.patch
index 41774fe53e..41774fe53e 100644
--- a/package/kernel/mac80211/patches/070-ath_common_config.patch
+++ b/package/kernel/mac80211/patches/ath/070-ath_common_config.patch
diff --git a/package/kernel/mac80211/patches/ath/080-ath10k_thermal_config.patch b/package/kernel/mac80211/patches/ath/080-ath10k_thermal_config.patch
new file mode 100644
index 0000000000..f008a795d8
--- /dev/null
+++ b/package/kernel/mac80211/patches/ath/080-ath10k_thermal_config.patch
@@ -0,0 +1,55 @@
+Index: backports-v4.18-rc7/drivers/net/wireless/ath/ath10k/Kconfig
+===================================================================
+--- backports-v4.18-rc7.orig/drivers/net/wireless/ath/ath10k/Kconfig
++++ backports-v4.18-rc7/drivers/net/wireless/ath/ath10k/Kconfig
+@@ -85,6 +85,12 @@ config ATH10K_TRACING
+ ---help---
+ Select this to ath10k use tracing infrastructure.
+
++config ATH10K_THERMAL
++ bool "Atheros ath10k thermal monitoring support"
++ depends on THERMAL
++ ---help---
++ Select this to ath10k use hwmon for thermal measurement.
++
+ config ATH10K_DFS_CERTIFIED
+ bool "Atheros DFS support for certified platforms"
+ depends on ATH10K && CFG80211_CERTIFICATION_ONUS
+Index: backports-v4.18-rc7/drivers/net/wireless/ath/ath10k/Makefile
+===================================================================
+--- backports-v4.18-rc7.orig/drivers/net/wireless/ath/ath10k/Makefile
++++ backports-v4.18-rc7/drivers/net/wireless/ath/ath10k/Makefile
+@@ -18,7 +18,7 @@ ath10k_core-y += mac.o \
+ ath10k_core-$(CPTCFG_ATH10K_SPECTRAL) += spectral.o
+ ath10k_core-$(CPTCFG_NL80211_TESTMODE) += testmode.o
+ ath10k_core-$(CPTCFG_ATH10K_TRACING) += trace.o
+-ath10k_core-$(CONFIG_THERMAL) += thermal.o
++ath10k_core-$(CPTCFG_ATH10K_THERMAL) += thermal.o
+ ath10k_core-$(CPTCFG_MAC80211_DEBUGFS) += debugfs_sta.o
+ ath10k_core-$(CONFIG_PM) += wow.o
+ ath10k_core-$(CONFIG_DEV_COREDUMP) += coredump.o
+Index: backports-v4.18-rc7/drivers/net/wireless/ath/ath10k/thermal.h
+===================================================================
+--- backports-v4.18-rc7.orig/drivers/net/wireless/ath/ath10k/thermal.h
++++ backports-v4.18-rc7/drivers/net/wireless/ath/ath10k/thermal.h
+@@ -36,7 +36,7 @@ struct ath10k_thermal {
+ int temperature;
+ };
+
+-#if IS_REACHABLE(CONFIG_THERMAL)
++#if IS_REACHABLE(CPTCFG_ATH10K_THERMAL)
+ int ath10k_thermal_register(struct ath10k *ar);
+ void ath10k_thermal_unregister(struct ath10k *ar);
+ void ath10k_thermal_event_temperature(struct ath10k *ar, int temperature);
+Index: backports-v4.18-rc7/local-symbols
+===================================================================
+--- backports-v4.18-rc7.orig/local-symbols
++++ backports-v4.18-rc7/local-symbols
+@@ -144,6 +144,7 @@ ATH10K_SNOC=
+ ATH10K_DEBUG=
+ ATH10K_DEBUGFS=
+ ATH10K_SPECTRAL=
++ATH10K_THERMAL=
+ ATH10K_TRACING=
+ ATH10K_DFS_CERTIFIED=
+ WCN36XX=
diff --git a/package/kernel/mac80211/patches/201-ath5k-WAR-for-AR71xx-PCI-bug.patch b/package/kernel/mac80211/patches/ath/201-ath5k-WAR-for-AR71xx-PCI-bug.patch
index 21516ffde9..21516ffde9 100644
--- a/package/kernel/mac80211/patches/201-ath5k-WAR-for-AR71xx-PCI-bug.patch
+++ b/package/kernel/mac80211/patches/ath/201-ath5k-WAR-for-AR71xx-PCI-bug.patch
diff --git a/package/kernel/mac80211/patches/350-ath9k_hw-reset-AHB-WMAC-interface-on-AR91xx.patch b/package/kernel/mac80211/patches/ath/350-ath9k_hw-reset-AHB-WMAC-interface-on-AR91xx.patch
index a7bcfa549b..a7bcfa549b 100644
--- a/package/kernel/mac80211/patches/350-ath9k_hw-reset-AHB-WMAC-interface-on-AR91xx.patch
+++ b/package/kernel/mac80211/patches/ath/350-ath9k_hw-reset-AHB-WMAC-interface-on-AR91xx.patch
diff --git a/package/kernel/mac80211/patches/351-ath9k_hw-issue-external-reset-for-QCA955x.patch b/package/kernel/mac80211/patches/ath/351-ath9k_hw-issue-external-reset-for-QCA955x.patch
index 5eb69b898d..5eb69b898d 100644
--- a/package/kernel/mac80211/patches/351-ath9k_hw-issue-external-reset-for-QCA955x.patch
+++ b/package/kernel/mac80211/patches/ath/351-ath9k_hw-issue-external-reset-for-QCA955x.patch
diff --git a/package/kernel/mac80211/patches/352-ath9k_hw-set-spectral-scan-enable-bit-on-trigger-for.patch b/package/kernel/mac80211/patches/ath/352-ath9k_hw-set-spectral-scan-enable-bit-on-trigger-for.patch
index dfe9aae268..dfe9aae268 100644
--- a/package/kernel/mac80211/patches/352-ath9k_hw-set-spectral-scan-enable-bit-on-trigger-for.patch
+++ b/package/kernel/mac80211/patches/ath/352-ath9k_hw-set-spectral-scan-enable-bit-on-trigger-for.patch
diff --git a/package/kernel/mac80211/patches/353-ath9k-don-t-run-periodic-and-nf-calibation-at-the-sa.patch b/package/kernel/mac80211/patches/ath/353-ath9k-don-t-run-periodic-and-nf-calibation-at-the-sa.patch
index 22f5154146..22f5154146 100644
--- a/package/kernel/mac80211/patches/353-ath9k-don-t-run-periodic-and-nf-calibation-at-the-sa.patch
+++ b/package/kernel/mac80211/patches/ath/353-ath9k-don-t-run-periodic-and-nf-calibation-at-the-sa.patch
diff --git a/package/kernel/mac80211/patches/354-ath9k-force-rx_clear-when-disabling-rx.patch b/package/kernel/mac80211/patches/ath/354-ath9k-force-rx_clear-when-disabling-rx.patch
index 8aaccf49b4..8aaccf49b4 100644
--- a/package/kernel/mac80211/patches/354-ath9k-force-rx_clear-when-disabling-rx.patch
+++ b/package/kernel/mac80211/patches/ath/354-ath9k-force-rx_clear-when-disabling-rx.patch
diff --git a/package/kernel/mac80211/patches/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 35d07430eb..35d07430eb 100644
--- a/package/kernel/mac80211/patches/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
diff --git a/package/kernel/mac80211/patches/360-ath9k-fix-moredata-bit-in-PS-buffered-frame-release.patch b/package/kernel/mac80211/patches/ath/360-ath9k-fix-moredata-bit-in-PS-buffered-frame-release.patch
index d651e6ce30..d651e6ce30 100644
--- a/package/kernel/mac80211/patches/360-ath9k-fix-moredata-bit-in-PS-buffered-frame-release.patch
+++ b/package/kernel/mac80211/patches/ath/360-ath9k-fix-moredata-bit-in-PS-buffered-frame-release.patch
diff --git a/package/kernel/mac80211/patches/361-ath9k-clear-potentially-stale-EOSP-status-bit-in-int.patch b/package/kernel/mac80211/patches/ath/361-ath9k-clear-potentially-stale-EOSP-status-bit-in-int.patch
index 319de2a767..319de2a767 100644
--- a/package/kernel/mac80211/patches/361-ath9k-clear-potentially-stale-EOSP-status-bit-in-int.patch
+++ b/package/kernel/mac80211/patches/ath/361-ath9k-clear-potentially-stale-EOSP-status-bit-in-int.patch
diff --git a/package/kernel/mac80211/patches/362-ath9k-report-tx-status-on-EOSP.patch b/package/kernel/mac80211/patches/ath/362-ath9k-report-tx-status-on-EOSP.patch
index 80a3074a4d..80a3074a4d 100644
--- a/package/kernel/mac80211/patches/362-ath9k-report-tx-status-on-EOSP.patch
+++ b/package/kernel/mac80211/patches/ath/362-ath9k-report-tx-status-on-EOSP.patch
diff --git a/package/kernel/mac80211/patches/363-ath9k-fix-block-ack-window-tracking-issues.patch b/package/kernel/mac80211/patches/ath/363-ath9k-fix-block-ack-window-tracking-issues.patch
index e25e92dda9..e25e92dda9 100644
--- a/package/kernel/mac80211/patches/363-ath9k-fix-block-ack-window-tracking-issues.patch
+++ b/package/kernel/mac80211/patches/ath/363-ath9k-fix-block-ack-window-tracking-issues.patch
diff --git a/package/kernel/mac80211/patches/364-ath9k_hw-fix-channel-maximum-power-level-test.patch b/package/kernel/mac80211/patches/ath/364-ath9k_hw-fix-channel-maximum-power-level-test.patch
index 67cbe92e59..67cbe92e59 100644
--- a/package/kernel/mac80211/patches/364-ath9k_hw-fix-channel-maximum-power-level-test.patch
+++ b/package/kernel/mac80211/patches/ath/364-ath9k_hw-fix-channel-maximum-power-level-test.patch
diff --git a/package/kernel/mac80211/patches/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 78083517bc..78083517bc 100644
--- a/package/kernel/mac80211/patches/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
diff --git a/package/kernel/mac80211/patches/366-ath9k-fix-more-data-flag-for-buffered-multicast-pack.patch b/package/kernel/mac80211/patches/ath/366-ath9k-fix-more-data-flag-for-buffered-multicast-pack.patch
index 0f3120d671..0f3120d671 100644
--- a/package/kernel/mac80211/patches/366-ath9k-fix-more-data-flag-for-buffered-multicast-pack.patch
+++ b/package/kernel/mac80211/patches/ath/366-ath9k-fix-more-data-flag-for-buffered-multicast-pack.patch
diff --git a/package/kernel/mac80211/patches/381-ath9k-fix-tx99-with-monitor-mode-interface.patch b/package/kernel/mac80211/patches/ath/381-ath9k-fix-tx99-with-monitor-mode-interface.patch
index 777b73417f..777b73417f 100644
--- a/package/kernel/mac80211/patches/381-ath9k-fix-tx99-with-monitor-mode-interface.patch
+++ b/package/kernel/mac80211/patches/ath/381-ath9k-fix-tx99-with-monitor-mode-interface.patch
diff --git a/package/kernel/mac80211/patches/400-ath_move_debug_code.patch b/package/kernel/mac80211/patches/ath/400-ath_move_debug_code.patch
index ed65053d77..ed65053d77 100644
--- a/package/kernel/mac80211/patches/400-ath_move_debug_code.patch
+++ b/package/kernel/mac80211/patches/ath/400-ath_move_debug_code.patch
diff --git a/package/kernel/mac80211/patches/401-ath9k_blink_default.patch b/package/kernel/mac80211/patches/ath/401-ath9k_blink_default.patch
index 7405e594fe..7405e594fe 100644
--- a/package/kernel/mac80211/patches/401-ath9k_blink_default.patch
+++ b/package/kernel/mac80211/patches/ath/401-ath9k_blink_default.patch
diff --git a/package/kernel/mac80211/patches/402-ath_regd_optional.patch b/package/kernel/mac80211/patches/ath/402-ath_regd_optional.patch
index 8fa56f40a4..8fa56f40a4 100644
--- a/package/kernel/mac80211/patches/402-ath_regd_optional.patch
+++ b/package/kernel/mac80211/patches/ath/402-ath_regd_optional.patch
diff --git a/package/kernel/mac80211/patches/403-world_regd_fixup.patch b/package/kernel/mac80211/patches/ath/403-world_regd_fixup.patch
index 2043083158..2043083158 100644
--- a/package/kernel/mac80211/patches/403-world_regd_fixup.patch
+++ b/package/kernel/mac80211/patches/ath/403-world_regd_fixup.patch
diff --git a/package/kernel/mac80211/patches/404-regd_no_assoc_hints.patch b/package/kernel/mac80211/patches/ath/404-regd_no_assoc_hints.patch
index 00be2ef98d..00be2ef98d 100644
--- a/package/kernel/mac80211/patches/404-regd_no_assoc_hints.patch
+++ b/package/kernel/mac80211/patches/ath/404-regd_no_assoc_hints.patch
diff --git a/package/kernel/mac80211/patches/405-ath_regd_us.patch b/package/kernel/mac80211/patches/ath/405-ath_regd_us.patch
index cc55877809..cc55877809 100644
--- a/package/kernel/mac80211/patches/405-ath_regd_us.patch
+++ b/package/kernel/mac80211/patches/ath/405-ath_regd_us.patch
diff --git a/package/kernel/mac80211/patches/406-ath_relax_default_regd.patch b/package/kernel/mac80211/patches/ath/406-ath_relax_default_regd.patch
index 35b0f2b76e..35b0f2b76e 100644
--- a/package/kernel/mac80211/patches/406-ath_relax_default_regd.patch
+++ b/package/kernel/mac80211/patches/ath/406-ath_relax_default_regd.patch
diff --git a/package/kernel/mac80211/patches/410-ath9k_allow_adhoc_and_ap.patch b/package/kernel/mac80211/patches/ath/410-ath9k_allow_adhoc_and_ap.patch
index 86f96e8e97..86f96e8e97 100644
--- a/package/kernel/mac80211/patches/410-ath9k_allow_adhoc_and_ap.patch
+++ b/package/kernel/mac80211/patches/ath/410-ath9k_allow_adhoc_and_ap.patch
diff --git a/package/kernel/mac80211/patches/411-ath5k_allow_adhoc_and_ap.patch b/package/kernel/mac80211/patches/ath/411-ath5k_allow_adhoc_and_ap.patch
index 2a5ab3d428..2a5ab3d428 100644
--- a/package/kernel/mac80211/patches/411-ath5k_allow_adhoc_and_ap.patch
+++ b/package/kernel/mac80211/patches/ath/411-ath5k_allow_adhoc_and_ap.patch
diff --git a/package/kernel/mac80211/patches/420-ath5k_disable_fast_cc.patch b/package/kernel/mac80211/patches/ath/420-ath5k_disable_fast_cc.patch
index 414f49508f..414f49508f 100644
--- a/package/kernel/mac80211/patches/420-ath5k_disable_fast_cc.patch
+++ b/package/kernel/mac80211/patches/ath/420-ath5k_disable_fast_cc.patch
diff --git a/package/kernel/mac80211/patches/430-add_ath5k_platform.patch b/package/kernel/mac80211/patches/ath/430-add_ath5k_platform.patch
index b213e2a819..b213e2a819 100644
--- a/package/kernel/mac80211/patches/430-add_ath5k_platform.patch
+++ b/package/kernel/mac80211/patches/ath/430-add_ath5k_platform.patch
diff --git a/package/kernel/mac80211/patches/431-add_platform_eeprom_support_to_ath5k.patch b/package/kernel/mac80211/patches/ath/431-add_platform_eeprom_support_to_ath5k.patch
index cdc9315cd6..cdc9315cd6 100644
--- a/package/kernel/mac80211/patches/431-add_platform_eeprom_support_to_ath5k.patch
+++ b/package/kernel/mac80211/patches/ath/431-add_platform_eeprom_support_to_ath5k.patch
diff --git a/package/kernel/mac80211/patches/432-ath5k_add_pciids.patch b/package/kernel/mac80211/patches/ath/432-ath5k_add_pciids.patch
index d82f8001d4..d82f8001d4 100644
--- a/package/kernel/mac80211/patches/432-ath5k_add_pciids.patch
+++ b/package/kernel/mac80211/patches/ath/432-ath5k_add_pciids.patch
diff --git a/package/kernel/mac80211/patches/440-ath5k_channel_bw_debugfs.patch b/package/kernel/mac80211/patches/ath/440-ath5k_channel_bw_debugfs.patch
index 3ae01a5c35..20d67d2762 100644
--- a/package/kernel/mac80211/patches/440-ath5k_channel_bw_debugfs.patch
+++ b/package/kernel/mac80211/patches/ath/440-ath5k_channel_bw_debugfs.patch
@@ -9,8 +9,10 @@ Other devices will need to be added to the switch in write_file_bwmode
drivers/net/wireless/ath/ath5k/debug.c | 86 ++++++++++++++++++++++++++++++++
1 files changed, 86 insertions(+), 0 deletions(-)
---- a/drivers/net/wireless/ath/ath5k/debug.c
-+++ b/drivers/net/wireless/ath/ath5k/debug.c
+Index: backports-v4.18-rc7/drivers/net/wireless/ath/ath5k/debug.c
+===================================================================
+--- backports-v4.18-rc7.orig/drivers/net/wireless/ath/ath5k/debug.c
++++ backports-v4.18-rc7/drivers/net/wireless/ath/ath5k/debug.c
@@ -822,6 +822,97 @@ static const struct file_operations fops
.llseek = default_llseek,
};
@@ -109,18 +111,19 @@ drivers/net/wireless/ath/ath5k/debug.c | 86 ++++++++++++++++++++++++++++++++
/* debugfs: queues etc */
-@@ -1012,6 +1103,9 @@ ath5k_debug_init_device(struct ath5k_hw
- debugfs_create_file("beacon", S_IWUSR | S_IRUSR, phydir, ah,
- &fops_beacon);
-
+@@ -1016,6 +1107,8 @@ ath5k_debug_init_device(struct ath5k_hw
+ debugfs_create_file("queue", 0600, phydir, ah, &fops_queue);
+ debugfs_create_bool("32khz_clock", 0600, phydir,
+ &ah->ah_use_32khz_clock);
+ debugfs_create_file("bwmode", S_IWUSR | S_IRUSR, phydir, ah,
+ &fops_bwmode);
-+
- debugfs_create_file("reset", S_IWUSR, phydir, ah, &fops_reset);
+ }
- debugfs_create_file("antenna", S_IWUSR | S_IRUSR, phydir, ah,
---- a/drivers/net/wireless/ath/ath5k/ath5k.h
-+++ b/drivers/net/wireless/ath/ath5k/ath5k.h
+ /* functions used in other places */
+Index: backports-v4.18-rc7/drivers/net/wireless/ath/ath5k/ath5k.h
+===================================================================
+--- backports-v4.18-rc7.orig/drivers/net/wireless/ath/ath5k/ath5k.h
++++ backports-v4.18-rc7/drivers/net/wireless/ath/ath5k/ath5k.h
@@ -1372,6 +1372,7 @@ struct ath5k_hw {
u8 ah_coverage_class;
bool ah_ack_bitrate_high;
@@ -129,8 +132,10 @@ drivers/net/wireless/ath/ath5k/debug.c | 86 ++++++++++++++++++++++++++++++++
bool ah_short_slot;
/* Antenna Control */
---- a/drivers/net/wireless/ath/ath5k/base.c
-+++ b/drivers/net/wireless/ath/ath5k/base.c
+Index: backports-v4.18-rc7/drivers/net/wireless/ath/ath5k/base.c
+===================================================================
+--- backports-v4.18-rc7.orig/drivers/net/wireless/ath/ath5k/base.c
++++ backports-v4.18-rc7/drivers/net/wireless/ath/ath5k/base.c
@@ -466,6 +466,9 @@ ath5k_chan_set(struct ath5k_hw *ah, stru
return -EINVAL;
}
diff --git a/package/kernel/mac80211/patches/500-ath9k_eeprom_debugfs.patch b/package/kernel/mac80211/patches/ath/500-ath9k_eeprom_debugfs.patch
index b6dc45cd96..b6dc45cd96 100644
--- a/package/kernel/mac80211/patches/500-ath9k_eeprom_debugfs.patch
+++ b/package/kernel/mac80211/patches/ath/500-ath9k_eeprom_debugfs.patch
diff --git a/package/kernel/mac80211/patches/501-ath9k_ahb_init.patch b/package/kernel/mac80211/patches/ath/501-ath9k_ahb_init.patch
index 53225dbc36..9c194b07b8 100644
--- a/package/kernel/mac80211/patches/501-ath9k_ahb_init.patch
+++ b/package/kernel/mac80211/patches/ath/501-ath9k_ahb_init.patch
@@ -1,6 +1,8 @@
---- a/drivers/net/wireless/ath/ath9k/init.c
-+++ b/drivers/net/wireless/ath/ath9k/init.c
-@@ -1088,23 +1088,23 @@ static int __init ath9k_init(void)
+Index: backports-v4.18-rc7/drivers/net/wireless/ath/ath9k/init.c
+===================================================================
+--- backports-v4.18-rc7.orig/drivers/net/wireless/ath/ath9k/init.c
++++ backports-v4.18-rc7/drivers/net/wireless/ath/ath9k/init.c
+@@ -1144,25 +1144,25 @@ static int __init ath9k_init(void)
{
int error;
@@ -21,6 +23,8 @@
+ goto err_ahb_exit;
}
+ dmi_check_system(ath9k_quirks);
+
return 0;
- err_pci_exit:
diff --git a/package/kernel/mac80211/patches/510-ath9k_intr_mitigation_tweak.patch b/package/kernel/mac80211/patches/ath/510-ath9k_intr_mitigation_tweak.patch
index d2a3b96570..d2a3b96570 100644
--- a/package/kernel/mac80211/patches/510-ath9k_intr_mitigation_tweak.patch
+++ b/package/kernel/mac80211/patches/ath/510-ath9k_intr_mitigation_tweak.patch
diff --git a/package/kernel/mac80211/patches/511-ath9k_reduce_rxbuf.patch b/package/kernel/mac80211/patches/ath/511-ath9k_reduce_rxbuf.patch
index 15b8d7b86b..15b8d7b86b 100644
--- a/package/kernel/mac80211/patches/511-ath9k_reduce_rxbuf.patch
+++ b/package/kernel/mac80211/patches/ath/511-ath9k_reduce_rxbuf.patch
diff --git a/package/kernel/mac80211/patches/512-ath9k_channelbw_debugfs.patch b/package/kernel/mac80211/patches/ath/512-ath9k_channelbw_debugfs.patch
index 2ebb73d689..2ebb73d689 100644
--- a/package/kernel/mac80211/patches/512-ath9k_channelbw_debugfs.patch
+++ b/package/kernel/mac80211/patches/ath/512-ath9k_channelbw_debugfs.patch
diff --git a/package/kernel/mac80211/patches/513-ath9k_add_pci_ids.patch b/package/kernel/mac80211/patches/ath/513-ath9k_add_pci_ids.patch
index fdeaed05e8..fdeaed05e8 100644
--- a/package/kernel/mac80211/patches/513-ath9k_add_pci_ids.patch
+++ b/package/kernel/mac80211/patches/ath/513-ath9k_add_pci_ids.patch
diff --git a/package/kernel/mac80211/patches/530-ath9k_extra_leds.patch b/package/kernel/mac80211/patches/ath/530-ath9k_extra_leds.patch
index 8ea2f79a20..8ea2f79a20 100644
--- a/package/kernel/mac80211/patches/530-ath9k_extra_leds.patch
+++ b/package/kernel/mac80211/patches/ath/530-ath9k_extra_leds.patch
diff --git a/package/kernel/mac80211/patches/531-ath9k_extra_platform_leds.patch b/package/kernel/mac80211/patches/ath/531-ath9k_extra_platform_leds.patch
index 8ed7ad8a09..8ed7ad8a09 100644
--- a/package/kernel/mac80211/patches/531-ath9k_extra_platform_leds.patch
+++ b/package/kernel/mac80211/patches/ath/531-ath9k_extra_platform_leds.patch
diff --git a/package/kernel/mac80211/patches/540-ath9k_reduce_ani_interval.patch b/package/kernel/mac80211/patches/ath/540-ath9k_reduce_ani_interval.patch
index e899903478..e899903478 100644
--- a/package/kernel/mac80211/patches/540-ath9k_reduce_ani_interval.patch
+++ b/package/kernel/mac80211/patches/ath/540-ath9k_reduce_ani_interval.patch
diff --git a/package/kernel/mac80211/patches/542-ath9k_debugfs_diag.patch b/package/kernel/mac80211/patches/ath/542-ath9k_debugfs_diag.patch
index 6dd03fd28a..6dd03fd28a 100644
--- a/package/kernel/mac80211/patches/542-ath9k_debugfs_diag.patch
+++ b/package/kernel/mac80211/patches/ath/542-ath9k_debugfs_diag.patch
diff --git a/package/kernel/mac80211/patches/543-ath9k_entropy_from_adc.patch b/package/kernel/mac80211/patches/ath/543-ath9k_entropy_from_adc.patch
index f9d3251c22..f9d3251c22 100644
--- a/package/kernel/mac80211/patches/543-ath9k_entropy_from_adc.patch
+++ b/package/kernel/mac80211/patches/ath/543-ath9k_entropy_from_adc.patch
diff --git a/package/kernel/mac80211/patches/544-ath9k-ar933x-usb-hang-workaround.patch b/package/kernel/mac80211/patches/ath/544-ath9k-ar933x-usb-hang-workaround.patch
index 680bb6d590..680bb6d590 100644
--- a/package/kernel/mac80211/patches/544-ath9k-ar933x-usb-hang-workaround.patch
+++ b/package/kernel/mac80211/patches/ath/544-ath9k-ar933x-usb-hang-workaround.patch
diff --git a/package/kernel/mac80211/patches/545-ath9k_ani_ws_detect.patch b/package/kernel/mac80211/patches/ath/545-ath9k_ani_ws_detect.patch
index 22a2308a0b..22a2308a0b 100644
--- a/package/kernel/mac80211/patches/545-ath9k_ani_ws_detect.patch
+++ b/package/kernel/mac80211/patches/ath/545-ath9k_ani_ws_detect.patch
diff --git a/package/kernel/mac80211/patches/547-ath9k_led_defstate_fix.patch b/package/kernel/mac80211/patches/ath/547-ath9k_led_defstate_fix.patch
index 5d84cf0c42..5d84cf0c42 100644
--- a/package/kernel/mac80211/patches/547-ath9k_led_defstate_fix.patch
+++ b/package/kernel/mac80211/patches/ath/547-ath9k_led_defstate_fix.patch
diff --git a/package/kernel/mac80211/patches/548-ath9k_enable_gpio_chip.patch b/package/kernel/mac80211/patches/ath/548-ath9k_enable_gpio_chip.patch
index 0b76d330c6..0b76d330c6 100644
--- a/package/kernel/mac80211/patches/548-ath9k_enable_gpio_chip.patch
+++ b/package/kernel/mac80211/patches/ath/548-ath9k_enable_gpio_chip.patch
diff --git a/package/kernel/mac80211/patches/549-ath9k_enable_gpio_buttons.patch b/package/kernel/mac80211/patches/ath/549-ath9k_enable_gpio_buttons.patch
index e7282ab6b1..e7282ab6b1 100644
--- a/package/kernel/mac80211/patches/549-ath9k_enable_gpio_buttons.patch
+++ b/package/kernel/mac80211/patches/ath/549-ath9k_enable_gpio_buttons.patch
diff --git a/package/kernel/mac80211/patches/550-ath9k-disable-bands-via-dt.patch b/package/kernel/mac80211/patches/ath/550-ath9k-disable-bands-via-dt.patch
index 55f040f170..55f040f170 100644
--- a/package/kernel/mac80211/patches/550-ath9k-disable-bands-via-dt.patch
+++ b/package/kernel/mac80211/patches/ath/550-ath9k-disable-bands-via-dt.patch
diff --git a/package/kernel/mac80211/patches/551-ath9k_ubnt_uap_plus_hsr.patch b/package/kernel/mac80211/patches/ath/551-ath9k_ubnt_uap_plus_hsr.patch
index 82b8109e06..82b8109e06 100644
--- a/package/kernel/mac80211/patches/551-ath9k_ubnt_uap_plus_hsr.patch
+++ b/package/kernel/mac80211/patches/ath/551-ath9k_ubnt_uap_plus_hsr.patch
diff --git a/package/kernel/mac80211/patches/552-ahb_of.patch b/package/kernel/mac80211/patches/ath/552-ahb_of.patch
index 8c20b00dd4..8c20b00dd4 100644
--- a/package/kernel/mac80211/patches/552-ahb_of.patch
+++ b/package/kernel/mac80211/patches/ath/552-ahb_of.patch
diff --git a/package/kernel/mac80211/patches/921-ath10k_init_devices_synchronously.patch b/package/kernel/mac80211/patches/ath/921-ath10k_init_devices_synchronously.patch
index fbf33a213c..fbf33a213c 100644
--- a/package/kernel/mac80211/patches/921-ath10k_init_devices_synchronously.patch
+++ b/package/kernel/mac80211/patches/ath/921-ath10k_init_devices_synchronously.patch
diff --git a/package/kernel/mac80211/patches/930-ath10k_add_tpt_led_trigger.patch b/package/kernel/mac80211/patches/ath/930-ath10k_add_tpt_led_trigger.patch
index 9df4696913..9df4696913 100644
--- a/package/kernel/mac80211/patches/930-ath10k_add_tpt_led_trigger.patch
+++ b/package/kernel/mac80211/patches/ath/930-ath10k_add_tpt_led_trigger.patch
diff --git a/package/kernel/mac80211/patches/936-ath10k-fix-otp-failure-result.patch b/package/kernel/mac80211/patches/ath/936-ath10k-fix-otp-failure-result.patch
index e1aaefd035..e1aaefd035 100644
--- a/package/kernel/mac80211/patches/936-ath10k-fix-otp-failure-result.patch
+++ b/package/kernel/mac80211/patches/ath/936-ath10k-fix-otp-failure-result.patch
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
new file mode 100644
index 0000000000..5f4d34896d
--- /dev/null
+++ b/package/kernel/mac80211/patches/ath/960-0010-ath10k-limit-htt-rx-ring-size.patch
@@ -0,0 +1,13 @@
+Index: backports-v4.18-rc7/drivers/net/wireless/ath/ath10k/htt.h
+===================================================================
+--- backports-v4.18-rc7.orig/drivers/net/wireless/ath/ath10k/htt.h
++++ backports-v4.18-rc7/drivers/net/wireless/ath/ath10k/htt.h
+@@ -238,7 +238,7 @@ enum htt_rx_ring_flags {
+ };
+
+ #define HTT_RX_RING_SIZE_MIN 128
+-#define HTT_RX_RING_SIZE_MAX 2048
++#define HTT_RX_RING_SIZE_MAX 512
+ #define HTT_RX_RING_SIZE HTT_RX_RING_SIZE_MAX
+ #define HTT_RX_RING_FILL_LEVEL (((HTT_RX_RING_SIZE) / 2) - 1)
+ #define HTT_RX_RING_FILL_LEVEL_DUAL_MAC (HTT_RX_RING_SIZE - 1)
diff --git a/package/kernel/mac80211/patches/960-0011-ath10k-limit-pci-buffer-size.patch b/package/kernel/mac80211/patches/ath/960-0011-ath10k-limit-pci-buffer-size.patch
index a101282d07..a101282d07 100644
--- a/package/kernel/mac80211/patches/960-0011-ath10k-limit-pci-buffer-size.patch
+++ b/package/kernel/mac80211/patches/ath/960-0011-ath10k-limit-pci-buffer-size.patch
diff --git a/package/kernel/mac80211/patches/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 a7eb0a0d84..a7eb0a0d84 100644
--- a/package/kernel/mac80211/patches/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
diff --git a/package/kernel/mac80211/patches/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 c5c8b1063a..c5c8b1063a 100644
--- a/package/kernel/mac80211/patches/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
diff --git a/package/kernel/mac80211/patches/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 009cbfa884..e59d45d508 100644
--- a/package/kernel/mac80211/patches/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
@@ -83,9 +83,11 @@ v13:
12 files changed, 314 insertions(+), 1 deletion(-)
create mode 100644 drivers/net/wireless/ath/ath10k/leds.c
create mode 100644 drivers/net/wireless/ath/ath10k/leds.h
---- a/drivers/net/wireless/ath/ath10k/Kconfig
-+++ b/drivers/net/wireless/ath/ath10k/Kconfig
-@@ -56,6 +56,16 @@ config ATH10K_DEBUGFS
+Index: backports-v4.18-rc7/drivers/net/wireless/ath/ath10k/Kconfig
+===================================================================
+--- backports-v4.18-rc7.orig/drivers/net/wireless/ath/ath10k/Kconfig
++++ backports-v4.18-rc7/drivers/net/wireless/ath/ath10k/Kconfig
+@@ -69,6 +69,16 @@ config ATH10K_DEBUGFS
If unsure, say Y to make it easier to debug problems.
@@ -102,19 +104,23 @@ v13:
config ATH10K_SPECTRAL
bool "Atheros ath10k spectral scan support"
depends on ATH10K_DEBUGFS
---- a/drivers/net/wireless/ath/ath10k/Makefile
-+++ b/drivers/net/wireless/ath/ath10k/Makefile
-@@ -18,6 +18,7 @@ ath10k_core-$(CPTCFG_ATH10K_SPECTRAL) +=
+Index: backports-v4.18-rc7/drivers/net/wireless/ath/ath10k/Makefile
+===================================================================
+--- backports-v4.18-rc7.orig/drivers/net/wireless/ath/ath10k/Makefile
++++ backports-v4.18-rc7/drivers/net/wireless/ath/ath10k/Makefile
+@@ -19,6 +19,7 @@ ath10k_core-$(CPTCFG_ATH10K_SPECTRAL) +=
ath10k_core-$(CPTCFG_NL80211_TESTMODE) += testmode.o
ath10k_core-$(CPTCFG_ATH10K_TRACING) += trace.o
ath10k_core-$(CPTCFG_ATH10K_THERMAL) += thermal.o
+ath10k_core-$(CPTCFG_ATH10K_LEDS) += leds.o
ath10k_core-$(CPTCFG_MAC80211_DEBUGFS) += debugfs_sta.o
ath10k_core-$(CONFIG_PM) += wow.o
-
---- a/local-symbols
-+++ b/local-symbols
-@@ -144,6 +144,7 @@ ATH10K_DEBUG=
+ ath10k_core-$(CONFIG_DEV_COREDUMP) += coredump.o
+Index: backports-v4.18-rc7/local-symbols
+===================================================================
+--- backports-v4.18-rc7.orig/local-symbols
++++ backports-v4.18-rc7/local-symbols
+@@ -147,6 +147,7 @@ ATH10K_DEBUG=
ATH10K_DEBUGFS=
ATH10K_SPECTRAL=
ATH10K_THERMAL=
@@ -122,17 +128,19 @@ v13:
ATH10K_TRACING=
ATH10K_DFS_CERTIFIED=
WCN36XX=
---- a/drivers/net/wireless/ath/ath10k/core.c
-+++ b/drivers/net/wireless/ath/ath10k/core.c
-@@ -32,6 +32,7 @@
- #include "htt.h"
+Index: backports-v4.18-rc7/drivers/net/wireless/ath/ath10k/core.c
+===================================================================
+--- backports-v4.18-rc7.orig/drivers/net/wireless/ath/ath10k/core.c
++++ backports-v4.18-rc7/drivers/net/wireless/ath/ath10k/core.c
+@@ -34,6 +34,7 @@
#include "testmode.h"
#include "wmi-ops.h"
+ #include "coredump.h"
+#include "leds.h"
unsigned int ath10k_debug_mask;
static unsigned int ath10k_cryptmode_param;
-@@ -56,6 +57,7 @@ static const struct ath10k_hw_params ath
+@@ -66,6 +67,7 @@ static const struct ath10k_hw_params ath
.id = QCA988X_HW_2_0_VERSION,
.dev_id = QCA988X_2_0_DEVICE_ID,
.name = "qca988x hw2.0",
@@ -140,7 +148,7 @@ v13:
.patch_load_addr = QCA988X_HW_2_0_PATCH_LOAD_ADDR,
.uart_pin = 7,
.cc_wraparound_type = ATH10K_HW_CC_WRAP_SHIFTED_ALL,
-@@ -81,6 +83,7 @@ static const struct ath10k_hw_params ath
+@@ -129,6 +131,7 @@ static const struct ath10k_hw_params ath
.id = QCA9887_HW_1_0_VERSION,
.dev_id = QCA9887_1_0_DEVICE_ID,
.name = "qca9887 hw1.0",
@@ -148,7 +156,7 @@ v13:
.patch_load_addr = QCA9887_HW_1_0_PATCH_LOAD_ADDR,
.uart_pin = 7,
.cc_wraparound_type = ATH10K_HW_CC_WRAP_SHIFTED_ALL,
-@@ -206,6 +209,7 @@ static const struct ath10k_hw_params ath
+@@ -288,6 +291,7 @@ static const struct ath10k_hw_params ath
.id = QCA99X0_HW_2_0_DEV_VERSION,
.dev_id = QCA99X0_2_0_DEVICE_ID,
.name = "qca99x0 hw2.0",
@@ -156,7 +164,7 @@ v13:
.patch_load_addr = QCA99X0_HW_2_0_PATCH_LOAD_ADDR,
.uart_pin = 7,
.otp_exe_param = 0x00000700,
-@@ -236,6 +240,7 @@ static const struct ath10k_hw_params ath
+@@ -325,6 +329,7 @@ static const struct ath10k_hw_params ath
.id = QCA9984_HW_1_0_DEV_VERSION,
.dev_id = QCA9984_1_0_DEVICE_ID,
.name = "qca9984/qca9994 hw1.0",
@@ -164,7 +172,7 @@ v13:
.patch_load_addr = QCA9984_HW_1_0_PATCH_LOAD_ADDR,
.uart_pin = 7,
.cc_wraparound_type = ATH10K_HW_CC_WRAP_SHIFTED_EACH,
-@@ -271,6 +276,7 @@ static const struct ath10k_hw_params ath
+@@ -367,6 +372,7 @@ static const struct ath10k_hw_params ath
.id = QCA9888_HW_2_0_DEV_VERSION,
.dev_id = QCA9888_2_0_DEVICE_ID,
.name = "qca9888 hw2.0",
@@ -172,7 +180,7 @@ v13:
.patch_load_addr = QCA9888_HW_2_0_PATCH_LOAD_ADDR,
.uart_pin = 7,
.cc_wraparound_type = ATH10K_HW_CC_WRAP_SHIFTED_EACH,
-@@ -2267,6 +2273,10 @@ int ath10k_core_start(struct ath10k *ar,
+@@ -2428,6 +2434,10 @@ int ath10k_core_start(struct ath10k *ar,
if (status)
goto err_hif_stop;
@@ -183,7 +191,7 @@ v13:
return 0;
err_hif_stop:
-@@ -2484,9 +2494,18 @@ static void ath10k_core_register_work(st
+@@ -2682,9 +2692,18 @@ static void ath10k_core_register_work(st
goto err_spectral_destroy;
}
@@ -202,7 +210,7 @@ v13:
err_spectral_destroy:
ath10k_spectral_destroy(ar);
err_debug_destroy:
-@@ -2528,6 +2547,8 @@ void ath10k_core_unregister(struct ath10
+@@ -2728,6 +2747,8 @@ void ath10k_core_unregister(struct ath10
if (!test_bit(ATH10K_FLAG_CORE_REGISTERED, &ar->dev_flags))
return;
@@ -211,9 +219,11 @@ v13:
ath10k_thermal_unregister(ar);
/* Stop spectral before unregistering from mac80211 to remove the
* 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
-@@ -24,6 +24,7 @@
+Index: backports-v4.18-rc7/drivers/net/wireless/ath/ath10k/core.h
+===================================================================
+--- backports-v4.18-rc7.orig/drivers/net/wireless/ath/ath10k/core.h
++++ backports-v4.18-rc7/drivers/net/wireless/ath/ath10k/core.h
+@@ -25,6 +25,7 @@
#include <linux/pci.h>
#include <linux/uuid.h>
#include <linux/time.h>
@@ -221,7 +231,7 @@ v13:
#include "htt.h"
#include "htc.h"
-@@ -829,7 +830,6 @@ struct ath10k {
+@@ -902,7 +903,6 @@ struct ath10k {
u32 low_5ghz_chan;
u32 high_5ghz_chan;
bool ani_enabled;
@@ -229,7 +239,7 @@ v13:
bool p2p;
struct {
-@@ -1012,6 +1012,13 @@ struct ath10k {
+@@ -1093,6 +1093,13 @@ struct ath10k {
} testmode;
struct {
@@ -243,9 +253,11 @@ v13:
/* protected by data_lock */
u32 fw_crash_counter;
u32 fw_warm_reset_counter;
---- a/drivers/net/wireless/ath/ath10k/hw.h
-+++ b/drivers/net/wireless/ath/ath10k/hw.h
-@@ -490,6 +490,7 @@ struct ath10k_hw_params {
+Index: backports-v4.18-rc7/drivers/net/wireless/ath/ath10k/hw.h
+===================================================================
+--- backports-v4.18-rc7.orig/drivers/net/wireless/ath/ath10k/hw.h
++++ backports-v4.18-rc7/drivers/net/wireless/ath/ath10k/hw.h
+@@ -504,6 +504,7 @@ struct ath10k_hw_params {
const char *name;
u32 patch_load_addr;
int uart_pin;
@@ -253,8 +265,10 @@ v13:
u32 otp_exe_param;
/* Type of hw cycle counter wraparound logic, for more info
+Index: backports-v4.18-rc7/drivers/net/wireless/ath/ath10k/leds.c
+===================================================================
--- /dev/null
-+++ b/drivers/net/wireless/ath/ath10k/leds.c
++++ backports-v4.18-rc7/drivers/net/wireless/ath/ath10k/leds.c
@@ -0,0 +1,103 @@
+/*
+ * Copyright (c) 2005-2011 Atheros Communications Inc.
@@ -359,8 +373,10 @@ v13:
+ led_classdev_unregister(&ar->leds.cdev);
+}
+
+Index: backports-v4.18-rc7/drivers/net/wireless/ath/ath10k/leds.h
+===================================================================
--- /dev/null
-+++ b/drivers/net/wireless/ath/ath10k/leds.h
++++ backports-v4.18-rc7/drivers/net/wireless/ath/ath10k/leds.h
@@ -0,0 +1,41 @@
+/*
+ * Copyright (c) 2018, The Linux Foundation. All rights reserved.
@@ -403,9 +419,11 @@ v13:
+
+#endif
+#endif /* _LEDS_H_ */
---- a/drivers/net/wireless/ath/ath10k/mac.c
-+++ b/drivers/net/wireless/ath/ath10k/mac.c
-@@ -32,6 +32,7 @@
+Index: backports-v4.18-rc7/drivers/net/wireless/ath/ath10k/mac.c
+===================================================================
+--- backports-v4.18-rc7.orig/drivers/net/wireless/ath/ath10k/mac.c
++++ backports-v4.18-rc7/drivers/net/wireless/ath/ath10k/mac.c
+@@ -33,6 +33,7 @@
#include "wmi-tlv.h"
#include "wmi-ops.h"
#include "wow.h"
@@ -413,9 +431,11 @@ v13:
/*********/
/* Rates */
---- a/drivers/net/wireless/ath/ath10k/wmi-ops.h
-+++ b/drivers/net/wireless/ath/ath10k/wmi-ops.h
-@@ -204,7 +204,10 @@ struct wmi_ops {
+Index: backports-v4.18-rc7/drivers/net/wireless/ath/ath10k/wmi-ops.h
+===================================================================
+--- backports-v4.18-rc7.orig/drivers/net/wireless/ath/ath10k/wmi-ops.h
++++ backports-v4.18-rc7/drivers/net/wireless/ath/ath10k/wmi-ops.h
+@@ -214,7 +214,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);
@@ -426,7 +446,7 @@ v13:
};
int ath10k_wmi_cmd_send(struct ath10k *ar, struct sk_buff *skb, u32 cmd_id);
-@@ -969,6 +972,35 @@ ath10k_wmi_force_fw_hang(struct ath10k *
+@@ -1042,6 +1045,35 @@ ath10k_wmi_force_fw_hang(struct ath10k *
return ath10k_wmi_cmd_send(ar, skb, ar->wmi.cmd->force_fw_hang_cmdid);
}
@@ -462,9 +482,11 @@ v13:
static inline int
ath10k_wmi_dbglog_cfg(struct ath10k *ar, u64 module_enable, u32 log_level)
{
---- a/drivers/net/wireless/ath/ath10k/wmi-tlv.c
-+++ b/drivers/net/wireless/ath/ath10k/wmi-tlv.c
-@@ -3652,6 +3652,8 @@ static const struct wmi_ops wmi_tlv_ops
+Index: backports-v4.18-rc7/drivers/net/wireless/ath/ath10k/wmi-tlv.c
+===================================================================
+--- backports-v4.18-rc7.orig/drivers/net/wireless/ath/ath10k/wmi-tlv.c
++++ backports-v4.18-rc7/drivers/net/wireless/ath/ath10k/wmi-tlv.c
+@@ -3909,6 +3909,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,
@@ -473,9 +495,11 @@ 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
-@@ -7051,6 +7051,49 @@ ath10k_wmi_op_gen_peer_set_param(struct
+Index: backports-v4.18-rc7/drivers/net/wireless/ath/ath10k/wmi.c
+===================================================================
+--- backports-v4.18-rc7.orig/drivers/net/wireless/ath/ath10k/wmi.c
++++ backports-v4.18-rc7/drivers/net/wireless/ath/ath10k/wmi.c
+@@ -7115,6 +7115,49 @@ ath10k_wmi_op_gen_peer_set_param(struct
return skb;
}
@@ -525,7 +549,7 @@ v13:
static struct sk_buff *
ath10k_wmi_op_gen_set_psmode(struct ath10k *ar, u32 vdev_id,
enum wmi_sta_ps_mode psmode)
-@@ -8596,6 +8639,9 @@ static const struct wmi_ops wmi_ops = {
+@@ -8726,6 +8769,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 +559,7 @@ v13:
/* .gen_bcn_tmpl not implemented */
/* .gen_prb_tmpl not implemented */
/* .gen_p2p_go_bcn_ie not implemented */
-@@ -8666,6 +8712,8 @@ static const struct wmi_ops wmi_10_1_ops
+@@ -8796,6 +8842,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 +568,7 @@ v13:
/* .gen_bcn_tmpl not implemented */
/* .gen_prb_tmpl not implemented */
/* .gen_p2p_go_bcn_ie not implemented */
-@@ -8737,6 +8785,8 @@ static const struct wmi_ops wmi_10_2_ops
+@@ -8867,6 +8915,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,7 +577,7 @@ v13:
/* .gen_pdev_enable_adaptive_cca not implemented */
};
-@@ -8807,6 +8857,8 @@ static const struct wmi_ops wmi_10_2_4_o
+@@ -8937,6 +8987,8 @@ static const struct wmi_ops wmi_10_2_4_o
.gen_pdev_enable_adaptive_cca =
ath10k_wmi_op_gen_pdev_enable_adaptive_cca,
.get_vdev_subtype = ath10k_wmi_10_2_4_op_get_vdev_subtype,
@@ -562,7 +586,7 @@ v13:
/* .gen_bcn_tmpl not implemented */
/* .gen_prb_tmpl not implemented */
/* .gen_p2p_go_bcn_ie not implemented */
-@@ -8886,6 +8938,8 @@ static const struct wmi_ops wmi_10_4_ops
+@@ -9016,6 +9068,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,
@@ -571,9 +595,11 @@ v13:
};
int ath10k_wmi_attach(struct ath10k *ar)
---- a/drivers/net/wireless/ath/ath10k/wmi.h
-+++ b/drivers/net/wireless/ath/ath10k/wmi.h
-@@ -2930,6 +2930,41 @@ enum wmi_10_4_feature_mask {
+Index: backports-v4.18-rc7/drivers/net/wireless/ath/ath10k/wmi.h
+===================================================================
+--- backports-v4.18-rc7.orig/drivers/net/wireless/ath/ath10k/wmi.h
++++ backports-v4.18-rc7/drivers/net/wireless/ath/ath10k/wmi.h
+@@ -2941,6 +2941,41 @@ enum wmi_10_4_feature_mask {
};
diff --git a/package/kernel/mac80211/patches/975-ath10k-use-tpt-trigger-by-default.patch b/package/kernel/mac80211/patches/ath/975-ath10k-use-tpt-trigger-by-default.patch
index 80db9ec437..80db9ec437 100644
--- a/package/kernel/mac80211/patches/975-ath10k-use-tpt-trigger-by-default.patch
+++ b/package/kernel/mac80211/patches/ath/975-ath10k-use-tpt-trigger-by-default.patch
diff --git a/package/kernel/mac80211/patches/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
index ea57d11144..ea57d11144 100644
--- a/package/kernel/mac80211/patches/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
diff --git a/package/kernel/mac80211/patches/040-brcmutil_option.patch b/package/kernel/mac80211/patches/brcm/040-brcmutil_option.patch
index 167332d916..167332d916 100644
--- a/package/kernel/mac80211/patches/040-brcmutil_option.patch
+++ b/package/kernel/mac80211/patches/brcm/040-brcmutil_option.patch
diff --git a/package/kernel/mac80211/patches/810-b43-gpio-mask-module-option.patch b/package/kernel/mac80211/patches/brcm/810-b43-gpio-mask-module-option.patch
index 5ce49d3a07..5ce49d3a07 100644
--- a/package/kernel/mac80211/patches/810-b43-gpio-mask-module-option.patch
+++ b/package/kernel/mac80211/patches/brcm/810-b43-gpio-mask-module-option.patch
diff --git a/package/kernel/mac80211/patches/811-b43_no_pio.patch b/package/kernel/mac80211/patches/brcm/811-b43_no_pio.patch
index d23387c8cd..d23387c8cd 100644
--- a/package/kernel/mac80211/patches/811-b43_no_pio.patch
+++ b/package/kernel/mac80211/patches/brcm/811-b43_no_pio.patch
diff --git a/package/kernel/mac80211/patches/812-b43-add-antenna-control.patch b/package/kernel/mac80211/patches/brcm/812-b43-add-antenna-control.patch
index 932c83b48e..932c83b48e 100644
--- a/package/kernel/mac80211/patches/812-b43-add-antenna-control.patch
+++ b/package/kernel/mac80211/patches/brcm/812-b43-add-antenna-control.patch
diff --git a/package/kernel/mac80211/patches/813-b43-reduce-number-of-RX-slots.patch b/package/kernel/mac80211/patches/brcm/813-b43-reduce-number-of-RX-slots.patch
index 5899706896..5899706896 100644
--- a/package/kernel/mac80211/patches/813-b43-reduce-number-of-RX-slots.patch
+++ b/package/kernel/mac80211/patches/brcm/813-b43-reduce-number-of-RX-slots.patch
diff --git a/package/kernel/mac80211/patches/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..03f4524c88 100644
--- a/package/kernel/mac80211/patches/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
diff --git a/package/kernel/mac80211/patches/815-b43-always-take-overlapping-devs.patch b/package/kernel/mac80211/patches/brcm/815-b43-always-take-overlapping-devs.patch
index f07151aa4e..f07151aa4e 100644
--- a/package/kernel/mac80211/patches/815-b43-always-take-overlapping-devs.patch
+++ b/package/kernel/mac80211/patches/brcm/815-b43-always-take-overlapping-devs.patch
diff --git a/package/kernel/mac80211/patches/850-brcmsmac-remove-extra-regulation-restriction.patch b/package/kernel/mac80211/patches/brcm/850-brcmsmac-remove-extra-regulation-restriction.patch
index 3c93386b30..3c93386b30 100644
--- a/package/kernel/mac80211/patches/850-brcmsmac-remove-extra-regulation-restriction.patch
+++ b/package/kernel/mac80211/patches/brcm/850-brcmsmac-remove-extra-regulation-restriction.patch
diff --git a/package/kernel/mac80211/patches/860-brcmfmac-register-wiphy-s-during-module_init.patch b/package/kernel/mac80211/patches/brcm/860-brcmfmac-register-wiphy-s-during-module_init.patch
index e70738322d..e70738322d 100644
--- a/package/kernel/mac80211/patches/860-brcmfmac-register-wiphy-s-during-module_init.patch
+++ b/package/kernel/mac80211/patches/brcm/860-brcmfmac-register-wiphy-s-during-module_init.patch
diff --git a/package/kernel/mac80211/patches/861-brcmfmac-workaround-bug-with-some-inconsistent-BSSes.patch b/package/kernel/mac80211/patches/brcm/861-brcmfmac-workaround-bug-with-some-inconsistent-BSSes.patch
index 1345e85f6d..1345e85f6d 100644
--- a/package/kernel/mac80211/patches/861-brcmfmac-workaround-bug-with-some-inconsistent-BSSes.patch
+++ b/package/kernel/mac80211/patches/brcm/861-brcmfmac-workaround-bug-with-some-inconsistent-BSSes.patch
diff --git a/package/kernel/mac80211/patches/862-brcmfmac-Disable-power-management.patch b/package/kernel/mac80211/patches/brcm/862-brcmfmac-Disable-power-management.patch
index 9b36059079..9b36059079 100644
--- a/package/kernel/mac80211/patches/862-brcmfmac-Disable-power-management.patch
+++ b/package/kernel/mac80211/patches/brcm/862-brcmfmac-Disable-power-management.patch
diff --git a/package/kernel/mac80211/patches/863-brcmfmac-add-in-driver-tables-with-country-codes.patch b/package/kernel/mac80211/patches/brcm/863-brcmfmac-add-in-driver-tables-with-country-codes.patch
index e7551c3a70..e7551c3a70 100644
--- a/package/kernel/mac80211/patches/863-brcmfmac-add-in-driver-tables-with-country-codes.patch
+++ b/package/kernel/mac80211/patches/brcm/863-brcmfmac-add-in-driver-tables-with-country-codes.patch
diff --git a/package/kernel/mac80211/patches/864-brcmfmac-do-not-use-internal-roaming-engine-by-default.patch b/package/kernel/mac80211/patches/brcm/864-brcmfmac-do-not-use-internal-roaming-engine-by-default.patch
index 417b6ec869..05c82d645b 100644
--- a/package/kernel/mac80211/patches/864-brcmfmac-do-not-use-internal-roaming-engine-by-default.patch
+++ b/package/kernel/mac80211/patches/brcm/864-brcmfmac-do-not-use-internal-roaming-engine-by-default.patch
@@ -7,8 +7,10 @@ See: http://projectable.me/optimize-my-pi-wi-fi/
Signed-off-by: Phil Elwell <phil@raspberrypi.org>
---
---- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/common.c
-+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/common.c
+Index: backports-v4.18-rc7/drivers/net/wireless/broadcom/brcm80211/brcmfmac/common.c
+===================================================================
+--- backports-v4.18-rc7.orig/drivers/net/wireless/broadcom/brcm80211/brcmfmac/common.c
++++ backports-v4.18-rc7/drivers/net/wireless/broadcom/brcm80211/brcmfmac/common.c
@@ -70,7 +70,11 @@ static int brcmf_fcmode;
module_param_named(fcmode, brcmf_fcmode, int, 0);
MODULE_PARM_DESC(fcmode, "Mode of firmware signalled flow control");
@@ -18,6 +20,6 @@ Signed-off-by: Phil Elwell <phil@raspberrypi.org>
+#else
static int brcmf_roamoff;
+#endif
- module_param_named(roamoff, brcmf_roamoff, int, S_IRUSR);
+ module_param_named(roamoff, brcmf_roamoff, int, 0400);
MODULE_PARM_DESC(roamoff, "Do not use internal roaming engine");
diff --git a/package/kernel/mac80211/patches/000-fix_kconfig.patch b/package/kernel/mac80211/patches/build/000-fix_kconfig.patch
index 3987aae4f5..3987aae4f5 100644
--- a/package/kernel/mac80211/patches/000-fix_kconfig.patch
+++ b/package/kernel/mac80211/patches/build/000-fix_kconfig.patch
diff --git a/package/kernel/mac80211/patches/001-fix_build.patch b/package/kernel/mac80211/patches/build/001-fix_build.patch
index 9e272e90af..9e272e90af 100644
--- a/package/kernel/mac80211/patches/001-fix_build.patch
+++ b/package/kernel/mac80211/patches/build/001-fix_build.patch
diff --git a/package/kernel/mac80211/patches/002-change_allconfig.patch b/package/kernel/mac80211/patches/build/002-change_allconfig.patch
index a071ae6370..a071ae6370 100644
--- a/package/kernel/mac80211/patches/002-change_allconfig.patch
+++ b/package/kernel/mac80211/patches/build/002-change_allconfig.patch
diff --git a/package/kernel/mac80211/patches/003-remove_bogus_modparams.patch b/package/kernel/mac80211/patches/build/003-remove_bogus_modparams.patch
index 8fa465a7e1..8fa465a7e1 100644
--- a/package/kernel/mac80211/patches/003-remove_bogus_modparams.patch
+++ b/package/kernel/mac80211/patches/build/003-remove_bogus_modparams.patch
diff --git a/package/kernel/mac80211/patches/004-kconfig_backport_fix.patch b/package/kernel/mac80211/patches/build/004-kconfig_backport_fix.patch
index 2c9572ec93..2c9572ec93 100644
--- a/package/kernel/mac80211/patches/004-kconfig_backport_fix.patch
+++ b/package/kernel/mac80211/patches/build/004-kconfig_backport_fix.patch
diff --git a/package/kernel/mac80211/patches/005-revert-devcoredump.patch b/package/kernel/mac80211/patches/build/005-revert-devcoredump.patch
index d485d95586..a62c5d7335 100644
--- a/package/kernel/mac80211/patches/005-revert-devcoredump.patch
+++ b/package/kernel/mac80211/patches/build/005-revert-devcoredump.patch
@@ -1,11 +1,13 @@
---- a/compat/Makefile
-+++ b/compat/Makefile
+Index: backports-v4.18-rc7/compat/Makefile
+===================================================================
+--- backports-v4.18-rc7.orig/compat/Makefile
++++ backports-v4.18-rc7/compat/Makefile
@@ -70,8 +70,6 @@ quiet_cmd_build_OID_registry = GEN $
cmd_build_OID_registry = perl $(src)/build_OID_registry $< $@
compat-$(CPTCFG_BPAUTO_ASN1_DECODER) += lib-asn1_decoder.o
compat-$(CPTCFG_BPAUTO_BUILD_SYSTEM_DATA_VERIFICATION) += lib-oid_registry.o
-skcipher-objs += crypto-skcipher.o
-obj-$(CPTCFG_BPAUTO_CRYPTO_SKCIPHER) += skcipher.o
+ compat-$(CPTCFG_BPAUTO_BUILD_WANT_DEV_COREDUMP) += drivers-base-devcoredump.o
compat-$(CPTCFG_BPAUTO_RHASHTABLE) += lib-rhashtable.o
cordic-objs += lib-cordic.o
- obj-$(CPTCFG_BPAUTO_BUILD_CORDIC) += cordic.o
diff --git a/package/kernel/mac80211/patches/006-fix-genl-multicast.patch b/package/kernel/mac80211/patches/build/006-fix-genl-multicast.patch
index 42fd3e8271..42fd3e8271 100644
--- a/package/kernel/mac80211/patches/006-fix-genl-multicast.patch
+++ b/package/kernel/mac80211/patches/build/006-fix-genl-multicast.patch
diff --git a/package/kernel/mac80211/patches/010-disable_rfkill.patch b/package/kernel/mac80211/patches/build/010-disable_rfkill.patch
index d5253063ce..d5253063ce 100644
--- a/package/kernel/mac80211/patches/010-disable_rfkill.patch
+++ b/package/kernel/mac80211/patches/build/010-disable_rfkill.patch
diff --git a/package/kernel/mac80211/patches/012-kernel_build_check.patch b/package/kernel/mac80211/patches/build/012-kernel_build_check.patch
index d225ba1820..d225ba1820 100644
--- a/package/kernel/mac80211/patches/012-kernel_build_check.patch
+++ b/package/kernel/mac80211/patches/build/012-kernel_build_check.patch
diff --git a/package/kernel/mac80211/patches/050-lib80211_option.patch b/package/kernel/mac80211/patches/build/050-lib80211_option.patch
index 28a0d905b7..28a0d905b7 100644
--- a/package/kernel/mac80211/patches/050-lib80211_option.patch
+++ b/package/kernel/mac80211/patches/build/050-lib80211_option.patch
diff --git a/package/kernel/mac80211/patches/060-no_local_ssb_bcma.patch b/package/kernel/mac80211/patches/build/060-no_local_ssb_bcma.patch
index d897b2b40e..d897b2b40e 100644
--- a/package/kernel/mac80211/patches/060-no_local_ssb_bcma.patch
+++ b/package/kernel/mac80211/patches/build/060-no_local_ssb_bcma.patch
diff --git a/package/kernel/mac80211/patches/700-mwl8k-missing-pci-id-for-WNR854T.patch b/package/kernel/mac80211/patches/mwl/700-mwl8k-missing-pci-id-for-WNR854T.patch
index a901a44ba4..a901a44ba4 100644
--- a/package/kernel/mac80211/patches/700-mwl8k-missing-pci-id-for-WNR854T.patch
+++ b/package/kernel/mac80211/patches/mwl/700-mwl8k-missing-pci-id-for-WNR854T.patch
diff --git a/package/kernel/mac80211/patches/801-libertas-configure-sysfs-links.patch b/package/kernel/mac80211/patches/mwl/801-libertas-configure-sysfs-links.patch
index 885bc246ba..885bc246ba 100644
--- a/package/kernel/mac80211/patches/801-libertas-configure-sysfs-links.patch
+++ b/package/kernel/mac80211/patches/mwl/801-libertas-configure-sysfs-links.patch
diff --git a/package/kernel/mac80211/patches/802-libertas-set-wireless-macaddr.patch b/package/kernel/mac80211/patches/mwl/802-libertas-set-wireless-macaddr.patch
index 089ad2fe78..089ad2fe78 100644
--- a/package/kernel/mac80211/patches/802-libertas-set-wireless-macaddr.patch
+++ b/package/kernel/mac80211/patches/mwl/802-libertas-set-wireless-macaddr.patch
diff --git a/package/kernel/mac80211/patches/940-mwl8k_init_devices_synchronously.patch b/package/kernel/mac80211/patches/mwl/940-mwl8k_init_devices_synchronously.patch
index a958c78b43..a958c78b43 100644
--- a/package/kernel/mac80211/patches/940-mwl8k_init_devices_synchronously.patch
+++ b/package/kernel/mac80211/patches/mwl/940-mwl8k_init_devices_synchronously.patch
diff --git a/package/kernel/mac80211/patches/030-rt2x00_options.patch b/package/kernel/mac80211/patches/rt2x00/030-rt2x00_options.patch
index 9dd348151c..9dd348151c 100644
--- a/package/kernel/mac80211/patches/030-rt2x00_options.patch
+++ b/package/kernel/mac80211/patches/rt2x00/030-rt2x00_options.patch
diff --git a/package/kernel/mac80211/patches/600-01-rt2x00-allow-to-build-rt2800soc-module-for-RT3883.patch b/package/kernel/mac80211/patches/rt2x00/600-01-rt2x00-allow-to-build-rt2800soc-module-for-RT3883.patch
index 699989baa0..699989baa0 100644
--- a/package/kernel/mac80211/patches/600-01-rt2x00-allow-to-build-rt2800soc-module-for-RT3883.patch
+++ b/package/kernel/mac80211/patches/rt2x00/600-01-rt2x00-allow-to-build-rt2800soc-module-for-RT3883.patch
diff --git a/package/kernel/mac80211/patches/600-02-rt2x00-rt2800lib-enable-support-for-RT3883.patch b/package/kernel/mac80211/patches/rt2x00/600-02-rt2x00-rt2800lib-enable-support-for-RT3883.patch
index 5127c5cfe4..5127c5cfe4 100644
--- a/package/kernel/mac80211/patches/600-02-rt2x00-rt2800lib-enable-support-for-RT3883.patch
+++ b/package/kernel/mac80211/patches/rt2x00/600-02-rt2x00-rt2800lib-enable-support-for-RT3883.patch
diff --git a/package/kernel/mac80211/patches/600-03-rt2x00-rt2800lib-add-rf_vals-for-RF3853.patch b/package/kernel/mac80211/patches/rt2x00/600-03-rt2x00-rt2800lib-add-rf_vals-for-RF3853.patch
index 60e57c1bae..60e57c1bae 100644
--- a/package/kernel/mac80211/patches/600-03-rt2x00-rt2800lib-add-rf_vals-for-RF3853.patch
+++ b/package/kernel/mac80211/patches/rt2x00/600-03-rt2x00-rt2800lib-add-rf_vals-for-RF3853.patch
diff --git a/package/kernel/mac80211/patches/600-04-rt2x00-rt2800lib-enable-VCO-calibration-for-RF3853.patch b/package/kernel/mac80211/patches/rt2x00/600-04-rt2x00-rt2800lib-enable-VCO-calibration-for-RF3853.patch
index def2c397fd..def2c397fd 100644
--- a/package/kernel/mac80211/patches/600-04-rt2x00-rt2800lib-enable-VCO-calibration-for-RF3853.patch
+++ b/package/kernel/mac80211/patches/rt2x00/600-04-rt2x00-rt2800lib-enable-VCO-calibration-for-RF3853.patch
diff --git a/package/kernel/mac80211/patches/600-05-rt2x00-rt2800lib-add-channel-configuration-function-.patch b/package/kernel/mac80211/patches/rt2x00/600-05-rt2x00-rt2800lib-add-channel-configuration-function-.patch
index 1d6e312037..1d6e312037 100644
--- a/package/kernel/mac80211/patches/600-05-rt2x00-rt2800lib-add-channel-configuration-function-.patch
+++ b/package/kernel/mac80211/patches/rt2x00/600-05-rt2x00-rt2800lib-add-channel-configuration-function-.patch
diff --git a/package/kernel/mac80211/patches/600-06-rt2x00-rt2800lib-enable-RF3853-support.patch b/package/kernel/mac80211/patches/rt2x00/600-06-rt2x00-rt2800lib-enable-RF3853-support.patch
index 6476dc107b..6476dc107b 100644
--- a/package/kernel/mac80211/patches/600-06-rt2x00-rt2800lib-enable-RF3853-support.patch
+++ b/package/kernel/mac80211/patches/rt2x00/600-06-rt2x00-rt2800lib-enable-RF3853-support.patch
diff --git a/package/kernel/mac80211/patches/600-07-rt2x00-rt2800lib-add-MAC-register-initialization-for.patch b/package/kernel/mac80211/patches/rt2x00/600-07-rt2x00-rt2800lib-add-MAC-register-initialization-for.patch
index 0a931e2026..0a931e2026 100644
--- a/package/kernel/mac80211/patches/600-07-rt2x00-rt2800lib-add-MAC-register-initialization-for.patch
+++ b/package/kernel/mac80211/patches/rt2x00/600-07-rt2x00-rt2800lib-add-MAC-register-initialization-for.patch
diff --git a/package/kernel/mac80211/patches/600-08-rt2x00-rt2800soc-fix-rt2800soc_disable_radio-for-RT3.patch b/package/kernel/mac80211/patches/rt2x00/600-08-rt2x00-rt2800soc-fix-rt2800soc_disable_radio-for-RT3.patch
index d68ad50447..d68ad50447 100644
--- a/package/kernel/mac80211/patches/600-08-rt2x00-rt2800soc-fix-rt2800soc_disable_radio-for-RT3.patch
+++ b/package/kernel/mac80211/patches/rt2x00/600-08-rt2x00-rt2800soc-fix-rt2800soc_disable_radio-for-RT3.patch
diff --git a/package/kernel/mac80211/patches/600-09-rt2x00-rt2800lib-add-BBP-register-initialization-for.patch b/package/kernel/mac80211/patches/rt2x00/600-09-rt2x00-rt2800lib-add-BBP-register-initialization-for.patch
index 99f57bcd33..99f57bcd33 100644
--- a/package/kernel/mac80211/patches/600-09-rt2x00-rt2800lib-add-BBP-register-initialization-for.patch
+++ b/package/kernel/mac80211/patches/rt2x00/600-09-rt2x00-rt2800lib-add-BBP-register-initialization-for.patch
diff --git a/package/kernel/mac80211/patches/600-10-rt2x00-rt2800lib-add-RFCSR-initialization-for-RT3883.patch b/package/kernel/mac80211/patches/rt2x00/600-10-rt2x00-rt2800lib-add-RFCSR-initialization-for-RT3883.patch
index c0f1f5863b..c0f1f5863b 100644
--- a/package/kernel/mac80211/patches/600-10-rt2x00-rt2800lib-add-RFCSR-initialization-for-RT3883.patch
+++ b/package/kernel/mac80211/patches/rt2x00/600-10-rt2x00-rt2800lib-add-RFCSR-initialization-for-RT3883.patch
diff --git a/package/kernel/mac80211/patches/600-11-rt2x00-rt2800lib-use-the-extended-EEPROM-map-for-RT3.patch b/package/kernel/mac80211/patches/rt2x00/600-11-rt2x00-rt2800lib-use-the-extended-EEPROM-map-for-RT3.patch
index e74f399e65..e74f399e65 100644
--- a/package/kernel/mac80211/patches/600-11-rt2x00-rt2800lib-use-the-extended-EEPROM-map-for-RT3.patch
+++ b/package/kernel/mac80211/patches/rt2x00/600-11-rt2x00-rt2800lib-use-the-extended-EEPROM-map-for-RT3.patch
diff --git a/package/kernel/mac80211/patches/600-12-rt2x00-rt2800lib-force-rf-type-to-RF3853-on-RT3883.patch b/package/kernel/mac80211/patches/rt2x00/600-12-rt2x00-rt2800lib-force-rf-type-to-RF3853-on-RT3883.patch
index 2e917c8ebf..2e917c8ebf 100644
--- a/package/kernel/mac80211/patches/600-12-rt2x00-rt2800lib-force-rf-type-to-RF3853-on-RT3883.patch
+++ b/package/kernel/mac80211/patches/rt2x00/600-12-rt2x00-rt2800lib-force-rf-type-to-RF3853-on-RT3883.patch
diff --git a/package/kernel/mac80211/patches/600-13-rt2x00-rt2800lib-add-channel-configuration-code-for-.patch b/package/kernel/mac80211/patches/rt2x00/600-13-rt2x00-rt2800lib-add-channel-configuration-code-for-.patch
index 0bb2d33577..0bb2d33577 100644
--- a/package/kernel/mac80211/patches/600-13-rt2x00-rt2800lib-add-channel-configuration-code-for-.patch
+++ b/package/kernel/mac80211/patches/rt2x00/600-13-rt2x00-rt2800lib-add-channel-configuration-code-for-.patch
diff --git a/package/kernel/mac80211/patches/600-14-rt2x00-rt2800lib-fix-txpower_to_dev-function-for-RT3.patch b/package/kernel/mac80211/patches/rt2x00/600-14-rt2x00-rt2800lib-fix-txpower_to_dev-function-for-RT3.patch
index 56157510eb..56157510eb 100644
--- a/package/kernel/mac80211/patches/600-14-rt2x00-rt2800lib-fix-txpower_to_dev-function-for-RT3.patch
+++ b/package/kernel/mac80211/patches/rt2x00/600-14-rt2x00-rt2800lib-fix-txpower_to_dev-function-for-RT3.patch
diff --git a/package/kernel/mac80211/patches/600-15-rt2x00-rt2800lib-use-correct-txpower-calculation-fun.patch b/package/kernel/mac80211/patches/rt2x00/600-15-rt2x00-rt2800lib-use-correct-txpower-calculation-fun.patch
index c1409bcfa3..c1409bcfa3 100644
--- a/package/kernel/mac80211/patches/600-15-rt2x00-rt2800lib-use-correct-txpower-calculation-fun.patch
+++ b/package/kernel/mac80211/patches/rt2x00/600-15-rt2x00-rt2800lib-use-correct-txpower-calculation-fun.patch
diff --git a/package/kernel/mac80211/patches/600-16-rt2x00-rt2800lib-hardcode-txmixer-gain-values-to-zer.patch b/package/kernel/mac80211/patches/rt2x00/600-16-rt2x00-rt2800lib-hardcode-txmixer-gain-values-to-zer.patch
index a4ccb28518..a4ccb28518 100644
--- a/package/kernel/mac80211/patches/600-16-rt2x00-rt2800lib-hardcode-txmixer-gain-values-to-zer.patch
+++ b/package/kernel/mac80211/patches/rt2x00/600-16-rt2x00-rt2800lib-hardcode-txmixer-gain-values-to-zer.patch
diff --git a/package/kernel/mac80211/patches/600-17-rt2x00-rt2800lib-use-correct-RT-XWI-size-for-RT3883.patch b/package/kernel/mac80211/patches/rt2x00/600-17-rt2x00-rt2800lib-use-correct-RT-XWI-size-for-RT3883.patch
index 197aabd7bc..197aabd7bc 100644
--- a/package/kernel/mac80211/patches/600-17-rt2x00-rt2800lib-use-correct-RT-XWI-size-for-RT3883.patch
+++ b/package/kernel/mac80211/patches/rt2x00/600-17-rt2x00-rt2800lib-use-correct-RT-XWI-size-for-RT3883.patch
diff --git a/package/kernel/mac80211/patches/600-18-rt2x00-rt2800lib-fix-antenna-configuration-for-RT388.patch b/package/kernel/mac80211/patches/rt2x00/600-18-rt2x00-rt2800lib-fix-antenna-configuration-for-RT388.patch
index 24c0ef91b0..24c0ef91b0 100644
--- a/package/kernel/mac80211/patches/600-18-rt2x00-rt2800lib-fix-antenna-configuration-for-RT388.patch
+++ b/package/kernel/mac80211/patches/rt2x00/600-18-rt2x00-rt2800lib-fix-antenna-configuration-for-RT388.patch
diff --git a/package/kernel/mac80211/patches/600-19-rt2x00-rt2800lib-fix-LNA-gain-configuration-for-RT38.patch b/package/kernel/mac80211/patches/rt2x00/600-19-rt2x00-rt2800lib-fix-LNA-gain-configuration-for-RT38.patch
index 52733ffeb9..52733ffeb9 100644
--- a/package/kernel/mac80211/patches/600-19-rt2x00-rt2800lib-fix-LNA-gain-configuration-for-RT38.patch
+++ b/package/kernel/mac80211/patches/rt2x00/600-19-rt2x00-rt2800lib-fix-LNA-gain-configuration-for-RT38.patch
diff --git a/package/kernel/mac80211/patches/600-20-rt2x00-rt2800lib-fix-VGC-setup-for-RT3883.patch b/package/kernel/mac80211/patches/rt2x00/600-20-rt2x00-rt2800lib-fix-VGC-setup-for-RT3883.patch
index 301928d283..301928d283 100644
--- a/package/kernel/mac80211/patches/600-20-rt2x00-rt2800lib-fix-VGC-setup-for-RT3883.patch
+++ b/package/kernel/mac80211/patches/rt2x00/600-20-rt2x00-rt2800lib-fix-VGC-setup-for-RT3883.patch
diff --git a/package/kernel/mac80211/patches/600-21-rt2x00-rt2800lib-fix-EEPROM-LNA-validation-for-RT388.patch b/package/kernel/mac80211/patches/rt2x00/600-21-rt2x00-rt2800lib-fix-EEPROM-LNA-validation-for-RT388.patch
index 4bbc7ae44e..4bbc7ae44e 100644
--- a/package/kernel/mac80211/patches/600-21-rt2x00-rt2800lib-fix-EEPROM-LNA-validation-for-RT388.patch
+++ b/package/kernel/mac80211/patches/rt2x00/600-21-rt2x00-rt2800lib-fix-EEPROM-LNA-validation-for-RT388.patch
diff --git a/package/kernel/mac80211/patches/600-22-rt2x00-rt2800lib-fix-txpower-compensation-for-RT3883.patch b/package/kernel/mac80211/patches/rt2x00/600-22-rt2x00-rt2800lib-fix-txpower-compensation-for-RT3883.patch
index e752efd0ea..e752efd0ea 100644
--- a/package/kernel/mac80211/patches/600-22-rt2x00-rt2800lib-fix-txpower-compensation-for-RT3883.patch
+++ b/package/kernel/mac80211/patches/rt2x00/600-22-rt2x00-rt2800lib-fix-txpower-compensation-for-RT3883.patch
diff --git a/package/kernel/mac80211/patches/600-23-rt2x00-rt2800mmio-add-a-workaround-for-spurious-TX_F.patch b/package/kernel/mac80211/patches/rt2x00/600-23-rt2x00-rt2800mmio-add-a-workaround-for-spurious-TX_F.patch
index 342174f8d5..342174f8d5 100644
--- a/package/kernel/mac80211/patches/600-23-rt2x00-rt2800mmio-add-a-workaround-for-spurious-TX_F.patch
+++ b/package/kernel/mac80211/patches/rt2x00/600-23-rt2x00-rt2800mmio-add-a-workaround-for-spurious-TX_F.patch
diff --git a/package/kernel/mac80211/patches/601-rt2x00-introduce-rt2x00_platform_h.patch b/package/kernel/mac80211/patches/rt2x00/601-rt2x00-introduce-rt2x00_platform_h.patch
index 9d47076ff6..9d47076ff6 100644
--- a/package/kernel/mac80211/patches/601-rt2x00-introduce-rt2x00_platform_h.patch
+++ b/package/kernel/mac80211/patches/rt2x00/601-rt2x00-introduce-rt2x00_platform_h.patch
diff --git a/package/kernel/mac80211/patches/602-rt2x00-introduce-rt2x00eeprom.patch b/package/kernel/mac80211/patches/rt2x00/602-rt2x00-introduce-rt2x00eeprom.patch
index 86a95a09f9..86a95a09f9 100644
--- a/package/kernel/mac80211/patches/602-rt2x00-introduce-rt2x00eeprom.patch
+++ b/package/kernel/mac80211/patches/rt2x00/602-rt2x00-introduce-rt2x00eeprom.patch
diff --git a/package/kernel/mac80211/patches/603-rt2x00-of_load_eeprom_filename.patch b/package/kernel/mac80211/patches/rt2x00/603-rt2x00-of_load_eeprom_filename.patch
index 9dffef1812..9dffef1812 100644
--- a/package/kernel/mac80211/patches/603-rt2x00-of_load_eeprom_filename.patch
+++ b/package/kernel/mac80211/patches/rt2x00/603-rt2x00-of_load_eeprom_filename.patch
diff --git a/package/kernel/mac80211/patches/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 a98b49c541..a98b49c541 100644
--- a/package/kernel/mac80211/patches/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
diff --git a/package/kernel/mac80211/patches/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..202dfc0b89 100644
--- a/package/kernel/mac80211/patches/606-rt2x00-allow_disabling_bands_through_platform_data.patch
+++ b/package/kernel/mac80211/patches/rt2x00/606-rt2x00-allow_disabling_bands_through_platform_data.patch
diff --git a/package/kernel/mac80211/patches/607-rt2x00-add_platform_data_mac_addr.patch b/package/kernel/mac80211/patches/rt2x00/607-rt2x00-add_platform_data_mac_addr.patch
index b8b0188040..b8b0188040 100644
--- a/package/kernel/mac80211/patches/607-rt2x00-add_platform_data_mac_addr.patch
+++ b/package/kernel/mac80211/patches/rt2x00/607-rt2x00-add_platform_data_mac_addr.patch
diff --git a/package/kernel/mac80211/patches/608-rt2x00-allow_disabling_bands_through_dts.patch b/package/kernel/mac80211/patches/rt2x00/608-rt2x00-allow_disabling_bands_through_dts.patch
index ca66aa8e3b..ca66aa8e3b 100644
--- a/package/kernel/mac80211/patches/608-rt2x00-allow_disabling_bands_through_dts.patch
+++ b/package/kernel/mac80211/patches/rt2x00/608-rt2x00-allow_disabling_bands_through_dts.patch
diff --git a/package/kernel/mac80211/patches/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 02b66e3bc0..02b66e3bc0 100644
--- a/package/kernel/mac80211/patches/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
diff --git a/package/kernel/mac80211/patches/610-rt2x00-change-led-polarity-from-OF.patch b/package/kernel/mac80211/patches/rt2x00/610-rt2x00-change-led-polarity-from-OF.patch
index ad70aa7826..ad70aa7826 100644
--- a/package/kernel/mac80211/patches/610-rt2x00-change-led-polarity-from-OF.patch
+++ b/package/kernel/mac80211/patches/rt2x00/610-rt2x00-change-led-polarity-from-OF.patch
diff --git a/package/kernel/mac80211/patches/611-rt2x00-add-AP+STA-support.patch b/package/kernel/mac80211/patches/rt2x00/611-rt2x00-add-AP+STA-support.patch
index 062b18a63b..062b18a63b 100644
--- a/package/kernel/mac80211/patches/611-rt2x00-add-AP+STA-support.patch
+++ b/package/kernel/mac80211/patches/rt2x00/611-rt2x00-add-AP+STA-support.patch
diff --git a/package/kernel/mac80211/patches/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 9fad80b672..9fad80b672 100644
--- a/package/kernel/mac80211/patches/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
diff --git a/package/kernel/mac80211/patches/651-rt2x00-remove-unneccesary-code.patch b/package/kernel/mac80211/patches/rt2x00/651-rt2x00-remove-unneccesary-code.patch
index 475fcbc223..475fcbc223 100644
--- a/package/kernel/mac80211/patches/651-rt2x00-remove-unneccesary-code.patch
+++ b/package/kernel/mac80211/patches/rt2x00/651-rt2x00-remove-unneccesary-code.patch
diff --git a/package/kernel/mac80211/patches/100-remove-cryptoapi-dependencies.patch b/package/kernel/mac80211/patches/subsys/100-remove-cryptoapi-dependencies.patch
index 8d7a39a6df..8d7a39a6df 100644
--- a/package/kernel/mac80211/patches/100-remove-cryptoapi-dependencies.patch
+++ b/package/kernel/mac80211/patches/subsys/100-remove-cryptoapi-dependencies.patch
diff --git a/package/kernel/mac80211/patches/110-mac80211_keep_keys_on_stop_ap.patch b/package/kernel/mac80211/patches/subsys/110-mac80211_keep_keys_on_stop_ap.patch
index 3b1fcdf9c8..3b1fcdf9c8 100644
--- a/package/kernel/mac80211/patches/110-mac80211_keep_keys_on_stop_ap.patch
+++ b/package/kernel/mac80211/patches/subsys/110-mac80211_keep_keys_on_stop_ap.patch
diff --git a/package/kernel/mac80211/patches/120-cfg80211_allow_perm_addr_change.patch b/package/kernel/mac80211/patches/subsys/120-cfg80211_allow_perm_addr_change.patch
index ffd8807ccc..ffd8807ccc 100644
--- a/package/kernel/mac80211/patches/120-cfg80211_allow_perm_addr_change.patch
+++ b/package/kernel/mac80211/patches/subsys/120-cfg80211_allow_perm_addr_change.patch
diff --git a/package/kernel/mac80211/patches/130-disable-fils.patch b/package/kernel/mac80211/patches/subsys/130-disable-fils.patch
index 1f03589878..1f03589878 100644
--- a/package/kernel/mac80211/patches/130-disable-fils.patch
+++ b/package/kernel/mac80211/patches/subsys/130-disable-fils.patch
diff --git a/package/kernel/mac80211/patches/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..d138b2c5ac 100644
--- a/package/kernel/mac80211/patches/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
diff --git a/package/kernel/mac80211/patches/132-mac80211-remove-cmac-dependency.patch b/package/kernel/mac80211/patches/subsys/132-mac80211-remove-cmac-dependency.patch
index 9d185e61e7..9d185e61e7 100644
--- a/package/kernel/mac80211/patches/132-mac80211-remove-cmac-dependency.patch
+++ b/package/kernel/mac80211/patches/subsys/132-mac80211-remove-cmac-dependency.patch
diff --git a/package/kernel/mac80211/patches/140-tweak-TSQ-setting.patch b/package/kernel/mac80211/patches/subsys/140-tweak-TSQ-setting.patch
index 6e9a07a927..6e9a07a927 100644
--- a/package/kernel/mac80211/patches/140-tweak-TSQ-setting.patch
+++ b/package/kernel/mac80211/patches/subsys/140-tweak-TSQ-setting.patch
diff --git a/package/kernel/mac80211/patches/150-disable_addr_notifier.patch b/package/kernel/mac80211/patches/subsys/150-disable_addr_notifier.patch
index 781dd3c1bc..781dd3c1bc 100644
--- a/package/kernel/mac80211/patches/150-disable_addr_notifier.patch
+++ b/package/kernel/mac80211/patches/subsys/150-disable_addr_notifier.patch
diff --git a/package/kernel/mac80211/patches/210-ap_scan.patch b/package/kernel/mac80211/patches/subsys/210-ap_scan.patch
index 8ade963c9f..8ade963c9f 100644
--- a/package/kernel/mac80211/patches/210-ap_scan.patch
+++ b/package/kernel/mac80211/patches/subsys/210-ap_scan.patch
diff --git a/package/kernel/mac80211/patches/357-mac80211-add-hdrlen-to-ieee80211_tx_data.patch b/package/kernel/mac80211/patches/subsys/357-mac80211-add-hdrlen-to-ieee80211_tx_data.patch
index 83c613434d..83c613434d 100644
--- a/package/kernel/mac80211/patches/357-mac80211-add-hdrlen-to-ieee80211_tx_data.patch
+++ b/package/kernel/mac80211/patches/subsys/357-mac80211-add-hdrlen-to-ieee80211_tx_data.patch
diff --git a/package/kernel/mac80211/patches/358-mac80211-add-NEED_ALIGNED4_SKBS-hw-flag.patch b/package/kernel/mac80211/patches/subsys/358-mac80211-add-NEED_ALIGNED4_SKBS-hw-flag.patch
index a9f01b368d..417013890b 100644
--- a/package/kernel/mac80211/patches/358-mac80211-add-NEED_ALIGNED4_SKBS-hw-flag.patch
+++ b/package/kernel/mac80211/patches/subsys/358-mac80211-add-NEED_ALIGNED4_SKBS-hw-flag.patch
@@ -21,11 +21,13 @@ wep/tkip/ccmp.
Signed-off-by: Janusz Dziedzic <janusz.dziedzic@tieto.com>
---
---- a/include/net/mac80211.h
-+++ b/include/net/mac80211.h
-@@ -2059,6 +2059,9 @@ struct ieee80211_txq {
- * @IEEE80211_HW_SUPPORTS_TDLS_BUFFER_STA: Hardware supports buffer STA on
- * TDLS links.
+Index: backports-v4.18-rc7/include/net/mac80211.h
+===================================================================
+--- backports-v4.18-rc7.orig/include/net/mac80211.h
++++ backports-v4.18-rc7/include/net/mac80211.h
+@@ -2084,6 +2084,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_NEEDS_ALIGNED4_SKBS: Driver need aligned skbs to four-byte.
+ * Padding will be added after ieee80211_hdr, before IV/LLC.
@@ -33,27 +35,31 @@ Signed-off-by: Janusz Dziedzic <janusz.dziedzic@tieto.com>
* @NUM_IEEE80211_HW_FLAGS: number of hardware flags, used for sizing arrays
*/
enum ieee80211_hw_flags {
-@@ -2102,6 +2105,7 @@ enum ieee80211_hw_flags {
- IEEE80211_HW_REPORTS_LOW_ACK,
- IEEE80211_HW_SUPPORTS_TX_FRAG,
+@@ -2129,6 +2132,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_NEEDS_ALIGNED4_SKBS,
/* keep last, obviously */
NUM_IEEE80211_HW_FLAGS
---- a/net/mac80211/debugfs.c
-+++ b/net/mac80211/debugfs.c
-@@ -212,6 +212,7 @@ static const char *hw_flag_names[] = {
- FLAG(REPORTS_LOW_ACK),
- FLAG(SUPPORTS_TX_FRAG),
+Index: backports-v4.18-rc7/net/mac80211/debugfs.c
+===================================================================
+--- backports-v4.18-rc7.orig/net/mac80211/debugfs.c
++++ backports-v4.18-rc7/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(NEEDS_ALIGNED4_SKBS),
#undef FLAG
};
---- a/net/mac80211/ieee80211_i.h
-+++ b/net/mac80211/ieee80211_i.h
-@@ -1548,6 +1548,29 @@ ieee80211_vif_get_num_mcast_if(struct ie
+Index: backports-v4.18-rc7/net/mac80211/ieee80211_i.h
+===================================================================
+--- backports-v4.18-rc7.orig/net/mac80211/ieee80211_i.h
++++ backports-v4.18-rc7/net/mac80211/ieee80211_i.h
+@@ -1550,6 +1550,29 @@ ieee80211_vif_get_num_mcast_if(struct ie
return -1;
}
@@ -83,9 +89,11 @@ Signed-off-by: Janusz Dziedzic <janusz.dziedzic@tieto.com>
u64 ieee80211_calculate_rx_timestamp(struct ieee80211_local *local,
struct ieee80211_rx_status *status,
unsigned int mpdu_len,
---- a/net/mac80211/sta_info.h
-+++ b/net/mac80211/sta_info.h
-@@ -300,7 +300,7 @@ struct ieee80211_fast_tx {
+Index: backports-v4.18-rc7/net/mac80211/sta_info.h
+===================================================================
+--- backports-v4.18-rc7.orig/net/mac80211/sta_info.h
++++ backports-v4.18-rc7/net/mac80211/sta_info.h
+@@ -301,7 +301,7 @@ struct ieee80211_fast_tx {
u8 hdr_len;
u8 sa_offs, da_offs, pn_offs;
u8 band;
@@ -94,9 +102,11 @@ Signed-off-by: Janusz Dziedzic <janusz.dziedzic@tieto.com>
sizeof(rfc1042_header)] __aligned(2);
struct rcu_head rcu_head;
---- a/net/mac80211/status.c
-+++ b/net/mac80211/status.c
-@@ -642,9 +642,22 @@ void ieee80211_tx_monitor(struct ieee802
+Index: backports-v4.18-rc7/net/mac80211/status.c
+===================================================================
+--- backports-v4.18-rc7.orig/net/mac80211/status.c
++++ backports-v4.18-rc7/net/mac80211/status.c
+@@ -653,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;
@@ -119,8 +129,10 @@ Signed-off-by: Janusz Dziedzic <janusz.dziedzic@tieto.com>
/* send frame to monitor interfaces now */
rtap_len = ieee80211_tx_radiotap_len(info);
if (WARN_ON_ONCE(skb_headroom(skb) < rtap_len)) {
---- a/net/mac80211/tkip.c
-+++ b/net/mac80211/tkip.c
+Index: backports-v4.18-rc7/net/mac80211/tkip.c
+===================================================================
+--- backports-v4.18-rc7.orig/net/mac80211/tkip.c
++++ backports-v4.18-rc7/net/mac80211/tkip.c
@@ -201,10 +201,12 @@ void ieee80211_get_tkip_p2k(struct ieee8
{
struct ieee80211_key *key = (struct ieee80211_key *)
@@ -135,9 +147,11 @@ Signed-off-by: Janusz Dziedzic <janusz.dziedzic@tieto.com>
u32 iv32 = get_unaligned_le32(&data[4]);
u16 iv16 = data[2] | (data[0] << 8);
---- a/net/mac80211/tx.c
-+++ b/net/mac80211/tx.c
-@@ -1172,8 +1172,7 @@ ieee80211_tx_prepare(struct ieee80211_su
+Index: backports-v4.18-rc7/net/mac80211/tx.c
+===================================================================
+--- backports-v4.18-rc7.orig/net/mac80211/tx.c
++++ backports-v4.18-rc7/net/mac80211/tx.c
+@@ -1169,8 +1169,7 @@ ieee80211_tx_prepare(struct ieee80211_su
info->flags &= ~IEEE80211_TX_INTFL_NEED_TXPROCESSING;
hdr = (struct ieee80211_hdr *) skb->data;
@@ -147,7 +161,7 @@ Signed-off-by: Janusz Dziedzic <janusz.dziedzic@tieto.com>
if (likely(sta)) {
if (!IS_ERR(sta))
-@@ -2184,7 +2183,7 @@ netdev_tx_t ieee80211_monitor_start_xmit
+@@ -2200,7 +2199,7 @@ netdev_tx_t ieee80211_monitor_start_xmit
goto fail;
hdr = (struct ieee80211_hdr *)(skb->data + len_rthdr);
@@ -156,7 +170,7 @@ Signed-off-by: Janusz Dziedzic <janusz.dziedzic@tieto.com>
if (skb->len < len_rthdr + hdrlen)
goto fail;
-@@ -2402,7 +2401,7 @@ static struct sk_buff *ieee80211_build_h
+@@ -2418,7 +2417,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;
@@ -165,7 +179,7 @@ Signed-off-by: Janusz Dziedzic <janusz.dziedzic@tieto.com>
if (IS_ERR(sta))
sta = NULL;
-@@ -2622,6 +2621,9 @@ static struct sk_buff *ieee80211_build_h
+@@ -2638,6 +2637,9 @@ static struct sk_buff *ieee80211_build_h
hdrlen += 2;
}
@@ -175,7 +189,7 @@ Signed-off-by: Janusz Dziedzic <janusz.dziedzic@tieto.com>
/*
* Drop unicast frames to unauthorised stations unless they are
* EAPOL frames from the local station.
-@@ -2702,6 +2704,7 @@ static struct sk_buff *ieee80211_build_h
+@@ -2718,6 +2720,7 @@ static struct sk_buff *ieee80211_build_h
skb_pull(skb, skip_header_bytes);
head_need = hdrlen + encaps_len + meshhdrlen - skb_headroom(skb);
@@ -183,7 +197,7 @@ Signed-off-by: Janusz Dziedzic <janusz.dziedzic@tieto.com>
/*
* So we need to modify the skb header and hence need a copy of
-@@ -2734,6 +2737,9 @@ static struct sk_buff *ieee80211_build_h
+@@ -2750,6 +2753,9 @@ static struct sk_buff *ieee80211_build_h
memcpy(skb_push(skb, meshhdrlen), &mesh_hdr, meshhdrlen);
#endif
@@ -193,7 +207,7 @@ Signed-off-by: Janusz Dziedzic <janusz.dziedzic@tieto.com>
if (ieee80211_is_data_qos(fc)) {
__le16 *qos_control;
-@@ -2909,6 +2915,9 @@ void ieee80211_check_fast_xmit(struct st
+@@ -2925,6 +2931,9 @@ void ieee80211_check_fast_xmit(struct st
fc |= cpu_to_le16(IEEE80211_STYPE_QOS_DATA);
}
@@ -203,7 +217,7 @@ Signed-off-by: Janusz Dziedzic <janusz.dziedzic@tieto.com>
/* 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,
-@@ -3495,7 +3504,7 @@ begin:
+@@ -3513,7 +3522,7 @@ begin:
if (tx.key &&
(tx.key->conf.flags & IEEE80211_KEY_FLAG_GENERATE_IV))
@@ -212,9 +226,11 @@ Signed-off-by: Janusz Dziedzic <janusz.dziedzic@tieto.com>
ieee80211_xmit_fast_finish(sta->sdata, sta, pn_offs,
tx.key, skb);
---- a/net/mac80211/util.c
-+++ b/net/mac80211/util.c
-@@ -1230,6 +1230,7 @@ void ieee80211_send_auth(struct ieee8021
+Index: backports-v4.18-rc7/net/mac80211/util.c
+===================================================================
+--- backports-v4.18-rc7.orig/net/mac80211/util.c
++++ backports-v4.18-rc7/net/mac80211/util.c
+@@ -1274,6 +1274,7 @@ void ieee80211_send_auth(struct ieee8021
u32 tx_flags)
{
struct ieee80211_local *local = sdata->local;
@@ -222,7 +238,7 @@ Signed-off-by: Janusz Dziedzic <janusz.dziedzic@tieto.com>
struct sk_buff *skb;
struct ieee80211_mgmt *mgmt;
unsigned int hdrlen;
-@@ -1256,7 +1257,7 @@ void ieee80211_send_auth(struct ieee8021
+@@ -1300,7 +1301,7 @@ void ieee80211_send_auth(struct ieee8021
skb_put_data(skb, extra, extra_len);
if (auth_alg == WLAN_AUTH_SHARED_KEY && transaction == 3) {
diff --git a/package/kernel/mac80211/patches/359-mac80211-minstrel-Enable-STBC-and-LDPC-for-VHT-Rates.patch b/package/kernel/mac80211/patches/subsys/359-mac80211-minstrel-Enable-STBC-and-LDPC-for-VHT-Rates.patch
index 609b15b832..609b15b832 100644
--- a/package/kernel/mac80211/patches/359-mac80211-minstrel-Enable-STBC-and-LDPC-for-VHT-Rates.patch
+++ b/package/kernel/mac80211/patches/subsys/359-mac80211-minstrel-Enable-STBC-and-LDPC-for-VHT-Rates.patch
diff --git a/package/kernel/mac80211/patches/370-mac80211-minstrel-remove-unnecessary-debugfs-cleanup.patch b/package/kernel/mac80211/patches/subsys/370-mac80211-minstrel-remove-unnecessary-debugfs-cleanup.patch
index 14cf6641d8..c871655a38 100644
--- a/package/kernel/mac80211/patches/370-mac80211-minstrel-remove-unnecessary-debugfs-cleanup.patch
+++ b/package/kernel/mac80211/patches/subsys/370-mac80211-minstrel-remove-unnecessary-debugfs-cleanup.patch
@@ -8,14 +8,16 @@ debugfs entries are cleaned up by debugfs_remove_recursive already.
Signed-off-by: Felix Fietkau <nbd@nbd.name>
---
---- a/net/mac80211/rc80211_minstrel.c
-+++ b/net/mac80211/rc80211_minstrel.c
+Index: backports-v4.18-rc7/net/mac80211/rc80211_minstrel.c
+===================================================================
+--- backports-v4.18-rc7.orig/net/mac80211/rc80211_minstrel.c
++++ backports-v4.18-rc7/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",
-- S_IRUGO | S_IWUGO, debugfsdir, &mp->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
@@ -39,8 +41,10 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
#endif
.get_expected_throughput = minstrel_get_expected_throughput,
};
---- a/net/mac80211/rc80211_minstrel.h
-+++ b/net/mac80211/rc80211_minstrel.h
+Index: backports-v4.18-rc7/net/mac80211/rc80211_minstrel.h
+===================================================================
+--- backports-v4.18-rc7.orig/net/mac80211/rc80211_minstrel.h
++++ backports-v4.18-rc7/net/mac80211/rc80211_minstrel.h
@@ -109,11 +109,6 @@ struct minstrel_sta_info {
/* sampling table */
@@ -69,17 +73,19 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
/* 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
+Index: backports-v4.18-rc7/net/mac80211/rc80211_minstrel_debugfs.c
+===================================================================
+--- backports-v4.18-rc7.orig/net/mac80211/rc80211_minstrel_debugfs.c
++++ backports-v4.18-rc7/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", S_IRUGO, dir, mi,
-- &minstrel_stat_fops);
+- mi->dbg_stats = debugfs_create_file("rc_stats", 0444, dir, mi,
+- &minstrel_stat_fops);
-
-- mi->dbg_stats_csv = debugfs_create_file("rc_stats_csv", S_IRUGO, dir,
-- mi, &minstrel_stat_csv_fops);
+- mi->dbg_stats_csv = debugfs_create_file("rc_stats_csv", 0444, dir, mi,
+- &minstrel_stat_csv_fops);
-}
-
-void
@@ -94,8 +100,10 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
+ 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
+Index: backports-v4.18-rc7/net/mac80211/rc80211_minstrel_ht.c
+===================================================================
+--- backports-v4.18-rc7.orig/net/mac80211/rc80211_minstrel_ht.c
++++ backports-v4.18-rc7/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
@@ -104,8 +112,10 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
#endif
.get_expected_throughput = minstrel_ht_get_expected_throughput,
};
---- a/net/mac80211/rc80211_minstrel_ht.h
-+++ b/net/mac80211/rc80211_minstrel_ht.h
+Index: backports-v4.18-rc7/net/mac80211/rc80211_minstrel_ht.h
+===================================================================
+--- backports-v4.18-rc7.orig/net/mac80211/rc80211_minstrel_ht.h
++++ backports-v4.18-rc7/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;
@@ -124,16 +134,18 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
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
+Index: backports-v4.18-rc7/net/mac80211/rc80211_minstrel_ht_debugfs.c
+===================================================================
+--- backports-v4.18-rc7.orig/net/mac80211/rc80211_minstrel_ht_debugfs.c
++++ backports-v4.18-rc7/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", S_IRUGO, dir, msp,
-- &minstrel_ht_stat_fops);
-- msp->dbg_stats_csv = debugfs_create_file("rc_stats_csv", S_IRUGO,
-- dir, msp, &minstrel_ht_stat_csv_fops);
+- 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
diff --git a/package/kernel/mac80211/patches/371-mac80211-minstrel-merge-with-minstrel_ht-always-enab.patch b/package/kernel/mac80211/patches/subsys/371-mac80211-minstrel-merge-with-minstrel_ht-always-enab.patch
index a2bdfd81a0..1c36a070ca 100644
--- a/package/kernel/mac80211/patches/371-mac80211-minstrel-merge-with-minstrel_ht-always-enab.patch
+++ b/package/kernel/mac80211/patches/subsys/371-mac80211-minstrel-merge-with-minstrel_ht-always-enab.patch
@@ -10,8 +10,10 @@ lines of code to make it optional.
Signed-off-by: Felix Fietkau <nbd@nbd.name>
---
---- a/net/mac80211/Kconfig
-+++ b/net/mac80211/Kconfig
+Index: backports-v4.18-rc7/net/mac80211/Kconfig
+===================================================================
+--- backports-v4.18-rc7.orig/net/mac80211/Kconfig
++++ backports-v4.18-rc7/net/mac80211/Kconfig
@@ -25,20 +25,6 @@ config MAC80211_RC_MINSTREL
---help---
This option enables the 'minstrel' TX rate control algorithm
@@ -43,9 +45,11 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
default ""
endif
---- a/net/mac80211/Makefile
-+++ b/net/mac80211/Makefile
-@@ -50,13 +50,14 @@ mac80211-$(CONFIG_PM) += pm.o
+Index: backports-v4.18-rc7/net/mac80211/Makefile
+===================================================================
+--- backports-v4.18-rc7.orig/net/mac80211/Makefile
++++ backports-v4.18-rc7/net/mac80211/Makefile
+@@ -51,13 +51,14 @@ mac80211-$(CONFIG_PM) += pm.o
CFLAGS_trace.o := -I$(src)
@@ -65,9 +69,11 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
-mac80211-$(CPTCFG_MAC80211_RC_MINSTREL_HT) += $(rc80211_minstrel_ht-y)
ccflags-y += -DDEBUG
---- a/net/mac80211/main.c
-+++ b/net/mac80211/main.c
-@@ -1252,18 +1252,12 @@ static int __init ieee80211_init(void)
+Index: backports-v4.18-rc7/net/mac80211/main.c
+===================================================================
+--- backports-v4.18-rc7.orig/net/mac80211/main.c
++++ backports-v4.18-rc7/net/mac80211/main.c
+@@ -1264,18 +1264,12 @@ static int __init ieee80211_init(void)
if (ret)
return ret;
@@ -86,7 +92,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
rc80211_minstrel_exit();
return ret;
-@@ -1271,7 +1265,6 @@ static int __init ieee80211_init(void)
+@@ -1283,7 +1277,6 @@ static int __init ieee80211_init(void)
static void __exit ieee80211_exit(void)
{
@@ -94,8 +100,10 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
rc80211_minstrel_exit();
ieee80211s_stop();
---- a/net/mac80211/rate.h
-+++ b/net/mac80211/rate.h
+Index: backports-v4.18-rc7/net/mac80211/rate.h
+===================================================================
+--- backports-v4.18-rc7.orig/net/mac80211/rate.h
++++ backports-v4.18-rc7/net/mac80211/rate.h
@@ -95,18 +95,5 @@ static inline void rc80211_minstrel_exit
}
#endif
@@ -115,8 +123,10 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
-
#endif /* IEEE80211_RATE_H */
---- a/net/mac80211/rc80211_minstrel.c
-+++ b/net/mac80211/rc80211_minstrel.c
+Index: backports-v4.18-rc7/net/mac80211/rc80211_minstrel.c
+===================================================================
+--- backports-v4.18-rc7.orig/net/mac80211/rc80211_minstrel.c
++++ backports-v4.18-rc7/net/mac80211/rc80211_minstrel.c
@@ -572,138 +572,6 @@ minstrel_rate_init(void *priv, struct ie
minstrel_update_rates(mp, mi);
}
@@ -141,11 +151,11 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
- max_rates = sband->n_bitrates;
- }
-
-- mi->r = kzalloc(sizeof(struct minstrel_rate) * max_rates, gfp);
+- mi->r = kcalloc(max_rates, sizeof(struct minstrel_rate), gfp);
- if (!mi->r)
- goto error;
-
-- mi->sample_table = kmalloc(SAMPLE_COLUMNS * max_rates, gfp);
+- mi->sample_table = kmalloc_array(max_rates, SAMPLE_COLUMNS, gfp);
- if (!mi->sample_table)
- goto error1;
-
@@ -286,8 +296,10 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
- ieee80211_rate_control_unregister(&mac80211_minstrel);
-}
-
---- a/net/mac80211/rc80211_minstrel.h
-+++ b/net/mac80211/rc80211_minstrel.h
+Index: backports-v4.18-rc7/net/mac80211/rc80211_minstrel.h
+===================================================================
+--- backports-v4.18-rc7.orig/net/mac80211/rc80211_minstrel.h
++++ backports-v4.18-rc7/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);
@@ -296,8 +308,10 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
-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
+Index: backports-v4.18-rc7/net/mac80211/rc80211_minstrel_debugfs.c
+===================================================================
+--- backports-v4.18-rc7.orig/net/mac80211/rc80211_minstrel_debugfs.c
++++ backports-v4.18-rc7/net/mac80211/rc80211_minstrel_debugfs.c
@@ -54,22 +54,6 @@
#include <net/mac80211.h>
#include "rc80211_minstrel.h"
@@ -358,8 +372,10 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
- 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
+Index: backports-v4.18-rc7/net/mac80211/rc80211_minstrel_ht.c
+===================================================================
+--- backports-v4.18-rc7.orig/net/mac80211/rc80211_minstrel_ht.c
++++ backports-v4.18-rc7/net/mac80211/rc80211_minstrel_ht.c
@@ -137,12 +137,10 @@
} \
}
@@ -523,8 +539,10 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
{
ieee80211_rate_control_unregister(&mac80211_minstrel_ht);
}
---- a/net/mac80211/rc80211_minstrel_ht.h
-+++ b/net/mac80211/rc80211_minstrel_ht.h
+Index: backports-v4.18-rc7/net/mac80211/rc80211_minstrel_ht.h
+===================================================================
+--- backports-v4.18-rc7.orig/net/mac80211/rc80211_minstrel_ht.h
++++ backports-v4.18-rc7/net/mac80211/rc80211_minstrel_ht.h
@@ -15,11 +15,7 @@
*/
#define MINSTREL_MAX_STREAMS 3
@@ -549,8 +567,10 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
struct mcs_group {
u32 flags;
---- a/net/mac80211/rc80211_minstrel_ht_debugfs.c
-+++ b/net/mac80211/rc80211_minstrel_ht_debugfs.c
+Index: backports-v4.18-rc7/net/mac80211/rc80211_minstrel_ht_debugfs.c
+===================================================================
+--- backports-v4.18-rc7.orig/net/mac80211/rc80211_minstrel_ht_debugfs.c
++++ backports-v4.18-rc7/net/mac80211/rc80211_minstrel_ht_debugfs.c
@@ -15,6 +15,22 @@
#include "rc80211_minstrel.h"
#include "rc80211_minstrel_ht.h"
diff --git a/package/kernel/mac80211/patches/372-mac80211-minstrel-reduce-minstrel_mcs_groups-size.patch b/package/kernel/mac80211/patches/subsys/372-mac80211-minstrel-reduce-minstrel_mcs_groups-size.patch
index 02a0ca0a52..02a0ca0a52 100644
--- a/package/kernel/mac80211/patches/372-mac80211-minstrel-reduce-minstrel_mcs_groups-size.patch
+++ b/package/kernel/mac80211/patches/subsys/372-mac80211-minstrel-reduce-minstrel_mcs_groups-size.patch
diff --git a/package/kernel/mac80211/patches/373-mac80211-minstrel-fix-using-short-preamble-CCK-rates.patch b/package/kernel/mac80211/patches/subsys/373-mac80211-minstrel-fix-using-short-preamble-CCK-rates.patch
index 502d8c7768..6478e9ec5a 100644
--- a/package/kernel/mac80211/patches/373-mac80211-minstrel-fix-using-short-preamble-CCK-rates.patch
+++ b/package/kernel/mac80211/patches/subsys/373-mac80211-minstrel-fix-using-short-preamble-CCK-rates.patch
@@ -9,8 +9,10 @@ Fixes: 782dda00ab8e ("mac80211: minstrel_ht: move short preamble check out of ge
Signed-off-by: Felix Fietkau <nbd@nbd.name>
---
---- a/net/mac80211/rc80211_minstrel_ht.c
-+++ b/net/mac80211/rc80211_minstrel_ht.c
+Index: backports-v4.18-rc7/net/mac80211/rc80211_minstrel_ht.c
+===================================================================
+--- backports-v4.18-rc7.orig/net/mac80211/rc80211_minstrel_ht.c
++++ backports-v4.18-rc7/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;
diff --git a/package/kernel/mac80211/patches/375-mac80211-minstrel-fix-CCK-rate-group-streams-value.patch b/package/kernel/mac80211/patches/subsys/375-mac80211-minstrel-fix-CCK-rate-group-streams-value.patch
index f0ffcd9655..f0ffcd9655 100644
--- a/package/kernel/mac80211/patches/375-mac80211-minstrel-fix-CCK-rate-group-streams-value.patch
+++ b/package/kernel/mac80211/patches/subsys/375-mac80211-minstrel-fix-CCK-rate-group-streams-value.patch
diff --git a/package/kernel/mac80211/patches/376-mac80211-minstrel-fix-sampling-reporting-of-CCK-rate.patch b/package/kernel/mac80211/patches/subsys/376-mac80211-minstrel-fix-sampling-reporting-of-CCK-rate.patch
index e0049c36eb..e0049c36eb 100644
--- a/package/kernel/mac80211/patches/376-mac80211-minstrel-fix-sampling-reporting-of-CCK-rate.patch
+++ b/package/kernel/mac80211/patches/subsys/376-mac80211-minstrel-fix-sampling-reporting-of-CCK-rate.patch
diff --git a/package/kernel/mac80211/patches/377-mac80211-minstrel-do-not-sample-rates-3-times-slower.patch b/package/kernel/mac80211/patches/subsys/377-mac80211-minstrel-do-not-sample-rates-3-times-slower.patch
index 414cb137de..414cb137de 100644
--- a/package/kernel/mac80211/patches/377-mac80211-minstrel-do-not-sample-rates-3-times-slower.patch
+++ b/package/kernel/mac80211/patches/subsys/377-mac80211-minstrel-do-not-sample-rates-3-times-slower.patch
diff --git a/package/kernel/mac80211/patches/378-mac80211-fix-memory-accounting-with-A-MSDU-aggregati.patch b/package/kernel/mac80211/patches/subsys/378-mac80211-fix-memory-accounting-with-A-MSDU-aggregati.patch
index c64457a17f..c64457a17f 100644
--- a/package/kernel/mac80211/patches/378-mac80211-fix-memory-accounting-with-A-MSDU-aggregati.patch
+++ b/package/kernel/mac80211/patches/subsys/378-mac80211-fix-memory-accounting-with-A-MSDU-aggregati.patch
diff --git a/package/kernel/mac80211/patches/379-cfg80211-initialize-sinfo-in-cfg80211_get_station.patch b/package/kernel/mac80211/patches/subsys/379-cfg80211-initialize-sinfo-in-cfg80211_get_station.patch
index 37323c1f7d..37323c1f7d 100644
--- a/package/kernel/mac80211/patches/379-cfg80211-initialize-sinfo-in-cfg80211_get_station.patch
+++ b/package/kernel/mac80211/patches/subsys/379-cfg80211-initialize-sinfo-in-cfg80211_get_station.patch
diff --git a/package/kernel/mac80211/patches/522-mac80211_configure_antenna_gain.patch b/package/kernel/mac80211/patches/subsys/522-mac80211_configure_antenna_gain.patch
index b815f5f22a..3546b1d439 100644
--- a/package/kernel/mac80211/patches/522-mac80211_configure_antenna_gain.patch
+++ b/package/kernel/mac80211/patches/subsys/522-mac80211_configure_antenna_gain.patch
@@ -1,6 +1,8 @@
---- a/include/net/cfg80211.h
-+++ b/include/net/cfg80211.h
-@@ -2750,6 +2750,7 @@ struct cfg80211_pmk_conf {
+Index: backports-v4.18-rc7/include/net/cfg80211.h
+===================================================================
+--- backports-v4.18-rc7.orig/include/net/cfg80211.h
++++ backports-v4.18-rc7/include/net/cfg80211.h
+@@ -2857,6 +2857,7 @@ struct cfg80211_external_auth_params {
* (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 +10,7 @@
*
* @set_wds_peer: set the WDS peer for a WDS interface
*
-@@ -3041,6 +3042,7 @@ struct cfg80211_ops {
+@@ -3157,6 +3158,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);
@@ -16,9 +18,11 @@
int (*set_wds_peer)(struct wiphy *wiphy, struct net_device *dev,
const u8 *addr);
---- a/include/net/mac80211.h
-+++ b/include/net/mac80211.h
-@@ -1338,6 +1338,7 @@ enum ieee80211_smps_mode {
+Index: backports-v4.18-rc7/include/net/mac80211.h
+===================================================================
+--- backports-v4.18-rc7.orig/include/net/mac80211.h
++++ backports-v4.18-rc7/include/net/mac80211.h
+@@ -1348,6 +1348,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 +30,7 @@
*
* @chandef: the channel definition to tune to
* @radar_enabled: whether radar detection is enabled
-@@ -1358,6 +1359,7 @@ enum ieee80211_smps_mode {
+@@ -1368,6 +1369,7 @@ enum ieee80211_smps_mode {
struct ieee80211_conf {
u32 flags;
int power_level, dynamic_ps_timeout;
@@ -34,11 +38,13 @@
u16 listen_interval;
u8 ps_dtim_period;
---- a/include/uapi/linux/nl80211.h
-+++ b/include/uapi/linux/nl80211.h
-@@ -2153,6 +2153,9 @@ enum nl80211_commands {
- * @NL80211_ATTR_PMKR0_NAME: PMK-R0 Name for offloaded FT.
- * @NL80211_ATTR_PORT_AUTHORIZED: (reserved)
+Index: backports-v4.18-rc7/include/uapi/linux/nl80211.h
+===================================================================
+--- backports-v4.18-rc7.orig/include/uapi/linux/nl80211.h
++++ backports-v4.18-rc7/include/uapi/linux/nl80211.h
+@@ -2238,6 +2238,9 @@ enum nl80211_commands {
+ * @NL80211_ATTR_TXQ_QUANTUM: TXQ scheduler quantum (bytes). Number of bytes
+ * a flow is assigned on each round of the DRR scheduler.
*
+ * @NL80211_ATTR_WIPHY_ANTENNA_GAIN: Configured antenna gain. Used to reduce
+ * transmit power to stay within regulatory limits. u32, dBi.
@@ -46,18 +52,20 @@
* @NUM_NL80211_ATTR: total number of nl80211_attrs available
* @NL80211_ATTR_MAX: highest attribute number currently defined
* @__NL80211_ATTR_AFTER_LAST: internal use
-@@ -2579,6 +2582,8 @@ enum nl80211_attrs {
- NL80211_ATTR_PMKR0_NAME,
- NL80211_ATTR_PORT_AUTHORIZED,
+@@ -2677,6 +2680,8 @@ enum nl80211_attrs {
+ NL80211_ATTR_TXQ_MEMORY_LIMIT,
+ NL80211_ATTR_TXQ_QUANTUM,
+ NL80211_ATTR_WIPHY_ANTENNA_GAIN,
+
/* add attributes here, update the policy in nl80211.c */
__NL80211_ATTR_AFTER_LAST,
---- a/net/mac80211/cfg.c
-+++ b/net/mac80211/cfg.c
-@@ -2447,6 +2447,19 @@ static int ieee80211_get_tx_power(struct
+Index: backports-v4.18-rc7/net/mac80211/cfg.c
+===================================================================
+--- backports-v4.18-rc7.orig/net/mac80211/cfg.c
++++ backports-v4.18-rc7/net/mac80211/cfg.c
+@@ -2489,6 +2489,19 @@ static int ieee80211_get_tx_power(struct
return 0;
}
@@ -77,7 +85,7 @@
static int ieee80211_set_wds_peer(struct wiphy *wiphy, struct net_device *dev,
const u8 *addr)
{
-@@ -3721,6 +3734,7 @@ const struct cfg80211_ops mac80211_confi
+@@ -3856,6 +3869,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,
@@ -85,9 +93,11 @@
.set_wds_peer = ieee80211_set_wds_peer,
.rfkill_poll = ieee80211_rfkill_poll,
CFG80211_TESTMODE_CMD(ieee80211_testmode_cmd)
---- a/net/mac80211/ieee80211_i.h
-+++ b/net/mac80211/ieee80211_i.h
-@@ -1348,6 +1348,7 @@ struct ieee80211_local {
+Index: backports-v4.18-rc7/net/mac80211/ieee80211_i.h
+===================================================================
+--- backports-v4.18-rc7.orig/net/mac80211/ieee80211_i.h
++++ backports-v4.18-rc7/net/mac80211/ieee80211_i.h
+@@ -1350,6 +1350,7 @@ struct ieee80211_local {
int dynamic_ps_forced_timeout;
int user_power_level; /* in dBm, for all interfaces */
@@ -95,8 +105,10 @@
enum ieee80211_smps_mode smps_mode;
---- a/net/mac80211/main.c
-+++ b/net/mac80211/main.c
+Index: backports-v4.18-rc7/net/mac80211/main.c
+===================================================================
+--- backports-v4.18-rc7.orig/net/mac80211/main.c
++++ backports-v4.18-rc7/net/mac80211/main.c
@@ -93,7 +93,7 @@ static u32 ieee80211_hw_conf_chan(struct
struct ieee80211_sub_if_data *sdata;
struct cfg80211_chan_def chandef = {};
@@ -127,17 +139,19 @@
local->hw.uapsd_queues = IEEE80211_DEFAULT_UAPSD_QUEUES;
local->hw.uapsd_max_sp_len = IEEE80211_DEFAULT_MAX_SP_LEN;
local->user_power_level = IEEE80211_UNSET_POWER_LEVEL;
---- a/net/wireless/nl80211.c
-+++ b/net/wireless/nl80211.c
-@@ -420,6 +420,7 @@ static const struct nla_policy nl80211_p
- [NL80211_ATTR_FILS_CACHE_ID] = { .len = 2 },
- [NL80211_ATTR_PMK] = { .type = NLA_BINARY, .len = PMK_MAX_LEN },
- [NL80211_ATTR_SCHED_SCAN_MULTI] = { .type = NLA_FLAG },
+Index: backports-v4.18-rc7/net/wireless/nl80211.c
+===================================================================
+--- backports-v4.18-rc7.orig/net/wireless/nl80211.c
++++ backports-v4.18-rc7/net/wireless/nl80211.c
+@@ -428,6 +428,7 @@ static const struct nla_policy nl80211_p
+ [NL80211_ATTR_TXQ_LIMIT] = { .type = NLA_U32 },
+ [NL80211_ATTR_TXQ_MEMORY_LIMIT] = { .type = NLA_U32 },
+ [NL80211_ATTR_TXQ_QUANTUM] = { .type = NLA_U32 },
+ [NL80211_ATTR_WIPHY_ANTENNA_GAIN] = { .type = NLA_U32 },
};
/* policy for the key attributes */
-@@ -2395,6 +2396,20 @@ static int nl80211_set_wiphy(struct sk_b
+@@ -2531,6 +2532,20 @@ static int nl80211_set_wiphy(struct sk_b
if (result)
return result;
}