Merge Official Source
Signed-off-by: Tianling Shen <cnsztl@immortalwrt.org>
This commit is contained in:
commit
0b394ff960
@ -543,6 +543,18 @@ config KERNEL_SOFTLOCKUP_DETECTOR
|
||||
chance to run. The current stack trace is displayed upon
|
||||
detection and the system will stay locked up.
|
||||
|
||||
config KERNEL_HARDLOCKUP_DETECTOR
|
||||
bool "Compile the kernel with detect Hard Lockups"
|
||||
depends on KERNEL_DEBUG_KERNEL
|
||||
help
|
||||
Say Y here to enable the kernel to act as a watchdog to detect
|
||||
hard lockups.
|
||||
|
||||
Hardlockups are bugs that cause the CPU to loop in kernel mode
|
||||
for more than 10 seconds, without letting other interrupts have a
|
||||
chance to run. The current stack trace is displayed upon detection
|
||||
and the system will stay locked up.
|
||||
|
||||
config KERNEL_DETECT_HUNG_TASK
|
||||
bool "Compile the kernel with detect Hung Tasks"
|
||||
depends on KERNEL_DEBUG_KERNEL
|
||||
|
@ -1,2 +1,2 @@
|
||||
LINUX_VERSION-5.10 = .172
|
||||
LINUX_KERNEL_HASH-5.10.172 = f20dbae344df1c33cad617f7670c5e061557f592f422c842d3b30155df2927b1
|
||||
LINUX_VERSION-5.10 = .175
|
||||
LINUX_KERNEL_HASH-5.10.175 = e277562e28f234e36665ae12b7585f9557a83a86bc4a8de8840a305af6307bce
|
||||
|
@ -45,6 +45,9 @@ linksys,ea8500)
|
||||
netgear,r7800)
|
||||
ubootenv_add_uci_config "/dev/mtd2" "0x0" "0x040000" "0x20000"
|
||||
;;
|
||||
nokia,ac400i)
|
||||
ubootenv_add_uci_config "/dev/mtd20" "0x0" "0x040000" "0x20000"
|
||||
;;
|
||||
qcom,ipq8064-ap148|\
|
||||
qcom,ipq8064-db149)
|
||||
ubootenv_add_uci_config $(ubootenv_mtdinfo)
|
||||
|
@ -8,7 +8,8 @@ touch /etc/config/ubootenv
|
||||
board=$(board_name)
|
||||
|
||||
case "$board" in
|
||||
dynalink,dl-wrx36)
|
||||
dynalink,dl-wrx36|\
|
||||
netgear,wax218)
|
||||
idx="$(find_mtd_index 0:appsblenv)"
|
||||
[ -n "$idx" ] && \
|
||||
ubootenv_add_uci_config "/dev/mtd$idx" "0x0" "0x40000" "0x20000" "2"
|
||||
|
@ -6,9 +6,9 @@ PKG_RELEASE:=1
|
||||
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_URL=$(PROJECT_GIT)/project/firmware/qca-wireless.git
|
||||
PKG_SOURCE_DATE:=2023-03-18
|
||||
PKG_SOURCE_VERSION:=86180c4c07330e303edf0afd6c017932903ee080
|
||||
PKG_MIRROR_HASH:=283d6651f8a9088981065d476c01c7c0794279e108a96377468d5fcdc3882a12
|
||||
PKG_SOURCE_DATE:=2023-03-19
|
||||
PKG_SOURCE_VERSION:=31ff96d9f99f993cb43d79f0c411fe6bf55633bb
|
||||
PKG_MIRROR_HASH:=8005a884059925a627024b9022ed06a36ebf4ed7a20e8aab191585afbdd6895f
|
||||
|
||||
PKG_FLAGS:=nonshared
|
||||
|
||||
@ -44,6 +44,8 @@ ALLWIFIBOARDS:= \
|
||||
glinet_gl-s1300 \
|
||||
linksys_ea8300 \
|
||||
linksys_whw03v2 \
|
||||
netgear_wax218 \
|
||||
nokia_ac400i \
|
||||
p2w_r619ac \
|
||||
pakedge_wr-1 \
|
||||
qnap_301w \
|
||||
@ -147,6 +149,8 @@ $(eval $(call generate-ipq-wifi-package,glinet_gl-ap1300,GL.iNet GL-AP1300))
|
||||
$(eval $(call generate-ipq-wifi-package,glinet_gl-s1300,GL.iNet GL-S1300))
|
||||
$(eval $(call generate-ipq-wifi-package,linksys_ea8300,Linksys EA8300))
|
||||
$(eval $(call generate-ipq-wifi-package,linksys_whw03v2,Linksys WHW03 V2))
|
||||
$(eval $(call generate-ipq-wifi-package,netgear_wax218,Netgear WAX218))
|
||||
$(eval $(call generate-ipq-wifi-package,nokia_ac400i,Nokia AC400i))
|
||||
$(eval $(call generate-ipq-wifi-package,p2w_r619ac,P&W R619AC))
|
||||
$(eval $(call generate-ipq-wifi-package,pakedge_wr-1,Pakedge WR-1))
|
||||
$(eval $(call generate-ipq-wifi-package,qnap_301w,QNAP 301w))
|
||||
|
@ -8,12 +8,12 @@
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=linux-firmware
|
||||
PKG_VERSION:=20230117
|
||||
PKG_VERSION:=20230310
|
||||
PKG_RELEASE:=1
|
||||
|
||||
PKG_SOURCE_URL:=@KERNEL/linux/kernel/firmware
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
|
||||
PKG_HASH:=df11e25ba2fb4d5343473757e17a3b4cef599250a26b1f7e0f038850f0cb3d64
|
||||
PKG_HASH:=5968d4e5178ca1ecad3c41c36bba4602c288f25c7a48eeaa74113537578199b2
|
||||
|
||||
PKG_MAINTAINER:=Felix Fietkau <nbd@nbd.name>
|
||||
|
||||
|
@ -0,0 +1,43 @@
|
||||
From 7c15430822e71e90203d87e6d0cfe83fa058b0dc Mon Sep 17 00:00:00 2001
|
||||
From: Len Brown <len.brown@intel.com>
|
||||
Date: Wed, 1 Feb 2023 12:32:01 -0600
|
||||
Subject: [PATCH] wifi: ath11k: allow system suspend to survive ath11k
|
||||
|
||||
When ath11k runs into internal errors upon suspend,
|
||||
it returns an error code to pci_pm_suspend, which
|
||||
aborts the entire system suspend.
|
||||
|
||||
The driver should not abort system suspend, but should
|
||||
keep its internal errors to itself, and allow the system
|
||||
to suspend. Otherwise, a user can suspend a laptop
|
||||
by closing the lid and sealing it into a case, assuming
|
||||
that is will suspend, rather than heating up and draining
|
||||
the battery when in transit.
|
||||
|
||||
In practice, the ath11k device seems to have plenty of transient
|
||||
errors, and subsequent suspend cycles after this failure
|
||||
often succeed.
|
||||
|
||||
https://bugzilla.kernel.org/show_bug.cgi?id=216968
|
||||
|
||||
Fixes: d1b0c33850d29 ("ath11k: implement suspend for QCA6390 PCI devices")
|
||||
|
||||
Signed-off-by: Len Brown <len.brown@intel.com>
|
||||
Cc: stable@vger.kernel.org
|
||||
Signed-off-by: Kalle Valo <kvalo@kernel.org>
|
||||
Link: https://lore.kernel.org/r/20230201183201.14431-1-len.brown@intel.com
|
||||
---
|
||||
drivers/net/wireless/ath/ath11k/pci.c | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
--- a/drivers/net/wireless/ath/ath11k/pci.c
|
||||
+++ b/drivers/net/wireless/ath/ath11k/pci.c
|
||||
@@ -981,7 +981,7 @@ static __maybe_unused int ath11k_pci_pm_
|
||||
if (ret)
|
||||
ath11k_warn(ab, "failed to suspend core: %d\n", ret);
|
||||
|
||||
- return ret;
|
||||
+ return 0;
|
||||
}
|
||||
|
||||
static __maybe_unused int ath11k_pci_pm_resume(struct device *dev)
|
@ -0,0 +1,61 @@
|
||||
From a96f10422e74cde27c100b321b127ec32ae75747 Mon Sep 17 00:00:00 2001
|
||||
From: Muna Sinada <quic_msinada@quicinc.com>
|
||||
Date: Fri, 24 Feb 2023 12:28:03 +0200
|
||||
Subject: [PATCH] wifi: ath11k: modify accessor macros to match index size
|
||||
|
||||
HE PHY is only 11 bytes, therefore it should be using byte indexes
|
||||
instead of dword. Change corresponding macros to reflect this.
|
||||
|
||||
Signed-off-by: Muna Sinada <quic_msinada@quicinc.com>
|
||||
Signed-off-by: Kalle Valo <quic_kvalo@quicinc.com>
|
||||
Link: https://lore.kernel.org/r/1666128501-12364-2-git-send-email-quic_msinada@quicinc.com
|
||||
---
|
||||
drivers/net/wireless/ath/ath11k/wmi.h | 24 +++++++++++++-----------
|
||||
1 file changed, 13 insertions(+), 11 deletions(-)
|
||||
|
||||
--- a/drivers/net/wireless/ath/ath11k/wmi.h
|
||||
+++ b/drivers/net/wireless/ath/ath11k/wmi.h
|
||||
@@ -2859,30 +2859,32 @@ struct rx_reorder_queue_remove_params {
|
||||
#define WMI_VDEV_PARAM_TXBF_SU_TX_BFER BIT(2)
|
||||
#define WMI_VDEV_PARAM_TXBF_MU_TX_BFER BIT(3)
|
||||
|
||||
-#define HECAP_PHYDWORD_0 0
|
||||
-#define HECAP_PHYDWORD_1 1
|
||||
-#define HECAP_PHYDWORD_2 2
|
||||
+#define HE_PHYCAP_BYTE_0 0
|
||||
+#define HE_PHYCAP_BYTE_1 1
|
||||
+#define HE_PHYCAP_BYTE_2 2
|
||||
+#define HE_PHYCAP_BYTE_3 3
|
||||
+#define HE_PHYCAP_BYTE_4 4
|
||||
|
||||
-#define HECAP_PHY_SU_BFER BIT(31)
|
||||
+#define HECAP_PHY_SU_BFER BIT(7)
|
||||
#define HECAP_PHY_SU_BFEE BIT(0)
|
||||
#define HECAP_PHY_MU_BFER BIT(1)
|
||||
-#define HECAP_PHY_UL_MUMIMO BIT(22)
|
||||
-#define HECAP_PHY_UL_MUOFDMA BIT(23)
|
||||
+#define HECAP_PHY_UL_MUMIMO BIT(6)
|
||||
+#define HECAP_PHY_UL_MUOFDMA BIT(7)
|
||||
|
||||
#define HECAP_PHY_SUBFMR_GET(hecap_phy) \
|
||||
- FIELD_GET(HECAP_PHY_SU_BFER, hecap_phy[HECAP_PHYDWORD_0])
|
||||
+ FIELD_GET(HECAP_PHY_SU_BFER, hecap_phy[HE_PHYCAP_BYTE_3])
|
||||
|
||||
#define HECAP_PHY_SUBFME_GET(hecap_phy) \
|
||||
- FIELD_GET(HECAP_PHY_SU_BFEE, hecap_phy[HECAP_PHYDWORD_1])
|
||||
+ FIELD_GET(HECAP_PHY_SU_BFEE, hecap_phy[HE_PHYCAP_BYTE_4])
|
||||
|
||||
#define HECAP_PHY_MUBFMR_GET(hecap_phy) \
|
||||
- FIELD_GET(HECAP_PHY_MU_BFER, hecap_phy[HECAP_PHYDWORD_1])
|
||||
+ FIELD_GET(HECAP_PHY_MU_BFER, hecap_phy[HE_PHYCAP_BYTE_4])
|
||||
|
||||
#define HECAP_PHY_ULMUMIMO_GET(hecap_phy) \
|
||||
- FIELD_GET(HECAP_PHY_UL_MUMIMO, hecap_phy[HECAP_PHYDWORD_0])
|
||||
+ FIELD_GET(HECAP_PHY_UL_MUMIMO, hecap_phy[HE_PHYCAP_BYTE_2])
|
||||
|
||||
#define HECAP_PHY_ULOFDMA_GET(hecap_phy) \
|
||||
- FIELD_GET(HECAP_PHY_UL_MUOFDMA, hecap_phy[HECAP_PHYDWORD_0])
|
||||
+ FIELD_GET(HECAP_PHY_UL_MUOFDMA, hecap_phy[HE_PHYCAP_BYTE_2])
|
||||
|
||||
#define HE_MODE_SU_TX_BFEE BIT(0)
|
||||
#define HE_MODE_SU_TX_BFER BIT(1)
|
@ -0,0 +1,300 @@
|
||||
From 38dfe775d0abf511341f37c1cb77b919a3ad410b Mon Sep 17 00:00:00 2001
|
||||
From: Muna Sinada <quic_msinada@quicinc.com>
|
||||
Date: Fri, 24 Feb 2023 12:28:04 +0200
|
||||
Subject: [PATCH] wifi: ath11k: push MU-MIMO params from hostapd to hardware
|
||||
|
||||
In the previous behaviour only HE IE in management frames are changed
|
||||
regarding MU-MIMO configurations and not in hardware. Adding push of
|
||||
MU-MIMO configurations to the hardware as well.
|
||||
|
||||
Tested-on: IPQ8074 hw2.0 AHB WLAN.HK.2.4.0.1-00356-QCAHKSWPL_SILICONZ-1
|
||||
|
||||
Co-developed-by: Anilkumar Kolli <quic_akolli@quicinc.com>
|
||||
Signed-off-by: Anilkumar Kolli <quic_akolli@quicinc.com>
|
||||
Signed-off-by: Muna Sinada <quic_msinada@quicinc.com>
|
||||
Signed-off-by: Kalle Valo <quic_kvalo@quicinc.com>
|
||||
Link: https://lore.kernel.org/r/1666128501-12364-3-git-send-email-quic_msinada@quicinc.com
|
||||
---
|
||||
drivers/net/wireless/ath/ath11k/mac.c | 200 ++++++++++++++++----------
|
||||
drivers/net/wireless/ath/ath11k/wmi.h | 3 +
|
||||
2 files changed, 130 insertions(+), 73 deletions(-)
|
||||
|
||||
--- a/drivers/net/wireless/ath/ath11k/mac.c
|
||||
+++ b/drivers/net/wireless/ath/ath11k/mac.c
|
||||
@@ -2699,6 +2699,117 @@ static int ath11k_setup_peer_smps(struct
|
||||
ath11k_smps_map[smps]);
|
||||
}
|
||||
|
||||
+static bool ath11k_mac_set_he_txbf_conf(struct ath11k_vif *arvif)
|
||||
+{
|
||||
+ struct ath11k *ar = arvif->ar;
|
||||
+ u32 param, value;
|
||||
+ int ret;
|
||||
+
|
||||
+ if (!arvif->vif->bss_conf.he_support)
|
||||
+ return true;
|
||||
+
|
||||
+ param = WMI_VDEV_PARAM_SET_HEMU_MODE;
|
||||
+ value = 0;
|
||||
+ if (arvif->vif->bss_conf.he_su_beamformer) {
|
||||
+ value |= FIELD_PREP(HE_MODE_SU_TX_BFER, HE_SU_BFER_ENABLE);
|
||||
+ if (arvif->vif->bss_conf.he_mu_beamformer &&
|
||||
+ arvif->vdev_type == WMI_VDEV_TYPE_AP)
|
||||
+ value |= FIELD_PREP(HE_MODE_MU_TX_BFER, HE_MU_BFER_ENABLE);
|
||||
+ }
|
||||
+
|
||||
+ if (arvif->vif->type != NL80211_IFTYPE_MESH_POINT) {
|
||||
+ value |= FIELD_PREP(HE_MODE_DL_OFDMA, HE_DL_MUOFDMA_ENABLE) |
|
||||
+ FIELD_PREP(HE_MODE_UL_OFDMA, HE_UL_MUOFDMA_ENABLE);
|
||||
+
|
||||
+ if (arvif->vif->bss_conf.he_full_ul_mumimo)
|
||||
+ value |= FIELD_PREP(HE_MODE_UL_MUMIMO, HE_UL_MUMIMO_ENABLE);
|
||||
+
|
||||
+ if (arvif->vif->bss_conf.he_su_beamformee)
|
||||
+ value |= FIELD_PREP(HE_MODE_SU_TX_BFEE, HE_SU_BFEE_ENABLE);
|
||||
+ }
|
||||
+
|
||||
+ ret = ath11k_wmi_vdev_set_param_cmd(ar, arvif->vdev_id, param, value);
|
||||
+ if (ret) {
|
||||
+ ath11k_warn(ar->ab, "failed to set vdev %d HE MU mode: %d\n",
|
||||
+ arvif->vdev_id, ret);
|
||||
+ return false;
|
||||
+ }
|
||||
+
|
||||
+ param = WMI_VDEV_PARAM_SET_HE_SOUNDING_MODE;
|
||||
+ value = FIELD_PREP(HE_VHT_SOUNDING_MODE, HE_VHT_SOUNDING_MODE_ENABLE) |
|
||||
+ FIELD_PREP(HE_TRIG_NONTRIG_SOUNDING_MODE,
|
||||
+ HE_TRIG_NONTRIG_SOUNDING_MODE_ENABLE);
|
||||
+ ret = ath11k_wmi_vdev_set_param_cmd(ar, arvif->vdev_id,
|
||||
+ param, value);
|
||||
+ if (ret) {
|
||||
+ ath11k_warn(ar->ab, "failed to set vdev %d sounding mode: %d\n",
|
||||
+ arvif->vdev_id, ret);
|
||||
+ return false;
|
||||
+ }
|
||||
+ return true;
|
||||
+}
|
||||
+
|
||||
+static bool ath11k_mac_vif_recalc_sta_he_txbf(struct ath11k *ar,
|
||||
+ struct ieee80211_vif *vif,
|
||||
+ struct ieee80211_sta_he_cap *he_cap)
|
||||
+{
|
||||
+ struct ath11k_vif *arvif = (void *)vif->drv_priv;
|
||||
+ struct ieee80211_he_cap_elem he_cap_elem = {0};
|
||||
+ struct ieee80211_sta_he_cap *cap_band = NULL;
|
||||
+ struct cfg80211_chan_def def;
|
||||
+ u32 param = WMI_VDEV_PARAM_SET_HEMU_MODE;
|
||||
+ u32 hemode = 0;
|
||||
+ int ret;
|
||||
+
|
||||
+ if (!vif->bss_conf.he_support)
|
||||
+ return true;
|
||||
+
|
||||
+ if (vif->type != NL80211_IFTYPE_STATION)
|
||||
+ return false;
|
||||
+
|
||||
+ if (WARN_ON(ath11k_mac_vif_chan(vif, &def)))
|
||||
+ return false;
|
||||
+
|
||||
+ if (def.chan->band == NL80211_BAND_2GHZ)
|
||||
+ cap_band = &ar->mac.iftype[NL80211_BAND_2GHZ][vif->type].he_cap;
|
||||
+ else
|
||||
+ cap_band = &ar->mac.iftype[NL80211_BAND_5GHZ][vif->type].he_cap;
|
||||
+
|
||||
+ memcpy(&he_cap_elem, &cap_band->he_cap_elem, sizeof(he_cap_elem));
|
||||
+
|
||||
+ if (HECAP_PHY_SUBFME_GET(he_cap_elem.phy_cap_info)) {
|
||||
+ if (HECAP_PHY_SUBFMR_GET(he_cap->he_cap_elem.phy_cap_info))
|
||||
+ hemode |= FIELD_PREP(HE_MODE_SU_TX_BFEE, HE_SU_BFEE_ENABLE);
|
||||
+ if (HECAP_PHY_MUBFMR_GET(he_cap->he_cap_elem.phy_cap_info))
|
||||
+ hemode |= FIELD_PREP(HE_MODE_MU_TX_BFEE, HE_MU_BFEE_ENABLE);
|
||||
+ }
|
||||
+
|
||||
+ if (vif->type != NL80211_IFTYPE_MESH_POINT) {
|
||||
+ hemode |= FIELD_PREP(HE_MODE_DL_OFDMA, HE_DL_MUOFDMA_ENABLE) |
|
||||
+ FIELD_PREP(HE_MODE_UL_OFDMA, HE_UL_MUOFDMA_ENABLE);
|
||||
+
|
||||
+ if (HECAP_PHY_ULMUMIMO_GET(he_cap_elem.phy_cap_info))
|
||||
+ if (HECAP_PHY_ULMUMIMO_GET(he_cap->he_cap_elem.phy_cap_info))
|
||||
+ hemode |= FIELD_PREP(HE_MODE_UL_MUMIMO,
|
||||
+ HE_UL_MUMIMO_ENABLE);
|
||||
+
|
||||
+ if (FIELD_GET(HE_MODE_MU_TX_BFEE, hemode))
|
||||
+ hemode |= FIELD_PREP(HE_MODE_SU_TX_BFEE, HE_SU_BFEE_ENABLE);
|
||||
+
|
||||
+ if (FIELD_GET(HE_MODE_MU_TX_BFER, hemode))
|
||||
+ hemode |= FIELD_PREP(HE_MODE_SU_TX_BFER, HE_SU_BFER_ENABLE);
|
||||
+ }
|
||||
+
|
||||
+ ret = ath11k_wmi_vdev_set_param_cmd(ar, arvif->vdev_id, param, hemode);
|
||||
+ if (ret) {
|
||||
+ ath11k_warn(ar->ab, "failed to submit vdev param txbf 0x%x: %d\n",
|
||||
+ hemode, ret);
|
||||
+ return false;
|
||||
+ }
|
||||
+
|
||||
+ return true;
|
||||
+}
|
||||
+
|
||||
static void ath11k_bss_assoc(struct ieee80211_hw *hw,
|
||||
struct ieee80211_vif *vif,
|
||||
struct ieee80211_bss_conf *bss_conf)
|
||||
@@ -2709,6 +2820,7 @@ static void ath11k_bss_assoc(struct ieee
|
||||
struct ieee80211_sta *ap_sta;
|
||||
struct ath11k_peer *peer;
|
||||
bool is_auth = false;
|
||||
+ struct ieee80211_sta_he_cap he_cap;
|
||||
int ret;
|
||||
|
||||
lockdep_assert_held(&ar->conf_mutex);
|
||||
@@ -2726,6 +2838,9 @@ static void ath11k_bss_assoc(struct ieee
|
||||
return;
|
||||
}
|
||||
|
||||
+ /* he_cap here is updated at assoc success for sta mode only */
|
||||
+ he_cap = ap_sta->deflink.he_cap;
|
||||
+
|
||||
ath11k_peer_assoc_prepare(ar, vif, ap_sta, &peer_arg, false);
|
||||
|
||||
rcu_read_unlock();
|
||||
@@ -2753,6 +2868,12 @@ static void ath11k_bss_assoc(struct ieee
|
||||
return;
|
||||
}
|
||||
|
||||
+ if (!ath11k_mac_vif_recalc_sta_he_txbf(ar, vif, &he_cap)) {
|
||||
+ ath11k_warn(ar->ab, "failed to recalc he txbf for vdev %i on bss %pM\n",
|
||||
+ arvif->vdev_id, bss_conf->bssid);
|
||||
+ return;
|
||||
+ }
|
||||
+
|
||||
WARN_ON(arvif->is_up);
|
||||
|
||||
arvif->aid = vif->cfg.aid;
|
||||
@@ -3202,6 +3323,8 @@ static void ath11k_mac_op_bss_info_chang
|
||||
ether_addr_copy(arvif->bssid, info->bssid);
|
||||
|
||||
if (changed & BSS_CHANGED_BEACON_ENABLED) {
|
||||
+ if (info->enable_beacon)
|
||||
+ ath11k_mac_set_he_txbf_conf(arvif);
|
||||
ath11k_control_beaconing(arvif, info);
|
||||
|
||||
if (arvif->is_up && vif->bss_conf.he_support &&
|
||||
@@ -5392,6 +5515,10 @@ static int ath11k_mac_copy_he_cap(struct
|
||||
|
||||
he_cap_elem->mac_cap_info[1] &=
|
||||
IEEE80211_HE_MAC_CAP1_TF_MAC_PAD_DUR_MASK;
|
||||
+ he_cap_elem->phy_cap_info[0] &=
|
||||
+ ~IEEE80211_HE_PHY_CAP0_CHANNEL_WIDTH_SET_160MHZ_IN_5G;
|
||||
+ he_cap_elem->phy_cap_info[0] &=
|
||||
+ ~IEEE80211_HE_PHY_CAP0_CHANNEL_WIDTH_SET_80PLUS80_MHZ_IN_5G;
|
||||
|
||||
he_cap_elem->phy_cap_info[5] &=
|
||||
~IEEE80211_HE_PHY_CAP5_BEAMFORMEE_NUM_SND_DIM_UNDER_80MHZ_MASK;
|
||||
@@ -6026,69 +6153,6 @@ ath11k_mac_setup_vdev_create_params(stru
|
||||
}
|
||||
}
|
||||
|
||||
-static u32
|
||||
-ath11k_mac_prepare_he_mode(struct ath11k_pdev *pdev, u32 viftype)
|
||||
-{
|
||||
- struct ath11k_pdev_cap *pdev_cap = &pdev->cap;
|
||||
- struct ath11k_band_cap *cap_band = NULL;
|
||||
- u32 *hecap_phy_ptr = NULL;
|
||||
- u32 hemode = 0;
|
||||
-
|
||||
- if (pdev->cap.supported_bands & WMI_HOST_WLAN_2G_CAP)
|
||||
- cap_band = &pdev_cap->band[NL80211_BAND_2GHZ];
|
||||
- else
|
||||
- cap_band = &pdev_cap->band[NL80211_BAND_5GHZ];
|
||||
-
|
||||
- hecap_phy_ptr = &cap_band->he_cap_phy_info[0];
|
||||
-
|
||||
- hemode = FIELD_PREP(HE_MODE_SU_TX_BFEE, HE_SU_BFEE_ENABLE) |
|
||||
- FIELD_PREP(HE_MODE_SU_TX_BFER, HECAP_PHY_SUBFMR_GET(hecap_phy_ptr)) |
|
||||
- FIELD_PREP(HE_MODE_UL_MUMIMO, HECAP_PHY_ULMUMIMO_GET(hecap_phy_ptr));
|
||||
-
|
||||
- /* TODO WDS and other modes */
|
||||
- if (viftype == NL80211_IFTYPE_AP) {
|
||||
- hemode |= FIELD_PREP(HE_MODE_MU_TX_BFER,
|
||||
- HECAP_PHY_MUBFMR_GET(hecap_phy_ptr)) |
|
||||
- FIELD_PREP(HE_MODE_DL_OFDMA, HE_DL_MUOFDMA_ENABLE) |
|
||||
- FIELD_PREP(HE_MODE_UL_OFDMA, HE_UL_MUOFDMA_ENABLE);
|
||||
- } else {
|
||||
- hemode |= FIELD_PREP(HE_MODE_MU_TX_BFEE, HE_MU_BFEE_ENABLE);
|
||||
- }
|
||||
-
|
||||
- return hemode;
|
||||
-}
|
||||
-
|
||||
-static int ath11k_set_he_mu_sounding_mode(struct ath11k *ar,
|
||||
- struct ath11k_vif *arvif)
|
||||
-{
|
||||
- u32 param_id, param_value;
|
||||
- struct ath11k_base *ab = ar->ab;
|
||||
- int ret = 0;
|
||||
-
|
||||
- param_id = WMI_VDEV_PARAM_SET_HEMU_MODE;
|
||||
- param_value = ath11k_mac_prepare_he_mode(ar->pdev, arvif->vif->type);
|
||||
- ret = ath11k_wmi_vdev_set_param_cmd(ar, arvif->vdev_id,
|
||||
- param_id, param_value);
|
||||
- if (ret) {
|
||||
- ath11k_warn(ab, "failed to set vdev %d HE MU mode: %d param_value %x\n",
|
||||
- arvif->vdev_id, ret, param_value);
|
||||
- return ret;
|
||||
- }
|
||||
- param_id = WMI_VDEV_PARAM_SET_HE_SOUNDING_MODE;
|
||||
- param_value =
|
||||
- FIELD_PREP(HE_VHT_SOUNDING_MODE, HE_VHT_SOUNDING_MODE_ENABLE) |
|
||||
- FIELD_PREP(HE_TRIG_NONTRIG_SOUNDING_MODE,
|
||||
- HE_TRIG_NONTRIG_SOUNDING_MODE_ENABLE);
|
||||
- ret = ath11k_wmi_vdev_set_param_cmd(ar, arvif->vdev_id,
|
||||
- param_id, param_value);
|
||||
- if (ret) {
|
||||
- ath11k_warn(ab, "failed to set vdev %d HE MU mode: %d\n",
|
||||
- arvif->vdev_id, ret);
|
||||
- return ret;
|
||||
- }
|
||||
- return ret;
|
||||
-}
|
||||
-
|
||||
static void ath11k_mac_op_update_vif_offload(struct ieee80211_hw *hw,
|
||||
struct ieee80211_vif *vif)
|
||||
{
|
||||
@@ -6757,7 +6821,6 @@ ath11k_mac_vdev_start_restart(struct ath
|
||||
struct ath11k_base *ab = ar->ab;
|
||||
struct wmi_vdev_start_req_arg arg = {};
|
||||
const struct cfg80211_chan_def *chandef = &ctx->def;
|
||||
- int he_support = arvif->vif->bss_conf.he_support;
|
||||
int ret = 0;
|
||||
|
||||
lockdep_assert_held(&ar->conf_mutex);
|
||||
@@ -6798,15 +6861,6 @@ ath11k_mac_vdev_start_restart(struct ath
|
||||
spin_lock_bh(&ab->base_lock);
|
||||
arg.regdomain = ar->ab->dfs_region;
|
||||
spin_unlock_bh(&ab->base_lock);
|
||||
-
|
||||
- if (he_support) {
|
||||
- ret = ath11k_set_he_mu_sounding_mode(ar, arvif);
|
||||
- if (ret) {
|
||||
- ath11k_warn(ar->ab, "failed to set he mode vdev %i\n",
|
||||
- arg.vdev_id);
|
||||
- return ret;
|
||||
- }
|
||||
- }
|
||||
}
|
||||
|
||||
arg.channel.passive |= !!(chandef->chan->flags & IEEE80211_CHAN_NO_IR);
|
||||
--- a/drivers/net/wireless/ath/ath11k/wmi.h
|
||||
+++ b/drivers/net/wireless/ath/ath11k/wmi.h
|
||||
@@ -2897,8 +2897,11 @@ struct rx_reorder_queue_remove_params {
|
||||
#define HE_DL_MUOFDMA_ENABLE 1
|
||||
#define HE_UL_MUOFDMA_ENABLE 1
|
||||
#define HE_DL_MUMIMO_ENABLE 1
|
||||
+#define HE_UL_MUMIMO_ENABLE 1
|
||||
#define HE_MU_BFEE_ENABLE 1
|
||||
#define HE_SU_BFEE_ENABLE 1
|
||||
+#define HE_MU_BFER_ENABLE 1
|
||||
+#define HE_SU_BFER_ENABLE 1
|
||||
|
||||
#define HE_VHT_SOUNDING_MODE_ENABLE 1
|
||||
#define HE_SU_MU_SOUNDING_MODE_ENABLE 1
|
@ -0,0 +1,67 @@
|
||||
From 8077c1bbbc28e527fb29143c46f32c6a9d6cadf0 Mon Sep 17 00:00:00 2001
|
||||
From: Muna Sinada <quic_msinada@quicinc.com>
|
||||
Date: Fri, 24 Feb 2023 12:28:04 +0200
|
||||
Subject: [PATCH] wifi: ath11k: move HE MCS mapper to a separate function
|
||||
|
||||
Move HE MCS mapper to a separate function and call new function
|
||||
in ath11k_mac_copy_he_cap().
|
||||
|
||||
Tested-on: IPQ8074 hw2.0 AHB WLAN.HK.2.4.0.1-00356-QCAHKSWPL_SILICONZ-1
|
||||
|
||||
Signed-off-by: Muna Sinada <quic_msinada@quicinc.com>
|
||||
Signed-off-by: Kalle Valo <quic_kvalo@quicinc.com>
|
||||
Link: https://lore.kernel.org/r/1666128501-12364-4-git-send-email-quic_msinada@quicinc.com
|
||||
---
|
||||
drivers/net/wireless/ath/ath11k/mac.c | 34 +++++++++++++++++----------
|
||||
1 file changed, 22 insertions(+), 12 deletions(-)
|
||||
|
||||
--- a/drivers/net/wireless/ath/ath11k/mac.c
|
||||
+++ b/drivers/net/wireless/ath/ath11k/mac.c
|
||||
@@ -5483,6 +5483,27 @@ static __le16 ath11k_mac_setup_he_6ghz_c
|
||||
return cpu_to_le16(bcap->he_6ghz_capa);
|
||||
}
|
||||
|
||||
+static void ath11k_mac_set_hemcsmap(struct ath11k *ar,
|
||||
+ struct ath11k_pdev_cap *cap,
|
||||
+ struct ieee80211_sta_he_cap *he_cap,
|
||||
+ int band)
|
||||
+{
|
||||
+ struct ath11k_band_cap *band_cap = &cap->band[band];
|
||||
+
|
||||
+ he_cap->he_mcs_nss_supp.rx_mcs_80 =
|
||||
+ cpu_to_le16(band_cap->he_mcs & 0xffff);
|
||||
+ he_cap->he_mcs_nss_supp.tx_mcs_80 =
|
||||
+ cpu_to_le16(band_cap->he_mcs & 0xffff);
|
||||
+ he_cap->he_mcs_nss_supp.rx_mcs_160 =
|
||||
+ cpu_to_le16((band_cap->he_mcs >> 16) & 0xffff);
|
||||
+ he_cap->he_mcs_nss_supp.tx_mcs_160 =
|
||||
+ cpu_to_le16((band_cap->he_mcs >> 16) & 0xffff);
|
||||
+ he_cap->he_mcs_nss_supp.rx_mcs_80p80 =
|
||||
+ cpu_to_le16((band_cap->he_mcs >> 16) & 0xffff);
|
||||
+ he_cap->he_mcs_nss_supp.tx_mcs_80p80 =
|
||||
+ cpu_to_le16((band_cap->he_mcs >> 16) & 0xffff);
|
||||
+}
|
||||
+
|
||||
static int ath11k_mac_copy_he_cap(struct ath11k *ar,
|
||||
struct ath11k_pdev_cap *cap,
|
||||
struct ieee80211_sband_iftype_data *data,
|
||||
@@ -5544,18 +5565,7 @@ static int ath11k_mac_copy_he_cap(struct
|
||||
break;
|
||||
}
|
||||
|
||||
- he_cap->he_mcs_nss_supp.rx_mcs_80 =
|
||||
- cpu_to_le16(band_cap->he_mcs & 0xffff);
|
||||
- he_cap->he_mcs_nss_supp.tx_mcs_80 =
|
||||
- cpu_to_le16(band_cap->he_mcs & 0xffff);
|
||||
- he_cap->he_mcs_nss_supp.rx_mcs_160 =
|
||||
- cpu_to_le16((band_cap->he_mcs >> 16) & 0xffff);
|
||||
- he_cap->he_mcs_nss_supp.tx_mcs_160 =
|
||||
- cpu_to_le16((band_cap->he_mcs >> 16) & 0xffff);
|
||||
- he_cap->he_mcs_nss_supp.rx_mcs_80p80 =
|
||||
- cpu_to_le16((band_cap->he_mcs >> 16) & 0xffff);
|
||||
- he_cap->he_mcs_nss_supp.tx_mcs_80p80 =
|
||||
- cpu_to_le16((band_cap->he_mcs >> 16) & 0xffff);
|
||||
+ ath11k_mac_set_hemcsmap(ar, cap, he_cap, band);
|
||||
|
||||
memset(he_cap->ppe_thres, 0, sizeof(he_cap->ppe_thres));
|
||||
if (he_cap_elem->phy_cap_info[6] &
|
@ -0,0 +1,64 @@
|
||||
From ebf82988f844dd98e6b007cffcc5e95986056995 Mon Sep 17 00:00:00 2001
|
||||
From: Muna Sinada <quic_msinada@quicinc.com>
|
||||
Date: Fri, 24 Feb 2023 12:28:04 +0200
|
||||
Subject: [PATCH] wifi: ath11k: generate rx and tx mcs maps for supported HE
|
||||
mcs
|
||||
|
||||
Generate rx and tx mcs maps in ath11k_mac_set_hemcsmap() and set them
|
||||
in supported mcs/nss for HE capabilities.
|
||||
|
||||
Tested-on: IPQ8074 hw2.0 AHB WLAN.HK.2.4.0.1-00356-QCAHKSWPL_SILICONZ-1
|
||||
|
||||
Signed-off-by: Muna Sinada <quic_msinada@quicinc.com>
|
||||
Signed-off-by: Kalle Valo <quic_kvalo@quicinc.com>
|
||||
Link: https://lore.kernel.org/r/1666128501-12364-5-git-send-email-quic_msinada@quicinc.com
|
||||
---
|
||||
drivers/net/wireless/ath/ath11k/mac.c | 30 ++++++++++++++++++++-------
|
||||
1 file changed, 23 insertions(+), 7 deletions(-)
|
||||
|
||||
--- a/drivers/net/wireless/ath/ath11k/mac.c
|
||||
+++ b/drivers/net/wireless/ath/ath11k/mac.c
|
||||
@@ -5488,20 +5488,36 @@ static void ath11k_mac_set_hemcsmap(stru
|
||||
struct ieee80211_sta_he_cap *he_cap,
|
||||
int band)
|
||||
{
|
||||
- struct ath11k_band_cap *band_cap = &cap->band[band];
|
||||
+ u16 txmcs_map, rxmcs_map;
|
||||
+ u32 i;
|
||||
|
||||
+ rxmcs_map = 0;
|
||||
+ txmcs_map = 0;
|
||||
+ for (i = 0; i < 8; i++) {
|
||||
+ if (i < ar->num_tx_chains &&
|
||||
+ (ar->cfg_tx_chainmask >> cap->tx_chain_mask_shift) & BIT(i))
|
||||
+ txmcs_map |= IEEE80211_HE_MCS_SUPPORT_0_11 << (i * 2);
|
||||
+ else
|
||||
+ txmcs_map |= IEEE80211_HE_MCS_NOT_SUPPORTED << (i * 2);
|
||||
+
|
||||
+ if (i < ar->num_rx_chains &&
|
||||
+ (ar->cfg_rx_chainmask >> cap->tx_chain_mask_shift) & BIT(i))
|
||||
+ rxmcs_map |= IEEE80211_HE_MCS_SUPPORT_0_11 << (i * 2);
|
||||
+ else
|
||||
+ rxmcs_map |= IEEE80211_HE_MCS_NOT_SUPPORTED << (i * 2);
|
||||
+ }
|
||||
he_cap->he_mcs_nss_supp.rx_mcs_80 =
|
||||
- cpu_to_le16(band_cap->he_mcs & 0xffff);
|
||||
+ cpu_to_le16(rxmcs_map & 0xffff);
|
||||
he_cap->he_mcs_nss_supp.tx_mcs_80 =
|
||||
- cpu_to_le16(band_cap->he_mcs & 0xffff);
|
||||
+ cpu_to_le16(txmcs_map & 0xffff);
|
||||
he_cap->he_mcs_nss_supp.rx_mcs_160 =
|
||||
- cpu_to_le16((band_cap->he_mcs >> 16) & 0xffff);
|
||||
+ cpu_to_le16(rxmcs_map & 0xffff);
|
||||
he_cap->he_mcs_nss_supp.tx_mcs_160 =
|
||||
- cpu_to_le16((band_cap->he_mcs >> 16) & 0xffff);
|
||||
+ cpu_to_le16(txmcs_map & 0xffff);
|
||||
he_cap->he_mcs_nss_supp.rx_mcs_80p80 =
|
||||
- cpu_to_le16((band_cap->he_mcs >> 16) & 0xffff);
|
||||
+ cpu_to_le16(rxmcs_map & 0xffff);
|
||||
he_cap->he_mcs_nss_supp.tx_mcs_80p80 =
|
||||
- cpu_to_le16((band_cap->he_mcs >> 16) & 0xffff);
|
||||
+ cpu_to_le16(txmcs_map & 0xffff);
|
||||
}
|
||||
|
||||
static int ath11k_mac_copy_he_cap(struct ath11k *ar,
|
@ -0,0 +1,150 @@
|
||||
From 01c6c9fccbd51c1d9eab0f5794b0271b026178df Mon Sep 17 00:00:00 2001
|
||||
From: Abinaya Kalaiselvan <quic_akalaise@quicinc.com>
|
||||
Date: Mon, 19 Dec 2022 11:08:44 +0530
|
||||
Subject: [PATCH] wifi: ath11k: Add tx ack signal support for management
|
||||
packets
|
||||
|
||||
Add support to notify tx ack signal values for management
|
||||
packets to userspace through nl80211 interface.
|
||||
|
||||
Advertise NL80211_EXT_FEATURE_ACK_SIGNAL_SUPPORT flag
|
||||
to enable this feature and it will be used for data
|
||||
packets as well.
|
||||
|
||||
Tested-on: IPQ8074 hw2.0 AHB WLAN.HK.2.7.0.1-01744-QCAHKSWPL_SILICONZ-1
|
||||
|
||||
Signed-off-by: Abinaya Kalaiselvan <quic_akalaise@quicinc.com>
|
||||
Signed-off-by: Maharaja Kennadyrajan <quic_mkenna@quicinc.com>
|
||||
Signed-off-by: Kalle Valo <quic_kvalo@quicinc.com>
|
||||
Link: https://lore.kernel.org/r/20221219053844.4084486-1-quic_mkenna@quicinc.com
|
||||
---
|
||||
drivers/net/wireless/ath/ath11k/hw.c | 1 +
|
||||
drivers/net/wireless/ath/ath11k/mac.c | 5 +++++
|
||||
drivers/net/wireless/ath/ath11k/wmi.c | 27 ++++++++++++++++-----------
|
||||
drivers/net/wireless/ath/ath11k/wmi.h | 3 +++
|
||||
4 files changed, 25 insertions(+), 11 deletions(-)
|
||||
|
||||
--- a/drivers/net/wireless/ath/ath11k/hw.c
|
||||
+++ b/drivers/net/wireless/ath/ath11k/hw.c
|
||||
@@ -201,6 +201,7 @@ static void ath11k_init_wmi_config_ipq80
|
||||
config->twt_ap_pdev_count = ab->num_radios;
|
||||
config->twt_ap_sta_count = 1000;
|
||||
config->flag1 |= WMI_RSRC_CFG_FLAG1_BSS_CHANNEL_INFO_64;
|
||||
+ config->flag1 |= WMI_RSRC_CFG_FLAG1_ACK_RSSI;
|
||||
}
|
||||
|
||||
static int ath11k_hw_mac_id_to_pdev_id_ipq8074(struct ath11k_hw_params *hw,
|
||||
--- a/drivers/net/wireless/ath/ath11k/mac.c
|
||||
+++ b/drivers/net/wireless/ath/ath11k/mac.c
|
||||
@@ -9174,6 +9174,11 @@ static int __ath11k_mac_register(struct
|
||||
goto err_free_if_combs;
|
||||
}
|
||||
|
||||
+ if (test_bit(WMI_TLV_SERVICE_TX_DATA_MGMT_ACK_RSSI,
|
||||
+ ar->ab->wmi_ab.svc_map))
|
||||
+ wiphy_ext_feature_set(ar->hw->wiphy,
|
||||
+ NL80211_EXT_FEATURE_ACK_SIGNAL_SUPPORT);
|
||||
+
|
||||
ar->hw->queues = ATH11K_HW_MAX_QUEUES;
|
||||
ar->hw->wiphy->tx_queue_len = ATH11K_QUEUE_LEN;
|
||||
ar->hw->offchannel_tx_hw_queue = ATH11K_HW_MAX_QUEUES - 1;
|
||||
--- a/drivers/net/wireless/ath/ath11k/wmi.c
|
||||
+++ b/drivers/net/wireless/ath/ath11k/wmi.c
|
||||
@@ -5229,8 +5229,8 @@ static int ath11k_pull_mgmt_rx_params_tl
|
||||
return 0;
|
||||
}
|
||||
|
||||
-static int wmi_process_mgmt_tx_comp(struct ath11k *ar, u32 desc_id,
|
||||
- u32 status)
|
||||
+static int wmi_process_mgmt_tx_comp(struct ath11k *ar,
|
||||
+ struct wmi_mgmt_tx_compl_event *tx_compl_param)
|
||||
{
|
||||
struct sk_buff *msdu;
|
||||
struct ieee80211_tx_info *info;
|
||||
@@ -5238,24 +5238,29 @@ static int wmi_process_mgmt_tx_comp(stru
|
||||
int num_mgmt;
|
||||
|
||||
spin_lock_bh(&ar->txmgmt_idr_lock);
|
||||
- msdu = idr_find(&ar->txmgmt_idr, desc_id);
|
||||
+ msdu = idr_find(&ar->txmgmt_idr, tx_compl_param->desc_id);
|
||||
|
||||
if (!msdu) {
|
||||
ath11k_warn(ar->ab, "received mgmt tx compl for invalid msdu_id: %d\n",
|
||||
- desc_id);
|
||||
+ tx_compl_param->desc_id);
|
||||
spin_unlock_bh(&ar->txmgmt_idr_lock);
|
||||
return -ENOENT;
|
||||
}
|
||||
|
||||
- idr_remove(&ar->txmgmt_idr, desc_id);
|
||||
+ idr_remove(&ar->txmgmt_idr, tx_compl_param->desc_id);
|
||||
spin_unlock_bh(&ar->txmgmt_idr_lock);
|
||||
|
||||
skb_cb = ATH11K_SKB_CB(msdu);
|
||||
dma_unmap_single(ar->ab->dev, skb_cb->paddr, msdu->len, DMA_TO_DEVICE);
|
||||
|
||||
info = IEEE80211_SKB_CB(msdu);
|
||||
- if ((!(info->flags & IEEE80211_TX_CTL_NO_ACK)) && !status)
|
||||
+ if ((!(info->flags & IEEE80211_TX_CTL_NO_ACK)) &&
|
||||
+ !tx_compl_param->status) {
|
||||
info->flags |= IEEE80211_TX_STAT_ACK;
|
||||
+ if (test_bit(WMI_TLV_SERVICE_TX_DATA_MGMT_ACK_RSSI,
|
||||
+ ar->ab->wmi_ab.svc_map))
|
||||
+ info->status.ack_signal = tx_compl_param->ack_rssi;
|
||||
+ }
|
||||
|
||||
ieee80211_tx_status_irqsafe(ar->hw, msdu);
|
||||
|
||||
@@ -5267,7 +5272,7 @@ static int wmi_process_mgmt_tx_comp(stru
|
||||
|
||||
ath11k_dbg(ar->ab, ATH11K_DBG_WMI,
|
||||
"wmi mgmt tx comp pending %d desc id %d\n",
|
||||
- num_mgmt, desc_id);
|
||||
+ num_mgmt, tx_compl_param->desc_id);
|
||||
|
||||
if (!num_mgmt)
|
||||
wake_up(&ar->txmgmt_empty_waitq);
|
||||
@@ -5300,6 +5305,7 @@ static int ath11k_pull_mgmt_tx_compl_par
|
||||
param->pdev_id = ev->pdev_id;
|
||||
param->desc_id = ev->desc_id;
|
||||
param->status = ev->status;
|
||||
+ param->ack_rssi = ev->ack_rssi;
|
||||
|
||||
kfree(tb);
|
||||
return 0;
|
||||
@@ -7070,13 +7076,12 @@ static void ath11k_mgmt_tx_compl_event(s
|
||||
goto exit;
|
||||
}
|
||||
|
||||
- wmi_process_mgmt_tx_comp(ar, tx_compl_param.desc_id,
|
||||
- tx_compl_param.status);
|
||||
+ wmi_process_mgmt_tx_comp(ar, &tx_compl_param);
|
||||
|
||||
ath11k_dbg(ab, ATH11K_DBG_MGMT,
|
||||
- "mgmt tx compl ev pdev_id %d, desc_id %d, status %d",
|
||||
+ "mgmt tx compl ev pdev_id %d, desc_id %d, status %d ack_rssi %d",
|
||||
tx_compl_param.pdev_id, tx_compl_param.desc_id,
|
||||
- tx_compl_param.status);
|
||||
+ tx_compl_param.status, tx_compl_param.ack_rssi);
|
||||
|
||||
exit:
|
||||
rcu_read_unlock();
|
||||
--- a/drivers/net/wireless/ath/ath11k/wmi.h
|
||||
+++ b/drivers/net/wireless/ath/ath11k/wmi.h
|
||||
@@ -2311,6 +2311,7 @@ struct wmi_init_cmd {
|
||||
} __packed;
|
||||
|
||||
#define WMI_RSRC_CFG_FLAG1_BSS_CHANNEL_INFO_64 BIT(5)
|
||||
+#define WMI_RSRC_CFG_FLAG1_ACK_RSSI BIT(18)
|
||||
|
||||
struct wmi_resource_config {
|
||||
u32 tlv_header;
|
||||
@@ -4550,6 +4551,8 @@ struct wmi_mgmt_tx_compl_event {
|
||||
u32 desc_id;
|
||||
u32 status;
|
||||
u32 pdev_id;
|
||||
+ u32 ppdu_id;
|
||||
+ u32 ack_rssi;
|
||||
} __packed;
|
||||
|
||||
struct wmi_scan_event {
|
@ -0,0 +1,216 @@
|
||||
From 25e289e1f52e1f4fb1d07622c6a24f8d8a8e420d Mon Sep 17 00:00:00 2001
|
||||
From: Aditya Kumar Singh <quic_adisi@quicinc.com>
|
||||
Date: Wed, 1 Mar 2023 16:20:58 +0200
|
||||
Subject: [PATCH] wifi: ath11k: use proper regulatory reference for bands
|
||||
|
||||
Currently, during regulatory event, 2 GHz/5 GHz is referred
|
||||
to as 2G/5G including variable names. However, there is no
|
||||
such entity as 2G or 5G.
|
||||
|
||||
Re-name such occurences to its proper name. No functional changes.
|
||||
|
||||
Tested-on: IPQ8074 hw2.0 AHB WLAN.HK.2.7.0.1-01744-QCAHKSWPL_SILICONZ-1
|
||||
Tested-on: QCN9074 hw1.0 PCI WLAN.HK.2.7.0.1-01744-QCAHKSWPL_SILICONZ-1
|
||||
Tested-on: QCN9074 hw1.0 PCI WLAN.HK.2.5.0.1-01100-QCAHKSWPL_SILICONZ-1
|
||||
|
||||
Signed-off-by: Aditya Kumar Singh <quic_adisi@quicinc.com>
|
||||
Signed-off-by: Kalle Valo <quic_kvalo@quicinc.com>
|
||||
Link: https://lore.kernel.org/r/20230110121024.14051-2-quic_adisi@quicinc.com
|
||||
---
|
||||
drivers/net/wireless/ath/ath11k/reg.c | 20 ++++-----
|
||||
drivers/net/wireless/ath/ath11k/wmi.c | 58 ++++++++++++++-------------
|
||||
drivers/net/wireless/ath/ath11k/wmi.h | 28 ++++++-------
|
||||
3 files changed, 54 insertions(+), 52 deletions(-)
|
||||
|
||||
--- a/drivers/net/wireless/ath/ath11k/reg.c
|
||||
+++ b/drivers/net/wireless/ath/ath11k/reg.c
|
||||
@@ -619,7 +619,7 @@ ath11k_reg_build_regd(struct ath11k_base
|
||||
u32 flags;
|
||||
char alpha2[3];
|
||||
|
||||
- num_rules = reg_info->num_5g_reg_rules + reg_info->num_2g_reg_rules;
|
||||
+ num_rules = reg_info->num_5ghz_reg_rules + reg_info->num_2ghz_reg_rules;
|
||||
|
||||
if (!num_rules)
|
||||
goto ret;
|
||||
@@ -644,20 +644,20 @@ ath11k_reg_build_regd(struct ath11k_base
|
||||
alpha2, ath11k_reg_get_regdom_str(tmp_regd->dfs_region),
|
||||
reg_info->dfs_region, num_rules);
|
||||
/* Update reg_rules[] below. Firmware is expected to
|
||||
- * send these rules in order(2G rules first and then 5G)
|
||||
+ * send these rules in order(2 GHz rules first and then 5 GHz)
|
||||
*/
|
||||
for (; i < num_rules; i++) {
|
||||
- if (reg_info->num_2g_reg_rules &&
|
||||
- (i < reg_info->num_2g_reg_rules)) {
|
||||
- reg_rule = reg_info->reg_rules_2g_ptr + i;
|
||||
+ if (reg_info->num_2ghz_reg_rules &&
|
||||
+ (i < reg_info->num_2ghz_reg_rules)) {
|
||||
+ reg_rule = reg_info->reg_rules_2ghz_ptr + i;
|
||||
max_bw = min_t(u16, reg_rule->max_bw,
|
||||
- reg_info->max_bw_2g);
|
||||
+ reg_info->max_bw_2ghz);
|
||||
flags = 0;
|
||||
- } else if (reg_info->num_5g_reg_rules &&
|
||||
- (j < reg_info->num_5g_reg_rules)) {
|
||||
- reg_rule = reg_info->reg_rules_5g_ptr + j++;
|
||||
+ } else if (reg_info->num_5ghz_reg_rules &&
|
||||
+ (j < reg_info->num_5ghz_reg_rules)) {
|
||||
+ reg_rule = reg_info->reg_rules_5ghz_ptr + j++;
|
||||
max_bw = min_t(u16, reg_rule->max_bw,
|
||||
- reg_info->max_bw_5g);
|
||||
+ reg_info->max_bw_5ghz);
|
||||
|
||||
/* FW doesn't pass NL80211_RRF_AUTO_BW flag for
|
||||
* BW Auto correction, we can enable this by default
|
||||
--- a/drivers/net/wireless/ath/ath11k/wmi.c
|
||||
+++ b/drivers/net/wireless/ath/ath11k/wmi.c
|
||||
@@ -4959,7 +4959,7 @@ static int ath11k_pull_reg_chan_list_upd
|
||||
const void **tb;
|
||||
const struct wmi_reg_chan_list_cc_event *chan_list_event_hdr;
|
||||
struct wmi_regulatory_rule_struct *wmi_reg_rule;
|
||||
- u32 num_2g_reg_rules, num_5g_reg_rules;
|
||||
+ u32 num_2ghz_reg_rules, num_5ghz_reg_rules;
|
||||
int ret;
|
||||
|
||||
ath11k_dbg(ab, ATH11K_DBG_WMI, "processing regulatory channel list\n");
|
||||
@@ -4978,10 +4978,10 @@ static int ath11k_pull_reg_chan_list_upd
|
||||
return -EPROTO;
|
||||
}
|
||||
|
||||
- reg_info->num_2g_reg_rules = chan_list_event_hdr->num_2g_reg_rules;
|
||||
- reg_info->num_5g_reg_rules = chan_list_event_hdr->num_5g_reg_rules;
|
||||
+ reg_info->num_2ghz_reg_rules = chan_list_event_hdr->num_2ghz_reg_rules;
|
||||
+ reg_info->num_5ghz_reg_rules = chan_list_event_hdr->num_5ghz_reg_rules;
|
||||
|
||||
- if (!(reg_info->num_2g_reg_rules + reg_info->num_5g_reg_rules)) {
|
||||
+ if (!(reg_info->num_2ghz_reg_rules + reg_info->num_5ghz_reg_rules)) {
|
||||
ath11k_warn(ab, "No regulatory rules available in the event info\n");
|
||||
kfree(tb);
|
||||
return -EINVAL;
|
||||
@@ -5008,46 +5008,48 @@ static int ath11k_pull_reg_chan_list_upd
|
||||
else if (chan_list_event_hdr->status_code == WMI_REG_SET_CC_STATUS_FAIL)
|
||||
reg_info->status_code = REG_SET_CC_STATUS_FAIL;
|
||||
|
||||
- reg_info->min_bw_2g = chan_list_event_hdr->min_bw_2g;
|
||||
- reg_info->max_bw_2g = chan_list_event_hdr->max_bw_2g;
|
||||
- reg_info->min_bw_5g = chan_list_event_hdr->min_bw_5g;
|
||||
- reg_info->max_bw_5g = chan_list_event_hdr->max_bw_5g;
|
||||
+ reg_info->min_bw_2ghz = chan_list_event_hdr->min_bw_2ghz;
|
||||
+ reg_info->max_bw_2ghz = chan_list_event_hdr->max_bw_2ghz;
|
||||
+ reg_info->min_bw_5ghz = chan_list_event_hdr->min_bw_5ghz;
|
||||
+ reg_info->max_bw_5ghz = chan_list_event_hdr->max_bw_5ghz;
|
||||
|
||||
- num_2g_reg_rules = reg_info->num_2g_reg_rules;
|
||||
- num_5g_reg_rules = reg_info->num_5g_reg_rules;
|
||||
+ num_2ghz_reg_rules = reg_info->num_2ghz_reg_rules;
|
||||
+ num_5ghz_reg_rules = reg_info->num_5ghz_reg_rules;
|
||||
|
||||
ath11k_dbg(ab, ATH11K_DBG_WMI,
|
||||
- "%s:cc %s dsf %d BW: min_2g %d max_2g %d min_5g %d max_5g %d",
|
||||
+ "%s:cc %s dsf %d BW: min_2ghz %d max_2ghz %d min_5ghz %d max_5ghz %d",
|
||||
__func__, reg_info->alpha2, reg_info->dfs_region,
|
||||
- reg_info->min_bw_2g, reg_info->max_bw_2g,
|
||||
- reg_info->min_bw_5g, reg_info->max_bw_5g);
|
||||
+ reg_info->min_bw_2ghz, reg_info->max_bw_2ghz,
|
||||
+ reg_info->min_bw_5ghz, reg_info->max_bw_5ghz);
|
||||
|
||||
ath11k_dbg(ab, ATH11K_DBG_WMI,
|
||||
- "%s: num_2g_reg_rules %d num_5g_reg_rules %d", __func__,
|
||||
- num_2g_reg_rules, num_5g_reg_rules);
|
||||
+ "%s: num_2ghz_reg_rules %d num_5ghz_reg_rules %d", __func__,
|
||||
+ num_2ghz_reg_rules, num_5ghz_reg_rules);
|
||||
|
||||
wmi_reg_rule =
|
||||
(struct wmi_regulatory_rule_struct *)((u8 *)chan_list_event_hdr
|
||||
+ sizeof(*chan_list_event_hdr)
|
||||
+ sizeof(struct wmi_tlv));
|
||||
|
||||
- if (num_2g_reg_rules) {
|
||||
- reg_info->reg_rules_2g_ptr = create_reg_rules_from_wmi(num_2g_reg_rules,
|
||||
- wmi_reg_rule);
|
||||
- if (!reg_info->reg_rules_2g_ptr) {
|
||||
+ if (num_2ghz_reg_rules) {
|
||||
+ reg_info->reg_rules_2ghz_ptr =
|
||||
+ create_reg_rules_from_wmi(num_2ghz_reg_rules,
|
||||
+ wmi_reg_rule);
|
||||
+ if (!reg_info->reg_rules_2ghz_ptr) {
|
||||
kfree(tb);
|
||||
- ath11k_warn(ab, "Unable to Allocate memory for 2g rules\n");
|
||||
+ ath11k_warn(ab, "Unable to Allocate memory for 2 GHz rules\n");
|
||||
return -ENOMEM;
|
||||
}
|
||||
}
|
||||
|
||||
- if (num_5g_reg_rules) {
|
||||
- wmi_reg_rule += num_2g_reg_rules;
|
||||
- reg_info->reg_rules_5g_ptr = create_reg_rules_from_wmi(num_5g_reg_rules,
|
||||
- wmi_reg_rule);
|
||||
- if (!reg_info->reg_rules_5g_ptr) {
|
||||
+ if (num_5ghz_reg_rules) {
|
||||
+ wmi_reg_rule += num_2ghz_reg_rules;
|
||||
+ reg_info->reg_rules_5ghz_ptr =
|
||||
+ create_reg_rules_from_wmi(num_5ghz_reg_rules,
|
||||
+ wmi_reg_rule);
|
||||
+ if (!reg_info->reg_rules_5ghz_ptr) {
|
||||
kfree(tb);
|
||||
- ath11k_warn(ab, "Unable to Allocate memory for 5g rules\n");
|
||||
+ ath11k_warn(ab, "Unable to Allocate memory for 5 GHz rules\n");
|
||||
return -ENOMEM;
|
||||
}
|
||||
}
|
||||
@@ -6619,8 +6621,8 @@ fallback:
|
||||
WARN_ON(1);
|
||||
mem_free:
|
||||
if (reg_info) {
|
||||
- kfree(reg_info->reg_rules_2g_ptr);
|
||||
- kfree(reg_info->reg_rules_5g_ptr);
|
||||
+ kfree(reg_info->reg_rules_2ghz_ptr);
|
||||
+ kfree(reg_info->reg_rules_5ghz_ptr);
|
||||
kfree(reg_info);
|
||||
}
|
||||
return ret;
|
||||
--- a/drivers/net/wireless/ath/ath11k/wmi.h
|
||||
+++ b/drivers/net/wireless/ath/ath11k/wmi.h
|
||||
@@ -4129,14 +4129,14 @@ struct cur_regulatory_info {
|
||||
u8 alpha2[REG_ALPHA2_LEN + 1];
|
||||
u32 dfs_region;
|
||||
u32 phybitmap;
|
||||
- u32 min_bw_2g;
|
||||
- u32 max_bw_2g;
|
||||
- u32 min_bw_5g;
|
||||
- u32 max_bw_5g;
|
||||
- u32 num_2g_reg_rules;
|
||||
- u32 num_5g_reg_rules;
|
||||
- struct cur_reg_rule *reg_rules_2g_ptr;
|
||||
- struct cur_reg_rule *reg_rules_5g_ptr;
|
||||
+ u32 min_bw_2ghz;
|
||||
+ u32 max_bw_2ghz;
|
||||
+ u32 min_bw_5ghz;
|
||||
+ u32 max_bw_5ghz;
|
||||
+ u32 num_2ghz_reg_rules;
|
||||
+ u32 num_5ghz_reg_rules;
|
||||
+ struct cur_reg_rule *reg_rules_2ghz_ptr;
|
||||
+ struct cur_reg_rule *reg_rules_5ghz_ptr;
|
||||
};
|
||||
|
||||
struct wmi_reg_chan_list_cc_event {
|
||||
@@ -4148,12 +4148,12 @@ struct wmi_reg_chan_list_cc_event {
|
||||
u32 domain_code;
|
||||
u32 dfs_region;
|
||||
u32 phybitmap;
|
||||
- u32 min_bw_2g;
|
||||
- u32 max_bw_2g;
|
||||
- u32 min_bw_5g;
|
||||
- u32 max_bw_5g;
|
||||
- u32 num_2g_reg_rules;
|
||||
- u32 num_5g_reg_rules;
|
||||
+ u32 min_bw_2ghz;
|
||||
+ u32 max_bw_2ghz;
|
||||
+ u32 min_bw_5ghz;
|
||||
+ u32 max_bw_5ghz;
|
||||
+ u32 num_2ghz_reg_rules;
|
||||
+ u32 num_5ghz_reg_rules;
|
||||
} __packed;
|
||||
|
||||
struct wmi_regulatory_rule_struct {
|
@ -0,0 +1,844 @@
|
||||
From 91fa00fa69224aae5afb720c5e68b22e4c4f7333 Mon Sep 17 00:00:00 2001
|
||||
From: Aditya Kumar Singh <quic_adisi@quicinc.com>
|
||||
Date: Wed, 1 Mar 2023 16:20:59 +0200
|
||||
Subject: [PATCH] wifi: ath11k: add support to parse new WMI event for 6 GHz
|
||||
|
||||
In order to support different power levels of 6 GHz AP and client,
|
||||
new WMI event for regulatory - WMI_REG_CHAN_LIST_CC_EXT_EVENTID is
|
||||
added in firmware. This event provides new parameters required for
|
||||
6 GHz regulatory rules.
|
||||
|
||||
Add support for parsing 2.4 GHz, 5 GHz and 6 GHz reg rules and other
|
||||
parameters from WMI_REG_CHAN_LIST_CC_EXT_EVENTID.
|
||||
|
||||
Tested-on: IPQ8074 hw2.0 AHB WLAN.HK.2.7.0.1-01744-QCAHKSWPL_SILICONZ-1
|
||||
Tested-on: QCN9074 hw1.0 PCI WLAN.HK.2.7.0.1-01744-QCAHKSWPL_SILICONZ-1
|
||||
Tested-on: QCN9074 hw1.0 PCI WLAN.HK.2.5.0.1-01100-QCAHKSWPL_SILICONZ-1
|
||||
|
||||
Signed-off-by: Lavanya Suresh <quic_lavaks@quicinc.com>
|
||||
Signed-off-by: Wen Gong <quic_wgong@quicinc.com>
|
||||
Signed-off-by: Aditya Kumar Singh <quic_adisi@quicinc.com>
|
||||
Signed-off-by: Kalle Valo <quic_kvalo@quicinc.com>
|
||||
Link: https://lore.kernel.org/r/20230110121024.14051-3-quic_adisi@quicinc.com
|
||||
---
|
||||
drivers/net/wireless/ath/ath11k/reg.c | 37 ++-
|
||||
drivers/net/wireless/ath/ath11k/wmi.c | 418 +++++++++++++++++++++++++-
|
||||
drivers/net/wireless/ath/ath11k/wmi.h | 163 +++++++++-
|
||||
3 files changed, 584 insertions(+), 34 deletions(-)
|
||||
|
||||
--- a/drivers/net/wireless/ath/ath11k/reg.c
|
||||
+++ b/drivers/net/wireless/ath/ath11k/reg.c
|
||||
@@ -613,7 +613,7 @@ ath11k_reg_build_regd(struct ath11k_base
|
||||
{
|
||||
struct ieee80211_regdomain *tmp_regd, *default_regd, *new_regd = NULL;
|
||||
struct cur_reg_rule *reg_rule;
|
||||
- u8 i = 0, j = 0;
|
||||
+ u8 i = 0, j = 0, k = 0;
|
||||
u8 num_rules;
|
||||
u16 max_bw;
|
||||
u32 flags;
|
||||
@@ -621,6 +621,12 @@ ath11k_reg_build_regd(struct ath11k_base
|
||||
|
||||
num_rules = reg_info->num_5ghz_reg_rules + reg_info->num_2ghz_reg_rules;
|
||||
|
||||
+ /* FIXME: Currently taking reg rules for 6 GHz only from Indoor AP mode list.
|
||||
+ * This can be updated after complete 6 GHz regulatory support is added.
|
||||
+ */
|
||||
+ if (reg_info->is_ext_reg_event)
|
||||
+ num_rules += reg_info->num_6ghz_rules_ap[WMI_REG_INDOOR_AP];
|
||||
+
|
||||
if (!num_rules)
|
||||
goto ret;
|
||||
|
||||
@@ -666,6 +672,14 @@ ath11k_reg_build_regd(struct ath11k_base
|
||||
* per other BW rule flags we pass from here
|
||||
*/
|
||||
flags = NL80211_RRF_AUTO_BW;
|
||||
+ } else if (reg_info->is_ext_reg_event &&
|
||||
+ reg_info->num_6ghz_rules_ap[WMI_REG_INDOOR_AP] &&
|
||||
+ (k < reg_info->num_6ghz_rules_ap[WMI_REG_INDOOR_AP])) {
|
||||
+ reg_rule = reg_info->reg_rules_6ghz_ap_ptr[WMI_REG_INDOOR_AP] +
|
||||
+ k++;
|
||||
+ max_bw = min_t(u16, reg_rule->max_bw,
|
||||
+ reg_info->max_bw_6ghz_ap[WMI_REG_INDOOR_AP]);
|
||||
+ flags = NL80211_RRF_AUTO_BW;
|
||||
} else {
|
||||
break;
|
||||
}
|
||||
@@ -693,12 +707,21 @@ ath11k_reg_build_regd(struct ath11k_base
|
||||
continue;
|
||||
}
|
||||
|
||||
- ath11k_dbg(ab, ATH11K_DBG_REG,
|
||||
- "\t%d. (%d - %d @ %d) (%d, %d) (%d ms) (FLAGS %d)\n",
|
||||
- i + 1, reg_rule->start_freq, reg_rule->end_freq,
|
||||
- max_bw, reg_rule->ant_gain, reg_rule->reg_power,
|
||||
- tmp_regd->reg_rules[i].dfs_cac_ms,
|
||||
- flags);
|
||||
+ if (reg_info->is_ext_reg_event) {
|
||||
+ ath11k_dbg(ab, ATH11K_DBG_REG,
|
||||
+ "\t%d. (%d - %d @ %d) (%d, %d) (%d ms) (FLAGS %d) (%d, %d)\n",
|
||||
+ i + 1, reg_rule->start_freq, reg_rule->end_freq,
|
||||
+ max_bw, reg_rule->ant_gain, reg_rule->reg_power,
|
||||
+ tmp_regd->reg_rules[i].dfs_cac_ms, flags,
|
||||
+ reg_rule->psd_flag, reg_rule->psd_eirp);
|
||||
+ } else {
|
||||
+ ath11k_dbg(ab, ATH11K_DBG_REG,
|
||||
+ "\t%d. (%d - %d @ %d) (%d, %d) (%d ms) (FLAGS %d)\n",
|
||||
+ i + 1, reg_rule->start_freq, reg_rule->end_freq,
|
||||
+ max_bw, reg_rule->ant_gain, reg_rule->reg_power,
|
||||
+ tmp_regd->reg_rules[i].dfs_cac_ms,
|
||||
+ flags);
|
||||
+ }
|
||||
}
|
||||
|
||||
tmp_regd->n_reg_rules = i;
|
||||
--- a/drivers/net/wireless/ath/ath11k/wmi.c
|
||||
+++ b/drivers/net/wireless/ath/ath11k/wmi.c
|
||||
@@ -105,6 +105,8 @@ static const struct wmi_tlv_policy wmi_t
|
||||
= { .min_len = sizeof(struct wmi_vdev_stopped_event) },
|
||||
[WMI_TAG_REG_CHAN_LIST_CC_EVENT]
|
||||
= { .min_len = sizeof(struct wmi_reg_chan_list_cc_event) },
|
||||
+ [WMI_TAG_REG_CHAN_LIST_CC_EXT_EVENT]
|
||||
+ = { .min_len = sizeof(struct wmi_reg_chan_list_cc_ext_event) },
|
||||
[WMI_TAG_MGMT_RX_HDR]
|
||||
= { .min_len = sizeof(struct wmi_mgmt_rx_hdr) },
|
||||
[WMI_TAG_MGMT_TX_COMPL_EVENT]
|
||||
@@ -3974,6 +3976,10 @@ ath11k_wmi_copy_resource_config(struct w
|
||||
wmi_cfg->sched_params = tg_cfg->sched_params;
|
||||
wmi_cfg->twt_ap_pdev_count = tg_cfg->twt_ap_pdev_count;
|
||||
wmi_cfg->twt_ap_sta_count = tg_cfg->twt_ap_sta_count;
|
||||
+ wmi_cfg->host_service_flags &=
|
||||
+ ~(1 << WMI_CFG_HOST_SERVICE_FLAG_REG_CC_EXT);
|
||||
+ wmi_cfg->host_service_flags |= (tg_cfg->is_reg_cc_ext_event_supported <<
|
||||
+ WMI_CFG_HOST_SERVICE_FLAG_REG_CC_EXT);
|
||||
}
|
||||
|
||||
static int ath11k_init_cmd_send(struct ath11k_pdev_wmi *wmi,
|
||||
@@ -4192,6 +4198,10 @@ int ath11k_wmi_cmd_init(struct ath11k_ba
|
||||
|
||||
ab->hw_params.hw_ops->wmi_init_config(ab, &config);
|
||||
|
||||
+ if (test_bit(WMI_TLV_SERVICE_REG_CC_EXT_EVENT_SUPPORT,
|
||||
+ ab->wmi_ab.svc_map))
|
||||
+ config.is_reg_cc_ext_event_supported = 1;
|
||||
+
|
||||
memcpy(&wmi_sc->wlan_resource_config, &config, sizeof(config));
|
||||
|
||||
init_param.res_cfg = &wmi_sc->wlan_resource_config;
|
||||
@@ -4995,18 +5005,11 @@ static int ath11k_pull_reg_chan_list_upd
|
||||
reg_info->phy_id = chan_list_event_hdr->phy_id;
|
||||
reg_info->ctry_code = chan_list_event_hdr->country_id;
|
||||
reg_info->reg_dmn_pair = chan_list_event_hdr->domain_code;
|
||||
- if (chan_list_event_hdr->status_code == WMI_REG_SET_CC_STATUS_PASS)
|
||||
- reg_info->status_code = REG_SET_CC_STATUS_PASS;
|
||||
- else if (chan_list_event_hdr->status_code == WMI_REG_CURRENT_ALPHA2_NOT_FOUND)
|
||||
- reg_info->status_code = REG_CURRENT_ALPHA2_NOT_FOUND;
|
||||
- else if (chan_list_event_hdr->status_code == WMI_REG_INIT_ALPHA2_NOT_FOUND)
|
||||
- reg_info->status_code = REG_INIT_ALPHA2_NOT_FOUND;
|
||||
- else if (chan_list_event_hdr->status_code == WMI_REG_SET_CC_CHANGE_NOT_ALLOWED)
|
||||
- reg_info->status_code = REG_SET_CC_CHANGE_NOT_ALLOWED;
|
||||
- else if (chan_list_event_hdr->status_code == WMI_REG_SET_CC_STATUS_NO_MEMORY)
|
||||
- reg_info->status_code = REG_SET_CC_STATUS_NO_MEMORY;
|
||||
- else if (chan_list_event_hdr->status_code == WMI_REG_SET_CC_STATUS_FAIL)
|
||||
- reg_info->status_code = REG_SET_CC_STATUS_FAIL;
|
||||
+
|
||||
+ reg_info->status_code =
|
||||
+ ath11k_wmi_cc_setting_code_to_reg(chan_list_event_hdr->status_code);
|
||||
+
|
||||
+ reg_info->is_ext_reg_event = false;
|
||||
|
||||
reg_info->min_bw_2ghz = chan_list_event_hdr->min_bw_2ghz;
|
||||
reg_info->max_bw_2ghz = chan_list_event_hdr->max_bw_2ghz;
|
||||
@@ -5060,6 +5063,372 @@ static int ath11k_pull_reg_chan_list_upd
|
||||
return 0;
|
||||
}
|
||||
|
||||
+static struct cur_reg_rule
|
||||
+*create_ext_reg_rules_from_wmi(u32 num_reg_rules,
|
||||
+ struct wmi_regulatory_ext_rule *wmi_reg_rule)
|
||||
+{
|
||||
+ struct cur_reg_rule *reg_rule_ptr;
|
||||
+ u32 count;
|
||||
+
|
||||
+ reg_rule_ptr = kcalloc(num_reg_rules, sizeof(*reg_rule_ptr), GFP_ATOMIC);
|
||||
+
|
||||
+ if (!reg_rule_ptr)
|
||||
+ return NULL;
|
||||
+
|
||||
+ for (count = 0; count < num_reg_rules; count++) {
|
||||
+ reg_rule_ptr[count].start_freq =
|
||||
+ u32_get_bits(wmi_reg_rule[count].freq_info,
|
||||
+ REG_RULE_START_FREQ);
|
||||
+ reg_rule_ptr[count].end_freq =
|
||||
+ u32_get_bits(wmi_reg_rule[count].freq_info,
|
||||
+ REG_RULE_END_FREQ);
|
||||
+ reg_rule_ptr[count].max_bw =
|
||||
+ u32_get_bits(wmi_reg_rule[count].bw_pwr_info,
|
||||
+ REG_RULE_MAX_BW);
|
||||
+ reg_rule_ptr[count].reg_power =
|
||||
+ u32_get_bits(wmi_reg_rule[count].bw_pwr_info,
|
||||
+ REG_RULE_REG_PWR);
|
||||
+ reg_rule_ptr[count].ant_gain =
|
||||
+ u32_get_bits(wmi_reg_rule[count].bw_pwr_info,
|
||||
+ REG_RULE_ANT_GAIN);
|
||||
+ reg_rule_ptr[count].flags =
|
||||
+ u32_get_bits(wmi_reg_rule[count].flag_info,
|
||||
+ REG_RULE_FLAGS);
|
||||
+ reg_rule_ptr[count].psd_flag =
|
||||
+ u32_get_bits(wmi_reg_rule[count].psd_power_info,
|
||||
+ REG_RULE_PSD_INFO);
|
||||
+ reg_rule_ptr[count].psd_eirp =
|
||||
+ u32_get_bits(wmi_reg_rule[count].psd_power_info,
|
||||
+ REG_RULE_PSD_EIRP);
|
||||
+ }
|
||||
+
|
||||
+ return reg_rule_ptr;
|
||||
+}
|
||||
+
|
||||
+static u8
|
||||
+ath11k_invalid_5ghz_reg_ext_rules_from_wmi(u32 num_reg_rules,
|
||||
+ const struct wmi_regulatory_ext_rule *rule)
|
||||
+{
|
||||
+ u8 num_invalid_5ghz_rules = 0;
|
||||
+ u32 count, start_freq;
|
||||
+
|
||||
+ for (count = 0; count < num_reg_rules; count++) {
|
||||
+ start_freq = u32_get_bits(rule[count].freq_info,
|
||||
+ REG_RULE_START_FREQ);
|
||||
+
|
||||
+ if (start_freq >= ATH11K_MIN_6G_FREQ)
|
||||
+ num_invalid_5ghz_rules++;
|
||||
+ }
|
||||
+
|
||||
+ return num_invalid_5ghz_rules;
|
||||
+}
|
||||
+
|
||||
+static int ath11k_pull_reg_chan_list_ext_update_ev(struct ath11k_base *ab,
|
||||
+ struct sk_buff *skb,
|
||||
+ struct cur_regulatory_info *reg_info)
|
||||
+{
|
||||
+ const void **tb;
|
||||
+ const struct wmi_reg_chan_list_cc_ext_event *ext_chan_list_event_hdr;
|
||||
+ struct wmi_regulatory_ext_rule *ext_wmi_reg_rule;
|
||||
+ u32 num_2ghz_reg_rules, num_5ghz_reg_rules;
|
||||
+ u32 num_6ghz_reg_rules_ap[WMI_REG_CURRENT_MAX_AP_TYPE];
|
||||
+ u32 num_6ghz_client[WMI_REG_CURRENT_MAX_AP_TYPE][WMI_REG_MAX_CLIENT_TYPE];
|
||||
+ u32 total_reg_rules = 0;
|
||||
+ int ret, i, j, num_invalid_5ghz_ext_rules = 0;
|
||||
+
|
||||
+ ath11k_dbg(ab, ATH11K_DBG_WMI, "processing regulatory ext channel list\n");
|
||||
+
|
||||
+ tb = ath11k_wmi_tlv_parse_alloc(ab, skb->data, skb->len, GFP_ATOMIC);
|
||||
+ if (IS_ERR(tb)) {
|
||||
+ ret = PTR_ERR(tb);
|
||||
+ ath11k_warn(ab, "failed to parse tlv: %d\n", ret);
|
||||
+ return ret;
|
||||
+ }
|
||||
+
|
||||
+ ext_chan_list_event_hdr = tb[WMI_TAG_REG_CHAN_LIST_CC_EXT_EVENT];
|
||||
+ if (!ext_chan_list_event_hdr) {
|
||||
+ ath11k_warn(ab, "failed to fetch reg chan list ext update ev\n");
|
||||
+ kfree(tb);
|
||||
+ return -EPROTO;
|
||||
+ }
|
||||
+
|
||||
+ reg_info->num_2ghz_reg_rules =
|
||||
+ ext_chan_list_event_hdr->num_2ghz_reg_rules;
|
||||
+ reg_info->num_5ghz_reg_rules =
|
||||
+ ext_chan_list_event_hdr->num_5ghz_reg_rules;
|
||||
+ reg_info->num_6ghz_rules_ap[WMI_REG_INDOOR_AP] =
|
||||
+ ext_chan_list_event_hdr->num_6ghz_reg_rules_ap_lpi;
|
||||
+ reg_info->num_6ghz_rules_ap[WMI_REG_STANDARD_POWER_AP] =
|
||||
+ ext_chan_list_event_hdr->num_6ghz_reg_rules_ap_sp;
|
||||
+ reg_info->num_6ghz_rules_ap[WMI_REG_VERY_LOW_POWER_AP] =
|
||||
+ ext_chan_list_event_hdr->num_6ghz_reg_rules_ap_vlp;
|
||||
+
|
||||
+ for (i = 0; i < WMI_REG_MAX_CLIENT_TYPE; i++) {
|
||||
+ reg_info->num_6ghz_rules_client[WMI_REG_INDOOR_AP][i] =
|
||||
+ ext_chan_list_event_hdr->num_6ghz_reg_rules_client_lpi[i];
|
||||
+ reg_info->num_6ghz_rules_client[WMI_REG_STANDARD_POWER_AP][i] =
|
||||
+ ext_chan_list_event_hdr->num_6ghz_reg_rules_client_sp[i];
|
||||
+ reg_info->num_6ghz_rules_client[WMI_REG_VERY_LOW_POWER_AP][i] =
|
||||
+ ext_chan_list_event_hdr->num_6ghz_reg_rules_client_vlp[i];
|
||||
+ }
|
||||
+
|
||||
+ num_2ghz_reg_rules = reg_info->num_2ghz_reg_rules;
|
||||
+ num_5ghz_reg_rules = reg_info->num_5ghz_reg_rules;
|
||||
+
|
||||
+ total_reg_rules += num_2ghz_reg_rules;
|
||||
+ total_reg_rules += num_5ghz_reg_rules;
|
||||
+
|
||||
+ if ((num_2ghz_reg_rules > MAX_REG_RULES) ||
|
||||
+ (num_5ghz_reg_rules > MAX_REG_RULES)) {
|
||||
+ ath11k_warn(ab, "Num reg rules for 2.4 GHz/5 GHz exceeds max limit (num_2ghz_reg_rules: %d num_5ghz_reg_rules: %d max_rules: %d)\n",
|
||||
+ num_2ghz_reg_rules, num_5ghz_reg_rules, MAX_REG_RULES);
|
||||
+ kfree(tb);
|
||||
+ return -EINVAL;
|
||||
+ }
|
||||
+
|
||||
+ for (i = 0; i < WMI_REG_CURRENT_MAX_AP_TYPE; i++) {
|
||||
+ num_6ghz_reg_rules_ap[i] = reg_info->num_6ghz_rules_ap[i];
|
||||
+
|
||||
+ if (num_6ghz_reg_rules_ap[i] > MAX_6GHZ_REG_RULES) {
|
||||
+ ath11k_warn(ab, "Num 6 GHz reg rules for AP mode(%d) exceeds max limit (num_6ghz_reg_rules_ap: %d, max_rules: %d)\n",
|
||||
+ i, num_6ghz_reg_rules_ap[i], MAX_6GHZ_REG_RULES);
|
||||
+ kfree(tb);
|
||||
+ return -EINVAL;
|
||||
+ }
|
||||
+
|
||||
+ total_reg_rules += num_6ghz_reg_rules_ap[i];
|
||||
+ }
|
||||
+
|
||||
+ for (i = 0; i < WMI_REG_MAX_CLIENT_TYPE; i++) {
|
||||
+ num_6ghz_client[WMI_REG_INDOOR_AP][i] =
|
||||
+ reg_info->num_6ghz_rules_client[WMI_REG_INDOOR_AP][i];
|
||||
+ total_reg_rules += num_6ghz_client[WMI_REG_INDOOR_AP][i];
|
||||
+
|
||||
+ num_6ghz_client[WMI_REG_STANDARD_POWER_AP][i] =
|
||||
+ reg_info->num_6ghz_rules_client[WMI_REG_STANDARD_POWER_AP][i];
|
||||
+ total_reg_rules += num_6ghz_client[WMI_REG_STANDARD_POWER_AP][i];
|
||||
+
|
||||
+ num_6ghz_client[WMI_REG_VERY_LOW_POWER_AP][i] =
|
||||
+ reg_info->num_6ghz_rules_client[WMI_REG_VERY_LOW_POWER_AP][i];
|
||||
+ total_reg_rules += num_6ghz_client[WMI_REG_VERY_LOW_POWER_AP][i];
|
||||
+
|
||||
+ if ((num_6ghz_client[WMI_REG_INDOOR_AP][i] > MAX_6GHZ_REG_RULES) ||
|
||||
+ (num_6ghz_client[WMI_REG_STANDARD_POWER_AP][i] >
|
||||
+ MAX_6GHZ_REG_RULES) ||
|
||||
+ (num_6ghz_client[WMI_REG_VERY_LOW_POWER_AP][i] >
|
||||
+ MAX_6GHZ_REG_RULES)) {
|
||||
+ ath11k_warn(ab,
|
||||
+ "Num 6 GHz client reg rules exceeds max limit, for client(type: %d)\n",
|
||||
+ i);
|
||||
+ kfree(tb);
|
||||
+ return -EINVAL;
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
+ if (!total_reg_rules) {
|
||||
+ ath11k_warn(ab, "No reg rules available\n");
|
||||
+ kfree(tb);
|
||||
+ return -EINVAL;
|
||||
+ }
|
||||
+
|
||||
+ memcpy(reg_info->alpha2, &ext_chan_list_event_hdr->alpha2,
|
||||
+ REG_ALPHA2_LEN);
|
||||
+
|
||||
+ reg_info->dfs_region = ext_chan_list_event_hdr->dfs_region;
|
||||
+ reg_info->phybitmap = ext_chan_list_event_hdr->phybitmap;
|
||||
+ reg_info->num_phy = ext_chan_list_event_hdr->num_phy;
|
||||
+ reg_info->phy_id = ext_chan_list_event_hdr->phy_id;
|
||||
+ reg_info->ctry_code = ext_chan_list_event_hdr->country_id;
|
||||
+ reg_info->reg_dmn_pair = ext_chan_list_event_hdr->domain_code;
|
||||
+
|
||||
+ reg_info->status_code =
|
||||
+ ath11k_wmi_cc_setting_code_to_reg(ext_chan_list_event_hdr->status_code);
|
||||
+
|
||||
+ reg_info->is_ext_reg_event = true;
|
||||
+
|
||||
+ reg_info->min_bw_2ghz = ext_chan_list_event_hdr->min_bw_2ghz;
|
||||
+ reg_info->max_bw_2ghz = ext_chan_list_event_hdr->max_bw_2ghz;
|
||||
+ reg_info->min_bw_5ghz = ext_chan_list_event_hdr->min_bw_5ghz;
|
||||
+ reg_info->max_bw_5ghz = ext_chan_list_event_hdr->max_bw_5ghz;
|
||||
+
|
||||
+ reg_info->min_bw_6ghz_ap[WMI_REG_INDOOR_AP] =
|
||||
+ ext_chan_list_event_hdr->min_bw_6ghz_ap_lpi;
|
||||
+ reg_info->max_bw_6ghz_ap[WMI_REG_INDOOR_AP] =
|
||||
+ ext_chan_list_event_hdr->max_bw_6ghz_ap_lpi;
|
||||
+ reg_info->min_bw_6ghz_ap[WMI_REG_STANDARD_POWER_AP] =
|
||||
+ ext_chan_list_event_hdr->min_bw_6ghz_ap_sp;
|
||||
+ reg_info->max_bw_6ghz_ap[WMI_REG_STANDARD_POWER_AP] =
|
||||
+ ext_chan_list_event_hdr->max_bw_6ghz_ap_sp;
|
||||
+ reg_info->min_bw_6ghz_ap[WMI_REG_VERY_LOW_POWER_AP] =
|
||||
+ ext_chan_list_event_hdr->min_bw_6ghz_ap_vlp;
|
||||
+ reg_info->max_bw_6ghz_ap[WMI_REG_VERY_LOW_POWER_AP] =
|
||||
+ ext_chan_list_event_hdr->max_bw_6ghz_ap_vlp;
|
||||
+
|
||||
+ for (i = 0; i < WMI_REG_MAX_CLIENT_TYPE; i++) {
|
||||
+ reg_info->min_bw_6ghz_client[WMI_REG_INDOOR_AP][i] =
|
||||
+ ext_chan_list_event_hdr->min_bw_6ghz_client_lpi[i];
|
||||
+ reg_info->max_bw_6ghz_client[WMI_REG_INDOOR_AP][i] =
|
||||
+ ext_chan_list_event_hdr->max_bw_6ghz_client_lpi[i];
|
||||
+ reg_info->min_bw_6ghz_client[WMI_REG_STANDARD_POWER_AP][i] =
|
||||
+ ext_chan_list_event_hdr->min_bw_6ghz_client_sp[i];
|
||||
+ reg_info->max_bw_6ghz_client[WMI_REG_STANDARD_POWER_AP][i] =
|
||||
+ ext_chan_list_event_hdr->max_bw_6ghz_client_sp[i];
|
||||
+ reg_info->min_bw_6ghz_client[WMI_REG_VERY_LOW_POWER_AP][i] =
|
||||
+ ext_chan_list_event_hdr->min_bw_6ghz_client_vlp[i];
|
||||
+ reg_info->max_bw_6ghz_client[WMI_REG_VERY_LOW_POWER_AP][i] =
|
||||
+ ext_chan_list_event_hdr->max_bw_6ghz_client_vlp[i];
|
||||
+ }
|
||||
+
|
||||
+ ath11k_dbg(ab, ATH11K_DBG_WMI,
|
||||
+ "%s:cc_ext %s dsf %d BW: min_2ghz %d max_2ghz %d min_5ghz %d max_5ghz %d",
|
||||
+ __func__, reg_info->alpha2, reg_info->dfs_region,
|
||||
+ reg_info->min_bw_2ghz, reg_info->max_bw_2ghz,
|
||||
+ reg_info->min_bw_5ghz, reg_info->max_bw_5ghz);
|
||||
+
|
||||
+ ath11k_dbg(ab, ATH11K_DBG_WMI,
|
||||
+ "num_2ghz_reg_rules %d num_5ghz_reg_rules %d",
|
||||
+ num_2ghz_reg_rules, num_5ghz_reg_rules);
|
||||
+
|
||||
+ ath11k_dbg(ab, ATH11K_DBG_WMI,
|
||||
+ "num_6ghz_reg_rules_ap_lpi: %d num_6ghz_reg_rules_ap_sp: %d num_6ghz_reg_rules_ap_vlp: %d",
|
||||
+ num_6ghz_reg_rules_ap[WMI_REG_INDOOR_AP],
|
||||
+ num_6ghz_reg_rules_ap[WMI_REG_STANDARD_POWER_AP],
|
||||
+ num_6ghz_reg_rules_ap[WMI_REG_VERY_LOW_POWER_AP]);
|
||||
+
|
||||
+ j = WMI_REG_DEFAULT_CLIENT;
|
||||
+ ath11k_dbg(ab, ATH11K_DBG_WMI,
|
||||
+ "6 GHz Regular client: num_6ghz_reg_rules_lpi: %d num_6ghz_reg_rules_sp: %d num_6ghz_reg_rules_vlp: %d",
|
||||
+ num_6ghz_client[WMI_REG_INDOOR_AP][j],
|
||||
+ num_6ghz_client[WMI_REG_STANDARD_POWER_AP][j],
|
||||
+ num_6ghz_client[WMI_REG_VERY_LOW_POWER_AP][j]);
|
||||
+
|
||||
+ j = WMI_REG_SUBORDINATE_CLIENT;
|
||||
+ ath11k_dbg(ab, ATH11K_DBG_WMI,
|
||||
+ "6 GHz Subordinate client: num_6ghz_reg_rules_lpi: %d num_6ghz_reg_rules_sp: %d num_6ghz_reg_rules_vlp: %d",
|
||||
+ num_6ghz_client[WMI_REG_INDOOR_AP][j],
|
||||
+ num_6ghz_client[WMI_REG_STANDARD_POWER_AP][j],
|
||||
+ num_6ghz_client[WMI_REG_VERY_LOW_POWER_AP][j]);
|
||||
+
|
||||
+ ext_wmi_reg_rule =
|
||||
+ (struct wmi_regulatory_ext_rule *)((u8 *)ext_chan_list_event_hdr
|
||||
+ + sizeof(*ext_chan_list_event_hdr)
|
||||
+ + sizeof(struct wmi_tlv));
|
||||
+ if (num_2ghz_reg_rules) {
|
||||
+ reg_info->reg_rules_2ghz_ptr =
|
||||
+ create_ext_reg_rules_from_wmi(num_2ghz_reg_rules,
|
||||
+ ext_wmi_reg_rule);
|
||||
+
|
||||
+ if (!reg_info->reg_rules_2ghz_ptr) {
|
||||
+ kfree(tb);
|
||||
+ ath11k_warn(ab, "Unable to Allocate memory for 2 GHz rules\n");
|
||||
+ return -ENOMEM;
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
+ ext_wmi_reg_rule += num_2ghz_reg_rules;
|
||||
+
|
||||
+ /* Firmware might include 6 GHz reg rule in 5 GHz rule list
|
||||
+ * for few countries along with separate 6 GHz rule.
|
||||
+ * Having same 6 GHz reg rule in 5 GHz and 6 GHz rules list
|
||||
+ * causes intersect check to be true, and same rules will be
|
||||
+ * shown multiple times in iw cmd.
|
||||
+ * Hence, avoid parsing 6 GHz rule from 5 GHz reg rule list
|
||||
+ */
|
||||
+ num_invalid_5ghz_ext_rules =
|
||||
+ ath11k_invalid_5ghz_reg_ext_rules_from_wmi(num_5ghz_reg_rules,
|
||||
+ ext_wmi_reg_rule);
|
||||
+
|
||||
+ if (num_invalid_5ghz_ext_rules) {
|
||||
+ ath11k_dbg(ab, ATH11K_DBG_WMI,
|
||||
+ "CC: %s 5 GHz reg rules number %d from fw, %d number of invalid 5 GHz rules",
|
||||
+ reg_info->alpha2, reg_info->num_5ghz_reg_rules,
|
||||
+ num_invalid_5ghz_ext_rules);
|
||||
+
|
||||
+ num_5ghz_reg_rules = num_5ghz_reg_rules - num_invalid_5ghz_ext_rules;
|
||||
+ reg_info->num_5ghz_reg_rules = num_5ghz_reg_rules;
|
||||
+ }
|
||||
+
|
||||
+ if (num_5ghz_reg_rules) {
|
||||
+ reg_info->reg_rules_5ghz_ptr =
|
||||
+ create_ext_reg_rules_from_wmi(num_5ghz_reg_rules,
|
||||
+ ext_wmi_reg_rule);
|
||||
+
|
||||
+ if (!reg_info->reg_rules_5ghz_ptr) {
|
||||
+ kfree(tb);
|
||||
+ ath11k_warn(ab, "Unable to Allocate memory for 5 GHz rules\n");
|
||||
+ return -ENOMEM;
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
+ /* We have adjusted the number of 5 GHz reg rules above. But still those
|
||||
+ * many rules needs to be adjusted in ext_wmi_reg_rule.
|
||||
+ *
|
||||
+ * NOTE: num_invalid_5ghz_ext_rules will be 0 for rest other cases.
|
||||
+ */
|
||||
+ ext_wmi_reg_rule += (num_5ghz_reg_rules + num_invalid_5ghz_ext_rules);
|
||||
+
|
||||
+ for (i = 0; i < WMI_REG_CURRENT_MAX_AP_TYPE; i++) {
|
||||
+ reg_info->reg_rules_6ghz_ap_ptr[i] =
|
||||
+ create_ext_reg_rules_from_wmi(num_6ghz_reg_rules_ap[i],
|
||||
+ ext_wmi_reg_rule);
|
||||
+
|
||||
+ if (!reg_info->reg_rules_6ghz_ap_ptr[i]) {
|
||||
+ kfree(tb);
|
||||
+ ath11k_warn(ab, "Unable to Allocate memory for 6 GHz AP rules\n");
|
||||
+ return -ENOMEM;
|
||||
+ }
|
||||
+
|
||||
+ ext_wmi_reg_rule += num_6ghz_reg_rules_ap[i];
|
||||
+ }
|
||||
+
|
||||
+ for (j = 0; j < WMI_REG_CURRENT_MAX_AP_TYPE; j++) {
|
||||
+ for (i = 0; i < WMI_REG_MAX_CLIENT_TYPE; i++) {
|
||||
+ reg_info->reg_rules_6ghz_client_ptr[j][i] =
|
||||
+ create_ext_reg_rules_from_wmi(num_6ghz_client[j][i],
|
||||
+ ext_wmi_reg_rule);
|
||||
+
|
||||
+ if (!reg_info->reg_rules_6ghz_client_ptr[j][i]) {
|
||||
+ kfree(tb);
|
||||
+ ath11k_warn(ab, "Unable to Allocate memory for 6 GHz client rules\n");
|
||||
+ return -ENOMEM;
|
||||
+ }
|
||||
+
|
||||
+ ext_wmi_reg_rule += num_6ghz_client[j][i];
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
+ reg_info->client_type = ext_chan_list_event_hdr->client_type;
|
||||
+ reg_info->rnr_tpe_usable = ext_chan_list_event_hdr->rnr_tpe_usable;
|
||||
+ reg_info->unspecified_ap_usable =
|
||||
+ ext_chan_list_event_hdr->unspecified_ap_usable;
|
||||
+ reg_info->domain_code_6ghz_ap[WMI_REG_INDOOR_AP] =
|
||||
+ ext_chan_list_event_hdr->domain_code_6ghz_ap_lpi;
|
||||
+ reg_info->domain_code_6ghz_ap[WMI_REG_STANDARD_POWER_AP] =
|
||||
+ ext_chan_list_event_hdr->domain_code_6ghz_ap_sp;
|
||||
+ reg_info->domain_code_6ghz_ap[WMI_REG_VERY_LOW_POWER_AP] =
|
||||
+ ext_chan_list_event_hdr->domain_code_6ghz_ap_vlp;
|
||||
+
|
||||
+ for (i = 0; i < WMI_REG_MAX_CLIENT_TYPE; i++) {
|
||||
+ reg_info->domain_code_6ghz_client[WMI_REG_INDOOR_AP][i] =
|
||||
+ ext_chan_list_event_hdr->domain_code_6ghz_client_lpi[i];
|
||||
+ reg_info->domain_code_6ghz_client[WMI_REG_STANDARD_POWER_AP][i] =
|
||||
+ ext_chan_list_event_hdr->domain_code_6ghz_client_sp[i];
|
||||
+ reg_info->domain_code_6ghz_client[WMI_REG_VERY_LOW_POWER_AP][i] =
|
||||
+ ext_chan_list_event_hdr->domain_code_6ghz_client_vlp[i];
|
||||
+ }
|
||||
+
|
||||
+ reg_info->domain_code_6ghz_super_id =
|
||||
+ ext_chan_list_event_hdr->domain_code_6ghz_super_id;
|
||||
+
|
||||
+ ath11k_dbg(ab, ATH11K_DBG_WMI, "6 GHz client_type: %d domain_code_6ghz_super_id: %d",
|
||||
+ reg_info->client_type, reg_info->domain_code_6ghz_super_id);
|
||||
+
|
||||
+ ath11k_dbg(ab, ATH11K_DBG_WMI, "processed regulatory ext channel list\n");
|
||||
+
|
||||
+ kfree(tb);
|
||||
+ return 0;
|
||||
+}
|
||||
+
|
||||
static int ath11k_pull_peer_del_resp_ev(struct ath11k_base *ab, struct sk_buff *skb,
|
||||
struct wmi_peer_delete_resp_event *peer_del_resp)
|
||||
{
|
||||
@@ -6507,12 +6876,14 @@ static bool ath11k_reg_is_world_alpha(ch
|
||||
return false;
|
||||
}
|
||||
|
||||
-static int ath11k_reg_chan_list_event(struct ath11k_base *ab, struct sk_buff *skb)
|
||||
+static int ath11k_reg_chan_list_event(struct ath11k_base *ab,
|
||||
+ struct sk_buff *skb,
|
||||
+ enum wmi_reg_chan_list_cmd_type id)
|
||||
{
|
||||
struct cur_regulatory_info *reg_info = NULL;
|
||||
struct ieee80211_regdomain *regd = NULL;
|
||||
bool intersect = false;
|
||||
- int ret = 0, pdev_idx;
|
||||
+ int ret = 0, pdev_idx, i, j;
|
||||
struct ath11k *ar;
|
||||
|
||||
reg_info = kzalloc(sizeof(*reg_info), GFP_ATOMIC);
|
||||
@@ -6521,7 +6892,11 @@ static int ath11k_reg_chan_list_event(st
|
||||
goto fallback;
|
||||
}
|
||||
|
||||
- ret = ath11k_pull_reg_chan_list_update_ev(ab, skb, reg_info);
|
||||
+ if (id == WMI_REG_CHAN_LIST_CC_ID)
|
||||
+ ret = ath11k_pull_reg_chan_list_update_ev(ab, skb, reg_info);
|
||||
+ else
|
||||
+ ret = ath11k_pull_reg_chan_list_ext_update_ev(ab, skb, reg_info);
|
||||
+
|
||||
if (ret) {
|
||||
ath11k_warn(ab, "failed to extract regulatory info from received event\n");
|
||||
goto fallback;
|
||||
@@ -6623,6 +6998,14 @@ mem_free:
|
||||
if (reg_info) {
|
||||
kfree(reg_info->reg_rules_2ghz_ptr);
|
||||
kfree(reg_info->reg_rules_5ghz_ptr);
|
||||
+ if (reg_info->is_ext_reg_event) {
|
||||
+ for (i = 0; i < WMI_REG_CURRENT_MAX_AP_TYPE; i++)
|
||||
+ kfree(reg_info->reg_rules_6ghz_ap_ptr[i]);
|
||||
+
|
||||
+ for (j = 0; j < WMI_REG_CURRENT_MAX_AP_TYPE; j++)
|
||||
+ for (i = 0; i < WMI_REG_MAX_CLIENT_TYPE; i++)
|
||||
+ kfree(reg_info->reg_rules_6ghz_client_ptr[j][i]);
|
||||
+ }
|
||||
kfree(reg_info);
|
||||
}
|
||||
return ret;
|
||||
@@ -8054,7 +8437,10 @@ static void ath11k_wmi_tlv_op_rx(struct
|
||||
ath11k_service_ready_ext2_event(ab, skb);
|
||||
break;
|
||||
case WMI_REG_CHAN_LIST_CC_EVENTID:
|
||||
- ath11k_reg_chan_list_event(ab, skb);
|
||||
+ ath11k_reg_chan_list_event(ab, skb, WMI_REG_CHAN_LIST_CC_ID);
|
||||
+ break;
|
||||
+ case WMI_REG_CHAN_LIST_CC_EXT_EVENTID:
|
||||
+ ath11k_reg_chan_list_event(ab, skb, WMI_REG_CHAN_LIST_CC_EXT_ID);
|
||||
break;
|
||||
case WMI_READY_EVENTID:
|
||||
ath11k_ready_event(ab, skb);
|
||||
--- a/drivers/net/wireless/ath/ath11k/wmi.h
|
||||
+++ b/drivers/net/wireless/ath/ath11k/wmi.h
|
||||
@@ -797,6 +797,7 @@ enum wmi_tlv_event_id {
|
||||
WMI_RMC_NEW_LEADER_EVENTID = WMI_TLV_CMD(WMI_GRP_RMC),
|
||||
WMI_REG_CHAN_LIST_CC_EVENTID = WMI_TLV_CMD(WMI_GRP_REGULATORY),
|
||||
WMI_11D_NEW_COUNTRY_EVENTID,
|
||||
+ WMI_REG_CHAN_LIST_CC_EXT_EVENTID,
|
||||
WMI_NDI_CAP_RSP_EVENTID = WMI_TLV_CMD(WMI_GRP_PROTOTYPE),
|
||||
WMI_NDP_INITIATOR_RSP_EVENTID,
|
||||
WMI_NDP_RESPONDER_RSP_EVENTID,
|
||||
@@ -1865,6 +1866,8 @@ enum wmi_tlv_tag {
|
||||
WMI_TAG_PDEV_SRG_OBSS_BSSID_ENABLE_BITMAP_CMD,
|
||||
WMI_TAG_PDEV_NON_SRG_OBSS_COLOR_ENABLE_BITMAP_CMD,
|
||||
WMI_TAG_PDEV_NON_SRG_OBSS_BSSID_ENABLE_BITMAP_CMD,
|
||||
+ WMI_TAG_REGULATORY_RULE_EXT_STRUCT = 0x3A9,
|
||||
+ WMI_TAG_REG_CHAN_LIST_CC_EXT_EVENT,
|
||||
WMI_TAG_PDEV_SET_BIOS_SAR_TABLE_CMD = 0x3D8,
|
||||
WMI_TAG_PDEV_SET_BIOS_GEO_TABLE_CMD,
|
||||
WMI_TAG_MAX
|
||||
@@ -2097,6 +2100,7 @@ enum wmi_tlv_service {
|
||||
|
||||
/* The second 128 bits */
|
||||
WMI_MAX_EXT_SERVICE = 256,
|
||||
+ WMI_TLV_SERVICE_REG_CC_EXT_EVENT_SUPPORT = 281,
|
||||
WMI_TLV_SERVICE_BIOS_SAR_SUPPORT = 326,
|
||||
|
||||
/* The third 128 bits */
|
||||
@@ -2313,6 +2317,8 @@ struct wmi_init_cmd {
|
||||
#define WMI_RSRC_CFG_FLAG1_BSS_CHANNEL_INFO_64 BIT(5)
|
||||
#define WMI_RSRC_CFG_FLAG1_ACK_RSSI BIT(18)
|
||||
|
||||
+#define WMI_CFG_HOST_SERVICE_FLAG_REG_CC_EXT 4
|
||||
+
|
||||
struct wmi_resource_config {
|
||||
u32 tlv_header;
|
||||
u32 num_vdevs;
|
||||
@@ -2372,6 +2378,15 @@ struct wmi_resource_config {
|
||||
u32 sched_params;
|
||||
u32 twt_ap_pdev_count;
|
||||
u32 twt_ap_sta_count;
|
||||
+ u32 max_nlo_ssids;
|
||||
+ u32 num_pkt_filters;
|
||||
+ u32 num_max_sta_vdevs;
|
||||
+ u32 max_bssid_indicator;
|
||||
+ u32 ul_resp_config;
|
||||
+ u32 msdu_flow_override_config0;
|
||||
+ u32 msdu_flow_override_config1;
|
||||
+ u32 flags2;
|
||||
+ u32 host_service_flags;
|
||||
} __packed;
|
||||
|
||||
struct wmi_service_ready_event {
|
||||
@@ -2854,6 +2869,8 @@ struct rx_reorder_queue_remove_params {
|
||||
#define REG_RULE_MAX_BW 0x0000ffff
|
||||
#define REG_RULE_REG_PWR 0x00ff0000
|
||||
#define REG_RULE_ANT_GAIN 0xff000000
|
||||
+#define REG_RULE_PSD_INFO BIT(0)
|
||||
+#define REG_RULE_PSD_EIRP 0xff0000
|
||||
|
||||
#define WMI_VDEV_PARAM_TXBF_SU_TX_BFEE BIT(0)
|
||||
#define WMI_VDEV_PARAM_TXBF_MU_TX_BFEE BIT(1)
|
||||
@@ -4049,6 +4066,7 @@ struct wmi_he_rate_set {
|
||||
|
||||
#define MAX_REG_RULES 10
|
||||
#define REG_ALPHA2_LEN 2
|
||||
+#define MAX_6GHZ_REG_RULES 5
|
||||
|
||||
enum wmi_start_event_param {
|
||||
WMI_VDEV_START_RESP_EVENT = 0,
|
||||
@@ -4079,16 +4097,6 @@ enum wmi_vdev_start_resp_status_code {
|
||||
WMI_VDEV_START_RESPONSE_INVALID_REGDOMAIN = 4,
|
||||
};
|
||||
|
||||
-;
|
||||
-enum cc_setting_code {
|
||||
- REG_SET_CC_STATUS_PASS = 0,
|
||||
- REG_CURRENT_ALPHA2_NOT_FOUND = 1,
|
||||
- REG_INIT_ALPHA2_NOT_FOUND = 2,
|
||||
- REG_SET_CC_CHANGE_NOT_ALLOWED = 3,
|
||||
- REG_SET_CC_STATUS_NO_MEMORY = 4,
|
||||
- REG_SET_CC_STATUS_FAIL = 5,
|
||||
-};
|
||||
-
|
||||
/* Regaulatory Rule Flags Passed by FW */
|
||||
#define REGULATORY_CHAN_DISABLED BIT(0)
|
||||
#define REGULATORY_CHAN_NO_IR BIT(1)
|
||||
@@ -4102,13 +4110,72 @@ enum cc_setting_code {
|
||||
#define REGULATORY_CHAN_NO_20MHZ BIT(11)
|
||||
#define REGULATORY_CHAN_NO_10MHZ BIT(12)
|
||||
|
||||
-enum {
|
||||
+enum wmi_reg_chan_list_cmd_type {
|
||||
+ WMI_REG_CHAN_LIST_CC_ID = 0,
|
||||
+ WMI_REG_CHAN_LIST_CC_EXT_ID = 1,
|
||||
+};
|
||||
+
|
||||
+enum wmi_reg_cc_setting_code {
|
||||
WMI_REG_SET_CC_STATUS_PASS = 0,
|
||||
WMI_REG_CURRENT_ALPHA2_NOT_FOUND = 1,
|
||||
WMI_REG_INIT_ALPHA2_NOT_FOUND = 2,
|
||||
WMI_REG_SET_CC_CHANGE_NOT_ALLOWED = 3,
|
||||
WMI_REG_SET_CC_STATUS_NO_MEMORY = 4,
|
||||
WMI_REG_SET_CC_STATUS_FAIL = 5,
|
||||
+
|
||||
+ /* add new setting code above, update in
|
||||
+ * @enum cc_setting_code as well.
|
||||
+ * Also handle it in ath11k_wmi_cc_setting_code_to_reg()
|
||||
+ */
|
||||
+};
|
||||
+
|
||||
+enum cc_setting_code {
|
||||
+ REG_SET_CC_STATUS_PASS = 0,
|
||||
+ REG_CURRENT_ALPHA2_NOT_FOUND = 1,
|
||||
+ REG_INIT_ALPHA2_NOT_FOUND = 2,
|
||||
+ REG_SET_CC_CHANGE_NOT_ALLOWED = 3,
|
||||
+ REG_SET_CC_STATUS_NO_MEMORY = 4,
|
||||
+ REG_SET_CC_STATUS_FAIL = 5,
|
||||
+
|
||||
+ /* add new setting code above, update in
|
||||
+ * @enum wmi_reg_cc_setting_code as well.
|
||||
+ */
|
||||
+};
|
||||
+
|
||||
+static inline enum cc_setting_code
|
||||
+ath11k_wmi_cc_setting_code_to_reg(enum wmi_reg_cc_setting_code status_code)
|
||||
+{
|
||||
+ switch (status_code) {
|
||||
+ case WMI_REG_SET_CC_STATUS_PASS:
|
||||
+ return REG_SET_CC_STATUS_PASS;
|
||||
+ case WMI_REG_CURRENT_ALPHA2_NOT_FOUND:
|
||||
+ return REG_CURRENT_ALPHA2_NOT_FOUND;
|
||||
+ case WMI_REG_INIT_ALPHA2_NOT_FOUND:
|
||||
+ return REG_INIT_ALPHA2_NOT_FOUND;
|
||||
+ case WMI_REG_SET_CC_CHANGE_NOT_ALLOWED:
|
||||
+ return REG_SET_CC_CHANGE_NOT_ALLOWED;
|
||||
+ case WMI_REG_SET_CC_STATUS_NO_MEMORY:
|
||||
+ return REG_SET_CC_STATUS_NO_MEMORY;
|
||||
+ case WMI_REG_SET_CC_STATUS_FAIL:
|
||||
+ return REG_SET_CC_STATUS_FAIL;
|
||||
+ }
|
||||
+
|
||||
+ return REG_SET_CC_STATUS_FAIL;
|
||||
+}
|
||||
+
|
||||
+enum wmi_reg_6ghz_ap_type {
|
||||
+ WMI_REG_INDOOR_AP = 0,
|
||||
+ WMI_REG_STANDARD_POWER_AP = 1,
|
||||
+ WMI_REG_VERY_LOW_POWER_AP = 2,
|
||||
+
|
||||
+ WMI_REG_CURRENT_MAX_AP_TYPE,
|
||||
+ WMI_REG_MAX_AP_TYPE = 7,
|
||||
+};
|
||||
+
|
||||
+enum wmi_reg_6ghz_client_type {
|
||||
+ WMI_REG_DEFAULT_CLIENT = 0,
|
||||
+ WMI_REG_SUBORDINATE_CLIENT = 1,
|
||||
+ WMI_REG_MAX_CLIENT_TYPE = 2,
|
||||
};
|
||||
|
||||
struct cur_reg_rule {
|
||||
@@ -4118,6 +4185,8 @@ struct cur_reg_rule {
|
||||
u8 reg_power;
|
||||
u8 ant_gain;
|
||||
u16 flags;
|
||||
+ bool psd_flag;
|
||||
+ s8 psd_eirp;
|
||||
};
|
||||
|
||||
struct cur_regulatory_info {
|
||||
@@ -4137,6 +4206,22 @@ struct cur_regulatory_info {
|
||||
u32 num_5ghz_reg_rules;
|
||||
struct cur_reg_rule *reg_rules_2ghz_ptr;
|
||||
struct cur_reg_rule *reg_rules_5ghz_ptr;
|
||||
+ bool is_ext_reg_event;
|
||||
+ enum wmi_reg_6ghz_client_type client_type;
|
||||
+ bool rnr_tpe_usable;
|
||||
+ bool unspecified_ap_usable;
|
||||
+ u8 domain_code_6ghz_ap[WMI_REG_CURRENT_MAX_AP_TYPE];
|
||||
+ u8 domain_code_6ghz_client[WMI_REG_CURRENT_MAX_AP_TYPE][WMI_REG_MAX_CLIENT_TYPE];
|
||||
+ u32 domain_code_6ghz_super_id;
|
||||
+ u32 min_bw_6ghz_ap[WMI_REG_CURRENT_MAX_AP_TYPE];
|
||||
+ u32 max_bw_6ghz_ap[WMI_REG_CURRENT_MAX_AP_TYPE];
|
||||
+ u32 min_bw_6ghz_client[WMI_REG_CURRENT_MAX_AP_TYPE][WMI_REG_MAX_CLIENT_TYPE];
|
||||
+ u32 max_bw_6ghz_client[WMI_REG_CURRENT_MAX_AP_TYPE][WMI_REG_MAX_CLIENT_TYPE];
|
||||
+ u32 num_6ghz_rules_ap[WMI_REG_CURRENT_MAX_AP_TYPE];
|
||||
+ u32 num_6ghz_rules_client[WMI_REG_CURRENT_MAX_AP_TYPE][WMI_REG_MAX_CLIENT_TYPE];
|
||||
+ struct cur_reg_rule *reg_rules_6ghz_ap_ptr[WMI_REG_CURRENT_MAX_AP_TYPE];
|
||||
+ struct cur_reg_rule *reg_rules_6ghz_client_ptr
|
||||
+ [WMI_REG_CURRENT_MAX_AP_TYPE][WMI_REG_MAX_CLIENT_TYPE];
|
||||
};
|
||||
|
||||
struct wmi_reg_chan_list_cc_event {
|
||||
@@ -4163,6 +4248,61 @@ struct wmi_regulatory_rule_struct {
|
||||
u32 flag_info;
|
||||
};
|
||||
|
||||
+#define WMI_REG_CLIENT_MAX 4
|
||||
+
|
||||
+struct wmi_reg_chan_list_cc_ext_event {
|
||||
+ u32 status_code;
|
||||
+ u32 phy_id;
|
||||
+ u32 alpha2;
|
||||
+ u32 num_phy;
|
||||
+ u32 country_id;
|
||||
+ u32 domain_code;
|
||||
+ u32 dfs_region;
|
||||
+ u32 phybitmap;
|
||||
+ u32 min_bw_2ghz;
|
||||
+ u32 max_bw_2ghz;
|
||||
+ u32 min_bw_5ghz;
|
||||
+ u32 max_bw_5ghz;
|
||||
+ u32 num_2ghz_reg_rules;
|
||||
+ u32 num_5ghz_reg_rules;
|
||||
+ u32 client_type;
|
||||
+ u32 rnr_tpe_usable;
|
||||
+ u32 unspecified_ap_usable;
|
||||
+ u32 domain_code_6ghz_ap_lpi;
|
||||
+ u32 domain_code_6ghz_ap_sp;
|
||||
+ u32 domain_code_6ghz_ap_vlp;
|
||||
+ u32 domain_code_6ghz_client_lpi[WMI_REG_CLIENT_MAX];
|
||||
+ u32 domain_code_6ghz_client_sp[WMI_REG_CLIENT_MAX];
|
||||
+ u32 domain_code_6ghz_client_vlp[WMI_REG_CLIENT_MAX];
|
||||
+ u32 domain_code_6ghz_super_id;
|
||||
+ u32 min_bw_6ghz_ap_sp;
|
||||
+ u32 max_bw_6ghz_ap_sp;
|
||||
+ u32 min_bw_6ghz_ap_lpi;
|
||||
+ u32 max_bw_6ghz_ap_lpi;
|
||||
+ u32 min_bw_6ghz_ap_vlp;
|
||||
+ u32 max_bw_6ghz_ap_vlp;
|
||||
+ u32 min_bw_6ghz_client_sp[WMI_REG_CLIENT_MAX];
|
||||
+ u32 max_bw_6ghz_client_sp[WMI_REG_CLIENT_MAX];
|
||||
+ u32 min_bw_6ghz_client_lpi[WMI_REG_CLIENT_MAX];
|
||||
+ u32 max_bw_6ghz_client_lpi[WMI_REG_CLIENT_MAX];
|
||||
+ u32 min_bw_6ghz_client_vlp[WMI_REG_CLIENT_MAX];
|
||||
+ u32 max_bw_6ghz_client_vlp[WMI_REG_CLIENT_MAX];
|
||||
+ u32 num_6ghz_reg_rules_ap_sp;
|
||||
+ u32 num_6ghz_reg_rules_ap_lpi;
|
||||
+ u32 num_6ghz_reg_rules_ap_vlp;
|
||||
+ u32 num_6ghz_reg_rules_client_sp[WMI_REG_CLIENT_MAX];
|
||||
+ u32 num_6ghz_reg_rules_client_lpi[WMI_REG_CLIENT_MAX];
|
||||
+ u32 num_6ghz_reg_rules_client_vlp[WMI_REG_CLIENT_MAX];
|
||||
+} __packed;
|
||||
+
|
||||
+struct wmi_regulatory_ext_rule {
|
||||
+ u32 tlv_header;
|
||||
+ u32 freq_info;
|
||||
+ u32 bw_pwr_info;
|
||||
+ u32 flag_info;
|
||||
+ u32 psd_power_info;
|
||||
+} __packed;
|
||||
+
|
||||
struct wmi_vdev_delete_resp_event {
|
||||
u32 vdev_id;
|
||||
} __packed;
|
||||
@@ -5358,6 +5498,7 @@ struct target_resource_config {
|
||||
u32 sched_params;
|
||||
u32 twt_ap_pdev_count;
|
||||
u32 twt_ap_sta_count;
|
||||
+ u8 is_reg_cc_ext_event_supported;
|
||||
};
|
||||
|
||||
enum wmi_debug_log_param {
|
@ -0,0 +1,567 @@
|
||||
From e238e62ba8868a784e485eb94451c87cd1b85cee Mon Sep 17 00:00:00 2001
|
||||
From: Aditya Kumar Singh <quic_adisi@quicinc.com>
|
||||
Date: Wed, 1 Mar 2023 16:20:59 +0200
|
||||
Subject: [PATCH] wifi: ath11k: add debug prints in regulatory WMI event
|
||||
processing
|
||||
|
||||
Add some more debug prints in processing regulatory WMI event in order to
|
||||
increase more debuggability.
|
||||
|
||||
Tested-on: IPQ8074 hw2.0 AHB WLAN.HK.2.7.0.1-01744-QCAHKSWPL_SILICONZ-1
|
||||
Tested-on: QCN9074 hw1.0 PCI WLAN.HK.2.7.0.1-01744-QCAHKSWPL_SILICONZ-1
|
||||
Tested-on: QCN9074 hw1.0 PCI WLAN.HK.2.5.0.1-01100-QCAHKSWPL_SILICONZ-1
|
||||
|
||||
Signed-off-by: Aditya Kumar Singh <quic_adisi@quicinc.com>
|
||||
Signed-off-by: Kalle Valo <quic_kvalo@quicinc.com>
|
||||
Link: https://lore.kernel.org/r/20230110121024.14051-4-quic_adisi@quicinc.com
|
||||
---
|
||||
drivers/net/wireless/ath/ath11k/reg.c | 2 +-
|
||||
drivers/net/wireless/ath/ath11k/wmi.c | 207 ++++++++++++++++++--------
|
||||
drivers/net/wireless/ath/ath11k/wmi.h | 142 ++++++++++++++++++
|
||||
3 files changed, 291 insertions(+), 60 deletions(-)
|
||||
|
||||
--- a/drivers/net/wireless/ath/ath11k/reg.c
|
||||
+++ b/drivers/net/wireless/ath/ath11k/reg.c
|
||||
@@ -646,7 +646,7 @@ ath11k_reg_build_regd(struct ath11k_base
|
||||
tmp_regd->dfs_region = ath11k_map_fw_dfs_region(reg_info->dfs_region);
|
||||
|
||||
ath11k_dbg(ab, ATH11K_DBG_REG,
|
||||
- "\r\nCountry %s, CFG Regdomain %s FW Regdomain %d, num_reg_rules %d\n",
|
||||
+ "Country %s, CFG Regdomain %s FW Regdomain %d, num_reg_rules %d\n",
|
||||
alpha2, ath11k_reg_get_regdom_str(tmp_regd->dfs_region),
|
||||
reg_info->dfs_region, num_rules);
|
||||
/* Update reg_rules[] below. Firmware is expected to
|
||||
--- a/drivers/net/wireless/ath/ath11k/wmi.c
|
||||
+++ b/drivers/net/wireless/ath/ath11k/wmi.c
|
||||
@@ -4925,6 +4925,26 @@ static int ath11k_pull_vdev_start_resp_t
|
||||
return 0;
|
||||
}
|
||||
|
||||
+static void ath11k_print_reg_rule(struct ath11k_base *ab, const char *band,
|
||||
+ u32 num_reg_rules,
|
||||
+ struct cur_reg_rule *reg_rule_ptr)
|
||||
+{
|
||||
+ struct cur_reg_rule *reg_rule = reg_rule_ptr;
|
||||
+ u32 count;
|
||||
+
|
||||
+ ath11k_dbg(ab, ATH11K_DBG_WMI, "number of reg rules in %s band: %d\n",
|
||||
+ band, num_reg_rules);
|
||||
+
|
||||
+ for (count = 0; count < num_reg_rules; count++) {
|
||||
+ ath11k_dbg(ab, ATH11K_DBG_WMI,
|
||||
+ "reg rule %d: (%d - %d @ %d) (%d, %d) (FLAGS %d)\n",
|
||||
+ count + 1, reg_rule->start_freq, reg_rule->end_freq,
|
||||
+ reg_rule->max_bw, reg_rule->ant_gain,
|
||||
+ reg_rule->reg_power, reg_rule->flags);
|
||||
+ reg_rule++;
|
||||
+ }
|
||||
+}
|
||||
+
|
||||
static struct cur_reg_rule
|
||||
*create_reg_rules_from_wmi(u32 num_reg_rules,
|
||||
struct wmi_regulatory_rule_struct *wmi_reg_rule)
|
||||
@@ -5006,6 +5026,10 @@ static int ath11k_pull_reg_chan_list_upd
|
||||
reg_info->ctry_code = chan_list_event_hdr->country_id;
|
||||
reg_info->reg_dmn_pair = chan_list_event_hdr->domain_code;
|
||||
|
||||
+ ath11k_dbg(ab, ATH11K_DBG_WMI,
|
||||
+ "status_code %s",
|
||||
+ ath11k_cc_status_to_str(reg_info->status_code));
|
||||
+
|
||||
reg_info->status_code =
|
||||
ath11k_wmi_cc_setting_code_to_reg(chan_list_event_hdr->status_code);
|
||||
|
||||
@@ -5020,13 +5044,13 @@ static int ath11k_pull_reg_chan_list_upd
|
||||
num_5ghz_reg_rules = reg_info->num_5ghz_reg_rules;
|
||||
|
||||
ath11k_dbg(ab, ATH11K_DBG_WMI,
|
||||
- "%s:cc %s dsf %d BW: min_2ghz %d max_2ghz %d min_5ghz %d max_5ghz %d",
|
||||
- __func__, reg_info->alpha2, reg_info->dfs_region,
|
||||
+ "cc %s dsf %d BW: min_2ghz %d max_2ghz %d min_5ghz %d max_5ghz %d",
|
||||
+ reg_info->alpha2, reg_info->dfs_region,
|
||||
reg_info->min_bw_2ghz, reg_info->max_bw_2ghz,
|
||||
reg_info->min_bw_5ghz, reg_info->max_bw_5ghz);
|
||||
|
||||
ath11k_dbg(ab, ATH11K_DBG_WMI,
|
||||
- "%s: num_2ghz_reg_rules %d num_5ghz_reg_rules %d", __func__,
|
||||
+ "num_2ghz_reg_rules %d num_5ghz_reg_rules %d",
|
||||
num_2ghz_reg_rules, num_5ghz_reg_rules);
|
||||
|
||||
wmi_reg_rule =
|
||||
@@ -5043,6 +5067,10 @@ static int ath11k_pull_reg_chan_list_upd
|
||||
ath11k_warn(ab, "Unable to Allocate memory for 2 GHz rules\n");
|
||||
return -ENOMEM;
|
||||
}
|
||||
+
|
||||
+ ath11k_print_reg_rule(ab, "2 GHz",
|
||||
+ num_2ghz_reg_rules,
|
||||
+ reg_info->reg_rules_2ghz_ptr);
|
||||
}
|
||||
|
||||
if (num_5ghz_reg_rules) {
|
||||
@@ -5055,6 +5083,10 @@ static int ath11k_pull_reg_chan_list_upd
|
||||
ath11k_warn(ab, "Unable to Allocate memory for 5 GHz rules\n");
|
||||
return -ENOMEM;
|
||||
}
|
||||
+
|
||||
+ ath11k_print_reg_rule(ab, "5 GHz",
|
||||
+ num_5ghz_reg_rules,
|
||||
+ reg_info->reg_rules_5ghz_ptr);
|
||||
}
|
||||
|
||||
ath11k_dbg(ab, ATH11K_DBG_WMI, "processed regulatory channel list\n");
|
||||
@@ -5128,7 +5160,7 @@ static int ath11k_pull_reg_chan_list_ext
|
||||
struct cur_regulatory_info *reg_info)
|
||||
{
|
||||
const void **tb;
|
||||
- const struct wmi_reg_chan_list_cc_ext_event *ext_chan_list_event_hdr;
|
||||
+ const struct wmi_reg_chan_list_cc_ext_event *ev;
|
||||
struct wmi_regulatory_ext_rule *ext_wmi_reg_rule;
|
||||
u32 num_2ghz_reg_rules, num_5ghz_reg_rules;
|
||||
u32 num_6ghz_reg_rules_ap[WMI_REG_CURRENT_MAX_AP_TYPE];
|
||||
@@ -5145,31 +5177,29 @@ static int ath11k_pull_reg_chan_list_ext
|
||||
return ret;
|
||||
}
|
||||
|
||||
- ext_chan_list_event_hdr = tb[WMI_TAG_REG_CHAN_LIST_CC_EXT_EVENT];
|
||||
- if (!ext_chan_list_event_hdr) {
|
||||
+ ev = tb[WMI_TAG_REG_CHAN_LIST_CC_EXT_EVENT];
|
||||
+ if (!ev) {
|
||||
ath11k_warn(ab, "failed to fetch reg chan list ext update ev\n");
|
||||
kfree(tb);
|
||||
return -EPROTO;
|
||||
}
|
||||
|
||||
- reg_info->num_2ghz_reg_rules =
|
||||
- ext_chan_list_event_hdr->num_2ghz_reg_rules;
|
||||
- reg_info->num_5ghz_reg_rules =
|
||||
- ext_chan_list_event_hdr->num_5ghz_reg_rules;
|
||||
+ reg_info->num_2ghz_reg_rules = ev->num_2ghz_reg_rules;
|
||||
+ reg_info->num_5ghz_reg_rules = ev->num_5ghz_reg_rules;
|
||||
reg_info->num_6ghz_rules_ap[WMI_REG_INDOOR_AP] =
|
||||
- ext_chan_list_event_hdr->num_6ghz_reg_rules_ap_lpi;
|
||||
+ ev->num_6ghz_reg_rules_ap_lpi;
|
||||
reg_info->num_6ghz_rules_ap[WMI_REG_STANDARD_POWER_AP] =
|
||||
- ext_chan_list_event_hdr->num_6ghz_reg_rules_ap_sp;
|
||||
+ ev->num_6ghz_reg_rules_ap_sp;
|
||||
reg_info->num_6ghz_rules_ap[WMI_REG_VERY_LOW_POWER_AP] =
|
||||
- ext_chan_list_event_hdr->num_6ghz_reg_rules_ap_vlp;
|
||||
+ ev->num_6ghz_reg_rules_ap_vlp;
|
||||
|
||||
for (i = 0; i < WMI_REG_MAX_CLIENT_TYPE; i++) {
|
||||
reg_info->num_6ghz_rules_client[WMI_REG_INDOOR_AP][i] =
|
||||
- ext_chan_list_event_hdr->num_6ghz_reg_rules_client_lpi[i];
|
||||
+ ev->num_6ghz_reg_rules_client_lpi[i];
|
||||
reg_info->num_6ghz_rules_client[WMI_REG_STANDARD_POWER_AP][i] =
|
||||
- ext_chan_list_event_hdr->num_6ghz_reg_rules_client_sp[i];
|
||||
+ ev->num_6ghz_reg_rules_client_sp[i];
|
||||
reg_info->num_6ghz_rules_client[WMI_REG_VERY_LOW_POWER_AP][i] =
|
||||
- ext_chan_list_event_hdr->num_6ghz_reg_rules_client_vlp[i];
|
||||
+ ev->num_6ghz_reg_rules_client_vlp[i];
|
||||
}
|
||||
|
||||
num_2ghz_reg_rules = reg_info->num_2ghz_reg_rules;
|
||||
@@ -5231,57 +5261,79 @@ static int ath11k_pull_reg_chan_list_ext
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
- memcpy(reg_info->alpha2, &ext_chan_list_event_hdr->alpha2,
|
||||
- REG_ALPHA2_LEN);
|
||||
+ memcpy(reg_info->alpha2, &ev->alpha2, REG_ALPHA2_LEN);
|
||||
+
|
||||
+ reg_info->dfs_region = ev->dfs_region;
|
||||
+ reg_info->phybitmap = ev->phybitmap;
|
||||
+ reg_info->num_phy = ev->num_phy;
|
||||
+ reg_info->phy_id = ev->phy_id;
|
||||
+ reg_info->ctry_code = ev->country_id;
|
||||
+ reg_info->reg_dmn_pair = ev->domain_code;
|
||||
|
||||
- reg_info->dfs_region = ext_chan_list_event_hdr->dfs_region;
|
||||
- reg_info->phybitmap = ext_chan_list_event_hdr->phybitmap;
|
||||
- reg_info->num_phy = ext_chan_list_event_hdr->num_phy;
|
||||
- reg_info->phy_id = ext_chan_list_event_hdr->phy_id;
|
||||
- reg_info->ctry_code = ext_chan_list_event_hdr->country_id;
|
||||
- reg_info->reg_dmn_pair = ext_chan_list_event_hdr->domain_code;
|
||||
+ ath11k_dbg(ab, ATH11K_DBG_WMI,
|
||||
+ "status_code %s",
|
||||
+ ath11k_cc_status_to_str(reg_info->status_code));
|
||||
|
||||
reg_info->status_code =
|
||||
- ath11k_wmi_cc_setting_code_to_reg(ext_chan_list_event_hdr->status_code);
|
||||
+ ath11k_wmi_cc_setting_code_to_reg(ev->status_code);
|
||||
|
||||
reg_info->is_ext_reg_event = true;
|
||||
|
||||
- reg_info->min_bw_2ghz = ext_chan_list_event_hdr->min_bw_2ghz;
|
||||
- reg_info->max_bw_2ghz = ext_chan_list_event_hdr->max_bw_2ghz;
|
||||
- reg_info->min_bw_5ghz = ext_chan_list_event_hdr->min_bw_5ghz;
|
||||
- reg_info->max_bw_5ghz = ext_chan_list_event_hdr->max_bw_5ghz;
|
||||
+ reg_info->min_bw_2ghz = ev->min_bw_2ghz;
|
||||
+ reg_info->max_bw_2ghz = ev->max_bw_2ghz;
|
||||
+ reg_info->min_bw_5ghz = ev->min_bw_5ghz;
|
||||
+ reg_info->max_bw_5ghz = ev->max_bw_5ghz;
|
||||
|
||||
reg_info->min_bw_6ghz_ap[WMI_REG_INDOOR_AP] =
|
||||
- ext_chan_list_event_hdr->min_bw_6ghz_ap_lpi;
|
||||
+ ev->min_bw_6ghz_ap_lpi;
|
||||
reg_info->max_bw_6ghz_ap[WMI_REG_INDOOR_AP] =
|
||||
- ext_chan_list_event_hdr->max_bw_6ghz_ap_lpi;
|
||||
+ ev->max_bw_6ghz_ap_lpi;
|
||||
reg_info->min_bw_6ghz_ap[WMI_REG_STANDARD_POWER_AP] =
|
||||
- ext_chan_list_event_hdr->min_bw_6ghz_ap_sp;
|
||||
+ ev->min_bw_6ghz_ap_sp;
|
||||
reg_info->max_bw_6ghz_ap[WMI_REG_STANDARD_POWER_AP] =
|
||||
- ext_chan_list_event_hdr->max_bw_6ghz_ap_sp;
|
||||
+ ev->max_bw_6ghz_ap_sp;
|
||||
reg_info->min_bw_6ghz_ap[WMI_REG_VERY_LOW_POWER_AP] =
|
||||
- ext_chan_list_event_hdr->min_bw_6ghz_ap_vlp;
|
||||
+ ev->min_bw_6ghz_ap_vlp;
|
||||
reg_info->max_bw_6ghz_ap[WMI_REG_VERY_LOW_POWER_AP] =
|
||||
- ext_chan_list_event_hdr->max_bw_6ghz_ap_vlp;
|
||||
+ ev->max_bw_6ghz_ap_vlp;
|
||||
+
|
||||
+ ath11k_dbg(ab, ATH11K_DBG_WMI,
|
||||
+ "6 GHz AP BW: LPI (%d - %d), SP (%d - %d), VLP (%d - %d)\n",
|
||||
+ reg_info->min_bw_6ghz_ap[WMI_REG_INDOOR_AP],
|
||||
+ reg_info->max_bw_6ghz_ap[WMI_REG_INDOOR_AP],
|
||||
+ reg_info->min_bw_6ghz_ap[WMI_REG_STANDARD_POWER_AP],
|
||||
+ reg_info->max_bw_6ghz_ap[WMI_REG_STANDARD_POWER_AP],
|
||||
+ reg_info->min_bw_6ghz_ap[WMI_REG_VERY_LOW_POWER_AP],
|
||||
+ reg_info->max_bw_6ghz_ap[WMI_REG_VERY_LOW_POWER_AP]);
|
||||
|
||||
for (i = 0; i < WMI_REG_MAX_CLIENT_TYPE; i++) {
|
||||
reg_info->min_bw_6ghz_client[WMI_REG_INDOOR_AP][i] =
|
||||
- ext_chan_list_event_hdr->min_bw_6ghz_client_lpi[i];
|
||||
+ ev->min_bw_6ghz_client_lpi[i];
|
||||
reg_info->max_bw_6ghz_client[WMI_REG_INDOOR_AP][i] =
|
||||
- ext_chan_list_event_hdr->max_bw_6ghz_client_lpi[i];
|
||||
+ ev->max_bw_6ghz_client_lpi[i];
|
||||
reg_info->min_bw_6ghz_client[WMI_REG_STANDARD_POWER_AP][i] =
|
||||
- ext_chan_list_event_hdr->min_bw_6ghz_client_sp[i];
|
||||
+ ev->min_bw_6ghz_client_sp[i];
|
||||
reg_info->max_bw_6ghz_client[WMI_REG_STANDARD_POWER_AP][i] =
|
||||
- ext_chan_list_event_hdr->max_bw_6ghz_client_sp[i];
|
||||
+ ev->max_bw_6ghz_client_sp[i];
|
||||
reg_info->min_bw_6ghz_client[WMI_REG_VERY_LOW_POWER_AP][i] =
|
||||
- ext_chan_list_event_hdr->min_bw_6ghz_client_vlp[i];
|
||||
+ ev->min_bw_6ghz_client_vlp[i];
|
||||
reg_info->max_bw_6ghz_client[WMI_REG_VERY_LOW_POWER_AP][i] =
|
||||
- ext_chan_list_event_hdr->max_bw_6ghz_client_vlp[i];
|
||||
+ ev->max_bw_6ghz_client_vlp[i];
|
||||
+
|
||||
+ ath11k_dbg(ab, ATH11K_DBG_WMI,
|
||||
+ "6 GHz %s BW: LPI (%d - %d), SP (%d - %d), VLP (%d - %d)\n",
|
||||
+ ath11k_6ghz_client_type_to_str(i),
|
||||
+ reg_info->min_bw_6ghz_client[WMI_REG_INDOOR_AP][i],
|
||||
+ reg_info->max_bw_6ghz_client[WMI_REG_INDOOR_AP][i],
|
||||
+ reg_info->min_bw_6ghz_client[WMI_REG_STANDARD_POWER_AP][i],
|
||||
+ reg_info->max_bw_6ghz_client[WMI_REG_STANDARD_POWER_AP][i],
|
||||
+ reg_info->min_bw_6ghz_client[WMI_REG_VERY_LOW_POWER_AP][i],
|
||||
+ reg_info->max_bw_6ghz_client[WMI_REG_VERY_LOW_POWER_AP][i]);
|
||||
}
|
||||
|
||||
ath11k_dbg(ab, ATH11K_DBG_WMI,
|
||||
- "%s:cc_ext %s dsf %d BW: min_2ghz %d max_2ghz %d min_5ghz %d max_5ghz %d",
|
||||
- __func__, reg_info->alpha2, reg_info->dfs_region,
|
||||
+ "cc_ext %s dsf %d BW: min_2ghz %d max_2ghz %d min_5ghz %d max_5ghz %d",
|
||||
+ reg_info->alpha2, reg_info->dfs_region,
|
||||
reg_info->min_bw_2ghz, reg_info->max_bw_2ghz,
|
||||
reg_info->min_bw_5ghz, reg_info->max_bw_5ghz);
|
||||
|
||||
@@ -5310,9 +5362,8 @@ static int ath11k_pull_reg_chan_list_ext
|
||||
num_6ghz_client[WMI_REG_VERY_LOW_POWER_AP][j]);
|
||||
|
||||
ext_wmi_reg_rule =
|
||||
- (struct wmi_regulatory_ext_rule *)((u8 *)ext_chan_list_event_hdr
|
||||
- + sizeof(*ext_chan_list_event_hdr)
|
||||
- + sizeof(struct wmi_tlv));
|
||||
+ (struct wmi_regulatory_ext_rule *)((u8 *)ev + sizeof(*ev) +
|
||||
+ sizeof(struct wmi_tlv));
|
||||
if (num_2ghz_reg_rules) {
|
||||
reg_info->reg_rules_2ghz_ptr =
|
||||
create_ext_reg_rules_from_wmi(num_2ghz_reg_rules,
|
||||
@@ -5323,6 +5374,10 @@ static int ath11k_pull_reg_chan_list_ext
|
||||
ath11k_warn(ab, "Unable to Allocate memory for 2 GHz rules\n");
|
||||
return -ENOMEM;
|
||||
}
|
||||
+
|
||||
+ ath11k_print_reg_rule(ab, "2 GHz",
|
||||
+ num_2ghz_reg_rules,
|
||||
+ reg_info->reg_rules_2ghz_ptr);
|
||||
}
|
||||
|
||||
ext_wmi_reg_rule += num_2ghz_reg_rules;
|
||||
@@ -5358,6 +5413,10 @@ static int ath11k_pull_reg_chan_list_ext
|
||||
ath11k_warn(ab, "Unable to Allocate memory for 5 GHz rules\n");
|
||||
return -ENOMEM;
|
||||
}
|
||||
+
|
||||
+ ath11k_print_reg_rule(ab, "5 GHz",
|
||||
+ num_5ghz_reg_rules,
|
||||
+ reg_info->reg_rules_5ghz_ptr);
|
||||
}
|
||||
|
||||
/* We have adjusted the number of 5 GHz reg rules above. But still those
|
||||
@@ -5378,10 +5437,17 @@ static int ath11k_pull_reg_chan_list_ext
|
||||
return -ENOMEM;
|
||||
}
|
||||
|
||||
+ ath11k_print_reg_rule(ab, ath11k_6ghz_ap_type_to_str(i),
|
||||
+ num_6ghz_reg_rules_ap[i],
|
||||
+ reg_info->reg_rules_6ghz_ap_ptr[i]);
|
||||
+
|
||||
ext_wmi_reg_rule += num_6ghz_reg_rules_ap[i];
|
||||
}
|
||||
|
||||
for (j = 0; j < WMI_REG_CURRENT_MAX_AP_TYPE; j++) {
|
||||
+ ath11k_dbg(ab, ATH11K_DBG_WMI,
|
||||
+ "6 GHz AP type %s", ath11k_6ghz_ap_type_to_str(j));
|
||||
+
|
||||
for (i = 0; i < WMI_REG_MAX_CLIENT_TYPE; i++) {
|
||||
reg_info->reg_rules_6ghz_client_ptr[j][i] =
|
||||
create_ext_reg_rules_from_wmi(num_6ghz_client[j][i],
|
||||
@@ -5393,35 +5459,58 @@ static int ath11k_pull_reg_chan_list_ext
|
||||
return -ENOMEM;
|
||||
}
|
||||
|
||||
+ ath11k_print_reg_rule(ab,
|
||||
+ ath11k_6ghz_client_type_to_str(i),
|
||||
+ num_6ghz_client[j][i],
|
||||
+ reg_info->reg_rules_6ghz_client_ptr[j][i]);
|
||||
+
|
||||
ext_wmi_reg_rule += num_6ghz_client[j][i];
|
||||
}
|
||||
}
|
||||
|
||||
- reg_info->client_type = ext_chan_list_event_hdr->client_type;
|
||||
- reg_info->rnr_tpe_usable = ext_chan_list_event_hdr->rnr_tpe_usable;
|
||||
+ reg_info->client_type = ev->client_type;
|
||||
+ reg_info->rnr_tpe_usable = ev->rnr_tpe_usable;
|
||||
reg_info->unspecified_ap_usable =
|
||||
- ext_chan_list_event_hdr->unspecified_ap_usable;
|
||||
+ ev->unspecified_ap_usable;
|
||||
reg_info->domain_code_6ghz_ap[WMI_REG_INDOOR_AP] =
|
||||
- ext_chan_list_event_hdr->domain_code_6ghz_ap_lpi;
|
||||
+ ev->domain_code_6ghz_ap_lpi;
|
||||
reg_info->domain_code_6ghz_ap[WMI_REG_STANDARD_POWER_AP] =
|
||||
- ext_chan_list_event_hdr->domain_code_6ghz_ap_sp;
|
||||
+ ev->domain_code_6ghz_ap_sp;
|
||||
reg_info->domain_code_6ghz_ap[WMI_REG_VERY_LOW_POWER_AP] =
|
||||
- ext_chan_list_event_hdr->domain_code_6ghz_ap_vlp;
|
||||
+ ev->domain_code_6ghz_ap_vlp;
|
||||
+
|
||||
+ ath11k_dbg(ab, ATH11K_DBG_WMI,
|
||||
+ "6 GHz reg info client type %s rnr_tpe_usable %d unspecified_ap_usable %d AP sub domain: lpi %s, sp %s, vlp %s\n",
|
||||
+ ath11k_6ghz_client_type_to_str(reg_info->client_type),
|
||||
+ reg_info->rnr_tpe_usable,
|
||||
+ reg_info->unspecified_ap_usable,
|
||||
+ ath11k_sub_reg_6ghz_to_str(ev->domain_code_6ghz_ap_lpi),
|
||||
+ ath11k_sub_reg_6ghz_to_str(ev->domain_code_6ghz_ap_sp),
|
||||
+ ath11k_sub_reg_6ghz_to_str(ev->domain_code_6ghz_ap_vlp));
|
||||
|
||||
for (i = 0; i < WMI_REG_MAX_CLIENT_TYPE; i++) {
|
||||
reg_info->domain_code_6ghz_client[WMI_REG_INDOOR_AP][i] =
|
||||
- ext_chan_list_event_hdr->domain_code_6ghz_client_lpi[i];
|
||||
+ ev->domain_code_6ghz_client_lpi[i];
|
||||
reg_info->domain_code_6ghz_client[WMI_REG_STANDARD_POWER_AP][i] =
|
||||
- ext_chan_list_event_hdr->domain_code_6ghz_client_sp[i];
|
||||
+ ev->domain_code_6ghz_client_sp[i];
|
||||
reg_info->domain_code_6ghz_client[WMI_REG_VERY_LOW_POWER_AP][i] =
|
||||
- ext_chan_list_event_hdr->domain_code_6ghz_client_vlp[i];
|
||||
+ ev->domain_code_6ghz_client_vlp[i];
|
||||
+
|
||||
+ ath11k_dbg(ab, ATH11K_DBG_WMI,
|
||||
+ "6 GHz client type %s client sub domain: lpi %s, sp %s, vlp %s\n",
|
||||
+ ath11k_6ghz_client_type_to_str(i),
|
||||
+ ath11k_sub_reg_6ghz_to_str(ev->domain_code_6ghz_client_lpi[i]),
|
||||
+ ath11k_sub_reg_6ghz_to_str(ev->domain_code_6ghz_client_sp[i]),
|
||||
+ ath11k_sub_reg_6ghz_to_str(ev->domain_code_6ghz_client_vlp[i])
|
||||
+ );
|
||||
}
|
||||
|
||||
- reg_info->domain_code_6ghz_super_id =
|
||||
- ext_chan_list_event_hdr->domain_code_6ghz_super_id;
|
||||
+ reg_info->domain_code_6ghz_super_id = ev->domain_code_6ghz_super_id;
|
||||
|
||||
- ath11k_dbg(ab, ATH11K_DBG_WMI, "6 GHz client_type: %d domain_code_6ghz_super_id: %d",
|
||||
- reg_info->client_type, reg_info->domain_code_6ghz_super_id);
|
||||
+ ath11k_dbg(ab, ATH11K_DBG_WMI,
|
||||
+ "6 GHz client_type %s 6 GHz super domain %s",
|
||||
+ ath11k_6ghz_client_type_to_str(reg_info->client_type),
|
||||
+ ath11k_super_reg_6ghz_to_str(reg_info->domain_code_6ghz_super_id));
|
||||
|
||||
ath11k_dbg(ab, ATH11K_DBG_WMI, "processed regulatory ext channel list\n");
|
||||
|
||||
--- a/drivers/net/wireless/ath/ath11k/wmi.h
|
||||
+++ b/drivers/net/wireless/ath/ath11k/wmi.h
|
||||
@@ -4139,6 +4139,7 @@ enum cc_setting_code {
|
||||
|
||||
/* add new setting code above, update in
|
||||
* @enum wmi_reg_cc_setting_code as well.
|
||||
+ * Also handle it in ath11k_cc_status_to_str()
|
||||
*/
|
||||
};
|
||||
|
||||
@@ -4163,21 +4164,162 @@ ath11k_wmi_cc_setting_code_to_reg(enum w
|
||||
return REG_SET_CC_STATUS_FAIL;
|
||||
}
|
||||
|
||||
+static inline const char *ath11k_cc_status_to_str(enum cc_setting_code code)
|
||||
+{
|
||||
+ switch (code) {
|
||||
+ case REG_SET_CC_STATUS_PASS:
|
||||
+ return "REG_SET_CC_STATUS_PASS";
|
||||
+ case REG_CURRENT_ALPHA2_NOT_FOUND:
|
||||
+ return "REG_CURRENT_ALPHA2_NOT_FOUND";
|
||||
+ case REG_INIT_ALPHA2_NOT_FOUND:
|
||||
+ return "REG_INIT_ALPHA2_NOT_FOUND";
|
||||
+ case REG_SET_CC_CHANGE_NOT_ALLOWED:
|
||||
+ return "REG_SET_CC_CHANGE_NOT_ALLOWED";
|
||||
+ case REG_SET_CC_STATUS_NO_MEMORY:
|
||||
+ return "REG_SET_CC_STATUS_NO_MEMORY";
|
||||
+ case REG_SET_CC_STATUS_FAIL:
|
||||
+ return "REG_SET_CC_STATUS_FAIL";
|
||||
+ }
|
||||
+
|
||||
+ return "Unknown CC status";
|
||||
+}
|
||||
+
|
||||
enum wmi_reg_6ghz_ap_type {
|
||||
WMI_REG_INDOOR_AP = 0,
|
||||
WMI_REG_STANDARD_POWER_AP = 1,
|
||||
WMI_REG_VERY_LOW_POWER_AP = 2,
|
||||
|
||||
+ /* add AP type above, handle in ath11k_6ghz_ap_type_to_str()
|
||||
+ */
|
||||
WMI_REG_CURRENT_MAX_AP_TYPE,
|
||||
WMI_REG_MAX_AP_TYPE = 7,
|
||||
};
|
||||
|
||||
+static inline const char *
|
||||
+ath11k_6ghz_ap_type_to_str(enum wmi_reg_6ghz_ap_type type)
|
||||
+{
|
||||
+ switch (type) {
|
||||
+ case WMI_REG_INDOOR_AP:
|
||||
+ return "INDOOR AP";
|
||||
+ case WMI_REG_STANDARD_POWER_AP:
|
||||
+ return "STANDARD POWER AP";
|
||||
+ case WMI_REG_VERY_LOW_POWER_AP:
|
||||
+ return "VERY LOW POWER AP";
|
||||
+ case WMI_REG_CURRENT_MAX_AP_TYPE:
|
||||
+ return "CURRENT_MAX_AP_TYPE";
|
||||
+ case WMI_REG_MAX_AP_TYPE:
|
||||
+ return "MAX_AP_TYPE";
|
||||
+ }
|
||||
+
|
||||
+ return "unknown 6 GHz AP type";
|
||||
+}
|
||||
+
|
||||
enum wmi_reg_6ghz_client_type {
|
||||
WMI_REG_DEFAULT_CLIENT = 0,
|
||||
WMI_REG_SUBORDINATE_CLIENT = 1,
|
||||
WMI_REG_MAX_CLIENT_TYPE = 2,
|
||||
+
|
||||
+ /* add client type above, handle it in
|
||||
+ * ath11k_6ghz_client_type_to_str()
|
||||
+ */
|
||||
+};
|
||||
+
|
||||
+static inline const char *
|
||||
+ath11k_6ghz_client_type_to_str(enum wmi_reg_6ghz_client_type type)
|
||||
+{
|
||||
+ switch (type) {
|
||||
+ case WMI_REG_DEFAULT_CLIENT:
|
||||
+ return "DEFAULT CLIENT";
|
||||
+ case WMI_REG_SUBORDINATE_CLIENT:
|
||||
+ return "SUBORDINATE CLIENT";
|
||||
+ case WMI_REG_MAX_CLIENT_TYPE:
|
||||
+ return "MAX_CLIENT_TYPE";
|
||||
+ }
|
||||
+
|
||||
+ return "unknown 6 GHz client type";
|
||||
+}
|
||||
+
|
||||
+enum reg_subdomains_6ghz {
|
||||
+ EMPTY_6GHZ = 0x0,
|
||||
+ FCC1_CLIENT_LPI_REGULAR_6GHZ = 0x01,
|
||||
+ FCC1_CLIENT_SP_6GHZ = 0x02,
|
||||
+ FCC1_AP_LPI_6GHZ = 0x03,
|
||||
+ FCC1_CLIENT_LPI_SUBORDINATE = FCC1_AP_LPI_6GHZ,
|
||||
+ FCC1_AP_SP_6GHZ = 0x04,
|
||||
+ ETSI1_LPI_6GHZ = 0x10,
|
||||
+ ETSI1_VLP_6GHZ = 0x11,
|
||||
+ ETSI2_LPI_6GHZ = 0x12,
|
||||
+ ETSI2_VLP_6GHZ = 0x13,
|
||||
+ APL1_LPI_6GHZ = 0x20,
|
||||
+ APL1_VLP_6GHZ = 0x21,
|
||||
+
|
||||
+ /* add sub-domain above, handle it in
|
||||
+ * ath11k_sub_reg_6ghz_to_str()
|
||||
+ */
|
||||
+};
|
||||
+
|
||||
+static inline const char *
|
||||
+ath11k_sub_reg_6ghz_to_str(enum reg_subdomains_6ghz sub_id)
|
||||
+{
|
||||
+ switch (sub_id) {
|
||||
+ case EMPTY_6GHZ:
|
||||
+ return "N/A";
|
||||
+ case FCC1_CLIENT_LPI_REGULAR_6GHZ:
|
||||
+ return "FCC1_CLIENT_LPI_REGULAR_6GHZ";
|
||||
+ case FCC1_CLIENT_SP_6GHZ:
|
||||
+ return "FCC1_CLIENT_SP_6GHZ";
|
||||
+ case FCC1_AP_LPI_6GHZ:
|
||||
+ return "FCC1_AP_LPI_6GHZ/FCC1_CLIENT_LPI_SUBORDINATE";
|
||||
+ case FCC1_AP_SP_6GHZ:
|
||||
+ return "FCC1_AP_SP_6GHZ";
|
||||
+ case ETSI1_LPI_6GHZ:
|
||||
+ return "ETSI1_LPI_6GHZ";
|
||||
+ case ETSI1_VLP_6GHZ:
|
||||
+ return "ETSI1_VLP_6GHZ";
|
||||
+ case ETSI2_LPI_6GHZ:
|
||||
+ return "ETSI2_LPI_6GHZ";
|
||||
+ case ETSI2_VLP_6GHZ:
|
||||
+ return "ETSI2_VLP_6GHZ";
|
||||
+ case APL1_LPI_6GHZ:
|
||||
+ return "APL1_LPI_6GHZ";
|
||||
+ case APL1_VLP_6GHZ:
|
||||
+ return "APL1_VLP_6GHZ";
|
||||
+ }
|
||||
+
|
||||
+ return "unknown sub reg id";
|
||||
+}
|
||||
+
|
||||
+enum reg_super_domain_6ghz {
|
||||
+ FCC1_6GHZ = 0x01,
|
||||
+ ETSI1_6GHZ = 0x02,
|
||||
+ ETSI2_6GHZ = 0x03,
|
||||
+ APL1_6GHZ = 0x04,
|
||||
+ FCC1_6GHZ_CL = 0x05,
|
||||
+
|
||||
+ /* add super domain above, handle it in
|
||||
+ * ath11k_super_reg_6ghz_to_str()
|
||||
+ */
|
||||
};
|
||||
|
||||
+static inline const char *
|
||||
+ath11k_super_reg_6ghz_to_str(enum reg_super_domain_6ghz domain_id)
|
||||
+{
|
||||
+ switch (domain_id) {
|
||||
+ case FCC1_6GHZ:
|
||||
+ return "FCC1_6GHZ";
|
||||
+ case ETSI1_6GHZ:
|
||||
+ return "ETSI1_6GHZ";
|
||||
+ case ETSI2_6GHZ:
|
||||
+ return "ETSI2_6GHZ";
|
||||
+ case APL1_6GHZ:
|
||||
+ return "APL1_6GHZ";
|
||||
+ case FCC1_6GHZ_CL:
|
||||
+ return "FCC1_6GHZ_CL";
|
||||
+ }
|
||||
+
|
||||
+ return "unknown domain id";
|
||||
+}
|
||||
+
|
||||
struct cur_reg_rule {
|
||||
u16 start_freq;
|
||||
u16 end_freq;
|
@ -0,0 +1,246 @@
|
||||
From 3b1088a09ec9438523c251d8435e78988824bc0d Mon Sep 17 00:00:00 2001
|
||||
From: "Gustavo A. R. Silva" <gustavoars@kernel.org>
|
||||
Date: Tue, 7 Mar 2023 16:22:39 -0600
|
||||
Subject: [PATCH] wifi: ath11k: Replace fake flex-array with flexible-array
|
||||
member
|
||||
MIME-Version: 1.0
|
||||
Content-Type: text/plain; charset=UTF-8
|
||||
Content-Transfer-Encoding: 8bit
|
||||
|
||||
Zero-length arrays as fake flexible arrays are deprecated and we are
|
||||
moving towards adopting C99 flexible-array members instead.
|
||||
|
||||
Address 25 of the following warnings found with GCC-13 and
|
||||
-fstrict-flex-arrays=3 enabled:
|
||||
drivers/net/wireless/ath/ath11k/debugfs_htt_stats.c:30:51: warning: array subscript <unknown> is outside array bounds of ‘const u32[0]’ {aka ‘const unsigned int[]’} [-Warray-bounds=]
|
||||
|
||||
This helps with the ongoing efforts to tighten the FORTIFY_SOURCE
|
||||
routines on memcpy() and help us make progress towards globally
|
||||
enabling -fstrict-flex-arrays=3 [1].
|
||||
|
||||
Link: https://github.com/KSPP/linux/issues/21
|
||||
Link: https://github.com/KSPP/linux/issues/266
|
||||
Link: https://gcc.gnu.org/pipermail/gcc-patches/2022-October/602902.html [1]
|
||||
Signed-off-by: Gustavo A. R. Silva <gustavoars@kernel.org>
|
||||
Reviewed-by: Simon Horman <simon.horman@corigine.com>
|
||||
Signed-off-by: Kalle Valo <quic_kvalo@quicinc.com>
|
||||
Link: https://lore.kernel.org/r/ZAe5L5DtmsQxzqRH@work
|
||||
---
|
||||
.../wireless/ath/ath11k/debugfs_htt_stats.h | 73 +++++++++++--------
|
||||
1 file changed, 43 insertions(+), 30 deletions(-)
|
||||
|
||||
--- a/drivers/net/wireless/ath/ath11k/debugfs_htt_stats.h
|
||||
+++ b/drivers/net/wireless/ath/ath11k/debugfs_htt_stats.h
|
||||
@@ -143,7 +143,8 @@ enum htt_tx_pdev_underrun_enum {
|
||||
/* Bytes stored in little endian order */
|
||||
/* Length should be multiple of DWORD */
|
||||
struct htt_stats_string_tlv {
|
||||
- u32 data[0]; /* Can be variable length */
|
||||
+ /* Can be variable length */
|
||||
+ DECLARE_FLEX_ARRAY(u32, data);
|
||||
} __packed;
|
||||
|
||||
#define HTT_STATS_MAC_ID GENMASK(7, 0)
|
||||
@@ -205,27 +206,32 @@ struct htt_tx_pdev_stats_cmn_tlv {
|
||||
|
||||
/* NOTE: Variable length TLV, use length spec to infer array size */
|
||||
struct htt_tx_pdev_stats_urrn_tlv_v {
|
||||
- u32 urrn_stats[0]; /* HTT_TX_PDEV_MAX_URRN_STATS */
|
||||
+ /* HTT_TX_PDEV_MAX_URRN_STATS */
|
||||
+ DECLARE_FLEX_ARRAY(u32, urrn_stats);
|
||||
};
|
||||
|
||||
/* NOTE: Variable length TLV, use length spec to infer array size */
|
||||
struct htt_tx_pdev_stats_flush_tlv_v {
|
||||
- u32 flush_errs[0]; /* HTT_TX_PDEV_MAX_FLUSH_REASON_STATS */
|
||||
+ /* HTT_TX_PDEV_MAX_FLUSH_REASON_STATS */
|
||||
+ DECLARE_FLEX_ARRAY(u32, flush_errs);
|
||||
};
|
||||
|
||||
/* NOTE: Variable length TLV, use length spec to infer array size */
|
||||
struct htt_tx_pdev_stats_sifs_tlv_v {
|
||||
- u32 sifs_status[0]; /* HTT_TX_PDEV_MAX_SIFS_BURST_STATS */
|
||||
+ /* HTT_TX_PDEV_MAX_SIFS_BURST_STATS */
|
||||
+ DECLARE_FLEX_ARRAY(u32, sifs_status);
|
||||
};
|
||||
|
||||
/* NOTE: Variable length TLV, use length spec to infer array size */
|
||||
struct htt_tx_pdev_stats_phy_err_tlv_v {
|
||||
- u32 phy_errs[0]; /* HTT_TX_PDEV_MAX_PHY_ERR_STATS */
|
||||
+ /* HTT_TX_PDEV_MAX_PHY_ERR_STATS */
|
||||
+ DECLARE_FLEX_ARRAY(u32, phy_errs);
|
||||
};
|
||||
|
||||
/* NOTE: Variable length TLV, use length spec to infer array size */
|
||||
struct htt_tx_pdev_stats_sifs_hist_tlv_v {
|
||||
- u32 sifs_hist_status[0]; /* HTT_TX_PDEV_SIFS_BURST_HIST_STATS */
|
||||
+ /* HTT_TX_PDEV_SIFS_BURST_HIST_STATS */
|
||||
+ DECLARE_FLEX_ARRAY(u32, sifs_hist_status);
|
||||
};
|
||||
|
||||
struct htt_tx_pdev_stats_tx_ppdu_stats_tlv_v {
|
||||
@@ -590,20 +596,20 @@ struct htt_tx_hwq_difs_latency_stats_tlv
|
||||
|
||||
/* NOTE: Variable length TLV, use length spec to infer array size */
|
||||
struct htt_tx_hwq_cmd_result_stats_tlv_v {
|
||||
- /* Histogram of sched cmd result */
|
||||
- u32 cmd_result[0]; /* HTT_TX_HWQ_MAX_CMD_RESULT_STATS */
|
||||
+ /* Histogram of sched cmd result, HTT_TX_HWQ_MAX_CMD_RESULT_STATS */
|
||||
+ DECLARE_FLEX_ARRAY(u32, cmd_result);
|
||||
};
|
||||
|
||||
/* NOTE: Variable length TLV, use length spec to infer array size */
|
||||
struct htt_tx_hwq_cmd_stall_stats_tlv_v {
|
||||
- /* Histogram of various pause conitions */
|
||||
- u32 cmd_stall_status[0]; /* HTT_TX_HWQ_MAX_CMD_STALL_STATS */
|
||||
+ /* Histogram of various pause conitions, HTT_TX_HWQ_MAX_CMD_STALL_STATS */
|
||||
+ DECLARE_FLEX_ARRAY(u32, cmd_stall_status);
|
||||
};
|
||||
|
||||
/* NOTE: Variable length TLV, use length spec to infer array size */
|
||||
struct htt_tx_hwq_fes_result_stats_tlv_v {
|
||||
- /* Histogram of number of user fes result */
|
||||
- u32 fes_result[0]; /* HTT_TX_HWQ_MAX_FES_RESULT_STATS */
|
||||
+ /* Histogram of number of user fes result, HTT_TX_HWQ_MAX_FES_RESULT_STATS */
|
||||
+ DECLARE_FLEX_ARRAY(u32, fes_result);
|
||||
};
|
||||
|
||||
/* NOTE: Variable length TLV, use length spec to infer array size
|
||||
@@ -635,8 +641,8 @@ struct htt_tx_hwq_tried_mpdu_cnt_hist_tl
|
||||
* #define WAL_TXOP_USED_HISTOGRAM_INTERVAL 1000 ( 1 ms )
|
||||
*/
|
||||
struct htt_tx_hwq_txop_used_cnt_hist_tlv_v {
|
||||
- /* Histogram of txop used cnt */
|
||||
- u32 txop_used_cnt_hist[0]; /* HTT_TX_HWQ_TXOP_USED_CNT_HIST */
|
||||
+ /* Histogram of txop used cnt, HTT_TX_HWQ_TXOP_USED_CNT_HIST */
|
||||
+ DECLARE_FLEX_ARRAY(u32, txop_used_cnt_hist);
|
||||
};
|
||||
|
||||
/* == TX SELFGEN STATS == */
|
||||
@@ -804,17 +810,20 @@ struct htt_tx_pdev_mpdu_stats_tlv {
|
||||
/* == TX SCHED STATS == */
|
||||
/* NOTE: Variable length TLV, use length spec to infer array size */
|
||||
struct htt_sched_txq_cmd_posted_tlv_v {
|
||||
- u32 sched_cmd_posted[0]; /* HTT_TX_PDEV_SCHED_TX_MODE_MAX */
|
||||
+ /* HTT_TX_PDEV_SCHED_TX_MODE_MAX */
|
||||
+ DECLARE_FLEX_ARRAY(u32, sched_cmd_posted);
|
||||
};
|
||||
|
||||
/* NOTE: Variable length TLV, use length spec to infer array size */
|
||||
struct htt_sched_txq_cmd_reaped_tlv_v {
|
||||
- u32 sched_cmd_reaped[0]; /* HTT_TX_PDEV_SCHED_TX_MODE_MAX */
|
||||
+ /* HTT_TX_PDEV_SCHED_TX_MODE_MAX */
|
||||
+ DECLARE_FLEX_ARRAY(u32, sched_cmd_reaped);
|
||||
};
|
||||
|
||||
/* NOTE: Variable length TLV, use length spec to infer array size */
|
||||
struct htt_sched_txq_sched_order_su_tlv_v {
|
||||
- u32 sched_order_su[0]; /* HTT_TX_PDEV_NUM_SCHED_ORDER_LOG */
|
||||
+ /* HTT_TX_PDEV_NUM_SCHED_ORDER_LOG */
|
||||
+ DECLARE_FLEX_ARRAY(u32, sched_order_su);
|
||||
};
|
||||
|
||||
enum htt_sched_txq_sched_ineligibility_tlv_enum {
|
||||
@@ -842,7 +851,7 @@ enum htt_sched_txq_sched_ineligibility_t
|
||||
/* NOTE: Variable length TLV, use length spec to infer array size */
|
||||
struct htt_sched_txq_sched_ineligibility_tlv_v {
|
||||
/* indexed by htt_sched_txq_sched_ineligibility_tlv_enum */
|
||||
- u32 sched_ineligibility[0];
|
||||
+ DECLARE_FLEX_ARRAY(u32, sched_ineligibility);
|
||||
};
|
||||
|
||||
#define HTT_TX_PDEV_STATS_SCHED_PER_TXQ_MAC_ID GENMASK(7, 0)
|
||||
@@ -888,18 +897,20 @@ struct htt_stats_tx_sched_cmn_tlv {
|
||||
|
||||
/* NOTE: Variable length TLV, use length spec to infer array size */
|
||||
struct htt_tx_tqm_gen_mpdu_stats_tlv_v {
|
||||
- u32 gen_mpdu_end_reason[0]; /* HTT_TX_TQM_MAX_GEN_MPDU_END_REASON */
|
||||
+ /* HTT_TX_TQM_MAX_GEN_MPDU_END_REASON */
|
||||
+ DECLARE_FLEX_ARRAY(u32, gen_mpdu_end_reason);
|
||||
};
|
||||
|
||||
/* NOTE: Variable length TLV, use length spec to infer array size */
|
||||
struct htt_tx_tqm_list_mpdu_stats_tlv_v {
|
||||
- u32 list_mpdu_end_reason[0]; /* HTT_TX_TQM_MAX_LIST_MPDU_END_REASON */
|
||||
+ /* HTT_TX_TQM_MAX_LIST_MPDU_END_REASON */
|
||||
+ DECLARE_FLEX_ARRAY(u32, list_mpdu_end_reason);
|
||||
};
|
||||
|
||||
/* NOTE: Variable length TLV, use length spec to infer array size */
|
||||
struct htt_tx_tqm_list_mpdu_cnt_tlv_v {
|
||||
- u32 list_mpdu_cnt_hist[0];
|
||||
- /* HTT_TX_TQM_MAX_LIST_MPDU_CNT_HISTOGRAM_BINS */
|
||||
+ /* HTT_TX_TQM_MAX_LIST_MPDU_CNT_HISTOGRAM_BINS */
|
||||
+ DECLARE_FLEX_ARRAY(u32, list_mpdu_cnt_hist);
|
||||
};
|
||||
|
||||
struct htt_tx_tqm_pdev_stats_tlv_v {
|
||||
@@ -1098,7 +1109,7 @@ struct htt_tx_de_compl_stats_tlv {
|
||||
* ENTRIES_PER_BIN_COUNT)
|
||||
*/
|
||||
struct htt_tx_de_fw2wbm_ring_full_hist_tlv {
|
||||
- u32 fw2wbm_ring_full_hist[0];
|
||||
+ DECLARE_FLEX_ARRAY(u32, fw2wbm_ring_full_hist);
|
||||
};
|
||||
|
||||
struct htt_tx_de_cmn_stats_tlv {
|
||||
@@ -1151,7 +1162,7 @@ struct htt_ring_if_cmn_tlv {
|
||||
/* NOTE: Variable length TLV, use length spec to infer array size */
|
||||
struct htt_sfm_client_user_tlv_v {
|
||||
/* Number of DWORDS used per user and per client */
|
||||
- u32 dwords_used_by_user_n[0];
|
||||
+ DECLARE_FLEX_ARRAY(u32, dwords_used_by_user_n);
|
||||
};
|
||||
|
||||
struct htt_sfm_client_tlv {
|
||||
@@ -1436,12 +1447,14 @@ struct htt_rx_soc_fw_stats_tlv {
|
||||
|
||||
/* NOTE: Variable length TLV, use length spec to infer array size */
|
||||
struct htt_rx_soc_fw_refill_ring_empty_tlv_v {
|
||||
- u32 refill_ring_empty_cnt[0]; /* HTT_RX_STATS_REFILL_MAX_RING */
|
||||
+ /* HTT_RX_STATS_REFILL_MAX_RING */
|
||||
+ DECLARE_FLEX_ARRAY(u32, refill_ring_empty_cnt);
|
||||
};
|
||||
|
||||
/* NOTE: Variable length TLV, use length spec to infer array size */
|
||||
struct htt_rx_soc_fw_refill_ring_num_refill_tlv_v {
|
||||
- u32 refill_ring_num_refill[0]; /* HTT_RX_STATS_REFILL_MAX_RING */
|
||||
+ /* HTT_RX_STATS_REFILL_MAX_RING */
|
||||
+ DECLARE_FLEX_ARRAY(u32, refill_ring_num_refill);
|
||||
};
|
||||
|
||||
/* RXDMA error code from WBM released packets */
|
||||
@@ -1473,7 +1486,7 @@ enum htt_rx_rxdma_error_code_enum {
|
||||
|
||||
/* NOTE: Variable length TLV, use length spec to infer array size */
|
||||
struct htt_rx_soc_fw_refill_ring_num_rxdma_err_tlv_v {
|
||||
- u32 rxdma_err[0]; /* HTT_RX_RXDMA_MAX_ERR_CODE */
|
||||
+ DECLARE_FLEX_ARRAY(u32, rxdma_err); /* HTT_RX_RXDMA_MAX_ERR_CODE */
|
||||
};
|
||||
|
||||
/* REO error code from WBM released packets */
|
||||
@@ -1505,7 +1518,7 @@ enum htt_rx_reo_error_code_enum {
|
||||
|
||||
/* NOTE: Variable length TLV, use length spec to infer array size */
|
||||
struct htt_rx_soc_fw_refill_ring_num_reo_err_tlv_v {
|
||||
- u32 reo_err[0]; /* HTT_RX_REO_MAX_ERR_CODE */
|
||||
+ DECLARE_FLEX_ARRAY(u32, reo_err); /* HTT_RX_REO_MAX_ERR_CODE */
|
||||
};
|
||||
|
||||
/* == RX PDEV STATS == */
|
||||
@@ -1622,13 +1635,13 @@ struct htt_rx_pdev_fw_stats_phy_err_tlv
|
||||
/* NOTE: Variable length TLV, use length spec to infer array size */
|
||||
struct htt_rx_pdev_fw_ring_mpdu_err_tlv_v {
|
||||
/* Num error MPDU for each RxDMA error type */
|
||||
- u32 fw_ring_mpdu_err[0]; /* HTT_RX_STATS_RXDMA_MAX_ERR */
|
||||
+ DECLARE_FLEX_ARRAY(u32, fw_ring_mpdu_err); /* HTT_RX_STATS_RXDMA_MAX_ERR */
|
||||
};
|
||||
|
||||
/* NOTE: Variable length TLV, use length spec to infer array size */
|
||||
struct htt_rx_pdev_fw_mpdu_drop_tlv_v {
|
||||
/* Num MPDU dropped */
|
||||
- u32 fw_mpdu_drop[0]; /* HTT_RX_STATS_FW_DROP_REASON_MAX */
|
||||
+ DECLARE_FLEX_ARRAY(u32, fw_mpdu_drop); /* HTT_RX_STATS_FW_DROP_REASON_MAX */
|
||||
};
|
||||
|
||||
#define HTT_PDEV_CCA_STATS_TX_FRAME_INFO_PRESENT (0x1)
|
@ -0,0 +1,79 @@
|
||||
From 5a78ac33e3cb8822da64dd1af196e83664b332b0 Mon Sep 17 00:00:00 2001
|
||||
From: Aditya Kumar Singh <quic_adisi@quicinc.com>
|
||||
Date: Thu, 9 Mar 2023 15:23:08 +0530
|
||||
Subject: [PATCH] wifi: ath11k: fix deinitialization of firmware resources
|
||||
|
||||
Currently, in ath11k_ahb_fw_resources_init(), iommu domain
|
||||
mapping is done only for the chipsets having fixed firmware
|
||||
memory. Also, for such chipsets, mapping is done only if it
|
||||
does not have TrustZone support.
|
||||
|
||||
During deinitialization, only if TrustZone support is not there,
|
||||
iommu is unmapped back. However, for non fixed firmware memory
|
||||
chipsets, TrustZone support is not there and this makes the
|
||||
condition check to true and it tries to unmap the memory which
|
||||
was not mapped during initialization.
|
||||
|
||||
This leads to the following trace -
|
||||
|
||||
[ 83.198790] Unable to handle kernel NULL pointer dereference at virtual address 0000000000000008
|
||||
[ 83.259537] Modules linked in: ath11k_ahb ath11k qmi_helpers
|
||||
.. snip ..
|
||||
[ 83.280286] pstate: 20000005 (nzCv daif -PAN -UAO -TCO -DIT -SSBS BTYPE=--)
|
||||
[ 83.287228] pc : __iommu_unmap+0x30/0x140
|
||||
[ 83.293907] lr : iommu_unmap+0x5c/0xa4
|
||||
[ 83.298072] sp : ffff80000b3abad0
|
||||
.. snip ..
|
||||
[ 83.369175] Call trace:
|
||||
[ 83.376282] __iommu_unmap+0x30/0x140
|
||||
[ 83.378541] iommu_unmap+0x5c/0xa4
|
||||
[ 83.382360] ath11k_ahb_fw_resource_deinit.part.12+0x2c/0xac [ath11k_ahb]
|
||||
[ 83.385666] ath11k_ahb_free_resources+0x140/0x17c [ath11k_ahb]
|
||||
[ 83.392521] ath11k_ahb_shutdown+0x34/0x40 [ath11k_ahb]
|
||||
[ 83.398248] platform_shutdown+0x20/0x2c
|
||||
[ 83.403455] device_shutdown+0x16c/0x1c4
|
||||
[ 83.407621] kernel_restart_prepare+0x34/0x3c
|
||||
[ 83.411529] kernel_restart+0x14/0x74
|
||||
[ 83.415781] __do_sys_reboot+0x1c4/0x22c
|
||||
[ 83.419427] __arm64_sys_reboot+0x1c/0x24
|
||||
[ 83.423420] invoke_syscall+0x44/0xfc
|
||||
[ 83.427326] el0_svc_common.constprop.3+0xac/0xe8
|
||||
[ 83.430974] do_el0_svc+0xa0/0xa8
|
||||
[ 83.435659] el0_svc+0x1c/0x44
|
||||
[ 83.438957] el0t_64_sync_handler+0x60/0x144
|
||||
[ 83.441910] el0t_64_sync+0x15c/0x160
|
||||
[ 83.446343] Code: aa0103f4 f9400001 f90027a1 d2800001 (f94006a0)
|
||||
[ 83.449903] ---[ end trace 0000000000000000 ]---
|
||||
|
||||
This can be reproduced by probing an AHB chipset which is not
|
||||
having a fixed memory region. During reboot (or rmmod) trace
|
||||
can be seen.
|
||||
|
||||
Fix this issue by adding a condition check on firmware fixed memory
|
||||
hw_param as done in the counter initialization function.
|
||||
|
||||
Tested-on: IPQ8074 hw2.0 AHB WLAN.HK.2.7.0.1-01744-QCAHKSWPL_SILICONZ-1
|
||||
|
||||
Fixes: f9eec4947add ("ath11k: Add support for targets without trustzone")
|
||||
Signed-off-by: Aditya Kumar Singh <quic_adisi@quicinc.com>
|
||||
Signed-off-by: Kalle Valo <quic_kvalo@quicinc.com>
|
||||
Link: https://lore.kernel.org/r/20230309095308.24937-1-quic_adisi@quicinc.com
|
||||
---
|
||||
drivers/net/wireless/ath/ath11k/ahb.c | 6 ++++++
|
||||
1 file changed, 6 insertions(+)
|
||||
|
||||
--- a/drivers/net/wireless/ath/ath11k/ahb.c
|
||||
+++ b/drivers/net/wireless/ath/ath11k/ahb.c
|
||||
@@ -1078,6 +1078,12 @@ static int ath11k_ahb_fw_resource_deinit
|
||||
struct iommu_domain *iommu;
|
||||
size_t unmapped_size;
|
||||
|
||||
+ /* Chipsets not requiring MSA would have not initialized
|
||||
+ * MSA resources, return success in such cases.
|
||||
+ */
|
||||
+ if (!ab->hw_params.fixed_fw_mem)
|
||||
+ return 0;
|
||||
+
|
||||
if (ab_ahb->fw.use_tz)
|
||||
return 0;
|
||||
|
@ -9,12 +9,12 @@ include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=libnftnl
|
||||
PKG_CPE_ID:=cpe:/a:netfilter:libnftnl
|
||||
PKG_VERSION:=1.2.4
|
||||
PKG_VERSION:=1.2.5
|
||||
PKG_RELEASE:=$(AUTORELEASE)
|
||||
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
|
||||
PKG_SOURCE_URL:=https://netfilter.org/projects/$(PKG_NAME)/files
|
||||
PKG_HASH:=c0fe233be4cdfd703e7d5977ef8eb63fcbf1d0052b6044e1b23d47ca3562477f
|
||||
PKG_HASH:=966de0a8120c8a53db859889749368bfb2cba0c4f0b4c1a30d264eccc45f1226
|
||||
|
||||
PKG_MAINTAINER:=Steven Barth <steven@midlink.org>
|
||||
PKG_LICENSE:=GPL-2.0-or-later
|
||||
|
@ -6,12 +6,12 @@
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=nftables
|
||||
PKG_VERSION:=1.0.6
|
||||
PKG_VERSION:=1.0.7
|
||||
PKG_RELEASE:=1
|
||||
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
|
||||
PKG_SOURCE_URL:=https://netfilter.org/projects/$(PKG_NAME)/files
|
||||
PKG_HASH:=2407430ddd82987670e48dc2fda9e280baa8307abec04ab18d609df3db005e4c
|
||||
PKG_HASH:=c12ac941fff9adaedf17367d5ce213789b98a0d314277bc22b3d71e10891f412
|
||||
|
||||
PKG_MAINTAINER:=
|
||||
PKG_LICENSE:=GPL-2.0
|
||||
|
@ -18,7 +18,7 @@ Signed-off-by: Stephen Boyd <sboyd@kernel.org>
|
||||
|
||||
--- a/drivers/clk/clk.c
|
||||
+++ b/drivers/clk/clk.c
|
||||
@@ -3105,7 +3105,10 @@ static int clk_rate_get(void *data, u64
|
||||
@@ -3116,7 +3116,10 @@ static int clk_rate_get(void *data, u64
|
||||
{
|
||||
struct clk_core *core = data;
|
||||
|
||||
|
@ -10,7 +10,7 @@ Signed-off-by: Abhimanyu Vishwakarma <Abhimanyu.Vishwakarma@imgtec.com>
|
||||
|
||||
--- a/drivers/mtd/spi-nor/core.c
|
||||
+++ b/drivers/mtd/spi-nor/core.c
|
||||
@@ -3143,6 +3143,7 @@ int spi_nor_scan(struct spi_nor *nor, co
|
||||
@@ -3152,6 +3152,7 @@ int spi_nor_scan(struct spi_nor *nor, co
|
||||
struct device *dev = nor->dev;
|
||||
struct mtd_info *mtd = &nor->mtd;
|
||||
struct device_node *np = spi_nor_get_flash_node(nor);
|
||||
@ -18,7 +18,7 @@ Signed-off-by: Abhimanyu Vishwakarma <Abhimanyu.Vishwakarma@imgtec.com>
|
||||
int ret;
|
||||
int i;
|
||||
|
||||
@@ -3197,7 +3198,12 @@ int spi_nor_scan(struct spi_nor *nor, co
|
||||
@@ -3206,7 +3207,12 @@ int spi_nor_scan(struct spi_nor *nor, co
|
||||
if (ret)
|
||||
return ret;
|
||||
|
||||
|
@ -833,7 +833,7 @@ SVN-Revision: 35130
|
||||
*sum = csum_fold(csum_partial(diff, sizeof(diff),
|
||||
--- a/include/linux/etherdevice.h
|
||||
+++ b/include/linux/etherdevice.h
|
||||
@@ -499,7 +499,7 @@ static inline bool is_etherdev_addr(cons
|
||||
@@ -513,7 +513,7 @@ static inline bool is_etherdev_addr(cons
|
||||
* @b: Pointer to Ethernet header
|
||||
*
|
||||
* Compare two Ethernet headers, returns 0 if equal.
|
||||
@ -842,7 +842,7 @@ SVN-Revision: 35130
|
||||
* aligned OR the platform can handle unaligned access. This is the
|
||||
* case for all packets coming into netif_receive_skb or similar
|
||||
* entry points.
|
||||
@@ -522,11 +522,12 @@ static inline unsigned long compare_ethe
|
||||
@@ -536,11 +536,12 @@ static inline unsigned long compare_ethe
|
||||
fold |= *(unsigned long *)(a + 6) ^ *(unsigned long *)(b + 6);
|
||||
return fold;
|
||||
#else
|
||||
|
@ -829,7 +829,7 @@ SVN-Revision: 35130
|
||||
*sum = csum_fold(csum_partial(diff, sizeof(diff),
|
||||
--- a/include/linux/etherdevice.h
|
||||
+++ b/include/linux/etherdevice.h
|
||||
@@ -511,7 +511,7 @@ static inline bool is_etherdev_addr(cons
|
||||
@@ -525,7 +525,7 @@ static inline bool is_etherdev_addr(cons
|
||||
* @b: Pointer to Ethernet header
|
||||
*
|
||||
* Compare two Ethernet headers, returns 0 if equal.
|
||||
@ -838,7 +838,7 @@ SVN-Revision: 35130
|
||||
* aligned OR the platform can handle unaligned access. This is the
|
||||
* case for all packets coming into netif_receive_skb or similar
|
||||
* entry points.
|
||||
@@ -534,11 +534,12 @@ static inline unsigned long compare_ethe
|
||||
@@ -548,11 +548,12 @@ static inline unsigned long compare_ethe
|
||||
fold |= *(unsigned long *)(a + 6) ^ *(unsigned long *)(b + 6);
|
||||
return fold;
|
||||
#else
|
||||
|
@ -1,76 +0,0 @@
|
||||
From 327dabbd0111910a7d174b0b812d608d6b67bead Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= <rafal@milecki.pl>
|
||||
Date: Mon, 8 Aug 2022 23:05:25 +0200
|
||||
Subject: [PATCH] bgmac: fix *initial* chip reset to support BCM5358
|
||||
MIME-Version: 1.0
|
||||
Content-Type: text/plain; charset=UTF-8
|
||||
Content-Transfer-Encoding: 8bit
|
||||
|
||||
While bringing hardware up we should perform a full reset including the
|
||||
switch bit (BGMAC_BCMA_IOCTL_SW_RESET aka SICF_SWRST). It's what
|
||||
specification says and what reference driver does.
|
||||
|
||||
This seems to be critical for the BCM5358. Without this hardware doesn't
|
||||
get initialized properly and doesn't seem to transmit or receive any
|
||||
packets.
|
||||
|
||||
Originally bgmac was calling bgmac_chip_reset() before setting
|
||||
"has_robosw" property which resulted in expected behaviour. That has
|
||||
changed as a side effect of adding platform device support which
|
||||
regressed BCM5358 support.
|
||||
|
||||
Fixes: f6a95a24957a ("net: ethernet: bgmac: Add platform device support")
|
||||
Cc: Jon Mason <jdmason@kudzu.us>
|
||||
Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
|
||||
---
|
||||
drivers/net/ethernet/broadcom/bgmac.c | 8 ++++++--
|
||||
drivers/net/ethernet/broadcom/bgmac.h | 2 ++
|
||||
2 files changed, 8 insertions(+), 2 deletions(-)
|
||||
|
||||
--- a/drivers/net/ethernet/broadcom/bgmac.c
|
||||
+++ b/drivers/net/ethernet/broadcom/bgmac.c
|
||||
@@ -891,13 +891,13 @@ static void bgmac_chip_reset_idm_config(
|
||||
|
||||
if (iost & BGMAC_BCMA_IOST_ATTACHED) {
|
||||
flags = BGMAC_BCMA_IOCTL_SW_CLKEN;
|
||||
- if (!bgmac->has_robosw)
|
||||
+ if (bgmac->in_init || !bgmac->has_robosw)
|
||||
flags |= BGMAC_BCMA_IOCTL_SW_RESET;
|
||||
}
|
||||
bgmac_clk_enable(bgmac, flags);
|
||||
}
|
||||
|
||||
- if (iost & BGMAC_BCMA_IOST_ATTACHED && !bgmac->has_robosw)
|
||||
+ if (iost & BGMAC_BCMA_IOST_ATTACHED && (bgmac->in_init || !bgmac->has_robosw))
|
||||
bgmac_idm_write(bgmac, BCMA_IOCTL,
|
||||
bgmac_idm_read(bgmac, BCMA_IOCTL) &
|
||||
~BGMAC_BCMA_IOCTL_SW_RESET);
|
||||
@@ -1502,6 +1502,8 @@ int bgmac_enet_probe(struct bgmac *bgmac
|
||||
struct net_device *net_dev = bgmac->net_dev;
|
||||
int err;
|
||||
|
||||
+ bgmac->in_init = true;
|
||||
+
|
||||
bgmac_chip_intrs_off(bgmac);
|
||||
|
||||
net_dev->irq = bgmac->irq;
|
||||
@@ -1562,6 +1564,8 @@ int bgmac_enet_probe(struct bgmac *bgmac
|
||||
bgmac->b53_device = &bgmac_b53_dev;
|
||||
}
|
||||
|
||||
+ bgmac->in_init = false;
|
||||
+
|
||||
err = register_netdev(bgmac->net_dev);
|
||||
if (err) {
|
||||
dev_err(bgmac->dev, "Cannot register net device\n");
|
||||
--- a/drivers/net/ethernet/broadcom/bgmac.h
|
||||
+++ b/drivers/net/ethernet/broadcom/bgmac.h
|
||||
@@ -513,6 +513,8 @@ struct bgmac {
|
||||
int irq;
|
||||
u32 int_mask;
|
||||
|
||||
+ bool in_init;
|
||||
+
|
||||
/* Current MAC state */
|
||||
int mac_speed;
|
||||
int mac_duplex;
|
@ -393,7 +393,7 @@
|
||||
switch0: switch@10080000 {
|
||||
#address-cells = <1>;
|
||||
#size-cells = <0>;
|
||||
compatible = "brcm,bcm6328-switch";
|
||||
compatible = "brcm,bcm6318-switch";
|
||||
reg = <0x10080000 0x8000>;
|
||||
big-endian;
|
||||
|
||||
|
@ -514,7 +514,7 @@
|
||||
switch0: switch@10700000 {
|
||||
#address-cells = <1>;
|
||||
#size-cells = <0>;
|
||||
compatible = "brcm,bcm6328-switch";
|
||||
compatible = "brcm,bcm63268-switch";
|
||||
reg = <0x10700000 0x8000>;
|
||||
big-endian;
|
||||
|
||||
|
@ -508,7 +508,7 @@
|
||||
switch0: switch@10e00000 {
|
||||
#address-cells = <1>;
|
||||
#size-cells = <0>;
|
||||
compatible = "brcm,bcm6328-switch";
|
||||
compatible = "brcm,bcm6362-switch";
|
||||
reg = <0x10e00000 0x8000>;
|
||||
big-endian;
|
||||
|
||||
|
@ -523,7 +523,7 @@
|
||||
switch0: switch@10f00000 {
|
||||
#address-cells = <1>;
|
||||
#size-cells = <0>;
|
||||
compatible = "brcm,bcm6328-switch";
|
||||
compatible = "brcm,bcm6368-switch";
|
||||
reg = <0x10f00000 0x8000>;
|
||||
big-endian;
|
||||
|
||||
|
@ -15,7 +15,7 @@ Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
|
||||
|
||||
--- a/arch/mips/bmips/setup.c
|
||||
+++ b/arch/mips/bmips/setup.c
|
||||
@@ -31,11 +31,51 @@
|
||||
@@ -31,13 +31,52 @@
|
||||
|
||||
#define RELO_NORMAL_VEC BIT(18)
|
||||
|
||||
@ -55,7 +55,8 @@ Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
|
||||
+#define REG_BCM63268_MISC_SB ((void __iomem *)CKSEG1ADDR(0x10001814))
|
||||
+#define BCM63268_FCVO_SHIFT 21
|
||||
+#define BCM63268_FCVO_MASK (0xf << BCM63268_FCVO_SHIFT)
|
||||
+
|
||||
|
||||
extern bool bmips_rac_flush_disable;
|
||||
|
||||
static const unsigned long kbase = VMLINUX_LOAD_ADDRESS & 0xfff00000;
|
||||
|
||||
@ -67,7 +68,7 @@ Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
|
||||
struct bmips_quirk {
|
||||
const char *compatible;
|
||||
void (*quirk_fn)(void);
|
||||
@@ -134,17 +174,161 @@ const char *get_system_type(void)
|
||||
@@ -142,17 +181,161 @@ const char *get_system_type(void)
|
||||
return "Generic BMIPS kernel";
|
||||
}
|
||||
|
||||
|
@ -50,12 +50,12 @@ Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
|
||||
#define REG_BCM6368_DDR_PLLC ((void __iomem *)CKSEG1ADDR(0x100012a0))
|
||||
#define BCM6368_PLLC_P1_SHIFT 0
|
||||
#define BCM6368_PLLC_P1_MASK (0xf << BCM6368_PLLC_P1_SHIFT)
|
||||
@@ -67,7 +73,21 @@
|
||||
@@ -67,6 +73,21 @@
|
||||
#define REG_BCM63268_MISC_SB ((void __iomem *)CKSEG1ADDR(0x10001814))
|
||||
#define BCM63268_FCVO_SHIFT 21
|
||||
#define BCM63268_FCVO_MASK (0xf << BCM63268_FCVO_SHIFT)
|
||||
+#define BCM63268_MEMC_ADDR ((void __iomem *)CKSEG1ADDR(0x10003000))
|
||||
|
||||
+
|
||||
+#define SDRAM_CFG_REG 0x0
|
||||
+#define SDRAM_SPACE_SHIFT 4
|
||||
+#define SDRAM_SPACE_MASK (0xf << SDRAM_SPACE_SHIFT)
|
||||
@ -70,9 +70,9 @@ Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
|
||||
+
|
||||
+#define DDR_CSEND_REG 0x8
|
||||
|
||||
static const unsigned long kbase = VMLINUX_LOAD_ADDRESS & 0xfff00000;
|
||||
extern bool bmips_rac_flush_disable;
|
||||
|
||||
@@ -76,6 +96,11 @@ struct bmips_cpufreq {
|
||||
@@ -77,6 +98,11 @@ struct bmips_cpufreq {
|
||||
u32 (*cpu_freq)(void);
|
||||
};
|
||||
|
||||
@ -84,7 +84,7 @@ Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
|
||||
struct bmips_quirk {
|
||||
const char *compatible;
|
||||
void (*quirk_fn)(void);
|
||||
@@ -333,9 +358,90 @@ void __init plat_time_init(void)
|
||||
@@ -340,9 +366,90 @@ void __init plat_time_init(void)
|
||||
mips_hpt_frequency = freq;
|
||||
}
|
||||
|
||||
@ -175,7 +175,7 @@ Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
|
||||
const struct bmips_quirk *q;
|
||||
|
||||
set_io_port_base(0);
|
||||
@@ -353,6 +459,18 @@ void __init plat_mem_setup(void)
|
||||
@@ -360,6 +467,18 @@ void __init plat_mem_setup(void)
|
||||
|
||||
__dt_setup_arch(dtb);
|
||||
|
||||
|
@ -1,100 +0,0 @@
|
||||
From f48c93e4c4b5dbad1c0fbd623fd68f55f1667527 Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?=C3=81lvaro=20Fern=C3=A1ndez=20Rojas?= <noltari@gmail.com>
|
||||
Date: Fri, 10 Mar 2023 13:05:10 +0100
|
||||
Subject: [PATCH] mips: bmips: BCM6358: disable arch_sync_dma_for_cpu_all() for
|
||||
TP1
|
||||
MIME-Version: 1.0
|
||||
Content-Type: text/plain; charset=UTF-8
|
||||
Content-Transfer-Encoding: 8bit
|
||||
|
||||
arch_sync_dma_for_cpu_all() causes kernel panics on BCM6358 with EHCI/OHCI:
|
||||
[ 3.881739] usb 1-1: new high-speed USB device number 2 using ehci-platform
|
||||
[ 3.895011] Reserved instruction in kernel code[#1]:
|
||||
[ 3.900113] CPU: 0 PID: 1 Comm: init Not tainted 5.10.16 #0
|
||||
[ 3.905829] $ 0 : 00000000 10008700 00000000 77d94060
|
||||
[ 3.911238] $ 4 : 7fd1f088 00000000 81431cac 81431ca0
|
||||
[ 3.916641] $ 8 : 00000000 ffffefff 8075cd34 00000000
|
||||
[ 3.922043] $12 : 806f8d40 f3e812b7 00000000 000d9aaa
|
||||
[ 3.927446] $16 : 7fd1f068 7fd1f080 7ff559b8 81428470
|
||||
[ 3.932848] $20 : 00000000 00000000 55590000 77d70000
|
||||
[ 3.938251] $24 : 00000018 00000010
|
||||
[ 3.943655] $28 : 81430000 81431e60 81431f28 800157fc
|
||||
[ 3.949058] Hi : 00000000
|
||||
[ 3.952013] Lo : 00000000
|
||||
[ 3.955019] epc : 80015808 setup_sigcontext+0x54/0x24c
|
||||
[ 3.960464] ra : 800157fc setup_sigcontext+0x48/0x24c
|
||||
[ 3.965913] Status: 10008703 KERNEL EXL IE
|
||||
[ 3.970216] Cause : 00800028 (ExcCode 0a)
|
||||
[ 3.974340] PrId : 0002a010 (Broadcom BMIPS4350)
|
||||
[ 3.979170] Modules linked in: ohci_platform ohci_hcd fsl_mph_dr_of ehci_platform ehci_fsl ehci_hcd gpio_button_hotplug usbcore nls_base usb_common
|
||||
[ 3.992907] Process init (pid: 1, threadinfo=(ptrval), task=(ptrval), tls=77e22ec8)
|
||||
[ 4.000776] Stack : 81431ef4 7fd1f080 81431f28 81428470 7fd1f068 81431edc 7ff559b8 81428470
|
||||
[ 4.009467] 81431f28 7fd1f080 55590000 77d70000 77d5498c 80015c70 806f0000 8063ae74
|
||||
[ 4.018149] 08100002 81431f28 0000000a 08100002 81431f28 0000000a 77d6b418 00000003
|
||||
[ 4.026831] ffffffff 80016414 80080734 81431ecc 81431ecc 00000001 00000000 04000000
|
||||
[ 4.035512] 77d54874 00000000 00000000 00000000 00000000 00000012 00000002 00000000
|
||||
[ 4.044196] ...
|
||||
[ 4.046706] Call Trace:
|
||||
[ 4.049238] [<80015808>] setup_sigcontext+0x54/0x24c
|
||||
[ 4.054356] [<80015c70>] setup_frame+0xdc/0x124
|
||||
[ 4.059015] [<80016414>] do_notify_resume+0x1dc/0x288
|
||||
[ 4.064207] [<80011b50>] work_notifysig+0x10/0x18
|
||||
[ 4.069036]
|
||||
[ 4.070538] Code: 8fc300b4 00001025 26240008 <ac820000> ac830004 3c048063 0c0228aa 24846a00 26240010
|
||||
[ 4.080686]
|
||||
[ 4.082517] ---[ end trace 22a8edb41f5f983b ]---
|
||||
[ 4.087374] Kernel panic - not syncing: Fatal exception
|
||||
[ 4.092753] Rebooting in 1 seconds..
|
||||
|
||||
This only happens when booting from TP1 instead of TP0.
|
||||
|
||||
Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
|
||||
---
|
||||
arch/mips/bmips/dma.c | 5 +++++
|
||||
arch/mips/bmips/setup.c | 9 +++++++++
|
||||
2 files changed, 14 insertions(+)
|
||||
|
||||
--- a/arch/mips/bmips/dma.c
|
||||
+++ b/arch/mips/bmips/dma.c
|
||||
@@ -64,11 +64,16 @@ phys_addr_t dma_to_phys(struct device *d
|
||||
return dma_addr;
|
||||
}
|
||||
|
||||
+int bmips_dma_sync_disable = 0;
|
||||
+
|
||||
void arch_sync_dma_for_cpu_all(void)
|
||||
{
|
||||
void __iomem *cbr = BMIPS_GET_CBR();
|
||||
u32 cfg;
|
||||
|
||||
+ if (bmips_dma_sync_disable)
|
||||
+ return;
|
||||
+
|
||||
if (boot_cpu_type() != CPU_BMIPS3300 &&
|
||||
boot_cpu_type() != CPU_BMIPS4350 &&
|
||||
boot_cpu_type() != CPU_BMIPS4380)
|
||||
--- a/arch/mips/bmips/setup.c
|
||||
+++ b/arch/mips/bmips/setup.c
|
||||
@@ -89,6 +89,8 @@
|
||||
|
||||
#define DDR_CSEND_REG 0x8
|
||||
|
||||
+extern int bmips_dma_sync_disable;
|
||||
+
|
||||
static const unsigned long kbase = VMLINUX_LOAD_ADDRESS & 0xfff00000;
|
||||
|
||||
struct bmips_cpufreq {
|
||||
@@ -168,6 +170,13 @@ static void bcm6358_quirks(void)
|
||||
* disable SMP for now
|
||||
*/
|
||||
bmips_smp_enabled = 0;
|
||||
+
|
||||
+ /*
|
||||
+ * ARCH_HAS_SYNC_DMA_FOR_CPU_ALL causes kernel panics on BCM6358 when
|
||||
+ * booting from TP1
|
||||
+ */
|
||||
+ if (read_c0_brcm_cmt_local() & (1 << 31))
|
||||
+ bmips_dma_sync_disable = 1;
|
||||
}
|
||||
|
||||
static void bcm6368_quirks(void)
|
@ -1,38 +0,0 @@
|
||||
From b5c07b7bceed9287647697408423acd08f97db73 Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?=C3=81lvaro=20Fern=C3=A1ndez=20Rojas?= <noltari@gmail.com>
|
||||
Date: Thu, 16 Mar 2023 18:42:41 +0100
|
||||
Subject: [PATCH] irqchip/bcm-6345-l1: request memory region
|
||||
MIME-Version: 1.0
|
||||
Content-Type: text/plain; charset=UTF-8
|
||||
Content-Transfer-Encoding: 8bit
|
||||
|
||||
Request memory region in order to display it in /proc/iomem.
|
||||
Also stop printing the MMIO address since it just displays (ptrval).
|
||||
|
||||
Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
|
||||
---
|
||||
drivers/irqchip/irq-bcm6345-l1.c | 6 ++++--
|
||||
1 file changed, 4 insertions(+), 2 deletions(-)
|
||||
|
||||
--- a/drivers/irqchip/irq-bcm6345-l1.c
|
||||
+++ b/drivers/irqchip/irq-bcm6345-l1.c
|
||||
@@ -261,6 +261,9 @@ static int __init bcm6345_l1_init_one(st
|
||||
if (!cpu->map_base)
|
||||
return -ENOMEM;
|
||||
|
||||
+ if (!request_mem_region(res.start, sz, res.name))
|
||||
+ pr_err("Failed to request intc memory");
|
||||
+
|
||||
for (i = 0; i < n_words; i++) {
|
||||
cpu->enable_cache[i] = 0;
|
||||
__raw_writel(0, cpu->map_base + reg_enable(intc, i));
|
||||
@@ -339,8 +342,7 @@ static int __init bcm6345_l1_of_init(str
|
||||
for_each_cpu(idx, &intc->cpumask) {
|
||||
struct bcm6345_l1_cpu *cpu = intc->cpus[idx];
|
||||
|
||||
- pr_info(" CPU%u at MMIO 0x%p (irq = %d)\n", idx,
|
||||
- cpu->map_base, cpu->parent_irq);
|
||||
+ pr_info(" CPU%u (irq = %d)\n", idx, cpu->parent_irq);
|
||||
}
|
||||
|
||||
return 0;
|
@ -1,27 +0,0 @@
|
||||
From dadd7a1aa1eaebd5a03dee933c9051eae3724f00 Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?=C3=81lvaro=20Fern=C3=A1ndez=20Rojas?= <noltari@gmail.com>
|
||||
Date: Thu, 9 Mar 2023 19:18:07 +0100
|
||||
Subject: [PATCH] net: dsa: b53: mmap: fix device tree support
|
||||
MIME-Version: 1.0
|
||||
Content-Type: text/plain; charset=UTF-8
|
||||
Content-Transfer-Encoding: 8bit
|
||||
|
||||
CPU port should also be enabled in order to get a working switch.
|
||||
|
||||
Fixes: a5538a777b73 ("net: dsa: b53: mmap: Add device tree support")
|
||||
Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
|
||||
---
|
||||
drivers/net/dsa/b53/b53_mmap.c | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
--- a/drivers/net/dsa/b53/b53_mmap.c
|
||||
+++ b/drivers/net/dsa/b53/b53_mmap.c
|
||||
@@ -263,7 +263,7 @@ static int b53_mmap_probe_of(struct plat
|
||||
if (of_property_read_u32(of_port, "reg", ®))
|
||||
continue;
|
||||
|
||||
- if (reg < B53_CPU_PORT)
|
||||
+ if (reg < B53_N_PORTS)
|
||||
pdata->enabled_ports |= BIT(reg);
|
||||
}
|
||||
|
@ -1,72 +0,0 @@
|
||||
From 32cf73d8c6485b7b97aca7e377a68436d09b7022 Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?=C3=81lvaro=20Fern=C3=A1ndez=20Rojas?= <noltari@gmail.com>
|
||||
Date: Sun, 14 Mar 2021 20:03:44 +0100
|
||||
Subject: [PATCH] net: dsa: b53: add support for BCM63xx RGMIIs
|
||||
MIME-Version: 1.0
|
||||
Content-Type: text/plain; charset=UTF-8
|
||||
Content-Transfer-Encoding: 8bit
|
||||
|
||||
Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
|
||||
---
|
||||
drivers/net/dsa/b53/b53_common.c | 37 ++++++++++++++++++++++++++++++++
|
||||
1 file changed, 37 insertions(+)
|
||||
|
||||
--- a/drivers/net/dsa/b53/b53_common.c
|
||||
+++ b/drivers/net/dsa/b53/b53_common.c
|
||||
@@ -1209,6 +1209,36 @@ static void b53_force_port_config(struct
|
||||
b53_write8(dev, B53_CTRL_PAGE, off, reg);
|
||||
}
|
||||
|
||||
+static void b53_adjust_63xx_rgmii(struct dsa_switch *ds, int port,
|
||||
+ phy_interface_t interface)
|
||||
+{
|
||||
+ struct b53_device *dev = ds->priv;
|
||||
+ u8 rgmii_ctrl = 0, off;
|
||||
+
|
||||
+ if (port == 8)
|
||||
+ off = B53_RGMII_CTRL_IMP;
|
||||
+ else
|
||||
+ off = B53_RGMII_CTRL_P(port);
|
||||
+
|
||||
+ b53_read8(dev, B53_CTRL_PAGE, off, &rgmii_ctrl);
|
||||
+
|
||||
+ rgmii_ctrl &= ~(RGMII_CTRL_DLL_RXC | RGMII_CTRL_DLL_TXC);
|
||||
+ if (interface == PHY_INTERFACE_MODE_RGMII_ID)
|
||||
+ rgmii_ctrl |= (RGMII_CTRL_DLL_RXC | RGMII_CTRL_DLL_TXC);
|
||||
+ else if (interface == PHY_INTERFACE_MODE_RGMII_RXID)
|
||||
+ rgmii_ctrl |= RGMII_CTRL_DLL_RXC;
|
||||
+ else if (interface == PHY_INTERFACE_MODE_RGMII_TXID)
|
||||
+ rgmii_ctrl |= RGMII_CTRL_DLL_TXC;
|
||||
+
|
||||
+ if (port != B53_CPU_PORT)
|
||||
+ rgmii_ctrl |= RGMII_CTRL_ENABLE_GMII;
|
||||
+
|
||||
+ b53_write8(dev, B53_CTRL_PAGE, off, rgmii_ctrl);
|
||||
+
|
||||
+ dev_info(ds->dev, "Configured port %d for %s\n", port,
|
||||
+ phy_modes(interface));
|
||||
+}
|
||||
+
|
||||
static void b53_adjust_link(struct dsa_switch *ds, int port,
|
||||
struct phy_device *phydev)
|
||||
{
|
||||
@@ -1235,6 +1265,9 @@ static void b53_adjust_link(struct dsa_s
|
||||
tx_pause, rx_pause);
|
||||
b53_force_link(dev, port, phydev->link);
|
||||
|
||||
+ if (is63xx(dev))
|
||||
+ b53_adjust_63xx_rgmii(ds, port, phydev->interface);
|
||||
+
|
||||
if (is531x5(dev) && phy_interface_is_rgmii(phydev)) {
|
||||
if (port == dev->imp_port)
|
||||
off = B53_RGMII_CTRL_IMP;
|
||||
@@ -1419,6 +1452,9 @@ void b53_phylink_mac_link_up(struct dsa_
|
||||
{
|
||||
struct b53_device *dev = ds->priv;
|
||||
|
||||
+ if (is63xx(dev) && port >= 4)
|
||||
+ b53_adjust_63xx_rgmii(ds, port, interface);
|
||||
+
|
||||
if (mode == MLO_AN_PHY)
|
||||
return;
|
||||
|
@ -37,7 +37,7 @@ Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
|
||||
|
||||
--- a/Makefile
|
||||
+++ b/Makefile
|
||||
@@ -416,7 +416,8 @@ HOSTCXX = g++
|
||||
@@ -423,7 +423,8 @@ HOSTCXX = g++
|
||||
endif
|
||||
|
||||
export KBUILD_USERCFLAGS := -Wall -Wmissing-prototypes -Wstrict-prototypes \
|
||||
|
@ -49,7 +49,7 @@ Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
|
||||
|
||||
--- a/Makefile
|
||||
+++ b/Makefile
|
||||
@@ -500,7 +500,7 @@ KBUILD_CFLAGS := -Wall -Wundef -Werror
|
||||
@@ -507,7 +507,7 @@ KBUILD_CFLAGS := -Wall -Wundef -Werror
|
||||
-fno-strict-aliasing -fno-common -fshort-wchar -fno-PIE \
|
||||
-Werror=implicit-function-declaration -Werror=implicit-int \
|
||||
-Werror=return-type -Wno-format-security \
|
||||
|
@ -32,7 +32,7 @@ Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
|
||||
|
||||
--- a/Makefile
|
||||
+++ b/Makefile
|
||||
@@ -416,7 +416,7 @@ HOSTCXX = g++
|
||||
@@ -423,7 +423,7 @@ HOSTCXX = g++
|
||||
endif
|
||||
|
||||
export KBUILD_USERCFLAGS := -Wall -Wmissing-prototypes -Wstrict-prototypes \
|
||||
|
@ -10,7 +10,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
|
||||
|
||||
--- a/Makefile
|
||||
+++ b/Makefile
|
||||
@@ -510,7 +510,7 @@ KBUILD_LDFLAGS_MODULE :=
|
||||
@@ -517,7 +517,7 @@ KBUILD_LDFLAGS_MODULE :=
|
||||
KBUILD_LDFLAGS :=
|
||||
CLANG_FLAGS :=
|
||||
|
||||
|
@ -18,7 +18,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
|
||||
|
||||
--- a/net/core/dev.c
|
||||
+++ b/net/core/dev.c
|
||||
@@ -6810,15 +6810,10 @@ void __netif_napi_del(struct napi_struct
|
||||
@@ -6813,15 +6813,10 @@ void __netif_napi_del(struct napi_struct
|
||||
}
|
||||
EXPORT_SYMBOL(__netif_napi_del);
|
||||
|
||||
@ -35,7 +35,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
|
||||
weight = n->weight;
|
||||
|
||||
/* This NAPI_STATE_SCHED test is for avoiding a race
|
||||
@@ -6838,7 +6833,7 @@ static int napi_poll(struct napi_struct
|
||||
@@ -6841,7 +6836,7 @@ static int napi_poll(struct napi_struct
|
||||
n->poll, work, weight);
|
||||
|
||||
if (likely(work < weight))
|
||||
@ -44,7 +44,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
|
||||
|
||||
/* Drivers must not modify the NAPI state if they
|
||||
* consume the entire weight. In such cases this code
|
||||
@@ -6847,7 +6842,7 @@ static int napi_poll(struct napi_struct
|
||||
@@ -6850,7 +6845,7 @@ static int napi_poll(struct napi_struct
|
||||
*/
|
||||
if (unlikely(napi_disable_pending(n))) {
|
||||
napi_complete(n);
|
||||
@ -53,7 +53,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
|
||||
}
|
||||
|
||||
if (n->gro_bitmask) {
|
||||
@@ -6865,12 +6860,29 @@ static int napi_poll(struct napi_struct
|
||||
@@ -6868,12 +6863,29 @@ static int napi_poll(struct napi_struct
|
||||
if (unlikely(!list_empty(&n->poll_list))) {
|
||||
pr_warn_once("%s: Budget exhausted after napi rescheduled\n",
|
||||
n->dev ? n->dev->name : "backlog");
|
||||
|
@ -131,7 +131,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
|
||||
static int __dev_open(struct net_device *dev, struct netlink_ext_ack *extack)
|
||||
{
|
||||
const struct net_device_ops *ops = dev->netdev_ops;
|
||||
@@ -4272,6 +4294,21 @@ int gro_normal_batch __read_mostly = 8;
|
||||
@@ -4274,6 +4296,21 @@ int gro_normal_batch __read_mostly = 8;
|
||||
static inline void ____napi_schedule(struct softnet_data *sd,
|
||||
struct napi_struct *napi)
|
||||
{
|
||||
@ -153,7 +153,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
|
||||
list_add_tail(&napi->poll_list, &sd->poll_list);
|
||||
__raise_softirq_irqoff(NET_RX_SOFTIRQ);
|
||||
}
|
||||
@@ -6763,6 +6800,12 @@ void netif_napi_add(struct net_device *d
|
||||
@@ -6766,6 +6803,12 @@ void netif_napi_add(struct net_device *d
|
||||
set_bit(NAPI_STATE_NPSVC, &napi->state);
|
||||
list_add_rcu(&napi->dev_list, &dev->napi_list);
|
||||
napi_hash_add(napi);
|
||||
@ -166,7 +166,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
|
||||
}
|
||||
EXPORT_SYMBOL(netif_napi_add);
|
||||
|
||||
@@ -6779,9 +6822,28 @@ void napi_disable(struct napi_struct *n)
|
||||
@@ -6782,9 +6825,28 @@ void napi_disable(struct napi_struct *n)
|
||||
hrtimer_cancel(&n->timer);
|
||||
|
||||
clear_bit(NAPI_STATE_DISABLE, &n->state);
|
||||
@ -195,7 +195,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
|
||||
static void flush_gro_hash(struct napi_struct *napi)
|
||||
{
|
||||
int i;
|
||||
@@ -6807,6 +6869,11 @@ void __netif_napi_del(struct napi_struct
|
||||
@@ -6810,6 +6872,11 @@ void __netif_napi_del(struct napi_struct
|
||||
|
||||
flush_gro_hash(napi);
|
||||
napi->gro_bitmask = 0;
|
||||
@ -207,7 +207,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
|
||||
}
|
||||
EXPORT_SYMBOL(__netif_napi_del);
|
||||
|
||||
@@ -6888,6 +6955,51 @@ static int napi_poll(struct napi_struct
|
||||
@@ -6891,6 +6958,51 @@ static int napi_poll(struct napi_struct
|
||||
return work;
|
||||
}
|
||||
|
||||
|
@ -57,7 +57,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
|
||||
* @n: NAPI context
|
||||
--- a/net/core/dev.c
|
||||
+++ b/net/core/dev.c
|
||||
@@ -4298,8 +4298,9 @@ static inline void ____napi_schedule(str
|
||||
@@ -4300,8 +4300,9 @@ static inline void ____napi_schedule(str
|
||||
|
||||
if (test_bit(NAPI_STATE_THREADED, &napi->state)) {
|
||||
/* Paired with smp_mb__before_atomic() in
|
||||
@ -69,7 +69,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
|
||||
* wake_up_process() when it's not NULL.
|
||||
*/
|
||||
thread = READ_ONCE(napi->thread);
|
||||
@@ -6773,6 +6774,49 @@ static void init_gro_hash(struct napi_st
|
||||
@@ -6776,6 +6777,49 @@ static void init_gro_hash(struct napi_st
|
||||
napi->gro_bitmask = 0;
|
||||
}
|
||||
|
||||
|
@ -45,7 +45,7 @@ Cc: Hannes Frederic Sowa <hannes@stressinduktion.org>
|
||||
enum gro_result {
|
||||
--- a/net/core/dev.c
|
||||
+++ b/net/core/dev.c
|
||||
@@ -4305,6 +4305,8 @@ static inline void ____napi_schedule(str
|
||||
@@ -4307,6 +4307,8 @@ static inline void ____napi_schedule(str
|
||||
*/
|
||||
thread = READ_ONCE(napi->thread);
|
||||
if (thread) {
|
||||
@ -54,7 +54,7 @@ Cc: Hannes Frederic Sowa <hannes@stressinduktion.org>
|
||||
wake_up_process(thread);
|
||||
return;
|
||||
}
|
||||
@@ -6565,7 +6567,8 @@ bool napi_complete_done(struct napi_stru
|
||||
@@ -6568,7 +6570,8 @@ bool napi_complete_done(struct napi_stru
|
||||
|
||||
WARN_ON_ONCE(!(val & NAPIF_STATE_SCHED));
|
||||
|
||||
@ -64,7 +64,7 @@ Cc: Hannes Frederic Sowa <hannes@stressinduktion.org>
|
||||
|
||||
/* If STATE_MISSED was set, leave STATE_SCHED set,
|
||||
* because we will call napi->poll() one more time.
|
||||
@@ -7001,16 +7004,25 @@ static int napi_poll(struct napi_struct
|
||||
@@ -7004,16 +7007,25 @@ static int napi_poll(struct napi_struct
|
||||
|
||||
static int napi_thread_wait(struct napi_struct *napi)
|
||||
{
|
||||
|
@ -34,7 +34,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
|
||||
|
||||
--- a/net/core/dev.c
|
||||
+++ b/net/core/dev.c
|
||||
@@ -7008,7 +7008,7 @@ static int napi_thread_wait(struct napi_
|
||||
@@ -7011,7 +7011,7 @@ static int napi_thread_wait(struct napi_
|
||||
|
||||
set_current_state(TASK_INTERRUPTIBLE);
|
||||
|
||||
@ -43,7 +43,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
|
||||
/* Testing SCHED_THREADED bit here to make sure the current
|
||||
* kthread owns this napi and could poll on this napi.
|
||||
* Testing SCHED bit is not enough because SCHED bit might be
|
||||
@@ -7026,6 +7026,7 @@ static int napi_thread_wait(struct napi_
|
||||
@@ -7029,6 +7029,7 @@ static int napi_thread_wait(struct napi_
|
||||
set_current_state(TASK_INTERRUPTIBLE);
|
||||
}
|
||||
__set_current_state(TASK_RUNNING);
|
||||
|
@ -14,7 +14,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
|
||||
|
||||
--- a/net/core/dev.c
|
||||
+++ b/net/core/dev.c
|
||||
@@ -6819,6 +6819,7 @@ int dev_set_threaded(struct net_device *
|
||||
@@ -6822,6 +6822,7 @@ int dev_set_threaded(struct net_device *
|
||||
|
||||
return err;
|
||||
}
|
||||
|
@ -19,7 +19,7 @@ Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
|
||||
|
||||
#include "mtk_eth_soc.h"
|
||||
|
||||
@@ -1296,13 +1297,12 @@ static int mtk_poll_rx(struct napi_struc
|
||||
@@ -1297,13 +1298,12 @@ static int mtk_poll_rx(struct napi_struc
|
||||
break;
|
||||
|
||||
/* find out which mac the packet come from. values start at 1 */
|
||||
@ -38,7 +38,7 @@ Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
|
||||
|
||||
if (unlikely(mac < 0 || mac >= MTK_MAC_COUNT ||
|
||||
!eth->netdev[mac]))
|
||||
@@ -2274,6 +2274,9 @@ static void mtk_gdm_config(struct mtk_et
|
||||
@@ -2275,6 +2275,9 @@ static void mtk_gdm_config(struct mtk_et
|
||||
|
||||
val |= config;
|
||||
|
||||
|
@ -27,7 +27,7 @@ Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
|
||||
obj-$(CONFIG_NET_MEDIATEK_STAR_EMAC) += mtk_star_emac.o
|
||||
--- a/drivers/net/ethernet/mediatek/mtk_eth_soc.c
|
||||
+++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c
|
||||
@@ -2299,7 +2299,10 @@ static int mtk_open(struct net_device *d
|
||||
@@ -2300,7 +2300,10 @@ static int mtk_open(struct net_device *d
|
||||
|
||||
/* we run 2 netdevs on the same dma ring so we only bring it up once */
|
||||
if (!refcount_read(ð->dma_refcnt)) {
|
||||
@ -39,7 +39,7 @@ Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
|
||||
|
||||
if (err)
|
||||
if (err) {
|
||||
@@ -2307,7 +2310,10 @@ static int mtk_open(struct net_device *d
|
||||
@@ -2308,7 +2311,10 @@ static int mtk_open(struct net_device *d
|
||||
return err;
|
||||
}
|
||||
|
||||
@ -51,7 +51,7 @@ Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
|
||||
|
||||
napi_enable(ð->tx_napi);
|
||||
napi_enable(ð->rx_napi);
|
||||
@@ -2374,6 +2380,9 @@ static int mtk_stop(struct net_device *d
|
||||
@@ -2375,6 +2381,9 @@ static int mtk_stop(struct net_device *d
|
||||
|
||||
mtk_dma_free(eth);
|
||||
|
||||
@ -61,7 +61,7 @@ Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -3102,6 +3111,13 @@ static int mtk_probe(struct platform_dev
|
||||
@@ -3103,6 +3112,13 @@ static int mtk_probe(struct platform_dev
|
||||
goto err_free_dev;
|
||||
}
|
||||
|
||||
@ -75,7 +75,7 @@ Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
|
||||
for (i = 0; i < MTK_MAX_DEVS; i++) {
|
||||
if (!eth->netdev[i])
|
||||
continue;
|
||||
@@ -3176,6 +3192,7 @@ static const struct mtk_soc_data mt7621_
|
||||
@@ -3177,6 +3193,7 @@ static const struct mtk_soc_data mt7621_
|
||||
.hw_features = MTK_HW_FEATURES,
|
||||
.required_clks = MT7621_CLKS_BITMAP,
|
||||
.required_pctl = false,
|
||||
@ -83,7 +83,7 @@ Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
|
||||
};
|
||||
|
||||
static const struct mtk_soc_data mt7622_data = {
|
||||
@@ -3184,6 +3201,7 @@ static const struct mtk_soc_data mt7622_
|
||||
@@ -3185,6 +3202,7 @@ static const struct mtk_soc_data mt7622_
|
||||
.hw_features = MTK_HW_FEATURES,
|
||||
.required_clks = MT7622_CLKS_BITMAP,
|
||||
.required_pctl = false,
|
||||
@ -122,7 +122,7 @@ Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
|
||||
#define RX_DMA_L4_VALID BIT(24)
|
||||
#define RX_DMA_L4_VALID_PDMA BIT(30) /* when PDMA is used */
|
||||
#define RX_DMA_FPORT_SHIFT 19
|
||||
@@ -819,6 +827,7 @@ struct mtk_soc_data {
|
||||
@@ -820,6 +828,7 @@ struct mtk_soc_data {
|
||||
u32 caps;
|
||||
u32 required_clks;
|
||||
bool required_pctl;
|
||||
@ -130,7 +130,7 @@ Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
|
||||
netdev_features_t hw_features;
|
||||
};
|
||||
|
||||
@@ -918,6 +927,8 @@ struct mtk_eth {
|
||||
@@ -919,6 +928,8 @@ struct mtk_eth {
|
||||
u32 tx_int_status_reg;
|
||||
u32 rx_dma_l4_valid;
|
||||
int ip_align;
|
||||
|
@ -21,7 +21,7 @@ Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
|
||||
obj-$(CONFIG_NET_MEDIATEK_STAR_EMAC) += mtk_star_emac.o
|
||||
--- a/drivers/net/ethernet/mediatek/mtk_eth_soc.c
|
||||
+++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c
|
||||
@@ -2858,6 +2858,7 @@ static const struct net_device_ops mtk_n
|
||||
@@ -2859,6 +2859,7 @@ static const struct net_device_ops mtk_n
|
||||
#ifdef CONFIG_NET_POLL_CONTROLLER
|
||||
.ndo_poll_controller = mtk_poll_controller,
|
||||
#endif
|
||||
@ -29,7 +29,7 @@ Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
|
||||
};
|
||||
|
||||
static int mtk_add_mac(struct mtk_eth *eth, struct device_node *np)
|
||||
@@ -3116,6 +3117,10 @@ static int mtk_probe(struct platform_dev
|
||||
@@ -3117,6 +3118,10 @@ static int mtk_probe(struct platform_dev
|
||||
eth->base + MTK_ETH_PPE_BASE, 2);
|
||||
if (err)
|
||||
goto err_free_dev;
|
||||
@ -60,7 +60,7 @@ Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
|
||||
#define MTK_HW_FEATURES_MT7628 (NETIF_F_SG | NETIF_F_RXCSUM)
|
||||
#define NEXT_DESP_IDX(X, Y) (((X) + 1) & ((Y) - 1))
|
||||
|
||||
@@ -929,6 +931,7 @@ struct mtk_eth {
|
||||
@@ -930,6 +932,7 @@ struct mtk_eth {
|
||||
int ip_align;
|
||||
|
||||
struct mtk_ppe ppe;
|
||||
@ -68,7 +68,7 @@ Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
|
||||
};
|
||||
|
||||
/* struct mtk_mac - the structure that holds the info about the MACs of the
|
||||
@@ -973,4 +976,9 @@ int mtk_gmac_sgmii_path_setup(struct mtk
|
||||
@@ -974,4 +977,9 @@ int mtk_gmac_sgmii_path_setup(struct mtk
|
||||
int mtk_gmac_gephy_path_setup(struct mtk_eth *eth, int mac_id);
|
||||
int mtk_gmac_rgmii_path_setup(struct mtk_eth *eth, int mac_id);
|
||||
|
||||
|
@ -17,7 +17,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
|
||||
|
||||
--- a/drivers/net/ethernet/mediatek/mtk_eth_soc.c
|
||||
+++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c
|
||||
@@ -1333,6 +1333,9 @@ static int mtk_poll_rx(struct napi_struc
|
||||
@@ -1334,6 +1334,9 @@ static int mtk_poll_rx(struct napi_struc
|
||||
goto release_desc;
|
||||
}
|
||||
|
||||
@ -27,7 +27,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
|
||||
/* receive data */
|
||||
skb = build_skb(data, ring->frag_size);
|
||||
if (unlikely(!skb)) {
|
||||
@@ -1342,8 +1345,6 @@ static int mtk_poll_rx(struct napi_struc
|
||||
@@ -1343,8 +1346,6 @@ static int mtk_poll_rx(struct napi_struc
|
||||
}
|
||||
skb_reserve(skb, NET_SKB_PAD + NET_IP_ALIGN);
|
||||
|
||||
|
@ -16,7 +16,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
|
||||
|
||||
--- a/drivers/net/ethernet/mediatek/mtk_eth_soc.c
|
||||
+++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c
|
||||
@@ -1339,9 +1339,9 @@ static int mtk_poll_rx(struct napi_struc
|
||||
@@ -1340,9 +1340,9 @@ static int mtk_poll_rx(struct napi_struc
|
||||
/* receive data */
|
||||
skb = build_skb(data, ring->frag_size);
|
||||
if (unlikely(!skb)) {
|
||||
@ -28,7 +28,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
|
||||
}
|
||||
skb_reserve(skb, NET_SKB_PAD + NET_IP_ALIGN);
|
||||
|
||||
@@ -1361,6 +1361,7 @@ static int mtk_poll_rx(struct napi_struc
|
||||
@@ -1362,6 +1362,7 @@ static int mtk_poll_rx(struct napi_struc
|
||||
skb_record_rx_queue(skb, 0);
|
||||
napi_gro_receive(napi, skb);
|
||||
|
||||
|
@ -14,7 +14,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
|
||||
|
||||
--- a/drivers/net/ethernet/mediatek/mtk_eth_soc.c
|
||||
+++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c
|
||||
@@ -890,7 +890,8 @@ static int txd_to_idx(struct mtk_tx_ring
|
||||
@@ -891,7 +891,8 @@ static int txd_to_idx(struct mtk_tx_ring
|
||||
return ((void *)dma - (void *)ring->dma) / sizeof(*dma);
|
||||
}
|
||||
|
||||
@ -24,7 +24,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
|
||||
{
|
||||
if (MTK_HAS_CAPS(eth->soc->caps, MTK_QDMA)) {
|
||||
if (tx_buf->flags & MTK_TX_FLAGS_SINGLE0) {
|
||||
@@ -922,8 +923,12 @@ static void mtk_tx_unmap(struct mtk_eth
|
||||
@@ -923,8 +924,12 @@ static void mtk_tx_unmap(struct mtk_eth
|
||||
|
||||
tx_buf->flags = 0;
|
||||
if (tx_buf->skb &&
|
||||
@ -39,7 +39,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
|
||||
tx_buf->skb = NULL;
|
||||
}
|
||||
|
||||
@@ -1101,7 +1106,7 @@ err_dma:
|
||||
@@ -1102,7 +1107,7 @@ err_dma:
|
||||
tx_buf = mtk_desc_to_tx_buf(ring, itxd);
|
||||
|
||||
/* unmap dma */
|
||||
@ -48,7 +48,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
|
||||
|
||||
itxd->txd3 = TX_DMA_LS0 | TX_DMA_OWNER_CPU;
|
||||
if (!MTK_HAS_CAPS(eth->soc->caps, MTK_QDMA))
|
||||
@@ -1423,7 +1428,7 @@ static int mtk_poll_tx_qdma(struct mtk_e
|
||||
@@ -1424,7 +1429,7 @@ static int mtk_poll_tx_qdma(struct mtk_e
|
||||
done[mac]++;
|
||||
budget--;
|
||||
}
|
||||
@ -57,7 +57,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
|
||||
|
||||
ring->last_free = desc;
|
||||
atomic_inc(&ring->free_count);
|
||||
@@ -1460,7 +1465,7 @@ static int mtk_poll_tx_pdma(struct mtk_e
|
||||
@@ -1461,7 +1466,7 @@ static int mtk_poll_tx_pdma(struct mtk_e
|
||||
budget--;
|
||||
}
|
||||
|
||||
@ -66,7 +66,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
|
||||
|
||||
desc = &ring->dma[cpu];
|
||||
ring->last_free = desc;
|
||||
@@ -1662,7 +1667,7 @@ static void mtk_tx_clean(struct mtk_eth
|
||||
@@ -1663,7 +1668,7 @@ static void mtk_tx_clean(struct mtk_eth
|
||||
|
||||
if (ring->buf) {
|
||||
for (i = 0; i < MTK_DMA_SIZE; i++)
|
||||
|
@ -16,7 +16,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
|
||||
|
||||
--- a/drivers/net/ethernet/mediatek/mtk_eth_soc.c
|
||||
+++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c
|
||||
@@ -1163,17 +1163,6 @@ static void mtk_wake_queue(struct mtk_et
|
||||
@@ -1164,17 +1164,6 @@ static void mtk_wake_queue(struct mtk_et
|
||||
}
|
||||
}
|
||||
|
||||
@ -34,7 +34,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
|
||||
static netdev_tx_t mtk_start_xmit(struct sk_buff *skb, struct net_device *dev)
|
||||
{
|
||||
struct mtk_mac *mac = netdev_priv(dev);
|
||||
@@ -1194,7 +1183,7 @@ static netdev_tx_t mtk_start_xmit(struct
|
||||
@@ -1195,7 +1184,7 @@ static netdev_tx_t mtk_start_xmit(struct
|
||||
|
||||
tx_num = mtk_cal_txd_req(skb);
|
||||
if (unlikely(atomic_read(&ring->free_count) <= tx_num)) {
|
||||
@ -43,7 +43,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
|
||||
netif_err(eth, tx_queued, dev,
|
||||
"Tx Ring full when queue awake!\n");
|
||||
spin_unlock(ð->page_lock);
|
||||
@@ -1220,7 +1209,7 @@ static netdev_tx_t mtk_start_xmit(struct
|
||||
@@ -1221,7 +1210,7 @@ static netdev_tx_t mtk_start_xmit(struct
|
||||
goto drop;
|
||||
|
||||
if (unlikely(atomic_read(&ring->free_count) <= ring->thresh))
|
||||
|
@ -15,7 +15,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
|
||||
|
||||
--- a/drivers/net/ethernet/mediatek/mtk_eth_soc.c
|
||||
+++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c
|
||||
@@ -2234,7 +2234,7 @@ static int mtk_start_dma(struct mtk_eth
|
||||
@@ -2235,7 +2235,7 @@ static int mtk_start_dma(struct mtk_eth
|
||||
if (MTK_HAS_CAPS(eth->soc->caps, MTK_QDMA)) {
|
||||
mtk_w32(eth,
|
||||
MTK_TX_WB_DDONE | MTK_TX_DMA_EN |
|
||||
|
@ -28,7 +28,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
|
||||
MediaTek SoC family.
|
||||
--- a/drivers/net/ethernet/mediatek/mtk_eth_soc.c
|
||||
+++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c
|
||||
@@ -1265,12 +1265,13 @@ static void mtk_update_rx_cpu_idx(struct
|
||||
@@ -1266,12 +1266,13 @@ static void mtk_update_rx_cpu_idx(struct
|
||||
static int mtk_poll_rx(struct napi_struct *napi, int budget,
|
||||
struct mtk_eth *eth)
|
||||
{
|
||||
@ -43,7 +43,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
|
||||
|
||||
while (done < budget) {
|
||||
struct net_device *netdev;
|
||||
@@ -1347,6 +1348,7 @@ static int mtk_poll_rx(struct napi_struc
|
||||
@@ -1348,6 +1349,7 @@ static int mtk_poll_rx(struct napi_struc
|
||||
else
|
||||
skb_checksum_none_assert(skb);
|
||||
skb->protocol = eth_type_trans(skb, netdev);
|
||||
@ -51,7 +51,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
|
||||
|
||||
if (netdev->features & NETIF_F_HW_VLAN_CTAG_RX &&
|
||||
(trxd.rxd2 & RX_DMA_VTAG))
|
||||
@@ -1379,6 +1381,12 @@ rx_done:
|
||||
@@ -1380,6 +1382,12 @@ rx_done:
|
||||
mtk_update_rx_cpu_idx(eth);
|
||||
}
|
||||
|
||||
@ -64,7 +64,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
|
||||
return done;
|
||||
}
|
||||
|
||||
@@ -1471,6 +1479,7 @@ static int mtk_poll_tx_pdma(struct mtk_e
|
||||
@@ -1472,6 +1480,7 @@ static int mtk_poll_tx_pdma(struct mtk_e
|
||||
static int mtk_poll_tx(struct mtk_eth *eth, int budget)
|
||||
{
|
||||
struct mtk_tx_ring *ring = ð->tx_ring;
|
||||
@ -72,7 +72,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
|
||||
unsigned int done[MTK_MAX_DEVS];
|
||||
unsigned int bytes[MTK_MAX_DEVS];
|
||||
int total = 0, i;
|
||||
@@ -1488,8 +1497,14 @@ static int mtk_poll_tx(struct mtk_eth *e
|
||||
@@ -1489,8 +1498,14 @@ static int mtk_poll_tx(struct mtk_eth *e
|
||||
continue;
|
||||
netdev_completed_queue(eth->netdev[i], done[i], bytes[i]);
|
||||
total += done[i];
|
||||
@ -87,7 +87,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
|
||||
if (mtk_queue_stopped(eth) &&
|
||||
(atomic_read(&ring->free_count) > ring->thresh))
|
||||
mtk_wake_queue(eth);
|
||||
@@ -2170,6 +2185,7 @@ static irqreturn_t mtk_handle_irq_rx(int
|
||||
@@ -2171,6 +2186,7 @@ static irqreturn_t mtk_handle_irq_rx(int
|
||||
{
|
||||
struct mtk_eth *eth = _eth;
|
||||
|
||||
@ -95,7 +95,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
|
||||
if (likely(napi_schedule_prep(ð->rx_napi))) {
|
||||
__napi_schedule(ð->rx_napi);
|
||||
mtk_rx_irq_disable(eth, MTK_RX_DONE_INT);
|
||||
@@ -2182,6 +2198,7 @@ static irqreturn_t mtk_handle_irq_tx(int
|
||||
@@ -2183,6 +2199,7 @@ static irqreturn_t mtk_handle_irq_tx(int
|
||||
{
|
||||
struct mtk_eth *eth = _eth;
|
||||
|
||||
@ -103,7 +103,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
|
||||
if (likely(napi_schedule_prep(ð->tx_napi))) {
|
||||
__napi_schedule(ð->tx_napi);
|
||||
mtk_tx_irq_disable(eth, MTK_TX_DONE_INT);
|
||||
@@ -2370,6 +2387,9 @@ static int mtk_stop(struct net_device *d
|
||||
@@ -2371,6 +2388,9 @@ static int mtk_stop(struct net_device *d
|
||||
napi_disable(ð->tx_napi);
|
||||
napi_disable(ð->rx_napi);
|
||||
|
||||
@ -113,7 +113,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
|
||||
if (MTK_HAS_CAPS(eth->soc->caps, MTK_QDMA))
|
||||
mtk_stop_dma(eth, MTK_QDMA_GLO_CFG);
|
||||
mtk_stop_dma(eth, MTK_PDMA_GLO_CFG);
|
||||
@@ -2422,6 +2442,64 @@ err_disable_clks:
|
||||
@@ -2423,6 +2443,64 @@ err_disable_clks:
|
||||
return ret;
|
||||
}
|
||||
|
||||
@ -178,7 +178,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
|
||||
static int mtk_hw_init(struct mtk_eth *eth)
|
||||
{
|
||||
int i, val, ret;
|
||||
@@ -2443,9 +2521,6 @@ static int mtk_hw_init(struct mtk_eth *e
|
||||
@@ -2444,9 +2522,6 @@ static int mtk_hw_init(struct mtk_eth *e
|
||||
goto err_disable_pm;
|
||||
}
|
||||
|
||||
@ -188,7 +188,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
|
||||
/* disable delay and normal interrupt */
|
||||
mtk_tx_irq_disable(eth, ~0);
|
||||
mtk_rx_irq_disable(eth, ~0);
|
||||
@@ -2484,11 +2559,11 @@ static int mtk_hw_init(struct mtk_eth *e
|
||||
@@ -2485,11 +2560,11 @@ static int mtk_hw_init(struct mtk_eth *e
|
||||
/* Enable RX VLan Offloading */
|
||||
mtk_w32(eth, 1, MTK_CDMP_EG_CTRL);
|
||||
|
||||
@ -203,7 +203,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
|
||||
mtk_tx_irq_disable(eth, ~0);
|
||||
mtk_rx_irq_disable(eth, ~0);
|
||||
|
||||
@@ -2993,6 +3068,13 @@ static int mtk_probe(struct platform_dev
|
||||
@@ -2994,6 +3069,13 @@ static int mtk_probe(struct platform_dev
|
||||
spin_lock_init(ð->page_lock);
|
||||
spin_lock_init(ð->tx_irq_lock);
|
||||
spin_lock_init(ð->rx_irq_lock);
|
||||
@ -269,7 +269,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
|
||||
|
||||
/* QDMA Interrupt grouping registers */
|
||||
#define MTK_QDMA_INT_GRP1 0x1a20
|
||||
@@ -863,6 +869,7 @@ struct mtk_sgmii {
|
||||
@@ -864,6 +870,7 @@ struct mtk_sgmii {
|
||||
* @page_lock: Make sure that register operations are atomic
|
||||
* @tx_irq__lock: Make sure that IRQ register operations are atomic
|
||||
* @rx_irq__lock: Make sure that IRQ register operations are atomic
|
||||
@ -277,7 +277,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
|
||||
* @dummy_dev: we run 2 netdevs on 1 physical DMA ring and need a
|
||||
* dummy for NAPI to work
|
||||
* @netdev: The netdev instances
|
||||
@@ -881,6 +888,14 @@ struct mtk_sgmii {
|
||||
@@ -882,6 +889,14 @@ struct mtk_sgmii {
|
||||
* @rx_ring_qdma: Pointer to the memory holding info about the QDMA RX ring
|
||||
* @tx_napi: The TX NAPI struct
|
||||
* @rx_napi: The RX NAPI struct
|
||||
@ -292,7 +292,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
|
||||
* @scratch_ring: Newer SoCs need memory for a second HW managed TX ring
|
||||
* @phy_scratch_ring: physical address of scratch_ring
|
||||
* @scratch_head: The scratch memory that scratch_ring points to.
|
||||
@@ -925,6 +940,18 @@ struct mtk_eth {
|
||||
@@ -926,6 +941,18 @@ struct mtk_eth {
|
||||
|
||||
const struct mtk_soc_data *soc;
|
||||
|
||||
|
@ -17,7 +17,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
|
||||
|
||||
--- a/drivers/net/ethernet/mediatek/mtk_eth_soc.c
|
||||
+++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c
|
||||
@@ -1399,7 +1399,7 @@ static int mtk_poll_tx_qdma(struct mtk_e
|
||||
@@ -1400,7 +1400,7 @@ static int mtk_poll_tx_qdma(struct mtk_e
|
||||
struct mtk_tx_buf *tx_buf;
|
||||
u32 cpu, dma;
|
||||
|
||||
@ -26,7 +26,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
|
||||
dma = mtk_r32(eth, MTK_QTX_DRX_PTR);
|
||||
|
||||
desc = mtk_qdma_phys_to_virt(ring, cpu);
|
||||
@@ -1433,6 +1433,7 @@ static int mtk_poll_tx_qdma(struct mtk_e
|
||||
@@ -1434,6 +1434,7 @@ static int mtk_poll_tx_qdma(struct mtk_e
|
||||
cpu = next_cpu;
|
||||
}
|
||||
|
||||
@ -34,7 +34,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
|
||||
mtk_w32(eth, cpu, MTK_QTX_CRX_PTR);
|
||||
|
||||
return budget;
|
||||
@@ -1633,6 +1634,7 @@ static int mtk_tx_alloc(struct mtk_eth *
|
||||
@@ -1634,6 +1635,7 @@ static int mtk_tx_alloc(struct mtk_eth *
|
||||
atomic_set(&ring->free_count, MTK_DMA_SIZE - 2);
|
||||
ring->next_free = &ring->dma[0];
|
||||
ring->last_free = &ring->dma[MTK_DMA_SIZE - 1];
|
||||
@ -42,7 +42,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
|
||||
ring->thresh = MAX_SKB_FRAGS;
|
||||
|
||||
/* make sure that all changes to the dma ring are flushed before we
|
||||
@@ -1646,9 +1648,7 @@ static int mtk_tx_alloc(struct mtk_eth *
|
||||
@@ -1647,9 +1649,7 @@ static int mtk_tx_alloc(struct mtk_eth *
|
||||
mtk_w32(eth,
|
||||
ring->phys + ((MTK_DMA_SIZE - 1) * sz),
|
||||
MTK_QTX_CRX_PTR);
|
||||
@ -55,7 +55,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
|
||||
} else {
|
||||
--- a/drivers/net/ethernet/mediatek/mtk_eth_soc.h
|
||||
+++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.h
|
||||
@@ -656,6 +656,7 @@ struct mtk_tx_buf {
|
||||
@@ -657,6 +657,7 @@ struct mtk_tx_buf {
|
||||
* @phys: The physical addr of tx_buf
|
||||
* @next_free: Pointer to the next free descriptor
|
||||
* @last_free: Pointer to the last free descriptor
|
||||
@ -63,7 +63,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
|
||||
* @thresh: The threshold of minimum amount of free descriptors
|
||||
* @free_count: QDMA uses a linked list. Track how many free descriptors
|
||||
* are present
|
||||
@@ -666,6 +667,7 @@ struct mtk_tx_ring {
|
||||
@@ -667,6 +668,7 @@ struct mtk_tx_ring {
|
||||
dma_addr_t phys;
|
||||
struct mtk_tx_dma *next_free;
|
||||
struct mtk_tx_dma *last_free;
|
||||
|
@ -16,7 +16,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
|
||||
|
||||
--- a/drivers/net/ethernet/mediatek/mtk_eth_soc.c
|
||||
+++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c
|
||||
@@ -798,13 +798,18 @@ static inline int mtk_max_buf_size(int f
|
||||
@@ -799,13 +799,18 @@ static inline int mtk_max_buf_size(int f
|
||||
return buf_size;
|
||||
}
|
||||
|
||||
@ -37,7 +37,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
|
||||
}
|
||||
|
||||
static void *mtk_max_lro_buf_alloc(gfp_t gfp_mask)
|
||||
@@ -1287,8 +1292,7 @@ static int mtk_poll_rx(struct napi_struc
|
||||
@@ -1288,8 +1293,7 @@ static int mtk_poll_rx(struct napi_struc
|
||||
rxd = &ring->dma[idx];
|
||||
data = ring->data[idx];
|
||||
|
||||
|
@ -14,7 +14,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
|
||||
|
||||
--- a/drivers/net/ethernet/mediatek/mtk_eth_soc.c
|
||||
+++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c
|
||||
@@ -1554,8 +1554,8 @@ static int mtk_napi_tx(struct napi_struc
|
||||
@@ -1555,8 +1555,8 @@ static int mtk_napi_tx(struct napi_struc
|
||||
if (status & MTK_TX_DONE_INT)
|
||||
return budget;
|
||||
|
||||
@ -25,7 +25,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
|
||||
|
||||
return tx_done;
|
||||
}
|
||||
@@ -1588,8 +1588,9 @@ poll_again:
|
||||
@@ -1589,8 +1589,9 @@ poll_again:
|
||||
remain_budget -= rx_done;
|
||||
goto poll_again;
|
||||
}
|
||||
|
@ -17,7 +17,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
|
||||
|
||||
--- a/drivers/net/ethernet/mediatek/mtk_eth_soc.c
|
||||
+++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c
|
||||
@@ -1531,7 +1531,6 @@ static void mtk_handle_status_irq(struct
|
||||
@@ -1532,7 +1532,6 @@ static void mtk_handle_status_irq(struct
|
||||
static int mtk_napi_tx(struct napi_struct *napi, int budget)
|
||||
{
|
||||
struct mtk_eth *eth = container_of(napi, struct mtk_eth, tx_napi);
|
||||
@ -25,7 +25,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
|
||||
int tx_done = 0;
|
||||
|
||||
if (MTK_HAS_CAPS(eth->soc->caps, MTK_QDMA))
|
||||
@@ -1540,21 +1539,19 @@ static int mtk_napi_tx(struct napi_struc
|
||||
@@ -1541,21 +1540,19 @@ static int mtk_napi_tx(struct napi_struc
|
||||
tx_done = mtk_poll_tx(eth, budget);
|
||||
|
||||
if (unlikely(netif_msg_intr(eth))) {
|
||||
@ -52,7 +52,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
|
||||
mtk_tx_irq_enable(eth, MTK_TX_DONE_INT);
|
||||
|
||||
return tx_done;
|
||||
@@ -1563,36 +1560,33 @@ static int mtk_napi_tx(struct napi_struc
|
||||
@@ -1564,36 +1561,33 @@ static int mtk_napi_tx(struct napi_struc
|
||||
static int mtk_napi_rx(struct napi_struct *napi, int budget)
|
||||
{
|
||||
struct mtk_eth *eth = container_of(napi, struct mtk_eth, rx_napi);
|
||||
|
@ -24,7 +24,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
|
||||
#include <net/dsa.h>
|
||||
|
||||
#include "mtk_eth_soc.h"
|
||||
@@ -1282,6 +1283,7 @@ static int mtk_poll_rx(struct napi_struc
|
||||
@@ -1283,6 +1284,7 @@ static int mtk_poll_rx(struct napi_struc
|
||||
struct net_device *netdev;
|
||||
unsigned int pktlen;
|
||||
dma_addr_t dma_addr;
|
||||
@ -32,7 +32,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
|
||||
int mac;
|
||||
|
||||
ring = mtk_get_rx_ring(eth);
|
||||
@@ -1354,6 +1356,12 @@ static int mtk_poll_rx(struct napi_struc
|
||||
@@ -1355,6 +1357,12 @@ static int mtk_poll_rx(struct napi_struc
|
||||
skb->protocol = eth_type_trans(skb, netdev);
|
||||
bytes += pktlen;
|
||||
|
||||
|
@ -19,7 +19,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
|
||||
|
||||
--- a/drivers/net/ethernet/mediatek/mtk_eth_soc.c
|
||||
+++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c
|
||||
@@ -2074,25 +2074,22 @@ static int mtk_set_features(struct net_d
|
||||
@@ -2075,25 +2075,22 @@ static int mtk_set_features(struct net_d
|
||||
/* wait for DMA to finish whatever it is doing before we start using it again */
|
||||
static int mtk_dma_busy_wait(struct mtk_eth *eth)
|
||||
{
|
||||
|
@ -25,10 +25,10 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
|
||||
mcr_new = mcr_cur;
|
||||
- mcr_new |= MAC_MCR_MAX_RX_1536 | MAC_MCR_IPG_CFG | MAC_MCR_FORCE_MODE |
|
||||
+ mcr_new |= MAC_MCR_IPG_CFG | MAC_MCR_FORCE_MODE |
|
||||
MAC_MCR_BACKOFF_EN | MAC_MCR_BACKPR_EN | MAC_MCR_FORCE_LINK;
|
||||
MAC_MCR_BACKOFF_EN | MAC_MCR_BACKPR_EN | MAC_MCR_FORCE_LINK |
|
||||
MAC_MCR_RX_FIFO_CLR_DIS;
|
||||
|
||||
/* Only update control register when needed! */
|
||||
@@ -782,8 +782,8 @@ static void mtk_get_stats64(struct net_d
|
||||
@@ -783,8 +783,8 @@ static void mtk_get_stats64(struct net_d
|
||||
static inline int mtk_max_frag_size(int mtu)
|
||||
{
|
||||
/* make sure buf_size will be at least MTK_MAX_RX_LENGTH */
|
||||
@ -39,7 +39,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
|
||||
|
||||
return SKB_DATA_ALIGN(MTK_RX_HLEN + mtu) +
|
||||
SKB_DATA_ALIGN(sizeof(struct skb_shared_info));
|
||||
@@ -794,7 +794,7 @@ static inline int mtk_max_buf_size(int f
|
||||
@@ -795,7 +795,7 @@ static inline int mtk_max_buf_size(int f
|
||||
int buf_size = frag_size - NET_SKB_PAD - NET_IP_ALIGN -
|
||||
SKB_DATA_ALIGN(sizeof(struct skb_shared_info));
|
||||
|
||||
@ -48,7 +48,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
|
||||
|
||||
return buf_size;
|
||||
}
|
||||
@@ -2630,6 +2630,35 @@ static void mtk_uninit(struct net_device
|
||||
@@ -2631,6 +2631,35 @@ static void mtk_uninit(struct net_device
|
||||
mtk_rx_irq_disable(eth, ~0);
|
||||
}
|
||||
|
||||
@ -84,7 +84,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
|
||||
static int mtk_do_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd)
|
||||
{
|
||||
struct mtk_mac *mac = netdev_priv(dev);
|
||||
@@ -2926,6 +2955,7 @@ static const struct net_device_ops mtk_n
|
||||
@@ -2927,6 +2956,7 @@ static const struct net_device_ops mtk_n
|
||||
.ndo_set_mac_address = mtk_set_mac_address,
|
||||
.ndo_validate_addr = eth_validate_addr,
|
||||
.ndo_do_ioctl = mtk_do_ioctl,
|
||||
@ -92,7 +92,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
|
||||
.ndo_tx_timeout = mtk_tx_timeout,
|
||||
.ndo_get_stats64 = mtk_get_stats64,
|
||||
.ndo_fix_features = mtk_fix_features,
|
||||
@@ -3028,7 +3058,10 @@ static int mtk_add_mac(struct mtk_eth *e
|
||||
@@ -3029,7 +3059,10 @@ static int mtk_add_mac(struct mtk_eth *e
|
||||
eth->netdev[id]->irq = eth->irq[0];
|
||||
eth->netdev[id]->dev.of_node = np;
|
||||
|
||||
|
@ -629,7 +629,7 @@
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -1003,6 +1023,7 @@ static struct sk_buff *__skb_clone(struc
|
||||
@@ -1002,6 +1022,7 @@ static struct sk_buff *__skb_clone(struc
|
||||
n->nohdr = 0;
|
||||
n->peeked = 0;
|
||||
C(pfmemalloc);
|
||||
@ -637,7 +637,7 @@
|
||||
n->destructor = NULL;
|
||||
C(tail);
|
||||
C(end);
|
||||
@@ -3421,7 +3442,7 @@ int skb_shift(struct sk_buff *tgt, struc
|
||||
@@ -3420,7 +3441,7 @@ int skb_shift(struct sk_buff *tgt, struc
|
||||
fragto = &skb_shinfo(tgt)->frags[merge];
|
||||
|
||||
skb_frag_size_add(fragto, skb_frag_size(fragfrom));
|
||||
@ -646,7 +646,7 @@
|
||||
}
|
||||
|
||||
/* Reposition in the original skb */
|
||||
@@ -5188,6 +5209,20 @@ bool skb_try_coalesce(struct sk_buff *to
|
||||
@@ -5187,6 +5208,20 @@ bool skb_try_coalesce(struct sk_buff *to
|
||||
if (skb_cloned(to))
|
||||
return false;
|
||||
|
||||
|
@ -0,0 +1,41 @@
|
||||
From 7390609b0121a1b982c5ecdfcd72dc328e5784ee Mon Sep 17 00:00:00 2001
|
||||
From: Michael Walle <michael@walle.cc>
|
||||
Date: Mon, 6 Feb 2023 13:43:42 +0000
|
||||
Subject: [PATCH] net: add helper eth_addr_add()
|
||||
|
||||
Add a helper to add an offset to a ethernet address. This comes in handy
|
||||
if you have a base ethernet address for multiple interfaces.
|
||||
|
||||
Signed-off-by: Michael Walle <michael@walle.cc>
|
||||
Reviewed-by: Andrew Lunn <andrew@lunn.ch>
|
||||
Acked-by: Jakub Kicinski <kuba@kernel.org>
|
||||
Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
|
||||
Link: https://lore.kernel.org/r/20230206134356.839737-9-srinivas.kandagatla@linaro.org
|
||||
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
|
||||
---
|
||||
include/linux/etherdevice.h | 14 ++++++++++++++
|
||||
1 file changed, 14 insertions(+)
|
||||
|
||||
--- a/include/linux/etherdevice.h
|
||||
+++ b/include/linux/etherdevice.h
|
||||
@@ -466,6 +466,20 @@ static inline void eth_addr_inc(u8 *addr
|
||||
}
|
||||
|
||||
/**
|
||||
+ * eth_addr_add() - Add (or subtract) an offset to/from the given MAC address.
|
||||
+ *
|
||||
+ * @offset: Offset to add.
|
||||
+ * @addr: Pointer to a six-byte array containing Ethernet address to increment.
|
||||
+ */
|
||||
+static inline void eth_addr_add(u8 *addr, long offset)
|
||||
+{
|
||||
+ u64 u = ether_addr_to_u64(addr);
|
||||
+
|
||||
+ u += offset;
|
||||
+ u64_to_ether_addr(u, addr);
|
||||
+}
|
||||
+
|
||||
+/**
|
||||
* is_etherdev_addr - Tell if given Ethernet address belongs to the device.
|
||||
* @dev: Pointer to a device structure
|
||||
* @addr: Pointer to a six-byte array containing the Ethernet address
|
@ -895,7 +895,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
|
||||
|
||||
--- a/drivers/net/ethernet/mediatek/mtk_eth_soc.c
|
||||
+++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c
|
||||
@@ -2604,14 +2604,11 @@ static int __init mtk_init(struct net_de
|
||||
@@ -2605,14 +2605,11 @@ static int __init mtk_init(struct net_de
|
||||
{
|
||||
struct mtk_mac *mac = netdev_priv(dev);
|
||||
struct mtk_eth *eth = mac->hw;
|
||||
@ -1360,7 +1360,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
|
||||
int irq;
|
||||
--- a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
|
||||
+++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
|
||||
@@ -5014,7 +5014,7 @@ int stmmac_dvr_probe(struct device *devi
|
||||
@@ -5015,7 +5015,7 @@ int stmmac_dvr_probe(struct device *devi
|
||||
priv->wol_irq = res->wol_irq;
|
||||
priv->lpi_irq = res->lpi_irq;
|
||||
|
||||
@ -1420,7 +1420,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
|
||||
|
||||
--- a/drivers/net/ethernet/ti/am65-cpsw-nuss.c
|
||||
+++ b/drivers/net/ethernet/ti/am65-cpsw-nuss.c
|
||||
@@ -1742,7 +1742,6 @@ static int am65_cpsw_nuss_init_slave_por
|
||||
@@ -1713,7 +1713,6 @@ static int am65_cpsw_nuss_init_slave_por
|
||||
|
||||
for_each_child_of_node(node, port_np) {
|
||||
struct am65_cpsw_port *port;
|
||||
@ -1428,8 +1428,8 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
|
||||
u32 port_id;
|
||||
|
||||
/* it is not a slave port node, continue */
|
||||
@@ -1821,15 +1820,15 @@ static int am65_cpsw_nuss_init_slave_por
|
||||
return ret;
|
||||
@@ -1796,15 +1795,15 @@ static int am65_cpsw_nuss_init_slave_por
|
||||
goto of_node_put;
|
||||
}
|
||||
|
||||
- mac_addr = of_get_mac_address(port_np);
|
||||
|
@ -34,7 +34,7 @@ Acked-by: Bjorn Helgaas <bhelgaas@google.com>
|
||||
set_dev_node(bus->bridge, pcibus_to_node(bus));
|
||||
--- a/include/linux/pci.h
|
||||
+++ b/include/linux/pci.h
|
||||
@@ -547,6 +547,7 @@ struct pci_host_bridge {
|
||||
@@ -548,6 +548,7 @@ struct pci_host_bridge {
|
||||
unsigned int native_dpc:1; /* OS may use PCIe DPC */
|
||||
unsigned int preserve_config:1; /* Preserve FW resource setup */
|
||||
unsigned int size_windows:1; /* Enable root bus sizing */
|
||||
|
@ -41,7 +41,7 @@ Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
|
||||
|
||||
--- a/drivers/bluetooth/btusb.c
|
||||
+++ b/drivers/bluetooth/btusb.c
|
||||
@@ -451,6 +451,10 @@ static const struct usb_device_id blackl
|
||||
@@ -455,6 +455,10 @@ static const struct usb_device_id blackl
|
||||
{ USB_DEVICE(0x0bda, 0xb009), .driver_info = BTUSB_REALTEK },
|
||||
{ USB_DEVICE(0x2ff8, 0xb011), .driver_info = BTUSB_REALTEK },
|
||||
|
||||
|
@ -44,7 +44,7 @@ Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
|
||||
|
||||
--- a/drivers/bluetooth/btusb.c
|
||||
+++ b/drivers/bluetooth/btusb.c
|
||||
@@ -451,6 +451,10 @@ static const struct usb_device_id blackl
|
||||
@@ -455,6 +455,10 @@ static const struct usb_device_id blackl
|
||||
{ USB_DEVICE(0x0bda, 0xb009), .driver_info = BTUSB_REALTEK },
|
||||
{ USB_DEVICE(0x2ff8, 0xb011), .driver_info = BTUSB_REALTEK },
|
||||
|
||||
|
@ -44,7 +44,7 @@ Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
|
||||
|
||||
--- a/drivers/bluetooth/btusb.c
|
||||
+++ b/drivers/bluetooth/btusb.c
|
||||
@@ -458,6 +458,8 @@ static const struct usb_device_id blackl
|
||||
@@ -462,6 +462,8 @@ static const struct usb_device_id blackl
|
||||
/* Additional Realtek 8761BU Bluetooth devices */
|
||||
{ USB_DEVICE(0x0b05, 0x190e), .driver_info = BTUSB_REALTEK |
|
||||
BTUSB_WIDEBAND_SPEECH },
|
||||
|
@ -0,0 +1,41 @@
|
||||
From 7390609b0121a1b982c5ecdfcd72dc328e5784ee Mon Sep 17 00:00:00 2001
|
||||
From: Michael Walle <michael@walle.cc>
|
||||
Date: Mon, 6 Feb 2023 13:43:42 +0000
|
||||
Subject: [PATCH] net: add helper eth_addr_add()
|
||||
|
||||
Add a helper to add an offset to a ethernet address. This comes in handy
|
||||
if you have a base ethernet address for multiple interfaces.
|
||||
|
||||
Signed-off-by: Michael Walle <michael@walle.cc>
|
||||
Reviewed-by: Andrew Lunn <andrew@lunn.ch>
|
||||
Acked-by: Jakub Kicinski <kuba@kernel.org>
|
||||
Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
|
||||
Link: https://lore.kernel.org/r/20230206134356.839737-9-srinivas.kandagatla@linaro.org
|
||||
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
|
||||
---
|
||||
include/linux/etherdevice.h | 14 ++++++++++++++
|
||||
1 file changed, 14 insertions(+)
|
||||
|
||||
--- a/include/linux/etherdevice.h
|
||||
+++ b/include/linux/etherdevice.h
|
||||
@@ -478,6 +478,20 @@ static inline void eth_addr_inc(u8 *addr
|
||||
}
|
||||
|
||||
/**
|
||||
+ * eth_addr_add() - Add (or subtract) an offset to/from the given MAC address.
|
||||
+ *
|
||||
+ * @offset: Offset to add.
|
||||
+ * @addr: Pointer to a six-byte array containing Ethernet address to increment.
|
||||
+ */
|
||||
+static inline void eth_addr_add(u8 *addr, long offset)
|
||||
+{
|
||||
+ u64 u = ether_addr_to_u64(addr);
|
||||
+
|
||||
+ u += offset;
|
||||
+ u64_to_ether_addr(u, addr);
|
||||
+}
|
||||
+
|
||||
+/**
|
||||
* is_etherdev_addr - Tell if given Ethernet address belongs to the device.
|
||||
* @dev: Pointer to a device structure
|
||||
* @addr: Pointer to a six-byte array containing the Ethernet address
|
@ -3879,7 +3879,6 @@ CONFIG_NET_CLS_IND=y
|
||||
# CONFIG_NET_CLS_ROUTE4 is not set
|
||||
# CONFIG_NET_CLS_RSVP is not set
|
||||
# CONFIG_NET_CLS_RSVP6 is not set
|
||||
# CONFIG_NET_CLS_TCINDEX is not set
|
||||
# CONFIG_NET_CLS_U32 is not set
|
||||
CONFIG_NET_CORE=y
|
||||
# CONFIG_NET_DEVLINK is not set
|
||||
|
@ -711,6 +711,7 @@ CONFIG_BLOCK=y
|
||||
# CONFIG_BONDING is not set
|
||||
# CONFIG_BOOKE_WDT is not set
|
||||
CONFIG_BOOKE_WDT_DEFAULT_TIMEOUT=3
|
||||
# CONFIG_BOOTPARAM_HARDLOCKUP_PANIC is not set
|
||||
# CONFIG_BOOTPARAM_HUNG_TASK_PANIC is not set
|
||||
# CONFIG_BOOTPARAM_SOFTLOCKUP_PANIC is not set
|
||||
# CONFIG_BOOTTIME_TRACING is not set
|
||||
@ -1373,7 +1374,10 @@ CONFIG_DEBUG_KERNEL=y
|
||||
# CONFIG_DEBUG_USER is not set
|
||||
# CONFIG_DEBUG_VIRTUAL is not set
|
||||
# CONFIG_DEBUG_VM is not set
|
||||
# CONFIG_DEBUG_VM_PGFLAGS is not set
|
||||
# CONFIG_DEBUG_VM_PGTABLE is not set
|
||||
# CONFIG_DEBUG_VM_RB is not set
|
||||
# CONFIG_DEBUG_VM_VMACACHE is not set
|
||||
# CONFIG_DEBUG_WQ_FORCE_RR_CPU is not set
|
||||
# CONFIG_DEBUG_WW_MUTEX_SLOWPATH is not set
|
||||
# CONFIG_DEBUG_WX is not set
|
||||
@ -2396,6 +2400,7 @@ CONFIG_HIGH_RES_TIMERS=y
|
||||
# CONFIG_HISI_DMA is not set
|
||||
# CONFIG_HISI_FEMAC is not set
|
||||
# CONFIG_HISI_HIKEY_USB is not set
|
||||
# CONFIG_HIST_TRIGGERS_DEBUG is not set
|
||||
# CONFIG_HIX5HD2_GMAC is not set
|
||||
# CONFIG_HMC425 is not set
|
||||
# CONFIG_HMC6352 is not set
|
||||
@ -2998,9 +3003,11 @@ CONFIG_KALLSYMS_BASE_RELATIVE=y
|
||||
# CONFIG_KALLSYMS_UNCOMPRESSED is not set
|
||||
# CONFIG_KARMA_PARTITION is not set
|
||||
# CONFIG_KASAN is not set
|
||||
# CONFIG_KASAN_MODULE_TEST is not set
|
||||
CONFIG_KASAN_STACK=y
|
||||
# CONFIG_KCMP is not set
|
||||
# CONFIG_KCOV is not set
|
||||
CONFIG_KCOV_IRQ_AREA_SIZE=0x40000
|
||||
# CONFIG_KCSAN is not set
|
||||
# CONFIG_KERNEL_BZIP2 is not set
|
||||
# CONFIG_KERNEL_CAT is not set
|
||||
@ -3202,6 +3209,7 @@ CONFIG_LINEAR_RANGES=y
|
||||
# CONFIG_LIS3L02DQ is not set
|
||||
# CONFIG_LITEX_LITEETH is not set
|
||||
# CONFIG_LITEX_SOC_CONTROLLER is not set
|
||||
# CONFIG_LIVEPATCH is not set
|
||||
# CONFIG_LKDTM is not set
|
||||
CONFIG_LLC=y
|
||||
# CONFIG_LLC2 is not set
|
||||
@ -6336,6 +6344,7 @@ CONFIG_SSB_POSSIBLE=y
|
||||
# CONFIG_STACKTRACE is not set
|
||||
# CONFIG_STACKTRACE_BUILD_ID is not set
|
||||
CONFIG_STACKTRACE_SUPPORT=y
|
||||
CONFIG_STACK_HASH_ORDER=20
|
||||
# CONFIG_STACK_TRACER is not set
|
||||
# CONFIG_STACK_VALIDATION is not set
|
||||
CONFIG_STAGING=y
|
||||
@ -6398,6 +6407,7 @@ CONFIG_SYMBOLIC_ERRNAME=y
|
||||
# CONFIG_SYNC_FILE is not set
|
||||
# CONFIG_SYNOPSYS_DWC_ETH_QOS is not set
|
||||
# CONFIG_SYNTH_EVENTS is not set
|
||||
# CONFIG_SYNTH_EVENT_GEN_TEST is not set
|
||||
CONFIG_SYN_COOKIES=y
|
||||
# CONFIG_SYSCON_REBOOT_MODE is not set
|
||||
CONFIG_SYSCTL=y
|
||||
@ -6472,6 +6482,7 @@ CONFIG_TCP_CONG_CUBIC=y
|
||||
# CONFIG_TEST_BLACKHOLE_DEV is not set
|
||||
# CONFIG_TEST_BPF is not set
|
||||
# CONFIG_TEST_CLOCKSOURCE_WATCHDOG is not set
|
||||
# CONFIG_TEST_DEBUG_VIRTUAL is not set
|
||||
# CONFIG_TEST_DIV64 is not set
|
||||
# CONFIG_TEST_FIRMWARE is not set
|
||||
# CONFIG_TEST_FREE_PAGES is not set
|
||||
@ -6774,7 +6785,12 @@ CONFIG_UBIFS_FS_ZLIB=y
|
||||
CONFIG_UBIFS_FS_ZSTD=y
|
||||
# CONFIG_UBSAN is not set
|
||||
CONFIG_UBSAN_ALIGNMENT=y
|
||||
CONFIG_UBSAN_BOOL=y
|
||||
# CONFIG_UBSAN_DIV_ZERO is not set
|
||||
CONFIG_UBSAN_ENUM=y
|
||||
# CONFIG_UBSAN_MISC is not set
|
||||
CONFIG_UBSAN_SHIFT=y
|
||||
# CONFIG_UBSAN_UNREACHABLE is not set
|
||||
# CONFIG_UCB1400_CORE is not set
|
||||
# CONFIG_UCSI is not set
|
||||
# CONFIG_UDF_FS is not set
|
||||
|
@ -56,7 +56,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
|
||||
} \
|
||||
\
|
||||
/* __*init sections */ \
|
||||
@@ -1019,6 +1029,8 @@
|
||||
@@ -1024,6 +1034,8 @@
|
||||
|
||||
#define COMMON_DISCARDS \
|
||||
SANITIZER_DISCARDS \
|
||||
|
@ -105,7 +105,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
|
||||
help
|
||||
--- a/net/core/dev.c
|
||||
+++ b/net/core/dev.c
|
||||
@@ -3654,6 +3654,11 @@ static int xmit_one(struct sk_buff *skb,
|
||||
@@ -3656,6 +3656,11 @@ static int xmit_one(struct sk_buff *skb,
|
||||
if (dev_nit_active(dev))
|
||||
dev_queue_xmit_nit(skb, dev);
|
||||
|
||||
|
@ -50,9 +50,9 @@ Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
|
||||
/**************************************************
|
||||
* MII
|
||||
**************************************************/
|
||||
@@ -1542,6 +1554,14 @@ int bgmac_enet_probe(struct bgmac *bgmac
|
||||
/* Omit FCS from max MTU size */
|
||||
net_dev->max_mtu = BGMAC_RX_MAX_FRAME_SIZE - ETH_FCS_LEN;
|
||||
@@ -1546,6 +1558,14 @@ int bgmac_enet_probe(struct bgmac *bgmac
|
||||
|
||||
bgmac->in_init = false;
|
||||
|
||||
+ if ((bgmac->feature_flags & BGMAC_FEAT_SRAB) && !bgmac_b53_pdata.regs) {
|
||||
+ bgmac_b53_pdata.regs = ioremap(0x18007000, 0x1000);
|
||||
@ -65,7 +65,7 @@ Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
|
||||
err = register_netdev(bgmac->net_dev);
|
||||
if (err) {
|
||||
dev_err(bgmac->dev, "Cannot register net device\n");
|
||||
@@ -1564,6 +1584,10 @@ EXPORT_SYMBOL_GPL(bgmac_enet_probe);
|
||||
@@ -1568,6 +1588,10 @@ EXPORT_SYMBOL_GPL(bgmac_enet_probe);
|
||||
|
||||
void bgmac_enet_remove(struct bgmac *bgmac)
|
||||
{
|
||||
@ -86,7 +86,7 @@ Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
|
||||
|
||||
struct bgmac_slot_info {
|
||||
union {
|
||||
@@ -533,6 +534,9 @@ struct bgmac {
|
||||
@@ -535,6 +536,9 @@ struct bgmac {
|
||||
void (*cmn_maskset32)(struct bgmac *bgmac, u16 offset, u32 mask,
|
||||
u32 set);
|
||||
int (*phy_connect)(struct bgmac *bgmac);
|
||||
|
@ -330,7 +330,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
|
||||
|
||||
--- a/net/core/sock.c
|
||||
+++ b/net/core/sock.c
|
||||
@@ -3701,6 +3701,8 @@ static __net_initdata struct pernet_oper
|
||||
@@ -3710,6 +3710,8 @@ static __net_initdata struct pernet_oper
|
||||
|
||||
static int __init proto_init(void)
|
||||
{
|
||||
|
@ -202,7 +202,7 @@ Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
|
||||
return !!nor->params->erase_map.uniform_erase_type;
|
||||
}
|
||||
|
||||
@@ -2571,6 +2573,7 @@ static int spi_nor_select_erase(struct s
|
||||
@@ -2580,6 +2582,7 @@ static int spi_nor_select_erase(struct s
|
||||
{
|
||||
struct spi_nor_erase_map *map = &nor->params->erase_map;
|
||||
const struct spi_nor_erase_type *erase = NULL;
|
||||
@ -210,7 +210,7 @@ Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
|
||||
struct mtd_info *mtd = &nor->mtd;
|
||||
u32 wanted_size = nor->info->sector_size;
|
||||
int i;
|
||||
@@ -2603,8 +2606,9 @@ static int spi_nor_select_erase(struct s
|
||||
@@ -2612,8 +2615,9 @@ static int spi_nor_select_erase(struct s
|
||||
*/
|
||||
for (i = SNOR_ERASE_TYPE_MAX - 1; i >= 0; i--) {
|
||||
if (map->erase_type[i].size) {
|
||||
@ -222,7 +222,7 @@ Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2612,6 +2616,9 @@ static int spi_nor_select_erase(struct s
|
||||
@@ -2621,6 +2625,9 @@ static int spi_nor_select_erase(struct s
|
||||
return -EINVAL;
|
||||
|
||||
mtd->erasesize = erase->size;
|
||||
|
@ -8,7 +8,7 @@ Signed-off-by: Daniel Golle <daniel@makrotopia.org>
|
||||
|
||||
--- a/drivers/mtd/ubi/build.c
|
||||
+++ b/drivers/mtd/ubi/build.c
|
||||
@@ -1185,6 +1185,73 @@ static struct mtd_info * __init open_mtd
|
||||
@@ -1192,6 +1192,73 @@ static struct mtd_info * __init open_mtd
|
||||
return mtd;
|
||||
}
|
||||
|
||||
@ -82,7 +82,7 @@ Signed-off-by: Daniel Golle <daniel@makrotopia.org>
|
||||
static int __init ubi_init(void)
|
||||
{
|
||||
int err, i, k;
|
||||
@@ -1268,6 +1335,12 @@ static int __init ubi_init(void)
|
||||
@@ -1275,6 +1342,12 @@ static int __init ubi_init(void)
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -91,7 +91,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
|
||||
for (i = sizeof(struct ipt_entry);
|
||||
i < e->target_offset;
|
||||
i += m->u.match_size) {
|
||||
@@ -1223,12 +1260,15 @@ compat_copy_entry_to_user(struct ipt_ent
|
||||
@@ -1222,12 +1259,15 @@ compat_copy_entry_to_user(struct ipt_ent
|
||||
compat_uint_t origsize;
|
||||
const struct xt_entry_match *ematch;
|
||||
int ret = 0;
|
||||
|
@ -185,7 +185,7 @@ Signed-off-by: Jonas Gorski <jogo@openwrt.org>
|
||||
cfg->fc_flags |= RTF_REJECT;
|
||||
|
||||
if (rtm->rtm_type == RTN_LOCAL)
|
||||
@@ -6135,6 +6166,8 @@ static int ip6_route_dev_notify(struct n
|
||||
@@ -6136,6 +6167,8 @@ static int ip6_route_dev_notify(struct n
|
||||
#ifdef CONFIG_IPV6_MULTIPLE_TABLES
|
||||
net->ipv6.ip6_prohibit_entry->dst.dev = dev;
|
||||
net->ipv6.ip6_prohibit_entry->rt6i_idev = in6_dev_get(dev);
|
||||
@ -194,7 +194,7 @@ Signed-off-by: Jonas Gorski <jogo@openwrt.org>
|
||||
net->ipv6.ip6_blk_hole_entry->dst.dev = dev;
|
||||
net->ipv6.ip6_blk_hole_entry->rt6i_idev = in6_dev_get(dev);
|
||||
#endif
|
||||
@@ -6146,6 +6179,7 @@ static int ip6_route_dev_notify(struct n
|
||||
@@ -6147,6 +6180,7 @@ static int ip6_route_dev_notify(struct n
|
||||
in6_dev_put_clear(&net->ipv6.ip6_null_entry->rt6i_idev);
|
||||
#ifdef CONFIG_IPV6_MULTIPLE_TABLES
|
||||
in6_dev_put_clear(&net->ipv6.ip6_prohibit_entry->rt6i_idev);
|
||||
@ -202,7 +202,7 @@ Signed-off-by: Jonas Gorski <jogo@openwrt.org>
|
||||
in6_dev_put_clear(&net->ipv6.ip6_blk_hole_entry->rt6i_idev);
|
||||
#endif
|
||||
}
|
||||
@@ -6337,6 +6371,8 @@ static int __net_init ip6_route_net_init
|
||||
@@ -6338,6 +6372,8 @@ static int __net_init ip6_route_net_init
|
||||
|
||||
#ifdef CONFIG_IPV6_MULTIPLE_TABLES
|
||||
net->ipv6.fib6_has_custom_rules = false;
|
||||
@ -211,7 +211,7 @@ Signed-off-by: Jonas Gorski <jogo@openwrt.org>
|
||||
net->ipv6.ip6_prohibit_entry = kmemdup(&ip6_prohibit_entry_template,
|
||||
sizeof(*net->ipv6.ip6_prohibit_entry),
|
||||
GFP_KERNEL);
|
||||
@@ -6347,11 +6383,21 @@ static int __net_init ip6_route_net_init
|
||||
@@ -6348,11 +6384,21 @@ static int __net_init ip6_route_net_init
|
||||
ip6_template_metrics, true);
|
||||
INIT_LIST_HEAD(&net->ipv6.ip6_prohibit_entry->rt6i_uncached);
|
||||
|
||||
@ -234,7 +234,7 @@ Signed-off-by: Jonas Gorski <jogo@openwrt.org>
|
||||
net->ipv6.ip6_blk_hole_entry->dst.ops = &net->ipv6.ip6_dst_ops;
|
||||
dst_init_metrics(&net->ipv6.ip6_blk_hole_entry->dst,
|
||||
ip6_template_metrics, true);
|
||||
@@ -6378,6 +6424,8 @@ out:
|
||||
@@ -6379,6 +6425,8 @@ out:
|
||||
return ret;
|
||||
|
||||
#ifdef CONFIG_IPV6_MULTIPLE_TABLES
|
||||
@ -243,7 +243,7 @@ Signed-off-by: Jonas Gorski <jogo@openwrt.org>
|
||||
out_ip6_prohibit_entry:
|
||||
kfree(net->ipv6.ip6_prohibit_entry);
|
||||
out_ip6_null_entry:
|
||||
@@ -6397,6 +6445,7 @@ static void __net_exit ip6_route_net_exi
|
||||
@@ -6398,6 +6446,7 @@ static void __net_exit ip6_route_net_exi
|
||||
kfree(net->ipv6.ip6_null_entry);
|
||||
#ifdef CONFIG_IPV6_MULTIPLE_TABLES
|
||||
kfree(net->ipv6.ip6_prohibit_entry);
|
||||
@ -251,7 +251,7 @@ Signed-off-by: Jonas Gorski <jogo@openwrt.org>
|
||||
kfree(net->ipv6.ip6_blk_hole_entry);
|
||||
#endif
|
||||
dst_entries_destroy(&net->ipv6.ip6_dst_ops);
|
||||
@@ -6480,6 +6529,9 @@ void __init ip6_route_init_special_entri
|
||||
@@ -6481,6 +6530,9 @@ void __init ip6_route_init_special_entri
|
||||
init_net.ipv6.ip6_prohibit_entry->rt6i_idev = in6_dev_get(init_net.loopback_dev);
|
||||
init_net.ipv6.ip6_blk_hole_entry->dst.dev = init_net.loopback_dev;
|
||||
init_net.ipv6.ip6_blk_hole_entry->rt6i_idev = in6_dev_get(init_net.loopback_dev);
|
||||
|
@ -32,7 +32,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
|
||||
__u16 tc_index; /* traffic control index */
|
||||
--- a/net/core/dev.c
|
||||
+++ b/net/core/dev.c
|
||||
@@ -6067,6 +6067,9 @@ static enum gro_result dev_gro_receive(s
|
||||
@@ -6069,6 +6069,9 @@ static enum gro_result dev_gro_receive(s
|
||||
int same_flow;
|
||||
int grow;
|
||||
|
||||
@ -42,7 +42,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
|
||||
if (netif_elide_gro(skb->dev))
|
||||
goto normal;
|
||||
|
||||
@@ -8045,6 +8048,48 @@ static void __netdev_adjacent_dev_unlink
|
||||
@@ -8048,6 +8051,48 @@ static void __netdev_adjacent_dev_unlink
|
||||
&upper_dev->adj_list.lower);
|
||||
}
|
||||
|
||||
@ -91,7 +91,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
|
||||
static int __netdev_upper_dev_link(struct net_device *dev,
|
||||
struct net_device *upper_dev, bool master,
|
||||
void *upper_priv, void *upper_info,
|
||||
@@ -8096,6 +8141,7 @@ static int __netdev_upper_dev_link(struc
|
||||
@@ -8099,6 +8144,7 @@ static int __netdev_upper_dev_link(struc
|
||||
if (ret)
|
||||
return ret;
|
||||
|
||||
@ -99,7 +99,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
|
||||
ret = call_netdevice_notifiers_info(NETDEV_CHANGEUPPER,
|
||||
&changeupper_info.info);
|
||||
ret = notifier_to_errno(ret);
|
||||
@@ -8192,6 +8238,7 @@ static void __netdev_upper_dev_unlink(st
|
||||
@@ -8195,6 +8241,7 @@ static void __netdev_upper_dev_unlink(st
|
||||
|
||||
__netdev_adjacent_dev_unlink_neighbour(dev, upper_dev);
|
||||
|
||||
@ -107,7 +107,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
|
||||
call_netdevice_notifiers_info(NETDEV_CHANGEUPPER,
|
||||
&changeupper_info.info);
|
||||
|
||||
@@ -8978,6 +9025,7 @@ int dev_set_mac_address(struct net_devic
|
||||
@@ -8981,6 +9028,7 @@ int dev_set_mac_address(struct net_devic
|
||||
if (err)
|
||||
return err;
|
||||
dev->addr_assign_type = NET_ADDR_SET;
|
||||
|
@ -20,7 +20,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
|
||||
#include <linux/mfd/syscon.h>
|
||||
#include <linux/regmap.h>
|
||||
#include <linux/clk.h>
|
||||
@@ -832,7 +833,7 @@ static int mtk_init_fq_dma(struct mtk_et
|
||||
@@ -833,7 +834,7 @@ static int mtk_init_fq_dma(struct mtk_et
|
||||
dma_addr_t dma_addr;
|
||||
int i;
|
||||
|
||||
@ -29,7 +29,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
|
||||
cnt * sizeof(struct mtk_tx_dma),
|
||||
ð->phy_scratch_ring,
|
||||
GFP_ATOMIC);
|
||||
@@ -844,10 +845,10 @@ static int mtk_init_fq_dma(struct mtk_et
|
||||
@@ -845,10 +846,10 @@ static int mtk_init_fq_dma(struct mtk_et
|
||||
if (unlikely(!eth->scratch_head))
|
||||
return -ENOMEM;
|
||||
|
||||
@ -42,7 +42,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
|
||||
return -ENOMEM;
|
||||
|
||||
phy_ring_tail = eth->phy_scratch_ring +
|
||||
@@ -901,26 +902,26 @@ static void mtk_tx_unmap(struct mtk_eth
|
||||
@@ -902,26 +903,26 @@ static void mtk_tx_unmap(struct mtk_eth
|
||||
{
|
||||
if (MTK_HAS_CAPS(eth->soc->caps, MTK_QDMA)) {
|
||||
if (tx_buf->flags & MTK_TX_FLAGS_SINGLE0) {
|
||||
@ -73,7 +73,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
|
||||
dma_unmap_addr(tx_buf, dma_addr1),
|
||||
dma_unmap_len(tx_buf, dma_len1),
|
||||
DMA_TO_DEVICE);
|
||||
@@ -998,9 +999,9 @@ static int mtk_tx_map(struct sk_buff *sk
|
||||
@@ -999,9 +1000,9 @@ static int mtk_tx_map(struct sk_buff *sk
|
||||
if (skb_vlan_tag_present(skb))
|
||||
txd4 |= TX_DMA_INS_VLAN | skb_vlan_tag_get(skb);
|
||||
|
||||
@ -85,7 +85,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
|
||||
return -ENOMEM;
|
||||
|
||||
WRITE_ONCE(itxd->txd1, mapped_addr);
|
||||
@@ -1039,10 +1040,10 @@ static int mtk_tx_map(struct sk_buff *sk
|
||||
@@ -1040,10 +1041,10 @@ static int mtk_tx_map(struct sk_buff *sk
|
||||
|
||||
|
||||
frag_map_size = min(frag_size, MTK_TX_DMA_BUF_LEN);
|
||||
@ -98,7 +98,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
|
||||
goto err_dma;
|
||||
|
||||
if (i == nr_frags - 1 &&
|
||||
@@ -1323,18 +1324,18 @@ static int mtk_poll_rx(struct napi_struc
|
||||
@@ -1324,18 +1325,18 @@ static int mtk_poll_rx(struct napi_struc
|
||||
netdev->stats.rx_dropped++;
|
||||
goto release_desc;
|
||||
}
|
||||
@ -120,7 +120,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
|
||||
ring->buf_size, DMA_FROM_DEVICE);
|
||||
|
||||
/* receive data */
|
||||
@@ -1607,7 +1608,7 @@ static int mtk_tx_alloc(struct mtk_eth *
|
||||
@@ -1608,7 +1609,7 @@ static int mtk_tx_alloc(struct mtk_eth *
|
||||
if (!ring->buf)
|
||||
goto no_tx_mem;
|
||||
|
||||
@ -129,7 +129,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
|
||||
&ring->phys, GFP_ATOMIC);
|
||||
if (!ring->dma)
|
||||
goto no_tx_mem;
|
||||
@@ -1625,7 +1626,7 @@ static int mtk_tx_alloc(struct mtk_eth *
|
||||
@@ -1626,7 +1627,7 @@ static int mtk_tx_alloc(struct mtk_eth *
|
||||
* descriptors in ring->dma_pdma.
|
||||
*/
|
||||
if (!MTK_HAS_CAPS(eth->soc->caps, MTK_QDMA)) {
|
||||
@ -138,7 +138,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
|
||||
&ring->phys_pdma,
|
||||
GFP_ATOMIC);
|
||||
if (!ring->dma_pdma)
|
||||
@@ -1684,7 +1685,7 @@ static void mtk_tx_clean(struct mtk_eth
|
||||
@@ -1685,7 +1686,7 @@ static void mtk_tx_clean(struct mtk_eth
|
||||
}
|
||||
|
||||
if (ring->dma) {
|
||||
@ -147,7 +147,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
|
||||
MTK_DMA_SIZE * sizeof(*ring->dma),
|
||||
ring->dma,
|
||||
ring->phys);
|
||||
@@ -1692,7 +1693,7 @@ static void mtk_tx_clean(struct mtk_eth
|
||||
@@ -1693,7 +1694,7 @@ static void mtk_tx_clean(struct mtk_eth
|
||||
}
|
||||
|
||||
if (ring->dma_pdma) {
|
||||
@ -156,7 +156,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
|
||||
MTK_DMA_SIZE * sizeof(*ring->dma_pdma),
|
||||
ring->dma_pdma,
|
||||
ring->phys_pdma);
|
||||
@@ -1740,18 +1741,18 @@ static int mtk_rx_alloc(struct mtk_eth *
|
||||
@@ -1741,18 +1742,18 @@ static int mtk_rx_alloc(struct mtk_eth *
|
||||
return -ENOMEM;
|
||||
}
|
||||
|
||||
@ -178,7 +178,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
|
||||
return -ENOMEM;
|
||||
ring->dma[i].rxd1 = (unsigned int)dma_addr;
|
||||
|
||||
@@ -1787,7 +1788,7 @@ static void mtk_rx_clean(struct mtk_eth
|
||||
@@ -1788,7 +1789,7 @@ static void mtk_rx_clean(struct mtk_eth
|
||||
continue;
|
||||
if (!ring->dma[i].rxd1)
|
||||
continue;
|
||||
@ -187,7 +187,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
|
||||
ring->dma[i].rxd1,
|
||||
ring->buf_size,
|
||||
DMA_FROM_DEVICE);
|
||||
@@ -1798,7 +1799,7 @@ static void mtk_rx_clean(struct mtk_eth
|
||||
@@ -1799,7 +1800,7 @@ static void mtk_rx_clean(struct mtk_eth
|
||||
}
|
||||
|
||||
if (ring->dma) {
|
||||
@ -196,7 +196,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
|
||||
ring->dma_size * sizeof(*ring->dma),
|
||||
ring->dma,
|
||||
ring->phys);
|
||||
@@ -2154,7 +2155,7 @@ static void mtk_dma_free(struct mtk_eth
|
||||
@@ -2155,7 +2156,7 @@ static void mtk_dma_free(struct mtk_eth
|
||||
if (eth->netdev[i])
|
||||
netdev_reset_queue(eth->netdev[i]);
|
||||
if (eth->scratch_ring) {
|
||||
@ -205,7 +205,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
|
||||
MTK_DMA_SIZE * sizeof(struct mtk_tx_dma),
|
||||
eth->scratch_ring,
|
||||
eth->phy_scratch_ring);
|
||||
@@ -2506,6 +2507,8 @@ static void mtk_dim_tx(struct work_struc
|
||||
@@ -2507,6 +2508,8 @@ static void mtk_dim_tx(struct work_struc
|
||||
|
||||
static int mtk_hw_init(struct mtk_eth *eth)
|
||||
{
|
||||
@ -214,7 +214,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
|
||||
int i, val, ret;
|
||||
|
||||
if (test_and_set_bit(MTK_HW_INIT, ð->state))
|
||||
@@ -2518,6 +2521,10 @@ static int mtk_hw_init(struct mtk_eth *e
|
||||
@@ -2519,6 +2522,10 @@ static int mtk_hw_init(struct mtk_eth *e
|
||||
if (ret)
|
||||
goto err_disable_pm;
|
||||
|
||||
@ -225,7 +225,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
|
||||
if (MTK_HAS_CAPS(eth->soc->caps, MTK_SOC_MT7628)) {
|
||||
ret = device_reset(eth->dev);
|
||||
if (ret) {
|
||||
@@ -3067,6 +3074,35 @@ free_netdev:
|
||||
@@ -3068,6 +3075,35 @@ free_netdev:
|
||||
return err;
|
||||
}
|
||||
|
||||
@ -261,7 +261,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
|
||||
static int mtk_probe(struct platform_device *pdev)
|
||||
{
|
||||
struct device_node *mac_np;
|
||||
@@ -3080,6 +3116,7 @@ static int mtk_probe(struct platform_dev
|
||||
@@ -3081,6 +3117,7 @@ static int mtk_probe(struct platform_dev
|
||||
eth->soc = of_device_get_match_data(&pdev->dev);
|
||||
|
||||
eth->dev = &pdev->dev;
|
||||
@ -269,7 +269,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
|
||||
eth->base = devm_platform_ioremap_resource(pdev, 0);
|
||||
if (IS_ERR(eth->base))
|
||||
return PTR_ERR(eth->base);
|
||||
@@ -3128,6 +3165,16 @@ static int mtk_probe(struct platform_dev
|
||||
@@ -3129,6 +3166,16 @@ static int mtk_probe(struct platform_dev
|
||||
}
|
||||
}
|
||||
|
||||
@ -288,7 +288,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
|
||||
GFP_KERNEL);
|
||||
--- a/drivers/net/ethernet/mediatek/mtk_eth_soc.h
|
||||
+++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.h
|
||||
@@ -456,6 +456,12 @@
|
||||
@@ -457,6 +457,12 @@
|
||||
#define RSTCTRL_FE BIT(6)
|
||||
#define RSTCTRL_PPE BIT(31)
|
||||
|
||||
@ -301,7 +301,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
|
||||
/* SGMII subsystem config registers */
|
||||
/* Register to auto-negotiation restart */
|
||||
#define SGMSYS_PCS_CONTROL_1 0x0
|
||||
@@ -873,6 +879,7 @@ struct mtk_sgmii {
|
||||
@@ -874,6 +880,7 @@ struct mtk_sgmii {
|
||||
/* struct mtk_eth - This is the main datasructure for holding the state
|
||||
* of the driver
|
||||
* @dev: The device pointer
|
||||
@ -309,7 +309,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
|
||||
* @base: The mapped register i/o base
|
||||
* @page_lock: Make sure that register operations are atomic
|
||||
* @tx_irq__lock: Make sure that IRQ register operations are atomic
|
||||
@@ -916,6 +923,7 @@ struct mtk_sgmii {
|
||||
@@ -917,6 +924,7 @@ struct mtk_sgmii {
|
||||
|
||||
struct mtk_eth {
|
||||
struct device *dev;
|
||||
@ -317,7 +317,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
|
||||
void __iomem *base;
|
||||
spinlock_t page_lock;
|
||||
spinlock_t tx_irq_lock;
|
||||
@@ -1014,6 +1022,7 @@ int mtk_gmac_rgmii_path_setup(struct mtk
|
||||
@@ -1015,6 +1023,7 @@ int mtk_gmac_rgmii_path_setup(struct mtk
|
||||
int mtk_eth_offload_init(struct mtk_eth *eth);
|
||||
int mtk_eth_setup_tc(struct net_device *dev, enum tc_setup_type type,
|
||||
void *type_data);
|
||||
|
@ -19,7 +19,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
|
||||
interface-type = "ace";
|
||||
reg = <0x5000 0x1000>;
|
||||
};
|
||||
@@ -936,6 +936,8 @@
|
||||
@@ -937,6 +937,8 @@
|
||||
power-domains = <&scpsys MT7622_POWER_DOMAIN_ETHSYS>;
|
||||
mediatek,ethsys = <ðsys>;
|
||||
mediatek,sgmiisys = <&sgmiisys>;
|
||||
|
@ -56,7 +56,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
|
||||
|
||||
static int mtk_msg_level = -1;
|
||||
module_param_named(msg_level, mtk_msg_level, int, 0);
|
||||
@@ -3197,6 +3198,22 @@ static int mtk_probe(struct platform_dev
|
||||
@@ -3198,6 +3199,22 @@ static int mtk_probe(struct platform_dev
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -11,7 +11,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
|
||||
|
||||
--- a/arch/arm64/boot/dts/mediatek/mt7622.dtsi
|
||||
+++ b/arch/arm64/boot/dts/mediatek/mt7622.dtsi
|
||||
@@ -892,6 +892,11 @@
|
||||
@@ -893,6 +893,11 @@
|
||||
};
|
||||
};
|
||||
|
||||
@ -23,7 +23,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
|
||||
ethsys: syscon@1b000000 {
|
||||
compatible = "mediatek,mt7622-ethsys",
|
||||
"syscon";
|
||||
@@ -910,6 +915,26 @@
|
||||
@@ -911,6 +916,26 @@
|
||||
#dma-cells = <1>;
|
||||
};
|
||||
|
||||
@ -50,7 +50,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
|
||||
eth: ethernet@1b100000 {
|
||||
compatible = "mediatek,mt7622-eth",
|
||||
"mediatek,mt2701-eth",
|
||||
@@ -937,6 +962,9 @@
|
||||
@@ -938,6 +963,9 @@
|
||||
mediatek,ethsys = <ðsys>;
|
||||
mediatek,sgmiisys = <&sgmiisys>;
|
||||
mediatek,cci-control = <&cci_control2>;
|
||||
|
@ -10,7 +10,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
|
||||
|
||||
--- a/drivers/net/ethernet/mediatek/mtk_eth_soc.c
|
||||
+++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c
|
||||
@@ -2329,7 +2329,7 @@ static int mtk_open(struct net_device *d
|
||||
@@ -2330,7 +2330,7 @@ static int mtk_open(struct net_device *d
|
||||
return err;
|
||||
}
|
||||
|
||||
@ -19,7 +19,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
|
||||
gdm_config = MTK_GDMA_TO_PPE;
|
||||
|
||||
mtk_gdm_config(eth, gdm_config);
|
||||
@@ -2403,7 +2403,7 @@ static int mtk_stop(struct net_device *d
|
||||
@@ -2404,7 +2404,7 @@ static int mtk_stop(struct net_device *d
|
||||
mtk_dma_free(eth);
|
||||
|
||||
if (eth->soc->offload_version)
|
||||
@ -28,7 +28,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
|
||||
|
||||
return 0;
|
||||
}
|
||||
@@ -3289,10 +3289,11 @@ static int mtk_probe(struct platform_dev
|
||||
@@ -3290,10 +3290,11 @@ static int mtk_probe(struct platform_dev
|
||||
}
|
||||
|
||||
if (eth->soc->offload_version) {
|
||||
@ -45,7 +45,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
|
||||
if (err)
|
||||
--- a/drivers/net/ethernet/mediatek/mtk_eth_soc.h
|
||||
+++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.h
|
||||
@@ -976,7 +976,7 @@ struct mtk_eth {
|
||||
@@ -977,7 +977,7 @@ struct mtk_eth {
|
||||
u32 rx_dma_l4_valid;
|
||||
int ip_align;
|
||||
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user