mirror of
https://github.com/coolsnowwolf/lede.git
synced 2025-04-16 04:13:31 +00:00
mac80211: bump to 4.19.79
This commit is contained in:
parent
cacb59b592
commit
eb7626e861
@ -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:=4.19.79-1
|
||||
PKG_RELEASE:=1
|
||||
PKG_SOURCE_URL:=@KERNEL/linux/kernel/projects/backports/stable/v4.19.79/
|
||||
PKG_HASH:=ee03b16949e4968092cfed3cd763ff4682bc29fa3b52ebc239aa915583413cf3
|
||||
|
||||
PKG_SOURCE:=backports-$(PKG_VERSION).tar.xz
|
||||
PKG_BUILD_DIR:=$(KERNEL_BUILD_DIR)/backports-$(PKG_VERSION)
|
||||
@ -28,7 +28,7 @@ PKG_DRIVERS = \
|
||||
lib80211 \
|
||||
mac80211-hwsim \
|
||||
mt7601u \
|
||||
p54-common p54-pci p54-spi p54-usb \
|
||||
p54-common p54-pci p54-usb \
|
||||
rsi91x rsi91x-usb rsi91x-sdio\
|
||||
wlcore wl12xx wl18xx \
|
||||
zd1211rw
|
||||
@ -275,7 +275,7 @@ endef
|
||||
|
||||
define KernelPackage/p54-common
|
||||
$(call KernelPackage/p54/Default)
|
||||
DEPENDS+= @PCI_SUPPORT||@USB_SUPPORT||@TARGET_omap24xx +kmod-mac80211 +kmod-lib-crc-ccitt +@DRIVER_11W_SUPPORT
|
||||
DEPENDS+= @(PCI_SUPPORT||USB_SUPPORT) +kmod-mac80211 +kmod-lib-crc-ccitt +@DRIVER_11W_SUPPORT
|
||||
TITLE+= (COMMON)
|
||||
FILES:=$(PKG_BUILD_DIR)/drivers/net/wireless/intersil/p54/p54common.ko
|
||||
endef
|
||||
@ -296,14 +296,6 @@ define KernelPackage/p54-usb
|
||||
AUTOLOAD:=$(call AutoProbe,p54usb)
|
||||
endef
|
||||
|
||||
define KernelPackage/p54-spi
|
||||
$(call KernelPackage/p54/Default)
|
||||
TITLE+= (SPI)
|
||||
DEPENDS+= @TARGET_omap24xx +kmod-p54-common +p54-spi-firmware
|
||||
FILES:=$(PKG_BUILD_DIR)/drivers/net/wireless/intersil/p54/p54spi.ko
|
||||
AUTOLOAD:=$(call AutoProbe,p54spi)
|
||||
endef
|
||||
|
||||
define KernelPackage/rsi91x
|
||||
$(call KernelPackage/mac80211/Default)
|
||||
TITLE:=Redpine Signals Inc 91x WLAN driver support
|
||||
@ -408,7 +400,6 @@ config-y += WL_MEDIATEK
|
||||
config-$(call config_package,p54-common) += P54_COMMON
|
||||
config-$(call config_package,p54-pci) += P54_PCI
|
||||
config-$(call config_package,p54-usb) += P54_USB
|
||||
config-$(call config_package,p54-spi) += P54_SPI
|
||||
|
||||
config-$(call config_package,hermes) += HERMES
|
||||
config-$(call config_package,hermes-pci) += PCI_HERMES
|
||||
|
@ -131,7 +131,7 @@ define KernelPackage/ath5k
|
||||
$(call KernelPackage/mac80211/Default)
|
||||
TITLE:=Atheros 5xxx wireless cards support
|
||||
URL:=https://wireless.wiki.kernel.org/en/users/drivers/ath5k
|
||||
DEPENDS+= @PCI_SUPPORT||@TARGET_ath25 +kmod-ath +@DRIVER_11W_SUPPORT
|
||||
DEPENDS+= @(PCI_SUPPORT||TARGET_ath25) +kmod-ath +@DRIVER_11W_SUPPORT
|
||||
FILES:=$(PKG_BUILD_DIR)/drivers/net/wireless/ath/ath5k/ath5k.ko
|
||||
AUTOLOAD:=$(call AutoProbe,ath5k)
|
||||
endef
|
||||
|
@ -347,7 +347,7 @@ define KernelPackage/b43legacy
|
||||
URL:=https://wireless.wiki.kernel.org/en/users/drivers/b43
|
||||
KCONFIG:= \
|
||||
CONFIG_HW_RANDOM=y
|
||||
DEPENDS+= +kmod-mac80211 +!(TARGET_brcm47xx||TARGET_brcm63xx):kmod-ssb +b43legacy-firmware
|
||||
DEPENDS+= +kmod-mac80211 +!(TARGET_brcm47xx||TARGET_brcm63xx):kmod-ssb @!TARGET_brcm47xx_mips74k +b43legacy-firmware
|
||||
FILES:=$(PKG_BUILD_DIR)/drivers/net/wireless/broadcom/b43legacy/b43legacy.ko
|
||||
AUTOLOAD:=$(call AutoProbe,b43legacy)
|
||||
MENU:=1
|
||||
|
@ -113,7 +113,7 @@ detect_mac80211() {
|
||||
set wireless.radio${devidx}.hwmode=11${mode_band}
|
||||
${dev_id}
|
||||
${ht_capab}
|
||||
set wireless.radio${devidx}.disabled=0
|
||||
set wireless.radio${devidx}.disabled=1
|
||||
|
||||
set wireless.default_radio${devidx}=wifi-iface
|
||||
set wireless.default_radio${devidx}.device=radio${devidx}
|
||||
|
@ -15,7 +15,7 @@ config-$(call config_package,ipw2200) += IPW2200
|
||||
|
||||
define KernelPackage/iwlwifi
|
||||
$(call KernelPackage/mac80211/Default)
|
||||
DEPENDS:= +kmod-mac80211 @PCI_SUPPORT +@DRIVER_11N_SUPPORT +@DRIVER_11AC_SUPPORT +@DRIVER_11W_SUPPORT @!LINUX_3_18
|
||||
DEPENDS:= +kmod-mac80211 @PCI_SUPPORT +@DRIVER_11N_SUPPORT +@DRIVER_11AC_SUPPORT +@DRIVER_11W_SUPPORT
|
||||
TITLE:=Intel AGN Wireless support
|
||||
FILES:= \
|
||||
$(PKG_BUILD_DIR)/drivers/net/wireless/intel/iwlwifi/iwlwifi.ko \
|
||||
@ -124,7 +124,7 @@ endef
|
||||
define KernelPackage/libipw
|
||||
$(call KernelPackage/mac80211/Default)
|
||||
TITLE:=libipw for ipw2100 and ipw2200
|
||||
DEPENDS:=@PCI_SUPPORT +kmod-crypto-michael-mic +kmod-crypto-ecb +kmod-lib80211 +kmod-cfg80211 +@DRIVER_WEXT_SUPPORT @!BIG_ENDIAN @!LINUX_3_18
|
||||
DEPENDS:=@PCI_SUPPORT +kmod-crypto-michael-mic +kmod-crypto-ecb +kmod-lib80211 +kmod-cfg80211 +@DRIVER_WEXT_SUPPORT @!BIG_ENDIAN
|
||||
FILES:=$(PKG_BUILD_DIR)/drivers/net/wireless/intel/ipw2x00/libipw.ko
|
||||
AUTOLOAD:=$(call AutoProbe,libipw)
|
||||
endef
|
||||
|
@ -11,7 +11,7 @@ config-$(call config_package,mwifiex-sdio) += MWIFIEX MWIFIEX_SDIO
|
||||
|
||||
define KernelPackage/libertas-usb
|
||||
$(call KernelPackage/mac80211/Default)
|
||||
DEPENDS+= @USB_SUPPORT +kmod-cfg80211 +kmod-usb-core +kmod-lib80211 +@DRIVER_WEXT_SUPPORT +libertas-usb-firmware @!LINUX_3_18
|
||||
DEPENDS+= @USB_SUPPORT +kmod-cfg80211 +kmod-usb-core +kmod-lib80211 +@DRIVER_WEXT_SUPPORT +libertas-usb-firmware
|
||||
TITLE:=Marvell 88W8015 Wireless Driver
|
||||
FILES:= \
|
||||
$(PKG_BUILD_DIR)/drivers/net/wireless/marvell/libertas/libertas.ko \
|
||||
@ -21,7 +21,7 @@ endef
|
||||
|
||||
define KernelPackage/libertas-sdio
|
||||
$(call KernelPackage/mac80211/Default)
|
||||
DEPENDS+= +kmod-cfg80211 +kmod-lib80211 +kmod-mmc +@DRIVER_WEXT_SUPPORT @!TARGET_uml +libertas-sdio-firmware @!LINUX_3_18
|
||||
DEPENDS+= +kmod-cfg80211 +kmod-lib80211 +kmod-mmc +@DRIVER_WEXT_SUPPORT @!TARGET_uml +libertas-sdio-firmware
|
||||
TITLE:=Marvell 88W8686 Wireless Driver
|
||||
FILES:= \
|
||||
$(PKG_BUILD_DIR)/drivers/net/wireless/marvell/libertas/libertas.ko \
|
||||
@ -32,7 +32,7 @@ endef
|
||||
define KernelPackage/libertas-spi
|
||||
$(call KernelPackage/mac80211/Default)
|
||||
SUBMENU:=Wireless Drivers
|
||||
DEPENDS+= +kmod-cfg80211 +kmod-lib80211 +@DRIVER_WEXT_SUPPORT @!TARGET_uml +libertas-spi-firmware @!LINUX_3_18
|
||||
DEPENDS+= +kmod-cfg80211 +kmod-lib80211 +@DRIVER_WEXT_SUPPORT @!TARGET_uml +libertas-spi-firmware
|
||||
KCONFIG := \
|
||||
CONFIG_SPI=y \
|
||||
CONFIG_SPI_MASTER=y
|
||||
|
@ -9,7 +9,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
|
||||
|
||||
--- a/drivers/net/wireless/ath/ath9k/hw.c
|
||||
+++ b/drivers/net/wireless/ath/ath9k/hw.c
|
||||
@@ -1421,8 +1421,12 @@ static bool ath9k_hw_set_reset(struct at
|
||||
@@ -1435,8 +1435,12 @@ static bool ath9k_hw_set_reset(struct at
|
||||
if (!AR_SREV_9100(ah))
|
||||
REG_WRITE(ah, AR_RC, 0);
|
||||
|
||||
|
@ -10,7 +10,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
|
||||
|
||||
--- a/drivers/net/wireless/ath/ath9k/hw.c
|
||||
+++ b/drivers/net/wireless/ath/ath9k/hw.c
|
||||
@@ -1298,39 +1298,56 @@ void ath9k_hw_get_delta_slope_vals(struc
|
||||
@@ -1312,39 +1312,56 @@ void ath9k_hw_get_delta_slope_vals(struc
|
||||
*coef_exponent = coef_exp - 16;
|
||||
}
|
||||
|
||||
@ -94,7 +94,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -1383,24 +1400,24 @@ static bool ath9k_hw_set_reset(struct at
|
||||
@@ -1397,24 +1414,24 @@ static bool ath9k_hw_set_reset(struct at
|
||||
rst_flags |= AR_RTC_RC_MAC_COLD;
|
||||
}
|
||||
|
||||
|
@ -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
|
||||
@@ -2976,7 +2976,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
|
||||
@@ -2988,9 +2989,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);
|
||||
|
@ -11,7 +11,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
|
||||
|
||||
--- a/drivers/net/wireless/ath/ath9k/hw.c
|
||||
+++ b/drivers/net/wireless/ath/ath9k/hw.c
|
||||
@@ -2981,6 +2981,10 @@ void ath9k_hw_apply_txpower(struct ath_h
|
||||
@@ -2995,6 +2995,10 @@ void ath9k_hw_apply_txpower(struct ath_h
|
||||
if (ant_gain > max_gain)
|
||||
ant_reduction = ant_gain - max_gain;
|
||||
|
||||
|
@ -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
|
||||
@@ -3021,6 +3021,8 @@ void regulatory_hint_country_ie(struct w
|
||||
enum environment_cap env = ENVIRON_ANY;
|
||||
struct regulatory_request *request = NULL, *lr;
|
||||
|
||||
@ -9,7 +9,7 @@
|
||||
/* IE len must be evenly divisible by 2 */
|
||||
if (country_ie_len & 0x01)
|
||||
return;
|
||||
@@ -3188,6 +3190,7 @@ static void restore_regulatory_settings(
|
||||
@@ -3227,6 +3229,7 @@ static void restore_regulatory_settings(
|
||||
|
||||
void regulatory_hint_disconnect(void)
|
||||
{
|
||||
|
@ -1,13 +0,0 @@
|
||||
--- a/drivers/net/wireless/ath/regd.c
|
||||
+++ b/drivers/net/wireless/ath/regd.c
|
||||
@@ -511,6 +511,10 @@ static int __ath_reg_dyn_country(struct
|
||||
|
||||
ath_reg_apply_world_flags(wiphy, request->initiator, reg);
|
||||
|
||||
+ // apply regulatory to phy devices
|
||||
+ if (regulatory_hint(wiphy, reg->alpha2))
|
||||
+ printk(KERN_DEBUG "ath: regulatory_hint error!\n");
|
||||
+
|
||||
return 0;
|
||||
}
|
||||
|
@ -1,6 +1,6 @@
|
||||
--- a/drivers/net/wireless/ath/ath9k/hw.c
|
||||
+++ b/drivers/net/wireless/ath/ath9k/hw.c
|
||||
@@ -392,13 +392,8 @@ static void ath9k_hw_init_config(struct
|
||||
@@ -403,13 +403,8 @@ static void ath9k_hw_init_config(struct
|
||||
|
||||
ah->config.rx_intr_mitigation = true;
|
||||
|
||||
|
@ -1,6 +1,6 @@
|
||||
--- a/drivers/net/wireless/ath/ath9k/hw.c
|
||||
+++ b/drivers/net/wireless/ath/ath9k/hw.c
|
||||
@@ -649,6 +649,7 @@ int ath9k_hw_init(struct ath_hw *ah)
|
||||
@@ -663,6 +663,7 @@ int ath9k_hw_init(struct ath_hw *ah)
|
||||
|
||||
/* These are all the AR5008/AR9001/AR9002/AR9003 hardware family of chipsets */
|
||||
switch (ah->hw_version.devid) {
|
||||
|
@ -94,7 +94,7 @@
|
||||
struct ath_gen_timer *ath_gen_timer_alloc(struct ath_hw *ah,
|
||||
--- a/drivers/net/wireless/ath/ath9k/hw.c
|
||||
+++ b/drivers/net/wireless/ath/ath9k/hw.c
|
||||
@@ -1869,6 +1869,20 @@ u32 ath9k_hw_get_tsf_offset(struct times
|
||||
@@ -1883,6 +1883,20 @@ u32 ath9k_hw_get_tsf_offset(struct times
|
||||
}
|
||||
EXPORT_SYMBOL(ath9k_hw_get_tsf_offset);
|
||||
|
||||
@ -115,7 +115,7 @@
|
||||
int ath9k_hw_reset(struct ath_hw *ah, struct ath9k_channel *chan,
|
||||
struct ath9k_hw_cal_data *caldata, bool fastcc)
|
||||
{
|
||||
@@ -2077,6 +2091,7 @@ int ath9k_hw_reset(struct ath_hw *ah, st
|
||||
@@ -2091,6 +2105,7 @@ int ath9k_hw_reset(struct ath_hw *ah, st
|
||||
ar9003_hw_disable_phy_restart(ah);
|
||||
|
||||
ath9k_hw_apply_gpio_override(ah);
|
||||
|
@ -20,7 +20,7 @@
|
||||
/******************/
|
||||
/* Chip Revisions */
|
||||
/******************/
|
||||
@@ -1441,6 +1454,9 @@ static bool ath9k_hw_set_reset(struct at
|
||||
@@ -1455,6 +1468,9 @@ static bool ath9k_hw_set_reset(struct at
|
||||
udelay(50);
|
||||
}
|
||||
|
||||
@ -30,7 +30,7 @@
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -1540,6 +1556,9 @@ static bool ath9k_hw_chip_reset(struct a
|
||||
@@ -1554,6 +1570,9 @@ static bool ath9k_hw_chip_reset(struct a
|
||||
ar9003_hw_internal_regulator_apply(ah);
|
||||
ath9k_hw_init_pll(ah, chan);
|
||||
|
||||
@ -40,7 +40,7 @@
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -1847,8 +1866,14 @@ static int ath9k_hw_do_fastcc(struct ath
|
||||
@@ -1861,8 +1880,14 @@ static int ath9k_hw_do_fastcc(struct ath
|
||||
if (AR_SREV_9271(ah))
|
||||
ar9002_hw_load_ani_reg(ah, chan);
|
||||
|
||||
@ -55,7 +55,7 @@
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
@@ -2102,6 +2127,9 @@ int ath9k_hw_reset(struct ath_hw *ah, st
|
||||
@@ -2116,6 +2141,9 @@ int ath9k_hw_reset(struct ath_hw *ah, st
|
||||
ath9k_hw_set_radar_params(ah);
|
||||
}
|
||||
|
||||
|
@ -0,0 +1,89 @@
|
||||
From 4420866ef1b602682b009e0186fbb8aefd2125be Mon Sep 17 00:00:00 2001
|
||||
From: Lorenzo Bianconi <lorenzo@kernel.org>
|
||||
Date: Tue, 20 Aug 2019 18:20:19 +0200
|
||||
Subject: [PATCH 1/4] ath9k: dynack: introduce ath_dynack_set_timeout routine
|
||||
|
||||
Introduce ath_dynack_set_timeout routine to configure slottime/ack/cts
|
||||
timeouts and remove duplicated code
|
||||
|
||||
Tested-by: Koen Vandeputte <koen.vandeputte@ncentric.com>
|
||||
Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
|
||||
---
|
||||
drivers/net/wireless/ath/ath9k/dynack.c | 37 ++++++++++++++-----------
|
||||
1 file changed, 21 insertions(+), 16 deletions(-)
|
||||
|
||||
--- a/drivers/net/wireless/ath/ath9k/dynack.c
|
||||
+++ b/drivers/net/wireless/ath/ath9k/dynack.c
|
||||
@@ -79,6 +79,24 @@ static inline bool ath_dynack_bssidmask(
|
||||
}
|
||||
|
||||
/**
|
||||
+ * ath_dynack_set_timeout - configure timeouts/slottime registers
|
||||
+ * @ah: ath hw
|
||||
+ * @to: timeout value
|
||||
+ *
|
||||
+ */
|
||||
+static void ath_dynack_set_timeout(struct ath_hw *ah, int to)
|
||||
+{
|
||||
+ struct ath_common *common = ath9k_hw_common(ah);
|
||||
+ int slottime = (to - 3) / 2;
|
||||
+
|
||||
+ ath_dbg(common, DYNACK, "ACK timeout %u slottime %u\n",
|
||||
+ to, slottime);
|
||||
+ ath9k_hw_setslottime(ah, slottime);
|
||||
+ ath9k_hw_set_ack_timeout(ah, to);
|
||||
+ ath9k_hw_set_cts_timeout(ah, to);
|
||||
+}
|
||||
+
|
||||
+/**
|
||||
* ath_dynack_compute_ackto - compute ACK timeout as the maximum STA timeout
|
||||
* @ah: ath hw
|
||||
*
|
||||
@@ -86,7 +104,6 @@ static inline bool ath_dynack_bssidmask(
|
||||
*/
|
||||
static void ath_dynack_compute_ackto(struct ath_hw *ah)
|
||||
{
|
||||
- struct ath_common *common = ath9k_hw_common(ah);
|
||||
struct ath_dynack *da = &ah->dynack;
|
||||
struct ath_node *an;
|
||||
int to = 0;
|
||||
@@ -96,15 +113,8 @@ static void ath_dynack_compute_ackto(str
|
||||
to = an->ackto;
|
||||
|
||||
if (to && da->ackto != to) {
|
||||
- u32 slottime;
|
||||
-
|
||||
- slottime = (to - 3) / 2;
|
||||
+ ath_dynack_set_timeout(ah, to);
|
||||
da->ackto = to;
|
||||
- ath_dbg(common, DYNACK, "ACK timeout %u slottime %u\n",
|
||||
- da->ackto, slottime);
|
||||
- ath9k_hw_setslottime(ah, slottime);
|
||||
- ath9k_hw_set_ack_timeout(ah, da->ackto);
|
||||
- ath9k_hw_set_cts_timeout(ah, da->ackto);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -198,10 +208,7 @@ void ath_dynack_sample_tx_ts(struct ath_
|
||||
ieee80211_is_assoc_resp(hdr->frame_control) ||
|
||||
ieee80211_is_auth(hdr->frame_control)) {
|
||||
ath_dbg(common, DYNACK, "late ack\n");
|
||||
-
|
||||
- ath9k_hw_setslottime(ah, (LATEACK_TO - 3) / 2);
|
||||
- ath9k_hw_set_ack_timeout(ah, LATEACK_TO);
|
||||
- ath9k_hw_set_cts_timeout(ah, LATEACK_TO);
|
||||
+ ath_dynack_set_timeout(ah, LATEACK_TO);
|
||||
if (sta) {
|
||||
struct ath_node *an;
|
||||
|
||||
@@ -340,9 +347,7 @@ void ath_dynack_reset(struct ath_hw *ah)
|
||||
da->ack_rbf.h_rb = 0;
|
||||
|
||||
/* init acktimeout */
|
||||
- ath9k_hw_setslottime(ah, (ackto - 3) / 2);
|
||||
- ath9k_hw_set_ack_timeout(ah, ackto);
|
||||
- ath9k_hw_set_cts_timeout(ah, ackto);
|
||||
+ ath_dynack_set_timeout(ah, ackto);
|
||||
}
|
||||
EXPORT_SYMBOL(ath_dynack_reset);
|
||||
|
@ -0,0 +1,27 @@
|
||||
From e5b56ce50eab31d24df6a70cf025db3acc4aa3ac Mon Sep 17 00:00:00 2001
|
||||
From: Lorenzo Bianconi <lorenzo@kernel.org>
|
||||
Date: Tue, 20 Aug 2019 18:20:20 +0200
|
||||
Subject: [PATCH 2/4] ath9k: dynack: properly set last timeout timestamp in
|
||||
ath_dynack_reset
|
||||
|
||||
Add compute timeout to last computation timestamp in
|
||||
ath_dynack_reset in order to not run ath_dynack_compute_ackto
|
||||
immediately
|
||||
|
||||
Tested-by: Koen Vandeputte <koen.vandeputte@ncentric.com>
|
||||
Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
|
||||
---
|
||||
drivers/net/wireless/ath/ath9k/dynack.c | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
--- a/drivers/net/wireless/ath/ath9k/dynack.c
|
||||
+++ b/drivers/net/wireless/ath/ath9k/dynack.c
|
||||
@@ -338,7 +338,7 @@ void ath_dynack_reset(struct ath_hw *ah)
|
||||
u32 ackto = 9 + 16 + 64;
|
||||
struct ath_dynack *da = &ah->dynack;
|
||||
|
||||
- da->lto = jiffies;
|
||||
+ da->lto = jiffies + COMPUTE_TO;
|
||||
da->ackto = ackto;
|
||||
|
||||
da->st_rbf.t_rb = 0;
|
@ -0,0 +1,92 @@
|
||||
From 3f737abb7d53cc80d619a3b4a30b6fa63cdc8df7 Mon Sep 17 00:00:00 2001
|
||||
From: Lorenzo Bianconi <lorenzo@kernel.org>
|
||||
Date: Tue, 20 Aug 2019 18:20:21 +0200
|
||||
Subject: [PATCH 3/4] ath9k: dynack: set max timeout according to channel width
|
||||
|
||||
Compute maximum configurable ackimeout/ctstimeout according to channel
|
||||
width (clockrate)
|
||||
|
||||
Tested-by: Koen Vandeputte <koen.vandeputte@ncentric.com>
|
||||
Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
|
||||
---
|
||||
drivers/net/wireless/ath/ath9k/dynack.c | 38 +++++++++++++++++++------
|
||||
1 file changed, 30 insertions(+), 8 deletions(-)
|
||||
|
||||
--- a/drivers/net/wireless/ath/ath9k/dynack.c
|
||||
+++ b/drivers/net/wireless/ath/ath9k/dynack.c
|
||||
@@ -20,12 +20,31 @@
|
||||
|
||||
#define COMPUTE_TO (5 * HZ)
|
||||
#define LATEACK_DELAY (10 * HZ)
|
||||
-#define LATEACK_TO 256
|
||||
-#define MAX_DELAY 300
|
||||
#define EWMA_LEVEL 96
|
||||
#define EWMA_DIV 128
|
||||
|
||||
/**
|
||||
+ * ath_dynack_get_max_to - set max timeout according to channel width
|
||||
+ * @ah: ath hw
|
||||
+ *
|
||||
+ */
|
||||
+static u32 ath_dynack_get_max_to(struct ath_hw *ah)
|
||||
+{
|
||||
+ const struct ath9k_channel *chan = ah->curchan;
|
||||
+
|
||||
+ if (!chan)
|
||||
+ return 300;
|
||||
+
|
||||
+ if (IS_CHAN_HT40(chan))
|
||||
+ return 300;
|
||||
+ if (IS_CHAN_HALF_RATE(chan))
|
||||
+ return 750;
|
||||
+ if (IS_CHAN_QUARTER_RATE(chan))
|
||||
+ return 1500;
|
||||
+ return 600;
|
||||
+}
|
||||
+
|
||||
+/**
|
||||
* ath_dynack_ewma - EWMA (Exponentially Weighted Moving Average) calculation
|
||||
*
|
||||
*/
|
||||
@@ -126,15 +145,16 @@ static void ath_dynack_compute_ackto(str
|
||||
*/
|
||||
static void ath_dynack_compute_to(struct ath_hw *ah)
|
||||
{
|
||||
- u32 ackto, ack_ts;
|
||||
- u8 *dst, *src;
|
||||
+ struct ath_dynack *da = &ah->dynack;
|
||||
+ u32 ackto, ack_ts, max_to;
|
||||
struct ieee80211_sta *sta;
|
||||
- struct ath_node *an;
|
||||
struct ts_info *st_ts;
|
||||
- struct ath_dynack *da = &ah->dynack;
|
||||
+ struct ath_node *an;
|
||||
+ u8 *dst, *src;
|
||||
|
||||
rcu_read_lock();
|
||||
|
||||
+ max_to = ath_dynack_get_max_to(ah);
|
||||
while (da->st_rbf.h_rb != da->st_rbf.t_rb &&
|
||||
da->ack_rbf.h_rb != da->ack_rbf.t_rb) {
|
||||
ack_ts = da->ack_rbf.tstamp[da->ack_rbf.h_rb];
|
||||
@@ -150,7 +170,7 @@ static void ath_dynack_compute_to(struct
|
||||
if (ack_ts > st_ts->tstamp + st_ts->dur) {
|
||||
ackto = ack_ts - st_ts->tstamp - st_ts->dur;
|
||||
|
||||
- if (ackto < MAX_DELAY) {
|
||||
+ if (ackto < max_to) {
|
||||
sta = ieee80211_find_sta_by_ifaddr(ah->hw, dst,
|
||||
src);
|
||||
if (sta) {
|
||||
@@ -207,8 +227,10 @@ void ath_dynack_sample_tx_ts(struct ath_
|
||||
if (ieee80211_is_assoc_req(hdr->frame_control) ||
|
||||
ieee80211_is_assoc_resp(hdr->frame_control) ||
|
||||
ieee80211_is_auth(hdr->frame_control)) {
|
||||
+ u32 max_to = ath_dynack_get_max_to(ah);
|
||||
+
|
||||
ath_dbg(common, DYNACK, "late ack\n");
|
||||
- ath_dynack_set_timeout(ah, LATEACK_TO);
|
||||
+ ath_dynack_set_timeout(ah, max_to);
|
||||
if (sta) {
|
||||
struct ath_node *an;
|
||||
|
@ -0,0 +1,73 @@
|
||||
From cc783bfa67e87d2e6206f7626b7bbb74d5c5f269 Mon Sep 17 00:00:00 2001
|
||||
From: Lorenzo Bianconi <lorenzo@kernel.org>
|
||||
Date: Tue, 20 Aug 2019 18:20:22 +0200
|
||||
Subject: [PATCH 4/4] ath9k: dynack: set ackto to max timeout in
|
||||
ath_dynack_reset
|
||||
|
||||
Initialize acktimeout to the maximum configurable value in
|
||||
ath_dynack_reset in order to not disconnect long distance static links
|
||||
enabling dynack and even to take care of possible errors configuring
|
||||
a static timeout. Moreover initialize station timeout value to the current
|
||||
acktimeout value
|
||||
|
||||
Tested-by: Koen Vandeputte <koen.vandeputte@ncentric.com>
|
||||
Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
|
||||
---
|
||||
drivers/net/wireless/ath/ath9k/dynack.c | 20 +++++++++++++-------
|
||||
1 file changed, 13 insertions(+), 7 deletions(-)
|
||||
|
||||
--- a/drivers/net/wireless/ath/ath9k/dynack.c
|
||||
+++ b/drivers/net/wireless/ath/ath9k/dynack.c
|
||||
@@ -321,11 +321,9 @@ EXPORT_SYMBOL(ath_dynack_sample_ack_ts);
|
||||
*/
|
||||
void ath_dynack_node_init(struct ath_hw *ah, struct ath_node *an)
|
||||
{
|
||||
- /* ackto = slottime + sifs + air delay */
|
||||
- u32 ackto = 9 + 16 + 64;
|
||||
struct ath_dynack *da = &ah->dynack;
|
||||
|
||||
- an->ackto = ackto;
|
||||
+ an->ackto = da->ackto;
|
||||
|
||||
spin_lock(&da->qlock);
|
||||
list_add_tail(&an->list, &da->nodes);
|
||||
@@ -356,20 +354,26 @@ EXPORT_SYMBOL(ath_dynack_node_deinit);
|
||||
*/
|
||||
void ath_dynack_reset(struct ath_hw *ah)
|
||||
{
|
||||
- /* ackto = slottime + sifs + air delay */
|
||||
- u32 ackto = 9 + 16 + 64;
|
||||
struct ath_dynack *da = &ah->dynack;
|
||||
+ struct ath_node *an;
|
||||
+
|
||||
+ spin_lock_bh(&da->qlock);
|
||||
|
||||
da->lto = jiffies + COMPUTE_TO;
|
||||
- da->ackto = ackto;
|
||||
|
||||
da->st_rbf.t_rb = 0;
|
||||
da->st_rbf.h_rb = 0;
|
||||
da->ack_rbf.t_rb = 0;
|
||||
da->ack_rbf.h_rb = 0;
|
||||
|
||||
+ da->ackto = ath_dynack_get_max_to(ah);
|
||||
+ list_for_each_entry(an, &da->nodes, list)
|
||||
+ an->ackto = da->ackto;
|
||||
+
|
||||
/* init acktimeout */
|
||||
- ath_dynack_set_timeout(ah, ackto);
|
||||
+ ath_dynack_set_timeout(ah, da->ackto);
|
||||
+
|
||||
+ spin_unlock_bh(&da->qlock);
|
||||
}
|
||||
EXPORT_SYMBOL(ath_dynack_reset);
|
||||
|
||||
@@ -386,6 +390,8 @@ void ath_dynack_init(struct ath_hw *ah)
|
||||
|
||||
spin_lock_init(&da->qlock);
|
||||
INIT_LIST_HEAD(&da->nodes);
|
||||
+ /* ackto = slottime + sifs + air delay */
|
||||
+ da->ackto = 9 + 16 + 64;
|
||||
|
||||
ah->hw->wiphy->features |= NL80211_FEATURE_ACKTO_ESTIMATION;
|
||||
}
|
@ -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
|
||||
@@ -8286,6 +8286,21 @@ static int ath10k_mac_init_rd(struct ath
|
||||
return 0;
|
||||
}
|
||||
|
||||
@ -22,7 +22,7 @@
|
||||
int ath10k_mac_register(struct ath10k *ar)
|
||||
{
|
||||
static const u32 cipher_suites[] = {
|
||||
@@ -8571,6 +8586,12 @@ int ath10k_mac_register(struct ath10k *a
|
||||
@@ -8575,6 +8590,12 @@ int ath10k_mac_register(struct ath10k *a
|
||||
|
||||
wiphy_ext_feature_set(ar->hw->wiphy, NL80211_EXT_FEATURE_CQM_RSSI_LIST);
|
||||
|
||||
|
@ -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
|
||||
@@ -2473,7 +2473,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
|
||||
@@ -2533,23 +2533,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
|
||||
@@ -2701,9 +2723,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);
|
||||
|
@ -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
|
||||
@@ -4477,13 +4477,6 @@ static struct ieee80211_sta_vht_cap ath1
|
||||
vht_cap.cap |= val;
|
||||
}
|
||||
|
||||
|
@ -42,7 +42,7 @@ Signed-off-by: Mathias Kresin <dev@kresin.me>
|
||||
if (ret)
|
||||
--- a/drivers/net/wireless/ath/ath10k/mac.c
|
||||
+++ b/drivers/net/wireless/ath/ath10k/mac.c
|
||||
@@ -8603,7 +8603,7 @@ int ath10k_mac_register(struct ath10k *a
|
||||
@@ -8607,7 +8607,7 @@ int ath10k_mac_register(struct ath10k *a
|
||||
wiphy_ext_feature_set(ar->hw->wiphy, NL80211_EXT_FEATURE_CQM_RSSI_LIST);
|
||||
|
||||
#ifdef CPTCFG_MAC80211_LEDS
|
||||
|
@ -29,7 +29,7 @@ Forwarded: https://patchwork.kernel.org/patch/10549245/
|
||||
#include <net/mac80211.h>
|
||||
#include <linux/etherdevice.h>
|
||||
#include <linux/acpi.h>
|
||||
@@ -8390,6 +8391,7 @@ int ath10k_mac_register(struct ath10k *a
|
||||
@@ -8394,6 +8395,7 @@ int ath10k_mac_register(struct ath10k *a
|
||||
ar->hw->wiphy->bands[NL80211_BAND_5GHZ] = band;
|
||||
}
|
||||
|
||||
|
@ -43,7 +43,7 @@ Origin: backport, https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux
|
||||
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
|
||||
@@ -5472,9 +5488,10 @@ static void ath10k_bss_info_changed(stru
|
||||
struct cfg80211_chan_def def;
|
||||
u32 vdev_param, pdev_param, slottime, preamble;
|
||||
u16 bitrate, hw_value;
|
||||
@ -56,7 +56,7 @@ Origin: backport, https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux
|
||||
|
||||
mutex_lock(&ar->conf_mutex);
|
||||
|
||||
@@ -5676,6 +5693,30 @@ static void ath10k_bss_info_changed(stru
|
||||
@@ -5680,6 +5697,30 @@ static void ath10k_bss_info_changed(stru
|
||||
arvif->vdev_id, ret);
|
||||
}
|
||||
|
||||
|
@ -26,7 +26,7 @@ Origin: backport, https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux
|
||||
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
|
||||
@@ -5703,22 +5703,22 @@ static void ath10k_bss_info_changed(stru
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -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
|
||||
@@ -5488,8 +5488,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
|
||||
@@ -5662,7 +5662,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];
|
||||
|
@ -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
|
||||
@@ -3143,7 +3143,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;
|
||||
|
@ -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
|
||||
@@ -3143,7 +3179,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;
|
||||
|
@ -22,7 +22,7 @@ Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
|
||||
|
||||
--- 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
|
||||
@@ -1474,7 +1474,7 @@ static u8 brcmf_sdio_rxglom(struct brcmf
|
||||
struct sk_buff *pfirst, *pnext;
|
||||
|
||||
int errcode;
|
||||
@ -31,7 +31,7 @@ Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
|
||||
|
||||
struct brcmf_sdio_hdrinfo rd_new;
|
||||
|
||||
@@ -1597,7 +1597,6 @@ static u8 brcmf_sdio_rxglom(struct brcmf
|
||||
@@ -1608,7 +1608,6 @@ static u8 brcmf_sdio_rxglom(struct brcmf
|
||||
|
||||
/* Remove superframe header, remember offset */
|
||||
skb_pull(pfirst, rd_new.dat_offset);
|
||||
@ -39,7 +39,7 @@ Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
|
||||
num = 0;
|
||||
|
||||
/* Validate all the subframe headers */
|
||||
@@ -3405,7 +3404,6 @@ static int brcmf_sdio_bus_preinit(struct
|
||||
@@ -3416,7 +3415,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;
|
||||
@ -47,7 +47,7 @@ Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
|
||||
u32 value;
|
||||
int err;
|
||||
|
||||
@@ -3448,7 +3446,6 @@ static int brcmf_sdio_bus_preinit(struct
|
||||
@@ -3459,7 +3457,6 @@ static int brcmf_sdio_bus_preinit(struct
|
||||
if (sdiodev->sg_support) {
|
||||
bus->txglom = false;
|
||||
value = 1;
|
||||
|
@ -67,7 +67,7 @@ Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
|
||||
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
|
||||
@@ -4185,6 +4185,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;
|
||||
|
@ -27,7 +27,7 @@ Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
|
||||
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
|
||||
@@ -1241,6 +1242,9 @@ static void brcmf_fws_return_credits(str
|
||||
}
|
||||
|
||||
fws->fifo_credit[fifo] += credits;
|
||||
@ -37,7 +37,7 @@ Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
|
||||
}
|
||||
|
||||
static void brcmf_fws_schedule_deq(struct brcmf_fws_info *fws)
|
||||
@@ -1595,19 +1599,21 @@ static int brcmf_fws_notify_credit_map(s
|
||||
@@ -1599,19 +1603,21 @@ static int brcmf_fws_notify_credit_map(s
|
||||
brcmf_err("event payload too small (%d)\n", e->datalen);
|
||||
return -EINVAL;
|
||||
}
|
||||
@ -63,7 +63,7 @@ Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
|
||||
}
|
||||
brcmf_fws_schedule_deq(fws);
|
||||
brcmf_fws_unlock(fws);
|
||||
@@ -2013,7 +2019,7 @@ static int brcmf_fws_borrow_credit(struc
|
||||
@@ -2017,7 +2023,7 @@ static int brcmf_fws_borrow_credit(struc
|
||||
}
|
||||
|
||||
for (lender_ac = 0; lender_ac <= BRCMF_FWS_FIFO_AC_VO; lender_ac++) {
|
||||
@ -72,7 +72,7 @@ Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
|
||||
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
|
||||
@@ -2216,8 +2222,9 @@ static void brcmf_fws_dequeue_worker(str
|
||||
}
|
||||
continue;
|
||||
}
|
||||
@ -84,7 +84,7 @@ Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
|
||||
skb = brcmf_fws_deq(fws, fifo);
|
||||
if (!skb)
|
||||
break;
|
||||
@@ -2222,7 +2229,7 @@ static void brcmf_fws_dequeue_worker(str
|
||||
@@ -2228,7 +2235,7 @@ static void brcmf_fws_dequeue_worker(str
|
||||
break;
|
||||
}
|
||||
if ((fifo == BRCMF_FWS_FIFO_AC_BE) &&
|
||||
|
@ -17,7 +17,7 @@ Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
|
||||
|
||||
--- 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
|
||||
@@ -6644,6 +6644,12 @@ static s32 brcmf_config_dongle(struct br
|
||||
|
||||
brcmf_configure_arp_nd_offload(ifp, true);
|
||||
|
||||
|
@ -18,7 +18,7 @@ Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
|
||||
|
||||
--- 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
|
||||
@@ -1459,9 +1459,10 @@ static int brcmf_fws_txstatus_suppressed
|
||||
|
||||
static int
|
||||
brcmf_fws_txs_process(struct brcmf_fws_info *fws, u8 flags, u32 hslot,
|
||||
@ -30,7 +30,7 @@ Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
|
||||
int ret;
|
||||
bool remove_from_hanger = true;
|
||||
struct sk_buff *skb;
|
||||
@@ -1468,60 +1469,71 @@ brcmf_fws_txs_process(struct brcmf_fws_i
|
||||
@@ -1472,60 +1473,71 @@ brcmf_fws_txs_process(struct brcmf_fws_i
|
||||
brcmf_dbg(DATA, "flags %d\n", flags);
|
||||
|
||||
if (flags == BRCMF_FWS_TXSTATUS_DISCARD)
|
||||
@ -144,7 +144,7 @@ Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
|
||||
|
||||
return 0;
|
||||
}
|
||||
@@ -1547,7 +1559,8 @@ static int brcmf_fws_fifocreditback_indi
|
||||
@@ -1551,7 +1563,8 @@ static int brcmf_fws_fifocreditback_indi
|
||||
return BRCMF_FWS_RET_OK_SCHEDULE;
|
||||
}
|
||||
|
||||
@ -154,7 +154,7 @@ Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
|
||||
{
|
||||
__le32 status_le;
|
||||
__le16 seq_le;
|
||||
@@ -1556,23 +1569,31 @@ static int brcmf_fws_txstatus_indicate(s
|
||||
@@ -1560,23 +1573,31 @@ static int brcmf_fws_txstatus_indicate(s
|
||||
u32 genbit;
|
||||
u8 flags;
|
||||
u16 seq;
|
||||
@ -189,7 +189,7 @@ Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
|
||||
brcmf_fws_unlock(fws);
|
||||
return BRCMF_FWS_RET_OK_NOSCHEDULE;
|
||||
}
|
||||
@@ -1888,8 +1909,6 @@ void brcmf_fws_hdrpull(struct brcmf_if *
|
||||
@@ -1892,8 +1913,6 @@ void brcmf_fws_hdrpull(struct brcmf_if *
|
||||
|
||||
err = BRCMF_FWS_RET_OK_NOSCHEDULE;
|
||||
switch (type) {
|
||||
@ -198,7 +198,7 @@ Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
|
||||
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 *
|
||||
@@ -1916,7 +1935,8 @@ void brcmf_fws_hdrpull(struct brcmf_if *
|
||||
err = brcmf_fws_request_indicate(fws, type, data);
|
||||
break;
|
||||
case BRCMF_FWS_TYPE_TXSTATUS:
|
||||
@ -208,7 +208,7 @@ Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
|
||||
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
|
||||
@@ -2005,7 +2025,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,
|
||||
@ -217,7 +217,7 @@ Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
|
||||
} else {
|
||||
fws->stats.rollback_success++;
|
||||
brcmf_fws_return_credits(fws, fifo, 1);
|
||||
@@ -2462,7 +2482,8 @@ void brcmf_fws_bustxfail(struct brcmf_fw
|
||||
@@ -2476,7 +2496,8 @@ void brcmf_fws_bustxfail(struct brcmf_fw
|
||||
}
|
||||
brcmf_fws_lock(fws);
|
||||
hslot = brcmf_skb_htod_tag_get_field(skb, HSLOT);
|
||||
|
@ -37,7 +37,7 @@ Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
|
||||
/* 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
|
||||
@@ -4057,6 +4063,7 @@ static void brcmf_sdio_firmware_callback
|
||||
void *nvram;
|
||||
u32 nvram_len;
|
||||
u8 saveclk;
|
||||
@ -45,7 +45,7 @@ Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
|
||||
|
||||
brcmf_dbg(TRACE, "Enter: dev=%s, err=%d\n", dev_name(dev), err);
|
||||
|
||||
@@ -4101,8 +4108,23 @@ static void brcmf_sdio_firmware_callback
|
||||
@@ -4112,8 +4119,23 @@ static void brcmf_sdio_firmware_callback
|
||||
brcmf_sdiod_writel(sdiod, core->base + SD_REG(hostintmask),
|
||||
bus->hostintmask, NULL);
|
||||
|
||||
|
@ -18,7 +18,7 @@ Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
|
||||
|
||||
--- 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
|
||||
@@ -4130,6 +4130,9 @@ static void brcmf_sdio_firmware_callback
|
||||
devctl |= SBSDIO_DEVCTL_F2WM_ENAB;
|
||||
brcmf_sdiod_writeb(sdiod, SBSDIO_DEVICE_CTL, devctl,
|
||||
&err);
|
||||
|
@ -85,7 +85,7 @@ Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
|
||||
};
|
||||
|
||||
static void pkt_align(struct sk_buff *p, int len, int align)
|
||||
@@ -677,6 +679,14 @@ brcmf_sdio_kso_control(struct brcmf_sdio
|
||||
@@ -683,6 +685,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);
|
||||
|
||||
@ -100,7 +100,7 @@ Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
|
||||
if (on) {
|
||||
/* device WAKEUP through KSO:
|
||||
* write bit 0 & read back until
|
||||
@@ -2402,6 +2412,14 @@ static int brcmf_sdio_tx_ctrlframe(struc
|
||||
@@ -2413,6 +2423,14 @@ static int brcmf_sdio_tx_ctrlframe(struc
|
||||
return ret;
|
||||
}
|
||||
|
||||
@ -115,7 +115,7 @@ Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
|
||||
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
|
||||
@@ -2420,7 +2438,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;
|
||||
@ -124,7 +124,7 @@ Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
|
||||
int err;
|
||||
|
||||
brcmf_dbg(TRACE, "Enter\n");
|
||||
@@ -2436,9 +2454,14 @@ static void brcmf_sdio_bus_stop(struct d
|
||||
@@ -2447,9 +2465,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);
|
||||
@ -142,7 +142,7 @@ Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
|
||||
if (err)
|
||||
brcmf_err("Failed to force clock for F2: err %d\n",
|
||||
err);
|
||||
@@ -3328,20 +3351,45 @@ err:
|
||||
@@ -3339,20 +3362,45 @@ err:
|
||||
return bcmerror;
|
||||
}
|
||||
|
||||
@ -190,7 +190,7 @@ Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
|
||||
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
|
||||
@@ -3361,8 +3409,7 @@ static void brcmf_sdio_sr_init(struct br
|
||||
|
||||
/* Add CMD14 Support */
|
||||
brcmf_sdiod_func0_wb(bus->sdiodev, SDIO_CCCR_BRCM_CARDCAP,
|
||||
@ -200,7 +200,7 @@ Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
|
||||
&err);
|
||||
if (err) {
|
||||
brcmf_err("error writing SDIO_CCCR_BRCM_CARDCAP\n");
|
||||
@@ -3359,7 +3406,7 @@ static void brcmf_sdio_sr_init(struct br
|
||||
@@ -3370,7 +3417,7 @@ static void brcmf_sdio_sr_init(struct br
|
||||
}
|
||||
|
||||
brcmf_sdiod_writeb(bus->sdiodev, SBSDIO_FUNC1_CHIPCLKCSR,
|
||||
@ -209,7 +209,7 @@ Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
|
||||
if (err) {
|
||||
brcmf_err("error writing SBSDIO_FUNC1_CHIPCLKCSR\n");
|
||||
return;
|
||||
@@ -4051,7 +4098,7 @@ static void brcmf_sdio_firmware_callback
|
||||
@@ -4062,7 +4109,7 @@ static void brcmf_sdio_firmware_callback
|
||||
const struct firmware *code;
|
||||
void *nvram;
|
||||
u32 nvram_len;
|
||||
@ -218,7 +218,7 @@ Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
|
||||
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
|
||||
@@ -4096,8 +4143,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) {
|
||||
|
@ -29,7 +29,7 @@ Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
|
||||
|
||||
#ifdef DEBUG
|
||||
|
||||
@@ -4173,6 +4174,17 @@ static void brcmf_sdio_firmware_callback
|
||||
@@ -4184,6 +4185,17 @@ static void brcmf_sdio_firmware_callback
|
||||
CY_4373_F2_WATERMARK |
|
||||
SBSDIO_MESBUSYCTRL_ENAB, &err);
|
||||
break;
|
||||
|
@ -30,7 +30,7 @@ Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
|
||||
|
||||
--- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c
|
||||
+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c
|
||||
@@ -3354,7 +3354,11 @@ err:
|
||||
@@ -3365,7 +3365,11 @@ err:
|
||||
|
||||
static bool brcmf_sdio_aos_no_decode(struct brcmf_sdio *bus)
|
||||
{
|
||||
|
@ -22,7 +22,7 @@ Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
|
||||
|
||||
--- 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] =
|
||||
@@ -6314,6 +6314,16 @@ brcmf_txrx_stypes[NUM_NL80211_IFTYPES] =
|
||||
.tx = 0xffff,
|
||||
.rx = BIT(IEEE80211_STYPE_ACTION >> 4) |
|
||||
BIT(IEEE80211_STYPE_PROBE_REQ >> 4)
|
||||
|
@ -14,7 +14,7 @@ Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
|
||||
|
||||
--- 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)
|
||||
@@ -1557,6 +1557,10 @@ void brcmf_usb_exit(void)
|
||||
|
||||
void brcmf_usb_register(void)
|
||||
{
|
||||
|
@ -1078,7 +1078,7 @@ Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
@@ -3498,7 +3531,7 @@ static void brcmf_report_wowl_wakeind(st
|
||||
@@ -3500,7 +3533,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) {
|
||||
@ -1087,7 +1087,7 @@ Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -3539,7 +3572,7 @@ static void brcmf_report_wowl_wakeind(st
|
||||
@@ -3541,7 +3574,7 @@ static void brcmf_report_wowl_wakeind(st
|
||||
cfg->wowl.nd_data_completed,
|
||||
BRCMF_ND_INFO_TIMEOUT);
|
||||
if (!timeout)
|
||||
@ -1096,7 +1096,7 @@ Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
|
||||
else
|
||||
wakeup_data.net_detect = cfg->wowl.nd_info;
|
||||
}
|
||||
@@ -3747,7 +3780,7 @@ brcmf_cfg80211_set_pmksa(struct wiphy *w
|
||||
@@ -3749,7 +3782,7 @@ brcmf_cfg80211_set_pmksa(struct wiphy *w
|
||||
cfg->pmk_list.npmk = cpu_to_le32(npmk);
|
||||
}
|
||||
} else {
|
||||
@ -1105,7 +1105,7 @@ Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
@@ -3793,7 +3826,7 @@ brcmf_cfg80211_del_pmksa(struct wiphy *w
|
||||
@@ -3795,7 +3828,7 @@ brcmf_cfg80211_del_pmksa(struct wiphy *w
|
||||
memset(&pmk[i], 0, sizeof(*pmk));
|
||||
cfg->pmk_list.npmk = cpu_to_le32(npmk - 1);
|
||||
} else {
|
||||
@ -1114,7 +1114,7 @@ Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
@@ -3825,19 +3858,20 @@ brcmf_cfg80211_flush_pmksa(struct wiphy
|
||||
@@ -3827,19 +3860,20 @@ brcmf_cfg80211_flush_pmksa(struct wiphy
|
||||
|
||||
static s32 brcmf_configure_opensecurity(struct brcmf_if *ifp)
|
||||
{
|
||||
@ -1137,7 +1137,7 @@ Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
|
||||
return err;
|
||||
}
|
||||
/* set upper-layer auth */
|
||||
@@ -3847,7 +3881,7 @@ static s32 brcmf_configure_opensecurity(
|
||||
@@ -3849,7 +3883,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) {
|
||||
@ -1146,7 +1146,7 @@ Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
|
||||
return err;
|
||||
}
|
||||
|
||||
@@ -3867,6 +3901,7 @@ brcmf_configure_wpaie(struct brcmf_if *i
|
||||
@@ -3869,6 +3903,7 @@ brcmf_configure_wpaie(struct brcmf_if *i
|
||||
const struct brcmf_vs_tlv *wpa_ie,
|
||||
bool is_rsn_ie)
|
||||
{
|
||||
@ -1154,7 +1154,7 @@ Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
|
||||
u32 auth = 0; /* d11 open authentication */
|
||||
u16 count;
|
||||
s32 err = 0;
|
||||
@@ -3897,13 +3932,13 @@ brcmf_configure_wpaie(struct brcmf_if *i
|
||||
@@ -3899,13 +3934,13 @@ brcmf_configure_wpaie(struct brcmf_if *i
|
||||
/* check for multicast cipher suite */
|
||||
if (offset + WPA_IE_MIN_OUI_LEN > len) {
|
||||
err = -EINVAL;
|
||||
@ -1170,7 +1170,7 @@ Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
|
||||
goto exit;
|
||||
}
|
||||
offset += TLV_OUI_LEN;
|
||||
@@ -3925,7 +3960,7 @@ brcmf_configure_wpaie(struct brcmf_if *i
|
||||
@@ -3927,7 +3962,7 @@ brcmf_configure_wpaie(struct brcmf_if *i
|
||||
break;
|
||||
default:
|
||||
err = -EINVAL;
|
||||
@ -1179,7 +1179,7 @@ Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
|
||||
goto exit;
|
||||
}
|
||||
|
||||
@@ -3936,13 +3971,13 @@ brcmf_configure_wpaie(struct brcmf_if *i
|
||||
@@ -3938,13 +3973,13 @@ brcmf_configure_wpaie(struct brcmf_if *i
|
||||
/* Check for unicast suite(s) */
|
||||
if (offset + (WPA_IE_MIN_OUI_LEN * count) > len) {
|
||||
err = -EINVAL;
|
||||
@ -1195,7 +1195,7 @@ Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
|
||||
goto exit;
|
||||
}
|
||||
offset += TLV_OUI_LEN;
|
||||
@@ -3960,7 +3995,7 @@ brcmf_configure_wpaie(struct brcmf_if *i
|
||||
@@ -3962,7 +3997,7 @@ brcmf_configure_wpaie(struct brcmf_if *i
|
||||
pval |= AES_ENABLED;
|
||||
break;
|
||||
default:
|
||||
@ -1204,7 +1204,7 @@ Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
|
||||
}
|
||||
offset++;
|
||||
}
|
||||
@@ -3970,13 +4005,13 @@ brcmf_configure_wpaie(struct brcmf_if *i
|
||||
@@ -3972,13 +4007,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;
|
||||
@ -1220,7 +1220,7 @@ Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
|
||||
goto exit;
|
||||
}
|
||||
offset += TLV_OUI_LEN;
|
||||
@@ -4004,7 +4039,7 @@ brcmf_configure_wpaie(struct brcmf_if *i
|
||||
@@ -4006,7 +4041,7 @@ brcmf_configure_wpaie(struct brcmf_if *i
|
||||
wpa_auth |= WPA2_AUTH_1X_SHA256;
|
||||
break;
|
||||
default:
|
||||
@ -1229,7 +1229,7 @@ Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
|
||||
}
|
||||
offset++;
|
||||
}
|
||||
@@ -4046,7 +4081,7 @@ brcmf_configure_wpaie(struct brcmf_if *i
|
||||
@@ -4048,7 +4083,7 @@ brcmf_configure_wpaie(struct brcmf_if *i
|
||||
err = brcmf_fil_bsscfg_int_set(ifp, "wme_bss_disable",
|
||||
wme_bss_disable);
|
||||
if (err < 0) {
|
||||
@ -1238,7 +1238,7 @@ Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
|
||||
goto exit;
|
||||
}
|
||||
|
||||
@@ -4060,7 +4095,7 @@ brcmf_configure_wpaie(struct brcmf_if *i
|
||||
@@ -4062,7 +4097,7 @@ brcmf_configure_wpaie(struct brcmf_if *i
|
||||
&data[offset],
|
||||
WPA_IE_MIN_OUI_LEN);
|
||||
if (err < 0) {
|
||||
@ -1247,7 +1247,7 @@ Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
|
||||
goto exit;
|
||||
}
|
||||
}
|
||||
@@ -4071,13 +4106,13 @@ brcmf_configure_wpaie(struct brcmf_if *i
|
||||
@@ -4073,13 +4108,13 @@ brcmf_configure_wpaie(struct brcmf_if *i
|
||||
/* set auth */
|
||||
err = brcmf_fil_bsscfg_int_set(ifp, "auth", auth);
|
||||
if (err < 0) {
|
||||
@ -1263,7 +1263,7 @@ Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
|
||||
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
|
||||
@@ -4088,14 +4123,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) {
|
||||
@ -1280,7 +1280,7 @@ Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
|
||||
goto exit;
|
||||
}
|
||||
|
||||
@@ -4180,6 +4215,7 @@ s32 brcmf_vif_set_mgmt_ie(struct brcmf_c
|
||||
@@ -4182,6 +4217,7 @@ s32 brcmf_vif_set_mgmt_ie(struct brcmf_c
|
||||
const u8 *vndr_ie_buf, u32 vndr_ie_len)
|
||||
{
|
||||
struct brcmf_if *ifp;
|
||||
@ -1288,7 +1288,7 @@ Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
|
||||
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
|
||||
@@ -4202,6 +4238,7 @@ s32 brcmf_vif_set_mgmt_ie(struct brcmf_c
|
||||
if (!vif)
|
||||
return -ENODEV;
|
||||
ifp = vif->ifp;
|
||||
@ -1296,7 +1296,7 @@ Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
|
||||
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
|
||||
@@ -4233,13 +4270,13 @@ s32 brcmf_vif_set_mgmt_ie(struct brcmf_c
|
||||
break;
|
||||
default:
|
||||
err = -EPERM;
|
||||
@ -1312,7 +1312,7 @@ Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
|
||||
goto exit;
|
||||
}
|
||||
|
||||
@@ -4298,8 +4335,8 @@ s32 brcmf_vif_set_mgmt_ie(struct brcmf_c
|
||||
@@ -4300,8 +4337,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)) {
|
||||
@ -1323,7 +1323,7 @@ Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
|
||||
break;
|
||||
}
|
||||
remained_buf_len -= (vndrie_info->ie_len +
|
||||
@@ -4330,7 +4367,7 @@ s32 brcmf_vif_set_mgmt_ie(struct brcmf_c
|
||||
@@ -4332,7 +4369,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)
|
||||
@ -1332,7 +1332,7 @@ Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
|
||||
}
|
||||
|
||||
exit:
|
||||
@@ -4358,13 +4395,14 @@ static s32
|
||||
@@ -4360,13 +4397,14 @@ static s32
|
||||
brcmf_config_ap_mgmt_ie(struct brcmf_cfg80211_vif *vif,
|
||||
struct cfg80211_beacon_data *beacon)
|
||||
{
|
||||
@ -1348,7 +1348,7 @@ Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
|
||||
return err;
|
||||
}
|
||||
brcmf_dbg(TRACE, "Applied Vndr IEs for Beacon\n");
|
||||
@@ -4374,7 +4412,7 @@ brcmf_config_ap_mgmt_ie(struct brcmf_cfg
|
||||
@@ -4376,7 +4414,7 @@ brcmf_config_ap_mgmt_ie(struct brcmf_cfg
|
||||
beacon->proberesp_ies,
|
||||
beacon->proberesp_ies_len);
|
||||
if (err)
|
||||
@ -1357,7 +1357,7 @@ Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
|
||||
else
|
||||
brcmf_dbg(TRACE, "Applied Vndr IEs for Probe Resp\n");
|
||||
|
||||
@@ -4483,7 +4521,8 @@ brcmf_cfg80211_start_ap(struct wiphy *wi
|
||||
@@ -4485,7 +4523,8 @@ brcmf_cfg80211_start_ap(struct wiphy *wi
|
||||
err = brcmf_fil_cmd_int_set(ifp, BRCMF_C_SET_REGULATORY,
|
||||
is_11d);
|
||||
if (err < 0) {
|
||||
@ -1367,7 +1367,7 @@ Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
|
||||
goto exit;
|
||||
}
|
||||
}
|
||||
@@ -4491,8 +4530,8 @@ brcmf_cfg80211_start_ap(struct wiphy *wi
|
||||
@@ -4493,8 +4532,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) {
|
||||
@ -1378,7 +1378,7 @@ Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
|
||||
goto exit;
|
||||
}
|
||||
}
|
||||
@@ -4500,7 +4539,8 @@ brcmf_cfg80211_start_ap(struct wiphy *wi
|
||||
@@ -4502,7 +4541,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) {
|
||||
@ -1388,7 +1388,7 @@ Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
|
||||
goto exit;
|
||||
}
|
||||
}
|
||||
@@ -4510,7 +4550,8 @@ brcmf_cfg80211_start_ap(struct wiphy *wi
|
||||
@@ -4512,7 +4552,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) {
|
||||
@ -1398,7 +1398,7 @@ Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
|
||||
goto exit;
|
||||
}
|
||||
brcmf_fil_iovar_int_set(ifp, "apsta", 0);
|
||||
@@ -4518,7 +4559,7 @@ brcmf_cfg80211_start_ap(struct wiphy *wi
|
||||
@@ -4520,7 +4561,7 @@ brcmf_cfg80211_start_ap(struct wiphy *wi
|
||||
|
||||
err = brcmf_fil_cmd_int_set(ifp, BRCMF_C_SET_INFRA, 1);
|
||||
if (err < 0) {
|
||||
@ -1407,7 +1407,7 @@ Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
|
||||
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
|
||||
@@ -4536,7 +4577,8 @@ brcmf_cfg80211_start_ap(struct wiphy *wi
|
||||
|
||||
err = brcmf_fil_cmd_int_set(ifp, BRCMF_C_SET_AP, 1);
|
||||
if (err < 0) {
|
||||
@ -1417,7 +1417,7 @@ Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
|
||||
goto exit;
|
||||
}
|
||||
if (!mbss) {
|
||||
@@ -4543,14 +4585,14 @@ brcmf_cfg80211_start_ap(struct wiphy *wi
|
||||
@@ -4545,14 +4587,14 @@ brcmf_cfg80211_start_ap(struct wiphy *wi
|
||||
*/
|
||||
err = brcmf_fil_iovar_int_set(ifp, "chanspec", chanspec);
|
||||
if (err < 0) {
|
||||
@ -1435,7 +1435,7 @@ Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
|
||||
goto exit;
|
||||
}
|
||||
/* On DOWN the firmware removes the WEP keys, reconfigure
|
||||
@@ -4565,14 +4607,14 @@ brcmf_cfg80211_start_ap(struct wiphy *wi
|
||||
@@ -4567,14 +4609,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) {
|
||||
@ -1452,7 +1452,7 @@ Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
|
||||
goto exit;
|
||||
}
|
||||
}
|
||||
@@ -4581,14 +4623,14 @@ brcmf_cfg80211_start_ap(struct wiphy *wi
|
||||
@@ -4583,14 +4625,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) {
|
||||
@ -1470,7 +1470,7 @@ Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
|
||||
goto exit;
|
||||
}
|
||||
bss_enable.bsscfgidx = cpu_to_le32(ifp->bsscfgidx);
|
||||
@@ -4596,7 +4638,7 @@ brcmf_cfg80211_start_ap(struct wiphy *wi
|
||||
@@ -4598,7 +4640,7 @@ brcmf_cfg80211_start_ap(struct wiphy *wi
|
||||
err = brcmf_fil_iovar_data_set(ifp, "bss", &bss_enable,
|
||||
sizeof(bss_enable));
|
||||
if (err < 0) {
|
||||
@ -1479,7 +1479,7 @@ Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
|
||||
goto exit;
|
||||
}
|
||||
|
||||
@@ -4644,13 +4686,13 @@ static int brcmf_cfg80211_stop_ap(struct
|
||||
@@ -4646,13 +4688,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)
|
||||
@ -1496,7 +1496,7 @@ Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
|
||||
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
|
||||
@@ -4660,7 +4702,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)
|
||||
@ -1505,7 +1505,7 @@ Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
|
||||
|
||||
brcmf_vif_clear_mgmt_ies(ifp->vif);
|
||||
} else {
|
||||
@@ -4667,7 +4709,7 @@ static int brcmf_cfg80211_stop_ap(struct
|
||||
@@ -4669,7 +4711,7 @@ static int brcmf_cfg80211_stop_ap(struct
|
||||
err = brcmf_fil_iovar_data_set(ifp, "bss", &bss_enable,
|
||||
sizeof(bss_enable));
|
||||
if (err < 0)
|
||||
@ -1514,7 +1514,7 @@ Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
|
||||
}
|
||||
brcmf_set_mpc(ifp, 1);
|
||||
brcmf_configure_arp_nd_offload(ifp, true);
|
||||
@@ -4715,7 +4757,8 @@ brcmf_cfg80211_del_station(struct wiphy
|
||||
@@ -4717,7 +4759,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)
|
||||
@ -1524,7 +1524,7 @@ Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
|
||||
|
||||
brcmf_dbg(TRACE, "Exit\n");
|
||||
return err;
|
||||
@@ -4745,7 +4788,7 @@ brcmf_cfg80211_change_station(struct wip
|
||||
@@ -4747,7 +4790,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)
|
||||
@ -1533,7 +1533,7 @@ Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
|
||||
|
||||
return err;
|
||||
}
|
||||
@@ -4795,7 +4838,7 @@ brcmf_cfg80211_mgmt_tx(struct wiphy *wip
|
||||
@@ -4797,7 +4840,7 @@ brcmf_cfg80211_mgmt_tx(struct wiphy *wip
|
||||
mgmt = (const struct ieee80211_mgmt *)buf;
|
||||
|
||||
if (!ieee80211_is_mgmt(mgmt->frame_control)) {
|
||||
@ -1542,7 +1542,7 @@ Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
|
||||
return -EPERM;
|
||||
}
|
||||
|
||||
@@ -4826,13 +4869,13 @@ brcmf_cfg80211_mgmt_tx(struct wiphy *wip
|
||||
@@ -4828,13 +4871,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) {
|
||||
@ -1558,7 +1558,7 @@ Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
|
||||
err = -ENOMEM;
|
||||
goto exit;
|
||||
}
|
||||
@@ -4890,7 +4933,7 @@ brcmf_cfg80211_cancel_remain_on_channel(
|
||||
@@ -4892,7 +4935,7 @@ brcmf_cfg80211_cancel_remain_on_channel(
|
||||
|
||||
vif = cfg->p2p.bss_idx[P2PAPI_BSSCFG_DEVICE].vif;
|
||||
if (vif == NULL) {
|
||||
@ -1567,7 +1567,7 @@ Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
|
||||
err = -ENODEV;
|
||||
goto exit;
|
||||
}
|
||||
@@ -4918,7 +4961,7 @@ static int brcmf_cfg80211_get_channel(st
|
||||
@@ -4920,7 +4963,7 @@ static int brcmf_cfg80211_get_channel(st
|
||||
|
||||
err = brcmf_fil_iovar_int_get(ifp, "chanspec", &chanspec);
|
||||
if (err) {
|
||||
@ -1576,7 +1576,7 @@ Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
|
||||
return err;
|
||||
}
|
||||
|
||||
@@ -5057,7 +5100,7 @@ static int brcmf_cfg80211_tdls_oper(stru
|
||||
@@ -5059,7 +5102,7 @@ static int brcmf_cfg80211_tdls_oper(stru
|
||||
ret = brcmf_fil_iovar_data_set(ifp, "tdls_endpoint",
|
||||
&info, sizeof(info));
|
||||
if (ret < 0)
|
||||
@ -1585,7 +1585,7 @@ Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
|
||||
|
||||
return ret;
|
||||
}
|
||||
@@ -5078,7 +5121,7 @@ brcmf_cfg80211_update_conn_params(struct
|
||||
@@ -5080,7 +5123,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)
|
||||
@ -1594,7 +1594,7 @@ Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
|
||||
else
|
||||
brcmf_dbg(TRACE, "Applied Vndr IEs for Assoc request\n");
|
||||
|
||||
@@ -5104,7 +5147,7 @@ brcmf_cfg80211_set_rekey_data(struct wip
|
||||
@@ -5106,7 +5149,7 @@ brcmf_cfg80211_set_rekey_data(struct wip
|
||||
ret = brcmf_fil_iovar_data_set(ifp, "gtk_key_info", >k_le,
|
||||
sizeof(gtk_le));
|
||||
if (ret < 0)
|
||||
@ -1603,7 +1603,7 @@ Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
|
||||
|
||||
return ret;
|
||||
}
|
||||
@@ -5336,6 +5379,7 @@ static void brcmf_clear_assoc_ies(struct
|
||||
@@ -5338,6 +5381,7 @@ static void brcmf_clear_assoc_ies(struct
|
||||
static s32 brcmf_get_assoc_ies(struct brcmf_cfg80211_info *cfg,
|
||||
struct brcmf_if *ifp)
|
||||
{
|
||||
@ -1611,7 +1611,7 @@ Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
|
||||
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
|
||||
@@ -5349,7 +5393,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) {
|
||||
@ -1620,7 +1620,7 @@ Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
|
||||
return err;
|
||||
}
|
||||
assoc_info =
|
||||
@@ -5359,7 +5403,7 @@ static s32 brcmf_get_assoc_ies(struct br
|
||||
@@ -5361,7 +5405,7 @@ static s32 brcmf_get_assoc_ies(struct br
|
||||
cfg->extra_buf,
|
||||
WL_ASSOC_INFO_MAX);
|
||||
if (err) {
|
||||
@ -1629,7 +1629,7 @@ Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
|
||||
return err;
|
||||
}
|
||||
conn_info->req_ie_len = req_len;
|
||||
@@ -5375,7 +5419,7 @@ static s32 brcmf_get_assoc_ies(struct br
|
||||
@@ -5379,7 +5423,7 @@ static s32 brcmf_get_assoc_ies(struct br
|
||||
cfg->extra_buf,
|
||||
WL_ASSOC_INFO_MAX);
|
||||
if (err) {
|
||||
@ -1638,7 +1638,7 @@ Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
|
||||
return err;
|
||||
}
|
||||
conn_info->resp_ie_len = resp_len;
|
||||
@@ -5502,6 +5546,7 @@ brcmf_notify_connect_status_ap(struct br
|
||||
@@ -5508,6 +5552,7 @@ brcmf_notify_connect_status_ap(struct br
|
||||
struct net_device *ndev,
|
||||
const struct brcmf_event_msg *e, void *data)
|
||||
{
|
||||
@ -1646,7 +1646,7 @@ Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
|
||||
static int generation;
|
||||
u32 event = e->event_code;
|
||||
u32 reason = e->reason;
|
||||
@@ -5519,7 +5564,7 @@ brcmf_notify_connect_status_ap(struct br
|
||||
@@ -5525,7 +5570,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) {
|
||||
@ -1655,7 +1655,7 @@ Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
@@ -5811,6 +5856,7 @@ static void init_vif_event(struct brcmf_
|
||||
@@ -5817,6 +5862,7 @@ static void init_vif_event(struct brcmf_
|
||||
|
||||
static s32 brcmf_dongle_roam(struct brcmf_if *ifp)
|
||||
{
|
||||
@ -1663,7 +1663,7 @@ Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
|
||||
s32 err;
|
||||
u32 bcn_timeout;
|
||||
__le32 roamtrigger[2];
|
||||
@@ -5823,7 +5869,7 @@ static s32 brcmf_dongle_roam(struct brcm
|
||||
@@ -5829,7 +5875,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) {
|
||||
@ -1672,7 +1672,7 @@ Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
|
||||
goto roam_setup_done;
|
||||
}
|
||||
|
||||
@@ -5835,7 +5881,7 @@ static s32 brcmf_dongle_roam(struct brcm
|
||||
@@ -5841,7 +5887,7 @@ static s32 brcmf_dongle_roam(struct brcm
|
||||
err = brcmf_fil_iovar_int_set(ifp, "roam_off",
|
||||
ifp->drvr->settings->roamoff);
|
||||
if (err) {
|
||||
@ -1681,7 +1681,7 @@ Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
|
||||
goto roam_setup_done;
|
||||
}
|
||||
|
||||
@@ -5844,7 +5890,7 @@ static s32 brcmf_dongle_roam(struct brcm
|
||||
@@ -5850,7 +5896,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) {
|
||||
@ -1690,7 +1690,7 @@ Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
|
||||
goto roam_setup_done;
|
||||
}
|
||||
|
||||
@@ -5853,7 +5899,7 @@ static s32 brcmf_dongle_roam(struct brcm
|
||||
@@ -5859,7 +5905,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) {
|
||||
@ -1699,7 +1699,7 @@ Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
|
||||
goto roam_setup_done;
|
||||
}
|
||||
|
||||
@@ -5864,25 +5910,26 @@ roam_setup_done:
|
||||
@@ -5870,25 +5916,26 @@ roam_setup_done:
|
||||
static s32
|
||||
brcmf_dongle_scantime(struct brcmf_if *ifp)
|
||||
{
|
||||
@ -1729,7 +1729,7 @@ Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
|
||||
goto dongle_scantime_out;
|
||||
}
|
||||
|
||||
@@ -5914,10 +5961,10 @@ static void brcmf_update_bw40_channel_fl
|
||||
@@ -5920,10 +5967,10 @@ static void brcmf_update_bw40_channel_fl
|
||||
static int brcmf_construct_chaninfo(struct brcmf_cfg80211_info *cfg,
|
||||
u32 bw_cap[])
|
||||
{
|
||||
@ -1741,7 +1741,7 @@ Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
|
||||
struct brcmf_chanspec_list *list;
|
||||
struct brcmu_chan ch;
|
||||
int err;
|
||||
@@ -5936,11 +5983,10 @@ static int brcmf_construct_chaninfo(stru
|
||||
@@ -5942,11 +5989,10 @@ static int brcmf_construct_chaninfo(stru
|
||||
err = brcmf_fil_iovar_data_get(ifp, "chanspecs", pbuf,
|
||||
BRCMF_DCMD_MEDLEN);
|
||||
if (err) {
|
||||
@ -1754,7 +1754,7 @@ Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
|
||||
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
|
||||
@@ -5966,7 +6012,8 @@ static int brcmf_construct_chaninfo(stru
|
||||
} else if (ch.band == BRCMU_CHAN_BAND_5G) {
|
||||
band = wiphy->bands[NL80211_BAND_5GHZ];
|
||||
} else {
|
||||
@ -1764,7 +1764,7 @@ Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
|
||||
continue;
|
||||
}
|
||||
if (!band)
|
||||
@@ -5983,8 +6030,8 @@ static int brcmf_construct_chaninfo(stru
|
||||
@@ -5989,8 +6036,8 @@ static int brcmf_construct_chaninfo(stru
|
||||
/* It seems firmware supports some channel we never
|
||||
* considered. Something new in IEEE standard?
|
||||
*/
|
||||
@ -1775,7 +1775,7 @@ Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
|
||||
continue;
|
||||
}
|
||||
|
||||
@@ -6030,6 +6077,7 @@ fail_pbuf:
|
||||
@@ -6036,6 +6083,7 @@ fail_pbuf:
|
||||
|
||||
static int brcmf_enable_bw40_2g(struct brcmf_cfg80211_info *cfg)
|
||||
{
|
||||
@ -1783,7 +1783,7 @@ Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
|
||||
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
|
||||
@@ -6082,7 +6130,7 @@ static int brcmf_enable_bw40_2g(struct b
|
||||
err = brcmf_fil_iovar_data_get(ifp, "chanspecs", pbuf,
|
||||
BRCMF_DCMD_MEDLEN);
|
||||
if (err) {
|
||||
@ -1792,7 +1792,7 @@ Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
|
||||
kfree(pbuf);
|
||||
return err;
|
||||
}
|
||||
@@ -6107,6 +6155,7 @@ static int brcmf_enable_bw40_2g(struct b
|
||||
@@ -6113,6 +6161,7 @@ static int brcmf_enable_bw40_2g(struct b
|
||||
|
||||
static void brcmf_get_bwcap(struct brcmf_if *ifp, u32 bw_cap[])
|
||||
{
|
||||
@ -1800,7 +1800,7 @@ Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
|
||||
u32 band, mimo_bwcap;
|
||||
int err;
|
||||
|
||||
@@ -6142,7 +6191,7 @@ static void brcmf_get_bwcap(struct brcmf
|
||||
@@ -6148,7 +6197,7 @@ static void brcmf_get_bwcap(struct brcmf
|
||||
bw_cap[NL80211_BAND_5GHZ] |= WLC_BW_20MHZ_BIT;
|
||||
break;
|
||||
default:
|
||||
@ -1809,7 +1809,7 @@ Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
|
||||
}
|
||||
}
|
||||
|
||||
@@ -6218,7 +6267,7 @@ static void brcmf_update_vht_cap(struct
|
||||
@@ -6224,7 +6273,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);
|
||||
@ -1818,7 +1818,7 @@ Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
|
||||
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
|
||||
@@ -6240,7 +6289,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) {
|
||||
@ -1827,7 +1827,7 @@ Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
|
||||
} else {
|
||||
brcmf_get_bwcap(ifp, bw_cap);
|
||||
}
|
||||
@@ -6244,7 +6293,7 @@ static int brcmf_setup_wiphybands(struct
|
||||
@@ -6250,7 +6299,7 @@ static int brcmf_setup_wiphybands(struct
|
||||
|
||||
err = brcmf_fil_iovar_int_get(ifp, "rxchain", &rxchain);
|
||||
if (err) {
|
||||
@ -1836,7 +1836,7 @@ Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
|
||||
nchain = 1;
|
||||
} else {
|
||||
for (nchain = 0; rxchain; nchain++)
|
||||
@@ -6254,7 +6303,7 @@ static int brcmf_setup_wiphybands(struct
|
||||
@@ -6260,7 +6309,7 @@ static int brcmf_setup_wiphybands(struct
|
||||
|
||||
err = brcmf_construct_chaninfo(cfg, bw_cap);
|
||||
if (err) {
|
||||
@ -1845,7 +1845,7 @@ Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
|
||||
return err;
|
||||
}
|
||||
|
||||
@@ -6266,7 +6315,6 @@ static int brcmf_setup_wiphybands(struct
|
||||
@@ -6272,7 +6321,6 @@ static int brcmf_setup_wiphybands(struct
|
||||
&txbf_bfr_cap);
|
||||
}
|
||||
|
||||
@ -1853,7 +1853,7 @@ Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
|
||||
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
|
||||
@@ -6473,7 +6521,7 @@ static void brcmf_wiphy_wowl_params(stru
|
||||
wowl = kmemdup(&brcmf_wowlan_support, sizeof(brcmf_wowlan_support),
|
||||
GFP_KERNEL);
|
||||
if (!wowl) {
|
||||
@ -1862,7 +1862,7 @@ Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
|
||||
wiphy->wowlan = &brcmf_wowlan_support;
|
||||
return;
|
||||
}
|
||||
@@ -6564,7 +6612,7 @@ static int brcmf_setup_wiphy(struct wiph
|
||||
@@ -6570,7 +6618,7 @@ static int brcmf_setup_wiphy(struct wiph
|
||||
err = brcmf_fil_cmd_data_get(ifp, BRCMF_C_GET_BANDLIST, &bandlist,
|
||||
sizeof(bandlist));
|
||||
if (err) {
|
||||
@ -1871,7 +1871,7 @@ Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
|
||||
return err;
|
||||
}
|
||||
/* first entry in bandlist is number of bands */
|
||||
@@ -6613,6 +6661,7 @@ static int brcmf_setup_wiphy(struct wiph
|
||||
@@ -6619,6 +6667,7 @@ static int brcmf_setup_wiphy(struct wiph
|
||||
|
||||
static s32 brcmf_config_dongle(struct brcmf_cfg80211_info *cfg)
|
||||
{
|
||||
@ -1879,7 +1879,7 @@ Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
|
||||
struct net_device *ndev;
|
||||
struct wireless_dev *wdev;
|
||||
struct brcmf_if *ifp;
|
||||
@@ -6650,7 +6699,7 @@ static s32 brcmf_config_dongle(struct br
|
||||
@@ -6656,7 +6705,7 @@ static s32 brcmf_config_dongle(struct br
|
||||
|
||||
err = brcmf_fil_cmd_int_set(ifp, BRCMF_C_SET_FAKEFRAG, 1);
|
||||
if (err) {
|
||||
@ -1888,7 +1888,7 @@ Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
|
||||
goto default_conf_out;
|
||||
}
|
||||
|
||||
@@ -6842,8 +6891,8 @@ static void brcmf_cfg80211_reg_notifier(
|
||||
@@ -6848,8 +6897,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') {
|
||||
@ -1899,7 +1899,7 @@ Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -6852,7 +6901,7 @@ static void brcmf_cfg80211_reg_notifier(
|
||||
@@ -6858,7 +6907,7 @@ static void brcmf_cfg80211_reg_notifier(
|
||||
|
||||
err = brcmf_fil_iovar_data_get(ifp, "country", &ccreq, sizeof(ccreq));
|
||||
if (err) {
|
||||
@ -1908,7 +1908,7 @@ Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -6862,7 +6911,7 @@ static void brcmf_cfg80211_reg_notifier(
|
||||
@@ -6868,7 +6917,7 @@ static void brcmf_cfg80211_reg_notifier(
|
||||
|
||||
err = brcmf_fil_iovar_data_set(ifp, "country", &ccreq, sizeof(ccreq));
|
||||
if (err) {
|
||||
@ -1917,7 +1917,7 @@ Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
|
||||
return;
|
||||
}
|
||||
brcmf_setup_wiphybands(cfg);
|
||||
@@ -6908,13 +6957,13 @@ struct brcmf_cfg80211_info *brcmf_cfg802
|
||||
@@ -6914,13 +6963,13 @@ struct brcmf_cfg80211_info *brcmf_cfg802
|
||||
u16 *cap = NULL;
|
||||
|
||||
if (!ndev) {
|
||||
@ -1933,7 +1933,7 @@ Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
|
||||
return NULL;
|
||||
}
|
||||
|
||||
@@ -6935,7 +6984,7 @@ struct brcmf_cfg80211_info *brcmf_cfg802
|
||||
@@ -6941,7 +6990,7 @@ struct brcmf_cfg80211_info *brcmf_cfg802
|
||||
|
||||
err = wl_init_priv(cfg);
|
||||
if (err) {
|
||||
@ -1942,7 +1942,7 @@ Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
|
||||
brcmf_free_vif(vif);
|
||||
goto wiphy_out;
|
||||
}
|
||||
@@ -6944,7 +6993,7 @@ struct brcmf_cfg80211_info *brcmf_cfg802
|
||||
@@ -6950,7 +6999,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) {
|
||||
@ -1951,7 +1951,7 @@ Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
|
||||
goto priv_out;
|
||||
}
|
||||
cfg->d11inf.io_type = (u8)io_type;
|
||||
@@ -6978,13 +7027,13 @@ struct brcmf_cfg80211_info *brcmf_cfg802
|
||||
@@ -6984,13 +7033,13 @@ struct brcmf_cfg80211_info *brcmf_cfg802
|
||||
#endif
|
||||
err = wiphy_register(wiphy);
|
||||
if (err < 0) {
|
||||
@ -1967,7 +1967,7 @@ Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
|
||||
goto wiphy_unreg_out;
|
||||
}
|
||||
|
||||
@@ -7002,24 +7051,24 @@ struct brcmf_cfg80211_info *brcmf_cfg802
|
||||
@@ -7008,24 +7057,24 @@ struct brcmf_cfg80211_info *brcmf_cfg802
|
||||
|
||||
err = brcmf_fweh_activate_events(ifp);
|
||||
if (err) {
|
||||
@ -1996,7 +1996,7 @@ Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
|
||||
brcmf_btcoex_detach(cfg);
|
||||
brcmf_p2p_detach(&cfg->p2p);
|
||||
goto wiphy_unreg_out;
|
||||
@@ -7039,7 +7088,7 @@ struct brcmf_cfg80211_info *brcmf_cfg802
|
||||
@@ -7045,7 +7094,7 @@ struct brcmf_cfg80211_info *brcmf_cfg802
|
||||
/* (re-) activate FWEH event handling */
|
||||
err = brcmf_fweh_activate_events(ifp);
|
||||
if (err) {
|
||||
|
@ -1,28 +0,0 @@
|
||||
From 1b5e2423164b3670e8bc9174e4762d297990deff Mon Sep 17 00:00:00 2001
|
||||
From: Arend van Spriel <arend.vanspriel@broadcom.com>
|
||||
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 <hante.meuleman@broadcom.com>
|
||||
Reviewed-by: Pieter-Paul Giesberts <pieter-paul.giesberts@broadcom.com>
|
||||
Reviewed-by: Franky Lin <franky.lin@broadcom.com>
|
||||
Signed-off-by: Arend van Spriel <arend.vanspriel@broadcom.com>
|
||||
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
|
||||
---
|
||||
drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c | 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;
|
@ -1,96 +0,0 @@
|
||||
From a4176ec356c73a46c07c181c6d04039fafa34a9f Mon Sep 17 00:00:00 2001
|
||||
From: Arend van Spriel <arend.vanspriel@broadcom.com>
|
||||
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 <hante.meuleman@broadcom.com>
|
||||
Reviewed-by: Pieter-Paul Giesberts <pieter-paul.giesberts@broadcom.com>
|
||||
Reviewed-by: Franky Lin <franky.lin@broadcom.com>
|
||||
Signed-off-by: Arend van Spriel <arend.vanspriel@broadcom.com>
|
||||
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
|
||||
---
|
||||
.../wireless/broadcom/brcm80211/brcmfmac/core.c | 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);
|
@ -48,7 +48,7 @@ Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
|
||||
*/
|
||||
--- 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
|
||||
@@ -1181,6 +1181,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);
|
||||
@ -58,7 +58,7 @@ Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
|
||||
|
||||
--- 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
|
||||
@@ -3154,9 +3154,12 @@ static int brcmf_debugfs_sdio_count_read
|
||||
return 0;
|
||||
}
|
||||
|
||||
@ -73,7 +73,7 @@ Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
|
||||
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
|
||||
@@ -3176,7 +3179,7 @@ static int brcmf_sdio_checkdied(struct b
|
||||
return 0;
|
||||
}
|
||||
|
||||
@ -82,7 +82,7 @@ Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
|
||||
{
|
||||
}
|
||||
#endif /* DEBUG */
|
||||
@@ -3477,8 +3480,6 @@ static int brcmf_sdio_bus_preinit(struct
|
||||
@@ -3488,8 +3491,6 @@ static int brcmf_sdio_bus_preinit(struct
|
||||
if (bus->rxbuf)
|
||||
bus->rxblen = value;
|
||||
|
||||
@ -91,7 +91,7 @@ Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
|
||||
/* 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_
|
||||
@@ -4099,6 +4100,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,
|
||||
|
@ -18,7 +18,7 @@ Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
|
||||
|
||||
--- 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
|
||||
@@ -3010,21 +3010,35 @@ static int brcmf_sdio_trap_info(struct s
|
||||
if (error < 0)
|
||||
return error;
|
||||
|
||||
@ -69,7 +69,7 @@ Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -3067,8 +3081,10 @@ static int brcmf_sdio_checkdied(struct b
|
||||
@@ -3078,8 +3092,10 @@ static int brcmf_sdio_checkdied(struct b
|
||||
else if (sh.flags & SDPCM_SHARED_ASSERT)
|
||||
brcmf_err("assertion in dongle\n");
|
||||
|
||||
@ -81,7 +81,7 @@ Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
|
||||
|
||||
return 0;
|
||||
}
|
||||
@@ -4199,7 +4215,7 @@ static void brcmf_sdio_firmware_callback
|
||||
@@ -4210,7 +4226,7 @@ static void brcmf_sdio_firmware_callback
|
||||
} else {
|
||||
/* Disable F2 again */
|
||||
sdio_disable_func(sdiod->func2);
|
||||
@ -90,7 +90,7 @@ Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
|
||||
}
|
||||
|
||||
if (brcmf_chip_sr_capable(bus->ci)) {
|
||||
@@ -4220,8 +4236,10 @@ static void brcmf_sdio_firmware_callback
|
||||
@@ -4231,8 +4247,10 @@ static void brcmf_sdio_firmware_callback
|
||||
}
|
||||
|
||||
/* If we didn't come up, turn off backplane clock */
|
||||
@ -102,7 +102,7 @@ Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
|
||||
|
||||
sdio_release_host(sdiod->func1);
|
||||
|
||||
@@ -4235,12 +4253,15 @@ static void brcmf_sdio_firmware_callback
|
||||
@@ -4246,12 +4264,15 @@ static void brcmf_sdio_firmware_callback
|
||||
err = brcmf_attach(sdiod->dev, sdiod->settings);
|
||||
if (err != 0) {
|
||||
brcmf_err("brcmf_attach failed\n");
|
||||
|
@ -18,7 +18,7 @@ Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
|
||||
|
||||
--- 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
|
||||
@@ -6047,11 +6047,18 @@ static int brcmf_construct_chaninfo(stru
|
||||
/* assuming the chanspecs order is HT20,
|
||||
* HT40 upper, HT40 lower, and VHT80.
|
||||
*/
|
||||
|
@ -18,7 +18,7 @@ Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
|
||||
|
||||
--- 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
|
||||
@@ -6048,6 +6048,9 @@ static int brcmf_construct_chaninfo(stru
|
||||
* HT40 upper, HT40 lower, and VHT80.
|
||||
*/
|
||||
switch (ch.bw) {
|
||||
|
@ -1891,7 +1891,7 @@ Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
|
||||
return err;
|
||||
}
|
||||
conn_info->req_ie_len = req_len;
|
||||
@@ -5421,7 +5465,7 @@ static s32 brcmf_get_assoc_ies(struct br
|
||||
@@ -5423,7 +5467,7 @@ static s32 brcmf_get_assoc_ies(struct br
|
||||
cfg->extra_buf,
|
||||
WL_ASSOC_INFO_MAX);
|
||||
if (err) {
|
||||
@ -1900,7 +1900,7 @@ Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
|
||||
return err;
|
||||
}
|
||||
conn_info->resp_ie_len = resp_len;
|
||||
@@ -5548,7 +5592,7 @@ brcmf_notify_connect_status_ap(struct br
|
||||
@@ -5552,7 +5596,7 @@ brcmf_notify_connect_status_ap(struct br
|
||||
struct net_device *ndev,
|
||||
const struct brcmf_event_msg *e, void *data)
|
||||
{
|
||||
@ -1909,7 +1909,7 @@ Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
|
||||
static int generation;
|
||||
u32 event = e->event_code;
|
||||
u32 reason = e->reason;
|
||||
@@ -5566,7 +5610,7 @@ brcmf_notify_connect_status_ap(struct br
|
||||
@@ -5570,7 +5614,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) {
|
||||
@ -1918,7 +1918,7 @@ Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
@@ -5858,7 +5902,7 @@ static void init_vif_event(struct brcmf_
|
||||
@@ -5862,7 +5906,7 @@ static void init_vif_event(struct brcmf_
|
||||
|
||||
static s32 brcmf_dongle_roam(struct brcmf_if *ifp)
|
||||
{
|
||||
@ -1927,7 +1927,7 @@ Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
|
||||
s32 err;
|
||||
u32 bcn_timeout;
|
||||
__le32 roamtrigger[2];
|
||||
@@ -5871,7 +5915,7 @@ static s32 brcmf_dongle_roam(struct brcm
|
||||
@@ -5875,7 +5919,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) {
|
||||
@ -1936,7 +1936,7 @@ Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
|
||||
goto roam_setup_done;
|
||||
}
|
||||
|
||||
@@ -5883,7 +5927,7 @@ static s32 brcmf_dongle_roam(struct brcm
|
||||
@@ -5887,7 +5931,7 @@ static s32 brcmf_dongle_roam(struct brcm
|
||||
err = brcmf_fil_iovar_int_set(ifp, "roam_off",
|
||||
ifp->drvr->settings->roamoff);
|
||||
if (err) {
|
||||
@ -1945,7 +1945,7 @@ Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
|
||||
goto roam_setup_done;
|
||||
}
|
||||
|
||||
@@ -5892,7 +5936,7 @@ static s32 brcmf_dongle_roam(struct brcm
|
||||
@@ -5896,7 +5940,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) {
|
||||
@ -1954,7 +1954,7 @@ Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
|
||||
goto roam_setup_done;
|
||||
}
|
||||
|
||||
@@ -5901,7 +5945,7 @@ static s32 brcmf_dongle_roam(struct brcm
|
||||
@@ -5905,7 +5949,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) {
|
||||
@ -1963,7 +1963,7 @@ Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
|
||||
goto roam_setup_done;
|
||||
}
|
||||
|
||||
@@ -5912,26 +5956,26 @@ roam_setup_done:
|
||||
@@ -5916,26 +5960,26 @@ roam_setup_done:
|
||||
static s32
|
||||
brcmf_dongle_scantime(struct brcmf_if *ifp)
|
||||
{
|
||||
@ -1994,7 +1994,7 @@ Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
|
||||
goto dongle_scantime_out;
|
||||
}
|
||||
|
||||
@@ -5964,7 +6008,8 @@ static int brcmf_construct_chaninfo(stru
|
||||
@@ -5968,7 +6012,8 @@ static int brcmf_construct_chaninfo(stru
|
||||
u32 bw_cap[])
|
||||
{
|
||||
struct wiphy *wiphy = cfg_to_wiphy(cfg);
|
||||
@ -2004,7 +2004,7 @@ Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
|
||||
struct ieee80211_supported_band *band;
|
||||
struct ieee80211_channel *channel;
|
||||
struct brcmf_chanspec_list *list;
|
||||
@@ -5985,7 +6030,7 @@ static int brcmf_construct_chaninfo(stru
|
||||
@@ -5989,7 +6034,7 @@ static int brcmf_construct_chaninfo(stru
|
||||
err = brcmf_fil_iovar_data_get(ifp, "chanspecs", pbuf,
|
||||
BRCMF_DCMD_MEDLEN);
|
||||
if (err) {
|
||||
@ -2013,7 +2013,7 @@ Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
|
||||
goto fail_pbuf;
|
||||
}
|
||||
|
||||
@@ -6008,7 +6053,7 @@ static int brcmf_construct_chaninfo(stru
|
||||
@@ -6012,7 +6057,7 @@ static int brcmf_construct_chaninfo(stru
|
||||
} else if (ch.band == BRCMU_CHAN_BAND_5G) {
|
||||
band = wiphy->bands[NL80211_BAND_5GHZ];
|
||||
} else {
|
||||
@ -2022,7 +2022,7 @@ Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
|
||||
ch.chspec);
|
||||
continue;
|
||||
}
|
||||
@@ -6032,7 +6077,7 @@ static int brcmf_construct_chaninfo(stru
|
||||
@@ -6036,7 +6081,7 @@ static int brcmf_construct_chaninfo(stru
|
||||
/* It seems firmware supports some channel we never
|
||||
* considered. Something new in IEEE standard?
|
||||
*/
|
||||
@ -2031,7 +2031,7 @@ Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
|
||||
ch.control_ch_num);
|
||||
continue;
|
||||
}
|
||||
@@ -6089,8 +6134,8 @@ fail_pbuf:
|
||||
@@ -6093,8 +6138,8 @@ fail_pbuf:
|
||||
|
||||
static int brcmf_enable_bw40_2g(struct brcmf_cfg80211_info *cfg)
|
||||
{
|
||||
@ -2042,7 +2042,7 @@ Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
|
||||
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
|
||||
@@ -6140,7 +6185,7 @@ static int brcmf_enable_bw40_2g(struct b
|
||||
err = brcmf_fil_iovar_data_get(ifp, "chanspecs", pbuf,
|
||||
BRCMF_DCMD_MEDLEN);
|
||||
if (err) {
|
||||
@ -2051,7 +2051,7 @@ Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
|
||||
kfree(pbuf);
|
||||
return err;
|
||||
}
|
||||
@@ -6167,7 +6212,7 @@ static int brcmf_enable_bw40_2g(struct b
|
||||
@@ -6171,7 +6216,7 @@ static int brcmf_enable_bw40_2g(struct b
|
||||
|
||||
static void brcmf_get_bwcap(struct brcmf_if *ifp, u32 bw_cap[])
|
||||
{
|
||||
@ -2060,7 +2060,7 @@ Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
|
||||
u32 band, mimo_bwcap;
|
||||
int err;
|
||||
|
||||
@@ -6203,7 +6248,7 @@ static void brcmf_get_bwcap(struct brcmf
|
||||
@@ -6207,7 +6252,7 @@ static void brcmf_get_bwcap(struct brcmf
|
||||
bw_cap[NL80211_BAND_5GHZ] |= WLC_BW_20MHZ_BIT;
|
||||
break;
|
||||
default:
|
||||
@ -2069,7 +2069,7 @@ Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
|
||||
}
|
||||
}
|
||||
|
||||
@@ -6278,7 +6323,8 @@ static void brcmf_update_vht_cap(struct
|
||||
@@ -6282,7 +6327,8 @@ static void brcmf_update_vht_cap(struct
|
||||
|
||||
static int brcmf_setup_wiphybands(struct brcmf_cfg80211_info *cfg)
|
||||
{
|
||||
@ -2079,7 +2079,7 @@ Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
|
||||
struct wiphy *wiphy = cfg_to_wiphy(cfg);
|
||||
u32 nmode = 0;
|
||||
u32 vhtmode = 0;
|
||||
@@ -6295,7 +6341,7 @@ static int brcmf_setup_wiphybands(struct
|
||||
@@ -6299,7 +6345,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) {
|
||||
@ -2088,7 +2088,7 @@ Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
|
||||
} else {
|
||||
brcmf_get_bwcap(ifp, bw_cap);
|
||||
}
|
||||
@@ -6305,7 +6351,7 @@ static int brcmf_setup_wiphybands(struct
|
||||
@@ -6309,7 +6355,7 @@ static int brcmf_setup_wiphybands(struct
|
||||
|
||||
err = brcmf_fil_iovar_int_get(ifp, "rxchain", &rxchain);
|
||||
if (err) {
|
||||
@ -2097,7 +2097,7 @@ Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
|
||||
nchain = 1;
|
||||
} else {
|
||||
for (nchain = 0; rxchain; nchain++)
|
||||
@@ -6315,7 +6361,7 @@ static int brcmf_setup_wiphybands(struct
|
||||
@@ -6319,7 +6365,7 @@ static int brcmf_setup_wiphybands(struct
|
||||
|
||||
err = brcmf_construct_chaninfo(cfg, bw_cap);
|
||||
if (err) {
|
||||
@ -2106,7 +2106,7 @@ Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
|
||||
return err;
|
||||
}
|
||||
|
||||
@@ -6522,12 +6568,13 @@ static void brcmf_wiphy_wowl_params(stru
|
||||
@@ -6526,12 +6572,13 @@ static void brcmf_wiphy_wowl_params(stru
|
||||
{
|
||||
#ifdef CONFIG_PM
|
||||
struct brcmf_cfg80211_info *cfg = wiphy_to_cfg(wiphy);
|
||||
@ -2121,7 +2121,7 @@ Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
|
||||
wiphy->wowlan = &brcmf_wowlan_support;
|
||||
return;
|
||||
}
|
||||
@@ -6624,7 +6671,7 @@ static int brcmf_setup_wiphy(struct wiph
|
||||
@@ -6628,7 +6675,7 @@ static int brcmf_setup_wiphy(struct wiph
|
||||
err = brcmf_fil_cmd_data_get(ifp, BRCMF_C_GET_BANDLIST, &bandlist,
|
||||
sizeof(bandlist));
|
||||
if (err) {
|
||||
@ -2130,7 +2130,7 @@ Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
|
||||
return err;
|
||||
}
|
||||
/* first entry in bandlist is number of bands */
|
||||
@@ -6673,7 +6720,7 @@ static int brcmf_setup_wiphy(struct wiph
|
||||
@@ -6677,7 +6724,7 @@ static int brcmf_setup_wiphy(struct wiph
|
||||
|
||||
static s32 brcmf_config_dongle(struct brcmf_cfg80211_info *cfg)
|
||||
{
|
||||
@ -2139,7 +2139,7 @@ Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
|
||||
struct net_device *ndev;
|
||||
struct wireless_dev *wdev;
|
||||
struct brcmf_if *ifp;
|
||||
@@ -6711,7 +6758,7 @@ static s32 brcmf_config_dongle(struct br
|
||||
@@ -6715,7 +6762,7 @@ static s32 brcmf_config_dongle(struct br
|
||||
|
||||
err = brcmf_fil_cmd_int_set(ifp, BRCMF_C_SET_FAKEFRAG, 1);
|
||||
if (err) {
|
||||
@ -2148,7 +2148,7 @@ Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
|
||||
goto default_conf_out;
|
||||
}
|
||||
|
||||
@@ -6892,6 +6939,7 @@ static void brcmf_cfg80211_reg_notifier(
|
||||
@@ -6896,6 +6943,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);
|
||||
@ -2156,7 +2156,7 @@ Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
|
||||
struct brcmf_fil_country_le ccreq;
|
||||
s32 err;
|
||||
int i;
|
||||
@@ -6903,7 +6951,7 @@ static void brcmf_cfg80211_reg_notifier(
|
||||
@@ -6907,7 +6955,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') {
|
||||
@ -2165,7 +2165,7 @@ Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
|
||||
req->alpha2[0], req->alpha2[1]);
|
||||
return;
|
||||
}
|
||||
@@ -6913,7 +6961,7 @@ static void brcmf_cfg80211_reg_notifier(
|
||||
@@ -6917,7 +6965,7 @@ static void brcmf_cfg80211_reg_notifier(
|
||||
|
||||
err = brcmf_fil_iovar_data_get(ifp, "country", &ccreq, sizeof(ccreq));
|
||||
if (err) {
|
||||
@ -2174,7 +2174,7 @@ Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -6923,7 +6971,7 @@ static void brcmf_cfg80211_reg_notifier(
|
||||
@@ -6927,7 +6975,7 @@ static void brcmf_cfg80211_reg_notifier(
|
||||
|
||||
err = brcmf_fil_iovar_data_set(ifp, "country", &ccreq, sizeof(ccreq));
|
||||
if (err) {
|
||||
@ -2183,7 +2183,7 @@ Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
|
||||
return;
|
||||
}
|
||||
brcmf_setup_wiphybands(cfg);
|
||||
@@ -6969,13 +7017,13 @@ struct brcmf_cfg80211_info *brcmf_cfg802
|
||||
@@ -6973,13 +7021,13 @@ struct brcmf_cfg80211_info *brcmf_cfg802
|
||||
u16 *cap = NULL;
|
||||
|
||||
if (!ndev) {
|
||||
@ -2199,7 +2199,7 @@ Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
|
||||
return NULL;
|
||||
}
|
||||
|
||||
@@ -6996,7 +7044,7 @@ struct brcmf_cfg80211_info *brcmf_cfg802
|
||||
@@ -7000,7 +7048,7 @@ struct brcmf_cfg80211_info *brcmf_cfg802
|
||||
|
||||
err = wl_init_priv(cfg);
|
||||
if (err) {
|
||||
@ -2208,7 +2208,7 @@ Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
|
||||
brcmf_free_vif(vif);
|
||||
goto wiphy_out;
|
||||
}
|
||||
@@ -7005,7 +7053,7 @@ struct brcmf_cfg80211_info *brcmf_cfg802
|
||||
@@ -7009,7 +7057,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) {
|
||||
@ -2217,7 +2217,7 @@ Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
|
||||
goto priv_out;
|
||||
}
|
||||
cfg->d11inf.io_type = (u8)io_type;
|
||||
@@ -7039,13 +7087,13 @@ struct brcmf_cfg80211_info *brcmf_cfg802
|
||||
@@ -7043,13 +7091,13 @@ struct brcmf_cfg80211_info *brcmf_cfg802
|
||||
#endif
|
||||
err = wiphy_register(wiphy);
|
||||
if (err < 0) {
|
||||
@ -2233,7 +2233,7 @@ Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
|
||||
goto wiphy_unreg_out;
|
||||
}
|
||||
|
||||
@@ -7063,24 +7111,24 @@ struct brcmf_cfg80211_info *brcmf_cfg802
|
||||
@@ -7067,24 +7115,24 @@ struct brcmf_cfg80211_info *brcmf_cfg802
|
||||
|
||||
err = brcmf_fweh_activate_events(ifp);
|
||||
if (err) {
|
||||
@ -2262,7 +2262,7 @@ Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
|
||||
brcmf_btcoex_detach(cfg);
|
||||
brcmf_p2p_detach(&cfg->p2p);
|
||||
goto wiphy_unreg_out;
|
||||
@@ -7100,7 +7148,7 @@ struct brcmf_cfg80211_info *brcmf_cfg802
|
||||
@@ -7104,7 +7152,7 @@ struct brcmf_cfg80211_info *brcmf_cfg802
|
||||
/* (re-) activate FWEH event handling */
|
||||
err = brcmf_fweh_activate_events(ifp);
|
||||
if (err) {
|
||||
|
@ -408,15 +408,15 @@ Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
|
||||
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
|
||||
@@ -918,16 +920,17 @@ static int brcmf_psm_watchdog_notify(str
|
||||
const struct brcmf_event_msg *evtmsg,
|
||||
void *data)
|
||||
{
|
||||
@ -436,7 +436,7 @@ Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
|
||||
|
||||
return err;
|
||||
}
|
||||
@@ -967,7 +970,7 @@ static int brcmf_inetaddr_changed(struct
|
||||
@@ -971,7 +974,7 @@ static int brcmf_inetaddr_changed(struct
|
||||
ret = brcmf_fil_iovar_data_get(ifp, "arp_hostip", addr_table,
|
||||
sizeof(addr_table));
|
||||
if (ret) {
|
||||
@ -445,7 +445,7 @@ Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
|
||||
return NOTIFY_OK;
|
||||
}
|
||||
|
||||
@@ -984,7 +987,7 @@ static int brcmf_inetaddr_changed(struct
|
||||
@@ -988,7 +991,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)
|
||||
@ -454,7 +454,7 @@ Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
|
||||
}
|
||||
break;
|
||||
case NETDEV_DOWN:
|
||||
@@ -996,8 +999,8 @@ static int brcmf_inetaddr_changed(struct
|
||||
@@ -1000,8 +1003,8 @@ static int brcmf_inetaddr_changed(struct
|
||||
ret = brcmf_fil_iovar_data_set(ifp, "arp_hostip_clear",
|
||||
NULL, 0);
|
||||
if (ret) {
|
||||
@ -465,7 +465,7 @@ Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
|
||||
return NOTIFY_OK;
|
||||
}
|
||||
for (i = 0; i < ARPOL_MAX_ENTRIES; i++) {
|
||||
@@ -1007,8 +1010,8 @@ static int brcmf_inetaddr_changed(struct
|
||||
@@ -1011,8 +1014,8 @@ static int brcmf_inetaddr_changed(struct
|
||||
&addr_table[i],
|
||||
sizeof(addr_table[i]));
|
||||
if (ret)
|
||||
@ -476,7 +476,7 @@ Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
|
||||
}
|
||||
}
|
||||
break;
|
||||
@@ -1182,7 +1185,7 @@ static int brcmf_bus_started(struct brcm
|
||||
@@ -1186,7 +1189,7 @@ static int brcmf_bus_started(struct brcm
|
||||
return 0;
|
||||
|
||||
fail:
|
||||
@ -485,7 +485,7 @@ Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
|
||||
if (drvr->config) {
|
||||
brcmf_cfg80211_detach(drvr->config);
|
||||
drvr->config = NULL;
|
||||
@@ -1234,7 +1237,7 @@ int brcmf_attach(struct device *dev, str
|
||||
@@ -1238,7 +1241,7 @@ int brcmf_attach(struct device *dev, str
|
||||
/* Attach and link in the protocol */
|
||||
ret = brcmf_proto_attach(drvr);
|
||||
if (ret != 0) {
|
||||
@ -494,7 +494,7 @@ Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
|
||||
goto fail;
|
||||
}
|
||||
|
||||
@@ -1247,7 +1250,7 @@ int brcmf_attach(struct device *dev, str
|
||||
@@ -1251,7 +1254,7 @@ int brcmf_attach(struct device *dev, str
|
||||
|
||||
ret = brcmf_bus_started(drvr, ops);
|
||||
if (ret != 0) {
|
||||
@ -503,7 +503,7 @@ Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
|
||||
goto fail;
|
||||
}
|
||||
|
||||
@@ -1347,6 +1350,7 @@ static int brcmf_get_pend_8021x_cnt(stru
|
||||
@@ -1353,6 +1356,7 @@ static int brcmf_get_pend_8021x_cnt(stru
|
||||
|
||||
int brcmf_netdev_wait_pend8021x(struct brcmf_if *ifp)
|
||||
{
|
||||
@ -511,7 +511,7 @@ Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
|
||||
int err;
|
||||
|
||||
err = wait_event_timeout(ifp->pend_8021x_wait,
|
||||
@@ -1354,7 +1358,7 @@ int brcmf_netdev_wait_pend8021x(struct b
|
||||
@@ -1360,7 +1364,7 @@ int brcmf_netdev_wait_pend8021x(struct b
|
||||
MAX_WAIT_FOR_8021X_TX);
|
||||
|
||||
if (!err)
|
||||
@ -690,7 +690,7 @@ Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
|
||||
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
|
||||
@@ -1259,6 +1259,7 @@ static int brcmf_fws_enq(struct brcmf_fw
|
||||
enum brcmf_fws_skb_state state, int fifo,
|
||||
struct sk_buff *p)
|
||||
{
|
||||
@ -698,7 +698,7 @@ Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
|
||||
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
|
||||
@@ -1271,7 +1272,7 @@ static int brcmf_fws_enq(struct brcmf_fw
|
||||
|
||||
entry = brcmf_skbcb(p)->mac;
|
||||
if (entry == NULL) {
|
||||
@ -707,7 +707,7 @@ Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
|
||||
return -ENOENT;
|
||||
}
|
||||
|
||||
@@ -1457,6 +1458,7 @@ static int
|
||||
@@ -1461,6 +1462,7 @@ static int
|
||||
brcmf_fws_txs_process(struct brcmf_fws_info *fws, u8 flags, u32 hslot,
|
||||
u32 genbit, u16 seq, u8 compcnt)
|
||||
{
|
||||
@ -715,7 +715,7 @@ Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
|
||||
u32 fifo;
|
||||
u8 cnt = 0;
|
||||
int ret;
|
||||
@@ -1481,14 +1483,14 @@ brcmf_fws_txs_process(struct brcmf_fws_i
|
||||
@@ -1485,14 +1487,14 @@ brcmf_fws_txs_process(struct brcmf_fws_i
|
||||
else if (flags == BRCMF_FWS_TXSTATUS_HOST_TOSSED)
|
||||
fws->stats.txs_host_tossed += compcnt;
|
||||
else
|
||||
@ -733,7 +733,7 @@ Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
|
||||
goto cont;
|
||||
}
|
||||
|
||||
@@ -1612,12 +1614,13 @@ static int brcmf_fws_notify_credit_map(s
|
||||
@@ -1616,12 +1618,13 @@ static int brcmf_fws_notify_credit_map(s
|
||||
const struct brcmf_event_msg *e,
|
||||
void *data)
|
||||
{
|
||||
@ -749,7 +749,7 @@ Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
@@ -1681,6 +1684,7 @@ static void brcmf_rxreorder_get_skb_list
|
||||
@@ -1685,6 +1688,7 @@ static void brcmf_rxreorder_get_skb_list
|
||||
|
||||
void brcmf_fws_rxreorder(struct brcmf_if *ifp, struct sk_buff *pkt)
|
||||
{
|
||||
@ -757,7 +757,7 @@ Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
|
||||
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
|
||||
@@ -1699,7 +1703,7 @@ void brcmf_fws_rxreorder(struct brcmf_if
|
||||
|
||||
/* validate flags and flow id */
|
||||
if (flags == 0xFF) {
|
||||
@ -766,7 +766,7 @@ Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
|
||||
brcmf_netif_rx(ifp, pkt);
|
||||
return;
|
||||
}
|
||||
@@ -1732,7 +1736,7 @@ void brcmf_fws_rxreorder(struct brcmf_if
|
||||
@@ -1736,7 +1740,7 @@ void brcmf_fws_rxreorder(struct brcmf_if
|
||||
flow_id, max_idx);
|
||||
rfi = kzalloc(buf_size, GFP_ATOMIC);
|
||||
if (rfi == NULL) {
|
||||
@ -775,7 +775,7 @@ Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
|
||||
brcmf_netif_rx(ifp, pkt);
|
||||
return;
|
||||
}
|
||||
@@ -1996,6 +2000,7 @@ static u8 brcmf_fws_precommit_skb(struct
|
||||
@@ -2000,6 +2004,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)
|
||||
{
|
||||
@ -783,7 +783,7 @@ Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
|
||||
struct brcmf_fws_mac_descriptor *entry;
|
||||
struct sk_buff *pktout;
|
||||
int qidx, hslot;
|
||||
@@ -2009,11 +2014,11 @@ static void brcmf_fws_rollback_toq(struc
|
||||
@@ -2013,11 +2018,11 @@ static void brcmf_fws_rollback_toq(struc
|
||||
|
||||
pktout = brcmu_pktq_penq_head(&entry->psq, qidx, skb);
|
||||
if (pktout == NULL) {
|
||||
@ -797,7 +797,7 @@ Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
|
||||
rc = -ENOENT;
|
||||
}
|
||||
|
||||
@@ -2118,7 +2123,8 @@ static int brcmf_fws_assign_htod(struct
|
||||
@@ -2122,7 +2127,8 @@ static int brcmf_fws_assign_htod(struct
|
||||
|
||||
int brcmf_fws_process_skb(struct brcmf_if *ifp, struct sk_buff *skb)
|
||||
{
|
||||
@ -807,7 +807,7 @@ Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
|
||||
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
|
||||
@@ -2150,7 +2156,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 {
|
||||
@ -816,7 +816,7 @@ Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
|
||||
brcmf_txfinalize(ifp, skb, false);
|
||||
rc = -ENOMEM;
|
||||
}
|
||||
@@ -2365,7 +2371,7 @@ struct brcmf_fws_info *brcmf_fws_attach(
|
||||
@@ -2371,7 +2377,7 @@ struct brcmf_fws_info *brcmf_fws_attach(
|
||||
|
||||
fws->fws_wq = create_singlethread_workqueue("brcmf_fws_wq");
|
||||
if (fws->fws_wq == NULL) {
|
||||
@ -825,7 +825,7 @@ Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
|
||||
rc = -EBADF;
|
||||
goto fail;
|
||||
}
|
||||
@@ -2381,13 +2387,13 @@ struct brcmf_fws_info *brcmf_fws_attach(
|
||||
@@ -2387,13 +2393,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) {
|
||||
@ -841,7 +841,7 @@ Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
|
||||
brcmf_fweh_unregister(drvr, BRCMF_E_FIFO_CREDIT_MAP);
|
||||
goto fail;
|
||||
}
|
||||
@@ -2399,7 +2405,7 @@ struct brcmf_fws_info *brcmf_fws_attach(
|
||||
@@ -2405,7 +2411,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)) {
|
||||
|
@ -36,7 +36,7 @@ Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
|
||||
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
|
||||
@@ -1298,6 +1298,16 @@ void brcmf_dev_coredump(struct device *d
|
||||
brcmf_dbg(TRACE, "failed to create coredump\n");
|
||||
}
|
||||
|
||||
@ -66,7 +66,7 @@ Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
|
||||
|
||||
--- 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
|
||||
@@ -1101,8 +1101,8 @@ static u32 brcmf_sdio_hostmail(struct br
|
||||
|
||||
/* dongle indicates the firmware has halted/crashed */
|
||||
if (hmb_data & HMB_DATA_FWHALT) {
|
||||
|
@ -49,7 +49,7 @@ Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
|
||||
*/
|
||||
--- 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
|
||||
@@ -1109,6 +1109,14 @@ static int brcmf_revinfo_read(struct seq
|
||||
return 0;
|
||||
}
|
||||
|
||||
@ -64,7 +64,7 @@ Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
|
||||
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
|
||||
@@ -1180,6 +1188,8 @@ static int brcmf_bus_started(struct brcm
|
||||
#endif
|
||||
#endif /* CONFIG_INET */
|
||||
|
||||
@ -73,7 +73,7 @@ Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
|
||||
/* 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
|
||||
@@ -1306,6 +1316,8 @@ void brcmf_fw_crashed(struct device *dev
|
||||
bphy_err(drvr, "Firmware has halted or crashed\n");
|
||||
|
||||
brcmf_dev_coredump(dev);
|
||||
|
@ -1,124 +0,0 @@
|
||||
From c80d26e81ef1802f30364b4ad1955c1443a592b9 Mon Sep 17 00:00:00 2001
|
||||
From: Piotr Figiel <p.figiel@camlintechnologies.com>
|
||||
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 <p.figiel@camlintechnologies.com>
|
||||
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
|
||||
---
|
||||
.../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);
|
@ -1,217 +0,0 @@
|
||||
From 5cdb0ef6144f47440850553579aa923c20a63f23 Mon Sep 17 00:00:00 2001
|
||||
From: Piotr Figiel <p.figiel@camlintechnologies.com>
|
||||
Date: Mon, 4 Mar 2019 15:42:52 +0000
|
||||
Subject: [PATCH] brcmfmac: fix NULL pointer derefence during USB disconnect
|
||||
|
||||
In case USB disconnect happens at the moment transmitting workqueue is in
|
||||
progress the underlying interface may be gone causing a NULL pointer
|
||||
dereference. Add synchronization of the workqueue destruction with the
|
||||
detach implementation in core so that the transmitting workqueue is stopped
|
||||
during detach before the interfaces are removed.
|
||||
|
||||
Fix following Oops:
|
||||
|
||||
Unable to handle kernel NULL pointer dereference at virtual address 00000008
|
||||
pgd = 9e6a802d
|
||||
[00000008] *pgd=00000000
|
||||
Internal error: Oops: 5 [#1] PREEMPT SMP ARM
|
||||
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
|
||||
usb_serial_simple usbserial cdc_acm brcmfmac brcmutil smsc95xx usbnet
|
||||
ci_hdrc_imx ci_hdrc ulpi usbmisc_imx 8250_exar 8250_pci 8250 8250_base
|
||||
libcomposite configfs udc_core
|
||||
CPU: 0 PID: 7 Comm: kworker/u8:0 Not tainted 4.19.23-00076-g03740aa-dirty #102
|
||||
Hardware name: Freescale i.MX6 Quad/DualLite (Device Tree)
|
||||
Workqueue: brcmf_fws_wq brcmf_fws_dequeue_worker [brcmfmac]
|
||||
PC is at brcmf_txfinalize+0x34/0x90 [brcmfmac]
|
||||
LR is at brcmf_fws_dequeue_worker+0x218/0x33c [brcmfmac]
|
||||
pc : [<7f0dee64>] lr : [<7f0e4140>] psr: 60010093
|
||||
sp : ee8abef0 ip : 00000000 fp : edf38000
|
||||
r10: ffffffed r9 : edf38970 r8 : edf38004
|
||||
r7 : edf3e970 r6 : 00000000 r5 : ede69000 r4 : 00000000
|
||||
r3 : 00000a97 r2 : 00000000 r1 : 0000888e r0 : ede69000
|
||||
Flags: nZCv IRQs off FIQs on Mode SVC_32 ISA ARM Segment none
|
||||
Control: 10c5387d Table: 7d03c04a DAC: 00000051
|
||||
Process kworker/u8:0 (pid: 7, stack limit = 0x24ec3e04)
|
||||
Stack: (0xee8abef0 to 0xee8ac000)
|
||||
bee0: ede69000 00000000 ed56c3e0 7f0e4140
|
||||
bf00: 00000001 00000000 edf38004 edf3e99c ed56c3e0 80d03d00 edfea43a edf3e970
|
||||
bf20: ee809880 ee804200 ee971100 00000000 edf3e974 00000000 ee804200 80135a70
|
||||
bf40: 80d03d00 ee804218 ee809880 ee809894 ee804200 80d03d00 ee804218 ee8aa000
|
||||
bf60: 00000088 80135d5c 00000000 ee829f00 ee829dc0 00000000 ee809880 80135d30
|
||||
bf80: ee829f1c ee873eac 00000000 8013b1a0 ee829dc0 8013b07c 00000000 00000000
|
||||
bfa0: 00000000 00000000 00000000 801010e8 00000000 00000000 00000000 00000000
|
||||
bfc0: 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
|
||||
bfe0: 00000000 00000000 00000000 00000000 00000013 00000000 00000000 00000000
|
||||
[<7f0dee64>] (brcmf_txfinalize [brcmfmac]) from [<7f0e4140>] (brcmf_fws_dequeue_worker+0x218/0x33c [brcmfmac])
|
||||
[<7f0e4140>] (brcmf_fws_dequeue_worker [brcmfmac]) 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(0xee8abfb0 to 0xee8abff8)
|
||||
bfa0: 00000000 00000000 00000000 00000000
|
||||
bfc0: 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
|
||||
bfe0: 00000000 00000000 00000000 00000000 00000013 00000000
|
||||
Code: e1530001 0a000007 e3560000 e1a00005 (05942008)
|
||||
---[ end trace 079239dd31c86e90 ]---
|
||||
|
||||
Signed-off-by: Piotr Figiel <p.figiel@camlintechnologies.com>
|
||||
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
|
||||
---
|
||||
.../wireless/broadcom/brcm80211/brcmfmac/bcdc.c | 11 +++++++++--
|
||||
.../wireless/broadcom/brcm80211/brcmfmac/bcdc.h | 6 ++++--
|
||||
.../wireless/broadcom/brcm80211/brcmfmac/core.c | 4 +++-
|
||||
.../broadcom/brcm80211/brcmfmac/fwsignal.c | 16 ++++++++++++----
|
||||
.../broadcom/brcm80211/brcmfmac/fwsignal.h | 3 ++-
|
||||
.../wireless/broadcom/brcm80211/brcmfmac/proto.c | 10 ++++++++--
|
||||
.../wireless/broadcom/brcm80211/brcmfmac/proto.h | 3 ++-
|
||||
7 files changed, 40 insertions(+), 13 deletions(-)
|
||||
|
||||
--- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/bcdc.c
|
||||
+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/bcdc.c
|
||||
@@ -490,11 +490,18 @@ fail:
|
||||
return -ENOMEM;
|
||||
}
|
||||
|
||||
-void brcmf_proto_bcdc_detach(struct brcmf_pub *drvr)
|
||||
+void brcmf_proto_bcdc_detach_pre_delif(struct brcmf_pub *drvr)
|
||||
+{
|
||||
+ struct brcmf_bcdc *bcdc = drvr->proto->pd;
|
||||
+
|
||||
+ brcmf_fws_detach_pre_delif(bcdc->fws);
|
||||
+}
|
||||
+
|
||||
+void brcmf_proto_bcdc_detach_post_delif(struct brcmf_pub *drvr)
|
||||
{
|
||||
struct brcmf_bcdc *bcdc = drvr->proto->pd;
|
||||
|
||||
drvr->proto->pd = NULL;
|
||||
- brcmf_fws_detach(bcdc->fws);
|
||||
+ brcmf_fws_detach_post_delif(bcdc->fws);
|
||||
kfree(bcdc);
|
||||
}
|
||||
--- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/bcdc.h
|
||||
+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/bcdc.h
|
||||
@@ -18,14 +18,16 @@
|
||||
|
||||
#ifdef CPTCFG_BRCMFMAC_PROTO_BCDC
|
||||
int brcmf_proto_bcdc_attach(struct brcmf_pub *drvr);
|
||||
-void brcmf_proto_bcdc_detach(struct brcmf_pub *drvr);
|
||||
+void brcmf_proto_bcdc_detach_pre_delif(struct brcmf_pub *drvr);
|
||||
+void brcmf_proto_bcdc_detach_post_delif(struct brcmf_pub *drvr);
|
||||
void brcmf_proto_bcdc_txflowblock(struct device *dev, bool state);
|
||||
void brcmf_proto_bcdc_txcomplete(struct device *dev, struct sk_buff *txp,
|
||||
bool success);
|
||||
struct brcmf_fws_info *drvr_to_fws(struct brcmf_pub *drvr);
|
||||
#else
|
||||
static inline int brcmf_proto_bcdc_attach(struct brcmf_pub *drvr) { return 0; }
|
||||
-static inline void brcmf_proto_bcdc_detach(struct brcmf_pub *drvr) {}
|
||||
+static void brcmf_proto_bcdc_detach_pre_delif(struct brcmf_pub *drvr) {};
|
||||
+static inline void brcmf_proto_bcdc_detach_post_delif(struct brcmf_pub *drvr) {}
|
||||
#endif
|
||||
|
||||
#endif /* BRCMFMAC_BCDC_H */
|
||||
--- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/core.c
|
||||
+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/core.c
|
||||
@@ -1342,6 +1342,8 @@ void brcmf_detach(struct device *dev)
|
||||
|
||||
brcmf_bus_change_state(bus_if, BRCMF_BUS_DOWN);
|
||||
|
||||
+ brcmf_proto_detach_pre_delif(drvr);
|
||||
+
|
||||
/* make sure primary interface removed last */
|
||||
for (i = BRCMF_MAX_IFS-1; i > -1; i--)
|
||||
brcmf_remove_interface(drvr->iflist[i], false);
|
||||
@@ -1351,7 +1353,7 @@ void brcmf_detach(struct device *dev)
|
||||
|
||||
brcmf_bus_stop(drvr->bus_if);
|
||||
|
||||
- brcmf_proto_detach(drvr);
|
||||
+ brcmf_proto_detach_post_delif(drvr);
|
||||
|
||||
bus_if->drvr = NULL;
|
||||
wiphy_free(drvr->wiphy);
|
||||
--- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/fwsignal.c
|
||||
+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/fwsignal.c
|
||||
@@ -2443,17 +2443,25 @@ struct brcmf_fws_info *brcmf_fws_attach(
|
||||
return fws;
|
||||
|
||||
fail:
|
||||
- brcmf_fws_detach(fws);
|
||||
+ brcmf_fws_detach_pre_delif(fws);
|
||||
+ brcmf_fws_detach_post_delif(fws);
|
||||
return ERR_PTR(rc);
|
||||
}
|
||||
|
||||
-void brcmf_fws_detach(struct brcmf_fws_info *fws)
|
||||
+void brcmf_fws_detach_pre_delif(struct brcmf_fws_info *fws)
|
||||
{
|
||||
if (!fws)
|
||||
return;
|
||||
-
|
||||
- if (fws->fws_wq)
|
||||
+ if (fws->fws_wq) {
|
||||
destroy_workqueue(fws->fws_wq);
|
||||
+ fws->fws_wq = NULL;
|
||||
+ }
|
||||
+}
|
||||
+
|
||||
+void brcmf_fws_detach_post_delif(struct brcmf_fws_info *fws)
|
||||
+{
|
||||
+ if (!fws)
|
||||
+ return;
|
||||
|
||||
/* cleanup */
|
||||
brcmf_fws_lock(fws);
|
||||
--- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/fwsignal.h
|
||||
+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/fwsignal.h
|
||||
@@ -19,7 +19,8 @@
|
||||
#define FWSIGNAL_H_
|
||||
|
||||
struct brcmf_fws_info *brcmf_fws_attach(struct brcmf_pub *drvr);
|
||||
-void brcmf_fws_detach(struct brcmf_fws_info *fws);
|
||||
+void brcmf_fws_detach_pre_delif(struct brcmf_fws_info *fws);
|
||||
+void brcmf_fws_detach_post_delif(struct brcmf_fws_info *fws);
|
||||
void brcmf_fws_debugfs_create(struct brcmf_pub *drvr);
|
||||
bool brcmf_fws_queue_skbs(struct brcmf_fws_info *fws);
|
||||
bool brcmf_fws_fc_active(struct brcmf_fws_info *fws);
|
||||
--- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/proto.c
|
||||
+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/proto.c
|
||||
@@ -67,16 +67,22 @@ fail:
|
||||
return -ENOMEM;
|
||||
}
|
||||
|
||||
-void brcmf_proto_detach(struct brcmf_pub *drvr)
|
||||
+void brcmf_proto_detach_post_delif(struct brcmf_pub *drvr)
|
||||
{
|
||||
brcmf_dbg(TRACE, "Enter\n");
|
||||
|
||||
if (drvr->proto) {
|
||||
if (drvr->bus_if->proto_type == BRCMF_PROTO_BCDC)
|
||||
- brcmf_proto_bcdc_detach(drvr);
|
||||
+ brcmf_proto_bcdc_detach_post_delif(drvr);
|
||||
else if (drvr->bus_if->proto_type == BRCMF_PROTO_MSGBUF)
|
||||
brcmf_proto_msgbuf_detach(drvr);
|
||||
kfree(drvr->proto);
|
||||
drvr->proto = NULL;
|
||||
}
|
||||
}
|
||||
+
|
||||
+void brcmf_proto_detach_pre_delif(struct brcmf_pub *drvr)
|
||||
+{
|
||||
+ if (drvr->proto && drvr->bus_if->proto_type == BRCMF_PROTO_BCDC)
|
||||
+ brcmf_proto_bcdc_detach_pre_delif(drvr);
|
||||
+}
|
||||
--- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/proto.h
|
||||
+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/proto.h
|
||||
@@ -54,7 +54,8 @@ struct brcmf_proto {
|
||||
|
||||
|
||||
int brcmf_proto_attach(struct brcmf_pub *drvr);
|
||||
-void brcmf_proto_detach(struct brcmf_pub *drvr);
|
||||
+void brcmf_proto_detach_pre_delif(struct brcmf_pub *drvr);
|
||||
+void brcmf_proto_detach_post_delif(struct brcmf_pub *drvr);
|
||||
|
||||
static inline int brcmf_proto_hdrpull(struct brcmf_pub *drvr, bool do_fws,
|
||||
struct sk_buff *skb,
|
@ -1,84 +0,0 @@
|
||||
From db3b9e2e1d58080d0754bdf9293dabf8c6491b67 Mon Sep 17 00:00:00 2001
|
||||
From: Piotr Figiel <p.figiel@camlintechnologies.com>
|
||||
Date: Fri, 8 Mar 2019 15:25:04 +0000
|
||||
Subject: [PATCH] brcmfmac: fix race during disconnect when USB completion is
|
||||
in progress
|
||||
|
||||
It was observed that rarely during USB disconnect happening shortly after
|
||||
connect (before full initialization completes) usb_hub_wq would wait
|
||||
forever for the dev_init_lock to be unlocked. dev_init_lock would remain
|
||||
locked though because of infinite wait during usb_kill_urb:
|
||||
|
||||
[ 2730.656472] kworker/0:2 D 0 260 2 0x00000000
|
||||
[ 2730.660700] Workqueue: events request_firmware_work_func
|
||||
[ 2730.664807] [<809dca20>] (__schedule) from [<809dd164>] (schedule+0x4c/0xac)
|
||||
[ 2730.670587] [<809dd164>] (schedule) from [<8069af44>] (usb_kill_urb+0xdc/0x114)
|
||||
[ 2730.676815] [<8069af44>] (usb_kill_urb) from [<7f258b50>] (brcmf_usb_free_q+0x34/0xa8 [brcmfmac])
|
||||
[ 2730.684833] [<7f258b50>] (brcmf_usb_free_q [brcmfmac]) from [<7f2517d4>] (brcmf_detach+0xa0/0xb8 [brcmfmac])
|
||||
[ 2730.693557] [<7f2517d4>] (brcmf_detach [brcmfmac]) from [<7f251a34>] (brcmf_attach+0xac/0x3d8 [brcmfmac])
|
||||
[ 2730.702094] [<7f251a34>] (brcmf_attach [brcmfmac]) from [<7f2587ac>] (brcmf_usb_probe_phase2+0x468/0x4a0 [brcmfmac])
|
||||
[ 2730.711601] [<7f2587ac>] (brcmf_usb_probe_phase2 [brcmfmac]) from [<7f252888>] (brcmf_fw_request_done+0x194/0x220 [brcmfmac])
|
||||
[ 2730.721795] [<7f252888>] (brcmf_fw_request_done [brcmfmac]) from [<805748e4>] (request_firmware_work_func+0x4c/0x88)
|
||||
[ 2730.731125] [<805748e4>] (request_firmware_work_func) from [<80141474>] (process_one_work+0x228/0x808)
|
||||
[ 2730.739223] [<80141474>] (process_one_work) from [<80141a80>] (worker_thread+0x2c/0x564)
|
||||
[ 2730.746105] [<80141a80>] (worker_thread) from [<80147bcc>] (kthread+0x13c/0x16c)
|
||||
[ 2730.752227] [<80147bcc>] (kthread) from [<801010b4>] (ret_from_fork+0x14/0x20)
|
||||
|
||||
[ 2733.099695] kworker/0:3 D 0 1065 2 0x00000000
|
||||
[ 2733.103926] Workqueue: usb_hub_wq hub_event
|
||||
[ 2733.106914] [<809dca20>] (__schedule) from [<809dd164>] (schedule+0x4c/0xac)
|
||||
[ 2733.112693] [<809dd164>] (schedule) from [<809e2a8c>] (schedule_timeout+0x214/0x3e4)
|
||||
[ 2733.119621] [<809e2a8c>] (schedule_timeout) from [<809dde2c>] (wait_for_common+0xc4/0x1c0)
|
||||
[ 2733.126810] [<809dde2c>] (wait_for_common) from [<7f258d00>] (brcmf_usb_disconnect+0x1c/0x4c [brcmfmac])
|
||||
[ 2733.135206] [<7f258d00>] (brcmf_usb_disconnect [brcmfmac]) from [<8069e0c8>] (usb_unbind_interface+0x5c/0x1e4)
|
||||
[ 2733.143943] [<8069e0c8>] (usb_unbind_interface) from [<8056d3e8>] (device_release_driver_internal+0x164/0x1fc)
|
||||
[ 2733.152769] [<8056d3e8>] (device_release_driver_internal) from [<8056c078>] (bus_remove_device+0xd0/0xfc)
|
||||
[ 2733.161138] [<8056c078>] (bus_remove_device) from [<8056977c>] (device_del+0x11c/0x310)
|
||||
[ 2733.167939] [<8056977c>] (device_del) from [<8069cba8>] (usb_disable_device+0xa0/0x1cc)
|
||||
[ 2733.174743] [<8069cba8>] (usb_disable_device) from [<8069507c>] (usb_disconnect+0x74/0x1dc)
|
||||
[ 2733.181823] [<8069507c>] (usb_disconnect) from [<80695e88>] (hub_event+0x478/0xf88)
|
||||
[ 2733.188278] [<80695e88>] (hub_event) from [<80141474>] (process_one_work+0x228/0x808)
|
||||
[ 2733.194905] [<80141474>] (process_one_work) from [<80141a80>] (worker_thread+0x2c/0x564)
|
||||
[ 2733.201724] [<80141a80>] (worker_thread) from [<80147bcc>] (kthread+0x13c/0x16c)
|
||||
[ 2733.207913] [<80147bcc>] (kthread) from [<801010b4>] (ret_from_fork+0x14/0x20)
|
||||
|
||||
It was traced down to a case where usb_kill_urb would be called on an URB
|
||||
structure containing more or less random data, including large number in
|
||||
its use_count. During the debugging it appeared that in brcmf_usb_free_q()
|
||||
the traversal over URBs' lists is not synchronized with operations on those
|
||||
lists in brcmf_usb_rx_complete() leading to handling
|
||||
brcmf_usbdev_info structure (holding lists' head) as lists' element and in
|
||||
result causing above problem.
|
||||
|
||||
Fix it by walking through all URBs during brcmf_cancel_all_urbs using the
|
||||
arrays of requests instead of linked lists.
|
||||
|
||||
Signed-off-by: Piotr Figiel <p.figiel@camlintechnologies.com>
|
||||
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
|
||||
---
|
||||
drivers/net/wireless/broadcom/brcm80211/brcmfmac/usb.c | 10 ++++++++--
|
||||
1 file changed, 8 insertions(+), 2 deletions(-)
|
||||
|
||||
--- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/usb.c
|
||||
+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/usb.c
|
||||
@@ -682,12 +682,18 @@ static int brcmf_usb_up(struct device *d
|
||||
|
||||
static void brcmf_cancel_all_urbs(struct brcmf_usbdev_info *devinfo)
|
||||
{
|
||||
+ int i;
|
||||
+
|
||||
if (devinfo->ctl_urb)
|
||||
usb_kill_urb(devinfo->ctl_urb);
|
||||
if (devinfo->bulk_urb)
|
||||
usb_kill_urb(devinfo->bulk_urb);
|
||||
- brcmf_usb_free_q(&devinfo->tx_postq, true);
|
||||
- brcmf_usb_free_q(&devinfo->rx_postq, true);
|
||||
+ if (devinfo->tx_reqs)
|
||||
+ for (i = 0; i < devinfo->bus_pub.ntxq; i++)
|
||||
+ usb_kill_urb(devinfo->tx_reqs[i].urb);
|
||||
+ if (devinfo->rx_reqs)
|
||||
+ for (i = 0; i < devinfo->bus_pub.nrxq; i++)
|
||||
+ usb_kill_urb(devinfo->rx_reqs[i].urb);
|
||||
}
|
||||
|
||||
static void brcmf_usb_down(struct device *dev)
|
@ -1,123 +0,0 @@
|
||||
From 24d413a31afaee9bbbf79226052c386b01780ce2 Mon Sep 17 00:00:00 2001
|
||||
From: Piotr Figiel <p.figiel@camlintechnologies.com>
|
||||
Date: Wed, 13 Mar 2019 09:52:01 +0000
|
||||
Subject: [PATCH] brcmfmac: fix Oops when bringing up interface during USB
|
||||
disconnect
|
||||
|
||||
Fix a race which leads to an Oops with NULL pointer dereference. The
|
||||
dereference is in brcmf_config_dongle() when cfg_to_ndev() attempts to get
|
||||
net_device structure of interface with index 0 via if2bss mapping. This
|
||||
shouldn't fail because of check for bus being ready in brcmf_netdev_open(),
|
||||
but it's not synchronised with USB disconnect and there is a race: after
|
||||
the check the bus can be marked down and the mapping for interface 0 may be
|
||||
gone.
|
||||
|
||||
Solve this by modifying disconnect handling so that the removal of mapping
|
||||
of ifidx to brcmf_if structure happens after netdev removal (which is
|
||||
synchronous with brcmf_netdev_open() thanks to rtln being locked in
|
||||
devinet_ioctl()). This assures brcmf_netdev_open() returns before the
|
||||
mapping is removed during disconnect.
|
||||
|
||||
Unable to handle kernel NULL pointer dereference at virtual address 00000008
|
||||
pgd = bcae2612
|
||||
[00000008] *pgd=8be73831
|
||||
Internal error: Oops: 17 [#1] PREEMPT SMP ARM
|
||||
Modules linked in: brcmfmac brcmutil 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 usb_serial_simple usbserial cdc_acm smsc95xx usbnet ci_hdrc_imx ci_hdrc
|
||||
usbmisc_imx ulpi 8250_exar 8250_pci 8250 8250_base libcomposite configfs
|
||||
udc_core [last unloaded: brcmutil]
|
||||
CPU: 2 PID: 24478 Comm: ifconfig Not tainted 4.19.23-00078-ga62866d-dirty #115
|
||||
Hardware name: Freescale i.MX6 Quad/DualLite (Device Tree)
|
||||
PC is at brcmf_cfg80211_up+0x94/0x29c [brcmfmac]
|
||||
LR is at brcmf_cfg80211_up+0x8c/0x29c [brcmfmac]
|
||||
pc : [<7f26a91c>] lr : [<7f26a914>] psr: a0070013
|
||||
sp : eca99d28 ip : 00000000 fp : ee9c6c00
|
||||
r10: 00000036 r9 : 00000000 r8 : ece4002c
|
||||
r7 : edb5b800 r6 : 00000000 r5 : 80f08448 r4 : edb5b968
|
||||
r3 : ffffffff r2 : 00000000 r1 : 00000002 r0 : 00000000
|
||||
Flags: NzCv IRQs on FIQs on Mode SVC_32 ISA ARM Segment none
|
||||
Control: 10c5387d Table: 7ca0c04a DAC: 00000051
|
||||
Process ifconfig (pid: 24478, stack limit = 0xd9e85a0e)
|
||||
Stack: (0xeca99d28 to 0xeca9a000)
|
||||
9d20: 00000000 80f873b0 0000000d 80f08448 eca99d68 50d45f32
|
||||
9d40: 7f27de94 ece40000 80f08448 80f08448 7f27de94 ece4002c 00000000 00000036
|
||||
9d60: ee9c6c00 7f27262c 00001002 50d45f32 ece40000 00000000 80f08448 80772008
|
||||
9d80: 00000001 00001043 00001002 ece40000 00000000 50d45f32 ece40000 00000001
|
||||
9da0: 80f08448 00001043 00001002 807723d0 00000000 50d45f32 80f08448 eca99e58
|
||||
9dc0: 80f87113 50d45f32 80f08448 ece40000 ece40138 00001002 80f08448 00000000
|
||||
9de0: 00000000 80772434 edbd5380 eca99e58 edbd5380 80f08448 ee9c6c0c 80805f70
|
||||
9e00: 00000000 ede08e00 00008914 ece40000 00000014 ee9c6c0c 600c0013 00001043
|
||||
9e20: 0208a8c0 ffffffff 00000000 50d45f32 eca98000 80f08448 7ee9fc38 00008914
|
||||
9e40: 80f68e40 00000051 eca98000 00000036 00000003 80808b9c 6e616c77 00000030
|
||||
9e60: 00000000 00000000 00001043 0208a8c0 ffffffff 00000000 80f08448 00000000
|
||||
9e80: 00000000 816d8b20 600c0013 00000001 ede09320 801763d4 00000000 50d45f32
|
||||
9ea0: eca98000 80f08448 7ee9fc38 50d45f32 00008914 80f08448 7ee9fc38 80f68e40
|
||||
9ec0: ed531540 8074721c 00000800 00000001 00000000 6e616c77 00000030 00000000
|
||||
9ee0: 00000000 00001002 0208a8c0 ffffffff 00000000 50d45f32 80f08448 7ee9fc38
|
||||
9f00: ed531560 ec8fc900 80285a6c 80285138 edb910c0 00000000 ecd91008 ede08e00
|
||||
9f20: 80f08448 00000000 00000000 816d8b20 600c0013 00000001 ede09320 801763d4
|
||||
9f40: 00000000 50d45f32 00021000 edb91118 edb910c0 80f08448 01b29000 edb91118
|
||||
9f60: eca99f7c 50d45f32 00021000 ec8fc900 00000003 ec8fc900 00008914 7ee9fc38
|
||||
9f80: eca98000 00000036 00000003 80285a6c 00086364 7ee9fe1c 000000c3 00000036
|
||||
9fa0: 801011c4 80101000 00086364 7ee9fe1c 00000003 00008914 7ee9fc38 00086364
|
||||
9fc0: 00086364 7ee9fe1c 000000c3 00000036 0008630c 7ee9fe1c 7ee9fc38 00000003
|
||||
9fe0: 000a42b8 7ee9fbd4 00019914 76e09acc 600c0010 00000003 00000000 00000000
|
||||
[<7f26a91c>] (brcmf_cfg80211_up [brcmfmac]) from [<7f27262c>] (brcmf_netdev_open+0x74/0xe8 [brcmfmac])
|
||||
[<7f27262c>] (brcmf_netdev_open [brcmfmac]) from [<80772008>] (__dev_open+0xcc/0x150)
|
||||
[<80772008>] (__dev_open) from [<807723d0>] (__dev_change_flags+0x168/0x1b4)
|
||||
[<807723d0>] (__dev_change_flags) from [<80772434>] (dev_change_flags+0x18/0x48)
|
||||
[<80772434>] (dev_change_flags) from [<80805f70>] (devinet_ioctl+0x67c/0x79c)
|
||||
[<80805f70>] (devinet_ioctl) from [<80808b9c>] (inet_ioctl+0x210/0x3d4)
|
||||
[<80808b9c>] (inet_ioctl) from [<8074721c>] (sock_ioctl+0x350/0x524)
|
||||
[<8074721c>] (sock_ioctl) from [<80285138>] (do_vfs_ioctl+0xb0/0x9b0)
|
||||
[<80285138>] (do_vfs_ioctl) from [<80285a6c>] (ksys_ioctl+0x34/0x5c)
|
||||
[<80285a6c>] (ksys_ioctl) from [<80101000>] (ret_fast_syscall+0x0/0x28)
|
||||
Exception stack(0xeca99fa8 to 0xeca99ff0)
|
||||
9fa0: 00086364 7ee9fe1c 00000003 00008914 7ee9fc38 00086364
|
||||
9fc0: 00086364 7ee9fe1c 000000c3 00000036 0008630c 7ee9fe1c 7ee9fc38 00000003
|
||||
9fe0: 000a42b8 7ee9fbd4 00019914 76e09acc
|
||||
Code: e5970328 eb002021 e1a02006 e3a01002 (e5909008)
|
||||
---[ end trace 5cbac2333f3ac5df ]---
|
||||
|
||||
Signed-off-by: Piotr Figiel <p.figiel@camlintechnologies.com>
|
||||
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
|
||||
---
|
||||
.../net/wireless/broadcom/brcm80211/brcmfmac/core.c | 10 +++++++---
|
||||
1 file changed, 7 insertions(+), 3 deletions(-)
|
||||
|
||||
--- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/core.c
|
||||
+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/core.c
|
||||
@@ -862,17 +862,17 @@ static void brcmf_del_if(struct brcmf_pu
|
||||
bool rtnl_locked)
|
||||
{
|
||||
struct brcmf_if *ifp;
|
||||
+ int ifidx;
|
||||
|
||||
ifp = drvr->iflist[bsscfgidx];
|
||||
- drvr->iflist[bsscfgidx] = NULL;
|
||||
if (!ifp) {
|
||||
bphy_err(drvr, "Null interface, bsscfgidx=%d\n", bsscfgidx);
|
||||
return;
|
||||
}
|
||||
brcmf_dbg(TRACE, "Enter, bsscfgidx=%d, ifidx=%d\n", bsscfgidx,
|
||||
ifp->ifidx);
|
||||
- if (drvr->if2bss[ifp->ifidx] == bsscfgidx)
|
||||
- drvr->if2bss[ifp->ifidx] = BRCMF_BSSIDX_INVALID;
|
||||
+ ifidx = ifp->ifidx;
|
||||
+
|
||||
if (ifp->ndev) {
|
||||
if (bsscfgidx == 0) {
|
||||
if (ifp->ndev->netdev_ops == &brcmf_netdev_ops_pri) {
|
||||
@@ -900,6 +900,10 @@ static void brcmf_del_if(struct brcmf_pu
|
||||
brcmf_p2p_ifp_removed(ifp, rtnl_locked);
|
||||
kfree(ifp);
|
||||
}
|
||||
+
|
||||
+ drvr->iflist[bsscfgidx] = NULL;
|
||||
+ if (drvr->if2bss[ifidx] == bsscfgidx)
|
||||
+ drvr->if2bss[ifidx] = BRCMF_BSSIDX_INVALID;
|
||||
}
|
||||
|
||||
void brcmf_remove_interface(struct brcmf_if *ifp, bool rtnl_locked)
|
@ -1,182 +0,0 @@
|
||||
From a9fd0953fa4a62887306be28641b4b0809f3b2fd Mon Sep 17 00:00:00 2001
|
||||
From: Piotr Figiel <p.figiel@camlintechnologies.com>
|
||||
Date: Wed, 13 Mar 2019 09:52:42 +0000
|
||||
Subject: [PATCH] brcmfmac: convert dev_init_lock mutex to completion
|
||||
|
||||
Leaving dev_init_lock mutex locked in probe causes BUG and a WARNING when
|
||||
kernel is compiled with CONFIG_PROVE_LOCKING. Convert mutex to completion
|
||||
which silences those warnings and improves code readability.
|
||||
|
||||
Fix below errors when connecting the USB WiFi dongle:
|
||||
|
||||
brcmfmac: brcmf_fw_alloc_request: using brcm/brcmfmac43143 for chip BCM43143/2
|
||||
BUG: workqueue leaked lock or atomic: kworker/0:2/0x00000000/434
|
||||
last function: hub_event
|
||||
1 lock held by kworker/0:2/434:
|
||||
#0: 18d5dcdf (&devinfo->dev_init_lock){+.+.}, at: brcmf_usb_probe+0x78/0x550 [brcmfmac]
|
||||
CPU: 0 PID: 434 Comm: kworker/0:2 Not tainted 4.19.23-00084-g454a789-dirty #123
|
||||
Hardware name: Freescale i.MX6 Quad/DualLite (Device Tree)
|
||||
Workqueue: usb_hub_wq hub_event
|
||||
[<8011237c>] (unwind_backtrace) from [<8010d74c>] (show_stack+0x10/0x14)
|
||||
[<8010d74c>] (show_stack) from [<809c4324>] (dump_stack+0xa8/0xd4)
|
||||
[<809c4324>] (dump_stack) from [<8014195c>] (process_one_work+0x710/0x808)
|
||||
[<8014195c>] (process_one_work) from [<80141a80>] (worker_thread+0x2c/0x564)
|
||||
[<80141a80>] (worker_thread) from [<80147bcc>] (kthread+0x13c/0x16c)
|
||||
[<80147bcc>] (kthread) from [<801010b4>] (ret_from_fork+0x14/0x20)
|
||||
Exception stack(0xed1d9fb0 to 0xed1d9ff8)
|
||||
9fa0: 00000000 00000000 00000000 00000000
|
||||
9fc0: 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
|
||||
9fe0: 00000000 00000000 00000000 00000000 00000013 00000000
|
||||
|
||||
======================================================
|
||||
WARNING: possible circular locking dependency detected
|
||||
4.19.23-00084-g454a789-dirty #123 Not tainted
|
||||
------------------------------------------------------
|
||||
kworker/0:2/434 is trying to acquire lock:
|
||||
e29cf799 ((wq_completion)"events"){+.+.}, at: process_one_work+0x174/0x808
|
||||
|
||||
but task is already holding lock:
|
||||
18d5dcdf (&devinfo->dev_init_lock){+.+.}, at: brcmf_usb_probe+0x78/0x550 [brcmfmac]
|
||||
|
||||
which lock already depends on the new lock.
|
||||
|
||||
the existing dependency chain (in reverse order) is:
|
||||
|
||||
-> #2 (&devinfo->dev_init_lock){+.+.}:
|
||||
mutex_lock_nested+0x1c/0x24
|
||||
brcmf_usb_probe+0x78/0x550 [brcmfmac]
|
||||
usb_probe_interface+0xc0/0x1bc
|
||||
really_probe+0x228/0x2c0
|
||||
__driver_attach+0xe4/0xe8
|
||||
bus_for_each_dev+0x68/0xb4
|
||||
bus_add_driver+0x19c/0x214
|
||||
driver_register+0x78/0x110
|
||||
usb_register_driver+0x84/0x148
|
||||
process_one_work+0x228/0x808
|
||||
worker_thread+0x2c/0x564
|
||||
kthread+0x13c/0x16c
|
||||
ret_from_fork+0x14/0x20
|
||||
(null)
|
||||
|
||||
-> #1 (brcmf_driver_work){+.+.}:
|
||||
worker_thread+0x2c/0x564
|
||||
kthread+0x13c/0x16c
|
||||
ret_from_fork+0x14/0x20
|
||||
(null)
|
||||
|
||||
-> #0 ((wq_completion)"events"){+.+.}:
|
||||
process_one_work+0x1b8/0x808
|
||||
worker_thread+0x2c/0x564
|
||||
kthread+0x13c/0x16c
|
||||
ret_from_fork+0x14/0x20
|
||||
(null)
|
||||
|
||||
other info that might help us debug this:
|
||||
|
||||
Chain exists of:
|
||||
(wq_completion)"events" --> brcmf_driver_work --> &devinfo->dev_init_lock
|
||||
|
||||
Possible unsafe locking scenario:
|
||||
|
||||
CPU0 CPU1
|
||||
---- ----
|
||||
lock(&devinfo->dev_init_lock);
|
||||
lock(brcmf_driver_work);
|
||||
lock(&devinfo->dev_init_lock);
|
||||
lock((wq_completion)"events");
|
||||
|
||||
*** DEADLOCK ***
|
||||
|
||||
1 lock held by kworker/0:2/434:
|
||||
#0: 18d5dcdf (&devinfo->dev_init_lock){+.+.}, at: brcmf_usb_probe+0x78/0x550 [brcmfmac]
|
||||
|
||||
stack backtrace:
|
||||
CPU: 0 PID: 434 Comm: kworker/0:2 Not tainted 4.19.23-00084-g454a789-dirty #123
|
||||
Hardware name: Freescale i.MX6 Quad/DualLite (Device Tree)
|
||||
Workqueue: events request_firmware_work_func
|
||||
[<8011237c>] (unwind_backtrace) from [<8010d74c>] (show_stack+0x10/0x14)
|
||||
[<8010d74c>] (show_stack) from [<809c4324>] (dump_stack+0xa8/0xd4)
|
||||
[<809c4324>] (dump_stack) from [<80172838>] (print_circular_bug+0x210/0x330)
|
||||
[<80172838>] (print_circular_bug) from [<80175940>] (__lock_acquire+0x160c/0x1a30)
|
||||
[<80175940>] (__lock_acquire) from [<8017671c>] (lock_acquire+0xe0/0x268)
|
||||
[<8017671c>] (lock_acquire) from [<80141404>] (process_one_work+0x1b8/0x808)
|
||||
[<80141404>] (process_one_work) from [<80141a80>] (worker_thread+0x2c/0x564)
|
||||
[<80141a80>] (worker_thread) from [<80147bcc>] (kthread+0x13c/0x16c)
|
||||
[<80147bcc>] (kthread) from [<801010b4>] (ret_from_fork+0x14/0x20)
|
||||
Exception stack(0xed1d9fb0 to 0xed1d9ff8)
|
||||
9fa0: 00000000 00000000 00000000 00000000
|
||||
9fc0: 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
|
||||
9fe0: 00000000 00000000 00000000 00000000 00000013 00000000
|
||||
|
||||
Signed-off-by: Piotr Figiel <p.figiel@camlintechnologies.com>
|
||||
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
|
||||
---
|
||||
.../wireless/broadcom/brcm80211/brcmfmac/usb.c | 17 ++++++++---------
|
||||
1 file changed, 8 insertions(+), 9 deletions(-)
|
||||
|
||||
--- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/usb.c
|
||||
+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/usb.c
|
||||
@@ -160,7 +160,7 @@ struct brcmf_usbdev_info {
|
||||
|
||||
struct usb_device *usbdev;
|
||||
struct device *dev;
|
||||
- struct mutex dev_init_lock;
|
||||
+ struct completion dev_init_done;
|
||||
|
||||
int ctl_in_pipe, ctl_out_pipe;
|
||||
struct urb *ctl_urb; /* URB for control endpoint */
|
||||
@@ -1194,11 +1194,11 @@ static void brcmf_usb_probe_phase2(struc
|
||||
if (ret)
|
||||
goto error;
|
||||
|
||||
- mutex_unlock(&devinfo->dev_init_lock);
|
||||
+ complete(&devinfo->dev_init_done);
|
||||
return;
|
||||
error:
|
||||
brcmf_dbg(TRACE, "failed: dev=%s, err=%d\n", dev_name(dev), ret);
|
||||
- mutex_unlock(&devinfo->dev_init_lock);
|
||||
+ complete(&devinfo->dev_init_done);
|
||||
device_release_driver(dev);
|
||||
}
|
||||
|
||||
@@ -1266,7 +1266,7 @@ static int brcmf_usb_probe_cb(struct brc
|
||||
if (ret)
|
||||
goto fail;
|
||||
/* we are done */
|
||||
- mutex_unlock(&devinfo->dev_init_lock);
|
||||
+ complete(&devinfo->dev_init_done);
|
||||
return 0;
|
||||
}
|
||||
bus->chip = bus_pub->devid;
|
||||
@@ -1326,11 +1326,10 @@ brcmf_usb_probe(struct usb_interface *in
|
||||
|
||||
devinfo->usbdev = usb;
|
||||
devinfo->dev = &usb->dev;
|
||||
- /* Take an init lock, to protect for disconnect while still loading.
|
||||
+ /* Init completion, to protect for disconnect while still loading.
|
||||
* Necessary because of the asynchronous firmware load construction
|
||||
*/
|
||||
- mutex_init(&devinfo->dev_init_lock);
|
||||
- mutex_lock(&devinfo->dev_init_lock);
|
||||
+ init_completion(&devinfo->dev_init_done);
|
||||
|
||||
usb_set_intfdata(intf, devinfo);
|
||||
|
||||
@@ -1408,7 +1407,7 @@ brcmf_usb_probe(struct usb_interface *in
|
||||
return 0;
|
||||
|
||||
fail:
|
||||
- mutex_unlock(&devinfo->dev_init_lock);
|
||||
+ complete(&devinfo->dev_init_done);
|
||||
kfree(devinfo);
|
||||
usb_set_intfdata(intf, NULL);
|
||||
return ret;
|
||||
@@ -1423,7 +1422,7 @@ brcmf_usb_disconnect(struct usb_interfac
|
||||
devinfo = (struct brcmf_usbdev_info *)usb_get_intfdata(intf);
|
||||
|
||||
if (devinfo) {
|
||||
- mutex_lock(&devinfo->dev_init_lock);
|
||||
+ wait_for_completion(&devinfo->dev_init_done);
|
||||
/* Make sure that devinfo still exists. Firmware probe routines
|
||||
* may have released the device and cleared the intfdata.
|
||||
*/
|
@ -1,35 +0,0 @@
|
||||
From 46953f97224d56a12ccbe9c6acaa84ca0dab2780 Mon Sep 17 00:00:00 2001
|
||||
From: Kangjie Lu <kjlu@umn.edu>
|
||||
Date: Fri, 15 Mar 2019 12:04:32 -0500
|
||||
Subject: [PATCH] brcmfmac: fix missing checks for kmemdup
|
||||
|
||||
In case kmemdup fails, the fix sets conn_info->req_ie_len and
|
||||
conn_info->resp_ie_len to zero to avoid buffer overflows.
|
||||
|
||||
Signed-off-by: Kangjie Lu <kjlu@umn.edu>
|
||||
Acked-by: Arend van Spriel <arend.vanspriel@broadcom.com>
|
||||
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
|
||||
---
|
||||
drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c | 4 ++++
|
||||
1 file changed, 4 insertions(+)
|
||||
|
||||
--- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c
|
||||
+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c
|
||||
@@ -5456,6 +5456,8 @@ static s32 brcmf_get_assoc_ies(struct br
|
||||
conn_info->req_ie =
|
||||
kmemdup(cfg->extra_buf, conn_info->req_ie_len,
|
||||
GFP_KERNEL);
|
||||
+ if (!conn_info->req_ie)
|
||||
+ conn_info->req_ie_len = 0;
|
||||
} else {
|
||||
conn_info->req_ie_len = 0;
|
||||
conn_info->req_ie = NULL;
|
||||
@@ -5472,6 +5474,8 @@ static s32 brcmf_get_assoc_ies(struct br
|
||||
conn_info->resp_ie =
|
||||
kmemdup(cfg->extra_buf, conn_info->resp_ie_len,
|
||||
GFP_KERNEL);
|
||||
+ if (!conn_info->resp_ie)
|
||||
+ conn_info->resp_ie_len = 0;
|
||||
} else {
|
||||
conn_info->resp_ie_len = 0;
|
||||
conn_info->resp_ie = NULL;
|
@ -0,0 +1,70 @@
|
||||
From b1a0ba8f772d7a6dcb5aa3e856f5bd8274989ebe Mon Sep 17 00:00:00 2001
|
||||
From: Hans de Goede <hdegoede@redhat.com>
|
||||
Date: Mon, 22 Apr 2019 22:41:23 +0200
|
||||
Subject: [PATCH] brcmfmac: Add DMI nvram filename quirk for ACEPC T8 and T11
|
||||
mini PCs
|
||||
|
||||
The ACEPC T8 and T11 mini PCs contain quite generic names in the sys_vendor
|
||||
and product_name DMI strings, without this patch brcmfmac will try to load:
|
||||
"brcmfmac43455-sdio.Default string-Default string.txt" as nvram file which
|
||||
is way too generic.
|
||||
|
||||
The DMI strings on which we are matching are somewhat generic too, but
|
||||
"To be filled by O.E.M." is less common then "Default string" and the
|
||||
system-sku and bios-version strings are pretty unique. Beside the DMI
|
||||
strings we also check the wifi-module chip-id and revision. I'm confident
|
||||
that the combination of all this is unique.
|
||||
|
||||
Both the T8 and T11 use the same wifi-module, this commit adds DMI
|
||||
quirks for both mini PCs pointing to brcmfmac43455-sdio.acepc-t8.txt .
|
||||
|
||||
BugLink: https://bugzilla.redhat.com/show_bug.cgi?id=1690852
|
||||
Cc: stable@vger.kernel.org
|
||||
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
|
||||
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
|
||||
---
|
||||
.../broadcom/brcm80211/brcmfmac/dmi.c | 26 +++++++++++++++++++
|
||||
1 file changed, 26 insertions(+)
|
||||
|
||||
--- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/dmi.c
|
||||
+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/dmi.c
|
||||
@@ -31,6 +31,10 @@ struct brcmf_dmi_data {
|
||||
|
||||
/* NOTE: Please keep all entries sorted alphabetically */
|
||||
|
||||
+static const struct brcmf_dmi_data acepc_t8_data = {
|
||||
+ BRCM_CC_4345_CHIP_ID, 6, "acepc-t8"
|
||||
+};
|
||||
+
|
||||
static const struct brcmf_dmi_data gpd_win_pocket_data = {
|
||||
BRCM_CC_4356_CHIP_ID, 2, "gpd-win-pocket"
|
||||
};
|
||||
@@ -49,6 +53,28 @@ static const struct brcmf_dmi_data pov_t
|
||||
|
||||
static const struct dmi_system_id dmi_platform_data[] = {
|
||||
{
|
||||
+ /* ACEPC T8 Cherry Trail Z8350 mini PC */
|
||||
+ .matches = {
|
||||
+ DMI_EXACT_MATCH(DMI_BOARD_VENDOR, "To be filled by O.E.M."),
|
||||
+ DMI_EXACT_MATCH(DMI_BOARD_NAME, "Cherry Trail CR"),
|
||||
+ DMI_EXACT_MATCH(DMI_PRODUCT_SKU, "T8"),
|
||||
+ /* also match on somewhat unique bios-version */
|
||||
+ DMI_EXACT_MATCH(DMI_BIOS_VERSION, "1.000"),
|
||||
+ },
|
||||
+ .driver_data = (void *)&acepc_t8_data,
|
||||
+ },
|
||||
+ {
|
||||
+ /* ACEPC T11 Cherry Trail Z8350 mini PC, same wifi as the T8 */
|
||||
+ .matches = {
|
||||
+ DMI_EXACT_MATCH(DMI_BOARD_VENDOR, "To be filled by O.E.M."),
|
||||
+ DMI_EXACT_MATCH(DMI_BOARD_NAME, "Cherry Trail CR"),
|
||||
+ DMI_EXACT_MATCH(DMI_PRODUCT_SKU, "T11"),
|
||||
+ /* also match on somewhat unique bios-version */
|
||||
+ DMI_EXACT_MATCH(DMI_BIOS_VERSION, "1.000"),
|
||||
+ },
|
||||
+ .driver_data = (void *)&acepc_t8_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
|
@ -0,0 +1,32 @@
|
||||
From 99d94ef367af67f630b38c93ff46c5819b7d06b6 Mon Sep 17 00:00:00 2001
|
||||
From: Wright Feng <Wright.Feng@cypress.com>
|
||||
Date: Thu, 25 Apr 2019 07:05:46 +0000
|
||||
Subject: [PATCH] brcmfmac: send mailbox interrupt twice for specific hardware
|
||||
device
|
||||
|
||||
For PCIE wireless device with core revision less than 14, device may miss
|
||||
PCIE to System Backplane Interrupt via PCIEtoSBMailbox. So add sending
|
||||
mail box interrupt twice as a hardware workaround.
|
||||
|
||||
Signed-off-by: Wright Feng <wright.feng@cypress.com>
|
||||
Reviewed-by: Arend van Spriel <arend.vanspriel@broadcom.com>
|
||||
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
|
||||
---
|
||||
drivers/net/wireless/broadcom/brcm80211/brcmfmac/pcie.c | 6 +++++-
|
||||
1 file changed, 5 insertions(+), 1 deletion(-)
|
||||
|
||||
--- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/pcie.c
|
||||
+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/pcie.c
|
||||
@@ -698,7 +698,11 @@ brcmf_pcie_send_mb_data(struct brcmf_pci
|
||||
|
||||
brcmf_pcie_write_tcm32(devinfo, addr, htod_mb_data);
|
||||
pci_write_config_dword(devinfo->pdev, BRCMF_PCIE_REG_SBMBX, 1);
|
||||
- pci_write_config_dword(devinfo->pdev, BRCMF_PCIE_REG_SBMBX, 1);
|
||||
+
|
||||
+ /* Send mailbox interrupt twice as a hardware workaround */
|
||||
+ core = brcmf_chip_get_core(devinfo->ci, BCMA_CORE_PCIE2);
|
||||
+ if (core->rev <= 13)
|
||||
+ pci_write_config_dword(devinfo->pdev, BRCMF_PCIE_REG_SBMBX, 1);
|
||||
|
||||
return 0;
|
||||
}
|
@ -0,0 +1,30 @@
|
||||
From 324f1feb960c79a07df3acde89a119a5aa80cb10 Mon Sep 17 00:00:00 2001
|
||||
From: Kalle Valo <kvalo@codeaurora.org>
|
||||
Date: Thu, 25 Apr 2019 20:08:31 +0300
|
||||
Subject: [PATCH] Revert "brcmfmac: send mailbox interrupt twice for specific
|
||||
hardware device"
|
||||
|
||||
This reverts commit 99d94ef367af67f630b38c93ff46c5819b7d06b6. I accidentally
|
||||
applied this broken (failed to compile) patch due to a bug in my patchwork
|
||||
script.
|
||||
|
||||
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
|
||||
---
|
||||
drivers/net/wireless/broadcom/brcm80211/brcmfmac/pcie.c | 6 +-----
|
||||
1 file changed, 1 insertion(+), 5 deletions(-)
|
||||
|
||||
--- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/pcie.c
|
||||
+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/pcie.c
|
||||
@@ -698,11 +698,7 @@ brcmf_pcie_send_mb_data(struct brcmf_pci
|
||||
|
||||
brcmf_pcie_write_tcm32(devinfo, addr, htod_mb_data);
|
||||
pci_write_config_dword(devinfo->pdev, BRCMF_PCIE_REG_SBMBX, 1);
|
||||
-
|
||||
- /* Send mailbox interrupt twice as a hardware workaround */
|
||||
- core = brcmf_chip_get_core(devinfo->ci, BCMA_CORE_PCIE2);
|
||||
- if (core->rev <= 13)
|
||||
- pci_write_config_dword(devinfo->pdev, BRCMF_PCIE_REG_SBMBX, 1);
|
||||
+ pci_write_config_dword(devinfo->pdev, BRCMF_PCIE_REG_SBMBX, 1);
|
||||
|
||||
return 0;
|
||||
}
|
@ -0,0 +1,39 @@
|
||||
From 9ef77fbedad9ea8895cd5d7fb7aee16071f527dc Mon Sep 17 00:00:00 2001
|
||||
From: Wright Feng <Wright.Feng@cypress.com>
|
||||
Date: Fri, 26 Apr 2019 03:12:32 +0000
|
||||
Subject: [PATCH] brcmfmac: send mailbox interrupt twice for specific hardware
|
||||
device
|
||||
|
||||
For PCIE wireless device with core revision less than 14, device may miss
|
||||
PCIE to System Backplane Interrupt via PCIEtoSBMailbox. So add sending
|
||||
mail box interrupt twice as a hardware workaround.
|
||||
|
||||
Signed-off-by: Wright Feng <wright.feng@cypress.com>
|
||||
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
|
||||
---
|
||||
drivers/net/wireless/broadcom/brcm80211/brcmfmac/pcie.c | 7 ++++++-
|
||||
1 file changed, 6 insertions(+), 1 deletion(-)
|
||||
|
||||
--- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/pcie.c
|
||||
+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/pcie.c
|
||||
@@ -675,6 +675,7 @@ static int
|
||||
brcmf_pcie_send_mb_data(struct brcmf_pciedev_info *devinfo, u32 htod_mb_data)
|
||||
{
|
||||
struct brcmf_pcie_shared_info *shared;
|
||||
+ struct brcmf_core *core;
|
||||
u32 addr;
|
||||
u32 cur_htod_mb_data;
|
||||
u32 i;
|
||||
@@ -698,7 +699,11 @@ brcmf_pcie_send_mb_data(struct brcmf_pci
|
||||
|
||||
brcmf_pcie_write_tcm32(devinfo, addr, htod_mb_data);
|
||||
pci_write_config_dword(devinfo->pdev, BRCMF_PCIE_REG_SBMBX, 1);
|
||||
- pci_write_config_dword(devinfo->pdev, BRCMF_PCIE_REG_SBMBX, 1);
|
||||
+
|
||||
+ /* Send mailbox interrupt twice as a hardware workaround */
|
||||
+ core = brcmf_chip_get_core(devinfo->ci, BCMA_CORE_PCIE2);
|
||||
+ if (core->rev <= 13)
|
||||
+ pci_write_config_dword(devinfo->pdev, BRCMF_PCIE_REG_SBMBX, 1);
|
||||
|
||||
return 0;
|
||||
}
|
@ -0,0 +1,49 @@
|
||||
From 2d91c8ad068a5cad4d9e7ece8dc811a697c7176a Mon Sep 17 00:00:00 2001
|
||||
From: Wright Feng <Wright.Feng@cypress.com>
|
||||
Date: Fri, 26 Apr 2019 03:41:46 +0000
|
||||
Subject: [PATCH] brcmfmac: set txflow request id from 1 to pktids array size
|
||||
|
||||
Some PCIE firmwares drop txstatus if pktid is 0 and make packet held in
|
||||
host side and never be released. If that packet type is 802.1x, the
|
||||
pend_8021x_cnt value will be always greater than 0 and show "Timed out
|
||||
waiting for no pending 802.1x packets" error message when sending key to
|
||||
dongle every time.
|
||||
|
||||
To be compatible with all firmwares, host should set txflow request id
|
||||
from 1 instead of from 0.
|
||||
|
||||
Signed-off-by: Wright Feng <wright.feng@cypress.com>
|
||||
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
|
||||
---
|
||||
drivers/net/wireless/broadcom/brcm80211/brcmfmac/msgbuf.c | 6 +++---
|
||||
1 file changed, 3 insertions(+), 3 deletions(-)
|
||||
|
||||
--- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/msgbuf.c
|
||||
+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/msgbuf.c
|
||||
@@ -375,7 +375,7 @@ brcmf_msgbuf_get_pktid(struct device *de
|
||||
struct brcmf_msgbuf_pktid *pktid;
|
||||
struct sk_buff *skb;
|
||||
|
||||
- if (idx >= pktids->array_size) {
|
||||
+ if (idx < 0 || idx >= pktids->array_size) {
|
||||
brcmf_err("Invalid packet id %d (max %d)\n", idx,
|
||||
pktids->array_size);
|
||||
return NULL;
|
||||
@@ -747,7 +747,7 @@ static void brcmf_msgbuf_txflow(struct b
|
||||
tx_msghdr = (struct msgbuf_tx_msghdr *)ret_ptr;
|
||||
|
||||
tx_msghdr->msg.msgtype = MSGBUF_TYPE_TX_POST;
|
||||
- tx_msghdr->msg.request_id = cpu_to_le32(pktid);
|
||||
+ tx_msghdr->msg.request_id = cpu_to_le32(pktid + 1);
|
||||
tx_msghdr->msg.ifidx = brcmf_flowring_ifidx_get(flow, flowid);
|
||||
tx_msghdr->flags = BRCMF_MSGBUF_PKT_FLAGS_FRAME_802_3;
|
||||
tx_msghdr->flags |= (skb->priority & 0x07) <<
|
||||
@@ -884,7 +884,7 @@ brcmf_msgbuf_process_txstatus(struct brc
|
||||
u16 flowid;
|
||||
|
||||
tx_status = (struct msgbuf_tx_status *)buf;
|
||||
- idx = le32_to_cpu(tx_status->msg.request_id);
|
||||
+ idx = le32_to_cpu(tx_status->msg.request_id) - 1;
|
||||
flowid = le16_to_cpu(tx_status->compl_hdr.flow_ring_id);
|
||||
flowid -= BRCMF_H2D_MSGRING_FLOWRING_IDSTART;
|
||||
skb = brcmf_msgbuf_get_pktid(msgbuf->drvr->bus_if->dev,
|
@ -0,0 +1,90 @@
|
||||
From 47dd82e3d25e85a7c7c4e4b0eac9d297d1e5e2d4 Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= <rafal@milecki.pl>
|
||||
Date: Sun, 28 Apr 2019 23:38:26 +0200
|
||||
Subject: [PATCH] brcmfmac: print firmware messages after a firmware crash
|
||||
MIME-Version: 1.0
|
||||
Content-Type: text/plain; charset=UTF-8
|
||||
Content-Transfer-Encoding: 8bit
|
||||
|
||||
Normally firmware messages are printed with debugging enabled only. It's
|
||||
a good idea as firmware may print a lot of messages that normal users
|
||||
don't need to care about.
|
||||
|
||||
However, on firmware crash, it may be very helpful to log all recent
|
||||
messages. There is almost always a backtrace available as well as rought
|
||||
info on the latest actions/state.
|
||||
|
||||
Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
|
||||
Reviewed-by: Arend van Spriel <arend.vanspriel@broadcom.com>
|
||||
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
|
||||
---
|
||||
.../broadcom/brcm80211/brcmfmac/pcie.c | 24 ++++++++++++++-----
|
||||
1 file changed, 18 insertions(+), 6 deletions(-)
|
||||
|
||||
--- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/pcie.c
|
||||
+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/pcie.c
|
||||
@@ -764,15 +764,22 @@ static void brcmf_pcie_bus_console_init(
|
||||
console->base_addr, console->buf_addr, console->bufsize);
|
||||
}
|
||||
|
||||
-
|
||||
-static void brcmf_pcie_bus_console_read(struct brcmf_pciedev_info *devinfo)
|
||||
+/**
|
||||
+ * brcmf_pcie_bus_console_read - reads firmware messages
|
||||
+ *
|
||||
+ * @error: specifies if error has occurred (prints messages unconditionally)
|
||||
+ */
|
||||
+static void brcmf_pcie_bus_console_read(struct brcmf_pciedev_info *devinfo,
|
||||
+ bool error)
|
||||
{
|
||||
+ struct pci_dev *pdev = devinfo->pdev;
|
||||
+ struct brcmf_bus *bus = dev_get_drvdata(&pdev->dev);
|
||||
struct brcmf_pcie_console *console;
|
||||
u32 addr;
|
||||
u8 ch;
|
||||
u32 newidx;
|
||||
|
||||
- if (!BRCMF_FWCON_ON())
|
||||
+ if (!error && !BRCMF_FWCON_ON())
|
||||
return;
|
||||
|
||||
console = &devinfo->shared.console;
|
||||
@@ -796,7 +803,10 @@ static void brcmf_pcie_bus_console_read(
|
||||
}
|
||||
if (ch == '\n') {
|
||||
console->log_str[console->log_idx] = 0;
|
||||
- pr_debug("CONSOLE: %s", console->log_str);
|
||||
+ if (error)
|
||||
+ brcmf_err(bus, "CONSOLE: %s", console->log_str);
|
||||
+ else
|
||||
+ pr_debug("CONSOLE: %s", console->log_str);
|
||||
console->log_idx = 0;
|
||||
}
|
||||
}
|
||||
@@ -857,7 +867,7 @@ static irqreturn_t brcmf_pcie_isr_thread
|
||||
&devinfo->pdev->dev);
|
||||
}
|
||||
}
|
||||
- brcmf_pcie_bus_console_read(devinfo);
|
||||
+ brcmf_pcie_bus_console_read(devinfo, false);
|
||||
if (devinfo->state == BRCMFMAC_PCIE_STATE_UP)
|
||||
brcmf_pcie_intr_enable(devinfo);
|
||||
devinfo->in_irq = false;
|
||||
@@ -1426,6 +1436,8 @@ static int brcmf_pcie_reset(struct devic
|
||||
struct brcmf_fw_request *fwreq;
|
||||
int err;
|
||||
|
||||
+ brcmf_pcie_bus_console_read(devinfo, true);
|
||||
+
|
||||
brcmf_detach(dev);
|
||||
|
||||
brcmf_pcie_release_irq(devinfo);
|
||||
@@ -1818,7 +1830,7 @@ static void brcmf_pcie_setup(struct devi
|
||||
if (brcmf_attach(&devinfo->pdev->dev, devinfo->settings) == 0)
|
||||
return;
|
||||
|
||||
- brcmf_pcie_bus_console_read(devinfo);
|
||||
+ brcmf_pcie_bus_console_read(devinfo, false);
|
||||
|
||||
fail:
|
||||
device_release_driver(dev);
|
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,24 @@
|
||||
From b07e1ae2ce53a60af67009ef199603a588003e07 Mon Sep 17 00:00:00 2001
|
||||
From: Weitao Hou <houweitaoo@gmail.com>
|
||||
Date: Mon, 20 May 2019 20:28:25 +0800
|
||||
Subject: [PATCH] brcmfmac: fix typos in code comments
|
||||
|
||||
fix lengh to length
|
||||
|
||||
Signed-off-by: Weitao Hou <houweitaoo@gmail.com>
|
||||
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
|
||||
---
|
||||
drivers/net/wireless/broadcom/brcm80211/brcmfmac/fwil.c | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
--- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/fwil.c
|
||||
+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/fwil.c
|
||||
@@ -303,7 +303,7 @@ brcmf_create_bsscfg(s32 bsscfgidx, char
|
||||
return brcmf_create_iovar(name, data, datalen, buf, buflen);
|
||||
|
||||
prefixlen = strlen(prefix);
|
||||
- namelen = strlen(name) + 1; /* lengh of iovar name + null */
|
||||
+ namelen = strlen(name) + 1; /* length of iovar name + null */
|
||||
iolen = prefixlen + namelen + sizeof(bsscfgidx_le) + datalen;
|
||||
|
||||
if (buflen < iolen) {
|
@ -0,0 +1,26 @@
|
||||
From bbfab331e3abd9fa8767eea6bf5c4684cdd4b934 Mon Sep 17 00:00:00 2001
|
||||
From: Neo Jou <neojou@gmail.com>
|
||||
Date: Tue, 21 May 2019 17:12:20 +0800
|
||||
Subject: [PATCH] brcmfmac: use strlcpy() instead of strcpy()
|
||||
|
||||
The function strcpy() is inherently not safe. Though the function
|
||||
works without problems here, it would be better to use other safer
|
||||
function, e.g. strlcpy(), to replace strcpy() still.
|
||||
|
||||
Signed-off-by: Neo Jou <neojou@gmail.com>
|
||||
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
|
||||
---
|
||||
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
|
||||
@@ -258,7 +258,7 @@ int brcmf_c_preinit_dcmds(struct brcmf_i
|
||||
|
||||
/* query for 'ver' to get version info from firmware */
|
||||
memset(buf, 0, sizeof(buf));
|
||||
- strcpy(buf, "ver");
|
||||
+ strlcpy(buf, "ver", sizeof(buf));
|
||||
err = brcmf_fil_iovar_data_get(ifp, "ver", buf, sizeof(buf));
|
||||
if (err < 0) {
|
||||
bphy_err(drvr, "Retrieving version information failed, %d\n",
|
@ -0,0 +1,56 @@
|
||||
From f491645f039420fb7e14283e21b90772571c807c Mon Sep 17 00:00:00 2001
|
||||
From: Arend van Spriel <arend.vanspriel@broadcom.com>
|
||||
Date: Thu, 11 Jul 2019 10:45:30 +0200
|
||||
Subject: [PATCH] brcmfmac: add 160MHz in chandef_to_chanspec()
|
||||
|
||||
The function chandef_to_chanspec() was not handling 160MHz bandwidth
|
||||
resulting in wrong encoding of the channel. That resulting in firmware
|
||||
rejecting the provided channel specification.
|
||||
|
||||
Reviewed-by: Hante Meuleman <hante.meuleman@broadcom.com>
|
||||
Reviewed-by: Pieter-Paul Giesberts <pieter-paul.giesberts@broadcom.com>
|
||||
Reviewed-by: Franky Lin <franky.lin@broadcom.com>
|
||||
Signed-off-by: Arend van Spriel <arend.vanspriel@broadcom.com>
|
||||
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
|
||||
---
|
||||
.../broadcom/brcm80211/brcmfmac/cfg80211.c | 21 ++++++++++++++++++-
|
||||
1 file changed, 20 insertions(+), 1 deletion(-)
|
||||
|
||||
--- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c
|
||||
+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c
|
||||
@@ -276,8 +276,26 @@ static u16 chandef_to_chanspec(struct br
|
||||
else
|
||||
ch_inf.sb = BRCMU_CHAN_SB_UU;
|
||||
break;
|
||||
- case NL80211_CHAN_WIDTH_80P80:
|
||||
case NL80211_CHAN_WIDTH_160:
|
||||
+ ch_inf.bw = BRCMU_CHAN_BW_160;
|
||||
+ if (primary_offset == -70)
|
||||
+ ch_inf.sb = BRCMU_CHAN_SB_LLL;
|
||||
+ else if (primary_offset == -50)
|
||||
+ ch_inf.sb = BRCMU_CHAN_SB_LLU;
|
||||
+ else if (primary_offset == -30)
|
||||
+ ch_inf.sb = BRCMU_CHAN_SB_LUL;
|
||||
+ else if (primary_offset == -10)
|
||||
+ ch_inf.sb = BRCMU_CHAN_SB_LUU;
|
||||
+ else if (primary_offset == 10)
|
||||
+ ch_inf.sb = BRCMU_CHAN_SB_ULL;
|
||||
+ else if (primary_offset == 30)
|
||||
+ ch_inf.sb = BRCMU_CHAN_SB_ULU;
|
||||
+ else if (primary_offset == 50)
|
||||
+ ch_inf.sb = BRCMU_CHAN_SB_UUL;
|
||||
+ else
|
||||
+ ch_inf.sb = BRCMU_CHAN_SB_UUU;
|
||||
+ break;
|
||||
+ case NL80211_CHAN_WIDTH_80P80:
|
||||
case NL80211_CHAN_WIDTH_5:
|
||||
case NL80211_CHAN_WIDTH_10:
|
||||
default:
|
||||
@@ -296,6 +314,7 @@ static u16 chandef_to_chanspec(struct br
|
||||
}
|
||||
d11inf->encchspec(&ch_inf);
|
||||
|
||||
+ brcmf_dbg(TRACE, "chanspec: 0x%x\n", ch_inf.chspec);
|
||||
return ch_inf.chspec;
|
||||
}
|
||||
|
@ -0,0 +1,63 @@
|
||||
From 011a56a3336a5de9c3152c169cd52ff79b8c3f89 Mon Sep 17 00:00:00 2001
|
||||
From: Arend van Spriel <arend.vanspriel@broadcom.com>
|
||||
Date: Thu, 11 Jul 2019 10:45:31 +0200
|
||||
Subject: [PATCH] brcmfmac: enable DFS_OFFLOAD extended feature if supported
|
||||
|
||||
If the firmware supports 802.11h and the device can operate in 5GHz
|
||||
band we can enable DFS_OFFLOAD extended feature.
|
||||
|
||||
Reviewed-by: Hante Meuleman <hante.meuleman@broadcom.com>
|
||||
Reviewed-by: Pieter-Paul Giesberts <pieter-paul.giesberts@broadcom.com>
|
||||
Reviewed-by: Franky Lin <franky.lin@broadcom.com>
|
||||
Signed-off-by: Arend van Spriel <arend.vanspriel@broadcom.com>
|
||||
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
|
||||
---
|
||||
drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c | 5 +++++
|
||||
drivers/net/wireless/broadcom/brcm80211/brcmfmac/feature.c | 1 +
|
||||
drivers/net/wireless/broadcom/brcm80211/brcmfmac/feature.h | 4 +++-
|
||||
3 files changed, 9 insertions(+), 1 deletion(-)
|
||||
|
||||
--- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c
|
||||
+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c
|
||||
@@ -6725,6 +6725,11 @@ static int brcmf_setup_wiphy(struct wiph
|
||||
}
|
||||
}
|
||||
|
||||
+ if (wiphy->bands[NL80211_BAND_5GHZ] &&
|
||||
+ brcmf_feat_is_enabled(ifp, BRCMF_FEAT_DOT11H))
|
||||
+ wiphy_ext_feature_set(wiphy,
|
||||
+ NL80211_EXT_FEATURE_DFS_OFFLOAD);
|
||||
+
|
||||
wiphy_read_of_freq_limits(wiphy);
|
||||
|
||||
return 0;
|
||||
--- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/feature.c
|
||||
+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/feature.c
|
||||
@@ -39,6 +39,7 @@ static const struct brcmf_feat_fwcap brc
|
||||
{ BRCMF_FEAT_P2P, "p2p" },
|
||||
{ BRCMF_FEAT_MONITOR, "monitor" },
|
||||
{ BRCMF_FEAT_MONITOR_FMT_RADIOTAP, "rtap" },
|
||||
+ { BRCMF_FEAT_DOT11H, "802.11h" }
|
||||
};
|
||||
|
||||
#ifdef DEBUG
|
||||
--- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/feature.h
|
||||
+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/feature.h
|
||||
@@ -25,6 +25,7 @@
|
||||
* 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
|
||||
+ * DOT11H: firmware supports 802.11h
|
||||
*/
|
||||
#define BRCMF_FEAT_LIST \
|
||||
BRCMF_FEAT_DEF(MBSS) \
|
||||
@@ -43,7 +44,8 @@
|
||||
BRCMF_FEAT_DEF(FWSUP) \
|
||||
BRCMF_FEAT_DEF(MONITOR) \
|
||||
BRCMF_FEAT_DEF(MONITOR_FMT_RADIOTAP) \
|
||||
- BRCMF_FEAT_DEF(MONITOR_FMT_HW_RX_HDR)
|
||||
+ BRCMF_FEAT_DEF(MONITOR_FMT_HW_RX_HDR) \
|
||||
+ BRCMF_FEAT_DEF(DOT11H)
|
||||
|
||||
/*
|
||||
* Quirks:
|
@ -0,0 +1,34 @@
|
||||
From fa9050927fa885410055ee03c948c2252693d296 Mon Sep 17 00:00:00 2001
|
||||
From: Arend van Spriel <arend.vanspriel@broadcom.com>
|
||||
Date: Thu, 11 Jul 2019 10:45:32 +0200
|
||||
Subject: [PATCH] brcmfmac: allow 160MHz in custom regulatory rules
|
||||
|
||||
The driver has custom regulatory rules which had maximum bandwidth
|
||||
for 5GHz channels set to 80MHz. As a consequence the driver can
|
||||
not use 160MHz in AP mode even when the device supports it. So
|
||||
relax the rules allowing 160MHz. After wiphy_register() the channel
|
||||
flags are updated according what the device actually supports.
|
||||
|
||||
Reviewed-by: Hante Meuleman <hante.meuleman@broadcom.com>
|
||||
Reviewed-by: Pieter-Paul Giesberts <pieter-paul.giesberts@broadcom.com>
|
||||
Reviewed-by: Franky Lin <franky.lin@broadcom.com>
|
||||
Signed-off-by: Arend van Spriel <arend.vanspriel@broadcom.com>
|
||||
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
|
||||
---
|
||||
drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c | 4 ++--
|
||||
1 file changed, 2 insertions(+), 2 deletions(-)
|
||||
|
||||
--- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c
|
||||
+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c
|
||||
@@ -189,9 +189,9 @@ static const struct ieee80211_regdomain
|
||||
*/
|
||||
REG_RULE(2484-10, 2484+10, 20, 6, 20, 0),
|
||||
/* IEEE 802.11a, channel 36..64 */
|
||||
- REG_RULE(5150-10, 5350+10, 80, 6, 20, 0),
|
||||
+ REG_RULE(5150-10, 5350+10, 160, 6, 20, 0),
|
||||
/* IEEE 802.11a, channel 100..165 */
|
||||
- REG_RULE(5470-10, 5850+10, 80, 6, 20, 0), }
|
||||
+ REG_RULE(5470-10, 5850+10, 160, 6, 20, 0), }
|
||||
};
|
||||
|
||||
/* Note: brcmf_cipher_suites is an array of int defining which cipher suites
|
@ -0,0 +1,168 @@
|
||||
From a84a60ccdd65278485fb495f468a5ab91a75c649 Mon Sep 17 00:00:00 2001
|
||||
From: Arend van Spriel <arend.vanspriel@broadcom.com>
|
||||
Date: Thu, 11 Jul 2019 11:05:06 +0200
|
||||
Subject: [PATCH] Revert "brcmfmac: fix NULL pointer derefence during USB
|
||||
disconnect"
|
||||
|
||||
This reverts commit 5cdb0ef6144f47440850553579aa923c20a63f23. Subsequent
|
||||
changes make rework the driver code fixing the issue differently.
|
||||
|
||||
Signed-off-by: Arend van Spriel <arend.vanspriel@broadcom.com>
|
||||
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
|
||||
---
|
||||
.../wireless/broadcom/brcm80211/brcmfmac/bcdc.c | 11 ++---------
|
||||
.../wireless/broadcom/brcm80211/brcmfmac/bcdc.h | 6 ++----
|
||||
.../wireless/broadcom/brcm80211/brcmfmac/core.c | 4 +---
|
||||
.../broadcom/brcm80211/brcmfmac/fwsignal.c | 16 ++++------------
|
||||
.../broadcom/brcm80211/brcmfmac/fwsignal.h | 3 +--
|
||||
.../wireless/broadcom/brcm80211/brcmfmac/proto.c | 10 ++--------
|
||||
.../wireless/broadcom/brcm80211/brcmfmac/proto.h | 3 +--
|
||||
7 files changed, 13 insertions(+), 40 deletions(-)
|
||||
|
||||
--- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/bcdc.c
|
||||
+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/bcdc.c
|
||||
@@ -479,18 +479,11 @@ fail:
|
||||
return -ENOMEM;
|
||||
}
|
||||
|
||||
-void brcmf_proto_bcdc_detach_pre_delif(struct brcmf_pub *drvr)
|
||||
-{
|
||||
- struct brcmf_bcdc *bcdc = drvr->proto->pd;
|
||||
-
|
||||
- brcmf_fws_detach_pre_delif(bcdc->fws);
|
||||
-}
|
||||
-
|
||||
-void brcmf_proto_bcdc_detach_post_delif(struct brcmf_pub *drvr)
|
||||
+void brcmf_proto_bcdc_detach(struct brcmf_pub *drvr)
|
||||
{
|
||||
struct brcmf_bcdc *bcdc = drvr->proto->pd;
|
||||
|
||||
drvr->proto->pd = NULL;
|
||||
- brcmf_fws_detach_post_delif(bcdc->fws);
|
||||
+ brcmf_fws_detach(bcdc->fws);
|
||||
kfree(bcdc);
|
||||
}
|
||||
--- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/bcdc.h
|
||||
+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/bcdc.h
|
||||
@@ -7,16 +7,14 @@
|
||||
|
||||
#ifdef CPTCFG_BRCMFMAC_PROTO_BCDC
|
||||
int brcmf_proto_bcdc_attach(struct brcmf_pub *drvr);
|
||||
-void brcmf_proto_bcdc_detach_pre_delif(struct brcmf_pub *drvr);
|
||||
-void brcmf_proto_bcdc_detach_post_delif(struct brcmf_pub *drvr);
|
||||
+void brcmf_proto_bcdc_detach(struct brcmf_pub *drvr);
|
||||
void brcmf_proto_bcdc_txflowblock(struct device *dev, bool state);
|
||||
void brcmf_proto_bcdc_txcomplete(struct device *dev, struct sk_buff *txp,
|
||||
bool success);
|
||||
struct brcmf_fws_info *drvr_to_fws(struct brcmf_pub *drvr);
|
||||
#else
|
||||
static inline int brcmf_proto_bcdc_attach(struct brcmf_pub *drvr) { return 0; }
|
||||
-static void brcmf_proto_bcdc_detach_pre_delif(struct brcmf_pub *drvr) {};
|
||||
-static inline void brcmf_proto_bcdc_detach_post_delif(struct brcmf_pub *drvr) {}
|
||||
+static inline void brcmf_proto_bcdc_detach(struct brcmf_pub *drvr) {}
|
||||
#endif
|
||||
|
||||
#endif /* BRCMFMAC_BCDC_H */
|
||||
--- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/core.c
|
||||
+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/core.c
|
||||
@@ -1335,8 +1335,6 @@ void brcmf_detach(struct device *dev)
|
||||
|
||||
brcmf_bus_change_state(bus_if, BRCMF_BUS_DOWN);
|
||||
|
||||
- brcmf_proto_detach_pre_delif(drvr);
|
||||
-
|
||||
/* make sure primary interface removed last */
|
||||
for (i = BRCMF_MAX_IFS-1; i > -1; i--)
|
||||
brcmf_remove_interface(drvr->iflist[i], false);
|
||||
@@ -1346,7 +1344,7 @@ void brcmf_detach(struct device *dev)
|
||||
|
||||
brcmf_bus_stop(drvr->bus_if);
|
||||
|
||||
- brcmf_proto_detach_post_delif(drvr);
|
||||
+ brcmf_proto_detach(drvr);
|
||||
|
||||
bus_if->drvr = NULL;
|
||||
wiphy_free(drvr->wiphy);
|
||||
--- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/fwsignal.c
|
||||
+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/fwsignal.c
|
||||
@@ -2432,25 +2432,17 @@ struct brcmf_fws_info *brcmf_fws_attach(
|
||||
return fws;
|
||||
|
||||
fail:
|
||||
- brcmf_fws_detach_pre_delif(fws);
|
||||
- brcmf_fws_detach_post_delif(fws);
|
||||
+ brcmf_fws_detach(fws);
|
||||
return ERR_PTR(rc);
|
||||
}
|
||||
|
||||
-void brcmf_fws_detach_pre_delif(struct brcmf_fws_info *fws)
|
||||
+void brcmf_fws_detach(struct brcmf_fws_info *fws)
|
||||
{
|
||||
if (!fws)
|
||||
return;
|
||||
- if (fws->fws_wq) {
|
||||
- destroy_workqueue(fws->fws_wq);
|
||||
- fws->fws_wq = NULL;
|
||||
- }
|
||||
-}
|
||||
|
||||
-void brcmf_fws_detach_post_delif(struct brcmf_fws_info *fws)
|
||||
-{
|
||||
- if (!fws)
|
||||
- return;
|
||||
+ if (fws->fws_wq)
|
||||
+ destroy_workqueue(fws->fws_wq);
|
||||
|
||||
/* cleanup */
|
||||
brcmf_fws_lock(fws);
|
||||
--- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/fwsignal.h
|
||||
+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/fwsignal.h
|
||||
@@ -7,8 +7,7 @@
|
||||
#define FWSIGNAL_H_
|
||||
|
||||
struct brcmf_fws_info *brcmf_fws_attach(struct brcmf_pub *drvr);
|
||||
-void brcmf_fws_detach_pre_delif(struct brcmf_fws_info *fws);
|
||||
-void brcmf_fws_detach_post_delif(struct brcmf_fws_info *fws);
|
||||
+void brcmf_fws_detach(struct brcmf_fws_info *fws);
|
||||
void brcmf_fws_debugfs_create(struct brcmf_pub *drvr);
|
||||
bool brcmf_fws_queue_skbs(struct brcmf_fws_info *fws);
|
||||
bool brcmf_fws_fc_active(struct brcmf_fws_info *fws);
|
||||
--- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/proto.c
|
||||
+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/proto.c
|
||||
@@ -56,22 +56,16 @@ fail:
|
||||
return -ENOMEM;
|
||||
}
|
||||
|
||||
-void brcmf_proto_detach_post_delif(struct brcmf_pub *drvr)
|
||||
+void brcmf_proto_detach(struct brcmf_pub *drvr)
|
||||
{
|
||||
brcmf_dbg(TRACE, "Enter\n");
|
||||
|
||||
if (drvr->proto) {
|
||||
if (drvr->bus_if->proto_type == BRCMF_PROTO_BCDC)
|
||||
- brcmf_proto_bcdc_detach_post_delif(drvr);
|
||||
+ brcmf_proto_bcdc_detach(drvr);
|
||||
else if (drvr->bus_if->proto_type == BRCMF_PROTO_MSGBUF)
|
||||
brcmf_proto_msgbuf_detach(drvr);
|
||||
kfree(drvr->proto);
|
||||
drvr->proto = NULL;
|
||||
}
|
||||
}
|
||||
-
|
||||
-void brcmf_proto_detach_pre_delif(struct brcmf_pub *drvr)
|
||||
-{
|
||||
- if (drvr->proto && drvr->bus_if->proto_type == BRCMF_PROTO_BCDC)
|
||||
- brcmf_proto_bcdc_detach_pre_delif(drvr);
|
||||
-}
|
||||
--- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/proto.h
|
||||
+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/proto.h
|
||||
@@ -43,8 +43,7 @@ struct brcmf_proto {
|
||||
|
||||
|
||||
int brcmf_proto_attach(struct brcmf_pub *drvr);
|
||||
-void brcmf_proto_detach_pre_delif(struct brcmf_pub *drvr);
|
||||
-void brcmf_proto_detach_post_delif(struct brcmf_pub *drvr);
|
||||
+void brcmf_proto_detach(struct brcmf_pub *drvr);
|
||||
|
||||
static inline int brcmf_proto_hdrpull(struct brcmf_pub *drvr, bool do_fws,
|
||||
struct sk_buff *skb,
|
@ -0,0 +1,67 @@
|
||||
From 14fcfd1cc0c05ea58f47dd693fdd13f25dfe995e Mon Sep 17 00:00:00 2001
|
||||
From: Arend van Spriel <arend.vanspriel@broadcom.com>
|
||||
Date: Thu, 11 Jul 2019 11:05:07 +0200
|
||||
Subject: [PATCH] brcmfmac: change the order of things in brcmf_detach()
|
||||
MIME-Version: 1.0
|
||||
Content-Type: text/plain; charset=UTF-8
|
||||
Content-Transfer-Encoding: 8bit
|
||||
|
||||
When brcmf_detach() from the bus layer upon rmmod we can no longer
|
||||
communicate. Hence we will set the bus state to DOWN and cleanup
|
||||
the event and protocol layer. The network interfaces need to be
|
||||
deleted before brcmf_cfg80211_detach() because the latter does the
|
||||
wiphy_unregister() which issues a warning if there are still network
|
||||
devices linked to the wiphy instance.
|
||||
|
||||
Reviewed-by: Hante Meuleman <hante.meuleman@broadcom.com>
|
||||
Reviewed-by: Pieter-Paul Giesberts <pieter-paul.giesberts@broadcom.com>
|
||||
Reviewed-by: Franky Lin <franky.lin@broadcom.com>
|
||||
Signed-off-by: Arend van Spriel <arend.vanspriel@broadcom.com>
|
||||
Tested-by: Rafał Miłecki <rafal@milecki.pl>
|
||||
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
|
||||
---
|
||||
.../broadcom/brcm80211/brcmfmac/core.c | 27 ++++++++++---------
|
||||
1 file changed, 14 insertions(+), 13 deletions(-)
|
||||
|
||||
--- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/core.c
|
||||
+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/core.c
|
||||
@@ -1328,25 +1328,26 @@ void brcmf_detach(struct device *dev)
|
||||
unregister_inet6addr_notifier(&drvr->inet6addr_notifier);
|
||||
#endif
|
||||
|
||||
- /* stop firmware event handling */
|
||||
- brcmf_fweh_detach(drvr);
|
||||
- if (drvr->config)
|
||||
- brcmf_p2p_detach(&drvr->config->p2p);
|
||||
-
|
||||
brcmf_bus_change_state(bus_if, BRCMF_BUS_DOWN);
|
||||
-
|
||||
- /* make sure primary interface removed last */
|
||||
- for (i = BRCMF_MAX_IFS-1; i > -1; i--)
|
||||
- brcmf_remove_interface(drvr->iflist[i], false);
|
||||
-
|
||||
- brcmf_cfg80211_detach(drvr->config);
|
||||
- drvr->config = NULL;
|
||||
-
|
||||
brcmf_bus_stop(drvr->bus_if);
|
||||
|
||||
+ brcmf_fweh_detach(drvr);
|
||||
brcmf_proto_detach(drvr);
|
||||
|
||||
+ /* make sure primary interface removed last */
|
||||
+ for (i = BRCMF_MAX_IFS - 1; i > -1; i--) {
|
||||
+ if (drvr->iflist[i])
|
||||
+ brcmf_del_if(drvr, drvr->iflist[i]->bsscfgidx, false);
|
||||
+ }
|
||||
+
|
||||
+ if (drvr->config) {
|
||||
+ brcmf_p2p_detach(&drvr->config->p2p);
|
||||
+ brcmf_cfg80211_detach(drvr->config);
|
||||
+ drvr->config = NULL;
|
||||
+ }
|
||||
+
|
||||
bus_if->drvr = NULL;
|
||||
+
|
||||
wiphy_free(drvr->wiphy);
|
||||
}
|
||||
|
@ -0,0 +1,30 @@
|
||||
From c613085b74941024194e41b200601b9aa6ee388f Mon Sep 17 00:00:00 2001
|
||||
From: Arend van Spriel <arend.vanspriel@broadcom.com>
|
||||
Date: Thu, 11 Jul 2019 11:05:08 +0200
|
||||
Subject: [PATCH] brcmfmac: avoid firmware command in brcmf_netdev_open() when
|
||||
bus is down
|
||||
|
||||
No point in sending a firmware command when bus is down so make it
|
||||
conditional checking the state.
|
||||
|
||||
Reviewed-by: Hante Meuleman <hante.meuleman@broadcom.com>
|
||||
Reviewed-by: Pieter-Paul Giesberts <pieter-paul.giesberts@broadcom.com>
|
||||
Reviewed-by: Franky Lin <franky.lin@broadcom.com>
|
||||
Signed-off-by: Arend van Spriel <arend.vanspriel@broadcom.com>
|
||||
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
|
||||
---
|
||||
drivers/net/wireless/broadcom/brcm80211/brcmfmac/core.c | 3 ++-
|
||||
1 file changed, 2 insertions(+), 1 deletion(-)
|
||||
|
||||
--- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/core.c
|
||||
+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/core.c
|
||||
@@ -579,7 +579,8 @@ static int brcmf_netdev_stop(struct net_
|
||||
|
||||
brcmf_cfg80211_down(ndev);
|
||||
|
||||
- brcmf_fil_iovar_data_set(ifp, "arp_hostip_clear", NULL, 0);
|
||||
+ if (ifp->drvr->bus_if->state == BRCMF_BUS_UP)
|
||||
+ brcmf_fil_iovar_data_set(ifp, "arp_hostip_clear", NULL, 0);
|
||||
|
||||
brcmf_net_setcarrier(ifp, false);
|
||||
|
@ -0,0 +1,38 @@
|
||||
From c33330ac06fe863289643e7a13ecdb6a2502dad7 Mon Sep 17 00:00:00 2001
|
||||
From: Arend van Spriel <arend.vanspriel@broadcom.com>
|
||||
Date: Thu, 11 Jul 2019 11:05:09 +0200
|
||||
Subject: [PATCH] brcmfmac: clear events in brcmf_fweh_detach() will always
|
||||
fail
|
||||
|
||||
Clearing firmware events in brcmf_fweh_detach() is always failing
|
||||
because it is called only upon driver remove and communication
|
||||
with firmware is no longer possible.
|
||||
|
||||
Reviewed-by: Hante Meuleman <hante.meuleman@broadcom.com>
|
||||
Reviewed-by: Pieter-Paul Giesberts <pieter-paul.giesberts@broadcom.com>
|
||||
Reviewed-by: Franky Lin <franky.lin@broadcom.com>
|
||||
Signed-off-by: Arend van Spriel <arend.vanspriel@broadcom.com>
|
||||
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
|
||||
---
|
||||
drivers/net/wireless/broadcom/brcm80211/brcmfmac/fweh.c | 9 ---------
|
||||
1 file changed, 9 deletions(-)
|
||||
|
||||
--- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/fweh.c
|
||||
+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/fweh.c
|
||||
@@ -303,16 +303,7 @@ void brcmf_fweh_attach(struct brcmf_pub
|
||||
void brcmf_fweh_detach(struct brcmf_pub *drvr)
|
||||
{
|
||||
struct brcmf_fweh_info *fweh = &drvr->fweh;
|
||||
- struct brcmf_if *ifp = brcmf_get_ifp(drvr, 0);
|
||||
- s8 eventmask[BRCMF_EVENTING_MASK_LEN];
|
||||
|
||||
- if (ifp) {
|
||||
- /* clear all events */
|
||||
- memset(eventmask, 0, BRCMF_EVENTING_MASK_LEN);
|
||||
- (void)brcmf_fil_iovar_data_set(ifp, "event_msgs",
|
||||
- eventmask,
|
||||
- BRCMF_EVENTING_MASK_LEN);
|
||||
- }
|
||||
/* cancel the worker */
|
||||
cancel_work_sync(&fweh->event_work);
|
||||
WARN_ON(!list_empty(&fweh->event_q));
|
@ -0,0 +1,79 @@
|
||||
From 1ac11ae949dd883854f4523ef8e3a32aabfd6256 Mon Sep 17 00:00:00 2001
|
||||
From: Arend van Spriel <arend.vanspriel@broadcom.com>
|
||||
Date: Thu, 11 Jul 2019 11:05:10 +0200
|
||||
Subject: [PATCH] brcmfmac: avoid firmware commands when bus is down
|
||||
|
||||
Upon rmmod a few attempts are made to inform firmware, but there is
|
||||
no point as the bus is down and these will fail. Avoid them to keep
|
||||
the logs clean.
|
||||
|
||||
Reported-by: Stefan Wahren <stefan.wahren@i2se.com>
|
||||
Reviewed-by: Hante Meuleman <hante.meuleman@broadcom.com>
|
||||
Reviewed-by: Pieter-Paul Giesberts <pieter-paul.giesberts@broadcom.com>
|
||||
Reviewed-by: Franky Lin <franky.lin@broadcom.com>
|
||||
Signed-off-by: Arend van Spriel <arend.vanspriel@broadcom.com>
|
||||
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
|
||||
---
|
||||
.../broadcom/brcm80211/brcmfmac/cfg80211.c | 23 +++++++++++--------
|
||||
1 file changed, 13 insertions(+), 10 deletions(-)
|
||||
|
||||
--- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c
|
||||
+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c
|
||||
@@ -1286,17 +1286,21 @@ static void brcmf_link_down(struct brcmf
|
||||
{
|
||||
struct brcmf_cfg80211_info *cfg = wiphy_to_cfg(vif->wdev.wiphy);
|
||||
struct brcmf_pub *drvr = cfg->pub;
|
||||
+ bool bus_up = drvr->bus_if->state == BRCMF_BUS_UP;
|
||||
s32 err = 0;
|
||||
|
||||
brcmf_dbg(TRACE, "Enter\n");
|
||||
|
||||
if (test_and_clear_bit(BRCMF_VIF_STATUS_CONNECTED, &vif->sme_state)) {
|
||||
- brcmf_dbg(INFO, "Call WLC_DISASSOC to stop excess roaming\n");
|
||||
- err = brcmf_fil_cmd_data_set(vif->ifp,
|
||||
- BRCMF_C_DISASSOC, NULL, 0);
|
||||
- if (err) {
|
||||
- bphy_err(drvr, "WLC_DISASSOC failed (%d)\n", err);
|
||||
+ if (bus_up) {
|
||||
+ brcmf_dbg(INFO, "Call WLC_DISASSOC to stop excess roaming\n");
|
||||
+ err = brcmf_fil_cmd_data_set(vif->ifp,
|
||||
+ BRCMF_C_DISASSOC, NULL, 0);
|
||||
+ if (err)
|
||||
+ bphy_err(drvr, "WLC_DISASSOC failed (%d)\n",
|
||||
+ err);
|
||||
}
|
||||
+
|
||||
if ((vif->wdev.iftype == NL80211_IFTYPE_STATION) ||
|
||||
(vif->wdev.iftype == NL80211_IFTYPE_P2P_CLIENT))
|
||||
cfg80211_disconnected(vif->wdev.netdev, reason, NULL, 0,
|
||||
@@ -1306,7 +1310,8 @@ static void brcmf_link_down(struct brcmf
|
||||
clear_bit(BRCMF_SCAN_STATUS_SUPPRESS, &cfg->scan_status);
|
||||
brcmf_btcoex_set_mode(vif, BRCMF_BTCOEX_ENABLED, 0);
|
||||
if (vif->profile.use_fwsup != BRCMF_PROFILE_FWSUP_NONE) {
|
||||
- brcmf_set_pmk(vif->ifp, NULL, 0);
|
||||
+ if (bus_up)
|
||||
+ brcmf_set_pmk(vif->ifp, NULL, 0);
|
||||
vif->profile.use_fwsup = BRCMF_PROFILE_FWSUP_NONE;
|
||||
}
|
||||
brcmf_dbg(TRACE, "Exit\n");
|
||||
@@ -4996,18 +5001,16 @@ 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;
|
||||
enum nl80211_chan_width width = 0;
|
||||
u32 chanspec;
|
||||
int freq, err;
|
||||
|
||||
- if (!ndev)
|
||||
+ if (!ndev || drvr->bus_if->state != BRCMF_BUS_UP)
|
||||
return -ENODEV;
|
||||
- ifp = netdev_priv(ndev);
|
||||
|
||||
- err = brcmf_fil_iovar_int_get(ifp, "chanspec", &chanspec);
|
||||
+ err = brcmf_fil_iovar_int_get(netdev_priv(ndev), "chanspec", &chanspec);
|
||||
if (err) {
|
||||
bphy_err(drvr, "chanspec failed (%d)\n", err);
|
||||
return err;
|
@ -0,0 +1,33 @@
|
||||
From e0bfb9601d4812719167cc4124a0d6db1e2f55e4 Mon Sep 17 00:00:00 2001
|
||||
From: Arend van Spriel <arend.vanspriel@broadcom.com>
|
||||
Date: Thu, 11 Jul 2019 11:05:11 +0200
|
||||
Subject: [PATCH] brcmfmac: simply remove flowring if bus is down
|
||||
|
||||
When the bus is down, eg. due to rmmod, there is no need to
|
||||
attempt to inform firmware about it.
|
||||
|
||||
Reviewed-by: Hante Meuleman <hante.meuleman@broadcom.com>
|
||||
Reviewed-by: Pieter-Paul Giesberts <pieter-paul.giesberts@broadcom.com>
|
||||
Reviewed-by: Franky Lin <franky.lin@broadcom.com>
|
||||
Signed-off-by: Arend van Spriel <arend.vanspriel@broadcom.com>
|
||||
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
|
||||
---
|
||||
drivers/net/wireless/broadcom/brcm80211/brcmfmac/msgbuf.c | 7 +++++++
|
||||
1 file changed, 7 insertions(+)
|
||||
|
||||
--- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/msgbuf.c
|
||||
+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/msgbuf.c
|
||||
@@ -1398,6 +1398,13 @@ void brcmf_msgbuf_delete_flowring(struct
|
||||
u8 ifidx;
|
||||
int err;
|
||||
|
||||
+ /* no need to submit if firmware can not be reached */
|
||||
+ if (drvr->bus_if->state != BRCMF_BUS_UP) {
|
||||
+ brcmf_dbg(MSGBUF, "bus down, flowring will be removed\n");
|
||||
+ brcmf_msgbuf_remove_flowring(msgbuf, flowid);
|
||||
+ return;
|
||||
+ }
|
||||
+
|
||||
commonring = msgbuf->commonrings[BRCMF_H2D_MSGRING_CONTROL_SUBMIT];
|
||||
brcmf_commonring_lock(commonring);
|
||||
ret_ptr = brcmf_commonring_reserve_for_write(commonring);
|
@ -0,0 +1,28 @@
|
||||
From 4b11c915f00caeef3292ed0429acc579b9da762a Mon Sep 17 00:00:00 2001
|
||||
From: Arend van Spriel <arend.vanspriel@broadcom.com>
|
||||
Date: Thu, 11 Jul 2019 11:05:12 +0200
|
||||
Subject: [PATCH] brcmfmac: remove unnecessary strlcpy() upon obtaining "ver"
|
||||
iovar
|
||||
|
||||
Recently a strcpy() was replaced by strlcpy(). However, the strcpy()
|
||||
was not needed in the first place. So removing that line of code.
|
||||
|
||||
Reviewed-by: Hante Meuleman <hante.meuleman@broadcom.com>
|
||||
Reviewed-by: Pieter-Paul Giesberts <pieter-paul.giesberts@broadcom.com>
|
||||
Reviewed-by: Franky Lin <franky.lin@broadcom.com>
|
||||
Signed-off-by: Arend van Spriel <arend.vanspriel@broadcom.com>
|
||||
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
|
||||
---
|
||||
drivers/net/wireless/broadcom/brcm80211/brcmfmac/common.c | 1 -
|
||||
1 file changed, 1 deletion(-)
|
||||
|
||||
--- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/common.c
|
||||
+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/common.c
|
||||
@@ -258,7 +258,6 @@ int brcmf_c_preinit_dcmds(struct brcmf_i
|
||||
|
||||
/* query for 'ver' to get version info from firmware */
|
||||
memset(buf, 0, sizeof(buf));
|
||||
- strlcpy(buf, "ver", sizeof(buf));
|
||||
err = brcmf_fil_iovar_data_get(ifp, "ver", buf, sizeof(buf));
|
||||
if (err < 0) {
|
||||
bphy_err(drvr, "Retrieving version information failed, %d\n",
|
@ -0,0 +1,38 @@
|
||||
From e3b1d879ccda9ffd5332777bb1beeb2cc913faa8 Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= <rafal@milecki.pl>
|
||||
Date: Sun, 21 Jul 2019 21:52:17 +0200
|
||||
Subject: [PATCH] brcmfmac: don't net_ratelimit() CONSOLE messages on firmware
|
||||
crash
|
||||
MIME-Version: 1.0
|
||||
Content-Type: text/plain; charset=UTF-8
|
||||
Content-Transfer-Encoding: 8bit
|
||||
|
||||
Firmware crash is a pretty rare event and can't happen too frequently as
|
||||
it has to be followed by a hardware reinitialization and config reload.
|
||||
It should be safe to don't use net_ratelimit() when it happens.
|
||||
|
||||
For reporting & debugging purposes it's important to provide a complete
|
||||
log as the last lines are actually the most important. This change
|
||||
modifies brcmfmac to print all messages in an unlimited way in that
|
||||
specific case. With this change there should be finally a backtrace of
|
||||
firmware finally visible after a crash.
|
||||
|
||||
Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
|
||||
Acked-by: Arend van Spriel <arend.vanspriel@broadcom.com>
|
||||
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
|
||||
---
|
||||
drivers/net/wireless/broadcom/brcm80211/brcmfmac/pcie.c | 3 ++-
|
||||
1 file changed, 2 insertions(+), 1 deletion(-)
|
||||
|
||||
--- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/pcie.c
|
||||
+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/pcie.c
|
||||
@@ -794,7 +794,8 @@ static void brcmf_pcie_bus_console_read(
|
||||
if (ch == '\n') {
|
||||
console->log_str[console->log_idx] = 0;
|
||||
if (error)
|
||||
- brcmf_err(bus, "CONSOLE: %s", console->log_str);
|
||||
+ __brcmf_err(bus, __func__, "CONSOLE: %s",
|
||||
+ console->log_str);
|
||||
else
|
||||
pr_debug("CONSOLE: %s", console->log_str);
|
||||
console->log_idx = 0;
|
@ -0,0 +1,54 @@
|
||||
From cddecd92d1ec2fd05ed1123455e7c6cf6906b5a5 Mon Sep 17 00:00:00 2001
|
||||
From: YueHaibing <yuehaibing@huawei.com>
|
||||
Date: Wed, 24 Jul 2019 22:12:01 +0800
|
||||
Subject: [PATCH] brcmfmac: remove set but not used variable 'dtim_period'
|
||||
|
||||
Fixes gcc '-Wunused-but-set-variable' warning:
|
||||
|
||||
drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c: In function brcmf_update_bss_info:
|
||||
drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c:2962:5: warning: variable dtim_period set but not used [-Wunused-but-set-variable]
|
||||
drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c: In function brcmf_update_bss_info:
|
||||
drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c:2961:6: warning: variable beacon_interval set but not used [-Wunused-but-set-variable]
|
||||
|
||||
They are never used so can be removed.
|
||||
|
||||
Reported-by: Hulk Robot <hulkci@huawei.com>
|
||||
Signed-off-by: YueHaibing <yuehaibing@huawei.com>
|
||||
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
|
||||
---
|
||||
.../net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c | 8 +-------
|
||||
1 file changed, 1 insertion(+), 7 deletions(-)
|
||||
|
||||
--- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c
|
||||
+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c
|
||||
@@ -2974,8 +2974,6 @@ static s32 brcmf_update_bss_info(struct
|
||||
struct brcmf_pub *drvr = cfg->pub;
|
||||
struct brcmf_bss_info_le *bi;
|
||||
const struct brcmf_tlv *tim;
|
||||
- u16 beacon_interval;
|
||||
- u8 dtim_period;
|
||||
size_t ie_len;
|
||||
u8 *ie;
|
||||
s32 err = 0;
|
||||
@@ -2999,12 +2997,9 @@ static s32 brcmf_update_bss_info(struct
|
||||
|
||||
ie = ((u8 *)bi) + le16_to_cpu(bi->ie_offset);
|
||||
ie_len = le32_to_cpu(bi->ie_length);
|
||||
- beacon_interval = le16_to_cpu(bi->beacon_period);
|
||||
|
||||
tim = brcmf_parse_tlvs(ie, ie_len, WLAN_EID_TIM);
|
||||
- if (tim)
|
||||
- dtim_period = tim->data[1];
|
||||
- else {
|
||||
+ if (!tim) {
|
||||
/*
|
||||
* active scan was done so we could not get dtim
|
||||
* information out of probe response.
|
||||
@@ -3016,7 +3011,6 @@ static s32 brcmf_update_bss_info(struct
|
||||
bphy_err(drvr, "wl dtim_assoc failed (%d)\n", err);
|
||||
goto update_bss_info_out;
|
||||
}
|
||||
- dtim_period = (u8)var;
|
||||
}
|
||||
|
||||
update_bss_info_out:
|
@ -0,0 +1,26 @@
|
||||
From 73c742bb9c9ba30871fdd5c730d5ca8b6712833a Mon Sep 17 00:00:00 2001
|
||||
From: Colin Ian King <colin.king@canonical.com>
|
||||
Date: Fri, 9 Aug 2019 18:22:17 +0100
|
||||
Subject: [PATCH] brcmfmac: remove redundant assignment to pointer hash
|
||||
|
||||
The pointer hash is being initialized with a value that is never read
|
||||
and is being re-assigned a little later on. The assignment is
|
||||
redundant and hence can be removed.
|
||||
|
||||
Addresses-Coverity: ("Unused value")
|
||||
Signed-off-by: Colin Ian King <colin.king@canonical.com>
|
||||
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
|
||||
---
|
||||
drivers/net/wireless/broadcom/brcm80211/brcmfmac/msgbuf.c | 1 -
|
||||
1 file changed, 1 deletion(-)
|
||||
|
||||
--- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/msgbuf.c
|
||||
+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/msgbuf.c
|
||||
@@ -1468,7 +1468,6 @@ static int brcmf_msgbuf_stats_read(struc
|
||||
seq_printf(seq, "\nh2d_flowrings: depth %u\n",
|
||||
BRCMF_H2D_TXFLOWRING_MAX_ITEM);
|
||||
seq_puts(seq, "Active flowrings:\n");
|
||||
- hash = msgbuf->flow->hash;
|
||||
for (i = 0; i < msgbuf->flow->nrofrings; i++) {
|
||||
if (!msgbuf->flow->rings[i])
|
||||
continue;
|
@ -0,0 +1,36 @@
|
||||
From 5f42b382ead278c1f6c3854765c97eb20491aa2a Mon Sep 17 00:00:00 2001
|
||||
From: Xulin Sun <xulin.sun@windriver.com>
|
||||
Date: Fri, 23 Aug 2019 15:47:08 +0800
|
||||
Subject: [PATCH] brcmfmac: replace strncpy() by strscpy()
|
||||
|
||||
The strncpy() may truncate the copied string,
|
||||
replace it by the safer strscpy().
|
||||
|
||||
To avoid below compile warning with gcc 8.2:
|
||||
|
||||
drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c:In function 'brcmf_vndr_ie':
|
||||
drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c:4227:2:
|
||||
warning: 'strncpy' output truncated before terminating nul copying 3 bytes from a string of the same length [-Wstringop-truncation]
|
||||
strncpy(iebuf, add_del_cmd, VNDR_IE_CMD_LEN - 1);
|
||||
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
Signed-off-by: Xulin Sun <xulin.sun@windriver.com>
|
||||
Acked-by: Arend van Spriel <arend.vanspriel@broadcom.com>
|
||||
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
|
||||
---
|
||||
drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c | 4 +---
|
||||
1 file changed, 1 insertion(+), 3 deletions(-)
|
||||
|
||||
--- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c
|
||||
+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c
|
||||
@@ -4236,9 +4236,7 @@ next:
|
||||
static u32
|
||||
brcmf_vndr_ie(u8 *iebuf, s32 pktflag, u8 *ie_ptr, u32 ie_len, s8 *add_del_cmd)
|
||||
{
|
||||
-
|
||||
- strncpy(iebuf, add_del_cmd, VNDR_IE_CMD_LEN - 1);
|
||||
- iebuf[VNDR_IE_CMD_LEN - 1] = '\0';
|
||||
+ strscpy(iebuf, add_del_cmd, VNDR_IE_CMD_LEN);
|
||||
|
||||
put_unaligned_le32(1, &iebuf[VNDR_IE_COUNT_OFFSET]);
|
||||
|
@ -1,19 +1,29 @@
|
||||
From 82f93cf46d6007ffa003b2d4a2834563b6b84d21 Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= <rafal@milecki.pl>
|
||||
Subject: [PATCH] brcmfmac: get RAM info right before downloading PCIe firmware
|
||||
Date: Thu, 29 Aug 2019 10:27:01 +0200
|
||||
Subject: [PATCH] brcmfmac: get chip's default RAM info during PCIe setup
|
||||
MIME-Version: 1.0
|
||||
Content-Type: text/plain; charset=UTF-8
|
||||
Content-Transfer-Encoding: 8bit
|
||||
|
||||
It's important as brcmf_chip_get_raminfo() also makes sure that memory
|
||||
is properly setup. Without it the firmware could report invalid RAM
|
||||
address like 0x04000001.
|
||||
Getting RAM info just once per driver's lifetime (during chip
|
||||
recognition) is not enough as it may get adjusted later (depending on
|
||||
the used firmware). Subsequent inits may load different firmwares so a
|
||||
full RAM recognition is required on every PCIe setup. This is especially
|
||||
important since implementing hardware reset on a firmware crash.
|
||||
|
||||
During a normal brcmfmac lifetime brcmf_chip_get_raminfo() is called on
|
||||
probe by the brcmf_chip_recognition(). This change allows implementing
|
||||
further improvements like handling errors by resetting a device with
|
||||
the brcmf_pcie_reset_device() and redownloading a firmware afterwards.
|
||||
Moreover calling brcmf_chip_get_raminfo() makes sure that RAM core is
|
||||
up. It's important as having BCMA_CORE_SYS_MEM down on BCM4366 was
|
||||
resulting in firmware failing to initialize and following error:
|
||||
[ 65.657546] brcmfmac 0000:01:00.0: brcmf_pcie_download_fw_nvram: Invalid shared RAM address 0x04000001
|
||||
|
||||
This change makes brcmf_chip_get_raminfo() call during chip recognition
|
||||
redundant for PCIe devices but SDIO and USB still need it and it's a
|
||||
very small overhead anyway.
|
||||
|
||||
Fixes: 4684997d9eea ("brcmfmac: reset PCIe bus on a firmware crash")
|
||||
Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
|
||||
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
|
||||
---
|
||||
drivers/net/wireless/broadcom/brcm80211/brcmfmac/chip.c | 6 ++++--
|
||||
drivers/net/wireless/broadcom/brcm80211/brcmfmac/chip.h | 1 +
|
||||
@ -22,7 +32,7 @@ Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
|
||||
|
||||
--- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/chip.c
|
||||
+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/chip.c
|
||||
@@ -707,8 +707,10 @@ static u32 brcmf_chip_tcm_rambase(struct
|
||||
@@ -696,8 +696,10 @@ static u32 brcmf_chip_tcm_rambase(struct
|
||||
return 0;
|
||||
}
|
||||
|
||||
@ -34,7 +44,7 @@ Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
|
||||
struct brcmf_core_priv *mem_core;
|
||||
struct brcmf_core *mem;
|
||||
|
||||
@@ -990,7 +992,7 @@ static int brcmf_chip_recognition(struct
|
||||
@@ -979,7 +981,7 @@ static int brcmf_chip_recognition(struct
|
||||
brcmf_chip_set_passive(&ci->pub);
|
||||
}
|
||||
|
||||
@ -45,7 +55,7 @@ Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
|
||||
static void brcmf_chip_disable_arm(struct brcmf_chip_priv *chip, u16 id)
|
||||
--- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/chip.h
|
||||
+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/chip.h
|
||||
@@ -80,6 +80,7 @@ struct brcmf_buscore_ops {
|
||||
@@ -69,6 +69,7 @@ struct brcmf_buscore_ops {
|
||||
void (*activate)(void *ctx, struct brcmf_chip *chip, u32 rstvec);
|
||||
};
|
||||
|
||||
@ -55,7 +65,7 @@ Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
|
||||
void brcmf_chip_detach(struct brcmf_chip *chip);
|
||||
--- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/pcie.c
|
||||
+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/pcie.c
|
||||
@@ -1762,6 +1762,12 @@ static void brcmf_pcie_setup(struct devi
|
||||
@@ -1770,6 +1770,12 @@ static void brcmf_pcie_setup(struct devi
|
||||
nvram_len = fwreq->items[BRCMF_PCIE_FW_NVRAM].nv_data.len;
|
||||
kfree(fwreq);
|
||||
|
@ -0,0 +1,31 @@
|
||||
From cb34212b1c25f7656a315f956d72696777e88340 Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= <rafal@milecki.pl>
|
||||
Date: Sun, 1 Sep 2019 13:34:35 +0200
|
||||
Subject: [PATCH] brcmfmac: add stub version of brcmf_debugfs_get_devdir()
|
||||
MIME-Version: 1.0
|
||||
Content-Type: text/plain; charset=UTF-8
|
||||
Content-Transfer-Encoding: 8bit
|
||||
|
||||
In case of compiling driver without DEBUG expose a stub function to make
|
||||
writing debug code much simpler (no extra conditions). This will allow
|
||||
e.g. using debugfs_create_file() without any magic if or #ifdef.
|
||||
|
||||
Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
|
||||
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
|
||||
---
|
||||
drivers/net/wireless/broadcom/brcm80211/brcmfmac/debug.h | 4 ++++
|
||||
1 file changed, 4 insertions(+)
|
||||
|
||||
--- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/debug.h
|
||||
+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/debug.h
|
||||
@@ -121,6 +121,10 @@ int brcmf_debugfs_add_entry(struct brcmf
|
||||
int brcmf_debug_create_memdump(struct brcmf_bus *bus, const void *data,
|
||||
size_t len);
|
||||
#else
|
||||
+static inline struct dentry *brcmf_debugfs_get_devdir(struct brcmf_pub *drvr)
|
||||
+{
|
||||
+ return ERR_PTR(-ENOENT);
|
||||
+}
|
||||
static inline
|
||||
int brcmf_debugfs_add_entry(struct brcmf_pub *drvr, const char *fn,
|
||||
int (*read_fn)(struct seq_file *seq, void *data))
|
@ -0,0 +1,59 @@
|
||||
From 2f8c8e62cd50d72ac68de884a09c6f5a969a269c Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= <rafal@milecki.pl>
|
||||
Date: Sun, 1 Sep 2019 13:34:36 +0200
|
||||
Subject: [PATCH] brcmfmac: add "reset" debugfs entry for testing reset
|
||||
MIME-Version: 1.0
|
||||
Content-Type: text/plain; charset=UTF-8
|
||||
Content-Transfer-Encoding: 8bit
|
||||
|
||||
This is a trivial debugfs entry for triggering reset just like in case
|
||||
of firmware crash. It works by writing 1 to it:
|
||||
echo 1 > reset
|
||||
|
||||
Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
|
||||
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
|
||||
---
|
||||
.../broadcom/brcm80211/brcmfmac/core.c | 25 +++++++++++++++++++
|
||||
1 file changed, 25 insertions(+)
|
||||
|
||||
--- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/core.c
|
||||
+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/core.c
|
||||
@@ -1107,6 +1107,29 @@ static void brcmf_core_bus_reset(struct
|
||||
brcmf_bus_reset(drvr->bus_if);
|
||||
}
|
||||
|
||||
+static ssize_t bus_reset_write(struct file *file, const char __user *user_buf,
|
||||
+ size_t count, loff_t *ppos)
|
||||
+{
|
||||
+ struct brcmf_pub *drvr = file->private_data;
|
||||
+ u8 value;
|
||||
+
|
||||
+ if (kstrtou8_from_user(user_buf, count, 0, &value))
|
||||
+ return -EINVAL;
|
||||
+
|
||||
+ if (value != 1)
|
||||
+ return -EINVAL;
|
||||
+
|
||||
+ schedule_work(&drvr->bus_reset);
|
||||
+
|
||||
+ return count;
|
||||
+}
|
||||
+
|
||||
+static const struct file_operations bus_reset_fops = {
|
||||
+ .open = simple_open,
|
||||
+ .llseek = no_llseek,
|
||||
+ .write = bus_reset_write,
|
||||
+};
|
||||
+
|
||||
static int brcmf_bus_started(struct brcmf_pub *drvr, struct cfg80211_ops *ops)
|
||||
{
|
||||
int ret = -1;
|
||||
@@ -1182,6 +1205,8 @@ static int brcmf_bus_started(struct brcm
|
||||
|
||||
/* populate debugfs */
|
||||
brcmf_debugfs_add_entry(drvr, "revinfo", brcmf_revinfo_read);
|
||||
+ debugfs_create_file("reset", 0600, brcmf_debugfs_get_devdir(drvr), drvr,
|
||||
+ &bus_reset_fops);
|
||||
brcmf_feat_debugfs_create(drvr);
|
||||
brcmf_proto_debugfs_create(drvr);
|
||||
brcmf_bus_debugfs_create(bus_if);
|
@ -0,0 +1,58 @@
|
||||
From 0e48b86d9a8f5c695bb02c9c02f6dc7d2ec8f2e2 Mon Sep 17 00:00:00 2001
|
||||
From: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
|
||||
Date: Wed, 4 Sep 2019 20:50:52 +0300
|
||||
Subject: [PATCH] brcmfmac: use %*ph to print small buffer
|
||||
|
||||
Use %*ph format to print small buffer as hex string.
|
||||
|
||||
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
|
||||
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
|
||||
---
|
||||
.../broadcom/brcm80211/brcmfmac/cfg80211.c | 18 ++++++------------
|
||||
1 file changed, 6 insertions(+), 12 deletions(-)
|
||||
|
||||
--- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c
|
||||
+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c
|
||||
@@ -4214,10 +4214,8 @@ brcmf_parse_vndr_ies(const u8 *vndr_ie_b
|
||||
|
||||
vndr_ies->count++;
|
||||
|
||||
- brcmf_dbg(TRACE, "** OUI %02x %02x %02x, type 0x%02x\n",
|
||||
- parsed_info->vndrie.oui[0],
|
||||
- parsed_info->vndrie.oui[1],
|
||||
- parsed_info->vndrie.oui[2],
|
||||
+ brcmf_dbg(TRACE, "** OUI %3ph, type 0x%02x\n",
|
||||
+ parsed_info->vndrie.oui,
|
||||
parsed_info->vndrie.oui_type);
|
||||
|
||||
if (vndr_ies->count >= VNDR_IE_PARSE_LIMIT)
|
||||
@@ -4341,12 +4339,10 @@ s32 brcmf_vif_set_mgmt_ie(struct brcmf_c
|
||||
for (i = 0; i < old_vndr_ies.count; i++) {
|
||||
vndrie_info = &old_vndr_ies.ie_info[i];
|
||||
|
||||
- brcmf_dbg(TRACE, "DEL ID : %d, Len: %d , OUI:%02x:%02x:%02x\n",
|
||||
+ brcmf_dbg(TRACE, "DEL ID : %d, Len: %d , OUI:%3ph\n",
|
||||
vndrie_info->vndrie.id,
|
||||
vndrie_info->vndrie.len,
|
||||
- vndrie_info->vndrie.oui[0],
|
||||
- vndrie_info->vndrie.oui[1],
|
||||
- vndrie_info->vndrie.oui[2]);
|
||||
+ vndrie_info->vndrie.oui);
|
||||
|
||||
del_add_ie_buf_len = brcmf_vndr_ie(curr_ie_buf, pktflag,
|
||||
vndrie_info->ie_ptr,
|
||||
@@ -4378,12 +4374,10 @@ s32 brcmf_vif_set_mgmt_ie(struct brcmf_c
|
||||
remained_buf_len -= (vndrie_info->ie_len +
|
||||
VNDR_IE_VSIE_OFFSET);
|
||||
|
||||
- brcmf_dbg(TRACE, "ADDED ID : %d, Len: %d, OUI:%02x:%02x:%02x\n",
|
||||
+ brcmf_dbg(TRACE, "ADDED ID : %d, Len: %d, OUI:%3ph\n",
|
||||
vndrie_info->vndrie.id,
|
||||
vndrie_info->vndrie.len,
|
||||
- vndrie_info->vndrie.oui[0],
|
||||
- vndrie_info->vndrie.oui[1],
|
||||
- vndrie_info->vndrie.oui[2]);
|
||||
+ vndrie_info->vndrie.oui);
|
||||
|
||||
del_add_ie_buf_len = brcmf_vndr_ie(curr_ie_buf, pktflag,
|
||||
vndrie_info->ie_ptr,
|
@ -0,0 +1,95 @@
|
||||
From ba76ff25ee64d5cfc86209d1fbb3c294b2c04412 Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= <rafal@milecki.pl>
|
||||
Date: Tue, 3 Sep 2019 06:29:26 +0200
|
||||
Subject: [PATCH 1/3] brcmfmac: move "cfg80211_ops" pointer to another struct
|
||||
MIME-Version: 1.0
|
||||
Content-Type: text/plain; charset=UTF-8
|
||||
Content-Transfer-Encoding: 8bit
|
||||
|
||||
This moves "ops" pointer from "struct brcmf_cfg80211_info" to the
|
||||
"struct brcmf_pub". This movement makes it possible to allocate wiphy
|
||||
without attaching cfg80211 (brcmf_cfg80211_attach()). It's required for
|
||||
later separation of wiphy allocation and driver initialization.
|
||||
|
||||
While at it fix also an unlikely memory leak in the brcmf_attach().
|
||||
|
||||
Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
|
||||
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
|
||||
---
|
||||
.../net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c | 1 -
|
||||
.../net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.h | 1 -
|
||||
drivers/net/wireless/broadcom/brcm80211/brcmfmac/core.c | 9 ++++++---
|
||||
drivers/net/wireless/broadcom/brcm80211/brcmfmac/core.h | 1 +
|
||||
4 files changed, 7 insertions(+), 5 deletions(-)
|
||||
|
||||
--- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c
|
||||
+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c
|
||||
@@ -7194,7 +7194,6 @@ void brcmf_cfg80211_detach(struct brcmf_
|
||||
brcmf_pno_detach(cfg);
|
||||
brcmf_btcoex_detach(cfg);
|
||||
wiphy_unregister(cfg->wiphy);
|
||||
- kfree(cfg->ops);
|
||||
wl_deinit_priv(cfg);
|
||||
brcmf_free_wiphy(cfg->wiphy);
|
||||
kfree(cfg);
|
||||
--- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.h
|
||||
+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.h
|
||||
@@ -292,7 +292,6 @@ struct brcmf_cfg80211_wowl {
|
||||
*/
|
||||
struct brcmf_cfg80211_info {
|
||||
struct wiphy *wiphy;
|
||||
- struct cfg80211_ops *ops;
|
||||
struct brcmf_cfg80211_conf *conf;
|
||||
struct brcmf_p2p_info p2p;
|
||||
struct brcmf_btcoex_info *btcoex;
|
||||
--- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/core.c
|
||||
+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/core.c
|
||||
@@ -1245,12 +1245,15 @@ int brcmf_attach(struct device *dev, str
|
||||
return -ENOMEM;
|
||||
|
||||
wiphy = wiphy_new(ops, sizeof(*drvr));
|
||||
- if (!wiphy)
|
||||
+ if (!wiphy) {
|
||||
+ kfree(ops);
|
||||
return -ENOMEM;
|
||||
+ }
|
||||
|
||||
set_wiphy_dev(wiphy, dev);
|
||||
drvr = wiphy_priv(wiphy);
|
||||
drvr->wiphy = wiphy;
|
||||
+ drvr->ops = ops;
|
||||
|
||||
for (i = 0; i < ARRAY_SIZE(drvr->if2bss); i++)
|
||||
drvr->if2bss[i] = BRCMF_BSSIDX_INVALID;
|
||||
@@ -1283,12 +1286,10 @@ int brcmf_attach(struct device *dev, str
|
||||
goto fail;
|
||||
}
|
||||
|
||||
- drvr->config->ops = ops;
|
||||
return 0;
|
||||
|
||||
fail:
|
||||
brcmf_detach(dev);
|
||||
- kfree(ops);
|
||||
|
||||
return ret;
|
||||
}
|
||||
@@ -1374,6 +1375,8 @@ void brcmf_detach(struct device *dev)
|
||||
|
||||
bus_if->drvr = NULL;
|
||||
|
||||
+ kfree(drvr->ops);
|
||||
+
|
||||
wiphy_free(drvr->wiphy);
|
||||
}
|
||||
|
||||
--- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/core.h
|
||||
+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/core.h
|
||||
@@ -97,6 +97,7 @@ struct brcmf_pub {
|
||||
struct brcmf_bus *bus_if;
|
||||
struct brcmf_proto *proto;
|
||||
struct wiphy *wiphy;
|
||||
+ struct cfg80211_ops *ops;
|
||||
struct brcmf_cfg80211_info *config;
|
||||
|
||||
/* Internal brcmf items */
|
@ -0,0 +1,266 @@
|
||||
From 450914c39f88d1adada26256360dea7050ff4e83 Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= <rafal@milecki.pl>
|
||||
Date: Tue, 3 Sep 2019 06:29:27 +0200
|
||||
Subject: [PATCH 2/3] brcmfmac: split brcmf_attach() and brcmf_detach()
|
||||
functions
|
||||
MIME-Version: 1.0
|
||||
Content-Type: text/plain; charset=UTF-8
|
||||
Content-Transfer-Encoding: 8bit
|
||||
|
||||
Move code allocating/freeing wiphy out of above functions. This will
|
||||
allow reinitializing the driver (e.g. on some error) without allocating
|
||||
a new wiphy.
|
||||
|
||||
Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
|
||||
Acked-by: Arend van Spriel <arend.vanspriel@broadcom.com>
|
||||
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
|
||||
---
|
||||
.../broadcom/brcm80211/brcmfmac/bus.h | 4 ++-
|
||||
.../broadcom/brcm80211/brcmfmac/core.c | 33 ++++++++++++++----
|
||||
.../broadcom/brcm80211/brcmfmac/pcie.c | 13 +++++--
|
||||
.../broadcom/brcm80211/brcmfmac/sdio.c | 15 ++++++--
|
||||
.../broadcom/brcm80211/brcmfmac/usb.c | 34 +++++++++++++++----
|
||||
5 files changed, 80 insertions(+), 19 deletions(-)
|
||||
|
||||
--- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/bus.h
|
||||
+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/bus.h
|
||||
@@ -253,10 +253,12 @@ void brcmf_rx_frame(struct device *dev,
|
||||
/* Receive async event packet from firmware. Callee disposes of rxp. */
|
||||
void brcmf_rx_event(struct device *dev, struct sk_buff *rxp);
|
||||
|
||||
+int brcmf_alloc(struct device *dev, struct brcmf_mp_device *settings);
|
||||
/* Indication from bus module regarding presence/insertion of dongle. */
|
||||
-int brcmf_attach(struct device *dev, struct brcmf_mp_device *settings);
|
||||
+int brcmf_attach(struct device *dev);
|
||||
/* Indication from bus module regarding removal/absence of dongle */
|
||||
void brcmf_detach(struct device *dev);
|
||||
+void brcmf_free(struct device *dev);
|
||||
/* Indication from bus module that dongle should be reset */
|
||||
void brcmf_dev_reset(struct device *dev);
|
||||
/* Request from bus module to initiate a coredump */
|
||||
--- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/core.c
|
||||
+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/core.c
|
||||
@@ -1230,13 +1230,11 @@ fail:
|
||||
return ret;
|
||||
}
|
||||
|
||||
-int brcmf_attach(struct device *dev, struct brcmf_mp_device *settings)
|
||||
+int brcmf_alloc(struct device *dev, struct brcmf_mp_device *settings)
|
||||
{
|
||||
struct wiphy *wiphy;
|
||||
struct cfg80211_ops *ops;
|
||||
struct brcmf_pub *drvr = NULL;
|
||||
- int ret = 0;
|
||||
- int i;
|
||||
|
||||
brcmf_dbg(TRACE, "Enter\n");
|
||||
|
||||
@@ -1254,6 +1252,21 @@ int brcmf_attach(struct device *dev, str
|
||||
drvr = wiphy_priv(wiphy);
|
||||
drvr->wiphy = wiphy;
|
||||
drvr->ops = ops;
|
||||
+ drvr->bus_if = dev_get_drvdata(dev);
|
||||
+ drvr->bus_if->drvr = drvr;
|
||||
+ drvr->settings = settings;
|
||||
+
|
||||
+ return 0;
|
||||
+}
|
||||
+
|
||||
+int brcmf_attach(struct device *dev)
|
||||
+{
|
||||
+ struct brcmf_bus *bus_if = dev_get_drvdata(dev);
|
||||
+ struct brcmf_pub *drvr = bus_if->drvr;
|
||||
+ int ret = 0;
|
||||
+ int i;
|
||||
+
|
||||
+ brcmf_dbg(TRACE, "Enter\n");
|
||||
|
||||
for (i = 0; i < ARRAY_SIZE(drvr->if2bss); i++)
|
||||
drvr->if2bss[i] = BRCMF_BSSIDX_INVALID;
|
||||
@@ -1262,9 +1275,6 @@ int brcmf_attach(struct device *dev, str
|
||||
|
||||
/* Link to bus module */
|
||||
drvr->hdrlen = 0;
|
||||
- drvr->bus_if = dev_get_drvdata(dev);
|
||||
- drvr->bus_if->drvr = drvr;
|
||||
- drvr->settings = settings;
|
||||
|
||||
/* Attach and link in the protocol */
|
||||
ret = brcmf_proto_attach(drvr);
|
||||
@@ -1280,7 +1290,7 @@ int brcmf_attach(struct device *dev, str
|
||||
/* attach firmware event handler */
|
||||
brcmf_fweh_attach(drvr);
|
||||
|
||||
- ret = brcmf_bus_started(drvr, ops);
|
||||
+ ret = brcmf_bus_started(drvr, drvr->ops);
|
||||
if (ret != 0) {
|
||||
bphy_err(drvr, "dongle is not responding: err=%d\n", ret);
|
||||
goto fail;
|
||||
@@ -1372,6 +1382,15 @@ void brcmf_detach(struct device *dev)
|
||||
brcmf_cfg80211_detach(drvr->config);
|
||||
drvr->config = NULL;
|
||||
}
|
||||
+}
|
||||
+
|
||||
+void brcmf_free(struct device *dev)
|
||||
+{
|
||||
+ struct brcmf_bus *bus_if = dev_get_drvdata(dev);
|
||||
+ struct brcmf_pub *drvr = bus_if->drvr;
|
||||
+
|
||||
+ if (!drvr)
|
||||
+ return;
|
||||
|
||||
bus_if->drvr = NULL;
|
||||
|
||||
--- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/pcie.c
|
||||
+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/pcie.c
|
||||
@@ -1430,6 +1430,7 @@ static int brcmf_pcie_reset(struct devic
|
||||
brcmf_pcie_bus_console_read(devinfo, true);
|
||||
|
||||
brcmf_detach(dev);
|
||||
+ brcmf_free(dev);
|
||||
|
||||
brcmf_pcie_release_irq(devinfo);
|
||||
brcmf_pcie_release_scratchbuffers(devinfo);
|
||||
@@ -1824,11 +1825,18 @@ static void brcmf_pcie_setup(struct devi
|
||||
|
||||
brcmf_pcie_intr_enable(devinfo);
|
||||
brcmf_pcie_hostready(devinfo);
|
||||
- if (brcmf_attach(&devinfo->pdev->dev, devinfo->settings) == 0)
|
||||
- return;
|
||||
+
|
||||
+ ret = brcmf_alloc(&devinfo->pdev->dev, devinfo->settings);
|
||||
+ if (ret)
|
||||
+ goto fail;
|
||||
+ ret = brcmf_attach(&devinfo->pdev->dev);
|
||||
+ if (ret)
|
||||
+ goto fail;
|
||||
|
||||
brcmf_pcie_bus_console_read(devinfo, false);
|
||||
|
||||
+ return;
|
||||
+
|
||||
fail:
|
||||
device_release_driver(dev);
|
||||
}
|
||||
@@ -1971,6 +1979,7 @@ brcmf_pcie_remove(struct pci_dev *pdev)
|
||||
brcmf_pcie_intr_disable(devinfo);
|
||||
|
||||
brcmf_detach(&pdev->dev);
|
||||
+ brcmf_free(&pdev->dev);
|
||||
|
||||
kfree(bus->bus_priv.pcie);
|
||||
kfree(bus->msgbuf->flowrings);
|
||||
--- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c
|
||||
+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c
|
||||
@@ -4251,17 +4251,26 @@ static void brcmf_sdio_firmware_callback
|
||||
sdiod->bus_if->chip = bus->ci->chip;
|
||||
sdiod->bus_if->chiprev = bus->ci->chiprev;
|
||||
|
||||
+ err = brcmf_alloc(sdiod->dev, sdiod->settings);
|
||||
+ if (err) {
|
||||
+ brcmf_err("brcmf_alloc failed\n");
|
||||
+ goto claim;
|
||||
+ }
|
||||
+
|
||||
/* Attach to the common layer, reserve hdr space */
|
||||
- err = brcmf_attach(sdiod->dev, sdiod->settings);
|
||||
+ err = brcmf_attach(sdiod->dev);
|
||||
if (err != 0) {
|
||||
brcmf_err("brcmf_attach failed\n");
|
||||
- sdio_claim_host(sdiod->func1);
|
||||
- goto checkdied;
|
||||
+ goto free;
|
||||
}
|
||||
|
||||
/* ready */
|
||||
return;
|
||||
|
||||
+free:
|
||||
+ brcmf_free(sdiod->dev);
|
||||
+claim:
|
||||
+ sdio_claim_host(sdiod->func1);
|
||||
checkdied:
|
||||
brcmf_sdio_checkdied(bus);
|
||||
release:
|
||||
--- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/usb.c
|
||||
+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/usb.c
|
||||
@@ -1178,8 +1178,12 @@ static void brcmf_usb_probe_phase2(struc
|
||||
if (ret)
|
||||
goto error;
|
||||
|
||||
+ ret = brcmf_alloc(devinfo->dev, devinfo->settings);
|
||||
+ if (ret)
|
||||
+ goto error;
|
||||
+
|
||||
/* Attach to the common driver interface */
|
||||
- ret = brcmf_attach(devinfo->dev, devinfo->settings);
|
||||
+ ret = brcmf_attach(devinfo->dev);
|
||||
if (ret)
|
||||
goto error;
|
||||
|
||||
@@ -1251,7 +1255,10 @@ static int brcmf_usb_probe_cb(struct brc
|
||||
}
|
||||
|
||||
if (!brcmf_usb_dlneeded(devinfo)) {
|
||||
- ret = brcmf_attach(devinfo->dev, devinfo->settings);
|
||||
+ ret = brcmf_alloc(devinfo->dev, devinfo->settings);
|
||||
+ if (ret)
|
||||
+ goto fail;
|
||||
+ ret = brcmf_attach(devinfo->dev);
|
||||
if (ret)
|
||||
goto fail;
|
||||
/* we are done */
|
||||
@@ -1279,6 +1286,7 @@ static int brcmf_usb_probe_cb(struct brc
|
||||
|
||||
fail:
|
||||
/* Release resources in reverse order */
|
||||
+ brcmf_free(devinfo->dev);
|
||||
kfree(bus);
|
||||
brcmf_usb_detach(devinfo);
|
||||
return ret;
|
||||
@@ -1292,6 +1300,7 @@ brcmf_usb_disconnect_cb(struct brcmf_usb
|
||||
brcmf_dbg(USB, "Enter, bus_pub %p\n", devinfo);
|
||||
|
||||
brcmf_detach(devinfo->dev);
|
||||
+ brcmf_free(devinfo->dev);
|
||||
kfree(devinfo->bus_pub.bus);
|
||||
brcmf_usb_detach(devinfo);
|
||||
}
|
||||
@@ -1435,10 +1444,12 @@ static int brcmf_usb_suspend(struct usb_
|
||||
|
||||
brcmf_dbg(USB, "Enter\n");
|
||||
devinfo->bus_pub.state = BRCMFMAC_USB_STATE_SLEEP;
|
||||
- if (devinfo->wowl_enabled)
|
||||
+ if (devinfo->wowl_enabled) {
|
||||
brcmf_cancel_all_urbs(devinfo);
|
||||
- else
|
||||
+ } else {
|
||||
brcmf_detach(&usb->dev);
|
||||
+ brcmf_free(&usb->dev);
|
||||
+ }
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -1451,8 +1462,19 @@ static int brcmf_usb_resume(struct usb_i
|
||||
struct brcmf_usbdev_info *devinfo = brcmf_usb_get_businfo(&usb->dev);
|
||||
|
||||
brcmf_dbg(USB, "Enter\n");
|
||||
- if (!devinfo->wowl_enabled)
|
||||
- return brcmf_attach(devinfo->dev, devinfo->settings);
|
||||
+ if (!devinfo->wowl_enabled) {
|
||||
+ int err;
|
||||
+
|
||||
+ err = brcmf_alloc(&usb->dev, devinfo->settings);
|
||||
+ if (err)
|
||||
+ return err;
|
||||
+
|
||||
+ err = brcmf_attach(devinfo->dev);
|
||||
+ if (err) {
|
||||
+ brcmf_free(devinfo->dev);
|
||||
+ return err;
|
||||
+ }
|
||||
+ }
|
||||
|
||||
devinfo->bus_pub.state = BRCMFMAC_USB_STATE_UP;
|
||||
brcmf_usb_rx_fill_all(devinfo);
|
@ -0,0 +1,51 @@
|
||||
From a1f5aac1765afbeace9581afa27da34085f68e1d Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= <rafal@milecki.pl>
|
||||
Date: Tue, 3 Sep 2019 06:29:28 +0200
|
||||
Subject: [PATCH 3/3] brcmfmac: don't realloc wiphy during PCIe reset
|
||||
MIME-Version: 1.0
|
||||
Content-Type: text/plain; charset=UTF-8
|
||||
Content-Transfer-Encoding: 8bit
|
||||
|
||||
Providing a new wiphy on every PCIe reset was confusing and was causing
|
||||
configuration problems for some users (supplicant and authenticators).
|
||||
Sticking to the existing wiphy should make error recovery much simpler
|
||||
and more reliable.
|
||||
|
||||
Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
|
||||
Acked-by: Arend van Spriel <arend.vanspriel@broadcom.com>
|
||||
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
|
||||
---
|
||||
drivers/net/wireless/broadcom/brcm80211/brcmfmac/pcie.c | 8 ++++----
|
||||
1 file changed, 4 insertions(+), 4 deletions(-)
|
||||
|
||||
--- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/pcie.c
|
||||
+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/pcie.c
|
||||
@@ -1430,7 +1430,6 @@ static int brcmf_pcie_reset(struct devic
|
||||
brcmf_pcie_bus_console_read(devinfo, true);
|
||||
|
||||
brcmf_detach(dev);
|
||||
- brcmf_free(dev);
|
||||
|
||||
brcmf_pcie_release_irq(devinfo);
|
||||
brcmf_pcie_release_scratchbuffers(devinfo);
|
||||
@@ -1826,9 +1825,6 @@ static void brcmf_pcie_setup(struct devi
|
||||
brcmf_pcie_intr_enable(devinfo);
|
||||
brcmf_pcie_hostready(devinfo);
|
||||
|
||||
- ret = brcmf_alloc(&devinfo->pdev->dev, devinfo->settings);
|
||||
- if (ret)
|
||||
- goto fail;
|
||||
ret = brcmf_attach(&devinfo->pdev->dev);
|
||||
if (ret)
|
||||
goto fail;
|
||||
@@ -1931,6 +1927,10 @@ brcmf_pcie_probe(struct pci_dev *pdev, c
|
||||
bus->wowl_supported = pci_pme_capable(pdev, PCI_D3hot);
|
||||
dev_set_drvdata(&pdev->dev, bus);
|
||||
|
||||
+ ret = brcmf_alloc(&devinfo->pdev->dev, devinfo->settings);
|
||||
+ if (ret)
|
||||
+ goto fail_bus;
|
||||
+
|
||||
fwreq = brcmf_pcie_prepare_fw_request(devinfo);
|
||||
if (!fwreq) {
|
||||
ret = -ENOMEM;
|
@ -13,7 +13,7 @@ Signed-off-by: Rafał Miłecki <zajec5@gmail.com>
|
||||
|
||||
--- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/core.c
|
||||
+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/core.c
|
||||
@@ -1436,6 +1436,7 @@ int __init brcmf_core_init(void)
|
||||
@@ -1472,6 +1472,7 @@ int __init brcmf_core_init(void)
|
||||
{
|
||||
if (!schedule_work(&brcmf_driver_work))
|
||||
return -EBUSY;
|
||||
@ -23,7 +23,7 @@ Signed-off-by: Rafał Miłecki <zajec5@gmail.com>
|
||||
}
|
||||
--- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/firmware.c
|
||||
+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/firmware.c
|
||||
@@ -442,6 +442,7 @@ struct brcmf_fw {
|
||||
@@ -431,6 +431,7 @@ struct brcmf_fw {
|
||||
struct brcmf_fw_request *req;
|
||||
u32 curpos;
|
||||
void (*done)(struct device *dev, int err, struct brcmf_fw_request *req);
|
||||
@ -31,7 +31,7 @@ Signed-off-by: Rafał Miłecki <zajec5@gmail.com>
|
||||
};
|
||||
|
||||
static void brcmf_fw_request_done(const struct firmware *fw, void *ctx);
|
||||
@@ -649,6 +650,8 @@ static void brcmf_fw_request_done(const
|
||||
@@ -638,6 +639,8 @@ static void brcmf_fw_request_done(const
|
||||
fwctx->req = NULL;
|
||||
}
|
||||
fwctx->done(fwctx->dev, ret, fwctx->req);
|
||||
@ -40,7 +40,7 @@ Signed-off-by: Rafał Miłecki <zajec5@gmail.com>
|
||||
kfree(fwctx);
|
||||
}
|
||||
|
||||
@@ -673,6 +676,8 @@ int brcmf_fw_get_firmwares(struct device
|
||||
@@ -662,6 +665,8 @@ int brcmf_fw_get_firmwares(struct device
|
||||
{
|
||||
struct brcmf_fw_item *first = &req->items[0];
|
||||
struct brcmf_fw *fwctx;
|
||||
@ -49,7 +49,7 @@ Signed-off-by: Rafał Miłecki <zajec5@gmail.com>
|
||||
int ret;
|
||||
|
||||
brcmf_dbg(TRACE, "enter: dev=%s\n", dev_name(dev));
|
||||
@@ -689,6 +694,9 @@ int brcmf_fw_get_firmwares(struct device
|
||||
@@ -678,6 +683,9 @@ int brcmf_fw_get_firmwares(struct device
|
||||
fwctx->dev = dev;
|
||||
fwctx->req = req;
|
||||
fwctx->done = fw_cb;
|
||||
@ -59,7 +59,7 @@ Signed-off-by: Rafał Miłecki <zajec5@gmail.com>
|
||||
|
||||
ret = request_firmware_nowait(THIS_MODULE, true, first->path,
|
||||
fwctx->dev, GFP_KERNEL, fwctx,
|
||||
@@ -696,6 +704,12 @@ int brcmf_fw_get_firmwares(struct device
|
||||
@@ -685,6 +693,12 @@ int brcmf_fw_get_firmwares(struct device
|
||||
if (ret < 0)
|
||||
brcmf_fw_request_done(NULL, fwctx);
|
||||
|
||||
|
@ -10,7 +10,7 @@ Signed-off-by: Rafał Miłecki <zajec5@gmail.com>
|
||||
|
||||
--- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c
|
||||
+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c
|
||||
@@ -620,8 +620,36 @@ static struct wireless_dev *brcmf_cfg802
|
||||
@@ -628,8 +628,36 @@ static struct wireless_dev *brcmf_cfg802
|
||||
struct brcmf_cfg80211_info *cfg = wiphy_to_cfg(wiphy);
|
||||
struct brcmf_pub *drvr = cfg->pub;
|
||||
struct wireless_dev *wdev;
|
||||
|
@ -14,7 +14,7 @@ Signed-off-by: Phil Elwell <phil@raspberrypi.org>
|
||||
|
||||
--- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c
|
||||
+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c
|
||||
@@ -2774,6 +2774,10 @@ brcmf_cfg80211_set_power_mgmt(struct wip
|
||||
@@ -2787,6 +2787,10 @@ brcmf_cfg80211_set_power_mgmt(struct wip
|
||||
* preference in cfg struct to apply this to
|
||||
* FW later while initializing the dongle
|
||||
*/
|
||||
|
@ -12,7 +12,7 @@ Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
|
||||
|
||||
--- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/of.c
|
||||
+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/of.c
|
||||
@@ -23,6 +23,36 @@
|
||||
@@ -12,6 +12,36 @@
|
||||
#include "common.h"
|
||||
#include "of.h"
|
||||
|
||||
@ -49,7 +49,7 @@ Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
|
||||
void brcmf_of_probe(struct device *dev, enum brcmf_bus_type bus_type,
|
||||
struct brcmf_mp_device *settings)
|
||||
{
|
||||
@@ -41,6 +71,8 @@ void brcmf_of_probe(struct device *dev,
|
||||
@@ -30,6 +60,8 @@ void brcmf_of_probe(struct device *dev,
|
||||
of_node_put(root);
|
||||
}
|
||||
|
||||
|
@ -9,7 +9,7 @@ Signed-off-by: Phil Elwell <phil@raspberrypi.org>
|
||||
|
||||
--- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/common.c
|
||||
+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/common.c
|
||||
@@ -70,7 +70,11 @@ static int brcmf_fcmode;
|
||||
@@ -59,7 +59,11 @@ static int brcmf_fcmode;
|
||||
module_param_named(fcmode, brcmf_fcmode, int, 0);
|
||||
MODULE_PARM_DESC(fcmode, "Mode of firmware signalled flow control");
|
||||
|
||||
|
@ -1,6 +1,6 @@
|
||||
--- a/drivers/net/wireless/marvell/mwl8k.c
|
||||
+++ b/drivers/net/wireless/marvell/mwl8k.c
|
||||
@@ -5686,6 +5686,7 @@ MODULE_FIRMWARE("mwl8k/fmimage_8366.fw")
|
||||
@@ -5691,6 +5691,7 @@ MODULE_FIRMWARE("mwl8k/fmimage_8366.fw")
|
||||
MODULE_FIRMWARE(MWL8K_8366_AP_FW(MWL8K_8366_AP_FW_API));
|
||||
|
||||
static const struct pci_device_id mwl8k_pci_id_table[] = {
|
||||
|
@ -1,6 +1,6 @@
|
||||
--- a/drivers/net/wireless/marvell/mwl8k.c
|
||||
+++ b/drivers/net/wireless/marvell/mwl8k.c
|
||||
@@ -6271,6 +6271,8 @@ static int mwl8k_probe(struct pci_dev *p
|
||||
@@ -6276,6 +6276,8 @@ static int mwl8k_probe(struct pci_dev *p
|
||||
|
||||
priv->running_bsses = 0;
|
||||
|
||||
@ -9,7 +9,7 @@
|
||||
return rc;
|
||||
|
||||
err_stop_firmware:
|
||||
@@ -6304,8 +6306,6 @@ static void mwl8k_remove(struct pci_dev
|
||||
@@ -6309,8 +6311,6 @@ static void mwl8k_remove(struct pci_dev
|
||||
return;
|
||||
priv = hw->priv;
|
||||
|
||||
|
@ -1,80 +0,0 @@
|
||||
From b897577af85bb5e5638efa780bc3716fae5212d3 Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?Petr=20=C5=A0tetiar?= <ynezz@true.cz>
|
||||
Date: Mon, 8 Apr 2019 09:45:56 +0200
|
||||
Subject: [PATCH] mwl8k: Fix rate_idx underflow
|
||||
MIME-Version: 1.0
|
||||
Content-Type: text/plain; charset=UTF-8
|
||||
Content-Transfer-Encoding: 8bit
|
||||
|
||||
It was reported on OpenWrt bug tracking system[1], that several users
|
||||
are affected by the endless reboot of their routers if they configure
|
||||
5GHz interface with channel 44 or 48.
|
||||
|
||||
The reboot loop is caused by the following excessive number of WARN_ON
|
||||
messages:
|
||||
|
||||
WARNING: CPU: 0 PID: 0 at backports-4.19.23-1/net/mac80211/rx.c:4516
|
||||
ieee80211_rx_napi+0x1fc/0xa54 [mac80211]
|
||||
|
||||
as the messages are being correctly emitted by the following guard:
|
||||
|
||||
case RX_ENC_LEGACY:
|
||||
if (WARN_ON(status->rate_idx >= sband->n_bitrates))
|
||||
|
||||
as the rate_idx is in this case erroneously set to 251 (0xfb). This fix
|
||||
simply converts previously used magic number to proper constant and
|
||||
guards against substraction which is leading to the currently observed
|
||||
underflow.
|
||||
|
||||
1. https://bugs.openwrt.org/index.php?do=details&task_id=2218
|
||||
|
||||
Fixes: 854783444bab ("mwl8k: properly set receive status rate index on 5 GHz receive")
|
||||
Cc: <stable@vger.kernel.org>
|
||||
Tested-by: Eubert Bao <bunnier@gmail.com>
|
||||
Reported-by: Eubert Bao <bunnier@gmail.com>
|
||||
Signed-off-by: Petr Štetiar <ynezz@true.cz>
|
||||
---
|
||||
drivers/net/wireless/marvell/mwl8k.c | 13 +++++++++----
|
||||
1 file changed, 9 insertions(+), 4 deletions(-)
|
||||
|
||||
diff --git a/drivers/net/wireless/marvell/mwl8k.c b/drivers/net/wireless/marvell/mwl8k.c
|
||||
index 8e4e9b6..ffc565a 100644
|
||||
--- a/drivers/net/wireless/marvell/mwl8k.c
|
||||
+++ b/drivers/net/wireless/marvell/mwl8k.c
|
||||
@@ -441,6 +441,9 @@ struct mwl8k_sta {
|
||||
#define MWL8K_CMD_UPDATE_STADB 0x1123
|
||||
#define MWL8K_CMD_BASTREAM 0x1125
|
||||
|
||||
+#define MWL8K_LEGACY_5G_RATE_OFFSET \
|
||||
+ (ARRAY_SIZE(mwl8k_rates_24) - ARRAY_SIZE(mwl8k_rates_50))
|
||||
+
|
||||
static const char *mwl8k_cmd_name(__le16 cmd, char *buf, int bufsize)
|
||||
{
|
||||
u16 command = le16_to_cpu(cmd);
|
||||
@@ -1016,8 +1019,9 @@ static void mwl8k_rxd_ap_refill(void *_rxd, dma_addr_t addr, int len)
|
||||
|
||||
if (rxd->channel > 14) {
|
||||
status->band = NL80211_BAND_5GHZ;
|
||||
- if (!(status->encoding == RX_ENC_HT))
|
||||
- status->rate_idx -= 5;
|
||||
+ if (!(status->encoding == RX_ENC_HT) &&
|
||||
+ status->rate_idx >= MWL8K_LEGACY_5G_RATE_OFFSET)
|
||||
+ status->rate_idx -= MWL8K_LEGACY_5G_RATE_OFFSET;
|
||||
} else {
|
||||
status->band = NL80211_BAND_2GHZ;
|
||||
}
|
||||
@@ -1124,8 +1128,9 @@ static void mwl8k_rxd_sta_refill(void *_rxd, dma_addr_t addr, int len)
|
||||
|
||||
if (rxd->channel > 14) {
|
||||
status->band = NL80211_BAND_5GHZ;
|
||||
- if (!(status->encoding == RX_ENC_HT))
|
||||
- status->rate_idx -= 5;
|
||||
+ if (!(status->encoding == RX_ENC_HT) &&
|
||||
+ status->rate_idx >= MWL8K_LEGACY_5G_RATE_OFFSET)
|
||||
+ status->rate_idx -= MWL8K_LEGACY_5G_RATE_OFFSET;
|
||||
} else {
|
||||
status->band = NL80211_BAND_2GHZ;
|
||||
}
|
||||
--
|
||||
1.9.1
|
||||
|
@ -51,7 +51,7 @@ Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
|
||||
rt2800mmio_enable_interrupt(rt2x00dev,
|
||||
--- a/drivers/net/wireless/ralink/rt2x00/rt2x00.h
|
||||
+++ b/drivers/net/wireless/ralink/rt2x00/rt2x00.h
|
||||
@@ -980,6 +980,8 @@ struct rt2x00_dev {
|
||||
@@ -979,6 +979,8 @@ struct rt2x00_dev {
|
||||
*/
|
||||
DECLARE_KFIFO_PTR(txstatus_fifo, u32);
|
||||
|
||||
@ -62,7 +62,7 @@ Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
|
||||
*/
|
||||
--- a/drivers/net/wireless/ralink/rt2x00/rt2x00queue.c
|
||||
+++ b/drivers/net/wireless/ralink/rt2x00/rt2x00queue.c
|
||||
@@ -1039,6 +1039,7 @@ void rt2x00queue_start_queues(struct rt2
|
||||
@@ -1042,6 +1042,7 @@ void rt2x00queue_start_queues(struct rt2
|
||||
*/
|
||||
tx_queue_for_each(rt2x00dev, queue)
|
||||
rt2x00queue_start_queue(queue);
|
||||
|
@ -97,7 +97,7 @@ Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
|
||||
* Driver configuration
|
||||
--- a/drivers/net/wireless/ralink/rt2x00/rt2x00mac.c
|
||||
+++ b/drivers/net/wireless/ralink/rt2x00/rt2x00mac.c
|
||||
@@ -720,8 +720,12 @@ void rt2x00mac_flush(struct ieee80211_hw
|
||||
@@ -710,8 +710,12 @@ void rt2x00mac_flush(struct ieee80211_hw
|
||||
if (!test_bit(DEVICE_STATE_PRESENT, &rt2x00dev->flags))
|
||||
return;
|
||||
|
||||
|
@ -25,7 +25,7 @@ Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com>
|
||||
|
||||
--- a/include/net/cfg80211.h
|
||||
+++ b/include/net/cfg80211.h
|
||||
@@ -6597,6 +6597,11 @@ int cfg80211_external_auth_request(struc
|
||||
@@ -6612,6 +6612,11 @@ bool cfg80211_iftype_allowed(struct wiph
|
||||
#define wiphy_info(wiphy, format, args...) \
|
||||
dev_info(&(wiphy)->dev, format, ##args)
|
||||
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user