瀏覽代碼

mac80211: Update to version 5.2-rc7

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

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

Signed-off-by: Hauke Mehrtens <[email protected]>
Hauke Mehrtens 6 年之前
父節點
當前提交
0b2c42ced2
共有 100 個文件被更改,包括 117 次插入10920 次删除
  1. 4 4
      package/kernel/mac80211/Makefile
  2. 1 1
      package/kernel/mac80211/broadcom.mk
  3. 2 1
      package/kernel/mac80211/patches/ath/070-ath_common_config.patch
  4. 2 2
      package/kernel/mac80211/patches/ath/080-ath10k_thermal_config.patch
  5. 2 2
      package/kernel/mac80211/patches/ath/356-Revert-ath9k-interpret-requested-txpower-in-EIRP-dom.patch
  6. 1 1
      package/kernel/mac80211/patches/ath/365-ath9k-adjust-tx-power-reduction-for-US-regulatory-do.patch
  7. 0 92
      package/kernel/mac80211/patches/ath/381-ath9k-fix-tx99-with-monitor-mode-interface.patch
  8. 0 96
      package/kernel/mac80211/patches/ath/395-ath9k-add-back-support-for-using-active-monitor-inte.patch
  9. 1 1
      package/kernel/mac80211/patches/ath/402-ath_regd_optional.patch
  10. 5 5
      package/kernel/mac80211/patches/ath/404-regd_no_assoc_hints.patch
  11. 2 2
      package/kernel/mac80211/patches/ath/405-ath_regd_us.patch
  12. 0 35
      package/kernel/mac80211/patches/ath/407-regd_add_extra_country_codes.patch
  13. 1 1
      package/kernel/mac80211/patches/ath/410-ath9k_allow_adhoc_and_ap.patch
  14. 3 3
      package/kernel/mac80211/patches/ath/411-ath5k_allow_adhoc_and_ap.patch
  15. 2 2
      package/kernel/mac80211/patches/ath/500-ath9k_eeprom_debugfs.patch
  16. 1 1
      package/kernel/mac80211/patches/ath/501-ath9k_ahb_init.patch
  17. 2 2
      package/kernel/mac80211/patches/ath/512-ath9k_channelbw_debugfs.patch
  18. 8 8
      package/kernel/mac80211/patches/ath/530-ath9k_extra_leds.patch
  19. 2 2
      package/kernel/mac80211/patches/ath/542-ath9k_debugfs_diag.patch
  20. 6 6
      package/kernel/mac80211/patches/ath/543-ath9k_entropy_from_adc.patch
  21. 1 1
      package/kernel/mac80211/patches/ath/545-ath9k_ani_ws_detect.patch
  22. 2 2
      package/kernel/mac80211/patches/ath/548-ath9k_enable_gpio_chip.patch
  23. 1 1
      package/kernel/mac80211/patches/ath/549-ath9k_enable_gpio_buttons.patch
  24. 1 1
      package/kernel/mac80211/patches/ath/551-ath9k_ubnt_uap_plus_hsr.patch
  25. 1 1
      package/kernel/mac80211/patches/ath/552-ahb_of.patch
  26. 0 88
      package/kernel/mac80211/patches/ath/554-ath9k-dynack-move-debug-log-after-buffer-increments.patch
  27. 0 22
      package/kernel/mac80211/patches/ath/557-ath9k-dynack-remove-experimental-tag.patch
  28. 2 2
      package/kernel/mac80211/patches/ath/921-ath10k_init_devices_synchronously.patch
  29. 3 3
      package/kernel/mac80211/patches/ath/930-ath10k_add_tpt_led_trigger.patch
  30. 1 1
      package/kernel/mac80211/patches/ath/960-0010-ath10k-limit-htt-rx-ring-size.patch
  31. 4 4
      package/kernel/mac80211/patches/ath/960-0011-ath10k-limit-pci-buffer-size.patch
  32. 5 5
      package/kernel/mac80211/patches/ath/972-ath10k_fix-crash-due-to-wrong-handling-of-peer_bw_rxnss_override-parameter.patch
  33. 2 2
      package/kernel/mac80211/patches/ath/973-ath10k_fix-band_center_freq-handling-for-VHT160-in-recent-firmwares.patch
  34. 32 40
      package/kernel/mac80211/patches/ath/974-ath10k_add-LED-and-GPIO-controlling-support-for-various-chipsets.patch
  35. 4 4
      package/kernel/mac80211/patches/ath/975-ath10k-use-tpt-trigger-by-default.patch
  36. 0 39
      package/kernel/mac80211/patches/ath/976-ath10k-Limit-available-channels-via-DT-ieee80211-fre.patch
  37. 0 89
      package/kernel/mac80211/patches/ath/977-ath10k-add-support-for-configuring-management-packet.patch
  38. 0 66
      package/kernel/mac80211/patches/ath/978-ath10k-fix-possible-out-of-bound-access-of-ath10k_ra.patch
  39. 3 3
      package/kernel/mac80211/patches/ath/979-ath10k-fix-incorrect-multicast-broadcast-rate-settin.patch
  40. 3 3
      package/kernel/mac80211/patches/ath/980-ath10k-fix-max-antenna-gain-unit.patch
  41. 5 5
      package/kernel/mac80211/patches/ath/981-ath10k-adjust-tx-power-reduction-for-US-regulatory-d.patch
  42. 2 1
      package/kernel/mac80211/patches/brcm/040-brcmutil_option.patch
  43. 0 25
      package/kernel/mac80211/patches/brcm/300-v4.20-0001-brcmfmac-add-CYW89342-mini-PCIe-device.patch
  44. 0 38
      package/kernel/mac80211/patches/brcm/302-v4.20-0001-brcmfmac-fix-wrong-strnchr-usage.patch
  45. 0 28
      package/kernel/mac80211/patches/brcm/304-v4.20-0002-brcmfmac-increase-buffer-for-obtaining-firmware-capa.patch
  46. 0 57
      package/kernel/mac80211/patches/brcm/305-v4.20-0001-brcmfmac-remove-set-but-not-used-variables-sfdoff-an.patch
  47. 0 67
      package/kernel/mac80211/patches/brcm/306-v4.20-0001-brcmfmac-reduce-timeout-for-action-frame-scan.patch
  48. 0 79
      package/kernel/mac80211/patches/brcm/306-v4.20-0002-brcmfmac-fix-full-timeout-waiting-for-action-frame-o.patch
  49. 0 102
      package/kernel/mac80211/patches/brcm/320-v5.0-0001-brcmfmac-Remove-firmware-loading-code-duplication.patch
  50. 0 127
      package/kernel/mac80211/patches/brcm/320-v5.0-0002-brcmfmac-Remove-recursion-from-firmware-load-error-h.patch
  51. 0 77
      package/kernel/mac80211/patches/brcm/320-v5.0-0003-brcmfmac-Add-support-for-first-trying-to-get-a-board.patch
  52. 0 77
      package/kernel/mac80211/patches/brcm/320-v5.0-0004-brcmfmac-Set-board_type-used-for-nvram-file-selectio.patch
  53. 0 179
      package/kernel/mac80211/patches/brcm/320-v5.0-0005-brcmfmac-Set-board_type-from-DMI-on-x86-based-machin.patch
  54. 0 41
      package/kernel/mac80211/patches/brcm/320-v5.0-0006-brcmfmac-Cleanup-brcmf_fw_request_done.patch
  55. 0 132
      package/kernel/mac80211/patches/brcm/321-v5.0-0001-brcmfmac-Add-support-for-getting-nvram-contents-from.patch
  56. 0 97
      package/kernel/mac80211/patches/brcm/321-v5.0-0002-brcmfmac-Fix-ccode-from-EFI-nvram-when-necessary.patch
  57. 0 34
      package/kernel/mac80211/patches/brcm/322-v5.0-0001-brcmfmac-fix-spelling-mistake-Retreiving-Retrieving.patch
  58. 0 83
      package/kernel/mac80211/patches/brcm/323-v5.0-0001-brcmutil-print-invalid-chanspec-when-WARN-ing.patch
  59. 0 80
      package/kernel/mac80211/patches/brcm/325-v5.0-brcmfmac-support-STA-info-struct-v7.patch
  60. 0 39
      package/kernel/mac80211/patches/brcm/326-v5.0-brcmfmac-Call-brcmf_dmi_probe-before-brcmf_of_probe.patch
  61. 0 95
      package/kernel/mac80211/patches/brcm/328-v5.0-0001-brcmfmac-add-credit-numbers-updating-support.patch
  62. 0 42
      package/kernel/mac80211/patches/brcm/328-v5.0-0002-brcmfmac-enable-frameburst-mode-in-default-firmware-.patch
  63. 0 229
      package/kernel/mac80211/patches/brcm/328-v5.0-0003-brcmfmac-handle-compressed-tx-status-signal.patch
  64. 0 36
      package/kernel/mac80211/patches/brcm/329-v5.0-0001-brcmfmac-add-4354-raw-pcie-device-id.patch
  65. 0 73
      package/kernel/mac80211/patches/brcm/329-v5.0-0002-brcmfmac-set-F2-watermark-to-256-for-4373.patch
  66. 0 55
      package/kernel/mac80211/patches/brcm/329-v5.0-0003-brcmfmac-set-SDIO-F1-MesBusyCtrl-for-CYW4373.patch
  67. 0 253
      package/kernel/mac80211/patches/brcm/329-v5.0-0004-brcmfmac-add-support-for-CYW43012-SDIO-chipset.patch
  68. 0 60
      package/kernel/mac80211/patches/brcm/329-v5.0-0005-brcmfmac-allow-GCI-core-enumuration.patch
  69. 0 49
      package/kernel/mac80211/patches/brcm/329-v5.0-0006-brcmfmac-update-43012-F2-watermark-setting-to-fix-DM.patch
  70. 0 57
      package/kernel/mac80211/patches/brcm/329-v5.0-0007-brcmfmac-4373-save-restore-support.patch
  71. 0 45
      package/kernel/mac80211/patches/brcm/329-v5.0-0008-brcmfmac-disable-command-decode-in-sdio_aos.patch
  72. 0 34
      package/kernel/mac80211/patches/brcm/330-v5.0-0001-brcmfmac-fix-false-positive-Wmaybe-unintialized-warn.patch
  73. 0 41
      package/kernel/mac80211/patches/brcm/332-v5.0-0001-brcmfmac-Fix-access-point-mode.patch
  74. 0 51
      package/kernel/mac80211/patches/brcm/340-v5.1-brcmfmac-Add-DMI-nvram-filename-quirk-for-PoV-TAB-P1.patch
  75. 0 28
      package/kernel/mac80211/patches/brcm/341-v5.1-brcmfmac-add-a-check-for-the-status-of-usb_register.patch
  76. 0 33
      package/kernel/mac80211/patches/brcm/342-v5.1-brcmfmac-fix-system-warning-message-during-wowl-susp.patch
  77. 0 104
      package/kernel/mac80211/patches/brcm/344-v5.1-brcmfmac-modify-__brcmf_err-to-take-bus-as-a-paramet.patch
  78. 0 266
      package/kernel/mac80211/patches/brcm/345-v5.1-brcmfmac-pass-bus-to-the-__brcmf_err-in-pcie.c.patch
  79. 0 2025
      package/kernel/mac80211/patches/brcm/346-v5.1-brcmfmac-add-bphy_err-and-use-it-in-the-cfg80211.c.patch
  80. 0 62
      package/kernel/mac80211/patches/brcm/347-v5.1-brcmfmac-fix-typos.patch
  81. 0 143
      package/kernel/mac80211/patches/brcm/348-v5.1-brcmfmac-support-monitor-frames-with-the-hardware-uc.patch
  82. 0 28
      package/kernel/mac80211/patches/brcm/349-v5.1-0001-brcmfmac-assure-SSID-length-from-firmware-is-limited.patch
  83. 0 96
      package/kernel/mac80211/patches/brcm/349-v5.1-0002-brcmfmac-add-subtype-check-for-event-handling-in-dat.patch
  84. 0 101
      package/kernel/mac80211/patches/brcm/349-v5.1-0003-brcmfmac-create-debugfs-files-for-bus-specific-layer.patch
  85. 0 41
      package/kernel/mac80211/patches/brcm/349-v5.1-0004-brcmfmac-disable-MBSS-feature-for-bcm4330-device.patch
  86. 0 121
      package/kernel/mac80211/patches/brcm/349-v5.1-0005-brcmfmac-check-and-dump-trap-info-during-sdio-probe.patch
  87. 0 42
      package/kernel/mac80211/patches/brcm/349-v5.1-0006-brcmfmac-use-chipname-in-brcmf_fw_alloc_request-for-.patch
  88. 0 67
      package/kernel/mac80211/patches/brcm/350-v5.1-brcmfmac-print-firmware-reported-ring-status-errors.patch
  89. 0 42
      package/kernel/mac80211/patches/brcm/351-v5.1-0001-brcmfmac-improve-code-handling-bandwidth-of-firmware.patch
  90. 0 30
      package/kernel/mac80211/patches/brcm/351-v5.1-0002-brcmfmac-support-firmware-reporting-160-MHz-channels.patch
  91. 0 2290
      package/kernel/mac80211/patches/brcm/352-v5.1-brcmfmac-rework-bphy_err-to-take-struct-brcmf_pub-ar.patch
  92. 0 38
      package/kernel/mac80211/patches/brcm/353-v5.1-brcmfmac-remove-set-but-not-used-variable-old_state.patch
  93. 0 1707
      package/kernel/mac80211/patches/brcm/354-v5.1-brcmfmac-use-bphy_err-in-all-wiphy-related-code.patch
  94. 0 38
      package/kernel/mac80211/patches/brcm/355-v5.1-brcmfmac-add-basic-validation-of-shared-RAM-address.patch
  95. 0 29
      package/kernel/mac80211/patches/brcm/356-v5.1-0001-brcmfmac-fix-size-of-the-struct-msgbuf_ring_status.patch
  96. 0 69
      package/kernel/mac80211/patches/brcm/356-v5.1-0002-brcmfmac-print-firmware-reported-general-status-erro.patch
  97. 0 32
      package/kernel/mac80211/patches/brcm/360-v5.2-0001-brcmfmac-support-repeated-brcmf_fw_alloc_request-cal.patch
  98. 0 79
      package/kernel/mac80211/patches/brcm/360-v5.2-0002-brcmfmac-add-a-function-designated-for-handling-firm.patch
  99. 0 153
      package/kernel/mac80211/patches/brcm/360-v5.2-0003-brcmfmac-reset-PCIe-bus-on-a-firmware-crash.patch
  100. 0 124
      package/kernel/mac80211/patches/brcm/361-v5.2-0001-brcmfmac-fix-WARNING-during-USB-disconnect-in-case-o.patch

+ 4 - 4
package/kernel/mac80211/Makefile

@@ -10,10 +10,10 @@ include $(INCLUDE_DIR)/kernel.mk
 
 PKG_NAME:=mac80211
 
-PKG_VERSION:=4.19.32-1
-PKG_RELEASE:=2
-PKG_SOURCE_URL:=@KERNEL/linux/kernel/projects/backports/stable/v4.19.32/
-PKG_HASH:=838db1565b54fe4bd1e769c54f30c65c9ea2fb5e99a0cddb7910561794ae317a
+PKG_VERSION:=5.2-rc7-1
+PKG_RELEASE:=1
+PKG_SOURCE_URL:=@KERNEL/linux/kernel/projects/backports/stable/v5.2-rc7/
+PKG_HASH:=3179a4ec398bd6366a4fd8a44b311a57f8da87ad10720baf7c17aef9c8ec2983
 
 PKG_SOURCE:=backports-$(PKG_VERSION).tar.xz
 PKG_BUILD_DIR:=$(KERNEL_BUILD_DIR)/backports-$(PKG_VERSION)

+ 1 - 1
package/kernel/mac80211/broadcom.mk

@@ -105,7 +105,7 @@ define KernelPackage/b43
   	CONFIG_HW_RANDOM=y
   # Depend on PCI_SUPPORT to make sure we can select kmod-bcma or kmod-ssb
   DEPENDS += \
-	@PCI_SUPPORT +kmod-mac80211 \
+	@PCI_SUPPORT +kmod-mac80211 +kmod-lib-cordic \
 	$(if $(CONFIG_PACKAGE_B43_USE_SSB),+kmod-ssb) \
 	$(if $(CONFIG_PACKAGE_B43_USE_BCMA),+kmod-bcma)
   FILES:=$(PKG_BUILD_DIR)/drivers/net/wireless/broadcom/b43/b43.ko

+ 2 - 1
package/kernel/mac80211/patches/ath/070-ath_common_config.patch

@@ -1,6 +1,7 @@
 --- a/drivers/net/wireless/ath/Kconfig
 +++ b/drivers/net/wireless/ath/Kconfig
-@@ -1,5 +1,5 @@
+@@ -1,6 +1,6 @@
+ # SPDX-License-Identifier: GPL-2.0-only
  config ATH_COMMON
 -	tristate
 +	tristate "ath.ko"

+ 2 - 2
package/kernel/mac80211/patches/ath/080-ath10k_thermal_config.patch

@@ -1,6 +1,6 @@
 --- a/drivers/net/wireless/ath/ath10k/Kconfig
 +++ b/drivers/net/wireless/ath/ath10k/Kconfig
-@@ -85,6 +85,12 @@ config ATH10K_TRACING
+@@ -87,6 +87,12 @@ config ATH10K_TRACING
  	---help---
  	  Select this to ath10k use tracing infrastructure.
  
@@ -26,7 +26,7 @@
  ath10k_core-$(CONFIG_DEV_COREDUMP) += coredump.o
 --- a/drivers/net/wireless/ath/ath10k/thermal.h
 +++ b/drivers/net/wireless/ath/ath10k/thermal.h
-@@ -36,7 +36,7 @@ struct ath10k_thermal {
+@@ -25,7 +25,7 @@ struct ath10k_thermal {
  	int temperature;
  };
  

+ 2 - 2
package/kernel/mac80211/patches/ath/356-Revert-ath9k-interpret-requested-txpower-in-EIRP-dom.patch

@@ -8,7 +8,7 @@ This reverts commit 71f5137bf010c6faffab50c0ec15374c59c4a411.
 
 --- a/drivers/net/wireless/ath/ath9k/hw.c
 +++ b/drivers/net/wireless/ath/ath9k/hw.c
-@@ -2962,7 +2962,8 @@ void ath9k_hw_apply_txpower(struct ath_h
+@@ -2963,7 +2963,8 @@ void ath9k_hw_apply_txpower(struct ath_h
  {
  	struct ath_regulatory *reg = ath9k_hw_regulatory(ah);
  	struct ieee80211_channel *channel;
@@ -18,7 +18,7 @@ This reverts commit 71f5137bf010c6faffab50c0ec15374c59c4a411.
  	u16 ctl = NO_CTL;
  
  	if (!chan)
-@@ -2974,9 +2975,14 @@ void ath9k_hw_apply_txpower(struct ath_h
+@@ -2975,9 +2976,14 @@ void ath9k_hw_apply_txpower(struct ath_h
  	channel = chan->chan;
  	chan_pwr = min_t(int, channel->max_power * 2, MAX_RATE_POWER);
  	new_pwr = min_t(int, chan_pwr, reg->power_limit);

+ 1 - 1
package/kernel/mac80211/patches/ath/365-ath9k-adjust-tx-power-reduction-for-US-regulatory-do.patch

@@ -11,7 +11,7 @@ Signed-off-by: Felix Fietkau <[email protected]>
 
 --- a/drivers/net/wireless/ath/ath9k/hw.c
 +++ b/drivers/net/wireless/ath/ath9k/hw.c
-@@ -2981,6 +2981,10 @@ void ath9k_hw_apply_txpower(struct ath_h
+@@ -2982,6 +2982,10 @@ void ath9k_hw_apply_txpower(struct ath_h
  	if (ant_gain > max_gain)
  		ant_reduction = ant_gain - max_gain;
  

+ 0 - 92
package/kernel/mac80211/patches/ath/381-ath9k-fix-tx99-with-monitor-mode-interface.patch

@@ -1,92 +0,0 @@
-From: Felix Fietkau <[email protected]>
-Date: Mon, 20 Aug 2018 11:35:05 +0200
-Subject: [PATCH] ath9k: fix tx99 with monitor mode interface
-
-Tx99 is typically configured via a monitor mode interface, which does
-not get added to the driver as a vif. Since the code currently expects
-a configured virtual interface for tx99, enabling tx99 via debugfs fails.
-Since the vif is not needed anyway, remove all checks for it.
-
-Signed-off-by: Felix Fietkau <[email protected]>
----
-
---- a/drivers/net/wireless/ath/ath9k/ath9k.h
-+++ b/drivers/net/wireless/ath/ath9k/ath9k.h
-@@ -1074,7 +1074,6 @@ struct ath_softc {
- 
- 	struct ath_spec_scan_priv spec_priv;
- 
--	struct ieee80211_vif *tx99_vif;
- 	struct sk_buff *tx99_skb;
- 	bool tx99_state;
- 	s16 tx99_power;
---- a/drivers/net/wireless/ath/ath9k/main.c
-+++ b/drivers/net/wireless/ath/ath9k/main.c
-@@ -1251,15 +1251,10 @@ static int ath9k_add_interface(struct ie
- 	struct ath_vif *avp = (void *)vif->drv_priv;
- 	struct ath_node *an = &avp->mcast_node;
- 
--	mutex_lock(&sc->mutex);
-+	if (IS_ENABLED(CPTCFG_ATH9K_TX99))
-+		return -EOPNOTSUPP;
- 
--	if (IS_ENABLED(CPTCFG_ATH9K_TX99)) {
--		if (sc->cur_chan->nvifs >= 1) {
--			mutex_unlock(&sc->mutex);
--			return -EOPNOTSUPP;
--		}
--		sc->tx99_vif = vif;
--	}
-+	mutex_lock(&sc->mutex);
- 
- 	ath_dbg(common, CONFIG, "Attach a VIF of type: %d\n", vif->type);
- 	sc->cur_chan->nvifs++;
-@@ -1342,7 +1337,6 @@ static void ath9k_remove_interface(struc
- 	ath9k_p2p_remove_vif(sc, vif);
- 
- 	sc->cur_chan->nvifs--;
--	sc->tx99_vif = NULL;
- 	if (!ath9k_is_chanctx_enabled())
- 		list_del(&avp->list);
- 
---- a/drivers/net/wireless/ath/ath9k/tx99.c
-+++ b/drivers/net/wireless/ath/ath9k/tx99.c
-@@ -54,12 +54,6 @@ static struct sk_buff *ath9k_build_tx99_
- 	struct ieee80211_hdr *hdr;
- 	struct ieee80211_tx_info *tx_info;
- 	struct sk_buff *skb;
--	struct ath_vif *avp;
--
--	if (!sc->tx99_vif)
--		return NULL;
--
--	avp = (struct ath_vif *)sc->tx99_vif->drv_priv;
- 
- 	skb = alloc_skb(len, GFP_KERNEL);
- 	if (!skb)
-@@ -77,14 +71,11 @@ static struct sk_buff *ath9k_build_tx99_
- 	memcpy(hdr->addr2, hw->wiphy->perm_addr, ETH_ALEN);
- 	memcpy(hdr->addr3, hw->wiphy->perm_addr, ETH_ALEN);
- 
--	hdr->seq_ctrl |= cpu_to_le16(avp->seq_no);
--
- 	tx_info = IEEE80211_SKB_CB(skb);
- 	memset(tx_info, 0, sizeof(*tx_info));
- 	rate = &tx_info->control.rates[0];
- 	tx_info->band = sc->cur_chan->chandef.chan->band;
- 	tx_info->flags = IEEE80211_TX_CTL_NO_ACK;
--	tx_info->control.vif = sc->tx99_vif;
- 	rate->count = 1;
- 	if (ah->curchan && IS_CHAN_HT(ah->curchan)) {
- 		rate->flags |= IEEE80211_TX_RC_MCS;
---- a/drivers/net/wireless/ath/ath9k/xmit.c
-+++ b/drivers/net/wireless/ath/ath9k/xmit.c
-@@ -2974,7 +2974,7 @@ int ath9k_tx99_send(struct ath_softc *sc
- 		return -EINVAL;
- 	}
- 
--	ath_set_rates(sc->tx99_vif, NULL, bf);
-+	ath_set_rates(NULL, NULL, bf);
- 
- 	ath9k_hw_set_desc_link(sc->sc_ah, bf->bf_desc, bf->bf_daddr);
- 	ath9k_hw_tx99_start(sc->sc_ah, txctl->txq->axq_qnum);

+ 0 - 96
package/kernel/mac80211/patches/ath/395-ath9k-add-back-support-for-using-active-monitor-inte.patch

@@ -1,96 +0,0 @@
-From: Felix Fietkau <[email protected]>
-Date: Sat, 22 Sep 2018 15:20:50 +0200
-Subject: [PATCH] ath9k: add back support for using active monitor interfaces
- for tx99
-
-Various documented examples on how to set up tx99 with ath9k rely
-on setting up a regular monitor interface for setting the channel.
-My previous patch "ath9k: fix tx99 with monitor mode interface" made
-it possible to set it up this way again. However, it was removing support
-for using an active monitor interface, which is required for controlling
-the bitrate as well, since the bitrate is not passed down with a regular
-monitor interface.
-
-This patch partially reverts the previous one, but keeps support for using
-a regular monitor interface to keep documented steps working in cases
-where the bitrate does not matter
-
-Fixes: d9c52fd17cb48 ("ath9k: fix tx99 with monitor mode interface")
-Signed-off-by: Felix Fietkau <[email protected]>
----
-
---- a/drivers/net/wireless/ath/ath9k/ath9k.h
-+++ b/drivers/net/wireless/ath/ath9k/ath9k.h
-@@ -1074,6 +1074,7 @@ struct ath_softc {
- 
- 	struct ath_spec_scan_priv spec_priv;
- 
-+	struct ieee80211_vif *tx99_vif;
- 	struct sk_buff *tx99_skb;
- 	bool tx99_state;
- 	s16 tx99_power;
---- a/drivers/net/wireless/ath/ath9k/main.c
-+++ b/drivers/net/wireless/ath/ath9k/main.c
-@@ -1251,8 +1251,13 @@ static int ath9k_add_interface(struct ie
- 	struct ath_vif *avp = (void *)vif->drv_priv;
- 	struct ath_node *an = &avp->mcast_node;
- 
--	if (IS_ENABLED(CPTCFG_ATH9K_TX99))
--		return -EOPNOTSUPP;
-+	if (IS_ENABLED(CPTCFG_ATH9K_TX99)) {
-+		if (sc->cur_chan->nvifs >= 1) {
-+			mutex_unlock(&sc->mutex);
-+			return -EOPNOTSUPP;
-+		}
-+		sc->tx99_vif = vif;
-+	}
- 
- 	mutex_lock(&sc->mutex);
- 
-@@ -1337,6 +1342,7 @@ static void ath9k_remove_interface(struc
- 	ath9k_p2p_remove_vif(sc, vif);
- 
- 	sc->cur_chan->nvifs--;
-+	sc->tx99_vif = NULL;
- 	if (!ath9k_is_chanctx_enabled())
- 		list_del(&avp->list);
- 
---- a/drivers/net/wireless/ath/ath9k/tx99.c
-+++ b/drivers/net/wireless/ath/ath9k/tx99.c
-@@ -54,6 +54,7 @@ static struct sk_buff *ath9k_build_tx99_
- 	struct ieee80211_hdr *hdr;
- 	struct ieee80211_tx_info *tx_info;
- 	struct sk_buff *skb;
-+	struct ath_vif *avp;
- 
- 	skb = alloc_skb(len, GFP_KERNEL);
- 	if (!skb)
-@@ -71,11 +72,17 @@ static struct sk_buff *ath9k_build_tx99_
- 	memcpy(hdr->addr2, hw->wiphy->perm_addr, ETH_ALEN);
- 	memcpy(hdr->addr3, hw->wiphy->perm_addr, ETH_ALEN);
- 
-+	if (sc->tx99_vif) {
-+		avp = (struct ath_vif *) sc->tx99_vif->drv_priv;
-+		hdr->seq_ctrl |= cpu_to_le16(avp->seq_no);
-+	}
-+
- 	tx_info = IEEE80211_SKB_CB(skb);
- 	memset(tx_info, 0, sizeof(*tx_info));
- 	rate = &tx_info->control.rates[0];
- 	tx_info->band = sc->cur_chan->chandef.chan->band;
- 	tx_info->flags = IEEE80211_TX_CTL_NO_ACK;
-+	tx_info->control.vif = sc->tx99_vif;
- 	rate->count = 1;
- 	if (ah->curchan && IS_CHAN_HT(ah->curchan)) {
- 		rate->flags |= IEEE80211_TX_RC_MCS;
---- a/drivers/net/wireless/ath/ath9k/xmit.c
-+++ b/drivers/net/wireless/ath/ath9k/xmit.c
-@@ -2974,7 +2974,7 @@ int ath9k_tx99_send(struct ath_softc *sc
- 		return -EINVAL;
- 	}
- 
--	ath_set_rates(NULL, NULL, bf);
-+	ath_set_rates(sc->tx99_vif, NULL, bf);
- 
- 	ath9k_hw_set_desc_link(sc->sc_ah, bf->bf_desc, bf->bf_daddr);
- 	ath9k_hw_tx99_start(sc->sc_ah, txctl->txq->axq_qnum);

+ 1 - 1
package/kernel/mac80211/patches/ath/402-ath_regd_optional.patch

@@ -70,7 +70,7 @@
  
 --- a/drivers/net/wireless/ath/Kconfig
 +++ b/drivers/net/wireless/ath/Kconfig
-@@ -23,6 +23,9 @@ config WLAN_VENDOR_ATH
+@@ -24,6 +24,9 @@ config WLAN_VENDOR_ATH
  
  if WLAN_VENDOR_ATH
  

+ 5 - 5
package/kernel/mac80211/patches/ath/404-regd_no_assoc_hints.patch

@@ -1,6 +1,6 @@
 --- a/net/wireless/reg.c
 +++ b/net/wireless/reg.c
-@@ -2982,6 +2982,8 @@ void regulatory_hint_country_ie(struct w
+@@ -3032,6 +3032,8 @@ void regulatory_hint_country_ie(struct w
  	enum environment_cap env = ENVIRON_ANY;
  	struct regulatory_request *request = NULL, *lr;
  
@@ -9,11 +9,11 @@
  	/* IE len must be evenly divisible by 2 */
  	if (country_ie_len & 0x01)
  		return;
-@@ -3188,6 +3190,7 @@ static void restore_regulatory_settings(
+@@ -3283,6 +3285,7 @@ static bool is_wiphy_all_set_reg_flag(en
  
  void regulatory_hint_disconnect(void)
  {
 +	return;
- 	pr_debug("All devices are disconnected, going to restore regulatory settings\n");
- 	restore_regulatory_settings(false);
- }
+ 	/* Restore of regulatory settings is not required when wiphy(s)
+ 	 * ignore IE from connected access point but clearance of beacon hints
+ 	 * is required when wiphy(s) supports beacon hints.

+ 2 - 2
package/kernel/mac80211/patches/ath/405-ath_regd_us.patch

@@ -21,6 +21,6 @@
  	{CTRY_UNITED_KINGDOM, ETSI1_WORLD, "GB"},
  	{CTRY_UNITED_STATES, FCC3_FCCA, "US"},
 +	{CTRY_UNITED_STATES, FCC3_FCCA_2, "US"},
+ 	{CTRY_UNITED_STATES2, FCC3_FCCA, "US"},
+ 	{CTRY_UNITED_STATES3, FCC3_FCCA, "US"},
  	/* This "PS" is for US public safety actually... to support this we
- 	 * would need to assign new special alpha2 to CRDA db as with the world
- 	 * regdomain and use another alpha2 */

+ 0 - 35
package/kernel/mac80211/patches/ath/407-regd_add_extra_country_codes.patch

@@ -1,35 +0,0 @@
-From: Oever Gonzalez <[email protected]>
-Date: Mon, 7 Jan 2019 01:07:12 +0200
-Subject: [PATCH] ath: regd: add extra coutry codes
-
-This patch adds several country codes to the regd.h and regd_common.h
-files in order to support devices whose country codes are not present in
-the original list. Without this patch, all devices whose manufacturer
-programmed any of these code in their EEPROM will not work.
-
-Signed-off-by: Oever Gonzalez <[email protected]>
----
-
---- a/drivers/net/wireless/ath/regd.h
-+++ b/drivers/net/wireless/ath/regd.h
-@@ -185,7 +185,9 @@ enum CountryCode {
- 	CTRY_UKRAINE = 804,
- 	CTRY_UNITED_KINGDOM = 826,
- 	CTRY_UNITED_STATES = 840,
-+	CTRY_UNITED_STATES2 = 841,
- 	CTRY_UNITED_STATES_FCC49 = 842,
-+	CTRY_UNITED_STATES3 = 843,
- 	CTRY_URUGUAY = 858,
- 	CTRY_UZBEKISTAN = 860,
- 	CTRY_VENEZUELA = 862,
---- a/drivers/net/wireless/ath/regd_common.h
-+++ b/drivers/net/wireless/ath/regd_common.h
-@@ -486,6 +486,8 @@ static struct country_code_to_enum_rd al
- 	{CTRY_UNITED_KINGDOM, ETSI1_WORLD, "GB"},
- 	{CTRY_UNITED_STATES, FCC3_FCCA, "US"},
- 	{CTRY_UNITED_STATES, FCC3_FCCA_2, "US"},
-+	{CTRY_UNITED_STATES2, FCC3_FCCA, "US"},
-+	{CTRY_UNITED_STATES3, FCC3_FCCA, "US"},
- 	/* This "PS" is for US public safety actually... to support this we
- 	 * would need to assign new special alpha2 to CRDA db as with the world
- 	 * regdomain and use another alpha2 */

+ 1 - 1
package/kernel/mac80211/patches/ath/410-ath9k_allow_adhoc_and_ap.patch

@@ -1,6 +1,6 @@
 --- a/drivers/net/wireless/ath/ath9k/init.c
 +++ b/drivers/net/wireless/ath/ath9k/init.c
-@@ -833,6 +833,7 @@ static const struct ieee80211_iface_limi
+@@ -831,6 +831,7 @@ static const struct ieee80211_iface_limi
  				 BIT(NL80211_IFTYPE_AP) },
  	{ .max = 1,	.types = BIT(NL80211_IFTYPE_P2P_CLIENT) |
  				 BIT(NL80211_IFTYPE_P2P_GO) },

+ 3 - 3
package/kernel/mac80211/patches/ath/411-ath5k_allow_adhoc_and_ap.patch

@@ -18,7 +18,7 @@
  		goto end;
 --- a/drivers/net/wireless/ath/ath5k/base.c
 +++ b/drivers/net/wireless/ath/ath5k/base.c
-@@ -1965,7 +1965,7 @@ ath5k_beacon_send(struct ath5k_hw *ah)
+@@ -1964,7 +1964,7 @@ ath5k_beacon_send(struct ath5k_hw *ah)
  	}
  
  	if ((ah->opmode == NL80211_IFTYPE_AP && ah->num_ap_vifs +
@@ -27,7 +27,7 @@
  			ah->opmode == NL80211_IFTYPE_MESH_POINT) {
  		u64 tsf = ath5k_hw_get_tsf64(ah);
  		u32 tsftu = TSF_TO_TU(tsf);
-@@ -2051,7 +2051,7 @@ ath5k_beacon_update_timers(struct ath5k_
+@@ -2050,7 +2050,7 @@ ath5k_beacon_update_timers(struct ath5k_
  
  	intval = ah->bintval & AR5K_BEACON_PERIOD;
  	if (ah->opmode == NL80211_IFTYPE_AP && ah->num_ap_vifs
@@ -36,7 +36,7 @@
  		intval /= ATH_BCBUF;	/* staggered multi-bss beacons */
  		if (intval < 15)
  			ATH5K_WARN(ah, "intval %u is too low, min 15\n",
-@@ -2518,6 +2518,7 @@ static const struct ieee80211_iface_limi
+@@ -2516,6 +2516,7 @@ static const struct ieee80211_iface_limi
  				 BIT(NL80211_IFTYPE_MESH_POINT) |
  #endif
  				 BIT(NL80211_IFTYPE_AP) },

+ 2 - 2
package/kernel/mac80211/patches/ath/500-ath9k_eeprom_debugfs.patch

@@ -1,6 +1,6 @@
 --- a/drivers/net/wireless/ath/ath9k/debug.c
 +++ b/drivers/net/wireless/ath/ath9k/debug.c
-@@ -1374,6 +1374,53 @@ void ath9k_deinit_debug(struct ath_softc
+@@ -1361,6 +1361,53 @@ void ath9k_deinit_debug(struct ath_softc
  	ath9k_cmn_spectral_deinit_debug(&sc->spec_priv);
  }
  
@@ -54,7 +54,7 @@
  int ath9k_init_debug(struct ath_hw *ah)
  {
  	struct ath_common *common = ath9k_hw_common(ah);
-@@ -1393,6 +1440,8 @@ int ath9k_init_debug(struct ath_hw *ah)
+@@ -1380,6 +1427,8 @@ int ath9k_init_debug(struct ath_hw *ah)
  	ath9k_tx99_init_debug(sc);
  	ath9k_cmn_spectral_init_debug(&sc->spec_priv, sc->debug.debugfs_phy);
  

+ 1 - 1
package/kernel/mac80211/patches/ath/501-ath9k_ahb_init.patch

@@ -1,6 +1,6 @@
 --- a/drivers/net/wireless/ath/ath9k/init.c
 +++ b/drivers/net/wireless/ath/ath9k/init.c
-@@ -1144,25 +1144,25 @@ static int __init ath9k_init(void)
+@@ -1143,25 +1143,25 @@ static int __init ath9k_init(void)
  {
  	int error;
  

+ 2 - 2
package/kernel/mac80211/patches/ath/512-ath9k_channelbw_debugfs.patch

@@ -1,6 +1,6 @@
 --- a/drivers/net/wireless/ath/ath9k/debug.c
 +++ b/drivers/net/wireless/ath/ath9k/debug.c
-@@ -1421,6 +1421,52 @@ static const struct file_operations fops
+@@ -1408,6 +1408,52 @@ static const struct file_operations fops
  	.owner = THIS_MODULE
  };
  
@@ -53,7 +53,7 @@
  int ath9k_init_debug(struct ath_hw *ah)
  {
  	struct ath_common *common = ath9k_hw_common(ah);
-@@ -1442,6 +1488,8 @@ int ath9k_init_debug(struct ath_hw *ah)
+@@ -1429,6 +1475,8 @@ int ath9k_init_debug(struct ath_hw *ah)
  
  	debugfs_create_file("eeprom", S_IRUSR, sc->debug.debugfs_phy, sc,
  			    &fops_eeprom);

+ 8 - 8
package/kernel/mac80211/patches/ath/530-ath9k_extra_leds.patch

@@ -1,6 +1,6 @@
 --- a/drivers/net/wireless/ath/ath9k/ath9k.h
 +++ b/drivers/net/wireless/ath/ath9k/ath9k.h
-@@ -850,6 +850,9 @@ static inline int ath9k_dump_btcoex(stru
+@@ -843,6 +843,9 @@ static inline int ath9k_dump_btcoex(stru
  #ifdef CPTCFG_MAC80211_LEDS
  void ath_init_leds(struct ath_softc *sc);
  void ath_deinit_leds(struct ath_softc *sc);
@@ -10,9 +10,9 @@
  #else
  static inline void ath_init_leds(struct ath_softc *sc)
  {
-@@ -991,6 +994,13 @@ void ath_ant_comb_scan(struct ath_softc
- #define AIRTIME_USE_NEW_QUEUES	BIT(2)
- #define AIRTIME_ACTIVE(flags) (!!(flags & (AIRTIME_USE_TX|AIRTIME_USE_RX)))
+@@ -979,6 +982,13 @@ void ath_ant_comb_scan(struct ath_softc
+ 
+ #define ATH9K_NUM_CHANCTX  2 /* supports 2 operating channels */
  
 +struct ath_led {
 +	struct list_head list;
@@ -24,7 +24,7 @@
  struct ath_softc {
  	struct ieee80211_hw *hw;
  	struct device *dev;
-@@ -1046,9 +1056,8 @@ struct ath_softc {
+@@ -1032,9 +1042,8 @@ struct ath_softc {
  	spinlock_t chan_lock;
  
  #ifdef CPTCFG_MAC80211_LEDS
@@ -181,7 +181,7 @@
  
 --- a/drivers/net/wireless/ath/ath9k/init.c
 +++ b/drivers/net/wireless/ath/ath9k/init.c
-@@ -1056,7 +1056,7 @@ int ath9k_init_device(u16 devid, struct
+@@ -1055,7 +1055,7 @@ int ath9k_init_device(u16 devid, struct
  
  #ifdef CPTCFG_MAC80211_LEDS
  	/* must be initialized before ieee80211_register_hw */
@@ -192,7 +192,7 @@
  #endif
 --- a/drivers/net/wireless/ath/ath9k/debug.c
 +++ b/drivers/net/wireless/ath/ath9k/debug.c
-@@ -1466,6 +1466,61 @@ static const struct file_operations fops
+@@ -1453,6 +1453,61 @@ static const struct file_operations fops
  	.llseek = default_llseek,
  };
  
@@ -254,7 +254,7 @@
  
  int ath9k_init_debug(struct ath_hw *ah)
  {
-@@ -1490,6 +1545,10 @@ int ath9k_init_debug(struct ath_hw *ah)
+@@ -1477,6 +1532,10 @@ int ath9k_init_debug(struct ath_hw *ah)
  			    &fops_eeprom);
  	debugfs_create_file("chanbw", S_IRUSR | S_IWUSR, sc->debug.debugfs_phy,
  			    sc, &fops_chanbw);

+ 2 - 2
package/kernel/mac80211/patches/ath/542-ath9k_debugfs_diag.patch

@@ -1,6 +1,6 @@
 --- a/drivers/net/wireless/ath/ath9k/debug.c
 +++ b/drivers/net/wireless/ath/ath9k/debug.c
-@@ -1522,6 +1522,50 @@ static const struct file_operations fops
+@@ -1509,6 +1509,50 @@ static const struct file_operations fops
  #endif
  
  
@@ -51,7 +51,7 @@
  int ath9k_init_debug(struct ath_hw *ah)
  {
  	struct ath_common *common = ath9k_hw_common(ah);
-@@ -1549,6 +1593,8 @@ int ath9k_init_debug(struct ath_hw *ah)
+@@ -1536,6 +1580,8 @@ int ath9k_init_debug(struct ath_hw *ah)
  	debugfs_create_file("gpio_led", S_IWUSR,
  			   sc->debug.debugfs_phy, sc, &fops_gpio_led);
  #endif

+ 6 - 6
package/kernel/mac80211/patches/ath/543-ath9k_entropy_from_adc.patch

@@ -55,7 +55,7 @@
  	ops->spectral_scan_config = ar9003_hw_spectral_scan_config;
 --- a/drivers/net/wireless/ath/ath9k/init.c
 +++ b/drivers/net/wireless/ath/ath9k/init.c
-@@ -821,7 +821,8 @@ static void ath9k_init_txpower_limits(st
+@@ -819,7 +819,8 @@ static void ath9k_init_txpower_limits(st
  	if (ah->caps.hw_caps & ATH9K_HW_CAP_5GHZ)
  		ath9k_init_band_txpower(sc, NL80211_BAND_5GHZ);
  
@@ -65,8 +65,8 @@
  }
  
  static const struct ieee80211_iface_limit if_limits[] = {
-@@ -1016,6 +1017,18 @@ static void ath9k_set_hw_capab(struct at
- 	wiphy_ext_feature_set(hw->wiphy, NL80211_EXT_FEATURE_CQM_RSSI_LIST);
+@@ -1015,6 +1016,18 @@ static void ath9k_set_hw_capab(struct at
+ 	wiphy_ext_feature_set(hw->wiphy, NL80211_EXT_FEATURE_AIRTIME_FAIRNESS);
  }
  
 +static void ath_get_initial_entropy(struct ath_softc *sc)
@@ -84,7 +84,7 @@
  int ath9k_init_device(u16 devid, struct ath_softc *sc,
  		    const struct ath_bus_ops *bus_ops)
  {
-@@ -1061,6 +1074,8 @@ int ath9k_init_device(u16 devid, struct
+@@ -1060,6 +1073,8 @@ int ath9k_init_device(u16 devid, struct
  		ARRAY_SIZE(ath9k_tpt_blink));
  #endif
  
@@ -110,7 +110,7 @@
  static inline void ath9k_hw_set_bt_ant_diversity(struct ath_hw *ah, bool enable)
 --- a/drivers/net/wireless/ath/ath9k/ar5008_phy.c
 +++ b/drivers/net/wireless/ath/ath9k/ar5008_phy.c
-@@ -1324,9 +1324,30 @@ void ar5008_hw_init_rate_txpower(struct
+@@ -1320,9 +1320,30 @@ void ar5008_hw_init_rate_txpower(struct
  	}
  }
  
@@ -141,7 +141,7 @@
  	static const u32 ar5416_cca_regs[6] = {
  		AR_PHY_CCA,
  		AR_PHY_CH1_CCA,
-@@ -1341,6 +1362,8 @@ int ar5008_hw_attach_phy_ops(struct ath_
+@@ -1337,6 +1358,8 @@ int ar5008_hw_attach_phy_ops(struct ath_
  	if (ret)
  	    return ret;
  

+ 1 - 1
package/kernel/mac80211/patches/ath/545-ath9k_ani_ws_detect.patch

@@ -1,6 +1,6 @@
 --- a/drivers/net/wireless/ath/ath9k/ar5008_phy.c
 +++ b/drivers/net/wireless/ath/ath9k/ar5008_phy.c
-@@ -953,55 +953,6 @@ static bool ar5008_hw_ani_control_new(st
+@@ -949,55 +949,6 @@ static bool ar5008_hw_ani_control_new(st
  		 * on == 0 means more noise imm
  		 */
  		u32 on = param ? 1 : 0;

+ 2 - 2
package/kernel/mac80211/patches/ath/548-ath9k_enable_gpio_chip.patch

@@ -18,7 +18,7 @@ Signed-off-by: Felix Fietkau <[email protected]>
  
  #include "common.h"
  #include "debug.h"
-@@ -1001,6 +1002,14 @@ struct ath_led {
+@@ -989,6 +990,14 @@ struct ath_led {
  	struct led_classdev cdev;
  };
  
@@ -33,7 +33,7 @@ Signed-off-by: Felix Fietkau <[email protected]>
  struct ath_softc {
  	struct ieee80211_hw *hw;
  	struct device *dev;
-@@ -1058,6 +1067,9 @@ struct ath_softc {
+@@ -1044,6 +1053,9 @@ struct ath_softc {
  #ifdef CPTCFG_MAC80211_LEDS
  	const char *led_default_trigger;
  	struct list_head leds;

+ 1 - 1
package/kernel/mac80211/patches/ath/549-ath9k_enable_gpio_buttons.patch

@@ -10,7 +10,7 @@ Signed-off-by: Felix Fietkau <[email protected]>
 ---
 --- a/drivers/net/wireless/ath/ath9k/ath9k.h
 +++ b/drivers/net/wireless/ath/ath9k/ath9k.h
-@@ -1069,6 +1069,7 @@ struct ath_softc {
+@@ -1055,6 +1055,7 @@ struct ath_softc {
  	struct list_head leds;
  #ifdef CONFIG_GPIOLIB
  	struct ath9k_gpio_chip *gpiochip;

+ 1 - 1
package/kernel/mac80211/patches/ath/551-ath9k_ubnt_uap_plus_hsr.patch

@@ -396,7 +396,7 @@
  ATH9K_HWRNG=
 --- a/drivers/net/wireless/ath/ath9k/Kconfig
 +++ b/drivers/net/wireless/ath/ath9k/Kconfig
-@@ -59,6 +59,19 @@ config ATH9K_AHB
+@@ -60,6 +60,19 @@ config ATH9K_AHB
  	  Say Y, if you have a SoC with a compatible built-in
  	  wireless MAC. Say N if unsure.
  

+ 1 - 1
package/kernel/mac80211/patches/ath/552-ahb_of.patch

@@ -318,7 +318,7 @@
  
  #include "common.h"
  #include "debug.h"
-@@ -1023,6 +1024,9 @@ struct ath_softc {
+@@ -1011,6 +1012,9 @@ struct ath_softc {
  	struct ath_hw *sc_ah;
  	void __iomem *mem;
  	int irq;

+ 0 - 88
package/kernel/mac80211/patches/ath/554-ath9k-dynack-move-debug-log-after-buffer-increments.patch

@@ -1,88 +0,0 @@
-From: Lorenzo Bianconi <[email protected]>
-Date: Fri, 2 Nov 2018 21:49:56 +0100
-Subject: [PATCH] ath9k: dynack: move debug log after buffer increments
-
-Move debug log in ath_dynack_sample_tx_ts and ath_dynack_sample_ack_ts
-after timestamp buffer head/tail increments in order to make debugging
-more user friendly
-
-Tested-by: Koen Vandeputte <[email protected]>
-Signed-off-by: Lorenzo Bianconi <[email protected]>
----
-
---- a/drivers/net/wireless/ath/ath9k/dynack.c
-+++ b/drivers/net/wireless/ath/ath9k/dynack.c
-@@ -178,11 +178,12 @@ void ath_dynack_sample_tx_ts(struct ath_
- 			     struct ath_tx_status *ts,
- 			     struct ieee80211_sta *sta)
- {
--	u8 ridx;
- 	struct ieee80211_hdr *hdr;
- 	struct ath_dynack *da = &ah->dynack;
- 	struct ath_common *common = ath9k_hw_common(ah);
- 	struct ieee80211_tx_info *info = IEEE80211_SKB_CB(skb);
-+	u32 dur = ts->duration;
-+	u8 ridx;
- 
- 	if (!da->enabled || (info->flags & IEEE80211_TX_CTL_NO_ACK))
- 		return;
-@@ -217,14 +218,13 @@ void ath_dynack_sample_tx_ts(struct ath_
- 	ridx = ts->ts_rateindex;
- 
- 	da->st_rbf.ts[da->st_rbf.t_rb].tstamp = ts->ts_tstamp;
--	da->st_rbf.ts[da->st_rbf.t_rb].dur = ts->duration;
- 	ether_addr_copy(da->st_rbf.addr[da->st_rbf.t_rb].h_dest, hdr->addr1);
- 	ether_addr_copy(da->st_rbf.addr[da->st_rbf.t_rb].h_src, hdr->addr2);
- 
- 	if (!(info->status.rates[ridx].flags & IEEE80211_TX_RC_MCS)) {
--		u32 phy, sifs;
- 		const struct ieee80211_rate *rate;
- 		struct ieee80211_tx_rate *rates = info->status.rates;
-+		u32 phy;
- 
- 		rate = &common->sbands[info->band].bitrates[rates[ridx].idx];
- 		if (info->band == NL80211_BAND_2GHZ &&
-@@ -233,19 +233,18 @@ void ath_dynack_sample_tx_ts(struct ath_
- 		else
- 			phy = WLAN_RC_PHY_OFDM;
- 
--		sifs = ath_dynack_get_sifs(ah, phy);
--		da->st_rbf.ts[da->st_rbf.t_rb].dur -= sifs;
-+		dur -= ath_dynack_get_sifs(ah, phy);
- 	}
--
--	ath_dbg(common, DYNACK, "{%pM} tx sample %u [dur %u][h %u-t %u]\n",
--		hdr->addr1, da->st_rbf.ts[da->st_rbf.t_rb].tstamp,
--		da->st_rbf.ts[da->st_rbf.t_rb].dur, da->st_rbf.h_rb,
--		(da->st_rbf.t_rb + 1) % ATH_DYN_BUF);
-+	da->st_rbf.ts[da->st_rbf.t_rb].dur = dur;
- 
- 	INCR(da->st_rbf.t_rb, ATH_DYN_BUF);
- 	if (da->st_rbf.t_rb == da->st_rbf.h_rb)
- 		INCR(da->st_rbf.h_rb, ATH_DYN_BUF);
- 
-+	ath_dbg(common, DYNACK, "{%pM} tx sample %u [dur %u][h %u-t %u]\n",
-+		hdr->addr1, ts->ts_tstamp, dur, da->st_rbf.h_rb,
-+		da->st_rbf.t_rb);
-+
- 	ath_dynack_compute_to(ah);
- 
- 	spin_unlock_bh(&da->qlock);
-@@ -272,14 +271,13 @@ void ath_dynack_sample_ack_ts(struct ath
- 	spin_lock_bh(&da->qlock);
- 	da->ack_rbf.tstamp[da->ack_rbf.t_rb] = ts;
- 
--	ath_dbg(common, DYNACK, "rx sample %u [h %u-t %u]\n",
--		da->ack_rbf.tstamp[da->ack_rbf.t_rb],
--		da->ack_rbf.h_rb, (da->ack_rbf.t_rb + 1) % ATH_DYN_BUF);
--
- 	INCR(da->ack_rbf.t_rb, ATH_DYN_BUF);
- 	if (da->ack_rbf.t_rb == da->ack_rbf.h_rb)
- 		INCR(da->ack_rbf.h_rb, ATH_DYN_BUF);
- 
-+	ath_dbg(common, DYNACK, "rx sample %u [h %u-t %u]\n",
-+		ts, da->ack_rbf.h_rb, da->ack_rbf.t_rb);
-+
- 	ath_dynack_compute_to(ah);
- 
- 	spin_unlock_bh(&da->qlock);

+ 0 - 22
package/kernel/mac80211/patches/ath/557-ath9k-dynack-remove-experimental-tag.patch

@@ -1,22 +0,0 @@
-From: Lorenzo Bianconi <[email protected]>
-Date: Fri, 2 Nov 2018 21:49:59 +0100
-Subject: [PATCH] ath9k: dynack: remove 'experimental' tag
-
-Remove experimental tag from dynack Kconfig entry since it has
-been tested on outdoor 25Km links
-
-Tested-by: Koen Vandeputte <[email protected]>
-Signed-off-by: Lorenzo Bianconi <[email protected]>
----
-
---- a/drivers/net/wireless/ath/ath9k/Kconfig
-+++ b/drivers/net/wireless/ath/ath9k/Kconfig
-@@ -132,7 +132,7 @@ config ATH9K_DFS_CERTIFIED
- 	  except increase code size.
- 
- config ATH9K_DYNACK
--	bool "Atheros ath9k ACK timeout estimation algorithm (EXPERIMENTAL)"
-+	bool "Atheros ath9k ACK timeout estimation algorithm"
- 	depends on ATH9K
- 	default n
- 	---help---

+ 2 - 2
package/kernel/mac80211/patches/ath/921-ath10k_init_devices_synchronously.patch

@@ -14,8 +14,8 @@ Signed-off-by: Sven Eckelmann <[email protected]>
 
 --- a/drivers/net/wireless/ath/ath10k/core.c
 +++ b/drivers/net/wireless/ath/ath10k/core.c
-@@ -2720,6 +2720,16 @@ int ath10k_core_register(struct ath10k *
- 	ar->chip_id = chip_id;
+@@ -3003,6 +3003,16 @@ int ath10k_core_register(struct ath10k *
+ 
  	queue_work(ar->workqueue, &ar->register_work);
  
 +	/* OpenWrt requires all PHYs to be initialized to create the

+ 3 - 3
package/kernel/mac80211/patches/ath/930-ath10k_add_tpt_led_trigger.patch

@@ -1,6 +1,6 @@
 --- a/drivers/net/wireless/ath/ath10k/mac.c
 +++ b/drivers/net/wireless/ath/ath10k/mac.c
-@@ -8282,6 +8282,21 @@ static int ath10k_mac_init_rd(struct ath
+@@ -8483,6 +8483,21 @@ static int ath10k_mac_init_rd(struct ath
  	return 0;
  }
  
@@ -22,9 +22,9 @@
  int ath10k_mac_register(struct ath10k *ar)
  {
  	static const u32 cipher_suites[] = {
-@@ -8571,6 +8586,12 @@ int ath10k_mac_register(struct ath10k *a
+@@ -8806,6 +8821,12 @@ int ath10k_mac_register(struct ath10k *a
  
- 	wiphy_ext_feature_set(ar->hw->wiphy, NL80211_EXT_FEATURE_CQM_RSSI_LIST);
+ 	ar->hw->weight_multiplier = ATH10K_AIRTIME_WEIGHT_MULTIPLIER;
  
 +#ifdef CPTCFG_MAC80211_LEDS
 +	ieee80211_create_tpt_led_trigger(ar->hw,

+ 1 - 1
package/kernel/mac80211/patches/ath/960-0010-ath10k-limit-htt-rx-ring-size.patch

@@ -1,6 +1,6 @@
 --- a/drivers/net/wireless/ath/ath10k/htt.h
 +++ b/drivers/net/wireless/ath/ath10k/htt.h
-@@ -238,7 +238,7 @@ enum htt_rx_ring_flags {
+@@ -226,7 +226,7 @@ enum htt_rx_ring_flags {
  };
  
  #define HTT_RX_RING_SIZE_MIN 128

+ 4 - 4
package/kernel/mac80211/patches/ath/960-0011-ath10k-limit-pci-buffer-size.patch

@@ -1,6 +1,6 @@
 --- a/drivers/net/wireless/ath/ath10k/pci.c
 +++ b/drivers/net/wireless/ath/ath10k/pci.c
-@@ -142,7 +142,7 @@ static struct ce_attr host_ce_config_wla
+@@ -131,7 +131,7 @@ static struct ce_attr host_ce_config_wla
  		.flags = CE_ATTR_FLAGS,
  		.src_nentries = 0,
  		.src_sz_max = 2048,
@@ -9,7 +9,7 @@
  		.recv_cb = ath10k_pci_htt_htc_rx_cb,
  	},
  
-@@ -151,7 +151,7 @@ static struct ce_attr host_ce_config_wla
+@@ -140,7 +140,7 @@ static struct ce_attr host_ce_config_wla
  		.flags = CE_ATTR_FLAGS,
  		.src_nentries = 0,
  		.src_sz_max = 2048,
@@ -18,7 +18,7 @@
  		.recv_cb = ath10k_pci_htc_rx_cb,
  	},
  
-@@ -178,7 +178,7 @@ static struct ce_attr host_ce_config_wla
+@@ -167,7 +167,7 @@ static struct ce_attr host_ce_config_wla
  		.flags = CE_ATTR_FLAGS,
  		.src_nentries = 0,
  		.src_sz_max = 512,
@@ -27,7 +27,7 @@
  		.recv_cb = ath10k_pci_htt_rx_cb,
  	},
  
-@@ -203,7 +203,7 @@ static struct ce_attr host_ce_config_wla
+@@ -192,7 +192,7 @@ static struct ce_attr host_ce_config_wla
  		.flags = CE_ATTR_FLAGS,
  		.src_nentries = 0,
  		.src_sz_max = 2048,

+ 5 - 5
package/kernel/mac80211/patches/ath/972-ath10k_fix-crash-due-to-wrong-handling-of-peer_bw_rxnss_override-parameter.patch

@@ -23,7 +23,7 @@ v9: use SM/MS macros from code.h to simplify shift/mask handling
  3 files changed, 52 insertions(+), 23 deletions(-)
 --- a/drivers/net/wireless/ath/ath10k/mac.c
 +++ b/drivers/net/wireless/ath/ath10k/mac.c
-@@ -2469,7 +2469,7 @@ static void ath10k_peer_assoc_h_vht(stru
+@@ -2475,7 +2475,7 @@ static void ath10k_peer_assoc_h_vht(stru
  	const u16 *vht_mcs_mask;
  	u8 ampdu_factor;
  	u8 max_nss, vht_mcs;
@@ -32,7 +32,7 @@ v9: use SM/MS macros from code.h to simplify shift/mask handling
  
  	if (WARN_ON(ath10k_mac_vif_chan(vif, &def)))
  		return;
-@@ -2529,23 +2529,45 @@ static void ath10k_peer_assoc_h_vht(stru
+@@ -2535,23 +2535,45 @@ static void ath10k_peer_assoc_h_vht(stru
  		__le16_to_cpu(vht_cap->vht_mcs.tx_highest);
  	arg->peer_vht_rates.tx_mcs_set = ath10k_peer_assoc_h_vht_limit(
  		__le16_to_cpu(vht_cap->vht_mcs.tx_mcs_map), vht_mcs_mask);
@@ -92,7 +92,7 @@ v9: use SM/MS macros from code.h to simplify shift/mask handling
  }
  
  static void ath10k_peer_assoc_h_qos(struct ath10k *ar,
-@@ -2697,9 +2719,9 @@ static int ath10k_peer_assoc_prepare(str
+@@ -2703,9 +2725,9 @@ static int ath10k_peer_assoc_prepare(str
  	ath10k_peer_assoc_h_crypto(ar, vif, sta, arg);
  	ath10k_peer_assoc_h_rates(ar, vif, sta, arg);
  	ath10k_peer_assoc_h_ht(ar, vif, sta, arg);
@@ -105,7 +105,7 @@ v9: use SM/MS macros from code.h to simplify shift/mask handling
  }
 --- a/drivers/net/wireless/ath/ath10k/wmi.c
 +++ b/drivers/net/wireless/ath/ath10k/wmi.c
-@@ -7357,12 +7357,7 @@ ath10k_wmi_peer_assoc_fill_10_4(struct a
+@@ -7552,12 +7552,7 @@ ath10k_wmi_peer_assoc_fill_10_4(struct a
  	struct wmi_10_4_peer_assoc_complete_cmd *cmd = buf;
  
  	ath10k_wmi_peer_assoc_fill_10_2(ar, buf, arg);
@@ -121,7 +121,7 @@ v9: use SM/MS macros from code.h to simplify shift/mask handling
  static int
 --- a/drivers/net/wireless/ath/ath10k/wmi.h
 +++ b/drivers/net/wireless/ath/ath10k/wmi.h
-@@ -6357,7 +6357,19 @@ struct wmi_10_2_peer_assoc_complete_cmd
+@@ -6468,7 +6468,19 @@ struct wmi_10_2_peer_assoc_complete_cmd
  	__le32 info0; /* WMI_PEER_ASSOC_INFO0_ */
  } __packed;
  

+ 2 - 2
package/kernel/mac80211/patches/ath/973-ath10k_fix-band_center_freq-handling-for-VHT160-in-recent-firmwares.patch

@@ -13,7 +13,7 @@ v2: fix trailing whitespace issue and fix some typos within the commit note
  2 files changed, 8 insertions(+), 10 deletions(-)
 --- a/drivers/net/wireless/ath/ath10k/mac.c
 +++ b/drivers/net/wireless/ath/ath10k/mac.c
-@@ -4473,13 +4473,6 @@ static struct ieee80211_sta_vht_cap ath1
+@@ -4533,13 +4533,6 @@ static struct ieee80211_sta_vht_cap ath1
  		vht_cap.cap |= val;
  	}
  
@@ -29,7 +29,7 @@ v2: fix trailing whitespace issue and fix some typos within the commit note
  		if ((i < ar->num_rf_chains) && (ar->cfg_tx_chainmask & BIT(i)))
 --- a/drivers/net/wireless/ath/ath10k/wmi.c
 +++ b/drivers/net/wireless/ath/ath10k/wmi.c
-@@ -1677,13 +1677,18 @@ void ath10k_wmi_put_wmi_channel(struct w
+@@ -1700,13 +1700,18 @@ void ath10k_wmi_put_wmi_channel(struct w
  		flags |= WMI_CHAN_FLAG_HT40_PLUS;
  	if (arg->chan_radar)
  		flags |= WMI_CHAN_FLAG_DFS;

+ 32 - 40
package/kernel/mac80211/patches/ath/974-ath10k_add-LED-and-GPIO-controlling-support-for-various-chipsets.patch

@@ -85,7 +85,7 @@ v13:
  create mode 100644 drivers/net/wireless/ath/ath10k/leds.h
 --- a/drivers/net/wireless/ath/ath10k/Kconfig
 +++ b/drivers/net/wireless/ath/ath10k/Kconfig
-@@ -69,6 +69,16 @@ config ATH10K_DEBUGFS
+@@ -71,6 +71,16 @@ config ATH10K_DEBUGFS
  
  	  If unsure, say Y to make it easier to debug problems.
  
@@ -124,7 +124,7 @@ v13:
  WCN36XX=
 --- a/drivers/net/wireless/ath/ath10k/core.c
 +++ b/drivers/net/wireless/ath/ath10k/core.c
-@@ -34,6 +34,7 @@
+@@ -24,6 +24,7 @@
  #include "testmode.h"
  #include "wmi-ops.h"
  #include "coredump.h"
@@ -132,47 +132,47 @@ v13:
  
  unsigned int ath10k_debug_mask;
  static unsigned int ath10k_cryptmode_param;
-@@ -64,6 +65,7 @@ static const struct ath10k_hw_params ath
- 		.id = QCA988X_HW_2_0_VERSION,
+@@ -55,6 +56,7 @@ static const struct ath10k_hw_params ath
  		.dev_id = QCA988X_2_0_DEVICE_ID,
+ 		.bus = ATH10K_BUS_PCI,
  		.name = "qca988x hw2.0",
 +		.led_pin = 1,
  		.patch_load_addr = QCA988X_HW_2_0_PATCH_LOAD_ADDR,
  		.uart_pin = 7,
  		.cc_wraparound_type = ATH10K_HW_CC_WRAP_SHIFTED_ALL,
-@@ -129,6 +131,7 @@ static const struct ath10k_hw_params ath
- 		.id = QCA9887_HW_1_0_VERSION,
+@@ -123,6 +125,7 @@ static const struct ath10k_hw_params ath
  		.dev_id = QCA9887_1_0_DEVICE_ID,
+ 		.bus = ATH10K_BUS_PCI,
  		.name = "qca9887 hw1.0",
 +		.led_pin = 1,
  		.patch_load_addr = QCA9887_HW_1_0_PATCH_LOAD_ADDR,
  		.uart_pin = 7,
  		.cc_wraparound_type = ATH10K_HW_CC_WRAP_SHIFTED_ALL,
-@@ -293,6 +296,7 @@ static const struct ath10k_hw_params ath
- 		.id = QCA99X0_HW_2_0_DEV_VERSION,
+@@ -297,6 +300,7 @@ static const struct ath10k_hw_params ath
  		.dev_id = QCA99X0_2_0_DEVICE_ID,
+ 		.bus = ATH10K_BUS_PCI,
  		.name = "qca99x0 hw2.0",
 +		.led_pin = 17,
  		.patch_load_addr = QCA99X0_HW_2_0_PATCH_LOAD_ADDR,
  		.uart_pin = 7,
  		.otp_exe_param = 0x00000700,
-@@ -331,6 +335,7 @@ static const struct ath10k_hw_params ath
- 		.id = QCA9984_HW_1_0_DEV_VERSION,
+@@ -337,6 +341,7 @@ static const struct ath10k_hw_params ath
  		.dev_id = QCA9984_1_0_DEVICE_ID,
+ 		.bus = ATH10K_BUS_PCI,
  		.name = "qca9984/qca9994 hw1.0",
 +		.led_pin = 17,
  		.patch_load_addr = QCA9984_HW_1_0_PATCH_LOAD_ADDR,
  		.uart_pin = 7,
  		.cc_wraparound_type = ATH10K_HW_CC_WRAP_SHIFTED_EACH,
-@@ -374,6 +379,7 @@ static const struct ath10k_hw_params ath
- 		.id = QCA9888_HW_2_0_DEV_VERSION,
+@@ -384,6 +389,7 @@ static const struct ath10k_hw_params ath
  		.dev_id = QCA9888_2_0_DEVICE_ID,
+ 		.bus = ATH10K_BUS_PCI,
  		.name = "qca9888 hw2.0",
 +		.led_pin = 17,
  		.patch_load_addr = QCA9888_HW_2_0_PATCH_LOAD_ADDR,
  		.uart_pin = 7,
  		.cc_wraparound_type = ATH10K_HW_CC_WRAP_SHIFTED_EACH,
-@@ -2441,6 +2447,10 @@ int ath10k_core_start(struct ath10k *ar,
+@@ -2720,6 +2726,10 @@ int ath10k_core_start(struct ath10k *ar,
  	if (status)
  		goto err_hif_stop;
  
@@ -183,7 +183,7 @@ v13:
  	return 0;
  
  err_hif_stop:
-@@ -2695,9 +2705,18 @@ static void ath10k_core_register_work(st
+@@ -2976,9 +2986,18 @@ static void ath10k_core_register_work(st
  		goto err_spectral_destroy;
  	}
  
@@ -202,7 +202,7 @@ v13:
  err_spectral_destroy:
  	ath10k_spectral_destroy(ar);
  err_debug_destroy:
-@@ -2741,6 +2760,8 @@ void ath10k_core_unregister(struct ath10
+@@ -3024,6 +3043,8 @@ void ath10k_core_unregister(struct ath10
  	if (!test_bit(ATH10K_FLAG_CORE_REGISTERED, &ar->dev_flags))
  		return;
  
@@ -213,7 +213,7 @@ v13:
  	 * relayfs debugfs file cleanly. Otherwise the parent debugfs tree
 --- a/drivers/net/wireless/ath/ath10k/core.h
 +++ b/drivers/net/wireless/ath/ath10k/core.h
-@@ -25,6 +25,7 @@
+@@ -14,6 +14,7 @@
  #include <linux/pci.h>
  #include <linux/uuid.h>
  #include <linux/time.h>
@@ -221,15 +221,7 @@ v13:
  
  #include "htt.h"
  #include "htc.h"
-@@ -908,7 +909,6 @@ struct ath10k {
- 	u32 low_5ghz_chan;
- 	u32 high_5ghz_chan;
- 	bool ani_enabled;
--
- 	bool p2p;
- 
- 	struct {
-@@ -1099,6 +1099,13 @@ struct ath10k {
+@@ -1150,6 +1151,13 @@ struct ath10k {
  	} testmode;
  
  	struct {
@@ -245,7 +237,7 @@ v13:
  		u32 fw_warm_reset_counter;
 --- a/drivers/net/wireless/ath/ath10k/hw.h
 +++ b/drivers/net/wireless/ath/ath10k/hw.h
-@@ -504,6 +504,7 @@ struct ath10k_hw_params {
+@@ -511,6 +511,7 @@ struct ath10k_hw_params {
  	const char *name;
  	u32 patch_load_addr;
  	int uart_pin;
@@ -405,7 +397,7 @@ v13:
 +#endif /* _LEDS_H_ */
 --- a/drivers/net/wireless/ath/ath10k/mac.c
 +++ b/drivers/net/wireless/ath/ath10k/mac.c
-@@ -33,6 +33,7 @@
+@@ -23,6 +23,7 @@
  #include "wmi-tlv.h"
  #include "wmi-ops.h"
  #include "wow.h"
@@ -416,9 +408,9 @@ v13:
 --- a/drivers/net/wireless/ath/ath10k/wmi-ops.h
 +++ b/drivers/net/wireless/ath/ath10k/wmi-ops.h
 @@ -216,7 +216,10 @@ struct wmi_ops {
- 	struct sk_buff *(*gen_echo)(struct ath10k *ar, u32 value);
- 	struct sk_buff *(*gen_pdev_get_tpc_table_cmdid)(struct ath10k *ar,
- 							u32 param);
+ 	struct sk_buff *(*gen_bb_timing)
+ 			(struct ath10k *ar,
+ 			 const struct wmi_bb_timing_cfg_arg *arg);
 +	struct sk_buff *(*gen_gpio_config)(struct ath10k *ar, u32 gpio_num,
 +					   u32 input, u32 pull_type, u32 intr_mode);
  
@@ -426,7 +418,7 @@ v13:
  };
  
  int ath10k_wmi_cmd_send(struct ath10k *ar, struct sk_buff *skb, u32 cmd_id);
-@@ -1054,6 +1057,35 @@ ath10k_wmi_force_fw_hang(struct ath10k *
+@@ -1080,6 +1083,35 @@ ath10k_wmi_force_fw_hang(struct ath10k *
  	return ath10k_wmi_cmd_send(ar, skb, ar->wmi.cmd->force_fw_hang_cmdid);
  }
  
@@ -464,7 +456,7 @@ v13:
  {
 --- a/drivers/net/wireless/ath/ath10k/wmi-tlv.c
 +++ b/drivers/net/wireless/ath/ath10k/wmi-tlv.c
-@@ -3976,6 +3976,8 @@ static const struct wmi_ops wmi_tlv_ops
+@@ -4309,6 +4309,8 @@ static const struct wmi_ops wmi_tlv_ops
  	.gen_echo = ath10k_wmi_tlv_op_gen_echo,
  	.gen_vdev_spectral_conf = ath10k_wmi_tlv_op_gen_vdev_spectral_conf,
  	.gen_vdev_spectral_enable = ath10k_wmi_tlv_op_gen_vdev_spectral_enable,
@@ -475,7 +467,7 @@ v13:
  static const struct wmi_peer_flags_map wmi_tlv_peer_flags_map = {
 --- a/drivers/net/wireless/ath/ath10k/wmi.c
 +++ b/drivers/net/wireless/ath/ath10k/wmi.c
-@@ -7177,6 +7177,49 @@ ath10k_wmi_op_gen_peer_set_param(struct
+@@ -7372,6 +7372,49 @@ ath10k_wmi_op_gen_peer_set_param(struct
  	return skb;
  }
  
@@ -525,7 +517,7 @@ v13:
  static struct sk_buff *
  ath10k_wmi_op_gen_set_psmode(struct ath10k *ar, u32 vdev_id,
  			     enum wmi_sta_ps_mode psmode)
-@@ -8788,6 +8831,9 @@ static const struct wmi_ops wmi_ops = {
+@@ -9004,6 +9047,9 @@ static const struct wmi_ops wmi_ops = {
  	.fw_stats_fill = ath10k_wmi_main_op_fw_stats_fill,
  	.get_vdev_subtype = ath10k_wmi_op_get_vdev_subtype,
  	.gen_echo = ath10k_wmi_op_gen_echo,
@@ -535,7 +527,7 @@ v13:
  	/* .gen_bcn_tmpl not implemented */
  	/* .gen_prb_tmpl not implemented */
  	/* .gen_p2p_go_bcn_ie not implemented */
-@@ -8858,6 +8904,8 @@ static const struct wmi_ops wmi_10_1_ops
+@@ -9074,6 +9120,8 @@ static const struct wmi_ops wmi_10_1_ops
  	.fw_stats_fill = ath10k_wmi_10x_op_fw_stats_fill,
  	.get_vdev_subtype = ath10k_wmi_op_get_vdev_subtype,
  	.gen_echo = ath10k_wmi_op_gen_echo,
@@ -544,7 +536,7 @@ v13:
  	/* .gen_bcn_tmpl not implemented */
  	/* .gen_prb_tmpl not implemented */
  	/* .gen_p2p_go_bcn_ie not implemented */
-@@ -8929,6 +8977,8 @@ static const struct wmi_ops wmi_10_2_ops
+@@ -9146,6 +9194,8 @@ static const struct wmi_ops wmi_10_2_ops
  	.gen_delba_send = ath10k_wmi_op_gen_delba_send,
  	.fw_stats_fill = ath10k_wmi_10x_op_fw_stats_fill,
  	.get_vdev_subtype = ath10k_wmi_op_get_vdev_subtype,
@@ -553,16 +545,16 @@ v13:
  	/* .gen_pdev_enable_adaptive_cca not implemented */
  };
  
-@@ -8999,6 +9049,8 @@ static const struct wmi_ops wmi_10_2_4_o
- 	.gen_pdev_enable_adaptive_cca =
+@@ -9217,6 +9267,8 @@ static const struct wmi_ops wmi_10_2_4_o
  		ath10k_wmi_op_gen_pdev_enable_adaptive_cca,
  	.get_vdev_subtype = ath10k_wmi_10_2_4_op_get_vdev_subtype,
+ 	.gen_bb_timing = ath10k_wmi_10_2_4_op_gen_bb_timing,
 +	.gen_gpio_config = ath10k_wmi_op_gen_gpio_config,
 +	.gen_gpio_output = ath10k_wmi_op_gen_gpio_output,
  	/* .gen_bcn_tmpl not implemented */
  	/* .gen_prb_tmpl not implemented */
  	/* .gen_p2p_go_bcn_ie not implemented */
-@@ -9078,6 +9130,8 @@ static const struct wmi_ops wmi_10_4_ops
+@@ -9297,6 +9349,8 @@ static const struct wmi_ops wmi_10_4_ops
  	.gen_pdev_bss_chan_info_req = ath10k_wmi_10_2_op_gen_pdev_bss_chan_info,
  	.gen_echo = ath10k_wmi_op_gen_echo,
  	.gen_pdev_get_tpc_config = ath10k_wmi_10_2_4_op_gen_pdev_get_tpc_config,
@@ -573,7 +565,7 @@ v13:
  int ath10k_wmi_attach(struct ath10k *ar)
 --- a/drivers/net/wireless/ath/ath10k/wmi.h
 +++ b/drivers/net/wireless/ath/ath10k/wmi.h
-@@ -2942,6 +2942,41 @@ enum wmi_10_4_feature_mask {
+@@ -2998,6 +2998,41 @@ enum wmi_10_4_feature_mask {
  
  };
  

+ 4 - 4
package/kernel/mac80211/patches/ath/975-ath10k-use-tpt-trigger-by-default.patch

@@ -16,9 +16,9 @@ Signed-off-by: Mathias Kresin <[email protected]>
 
 --- a/drivers/net/wireless/ath/ath10k/core.h
 +++ b/drivers/net/wireless/ath/ath10k/core.h
-@@ -1144,6 +1144,10 @@ struct ath10k {
- 	struct ath10k_radar_found_info last_radar_info;
+@@ -1198,6 +1198,10 @@ struct ath10k {
  	struct work_struct radar_confirmation_work;
+ 	struct ath10k_bus_params bus_param;
  
 +#ifdef CPTCFG_MAC80211_LEDS
 +	const char *led_default_trigger;
@@ -42,8 +42,8 @@ Signed-off-by: Mathias Kresin <[email protected]>
  	if (ret)
 --- a/drivers/net/wireless/ath/ath10k/mac.c
 +++ b/drivers/net/wireless/ath/ath10k/mac.c
-@@ -8603,7 +8603,7 @@ int ath10k_mac_register(struct ath10k *a
- 	wiphy_ext_feature_set(ar->hw->wiphy, NL80211_EXT_FEATURE_CQM_RSSI_LIST);
+@@ -8838,7 +8838,7 @@ int ath10k_mac_register(struct ath10k *a
+ 	ar->hw->weight_multiplier = ATH10K_AIRTIME_WEIGHT_MULTIPLIER;
  
  #ifdef CPTCFG_MAC80211_LEDS
 -	ieee80211_create_tpt_led_trigger(ar->hw,

+ 0 - 39
package/kernel/mac80211/patches/ath/976-ath10k-Limit-available-channels-via-DT-ieee80211-fre.patch

@@ -1,39 +0,0 @@
-From bbf0a8af2261bc7ae39b227ff6a1e9f45a008c27 Mon Sep 17 00:00:00 2001
-From: Sven Eckelmann <[email protected]>
-Date: Mon, 30 Jul 2018 17:31:41 +0200
-Subject: [PATCH] ath10k: Limit available channels via DT ieee80211-freq-limit
-
-Tri-band devices (1x 2.4GHz + 2x 5GHz) often incorporate special filters in
-the RX and TX path. These filtered channel can in theory still be used by
-the hardware but the signal strength is reduced so much that it makes no
-sense.
-
-There is already a DT property to limit the available channels but ath10k
-has to manually call this functionality to limit the currrently set wiphy
-channels further.
-
-Signed-off-by: Sven Eckelmann <[email protected]>
-
-Forwarded: https://patchwork.kernel.org/patch/10549245/
----
- drivers/net/wireless/ath/ath10k/mac.c | 2 ++
- 1 file changed, 2 insertions(+)
-
---- a/drivers/net/wireless/ath/ath10k/mac.c
-+++ b/drivers/net/wireless/ath/ath10k/mac.c
-@@ -18,6 +18,7 @@
- 
- #include "mac.h"
- 
-+#include <net/cfg80211.h>
- #include <net/mac80211.h>
- #include <linux/etherdevice.h>
- #include <linux/acpi.h>
-@@ -8390,6 +8391,7 @@ int ath10k_mac_register(struct ath10k *a
- 		ar->hw->wiphy->bands[NL80211_BAND_5GHZ] = band;
- 	}
- 
-+	wiphy_read_of_freq_limits(ar->hw->wiphy);
- 	ath10k_mac_setup_ht_vht_cap(ar);
- 
- 	ar->hw->wiphy->interface_modes =

+ 0 - 89
package/kernel/mac80211/patches/ath/977-ath10k-add-support-for-configuring-management-packet.patch

@@ -1,89 +0,0 @@
-From: Sriram R <[email protected]>
-Date: Mon, 10 Sep 2018 11:09:40 +0530
-Subject: [PATCH] ath10k: add support for configuring management packet rate
-
-By default the firmware uses 1Mbps and 6Mbps rate for management packets
-in 2G and 5G bands respectively. But when the user selects different
-basic rates from the userspace, we need to send the management
-packets at the lowest basic rate selected by the user.
-
-This change makes use of WMI_VDEV_PARAM_MGMT_RATE param for configuring the
-management packets rate to the firmware.
-
-Chipsets Tested : QCA988X, QCA9887, QCA9984
-FW Tested 	: 10.2.4-1.0-41, 10.4-3.6.104
-
-Signed-off-by: Sriram R <[email protected]>
-Signed-off-by: Kalle Valo <[email protected]>
-
-Origin: backport, https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=f279294e9ee22a8f306fdc8e4181cf555e6f0f70
----
---- a/drivers/net/wireless/ath/ath10k/mac.c
-+++ b/drivers/net/wireless/ath/ath10k/mac.c
-@@ -158,6 +158,22 @@ u8 ath10k_mac_bitrate_to_idx(const struc
- 	return 0;
- }
- 
-+static int ath10k_mac_get_rate_hw_value(int bitrate)
-+{
-+	int i;
-+	u8 hw_value_prefix = 0;
-+
-+	if (ath10k_mac_bitrate_is_cck(bitrate))
-+		hw_value_prefix = WMI_RATE_PREAMBLE_CCK << 6;
-+
-+	for (i = 0; i < sizeof(ath10k_rates); i++) {
-+		if (ath10k_rates[i].bitrate == bitrate)
-+			return hw_value_prefix | ath10k_rates[i].hw_value;
-+	}
-+
-+	return -EINVAL;
-+}
-+
- static int ath10k_mac_get_max_vht_mcs_map(u16 mcs_map, int nss)
- {
- 	switch ((mcs_map >> (2 * nss)) & 0x3) {
-@@ -5468,9 +5484,10 @@ static void ath10k_bss_info_changed(stru
- 	struct cfg80211_chan_def def;
- 	u32 vdev_param, pdev_param, slottime, preamble;
- 	u16 bitrate, hw_value;
--	u8 rate;
--	int rateidx, ret = 0;
-+	u8 rate, basic_rate_idx;
-+	int rateidx, ret = 0, hw_rate_code;
- 	enum nl80211_band band;
-+	const struct ieee80211_supported_band *sband;
- 
- 	mutex_lock(&ar->conf_mutex);
- 
-@@ -5676,6 +5693,30 @@ static void ath10k_bss_info_changed(stru
- 				    arvif->vdev_id,  ret);
- 	}
- 
-+	if (changed & BSS_CHANGED_BASIC_RATES) {
-+		if (WARN_ON(ath10k_mac_vif_chan(vif, &def))) {
-+			mutex_unlock(&ar->conf_mutex);
-+			return;
-+		}
-+
-+	sband = ar->hw->wiphy->bands[def.chan->band];
-+	basic_rate_idx = ffs(vif->bss_conf.basic_rates) - 1;
-+	bitrate = sband->bitrates[basic_rate_idx].bitrate;
-+
-+	hw_rate_code = ath10k_mac_get_rate_hw_value(bitrate);
-+	if (hw_rate_code < 0) {
-+		ath10k_warn(ar, "bitrate not supported %d\n", bitrate);
-+		mutex_unlock(&ar->conf_mutex);
-+		return;
-+	}
-+
-+	vdev_param = ar->wmi.vdev_param->mgmt_rate;
-+	ret = ath10k_wmi_vdev_set_param(ar, arvif->vdev_id, vdev_param,
-+					hw_rate_code);
-+	if (ret)
-+		ath10k_warn(ar, "failed to set mgmt tx rate %d\n", ret);
-+	}
-+
- 	mutex_unlock(&ar->conf_mutex);
- }
- 

+ 0 - 66
package/kernel/mac80211/patches/ath/978-ath10k-fix-possible-out-of-bound-access-of-ath10k_ra.patch

@@ -1,66 +0,0 @@
-From: Sriram R <[email protected]>
-Date: Wed, 3 Oct 2018 08:43:50 +0530
-Subject: [PATCH] ath10k: fix possible out of bound access of ath10k_rates array
-
-While using 'ath10k_mac_get_rate_hw_value()' to obtain the hw value
-from the passed bitrate, there is a chance of out of bound array access
-when wrong bitrate is passed. This is fixed by comparing the bitrates
-within the correct size of the ath10k_rates array.
-
-Fixes commit f279294e9ee2 ("ath10k: add support for configuring management
-packet rate"). Also correction made to some indents used in the above commit.
-
-Signed-off-by: Sriram R <[email protected]>
-Signed-off-by: Kalle Valo <[email protected]>
-
-Origin: backport, https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=34e141eea7dd8525dd1ef7a925459e455b4d307f
----
---- a/drivers/net/wireless/ath/ath10k/mac.c
-+++ b/drivers/net/wireless/ath/ath10k/mac.c
-@@ -166,7 +166,7 @@ static int ath10k_mac_get_rate_hw_value(
- 	if (ath10k_mac_bitrate_is_cck(bitrate))
- 		hw_value_prefix = WMI_RATE_PREAMBLE_CCK << 6;
- 
--	for (i = 0; i < sizeof(ath10k_rates); i++) {
-+	for (i = 0; i < ARRAY_SIZE(ath10k_rates); i++) {
- 		if (ath10k_rates[i].bitrate == bitrate)
- 			return hw_value_prefix | ath10k_rates[i].hw_value;
- 	}
-@@ -5699,22 +5699,22 @@ static void ath10k_bss_info_changed(stru
- 			return;
- 		}
- 
--	sband = ar->hw->wiphy->bands[def.chan->band];
--	basic_rate_idx = ffs(vif->bss_conf.basic_rates) - 1;
--	bitrate = sband->bitrates[basic_rate_idx].bitrate;
--
--	hw_rate_code = ath10k_mac_get_rate_hw_value(bitrate);
--	if (hw_rate_code < 0) {
--		ath10k_warn(ar, "bitrate not supported %d\n", bitrate);
--		mutex_unlock(&ar->conf_mutex);
--		return;
--	}
-+		sband = ar->hw->wiphy->bands[def.chan->band];
-+		basic_rate_idx = ffs(vif->bss_conf.basic_rates) - 1;
-+		bitrate = sband->bitrates[basic_rate_idx].bitrate;
-+
-+		hw_rate_code = ath10k_mac_get_rate_hw_value(bitrate);
-+		if (hw_rate_code < 0) {
-+			ath10k_warn(ar, "bitrate not supported %d\n", bitrate);
-+			mutex_unlock(&ar->conf_mutex);
-+			return;
-+		}
- 
--	vdev_param = ar->wmi.vdev_param->mgmt_rate;
--	ret = ath10k_wmi_vdev_set_param(ar, arvif->vdev_id, vdev_param,
--					hw_rate_code);
--	if (ret)
--		ath10k_warn(ar, "failed to set mgmt tx rate %d\n", ret);
-+		vdev_param = ar->wmi.vdev_param->mgmt_rate;
-+		ret = ath10k_wmi_vdev_set_param(ar, arvif->vdev_id, vdev_param,
-+						hw_rate_code);
-+		if (ret)
-+			ath10k_warn(ar, "failed to set mgmt tx rate %d\n", ret);
- 	}
- 
- 	mutex_unlock(&ar->conf_mutex);

+ 3 - 3
package/kernel/mac80211/patches/ath/979-ath10k-fix-incorrect-multicast-broadcast-rate-settin.patch

@@ -17,7 +17,7 @@ Origin: other, https://patchwork.kernel.org/patch/10723033/
 
 --- a/drivers/net/wireless/ath/ath10k/mac.c
 +++ b/drivers/net/wireless/ath/ath10k/mac.c
-@@ -5484,8 +5484,8 @@ static void ath10k_bss_info_changed(stru
+@@ -5604,8 +5604,8 @@ static void ath10k_bss_info_changed(stru
  	struct cfg80211_chan_def def;
  	u32 vdev_param, pdev_param, slottime, preamble;
  	u16 bitrate, hw_value;
@@ -28,9 +28,9 @@ Origin: other, https://patchwork.kernel.org/patch/10723033/
  	enum nl80211_band band;
  	const struct ieee80211_supported_band *sband;
  
-@@ -5658,7 +5658,11 @@ static void ath10k_bss_info_changed(stru
+@@ -5792,7 +5792,11 @@ static void ath10k_bss_info_changed(stru
  	if (changed & BSS_CHANGED_MCAST_RATE &&
- 	    !WARN_ON(ath10k_mac_vif_chan(arvif->vif, &def))) {
+ 	    !ath10k_mac_vif_chan(arvif->vif, &def)) {
  		band = def.chan->band;
 -		rateidx = vif->bss_conf.mcast_rate[band] - 1;
 +		mcast_rate = vif->bss_conf.mcast_rate[band];

+ 3 - 3
package/kernel/mac80211/patches/ath/980-ath10k-fix-max-antenna-gain-unit.patch

@@ -20,7 +20,7 @@ Forwarded: https://patchwork.kernel.org/patch/10986723/
 
 --- a/drivers/net/wireless/ath/ath10k/mac.c
 +++ b/drivers/net/wireless/ath/ath10k/mac.c
-@@ -1020,7 +1020,7 @@ static int ath10k_monitor_vdev_start(str
+@@ -1009,7 +1009,7 @@ static int ath10k_monitor_vdev_start(str
  	arg.channel.min_power = 0;
  	arg.channel.max_power = channel->max_power * 2;
  	arg.channel.max_reg_power = channel->max_reg_power * 2;
@@ -29,7 +29,7 @@ Forwarded: https://patchwork.kernel.org/patch/10986723/
  
  	reinit_completion(&ar->vdev_setup_done);
  
-@@ -1462,7 +1462,7 @@ static int ath10k_vdev_start_restart(str
+@@ -1451,7 +1451,7 @@ static int ath10k_vdev_start_restart(str
  	arg.channel.min_power = 0;
  	arg.channel.max_power = chandef->chan->max_power * 2;
  	arg.channel.max_reg_power = chandef->chan->max_reg_power * 2;
@@ -38,7 +38,7 @@ Forwarded: https://patchwork.kernel.org/patch/10986723/
  
  	if (arvif->vdev_type == WMI_VDEV_TYPE_AP) {
  		arg.ssid = arvif->u.ap.ssid;
-@@ -3139,7 +3139,7 @@ static int ath10k_update_channel_list(st
+@@ -3128,7 +3128,7 @@ static int ath10k_update_channel_list(st
  			ch->min_power = 0;
  			ch->max_power = channel->max_power * 2;
  			ch->max_reg_power = channel->max_reg_power * 2;

+ 5 - 5
package/kernel/mac80211/patches/ath/981-ath10k-adjust-tx-power-reduction-for-US-regulatory-d.patch

@@ -28,8 +28,8 @@ Forwarded: no
 
 --- a/drivers/net/wireless/ath/ath10k/mac.c
 +++ b/drivers/net/wireless/ath/ath10k/mac.c
-@@ -988,6 +988,40 @@ static inline int ath10k_vdev_setup_sync
- 	return 0;
+@@ -977,6 +977,40 @@ static inline int ath10k_vdev_setup_sync
+ 	return ar->last_wmi_vdev_start_status;
  }
  
 +static u32 ath10k_get_max_antenna_gain(struct ath10k *ar,
@@ -69,7 +69,7 @@ Forwarded: no
  static int ath10k_monitor_vdev_start(struct ath10k *ar, int vdev_id)
  {
  	struct cfg80211_chan_def *chandef = NULL;
-@@ -1020,7 +1054,8 @@ static int ath10k_monitor_vdev_start(str
+@@ -1009,7 +1043,8 @@ static int ath10k_monitor_vdev_start(str
  	arg.channel.min_power = 0;
  	arg.channel.max_power = channel->max_power * 2;
  	arg.channel.max_reg_power = channel->max_reg_power * 2;
@@ -79,7 +79,7 @@ Forwarded: no
  
  	reinit_completion(&ar->vdev_setup_done);
  
-@@ -1462,7 +1497,8 @@ static int ath10k_vdev_start_restart(str
+@@ -1451,7 +1486,8 @@ static int ath10k_vdev_start_restart(str
  	arg.channel.min_power = 0;
  	arg.channel.max_power = chandef->chan->max_power * 2;
  	arg.channel.max_reg_power = chandef->chan->max_reg_power * 2;
@@ -89,7 +89,7 @@ Forwarded: no
  
  	if (arvif->vdev_type == WMI_VDEV_TYPE_AP) {
  		arg.ssid = arvif->u.ap.ssid;
-@@ -3139,7 +3175,8 @@ static int ath10k_update_channel_list(st
+@@ -3128,7 +3164,8 @@ static int ath10k_update_channel_list(st
  			ch->min_power = 0;
  			ch->max_power = channel->max_power * 2;
  			ch->max_reg_power = channel->max_reg_power * 2;

+ 2 - 1
package/kernel/mac80211/patches/brcm/040-brcmutil_option.patch

@@ -1,6 +1,7 @@
 --- a/drivers/net/wireless/broadcom/brcm80211/Kconfig
 +++ b/drivers/net/wireless/broadcom/brcm80211/Kconfig
-@@ -1,5 +1,5 @@
+@@ -1,6 +1,6 @@
+ # SPDX-License-Identifier: GPL-2.0-only
  config BRCMUTIL
 -	tristate
 +	tristate "Broadcom 802.11 driver utility functions"

+ 0 - 25
package/kernel/mac80211/patches/brcm/300-v4.20-0001-brcmfmac-add-CYW89342-mini-PCIe-device.patch

@@ -1,25 +0,0 @@
-From 2fef681a4cf7994c882190fd2417b95f30510afb Mon Sep 17 00:00:00 2001
-From: Jia-Shyr Chuang <[email protected]>
-Date: Wed, 15 Aug 2018 04:23:09 -0500
-Subject: [PATCH] brcmfmac: add CYW89342 mini-PCIe device
-
-CYW89342 is a 2x2 MIMO, 802.11a/b/g/n/ac for WLAN. It is a member of
-4355/4359 family.
-
-Signed-off-by: Jia-Shyr Chuang <[email protected]>
-Signed-off-by: Chi-Hsien Lin <[email protected]>
-Signed-off-by: Kalle Valo <[email protected]>
----
- drivers/net/wireless/broadcom/brcm80211/brcmfmac/pcie.c | 1 +
- 1 file changed, 1 insertion(+)
-
---- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/pcie.c
-+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/pcie.c
-@@ -2017,6 +2017,7 @@ static const struct dev_pm_ops brcmf_pci
- 
- static const struct pci_device_id brcmf_pcie_devid_table[] = {
- 	BRCMF_PCIE_DEVICE(BRCM_PCIE_4350_DEVICE_ID),
-+	BRCMF_PCIE_DEVICE_SUB(0x4355, BRCM_PCIE_VENDOR_ID_BROADCOM, 0x4355),
- 	BRCMF_PCIE_DEVICE(BRCM_PCIE_4356_DEVICE_ID),
- 	BRCMF_PCIE_DEVICE(BRCM_PCIE_43567_DEVICE_ID),
- 	BRCMF_PCIE_DEVICE(BRCM_PCIE_43570_DEVICE_ID),

+ 0 - 38
package/kernel/mac80211/patches/brcm/302-v4.20-0001-brcmfmac-fix-wrong-strnchr-usage.patch

@@ -1,38 +0,0 @@
-From cb18e2e9ec71d42409a51b83546686c609780dde Mon Sep 17 00:00:00 2001
-From: Rasmus Villemoes <[email protected]>
-Date: Wed, 22 Aug 2018 15:22:15 +0200
-Subject: [PATCH] brcmfmac: fix wrong strnchr usage
-
-strnchr takes arguments in the order of its name: string, max bytes to
-read, character to search for. Here we're passing '\n' aka 10 as the
-buffer size, and searching for sizeof(buf) aka BRCMF_DCMD_SMLEN aka
-256 (aka '\0', since it's implicitly converted to char) within those 10
-bytes.
-
-Just interchanging the last two arguments would still leave a bug,
-because if we've been successful once, there are not sizeof(buf)
-characters left after the new value of p.
-
-Since clmver is immediately afterwards passed as a %s argument, I assume
-that it is actually a properly nul-terminated string. For that case, we
-have strreplace().
-
-Signed-off-by: Rasmus Villemoes <[email protected]>
-Signed-off-by: Kalle Valo <[email protected]>
----
- drivers/net/wireless/broadcom/brcm80211/brcmfmac/common.c | 4 +---
- 1 file changed, 1 insertion(+), 3 deletions(-)
-
---- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/common.c
-+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/common.c
-@@ -296,9 +296,7 @@ int brcmf_c_preinit_dcmds(struct brcmf_i
- 		/* Replace all newline/linefeed characters with space
- 		 * character
- 		 */
--		ptr = clmver;
--		while ((ptr = strnchr(ptr, '\n', sizeof(buf))) != NULL)
--			*ptr = ' ';
-+		strreplace(clmver, '\n', ' ');
- 
- 		brcmf_dbg(INFO, "CLM version = %s\n", clmver);
- 	}

+ 0 - 28
package/kernel/mac80211/patches/brcm/304-v4.20-0002-brcmfmac-increase-buffer-for-obtaining-firmware-capa.patch

@@ -1,28 +0,0 @@
-From: Arend van Spriel <[email protected]>
-Date: Wed, 5 Sep 2018 09:48:59 +0200
-Subject: [PATCH] brcmfmac: increase buffer for obtaining firmware capabilities
-
-When obtaining the firmware capability a buffer is provided of 512
-bytes. However, if all features in firmware are supported the buffer
-needs to be 565 bytes as otherwise truncated information is retrieved
-from firmware. Increasing the buffer to 768 bytes on stack.
-
-Reviewed-by: Hante Meuleman <[email protected]>
-Reviewed-by: Pieter-Paul Giesberts <[email protected]>
-Reviewed-by: Franky Lin <[email protected]>
-Signed-off-by: Arend van Spriel <[email protected]>
----
- drivers/net/wireless/broadcom/brcm80211/brcmfmac/feature.c | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
---- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/feature.c
-+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/feature.c
-@@ -178,7 +178,7 @@ static void brcmf_feat_iovar_data_set(st
- 	ifp->fwil_fwerr = false;
- }
- 
--#define MAX_CAPS_BUFFER_SIZE	512
-+#define MAX_CAPS_BUFFER_SIZE	768
- static void brcmf_feat_firmware_capabilities(struct brcmf_if *ifp)
- {
- 	char caps[MAX_CAPS_BUFFER_SIZE];

+ 0 - 57
package/kernel/mac80211/patches/brcm/305-v4.20-0001-brcmfmac-remove-set-but-not-used-variables-sfdoff-an.patch

@@ -1,57 +0,0 @@
-From a8254fa4ba60b85829b6e5ede6564f81cd70d59f Mon Sep 17 00:00:00 2001
-From: YueHaibing <[email protected]>
-Date: Tue, 11 Sep 2018 11:24:04 +0800
-Subject: [PATCH] brcmfmac: remove set but not used variables 'sfdoff' and
- 'pad_size'
-
-Fixes gcc '-Wunused-but-set-variable' warning:
-
-drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c: In function 'brcmf_sdio_rxglom':
-drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c:1466:11: warning:
- variable 'sfdoff' set but not used [-Wunused-but-set-variable]
-
-drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c: In function 'brcmf_sdio_bus_preinit':
-drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c:3408:7: warning:
- variable 'pad_size' set but not used [-Wunused-but-set-variable]
-
-Signed-off-by: YueHaibing <[email protected]>
-Signed-off-by: Kalle Valo <[email protected]>
----
- drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c | 5 +----
- 1 file changed, 1 insertion(+), 4 deletions(-)
-
---- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c
-+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c
-@@ -1463,7 +1463,7 @@ static u8 brcmf_sdio_rxglom(struct brcmf
- 	struct sk_buff *pfirst, *pnext;
- 
- 	int errcode;
--	u8 doff, sfdoff;
-+	u8 doff;
- 
- 	struct brcmf_sdio_hdrinfo rd_new;
- 
-@@ -1597,7 +1597,6 @@ static u8 brcmf_sdio_rxglom(struct brcmf
- 
- 		/* Remove superframe header, remember offset */
- 		skb_pull(pfirst, rd_new.dat_offset);
--		sfdoff = rd_new.dat_offset;
- 		num = 0;
- 
- 		/* Validate all the subframe headers */
-@@ -3405,7 +3404,6 @@ static int brcmf_sdio_bus_preinit(struct
- 	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;
- 
-@@ -3448,7 +3446,6 @@ static int brcmf_sdio_bus_preinit(struct
- 	if (sdiodev->sg_support) {
- 		bus->txglom = false;
- 		value = 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) {

+ 0 - 67
package/kernel/mac80211/patches/brcm/306-v4.20-0001-brcmfmac-reduce-timeout-for-action-frame-scan.patch

@@ -1,67 +0,0 @@
-From edb6d6885bef82d1eac432dbeca9fbf4ec349d7e Mon Sep 17 00:00:00 2001
-From: Chung-Hsien Hsu <[email protected]>
-Date: Thu, 27 Sep 2018 14:59:44 +0000
-Subject: [PATCH] brcmfmac: reduce timeout for action frame scan
-
-Finding a common channel to send an action frame out is required for
-some action types. Since a loop with several scan retry is used to find
-the channel, a short wait time could be considered for each attempt.
-This patch reduces the wait time from 1500 to 450 msec for each action
-frame scan.
-
-This patch fixes the WFA p2p certification 5.1.20 failure caused by the
-long action frame send time.
-
-Signed-off-by: Chung-Hsien Hsu <[email protected]>
-Signed-off-by: Chi-Hsien Lin <[email protected]>
-Signed-off-by: Kalle Valo <[email protected]>
----
- drivers/net/wireless/broadcom/brcm80211/brcmfmac/p2p.c | 9 ++++-----
- 1 file changed, 4 insertions(+), 5 deletions(-)
-
---- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/p2p.c
-+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/p2p.c
-@@ -74,7 +74,7 @@
- #define P2P_AF_MAX_WAIT_TIME		msecs_to_jiffies(2000)
- #define P2P_INVALID_CHANNEL		-1
- #define P2P_CHANNEL_SYNC_RETRY		5
--#define P2P_AF_FRM_SCAN_MAX_WAIT	msecs_to_jiffies(1500)
-+#define P2P_AF_FRM_SCAN_MAX_WAIT	msecs_to_jiffies(450)
- #define P2P_DEFAULT_SLEEP_TIME_VSDB	200
- 
- /* WiFi P2P Public Action Frame OUI Subtypes */
-@@ -1134,7 +1134,6 @@ static s32 brcmf_p2p_af_searching_channe
- {
- 	struct afx_hdl *afx_hdl = &p2p->afx_hdl;
- 	struct brcmf_cfg80211_vif *pri_vif;
--	unsigned long duration;
- 	s32 retry;
- 
- 	brcmf_dbg(TRACE, "Enter\n");
-@@ -1150,7 +1149,6 @@ static s32 brcmf_p2p_af_searching_channe
- 	 * pending action frame tx is cancelled.
- 	 */
- 	retry = 0;
--	duration = msecs_to_jiffies(P2P_AF_FRM_SCAN_MAX_WAIT);
- 	while ((retry < P2P_CHANNEL_SYNC_RETRY) &&
- 	       (afx_hdl->peer_chan == P2P_INVALID_CHANNEL)) {
- 		afx_hdl->is_listen = false;
-@@ -1158,7 +1156,8 @@ static s32 brcmf_p2p_af_searching_channe
- 			  retry);
- 		/* search peer on peer's listen channel */
- 		schedule_work(&afx_hdl->afx_work);
--		wait_for_completion_timeout(&afx_hdl->act_frm_scan, duration);
-+		wait_for_completion_timeout(&afx_hdl->act_frm_scan,
-+					    P2P_AF_FRM_SCAN_MAX_WAIT);
- 		if ((afx_hdl->peer_chan != P2P_INVALID_CHANNEL) ||
- 		    (!test_bit(BRCMF_P2P_STATUS_FINDING_COMMON_CHANNEL,
- 			       &p2p->status)))
-@@ -1171,7 +1170,7 @@ static s32 brcmf_p2p_af_searching_channe
- 			afx_hdl->is_listen = true;
- 			schedule_work(&afx_hdl->afx_work);
- 			wait_for_completion_timeout(&afx_hdl->act_frm_scan,
--						    duration);
-+						    P2P_AF_FRM_SCAN_MAX_WAIT);
- 		}
- 		if ((afx_hdl->peer_chan != P2P_INVALID_CHANNEL) ||
- 		    (!test_bit(BRCMF_P2P_STATUS_FINDING_COMMON_CHANNEL,

+ 0 - 79
package/kernel/mac80211/patches/brcm/306-v4.20-0002-brcmfmac-fix-full-timeout-waiting-for-action-frame-o.patch

@@ -1,79 +0,0 @@
-From fbf07000960d9c8a13fdc17c6de0230d681c7543 Mon Sep 17 00:00:00 2001
-From: Chung-Hsien Hsu <[email protected]>
-Date: Thu, 27 Sep 2018 14:59:49 +0000
-Subject: [PATCH] brcmfmac: fix full timeout waiting for action frame
- on-channel tx
-
-The driver sends an action frame down and waits for a completion signal
-triggered by the received BRCMF_E_ACTION_FRAME_OFF_CHAN_COMPLETE event
-to continue the process. However, the action frame could be transmitted
-either on the current channel or on an off channel. For the on-channel
-case, only BRCMF_E_ACTION_FRAME_COMPLETE event will be received when
-the frame is transmitted, which make the driver always wait a full
-timeout duration. This patch has the completion signal be triggered by
-receiving the BRCMF_E_ACTION_FRAME_COMPLETE event for the on-channel
-case.
-
-This change fixes WFA p2p certification 5.1.19 failure.
-
-Signed-off-by: Chung-Hsien Hsu <[email protected]>
-Signed-off-by: Chi-Hsien Lin <[email protected]>
-Signed-off-by: Kalle Valo <[email protected]>
----
- drivers/net/wireless/broadcom/brcm80211/brcmfmac/p2p.c | 17 +++++++++++++++--
- drivers/net/wireless/broadcom/brcm80211/brcmfmac/p2p.h |  2 ++
- 2 files changed, 17 insertions(+), 2 deletions(-)
-
---- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/p2p.c
-+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/p2p.c
-@@ -1457,10 +1457,12 @@ int brcmf_p2p_notify_action_tx_complete(
- 		return 0;
- 
- 	if (e->event_code == BRCMF_E_ACTION_FRAME_COMPLETE) {
--		if (e->status == BRCMF_E_STATUS_SUCCESS)
-+		if (e->status == BRCMF_E_STATUS_SUCCESS) {
- 			set_bit(BRCMF_P2P_STATUS_ACTION_TX_COMPLETED,
- 				&p2p->status);
--		else {
-+			if (!p2p->wait_for_offchan_complete)
-+				complete(&p2p->send_af_done);
-+		} else {
- 			set_bit(BRCMF_P2P_STATUS_ACTION_TX_NOACK, &p2p->status);
- 			/* If there is no ack, we don't need to wait for
- 			 * WLC_E_ACTION_FRAME_OFFCHAN_COMPLETE event
-@@ -1511,6 +1513,17 @@ static s32 brcmf_p2p_tx_action_frame(str
- 	p2p->af_sent_channel = le32_to_cpu(af_params->channel);
- 	p2p->af_tx_sent_jiffies = jiffies;
- 
-+	if (test_bit(BRCMF_P2P_STATUS_DISCOVER_LISTEN, &p2p->status) &&
-+	    p2p->af_sent_channel ==
-+	    ieee80211_frequency_to_channel(p2p->remain_on_channel.center_freq))
-+		p2p->wait_for_offchan_complete = false;
-+	else
-+		p2p->wait_for_offchan_complete = true;
-+
-+	brcmf_dbg(TRACE, "Waiting for %s tx completion event\n",
-+		  (p2p->wait_for_offchan_complete) ?
-+		   "off-channel" : "on-channel");
-+
- 	timeout = wait_for_completion_timeout(&p2p->send_af_done,
- 					      P2P_AF_MAX_WAIT_TIME);
- 
---- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/p2p.h
-+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/p2p.h
-@@ -124,6 +124,7 @@ struct afx_hdl {
-  * @gon_req_action: about to send go negotiation requets frame.
-  * @block_gon_req_tx: drop tx go negotiation requets frame.
-  * @p2pdev_dynamically: is p2p device if created by module param or supplicant.
-+ * @wait_for_offchan_complete: wait for off-channel tx completion event.
-  */
- struct brcmf_p2p_info {
- 	struct brcmf_cfg80211_info *cfg;
-@@ -144,6 +145,7 @@ struct brcmf_p2p_info {
- 	bool gon_req_action;
- 	bool block_gon_req_tx;
- 	bool p2pdev_dynamically;
-+	bool wait_for_offchan_complete;
- };
- 
- s32 brcmf_p2p_attach(struct brcmf_cfg80211_info *cfg, bool p2pdev_forced);

+ 0 - 102
package/kernel/mac80211/patches/brcm/320-v5.0-0001-brcmfmac-Remove-firmware-loading-code-duplication.patch

@@ -1,102 +0,0 @@
-From a1a3b762163868ad07a4499a73df324f40d5ab0b Mon Sep 17 00:00:00 2001
-From: Hans de Goede <[email protected]>
-Date: Wed, 10 Oct 2018 13:00:58 +0200
-Subject: [PATCH] brcmfmac: Remove firmware-loading code duplication
-
-brcmf_fw_request_next_item and brcmf_fw_request_done both have identical
-code to complete the fw-request depending on the item-type.
-
-This commit adds a new brcmf_fw_complete_request helper removing this code
-duplication.
-
-Signed-off-by: Hans de Goede <[email protected]>
-Signed-off-by: Kalle Valo <[email protected]>
----
- .../broadcom/brcm80211/brcmfmac/firmware.c         | 62 +++++++++++-----------
- 1 file changed, 31 insertions(+), 31 deletions(-)
-
---- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/firmware.c
-+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/firmware.c
-@@ -504,6 +504,34 @@ fail:
- 	return -ENOENT;
- }
- 
-+static int brcmf_fw_complete_request(const struct firmware *fw,
-+				     struct brcmf_fw *fwctx)
-+{
-+	struct brcmf_fw_item *cur = &fwctx->req->items[fwctx->curpos];
-+	int ret = 0;
-+
-+	brcmf_dbg(TRACE, "firmware %s %sfound\n", cur->path, fw ? "" : "not ");
-+
-+	switch (cur->type) {
-+	case BRCMF_FW_TYPE_NVRAM:
-+		ret = brcmf_fw_request_nvram_done(fw, fwctx);
-+		break;
-+	case BRCMF_FW_TYPE_BINARY:
-+		if (fw)
-+			cur->binary = fw;
-+		else
-+			ret = -ENOENT;
-+		break;
-+	default:
-+		/* something fishy here so bail out early */
-+		brcmf_err("unknown fw type: %d\n", cur->type);
-+		release_firmware(fw);
-+		ret = -EINVAL;
-+	}
-+
-+	return (cur->flags & BRCMF_FW_REQF_OPTIONAL) ? 0 : ret;
-+}
-+
- static int brcmf_fw_request_next_item(struct brcmf_fw *fwctx, bool async)
- {
- 	struct brcmf_fw_item *cur;
-@@ -525,15 +553,7 @@ static int brcmf_fw_request_next_item(st
- 	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);
--
-+		brcmf_fw_complete_request(fw, fwctx);
- 		return -EAGAIN;
- 	}
- 	return 0;
-@@ -547,28 +567,8 @@ static void brcmf_fw_request_done(const
- 
- 	cur = &fwctx->req->items[fwctx->curpos];
- 
--	brcmf_dbg(TRACE, "enter: firmware %s %sfound\n", cur->path,
--		  fw ? "" : "not ");
--
--	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))
-+	ret = brcmf_fw_complete_request(fw, fwctx);
-+	if (ret < 0)
- 		goto fail;
- 
- 	do {

+ 0 - 127
package/kernel/mac80211/patches/brcm/320-v5.0-0002-brcmfmac-Remove-recursion-from-firmware-load-error-h.patch

@@ -1,127 +0,0 @@
-From 5b587496dc63595b71265d986ce69728c2724370 Mon Sep 17 00:00:00 2001
-From: Hans de Goede <[email protected]>
-Date: Wed, 10 Oct 2018 13:00:59 +0200
-Subject: [PATCH] brcmfmac: Remove recursion from firmware load error handling
-
-Before this commit brcmf_fw_request_done would call
-brcmf_fw_request_next_item to load the next item, which on an error would
-call brcmf_fw_request_done, which if the error is recoverable (*) will
-then continue calling brcmf_fw_request_next_item for the next item again
-which on an error will call brcmf_fw_request_done again...
-
-This does not blow up because we only have a limited number of items so
-we never recurse too deep. But the recursion is still quite ugly and
-frankly is giving me a headache, so lets fix this.
-
-This commit fixes this by removing brcmf_fw_request_next_item and by
-making brcmf_fw_get_firmwares and brcmf_fw_request_done directly call
-firmware_request_nowait resp. firmware_request themselves.
-
-*) brcmf_fw_request_nvram_done fallback path succeeds or
-   BRCMF_FW_REQF_OPTIONAL is set
-
-Signed-off-by: Hans de Goede <[email protected]>
-Signed-off-by: Kalle Valo <[email protected]>
----
- .../broadcom/brcm80211/brcmfmac/firmware.c         | 65 +++++++---------------
- 1 file changed, 19 insertions(+), 46 deletions(-)
-
---- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/firmware.c
-+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/firmware.c
-@@ -532,33 +532,6 @@ static int brcmf_fw_complete_request(con
- 	return (cur->flags & BRCMF_FW_REQF_OPTIONAL) ? 0 : ret;
- }
- 
--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_fw_complete_request(fw, fwctx);
--		return -EAGAIN;
--	}
--	return 0;
--}
--
- static void brcmf_fw_request_done(const struct firmware *fw, void *ctx)
- {
- 	struct brcmf_fw *fwctx = ctx;
-@@ -568,26 +541,19 @@ static void brcmf_fw_request_done(const
- 	cur = &fwctx->req->items[fwctx->curpos];
- 
- 	ret = brcmf_fw_complete_request(fw, fwctx);
--	if (ret < 0)
--		goto fail;
- 
--	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 err=%d: dev=%s, fw=%s\n", ret,
--		  dev_name(fwctx->dev), cur->path);
--	brcmf_fw_free_request(fwctx->req);
--	fwctx->req = NULL;
--done:
-+	while (ret == 0 && ++fwctx->curpos < fwctx->req->n_items) {
-+		cur = &fwctx->req->items[fwctx->curpos];
-+		request_firmware(&fw, cur->path, fwctx->dev);
-+		ret = brcmf_fw_complete_request(fw, ctx);
-+	}
-+
-+	if (ret) {
-+		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;
-+	}
- 	fwctx->done(fwctx->dev, ret, fwctx->req);
- 	kfree(fwctx);
- }
-@@ -611,7 +577,9 @@ int brcmf_fw_get_firmwares(struct device
- 			   void (*fw_cb)(struct device *dev, int err,
- 					 struct brcmf_fw_request *req))
- {
-+	struct brcmf_fw_item *first = &req->items[0];
- 	struct brcmf_fw *fwctx;
-+	int ret;
- 
- 	brcmf_dbg(TRACE, "enter: dev=%s\n", dev_name(dev));
- 	if (!fw_cb)
-@@ -628,7 +596,12 @@ int brcmf_fw_get_firmwares(struct device
- 	fwctx->req = req;
- 	fwctx->done = fw_cb;
- 
--	brcmf_fw_request_next_item(fwctx, true);
-+	ret = request_firmware_nowait(THIS_MODULE, true, first->path,
-+				      fwctx->dev, GFP_KERNEL, fwctx,
-+				      brcmf_fw_request_done);
-+	if (ret < 0)
-+		brcmf_fw_request_done(NULL, fwctx);
-+
- 	return 0;
- }
- 

+ 0 - 77
package/kernel/mac80211/patches/brcm/320-v5.0-0003-brcmfmac-Add-support-for-first-trying-to-get-a-board.patch

@@ -1,77 +0,0 @@
-From eae8e50669e15002b195177212a6e25afbe7cf4d Mon Sep 17 00:00:00 2001
-From: Hans de Goede <[email protected]>
-Date: Wed, 10 Oct 2018 13:01:00 +0200
-Subject: [PATCH] brcmfmac: Add support for first trying to get a board
- specific nvram file
-
-The nvram files which some brcmfmac chips need are board-specific. To be
-able to distribute these as part of linux-firmware, so that devices with
-such a wifi chip will work OOTB, multiple (one per board) versions must
-co-exist under /lib/firmware.
-
-This commit adds support for callers of the brcmfmac/firmware.c code to
-pass in a board_type parameter through the request structure.
-
-If that parameter is set then the code will first try to load
-chipmodel.board_type.txt before falling back to the old chipmodel.txt name.
-
-Signed-off-by: Hans de Goede <[email protected]>
-Signed-off-by: Kalle Valo <[email protected]>
----
- .../broadcom/brcm80211/brcmfmac/firmware.c         | 27 +++++++++++++++++++++-
- .../broadcom/brcm80211/brcmfmac/firmware.h         |  1 +
- 2 files changed, 27 insertions(+), 1 deletion(-)
-
---- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/firmware.c
-+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/firmware.c
-@@ -532,6 +532,31 @@ static int brcmf_fw_complete_request(con
- 	return (cur->flags & BRCMF_FW_REQF_OPTIONAL) ? 0 : ret;
- }
- 
-+static int brcmf_fw_request_firmware(const struct firmware **fw,
-+				     struct brcmf_fw *fwctx)
-+{
-+	struct brcmf_fw_item *cur = &fwctx->req->items[fwctx->curpos];
-+	int ret;
-+
-+	/* nvram files are board-specific, first try a board-specific path */
-+	if (cur->type == BRCMF_FW_TYPE_NVRAM && fwctx->req->board_type) {
-+		char alt_path[BRCMF_FW_NAME_LEN];
-+
-+		strlcpy(alt_path, cur->path, BRCMF_FW_NAME_LEN);
-+		/* strip .txt at the end */
-+		alt_path[strlen(alt_path) - 4] = 0;
-+		strlcat(alt_path, ".", BRCMF_FW_NAME_LEN);
-+		strlcat(alt_path, fwctx->req->board_type, BRCMF_FW_NAME_LEN);
-+		strlcat(alt_path, ".txt", BRCMF_FW_NAME_LEN);
-+
-+		ret = request_firmware(fw, alt_path, fwctx->dev);
-+		if (ret == 0)
-+			return ret;
-+	}
-+
-+	return request_firmware(fw, cur->path, fwctx->dev);
-+}
-+
- static void brcmf_fw_request_done(const struct firmware *fw, void *ctx)
- {
- 	struct brcmf_fw *fwctx = ctx;
-@@ -544,7 +569,7 @@ static void brcmf_fw_request_done(const
- 
- 	while (ret == 0 && ++fwctx->curpos < fwctx->req->n_items) {
- 		cur = &fwctx->req->items[fwctx->curpos];
--		request_firmware(&fw, cur->path, fwctx->dev);
-+		brcmf_fw_request_firmware(&fw, fwctx);
- 		ret = brcmf_fw_complete_request(fw, ctx);
- 	}
- 
---- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/firmware.h
-+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/firmware.h
-@@ -70,6 +70,7 @@ struct brcmf_fw_request {
- 	u16 domain_nr;
- 	u16 bus_nr;
- 	u32 n_items;
-+	const char *board_type;
- 	struct brcmf_fw_item items[0];
- };
- 

+ 0 - 77
package/kernel/mac80211/patches/brcm/320-v5.0-0004-brcmfmac-Set-board_type-used-for-nvram-file-selectio.patch

@@ -1,77 +0,0 @@
-From 0ad4b55b2f29784f93875e6231bf57cd233624a2 Mon Sep 17 00:00:00 2001
-From: Hans de Goede <[email protected]>
-Date: Wed, 10 Oct 2018 13:01:01 +0200
-Subject: [PATCH] brcmfmac: Set board_type used for nvram file selection to
- machine-compatible
-
-For of/devicetree using machines, set the board_type used for nvram file
-selection to the first string listed in the top-level's node compatible
-string, aka the machine-compatible as used by of_machine_is_compatible().
-
-The board_type setting is used to load the board-specific nvram file with
-a board-specific name so that we can ship files for each supported board
-in linux-firmware.
-
-Signed-off-by: Hans de Goede <[email protected]>
-Signed-off-by: Kalle Valo <[email protected]>
----
- drivers/net/wireless/broadcom/brcm80211/brcmfmac/common.h |  1 +
- drivers/net/wireless/broadcom/brcm80211/brcmfmac/of.c     | 11 ++++++++++-
- drivers/net/wireless/broadcom/brcm80211/brcmfmac/pcie.c   |  1 +
- drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c   |  1 +
- 4 files changed, 13 insertions(+), 1 deletion(-)
-
---- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/common.h
-+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/common.h
-@@ -59,6 +59,7 @@ struct brcmf_mp_device {
- 	bool		iapp;
- 	bool		ignore_probe_fail;
- 	struct brcmfmac_pd_cc *country_codes;
-+	const char	*board_type;
- 	union {
- 		struct brcmfmac_sdio_pd sdio;
- 	} bus;
---- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/of.c
-+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/of.c
-@@ -27,11 +27,20 @@ void brcmf_of_probe(struct device *dev,
- 		    struct brcmf_mp_device *settings)
- {
- 	struct brcmfmac_sdio_pd *sdio = &settings->bus.sdio;
--	struct device_node *np = dev->of_node;
-+	struct device_node *root, *np = dev->of_node;
-+	struct property *prop;
- 	int irq;
- 	u32 irqf;
- 	u32 val;
- 
-+	/* Set board-type to the first string of the machine compatible prop */
-+	root = of_find_node_by_path("/");
-+	if (root) {
-+		prop = of_find_property(root, "compatible", NULL);
-+		settings->board_type = of_prop_next_string(prop, NULL);
-+		of_node_put(root);
-+	}
-+
- 	if (!np || bus_type != BRCMF_BUSTYPE_SDIO ||
- 	    !of_device_is_compatible(np, "brcm,bcm4329-fmac"))
- 		return;
---- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/pcie.c
-+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/pcie.c
-@@ -1785,6 +1785,7 @@ 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->board_type = devinfo->settings->board_type;
- 	/* 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;
---- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c
-+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c
-@@ -4174,6 +4174,7 @@ brcmf_sdio_prepare_fw_request(struct brc
- 
- 	fwreq->items[BRCMF_SDIO_FW_CODE].type = BRCMF_FW_TYPE_BINARY;
- 	fwreq->items[BRCMF_SDIO_FW_NVRAM].type = BRCMF_FW_TYPE_NVRAM;
-+	fwreq->board_type = bus->sdiodev->settings->board_type;
- 
- 	return fwreq;
- }

+ 0 - 179
package/kernel/mac80211/patches/brcm/320-v5.0-0005-brcmfmac-Set-board_type-from-DMI-on-x86-based-machin.patch

@@ -1,179 +0,0 @@
-From bd1e82bb420adf4ad7cd468d8a482cde622dd69d Mon Sep 17 00:00:00 2001
-From: Hans de Goede <[email protected]>
-Date: Wed, 10 Oct 2018 13:01:02 +0200
-Subject: [PATCH] brcmfmac: Set board_type from DMI on x86 based machines
-
-For x86 based machines, set the board_type used for nvram file selection
-based on the DMI sys-vendor and product-name strings.
-
-Since on some models these strings are too generic, this commit also adds
-a quirk table overriding the strings for models listed in that table.
-
-The board_type setting is used to load the board-specific nvram file with
-a board-specific name so that we can ship files for each supported board
-in linux-firmware.
-
-Signed-off-by: Hans de Goede <[email protected]>
-Signed-off-by: Kalle Valo <[email protected]>
----
- .../wireless/broadcom/brcm80211/brcmfmac/Makefile  |   2 +
- .../wireless/broadcom/brcm80211/brcmfmac/common.c  |   3 +-
- .../wireless/broadcom/brcm80211/brcmfmac/common.h  |   7 ++
- .../net/wireless/broadcom/brcm80211/brcmfmac/dmi.c | 116 +++++++++++++++++++++
- 4 files changed, 127 insertions(+), 1 deletion(-)
- create mode 100644 drivers/net/wireless/broadcom/brcm80211/brcmfmac/dmi.c
-
---- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/Makefile
-+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/Makefile
-@@ -54,3 +54,5 @@ brcmfmac-$(CPTCFG_BRCM_TRACING) += \
- 		tracepoint.o
- brcmfmac-$(CONFIG_OF) += \
- 		of.o
-+brcmfmac-$(CONFIG_DMI) += \
-+		dmi.o
---- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/common.c
-+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/common.c
-@@ -448,8 +448,9 @@ struct brcmf_mp_device *brcmf_get_module
- 		}
- 	}
- 	if (!found) {
--		/* No platform data for this device, try OF (Open Firwmare) */
-+		/* No platform data for this device, try OF and DMI data */
- 		brcmf_of_probe(dev, bus_type, settings);
-+		brcmf_dmi_probe(settings, chip, chiprev);
- 	}
- 	return settings;
- }
---- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/common.h
-+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/common.h
-@@ -75,4 +75,11 @@ void brcmf_release_module_param(struct b
- /* Sets dongle media info (drv_version, mac address). */
- int brcmf_c_preinit_dcmds(struct brcmf_if *ifp);
- 
-+#ifdef CONFIG_DMI
-+void brcmf_dmi_probe(struct brcmf_mp_device *settings, u32 chip, u32 chiprev);
-+#else
-+static inline void
-+brcmf_dmi_probe(struct brcmf_mp_device *settings, u32 chip, u32 chiprev) {}
-+#endif
-+
- #endif /* BRCMFMAC_COMMON_H */
---- /dev/null
-+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/dmi.c
-@@ -0,0 +1,116 @@
-+/*
-+ * Copyright 2018 Hans de Goede <[email protected]>
-+ *
-+ * Permission to use, copy, modify, and/or distribute this software for any
-+ * purpose with or without fee is hereby granted, provided that the above
-+ * copyright notice and this permission notice appear in all copies.
-+ *
-+ * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
-+ * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
-+ * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
-+ * SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
-+ * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION
-+ * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
-+ * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
-+ */
-+
-+#include <linux/dmi.h>
-+#include <linux/mod_devicetable.h>
-+#include "core.h"
-+#include "common.h"
-+#include "brcm_hw_ids.h"
-+
-+/* The DMI data never changes so we can use a static buf for this */
-+static char dmi_board_type[128];
-+
-+struct brcmf_dmi_data {
-+	u32 chip;
-+	u32 chiprev;
-+	const char *board_type;
-+};
-+
-+/* NOTE: Please keep all entries sorted alphabetically */
-+
-+static const struct brcmf_dmi_data gpd_win_pocket_data = {
-+	BRCM_CC_4356_CHIP_ID, 2, "gpd-win-pocket"
-+};
-+
-+static const struct brcmf_dmi_data jumper_ezpad_mini3_data = {
-+	BRCM_CC_43430_CHIP_ID, 0, "jumper-ezpad-mini3"
-+};
-+
-+static const struct brcmf_dmi_data meegopad_t08_data = {
-+	BRCM_CC_43340_CHIP_ID, 2, "meegopad-t08"
-+};
-+
-+static const struct dmi_system_id dmi_platform_data[] = {
-+	{
-+		/* Match for the GPDwin which unfortunately uses somewhat
-+		 * generic dmi strings, which is why we test for 4 strings.
-+		 * Comparing against 23 other byt/cht boards, board_vendor
-+		 * and board_name are unique to the GPDwin, where as only one
-+		 * other board has the same board_serial and 3 others have
-+		 * the same default product_name. Also the GPDwin is the
-+		 * only device to have both board_ and product_name not set.
-+		 */
-+		.matches = {
-+			DMI_MATCH(DMI_BOARD_VENDOR, "AMI Corporation"),
-+			DMI_MATCH(DMI_BOARD_NAME, "Default string"),
-+			DMI_MATCH(DMI_BOARD_SERIAL, "Default string"),
-+			DMI_MATCH(DMI_PRODUCT_NAME, "Default string"),
-+		},
-+		.driver_data = (void *)&gpd_win_pocket_data,
-+	},
-+	{
-+		/* Jumper EZpad mini3 */
-+		.matches = {
-+			DMI_MATCH(DMI_SYS_VENDOR, "Insyde"),
-+			DMI_MATCH(DMI_PRODUCT_NAME, "CherryTrail"),
-+			/* jumperx.T87.KFBNEEA02 with the version-nr dropped */
-+			DMI_MATCH(DMI_BIOS_VERSION, "jumperx.T87.KFBNEEA"),
-+		},
-+		.driver_data = (void *)&jumper_ezpad_mini3_data,
-+	},
-+	{
-+		/* Meegopad T08 */
-+		.matches = {
-+			DMI_MATCH(DMI_SYS_VENDOR, "Default string"),
-+			DMI_MATCH(DMI_PRODUCT_NAME, "Default string"),
-+			DMI_MATCH(DMI_BOARD_NAME, "T3 MRD"),
-+			DMI_MATCH(DMI_BOARD_VERSION, "V1.1"),
-+		},
-+		.driver_data = (void *)&meegopad_t08_data,
-+	},
-+	{}
-+};
-+
-+void brcmf_dmi_probe(struct brcmf_mp_device *settings, u32 chip, u32 chiprev)
-+{
-+	const struct dmi_system_id *match;
-+	const struct brcmf_dmi_data *data;
-+	const char *sys_vendor;
-+	const char *product_name;
-+
-+	/* Some models have DMI strings which are too generic, e.g.
-+	 * "Default string", we use a quirk table for these.
-+	 */
-+	for (match = dmi_first_match(dmi_platform_data);
-+	     match;
-+	     match = dmi_first_match(match + 1)) {
-+		data = match->driver_data;
-+
-+		if (data->chip == chip && data->chiprev == chiprev) {
-+			settings->board_type = data->board_type;
-+			return;
-+		}
-+	}
-+
-+	/* Not found in the quirk-table, use sys_vendor-product_name */
-+	sys_vendor = dmi_get_system_info(DMI_SYS_VENDOR);
-+	product_name = dmi_get_system_info(DMI_PRODUCT_NAME);
-+	if (sys_vendor && product_name) {
-+		snprintf(dmi_board_type, sizeof(dmi_board_type), "%s-%s",
-+			 sys_vendor, product_name);
-+		settings->board_type = dmi_board_type;
-+	}
-+}

+ 0 - 41
package/kernel/mac80211/patches/brcm/320-v5.0-0006-brcmfmac-Cleanup-brcmf_fw_request_done.patch

@@ -1,41 +0,0 @@
-From 55e491edbf14b2da5419c2a319ea3b1d6368d9a2 Mon Sep 17 00:00:00 2001
-From: Hans de Goede <[email protected]>
-Date: Wed, 10 Oct 2018 13:01:03 +0200
-Subject: [PATCH] brcmfmac: Cleanup brcmf_fw_request_done()
-
-The "cur" variable is now only used for a debug print and we already
-print the same info from brcmf_fw_complete_request(), so the debug print
-does not provide any extra info and we can remove it.
-
-Signed-off-by: Hans de Goede <[email protected]>
-Signed-off-by: Kalle Valo <[email protected]>
----
- drivers/net/wireless/broadcom/brcm80211/brcmfmac/firmware.c | 8 +-------
- 1 file changed, 1 insertion(+), 7 deletions(-)
-
---- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/firmware.c
-+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/firmware.c
-@@ -560,22 +560,16 @@ static int brcmf_fw_request_firmware(con
- 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;
--
--	cur = &fwctx->req->items[fwctx->curpos];
-+	int ret;
- 
- 	ret = brcmf_fw_complete_request(fw, fwctx);
- 
- 	while (ret == 0 && ++fwctx->curpos < fwctx->req->n_items) {
--		cur = &fwctx->req->items[fwctx->curpos];
- 		brcmf_fw_request_firmware(&fw, fwctx);
- 		ret = brcmf_fw_complete_request(fw, ctx);
- 	}
- 
- 	if (ret) {
--		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;
- 	}

+ 0 - 132
package/kernel/mac80211/patches/brcm/321-v5.0-0001-brcmfmac-Add-support-for-getting-nvram-contents-from.patch

@@ -1,132 +0,0 @@
-From ce2e6db554fad444fa0b3904fc3015336e0ef765 Mon Sep 17 00:00:00 2001
-From: Hans de Goede <[email protected]>
-Date: Thu, 11 Oct 2018 11:51:06 +0200
-Subject: [PATCH] brcmfmac: Add support for getting nvram contents from EFI
- variables
-
-Various X86 laptops with a SDIO attached brcmfmac wifi chip, store the
-nvram contents in a special EFI variable. This commit adds support for
-getting nvram directly from this EFI variable, without the user needing
-to manually copy it.
-
-This makes Wifi / Bluetooth work out of the box on these devices instead of
-requiring manual setup.
-
-This has been tested on the following models: Acer Iconia Tab8 w1-810,
-Acer One 10, Asus T100CHI, Asus T100HA, Asus T100TA, Asus T200TA and a
-Lenovo Mixx 2 8.
-
-Tested-by: Hans de Goede <[email protected]>
-Signed-off-by: Hans de Goede <[email protected]>
-Signed-off-by: Kalle Valo <[email protected]>
----
- .../broadcom/brcm80211/brcmfmac/firmware.c         | 63 +++++++++++++++++++---
- 1 file changed, 57 insertions(+), 6 deletions(-)
-
---- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/firmware.c
-+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/firmware.c
-@@ -14,6 +14,7 @@
-  * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
-  */
- 
-+#include <linux/efi.h>
- #include <linux/kernel.h>
- #include <linux/slab.h>
- #include <linux/device.h>
-@@ -445,6 +446,51 @@ struct brcmf_fw {
- 
- static void brcmf_fw_request_done(const struct firmware *fw, void *ctx);
- 
-+#ifdef CONFIG_EFI
-+static u8 *brcmf_fw_nvram_from_efi(size_t *data_len_ret)
-+{
-+	const u16 name[] = { 'n', 'v', 'r', 'a', 'm', 0 };
-+	struct efivar_entry *nvram_efivar;
-+	unsigned long data_len = 0;
-+	u8 *data = NULL;
-+	int err;
-+
-+	nvram_efivar = kzalloc(sizeof(*nvram_efivar), GFP_KERNEL);
-+	if (!nvram_efivar)
-+		return NULL;
-+
-+	memcpy(&nvram_efivar->var.VariableName, name, sizeof(name));
-+	nvram_efivar->var.VendorGuid = EFI_GUID(0x74b00bd9, 0x805a, 0x4d61,
-+						0xb5, 0x1f, 0x43, 0x26,
-+						0x81, 0x23, 0xd1, 0x13);
-+
-+	err = efivar_entry_size(nvram_efivar, &data_len);
-+	if (err)
-+		goto fail;
-+
-+	data = kmalloc(data_len, GFP_KERNEL);
-+	if (!data)
-+		goto fail;
-+
-+	err = efivar_entry_get(nvram_efivar, NULL, &data_len, data);
-+	if (err)
-+		goto fail;
-+
-+	brcmf_info("Using nvram EFI variable\n");
-+
-+	kfree(nvram_efivar);
-+	*data_len_ret = data_len;
-+	return data;
-+
-+fail:
-+	kfree(data);
-+	kfree(nvram_efivar);
-+	return NULL;
-+}
-+#else
-+static u8 *brcmf_fw_nvram_from_efi(size_t *data_len) { return NULL; }
-+#endif
-+
- static void brcmf_fw_free_request(struct brcmf_fw_request *req)
- {
- 	struct brcmf_fw_item *item;
-@@ -463,11 +509,12 @@ static int brcmf_fw_request_nvram_done(c
- {
- 	struct brcmf_fw *fwctx = ctx;
- 	struct brcmf_fw_item *cur;
-+	bool free_bcm47xx_nvram = false;
-+	bool kfree_nvram = false;
- 	u32 nvram_length = 0;
- 	void *nvram = NULL;
- 	u8 *data = NULL;
- 	size_t data_len;
--	bool raw_nvram;
- 
- 	brcmf_dbg(TRACE, "enter: dev=%s\n", dev_name(fwctx->dev));
- 
-@@ -476,12 +523,13 @@ static int brcmf_fw_request_nvram_done(c
- 	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 && !(cur->flags & BRCMF_FW_REQF_OPTIONAL))
-+		if ((data = bcm47xx_nvram_get_contents(&data_len)))
-+			free_bcm47xx_nvram = true;
-+		else if ((data = brcmf_fw_nvram_from_efi(&data_len)))
-+			kfree_nvram = true;
-+		else if (!(cur->flags & BRCMF_FW_REQF_OPTIONAL))
- 			goto fail;
--		raw_nvram = true;
- 	}
- 
- 	if (data)
-@@ -489,8 +537,11 @@ static int brcmf_fw_request_nvram_done(c
- 					     fwctx->req->domain_nr,
- 					     fwctx->req->bus_nr);
- 
--	if (raw_nvram)
-+	if (free_bcm47xx_nvram)
- 		bcm47xx_nvram_release_contents(data);
-+	if (kfree_nvram)
-+		kfree(data);
-+
- 	release_firmware(fw);
- 	if (!nvram && !(cur->flags & BRCMF_FW_REQF_OPTIONAL))
- 		goto fail;

+ 0 - 97
package/kernel/mac80211/patches/brcm/321-v5.0-0002-brcmfmac-Fix-ccode-from-EFI-nvram-when-necessary.patch

@@ -1,97 +0,0 @@
-From 29ec3394f0bd85c22674ab6693d92da5e2324610 Mon Sep 17 00:00:00 2001
-From: Hans de Goede <[email protected]>
-Date: Thu, 11 Oct 2018 11:51:07 +0200
-Subject: [PATCH] brcmfmac: Fix ccode from EFI nvram when necessary
-
-In some cases the EFI-var stored nvram contains "ccode=ALL" or "ccode=XV"
-to specify "worldwide" compatible settings, but these 2 ccode-s do not work
-properly.
-
-I've tested the different known "worldwide" ccode-s used in various nvram
-sources with the latest firmwares from linux-firmware for various brcmfmac
-models, here is a simplified (*) table with what each setting results in:
-
-ALL: 12-14 disab, U-NII-1, U-NII-2 no-IR/radar, U-NII-3
-XV:  12-14 no-IR, disables all 5G channels
-XY:  12-13 enab, 14 disab, U-NII-1 enab, U-NII-2 no-IR/radar, U-NII-3 disab
-X2:  12-13 no-IR, 14 dis, U-NII-1 no-IR, U-NII-2 no-IR/radar, U-NII-3 no-IR
-
-Where 12,13,14 are 2.4G channels 12-14 and U-NII-1/2/3 are the 3 different
-5G channel groups. no-IR is no-Initiate-Radiation, we will never send on
-these channels without first having received valid wifi traffic there.
-
-This immediately shows that both ALL and XV are not as worldwide as we want
-them to be. ALL causes channels 12 and 13 to not be available and XV causes
-all 5GHz channels to not be available. Also ALL unconditionally enables the
-U-NII-1 and U-NII-3 5G groups, while we really should be using no-IR for
-these.
-
-This commit replace XV and ALL with X2, which allows usage of chan 12-13
-and 5G channels, but only after receiving valid wifi traffic there first.
-
-Note that this configure the firmware's channel limits, the kernels own
-regulatory restrictions based on e.g. regulatory info received from the
-access-point, will be applied on top of this.
-
-This fixes channels 12+13 not working on the Asus T200TA and the Lenovo
-Mixx 2 8 and 5G channels not working on the Asus T100HA.
-
-This has been tested on the following models: Acer Iconia Tab8 w1-810,
-Acer One 10, Asus T100CHI, Asus T100HA, Asus T100TA, Asus T200TA and a
-Lenovo Mixx 2 8.
-
-*) There are some exceptions to this table:
-1) On really old firmware e.g. linux-firmware's 2011 brcmfmac4330-sdio.bin
-   ALL really means all, unconditionally enabling everything
-2) The exact meaning might be influenced by setting the regrev nvram var.
-   Specifically using ccode=XV + regrev=1 on brcmfmac43241b4 leads to:
-   12-14 no-ir, U-NII-1 no-ir, U-NII-2 no-ir/radar, U-NII-3 no-ir
-   But only on the brcmfmac43241b4 and not on e.g. the brcmfmac43340
-
-Tested-by: Hans de Goede <[email protected]>
-Signed-off-by: Hans de Goede <[email protected]>
-Signed-off-by: Kalle Valo <[email protected]>
----
- .../broadcom/brcm80211/brcmfmac/firmware.c         | 24 ++++++++++++++++++++++
- 1 file changed, 24 insertions(+)
-
---- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/firmware.c
-+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/firmware.c
-@@ -447,6 +447,29 @@ struct brcmf_fw {
- static void brcmf_fw_request_done(const struct firmware *fw, void *ctx);
- 
- #ifdef CONFIG_EFI
-+/* In some cases the EFI-var stored nvram contains "ccode=ALL" or "ccode=XV"
-+ * to specify "worldwide" compatible settings, but these 2 ccode-s do not work
-+ * properly. "ccode=ALL" causes channels 12 and 13 to not be available,
-+ * "ccode=XV" causes all 5GHz channels to not be available. So we replace both
-+ * with "ccode=X2" which allows channels 12+13 and 5Ghz channels in
-+ * no-Initiate-Radiation mode. This means that we will never send on these
-+ * channels without first having received valid wifi traffic on the channel.
-+ */
-+static void brcmf_fw_fix_efi_nvram_ccode(char *data, unsigned long data_len)
-+{
-+	char *ccode;
-+
-+	ccode = strnstr((char *)data, "ccode=ALL", data_len);
-+	if (!ccode)
-+		ccode = strnstr((char *)data, "ccode=XV\r", data_len);
-+	if (!ccode)
-+		return;
-+
-+	ccode[6] = 'X';
-+	ccode[7] = '2';
-+	ccode[8] = '\r';
-+}
-+
- static u8 *brcmf_fw_nvram_from_efi(size_t *data_len_ret)
- {
- 	const u16 name[] = { 'n', 'v', 'r', 'a', 'm', 0 };
-@@ -476,6 +499,7 @@ static u8 *brcmf_fw_nvram_from_efi(size_
- 	if (err)
- 		goto fail;
- 
-+	brcmf_fw_fix_efi_nvram_ccode(data, data_len);
- 	brcmf_info("Using nvram EFI variable\n");
- 
- 	kfree(nvram_efivar);

+ 0 - 34
package/kernel/mac80211/patches/brcm/322-v5.0-0001-brcmfmac-fix-spelling-mistake-Retreiving-Retrieving.patch

@@ -1,34 +0,0 @@
-From e966a79c2f761a696dec9cfb0e2d4aa977bf78cb Mon Sep 17 00:00:00 2001
-From: Colin Ian King <[email protected]>
-Date: Tue, 16 Oct 2018 18:43:42 +0100
-Subject: [PATCH] brcmfmac: fix spelling mistake "Retreiving" -> "Retrieving"
-
-Trivial fix to spelling mistake in brcmf_err error message.
-
-Signed-off-by: Colin Ian King <[email protected]>
-Acked-by: Arend van Spriel <[email protected]>
-Signed-off-by: Kalle Valo <[email protected]>
----
- drivers/net/wireless/broadcom/brcm80211/brcmfmac/common.c | 4 ++--
- 1 file changed, 2 insertions(+), 2 deletions(-)
-
---- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/common.c
-+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/common.c
-@@ -214,7 +214,7 @@ int brcmf_c_preinit_dcmds(struct brcmf_i
- 	err = brcmf_fil_iovar_data_get(ifp, "cur_etheraddr", ifp->mac_addr,
- 				       sizeof(ifp->mac_addr));
- 	if (err < 0) {
--		brcmf_err("Retreiving cur_etheraddr failed, %d\n", err);
-+		brcmf_err("Retrieving cur_etheraddr failed, %d\n", err);
- 		goto done;
- 	}
- 	memcpy(ifp->drvr->wiphy->perm_addr, ifp->drvr->mac, ETH_ALEN);
-@@ -269,7 +269,7 @@ int brcmf_c_preinit_dcmds(struct brcmf_i
- 	strcpy(buf, "ver");
- 	err = brcmf_fil_iovar_data_get(ifp, "ver", buf, sizeof(buf));
- 	if (err < 0) {
--		brcmf_err("Retreiving version information failed, %d\n",
-+		brcmf_err("Retrieving version information failed, %d\n",
- 			  err);
- 		goto done;
- 	}

+ 0 - 83
package/kernel/mac80211/patches/brcm/323-v5.0-0001-brcmutil-print-invalid-chanspec-when-WARN-ing.patch

@@ -1,83 +0,0 @@
-From ae5848cb4511bbbfe0306fcdbe5d9a95cd9546a9 Mon Sep 17 00:00:00 2001
-From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= <[email protected]>
-Date: Fri, 26 Oct 2018 13:22:32 +0200
-Subject: [PATCH] brcmutil: print invalid chanspec when WARN-ing
-MIME-Version: 1.0
-Content-Type: text/plain; charset=UTF-8
-Content-Transfer-Encoding: 8bit
-
-On one of my devices I got WARNINGs when brcmfmac tried to decode
-chanspec. I couldn't tell if it was some unsupported format or just a
-malformed value passed by a firmware.
-
-Print chanspec value so it's possible to debug a possible problem.
-
-Signed-off-by: Rafał Miłecki <[email protected]>
-Signed-off-by: Kalle Valo <[email protected]>
----
- drivers/net/wireless/broadcom/brcm80211/brcmutil/d11.c | 14 +++++++-------
- 1 file changed, 7 insertions(+), 7 deletions(-)
-
---- a/drivers/net/wireless/broadcom/brcm80211/brcmutil/d11.c
-+++ b/drivers/net/wireless/broadcom/brcm80211/brcmutil/d11.c
-@@ -128,7 +128,7 @@ static void brcmu_d11n_decchspec(struct
- 		}
- 		break;
- 	default:
--		WARN_ON_ONCE(1);
-+		WARN_ONCE(1, "Invalid chanspec 0x%04x\n", ch->chspec);
- 		break;
- 	}
- 
-@@ -140,7 +140,7 @@ static void brcmu_d11n_decchspec(struct
- 		ch->band = BRCMU_CHAN_BAND_2G;
- 		break;
- 	default:
--		WARN_ON_ONCE(1);
-+		WARN_ONCE(1, "Invalid chanspec 0x%04x\n", ch->chspec);
- 		break;
- 	}
- }
-@@ -167,7 +167,7 @@ static void brcmu_d11ac_decchspec(struct
- 			ch->sb = BRCMU_CHAN_SB_U;
- 			ch->control_ch_num += CH_10MHZ_APART;
- 		} else {
--			WARN_ON_ONCE(1);
-+			WARN_ONCE(1, "Invalid chanspec 0x%04x\n", ch->chspec);
- 		}
- 		break;
- 	case BRCMU_CHSPEC_D11AC_BW_80:
-@@ -188,7 +188,7 @@ static void brcmu_d11ac_decchspec(struct
- 			ch->control_ch_num += CH_30MHZ_APART;
- 			break;
- 		default:
--			WARN_ON_ONCE(1);
-+			WARN_ONCE(1, "Invalid chanspec 0x%04x\n", ch->chspec);
- 			break;
- 		}
- 		break;
-@@ -222,13 +222,13 @@ static void brcmu_d11ac_decchspec(struct
- 			ch->control_ch_num += CH_70MHZ_APART;
- 			break;
- 		default:
--			WARN_ON_ONCE(1);
-+			WARN_ONCE(1, "Invalid chanspec 0x%04x\n", ch->chspec);
- 			break;
- 		}
- 		break;
- 	case BRCMU_CHSPEC_D11AC_BW_8080:
- 	default:
--		WARN_ON_ONCE(1);
-+		WARN_ONCE(1, "Invalid chanspec 0x%04x\n", ch->chspec);
- 		break;
- 	}
- 
-@@ -240,7 +240,7 @@ static void brcmu_d11ac_decchspec(struct
- 		ch->band = BRCMU_CHAN_BAND_2G;
- 		break;
- 	default:
--		WARN_ON_ONCE(1);
-+		WARN_ONCE(1, "Invalid chanspec 0x%04x\n", ch->chspec);
- 		break;
- 	}
- }

+ 0 - 80
package/kernel/mac80211/patches/brcm/325-v5.0-brcmfmac-support-STA-info-struct-v7.patch

@@ -1,80 +0,0 @@
-From 4282ff17e557d319e1b988fa4f582792cfaf6fff Mon Sep 17 00:00:00 2001
-From: Dan Haab <[email protected]>
-Date: Fri, 9 Nov 2018 09:38:55 -0700
-Subject: [PATCH] brcmfmac: support STA info struct v7
-MIME-Version: 1.0
-Content-Type: text/plain; charset=UTF-8
-Content-Transfer-Encoding: 8bit
-
-The newest firmwares provide STA info using v7 of the struct. As v7
-isn't backward compatible, a union is needed.
-
-Even though brcmfmac does not use any of the new info it's important to
-provide the proper struct buffer. Without this change new firmwares will
-fallback to the very limited v3 instead of something in between such as
-v4.
-
-Signed-off-by: Dan Haab <[email protected]>
-Reviewed-by: Rafał Miłecki <[email protected]>
-Reviewed-by: Arend van Spriel <[email protected]>
-Signed-off-by: Kalle Valo <[email protected]>
----
- .../broadcom/brcm80211/brcmfmac/fwil_types.h  | 40 +++++++++++++++----
- 1 file changed, 33 insertions(+), 7 deletions(-)
-
---- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/fwil_types.h
-+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/fwil_types.h
-@@ -176,6 +176,8 @@
- 
- #define BRCMF_VHT_CAP_MCS_MAP_NSS_MAX	8
- 
-+#define BRCMF_HE_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.
-@@ -601,13 +603,37 @@ 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;
-+	union {
-+		struct {
-+			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;
-+		} v5;
-+
-+		struct {
-+			__le32 rx_dur_total;	/* total user RX duration (estimated) */
-+			__le16 chanspec;	/** chanspec this sta is on */
-+			__le16 pad_1;
-+			struct {
-+				__le16 version;					/* version */
-+				__le16 len;					/* length */
-+				__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 */
-+				__le16 he_mcs[BRCMF_HE_CAP_MCS_MAP_NSS_MAX];	/* supported he mcs index bit map per nss */
-+			} rateset_adv;		/* rateset along with mcs index bitmap */
-+			__le16 wpauth;		/* authentication type */
-+			u8 algo;		/* crypto algorithm */
-+			u8 pad_2;
-+			__le32 tx_rspec;	/* Rate of last successful tx frame */
-+			__le32 rx_rspec;	/* Rate of last successful rx frame */
-+			__le32 wnm_cap;		/* wnm capabilities */
-+		} v7;
-+	};
- };
- 
- struct brcmf_chanspec_list {

+ 0 - 39
package/kernel/mac80211/patches/brcm/326-v5.0-brcmfmac-Call-brcmf_dmi_probe-before-brcmf_of_probe.patch

@@ -1,39 +0,0 @@
-From 554da3868eb1d7174710c18b4ddd6ff01f6d612c Mon Sep 17 00:00:00 2001
-From: Hans de Goede <[email protected]>
-Date: Fri, 23 Nov 2018 10:11:48 +0100
-Subject: [PATCH] brcmfmac: Call brcmf_dmi_probe before brcmf_of_probe
-
-ARM systems with UEFI may have both devicetree (of) and DMI data in this
-case we end up setting brcmf_mp_device.board_type twice.
-
-In this case we should prefer the devicetree data, because:
-1) The devicerree data is more reliable
-2) Some ARM systems (e.g. the Raspberry Pi 3 models) support both UEFI and
-   classic uboot booting, the devicetree data is always there, so using it
-   makes sure we ask for the same nvram file independent of how we booted.
-
-This commit moves the brcmf_dmi_probe call to before the brcmf_of_probe
-call, so that the latter can override the value of the first if both are
-set.
-
-Fixes: bd1e82bb420a ("brcmfmac: Set board_type from DMI on x86 based ...")
-Cc: Peter Robinson <[email protected]>
-Tested-and-reported-by: Peter Robinson <[email protected]>
-Signed-off-by: Hans de Goede <[email protected]>
-Signed-off-by: Kalle Valo <[email protected]>
----
- drivers/net/wireless/broadcom/brcm80211/brcmfmac/common.c | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
---- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/common.c
-+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/common.c
-@@ -449,8 +449,8 @@ struct brcmf_mp_device *brcmf_get_module
- 	}
- 	if (!found) {
- 		/* No platform data for this device, try OF and DMI data */
--		brcmf_of_probe(dev, bus_type, settings);
- 		brcmf_dmi_probe(settings, chip, chiprev);
-+		brcmf_of_probe(dev, bus_type, settings);
- 	}
- 	return settings;
- }

+ 0 - 95
package/kernel/mac80211/patches/brcm/328-v5.0-0001-brcmfmac-add-credit-numbers-updating-support.patch

@@ -1,95 +0,0 @@
-From 153e22c0ff1260035cd7fe72c8aeead1f5fac757 Mon Sep 17 00:00:00 2001
-From: Wright Feng <[email protected]>
-Date: Mon, 5 Nov 2018 05:51:54 +0000
-Subject: [PATCH] brcmfmac: add credit numbers updating support
-
-The credit numbers are static and tunable per chip in firmware side.
-However the credit number may be changed that is based on packet pool
-length and will send BRCMF_E_FIFO_CREDIT_MAP event to notify host driver
-updates the credit numbers during interface up.
-The purpose of this patch is making host driver has ability of updating
-the credit numbers when receiving the BRCMF_E_FIFO_CREDIT_MAP event.
-
-Signed-off-by: Wright Feng <[email protected]>
-Acked-by: Arend van Spriel <[email protected]>
-Signed-off-by: Kalle Valo <[email protected]>
----
- .../broadcom/brcm80211/brcmfmac/fwsignal.c    | 23 ++++++++++++-------
- 1 file changed, 15 insertions(+), 8 deletions(-)
-
---- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/fwsignal.c
-+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/fwsignal.c
-@@ -511,6 +511,7 @@ struct brcmf_fws_info {
- 	struct work_struct fws_dequeue_work;
- 	u32 fifo_enqpkt[BRCMF_FWS_FIFO_COUNT];
- 	int fifo_credit[BRCMF_FWS_FIFO_COUNT];
-+	int init_fifo_credit[BRCMF_FWS_FIFO_COUNT];
- 	int credits_borrowed[BRCMF_FWS_FIFO_AC_VO + 1];
- 	int deq_node_pos[BRCMF_FWS_FIFO_COUNT];
- 	u32 fifo_credit_map;
-@@ -1237,6 +1238,9 @@ static void brcmf_fws_return_credits(str
- 	}
- 
- 	fws->fifo_credit[fifo] += credits;
-+	if (fws->fifo_credit[fifo] > fws->init_fifo_credit[fifo])
-+		fws->fifo_credit[fifo] = fws->init_fifo_credit[fifo];
-+
- }
- 
- static void brcmf_fws_schedule_deq(struct brcmf_fws_info *fws)
-@@ -1595,19 +1599,21 @@ static int brcmf_fws_notify_credit_map(s
- 		brcmf_err("event payload too small (%d)\n", e->datalen);
- 		return -EINVAL;
- 	}
--	if (fws->creditmap_received)
--		return 0;
- 
- 	fws->creditmap_received = true;
- 
- 	brcmf_dbg(TRACE, "enter: credits %pM\n", credits);
- 	brcmf_fws_lock(fws);
- 	for (i = 0; i < ARRAY_SIZE(fws->fifo_credit); i++) {
--		if (*credits)
-+		fws->fifo_credit[i] += credits[i] - fws->init_fifo_credit[i];
-+		fws->init_fifo_credit[i] = credits[i];
-+		if (fws->fifo_credit[i] > 0)
- 			fws->fifo_credit_map |= 1 << i;
- 		else
- 			fws->fifo_credit_map &= ~(1 << i);
--		fws->fifo_credit[i] = *credits++;
-+		WARN_ONCE(fws->fifo_credit[i] < 0,
-+			  "fifo_credit[%d] is negative(%d)\n", i,
-+			  fws->fifo_credit[i]);
- 	}
- 	brcmf_fws_schedule_deq(fws);
- 	brcmf_fws_unlock(fws);
-@@ -2013,7 +2019,7 @@ static int brcmf_fws_borrow_credit(struc
- 	}
- 
- 	for (lender_ac = 0; lender_ac <= BRCMF_FWS_FIFO_AC_VO; lender_ac++) {
--		if (fws->fifo_credit[lender_ac]) {
-+		if (fws->fifo_credit[lender_ac] > 0) {
- 			fws->credits_borrowed[lender_ac]++;
- 			fws->fifo_credit[lender_ac]--;
- 			if (fws->fifo_credit[lender_ac] == 0)
-@@ -2210,8 +2216,9 @@ static void brcmf_fws_dequeue_worker(str
- 			}
- 			continue;
- 		}
--		while ((fws->fifo_credit[fifo]) || ((!fws->bcmc_credit_check) &&
--		       (fifo == BRCMF_FWS_FIFO_BCMC))) {
-+		while ((fws->fifo_credit[fifo] > 0) ||
-+		       ((!fws->bcmc_credit_check) &&
-+			(fifo == BRCMF_FWS_FIFO_BCMC))) {
- 			skb = brcmf_fws_deq(fws, fifo);
- 			if (!skb)
- 				break;
-@@ -2222,7 +2229,7 @@ static void brcmf_fws_dequeue_worker(str
- 				break;
- 		}
- 		if ((fifo == BRCMF_FWS_FIFO_AC_BE) &&
--		    (fws->fifo_credit[fifo] == 0) &&
-+		    (fws->fifo_credit[fifo] <= 0) &&
- 		    (!fws->bus_flow_blocked)) {
- 			while (brcmf_fws_borrow_credit(fws) == 0) {
- 				skb = brcmf_fws_deq(fws, fifo);

+ 0 - 42
package/kernel/mac80211/patches/brcm/328-v5.0-0002-brcmfmac-enable-frameburst-mode-in-default-firmware-.patch

@@ -1,42 +0,0 @@
-From a3bdc6deb60bf6be4405058ca49a686c4db08c39 Mon Sep 17 00:00:00 2001
-From: Wright Feng <[email protected]>
-Date: Mon, 5 Nov 2018 05:51:59 +0000
-Subject: [PATCH] brcmfmac: enable frameburst mode in default firmware setting
-
-The frameburst feature can enable per-packet framebursting in firmware
-side and get higher TX throughput in High Throughput(HT) mode. To enhance
-TX throughput, we enable frameburst mode in default firmware setting.
-
-Signed-off-by: Wright Feng <[email protected]>
-Acked-by: Arend van Spriel <[email protected]>
-Signed-off-by: Kalle Valo <[email protected]>
----
- drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c | 6 ++++++
- drivers/net/wireless/broadcom/brcm80211/brcmfmac/fwil.h     | 1 +
- 2 files changed, 7 insertions(+)
-
---- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c
-+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c
-@@ -6638,6 +6638,12 @@ static s32 brcmf_config_dongle(struct br
- 
- 	brcmf_configure_arp_nd_offload(ifp, true);
- 
-+	err = brcmf_fil_cmd_int_set(ifp, BRCMF_C_SET_FAKEFRAG, 1);
-+	if (err) {
-+		brcmf_err("failed to set frameburst mode\n");
-+		goto default_conf_out;
-+	}
-+
- 	cfg->dongle_up = true;
- default_conf_out:
- 
---- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/fwil.h
-+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/fwil.h
-@@ -80,6 +80,7 @@
- #define BRCMF_C_SCB_DEAUTHENTICATE_FOR_REASON	201
- #define BRCMF_C_SET_ASSOC_PREFER		205
- #define BRCMF_C_GET_VALID_CHANNELS		217
-+#define BRCMF_C_SET_FAKEFRAG			219
- #define BRCMF_C_GET_KEY_PRIMARY			235
- #define BRCMF_C_SET_KEY_PRIMARY			236
- #define BRCMF_C_SET_SCAN_PASSIVE_TIME		258

+ 0 - 229
package/kernel/mac80211/patches/brcm/328-v5.0-0003-brcmfmac-handle-compressed-tx-status-signal.patch

@@ -1,229 +0,0 @@
-From e4af3ffb43d50f070134aa1b40d5c3573f57deb1 Mon Sep 17 00:00:00 2001
-From: Chung-Hsien Hsu <[email protected]>
-Date: Mon, 5 Nov 2018 05:52:05 +0000
-Subject: [PATCH] brcmfmac: handle compressed tx status signal
-
-Firmware inform the driver about tx status by normal tx status signal
-or compressed tx status signal. This patch adds support to handle the
-compressed tx status signal.
-
-Signed-off-by: Chung-Hsien Hsu <[email protected]>
-Signed-off-by: Chi-Hsien Lin <[email protected]>
-Signed-off-by: Wright Feng <[email protected]>
-Acked-by: Arend van Spriel <[email protected]>
-Signed-off-by: Kalle Valo <[email protected]>
----
- .../broadcom/brcm80211/brcmfmac/fwsignal.c    | 121 ++++++++++--------
- 1 file changed, 71 insertions(+), 50 deletions(-)
-
---- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/fwsignal.c
-+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/fwsignal.c
-@@ -1455,9 +1455,10 @@ static int brcmf_fws_txstatus_suppressed
- 
- static int
- brcmf_fws_txs_process(struct brcmf_fws_info *fws, u8 flags, u32 hslot,
--		      u32 genbit, u16 seq)
-+		      u32 genbit, u16 seq, u8 compcnt)
- {
- 	u32 fifo;
-+	u8 cnt = 0;
- 	int ret;
- 	bool remove_from_hanger = true;
- 	struct sk_buff *skb;
-@@ -1468,60 +1469,71 @@ brcmf_fws_txs_process(struct brcmf_fws_i
- 	brcmf_dbg(DATA, "flags %d\n", flags);
- 
- 	if (flags == BRCMF_FWS_TXSTATUS_DISCARD)
--		fws->stats.txs_discard++;
-+		fws->stats.txs_discard += compcnt;
- 	else if (flags == BRCMF_FWS_TXSTATUS_CORE_SUPPRESS) {
--		fws->stats.txs_supp_core++;
-+		fws->stats.txs_supp_core += compcnt;
- 		remove_from_hanger = false;
- 	} else if (flags == BRCMF_FWS_TXSTATUS_FW_PS_SUPPRESS) {
--		fws->stats.txs_supp_ps++;
-+		fws->stats.txs_supp_ps += compcnt;
- 		remove_from_hanger = false;
- 	} else if (flags == BRCMF_FWS_TXSTATUS_FW_TOSSED)
--		fws->stats.txs_tossed++;
-+		fws->stats.txs_tossed += compcnt;
- 	else if (flags == BRCMF_FWS_TXSTATUS_HOST_TOSSED)
--		fws->stats.txs_host_tossed++;
-+		fws->stats.txs_host_tossed += compcnt;
- 	else
- 		brcmf_err("unexpected txstatus\n");
- 
--	ret = brcmf_fws_hanger_poppkt(&fws->hanger, hslot, &skb,
--				      remove_from_hanger);
--	if (ret != 0) {
--		brcmf_err("no packet in hanger slot: hslot=%d\n", hslot);
--		return ret;
--	}
-+	while (cnt < compcnt) {
-+		ret = brcmf_fws_hanger_poppkt(&fws->hanger, hslot, &skb,
-+					      remove_from_hanger);
-+		if (ret != 0) {
-+			brcmf_err("no packet in hanger slot: hslot=%d\n",
-+				  hslot);
-+			goto cont;
-+		}
- 
--	skcb = brcmf_skbcb(skb);
--	entry = skcb->mac;
--	if (WARN_ON(!entry)) {
--		brcmu_pkt_buf_free_skb(skb);
--		return -EINVAL;
--	}
--	entry->transit_count--;
--	if (entry->suppressed && entry->suppr_transit_count)
--		entry->suppr_transit_count--;
--
--	brcmf_dbg(DATA, "%s flags %d htod %X seq %X\n", entry->name, flags,
--		  skcb->htod, seq);
--
--	/* pick up the implicit credit from this packet */
--	fifo = brcmf_skb_htod_tag_get_field(skb, FIFO);
--	if ((fws->fcmode == BRCMF_FWS_FCMODE_IMPLIED_CREDIT) ||
--	    (brcmf_skb_if_flags_get_field(skb, REQ_CREDIT)) ||
--	    (flags == BRCMF_FWS_TXSTATUS_HOST_TOSSED)) {
--		brcmf_fws_return_credits(fws, fifo, 1);
--		brcmf_fws_schedule_deq(fws);
--	}
--	brcmf_fws_macdesc_return_req_credit(skb);
-+		skcb = brcmf_skbcb(skb);
-+		entry = skcb->mac;
-+		if (WARN_ON(!entry)) {
-+			brcmu_pkt_buf_free_skb(skb);
-+			goto cont;
-+		}
-+		entry->transit_count--;
-+		if (entry->suppressed && entry->suppr_transit_count)
-+			entry->suppr_transit_count--;
- 
--	ret = brcmf_proto_hdrpull(fws->drvr, false, skb, &ifp);
--	if (ret) {
--		brcmu_pkt_buf_free_skb(skb);
--		return -EINVAL;
-+		brcmf_dbg(DATA, "%s flags %d htod %X seq %X\n", entry->name,
-+			  flags, skcb->htod, seq);
-+
-+		/* pick up the implicit credit from this packet */
-+		fifo = brcmf_skb_htod_tag_get_field(skb, FIFO);
-+		if (fws->fcmode == BRCMF_FWS_FCMODE_IMPLIED_CREDIT ||
-+		    (brcmf_skb_if_flags_get_field(skb, REQ_CREDIT)) ||
-+		    flags == BRCMF_FWS_TXSTATUS_HOST_TOSSED) {
-+			brcmf_fws_return_credits(fws, fifo, 1);
-+			brcmf_fws_schedule_deq(fws);
-+		}
-+		brcmf_fws_macdesc_return_req_credit(skb);
-+
-+		ret = brcmf_proto_hdrpull(fws->drvr, false, skb, &ifp);
-+		if (ret) {
-+			brcmu_pkt_buf_free_skb(skb);
-+			goto cont;
-+		}
-+		if (!remove_from_hanger)
-+			ret = brcmf_fws_txstatus_suppressed(fws, fifo, skb,
-+							    genbit, seq);
-+		if (remove_from_hanger || ret)
-+			brcmf_txfinalize(ifp, skb, true);
-+
-+cont:
-+		hslot = (hslot + 1) & (BRCMF_FWS_TXSTAT_HSLOT_MASK >>
-+				       BRCMF_FWS_TXSTAT_HSLOT_SHIFT);
-+		if (BRCMF_FWS_MODE_GET_REUSESEQ(fws->mode))
-+			seq = (seq + 1) & BRCMF_SKB_HTOD_SEQ_NR_MASK;
-+
-+		cnt++;
- 	}
--	if (!remove_from_hanger)
--		ret = brcmf_fws_txstatus_suppressed(fws, fifo, skb,
--						    genbit, seq);
--	if (remove_from_hanger || ret)
--		brcmf_txfinalize(ifp, skb, true);
- 
- 	return 0;
- }
-@@ -1547,7 +1559,8 @@ static int brcmf_fws_fifocreditback_indi
- 	return BRCMF_FWS_RET_OK_SCHEDULE;
- }
- 
--static int brcmf_fws_txstatus_indicate(struct brcmf_fws_info *fws, u8 *data)
-+static int brcmf_fws_txstatus_indicate(struct brcmf_fws_info *fws, u8 type,
-+				       u8 *data)
- {
- 	__le32 status_le;
- 	__le16 seq_le;
-@@ -1556,23 +1569,31 @@ static int brcmf_fws_txstatus_indicate(s
- 	u32 genbit;
- 	u8 flags;
- 	u16 seq;
-+	u8 compcnt;
-+	u8 compcnt_offset = BRCMF_FWS_TYPE_TXSTATUS_LEN;
- 
--	fws->stats.txs_indicate++;
- 	memcpy(&status_le, data, sizeof(status_le));
- 	status = le32_to_cpu(status_le);
- 	flags = brcmf_txstatus_get_field(status, FLAGS);
- 	hslot = brcmf_txstatus_get_field(status, HSLOT);
- 	genbit = brcmf_txstatus_get_field(status, GENERATION);
- 	if (BRCMF_FWS_MODE_GET_REUSESEQ(fws->mode)) {
--		memcpy(&seq_le, &data[BRCMF_FWS_TYPE_PKTTAG_LEN],
-+		memcpy(&seq_le, &data[BRCMF_FWS_TYPE_TXSTATUS_LEN],
- 		       sizeof(seq_le));
- 		seq = le16_to_cpu(seq_le);
-+		compcnt_offset += BRCMF_FWS_TYPE_SEQ_LEN;
- 	} else {
- 		seq = 0;
- 	}
- 
-+	if (type == BRCMF_FWS_TYPE_COMP_TXSTATUS)
-+		compcnt = data[compcnt_offset];
-+	else
-+		compcnt = 1;
-+	fws->stats.txs_indicate += compcnt;
-+
- 	brcmf_fws_lock(fws);
--	brcmf_fws_txs_process(fws, flags, hslot, genbit, seq);
-+	brcmf_fws_txs_process(fws, flags, hslot, genbit, seq, compcnt);
- 	brcmf_fws_unlock(fws);
- 	return BRCMF_FWS_RET_OK_NOSCHEDULE;
- }
-@@ -1888,8 +1909,6 @@ void brcmf_fws_hdrpull(struct brcmf_if *
- 
- 		err = BRCMF_FWS_RET_OK_NOSCHEDULE;
- 		switch (type) {
--		case BRCMF_FWS_TYPE_COMP_TXSTATUS:
--			break;
- 		case BRCMF_FWS_TYPE_HOST_REORDER_RXPKTS:
- 			rd = (struct brcmf_skb_reorder_data *)skb->cb;
- 			rd->reorder = data;
-@@ -1912,7 +1931,8 @@ void brcmf_fws_hdrpull(struct brcmf_if *
- 			err = brcmf_fws_request_indicate(fws, type, data);
- 			break;
- 		case BRCMF_FWS_TYPE_TXSTATUS:
--			brcmf_fws_txstatus_indicate(fws, data);
-+		case BRCMF_FWS_TYPE_COMP_TXSTATUS:
-+			brcmf_fws_txstatus_indicate(fws, type, data);
- 			break;
- 		case BRCMF_FWS_TYPE_FIFO_CREDITBACK:
- 			err = brcmf_fws_fifocreditback_indicate(fws, data);
-@@ -2001,7 +2021,7 @@ static void brcmf_fws_rollback_toq(struc
- 		fws->stats.rollback_failed++;
- 		hslot = brcmf_skb_htod_tag_get_field(skb, HSLOT);
- 		brcmf_fws_txs_process(fws, BRCMF_FWS_TXSTATUS_HOST_TOSSED,
--				      hslot, 0, 0);
-+				      hslot, 0, 0, 1);
- 	} else {
- 		fws->stats.rollback_success++;
- 		brcmf_fws_return_credits(fws, fifo, 1);
-@@ -2462,7 +2482,8 @@ void brcmf_fws_bustxfail(struct brcmf_fw
- 	}
- 	brcmf_fws_lock(fws);
- 	hslot = brcmf_skb_htod_tag_get_field(skb, HSLOT);
--	brcmf_fws_txs_process(fws, BRCMF_FWS_TXSTATUS_HOST_TOSSED, hslot, 0, 0);
-+	brcmf_fws_txs_process(fws, BRCMF_FWS_TXSTATUS_HOST_TOSSED, hslot, 0, 0,
-+			      1);
- 	brcmf_fws_unlock(fws);
- }
- 

+ 0 - 36
package/kernel/mac80211/patches/brcm/329-v5.0-0001-brcmfmac-add-4354-raw-pcie-device-id.patch

@@ -1,36 +0,0 @@
-From eb6b33bfb8f56859df7264dccc2ca8ab7c57342a Mon Sep 17 00:00:00 2001
-From: Winnie Chang <[email protected]>
-Date: Wed, 21 Nov 2018 07:53:42 +0000
-Subject: [PATCH] brcmfmac: add 4354 raw pcie device id
-
-Add the raw 4354 PCIe device ID for unprogrammed Cypress boards.
-
-Reviewed-by: Arend Van Spriel <[email protected]>
-Signed-off-by: Winnie Chang <[email protected]>
-Signed-off-by: Chi-Hsien Lin <[email protected]>
-Signed-off-by: Kalle Valo <[email protected]>
----
- drivers/net/wireless/broadcom/brcm80211/brcmfmac/pcie.c       | 1 +
- drivers/net/wireless/broadcom/brcm80211/include/brcm_hw_ids.h | 1 +
- 2 files changed, 2 insertions(+)
-
---- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/pcie.c
-+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/pcie.c
-@@ -2019,6 +2019,7 @@ static const struct dev_pm_ops brcmf_pci
- static const struct pci_device_id brcmf_pcie_devid_table[] = {
- 	BRCMF_PCIE_DEVICE(BRCM_PCIE_4350_DEVICE_ID),
- 	BRCMF_PCIE_DEVICE_SUB(0x4355, BRCM_PCIE_VENDOR_ID_BROADCOM, 0x4355),
-+	BRCMF_PCIE_DEVICE(BRCM_PCIE_4354_RAW_DEVICE_ID),
- 	BRCMF_PCIE_DEVICE(BRCM_PCIE_4356_DEVICE_ID),
- 	BRCMF_PCIE_DEVICE(BRCM_PCIE_43567_DEVICE_ID),
- 	BRCMF_PCIE_DEVICE(BRCM_PCIE_43570_DEVICE_ID),
---- a/drivers/net/wireless/broadcom/brcm80211/include/brcm_hw_ids.h
-+++ b/drivers/net/wireless/broadcom/brcm80211/include/brcm_hw_ids.h
-@@ -74,6 +74,7 @@
- /* PCIE Device IDs */
- #define BRCM_PCIE_4350_DEVICE_ID	0x43a3
- #define BRCM_PCIE_4354_DEVICE_ID	0x43df
-+#define BRCM_PCIE_4354_RAW_DEVICE_ID	0x4354
- #define BRCM_PCIE_4356_DEVICE_ID	0x43ec
- #define BRCM_PCIE_43567_DEVICE_ID	0x43d3
- #define BRCM_PCIE_43570_DEVICE_ID	0x43d9

+ 0 - 73
package/kernel/mac80211/patches/brcm/329-v5.0-0002-brcmfmac-set-F2-watermark-to-256-for-4373.patch

@@ -1,73 +0,0 @@
-From e1a08730eeb0bad4d82c3bc40e74854872de618d Mon Sep 17 00:00:00 2001
-From: Wright Feng <[email protected]>
-Date: Wed, 21 Nov 2018 07:53:44 +0000
-Subject: [PATCH] brcmfmac: set F2 watermark to 256 for 4373
-
-We got SDIO_CRC_ERROR with 4373 on SDR104 when doing bi-directional
-throughput test. Enable watermark to 256 to guarantee the operation
-stability.
-
-Reviewed-by: Arend van Spriel <[email protected]>
-Signed-off-by: Wright Feng <[email protected]>
-Signed-off-by: Chi-Hsien Lin <[email protected]>
-Signed-off-by: Kalle Valo <[email protected]>
----
- .../broadcom/brcm80211/brcmfmac/sdio.c        | 26 +++++++++++++++++--
- 1 file changed, 24 insertions(+), 2 deletions(-)
-
---- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c
-+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c
-@@ -49,6 +49,10 @@
- #define DCMD_RESP_TIMEOUT	msecs_to_jiffies(2500)
- #define CTL_DONE_TIMEOUT	msecs_to_jiffies(2500)
- 
-+/* watermark expressed in number of words */
-+#define DEFAULT_F2_WATERMARK    0x8
-+#define CY_4373_F2_WATERMARK    0x40
-+
- #ifdef DEBUG
- 
- #define BRCMF_TRAP_INFO_SIZE	80
-@@ -138,6 +142,8 @@ struct rte_console {
- /* 1: isolate internal sdio signals, put external pads in tri-state; requires
-  * sdio bus power cycle to clear (rev 9) */
- #define SBSDIO_DEVCTL_PADS_ISO		0x08
-+/* 1: enable F2 Watermark */
-+#define SBSDIO_DEVCTL_F2WM_ENAB		0x10
- /* Force SD->SB reset mapping (rev 11) */
- #define SBSDIO_DEVCTL_SB_RST_CTL	0x30
- /*   Determined by CoreControl bit */
-@@ -4046,6 +4052,7 @@ static void brcmf_sdio_firmware_callback
- 	void *nvram;
- 	u32 nvram_len;
- 	u8 saveclk;
-+	u8 devctl;
- 
- 	brcmf_dbg(TRACE, "Enter: dev=%s, err=%d\n", dev_name(dev), err);
- 
-@@ -4101,8 +4108,23 @@ static void brcmf_sdio_firmware_callback
- 		brcmf_sdiod_writel(sdiod, core->base + SD_REG(hostintmask),
- 				   bus->hostintmask, NULL);
- 
--
--		brcmf_sdiod_writeb(sdiod, SBSDIO_WATERMARK, 8, &err);
-+		switch (sdiod->func1->device) {
-+		case SDIO_DEVICE_ID_CYPRESS_4373:
-+			brcmf_dbg(INFO, "set F2 watermark to 0x%x*4 bytes\n",
-+				  CY_4373_F2_WATERMARK);
-+			brcmf_sdiod_writeb(sdiod, SBSDIO_WATERMARK,
-+					   CY_4373_F2_WATERMARK, &err);
-+			devctl = brcmf_sdiod_readb(sdiod, SBSDIO_DEVICE_CTL,
-+						   &err);
-+			devctl |= SBSDIO_DEVCTL_F2WM_ENAB;
-+			brcmf_sdiod_writeb(sdiod, SBSDIO_DEVICE_CTL, devctl,
-+					   &err);
-+			break;
-+		default:
-+			brcmf_sdiod_writeb(sdiod, SBSDIO_WATERMARK,
-+					   DEFAULT_F2_WATERMARK, &err);
-+			break;
-+		}
- 	} else {
- 		/* Disable F2 again */
- 		sdio_disable_func(sdiod->func2);

+ 0 - 55
package/kernel/mac80211/patches/brcm/329-v5.0-0003-brcmfmac-set-SDIO-F1-MesBusyCtrl-for-CYW4373.patch

@@ -1,55 +0,0 @@
-From 58e4bbea0c1d9b5ace11df968c5dc096ce052a73 Mon Sep 17 00:00:00 2001
-From: Madhan Mohan R <[email protected]>
-Date: Wed, 21 Nov 2018 07:53:45 +0000
-Subject: [PATCH] brcmfmac: set SDIO F1 MesBusyCtrl for CYW4373
-
-Along with F2 watermark (existing) configuration, F1 MesBusyCtrl
-should be enabled & sdio device RX FIFO watermark should be
-configured to avoid overflow errors.
-
-Reviewed-by: Arend van Spriel <[email protected]>
-Signed-off-by: Madhan Mohan R <[email protected]>
-Signed-off-by: Chi-Hsien Lin <[email protected]>
-Signed-off-by: Kalle Valo <[email protected]>
----
- drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c | 3 +++
- drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.h | 9 ++++++++-
- 2 files changed, 11 insertions(+), 1 deletion(-)
-
---- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c
-+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c
-@@ -4119,6 +4119,9 @@ static void brcmf_sdio_firmware_callback
- 			devctl |= SBSDIO_DEVCTL_F2WM_ENAB;
- 			brcmf_sdiod_writeb(sdiod, SBSDIO_DEVICE_CTL, devctl,
- 					   &err);
-+			brcmf_sdiod_writeb(sdiod, SBSDIO_FUNC1_MESBUSYCTRL,
-+					   CY_4373_F2_WATERMARK |
-+					   SBSDIO_MESBUSYCTRL_ENAB, &err);
- 			break;
- 		default:
- 			brcmf_sdiod_writeb(sdiod, SBSDIO_WATERMARK,
---- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.h
-+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.h
-@@ -77,7 +77,7 @@
- #define SBSDIO_GPIO_OUT			0x10006
- /* gpio enable */
- #define SBSDIO_GPIO_EN			0x10007
--/* rev < 7, watermark for sdio device */
-+/* rev < 7, watermark for sdio device TX path */
- #define SBSDIO_WATERMARK		0x10008
- /* control busy signal generation */
- #define SBSDIO_DEVICE_CTL		0x10009
-@@ -104,6 +104,13 @@
- #define SBSDIO_FUNC1_RFRAMEBCHI		0x1001C
- /* MesBusyCtl (rev 11) */
- #define SBSDIO_FUNC1_MESBUSYCTRL	0x1001D
-+/* Watermark for sdio device RX path */
-+#define SBSDIO_MESBUSY_RXFIFO_WM_MASK	0x7F
-+#define SBSDIO_MESBUSY_RXFIFO_WM_SHIFT	0
-+/* Enable busy capability for MES access */
-+#define SBSDIO_MESBUSYCTRL_ENAB		0x80
-+#define SBSDIO_MESBUSYCTRL_ENAB_SHIFT	7
-+
- /* Sdio Core Rev 12 */
- #define SBSDIO_FUNC1_WAKEUPCTRL		0x1001E
- #define SBSDIO_FUNC1_WCTRL_ALPWAIT_MASK		0x1

+ 0 - 253
package/kernel/mac80211/patches/brcm/329-v5.0-0004-brcmfmac-add-support-for-CYW43012-SDIO-chipset.patch

@@ -1,253 +0,0 @@
-From 35cb51b2162a1a7c5cd977f92595e60ab14d3b22 Mon Sep 17 00:00:00 2001
-From: Chi-Hsien Lin <[email protected]>
-Date: Wed, 21 Nov 2018 07:53:47 +0000
-Subject: [PATCH] brcmfmac: add support for CYW43012 SDIO chipset
-
-CYW43012 is a 1x1 802.11a/b/g/n Dual-Band HT20, 256-QAM/Turbo QAM. It
-is an Ultra Low Power WLAN+BT combo chip.
-
-Reviewed-by: Arend van Spriel <[email protected]>
-Signed-off-by: Chi-Hsien Lin <[email protected]>
-Signed-off-by: Praveen Babu C <[email protected]>
-Signed-off-by: Kalle Valo <[email protected]>
----
- .../broadcom/brcm80211/brcmfmac/bcmsdh.c      |  1 +
- .../broadcom/brcm80211/brcmfmac/chip.c        | 14 +++-
- .../broadcom/brcm80211/brcmfmac/sdio.c        | 74 ++++++++++++++++---
- .../broadcom/brcm80211/include/brcm_hw_ids.h  |  1 +
- include/linux/mmc/sdio_ids.h                  |  1 +
- 5 files changed, 78 insertions(+), 13 deletions(-)
-
---- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/bcmsdh.c
-+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/bcmsdh.c
-@@ -972,6 +972,7 @@ static const struct sdio_device_id brcmf
- 	BRCMF_SDIO_DEVICE(SDIO_DEVICE_ID_BROADCOM_4354),
- 	BRCMF_SDIO_DEVICE(SDIO_DEVICE_ID_BROADCOM_4356),
- 	BRCMF_SDIO_DEVICE(SDIO_DEVICE_ID_CYPRESS_4373),
-+	BRCMF_SDIO_DEVICE(SDIO_DEVICE_ID_CYPRESS_43012),
- 	{ /* end: all zeroes */ }
- };
- MODULE_DEVICE_TABLE(sdio, brcmf_sdmmc_ids);
---- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/chip.c
-+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/chip.c
-@@ -165,6 +165,7 @@ struct sbconfig {
- #define SRCI_LSS_MASK		0x00f00000
- #define SRCI_LSS_SHIFT		20
- #define	SRCI_SRNB_MASK		0xf0
-+#define	SRCI_SRNB_MASK_EXT	0x100
- #define	SRCI_SRNB_SHIFT		4
- #define	SRCI_SRBSZ_MASK		0xf
- #define	SRCI_SRBSZ_SHIFT	0
-@@ -592,7 +593,13 @@ static void brcmf_chip_socram_ramsize(st
- 		if (lss != 0)
- 			*ramsize += (1 << ((lss - 1) + SR_BSZ_BASE));
- 	} else {
--		nb = (coreinfo & SRCI_SRNB_MASK) >> SRCI_SRNB_SHIFT;
-+		/* length of SRAM Banks increased for corerev greater than 23 */
-+		if (sr->pub.rev >= 23) {
-+			nb = (coreinfo & (SRCI_SRNB_MASK | SRCI_SRNB_MASK_EXT))
-+				>> SRCI_SRNB_SHIFT;
-+		} else {
-+			nb = (coreinfo & SRCI_SRNB_MASK) >> SRCI_SRNB_SHIFT;
-+		}
- 		for (i = 0; i < nb; i++) {
- 			retent = brcmf_chip_socram_banksize(sr, i, &banksize);
- 			*ramsize += banksize;
-@@ -1356,6 +1363,11 @@ bool brcmf_chip_sr_capable(struct brcmf_
- 		addr = CORE_CC_REG(base, sr_control1);
- 		reg = chip->ops->read32(chip->ctx, addr);
- 		return reg != 0;
-+	case CY_CC_43012_CHIP_ID:
-+		addr = CORE_CC_REG(pmu->base, retention_ctl);
-+		reg = chip->ops->read32(chip->ctx, addr);
-+		return (reg & (PMU_RCTL_MACPHY_DISABLE_MASK |
-+			       PMU_RCTL_LOGIC_DISABLE_MASK)) == 0;
- 	default:
- 		addr = CORE_CC_REG(pmu->base, pmucapabilities_ext);
- 		reg = chip->ops->read32(chip->ctx, addr);
---- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c
-+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c
-@@ -624,6 +624,7 @@ BRCMF_FW_DEF(43455, "brcmfmac43455-sdio"
- BRCMF_FW_DEF(4354, "brcmfmac4354-sdio");
- BRCMF_FW_DEF(4356, "brcmfmac4356-sdio");
- BRCMF_FW_DEF(4373, "brcmfmac4373-sdio");
-+BRCMF_FW_DEF(43012, "brcmfmac43012-sdio");
- 
- static const struct brcmf_firmware_mapping brcmf_sdio_fwnames[] = {
- 	BRCMF_FW_ENTRY(BRCM_CC_43143_CHIP_ID, 0xFFFFFFFF, 43143),
-@@ -643,7 +644,8 @@ static const struct brcmf_firmware_mappi
- 	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)
-+	BRCMF_FW_ENTRY(CY_CC_4373_CHIP_ID, 0xFFFFFFFF, 4373),
-+	BRCMF_FW_ENTRY(CY_CC_43012_CHIP_ID, 0xFFFFFFFF, 43012)
- };
- 
- static void pkt_align(struct sk_buff *p, int len, int align)
-@@ -677,6 +679,14 @@ brcmf_sdio_kso_control(struct brcmf_sdio
- 	/* 1st KSO write goes to AOS wake up core if device is asleep  */
- 	brcmf_sdiod_writeb(bus->sdiodev, SBSDIO_FUNC1_SLEEPCSR, wr_val, &err);
- 
-+	/* In case of 43012 chip, the chip could go down immediately after
-+	 * KSO bit is cleared. So the further reads of KSO register could
-+	 * fail. Thereby just bailing out immediately after clearing KSO
-+	 * bit, to avoid polling of KSO bit.
-+	 */
-+	if (!on && bus->ci->chip == CY_CC_43012_CHIP_ID)
-+		return err;
-+
- 	if (on) {
- 		/* device WAKEUP through KSO:
- 		 * write bit 0 & read back until
-@@ -2402,6 +2412,14 @@ static int brcmf_sdio_tx_ctrlframe(struc
- 	return ret;
- }
- 
-+static bool brcmf_chip_is_ulp(struct brcmf_chip *ci)
-+{
-+	if (ci->chip == CY_CC_43012_CHIP_ID)
-+		return true;
-+	else
-+		return false;
-+}
-+
- static void brcmf_sdio_bus_stop(struct device *dev)
- {
- 	struct brcmf_bus *bus_if = dev_get_drvdata(dev);
-@@ -2409,7 +2427,7 @@ static void brcmf_sdio_bus_stop(struct d
- 	struct brcmf_sdio *bus = sdiodev->bus;
- 	struct brcmf_core *core = bus->sdio_core;
- 	u32 local_hostintmask;
--	u8 saveclk;
-+	u8 saveclk, bpreq;
- 	int err;
- 
- 	brcmf_dbg(TRACE, "Enter\n");
-@@ -2436,9 +2454,14 @@ static void brcmf_sdio_bus_stop(struct d
- 		/* Force backplane clocks to assure F2 interrupt propagates */
- 		saveclk = brcmf_sdiod_readb(sdiodev, SBSDIO_FUNC1_CHIPCLKCSR,
- 					    &err);
--		if (!err)
--			brcmf_sdiod_writeb(sdiodev, SBSDIO_FUNC1_CHIPCLKCSR,
--					   (saveclk | SBSDIO_FORCE_HT), &err);
-+		if (!err) {
-+			bpreq = saveclk;
-+			bpreq |= brcmf_chip_is_ulp(bus->ci) ?
-+				SBSDIO_HT_AVAIL_REQ : SBSDIO_FORCE_HT;
-+			brcmf_sdiod_writeb(sdiodev,
-+					   SBSDIO_FUNC1_CHIPCLKCSR,
-+					   bpreq, &err);
-+		}
- 		if (err)
- 			brcmf_err("Failed to force clock for F2: err %d\n",
- 				  err);
-@@ -3328,20 +3351,45 @@ err:
- 	return bcmerror;
- }
- 
-+static bool brcmf_sdio_aos_no_decode(struct brcmf_sdio *bus)
-+{
-+	if (bus->ci->chip == CY_CC_43012_CHIP_ID)
-+		return true;
-+	else
-+		return false;
-+}
-+
- static void brcmf_sdio_sr_init(struct brcmf_sdio *bus)
- {
- 	int err = 0;
- 	u8 val;
-+	u8 wakeupctrl;
-+	u8 cardcap;
-+	u8 chipclkcsr;
- 
- 	brcmf_dbg(TRACE, "Enter\n");
- 
-+	if (brcmf_chip_is_ulp(bus->ci)) {
-+		wakeupctrl = SBSDIO_FUNC1_WCTRL_ALPWAIT_SHIFT;
-+		chipclkcsr = SBSDIO_HT_AVAIL_REQ;
-+	} else {
-+		wakeupctrl = SBSDIO_FUNC1_WCTRL_HTWAIT_SHIFT;
-+		chipclkcsr = SBSDIO_FORCE_HT;
-+	}
-+
-+	if (brcmf_sdio_aos_no_decode(bus)) {
-+		cardcap = SDIO_CCCR_BRCM_CARDCAP_CMD_NODEC;
-+	} else {
-+		cardcap = (SDIO_CCCR_BRCM_CARDCAP_CMD14_SUPPORT |
-+			   SDIO_CCCR_BRCM_CARDCAP_CMD14_EXT);
-+	}
-+
- 	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;
-+	val |= 1 << wakeupctrl;
- 	brcmf_sdiod_writeb(bus->sdiodev, SBSDIO_FUNC1_WAKEUPCTRL, val, &err);
- 	if (err) {
- 		brcmf_err("error writing SBSDIO_FUNC1_WAKEUPCTRL\n");
-@@ -3350,8 +3398,7 @@ static void brcmf_sdio_sr_init(struct br
- 
- 	/* Add CMD14 Support */
- 	brcmf_sdiod_func0_wb(bus->sdiodev, SDIO_CCCR_BRCM_CARDCAP,
--			     (SDIO_CCCR_BRCM_CARDCAP_CMD14_SUPPORT |
--			      SDIO_CCCR_BRCM_CARDCAP_CMD14_EXT),
-+			     cardcap,
- 			     &err);
- 	if (err) {
- 		brcmf_err("error writing SDIO_CCCR_BRCM_CARDCAP\n");
-@@ -3359,7 +3406,7 @@ static void brcmf_sdio_sr_init(struct br
- 	}
- 
- 	brcmf_sdiod_writeb(bus->sdiodev, SBSDIO_FUNC1_CHIPCLKCSR,
--			   SBSDIO_FORCE_HT, &err);
-+			   chipclkcsr, &err);
- 	if (err) {
- 		brcmf_err("error writing SBSDIO_FUNC1_CHIPCLKCSR\n");
- 		return;
-@@ -4051,7 +4098,7 @@ static void brcmf_sdio_firmware_callback
- 	const struct firmware *code;
- 	void *nvram;
- 	u32 nvram_len;
--	u8 saveclk;
-+	u8 saveclk, bpreq;
- 	u8 devctl;
- 
- 	brcmf_dbg(TRACE, "Enter: dev=%s, err=%d\n", dev_name(dev), err);
-@@ -4085,8 +4132,11 @@ static void brcmf_sdio_firmware_callback
- 	/* Force clocks on backplane to be sure F2 interrupt propagates */
- 	saveclk = brcmf_sdiod_readb(sdiod, SBSDIO_FUNC1_CHIPCLKCSR, &err);
- 	if (!err) {
-+		bpreq = saveclk;
-+		bpreq |= brcmf_chip_is_ulp(bus->ci) ?
-+			SBSDIO_HT_AVAIL_REQ : SBSDIO_FORCE_HT;
- 		brcmf_sdiod_writeb(sdiod, SBSDIO_FUNC1_CHIPCLKCSR,
--				   (saveclk | SBSDIO_FORCE_HT), &err);
-+				   bpreq, &err);
- 	}
- 	if (err) {
- 		brcmf_err("Failed to force clock for F2: err %d\n", err);
---- a/drivers/net/wireless/broadcom/brcm80211/include/brcm_hw_ids.h
-+++ b/drivers/net/wireless/broadcom/brcm80211/include/brcm_hw_ids.h
-@@ -60,6 +60,7 @@
- #define BRCM_CC_43664_CHIP_ID		43664
- #define BRCM_CC_4371_CHIP_ID		0x4371
- #define CY_CC_4373_CHIP_ID		0x4373
-+#define CY_CC_43012_CHIP_ID		43012
- 
- /* USB Device IDs */
- #define BRCM_USB_43143_DEVICE_ID	0xbd1e
---- a/include/linux/mmc/sdio_ids.h
-+++ b/include/linux/mmc/sdio_ids.h
-@@ -42,6 +42,7 @@
- #define SDIO_DEVICE_ID_BROADCOM_4354		0x4354
- #define SDIO_DEVICE_ID_BROADCOM_4356		0x4356
- #define SDIO_DEVICE_ID_CYPRESS_4373		0x4373
-+#define SDIO_DEVICE_ID_CYPRESS_43012		43012
- 
- #define SDIO_VENDOR_ID_INTEL			0x0089
- #define SDIO_DEVICE_ID_INTEL_IWMC3200WIMAX	0x1402

+ 0 - 60
package/kernel/mac80211/patches/brcm/329-v5.0-0005-brcmfmac-allow-GCI-core-enumuration.patch

@@ -1,60 +0,0 @@
-From b021a6bc1175442609af0b66d64f850883e155fb Mon Sep 17 00:00:00 2001
-From: Chi-Hsien Lin <[email protected]>
-Date: Wed, 21 Nov 2018 07:53:48 +0000
-Subject: [PATCH] brcmfmac: allow GCI core enumuration
-
-GCI core is needed for ULP operation. Allow GCI core enumuration with
-below changes:
- - Allow GCI to be added to core list even when it doesn't have a wrapper.
- - Allow 8K address space size.
- - Don't overwrite the address value when an additional size descriptor
-   is in place.
-
-Reviewed-by: Arend van Spriel <[email protected]>
-Signed-off-by: Chi-Hsien Lin <[email protected]>
-Signed-off-by: Kalle Valo <[email protected]>
----
- .../wireless/broadcom/brcm80211/brcmfmac/chip.c    | 14 ++++++++------
- 1 file changed, 8 insertions(+), 6 deletions(-)
-
---- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/chip.c
-+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/chip.c
-@@ -786,7 +786,7 @@ static int brcmf_chip_dmp_get_regaddr(st
- 				      u32 *regbase, u32 *wrapbase)
- {
- 	u8 desc;
--	u32 val;
-+	u32 val, szdesc;
- 	u8 mpnum = 0;
- 	u8 stype, sztype, wraptype;
- 
-@@ -832,14 +832,15 @@ static int brcmf_chip_dmp_get_regaddr(st
- 
- 		/* next size descriptor can be skipped */
- 		if (sztype == DMP_SLAVE_SIZE_DESC) {
--			val = brcmf_chip_dmp_get_desc(ci, eromaddr, NULL);
-+			szdesc = brcmf_chip_dmp_get_desc(ci, eromaddr, NULL);
- 			/* skip upper size descriptor if present */
--			if (val & DMP_DESC_ADDRSIZE_GT32)
-+			if (szdesc & DMP_DESC_ADDRSIZE_GT32)
- 				brcmf_chip_dmp_get_desc(ci, eromaddr, NULL);
- 		}
- 
--		/* only look for 4K register regions */
--		if (sztype != DMP_SLAVE_SIZE_4K)
-+		/* look for 4K or 8K register regions */
-+		if (sztype != DMP_SLAVE_SIZE_4K &&
-+		    sztype != DMP_SLAVE_SIZE_8K)
- 			continue;
- 
- 		stype = (val & DMP_SLAVE_TYPE) >> DMP_SLAVE_TYPE_S;
-@@ -896,7 +897,8 @@ int brcmf_chip_dmp_erom_scan(struct brcm
- 
- 		/* need core with ports */
- 		if (nmw + nsw == 0 &&
--		    id != BCMA_CORE_PMU)
-+		    id != BCMA_CORE_PMU &&
-+		    id != BCMA_CORE_GCI)
- 			continue;
- 
- 		/* try to obtain register address info */

+ 0 - 49
package/kernel/mac80211/patches/brcm/329-v5.0-0006-brcmfmac-update-43012-F2-watermark-setting-to-fix-DM.patch

@@ -1,49 +0,0 @@
-From f95a8d9c6aca196f1ace5b2e53a3dd3bc491b1b3 Mon Sep 17 00:00:00 2001
-From: Naveen Gupta <[email protected]>
-Date: Wed, 21 Nov 2018 07:53:49 +0000
-Subject: [PATCH] brcmfmac: update 43012 F2 watermark setting to fix DMA Error
- during UDP RX Traffic
-
-The number of words that the read FIFO has to contain except
-the end of frame before sends data back to the host.
-Max watermark = (512B - 2* (BurstLength))/4 =
-(512 - 128)/4 = 384/4 = 0x60
-so if burst length (i.e. BurstLength = 64) is increased,
-watermark has to be reduced. This is the optimal setting for this chip.
-
-Reviewed-by: Arend van Spriel <[email protected]>
-Signed-off-by: Naveen Gupta <[email protected]>
-Signed-off-by: Chi-Hsien Lin <[email protected]>
-Signed-off-by: Kalle Valo <[email protected]>
----
- .../net/wireless/broadcom/brcm80211/brcmfmac/sdio.c  | 12 ++++++++++++
- 1 file changed, 12 insertions(+)
-
---- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c
-+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c
-@@ -52,6 +52,7 @@
- /* watermark expressed in number of words */
- #define DEFAULT_F2_WATERMARK    0x8
- #define CY_4373_F2_WATERMARK    0x40
-+#define CY_43012_F2_WATERMARK    0x60
- 
- #ifdef DEBUG
- 
-@@ -4173,6 +4174,17 @@ static void brcmf_sdio_firmware_callback
- 					   CY_4373_F2_WATERMARK |
- 					   SBSDIO_MESBUSYCTRL_ENAB, &err);
- 			break;
-+		case SDIO_DEVICE_ID_CYPRESS_43012:
-+			brcmf_dbg(INFO, "set F2 watermark to 0x%x*4 bytes\n",
-+				  CY_43012_F2_WATERMARK);
-+			brcmf_sdiod_writeb(sdiod, SBSDIO_WATERMARK,
-+					   CY_43012_F2_WATERMARK, &err);
-+			devctl = brcmf_sdiod_readb(sdiod, SBSDIO_DEVICE_CTL,
-+						   &err);
-+			devctl |= SBSDIO_DEVCTL_F2WM_ENAB;
-+			brcmf_sdiod_writeb(sdiod, SBSDIO_DEVICE_CTL, devctl,
-+					   &err);
-+			break;
- 		default:
- 			brcmf_sdiod_writeb(sdiod, SBSDIO_WATERMARK,
- 					   DEFAULT_F2_WATERMARK, &err);

+ 0 - 57
package/kernel/mac80211/patches/brcm/329-v5.0-0007-brcmfmac-4373-save-restore-support.patch

@@ -1,57 +0,0 @@
-From 2f2d389efda4caa4c1b69cb4fa2ab217f0fe6d6f Mon Sep 17 00:00:00 2001
-From: Chi-Hsien Lin <[email protected]>
-Date: Wed, 21 Nov 2018 07:53:50 +0000
-Subject: [PATCH] brcmfmac: 4373 save-restore support
-
-Use chipcommon sr_control0 register to check 4373 sr support.
-
-Reviewed-by: Arend van Spriel <[email protected]>
-Signed-off-by: Chi-Hsien Lin <[email protected]>
-Signed-off-by: Kalle Valo <[email protected]>
----
- .../broadcom/brcm80211/brcmfmac/chip.c        |  5 +++++
- .../broadcom/brcm80211/include/chipcommon.h   | 19 +++++++++++++++++++
- 2 files changed, 24 insertions(+)
-
---- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/chip.c
-+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/chip.c
-@@ -1365,6 +1365,11 @@ bool brcmf_chip_sr_capable(struct brcmf_
- 		addr = CORE_CC_REG(base, sr_control1);
- 		reg = chip->ops->read32(chip->ctx, addr);
- 		return reg != 0;
-+	case CY_CC_4373_CHIP_ID:
-+		/* explicitly check SR engine enable bit */
-+		addr = CORE_CC_REG(base, sr_control0);
-+		reg = chip->ops->read32(chip->ctx, addr);
-+		return (reg & CC_SR_CTL0_ENABLE_MASK) != 0;
- 	case CY_CC_43012_CHIP_ID:
- 		addr = CORE_CC_REG(pmu->base, retention_ctl);
- 		reg = chip->ops->read32(chip->ctx, addr);
---- a/drivers/net/wireless/broadcom/brcm80211/include/chipcommon.h
-+++ b/drivers/net/wireless/broadcom/brcm80211/include/chipcommon.h
-@@ -269,6 +269,25 @@ struct chipcregs {
- /* GSIO (spi/i2c) present, rev >= 37 */
- #define	CC_CAP2_GSIO		0x00000002
- 
-+/* sr_control0, rev >= 48 */
-+#define CC_SR_CTL0_ENABLE_MASK			BIT(0)
-+#define CC_SR_CTL0_ENABLE_SHIFT		0
-+#define CC_SR_CTL0_EN_SR_ENG_CLK_SHIFT	1 /* sr_clk to sr_memory enable */
-+#define CC_SR_CTL0_RSRC_TRIGGER_SHIFT	2 /* Rising edge resource trigger 0 to
-+					   * sr_engine
-+					   */
-+#define CC_SR_CTL0_MIN_DIV_SHIFT	6 /* Min division value for fast clk
-+					   * in sr_engine
-+					   */
-+#define CC_SR_CTL0_EN_SBC_STBY_SHIFT		16
-+#define CC_SR_CTL0_EN_SR_ALP_CLK_MASK_SHIFT	18
-+#define CC_SR_CTL0_EN_SR_HT_CLK_SHIFT		19
-+#define CC_SR_CTL0_ALLOW_PIC_SHIFT	20 /* Allow pic to separate power
-+					    * domains
-+					    */
-+#define CC_SR_CTL0_MAX_SR_LQ_CLK_CNT_SHIFT	25
-+#define CC_SR_CTL0_EN_MEM_DISABLE_FOR_SLEEP	30
-+
- /* pmucapabilities */
- #define PCAP_REV_MASK	0x000000ff
- #define PCAP_RC_MASK	0x00001f00

+ 0 - 45
package/kernel/mac80211/patches/brcm/329-v5.0-0008-brcmfmac-disable-command-decode-in-sdio_aos.patch

@@ -1,45 +0,0 @@
-From 29f6589140a10ece8c1d73f58043ea5b3473ab3e Mon Sep 17 00:00:00 2001
-From: Wright Feng <[email protected]>
-Date: Wed, 21 Nov 2018 07:53:52 +0000
-Subject: [PATCH] brcmfmac: disable command decode in sdio_aos
-
-AOS is a part of the SDIOD core that becomes active when the rest of
-SDIOD is sleeping to keep SDIO bus alive responding to reduced set of
-commands.
-
-Transaction between AOS and SDIOD is not protected, and if cmd 52 is
-received in AOS and in the middle of response state changed from AOS to
-SDIOD, response is corrupted and it causes to SDIO Host controller to
-hang.
-
-Command decode for below chips are disabled in this commit:
- - 4339
- - 4345
- - 4354
- - 4373
-
-Reviewed-by: Arend van Spriel <[email protected]>
-Signed-off-by: Wright Feng <[email protected]>
-Signed-off-by: Double Lo <[email protected]>
-Signed-off-by: Madhan Mohan R <[email protected]>
-Signed-off-by: Chi-Hsien Lin <[email protected]>
-Signed-off-by: Kalle Valo <[email protected]>
----
- drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c | 6 +++++-
- 1 file changed, 5 insertions(+), 1 deletion(-)
-
---- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c
-+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c
-@@ -3354,7 +3354,11 @@ err:
- 
- static bool brcmf_sdio_aos_no_decode(struct brcmf_sdio *bus)
- {
--	if (bus->ci->chip == CY_CC_43012_CHIP_ID)
-+	if (bus->ci->chip == CY_CC_43012_CHIP_ID ||
-+	    bus->ci->chip == CY_CC_4373_CHIP_ID ||
-+	    bus->ci->chip == BRCM_CC_4339_CHIP_ID ||
-+	    bus->ci->chip == BRCM_CC_4345_CHIP_ID ||
-+	    bus->ci->chip == BRCM_CC_4354_CHIP_ID)
- 		return true;
- 	else
- 		return false;

+ 0 - 34
package/kernel/mac80211/patches/brcm/330-v5.0-0001-brcmfmac-fix-false-positive-Wmaybe-unintialized-warn.patch

@@ -1,34 +0,0 @@
-From 412dd15c8177d93abe0c8787b83b31c5eb061405 Mon Sep 17 00:00:00 2001
-From: Arnd Bergmann <[email protected]>
-Date: Mon, 10 Dec 2018 21:55:37 +0100
-Subject: [PATCH] brcmfmac: fix false-positive -Wmaybe-unintialized warning
-
-When CONFIG_NO_AUTO_INLINE is set, we get a false-postive warning
-for the brcmf_fw_request_nvram_done() function, after gcc figures
-out that brcmf_fw_nvram_from_efi() might not set the 'data_len'
-variable, but fails to notice that it always returns NULL:
-
-drivers/net/wireless/broadcom/brcm80211/brcmfmac/firmware.c: In function 'brcmf_fw_request_nvram_done':
-drivers/net/wireless/broadcom/brcm80211/brcmfmac/firmware.c:560:11: error: 'data_len' may be used uninitialized in this function [-Werror=maybe-uninitialized]
-
-Mark it 'inline' to force gcc to understand this.
-
-Fixes: ce2e6db554fa ("brcmfmac: Add support for getting nvram contents from EFI variables")
-Signed-off-by: Arnd Bergmann <[email protected]>
-Reviewed-by: Hans de Goede <[email protected]>
-Signed-off-by: Kalle Valo <[email protected]>
----
- drivers/net/wireless/broadcom/brcm80211/brcmfmac/firmware.c | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
---- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/firmware.c
-+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/firmware.c
-@@ -512,7 +512,7 @@ fail:
- 	return NULL;
- }
- #else
--static u8 *brcmf_fw_nvram_from_efi(size_t *data_len) { return NULL; }
-+static inline u8 *brcmf_fw_nvram_from_efi(size_t *data_len) { return NULL; }
- #endif
- 
- static void brcmf_fw_free_request(struct brcmf_fw_request *req)

+ 0 - 41
package/kernel/mac80211/patches/brcm/332-v5.0-0001-brcmfmac-Fix-access-point-mode.patch

@@ -1,41 +0,0 @@
-From 861cb5eb467f5e38dce1aabe4e8db379255bd89b Mon Sep 17 00:00:00 2001
-From: Stefan Wahren <[email protected]>
-Date: Wed, 12 Dec 2018 20:20:06 +0100
-Subject: [PATCH] brcmfmac: Fix access point mode
-
-Since commit 1204aa17f3b4 ("brcmfmac: set WIPHY_FLAG_HAVE_AP_SME flag")
-the Raspberry Pi 3 A+ (BCM43455) isn't able to operate in AP mode with
-hostapd (device_ap_sme=1 use_monitor=0):
-
-brcmfmac: brcmf_cfg80211_stop_ap: setting AP mode failed -52
-
-So add the missing mgmt_stypes for AP mode to fix this.
-
-Fixes: 1204aa17f3b4 ("brcmfmac: set WIPHY_FLAG_HAVE_AP_SME flag")
-Suggested-by: Arend van Spriel <[email protected]>
-Signed-off-by: Stefan Wahren <[email protected]>
-Acked-by: Arend van Spriel <[email protected]>
-Signed-off-by: Kalle Valo <[email protected]>
----
- .../wireless/broadcom/brcm80211/brcmfmac/cfg80211.c    | 10 ++++++++++
- 1 file changed, 10 insertions(+)
-
---- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c
-+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c
-@@ -6308,6 +6308,16 @@ brcmf_txrx_stypes[NUM_NL80211_IFTYPES] =
- 		.tx = 0xffff,
- 		.rx = BIT(IEEE80211_STYPE_ACTION >> 4) |
- 		      BIT(IEEE80211_STYPE_PROBE_REQ >> 4)
-+	},
-+	[NL80211_IFTYPE_AP] = {
-+		.tx = 0xffff,
-+		.rx = BIT(IEEE80211_STYPE_ASSOC_REQ >> 4) |
-+		      BIT(IEEE80211_STYPE_REASSOC_REQ >> 4) |
-+		      BIT(IEEE80211_STYPE_PROBE_REQ >> 4) |
-+		      BIT(IEEE80211_STYPE_DISASSOC >> 4) |
-+		      BIT(IEEE80211_STYPE_AUTH >> 4) |
-+		      BIT(IEEE80211_STYPE_DEAUTH >> 4) |
-+		      BIT(IEEE80211_STYPE_ACTION >> 4)
- 	}
- };
- 

+ 0 - 51
package/kernel/mac80211/patches/brcm/340-v5.1-brcmfmac-Add-DMI-nvram-filename-quirk-for-PoV-TAB-P1.patch

@@ -1,51 +0,0 @@
-From 4d95f99c59b8b814bcf09ba86020d937ec7caa86 Mon Sep 17 00:00:00 2001
-From: Hans de Goede <[email protected]>
-Date: Thu, 20 Dec 2018 17:40:58 +0100
-Subject: [PATCH] brcmfmac: Add DMI nvram filename quirk for PoV TAB-P1006W-232
- tablet
-
-The Point of View TAB-P1006W-232 tablet contains quite generic names in
-the sys_vendor and product_name DMI strings, without this patch brcmfmac
-will try to load: brcmfmac43340-sdio.Insyde-BayTrail.txt as nvram file
-which is a bit too generic.
-
-Add a DMI quirk so that a unique and clearly identifiable nvram file
-name is used on the PoV TAB-P1006W-232 tablet.
-
-Signed-off-by: Hans de Goede <[email protected]>
-Signed-off-by: Kalle Valo <[email protected]>
----
- .../wireless/broadcom/brcm80211/brcmfmac/dmi.c    | 15 +++++++++++++++
- 1 file changed, 15 insertions(+)
-
---- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/dmi.c
-+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/dmi.c
-@@ -43,6 +43,10 @@ static const struct brcmf_dmi_data meego
- 	BRCM_CC_43340_CHIP_ID, 2, "meegopad-t08"
- };
- 
-+static const struct brcmf_dmi_data pov_tab_p1006w_data = {
-+	BRCM_CC_43340_CHIP_ID, 2, "pov-tab-p1006w-data"
-+};
-+
- static const struct dmi_system_id dmi_platform_data[] = {
- 	{
- 		/* Match for the GPDwin which unfortunately uses somewhat
-@@ -81,6 +85,17 @@ static const struct dmi_system_id dmi_pl
- 		},
- 		.driver_data = (void *)&meegopad_t08_data,
- 	},
-+	{
-+		/* Point of View TAB-P1006W-232 */
-+		.matches = {
-+			DMI_EXACT_MATCH(DMI_SYS_VENDOR, "Insyde"),
-+			DMI_EXACT_MATCH(DMI_PRODUCT_NAME, "BayTrail"),
-+			/* Note 105b is Foxcon's USB/PCI vendor id */
-+			DMI_EXACT_MATCH(DMI_BOARD_VENDOR, "105B"),
-+			DMI_EXACT_MATCH(DMI_BOARD_NAME, "0E57"),
-+		},
-+		.driver_data = (void *)&pov_tab_p1006w_data,
-+	},
- 	{}
- };
- 

+ 0 - 28
package/kernel/mac80211/patches/brcm/341-v5.1-brcmfmac-add-a-check-for-the-status-of-usb_register.patch

@@ -1,28 +0,0 @@
-From 42daad3343be4a4e1ee03e30a5f5cc731dadfef5 Mon Sep 17 00:00:00 2001
-From: Kangjie Lu <[email protected]>
-Date: Tue, 25 Dec 2018 19:22:24 -0600
-Subject: [PATCH] brcmfmac: add a check for the status of usb_register
-
-usb_register() may fail, so let's check its status and issue an error
-message if it fails.
-
-Signed-off-by: Kangjie Lu <[email protected]>
-Signed-off-by: Kalle Valo <[email protected]>
----
- drivers/net/wireless/broadcom/brcm80211/brcmfmac/usb.c | 6 +++++-
- 1 file changed, 5 insertions(+), 1 deletion(-)
-
---- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/usb.c
-+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/usb.c
-@@ -1552,6 +1552,10 @@ void brcmf_usb_exit(void)
- 
- void brcmf_usb_register(void)
- {
-+	int ret;
-+
- 	brcmf_dbg(USB, "Enter\n");
--	usb_register(&brcmf_usbdrvr);
-+	ret = usb_register(&brcmf_usbdrvr);
-+	if (ret)
-+		brcmf_err("usb_register failed %d\n", ret);
- }

+ 0 - 33
package/kernel/mac80211/patches/brcm/342-v5.1-brcmfmac-fix-system-warning-message-during-wowl-susp.patch

@@ -1,33 +0,0 @@
-From 3a33bd840523aaa06f4429fbfd38922bf0dc2e8d Mon Sep 17 00:00:00 2001
-From: Lo-Hsiang Lo <[email protected]>
-Date: Mon, 7 Jan 2019 08:46:16 +0000
-Subject: [PATCH] brcmfmac: fix system warning message during wowl suspend
-
-There is a system warning message, warn_slowpath-fmt, during suspend
-while using supplicant join AP and enable wowl feature by IW command.
-It's caused by brcmf_pno_remove_request path can't find the reqid.
-This fix will not go to remove pno request function if there is no
-pno scan.
-
-Acked-by: Arend van Spriel <[email protected]>
-Signed-off-by: Lo-Hsiang Lo <[email protected]>
-Signed-off-by: Chi-Hsien Lin <[email protected]>
-Signed-off-by: Kalle Valo <[email protected]>
----
- drivers/net/wireless/broadcom/brcm80211/brcmfmac/pno.c | 5 +++++
- 1 file changed, 5 insertions(+)
-
---- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/pno.c
-+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/pno.c
-@@ -496,6 +496,11 @@ int brcmf_pno_stop_sched_scan(struct brc
- 	brcmf_dbg(TRACE, "reqid=%llu\n", reqid);
- 
- 	pi = ifp_to_pno(ifp);
-+
-+	/* No PNO request */
-+	if (!pi->n_reqs)
-+		return 0;
-+
- 	err = brcmf_pno_remove_request(pi, reqid);
- 	if (err)
- 		return err;

+ 0 - 104
package/kernel/mac80211/patches/brcm/344-v5.1-brcmfmac-modify-__brcmf_err-to-take-bus-as-a-paramet.patch

@@ -1,104 +0,0 @@
-From 5cc898fbcb352b764f8d51c16e10e2eb0056173d Mon Sep 17 00:00:00 2001
-From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= <[email protected]>
-Date: Wed, 6 Feb 2019 12:28:15 +0100
-Subject: [PATCH] brcmfmac: modify __brcmf_err() to take bus as a parameter
-MIME-Version: 1.0
-Content-Type: text/plain; charset=UTF-8
-Content-Transfer-Encoding: 8bit
-
-So far __brcmf_err() was using pr_err() which didn't allow identifying
-device that was affected by an error. It's crucial for systems with more
-than 1 device supported by brcmfmac (a common case for home routers).
-
-This change allows passing struct brcmf_bus to the __brcmf_err(). That
-struct has been agreed to be the most common one. It allows accessing
-struct device easily & using dev_err() printing helper.
-
-Signed-off-by: Rafał Miłecki <[email protected]>
-Acked-by: Arend van Spriel <[email protected]>
-Signed-off-by: Kalle Valo <[email protected]>
----
- .../net/wireless/broadcom/brcm80211/brcmfmac/common.c    | 7 +++++--
- drivers/net/wireless/broadcom/brcm80211/brcmfmac/debug.h | 8 +++++---
- .../wireless/broadcom/brcm80211/brcmfmac/tracepoint.c    | 9 +++++++--
- 3 files changed, 17 insertions(+), 7 deletions(-)
-
---- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/common.c
-+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/common.c
-@@ -350,7 +350,7 @@ done:
- }
- 
- #ifndef CPTCFG_BRCM_TRACING
--void __brcmf_err(const char *func, const char *fmt, ...)
-+void __brcmf_err(struct brcmf_bus *bus, const char *func, const char *fmt, ...)
- {
- 	struct va_format vaf;
- 	va_list args;
-@@ -359,7 +359,10 @@ void __brcmf_err(const char *func, const
- 
- 	vaf.fmt = fmt;
- 	vaf.va = &args;
--	pr_err("%s: %pV", func, &vaf);
-+	if (bus)
-+		dev_err(bus->dev, "%s: %pV", func, &vaf);
-+	else
-+		pr_err("%s: %pV", func, &vaf);
- 
- 	va_end(args);
- }
---- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/debug.h
-+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/debug.h
-@@ -45,8 +45,10 @@
- #undef pr_fmt
- #define pr_fmt(fmt)		KBUILD_MODNAME ": " fmt
- 
--__printf(2, 3)
--void __brcmf_err(const char *func, const char *fmt, ...);
-+struct brcmf_bus;
-+
-+__printf(3, 4)
-+void __brcmf_err(struct brcmf_bus *bus, const char *func, const char *fmt, ...);
- /* Macro for error messages. When debugging / tracing the driver all error
-  * messages are important to us.
-  */
-@@ -55,7 +57,7 @@ void __brcmf_err(const char *func, const
- 		if (IS_ENABLED(CPTCFG_BRCMDBG) ||			\
- 		    IS_ENABLED(CPTCFG_BRCM_TRACING) ||			\
- 		    net_ratelimit())					\
--			__brcmf_err(__func__, fmt, ##__VA_ARGS__);	\
-+			__brcmf_err(NULL, __func__, fmt, ##__VA_ARGS__);\
- 	} while (0)
- 
- #if defined(DEBUG) || defined(CPTCFG_BRCM_TRACING)
---- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/tracepoint.c
-+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/tracepoint.c
-@@ -14,14 +14,16 @@
-  * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
-  */
- 
-+#include <linux/device.h>
- #include <linux/module.h> /* bug in tracepoint.h, it should include this */
- 
- #ifndef __CHECKER__
- #define CREATE_TRACE_POINTS
-+#include "bus.h"
- #include "tracepoint.h"
- #include "debug.h"
- 
--void __brcmf_err(const char *func, const char *fmt, ...)
-+void __brcmf_err(struct brcmf_bus *bus, const char *func, const char *fmt, ...)
- {
- 	struct va_format vaf = {
- 		.fmt = fmt,
-@@ -30,7 +32,10 @@ void __brcmf_err(const char *func, const
- 
- 	va_start(args, fmt);
- 	vaf.va = &args;
--	pr_err("%s: %pV", func, &vaf);
-+	if (bus)
-+		dev_err(bus->dev, "%s: %pV", func, &vaf);
-+	else
-+		pr_err("%s: %pV", func, &vaf);
- 	trace_brcmf_err(func, &vaf);
- 	va_end(args);
- }

+ 0 - 266
package/kernel/mac80211/patches/brcm/345-v5.1-brcmfmac-pass-bus-to-the-__brcmf_err-in-pcie.c.patch

@@ -1,266 +0,0 @@
-From 8602e62441aba276cafd68034b72162fbc5ca0a6 Mon Sep 17 00:00:00 2001
-From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= <[email protected]>
-Date: Wed, 6 Feb 2019 12:28:16 +0100
-Subject: [PATCH] brcmfmac: pass bus to the __brcmf_err() in pcie.c
-MIME-Version: 1.0
-Content-Type: text/plain; charset=UTF-8
-Content-Transfer-Encoding: 8bit
-
-This enables dev_err() usage (instead of pr_err()) in the __brcmf_err().
-It makes error messages more meaningful and is important for debugging
-errors/bugs on systems with multiple brcmfmac supported devices.
-
-All bus files should follow & get updated similarly (soon).
-
-Signed-off-by: Rafał Miłecki <[email protected]>
-Signed-off-by: Kalle Valo <[email protected]>
----
- .../broadcom/brcm80211/brcmfmac/debug.h       |  2 +
- .../broadcom/brcm80211/brcmfmac/pcie.c        | 59 +++++++++++--------
- 2 files changed, 38 insertions(+), 23 deletions(-)
-
---- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/debug.h
-+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/debug.h
-@@ -52,6 +52,7 @@ void __brcmf_err(struct brcmf_bus *bus,
- /* Macro for error messages. When debugging / tracing the driver all error
-  * messages are important to us.
-  */
-+#ifndef brcmf_err
- #define brcmf_err(fmt, ...)						\
- 	do {								\
- 		if (IS_ENABLED(CPTCFG_BRCMDBG) ||			\
-@@ -59,6 +60,7 @@ void __brcmf_err(struct brcmf_bus *bus,
- 		    net_ratelimit())					\
- 			__brcmf_err(NULL, __func__, fmt, ##__VA_ARGS__);\
- 	} while (0)
-+#endif
- 
- #if defined(DEBUG) || defined(CPTCFG_BRCM_TRACING)
- 
---- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/pcie.c
-+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/pcie.c
-@@ -30,6 +30,15 @@
- #include <brcmu_wifi.h>
- #include <brcm_hw_ids.h>
- 
-+/* Custom brcmf_err() that takes bus arg and passes it further */
-+#define brcmf_err(bus, fmt, ...)					\
-+	do {								\
-+		if (IS_ENABLED(CPTCFG_BRCMDBG) ||			\
-+		    IS_ENABLED(CPTCFG_BRCM_TRACING) ||			\
-+		    net_ratelimit())					\
-+			__brcmf_err(bus, __func__, fmt, ##__VA_ARGS__);	\
-+	} while (0)
-+
- #include "debug.h"
- #include "bus.h"
- #include "commonring.h"
-@@ -531,6 +540,7 @@ static void
- brcmf_pcie_select_core(struct brcmf_pciedev_info *devinfo, u16 coreid)
- {
- 	const struct pci_dev *pdev = devinfo->pdev;
-+	struct brcmf_bus *bus = dev_get_drvdata(&pdev->dev);
- 	struct brcmf_core *core;
- 	u32 bar0_win;
- 
-@@ -548,7 +558,7 @@ brcmf_pcie_select_core(struct brcmf_pcie
- 			}
- 		}
- 	} else {
--		brcmf_err("Unsupported core selected %x\n", coreid);
-+		brcmf_err(bus, "Unsupported core selected %x\n", coreid);
- 	}
- }
- 
-@@ -848,9 +858,8 @@ static irqreturn_t brcmf_pcie_isr_thread
- 
- static int brcmf_pcie_request_irq(struct brcmf_pciedev_info *devinfo)
- {
--	struct pci_dev *pdev;
--
--	pdev = devinfo->pdev;
-+	struct pci_dev *pdev = devinfo->pdev;
-+	struct brcmf_bus *bus = dev_get_drvdata(&pdev->dev);
- 
- 	brcmf_pcie_intr_disable(devinfo);
- 
-@@ -861,7 +870,7 @@ static int brcmf_pcie_request_irq(struct
- 				 brcmf_pcie_isr_thread, IRQF_SHARED,
- 				 "brcmf_pcie_intr", devinfo)) {
- 		pci_disable_msi(pdev);
--		brcmf_err("Failed to request IRQ %d\n", pdev->irq);
-+		brcmf_err(bus, "Failed to request IRQ %d\n", pdev->irq);
- 		return -EIO;
- 	}
- 	devinfo->irq_allocated = true;
-@@ -871,15 +880,14 @@ static int brcmf_pcie_request_irq(struct
- 
- static void brcmf_pcie_release_irq(struct brcmf_pciedev_info *devinfo)
- {
--	struct pci_dev *pdev;
-+	struct pci_dev *pdev = devinfo->pdev;
-+	struct brcmf_bus *bus = dev_get_drvdata(&pdev->dev);
- 	u32 status;
- 	u32 count;
- 
- 	if (!devinfo->irq_allocated)
- 		return;
- 
--	pdev = devinfo->pdev;
--
- 	brcmf_pcie_intr_disable(devinfo);
- 	free_irq(pdev->irq, devinfo);
- 	pci_disable_msi(pdev);
-@@ -891,7 +899,7 @@ static void brcmf_pcie_release_irq(struc
- 		count++;
- 	}
- 	if (devinfo->in_irq)
--		brcmf_err("Still in IRQ (processing) !!!\n");
-+		brcmf_err(bus, "Still in IRQ (processing) !!!\n");
- 
- 	status = brcmf_pcie_read_reg32(devinfo, BRCMF_PCIE_PCIE2REG_MAILBOXINT);
- 	brcmf_pcie_write_reg32(devinfo, BRCMF_PCIE_PCIE2REG_MAILBOXINT, status);
-@@ -1102,6 +1110,7 @@ static void brcmf_pcie_release_ringbuffe
- 
- static int brcmf_pcie_init_ringbuffers(struct brcmf_pciedev_info *devinfo)
- {
-+	struct brcmf_bus *bus = dev_get_drvdata(&devinfo->pdev->dev);
- 	struct brcmf_pcie_ringbuf *ring;
- 	struct brcmf_pcie_ringbuf *rings;
- 	u32 d2h_w_idx_ptr;
-@@ -1254,7 +1263,7 @@ static int brcmf_pcie_init_ringbuffers(s
- 	return 0;
- 
- fail:
--	brcmf_err("Allocating ring buffers failed\n");
-+	brcmf_err(bus, "Allocating ring buffers failed\n");
- 	brcmf_pcie_release_ringbuffers(devinfo);
- 	return -ENOMEM;
- }
-@@ -1277,6 +1286,7 @@ brcmf_pcie_release_scratchbuffers(struct
- 
- static int brcmf_pcie_init_scratchbuffers(struct brcmf_pciedev_info *devinfo)
- {
-+	struct brcmf_bus *bus = dev_get_drvdata(&devinfo->pdev->dev);
- 	u64 address;
- 	u32 addr;
- 
-@@ -1316,7 +1326,7 @@ static int brcmf_pcie_init_scratchbuffer
- 	return 0;
- 
- fail:
--	brcmf_err("Allocating scratch buffers failed\n");
-+	brcmf_err(bus, "Allocating scratch buffers failed\n");
- 	brcmf_pcie_release_scratchbuffers(devinfo);
- 	return -ENOMEM;
- }
-@@ -1437,6 +1447,7 @@ static int
- brcmf_pcie_init_share_ram_info(struct brcmf_pciedev_info *devinfo,
- 			       u32 sharedram_addr)
- {
-+	struct brcmf_bus *bus = dev_get_drvdata(&devinfo->pdev->dev);
- 	struct brcmf_pcie_shared_info *shared;
- 	u32 addr;
- 
-@@ -1448,7 +1459,8 @@ brcmf_pcie_init_share_ram_info(struct br
- 	brcmf_dbg(PCIE, "PCIe protocol version %d\n", shared->version);
- 	if ((shared->version > BRCMF_PCIE_MAX_SHARED_VERSION) ||
- 	    (shared->version < BRCMF_PCIE_MIN_SHARED_VERSION)) {
--		brcmf_err("Unsupported PCIE version %d\n", shared->version);
-+		brcmf_err(bus, "Unsupported PCIE version %d\n",
-+			  shared->version);
- 		return -EINVAL;
- 	}
- 
-@@ -1490,6 +1502,7 @@ static int brcmf_pcie_download_fw_nvram(
- 					const struct firmware *fw, void *nvram,
- 					u32 nvram_len)
- {
-+	struct brcmf_bus *bus = dev_get_drvdata(&devinfo->pdev->dev);
- 	u32 sharedram_addr;
- 	u32 sharedram_addr_written;
- 	u32 loop_counter;
-@@ -1544,7 +1557,7 @@ static int brcmf_pcie_download_fw_nvram(
- 		loop_counter--;
- 	}
- 	if (sharedram_addr == sharedram_addr_written) {
--		brcmf_err("FW failed to initialize\n");
-+		brcmf_err(bus, "FW failed to initialize\n");
- 		return -ENODEV;
- 	}
- 	brcmf_dbg(PCIE, "Shared RAM addr: 0x%08x\n", sharedram_addr);
-@@ -1555,16 +1568,15 @@ static int brcmf_pcie_download_fw_nvram(
- 
- static int brcmf_pcie_get_resource(struct brcmf_pciedev_info *devinfo)
- {
--	struct pci_dev *pdev;
-+	struct pci_dev *pdev = devinfo->pdev;
-+	struct brcmf_bus *bus = dev_get_drvdata(&pdev->dev);
- 	int err;
- 	phys_addr_t  bar0_addr, bar1_addr;
- 	ulong bar1_size;
- 
--	pdev = devinfo->pdev;
--
- 	err = pci_enable_device(pdev);
- 	if (err) {
--		brcmf_err("pci_enable_device failed err=%d\n", err);
-+		brcmf_err(bus, "pci_enable_device failed err=%d\n", err);
- 		return err;
- 	}
- 
-@@ -1577,7 +1589,7 @@ static int brcmf_pcie_get_resource(struc
- 	/* read Bar-1 mapped memory range */
- 	bar1_size = pci_resource_len(pdev, 2);
- 	if ((bar1_size == 0) || (bar1_addr == 0)) {
--		brcmf_err("BAR1 Not enabled, device size=%ld, addr=%#016llx\n",
-+		brcmf_err(bus, "BAR1 Not enabled, device size=%ld, addr=%#016llx\n",
- 			  bar1_size, (unsigned long long)bar1_addr);
- 		return -EINVAL;
- 	}
-@@ -1586,7 +1598,7 @@ static int brcmf_pcie_get_resource(struc
- 	devinfo->tcm = ioremap_nocache(bar1_addr, bar1_size);
- 
- 	if (!devinfo->regs || !devinfo->tcm) {
--		brcmf_err("ioremap() failed (%p,%p)\n", devinfo->regs,
-+		brcmf_err(bus, "ioremap() failed (%p,%p)\n", devinfo->regs,
- 			  devinfo->tcm);
- 		return -EINVAL;
- 	}
-@@ -1873,7 +1885,7 @@ fail_bus:
- 	kfree(bus->msgbuf);
- 	kfree(bus);
- fail:
--	brcmf_err("failed %x:%x\n", pdev->vendor, pdev->device);
-+	brcmf_err(NULL, "failed %x:%x\n", pdev->vendor, pdev->device);
- 	brcmf_pcie_release_resource(devinfo);
- 	if (devinfo->ci)
- 		brcmf_chip_detach(devinfo->ci);
-@@ -1947,7 +1959,7 @@ static int brcmf_pcie_pm_enter_D3(struct
- 	wait_event_timeout(devinfo->mbdata_resp_wait, devinfo->mbdata_completed,
- 			   BRCMF_PCIE_MBDATA_TIMEOUT);
- 	if (!devinfo->mbdata_completed) {
--		brcmf_err("Timeout on response for entering D3 substate\n");
-+		brcmf_err(bus, "Timeout on response for entering D3 substate\n");
- 		brcmf_bus_change_state(bus, BRCMF_BUS_UP);
- 		return -EIO;
- 	}
-@@ -1993,7 +2005,7 @@ cleanup:
- 
- 	err = brcmf_pcie_probe(pdev, NULL);
- 	if (err)
--		brcmf_err("probe after resume failed, err=%d\n", err);
-+		brcmf_err(bus, "probe after resume failed, err=%d\n", err);
- 
- 	return err;
- }
-@@ -2066,7 +2078,8 @@ void brcmf_pcie_register(void)
- 	brcmf_dbg(PCIE, "Enter\n");
- 	err = pci_register_driver(&brcmf_pciedrvr);
- 	if (err)
--		brcmf_err("PCIE driver registration failed, err=%d\n", err);
-+		brcmf_err(NULL, "PCIE driver registration failed, err=%d\n",
-+			  err);
- }
- 
- 

+ 0 - 2025
package/kernel/mac80211/patches/brcm/346-v5.1-brcmfmac-add-bphy_err-and-use-it-in-the-cfg80211.c.patch

@@ -1,2025 +0,0 @@
-From 3ef005b82e2ad68107fc5814eaa743d171a6c362 Mon Sep 17 00:00:00 2001
-From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= <[email protected]>
-Date: Wed, 16 Jan 2019 07:28:54 +0100
-Subject: [PATCH] brcmfmac: add bphy_err() and use it in the cfg80211.c
-MIME-Version: 1.0
-Content-Type: text/plain; charset=UTF-8
-Content-Transfer-Encoding: 8bit
-
-This new macro uses wiphy_err() which:
-1) Should be the best choice with wiphy already created
-2) Uses dev_err() which allows identifying error-affected device
-
-Signed-off-by: Rafał Miłecki <[email protected]>
-Signed-off-by: Kalle Valo <[email protected]>
----
- .../broadcom/brcm80211/brcmfmac/cfg80211.c    | 497 ++++++++++--------
- .../broadcom/brcm80211/brcmfmac/debug.h       |   9 +
- 2 files changed, 282 insertions(+), 224 deletions(-)
-
---- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c
-+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c
-@@ -457,6 +457,7 @@ static void convert_key_from_CPU(struct
- static int
- send_key_to_dongle(struct brcmf_if *ifp, struct brcmf_wsec_key *key)
- {
-+	struct wiphy *wiphy = ifp->drvr->wiphy;
- 	int err;
- 	struct brcmf_wsec_key_le key_le;
- 
-@@ -468,7 +469,7 @@ send_key_to_dongle(struct brcmf_if *ifp,
- 					sizeof(key_le));
- 
- 	if (err)
--		brcmf_err("wsec_key error (%d)\n", err);
-+		bphy_err(wiphy, "wsec_key error (%d)\n", err);
- 	return err;
- }
- 
-@@ -508,6 +509,7 @@ static int brcmf_get_first_free_bsscfgid
- 
- static int brcmf_cfg80211_request_ap_if(struct brcmf_if *ifp)
- {
-+	struct wiphy *wiphy = ifp->drvr->wiphy;
- 	struct brcmf_mbss_ssid_le mbss_ssid_le;
- 	int bsscfgidx;
- 	int err;
-@@ -524,7 +526,7 @@ static int brcmf_cfg80211_request_ap_if(
- 	err = brcmf_fil_bsscfg_data_set(ifp, "bsscfg:ssid", &mbss_ssid_le,
- 					sizeof(mbss_ssid_le));
- 	if (err < 0)
--		brcmf_err("setting ssid failed %d\n", err);
-+		bphy_err(wiphy, "setting ssid failed %d\n", err);
- 
- 	return err;
- }
-@@ -567,7 +569,7 @@ struct wireless_dev *brcmf_ap_add_vif(st
- 					    BRCMF_VIF_EVENT_TIMEOUT);
- 	brcmf_cfg80211_arm_vif_event(cfg, NULL);
- 	if (!err) {
--		brcmf_err("timeout occurred\n");
-+		bphy_err(wiphy, "timeout occurred\n");
- 		err = -EIO;
- 		goto fail;
- 	}
-@@ -575,7 +577,7 @@ struct wireless_dev *brcmf_ap_add_vif(st
- 	/* interface created in firmware */
- 	ifp = vif->ifp;
- 	if (!ifp) {
--		brcmf_err("no if pointer provided\n");
-+		bphy_err(wiphy, "no if pointer provided\n");
- 		err = -ENOENT;
- 		goto fail;
- 	}
-@@ -583,7 +585,7 @@ struct wireless_dev *brcmf_ap_add_vif(st
- 	strncpy(ifp->ndev->name, name, sizeof(ifp->ndev->name) - 1);
- 	err = brcmf_net_attach(ifp, true);
- 	if (err) {
--		brcmf_err("Registering netdevice failed\n");
-+		bphy_err(wiphy, "Registering netdevice failed\n");
- 		free_netdev(ifp->ndev);
- 		goto fail;
- 	}
-@@ -620,7 +622,7 @@ static struct wireless_dev *brcmf_cfg802
- 	brcmf_dbg(TRACE, "enter: %s type %d\n", name, type);
- 	err = brcmf_vif_add_validate(wiphy_to_cfg(wiphy), type);
- 	if (err) {
--		brcmf_err("iface validation failed: err=%d\n", err);
-+		bphy_err(wiphy, "iface validation failed: err=%d\n", err);
- 		return ERR_PTR(err);
- 	}
- 	switch (type) {
-@@ -645,8 +647,8 @@ static struct wireless_dev *brcmf_cfg802
- 	}
- 
- 	if (IS_ERR(wdev))
--		brcmf_err("add iface %s type %d failed: err=%d\n",
--			  name, type, (int)PTR_ERR(wdev));
-+		bphy_err(wiphy, "add iface %s type %d failed: err=%d\n", name,
-+			 type, (int)PTR_ERR(wdev));
- 	else
- 		brcmf_cfg80211_update_proto_addr_mode(wdev);
- 
-@@ -661,12 +663,13 @@ static void brcmf_scan_config_mpc(struct
- 
- void brcmf_set_mpc(struct brcmf_if *ifp, int mpc)
- {
-+	struct wiphy *wiphy = ifp->drvr->wiphy;
- 	s32 err = 0;
- 
- 	if (check_vif_up(ifp->vif)) {
- 		err = brcmf_fil_iovar_int_set(ifp, "mpc", mpc);
- 		if (err) {
--			brcmf_err("fail to set mpc\n");
-+			bphy_err(wiphy, "fail to set mpc\n");
- 			return;
- 		}
- 		brcmf_dbg(INFO, "MPC : %d\n", mpc);
-@@ -677,6 +680,7 @@ s32 brcmf_notify_escan_complete(struct b
- 				struct brcmf_if *ifp, bool aborted,
- 				bool fw_abort)
- {
-+	struct wiphy *wiphy = cfg_to_wiphy(cfg);
- 	struct brcmf_scan_params_le params_le;
- 	struct cfg80211_scan_request *scan_request;
- 	u64 reqid;
-@@ -711,7 +715,7 @@ s32 brcmf_notify_escan_complete(struct b
- 		err = brcmf_fil_cmd_data_set(ifp, BRCMF_C_SCAN,
- 					     &params_le, sizeof(params_le));
- 		if (err)
--			brcmf_err("Scan abort failed\n");
-+			bphy_err(wiphy, "Scan abort failed\n");
- 	}
- 
- 	brcmf_scan_config_mpc(ifp, 1);
-@@ -763,7 +767,7 @@ static int brcmf_cfg80211_del_ap_iface(s
- 
- 	err = brcmf_fil_bsscfg_data_set(ifp, "interface_remove", NULL, 0);
- 	if (err) {
--		brcmf_err("interface_remove failed %d\n", err);
-+		bphy_err(wiphy, "interface_remove failed %d\n", err);
- 		goto err_unarm;
- 	}
- 
-@@ -771,7 +775,7 @@ static int brcmf_cfg80211_del_ap_iface(s
- 	ret = brcmf_cfg80211_wait_vif_event(cfg, BRCMF_E_IF_DEL,
- 					    BRCMF_VIF_EVENT_TIMEOUT);
- 	if (!ret) {
--		brcmf_err("timeout occurred\n");
-+		bphy_err(wiphy, "timeout occurred\n");
- 		err = -EIO;
- 		goto err_unarm;
- 	}
-@@ -873,14 +877,14 @@ brcmf_cfg80211_change_iface(struct wiphy
- 	}
- 	err = brcmf_vif_change_validate(wiphy_to_cfg(wiphy), vif, type);
- 	if (err) {
--		brcmf_err("iface validation failed: err=%d\n", err);
-+		bphy_err(wiphy, "iface validation failed: err=%d\n", err);
- 		return err;
- 	}
- 	switch (type) {
- 	case NL80211_IFTYPE_MONITOR:
- 	case NL80211_IFTYPE_WDS:
--		brcmf_err("type (%d) : currently we do not support this type\n",
--			  type);
-+		bphy_err(wiphy, "type (%d) : currently we do not support this type\n",
-+			 type);
- 		return -EOPNOTSUPP;
- 	case NL80211_IFTYPE_ADHOC:
- 		infra = 0;
-@@ -908,7 +912,7 @@ brcmf_cfg80211_change_iface(struct wiphy
- 	} else {
- 		err = brcmf_fil_cmd_int_set(ifp, BRCMF_C_SET_INFRA, infra);
- 		if (err) {
--			brcmf_err("WLC_SET_INFRA error (%d)\n", err);
-+			bphy_err(wiphy, "WLC_SET_INFRA error (%d)\n", err);
- 			err = -EAGAIN;
- 			goto done;
- 		}
-@@ -999,6 +1003,7 @@ static s32
- brcmf_run_escan(struct brcmf_cfg80211_info *cfg, struct brcmf_if *ifp,
- 		struct cfg80211_scan_request *request)
- {
-+	struct wiphy *wiphy = cfg_to_wiphy(cfg);
- 	s32 params_size = BRCMF_SCAN_PARAMS_FIXED_SIZE +
- 			  offsetof(struct brcmf_escan_params_le, params_le);
- 	struct brcmf_escan_params_le *params;
-@@ -1030,7 +1035,7 @@ brcmf_run_escan(struct brcmf_cfg80211_in
- 		if (err == -EBUSY)
- 			brcmf_dbg(INFO, "system busy : escan canceled\n");
- 		else
--			brcmf_err("error (%d)\n", err);
-+			bphy_err(wiphy, "error (%d)\n", err);
- 	}
- 
- 	kfree(params);
-@@ -1076,21 +1081,22 @@ brcmf_cfg80211_scan(struct wiphy *wiphy,
- 		return -EIO;
- 
- 	if (test_bit(BRCMF_SCAN_STATUS_BUSY, &cfg->scan_status)) {
--		brcmf_err("Scanning already: status (%lu)\n", cfg->scan_status);
-+		bphy_err(wiphy, "Scanning already: status (%lu)\n",
-+			 cfg->scan_status);
- 		return -EAGAIN;
- 	}
- 	if (test_bit(BRCMF_SCAN_STATUS_ABORT, &cfg->scan_status)) {
--		brcmf_err("Scanning being aborted: status (%lu)\n",
--			  cfg->scan_status);
-+		bphy_err(wiphy, "Scanning being aborted: status (%lu)\n",
-+			 cfg->scan_status);
- 		return -EAGAIN;
- 	}
- 	if (test_bit(BRCMF_SCAN_STATUS_SUPPRESS, &cfg->scan_status)) {
--		brcmf_err("Scanning suppressed: status (%lu)\n",
--			  cfg->scan_status);
-+		bphy_err(wiphy, "Scanning suppressed: status (%lu)\n",
-+			 cfg->scan_status);
- 		return -EAGAIN;
- 	}
- 	if (test_bit(BRCMF_VIF_STATUS_CONNECTING, &vif->sme_state)) {
--		brcmf_err("Connecting: status (%lu)\n", vif->sme_state);
-+		bphy_err(wiphy, "Connecting: status (%lu)\n", vif->sme_state);
- 		return -EAGAIN;
- 	}
- 
-@@ -1124,7 +1130,7 @@ brcmf_cfg80211_scan(struct wiphy *wiphy,
- 	return 0;
- 
- scan_out:
--	brcmf_err("scan error (%d)\n", err);
-+	bphy_err(wiphy, "scan error (%d)\n", err);
- 	clear_bit(BRCMF_SCAN_STATUS_BUSY, &cfg->scan_status);
- 	cfg->scan_request = NULL;
- 	return err;
-@@ -1132,36 +1138,41 @@ scan_out:
- 
- static s32 brcmf_set_rts(struct net_device *ndev, u32 rts_threshold)
- {
-+	struct brcmf_if *ifp = netdev_priv(ndev);
-+	struct wiphy *wiphy = ifp->drvr->wiphy;
- 	s32 err = 0;
- 
--	err = brcmf_fil_iovar_int_set(netdev_priv(ndev), "rtsthresh",
--				      rts_threshold);
-+	err = brcmf_fil_iovar_int_set(ifp, "rtsthresh", rts_threshold);
- 	if (err)
--		brcmf_err("Error (%d)\n", err);
-+		bphy_err(wiphy, "Error (%d)\n", err);
- 
- 	return err;
- }
- 
- static s32 brcmf_set_frag(struct net_device *ndev, u32 frag_threshold)
- {
-+	struct brcmf_if *ifp = netdev_priv(ndev);
-+	struct wiphy *wiphy = ifp->drvr->wiphy;
- 	s32 err = 0;
- 
--	err = brcmf_fil_iovar_int_set(netdev_priv(ndev), "fragthresh",
-+	err = brcmf_fil_iovar_int_set(ifp, "fragthresh",
- 				      frag_threshold);
- 	if (err)
--		brcmf_err("Error (%d)\n", err);
-+		bphy_err(wiphy, "Error (%d)\n", err);
- 
- 	return err;
- }
- 
- static s32 brcmf_set_retry(struct net_device *ndev, u32 retry, bool l)
- {
-+	struct brcmf_if *ifp = netdev_priv(ndev);
-+	struct wiphy *wiphy = ifp->drvr->wiphy;
- 	s32 err = 0;
- 	u32 cmd = (l ? BRCMF_C_SET_LRL : BRCMF_C_SET_SRL);
- 
--	err = brcmf_fil_cmd_int_set(netdev_priv(ndev), cmd, retry);
-+	err = brcmf_fil_cmd_int_set(ifp, cmd, retry);
- 	if (err) {
--		brcmf_err("cmd (%d) , error (%d)\n", cmd, err);
-+		bphy_err(wiphy, "cmd (%d) , error (%d)\n", cmd, err);
- 		return err;
- 	}
- 	return err;
-@@ -1237,6 +1248,7 @@ static u16 brcmf_map_fw_linkdown_reason(
- 
- static int brcmf_set_pmk(struct brcmf_if *ifp, const u8 *pmk_data, u16 pmk_len)
- {
-+	struct wiphy *wiphy = ifp->drvr->wiphy;
- 	struct brcmf_wsec_pmk_le pmk;
- 	int i, err;
- 
-@@ -1250,8 +1262,8 @@ static int brcmf_set_pmk(struct brcmf_if
- 	err = brcmf_fil_cmd_data_set(ifp, BRCMF_C_SET_WSEC_PMK,
- 				     &pmk, sizeof(pmk));
- 	if (err < 0)
--		brcmf_err("failed to change PSK in firmware (len=%u)\n",
--			  pmk_len);
-+		bphy_err(wiphy, "failed to change PSK in firmware (len=%u)\n",
-+			 pmk_len);
- 
- 	return err;
- }
-@@ -1259,6 +1271,7 @@ static int brcmf_set_pmk(struct brcmf_if
- static void brcmf_link_down(struct brcmf_cfg80211_vif *vif, u16 reason)
- {
- 	struct brcmf_cfg80211_info *cfg = wiphy_to_cfg(vif->wdev.wiphy);
-+	struct wiphy *wiphy = cfg_to_wiphy(cfg);
- 	s32 err = 0;
- 
- 	brcmf_dbg(TRACE, "Enter\n");
-@@ -1268,7 +1281,7 @@ static void brcmf_link_down(struct brcmf
- 		err = brcmf_fil_cmd_data_set(vif->ifp,
- 					     BRCMF_C_DISASSOC, NULL, 0);
- 		if (err) {
--			brcmf_err("WLC_DISASSOC failed (%d)\n", err);
-+			bphy_err(wiphy, "WLC_DISASSOC failed (%d)\n", err);
- 		}
- 		if ((vif->wdev.iftype == NL80211_IFTYPE_STATION) ||
- 		    (vif->wdev.iftype == NL80211_IFTYPE_P2P_CLIENT))
-@@ -1356,7 +1369,7 @@ brcmf_cfg80211_join_ibss(struct wiphy *w
- 
- 	err = brcmf_fil_iovar_int_set(ifp, "wsec", wsec);
- 	if (err) {
--		brcmf_err("wsec failed (%d)\n", err);
-+		bphy_err(wiphy, "wsec failed (%d)\n", err);
- 		goto done;
- 	}
- 
-@@ -1368,7 +1381,7 @@ brcmf_cfg80211_join_ibss(struct wiphy *w
- 
- 	err = brcmf_fil_cmd_int_set(ifp, BRCMF_C_SET_BCNPRD, bcnprd);
- 	if (err) {
--		brcmf_err("WLC_SET_BCNPRD failed (%d)\n", err);
-+		bphy_err(wiphy, "WLC_SET_BCNPRD failed (%d)\n", err);
- 		goto done;
- 	}
- 
-@@ -1413,7 +1426,7 @@ brcmf_cfg80211_join_ibss(struct wiphy *w
- 		err = brcmf_fil_cmd_int_set(ifp, BRCMF_C_SET_CHANNEL,
- 					    target_channel);
- 		if (err) {
--			brcmf_err("WLC_SET_CHANNEL failed (%d)\n", err);
-+			bphy_err(wiphy, "WLC_SET_CHANNEL failed (%d)\n", err);
- 			goto done;
- 		}
- 	} else
-@@ -1425,7 +1438,7 @@ brcmf_cfg80211_join_ibss(struct wiphy *w
- 	err = brcmf_fil_cmd_data_set(ifp, BRCMF_C_SET_SSID,
- 				     &join_params, join_params_size);
- 	if (err) {
--		brcmf_err("WLC_SET_SSID failed (%d)\n", err);
-+		bphy_err(wiphy, "WLC_SET_SSID failed (%d)\n", err);
- 		goto done;
- 	}
- 
-@@ -1461,6 +1474,8 @@ brcmf_cfg80211_leave_ibss(struct wiphy *
- static s32 brcmf_set_wpa_version(struct net_device *ndev,
- 				 struct cfg80211_connect_params *sme)
- {
-+	struct brcmf_if *ifp = netdev_priv(ndev);
-+	struct wiphy *wiphy = ifp->drvr->wiphy;
- 	struct brcmf_cfg80211_profile *profile = ndev_to_prof(ndev);
- 	struct brcmf_cfg80211_security *sec;
- 	s32 val = 0;
-@@ -1473,9 +1488,9 @@ static s32 brcmf_set_wpa_version(struct
- 	else
- 		val = WPA_AUTH_DISABLED;
- 	brcmf_dbg(CONN, "setting wpa_auth to 0x%0x\n", val);
--	err = brcmf_fil_bsscfg_int_set(netdev_priv(ndev), "wpa_auth", val);
-+	err = brcmf_fil_bsscfg_int_set(ifp, "wpa_auth", val);
- 	if (err) {
--		brcmf_err("set wpa_auth failed (%d)\n", err);
-+		bphy_err(wiphy, "set wpa_auth failed (%d)\n", err);
- 		return err;
- 	}
- 	sec = &profile->sec;
-@@ -1486,6 +1501,8 @@ static s32 brcmf_set_wpa_version(struct
- static s32 brcmf_set_auth_type(struct net_device *ndev,
- 			       struct cfg80211_connect_params *sme)
- {
-+	struct brcmf_if *ifp = netdev_priv(ndev);
-+	struct wiphy *wiphy = ifp->drvr->wiphy;
- 	struct brcmf_cfg80211_profile *profile = ndev_to_prof(ndev);
- 	struct brcmf_cfg80211_security *sec;
- 	s32 val = 0;
-@@ -1506,9 +1523,9 @@ static s32 brcmf_set_auth_type(struct ne
- 		break;
- 	}
- 
--	err = brcmf_fil_bsscfg_int_set(netdev_priv(ndev), "auth", val);
-+	err = brcmf_fil_bsscfg_int_set(ifp, "auth", val);
- 	if (err) {
--		brcmf_err("set auth failed (%d)\n", err);
-+		bphy_err(wiphy, "set auth failed (%d)\n", err);
- 		return err;
- 	}
- 	sec = &profile->sec;
-@@ -1520,6 +1537,8 @@ static s32
- brcmf_set_wsec_mode(struct net_device *ndev,
- 		    struct cfg80211_connect_params *sme)
- {
-+	struct brcmf_if *ifp = netdev_priv(ndev);
-+	struct wiphy *wiphy = ifp->drvr->wiphy;
- 	struct brcmf_cfg80211_profile *profile = ndev_to_prof(ndev);
- 	struct brcmf_cfg80211_security *sec;
- 	s32 pval = 0;
-@@ -1543,8 +1562,8 @@ brcmf_set_wsec_mode(struct net_device *n
- 			pval = AES_ENABLED;
- 			break;
- 		default:
--			brcmf_err("invalid cipher pairwise (%d)\n",
--				  sme->crypto.ciphers_pairwise[0]);
-+			bphy_err(wiphy, "invalid cipher pairwise (%d)\n",
-+				 sme->crypto.ciphers_pairwise[0]);
- 			return -EINVAL;
- 		}
- 	}
-@@ -1564,8 +1583,8 @@ brcmf_set_wsec_mode(struct net_device *n
- 			gval = AES_ENABLED;
- 			break;
- 		default:
--			brcmf_err("invalid cipher group (%d)\n",
--				  sme->crypto.cipher_group);
-+			bphy_err(wiphy, "invalid cipher group (%d)\n",
-+				 sme->crypto.cipher_group);
- 			return -EINVAL;
- 		}
- 	}
-@@ -1578,9 +1597,9 @@ brcmf_set_wsec_mode(struct net_device *n
- 		pval = AES_ENABLED;
- 
- 	wsec = pval | gval;
--	err = brcmf_fil_bsscfg_int_set(netdev_priv(ndev), "wsec", wsec);
-+	err = brcmf_fil_bsscfg_int_set(ifp, "wsec", wsec);
- 	if (err) {
--		brcmf_err("error (%d)\n", err);
-+		bphy_err(wiphy, "error (%d)\n", err);
- 		return err;
- 	}
- 
-@@ -1595,6 +1614,7 @@ static s32
- brcmf_set_key_mgmt(struct net_device *ndev, struct cfg80211_connect_params *sme)
- {
- 	struct brcmf_if *ifp = netdev_priv(ndev);
-+	struct wiphy *wiphy = ifp->drvr->wiphy;
- 	struct brcmf_cfg80211_profile *profile = &ifp->vif->profile;
- 	s32 val;
- 	s32 err;
-@@ -1613,7 +1633,7 @@ brcmf_set_key_mgmt(struct net_device *nd
- 
- 	err = brcmf_fil_bsscfg_int_get(netdev_priv(ndev), "wpa_auth", &val);
- 	if (err) {
--		brcmf_err("could not get wpa_auth (%d)\n", err);
-+		bphy_err(wiphy, "could not get wpa_auth (%d)\n", err);
- 		return err;
- 	}
- 	if (val & (WPA_AUTH_PSK | WPA_AUTH_UNSPECIFIED)) {
-@@ -1627,8 +1647,8 @@ brcmf_set_key_mgmt(struct net_device *nd
- 			val = WPA_AUTH_PSK;
- 			break;
- 		default:
--			brcmf_err("invalid cipher group (%d)\n",
--				  sme->crypto.cipher_group);
-+			bphy_err(wiphy, "invalid cipher group (%d)\n",
-+				 sme->crypto.cipher_group);
- 			return -EINVAL;
- 		}
- 	} else if (val & (WPA2_AUTH_PSK | WPA2_AUTH_UNSPECIFIED)) {
-@@ -1650,8 +1670,8 @@ brcmf_set_key_mgmt(struct net_device *nd
- 			val = WPA2_AUTH_PSK;
- 			break;
- 		default:
--			brcmf_err("invalid cipher group (%d)\n",
--				  sme->crypto.cipher_group);
-+			bphy_err(wiphy, "invalid cipher group (%d)\n",
-+				 sme->crypto.cipher_group);
- 			return -EINVAL;
- 		}
- 	}
-@@ -1697,7 +1717,7 @@ skip_mfp_config:
- 	brcmf_dbg(CONN, "setting wpa_auth to %d\n", val);
- 	err = brcmf_fil_bsscfg_int_set(netdev_priv(ndev), "wpa_auth", val);
- 	if (err) {
--		brcmf_err("could not set wpa_auth (%d)\n", err);
-+		bphy_err(wiphy, "could not set wpa_auth (%d)\n", err);
- 		return err;
- 	}
- 
-@@ -1708,6 +1728,8 @@ static s32
- brcmf_set_sharedkey(struct net_device *ndev,
- 		    struct cfg80211_connect_params *sme)
- {
-+	struct brcmf_if *ifp = netdev_priv(ndev);
-+	struct wiphy *wiphy = ifp->drvr->wiphy;
- 	struct brcmf_cfg80211_profile *profile = ndev_to_prof(ndev);
- 	struct brcmf_cfg80211_security *sec;
- 	struct brcmf_wsec_key key;
-@@ -1734,7 +1756,7 @@ brcmf_set_sharedkey(struct net_device *n
- 	key.len = (u32) sme->key_len;
- 	key.index = (u32) sme->key_idx;
- 	if (key.len > sizeof(key.data)) {
--		brcmf_err("Too long key length (%u)\n", key.len);
-+		bphy_err(wiphy, "Too long key length (%u)\n", key.len);
- 		return -EINVAL;
- 	}
- 	memcpy(key.data, sme->key, key.len);
-@@ -1747,24 +1769,24 @@ brcmf_set_sharedkey(struct net_device *n
- 		key.algo = CRYPTO_ALGO_WEP128;
- 		break;
- 	default:
--		brcmf_err("Invalid algorithm (%d)\n",
--			  sme->crypto.ciphers_pairwise[0]);
-+		bphy_err(wiphy, "Invalid algorithm (%d)\n",
-+			 sme->crypto.ciphers_pairwise[0]);
- 		return -EINVAL;
- 	}
- 	/* Set the new key/index */
- 	brcmf_dbg(CONN, "key length (%d) key index (%d) algo (%d)\n",
- 		  key.len, key.index, key.algo);
- 	brcmf_dbg(CONN, "key \"%s\"\n", key.data);
--	err = send_key_to_dongle(netdev_priv(ndev), &key);
-+	err = send_key_to_dongle(ifp, &key);
- 	if (err)
- 		return err;
- 
- 	if (sec->auth_type == NL80211_AUTHTYPE_SHARED_KEY) {
- 		brcmf_dbg(CONN, "set auth_type to shared key\n");
- 		val = WL_AUTH_SHARED_KEY;	/* shared key */
--		err = brcmf_fil_bsscfg_int_set(netdev_priv(ndev), "auth", val);
-+		err = brcmf_fil_bsscfg_int_set(ifp, "auth", val);
- 		if (err)
--			brcmf_err("set auth failed (%d)\n", err);
-+			bphy_err(wiphy, "set auth failed (%d)\n", err);
- 	}
- 	return err;
- }
-@@ -1784,6 +1806,7 @@ enum nl80211_auth_type brcmf_war_auth_ty
- static void brcmf_set_join_pref(struct brcmf_if *ifp,
- 				struct cfg80211_bss_selection *bss_select)
- {
-+	struct wiphy *wiphy = ifp->drvr->wiphy;
- 	struct brcmf_join_pref_params join_pref_params[2];
- 	enum nl80211_band band;
- 	int err, i = 0;
-@@ -1822,7 +1845,7 @@ static void brcmf_set_join_pref(struct b
- 	err = brcmf_fil_iovar_data_set(ifp, "join_pref", join_pref_params,
- 				       sizeof(join_pref_params));
- 	if (err)
--		brcmf_err("Set join_pref error (%d)\n", err);
-+		bphy_err(wiphy, "Set join_pref error (%d)\n", err);
- }
- 
- static s32
-@@ -1849,7 +1872,7 @@ brcmf_cfg80211_connect(struct wiphy *wip
- 		return -EIO;
- 
- 	if (!sme->ssid) {
--		brcmf_err("Invalid ssid\n");
-+		bphy_err(wiphy, "Invalid ssid\n");
- 		return -EOPNOTSUPP;
- 	}
- 
-@@ -1878,7 +1901,7 @@ brcmf_cfg80211_connect(struct wiphy *wip
- 	err = brcmf_vif_set_mgmt_ie(ifp->vif, BRCMF_VNDR_IE_ASSOCREQ_FLAG,
- 				    sme->ie, sme->ie_len);
- 	if (err)
--		brcmf_err("Set Assoc REQ IE Failed\n");
-+		bphy_err(wiphy, "Set Assoc REQ IE Failed\n");
- 	else
- 		brcmf_dbg(TRACE, "Applied Vndr IEs for Assoc request\n");
- 
-@@ -1899,32 +1922,32 @@ brcmf_cfg80211_connect(struct wiphy *wip
- 
- 	err = brcmf_set_wpa_version(ndev, sme);
- 	if (err) {
--		brcmf_err("wl_set_wpa_version failed (%d)\n", err);
-+		bphy_err(wiphy, "wl_set_wpa_version failed (%d)\n", err);
- 		goto done;
- 	}
- 
- 	sme->auth_type = brcmf_war_auth_type(ifp, sme->auth_type);
- 	err = brcmf_set_auth_type(ndev, sme);
- 	if (err) {
--		brcmf_err("wl_set_auth_type failed (%d)\n", err);
-+		bphy_err(wiphy, "wl_set_auth_type failed (%d)\n", err);
- 		goto done;
- 	}
- 
- 	err = brcmf_set_wsec_mode(ndev, sme);
- 	if (err) {
--		brcmf_err("wl_set_set_cipher failed (%d)\n", err);
-+		bphy_err(wiphy, "wl_set_set_cipher failed (%d)\n", err);
- 		goto done;
- 	}
- 
- 	err = brcmf_set_key_mgmt(ndev, sme);
- 	if (err) {
--		brcmf_err("wl_set_key_mgmt failed (%d)\n", err);
-+		bphy_err(wiphy, "wl_set_key_mgmt failed (%d)\n", err);
- 		goto done;
- 	}
- 
- 	err = brcmf_set_sharedkey(ndev, sme);
- 	if (err) {
--		brcmf_err("brcmf_set_sharedkey failed (%d)\n", err);
-+		bphy_err(wiphy, "brcmf_set_sharedkey failed (%d)\n", err);
- 		goto done;
- 	}
- 
-@@ -1941,7 +1964,7 @@ brcmf_cfg80211_connect(struct wiphy *wip
- 		/* enable firmware supplicant for this interface */
- 		err = brcmf_fil_iovar_int_set(ifp, "sup_wpa", 1);
- 		if (err < 0) {
--			brcmf_err("failed to enable fw supplicant\n");
-+			bphy_err(wiphy, "failed to enable fw supplicant\n");
- 			goto done;
- 		}
- 	}
-@@ -2036,7 +2059,7 @@ brcmf_cfg80211_connect(struct wiphy *wip
- 	err = brcmf_fil_cmd_data_set(ifp, BRCMF_C_SET_SSID,
- 				     &join_params, join_params_size);
- 	if (err)
--		brcmf_err("BRCMF_C_SET_SSID failed (%d)\n", err);
-+		bphy_err(wiphy, "BRCMF_C_SET_SSID failed (%d)\n", err);
- 
- done:
- 	if (err)
-@@ -2067,7 +2090,7 @@ brcmf_cfg80211_disconnect(struct wiphy *
- 	err = brcmf_fil_cmd_data_set(ifp, BRCMF_C_DISASSOC,
- 				     &scbval, sizeof(scbval));
- 	if (err)
--		brcmf_err("error (%d)\n", err);
-+		bphy_err(wiphy, "error (%d)\n", err);
- 
- 	brcmf_dbg(TRACE, "Exit\n");
- 	return err;
-@@ -2094,7 +2117,7 @@ brcmf_cfg80211_set_tx_power(struct wiphy
- 	case NL80211_TX_POWER_LIMITED:
- 	case NL80211_TX_POWER_FIXED:
- 		if (mbm < 0) {
--			brcmf_err("TX_POWER_FIXED - dbm is negative\n");
-+			bphy_err(wiphy, "TX_POWER_FIXED - dbm is negative\n");
- 			err = -EINVAL;
- 			goto done;
- 		}
-@@ -2104,7 +2127,7 @@ brcmf_cfg80211_set_tx_power(struct wiphy
- 		qdbm |= WL_TXPWR_OVERRIDE;
- 		break;
- 	default:
--		brcmf_err("Unsupported type %d\n", type);
-+		bphy_err(wiphy, "Unsupported type %d\n", type);
- 		err = -EINVAL;
- 		goto done;
- 	}
-@@ -2112,11 +2135,11 @@ brcmf_cfg80211_set_tx_power(struct wiphy
- 	disable = WL_RADIO_SW_DISABLE << 16;
- 	err = brcmf_fil_cmd_int_set(ifp, BRCMF_C_SET_RADIO, disable);
- 	if (err)
--		brcmf_err("WLC_SET_RADIO error (%d)\n", err);
-+		bphy_err(wiphy, "WLC_SET_RADIO error (%d)\n", err);
- 
- 	err = brcmf_fil_iovar_int_set(ifp, "qtxpower", qdbm);
- 	if (err)
--		brcmf_err("qtxpower error (%d)\n", err);
-+		bphy_err(wiphy, "qtxpower error (%d)\n", err);
- 
- done:
- 	brcmf_dbg(TRACE, "Exit %d (qdbm)\n", qdbm & ~WL_TXPWR_OVERRIDE);
-@@ -2137,7 +2160,7 @@ brcmf_cfg80211_get_tx_power(struct wiphy
- 
- 	err = brcmf_fil_iovar_int_get(vif->ifp, "qtxpower", &qdbm);
- 	if (err) {
--		brcmf_err("error (%d)\n", err);
-+		bphy_err(wiphy, "error (%d)\n", err);
- 		goto done;
- 	}
- 	*dbm = (qdbm & ~WL_TXPWR_OVERRIDE) / 4;
-@@ -2163,7 +2186,7 @@ brcmf_cfg80211_config_default_key(struct
- 
- 	err = brcmf_fil_bsscfg_int_get(ifp, "wsec", &wsec);
- 	if (err) {
--		brcmf_err("WLC_GET_WSEC error (%d)\n", err);
-+		bphy_err(wiphy, "WLC_GET_WSEC error (%d)\n", err);
- 		goto done;
- 	}
- 
-@@ -2173,7 +2196,7 @@ brcmf_cfg80211_config_default_key(struct
- 		err = brcmf_fil_cmd_int_set(ifp,
- 					    BRCMF_C_SET_KEY_PRIMARY, index);
- 		if (err)
--			brcmf_err("error (%d)\n", err);
-+			bphy_err(wiphy, "error (%d)\n", err);
- 	}
- done:
- 	brcmf_dbg(TRACE, "Exit\n");
-@@ -2237,7 +2260,7 @@ brcmf_cfg80211_add_key(struct wiphy *wip
- 
- 	if (key_idx >= BRCMF_MAX_DEFAULT_KEYS) {
- 		/* we ignore this key index in this case */
--		brcmf_err("invalid key index (%d)\n", key_idx);
-+		bphy_err(wiphy, "invalid key index (%d)\n", key_idx);
- 		return -EINVAL;
- 	}
- 
-@@ -2246,7 +2269,7 @@ brcmf_cfg80211_add_key(struct wiphy *wip
- 					      mac_addr);
- 
- 	if (params->key_len > sizeof(key->data)) {
--		brcmf_err("Too long key length (%u)\n", params->key_len);
-+		bphy_err(wiphy, "Too long key length (%u)\n", params->key_len);
- 		return -EINVAL;
- 	}
- 
-@@ -2300,7 +2323,7 @@ brcmf_cfg80211_add_key(struct wiphy *wip
- 		brcmf_dbg(CONN, "WLAN_CIPHER_SUITE_CCMP\n");
- 		break;
- 	default:
--		brcmf_err("Invalid cipher (0x%x)\n", params->cipher);
-+		bphy_err(wiphy, "Invalid cipher (0x%x)\n", params->cipher);
- 		err = -EINVAL;
- 		goto done;
- 	}
-@@ -2311,13 +2334,13 @@ brcmf_cfg80211_add_key(struct wiphy *wip
- 
- 	err = brcmf_fil_bsscfg_int_get(ifp, "wsec", &wsec);
- 	if (err) {
--		brcmf_err("get wsec error (%d)\n", err);
-+		bphy_err(wiphy, "get wsec error (%d)\n", err);
- 		goto done;
- 	}
- 	wsec |= val;
- 	err = brcmf_fil_bsscfg_int_set(ifp, "wsec", wsec);
- 	if (err) {
--		brcmf_err("set wsec error (%d)\n", err);
-+		bphy_err(wiphy, "set wsec error (%d)\n", err);
- 		goto done;
- 	}
- 
-@@ -2348,7 +2371,7 @@ brcmf_cfg80211_get_key(struct wiphy *wip
- 
- 	err = brcmf_fil_bsscfg_int_get(ifp, "wsec", &wsec);
- 	if (err) {
--		brcmf_err("WLC_GET_WSEC error (%d)\n", err);
-+		bphy_err(wiphy, "WLC_GET_WSEC error (%d)\n", err);
- 		/* Ignore this error, may happen during DISASSOC */
- 		err = -EAGAIN;
- 		goto done;
-@@ -2369,7 +2392,7 @@ brcmf_cfg80211_get_key(struct wiphy *wip
- 		params.cipher = WLAN_CIPHER_SUITE_AES_CMAC;
- 		brcmf_dbg(CONN, "WLAN_CIPHER_SUITE_AES_CMAC\n");
- 	} else  {
--		brcmf_err("Invalid algo (0x%x)\n", wsec);
-+		bphy_err(wiphy, "Invalid algo (0x%x)\n", wsec);
- 		err = -EINVAL;
- 		goto done;
- 	}
-@@ -2399,6 +2422,7 @@ brcmf_cfg80211_config_default_mgmt_key(s
- static void
- brcmf_cfg80211_reconfigure_wep(struct brcmf_if *ifp)
- {
-+	struct wiphy *wiphy = ifp->drvr->wiphy;
- 	s32 err;
- 	u8 key_idx;
- 	struct brcmf_wsec_key *key;
-@@ -2415,18 +2439,18 @@ brcmf_cfg80211_reconfigure_wep(struct br
- 
- 	err = send_key_to_dongle(ifp, key);
- 	if (err) {
--		brcmf_err("Setting WEP key failed (%d)\n", err);
-+		bphy_err(wiphy, "Setting WEP key failed (%d)\n", err);
- 		return;
- 	}
- 	err = brcmf_fil_bsscfg_int_get(ifp, "wsec", &wsec);
- 	if (err) {
--		brcmf_err("get wsec error (%d)\n", err);
-+		bphy_err(wiphy, "get wsec error (%d)\n", err);
- 		return;
- 	}
- 	wsec |= WEP_ENABLED;
- 	err = brcmf_fil_bsscfg_int_set(ifp, "wsec", wsec);
- 	if (err)
--		brcmf_err("set wsec error (%d)\n", err);
-+		bphy_err(wiphy, "set wsec error (%d)\n", err);
- }
- 
- static void brcmf_convert_sta_flags(u32 fw_sta_flags, struct station_info *si)
-@@ -2452,6 +2476,7 @@ static void brcmf_convert_sta_flags(u32
- 
- static void brcmf_fill_bss_param(struct brcmf_if *ifp, struct station_info *si)
- {
-+	struct wiphy *wiphy = ifp->drvr->wiphy;
- 	struct {
- 		__le32 len;
- 		struct brcmf_bss_info_le bss_le;
-@@ -2467,7 +2492,7 @@ static void brcmf_fill_bss_param(struct
- 	err = brcmf_fil_cmd_data_get(ifp, BRCMF_C_GET_BSS_INFO, buf,
- 				     WL_BSS_INFO_MAX);
- 	if (err) {
--		brcmf_err("Failed to get bss info (%d)\n", err);
-+		bphy_err(wiphy, "Failed to get bss info (%d)\n", err);
- 		goto out_kfree;
- 	}
- 	si->filled |= BIT_ULL(NL80211_STA_INFO_BSS_PARAM);
-@@ -2489,6 +2514,7 @@ static s32
- brcmf_cfg80211_get_station_ibss(struct brcmf_if *ifp,
- 				struct station_info *sinfo)
- {
-+	struct wiphy *wiphy = ifp->drvr->wiphy;
- 	struct brcmf_scb_val_le scbval;
- 	struct brcmf_pktcnt_le pktcnt;
- 	s32 err;
-@@ -2498,7 +2524,7 @@ brcmf_cfg80211_get_station_ibss(struct b
- 	/* Get the current tx rate */
- 	err = brcmf_fil_cmd_int_get(ifp, BRCMF_C_GET_RATE, &rate);
- 	if (err < 0) {
--		brcmf_err("BRCMF_C_GET_RATE error (%d)\n", err);
-+		bphy_err(wiphy, "BRCMF_C_GET_RATE error (%d)\n", err);
- 		return err;
- 	}
- 	sinfo->filled |= BIT_ULL(NL80211_STA_INFO_TX_BITRATE);
-@@ -2508,7 +2534,7 @@ brcmf_cfg80211_get_station_ibss(struct b
- 	err = brcmf_fil_cmd_data_get(ifp, BRCMF_C_GET_RSSI, &scbval,
- 				     sizeof(scbval));
- 	if (err) {
--		brcmf_err("BRCMF_C_GET_RSSI error (%d)\n", err);
-+		bphy_err(wiphy, "BRCMF_C_GET_RSSI error (%d)\n", err);
- 		return err;
- 	}
- 	rssi = le32_to_cpu(scbval.val);
-@@ -2518,7 +2544,7 @@ brcmf_cfg80211_get_station_ibss(struct b
- 	err = brcmf_fil_cmd_data_get(ifp, BRCMF_C_GET_GET_PKTCNTS, &pktcnt,
- 				     sizeof(pktcnt));
- 	if (err) {
--		brcmf_err("BRCMF_C_GET_GET_PKTCNTS error (%d)\n", err);
-+		bphy_err(wiphy, "BRCMF_C_GET_GET_PKTCNTS error (%d)\n", err);
- 		return err;
- 	}
- 	sinfo->filled |= BIT_ULL(NL80211_STA_INFO_RX_PACKETS) |
-@@ -2566,7 +2592,7 @@ brcmf_cfg80211_get_station(struct wiphy
- 					       &sta_info_le,
- 					       sizeof(sta_info_le));
- 		if (err < 0) {
--			brcmf_err("GET STA INFO failed, %d\n", err);
-+			bphy_err(wiphy, "GET STA INFO failed, %d\n", err);
- 			goto done;
- 		}
- 	}
-@@ -2635,7 +2661,8 @@ brcmf_cfg80211_get_station(struct wiphy
- 			err = brcmf_fil_cmd_data_get(ifp, BRCMF_C_GET_RSSI,
- 						     &scb_val, sizeof(scb_val));
- 			if (err) {
--				brcmf_err("Could not get rssi (%d)\n", err);
-+				bphy_err(wiphy, "Could not get rssi (%d)\n",
-+					 err);
- 				goto done;
- 			} else {
- 				rssi = le32_to_cpu(scb_val.val);
-@@ -2666,8 +2693,8 @@ brcmf_cfg80211_dump_station(struct wiphy
- 					     &cfg->assoclist,
- 					     sizeof(cfg->assoclist));
- 		if (err) {
--			brcmf_err("BRCMF_C_GET_ASSOCLIST unsupported, err=%d\n",
--				  err);
-+			bphy_err(wiphy, "BRCMF_C_GET_ASSOCLIST unsupported, err=%d\n",
-+				 err);
- 			cfg->assoclist.count = 0;
- 			return -EOPNOTSUPP;
- 		}
-@@ -2715,9 +2742,9 @@ brcmf_cfg80211_set_power_mgmt(struct wip
- 	err = brcmf_fil_cmd_int_set(ifp, BRCMF_C_SET_PM, pm);
- 	if (err) {
- 		if (err == -ENODEV)
--			brcmf_err("net_device is not ready yet\n");
-+			bphy_err(wiphy, "net_device is not ready yet\n");
- 		else
--			brcmf_err("error (%d)\n", err);
-+			bphy_err(wiphy, "error (%d)\n", err);
- 	}
- done:
- 	brcmf_dbg(TRACE, "Exit\n");
-@@ -2740,7 +2767,7 @@ static s32 brcmf_inform_single_bss(struc
- 	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");
-+		bphy_err(wiphy, "Bss info is larger than buffer. Discarding\n");
- 		return 0;
- 	}
- 
-@@ -2799,6 +2826,7 @@ next_bss_le(struct brcmf_scan_results *l
- 
- static s32 brcmf_inform_bss(struct brcmf_cfg80211_info *cfg)
- {
-+	struct wiphy *wiphy = cfg_to_wiphy(cfg);
- 	struct brcmf_scan_results *bss_list;
- 	struct brcmf_bss_info_le *bi = NULL;	/* must be initialized */
- 	s32 err = 0;
-@@ -2807,8 +2835,8 @@ static s32 brcmf_inform_bss(struct brcmf
- 	bss_list = (struct brcmf_scan_results *)cfg->escan_info.escan_buf;
- 	if (bss_list->count != 0 &&
- 	    bss_list->version != BRCMF_BSS_INFO_VERSION) {
--		brcmf_err("Version %d != WL_BSS_INFO_VERSION\n",
--			  bss_list->version);
-+		bphy_err(wiphy, "Version %d != WL_BSS_INFO_VERSION\n",
-+			 bss_list->version);
- 		return -EOPNOTSUPP;
- 	}
- 	brcmf_dbg(SCAN, "scanned AP count (%d)\n", bss_list->count);
-@@ -2852,7 +2880,7 @@ static s32 brcmf_inform_ibss(struct brcm
- 	err = brcmf_fil_cmd_data_get(netdev_priv(ndev), BRCMF_C_GET_BSS_INFO,
- 				     buf, WL_BSS_INFO_MAX);
- 	if (err) {
--		brcmf_err("WLC_GET_BSS_INFO failed: %d\n", err);
-+		bphy_err(wiphy, "WLC_GET_BSS_INFO failed: %d\n", err);
- 		goto CleanUp;
- 	}
- 
-@@ -2906,6 +2934,7 @@ CleanUp:
- static s32 brcmf_update_bss_info(struct brcmf_cfg80211_info *cfg,
- 				 struct brcmf_if *ifp)
- {
-+	struct wiphy *wiphy = cfg_to_wiphy(cfg);
- 	struct brcmf_bss_info_le *bi;
- 	const struct brcmf_tlv *tim;
- 	u16 beacon_interval;
-@@ -2922,7 +2951,7 @@ static s32 brcmf_update_bss_info(struct
- 	err = brcmf_fil_cmd_data_get(ifp, BRCMF_C_GET_BSS_INFO,
- 				     cfg->extra_buf, WL_EXTRA_BUF_MAX);
- 	if (err) {
--		brcmf_err("Could not get bss info %d\n", err);
-+		bphy_err(wiphy, "Could not get bss info %d\n", err);
- 		goto update_bss_info_out;
- 	}
- 
-@@ -2947,7 +2976,7 @@ static s32 brcmf_update_bss_info(struct
- 		u32 var;
- 		err = brcmf_fil_iovar_int_get(ifp, "dtim_assoc", &var);
- 		if (err) {
--			brcmf_err("wl dtim_assoc failed (%d)\n", err);
-+			bphy_err(wiphy, "wl dtim_assoc failed (%d)\n", err);
- 			goto update_bss_info_out;
- 		}
- 		dtim_period = (u8)var;
-@@ -2985,9 +3014,10 @@ static void brcmf_escan_timeout(struct t
- {
- 	struct brcmf_cfg80211_info *cfg =
- 			from_timer(cfg, t, escan_timeout);
-+	struct wiphy *wiphy = cfg_to_wiphy(cfg);
- 
- 	if (cfg->int_escan_map || cfg->scan_request) {
--		brcmf_err("timer expired\n");
-+		bphy_err(wiphy, "timer expired\n");
- 		schedule_work(&cfg->escan_timeout_work);
- 	}
- }
-@@ -3036,6 +3066,7 @@ brcmf_cfg80211_escan_handler(struct brcm
- 			     const struct brcmf_event_msg *e, void *data)
- {
- 	struct brcmf_cfg80211_info *cfg = ifp->drvr->config;
-+	struct wiphy *wiphy = cfg_to_wiphy(cfg);
- 	s32 status;
- 	struct brcmf_escan_result_le *escan_result_le;
- 	u32 escan_buflen;
-@@ -3052,32 +3083,33 @@ brcmf_cfg80211_escan_handler(struct brcm
- 		goto exit;
- 
- 	if (!test_bit(BRCMF_SCAN_STATUS_BUSY, &cfg->scan_status)) {
--		brcmf_err("scan not ready, bsscfgidx=%d\n", ifp->bsscfgidx);
-+		bphy_err(wiphy, "scan not ready, bsscfgidx=%d\n",
-+			 ifp->bsscfgidx);
- 		return -EPERM;
- 	}
- 
- 	if (status == BRCMF_E_STATUS_PARTIAL) {
- 		brcmf_dbg(SCAN, "ESCAN Partial result\n");
- 		if (e->datalen < sizeof(*escan_result_le)) {
--			brcmf_err("invalid event data length\n");
-+			bphy_err(wiphy, "invalid event data length\n");
- 			goto exit;
- 		}
- 		escan_result_le = (struct brcmf_escan_result_le *) data;
- 		if (!escan_result_le) {
--			brcmf_err("Invalid escan result (NULL pointer)\n");
-+			bphy_err(wiphy, "Invalid escan result (NULL pointer)\n");
- 			goto exit;
- 		}
- 		escan_buflen = le32_to_cpu(escan_result_le->buflen);
- 		if (escan_buflen > BRCMF_ESCAN_BUF_SIZE ||
- 		    escan_buflen > e->datalen ||
- 		    escan_buflen < sizeof(*escan_result_le)) {
--			brcmf_err("Invalid escan buffer length: %d\n",
--				  escan_buflen);
-+			bphy_err(wiphy, "Invalid escan buffer length: %d\n",
-+				 escan_buflen);
- 			goto exit;
- 		}
- 		if (le16_to_cpu(escan_result_le->bss_count) != 1) {
--			brcmf_err("Invalid bss_count %d: ignoring\n",
--				  escan_result_le->bss_count);
-+			bphy_err(wiphy, "Invalid bss_count %d: ignoring\n",
-+				 escan_result_le->bss_count);
- 			goto exit;
- 		}
- 		bss_info_le = &escan_result_le->bss_info_le;
-@@ -3092,8 +3124,8 @@ brcmf_cfg80211_escan_handler(struct brcm
- 
- 		bi_length = le32_to_cpu(bss_info_le->length);
- 		if (bi_length != escan_buflen -	WL_ESCAN_RESULTS_FIXED_SIZE) {
--			brcmf_err("Ignoring invalid bss_info length: %d\n",
--				  bi_length);
-+			bphy_err(wiphy, "Ignoring invalid bss_info length: %d\n",
-+				 bi_length);
- 			goto exit;
- 		}
- 
-@@ -3101,7 +3133,7 @@ brcmf_cfg80211_escan_handler(struct brcm
- 					BIT(NL80211_IFTYPE_ADHOC))) {
- 			if (le16_to_cpu(bss_info_le->capability) &
- 						WLAN_CAPABILITY_IBSS) {
--				brcmf_err("Ignoring IBSS result\n");
-+				bphy_err(wiphy, "Ignoring IBSS result\n");
- 				goto exit;
- 			}
- 		}
-@@ -3109,7 +3141,7 @@ brcmf_cfg80211_escan_handler(struct brcm
- 		list = (struct brcmf_scan_results *)
- 				cfg->escan_info.escan_buf;
- 		if (bi_length > BRCMF_ESCAN_BUF_SIZE - list->buflen) {
--			brcmf_err("Buffer is too small: ignoring\n");
-+			bphy_err(wiphy, "Buffer is too small: ignoring\n");
- 			goto exit;
- 		}
- 
-@@ -3301,14 +3333,14 @@ brcmf_notify_sched_scan_results(struct b
- 	WARN_ON(status != BRCMF_PNO_SCAN_COMPLETE);
- 	brcmf_dbg(SCAN, "PFN NET FOUND event. count: %d\n", result_count);
- 	if (!result_count) {
--		brcmf_err("FALSE PNO Event. (pfn_count == 0)\n");
-+		bphy_err(wiphy, "FALSE PNO Event. (pfn_count == 0)\n");
- 		goto out_err;
- 	}
- 
- 	netinfo_start = brcmf_get_netinfo_array(pfn_result);
- 	datalen = e->datalen - ((void *)netinfo_start - (void *)pfn_result);
- 	if (datalen < result_count * sizeof(*netinfo)) {
--		brcmf_err("insufficient event data\n");
-+		bphy_err(wiphy, "insufficient event data\n");
- 		goto out_err;
- 	}
- 
-@@ -3362,8 +3394,8 @@ brcmf_cfg80211_sched_scan_start(struct w
- 		  req->n_match_sets, req->n_ssids);
- 
- 	if (test_bit(BRCMF_SCAN_STATUS_SUPPRESS, &cfg->scan_status)) {
--		brcmf_err("Scanning suppressed: status=%lu\n",
--			  cfg->scan_status);
-+		bphy_err(wiphy, "Scanning suppressed: status=%lu\n",
-+			 cfg->scan_status);
- 		return -EAGAIN;
- 	}
- 
-@@ -3442,6 +3474,7 @@ brcmf_wowl_nd_results(struct brcmf_if *i
- 		      void *data)
- {
- 	struct brcmf_cfg80211_info *cfg = ifp->drvr->config;
-+	struct wiphy *wiphy = cfg_to_wiphy(cfg);
- 	struct brcmf_pno_scanresults_le *pfn_result;
- 	struct brcmf_pno_net_info_le *netinfo;
- 
-@@ -3460,8 +3493,8 @@ brcmf_wowl_nd_results(struct brcmf_if *i
- 	}
- 
- 	if (le32_to_cpu(pfn_result->count) < 1) {
--		brcmf_err("Invalid result count, expected 1 (%d)\n",
--			  le32_to_cpu(pfn_result->count));
-+		bphy_err(wiphy, "Invalid result count, expected 1 (%d)\n",
-+			 le32_to_cpu(pfn_result->count));
- 		return -EINVAL;
- 	}
- 
-@@ -3498,7 +3531,7 @@ static void brcmf_report_wowl_wakeind(st
- 	err = brcmf_fil_iovar_data_get(ifp, "wowl_wakeind", &wake_ind_le,
- 				       sizeof(wake_ind_le));
- 	if (err) {
--		brcmf_err("Get wowl_wakeind failed, err = %d\n", err);
-+		bphy_err(wiphy, "Get wowl_wakeind failed, err = %d\n", err);
- 		return;
- 	}
- 
-@@ -3539,7 +3572,7 @@ static void brcmf_report_wowl_wakeind(st
- 				cfg->wowl.nd_data_completed,
- 				BRCMF_ND_INFO_TIMEOUT);
- 			if (!timeout)
--				brcmf_err("No result for wowl net detect\n");
-+				bphy_err(wiphy, "No result for wowl net detect\n");
- 			else
- 				wakeup_data.net_detect = cfg->wowl.nd_info;
- 		}
-@@ -3747,7 +3780,7 @@ brcmf_cfg80211_set_pmksa(struct wiphy *w
- 			cfg->pmk_list.npmk = cpu_to_le32(npmk);
- 		}
- 	} else {
--		brcmf_err("Too many PMKSA entries cached %d\n", npmk);
-+		bphy_err(wiphy, "Too many PMKSA entries cached %d\n", npmk);
- 		return -EINVAL;
- 	}
- 
-@@ -3793,7 +3826,7 @@ brcmf_cfg80211_del_pmksa(struct wiphy *w
- 		memset(&pmk[i], 0, sizeof(*pmk));
- 		cfg->pmk_list.npmk = cpu_to_le32(npmk - 1);
- 	} else {
--		brcmf_err("Cache entry not found\n");
-+		bphy_err(wiphy, "Cache entry not found\n");
- 		return -EINVAL;
- 	}
- 
-@@ -3825,19 +3858,20 @@ brcmf_cfg80211_flush_pmksa(struct wiphy
- 
- static s32 brcmf_configure_opensecurity(struct brcmf_if *ifp)
- {
-+	struct wiphy *wiphy = ifp->drvr->wiphy;
- 	s32 err;
- 	s32 wpa_val;
- 
- 	/* set auth */
- 	err = brcmf_fil_bsscfg_int_set(ifp, "auth", 0);
- 	if (err < 0) {
--		brcmf_err("auth error %d\n", err);
-+		bphy_err(wiphy, "auth error %d\n", err);
- 		return err;
- 	}
- 	/* set wsec */
- 	err = brcmf_fil_bsscfg_int_set(ifp, "wsec", 0);
- 	if (err < 0) {
--		brcmf_err("wsec error %d\n", err);
-+		bphy_err(wiphy, "wsec error %d\n", err);
- 		return err;
- 	}
- 	/* set upper-layer auth */
-@@ -3847,7 +3881,7 @@ static s32 brcmf_configure_opensecurity(
- 		wpa_val = WPA_AUTH_DISABLED;
- 	err = brcmf_fil_bsscfg_int_set(ifp, "wpa_auth", wpa_val);
- 	if (err < 0) {
--		brcmf_err("wpa_auth error %d\n", err);
-+		bphy_err(wiphy, "wpa_auth error %d\n", err);
- 		return err;
- 	}
- 
-@@ -3867,6 +3901,7 @@ brcmf_configure_wpaie(struct brcmf_if *i
- 		      const struct brcmf_vs_tlv *wpa_ie,
- 		      bool is_rsn_ie)
- {
-+	struct wiphy *wiphy = ifp->drvr->wiphy;
- 	u32 auth = 0; /* d11 open authentication */
- 	u16 count;
- 	s32 err = 0;
-@@ -3897,13 +3932,13 @@ brcmf_configure_wpaie(struct brcmf_if *i
- 	/* check for multicast cipher suite */
- 	if (offset + WPA_IE_MIN_OUI_LEN > len) {
- 		err = -EINVAL;
--		brcmf_err("no multicast cipher suite\n");
-+		bphy_err(wiphy, "no multicast cipher suite\n");
- 		goto exit;
- 	}
- 
- 	if (!brcmf_valid_wpa_oui(&data[offset], is_rsn_ie)) {
- 		err = -EINVAL;
--		brcmf_err("ivalid OUI\n");
-+		bphy_err(wiphy, "ivalid OUI\n");
- 		goto exit;
- 	}
- 	offset += TLV_OUI_LEN;
-@@ -3925,7 +3960,7 @@ brcmf_configure_wpaie(struct brcmf_if *i
- 		break;
- 	default:
- 		err = -EINVAL;
--		brcmf_err("Invalid multi cast cipher info\n");
-+		bphy_err(wiphy, "Invalid multi cast cipher info\n");
- 		goto exit;
- 	}
- 
-@@ -3936,13 +3971,13 @@ brcmf_configure_wpaie(struct brcmf_if *i
- 	/* Check for unicast suite(s) */
- 	if (offset + (WPA_IE_MIN_OUI_LEN * count) > len) {
- 		err = -EINVAL;
--		brcmf_err("no unicast cipher suite\n");
-+		bphy_err(wiphy, "no unicast cipher suite\n");
- 		goto exit;
- 	}
- 	for (i = 0; i < count; i++) {
- 		if (!brcmf_valid_wpa_oui(&data[offset], is_rsn_ie)) {
- 			err = -EINVAL;
--			brcmf_err("ivalid OUI\n");
-+			bphy_err(wiphy, "ivalid OUI\n");
- 			goto exit;
- 		}
- 		offset += TLV_OUI_LEN;
-@@ -3960,7 +3995,7 @@ brcmf_configure_wpaie(struct brcmf_if *i
- 			pval |= AES_ENABLED;
- 			break;
- 		default:
--			brcmf_err("Invalid unicast security info\n");
-+			bphy_err(wiphy, "Invalid unicast security info\n");
- 		}
- 		offset++;
- 	}
-@@ -3970,13 +4005,13 @@ brcmf_configure_wpaie(struct brcmf_if *i
- 	/* Check for auth key management suite(s) */
- 	if (offset + (WPA_IE_MIN_OUI_LEN * count) > len) {
- 		err = -EINVAL;
--		brcmf_err("no auth key mgmt suite\n");
-+		bphy_err(wiphy, "no auth key mgmt suite\n");
- 		goto exit;
- 	}
- 	for (i = 0; i < count; i++) {
- 		if (!brcmf_valid_wpa_oui(&data[offset], is_rsn_ie)) {
- 			err = -EINVAL;
--			brcmf_err("ivalid OUI\n");
-+			bphy_err(wiphy, "ivalid OUI\n");
- 			goto exit;
- 		}
- 		offset += TLV_OUI_LEN;
-@@ -4004,7 +4039,7 @@ brcmf_configure_wpaie(struct brcmf_if *i
- 			wpa_auth |= WPA2_AUTH_1X_SHA256;
- 			break;
- 		default:
--			brcmf_err("Invalid key mgmt info\n");
-+			bphy_err(wiphy, "Invalid key mgmt info\n");
- 		}
- 		offset++;
- 	}
-@@ -4046,7 +4081,7 @@ brcmf_configure_wpaie(struct brcmf_if *i
- 		err = brcmf_fil_bsscfg_int_set(ifp, "wme_bss_disable",
- 					       wme_bss_disable);
- 		if (err < 0) {
--			brcmf_err("wme_bss_disable error %d\n", err);
-+			bphy_err(wiphy, "wme_bss_disable error %d\n", err);
- 			goto exit;
- 		}
- 
-@@ -4060,7 +4095,7 @@ brcmf_configure_wpaie(struct brcmf_if *i
- 							&data[offset],
- 							WPA_IE_MIN_OUI_LEN);
- 			if (err < 0) {
--				brcmf_err("bip error %d\n", err);
-+				bphy_err(wiphy, "bip error %d\n", err);
- 				goto exit;
- 			}
- 		}
-@@ -4071,13 +4106,13 @@ brcmf_configure_wpaie(struct brcmf_if *i
- 	/* set auth */
- 	err = brcmf_fil_bsscfg_int_set(ifp, "auth", auth);
- 	if (err < 0) {
--		brcmf_err("auth error %d\n", err);
-+		bphy_err(wiphy, "auth error %d\n", err);
- 		goto exit;
- 	}
- 	/* set wsec */
- 	err = brcmf_fil_bsscfg_int_set(ifp, "wsec", wsec);
- 	if (err < 0) {
--		brcmf_err("wsec error %d\n", err);
-+		bphy_err(wiphy, "wsec error %d\n", err);
- 		goto exit;
- 	}
- 	/* Configure MFP, this needs to go after wsec otherwise the wsec command
-@@ -4086,14 +4121,14 @@ brcmf_configure_wpaie(struct brcmf_if *i
- 	if (brcmf_feat_is_enabled(ifp, BRCMF_FEAT_MFP)) {
- 		err = brcmf_fil_bsscfg_int_set(ifp, "mfp", mfp);
- 		if (err < 0) {
--			brcmf_err("mfp error %d\n", err);
-+			bphy_err(wiphy, "mfp error %d\n", err);
- 			goto exit;
- 		}
- 	}
- 	/* set upper-layer auth */
- 	err = brcmf_fil_bsscfg_int_set(ifp, "wpa_auth", wpa_auth);
- 	if (err < 0) {
--		brcmf_err("wpa_auth error %d\n", err);
-+		bphy_err(wiphy, "wpa_auth error %d\n", err);
- 		goto exit;
- 	}
- 
-@@ -4180,6 +4215,7 @@ s32 brcmf_vif_set_mgmt_ie(struct brcmf_c
- 			  const u8 *vndr_ie_buf, u32 vndr_ie_len)
- {
- 	struct brcmf_if *ifp;
-+	struct wiphy *wiphy;
- 	struct vif_saved_ie *saved_ie;
- 	s32 err = 0;
- 	u8  *iovar_ie_buf;
-@@ -4200,6 +4236,7 @@ s32 brcmf_vif_set_mgmt_ie(struct brcmf_c
- 	if (!vif)
- 		return -ENODEV;
- 	ifp = vif->ifp;
-+	wiphy = ifp->drvr->wiphy;
- 	saved_ie = &vif->saved_ie;
- 
- 	brcmf_dbg(TRACE, "bsscfgidx %d, pktflag : 0x%02X\n", ifp->bsscfgidx,
-@@ -4231,13 +4268,13 @@ s32 brcmf_vif_set_mgmt_ie(struct brcmf_c
- 		break;
- 	default:
- 		err = -EPERM;
--		brcmf_err("not suitable type\n");
-+		bphy_err(wiphy, "not suitable type\n");
- 		goto exit;
- 	}
- 
- 	if (vndr_ie_len > mgmt_ie_buf_len) {
- 		err = -ENOMEM;
--		brcmf_err("extra IE size too big\n");
-+		bphy_err(wiphy, "extra IE size too big\n");
- 		goto exit;
- 	}
- 
-@@ -4298,8 +4335,8 @@ s32 brcmf_vif_set_mgmt_ie(struct brcmf_c
- 			/* verify remained buf size before copy data */
- 			if (remained_buf_len < (vndrie_info->vndrie.len +
- 							VNDR_IE_VSIE_OFFSET)) {
--				brcmf_err("no space in mgmt_ie_buf: len left %d",
--					  remained_buf_len);
-+				bphy_err(wiphy, "no space in mgmt_ie_buf: len left %d",
-+					 remained_buf_len);
- 				break;
- 			}
- 			remained_buf_len -= (vndrie_info->ie_len +
-@@ -4330,7 +4367,7 @@ s32 brcmf_vif_set_mgmt_ie(struct brcmf_c
- 		err  = brcmf_fil_bsscfg_data_set(ifp, "vndr_ie", iovar_ie_buf,
- 						 total_ie_buf_len);
- 		if (err)
--			brcmf_err("vndr ie set error : %d\n", err);
-+			bphy_err(wiphy, "vndr ie set error : %d\n", err);
- 	}
- 
- exit:
-@@ -4358,13 +4395,14 @@ static s32
- brcmf_config_ap_mgmt_ie(struct brcmf_cfg80211_vif *vif,
- 			struct cfg80211_beacon_data *beacon)
- {
-+	struct wiphy *wiphy = vif->ifp->drvr->wiphy;
- 	s32 err;
- 
- 	/* Set Beacon IEs to FW */
- 	err = brcmf_vif_set_mgmt_ie(vif, BRCMF_VNDR_IE_BEACON_FLAG,
- 				    beacon->tail, beacon->tail_len);
- 	if (err) {
--		brcmf_err("Set Beacon IE Failed\n");
-+		bphy_err(wiphy, "Set Beacon IE Failed\n");
- 		return err;
- 	}
- 	brcmf_dbg(TRACE, "Applied Vndr IEs for Beacon\n");
-@@ -4374,7 +4412,7 @@ brcmf_config_ap_mgmt_ie(struct brcmf_cfg
- 				    beacon->proberesp_ies,
- 				    beacon->proberesp_ies_len);
- 	if (err)
--		brcmf_err("Set Probe Resp IE Failed\n");
-+		bphy_err(wiphy, "Set Probe Resp IE Failed\n");
- 	else
- 		brcmf_dbg(TRACE, "Applied Vndr IEs for Probe Resp\n");
- 
-@@ -4483,7 +4521,8 @@ brcmf_cfg80211_start_ap(struct wiphy *wi
- 			err = brcmf_fil_cmd_int_set(ifp, BRCMF_C_SET_REGULATORY,
- 						    is_11d);
- 			if (err < 0) {
--				brcmf_err("Regulatory Set Error, %d\n", err);
-+				bphy_err(wiphy, "Regulatory Set Error, %d\n",
-+					 err);
- 				goto exit;
- 			}
- 		}
-@@ -4491,8 +4530,8 @@ brcmf_cfg80211_start_ap(struct wiphy *wi
- 			err = brcmf_fil_cmd_int_set(ifp, BRCMF_C_SET_BCNPRD,
- 						    settings->beacon_interval);
- 			if (err < 0) {
--				brcmf_err("Beacon Interval Set Error, %d\n",
--					  err);
-+				bphy_err(wiphy, "Beacon Interval Set Error, %d\n",
-+					 err);
- 				goto exit;
- 			}
- 		}
-@@ -4500,7 +4539,8 @@ brcmf_cfg80211_start_ap(struct wiphy *wi
- 			err = brcmf_fil_cmd_int_set(ifp, BRCMF_C_SET_DTIMPRD,
- 						    settings->dtim_period);
- 			if (err < 0) {
--				brcmf_err("DTIM Interval Set Error, %d\n", err);
-+				bphy_err(wiphy, "DTIM Interval Set Error, %d\n",
-+					 err);
- 				goto exit;
- 			}
- 		}
-@@ -4510,7 +4550,8 @@ brcmf_cfg80211_start_ap(struct wiphy *wi
- 		     !brcmf_feat_is_enabled(ifp, BRCMF_FEAT_RSDB))) {
- 			err = brcmf_fil_cmd_int_set(ifp, BRCMF_C_DOWN, 1);
- 			if (err < 0) {
--				brcmf_err("BRCMF_C_DOWN error %d\n", err);
-+				bphy_err(wiphy, "BRCMF_C_DOWN error %d\n",
-+					 err);
- 				goto exit;
- 			}
- 			brcmf_fil_iovar_int_set(ifp, "apsta", 0);
-@@ -4518,7 +4559,7 @@ brcmf_cfg80211_start_ap(struct wiphy *wi
- 
- 		err = brcmf_fil_cmd_int_set(ifp, BRCMF_C_SET_INFRA, 1);
- 		if (err < 0) {
--			brcmf_err("SET INFRA error %d\n", err);
-+			bphy_err(wiphy, "SET INFRA error %d\n", err);
- 			goto exit;
- 		}
- 	} else if (WARN_ON(supports_11d && (is_11d != ifp->vif->is_11d))) {
-@@ -4534,7 +4575,8 @@ brcmf_cfg80211_start_ap(struct wiphy *wi
- 
- 		err = brcmf_fil_cmd_int_set(ifp, BRCMF_C_SET_AP, 1);
- 		if (err < 0) {
--			brcmf_err("setting AP mode failed %d\n", err);
-+			bphy_err(wiphy, "setting AP mode failed %d\n",
-+				 err);
- 			goto exit;
- 		}
- 		if (!mbss) {
-@@ -4543,14 +4585,14 @@ brcmf_cfg80211_start_ap(struct wiphy *wi
- 			 */
- 			err = brcmf_fil_iovar_int_set(ifp, "chanspec", chanspec);
- 			if (err < 0) {
--				brcmf_err("Set Channel failed: chspec=%d, %d\n",
--					  chanspec, err);
-+				bphy_err(wiphy, "Set Channel failed: chspec=%d, %d\n",
-+					 chanspec, err);
- 				goto exit;
- 			}
- 		}
- 		err = brcmf_fil_cmd_int_set(ifp, BRCMF_C_UP, 1);
- 		if (err < 0) {
--			brcmf_err("BRCMF_C_UP error (%d)\n", err);
-+			bphy_err(wiphy, "BRCMF_C_UP error (%d)\n", err);
- 			goto exit;
- 		}
- 		/* On DOWN the firmware removes the WEP keys, reconfigure
-@@ -4565,14 +4607,14 @@ brcmf_cfg80211_start_ap(struct wiphy *wi
- 		err = brcmf_fil_cmd_data_set(ifp, BRCMF_C_SET_SSID,
- 					     &join_params, sizeof(join_params));
- 		if (err < 0) {
--			brcmf_err("SET SSID error (%d)\n", err);
-+			bphy_err(wiphy, "SET SSID error (%d)\n", err);
- 			goto exit;
- 		}
- 
- 		if (settings->hidden_ssid) {
- 			err = brcmf_fil_iovar_int_set(ifp, "closednet", 1);
- 			if (err) {
--				brcmf_err("closednet error (%d)\n", err);
-+				bphy_err(wiphy, "closednet error (%d)\n", err);
- 				goto exit;
- 			}
- 		}
-@@ -4581,14 +4623,14 @@ brcmf_cfg80211_start_ap(struct wiphy *wi
- 	} else if (dev_role == NL80211_IFTYPE_P2P_GO) {
- 		err = brcmf_fil_iovar_int_set(ifp, "chanspec", chanspec);
- 		if (err < 0) {
--			brcmf_err("Set Channel failed: chspec=%d, %d\n",
--				  chanspec, err);
-+			bphy_err(wiphy, "Set Channel failed: chspec=%d, %d\n",
-+				 chanspec, err);
- 			goto exit;
- 		}
- 		err = brcmf_fil_bsscfg_data_set(ifp, "ssid", &ssid_le,
- 						sizeof(ssid_le));
- 		if (err < 0) {
--			brcmf_err("setting ssid failed %d\n", err);
-+			bphy_err(wiphy, "setting ssid failed %d\n", err);
- 			goto exit;
- 		}
- 		bss_enable.bsscfgidx = cpu_to_le32(ifp->bsscfgidx);
-@@ -4596,7 +4638,7 @@ brcmf_cfg80211_start_ap(struct wiphy *wi
- 		err = brcmf_fil_iovar_data_set(ifp, "bss", &bss_enable,
- 					       sizeof(bss_enable));
- 		if (err < 0) {
--			brcmf_err("bss_enable config failed %d\n", err);
-+			bphy_err(wiphy, "bss_enable config failed %d\n", err);
- 			goto exit;
- 		}
- 
-@@ -4644,13 +4686,13 @@ static int brcmf_cfg80211_stop_ap(struct
- 		err = brcmf_fil_cmd_data_set(ifp, BRCMF_C_SET_SSID,
- 					     &join_params, sizeof(join_params));
- 		if (err < 0)
--			brcmf_err("SET SSID error (%d)\n", err);
-+			bphy_err(wiphy, "SET SSID error (%d)\n", err);
- 		err = brcmf_fil_cmd_int_set(ifp, BRCMF_C_DOWN, 1);
- 		if (err < 0)
--			brcmf_err("BRCMF_C_DOWN error %d\n", err);
-+			bphy_err(wiphy, "BRCMF_C_DOWN error %d\n", err);
- 		err = brcmf_fil_cmd_int_set(ifp, BRCMF_C_SET_AP, 0);
- 		if (err < 0)
--			brcmf_err("setting AP mode failed %d\n", err);
-+			bphy_err(wiphy, "setting AP mode failed %d\n", err);
- 		if (brcmf_feat_is_enabled(ifp, BRCMF_FEAT_MBSS))
- 			brcmf_fil_iovar_int_set(ifp, "mbss", 0);
- 		brcmf_fil_cmd_int_set(ifp, BRCMF_C_SET_REGULATORY,
-@@ -4658,7 +4700,7 @@ static int brcmf_cfg80211_stop_ap(struct
- 		/* Bring device back up so it can be used again */
- 		err = brcmf_fil_cmd_int_set(ifp, BRCMF_C_UP, 1);
- 		if (err < 0)
--			brcmf_err("BRCMF_C_UP error %d\n", err);
-+			bphy_err(wiphy, "BRCMF_C_UP error %d\n", err);
- 
- 		brcmf_vif_clear_mgmt_ies(ifp->vif);
- 	} else {
-@@ -4667,7 +4709,7 @@ static int brcmf_cfg80211_stop_ap(struct
- 		err = brcmf_fil_iovar_data_set(ifp, "bss", &bss_enable,
- 					       sizeof(bss_enable));
- 		if (err < 0)
--			brcmf_err("bss_enable config failed %d\n", err);
-+			bphy_err(wiphy, "bss_enable config failed %d\n", err);
- 	}
- 	brcmf_set_mpc(ifp, 1);
- 	brcmf_configure_arp_nd_offload(ifp, true);
-@@ -4715,7 +4757,8 @@ brcmf_cfg80211_del_station(struct wiphy
- 	err = brcmf_fil_cmd_data_set(ifp, BRCMF_C_SCB_DEAUTHENTICATE_FOR_REASON,
- 				     &scbval, sizeof(scbval));
- 	if (err)
--		brcmf_err("SCB_DEAUTHENTICATE_FOR_REASON failed %d\n", err);
-+		bphy_err(wiphy, "SCB_DEAUTHENTICATE_FOR_REASON failed %d\n",
-+			 err);
- 
- 	brcmf_dbg(TRACE, "Exit\n");
- 	return err;
-@@ -4745,7 +4788,7 @@ brcmf_cfg80211_change_station(struct wip
- 		err = brcmf_fil_cmd_data_set(ifp, BRCMF_C_SET_SCB_DEAUTHORIZE,
- 					     (void *)mac, ETH_ALEN);
- 	if (err < 0)
--		brcmf_err("Setting SCB (de-)authorize failed, %d\n", err);
-+		bphy_err(wiphy, "Setting SCB (de-)authorize failed, %d\n", err);
- 
- 	return err;
- }
-@@ -4795,7 +4838,7 @@ brcmf_cfg80211_mgmt_tx(struct wiphy *wip
- 	mgmt = (const struct ieee80211_mgmt *)buf;
- 
- 	if (!ieee80211_is_mgmt(mgmt->frame_control)) {
--		brcmf_err("Driver only allows MGMT packet type\n");
-+		bphy_err(wiphy, "Driver only allows MGMT packet type\n");
- 		return -EPERM;
- 	}
- 
-@@ -4826,13 +4869,13 @@ brcmf_cfg80211_mgmt_tx(struct wiphy *wip
- 					GFP_KERNEL);
- 	} else if (ieee80211_is_action(mgmt->frame_control)) {
- 		if (len > BRCMF_FIL_ACTION_FRAME_SIZE + DOT11_MGMT_HDR_LEN) {
--			brcmf_err("invalid action frame length\n");
-+			bphy_err(wiphy, "invalid action frame length\n");
- 			err = -EINVAL;
- 			goto exit;
- 		}
- 		af_params = kzalloc(sizeof(*af_params), GFP_KERNEL);
- 		if (af_params == NULL) {
--			brcmf_err("unable to allocate frame\n");
-+			bphy_err(wiphy, "unable to allocate frame\n");
- 			err = -ENOMEM;
- 			goto exit;
- 		}
-@@ -4890,7 +4933,7 @@ brcmf_cfg80211_cancel_remain_on_channel(
- 
- 	vif = cfg->p2p.bss_idx[P2PAPI_BSSCFG_DEVICE].vif;
- 	if (vif == NULL) {
--		brcmf_err("No p2p device available for probe response\n");
-+		bphy_err(wiphy, "No p2p device available for probe response\n");
- 		err = -ENODEV;
- 		goto exit;
- 	}
-@@ -4918,7 +4961,7 @@ static int brcmf_cfg80211_get_channel(st
- 
- 	err = brcmf_fil_iovar_int_get(ifp, "chanspec", &chanspec);
- 	if (err) {
--		brcmf_err("chanspec failed (%d)\n", err);
-+		bphy_err(wiphy, "chanspec failed (%d)\n", err);
- 		return err;
- 	}
- 
-@@ -5057,7 +5100,7 @@ static int brcmf_cfg80211_tdls_oper(stru
- 	ret = brcmf_fil_iovar_data_set(ifp, "tdls_endpoint",
- 				       &info, sizeof(info));
- 	if (ret < 0)
--		brcmf_err("tdls_endpoint iovar failed: ret=%d\n", ret);
-+		bphy_err(wiphy, "tdls_endpoint iovar failed: ret=%d\n", ret);
- 
- 	return ret;
- }
-@@ -5078,7 +5121,7 @@ brcmf_cfg80211_update_conn_params(struct
- 	err = brcmf_vif_set_mgmt_ie(ifp->vif, BRCMF_VNDR_IE_ASSOCREQ_FLAG,
- 				    sme->ie, sme->ie_len);
- 	if (err)
--		brcmf_err("Set Assoc REQ IE Failed\n");
-+		bphy_err(wiphy, "Set Assoc REQ IE Failed\n");
- 	else
- 		brcmf_dbg(TRACE, "Applied Vndr IEs for Assoc request\n");
- 
-@@ -5104,7 +5147,7 @@ brcmf_cfg80211_set_rekey_data(struct wip
- 	ret = brcmf_fil_iovar_data_set(ifp, "gtk_key_info", &gtk_le,
- 				       sizeof(gtk_le));
- 	if (ret < 0)
--		brcmf_err("gtk_key_info iovar failed: ret=%d\n", ret);
-+		bphy_err(wiphy, "gtk_key_info iovar failed: ret=%d\n", ret);
- 
- 	return ret;
- }
-@@ -5336,6 +5379,7 @@ static void brcmf_clear_assoc_ies(struct
- static s32 brcmf_get_assoc_ies(struct brcmf_cfg80211_info *cfg,
- 			       struct brcmf_if *ifp)
- {
-+	struct wiphy *wiphy = cfg_to_wiphy(cfg);
- 	struct brcmf_cfg80211_assoc_ielen_le *assoc_info;
- 	struct brcmf_cfg80211_connect_info *conn_info = cfg_to_conn(cfg);
- 	u32 req_len;
-@@ -5347,7 +5391,7 @@ static s32 brcmf_get_assoc_ies(struct br
- 	err = brcmf_fil_iovar_data_get(ifp, "assoc_info",
- 				       cfg->extra_buf, WL_ASSOC_INFO_MAX);
- 	if (err) {
--		brcmf_err("could not get assoc info (%d)\n", err);
-+		bphy_err(wiphy, "could not get assoc info (%d)\n", err);
- 		return err;
- 	}
- 	assoc_info =
-@@ -5359,7 +5403,7 @@ static s32 brcmf_get_assoc_ies(struct br
- 					       cfg->extra_buf,
- 					       WL_ASSOC_INFO_MAX);
- 		if (err) {
--			brcmf_err("could not get assoc req (%d)\n", err);
-+			bphy_err(wiphy, "could not get assoc req (%d)\n", err);
- 			return err;
- 		}
- 		conn_info->req_ie_len = req_len;
-@@ -5375,7 +5419,7 @@ static s32 brcmf_get_assoc_ies(struct br
- 					       cfg->extra_buf,
- 					       WL_ASSOC_INFO_MAX);
- 		if (err) {
--			brcmf_err("could not get assoc resp (%d)\n", err);
-+			bphy_err(wiphy, "could not get assoc resp (%d)\n", err);
- 			return err;
- 		}
- 		conn_info->resp_ie_len = resp_len;
-@@ -5502,6 +5546,7 @@ brcmf_notify_connect_status_ap(struct br
- 			       struct net_device *ndev,
- 			       const struct brcmf_event_msg *e, void *data)
- {
-+	struct wiphy *wiphy = cfg_to_wiphy(cfg);
- 	static int generation;
- 	u32 event = e->event_code;
- 	u32 reason = e->reason;
-@@ -5519,7 +5564,7 @@ brcmf_notify_connect_status_ap(struct br
- 	if (((event == BRCMF_E_ASSOC_IND) || (event == BRCMF_E_REASSOC_IND)) &&
- 	    (reason == BRCMF_E_STATUS_SUCCESS)) {
- 		if (!data) {
--			brcmf_err("No IEs present in ASSOC/REASSOC_IND");
-+			bphy_err(wiphy, "No IEs present in ASSOC/REASSOC_IND\n");
- 			return -EINVAL;
- 		}
- 
-@@ -5811,6 +5856,7 @@ static void init_vif_event(struct brcmf_
- 
- static s32 brcmf_dongle_roam(struct brcmf_if *ifp)
- {
-+	struct wiphy *wiphy = ifp->drvr->wiphy;
- 	s32 err;
- 	u32 bcn_timeout;
- 	__le32 roamtrigger[2];
-@@ -5823,7 +5869,7 @@ static s32 brcmf_dongle_roam(struct brcm
- 		bcn_timeout = BRCMF_DEFAULT_BCN_TIMEOUT_ROAM_ON;
- 	err = brcmf_fil_iovar_int_set(ifp, "bcn_timeout", bcn_timeout);
- 	if (err) {
--		brcmf_err("bcn_timeout error (%d)\n", err);
-+		bphy_err(wiphy, "bcn_timeout error (%d)\n", err);
- 		goto roam_setup_done;
- 	}
- 
-@@ -5835,7 +5881,7 @@ static s32 brcmf_dongle_roam(struct brcm
- 	err = brcmf_fil_iovar_int_set(ifp, "roam_off",
- 				      ifp->drvr->settings->roamoff);
- 	if (err) {
--		brcmf_err("roam_off error (%d)\n", err);
-+		bphy_err(wiphy, "roam_off error (%d)\n", err);
- 		goto roam_setup_done;
- 	}
- 
-@@ -5844,7 +5890,7 @@ static s32 brcmf_dongle_roam(struct brcm
- 	err = brcmf_fil_cmd_data_set(ifp, BRCMF_C_SET_ROAM_TRIGGER,
- 				     (void *)roamtrigger, sizeof(roamtrigger));
- 	if (err) {
--		brcmf_err("WLC_SET_ROAM_TRIGGER error (%d)\n", err);
-+		bphy_err(wiphy, "WLC_SET_ROAM_TRIGGER error (%d)\n", err);
- 		goto roam_setup_done;
- 	}
- 
-@@ -5853,7 +5899,7 @@ static s32 brcmf_dongle_roam(struct brcm
- 	err = brcmf_fil_cmd_data_set(ifp, BRCMF_C_SET_ROAM_DELTA,
- 				     (void *)roam_delta, sizeof(roam_delta));
- 	if (err) {
--		brcmf_err("WLC_SET_ROAM_DELTA error (%d)\n", err);
-+		bphy_err(wiphy, "WLC_SET_ROAM_DELTA error (%d)\n", err);
- 		goto roam_setup_done;
- 	}
- 
-@@ -5864,25 +5910,26 @@ roam_setup_done:
- static s32
- brcmf_dongle_scantime(struct brcmf_if *ifp)
- {
-+	struct wiphy *wiphy = ifp->drvr->wiphy;
- 	s32 err = 0;
- 
- 	err = brcmf_fil_cmd_int_set(ifp, BRCMF_C_SET_SCAN_CHANNEL_TIME,
- 				    BRCMF_SCAN_CHANNEL_TIME);
- 	if (err) {
--		brcmf_err("Scan assoc time error (%d)\n", err);
-+		bphy_err(wiphy, "Scan assoc time error (%d)\n", err);
- 		goto dongle_scantime_out;
- 	}
- 	err = brcmf_fil_cmd_int_set(ifp, BRCMF_C_SET_SCAN_UNASSOC_TIME,
- 				    BRCMF_SCAN_UNASSOC_TIME);
- 	if (err) {
--		brcmf_err("Scan unassoc time error (%d)\n", err);
-+		bphy_err(wiphy, "Scan unassoc time error (%d)\n", err);
- 		goto dongle_scantime_out;
- 	}
- 
- 	err = brcmf_fil_cmd_int_set(ifp, BRCMF_C_SET_SCAN_PASSIVE_TIME,
- 				    BRCMF_SCAN_PASSIVE_TIME);
- 	if (err) {
--		brcmf_err("Scan passive time error (%d)\n", err);
-+		bphy_err(wiphy, "Scan passive time error (%d)\n", err);
- 		goto dongle_scantime_out;
- 	}
- 
-@@ -5914,10 +5961,10 @@ static void brcmf_update_bw40_channel_fl
- static int brcmf_construct_chaninfo(struct brcmf_cfg80211_info *cfg,
- 				    u32 bw_cap[])
- {
-+	struct wiphy *wiphy = cfg_to_wiphy(cfg);
- 	struct brcmf_if *ifp = brcmf_get_ifp(cfg->pub, 0);
- 	struct ieee80211_supported_band *band;
- 	struct ieee80211_channel *channel;
--	struct wiphy *wiphy;
- 	struct brcmf_chanspec_list *list;
- 	struct brcmu_chan ch;
- 	int err;
-@@ -5936,11 +5983,10 @@ static int brcmf_construct_chaninfo(stru
- 	err = brcmf_fil_iovar_data_get(ifp, "chanspecs", pbuf,
- 				       BRCMF_DCMD_MEDLEN);
- 	if (err) {
--		brcmf_err("get chanspecs error (%d)\n", err);
-+		bphy_err(wiphy, "get chanspecs error (%d)\n", err);
- 		goto fail_pbuf;
- 	}
- 
--	wiphy = cfg_to_wiphy(cfg);
- 	band = wiphy->bands[NL80211_BAND_2GHZ];
- 	if (band)
- 		for (i = 0; i < band->n_channels; i++)
-@@ -5960,7 +6006,8 @@ static int brcmf_construct_chaninfo(stru
- 		} else if (ch.band == BRCMU_CHAN_BAND_5G) {
- 			band = wiphy->bands[NL80211_BAND_5GHZ];
- 		} else {
--			brcmf_err("Invalid channel Spec. 0x%x.\n", ch.chspec);
-+			bphy_err(wiphy, "Invalid channel Spec. 0x%x.\n",
-+				 ch.chspec);
- 			continue;
- 		}
- 		if (!band)
-@@ -5983,8 +6030,8 @@ static int brcmf_construct_chaninfo(stru
- 			/* It seems firmware supports some channel we never
- 			 * considered. Something new in IEEE standard?
- 			 */
--			brcmf_err("Ignoring unexpected firmware channel %d\n",
--				  ch.control_ch_num);
-+			bphy_err(wiphy, "Ignoring unexpected firmware channel %d\n",
-+				 ch.control_ch_num);
- 			continue;
- 		}
- 
-@@ -6030,6 +6077,7 @@ fail_pbuf:
- 
- static int brcmf_enable_bw40_2g(struct brcmf_cfg80211_info *cfg)
- {
-+	struct wiphy *wiphy = cfg_to_wiphy(cfg);
- 	struct brcmf_if *ifp = brcmf_get_ifp(cfg->pub, 0);
- 	struct ieee80211_supported_band *band;
- 	struct brcmf_fil_bwcap_le band_bwcap;
-@@ -6076,7 +6124,7 @@ static int brcmf_enable_bw40_2g(struct b
- 		err = brcmf_fil_iovar_data_get(ifp, "chanspecs", pbuf,
- 					       BRCMF_DCMD_MEDLEN);
- 		if (err) {
--			brcmf_err("get chanspecs error (%d)\n", err);
-+			bphy_err(wiphy, "get chanspecs error (%d)\n", err);
- 			kfree(pbuf);
- 			return err;
- 		}
-@@ -6107,6 +6155,7 @@ static int brcmf_enable_bw40_2g(struct b
- 
- static void brcmf_get_bwcap(struct brcmf_if *ifp, u32 bw_cap[])
- {
-+	struct wiphy *wiphy = ifp->drvr->wiphy;
- 	u32 band, mimo_bwcap;
- 	int err;
- 
-@@ -6142,7 +6191,7 @@ static void brcmf_get_bwcap(struct brcmf
- 		bw_cap[NL80211_BAND_5GHZ] |= WLC_BW_20MHZ_BIT;
- 		break;
- 	default:
--		brcmf_err("invalid mimo_bw_cap value\n");
-+		bphy_err(wiphy, "invalid mimo_bw_cap value\n");
- 	}
- }
- 
-@@ -6218,7 +6267,7 @@ static void brcmf_update_vht_cap(struct
- static int brcmf_setup_wiphybands(struct brcmf_cfg80211_info *cfg)
- {
- 	struct brcmf_if *ifp = brcmf_get_ifp(cfg->pub, 0);
--	struct wiphy *wiphy;
-+	struct wiphy *wiphy = cfg_to_wiphy(cfg);
- 	u32 nmode = 0;
- 	u32 vhtmode = 0;
- 	u32 bw_cap[2] = { WLC_BW_20MHZ_BIT, WLC_BW_20MHZ_BIT };
-@@ -6234,7 +6283,7 @@ static int brcmf_setup_wiphybands(struct
- 	(void)brcmf_fil_iovar_int_get(ifp, "vhtmode", &vhtmode);
- 	err = brcmf_fil_iovar_int_get(ifp, "nmode", &nmode);
- 	if (err) {
--		brcmf_err("nmode error (%d)\n", err);
-+		bphy_err(wiphy, "nmode error (%d)\n", err);
- 	} else {
- 		brcmf_get_bwcap(ifp, bw_cap);
- 	}
-@@ -6244,7 +6293,7 @@ static int brcmf_setup_wiphybands(struct
- 
- 	err = brcmf_fil_iovar_int_get(ifp, "rxchain", &rxchain);
- 	if (err) {
--		brcmf_err("rxchain error (%d)\n", err);
-+		bphy_err(wiphy, "rxchain error (%d)\n", err);
- 		nchain = 1;
- 	} else {
- 		for (nchain = 0; rxchain; nchain++)
-@@ -6254,7 +6303,7 @@ static int brcmf_setup_wiphybands(struct
- 
- 	err = brcmf_construct_chaninfo(cfg, bw_cap);
- 	if (err) {
--		brcmf_err("brcmf_construct_chaninfo failed (%d)\n", err);
-+		bphy_err(wiphy, "brcmf_construct_chaninfo failed (%d)\n", err);
- 		return err;
- 	}
- 
-@@ -6266,7 +6315,6 @@ static int brcmf_setup_wiphybands(struct
- 					      &txbf_bfr_cap);
- 	}
- 
--	wiphy = cfg_to_wiphy(cfg);
- 	for (i = 0; i < ARRAY_SIZE(wiphy->bands); i++) {
- 		band = wiphy->bands[i];
- 		if (band == NULL)
-@@ -6467,7 +6515,7 @@ static void brcmf_wiphy_wowl_params(stru
- 	wowl = kmemdup(&brcmf_wowlan_support, sizeof(brcmf_wowlan_support),
- 		       GFP_KERNEL);
- 	if (!wowl) {
--		brcmf_err("only support basic wowlan features\n");
-+		bphy_err(wiphy, "only support basic wowlan features\n");
- 		wiphy->wowlan = &brcmf_wowlan_support;
- 		return;
- 	}
-@@ -6564,7 +6612,7 @@ static int brcmf_setup_wiphy(struct wiph
- 	err = brcmf_fil_cmd_data_get(ifp, BRCMF_C_GET_BANDLIST, &bandlist,
- 				     sizeof(bandlist));
- 	if (err) {
--		brcmf_err("could not obtain band info: err=%d\n", err);
-+		bphy_err(wiphy, "could not obtain band info: err=%d\n", err);
- 		return err;
- 	}
- 	/* first entry in bandlist is number of bands */
-@@ -6613,6 +6661,7 @@ static int brcmf_setup_wiphy(struct wiph
- 
- static s32 brcmf_config_dongle(struct brcmf_cfg80211_info *cfg)
- {
-+	struct wiphy *wiphy = cfg_to_wiphy(cfg);
- 	struct net_device *ndev;
- 	struct wireless_dev *wdev;
- 	struct brcmf_if *ifp;
-@@ -6650,7 +6699,7 @@ static s32 brcmf_config_dongle(struct br
- 
- 	err = brcmf_fil_cmd_int_set(ifp, BRCMF_C_SET_FAKEFRAG, 1);
- 	if (err) {
--		brcmf_err("failed to set frameburst mode\n");
-+		bphy_err(wiphy, "failed to set frameburst mode\n");
- 		goto default_conf_out;
- 	}
- 
-@@ -6842,8 +6891,8 @@ static void brcmf_cfg80211_reg_notifier(
- 	/* ignore non-ISO3166 country codes */
- 	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]);
-+			bphy_err(wiphy, "not an ISO3166 code (0x%02x 0x%02x)\n",
-+				 req->alpha2[0], req->alpha2[1]);
- 			return;
- 		}
- 
-@@ -6852,7 +6901,7 @@ static void brcmf_cfg80211_reg_notifier(
- 
- 	err = brcmf_fil_iovar_data_get(ifp, "country", &ccreq, sizeof(ccreq));
- 	if (err) {
--		brcmf_err("Country code iovar returned err = %d\n", err);
-+		bphy_err(wiphy, "Country code iovar returned err = %d\n", err);
- 		return;
- 	}
- 
-@@ -6862,7 +6911,7 @@ static void brcmf_cfg80211_reg_notifier(
- 
- 	err = brcmf_fil_iovar_data_set(ifp, "country", &ccreq, sizeof(ccreq));
- 	if (err) {
--		brcmf_err("Firmware rejected country setting\n");
-+		bphy_err(wiphy, "Firmware rejected country setting\n");
- 		return;
- 	}
- 	brcmf_setup_wiphybands(cfg);
-@@ -6908,13 +6957,13 @@ struct brcmf_cfg80211_info *brcmf_cfg802
- 	u16 *cap = NULL;
- 
- 	if (!ndev) {
--		brcmf_err("ndev is invalid\n");
-+		bphy_err(wiphy, "ndev is invalid\n");
- 		return NULL;
- 	}
- 
- 	cfg = kzalloc(sizeof(*cfg), GFP_KERNEL);
- 	if (!cfg) {
--		brcmf_err("Could not allocate wiphy device\n");
-+		bphy_err(wiphy, "Could not allocate wiphy device\n");
- 		return NULL;
- 	}
- 
-@@ -6935,7 +6984,7 @@ struct brcmf_cfg80211_info *brcmf_cfg802
- 
- 	err = wl_init_priv(cfg);
- 	if (err) {
--		brcmf_err("Failed to init iwm_priv (%d)\n", err);
-+		bphy_err(wiphy, "Failed to init iwm_priv (%d)\n", err);
- 		brcmf_free_vif(vif);
- 		goto wiphy_out;
- 	}
-@@ -6944,7 +6993,7 @@ struct brcmf_cfg80211_info *brcmf_cfg802
- 	/* determine d11 io type before wiphy setup */
- 	err = brcmf_fil_cmd_int_get(ifp, BRCMF_C_GET_VERSION, &io_type);
- 	if (err) {
--		brcmf_err("Failed to get D11 version (%d)\n", err);
-+		bphy_err(wiphy, "Failed to get D11 version (%d)\n", err);
- 		goto priv_out;
- 	}
- 	cfg->d11inf.io_type = (u8)io_type;
-@@ -6978,13 +7027,13 @@ struct brcmf_cfg80211_info *brcmf_cfg802
- #endif
- 	err = wiphy_register(wiphy);
- 	if (err < 0) {
--		brcmf_err("Could not register wiphy device (%d)\n", err);
-+		bphy_err(wiphy, "Could not register wiphy device (%d)\n", err);
- 		goto priv_out;
- 	}
- 
- 	err = brcmf_setup_wiphybands(cfg);
- 	if (err) {
--		brcmf_err("Setting wiphy bands failed (%d)\n", err);
-+		bphy_err(wiphy, "Setting wiphy bands failed (%d)\n", err);
- 		goto wiphy_unreg_out;
- 	}
- 
-@@ -7002,24 +7051,24 @@ struct brcmf_cfg80211_info *brcmf_cfg802
- 
- 	err = brcmf_fweh_activate_events(ifp);
- 	if (err) {
--		brcmf_err("FWEH activation failed (%d)\n", err);
-+		bphy_err(wiphy, "FWEH activation failed (%d)\n", err);
- 		goto wiphy_unreg_out;
- 	}
- 
- 	err = brcmf_p2p_attach(cfg, p2pdev_forced);
- 	if (err) {
--		brcmf_err("P2P initialisation failed (%d)\n", err);
-+		bphy_err(wiphy, "P2P initialisation failed (%d)\n", err);
- 		goto wiphy_unreg_out;
- 	}
- 	err = brcmf_btcoex_attach(cfg);
- 	if (err) {
--		brcmf_err("BT-coex initialisation failed (%d)\n", err);
-+		bphy_err(wiphy, "BT-coex initialisation failed (%d)\n", err);
- 		brcmf_p2p_detach(&cfg->p2p);
- 		goto wiphy_unreg_out;
- 	}
- 	err = brcmf_pno_attach(cfg);
- 	if (err) {
--		brcmf_err("PNO initialisation failed (%d)\n", err);
-+		bphy_err(wiphy, "PNO initialisation failed (%d)\n", err);
- 		brcmf_btcoex_detach(cfg);
- 		brcmf_p2p_detach(&cfg->p2p);
- 		goto wiphy_unreg_out;
-@@ -7039,7 +7088,7 @@ struct brcmf_cfg80211_info *brcmf_cfg802
- 	/* (re-) activate FWEH event handling */
- 	err = brcmf_fweh_activate_events(ifp);
- 	if (err) {
--		brcmf_err("FWEH activation failed (%d)\n", err);
-+		bphy_err(wiphy, "FWEH activation failed (%d)\n", err);
- 		goto detach;
- 	}
- 
---- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/debug.h
-+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/debug.h
-@@ -62,6 +62,15 @@ void __brcmf_err(struct brcmf_bus *bus,
- 	} while (0)
- #endif
- 
-+#define bphy_err(wiphy, fmt, ...)					\
-+	do {								\
-+		if (IS_ENABLED(CPTCFG_BRCMDBG) ||			\
-+		    IS_ENABLED(CPTCFG_BRCM_TRACING) ||			\
-+		    net_ratelimit())					\
-+			wiphy_err(wiphy, "%s: " fmt, __func__,		\
-+				  ##__VA_ARGS__);			\
-+	} while (0)
-+
- #if defined(DEBUG) || defined(CPTCFG_BRCM_TRACING)
- 
- /* For debug/tracing purposes treat info messages as errors */

+ 0 - 62
package/kernel/mac80211/patches/brcm/347-v5.1-brcmfmac-fix-typos.patch

@@ -1,62 +0,0 @@
-From 2359dd09f9819c7d57d81e05173541f0f9f820c7 Mon Sep 17 00:00:00 2001
-From: Matteo Croce <[email protected]>
-Date: Tue, 29 Jan 2019 18:47:17 +0100
-Subject: [PATCH] brcmfmac: fix typos
-
-Fix spelling mistakes in brcmfmac: "lenght" -> "length".
-The typos are also in the special comment blocks which
-translates to documentation.
-
-Signed-off-by: Matteo Croce <[email protected]>
-Signed-off-by: Kalle Valo <[email protected]>
----
- drivers/net/wireless/broadcom/brcm80211/brcmfmac/core.h     | 2 +-
- drivers/net/wireless/broadcom/brcm80211/brcmfmac/firmware.c | 2 +-
- drivers/net/wireless/broadcom/brcm80211/brcmfmac/fweh.h     | 2 +-
- drivers/net/wireless/broadcom/brcm80211/brcmfmac/usb.c      | 2 +-
- 4 files changed, 4 insertions(+), 4 deletions(-)
-
---- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/core.h
-+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/core.h
-@@ -36,7 +36,7 @@
- #define BRCMF_DCMD_MEDLEN	1536
- #define BRCMF_DCMD_MAXLEN	8192
- 
--/* IOCTL from host to device are limited in lenght. A device can only handle
-+/* IOCTL from host to device are limited in length. A device can only handle
-  * ethernet frame size. This limitation is to be applied by protocol layer.
-  */
- #define BRCMF_TX_IOCTL_MAX_MSG_SIZE	(ETH_FRAME_LEN+ETH_FCS_LEN)
---- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/firmware.c
-+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/firmware.c
-@@ -47,7 +47,7 @@ enum nvram_parser_state {
-  * @state: current parser state.
-  * @data: input buffer being parsed.
-  * @nvram: output buffer with parse result.
-- * @nvram_len: lenght of parse result.
-+ * @nvram_len: length of parse result.
-  * @line: current line.
-  * @column: current column in line.
-  * @pos: byte offset in input buffer.
---- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/fweh.h
-+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/fweh.h
-@@ -266,7 +266,7 @@ struct brcmf_event {
-  * @status: status information.
-  * @reason: reason code.
-  * @auth_type: authentication type.
-- * @datalen: lenght of event data buffer.
-+ * @datalen: length of event data buffer.
-  * @addr: ether address.
-  * @ifname: interface name.
-  * @ifidx: interface index.
---- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/usb.c
-+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/usb.c
-@@ -508,7 +508,7 @@ static void brcmf_usb_rx_complete(struct
- 	skb = req->skb;
- 	req->skb = NULL;
- 
--	/* zero lenght packets indicate usb "failure". Do not refill */
-+	/* zero length packets indicate usb "failure". Do not refill */
- 	if (urb->status != 0 || !urb->actual_length) {
- 		brcmu_pkt_buf_free_skb(skb);
- 		brcmf_usb_enq(devinfo, &devinfo->rx_freeq, req, NULL);

+ 0 - 143
package/kernel/mac80211/patches/brcm/348-v5.1-brcmfmac-support-monitor-frames-with-the-hardware-uc.patch

@@ -1,143 +0,0 @@
-From e665988be29ccea3584528967b432a5cfd801ca4 Mon Sep 17 00:00:00 2001
-From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= <[email protected]>
-Date: Fri, 8 Feb 2019 07:42:30 +0100
-Subject: [PATCH] brcmfmac: support monitor frames with the hardware/ucode
- header
-MIME-Version: 1.0
-Content-Type: text/plain; charset=UTF-8
-Content-Transfer-Encoding: 8bit
-
-So far there were two monitor frame formats:
-1) 802.11 frames (with frame (sub)type & all addresses)
-2) 802.11 frames with the radiotap header
-
-Testing the latest FullMAC firmwares for 4366b1/4366c0 resulted in
-discovering a new format being used. It seems (almost?) identical to the
-one known from ucode used in SoftMAC devices which is most likely the
-same codebase anyway.
-
-While new firmwares will /announce/ radiotap header support using the
-"rtap" fw capability string it seems no string was added for the new
-ucode header format.
-
-All above means that:
-1) We need new format support when dealing with a received frame
-2) A new feature bit & mapping quirks have to be added manually
-
-As for now only an empty radiotap is being created. Adding support for
-extracting some info (band, channel, signal, etc.) is planned for the
-future.
-
-Signed-off-by: Rafał Miłecki <[email protected]>
-Acked-by: Arend van Spriel <[email protected]>
-Signed-off-by: Kalle Valo <[email protected]>
----
- .../broadcom/brcm80211/brcmfmac/core.c        | 55 +++++++++++++++++++
- .../broadcom/brcm80211/brcmfmac/feature.c     |  4 ++
- .../broadcom/brcm80211/brcmfmac/feature.h     |  4 +-
- 3 files changed, 62 insertions(+), 1 deletion(-)
-
---- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/core.c
-+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/core.c
-@@ -43,6 +43,36 @@
- 
- #define BRCMF_BSSIDX_INVALID			-1
- 
-+#define	RXS_PBPRES				BIT(2)
-+
-+#define	D11_PHY_HDR_LEN				6
-+
-+struct d11rxhdr_le {
-+	__le16 RxFrameSize;
-+	u16 PAD;
-+	__le16 PhyRxStatus_0;
-+	__le16 PhyRxStatus_1;
-+	__le16 PhyRxStatus_2;
-+	__le16 PhyRxStatus_3;
-+	__le16 PhyRxStatus_4;
-+	__le16 PhyRxStatus_5;
-+	__le16 RxStatus1;
-+	__le16 RxStatus2;
-+	__le16 RxTSFTime;
-+	__le16 RxChan;
-+	u8 unknown[12];
-+} __packed;
-+
-+struct wlc_d11rxhdr {
-+	struct d11rxhdr_le rxhdr;
-+	__le32 tsf_l;
-+	s8 rssi;
-+	s8 rxpwr0;
-+	s8 rxpwr1;
-+	s8 do_rssi_ma;
-+	s8 rxpwr[4];
-+} __packed;
-+
- char *brcmf_ifname(struct brcmf_if *ifp)
- {
- 	if (!ifp)
-@@ -409,6 +439,31 @@ void brcmf_netif_mon_rx(struct brcmf_if
- {
- 	if (brcmf_feat_is_enabled(ifp, BRCMF_FEAT_MONITOR_FMT_RADIOTAP)) {
- 		/* Do nothing */
-+	} else if (brcmf_feat_is_enabled(ifp, BRCMF_FEAT_MONITOR_FMT_HW_RX_HDR)) {
-+		struct wlc_d11rxhdr *wlc_rxhdr = (struct wlc_d11rxhdr *)skb->data;
-+		struct ieee80211_radiotap_header *radiotap;
-+		unsigned int offset;
-+		u16 RxStatus1;
-+
-+		RxStatus1 = le16_to_cpu(wlc_rxhdr->rxhdr.RxStatus1);
-+
-+		offset = sizeof(struct wlc_d11rxhdr);
-+		/* MAC inserts 2 pad bytes for a4 headers or QoS or A-MSDU
-+		 * subframes
-+		 */
-+		if (RxStatus1 & RXS_PBPRES)
-+			offset += 2;
-+		offset += D11_PHY_HDR_LEN;
-+
-+		skb_pull(skb, offset);
-+
-+		/* TODO: use RX header 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;
- 	} else {
- 		struct ieee80211_radiotap_header *radiotap;
- 
---- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/feature.c
-+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/feature.c
-@@ -103,6 +103,10 @@ static const struct brcmf_feat_fwfeat br
- 	{ "01-6cb8e269", BIT(BRCMF_FEAT_MONITOR) },
- 	/* brcmfmac4366b-pcie.bin from linux-firmware.git commit 52442afee990 */
- 	{ "01-c47a91a4", BIT(BRCMF_FEAT_MONITOR) },
-+	/* brcmfmac4366b-pcie.bin from linux-firmware.git commit 211de1679a68 */
-+	{ "01-801fb449", BIT(BRCMF_FEAT_MONITOR_FMT_HW_RX_HDR) },
-+	/* brcmfmac4366c-pcie.bin from linux-firmware.git commit 211de1679a68 */
-+	{ "01-d2cbb8fd", BIT(BRCMF_FEAT_MONITOR_FMT_HW_RX_HDR) },
- };
- 
- static void brcmf_feat_firmware_overrides(struct brcmf_pub *drv)
---- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/feature.h
-+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/feature.h
-@@ -35,6 +35,7 @@
-  * FWSUP: Firmware supplicant.
-  * MONITOR: firmware can pass monitor packets to host.
-  * MONITOR_FMT_RADIOTAP: firmware provides monitor packets with radiotap header
-+ * MONITOR_FMT_HW_RX_HDR: firmware provides monitor packets with hw/ucode header
-  */
- #define BRCMF_FEAT_LIST \
- 	BRCMF_FEAT_DEF(MBSS) \
-@@ -52,7 +53,8 @@
- 	BRCMF_FEAT_DEF(GSCAN) \
- 	BRCMF_FEAT_DEF(FWSUP) \
- 	BRCMF_FEAT_DEF(MONITOR) \
--	BRCMF_FEAT_DEF(MONITOR_FMT_RADIOTAP)
-+	BRCMF_FEAT_DEF(MONITOR_FMT_RADIOTAP) \
-+	BRCMF_FEAT_DEF(MONITOR_FMT_HW_RX_HDR)
- 
- /*
-  * Quirks:

+ 0 - 28
package/kernel/mac80211/patches/brcm/349-v5.1-0001-brcmfmac-assure-SSID-length-from-firmware-is-limited.patch

@@ -1,28 +0,0 @@
-From 1b5e2423164b3670e8bc9174e4762d297990deff Mon Sep 17 00:00:00 2001
-From: Arend van Spriel <[email protected]>
-Date: Thu, 14 Feb 2019 13:43:47 +0100
-Subject: [PATCH] brcmfmac: assure SSID length from firmware is limited
-
-The SSID length as received from firmware should not exceed
-IEEE80211_MAX_SSID_LEN as that would result in heap overflow.
-
-Reviewed-by: Hante Meuleman <[email protected]>
-Reviewed-by: Pieter-Paul Giesberts <[email protected]>
-Reviewed-by: Franky Lin <[email protected]>
-Signed-off-by: Arend van Spriel <[email protected]>
-Signed-off-by: Kalle Valo <[email protected]>
----
- drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c | 2 ++
- 1 file changed, 2 insertions(+)
-
---- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c
-+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c
-@@ -3499,6 +3499,8 @@ brcmf_wowl_nd_results(struct brcmf_if *i
- 	}
- 
- 	netinfo = brcmf_get_netinfo_array(pfn_result);
-+	if (netinfo->SSID_len > IEEE80211_MAX_SSID_LEN)
-+		netinfo->SSID_len = IEEE80211_MAX_SSID_LEN;
- 	memcpy(cfg->wowl.nd->ssid.ssid, netinfo->SSID, netinfo->SSID_len);
- 	cfg->wowl.nd->ssid.ssid_len = netinfo->SSID_len;
- 	cfg->wowl.nd->n_channels = 1;

+ 0 - 96
package/kernel/mac80211/patches/brcm/349-v5.1-0002-brcmfmac-add-subtype-check-for-event-handling-in-dat.patch

@@ -1,96 +0,0 @@
-From a4176ec356c73a46c07c181c6d04039fafa34a9f Mon Sep 17 00:00:00 2001
-From: Arend van Spriel <[email protected]>
-Date: Thu, 14 Feb 2019 13:43:48 +0100
-Subject: [PATCH] brcmfmac: add subtype check for event handling in data path
-
-For USB there is no separate channel being used to pass events
-from firmware to the host driver and as such are passed over the
-data path. In order to detect mock event messages an additional
-check is needed on event subtype. This check is added conditionally
-using unlikely() keyword.
-
-Reviewed-by: Hante Meuleman <[email protected]>
-Reviewed-by: Pieter-Paul Giesberts <[email protected]>
-Reviewed-by: Franky Lin <[email protected]>
-Signed-off-by: Arend van Spriel <[email protected]>
-Signed-off-by: Kalle Valo <[email protected]>
----
- .../wireless/broadcom/brcm80211/brcmfmac/core.c  |  5 +++--
- .../wireless/broadcom/brcm80211/brcmfmac/fweh.h  | 16 ++++++++++++----
- .../broadcom/brcm80211/brcmfmac/msgbuf.c         |  2 +-
- 3 files changed, 16 insertions(+), 7 deletions(-)
-
---- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/core.c
-+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/core.c
-@@ -519,7 +519,8 @@ void brcmf_rx_frame(struct device *dev,
- 	} else {
- 		/* Process special event packets */
- 		if (handle_event)
--			brcmf_fweh_process_skb(ifp->drvr, skb);
-+			brcmf_fweh_process_skb(ifp->drvr, skb,
-+					       BCMILCP_SUBTYPE_VENDOR_LONG);
- 
- 		brcmf_netif_rx(ifp, skb);
- 	}
-@@ -536,7 +537,7 @@ void brcmf_rx_event(struct device *dev,
- 	if (brcmf_rx_hdrpull(drvr, skb, &ifp))
- 		return;
- 
--	brcmf_fweh_process_skb(ifp->drvr, skb);
-+	brcmf_fweh_process_skb(ifp->drvr, skb, 0);
- 	brcmu_pkt_buf_free_skb(skb);
- }
- 
---- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/fweh.h
-+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/fweh.h
-@@ -211,7 +211,7 @@ enum brcmf_fweh_event_code {
-  */
- #define BRCM_OUI				"\x00\x10\x18"
- #define BCMILCP_BCM_SUBTYPE_EVENT		1
--
-+#define BCMILCP_SUBTYPE_VENDOR_LONG		32769
- 
- /**
-  * struct brcm_ethhdr - broadcom specific ether header.
-@@ -334,10 +334,10 @@ void brcmf_fweh_process_event(struct brc
- void brcmf_fweh_p2pdev_setup(struct brcmf_if *ifp, bool ongoing);
- 
- static inline void brcmf_fweh_process_skb(struct brcmf_pub *drvr,
--					  struct sk_buff *skb)
-+					  struct sk_buff *skb, u16 stype)
- {
- 	struct brcmf_event *event_packet;
--	u16 usr_stype;
-+	u16 subtype, usr_stype;
- 
- 	/* only process events when protocol matches */
- 	if (skb->protocol != cpu_to_be16(ETH_P_LINK_CTL))
-@@ -346,8 +346,16 @@ static inline void brcmf_fweh_process_sk
- 	if ((skb->len + ETH_HLEN) < sizeof(*event_packet))
- 		return;
- 
--	/* check for BRCM oui match */
- 	event_packet = (struct brcmf_event *)skb_mac_header(skb);
-+
-+	/* check subtype if needed */
-+	if (unlikely(stype)) {
-+		subtype = get_unaligned_be16(&event_packet->hdr.subtype);
-+		if (subtype != stype)
-+			return;
-+	}
-+
-+	/* check for BRCM oui match */
- 	if (memcmp(BRCM_OUI, &event_packet->hdr.oui[0],
- 		   sizeof(event_packet->hdr.oui)))
- 		return;
---- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/msgbuf.c
-+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/msgbuf.c
-@@ -1116,7 +1116,7 @@ static void brcmf_msgbuf_process_event(s
- 
- 	skb->protocol = eth_type_trans(skb, ifp->ndev);
- 
--	brcmf_fweh_process_skb(ifp->drvr, skb);
-+	brcmf_fweh_process_skb(ifp->drvr, skb, 0);
- 
- exit:
- 	brcmu_pkt_buf_free_skb(skb);

+ 0 - 101
package/kernel/mac80211/patches/brcm/349-v5.1-0003-brcmfmac-create-debugfs-files-for-bus-specific-layer.patch

@@ -1,101 +0,0 @@
-From aaf6a5e86e36766abbeedf220462bde8031f9a72 Mon Sep 17 00:00:00 2001
-From: Arend van Spriel <[email protected]>
-Date: Thu, 14 Feb 2019 13:43:49 +0100
-Subject: [PATCH] brcmfmac: create debugfs files for bus-specific layer
-
-Since we moved the drivers debugfs directory under ieee80211 debugfs the
-debugfs entries need to be added after wiphy_register() has been called.
-For most part that has been done accordingly, but for the debugfs entries
-added by SDIO it was not and failed silently. This patch fixes that by
-adding a bus-layer callback for it.
-
-Fixes: 856d5a011c86 ("brcmfmac: allocate struct brcmf_pub instance using wiphy_new()")
-Reported-by: Russel King <[email protected]>
-Reviewed-by: Franky Lin <[email protected]>
-Signed-off-by: Arend van Spriel <[email protected]>
-Signed-off-by: Kalle Valo <[email protected]>
----
- .../net/wireless/broadcom/brcm80211/brcmfmac/bus.h   | 10 ++++++++++
- .../net/wireless/broadcom/brcm80211/brcmfmac/core.c  |  1 +
- .../net/wireless/broadcom/brcm80211/brcmfmac/sdio.c  | 12 +++++++-----
- 3 files changed, 18 insertions(+), 5 deletions(-)
-
---- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/bus.h
-+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/bus.h
-@@ -90,6 +90,7 @@ struct brcmf_bus_ops {
- 	int (*get_memdump)(struct device *dev, void *data, size_t len);
- 	int (*get_fwname)(struct device *dev, const char *ext,
- 			  unsigned char *fw_name);
-+	void (*debugfs_create)(struct device *dev);
- };
- 
- 
-@@ -235,6 +236,15 @@ int brcmf_bus_get_fwname(struct brcmf_bu
- 	return bus->ops->get_fwname(bus->dev, ext, fw_name);
- }
- 
-+static inline
-+void brcmf_bus_debugfs_create(struct brcmf_bus *bus)
-+{
-+	if (!bus->ops->debugfs_create)
-+		return;
-+
-+	return bus->ops->debugfs_create(bus->dev);
-+}
-+
- /*
-  * interface functions from common layer
-  */
---- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/core.c
-+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/core.c
-@@ -1177,6 +1177,7 @@ static int brcmf_bus_started(struct brcm
- 	brcmf_debugfs_add_entry(drvr, "revinfo", brcmf_revinfo_read);
- 	brcmf_feat_debugfs_create(drvr);
- 	brcmf_proto_debugfs_create(drvr);
-+	brcmf_bus_debugfs_create(bus_if);
- 
- 	return 0;
- 
---- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c
-+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c
-@@ -3143,9 +3143,12 @@ static int brcmf_debugfs_sdio_count_read
- 	return 0;
- }
- 
--static void brcmf_sdio_debugfs_create(struct brcmf_sdio *bus)
-+static void brcmf_sdio_debugfs_create(struct device *dev)
- {
--	struct brcmf_pub *drvr = bus->sdiodev->bus_if->drvr;
-+	struct brcmf_bus *bus_if = dev_get_drvdata(dev);
-+	struct brcmf_pub *drvr = bus_if->drvr;
-+	struct brcmf_sdio_dev *sdiodev = bus_if->bus_priv.sdio;
-+	struct brcmf_sdio *bus = sdiodev->bus;
- 	struct dentry *dentry = brcmf_debugfs_get_devdir(drvr);
- 
- 	if (IS_ERR_OR_NULL(dentry))
-@@ -3165,7 +3168,7 @@ static int brcmf_sdio_checkdied(struct b
- 	return 0;
- }
- 
--static void brcmf_sdio_debugfs_create(struct brcmf_sdio *bus)
-+static void brcmf_sdio_debugfs_create(struct device *dev)
- {
- }
- #endif /* DEBUG */
-@@ -3477,8 +3480,6 @@ 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.
-@@ -4088,6 +4089,7 @@ static const struct brcmf_bus_ops brcmf_
- 	.get_ramsize = brcmf_sdio_bus_get_ramsize,
- 	.get_memdump = brcmf_sdio_bus_get_memdump,
- 	.get_fwname = brcmf_sdio_get_fwname,
-+	.debugfs_create = brcmf_sdio_debugfs_create
- };
- 
- #define BRCMF_SDIO_FW_CODE	0

+ 0 - 41
package/kernel/mac80211/patches/brcm/349-v5.1-0004-brcmfmac-disable-MBSS-feature-for-bcm4330-device.patch

@@ -1,41 +0,0 @@
-From 92d3b88b1029c46f9bf27302c502dc0e3541805b Mon Sep 17 00:00:00 2001
-From: Arend van Spriel <[email protected]>
-Date: Thu, 14 Feb 2019 13:43:50 +0100
-Subject: [PATCH] brcmfmac: disable MBSS feature for bcm4330 device
-
-The MBSS feature was already disabled for bcm43362 as it resulted in a
-beacon with BRCM_TEST_SSID regardless user configuration in hostapd. Now
-the same has been reported for bcm4330 so disable the feature for this
-device as well.
-
-Reported-by: Russell King <[email protected]>
-Tested-by: Christopher Martin <[email protected]>
-Reviewed-by: Hante Meuleman <[email protected]>
-Reviewed-by: Pieter-Paul Giesberts <[email protected]>
-Reviewed-by: Franky Lin <[email protected]>
-Signed-off-by: Arend van Spriel <[email protected]>
-Signed-off-by: Kalle Valo <[email protected]>
----
- .../net/wireless/broadcom/brcm80211/brcmfmac/feature.c | 10 ++++++++--
- 1 file changed, 8 insertions(+), 2 deletions(-)
-
---- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/feature.c
-+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/feature.c
-@@ -272,9 +272,15 @@ void brcmf_feat_attach(struct brcmf_pub
- 					BIT(BRCMF_FEAT_WOWL_GTK);
- 		}
- 	}
--	/* MBSS does not work for 43362 */
--	if (drvr->bus_if->chip == BRCM_CC_43362_CHIP_ID)
-+	/* MBSS does not work for all chips */
-+	switch (drvr->bus_if->chip) {
-+	case BRCM_CC_4330_CHIP_ID:
-+	case BRCM_CC_43362_CHIP_ID:
- 		ifp->drvr->feat_flags &= ~BIT(BRCMF_FEAT_MBSS);
-+		break;
-+	default:
-+		break;
-+	}
- 	brcmf_feat_iovar_int_get(ifp, BRCMF_FEAT_RSDB, "rsdb_mode");
- 	brcmf_feat_iovar_int_get(ifp, BRCMF_FEAT_TDLS, "tdls_enable");
- 	brcmf_feat_iovar_int_get(ifp, BRCMF_FEAT_MFP, "mfp");

+ 0 - 121
package/kernel/mac80211/patches/brcm/349-v5.1-0005-brcmfmac-check-and-dump-trap-info-during-sdio-probe.patch

@@ -1,121 +0,0 @@
-From 4ab2cf03da91785f2c34d79a302e53da06928bc1 Mon Sep 17 00:00:00 2001
-From: Arend van Spriel <[email protected]>
-Date: Thu, 14 Feb 2019 13:43:51 +0100
-Subject: [PATCH] brcmfmac: check and dump trap info during sdio probe
-
-When the firmware crashes during the probe sequence we provide little
-information on what really failed. This patch checks the sdpcm shared
-location and show the trap information if a firmware trap has happened.
-
-Reviewed-by: Hante Meuleman <[email protected]>
-Reviewed-by: Pieter-Paul Giesberts <[email protected]>
-Reviewed-by: Franky Lin <[email protected]>
-Signed-off-by: Arend van Spriel <[email protected]>
-Signed-off-by: Kalle Valo <[email protected]>
----
- .../broadcom/brcm80211/brcmfmac/sdio.c        | 59 +++++++++++++------
- 1 file changed, 40 insertions(+), 19 deletions(-)
-
---- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c
-+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c
-@@ -2999,21 +2999,35 @@ static int brcmf_sdio_trap_info(struct s
- 	if (error < 0)
- 		return error;
- 
--	seq_printf(seq,
--		   "dongle trap info: type 0x%x @ epc 0x%08x\n"
--		   "  cpsr 0x%08x spsr 0x%08x sp 0x%08x\n"
--		   "  lr   0x%08x pc   0x%08x offset 0x%x\n"
--		   "  r0   0x%08x r1   0x%08x r2 0x%08x r3 0x%08x\n"
--		   "  r4   0x%08x r5   0x%08x r6 0x%08x r7 0x%08x\n",
--		   le32_to_cpu(tr.type), le32_to_cpu(tr.epc),
--		   le32_to_cpu(tr.cpsr), le32_to_cpu(tr.spsr),
--		   le32_to_cpu(tr.r13), le32_to_cpu(tr.r14),
--		   le32_to_cpu(tr.pc), sh->trap_addr,
--		   le32_to_cpu(tr.r0), le32_to_cpu(tr.r1),
--		   le32_to_cpu(tr.r2), le32_to_cpu(tr.r3),
--		   le32_to_cpu(tr.r4), le32_to_cpu(tr.r5),
--		   le32_to_cpu(tr.r6), le32_to_cpu(tr.r7));
--
-+	if (seq)
-+		seq_printf(seq,
-+			   "dongle trap info: type 0x%x @ epc 0x%08x\n"
-+			   "  cpsr 0x%08x spsr 0x%08x sp 0x%08x\n"
-+			   "  lr   0x%08x pc   0x%08x offset 0x%x\n"
-+			   "  r0   0x%08x r1   0x%08x r2 0x%08x r3 0x%08x\n"
-+			   "  r4   0x%08x r5   0x%08x r6 0x%08x r7 0x%08x\n",
-+			   le32_to_cpu(tr.type), le32_to_cpu(tr.epc),
-+			   le32_to_cpu(tr.cpsr), le32_to_cpu(tr.spsr),
-+			   le32_to_cpu(tr.r13), le32_to_cpu(tr.r14),
-+			   le32_to_cpu(tr.pc), sh->trap_addr,
-+			   le32_to_cpu(tr.r0), le32_to_cpu(tr.r1),
-+			   le32_to_cpu(tr.r2), le32_to_cpu(tr.r3),
-+			   le32_to_cpu(tr.r4), le32_to_cpu(tr.r5),
-+			   le32_to_cpu(tr.r6), le32_to_cpu(tr.r7));
-+	else
-+		pr_debug("dongle trap info: type 0x%x @ epc 0x%08x\n"
-+			 "  cpsr 0x%08x spsr 0x%08x sp 0x%08x\n"
-+			 "  lr   0x%08x pc   0x%08x offset 0x%x\n"
-+			 "  r0   0x%08x r1   0x%08x r2 0x%08x r3 0x%08x\n"
-+			 "  r4   0x%08x r5   0x%08x r6 0x%08x r7 0x%08x\n",
-+			 le32_to_cpu(tr.type), le32_to_cpu(tr.epc),
-+			 le32_to_cpu(tr.cpsr), le32_to_cpu(tr.spsr),
-+			 le32_to_cpu(tr.r13), le32_to_cpu(tr.r14),
-+			 le32_to_cpu(tr.pc), sh->trap_addr,
-+			 le32_to_cpu(tr.r0), le32_to_cpu(tr.r1),
-+			 le32_to_cpu(tr.r2), le32_to_cpu(tr.r3),
-+			 le32_to_cpu(tr.r4), le32_to_cpu(tr.r5),
-+			 le32_to_cpu(tr.r6), le32_to_cpu(tr.r7));
- 	return 0;
- }
- 
-@@ -3067,8 +3081,10 @@ static int brcmf_sdio_checkdied(struct b
- 	else if (sh.flags & SDPCM_SHARED_ASSERT)
- 		brcmf_err("assertion in dongle\n");
- 
--	if (sh.flags & SDPCM_SHARED_TRAP)
-+	if (sh.flags & SDPCM_SHARED_TRAP) {
- 		brcmf_err("firmware trap in dongle\n");
-+		brcmf_sdio_trap_info(NULL, bus, &sh);
-+	}
- 
- 	return 0;
- }
-@@ -4199,7 +4215,7 @@ static void brcmf_sdio_firmware_callback
- 	} else {
- 		/* Disable F2 again */
- 		sdio_disable_func(sdiod->func2);
--		goto release;
-+		goto checkdied;
- 	}
- 
- 	if (brcmf_chip_sr_capable(bus->ci)) {
-@@ -4220,8 +4236,10 @@ static void brcmf_sdio_firmware_callback
- 	}
- 
- 	/* If we didn't come up, turn off backplane clock */
--	if (err != 0)
-+	if (err != 0) {
- 		brcmf_sdio_clkctl(bus, CLK_NONE, false);
-+		goto checkdied;
-+	}
- 
- 	sdio_release_host(sdiod->func1);
- 
-@@ -4235,12 +4253,15 @@ static void brcmf_sdio_firmware_callback
- 	err = brcmf_attach(sdiod->dev, sdiod->settings);
- 	if (err != 0) {
- 		brcmf_err("brcmf_attach failed\n");
--		goto fail;
-+		sdio_claim_host(sdiod->func1);
-+		goto checkdied;
- 	}
- 
- 	/* ready */
- 	return;
- 
-+checkdied:
-+	brcmf_sdio_checkdied(bus);
- release:
- 	sdio_release_host(sdiod->func1);
- fail:

+ 0 - 42
package/kernel/mac80211/patches/brcm/349-v5.1-0006-brcmfmac-use-chipname-in-brcmf_fw_alloc_request-for-.patch

@@ -1,42 +0,0 @@
-From a250c91c1762e85c736e67cb4a9a95ebae72e62d Mon Sep 17 00:00:00 2001
-From: Arend van Spriel <[email protected]>
-Date: Thu, 14 Feb 2019 13:43:52 +0100
-Subject: [PATCH] brcmfmac: use chipname in brcmf_fw_alloc_request() for error
- path as well
-
-The local variable chipname is string representation of chip id and revision
-which is printed in the good flow of brcmf_fw_alloc_request(). Also use it
-for the error path, ie. for unknown/unsupported devices.
-
-Reviewed-by: Hante Meuleman <[email protected]>
-Reviewed-by: Pieter-Paul Giesberts <[email protected]>
-Reviewed-by: Franky Lin <[email protected]>
-Signed-off-by: Arend van Spriel <[email protected]>
-Signed-off-by: Kalle Valo <[email protected]>
----
- drivers/net/wireless/broadcom/brcm80211/brcmfmac/firmware.c | 6 +++---
- 1 file changed, 3 insertions(+), 3 deletions(-)
-
---- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/firmware.c
-+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/firmware.c
-@@ -719,8 +719,10 @@ brcmf_fw_alloc_request(u32 chip, u32 chi
- 			break;
- 	}
- 
-+	brcmf_chip_name(chip, chiprev, chipname, sizeof(chipname));
-+
- 	if (i == table_size) {
--		brcmf_err("Unknown chipid %d [%d]\n", chip, chiprev);
-+		brcmf_err("Unknown chip %s\n", chipname);
- 		return NULL;
- 	}
- 
-@@ -729,8 +731,6 @@ brcmf_fw_alloc_request(u32 chip, u32 chi
- 	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);
- 

+ 0 - 67
package/kernel/mac80211/patches/brcm/350-v5.1-brcmfmac-print-firmware-reported-ring-status-errors.patch

@@ -1,67 +0,0 @@
-From c988b78244df8216902e20de536434e2f474a37e Mon Sep 17 00:00:00 2001
-From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= <[email protected]>
-Date: Fri, 8 Feb 2019 15:24:39 +0100
-Subject: [PATCH] brcmfmac: print firmware reported ring status errors
-MIME-Version: 1.0
-Content-Type: text/plain; charset=UTF-8
-Content-Transfer-Encoding: 8bit
-
-Firmware is capable of reporting ring status. It's used e.g. to signal
-some problem with a specific ring setup. This patch adds support for
-printing ring & error number which may be useful for debugging setup
-issues.
-
-Signed-off-by: Rafał Miłecki <[email protected]>
-Signed-off-by: Kalle Valo <[email protected]>
----
- .../broadcom/brcm80211/brcmfmac/msgbuf.c      | 25 +++++++++++++++++++
- 1 file changed, 25 insertions(+)
-
---- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/msgbuf.c
-+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/msgbuf.c
-@@ -134,6 +134,14 @@ struct msgbuf_completion_hdr {
- 	__le16				flow_ring_id;
- };
- 
-+/* Data struct for the MSGBUF_TYPE_RING_STATUS */
-+struct msgbuf_ring_status {
-+	struct msgbuf_common_hdr	msg;
-+	struct msgbuf_completion_hdr	compl_hdr;
-+	__le16				write_idx;
-+	__le32				rsvd0[5];
-+};
-+
- struct msgbuf_rx_event {
- 	struct msgbuf_common_hdr	msg;
- 	struct msgbuf_completion_hdr	compl_hdr;
-@@ -1180,6 +1188,19 @@ brcmf_msgbuf_process_rx_complete(struct
- 	brcmf_netif_rx(ifp, skb);
- }
- 
-+static void brcmf_msgbuf_process_ring_status(struct brcmf_msgbuf *msgbuf,
-+					     void *buf)
-+{
-+	struct msgbuf_ring_status *ring_status = buf;
-+	int err;
-+
-+	err = le16_to_cpu(ring_status->compl_hdr.status);
-+	if (err) {
-+		int ring = le16_to_cpu(ring_status->compl_hdr.flow_ring_id);
-+
-+		brcmf_err("Firmware reported ring %d error: %d\n", ring, err);
-+	}
-+}
- 
- static void
- brcmf_msgbuf_process_flow_ring_create_response(struct brcmf_msgbuf *msgbuf,
-@@ -1241,6 +1262,10 @@ static void brcmf_msgbuf_process_msgtype
- 
- 	msg = (struct msgbuf_common_hdr *)buf;
- 	switch (msg->msgtype) {
-+	case MSGBUF_TYPE_RING_STATUS:
-+		brcmf_dbg(MSGBUF, "MSGBUF_TYPE_RING_STATUS\n");
-+		brcmf_msgbuf_process_ring_status(msgbuf, buf);
-+		break;
- 	case MSGBUF_TYPE_FLOW_RING_CREATE_CMPLT:
- 		brcmf_dbg(MSGBUF, "MSGBUF_TYPE_FLOW_RING_CREATE_CMPLT\n");
- 		brcmf_msgbuf_process_flow_ring_create_response(msgbuf, buf);

+ 0 - 42
package/kernel/mac80211/patches/brcm/351-v5.1-0001-brcmfmac-improve-code-handling-bandwidth-of-firmware.patch

@@ -1,42 +0,0 @@
-From f4e183293b871c96c0220dcc549d5ca4c72628ad Mon Sep 17 00:00:00 2001
-From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= <[email protected]>
-Date: Mon, 11 Feb 2019 23:04:53 +0100
-Subject: [PATCH] brcmfmac: improve code handling bandwidth of firmware
- reported channels
-MIME-Version: 1.0
-Content-Type: text/plain; charset=UTF-8
-Content-Transfer-Encoding: 8bit
-
-1) Use switch to simplify/improve the code & avoid some duplication
-2) Add warning for unsupported values
-
-Signed-off-by: Rafał Miłecki <[email protected]>
-Signed-off-by: Kalle Valo <[email protected]>
----
- .../wireless/broadcom/brcm80211/brcmfmac/cfg80211.c | 13 ++++++++++---
- 1 file changed, 10 insertions(+), 3 deletions(-)
-
---- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c
-+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c
-@@ -6043,11 +6043,18 @@ static int brcmf_construct_chaninfo(stru
- 		/* assuming the chanspecs order is HT20,
- 		 * HT40 upper, HT40 lower, and VHT80.
- 		 */
--		if (ch.bw == BRCMU_CHAN_BW_80) {
-+		switch (ch.bw) {
-+		case BRCMU_CHAN_BW_80:
- 			channel->flags &= ~IEEE80211_CHAN_NO_80MHZ;
--		} else if (ch.bw == BRCMU_CHAN_BW_40) {
-+			break;
-+		case BRCMU_CHAN_BW_40:
- 			brcmf_update_bw40_channel_flag(channel, &ch);
--		} else {
-+			break;
-+		default:
-+			wiphy_warn(wiphy, "Firmware reported unsupported bandwidth %d\n",
-+				   ch.bw);
-+			/* fall through */
-+		case BRCMU_CHAN_BW_20:
- 			/* enable the channel and disable other bandwidths
- 			 * for now as mentioned order assure they are enabled
- 			 * for subsequent chanspecs.

+ 0 - 30
package/kernel/mac80211/patches/brcm/351-v5.1-0002-brcmfmac-support-firmware-reporting-160-MHz-channels.patch

@@ -1,30 +0,0 @@
-From 30519cbe339a45bd11a57ca8ece07f4f6a1cda2e Mon Sep 17 00:00:00 2001
-From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= <[email protected]>
-Date: Mon, 11 Feb 2019 23:04:54 +0100
-Subject: [PATCH] brcmfmac: support firmware reporting 160 MHz channels
-MIME-Version: 1.0
-Content-Type: text/plain; charset=UTF-8
-Content-Transfer-Encoding: 8bit
-
-So far 160 MHz channels were treated as 20 MHz ones which was breaking
-support for 40/80 MHz due to the brcmf_construct_chaninfo() logic and
-its assumptions.
-
-Signed-off-by: Rafał Miłecki <[email protected]>
-Signed-off-by: Kalle Valo <[email protected]>
----
- 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
-@@ -6044,6 +6044,9 @@ static int brcmf_construct_chaninfo(stru
- 		 * HT40 upper, HT40 lower, and VHT80.
- 		 */
- 		switch (ch.bw) {
-+		case BRCMU_CHAN_BW_160:
-+			channel->flags &= ~IEEE80211_CHAN_NO_160MHZ;
-+			break;
- 		case BRCMU_CHAN_BW_80:
- 			channel->flags &= ~IEEE80211_CHAN_NO_80MHZ;
- 			break;

+ 0 - 2290
package/kernel/mac80211/patches/brcm/352-v5.1-brcmfmac-rework-bphy_err-to-take-struct-brcmf_pub-ar.patch

@@ -1,2290 +0,0 @@
-From 16e646768396339b3d354985b99bcd3f1f195a7d Mon Sep 17 00:00:00 2001
-From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= <[email protected]>
-Date: Fri, 15 Feb 2019 15:45:54 +0100
-Subject: [PATCH] brcmfmac: rework bphy_err() to take struct brcmf_pub argument
-MIME-Version: 1.0
-Content-Type: text/plain; charset=UTF-8
-Content-Transfer-Encoding: 8bit
-
-This macro will be used in more places not just the cfg80211.c. It makes
-sense to pass some common struct to it as "struct wiphy" is mostly
-referenced in cfg80211 code only.
-
-A very common one (used above the bus abstraction layer) is struct
-brcmf_pub. Many functions already keep reference to it which will make
-using bphy_err() simpler. It should also allow extending that macro's
-logic if it's ever needed.
-
-This improves code recently added in the commit 3ef005b82e2a ("brcmfmac:
-add bphy_err() and use it in the cfg80211.c").
-
-Signed-off-by: Rafał Miłecki <[email protected]>
-Signed-off-by: Kalle Valo <[email protected]>
----
- .../broadcom/brcm80211/brcmfmac/cfg80211.c    | 510 ++++++++++--------
- .../broadcom/brcm80211/brcmfmac/debug.h       |   4 +-
- 2 files changed, 281 insertions(+), 233 deletions(-)
-
---- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c
-+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c
-@@ -457,7 +457,7 @@ static void convert_key_from_CPU(struct
- static int
- send_key_to_dongle(struct brcmf_if *ifp, struct brcmf_wsec_key *key)
- {
--	struct wiphy *wiphy = ifp->drvr->wiphy;
-+	struct brcmf_pub *drvr = ifp->drvr;
- 	int err;
- 	struct brcmf_wsec_key_le key_le;
- 
-@@ -469,7 +469,7 @@ send_key_to_dongle(struct brcmf_if *ifp,
- 					sizeof(key_le));
- 
- 	if (err)
--		bphy_err(wiphy, "wsec_key error (%d)\n", err);
-+		bphy_err(drvr, "wsec_key error (%d)\n", err);
- 	return err;
- }
- 
-@@ -509,7 +509,7 @@ static int brcmf_get_first_free_bsscfgid
- 
- static int brcmf_cfg80211_request_ap_if(struct brcmf_if *ifp)
- {
--	struct wiphy *wiphy = ifp->drvr->wiphy;
-+	struct brcmf_pub *drvr = ifp->drvr;
- 	struct brcmf_mbss_ssid_le mbss_ssid_le;
- 	int bsscfgidx;
- 	int err;
-@@ -526,7 +526,7 @@ static int brcmf_cfg80211_request_ap_if(
- 	err = brcmf_fil_bsscfg_data_set(ifp, "bsscfg:ssid", &mbss_ssid_le,
- 					sizeof(mbss_ssid_le));
- 	if (err < 0)
--		bphy_err(wiphy, "setting ssid failed %d\n", err);
-+		bphy_err(drvr, "setting ssid failed %d\n", err);
- 
- 	return err;
- }
-@@ -544,6 +544,7 @@ struct wireless_dev *brcmf_ap_add_vif(st
- {
- 	struct brcmf_cfg80211_info *cfg = wiphy_to_cfg(wiphy);
- 	struct brcmf_if *ifp = netdev_priv(cfg_to_ndev(cfg));
-+	struct brcmf_pub *drvr = cfg->pub;
- 	struct brcmf_cfg80211_vif *vif;
- 	int err;
- 
-@@ -569,7 +570,7 @@ struct wireless_dev *brcmf_ap_add_vif(st
- 					    BRCMF_VIF_EVENT_TIMEOUT);
- 	brcmf_cfg80211_arm_vif_event(cfg, NULL);
- 	if (!err) {
--		bphy_err(wiphy, "timeout occurred\n");
-+		bphy_err(drvr, "timeout occurred\n");
- 		err = -EIO;
- 		goto fail;
- 	}
-@@ -577,7 +578,7 @@ struct wireless_dev *brcmf_ap_add_vif(st
- 	/* interface created in firmware */
- 	ifp = vif->ifp;
- 	if (!ifp) {
--		bphy_err(wiphy, "no if pointer provided\n");
-+		bphy_err(drvr, "no if pointer provided\n");
- 		err = -ENOENT;
- 		goto fail;
- 	}
-@@ -585,7 +586,7 @@ struct wireless_dev *brcmf_ap_add_vif(st
- 	strncpy(ifp->ndev->name, name, sizeof(ifp->ndev->name) - 1);
- 	err = brcmf_net_attach(ifp, true);
- 	if (err) {
--		bphy_err(wiphy, "Registering netdevice failed\n");
-+		bphy_err(drvr, "Registering netdevice failed\n");
- 		free_netdev(ifp->ndev);
- 		goto fail;
- 	}
-@@ -616,13 +617,15 @@ static struct wireless_dev *brcmf_cfg802
- 						     enum nl80211_iftype type,
- 						     struct vif_params *params)
- {
-+	struct brcmf_cfg80211_info *cfg = wiphy_to_cfg(wiphy);
-+	struct brcmf_pub *drvr = cfg->pub;
- 	struct wireless_dev *wdev;
- 	int err;
- 
- 	brcmf_dbg(TRACE, "enter: %s type %d\n", name, type);
- 	err = brcmf_vif_add_validate(wiphy_to_cfg(wiphy), type);
- 	if (err) {
--		bphy_err(wiphy, "iface validation failed: err=%d\n", err);
-+		bphy_err(drvr, "iface validation failed: err=%d\n", err);
- 		return ERR_PTR(err);
- 	}
- 	switch (type) {
-@@ -647,7 +650,7 @@ static struct wireless_dev *brcmf_cfg802
- 	}
- 
- 	if (IS_ERR(wdev))
--		bphy_err(wiphy, "add iface %s type %d failed: err=%d\n", name,
-+		bphy_err(drvr, "add iface %s type %d failed: err=%d\n", name,
- 			 type, (int)PTR_ERR(wdev));
- 	else
- 		brcmf_cfg80211_update_proto_addr_mode(wdev);
-@@ -663,13 +666,13 @@ static void brcmf_scan_config_mpc(struct
- 
- void brcmf_set_mpc(struct brcmf_if *ifp, int mpc)
- {
--	struct wiphy *wiphy = ifp->drvr->wiphy;
-+	struct brcmf_pub *drvr = ifp->drvr;
- 	s32 err = 0;
- 
- 	if (check_vif_up(ifp->vif)) {
- 		err = brcmf_fil_iovar_int_set(ifp, "mpc", mpc);
- 		if (err) {
--			bphy_err(wiphy, "fail to set mpc\n");
-+			bphy_err(drvr, "fail to set mpc\n");
- 			return;
- 		}
- 		brcmf_dbg(INFO, "MPC : %d\n", mpc);
-@@ -680,7 +683,7 @@ s32 brcmf_notify_escan_complete(struct b
- 				struct brcmf_if *ifp, bool aborted,
- 				bool fw_abort)
- {
--	struct wiphy *wiphy = cfg_to_wiphy(cfg);
-+	struct brcmf_pub *drvr = cfg->pub;
- 	struct brcmf_scan_params_le params_le;
- 	struct cfg80211_scan_request *scan_request;
- 	u64 reqid;
-@@ -715,7 +718,7 @@ s32 brcmf_notify_escan_complete(struct b
- 		err = brcmf_fil_cmd_data_set(ifp, BRCMF_C_SCAN,
- 					     &params_le, sizeof(params_le));
- 		if (err)
--			bphy_err(wiphy, "Scan abort failed\n");
-+			bphy_err(drvr, "Scan abort failed\n");
- 	}
- 
- 	brcmf_scan_config_mpc(ifp, 1);
-@@ -760,6 +763,7 @@ static int brcmf_cfg80211_del_ap_iface(s
- 	struct brcmf_cfg80211_info *cfg = wiphy_to_cfg(wiphy);
- 	struct net_device *ndev = wdev->netdev;
- 	struct brcmf_if *ifp = netdev_priv(ndev);
-+	struct brcmf_pub *drvr = cfg->pub;
- 	int ret;
- 	int err;
- 
-@@ -767,7 +771,7 @@ static int brcmf_cfg80211_del_ap_iface(s
- 
- 	err = brcmf_fil_bsscfg_data_set(ifp, "interface_remove", NULL, 0);
- 	if (err) {
--		bphy_err(wiphy, "interface_remove failed %d\n", err);
-+		bphy_err(drvr, "interface_remove failed %d\n", err);
- 		goto err_unarm;
- 	}
- 
-@@ -775,7 +779,7 @@ static int brcmf_cfg80211_del_ap_iface(s
- 	ret = brcmf_cfg80211_wait_vif_event(cfg, BRCMF_E_IF_DEL,
- 					    BRCMF_VIF_EVENT_TIMEOUT);
- 	if (!ret) {
--		bphy_err(wiphy, "timeout occurred\n");
-+		bphy_err(drvr, "timeout occurred\n");
- 		err = -EIO;
- 		goto err_unarm;
- 	}
-@@ -838,6 +842,7 @@ brcmf_cfg80211_change_iface(struct wiphy
- 	struct brcmf_cfg80211_info *cfg = wiphy_to_cfg(wiphy);
- 	struct brcmf_if *ifp = netdev_priv(ndev);
- 	struct brcmf_cfg80211_vif *vif = ifp->vif;
-+	struct brcmf_pub *drvr = cfg->pub;
- 	s32 infra = 0;
- 	s32 ap = 0;
- 	s32 err = 0;
-@@ -877,13 +882,13 @@ brcmf_cfg80211_change_iface(struct wiphy
- 	}
- 	err = brcmf_vif_change_validate(wiphy_to_cfg(wiphy), vif, type);
- 	if (err) {
--		bphy_err(wiphy, "iface validation failed: err=%d\n", err);
-+		bphy_err(drvr, "iface validation failed: err=%d\n", err);
- 		return err;
- 	}
- 	switch (type) {
- 	case NL80211_IFTYPE_MONITOR:
- 	case NL80211_IFTYPE_WDS:
--		bphy_err(wiphy, "type (%d) : currently we do not support this type\n",
-+		bphy_err(drvr, "type (%d) : currently we do not support this type\n",
- 			 type);
- 		return -EOPNOTSUPP;
- 	case NL80211_IFTYPE_ADHOC:
-@@ -912,7 +917,7 @@ brcmf_cfg80211_change_iface(struct wiphy
- 	} else {
- 		err = brcmf_fil_cmd_int_set(ifp, BRCMF_C_SET_INFRA, infra);
- 		if (err) {
--			bphy_err(wiphy, "WLC_SET_INFRA error (%d)\n", err);
-+			bphy_err(drvr, "WLC_SET_INFRA error (%d)\n", err);
- 			err = -EAGAIN;
- 			goto done;
- 		}
-@@ -1003,7 +1008,7 @@ static s32
- brcmf_run_escan(struct brcmf_cfg80211_info *cfg, struct brcmf_if *ifp,
- 		struct cfg80211_scan_request *request)
- {
--	struct wiphy *wiphy = cfg_to_wiphy(cfg);
-+	struct brcmf_pub *drvr = cfg->pub;
- 	s32 params_size = BRCMF_SCAN_PARAMS_FIXED_SIZE +
- 			  offsetof(struct brcmf_escan_params_le, params_le);
- 	struct brcmf_escan_params_le *params;
-@@ -1035,7 +1040,7 @@ brcmf_run_escan(struct brcmf_cfg80211_in
- 		if (err == -EBUSY)
- 			brcmf_dbg(INFO, "system busy : escan canceled\n");
- 		else
--			bphy_err(wiphy, "error (%d)\n", err);
-+			bphy_err(drvr, "error (%d)\n", err);
- 	}
- 
- 	kfree(params);
-@@ -1072,6 +1077,7 @@ static s32
- brcmf_cfg80211_scan(struct wiphy *wiphy, struct cfg80211_scan_request *request)
- {
- 	struct brcmf_cfg80211_info *cfg = wiphy_to_cfg(wiphy);
-+	struct brcmf_pub *drvr = cfg->pub;
- 	struct brcmf_cfg80211_vif *vif;
- 	s32 err = 0;
- 
-@@ -1081,22 +1087,22 @@ brcmf_cfg80211_scan(struct wiphy *wiphy,
- 		return -EIO;
- 
- 	if (test_bit(BRCMF_SCAN_STATUS_BUSY, &cfg->scan_status)) {
--		bphy_err(wiphy, "Scanning already: status (%lu)\n",
-+		bphy_err(drvr, "Scanning already: status (%lu)\n",
- 			 cfg->scan_status);
- 		return -EAGAIN;
- 	}
- 	if (test_bit(BRCMF_SCAN_STATUS_ABORT, &cfg->scan_status)) {
--		bphy_err(wiphy, "Scanning being aborted: status (%lu)\n",
-+		bphy_err(drvr, "Scanning being aborted: status (%lu)\n",
- 			 cfg->scan_status);
- 		return -EAGAIN;
- 	}
- 	if (test_bit(BRCMF_SCAN_STATUS_SUPPRESS, &cfg->scan_status)) {
--		bphy_err(wiphy, "Scanning suppressed: status (%lu)\n",
-+		bphy_err(drvr, "Scanning suppressed: status (%lu)\n",
- 			 cfg->scan_status);
- 		return -EAGAIN;
- 	}
- 	if (test_bit(BRCMF_VIF_STATUS_CONNECTING, &vif->sme_state)) {
--		bphy_err(wiphy, "Connecting: status (%lu)\n", vif->sme_state);
-+		bphy_err(drvr, "Connecting: status (%lu)\n", vif->sme_state);
- 		return -EAGAIN;
- 	}
- 
-@@ -1130,7 +1136,7 @@ brcmf_cfg80211_scan(struct wiphy *wiphy,
- 	return 0;
- 
- scan_out:
--	bphy_err(wiphy, "scan error (%d)\n", err);
-+	bphy_err(drvr, "scan error (%d)\n", err);
- 	clear_bit(BRCMF_SCAN_STATUS_BUSY, &cfg->scan_status);
- 	cfg->scan_request = NULL;
- 	return err;
-@@ -1139,12 +1145,12 @@ scan_out:
- static s32 brcmf_set_rts(struct net_device *ndev, u32 rts_threshold)
- {
- 	struct brcmf_if *ifp = netdev_priv(ndev);
--	struct wiphy *wiphy = ifp->drvr->wiphy;
-+	struct brcmf_pub *drvr = ifp->drvr;
- 	s32 err = 0;
- 
- 	err = brcmf_fil_iovar_int_set(ifp, "rtsthresh", rts_threshold);
- 	if (err)
--		bphy_err(wiphy, "Error (%d)\n", err);
-+		bphy_err(drvr, "Error (%d)\n", err);
- 
- 	return err;
- }
-@@ -1152,13 +1158,13 @@ static s32 brcmf_set_rts(struct net_devi
- static s32 brcmf_set_frag(struct net_device *ndev, u32 frag_threshold)
- {
- 	struct brcmf_if *ifp = netdev_priv(ndev);
--	struct wiphy *wiphy = ifp->drvr->wiphy;
-+	struct brcmf_pub *drvr = ifp->drvr;
- 	s32 err = 0;
- 
- 	err = brcmf_fil_iovar_int_set(ifp, "fragthresh",
- 				      frag_threshold);
- 	if (err)
--		bphy_err(wiphy, "Error (%d)\n", err);
-+		bphy_err(drvr, "Error (%d)\n", err);
- 
- 	return err;
- }
-@@ -1166,13 +1172,13 @@ static s32 brcmf_set_frag(struct net_dev
- static s32 brcmf_set_retry(struct net_device *ndev, u32 retry, bool l)
- {
- 	struct brcmf_if *ifp = netdev_priv(ndev);
--	struct wiphy *wiphy = ifp->drvr->wiphy;
-+	struct brcmf_pub *drvr = ifp->drvr;
- 	s32 err = 0;
- 	u32 cmd = (l ? BRCMF_C_SET_LRL : BRCMF_C_SET_SRL);
- 
- 	err = brcmf_fil_cmd_int_set(ifp, cmd, retry);
- 	if (err) {
--		bphy_err(wiphy, "cmd (%d) , error (%d)\n", cmd, err);
-+		bphy_err(drvr, "cmd (%d) , error (%d)\n", cmd, err);
- 		return err;
- 	}
- 	return err;
-@@ -1248,7 +1254,7 @@ static u16 brcmf_map_fw_linkdown_reason(
- 
- static int brcmf_set_pmk(struct brcmf_if *ifp, const u8 *pmk_data, u16 pmk_len)
- {
--	struct wiphy *wiphy = ifp->drvr->wiphy;
-+	struct brcmf_pub *drvr = ifp->drvr;
- 	struct brcmf_wsec_pmk_le pmk;
- 	int i, err;
- 
-@@ -1262,7 +1268,7 @@ static int brcmf_set_pmk(struct brcmf_if
- 	err = brcmf_fil_cmd_data_set(ifp, BRCMF_C_SET_WSEC_PMK,
- 				     &pmk, sizeof(pmk));
- 	if (err < 0)
--		bphy_err(wiphy, "failed to change PSK in firmware (len=%u)\n",
-+		bphy_err(drvr, "failed to change PSK in firmware (len=%u)\n",
- 			 pmk_len);
- 
- 	return err;
-@@ -1271,7 +1277,7 @@ static int brcmf_set_pmk(struct brcmf_if
- static void brcmf_link_down(struct brcmf_cfg80211_vif *vif, u16 reason)
- {
- 	struct brcmf_cfg80211_info *cfg = wiphy_to_cfg(vif->wdev.wiphy);
--	struct wiphy *wiphy = cfg_to_wiphy(cfg);
-+	struct brcmf_pub *drvr = cfg->pub;
- 	s32 err = 0;
- 
- 	brcmf_dbg(TRACE, "Enter\n");
-@@ -1281,7 +1287,7 @@ static void brcmf_link_down(struct brcmf
- 		err = brcmf_fil_cmd_data_set(vif->ifp,
- 					     BRCMF_C_DISASSOC, NULL, 0);
- 		if (err) {
--			bphy_err(wiphy, "WLC_DISASSOC failed (%d)\n", err);
-+			bphy_err(drvr, "WLC_DISASSOC failed (%d)\n", err);
- 		}
- 		if ((vif->wdev.iftype == NL80211_IFTYPE_STATION) ||
- 		    (vif->wdev.iftype == NL80211_IFTYPE_P2P_CLIENT))
-@@ -1305,6 +1311,7 @@ brcmf_cfg80211_join_ibss(struct wiphy *w
- 	struct brcmf_cfg80211_info *cfg = wiphy_to_cfg(wiphy);
- 	struct brcmf_if *ifp = netdev_priv(ndev);
- 	struct brcmf_cfg80211_profile *profile = &ifp->vif->profile;
-+	struct brcmf_pub *drvr = cfg->pub;
- 	struct brcmf_join_params join_params;
- 	size_t join_params_size = 0;
- 	s32 err = 0;
-@@ -1369,7 +1376,7 @@ brcmf_cfg80211_join_ibss(struct wiphy *w
- 
- 	err = brcmf_fil_iovar_int_set(ifp, "wsec", wsec);
- 	if (err) {
--		bphy_err(wiphy, "wsec failed (%d)\n", err);
-+		bphy_err(drvr, "wsec failed (%d)\n", err);
- 		goto done;
- 	}
- 
-@@ -1381,7 +1388,7 @@ brcmf_cfg80211_join_ibss(struct wiphy *w
- 
- 	err = brcmf_fil_cmd_int_set(ifp, BRCMF_C_SET_BCNPRD, bcnprd);
- 	if (err) {
--		bphy_err(wiphy, "WLC_SET_BCNPRD failed (%d)\n", err);
-+		bphy_err(drvr, "WLC_SET_BCNPRD failed (%d)\n", err);
- 		goto done;
- 	}
- 
-@@ -1426,7 +1433,7 @@ brcmf_cfg80211_join_ibss(struct wiphy *w
- 		err = brcmf_fil_cmd_int_set(ifp, BRCMF_C_SET_CHANNEL,
- 					    target_channel);
- 		if (err) {
--			bphy_err(wiphy, "WLC_SET_CHANNEL failed (%d)\n", err);
-+			bphy_err(drvr, "WLC_SET_CHANNEL failed (%d)\n", err);
- 			goto done;
- 		}
- 	} else
-@@ -1438,7 +1445,7 @@ brcmf_cfg80211_join_ibss(struct wiphy *w
- 	err = brcmf_fil_cmd_data_set(ifp, BRCMF_C_SET_SSID,
- 				     &join_params, join_params_size);
- 	if (err) {
--		bphy_err(wiphy, "WLC_SET_SSID failed (%d)\n", err);
-+		bphy_err(drvr, "WLC_SET_SSID failed (%d)\n", err);
- 		goto done;
- 	}
- 
-@@ -1475,8 +1482,8 @@ static s32 brcmf_set_wpa_version(struct
- 				 struct cfg80211_connect_params *sme)
- {
- 	struct brcmf_if *ifp = netdev_priv(ndev);
--	struct wiphy *wiphy = ifp->drvr->wiphy;
- 	struct brcmf_cfg80211_profile *profile = ndev_to_prof(ndev);
-+	struct brcmf_pub *drvr = ifp->drvr;
- 	struct brcmf_cfg80211_security *sec;
- 	s32 val = 0;
- 	s32 err = 0;
-@@ -1490,7 +1497,7 @@ static s32 brcmf_set_wpa_version(struct
- 	brcmf_dbg(CONN, "setting wpa_auth to 0x%0x\n", val);
- 	err = brcmf_fil_bsscfg_int_set(ifp, "wpa_auth", val);
- 	if (err) {
--		bphy_err(wiphy, "set wpa_auth failed (%d)\n", err);
-+		bphy_err(drvr, "set wpa_auth failed (%d)\n", err);
- 		return err;
- 	}
- 	sec = &profile->sec;
-@@ -1502,8 +1509,8 @@ static s32 brcmf_set_auth_type(struct ne
- 			       struct cfg80211_connect_params *sme)
- {
- 	struct brcmf_if *ifp = netdev_priv(ndev);
--	struct wiphy *wiphy = ifp->drvr->wiphy;
- 	struct brcmf_cfg80211_profile *profile = ndev_to_prof(ndev);
-+	struct brcmf_pub *drvr = ifp->drvr;
- 	struct brcmf_cfg80211_security *sec;
- 	s32 val = 0;
- 	s32 err = 0;
-@@ -1525,7 +1532,7 @@ static s32 brcmf_set_auth_type(struct ne
- 
- 	err = brcmf_fil_bsscfg_int_set(ifp, "auth", val);
- 	if (err) {
--		bphy_err(wiphy, "set auth failed (%d)\n", err);
-+		bphy_err(drvr, "set auth failed (%d)\n", err);
- 		return err;
- 	}
- 	sec = &profile->sec;
-@@ -1538,8 +1545,8 @@ brcmf_set_wsec_mode(struct net_device *n
- 		    struct cfg80211_connect_params *sme)
- {
- 	struct brcmf_if *ifp = netdev_priv(ndev);
--	struct wiphy *wiphy = ifp->drvr->wiphy;
- 	struct brcmf_cfg80211_profile *profile = ndev_to_prof(ndev);
-+	struct brcmf_pub *drvr = ifp->drvr;
- 	struct brcmf_cfg80211_security *sec;
- 	s32 pval = 0;
- 	s32 gval = 0;
-@@ -1562,7 +1569,7 @@ brcmf_set_wsec_mode(struct net_device *n
- 			pval = AES_ENABLED;
- 			break;
- 		default:
--			bphy_err(wiphy, "invalid cipher pairwise (%d)\n",
-+			bphy_err(drvr, "invalid cipher pairwise (%d)\n",
- 				 sme->crypto.ciphers_pairwise[0]);
- 			return -EINVAL;
- 		}
-@@ -1583,7 +1590,7 @@ brcmf_set_wsec_mode(struct net_device *n
- 			gval = AES_ENABLED;
- 			break;
- 		default:
--			bphy_err(wiphy, "invalid cipher group (%d)\n",
-+			bphy_err(drvr, "invalid cipher group (%d)\n",
- 				 sme->crypto.cipher_group);
- 			return -EINVAL;
- 		}
-@@ -1599,7 +1606,7 @@ brcmf_set_wsec_mode(struct net_device *n
- 	wsec = pval | gval;
- 	err = brcmf_fil_bsscfg_int_set(ifp, "wsec", wsec);
- 	if (err) {
--		bphy_err(wiphy, "error (%d)\n", err);
-+		bphy_err(drvr, "error (%d)\n", err);
- 		return err;
- 	}
- 
-@@ -1614,8 +1621,8 @@ static s32
- brcmf_set_key_mgmt(struct net_device *ndev, struct cfg80211_connect_params *sme)
- {
- 	struct brcmf_if *ifp = netdev_priv(ndev);
--	struct wiphy *wiphy = ifp->drvr->wiphy;
- 	struct brcmf_cfg80211_profile *profile = &ifp->vif->profile;
-+	struct brcmf_pub *drvr = ifp->drvr;
- 	s32 val;
- 	s32 err;
- 	const struct brcmf_tlv *rsn_ie;
-@@ -1633,7 +1640,7 @@ brcmf_set_key_mgmt(struct net_device *nd
- 
- 	err = brcmf_fil_bsscfg_int_get(netdev_priv(ndev), "wpa_auth", &val);
- 	if (err) {
--		bphy_err(wiphy, "could not get wpa_auth (%d)\n", err);
-+		bphy_err(drvr, "could not get wpa_auth (%d)\n", err);
- 		return err;
- 	}
- 	if (val & (WPA_AUTH_PSK | WPA_AUTH_UNSPECIFIED)) {
-@@ -1647,7 +1654,7 @@ brcmf_set_key_mgmt(struct net_device *nd
- 			val = WPA_AUTH_PSK;
- 			break;
- 		default:
--			bphy_err(wiphy, "invalid cipher group (%d)\n",
-+			bphy_err(drvr, "invalid cipher group (%d)\n",
- 				 sme->crypto.cipher_group);
- 			return -EINVAL;
- 		}
-@@ -1670,7 +1677,7 @@ brcmf_set_key_mgmt(struct net_device *nd
- 			val = WPA2_AUTH_PSK;
- 			break;
- 		default:
--			bphy_err(wiphy, "invalid cipher group (%d)\n",
-+			bphy_err(drvr, "invalid cipher group (%d)\n",
- 				 sme->crypto.cipher_group);
- 			return -EINVAL;
- 		}
-@@ -1717,7 +1724,7 @@ skip_mfp_config:
- 	brcmf_dbg(CONN, "setting wpa_auth to %d\n", val);
- 	err = brcmf_fil_bsscfg_int_set(netdev_priv(ndev), "wpa_auth", val);
- 	if (err) {
--		bphy_err(wiphy, "could not set wpa_auth (%d)\n", err);
-+		bphy_err(drvr, "could not set wpa_auth (%d)\n", err);
- 		return err;
- 	}
- 
-@@ -1729,7 +1736,7 @@ brcmf_set_sharedkey(struct net_device *n
- 		    struct cfg80211_connect_params *sme)
- {
- 	struct brcmf_if *ifp = netdev_priv(ndev);
--	struct wiphy *wiphy = ifp->drvr->wiphy;
-+	struct brcmf_pub *drvr = ifp->drvr;
- 	struct brcmf_cfg80211_profile *profile = ndev_to_prof(ndev);
- 	struct brcmf_cfg80211_security *sec;
- 	struct brcmf_wsec_key key;
-@@ -1756,7 +1763,7 @@ brcmf_set_sharedkey(struct net_device *n
- 	key.len = (u32) sme->key_len;
- 	key.index = (u32) sme->key_idx;
- 	if (key.len > sizeof(key.data)) {
--		bphy_err(wiphy, "Too long key length (%u)\n", key.len);
-+		bphy_err(drvr, "Too long key length (%u)\n", key.len);
- 		return -EINVAL;
- 	}
- 	memcpy(key.data, sme->key, key.len);
-@@ -1769,7 +1776,7 @@ brcmf_set_sharedkey(struct net_device *n
- 		key.algo = CRYPTO_ALGO_WEP128;
- 		break;
- 	default:
--		bphy_err(wiphy, "Invalid algorithm (%d)\n",
-+		bphy_err(drvr, "Invalid algorithm (%d)\n",
- 			 sme->crypto.ciphers_pairwise[0]);
- 		return -EINVAL;
- 	}
-@@ -1786,7 +1793,7 @@ brcmf_set_sharedkey(struct net_device *n
- 		val = WL_AUTH_SHARED_KEY;	/* shared key */
- 		err = brcmf_fil_bsscfg_int_set(ifp, "auth", val);
- 		if (err)
--			bphy_err(wiphy, "set auth failed (%d)\n", err);
-+			bphy_err(drvr, "set auth failed (%d)\n", err);
- 	}
- 	return err;
- }
-@@ -1806,7 +1813,7 @@ enum nl80211_auth_type brcmf_war_auth_ty
- static void brcmf_set_join_pref(struct brcmf_if *ifp,
- 				struct cfg80211_bss_selection *bss_select)
- {
--	struct wiphy *wiphy = ifp->drvr->wiphy;
-+	struct brcmf_pub *drvr = ifp->drvr;
- 	struct brcmf_join_pref_params join_pref_params[2];
- 	enum nl80211_band band;
- 	int err, i = 0;
-@@ -1845,7 +1852,7 @@ static void brcmf_set_join_pref(struct b
- 	err = brcmf_fil_iovar_data_set(ifp, "join_pref", join_pref_params,
- 				       sizeof(join_pref_params));
- 	if (err)
--		bphy_err(wiphy, "Set join_pref error (%d)\n", err);
-+		bphy_err(drvr, "Set join_pref error (%d)\n", err);
- }
- 
- static s32
-@@ -1856,6 +1863,7 @@ brcmf_cfg80211_connect(struct wiphy *wip
- 	struct brcmf_if *ifp = netdev_priv(ndev);
- 	struct brcmf_cfg80211_profile *profile = &ifp->vif->profile;
- 	struct ieee80211_channel *chan = sme->channel;
-+	struct brcmf_pub *drvr = ifp->drvr;
- 	struct brcmf_join_params join_params;
- 	size_t join_params_size;
- 	const struct brcmf_tlv *rsn_ie;
-@@ -1872,7 +1880,7 @@ brcmf_cfg80211_connect(struct wiphy *wip
- 		return -EIO;
- 
- 	if (!sme->ssid) {
--		bphy_err(wiphy, "Invalid ssid\n");
-+		bphy_err(drvr, "Invalid ssid\n");
- 		return -EOPNOTSUPP;
- 	}
- 
-@@ -1901,7 +1909,7 @@ brcmf_cfg80211_connect(struct wiphy *wip
- 	err = brcmf_vif_set_mgmt_ie(ifp->vif, BRCMF_VNDR_IE_ASSOCREQ_FLAG,
- 				    sme->ie, sme->ie_len);
- 	if (err)
--		bphy_err(wiphy, "Set Assoc REQ IE Failed\n");
-+		bphy_err(drvr, "Set Assoc REQ IE Failed\n");
- 	else
- 		brcmf_dbg(TRACE, "Applied Vndr IEs for Assoc request\n");
- 
-@@ -1922,32 +1930,32 @@ brcmf_cfg80211_connect(struct wiphy *wip
- 
- 	err = brcmf_set_wpa_version(ndev, sme);
- 	if (err) {
--		bphy_err(wiphy, "wl_set_wpa_version failed (%d)\n", err);
-+		bphy_err(drvr, "wl_set_wpa_version failed (%d)\n", err);
- 		goto done;
- 	}
- 
- 	sme->auth_type = brcmf_war_auth_type(ifp, sme->auth_type);
- 	err = brcmf_set_auth_type(ndev, sme);
- 	if (err) {
--		bphy_err(wiphy, "wl_set_auth_type failed (%d)\n", err);
-+		bphy_err(drvr, "wl_set_auth_type failed (%d)\n", err);
- 		goto done;
- 	}
- 
- 	err = brcmf_set_wsec_mode(ndev, sme);
- 	if (err) {
--		bphy_err(wiphy, "wl_set_set_cipher failed (%d)\n", err);
-+		bphy_err(drvr, "wl_set_set_cipher failed (%d)\n", err);
- 		goto done;
- 	}
- 
- 	err = brcmf_set_key_mgmt(ndev, sme);
- 	if (err) {
--		bphy_err(wiphy, "wl_set_key_mgmt failed (%d)\n", err);
-+		bphy_err(drvr, "wl_set_key_mgmt failed (%d)\n", err);
- 		goto done;
- 	}
- 
- 	err = brcmf_set_sharedkey(ndev, sme);
- 	if (err) {
--		bphy_err(wiphy, "brcmf_set_sharedkey failed (%d)\n", err);
-+		bphy_err(drvr, "brcmf_set_sharedkey failed (%d)\n", err);
- 		goto done;
- 	}
- 
-@@ -1964,7 +1972,7 @@ brcmf_cfg80211_connect(struct wiphy *wip
- 		/* enable firmware supplicant for this interface */
- 		err = brcmf_fil_iovar_int_set(ifp, "sup_wpa", 1);
- 		if (err < 0) {
--			bphy_err(wiphy, "failed to enable fw supplicant\n");
-+			bphy_err(drvr, "failed to enable fw supplicant\n");
- 			goto done;
- 		}
- 	}
-@@ -2059,7 +2067,7 @@ brcmf_cfg80211_connect(struct wiphy *wip
- 	err = brcmf_fil_cmd_data_set(ifp, BRCMF_C_SET_SSID,
- 				     &join_params, join_params_size);
- 	if (err)
--		bphy_err(wiphy, "BRCMF_C_SET_SSID failed (%d)\n", err);
-+		bphy_err(drvr, "BRCMF_C_SET_SSID failed (%d)\n", err);
- 
- done:
- 	if (err)
-@@ -2072,8 +2080,10 @@ static s32
- brcmf_cfg80211_disconnect(struct wiphy *wiphy, struct net_device *ndev,
- 		       u16 reason_code)
- {
-+	struct brcmf_cfg80211_info *cfg = wiphy_to_cfg(wiphy);
- 	struct brcmf_if *ifp = netdev_priv(ndev);
- 	struct brcmf_cfg80211_profile *profile = &ifp->vif->profile;
-+	struct brcmf_pub *drvr = cfg->pub;
- 	struct brcmf_scb_val_le scbval;
- 	s32 err = 0;
- 
-@@ -2090,7 +2100,7 @@ brcmf_cfg80211_disconnect(struct wiphy *
- 	err = brcmf_fil_cmd_data_set(ifp, BRCMF_C_DISASSOC,
- 				     &scbval, sizeof(scbval));
- 	if (err)
--		bphy_err(wiphy, "error (%d)\n", err);
-+		bphy_err(drvr, "error (%d)\n", err);
- 
- 	brcmf_dbg(TRACE, "Exit\n");
- 	return err;
-@@ -2103,6 +2113,7 @@ brcmf_cfg80211_set_tx_power(struct wiphy
- 	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_pub *drvr = cfg->pub;
- 	s32 err;
- 	s32 disable;
- 	u32 qdbm = 127;
-@@ -2117,7 +2128,7 @@ brcmf_cfg80211_set_tx_power(struct wiphy
- 	case NL80211_TX_POWER_LIMITED:
- 	case NL80211_TX_POWER_FIXED:
- 		if (mbm < 0) {
--			bphy_err(wiphy, "TX_POWER_FIXED - dbm is negative\n");
-+			bphy_err(drvr, "TX_POWER_FIXED - dbm is negative\n");
- 			err = -EINVAL;
- 			goto done;
- 		}
-@@ -2127,7 +2138,7 @@ brcmf_cfg80211_set_tx_power(struct wiphy
- 		qdbm |= WL_TXPWR_OVERRIDE;
- 		break;
- 	default:
--		bphy_err(wiphy, "Unsupported type %d\n", type);
-+		bphy_err(drvr, "Unsupported type %d\n", type);
- 		err = -EINVAL;
- 		goto done;
- 	}
-@@ -2135,11 +2146,11 @@ brcmf_cfg80211_set_tx_power(struct wiphy
- 	disable = WL_RADIO_SW_DISABLE << 16;
- 	err = brcmf_fil_cmd_int_set(ifp, BRCMF_C_SET_RADIO, disable);
- 	if (err)
--		bphy_err(wiphy, "WLC_SET_RADIO error (%d)\n", err);
-+		bphy_err(drvr, "WLC_SET_RADIO error (%d)\n", err);
- 
- 	err = brcmf_fil_iovar_int_set(ifp, "qtxpower", qdbm);
- 	if (err)
--		bphy_err(wiphy, "qtxpower error (%d)\n", err);
-+		bphy_err(drvr, "qtxpower error (%d)\n", err);
- 
- done:
- 	brcmf_dbg(TRACE, "Exit %d (qdbm)\n", qdbm & ~WL_TXPWR_OVERRIDE);
-@@ -2150,7 +2161,9 @@ 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 brcmf_cfg80211_vif *vif = wdev_to_vif(wdev);
-+	struct brcmf_pub *drvr = cfg->pub;
- 	s32 qdbm = 0;
- 	s32 err;
- 
-@@ -2160,7 +2173,7 @@ brcmf_cfg80211_get_tx_power(struct wiphy
- 
- 	err = brcmf_fil_iovar_int_get(vif->ifp, "qtxpower", &qdbm);
- 	if (err) {
--		bphy_err(wiphy, "error (%d)\n", err);
-+		bphy_err(drvr, "error (%d)\n", err);
- 		goto done;
- 	}
- 	*dbm = (qdbm & ~WL_TXPWR_OVERRIDE) / 4;
-@@ -2175,6 +2188,7 @@ brcmf_cfg80211_config_default_key(struct
- 				  u8 key_idx, bool unicast, bool multicast)
- {
- 	struct brcmf_if *ifp = netdev_priv(ndev);
-+	struct brcmf_pub *drvr = ifp->drvr;
- 	u32 index;
- 	u32 wsec;
- 	s32 err = 0;
-@@ -2186,7 +2200,7 @@ brcmf_cfg80211_config_default_key(struct
- 
- 	err = brcmf_fil_bsscfg_int_get(ifp, "wsec", &wsec);
- 	if (err) {
--		bphy_err(wiphy, "WLC_GET_WSEC error (%d)\n", err);
-+		bphy_err(drvr, "WLC_GET_WSEC error (%d)\n", err);
- 		goto done;
- 	}
- 
-@@ -2196,7 +2210,7 @@ brcmf_cfg80211_config_default_key(struct
- 		err = brcmf_fil_cmd_int_set(ifp,
- 					    BRCMF_C_SET_KEY_PRIMARY, index);
- 		if (err)
--			bphy_err(wiphy, "error (%d)\n", err);
-+			bphy_err(drvr, "error (%d)\n", err);
- 	}
- done:
- 	brcmf_dbg(TRACE, "Exit\n");
-@@ -2245,7 +2259,9 @@ brcmf_cfg80211_add_key(struct wiphy *wip
- 		       u8 key_idx, bool pairwise, const u8 *mac_addr,
- 		       struct key_params *params)
- {
-+	struct brcmf_cfg80211_info *cfg = wiphy_to_cfg(wiphy);
- 	struct brcmf_if *ifp = netdev_priv(ndev);
-+	struct brcmf_pub *drvr = cfg->pub;
- 	struct brcmf_wsec_key *key;
- 	s32 val;
- 	s32 wsec;
-@@ -2260,7 +2276,7 @@ brcmf_cfg80211_add_key(struct wiphy *wip
- 
- 	if (key_idx >= BRCMF_MAX_DEFAULT_KEYS) {
- 		/* we ignore this key index in this case */
--		bphy_err(wiphy, "invalid key index (%d)\n", key_idx);
-+		bphy_err(drvr, "invalid key index (%d)\n", key_idx);
- 		return -EINVAL;
- 	}
- 
-@@ -2269,7 +2285,7 @@ brcmf_cfg80211_add_key(struct wiphy *wip
- 					      mac_addr);
- 
- 	if (params->key_len > sizeof(key->data)) {
--		bphy_err(wiphy, "Too long key length (%u)\n", params->key_len);
-+		bphy_err(drvr, "Too long key length (%u)\n", params->key_len);
- 		return -EINVAL;
- 	}
- 
-@@ -2323,7 +2339,7 @@ brcmf_cfg80211_add_key(struct wiphy *wip
- 		brcmf_dbg(CONN, "WLAN_CIPHER_SUITE_CCMP\n");
- 		break;
- 	default:
--		bphy_err(wiphy, "Invalid cipher (0x%x)\n", params->cipher);
-+		bphy_err(drvr, "Invalid cipher (0x%x)\n", params->cipher);
- 		err = -EINVAL;
- 		goto done;
- 	}
-@@ -2334,13 +2350,13 @@ brcmf_cfg80211_add_key(struct wiphy *wip
- 
- 	err = brcmf_fil_bsscfg_int_get(ifp, "wsec", &wsec);
- 	if (err) {
--		bphy_err(wiphy, "get wsec error (%d)\n", err);
-+		bphy_err(drvr, "get wsec error (%d)\n", err);
- 		goto done;
- 	}
- 	wsec |= val;
- 	err = brcmf_fil_bsscfg_int_set(ifp, "wsec", wsec);
- 	if (err) {
--		bphy_err(wiphy, "set wsec error (%d)\n", err);
-+		bphy_err(drvr, "set wsec error (%d)\n", err);
- 		goto done;
- 	}
- 
-@@ -2355,9 +2371,11 @@ brcmf_cfg80211_get_key(struct wiphy *wip
- 		       void (*callback)(void *cookie,
- 					struct key_params *params))
- {
-+	struct brcmf_cfg80211_info *cfg = wiphy_to_cfg(wiphy);
- 	struct key_params params;
- 	struct brcmf_if *ifp = netdev_priv(ndev);
- 	struct brcmf_cfg80211_profile *profile = &ifp->vif->profile;
-+	struct brcmf_pub *drvr = cfg->pub;
- 	struct brcmf_cfg80211_security *sec;
- 	s32 wsec;
- 	s32 err = 0;
-@@ -2371,7 +2389,7 @@ brcmf_cfg80211_get_key(struct wiphy *wip
- 
- 	err = brcmf_fil_bsscfg_int_get(ifp, "wsec", &wsec);
- 	if (err) {
--		bphy_err(wiphy, "WLC_GET_WSEC error (%d)\n", err);
-+		bphy_err(drvr, "WLC_GET_WSEC error (%d)\n", err);
- 		/* Ignore this error, may happen during DISASSOC */
- 		err = -EAGAIN;
- 		goto done;
-@@ -2392,7 +2410,7 @@ brcmf_cfg80211_get_key(struct wiphy *wip
- 		params.cipher = WLAN_CIPHER_SUITE_AES_CMAC;
- 		brcmf_dbg(CONN, "WLAN_CIPHER_SUITE_AES_CMAC\n");
- 	} else  {
--		bphy_err(wiphy, "Invalid algo (0x%x)\n", wsec);
-+		bphy_err(drvr, "Invalid algo (0x%x)\n", wsec);
- 		err = -EINVAL;
- 		goto done;
- 	}
-@@ -2422,7 +2440,7 @@ brcmf_cfg80211_config_default_mgmt_key(s
- static void
- brcmf_cfg80211_reconfigure_wep(struct brcmf_if *ifp)
- {
--	struct wiphy *wiphy = ifp->drvr->wiphy;
-+	struct brcmf_pub *drvr = ifp->drvr;
- 	s32 err;
- 	u8 key_idx;
- 	struct brcmf_wsec_key *key;
-@@ -2439,18 +2457,18 @@ brcmf_cfg80211_reconfigure_wep(struct br
- 
- 	err = send_key_to_dongle(ifp, key);
- 	if (err) {
--		bphy_err(wiphy, "Setting WEP key failed (%d)\n", err);
-+		bphy_err(drvr, "Setting WEP key failed (%d)\n", err);
- 		return;
- 	}
- 	err = brcmf_fil_bsscfg_int_get(ifp, "wsec", &wsec);
- 	if (err) {
--		bphy_err(wiphy, "get wsec error (%d)\n", err);
-+		bphy_err(drvr, "get wsec error (%d)\n", err);
- 		return;
- 	}
- 	wsec |= WEP_ENABLED;
- 	err = brcmf_fil_bsscfg_int_set(ifp, "wsec", wsec);
- 	if (err)
--		bphy_err(wiphy, "set wsec error (%d)\n", err);
-+		bphy_err(drvr, "set wsec error (%d)\n", err);
- }
- 
- static void brcmf_convert_sta_flags(u32 fw_sta_flags, struct station_info *si)
-@@ -2476,7 +2494,7 @@ static void brcmf_convert_sta_flags(u32
- 
- static void brcmf_fill_bss_param(struct brcmf_if *ifp, struct station_info *si)
- {
--	struct wiphy *wiphy = ifp->drvr->wiphy;
-+	struct brcmf_pub *drvr = ifp->drvr;
- 	struct {
- 		__le32 len;
- 		struct brcmf_bss_info_le bss_le;
-@@ -2492,7 +2510,7 @@ static void brcmf_fill_bss_param(struct
- 	err = brcmf_fil_cmd_data_get(ifp, BRCMF_C_GET_BSS_INFO, buf,
- 				     WL_BSS_INFO_MAX);
- 	if (err) {
--		bphy_err(wiphy, "Failed to get bss info (%d)\n", err);
-+		bphy_err(drvr, "Failed to get bss info (%d)\n", err);
- 		goto out_kfree;
- 	}
- 	si->filled |= BIT_ULL(NL80211_STA_INFO_BSS_PARAM);
-@@ -2514,7 +2532,7 @@ static s32
- brcmf_cfg80211_get_station_ibss(struct brcmf_if *ifp,
- 				struct station_info *sinfo)
- {
--	struct wiphy *wiphy = ifp->drvr->wiphy;
-+	struct brcmf_pub *drvr = ifp->drvr;
- 	struct brcmf_scb_val_le scbval;
- 	struct brcmf_pktcnt_le pktcnt;
- 	s32 err;
-@@ -2524,7 +2542,7 @@ brcmf_cfg80211_get_station_ibss(struct b
- 	/* Get the current tx rate */
- 	err = brcmf_fil_cmd_int_get(ifp, BRCMF_C_GET_RATE, &rate);
- 	if (err < 0) {
--		bphy_err(wiphy, "BRCMF_C_GET_RATE error (%d)\n", err);
-+		bphy_err(drvr, "BRCMF_C_GET_RATE error (%d)\n", err);
- 		return err;
- 	}
- 	sinfo->filled |= BIT_ULL(NL80211_STA_INFO_TX_BITRATE);
-@@ -2534,7 +2552,7 @@ brcmf_cfg80211_get_station_ibss(struct b
- 	err = brcmf_fil_cmd_data_get(ifp, BRCMF_C_GET_RSSI, &scbval,
- 				     sizeof(scbval));
- 	if (err) {
--		bphy_err(wiphy, "BRCMF_C_GET_RSSI error (%d)\n", err);
-+		bphy_err(drvr, "BRCMF_C_GET_RSSI error (%d)\n", err);
- 		return err;
- 	}
- 	rssi = le32_to_cpu(scbval.val);
-@@ -2544,7 +2562,7 @@ brcmf_cfg80211_get_station_ibss(struct b
- 	err = brcmf_fil_cmd_data_get(ifp, BRCMF_C_GET_GET_PKTCNTS, &pktcnt,
- 				     sizeof(pktcnt));
- 	if (err) {
--		bphy_err(wiphy, "BRCMF_C_GET_GET_PKTCNTS error (%d)\n", err);
-+		bphy_err(drvr, "BRCMF_C_GET_GET_PKTCNTS error (%d)\n", err);
- 		return err;
- 	}
- 	sinfo->filled |= BIT_ULL(NL80211_STA_INFO_RX_PACKETS) |
-@@ -2563,7 +2581,9 @@ static s32
- brcmf_cfg80211_get_station(struct wiphy *wiphy, struct net_device *ndev,
- 			   const u8 *mac, struct station_info *sinfo)
- {
-+	struct brcmf_cfg80211_info *cfg = wiphy_to_cfg(wiphy);
- 	struct brcmf_if *ifp = netdev_priv(ndev);
-+	struct brcmf_pub *drvr = cfg->pub;
- 	struct brcmf_scb_val_le scb_val;
- 	s32 err = 0;
- 	struct brcmf_sta_info_le sta_info_le;
-@@ -2592,7 +2612,7 @@ brcmf_cfg80211_get_station(struct wiphy
- 					       &sta_info_le,
- 					       sizeof(sta_info_le));
- 		if (err < 0) {
--			bphy_err(wiphy, "GET STA INFO failed, %d\n", err);
-+			bphy_err(drvr, "GET STA INFO failed, %d\n", err);
- 			goto done;
- 		}
- 	}
-@@ -2661,7 +2681,7 @@ brcmf_cfg80211_get_station(struct wiphy
- 			err = brcmf_fil_cmd_data_get(ifp, BRCMF_C_GET_RSSI,
- 						     &scb_val, sizeof(scb_val));
- 			if (err) {
--				bphy_err(wiphy, "Could not get rssi (%d)\n",
-+				bphy_err(drvr, "Could not get rssi (%d)\n",
- 					 err);
- 				goto done;
- 			} else {
-@@ -2683,6 +2703,7 @@ brcmf_cfg80211_dump_station(struct wiphy
- {
- 	struct brcmf_cfg80211_info *cfg = wiphy_to_cfg(wiphy);
- 	struct brcmf_if *ifp = netdev_priv(ndev);
-+	struct brcmf_pub *drvr = cfg->pub;
- 	s32 err;
- 
- 	brcmf_dbg(TRACE, "Enter, idx %d\n", idx);
-@@ -2693,7 +2714,7 @@ brcmf_cfg80211_dump_station(struct wiphy
- 					     &cfg->assoclist,
- 					     sizeof(cfg->assoclist));
- 		if (err) {
--			bphy_err(wiphy, "BRCMF_C_GET_ASSOCLIST unsupported, err=%d\n",
-+			bphy_err(drvr, "BRCMF_C_GET_ASSOCLIST unsupported, err=%d\n",
- 				 err);
- 			cfg->assoclist.count = 0;
- 			return -EOPNOTSUPP;
-@@ -2714,6 +2735,7 @@ brcmf_cfg80211_set_power_mgmt(struct wip
- 	s32 err = 0;
- 	struct brcmf_cfg80211_info *cfg = wiphy_to_cfg(wiphy);
- 	struct brcmf_if *ifp = netdev_priv(ndev);
-+	struct brcmf_pub *drvr = cfg->pub;
- 
- 	brcmf_dbg(TRACE, "Enter\n");
- 
-@@ -2742,9 +2764,9 @@ brcmf_cfg80211_set_power_mgmt(struct wip
- 	err = brcmf_fil_cmd_int_set(ifp, BRCMF_C_SET_PM, pm);
- 	if (err) {
- 		if (err == -ENODEV)
--			bphy_err(wiphy, "net_device is not ready yet\n");
-+			bphy_err(drvr, "net_device is not ready yet\n");
- 		else
--			bphy_err(wiphy, "error (%d)\n", err);
-+			bphy_err(drvr, "error (%d)\n", err);
- 	}
- done:
- 	brcmf_dbg(TRACE, "Exit\n");
-@@ -2755,6 +2777,7 @@ static s32 brcmf_inform_single_bss(struc
- 				   struct brcmf_bss_info_le *bi)
- {
- 	struct wiphy *wiphy = cfg_to_wiphy(cfg);
-+	struct brcmf_pub *drvr = cfg->pub;
- 	struct cfg80211_bss *bss;
- 	enum nl80211_band band;
- 	struct brcmu_chan ch;
-@@ -2767,7 +2790,7 @@ static s32 brcmf_inform_single_bss(struc
- 	struct cfg80211_inform_bss bss_data = {};
- 
- 	if (le32_to_cpu(bi->length) > WL_BSS_INFO_MAX) {
--		bphy_err(wiphy, "Bss info is larger than buffer. Discarding\n");
-+		bphy_err(drvr, "Bss info is larger than buffer. Discarding\n");
- 		return 0;
- 	}
- 
-@@ -2826,7 +2849,7 @@ next_bss_le(struct brcmf_scan_results *l
- 
- static s32 brcmf_inform_bss(struct brcmf_cfg80211_info *cfg)
- {
--	struct wiphy *wiphy = cfg_to_wiphy(cfg);
-+	struct brcmf_pub *drvr = cfg->pub;
- 	struct brcmf_scan_results *bss_list;
- 	struct brcmf_bss_info_le *bi = NULL;	/* must be initialized */
- 	s32 err = 0;
-@@ -2835,7 +2858,7 @@ static s32 brcmf_inform_bss(struct brcmf
- 	bss_list = (struct brcmf_scan_results *)cfg->escan_info.escan_buf;
- 	if (bss_list->count != 0 &&
- 	    bss_list->version != BRCMF_BSS_INFO_VERSION) {
--		bphy_err(wiphy, "Version %d != WL_BSS_INFO_VERSION\n",
-+		bphy_err(drvr, "Version %d != WL_BSS_INFO_VERSION\n",
- 			 bss_list->version);
- 		return -EOPNOTSUPP;
- 	}
-@@ -2853,6 +2876,7 @@ static s32 brcmf_inform_ibss(struct brcm
- 			     struct net_device *ndev, const u8 *bssid)
- {
- 	struct wiphy *wiphy = cfg_to_wiphy(cfg);
-+	struct brcmf_pub *drvr = cfg->pub;
- 	struct ieee80211_channel *notify_channel;
- 	struct brcmf_bss_info_le *bi = NULL;
- 	struct ieee80211_supported_band *band;
-@@ -2880,7 +2904,7 @@ static s32 brcmf_inform_ibss(struct brcm
- 	err = brcmf_fil_cmd_data_get(netdev_priv(ndev), BRCMF_C_GET_BSS_INFO,
- 				     buf, WL_BSS_INFO_MAX);
- 	if (err) {
--		bphy_err(wiphy, "WLC_GET_BSS_INFO failed: %d\n", err);
-+		bphy_err(drvr, "WLC_GET_BSS_INFO failed: %d\n", err);
- 		goto CleanUp;
- 	}
- 
-@@ -2934,7 +2958,7 @@ CleanUp:
- static s32 brcmf_update_bss_info(struct brcmf_cfg80211_info *cfg,
- 				 struct brcmf_if *ifp)
- {
--	struct wiphy *wiphy = cfg_to_wiphy(cfg);
-+	struct brcmf_pub *drvr = cfg->pub;
- 	struct brcmf_bss_info_le *bi;
- 	const struct brcmf_tlv *tim;
- 	u16 beacon_interval;
-@@ -2951,7 +2975,7 @@ static s32 brcmf_update_bss_info(struct
- 	err = brcmf_fil_cmd_data_get(ifp, BRCMF_C_GET_BSS_INFO,
- 				     cfg->extra_buf, WL_EXTRA_BUF_MAX);
- 	if (err) {
--		bphy_err(wiphy, "Could not get bss info %d\n", err);
-+		bphy_err(drvr, "Could not get bss info %d\n", err);
- 		goto update_bss_info_out;
- 	}
- 
-@@ -2976,7 +3000,7 @@ static s32 brcmf_update_bss_info(struct
- 		u32 var;
- 		err = brcmf_fil_iovar_int_get(ifp, "dtim_assoc", &var);
- 		if (err) {
--			bphy_err(wiphy, "wl dtim_assoc failed (%d)\n", err);
-+			bphy_err(drvr, "wl dtim_assoc failed (%d)\n", err);
- 			goto update_bss_info_out;
- 		}
- 		dtim_period = (u8)var;
-@@ -3014,10 +3038,10 @@ static void brcmf_escan_timeout(struct t
- {
- 	struct brcmf_cfg80211_info *cfg =
- 			from_timer(cfg, t, escan_timeout);
--	struct wiphy *wiphy = cfg_to_wiphy(cfg);
-+	struct brcmf_pub *drvr = cfg->pub;
- 
- 	if (cfg->int_escan_map || cfg->scan_request) {
--		bphy_err(wiphy, "timer expired\n");
-+		bphy_err(drvr, "timer expired\n");
- 		schedule_work(&cfg->escan_timeout_work);
- 	}
- }
-@@ -3065,8 +3089,8 @@ static s32
- brcmf_cfg80211_escan_handler(struct brcmf_if *ifp,
- 			     const struct brcmf_event_msg *e, void *data)
- {
--	struct brcmf_cfg80211_info *cfg = ifp->drvr->config;
--	struct wiphy *wiphy = cfg_to_wiphy(cfg);
-+	struct brcmf_pub *drvr = ifp->drvr;
-+	struct brcmf_cfg80211_info *cfg = drvr->config;
- 	s32 status;
- 	struct brcmf_escan_result_le *escan_result_le;
- 	u32 escan_buflen;
-@@ -3083,7 +3107,7 @@ brcmf_cfg80211_escan_handler(struct brcm
- 		goto exit;
- 
- 	if (!test_bit(BRCMF_SCAN_STATUS_BUSY, &cfg->scan_status)) {
--		bphy_err(wiphy, "scan not ready, bsscfgidx=%d\n",
-+		bphy_err(drvr, "scan not ready, bsscfgidx=%d\n",
- 			 ifp->bsscfgidx);
- 		return -EPERM;
- 	}
-@@ -3091,24 +3115,24 @@ brcmf_cfg80211_escan_handler(struct brcm
- 	if (status == BRCMF_E_STATUS_PARTIAL) {
- 		brcmf_dbg(SCAN, "ESCAN Partial result\n");
- 		if (e->datalen < sizeof(*escan_result_le)) {
--			bphy_err(wiphy, "invalid event data length\n");
-+			bphy_err(drvr, "invalid event data length\n");
- 			goto exit;
- 		}
- 		escan_result_le = (struct brcmf_escan_result_le *) data;
- 		if (!escan_result_le) {
--			bphy_err(wiphy, "Invalid escan result (NULL pointer)\n");
-+			bphy_err(drvr, "Invalid escan result (NULL pointer)\n");
- 			goto exit;
- 		}
- 		escan_buflen = le32_to_cpu(escan_result_le->buflen);
- 		if (escan_buflen > BRCMF_ESCAN_BUF_SIZE ||
- 		    escan_buflen > e->datalen ||
- 		    escan_buflen < sizeof(*escan_result_le)) {
--			bphy_err(wiphy, "Invalid escan buffer length: %d\n",
-+			bphy_err(drvr, "Invalid escan buffer length: %d\n",
- 				 escan_buflen);
- 			goto exit;
- 		}
- 		if (le16_to_cpu(escan_result_le->bss_count) != 1) {
--			bphy_err(wiphy, "Invalid bss_count %d: ignoring\n",
-+			bphy_err(drvr, "Invalid bss_count %d: ignoring\n",
- 				 escan_result_le->bss_count);
- 			goto exit;
- 		}
-@@ -3124,7 +3148,7 @@ brcmf_cfg80211_escan_handler(struct brcm
- 
- 		bi_length = le32_to_cpu(bss_info_le->length);
- 		if (bi_length != escan_buflen -	WL_ESCAN_RESULTS_FIXED_SIZE) {
--			bphy_err(wiphy, "Ignoring invalid bss_info length: %d\n",
-+			bphy_err(drvr, "Ignoring invalid bss_info length: %d\n",
- 				 bi_length);
- 			goto exit;
- 		}
-@@ -3133,7 +3157,7 @@ brcmf_cfg80211_escan_handler(struct brcm
- 					BIT(NL80211_IFTYPE_ADHOC))) {
- 			if (le16_to_cpu(bss_info_le->capability) &
- 						WLAN_CAPABILITY_IBSS) {
--				bphy_err(wiphy, "Ignoring IBSS result\n");
-+				bphy_err(drvr, "Ignoring IBSS result\n");
- 				goto exit;
- 			}
- 		}
-@@ -3141,7 +3165,7 @@ brcmf_cfg80211_escan_handler(struct brcm
- 		list = (struct brcmf_scan_results *)
- 				cfg->escan_info.escan_buf;
- 		if (bi_length > BRCMF_ESCAN_BUF_SIZE - list->buflen) {
--			bphy_err(wiphy, "Buffer is too small: ignoring\n");
-+			bphy_err(drvr, "Buffer is too small: ignoring\n");
- 			goto exit;
- 		}
- 
-@@ -3300,7 +3324,8 @@ static s32
- brcmf_notify_sched_scan_results(struct brcmf_if *ifp,
- 				const struct brcmf_event_msg *e, void *data)
- {
--	struct brcmf_cfg80211_info *cfg = ifp->drvr->config;
-+	struct brcmf_pub *drvr = ifp->drvr;
-+	struct brcmf_cfg80211_info *cfg = drvr->config;
- 	struct brcmf_pno_net_info_le *netinfo, *netinfo_start;
- 	struct cfg80211_scan_request *request = NULL;
- 	struct wiphy *wiphy = cfg_to_wiphy(cfg);
-@@ -3333,14 +3358,14 @@ brcmf_notify_sched_scan_results(struct b
- 	WARN_ON(status != BRCMF_PNO_SCAN_COMPLETE);
- 	brcmf_dbg(SCAN, "PFN NET FOUND event. count: %d\n", result_count);
- 	if (!result_count) {
--		bphy_err(wiphy, "FALSE PNO Event. (pfn_count == 0)\n");
-+		bphy_err(drvr, "FALSE PNO Event. (pfn_count == 0)\n");
- 		goto out_err;
- 	}
- 
- 	netinfo_start = brcmf_get_netinfo_array(pfn_result);
- 	datalen = e->datalen - ((void *)netinfo_start - (void *)pfn_result);
- 	if (datalen < result_count * sizeof(*netinfo)) {
--		bphy_err(wiphy, "insufficient event data\n");
-+		bphy_err(drvr, "insufficient event data\n");
- 		goto out_err;
- 	}
- 
-@@ -3387,14 +3412,15 @@ brcmf_cfg80211_sched_scan_start(struct w
- 				struct net_device *ndev,
- 				struct cfg80211_sched_scan_request *req)
- {
--	struct brcmf_if *ifp = netdev_priv(ndev);
- 	struct brcmf_cfg80211_info *cfg = wiphy_to_cfg(wiphy);
-+	struct brcmf_if *ifp = netdev_priv(ndev);
-+	struct brcmf_pub *drvr = cfg->pub;
- 
- 	brcmf_dbg(SCAN, "Enter: n_match_sets=%d n_ssids=%d\n",
- 		  req->n_match_sets, req->n_ssids);
- 
- 	if (test_bit(BRCMF_SCAN_STATUS_SUPPRESS, &cfg->scan_status)) {
--		bphy_err(wiphy, "Scanning suppressed: status=%lu\n",
-+		bphy_err(drvr, "Scanning suppressed: status=%lu\n",
- 			 cfg->scan_status);
- 		return -EAGAIN;
- 	}
-@@ -3473,8 +3499,8 @@ static s32
- brcmf_wowl_nd_results(struct brcmf_if *ifp, const struct brcmf_event_msg *e,
- 		      void *data)
- {
--	struct brcmf_cfg80211_info *cfg = ifp->drvr->config;
--	struct wiphy *wiphy = cfg_to_wiphy(cfg);
-+	struct brcmf_pub *drvr = ifp->drvr;
-+	struct brcmf_cfg80211_info *cfg = drvr->config;
- 	struct brcmf_pno_scanresults_le *pfn_result;
- 	struct brcmf_pno_net_info_le *netinfo;
- 
-@@ -3493,7 +3519,7 @@ brcmf_wowl_nd_results(struct brcmf_if *i
- 	}
- 
- 	if (le32_to_cpu(pfn_result->count) < 1) {
--		bphy_err(wiphy, "Invalid result count, expected 1 (%d)\n",
-+		bphy_err(drvr, "Invalid result count, expected 1 (%d)\n",
- 			 le32_to_cpu(pfn_result->count));
- 		return -EINVAL;
- 	}
-@@ -3523,6 +3549,7 @@ brcmf_wowl_nd_results(struct brcmf_if *i
- static void brcmf_report_wowl_wakeind(struct wiphy *wiphy, struct brcmf_if *ifp)
- {
- 	struct brcmf_cfg80211_info *cfg = wiphy_to_cfg(wiphy);
-+	struct brcmf_pub *drvr = cfg->pub;
- 	struct brcmf_wowl_wakeind_le wake_ind_le;
- 	struct cfg80211_wowlan_wakeup wakeup_data;
- 	struct cfg80211_wowlan_wakeup *wakeup;
-@@ -3533,7 +3560,7 @@ static void brcmf_report_wowl_wakeind(st
- 	err = brcmf_fil_iovar_data_get(ifp, "wowl_wakeind", &wake_ind_le,
- 				       sizeof(wake_ind_le));
- 	if (err) {
--		bphy_err(wiphy, "Get wowl_wakeind failed, err = %d\n", err);
-+		bphy_err(drvr, "Get wowl_wakeind failed, err = %d\n", err);
- 		return;
- 	}
- 
-@@ -3574,7 +3601,7 @@ static void brcmf_report_wowl_wakeind(st
- 				cfg->wowl.nd_data_completed,
- 				BRCMF_ND_INFO_TIMEOUT);
- 			if (!timeout)
--				bphy_err(wiphy, "No result for wowl net detect\n");
-+				bphy_err(drvr, "No result for wowl net detect\n");
- 			else
- 				wakeup_data.net_detect = cfg->wowl.nd_info;
- 		}
-@@ -3763,6 +3790,7 @@ brcmf_cfg80211_set_pmksa(struct wiphy *w
- 	struct brcmf_cfg80211_info *cfg = wiphy_to_cfg(wiphy);
- 	struct brcmf_if *ifp = netdev_priv(ndev);
- 	struct brcmf_pmksa *pmk = &cfg->pmk_list.pmk[0];
-+	struct brcmf_pub *drvr = cfg->pub;
- 	s32 err;
- 	u32 npmk, i;
- 
-@@ -3782,7 +3810,7 @@ brcmf_cfg80211_set_pmksa(struct wiphy *w
- 			cfg->pmk_list.npmk = cpu_to_le32(npmk);
- 		}
- 	} else {
--		bphy_err(wiphy, "Too many PMKSA entries cached %d\n", npmk);
-+		bphy_err(drvr, "Too many PMKSA entries cached %d\n", npmk);
- 		return -EINVAL;
- 	}
- 
-@@ -3805,6 +3833,7 @@ brcmf_cfg80211_del_pmksa(struct wiphy *w
- 	struct brcmf_cfg80211_info *cfg = wiphy_to_cfg(wiphy);
- 	struct brcmf_if *ifp = netdev_priv(ndev);
- 	struct brcmf_pmksa *pmk = &cfg->pmk_list.pmk[0];
-+	struct brcmf_pub *drvr = cfg->pub;
- 	s32 err;
- 	u32 npmk, i;
- 
-@@ -3828,7 +3857,7 @@ brcmf_cfg80211_del_pmksa(struct wiphy *w
- 		memset(&pmk[i], 0, sizeof(*pmk));
- 		cfg->pmk_list.npmk = cpu_to_le32(npmk - 1);
- 	} else {
--		bphy_err(wiphy, "Cache entry not found\n");
-+		bphy_err(drvr, "Cache entry not found\n");
- 		return -EINVAL;
- 	}
- 
-@@ -3860,20 +3889,20 @@ brcmf_cfg80211_flush_pmksa(struct wiphy
- 
- static s32 brcmf_configure_opensecurity(struct brcmf_if *ifp)
- {
--	struct wiphy *wiphy = ifp->drvr->wiphy;
-+	struct brcmf_pub *drvr = ifp->drvr;
- 	s32 err;
- 	s32 wpa_val;
- 
- 	/* set auth */
- 	err = brcmf_fil_bsscfg_int_set(ifp, "auth", 0);
- 	if (err < 0) {
--		bphy_err(wiphy, "auth error %d\n", err);
-+		bphy_err(drvr, "auth error %d\n", err);
- 		return err;
- 	}
- 	/* set wsec */
- 	err = brcmf_fil_bsscfg_int_set(ifp, "wsec", 0);
- 	if (err < 0) {
--		bphy_err(wiphy, "wsec error %d\n", err);
-+		bphy_err(drvr, "wsec error %d\n", err);
- 		return err;
- 	}
- 	/* set upper-layer auth */
-@@ -3883,7 +3912,7 @@ static s32 brcmf_configure_opensecurity(
- 		wpa_val = WPA_AUTH_DISABLED;
- 	err = brcmf_fil_bsscfg_int_set(ifp, "wpa_auth", wpa_val);
- 	if (err < 0) {
--		bphy_err(wiphy, "wpa_auth error %d\n", err);
-+		bphy_err(drvr, "wpa_auth error %d\n", err);
- 		return err;
- 	}
- 
-@@ -3903,7 +3932,7 @@ brcmf_configure_wpaie(struct brcmf_if *i
- 		      const struct brcmf_vs_tlv *wpa_ie,
- 		      bool is_rsn_ie)
- {
--	struct wiphy *wiphy = ifp->drvr->wiphy;
-+	struct brcmf_pub *drvr = ifp->drvr;
- 	u32 auth = 0; /* d11 open authentication */
- 	u16 count;
- 	s32 err = 0;
-@@ -3934,13 +3963,13 @@ brcmf_configure_wpaie(struct brcmf_if *i
- 	/* check for multicast cipher suite */
- 	if (offset + WPA_IE_MIN_OUI_LEN > len) {
- 		err = -EINVAL;
--		bphy_err(wiphy, "no multicast cipher suite\n");
-+		bphy_err(drvr, "no multicast cipher suite\n");
- 		goto exit;
- 	}
- 
- 	if (!brcmf_valid_wpa_oui(&data[offset], is_rsn_ie)) {
- 		err = -EINVAL;
--		bphy_err(wiphy, "ivalid OUI\n");
-+		bphy_err(drvr, "ivalid OUI\n");
- 		goto exit;
- 	}
- 	offset += TLV_OUI_LEN;
-@@ -3962,7 +3991,7 @@ brcmf_configure_wpaie(struct brcmf_if *i
- 		break;
- 	default:
- 		err = -EINVAL;
--		bphy_err(wiphy, "Invalid multi cast cipher info\n");
-+		bphy_err(drvr, "Invalid multi cast cipher info\n");
- 		goto exit;
- 	}
- 
-@@ -3973,13 +4002,13 @@ brcmf_configure_wpaie(struct brcmf_if *i
- 	/* Check for unicast suite(s) */
- 	if (offset + (WPA_IE_MIN_OUI_LEN * count) > len) {
- 		err = -EINVAL;
--		bphy_err(wiphy, "no unicast cipher suite\n");
-+		bphy_err(drvr, "no unicast cipher suite\n");
- 		goto exit;
- 	}
- 	for (i = 0; i < count; i++) {
- 		if (!brcmf_valid_wpa_oui(&data[offset], is_rsn_ie)) {
- 			err = -EINVAL;
--			bphy_err(wiphy, "ivalid OUI\n");
-+			bphy_err(drvr, "ivalid OUI\n");
- 			goto exit;
- 		}
- 		offset += TLV_OUI_LEN;
-@@ -3997,7 +4026,7 @@ brcmf_configure_wpaie(struct brcmf_if *i
- 			pval |= AES_ENABLED;
- 			break;
- 		default:
--			bphy_err(wiphy, "Invalid unicast security info\n");
-+			bphy_err(drvr, "Invalid unicast security info\n");
- 		}
- 		offset++;
- 	}
-@@ -4007,13 +4036,13 @@ brcmf_configure_wpaie(struct brcmf_if *i
- 	/* Check for auth key management suite(s) */
- 	if (offset + (WPA_IE_MIN_OUI_LEN * count) > len) {
- 		err = -EINVAL;
--		bphy_err(wiphy, "no auth key mgmt suite\n");
-+		bphy_err(drvr, "no auth key mgmt suite\n");
- 		goto exit;
- 	}
- 	for (i = 0; i < count; i++) {
- 		if (!brcmf_valid_wpa_oui(&data[offset], is_rsn_ie)) {
- 			err = -EINVAL;
--			bphy_err(wiphy, "ivalid OUI\n");
-+			bphy_err(drvr, "ivalid OUI\n");
- 			goto exit;
- 		}
- 		offset += TLV_OUI_LEN;
-@@ -4041,7 +4070,7 @@ brcmf_configure_wpaie(struct brcmf_if *i
- 			wpa_auth |= WPA2_AUTH_1X_SHA256;
- 			break;
- 		default:
--			bphy_err(wiphy, "Invalid key mgmt info\n");
-+			bphy_err(drvr, "Invalid key mgmt info\n");
- 		}
- 		offset++;
- 	}
-@@ -4083,7 +4112,7 @@ brcmf_configure_wpaie(struct brcmf_if *i
- 		err = brcmf_fil_bsscfg_int_set(ifp, "wme_bss_disable",
- 					       wme_bss_disable);
- 		if (err < 0) {
--			bphy_err(wiphy, "wme_bss_disable error %d\n", err);
-+			bphy_err(drvr, "wme_bss_disable error %d\n", err);
- 			goto exit;
- 		}
- 
-@@ -4097,7 +4126,7 @@ brcmf_configure_wpaie(struct brcmf_if *i
- 							&data[offset],
- 							WPA_IE_MIN_OUI_LEN);
- 			if (err < 0) {
--				bphy_err(wiphy, "bip error %d\n", err);
-+				bphy_err(drvr, "bip error %d\n", err);
- 				goto exit;
- 			}
- 		}
-@@ -4108,13 +4137,13 @@ brcmf_configure_wpaie(struct brcmf_if *i
- 	/* set auth */
- 	err = brcmf_fil_bsscfg_int_set(ifp, "auth", auth);
- 	if (err < 0) {
--		bphy_err(wiphy, "auth error %d\n", err);
-+		bphy_err(drvr, "auth error %d\n", err);
- 		goto exit;
- 	}
- 	/* set wsec */
- 	err = brcmf_fil_bsscfg_int_set(ifp, "wsec", wsec);
- 	if (err < 0) {
--		bphy_err(wiphy, "wsec error %d\n", err);
-+		bphy_err(drvr, "wsec error %d\n", err);
- 		goto exit;
- 	}
- 	/* Configure MFP, this needs to go after wsec otherwise the wsec command
-@@ -4123,14 +4152,14 @@ brcmf_configure_wpaie(struct brcmf_if *i
- 	if (brcmf_feat_is_enabled(ifp, BRCMF_FEAT_MFP)) {
- 		err = brcmf_fil_bsscfg_int_set(ifp, "mfp", mfp);
- 		if (err < 0) {
--			bphy_err(wiphy, "mfp error %d\n", err);
-+			bphy_err(drvr, "mfp error %d\n", err);
- 			goto exit;
- 		}
- 	}
- 	/* set upper-layer auth */
- 	err = brcmf_fil_bsscfg_int_set(ifp, "wpa_auth", wpa_auth);
- 	if (err < 0) {
--		bphy_err(wiphy, "wpa_auth error %d\n", err);
-+		bphy_err(drvr, "wpa_auth error %d\n", err);
- 		goto exit;
- 	}
- 
-@@ -4216,8 +4245,8 @@ brcmf_vndr_ie(u8 *iebuf, s32 pktflag, u8
- s32 brcmf_vif_set_mgmt_ie(struct brcmf_cfg80211_vif *vif, s32 pktflag,
- 			  const u8 *vndr_ie_buf, u32 vndr_ie_len)
- {
-+	struct brcmf_pub *drvr;
- 	struct brcmf_if *ifp;
--	struct wiphy *wiphy;
- 	struct vif_saved_ie *saved_ie;
- 	s32 err = 0;
- 	u8  *iovar_ie_buf;
-@@ -4238,7 +4267,7 @@ s32 brcmf_vif_set_mgmt_ie(struct brcmf_c
- 	if (!vif)
- 		return -ENODEV;
- 	ifp = vif->ifp;
--	wiphy = ifp->drvr->wiphy;
-+	drvr = ifp->drvr;
- 	saved_ie = &vif->saved_ie;
- 
- 	brcmf_dbg(TRACE, "bsscfgidx %d, pktflag : 0x%02X\n", ifp->bsscfgidx,
-@@ -4270,13 +4299,13 @@ s32 brcmf_vif_set_mgmt_ie(struct brcmf_c
- 		break;
- 	default:
- 		err = -EPERM;
--		bphy_err(wiphy, "not suitable type\n");
-+		bphy_err(drvr, "not suitable type\n");
- 		goto exit;
- 	}
- 
- 	if (vndr_ie_len > mgmt_ie_buf_len) {
- 		err = -ENOMEM;
--		bphy_err(wiphy, "extra IE size too big\n");
-+		bphy_err(drvr, "extra IE size too big\n");
- 		goto exit;
- 	}
- 
-@@ -4337,7 +4366,7 @@ s32 brcmf_vif_set_mgmt_ie(struct brcmf_c
- 			/* verify remained buf size before copy data */
- 			if (remained_buf_len < (vndrie_info->vndrie.len +
- 							VNDR_IE_VSIE_OFFSET)) {
--				bphy_err(wiphy, "no space in mgmt_ie_buf: len left %d",
-+				bphy_err(drvr, "no space in mgmt_ie_buf: len left %d",
- 					 remained_buf_len);
- 				break;
- 			}
-@@ -4369,7 +4398,7 @@ s32 brcmf_vif_set_mgmt_ie(struct brcmf_c
- 		err  = brcmf_fil_bsscfg_data_set(ifp, "vndr_ie", iovar_ie_buf,
- 						 total_ie_buf_len);
- 		if (err)
--			bphy_err(wiphy, "vndr ie set error : %d\n", err);
-+			bphy_err(drvr, "vndr ie set error : %d\n", err);
- 	}
- 
- exit:
-@@ -4397,14 +4426,14 @@ static s32
- brcmf_config_ap_mgmt_ie(struct brcmf_cfg80211_vif *vif,
- 			struct cfg80211_beacon_data *beacon)
- {
--	struct wiphy *wiphy = vif->ifp->drvr->wiphy;
-+	struct brcmf_pub *drvr = vif->ifp->drvr;
- 	s32 err;
- 
- 	/* Set Beacon IEs to FW */
- 	err = brcmf_vif_set_mgmt_ie(vif, BRCMF_VNDR_IE_BEACON_FLAG,
- 				    beacon->tail, beacon->tail_len);
- 	if (err) {
--		bphy_err(wiphy, "Set Beacon IE Failed\n");
-+		bphy_err(drvr, "Set Beacon IE Failed\n");
- 		return err;
- 	}
- 	brcmf_dbg(TRACE, "Applied Vndr IEs for Beacon\n");
-@@ -4414,7 +4443,7 @@ brcmf_config_ap_mgmt_ie(struct brcmf_cfg
- 				    beacon->proberesp_ies,
- 				    beacon->proberesp_ies_len);
- 	if (err)
--		bphy_err(wiphy, "Set Probe Resp IE Failed\n");
-+		bphy_err(drvr, "Set Probe Resp IE Failed\n");
- 	else
- 		brcmf_dbg(TRACE, "Applied Vndr IEs for Probe Resp\n");
- 
-@@ -4428,6 +4457,7 @@ brcmf_cfg80211_start_ap(struct wiphy *wi
- 	s32 ie_offset;
- 	struct brcmf_cfg80211_info *cfg = wiphy_to_cfg(wiphy);
- 	struct brcmf_if *ifp = netdev_priv(ndev);
-+	struct brcmf_pub *drvr = cfg->pub;
- 	const struct brcmf_tlv *ssid_ie;
- 	const struct brcmf_tlv *country_ie;
- 	struct brcmf_ssid_le ssid_le;
-@@ -4523,7 +4553,7 @@ brcmf_cfg80211_start_ap(struct wiphy *wi
- 			err = brcmf_fil_cmd_int_set(ifp, BRCMF_C_SET_REGULATORY,
- 						    is_11d);
- 			if (err < 0) {
--				bphy_err(wiphy, "Regulatory Set Error, %d\n",
-+				bphy_err(drvr, "Regulatory Set Error, %d\n",
- 					 err);
- 				goto exit;
- 			}
-@@ -4532,7 +4562,7 @@ brcmf_cfg80211_start_ap(struct wiphy *wi
- 			err = brcmf_fil_cmd_int_set(ifp, BRCMF_C_SET_BCNPRD,
- 						    settings->beacon_interval);
- 			if (err < 0) {
--				bphy_err(wiphy, "Beacon Interval Set Error, %d\n",
-+				bphy_err(drvr, "Beacon Interval Set Error, %d\n",
- 					 err);
- 				goto exit;
- 			}
-@@ -4541,7 +4571,7 @@ brcmf_cfg80211_start_ap(struct wiphy *wi
- 			err = brcmf_fil_cmd_int_set(ifp, BRCMF_C_SET_DTIMPRD,
- 						    settings->dtim_period);
- 			if (err < 0) {
--				bphy_err(wiphy, "DTIM Interval Set Error, %d\n",
-+				bphy_err(drvr, "DTIM Interval Set Error, %d\n",
- 					 err);
- 				goto exit;
- 			}
-@@ -4552,7 +4582,7 @@ brcmf_cfg80211_start_ap(struct wiphy *wi
- 		     !brcmf_feat_is_enabled(ifp, BRCMF_FEAT_RSDB))) {
- 			err = brcmf_fil_cmd_int_set(ifp, BRCMF_C_DOWN, 1);
- 			if (err < 0) {
--				bphy_err(wiphy, "BRCMF_C_DOWN error %d\n",
-+				bphy_err(drvr, "BRCMF_C_DOWN error %d\n",
- 					 err);
- 				goto exit;
- 			}
-@@ -4561,7 +4591,7 @@ brcmf_cfg80211_start_ap(struct wiphy *wi
- 
- 		err = brcmf_fil_cmd_int_set(ifp, BRCMF_C_SET_INFRA, 1);
- 		if (err < 0) {
--			bphy_err(wiphy, "SET INFRA error %d\n", err);
-+			bphy_err(drvr, "SET INFRA error %d\n", err);
- 			goto exit;
- 		}
- 	} else if (WARN_ON(supports_11d && (is_11d != ifp->vif->is_11d))) {
-@@ -4577,7 +4607,7 @@ brcmf_cfg80211_start_ap(struct wiphy *wi
- 
- 		err = brcmf_fil_cmd_int_set(ifp, BRCMF_C_SET_AP, 1);
- 		if (err < 0) {
--			bphy_err(wiphy, "setting AP mode failed %d\n",
-+			bphy_err(drvr, "setting AP mode failed %d\n",
- 				 err);
- 			goto exit;
- 		}
-@@ -4587,14 +4617,14 @@ brcmf_cfg80211_start_ap(struct wiphy *wi
- 			 */
- 			err = brcmf_fil_iovar_int_set(ifp, "chanspec", chanspec);
- 			if (err < 0) {
--				bphy_err(wiphy, "Set Channel failed: chspec=%d, %d\n",
-+				bphy_err(drvr, "Set Channel failed: chspec=%d, %d\n",
- 					 chanspec, err);
- 				goto exit;
- 			}
- 		}
- 		err = brcmf_fil_cmd_int_set(ifp, BRCMF_C_UP, 1);
- 		if (err < 0) {
--			bphy_err(wiphy, "BRCMF_C_UP error (%d)\n", err);
-+			bphy_err(drvr, "BRCMF_C_UP error (%d)\n", err);
- 			goto exit;
- 		}
- 		/* On DOWN the firmware removes the WEP keys, reconfigure
-@@ -4609,14 +4639,14 @@ brcmf_cfg80211_start_ap(struct wiphy *wi
- 		err = brcmf_fil_cmd_data_set(ifp, BRCMF_C_SET_SSID,
- 					     &join_params, sizeof(join_params));
- 		if (err < 0) {
--			bphy_err(wiphy, "SET SSID error (%d)\n", err);
-+			bphy_err(drvr, "SET SSID error (%d)\n", err);
- 			goto exit;
- 		}
- 
- 		if (settings->hidden_ssid) {
- 			err = brcmf_fil_iovar_int_set(ifp, "closednet", 1);
- 			if (err) {
--				bphy_err(wiphy, "closednet error (%d)\n", err);
-+				bphy_err(drvr, "closednet error (%d)\n", err);
- 				goto exit;
- 			}
- 		}
-@@ -4625,14 +4655,14 @@ brcmf_cfg80211_start_ap(struct wiphy *wi
- 	} else if (dev_role == NL80211_IFTYPE_P2P_GO) {
- 		err = brcmf_fil_iovar_int_set(ifp, "chanspec", chanspec);
- 		if (err < 0) {
--			bphy_err(wiphy, "Set Channel failed: chspec=%d, %d\n",
-+			bphy_err(drvr, "Set Channel failed: chspec=%d, %d\n",
- 				 chanspec, err);
- 			goto exit;
- 		}
- 		err = brcmf_fil_bsscfg_data_set(ifp, "ssid", &ssid_le,
- 						sizeof(ssid_le));
- 		if (err < 0) {
--			bphy_err(wiphy, "setting ssid failed %d\n", err);
-+			bphy_err(drvr, "setting ssid failed %d\n", err);
- 			goto exit;
- 		}
- 		bss_enable.bsscfgidx = cpu_to_le32(ifp->bsscfgidx);
-@@ -4640,7 +4670,7 @@ brcmf_cfg80211_start_ap(struct wiphy *wi
- 		err = brcmf_fil_iovar_data_set(ifp, "bss", &bss_enable,
- 					       sizeof(bss_enable));
- 		if (err < 0) {
--			bphy_err(wiphy, "bss_enable config failed %d\n", err);
-+			bphy_err(drvr, "bss_enable config failed %d\n", err);
- 			goto exit;
- 		}
- 
-@@ -4663,7 +4693,9 @@ exit:
- 
- static int brcmf_cfg80211_stop_ap(struct wiphy *wiphy, struct net_device *ndev)
- {
-+	struct brcmf_cfg80211_info *cfg = wiphy_to_cfg(wiphy);
- 	struct brcmf_if *ifp = netdev_priv(ndev);
-+	struct brcmf_pub *drvr = cfg->pub;
- 	s32 err;
- 	struct brcmf_fil_bss_enable_le bss_enable;
- 	struct brcmf_join_params join_params;
-@@ -4688,13 +4720,13 @@ static int brcmf_cfg80211_stop_ap(struct
- 		err = brcmf_fil_cmd_data_set(ifp, BRCMF_C_SET_SSID,
- 					     &join_params, sizeof(join_params));
- 		if (err < 0)
--			bphy_err(wiphy, "SET SSID error (%d)\n", err);
-+			bphy_err(drvr, "SET SSID error (%d)\n", err);
- 		err = brcmf_fil_cmd_int_set(ifp, BRCMF_C_DOWN, 1);
- 		if (err < 0)
--			bphy_err(wiphy, "BRCMF_C_DOWN error %d\n", err);
-+			bphy_err(drvr, "BRCMF_C_DOWN error %d\n", err);
- 		err = brcmf_fil_cmd_int_set(ifp, BRCMF_C_SET_AP, 0);
- 		if (err < 0)
--			bphy_err(wiphy, "setting AP mode failed %d\n", err);
-+			bphy_err(drvr, "setting AP mode failed %d\n", err);
- 		if (brcmf_feat_is_enabled(ifp, BRCMF_FEAT_MBSS))
- 			brcmf_fil_iovar_int_set(ifp, "mbss", 0);
- 		brcmf_fil_cmd_int_set(ifp, BRCMF_C_SET_REGULATORY,
-@@ -4702,7 +4734,7 @@ static int brcmf_cfg80211_stop_ap(struct
- 		/* Bring device back up so it can be used again */
- 		err = brcmf_fil_cmd_int_set(ifp, BRCMF_C_UP, 1);
- 		if (err < 0)
--			bphy_err(wiphy, "BRCMF_C_UP error %d\n", err);
-+			bphy_err(drvr, "BRCMF_C_UP error %d\n", err);
- 
- 		brcmf_vif_clear_mgmt_ies(ifp->vif);
- 	} else {
-@@ -4711,7 +4743,7 @@ static int brcmf_cfg80211_stop_ap(struct
- 		err = brcmf_fil_iovar_data_set(ifp, "bss", &bss_enable,
- 					       sizeof(bss_enable));
- 		if (err < 0)
--			bphy_err(wiphy, "bss_enable config failed %d\n", err);
-+			bphy_err(drvr, "bss_enable config failed %d\n", err);
- 	}
- 	brcmf_set_mpc(ifp, 1);
- 	brcmf_configure_arp_nd_offload(ifp, true);
-@@ -4740,6 +4772,7 @@ brcmf_cfg80211_del_station(struct wiphy
- 			   struct station_del_parameters *params)
- {
- 	struct brcmf_cfg80211_info *cfg = wiphy_to_cfg(wiphy);
-+	struct brcmf_pub *drvr = cfg->pub;
- 	struct brcmf_scb_val_le scbval;
- 	struct brcmf_if *ifp = netdev_priv(ndev);
- 	s32 err;
-@@ -4759,7 +4792,7 @@ brcmf_cfg80211_del_station(struct wiphy
- 	err = brcmf_fil_cmd_data_set(ifp, BRCMF_C_SCB_DEAUTHENTICATE_FOR_REASON,
- 				     &scbval, sizeof(scbval));
- 	if (err)
--		bphy_err(wiphy, "SCB_DEAUTHENTICATE_FOR_REASON failed %d\n",
-+		bphy_err(drvr, "SCB_DEAUTHENTICATE_FOR_REASON failed %d\n",
- 			 err);
- 
- 	brcmf_dbg(TRACE, "Exit\n");
-@@ -4770,6 +4803,8 @@ static int
- brcmf_cfg80211_change_station(struct wiphy *wiphy, struct net_device *ndev,
- 			      const u8 *mac, struct station_parameters *params)
- {
-+	struct brcmf_cfg80211_info *cfg = wiphy_to_cfg(wiphy);
-+	struct brcmf_pub *drvr = cfg->pub;
- 	struct brcmf_if *ifp = netdev_priv(ndev);
- 	s32 err;
- 
-@@ -4790,7 +4825,7 @@ brcmf_cfg80211_change_station(struct wip
- 		err = brcmf_fil_cmd_data_set(ifp, BRCMF_C_SET_SCB_DEAUTHORIZE,
- 					     (void *)mac, ETH_ALEN);
- 	if (err < 0)
--		bphy_err(wiphy, "Setting SCB (de-)authorize failed, %d\n", err);
-+		bphy_err(drvr, "Setting SCB (de-)authorize failed, %d\n", err);
- 
- 	return err;
- }
-@@ -4820,6 +4855,7 @@ brcmf_cfg80211_mgmt_tx(struct wiphy *wip
- {
- 	struct brcmf_cfg80211_info *cfg = wiphy_to_cfg(wiphy);
- 	struct ieee80211_channel *chan = params->chan;
-+	struct brcmf_pub *drvr = cfg->pub;
- 	const u8 *buf = params->buf;
- 	size_t len = params->len;
- 	const struct ieee80211_mgmt *mgmt;
-@@ -4840,7 +4876,7 @@ brcmf_cfg80211_mgmt_tx(struct wiphy *wip
- 	mgmt = (const struct ieee80211_mgmt *)buf;
- 
- 	if (!ieee80211_is_mgmt(mgmt->frame_control)) {
--		bphy_err(wiphy, "Driver only allows MGMT packet type\n");
-+		bphy_err(drvr, "Driver only allows MGMT packet type\n");
- 		return -EPERM;
- 	}
- 
-@@ -4871,13 +4907,13 @@ brcmf_cfg80211_mgmt_tx(struct wiphy *wip
- 					GFP_KERNEL);
- 	} else if (ieee80211_is_action(mgmt->frame_control)) {
- 		if (len > BRCMF_FIL_ACTION_FRAME_SIZE + DOT11_MGMT_HDR_LEN) {
--			bphy_err(wiphy, "invalid action frame length\n");
-+			bphy_err(drvr, "invalid action frame length\n");
- 			err = -EINVAL;
- 			goto exit;
- 		}
- 		af_params = kzalloc(sizeof(*af_params), GFP_KERNEL);
- 		if (af_params == NULL) {
--			bphy_err(wiphy, "unable to allocate frame\n");
-+			bphy_err(drvr, "unable to allocate frame\n");
- 			err = -ENOMEM;
- 			goto exit;
- 		}
-@@ -4928,6 +4964,7 @@ brcmf_cfg80211_cancel_remain_on_channel(
- 					u64 cookie)
- {
- 	struct brcmf_cfg80211_info *cfg = wiphy_to_cfg(wiphy);
-+	struct brcmf_pub *drvr = cfg->pub;
- 	struct brcmf_cfg80211_vif *vif;
- 	int err = 0;
- 
-@@ -4935,7 +4972,7 @@ brcmf_cfg80211_cancel_remain_on_channel(
- 
- 	vif = cfg->p2p.bss_idx[P2PAPI_BSSCFG_DEVICE].vif;
- 	if (vif == NULL) {
--		bphy_err(wiphy, "No p2p device available for probe response\n");
-+		bphy_err(drvr, "No p2p device available for probe response\n");
- 		err = -ENODEV;
- 		goto exit;
- 	}
-@@ -4950,6 +4987,7 @@ static int brcmf_cfg80211_get_channel(st
- {
- 	struct brcmf_cfg80211_info *cfg = wiphy_to_cfg(wiphy);
- 	struct net_device *ndev = wdev->netdev;
-+	struct brcmf_pub *drvr = cfg->pub;
- 	struct brcmf_if *ifp;
- 	struct brcmu_chan ch;
- 	enum nl80211_band band = 0;
-@@ -4963,7 +5001,7 @@ static int brcmf_cfg80211_get_channel(st
- 
- 	err = brcmf_fil_iovar_int_get(ifp, "chanspec", &chanspec);
- 	if (err) {
--		bphy_err(wiphy, "chanspec failed (%d)\n", err);
-+		bphy_err(drvr, "chanspec failed (%d)\n", err);
- 		return err;
- 	}
- 
-@@ -5085,6 +5123,8 @@ static int brcmf_cfg80211_tdls_oper(stru
- 				    struct net_device *ndev, const u8 *peer,
- 				    enum nl80211_tdls_operation oper)
- {
-+	struct brcmf_cfg80211_info *cfg = wiphy_to_cfg(wiphy);
-+	struct brcmf_pub *drvr = cfg->pub;
- 	struct brcmf_if *ifp;
- 	struct brcmf_tdls_iovar_le info;
- 	int ret = 0;
-@@ -5102,7 +5142,7 @@ static int brcmf_cfg80211_tdls_oper(stru
- 	ret = brcmf_fil_iovar_data_set(ifp, "tdls_endpoint",
- 				       &info, sizeof(info));
- 	if (ret < 0)
--		bphy_err(wiphy, "tdls_endpoint iovar failed: ret=%d\n", ret);
-+		bphy_err(drvr, "tdls_endpoint iovar failed: ret=%d\n", ret);
- 
- 	return ret;
- }
-@@ -5113,6 +5153,8 @@ brcmf_cfg80211_update_conn_params(struct
- 				  struct cfg80211_connect_params *sme,
- 				  u32 changed)
- {
-+	struct brcmf_cfg80211_info *cfg = wiphy_to_cfg(wiphy);
-+	struct brcmf_pub *drvr = cfg->pub;
- 	struct brcmf_if *ifp;
- 	int err;
- 
-@@ -5123,7 +5165,7 @@ brcmf_cfg80211_update_conn_params(struct
- 	err = brcmf_vif_set_mgmt_ie(ifp->vif, BRCMF_VNDR_IE_ASSOCREQ_FLAG,
- 				    sme->ie, sme->ie_len);
- 	if (err)
--		bphy_err(wiphy, "Set Assoc REQ IE Failed\n");
-+		bphy_err(drvr, "Set Assoc REQ IE Failed\n");
- 	else
- 		brcmf_dbg(TRACE, "Applied Vndr IEs for Assoc request\n");
- 
-@@ -5135,6 +5177,8 @@ static int
- brcmf_cfg80211_set_rekey_data(struct wiphy *wiphy, struct net_device *ndev,
- 			      struct cfg80211_gtk_rekey_data *gtk)
- {
-+	struct brcmf_cfg80211_info *cfg = wiphy_to_cfg(wiphy);
-+	struct brcmf_pub *drvr = cfg->pub;
- 	struct brcmf_if *ifp = netdev_priv(ndev);
- 	struct brcmf_gtk_keyinfo_le gtk_le;
- 	int ret;
-@@ -5149,7 +5193,7 @@ brcmf_cfg80211_set_rekey_data(struct wip
- 	ret = brcmf_fil_iovar_data_set(ifp, "gtk_key_info", &gtk_le,
- 				       sizeof(gtk_le));
- 	if (ret < 0)
--		bphy_err(wiphy, "gtk_key_info iovar failed: ret=%d\n", ret);
-+		bphy_err(drvr, "gtk_key_info iovar failed: ret=%d\n", ret);
- 
- 	return ret;
- }
-@@ -5381,7 +5425,7 @@ static void brcmf_clear_assoc_ies(struct
- static s32 brcmf_get_assoc_ies(struct brcmf_cfg80211_info *cfg,
- 			       struct brcmf_if *ifp)
- {
--	struct wiphy *wiphy = cfg_to_wiphy(cfg);
-+	struct brcmf_pub *drvr = cfg->pub;
- 	struct brcmf_cfg80211_assoc_ielen_le *assoc_info;
- 	struct brcmf_cfg80211_connect_info *conn_info = cfg_to_conn(cfg);
- 	u32 req_len;
-@@ -5393,7 +5437,7 @@ static s32 brcmf_get_assoc_ies(struct br
- 	err = brcmf_fil_iovar_data_get(ifp, "assoc_info",
- 				       cfg->extra_buf, WL_ASSOC_INFO_MAX);
- 	if (err) {
--		bphy_err(wiphy, "could not get assoc info (%d)\n", err);
-+		bphy_err(drvr, "could not get assoc info (%d)\n", err);
- 		return err;
- 	}
- 	assoc_info =
-@@ -5405,7 +5449,7 @@ static s32 brcmf_get_assoc_ies(struct br
- 					       cfg->extra_buf,
- 					       WL_ASSOC_INFO_MAX);
- 		if (err) {
--			bphy_err(wiphy, "could not get assoc req (%d)\n", err);
-+			bphy_err(drvr, "could not get assoc req (%d)\n", err);
- 			return err;
- 		}
- 		conn_info->req_ie_len = req_len;
-@@ -5421,7 +5465,7 @@ static s32 brcmf_get_assoc_ies(struct br
- 					       cfg->extra_buf,
- 					       WL_ASSOC_INFO_MAX);
- 		if (err) {
--			bphy_err(wiphy, "could not get assoc resp (%d)\n", err);
-+			bphy_err(drvr, "could not get assoc resp (%d)\n", err);
- 			return err;
- 		}
- 		conn_info->resp_ie_len = resp_len;
-@@ -5548,7 +5592,7 @@ brcmf_notify_connect_status_ap(struct br
- 			       struct net_device *ndev,
- 			       const struct brcmf_event_msg *e, void *data)
- {
--	struct wiphy *wiphy = cfg_to_wiphy(cfg);
-+	struct brcmf_pub *drvr = cfg->pub;
- 	static int generation;
- 	u32 event = e->event_code;
- 	u32 reason = e->reason;
-@@ -5566,7 +5610,7 @@ brcmf_notify_connect_status_ap(struct br
- 	if (((event == BRCMF_E_ASSOC_IND) || (event == BRCMF_E_REASSOC_IND)) &&
- 	    (reason == BRCMF_E_STATUS_SUCCESS)) {
- 		if (!data) {
--			bphy_err(wiphy, "No IEs present in ASSOC/REASSOC_IND\n");
-+			bphy_err(drvr, "No IEs present in ASSOC/REASSOC_IND\n");
- 			return -EINVAL;
- 		}
- 
-@@ -5858,7 +5902,7 @@ static void init_vif_event(struct brcmf_
- 
- static s32 brcmf_dongle_roam(struct brcmf_if *ifp)
- {
--	struct wiphy *wiphy = ifp->drvr->wiphy;
-+	struct brcmf_pub *drvr = ifp->drvr;
- 	s32 err;
- 	u32 bcn_timeout;
- 	__le32 roamtrigger[2];
-@@ -5871,7 +5915,7 @@ static s32 brcmf_dongle_roam(struct brcm
- 		bcn_timeout = BRCMF_DEFAULT_BCN_TIMEOUT_ROAM_ON;
- 	err = brcmf_fil_iovar_int_set(ifp, "bcn_timeout", bcn_timeout);
- 	if (err) {
--		bphy_err(wiphy, "bcn_timeout error (%d)\n", err);
-+		bphy_err(drvr, "bcn_timeout error (%d)\n", err);
- 		goto roam_setup_done;
- 	}
- 
-@@ -5883,7 +5927,7 @@ static s32 brcmf_dongle_roam(struct brcm
- 	err = brcmf_fil_iovar_int_set(ifp, "roam_off",
- 				      ifp->drvr->settings->roamoff);
- 	if (err) {
--		bphy_err(wiphy, "roam_off error (%d)\n", err);
-+		bphy_err(drvr, "roam_off error (%d)\n", err);
- 		goto roam_setup_done;
- 	}
- 
-@@ -5892,7 +5936,7 @@ static s32 brcmf_dongle_roam(struct brcm
- 	err = brcmf_fil_cmd_data_set(ifp, BRCMF_C_SET_ROAM_TRIGGER,
- 				     (void *)roamtrigger, sizeof(roamtrigger));
- 	if (err) {
--		bphy_err(wiphy, "WLC_SET_ROAM_TRIGGER error (%d)\n", err);
-+		bphy_err(drvr, "WLC_SET_ROAM_TRIGGER error (%d)\n", err);
- 		goto roam_setup_done;
- 	}
- 
-@@ -5901,7 +5945,7 @@ static s32 brcmf_dongle_roam(struct brcm
- 	err = brcmf_fil_cmd_data_set(ifp, BRCMF_C_SET_ROAM_DELTA,
- 				     (void *)roam_delta, sizeof(roam_delta));
- 	if (err) {
--		bphy_err(wiphy, "WLC_SET_ROAM_DELTA error (%d)\n", err);
-+		bphy_err(drvr, "WLC_SET_ROAM_DELTA error (%d)\n", err);
- 		goto roam_setup_done;
- 	}
- 
-@@ -5912,26 +5956,26 @@ roam_setup_done:
- static s32
- brcmf_dongle_scantime(struct brcmf_if *ifp)
- {
--	struct wiphy *wiphy = ifp->drvr->wiphy;
-+	struct brcmf_pub *drvr = ifp->drvr;
- 	s32 err = 0;
- 
- 	err = brcmf_fil_cmd_int_set(ifp, BRCMF_C_SET_SCAN_CHANNEL_TIME,
- 				    BRCMF_SCAN_CHANNEL_TIME);
- 	if (err) {
--		bphy_err(wiphy, "Scan assoc time error (%d)\n", err);
-+		bphy_err(drvr, "Scan assoc time error (%d)\n", err);
- 		goto dongle_scantime_out;
- 	}
- 	err = brcmf_fil_cmd_int_set(ifp, BRCMF_C_SET_SCAN_UNASSOC_TIME,
- 				    BRCMF_SCAN_UNASSOC_TIME);
- 	if (err) {
--		bphy_err(wiphy, "Scan unassoc time error (%d)\n", err);
-+		bphy_err(drvr, "Scan unassoc time error (%d)\n", err);
- 		goto dongle_scantime_out;
- 	}
- 
- 	err = brcmf_fil_cmd_int_set(ifp, BRCMF_C_SET_SCAN_PASSIVE_TIME,
- 				    BRCMF_SCAN_PASSIVE_TIME);
- 	if (err) {
--		bphy_err(wiphy, "Scan passive time error (%d)\n", err);
-+		bphy_err(drvr, "Scan passive time error (%d)\n", err);
- 		goto dongle_scantime_out;
- 	}
- 
-@@ -5964,7 +6008,8 @@ static int brcmf_construct_chaninfo(stru
- 				    u32 bw_cap[])
- {
- 	struct wiphy *wiphy = cfg_to_wiphy(cfg);
--	struct brcmf_if *ifp = brcmf_get_ifp(cfg->pub, 0);
-+	struct brcmf_pub *drvr = cfg->pub;
-+	struct brcmf_if *ifp = brcmf_get_ifp(drvr, 0);
- 	struct ieee80211_supported_band *band;
- 	struct ieee80211_channel *channel;
- 	struct brcmf_chanspec_list *list;
-@@ -5985,7 +6030,7 @@ static int brcmf_construct_chaninfo(stru
- 	err = brcmf_fil_iovar_data_get(ifp, "chanspecs", pbuf,
- 				       BRCMF_DCMD_MEDLEN);
- 	if (err) {
--		bphy_err(wiphy, "get chanspecs error (%d)\n", err);
-+		bphy_err(drvr, "get chanspecs error (%d)\n", err);
- 		goto fail_pbuf;
- 	}
- 
-@@ -6008,7 +6053,7 @@ static int brcmf_construct_chaninfo(stru
- 		} else if (ch.band == BRCMU_CHAN_BAND_5G) {
- 			band = wiphy->bands[NL80211_BAND_5GHZ];
- 		} else {
--			bphy_err(wiphy, "Invalid channel Spec. 0x%x.\n",
-+			bphy_err(drvr, "Invalid channel Spec. 0x%x.\n",
- 				 ch.chspec);
- 			continue;
- 		}
-@@ -6032,7 +6077,7 @@ static int brcmf_construct_chaninfo(stru
- 			/* It seems firmware supports some channel we never
- 			 * considered. Something new in IEEE standard?
- 			 */
--			bphy_err(wiphy, "Ignoring unexpected firmware channel %d\n",
-+			bphy_err(drvr, "Ignoring unexpected firmware channel %d\n",
- 				 ch.control_ch_num);
- 			continue;
- 		}
-@@ -6089,8 +6134,8 @@ fail_pbuf:
- 
- static int brcmf_enable_bw40_2g(struct brcmf_cfg80211_info *cfg)
- {
--	struct wiphy *wiphy = cfg_to_wiphy(cfg);
--	struct brcmf_if *ifp = brcmf_get_ifp(cfg->pub, 0);
-+	struct brcmf_pub *drvr = cfg->pub;
-+	struct brcmf_if *ifp = brcmf_get_ifp(drvr, 0);
- 	struct ieee80211_supported_band *band;
- 	struct brcmf_fil_bwcap_le band_bwcap;
- 	struct brcmf_chanspec_list *list;
-@@ -6136,7 +6181,7 @@ static int brcmf_enable_bw40_2g(struct b
- 		err = brcmf_fil_iovar_data_get(ifp, "chanspecs", pbuf,
- 					       BRCMF_DCMD_MEDLEN);
- 		if (err) {
--			bphy_err(wiphy, "get chanspecs error (%d)\n", err);
-+			bphy_err(drvr, "get chanspecs error (%d)\n", err);
- 			kfree(pbuf);
- 			return err;
- 		}
-@@ -6167,7 +6212,7 @@ static int brcmf_enable_bw40_2g(struct b
- 
- static void brcmf_get_bwcap(struct brcmf_if *ifp, u32 bw_cap[])
- {
--	struct wiphy *wiphy = ifp->drvr->wiphy;
-+	struct brcmf_pub *drvr = ifp->drvr;
- 	u32 band, mimo_bwcap;
- 	int err;
- 
-@@ -6203,7 +6248,7 @@ static void brcmf_get_bwcap(struct brcmf
- 		bw_cap[NL80211_BAND_5GHZ] |= WLC_BW_20MHZ_BIT;
- 		break;
- 	default:
--		bphy_err(wiphy, "invalid mimo_bw_cap value\n");
-+		bphy_err(drvr, "invalid mimo_bw_cap value\n");
- 	}
- }
- 
-@@ -6278,7 +6323,8 @@ static void brcmf_update_vht_cap(struct
- 
- static int brcmf_setup_wiphybands(struct brcmf_cfg80211_info *cfg)
- {
--	struct brcmf_if *ifp = brcmf_get_ifp(cfg->pub, 0);
-+	struct brcmf_pub *drvr = cfg->pub;
-+	struct brcmf_if *ifp = brcmf_get_ifp(drvr, 0);
- 	struct wiphy *wiphy = cfg_to_wiphy(cfg);
- 	u32 nmode = 0;
- 	u32 vhtmode = 0;
-@@ -6295,7 +6341,7 @@ static int brcmf_setup_wiphybands(struct
- 	(void)brcmf_fil_iovar_int_get(ifp, "vhtmode", &vhtmode);
- 	err = brcmf_fil_iovar_int_get(ifp, "nmode", &nmode);
- 	if (err) {
--		bphy_err(wiphy, "nmode error (%d)\n", err);
-+		bphy_err(drvr, "nmode error (%d)\n", err);
- 	} else {
- 		brcmf_get_bwcap(ifp, bw_cap);
- 	}
-@@ -6305,7 +6351,7 @@ static int brcmf_setup_wiphybands(struct
- 
- 	err = brcmf_fil_iovar_int_get(ifp, "rxchain", &rxchain);
- 	if (err) {
--		bphy_err(wiphy, "rxchain error (%d)\n", err);
-+		bphy_err(drvr, "rxchain error (%d)\n", err);
- 		nchain = 1;
- 	} else {
- 		for (nchain = 0; rxchain; nchain++)
-@@ -6315,7 +6361,7 @@ static int brcmf_setup_wiphybands(struct
- 
- 	err = brcmf_construct_chaninfo(cfg, bw_cap);
- 	if (err) {
--		bphy_err(wiphy, "brcmf_construct_chaninfo failed (%d)\n", err);
-+		bphy_err(drvr, "brcmf_construct_chaninfo failed (%d)\n", err);
- 		return err;
- 	}
- 
-@@ -6522,12 +6568,13 @@ static void brcmf_wiphy_wowl_params(stru
- {
- #ifdef CONFIG_PM
- 	struct brcmf_cfg80211_info *cfg = wiphy_to_cfg(wiphy);
-+	struct brcmf_pub *drvr = cfg->pub;
- 	struct wiphy_wowlan_support *wowl;
- 
- 	wowl = kmemdup(&brcmf_wowlan_support, sizeof(brcmf_wowlan_support),
- 		       GFP_KERNEL);
- 	if (!wowl) {
--		bphy_err(wiphy, "only support basic wowlan features\n");
-+		bphy_err(drvr, "only support basic wowlan features\n");
- 		wiphy->wowlan = &brcmf_wowlan_support;
- 		return;
- 	}
-@@ -6624,7 +6671,7 @@ static int brcmf_setup_wiphy(struct wiph
- 	err = brcmf_fil_cmd_data_get(ifp, BRCMF_C_GET_BANDLIST, &bandlist,
- 				     sizeof(bandlist));
- 	if (err) {
--		bphy_err(wiphy, "could not obtain band info: err=%d\n", err);
-+		bphy_err(drvr, "could not obtain band info: err=%d\n", err);
- 		return err;
- 	}
- 	/* first entry in bandlist is number of bands */
-@@ -6673,7 +6720,7 @@ static int brcmf_setup_wiphy(struct wiph
- 
- static s32 brcmf_config_dongle(struct brcmf_cfg80211_info *cfg)
- {
--	struct wiphy *wiphy = cfg_to_wiphy(cfg);
-+	struct brcmf_pub *drvr = cfg->pub;
- 	struct net_device *ndev;
- 	struct wireless_dev *wdev;
- 	struct brcmf_if *ifp;
-@@ -6711,7 +6758,7 @@ static s32 brcmf_config_dongle(struct br
- 
- 	err = brcmf_fil_cmd_int_set(ifp, BRCMF_C_SET_FAKEFRAG, 1);
- 	if (err) {
--		bphy_err(wiphy, "failed to set frameburst mode\n");
-+		bphy_err(drvr, "failed to set frameburst mode\n");
- 		goto default_conf_out;
- 	}
- 
-@@ -6892,6 +6939,7 @@ static void brcmf_cfg80211_reg_notifier(
- {
- 	struct brcmf_cfg80211_info *cfg = wiphy_to_cfg(wiphy);
- 	struct brcmf_if *ifp = brcmf_get_ifp(cfg->pub, 0);
-+	struct brcmf_pub *drvr = cfg->pub;
- 	struct brcmf_fil_country_le ccreq;
- 	s32 err;
- 	int i;
-@@ -6903,7 +6951,7 @@ static void brcmf_cfg80211_reg_notifier(
- 	/* ignore non-ISO3166 country codes */
- 	for (i = 0; i < 2; i++)
- 		if (req->alpha2[i] < 'A' || req->alpha2[i] > 'Z') {
--			bphy_err(wiphy, "not an ISO3166 code (0x%02x 0x%02x)\n",
-+			bphy_err(drvr, "not an ISO3166 code (0x%02x 0x%02x)\n",
- 				 req->alpha2[0], req->alpha2[1]);
- 			return;
- 		}
-@@ -6913,7 +6961,7 @@ static void brcmf_cfg80211_reg_notifier(
- 
- 	err = brcmf_fil_iovar_data_get(ifp, "country", &ccreq, sizeof(ccreq));
- 	if (err) {
--		bphy_err(wiphy, "Country code iovar returned err = %d\n", err);
-+		bphy_err(drvr, "Country code iovar returned err = %d\n", err);
- 		return;
- 	}
- 
-@@ -6923,7 +6971,7 @@ static void brcmf_cfg80211_reg_notifier(
- 
- 	err = brcmf_fil_iovar_data_set(ifp, "country", &ccreq, sizeof(ccreq));
- 	if (err) {
--		bphy_err(wiphy, "Firmware rejected country setting\n");
-+		bphy_err(drvr, "Firmware rejected country setting\n");
- 		return;
- 	}
- 	brcmf_setup_wiphybands(cfg);
-@@ -6969,13 +7017,13 @@ struct brcmf_cfg80211_info *brcmf_cfg802
- 	u16 *cap = NULL;
- 
- 	if (!ndev) {
--		bphy_err(wiphy, "ndev is invalid\n");
-+		bphy_err(drvr, "ndev is invalid\n");
- 		return NULL;
- 	}
- 
- 	cfg = kzalloc(sizeof(*cfg), GFP_KERNEL);
- 	if (!cfg) {
--		bphy_err(wiphy, "Could not allocate wiphy device\n");
-+		bphy_err(drvr, "Could not allocate wiphy device\n");
- 		return NULL;
- 	}
- 
-@@ -6996,7 +7044,7 @@ struct brcmf_cfg80211_info *brcmf_cfg802
- 
- 	err = wl_init_priv(cfg);
- 	if (err) {
--		bphy_err(wiphy, "Failed to init iwm_priv (%d)\n", err);
-+		bphy_err(drvr, "Failed to init iwm_priv (%d)\n", err);
- 		brcmf_free_vif(vif);
- 		goto wiphy_out;
- 	}
-@@ -7005,7 +7053,7 @@ struct brcmf_cfg80211_info *brcmf_cfg802
- 	/* determine d11 io type before wiphy setup */
- 	err = brcmf_fil_cmd_int_get(ifp, BRCMF_C_GET_VERSION, &io_type);
- 	if (err) {
--		bphy_err(wiphy, "Failed to get D11 version (%d)\n", err);
-+		bphy_err(drvr, "Failed to get D11 version (%d)\n", err);
- 		goto priv_out;
- 	}
- 	cfg->d11inf.io_type = (u8)io_type;
-@@ -7039,13 +7087,13 @@ struct brcmf_cfg80211_info *brcmf_cfg802
- #endif
- 	err = wiphy_register(wiphy);
- 	if (err < 0) {
--		bphy_err(wiphy, "Could not register wiphy device (%d)\n", err);
-+		bphy_err(drvr, "Could not register wiphy device (%d)\n", err);
- 		goto priv_out;
- 	}
- 
- 	err = brcmf_setup_wiphybands(cfg);
- 	if (err) {
--		bphy_err(wiphy, "Setting wiphy bands failed (%d)\n", err);
-+		bphy_err(drvr, "Setting wiphy bands failed (%d)\n", err);
- 		goto wiphy_unreg_out;
- 	}
- 
-@@ -7063,24 +7111,24 @@ struct brcmf_cfg80211_info *brcmf_cfg802
- 
- 	err = brcmf_fweh_activate_events(ifp);
- 	if (err) {
--		bphy_err(wiphy, "FWEH activation failed (%d)\n", err);
-+		bphy_err(drvr, "FWEH activation failed (%d)\n", err);
- 		goto wiphy_unreg_out;
- 	}
- 
- 	err = brcmf_p2p_attach(cfg, p2pdev_forced);
- 	if (err) {
--		bphy_err(wiphy, "P2P initialisation failed (%d)\n", err);
-+		bphy_err(drvr, "P2P initialisation failed (%d)\n", err);
- 		goto wiphy_unreg_out;
- 	}
- 	err = brcmf_btcoex_attach(cfg);
- 	if (err) {
--		bphy_err(wiphy, "BT-coex initialisation failed (%d)\n", err);
-+		bphy_err(drvr, "BT-coex initialisation failed (%d)\n", err);
- 		brcmf_p2p_detach(&cfg->p2p);
- 		goto wiphy_unreg_out;
- 	}
- 	err = brcmf_pno_attach(cfg);
- 	if (err) {
--		bphy_err(wiphy, "PNO initialisation failed (%d)\n", err);
-+		bphy_err(drvr, "PNO initialisation failed (%d)\n", err);
- 		brcmf_btcoex_detach(cfg);
- 		brcmf_p2p_detach(&cfg->p2p);
- 		goto wiphy_unreg_out;
-@@ -7100,7 +7148,7 @@ struct brcmf_cfg80211_info *brcmf_cfg802
- 	/* (re-) activate FWEH event handling */
- 	err = brcmf_fweh_activate_events(ifp);
- 	if (err) {
--		bphy_err(wiphy, "FWEH activation failed (%d)\n", err);
-+		bphy_err(drvr, "FWEH activation failed (%d)\n", err);
- 		goto detach;
- 	}
- 
---- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/debug.h
-+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/debug.h
-@@ -62,12 +62,12 @@ void __brcmf_err(struct brcmf_bus *bus,
- 	} while (0)
- #endif
- 
--#define bphy_err(wiphy, fmt, ...)					\
-+#define bphy_err(drvr, fmt, ...)					\
- 	do {								\
- 		if (IS_ENABLED(CPTCFG_BRCMDBG) ||			\
- 		    IS_ENABLED(CPTCFG_BRCM_TRACING) ||			\
- 		    net_ratelimit())					\
--			wiphy_err(wiphy, "%s: " fmt, __func__,		\
-+			wiphy_err((drvr)->wiphy, "%s: " fmt, __func__,	\
- 				  ##__VA_ARGS__);			\
- 	} while (0)
- 

+ 0 - 38
package/kernel/mac80211/patches/brcm/353-v5.1-brcmfmac-remove-set-but-not-used-variable-old_state.patch

@@ -1,38 +0,0 @@
-From e4d1b2716b8859199c28f2ac5f984bd05a146a6b Mon Sep 17 00:00:00 2001
-From: YueHaibing <[email protected]>
-Date: Mon, 18 Feb 2019 08:08:46 +0000
-Subject: [PATCH] brcmfmac: remove set but not used variable 'old_state'
-
-Fixes gcc '-Wunused-but-set-variable' warning:
-
-drivers/net/wireless/broadcom/brcm80211/brcmfmac/usb.c: In function 'brcmf_usb_state_change':
-drivers/net/wireless/broadcom/brcm80211/brcmfmac/usb.c:578:6: warning:
- variable 'old_state' set but not used [-Wunused-but-set-variable]
-
-It's never used and can be removed.
-
-Signed-off-by: YueHaibing <[email protected]>
-Acked-by: Arend van Spriel <[email protected]>
-Signed-off-by: Kalle Valo <[email protected]>
----
- drivers/net/wireless/broadcom/brcm80211/brcmfmac/usb.c | 2 --
- 1 file changed, 2 deletions(-)
-
---- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/usb.c
-+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/usb.c
-@@ -575,7 +575,6 @@ static void
- brcmf_usb_state_change(struct brcmf_usbdev_info *devinfo, int state)
- {
- 	struct brcmf_bus *bcmf_bus = devinfo->bus_pub.bus;
--	int old_state;
- 
- 	brcmf_dbg(USB, "Enter, current state=%d, new state=%d\n",
- 		  devinfo->bus_pub.state, state);
-@@ -583,7 +582,6 @@ brcmf_usb_state_change(struct brcmf_usbd
- 	if (devinfo->bus_pub.state == state)
- 		return;
- 
--	old_state = devinfo->bus_pub.state;
- 	devinfo->bus_pub.state = state;
- 
- 	/* update state of upper layer */

+ 0 - 1707
package/kernel/mac80211/patches/brcm/354-v5.1-brcmfmac-use-bphy_err-in-all-wiphy-related-code.patch

@@ -1,1707 +0,0 @@
-From dcb1471bc6d0541d636c7ecd9239573304842884 Mon Sep 17 00:00:00 2001
-From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= <[email protected]>
-Date: Tue, 19 Feb 2019 23:42:19 +0100
-Subject: [PATCH] brcmfmac: use bphy_err() in all wiphy-related code
-MIME-Version: 1.0
-Content-Type: text/plain; charset=UTF-8
-Content-Transfer-Encoding: 8bit
-
-This recently added macro provides more meaningful error messages thanks
-to identifying a specific wiphy. It's especially important on systems
-with few cards supported by the same (brcmfmac) driver.
-
-Signed-off-by: Rafał Miłecki <[email protected]>
-Acked-by: Arend van Spriel <[email protected]>
-Signed-off-by: Kalle Valo <[email protected]>
----
- .../broadcom/brcm80211/brcmfmac/bcdc.c        | 22 ++---
- .../broadcom/brcm80211/brcmfmac/common.c      | 39 ++++----
- .../broadcom/brcm80211/brcmfmac/core.c        | 74 ++++++++--------
- .../broadcom/brcm80211/brcmfmac/feature.c     |  8 +-
- .../broadcom/brcm80211/brcmfmac/fweh.c        | 25 +++---
- .../broadcom/brcm80211/brcmfmac/fwil.c        | 10 +--
- .../broadcom/brcm80211/brcmfmac/fwsignal.c    | 38 ++++----
- .../broadcom/brcm80211/brcmfmac/msgbuf.c      | 65 ++++++++------
- .../broadcom/brcm80211/brcmfmac/p2p.c         | 88 +++++++++++--------
- .../broadcom/brcm80211/brcmfmac/pno.c         | 22 +++--
- .../broadcom/brcm80211/brcmfmac/proto.c       |  6 +-
- 11 files changed, 224 insertions(+), 173 deletions(-)
-
---- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/bcdc.c
-+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/bcdc.c
-@@ -178,8 +178,8 @@ brcmf_proto_bcdc_query_dcmd(struct brcmf
- 	*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",
--			  ret);
-+		bphy_err(drvr, "brcmf_proto_bcdc_msg failed w/status %d\n",
-+			 ret);
- 		goto done;
- 	}
- 
-@@ -195,9 +195,9 @@ retry:
- 	if ((id < bcdc->reqid) && (++retries < RETRIES))
- 		goto retry;
- 	if (id != bcdc->reqid) {
--		brcmf_err("%s: unexpected request id %d (expected %d)\n",
--			  brcmf_ifname(brcmf_get_ifp(drvr, ifidx)), id,
--			  bcdc->reqid);
-+		bphy_err(drvr, "%s: unexpected request id %d (expected %d)\n",
-+			 brcmf_ifname(brcmf_get_ifp(drvr, ifidx)), id,
-+			 bcdc->reqid);
- 		ret = -EINVAL;
- 		goto done;
- 	}
-@@ -245,9 +245,9 @@ brcmf_proto_bcdc_set_dcmd(struct brcmf_p
- 	id = (flags & BCDC_DCMD_ID_MASK) >> BCDC_DCMD_ID_SHIFT;
- 
- 	if (id != bcdc->reqid) {
--		brcmf_err("%s: unexpected request id %d (expected %d)\n",
--			  brcmf_ifname(brcmf_get_ifp(drvr, ifidx)), id,
--			  bcdc->reqid);
-+		bphy_err(drvr, "%s: unexpected request id %d (expected %d)\n",
-+			 brcmf_ifname(brcmf_get_ifp(drvr, ifidx)), id,
-+			 bcdc->reqid);
- 		ret = -EINVAL;
- 		goto done;
- 	}
-@@ -312,8 +312,8 @@ brcmf_proto_bcdc_hdrpull(struct brcmf_pu
- 	}
- 	if (((h->flags & BCDC_FLAG_VER_MASK) >> BCDC_FLAG_VER_SHIFT) !=
- 	    BCDC_PROTO_VER) {
--		brcmf_err("%s: non-BCDC packet received, flags 0x%x\n",
--			  brcmf_ifname(tmp_if), h->flags);
-+		bphy_err(drvr, "%s: non-BCDC packet received, flags 0x%x\n",
-+			 brcmf_ifname(tmp_if), h->flags);
- 		return -EBADE;
- 	}
- 
-@@ -460,7 +460,7 @@ int brcmf_proto_bcdc_attach(struct brcmf
- 
- 	/* ensure that the msg buf directly follows the cdc msg struct */
- 	if ((unsigned long)(&bcdc->msg + 1) != (unsigned long)bcdc->buf) {
--		brcmf_err("struct brcmf_proto_bcdc is not correctly defined\n");
-+		bphy_err(drvr, "struct brcmf_proto_bcdc is not correctly defined\n");
- 		goto fail;
- 	}
- 
---- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/common.c
-+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/common.c
-@@ -90,6 +90,7 @@ struct brcmf_mp_global_t brcmf_mp_global
- 
- void brcmf_c_set_joinpref_default(struct brcmf_if *ifp)
- {
-+	struct brcmf_pub *drvr = ifp->drvr;
- 	struct brcmf_join_pref_params join_pref_params[2];
- 	int err;
- 
-@@ -106,7 +107,7 @@ void brcmf_c_set_joinpref_default(struct
- 	err = brcmf_fil_iovar_data_set(ifp, "join_pref", join_pref_params,
- 				       sizeof(join_pref_params));
- 	if (err)
--		brcmf_err("Set join_pref error (%d)\n", err);
-+		bphy_err(drvr, "Set join_pref error (%d)\n", err);
- }
- 
- static int brcmf_c_download(struct brcmf_if *ifp, u16 flag,
-@@ -129,7 +130,8 @@ static int brcmf_c_download(struct brcmf
- 
- static int brcmf_c_process_clm_blob(struct brcmf_if *ifp)
- {
--	struct brcmf_bus *bus = ifp->drvr->bus_if;
-+	struct brcmf_pub *drvr = ifp->drvr;
-+	struct brcmf_bus *bus = drvr->bus_if;
- 	struct brcmf_dload_data_le *chunk_buf;
- 	const struct firmware *clm = NULL;
- 	u8 clm_name[BRCMF_FW_NAME_LEN];
-@@ -145,7 +147,7 @@ static int brcmf_c_process_clm_blob(stru
- 	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);
-+		bphy_err(drvr, "get CLM blob file name failed (%d)\n", err);
- 		return err;
- 	}
- 
-@@ -182,12 +184,12 @@ static int brcmf_c_process_clm_blob(stru
- 	} while ((datalen > 0) && (err == 0));
- 
- 	if (err) {
--		brcmf_err("clmload (%zu byte file) failed (%d); ",
--			  clm->size, err);
-+		bphy_err(drvr, "clmload (%zu byte file) failed (%d)\n",
-+			 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);
-+			bphy_err(drvr, "get clmload_status failed (%d)\n", err);
- 		else
- 			brcmf_dbg(INFO, "clmload_status=%d\n", status);
- 		err = -EIO;
-@@ -201,6 +203,7 @@ done:
- 
- int brcmf_c_preinit_dcmds(struct brcmf_if *ifp)
- {
-+	struct brcmf_pub *drvr = ifp->drvr;
- 	s8 eventmask[BRCMF_EVENTING_MASK_LEN];
- 	u8 buf[BRCMF_DCMD_SMLEN];
- 	struct brcmf_bus *bus;
-@@ -214,7 +217,7 @@ int brcmf_c_preinit_dcmds(struct brcmf_i
- 	err = brcmf_fil_iovar_data_get(ifp, "cur_etheraddr", ifp->mac_addr,
- 				       sizeof(ifp->mac_addr));
- 	if (err < 0) {
--		brcmf_err("Retrieving cur_etheraddr failed, %d\n", err);
-+		bphy_err(drvr, "Retrieving cur_etheraddr failed, %d\n", err);
- 		goto done;
- 	}
- 	memcpy(ifp->drvr->wiphy->perm_addr, ifp->drvr->mac, ETH_ALEN);
-@@ -226,7 +229,7 @@ int brcmf_c_preinit_dcmds(struct brcmf_i
- 	err = brcmf_fil_cmd_data_get(ifp, BRCMF_C_GET_REVINFO,
- 				     &revinfo, sizeof(revinfo));
- 	if (err < 0) {
--		brcmf_err("retrieving revision info failed, %d\n", err);
-+		bphy_err(drvr, "retrieving revision info failed, %d\n", err);
- 		strlcpy(ri->chipname, "UNKNOWN", sizeof(ri->chipname));
- 	} else {
- 		ri->vendorid = le32_to_cpu(revinfo.vendorid);
-@@ -260,7 +263,7 @@ int brcmf_c_preinit_dcmds(struct brcmf_i
- 	/* Do any CLM downloading */
- 	err = brcmf_c_process_clm_blob(ifp);
- 	if (err < 0) {
--		brcmf_err("download CLM blob file failed, %d\n", err);
-+		bphy_err(drvr, "download CLM blob file failed, %d\n", err);
- 		goto done;
- 	}
- 
-@@ -269,8 +272,8 @@ int brcmf_c_preinit_dcmds(struct brcmf_i
- 	strcpy(buf, "ver");
- 	err = brcmf_fil_iovar_data_get(ifp, "ver", buf, sizeof(buf));
- 	if (err < 0) {
--		brcmf_err("Retrieving version information failed, %d\n",
--			  err);
-+		bphy_err(drvr, "Retrieving version information failed, %d\n",
-+			 err);
- 		goto done;
- 	}
- 	ptr = (char *)buf;
-@@ -304,7 +307,7 @@ int brcmf_c_preinit_dcmds(struct brcmf_i
- 	/* set mpc */
- 	err = brcmf_fil_iovar_int_set(ifp, "mpc", 1);
- 	if (err) {
--		brcmf_err("failed setting mpc\n");
-+		bphy_err(drvr, "failed setting mpc\n");
- 		goto done;
- 	}
- 
-@@ -314,14 +317,14 @@ int brcmf_c_preinit_dcmds(struct brcmf_i
- 	err = brcmf_fil_iovar_data_get(ifp, "event_msgs", eventmask,
- 				       BRCMF_EVENTING_MASK_LEN);
- 	if (err) {
--		brcmf_err("Get event_msgs error (%d)\n", err);
-+		bphy_err(drvr, "Get event_msgs error (%d)\n", err);
- 		goto done;
- 	}
- 	setbit(eventmask, BRCMF_E_IF);
- 	err = brcmf_fil_iovar_data_set(ifp, "event_msgs", eventmask,
- 				       BRCMF_EVENTING_MASK_LEN);
- 	if (err) {
--		brcmf_err("Set event_msgs error (%d)\n", err);
-+		bphy_err(drvr, "Set event_msgs error (%d)\n", err);
- 		goto done;
- 	}
- 
-@@ -329,8 +332,8 @@ int brcmf_c_preinit_dcmds(struct brcmf_i
- 	err = brcmf_fil_cmd_int_set(ifp, BRCMF_C_SET_SCAN_CHANNEL_TIME,
- 				    BRCMF_DEFAULT_SCAN_CHANNEL_TIME);
- 	if (err) {
--		brcmf_err("BRCMF_C_SET_SCAN_CHANNEL_TIME error (%d)\n",
--			  err);
-+		bphy_err(drvr, "BRCMF_C_SET_SCAN_CHANNEL_TIME error (%d)\n",
-+			 err);
- 		goto done;
- 	}
- 
-@@ -338,8 +341,8 @@ int brcmf_c_preinit_dcmds(struct brcmf_i
- 	err = brcmf_fil_cmd_int_set(ifp, BRCMF_C_SET_SCAN_UNASSOC_TIME,
- 				    BRCMF_DEFAULT_SCAN_UNASSOC_TIME);
- 	if (err) {
--		brcmf_err("BRCMF_C_SET_SCAN_UNASSOC_TIME error (%d)\n",
--			  err);
-+		bphy_err(drvr, "BRCMF_C_SET_SCAN_UNASSOC_TIME error (%d)\n",
-+			 err);
- 		goto done;
- 	}
- 
---- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/core.c
-+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/core.c
-@@ -90,7 +90,7 @@ struct brcmf_if *brcmf_get_ifp(struct br
- 	s32 bsscfgidx;
- 
- 	if (ifidx < 0 || ifidx >= BRCMF_MAX_IFS) {
--		brcmf_err("ifidx %d out of range\n", ifidx);
-+		bphy_err(drvr, "ifidx %d out of range\n", ifidx);
- 		return NULL;
- 	}
- 
-@@ -141,7 +141,9 @@ void brcmf_configure_arp_nd_offload(stru
- 
- static void _brcmf_set_multicast_list(struct work_struct *work)
- {
--	struct brcmf_if *ifp;
-+	struct brcmf_if *ifp = container_of(work, struct brcmf_if,
-+					    multicast_work);
-+	struct brcmf_pub *drvr = ifp->drvr;
- 	struct net_device *ndev;
- 	struct netdev_hw_addr *ha;
- 	u32 cmd_value, cnt;
-@@ -150,8 +152,6 @@ static void _brcmf_set_multicast_list(st
- 	u32 buflen;
- 	s32 err;
- 
--	ifp = container_of(work, struct brcmf_if, multicast_work);
--
- 	brcmf_dbg(TRACE, "Enter, bsscfgidx=%d\n", ifp->bsscfgidx);
- 
- 	ndev = ifp->ndev;
-@@ -181,7 +181,7 @@ static void _brcmf_set_multicast_list(st
- 
- 	err = brcmf_fil_iovar_data_set(ifp, "mcast_list", buf, buflen);
- 	if (err < 0) {
--		brcmf_err("Setting mcast_list failed, %d\n", err);
-+		bphy_err(drvr, "Setting mcast_list failed, %d\n", err);
- 		cmd_value = cnt ? true : cmd_value;
- 	}
- 
-@@ -194,25 +194,25 @@ static void _brcmf_set_multicast_list(st
- 	 */
- 	err = brcmf_fil_iovar_int_set(ifp, "allmulti", cmd_value);
- 	if (err < 0)
--		brcmf_err("Setting allmulti failed, %d\n", err);
-+		bphy_err(drvr, "Setting allmulti failed, %d\n", err);
- 
- 	/*Finally, pick up the PROMISC flag */
- 	cmd_value = (ndev->flags & IFF_PROMISC) ? true : false;
- 	err = brcmf_fil_cmd_int_set(ifp, BRCMF_C_SET_PROMISC, cmd_value);
- 	if (err < 0)
--		brcmf_err("Setting BRCMF_C_SET_PROMISC failed, %d\n",
--			  err);
-+		bphy_err(drvr, "Setting BRCMF_C_SET_PROMISC failed, %d\n",
-+			 err);
- 	brcmf_configure_arp_nd_offload(ifp, !cmd_value);
- }
- 
- #if IS_ENABLED(CONFIG_IPV6)
- static void _brcmf_update_ndtable(struct work_struct *work)
- {
--	struct brcmf_if *ifp;
-+	struct brcmf_if *ifp = container_of(work, struct brcmf_if,
-+					    ndoffload_work);
-+	struct brcmf_pub *drvr = ifp->drvr;
- 	int i, ret;
- 
--	ifp = container_of(work, struct brcmf_if, ndoffload_work);
--
- 	/* clear the table in firmware */
- 	ret = brcmf_fil_iovar_data_set(ifp, "nd_hostip_clear", NULL, 0);
- 	if (ret) {
-@@ -225,7 +225,7 @@ static void _brcmf_update_ndtable(struct
- 					       &ifp->ipv6_addr_tbl[i],
- 					       sizeof(struct in6_addr));
- 		if (ret)
--			brcmf_err("add nd ip err %d\n", ret);
-+			bphy_err(drvr, "add nd ip err %d\n", ret);
- 	}
- }
- #else
-@@ -238,6 +238,7 @@ static int brcmf_netdev_set_mac_address(
- {
- 	struct brcmf_if *ifp = netdev_priv(ndev);
- 	struct sockaddr *sa = (struct sockaddr *)addr;
-+	struct brcmf_pub *drvr = ifp->drvr;
- 	int err;
- 
- 	brcmf_dbg(TRACE, "Enter, bsscfgidx=%d\n", ifp->bsscfgidx);
-@@ -245,7 +246,7 @@ static int brcmf_netdev_set_mac_address(
- 	err = brcmf_fil_iovar_data_set(ifp, "cur_etheraddr", sa->sa_data,
- 				       ETH_ALEN);
- 	if (err < 0) {
--		brcmf_err("Setting cur_etheraddr failed, %d\n", err);
-+		bphy_err(drvr, "Setting cur_etheraddr failed, %d\n", err);
- 	} else {
- 		brcmf_dbg(TRACE, "updated to %pM\n", sa->sa_data);
- 		memcpy(ifp->mac_addr, sa->sa_data, ETH_ALEN);
-@@ -305,7 +306,7 @@ static netdev_tx_t brcmf_netdev_start_xm
- 
- 	/* Can the device send data? */
- 	if (drvr->bus_if->state != BRCMF_BUS_UP) {
--		brcmf_err("xmit rejected state=%d\n", drvr->bus_if->state);
-+		bphy_err(drvr, "xmit rejected state=%d\n", drvr->bus_if->state);
- 		netif_stop_queue(ndev);
- 		dev_kfree_skb(skb);
- 		ret = -ENODEV;
-@@ -339,8 +340,8 @@ static netdev_tx_t brcmf_netdev_start_xm
- 		ret = pskb_expand_head(skb, ALIGN(head_delta, NET_SKB_PAD), 0,
- 				       GFP_ATOMIC);
- 		if (ret < 0) {
--			brcmf_err("%s: failed to expand headroom\n",
--				  brcmf_ifname(ifp));
-+			bphy_err(drvr, "%s: failed to expand headroom\n",
-+				 brcmf_ifname(ifp));
- 			atomic_inc(&drvr->bus_if->stats.pktcow_failed);
- 			goto done;
- 		}
-@@ -607,7 +608,7 @@ static int brcmf_netdev_open(struct net_
- 
- 	/* If bus is not ready, can't continue */
- 	if (bus_if->state != BRCMF_BUS_UP) {
--		brcmf_err("failed bus is not ready\n");
-+		bphy_err(drvr, "failed bus is not ready\n");
- 		return -EAGAIN;
- 	}
- 
-@@ -621,7 +622,7 @@ static int brcmf_netdev_open(struct net_
- 		ndev->features &= ~NETIF_F_IP_CSUM;
- 
- 	if (brcmf_cfg80211_up(ndev)) {
--		brcmf_err("failed to bring up cfg80211\n");
-+		bphy_err(drvr, "failed to bring up cfg80211\n");
- 		return -EIO;
- 	}
- 
-@@ -683,7 +684,7 @@ int brcmf_net_attach(struct brcmf_if *if
- 	else
- 		err = register_netdev(ndev);
- 	if (err != 0) {
--		brcmf_err("couldn't register the net device\n");
-+		bphy_err(drvr, "couldn't register the net device\n");
- 		goto fail;
- 	}
- 
-@@ -760,6 +761,7 @@ static const struct net_device_ops brcmf
- 
- static int brcmf_net_p2p_attach(struct brcmf_if *ifp)
- {
-+	struct brcmf_pub *drvr = ifp->drvr;
- 	struct net_device *ndev;
- 
- 	brcmf_dbg(TRACE, "Enter, bsscfgidx=%d mac=%pM\n", ifp->bsscfgidx,
-@@ -772,7 +774,7 @@ static int brcmf_net_p2p_attach(struct b
- 	memcpy(ndev->dev_addr, ifp->mac_addr, ETH_ALEN);
- 
- 	if (register_netdev(ndev) != 0) {
--		brcmf_err("couldn't register the p2p net device\n");
-+		bphy_err(drvr, "couldn't register the p2p net device\n");
- 		goto fail;
- 	}
- 
-@@ -801,8 +803,8 @@ struct brcmf_if *brcmf_add_if(struct brc
- 	 */
- 	if (ifp) {
- 		if (ifidx) {
--			brcmf_err("ERROR: netdev:%s already exists\n",
--				  ifp->ndev->name);
-+			bphy_err(drvr, "ERROR: netdev:%s already exists\n",
-+				 ifp->ndev->name);
- 			netif_stop_queue(ifp->ndev);
- 			brcmf_net_detach(ifp->ndev, false);
- 			drvr->iflist[bsscfgidx] = NULL;
-@@ -864,7 +866,7 @@ static void brcmf_del_if(struct brcmf_pu
- 	ifp = drvr->iflist[bsscfgidx];
- 	drvr->iflist[bsscfgidx] = NULL;
- 	if (!ifp) {
--		brcmf_err("Null interface, bsscfgidx=%d\n", bsscfgidx);
-+		bphy_err(drvr, "Null interface, bsscfgidx=%d\n", bsscfgidx);
- 		return;
- 	}
- 	brcmf_dbg(TRACE, "Enter, bsscfgidx=%d, ifidx=%d\n", bsscfgidx,
-@@ -914,16 +916,17 @@ static int brcmf_psm_watchdog_notify(str
- 				     const struct brcmf_event_msg *evtmsg,
- 				     void *data)
- {
-+	struct brcmf_pub *drvr = ifp->drvr;
- 	int err;
- 
- 	brcmf_dbg(TRACE, "enter: bsscfgidx=%d\n", ifp->bsscfgidx);
- 
--	brcmf_err("PSM's watchdog has fired!\n");
-+	bphy_err(drvr, "PSM's watchdog has fired!\n");
- 
- 	err = brcmf_debug_create_memdump(ifp->drvr->bus_if, data,
- 					 evtmsg->datalen);
- 	if (err)
--		brcmf_err("Failed to get memory dump, %d\n", err);
-+		bphy_err(drvr, "Failed to get memory dump, %d\n", err);
- 
- 	return err;
- }
-@@ -967,7 +970,7 @@ static int brcmf_inetaddr_changed(struct
- 	ret = brcmf_fil_iovar_data_get(ifp, "arp_hostip", addr_table,
- 				       sizeof(addr_table));
- 	if (ret) {
--		brcmf_err("fail to get arp ip table err:%d\n", ret);
-+		bphy_err(drvr, "fail to get arp ip table err:%d\n", ret);
- 		return NOTIFY_OK;
- 	}
- 
-@@ -984,7 +987,7 @@ static int brcmf_inetaddr_changed(struct
- 			ret = brcmf_fil_iovar_data_set(ifp, "arp_hostip",
- 				&ifa->ifa_address, sizeof(ifa->ifa_address));
- 			if (ret)
--				brcmf_err("add arp ip err %d\n", ret);
-+				bphy_err(drvr, "add arp ip err %d\n", ret);
- 		}
- 		break;
- 	case NETDEV_DOWN:
-@@ -996,8 +999,8 @@ static int brcmf_inetaddr_changed(struct
- 			ret = brcmf_fil_iovar_data_set(ifp, "arp_hostip_clear",
- 						       NULL, 0);
- 			if (ret) {
--				brcmf_err("fail to clear arp ip table err:%d\n",
--					  ret);
-+				bphy_err(drvr, "fail to clear arp ip table err:%d\n",
-+					 ret);
- 				return NOTIFY_OK;
- 			}
- 			for (i = 0; i < ARPOL_MAX_ENTRIES; i++) {
-@@ -1007,8 +1010,8 @@ static int brcmf_inetaddr_changed(struct
- 							       &addr_table[i],
- 							       sizeof(addr_table[i]));
- 				if (ret)
--					brcmf_err("add arp ip err %d\n",
--						  ret);
-+					bphy_err(drvr, "add arp ip err %d\n",
-+						 ret);
- 			}
- 		}
- 		break;
-@@ -1182,7 +1185,7 @@ static int brcmf_bus_started(struct brcm
- 	return 0;
- 
- fail:
--	brcmf_err("failed: %d\n", ret);
-+	bphy_err(drvr, "failed: %d\n", ret);
- 	if (drvr->config) {
- 		brcmf_cfg80211_detach(drvr->config);
- 		drvr->config = NULL;
-@@ -1234,7 +1237,7 @@ int brcmf_attach(struct device *dev, str
- 	/* Attach and link in the protocol */
- 	ret = brcmf_proto_attach(drvr);
- 	if (ret != 0) {
--		brcmf_err("brcmf_prot_attach failed\n");
-+		bphy_err(drvr, "brcmf_prot_attach failed\n");
- 		goto fail;
- 	}
- 
-@@ -1247,7 +1250,7 @@ int brcmf_attach(struct device *dev, str
- 
- 	ret = brcmf_bus_started(drvr, ops);
- 	if (ret != 0) {
--		brcmf_err("dongle is not responding: err=%d\n", ret);
-+		bphy_err(drvr, "dongle is not responding: err=%d\n", ret);
- 		goto fail;
- 	}
- 
-@@ -1347,6 +1350,7 @@ static int brcmf_get_pend_8021x_cnt(stru
- 
- int brcmf_netdev_wait_pend8021x(struct brcmf_if *ifp)
- {
-+	struct brcmf_pub *drvr = ifp->drvr;
- 	int err;
- 
- 	err = wait_event_timeout(ifp->pend_8021x_wait,
-@@ -1354,7 +1358,7 @@ int brcmf_netdev_wait_pend8021x(struct b
- 				 MAX_WAIT_FOR_8021X_TX);
- 
- 	if (!err)
--		brcmf_err("Timed out waiting for no pending 802.1x packets\n");
-+		bphy_err(drvr, "Timed out waiting for no pending 802.1x packets\n");
- 
- 	return !err;
- }
---- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/feature.c
-+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/feature.c
-@@ -185,13 +185,14 @@ static void brcmf_feat_iovar_data_set(st
- #define MAX_CAPS_BUFFER_SIZE	768
- static void brcmf_feat_firmware_capabilities(struct brcmf_if *ifp)
- {
-+	struct brcmf_pub *drvr = ifp->drvr;
- 	char caps[MAX_CAPS_BUFFER_SIZE];
- 	enum brcmf_feat_id id;
- 	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);
-+		bphy_err(drvr, "could not get firmware cap (%d)\n", err);
- 		return;
- 	}
- 
-@@ -216,14 +217,15 @@ static void brcmf_feat_firmware_capabili
- 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);
-+	struct brcmf_pub *drvr = bus_if->drvr;
-+	struct brcmf_if *ifp = brcmf_get_ifp(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);
-+		bphy_err(drvr, "could not get firmware cap (%d)\n", err);
- 		return err;
- 	}
- 
---- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/fweh.c
-+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/fweh.c
-@@ -102,7 +102,8 @@ static void brcmf_fweh_queue_event(struc
- 	schedule_work(&fweh->event_work);
- }
- 
--static int brcmf_fweh_call_event_handler(struct brcmf_if *ifp,
-+static int brcmf_fweh_call_event_handler(struct brcmf_pub *drvr,
-+					 struct brcmf_if *ifp,
- 					 enum brcmf_fweh_event_code code,
- 					 struct brcmf_event_msg *emsg,
- 					 void *data)
-@@ -117,9 +118,9 @@ static int brcmf_fweh_call_event_handler
- 		if (fweh->evt_handler[code])
- 			err = fweh->evt_handler[code](ifp, emsg, data);
- 		else
--			brcmf_err("unhandled event %d ignored\n", code);
-+			bphy_err(drvr, "unhandled event %d ignored\n", code);
- 	} else {
--		brcmf_err("no interface object\n");
-+		bphy_err(drvr, "no interface object\n");
- 	}
- 	return err;
- }
-@@ -158,7 +159,7 @@ static void brcmf_fweh_handle_if_event(s
- 		return;
- 	}
- 	if (ifevent->ifidx >= BRCMF_MAX_IFS) {
--		brcmf_err("invalid interface index: %u\n", ifevent->ifidx);
-+		bphy_err(drvr, "invalid interface index: %u\n", ifevent->ifidx);
- 		return;
- 	}
- 
-@@ -181,7 +182,8 @@ static void brcmf_fweh_handle_if_event(s
- 	if (ifp && ifevent->action == BRCMF_E_IF_CHANGE)
- 		brcmf_proto_reset_if(drvr, ifp);
- 
--	err = brcmf_fweh_call_event_handler(ifp, emsg->event_code, emsg, data);
-+	err = brcmf_fweh_call_event_handler(drvr, ifp, emsg->event_code, emsg,
-+					    data);
- 
- 	if (ifp && ifevent->action == BRCMF_E_IF_DEL) {
- 		bool armed = brcmf_cfg80211_vif_event_armed(drvr->config);
-@@ -268,11 +270,11 @@ static void brcmf_fweh_event_worker(stru
- 			ifp = drvr->iflist[0];
- 		else
- 			ifp = drvr->iflist[emsg.bsscfgidx];
--		err = brcmf_fweh_call_event_handler(ifp, event->code, &emsg,
--						    event->data);
-+		err = brcmf_fweh_call_event_handler(drvr, ifp, event->code,
-+						    &emsg, event->data);
- 		if (err) {
--			brcmf_err("event handler failed (%d)\n",
--				  event->code);
-+			bphy_err(drvr, "event handler failed (%d)\n",
-+				 event->code);
- 			err = 0;
- 		}
- event_free:
-@@ -339,7 +341,7 @@ int brcmf_fweh_register(struct brcmf_pub
- 			brcmf_fweh_handler_t handler)
- {
- 	if (drvr->fweh.evt_handler[code]) {
--		brcmf_err("event code %d already registered\n", code);
-+		bphy_err(drvr, "event code %d already registered\n", code);
- 		return -ENOSPC;
- 	}
- 	drvr->fweh.evt_handler[code] = handler;
-@@ -369,6 +371,7 @@ void brcmf_fweh_unregister(struct brcmf_
-  */
- int brcmf_fweh_activate_events(struct brcmf_if *ifp)
- {
-+	struct brcmf_pub *drvr = ifp->drvr;
- 	int i, err;
- 	s8 eventmask[BRCMF_EVENTING_MASK_LEN];
- 
-@@ -388,7 +391,7 @@ int brcmf_fweh_activate_events(struct br
- 	err = brcmf_fil_iovar_data_set(ifp, "event_msgs",
- 				       eventmask, BRCMF_EVENTING_MASK_LEN);
- 	if (err)
--		brcmf_err("Set event_msgs error (%d)\n", err);
-+		bphy_err(drvr, "Set event_msgs error (%d)\n", err);
- 
- 	return err;
- }
---- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/fwil.c
-+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/fwil.c
-@@ -110,7 +110,7 @@ brcmf_fil_cmd_data(struct brcmf_if *ifp,
- 	s32 err, fwerr;
- 
- 	if (drvr->bus_if->state != BRCMF_BUS_UP) {
--		brcmf_err("bus is down. we have nothing to do.\n");
-+		bphy_err(drvr, "bus is down. we have nothing to do.\n");
- 		return -EIO;
- 	}
- 
-@@ -242,7 +242,7 @@ brcmf_fil_iovar_data_set(struct brcmf_if
- 					 buflen, true);
- 	} else {
- 		err = -EPERM;
--		brcmf_err("Creating iovar failed\n");
-+		bphy_err(drvr, "Creating iovar failed\n");
- 	}
- 
- 	mutex_unlock(&drvr->proto_block);
-@@ -268,7 +268,7 @@ brcmf_fil_iovar_data_get(struct brcmf_if
- 			memcpy(data, drvr->proto_buf, len);
- 	} else {
- 		err = -EPERM;
--		brcmf_err("Creating iovar failed\n");
-+		bphy_err(drvr, "Creating iovar failed\n");
- 	}
- 
- 	brcmf_dbg(FIL, "ifidx=%d, name=%s, len=%d\n", ifp->ifidx, name, len);
-@@ -366,7 +366,7 @@ brcmf_fil_bsscfg_data_set(struct brcmf_i
- 					 buflen, true);
- 	} else {
- 		err = -EPERM;
--		brcmf_err("Creating bsscfg failed\n");
-+		bphy_err(drvr, "Creating bsscfg failed\n");
- 	}
- 
- 	mutex_unlock(&drvr->proto_block);
-@@ -392,7 +392,7 @@ brcmf_fil_bsscfg_data_get(struct brcmf_i
- 			memcpy(data, drvr->proto_buf, len);
- 	} else {
- 		err = -EPERM;
--		brcmf_err("Creating bsscfg failed\n");
-+		bphy_err(drvr, "Creating bsscfg failed\n");
- 	}
- 	brcmf_dbg(FIL, "ifidx=%d, bsscfgidx=%d, name=%s, len=%d\n", ifp->ifidx,
- 		  ifp->bsscfgidx, name, len);
---- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/fwsignal.c
-+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/fwsignal.c
-@@ -1255,6 +1255,7 @@ static int brcmf_fws_enq(struct brcmf_fw
- 			 enum brcmf_fws_skb_state state, int fifo,
- 			 struct sk_buff *p)
- {
-+	struct brcmf_pub *drvr = fws->drvr;
- 	int prec = 2 * fifo;
- 	u32 *qfull_stat = &fws->stats.delayq_full_error;
- 	struct brcmf_fws_mac_descriptor *entry;
-@@ -1267,7 +1268,7 @@ static int brcmf_fws_enq(struct brcmf_fw
- 
- 	entry = brcmf_skbcb(p)->mac;
- 	if (entry == NULL) {
--		brcmf_err("no mac descriptor found for skb %p\n", p);
-+		bphy_err(drvr, "no mac descriptor found for skb %p\n", p);
- 		return -ENOENT;
- 	}
- 
-@@ -1457,6 +1458,7 @@ static int
- brcmf_fws_txs_process(struct brcmf_fws_info *fws, u8 flags, u32 hslot,
- 		      u32 genbit, u16 seq, u8 compcnt)
- {
-+	struct brcmf_pub *drvr = fws->drvr;
- 	u32 fifo;
- 	u8 cnt = 0;
- 	int ret;
-@@ -1481,14 +1483,14 @@ brcmf_fws_txs_process(struct brcmf_fws_i
- 	else if (flags == BRCMF_FWS_TXSTATUS_HOST_TOSSED)
- 		fws->stats.txs_host_tossed += compcnt;
- 	else
--		brcmf_err("unexpected txstatus\n");
-+		bphy_err(drvr, "unexpected txstatus\n");
- 
- 	while (cnt < compcnt) {
- 		ret = brcmf_fws_hanger_poppkt(&fws->hanger, hslot, &skb,
- 					      remove_from_hanger);
- 		if (ret != 0) {
--			brcmf_err("no packet in hanger slot: hslot=%d\n",
--				  hslot);
-+			bphy_err(drvr, "no packet in hanger slot: hslot=%d\n",
-+				 hslot);
- 			goto cont;
- 		}
- 
-@@ -1612,12 +1614,13 @@ static int brcmf_fws_notify_credit_map(s
- 				       const struct brcmf_event_msg *e,
- 				       void *data)
- {
--	struct brcmf_fws_info *fws = drvr_to_fws(ifp->drvr);
-+	struct brcmf_pub *drvr = ifp->drvr;
-+	struct brcmf_fws_info *fws = drvr_to_fws(drvr);
- 	int i;
- 	u8 *credits = data;
- 
- 	if (e->datalen < BRCMF_FWS_FIFO_COUNT) {
--		brcmf_err("event payload too small (%d)\n", e->datalen);
-+		bphy_err(drvr, "event payload too small (%d)\n", e->datalen);
- 		return -EINVAL;
- 	}
- 
-@@ -1681,6 +1684,7 @@ static void brcmf_rxreorder_get_skb_list
- 
- void brcmf_fws_rxreorder(struct brcmf_if *ifp, struct sk_buff *pkt)
- {
-+	struct brcmf_pub *drvr = ifp->drvr;
- 	u8 *reorder_data;
- 	u8 flow_id, max_idx, cur_idx, exp_idx, end_idx;
- 	struct brcmf_ampdu_rx_reorder *rfi;
-@@ -1695,7 +1699,7 @@ void brcmf_fws_rxreorder(struct brcmf_if
- 
- 	/* validate flags and flow id */
- 	if (flags == 0xFF) {
--		brcmf_err("invalid flags...so ignore this packet\n");
-+		bphy_err(drvr, "invalid flags...so ignore this packet\n");
- 		brcmf_netif_rx(ifp, pkt);
- 		return;
- 	}
-@@ -1732,7 +1736,7 @@ void brcmf_fws_rxreorder(struct brcmf_if
- 			  flow_id, max_idx);
- 		rfi = kzalloc(buf_size, GFP_ATOMIC);
- 		if (rfi == NULL) {
--			brcmf_err("failed to alloc buffer\n");
-+			bphy_err(drvr, "failed to alloc buffer\n");
- 			brcmf_netif_rx(ifp, pkt);
- 			return;
- 		}
-@@ -1996,6 +2000,7 @@ static u8 brcmf_fws_precommit_skb(struct
- static void brcmf_fws_rollback_toq(struct brcmf_fws_info *fws,
- 				   struct sk_buff *skb, int fifo)
- {
-+	struct brcmf_pub *drvr = fws->drvr;
- 	struct brcmf_fws_mac_descriptor *entry;
- 	struct sk_buff *pktout;
- 	int qidx, hslot;
-@@ -2009,11 +2014,11 @@ static void brcmf_fws_rollback_toq(struc
- 
- 		pktout = brcmu_pktq_penq_head(&entry->psq, qidx, skb);
- 		if (pktout == NULL) {
--			brcmf_err("%s queue %d full\n", entry->name, qidx);
-+			bphy_err(drvr, "%s queue %d full\n", entry->name, qidx);
- 			rc = -ENOSPC;
- 		}
- 	} else {
--		brcmf_err("%s entry removed\n", entry->name);
-+		bphy_err(drvr, "%s entry removed\n", entry->name);
- 		rc = -ENOENT;
- 	}
- 
-@@ -2118,7 +2123,8 @@ static int brcmf_fws_assign_htod(struct
- 
- int brcmf_fws_process_skb(struct brcmf_if *ifp, struct sk_buff *skb)
- {
--	struct brcmf_fws_info *fws = drvr_to_fws(ifp->drvr);
-+	struct brcmf_pub *drvr = ifp->drvr;
-+	struct brcmf_fws_info *fws = drvr_to_fws(drvr);
- 	struct brcmf_skbuff_cb *skcb = brcmf_skbcb(skb);
- 	struct ethhdr *eh = (struct ethhdr *)(skb->data);
- 	int fifo = BRCMF_FWS_FIFO_BCMC;
-@@ -2146,7 +2152,7 @@ int brcmf_fws_process_skb(struct brcmf_i
- 		brcmf_fws_enq(fws, BRCMF_FWS_SKBSTATE_DELAYED, fifo, skb);
- 		brcmf_fws_schedule_deq(fws);
- 	} else {
--		brcmf_err("drop skb: no hanger slot\n");
-+		bphy_err(drvr, "drop skb: no hanger slot\n");
- 		brcmf_txfinalize(ifp, skb, false);
- 		rc = -ENOMEM;
- 	}
-@@ -2365,7 +2371,7 @@ struct brcmf_fws_info *brcmf_fws_attach(
- 
- 	fws->fws_wq = create_singlethread_workqueue("brcmf_fws_wq");
- 	if (fws->fws_wq == NULL) {
--		brcmf_err("workqueue creation failed\n");
-+		bphy_err(drvr, "workqueue creation failed\n");
- 		rc = -EBADF;
- 		goto fail;
- 	}
-@@ -2381,13 +2387,13 @@ struct brcmf_fws_info *brcmf_fws_attach(
- 	rc = brcmf_fweh_register(drvr, BRCMF_E_FIFO_CREDIT_MAP,
- 				 brcmf_fws_notify_credit_map);
- 	if (rc < 0) {
--		brcmf_err("register credit map handler failed\n");
-+		bphy_err(drvr, "register credit map handler failed\n");
- 		goto fail;
- 	}
- 	rc = brcmf_fweh_register(drvr, BRCMF_E_BCMC_CREDIT_SUPPORT,
- 				 brcmf_fws_notify_bcmc_credit_support);
- 	if (rc < 0) {
--		brcmf_err("register bcmc credit handler failed\n");
-+		bphy_err(drvr, "register bcmc credit handler failed\n");
- 		brcmf_fweh_unregister(drvr, BRCMF_E_FIFO_CREDIT_MAP);
- 		goto fail;
- 	}
-@@ -2399,7 +2405,7 @@ struct brcmf_fws_info *brcmf_fws_attach(
- 	fws->fw_signals = true;
- 	ifp = brcmf_get_ifp(drvr, 0);
- 	if (brcmf_fil_iovar_int_set(ifp, "tlv", tlv)) {
--		brcmf_err("failed to set bdcv2 tlv signaling\n");
-+		bphy_err(drvr, "failed to set bdcv2 tlv signaling\n");
- 		fws->fcmode = BRCMF_FWS_FCMODE_NONE;
- 		fws->fw_signals = false;
- 	}
---- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/msgbuf.c
-+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/msgbuf.c
-@@ -439,7 +439,7 @@ static int brcmf_msgbuf_tx_ioctl(struct
- 	brcmf_commonring_lock(commonring);
- 	ret_ptr = brcmf_commonring_reserve_for_write(commonring);
- 	if (!ret_ptr) {
--		brcmf_err("Failed to reserve space in commonring\n");
-+		bphy_err(drvr, "Failed to reserve space in commonring\n");
- 		brcmf_commonring_unlock(commonring);
- 		return -ENOMEM;
- 	}
-@@ -503,7 +503,7 @@ static int brcmf_msgbuf_query_dcmd(struc
- 
- 	timeout = brcmf_msgbuf_ioctl_resp_wait(msgbuf);
- 	if (!timeout) {
--		brcmf_err("Timeout on response for query command\n");
-+		bphy_err(drvr, "Timeout on response for query command\n");
- 		return -EIO;
- 	}
- 
-@@ -580,6 +580,7 @@ static u32
- brcmf_msgbuf_flowring_create_worker(struct brcmf_msgbuf *msgbuf,
- 				    struct brcmf_msgbuf_work_item *work)
- {
-+	struct brcmf_pub *drvr = msgbuf->drvr;
- 	struct msgbuf_tx_flowring_create_req *create;
- 	struct brcmf_commonring *commonring;
- 	void *ret_ptr;
-@@ -595,7 +596,7 @@ brcmf_msgbuf_flowring_create_worker(stru
- 				     &msgbuf->flowring_dma_handle[flowid],
- 				     GFP_KERNEL);
- 	if (!dma_buf) {
--		brcmf_err("dma_alloc_coherent failed\n");
-+		bphy_err(drvr, "dma_alloc_coherent failed\n");
- 		brcmf_flowring_delete(msgbuf->flow, flowid);
- 		return BRCMF_FLOWRING_INVALID_ID;
- 	}
-@@ -608,7 +609,7 @@ brcmf_msgbuf_flowring_create_worker(stru
- 	brcmf_commonring_lock(commonring);
- 	ret_ptr = brcmf_commonring_reserve_for_write(commonring);
- 	if (!ret_ptr) {
--		brcmf_err("Failed to reserve space in commonring\n");
-+		bphy_err(drvr, "Failed to reserve space in commonring\n");
- 		brcmf_commonring_unlock(commonring);
- 		brcmf_msgbuf_remove_flowring(msgbuf, flowid);
- 		return BRCMF_FLOWRING_INVALID_ID;
-@@ -635,7 +636,7 @@ brcmf_msgbuf_flowring_create_worker(stru
- 	err = brcmf_commonring_write_complete(commonring);
- 	brcmf_commonring_unlock(commonring);
- 	if (err) {
--		brcmf_err("Failed to write commonring\n");
-+		bphy_err(drvr, "Failed to write commonring\n");
- 		brcmf_msgbuf_remove_flowring(msgbuf, flowid);
- 		return BRCMF_FLOWRING_INVALID_ID;
- 	}
-@@ -694,6 +695,7 @@ static u32 brcmf_msgbuf_flowring_create(
- static void brcmf_msgbuf_txflow(struct brcmf_msgbuf *msgbuf, u16 flowid)
- {
- 	struct brcmf_flowring *flow = msgbuf->flow;
-+	struct brcmf_pub *drvr = msgbuf->drvr;
- 	struct brcmf_commonring *commonring;
- 	void *ret_ptr;
- 	u32 count;
-@@ -713,8 +715,8 @@ static void brcmf_msgbuf_txflow(struct b
- 	while (brcmf_flowring_qlen(flow, flowid)) {
- 		skb = brcmf_flowring_dequeue(flow, flowid);
- 		if (skb == NULL) {
--			brcmf_err("No SKB, but qlen %d\n",
--				  brcmf_flowring_qlen(flow, flowid));
-+			bphy_err(drvr, "No SKB, but qlen %d\n",
-+				 brcmf_flowring_qlen(flow, flowid));
- 			break;
- 		}
- 		skb_orphan(skb);
-@@ -722,7 +724,7 @@ static void brcmf_msgbuf_txflow(struct b
- 					     msgbuf->tx_pktids, skb, ETH_HLEN,
- 					     &physaddr, &pktid)) {
- 			brcmf_flowring_reinsert(flow, flowid, skb);
--			brcmf_err("No PKTID available !!\n");
-+			bphy_err(drvr, "No PKTID available !!\n");
- 			break;
- 		}
- 		ret_ptr = brcmf_commonring_reserve_for_write(commonring);
-@@ -893,6 +895,7 @@ brcmf_msgbuf_process_txstatus(struct brc
- 
- static u32 brcmf_msgbuf_rxbuf_data_post(struct brcmf_msgbuf *msgbuf, u32 count)
- {
-+	struct brcmf_pub *drvr = msgbuf->drvr;
- 	struct brcmf_commonring *commonring;
- 	void *ret_ptr;
- 	struct sk_buff *skb;
-@@ -920,7 +923,7 @@ static u32 brcmf_msgbuf_rxbuf_data_post(
- 		skb = brcmu_pkt_buf_get_skb(BRCMF_MSGBUF_MAX_PKT_SIZE);
- 
- 		if (skb == NULL) {
--			brcmf_err("Failed to alloc SKB\n");
-+			bphy_err(drvr, "Failed to alloc SKB\n");
- 			brcmf_commonring_write_cancel(commonring, alloced - i);
- 			break;
- 		}
-@@ -930,7 +933,7 @@ static u32 brcmf_msgbuf_rxbuf_data_post(
- 					     msgbuf->rx_pktids, skb, 0,
- 					     &physaddr, &pktid)) {
- 			dev_kfree_skb_any(skb);
--			brcmf_err("No PKTID available !!\n");
-+			bphy_err(drvr, "No PKTID available !!\n");
- 			brcmf_commonring_write_cancel(commonring, alloced - i);
- 			break;
- 		}
-@@ -1000,6 +1003,7 @@ static u32
- brcmf_msgbuf_rxbuf_ctrl_post(struct brcmf_msgbuf *msgbuf, bool event_buf,
- 			     u32 count)
- {
-+	struct brcmf_pub *drvr = msgbuf->drvr;
- 	struct brcmf_commonring *commonring;
- 	void *ret_ptr;
- 	struct sk_buff *skb;
-@@ -1017,7 +1021,7 @@ brcmf_msgbuf_rxbuf_ctrl_post(struct brcm
- 							      count,
- 							      &alloced);
- 	if (!ret_ptr) {
--		brcmf_err("Failed to reserve space in commonring\n");
-+		bphy_err(drvr, "Failed to reserve space in commonring\n");
- 		brcmf_commonring_unlock(commonring);
- 		return 0;
- 	}
-@@ -1029,7 +1033,7 @@ brcmf_msgbuf_rxbuf_ctrl_post(struct brcm
- 		skb = brcmu_pkt_buf_get_skb(BRCMF_MSGBUF_MAX_PKT_SIZE);
- 
- 		if (skb == NULL) {
--			brcmf_err("Failed to alloc SKB\n");
-+			bphy_err(drvr, "Failed to alloc SKB\n");
- 			brcmf_commonring_write_cancel(commonring, alloced - i);
- 			break;
- 		}
-@@ -1039,7 +1043,7 @@ brcmf_msgbuf_rxbuf_ctrl_post(struct brcm
- 					     msgbuf->rx_pktids, skb, 0,
- 					     &physaddr, &pktid)) {
- 			dev_kfree_skb_any(skb);
--			brcmf_err("No PKTID available !!\n");
-+			bphy_err(drvr, "No PKTID available !!\n");
- 			brcmf_commonring_write_cancel(commonring, alloced - i);
- 			break;
- 		}
-@@ -1091,6 +1095,7 @@ static void brcmf_msgbuf_rxbuf_event_pos
- 
- static void brcmf_msgbuf_process_event(struct brcmf_msgbuf *msgbuf, void *buf)
- {
-+	struct brcmf_pub *drvr = msgbuf->drvr;
- 	struct msgbuf_rx_event *event;
- 	u32 idx;
- 	u16 buflen;
-@@ -1117,8 +1122,8 @@ static void brcmf_msgbuf_process_event(s
- 
- 	ifp = brcmf_get_ifp(msgbuf->drvr, event->msg.ifidx);
- 	if (!ifp || !ifp->ndev) {
--		brcmf_err("Received pkt for invalid ifidx %d\n",
--			  event->msg.ifidx);
-+		bphy_err(drvr, "Received pkt for invalid ifidx %d\n",
-+			 event->msg.ifidx);
- 		goto exit;
- 	}
- 
-@@ -1134,6 +1139,7 @@ exit:
- static void
- brcmf_msgbuf_process_rx_complete(struct brcmf_msgbuf *msgbuf, void *buf)
- {
-+	struct brcmf_pub *drvr = msgbuf->drvr;
- 	struct msgbuf_rx_complete *rx_complete;
- 	struct sk_buff *skb;
- 	u16 data_offset;
-@@ -1167,7 +1173,7 @@ brcmf_msgbuf_process_rx_complete(struct
- 		ifp = msgbuf->drvr->mon_if;
- 
- 		if (!ifp) {
--			brcmf_err("Received unexpected monitor pkt\n");
-+			bphy_err(drvr, "Received unexpected monitor pkt\n");
- 			brcmu_pkt_buf_free_skb(skb);
- 			return;
- 		}
-@@ -1178,8 +1184,8 @@ brcmf_msgbuf_process_rx_complete(struct
- 
- 	ifp = brcmf_get_ifp(msgbuf->drvr, rx_complete->msg.ifidx);
- 	if (!ifp || !ifp->ndev) {
--		brcmf_err("Received pkt for invalid ifidx %d\n",
--			  rx_complete->msg.ifidx);
-+		bphy_err(drvr, "Received pkt for invalid ifidx %d\n",
-+			 rx_complete->msg.ifidx);
- 		brcmu_pkt_buf_free_skb(skb);
- 		return;
- 	}
-@@ -1192,13 +1198,15 @@ static void brcmf_msgbuf_process_ring_st
- 					     void *buf)
- {
- 	struct msgbuf_ring_status *ring_status = buf;
-+	struct brcmf_pub *drvr = msgbuf->drvr;
- 	int err;
- 
- 	err = le16_to_cpu(ring_status->compl_hdr.status);
- 	if (err) {
- 		int ring = le16_to_cpu(ring_status->compl_hdr.flow_ring_id);
- 
--		brcmf_err("Firmware reported ring %d error: %d\n", ring, err);
-+		bphy_err(drvr, "Firmware reported ring %d error: %d\n", ring,
-+			 err);
- 	}
- }
- 
-@@ -1206,6 +1214,7 @@ static void
- brcmf_msgbuf_process_flow_ring_create_response(struct brcmf_msgbuf *msgbuf,
- 					       void *buf)
- {
-+	struct brcmf_pub *drvr = msgbuf->drvr;
- 	struct msgbuf_flowring_create_resp *flowring_create_resp;
- 	u16 status;
- 	u16 flowid;
-@@ -1217,7 +1226,7 @@ brcmf_msgbuf_process_flow_ring_create_re
- 	status =  le16_to_cpu(flowring_create_resp->compl_hdr.status);
- 
- 	if (status) {
--		brcmf_err("Flowring creation failed, code %d\n", status);
-+		bphy_err(drvr, "Flowring creation failed, code %d\n", status);
- 		brcmf_msgbuf_remove_flowring(msgbuf, flowid);
- 		return;
- 	}
-@@ -1234,6 +1243,7 @@ static void
- brcmf_msgbuf_process_flow_ring_delete_response(struct brcmf_msgbuf *msgbuf,
- 					       void *buf)
- {
-+	struct brcmf_pub *drvr = msgbuf->drvr;
- 	struct msgbuf_flowring_delete_resp *flowring_delete_resp;
- 	u16 status;
- 	u16 flowid;
-@@ -1245,7 +1255,7 @@ brcmf_msgbuf_process_flow_ring_delete_re
- 	status =  le16_to_cpu(flowring_delete_resp->compl_hdr.status);
- 
- 	if (status) {
--		brcmf_err("Flowring deletion failed, code %d\n", status);
-+		bphy_err(drvr, "Flowring deletion failed, code %d\n", status);
- 		brcmf_flowring_delete(msgbuf->flow, flowid);
- 		return;
- 	}
-@@ -1258,6 +1268,7 @@ brcmf_msgbuf_process_flow_ring_delete_re
- 
- static void brcmf_msgbuf_process_msgtype(struct brcmf_msgbuf *msgbuf, void *buf)
- {
-+	struct brcmf_pub *drvr = msgbuf->drvr;
- 	struct msgbuf_common_hdr *msg;
- 
- 	msg = (struct msgbuf_common_hdr *)buf;
-@@ -1294,7 +1305,7 @@ static void brcmf_msgbuf_process_msgtype
- 		brcmf_msgbuf_process_rx_complete(msgbuf, buf);
- 		break;
- 	default:
--		brcmf_err("Unsupported msgtype %d\n", msg->msgtype);
-+		bphy_err(drvr, "Unsupported msgtype %d\n", msg->msgtype);
- 		break;
- 	}
- }
-@@ -1377,7 +1388,7 @@ void brcmf_msgbuf_delete_flowring(struct
- 	brcmf_commonring_lock(commonring);
- 	ret_ptr = brcmf_commonring_reserve_for_write(commonring);
- 	if (!ret_ptr) {
--		brcmf_err("FW unaware, flowring will be removed !!\n");
-+		bphy_err(drvr, "FW unaware, flowring will be removed !!\n");
- 		brcmf_commonring_unlock(commonring);
- 		brcmf_msgbuf_remove_flowring(msgbuf, flowid);
- 		return;
-@@ -1401,7 +1412,7 @@ void brcmf_msgbuf_delete_flowring(struct
- 	err = brcmf_commonring_write_complete(commonring);
- 	brcmf_commonring_unlock(commonring);
- 	if (err) {
--		brcmf_err("Failed to submit RING_DELETE, flowring will be removed\n");
-+		bphy_err(drvr, "Failed to submit RING_DELETE, flowring will be removed\n");
- 		brcmf_msgbuf_remove_flowring(msgbuf, flowid);
- 	}
- }
-@@ -1476,8 +1487,8 @@ int brcmf_proto_msgbuf_attach(struct brc
- 	if_msgbuf = drvr->bus_if->msgbuf;
- 
- 	if (if_msgbuf->max_flowrings >= BRCMF_FLOWRING_HASHSIZE) {
--		brcmf_err("driver not configured for this many flowrings %d\n",
--			  if_msgbuf->max_flowrings);
-+		bphy_err(drvr, "driver not configured for this many flowrings %d\n",
-+			 if_msgbuf->max_flowrings);
- 		if_msgbuf->max_flowrings = BRCMF_FLOWRING_HASHSIZE - 1;
- 	}
- 
-@@ -1487,7 +1498,7 @@ int brcmf_proto_msgbuf_attach(struct brc
- 
- 	msgbuf->txflow_wq = create_singlethread_workqueue("msgbuf_txflow");
- 	if (msgbuf->txflow_wq == NULL) {
--		brcmf_err("workqueue creation failed\n");
-+		bphy_err(drvr, "workqueue creation failed\n");
- 		goto fail;
- 	}
- 	INIT_WORK(&msgbuf->txflow_work, brcmf_msgbuf_txflow_worker);
---- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/p2p.c
-+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/p2p.c
-@@ -434,6 +434,7 @@ static void brcmf_p2p_print_actframe(boo
-  */
- static int brcmf_p2p_set_firmware(struct brcmf_if *ifp, u8 *p2p_mac)
- {
-+	struct brcmf_pub *drvr = ifp->drvr;
- 	s32 ret = 0;
- 
- 	brcmf_fil_cmd_int_set(ifp, BRCMF_C_DOWN, 1);
-@@ -450,7 +451,7 @@ static int brcmf_p2p_set_firmware(struct
- 	ret = brcmf_fil_iovar_data_set(ifp, "p2p_da_override", p2p_mac,
- 				       ETH_ALEN);
- 	if (ret)
--		brcmf_err("failed to update device address ret %d\n", ret);
-+		bphy_err(drvr, "failed to update device address ret %d\n", ret);
- 
- 	return ret;
- }
-@@ -570,13 +571,14 @@ static s32 brcmf_p2p_deinit_discovery(st
-  */
- static int brcmf_p2p_enable_discovery(struct brcmf_p2p_info *p2p)
- {
-+	struct brcmf_pub *drvr = p2p->cfg->pub;
- 	struct brcmf_cfg80211_vif *vif;
- 	s32 ret = 0;
- 
- 	brcmf_dbg(TRACE, "enter\n");
- 	vif = p2p->bss_idx[P2PAPI_BSSCFG_DEVICE].vif;
- 	if (!vif) {
--		brcmf_err("P2P config device not available\n");
-+		bphy_err(drvr, "P2P config device not available\n");
- 		ret = -EPERM;
- 		goto exit;
- 	}
-@@ -590,13 +592,13 @@ static int brcmf_p2p_enable_discovery(st
- 	vif = p2p->bss_idx[P2PAPI_BSSCFG_PRIMARY].vif;
- 	ret = brcmf_fil_iovar_int_set(vif->ifp, "p2p_disc", 1);
- 	if (ret < 0) {
--		brcmf_err("set p2p_disc error\n");
-+		bphy_err(drvr, "set p2p_disc error\n");
- 		goto exit;
- 	}
- 	vif = p2p->bss_idx[P2PAPI_BSSCFG_DEVICE].vif;
- 	ret = brcmf_p2p_set_discover_state(vif->ifp, WL_P2P_DISC_ST_SCAN, 0, 0);
- 	if (ret < 0) {
--		brcmf_err("unable to set WL_P2P_DISC_ST_SCAN\n");
-+		bphy_err(drvr, "unable to set WL_P2P_DISC_ST_SCAN\n");
- 		goto exit;
- 	}
- 
-@@ -608,7 +610,7 @@ static int brcmf_p2p_enable_discovery(st
- 	 */
- 	ret = brcmf_fil_bsscfg_int_set(vif->ifp, "wsec", AES_ENABLED);
- 	if (ret < 0) {
--		brcmf_err("wsec error %d\n", ret);
-+		bphy_err(drvr, "wsec error %d\n", ret);
- 		goto exit;
- 	}
- 
-@@ -630,6 +632,7 @@ static s32 brcmf_p2p_escan(struct brcmf_
- 			   u16 chanspecs[], s32 search_state,
- 			   enum p2p_bss_type bss_type)
- {
-+	struct brcmf_pub *drvr = p2p->cfg->pub;
- 	s32 ret = 0;
- 	s32 memsize = offsetof(struct brcmf_p2p_scan_le,
- 			       eparams.params_le.channel_list);
-@@ -648,7 +651,7 @@ static s32 brcmf_p2p_escan(struct brcmf_
- 
- 	vif = p2p->bss_idx[bss_type].vif;
- 	if (vif == NULL) {
--		brcmf_err("no vif for bss type %d\n", bss_type);
-+		bphy_err(drvr, "no vif for bss type %d\n", bss_type);
- 		ret = -EINVAL;
- 		goto exit;
- 	}
-@@ -676,7 +679,7 @@ static s32 brcmf_p2p_escan(struct brcmf_
- 		       BRCMF_P2P_WILDCARD_SSID_LEN);
- 		break;
- 	default:
--		brcmf_err(" invalid search state %d\n", search_state);
-+		bphy_err(drvr, " invalid search state %d\n", search_state);
- 		ret = -EINVAL;
- 		goto exit;
- 	}
-@@ -760,6 +763,7 @@ static s32 brcmf_p2p_run_escan(struct br
- 			       struct cfg80211_scan_request *request)
- {
- 	struct brcmf_p2p_info *p2p = &cfg->p2p;
-+	struct brcmf_pub *drvr = cfg->pub;
- 	s32 err = 0;
- 	s32 search_state = WL_P2P_DISC_ST_SCAN;
- 	struct brcmf_cfg80211_vif *vif;
-@@ -822,7 +826,7 @@ static s32 brcmf_p2p_run_escan(struct br
- 	}
- exit:
- 	if (err)
--		brcmf_err("error (%d)\n", err);
-+		bphy_err(drvr, "error (%d)\n", err);
- 	return err;
- }
- 
-@@ -917,19 +921,20 @@ int brcmf_p2p_scan_prep(struct wiphy *wi
- static s32
- brcmf_p2p_discover_listen(struct brcmf_p2p_info *p2p, u16 channel, u32 duration)
- {
-+	struct brcmf_pub *drvr = p2p->cfg->pub;
- 	struct brcmf_cfg80211_vif *vif;
- 	struct brcmu_chan ch;
- 	s32 err = 0;
- 
- 	vif = p2p->bss_idx[P2PAPI_BSSCFG_DEVICE].vif;
- 	if (!vif) {
--		brcmf_err("Discovery is not set, so we have nothing to do\n");
-+		bphy_err(drvr, "Discovery is not set, so we have nothing to do\n");
- 		err = -EPERM;
- 		goto exit;
- 	}
- 
- 	if (test_bit(BRCMF_P2P_STATUS_DISCOVER_LISTEN, &p2p->status)) {
--		brcmf_err("Previous LISTEN is not completed yet\n");
-+		bphy_err(drvr, "Previous LISTEN is not completed yet\n");
- 		/* WAR: prevent cookie mismatch in wpa_supplicant return OK */
- 		goto exit;
- 	}
-@@ -1046,6 +1051,7 @@ void brcmf_p2p_cancel_remain_on_channel(
-  */
- static s32 brcmf_p2p_act_frm_search(struct brcmf_p2p_info *p2p, u16 channel)
- {
-+	struct brcmf_pub *drvr = p2p->cfg->pub;
- 	s32 err;
- 	u32 channel_cnt;
- 	u16 *default_chan_list;
-@@ -1061,7 +1067,7 @@ static s32 brcmf_p2p_act_frm_search(stru
- 	default_chan_list = kcalloc(channel_cnt, sizeof(*default_chan_list),
- 				    GFP_KERNEL);
- 	if (default_chan_list == NULL) {
--		brcmf_err("channel list allocation failed\n");
-+		bphy_err(drvr, "channel list allocation failed\n");
- 		err = -ENOMEM;
- 		goto exit;
- 	}
-@@ -1103,6 +1109,7 @@ static void brcmf_p2p_afx_handler(struct
- 	struct brcmf_p2p_info *p2p = container_of(afx_hdl,
- 						  struct brcmf_p2p_info,
- 						  afx_hdl);
-+	struct brcmf_pub *drvr = p2p->cfg->pub;
- 	s32 err;
- 
- 	if (!afx_hdl->is_active)
-@@ -1116,7 +1123,7 @@ static void brcmf_p2p_afx_handler(struct
- 		err = brcmf_p2p_act_frm_search(p2p, afx_hdl->peer_listen_chan);
- 
- 	if (err) {
--		brcmf_err("ERROR occurred! value is (%d)\n", err);
-+		bphy_err(drvr, "ERROR occurred! value is (%d)\n", err);
- 		if (test_bit(BRCMF_P2P_STATUS_FINDING_COMMON_CHANNEL,
- 			     &p2p->status))
- 			complete(&afx_hdl->act_frm_scan);
-@@ -1338,7 +1345,8 @@ int brcmf_p2p_notify_action_frame_rx(str
- 				     const struct brcmf_event_msg *e,
- 				     void *data)
- {
--	struct brcmf_cfg80211_info *cfg = ifp->drvr->config;
-+	struct brcmf_pub *drvr = ifp->drvr;
-+	struct brcmf_cfg80211_info *cfg = drvr->config;
- 	struct brcmf_p2p_info *p2p = &cfg->p2p;
- 	struct afx_hdl *afx_hdl = &p2p->afx_hdl;
- 	struct wireless_dev *wdev;
-@@ -1409,7 +1417,7 @@ int brcmf_p2p_notify_action_frame_rx(str
- 	mgmt_frame = kzalloc(offsetof(struct ieee80211_mgmt, u) +
- 			     mgmt_frame_len, GFP_KERNEL);
- 	if (!mgmt_frame) {
--		brcmf_err("No memory available for action frame\n");
-+		bphy_err(drvr, "No memory available for action frame\n");
- 		return -ENOMEM;
- 	}
- 	memcpy(mgmt_frame->da, ifp->mac_addr, ETH_ALEN);
-@@ -1492,6 +1500,7 @@ int brcmf_p2p_notify_action_tx_complete(
- static s32 brcmf_p2p_tx_action_frame(struct brcmf_p2p_info *p2p,
- 				     struct brcmf_fil_af_params_le *af_params)
- {
-+	struct brcmf_pub *drvr = p2p->cfg->pub;
- 	struct brcmf_cfg80211_vif *vif;
- 	s32 err = 0;
- 	s32 timeout = 0;
-@@ -1506,7 +1515,7 @@ static s32 brcmf_p2p_tx_action_frame(str
- 	err = brcmf_fil_bsscfg_data_set(vif->ifp, "actframe", af_params,
- 					sizeof(*af_params));
- 	if (err) {
--		brcmf_err(" sending action frame has failed\n");
-+		bphy_err(drvr, " sending action frame has failed\n");
- 		goto exit;
- 	}
- 
-@@ -1556,6 +1565,7 @@ static s32 brcmf_p2p_pub_af_tx(struct br
- 			       struct brcmf_config_af_params *config_af_params)
- {
- 	struct brcmf_p2p_info *p2p = &cfg->p2p;
-+	struct brcmf_pub *drvr = cfg->pub;
- 	struct brcmf_fil_action_frame_le *action_frame;
- 	struct brcmf_p2p_pub_act_frame *act_frm;
- 	s32 err = 0;
-@@ -1634,8 +1644,8 @@ static s32 brcmf_p2p_pub_af_tx(struct br
- 		config_af_params->extra_listen = false;
- 		break;
- 	default:
--		brcmf_err("Unknown p2p pub act frame subtype: %d\n",
--			  act_frm->subtype);
-+		bphy_err(drvr, "Unknown p2p pub act frame subtype: %d\n",
-+			 act_frm->subtype);
- 		err = -EINVAL;
- 	}
- 	return err;
-@@ -1657,6 +1667,7 @@ bool brcmf_p2p_send_action_frame(struct
- 	struct brcmf_fil_action_frame_le *action_frame;
- 	struct brcmf_config_af_params config_af_params;
- 	struct afx_hdl *afx_hdl = &p2p->afx_hdl;
-+	struct brcmf_pub *drvr = cfg->pub;
- 	u16 action_frame_len;
- 	bool ack = false;
- 	u8 category;
-@@ -1692,7 +1703,7 @@ bool brcmf_p2p_send_action_frame(struct
- 		if (brcmf_p2p_pub_af_tx(cfg, af_params, &config_af_params)) {
- 			/* Just send unknown subtype frame with */
- 			/* default parameters.                  */
--			brcmf_err("P2P Public action frame, unknown subtype.\n");
-+			bphy_err(drvr, "P2P Public action frame, unknown subtype.\n");
- 		}
- 	} else if (brcmf_p2p_is_gas_action(action_frame->data,
- 					   action_frame_len)) {
-@@ -1714,7 +1725,7 @@ bool brcmf_p2p_send_action_frame(struct
- 			af_params->dwell_time =
- 				cpu_to_le32(P2P_AF_MIN_DWELL_TIME);
- 		} else {
--			brcmf_err("Unknown action type: %d\n", action);
-+			bphy_err(drvr, "Unknown action type: %d\n", action);
- 			goto exit;
- 		}
- 	} else if (brcmf_p2p_is_p2p_action(action_frame->data,
-@@ -1722,8 +1733,8 @@ bool brcmf_p2p_send_action_frame(struct
- 		/* do not configure anything. it will be */
- 		/* sent with a default configuration     */
- 	} else {
--		brcmf_err("Unknown Frame: category 0x%x, action 0x%x\n",
--			  category, action);
-+		bphy_err(drvr, "Unknown Frame: category 0x%x, action 0x%x\n",
-+			 category, action);
- 		return false;
- 	}
- 
-@@ -1761,7 +1772,7 @@ bool brcmf_p2p_send_action_frame(struct
- 
- 		if (brcmf_p2p_af_searching_channel(p2p) ==
- 							P2P_INVALID_CHANNEL) {
--			brcmf_err("Couldn't find peer's channel.\n");
-+			bphy_err(drvr, "Couldn't find peer's channel.\n");
- 			goto exit;
- 		}
- 
-@@ -1783,7 +1794,8 @@ bool brcmf_p2p_send_action_frame(struct
- 		tx_retry++;
- 	}
- 	if (ack == false) {
--		brcmf_err("Failed to send Action Frame(retry %d)\n", tx_retry);
-+		bphy_err(drvr, "Failed to send Action Frame(retry %d)\n",
-+			 tx_retry);
- 		clear_bit(BRCMF_P2P_STATUS_GO_NEG_PHASE, &p2p->status);
- 	}
- 
-@@ -1965,6 +1977,7 @@ int brcmf_p2p_ifchange(struct brcmf_cfg8
- 		       enum brcmf_fil_p2p_if_types if_type)
- {
- 	struct brcmf_p2p_info *p2p = &cfg->p2p;
-+	struct brcmf_pub *drvr = cfg->pub;
- 	struct brcmf_cfg80211_vif *vif;
- 	struct brcmf_fil_p2p_if_le if_request;
- 	s32 err;
-@@ -1974,13 +1987,13 @@ int brcmf_p2p_ifchange(struct brcmf_cfg8
- 
- 	vif = p2p->bss_idx[P2PAPI_BSSCFG_PRIMARY].vif;
- 	if (!vif) {
--		brcmf_err("vif for P2PAPI_BSSCFG_PRIMARY does not exist\n");
-+		bphy_err(drvr, "vif for P2PAPI_BSSCFG_PRIMARY does not exist\n");
- 		return -EPERM;
- 	}
- 	brcmf_notify_escan_complete(cfg, vif->ifp, true, true);
- 	vif = p2p->bss_idx[P2PAPI_BSSCFG_CONNECTION].vif;
- 	if (!vif) {
--		brcmf_err("vif for P2PAPI_BSSCFG_CONNECTION does not exist\n");
-+		bphy_err(drvr, "vif for P2PAPI_BSSCFG_CONNECTION does not exist\n");
- 		return -EPERM;
- 	}
- 	brcmf_set_mpc(vif->ifp, 0);
-@@ -1998,7 +2011,7 @@ int brcmf_p2p_ifchange(struct brcmf_cfg8
- 	err = brcmf_fil_iovar_data_set(vif->ifp, "p2p_ifupd", &if_request,
- 				       sizeof(if_request));
- 	if (err) {
--		brcmf_err("p2p_ifupd FAILED, err=%d\n", err);
-+		bphy_err(drvr, "p2p_ifupd FAILED, err=%d\n", err);
- 		brcmf_cfg80211_arm_vif_event(cfg, NULL);
- 		return err;
- 	}
-@@ -2006,7 +2019,7 @@ int brcmf_p2p_ifchange(struct brcmf_cfg8
- 					    BRCMF_VIF_EVENT_TIMEOUT);
- 	brcmf_cfg80211_arm_vif_event(cfg, NULL);
- 	if (!err)  {
--		brcmf_err("No BRCMF_E_IF_CHANGE event received\n");
-+		bphy_err(drvr, "No BRCMF_E_IF_CHANGE event received\n");
- 		return -EIO;
- 	}
- 
-@@ -2069,6 +2082,7 @@ static struct wireless_dev *brcmf_p2p_cr
- 						    struct wiphy *wiphy,
- 						    u8 *addr)
- {
-+	struct brcmf_pub *drvr = p2p->cfg->pub;
- 	struct brcmf_cfg80211_vif *p2p_vif;
- 	struct brcmf_if *p2p_ifp;
- 	struct brcmf_if *pri_ifp;
-@@ -2080,7 +2094,7 @@ static struct wireless_dev *brcmf_p2p_cr
- 
- 	p2p_vif = brcmf_alloc_vif(p2p->cfg, NL80211_IFTYPE_P2P_DEVICE);
- 	if (IS_ERR(p2p_vif)) {
--		brcmf_err("could not create discovery vif\n");
-+		bphy_err(drvr, "could not create discovery vif\n");
- 		return (struct wireless_dev *)p2p_vif;
- 	}
- 
-@@ -2088,7 +2102,7 @@ static struct wireless_dev *brcmf_p2p_cr
- 
- 	/* 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");
-+		bphy_err(drvr, "discovery vif must be different from primary interface\n");
- 		return ERR_PTR(-EINVAL);
- 	}
- 
-@@ -2101,7 +2115,7 @@ static struct wireless_dev *brcmf_p2p_cr
- 	/* Initialize P2P Discovery in the firmware */
- 	err = brcmf_fil_iovar_int_set(pri_ifp, "p2p_disc", 1);
- 	if (err < 0) {
--		brcmf_err("set p2p_disc error\n");
-+		bphy_err(drvr, "set p2p_disc error\n");
- 		brcmf_fweh_p2pdev_setup(pri_ifp, false);
- 		brcmf_cfg80211_arm_vif_event(p2p->cfg, NULL);
- 		goto fail;
-@@ -2113,7 +2127,7 @@ static struct wireless_dev *brcmf_p2p_cr
- 	brcmf_cfg80211_arm_vif_event(p2p->cfg, NULL);
- 	brcmf_fweh_p2pdev_setup(pri_ifp, false);
- 	if (!err) {
--		brcmf_err("timeout occurred\n");
-+		bphy_err(drvr, "timeout occurred\n");
- 		err = -EIO;
- 		goto fail;
- 	}
-@@ -2127,7 +2141,7 @@ static struct wireless_dev *brcmf_p2p_cr
- 	/* verify bsscfg index for P2P discovery */
- 	err = brcmf_fil_iovar_int_get(pri_ifp, "p2p_dev", &bsscfgidx);
- 	if (err < 0) {
--		brcmf_err("retrieving discover bsscfg index failed\n");
-+		bphy_err(drvr, "retrieving discover bsscfg index failed\n");
- 		goto fail;
- 	}
- 
-@@ -2161,6 +2175,7 @@ struct wireless_dev *brcmf_p2p_add_vif(s
- {
- 	struct brcmf_cfg80211_info *cfg = wiphy_to_cfg(wiphy);
- 	struct brcmf_if *ifp = netdev_priv(cfg_to_ndev(cfg));
-+	struct brcmf_pub *drvr = cfg->pub;
- 	struct brcmf_cfg80211_vif *vif;
- 	enum brcmf_fil_p2p_if_types iftype;
- 	int err;
-@@ -2201,7 +2216,7 @@ struct wireless_dev *brcmf_p2p_add_vif(s
- 					    BRCMF_VIF_EVENT_TIMEOUT);
- 	brcmf_cfg80211_arm_vif_event(cfg, NULL);
- 	if (!err) {
--		brcmf_err("timeout occurred\n");
-+		bphy_err(drvr, "timeout occurred\n");
- 		err = -EIO;
- 		goto fail;
- 	}
-@@ -2209,7 +2224,7 @@ struct wireless_dev *brcmf_p2p_add_vif(s
- 	/* interface created in firmware */
- 	ifp = vif->ifp;
- 	if (!ifp) {
--		brcmf_err("no if pointer provided\n");
-+		bphy_err(drvr, "no if pointer provided\n");
- 		err = -ENOENT;
- 		goto fail;
- 	}
-@@ -2220,7 +2235,7 @@ struct wireless_dev *brcmf_p2p_add_vif(s
- #endif /* >= 3.17.0 */
- 	err = brcmf_net_attach(ifp, true);
- 	if (err) {
--		brcmf_err("Registering netdevice failed\n");
-+		bphy_err(drvr, "Registering netdevice failed\n");
- 		free_netdev(ifp->ndev);
- 		goto fail;
- 	}
-@@ -2375,6 +2390,7 @@ void brcmf_p2p_stop_device(struct wiphy
-  */
- s32 brcmf_p2p_attach(struct brcmf_cfg80211_info *cfg, bool p2pdev_forced)
- {
-+	struct brcmf_pub *drvr = cfg->pub;
- 	struct brcmf_p2p_info *p2p;
- 	struct brcmf_if *pri_ifp;
- 	s32 err = 0;
-@@ -2389,7 +2405,7 @@ s32 brcmf_p2p_attach(struct brcmf_cfg802
- 	if (p2pdev_forced) {
- 		err_ptr = brcmf_p2p_create_p2pdev(p2p, NULL, NULL);
- 		if (IS_ERR(err_ptr)) {
--			brcmf_err("P2P device creation failed.\n");
-+			bphy_err(drvr, "P2P device creation failed.\n");
- 			err = PTR_ERR(err_ptr);
- 		}
- 	} else {
---- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/pno.c
-+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/pno.c
-@@ -109,6 +109,7 @@ static int brcmf_pno_channel_config(stru
- static int brcmf_pno_config(struct brcmf_if *ifp, u32 scan_freq,
- 			    u32 mscan, u32 bestn)
- {
-+	struct brcmf_pub *drvr = ifp->drvr;
- 	struct brcmf_pno_param_le pfn_param;
- 	u16 flags;
- 	u32 pfnmem;
-@@ -132,13 +133,13 @@ static int brcmf_pno_config(struct brcmf
- 		/* set bestn in firmware */
- 		err = brcmf_fil_iovar_int_set(ifp, "pfnmem", pfnmem);
- 		if (err < 0) {
--			brcmf_err("failed to set pfnmem\n");
-+			bphy_err(drvr, "failed to set pfnmem\n");
- 			goto exit;
- 		}
- 		/* get max mscan which the firmware supports */
- 		err = brcmf_fil_iovar_int_get(ifp, "pfnmem", &pfnmem);
- 		if (err < 0) {
--			brcmf_err("failed to get pfnmem\n");
-+			bphy_err(drvr, "failed to get pfnmem\n");
- 			goto exit;
- 		}
- 		mscan = min_t(u32, mscan, pfnmem);
-@@ -152,7 +153,7 @@ static int brcmf_pno_config(struct brcmf
- 	err = brcmf_fil_iovar_data_set(ifp, "pfn_set", &pfn_param,
- 				       sizeof(pfn_param));
- 	if (err)
--		brcmf_err("pfn_set failed, err=%d\n", err);
-+		bphy_err(drvr, "pfn_set failed, err=%d\n", err);
- 
- exit:
- 	return err;
-@@ -160,6 +161,7 @@ exit:
- 
- static int brcmf_pno_set_random(struct brcmf_if *ifp, struct brcmf_pno_info *pi)
- {
-+	struct brcmf_pub *drvr = ifp->drvr;
- 	struct brcmf_pno_macaddr_le pfn_mac;
- 	u8 *mac_addr = NULL;
- 	u8 *mac_mask = NULL;
-@@ -194,7 +196,7 @@ static int brcmf_pno_set_random(struct b
- 	err = brcmf_fil_iovar_data_set(ifp, "pfn_macaddr", &pfn_mac,
- 				       sizeof(pfn_mac));
- 	if (err)
--		brcmf_err("pfn_macaddr failed, err=%d\n", err);
-+		bphy_err(drvr, "pfn_macaddr failed, err=%d\n", err);
- 
- 	return err;
- }
-@@ -202,6 +204,7 @@ static int brcmf_pno_set_random(struct b
- static int brcmf_pno_add_ssid(struct brcmf_if *ifp, struct cfg80211_ssid *ssid,
- 			      bool active)
- {
-+	struct brcmf_pub *drvr = ifp->drvr;
- 	struct brcmf_pno_net_param_le pfn;
- 	int err;
- 
-@@ -218,12 +221,13 @@ static int brcmf_pno_add_ssid(struct brc
- 	brcmf_dbg(SCAN, "adding ssid=%.32s (active=%d)\n", ssid->ssid, active);
- 	err = brcmf_fil_iovar_data_set(ifp, "pfn_add", &pfn, sizeof(pfn));
- 	if (err < 0)
--		brcmf_err("adding failed: err=%d\n", err);
-+		bphy_err(drvr, "adding failed: err=%d\n", err);
- 	return err;
- }
- 
- static int brcmf_pno_add_bssid(struct brcmf_if *ifp, const u8 *bssid)
- {
-+	struct brcmf_pub *drvr = ifp->drvr;
- 	struct brcmf_pno_bssid_le bssid_cfg;
- 	int err;
- 
-@@ -234,7 +238,7 @@ static int brcmf_pno_add_bssid(struct br
- 	err = brcmf_fil_iovar_data_set(ifp, "pfn_add_bssid", &bssid_cfg,
- 				       sizeof(bssid_cfg));
- 	if (err < 0)
--		brcmf_err("adding failed: err=%d\n", err);
-+		bphy_err(drvr, "adding failed: err=%d\n", err);
- 	return err;
- }
- 
-@@ -258,6 +262,7 @@ static bool brcmf_is_ssid_active(struct
- 
- static int brcmf_pno_clean(struct brcmf_if *ifp)
- {
-+	struct brcmf_pub *drvr = ifp->drvr;
- 	int ret;
- 
- 	/* Disable pfn */
-@@ -267,7 +272,7 @@ static int brcmf_pno_clean(struct brcmf_
- 		ret = brcmf_fil_iovar_data_set(ifp, "pfnclear", NULL, 0);
- 	}
- 	if (ret < 0)
--		brcmf_err("failed code %d\n", ret);
-+		bphy_err(drvr, "failed code %d\n", ret);
- 
- 	return ret;
- }
-@@ -392,6 +397,7 @@ static int brcmf_pno_config_networks(str
- 
- static int brcmf_pno_config_sched_scans(struct brcmf_if *ifp)
- {
-+	struct brcmf_pub *drvr = ifp->drvr;
- 	struct brcmf_pno_info *pi;
- 	struct brcmf_gscan_config *gscan_cfg;
- 	struct brcmf_gscan_bucket_config *buckets;
-@@ -416,7 +422,7 @@ static int brcmf_pno_config_sched_scans(
- 	/* clean up everything */
- 	err = brcmf_pno_clean(ifp);
- 	if  (err < 0) {
--		brcmf_err("failed error=%d\n", err);
-+		bphy_err(drvr, "failed error=%d\n", err);
- 		goto free_gscan;
- 	}
- 
---- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/proto.c
-+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/proto.c
-@@ -47,8 +47,8 @@ int brcmf_proto_attach(struct brcmf_pub
- 		if (brcmf_proto_msgbuf_attach(drvr))
- 			goto fail;
- 	} else {
--		brcmf_err("Unsupported proto type %d\n",
--			  drvr->bus_if->proto_type);
-+		bphy_err(drvr, "Unsupported proto type %d\n",
-+			 drvr->bus_if->proto_type);
- 		goto fail;
- 	}
- 	if (!proto->tx_queue_data || (proto->hdrpull == NULL) ||
-@@ -56,7 +56,7 @@ int brcmf_proto_attach(struct brcmf_pub
- 	    (proto->configure_addr_mode == NULL) ||
- 	    (proto->delete_peer == NULL) || (proto->add_tdls_peer == NULL) ||
- 	    (proto->debugfs_create == NULL)) {
--		brcmf_err("Not all proto handlers have been installed\n");
-+		bphy_err(drvr, "Not all proto handlers have been installed\n");
- 		goto fail;
- 	}
- 	return 0;

+ 0 - 38
package/kernel/mac80211/patches/brcm/355-v5.1-brcmfmac-add-basic-validation-of-shared-RAM-address.patch

@@ -1,38 +0,0 @@
-From e0a8ef4d7b4315bc4c1641fb3f3a7dfdfa6627b8 Mon Sep 17 00:00:00 2001
-From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= <[email protected]>
-Date: Wed, 20 Feb 2019 11:30:47 +0100
-Subject: [PATCH] brcmfmac: add basic validation of shared RAM address
-MIME-Version: 1.0
-Content-Type: text/plain; charset=UTF-8
-Content-Transfer-Encoding: 8bit
-
-While experimenting with firmware loading I ended up in a state of
-firmware reporting shared RAM address 0x04000001. It was causing:
-[   94.448015] Unable to handle kernel paging request at virtual address cd680001
-due to reading out of the mapped memory.
-
-This patch adds some basic validation to avoid kernel crashes due to the
-unexpected firmware behavior.
-
-Signed-off-by: Rafał Miłecki <[email protected]>
-Acked-by: Arend van Spriel <[email protected]>
-Signed-off-by: Kalle Valo <[email protected]>
----
- drivers/net/wireless/broadcom/brcm80211/brcmfmac/pcie.c | 6 ++++++
- 1 file changed, 6 insertions(+)
-
---- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/pcie.c
-+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/pcie.c
-@@ -1560,6 +1560,12 @@ static int brcmf_pcie_download_fw_nvram(
- 		brcmf_err(bus, "FW failed to initialize\n");
- 		return -ENODEV;
- 	}
-+	if (sharedram_addr < devinfo->ci->rambase ||
-+	    sharedram_addr >= devinfo->ci->rambase + devinfo->ci->ramsize) {
-+		brcmf_err(bus, "Invalid shared RAM address 0x%08x\n",
-+			  sharedram_addr);
-+		return -ENODEV;
-+	}
- 	brcmf_dbg(PCIE, "Shared RAM addr: 0x%08x\n", sharedram_addr);
- 
- 	return (brcmf_pcie_init_share_ram_info(devinfo, sharedram_addr));

+ 0 - 29
package/kernel/mac80211/patches/brcm/356-v5.1-0001-brcmfmac-fix-size-of-the-struct-msgbuf_ring_status.patch

@@ -1,29 +0,0 @@
-From 0c7051610c577b60b01b3b5aec14d6765e177b0d Mon Sep 17 00:00:00 2001
-From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= <[email protected]>
-Date: Thu, 21 Feb 2019 11:33:24 +0100
-Subject: [PATCH] brcmfmac: fix size of the struct msgbuf_ring_status
-MIME-Version: 1.0
-Content-Type: text/plain; charset=UTF-8
-Content-Transfer-Encoding: 8bit
-
-This updates host struct to match the in-firmawre definition. It's a
-cosmetic change as it only applies to the reserved struct space.
-
-Fixes: c988b78244df ("brcmfmac: print firmware reported ring status errors")
-Signed-off-by: Rafał Miłecki <[email protected]>
-Signed-off-by: Kalle Valo <[email protected]>
----
- drivers/net/wireless/broadcom/brcm80211/brcmfmac/msgbuf.c | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
---- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/msgbuf.c
-+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/msgbuf.c
-@@ -139,7 +139,7 @@ struct msgbuf_ring_status {
- 	struct msgbuf_common_hdr	msg;
- 	struct msgbuf_completion_hdr	compl_hdr;
- 	__le16				write_idx;
--	__le32				rsvd0[5];
-+	__le16				rsvd0[5];
- };
- 
- struct msgbuf_rx_event {

+ 0 - 69
package/kernel/mac80211/patches/brcm/356-v5.1-0002-brcmfmac-print-firmware-reported-general-status-erro.patch

@@ -1,69 +0,0 @@
-From c91377495192cda096e52dc09c266b0d05f16d86 Mon Sep 17 00:00:00 2001
-From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= <[email protected]>
-Date: Thu, 21 Feb 2019 11:33:25 +0100
-Subject: [PATCH] brcmfmac: print firmware reported general status errors
-MIME-Version: 1.0
-Content-Type: text/plain; charset=UTF-8
-Content-Transfer-Encoding: 8bit
-
-Firmware may report general errors using a special message type. Add
-basic support for it by simply decoding & printing an error number.
-
-A sample situation in which firmware reports a buf error:
-CONSOLE: 027084.733 no host response IOCTL buffer available..so fail the request
-will now produce a "Firmware reported general error: 9" on the host.
-
-Signed-off-by: Rafał Miłecki <[email protected]>
-Acked-by: Arend van Spriel <[email protected]>
-Signed-off-by: Kalle Valo <[email protected]>
----
- .../broadcom/brcm80211/brcmfmac/msgbuf.c      | 24 +++++++++++++++++++
- 1 file changed, 24 insertions(+)
-
---- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/msgbuf.c
-+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/msgbuf.c
-@@ -134,6 +134,14 @@ struct msgbuf_completion_hdr {
- 	__le16				flow_ring_id;
- };
- 
-+/* Data struct for the MSGBUF_TYPE_GEN_STATUS */
-+struct msgbuf_gen_status {
-+	struct msgbuf_common_hdr	msg;
-+	struct msgbuf_completion_hdr	compl_hdr;
-+	__le16				write_idx;
-+	__le32				rsvd0[3];
-+};
-+
- /* Data struct for the MSGBUF_TYPE_RING_STATUS */
- struct msgbuf_ring_status {
- 	struct msgbuf_common_hdr	msg;
-@@ -1194,6 +1202,18 @@ brcmf_msgbuf_process_rx_complete(struct
- 	brcmf_netif_rx(ifp, skb);
- }
- 
-+static void brcmf_msgbuf_process_gen_status(struct brcmf_msgbuf *msgbuf,
-+					    void *buf)
-+{
-+	struct msgbuf_gen_status *gen_status = buf;
-+	struct brcmf_pub *drvr = msgbuf->drvr;
-+	int err;
-+
-+	err = le16_to_cpu(gen_status->compl_hdr.status);
-+	if (err)
-+		bphy_err(drvr, "Firmware reported general error: %d\n", err);
-+}
-+
- static void brcmf_msgbuf_process_ring_status(struct brcmf_msgbuf *msgbuf,
- 					     void *buf)
- {
-@@ -1273,6 +1293,10 @@ static void brcmf_msgbuf_process_msgtype
- 
- 	msg = (struct msgbuf_common_hdr *)buf;
- 	switch (msg->msgtype) {
-+	case MSGBUF_TYPE_GEN_STATUS:
-+		brcmf_dbg(MSGBUF, "MSGBUF_TYPE_GEN_STATUS\n");
-+		brcmf_msgbuf_process_gen_status(msgbuf, buf);
-+		break;
- 	case MSGBUF_TYPE_RING_STATUS:
- 		brcmf_dbg(MSGBUF, "MSGBUF_TYPE_RING_STATUS\n");
- 		brcmf_msgbuf_process_ring_status(msgbuf, buf);

+ 0 - 32
package/kernel/mac80211/patches/brcm/360-v5.2-0001-brcmfmac-support-repeated-brcmf_fw_alloc_request-cal.patch

@@ -1,32 +0,0 @@
-From c9692820710f57c826b2e43a6fb1e4cd307508b0 Mon Sep 17 00:00:00 2001
-From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= <[email protected]>
-Date: Tue, 26 Feb 2019 14:11:16 +0100
-Subject: [PATCH] brcmfmac: support repeated brcmf_fw_alloc_request() calls
-MIME-Version: 1.0
-Content-Type: text/plain; charset=UTF-8
-Content-Transfer-Encoding: 8bit
-
-During a normal brcmfmac lifetime brcmf_fw_alloc_request() is called
-once only during the probe. It's safe to assume provided array is clear.
-
-Further brcmfmac improvements may require calling it multiple times
-though. This patch allows it by fixing invalid firmware paths like:
-brcm/brcmfmac4366c-pcie.binbrcm/brcmfmac4366c-pcie.bin
-
-Signed-off-by: Rafał Miłecki <[email protected]>
-Reviewed-by: Arend van Spriel <[email protected]>
-Signed-off-by: Kalle Valo <[email protected]>
----
- drivers/net/wireless/broadcom/brcm80211/brcmfmac/firmware.c | 1 +
- 1 file changed, 1 insertion(+)
-
---- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/firmware.c
-+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/firmware.c
-@@ -743,6 +743,7 @@ brcmf_fw_alloc_request(u32 chip, u32 chi
- 
- 	for (j = 0; j < n_fwnames; j++) {
- 		fwreq->items[j].path = fwnames[j].path;
-+		fwnames[j].path[0] = '\0';
- 		/* check if firmware path is provided by module parameter */
- 		if (brcmf_mp_global.firmware_path[0] != '\0') {
- 			strlcpy(fwnames[j].path, mp_path,

+ 0 - 79
package/kernel/mac80211/patches/brcm/360-v5.2-0002-brcmfmac-add-a-function-designated-for-handling-firm.patch

@@ -1,79 +0,0 @@
-From a2ec87ddbf1637f854ffcfff9d12d392fa30758b Mon Sep 17 00:00:00 2001
-From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= <[email protected]>
-Date: Tue, 26 Feb 2019 14:11:18 +0100
-Subject: [PATCH] brcmfmac: add a function designated for handling firmware
- fails
-MIME-Version: 1.0
-Content-Type: text/plain; charset=UTF-8
-Content-Transfer-Encoding: 8bit
-
-This improves handling PCIe firmware halts by printing a clear error
-message and replaces a similar code in the SDIO bus support.
-
-It will also allow further improvements like trying to recover from a
-firmware crash.
-
-Signed-off-by: Rafał Miłecki <[email protected]>
-Reviewed-by: Arend van Spriel <[email protected]>
-Signed-off-by: Kalle Valo <[email protected]>
----
- drivers/net/wireless/broadcom/brcm80211/brcmfmac/bus.h |  2 ++
- .../net/wireless/broadcom/brcm80211/brcmfmac/core.c    | 10 ++++++++++
- .../net/wireless/broadcom/brcm80211/brcmfmac/pcie.c    |  2 +-
- .../net/wireless/broadcom/brcm80211/brcmfmac/sdio.c    |  4 ++--
- 4 files changed, 15 insertions(+), 3 deletions(-)
-
---- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/bus.h
-+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/bus.h
-@@ -262,6 +262,8 @@ void brcmf_detach(struct device *dev);
- void brcmf_dev_reset(struct device *dev);
- /* Request from bus module to initiate a coredump */
- void brcmf_dev_coredump(struct device *dev);
-+/* Indication that firmware has halted or crashed */
-+void brcmf_fw_crashed(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
-@@ -1294,6 +1294,16 @@ void brcmf_dev_coredump(struct device *d
- 		brcmf_dbg(TRACE, "failed to create coredump\n");
- }
- 
-+void brcmf_fw_crashed(struct device *dev)
-+{
-+	struct brcmf_bus *bus_if = dev_get_drvdata(dev);
-+	struct brcmf_pub *drvr = bus_if->drvr;
-+
-+	bphy_err(drvr, "Firmware has halted or crashed\n");
-+
-+	brcmf_dev_coredump(dev);
-+}
-+
- 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
-@@ -730,7 +730,7 @@ static void brcmf_pcie_handle_mb_data(st
- 	}
- 	if (dtoh_mb_data & BRCMF_D2H_DEV_FWHALT) {
- 		brcmf_dbg(PCIE, "D2H_MB_DATA: FW HALT\n");
--		brcmf_dev_coredump(&devinfo->pdev->dev);
-+		brcmf_fw_crashed(&devinfo->pdev->dev);
- 	}
- }
- 
---- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c
-+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c
-@@ -1090,8 +1090,8 @@ static u32 brcmf_sdio_hostmail(struct br
- 
- 	/* dongle indicates the firmware has halted/crashed */
- 	if (hmb_data & HMB_DATA_FWHALT) {
--		brcmf_err("mailbox indicates firmware halted\n");
--		brcmf_dev_coredump(&sdiod->func1->dev);
-+		brcmf_dbg(SDIO, "mailbox indicates firmware halted\n");
-+		brcmf_fw_crashed(&sdiod->func1->dev);
- 	}
- 
- 	/* Dongle recomposed rx frames, accept them again */

+ 0 - 153
package/kernel/mac80211/patches/brcm/360-v5.2-0003-brcmfmac-reset-PCIe-bus-on-a-firmware-crash.patch

@@ -1,153 +0,0 @@
-From 4684997d9eea29380000e062755aa6d368d789a3 Mon Sep 17 00:00:00 2001
-From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= <[email protected]>
-Date: Tue, 26 Feb 2019 14:11:19 +0100
-Subject: [PATCH] brcmfmac: reset PCIe bus on a firmware crash
-MIME-Version: 1.0
-Content-Type: text/plain; charset=UTF-8
-Content-Transfer-Encoding: 8bit
-
-This includes bus reset & reloading a firmware. It should be sufficient
-for a user space to (setup and) use a wireless device again.
-
-Support for reset on USB & SDIO can be added later.
-
-Signed-off-by: Rafał Miłecki <[email protected]>
-Reviewed-by: Arend van Spriel <[email protected]>
-Signed-off-by: Kalle Valo <[email protected]>
----
- .../broadcom/brcm80211/brcmfmac/bus.h         | 10 ++++++
- .../broadcom/brcm80211/brcmfmac/core.c        | 12 +++++++
- .../broadcom/brcm80211/brcmfmac/core.h        |  2 ++
- .../broadcom/brcm80211/brcmfmac/pcie.c        | 35 +++++++++++++++++++
- 4 files changed, 59 insertions(+)
-
---- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/bus.h
-+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/bus.h
-@@ -91,6 +91,7 @@ struct brcmf_bus_ops {
- 	int (*get_fwname)(struct device *dev, const char *ext,
- 			  unsigned char *fw_name);
- 	void (*debugfs_create)(struct device *dev);
-+	int (*reset)(struct device *dev);
- };
- 
- 
-@@ -245,6 +246,15 @@ void brcmf_bus_debugfs_create(struct brc
- 	return bus->ops->debugfs_create(bus->dev);
- }
- 
-+static inline
-+int brcmf_bus_reset(struct brcmf_bus *bus)
-+{
-+	if (!bus->ops->reset)
-+		return -EOPNOTSUPP;
-+
-+	return bus->ops->reset(bus->dev);
-+}
-+
- /*
-  * interface functions from common layer
-  */
---- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/core.c
-+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/core.c
-@@ -1105,6 +1105,14 @@ static int brcmf_revinfo_read(struct seq
- 	return 0;
- }
- 
-+static void brcmf_core_bus_reset(struct work_struct *work)
-+{
-+	struct brcmf_pub *drvr = container_of(work, struct brcmf_pub,
-+					      bus_reset);
-+
-+	brcmf_bus_reset(drvr->bus_if);
-+}
-+
- static int brcmf_bus_started(struct brcmf_pub *drvr, struct cfg80211_ops *ops)
- {
- 	int ret = -1;
-@@ -1176,6 +1184,8 @@ static int brcmf_bus_started(struct brcm
- #endif
- #endif /* CONFIG_INET */
- 
-+	INIT_WORK(&drvr->bus_reset, brcmf_core_bus_reset);
-+
- 	/* populate debugfs */
- 	brcmf_debugfs_add_entry(drvr, "revinfo", brcmf_revinfo_read);
- 	brcmf_feat_debugfs_create(drvr);
-@@ -1302,6 +1312,8 @@ void brcmf_fw_crashed(struct device *dev
- 	bphy_err(drvr, "Firmware has halted or crashed\n");
- 
- 	brcmf_dev_coredump(dev);
-+
-+	schedule_work(&drvr->bus_reset);
- }
- 
- void brcmf_detach(struct device *dev)
---- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/core.h
-+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/core.h
-@@ -143,6 +143,8 @@ struct brcmf_pub {
- 	struct notifier_block inet6addr_notifier;
- 	struct brcmf_mp_device *settings;
- 
-+	struct work_struct bus_reset;
-+
- 	u8 clmver[BRCMF_DCMD_SMLEN];
- };
- 
---- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/pcie.c
-+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/pcie.c
-@@ -345,6 +345,10 @@ static const u32 brcmf_ring_itemsize[BRC
- 	BRCMF_D2H_MSGRING_RX_COMPLETE_ITEMSIZE
- };
- 
-+static void brcmf_pcie_setup(struct device *dev, int ret,
-+			     struct brcmf_fw_request *fwreq);
-+static struct brcmf_fw_request *
-+brcmf_pcie_prepare_fw_request(struct brcmf_pciedev_info *devinfo);
- 
- static u32
- brcmf_pcie_read_reg32(struct brcmf_pciedev_info *devinfo, u32 reg_offset)
-@@ -1409,6 +1413,36 @@ int brcmf_pcie_get_fwname(struct device
- 	return 0;
- }
- 
-+static int brcmf_pcie_reset(struct device *dev)
-+{
-+	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;
-+	struct brcmf_fw_request *fwreq;
-+	int err;
-+
-+	brcmf_detach(dev);
-+
-+	brcmf_pcie_release_irq(devinfo);
-+	brcmf_pcie_release_scratchbuffers(devinfo);
-+	brcmf_pcie_release_ringbuffers(devinfo);
-+	brcmf_pcie_reset_device(devinfo);
-+
-+	fwreq = brcmf_pcie_prepare_fw_request(devinfo);
-+	if (!fwreq) {
-+		dev_err(dev, "Failed to prepare FW request\n");
-+		return -ENOMEM;
-+	}
-+
-+	err = brcmf_fw_get_firmwares(dev, fwreq, brcmf_pcie_setup);
-+	if (err) {
-+		dev_err(dev, "Failed to prepare FW request\n");
-+		kfree(fwreq);
-+	}
-+
-+	return err;
-+}
-+
- static const struct brcmf_bus_ops brcmf_pcie_bus_ops = {
- 	.txdata = brcmf_pcie_tx,
- 	.stop = brcmf_pcie_down,
-@@ -1418,6 +1452,7 @@ static const struct brcmf_bus_ops brcmf_
- 	.get_ramsize = brcmf_pcie_get_ramsize,
- 	.get_memdump = brcmf_pcie_get_memdump,
- 	.get_fwname = brcmf_pcie_get_fwname,
-+	.reset = brcmf_pcie_reset,
- };
- 
- 

+ 0 - 124
package/kernel/mac80211/patches/brcm/361-v5.2-0001-brcmfmac-fix-WARNING-during-USB-disconnect-in-case-o.patch

@@ -1,124 +0,0 @@
-From c80d26e81ef1802f30364b4ad1955c1443a592b9 Mon Sep 17 00:00:00 2001
-From: Piotr Figiel <[email protected]>
-Date: Mon, 4 Mar 2019 15:42:49 +0000
-Subject: [PATCH] brcmfmac: fix WARNING during USB disconnect in case of
- unempty psq
-
-brcmu_pkt_buf_free_skb emits WARNING when attempting to free a sk_buff
-which is part of any queue. After USB disconnect this may have happened
-when brcmf_fws_hanger_cleanup() is called as per-interface psq was never
-cleaned when removing the interface.
-Change brcmf_fws_macdesc_cleanup() in a way that it removes the
-corresponding packets from hanger table (to avoid double-free when
-brcmf_fws_hanger_cleanup() is called) and add a call to clean-up the
-interface specific packet queue.
-
-Below is a WARNING during USB disconnect with Raspberry Pi WiFi dongle
-running in AP mode. This was reproducible when the interface was
-transmitting during the disconnect and is fixed with this commit.
-
-------------[ cut here ]------------
-WARNING: CPU: 0 PID: 1171 at drivers/net/wireless/broadcom/brcm80211/brcmutil/utils.c:49 brcmu_pkt_buf_free_skb+0x3c/0x40
-Modules linked in: nf_log_ipv4 nf_log_common xt_LOG xt_limit iptable_mangle xt_connmark xt_tcpudp xt_conntrack nf_conntrack nf_defrag_ipv6 nf_defrag_ipv4 iptable_filter ip_tables x_tables usb_f_mass_storage usb_f_rndis u_ether cdc_acm smsc95xx usbnet ci_hdrc_imx ci_hdrc ulpi usbmisc_imx 8250_exar 8250_pci 8250 8250_base libcomposite configfs udc_core
-CPU: 0 PID: 1171 Comm: kworker/0:0 Not tainted 4.19.23-00075-gde33ed8 #99
-Hardware name: Freescale i.MX6 Quad/DualLite (Device Tree)
-Workqueue: usb_hub_wq hub_event
-[<8010ff84>] (unwind_backtrace) from [<8010bb64>] (show_stack+0x10/0x14)
-[<8010bb64>] (show_stack) from [<80840278>] (dump_stack+0x88/0x9c)
-[<80840278>] (dump_stack) from [<8011f5ec>] (__warn+0xfc/0x114)
-[<8011f5ec>] (__warn) from [<8011f71c>] (warn_slowpath_null+0x40/0x48)
-[<8011f71c>] (warn_slowpath_null) from [<805a476c>] (brcmu_pkt_buf_free_skb+0x3c/0x40)
-[<805a476c>] (brcmu_pkt_buf_free_skb) from [<805bb6c4>] (brcmf_fws_cleanup+0x1e4/0x22c)
-[<805bb6c4>] (brcmf_fws_cleanup) from [<805bc854>] (brcmf_fws_del_interface+0x58/0x68)
-[<805bc854>] (brcmf_fws_del_interface) from [<805b66ac>] (brcmf_remove_interface+0x40/0x150)
-[<805b66ac>] (brcmf_remove_interface) from [<805b6870>] (brcmf_detach+0x6c/0xb0)
-[<805b6870>] (brcmf_detach) from [<805bdbb8>] (brcmf_usb_disconnect+0x30/0x4c)
-[<805bdbb8>] (brcmf_usb_disconnect) from [<805e5d64>] (usb_unbind_interface+0x5c/0x1e0)
-[<805e5d64>] (usb_unbind_interface) from [<804aab10>] (device_release_driver_internal+0x154/0x1ec)
-[<804aab10>] (device_release_driver_internal) from [<804a97f4>] (bus_remove_device+0xcc/0xf8)
-[<804a97f4>] (bus_remove_device) from [<804a6fc0>] (device_del+0x118/0x308)
-[<804a6fc0>] (device_del) from [<805e488c>] (usb_disable_device+0xa0/0x1c8)
-[<805e488c>] (usb_disable_device) from [<805dcf98>] (usb_disconnect+0x70/0x1d8)
-[<805dcf98>] (usb_disconnect) from [<805ddd84>] (hub_event+0x464/0xf50)
-[<805ddd84>] (hub_event) from [<80135a70>] (process_one_work+0x138/0x3f8)
-[<80135a70>] (process_one_work) from [<80135d5c>] (worker_thread+0x2c/0x554)
-[<80135d5c>] (worker_thread) from [<8013b1a0>] (kthread+0x124/0x154)
-[<8013b1a0>] (kthread) from [<801010e8>] (ret_from_fork+0x14/0x2c)
-Exception stack(0xecf8dfb0 to 0xecf8dff8)
-dfa0:                                     00000000 00000000 00000000 00000000
-dfc0: 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
-dfe0: 00000000 00000000 00000000 00000000 00000013 00000000
----[ end trace 38d234018e9e2a90 ]---
-------------[ cut here ]------------
-
-Signed-off-by: Piotr Figiel <[email protected]>
-Signed-off-by: Kalle Valo <[email protected]>
----
- .../broadcom/brcm80211/brcmfmac/fwsignal.c    | 42 +++++++++++--------
- 1 file changed, 24 insertions(+), 18 deletions(-)
-
---- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/fwsignal.c
-+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/fwsignal.c
-@@ -580,24 +580,6 @@ static bool brcmf_fws_ifidx_match(struct
- 	return ifidx == *(int *)arg;
- }
- 
--static void brcmf_fws_psq_flush(struct brcmf_fws_info *fws, struct pktq *q,
--				int ifidx)
--{
--	bool (*matchfn)(struct sk_buff *, void *) = NULL;
--	struct sk_buff *skb;
--	int prec;
--
--	if (ifidx != -1)
--		matchfn = brcmf_fws_ifidx_match;
--	for (prec = 0; prec < q->num_prec; prec++) {
--		skb = brcmu_pktq_pdeq_match(q, prec, matchfn, &ifidx);
--		while (skb) {
--			brcmu_pkt_buf_free_skb(skb);
--			skb = brcmu_pktq_pdeq_match(q, prec, matchfn, &ifidx);
--		}
--	}
--}
--
- static void brcmf_fws_hanger_init(struct brcmf_fws_hanger *hanger)
- {
- 	int i;
-@@ -669,6 +651,28 @@ static inline int brcmf_fws_hanger_poppk
- 	return 0;
- }
- 
-+static void brcmf_fws_psq_flush(struct brcmf_fws_info *fws, struct pktq *q,
-+				int ifidx)
-+{
-+	bool (*matchfn)(struct sk_buff *, void *) = NULL;
-+	struct sk_buff *skb;
-+	int prec;
-+	u32 hslot;
-+
-+	if (ifidx != -1)
-+		matchfn = brcmf_fws_ifidx_match;
-+	for (prec = 0; prec < q->num_prec; prec++) {
-+		skb = brcmu_pktq_pdeq_match(q, prec, matchfn, &ifidx);
-+		while (skb) {
-+			hslot = brcmf_skb_htod_tag_get_field(skb, HSLOT);
-+			brcmf_fws_hanger_poppkt(&fws->hanger, hslot, &skb,
-+						true);
-+			brcmu_pkt_buf_free_skb(skb);
-+			skb = brcmu_pktq_pdeq_match(q, prec, matchfn, &ifidx);
-+		}
-+	}
-+}
-+
- static int brcmf_fws_hanger_mark_suppressed(struct brcmf_fws_hanger *h,
- 					    u32 slot_id)
- {
-@@ -2200,6 +2204,8 @@ void brcmf_fws_del_interface(struct brcm
- 	brcmf_fws_lock(fws);
- 	ifp->fws_desc = NULL;
- 	brcmf_dbg(TRACE, "deleting %s\n", entry->name);
-+	brcmf_fws_macdesc_cleanup(fws, &fws->desc.iface[ifp->ifidx],
-+				  ifp->ifidx);
- 	brcmf_fws_macdesc_deinit(entry);
- 	brcmf_fws_cleanup(fws, ifp->ifidx);
- 	brcmf_fws_unlock(fws);

Some files were not shown because too many files changed in this diff