Merge Official Source

Signed-off-by: Tianling Shen <cnsztl@immortalwrt.org>
This commit is contained in:
Tianling Shen 2025-04-14 14:41:22 +08:00
commit bec5211deb
No known key found for this signature in database
GPG Key ID: 6850B6345C862176
157 changed files with 7980 additions and 3005 deletions

View File

@ -1,2 +1,2 @@
LINUX_VERSION-6.6 = .85
LINUX_KERNEL_HASH-6.6.85 = 5ebaccf4ca3428cd26817bae62171f4efd270eed866a3e3d0a1d9e970b7b7529
LINUX_VERSION-6.6 = .87
LINUX_KERNEL_HASH-6.6.87 = 8957e5c2dacdbc47a16dbf1f6303ca7088409be6197a3881f752313275357ac6

View File

@ -290,8 +290,8 @@ ifeq ($(DUMP),1)
CPU_CFLAGS_archs = -mcpu=archs
endif
ifeq ($(ARCH),riscv64)
CPU_TYPE ?= riscv64
CPU_CFLAGS_riscv64:=-mabi=lp64d -march=rv64imafdc
CPU_TYPE ?= generic
CPU_CFLAGS_generic:=-mabi=lp64d -march=rv64gc
endif
ifeq ($(ARCH),loongarch64)
CPU_TYPE ?= generic

View File

@ -43,6 +43,7 @@ endef
define Trusted-Firmware-A/Default
BUILD_TARGET:=layerscape
BUILD_SUBTARGET:=armv8_64b
BUILD_DEVICES:=fsl_$(1)
DEPENDS:=+layerscape-rcw +u-boot-fsl_$(1)
endef

View File

@ -282,10 +282,10 @@
+bootcmd=run check_buttons ; if pstore check ; then run boot_recovery ; else run boot_ubi ; fi
+bootconf=config-1
+bootdelay=0
+bootfile=openwrt-mediatek-filogic-netis_nx31-initramfs-recovery.itb
+bootfile_bl2=openwrt-mediatek-filogic-netis_nx31-preloader.bin
+bootfile_fip=openwrt-mediatek-filogic-netis_nx31-bl31-uboot.fip
+bootfile_upg=openwrt-mediatek-filogic-netis_nx31-squashfs-sysupgrade.itb
+bootfile=immortalwrt-mediatek-filogic-netis_nx31-initramfs-recovery.itb
+bootfile_bl2=immortalwrt-mediatek-filogic-netis_nx31-preloader.bin
+bootfile_fip=immortalwrt-mediatek-filogic-netis_nx31-bl31-uboot.fip
+bootfile_upg=immortalwrt-mediatek-filogic-netis_nx31-squashfs-sysupgrade.itb
+bootled_status=blue:status
+bootmenu_confirm_return=askenv - Press ENTER to return to menu ; bootmenu 60
+bootmenu_default=0

View File

@ -146,6 +146,20 @@ define U-Boot/nanopi-r4se-rk3399
friendlyarm_nanopi-r4se
endef
define U-Boot/rock-4c-plus-rk3399
$(U-Boot/rk3399/Default)
NAME:=ROCK 4C+
BUILD_DEVICES:= \
radxa_rock-4c-plus
endef
define U-Boot/rock-4se-rk3399
$(U-Boot/rk3399/Default)
NAME:=ROCK 4SE
BUILD_DEVICES:= \
radxa_rock-4se
endef
define U-Boot/rock-pi-4-rk3399
$(U-Boot/rk3399/Default)
NAME:=ROCK Pi 4
@ -389,6 +403,8 @@ UBOOT_TARGETS := \
nanopc-t4-rk3399 \
nanopi-r4s-rk3399 \
nanopi-r4se-rk3399 \
rock-4c-plus-rk3399 \
rock-4se-rk3399 \
rock-pi-4-rk3399 \
rockpro64-rk3399 \
rock-pi-s-rk3308 \

View File

@ -119,6 +119,7 @@ gatonetworks,gdsp)
glinet,gl-mt3000)
ubootenv_add_uci_config "/dev/mtd1" "0x0" "0x80000" "0x20000"
;;
mercusys,mr80x-v3|\
mercusys,mr90x-v1|\
routerich,ax3000|\
tenbay,wr3000k|\

View File

@ -25,6 +25,8 @@ define Package/layerscape-fman
CATEGORY:=Firmware
TITLE:=NXP FMan ucode
DEPENDS:=@TARGET_layerscape
DEFAULT:=y if TARGET_layerscape_armv8_64b
HIDDEN:=1
endef
define Build/Compile

View File

@ -27,6 +27,8 @@ define Package/layerscape-ddr-phy
CATEGORY:=Firmware
TITLE:=NXP Layerscape DDR PHY firmware
DEPENDS:=@TARGET_layerscape
DEFAULT:=y if TARGET_layerscape_armv8_64b
HIDDEN:=1
endef
define Build/Compile

View File

@ -26,6 +26,8 @@ define Package/layerscape-dpl
CATEGORY:=Firmware
TITLE:=NXP DPL firmware
DEPENDS:=@TARGET_layerscape
DEFAULT:=y if TARGET_layerscape_armv8_64b
HIDDEN:=1
endef
MAKE_PATH:=config

View File

@ -25,6 +25,8 @@ define Package/layerscape-mc
CATEGORY:=Firmware
TITLE:=NXP MC firmware
DEPENDS:=@TARGET_layerscape
DEFAULT:=y if TARGET_layerscape_armv8_64b
HIDDEN:=1
endef
define Build/Compile

View File

@ -25,6 +25,8 @@ define Package/layerscape-rcw
CATEGORY:=Firmware
TITLE:=NXP Layerscape RCW binaries
DEPENDS:=@TARGET_layerscape
DEFAULT:=y if TARGET_layerscape_armv7
HIDDEN:=1
endef
BOARDS := \

View File

@ -5,3 +5,11 @@ define Package/ath12k-firmware-wcn7850/install
$(PKG_BUILD_DIR)/ath12k/WCN7850/hw2.0/* $(1)/lib/firmware/ath12k/WCN7850/hw2.0/
endef
$(eval $(call BuildPackage,ath12k-firmware-wcn7850))
Package/ath12k-firmware-qcn9274 = $(call Package/firmware-default,QCN9274 ath12k firmware)
define Package/ath12k-firmware-qcn9274/install
$(INSTALL_DIR) $(1)/lib/firmware/ath12k/QCN9274/hw2.0
$(INSTALL_DATA) \
$(PKG_BUILD_DIR)/ath12k/QCN9274/hw2.0/* $(1)/lib/firmware/ath12k/QCN9274/hw2.0/
endef
$(eval $(call BuildPackage,ath12k-firmware-qcn9274))

View File

@ -7,8 +7,7 @@ Rollback some APIs to fix compilation errors.
Signed-off-by: Shiji Yang <yangshiji66@outlook.com>
---
ath10k-6.14/ahb.c | 2 +-
ath10k-6.14/mac.c | 5 ++---
2 files changed, 3 insertions(+), 4 deletions(-)
1 files changed, 1 insertions(+), 1 deletions(-)
--- a/ath10k-6.14/ahb.c
+++ b/ath10k-6.14/ahb.c
@ -21,26 +20,3 @@ Signed-off-by: Shiji Yang <yangshiji66@outlook.com>
};
int ath10k_ahb_init(void)
--- a/ath10k-6.14/mac.c
+++ b/ath10k-6.14/mac.c
@@ -9607,10 +9607,9 @@ exit:
static void ath10k_sta_rc_update(struct ieee80211_hw *hw,
struct ieee80211_vif *vif,
- struct ieee80211_link_sta *link_sta,
+ struct ieee80211_sta *sta,
u32 changed)
{
- struct ieee80211_sta *sta = link_sta->sta;
struct ath10k *ar = hw->priv;
struct ath10k_sta *arsta = (struct ath10k_sta *)sta->drv_priv;
struct ath10k_vif *arvif = (void *)vif->drv_priv;
@@ -10603,7 +10602,7 @@ static const struct ieee80211_ops ath10k
.reconfig_complete = ath10k_reconfig_complete,
.get_survey = ath10k_get_survey,
.set_bitrate_mask = ath10k_mac_op_set_bitrate_mask,
- .link_sta_rc_update = ath10k_sta_rc_update,
+ .sta_rc_update = ath10k_sta_rc_update,
.offset_tsf = ath10k_offset_tsf,
.get_tsf = ath10k_get_tsf,
.ampdu_action = ath10k_ampdu_action,

View File

@ -35,9 +35,9 @@ define Package/bcm63xx-cfe/install
endef
define Build/InstallDev
rm -rf $(KERNEL_BUILD_DIR)/$(PKG_NAME)
mkdir -p $(KERNEL_BUILD_DIR)/$(PKG_NAME)
$(CP) -r $(PKG_BUILD_DIR)/* $(KERNEL_BUILD_DIR)/$(PKG_NAME)
rm -rf $(STAGING_DIR_IMAGE)/$(PKG_NAME)
mkdir -p $(STAGING_DIR_IMAGE)/$(PKG_NAME)
$(CP) -r $(PKG_BUILD_DIR)/* $(STAGING_DIR_IMAGE)/$(PKG_NAME)
endef
$(eval $(call BuildPackage,bcm63xx-cfe))

View File

@ -674,7 +674,7 @@ static void gpio_keys_irq_close(struct gpio_keys_button_dev *bdev)
}
}
static int gpio_keys_remove(struct platform_device *pdev)
static void gpio_keys_remove(struct platform_device *pdev)
{
struct gpio_keys_button_dev *bdev = platform_get_drvdata(pdev);
@ -684,13 +684,11 @@ static int gpio_keys_remove(struct platform_device *pdev)
gpio_keys_polled_close(bdev);
else
gpio_keys_irq_close(bdev);
return 0;
}
static struct platform_driver gpio_keys_driver = {
.probe = gpio_keys_probe,
.remove = gpio_keys_remove,
.remove_new = gpio_keys_remove,
.driver = {
.name = "gpio-keys",
.of_match_table = of_match_ptr(gpio_keys_of_match),
@ -699,7 +697,7 @@ static struct platform_driver gpio_keys_driver = {
static struct platform_driver gpio_keys_polled_driver = {
.probe = gpio_keys_polled_probe,
.remove = gpio_keys_remove,
.remove_new = gpio_keys_remove,
.driver = {
.name = "gpio-keys-polled",
.of_match_table = of_match_ptr(gpio_keys_polled_of_match),

View File

@ -2780,7 +2780,7 @@ static int ltq_mei_probe(struct platform_device *pdev)
return 0;
}
static int ltq_mei_remove(struct platform_device *pdev)
static void ltq_mei_remove(struct platform_device *pdev)
{
int i = 0;
int num;
@ -2794,7 +2794,6 @@ static int ltq_mei_remove(struct platform_device *pdev)
IFX_MEI_ExitDevice (i);
}
}
return 0;
}
static const struct of_device_id ltq_mei_match[] = {
@ -2804,7 +2803,7 @@ static const struct of_device_id ltq_mei_match[] = {
static struct platform_driver ltq_mei_driver = {
.probe = ltq_mei_probe,
.remove = ltq_mei_remove,
.remove_new = ltq_mei_remove,
.driver = {
.name = "lantiq,mei-xway",
.of_match_table = ltq_mei_match,

View File

@ -1865,7 +1865,7 @@ INIT_PRIV_DATA_FAIL:
return ret;
}
static int ltq_atm_remove(struct platform_device *pdev)
static void ltq_atm_remove(struct platform_device *pdev)
{
int port_num;
struct ltq_atm_ops *ops = platform_get_drvdata(pdev);
@ -1885,13 +1885,11 @@ static int ltq_atm_remove(struct platform_device *pdev)
ops->shutdown();
clear_priv_data();
return 0;
}
static struct platform_driver ltq_atm_driver = {
.probe = ltq_atm_probe,
.remove = ltq_atm_remove,
.remove_new = ltq_atm_remove,
.driver = {
.name = "atm",
.of_match_table = ltq_atm_match,

View File

@ -143,7 +143,7 @@ static int ltq_deu_probe(struct platform_device *pdev)
* \ingroup IFX_DEU_FUNCTIONS
* \brief remove the loaded crypto algorithms
*/
static int ltq_deu_remove(struct platform_device *pdev)
static void ltq_deu_remove(struct platform_device *pdev)
{
//#ifdef CONFIG_CRYPTO_DEV_PWR_SAVE_MODE
#if defined(CONFIG_CRYPTO_DEV_DES)
@ -168,8 +168,6 @@ static int ltq_deu_remove(struct platform_device *pdev)
ifxdeu_fini_md5_hmac ();
#endif
printk("DEU has exited successfully\n");
return 0;
}
@ -193,7 +191,7 @@ MODULE_DEVICE_TABLE(of, ltq_deu_match);
static struct platform_driver ltq_deu_driver = {
.probe = ltq_deu_probe,
.remove = ltq_deu_remove,
.remove_new = ltq_deu_remove,
.driver = {
.name = "deu",
.of_match_table = ltq_deu_match,

View File

@ -1566,7 +1566,7 @@ INIT_PRIV_DATA_FAIL:
* Output:
* none
*/
static int ltq_ptm_remove(struct platform_device *pdev)
static void ltq_ptm_remove(struct platform_device *pdev)
{
int i;
@ -1591,13 +1591,11 @@ static int ltq_ptm_remove(struct platform_device *pdev)
ifx_ptm_uninit_chip();
clear_priv_data();
return 0;
}
static struct platform_driver ltq_ptm_driver = {
.probe = ltq_ptm_probe,
.remove = ltq_ptm_remove,
.remove_new = ltq_ptm_remove,
.driver = {
.name = "ptm",
.of_match_table = ltq_ptm_match,

View File

@ -1079,7 +1079,7 @@ INIT_PRIV_DATA_FAIL:
return ret;
}
static int ltq_ptm_remove(struct platform_device *pdev)
static void ltq_ptm_remove(struct platform_device *pdev)
{
int i;
ifx_mei_atm_showtime_enter = NULL;
@ -1103,8 +1103,6 @@ static int ltq_ptm_remove(struct platform_device *pdev)
ifx_ptm_uninit_chip();
clear_priv_data();
return 0;
}
#ifndef MODULE
@ -1135,7 +1133,7 @@ static int __init queue_gamma_map_setup(char *line)
#endif
static struct platform_driver ltq_ptm_driver = {
.probe = ltq_ptm_probe,
.remove = ltq_ptm_remove,
.remove_new = ltq_ptm_remove,
.driver = {
.name = "ptm",
.of_match_table = ltq_ptm_match,

View File

@ -658,7 +658,7 @@ $(eval $(call KernelPackage,dsa-realtek))
define KernelPackage/dsa-rtl8366rb
SUBMENU:=$(NETWORK_DEVICES_MENU)
TITLE:=Realtek RTL8365MB switch DSA support
TITLE:=Realtek RTL8366RB switch DSA support
DEPENDS:=+kmod-dsa-realtek @!TARGET_x86 @!TARGET_bcm47xx @!TARGET_uml
KCONFIG:= \
CONFIG_NET_DSA_REALTEK_RTL8366RB \

View File

@ -538,7 +538,7 @@ $(eval $(call KernelPackage,usb-dwc3-octeon))
define KernelPackage/usb-dwc3-qcom
TITLE:=DWC3 Qualcomm USB driver
DEPENDS:=@(TARGET_ipq40xx||TARGET_ipq806x||TARGET_qualcommax) +kmod-usb-dwc3
DEPENDS:=@(TARGET_ipq40xx||TARGET_ipq806x||TARGET_qualcommax||TARGET_qualcommbe) +kmod-usb-dwc3
KCONFIG:= CONFIG_USB_DWC3_QCOM
FILES:= $(LINUX_DIR)/drivers/usb/dwc3/dwc3-qcom.ko
AUTOLOAD:=$(call AutoLoad,53,dwc3-qcom,1)

View File

@ -1,6 +1,6 @@
--- a/drivers/net/wireless/ath/ath10k/mac.c
+++ b/drivers/net/wireless/ath/ath10k/mac.c
@@ -9919,6 +9919,21 @@ static int ath10k_mac_init_rd(struct ath
@@ -9920,6 +9920,21 @@ static int ath10k_mac_init_rd(struct ath
return 0;
}
@ -22,7 +22,7 @@
int ath10k_mac_register(struct ath10k *ar)
{
static const u32 cipher_suites[] = {
@@ -10281,6 +10296,12 @@ int ath10k_mac_register(struct ath10k *a
@@ -10282,6 +10297,12 @@ int ath10k_mac_register(struct ath10k *a
ar->hw->weight_multiplier = ATH10K_AIRTIME_WEIGHT_MULTIPLIER;

View File

@ -40,7 +40,7 @@ Signed-off-by: Mathias Kresin <dev@kresin.me>
if (ret)
--- a/drivers/net/wireless/ath/ath10k/mac.c
+++ b/drivers/net/wireless/ath/ath10k/mac.c
@@ -10297,7 +10297,7 @@ int ath10k_mac_register(struct ath10k *a
@@ -10298,7 +10298,7 @@ int ath10k_mac_register(struct ath10k *a
ar->hw->weight_multiplier = ATH10K_AIRTIME_WEIGHT_MULTIPLIER;
#ifdef CPTCFG_MAC80211_LEDS

View File

@ -41,7 +41,7 @@ Signed-off-by: Ziyang Huang <hzyitc@outlook.com>
}
} else {
ab->qmi.target_mem[idx].paddr = 0;
@@ -2292,6 +2296,7 @@ static int ath11k_qmi_load_file_target_m
@@ -2295,6 +2299,7 @@ static int ath11k_qmi_load_file_target_m
struct qmi_wlanfw_bdf_download_resp_msg_v01 resp;
struct qmi_txn txn;
const u8 *temp = data;
@ -49,7 +49,7 @@ Signed-off-by: Ziyang Huang <hzyitc@outlook.com>
void __iomem *bdf_addr = NULL;
int ret = 0;
u32 remaining = len;
@@ -2303,7 +2308,9 @@ static int ath11k_qmi_load_file_target_m
@@ -2306,7 +2311,9 @@ static int ath11k_qmi_load_file_target_m
memset(&resp, 0, sizeof(resp));
if (ab->hw_params.fixed_bdf_addr) {

View File

@ -91,9 +91,9 @@ Signed-off-by: George Moussalem <george.moussalem@outlook.com>
#endif /* _HIF_H_ */
--- a/drivers/net/wireless/ath/ath11k/qmi.c
+++ b/drivers/net/wireless/ath/ath11k/qmi.c
@@ -2184,6 +2184,8 @@ static int ath11k_qmi_request_device_inf
ab->mem = bar_addr_va;
ab->mem_len = resp.bar_size;
@@ -2187,6 +2187,8 @@ static int ath11k_qmi_request_device_inf
if (!ab->hw_params.ce_remap)
ab->mem_ce = ab->mem;
+ ath11k_hif_config_static_window(ab);
+

View File

@ -89,7 +89,7 @@ Signed-off-by: George Moussalem <george.moussalem@outlook.com>
/* SMBIOS type containing Board Data File Name Extension */
#define ATH11K_SMBIOS_BDF_EXT_TYPE 0xF8
@@ -945,6 +948,7 @@ struct ath11k_base {
@@ -951,6 +954,7 @@ struct ath11k_base {
struct list_head peers;
wait_queue_head_t peer_mapping_wq;
u8 mac_addr[ETH_ALEN];

View File

@ -132,7 +132,7 @@ Signed-off-by: Sriram R <srirrama@codeaurora.org>
};
/* HTT definitions */
@@ -1712,5 +1718,6 @@ void ath11k_dp_shadow_init_timer(struct
@@ -1689,5 +1695,6 @@ void ath11k_dp_shadow_init_timer(struct
struct ath11k_hp_update_timer *update_timer,
u32 interval, u32 ring_id);
void ath11k_dp_stop_shadow_timers(struct ath11k_base *ab);

View File

@ -532,7 +532,7 @@ Acked-by: Jeff Johnson <quic_jjohnson@quicinc.com>
return ret;
}
@@ -5994,7 +6009,7 @@ static int ath12k_mac_start(struct ath12
@@ -5995,7 +6010,7 @@ static int ath12k_mac_start(struct ath12
/* TODO: Do we need to enable ANI? */
@ -541,7 +541,7 @@ Acked-by: Jeff Johnson <quic_jjohnson@quicinc.com>
ar->num_started_vdevs = 0;
ar->num_created_vdevs = 0;
@@ -6174,6 +6189,9 @@ static void ath12k_mac_stop(struct ath12
@@ -6175,6 +6190,9 @@ static void ath12k_mac_stop(struct ath12
cancel_delayed_work_sync(&ar->scan.timeout);
cancel_work_sync(&ar->regd_update_work);
cancel_work_sync(&ar->ab->rfkill_work);
@ -551,7 +551,7 @@ Acked-by: Jeff Johnson <quic_jjohnson@quicinc.com>
spin_lock_bh(&ar->data_lock);
list_for_each_entry_safe(ppdu_stats, tmp, &ar->ppdu_stats_info, list) {
@@ -6420,6 +6438,117 @@ static void ath12k_mac_op_update_vif_off
@@ -6421,6 +6439,117 @@ static void ath12k_mac_op_update_vif_off
ath12k_mac_update_vif_offload(arvif);
}
@ -669,7 +669,7 @@ Acked-by: Jeff Johnson <quic_jjohnson@quicinc.com>
static int ath12k_mac_vdev_create(struct ath12k *ar, struct ieee80211_vif *vif)
{
struct ath12k_hw *ah = ar->ah;
@@ -6534,6 +6663,7 @@ static int ath12k_mac_vdev_create(struct
@@ -6535,6 +6664,7 @@ static int ath12k_mac_vdev_create(struct
arvif->vdev_id, ret);
goto err_peer_del;
}
@ -677,7 +677,7 @@ Acked-by: Jeff Johnson <quic_jjohnson@quicinc.com>
break;
case WMI_VDEV_TYPE_STA:
param_id = WMI_STA_PS_PARAM_RX_WAKE_POLICY;
@@ -6572,6 +6702,13 @@ static int ath12k_mac_vdev_create(struct
@@ -6573,6 +6703,13 @@ static int ath12k_mac_vdev_create(struct
arvif->vdev_id, ret);
goto err_peer_del;
}
@ -691,7 +691,7 @@ Acked-by: Jeff Johnson <quic_jjohnson@quicinc.com>
break;
default:
break;
@@ -6912,6 +7049,11 @@ static void ath12k_mac_op_remove_interfa
@@ -6913,6 +7050,11 @@ static void ath12k_mac_op_remove_interfa
ath12k_dbg(ab, ATH12K_DBG_MAC, "mac remove interface (vdev %d)\n",
arvif->vdev_id);
@ -703,7 +703,7 @@ Acked-by: Jeff Johnson <quic_jjohnson@quicinc.com>
if (arvif->vdev_type == WMI_VDEV_TYPE_AP) {
ret = ath12k_peer_delete(ar, arvif->vdev_id, vif->addr);
if (ret)
@@ -7752,6 +7894,14 @@ ath12k_mac_op_unassign_vif_chanctx(struc
@@ -7753,6 +7895,14 @@ ath12k_mac_op_unassign_vif_chanctx(struc
ar->num_started_vdevs == 1 && ar->monitor_vdev_created)
ath12k_mac_monitor_stop(ar);
@ -718,7 +718,7 @@ Acked-by: Jeff Johnson <quic_jjohnson@quicinc.com>
mutex_unlock(&ar->conf_mutex);
}
@@ -8290,6 +8440,14 @@ ath12k_mac_op_reconfig_complete(struct i
@@ -8291,6 +8441,14 @@ ath12k_mac_op_reconfig_complete(struct i
ath12k_warn(ar->ab, "pdev %d successfully recovered\n",
ar->pdev->pdev_id);
@ -733,7 +733,7 @@ Acked-by: Jeff Johnson <quic_jjohnson@quicinc.com>
if (ab->is_reset) {
recovery_count = atomic_inc_return(&ab->recovery_count);
@@ -9339,6 +9497,9 @@ static void ath12k_mac_setup(struct ath1
@@ -9340,6 +9498,9 @@ static void ath12k_mac_setup(struct ath1
INIT_WORK(&ar->wmi_mgmt_tx_work, ath12k_mgmt_over_wmi_tx_work);
skb_queue_head_init(&ar->wmi_mgmt_tx_queue);

View File

@ -0,0 +1,67 @@
From 24f587572acf7509127dbdfcbf1b681ef84eeba0 Mon Sep 17 00:00:00 2001
From: Aaradhana Sahu <quic_aarasahu@quicinc.com>
Date: Thu, 16 Jan 2025 08:58:35 +0530
Subject: [PATCH] wifi: ath12k: Fetch regdb.bin file from board-2.bin
Currently, ath12k_core_fetch_regdb() finds regdb.bin file through
board id's but in board-2.bin file regdb.bin file is present with
default board id because of which regdb.bin is not fetched.
Add support to fetch regdb.bin file from board-2.bin through
default board id.
Tested-on: QCN9274 hw2.0 PCI WLAN.WBE.1.3.1-00173-QCAHKSWPL_SILICONZ-1
Signed-off-by: Aaradhana Sahu <quic_aarasahu@quicinc.com>
Reviewed-by: Aditya Kumar Singh <quic_adisi@quicinc.com>
Link: https://patch.msgid.link/20250116032835.118397-1-quic_aarasahu@quicinc.com
Signed-off-by: Jeff Johnson <jeff.johnson@oss.qualcomm.com>
---
drivers/net/wireless/ath/ath12k/core.c | 12 +++++++-----
1 file changed, 7 insertions(+), 5 deletions(-)
--- a/drivers/net/wireless/ath/ath12k/core.c
+++ b/drivers/net/wireless/ath/ath12k/core.c
@@ -161,7 +161,7 @@ EXPORT_SYMBOL(ath12k_core_resume);
static int __ath12k_core_create_board_name(struct ath12k_base *ab, char *name,
size_t name_len, bool with_variant,
- bool bus_type_mode)
+ bool bus_type_mode, bool with_default)
{
/* strlen(',variant=') + strlen(ab->qmi.target.bdf_ext) */
char variant[9 + ATH12K_QMI_BDF_EXT_STR_LENGTH] = { 0 };
@@ -192,7 +192,9 @@ static int __ath12k_core_create_board_na
"bus=%s,qmi-chip-id=%d,qmi-board-id=%d%s",
ath12k_bus_str(ab->hif.bus),
ab->qmi.target.chip_id,
- ab->qmi.target.board_id, variant);
+ with_default ?
+ ATH12K_BOARD_ID_DEFAULT : ab->qmi.target.board_id,
+ variant);
break;
}
@@ -204,19 +206,19 @@ static int __ath12k_core_create_board_na
static int ath12k_core_create_board_name(struct ath12k_base *ab, char *name,
size_t name_len)
{
- return __ath12k_core_create_board_name(ab, name, name_len, true, false);
+ return __ath12k_core_create_board_name(ab, name, name_len, true, false, false);
}
static int ath12k_core_create_fallback_board_name(struct ath12k_base *ab, char *name,
size_t name_len)
{
- return __ath12k_core_create_board_name(ab, name, name_len, false, false);
+ return __ath12k_core_create_board_name(ab, name, name_len, false, false, true);
}
static int ath12k_core_create_bus_type_board_name(struct ath12k_base *ab, char *name,
size_t name_len)
{
- return __ath12k_core_create_board_name(ab, name, name_len, false, true);
+ return __ath12k_core_create_board_name(ab, name, name_len, false, true, true);
}
const struct firmware *ath12k_core_firmware_request(struct ath12k_base *ab,

View File

@ -0,0 +1,153 @@
From patchwork Mon Mar 10 13:28:18 2025
Content-Type: text/plain; charset="utf-8"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
X-Patchwork-Submitter: Mantas <mantas@8devices.com>
X-Patchwork-Id: 14010032
X-Patchwork-Delegate: quic_jjohnson@quicinc.com
Received: from mail-lf1-f41.google.com (mail-lf1-f41.google.com
[209.85.167.41])
(using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits))
(No client certificate requested)
by smtp.subspace.kernel.org (Postfix) with ESMTPS id 2ADD522A4DA
for <linux-wireless@vger.kernel.org>; Mon, 10 Mar 2025 13:28:47 +0000 (UTC)
Authentication-Results: smtp.subspace.kernel.org;
arc=none smtp.client-ip=209.85.167.41
ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116;
t=1741613330; cv=none;
b=Vx8zckt7S92zrauuzzoNjX/1eXhlbq+4R3uNXCWPCBFXXHBuAHrmXrDOQILh1g+IfyWOgpyXyibTTkLg6IWREXcA/OjV+V9ehNaQaHJAt4D14uxuNW6uIDA56myF+bhdmiZnfGZfK3puVBjeCAMbZwGhc81dTR3RaEhKYP93Wcg=
ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org;
s=arc-20240116; t=1741613330; c=relaxed/simple;
bh=yRMCaDQnvsF6vQ/w9rLRB/etZre1sSzpWUDTNGX0zAk=;
h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:To:Cc;
b=rFopB9f+nOXbmGbGXoo4SeBAV82xQ6nydiMDCiYAw7sELURejS0lK9xQZolnRGeyNtHnQgix39lrcilr6cdvGMhaziXzS6RYlY2WyoHTMxHwYGUIa9McnJ1AkCczdVv6SgeNUlVVEgAZBqH0Q2pmd5b91h/PMc/aPdQm9SQY8IU=
ARC-Authentication-Results: i=1; smtp.subspace.kernel.org;
dmarc=pass (p=quarantine dis=none) header.from=8devices.com;
spf=pass smtp.mailfrom=8devices.com;
dkim=pass (2048-bit key) header.d=8devices.com header.i=@8devices.com
header.b=LitRbtOU; arc=none smtp.client-ip=209.85.167.41
Authentication-Results: smtp.subspace.kernel.org;
dmarc=pass (p=quarantine dis=none) header.from=8devices.com
Authentication-Results: smtp.subspace.kernel.org;
spf=pass smtp.mailfrom=8devices.com
Authentication-Results: smtp.subspace.kernel.org;
dkim=pass (2048-bit key) header.d=8devices.com header.i=@8devices.com
header.b="LitRbtOU"
Received: by mail-lf1-f41.google.com with SMTP id
2adb3069b0e04-5499c5d9691so1866539e87.2
for <linux-wireless@vger.kernel.org>;
Mon, 10 Mar 2025 06:28:47 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
d=8devices.com; s=8devices; t=1741613326; x=1742218126;
darn=vger.kernel.org;
h=cc:to:message-id:content-transfer-encoding:mime-version:subject
:date:from:from:to:cc:subject:date:message-id:reply-to;
bh=6+w3029kfHch5SeD/z0zur2K64cd98za9hhmN/ji0MY=;
b=LitRbtOUxDhUPycKFo/pzuJu9Y11QmpYSvOmkgM9TcNEOsBvLk8z0EJ7+xy24ijRGJ
Xz16V9Z1kJGkXBK90klI6s3RjVBQf+dxf37t2kdQWdrgOE2VhXjnnV5zP7odCkMmOViw
2UmKSvagsxc6KojE2OYyd+vR3hmL+4fCtegorXMaRrf0Brje8XJmViAUgbc+IAtfL0Ao
pnig300fAb4WbnmIJIRiOUKoTESjbJRkUehGJkhe1ztiPE1F86AVMXw5IrDBR/WtMin1
9nYYDqfSGvI7fOvfStfZ9hS0ShIhBNd5naccyQ7c0xSTvXJ51vUvNvdZuufm9OKsbQ99
nh4g==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
d=1e100.net; s=20230601; t=1741613326; x=1742218126;
h=cc:to:message-id:content-transfer-encoding:mime-version:subject
:date:from:x-gm-message-state:from:to:cc:subject:date:message-id
:reply-to;
bh=6+w3029kfHch5SeD/z0zur2K64cd98za9hhmN/ji0MY=;
b=Gx+AX3aIV66kzjGLGOToc2CuQrnfaWn43yZW2rgRpKJv03162undTbo+SdaI8s+8mY
aKrYsNOOqI4h6pHCZsVkBzqVh5ZOs+xJbJaHEETGzyBYA2sy0bdDwDUr0rIzJUD8ZYiw
736zfMRE2rxfOLoVIcfBLXMUcR2d63n/4wxgr1s5HVV3o8uEZ5gxNDnz5p/QabiWbT3m
AMSVVaOBUTRnd9GcZhzYfKboT7SNrTJz0emqSWPKCWfm8dYIzH3TuIGULfRu5UA1/Y2H
Q6ZbLmcYu5+VDKCtQl4nSmun3WUNAyPoeg5PCB1YcuCpqKcjU8l5Kkn+JxNjYAG432us
Z5xQ==
X-Forwarded-Encrypted: i=1;
AJvYcCVigvWgctGNxtYGpBtNhTPBpQPHa7l14ZVktj/Oe1W8p1xwSIjIViAk2X3sDC23bbrmI41TVZbgJZDGCMFJ6g==@vger.kernel.org
X-Gm-Message-State: AOJu0YxJFjAixTwr8dSwTYmdvbVzm/jbyVk+gQV6pF/9Vep5xeVdJMWa
TE+4MHJDPdO8dA16Yn/y5c8pLBEYKqRlo8uDHNKV6e5ldbv18Xv6bR163j+rVCQ=
X-Gm-Gg: ASbGncsUwV1fquQPNOfmTge/yCSzRhyC7+A8STTBe3n+C2XDK1UV8IswQL5UEXlb268
mumVPzu1Ex8+Nh+quKWT+CIR3WR0NRXm1oiG0N+Cu2Mm4cm4mipqrV9Yxd6x5OMsG32XKd6r0iQ
gr7joJETyo6k1TGc6i0LyoIabLOCc7Nkeu7BD+URUnBvoeQyXBdJpX0bbdvANKW5DrUeX1GkUA7
0o4dZYtRola31Z1W9xZMdSefhmI4zZE4uy/RyR/FkQq2Zqk9FGct8DOKoHpOPa0DHVMy0lQAiNI
KNg6OYtuJY+/6TpDoZzNpooiLi29WL6hqlpkmlZeluuCBG6HlSbZTQ==
X-Google-Smtp-Source:
AGHT+IGIixTut4yqDWp69RPz6EjMMq4lD94Ez1yhsRnow6NgvTk6WmKPLFavYgOJC+xGczTQmaocLw==
X-Received: by 2002:a05:6512:1112:b0:549:5850:f275 with SMTP id
2adb3069b0e04-54990ec8e60mr4354451e87.50.1741613326121;
Mon, 10 Mar 2025 06:28:46 -0700 (PDT)
Received: from [127.0.1.1] ([78.62.132.154])
by smtp.gmail.com with ESMTPSA id
2adb3069b0e04-5498b1bcaecsm1460408e87.200.2025.03.10.06.28.45
(version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
Mon, 10 Mar 2025 06:28:45 -0700 (PDT)
From: Mantas Pucka <mantas@8devices.com>
Date: Mon, 10 Mar 2025 15:28:18 +0200
Subject: [PATCH ath-next] wifi: ath12k: limit WMI_SCAN_CHAN_LIST_CMDID
argument size
Precedence: bulk
X-Mailing-List: linux-wireless@vger.kernel.org
List-Id: <linux-wireless.vger.kernel.org>
List-Subscribe: <mailto:linux-wireless+subscribe@vger.kernel.org>
List-Unsubscribe: <mailto:linux-wireless+unsubscribe@vger.kernel.org>
MIME-Version: 1.0
Message-Id: <20250310-limit-wmi-chanlist-v1-1-8f0fb45459a7@8devices.com>
X-B4-Tracking: v=1; b=H4sIAPHozmcC/x2MSwqEMBAFryK9tiGJ+MGriIuMtvpAM0MSHEG8u
9FNQVG8d1IQDwnUZid52RHwdUl0ntGwWDcLY0xORplSFVrxig2R/xv46StCZF0Pn2Y0ibaiNPx
5mXC8px3ZuLCTI1J/XTfUqQSebgAAAA==
X-Change-ID: 20250310-limit-wmi-chanlist-17cb8d27cba6
To: ath12k@lists.infradead.org
Cc: Johannes Berg <johannes@sipsolutions.net>,
Jeff Johnson <jjohnson@kernel.org>, linux-wireless@vger.kernel.org,
linux-kernel@vger.kernel.org, Mantas Pucka <mantas@8devices.com>
X-Mailer: b4 0.14.2
When using BDF with both 5GHz and 6GHz bands enabled on QCN9274, interface
fails to start. It happens because FW fails to process
WMI_SCAN_CHAN_LIST_CMDID with argument size >2048, resulting in a command
timeout. The current code allows splitting channel list across multiple WMI
commands but uses WMI max_msg_len (4096) as chunk size, which is still too
large.
Fix this by limiting the number of channels sent at once, using the value
specified in WMI interface description [1].
[1] https://git.codelinaro.org/clo/qsdk/platform/vendor/qcom-opensource/wlan/fw-api/-/blob/NHSS.QSDK.13.0.0.6/fw/wmi_unified.h#L6459
Tested-on: QCN9274 hw2.0 PCI WLAN.WBE.1.4.1-00199-QCAHKSWPL_SILICONZ-1
Signed-off-by: Mantas Pucka <mantas@8devices.com>
---
drivers/net/wireless/ath/ath12k/wmi.c | 3 +++
drivers/net/wireless/ath/ath12k/wmi.h | 2 ++
2 files changed, 5 insertions(+)
---
base-commit: 42aa76e608ca845c98e79f9e23af0bdb07b2eb1d
change-id: 20250310-limit-wmi-chanlist-17cb8d27cba6
Best regards,
--- a/drivers/net/wireless/ath/ath12k/wmi.c
+++ b/drivers/net/wireless/ath/ath12k/wmi.c
@@ -2558,6 +2558,9 @@ int ath12k_wmi_send_scan_chan_list_cmd(s
max_chan_limit = (wmi->wmi_ab->max_msg_len[ar->pdev_idx] - len) /
sizeof(*chan_info);
+ if (max_chan_limit > WMI_MAX_NUM_CHAN_PER_WMI_CMD)
+ max_chan_limit = WMI_MAX_NUM_CHAN_PER_WMI_CMD;
+
num_send_chans = min(arg->nallchans, max_chan_limit);
arg->nallchans -= num_send_chans;
--- a/drivers/net/wireless/ath/ath12k/wmi.h
+++ b/drivers/net/wireless/ath/ath12k/wmi.h
@@ -3743,6 +3743,8 @@ struct wmi_stop_scan_cmd {
__le32 pdev_id;
} __packed;
+#define WMI_MAX_NUM_CHAN_PER_WMI_CMD 58
+
struct ath12k_wmi_scan_chan_list_arg {
u32 pdev_id;
u16 nallchans;

View File

@ -0,0 +1,137 @@
From patchwork Thu Mar 13 09:00:56 2025
Content-Type: text/plain; charset="utf-8"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
X-Patchwork-Submitter: Mantas <mantas@8devices.com>
X-Patchwork-Id: 14014575
X-Patchwork-Delegate: quic_jjohnson@quicinc.com
Received: from mail-lf1-f49.google.com (mail-lf1-f49.google.com
[209.85.167.49])
(using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits))
(No client certificate requested)
by smtp.subspace.kernel.org (Postfix) with ESMTPS id F210C2641F0
for <linux-wireless@vger.kernel.org>; Thu, 13 Mar 2025 09:01:28 +0000 (UTC)
Authentication-Results: smtp.subspace.kernel.org;
arc=none smtp.client-ip=209.85.167.49
ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116;
t=1741856491; cv=none;
b=CeFjBZstZXxg4oQQPPON0u0Mw9kvUaCubWSfpcWvN2italvlwccDBr+izqIzCXwxYaoAedVR6iHEQv+LBtIHOsMWHOCI9E6jYAPqjbEUEU0RMdvujKLVFvFXYR4UaRDAMzDGMlFF1qc0pY0sYR4FYfFBBQOarHn2sjZ/csIyj4k=
ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org;
s=arc-20240116; t=1741856491; c=relaxed/simple;
bh=oLhlWw1tOovRHEGC4gsbi6BHKYXLNDYOrtVP3tTS5nE=;
h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:To:Cc;
b=baAfN8drFOEwQR9LVuWoVsd3jkMbQECK7Zuc68EzbbJwM4Zb0tbziTk1vvqED+f9JPOMbjRyjvV1hvy3svqZr7OuTZJdSM41D+DsbHvw0jEhaRlKwzpLWuOn9lu56ahcAsvx4A4JRawEK90smoYpejhxkdlSrxqRBh1ey3RwmQU=
ARC-Authentication-Results: i=1; smtp.subspace.kernel.org;
dmarc=pass (p=quarantine dis=none) header.from=8devices.com;
spf=pass smtp.mailfrom=8devices.com;
dkim=pass (2048-bit key) header.d=8devices.com header.i=@8devices.com
header.b=FdBxu3P+; arc=none smtp.client-ip=209.85.167.49
Authentication-Results: smtp.subspace.kernel.org;
dmarc=pass (p=quarantine dis=none) header.from=8devices.com
Authentication-Results: smtp.subspace.kernel.org;
spf=pass smtp.mailfrom=8devices.com
Authentication-Results: smtp.subspace.kernel.org;
dkim=pass (2048-bit key) header.d=8devices.com header.i=@8devices.com
header.b="FdBxu3P+"
Received: by mail-lf1-f49.google.com with SMTP id
2adb3069b0e04-54943bb8006so648002e87.0
for <linux-wireless@vger.kernel.org>;
Thu, 13 Mar 2025 02:01:28 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
d=8devices.com; s=8devices; t=1741856487; x=1742461287;
darn=vger.kernel.org;
h=cc:to:message-id:content-transfer-encoding:mime-version:subject
:date:from:from:to:cc:subject:date:message-id:reply-to;
bh=uj7GGUjO2Cb2hoHrzMda/fIIQwFl12ddzGuw5jrHW8M=;
b=FdBxu3P+gf3qNd4jxSOCYUJ1meLFYAm0ou6lnEyomeeXDBFwITM6FM0cgBdXgmkLWZ
ZKowNImwE9FKqNGxpg2tZ4obR9aM7HzzkxV3TE+1aIiocbr/5xyXQU+/AUvaM3vui/8d
SFiwhX9FwFKdrYi1Og4XFD2aBhA5Fzp0U27grJYGTLchEfkr9Om43y3vZ7w2ENEBU0SO
7NFmSwx7BmflIybP2sGCUzjacGQzzec0zz256EY7GpZH9r19jgWiCe1YGWdlxDaRhWze
xV4okbZKydpYlUU/qGsgn23cRQuFCvMobvfkmTwsGYwlN4bAzq/cHw83YEFrUzYOngZK
z7bg==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
d=1e100.net; s=20230601; t=1741856487; x=1742461287;
h=cc:to:message-id:content-transfer-encoding:mime-version:subject
:date:from:x-gm-message-state:from:to:cc:subject:date:message-id
:reply-to;
bh=uj7GGUjO2Cb2hoHrzMda/fIIQwFl12ddzGuw5jrHW8M=;
b=PhLIANoGtdl34d9fFH7uxPyg1K5yPGRwimsWPVhHon98V9QP64+qUbifocbfojxz8u
NEVzhOx0kfmsmkBxUzuRCu6xuTAF8LmjBpAJJxo3/4nqY67np8iZt/MITzx6egbMOUAs
txqj0rzXwr55N/9yAD/QuD6bBcd8PcNMPp0CjFAt39AyK6De3BEIcA7b/eLoY3lifaxJ
9U5ZZ/dHXwSIr9xuE1EB6pT5FbHcI8iWJTDJ8NdBcmWC8qtGAAMzlzWqHU0nOAJEjwEc
T+oaJr8fTAgq4B5OvS1cNClscZHvoM3zlIoczwPPoBZCtUi2gThz9R4BrBxepdoZl1qq
NZQA==
X-Forwarded-Encrypted: i=1;
AJvYcCUSbJyRkEPLa3fw7FZX3Ci6+/o8dqI0hd6pkVT20pi6Ufgze7nBQXa+qdK3OM5Ng2TFBrym8JoyBo//MwDHng==@vger.kernel.org
X-Gm-Message-State: AOJu0Ywjzq2sFNyTMNPyxDt+721RyXdLbDPrF5PY3LnwpKaTfduyXkMF
K/7N3Cpb/71aQsMXwmIbXAOGeLVWLBQHdYnQLZlsCTjVNArIjgiX7tNB0Mq56+qYtR9PdMrBAt8
m
X-Gm-Gg: ASbGncvDd0SdjhjPfzaKTXW4e0hclZuKu4pZ4d0XD5/Q6dnv09ZObgGjJbIRrAhYizp
zWc8CwidDk8UYPX/OhiAyDhS4XRKRy2QG03sZh17aHDhishhmCE+mcqe+YUM+F4ns/05sAR2MeP
wu/Rz6NS6UD4ihGNReTORGB3X4n9I5dgdNheFyqbrRX+Js4zXuvn1jgoEWawfovOu/4HAlnv+7p
1ufgXBXJGVj6+OGzyNOyYloTB/Csok3zU9yBfrU+G19mpGaF86t/6yxmUIXCO+cWfbu2GIhVZp3
RmSiDo/spnsvtYVGCPc6v9jALz83YcknTLkX8u+08AOkJKK7Mh8rKlCvbfZcB355
X-Google-Smtp-Source:
AGHT+IE2NulrNIo+M5vahinpDWyI9BdSgzdREdo+l0AN7HhcxOd01ZBOpT3HYFht1EVpKj5T7Edrrw==
X-Received: by 2002:a05:6512:ba6:b0:549:8f21:bc0e with SMTP id
2adb3069b0e04-54990eb1987mr9398593e87.32.1741856486697;
Thu, 13 Mar 2025 02:01:26 -0700 (PDT)
Received: from [127.0.1.1] ([78.62.132.154])
by smtp.gmail.com with ESMTPSA id
2adb3069b0e04-549ba88591csm142134e87.187.2025.03.13.02.01.25
(version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
Thu, 13 Mar 2025 02:01:25 -0700 (PDT)
From: Mantas Pucka <mantas@8devices.com>
Date: Thu, 13 Mar 2025 11:00:56 +0200
Subject: [PATCH] wifi: ath12k: fix 5GHz operation on wideband QCN9274
radios
Precedence: bulk
X-Mailing-List: linux-wireless@vger.kernel.org
List-Id: <linux-wireless.vger.kernel.org>
List-Subscribe: <mailto:linux-wireless+subscribe@vger.kernel.org>
List-Unsubscribe: <mailto:linux-wireless+unsubscribe@vger.kernel.org>
MIME-Version: 1.0
Message-Id: <20250313-ath12-wideband-caps-v1-1-23ac4247cd8a@8devices.com>
X-B4-Tracking: v=1; b=H4sIAMee0mcC/x3MQQqAIBBA0avErBvIsUi6SrSwHGs2FhoVhHdPW
r7F/y8kjsIJhuqFyJck2UOBqitYNhtWRnHFQA11jVYa7bkpwlsczzY4XOyRkNqZjOqNcZ6hlEd
kL89/HaecP+zWjGtlAAAA
X-Change-ID: 20250313-ath12-wideband-caps-24b281788dfe
To: ath12k@lists.infradead.org
Cc: Johannes Berg <johannes@sipsolutions.net>,
Jeff Johnson <jjohnson@kernel.org>, linux-wireless@vger.kernel.org,
linux-kernel@vger.kernel.org, Mantas Pucka <mantas@8devices.com>
X-Mailer: b4 0.14.2
Currently ath12k_mac_setup_ht_vht_cap() incorrectly assumes that QCN9274
radios with 6GHz band can't support 5GHz as well. This prevents the
addition of HT and VHT capabilities for the 5GHz band. Since QCN9274 is
capable of operating in multiple bands, remove the 6GHz support check and
exception for single_pdev_only (i.e. WCN7850).
Tested-on: QCN9274 hw2.0 PCI WLAN.WBE.1.4.1-00199-QCAHKSWPL_SILICONZ-1
Signed-off-by: Mantas Pucka <mantas@8devices.com>
---
drivers/net/wireless/ath/ath12k/mac.c | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)
---
base-commit: 42aa76e608ca845c98e79f9e23af0bdb07b2eb1d
change-id: 20250313-ath12-wideband-caps-24b281788dfe
Best regards,
--- a/drivers/net/wireless/ath/ath12k/mac.c
+++ b/drivers/net/wireless/ath/ath12k/mac.c
@@ -5185,9 +5185,7 @@ static void ath12k_mac_setup_ht_vht_cap(
rate_cap_rx_chainmask);
}
- if (cap->supported_bands & WMI_HOST_WLAN_5G_CAP &&
- (ar->ab->hw_params->single_pdev_only ||
- !ar->supports_6ghz)) {
+ if (cap->supported_bands & WMI_HOST_WLAN_5G_CAP) {
band = &ar->mac.sbands[NL80211_BAND_5GHZ];
ht_cap = cap->band[NL80211_BAND_5GHZ].ht_cap_info;
if (ht_cap_info)

View File

@ -0,0 +1,469 @@
From patchwork Wed Sep 18 21:20:48 2024
Content-Type: text/plain; charset="utf-8"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
X-Patchwork-Submitter: Pradeep Kumar Chitrapu <quic_pradeepc@quicinc.com>
X-Patchwork-Id: 13807212
X-Patchwork-Delegate: quic_jjohnson@quicinc.com
Received: from mx0a-0031df01.pphosted.com (mx0a-0031df01.pphosted.com
[205.220.168.131])
(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
(No client certificate requested)
by smtp.subspace.kernel.org (Postfix) with ESMTPS id A06681CA6B9
for <linux-wireless@vger.kernel.org>; Wed, 18 Sep 2024 21:21:13 +0000 (UTC)
Authentication-Results: smtp.subspace.kernel.org;
arc=none smtp.client-ip=205.220.168.131
ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116;
t=1726694475; cv=none;
b=HjUnHV2ZbMRZne/OD71kC1p0zBs+1+LVanM+3YbUfCnjvvtSry2r0Dj0HBjHnId1ltZw0ebTJaEZDcXBybkc2yiiGRlcH5s4feXisp9WApElGptz2Qn1SEtO3VDLKyE5m56eJftK/dpin6HPZGOk3hMBHkxoo966Jp4vlC9e2rY=
ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org;
s=arc-20240116; t=1726694475; c=relaxed/simple;
bh=lJX5iM2Ahf/ROaeR2Kk4suhcbwA47aOSPqyQsesg4A0=;
h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References:
MIME-Version:Content-Type;
b=RYEWdi9+UZKYtzHKfAF5xdIOkpdgQjBK8hE1SX/f0rJDxozjZe1jDY28C+kzN4uhSwcBSwr7pZjMLL8LELNITE6fIk/zDY5UAO/jdeUPBnTrmrckzZOwaCFIQ1nt6ssDZDfpJADBjCIuMXB7HNChH3qSMlmYTV9QTDxpBK0fQxM=
ARC-Authentication-Results: i=1; smtp.subspace.kernel.org;
dmarc=pass (p=none dis=none) header.from=quicinc.com;
spf=pass smtp.mailfrom=quicinc.com;
dkim=pass (2048-bit key) header.d=quicinc.com header.i=@quicinc.com
header.b=EtpV59A6; arc=none smtp.client-ip=205.220.168.131
Authentication-Results: smtp.subspace.kernel.org;
dmarc=pass (p=none dis=none) header.from=quicinc.com
Authentication-Results: smtp.subspace.kernel.org;
spf=pass smtp.mailfrom=quicinc.com
Authentication-Results: smtp.subspace.kernel.org;
dkim=pass (2048-bit key) header.d=quicinc.com header.i=@quicinc.com
header.b="EtpV59A6"
Received: from pps.filterd (m0279862.ppops.net [127.0.0.1])
by mx0a-0031df01.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id
48IL3WbX003099;
Wed, 18 Sep 2024 21:21:07 GMT
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=quicinc.com; h=
cc:content-transfer-encoding:content-type:date:from:in-reply-to
:message-id:mime-version:references:subject:to; s=qcppdkim1; bh=
3ukRiLVgAcc9GoJxAaFrgsHYImZ/9ZPgSlMf75Ew/1Y=; b=EtpV59A6K8yD5o5B
8JSYPL7TI2tnIQciUmyLNJig3DWGn3AZbFqPjgTYUgoQLHjsNWd+WRAKx13tQhSW
peq0OW9986uI1TFVpaw0pwVXoBiStEI5MH/7ThiA5nIAI4hYBI6+iiwL7qWpboSL
UrG9sWI35wsgcjedTtrzR2QfpeTAvlnReoac/49o5GAysu1oGDN79VAAP7tDZbO2
trx/XdQmW/8iqtRR3Idhjcod6B6ovXKkmAZUHzhp4zRupTUsKOU84X3aTYZQLN/B
46HuFZSlOJEB/63Co7I2K8YfQT3FikP2mkrIsDwH78Y2OekhXJWFe7dU4SsX6nh6
sIXVxA==
Received: from nalasppmta04.qualcomm.com (Global_NAT1.qualcomm.com
[129.46.96.20])
by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 41n4gd387e-1
(version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT);
Wed, 18 Sep 2024 21:21:07 +0000 (GMT)
Received: from nalasex01a.na.qualcomm.com (nalasex01a.na.qualcomm.com
[10.47.209.196])
by NALASPPMTA04.qualcomm.com (8.18.1.2/8.18.1.2) with ESMTPS id
48ILL6rr020545
(version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT);
Wed, 18 Sep 2024 21:21:06 GMT
Received: from ath12k-linux1.qualcomm.com (10.80.80.8) by
nalasex01a.na.qualcomm.com (10.47.209.196) with Microsoft SMTP Server
(version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id
15.2.1544.9; Wed, 18 Sep 2024 14:21:06 -0700
From: Pradeep Kumar Chitrapu <quic_pradeepc@quicinc.com>
To: <ath12k@lists.infradead.org>
CC: <linux-wireless@vger.kernel.org>,
Pradeep Kumar Chitrapu
<quic_pradeepc@quicinc.com>,
Muna Sinada <quic_msinada@quicinc.com>,
"Jeff
Johnson" <quic_jjohnson@quicinc.com>
Subject: [PATCH V8 1/9] wifi: ath12k: push HE MU-MIMO params to hardware
Date: Wed, 18 Sep 2024 14:20:48 -0700
Message-ID: <20240918212056.4137076-2-quic_pradeepc@quicinc.com>
X-Mailer: git-send-email 2.34.1
In-Reply-To: <20240918212056.4137076-1-quic_pradeepc@quicinc.com>
References: <20240918212056.4137076-1-quic_pradeepc@quicinc.com>
Precedence: bulk
X-Mailing-List: linux-wireless@vger.kernel.org
List-Id: <linux-wireless.vger.kernel.org>
List-Subscribe: <mailto:linux-wireless+subscribe@vger.kernel.org>
List-Unsubscribe: <mailto:linux-wireless+unsubscribe@vger.kernel.org>
MIME-Version: 1.0
X-ClientProxiedBy: nasanex01a.na.qualcomm.com (10.52.223.231) To
nalasex01a.na.qualcomm.com (10.47.209.196)
X-QCInternal: smtphost
X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=5800
signatures=585085
X-Proofpoint-ORIG-GUID: QTgqLsl2p5OGLwWEQsGrsmA8q68U11H8
X-Proofpoint-GUID: QTgqLsl2p5OGLwWEQsGrsmA8q68U11H8
X-Proofpoint-Virus-Version: vendor=baseguard
engine=ICAP:2.0.293,Aquarius:18.0.1039,Hydra:6.0.680,FMLib:17.12.60.29
definitions=2024-09-06_09,2024-09-06_01,2024-09-02_01
X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0
malwarescore=0 suspectscore=0
bulkscore=0 clxscore=1015 spamscore=0 adultscore=0 lowpriorityscore=0
mlxlogscore=999 impostorscore=0 mlxscore=0 priorityscore=1501 phishscore=0
classifier=spam adjust=0 reason=mlx scancount=1 engine=8.19.0-2408220000
definitions=main-2409180140
Currently, only the HE IE in management frames is updated with
respect to MU-MIMO configurations, but this change is not
reflected in the hardware. Add support to propagate MU-MIMO
configurations to the hardware as well.
Tested-on: QCN9274 hw2.0 PCI WLAN.WBE.1.0.1-00029-QCAHKSWPL_SILICONZ-1
Co-developed-by: Muna Sinada <quic_msinada@quicinc.com>
Signed-off-by: Muna Sinada <quic_msinada@quicinc.com>
Signed-off-by: Pradeep Kumar Chitrapu <quic_pradeepc@quicinc.com>
Acked-by: Jeff Johnson <quic_jjohnson@quicinc.com>
---
drivers/net/wireless/ath/ath12k/mac.c | 215 +++++++++++++++++---------
drivers/net/wireless/ath/ath12k/mac.h | 15 ++
drivers/net/wireless/ath/ath12k/wmi.h | 28 +---
3 files changed, 156 insertions(+), 102 deletions(-)
--- a/drivers/net/wireless/ath/ath12k/mac.c
+++ b/drivers/net/wireless/ath/ath12k/mac.c
@@ -2851,6 +2851,108 @@ static int ath12k_setup_peer_smps(struct
ath12k_smps_map[smps]);
}
+static int ath12k_mac_set_he_txbf_conf(struct ath12k_vif *arvif)
+{
+ struct ath12k *ar = arvif->ar;
+ u32 param = WMI_VDEV_PARAM_SET_HEMU_MODE;
+ u32 value = 0;
+ int ret;
+
+ if (!arvif->vif->bss_conf.he_support)
+ return 0;
+
+ if (arvif->vif->bss_conf.he_su_beamformer) {
+ value |= u32_encode_bits(HE_SU_BFER_ENABLE, HE_MODE_SU_TX_BFER);
+ if (arvif->vif->bss_conf.he_mu_beamformer &&
+ arvif->vdev_type == WMI_VDEV_TYPE_AP)
+ value |= u32_encode_bits(HE_MU_BFER_ENABLE, HE_MODE_MU_TX_BFER);
+ }
+
+ if (arvif->vif->type != NL80211_IFTYPE_MESH_POINT) {
+ value |= u32_encode_bits(HE_DL_MUOFDMA_ENABLE, HE_MODE_DL_OFDMA) |
+ u32_encode_bits(HE_UL_MUOFDMA_ENABLE, HE_MODE_UL_OFDMA);
+
+ if (arvif->vif->bss_conf.he_full_ul_mumimo)
+ value |= u32_encode_bits(HE_UL_MUMIMO_ENABLE, HE_MODE_UL_MUMIMO);
+
+ if (arvif->vif->bss_conf.he_su_beamformee)
+ value |= u32_encode_bits(HE_SU_BFEE_ENABLE, HE_MODE_SU_TX_BFEE);
+ }
+
+ ret = ath12k_wmi_vdev_set_param_cmd(ar, arvif->vdev_id, param, value);
+ if (ret) {
+ ath12k_warn(ar->ab, "failed to set vdev %d HE MU mode: %d\n",
+ arvif->vdev_id, ret);
+ return ret;
+ }
+
+ param = WMI_VDEV_PARAM_SET_HE_SOUNDING_MODE;
+ value = u32_encode_bits(HE_VHT_SOUNDING_MODE_ENABLE, HE_VHT_SOUNDING_MODE) |
+ u32_encode_bits(HE_TRIG_NONTRIG_SOUNDING_MODE_ENABLE,
+ HE_TRIG_NONTRIG_SOUNDING_MODE);
+ ret = ath12k_wmi_vdev_set_param_cmd(ar, arvif->vdev_id,
+ param, value);
+ if (ret) {
+ ath12k_warn(ar->ab, "failed to set vdev %d sounding mode: %d\n",
+ arvif->vdev_id, ret);
+ return ret;
+ }
+
+ return 0;
+}
+
+static int ath12k_mac_vif_recalc_sta_he_txbf(struct ath12k *ar,
+ struct ieee80211_vif *vif,
+ struct ieee80211_sta_he_cap *he_cap,
+ int *hemode)
+{
+ struct ieee80211_he_cap_elem he_cap_elem = {};
+ struct ieee80211_sta_he_cap *cap_band;
+ struct cfg80211_chan_def def;
+
+ if (!vif->bss_conf.he_support)
+ return 0;
+
+ if (vif->type != NL80211_IFTYPE_STATION)
+ return -EINVAL;
+
+ if (WARN_ON(ath12k_mac_vif_chan(vif, &def)))
+ return -EINVAL;
+
+ 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));
+
+ *hemode = 0;
+ 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 |= u32_encode_bits(HE_SU_BFEE_ENABLE, HE_MODE_SU_TX_BFEE);
+ if (HECAP_PHY_MUBFMR_GET(he_cap->he_cap_elem.phy_cap_info))
+ *hemode |= u32_encode_bits(HE_MU_BFEE_ENABLE, HE_MODE_MU_TX_BFEE);
+ }
+
+ if (vif->type != NL80211_IFTYPE_MESH_POINT) {
+ *hemode |= u32_encode_bits(HE_DL_MUOFDMA_ENABLE, HE_MODE_DL_OFDMA) |
+ u32_encode_bits(HE_UL_MUOFDMA_ENABLE, HE_MODE_UL_OFDMA);
+
+ 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 |= u32_encode_bits(HE_UL_MUMIMO_ENABLE,
+ HE_MODE_UL_MUMIMO);
+
+ if (u32_get_bits(*hemode, HE_MODE_MU_TX_BFEE))
+ *hemode |= u32_encode_bits(HE_SU_BFEE_ENABLE, HE_MODE_SU_TX_BFEE);
+
+ if (u32_get_bits(*hemode, HE_MODE_MU_TX_BFER))
+ *hemode |= u32_encode_bits(HE_SU_BFER_ENABLE, HE_MODE_SU_TX_BFER);
+ }
+
+ return 0;
+}
+
static void ath12k_bss_assoc(struct ath12k *ar,
struct ath12k_vif *arvif,
struct ieee80211_bss_conf *bss_conf)
@@ -2858,9 +2960,11 @@ static void ath12k_bss_assoc(struct ath1
struct ieee80211_vif *vif = arvif->vif;
struct ath12k_wmi_vdev_up_params params = {};
struct ath12k_wmi_peer_assoc_arg peer_arg;
+ struct ieee80211_sta_he_cap he_cap;
struct ieee80211_sta *ap_sta;
struct ath12k_peer *peer;
bool is_auth = false;
+ u32 hemode = 0;
int ret;
lockdep_assert_held(&ar->conf_mutex);
@@ -2880,8 +2984,29 @@ static void ath12k_bss_assoc(struct ath1
ath12k_peer_assoc_prepare(ar, vif, ap_sta, &peer_arg, false);
+ /* he_cap here is updated at assoc success for sta mode only */
+ he_cap = ap_sta->deflink.he_cap;
+
+ /* ap_sta->deflink.he_cap must be protected by rcu_read_lock */
+ ret = ath12k_mac_vif_recalc_sta_he_txbf(ar, vif, &he_cap, &hemode);
+ if (ret) {
+ ath12k_warn(ar->ab, "failed to recalc he txbf for vdev %i on bss %pM: %d\n",
+ arvif->vdev_id, bss_conf->bssid, ret);
+ rcu_read_unlock();
+ return;
+ }
+
rcu_read_unlock();
+ /* keep this before ath12k_wmi_send_peer_assoc_cmd() */
+ ret = ath12k_wmi_vdev_set_param_cmd(ar, arvif->vdev_id,
+ WMI_VDEV_PARAM_SET_HEMU_MODE, hemode);
+ if (ret) {
+ ath12k_warn(ar->ab, "failed to submit vdev param txbf 0x%x: %d\n",
+ hemode, ret);
+ return;
+ }
+
ret = ath12k_wmi_send_peer_assoc_cmd(ar, &peer_arg);
if (ret) {
ath12k_warn(ar->ab, "failed to run peer assoc for %pM vdev %i: %d\n",
@@ -3220,6 +3345,13 @@ static void ath12k_mac_bss_info_changed(
ether_addr_copy(arvif->bssid, info->bssid);
if (changed & BSS_CHANGED_BEACON_ENABLED) {
+ if (info->enable_beacon) {
+ ret = ath12k_mac_set_he_txbf_conf(arvif);
+ if (ret)
+ ath12k_warn(ar->ab,
+ "failed to set HE TXBF config for vdev: %d\n",
+ arvif->vdev_id);
+ }
ath12k_control_beaconing(arvif, info);
if (arvif->is_up && vif->bss_conf.he_support &&
@@ -5351,11 +5483,14 @@ static void ath12k_mac_copy_he_cap(struc
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_40MHZ_IN_2G |
+ IEEE80211_HE_PHY_CAP0_CHANNEL_WIDTH_SET_40MHZ_80MHZ_IN_5G |
+ 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;
- he_cap_elem->phy_cap_info[5] &=
- ~IEEE80211_HE_PHY_CAP5_BEAMFORMEE_NUM_SND_DIM_ABOVE_80MHZ_MASK;
he_cap_elem->phy_cap_info[5] |= num_tx_chains - 1;
switch (iftype) {
@@ -6317,71 +6452,6 @@ static int ath12k_mac_setup_vdev_create_
return 0;
}
-static u32
-ath12k_mac_prepare_he_mode(struct ath12k_pdev *pdev, u32 viftype)
-{
- struct ath12k_pdev_cap *pdev_cap = &pdev->cap;
- struct ath12k_band_cap *cap_band = NULL;
- u32 *hecap_phy_ptr = NULL;
- u32 hemode;
-
- 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 = u32_encode_bits(HE_SU_BFEE_ENABLE, HE_MODE_SU_TX_BFEE) |
- u32_encode_bits(HECAP_PHY_SUBFMR_GET(hecap_phy_ptr),
- HE_MODE_SU_TX_BFER) |
- u32_encode_bits(HECAP_PHY_ULMUMIMO_GET(hecap_phy_ptr),
- HE_MODE_UL_MUMIMO);
-
- /* TODO: WDS and other modes */
- if (viftype == NL80211_IFTYPE_AP) {
- hemode |= u32_encode_bits(HECAP_PHY_MUBFMR_GET(hecap_phy_ptr),
- HE_MODE_MU_TX_BFER) |
- u32_encode_bits(HE_DL_MUOFDMA_ENABLE, HE_MODE_DL_OFDMA) |
- u32_encode_bits(HE_UL_MUOFDMA_ENABLE, HE_MODE_UL_OFDMA);
- } else {
- hemode |= u32_encode_bits(HE_MU_BFEE_ENABLE, HE_MODE_MU_TX_BFEE);
- }
-
- return hemode;
-}
-
-static int ath12k_set_he_mu_sounding_mode(struct ath12k *ar,
- struct ath12k_vif *arvif)
-{
- u32 param_id, param_value;
- struct ath12k_base *ab = ar->ab;
- int ret;
-
- param_id = WMI_VDEV_PARAM_SET_HEMU_MODE;
- param_value = ath12k_mac_prepare_he_mode(ar->pdev, arvif->vif->type);
- ret = ath12k_wmi_vdev_set_param_cmd(ar, arvif->vdev_id,
- param_id, param_value);
- if (ret) {
- ath12k_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 =
- u32_encode_bits(HE_VHT_SOUNDING_MODE_ENABLE, HE_VHT_SOUNDING_MODE) |
- u32_encode_bits(HE_TRIG_NONTRIG_SOUNDING_MODE_ENABLE,
- HE_TRIG_NONTRIG_SOUNDING_MODE);
- ret = ath12k_wmi_vdev_set_param_cmd(ar, arvif->vdev_id,
- param_id, param_value);
- if (ret) {
- ath12k_warn(ab, "failed to set vdev %d HE MU mode: %d\n",
- arvif->vdev_id, ret);
- return ret;
- }
- return ret;
-}
-
static void ath12k_mac_update_vif_offload(struct ath12k_vif *arvif)
{
struct ieee80211_vif *vif = arvif->vif;
@@ -7339,7 +7409,6 @@ ath12k_mac_vdev_start_restart(struct ath
struct ath12k_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;
lockdep_assert_held(&ar->conf_mutex);
@@ -7395,14 +7464,6 @@ ath12k_mac_vdev_start_restart(struct ath
spin_unlock_bh(&ab->base_lock);
/* TODO: Notify if secondary 80Mhz also needs radar detection */
- if (he_support) {
- ret = ath12k_set_he_mu_sounding_mode(ar, arvif);
- if (ret) {
- ath12k_warn(ar->ab, "failed to set he mode vdev %i\n",
- arg.vdev_id);
- return ret;
- }
- }
}
arg.passive |= !!(chandef->chan->flags & IEEE80211_CHAN_NO_IR);
--- a/drivers/net/wireless/ath/ath12k/mac.h
+++ b/drivers/net/wireless/ath/ath12k/mac.h
@@ -41,6 +41,21 @@ struct ath12k_generic_iter {
#define ATH12K_TX_POWER_MAX_VAL 70
#define ATH12K_TX_POWER_MIN_VAL 0
+#define HECAP_PHY_SUBFMR_GET(hecap_phy) \
+ u8_get_bits(hecap_phy[3], IEEE80211_HE_PHY_CAP3_SU_BEAMFORMER)
+
+#define HECAP_PHY_SUBFME_GET(hecap_phy) \
+ u8_get_bits(hecap_phy[4], IEEE80211_HE_PHY_CAP4_SU_BEAMFORMEE)
+
+#define HECAP_PHY_MUBFMR_GET(hecap_phy) \
+ u8_get_bits(hecap_phy[4], IEEE80211_HE_PHY_CAP4_MU_BEAMFORMER)
+
+#define HECAP_PHY_ULMUMIMO_GET(hecap_phy) \
+ u8_get_bits(hecap_phy[2], IEEE80211_HE_PHY_CAP2_UL_MU_FULL_MU_MIMO)
+
+#define HECAP_PHY_ULOFDMA_GET(hecap_phy) \
+ u8_get_bits(hecap_phy[2], IEEE80211_HE_PHY_CAP2_UL_MU_PARTIAL_MU_MIMO)
+
enum ath12k_supported_bw {
ATH12K_BW_20 = 0,
ATH12K_BW_40 = 1,
--- a/drivers/net/wireless/ath/ath12k/wmi.h
+++ b/drivers/net/wireless/ath/ath12k/wmi.h
@@ -2995,31 +2995,6 @@ struct ath12k_wmi_rx_reorder_queue_remov
#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 HECAP_PHY_SU_BFER BIT(31)
-#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_SUBFMR_GET(hecap_phy) \
- u32_get_bits(hecap_phy[HECAP_PHYDWORD_0], HECAP_PHY_SU_BFER)
-
-#define HECAP_PHY_SUBFME_GET(hecap_phy) \
- u32_get_bits(hecap_phy[HECAP_PHYDWORD_1], HECAP_PHY_SU_BFEE)
-
-#define HECAP_PHY_MUBFMR_GET(hecap_phy) \
- u32_get_bits(hecap_phy[HECAP_PHYDWORD_1], HECAP_PHY_MU_BFER)
-
-#define HECAP_PHY_ULMUMIMO_GET(hecap_phy) \
- u32_get_bits(hecap_phy[HECAP_PHYDWORD_0], HECAP_PHY_UL_MUMIMO)
-
-#define HECAP_PHY_ULOFDMA_GET(hecap_phy) \
- u32_get_bits(hecap_phy[HECAP_PHYDWORD_0], HECAP_PHY_UL_MUOFDMA)
-
#define HE_MODE_SU_TX_BFEE BIT(0)
#define HE_MODE_SU_TX_BFER BIT(1)
#define HE_MODE_MU_TX_BFEE BIT(2)
@@ -3031,8 +3006,11 @@ struct ath12k_wmi_rx_reorder_queue_remov
#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

View File

@ -0,0 +1,222 @@
From patchwork Wed Sep 18 21:20:49 2024
Content-Type: text/plain; charset="utf-8"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
X-Patchwork-Submitter: Pradeep Kumar Chitrapu <quic_pradeepc@quicinc.com>
X-Patchwork-Id: 13807210
X-Patchwork-Delegate: quic_jjohnson@quicinc.com
Received: from mx0a-0031df01.pphosted.com (mx0a-0031df01.pphosted.com
[205.220.168.131])
(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
(No client certificate requested)
by smtp.subspace.kernel.org (Postfix) with ESMTPS id B81C317967F
for <linux-wireless@vger.kernel.org>; Wed, 18 Sep 2024 21:21:12 +0000 (UTC)
Authentication-Results: smtp.subspace.kernel.org;
arc=none smtp.client-ip=205.220.168.131
ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116;
t=1726694474; cv=none;
b=SYN3tI9xaTiXuxK7CUAD6gXBOqoyS1qZxAGNOXDt4yS1Q6oU0YiwQonIkVrnux7/DC3bCm2JScN5vIxVzkGOkFztaIHlZMM/TRsp6GzSIbZdasVpxySumoe965kRna+5fYAmf4i3wJupfj9p6509u7j6kXzz1ZxlSStR4wLObcE=
ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org;
s=arc-20240116; t=1726694474; c=relaxed/simple;
bh=yQPaApb7knqLxhkxSrizMfAanw18TDUbxBPbfnhzlV0=;
h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References:
MIME-Version:Content-Type;
b=W+Rk8/tiKUvP6A8WYQFxi97//4Yj4m/rYPXAg0YP+6K+GXDcFK2VD+yEzmymA/fsenli+7ZEJ1zH6XgzLe4+1QFctCYGnq1LPoD01a4AIF8VqJGVdgs6e1ZwCKv8AOLkZUb09QkmM8Ur4R1xFhc4oVqhlvm3NMc24NERWmxzGjI=
ARC-Authentication-Results: i=1; smtp.subspace.kernel.org;
dmarc=pass (p=none dis=none) header.from=quicinc.com;
spf=pass smtp.mailfrom=quicinc.com;
dkim=pass (2048-bit key) header.d=quicinc.com header.i=@quicinc.com
header.b=XJxqlj7h; arc=none smtp.client-ip=205.220.168.131
Authentication-Results: smtp.subspace.kernel.org;
dmarc=pass (p=none dis=none) header.from=quicinc.com
Authentication-Results: smtp.subspace.kernel.org;
spf=pass smtp.mailfrom=quicinc.com
Authentication-Results: smtp.subspace.kernel.org;
dkim=pass (2048-bit key) header.d=quicinc.com header.i=@quicinc.com
header.b="XJxqlj7h"
Received: from pps.filterd (m0279867.ppops.net [127.0.0.1])
by mx0a-0031df01.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id
48IHKWuA006417;
Wed, 18 Sep 2024 21:21:08 GMT
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=quicinc.com; h=
cc:content-transfer-encoding:content-type:date:from:in-reply-to
:message-id:mime-version:references:subject:to; s=qcppdkim1; bh=
hcoreX5pgczyblwh1gpL6Ax4OV0yrVpAaKX7psGXczI=; b=XJxqlj7hhoW4GYMB
+B9r7ajbqV+ZxP+/1uDt5veOBY8aQgsorBoEbZFKm+ccV0u5SQJ/fFSomLg8QYpE
iojXUyYsGJMsXSPW+OdC0DQ2JrhDEHWFQa/6c3C0sdBE5IGgTa8YiAmYAx/A1ti1
ruMNSyT8H/xEKkR953axz1DOGJZfp9dCtOM5Xw6nrqpeUEYBShgvQ+1LLXqrH8U4
qUlYW2vKFKJgZUe97nwRrwOiunhTD4M2ARe6xHqZ7bL+2bW27sRTSI69vGrcEdKM
Ied7A8KmlUAN5BBsOj5MeKAaoy0+h4iY/9W3JgDfOu+LwjuAaKzgPNrttmPehdhJ
Q8q0JQ==
Received: from nalasppmta01.qualcomm.com (Global_NAT1.qualcomm.com
[129.46.96.20])
by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 41n4kjk65k-1
(version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT);
Wed, 18 Sep 2024 21:21:07 +0000 (GMT)
Received: from nalasex01a.na.qualcomm.com (nalasex01a.na.qualcomm.com
[10.47.209.196])
by NALASPPMTA01.qualcomm.com (8.18.1.2/8.18.1.2) with ESMTPS id
48ILL7IZ032342
(version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT);
Wed, 18 Sep 2024 21:21:07 GMT
Received: from ath12k-linux1.qualcomm.com (10.80.80.8) by
nalasex01a.na.qualcomm.com (10.47.209.196) with Microsoft SMTP Server
(version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id
15.2.1544.9; Wed, 18 Sep 2024 14:21:06 -0700
From: Pradeep Kumar Chitrapu <quic_pradeepc@quicinc.com>
To: <ath12k@lists.infradead.org>
CC: <linux-wireless@vger.kernel.org>,
Pradeep Kumar Chitrapu
<quic_pradeepc@quicinc.com>,
Muna Sinada <quic_msinada@quicinc.com>,
"Jeff
Johnson" <quic_jjohnson@quicinc.com>
Subject: [PATCH V8 2/9] wifi: ath12k: push EHT MU-MIMO params to hardware
Date: Wed, 18 Sep 2024 14:20:49 -0700
Message-ID: <20240918212056.4137076-3-quic_pradeepc@quicinc.com>
X-Mailer: git-send-email 2.34.1
In-Reply-To: <20240918212056.4137076-1-quic_pradeepc@quicinc.com>
References: <20240918212056.4137076-1-quic_pradeepc@quicinc.com>
Precedence: bulk
X-Mailing-List: linux-wireless@vger.kernel.org
List-Id: <linux-wireless.vger.kernel.org>
List-Subscribe: <mailto:linux-wireless+subscribe@vger.kernel.org>
List-Unsubscribe: <mailto:linux-wireless+unsubscribe@vger.kernel.org>
MIME-Version: 1.0
X-ClientProxiedBy: nasanex01a.na.qualcomm.com (10.52.223.231) To
nalasex01a.na.qualcomm.com (10.47.209.196)
X-QCInternal: smtphost
X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=5800
signatures=585085
X-Proofpoint-GUID: DiIEaDHD4453WG2b31qitb3_i0JkAM4u
X-Proofpoint-ORIG-GUID: DiIEaDHD4453WG2b31qitb3_i0JkAM4u
X-Proofpoint-Virus-Version: vendor=baseguard
engine=ICAP:2.0.293,Aquarius:18.0.1039,Hydra:6.0.680,FMLib:17.12.60.29
definitions=2024-09-06_09,2024-09-06_01,2024-09-02_01
X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0
bulkscore=0 adultscore=0
suspectscore=0 mlxscore=0 clxscore=1015 lowpriorityscore=0 malwarescore=0
phishscore=0 impostorscore=0 mlxlogscore=999 priorityscore=1501
spamscore=0 classifier=spam adjust=0 reason=mlx scancount=1
engine=8.19.0-2408220000 definitions=main-2409180140
Currently, only the EHT IE in management frames is updated with
respect to MU-MIMO configurations, but this change is not
reflected in the hardware. Add support to propagate MU-MIMO
configurations to the hardware as well for AP mode. Similar
support for STA mode will be added in future.
Tested-on: QCN9274 hw2.0 PCI WLAN.WBE.1.0.1-00029-QCAHKSWPL_SILICONZ-1
Co-developed-by: Muna Sinada <quic_msinada@quicinc.com>
Signed-off-by: Muna Sinada <quic_msinada@quicinc.com>
Signed-off-by: Pradeep Kumar Chitrapu <quic_pradeepc@quicinc.com>
Acked-by: Jeff Johnson <quic_jjohnson@quicinc.com>
---
drivers/net/wireless/ath/ath12k/mac.c | 50 +++++++++++++++++++++++++++
drivers/net/wireless/ath/ath12k/wmi.h | 21 +++++++++++
2 files changed, 71 insertions(+)
--- a/drivers/net/wireless/ath/ath12k/mac.c
+++ b/drivers/net/wireless/ath/ath12k/mac.c
@@ -2953,6 +2953,50 @@ static int ath12k_mac_vif_recalc_sta_he_
return 0;
}
+static int ath12k_mac_set_eht_txbf_conf(struct ath12k_vif *arvif)
+{
+ u32 param = WMI_VDEV_PARAM_SET_EHT_MU_MODE;
+ struct ath12k *ar = arvif->ar;
+ u32 value = 0;
+ int ret;
+
+ if (!arvif->vif->bss_conf.eht_support)
+ return 0;
+
+ if (arvif->vif->bss_conf.eht_su_beamformer) {
+ value |= u32_encode_bits(EHT_SU_BFER_ENABLE, EHT_MODE_SU_TX_BFER);
+ if (arvif->vif->bss_conf.eht_mu_beamformer &&
+ arvif->vdev_type == WMI_VDEV_TYPE_AP)
+ value |= u32_encode_bits(EHT_MU_BFER_ENABLE,
+ EHT_MODE_MU_TX_BFER) |
+ u32_encode_bits(EHT_DL_MUOFDMA_ENABLE,
+ EHT_MODE_DL_OFDMA_MUMIMO) |
+ u32_encode_bits(EHT_UL_MUOFDMA_ENABLE,
+ EHT_MODE_UL_OFDMA_MUMIMO);
+ }
+
+ if (arvif->vif->type != NL80211_IFTYPE_MESH_POINT) {
+ value |= u32_encode_bits(EHT_DL_MUOFDMA_ENABLE, EHT_MODE_DL_OFDMA) |
+ u32_encode_bits(EHT_UL_MUOFDMA_ENABLE, EHT_MODE_UL_OFDMA);
+
+ if (arvif->vif->bss_conf.eht_80mhz_full_bw_ul_mumimo)
+ value |= u32_encode_bits(EHT_UL_MUMIMO_ENABLE, EHT_MODE_MUMIMO);
+
+ if (arvif->vif->bss_conf.eht_su_beamformee)
+ value |= u32_encode_bits(EHT_SU_BFEE_ENABLE,
+ EHT_MODE_SU_TX_BFEE);
+ }
+
+ ret = ath12k_wmi_vdev_set_param_cmd(ar, arvif->vdev_id, param, value);
+ if (ret) {
+ ath12k_warn(ar->ab, "failed to set vdev %d EHT MU mode: %d\n",
+ arvif->vdev_id, ret);
+ return ret;
+ }
+
+ return 0;
+}
+
static void ath12k_bss_assoc(struct ath12k *ar,
struct ath12k_vif *arvif,
struct ieee80211_bss_conf *bss_conf)
@@ -3351,6 +3395,12 @@ static void ath12k_mac_bss_info_changed(
ath12k_warn(ar->ab,
"failed to set HE TXBF config for vdev: %d\n",
arvif->vdev_id);
+
+ ret = ath12k_mac_set_eht_txbf_conf(arvif);
+ if (ret)
+ ath12k_warn(ar->ab,
+ "failed to set EHT TXBF config for vdev: %d\n",
+ arvif->vdev_id);
}
ath12k_control_beaconing(arvif, info);
--- a/drivers/net/wireless/ath/ath12k/wmi.h
+++ b/drivers/net/wireless/ath/ath12k/wmi.h
@@ -1139,6 +1139,7 @@ enum wmi_tlv_vdev_param {
WMI_VDEV_PARAM_BSS_COLOR,
WMI_VDEV_PARAM_SET_HEMU_MODE,
WMI_VDEV_PARAM_HEOPS_0_31 = 0x8003,
+ WMI_VDEV_PARAM_SET_EHT_MU_MODE = 0x8005,
};
enum wmi_tlv_peer_flags {
@@ -3012,6 +3013,26 @@ struct ath12k_wmi_rx_reorder_queue_remov
#define HE_MU_BFER_ENABLE 1
#define HE_SU_BFER_ENABLE 1
+#define EHT_MODE_SU_TX_BFEE BIT(0)
+#define EHT_MODE_SU_TX_BFER BIT(1)
+#define EHT_MODE_MU_TX_BFEE BIT(2)
+#define EHT_MODE_MU_TX_BFER BIT(3)
+#define EHT_MODE_DL_OFDMA BIT(4)
+#define EHT_MODE_UL_OFDMA BIT(5)
+#define EHT_MODE_MUMIMO BIT(6)
+#define EHT_MODE_DL_OFDMA_TXBF BIT(7)
+#define EHT_MODE_DL_OFDMA_MUMIMO BIT(8)
+#define EHT_MODE_UL_OFDMA_MUMIMO BIT(9)
+
+#define EHT_DL_MUOFDMA_ENABLE 1
+#define EHT_UL_MUOFDMA_ENABLE 1
+#define EHT_DL_MUMIMO_ENABLE 1
+#define EHT_UL_MUMIMO_ENABLE 1
+#define EHT_MU_BFEE_ENABLE 1
+#define EHT_SU_BFEE_ENABLE 1
+#define EHT_MU_BFER_ENABLE 1
+#define EHT_SU_BFER_ENABLE 1
+
#define HE_VHT_SOUNDING_MODE_ENABLE 1
#define HE_SU_MU_SOUNDING_MODE_ENABLE 1
#define HE_TRIG_NONTRIG_SOUNDING_MODE_ENABLE 1

View File

@ -0,0 +1,162 @@
From patchwork Wed Sep 18 21:20:50 2024
Content-Type: text/plain; charset="utf-8"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
X-Patchwork-Submitter: Pradeep Kumar Chitrapu <quic_pradeepc@quicinc.com>
X-Patchwork-Id: 13807213
X-Patchwork-Delegate: quic_jjohnson@quicinc.com
Received: from mx0b-0031df01.pphosted.com (mx0b-0031df01.pphosted.com
[205.220.180.131])
(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
(No client certificate requested)
by smtp.subspace.kernel.org (Postfix) with ESMTPS id 4B2B11CB312
for <linux-wireless@vger.kernel.org>; Wed, 18 Sep 2024 21:21:14 +0000 (UTC)
Authentication-Results: smtp.subspace.kernel.org;
arc=none smtp.client-ip=205.220.180.131
ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116;
t=1726694475; cv=none;
b=uo8JC/iAnxSCZyXzNFarViwWJNwY+JldG9aDgn6LOK7yCxMusODCN3rw4mSCs0sLxHrfxFouDKWpiKeM7hGb/fzQzU2eh6bHNvzhjOqaTjAsJo7sVGj4L2QK1UPb2ZxMke35L51ztNTVhAc7IS17sn6blDZnU+1+RGRKXskHc78=
ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org;
s=arc-20240116; t=1726694475; c=relaxed/simple;
bh=nhEu2OadboIpWVwShgMmYabjiVuEo2mUKJhJlcUzvgI=;
h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References:
MIME-Version:Content-Type;
b=iPc43CIgA4O9RfgxO3cfBBvDShW3nh4Q/MVoL1JTtx8u/9t1CeFY7KstjtKiPdJ6vxx0yhZwXcwCRFfbZdfRduyybDRKPmgqN/VogzkwizBSFWBL41H02pCvee2mV3poTyZz9CnCJ5L7An5k7ARI3Eo6EwsgaAYIncO/tU2Jsao=
ARC-Authentication-Results: i=1; smtp.subspace.kernel.org;
dmarc=pass (p=none dis=none) header.from=quicinc.com;
spf=pass smtp.mailfrom=quicinc.com;
dkim=pass (2048-bit key) header.d=quicinc.com header.i=@quicinc.com
header.b=iXyzdRBT; arc=none smtp.client-ip=205.220.180.131
Authentication-Results: smtp.subspace.kernel.org;
dmarc=pass (p=none dis=none) header.from=quicinc.com
Authentication-Results: smtp.subspace.kernel.org;
spf=pass smtp.mailfrom=quicinc.com
Authentication-Results: smtp.subspace.kernel.org;
dkim=pass (2048-bit key) header.d=quicinc.com header.i=@quicinc.com
header.b="iXyzdRBT"
Received: from pps.filterd (m0279869.ppops.net [127.0.0.1])
by mx0a-0031df01.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id
48I90GrT001584;
Wed, 18 Sep 2024 21:21:09 GMT
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=quicinc.com; h=
cc:content-transfer-encoding:content-type:date:from:in-reply-to
:message-id:mime-version:references:subject:to; s=qcppdkim1; bh=
aj0umwCwR0cGrc/Vc7qz7QRYcnU4amMo6KwLL9RZRaA=; b=iXyzdRBTMie5qv2n
KocnG3cRtZjxDUMbNTj+in3o4zrIU5RFumLb3ZmgpbCZD9jcmxkc9fcTdtwxUz8e
LTodO1mKSkqtOufy45keXIYYJN3lxfFsZtA5bcmG+QCJZJmPaTpMaf9L9Us9e+JZ
Ngjh4JNR3UIXn5+UvNGrRNEWeAlCrwf9Z5bWl1mQmwmkVVuH3nMu1IyPidF3tzRk
AdQTPkPtpnoGlYwEWL/noPAYTf4OuZrqPCAj31iBfZvq2RjAdWtPx/ayYEQsNKCu
xoBLKjb8hppxfGqn06TpV73nTxvhEDwnwBTwfgrr+xVeKvwz6Mrh8aoYBdUeFUAh
OiuxDA==
Received: from nalasppmta03.qualcomm.com (Global_NAT1.qualcomm.com
[129.46.96.20])
by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 41n4hf38cn-1
(version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT);
Wed, 18 Sep 2024 21:21:08 +0000 (GMT)
Received: from nalasex01a.na.qualcomm.com (nalasex01a.na.qualcomm.com
[10.47.209.196])
by NALASPPMTA03.qualcomm.com (8.18.1.2/8.18.1.2) with ESMTPS id
48ILL7e8005093
(version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT);
Wed, 18 Sep 2024 21:21:07 GMT
Received: from ath12k-linux1.qualcomm.com (10.80.80.8) by
nalasex01a.na.qualcomm.com (10.47.209.196) with Microsoft SMTP Server
(version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id
15.2.1544.9; Wed, 18 Sep 2024 14:21:07 -0700
From: Pradeep Kumar Chitrapu <quic_pradeepc@quicinc.com>
To: <ath12k@lists.infradead.org>
CC: <linux-wireless@vger.kernel.org>,
Pradeep Kumar Chitrapu
<quic_pradeepc@quicinc.com>,
Muna Sinada <quic_msinada@quicinc.com>,
"Jeff
Johnson" <quic_jjohnson@quicinc.com>
Subject: [PATCH V8 3/9] wifi: ath12k: move HE MCS mapper to a separate
function
Date: Wed, 18 Sep 2024 14:20:50 -0700
Message-ID: <20240918212056.4137076-4-quic_pradeepc@quicinc.com>
X-Mailer: git-send-email 2.34.1
In-Reply-To: <20240918212056.4137076-1-quic_pradeepc@quicinc.com>
References: <20240918212056.4137076-1-quic_pradeepc@quicinc.com>
Precedence: bulk
X-Mailing-List: linux-wireless@vger.kernel.org
List-Id: <linux-wireless.vger.kernel.org>
List-Subscribe: <mailto:linux-wireless+subscribe@vger.kernel.org>
List-Unsubscribe: <mailto:linux-wireless+unsubscribe@vger.kernel.org>
MIME-Version: 1.0
X-ClientProxiedBy: nasanex01a.na.qualcomm.com (10.52.223.231) To
nalasex01a.na.qualcomm.com (10.47.209.196)
X-QCInternal: smtphost
X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=5800
signatures=585085
X-Proofpoint-ORIG-GUID: zHmCiFNBcWNOH7v_I9cuj0l6gmfKvBVa
X-Proofpoint-GUID: zHmCiFNBcWNOH7v_I9cuj0l6gmfKvBVa
X-Proofpoint-Virus-Version: vendor=baseguard
engine=ICAP:2.0.293,Aquarius:18.0.1039,Hydra:6.0.680,FMLib:17.12.60.29
definitions=2024-09-06_09,2024-09-06_01,2024-09-02_01
X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0
priorityscore=1501 mlxscore=0
suspectscore=0 bulkscore=0 lowpriorityscore=0 spamscore=0 clxscore=1015
mlxlogscore=999 adultscore=0 malwarescore=0 phishscore=0 impostorscore=0
classifier=spam adjust=0 reason=mlx scancount=1 engine=8.19.0-2408220000
definitions=main-2409180140
Refactor the HE MCS mapper functionality in
ath12k_mac_copy_he_cap() into a new function.
This helps improve readability, extensibility and will be used
when adding support for 160 MHz bandwidth in subsequent patches.
Tested-on: QCN9274 hw2.0 PCI WLAN.WBE.1.0.1-00029-QCAHKSWPL_SILICONZ-1
Co-developed-by: Muna Sinada <quic_msinada@quicinc.com>
Signed-off-by: Muna Sinada <quic_msinada@quicinc.com>
Signed-off-by: Pradeep Kumar Chitrapu <quic_pradeepc@quicinc.com>
Acked-by: Jeff Johnson <quic_jjohnson@quicinc.com>
---
drivers/net/wireless/ath/ath12k/mac.c | 22 ++++++++++++++--------
1 file changed, 14 insertions(+), 8 deletions(-)
--- a/drivers/net/wireless/ath/ath12k/mac.c
+++ b/drivers/net/wireless/ath/ath12k/mac.c
@@ -5518,12 +5518,24 @@ static __le16 ath12k_mac_setup_he_6ghz_c
return cpu_to_le16(bcap->he_6ghz_capa);
}
+static void ath12k_mac_set_hemcsmap(struct ath12k_band_cap *band_cap,
+ struct ieee80211_sta_he_cap *he_cap)
+{
+ struct ieee80211_he_mcs_nss_supp *mcs_nss = &he_cap->he_mcs_nss_supp;
+
+ mcs_nss->rx_mcs_80 = cpu_to_le16(band_cap->he_mcs & 0xffff);
+ mcs_nss->tx_mcs_80 = cpu_to_le16(band_cap->he_mcs & 0xffff);
+ mcs_nss->rx_mcs_160 = cpu_to_le16((band_cap->he_mcs >> 16) & 0xffff);
+ mcs_nss->tx_mcs_160 = cpu_to_le16((band_cap->he_mcs >> 16) & 0xffff);
+ mcs_nss->rx_mcs_80p80 = cpu_to_le16((band_cap->he_mcs >> 16) & 0xffff);
+ mcs_nss->tx_mcs_80p80 = cpu_to_le16((band_cap->he_mcs >> 16) & 0xffff);
+}
+
static void ath12k_mac_copy_he_cap(struct ath12k_band_cap *band_cap,
int iftype, u8 num_tx_chains,
struct ieee80211_sta_he_cap *he_cap)
{
struct ieee80211_he_cap_elem *he_cap_elem = &he_cap->he_cap_elem;
- struct ieee80211_he_mcs_nss_supp *mcs_nss = &he_cap->he_mcs_nss_supp;
he_cap->has_he = true;
memcpy(he_cap_elem->mac_cap_info, band_cap->he_cap_info,
@@ -5561,13 +5573,7 @@ static void ath12k_mac_copy_he_cap(struc
break;
}
- mcs_nss->rx_mcs_80 = cpu_to_le16(band_cap->he_mcs & 0xffff);
- mcs_nss->tx_mcs_80 = cpu_to_le16(band_cap->he_mcs & 0xffff);
- mcs_nss->rx_mcs_160 = cpu_to_le16((band_cap->he_mcs >> 16) & 0xffff);
- mcs_nss->tx_mcs_160 = cpu_to_le16((band_cap->he_mcs >> 16) & 0xffff);
- mcs_nss->rx_mcs_80p80 = cpu_to_le16((band_cap->he_mcs >> 16) & 0xffff);
- mcs_nss->tx_mcs_80p80 = cpu_to_le16((band_cap->he_mcs >> 16) & 0xffff);
-
+ ath12k_mac_set_hemcsmap(band_cap, he_cap);
memset(he_cap->ppe_thres, 0, sizeof(he_cap->ppe_thres));
if (he_cap_elem->phy_cap_info[6] &
IEEE80211_HE_PHY_CAP6_PPE_THRESHOLD_PRESENT)

View File

@ -0,0 +1,186 @@
From patchwork Wed Sep 18 21:20:51 2024
Content-Type: text/plain; charset="utf-8"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
X-Patchwork-Submitter: Pradeep Kumar Chitrapu <quic_pradeepc@quicinc.com>
X-Patchwork-Id: 13807215
X-Patchwork-Delegate: quic_jjohnson@quicinc.com
Received: from mx0b-0031df01.pphosted.com (mx0b-0031df01.pphosted.com
[205.220.180.131])
(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
(No client certificate requested)
by smtp.subspace.kernel.org (Postfix) with ESMTPS id A88651CB32C
for <linux-wireless@vger.kernel.org>; Wed, 18 Sep 2024 21:21:14 +0000 (UTC)
Authentication-Results: smtp.subspace.kernel.org;
arc=none smtp.client-ip=205.220.180.131
ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116;
t=1726694476; cv=none;
b=Lkqx2oSLyeGRxKcm+N4Vmg+KOuwHpt6xhgWj9SpyWNXxxWkVExVyHvPrWaP/u4OXd0YjYBJC3Dg0NJYY9WJyL0A3RP8GK++s9CiRloNaEmEjI71S/f3+0HVXu5bCmi8cyiIMFzCpAcNuZ67J7r/WxvNRbeox3iZHmXK1WFUb4Hs=
ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org;
s=arc-20240116; t=1726694476; c=relaxed/simple;
bh=nv4kc89H7eGC0FLgCwC70zFDhNkClMNiRf5HjDZHHuQ=;
h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References:
MIME-Version:Content-Type;
b=B1oJWv7vHZKRChjamOFJnRzQVtL7qBs7/Ho9GojLQtHyCKtrCEOJt/lWvhkqISf48/5MaQOCdkHhCrQT/eHP9hZ1wnCdeOKXh6Wmk/QYt9yEcc0X6HT5wUxgpaA3PooH/cMlJCX0c8hyhT7XBm6vWnPwQjt/FnLTubA3uj+X8oE=
ARC-Authentication-Results: i=1; smtp.subspace.kernel.org;
dmarc=pass (p=none dis=none) header.from=quicinc.com;
spf=pass smtp.mailfrom=quicinc.com;
dkim=pass (2048-bit key) header.d=quicinc.com header.i=@quicinc.com
header.b=WweZPnje; arc=none smtp.client-ip=205.220.180.131
Authentication-Results: smtp.subspace.kernel.org;
dmarc=pass (p=none dis=none) header.from=quicinc.com
Authentication-Results: smtp.subspace.kernel.org;
spf=pass smtp.mailfrom=quicinc.com
Authentication-Results: smtp.subspace.kernel.org;
dkim=pass (2048-bit key) header.d=quicinc.com header.i=@quicinc.com
header.b="WweZPnje"
Received: from pps.filterd (m0279872.ppops.net [127.0.0.1])
by mx0a-0031df01.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id
48IACJst031540;
Wed, 18 Sep 2024 21:21:09 GMT
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=quicinc.com; h=
cc:content-transfer-encoding:content-type:date:from:in-reply-to
:message-id:mime-version:references:subject:to; s=qcppdkim1; bh=
ARu9Fu0s66NeuLm2pdCBchANS+rlgd275Q/E4KE2T1o=; b=WweZPnjehL/ZQW57
4JHJDsl8A5hyljMaJrVPdmZwNktTurJPMpD5z0akqx2dq3bfjzx2rx5NAtMb831x
ieysvT1ApK5V32fmb9xzG7FMIU3DH4eqr/9ApZbHFVPTglHrVoVzHJLps3I+Ts5P
gi1dsIAdwTai7hW1FchcW/pZ2kJMq6zN7oljoFs7pc1CvzHfIJowQM8gFfslkqlL
lvm9A9knvnUlkrEvzgpoZfZxm/91t9bQzkQDTX91wRc0oGR/9liT+z4Sdum2rLwb
fri8rhQIw8w1ExGM1nzChPaajmDIsE86ODjDL2xBbd/DcdsVvOYl8ewJ8AX45qNs
+LpHtg==
Received: from nalasppmta03.qualcomm.com (Global_NAT1.qualcomm.com
[129.46.96.20])
by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 41n4j6uagq-1
(version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT);
Wed, 18 Sep 2024 21:21:09 +0000 (GMT)
Received: from nalasex01a.na.qualcomm.com (nalasex01a.na.qualcomm.com
[10.47.209.196])
by NALASPPMTA03.qualcomm.com (8.18.1.2/8.18.1.2) with ESMTPS id
48ILL8gM005103
(version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT);
Wed, 18 Sep 2024 21:21:08 GMT
Received: from ath12k-linux1.qualcomm.com (10.80.80.8) by
nalasex01a.na.qualcomm.com (10.47.209.196) with Microsoft SMTP Server
(version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id
15.2.1544.9; Wed, 18 Sep 2024 14:21:07 -0700
From: Pradeep Kumar Chitrapu <quic_pradeepc@quicinc.com>
To: <ath12k@lists.infradead.org>
CC: <linux-wireless@vger.kernel.org>,
Pradeep Kumar Chitrapu
<quic_pradeepc@quicinc.com>,
Muna Sinada <quic_msinada@quicinc.com>,
"Jeff
Johnson" <quic_jjohnson@quicinc.com>
Subject: [PATCH V8 4/9] wifi: ath12k: generate rx and tx mcs maps for
supported HE mcs
Date: Wed, 18 Sep 2024 14:20:51 -0700
Message-ID: <20240918212056.4137076-5-quic_pradeepc@quicinc.com>
X-Mailer: git-send-email 2.34.1
In-Reply-To: <20240918212056.4137076-1-quic_pradeepc@quicinc.com>
References: <20240918212056.4137076-1-quic_pradeepc@quicinc.com>
Precedence: bulk
X-Mailing-List: linux-wireless@vger.kernel.org
List-Id: <linux-wireless.vger.kernel.org>
List-Subscribe: <mailto:linux-wireless+subscribe@vger.kernel.org>
List-Unsubscribe: <mailto:linux-wireless+unsubscribe@vger.kernel.org>
MIME-Version: 1.0
X-ClientProxiedBy: nasanex01a.na.qualcomm.com (10.52.223.231) To
nalasex01a.na.qualcomm.com (10.47.209.196)
X-QCInternal: smtphost
X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=5800
signatures=585085
X-Proofpoint-ORIG-GUID: wHJ63GZpWGKZ4XSyQZiVlsARNAgr5CQM
X-Proofpoint-GUID: wHJ63GZpWGKZ4XSyQZiVlsARNAgr5CQM
X-Proofpoint-Virus-Version: vendor=baseguard
engine=ICAP:2.0.293,Aquarius:18.0.1039,Hydra:6.0.680,FMLib:17.12.60.29
definitions=2024-09-06_09,2024-09-06_01,2024-09-02_01
X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0
phishscore=0 mlxlogscore=999
mlxscore=0 malwarescore=0 bulkscore=0 priorityscore=1501 clxscore=1015
adultscore=0 suspectscore=0 lowpriorityscore=0 spamscore=0 impostorscore=0
classifier=spam adjust=0 reason=mlx scancount=1 engine=8.19.0-2408220000
definitions=main-2409180140
Generate rx and tx mcs maps in ath12k_mac_set_hemcsmap() based
on number of supported tx/rx chains and set them in supported
mcs/nss for HE capabilities.
Tested-on: QCN9274 hw2.0 PCI WLAN.WBE.1.0.1-00029-QCAHKSWPL_SILICONZ-1
Co-developed-by: Muna Sinada <quic_msinada@quicinc.com>
Signed-off-by: Muna Sinada <quic_msinada@quicinc.com>
Signed-off-by: Pradeep Kumar Chitrapu <quic_pradeepc@quicinc.com>
Acked-by: Jeff Johnson <quic_jjohnson@quicinc.com>
---
drivers/net/wireless/ath/ath12k/mac.c | 40 ++++++++++++++++++++-------
1 file changed, 30 insertions(+), 10 deletions(-)
--- a/drivers/net/wireless/ath/ath12k/mac.c
+++ b/drivers/net/wireless/ath/ath12k/mac.c
@@ -5518,20 +5518,40 @@ static __le16 ath12k_mac_setup_he_6ghz_c
return cpu_to_le16(bcap->he_6ghz_capa);
}
-static void ath12k_mac_set_hemcsmap(struct ath12k_band_cap *band_cap,
+static void ath12k_mac_set_hemcsmap(struct ath12k *ar,
+ struct ath12k_pdev_cap *cap,
struct ieee80211_sta_he_cap *he_cap)
{
struct ieee80211_he_mcs_nss_supp *mcs_nss = &he_cap->he_mcs_nss_supp;
+ u16 txmcs_map, rxmcs_map;
+ u32 i;
- mcs_nss->rx_mcs_80 = cpu_to_le16(band_cap->he_mcs & 0xffff);
- mcs_nss->tx_mcs_80 = cpu_to_le16(band_cap->he_mcs & 0xffff);
- mcs_nss->rx_mcs_160 = cpu_to_le16((band_cap->he_mcs >> 16) & 0xffff);
- mcs_nss->tx_mcs_160 = cpu_to_le16((band_cap->he_mcs >> 16) & 0xffff);
- mcs_nss->rx_mcs_80p80 = cpu_to_le16((band_cap->he_mcs >> 16) & 0xffff);
- mcs_nss->tx_mcs_80p80 = cpu_to_le16((band_cap->he_mcs >> 16) & 0xffff);
+ 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);
+ }
+
+ mcs_nss->rx_mcs_80 = cpu_to_le16(rxmcs_map & 0xffff);
+ mcs_nss->tx_mcs_80 = cpu_to_le16(txmcs_map & 0xffff);
+ mcs_nss->rx_mcs_160 = cpu_to_le16(rxmcs_map & 0xffff);
+ mcs_nss->tx_mcs_160 = cpu_to_le16(txmcs_map & 0xffff);
+ mcs_nss->rx_mcs_80p80 = cpu_to_le16(rxmcs_map & 0xffff);
+ mcs_nss->tx_mcs_80p80 = cpu_to_le16(txmcs_map & 0xffff);
}
-static void ath12k_mac_copy_he_cap(struct ath12k_band_cap *band_cap,
+static void ath12k_mac_copy_he_cap(struct ath12k *ar,
+ struct ath12k_band_cap *band_cap,
int iftype, u8 num_tx_chains,
struct ieee80211_sta_he_cap *he_cap)
{
@@ -5573,7 +5593,7 @@ static void ath12k_mac_copy_he_cap(struc
break;
}
- ath12k_mac_set_hemcsmap(band_cap, he_cap);
+ ath12k_mac_set_hemcsmap(ar, &ar->pdev->cap, he_cap);
memset(he_cap->ppe_thres, 0, sizeof(he_cap->ppe_thres));
if (he_cap_elem->phy_cap_info[6] &
IEEE80211_HE_PHY_CAP6_PPE_THRESHOLD_PRESENT)
@@ -5762,7 +5782,7 @@ static int ath12k_mac_copy_sband_iftype_
data[idx].types_mask = BIT(i);
- ath12k_mac_copy_he_cap(band_cap, i, ar->num_tx_chains, he_cap);
+ ath12k_mac_copy_he_cap(ar, band_cap, i, ar->num_tx_chains, he_cap);
if (band == NL80211_BAND_6GHZ) {
data[idx].he_6ghz_capa.capa =
ath12k_mac_setup_he_6ghz_cap(cap, band_cap);

View File

@ -0,0 +1,141 @@
From patchwork Wed Sep 18 21:20:52 2024
Content-Type: text/plain; charset="utf-8"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
X-Patchwork-Submitter: Pradeep Kumar Chitrapu <quic_pradeepc@quicinc.com>
X-Patchwork-Id: 13807211
X-Patchwork-Delegate: quic_jjohnson@quicinc.com
Received: from mx0a-0031df01.pphosted.com (mx0a-0031df01.pphosted.com
[205.220.168.131])
(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
(No client certificate requested)
by smtp.subspace.kernel.org (Postfix) with ESMTPS id 77FB41CA6AC
for <linux-wireless@vger.kernel.org>; Wed, 18 Sep 2024 21:21:13 +0000 (UTC)
Authentication-Results: smtp.subspace.kernel.org;
arc=none smtp.client-ip=205.220.168.131
ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116;
t=1726694475; cv=none;
b=RN/ddoo5Vh8RVGeYZ8k8lXTOb7bzs7wSIAQGFjyvpfc9NICOpTDXpM3ai/D/fFtXLR8mFmYa4uIMFdrWML1x/UjZtd+jJnNyL/jo4/t5+ONN0nU4brd/dW7fv/biqLA6CkFbjnw01XnInXLzGT8IIm4NvxBkMy/RVj0tC33y7os=
ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org;
s=arc-20240116; t=1726694475; c=relaxed/simple;
bh=bsvgv033jSAPUVmS0VlMcScTn/1aM6tw3aACOOiqxvA=;
h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References:
MIME-Version:Content-Type;
b=rDT2TKhzEg9vR1RSVstUP/e9Z+sWhPbag7vxjm3nmkSJBFS5bR72jSO3YnpEGSQLOgd0c+ou8ce0GQOHHZBEpr8VlMP4o6SK8T3BVg4yPiHhqLzwadektVXzAofZ0K+caSvYUjsPvDd2wH1xDyUPHgvr/DjsPh8bhO1MP80pTYk=
ARC-Authentication-Results: i=1; smtp.subspace.kernel.org;
dmarc=pass (p=none dis=none) header.from=quicinc.com;
spf=pass smtp.mailfrom=quicinc.com;
dkim=pass (2048-bit key) header.d=quicinc.com header.i=@quicinc.com
header.b=DbZeRJ9u; arc=none smtp.client-ip=205.220.168.131
Authentication-Results: smtp.subspace.kernel.org;
dmarc=pass (p=none dis=none) header.from=quicinc.com
Authentication-Results: smtp.subspace.kernel.org;
spf=pass smtp.mailfrom=quicinc.com
Authentication-Results: smtp.subspace.kernel.org;
dkim=pass (2048-bit key) header.d=quicinc.com header.i=@quicinc.com
header.b="DbZeRJ9u"
Received: from pps.filterd (m0279867.ppops.net [127.0.0.1])
by mx0a-0031df01.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id
48I9TNqc020283;
Wed, 18 Sep 2024 21:21:09 GMT
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=quicinc.com; h=
cc:content-transfer-encoding:content-type:date:from:in-reply-to
:message-id:mime-version:references:subject:to; s=qcppdkim1; bh=
azR+5F3oXqRD0oIXJq+q0F3HbuiVUYwPuvX5vVskhnw=; b=DbZeRJ9uo40mL5rR
p0cASEsdLU8yr/aYeIXTSWCHBf5P73m5S26EYVv6MqTdcnmRT7flYyQWzotNV+gg
oHJpR7L5sN+omhK+7gDPRcm5j29/U9+7rMG7I0JwrfR6KbUUNJkrg+omW45ZdRPS
/92XJynSBDgzEGETs0AjLe+PLPW4Ucnncc+YscEVm/dtR4f5vQBYwGdCwv4IuczO
FJrEmDh3mj7m6JtNVV+A3LT5qS7PCAbiS7qhTAkDfhH9gDZJuUTO2b6ByyO4UkWp
afB41wIc4KUDYsTHkThkApxxp0vHfJJLGCweUi+YKYaqvQETgLhHx/UkSRdoRBII
N708pg==
Received: from nalasppmta05.qualcomm.com (Global_NAT1.qualcomm.com
[129.46.96.20])
by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 41n4kjk65m-1
(version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT);
Wed, 18 Sep 2024 21:21:09 +0000 (GMT)
Received: from nalasex01a.na.qualcomm.com (nalasex01a.na.qualcomm.com
[10.47.209.196])
by NALASPPMTA05.qualcomm.com (8.18.1.2/8.18.1.2) with ESMTPS id
48ILL8Gi009579
(version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT);
Wed, 18 Sep 2024 21:21:08 GMT
Received: from ath12k-linux1.qualcomm.com (10.80.80.8) by
nalasex01a.na.qualcomm.com (10.47.209.196) with Microsoft SMTP Server
(version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id
15.2.1544.9; Wed, 18 Sep 2024 14:21:08 -0700
From: Pradeep Kumar Chitrapu <quic_pradeepc@quicinc.com>
To: <ath12k@lists.infradead.org>
CC: <linux-wireless@vger.kernel.org>,
Pradeep Kumar Chitrapu
<quic_pradeepc@quicinc.com>,
Jeff Johnson <quic_jjohnson@quicinc.com>
Subject: [PATCH V8 5/9] wifi: ath12k: fix TX and RX MCS rate configurations in
HE mode
Date: Wed, 18 Sep 2024 14:20:52 -0700
Message-ID: <20240918212056.4137076-6-quic_pradeepc@quicinc.com>
X-Mailer: git-send-email 2.34.1
In-Reply-To: <20240918212056.4137076-1-quic_pradeepc@quicinc.com>
References: <20240918212056.4137076-1-quic_pradeepc@quicinc.com>
Precedence: bulk
X-Mailing-List: linux-wireless@vger.kernel.org
List-Id: <linux-wireless.vger.kernel.org>
List-Subscribe: <mailto:linux-wireless+subscribe@vger.kernel.org>
List-Unsubscribe: <mailto:linux-wireless+unsubscribe@vger.kernel.org>
MIME-Version: 1.0
X-ClientProxiedBy: nasanex01a.na.qualcomm.com (10.52.223.231) To
nalasex01a.na.qualcomm.com (10.47.209.196)
X-QCInternal: smtphost
X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=5800
signatures=585085
X-Proofpoint-GUID: JNJY4yItbZ8HP8WQjm82lNqNLkxUdf1v
X-Proofpoint-ORIG-GUID: JNJY4yItbZ8HP8WQjm82lNqNLkxUdf1v
X-Proofpoint-Virus-Version: vendor=baseguard
engine=ICAP:2.0.293,Aquarius:18.0.1039,Hydra:6.0.680,FMLib:17.12.60.29
definitions=2024-09-06_09,2024-09-06_01,2024-09-02_01
X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0
bulkscore=0 adultscore=0
suspectscore=0 mlxscore=0 clxscore=1015 lowpriorityscore=0 malwarescore=0
phishscore=0 impostorscore=0 mlxlogscore=999 priorityscore=1501
spamscore=0 classifier=spam adjust=0 reason=mlx scancount=1
engine=8.19.0-2408220000 definitions=main-2409180140
Currently, the TX and RX MCS rate configurations per peer are
reversed when sent to the firmware. As a result, RX MCS rates
are configured for TX, and vice versa. This commit rectifies
the configuration to match what the firmware expects.
Tested-on: QCN9274 hw2.0 PCI WLAN.WBE.1.0.1-00029-QCAHKSWPL_SILICONZ-1
Fixes: d889913205cf ("wifi: ath12k: driver for Qualcomm Wi-Fi 7 devices")
Signed-off-by: Pradeep Kumar Chitrapu <quic_pradeepc@quicinc.com>
Acked-by: Jeff Johnson <quic_jjohnson@quicinc.com>
---
drivers/net/wireless/ath/ath12k/wmi.c | 4 ++--
drivers/net/wireless/ath/ath12k/wmi.h | 2 ++
2 files changed, 4 insertions(+), 2 deletions(-)
--- a/drivers/net/wireless/ath/ath12k/wmi.c
+++ b/drivers/net/wireless/ath/ath12k/wmi.c
@@ -2140,8 +2140,8 @@ int ath12k_wmi_send_peer_assoc_cmd(struc
he_mcs->tlv_header = ath12k_wmi_tlv_cmd_hdr(WMI_TAG_HE_RATE_SET,
sizeof(*he_mcs));
- he_mcs->rx_mcs_set = cpu_to_le32(arg->peer_he_rx_mcs_set[i]);
- he_mcs->tx_mcs_set = cpu_to_le32(arg->peer_he_tx_mcs_set[i]);
+ he_mcs->rx_mcs_set = cpu_to_le32(arg->peer_he_tx_mcs_set[i]);
+ he_mcs->tx_mcs_set = cpu_to_le32(arg->peer_he_rx_mcs_set[i]);
ptr += sizeof(*he_mcs);
}
--- a/drivers/net/wireless/ath/ath12k/wmi.h
+++ b/drivers/net/wireless/ath/ath12k/wmi.h
@@ -3953,7 +3953,9 @@ struct ath12k_wmi_vht_rate_set_params {
struct ath12k_wmi_he_rate_set_params {
__le32 tlv_header;
+ /* MCS at which the peer can receive */
__le32 rx_mcs_set;
+ /* MCS at which the peer can transmit */
__le32 tx_mcs_set;
} __packed;

View File

@ -0,0 +1,254 @@
From patchwork Wed Sep 18 21:20:54 2024
Content-Type: text/plain; charset="utf-8"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
X-Patchwork-Submitter: Pradeep Kumar Chitrapu <quic_pradeepc@quicinc.com>
X-Patchwork-Id: 13807218
X-Patchwork-Delegate: quic_jjohnson@quicinc.com
Received: from mx0a-0031df01.pphosted.com (mx0a-0031df01.pphosted.com
[205.220.168.131])
(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
(No client certificate requested)
by smtp.subspace.kernel.org (Postfix) with ESMTPS id E7A2C15853D
for <linux-wireless@vger.kernel.org>; Wed, 18 Sep 2024 21:21:29 +0000 (UTC)
Authentication-Results: smtp.subspace.kernel.org;
arc=none smtp.client-ip=205.220.168.131
ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116;
t=1726694491; cv=none;
b=IDDUnQF/Tnpw/FvWitX7ofLgG/RwY2FyN79K1j9v3STIk2mbRSVtS7kUmHv83gWDgLeingrnJyz3kE7pWhAK5Zt+U/d3HoSbyXlaWdr1m98ZLPJnOIO51q8LBaUW4uPaZbMJiRGvTbhFw+0k6FNjQse034o2zQ5vHk1qETT9XsU=
ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org;
s=arc-20240116; t=1726694491; c=relaxed/simple;
bh=4Sbgjg6TXf4A547Y46Qiyw4U55YEFrIGdUXLZjEx5C0=;
h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References:
MIME-Version:Content-Type;
b=Y+NDqrjfpb1iFWpY9XYrVbCXhYRTFGsK7MN6jcsgZur7Ro+ZQsyZfhkFA+t+Bb52hk2p2N7v1TAdqLDK2CiFXaWPy/JfESHATwktCnNG+8/UL3n0VIjl+qxGTWt3pS/aWzI6yQjM2FB6tKc4kMnGX//RrgXhEIrh1M4ROs3IpJ0=
ARC-Authentication-Results: i=1; smtp.subspace.kernel.org;
dmarc=pass (p=none dis=none) header.from=quicinc.com;
spf=pass smtp.mailfrom=quicinc.com;
dkim=pass (2048-bit key) header.d=quicinc.com header.i=@quicinc.com
header.b=Kt1nBSex; arc=none smtp.client-ip=205.220.168.131
Authentication-Results: smtp.subspace.kernel.org;
dmarc=pass (p=none dis=none) header.from=quicinc.com
Authentication-Results: smtp.subspace.kernel.org;
spf=pass smtp.mailfrom=quicinc.com
Authentication-Results: smtp.subspace.kernel.org;
dkim=pass (2048-bit key) header.d=quicinc.com header.i=@quicinc.com
header.b="Kt1nBSex"
Received: from pps.filterd (m0279866.ppops.net [127.0.0.1])
by mx0a-0031df01.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id
48IJrYUI005813;
Wed, 18 Sep 2024 21:21:27 GMT
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=quicinc.com; h=
cc:content-transfer-encoding:content-type:date:from:in-reply-to
:message-id:mime-version:references:subject:to; s=qcppdkim1; bh=
7iZtYFy4NRmF2YHXqLd4zDMUbigsFxIkBQ6OeDD3zOs=; b=Kt1nBSex9R0mUQFv
fimFwEUDD2mzhj9KyoJnJsvbpzJOV9sBCCp3nPyxHNB66qzQUi/U904HE+wQ26S+
Dmo2aGOzcx4GHLU8agTSdb51h1ylcD1ulUXKpEqDIEkWv7leWNteXYTqoj2aUvXQ
MH261Yr4HRs5iWT53+FXUrPvY1eipkyG20XH2RcNT7XMMIT29hm5DRVTwU0kzAVU
/0hrrSBcgbTJP0KA5zSfO+bFE7fyWSxrjOzt7ugW9KdHlAj5iNAeePRUUlvqSGe7
07QprF1ixgWWpsIbUnZdd9UZLPKot8h5Vous/24QLAznqmj/FgipHLT6+Dy61eVq
L/T40w==
Received: from nalasppmta04.qualcomm.com (Global_NAT1.qualcomm.com
[129.46.96.20])
by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 41n4jdu9q1-1
(version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT);
Wed, 18 Sep 2024 21:21:27 +0000 (GMT)
Received: from nalasex01a.na.qualcomm.com (nalasex01a.na.qualcomm.com
[10.47.209.196])
by NALASPPMTA04.qualcomm.com (8.18.1.2/8.18.1.2) with ESMTPS id
48ILL9Ux020570
(version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT);
Wed, 18 Sep 2024 21:21:09 GMT
Received: from ath12k-linux1.qualcomm.com (10.80.80.8) by
nalasex01a.na.qualcomm.com (10.47.209.196) with Microsoft SMTP Server
(version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id
15.2.1544.9; Wed, 18 Sep 2024 14:21:08 -0700
From: Pradeep Kumar Chitrapu <quic_pradeepc@quicinc.com>
To: <ath12k@lists.infradead.org>
CC: <linux-wireless@vger.kernel.org>,
Pradeep Kumar Chitrapu
<quic_pradeepc@quicinc.com>,
Jeff Johnson <quic_jjohnson@quicinc.com>
Subject: [PATCH V8 7/9] wifi: ath12k: clean up 80P80 support
Date: Wed, 18 Sep 2024 14:20:54 -0700
Message-ID: <20240918212056.4137076-8-quic_pradeepc@quicinc.com>
X-Mailer: git-send-email 2.34.1
In-Reply-To: <20240918212056.4137076-1-quic_pradeepc@quicinc.com>
References: <20240918212056.4137076-1-quic_pradeepc@quicinc.com>
Precedence: bulk
X-Mailing-List: linux-wireless@vger.kernel.org
List-Id: <linux-wireless.vger.kernel.org>
List-Subscribe: <mailto:linux-wireless+subscribe@vger.kernel.org>
List-Unsubscribe: <mailto:linux-wireless+unsubscribe@vger.kernel.org>
MIME-Version: 1.0
X-ClientProxiedBy: nasanex01a.na.qualcomm.com (10.52.223.231) To
nalasex01a.na.qualcomm.com (10.47.209.196)
X-QCInternal: smtphost
X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=5800
signatures=585085
X-Proofpoint-ORIG-GUID: zOl2cVhwvoAFaH70WioUIdrk_oIr5c-T
X-Proofpoint-GUID: zOl2cVhwvoAFaH70WioUIdrk_oIr5c-T
X-Proofpoint-Virus-Version: vendor=baseguard
engine=ICAP:2.0.293,Aquarius:18.0.1039,Hydra:6.0.680,FMLib:17.12.60.29
definitions=2024-09-06_09,2024-09-06_01,2024-09-02_01
X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0
phishscore=0 impostorscore=0
clxscore=1015 adultscore=0 mlxscore=0 suspectscore=0 malwarescore=0
priorityscore=1501 spamscore=0 bulkscore=0 lowpriorityscore=0
mlxlogscore=999 classifier=spam adjust=0 reason=mlx scancount=1
engine=8.19.0-2408220000 definitions=main-2409180141
Clean up unused 80P80 references as hardware does not support
it. This is applicable to both QCN9274 and WCN7850.
Tested-on: QCN9274 hw2.0 PCI WLAN.WBE.1.0.1-00029-QCAHKSWPL_SILICONZ-1
Signed-off-by: Pradeep Kumar Chitrapu <quic_pradeepc@quicinc.com>
Acked-by: Jeff Johnson <quic_jjohnson@quicinc.com>
---
drivers/net/wireless/ath/ath12k/mac.c | 51 ++++++---------------------
drivers/net/wireless/ath/ath12k/wmi.c | 5 +--
drivers/net/wireless/ath/ath12k/wmi.h | 1 -
3 files changed, 11 insertions(+), 46 deletions(-)
--- a/drivers/net/wireless/ath/ath12k/mac.c
+++ b/drivers/net/wireless/ath/ath12k/mac.c
@@ -206,7 +206,7 @@ ath12k_phymodes[NUM_NL80211_BANDS][ATH12
[NL80211_CHAN_WIDTH_40] = MODE_11BE_EHT40,
[NL80211_CHAN_WIDTH_80] = MODE_11BE_EHT80,
[NL80211_CHAN_WIDTH_160] = MODE_11BE_EHT160,
- [NL80211_CHAN_WIDTH_80P80] = MODE_11BE_EHT80_80,
+ [NL80211_CHAN_WIDTH_80P80] = MODE_UNKNOWN,
[NL80211_CHAN_WIDTH_320] = MODE_11BE_EHT320,
},
[NL80211_BAND_6GHZ] = {
@@ -217,7 +217,7 @@ ath12k_phymodes[NUM_NL80211_BANDS][ATH12
[NL80211_CHAN_WIDTH_40] = MODE_11BE_EHT40,
[NL80211_CHAN_WIDTH_80] = MODE_11BE_EHT80,
[NL80211_CHAN_WIDTH_160] = MODE_11BE_EHT160,
- [NL80211_CHAN_WIDTH_80P80] = MODE_11BE_EHT80_80,
+ [NL80211_CHAN_WIDTH_80P80] = MODE_UNKNOWN,
[NL80211_CHAN_WIDTH_320] = MODE_11BE_EHT320,
},
@@ -2390,17 +2390,6 @@ static void ath12k_peer_assoc_h_he(struc
switch (sta->deflink.bandwidth) {
case IEEE80211_STA_RX_BW_160:
- if (he_cap->he_cap_elem.phy_cap_info[0] &
- IEEE80211_HE_PHY_CAP0_CHANNEL_WIDTH_SET_80PLUS80_MHZ_IN_5G) {
- v = ath12k_peer_assoc_h_he_limit(v, he_mcs_mask);
- arg->peer_he_rx_mcs_set[WMI_HECAP_TXRX_MCS_NSS_IDX_80_80] = v;
-
- v = le16_to_cpu(he_cap->he_mcs_nss_supp.tx_mcs_80p80);
- arg->peer_he_tx_mcs_set[WMI_HECAP_TXRX_MCS_NSS_IDX_80_80] = v;
-
- arg->peer_he_mcs_count++;
- he_tx_mcs = v;
- }
v = le16_to_cpu(he_cap->he_mcs_nss_supp.rx_mcs_160);
arg->peer_he_rx_mcs_set[WMI_HECAP_TXRX_MCS_NSS_IDX_160] = v;
@@ -2658,16 +2647,11 @@ static enum wmi_phy_mode ath12k_mac_get_
struct ieee80211_sta *sta)
{
if (sta->deflink.bandwidth == IEEE80211_STA_RX_BW_160) {
- switch (sta->deflink.vht_cap.cap &
- IEEE80211_VHT_CAP_SUPP_CHAN_WIDTH_MASK) {
- case IEEE80211_VHT_CAP_SUPP_CHAN_WIDTH_160MHZ:
+ if (sta->deflink.vht_cap.cap &
+ IEEE80211_VHT_CAP_SUPP_CHAN_WIDTH_160MHZ)
return MODE_11AC_VHT160;
- case IEEE80211_VHT_CAP_SUPP_CHAN_WIDTH_160_80PLUS80MHZ:
- return MODE_11AC_VHT80_80;
- default:
- /* not sure if this is a valid case? */
- return MODE_11AC_VHT160;
- }
+
+ return MODE_UNKNOWN;
}
if (sta->deflink.bandwidth == IEEE80211_STA_RX_BW_80)
@@ -2689,11 +2673,8 @@ static enum wmi_phy_mode ath12k_mac_get_
if (sta->deflink.he_cap.he_cap_elem.phy_cap_info[0] &
IEEE80211_HE_PHY_CAP0_CHANNEL_WIDTH_SET_160MHZ_IN_5G)
return MODE_11AX_HE160;
- else if (sta->deflink.he_cap.he_cap_elem.phy_cap_info[0] &
- IEEE80211_HE_PHY_CAP0_CHANNEL_WIDTH_SET_80PLUS80_MHZ_IN_5G)
- return MODE_11AX_HE80_80;
- /* not sure if this is a valid case? */
- return MODE_11AX_HE160;
+
+ return MODE_UNKNOWN;
}
if (sta->deflink.bandwidth == IEEE80211_STA_RX_BW_80)
@@ -2721,14 +2702,7 @@ static enum wmi_phy_mode ath12k_mac_get_
IEEE80211_HE_PHY_CAP0_CHANNEL_WIDTH_SET_160MHZ_IN_5G)
return MODE_11BE_EHT160;
- if (sta->deflink.he_cap.he_cap_elem.phy_cap_info[0] &
- IEEE80211_HE_PHY_CAP0_CHANNEL_WIDTH_SET_80PLUS80_MHZ_IN_5G)
- return MODE_11BE_EHT80_80;
-
- ath12k_warn(ar->ab, "invalid EHT PHY capability info for 160 Mhz: %d\n",
- sta->deflink.he_cap.he_cap_elem.phy_cap_info[0]);
-
- return MODE_11BE_EHT160;
+ return MODE_UNKNOWN;
}
if (sta->deflink.bandwidth == IEEE80211_STA_RX_BW_80)
@@ -5805,8 +5779,6 @@ static void ath12k_mac_set_hemcsmap(stru
mcs_nss->tx_mcs_80 = cpu_to_le16(txmcs_map & 0xffff);
mcs_nss->rx_mcs_160 = cpu_to_le16(rxmcs_map & 0xffff);
mcs_nss->tx_mcs_160 = cpu_to_le16(txmcs_map & 0xffff);
- mcs_nss->rx_mcs_80p80 = cpu_to_le16(rxmcs_map & 0xffff);
- mcs_nss->tx_mcs_80p80 = cpu_to_le16(txmcs_map & 0xffff);
}
static void ath12k_mac_copy_he_cap(struct ath12k *ar,
@@ -5828,6 +5800,7 @@ static void ath12k_mac_copy_he_cap(struc
IEEE80211_HE_PHY_CAP0_CHANNEL_WIDTH_SET_40MHZ_IN_2G |
IEEE80211_HE_PHY_CAP0_CHANNEL_WIDTH_SET_40MHZ_80MHZ_IN_5G |
IEEE80211_HE_PHY_CAP0_CHANNEL_WIDTH_SET_160MHZ_IN_5G;
+ /* 80PLUS80 is not supported */
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] &=
@@ -8494,10 +8467,6 @@ static __le16
ath12k_mac_get_tx_mcs_map(const struct ieee80211_sta_he_cap *he_cap)
{
if (he_cap->he_cap_elem.phy_cap_info[0] &
- IEEE80211_HE_PHY_CAP0_CHANNEL_WIDTH_SET_80PLUS80_MHZ_IN_5G)
- return he_cap->he_mcs_nss_supp.tx_mcs_80p80;
-
- if (he_cap->he_cap_elem.phy_cap_info[0] &
IEEE80211_HE_PHY_CAP0_CHANNEL_WIDTH_SET_160MHZ_IN_5G)
return he_cap->he_mcs_nss_supp.tx_mcs_160;
--- a/drivers/net/wireless/ath/ath12k/wmi.c
+++ b/drivers/net/wireless/ath/ath12k/wmi.c
@@ -986,10 +986,7 @@ static void ath12k_wmi_put_wmi_channel(s
chan->mhz = cpu_to_le32(arg->freq);
chan->band_center_freq1 = cpu_to_le32(arg->band_center_freq1);
- if (arg->mode == MODE_11AC_VHT80_80)
- chan->band_center_freq2 = cpu_to_le32(arg->band_center_freq2);
- else
- chan->band_center_freq2 = 0;
+ chan->band_center_freq2 = 0;
chan->info |= le32_encode_bits(arg->mode, WMI_CHAN_INFO_MODE);
if (arg->passive)
--- a/drivers/net/wireless/ath/ath12k/wmi.h
+++ b/drivers/net/wireless/ath/ath12k/wmi.h
@@ -3633,7 +3633,6 @@ struct wmi_vdev_install_key_arg {
#define WMI_HOST_MAX_HE_RATE_SET 3
#define WMI_HECAP_TXRX_MCS_NSS_IDX_80 0
#define WMI_HECAP_TXRX_MCS_NSS_IDX_160 1
-#define WMI_HECAP_TXRX_MCS_NSS_IDX_80_80 2
struct wmi_rate_set_arg {
u32 num_rates;

View File

@ -0,0 +1,399 @@
From patchwork Wed Sep 18 21:20:55 2024
Content-Type: text/plain; charset="utf-8"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
X-Patchwork-Submitter: Pradeep Kumar Chitrapu <quic_pradeepc@quicinc.com>
X-Patchwork-Id: 13807216
X-Patchwork-Delegate: quic_jjohnson@quicinc.com
Received: from mx0b-0031df01.pphosted.com (mx0b-0031df01.pphosted.com
[205.220.180.131])
(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
(No client certificate requested)
by smtp.subspace.kernel.org (Postfix) with ESMTPS id C64DB1CB518
for <linux-wireless@vger.kernel.org>; Wed, 18 Sep 2024 21:21:15 +0000 (UTC)
Authentication-Results: smtp.subspace.kernel.org;
arc=none smtp.client-ip=205.220.180.131
ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116;
t=1726694477; cv=none;
b=aWI5JISgL9c0iB/8EAXYKF/Lb2sJoeG+v5+Va4eb/voqwiSQ4FtwPkCC00b9attXvu4dD9wEHGKPW8Uh2kb1tSTl0uNHxijRmLYK2VUWkLHsZ3Pd6VvGoTpbtmOTgsGklZHZiFd+jyWgGkHB4ZBkHSkG9JH6VR44MSIgNj8g14A=
ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org;
s=arc-20240116; t=1726694477; c=relaxed/simple;
bh=AYJpDHbXZ0n0NNHQi7/aGcqo7YfyoYhv+FrXZ143wMA=;
h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References:
MIME-Version:Content-Type;
b=jD1C2mzFvENculg9HS0v02iWUDzrWXiuU5GXTyC/0BKAJirnQkOUdVm7u0AEPiMxfkktLT3QCJLuvnKu3ZqSXWNbc2zOdUHTyW12fKdDNHib1WYYySBnfqu4EmiJKGcTE57VFlVdbklngOCDTCqHvVgP7YitGg2fWLPqBP/4yhM=
ARC-Authentication-Results: i=1; smtp.subspace.kernel.org;
dmarc=pass (p=none dis=none) header.from=quicinc.com;
spf=pass smtp.mailfrom=quicinc.com;
dkim=pass (2048-bit key) header.d=quicinc.com header.i=@quicinc.com
header.b=OMqc+btb; arc=none smtp.client-ip=205.220.180.131
Authentication-Results: smtp.subspace.kernel.org;
dmarc=pass (p=none dis=none) header.from=quicinc.com
Authentication-Results: smtp.subspace.kernel.org;
spf=pass smtp.mailfrom=quicinc.com
Authentication-Results: smtp.subspace.kernel.org;
dkim=pass (2048-bit key) header.d=quicinc.com header.i=@quicinc.com
header.b="OMqc+btb"
Received: from pps.filterd (m0279872.ppops.net [127.0.0.1])
by mx0a-0031df01.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id
48I8sxTR020476;
Wed, 18 Sep 2024 21:21:11 GMT
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=quicinc.com; h=
cc:content-transfer-encoding:content-type:date:from:in-reply-to
:message-id:mime-version:references:subject:to; s=qcppdkim1; bh=
dFohRj9vqwjJTRRYk31/1oJCFqLLKUuQ/verxCo/cGo=; b=OMqc+btbHl9cHSxO
NauW5WX4C34QsGL/4d03QTtCDlctfB5PRmINiP2/jGcVZk3NZWS3d2f5zjPY7+hd
uaUDslDMQwvAj1Jay/we1qNaFIPuzj4c9BbHqvvXa0WiCgQWpBC2h2jcFLXbeVHE
5bqH+plXU5cz1d2YbsRpCXsdUWL/+S3u6A6/qxj6UraJ1s/rkE4ndQe/AQuf96Ja
ylYiZPdtJJXzB6rPDN1bQsSET/PNXzIkrYTaDLF9A6688WU9izJdAjRcsu8oB8o1
U+yftDfoegI7+ZyTZ4JUnQs7zJp171L/qsF0U9RONZCIbSLN9pkTo6xp6CrHGeLQ
0tCmwQ==
Received: from nalasppmta05.qualcomm.com (Global_NAT1.qualcomm.com
[129.46.96.20])
by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 41n4j6uagr-1
(version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT);
Wed, 18 Sep 2024 21:21:10 +0000 (GMT)
Received: from nalasex01a.na.qualcomm.com (nalasex01a.na.qualcomm.com
[10.47.209.196])
by NALASPPMTA05.qualcomm.com (8.18.1.2/8.18.1.2) with ESMTPS id
48ILL9IB009589
(version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT);
Wed, 18 Sep 2024 21:21:09 GMT
Received: from ath12k-linux1.qualcomm.com (10.80.80.8) by
nalasex01a.na.qualcomm.com (10.47.209.196) with Microsoft SMTP Server
(version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id
15.2.1544.9; Wed, 18 Sep 2024 14:21:09 -0700
From: Pradeep Kumar Chitrapu <quic_pradeepc@quicinc.com>
To: <ath12k@lists.infradead.org>
CC: <linux-wireless@vger.kernel.org>,
Pradeep Kumar Chitrapu
<quic_pradeepc@quicinc.com>,
P Praneesh <quic_ppranees@quicinc.com>,
"Jeff
Johnson" <quic_jjohnson@quicinc.com>
Subject: [PATCH V8 8/9] wifi: ath12k: add support for 160 MHz bandwidth
Date: Wed, 18 Sep 2024 14:20:55 -0700
Message-ID: <20240918212056.4137076-9-quic_pradeepc@quicinc.com>
X-Mailer: git-send-email 2.34.1
In-Reply-To: <20240918212056.4137076-1-quic_pradeepc@quicinc.com>
References: <20240918212056.4137076-1-quic_pradeepc@quicinc.com>
Precedence: bulk
X-Mailing-List: linux-wireless@vger.kernel.org
List-Id: <linux-wireless.vger.kernel.org>
List-Subscribe: <mailto:linux-wireless+subscribe@vger.kernel.org>
List-Unsubscribe: <mailto:linux-wireless+unsubscribe@vger.kernel.org>
MIME-Version: 1.0
X-ClientProxiedBy: nasanex01a.na.qualcomm.com (10.52.223.231) To
nalasex01a.na.qualcomm.com (10.47.209.196)
X-QCInternal: smtphost
X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=5800
signatures=585085
X-Proofpoint-ORIG-GUID: wO0mnzqAAbcWYLNaoEhU3YfsdCyDJ2hk
X-Proofpoint-GUID: wO0mnzqAAbcWYLNaoEhU3YfsdCyDJ2hk
X-Proofpoint-Virus-Version: vendor=baseguard
engine=ICAP:2.0.293,Aquarius:18.0.1039,Hydra:6.0.680,FMLib:17.12.60.29
definitions=2024-09-06_09,2024-09-06_01,2024-09-02_01
X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0
phishscore=0 mlxlogscore=999
mlxscore=0 malwarescore=0 bulkscore=0 priorityscore=1501 clxscore=1015
adultscore=0 suspectscore=0 lowpriorityscore=0 spamscore=0 impostorscore=0
classifier=spam adjust=0 reason=mlx scancount=1 engine=8.19.0-2408220000
definitions=main-2409180140
Add support to configure maximum NSS in 160 MHz bandwidth.
Firmware advertises support for handling NSS ratio information
as a part of service ready ext event using nss_ratio_enabled
flag. Save this information in ath12k_pdev_cap to calculate
NSS ratio.
Additionally, reorder the code by moving
ath12k_peer_assoc_h_phymode() before ath12k_peer_assoc_h_vht()
to ensure that arg->peer_phymode correctly reflects the bandwidth
in the max NSS calculation.
Tested-on: QCN9274 hw2.0 PCI WLAN.WBE.1.0.1-00029-QCAHKSWPL_SILICONZ-1
Co-developed-by: P Praneesh <quic_ppranees@quicinc.com>
Signed-off-by: P Praneesh <quic_ppranees@quicinc.com>
Signed-off-by: Pradeep Kumar Chitrapu <quic_pradeepc@quicinc.com>
Acked-by: Jeff Johnson <quic_jjohnson@quicinc.com>
---
drivers/net/wireless/ath/ath12k/core.h | 2 +
drivers/net/wireless/ath/ath12k/mac.c | 85 ++++++++++++++++++++++----
drivers/net/wireless/ath/ath12k/mac.h | 2 +
drivers/net/wireless/ath/ath12k/wmi.c | 19 +++++-
drivers/net/wireless/ath/ath12k/wmi.h | 28 +++++++++
5 files changed, 124 insertions(+), 12 deletions(-)
--- a/drivers/net/wireless/ath/ath12k/core.h
+++ b/drivers/net/wireless/ath/ath12k/core.h
@@ -717,6 +717,8 @@ struct ath12k_pdev_cap {
u32 tx_chain_mask_shift;
u32 rx_chain_mask_shift;
struct ath12k_band_cap band[NUM_NL80211_BANDS];
+ bool nss_ratio_enabled;
+ u8 nss_ratio_info;
};
struct mlo_timestamp {
--- a/drivers/net/wireless/ath/ath12k/mac.c
+++ b/drivers/net/wireless/ath/ath12k/mac.c
@@ -2050,6 +2050,34 @@ ath12k_peer_assoc_h_vht_limit(u16 tx_mcs
return tx_mcs_set;
}
+static u8 ath12k_get_nss_160mhz(struct ath12k *ar,
+ u8 max_nss)
+{
+ u8 nss_ratio_info = ar->pdev->cap.nss_ratio_info;
+ u8 max_sup_nss = 0;
+
+ switch (nss_ratio_info) {
+ case WMI_NSS_RATIO_1BY2_NSS:
+ max_sup_nss = max_nss >> 1;
+ break;
+ case WMI_NSS_RATIO_3BY4_NSS:
+ ath12k_warn(ar->ab, "WMI_NSS_RATIO_3BY4_NSS not supported\n");
+ break;
+ case WMI_NSS_RATIO_1_NSS:
+ max_sup_nss = max_nss;
+ break;
+ case WMI_NSS_RATIO_2_NSS:
+ ath12k_warn(ar->ab, "WMI_NSS_RATIO_2_NSS not supported\n");
+ break;
+ default:
+ ath12k_warn(ar->ab, "invalid nss ratio received from fw: %d\n",
+ nss_ratio_info);
+ break;
+ }
+
+ return max_sup_nss;
+}
+
static void ath12k_peer_assoc_h_vht(struct ath12k *ar,
struct ieee80211_vif *vif,
struct ieee80211_sta *sta,
@@ -2065,6 +2093,7 @@ static void ath12k_peer_assoc_h_vht(stru
u8 max_nss, vht_mcs;
int i, vht_nss, nss_idx;
bool user_rate_valid = true;
+ u32 rx_nss, tx_nss, nss_160;
if (WARN_ON(ath12k_mac_vif_chan(vif, &def)))
return;
@@ -2159,10 +2188,24 @@ static void ath12k_peer_assoc_h_vht(stru
/* TODO: Check */
arg->tx_max_mcs_nss = 0xFF;
- ath12k_dbg(ar->ab, ATH12K_DBG_MAC, "mac vht peer %pM max_mpdu %d flags 0x%x\n",
- sta->addr, arg->peer_max_mpdu, arg->peer_flags);
+ if (arg->peer_phymode == MODE_11AC_VHT160) {
+ tx_nss = ath12k_get_nss_160mhz(ar, max_nss);
+ rx_nss = min(arg->peer_nss, tx_nss);
+ arg->peer_bw_rxnss_override = ATH12K_BW_NSS_MAP_ENABLE;
- /* TODO: rxnss_override */
+ if (!rx_nss) {
+ ath12k_warn(ar->ab, "invalid max_nss\n");
+ return;
+ }
+
+ nss_160 = u32_encode_bits(rx_nss - 1, ATH12K_PEER_RX_NSS_160MHZ);
+ arg->peer_bw_rxnss_override |= nss_160;
+ }
+
+ ath12k_dbg(ar->ab, ATH12K_DBG_MAC,
+ "mac vht peer %pM max_mpdu %d flags 0x%x nss_override 0x%x\n",
+ sta->addr, arg->peer_max_mpdu, arg->peer_flags,
+ arg->peer_bw_rxnss_override);
}
static int ath12k_mac_get_max_he_mcs_map(u16 mcs_map, int nss)
@@ -2251,6 +2294,7 @@ static void ath12k_peer_assoc_h_he(struc
u16 he_tx_mcs = 0, v = 0;
int he_nss, nss_idx;
bool user_rate_valid = true;
+ u32 rx_nss, tx_nss, nss_160;
if (WARN_ON(ath12k_mac_vif_chan(vif, &def)))
return;
@@ -2429,11 +2473,28 @@ static void ath12k_peer_assoc_h_he(struc
he_mcs_mask[i])
max_nss = i + 1;
}
+ max_nss = min(max_nss, ar->num_tx_chains);
arg->peer_nss = min(sta->deflink.rx_nss, max_nss);
+ if (arg->peer_phymode == MODE_11AX_HE160) {
+ tx_nss = ath12k_get_nss_160mhz(ar, max_nss);
+ rx_nss = min(arg->peer_nss, tx_nss);
+ arg->peer_bw_rxnss_override = ATH12K_BW_NSS_MAP_ENABLE;
+
+ if (!rx_nss) {
+ ath12k_warn(ar->ab, "invalid max_nss\n");
+ return;
+ }
+
+ nss_160 = u32_encode_bits(rx_nss - 1, ATH12K_PEER_RX_NSS_160MHZ);
+ arg->peer_bw_rxnss_override |= nss_160;
+ }
+
ath12k_dbg(ar->ab, ATH12K_DBG_MAC,
- "mac he peer %pM nss %d mcs cnt %d\n",
- sta->deflink.addr, arg->peer_nss, arg->peer_he_mcs_count);
+ "mac he peer %pM nss %d mcs cnt %d nss_override 0x%x\n",
+ sta->deflink.addr, arg->peer_nss,
+ arg->peer_he_mcs_count,
+ arg->peer_bw_rxnss_override);
}
static void ath12k_peer_assoc_h_he_6ghz(struct ath12k *ar,
@@ -2965,13 +3026,13 @@ static void ath12k_peer_assoc_prepare(st
ath12k_peer_assoc_h_basic(ar, vif, sta, arg);
ath12k_peer_assoc_h_crypto(ar, vif, sta, arg);
ath12k_peer_assoc_h_rates(ar, vif, sta, arg);
+ ath12k_peer_assoc_h_phymode(ar, vif, sta, arg);
ath12k_peer_assoc_h_ht(ar, vif, sta, arg);
ath12k_peer_assoc_h_vht(ar, vif, sta, arg);
ath12k_peer_assoc_h_he(ar, vif, sta, arg);
ath12k_peer_assoc_h_he_6ghz(ar, vif, sta, arg);
ath12k_peer_assoc_h_eht(ar, vif, sta, arg);
ath12k_peer_assoc_h_qos(ar, vif, sta, arg);
- ath12k_peer_assoc_h_phymode(ar, vif, sta, arg);
ath12k_peer_assoc_h_smps(sta, arg);
/* TODO: amsdu_disable req? */
@@ -5551,10 +5612,8 @@ ath12k_create_vht_cap(struct ath12k *ar,
ath12k_set_vht_txbf_cap(ar, &vht_cap.cap);
- /* TODO: Enable back VHT160 mode once association issues are fixed */
- /* Disabling VHT160 and VHT80+80 modes */
- vht_cap.cap &= ~IEEE80211_VHT_CAP_SUPP_CHAN_WIDTH_MASK;
- vht_cap.cap &= ~IEEE80211_VHT_CAP_SHORT_GI_160;
+ /* 80P80 is not supported */
+ vht_cap.cap &= ~IEEE80211_VHT_CAP_SUPP_CHAN_WIDTH_160_80PLUS80MHZ;
rxmcs_map = 0;
txmcs_map = 0;
@@ -9710,7 +9769,8 @@ static int ath12k_mac_setup_iface_combin
combinations[0].radar_detect_widths = BIT(NL80211_CHAN_WIDTH_20_NOHT) |
BIT(NL80211_CHAN_WIDTH_20) |
BIT(NL80211_CHAN_WIDTH_40) |
- BIT(NL80211_CHAN_WIDTH_80);
+ BIT(NL80211_CHAN_WIDTH_80) |
+ BIT(NL80211_CHAN_WIDTH_160);
wiphy->iface_combinations = combinations;
wiphy->n_iface_combinations = 1;
@@ -9926,6 +9986,9 @@ static int ath12k_mac_hw_register(struct
ieee80211_hw_set(hw, SUPPORTS_TX_FRAG);
ieee80211_hw_set(hw, REPORTS_LOW_ACK);
+ if (cap->nss_ratio_enabled)
+ ieee80211_hw_set(hw, SUPPORTS_VHT_EXT_NSS_BW);
+
if ((ht_cap & WMI_HT_CAP_ENABLED) || ar->supports_6ghz) {
ieee80211_hw_set(hw, AMPDU_AGGREGATION);
ieee80211_hw_set(hw, TX_AMPDU_SETUP_IN_HW);
--- a/drivers/net/wireless/ath/ath12k/mac.h
+++ b/drivers/net/wireless/ath/ath12k/mac.h
@@ -37,6 +37,8 @@ struct ath12k_generic_iter {
#define IEEE80211_DISABLE_VHT_MCS_SUPPORT_0_11 BIT(24)
#define ATH12K_CHAN_WIDTH_NUM 14
+#define ATH12K_BW_NSS_MAP_ENABLE BIT(31)
+#define ATH12K_PEER_RX_NSS_160MHZ GENMASK(2, 0)
#define ATH12K_TX_POWER_MAX_VAL 70
#define ATH12K_TX_POWER_MIN_VAL 0
--- a/drivers/net/wireless/ath/ath12k/wmi.c
+++ b/drivers/net/wireless/ath/ath12k/wmi.c
@@ -525,6 +525,10 @@ ath12k_pull_mac_phy_cap_svc_ready_ext(st
pdev_cap->he_mcs = le32_to_cpu(mac_caps->he_supp_mcs_5g);
pdev_cap->tx_chain_mask = le32_to_cpu(mac_caps->tx_chain_mask_5g);
pdev_cap->rx_chain_mask = le32_to_cpu(mac_caps->rx_chain_mask_5g);
+ pdev_cap->nss_ratio_enabled =
+ WMI_NSS_RATIO_EN_DIS_GET(mac_caps->nss_ratio);
+ pdev_cap->nss_ratio_info =
+ WMI_NSS_RATIO_INFO_GET(mac_caps->nss_ratio);
} else {
return -EINVAL;
}
@@ -982,11 +986,24 @@ int ath12k_wmi_vdev_down(struct ath12k *
static void ath12k_wmi_put_wmi_channel(struct ath12k_wmi_channel_params *chan,
struct wmi_vdev_start_req_arg *arg)
{
+ u32 center_freq1 = arg->band_center_freq1;
+
memset(chan, 0, sizeof(*chan));
chan->mhz = cpu_to_le32(arg->freq);
chan->band_center_freq1 = cpu_to_le32(arg->band_center_freq1);
- chan->band_center_freq2 = 0;
+ if (arg->mode == MODE_11AX_HE160) {
+ if (arg->freq > center_freq1)
+ chan->band_center_freq1 =
+ cpu_to_le32(center_freq1 + 40);
+ else
+ chan->band_center_freq1 =
+ cpu_to_le32(center_freq1 - 40);
+
+ chan->band_center_freq2 = cpu_to_le32(arg->band_center_freq1);
+ } else {
+ chan->band_center_freq2 = 0;
+ }
chan->info |= le32_encode_bits(arg->mode, WMI_CHAN_INFO_MODE);
if (arg->passive)
--- a/drivers/net/wireless/ath/ath12k/wmi.h
+++ b/drivers/net/wireless/ath/ath12k/wmi.h
@@ -2264,6 +2264,21 @@ enum wmi_direct_buffer_module {
WMI_DIRECT_BUF_MAX
};
+/**
+ * enum wmi_nss_ratio - NSS ratio received from FW during service ready ext event
+ * @WMI_NSS_RATIO_1BY2_NSS: Max nss of 160MHz is equals to half of the max nss of 80MHz
+ * @WMI_NSS_RATIO_3BY4_NSS: Max nss of 160MHz is equals to 3/4 of the max nss of 80MHz
+ * @WMI_NSS_RATIO_1_NSS: Max nss of 160MHz is equals to the max nss of 80MHz
+ * @WMI_NSS_RATIO_2_NSS: Max nss of 160MHz is equals to two times the max nss of 80MHz
+ */
+
+enum wmi_nss_ratio {
+ WMI_NSS_RATIO_1BY2_NSS,
+ WMI_NSS_RATIO_3BY4_NSS,
+ WMI_NSS_RATIO_1_NSS,
+ WMI_NSS_RATIO_2_NSS
+};
+
struct ath12k_wmi_pdev_band_arg {
u32 pdev_id;
u32 start_freq;
@@ -2580,6 +2595,12 @@ struct ath12k_wmi_hw_mode_cap_params {
} __packed;
#define WMI_MAX_HECAP_PHY_SIZE (3)
+#define WMI_NSS_RATIO_EN_DIS_BITPOS BIT(0)
+#define WMI_NSS_RATIO_EN_DIS_GET(_val) \
+ le32_get_bits(_val, WMI_NSS_RATIO_EN_DIS_BITPOS)
+#define WMI_NSS_RATIO_INFO_BITPOS GENMASK(4, 1)
+#define WMI_NSS_RATIO_INFO_GET(_val) \
+ le32_get_bits(_val, WMI_NSS_RATIO_INFO_BITPOS)
/* pdev_id is present in lower 16 bits of pdev_and_hw_link_ids in
* ath12k_wmi_mac_phy_caps_params & ath12k_wmi_caps_ext_params.
@@ -2621,6 +2642,13 @@ struct ath12k_wmi_mac_phy_caps_params {
__le32 he_cap_info_2g_ext;
__le32 he_cap_info_5g_ext;
__le32 he_cap_info_internal;
+ __le32 wireless_modes;
+ __le32 low_2ghz_chan_freq;
+ __le32 high_2ghz_chan_freq;
+ __le32 low_5ghz_chan_freq;
+ __le32 high_5ghz_chan_freq;
+ __le32 nss_ratio;
+
} __packed;
struct ath12k_wmi_hal_reg_caps_ext_params {

View File

@ -0,0 +1,191 @@
From patchwork Wed Sep 18 21:20:56 2024
Content-Type: text/plain; charset="utf-8"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
X-Patchwork-Submitter: Pradeep Kumar Chitrapu <quic_pradeepc@quicinc.com>
X-Patchwork-Id: 13807214
X-Patchwork-Delegate: quic_jjohnson@quicinc.com
Received: from mx0a-0031df01.pphosted.com (mx0a-0031df01.pphosted.com
[205.220.168.131])
(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
(No client certificate requested)
by smtp.subspace.kernel.org (Postfix) with ESMTPS id A44471CB32B
for <linux-wireless@vger.kernel.org>; Wed, 18 Sep 2024 21:21:14 +0000 (UTC)
Authentication-Results: smtp.subspace.kernel.org;
arc=none smtp.client-ip=205.220.168.131
ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116;
t=1726694476; cv=none;
b=YnQUUZ4IfmLtgtYCtYRGhH8uRGd6VL74IRylGv6Ihb2PMO/n5UdfZlDk/m9w0OH4/sSsqULSz2lupiSTwXCPxc+73uK+OUjIEmCfPlNdrtzK2naXyiXAASPqonpnRBnyoIFwaE8zj8AHUqk5TAajedqpK9EnOaboX2XGYVbe0yI=
ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org;
s=arc-20240116; t=1726694476; c=relaxed/simple;
bh=TAPBD6g5pYNuC8Odk6t6JkL8GvKdG9H30IPHTEgA7C0=;
h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References:
MIME-Version:Content-Type;
b=djAINL+wQRgQaGOI4fotrExnm1Yz5quwEW2I7s85hWLI3gB+HsjwPKWJypllDKm8W0FDcrsoZWFmOrfx0wJ5LIe+OtXJ4ijSG7xcJeGtgDXZ3hAA5ZBk/B+CD+g+NZ3c0mwkSKpUm5dUBPKi1+kJsPuVEwKeCmdMVj8QHSYMXPw=
ARC-Authentication-Results: i=1; smtp.subspace.kernel.org;
dmarc=pass (p=none dis=none) header.from=quicinc.com;
spf=pass smtp.mailfrom=quicinc.com;
dkim=pass (2048-bit key) header.d=quicinc.com header.i=@quicinc.com
header.b=i4iTJD+Z; arc=none smtp.client-ip=205.220.168.131
Authentication-Results: smtp.subspace.kernel.org;
dmarc=pass (p=none dis=none) header.from=quicinc.com
Authentication-Results: smtp.subspace.kernel.org;
spf=pass smtp.mailfrom=quicinc.com
Authentication-Results: smtp.subspace.kernel.org;
dkim=pass (2048-bit key) header.d=quicinc.com header.i=@quicinc.com
header.b="i4iTJD+Z"
Received: from pps.filterd (m0279863.ppops.net [127.0.0.1])
by mx0a-0031df01.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id
48I9VJ15022098;
Wed, 18 Sep 2024 21:21:11 GMT
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=quicinc.com; h=
cc:content-transfer-encoding:content-type:date:from:in-reply-to
:message-id:mime-version:references:subject:to; s=qcppdkim1; bh=
2gwv4CbPGErAHv9NWtZrCSVk7NoZpHzKz9tuTs+8dV4=; b=i4iTJD+ZMXDp8Ul8
HTo5IL/NLwS3mnlutEaaL+juUKm+wsFdl/BeMp9CC4H/sapolIhM4Zje9t3H9K0R
+z1OxQDEekvWrrfUlikEaUHjOEwQ4YKSPJ+1uAIrbbA3REWeW5z39IITJ3dGU05N
hnfPQEiFcPgDbFQv0Iaf434znv8rbOow6dc+M1E6EjpGd92Mq80BpsJqP8Ee0RUr
WO3rsws1kXzFs6ELsg/FmC3l6eG9A4z9SUxcZ7QqTaz8aPOAZS/lclN0cOJT7VgK
7UNPGoDoJhTmHEX17W/rQR8RiV8c0hMciOuB1sfI7H/1uGkEPMjmfIsEdBjQ/9oa
DDiHrg==
Received: from nalasppmta02.qualcomm.com (Global_NAT1.qualcomm.com
[129.46.96.20])
by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 41n4hfk92c-1
(version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT);
Wed, 18 Sep 2024 21:21:11 +0000 (GMT)
Received: from nalasex01a.na.qualcomm.com (nalasex01a.na.qualcomm.com
[10.47.209.196])
by NALASPPMTA02.qualcomm.com (8.18.1.2/8.18.1.2) with ESMTPS id
48ILLA0u011397
(version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT);
Wed, 18 Sep 2024 21:21:10 GMT
Received: from ath12k-linux1.qualcomm.com (10.80.80.8) by
nalasex01a.na.qualcomm.com (10.47.209.196) with Microsoft SMTP Server
(version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id
15.2.1544.9; Wed, 18 Sep 2024 14:21:09 -0700
From: Pradeep Kumar Chitrapu <quic_pradeepc@quicinc.com>
To: <ath12k@lists.infradead.org>
CC: <linux-wireless@vger.kernel.org>,
Pradeep Kumar Chitrapu
<quic_pradeepc@quicinc.com>,
Jeff Johnson <quic_jjohnson@quicinc.com>
Subject: [PATCH V8 9/9] wifi: ath12k: add extended NSS bandwidth support for
160 MHz
Date: Wed, 18 Sep 2024 14:20:56 -0700
Message-ID: <20240918212056.4137076-10-quic_pradeepc@quicinc.com>
X-Mailer: git-send-email 2.34.1
In-Reply-To: <20240918212056.4137076-1-quic_pradeepc@quicinc.com>
References: <20240918212056.4137076-1-quic_pradeepc@quicinc.com>
Precedence: bulk
X-Mailing-List: linux-wireless@vger.kernel.org
List-Id: <linux-wireless.vger.kernel.org>
List-Subscribe: <mailto:linux-wireless+subscribe@vger.kernel.org>
List-Unsubscribe: <mailto:linux-wireless+unsubscribe@vger.kernel.org>
MIME-Version: 1.0
X-ClientProxiedBy: nasanex01a.na.qualcomm.com (10.52.223.231) To
nalasex01a.na.qualcomm.com (10.47.209.196)
X-QCInternal: smtphost
X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=5800
signatures=585085
X-Proofpoint-GUID: Mta6b5FqdCLrvsiUf1WwMHFr8SiJUh5L
X-Proofpoint-ORIG-GUID: Mta6b5FqdCLrvsiUf1WwMHFr8SiJUh5L
X-Proofpoint-Virus-Version: vendor=baseguard
engine=ICAP:2.0.293,Aquarius:18.0.1039,Hydra:6.0.680,FMLib:17.12.60.29
definitions=2024-09-06_09,2024-09-06_01,2024-09-02_01
X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0
priorityscore=1501
clxscore=1015 phishscore=0 malwarescore=0 mlxlogscore=999 mlxscore=0
impostorscore=0 adultscore=0 suspectscore=0 lowpriorityscore=0 spamscore=0
bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1
engine=8.19.0-2408220000 definitions=main-2409180140
Currently rx and tx MCS map for 160 MHz under HE capabilities
are not updating properly, when 160 MHz is configured with NSS
lesser than max NSS support. Fix this by utilizing
nss_ratio_enabled and nss_ratio_info fields sent by firmware
in service ready event.
However, if firmware advertises EXT NSS BW support in VHT caps
as 1(1x2) and when nss_ratio_info indicates 1:1, reset the EXT
NSS BW Support in VHT caps to 0 which indicates 1x1. This is
to avoid incorrectly choosing 1:2 NSS ratio when using the
default VHT caps advertised by firmware.
Tested-on: QCN9274 hw2.0 PCI WLAN.WBE.1.0.1-00029-QCAHKSWPL_SILICONZ-1
Signed-off-by: Pradeep Kumar Chitrapu <quic_pradeepc@quicinc.com>
Acked-by: Jeff Johnson <quic_jjohnson@quicinc.com>
---
drivers/net/wireless/ath/ath12k/mac.c | 33 ++++++++++++++++++++++-----
1 file changed, 27 insertions(+), 6 deletions(-)
--- a/drivers/net/wireless/ath/ath12k/mac.c
+++ b/drivers/net/wireless/ath/ath12k/mac.c
@@ -2477,8 +2477,10 @@ static void ath12k_peer_assoc_h_he(struc
arg->peer_nss = min(sta->deflink.rx_nss, max_nss);
if (arg->peer_phymode == MODE_11AX_HE160) {
- tx_nss = ath12k_get_nss_160mhz(ar, max_nss);
+ tx_nss = ath12k_get_nss_160mhz(ar, ar->num_tx_chains);
rx_nss = min(arg->peer_nss, tx_nss);
+
+ arg->peer_nss = min(sta->deflink.rx_nss, ar->num_rx_chains);
arg->peer_bw_rxnss_override = ATH12K_BW_NSS_MAP_ENABLE;
if (!rx_nss) {
@@ -5635,6 +5637,12 @@ ath12k_create_vht_cap(struct ath12k *ar,
vht_cap.vht_mcs.rx_mcs_map = cpu_to_le16(rxmcs_map);
vht_cap.vht_mcs.tx_mcs_map = cpu_to_le16(txmcs_map);
+ /* Check if the HW supports 1:1 NSS ratio and reset
+ * EXT NSS BW Support field to 0 to indicate 1:1 ratio
+ */
+ if (ar->pdev->cap.nss_ratio_info == WMI_NSS_RATIO_1_NSS)
+ vht_cap.cap &= ~IEEE80211_VHT_CAP_EXT_NSS_BW_MASK;
+
return vht_cap;
}
@@ -5815,11 +5823,12 @@ static void ath12k_mac_set_hemcsmap(stru
struct ieee80211_sta_he_cap *he_cap)
{
struct ieee80211_he_mcs_nss_supp *mcs_nss = &he_cap->he_mcs_nss_supp;
- u16 txmcs_map, rxmcs_map;
+ u8 maxtxnss_160 = ath12k_get_nss_160mhz(ar, ar->num_tx_chains);
+ u8 maxrxnss_160 = ath12k_get_nss_160mhz(ar, ar->num_rx_chains);
+ u16 txmcs_map_160 = 0, rxmcs_map_160 = 0;
+ u16 txmcs_map = 0, rxmcs_map = 0;
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))
@@ -5832,12 +5841,24 @@ static void ath12k_mac_set_hemcsmap(stru
rxmcs_map |= IEEE80211_HE_MCS_SUPPORT_0_11 << (i * 2);
else
rxmcs_map |= IEEE80211_HE_MCS_NOT_SUPPORTED << (i * 2);
+
+ if (i < maxtxnss_160 &&
+ (ar->cfg_tx_chainmask >> cap->tx_chain_mask_shift) & BIT(i))
+ txmcs_map_160 |= IEEE80211_HE_MCS_SUPPORT_0_11 << (i * 2);
+ else
+ txmcs_map_160 |= IEEE80211_HE_MCS_NOT_SUPPORTED << (i * 2);
+
+ if (i < maxrxnss_160 &&
+ (ar->cfg_tx_chainmask >> cap->tx_chain_mask_shift) & BIT(i))
+ rxmcs_map_160 |= IEEE80211_HE_MCS_SUPPORT_0_11 << (i * 2);
+ else
+ rxmcs_map_160 |= IEEE80211_HE_MCS_NOT_SUPPORTED << (i * 2);
}
mcs_nss->rx_mcs_80 = cpu_to_le16(rxmcs_map & 0xffff);
mcs_nss->tx_mcs_80 = cpu_to_le16(txmcs_map & 0xffff);
- mcs_nss->rx_mcs_160 = cpu_to_le16(rxmcs_map & 0xffff);
- mcs_nss->tx_mcs_160 = cpu_to_le16(txmcs_map & 0xffff);
+ mcs_nss->rx_mcs_160 = cpu_to_le16(rxmcs_map_160 & 0xffff);
+ mcs_nss->tx_mcs_160 = cpu_to_le16(txmcs_map_160 & 0xffff);
}
static void ath12k_mac_copy_he_cap(struct ath12k *ar,

View File

@ -0,0 +1,548 @@
From: Johannes Berg <johannes.berg@intel.com>
Date: Mon, 7 Oct 2024 15:00:54 +0300
Subject: [PATCH] wifi: mac80211: call rate_control_rate_update() for link STA
In order to update the right link information, call the update
rate_control_rate_update() with the right link_sta, and then
pass that through to the driver's sta_rc_update() method. The
software rate control still doesn't support it, but that'll be
skipped by not having a rate control ref.
Since it now operates on a link sta, rename the driver method.
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
Link: https://patch.msgid.link/20241007144851.5851b6b5fd41.Ibdf50d96afa4b761dd9b9dfd54a1147e77a75329@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
---
--- a/drivers/net/wireless/ath/ath10k/mac.c
+++ b/drivers/net/wireless/ath/ath10k/mac.c
@@ -8507,9 +8507,10 @@ exit:
static void ath10k_sta_rc_update(struct ieee80211_hw *hw,
struct ieee80211_vif *vif,
- struct ieee80211_sta *sta,
+ struct ieee80211_link_sta *link_sta,
u32 changed)
{
+ struct ieee80211_sta *sta = link_sta->sta;
struct ath10k *ar = hw->priv;
struct ath10k_sta *arsta = (struct ath10k_sta *)sta->drv_priv;
struct ath10k_vif *arvif = (void *)vif->drv_priv;
@@ -9450,7 +9451,7 @@ static const struct ieee80211_ops ath10k
.reconfig_complete = ath10k_reconfig_complete,
.get_survey = ath10k_get_survey,
.set_bitrate_mask = ath10k_mac_op_set_bitrate_mask,
- .sta_rc_update = ath10k_sta_rc_update,
+ .link_sta_rc_update = ath10k_sta_rc_update,
.offset_tsf = ath10k_offset_tsf,
.ampdu_action = ath10k_ampdu_action,
.get_et_sset_count = ath10k_debug_get_et_sset_count,
--- a/drivers/net/wireless/ath/ath11k/mac.c
+++ b/drivers/net/wireless/ath/ath11k/mac.c
@@ -5079,9 +5079,10 @@ static void ath11k_mac_op_sta_set_4addr(
static void ath11k_mac_op_sta_rc_update(struct ieee80211_hw *hw,
struct ieee80211_vif *vif,
- struct ieee80211_sta *sta,
+ struct ieee80211_link_sta *link_sta,
u32 changed)
{
+ struct ieee80211_sta *sta = link_sta->sta;
struct ath11k *ar = hw->priv;
struct ath11k_sta *arsta = ath11k_sta_to_arsta(sta);
struct ath11k_vif *arvif = ath11k_vif_to_arvif(vif);
@@ -9708,7 +9709,7 @@ static const struct ieee80211_ops ath11k
.sta_state = ath11k_mac_op_sta_state,
.sta_set_4addr = ath11k_mac_op_sta_set_4addr,
.sta_set_txpwr = ath11k_mac_op_sta_set_txpwr,
- .sta_rc_update = ath11k_mac_op_sta_rc_update,
+ .link_sta_rc_update = ath11k_mac_op_sta_rc_update,
.conf_tx = ath11k_mac_op_conf_tx,
.set_antenna = ath11k_mac_op_set_antenna,
.get_antenna = ath11k_mac_op_get_antenna,
--- a/drivers/net/wireless/ath/ath12k/mac.c
+++ b/drivers/net/wireless/ath/ath12k/mac.c
@@ -4740,9 +4740,10 @@ out:
static void ath12k_mac_op_sta_rc_update(struct ieee80211_hw *hw,
struct ieee80211_vif *vif,
- struct ieee80211_sta *sta,
+ struct ieee80211_link_sta *link_sta,
u32 changed)
{
+ struct ieee80211_sta *sta = link_sta->sta;
struct ath12k *ar;
struct ath12k_sta *arsta = ath12k_sta_to_arsta(sta);
struct ath12k_vif *arvif = ath12k_vif_to_arvif(vif);
@@ -8684,7 +8685,7 @@ static const struct ieee80211_ops ath12k
.set_rekey_data = ath12k_mac_op_set_rekey_data,
.sta_state = ath12k_mac_op_sta_state,
.sta_set_txpwr = ath12k_mac_op_sta_set_txpwr,
- .sta_rc_update = ath12k_mac_op_sta_rc_update,
+ .link_sta_rc_update = ath12k_mac_op_sta_rc_update,
.conf_tx = ath12k_mac_op_conf_tx,
.set_antenna = ath12k_mac_op_set_antenna,
.get_antenna = ath12k_mac_op_get_antenna,
--- a/drivers/net/wireless/ath/ath9k/htc_drv_main.c
+++ b/drivers/net/wireless/ath/ath9k/htc_drv_main.c
@@ -1357,8 +1357,10 @@ static int ath9k_htc_sta_remove(struct i
static void ath9k_htc_sta_rc_update(struct ieee80211_hw *hw,
struct ieee80211_vif *vif,
- struct ieee80211_sta *sta, u32 changed)
+ struct ieee80211_link_sta *link_sta,
+ u32 changed)
{
+ struct ieee80211_sta *sta = link_sta->sta;
struct ath9k_htc_sta *ista = (struct ath9k_htc_sta *) sta->drv_priv;
if (!(changed & IEEE80211_RC_SUPP_RATES_CHANGED))
@@ -1883,7 +1885,7 @@ struct ieee80211_ops ath9k_htc_ops = {
.sta_add = ath9k_htc_sta_add,
.sta_remove = ath9k_htc_sta_remove,
.conf_tx = ath9k_htc_conf_tx,
- .sta_rc_update = ath9k_htc_sta_rc_update,
+ .link_sta_rc_update = ath9k_htc_sta_rc_update,
.bss_info_changed = ath9k_htc_bss_info_changed,
.set_key = ath9k_htc_set_key,
.get_tsf = ath9k_htc_get_tsf,
--- a/drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c
+++ b/drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c
@@ -4248,8 +4248,9 @@ int iwl_mvm_mac_set_rts_threshold(struct
}
void iwl_mvm_sta_rc_update(struct ieee80211_hw *hw, struct ieee80211_vif *vif,
- struct ieee80211_sta *sta, u32 changed)
+ struct ieee80211_link_sta *link_sta, u32 changed)
{
+ struct ieee80211_sta *sta = link_sta->sta;
struct iwl_mvm *mvm = IWL_MAC80211_GET_MVM(hw);
if (changed & (IEEE80211_RC_BW_CHANGED |
@@ -6574,7 +6575,7 @@ const struct ieee80211_ops iwl_mvm_hw_op
.allow_buffered_frames = iwl_mvm_mac_allow_buffered_frames,
.release_buffered_frames = iwl_mvm_mac_release_buffered_frames,
.set_rts_threshold = iwl_mvm_mac_set_rts_threshold,
- .sta_rc_update = iwl_mvm_sta_rc_update,
+ .link_sta_rc_update = iwl_mvm_sta_rc_update,
.conf_tx = iwl_mvm_mac_conf_tx,
.mgd_prepare_tx = iwl_mvm_mac_mgd_prepare_tx,
.mgd_complete_tx = iwl_mvm_mac_mgd_complete_tx,
--- a/drivers/net/wireless/intel/iwlwifi/mvm/mld-mac80211.c
+++ b/drivers/net/wireless/intel/iwlwifi/mvm/mld-mac80211.c
@@ -1413,7 +1413,7 @@ const struct ieee80211_ops iwl_mvm_mld_h
.allow_buffered_frames = iwl_mvm_mac_allow_buffered_frames,
.release_buffered_frames = iwl_mvm_mac_release_buffered_frames,
.set_rts_threshold = iwl_mvm_mac_set_rts_threshold,
- .sta_rc_update = iwl_mvm_sta_rc_update,
+ .link_sta_rc_update = iwl_mvm_sta_rc_update,
.conf_tx = iwl_mvm_mld_mac_conf_tx,
.mgd_prepare_tx = iwl_mvm_mac_mgd_prepare_tx,
.mgd_complete_tx = iwl_mvm_mac_mgd_complete_tx,
--- a/drivers/net/wireless/intel/iwlwifi/mvm/mvm.h
+++ b/drivers/net/wireless/intel/iwlwifi/mvm/mvm.h
@@ -2914,7 +2914,7 @@ iwl_mvm_mac_release_buffered_frames(stru
bool more_data);
int iwl_mvm_mac_set_rts_threshold(struct ieee80211_hw *hw, u32 value);
void iwl_mvm_sta_rc_update(struct ieee80211_hw *hw, struct ieee80211_vif *vif,
- struct ieee80211_sta *sta, u32 changed);
+ struct ieee80211_link_sta *link_sta, u32 changed);
void iwl_mvm_mac_mgd_prepare_tx(struct ieee80211_hw *hw,
struct ieee80211_vif *vif,
struct ieee80211_prep_tx_info *info);
--- a/drivers/net/wireless/mediatek/mt76/mt7915/main.c
+++ b/drivers/net/wireless/mediatek/mt76/mt7915/main.c
@@ -1163,9 +1163,10 @@ static void mt7915_sta_rc_work(void *dat
static void mt7915_sta_rc_update(struct ieee80211_hw *hw,
struct ieee80211_vif *vif,
- struct ieee80211_sta *sta,
+ struct ieee80211_link_sta *link_sta,
u32 changed)
{
+ struct ieee80211_sta *sta = link_sta->sta;
struct mt7915_phy *phy = mt7915_hw_phy(hw);
struct mt7915_dev *dev = phy->dev;
struct mt7915_sta *msta = (struct mt7915_sta *)sta->drv_priv;
@@ -1709,7 +1710,7 @@ const struct ieee80211_ops mt7915_ops =
.stop_ap = mt7915_stop_ap,
.sta_state = mt76_sta_state,
.sta_pre_rcu_remove = mt76_sta_pre_rcu_remove,
- .sta_rc_update = mt7915_sta_rc_update,
+ .link_sta_rc_update = mt7915_sta_rc_update,
.set_key = mt7915_set_key,
.ampdu_action = mt7915_ampdu_action,
.set_rts_threshold = mt7915_set_rts_threshold,
--- a/drivers/net/wireless/mediatek/mt76/mt7996/main.c
+++ b/drivers/net/wireless/mediatek/mt76/mt7996/main.c
@@ -1060,9 +1060,10 @@ static void mt7996_sta_rc_work(void *dat
static void mt7996_sta_rc_update(struct ieee80211_hw *hw,
struct ieee80211_vif *vif,
- struct ieee80211_sta *sta,
+ struct ieee80211_link_sta *link_sta,
u32 changed)
{
+ struct ieee80211_sta *sta = link_sta->sta;
struct mt7996_phy *phy = mt7996_hw_phy(hw);
struct mt7996_dev *dev = phy->dev;
@@ -1472,7 +1473,7 @@ const struct ieee80211_ops mt7996_ops =
.sta_add = mt7996_sta_add,
.sta_remove = mt7996_sta_remove,
.sta_pre_rcu_remove = mt76_sta_pre_rcu_remove,
- .sta_rc_update = mt7996_sta_rc_update,
+ .link_sta_rc_update = mt7996_sta_rc_update,
.set_key = mt7996_set_key,
.ampdu_action = mt7996_ampdu_action,
.set_rts_threshold = mt7996_set_rts_threshold,
--- a/drivers/net/wireless/realtek/rtw88/mac80211.c
+++ b/drivers/net/wireless/realtek/rtw88/mac80211.c
@@ -928,8 +928,10 @@ static int rtw_ops_set_sar_specs(struct
static void rtw_ops_sta_rc_update(struct ieee80211_hw *hw,
struct ieee80211_vif *vif,
- struct ieee80211_sta *sta, u32 changed)
+ struct ieee80211_link_sta *link_sta,
+ u32 changed)
{
+ struct ieee80211_sta *sta = link_sta->sta;
struct rtw_dev *rtwdev = hw->priv;
struct rtw_sta_info *si = (struct rtw_sta_info *)sta->drv_priv;
@@ -973,7 +975,7 @@ const struct ieee80211_ops rtw_ops = {
.reconfig_complete = rtw_reconfig_complete,
.hw_scan = rtw_ops_hw_scan,
.cancel_hw_scan = rtw_ops_cancel_hw_scan,
- .sta_rc_update = rtw_ops_sta_rc_update,
+ .link_sta_rc_update = rtw_ops_sta_rc_update,
.set_sar_specs = rtw_ops_set_sar_specs,
#ifdef CONFIG_PM
.suspend = rtw_ops_suspend,
--- a/drivers/net/wireless/realtek/rtw89/mac80211.c
+++ b/drivers/net/wireless/realtek/rtw89/mac80211.c
@@ -1290,8 +1290,10 @@ out:
static void rtw89_ops_sta_rc_update(struct ieee80211_hw *hw,
struct ieee80211_vif *vif,
- struct ieee80211_sta *sta, u32 changed)
+ struct ieee80211_link_sta *link_sta,
+ u32 changed)
{
+ struct ieee80211_sta *sta = link_sta->sta;
struct rtw89_dev *rtwdev = hw->priv;
rtw89_phy_ra_update_sta(rtwdev, sta, changed);
@@ -1594,7 +1596,7 @@ const struct ieee80211_ops rtw89_ops = {
.remain_on_channel = rtw89_ops_remain_on_channel,
.cancel_remain_on_channel = rtw89_ops_cancel_remain_on_channel,
.set_sar_specs = rtw89_ops_set_sar_specs,
- .sta_rc_update = rtw89_ops_sta_rc_update,
+ .link_sta_rc_update = rtw89_ops_sta_rc_update,
.set_tid_config = rtw89_ops_set_tid_config,
#ifdef CONFIG_PM
.suspend = rtw89_ops_suspend,
--- a/drivers/net/wireless/ti/wlcore/main.c
+++ b/drivers/net/wireless/ti/wlcore/main.c
@@ -5789,9 +5789,10 @@ static int wlcore_op_cancel_remain_on_ch
static void wlcore_op_sta_rc_update(struct ieee80211_hw *hw,
struct ieee80211_vif *vif,
- struct ieee80211_sta *sta,
+ struct ieee80211_link_sta *link_sta,
u32 changed)
{
+ struct ieee80211_sta *sta = link_sta->sta;
struct wl12xx_vif *wlvif = wl12xx_vif_to_data(vif);
wl1271_debug(DEBUG_MAC80211, "mac80211 sta_rc_update");
@@ -6052,7 +6053,7 @@ static const struct ieee80211_ops wl1271
.assign_vif_chanctx = wlcore_op_assign_vif_chanctx,
.unassign_vif_chanctx = wlcore_op_unassign_vif_chanctx,
.switch_vif_chanctx = wlcore_op_switch_vif_chanctx,
- .sta_rc_update = wlcore_op_sta_rc_update,
+ .link_sta_rc_update = wlcore_op_sta_rc_update,
.sta_statistics = wlcore_op_sta_statistics,
.get_expected_throughput = wlcore_op_get_expected_throughput,
CFG80211_TESTMODE_CMD(wl1271_tm_cmd)
--- a/drivers/net/wireless/virtual/mac80211_hwsim.c
+++ b/drivers/net/wireless/virtual/mac80211_hwsim.c
@@ -2594,10 +2594,11 @@ static void mac80211_hwsim_link_info_cha
static void
mac80211_hwsim_sta_rc_update(struct ieee80211_hw *hw,
struct ieee80211_vif *vif,
- struct ieee80211_sta *sta,
+ struct ieee80211_link_sta *link_sta,
u32 changed)
{
struct mac80211_hwsim_data *data = hw->priv;
+ struct ieee80211_sta *sta = link_sta->sta;
u32 bw = U32_MAX;
int link_id;
@@ -2607,7 +2608,6 @@ mac80211_hwsim_sta_rc_update(struct ieee
link_id++) {
enum nl80211_chan_width confbw = NL80211_CHAN_WIDTH_20_NOHT;
struct ieee80211_bss_conf *vif_conf;
- struct ieee80211_link_sta *link_sta;
link_sta = rcu_dereference(sta->link[link_id]);
@@ -2659,7 +2659,7 @@ static int mac80211_hwsim_sta_add(struct
hwsim_check_magic(vif);
hwsim_set_sta_magic(sta);
- mac80211_hwsim_sta_rc_update(hw, vif, sta, 0);
+ mac80211_hwsim_sta_rc_update(hw, vif, &sta->deflink, 0);
if (sta->valid_links) {
WARN(hweight16(sta->valid_links) > 1,
@@ -3961,7 +3961,7 @@ out:
.link_info_changed = mac80211_hwsim_link_info_changed, \
.tx_last_beacon = mac80211_hwsim_tx_last_beacon, \
.sta_notify = mac80211_hwsim_sta_notify, \
- .sta_rc_update = mac80211_hwsim_sta_rc_update, \
+ .link_sta_rc_update = mac80211_hwsim_sta_rc_update, \
.conf_tx = mac80211_hwsim_conf_tx, \
.get_survey = mac80211_hwsim_get_survey, \
CFG80211_TESTMODE_CMD(mac80211_hwsim_testmode_cmd) \
--- a/include/net/mac80211.h
+++ b/include/net/mac80211.h
@@ -4075,8 +4075,8 @@ struct ieee80211_prep_tx_info {
* in @sta_state.
* The callback can sleep.
*
- * @sta_rc_update: Notifies the driver of changes to the bitrates that can be
- * used to transmit to the station. The changes are advertised with bits
+ * @link_sta_rc_update: Notifies the driver of changes to the bitrates that can
+ * be used to transmit to the station. The changes are advertised with bits
* from &enum ieee80211_rate_control_changed and the values are reflected
* in the station data. This callback should only be used when the driver
* uses hardware rate control (%IEEE80211_HW_HAS_RATE_CONTROL) since
@@ -4560,10 +4560,10 @@ struct ieee80211_ops {
void (*sta_pre_rcu_remove)(struct ieee80211_hw *hw,
struct ieee80211_vif *vif,
struct ieee80211_sta *sta);
- void (*sta_rc_update)(struct ieee80211_hw *hw,
- struct ieee80211_vif *vif,
- struct ieee80211_sta *sta,
- u32 changed);
+ void (*link_sta_rc_update)(struct ieee80211_hw *hw,
+ struct ieee80211_vif *vif,
+ struct ieee80211_link_sta *link_sta,
+ u32 changed);
void (*sta_rate_tbl_update)(struct ieee80211_hw *hw,
struct ieee80211_vif *vif,
struct ieee80211_sta *sta);
--- a/net/mac80211/chan.c
+++ b/net/mac80211/chan.c
@@ -467,7 +467,7 @@ static void ieee80211_chan_bw_change(str
continue;
link_sta->pub->bandwidth = new_sta_bw;
- rate_control_rate_update(local, sband, sta, link_id,
+ rate_control_rate_update(local, sband, link_sta,
IEEE80211_RC_BW_CHANGED);
}
}
--- a/net/mac80211/driver-ops.c
+++ b/net/mac80211/driver-ops.c
@@ -181,9 +181,10 @@ int drv_sta_set_txpwr(struct ieee80211_l
return ret;
}
-void drv_sta_rc_update(struct ieee80211_local *local,
- struct ieee80211_sub_if_data *sdata,
- struct ieee80211_sta *sta, u32 changed)
+void drv_link_sta_rc_update(struct ieee80211_local *local,
+ struct ieee80211_sub_if_data *sdata,
+ struct ieee80211_link_sta *link_sta,
+ u32 changed)
{
sdata = get_bss_sdata(sdata);
if (!check_sdata_in_driver(sdata))
@@ -193,10 +194,10 @@ void drv_sta_rc_update(struct ieee80211_
(sdata->vif.type != NL80211_IFTYPE_ADHOC &&
sdata->vif.type != NL80211_IFTYPE_MESH_POINT));
- trace_drv_sta_rc_update(local, sdata, sta, changed);
- if (local->ops->sta_rc_update)
- local->ops->sta_rc_update(&local->hw, &sdata->vif,
- sta, changed);
+ trace_drv_link_sta_rc_update(local, sdata, link_sta, changed);
+ if (local->ops->link_sta_rc_update)
+ local->ops->link_sta_rc_update(&local->hw, &sdata->vif,
+ link_sta, changed);
trace_drv_return_void(local);
}
--- a/net/mac80211/driver-ops.h
+++ b/net/mac80211/driver-ops.h
@@ -594,9 +594,9 @@ int drv_sta_set_txpwr(struct ieee80211_l
struct ieee80211_sub_if_data *sdata,
struct sta_info *sta);
-void drv_sta_rc_update(struct ieee80211_local *local,
- struct ieee80211_sub_if_data *sdata,
- struct ieee80211_sta *sta, u32 changed);
+void drv_link_sta_rc_update(struct ieee80211_local *local,
+ struct ieee80211_sub_if_data *sdata,
+ struct ieee80211_link_sta *link_sta, u32 changed);
static inline void drv_sta_rate_tbl_update(struct ieee80211_local *local,
struct ieee80211_sub_if_data *sdata,
--- a/net/mac80211/ibss.c
+++ b/net/mac80211/ibss.c
@@ -1072,7 +1072,8 @@ static void ieee80211_update_sta_info(st
if (sta->sta.deflink.rx_nss != rx_nss)
changed |= IEEE80211_RC_NSS_CHANGED;
- drv_sta_rc_update(local, sdata, &sta->sta, changed);
+ drv_link_sta_rc_update(local, sdata, &sta->sta.deflink,
+ changed);
}
rcu_read_unlock();
--- a/net/mac80211/mesh_plink.c
+++ b/net/mac80211/mesh_plink.c
@@ -489,7 +489,7 @@ static void mesh_sta_info_init(struct ie
if (!test_sta_flag(sta, WLAN_STA_RATE_CONTROL))
rate_control_rate_init(sta);
else
- rate_control_rate_update(local, sband, sta, 0, changed);
+ rate_control_rate_update(local, sband, &sta->deflink, changed);
out:
spin_unlock_bh(&sta->mesh->plink_lock);
}
--- a/net/mac80211/rate.c
+++ b/net/mac80211/rate.c
@@ -93,16 +93,15 @@ void rate_control_tx_status(struct ieee8
void rate_control_rate_update(struct ieee80211_local *local,
struct ieee80211_supported_band *sband,
- struct sta_info *sta, unsigned int link_id,
+ struct link_sta_info *link_sta,
u32 changed)
{
struct rate_control_ref *ref = local->rate_ctrl;
+ struct sta_info *sta = link_sta->sta;
struct ieee80211_sta *ista = &sta->sta;
void *priv_sta = sta->rate_ctrl_priv;
struct ieee80211_chanctx_conf *chanctx_conf;
- WARN_ON(link_id != 0);
-
if (ref && ref->ops->rate_update) {
rcu_read_lock();
@@ -120,7 +119,8 @@ void rate_control_rate_update(struct iee
}
if (sta->uploaded)
- drv_sta_rc_update(local, sta->sdata, &sta->sta, changed);
+ drv_link_sta_rc_update(local, sta->sdata, link_sta->pub,
+ changed);
}
int ieee80211_rate_control_register(const struct rate_control_ops *ops)
--- a/net/mac80211/rate.h
+++ b/net/mac80211/rate.h
@@ -32,8 +32,7 @@ void rate_control_tx_status(struct ieee8
void rate_control_rate_init(struct sta_info *sta);
void rate_control_rate_update(struct ieee80211_local *local,
struct ieee80211_supported_band *sband,
- struct sta_info *sta,
- unsigned int link_id,
+ struct link_sta_info *link_sta,
u32 changed);
static inline void *rate_control_alloc_sta(struct rate_control_ref *ref,
--- a/net/mac80211/rx.c
+++ b/net/mac80211/rx.c
@@ -3568,7 +3568,7 @@ ieee80211_rx_h_action(struct ieee80211_r
sband = rx->local->hw.wiphy->bands[status->band];
- rate_control_rate_update(local, sband, rx->sta, 0,
+ rate_control_rate_update(local, sband, rx->link_sta,
IEEE80211_RC_SMPS_CHANGED);
cfg80211_sta_opmode_change_notify(sdata->dev,
rx->sta->addr,
@@ -3605,7 +3605,7 @@ ieee80211_rx_h_action(struct ieee80211_r
ieee80211_sta_rx_bw_to_chan_width(rx->link_sta);
sta_opmode.changed = STA_OPMODE_MAX_BW_CHANGED;
- rate_control_rate_update(local, sband, rx->sta, 0,
+ rate_control_rate_update(local, sband, rx->link_sta,
IEEE80211_RC_BW_CHANGED);
cfg80211_sta_opmode_change_notify(sdata->dev,
rx->sta->addr,
--- a/net/mac80211/tdls.c
+++ b/net/mac80211/tdls.c
@@ -1342,7 +1342,8 @@ static void iee80211_tdls_recalc_chanctx
bw = min(bw, ieee80211_sta_cap_rx_bw(&sta->deflink));
if (bw != sta->sta.deflink.bandwidth) {
sta->sta.deflink.bandwidth = bw;
- rate_control_rate_update(local, sband, sta, 0,
+ rate_control_rate_update(local, sband,
+ &sta->deflink,
IEEE80211_RC_BW_CHANGED);
/*
* if a TDLS peer BW was updated, we need to
--- a/net/mac80211/trace.h
+++ b/net/mac80211/trace.h
@@ -945,31 +945,34 @@ TRACE_EVENT(drv_sta_set_txpwr,
)
);
-TRACE_EVENT(drv_sta_rc_update,
+TRACE_EVENT(drv_link_sta_rc_update,
TP_PROTO(struct ieee80211_local *local,
struct ieee80211_sub_if_data *sdata,
- struct ieee80211_sta *sta,
+ struct ieee80211_link_sta *link_sta,
u32 changed),
- TP_ARGS(local, sdata, sta, changed),
+ TP_ARGS(local, sdata, link_sta, changed),
TP_STRUCT__entry(
LOCAL_ENTRY
VIF_ENTRY
STA_ENTRY
__field(u32, changed)
+ __field(u32, link_id)
),
TP_fast_assign(
LOCAL_ASSIGN;
VIF_ASSIGN;
- STA_ASSIGN;
+ STA_NAMED_ASSIGN(link_sta->sta);
__entry->changed = changed;
+ __entry->link_id = link_sta->link_id;
),
TP_printk(
- LOCAL_PR_FMT VIF_PR_FMT STA_PR_FMT " changed: 0x%x",
- LOCAL_PR_ARG, VIF_PR_ARG, STA_PR_ARG, __entry->changed
+ LOCAL_PR_FMT VIF_PR_FMT STA_PR_FMT " (link %d) changed: 0x%x",
+ LOCAL_PR_ARG, VIF_PR_ARG, STA_PR_ARG, __entry->link_id,
+ __entry->changed
)
);
--- a/net/mac80211/vht.c
+++ b/net/mac80211/vht.c
@@ -766,8 +766,7 @@ void ieee80211_vht_handle_opmode(struct
if (changed > 0) {
ieee80211_recalc_min_chandef(sdata, link_sta->link_id);
- rate_control_rate_update(local, sband, link_sta->sta,
- link_sta->link_id, changed);
+ rate_control_rate_update(local, sband, link_sta, changed);
}
}

View File

@ -126,7 +126,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
}
--- a/net/wireless/trace.h
+++ b/net/wireless/trace.h
@@ -1318,19 +1318,21 @@ TRACE_EVENT(rdev_libertas_set_mesh_chann
@@ -1322,19 +1322,21 @@ TRACE_EVENT(rdev_libertas_set_mesh_chann
);
TRACE_EVENT(rdev_set_monitor_channel,

View File

@ -8,9 +8,9 @@ PKG_LICENSE_FILES:=
PKG_SOURCE_URL:=https://github.com/openwrt/mt76
PKG_SOURCE_PROTO:=git
PKG_SOURCE_DATE:=2025-02-14
PKG_SOURCE_VERSION:=e5fef138524e63314cb96ff8314048d175294e95
PKG_MIRROR_HASH:=4d6ea8669b3034c97f5b341a5473facf4fe21262a2fde71257b57c4d1c86be5e
PKG_SOURCE_DATE:=2025-04-11
PKG_SOURCE_VERSION:=be28ef77e330fdee28054214c798f028ddfbbc02
PKG_MIRROR_HASH:=71d0651fd74b00fd83f5ea965483623dd6b33581c9cb0a05552d8e3d29dd2767
PKG_MAINTAINER:=Felix Fietkau <nbd@nbd.name>
PKG_USE_NINJA:=0

View File

@ -0,0 +1,47 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=r8127
PKG_VERSION:=11.014.00
PKG_RELEASE:=1
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
PKG_SOURCE_URL:=https://github.com/openwrt/rtl8127/releases/download/$(PKG_VERSION)
PKG_HASH:=f496bc16c32d2e8f9482c57d006604c70d9e8d55b4f1f999b88c602de9104094
PKG_BUILD_PARALLEL:=1
PKG_LICENSE:=GPLv2
PKG_MAINTAINER:=Alvaro Fernandez Rojas <noltari@gmail.com>
include $(INCLUDE_DIR)/kernel.mk
include $(INCLUDE_DIR)/package.mk
define KernelPackage/r8127
SUBMENU:=Network Devices
TITLE:=Realtek RTL8127 PCI 10 Gigabit Ethernet driver
DEPENDS:=@PCI_SUPPORT +kmod-libphy
FILES:=$(PKG_BUILD_DIR)/src/r8127.ko
AUTOLOAD:=$(call AutoProbe,r8127)
PROVIDES:=kmod-r8169
VARIANT:=regular
endef
define KernelPackage/r8127-rss
$(call KernelPackage/r8127)
CONFLICTS:=kmod-r8127
TITLE+= (RSS)
VARIANT:=rss
endef
ifeq ($(BUILD_VARIANT),rss)
PKG_MAKE_FLAGS += ENABLE_RSS_SUPPORT=y
endif
define Build/Compile
+$(KERNEL_MAKE) $(PKG_JOBS) \
$(PKG_MAKE_FLAGS) \
M="$(PKG_BUILD_DIR)/src" \
modules
endef
$(eval $(call KernelPackage,r8127))
$(eval $(call KernelPackage,r8127-rss))

View File

@ -0,0 +1,107 @@
From 5ca1d47e065c0318774a946ffdf76010c78cc164 Mon Sep 17 00:00:00 2001
From: Chukun Pan <amadeus@jmu.edu.cn>
Date: Sat, 10 Aug 2024 20:16:32 +0800
Subject: [PATCH] r8127: print link speed and duplex mode
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Like other Ethernet drivers, print link speed and duplex mode
when the interface is up. Formatting output at the same time.
Signed-off-by: Chukun Pan <amadeus@jmu.edu.cn>
Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
---
src/r8127.h | 2 ++
src/r8127_n.c | 48 +++++++++++++++++++++++++++++++++++++++++++++---
2 files changed, 47 insertions(+), 3 deletions(-)
--- a/src/r8127.h
+++ b/src/r8127.h
@@ -1753,6 +1753,11 @@ enum RTL8127_register_content {
LinkStatus = 0x02,
FullDup = 0x01,
+#define RTL8127_FULL_DUPLEX_MASK (_10000bpsF | _5000bpsF | _2500bpsF | _1000bpsF | FullDup)
+#define RTL8127_SPEED_1000_MASK (_1000bpsF | _1000bpsL | _2500bpsL)
+#define RTL8127_SPEED_2500_MASK (_2500bpsF | _5000bpsL)
+#define RTL8127_SPEED_5000_MASK (_5000bpsF | _10000bpsL)
+
/* DBG_reg */
Fix_Nak_1 = (1 << 4),
Fix_Nak_2 = (1 << 3),
--- a/src/r8127_n.c
+++ b/src/r8127_n.c
@@ -39,6 +39,7 @@
#include <linux/module.h>
#include <linux/version.h>
#include <linux/pci.h>
+#include <linux/phy.h>
#include <linux/netdevice.h>
#include <linux/etherdevice.h>
#include <linux/delay.h>
@@ -4746,6 +4747,42 @@ rtl8127_link_down_patch(struct net_devic
#endif
}
+static unsigned int rtl8127_phy_duplex(u32 status)
+{
+ unsigned int duplex = DUPLEX_UNKNOWN;
+
+ if (status & LinkStatus) {
+ if (status & RTL8127_FULL_DUPLEX_MASK)
+ duplex = DUPLEX_FULL;
+ else
+ duplex = DUPLEX_HALF;
+ }
+
+ return duplex;
+}
+
+static int rtl8127_phy_speed(u32 status)
+{
+ int speed = SPEED_UNKNOWN;
+
+ if (status & LinkStatus) {
+ if (status & _10000bpsF)
+ speed = SPEED_10000;
+ else if (status & RTL8127_SPEED_5000_MASK)
+ speed = SPEED_5000;
+ else if (status & RTL8127_SPEED_2500_MASK)
+ speed = SPEED_2500;
+ else if (status & RTL8127_SPEED_1000_MASK)
+ speed = SPEED_1000;
+ else if (status & _100bps)
+ speed = SPEED_100;
+ else if (status & _10bps)
+ speed = SPEED_10;
+ }
+
+ return speed;
+}
+
static void
_rtl8127_check_link_status(struct net_device *dev, unsigned int link_state)
{
@@ -4758,11 +4795,18 @@ _rtl8127_check_link_status(struct net_de
if (link_state == R8127_LINK_STATE_ON) {
rtl8127_link_on_patch(dev);
- if (netif_msg_ifup(tp))
- printk(KERN_INFO PFX "%s: link up\n", dev->name);
+ if (netif_msg_ifup(tp)) {
+ const u32 phy_status = RTL_R32(tp, PHYstatus);
+ const unsigned int phy_duplex = rtl8127_phy_duplex(phy_status);
+ const int phy_speed = rtl8127_phy_speed(phy_status);
+ printk(KERN_INFO PFX "%s: Link is Up - %s/%s\n",
+ dev->name,
+ phy_speed_to_str(phy_speed),
+ phy_duplex_to_str(phy_duplex));
+ }
} else {
if (netif_msg_ifdown(tp))
- printk(KERN_INFO PFX "%s: link down\n", dev->name);
+ printk(KERN_INFO PFX "%s: Link is Down\n", dev->name);
rtl8127_link_down_patch(dev);
}

View File

@ -132,18 +132,17 @@ static int ubootenv_probe(struct platform_device *pdev)
return misc_register(&data->misc);
}
static int ubootenv_remove(struct platform_device *pdev)
static void ubootenv_remove(struct platform_device *pdev)
{
struct ubootenv_drvdata *data = platform_get_drvdata(pdev);
data->env = NULL;
misc_deregister(&data->misc);
return 0;
}
static struct platform_driver ubootenv_driver = {
.probe = ubootenv_probe,
.remove = ubootenv_remove,
.remove_new = ubootenv_remove,
.driver = {
.name = NAME,
.of_match_table = of_ubootenv_match,

View File

@ -0,0 +1,36 @@
#!/bin/sh
# Restart ath12k radios that take long time to initialize on boot
[ "${ACTION}" = "add" ] || exit 0
[ $(grep -c DRIVER=ath12k_pci /sys/$DEVPATH/device/uevent) -gt 0 ] || exit 0
. /usr/share/libubox/jshn.sh
restart_radio() {
radio=$1
arg="{\"radio\": \"$radio\"}"
ubus call network reload
ubus call network.wireless down "$arg"
ubus call network.wireless up "$arg"
}
json_init
json_load "$(ubus -S call network.wireless status)"
json_get_keys radios
for radio in $radios; do
json_select $radio
json_get_vars up
json_get_vars retry_setup_failed
json_select config
json_get_vars path
json_select ..
if [ $up = 0 -a $retry_setup_failed = 1 ] &&
[ $(iwinfo nl80211 phyname "path=$path") = "$DEVICENAME" ]; then
restart_radio $radio
fi
json_select ..
done

View File

@ -8,13 +8,13 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=dnsmasq
PKG_UPSTREAM_VERSION:=2.90
PKG_UPSTREAM_VERSION:=2.91
PKG_VERSION:=$(subst test,~~test,$(subst rc,~rc,$(PKG_UPSTREAM_VERSION)))
PKG_RELEASE:=4
PKG_RELEASE:=1
PKG_SOURCE:=$(PKG_NAME)-$(PKG_UPSTREAM_VERSION).tar.xz
PKG_SOURCE_URL:=https://thekelleys.org.uk/dnsmasq/
PKG_HASH:=8e50309bd837bfec9649a812e066c09b6988b73d749b7d293c06c57d46a109e4
PKG_HASH:=f622682848b33677adb2b6ad08264618a2ae0a01da486a93fd8cd91186b3d153
PKG_LICENSE:=GPL-2.0
PKG_LICENSE_FILES:=COPYING

View File

@ -1,43 +0,0 @@
From 1ed783b8d7343c42910a61f12a8fc6237eb80417 Mon Sep 17 00:00:00 2001
From: Simon Kelley <simon@thekelleys.org.uk>
Date: Mon, 19 Feb 2024 12:22:43 +0000
Subject: Fix spurious "resource limit exceeded" messages.
Replies from upstream with a REFUSED rcode can result in
log messages stating that a resource limit has been exceeded,
which is not the case.
Thanks to Dominik Derigs and the Pi-hole project for
spotting this.
---
CHANGELOG | 5 +++++
src/forward.c | 6 +++---
2 files changed, 8 insertions(+), 3 deletions(-)
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -1,3 +1,8 @@
+version 2.91
+ Fix spurious "resource limit exceeded messages". Thanks to
+ Dominik Derigs for the bug report.
+
+
version 2.90
Fix reversion in --rev-server introduced in 2.88 which
caused breakage if the prefix length is not exactly divisible
--- a/src/forward.c
+++ b/src/forward.c
@@ -937,10 +937,10 @@ static void dnssec_validate(struct frec
status = dnssec_validate_reply(now, header, plen, daemon->namebuff, daemon->keyname, &forward->class,
!option_bool(OPT_DNSSEC_IGN_NS) && (forward->sentto->flags & SERV_DO_DNSSEC),
NULL, NULL, NULL, &orig->validate_counter);
- }
- if (STAT_ISEQUAL(status, STAT_ABANDONED))
- log_resource = 1;
+ if (STAT_ISEQUAL(status, STAT_ABANDONED))
+ log_resource = 1;
+ }
/* Can't validate, as we're missing key data. Put this
answer aside, whilst we get that. */

View File

@ -1,31 +0,0 @@
From ccff85ad72d2f858d9743d40525128e4f62d41a8 Mon Sep 17 00:00:00 2001
From: renmingshuai <renmingshuai@huawei.com>
Date: Wed, 21 Feb 2024 00:24:25 +0000
Subject: [PATCH] Fix error introduced in
51471cafa5a4fa44d6fe490885d9910bd72a5907
Signed-off-by: renmingshuai <renmingshuai@huawei.com>
---
src/dnssec.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
--- a/src/dnssec.c
+++ b/src/dnssec.c
@@ -1547,7 +1547,7 @@ static int prove_non_existence_nsec3(str
nsecs[i] = NULL; /* Speculative, will be restored if OK. */
if (!(p = skip_name(nsec3p, header, plen, 15)))
- return 0; /* bad packet */
+ return DNSSEC_FAIL_BADPACKET; /* bad packet */
p += 10; /* type, class, TTL, rdlen */
@@ -1640,7 +1640,7 @@ static int prove_non_existence_nsec3(str
if (!wildname)
{
if (!(wildcard = strchr(next_closest, '.')) || wildcard == next_closest)
- return 0;
+ return DNSSEC_FAIL_NONSEC;
wildcard--;
*wildcard = '*';

View File

@ -1,98 +0,0 @@
From 8ce27433f8b2e17c557cb55e4f16941d309deeac Mon Sep 17 00:00:00 2001
From: Simon Kelley <simon@thekelleys.org.uk>
Date: Fri, 17 Jan 2025 17:49:29 +0000
Subject: [PATCH] Handle DS queries to auth zones.
Origin: upstream, v2.91test8
When dnsmasq is configured to act as an authoritative server and has
an authoritative zone configured, and recieves a query for
that zone _as_forwarder_ it answers the query directly rather
than forwarding it. This doesn't affect the answer, but it
saves dnsmasq forwarding the query to the recusor upstream,
whch then bounces it back to dnsmasq in auth mode. The
exception should be when the query is for the root of zone, for a DS
RR. The answer to that has to come from the parent, via the
recursor, and will typically be a proof-of-nonexistence since
dnsmasq doesn't support signed zones. This patch suppresses
local answers and forces forwarding to the upstream recursor
for such queries. It stops breakage when a DNSSEC validating
client makes queries to dnsmasq acting as forwarder for a zone
for which it is authoritative.
[ukleinek: drop changes to CHANGELOG to prevent conflicts]
---
src/forward.c | 52 +++++++++++++++++++++++++++++++++++++--------------
1 file changed, 38 insertions(+), 14 deletions(-)
--- a/src/forward.c
+++ b/src/forward.c
@@ -1744,15 +1744,27 @@ void receive_query(struct listener *list
#endif
#ifdef HAVE_AUTH
- /* find queries for zones we're authoritative for, and answer them directly */
+ /* Find queries for zones we're authoritative for, and answer them directly.
+ The exception to this is DS queries for the zone route. They
+ have to come from the parent zone. Since dnsmasq's auth server
+ can't do DNSSEC, the zone will be unsigned, and anything using
+ dnsmasq as a forwarder and doing validation will be expecting to
+ see the proof of non-existence from the parent. */
if (!auth_dns && !option_bool(OPT_LOCALISE))
for (zone = daemon->auth_zones; zone; zone = zone->next)
- if (in_zone(zone, daemon->namebuff, NULL))
- {
- auth_dns = 1;
- local_auth = 1;
- break;
- }
+ {
+ char *cut;
+
+ if (in_zone(zone, daemon->namebuff, &cut))
+ {
+ if (type != T_DS || cut)
+ {
+ auth_dns = 1;
+ local_auth = 1;
+ }
+ break;
+ }
+ }
#endif
#ifdef HAVE_LOOP
@@ -2268,15 +2280,27 @@ unsigned char *tcp_request(int confd, ti
&peer_addr, auth_dns ? "auth" : "query", qtype);
#ifdef HAVE_AUTH
- /* find queries for zones we're authoritative for, and answer them directly */
+ /* Find queries for zones we're authoritative for, and answer them directly.
+ The exception to this is DS queries for the zone route. They
+ have to come from the parent zone. Since dnsmasq's auth server
+ can't do DNSSEC, the zone will be unsigned, and anything using
+ dnsmasq as a forwarder and doing validation will be expecting to
+ see the proof of non-existence from the parent. */
if (!auth_dns && !option_bool(OPT_LOCALISE))
for (zone = daemon->auth_zones; zone; zone = zone->next)
- if (in_zone(zone, daemon->namebuff, NULL))
- {
- auth_dns = 1;
- local_auth = 1;
- break;
- }
+ {
+ char *cut;
+
+ if (in_zone(zone, daemon->namebuff, &cut))
+ {
+ if (qtype != T_DS || cut)
+ {
+ auth_dns = 1;
+ local_auth = 1;
+ }
+ break;
+ }
+ }
#endif
}
}

View File

@ -1,16 +1,16 @@
--- a/src/dnsmasq.c
+++ b/src/dnsmasq.c
@@ -2021,6 +2021,10 @@ static void check_dns_listeners(time_t n
daemon->pipe_to_parent = pipefd[1];
}
@@ -2097,6 +2097,10 @@
daemon->pipe_to_parent = pipefd[1];
}
+#ifdef HAVE_UBUS
+ drop_ubus_listeners();
+ drop_ubus_listeners();
+#endif
+
/* start with no upstream connections. */
for (s = daemon->servers; s; s = s->next)
s->tcpfd = -1;
/* The connected socket inherits non-blocking
attribute from the listening socket.
Reset that here. */
--- a/src/dnsmasq.h
+++ b/src/dnsmasq.h
@@ -1670,14 +1670,26 @@ void emit_dbus_signal(int action, struct

View File

@ -1,6 +1,6 @@
#!/bin/sh /etc/rc.common
# Copyright (C) 2008-2015 OpenWrt.org
# shellcheck disable=1091,2034,3037,3043,3045
# shellcheck disable=1091,2034,3037,3043,3045,3057
START=90
STOP=01
@ -24,15 +24,63 @@ LLDPD_RESTART_HASH=${LLDPD_RUN}/lldpd.restart_hash
. "$IPKG_INSTROOT/lib/functions/network.sh"
# Load release info once for all 'find_*' functions
[ -s /etc/os-release ] && . /etc/os-release
# Helper function to truncate output to 31 characters
truncate_output() {
# Some devices have trouble decoding inventory TLV strings > 31 chars
# lldpd truncates inventory TLV to a total TLV length of 36 (of which string = 32)
echo "${1:0:31}"
}
find_release_info()
{
[ -s /etc/os-release ] && . /etc/os-release
[ -z "$PRETTY_NAME" ] && [ -s /etc/openwrt_version ] && \
PRETTY_NAME="$(cat /etc/openwrt_version)"
echo "${PRETTY_NAME:-Unknown OpenWrt release} @ $(cat /proc/sys/kernel/hostname)"
}
find_hardware_revision()
{
echo "${OPENWRT_DEVICE_REVISION:-Unknown hardware revision}"
}
find_firmware_info()
{
echo "${PRETTY_NAME:-Unknown firmware release}"
}
find_software_revision()
{
echo "${BUILD_ID:-Unknown software revision}"
}
# Helper function to extract JSON values using jsonfilter
extract_json_field() {
local _path="$1"
jsonfilter -q -i /etc/board.json -e "$_path" 2>/dev/null
}
find_manufacturer_info()
{
local _id
# extract the model->id field, e.g.: "id": "glinet,gl-mt6000",
_id=$(extract_json_field '@.model.id')
# stash text up to first comma
_id="${_id%%,*}"
echo "${_id:-Unknown manufacturer}"
}
find_model_info()
{
local _name
# extract the model->name field, e.g.: "name": "GL.iNet GL-MT6000"
_name=$(extract_json_field '@.model.name')
echo "${_name:-Unknown model name}"
}
get_config_restart_hash() {
local var="$1"
local _string _hash v
@ -120,6 +168,48 @@ write_lldpd_conf()
config_load 'lldpd'
config_get lldp_description 'config' 'lldp_description' "$(find_release_info)"
# Check the 'do not send inventory' flag
local lldpmed_no_inventory
config_get_bool lldpmed_no_inventory 'config' 'lldpmed_no_inventory' 0
if [ "$lldpmed_no_inventory" = 0 ]; then
# lldpmed_no_inventory=1 ('-i' in start_service()) prevents these from being sent
# TIA TR-41 TLV 127 subtype 0x05
local lldp_med_inv_hardware_revision
config_get lldp_med_inv_hardware_revision 'config' 'lldp_med_inv_hardware_revision' "$(find_hardware_revision)"
lldp_med_inv_hardware_revision=$(truncate_output "$lldp_med_inv_hardware_revision")
# TIA TR-41 TLV 127 subtype 0x06
local lldp_med_inv_firmware_revision
config_get lldp_med_inv_firmware_revision 'config' 'lldp_med_inv_firmware_revision' "$(find_firmware_info)"
lldp_med_inv_firmware_revision=$(truncate_output "$lldp_med_inv_firmware_revision")
# TIA TR-41 TLV 127 subtype 0x07
local lldp_med_inv_software_revision
config_get lldp_med_inv_software_revision 'config' 'lldp_med_inv_software_revision' "$(find_software_revision)"
lldp_med_inv_software_revision=$(truncate_output "$lldp_med_inv_software_revision")
# TIA TR-41 TLV 127 subtype 0x08
local lldp_med_inv_serial_number
config_get lldp_med_inv_serial_number 'config' 'lldp_med_inv_serial_number'
lldp_med_inv_serial_number=$(truncate_output "$lldp_med_inv_serial_number")
# TIA TR-41 TLV 127 subtype 0x09
local lldp_med_inv_manufacturer_name
config_get lldp_med_inv_manufacturer_name 'config' 'lldp_med_inv_manufacturer_name' "$(find_manufacturer_info)"
lldp_med_inv_manufacturer_name=$(truncate_output "$lldp_med_inv_manufacturer_name")
# TIA TR-41 TLV 127 subtype 0x0a
local lldp_med_inv_model_name
config_get lldp_med_inv_model_name 'config' 'lldp_med_inv_model_name' "$(find_model_info)"
lldp_med_inv_model_name=$(truncate_output "$lldp_med_inv_model_name")
# TIA TR-41 TLV 127 subtype 0x0b
local lldp_med_inv_asset_id
config_get lldp_med_inv_asset_id 'config' 'lldp_med_inv_asset_id'
lldp_med_inv_asset_id=$(truncate_output "$lldp_med_inv_asset_id")
fi
local lldp_hostname
config_get lldp_hostname 'config' 'lldp_hostname' "$(cat /proc/sys/kernel/hostname)"
@ -182,6 +272,17 @@ write_lldpd_conf()
[ -n "$lldp_mgmt_ip" ] && echo "configure system ip management pattern" "\"$lldp_mgmt_ip\"" >> "$LLDPD_CONF"
[ -n "$lldp_syscapabilities" ] && echo "configure system capabilities enabled $lldp_syscapabilities" >> "$LLDPD_CONF"
if [ "$lldpmed_no_inventory" = 0 ]; then
# Hardware inventory info
[ -n "$lldp_med_inv_hardware_revision" ] && echo "configure inventory hardware-revision \"$lldp_med_inv_hardware_revision\"" >> "$LLDPD_CONF"
[ -n "$lldp_med_inv_firmware_revision" ] && echo "configure inventory firmware-revision \"$lldp_med_inv_firmware_revision\"" >> "$LLDPD_CONF"
[ -n "$lldp_med_inv_software_revision" ] && echo "configure inventory software-revision \"$lldp_med_inv_software_revision\"" >> "$LLDPD_CONF"
[ -n "$lldp_med_inv_serial_number" ] && echo "configure inventory serial-number \"$lldp_med_inv_serial_number\"" >> "$LLDPD_CONF"
[ -n "$lldp_med_inv_manufacturer_name" ] && echo "configure inventory manufacturer \"$lldp_med_inv_manufacturer_name\"" >> "$LLDPD_CONF"
[ -n "$lldp_med_inv_model_name" ] && echo "configure inventory model \"$lldp_med_inv_model_name\"" >> "$LLDPD_CONF"
[ -n "$lldp_med_inv_asset_id" ] && echo "configure inventory asset \"$lldp_med_inv_asset_id\"" >> "$LLDPD_CONF"
fi
if [ "$CONFIG_LLDPD_WITH_LLDPMED" = "y" ] && [ "$lldpmed_fast_start" -gt 0 ]; then
if [ "$lldpmed_fast_start_tx_interval" -gt 0 ]; then
echo "configure med fast-start tx-interval $lldpmed_fast_start_tx_interval" >> "$LLDPD_CONF"
@ -401,6 +502,14 @@ reload_service() {
unconfigure system hostname
unconfigure system ip management pattern
unconfigure system platform
# Hardware inventory info
unconfigure inventory hardware-revision
unconfigure inventory firmware-revision
unconfigure inventory software-revision
unconfigure inventory serial-number
unconfigure inventory manufacturer
unconfigure inventory model
unconfigure inventory asset
EOF
if [ "$CONFIG_LLDPD_WITH_LLDPMED" = "y" ]; then
$LLDPCLI -u "$LLDPSOCKET" >/dev/null 2>&1 <<-EOF

View File

@ -99,7 +99,7 @@ function network_socket_handle_request(sock_data, req)
if (list[name])
return 0;
let allowed;
let allowed = net.peers[host].allowed == null;
for (let cur in net.peers[host].allowed) {
if (!wildcard(name, cur))
continue;

View File

@ -7,7 +7,7 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=ca-certificates
PKG_VERSION:=20240203
PKG_VERSION:=20241223
PKG_RELEASE:=1
PKG_MAINTAINER:=
@ -16,7 +16,7 @@ PKG_LICENSE_FILES:=debian/copyright
PKG_SOURCE:=$(PKG_NAME)_$(PKG_VERSION).tar.xz
PKG_SOURCE_URL:=@DEBIAN/pool/main/c/ca-certificates
PKG_HASH:=3286d3fc42c4d11b7086711a85f865b44065ce05cf1fb5376b2abed07622a9c6
PKG_HASH:=dd8286d0a9dd35c756fea5f1df3fed1510fb891f376903891b003cd9b1ad7e03
PKG_INSTALL:=1
include $(INCLUDE_DIR)/package.mk

View File

@ -135,8 +135,14 @@ export function remove_call(ctx, argv, named)
if (!data)
continue;
for (let idx in val)
for (let idx in val) {
if (idx != "" + +idx) {
let cur_idx = index(data, idx);
if (cur_idx >= 0)
idx = cur_idx + 1;
}
data[+idx - 1] = null;
}
cur_obj[name] = filter(data, (v) => v != null);
if (cur.attribute_allow_empty && !length(cur_obj[name]))

View File

@ -12,10 +12,14 @@ include $(INCLUDE_DIR)/package.mk
define Package/$(PKG_NAME)
SECTION:=utils
CATEGORY:=Utilities
DEPENDS:=@USB_GADGET_SUPPORT +kmod-usb-gadget +kmod-usb-lib-composite
DEPENDS:=@USB_GADGET_SUPPORT +kmod-usb-gadget +kmod-fs-configfs +kmod-usb-lib-composite
TITLE:=init script to create USB gadgets
endef
define Package/$(PKG_NAME)/conffiles
/etc/config/usbgadget
endef
define Build/Compile
endef
@ -35,7 +39,7 @@ define GadgetPreset
SECTION:=utils
CATEGORY:=Utilities
TITLE+= $(2) gadget preset
DEPENDS+= $(3)
DEPENDS+= +usbgadget $(3)
endef
define Package/$(PKG_NAME)-$(1)/description
@ -51,4 +55,4 @@ define GadgetPreset
endef
$(eval $(call GadgetPreset,ncm,CDC-NCM,+kmod-usb-gadget-ncm))
$(eval $(call GadgetPreset,acm,CDC-ACM,+kmod-usb-gadget-serial))
$(eval $(call GadgetPreset,acm,CDC-ACM,+kmod-usb-gadget-serial))

View File

@ -8,6 +8,7 @@ endef
define Device/nec-netbsd-aterm
DEVICE_VENDOR := NEC
LOADER_TYPE := bin
LZMA_TEXT_START := 0x82800000
KERNEL := kernel-bin | append-dtb | lzma | loader-kernel | uImage none
KERNEL_INITRAMFS := kernel-bin | append-dtb | lzma | loader-kernel | uImage none
ARTIFACTS := uboot.bin

View File

@ -65,7 +65,7 @@ Signed-off-by: Phil Elwell <phil@raspberrypi.com>
writel(tmp, base + PCIE_MISC_HARD_PCIE_HARD_DEBUG);
return 0;
@@ -1536,6 +1551,7 @@ static int brcm_pcie_probe(struct platfo
@@ -1537,6 +1552,7 @@ static int brcm_pcie_probe(struct platfo
pcie->gen = (ret < 0) ? 0 : ret;
pcie->ssc = of_property_read_bool(np, "brcm,enable-ssc");

View File

@ -831,7 +831,7 @@ Signed-off-by: Jonathan Bell <jonathan@raspberrypi.com>
return 0;
}
@@ -1207,6 +1534,7 @@ static void brcm_pcie_enter_l23(struct b
@@ -1208,6 +1535,7 @@ static void brcm_pcie_enter_l23(struct b
static int brcm_phy_cntl(struct brcm_pcie *pcie, const int start)
{
@ -839,7 +839,7 @@ Signed-off-by: Jonathan Bell <jonathan@raspberrypi.com>
static const u32 shifts[PCIE_DVT_PMU_PCIE_PHY_CTRL_DAST_NFLDS] = {
PCIE_DVT_PMU_PCIE_PHY_CTRL_DAST_PWRDN_SHIFT,
PCIE_DVT_PMU_PCIE_PHY_CTRL_DAST_RESET_SHIFT,
@@ -1239,6 +1567,9 @@ static int brcm_phy_cntl(struct brcm_pci
@@ -1240,6 +1568,9 @@ static int brcm_phy_cntl(struct brcm_pci
dev_err(pcie->dev, "failed to %s phy\n", (start ? "start" : "stop"));
return ret;
@ -849,7 +849,7 @@ Signed-off-by: Jonathan Bell <jonathan@raspberrypi.com>
}
static inline int brcm_phy_start(struct brcm_pcie *pcie)
@@ -1271,6 +1602,12 @@ static void brcm_pcie_turn_off(struct br
@@ -1272,6 +1603,12 @@ static void brcm_pcie_turn_off(struct br
u32p_replace_bits(&tmp, 1, PCIE_MISC_HARD_PCIE_HARD_DEBUG_SERDES_IDDQ_MASK);
writel(tmp, base + PCIE_MISC_HARD_PCIE_HARD_DEBUG);
@ -862,7 +862,7 @@ Signed-off-by: Jonathan Bell <jonathan@raspberrypi.com>
/* Shutdown PCIe bridge */
pcie->bridge_sw_init_set(pcie, 1);
}
@@ -1301,9 +1638,9 @@ static int brcm_pcie_suspend_noirq(struc
@@ -1302,9 +1639,9 @@ static int brcm_pcie_suspend_noirq(struc
if (brcm_phy_stop(pcie))
dev_err(dev, "Could not stop phy for suspend\n");
@ -874,7 +874,7 @@ Signed-off-by: Jonathan Bell <jonathan@raspberrypi.com>
return ret;
}
@@ -1398,7 +1735,7 @@ err_regulator:
@@ -1399,7 +1736,7 @@ err_regulator:
if (pcie->sr)
regulator_bulk_disable(pcie->sr->num_supplies, pcie->sr->supplies);
err_reset:
@ -883,7 +883,7 @@ Signed-off-by: Jonathan Bell <jonathan@raspberrypi.com>
err_disable_clk:
clk_disable_unprepare(pcie->clk);
return ret;
@@ -1410,8 +1747,8 @@ static void __brcm_pcie_remove(struct br
@@ -1411,8 +1748,8 @@ static void __brcm_pcie_remove(struct br
brcm_pcie_turn_off(pcie);
if (brcm_phy_stop(pcie))
dev_err(pcie->dev, "Could not stop phy\n");
@ -894,7 +894,7 @@ Signed-off-by: Jonathan Bell <jonathan@raspberrypi.com>
clk_disable_unprepare(pcie->clk);
}
@@ -1429,12 +1766,16 @@ static const int pcie_offsets[] = {
@@ -1430,12 +1767,16 @@ static const int pcie_offsets[] = {
[RGR1_SW_INIT_1] = 0x9210,
[EXT_CFG_INDEX] = 0x9000,
[EXT_CFG_DATA] = 0x9004,
@ -911,7 +911,7 @@ Signed-off-by: Jonathan Bell <jonathan@raspberrypi.com>
};
static const struct pcie_cfg_data generic_cfg = {
@@ -1442,6 +1783,7 @@ static const struct pcie_cfg_data generi
@@ -1443,6 +1784,7 @@ static const struct pcie_cfg_data generi
.type = GENERIC,
.perst_set = brcm_pcie_perst_set_generic,
.bridge_sw_init_set = brcm_pcie_bridge_sw_init_set_generic,
@ -919,7 +919,7 @@ Signed-off-by: Jonathan Bell <jonathan@raspberrypi.com>
};
static const struct pcie_cfg_data bcm7425_cfg = {
@@ -1449,6 +1791,7 @@ static const struct pcie_cfg_data bcm742
@@ -1450,6 +1792,7 @@ static const struct pcie_cfg_data bcm742
.type = BCM7425,
.perst_set = brcm_pcie_perst_set_generic,
.bridge_sw_init_set = brcm_pcie_bridge_sw_init_set_generic,
@ -927,7 +927,7 @@ Signed-off-by: Jonathan Bell <jonathan@raspberrypi.com>
};
static const struct pcie_cfg_data bcm7435_cfg = {
@@ -1463,12 +1806,15 @@ static const struct pcie_cfg_data bcm490
@@ -1464,12 +1807,15 @@ static const struct pcie_cfg_data bcm490
.type = BCM4908,
.perst_set = brcm_pcie_perst_set_4908,
.bridge_sw_init_set = brcm_pcie_bridge_sw_init_set_generic,
@ -943,7 +943,7 @@ Signed-off-by: Jonathan Bell <jonathan@raspberrypi.com>
};
static const struct pcie_cfg_data bcm7278_cfg = {
@@ -1476,6 +1822,7 @@ static const struct pcie_cfg_data bcm727
@@ -1477,6 +1823,7 @@ static const struct pcie_cfg_data bcm727
.type = BCM7278,
.perst_set = brcm_pcie_perst_set_7278,
.bridge_sw_init_set = brcm_pcie_bridge_sw_init_set_7278,
@ -951,7 +951,7 @@ Signed-off-by: Jonathan Bell <jonathan@raspberrypi.com>
};
static const struct pcie_cfg_data bcm2711_cfg = {
@@ -1483,10 +1830,27 @@ static const struct pcie_cfg_data bcm271
@@ -1484,10 +1831,27 @@ static const struct pcie_cfg_data bcm271
.type = BCM2711,
.perst_set = brcm_pcie_perst_set_generic,
.bridge_sw_init_set = brcm_pcie_bridge_sw_init_set_generic,
@ -979,7 +979,7 @@ Signed-off-by: Jonathan Bell <jonathan@raspberrypi.com>
{ .compatible = "brcm,bcm4908-pcie", .data = &bcm4908_cfg },
{ .compatible = "brcm,bcm7211-pcie", .data = &generic_cfg },
{ .compatible = "brcm,bcm7278-pcie", .data = &bcm7278_cfg },
@@ -1527,7 +1891,7 @@ static int brcm_pcie_probe(struct platfo
@@ -1528,7 +1892,7 @@ static int brcm_pcie_probe(struct platfo
data = of_device_get_match_data(&pdev->dev);
if (!data) {
@ -988,7 +988,7 @@ Signed-off-by: Jonathan Bell <jonathan@raspberrypi.com>
return -EINVAL;
}
@@ -1538,6 +1902,7 @@ static int brcm_pcie_probe(struct platfo
@@ -1539,6 +1903,7 @@ static int brcm_pcie_probe(struct platfo
pcie->type = data->type;
pcie->perst_set = data->perst_set;
pcie->bridge_sw_init_set = data->bridge_sw_init_set;
@ -996,7 +996,7 @@ Signed-off-by: Jonathan Bell <jonathan@raspberrypi.com>
pcie->base = devm_platform_ioremap_resource(pdev, 0);
if (IS_ERR(pcie->base))
@@ -1568,14 +1933,20 @@ static int brcm_pcie_probe(struct platfo
@@ -1569,14 +1934,20 @@ static int brcm_pcie_probe(struct platfo
clk_disable_unprepare(pcie->clk);
return PTR_ERR(pcie->perst_reset);
}
@ -1019,7 +1019,7 @@ Signed-off-by: Jonathan Bell <jonathan@raspberrypi.com>
clk_disable_unprepare(pcie->clk);
return ret;
}
@@ -1598,6 +1969,33 @@ static int brcm_pcie_probe(struct platfo
@@ -1599,6 +1970,33 @@ static int brcm_pcie_probe(struct platfo
dev_err(pcie->dev, "probe of internal MSI failed");
goto fail;
}
@ -1053,7 +1053,7 @@ Signed-off-by: Jonathan Bell <jonathan@raspberrypi.com>
}
bridge->ops = pcie->type == BCM7425 ? &brcm7425_pcie_ops : &brcm_pcie_ops;
@@ -1614,6 +2012,8 @@ static int brcm_pcie_probe(struct platfo
@@ -1615,6 +2013,8 @@ static int brcm_pcie_probe(struct platfo
return ret;
}

View File

@ -45,7 +45,7 @@ Signed-off-by: Phil Elwell <phil@raspberrypi.com>
writel(tmp, base + PCIE_MISC_MISC_CTRL);
brcm_pcie_set_tc_qos(pcie);
@@ -1917,6 +1918,7 @@ static int brcm_pcie_probe(struct platfo
@@ -1918,6 +1919,7 @@ static int brcm_pcie_probe(struct platfo
pcie->ssc = of_property_read_bool(np, "brcm,enable-ssc");
pcie->l1ss = of_property_read_bool(np, "brcm,enable-l1ss");

View File

@ -61,7 +61,7 @@ Signed-off-by: Jonathan Bell <jonathan@raspberrypi.com>
/*
* Wait for 100ms after PERST# deassertion; see PCIe CEM specification
@@ -1919,6 +1940,7 @@ static int brcm_pcie_probe(struct platfo
@@ -1920,6 +1941,7 @@ static int brcm_pcie_probe(struct platfo
pcie->ssc = of_property_read_bool(np, "brcm,enable-ssc");
pcie->l1ss = of_property_read_bool(np, "brcm,enable-l1ss");
pcie->rcb_mps_mode = of_property_read_bool(np, "brcm,enable-mps-rcb");

View File

@ -56,7 +56,7 @@ Signed-off-by: Richard Oliver <richard.oliver@raspberrypi.com>
depends on RENESAS_RPCIF
--- a/drivers/spi/Makefile
+++ b/drivers/spi/Makefile
@@ -115,6 +115,7 @@ obj-$(CONFIG_SPI_ROCKCHIP) += spi-rockc
@@ -116,6 +116,7 @@ obj-$(CONFIG_SPI_ROCKCHIP) += spi-rockc
obj-$(CONFIG_SPI_ROCKCHIP_SFC) += spi-rockchip-sfc.o
obj-$(CONFIG_SPI_RB4XX) += spi-rb4xx.o
obj-$(CONFIG_MACH_REALTEK_RTL) += spi-realtek-rtl.o

View File

@ -18,7 +18,7 @@ Signed-off-by: Phil Elwell <phil@raspberrypi.com>
--- a/drivers/nvme/host/pci.c
+++ b/drivers/nvme/host/pci.c
@@ -1932,6 +1932,7 @@ static void nvme_free_host_mem(struct nv
@@ -1948,6 +1948,7 @@ static void nvme_free_host_mem(struct nv
dev->nr_host_mem_descs = 0;
}
@ -26,7 +26,7 @@ Signed-off-by: Phil Elwell <phil@raspberrypi.com>
static int __nvme_alloc_host_mem(struct nvme_dev *dev, u64 preferred,
u32 chunk_size)
{
@@ -2000,9 +2001,11 @@ out:
@@ -2016,9 +2017,11 @@ out:
dev->host_mem_descs = NULL;
return -ENOMEM;
}
@ -38,7 +38,7 @@ Signed-off-by: Phil Elwell <phil@raspberrypi.com>
u64 min_chunk = min_t(u64, preferred, PAGE_SIZE * MAX_ORDER_NR_PAGES);
u64 hmminds = max_t(u32, dev->ctrl.hmminds * 4096, PAGE_SIZE * 2);
u64 chunk_size;
@@ -2015,6 +2018,7 @@ static int nvme_alloc_host_mem(struct nv
@@ -2031,6 +2034,7 @@ static int nvme_alloc_host_mem(struct nv
nvme_free_host_mem(dev);
}
}

View File

@ -17,7 +17,7 @@ Signed-off-by: Dom Cobley <popcornmix@gmail.com>
--- a/drivers/pci/probe.c
+++ b/drivers/pci/probe.c
@@ -968,9 +968,6 @@ static int pci_register_host_bridge(stru
@@ -967,9 +967,6 @@ static int pci_register_host_bridge(stru
else
pr_info("PCI host bridge to bus %s\n", name);

View File

@ -0,0 +1,77 @@
From 0553897d77e849a86e836ddf1e0c0dbbd8e64f83 Mon Sep 17 00:00:00 2001
From: Dave Stevenson <dave.stevenson@raspberrypi.com>
Date: Mon, 20 Jan 2025 10:40:09 +0000
Subject: [PATCH] media: i2c: imx477: Add further link frequency options
https://github.com/raspberrypi/linux/issues/6004 reports further
issues with GPS interference.
Untested, but adds further link frequency options.
Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
---
drivers/media/i2c/imx477.c | 33 +++++++++++++++++++++++++++++++++
1 file changed, 33 insertions(+)
--- a/drivers/media/i2c/imx477.c
+++ b/drivers/media/i2c/imx477.c
@@ -169,12 +169,18 @@ enum {
IMX477_LINK_FREQ_450MHZ,
IMX477_LINK_FREQ_453MHZ,
IMX477_LINK_FREQ_456MHZ,
+ IMX477_LINK_FREQ_459MHZ,
+ IMX477_LINK_FREQ_462MHZ,
+ IMX477_LINK_FREQ_498MHZ,
};
static const s64 link_freqs[] = {
[IMX477_LINK_FREQ_450MHZ] = 450000000,
[IMX477_LINK_FREQ_453MHZ] = 453000000,
[IMX477_LINK_FREQ_456MHZ] = 456000000,
+ [IMX477_LINK_FREQ_459MHZ] = 459000000,
+ [IMX477_LINK_FREQ_462MHZ] = 462000000,
+ [IMX477_LINK_FREQ_498MHZ] = 498000000,
};
/* 450MHz is the nominal "default" link frequency */
@@ -193,6 +199,21 @@ static const struct imx477_reg link_456M
{0x030F, 0x98},
};
+static const struct imx477_reg link_459Mhz_regs[] = {
+ {0x030E, 0x00},
+ {0x030F, 0x99},
+};
+
+static const struct imx477_reg link_462Mhz_regs[] = {
+ {0x030E, 0x00},
+ {0x030F, 0x9a},
+};
+
+static const struct imx477_reg link_498Mhz_regs[] = {
+ {0x030E, 0x00},
+ {0x030F, 0xa6},
+};
+
static const struct imx477_reg_list link_freq_regs[] = {
[IMX477_LINK_FREQ_450MHZ] = {
.regs = link_450Mhz_regs,
@@ -206,6 +227,18 @@ static const struct imx477_reg_list link
.regs = link_456Mhz_regs,
.num_of_regs = ARRAY_SIZE(link_456Mhz_regs)
},
+ [IMX477_LINK_FREQ_459MHZ] = {
+ .regs = link_459Mhz_regs,
+ .num_of_regs = ARRAY_SIZE(link_459Mhz_regs)
+ },
+ [IMX477_LINK_FREQ_462MHZ] = {
+ .regs = link_462Mhz_regs,
+ .num_of_regs = ARRAY_SIZE(link_462Mhz_regs)
+ },
+ [IMX477_LINK_FREQ_498MHZ] = {
+ .regs = link_498Mhz_regs,
+ .num_of_regs = ARRAY_SIZE(link_498Mhz_regs)
+ },
};
static const struct imx477_reg mode_common_regs[] = {

View File

@ -0,0 +1,82 @@
From 9da8d6df2051478f0ba16d73c65995955c19cb3a Mon Sep 17 00:00:00 2001
From: Phil Elwell <phil@raspberrypi.com>
Date: Tue, 18 Mar 2025 13:09:11 +0000
Subject: [PATCH] overlays: Fix some unusable fragments
A forthcoming overlaycheck update looks for dormant fragments with no
parameters to enable them. The test discovered some real errors, which
this patch fixes, and one case where some fragments aren't yet being
used, which this comments out until they are.
Signed-off-by: Phil Elwell <phil@raspberrypi.com>
---
arch/arm/boot/dts/overlays/rpi-poe-overlay.dts | 2 +-
arch/arm/boot/dts/overlays/rpi-poe-plus-overlay.dts | 2 +-
arch/arm/boot/dts/overlays/sx150x-overlay.dts | 2 +-
arch/arm/boot/dts/overlays/vc4-kms-dpi-panel-overlay.dts | 4 ++++
4 files changed, 7 insertions(+), 3 deletions(-)
--- a/arch/arm/boot/dts/overlays/rpi-poe-overlay.dts
+++ b/arch/arm/boot/dts/overlays/rpi-poe-overlay.dts
@@ -145,7 +145,7 @@
poe_fan_temp2_hyst = <&trip2>,"hysteresis:0";
poe_fan_temp3 = <&trip3>,"temperature:0";
poe_fan_temp3_hyst = <&trip3>,"hysteresis:0";
- i2c = <0>, "+5+6",
+ i2c = <0>, "+7+8",
<&fwpwm>,"status=disabled",
<&i2c_bus>,"status=okay",
<&poe_mfd>,"status=okay",
--- a/arch/arm/boot/dts/overlays/rpi-poe-plus-overlay.dts
+++ b/arch/arm/boot/dts/overlays/rpi-poe-plus-overlay.dts
@@ -28,7 +28,7 @@
};
__overrides__ {
- i2c = <0>, "+5+6",
+ i2c = <0>, "+7+8",
<&fwpwm>,"status=disabled",
<&rpi_poe_power_supply>,"status=disabled",
<&i2c_bus>,"status=okay",
--- a/arch/arm/boot/dts/overlays/sx150x-overlay.dts
+++ b/arch/arm/boot/dts/overlays/sx150x-overlay.dts
@@ -1681,7 +1681,7 @@
sx1507-1-3E-int-gpio = <0>,"+67+99", <&sx150x_1_3E_pins>,"brcm,pins:0", <&sx1507_1_3E>,"interrupts:0";
sx1507-0-3F-int-gpio = <0>,"+68+100", <&sx150x_0_3F_pins>,"brcm,pins:0", <&sx1507_0_3F>,"interrupts:0";
sx1507-1-3F-int-gpio = <0>,"+69+101", <&sx150x_1_3F_pins>,"brcm,pins:0", <&sx1507_1_3F>,"interrupts:0";
- sx1507-0-70-int-gpio = <0>,"+60+102", <&sx150x_0_70_pins>,"brcm,pins:0", <&sx1507_0_70>,"interrupts:0";
+ sx1507-0-70-int-gpio = <0>,"+70+102", <&sx150x_0_70_pins>,"brcm,pins:0", <&sx1507_0_70>,"interrupts:0";
sx1507-1-70-int-gpio = <0>,"+71+103", <&sx150x_1_70_pins>,"brcm,pins:0", <&sx1507_1_70>,"interrupts:0";
sx1507-0-71-int-gpio = <0>,"+72+104", <&sx150x_0_71_pins>,"brcm,pins:0", <&sx1507_0_71>,"interrupts:0";
sx1507-1-71-int-gpio = <0>,"+73+105", <&sx150x_1_71_pins>,"brcm,pins:0", <&sx1507_1_71>,"interrupts:0";
--- a/arch/arm/boot/dts/overlays/vc4-kms-dpi-panel-overlay.dts
+++ b/arch/arm/boot/dts/overlays/vc4-kms-dpi-panel-overlay.dts
@@ -42,24 +42,28 @@
pinctrl-0 = <&dpi_18bit_gpio0>;
};
};
+#if 0
fragment@92 {
target = <&dpi>;
__dormant__ {
pinctrl-0 = <&dpi_gpio0>;
};
};
+#endif
fragment@93 {
target = <&dpi>;
__dormant__ {
pinctrl-0 = <&dpi_16bit_cpadhi_gpio0>;
};
};
+#if 0
fragment@94 {
target = <&dpi>;
__dormant__ {
pinctrl-0 = <&dpi_16bit_gpio0>;
};
};
+#endif
__overrides__ {
at056tn53v1 = <0>, "+0+90";

View File

@ -0,0 +1,33 @@
From bba53a117a4a5c29da892962332ff1605990e17a Mon Sep 17 00:00:00 2001
From: Phil Elwell <phil@raspberrypi.com>
Date: Wed, 26 Mar 2025 11:28:28 +0000
Subject: [PATCH] dts: rp1: Don't use DMA with UARTs
DMA has been enabled on RP1's UART0, but with mixed success. Transmits
seem to work, but the DMA interface is not well suited to receiving
arbitrary amounts of data. In particular, the PL011 driver is slow to
pass on the received data, batching it into large blocks.
On balance, it's better to just disable the DMA support. As with the
other UARTs, the required runes are left in the DTS as comments.
Signed-off-by: Phil Elwell <phil@raspberrypi.com>
---
arch/arm64/boot/dts/broadcom/rp1.dtsi | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
--- a/arch/arm64/boot/dts/broadcom/rp1.dtsi
+++ b/arch/arm64/boot/dts/broadcom/rp1.dtsi
@@ -65,9 +65,9 @@
interrupts = <RP1_INT_UART0 IRQ_TYPE_LEVEL_HIGH>;
clocks = <&rp1_clocks RP1_CLK_UART &rp1_clocks RP1_PLL_SYS_PRI_PH>;
clock-names = "uartclk", "apb_pclk";
- dmas = <&rp1_dma RP1_DMA_UART0_TX>,
- <&rp1_dma RP1_DMA_UART0_RX>;
- dma-names = "tx", "rx";
+ // dmas = <&rp1_dma RP1_DMA_UART0_TX>,
+ // <&rp1_dma RP1_DMA_UART0_RX>;
+ // dma-names = "tx", "rx";
pinctrl-names = "default";
arm,primecell-periphid = <0x00341011>;
uart-has-rtscts;

View File

@ -33,7 +33,7 @@ define Build/bcm4908img
cp -r $(DEVICE_NAME)/* $@-bootfs/
touch $@-bootfs/1-openwrt
cp $(DTS_DIR)/$(firstword $(DEVICE_DTS)).dtb $@-bootfs/94908.dtb
cp $(KDIR)/bcm63xx-cfe/$(subst _,$(comma),$(DEVICE_NAME))/cferam.000 $@-bootfs/
cp $(STAGING_DIR_IMAGE)/bcm63xx-cfe/$(subst _,$(comma),$(DEVICE_NAME))/cferam.000 $@-bootfs/
cp $(IMAGE_KERNEL) $@-bootfs/vmlinux.lz
$(STAGING_DIR_HOST)/bin/mkfs.jffs2 --pad=0x800000 --little-endian --squash-uids \

View File

@ -136,7 +136,7 @@ define Build/cfe-jffs2-cferam
# will have version 0 and let cferam be the second (version 1).
touch $@-cferam/1-openwrt
# Add cferam as the last file in the JFFS2 partition
cp $(KDIR)/bcm63xx-cfe/$(CFE_RAM_FILE) $@-cferam/$(CFE_RAM_JFFS2_NAME)
cp $(STAGING_DIR_IMAGE)/bcm63xx-cfe/$(CFE_RAM_FILE) $@-cferam/$(CFE_RAM_JFFS2_NAME)
# The JFFS2 partition creation should result in the following
# layout:

View File

@ -7,7 +7,7 @@ include $(TOPDIR)/rules.mk
ARCH:=arm
BOARD:=gemini
BOARDNAME:=Cortina Systems CS351x
FEATURES:=squashfs pci rtc usb dt gpio display ext4 rootfs-part boot-part
FEATURES:=squashfs pci rtc usb usbgadget dt gpio display ext4 rootfs-part boot-part
CPU_TYPE:=fa526
SUBTARGETS:=generic

View File

@ -0,0 +1,11 @@
. /lib/functions.sh
case "$(board_name)" in
dlink,dns-313)
uci set usbgadget.@preset[0].name="acm"
uci set usbgadget.@preset[0].UDC="69000000.usb"
uci commit usbgadget
;;
esac
exit 0

View File

@ -0,0 +1,4 @@
::sysinit:/etc/init.d/rcS S boot
::shutdown:/etc/init.d/rcS K shutdown
::askconsole:/usr/libexec/login.sh
ttyGS0::askfirst:/usr/libexec/login.sh

View File

@ -170,7 +170,7 @@ define Device/dlink_dns-313
DEVICE_VENDOR := D-Link
DEVICE_MODEL := DNS-313 1-Bay Network Storage Enclosure
DEVICE_DTS := gemini-dlink-dns-313
DEVICE_PACKAGES := $(GEMINI_NAS_PACKAGES)
DEVICE_PACKAGES := $(GEMINI_NAS_PACKAGES) usbgadget-acm
BLOCKSIZE := 1k
FILESYSTEMS := ext4
IMAGES := factory.bin.gz

View File

@ -1,18 +1,7 @@
From 7304d1909080ef0c9da703500a97f46c98393fcd Mon Sep 17 00:00:00 2001
From: Md Sadre Alam <quic_mdalam@quicinc.com>
To: <broonie@kernel.org>, <robh@kernel.org>, <krzk+dt@kernel.org>,
<conor+dt@kernel.org>, <andersson@kernel.org>,
<konradybcio@kernel.org>, <miquel.raynal@bootlin.com>,
<richard@nod.at>, <vigneshr@ti.com>,
<manivannan.sadhasivam@linaro.org>,
<linux-arm-msm@vger.kernel.org>, <linux-spi@vger.kernel.org>,
<devicetree@vger.kernel.org>, <linux-kernel@vger.kernel.org>,
<linux-mtd@lists.infradead.org>
Cc: <quic_srichara@quicinc.com>, <quic_varada@quicinc.com>,
<quic_mdalam@quicinc.com>
Subject: [PATCH v14 6/8] spi: spi-qpic: add driver for QCOM SPI NAND flash Interface
Date: Wed, 20 Nov 2024 14:45:04 +0530 [thread overview]
Message-ID: <20241120091507.1404368-7-quic_mdalam@quicinc.com> (raw)
In-Reply-To: <20241120091507.1404368-1-quic_mdalam@quicinc.com>
Date: Mon, 24 Feb 2025 16:44:14 +0530
Subject: [PATCH] spi: spi-qpic: add driver for QCOM SPI NAND flash Interface
This driver implements support for the SPI-NAND mode of QCOM NAND Flash
Interface as a SPI-MEM controller with pipelined ECC capability.
@ -22,199 +11,23 @@ Signed-off-by: Sricharan Ramabadhran <quic_srichara@quicinc.com>
Co-developed-by: Varadarajan Narayanan <quic_varada@quicinc.com>
Signed-off-by: Varadarajan Narayanan <quic_varada@quicinc.com>
Signed-off-by: Md Sadre Alam <quic_mdalam@quicinc.com>
Link: https://patch.msgid.link/20250224111414.2809669-3-quic_mdalam@quicinc.com
Signed-off-by: Mark Brown <broonie@kernel.org>
---
Change in [v14]
* No Change
Change in [v13]
* Changed return type of qcom_spi_cmd_mapping() from u32 to
int to fix the kernel test bot warning
* Changed type of variable cmd in qcom_spi_write_page() from u32
to int
* Removed unused variable s_op from qcom_spi_write_page()
* Updated return value variable type from u32 to int in
qcom_spi_send_cmdaddr()
Change in [v12]
* Added obj-$(CONFIG_SPI_QPIC_SNAND) += qpic_common.o in Makefile
to build qpic_common.c based on CONFIG_SPI_QPIC_SNAND
Change in [v11]
* Fixed build error reported by kernel test bot
* Changed "depends on MTD" to "select MTD" in
drivers/spi/Kconfig file
Change in [v10]
* Fixed compilation warnings reported by kernel test robot.
* Added depends on CONFIG_MTD
* removed extra bracket from statement if (i == (num_cw - 1)) in
qcom_spi_program_raw() api.
Change in [v9]
* Changed data type of addr1, addr2, cmd, to __le32 in qpic_spi_nand
structure
* In qcom_spi_set_read_loc_first() api added cpu_to_le32() macro to fix
compilation warning
* In qcom_spi_set_read_loc_last() api added cpu_to_le32() macro to fix
compilation warning
* In qcom_spi_init() api added cpu_to_le32() macro to fix compilation
warning
* In qcom_spi_ecc_init_ctx_pipelined() api removed unused variables
reqs, user, step_size, strength and added cpu_to_le32() macro as well
to fix compilation warning
* In qcom_spi_read_last_cw() api added cpu_to_le32() macro to fix compilation
warning
* In qcom_spi_check_error() api added cpu_to_le32() macro to fix compilation
warning
* In qcom_spi_read_page_ecc() api added cpu_to_le32() macro to fix compilation
warning
* In qcom_spi_read_page_oob() api added cpu_to_le32() macro to fix compilation
warning
* In qcom_spi_program_raw() api added cpu_to_le32() macro to fix compilation
warning
* In qcom_spi_program_ecc() api added cpu_to_le32() macro to fix compilation
warning
* In qcom_spi_program_oob() api added cpu_to_le32() macro to fix compilation
warning
* In qcom_spi_send_cmdaddr() api added cpu_to_le32() macro to fix compilation
warning
* In qcom_spi_io_op() api added cpu_to_le32() macro to fix compilation
warning
Change in [v8]
* Included "bitfield.h" file to /spi-qpic-snand.c
to fix compilation warning reported by kernel test robot
* Removed unused variable "steps" in
qcom_spi_ecc_init_ctx_pipelined() to fix compilation warning
Change in [v7]
* Added read_oob() and write_oob() api
* Handled offset value for oob layout
* Made CONFIG_SPI_QPIC_SNAND as bool
* Added macro ecceng_to_qspi()
* Added FIELD_PREP() Macro in spi init
* Added else condition in
qcom_spi_ecc_finish_io_req_pipelined()
for corrected ecc
* Handled multiple error condition for api
qcom_spi_cmd_mapping()
* Fix typo for printing debug message
Change in [v6]
* Added separate qpic_spi_nand{...} struct
* moved qpic_ecc and qcom_ecc_stats struct to
spi-qpic-snand.c file, since its spi nand
specific
* Added FIELD_PREP() and GENMASK() macro
* Removed rawnand.h and partition.h from
spi-qpic-snand.c
* Removed oob_buff assignment form
qcom_spi_write_page_cache
* Added qcom_nand_unalloc() in remove() path
* Fixes all all comments
Change in [v5]
* Added raw_read() and raw_write() api
* Updated commit message
* Removed register indirection
* Added qcom_spi_ prefix to all the api
* Removed snand_set_reg() api.
* Fixed nandbiterr issue
* Removed hardcoded num_cw and made it variable
* Removed hardcoded value for mtd pagesize
* Added -ENOSUPPORT in cmd mapping for unsupported
commands
* Replace if..else with switch..case statement
Change in [v4]
* No change
Change in [v3]
* Set SPI_QPIC_SNAND to n and added COMPILE_TEST in Kconfig
* Made driver name sorted in Make file
* Made comment like c++
* Changed macro to functions, snandc_set_read_loc_last()
and snandc_set_read_loc_first()
* Added error handling in snandc_set_reg()
* Changed into normal conditional statement for
return snandc->ecc_stats.failed ? -EBADMSG :
snandc->ecc_stats.bitflips;
* Remove cast of wbuf in qpic_snand_program_execute()
function
* Made num_cw variable instead hardcoded value
* changed if..else condition of function qpic_snand_io_op()
to switch..case statement
* Added __devm_spi_alloc_controller() api instead of
devm_spi_alloc_master()
* Disabling clock in remove path
Change in [v2]
* Added initial support for SPI-NAND driver
Change in [v1]
* Added RFC patch for design review
drivers/mtd/nand/Makefile | 4 +
drivers/spi/Kconfig | 9 +
drivers/spi/Makefile | 1 +
drivers/spi/spi-qpic-snand.c | 1633 ++++++++++++++++++++++++++
drivers/spi/spi-qpic-snand.c | 1631 ++++++++++++++++++++++++++
include/linux/mtd/nand-qpic-common.h | 7 +
5 files changed, 1654 insertions(+)
5 files changed, 1652 insertions(+)
create mode 100644 drivers/spi/spi-qpic-snand.c
--- a/drivers/mtd/nand/Makefile
+++ b/drivers/mtd/nand/Makefile
@@ -4,7 +4,11 @@ nandcore-objs := core.o bbt.o
@@ -3,7 +3,11 @@
nandcore-objs := core.o bbt.o
obj-$(CONFIG_MTD_NAND_CORE) += nandcore.o
obj-$(CONFIG_MTD_NAND_ECC_MEDIATEK) += ecc-mtk.o
obj-$(CONFIG_MTD_NAND_MTK_BMT) += mtk_bmt.o mtk_bmt_v2.o mtk_bmt_bbt.o mtk_bmt_nmbm.o
+ifeq ($(CONFIG_SPI_QPIC_SNAND),y)
+obj-$(CONFIG_SPI_QPIC_SNAND) += qpic_common.o
+else
@ -253,7 +66,7 @@ Change in [v1]
obj-$(CONFIG_SPI_ROCKCHIP_SFC) += spi-rockchip-sfc.o
--- /dev/null
+++ b/drivers/spi/spi-qpic-snand.c
@@ -0,0 +1,1633 @@
@@ -0,0 +1,1631 @@
+/*
+ * SPDX-License-Identifier: GPL-2.0
+ *
@ -314,6 +127,7 @@ Change in [v1]
+#define BAD_BLOCK_MARKER_SIZE 0x2
+#define OOB_BUF_SIZE 128
+#define ecceng_to_qspi(eng) container_of(eng, struct qpic_spi_nand, ecc_eng)
+
+struct qpic_snand_op {
+ u32 cmd_reg;
+ u32 addr1_reg;
@ -1456,64 +1270,63 @@ Change in [v1]
+ return 0;
+}
+
+static int qcom_spi_cmd_mapping(struct qcom_nand_controller *snandc, u32 opcode)
+static int qcom_spi_cmd_mapping(struct qcom_nand_controller *snandc, u32 opcode, u32 *cmd)
+{
+ int cmd = 0x0;
+
+ switch (opcode) {
+ case SPINAND_RESET:
+ cmd = (SPI_WP | SPI_HOLD | SPI_TRANSFER_MODE_x1 | OP_RESET_DEVICE);
+ *cmd = (SPI_WP | SPI_HOLD | SPI_TRANSFER_MODE_x1 | OP_RESET_DEVICE);
+ break;
+ case SPINAND_READID:
+ cmd = (SPI_WP | SPI_HOLD | SPI_TRANSFER_MODE_x1 | OP_FETCH_ID);
+ *cmd = (SPI_WP | SPI_HOLD | SPI_TRANSFER_MODE_x1 | OP_FETCH_ID);
+ break;
+ case SPINAND_GET_FEATURE:
+ cmd = (SPI_TRANSFER_MODE_x1 | SPI_WP | SPI_HOLD | ACC_FEATURE);
+ *cmd = (SPI_TRANSFER_MODE_x1 | SPI_WP | SPI_HOLD | ACC_FEATURE);
+ break;
+ case SPINAND_SET_FEATURE:
+ cmd = (SPI_TRANSFER_MODE_x1 | SPI_WP | SPI_HOLD | ACC_FEATURE |
+ *cmd = (SPI_TRANSFER_MODE_x1 | SPI_WP | SPI_HOLD | ACC_FEATURE |
+ QPIC_SET_FEATURE);
+ break;
+ case SPINAND_READ:
+ if (snandc->qspi->raw_rw) {
+ cmd = (PAGE_ACC | LAST_PAGE | SPI_TRANSFER_MODE_x1 |
+ *cmd = (PAGE_ACC | LAST_PAGE | SPI_TRANSFER_MODE_x1 |
+ SPI_WP | SPI_HOLD | OP_PAGE_READ);
+ } else {
+ cmd = (PAGE_ACC | LAST_PAGE | SPI_TRANSFER_MODE_x1 |
+ *cmd = (PAGE_ACC | LAST_PAGE | SPI_TRANSFER_MODE_x1 |
+ SPI_WP | SPI_HOLD | OP_PAGE_READ_WITH_ECC);
+ }
+
+ break;
+ case SPINAND_ERASE:
+ cmd = OP_BLOCK_ERASE | PAGE_ACC | LAST_PAGE | SPI_WP |
+ *cmd = OP_BLOCK_ERASE | PAGE_ACC | LAST_PAGE | SPI_WP |
+ SPI_HOLD | SPI_TRANSFER_MODE_x1;
+ break;
+ case SPINAND_WRITE_EN:
+ cmd = SPINAND_WRITE_EN;
+ *cmd = SPINAND_WRITE_EN;
+ break;
+ case SPINAND_PROGRAM_EXECUTE:
+ cmd = (PAGE_ACC | LAST_PAGE | SPI_TRANSFER_MODE_x1 |
+ *cmd = (PAGE_ACC | LAST_PAGE | SPI_TRANSFER_MODE_x1 |
+ SPI_WP | SPI_HOLD | OP_PROGRAM_PAGE);
+ break;
+ case SPINAND_PROGRAM_LOAD:
+ cmd = SPINAND_PROGRAM_LOAD;
+ *cmd = SPINAND_PROGRAM_LOAD;
+ break;
+ default:
+ dev_err(snandc->dev, "Opcode not supported: %u\n", opcode);
+ return -EOPNOTSUPP;
+ }
+
+ return cmd;
+ return 0;
+}
+
+static int qcom_spi_write_page(struct qcom_nand_controller *snandc,
+ const struct spi_mem_op *op)
+{
+ int cmd;
+ int ret;
+ u32 cmd;
+
+ cmd = qcom_spi_cmd_mapping(snandc, op->cmd.opcode);
+ if (cmd < 0)
+ return cmd;
+ ret = qcom_spi_cmd_mapping(snandc, op->cmd.opcode, &cmd);
+ if (ret < 0)
+ return ret;
+
+ if (op->cmd.opcode == SPINAND_PROGRAM_LOAD)
+ snandc->qspi->data_buf = (u8 *)op->data.buf.out;
@ -1528,12 +1341,10 @@ Change in [v1]
+ u32 cmd;
+ int ret, opcode;
+
+ ret = qcom_spi_cmd_mapping(snandc, op->cmd.opcode);
+ ret = qcom_spi_cmd_mapping(snandc, op->cmd.opcode, &cmd);
+ if (ret < 0)
+ return ret;
+
+ cmd = ret;
+
+ s_op.cmd_reg = cmd;
+ s_op.addr1_reg = op->addr.val;
+ s_op.addr2_reg = 0;

View File

@ -0,0 +1,28 @@
From cf1ba3cb245020459f2ca446b7a7b199839f5d83 Mon Sep 17 00:00:00 2001
From: Dan Carpenter <dan.carpenter@linaro.org>
Date: Thu, 6 Mar 2025 12:40:01 +0300
Subject: [PATCH] spi: spi-qpic-snand: Fix ECC_CFG_ECC_DISABLE shift in
qcom_spi_read_last_cw()
The ECC_CFG_ECC_DISABLE define is BIT(0). It's supposed to be used
directly instead of used as a shifter.
Fixes: 7304d1909080 ("spi: spi-qpic: add driver for QCOM SPI NAND flash Interface")
Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org>
Link: https://patch.msgid.link/2f4b0a0b-2c03-41c0-8a4a-3d789a83832d@stanley.mountain
Signed-off-by: Mark Brown <broonie@kernel.org>
---
drivers/spi/spi-qpic-snand.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
--- a/drivers/spi/spi-qpic-snand.c
+++ b/drivers/spi/spi-qpic-snand.c
@@ -514,7 +514,7 @@ static int qcom_spi_read_last_cw(struct
cfg0 = (ecc_cfg->cfg0_raw & ~(7U << CW_PER_PAGE)) |
0 << CW_PER_PAGE;
cfg1 = ecc_cfg->cfg1_raw;
- ecc_bch_cfg = 1 << ECC_CFG_ECC_DISABLE;
+ ecc_bch_cfg = ECC_CFG_ECC_DISABLE;
snandc->regs->cmd = snandc->qspi->cmd;
snandc->regs->cfg0 = cpu_to_le32(cfg0);

View File

@ -0,0 +1,35 @@
From d450cdd9c4398add1f2aa7200f2c95f1e3b9f9fa Mon Sep 17 00:00:00 2001
From: Gabor Juhos <j4g8y7@gmail.com>
Date: Thu, 13 Mar 2025 19:31:21 +0100
Subject: [PATCH] spi: spi-qpic-snand: avoid memleak in
qcom_spi_ecc_init_ctx_pipelined()
When the allocation of the OOB buffer fails, the
qcom_spi_ecc_init_ctx_pipelined() function returns without freeing
the memory allocated for 'ecc_cfg' thus it can cause a memory leak.
Call kfree() to free 'ecc_cfg' before returning from the function
to avoid that.
Fixes: 7304d1909080 ("spi: spi-qpic: add driver for QCOM SPI NAND flash Interface")
Signed-off-by: Gabor Juhos <j4g8y7@gmail.com>
Link: https://patch.msgid.link/20250313-qpic-snand-memleak-fix-v1-1-e54e78d1da3a@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
---
drivers/spi/spi-qpic-snand.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
--- a/drivers/spi/spi-qpic-snand.c
+++ b/drivers/spi/spi-qpic-snand.c
@@ -263,8 +263,10 @@ static int qcom_spi_ecc_init_ctx_pipelin
return -ENOMEM;
snandc->qspi->oob_buf = kzalloc(mtd->writesize + mtd->oobsize,
GFP_KERNEL);
- if (!snandc->qspi->oob_buf)
+ if (!snandc->qspi->oob_buf) {
+ kfree(ecc_cfg);
return -ENOMEM;
+ }
memset(snandc->qspi->oob_buf, 0xff, mtd->writesize + mtd->oobsize);

View File

@ -0,0 +1,49 @@
From d32c4e58545f17caaa854415f854691e32d42075 Mon Sep 17 00:00:00 2001
From: Geert Uytterhoeven <geert+renesas@glider.be>
Date: Wed, 26 Mar 2025 15:22:19 +0100
Subject: [PATCH] spi: SPI_QPIC_SNAND should be tristate and depend on MTD
SPI_QPIC_SNAND is the only driver that selects MTD instead of depending
on it, which could lead to circular dependencies. Moreover, as
SPI_QPIC_SNAND is bool, this forces MTD (and various related symbols) to
be built-in, as can be seen in an allmodconfig kernel.
Except for a missing semicolon, there is no reason why SPI_QPIC_SNAND
cannot be tristate; all MODULE_*() boilerplate is already present.
Hence make SPI_QPIC_SNAND tristate, let it depend on MTD, and add the
missing semicolon.
Fixes: 7304d1909080ef0c ("spi: spi-qpic: add driver for QCOM SPI NAND flash Interface")
Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
Link: https://patch.msgid.link/b63db431cbf35223a4400e44c296293d32c4543c.1742998909.git.geert+renesas@glider.be
Signed-off-by: Mark Brown <broonie@kernel.org>
---
drivers/spi/Kconfig | 4 ++--
drivers/spi/spi-qpic-snand.c | 2 +-
2 files changed, 3 insertions(+), 3 deletions(-)
--- a/drivers/spi/Kconfig
+++ b/drivers/spi/Kconfig
@@ -871,9 +871,9 @@ config SPI_QCOM_QSPI
QSPI(Quad SPI) driver for Qualcomm QSPI controller.
config SPI_QPIC_SNAND
- bool "QPIC SNAND controller"
+ tristate "QPIC SNAND controller"
depends on ARCH_QCOM || COMPILE_TEST
- select MTD
+ depends on MTD
help
QPIC_SNAND (QPIC SPI NAND) driver for Qualcomm QPIC controller.
QPIC controller supports both parallel nand and serial nand.
--- a/drivers/spi/spi-qpic-snand.c
+++ b/drivers/spi/spi-qpic-snand.c
@@ -1614,7 +1614,7 @@ static const struct of_device_id qcom_sn
.data = &ipq9574_snandc_props,
},
{}
-}
+};
MODULE_DEVICE_TABLE(of, qcom_snandc_of_match);
static struct platform_driver qcom_spi_driver = {

View File

@ -0,0 +1,29 @@
From f48d80503504257682e493dc17408f2f0b47bcfa Mon Sep 17 00:00:00 2001
From: Gabor Juhos <j4g8y7@gmail.com>
Date: Thu, 20 Mar 2025 19:11:59 +0100
Subject: [PATCH] spi: spi-qpic-snand: use kmalloc() for OOB buffer allocation
The qcom_spi_ecc_init_ctx_pipelined() function allocates zeroed
memory for the OOB buffer, then it fills the buffer with '0xff'
bytes right after the allocation. In this case zeroing the memory
during allocation is superfluous, so use kmalloc() instead of
kzalloc() to avoid that.
Signed-off-by: Gabor Juhos <j4g8y7@gmail.com>
Link: https://patch.msgid.link/20250320-qpic-snand-kmalloc-v1-1-94e267550675@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
---
drivers/spi/spi-qpic-snand.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
--- a/drivers/spi/spi-qpic-snand.c
+++ b/drivers/spi/spi-qpic-snand.c
@@ -261,7 +261,7 @@ static int qcom_spi_ecc_init_ctx_pipelin
ecc_cfg = kzalloc(sizeof(*ecc_cfg), GFP_KERNEL);
if (!ecc_cfg)
return -ENOMEM;
- snandc->qspi->oob_buf = kzalloc(mtd->writesize + mtd->oobsize,
+ snandc->qspi->oob_buf = kmalloc(mtd->writesize + mtd->oobsize,
GFP_KERNEL);
if (!snandc->qspi->oob_buf) {
kfree(ecc_cfg);

View File

@ -1199,19 +1199,17 @@ static int adm6996_gpio_probe(struct platform_device *pdev)
return 0;
}
static int adm6996_gpio_remove(struct platform_device *pdev)
static void adm6996_gpio_remove(struct platform_device *pdev)
{
struct adm6996_priv *priv = platform_get_drvdata(pdev);
if (priv && (priv->model == ADM6996M || priv->model == ADM6996L))
unregister_switch(&priv->dev);
return 0;
}
static struct platform_driver adm6996_gpio_driver = {
.probe = adm6996_gpio_probe,
.remove = adm6996_gpio_remove,
.remove_new = adm6996_gpio_remove,
.driver = {
.name = "adm6996_gpio",
},

View File

@ -23,6 +23,7 @@
#include <linux/lockdep.h>
#include <linux/ar8216_platform.h>
#include <linux/workqueue.h>
#include <linux/of.h>
#include <linux/of_device.h>
#include <linux/leds.h>
#include <linux/mdio.h>
@ -1209,7 +1210,7 @@ ar8327_sw_hw_apply(struct switch_dev *dev)
return 0;
}
int
static int
ar8327_sw_get_port_igmp_snooping(struct switch_dev *dev,
const struct switch_attr *attr,
struct switch_val *val)
@ -1227,7 +1228,7 @@ ar8327_sw_get_port_igmp_snooping(struct switch_dev *dev,
return 0;
}
int
static int
ar8327_sw_set_port_igmp_snooping(struct switch_dev *dev,
const struct switch_attr *attr,
struct switch_val *val)
@ -1245,7 +1246,7 @@ ar8327_sw_set_port_igmp_snooping(struct switch_dev *dev,
return 0;
}
int
static int
ar8327_sw_get_igmp_snooping(struct switch_dev *dev,
const struct switch_attr *attr,
struct switch_val *val)
@ -1262,7 +1263,7 @@ ar8327_sw_get_igmp_snooping(struct switch_dev *dev,
return 0;
}
int
static int
ar8327_sw_set_igmp_snooping(struct switch_dev *dev,
const struct switch_attr *attr,
struct switch_val *val)
@ -1278,7 +1279,7 @@ ar8327_sw_set_igmp_snooping(struct switch_dev *dev,
return 0;
}
int
static int
ar8327_sw_get_igmp_v3(struct switch_dev *dev,
const struct switch_attr *attr,
struct switch_val *val)
@ -1294,7 +1295,7 @@ ar8327_sw_get_igmp_v3(struct switch_dev *dev,
return 0;
}
int
static int
ar8327_sw_set_igmp_v3(struct switch_dev *dev,
const struct switch_attr *attr,
struct switch_val *val)

View File

@ -217,19 +217,17 @@ static int b53_mmap_probe(struct platform_device *pdev)
return b53_swconfig_switch_register(dev);
}
static int b53_mmap_remove(struct platform_device *pdev)
static void b53_mmap_remove(struct platform_device *pdev)
{
struct b53_device *dev = platform_get_drvdata(pdev);
if (dev)
b53_switch_remove(dev);
return 0;
}
static struct platform_driver b53_mmap_driver = {
.probe = b53_mmap_probe,
.remove = b53_mmap_remove,
.remove_new = b53_mmap_remove,
.driver = {
.name = "b53-switch",
},

View File

@ -354,19 +354,17 @@ static int b53_srab_probe(struct platform_device *pdev)
return b53_swconfig_switch_register(dev);
}
static int b53_srab_remove(struct platform_device *pdev)
static void b53_srab_remove(struct platform_device *pdev)
{
struct b53_device *dev = platform_get_drvdata(pdev);
if (dev)
b53_switch_remove(dev);
return 0;
}
static struct platform_driver b53_srab_driver = {
.probe = b53_srab_probe,
.remove = b53_srab_remove,
.remove_new = b53_srab_remove,
.driver = {
.name = "b53-srab-switch",
},

View File

@ -254,7 +254,7 @@ static int __rtl8366_smi_read_reg(struct rtl8366_smi *smi, u32 addr, u32 *data)
#define MDC_MDIO_WRITE_OP 0x0003
#define MDC_REALTEK_PHY_ADDR 0x0
int __rtl8366_mdio_read_reg(struct rtl8366_smi *smi, u32 addr, u32 *data)
static int __rtl8366_mdio_read_reg(struct rtl8366_smi *smi, u32 addr, u32 *data)
{
u32 phy_id = smi->phy_id;
struct mii_bus *mbus = smi->ext_mbus;
@ -1527,7 +1527,7 @@ static void rtl8366_smi_reset(struct rtl8366_smi *smi, bool active)
reset_control_deassert(smi->reset);
}
int rtl8366_smi_probe_of(struct platform_device *pdev, struct rtl8366_smi *smi)
static int rtl8366_smi_probe_of(struct platform_device *pdev, struct rtl8366_smi *smi)
{
int sck = of_get_named_gpio(pdev->dev.of_node, "gpio-sck", 0);
int sda = of_get_named_gpio(pdev->dev.of_node, "gpio-sda", 0);
@ -1577,7 +1577,7 @@ static inline int rtl8366_smi_probe_of(struct platform_device *pdev, struct rtl8
}
#endif
int rtl8366_smi_probe_plat(struct platform_device *pdev, struct rtl8366_smi *smi)
static int rtl8366_smi_probe_plat(struct platform_device *pdev, struct rtl8366_smi *smi)
{
struct rtl8366_platform_data *pdata = pdev->dev.platform_data;

View File

@ -1478,7 +1478,7 @@ static int rtl8366rb_probe(struct platform_device *pdev)
return err;
}
static int rtl8366rb_remove(struct platform_device *pdev)
static void rtl8366rb_remove(struct platform_device *pdev)
{
struct rtl8366_smi *smi = platform_get_drvdata(pdev);
@ -1488,8 +1488,6 @@ static int rtl8366rb_remove(struct platform_device *pdev)
rtl8366_smi_cleanup(smi);
kfree(smi);
}
return 0;
}
#ifdef CONFIG_OF
@ -1506,7 +1504,7 @@ static struct platform_driver rtl8366rb_driver = {
.of_match_table = of_match_ptr(rtl8366rb_match),
},
.probe = rtl8366rb_probe,
.remove = rtl8366rb_remove,
.remove_new = rtl8366rb_remove,
};
static int __init rtl8366rb_module_init(void)

View File

@ -1266,7 +1266,7 @@ static int rtl8366s_probe(struct platform_device *pdev)
return err;
}
static int rtl8366s_remove(struct platform_device *pdev)
static void rtl8366s_remove(struct platform_device *pdev)
{
struct rtl8366_smi *smi = platform_get_drvdata(pdev);
@ -1276,8 +1276,6 @@ static int rtl8366s_remove(struct platform_device *pdev)
rtl8366_smi_cleanup(smi);
kfree(smi);
}
return 0;
}
#ifdef CONFIG_OF
@ -1296,7 +1294,7 @@ static struct platform_driver rtl8366s_driver = {
#endif
},
.probe = rtl8366s_probe,
.remove = rtl8366s_remove,
.remove_new = rtl8366s_remove,
};
static int __init rtl8366s_module_init(void)

View File

@ -1801,7 +1801,7 @@ static int rtl8367_probe(struct platform_device *pdev)
return err;
}
static int rtl8367_remove(struct platform_device *pdev)
static void rtl8367_remove(struct platform_device *pdev)
{
struct rtl8366_smi *smi = platform_get_drvdata(pdev);
@ -1811,8 +1811,6 @@ static int rtl8367_remove(struct platform_device *pdev)
rtl8366_smi_cleanup(smi);
kfree(smi);
}
return 0;
}
static void rtl8367_shutdown(struct platform_device *pdev)
@ -1839,7 +1837,7 @@ static struct platform_driver rtl8367_driver = {
#endif
},
.probe = rtl8367_probe,
.remove = rtl8367_remove,
.remove_new = rtl8367_remove,
.shutdown = rtl8367_shutdown,
};

View File

@ -1600,7 +1600,7 @@ static int rtl8367b_probe(struct platform_device *pdev)
return err;
}
static int rtl8367b_remove(struct platform_device *pdev)
static void rtl8367b_remove(struct platform_device *pdev)
{
struct rtl8366_smi *smi = platform_get_drvdata(pdev);
@ -1610,8 +1610,6 @@ static int rtl8367b_remove(struct platform_device *pdev)
rtl8366_smi_cleanup(smi);
kfree(smi);
}
return 0;
}
static void rtl8367b_shutdown(struct platform_device *pdev)
@ -1638,7 +1636,7 @@ static struct platform_driver rtl8367b_driver = {
#endif
},
.probe = rtl8367b_probe,
.remove = rtl8367b_remove,
.remove_new = rtl8367b_remove,
.shutdown = rtl8367b_shutdown,
};

View File

@ -1057,7 +1057,7 @@ static struct genl_family switch_fam = {
};
#ifdef CONFIG_OF
void
static void
of_switch_load_portmap(struct switch_dev *dev)
{
struct device_node *port;

View File

@ -28,6 +28,6 @@ Subject: [PATCH] mtd/nand: add MediaTek NAND bad block managment table
obj-$(CONFIG_MTD_NAND_CORE) += nandcore.o
obj-$(CONFIG_MTD_NAND_ECC_MEDIATEK) += ecc-mtk.o
+obj-$(CONFIG_MTD_NAND_MTK_BMT) += mtk_bmt.o mtk_bmt_v2.o mtk_bmt_bbt.o mtk_bmt_nmbm.o
obj-$(CONFIG_MTD_NAND_QCOM) += qpic_common.o
obj-y += onenand/
obj-y += raw/
ifeq ($(CONFIG_SPI_QPIC_SNAND),y)
obj-$(CONFIG_SPI_QPIC_SNAND) += qpic_common.o
else

View File

@ -13,7 +13,7 @@ Signed-off-by: Daniel Golle <daniel@makrotopia.org>
--- a/drivers/net/usb/rndis_host.c
+++ b/drivers/net/usb/rndis_host.c
@@ -630,6 +630,16 @@ static const struct driver_info zte_rndi
@@ -640,6 +640,16 @@ static const struct driver_info wwan_rnd
.tx_fixup = rndis_tx_fixup,
};
@ -30,7 +30,7 @@ Signed-off-by: Daniel Golle <daniel@makrotopia.org>
/*-------------------------------------------------------------------------*/
static const struct usb_device_id products [] = {
@@ -666,6 +676,36 @@ static const struct usb_device_id produc
@@ -676,6 +686,36 @@ static const struct usb_device_id produc
USB_INTERFACE_INFO(USB_CLASS_WIRELESS_CONTROLLER, 1, 3),
.driver_info = (unsigned long) &rndis_info,
}, {
@ -64,6 +64,6 @@ Signed-off-by: Daniel Golle <daniel@makrotopia.org>
+ USB_CLASS_WIRELESS_CONTROLLER, 1, 3),
+ .driver_info = (unsigned long) &asr_rndis_info,
+}, {
/* Novatel Verizon USB730L */
USB_INTERFACE_INFO(USB_CLASS_MISC, 4, 1),
.driver_info = (unsigned long) &rndis_info,
/* Mobile Broadband Modem, seen in Novatel Verizon USB730L and
* Telit FN990A (RNDIS)
*/

View File

@ -1,63 +0,0 @@
From linux-netdev Tue Dec 03 13:04:55 2024
From: Dominique Martinet <asmadeus () codewreck ! org>
Date: Tue, 03 Dec 2024 13:04:55 +0000
To: linux-netdev
Subject: [PATCH] net: usb: usbnet: restore usb%d name exception for local mac addresses
Message-Id: <20241203130457.904325-1-asmadeus () codewreck ! org>
X-MARC-Message: https://marc.info/?l=linux-netdev&m=173323431631309
From: Dominique Martinet <dominique.martinet@atmark-techno.com>
The previous commit assumed that local addresses always came from the
kernel, but some devices hand out local mac addresses so we ended up
with point-to-point devices with a mac set by the driver, renaming to
eth%d when they used to be named usb%d.
Userspace should not rely on device name, but for the sake of stability
restore the local mac address check portion of the naming exception:
point to point devices which either have no mac set by the driver or
have a local mac handed out by the driver will keep the usb%d name.
Fixes: 8a7d12d674ac ("net: usb: usbnet: fix name regression")
Signed-off-by: Dominique Martinet <dominique.martinet@atmark-techno.com>
---
drivers/net/usb/usbnet.c | 20 ++++++++++++++------
1 file changed, 14 insertions(+), 6 deletions(-)
--- a/drivers/net/usb/usbnet.c
+++ b/drivers/net/usb/usbnet.c
@@ -178,6 +178,17 @@ int usbnet_get_ethernet_addr(struct usbn
}
EXPORT_SYMBOL_GPL(usbnet_get_ethernet_addr);
+static bool usbnet_needs_usb_name_format(struct usbnet *dev, struct net_device *net)
+{
+ /* Point to point devices which don't have a real MAC address
+ * (or report a fake local one) have historically used the usb%d
+ * naming. Preserve this..
+ */
+ return (dev->driver_info->flags & FLAG_POINTTOPOINT) != 0 &&
+ (is_zero_ether_addr(net->dev_addr) ||
+ is_local_ether_addr(net->dev_addr));
+}
+
static void intr_complete (struct urb *urb)
{
struct usbnet *dev = urb->context;
@@ -1766,13 +1777,10 @@ usbnet_probe (struct usb_interface *udev
if (status < 0)
goto out1;
- // heuristic: "usb%d" for links we know are two-host,
- // else "eth%d" when there's reasonable doubt. userspace
- // can rename the link if it knows better.
+ /* heuristic: rename to "eth%d" if we are not sure this link
+ * is two-host (these links keep "usb%d") */
if ((dev->driver_info->flags & FLAG_ETHER) != 0 &&
- ((dev->driver_info->flags & FLAG_POINTTOPOINT) == 0 ||
- /* somebody touched it*/
- !is_zero_ether_addr(net->dev_addr)))
+ !usbnet_needs_usb_name_format(dev, net))
strscpy(net->name, "eth%d", sizeof(net->name));
/* WLAN devices should always be named "wlan%d" */
if ((dev->driver_info->flags & FLAG_WLAN) != 0)

View File

@ -138,7 +138,7 @@ Signed-off-by: Jonas Gorski <jogo@openwrt.org>
static const struct rt6_info ip6_blk_hole_entry_template = {
.dst = {
.__rcuref = RCUREF_INIT(1),
@@ -1043,6 +1057,7 @@ static const int fib6_prop[RTN_MAX + 1]
@@ -1077,6 +1091,7 @@ static const int fib6_prop[RTN_MAX + 1]
[RTN_BLACKHOLE] = -EINVAL,
[RTN_UNREACHABLE] = -EHOSTUNREACH,
[RTN_PROHIBIT] = -EACCES,
@ -146,7 +146,7 @@ Signed-off-by: Jonas Gorski <jogo@openwrt.org>
[RTN_THROW] = -EAGAIN,
[RTN_NAT] = -EINVAL,
[RTN_XRESOLVE] = -EINVAL,
@@ -1078,6 +1093,10 @@ static void ip6_rt_init_dst_reject(struc
@@ -1112,6 +1127,10 @@ static void ip6_rt_init_dst_reject(struc
rt->dst.output = ip6_pkt_prohibit_out;
rt->dst.input = ip6_pkt_prohibit;
break;
@ -157,7 +157,7 @@ Signed-off-by: Jonas Gorski <jogo@openwrt.org>
case RTN_THROW:
case RTN_UNREACHABLE:
default:
@@ -4554,6 +4573,17 @@ static int ip6_pkt_prohibit_out(struct n
@@ -4588,6 +4607,17 @@ static int ip6_pkt_prohibit_out(struct n
return ip6_pkt_drop(skb, ICMPV6_ADM_PROHIBITED, IPSTATS_MIB_OUTNOROUTES);
}
@ -175,7 +175,7 @@ Signed-off-by: Jonas Gorski <jogo@openwrt.org>
/*
* Allocate a dst for local (unicast / anycast) address.
*/
@@ -5045,7 +5075,8 @@ static int rtm_to_fib6_config(struct sk_
@@ -5079,7 +5109,8 @@ static int rtm_to_fib6_config(struct sk_
if (rtm->rtm_type == RTN_UNREACHABLE ||
rtm->rtm_type == RTN_BLACKHOLE ||
rtm->rtm_type == RTN_PROHIBIT ||
@ -185,7 +185,7 @@ Signed-off-by: Jonas Gorski <jogo@openwrt.org>
cfg->fc_flags |= RTF_REJECT;
if (rtm->rtm_type == RTN_LOCAL)
@@ -6307,6 +6338,8 @@ static int ip6_route_dev_notify(struct n
@@ -6341,6 +6372,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
@@ -6318,6 +6351,7 @@ static int ip6_route_dev_notify(struct n
@@ -6352,6 +6385,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
}
@@ -6518,6 +6552,8 @@ static int __net_init ip6_route_net_init
@@ -6552,6 +6586,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);
@@ -6528,11 +6564,21 @@ static int __net_init ip6_route_net_init
@@ -6562,11 +6598,21 @@ static int __net_init ip6_route_net_init
ip6_template_metrics, true);
INIT_LIST_HEAD(&net->ipv6.ip6_prohibit_entry->dst.rt_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);
@@ -6559,6 +6605,8 @@ out:
@@ -6593,6 +6639,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:
@@ -6578,6 +6626,7 @@ static void __net_exit ip6_route_net_exi
@@ -6612,6 +6660,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);
@@ -6661,6 +6710,9 @@ void __init ip6_route_init_special_entri
@@ -6695,6 +6744,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);

View File

@ -161,7 +161,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
struct rtnl_link {
rtnl_doit_func doit;
@@ -4978,7 +4978,9 @@ int ndo_dflt_bridge_getlink(struct sk_bu
@@ -4981,7 +4981,9 @@ int ndo_dflt_bridge_getlink(struct sk_bu
brport_nla_put_flag(skb, flags, mask,
IFLA_BRPORT_MCAST_FLOOD, BR_MCAST_FLOOD) ||
brport_nla_put_flag(skb, flags, mask,

View File

@ -502,6 +502,7 @@ CONFIG_SPI_BITBANG=y
CONFIG_SPI_GPIO=y
CONFIG_SPI_MASTER=y
CONFIG_SPI_MEM=y
# CONFIG_SPI_QPIC_SNAND is not set
CONFIG_SPI_QUP=y
CONFIG_SPMI=y
# CONFIG_SPMI_HISI3670 is not set

View File

@ -500,6 +500,7 @@ CONFIG_SPARSE_IRQ=y
CONFIG_SPI=y
CONFIG_SPI_MASTER=y
CONFIG_SPI_MEM=y
# CONFIG_SPI_QPIC_SNAND is not set
CONFIG_SPI_QUP=y
CONFIG_SPMI=y
# CONFIG_SPMI_HISI3670 is not set

View File

@ -31,7 +31,6 @@ define Device/fsl_ls1021a-twr
DEVICE_VENDOR := NXP
DEVICE_MODEL := TWR-LS1021A
DEVICE_VARIANT := Default
DEVICE_PACKAGES += ~layerscape-rcw
IMAGE/firmware.bin := \
ls-clean | \
ls-append $(1)-rcw.bin | pad-to 1M | \

View File

@ -30,7 +30,6 @@ define Device/fsl_ls1012a-frdm
DEVICE_MODEL := FRDM-LS1012A
DEVICE_PACKAGES += \
layerscape-ppfe \
~trusted-firmware-a-ls1012a-frdm \
kmod-ppfe
BLOCKSIZE := 256KiB
IMAGE/firmware.bin := \
@ -56,7 +55,6 @@ define Device/fsl_ls1012a-rdb
DEVICE_MODEL := LS1012A-RDB
DEVICE_PACKAGES += \
layerscape-ppfe \
~trusted-firmware-a-ls1012a-rdb \
kmod-hwmon-ina2xx \
kmod-iio-fxas21002c-i2c \
kmod-iio-fxos8700-i2c \
@ -80,7 +78,6 @@ define Device/fsl_ls1012a-frwy-sdboot
DEVICE_MODEL := FRWY-LS1012A
DEVICE_PACKAGES += \
layerscape-ppfe \
~trusted-firmware-a-ls1012a-frwy-sdboot \
kmod-ppfe
DEVICE_DTS := fsl-ls1012a-frwy
IMAGES += firmware.bin
@ -105,7 +102,6 @@ define Device/fsl_ls1028a-rdb
DEVICE_VARIANT := Default
KERNEL = kernel-bin | gzip | fit gzip $$(DEVICE_DTS_DIR)/$$(DEVICE_DTS).dtb
DEVICE_PACKAGES += \
~trusted-firmware-a-ls1028a-rdb \
kmod-hwmon-ina2xx \
kmod-hwmon-lm90 \
kmod-rtc-pcf2127
@ -130,7 +126,6 @@ define Device/fsl_ls1028a-rdb-sdboot
DEVICE_VARIANT := SD Card Boot
DEVICE_DTS := fsl-ls1028a-rdb
DEVICE_PACKAGES += \
~trusted-firmware-a-ls1028a-rdb-sdboot \
kmod-hwmon-ina2xx \
kmod-hwmon-lm90 \
kmod-rtc-pcf2127
@ -151,8 +146,6 @@ define Device/fsl_ls1043a-rdb
DEVICE_MODEL := LS1043A-RDB
DEVICE_VARIANT := Default
DEVICE_PACKAGES += \
~layerscape-fman \
~trusted-firmware-a-ls1043a-rdb \
kmod-ahci-qoriq \
kmod-hwmon-ina2xx \
kmod-hwmon-lm90
@ -175,8 +168,6 @@ define Device/fsl_ls1043a-rdb-sdboot
DEVICE_MODEL := LS1043A-RDB
DEVICE_VARIANT := SD Card Boot
DEVICE_PACKAGES += \
~layerscape-fman \
~trusted-firmware-a-ls1043a-rdb-sdboot \
kmod-ahci-qoriq \
kmod-hwmon-ina2xx \
kmod-hwmon-lm90
@ -197,9 +188,6 @@ define Device/fsl_ls1046a-frwy
DEVICE_VENDOR := NXP
DEVICE_MODEL := FRWY-LS1046A
DEVICE_VARIANT := Default
DEVICE_PACKAGES += \
~layerscape-fman \
~trusted-firmware-a-ls1046a-frwy
IMAGE/firmware.bin := \
ls-clean | \
ls-append $(1)-bl2.pbl | pad-to 1M | \
@ -217,9 +205,6 @@ define Device/fsl_ls1046a-frwy-sdboot
DEVICE_VENDOR := NXP
DEVICE_MODEL := FRWY-LS1046A
DEVICE_VARIANT := SD Card Boot
DEVICE_PACKAGES += \
~layerscape-fman \
~trusted-firmware-a-ls1046a-frwy-sdboot
DEVICE_DTS := fsl-ls1046a-frwy
IMAGE/sdcard.img.gz := \
ls-clean | \
@ -239,8 +224,6 @@ define Device/fsl_ls1046a-rdb
DEVICE_MODEL := LS1046A-RDB
DEVICE_VARIANT := Default
DEVICE_PACKAGES += \
~layerscape-fman \
~trusted-firmware-a-ls1046a-rdb \
kmod-ahci-qoriq \
kmod-hwmon-ina2xx \
kmod-hwmon-lm90
@ -263,8 +246,6 @@ define Device/fsl_ls1046a-rdb-sdboot
DEVICE_MODEL := LS1046A-RDB
DEVICE_VARIANT := SD Card Boot
DEVICE_PACKAGES += \
~layerscape-fman \
~trusted-firmware-a-ls1046a-rdb-sdboot \
kmod-ahci-qoriq \
kmod-hwmon-ina2xx \
kmod-hwmon-lm90
@ -287,9 +268,6 @@ define Device/fsl_ls1088a-rdb
DEVICE_MODEL := LS1088A-RDB
DEVICE_VARIANT := Default
DEVICE_PACKAGES += \
~layerscape-mc \
~layerscape-dpl \
~trusted-firmware-a-ls1088a-rdb \
restool \
kmod-ahci-qoriq \
kmod-hwmon-ina2xx \
@ -315,9 +293,6 @@ define Device/fsl_ls1088a-rdb-sdboot
DEVICE_MODEL := LS1088A-RDB
DEVICE_VARIANT := SD Card Boot
DEVICE_PACKAGES += \
~layerscape-mc \
~layerscape-dpl \
~trusted-firmware-a-ls1088a-rdb-sdboot \
restool \
kmod-ahci-qoriq \
kmod-hwmon-ina2xx \
@ -342,9 +317,6 @@ define Device/fsl_ls2088a-rdb
DEVICE_VENDOR := NXP
DEVICE_MODEL := LS2088ARDB
DEVICE_PACKAGES += \
~layerscape-mc \
~layerscape-dpl \
~trusted-firmware-a-ls2088a-rdb \
restool \
kmod-ahci-qoriq
IMAGE/firmware.bin := \
@ -365,12 +337,7 @@ define Device/fsl_lx2160a-rdb
DEVICE_VENDOR := NXP
DEVICE_MODEL := LX2160A-RDB
DEVICE_VARIANT := Rev2.0 silicon
DEVICE_PACKAGES += \
~layerscape-mc \
~layerscape-dpl \
~layerscape-ddr-phy \
~trusted-firmware-a-lx2160a-rdb \
restool
DEVICE_PACKAGES += restool
IMAGE/firmware.bin := \
ls-clean | \
ls-append $(1)-bl2.pbl | pad-to 1M | \
@ -391,12 +358,7 @@ define Device/fsl_lx2160a-rdb-sdboot
DEVICE_VENDOR := NXP
DEVICE_MODEL := LX2160A-RDB
DEVICE_VARIANT := Rev2.0 silicon SD Card Boot
DEVICE_PACKAGES += \
~layerscape-mc \
~layerscape-dpl \
~layerscape-ddr-phy \
~trusted-firmware-a-lx2160a-rdb-sdboot \
restool
DEVICE_PACKAGES += restool
DEVICE_DTS := fsl-lx2160a-rdb
IMAGE/sdcard.img.gz := \
ls-clean | \

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