From 369d2f3bf998644136a16aa526351ddc36742c32 Mon Sep 17 00:00:00 2001 From: James Sweeney Date: Thu, 2 Jan 2025 08:06:09 -0500 Subject: [PATCH 01/22] realtek: add 1920-24g-poe-180w to mac address Add 1920-24g-poe-180w to the mac address retrieval part of 02_network to properly set the device's port MAC addresses. This piece was missed when this device was added. Fixes: b948c1e39b9e ("realtek: add support for HPE 1920-24G PoE-180W (JG925A)") Link: https://github.com/openwrt/openwrt/pull/17460 Signed-off-by: James Sweeney (cherry picked from commit 0b54029a6e96bb2ce484f316be3870cc2617de30) --- target/linux/realtek/base-files/etc/board.d/02_network | 1 + 1 file changed, 1 insertion(+) diff --git a/target/linux/realtek/base-files/etc/board.d/02_network b/target/linux/realtek/base-files/etc/board.d/02_network index 12fb33d85e..1255ee8b9e 100644 --- a/target/linux/realtek/base-files/etc/board.d/02_network +++ b/target/linux/realtek/base-files/etc/board.d/02_network @@ -36,6 +36,7 @@ hpe,1920-8g-poe-65w|\ hpe,1920-8g-poe-180w|\ hpe,1920-16g|\ hpe,1920-24g|\ +hpe,1920-24g-poe-180w|\ hpe,1920-24g-poe-370w|\ hpe,1920-48g|\ hpe,1920-48g-poe) From 5330f620854731cb1c5d44043cfa444b4af78f87 Mon Sep 17 00:00:00 2001 From: Georgi Valkov Date: Thu, 12 Dec 2024 11:05:15 +0200 Subject: [PATCH 02/22] mac80211: refresh patch for ath12k refresh the following patch for ath12k 001-wifi-ath12k-add-11d-scan-offload-support-and-handle-country-code-for-WCN7850.patch Signed-off-by: Georgi Valkov Link: https://github.com/openwrt/openwrt/pull/17246 Signed-off-by: John Crispin (cherry picked from commit fb17914f65a430555b908929682d8b36d6e31b12) --- ...-and-handle-country-code-for-WCN7850.patch | 40 +++++++++---------- 1 file changed, 20 insertions(+), 20 deletions(-) diff --git a/package/kernel/mac80211/patches/ath12k/001-wifi-ath12k-add-11d-scan-offload-support-and-handle-country-code-for-WCN7850.patch b/package/kernel/mac80211/patches/ath12k/001-wifi-ath12k-add-11d-scan-offload-support-and-handle-country-code-for-WCN7850.patch index d370db1047..f368ccd272 100644 --- a/package/kernel/mac80211/patches/ath12k/001-wifi-ath12k-add-11d-scan-offload-support-and-handle-country-code-for-WCN7850.patch +++ b/package/kernel/mac80211/patches/ath12k/001-wifi-ath12k-add-11d-scan-offload-support-and-handle-country-code-for-WCN7850.patch @@ -121,7 +121,7 @@ Acked-by: Jeff Johnson }; static __le32 ath12k_wmi_tlv_hdr(u32 cmd, u32 len) -@@ -2363,7 +2365,10 @@ int ath12k_wmi_send_scan_start_cmd(struc +@@ -2364,7 +2366,10 @@ int ath12k_wmi_send_scan_start_cmd(struc cmd->scan_id = cpu_to_le32(arg->scan_id); cmd->scan_req_id = cpu_to_le32(arg->scan_req_id); cmd->vdev_id = cpu_to_le32(arg->vdev_id); @@ -133,7 +133,7 @@ Acked-by: Jeff Johnson cmd->notify_scan_events = cpu_to_le32(arg->notify_scan_events); ath12k_wmi_copy_scan_event_cntrl_flags(cmd, arg); -@@ -3083,6 +3088,110 @@ out: +@@ -3084,6 +3089,110 @@ out: return ret; } @@ -244,7 +244,7 @@ Acked-by: Jeff Johnson int ath12k_wmi_send_twt_enable_cmd(struct ath12k *ar, u32 pdev_id) { -@@ -5668,6 +5777,50 @@ static void ath12k_wmi_op_ep_tx_credits( +@@ -5669,6 +5778,50 @@ static void ath12k_wmi_op_ep_tx_credits( wake_up(&ab->wmi_ab.tx_credits_wq); } @@ -295,7 +295,7 @@ Acked-by: Jeff Johnson static void ath12k_wmi_htc_tx_complete(struct ath12k_base *ab, struct sk_buff *skb) { -@@ -7269,6 +7422,9 @@ static void ath12k_wmi_op_rx(struct ath1 +@@ -7270,6 +7423,9 @@ static void ath12k_wmi_op_rx(struct ath1 case WMI_GTK_OFFLOAD_STATUS_EVENTID: ath12k_wmi_gtk_offload_status_event(ab, skb); break; @@ -307,7 +307,7 @@ Acked-by: Jeff Johnson ath12k_dbg(ab, ATH12K_DBG_WMI, "Unknown eventid: 0x%x\n", id); --- a/drivers/net/wireless/ath/ath12k/wmi.h +++ b/drivers/net/wireless/ath/ath12k/wmi.h -@@ -3859,6 +3859,28 @@ struct wmi_init_country_cmd { +@@ -3860,6 +3860,28 @@ struct wmi_init_country_cmd { } cc_info; } __packed; @@ -336,7 +336,7 @@ Acked-by: Jeff Johnson struct wmi_delba_send_cmd { __le32 tlv_header; __le32 vdev_id; -@@ -3944,6 +3966,16 @@ struct ath12k_wmi_eht_rate_set_params { +@@ -3945,6 +3967,16 @@ struct ath12k_wmi_eht_rate_set_params { #define MAX_6G_REG_RULES 5 #define REG_US_5G_NUM_REG_RULES 4 @@ -353,7 +353,7 @@ Acked-by: Jeff Johnson enum wmi_start_event_param { WMI_VDEV_START_RESP_EVENT = 0, WMI_VDEV_RESTART_RESP_EVENT, -@@ -5546,11 +5578,17 @@ int ath12k_wmi_send_bcn_offload_control_ +@@ -5547,11 +5579,17 @@ int ath12k_wmi_send_bcn_offload_control_ u32 vdev_id, u32 bcn_ctrl_op); int ath12k_wmi_send_init_country_cmd(struct ath12k *ar, struct ath12k_wmi_init_country_arg *arg); @@ -485,7 +485,7 @@ Acked-by: Jeff Johnson u32 fw_crash_counter; --- a/drivers/net/wireless/ath/ath12k/mac.c +++ b/drivers/net/wireless/ath/ath12k/mac.c -@@ -2947,6 +2947,11 @@ static void ath12k_bss_assoc(struct ath1 +@@ -2946,6 +2946,11 @@ static void ath12k_bss_assoc(struct ath1 if (ret) ath12k_warn(ar->ab, "failed to set vdev %i OBSS PD parameters: %d\n", arvif->vdev_id, ret); @@ -497,7 +497,7 @@ Acked-by: Jeff Johnson } static void ath12k_bss_disassoc(struct ath12k *ar, -@@ -3522,7 +3527,7 @@ void __ath12k_mac_scan_finish(struct ath +@@ -3521,7 +3526,7 @@ void __ath12k_mac_scan_finish(struct ath ar->scan_channel = NULL; ar->scan.roc_freq = 0; cancel_delayed_work(&ar->scan.timeout); @@ -506,7 +506,7 @@ Acked-by: Jeff Johnson break; } } -@@ -3783,7 +3788,12 @@ scan: +@@ -3782,7 +3787,12 @@ scan: ret = ath12k_start_scan(ar, &arg); if (ret) { @@ -520,7 +520,7 @@ Acked-by: Jeff Johnson spin_lock_bh(&ar->data_lock); ar->scan.state = ATH12K_SCAN_IDLE; spin_unlock_bh(&ar->data_lock); -@@ -3802,6 +3812,11 @@ exit: +@@ -3801,6 +3811,11 @@ exit: mutex_unlock(&ar->conf_mutex); @@ -532,7 +532,7 @@ Acked-by: Jeff Johnson return ret; } -@@ -5986,7 +6001,7 @@ static int ath12k_mac_start(struct ath12 +@@ -5985,7 +6000,7 @@ static int ath12k_mac_start(struct ath12 /* TODO: Do we need to enable ANI? */ @@ -541,7 +541,7 @@ Acked-by: Jeff Johnson ar->num_started_vdevs = 0; ar->num_created_vdevs = 0; -@@ -6166,6 +6181,9 @@ static void ath12k_mac_stop(struct ath12 +@@ -6165,6 +6180,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 spin_lock_bh(&ar->data_lock); list_for_each_entry_safe(ppdu_stats, tmp, &ar->ppdu_stats_info, list) { -@@ -6412,6 +6430,117 @@ static void ath12k_mac_op_update_vif_off +@@ -6411,6 +6429,117 @@ static void ath12k_mac_op_update_vif_off ath12k_mac_update_vif_offload(arvif); } @@ -669,7 +669,7 @@ Acked-by: Jeff Johnson static int ath12k_mac_vdev_create(struct ath12k *ar, struct ieee80211_vif *vif) { struct ath12k_hw *ah = ar->ah; -@@ -6526,6 +6655,7 @@ static int ath12k_mac_vdev_create(struct +@@ -6525,6 +6654,7 @@ static int ath12k_mac_vdev_create(struct arvif->vdev_id, ret); goto err_peer_del; } @@ -677,7 +677,7 @@ Acked-by: Jeff Johnson break; case WMI_VDEV_TYPE_STA: param_id = WMI_STA_PS_PARAM_RX_WAKE_POLICY; -@@ -6564,6 +6694,13 @@ static int ath12k_mac_vdev_create(struct +@@ -6563,6 +6693,13 @@ static int ath12k_mac_vdev_create(struct arvif->vdev_id, ret); goto err_peer_del; } @@ -691,7 +691,7 @@ Acked-by: Jeff Johnson break; default: break; -@@ -6904,6 +7041,11 @@ static void ath12k_mac_op_remove_interfa +@@ -6903,6 +7040,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 if (arvif->vdev_type == WMI_VDEV_TYPE_AP) { ret = ath12k_peer_delete(ar, arvif->vdev_id, vif->addr); if (ret) -@@ -7744,6 +7886,14 @@ ath12k_mac_op_unassign_vif_chanctx(struc +@@ -7743,6 +7885,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 mutex_unlock(&ar->conf_mutex); } -@@ -8282,6 +8432,14 @@ ath12k_mac_op_reconfig_complete(struct i +@@ -8281,6 +8431,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 if (ab->is_reset) { recovery_count = atomic_inc_return(&ab->recovery_count); -@@ -9331,6 +9489,9 @@ static void ath12k_mac_setup(struct ath1 +@@ -9330,6 +9488,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); From 3bd2962c3d487227e3435b2cdadda5e917361a3c Mon Sep 17 00:00:00 2001 From: Felix Fietkau Date: Thu, 26 Dec 2024 09:41:22 +0100 Subject: [PATCH 03/22] mac80211: update to version 6.12.6 - drop patches accepted upstream - include build fixes in the tarball - based on https://github.com/nbd168/backports commit 410656ef04d2 Signed-off-by: Felix Fietkau (cherry picked from commit a85059438f2caed0d01a87fce9b8bd5bed134bb2) --- package/kernel/mac80211/Makefile | 4 +- ...add_platform_eeprom_support_to_ath5k.patch | 6 +- ...-and-handle-country-code-for-WCN7850.patch | 56 +-- .../patches/ath5k/432-ath5k_add_pciids.patch | 11 - ...erpret-requested-txpower-in-EIRP-dom.patch | 4 +- ...power-reduction-for-US-regulatory-do.patch | 2 +- ...-in-driver-tables-with-country-codes.patch | 4 +- .../build/070-remove-broken-wext-select.patch | 10 - .../build/120-headers_version_fix.patch | 14 - .../patches/build/140-trace_backport.patch | 18 +- .../210-wireless_netns_local_backport.patch | 44 ++ ...=> 220-brcmfmac_usb_driver_backport.patch} | 0 ...-init_vqs-build-error-on-kernel-6.6.patch} | 0 ...t_allns-build-error-on-kernel-6.6.59.patch | 169 ------- ...700-mwl8k-missing-pci-id-for-WNR854T.patch | 2 +- ...crease-the-global-limit-up-to-4-SSID.patch | 2 +- ...940-mwl8k_init_devices_synchronously.patch | 4 +- ...ringified-name-of-command-in-error-l.patch | 10 +- ...-rtw88-Set-efuse-ext_lna_5g-fix-typo.patch | 30 -- ...upport-USB-3-with-RTL8822CU-RTL8822B.patch | 284 ----------- ...fs-support-multiple-adapters-debuggi.patch | 454 ------------------ ...-wifi-rtw88-select-WANT_DEV_COREDUMP.patch | 25 - ...-Parse-channel-from-IE-to-correct-in.patch | 151 ------ ...nit-RX-burst-length-according-to-USB.patch | 73 --- ...pdate-the-RX-stats-after-every-frame.patch | 31 -- ...ifi-rtw88-usb-Support-RX-aggregation.patch | 118 ----- ...e-USB-RX-aggregation-for-8822c-8822b.patch | 168 ------- ...n-mac_id-for-vif-sta-and-update-to-T.patch | 231 --------- ...-the-RX-descriptor-with-a-single-fun.patch | 2 +- ...Fix-the-RX-aggregation-in-USB-3-mode.patch | 70 --- ...e-data-rate-fallback-for-older-chips.patch | 4 +- ...et-pkt_info.ls-for-the-reserved-page.patch | 2 +- ...w88-usb-Support-USB-3-with-RTL8812AU.patch | 6 +- ...nable-RX-aggregation-for-8821au-8812.patch | 4 +- .../patches/subsys/130-disable_auto_vif.patch | 2 +- .../patches/subsys/220-allow-ibss-mixed.patch | 2 +- ...race-period-for-DFS-available-after-.patch | 6 +- ...dd-AQL-support-for-broadcast-packets.patch | 2 +- ...-not-pass-a-stopped-vif-to-the-drive.patch | 24 - ...1-add-option-for-vif-allowed-radios.patch} | 12 +- ...troduce-EHT-rate-support-in-AQL-airt.patch | 233 --------- ...eck-radio-iface-combination-for-mult.patch | 122 ----- ...-vif-radio-mask-to-limit-ibss-scan-.patch} | 8 +- ...et-correct-chandef-when-starting-CAC.patch | 64 --- ...-vif-radio-mask-to-limit-chanctx-an.patch} | 8 +- ...0211-move-radar-detect-work-to-sdata.patch | 136 ------ ...1-remove-status-ampdu_delimiter_crc.patch} | 0 ...-net_device-to-.set_monitor_channel.patch} | 2 +- ...move-label-usage-in-ieee80211_start_.patch | 50 -- ...-flag-to-opt-out-of-virtual-monitor.patch} | 24 +- ...k-rdev_end_cac-trace-event-from-wiph.patch | 42 -- ...i-cfg80211-add-monitor-SKIP_TX-flag.patch} | 0 ...ve-DFS-related-members-to-links-in-w.patch | 309 ------------ ...37-wifi-cfg80211-handle-DFS-per-link.patch | 435 ----------------- ...-support-for-the-monitor-SKIP_TX-fl.patch} | 2 +- ...38-wifi-mac80211-handle-DFS-per-link.patch | 134 ------ ...80211-refactor-ieee80211_rx_monitor.patch} | 0 ...-mac80211-use-proper-link-ID-for-DFS.patch | 168 ------- ...ter-on-monitor-interfaces-based-on-.patch} | 0 ...report-per-wiphy-radio-antenna-mask.patch} | 0 ...ndle-ieee80211_radar_detected-for-ML.patch | 360 -------------- ...-vif-addr-when-switching-from-monit.patch} | 0 ...ip-non-uploaded-keys-in-ieee80211_it.patch | 79 --- ...x-incorrect-timing-to-initialize-sta.patch | 32 -- ...ee80211_i-Fix-memory-corruption-bug-.patch | 53 -- ...ix-user-power-when-emulating-chanctx.patch | 24 - ...80211-Add-wiphy_delayed_work_pending.patch | 83 ---- ...nvert-color-collision-detection-to-w.patch | 148 ------ 68 files changed, 143 insertions(+), 4434 deletions(-) delete mode 100644 package/kernel/mac80211/patches/ath5k/432-ath5k_add_pciids.patch delete mode 100644 package/kernel/mac80211/patches/build/070-remove-broken-wext-select.patch delete mode 100644 package/kernel/mac80211/patches/build/120-headers_version_fix.patch create mode 100644 package/kernel/mac80211/patches/build/210-wireless_netns_local_backport.patch rename package/kernel/mac80211/patches/build/{230-brcmfmac_usb_driver_backport.patch => 220-brcmfmac_usb_driver_backport.patch} (100%) rename package/kernel/mac80211/patches/build/{235-fix-init_vqs-build-error-on-kernel-6.6.patch => 230-fix-init_vqs-build-error-on-kernel-6.6.patch} (100%) delete mode 100644 package/kernel/mac80211/patches/build/236-fix-genlmsg_multicast_allns-build-error-on-kernel-6.6.59.patch delete mode 100644 package/kernel/mac80211/patches/rtl/001-v6.12-wifi-rtw88-Set-efuse-ext_lna_5g-fix-typo.patch delete mode 100644 package/kernel/mac80211/patches/rtl/002-v6.12-wifi-rtw88-usb-Support-USB-3-with-RTL8822CU-RTL8822B.patch delete mode 100644 package/kernel/mac80211/patches/rtl/004-v6.12-wifi-rtw88-debugfs-support-multiple-adapters-debuggi.patch delete mode 100644 package/kernel/mac80211/patches/rtl/005-v6.12-wifi-rtw88-select-WANT_DEV_COREDUMP.patch delete mode 100644 package/kernel/mac80211/patches/rtl/008-v6.12-wifi-rtw88-8822c-Parse-channel-from-IE-to-correct-in.patch delete mode 100644 package/kernel/mac80211/patches/rtl/010-v6.12-wifi-rtw88-usb-Init-RX-burst-length-according-to-USB.patch delete mode 100644 package/kernel/mac80211/patches/rtl/011-v6.12-wifi-rtw88-usb-Update-the-RX-stats-after-every-frame.patch delete mode 100644 package/kernel/mac80211/patches/rtl/012-v6.12-wifi-rtw88-usb-Support-RX-aggregation.patch delete mode 100644 package/kernel/mac80211/patches/rtl/013-v6.12-wifi-rtw88-Enable-USB-RX-aggregation-for-8822c-8822b.patch delete mode 100644 package/kernel/mac80211/patches/rtl/016-v6.12-wifi-rtw88-assign-mac_id-for-vif-sta-and-update-to-T.patch delete mode 100644 package/kernel/mac80211/patches/rtl/020-v6.12-wifi-rtw88-Fix-the-RX-aggregation-in-USB-3-mode.patch delete mode 100644 package/kernel/mac80211/patches/subsys/321-wifi-mac80211-do-not-pass-a-stopped-vif-to-the-drive.patch rename package/kernel/mac80211/patches/subsys/{350-wifi-cfg80211-add-option-for-vif-allowed-radios.patch => 330-wifi-cfg80211-add-option-for-vif-allowed-radios.patch} (96%) delete mode 100644 package/kernel/mac80211/patches/subsys/330-wifi-mac80211-introduce-EHT-rate-support-in-AQL-airt.patch delete mode 100644 package/kernel/mac80211/patches/subsys/331-wifi-cfg80211-check-radio-iface-combination-for-mult.patch rename package/kernel/mac80211/patches/subsys/{351-wifi-mac80211-use-vif-radio-mask-to-limit-ibss-scan-.patch => 331-wifi-mac80211-use-vif-radio-mask-to-limit-ibss-scan-.patch} (88%) delete mode 100644 package/kernel/mac80211/patches/subsys/332-wifi-cfg80211-Set-correct-chandef-when-starting-CAC.patch rename package/kernel/mac80211/patches/subsys/{352-wifi-mac80211-use-vif-radio-mask-to-limit-chanctx-an.patch => 332-wifi-mac80211-use-vif-radio-mask-to-limit-chanctx-an.patch} (86%) delete mode 100644 package/kernel/mac80211/patches/subsys/333-Revert-wifi-mac80211-move-radar-detect-work-to-sdata.patch rename package/kernel/mac80211/patches/subsys/{353-wifi-mac80211-remove-status-ampdu_delimiter_crc.patch => 333-wifi-mac80211-remove-status-ampdu_delimiter_crc.patch} (100%) rename package/kernel/mac80211/patches/subsys/{354-wifi-cfg80211-pass-net_device-to-.set_monitor_channel.patch => 334-wifi-cfg80211-pass-net_device-to-.set_monitor_channel.patch} (98%) delete mode 100644 package/kernel/mac80211/patches/subsys/334-wifi-mac80211-remove-label-usage-in-ieee80211_start_.patch rename package/kernel/mac80211/patches/subsys/{355-wifi-mac80211-add-flag-to-opt-out-of-virtual-monitor.patch => 335-wifi-mac80211-add-flag-to-opt-out-of-virtual-monitor.patch} (93%) delete mode 100644 package/kernel/mac80211/patches/subsys/335-wifi-trace-unlink-rdev_end_cac-trace-event-from-wiph.patch rename package/kernel/mac80211/patches/subsys/{356-wifi-cfg80211-add-monitor-SKIP_TX-flag.patch => 336-wifi-cfg80211-add-monitor-SKIP_TX-flag.patch} (100%) delete mode 100644 package/kernel/mac80211/patches/subsys/336-wifi-cfg80211-move-DFS-related-members-to-links-in-w.patch delete mode 100644 package/kernel/mac80211/patches/subsys/337-wifi-cfg80211-handle-DFS-per-link.patch rename package/kernel/mac80211/patches/subsys/{357-wifi-mac80211-add-support-for-the-monitor-SKIP_TX-fl.patch => 337-wifi-mac80211-add-support-for-the-monitor-SKIP_TX-fl.patch} (97%) delete mode 100644 package/kernel/mac80211/patches/subsys/338-wifi-mac80211-handle-DFS-per-link.patch rename package/kernel/mac80211/patches/subsys/{358-wifi-mac80211-refactor-ieee80211_rx_monitor.patch => 338-wifi-mac80211-refactor-ieee80211_rx_monitor.patch} (100%) delete mode 100644 package/kernel/mac80211/patches/subsys/339-wifi-cfg80211-mac80211-use-proper-link-ID-for-DFS.patch rename package/kernel/mac80211/patches/subsys/{359-wifi-mac80211-filter-on-monitor-interfaces-based-on-.patch => 339-wifi-mac80211-filter-on-monitor-interfaces-based-on-.patch} (100%) rename package/kernel/mac80211/patches/subsys/{360-wifi-cfg80211-report-per-wiphy-radio-antenna-mask.patch => 340-wifi-cfg80211-report-per-wiphy-radio-antenna-mask.patch} (100%) delete mode 100644 package/kernel/mac80211/patches/subsys/340-wifi-mac80211-handle-ieee80211_radar_detected-for-ML.patch rename package/kernel/mac80211/patches/subsys/{361-wifi-mac80211-fix-vif-addr-when-switching-from-monit.patch => 341-wifi-mac80211-fix-vif-addr-when-switching-from-monit.patch} (100%) delete mode 100644 package/kernel/mac80211/patches/subsys/341-wifi-mac80211-skip-non-uploaded-keys-in-ieee80211_it.patch delete mode 100644 package/kernel/mac80211/patches/subsys/362-wifi-mac80211-fix-incorrect-timing-to-initialize-sta.patch delete mode 100644 package/kernel/mac80211/patches/subsys/363-wifi-mac80211-ieee80211_i-Fix-memory-corruption-bug-.patch delete mode 100644 package/kernel/mac80211/patches/subsys/364-mac80211-fix-user-power-when-emulating-chanctx.patch delete mode 100644 package/kernel/mac80211/patches/subsys/365-wifi-cfg80211-Add-wiphy_delayed_work_pending.patch delete mode 100644 package/kernel/mac80211/patches/subsys/366-wifi-mac80211-Convert-color-collision-detection-to-w.patch diff --git a/package/kernel/mac80211/Makefile b/package/kernel/mac80211/Makefile index 22cd0e97b4..f924d34684 100644 --- a/package/kernel/mac80211/Makefile +++ b/package/kernel/mac80211/Makefile @@ -10,13 +10,13 @@ include $(INCLUDE_DIR)/kernel.mk PKG_NAME:=mac80211 -PKG_VERSION:=6.11.2 +PKG_VERSION:=6.12.6 PKG_RELEASE:=1 PKG_LICENSE:=GPL-2.0-only PKG_LICENSE_FILES:=COPYING PKG_SOURCE_URL:=http://mirror2.openwrt.org/sources/ -PKG_HASH:=700ea5abef8dde9e3c6df2acd32ff443da735d773d56db9a80269e2237549b34 +PKG_HASH:=28ec39425a1b3270e1422d92a8131a6a3d8919cc13e8ee250c315e55d922ba68 PKG_SOURCE:=backports-$(PKG_VERSION).tar.xz PKG_BUILD_DIR:=$(KERNEL_BUILD_DIR)/$(if $(BUILD_VARIANT),$(PKG_NAME)-$(BUILD_VARIANT)/)backports-$(PKG_VERSION) diff --git a/package/kernel/mac80211/patches/ath/431-add_platform_eeprom_support_to_ath5k.patch b/package/kernel/mac80211/patches/ath/431-add_platform_eeprom_support_to_ath5k.patch index c762aa6d64..abadadf856 100644 --- a/package/kernel/mac80211/patches/ath/431-add_platform_eeprom_support_to_ath5k.patch +++ b/package/kernel/mac80211/patches/ath/431-add_platform_eeprom_support_to_ath5k.patch @@ -8,7 +8,7 @@ #include "../ath.h" #include "ath5k.h" #include "debug.h" -@@ -71,7 +72,7 @@ static void ath5k_pci_read_cachesize(str +@@ -73,7 +74,7 @@ static void ath5k_pci_read_cachesize(str } /* @@ -17,7 +17,7 @@ */ static bool ath5k_pci_eeprom_read(struct ath_common *common, u32 offset, u16 *data) -@@ -79,6 +80,19 @@ ath5k_pci_eeprom_read(struct ath_common +@@ -81,6 +82,19 @@ ath5k_pci_eeprom_read(struct ath_common struct ath5k_hw *ah = common->ah; u32 status, timeout; @@ -37,7 +37,7 @@ /* * Initialize EEPROM access */ -@@ -122,6 +136,16 @@ static int ath5k_pci_eeprom_read_mac(str +@@ -124,6 +138,16 @@ static int ath5k_pci_eeprom_read_mac(str u16 data; int octet; diff --git a/package/kernel/mac80211/patches/ath12k/001-wifi-ath12k-add-11d-scan-offload-support-and-handle-country-code-for-WCN7850.patch b/package/kernel/mac80211/patches/ath12k/001-wifi-ath12k-add-11d-scan-offload-support-and-handle-country-code-for-WCN7850.patch index f368ccd272..caa4e20f97 100644 --- a/package/kernel/mac80211/patches/ath12k/001-wifi-ath12k-add-11d-scan-offload-support-and-handle-country-code-for-WCN7850.patch +++ b/package/kernel/mac80211/patches/ath12k/001-wifi-ath12k-add-11d-scan-offload-support-and-handle-country-code-for-WCN7850.patch @@ -451,7 +451,7 @@ Acked-by: Jeff Johnson enum ath12k_dev_flags { ATH12K_CAC_RUNNING, ATH12K_FLAG_CRASH_FLUSH, -@@ -313,6 +319,8 @@ struct ath12k_vif_iter { +@@ -319,6 +325,8 @@ struct ath12k_vif_iter { #define ATH12K_RX_RATE_TABLE_11AX_NUM 576 #define ATH12K_RX_RATE_TABLE_NUM 320 @@ -460,7 +460,7 @@ Acked-by: Jeff Johnson struct ath12k_rx_peer_rate_stats { u64 ht_mcs_count[HAL_RX_MAX_MCS_HT + 1]; u64 vht_mcs_count[HAL_RX_MAX_MCS_VHT + 1]; -@@ -648,6 +656,13 @@ struct ath12k { +@@ -654,6 +662,13 @@ struct ath12k { u32 freq_low; u32 freq_high; @@ -474,7 +474,7 @@ Acked-by: Jeff Johnson bool nlo_enabled; }; -@@ -880,6 +895,8 @@ struct ath12k_base { +@@ -886,6 +901,8 @@ struct ath12k_base { /* continuous recovery fail count */ atomic_t fail_cont_count; unsigned long reset_fail_timeout; @@ -485,7 +485,7 @@ Acked-by: Jeff Johnson u32 fw_crash_counter; --- a/drivers/net/wireless/ath/ath12k/mac.c +++ b/drivers/net/wireless/ath/ath12k/mac.c -@@ -2946,6 +2946,11 @@ static void ath12k_bss_assoc(struct ath1 +@@ -2949,6 +2949,11 @@ static void ath12k_bss_assoc(struct ath1 if (ret) ath12k_warn(ar->ab, "failed to set vdev %i OBSS PD parameters: %d\n", arvif->vdev_id, ret); @@ -497,7 +497,7 @@ Acked-by: Jeff Johnson } static void ath12k_bss_disassoc(struct ath12k *ar, -@@ -3521,7 +3526,7 @@ void __ath12k_mac_scan_finish(struct ath +@@ -3524,7 +3529,7 @@ void __ath12k_mac_scan_finish(struct ath ar->scan_channel = NULL; ar->scan.roc_freq = 0; cancel_delayed_work(&ar->scan.timeout); @@ -506,9 +506,9 @@ Acked-by: Jeff Johnson break; } } -@@ -3782,7 +3787,12 @@ scan: +@@ -3790,7 +3795,12 @@ scan: - ret = ath12k_start_scan(ar, &arg); + ret = ath12k_start_scan(ar, arg); if (ret) { - ath12k_warn(ar->ab, "failed to start hw scan: %d\n", ret); + if (ret == -EBUSY) @@ -520,7 +520,7 @@ Acked-by: Jeff Johnson spin_lock_bh(&ar->data_lock); ar->scan.state = ATH12K_SCAN_IDLE; spin_unlock_bh(&ar->data_lock); -@@ -3801,6 +3811,11 @@ exit: +@@ -3810,6 +3820,11 @@ exit: mutex_unlock(&ar->conf_mutex); @@ -532,7 +532,7 @@ Acked-by: Jeff Johnson return ret; } -@@ -5985,7 +6000,7 @@ static int ath12k_mac_start(struct ath12 +@@ -5994,7 +6009,7 @@ static int ath12k_mac_start(struct ath12 /* TODO: Do we need to enable ANI? */ @@ -541,7 +541,7 @@ Acked-by: Jeff Johnson ar->num_started_vdevs = 0; ar->num_created_vdevs = 0; -@@ -6165,6 +6180,9 @@ static void ath12k_mac_stop(struct ath12 +@@ -6174,6 +6189,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 spin_lock_bh(&ar->data_lock); list_for_each_entry_safe(ppdu_stats, tmp, &ar->ppdu_stats_info, list) { -@@ -6411,6 +6429,117 @@ static void ath12k_mac_op_update_vif_off +@@ -6420,6 +6438,117 @@ static void ath12k_mac_op_update_vif_off ath12k_mac_update_vif_offload(arvif); } @@ -669,7 +669,7 @@ Acked-by: Jeff Johnson static int ath12k_mac_vdev_create(struct ath12k *ar, struct ieee80211_vif *vif) { struct ath12k_hw *ah = ar->ah; -@@ -6525,6 +6654,7 @@ static int ath12k_mac_vdev_create(struct +@@ -6534,6 +6663,7 @@ static int ath12k_mac_vdev_create(struct arvif->vdev_id, ret); goto err_peer_del; } @@ -677,7 +677,7 @@ Acked-by: Jeff Johnson break; case WMI_VDEV_TYPE_STA: param_id = WMI_STA_PS_PARAM_RX_WAKE_POLICY; -@@ -6563,6 +6693,13 @@ static int ath12k_mac_vdev_create(struct +@@ -6572,6 +6702,13 @@ static int ath12k_mac_vdev_create(struct arvif->vdev_id, ret); goto err_peer_del; } @@ -691,7 +691,7 @@ Acked-by: Jeff Johnson break; default: break; -@@ -6903,6 +7040,11 @@ static void ath12k_mac_op_remove_interfa +@@ -6912,6 +7049,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 if (arvif->vdev_type == WMI_VDEV_TYPE_AP) { ret = ath12k_peer_delete(ar, arvif->vdev_id, vif->addr); if (ret) -@@ -7743,6 +7885,14 @@ ath12k_mac_op_unassign_vif_chanctx(struc +@@ -7752,6 +7894,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 mutex_unlock(&ar->conf_mutex); } -@@ -8281,6 +8431,14 @@ ath12k_mac_op_reconfig_complete(struct i +@@ -8290,6 +8440,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 if (ab->is_reset) { recovery_count = atomic_inc_return(&ab->recovery_count); -@@ -9330,6 +9488,9 @@ static void ath12k_mac_setup(struct ath1 +@@ -9339,6 +9497,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); @@ -888,36 +888,36 @@ Acked-by: Jeff Johnson #endif --- a/drivers/net/wireless/ath/ath12k/hw.c +++ b/drivers/net/wireless/ath/ath12k/hw.c -@@ -926,6 +926,7 @@ static const struct ath12k_hw_params ath - .supports_dynamic_smps_6ghz = true, - +@@ -928,6 +928,7 @@ static const struct ath12k_hw_params ath .iova_mask = 0, + + .supports_aspm = false, + .current_cc_support = false, }, { .name = "wcn7850 hw2.0", -@@ -1004,6 +1005,7 @@ static const struct ath12k_hw_params ath - .supports_dynamic_smps_6ghz = false, - +@@ -1008,6 +1009,7 @@ static const struct ath12k_hw_params ath .iova_mask = ATH12K_PCIE_MAX_PAYLOAD_SIZE - 1, + + .supports_aspm = true, + .current_cc_support = true, }, { .name = "qcn9274 hw2.0", -@@ -1078,6 +1080,7 @@ static const struct ath12k_hw_params ath - .supports_dynamic_smps_6ghz = true, - +@@ -1084,6 +1086,7 @@ static const struct ath12k_hw_params ath .iova_mask = 0, + + .supports_aspm = false, + .current_cc_support = false, }, }; --- a/drivers/net/wireless/ath/ath12k/hw.h +++ b/drivers/net/wireless/ath/ath12k/hw.h -@@ -189,6 +189,7 @@ struct ath12k_hw_params { - bool tcl_ring_retry:1; +@@ -190,6 +190,7 @@ struct ath12k_hw_params { bool reoq_lut_support:1; bool supports_shadow_regs:1; + bool supports_aspm:1; + bool current_cc_support:1; u32 num_tcl_banks; diff --git a/package/kernel/mac80211/patches/ath5k/432-ath5k_add_pciids.patch b/package/kernel/mac80211/patches/ath5k/432-ath5k_add_pciids.patch deleted file mode 100644 index bd0e6707a5..0000000000 --- a/package/kernel/mac80211/patches/ath5k/432-ath5k_add_pciids.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- a/drivers/net/wireless/ath/ath5k/pci.c -+++ b/drivers/net/wireless/ath/ath5k/pci.c -@@ -47,6 +47,8 @@ static const struct pci_device_id ath5k_ - { PCI_VDEVICE(ATHEROS, 0x001b) }, /* 5413 Eagle */ - { PCI_VDEVICE(ATHEROS, 0x001c) }, /* PCI-E cards */ - { PCI_VDEVICE(ATHEROS, 0x001d) }, /* 2417 Nala */ -+ { PCI_VDEVICE(ATHEROS, 0xff16) }, /* 2413,2414 sx76x on lantiq_danube */ -+ { PCI_VDEVICE(ATHEROS, 0xff1a) }, /* 2417 arv45xx on lantiq_danube */ - { PCI_VDEVICE(ATHEROS, 0xff1b) }, /* AR5BXB63 */ - { 0 } - }; diff --git a/package/kernel/mac80211/patches/ath9k/356-Revert-ath9k-interpret-requested-txpower-in-EIRP-dom.patch b/package/kernel/mac80211/patches/ath9k/356-Revert-ath9k-interpret-requested-txpower-in-EIRP-dom.patch index 385eea0116..9016da963b 100644 --- a/package/kernel/mac80211/patches/ath9k/356-Revert-ath9k-interpret-requested-txpower-in-EIRP-dom.patch +++ b/package/kernel/mac80211/patches/ath9k/356-Revert-ath9k-interpret-requested-txpower-in-EIRP-dom.patch @@ -8,7 +8,7 @@ This reverts commit 71f5137bf010c6faffab50c0ec15374c59c4a411. --- a/drivers/net/wireless/ath/ath9k/hw.c +++ b/drivers/net/wireless/ath/ath9k/hw.c -@@ -2977,7 +2977,8 @@ void ath9k_hw_apply_txpower(struct ath_h +@@ -2975,7 +2975,8 @@ void ath9k_hw_apply_txpower(struct ath_h { struct ath_regulatory *reg = ath9k_hw_regulatory(ah); struct ieee80211_channel *channel; @@ -18,7 +18,7 @@ This reverts commit 71f5137bf010c6faffab50c0ec15374c59c4a411. u16 ctl = NO_CTL; if (!chan) -@@ -2989,9 +2990,14 @@ void ath9k_hw_apply_txpower(struct ath_h +@@ -2987,9 +2988,14 @@ void ath9k_hw_apply_txpower(struct ath_h channel = chan->chan; chan_pwr = min_t(int, channel->max_power * 2, MAX_COMBINED_POWER); new_pwr = min_t(int, chan_pwr, reg->power_limit); diff --git a/package/kernel/mac80211/patches/ath9k/365-ath9k-adjust-tx-power-reduction-for-US-regulatory-do.patch b/package/kernel/mac80211/patches/ath9k/365-ath9k-adjust-tx-power-reduction-for-US-regulatory-do.patch index 0c3edc1260..5e5f3e4f10 100644 --- a/package/kernel/mac80211/patches/ath9k/365-ath9k-adjust-tx-power-reduction-for-US-regulatory-do.patch +++ b/package/kernel/mac80211/patches/ath9k/365-ath9k-adjust-tx-power-reduction-for-US-regulatory-do.patch @@ -11,7 +11,7 @@ Signed-off-by: Felix Fietkau --- a/drivers/net/wireless/ath/ath9k/hw.c +++ b/drivers/net/wireless/ath/ath9k/hw.c -@@ -2996,6 +2996,10 @@ void ath9k_hw_apply_txpower(struct ath_h +@@ -2994,6 +2994,10 @@ void ath9k_hw_apply_txpower(struct ath_h if (ant_gain > max_gain) ant_reduction = ant_gain - max_gain; diff --git a/package/kernel/mac80211/patches/brcm/863-brcmfmac-add-in-driver-tables-with-country-codes.patch b/package/kernel/mac80211/patches/brcm/863-brcmfmac-add-in-driver-tables-with-country-codes.patch index 25f0d254c0..1f0609e348 100644 --- a/package/kernel/mac80211/patches/brcm/863-brcmfmac-add-in-driver-tables-with-country-codes.patch +++ b/package/kernel/mac80211/patches/brcm/863-brcmfmac-add-in-driver-tables-with-country-codes.patch @@ -49,9 +49,9 @@ Signed-off-by: Rafał Miłecki void brcmf_of_probe(struct device *dev, enum brcmf_bus_type bus_type, struct brcmf_mp_device *settings) { -@@ -114,6 +144,8 @@ void brcmf_of_probe(struct device *dev, - of_node_put(root); +@@ -113,6 +143,8 @@ void brcmf_of_probe(struct device *dev, } + of_node_put(root); + brcmf_of_probe_cc(dev, settings); + diff --git a/package/kernel/mac80211/patches/build/070-remove-broken-wext-select.patch b/package/kernel/mac80211/patches/build/070-remove-broken-wext-select.patch deleted file mode 100644 index 121b7faad9..0000000000 --- a/package/kernel/mac80211/patches/build/070-remove-broken-wext-select.patch +++ /dev/null @@ -1,10 +0,0 @@ ---- a/drivers/staging/rtl8723bs/Kconfig -+++ b/drivers/staging/rtl8723bs/Kconfig -@@ -5,7 +5,6 @@ config RTL8723BS - depends on m - depends on WLAN && MMC && CFG80211 - depends on m -- select CFG80211_WEXT - depends on CRYPTO - select BPAUTO_CRYPTO_LIB_ARC4 - help diff --git a/package/kernel/mac80211/patches/build/120-headers_version_fix.patch b/package/kernel/mac80211/patches/build/120-headers_version_fix.patch deleted file mode 100644 index 29f500a4d0..0000000000 --- a/package/kernel/mac80211/patches/build/120-headers_version_fix.patch +++ /dev/null @@ -1,14 +0,0 @@ ---- a/backport-include/net/dropreason.h -+++ b/backport-include/net/dropreason.h -@@ -3,10 +3,9 @@ - - #include - -+#include - #if LINUX_VERSION_IS_GEQ(6,0,0) - #include_next --#else --#include - #endif - - #if LINUX_VERSION_IS_LESS(6,4,0) diff --git a/package/kernel/mac80211/patches/build/140-trace_backport.patch b/package/kernel/mac80211/patches/build/140-trace_backport.patch index 00ee47e1a4..8b77b7e83d 100644 --- a/package/kernel/mac80211/patches/build/140-trace_backport.patch +++ b/package/kernel/mac80211/patches/build/140-trace_backport.patch @@ -1,6 +1,6 @@ --- a/drivers/bus/mhi/host/trace.h +++ b/drivers/bus/mhi/host/trace.h -@@ -103,7 +103,7 @@ TRACE_EVENT(mhi_gen_tre, +@@ -104,7 +104,7 @@ TRACE_EVENT(mhi_gen_tre, ), TP_fast_assign( @@ -8,8 +8,8 @@ + __assign_str(name, mhi_cntrl->mhi_dev->name); __entry->ch_num = mhi_chan->chan; __entry->wp = mhi_tre; - __entry->tre_ptr = mhi_tre->ptr; -@@ -131,7 +131,7 @@ TRACE_EVENT(mhi_intvec_states, + __entry->tre_ptr = le64_to_cpu(mhi_tre->ptr); +@@ -132,7 +132,7 @@ TRACE_EVENT(mhi_intvec_states, ), TP_fast_assign( @@ -18,7 +18,7 @@ __entry->local_ee = mhi_cntrl->ee; __entry->state = mhi_cntrl->dev_state; __entry->dev_ee = dev_ee; -@@ -158,7 +158,7 @@ TRACE_EVENT(mhi_tryset_pm_state, +@@ -159,7 +159,7 @@ TRACE_EVENT(mhi_tryset_pm_state, ), TP_fast_assign( @@ -27,16 +27,16 @@ if (pm_state) pm_state = __fls(pm_state); __entry->pm_state = pm_state; -@@ -184,7 +184,7 @@ DECLARE_EVENT_CLASS(mhi_process_event_ri +@@ -185,7 +185,7 @@ DECLARE_EVENT_CLASS(mhi_process_event_ri ), TP_fast_assign( - __assign_str(name); + __assign_str(name, mhi_cntrl->mhi_dev->name); __entry->rp = rp; - __entry->ptr = rp->ptr; - __entry->dword0 = rp->dword[0]; -@@ -226,7 +226,7 @@ DECLARE_EVENT_CLASS(mhi_update_channel_s + __entry->ptr = le64_to_cpu(rp->ptr); + __entry->dword0 = le32_to_cpu(rp->dword[0]); +@@ -227,7 +227,7 @@ DECLARE_EVENT_CLASS(mhi_update_channel_s ), TP_fast_assign( @@ -45,7 +45,7 @@ __entry->ch_num = mhi_chan->chan; __entry->state = state; __entry->reason = reason; -@@ -265,7 +265,7 @@ TRACE_EVENT(mhi_pm_st_transition, +@@ -266,7 +266,7 @@ TRACE_EVENT(mhi_pm_st_transition, ), TP_fast_assign( diff --git a/package/kernel/mac80211/patches/build/210-wireless_netns_local_backport.patch b/package/kernel/mac80211/patches/build/210-wireless_netns_local_backport.patch new file mode 100644 index 0000000000..9b0e95e845 --- /dev/null +++ b/package/kernel/mac80211/patches/build/210-wireless_netns_local_backport.patch @@ -0,0 +1,44 @@ +--- a/net/wireless/core.c ++++ b/net/wireless/core.c +@@ -165,11 +165,15 @@ int cfg80211_switch_netns(struct cfg8021 + list_for_each_entry(wdev, &rdev->wiphy.wdev_list, list) { + if (!wdev->netdev) + continue; ++#if LINUX_VERSION_IS_GEQ(6,12,0) + wdev->netdev->netns_local = false; ++#endif + err = dev_change_net_namespace(wdev->netdev, net, "wlan%d"); + if (err) + break; ++#if LINUX_VERSION_IS_GEQ(6,12,0) + wdev->netdev->netns_local = true; ++#endif + } + + if (err) { +@@ -181,11 +185,15 @@ int cfg80211_switch_netns(struct cfg8021 + list) { + if (!wdev->netdev) + continue; ++#if LINUX_VERSION_IS_GEQ(6,12,0) + wdev->netdev->netns_local = false; ++#endif + err = dev_change_net_namespace(wdev->netdev, net, + "wlan%d"); + WARN_ON(err); ++#if LINUX_VERSION_IS_GEQ(6,12,0) + wdev->netdev->netns_local = true; ++#endif + } + + return err; +@@ -1518,7 +1526,9 @@ static int cfg80211_netdev_notifier_call + SET_NETDEV_DEVTYPE(dev, &wiphy_type); + wdev->netdev = dev; + /* can only change netns with wiphy */ ++#if LINUX_VERSION_IS_GEQ(6,12,0) + dev->netns_local = true; ++#endif + + cfg80211_init_wdev(wdev); + break; diff --git a/package/kernel/mac80211/patches/build/230-brcmfmac_usb_driver_backport.patch b/package/kernel/mac80211/patches/build/220-brcmfmac_usb_driver_backport.patch similarity index 100% rename from package/kernel/mac80211/patches/build/230-brcmfmac_usb_driver_backport.patch rename to package/kernel/mac80211/patches/build/220-brcmfmac_usb_driver_backport.patch diff --git a/package/kernel/mac80211/patches/build/235-fix-init_vqs-build-error-on-kernel-6.6.patch b/package/kernel/mac80211/patches/build/230-fix-init_vqs-build-error-on-kernel-6.6.patch similarity index 100% rename from package/kernel/mac80211/patches/build/235-fix-init_vqs-build-error-on-kernel-6.6.patch rename to package/kernel/mac80211/patches/build/230-fix-init_vqs-build-error-on-kernel-6.6.patch diff --git a/package/kernel/mac80211/patches/build/236-fix-genlmsg_multicast_allns-build-error-on-kernel-6.6.59.patch b/package/kernel/mac80211/patches/build/236-fix-genlmsg_multicast_allns-build-error-on-kernel-6.6.59.patch deleted file mode 100644 index 905bf8dfc1..0000000000 --- a/package/kernel/mac80211/patches/build/236-fix-genlmsg_multicast_allns-build-error-on-kernel-6.6.59.patch +++ /dev/null @@ -1,169 +0,0 @@ -From e0f83d268974dab0361d11904dfc9acec53f96a6 Mon Sep 17 00:00:00 2001 -From: Eric Dumazet -Date: Fri, 11 Oct 2024 17:12:17 +0000 -Subject: [PATCH] genetlink: hold RCU in genlmsg_mcast() - -[ Upstream commit 56440d7ec28d60f8da3bfa09062b3368ff9b16db ] - -While running net selftests with CONFIG_PROVE_RCU_LIST=y I saw -one lockdep splat [1]. - -genlmsg_mcast() uses for_each_net_rcu(), and must therefore hold RCU. - -Instead of letting all callers guard genlmsg_multicast_allns() -with a rcu_read_lock()/rcu_read_unlock() pair, do it in genlmsg_mcast(). - -This also means the @flags parameter is useless, we need to always use -GFP_ATOMIC. - -[1] -[10882.424136] ============================= -[10882.424166] WARNING: suspicious RCU usage -[10882.424309] 6.12.0-rc2-virtme #1156 Not tainted -[10882.424400] ----------------------------- -[10882.424423] net/netlink/genetlink.c:1940 RCU-list traversed in non-reader section!! -[10882.424469] -other info that might help us debug this: - -[10882.424500] -rcu_scheduler_active = 2, debug_locks = 1 -[10882.424744] 2 locks held by ip/15677: -[10882.424791] #0: ffffffffb6b491b0 (cb_lock){++++}-{3:3}, at: genl_rcv (net/netlink/genetlink.c:1219) -[10882.426334] #1: ffffffffb6b49248 (genl_mutex){+.+.}-{3:3}, at: genl_rcv_msg (net/netlink/genetlink.c:61 net/netlink/genetlink.c:57 net/netlink/genetlink.c:1209) -[10882.426465] -stack backtrace: -[10882.426805] CPU: 14 UID: 0 PID: 15677 Comm: ip Not tainted 6.12.0-rc2-virtme #1156 -[10882.426919] Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 1.16.3-debian-1.16.3-2 04/01/2014 -[10882.427046] Call Trace: -[10882.427131] -[10882.427244] dump_stack_lvl (lib/dump_stack.c:123) -[10882.427335] lockdep_rcu_suspicious (kernel/locking/lockdep.c:6822) -[10882.427387] genlmsg_multicast_allns (net/netlink/genetlink.c:1940 (discriminator 7) net/netlink/genetlink.c:1977 (discriminator 7)) -[10882.427436] l2tp_tunnel_notify.constprop.0 (net/l2tp/l2tp_netlink.c:119) l2tp_netlink -[10882.427683] l2tp_nl_cmd_tunnel_create (net/l2tp/l2tp_netlink.c:253) l2tp_netlink -[10882.427748] genl_family_rcv_msg_doit (net/netlink/genetlink.c:1115) -[10882.427834] genl_rcv_msg (net/netlink/genetlink.c:1195 net/netlink/genetlink.c:1210) -[10882.427877] ? __pfx_l2tp_nl_cmd_tunnel_create (net/l2tp/l2tp_netlink.c:186) l2tp_netlink -[10882.427927] ? __pfx_genl_rcv_msg (net/netlink/genetlink.c:1201) -[10882.427959] netlink_rcv_skb (net/netlink/af_netlink.c:2551) -[10882.428069] genl_rcv (net/netlink/genetlink.c:1220) -[10882.428095] netlink_unicast (net/netlink/af_netlink.c:1332 net/netlink/af_netlink.c:1357) -[10882.428140] netlink_sendmsg (net/netlink/af_netlink.c:1901) -[10882.428210] ____sys_sendmsg (net/socket.c:729 (discriminator 1) net/socket.c:744 (discriminator 1) net/socket.c:2607 (discriminator 1)) - -Fixes: 33f72e6f0c67 ("l2tp : multicast notification to the registered listeners") -Signed-off-by: Eric Dumazet -Cc: James Chapman -Cc: Tom Parkin -Cc: Johannes Berg -Link: https://patch.msgid.link/20241011171217.3166614-1-edumazet@google.com -Signed-off-by: Jakub Kicinski -Signed-off-by: Sasha Levin ---- - drivers/target/target_core_user.c | 2 +- - include/net/genetlink.h | 3 +-- - net/l2tp/l2tp_netlink.c | 4 ++-- - net/netlink/genetlink.c | 28 ++++++++++++++-------------- - net/wireless/nl80211.c | 8 ++------ - 5 files changed, 20 insertions(+), 25 deletions(-) - ---- a/backport-include/net/genetlink.h -+++ b/backport-include/net/genetlink.h -@@ -150,7 +150,7 @@ int genlmsg_multicast(const struct genl_ - #define genlmsg_multicast_allns LINUX_BACKPORT(genlmsg_multicast_allns) - int backport_genlmsg_multicast_allns(const struct genl_family *family, - struct sk_buff *skb, u32 portid, -- unsigned int group, gfp_t flags); -+ unsigned int group); - - #define genl_family_attrbuf LINUX_BACKPORT(genl_family_attrbuf) - static inline struct nlattr **genl_family_attrbuf(struct genl_family *family) ---- a/compat/backport-genetlink.c -+++ b/compat/backport-genetlink.c -@@ -198,23 +198,23 @@ int genlmsg_multicast(const struct genl_ - } - EXPORT_SYMBOL_GPL(genlmsg_multicast); - --static int genlmsg_mcast(struct sk_buff *skb, u32 portid, unsigned long group, -- gfp_t flags) -+static int genlmsg_mcast(struct sk_buff *skb, u32 portid, unsigned long group) - { - struct sk_buff *tmp; - struct net *net, *prev = NULL; - bool delivered = false; - int err; - -+ rcu_read_lock(); - for_each_net_rcu(net) { - if (prev) { -- tmp = skb_clone(skb, flags); -+ tmp = skb_clone(skb, GFP_ATOMIC); - if (!tmp) { - err = -ENOMEM; - goto error; - } - err = nlmsg_multicast(prev->genl_sock, tmp, -- portid, group, flags); -+ portid, group, GFP_ATOMIC); - if (!err) - delivered = true; - else if (err != -ESRCH) -@@ -223,25 +223,29 @@ static int genlmsg_mcast(struct sk_buff - - prev = net; - } -+ err = nlmsg_multicast(prev->genl_sock, skb, portid, group, GFP_ATOMIC); -+ -+ rcu_read_unlock(); - -- err = nlmsg_multicast(prev->genl_sock, skb, portid, group, flags); - if (!err) - delivered = true; - else if (err != -ESRCH) - return err; - return delivered ? 0 : -ESRCH; - error: -+ rcu_read_unlock(); -+ - kfree_skb(skb); - return err; - } - - int backport_genlmsg_multicast_allns(const struct genl_family *family, - struct sk_buff *skb, u32 portid, -- unsigned int group, gfp_t flags) -+ unsigned int group) - { - group = __backport_genl_group(family, group); - if (group == INVALID_GROUP) - return -EINVAL; -- return genlmsg_mcast(skb, portid, group, flags); -+ return genlmsg_mcast(skb, portid, group); - } - EXPORT_SYMBOL_GPL(backport_genlmsg_multicast_allns); ---- a/net/wireless/nl80211.c -+++ b/net/wireless/nl80211.c -@@ -17956,10 +17956,8 @@ void nl80211_common_reg_change_event(enu - - genlmsg_end(msg, hdr); - -- rcu_read_lock(); - genlmsg_multicast_allns(&nl80211_fam, msg, 0, -- NL80211_MCGRP_REGULATORY, GFP_ATOMIC); -- rcu_read_unlock(); -+ NL80211_MCGRP_REGULATORY); - - return; - -@@ -18692,10 +18690,8 @@ void nl80211_send_beacon_hint_event(stru - - genlmsg_end(msg, hdr); - -- rcu_read_lock(); - genlmsg_multicast_allns(&nl80211_fam, msg, 0, -- NL80211_MCGRP_REGULATORY, GFP_ATOMIC); -- rcu_read_unlock(); -+ NL80211_MCGRP_REGULATORY); - - return; - diff --git a/package/kernel/mac80211/patches/mwl/700-mwl8k-missing-pci-id-for-WNR854T.patch b/package/kernel/mac80211/patches/mwl/700-mwl8k-missing-pci-id-for-WNR854T.patch index c3324f4289..cfb7dcf738 100644 --- a/package/kernel/mac80211/patches/mwl/700-mwl8k-missing-pci-id-for-WNR854T.patch +++ b/package/kernel/mac80211/patches/mwl/700-mwl8k-missing-pci-id-for-WNR854T.patch @@ -1,6 +1,6 @@ --- a/drivers/net/wireless/marvell/mwl8k.c +++ b/drivers/net/wireless/marvell/mwl8k.c -@@ -5709,6 +5709,7 @@ MODULE_FIRMWARE("mwl8k/fmimage_8366.fw") +@@ -5712,6 +5712,7 @@ MODULE_FIRMWARE("mwl8k/fmimage_8366.fw") MODULE_FIRMWARE(MWL8K_8366_AP_FW(MWL8K_8366_AP_FW_API)); static const struct pci_device_id mwl8k_pci_id_table[] = { diff --git a/package/kernel/mac80211/patches/mwl/900-mwifiex-increase-the-global-limit-up-to-4-SSID.patch b/package/kernel/mac80211/patches/mwl/900-mwifiex-increase-the-global-limit-up-to-4-SSID.patch index caa139a2c6..484b37bfcc 100644 --- a/package/kernel/mac80211/patches/mwl/900-mwifiex-increase-the-global-limit-up-to-4-SSID.patch +++ b/package/kernel/mac80211/patches/mwl/900-mwifiex-increase-the-global-limit-up-to-4-SSID.patch @@ -30,7 +30,7 @@ the card-specific structure. #define MWIFIEX_DMA_ALIGN_SZ 64 #define MWIFIEX_RX_HEADROOM 64 -@@ -100,7 +100,7 @@ +@@ -123,7 +123,7 @@ #define MWIFIEX_RATE_INDEX_OFDM0 4 #define MWIFIEX_MAX_STA_NUM 3 diff --git a/package/kernel/mac80211/patches/mwl/940-mwl8k_init_devices_synchronously.patch b/package/kernel/mac80211/patches/mwl/940-mwl8k_init_devices_synchronously.patch index 062b0600d0..d09cfac448 100644 --- a/package/kernel/mac80211/patches/mwl/940-mwl8k_init_devices_synchronously.patch +++ b/package/kernel/mac80211/patches/mwl/940-mwl8k_init_devices_synchronously.patch @@ -1,6 +1,6 @@ --- a/drivers/net/wireless/marvell/mwl8k.c +++ b/drivers/net/wireless/marvell/mwl8k.c -@@ -6295,6 +6295,8 @@ static int mwl8k_probe(struct pci_dev *p +@@ -6298,6 +6298,8 @@ static int mwl8k_probe(struct pci_dev *p priv->running_bsses = 0; @@ -9,7 +9,7 @@ return rc; err_stop_firmware: -@@ -6328,8 +6330,6 @@ static void mwl8k_remove(struct pci_dev +@@ -6331,8 +6333,6 @@ static void mwl8k_remove(struct pci_dev return; priv = hw->priv; diff --git a/package/kernel/mac80211/patches/mwl/950-mwifiex-Print-stringified-name-of-command-in-error-l.patch b/package/kernel/mac80211/patches/mwl/950-mwifiex-Print-stringified-name-of-command-in-error-l.patch index a7ecabde82..93a213265c 100644 --- a/package/kernel/mac80211/patches/mwl/950-mwifiex-Print-stringified-name-of-command-in-error-l.patch +++ b/package/kernel/mac80211/patches/mwl/950-mwifiex-Print-stringified-name-of-command-in-error-l.patch @@ -116,7 +116,7 @@ Signed-off-by: Pali Rohár mwifiex_recycle_cmd_node(adapter, cmd_node); queue_work(adapter->workqueue, &adapter->main_work); return -1; -@@ -653,8 +732,8 @@ int mwifiex_send_cmd(struct mwifiex_priv +@@ -655,8 +734,8 @@ int mwifiex_send_cmd(struct mwifiex_priv /* Return error, since the command preparation failed */ if (ret) { mwifiex_dbg(adapter, ERROR, @@ -127,7 +127,7 @@ Signed-off-by: Pali Rohár mwifiex_insert_cmd_to_free_q(adapter, cmd_node); return -1; } -@@ -902,8 +981,9 @@ int mwifiex_process_cmdresp(struct mwifi +@@ -904,8 +983,9 @@ int mwifiex_process_cmdresp(struct mwifi if (adapter->hw_status == MWIFIEX_HW_STATUS_INITIALIZING) { if (ret) { mwifiex_dbg(adapter, ERROR, @@ -139,7 +139,7 @@ Signed-off-by: Pali Rohár mwifiex_init_fw_complete(adapter); return -1; } else if (adapter->last_init_cmd == cmdresp_no) -@@ -1265,8 +1345,8 @@ mwifiex_process_sleep_confirm_resp(struc +@@ -1287,8 +1367,8 @@ mwifiex_process_sleep_confirm_resp(struc if (command != HostCmd_CMD_802_11_PS_MODE_ENH) { mwifiex_dbg(adapter, ERROR, @@ -152,7 +152,7 @@ Signed-off-by: Pali Rohár --- a/drivers/net/wireless/marvell/mwifiex/main.h +++ b/drivers/net/wireless/marvell/mwifiex/main.h -@@ -1084,6 +1084,8 @@ void mwifiex_cancel_all_pending_cmd(stru +@@ -1100,6 +1100,8 @@ void mwifiex_cancel_all_pending_cmd(stru void mwifiex_cancel_pending_scan_cmd(struct mwifiex_adapter *adapter); void mwifiex_cancel_scan(struct mwifiex_adapter *adapter); @@ -177,7 +177,7 @@ Signed-off-by: Pali Rohár adapter->cmd_wait_q.status = -1; --- a/drivers/net/wireless/marvell/mwifiex/uap_cmd.c +++ b/drivers/net/wireless/marvell/mwifiex/uap_cmd.c -@@ -802,7 +802,8 @@ int mwifiex_uap_prepare_cmd(struct mwifi +@@ -964,7 +964,8 @@ int mwifiex_uap_prepare_cmd(struct mwifi break; default: mwifiex_dbg(priv->adapter, ERROR, diff --git a/package/kernel/mac80211/patches/rtl/001-v6.12-wifi-rtw88-Set-efuse-ext_lna_5g-fix-typo.patch b/package/kernel/mac80211/patches/rtl/001-v6.12-wifi-rtw88-Set-efuse-ext_lna_5g-fix-typo.patch deleted file mode 100644 index 96a6743c5b..0000000000 --- a/package/kernel/mac80211/patches/rtl/001-v6.12-wifi-rtw88-Set-efuse-ext_lna_5g-fix-typo.patch +++ /dev/null @@ -1,30 +0,0 @@ -From 8fbcaa308591b91e9037ab6a8d733873b749a70d Mon Sep 17 00:00:00 2001 -From: Bitterblue Smith -Date: Sat, 6 Jul 2024 01:40:58 +0300 -Subject: [PATCH] wifi: rtw88: Set efuse->ext_lna_5g - fix typo - -efuse->ext_lna_2g is set twice and efuse->ext_lna_5g is not set at all. -Set each one once. - -Nothing uses these members right now. They will be used by the RTL8821AU -and RTL8812AU drivers. - -Signed-off-by: Bitterblue Smith -Acked-by: Ping-Ke Shih -Signed-off-by: Ping-Ke Shih -Link: https://patch.msgid.link/8ccc9e13-0d45-417d-8f88-93a0ad294f77@gmail.com ---- - drivers/net/wireless/realtek/rtw88/main.c | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - ---- a/drivers/net/wireless/realtek/rtw88/main.c -+++ b/drivers/net/wireless/realtek/rtw88/main.c -@@ -2006,7 +2006,7 @@ static int rtw_chip_efuse_info_setup(str - efuse->ext_pa_2g = efuse->pa_type_2g & BIT(4) ? 1 : 0; - efuse->ext_lna_2g = efuse->lna_type_2g & BIT(3) ? 1 : 0; - efuse->ext_pa_5g = efuse->pa_type_5g & BIT(0) ? 1 : 0; -- efuse->ext_lna_2g = efuse->lna_type_5g & BIT(3) ? 1 : 0; -+ efuse->ext_lna_5g = efuse->lna_type_5g & BIT(3) ? 1 : 0; - - if (!is_valid_ether_addr(efuse->addr)) { - eth_random_addr(efuse->addr); diff --git a/package/kernel/mac80211/patches/rtl/002-v6.12-wifi-rtw88-usb-Support-USB-3-with-RTL8822CU-RTL8822B.patch b/package/kernel/mac80211/patches/rtl/002-v6.12-wifi-rtw88-usb-Support-USB-3-with-RTL8822CU-RTL8822B.patch deleted file mode 100644 index 2faa59d760..0000000000 --- a/package/kernel/mac80211/patches/rtl/002-v6.12-wifi-rtw88-usb-Support-USB-3-with-RTL8822CU-RTL8822B.patch +++ /dev/null @@ -1,284 +0,0 @@ -From 315c23a64e99552502dd4d18d6ddc073fad9a7c3 Mon Sep 17 00:00:00 2001 -From: Bitterblue Smith -Date: Thu, 11 Jul 2024 01:11:33 +0300 -Subject: [PATCH] wifi: rtw88: usb: Support USB 3 with RTL8822CU/RTL8822BU - -The Realtek wifi 5 devices which support USB 3 are weird: when first -plugged in, they pretend to be USB 2. The driver needs to send some -commands to the device, which make it disappear and come back as a -USB 3 device. - -Implement the required commands in rtw88. - -When a USB 3 device is plugged into a USB 2 port, rtw88 will try to -switch it to USB 3 mode only once. The device will disappear and come -back still in USB 2 mode, of course. - -Some people experience heavy interference in the 2.4 GHz band in -USB 3 mode, so add a module parameter switch_usb_mode with the -default value 1 to let people disable the switching. - -Signed-off-by: Bitterblue Smith -Acked-by: Ping-Ke Shih -Signed-off-by: Ping-Ke Shih -Link: https://patch.msgid.link/77906c62-5674-426f-bde1-1b2a12a0339d@gmail.com ---- - drivers/net/wireless/realtek/rtw88/debug.h | 1 + - drivers/net/wireless/realtek/rtw88/main.h | 2 + - drivers/net/wireless/realtek/rtw88/reg.h | 11 +++ - drivers/net/wireless/realtek/rtw88/rtw8822b.c | 1 + - drivers/net/wireless/realtek/rtw88/rtw8822b.h | 4 +- - drivers/net/wireless/realtek/rtw88/rtw8822c.c | 1 + - drivers/net/wireless/realtek/rtw88/rtw8822c.h | 24 +++--- - drivers/net/wireless/realtek/rtw88/usb.c | 84 +++++++++++++++++++ - 8 files changed, 116 insertions(+), 12 deletions(-) - ---- a/drivers/net/wireless/realtek/rtw88/debug.h -+++ b/drivers/net/wireless/realtek/rtw88/debug.h -@@ -25,6 +25,7 @@ enum rtw_debug_mask { - RTW_DBG_HW_SCAN = 0x00010000, - RTW_DBG_STATE = 0x00020000, - RTW_DBG_SDIO = 0x00040000, -+ RTW_DBG_USB = 0x00080000, - - RTW_DBG_UNEXP = 0x80000000, - RTW_DBG_ALL = 0xffffffff ---- a/drivers/net/wireless/realtek/rtw88/main.h -+++ b/drivers/net/wireless/realtek/rtw88/main.h -@@ -1785,6 +1785,8 @@ struct rtw_efuse { - bool share_ant; - u8 bt_setting; - -+ u8 usb_mode_switch; -+ - struct { - u8 hci; - u8 bw; ---- a/drivers/net/wireless/realtek/rtw88/reg.h -+++ b/drivers/net/wireless/realtek/rtw88/reg.h -@@ -15,6 +15,7 @@ - #define BIT_WLOCK_1C_B6 BIT(5) - #define REG_SYS_PW_CTRL 0x0004 - #define BIT_PFM_WOWL BIT(3) -+#define BIT_APFM_OFFMAC BIT(9) - #define REG_SYS_CLK_CTRL 0x0008 - #define BIT_CPU_CLK_EN BIT(14) - -@@ -133,6 +134,14 @@ - #define REG_PMC_DBG_CTRL1 0xa8 - #define BITS_PMC_BT_IQK_STS GENMASK(22, 21) - -+#define REG_PAD_CTRL2 0x00C4 -+#define BIT_RSM_EN_V1 BIT(16) -+#define BIT_NO_PDN_CHIPOFF_V1 BIT(17) -+#define BIT_MASK_USB23_SW_MODE_V1 GENMASK(19, 18) -+#define BIT_USB3_USB2_TRANSITION BIT(20) -+#define BIT_USB_MODE_U2 1 -+#define BIT_USB_MODE_U3 2 -+ - #define REG_EFUSE_ACCESS 0x00CF - #define EFUSE_ACCESS_ON 0x69 - #define EFUSE_ACCESS_OFF 0x00 -@@ -568,6 +577,8 @@ - #define BIT_WL_SECURITY_CLK BIT(15) - #define BIT_DDMA_EN BIT(8) - -+#define REG_SW_MDIO 0x10C0 -+ - #define REG_H2C_PKT_READADDR 0x10D0 - #define REG_H2C_PKT_WRITEADDR 0x10D4 - #define REG_FW_DBG6 0x10F8 ---- a/drivers/net/wireless/realtek/rtw88/rtw8822b.c -+++ b/drivers/net/wireless/realtek/rtw88/rtw8822b.c -@@ -46,6 +46,7 @@ static int rtw8822b_read_efuse(struct rt - - map = (struct rtw8822b_efuse *)log_map; - -+ efuse->usb_mode_switch = u8_get_bits(map->usb_mode, BIT(7)); - efuse->rfe_option = map->rfe_option; - efuse->rf_board_option = map->rf_board_option; - efuse->crystal_cap = map->xtal_k; ---- a/drivers/net/wireless/realtek/rtw88/rtw8822b.h -+++ b/drivers/net/wireless/realtek/rtw88/rtw8822b.h -@@ -72,7 +72,9 @@ struct rtw8822bs_efuse { - - struct rtw8822b_efuse { - __le16 rtl_id; -- u8 res0[0x0e]; -+ u8 res0[4]; -+ u8 usb_mode; -+ u8 res1[0x09]; - - /* power index for four RF paths */ - struct rtw_txpwr_idx txpwr_idx_table[4]; ---- a/drivers/net/wireless/realtek/rtw88/rtw8822c.c -+++ b/drivers/net/wireless/realtek/rtw88/rtw8822c.c -@@ -49,6 +49,7 @@ static int rtw8822c_read_efuse(struct rt - - map = (struct rtw8822c_efuse *)log_map; - -+ efuse->usb_mode_switch = u8_get_bits(map->usb_mode, BIT(7)); - efuse->rfe_option = map->rfe_option; - efuse->rf_board_option = map->rf_board_option; - efuse->crystal_cap = map->xtal_k & XCAP_MASK; ---- a/drivers/net/wireless/realtek/rtw88/rtw8822c.h -+++ b/drivers/net/wireless/realtek/rtw88/rtw8822c.h -@@ -59,16 +59,18 @@ struct rtw8822ce_efuse { - - struct rtw8822c_efuse { - __le16 rtl_id; -- u8 res0[0x0e]; -+ u8 res0[4]; -+ u8 usb_mode; -+ u8 res1[0x09]; - - /* power index for four RF paths */ - struct rtw_txpwr_idx txpwr_idx_table[4]; - - u8 channel_plan; /* 0xb8 */ - u8 xtal_k; -- u8 res1; -+ u8 res2; - u8 iqk_lck; -- u8 res2[5]; /* 0xbc */ -+ u8 res3[5]; /* 0xbc */ - u8 rf_board_option; - u8 rf_feature_option; - u8 rf_bt_setting; -@@ -80,21 +82,21 @@ struct rtw8822c_efuse { - u8 rf_antenna_option; /* 0xc9 */ - u8 rfe_option; - u8 country_code[2]; -- u8 res3[3]; -+ u8 res4[3]; - u8 path_a_thermal; /* 0xd0 */ - u8 path_b_thermal; -- u8 res4[2]; -+ u8 res5[2]; - u8 rx_gain_gap_2g_ofdm; -- u8 res5; -- u8 rx_gain_gap_2g_cck; - u8 res6; -- u8 rx_gain_gap_5gl; -+ u8 rx_gain_gap_2g_cck; - u8 res7; -- u8 rx_gain_gap_5gm; -+ u8 rx_gain_gap_5gl; - u8 res8; -- u8 rx_gain_gap_5gh; -+ u8 rx_gain_gap_5gm; - u8 res9; -- u8 res10[0x42]; -+ u8 rx_gain_gap_5gh; -+ u8 res10; -+ u8 res11[0x42]; - union { - struct rtw8822ce_efuse e; - struct rtw8822cu_efuse u; ---- a/drivers/net/wireless/realtek/rtw88/usb.c -+++ b/drivers/net/wireless/realtek/rtw88/usb.c -@@ -14,6 +14,11 @@ - #include "ps.h" - #include "usb.h" - -+static bool rtw_switch_usb_mode = true; -+module_param_named(switch_usb_mode, rtw_switch_usb_mode, bool, 0644); -+MODULE_PARM_DESC(switch_usb_mode, -+ "Set to N to disable switching to USB 3 mode to avoid potential interference in the 2.4 GHz band (default: Y)"); -+ - #define RTW_USB_MAX_RXQ_LEN 512 - - struct rtw_usb_txcb { -@@ -841,6 +846,77 @@ static void rtw_usb_intf_deinit(struct r - usb_set_intfdata(intf, NULL); - } - -+static int rtw_usb_switch_mode_new(struct rtw_dev *rtwdev) -+{ -+ enum usb_device_speed cur_speed; -+ u8 id = rtwdev->chip->id; -+ bool can_switch; -+ u32 pad_ctrl2; -+ -+ if (rtw_read8(rtwdev, REG_SYS_CFG2 + 3) == 0x20) -+ cur_speed = USB_SPEED_SUPER; -+ else -+ cur_speed = USB_SPEED_HIGH; -+ -+ if (cur_speed == USB_SPEED_SUPER) -+ return 0; -+ -+ pad_ctrl2 = rtw_read32(rtwdev, REG_PAD_CTRL2); -+ -+ can_switch = !!(pad_ctrl2 & (BIT_MASK_USB23_SW_MODE_V1 | -+ BIT_USB3_USB2_TRANSITION)); -+ -+ if (!can_switch) { -+ rtw_dbg(rtwdev, RTW_DBG_USB, -+ "Switching to USB 3 mode unsupported by the chip\n"); -+ return 0; -+ } -+ -+ /* At this point cur_speed is USB_SPEED_HIGH. If we already tried -+ * to switch don't try again - it's a USB 2 port. -+ */ -+ if (u32_get_bits(pad_ctrl2, BIT_MASK_USB23_SW_MODE_V1) == BIT_USB_MODE_U3) -+ return 0; -+ -+ /* Enable IO wrapper timeout */ -+ if (id == RTW_CHIP_TYPE_8822B || id == RTW_CHIP_TYPE_8821C) -+ rtw_write8_clr(rtwdev, REG_SW_MDIO + 3, BIT(0)); -+ -+ u32p_replace_bits(&pad_ctrl2, BIT_USB_MODE_U3, BIT_MASK_USB23_SW_MODE_V1); -+ pad_ctrl2 |= BIT_RSM_EN_V1; -+ -+ rtw_write32(rtwdev, REG_PAD_CTRL2, pad_ctrl2); -+ rtw_write8(rtwdev, REG_PAD_CTRL2 + 1, 4); -+ -+ rtw_write16_set(rtwdev, REG_SYS_PW_CTRL, BIT_APFM_OFFMAC); -+ usleep_range(1000, 1001); -+ rtw_write32_set(rtwdev, REG_PAD_CTRL2, BIT_NO_PDN_CHIPOFF_V1); -+ -+ return 1; -+} -+ -+static int rtw_usb_switch_mode(struct rtw_dev *rtwdev) -+{ -+ u8 id = rtwdev->chip->id; -+ -+ if (id != RTW_CHIP_TYPE_8822C && id != RTW_CHIP_TYPE_8822B) -+ return 0; -+ -+ if (!rtwdev->efuse.usb_mode_switch) { -+ rtw_dbg(rtwdev, RTW_DBG_USB, -+ "Switching to USB 3 mode disabled by chip's efuse\n"); -+ return 0; -+ } -+ -+ if (!rtw_switch_usb_mode) { -+ rtw_dbg(rtwdev, RTW_DBG_USB, -+ "Switching to USB 3 mode disabled by module parameter\n"); -+ return 0; -+ } -+ -+ return rtw_usb_switch_mode_new(rtwdev); -+} -+ - int rtw_usb_probe(struct usb_interface *intf, const struct usb_device_id *id) - { - struct rtw_dev *rtwdev; -@@ -896,6 +972,14 @@ int rtw_usb_probe(struct usb_interface * - goto err_destroy_rxwq; - } - -+ ret = rtw_usb_switch_mode(rtwdev); -+ if (ret) { -+ /* Not a fail, but we do need to skip rtw_register_hw. */ -+ rtw_dbg(rtwdev, RTW_DBG_USB, "switching to USB 3 mode\n"); -+ ret = 0; -+ goto err_destroy_rxwq; -+ } -+ - ret = rtw_register_hw(rtwdev, rtwdev->hw); - if (ret) { - rtw_err(rtwdev, "failed to register hw\n"); diff --git a/package/kernel/mac80211/patches/rtl/004-v6.12-wifi-rtw88-debugfs-support-multiple-adapters-debuggi.patch b/package/kernel/mac80211/patches/rtl/004-v6.12-wifi-rtw88-debugfs-support-multiple-adapters-debuggi.patch deleted file mode 100644 index d965fbce92..0000000000 --- a/package/kernel/mac80211/patches/rtl/004-v6.12-wifi-rtw88-debugfs-support-multiple-adapters-debuggi.patch +++ /dev/null @@ -1,454 +0,0 @@ -From 8db6c1ca64664ef9b071e6eeb646023ac5b240a8 Mon Sep 17 00:00:00 2001 -From: Ping-Ke Shih -Date: Thu, 18 Jul 2024 14:41:55 +0800 -Subject: [PATCH] wifi: rtw88: debugfs: support multiple adapters debugging - -Originally in order to read partial registers from large area, we write -a range value stored into a static variable and read registers according -to the static variable. - -However, if we install more than one adapters supported by this driver, -the static variables will be overwritten by latter adapters. To resolve -the problem, move the static variables to struct rtw_dev for each adapter. - -With changes, smatch spends too much time to parse rtw_debugfs_init(): - debug.c:1289 rtw_debugfs_init() parse error: turning off implications - after 60 seconds -Move stuffs of adding debugfs entries to three rtw_debugfs_add_xxx() -functions. - -Reported-by: Bitterblue Smith -Closes: https://lore.kernel.org/linux-wireless/cd6a2acf3c2c36d938b40140b52a779516f446a9.camel@realtek.com/T/#m27662022c70d9f893ba96f6c6a8dd8fce2434dfe -Tested-by: Bitterblue Smith -Signed-off-by: Ping-Ke Shih -Link: https://patch.msgid.link/20240718064155.38955-1-pkshih@realtek.com ---- - drivers/net/wireless/realtek/rtw88/debug.c | 303 ++++++++++++--------- - drivers/net/wireless/realtek/rtw88/debug.h | 2 + - drivers/net/wireless/realtek/rtw88/main.c | 1 + - drivers/net/wireless/realtek/rtw88/main.h | 3 +- - 4 files changed, 180 insertions(+), 129 deletions(-) - ---- a/drivers/net/wireless/realtek/rtw88/debug.c -+++ b/drivers/net/wireless/realtek/rtw88/debug.c -@@ -43,6 +43,62 @@ struct rtw_debugfs_priv { - }; - }; - -+struct rtw_debugfs { -+ struct rtw_debugfs_priv mac_0; -+ struct rtw_debugfs_priv mac_1; -+ struct rtw_debugfs_priv mac_2; -+ struct rtw_debugfs_priv mac_3; -+ struct rtw_debugfs_priv mac_4; -+ struct rtw_debugfs_priv mac_5; -+ struct rtw_debugfs_priv mac_6; -+ struct rtw_debugfs_priv mac_7; -+ struct rtw_debugfs_priv mac_10; -+ struct rtw_debugfs_priv mac_11; -+ struct rtw_debugfs_priv mac_12; -+ struct rtw_debugfs_priv mac_13; -+ struct rtw_debugfs_priv mac_14; -+ struct rtw_debugfs_priv mac_15; -+ struct rtw_debugfs_priv mac_16; -+ struct rtw_debugfs_priv mac_17; -+ struct rtw_debugfs_priv bb_8; -+ struct rtw_debugfs_priv bb_9; -+ struct rtw_debugfs_priv bb_a; -+ struct rtw_debugfs_priv bb_b; -+ struct rtw_debugfs_priv bb_c; -+ struct rtw_debugfs_priv bb_d; -+ struct rtw_debugfs_priv bb_e; -+ struct rtw_debugfs_priv bb_f; -+ struct rtw_debugfs_priv bb_18; -+ struct rtw_debugfs_priv bb_19; -+ struct rtw_debugfs_priv bb_1a; -+ struct rtw_debugfs_priv bb_1b; -+ struct rtw_debugfs_priv bb_1c; -+ struct rtw_debugfs_priv bb_1d; -+ struct rtw_debugfs_priv bb_1e; -+ struct rtw_debugfs_priv bb_1f; -+ struct rtw_debugfs_priv bb_2c; -+ struct rtw_debugfs_priv bb_2d; -+ struct rtw_debugfs_priv bb_40; -+ struct rtw_debugfs_priv bb_41; -+ struct rtw_debugfs_priv rf_dump; -+ struct rtw_debugfs_priv tx_pwr_tbl; -+ struct rtw_debugfs_priv write_reg; -+ struct rtw_debugfs_priv h2c; -+ struct rtw_debugfs_priv rf_write; -+ struct rtw_debugfs_priv rf_read; -+ struct rtw_debugfs_priv read_reg; -+ struct rtw_debugfs_priv fix_rate; -+ struct rtw_debugfs_priv dump_cam; -+ struct rtw_debugfs_priv rsvd_page; -+ struct rtw_debugfs_priv phy_info; -+ struct rtw_debugfs_priv coex_enable; -+ struct rtw_debugfs_priv coex_info; -+ struct rtw_debugfs_priv edcca_enable; -+ struct rtw_debugfs_priv fw_crash; -+ struct rtw_debugfs_priv force_lowest_basic_rate; -+ struct rtw_debugfs_priv dm_cap; -+}; -+ - static const char * const rtw_dm_cap_strs[] = { - [RTW_DM_CAP_NA] = "NA", - [RTW_DM_CAP_TXGAPK] = "TXGAPK", -@@ -524,7 +580,7 @@ static int rtw_debug_get_bb_page(struct - return 0; - } - --static int rtw_debug_get_rf_dump(struct seq_file *m, void *v) -+static int rtw_debugfs_get_rf_dump(struct seq_file *m, void *v) - { - struct rtw_debugfs_priv *debugfs_priv = m->private; - struct rtw_dev *rtwdev = debugfs_priv->rtwdev; -@@ -1074,139 +1130,102 @@ static int rtw_debugfs_get_dm_cap(struct - return 0; - } - --#define rtw_debug_impl_mac(page, addr) \ --static struct rtw_debugfs_priv rtw_debug_priv_mac_ ##page = { \ -+#define rtw_debug_priv_mac(addr) \ -+{ \ - .cb_read = rtw_debug_get_mac_page, \ - .cb_data = addr, \ - } - --rtw_debug_impl_mac(0, 0x0000); --rtw_debug_impl_mac(1, 0x0100); --rtw_debug_impl_mac(2, 0x0200); --rtw_debug_impl_mac(3, 0x0300); --rtw_debug_impl_mac(4, 0x0400); --rtw_debug_impl_mac(5, 0x0500); --rtw_debug_impl_mac(6, 0x0600); --rtw_debug_impl_mac(7, 0x0700); --rtw_debug_impl_mac(10, 0x1000); --rtw_debug_impl_mac(11, 0x1100); --rtw_debug_impl_mac(12, 0x1200); --rtw_debug_impl_mac(13, 0x1300); --rtw_debug_impl_mac(14, 0x1400); --rtw_debug_impl_mac(15, 0x1500); --rtw_debug_impl_mac(16, 0x1600); --rtw_debug_impl_mac(17, 0x1700); -- --#define rtw_debug_impl_bb(page, addr) \ --static struct rtw_debugfs_priv rtw_debug_priv_bb_ ##page = { \ -+#define rtw_debug_priv_bb(addr) \ -+{ \ - .cb_read = rtw_debug_get_bb_page, \ - .cb_data = addr, \ - } - --rtw_debug_impl_bb(8, 0x0800); --rtw_debug_impl_bb(9, 0x0900); --rtw_debug_impl_bb(a, 0x0a00); --rtw_debug_impl_bb(b, 0x0b00); --rtw_debug_impl_bb(c, 0x0c00); --rtw_debug_impl_bb(d, 0x0d00); --rtw_debug_impl_bb(e, 0x0e00); --rtw_debug_impl_bb(f, 0x0f00); --rtw_debug_impl_bb(18, 0x1800); --rtw_debug_impl_bb(19, 0x1900); --rtw_debug_impl_bb(1a, 0x1a00); --rtw_debug_impl_bb(1b, 0x1b00); --rtw_debug_impl_bb(1c, 0x1c00); --rtw_debug_impl_bb(1d, 0x1d00); --rtw_debug_impl_bb(1e, 0x1e00); --rtw_debug_impl_bb(1f, 0x1f00); --rtw_debug_impl_bb(2c, 0x2c00); --rtw_debug_impl_bb(2d, 0x2d00); --rtw_debug_impl_bb(40, 0x4000); --rtw_debug_impl_bb(41, 0x4100); -- --static struct rtw_debugfs_priv rtw_debug_priv_rf_dump = { -- .cb_read = rtw_debug_get_rf_dump, --}; -- --static struct rtw_debugfs_priv rtw_debug_priv_tx_pwr_tbl = { -- .cb_read = rtw_debugfs_get_tx_pwr_tbl, --}; -- --static struct rtw_debugfs_priv rtw_debug_priv_write_reg = { -- .cb_write = rtw_debugfs_set_write_reg, --}; -- --static struct rtw_debugfs_priv rtw_debug_priv_h2c = { -- .cb_write = rtw_debugfs_set_h2c, --}; -- --static struct rtw_debugfs_priv rtw_debug_priv_rf_write = { -- .cb_write = rtw_debugfs_set_rf_write, --}; -- --static struct rtw_debugfs_priv rtw_debug_priv_rf_read = { -- .cb_write = rtw_debugfs_set_rf_read, -- .cb_read = rtw_debugfs_get_rf_read, --}; -- --static struct rtw_debugfs_priv rtw_debug_priv_read_reg = { -- .cb_write = rtw_debugfs_set_read_reg, -- .cb_read = rtw_debugfs_get_read_reg, --}; -- --static struct rtw_debugfs_priv rtw_debug_priv_fix_rate = { -- .cb_write = rtw_debugfs_set_fix_rate, -- .cb_read = rtw_debugfs_get_fix_rate, --}; -- --static struct rtw_debugfs_priv rtw_debug_priv_dump_cam = { -- .cb_write = rtw_debugfs_set_single_input, -- .cb_read = rtw_debugfs_get_dump_cam, --}; -- --static struct rtw_debugfs_priv rtw_debug_priv_rsvd_page = { -- .cb_write = rtw_debugfs_set_rsvd_page, -- .cb_read = rtw_debugfs_get_rsvd_page, --}; -- --static struct rtw_debugfs_priv rtw_debug_priv_phy_info = { -- .cb_read = rtw_debugfs_get_phy_info, --}; -- --static struct rtw_debugfs_priv rtw_debug_priv_coex_enable = { -- .cb_write = rtw_debugfs_set_coex_enable, -- .cb_read = rtw_debugfs_get_coex_enable, --}; -- --static struct rtw_debugfs_priv rtw_debug_priv_coex_info = { -- .cb_read = rtw_debugfs_get_coex_info, --}; -- --static struct rtw_debugfs_priv rtw_debug_priv_edcca_enable = { -- .cb_write = rtw_debugfs_set_edcca_enable, -- .cb_read = rtw_debugfs_get_edcca_enable, --}; -- --static struct rtw_debugfs_priv rtw_debug_priv_fw_crash = { -- .cb_write = rtw_debugfs_set_fw_crash, -- .cb_read = rtw_debugfs_get_fw_crash, --}; -- --static struct rtw_debugfs_priv rtw_debug_priv_force_lowest_basic_rate = { -- .cb_write = rtw_debugfs_set_force_lowest_basic_rate, -- .cb_read = rtw_debugfs_get_force_lowest_basic_rate, --}; -- --static struct rtw_debugfs_priv rtw_debug_priv_dm_cap = { -- .cb_write = rtw_debugfs_set_dm_cap, -- .cb_read = rtw_debugfs_get_dm_cap, -+#define rtw_debug_priv_get(name) \ -+{ \ -+ .cb_read = rtw_debugfs_get_ ##name, \ -+} -+ -+#define rtw_debug_priv_set(name) \ -+{ \ -+ .cb_write = rtw_debugfs_set_ ##name, \ -+} -+ -+#define rtw_debug_priv_set_and_get(name) \ -+{ \ -+ .cb_write = rtw_debugfs_set_ ##name, \ -+ .cb_read = rtw_debugfs_get_ ##name, \ -+} -+ -+#define rtw_debug_priv_set_single_and_get(name) \ -+{ \ -+ .cb_write = rtw_debugfs_set_single_input, \ -+ .cb_read = rtw_debugfs_get_ ##name, \ -+} -+ -+static const struct rtw_debugfs rtw_debugfs_templ = { -+ .mac_0 = rtw_debug_priv_mac(0x0000), -+ .mac_1 = rtw_debug_priv_mac(0x0100), -+ .mac_2 = rtw_debug_priv_mac(0x0200), -+ .mac_3 = rtw_debug_priv_mac(0x0300), -+ .mac_4 = rtw_debug_priv_mac(0x0400), -+ .mac_5 = rtw_debug_priv_mac(0x0500), -+ .mac_6 = rtw_debug_priv_mac(0x0600), -+ .mac_7 = rtw_debug_priv_mac(0x0700), -+ .mac_10 = rtw_debug_priv_mac(0x1000), -+ .mac_11 = rtw_debug_priv_mac(0x1100), -+ .mac_12 = rtw_debug_priv_mac(0x1200), -+ .mac_13 = rtw_debug_priv_mac(0x1300), -+ .mac_14 = rtw_debug_priv_mac(0x1400), -+ .mac_15 = rtw_debug_priv_mac(0x1500), -+ .mac_16 = rtw_debug_priv_mac(0x1600), -+ .mac_17 = rtw_debug_priv_mac(0x1700), -+ .bb_8 = rtw_debug_priv_bb(0x0800), -+ .bb_9 = rtw_debug_priv_bb(0x0900), -+ .bb_a = rtw_debug_priv_bb(0x0a00), -+ .bb_b = rtw_debug_priv_bb(0x0b00), -+ .bb_c = rtw_debug_priv_bb(0x0c00), -+ .bb_d = rtw_debug_priv_bb(0x0d00), -+ .bb_e = rtw_debug_priv_bb(0x0e00), -+ .bb_f = rtw_debug_priv_bb(0x0f00), -+ .bb_18 = rtw_debug_priv_bb(0x1800), -+ .bb_19 = rtw_debug_priv_bb(0x1900), -+ .bb_1a = rtw_debug_priv_bb(0x1a00), -+ .bb_1b = rtw_debug_priv_bb(0x1b00), -+ .bb_1c = rtw_debug_priv_bb(0x1c00), -+ .bb_1d = rtw_debug_priv_bb(0x1d00), -+ .bb_1e = rtw_debug_priv_bb(0x1e00), -+ .bb_1f = rtw_debug_priv_bb(0x1f00), -+ .bb_2c = rtw_debug_priv_bb(0x2c00), -+ .bb_2d = rtw_debug_priv_bb(0x2d00), -+ .bb_40 = rtw_debug_priv_bb(0x4000), -+ .bb_41 = rtw_debug_priv_bb(0x4100), -+ .rf_dump = rtw_debug_priv_get(rf_dump), -+ .tx_pwr_tbl = rtw_debug_priv_get(tx_pwr_tbl), -+ .write_reg = rtw_debug_priv_set(write_reg), -+ .h2c = rtw_debug_priv_set(h2c), -+ .rf_write = rtw_debug_priv_set(rf_write), -+ .rf_read = rtw_debug_priv_set_and_get(rf_read), -+ .read_reg = rtw_debug_priv_set_and_get(read_reg), -+ .fix_rate = rtw_debug_priv_set_and_get(fix_rate), -+ .dump_cam = rtw_debug_priv_set_single_and_get(dump_cam), -+ .rsvd_page = rtw_debug_priv_set_and_get(rsvd_page), -+ .phy_info = rtw_debug_priv_get(phy_info), -+ .coex_enable = rtw_debug_priv_set_and_get(coex_enable), -+ .coex_info = rtw_debug_priv_get(coex_info), -+ .edcca_enable = rtw_debug_priv_set_and_get(edcca_enable), -+ .fw_crash = rtw_debug_priv_set_and_get(fw_crash), -+ .force_lowest_basic_rate = rtw_debug_priv_set_and_get(force_lowest_basic_rate), -+ .dm_cap = rtw_debug_priv_set_and_get(dm_cap), - }; - - #define rtw_debugfs_add_core(name, mode, fopname, parent) \ - do { \ -- rtw_debug_priv_ ##name.rtwdev = rtwdev; \ -+ struct rtw_debugfs_priv *priv = &rtwdev->debugfs->name; \ -+ priv->rtwdev = rtwdev; \ - if (IS_ERR(debugfs_create_file(#name, mode, \ -- parent, &rtw_debug_priv_ ##name,\ -+ parent, priv, \ - &file_ops_ ##fopname))) \ - pr_debug("Unable to initialize debugfs:%s\n", \ - #name); \ -@@ -1219,12 +1238,9 @@ static struct rtw_debugfs_priv rtw_debug - #define rtw_debugfs_add_r(name) \ - rtw_debugfs_add_core(name, S_IFREG | 0444, single_r, debugfs_topdir) - --void rtw_debugfs_init(struct rtw_dev *rtwdev) -+static -+void rtw_debugfs_add_basic(struct rtw_dev *rtwdev, struct dentry *debugfs_topdir) - { -- struct dentry *debugfs_topdir; -- -- debugfs_topdir = debugfs_create_dir("rtw88", -- rtwdev->hw->wiphy->debugfsdir); - rtw_debugfs_add_w(write_reg); - rtw_debugfs_add_rw(read_reg); - rtw_debugfs_add_w(rf_write); -@@ -1236,6 +1252,17 @@ void rtw_debugfs_init(struct rtw_dev *rt - rtw_debugfs_add_r(coex_info); - rtw_debugfs_add_rw(coex_enable); - rtw_debugfs_add_w(h2c); -+ rtw_debugfs_add_r(rf_dump); -+ rtw_debugfs_add_r(tx_pwr_tbl); -+ rtw_debugfs_add_rw(edcca_enable); -+ rtw_debugfs_add_rw(fw_crash); -+ rtw_debugfs_add_rw(force_lowest_basic_rate); -+ rtw_debugfs_add_rw(dm_cap); -+} -+ -+static -+void rtw_debugfs_add_sec0(struct rtw_dev *rtwdev, struct dentry *debugfs_topdir) -+{ - rtw_debugfs_add_r(mac_0); - rtw_debugfs_add_r(mac_1); - rtw_debugfs_add_r(mac_2); -@@ -1252,6 +1279,11 @@ void rtw_debugfs_init(struct rtw_dev *rt - rtw_debugfs_add_r(bb_d); - rtw_debugfs_add_r(bb_e); - rtw_debugfs_add_r(bb_f); -+} -+ -+static -+void rtw_debugfs_add_sec1(struct rtw_dev *rtwdev, struct dentry *debugfs_topdir) -+{ - rtw_debugfs_add_r(mac_10); - rtw_debugfs_add_r(mac_11); - rtw_debugfs_add_r(mac_12); -@@ -1274,14 +1306,29 @@ void rtw_debugfs_init(struct rtw_dev *rt - rtw_debugfs_add_r(bb_40); - rtw_debugfs_add_r(bb_41); - } -- rtw_debugfs_add_r(rf_dump); -- rtw_debugfs_add_r(tx_pwr_tbl); -- rtw_debugfs_add_rw(edcca_enable); -- rtw_debugfs_add_rw(fw_crash); -- rtw_debugfs_add_rw(force_lowest_basic_rate); -- rtw_debugfs_add_rw(dm_cap); - } - -+void rtw_debugfs_init(struct rtw_dev *rtwdev) -+{ -+ struct dentry *debugfs_topdir; -+ -+ rtwdev->debugfs = kmemdup(&rtw_debugfs_templ, sizeof(rtw_debugfs_templ), -+ GFP_KERNEL); -+ if (!rtwdev->debugfs) -+ return; -+ -+ debugfs_topdir = debugfs_create_dir("rtw88", -+ rtwdev->hw->wiphy->debugfsdir); -+ -+ rtw_debugfs_add_basic(rtwdev, debugfs_topdir); -+ rtw_debugfs_add_sec0(rtwdev, debugfs_topdir); -+ rtw_debugfs_add_sec1(rtwdev, debugfs_topdir); -+} -+ -+void rtw_debugfs_deinit(struct rtw_dev *rtwdev) -+{ -+ kfree(rtwdev->debugfs); -+} - #endif /* CPTCFG_RTW88_DEBUGFS */ - - #ifdef CPTCFG_RTW88_DEBUG ---- a/drivers/net/wireless/realtek/rtw88/debug.h -+++ b/drivers/net/wireless/realtek/rtw88/debug.h -@@ -34,11 +34,13 @@ enum rtw_debug_mask { - #ifdef CPTCFG_RTW88_DEBUGFS - - void rtw_debugfs_init(struct rtw_dev *rtwdev); -+void rtw_debugfs_deinit(struct rtw_dev *rtwdev); - void rtw_debugfs_get_simple_phy_info(struct seq_file *m); - - #else - - static inline void rtw_debugfs_init(struct rtw_dev *rtwdev) {} -+static inline void rtw_debugfs_deinit(struct rtw_dev *rtwdev) {} - - #endif /* CPTCFG_RTW88_DEBUGFS */ - ---- a/drivers/net/wireless/realtek/rtw88/main.c -+++ b/drivers/net/wireless/realtek/rtw88/main.c -@@ -2300,6 +2300,7 @@ void rtw_unregister_hw(struct rtw_dev *r - - ieee80211_unregister_hw(hw); - rtw_unset_supported_band(hw, chip); -+ rtw_debugfs_deinit(rtwdev); - } - EXPORT_SYMBOL(rtw_unregister_hw); - ---- a/drivers/net/wireless/realtek/rtw88/main.h -+++ b/drivers/net/wireless/realtek/rtw88/main.h -@@ -50,6 +50,7 @@ extern const struct ieee80211_ops rtw_op - #define RTW_MAX_CHANNEL_NUM_5G 49 - - struct rtw_dev; -+struct rtw_debugfs; - - enum rtw_hci_type { - RTW_HCI_TYPE_PCIE, -@@ -2053,7 +2054,7 @@ struct rtw_dev { - bool beacon_loss; - struct completion lps_leave_check; - -- struct dentry *debugfs; -+ struct rtw_debugfs *debugfs; - - u8 sta_cnt; - u32 rts_threshold; diff --git a/package/kernel/mac80211/patches/rtl/005-v6.12-wifi-rtw88-select-WANT_DEV_COREDUMP.patch b/package/kernel/mac80211/patches/rtl/005-v6.12-wifi-rtw88-select-WANT_DEV_COREDUMP.patch deleted file mode 100644 index 6c31b5e848..0000000000 --- a/package/kernel/mac80211/patches/rtl/005-v6.12-wifi-rtw88-select-WANT_DEV_COREDUMP.patch +++ /dev/null @@ -1,25 +0,0 @@ -From 7e989b0c1e33210c07340bf5228aa83ea52515b5 Mon Sep 17 00:00:00 2001 -From: Zong-Zhe Yang -Date: Thu, 18 Jul 2024 15:06:15 +0800 -Subject: [PATCH] wifi: rtw88: select WANT_DEV_COREDUMP - -We have invoked device coredump when fw crash. -Should select WANT_DEV_COREDUMP by ourselves. - -Signed-off-by: Zong-Zhe Yang -Signed-off-by: Ping-Ke Shih -Link: https://patch.msgid.link/20240718070616.42217-1-pkshih@realtek.com ---- - drivers/net/wireless/realtek/rtw88/Kconfig | 1 + - 1 file changed, 1 insertion(+) - ---- a/drivers/net/wireless/realtek/rtw88/Kconfig -+++ b/drivers/net/wireless/realtek/rtw88/Kconfig -@@ -14,6 +14,7 @@ if RTW88 - config RTW88_CORE - tristate - depends on m -+ select BPAUTO_WANT_DEV_COREDUMP - - config RTW88_PCI - tristate diff --git a/package/kernel/mac80211/patches/rtl/008-v6.12-wifi-rtw88-8822c-Parse-channel-from-IE-to-correct-in.patch b/package/kernel/mac80211/patches/rtl/008-v6.12-wifi-rtw88-8822c-Parse-channel-from-IE-to-correct-in.patch deleted file mode 100644 index a304cd7d05..0000000000 --- a/package/kernel/mac80211/patches/rtl/008-v6.12-wifi-rtw88-8822c-Parse-channel-from-IE-to-correct-in.patch +++ /dev/null @@ -1,151 +0,0 @@ -From 53ed4b25a79aeec5991c2dc579e635b136ef7676 Mon Sep 17 00:00:00 2001 -From: Po-Hao Huang -Date: Wed, 24 Jul 2024 13:05:01 +0800 -Subject: [PATCH] wifi: rtw88: 8822c: Parse channel from IE to correct invalid - hardware reports - -For CCK packets we could get incorrect reports from hardware. -And this causes wrong frequencies being reported. Parse the channel -information from IE if provided by AP to fix this. - -Signed-off-by: Po-Hao Huang -Signed-off-by: Ping-Ke Shih -Link: https://patch.msgid.link/20240724050501.7550-1-pkshih@realtek.com ---- - drivers/net/wireless/realtek/rtw88/main.h | 1 + - drivers/net/wireless/realtek/rtw88/pci.c | 1 + - drivers/net/wireless/realtek/rtw88/rtw8822c.c | 7 ++-- - drivers/net/wireless/realtek/rtw88/rx.c | 41 +++++++++++++++++++ - drivers/net/wireless/realtek/rtw88/rx.h | 13 ++++++ - drivers/net/wireless/realtek/rtw88/sdio.c | 1 + - drivers/net/wireless/realtek/rtw88/usb.c | 2 + - 7 files changed, 63 insertions(+), 3 deletions(-) - ---- a/drivers/net/wireless/realtek/rtw88/main.h -+++ b/drivers/net/wireless/realtek/rtw88/main.h -@@ -623,6 +623,7 @@ struct rtw_rx_pkt_stat { - bool crc_err; - bool decrypted; - bool is_c2h; -+ bool channel_invalid; - - s32 signal_power; - u16 pkt_len; ---- a/drivers/net/wireless/realtek/rtw88/pci.c -+++ b/drivers/net/wireless/realtek/rtw88/pci.c -@@ -1088,6 +1088,7 @@ static u32 rtw_pci_rx_napi(struct rtw_de - /* remove rx_desc */ - skb_pull(new, pkt_offset); - -+ rtw_update_rx_freq_for_invalid(rtwdev, new, &rx_status, &pkt_stat); - rtw_rx_stats(rtwdev, pkt_stat.vif, new); - memcpy(new->cb, &rx_status, sizeof(rx_status)); - ieee80211_rx_napi(rtwdev->hw, NULL, new, napi); ---- a/drivers/net/wireless/realtek/rtw88/rtw8822c.c -+++ b/drivers/net/wireless/realtek/rtw88/rtw8822c.c -@@ -2576,9 +2576,10 @@ static void query_phy_status_page0(struc - rx_power[RF_PATH_B] -= 110; - - channel = GET_PHY_STAT_P0_CHANNEL(phy_status); -- if (channel == 0) -- channel = rtwdev->hal.current_channel; -- rtw_set_rx_freq_band(pkt_stat, channel); -+ if (channel != 0) -+ rtw_set_rx_freq_band(pkt_stat, channel); -+ else -+ pkt_stat->channel_invalid = true; - - pkt_stat->rx_power[RF_PATH_A] = rx_power[RF_PATH_A]; - pkt_stat->rx_power[RF_PATH_B] = rx_power[RF_PATH_B]; ---- a/drivers/net/wireless/realtek/rtw88/rx.c -+++ b/drivers/net/wireless/realtek/rtw88/rx.c -@@ -146,6 +146,47 @@ static void rtw_set_rx_freq_by_pktstat(s - rx_status->band = pkt_stat->band; - } - -+void rtw_update_rx_freq_from_ie(struct rtw_dev *rtwdev, struct sk_buff *skb, -+ struct ieee80211_rx_status *rx_status, -+ struct rtw_rx_pkt_stat *pkt_stat) -+{ -+ struct ieee80211_mgmt *mgmt = (struct ieee80211_mgmt *)skb->data; -+ int channel = rtwdev->hal.current_channel; -+ size_t hdr_len, ielen; -+ int channel_number; -+ u8 *variable; -+ -+ if (!test_bit(RTW_FLAG_SCANNING, rtwdev->flags)) -+ goto fill_rx_status; -+ -+ if (ieee80211_is_beacon(mgmt->frame_control)) { -+ variable = mgmt->u.beacon.variable; -+ hdr_len = offsetof(struct ieee80211_mgmt, -+ u.beacon.variable); -+ } else if (ieee80211_is_probe_resp(mgmt->frame_control)) { -+ variable = mgmt->u.probe_resp.variable; -+ hdr_len = offsetof(struct ieee80211_mgmt, -+ u.probe_resp.variable); -+ } else { -+ goto fill_rx_status; -+ } -+ -+ if (skb->len > hdr_len) -+ ielen = skb->len - hdr_len; -+ else -+ goto fill_rx_status; -+ -+ channel_number = cfg80211_get_ies_channel_number(variable, ielen, -+ NL80211_BAND_2GHZ); -+ if (channel_number != -1) -+ channel = channel_number; -+ -+fill_rx_status: -+ rtw_set_rx_freq_band(pkt_stat, channel); -+ rtw_set_rx_freq_by_pktstat(pkt_stat, rx_status); -+} -+EXPORT_SYMBOL(rtw_update_rx_freq_from_ie); -+ - void rtw_rx_fill_rx_status(struct rtw_dev *rtwdev, - struct rtw_rx_pkt_stat *pkt_stat, - struct ieee80211_hdr *hdr, ---- a/drivers/net/wireless/realtek/rtw88/rx.h -+++ b/drivers/net/wireless/realtek/rtw88/rx.h -@@ -50,5 +50,18 @@ void rtw_rx_fill_rx_status(struct rtw_de - struct ieee80211_hdr *hdr, - struct ieee80211_rx_status *rx_status, - u8 *phy_status); -+void rtw_update_rx_freq_from_ie(struct rtw_dev *rtwdev, struct sk_buff *skb, -+ struct ieee80211_rx_status *rx_status, -+ struct rtw_rx_pkt_stat *pkt_stat); -+ -+static inline -+void rtw_update_rx_freq_for_invalid(struct rtw_dev *rtwdev, struct sk_buff *skb, -+ struct ieee80211_rx_status *rx_status, -+ struct rtw_rx_pkt_stat *pkt_stat) -+{ -+ if (pkt_stat->channel_invalid) -+ rtw_update_rx_freq_from_ie(rtwdev, skb, rx_status, pkt_stat); -+} -+ - - #endif ---- a/drivers/net/wireless/realtek/rtw88/sdio.c -+++ b/drivers/net/wireless/realtek/rtw88/sdio.c -@@ -948,6 +948,7 @@ static void rtw_sdio_rx_skb(struct rtw_d - skb_put(skb, pkt_stat->pkt_len); - skb_reserve(skb, pkt_offset); - -+ rtw_update_rx_freq_for_invalid(rtwdev, skb, rx_status, pkt_stat); - rtw_rx_stats(rtwdev, pkt_stat->vif, skb); - - ieee80211_rx_irqsafe(rtwdev->hw, skb); ---- a/drivers/net/wireless/realtek/rtw88/usb.c -+++ b/drivers/net/wireless/realtek/rtw88/usb.c -@@ -579,6 +579,8 @@ static void rtw_usb_rx_handler(struct wo - - skb_put(skb, pkt_stat.pkt_len); - skb_reserve(skb, pkt_offset); -+ -+ rtw_update_rx_freq_for_invalid(rtwdev, skb, &rx_status, &pkt_stat); - memcpy(skb->cb, &rx_status, sizeof(rx_status)); - ieee80211_rx_irqsafe(rtwdev->hw, skb); - } diff --git a/package/kernel/mac80211/patches/rtl/010-v6.12-wifi-rtw88-usb-Init-RX-burst-length-according-to-USB.patch b/package/kernel/mac80211/patches/rtl/010-v6.12-wifi-rtw88-usb-Init-RX-burst-length-according-to-USB.patch deleted file mode 100644 index 191c87ff37..0000000000 --- a/package/kernel/mac80211/patches/rtl/010-v6.12-wifi-rtw88-usb-Init-RX-burst-length-according-to-USB.patch +++ /dev/null @@ -1,73 +0,0 @@ -From fbbd8cb347e25b68d25c4f3871821afc495ee7a9 Mon Sep 17 00:00:00 2001 -From: Bitterblue Smith -Date: Thu, 8 Aug 2024 01:19:36 +0300 -Subject: [PATCH] wifi: rtw88: usb: Init RX burst length according to USB speed - -This is needed in order to make USB RX aggregation work with RTL8811CU -(and presumably RTL8822BU and RTL8822CU also). - -I don't know what BIT_DMA_BURST_CNT, BIT_DMA_MODE, and BIT_DROP_DATA_EN -are doing. - -Tested with RTL8822CU, RTL8811CU, and RTL8723DU. - -The RX speed is unchanged in my tests. - -Tested-by: Sascha Hauer -Signed-off-by: Bitterblue Smith -Signed-off-by: Ping-Ke Shih -Link: https://patch.msgid.link/ac569c6f-7129-4341-b523-901fe10cabff@gmail.com ---- - drivers/net/wireless/realtek/rtw88/reg.h | 6 ++++++ - drivers/net/wireless/realtek/rtw88/usb.c | 23 ++++++++++++++++++++++- - 2 files changed, 28 insertions(+), 1 deletion(-) - ---- a/drivers/net/wireless/realtek/rtw88/reg.h -+++ b/drivers/net/wireless/realtek/rtw88/reg.h -@@ -322,6 +322,12 @@ - #define REG_RXDMA_DPR 0x028C - #define REG_RXDMA_MODE 0x0290 - #define BIT_DMA_MODE BIT(1) -+#define BIT_DMA_BURST_CNT GENMASK(3, 2) -+#define BIT_DMA_BURST_SIZE GENMASK(5, 4) -+#define BIT_DMA_BURST_SIZE_64 2 -+#define BIT_DMA_BURST_SIZE_512 1 -+#define BIT_DMA_BURST_SIZE_1024 0 -+ - #define REG_RXPKTNUM 0x02B0 - - #define REG_INT_MIG 0x0304 ---- a/drivers/net/wireless/realtek/rtw88/usb.c -+++ b/drivers/net/wireless/realtek/rtw88/usb.c -@@ -720,9 +720,30 @@ static void rtw_usb_link_ps(struct rtw_d - /* empty function for rtw_hci_ops */ - } - -+static void rtw_usb_init_burst_pkt_len(struct rtw_dev *rtwdev) -+{ -+ struct rtw_usb *rtwusb = rtw_get_usb_priv(rtwdev); -+ enum usb_device_speed speed = rtwusb->udev->speed; -+ u8 rxdma, burst_size; -+ -+ rxdma = BIT_DMA_BURST_CNT | BIT_DMA_MODE; -+ -+ if (speed == USB_SPEED_SUPER) -+ burst_size = BIT_DMA_BURST_SIZE_1024; -+ else if (speed == USB_SPEED_HIGH) -+ burst_size = BIT_DMA_BURST_SIZE_512; -+ else -+ burst_size = BIT_DMA_BURST_SIZE_64; -+ -+ u8p_replace_bits(&rxdma, burst_size, BIT_DMA_BURST_SIZE); -+ -+ rtw_write8(rtwdev, REG_RXDMA_MODE, rxdma); -+ rtw_write16_set(rtwdev, REG_TXDMA_OFFSET_CHK, BIT_DROP_DATA_EN); -+} -+ - static void rtw_usb_interface_cfg(struct rtw_dev *rtwdev) - { -- /* empty function for rtw_hci_ops */ -+ rtw_usb_init_burst_pkt_len(rtwdev); - } - - static struct rtw_hci_ops rtw_usb_ops = { diff --git a/package/kernel/mac80211/patches/rtl/011-v6.12-wifi-rtw88-usb-Update-the-RX-stats-after-every-frame.patch b/package/kernel/mac80211/patches/rtl/011-v6.12-wifi-rtw88-usb-Update-the-RX-stats-after-every-frame.patch deleted file mode 100644 index f78f43b464..0000000000 --- a/package/kernel/mac80211/patches/rtl/011-v6.12-wifi-rtw88-usb-Update-the-RX-stats-after-every-frame.patch +++ /dev/null @@ -1,31 +0,0 @@ -From 38ea04a79ad0f8cc30bb5e9ad98d665e4ae5060c Mon Sep 17 00:00:00 2001 -From: Bitterblue Smith -Date: Thu, 8 Aug 2024 01:20:36 +0300 -Subject: [PATCH] wifi: rtw88: usb: Update the RX stats after every frame - -Update the number of received unicast data frames and bytes every time -a frame is received. This is what the PCI and SDIO drivers do. - -This has an influence on the power saving, bluetooth coexistence, and -(in a future patch) the use of RX aggregation. - -Tested with RTL8822CU, RTL8811CU, and RTL8723DU. - -Tested-by: Sascha Hauer -Signed-off-by: Bitterblue Smith -Signed-off-by: Ping-Ke Shih -Link: https://patch.msgid.link/75a2ca52-8f01-45c5-926f-d3a68ae3b284@gmail.com ---- - drivers/net/wireless/realtek/rtw88/usb.c | 1 + - 1 file changed, 1 insertion(+) - ---- a/drivers/net/wireless/realtek/rtw88/usb.c -+++ b/drivers/net/wireless/realtek/rtw88/usb.c -@@ -581,6 +581,7 @@ static void rtw_usb_rx_handler(struct wo - skb_reserve(skb, pkt_offset); - - rtw_update_rx_freq_for_invalid(rtwdev, skb, &rx_status, &pkt_stat); -+ rtw_rx_stats(rtwdev, pkt_stat.vif, skb); - memcpy(skb->cb, &rx_status, sizeof(rx_status)); - ieee80211_rx_irqsafe(rtwdev->hw, skb); - } diff --git a/package/kernel/mac80211/patches/rtl/012-v6.12-wifi-rtw88-usb-Support-RX-aggregation.patch b/package/kernel/mac80211/patches/rtl/012-v6.12-wifi-rtw88-usb-Support-RX-aggregation.patch deleted file mode 100644 index bc8eac898b..0000000000 --- a/package/kernel/mac80211/patches/rtl/012-v6.12-wifi-rtw88-usb-Support-RX-aggregation.patch +++ /dev/null @@ -1,118 +0,0 @@ -From df3d8f463b1dfc7cb8f4fb52b1b81d290b850d03 Mon Sep 17 00:00:00 2001 -From: Bitterblue Smith -Date: Thu, 8 Aug 2024 01:21:36 +0300 -Subject: [PATCH] wifi: rtw88: usb: Support RX aggregation - -The chips can be configured to aggregate several frames into a single -USB transfer. Modify rtw_usb_rx_handler() to support this case. - -RX aggregation improves the RX speed of RTL8811CU on certain ARM -systems, like the NanoPi NEO Core2. It also improves the RX speed of -RTL8822CU on some x86_64 systems. - -Currently none of the chips are configured to aggregate frames. - -Tested with RTL8822CU, RTL8811CU, and RTL8723DU. - -Reviewed-by: Sascha Hauer -Tested-by: Sascha Hauer -Signed-off-by: Bitterblue Smith -Signed-off-by: Ping-Ke Shih -Link: https://patch.msgid.link/f845826d-de71-492d-9a22-e48c07989a1f@gmail.com ---- - drivers/net/wireless/realtek/rtw88/usb.c | 61 ++++++++++++++++-------- - 1 file changed, 40 insertions(+), 21 deletions(-) - ---- a/drivers/net/wireless/realtek/rtw88/usb.c -+++ b/drivers/net/wireless/realtek/rtw88/usb.c -@@ -546,11 +546,12 @@ static void rtw_usb_rx_handler(struct wo - struct rtw_usb *rtwusb = container_of(work, struct rtw_usb, rx_work); - struct rtw_dev *rtwdev = rtwusb->rtwdev; - const struct rtw_chip_info *chip = rtwdev->chip; -- struct rtw_rx_pkt_stat pkt_stat; -+ u32 pkt_desc_sz = chip->rx_pkt_desc_sz; - struct ieee80211_rx_status rx_status; -+ u32 pkt_offset, next_pkt, urb_len; -+ struct rtw_rx_pkt_stat pkt_stat; -+ struct sk_buff *next_skb; - struct sk_buff *skb; -- u32 pkt_desc_sz = chip->rx_pkt_desc_sz; -- u32 pkt_offset; - u8 *rx_desc; - int limit; - -@@ -559,31 +560,48 @@ static void rtw_usb_rx_handler(struct wo - if (!skb) - break; - -- rx_desc = skb->data; -- chip->ops->query_rx_desc(rtwdev, rx_desc, &pkt_stat, -- &rx_status); -- pkt_offset = pkt_desc_sz + pkt_stat.drv_info_sz + -- pkt_stat.shift; -- -- if (pkt_stat.is_c2h) { -- skb_put(skb, pkt_stat.pkt_len + pkt_offset); -- rtw_fw_c2h_cmd_rx_irqsafe(rtwdev, pkt_offset, skb); -- continue; -- } -- - if (skb_queue_len(&rtwusb->rx_queue) >= RTW_USB_MAX_RXQ_LEN) { - dev_dbg_ratelimited(rtwdev->dev, "failed to get rx_queue, overflow\n"); - dev_kfree_skb_any(skb); - continue; - } - -- skb_put(skb, pkt_stat.pkt_len); -- skb_reserve(skb, pkt_offset); -+ urb_len = skb->len; -+ -+ do { -+ rx_desc = skb->data; -+ chip->ops->query_rx_desc(rtwdev, rx_desc, &pkt_stat, -+ &rx_status); -+ pkt_offset = pkt_desc_sz + pkt_stat.drv_info_sz + -+ pkt_stat.shift; -+ -+ next_pkt = round_up(pkt_stat.pkt_len + pkt_offset, 8); -+ -+ if (urb_len >= next_pkt + pkt_desc_sz) -+ next_skb = skb_clone(skb, GFP_KERNEL); -+ else -+ next_skb = NULL; -+ -+ if (pkt_stat.is_c2h) { -+ skb_trim(skb, pkt_stat.pkt_len + pkt_offset); -+ rtw_fw_c2h_cmd_rx_irqsafe(rtwdev, pkt_offset, skb); -+ } else { -+ skb_pull(skb, pkt_offset); -+ skb_trim(skb, pkt_stat.pkt_len); -+ rtw_update_rx_freq_for_invalid(rtwdev, skb, -+ &rx_status, -+ &pkt_stat); -+ rtw_rx_stats(rtwdev, pkt_stat.vif, skb); -+ memcpy(skb->cb, &rx_status, sizeof(rx_status)); -+ ieee80211_rx_irqsafe(rtwdev->hw, skb); -+ } -+ -+ skb = next_skb; -+ if (skb) -+ skb_pull(skb, next_pkt); - -- rtw_update_rx_freq_for_invalid(rtwdev, skb, &rx_status, &pkt_stat); -- rtw_rx_stats(rtwdev, pkt_stat.vif, skb); -- memcpy(skb->cb, &rx_status, sizeof(rx_status)); -- ieee80211_rx_irqsafe(rtwdev->hw, skb); -+ urb_len -= next_pkt; -+ } while (skb); - } - } - -@@ -627,6 +645,7 @@ static void rtw_usb_read_port_complete(s - if (skb) - dev_kfree_skb_any(skb); - } else { -+ skb_put(skb, urb->actual_length); - skb_queue_tail(&rtwusb->rx_queue, skb); - queue_work(rtwusb->rxwq, &rtwusb->rx_work); - } diff --git a/package/kernel/mac80211/patches/rtl/013-v6.12-wifi-rtw88-Enable-USB-RX-aggregation-for-8822c-8822b.patch b/package/kernel/mac80211/patches/rtl/013-v6.12-wifi-rtw88-Enable-USB-RX-aggregation-for-8822c-8822b.patch deleted file mode 100644 index 71175324e6..0000000000 --- a/package/kernel/mac80211/patches/rtl/013-v6.12-wifi-rtw88-Enable-USB-RX-aggregation-for-8822c-8822b.patch +++ /dev/null @@ -1,168 +0,0 @@ -From 002a5db9a52a0e7af0fa9a450d31049748435748 Mon Sep 17 00:00:00 2001 -From: Bitterblue Smith -Date: Thu, 8 Aug 2024 01:23:06 +0300 -Subject: [PATCH] wifi: rtw88: Enable USB RX aggregation for 8822c/8822b/8821c - -Enable USB RX aggregation when there is at least 1 Mbps RX or TX -traffic, otherwise disable it. - -USB RX aggregation improves the RX speed of RTL8811CU on certain ARM -systems, like the NanoPi NEO Core2. Before: 28 Mbps, after: 231 Mbps. - -It also improves the RX speed of RTL8822CU on some x86_64 systems. -Before: ~200 Mbps, after: ~300 Mbps. - -The official drivers for these chips use the same logic for SDIO, but -for some reason the SDIO driver in rtw88 always enables RX aggregation, -so this patch only toggles aggregation for USB devices. - -RTL8703B is likely not found in USB devices, and RTL8723DU doesn't like -aggregation. - -Tested-by: Sascha Hauer -Signed-off-by: Bitterblue Smith -Signed-off-by: Ping-Ke Shih -Link: https://patch.msgid.link/b4c0d54c-6755-4b0f-9dd7-f9196fd74b68@gmail.com ---- - drivers/net/wireless/realtek/rtw88/hci.h | 7 ++++ - drivers/net/wireless/realtek/rtw88/main.c | 13 +++++--- - drivers/net/wireless/realtek/rtw88/pci.c | 1 + - drivers/net/wireless/realtek/rtw88/sdio.c | 1 + - drivers/net/wireless/realtek/rtw88/usb.c | 40 +++++++++++++++++++++++ - 5 files changed, 58 insertions(+), 4 deletions(-) - ---- a/drivers/net/wireless/realtek/rtw88/hci.h -+++ b/drivers/net/wireless/realtek/rtw88/hci.h -@@ -18,6 +18,7 @@ struct rtw_hci_ops { - void (*deep_ps)(struct rtw_dev *rtwdev, bool enter); - void (*link_ps)(struct rtw_dev *rtwdev, bool enter); - void (*interface_cfg)(struct rtw_dev *rtwdev); -+ void (*dynamic_rx_agg)(struct rtw_dev *rtwdev, bool enable); - - int (*write_data_rsvd_page)(struct rtw_dev *rtwdev, u8 *buf, u32 size); - int (*write_data_h2c)(struct rtw_dev *rtwdev, u8 *buf, u32 size); -@@ -72,6 +73,12 @@ static inline void rtw_hci_interface_cfg - rtwdev->hci.ops->interface_cfg(rtwdev); - } - -+static inline void rtw_hci_dynamic_rx_agg(struct rtw_dev *rtwdev, bool enable) -+{ -+ if (rtwdev->hci.ops->dynamic_rx_agg) -+ rtwdev->hci.ops->dynamic_rx_agg(rtwdev, enable); -+} -+ - static inline int - rtw_hci_write_data_rsvd_page(struct rtw_dev *rtwdev, u8 *buf, u32 size) - { ---- a/drivers/net/wireless/realtek/rtw88/main.c -+++ b/drivers/net/wireless/realtek/rtw88/main.c -@@ -212,6 +212,7 @@ static void rtw_watch_dog_work(struct wo - struct rtw_traffic_stats *stats = &rtwdev->stats; - struct rtw_watch_dog_iter_data data = {}; - bool busy_traffic = test_bit(RTW_FLAG_BUSY_TRAFFIC, rtwdev->flags); -+ u32 tx_unicast_mbps, rx_unicast_mbps; - bool ps_active; - - mutex_lock(&rtwdev->mutex); -@@ -236,10 +237,11 @@ static void rtw_watch_dog_work(struct wo - else - ps_active = false; - -- ewma_tp_add(&stats->tx_ewma_tp, -- (u32)(stats->tx_unicast >> RTW_TP_SHIFT)); -- ewma_tp_add(&stats->rx_ewma_tp, -- (u32)(stats->rx_unicast >> RTW_TP_SHIFT)); -+ tx_unicast_mbps = stats->tx_unicast >> RTW_TP_SHIFT; -+ rx_unicast_mbps = stats->rx_unicast >> RTW_TP_SHIFT; -+ -+ ewma_tp_add(&stats->tx_ewma_tp, tx_unicast_mbps); -+ ewma_tp_add(&stats->rx_ewma_tp, rx_unicast_mbps); - stats->tx_throughput = ewma_tp_read(&stats->tx_ewma_tp); - stats->rx_throughput = ewma_tp_read(&stats->rx_ewma_tp); - -@@ -259,6 +261,9 @@ static void rtw_watch_dog_work(struct wo - - rtw_phy_dynamic_mechanism(rtwdev); - -+ rtw_hci_dynamic_rx_agg(rtwdev, -+ tx_unicast_mbps >= 1 || rx_unicast_mbps >= 1); -+ - data.rtwdev = rtwdev; - /* rtw_iterate_vifs internally uses an atomic iterator which is needed - * to avoid taking local->iflist_mtx mutex ---- a/drivers/net/wireless/realtek/rtw88/pci.c -+++ b/drivers/net/wireless/realtek/rtw88/pci.c -@@ -1601,6 +1601,7 @@ static struct rtw_hci_ops rtw_pci_ops = - .deep_ps = rtw_pci_deep_ps, - .link_ps = rtw_pci_link_ps, - .interface_cfg = rtw_pci_interface_cfg, -+ .dynamic_rx_agg = NULL, - - .read8 = rtw_pci_read8, - .read16 = rtw_pci_read16, ---- a/drivers/net/wireless/realtek/rtw88/sdio.c -+++ b/drivers/net/wireless/realtek/rtw88/sdio.c -@@ -1157,6 +1157,7 @@ static struct rtw_hci_ops rtw_sdio_ops = - .deep_ps = rtw_sdio_deep_ps, - .link_ps = rtw_sdio_link_ps, - .interface_cfg = rtw_sdio_interface_cfg, -+ .dynamic_rx_agg = NULL, - - .read8 = rtw_sdio_read8, - .read16 = rtw_sdio_read16, ---- a/drivers/net/wireless/realtek/rtw88/usb.c -+++ b/drivers/net/wireless/realtek/rtw88/usb.c -@@ -766,6 +766,45 @@ static void rtw_usb_interface_cfg(struct - rtw_usb_init_burst_pkt_len(rtwdev); - } - -+static void rtw_usb_dynamic_rx_agg_v1(struct rtw_dev *rtwdev, bool enable) -+{ -+ u8 size, timeout; -+ u16 val16; -+ -+ rtw_write32_set(rtwdev, REG_RXDMA_AGG_PG_TH, BIT_EN_PRE_CALC); -+ rtw_write8_set(rtwdev, REG_TXDMA_PQ_MAP, BIT_RXDMA_AGG_EN); -+ rtw_write8_clr(rtwdev, REG_RXDMA_AGG_PG_TH + 3, BIT(7)); -+ -+ if (enable) { -+ size = 0x5; -+ timeout = 0x20; -+ } else { -+ size = 0x0; -+ timeout = 0x1; -+ } -+ val16 = u16_encode_bits(size, BIT_RXDMA_AGG_PG_TH) | -+ u16_encode_bits(timeout, BIT_DMA_AGG_TO_V1); -+ -+ rtw_write16(rtwdev, REG_RXDMA_AGG_PG_TH, val16); -+} -+ -+static void rtw_usb_dynamic_rx_agg(struct rtw_dev *rtwdev, bool enable) -+{ -+ switch (rtwdev->chip->id) { -+ case RTW_CHIP_TYPE_8822C: -+ case RTW_CHIP_TYPE_8822B: -+ case RTW_CHIP_TYPE_8821C: -+ rtw_usb_dynamic_rx_agg_v1(rtwdev, enable); -+ break; -+ case RTW_CHIP_TYPE_8723D: -+ /* Doesn't like aggregation. */ -+ break; -+ case RTW_CHIP_TYPE_8703B: -+ /* Likely not found in USB devices. */ -+ break; -+ } -+} -+ - static struct rtw_hci_ops rtw_usb_ops = { - .tx_write = rtw_usb_tx_write, - .tx_kick_off = rtw_usb_tx_kick_off, -@@ -775,6 +814,7 @@ static struct rtw_hci_ops rtw_usb_ops = - .deep_ps = rtw_usb_deep_ps, - .link_ps = rtw_usb_link_ps, - .interface_cfg = rtw_usb_interface_cfg, -+ .dynamic_rx_agg = rtw_usb_dynamic_rx_agg, - - .write8 = rtw_usb_write8, - .write16 = rtw_usb_write16, diff --git a/package/kernel/mac80211/patches/rtl/016-v6.12-wifi-rtw88-assign-mac_id-for-vif-sta-and-update-to-T.patch b/package/kernel/mac80211/patches/rtl/016-v6.12-wifi-rtw88-assign-mac_id-for-vif-sta-and-update-to-T.patch deleted file mode 100644 index ce110c5c90..0000000000 --- a/package/kernel/mac80211/patches/rtl/016-v6.12-wifi-rtw88-assign-mac_id-for-vif-sta-and-update-to-T.patch +++ /dev/null @@ -1,231 +0,0 @@ -From 902cb7b11f9a7ff07233cc4c626b54c3e4703149 Mon Sep 17 00:00:00 2001 -From: Ping-Ke Shih -Date: Mon, 19 Aug 2024 10:52:48 +0800 -Subject: [PATCH] wifi: rtw88: assign mac_id for vif/sta and update to TX desc - -A mac_id as an instance in firmware has to be assigned for each station -including AP and connected stations. Firmware will use the mac_id to -control TX rate and do statistics. - -Assignment rule is to assign mac_id to each vif when adding vif. -For station mode, sta->mac_id will reuse vif->mac_id. For AP mode, -dynamically allocate an sta->mac_id to a station, and vif->mac_id is -used to send broadcast/multicast packets which are not belong to -a station. For example, - - vif->mac_id sta->mac_id -vif0 (STA mode) 0 0 -vif1 (AP mode) 1 2... - -By the way, remove unused RTW_BC_MC_MACID, which was planed to send -broadcast/multicast packets on fixed mac_id. - -Tested-on RTL8822CE with STA + AP SCC mode. - -Link: https://lore.kernel.org/linux-wireless/e4be0a75-43b2-4ae5-9aab-5c4a88e78097@gmail.com/ -Cc: Bitterblue Smith -Signed-off-by: Ping-Ke Shih -Link: https://patch.msgid.link/20240819025248.17939-1-pkshih@realtek.com ---- - drivers/net/wireless/realtek/rtw88/mac80211.c | 13 ++++++-- - drivers/net/wireless/realtek/rtw88/main.c | 30 ++++++++----------- - drivers/net/wireless/realtek/rtw88/main.h | 14 +++++++-- - drivers/net/wireless/realtek/rtw88/tx.c | 11 +++++-- - drivers/net/wireless/realtek/rtw88/tx.h | 1 + - 5 files changed, 44 insertions(+), 25 deletions(-) - ---- a/drivers/net/wireless/realtek/rtw88/mac80211.c -+++ b/drivers/net/wireless/realtek/rtw88/mac80211.c -@@ -167,6 +167,12 @@ static int rtw_ops_add_interface(struct - - mutex_lock(&rtwdev->mutex); - -+ rtwvif->mac_id = rtw_acquire_macid(rtwdev); -+ if (rtwvif->mac_id >= RTW_MAX_MAC_ID_NUM) { -+ mutex_unlock(&rtwdev->mutex); -+ return -ENOSPC; -+ } -+ - port = find_first_zero_bit(rtwdev->hw_port, RTW_PORT_NUM); - if (port >= RTW_PORT_NUM) { - mutex_unlock(&rtwdev->mutex); -@@ -214,7 +220,8 @@ static int rtw_ops_add_interface(struct - - mutex_unlock(&rtwdev->mutex); - -- rtw_dbg(rtwdev, RTW_DBG_STATE, "start vif %pM on port %d\n", vif->addr, rtwvif->port); -+ rtw_dbg(rtwdev, RTW_DBG_STATE, "start vif %pM mac_id %d on port %d\n", -+ vif->addr, rtwvif->mac_id, rtwvif->port); - return 0; - } - -@@ -225,7 +232,8 @@ static void rtw_ops_remove_interface(str - struct rtw_vif *rtwvif = (struct rtw_vif *)vif->drv_priv; - u32 config = 0; - -- rtw_dbg(rtwdev, RTW_DBG_STATE, "stop vif %pM on port %d\n", vif->addr, rtwvif->port); -+ rtw_dbg(rtwdev, RTW_DBG_STATE, "stop vif %pM mac_id %d on port %d\n", -+ vif->addr, rtwvif->mac_id, rtwvif->port); - - mutex_lock(&rtwdev->mutex); - -@@ -242,6 +250,7 @@ static void rtw_ops_remove_interface(str - config |= PORT_SET_BCN_CTRL; - rtw_vif_port_config(rtwdev, rtwvif, config); - clear_bit(rtwvif->port, rtwdev->hw_port); -+ rtw_release_macid(rtwdev, rtwvif->mac_id); - rtw_recalc_lps(rtwdev, NULL); - - mutex_unlock(&rtwdev->mutex); ---- a/drivers/net/wireless/realtek/rtw88/main.c -+++ b/drivers/net/wireless/realtek/rtw88/main.c -@@ -311,17 +311,6 @@ static void rtw_ips_work(struct work_str - mutex_unlock(&rtwdev->mutex); - } - --static u8 rtw_acquire_macid(struct rtw_dev *rtwdev) --{ -- unsigned long mac_id; -- -- mac_id = find_first_zero_bit(rtwdev->mac_id_map, RTW_MAX_MAC_ID_NUM); -- if (mac_id < RTW_MAX_MAC_ID_NUM) -- set_bit(mac_id, rtwdev->mac_id_map); -- -- return mac_id; --} -- - static void rtw_sta_rc_work(struct work_struct *work) - { - struct rtw_sta_info *si = container_of(work, struct rtw_sta_info, -@@ -340,12 +329,14 @@ int rtw_sta_add(struct rtw_dev *rtwdev, - struct rtw_vif *rtwvif = (struct rtw_vif *)vif->drv_priv; - int i; - -- si->mac_id = rtw_acquire_macid(rtwdev); -- if (si->mac_id >= RTW_MAX_MAC_ID_NUM) -- return -ENOSPC; -+ if (vif->type == NL80211_IFTYPE_STATION) { -+ si->mac_id = rtwvif->mac_id; -+ } else { -+ si->mac_id = rtw_acquire_macid(rtwdev); -+ if (si->mac_id >= RTW_MAX_MAC_ID_NUM) -+ return -ENOSPC; -+ } - -- if (vif->type == NL80211_IFTYPE_STATION && vif->cfg.assoc == 0) -- rtwvif->mac_id = si->mac_id; - si->rtwdev = rtwdev; - si->sta = sta; - si->vif = vif; -@@ -370,11 +361,13 @@ void rtw_sta_remove(struct rtw_dev *rtwd - bool fw_exist) - { - struct rtw_sta_info *si = (struct rtw_sta_info *)sta->drv_priv; -+ struct ieee80211_vif *vif = si->vif; - int i; - - cancel_work_sync(&si->rc_work); - -- rtw_release_macid(rtwdev, si->mac_id); -+ if (vif->type != NL80211_IFTYPE_STATION) -+ rtw_release_macid(rtwdev, si->mac_id); - if (fw_exist) - rtw_fw_media_status_report(rtwdev, si->mac_id, false); - -@@ -614,6 +607,8 @@ static void rtw_reset_vif_iter(void *dat - rtw_bf_disassoc(rtwdev, vif, NULL); - rtw_vif_assoc_changed(rtwvif, NULL); - rtw_txq_cleanup(rtwdev, vif->txq); -+ -+ rtw_release_macid(rtwdev, rtwvif->mac_id); - } - - void rtw_fw_recovery(struct rtw_dev *rtwdev) -@@ -2139,7 +2134,6 @@ int rtw_core_init(struct rtw_dev *rtwdev - rtwdev->sec.total_cam_num = 32; - rtwdev->hal.current_channel = 1; - rtwdev->dm_info.fix_rate = U8_MAX; -- set_bit(RTW_BC_MC_MACID, rtwdev->mac_id_map); - - rtw_stats_init(rtwdev); - ---- a/drivers/net/wireless/realtek/rtw88/main.h -+++ b/drivers/net/wireless/realtek/rtw88/main.h -@@ -742,7 +742,6 @@ struct rtw_txq { - unsigned long flags; - }; - --#define RTW_BC_MC_MACID 1 - DECLARE_EWMA(rssi, 10, 16); - - struct rtw_sta_info { -@@ -805,7 +804,7 @@ struct rtw_bf_info { - struct rtw_vif { - enum rtw_net_type net_type; - u16 aid; -- u8 mac_id; /* for STA mode only */ -+ u8 mac_id; - u8 mac_addr[ETH_ALEN]; - u8 bssid[ETH_ALEN]; - u8 port; -@@ -2131,6 +2130,17 @@ static inline bool rtw_chip_has_tx_stbc( - return rtwdev->chip->tx_stbc; - } - -+static inline u8 rtw_acquire_macid(struct rtw_dev *rtwdev) -+{ -+ unsigned long mac_id; -+ -+ mac_id = find_first_zero_bit(rtwdev->mac_id_map, RTW_MAX_MAC_ID_NUM); -+ if (mac_id < RTW_MAX_MAC_ID_NUM) -+ set_bit(mac_id, rtwdev->mac_id_map); -+ -+ return mac_id; -+} -+ - static inline void rtw_release_macid(struct rtw_dev *rtwdev, u8 mac_id) - { - clear_bit(mac_id, rtwdev->mac_id_map); ---- a/drivers/net/wireless/realtek/rtw88/tx.c -+++ b/drivers/net/wireless/realtek/rtw88/tx.c -@@ -46,7 +46,8 @@ void rtw_tx_fill_tx_desc(struct rtw_tx_p - le32_encode_bits(pkt_info->ls, RTW_TX_DESC_W0_LS) | - le32_encode_bits(pkt_info->dis_qselseq, RTW_TX_DESC_W0_DISQSELSEQ); - -- tx_desc->w1 = le32_encode_bits(pkt_info->qsel, RTW_TX_DESC_W1_QSEL) | -+ tx_desc->w1 = le32_encode_bits(pkt_info->mac_id, RTW_TX_DESC_W1_MACID) | -+ le32_encode_bits(pkt_info->qsel, RTW_TX_DESC_W1_QSEL) | - le32_encode_bits(pkt_info->rate_id, RTW_TX_DESC_W1_RATE_ID) | - le32_encode_bits(pkt_info->sec_type, RTW_TX_DESC_W1_SEC_TYPE) | - le32_encode_bits(pkt_info->pkt_offset, RTW_TX_DESC_W1_PKT_OFFSET) | -@@ -401,14 +402,18 @@ void rtw_tx_pkt_info_update(struct rtw_d - const struct rtw_chip_info *chip = rtwdev->chip; - struct ieee80211_tx_info *info = IEEE80211_SKB_CB(skb); - struct ieee80211_hdr *hdr = (struct ieee80211_hdr *)skb->data; -+ struct ieee80211_vif *vif = info->control.vif; - struct rtw_sta_info *si; -- struct ieee80211_vif *vif = NULL; -+ struct rtw_vif *rtwvif; - __le16 fc = hdr->frame_control; - bool bmc; - - if (sta) { - si = (struct rtw_sta_info *)sta->drv_priv; -- vif = si->vif; -+ pkt_info->mac_id = si->mac_id; -+ } else if (vif) { -+ rtwvif = (struct rtw_vif *)vif->drv_priv; -+ pkt_info->mac_id = rtwvif->mac_id; - } - - if (ieee80211_is_mgmt(fc) || ieee80211_is_nullfunc(fc)) ---- a/drivers/net/wireless/realtek/rtw88/tx.h -+++ b/drivers/net/wireless/realtek/rtw88/tx.h -@@ -27,6 +27,7 @@ struct rtw_tx_desc { - #define RTW_TX_DESC_W0_BMC BIT(24) - #define RTW_TX_DESC_W0_LS BIT(26) - #define RTW_TX_DESC_W0_DISQSELSEQ BIT(31) -+#define RTW_TX_DESC_W1_MACID GENMASK(7, 0) - #define RTW_TX_DESC_W1_QSEL GENMASK(12, 8) - #define RTW_TX_DESC_W1_RATE_ID GENMASK(20, 16) - #define RTW_TX_DESC_W1_SEC_TYPE GENMASK(23, 22) diff --git a/package/kernel/mac80211/patches/rtl/019-v6.13-wifi-rtw88-Parse-the-RX-descriptor-with-a-single-fun.patch b/package/kernel/mac80211/patches/rtl/019-v6.13-wifi-rtw88-Parse-the-RX-descriptor-with-a-single-fun.patch index 9828f507b6..4a32831ea3 100644 --- a/package/kernel/mac80211/patches/rtl/019-v6.13-wifi-rtw88-Parse-the-RX-descriptor-with-a-single-fun.patch +++ b/package/kernel/mac80211/patches/rtl/019-v6.13-wifi-rtw88-Parse-the-RX-descriptor-with-a-single-fun.patch @@ -547,7 +547,7 @@ Link: https://patch.msgid.link/913f1747-38fc-4409-85a4-57bb9cee506b@gmail.com --- a/drivers/net/wireless/realtek/rtw88/usb.c +++ b/drivers/net/wireless/realtek/rtw88/usb.c -@@ -570,8 +570,8 @@ static void rtw_usb_rx_handler(struct wo +@@ -571,8 +571,8 @@ static void rtw_usb_rx_handler(struct wo do { rx_desc = skb->data; diff --git a/package/kernel/mac80211/patches/rtl/020-v6.12-wifi-rtw88-Fix-the-RX-aggregation-in-USB-3-mode.patch b/package/kernel/mac80211/patches/rtl/020-v6.12-wifi-rtw88-Fix-the-RX-aggregation-in-USB-3-mode.patch deleted file mode 100644 index 174ee10816..0000000000 --- a/package/kernel/mac80211/patches/rtl/020-v6.12-wifi-rtw88-Fix-the-RX-aggregation-in-USB-3-mode.patch +++ /dev/null @@ -1,70 +0,0 @@ -From 4aefde403da7af30757915e0462d88398c9388c5 Mon Sep 17 00:00:00 2001 -From: Bitterblue Smith -Date: Tue, 8 Oct 2024 21:44:02 +0300 -Subject: [PATCH] wifi: rtw88: Fix the RX aggregation in USB 3 mode - -RTL8822CU, RTL8822BU, and RTL8821CU don't need BIT_EN_PRE_CALC. -In fact, RTL8822BU in USB 3 mode doesn't pass all the frames to the -driver, resulting in much lower download speed than normal: - -$ iperf3 -c 192.168.0.1 -R -Connecting to host 192.168.0.1, port 5201 -Reverse mode, remote host 192.168.0.1 is sending -[ 5] local 192.168.0.50 port 43062 connected to 192.168.0.1 port 5201 -[ ID] Interval Transfer Bitrate -[ 5] 0.00-1.00 sec 26.9 MBytes 225 Mbits/sec -[ 5] 1.00-2.00 sec 7.50 MBytes 62.9 Mbits/sec -[ 5] 2.00-3.00 sec 8.50 MBytes 71.3 Mbits/sec -[ 5] 3.00-4.00 sec 8.38 MBytes 70.3 Mbits/sec -[ 5] 4.00-5.00 sec 7.75 MBytes 65.0 Mbits/sec -[ 5] 5.00-6.00 sec 8.00 MBytes 67.1 Mbits/sec -[ 5] 6.00-7.00 sec 8.00 MBytes 67.1 Mbits/sec -[ 5] 7.00-8.00 sec 7.75 MBytes 65.0 Mbits/sec -[ 5] 8.00-9.00 sec 7.88 MBytes 66.1 Mbits/sec -[ 5] 9.00-10.00 sec 7.88 MBytes 66.1 Mbits/sec -- - - - - - - - - - - - - - - - - - - - - - - - - -[ ID] Interval Transfer Bitrate Retr -[ 5] 0.00-10.02 sec 102 MBytes 85.1 Mbits/sec 224 sender -[ 5] 0.00-10.00 sec 98.6 MBytes 82.7 Mbits/sec receiver - -Don't set BIT_EN_PRE_CALC. Then the speed is much better: - -% iperf3 -c 192.168.0.1 -R -Connecting to host 192.168.0.1, port 5201 -Reverse mode, remote host 192.168.0.1 is sending -[ 5] local 192.168.0.50 port 39000 connected to 192.168.0.1 port 5201 -[ ID] Interval Transfer Bitrate -[ 5] 0.00-1.00 sec 52.8 MBytes 442 Mbits/sec -[ 5] 1.00-2.00 sec 71.9 MBytes 603 Mbits/sec -[ 5] 2.00-3.00 sec 74.8 MBytes 627 Mbits/sec -[ 5] 3.00-4.00 sec 75.9 MBytes 636 Mbits/sec -[ 5] 4.00-5.00 sec 76.0 MBytes 638 Mbits/sec -[ 5] 5.00-6.00 sec 74.1 MBytes 622 Mbits/sec -[ 5] 6.00-7.00 sec 74.0 MBytes 621 Mbits/sec -[ 5] 7.00-8.00 sec 76.0 MBytes 638 Mbits/sec -[ 5] 8.00-9.00 sec 74.4 MBytes 624 Mbits/sec -[ 5] 9.00-10.00 sec 63.9 MBytes 536 Mbits/sec -- - - - - - - - - - - - - - - - - - - - - - - - - -[ ID] Interval Transfer Bitrate Retr -[ 5] 0.00-10.00 sec 717 MBytes 601 Mbits/sec 24 sender -[ 5] 0.00-10.00 sec 714 MBytes 599 Mbits/sec receiver - -Fixes: 002a5db9a52a ("wifi: rtw88: Enable USB RX aggregation for 8822c/8822b/8821c") -Signed-off-by: Bitterblue Smith -Acked-by: Ping-Ke Shih -Signed-off-by: Kalle Valo -Link: https://patch.msgid.link/afb94a82-3d18-459e-97fc-1a217608cdf0@gmail.com ---- - drivers/net/wireless/realtek/rtw88/usb.c | 1 - - 1 file changed, 1 deletion(-) - ---- a/drivers/net/wireless/realtek/rtw88/usb.c -+++ b/drivers/net/wireless/realtek/rtw88/usb.c -@@ -771,7 +771,6 @@ static void rtw_usb_dynamic_rx_agg_v1(st - u8 size, timeout; - u16 val16; - -- rtw_write32_set(rtwdev, REG_RXDMA_AGG_PG_TH, BIT_EN_PRE_CALC); - rtw_write8_set(rtwdev, REG_TXDMA_PQ_MAP, BIT_RXDMA_AGG_EN); - rtw_write8_clr(rtwdev, REG_RXDMA_AGG_PG_TH + 3, BIT(7)); - diff --git a/package/kernel/mac80211/patches/rtl/030-v6.13-wifi-rtw88-Enable-data-rate-fallback-for-older-chips.patch b/package/kernel/mac80211/patches/rtl/030-v6.13-wifi-rtw88-Enable-data-rate-fallback-for-older-chips.patch index 153c04ee20..944985edc9 100644 --- a/package/kernel/mac80211/patches/rtl/030-v6.13-wifi-rtw88-Enable-data-rate-fallback-for-older-chips.patch +++ b/package/kernel/mac80211/patches/rtl/030-v6.13-wifi-rtw88-Enable-data-rate-fallback-for-older-chips.patch @@ -174,7 +174,7 @@ Link: https://patch.msgid.link/2b3e3e6f-541b-4a3b-8ca3-65b267e6a95a@gmail.com void rtw_tx_rsvd_page_pkt_info_update(struct rtw_dev *rtwdev, --- a/drivers/net/wireless/realtek/rtw88/usb.c +++ b/drivers/net/wireless/realtek/rtw88/usb.c -@@ -457,7 +457,7 @@ static int rtw_usb_write_data(struct rtw +@@ -458,7 +458,7 @@ static int rtw_usb_write_data(struct rtw skb_put_data(skb, buf, size); skb_push(skb, chip->tx_pkt_desc_sz); memset(skb->data, 0, chip->tx_pkt_desc_sz); @@ -183,7 +183,7 @@ Link: https://patch.msgid.link/2b3e3e6f-541b-4a3b-8ca3-65b267e6a95a@gmail.com rtw_tx_fill_txdesc_checksum(rtwdev, pkt_info, skb->data); ret = rtw_usb_write_port(rtwdev, qsel, skb, -@@ -524,7 +524,7 @@ static int rtw_usb_tx_write(struct rtw_d +@@ -525,7 +525,7 @@ static int rtw_usb_tx_write(struct rtw_d pkt_desc = skb_push(skb, chip->tx_pkt_desc_sz); memset(pkt_desc, 0, chip->tx_pkt_desc_sz); ep = qsel_to_ep(rtwusb, pkt_info->qsel); diff --git a/package/kernel/mac80211/patches/rtl/034-v6.13-wifi-rtw88-usb-Set-pkt_info.ls-for-the-reserved-page.patch b/package/kernel/mac80211/patches/rtl/034-v6.13-wifi-rtw88-usb-Set-pkt_info.ls-for-the-reserved-page.patch index 7c6e135860..67d7d230f4 100644 --- a/package/kernel/mac80211/patches/rtl/034-v6.13-wifi-rtw88-usb-Set-pkt_info.ls-for-the-reserved-page.patch +++ b/package/kernel/mac80211/patches/rtl/034-v6.13-wifi-rtw88-usb-Set-pkt_info.ls-for-the-reserved-page.patch @@ -17,7 +17,7 @@ Link: https://patch.msgid.link/e443f5d9-4b53-4f64-985c-64313ec80bef@gmail.com --- a/drivers/net/wireless/realtek/rtw88/usb.c +++ b/drivers/net/wireless/realtek/rtw88/usb.c -@@ -477,6 +477,7 @@ static int rtw_usb_write_data_rsvd_page( +@@ -478,6 +478,7 @@ static int rtw_usb_write_data_rsvd_page( pkt_info.tx_pkt_size = size; pkt_info.qsel = TX_DESC_QSEL_BEACON; pkt_info.offset = chip->tx_pkt_desc_sz; diff --git a/package/kernel/mac80211/patches/rtl/048-wifi-rtw88-usb-Support-USB-3-with-RTL8812AU.patch b/package/kernel/mac80211/patches/rtl/048-wifi-rtw88-usb-Support-USB-3-with-RTL8812AU.patch index 2ccefb9893..33ca91d77d 100644 --- a/package/kernel/mac80211/patches/rtl/048-wifi-rtw88-usb-Support-USB-3-with-RTL8812AU.patch +++ b/package/kernel/mac80211/patches/rtl/048-wifi-rtw88-usb-Support-USB-3-with-RTL8812AU.patch @@ -12,7 +12,7 @@ Signed-off-by: Bitterblue Smith --- a/drivers/net/wireless/realtek/rtw88/usb.c +++ b/drivers/net/wireless/realtek/rtw88/usb.c -@@ -929,6 +929,32 @@ static void rtw_usb_intf_deinit(struct r +@@ -930,6 +930,32 @@ static void rtw_usb_intf_deinit(struct r usb_set_intfdata(intf, NULL); } @@ -45,7 +45,7 @@ Signed-off-by: Bitterblue Smith static int rtw_usb_switch_mode_new(struct rtw_dev *rtwdev) { enum usb_device_speed cur_speed; -@@ -982,7 +1008,8 @@ static int rtw_usb_switch_mode(struct rt +@@ -983,7 +1009,8 @@ static int rtw_usb_switch_mode(struct rt { u8 id = rtwdev->chip->id; @@ -55,7 +55,7 @@ Signed-off-by: Bitterblue Smith return 0; if (!rtwdev->efuse.usb_mode_switch) { -@@ -997,7 +1024,10 @@ static int rtw_usb_switch_mode(struct rt +@@ -998,7 +1025,10 @@ static int rtw_usb_switch_mode(struct rt return 0; } diff --git a/package/kernel/mac80211/patches/rtl/049-wifi-rtw88-usb-Enable-RX-aggregation-for-8821au-8812.patch b/package/kernel/mac80211/patches/rtl/049-wifi-rtw88-usb-Enable-RX-aggregation-for-8821au-8812.patch index 00775c0281..d4c3ef3495 100644 --- a/package/kernel/mac80211/patches/rtl/049-wifi-rtw88-usb-Enable-RX-aggregation-for-8821au-8812.patch +++ b/package/kernel/mac80211/patches/rtl/049-wifi-rtw88-usb-Enable-RX-aggregation-for-8821au-8812.patch @@ -19,7 +19,7 @@ Signed-off-by: Bitterblue Smith --- a/drivers/net/wireless/realtek/rtw88/usb.c +++ b/drivers/net/wireless/realtek/rtw88/usb.c -@@ -788,6 +788,32 @@ static void rtw_usb_dynamic_rx_agg_v1(st +@@ -789,6 +789,32 @@ static void rtw_usb_dynamic_rx_agg_v1(st rtw_write16(rtwdev, REG_RXDMA_AGG_PG_TH, val16); } @@ -52,7 +52,7 @@ Signed-off-by: Bitterblue Smith static void rtw_usb_dynamic_rx_agg(struct rtw_dev *rtwdev, bool enable) { switch (rtwdev->chip->id) { -@@ -796,6 +822,10 @@ static void rtw_usb_dynamic_rx_agg(struc +@@ -797,6 +823,10 @@ static void rtw_usb_dynamic_rx_agg(struc case RTW_CHIP_TYPE_8821C: rtw_usb_dynamic_rx_agg_v1(rtwdev, enable); break; diff --git a/package/kernel/mac80211/patches/subsys/130-disable_auto_vif.patch b/package/kernel/mac80211/patches/subsys/130-disable_auto_vif.patch index eea165ccca..c9496b5e70 100644 --- a/package/kernel/mac80211/patches/subsys/130-disable_auto_vif.patch +++ b/package/kernel/mac80211/patches/subsys/130-disable_auto_vif.patch @@ -1,6 +1,6 @@ --- a/net/mac80211/main.c +++ b/net/mac80211/main.c -@@ -1581,24 +1581,6 @@ int ieee80211_register_hw(struct ieee802 +@@ -1583,24 +1583,6 @@ int ieee80211_register_hw(struct ieee802 ieee80211_check_wbrf_support(local); diff --git a/package/kernel/mac80211/patches/subsys/220-allow-ibss-mixed.patch b/package/kernel/mac80211/patches/subsys/220-allow-ibss-mixed.patch index 55376362a5..378ca275f5 100644 --- a/package/kernel/mac80211/patches/subsys/220-allow-ibss-mixed.patch +++ b/package/kernel/mac80211/patches/subsys/220-allow-ibss-mixed.patch @@ -16,7 +16,7 @@ and we should ignore this. --- a/net/wireless/core.c +++ b/net/wireless/core.c -@@ -654,21 +654,6 @@ static int wiphy_verify_combinations(str +@@ -678,21 +678,6 @@ int wiphy_verify_iface_combinations(stru c->limits[j].max > 1)) return -EINVAL; diff --git a/package/kernel/mac80211/patches/subsys/310-cfg80211-allow-grace-period-for-DFS-available-after-.patch b/package/kernel/mac80211/patches/subsys/310-cfg80211-allow-grace-period-for-DFS-available-after-.patch index 7e9be59e04..c86b836f2f 100644 --- a/package/kernel/mac80211/patches/subsys/310-cfg80211-allow-grace-period-for-DFS-available-after-.patch +++ b/package/kernel/mac80211/patches/subsys/310-cfg80211-allow-grace-period-for-DFS-available-after-.patch @@ -113,7 +113,7 @@ Signed-off-by: Felix Fietkau { --- a/net/wireless/core.h +++ b/net/wireless/core.h -@@ -467,6 +467,8 @@ void cfg80211_set_dfs_state(struct wiphy +@@ -475,6 +475,8 @@ void cfg80211_set_dfs_state(struct wiphy enum nl80211_dfs_state dfs_state); void cfg80211_dfs_channels_update_work(struct work_struct *work); @@ -124,7 +124,7 @@ Signed-off-by: Felix Fietkau --- a/net/wireless/mlme.c +++ b/net/wireless/mlme.c -@@ -1037,6 +1037,8 @@ void cfg80211_dfs_channels_update_work(s +@@ -1031,6 +1031,8 @@ void cfg80211_dfs_channels_update_work(s if (c->dfs_state == NL80211_DFS_UNAVAILABLE) { time_dfs_update = IEEE80211_DFS_MIN_NOP_TIME_MS; radar_event = NL80211_RADAR_NOP_FINISHED; @@ -133,7 +133,7 @@ Signed-off-by: Felix Fietkau } else { if (regulatory_pre_cac_allowed(wiphy) || cfg80211_any_wiphy_oper_chan(wiphy, c)) -@@ -1044,11 +1046,10 @@ void cfg80211_dfs_channels_update_work(s +@@ -1038,11 +1040,10 @@ void cfg80211_dfs_channels_update_work(s time_dfs_update = REG_PRE_CAC_EXPIRY_GRACE_MS; radar_event = NL80211_RADAR_PRE_CAC_EXPIRED; diff --git a/package/kernel/mac80211/patches/subsys/320-mac80211-add-AQL-support-for-broadcast-packets.patch b/package/kernel/mac80211/patches/subsys/320-mac80211-add-AQL-support-for-broadcast-packets.patch index c03f40d9b4..9513dc14bc 100644 --- a/package/kernel/mac80211/patches/subsys/320-mac80211-add-AQL-support-for-broadcast-packets.patch +++ b/package/kernel/mac80211/patches/subsys/320-mac80211-add-AQL-support-for-broadcast-packets.patch @@ -85,7 +85,7 @@ Signed-off-by: Felix Fietkau const struct ieee80211_ops *ops; --- a/net/mac80211/main.c +++ b/net/mac80211/main.c -@@ -952,6 +952,7 @@ struct ieee80211_hw *ieee80211_alloc_hw_ +@@ -954,6 +954,7 @@ struct ieee80211_hw *ieee80211_alloc_hw_ spin_lock_init(&local->rx_path_lock); spin_lock_init(&local->queue_stop_reason_lock); diff --git a/package/kernel/mac80211/patches/subsys/321-wifi-mac80211-do-not-pass-a-stopped-vif-to-the-drive.patch b/package/kernel/mac80211/patches/subsys/321-wifi-mac80211-do-not-pass-a-stopped-vif-to-the-drive.patch deleted file mode 100644 index f48fa38e5e..0000000000 --- a/package/kernel/mac80211/patches/subsys/321-wifi-mac80211-do-not-pass-a-stopped-vif-to-the-drive.patch +++ /dev/null @@ -1,24 +0,0 @@ -From: Felix Fietkau -Date: Wed, 2 Oct 2024 11:45:35 +0200 -Subject: [PATCH] wifi: mac80211: do not pass a stopped vif to the driver in - .get_txpower - -Avoid potentially crashing in the driver because of uninitialized private data - -Fixes: 5b3dc42b1b0d ("mac80211: add support for driver tx power reporting") -Cc: stable@vger.kernel.org -Signed-off-by: Felix Fietkau ---- - ---- a/net/mac80211/cfg.c -+++ b/net/mac80211/cfg.c -@@ -3134,7 +3134,8 @@ static int ieee80211_get_tx_power(struct - struct ieee80211_local *local = wiphy_priv(wiphy); - struct ieee80211_sub_if_data *sdata = IEEE80211_WDEV_TO_SUB_IF(wdev); - -- if (local->ops->get_txpower) -+ if (local->ops->get_txpower && -+ (sdata->flags & IEEE80211_SDATA_IN_DRIVER)) - return drv_get_txpower(local, sdata, dbm); - - if (local->emulate_chanctx) diff --git a/package/kernel/mac80211/patches/subsys/350-wifi-cfg80211-add-option-for-vif-allowed-radios.patch b/package/kernel/mac80211/patches/subsys/330-wifi-cfg80211-add-option-for-vif-allowed-radios.patch similarity index 96% rename from package/kernel/mac80211/patches/subsys/350-wifi-cfg80211-add-option-for-vif-allowed-radios.patch rename to package/kernel/mac80211/patches/subsys/330-wifi-cfg80211-add-option-for-vif-allowed-radios.patch index d5b42f3a3a..3b09c46f28 100644 --- a/package/kernel/mac80211/patches/subsys/350-wifi-cfg80211-add-option-for-vif-allowed-radios.patch +++ b/package/kernel/mac80211/patches/subsys/330-wifi-cfg80211-add-option-for-vif-allowed-radios.patch @@ -23,15 +23,15 @@ Signed-off-by: Felix Fietkau --- a/include/net/cfg80211.h +++ b/include/net/cfg80211.h -@@ -6227,6 +6227,7 @@ enum ieee80211_ap_reg_power { +@@ -6271,6 +6271,7 @@ enum ieee80211_ap_reg_power { * entered. - * @links[].cac_time_ms: CAC time in ms + * @links.cac_time_ms: CAC time in ms * @valid_links: bitmap describing what elements of @links are valid + * @radio_mask: Bitmask of radios that this interface is allowed to operate on. */ struct wireless_dev { struct wiphy *wiphy; -@@ -6339,6 +6340,8 @@ struct wireless_dev { +@@ -6383,6 +6384,8 @@ struct wireless_dev { unsigned int cac_time_ms; } links[IEEE80211_MLD_MAX_NUM_LINKS]; u16 valid_links; @@ -40,7 +40,7 @@ Signed-off-by: Felix Fietkau }; static inline const u8 *wdev_address(struct wireless_dev *wdev) -@@ -6525,6 +6528,17 @@ bool cfg80211_radio_chandef_valid(const +@@ -6569,6 +6572,17 @@ bool cfg80211_radio_chandef_valid(const const struct cfg80211_chan_def *chandef); /** @@ -246,7 +246,7 @@ Signed-off-by: Felix Fietkau continue; for (i = 0; i < rdev_req->n_channels; i++) { -@@ -3490,9 +3491,12 @@ int cfg80211_wext_siwscan(struct net_dev +@@ -3519,9 +3520,12 @@ int cfg80211_wext_siwscan(struct net_dev continue; for (j = 0; j < wiphy->bands[band]->n_channels; j++) { @@ -298,7 +298,7 @@ Signed-off-by: Felix Fietkau +EXPORT_SYMBOL(cfg80211_wdev_channel_allowed); --- a/net/wireless/core.c +++ b/net/wireless/core.c -@@ -1415,6 +1415,8 @@ void cfg80211_init_wdev(struct wireless_ +@@ -1424,6 +1424,8 @@ void cfg80211_init_wdev(struct wireless_ /* allow mac80211 to determine the timeout */ wdev->ps_timeout = -1; diff --git a/package/kernel/mac80211/patches/subsys/330-wifi-mac80211-introduce-EHT-rate-support-in-AQL-airt.patch b/package/kernel/mac80211/patches/subsys/330-wifi-mac80211-introduce-EHT-rate-support-in-AQL-airt.patch deleted file mode 100644 index 0a3c8ec53b..0000000000 --- a/package/kernel/mac80211/patches/subsys/330-wifi-mac80211-introduce-EHT-rate-support-in-AQL-airt.patch +++ /dev/null @@ -1,233 +0,0 @@ -From: Ming Yen Hsieh -Date: Wed, 4 Sep 2024 19:12:56 +0800 -Subject: [PATCH] wifi: mac80211: introduce EHT rate support in AQL airtime - -Add definitions related to EHT mode and airtime calculation -according to the 802.11BE_D4.0. - -Co-developed-by: Bo Jiao -Signed-off-by: Bo Jiao -Signed-off-by: Deren Wu -Signed-off-by: Quan Zhou -Signed-off-by: Ming Yen Hsieh -Link: https://patch.msgid.link/20240904111256.11734-1-mingyen.hsieh@mediatek.com -Signed-off-by: Johannes Berg ---- - ---- a/net/mac80211/airtime.c -+++ b/net/mac80211/airtime.c -@@ -55,10 +55,21 @@ - #define HE_DURATION_S(shift, streams, gi, bps) \ - (HE_DURATION(streams, gi, bps) >> shift) - -+/* gi in HE/EHT is identical. It matches enum nl80211_eht_gi as well */ -+#define EHT_GI_08 HE_GI_08 -+#define EHT_GI_16 HE_GI_16 -+#define EHT_GI_32 HE_GI_32 -+ -+#define EHT_DURATION(streams, gi, bps) \ -+ HE_DURATION(streams, gi, bps) -+#define EHT_DURATION_S(shift, streams, gi, bps) \ -+ HE_DURATION_S(shift, streams, gi, bps) -+ - #define BW_20 0 - #define BW_40 1 - #define BW_80 2 - #define BW_160 3 -+#define BW_320 4 - - /* - * Define group sort order: HT40 -> SGI -> #streams -@@ -68,17 +79,26 @@ - #define IEEE80211_VHT_STREAM_GROUPS 8 /* BW(=4) * SGI(=2) */ - - #define IEEE80211_HE_MAX_STREAMS 8 -+#define IEEE80211_HE_STREAM_GROUPS 12 /* BW(=4) * GI(=3) */ -+ -+#define IEEE80211_EHT_MAX_STREAMS 8 -+#define IEEE80211_EHT_STREAM_GROUPS 15 /* BW(=5) * GI(=3) */ - - #define IEEE80211_HT_GROUPS_NB (IEEE80211_MAX_STREAMS * \ - IEEE80211_HT_STREAM_GROUPS) - #define IEEE80211_VHT_GROUPS_NB (IEEE80211_MAX_STREAMS * \ - IEEE80211_VHT_STREAM_GROUPS) -+#define IEEE80211_HE_GROUPS_NB (IEEE80211_HE_MAX_STREAMS * \ -+ IEEE80211_HE_STREAM_GROUPS) -+#define IEEE80211_EHT_GROUPS_NB (IEEE80211_EHT_MAX_STREAMS * \ -+ IEEE80211_EHT_STREAM_GROUPS) - - #define IEEE80211_HT_GROUP_0 0 - #define IEEE80211_VHT_GROUP_0 (IEEE80211_HT_GROUP_0 + IEEE80211_HT_GROUPS_NB) - #define IEEE80211_HE_GROUP_0 (IEEE80211_VHT_GROUP_0 + IEEE80211_VHT_GROUPS_NB) -+#define IEEE80211_EHT_GROUP_0 (IEEE80211_HE_GROUP_0 + IEEE80211_HE_GROUPS_NB) - --#define MCS_GROUP_RATES 12 -+#define MCS_GROUP_RATES 14 - - #define HT_GROUP_IDX(_streams, _sgi, _ht40) \ - IEEE80211_HT_GROUP_0 + \ -@@ -203,6 +223,69 @@ - #define HE_GROUP(_streams, _gi, _bw) \ - __HE_GROUP(_streams, _gi, _bw, \ - HE_GROUP_SHIFT(_streams, _gi, _bw)) -+ -+#define EHT_BW2VBPS(_bw, r5, r4, r3, r2, r1) \ -+ ((_bw) == BW_320 ? r5 : BW2VBPS(_bw, r4, r3, r2, r1)) -+ -+#define EHT_GROUP_IDX(_streams, _gi, _bw) \ -+ (IEEE80211_EHT_GROUP_0 + \ -+ IEEE80211_EHT_MAX_STREAMS * 3 * (_bw) + \ -+ IEEE80211_EHT_MAX_STREAMS * (_gi) + \ -+ (_streams) - 1) -+ -+#define __EHT_GROUP(_streams, _gi, _bw, _s) \ -+ [EHT_GROUP_IDX(_streams, _gi, _bw)] = { \ -+ .shift = _s, \ -+ .duration = { \ -+ EHT_DURATION_S(_s, _streams, _gi, \ -+ EHT_BW2VBPS(_bw, 1960, 980, 490, 234, 117)), \ -+ EHT_DURATION_S(_s, _streams, _gi, \ -+ EHT_BW2VBPS(_bw, 3920, 1960, 980, 468, 234)), \ -+ EHT_DURATION_S(_s, _streams, _gi, \ -+ EHT_BW2VBPS(_bw, 5880, 2937, 1470, 702, 351)), \ -+ EHT_DURATION_S(_s, _streams, _gi, \ -+ EHT_BW2VBPS(_bw, 7840, 3920, 1960, 936, 468)), \ -+ EHT_DURATION_S(_s, _streams, _gi, \ -+ EHT_BW2VBPS(_bw, 11760, 5880, 2940, 1404, 702)), \ -+ EHT_DURATION_S(_s, _streams, _gi, \ -+ EHT_BW2VBPS(_bw, 15680, 7840, 3920, 1872, 936)), \ -+ EHT_DURATION_S(_s, _streams, _gi, \ -+ EHT_BW2VBPS(_bw, 17640, 8820, 4410, 2106, 1053)), \ -+ EHT_DURATION_S(_s, _streams, _gi, \ -+ EHT_BW2VBPS(_bw, 19600, 9800, 4900, 2340, 1170)), \ -+ EHT_DURATION_S(_s, _streams, _gi, \ -+ EHT_BW2VBPS(_bw, 23520, 11760, 5880, 2808, 1404)), \ -+ EHT_DURATION_S(_s, _streams, _gi, \ -+ EHT_BW2VBPS(_bw, 26133, 13066, 6533, 3120, 1560)), \ -+ EHT_DURATION_S(_s, _streams, _gi, \ -+ EHT_BW2VBPS(_bw, 29400, 14700, 7350, 3510, 1755)), \ -+ EHT_DURATION_S(_s, _streams, _gi, \ -+ EHT_BW2VBPS(_bw, 32666, 16333, 8166, 3900, 1950)), \ -+ EHT_DURATION_S(_s, _streams, _gi, \ -+ EHT_BW2VBPS(_bw, 35280, 17640, 8820, 4212, 2106)), \ -+ EHT_DURATION_S(_s, _streams, _gi, \ -+ EHT_BW2VBPS(_bw, 39200, 19600, 9800, 4680, 2340)) \ -+ } \ -+} -+ -+#define EHT_GROUP_SHIFT(_streams, _gi, _bw) \ -+ GROUP_SHIFT(EHT_DURATION(_streams, _gi, \ -+ EHT_BW2VBPS(_bw, 1960, 980, 490, 234, 117))) -+ -+#define EHT_GROUP(_streams, _gi, _bw) \ -+ __EHT_GROUP(_streams, _gi, _bw, \ -+ EHT_GROUP_SHIFT(_streams, _gi, _bw)) -+ -+#define EHT_GROUP_RANGE(_gi, _bw) \ -+ EHT_GROUP(1, _gi, _bw), \ -+ EHT_GROUP(2, _gi, _bw), \ -+ EHT_GROUP(3, _gi, _bw), \ -+ EHT_GROUP(4, _gi, _bw), \ -+ EHT_GROUP(5, _gi, _bw), \ -+ EHT_GROUP(6, _gi, _bw), \ -+ EHT_GROUP(7, _gi, _bw), \ -+ EHT_GROUP(8, _gi, _bw) -+ - struct mcs_group { - u8 shift; - u16 duration[MCS_GROUP_RATES]; -@@ -376,6 +459,26 @@ static const struct mcs_group airtime_mc - HE_GROUP(6, HE_GI_32, BW_160), - HE_GROUP(7, HE_GI_32, BW_160), - HE_GROUP(8, HE_GI_32, BW_160), -+ -+ EHT_GROUP_RANGE(EHT_GI_08, BW_20), -+ EHT_GROUP_RANGE(EHT_GI_16, BW_20), -+ EHT_GROUP_RANGE(EHT_GI_32, BW_20), -+ -+ EHT_GROUP_RANGE(EHT_GI_08, BW_40), -+ EHT_GROUP_RANGE(EHT_GI_16, BW_40), -+ EHT_GROUP_RANGE(EHT_GI_32, BW_40), -+ -+ EHT_GROUP_RANGE(EHT_GI_08, BW_80), -+ EHT_GROUP_RANGE(EHT_GI_16, BW_80), -+ EHT_GROUP_RANGE(EHT_GI_32, BW_80), -+ -+ EHT_GROUP_RANGE(EHT_GI_08, BW_160), -+ EHT_GROUP_RANGE(EHT_GI_16, BW_160), -+ EHT_GROUP_RANGE(EHT_GI_32, BW_160), -+ -+ EHT_GROUP_RANGE(EHT_GI_08, BW_320), -+ EHT_GROUP_RANGE(EHT_GI_16, BW_320), -+ EHT_GROUP_RANGE(EHT_GI_32, BW_320), - }; - - static u32 -@@ -422,6 +525,9 @@ static u32 ieee80211_get_rate_duration(s - case RATE_INFO_BW_160: - bw = BW_160; - break; -+ case RATE_INFO_BW_320: -+ bw = BW_320; -+ break; - default: - WARN_ON_ONCE(1); - return 0; -@@ -443,14 +549,27 @@ static u32 ieee80211_get_rate_duration(s - idx = status->rate_idx; - group = HE_GROUP_IDX(streams, status->he_gi, bw); - break; -+ case RX_ENC_EHT: -+ streams = status->nss; -+ idx = status->rate_idx; -+ group = EHT_GROUP_IDX(streams, status->eht.gi, bw); -+ break; - default: - WARN_ON_ONCE(1); - return 0; - } - -- if (WARN_ON_ONCE((status->encoding != RX_ENC_HE && streams > 4) || -- (status->encoding == RX_ENC_HE && streams > 8))) -- return 0; -+ switch (status->encoding) { -+ case RX_ENC_EHT: -+ case RX_ENC_HE: -+ if (WARN_ON_ONCE(streams > 8)) -+ return 0; -+ break; -+ default: -+ if (WARN_ON_ONCE(streams > 4)) -+ return 0; -+ break; -+ } - - if (idx >= MCS_GROUP_RATES) - return 0; -@@ -517,7 +636,9 @@ static bool ieee80211_fill_rate_info(str - stat->nss = ri->nss; - stat->rate_idx = ri->mcs; - -- if (ri->flags & RATE_INFO_FLAGS_HE_MCS) -+ if (ri->flags & RATE_INFO_FLAGS_EHT_MCS) -+ stat->encoding = RX_ENC_EHT; -+ else if (ri->flags & RATE_INFO_FLAGS_HE_MCS) - stat->encoding = RX_ENC_HE; - else if (ri->flags & RATE_INFO_FLAGS_VHT_MCS) - stat->encoding = RX_ENC_VHT; -@@ -529,7 +650,14 @@ static bool ieee80211_fill_rate_info(str - if (ri->flags & RATE_INFO_FLAGS_SHORT_GI) - stat->enc_flags |= RX_ENC_FLAG_SHORT_GI; - -- stat->he_gi = ri->he_gi; -+ switch (stat->encoding) { -+ case RX_ENC_EHT: -+ stat->eht.gi = ri->eht_gi; -+ break; -+ default: -+ stat->he_gi = ri->he_gi; -+ break; -+ } - - if (stat->encoding != RX_ENC_LEGACY) - return true; diff --git a/package/kernel/mac80211/patches/subsys/331-wifi-cfg80211-check-radio-iface-combination-for-mult.patch b/package/kernel/mac80211/patches/subsys/331-wifi-cfg80211-check-radio-iface-combination-for-mult.patch deleted file mode 100644 index 76c351aa83..0000000000 --- a/package/kernel/mac80211/patches/subsys/331-wifi-cfg80211-check-radio-iface-combination-for-mult.patch +++ /dev/null @@ -1,122 +0,0 @@ -From: Karthikeyan Periyasamy -Date: Tue, 17 Sep 2024 19:32:39 +0530 -Subject: [PATCH] wifi: cfg80211: check radio iface combination for multi radio - per wiphy - -Currently, wiphy_verify_combinations() fails for the multi-radio per wiphy -due to the condition check on new global interface combination that DFS -only works on one channel. In a multi-radio scenario, new global interface -combination encompasses the capabilities of all radio combinations, so it -supports more than one channel with DFS. For multi-radio per wiphy, -interface combination verification needs to be performed for radio specific -interface combinations. This is necessary as the new global interface -combination combines the capabilities of all radio combinations. - -Fixes: a01b1e9f9955 ("wifi: mac80211: add support for DFS with multiple radios") -Signed-off-by: Karthikeyan Periyasamy ---- - ---- a/net/wireless/core.c -+++ b/net/wireless/core.c -@@ -599,16 +599,20 @@ use_default_name: - } - EXPORT_SYMBOL(wiphy_new_nm); - --static int wiphy_verify_combinations(struct wiphy *wiphy) -+static -+int wiphy_verify_iface_combinations(struct wiphy *wiphy, -+ const struct ieee80211_iface_combination *iface_comb, -+ int n_iface_comb, -+ bool combined_radio) - { - const struct ieee80211_iface_combination *c; - int i, j; - -- for (i = 0; i < wiphy->n_iface_combinations; i++) { -+ for (i = 0; i < n_iface_comb; i++) { - u32 cnt = 0; - u16 all_iftypes = 0; - -- c = &wiphy->iface_combinations[i]; -+ c = &iface_comb[i]; - - /* - * Combinations with just one interface aren't real, -@@ -621,9 +625,13 @@ static int wiphy_verify_combinations(str - if (WARN_ON(!c->num_different_channels)) - return -EINVAL; - -- /* DFS only works on one channel. */ -- if (WARN_ON(c->radar_detect_widths && -- (c->num_different_channels > 1))) -+ /* DFS only works on one channel. Avoid this check -+ * for multi-radio global combination, since it hold -+ * the capabilities of all radio combinations. -+ */ -+ if (!combined_radio && -+ WARN_ON(c->radar_detect_widths && -+ c->num_different_channels > 1)) - return -EINVAL; - - if (WARN_ON(!c->n_limits)) -@@ -644,13 +652,21 @@ static int wiphy_verify_combinations(str - if (WARN_ON(wiphy->software_iftypes & types)) - return -EINVAL; - -- /* Only a single P2P_DEVICE can be allowed */ -- if (WARN_ON(types & BIT(NL80211_IFTYPE_P2P_DEVICE) && -+ /* Only a single P2P_DEVICE can be allowed, avoid this -+ * check for multi-radio global combination, since it -+ * hold the capabilities of all radio combinations. -+ */ -+ if (!combined_radio && -+ WARN_ON(types & BIT(NL80211_IFTYPE_P2P_DEVICE) && - c->limits[j].max > 1)) - return -EINVAL; - -- /* Only a single NAN can be allowed */ -- if (WARN_ON(types & BIT(NL80211_IFTYPE_NAN) && -+ /* Only a single NAN can be allowed, avoid this -+ * check for multi-radio global combination, since it -+ * hold the capabilities of all radio combinations. -+ */ -+ if (!combined_radio && -+ WARN_ON(types & BIT(NL80211_IFTYPE_NAN) && - c->limits[j].max > 1)) - return -EINVAL; - -@@ -674,6 +690,34 @@ static int wiphy_verify_combinations(str - return 0; - } - -+static int wiphy_verify_combinations(struct wiphy *wiphy) -+{ -+ int i, ret; -+ bool combined_radio = false; -+ -+ if (wiphy->n_radio) { -+ for (i = 0; i < wiphy->n_radio; i++) { -+ const struct wiphy_radio *radio = &wiphy->radio[i]; -+ -+ ret = wiphy_verify_iface_combinations(wiphy, -+ radio->iface_combinations, -+ radio->n_iface_combinations, -+ false); -+ if (ret) -+ return ret; -+ } -+ -+ combined_radio = true; -+ } -+ -+ ret = wiphy_verify_iface_combinations(wiphy, -+ wiphy->iface_combinations, -+ wiphy->n_iface_combinations, -+ combined_radio); -+ -+ return ret; -+} -+ - int wiphy_register(struct wiphy *wiphy) - { - struct cfg80211_registered_device *rdev = wiphy_to_rdev(wiphy); diff --git a/package/kernel/mac80211/patches/subsys/351-wifi-mac80211-use-vif-radio-mask-to-limit-ibss-scan-.patch b/package/kernel/mac80211/patches/subsys/331-wifi-mac80211-use-vif-radio-mask-to-limit-ibss-scan-.patch similarity index 88% rename from package/kernel/mac80211/patches/subsys/351-wifi-mac80211-use-vif-radio-mask-to-limit-ibss-scan-.patch rename to package/kernel/mac80211/patches/subsys/331-wifi-mac80211-use-vif-radio-mask-to-limit-ibss-scan-.patch index 7363c3873f..779857fe88 100644 --- a/package/kernel/mac80211/patches/subsys/351-wifi-mac80211-use-vif-radio-mask-to-limit-ibss-scan-.patch +++ b/package/kernel/mac80211/patches/subsys/331-wifi-mac80211-use-vif-radio-mask-to-limit-ibss-scan-.patch @@ -10,7 +10,7 @@ Signed-off-by: Felix Fietkau --- a/net/mac80211/scan.c +++ b/net/mac80211/scan.c -@@ -1178,14 +1178,14 @@ int ieee80211_request_ibss_scan(struct i +@@ -1176,14 +1176,14 @@ int ieee80211_request_ibss_scan(struct i unsigned int n_channels) { struct ieee80211_local *local = sdata->local; @@ -27,7 +27,7 @@ Signed-off-by: Felix Fietkau /* fill internal scan request */ if (!channels) { -@@ -1202,7 +1202,9 @@ int ieee80211_request_ibss_scan(struct i +@@ -1200,7 +1200,9 @@ int ieee80211_request_ibss_scan(struct i &local->hw.wiphy->bands[band]->channels[i]; if (tmp_ch->flags & (IEEE80211_CHAN_NO_IR | @@ -38,7 +38,7 @@ Signed-off-by: Felix Fietkau continue; local->int_scan_req->channels[n_ch] = tmp_ch; -@@ -1211,21 +1213,23 @@ int ieee80211_request_ibss_scan(struct i +@@ -1209,21 +1211,23 @@ int ieee80211_request_ibss_scan(struct i } if (WARN_ON_ONCE(n_ch == 0)) @@ -66,7 +66,7 @@ Signed-off-by: Felix Fietkau local->int_scan_req->n_channels = n_ch; } -@@ -1235,9 +1239,7 @@ int ieee80211_request_ibss_scan(struct i +@@ -1233,9 +1237,7 @@ int ieee80211_request_ibss_scan(struct i memcpy(local->int_scan_req->ssids[0].ssid, ssid, IEEE80211_MAX_SSID_LEN); local->int_scan_req->ssids[0].ssid_len = ssid_len; diff --git a/package/kernel/mac80211/patches/subsys/332-wifi-cfg80211-Set-correct-chandef-when-starting-CAC.patch b/package/kernel/mac80211/patches/subsys/332-wifi-cfg80211-Set-correct-chandef-when-starting-CAC.patch deleted file mode 100644 index 72a3510aac..0000000000 --- a/package/kernel/mac80211/patches/subsys/332-wifi-cfg80211-Set-correct-chandef-when-starting-CAC.patch +++ /dev/null @@ -1,64 +0,0 @@ -From: Issam Hamdi -Date: Fri, 16 Aug 2024 16:24:18 +0200 -Subject: [PATCH] wifi: cfg80211: Set correct chandef when starting CAC - -When starting CAC in a mode other than AP mode, it return a -"WARNING: CPU: 0 PID: 63 at cfg80211_chandef_dfs_usable+0x20/0xaf [cfg80211]" -caused by the chandef.chan being null at the end of CAC. - -Solution: Ensure the channel definition is set for the different modes -when starting CAC to avoid getting a NULL 'chan' at the end of CAC. - - Call Trace: - ? show_regs.part.0+0x14/0x16 - ? __warn+0x67/0xc0 - ? cfg80211_chandef_dfs_usable+0x20/0xaf [cfg80211] - ? report_bug+0xa7/0x130 - ? exc_overflow+0x30/0x30 - ? handle_bug+0x27/0x50 - ? exc_invalid_op+0x18/0x60 - ? handle_exception+0xf6/0xf6 - ? exc_overflow+0x30/0x30 - ? cfg80211_chandef_dfs_usable+0x20/0xaf [cfg80211] - ? exc_overflow+0x30/0x30 - ? cfg80211_chandef_dfs_usable+0x20/0xaf [cfg80211] - ? regulatory_propagate_dfs_state.cold+0x1b/0x4c [cfg80211] - ? cfg80211_propagate_cac_done_wk+0x1a/0x30 [cfg80211] - ? process_one_work+0x165/0x280 - ? worker_thread+0x120/0x3f0 - ? kthread+0xc2/0xf0 - ? process_one_work+0x280/0x280 - ? kthread_complete_and_exit+0x20/0x20 - ? ret_from_fork+0x19/0x24 - -Reported-by: Kretschmer Mathias -Signed-off-by: Issam Hamdi -Link: https://patch.msgid.link/20240816142418.3381951-1-ih@simonwunderlich.de -[shorten subject, remove OCB, reorder cases to match previous list] -Signed-off-by: Johannes Berg ---- - ---- a/net/wireless/nl80211.c -+++ b/net/wireless/nl80211.c -@@ -10144,7 +10144,20 @@ static int nl80211_start_radar_detection - - err = rdev_start_radar_detection(rdev, dev, &chandef, cac_time_ms); - if (!err) { -- wdev->links[0].ap.chandef = chandef; -+ switch (wdev->iftype) { -+ case NL80211_IFTYPE_AP: -+ case NL80211_IFTYPE_P2P_GO: -+ wdev->links[0].ap.chandef = chandef; -+ break; -+ case NL80211_IFTYPE_ADHOC: -+ wdev->u.ibss.chandef = chandef; -+ break; -+ case NL80211_IFTYPE_MESH_POINT: -+ wdev->u.mesh.chandef = chandef; -+ break; -+ default: -+ break; -+ } - wdev->cac_started = true; - wdev->cac_start_time = jiffies; - wdev->cac_time_ms = cac_time_ms; diff --git a/package/kernel/mac80211/patches/subsys/352-wifi-mac80211-use-vif-radio-mask-to-limit-chanctx-an.patch b/package/kernel/mac80211/patches/subsys/332-wifi-mac80211-use-vif-radio-mask-to-limit-chanctx-an.patch similarity index 86% rename from package/kernel/mac80211/patches/subsys/352-wifi-mac80211-use-vif-radio-mask-to-limit-chanctx-an.patch rename to package/kernel/mac80211/patches/subsys/332-wifi-mac80211-use-vif-radio-mask-to-limit-chanctx-an.patch index ac3d101148..0c8c894eaa 100644 --- a/package/kernel/mac80211/patches/subsys/352-wifi-mac80211-use-vif-radio-mask-to-limit-chanctx-an.patch +++ b/package/kernel/mac80211/patches/subsys/332-wifi-mac80211-use-vif-radio-mask-to-limit-chanctx-an.patch @@ -9,7 +9,7 @@ Signed-off-by: Felix Fietkau --- a/net/mac80211/chan.c +++ b/net/mac80211/chan.c -@@ -1167,7 +1167,7 @@ ieee80211_replace_chanctx(struct ieee802 +@@ -1169,7 +1169,7 @@ ieee80211_replace_chanctx(struct ieee802 static bool ieee80211_find_available_radio(struct ieee80211_local *local, const struct ieee80211_chan_req *chanreq, @@ -18,7 +18,7 @@ Signed-off-by: Felix Fietkau { struct wiphy *wiphy = local->hw.wiphy; const struct wiphy_radio *radio; -@@ -1178,6 +1178,9 @@ ieee80211_find_available_radio(struct ie +@@ -1180,6 +1180,9 @@ ieee80211_find_available_radio(struct ie return true; for (i = 0; i < wiphy->n_radio; i++) { @@ -28,7 +28,7 @@ Signed-off-by: Felix Fietkau radio = &wiphy->radio[i]; if (!cfg80211_radio_chandef_valid(radio, &chanreq->oper)) continue; -@@ -1211,7 +1214,9 @@ int ieee80211_link_reserve_chanctx(struc +@@ -1213,7 +1216,9 @@ int ieee80211_link_reserve_chanctx(struc new_ctx = ieee80211_find_reservation_chanctx(local, chanreq, mode); if (!new_ctx) { if (ieee80211_can_create_new_chanctx(local, -1) && @@ -39,7 +39,7 @@ Signed-off-by: Felix Fietkau new_ctx = ieee80211_new_chanctx(local, chanreq, mode, false, radio_idx); else -@@ -1881,7 +1886,9 @@ int _ieee80211_link_use_channel(struct i +@@ -1883,7 +1888,9 @@ int _ieee80211_link_use_channel(struct i /* Note: context is now reserved */ if (ctx) reserved = true; diff --git a/package/kernel/mac80211/patches/subsys/333-Revert-wifi-mac80211-move-radar-detect-work-to-sdata.patch b/package/kernel/mac80211/patches/subsys/333-Revert-wifi-mac80211-move-radar-detect-work-to-sdata.patch deleted file mode 100644 index d12df8f53e..0000000000 --- a/package/kernel/mac80211/patches/subsys/333-Revert-wifi-mac80211-move-radar-detect-work-to-sdata.patch +++ /dev/null @@ -1,136 +0,0 @@ -From: Aditya Kumar Singh -Date: Fri, 6 Sep 2024 12:14:19 +0530 -Subject: [PATCH] Revert "wifi: mac80211: move radar detect work to sdata" -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit - -This reverts commit ce9e660ef32e ("wifi: mac80211: move radar detect work to sdata"). - -To enable radar detection with MLO, it’s essential to handle it on a -per-link basis. This is because when using MLO, multiple links may already -be active and beaconing. In this scenario, another link should be able to -initiate a radar detection. Also, if underlying links are associated with -different hardware devices but grouped together for MLO, they could -potentially start radar detection simultaneously. Therefore, it makes -sense to manage radar detection settings separately for each link by moving -them back to a per-link data structure. - -Signed-off-by: Aditya Kumar Singh -Link: https://patch.msgid.link/20240906064426.2101315-2-quic_adisi@quicinc.com -Signed-off-by: Johannes Berg ---- - ---- a/net/mac80211/cfg.c -+++ b/net/mac80211/cfg.c -@@ -1658,7 +1658,7 @@ static int ieee80211_stop_ap(struct wiph - - if (sdata->wdev.cac_started) { - chandef = link_conf->chanreq.oper; -- wiphy_delayed_work_cancel(wiphy, &sdata->dfs_cac_timer_work); -+ wiphy_delayed_work_cancel(wiphy, &link->dfs_cac_timer_work); - cfg80211_cac_event(sdata->dev, &chandef, - NL80211_RADAR_CAC_ABORTED, - GFP_KERNEL); -@@ -3482,7 +3482,7 @@ static int ieee80211_start_radar_detecti - if (err) - goto out_unlock; - -- wiphy_delayed_work_queue(wiphy, &sdata->dfs_cac_timer_work, -+ wiphy_delayed_work_queue(wiphy, &sdata->deflink.dfs_cac_timer_work, - msecs_to_jiffies(cac_time_ms)); - - out_unlock: -@@ -3499,7 +3499,7 @@ static void ieee80211_end_cac(struct wip - - list_for_each_entry(sdata, &local->interfaces, list) { - wiphy_delayed_work_cancel(wiphy, -- &sdata->dfs_cac_timer_work); -+ &sdata->deflink.dfs_cac_timer_work); - - if (sdata->wdev.cac_started) { - ieee80211_link_release_channel(&sdata->deflink); ---- a/net/mac80211/ieee80211_i.h -+++ b/net/mac80211/ieee80211_i.h -@@ -1069,6 +1069,7 @@ struct ieee80211_link_data { - int ap_power_level; /* in dBm */ - - bool radar_required; -+ struct wiphy_delayed_work dfs_cac_timer_work; - - union { - struct ieee80211_link_data_managed mgd; -@@ -1167,8 +1168,6 @@ struct ieee80211_sub_if_data { - struct ieee80211_link_data deflink; - struct ieee80211_link_data __rcu *link[IEEE80211_MLD_MAX_NUM_LINKS]; - -- struct wiphy_delayed_work dfs_cac_timer_work; -- - /* for ieee80211_set_active_links_async() */ - struct wiphy_work activate_links_work; - u16 desired_active_links; ---- a/net/mac80211/iface.c -+++ b/net/mac80211/iface.c -@@ -551,7 +551,7 @@ static void ieee80211_do_stop(struct iee - wiphy_work_cancel(local->hw.wiphy, - &sdata->deflink.color_change_finalize_work); - wiphy_delayed_work_cancel(local->hw.wiphy, -- &sdata->dfs_cac_timer_work); -+ &sdata->deflink.dfs_cac_timer_work); - - if (sdata->wdev.cac_started) { - chandef = sdata->vif.bss_conf.chanreq.oper; -@@ -1744,8 +1744,6 @@ static void ieee80211_setup_sdata(struct - wiphy_work_init(&sdata->work, ieee80211_iface_work); - wiphy_work_init(&sdata->activate_links_work, - ieee80211_activate_links_work); -- wiphy_delayed_work_init(&sdata->dfs_cac_timer_work, -- ieee80211_dfs_cac_timer_work); - - switch (type) { - case NL80211_IFTYPE_P2P_GO: ---- a/net/mac80211/link.c -+++ b/net/mac80211/link.c -@@ -45,6 +45,8 @@ void ieee80211_link_init(struct ieee8021 - ieee80211_color_collision_detection_work); - INIT_LIST_HEAD(&link->assigned_chanctx_list); - INIT_LIST_HEAD(&link->reserved_chanctx_list); -+ wiphy_delayed_work_init(&link->dfs_cac_timer_work, -+ ieee80211_dfs_cac_timer_work); - - if (!deflink) { - switch (sdata->vif.type) { ---- a/net/mac80211/mlme.c -+++ b/net/mac80211/mlme.c -@@ -3031,15 +3031,16 @@ void ieee80211_dynamic_ps_timer(struct t - - void ieee80211_dfs_cac_timer_work(struct wiphy *wiphy, struct wiphy_work *work) - { -- struct ieee80211_sub_if_data *sdata = -- container_of(work, struct ieee80211_sub_if_data, -+ struct ieee80211_link_data *link = -+ container_of(work, struct ieee80211_link_data, - dfs_cac_timer_work.work); -- struct cfg80211_chan_def chandef = sdata->vif.bss_conf.chanreq.oper; -+ struct cfg80211_chan_def chandef = link->conf->chanreq.oper; -+ struct ieee80211_sub_if_data *sdata = link->sdata; - - lockdep_assert_wiphy(sdata->local->hw.wiphy); - - if (sdata->wdev.cac_started) { -- ieee80211_link_release_channel(&sdata->deflink); -+ ieee80211_link_release_channel(link); - cfg80211_cac_event(sdata->dev, &chandef, - NL80211_RADAR_CAC_FINISHED, - GFP_KERNEL); ---- a/net/mac80211/util.c -+++ b/net/mac80211/util.c -@@ -3460,7 +3460,7 @@ void ieee80211_dfs_cac_cancel(struct iee - - list_for_each_entry(sdata, &local->interfaces, list) { - wiphy_delayed_work_cancel(local->hw.wiphy, -- &sdata->dfs_cac_timer_work); -+ &sdata->deflink.dfs_cac_timer_work); - - if (sdata->wdev.cac_started) { - chandef = sdata->vif.bss_conf.chanreq.oper; diff --git a/package/kernel/mac80211/patches/subsys/353-wifi-mac80211-remove-status-ampdu_delimiter_crc.patch b/package/kernel/mac80211/patches/subsys/333-wifi-mac80211-remove-status-ampdu_delimiter_crc.patch similarity index 100% rename from package/kernel/mac80211/patches/subsys/353-wifi-mac80211-remove-status-ampdu_delimiter_crc.patch rename to package/kernel/mac80211/patches/subsys/333-wifi-mac80211-remove-status-ampdu_delimiter_crc.patch diff --git a/package/kernel/mac80211/patches/subsys/354-wifi-cfg80211-pass-net_device-to-.set_monitor_channel.patch b/package/kernel/mac80211/patches/subsys/334-wifi-cfg80211-pass-net_device-to-.set_monitor_channel.patch similarity index 98% rename from package/kernel/mac80211/patches/subsys/354-wifi-cfg80211-pass-net_device-to-.set_monitor_channel.patch rename to package/kernel/mac80211/patches/subsys/334-wifi-cfg80211-pass-net_device-to-.set_monitor_channel.patch index c2a915963c..ef8a36a9af 100644 --- a/package/kernel/mac80211/patches/subsys/354-wifi-cfg80211-pass-net_device-to-.set_monitor_channel.patch +++ b/package/kernel/mac80211/patches/subsys/334-wifi-cfg80211-pass-net_device-to-.set_monitor_channel.patch @@ -88,7 +88,7 @@ Signed-off-by: Felix Fietkau bool cfg80211_any_usable_channels(struct wiphy *wiphy, --- a/net/wireless/core.h +++ b/net/wireless/core.h -@@ -510,6 +510,7 @@ static inline unsigned int elapsed_jiffi +@@ -518,6 +518,7 @@ static inline unsigned int elapsed_jiffi } int cfg80211_set_monitor_channel(struct cfg80211_registered_device *rdev, diff --git a/package/kernel/mac80211/patches/subsys/334-wifi-mac80211-remove-label-usage-in-ieee80211_start_.patch b/package/kernel/mac80211/patches/subsys/334-wifi-mac80211-remove-label-usage-in-ieee80211_start_.patch deleted file mode 100644 index 329b645462..0000000000 --- a/package/kernel/mac80211/patches/subsys/334-wifi-mac80211-remove-label-usage-in-ieee80211_start_.patch +++ /dev/null @@ -1,50 +0,0 @@ -From: Aditya Kumar Singh -Date: Fri, 6 Sep 2024 12:14:20 +0530 -Subject: [PATCH] wifi: mac80211: remove label usage in - ieee80211_start_radar_detection() - -After locks rework [1], ieee80211_start_radar_detection() function is no -longer acquiring any lock as such explicitly. Hence, it is not unlocking -anything as well. However, label "out_unlock" is still used which creates -confusion. Also, now there is no need of goto label as such. - -Get rid of the goto logic and use direct return statements. - -[1]: https://lore.kernel.org/all/20230828135928.b1c6efffe9ad.I4aec875e25abc9ef0b5ad1e70b5747fd483fbd3c@changeid/ - -Signed-off-by: Aditya Kumar Singh -Link: https://patch.msgid.link/20240906064426.2101315-3-quic_adisi@quicinc.com -Signed-off-by: Johannes Berg ---- - ---- a/net/mac80211/cfg.c -+++ b/net/mac80211/cfg.c -@@ -3468,10 +3468,8 @@ static int ieee80211_start_radar_detecti - - lockdep_assert_wiphy(local->hw.wiphy); - -- if (!list_empty(&local->roc_list) || local->scanning) { -- err = -EBUSY; -- goto out_unlock; -- } -+ if (!list_empty(&local->roc_list) || local->scanning) -+ return -EBUSY; - - /* whatever, but channel contexts should not complain about that one */ - sdata->deflink.smps_mode = IEEE80211_SMPS_OFF; -@@ -3480,13 +3478,12 @@ static int ieee80211_start_radar_detecti - err = ieee80211_link_use_channel(&sdata->deflink, &chanreq, - IEEE80211_CHANCTX_SHARED); - if (err) -- goto out_unlock; -+ return err; - - wiphy_delayed_work_queue(wiphy, &sdata->deflink.dfs_cac_timer_work, - msecs_to_jiffies(cac_time_ms)); - -- out_unlock: -- return err; -+ return 0; - } - - static void ieee80211_end_cac(struct wiphy *wiphy, diff --git a/package/kernel/mac80211/patches/subsys/355-wifi-mac80211-add-flag-to-opt-out-of-virtual-monitor.patch b/package/kernel/mac80211/patches/subsys/335-wifi-mac80211-add-flag-to-opt-out-of-virtual-monitor.patch similarity index 93% rename from package/kernel/mac80211/patches/subsys/355-wifi-mac80211-add-flag-to-opt-out-of-virtual-monitor.patch rename to package/kernel/mac80211/patches/subsys/335-wifi-mac80211-add-flag-to-opt-out-of-virtual-monitor.patch index 2510cb0dbe..604abfd43f 100644 --- a/package/kernel/mac80211/patches/subsys/355-wifi-mac80211-add-flag-to-opt-out-of-virtual-monitor.patch +++ b/package/kernel/mac80211/patches/subsys/335-wifi-mac80211-add-flag-to-opt-out-of-virtual-monitor.patch @@ -95,7 +95,7 @@ Signed-off-by: Felix Fietkau if (ret) return ret; done: -@@ -3049,7 +3057,8 @@ static int ieee80211_set_tx_power(struct +@@ -3050,7 +3058,8 @@ static int ieee80211_set_tx_power(struct if (wdev) { sdata = IEEE80211_WDEV_TO_SUB_IF(wdev); @@ -105,7 +105,7 @@ Signed-off-by: Felix Fietkau if (!ieee80211_hw_check(&local->hw, WANT_MONITOR_VIF)) return -EOPNOTSUPP; -@@ -3097,7 +3106,8 @@ static int ieee80211_set_tx_power(struct +@@ -3098,7 +3107,8 @@ static int ieee80211_set_tx_power(struct } list_for_each_entry(sdata, &local->interfaces, list) { @@ -115,7 +115,7 @@ Signed-off-by: Felix Fietkau has_monitor = true; continue; } -@@ -3107,7 +3117,8 @@ static int ieee80211_set_tx_power(struct +@@ -3108,7 +3118,8 @@ static int ieee80211_set_tx_power(struct sdata->vif.bss_conf.txpower_type = txp_type; } list_for_each_entry(sdata, &local->interfaces, list) { @@ -125,7 +125,7 @@ Signed-off-by: Felix Fietkau continue; ieee80211_recalc_txpower(sdata, update_txp_type); } -@@ -4299,7 +4310,8 @@ static int ieee80211_cfg_get_channel(str +@@ -4303,7 +4314,8 @@ static int ieee80211_cfg_get_channel(str if (chanctx_conf) { *chandef = link->conf->chanreq.oper; ret = 0; @@ -137,7 +137,7 @@ Signed-off-by: Felix Fietkau *chandef = local->monitor_chanreq.oper; --- a/net/mac80211/chan.c +++ b/net/mac80211/chan.c -@@ -337,6 +337,10 @@ ieee80211_get_chanctx_max_required_bw(st +@@ -339,6 +339,10 @@ ieee80211_get_chanctx_max_required_bw(st case NL80211_IFTYPE_P2P_DEVICE: case NL80211_IFTYPE_NAN: continue; @@ -148,7 +148,7 @@ Signed-off-by: Felix Fietkau case NL80211_IFTYPE_ADHOC: case NL80211_IFTYPE_MESH_POINT: case NL80211_IFTYPE_OCB: -@@ -345,7 +349,6 @@ ieee80211_get_chanctx_max_required_bw(st +@@ -347,7 +351,6 @@ ieee80211_get_chanctx_max_required_bw(st case NL80211_IFTYPE_WDS: case NL80211_IFTYPE_UNSPECIFIED: case NUM_NL80211_IFTYPES: @@ -156,7 +156,7 @@ Signed-off-by: Felix Fietkau case NL80211_IFTYPE_P2P_CLIENT: case NL80211_IFTYPE_P2P_GO: WARN_ON_ONCE(1); -@@ -954,6 +957,10 @@ void ieee80211_recalc_smps_chanctx(struc +@@ -956,6 +959,10 @@ void ieee80211_recalc_smps_chanctx(struc if (!link->sdata->u.mgd.associated) continue; break; @@ -167,7 +167,7 @@ Signed-off-by: Felix Fietkau case NL80211_IFTYPE_AP: case NL80211_IFTYPE_ADHOC: case NL80211_IFTYPE_MESH_POINT: -@@ -966,6 +973,11 @@ void ieee80211_recalc_smps_chanctx(struc +@@ -968,6 +975,11 @@ void ieee80211_recalc_smps_chanctx(struc if (rcu_access_pointer(link->conf->chanctx_conf) != &chanctx->conf) continue; @@ -296,8 +296,8 @@ Signed-off-by: Felix Fietkau } --- a/net/mac80211/util.c +++ b/net/mac80211/util.c -@@ -754,7 +754,8 @@ static void __iterate_interfaces(struct - list_for_each_entry_rcu(sdata, &local->interfaces, list) { +@@ -739,7 +739,8 @@ static void __iterate_interfaces(struct + lockdep_is_held(&local->hw.wiphy->mtx)) { switch (sdata->vif.type) { case NL80211_IFTYPE_MONITOR: - if (!(sdata->u.mntr.flags & MONITOR_FLAG_ACTIVE)) @@ -306,7 +306,7 @@ Signed-off-by: Felix Fietkau continue; break; case NL80211_IFTYPE_AP_VLAN: -@@ -1857,8 +1858,10 @@ int ieee80211_reconfig(struct ieee80211_ +@@ -1856,8 +1857,10 @@ int ieee80211_reconfig(struct ieee80211_ } list_for_each_entry(sdata, &local->interfaces, list) { @@ -318,7 +318,7 @@ Signed-off-by: Felix Fietkau ieee80211_sdata_running(sdata)) { res = drv_add_interface(local, sdata); if (WARN_ON(res)) -@@ -1871,11 +1874,14 @@ int ieee80211_reconfig(struct ieee80211_ +@@ -1870,11 +1873,14 @@ int ieee80211_reconfig(struct ieee80211_ */ if (res) { list_for_each_entry_continue_reverse(sdata, &local->interfaces, diff --git a/package/kernel/mac80211/patches/subsys/335-wifi-trace-unlink-rdev_end_cac-trace-event-from-wiph.patch b/package/kernel/mac80211/patches/subsys/335-wifi-trace-unlink-rdev_end_cac-trace-event-from-wiph.patch deleted file mode 100644 index 98bc0c26fd..0000000000 --- a/package/kernel/mac80211/patches/subsys/335-wifi-trace-unlink-rdev_end_cac-trace-event-from-wiph.patch +++ /dev/null @@ -1,42 +0,0 @@ -From: Aditya Kumar Singh -Date: Fri, 6 Sep 2024 12:14:21 +0530 -Subject: [PATCH] wifi: trace: unlink rdev_end_cac trace event from - wiphy_netdev_evt class - -rdev_end_cac trace event is linked with wiphy_netdev_evt event class. -There is no option to pass link ID currently to wiphy_netdev_evt class. -A subsequent change would pass link ID to rdev_end_cac event and hence -it can no longer derive the event class from wiphy_netdev_evt. - -Therefore, unlink rdev_end_cac event from wiphy_netdev_evt and define it's -own independent trace event. Link ID would be passed in subsequent change. - -Signed-off-by: Aditya Kumar Singh -Link: https://patch.msgid.link/20240906064426.2101315-4-quic_adisi@quicinc.com -Signed-off-by: Johannes Berg ---- - ---- a/net/wireless/trace.h -+++ b/net/wireless/trace.h -@@ -805,9 +805,18 @@ DEFINE_EVENT(wiphy_netdev_evt, rdev_flus - TP_ARGS(wiphy, netdev) - ); - --DEFINE_EVENT(wiphy_netdev_evt, rdev_end_cac, -- TP_PROTO(struct wiphy *wiphy, struct net_device *netdev), -- TP_ARGS(wiphy, netdev) -+TRACE_EVENT(rdev_end_cac, -+ TP_PROTO(struct wiphy *wiphy, struct net_device *netdev), -+ TP_ARGS(wiphy, netdev), -+ TP_STRUCT__entry( -+ WIPHY_ENTRY -+ NETDEV_ENTRY -+ ), -+ TP_fast_assign( -+ WIPHY_ASSIGN; -+ NETDEV_ASSIGN; -+ ), -+ TP_printk(WIPHY_PR_FMT ", " NETDEV_PR_FMT, WIPHY_PR_ARG, NETDEV_PR_ARG) - ); - - DECLARE_EVENT_CLASS(station_add_change, diff --git a/package/kernel/mac80211/patches/subsys/356-wifi-cfg80211-add-monitor-SKIP_TX-flag.patch b/package/kernel/mac80211/patches/subsys/336-wifi-cfg80211-add-monitor-SKIP_TX-flag.patch similarity index 100% rename from package/kernel/mac80211/patches/subsys/356-wifi-cfg80211-add-monitor-SKIP_TX-flag.patch rename to package/kernel/mac80211/patches/subsys/336-wifi-cfg80211-add-monitor-SKIP_TX-flag.patch diff --git a/package/kernel/mac80211/patches/subsys/336-wifi-cfg80211-move-DFS-related-members-to-links-in-w.patch b/package/kernel/mac80211/patches/subsys/336-wifi-cfg80211-move-DFS-related-members-to-links-in-w.patch deleted file mode 100644 index 95dac04de5..0000000000 --- a/package/kernel/mac80211/patches/subsys/336-wifi-cfg80211-move-DFS-related-members-to-links-in-w.patch +++ /dev/null @@ -1,309 +0,0 @@ -From: Aditya Kumar Singh -Date: Fri, 6 Sep 2024 12:14:22 +0530 -Subject: [PATCH] wifi: cfg80211: move DFS related members to links[] in - wireless_dev - -A few members related to DFS handling are currently under per wireless -device data structure. However, in order to support DFS with MLO, there is -a need to have them on a per-link manner. - -Hence, as a preliminary step, move members cac_started, cac_start_time -and cac_time_ms to be on a per-link basis. - -Since currently, link ID is not known at all places, use default value of -0 for now. - -Signed-off-by: Aditya Kumar Singh -Link: https://patch.msgid.link/20240906064426.2101315-5-quic_adisi@quicinc.com -Signed-off-by: Johannes Berg ---- - ---- a/drivers/net/wireless/marvell/mwifiex/11h.c -+++ b/drivers/net/wireless/marvell/mwifiex/11h.c -@@ -117,7 +117,7 @@ void mwifiex_dfs_cac_work_queue(struct w - dfs_cac_work); - - chandef = priv->dfs_chandef; -- if (priv->wdev.cac_started) { -+ if (priv->wdev.links[0].cac_started) { - mwifiex_dbg(priv->adapter, MSG, - "CAC timer finished; No radar detected\n"); - cfg80211_cac_event(priv->netdev, &chandef, -@@ -174,7 +174,7 @@ int mwifiex_stop_radar_detection(struct - */ - void mwifiex_abort_cac(struct mwifiex_private *priv) - { -- if (priv->wdev.cac_started) { -+ if (priv->wdev.links[0].cac_started) { - if (mwifiex_stop_radar_detection(priv, &priv->dfs_chandef)) - mwifiex_dbg(priv->adapter, ERROR, - "failed to stop CAC in FW\n"); ---- a/drivers/net/wireless/marvell/mwifiex/cfg80211.c -+++ b/drivers/net/wireless/marvell/mwifiex/cfg80211.c -@@ -1880,7 +1880,7 @@ mwifiex_cfg80211_del_station(struct wiph - struct mwifiex_sta_node *sta_node; - u8 deauth_mac[ETH_ALEN]; - -- if (!priv->bss_started && priv->wdev.cac_started) { -+ if (!priv->bss_started && priv->wdev.links[0].cac_started) { - mwifiex_dbg(priv->adapter, INFO, "%s: abort CAC!\n", __func__); - mwifiex_abort_cac(priv); - } -@@ -3978,7 +3978,7 @@ mwifiex_cfg80211_channel_switch(struct w - return -EBUSY; - } - -- if (priv->wdev.cac_started) -+ if (priv->wdev.links[0].cac_started) - return -EBUSY; - - if (cfg80211_chandef_identical(¶ms->chandef, ---- a/drivers/net/wireless/quantenna/qtnfmac/event.c -+++ b/drivers/net/wireless/quantenna/qtnfmac/event.c -@@ -520,21 +520,21 @@ static int qtnf_event_handle_radar(struc - cfg80211_radar_event(wiphy, &chandef, GFP_KERNEL); - break; - case QLINK_RADAR_CAC_FINISHED: -- if (!vif->wdev.cac_started) -+ if (!vif->wdev.links[0].cac_started) - break; - - cfg80211_cac_event(vif->netdev, &chandef, - NL80211_RADAR_CAC_FINISHED, GFP_KERNEL); - break; - case QLINK_RADAR_CAC_ABORTED: -- if (!vif->wdev.cac_started) -+ if (!vif->wdev.links[0].cac_started) - break; - - cfg80211_cac_event(vif->netdev, &chandef, - NL80211_RADAR_CAC_ABORTED, GFP_KERNEL); - break; - case QLINK_RADAR_CAC_STARTED: -- if (vif->wdev.cac_started) -+ if (vif->wdev.links[0].cac_started) - break; - - if (!wiphy_ext_feature_isset(wiphy, ---- a/include/net/cfg80211.h -+++ b/include/net/cfg80211.h -@@ -6198,9 +6198,6 @@ enum ieee80211_ap_reg_power { - * @address: The address for this device, valid only if @netdev is %NULL - * @is_running: true if this is a non-netdev device that has been started, e.g. - * the P2P Device. -- * @cac_started: true if DFS channel availability check has been started -- * @cac_start_time: timestamp (jiffies) when the dfs state was entered. -- * @cac_time_ms: CAC time in ms - * @ps: powersave mode is enabled - * @ps_timeout: dynamic powersave timeout - * @ap_unexpected_nlportid: (private) netlink port ID of application -@@ -6224,6 +6221,11 @@ enum ieee80211_ap_reg_power { - * unprotected beacon report - * @links: array of %IEEE80211_MLD_MAX_NUM_LINKS elements containing @addr - * @ap and @client for each link -+ * @links[].cac_started: true if DFS channel availability check has been -+ * started -+ * @links[].cac_start_time: timestamp (jiffies) when the dfs state was -+ * entered. -+ * @links[].cac_time_ms: CAC time in ms - * @valid_links: bitmap describing what elements of @links are valid - */ - struct wireless_dev { -@@ -6265,11 +6267,6 @@ struct wireless_dev { - u32 owner_nlportid; - bool nl_owner_dead; - -- /* FIXME: need to rework radar detection for MLO */ -- bool cac_started; -- unsigned long cac_start_time; -- unsigned int cac_time_ms; -- - #ifdef CPTCFG_CFG80211_WEXT - /* wext data */ - struct { -@@ -6336,6 +6333,10 @@ struct wireless_dev { - struct cfg80211_internal_bss *current_bss; - } client; - }; -+ -+ bool cac_started; -+ unsigned long cac_start_time; -+ unsigned int cac_time_ms; - } links[IEEE80211_MLD_MAX_NUM_LINKS]; - u16 valid_links; - }; ---- a/net/mac80211/cfg.c -+++ b/net/mac80211/cfg.c -@@ -1656,7 +1656,7 @@ static int ieee80211_stop_ap(struct wiph - ieee80211_link_info_change_notify(sdata, link, - BSS_CHANGED_BEACON_ENABLED); - -- if (sdata->wdev.cac_started) { -+ if (sdata->wdev.links[0].cac_started) { - chandef = link_conf->chanreq.oper; - wiphy_delayed_work_cancel(wiphy, &link->dfs_cac_timer_work); - cfg80211_cac_event(sdata->dev, &chandef, -@@ -3498,9 +3498,9 @@ static void ieee80211_end_cac(struct wip - wiphy_delayed_work_cancel(wiphy, - &sdata->deflink.dfs_cac_timer_work); - -- if (sdata->wdev.cac_started) { -+ if (sdata->wdev.links[0].cac_started) { - ieee80211_link_release_channel(&sdata->deflink); -- sdata->wdev.cac_started = false; -+ sdata->wdev.links[0].cac_started = false; - } - } - } -@@ -3955,7 +3955,7 @@ __ieee80211_channel_switch(struct wiphy - if (!list_empty(&local->roc_list) || local->scanning) - return -EBUSY; - -- if (sdata->wdev.cac_started) -+ if (sdata->wdev.links[0].cac_started) - return -EBUSY; - - if (WARN_ON(link_id >= IEEE80211_MLD_MAX_NUM_LINKS)) ---- a/net/mac80211/iface.c -+++ b/net/mac80211/iface.c -@@ -553,7 +553,7 @@ static void ieee80211_do_stop(struct iee - wiphy_delayed_work_cancel(local->hw.wiphy, - &sdata->deflink.dfs_cac_timer_work); - -- if (sdata->wdev.cac_started) { -+ if (sdata->wdev.links[0].cac_started) { - chandef = sdata->vif.bss_conf.chanreq.oper; - WARN_ON(local->suspended); - ieee80211_link_release_channel(&sdata->deflink); ---- a/net/mac80211/mlme.c -+++ b/net/mac80211/mlme.c -@@ -3039,7 +3039,7 @@ void ieee80211_dfs_cac_timer_work(struct - - lockdep_assert_wiphy(sdata->local->hw.wiphy); - -- if (sdata->wdev.cac_started) { -+ if (sdata->wdev.links[0].cac_started) { - ieee80211_link_release_channel(link); - cfg80211_cac_event(sdata->dev, &chandef, - NL80211_RADAR_CAC_FINISHED, ---- a/net/mac80211/scan.c -+++ b/net/mac80211/scan.c -@@ -585,7 +585,7 @@ static bool __ieee80211_can_leave_ch(str - return false; - - list_for_each_entry(sdata_iter, &local->interfaces, list) { -- if (sdata_iter->wdev.cac_started) -+ if (sdata_iter->wdev.links[0].cac_started) - return false; - } - ---- a/net/mac80211/util.c -+++ b/net/mac80211/util.c -@@ -3462,7 +3462,7 @@ void ieee80211_dfs_cac_cancel(struct iee - wiphy_delayed_work_cancel(local->hw.wiphy, - &sdata->deflink.dfs_cac_timer_work); - -- if (sdata->wdev.cac_started) { -+ if (sdata->wdev.links[0].cac_started) { - chandef = sdata->vif.bss_conf.chanreq.oper; - ieee80211_link_release_channel(&sdata->deflink); - cfg80211_cac_event(sdata->dev, ---- a/net/wireless/ibss.c -+++ b/net/wireless/ibss.c -@@ -94,7 +94,7 @@ int __cfg80211_join_ibss(struct cfg80211 - - lockdep_assert_held(&rdev->wiphy.mtx); - -- if (wdev->cac_started) -+ if (wdev->links[0].cac_started) - return -EBUSY; - - if (wdev->u.ibss.ssid_len) ---- a/net/wireless/mesh.c -+++ b/net/wireless/mesh.c -@@ -127,7 +127,7 @@ int __cfg80211_join_mesh(struct cfg80211 - if (!rdev->ops->join_mesh) - return -EOPNOTSUPP; - -- if (wdev->cac_started) -+ if (wdev->links[0].cac_started) - return -EBUSY; - - if (!setup->chandef.chan) { ---- a/net/wireless/mlme.c -+++ b/net/wireless/mlme.c -@@ -1124,13 +1124,14 @@ void cfg80211_cac_event(struct net_devic - - trace_cfg80211_cac_event(netdev, event); - -- if (WARN_ON(!wdev->cac_started && event != NL80211_RADAR_CAC_STARTED)) -+ if (WARN_ON(!wdev->links[0].cac_started && -+ event != NL80211_RADAR_CAC_STARTED)) - return; - - switch (event) { - case NL80211_RADAR_CAC_FINISHED: -- timeout = wdev->cac_start_time + -- msecs_to_jiffies(wdev->cac_time_ms); -+ timeout = wdev->links[0].cac_start_time + -+ msecs_to_jiffies(wdev->links[0].cac_time_ms); - WARN_ON(!time_after_eq(jiffies, timeout)); - cfg80211_set_dfs_state(wiphy, chandef, NL80211_DFS_AVAILABLE); - memcpy(&rdev->cac_done_chandef, chandef, -@@ -1139,10 +1140,10 @@ void cfg80211_cac_event(struct net_devic - cfg80211_sched_dfs_chan_update(rdev); - fallthrough; - case NL80211_RADAR_CAC_ABORTED: -- wdev->cac_started = false; -+ wdev->links[0].cac_started = false; - break; - case NL80211_RADAR_CAC_STARTED: -- wdev->cac_started = true; -+ wdev->links[0].cac_started = true; - break; - default: - WARN_ON(1); ---- a/net/wireless/nl80211.c -+++ b/net/wireless/nl80211.c -@@ -6066,7 +6066,7 @@ static int nl80211_start_ap(struct sk_bu - if (!rdev->ops->start_ap) - return -EOPNOTSUPP; - -- if (wdev->cac_started) -+ if (wdev->links[0].cac_started) - return -EBUSY; - - if (wdev->links[link_id].ap.beacon_interval) -@@ -10122,7 +10122,7 @@ static int nl80211_start_radar_detection - goto unlock; - } - -- if (cfg80211_beaconing_iface_active(wdev) || wdev->cac_started) { -+ if (cfg80211_beaconing_iface_active(wdev) || wdev->links[0].cac_started) { - err = -EBUSY; - goto unlock; - } -@@ -10158,9 +10158,9 @@ static int nl80211_start_radar_detection - default: - break; - } -- wdev->cac_started = true; -- wdev->cac_start_time = jiffies; -- wdev->cac_time_ms = cac_time_ms; -+ wdev->links[0].cac_started = true; -+ wdev->links[0].cac_start_time = jiffies; -+ wdev->links[0].cac_time_ms = cac_time_ms; - } - unlock: - wiphy_unlock(wiphy); ---- a/net/wireless/reg.c -+++ b/net/wireless/reg.c -@@ -4241,7 +4241,7 @@ static void cfg80211_check_and_end_cac(s - list_for_each_entry(wdev, &rdev->wiphy.wdev_list, list) { - struct cfg80211_chan_def *chandef; - -- if (!wdev->cac_started) -+ if (!wdev->links[0].cac_started) - continue; - - /* FIXME: radar detection is tied to link 0 for now */ diff --git a/package/kernel/mac80211/patches/subsys/337-wifi-cfg80211-handle-DFS-per-link.patch b/package/kernel/mac80211/patches/subsys/337-wifi-cfg80211-handle-DFS-per-link.patch deleted file mode 100644 index a4e0333642..0000000000 --- a/package/kernel/mac80211/patches/subsys/337-wifi-cfg80211-handle-DFS-per-link.patch +++ /dev/null @@ -1,435 +0,0 @@ -From: Aditya Kumar Singh -Date: Fri, 6 Sep 2024 12:14:23 +0530 -Subject: [PATCH] wifi: cfg80211: handle DFS per link - -Currently, during starting a radar detection, no link id information is -parsed and passed down. In order to support starting radar detection -during Multi Link Operation, it is required to pass link id as well. - -Add changes to first parse and then pass link id in the start radar -detection path. - -Additionally, update notification APIs to allow drivers/mac80211 to -pass the link ID. - -However, everything is handled at link 0 only until all API's are ready to -handle it per link. - -Signed-off-by: Aditya Kumar Singh -Link: https://patch.msgid.link/20240906064426.2101315-6-quic_adisi@quicinc.com -Signed-off-by: Johannes Berg ---- - ---- a/drivers/net/wireless/marvell/mwifiex/11h.c -+++ b/drivers/net/wireless/marvell/mwifiex/11h.c -@@ -122,7 +122,7 @@ void mwifiex_dfs_cac_work_queue(struct w - "CAC timer finished; No radar detected\n"); - cfg80211_cac_event(priv->netdev, &chandef, - NL80211_RADAR_CAC_FINISHED, -- GFP_KERNEL); -+ GFP_KERNEL, 0); - } - } - -@@ -182,7 +182,8 @@ void mwifiex_abort_cac(struct mwifiex_pr - "Aborting delayed work for CAC.\n"); - cancel_delayed_work_sync(&priv->dfs_cac_work); - cfg80211_cac_event(priv->netdev, &priv->dfs_chandef, -- NL80211_RADAR_CAC_ABORTED, GFP_KERNEL); -+ NL80211_RADAR_CAC_ABORTED, GFP_KERNEL, -+ 0); - } - } - -@@ -221,7 +222,7 @@ int mwifiex_11h_handle_chanrpt_ready(str - cfg80211_cac_event(priv->netdev, - &priv->dfs_chandef, - NL80211_RADAR_DETECTED, -- GFP_KERNEL); -+ GFP_KERNEL, 0); - } - break; - default: ---- a/drivers/net/wireless/marvell/mwifiex/cfg80211.c -+++ b/drivers/net/wireless/marvell/mwifiex/cfg80211.c -@@ -4145,7 +4145,7 @@ static int - mwifiex_cfg80211_start_radar_detection(struct wiphy *wiphy, - struct net_device *dev, - struct cfg80211_chan_def *chandef, -- u32 cac_time_ms) -+ u32 cac_time_ms, int link_id) - { - struct mwifiex_private *priv = mwifiex_netdev_get_priv(dev); - struct mwifiex_radar_params radar_params; ---- a/drivers/net/wireless/quantenna/qtnfmac/cfg80211.c -+++ b/drivers/net/wireless/quantenna/qtnfmac/cfg80211.c -@@ -837,7 +837,7 @@ static int qtnf_channel_switch(struct wi - static int qtnf_start_radar_detection(struct wiphy *wiphy, - struct net_device *ndev, - struct cfg80211_chan_def *chandef, -- u32 cac_time_ms) -+ u32 cac_time_ms, int link_id) - { - struct qtnf_vif *vif = qtnf_netdev_get_priv(ndev); - int ret; ---- a/drivers/net/wireless/quantenna/qtnfmac/event.c -+++ b/drivers/net/wireless/quantenna/qtnfmac/event.c -@@ -524,14 +524,14 @@ static int qtnf_event_handle_radar(struc - break; - - cfg80211_cac_event(vif->netdev, &chandef, -- NL80211_RADAR_CAC_FINISHED, GFP_KERNEL); -+ NL80211_RADAR_CAC_FINISHED, GFP_KERNEL, 0); - break; - case QLINK_RADAR_CAC_ABORTED: - if (!vif->wdev.links[0].cac_started) - break; - - cfg80211_cac_event(vif->netdev, &chandef, -- NL80211_RADAR_CAC_ABORTED, GFP_KERNEL); -+ NL80211_RADAR_CAC_ABORTED, GFP_KERNEL, 0); - break; - case QLINK_RADAR_CAC_STARTED: - if (vif->wdev.links[0].cac_started) -@@ -542,7 +542,7 @@ static int qtnf_event_handle_radar(struc - break; - - cfg80211_cac_event(vif->netdev, &chandef, -- NL80211_RADAR_CAC_STARTED, GFP_KERNEL); -+ NL80211_RADAR_CAC_STARTED, GFP_KERNEL, 0); - break; - default: - pr_warn("%s: unhandled radar event %u\n", ---- a/include/net/cfg80211.h -+++ b/include/net/cfg80211.h -@@ -4841,9 +4841,9 @@ struct cfg80211_ops { - int (*start_radar_detection)(struct wiphy *wiphy, - struct net_device *dev, - struct cfg80211_chan_def *chandef, -- u32 cac_time_ms); -+ u32 cac_time_ms, int link_id); - void (*end_cac)(struct wiphy *wiphy, -- struct net_device *dev); -+ struct net_device *dev, unsigned int link_id); - int (*update_ft_ies)(struct wiphy *wiphy, struct net_device *dev, - struct cfg80211_update_ft_ies_params *ftie); - int (*crit_proto_start)(struct wiphy *wiphy, -@@ -8745,6 +8745,7 @@ void cfg80211_sta_opmode_change_notify(s - * @chandef: chandef for the current channel - * @event: type of event - * @gfp: context flags -+ * @link_id: valid link_id for MLO operation or 0 otherwise. - * - * This function is called when a Channel availability check (CAC) is finished - * or aborted. This must be called to notify the completion of a CAC process, -@@ -8752,7 +8753,8 @@ void cfg80211_sta_opmode_change_notify(s - */ - void cfg80211_cac_event(struct net_device *netdev, - const struct cfg80211_chan_def *chandef, -- enum nl80211_radar_event event, gfp_t gfp); -+ enum nl80211_radar_event event, gfp_t gfp, -+ unsigned int link_id); - - /** - * cfg80211_background_cac_abort - Channel Availability Check offchan abort event ---- a/net/mac80211/cfg.c -+++ b/net/mac80211/cfg.c -@@ -1661,7 +1661,7 @@ static int ieee80211_stop_ap(struct wiph - wiphy_delayed_work_cancel(wiphy, &link->dfs_cac_timer_work); - cfg80211_cac_event(sdata->dev, &chandef, - NL80211_RADAR_CAC_ABORTED, -- GFP_KERNEL); -+ GFP_KERNEL, 0); - } - - drv_stop_ap(sdata->local, sdata, link_conf); -@@ -3459,7 +3459,7 @@ static int ieee80211_set_bitrate_mask(st - static int ieee80211_start_radar_detection(struct wiphy *wiphy, - struct net_device *dev, - struct cfg80211_chan_def *chandef, -- u32 cac_time_ms) -+ u32 cac_time_ms, int link_id) - { - struct ieee80211_sub_if_data *sdata = IEEE80211_DEV_TO_SUB_IF(dev); - struct ieee80211_chan_req chanreq = { .oper = *chandef }; -@@ -3487,7 +3487,7 @@ static int ieee80211_start_radar_detecti - } - - static void ieee80211_end_cac(struct wiphy *wiphy, -- struct net_device *dev) -+ struct net_device *dev, unsigned int link_id) - { - struct ieee80211_sub_if_data *sdata = IEEE80211_DEV_TO_SUB_IF(dev); - struct ieee80211_local *local = sdata->local; ---- a/net/mac80211/iface.c -+++ b/net/mac80211/iface.c -@@ -559,7 +559,7 @@ static void ieee80211_do_stop(struct iee - ieee80211_link_release_channel(&sdata->deflink); - cfg80211_cac_event(sdata->dev, &chandef, - NL80211_RADAR_CAC_ABORTED, -- GFP_KERNEL); -+ GFP_KERNEL, 0); - } - - if (sdata->vif.type == NL80211_IFTYPE_AP) { ---- a/net/mac80211/mlme.c -+++ b/net/mac80211/mlme.c -@@ -3043,7 +3043,7 @@ void ieee80211_dfs_cac_timer_work(struct - ieee80211_link_release_channel(link); - cfg80211_cac_event(sdata->dev, &chandef, - NL80211_RADAR_CAC_FINISHED, -- GFP_KERNEL); -+ GFP_KERNEL, 0); - } - } - ---- a/net/mac80211/util.c -+++ b/net/mac80211/util.c -@@ -3468,7 +3468,7 @@ void ieee80211_dfs_cac_cancel(struct iee - cfg80211_cac_event(sdata->dev, - &chandef, - NL80211_RADAR_CAC_ABORTED, -- GFP_KERNEL); -+ GFP_KERNEL, 0); - } - } - } ---- a/net/wireless/mlme.c -+++ b/net/wireless/mlme.c -@@ -1111,18 +1111,19 @@ EXPORT_SYMBOL(__cfg80211_radar_event); - - void cfg80211_cac_event(struct net_device *netdev, - const struct cfg80211_chan_def *chandef, -- enum nl80211_radar_event event, gfp_t gfp) -+ enum nl80211_radar_event event, gfp_t gfp, -+ unsigned int link_id) - { - struct wireless_dev *wdev = netdev->ieee80211_ptr; - struct wiphy *wiphy = wdev->wiphy; - struct cfg80211_registered_device *rdev = wiphy_to_rdev(wiphy); - unsigned long timeout; - -- /* not yet supported */ -- if (wdev->valid_links) -+ if (WARN_ON(wdev->valid_links && -+ !(wdev->valid_links & BIT(link_id)))) - return; - -- trace_cfg80211_cac_event(netdev, event); -+ trace_cfg80211_cac_event(netdev, event, link_id); - - if (WARN_ON(!wdev->links[0].cac_started && - event != NL80211_RADAR_CAC_STARTED)) ---- a/net/wireless/nl80211.c -+++ b/net/wireless/nl80211.c -@@ -10122,7 +10122,20 @@ static int nl80211_start_radar_detection - goto unlock; - } - -- if (cfg80211_beaconing_iface_active(wdev) || wdev->links[0].cac_started) { -+ if (cfg80211_beaconing_iface_active(wdev)) { -+ /* During MLO other link(s) can beacon, only the current link -+ * can not already beacon -+ */ -+ if (wdev->valid_links && -+ !wdev->links[0].ap.beacon_interval) { -+ /* nothing */ -+ } else { -+ err = -EBUSY; -+ goto unlock; -+ } -+ } -+ -+ if (wdev->links[0].cac_started) { - err = -EBUSY; - goto unlock; - } -@@ -10142,7 +10155,8 @@ static int nl80211_start_radar_detection - if (WARN_ON(!cac_time_ms)) - cac_time_ms = IEEE80211_DFS_MIN_CAC_TIME_MS; - -- err = rdev_start_radar_detection(rdev, dev, &chandef, cac_time_ms); -+ err = rdev_start_radar_detection(rdev, dev, &chandef, cac_time_ms, -+ 0); - if (!err) { - switch (wdev->iftype) { - case NL80211_IFTYPE_AP: -@@ -16512,10 +16526,10 @@ nl80211_set_ttlm(struct sk_buff *skb, st - SELECTOR(__sel, NETDEV_UP_NOTMX, \ - NL80211_FLAG_NEED_NETDEV_UP | \ - NL80211_FLAG_NO_WIPHY_MTX) \ -- SELECTOR(__sel, NETDEV_UP_NOTMX_NOMLO, \ -+ SELECTOR(__sel, NETDEV_UP_NOTMX_MLO, \ - NL80211_FLAG_NEED_NETDEV_UP | \ - NL80211_FLAG_NO_WIPHY_MTX | \ -- NL80211_FLAG_MLO_UNSUPPORTED) \ -+ NL80211_FLAG_MLO_VALID_LINK_ID) \ - SELECTOR(__sel, NETDEV_UP_CLEAR, \ - NL80211_FLAG_NEED_NETDEV_UP | \ - NL80211_FLAG_CLEAR_SKB) \ -@@ -17410,7 +17424,7 @@ static const struct genl_small_ops nl802 - .flags = GENL_UNS_ADMIN_PERM, - .internal_flags = IFLAGS(NL80211_FLAG_NEED_NETDEV_UP | - NL80211_FLAG_NO_WIPHY_MTX | -- NL80211_FLAG_MLO_UNSUPPORTED), -+ NL80211_FLAG_MLO_VALID_LINK_ID), - }, - { - .cmd = NL80211_CMD_GET_PROTOCOL_FEATURES, ---- a/net/wireless/rdev-ops.h -+++ b/net/wireless/rdev-ops.h -@@ -1200,26 +1200,27 @@ static inline int - rdev_start_radar_detection(struct cfg80211_registered_device *rdev, - struct net_device *dev, - struct cfg80211_chan_def *chandef, -- u32 cac_time_ms) -+ u32 cac_time_ms, int link_id) - { - int ret = -EOPNOTSUPP; - - trace_rdev_start_radar_detection(&rdev->wiphy, dev, chandef, -- cac_time_ms); -+ cac_time_ms, link_id); - if (rdev->ops->start_radar_detection) - ret = rdev->ops->start_radar_detection(&rdev->wiphy, dev, -- chandef, cac_time_ms); -+ chandef, cac_time_ms, -+ link_id); - trace_rdev_return_int(&rdev->wiphy, ret); - return ret; - } - - static inline void - rdev_end_cac(struct cfg80211_registered_device *rdev, -- struct net_device *dev) -+ struct net_device *dev, unsigned int link_id) - { -- trace_rdev_end_cac(&rdev->wiphy, dev); -+ trace_rdev_end_cac(&rdev->wiphy, dev, link_id); - if (rdev->ops->end_cac) -- rdev->ops->end_cac(&rdev->wiphy, dev); -+ rdev->ops->end_cac(&rdev->wiphy, dev, link_id); - trace_rdev_return_void(&rdev->wiphy); - } - ---- a/net/wireless/reg.c -+++ b/net/wireless/reg.c -@@ -4229,6 +4229,8 @@ EXPORT_SYMBOL(regulatory_pre_cac_allowed - static void cfg80211_check_and_end_cac(struct cfg80211_registered_device *rdev) - { - struct wireless_dev *wdev; -+ unsigned int link_id; -+ - /* If we finished CAC or received radar, we should end any - * CAC running on the same channels. - * the check !cfg80211_chandef_dfs_usable contain 2 options: -@@ -4241,16 +4243,17 @@ static void cfg80211_check_and_end_cac(s - list_for_each_entry(wdev, &rdev->wiphy.wdev_list, list) { - struct cfg80211_chan_def *chandef; - -- if (!wdev->links[0].cac_started) -- continue; -+ for_each_valid_link(wdev, link_id) { -+ if (!wdev->links[link_id].cac_started) -+ continue; - -- /* FIXME: radar detection is tied to link 0 for now */ -- chandef = wdev_chandef(wdev, 0); -- if (!chandef) -- continue; -+ chandef = wdev_chandef(wdev, link_id); -+ if (!chandef) -+ continue; - -- if (!cfg80211_chandef_dfs_usable(&rdev->wiphy, chandef)) -- rdev_end_cac(rdev, wdev->netdev); -+ if (!cfg80211_chandef_dfs_usable(&rdev->wiphy, chandef)) -+ rdev_end_cac(rdev, wdev->netdev, link_id); -+ } - } - } - ---- a/net/wireless/trace.h -+++ b/net/wireless/trace.h -@@ -806,17 +806,21 @@ DEFINE_EVENT(wiphy_netdev_evt, rdev_flus - ); - - TRACE_EVENT(rdev_end_cac, -- TP_PROTO(struct wiphy *wiphy, struct net_device *netdev), -- TP_ARGS(wiphy, netdev), -+ TP_PROTO(struct wiphy *wiphy, struct net_device *netdev, -+ unsigned int link_id), -+ TP_ARGS(wiphy, netdev, link_id), - TP_STRUCT__entry( - WIPHY_ENTRY - NETDEV_ENTRY -+ __field(unsigned int, link_id) - ), - TP_fast_assign( - WIPHY_ASSIGN; - NETDEV_ASSIGN; -+ __entry->link_id = link_id; - ), -- TP_printk(WIPHY_PR_FMT ", " NETDEV_PR_FMT, WIPHY_PR_ARG, NETDEV_PR_ARG) -+ TP_printk(WIPHY_PR_FMT ", " NETDEV_PR_FMT ", link_id: %d", -+ WIPHY_PR_ARG, NETDEV_PR_ARG, __entry->link_id) - ); - - DECLARE_EVENT_CLASS(station_add_change, -@@ -2661,24 +2665,26 @@ TRACE_EVENT(rdev_external_auth, - TRACE_EVENT(rdev_start_radar_detection, - TP_PROTO(struct wiphy *wiphy, struct net_device *netdev, - struct cfg80211_chan_def *chandef, -- u32 cac_time_ms), -- TP_ARGS(wiphy, netdev, chandef, cac_time_ms), -+ u32 cac_time_ms, int link_id), -+ TP_ARGS(wiphy, netdev, chandef, cac_time_ms, link_id), - TP_STRUCT__entry( - WIPHY_ENTRY - NETDEV_ENTRY - CHAN_DEF_ENTRY - __field(u32, cac_time_ms) -+ __field(int, link_id) - ), - TP_fast_assign( - WIPHY_ASSIGN; - NETDEV_ASSIGN; - CHAN_DEF_ASSIGN(chandef); - __entry->cac_time_ms = cac_time_ms; -+ __entry->link_id = link_id; - ), - TP_printk(WIPHY_PR_FMT ", " NETDEV_PR_FMT ", " CHAN_DEF_PR_FMT -- ", cac_time_ms=%u", -+ ", cac_time_ms=%u, link_id=%d", - WIPHY_PR_ARG, NETDEV_PR_ARG, CHAN_DEF_PR_ARG, -- __entry->cac_time_ms) -+ __entry->cac_time_ms, __entry->link_id) - ); - - TRACE_EVENT(rdev_set_mcast_rate, -@@ -3492,18 +3498,21 @@ TRACE_EVENT(cfg80211_radar_event, - ); - - TRACE_EVENT(cfg80211_cac_event, -- TP_PROTO(struct net_device *netdev, enum nl80211_radar_event evt), -- TP_ARGS(netdev, evt), -+ TP_PROTO(struct net_device *netdev, enum nl80211_radar_event evt, -+ unsigned int link_id), -+ TP_ARGS(netdev, evt, link_id), - TP_STRUCT__entry( - NETDEV_ENTRY - __field(enum nl80211_radar_event, evt) -+ __field(unsigned int, link_id) - ), - TP_fast_assign( - NETDEV_ASSIGN; - __entry->evt = evt; -+ __entry->link_id = link_id; - ), -- TP_printk(NETDEV_PR_FMT ", event: %d", -- NETDEV_PR_ARG, __entry->evt) -+ TP_printk(NETDEV_PR_FMT ", event: %d, link_id=%u", -+ NETDEV_PR_ARG, __entry->evt, __entry->link_id) - ); - - DECLARE_EVENT_CLASS(cfg80211_rx_evt, diff --git a/package/kernel/mac80211/patches/subsys/357-wifi-mac80211-add-support-for-the-monitor-SKIP_TX-fl.patch b/package/kernel/mac80211/patches/subsys/337-wifi-mac80211-add-support-for-the-monitor-SKIP_TX-fl.patch similarity index 97% rename from package/kernel/mac80211/patches/subsys/357-wifi-mac80211-add-support-for-the-monitor-SKIP_TX-fl.patch rename to package/kernel/mac80211/patches/subsys/337-wifi-mac80211-add-support-for-the-monitor-SKIP_TX-fl.patch index e62c15c19d..d9e484eeba 100644 --- a/package/kernel/mac80211/patches/subsys/357-wifi-mac80211-add-support-for-the-monitor-SKIP_TX-fl.patch +++ b/package/kernel/mac80211/patches/subsys/337-wifi-mac80211-add-support-for-the-monitor-SKIP_TX-fl.patch @@ -11,7 +11,7 @@ Signed-off-by: Felix Fietkau --- a/net/mac80211/ieee80211_i.h +++ b/net/mac80211/ieee80211_i.h -@@ -1374,7 +1374,7 @@ struct ieee80211_local { +@@ -1373,7 +1373,7 @@ struct ieee80211_local { spinlock_t queue_stop_reason_lock; int open_count; diff --git a/package/kernel/mac80211/patches/subsys/338-wifi-mac80211-handle-DFS-per-link.patch b/package/kernel/mac80211/patches/subsys/338-wifi-mac80211-handle-DFS-per-link.patch deleted file mode 100644 index 388c0575c8..0000000000 --- a/package/kernel/mac80211/patches/subsys/338-wifi-mac80211-handle-DFS-per-link.patch +++ /dev/null @@ -1,134 +0,0 @@ -From: Aditya Kumar Singh -Date: Fri, 6 Sep 2024 12:14:24 +0530 -Subject: [PATCH] wifi: mac80211: handle DFS per link - -In order to support DFS with MLO, handle the link ID now passed from -cfg80211, adjust the code to do everything per link and call the -notifications to cfg80211 correctly. - -Signed-off-by: Aditya Kumar Singh -Link: https://patch.msgid.link/20240906064426.2101315-7-quic_adisi@quicinc.com -Signed-off-by: Johannes Berg ---- - ---- a/net/mac80211/cfg.c -+++ b/net/mac80211/cfg.c -@@ -3464,6 +3464,7 @@ static int ieee80211_start_radar_detecti - struct ieee80211_sub_if_data *sdata = IEEE80211_DEV_TO_SUB_IF(dev); - struct ieee80211_chan_req chanreq = { .oper = *chandef }; - struct ieee80211_local *local = sdata->local; -+ struct ieee80211_link_data *link_data; - int err; - - lockdep_assert_wiphy(local->hw.wiphy); -@@ -3471,16 +3472,20 @@ static int ieee80211_start_radar_detecti - if (!list_empty(&local->roc_list) || local->scanning) - return -EBUSY; - -+ link_data = sdata_dereference(sdata->link[link_id], sdata); -+ if (!link_data) -+ return -ENOLINK; -+ - /* whatever, but channel contexts should not complain about that one */ -- sdata->deflink.smps_mode = IEEE80211_SMPS_OFF; -- sdata->deflink.needed_rx_chains = local->rx_chains; -+ link_data->smps_mode = IEEE80211_SMPS_OFF; -+ link_data->needed_rx_chains = local->rx_chains; - -- err = ieee80211_link_use_channel(&sdata->deflink, &chanreq, -+ err = ieee80211_link_use_channel(link_data, &chanreq, - IEEE80211_CHANCTX_SHARED); - if (err) - return err; - -- wiphy_delayed_work_queue(wiphy, &sdata->deflink.dfs_cac_timer_work, -+ wiphy_delayed_work_queue(wiphy, &link_data->dfs_cac_timer_work, - msecs_to_jiffies(cac_time_ms)); - - return 0; -@@ -3491,16 +3496,21 @@ static void ieee80211_end_cac(struct wip - { - struct ieee80211_sub_if_data *sdata = IEEE80211_DEV_TO_SUB_IF(dev); - struct ieee80211_local *local = sdata->local; -+ struct ieee80211_link_data *link_data; - - lockdep_assert_wiphy(local->hw.wiphy); - - list_for_each_entry(sdata, &local->interfaces, list) { -+ link_data = sdata_dereference(sdata->link[link_id], sdata); -+ if (!link_data) -+ continue; -+ - wiphy_delayed_work_cancel(wiphy, -- &sdata->deflink.dfs_cac_timer_work); -+ &link_data->dfs_cac_timer_work); - -- if (sdata->wdev.links[0].cac_started) { -- ieee80211_link_release_channel(&sdata->deflink); -- sdata->wdev.links[0].cac_started = false; -+ if (sdata->wdev.links[link_id].cac_started) { -+ ieee80211_link_release_channel(link_data); -+ sdata->wdev.links[link_id].cac_started = false; - } - } - } ---- a/net/mac80211/link.c -+++ b/net/mac80211/link.c -@@ -77,6 +77,16 @@ void ieee80211_link_stop(struct ieee8021 - &link->color_change_finalize_work); - wiphy_work_cancel(link->sdata->local->hw.wiphy, - &link->csa.finalize_work); -+ -+ if (link->sdata->wdev.links[link->link_id].cac_started) { -+ wiphy_delayed_work_cancel(link->sdata->local->hw.wiphy, -+ &link->dfs_cac_timer_work); -+ cfg80211_cac_event(link->sdata->dev, -+ &link->conf->chanreq.oper, -+ NL80211_RADAR_CAC_ABORTED, -+ GFP_KERNEL, link->link_id); -+ } -+ - ieee80211_link_release_channel(link); - } - ---- a/net/mac80211/util.c -+++ b/net/mac80211/util.c -@@ -3455,20 +3455,30 @@ void ieee80211_dfs_cac_cancel(struct iee - { - struct ieee80211_sub_if_data *sdata; - struct cfg80211_chan_def chandef; -+ struct ieee80211_link_data *link; -+ unsigned int link_id; - - lockdep_assert_wiphy(local->hw.wiphy); - - list_for_each_entry(sdata, &local->interfaces, list) { -- wiphy_delayed_work_cancel(local->hw.wiphy, -- &sdata->deflink.dfs_cac_timer_work); -+ for (link_id = 0; link_id < IEEE80211_MLD_MAX_NUM_LINKS; -+ link_id++) { -+ link = sdata_dereference(sdata->link[link_id], -+ sdata); -+ if (!link) -+ continue; - -- if (sdata->wdev.links[0].cac_started) { -- chandef = sdata->vif.bss_conf.chanreq.oper; -- ieee80211_link_release_channel(&sdata->deflink); -- cfg80211_cac_event(sdata->dev, -- &chandef, -+ wiphy_delayed_work_cancel(local->hw.wiphy, -+ &link->dfs_cac_timer_work); -+ -+ if (!sdata->wdev.links[link_id].cac_started) -+ continue; -+ -+ chandef = link->conf->chanreq.oper; -+ ieee80211_link_release_channel(link); -+ cfg80211_cac_event(sdata->dev, &chandef, - NL80211_RADAR_CAC_ABORTED, -- GFP_KERNEL, 0); -+ GFP_KERNEL, link_id); - } - } - } diff --git a/package/kernel/mac80211/patches/subsys/358-wifi-mac80211-refactor-ieee80211_rx_monitor.patch b/package/kernel/mac80211/patches/subsys/338-wifi-mac80211-refactor-ieee80211_rx_monitor.patch similarity index 100% rename from package/kernel/mac80211/patches/subsys/358-wifi-mac80211-refactor-ieee80211_rx_monitor.patch rename to package/kernel/mac80211/patches/subsys/338-wifi-mac80211-refactor-ieee80211_rx_monitor.patch diff --git a/package/kernel/mac80211/patches/subsys/339-wifi-cfg80211-mac80211-use-proper-link-ID-for-DFS.patch b/package/kernel/mac80211/patches/subsys/339-wifi-cfg80211-mac80211-use-proper-link-ID-for-DFS.patch deleted file mode 100644 index 53079b6cf6..0000000000 --- a/package/kernel/mac80211/patches/subsys/339-wifi-cfg80211-mac80211-use-proper-link-ID-for-DFS.patch +++ /dev/null @@ -1,168 +0,0 @@ -From: Aditya Kumar Singh -Date: Fri, 6 Sep 2024 12:14:25 +0530 -Subject: [PATCH] wifi: cfg80211/mac80211: use proper link ID for DFS - -Now that all APIs have support to handle DFS per link, use proper link ID -instead of 0. - -Signed-off-by: Aditya Kumar Singh -Link: https://patch.msgid.link/20240906064426.2101315-8-quic_adisi@quicinc.com -Signed-off-by: Johannes Berg ---- - ---- a/net/mac80211/cfg.c -+++ b/net/mac80211/cfg.c -@@ -1656,12 +1656,12 @@ static int ieee80211_stop_ap(struct wiph - ieee80211_link_info_change_notify(sdata, link, - BSS_CHANGED_BEACON_ENABLED); - -- if (sdata->wdev.links[0].cac_started) { -+ if (sdata->wdev.links[link_id].cac_started) { - chandef = link_conf->chanreq.oper; - wiphy_delayed_work_cancel(wiphy, &link->dfs_cac_timer_work); - cfg80211_cac_event(sdata->dev, &chandef, - NL80211_RADAR_CAC_ABORTED, -- GFP_KERNEL, 0); -+ GFP_KERNEL, link_id); - } - - drv_stop_ap(sdata->local, sdata, link_conf); -@@ -3965,7 +3965,7 @@ __ieee80211_channel_switch(struct wiphy - if (!list_empty(&local->roc_list) || local->scanning) - return -EBUSY; - -- if (sdata->wdev.links[0].cac_started) -+ if (sdata->wdev.links[link_id].cac_started) - return -EBUSY; - - if (WARN_ON(link_id >= IEEE80211_MLD_MAX_NUM_LINKS)) ---- a/net/mac80211/mlme.c -+++ b/net/mac80211/mlme.c -@@ -3039,11 +3039,11 @@ void ieee80211_dfs_cac_timer_work(struct - - lockdep_assert_wiphy(sdata->local->hw.wiphy); - -- if (sdata->wdev.links[0].cac_started) { -+ if (sdata->wdev.links[link->link_id].cac_started) { - ieee80211_link_release_channel(link); - cfg80211_cac_event(sdata->dev, &chandef, - NL80211_RADAR_CAC_FINISHED, -- GFP_KERNEL, 0); -+ GFP_KERNEL, link->link_id); - } - } - ---- a/net/mac80211/scan.c -+++ b/net/mac80211/scan.c -@@ -575,6 +575,7 @@ static bool __ieee80211_can_leave_ch(str - { - struct ieee80211_local *local = sdata->local; - struct ieee80211_sub_if_data *sdata_iter; -+ unsigned int link_id; - - lockdep_assert_wiphy(local->hw.wiphy); - -@@ -585,8 +586,9 @@ static bool __ieee80211_can_leave_ch(str - return false; - - list_for_each_entry(sdata_iter, &local->interfaces, list) { -- if (sdata_iter->wdev.links[0].cac_started) -- return false; -+ for_each_valid_link(&sdata_iter->wdev, link_id) -+ if (sdata_iter->wdev.links[link_id].cac_started) -+ return false; - } - - return true; ---- a/net/wireless/mlme.c -+++ b/net/wireless/mlme.c -@@ -1125,14 +1125,14 @@ void cfg80211_cac_event(struct net_devic - - trace_cfg80211_cac_event(netdev, event, link_id); - -- if (WARN_ON(!wdev->links[0].cac_started && -+ if (WARN_ON(!wdev->links[link_id].cac_started && - event != NL80211_RADAR_CAC_STARTED)) - return; - - switch (event) { - case NL80211_RADAR_CAC_FINISHED: -- timeout = wdev->links[0].cac_start_time + -- msecs_to_jiffies(wdev->links[0].cac_time_ms); -+ timeout = wdev->links[link_id].cac_start_time + -+ msecs_to_jiffies(wdev->links[link_id].cac_time_ms); - WARN_ON(!time_after_eq(jiffies, timeout)); - cfg80211_set_dfs_state(wiphy, chandef, NL80211_DFS_AVAILABLE); - memcpy(&rdev->cac_done_chandef, chandef, -@@ -1141,10 +1141,10 @@ void cfg80211_cac_event(struct net_devic - cfg80211_sched_dfs_chan_update(rdev); - fallthrough; - case NL80211_RADAR_CAC_ABORTED: -- wdev->links[0].cac_started = false; -+ wdev->links[link_id].cac_started = false; - break; - case NL80211_RADAR_CAC_STARTED: -- wdev->links[0].cac_started = true; -+ wdev->links[link_id].cac_started = true; - break; - default: - WARN_ON(1); ---- a/net/wireless/nl80211.c -+++ b/net/wireless/nl80211.c -@@ -6066,7 +6066,7 @@ static int nl80211_start_ap(struct sk_bu - if (!rdev->ops->start_ap) - return -EOPNOTSUPP; - -- if (wdev->links[0].cac_started) -+ if (wdev->links[link_id].cac_started) - return -EBUSY; - - if (wdev->links[link_id].ap.beacon_interval) -@@ -10073,6 +10073,7 @@ static int nl80211_start_radar_detection - struct cfg80211_registered_device *rdev = info->user_ptr[0]; - struct net_device *dev = info->user_ptr[1]; - struct wireless_dev *wdev = dev->ieee80211_ptr; -+ int link_id = nl80211_link_id(info->attrs); - struct wiphy *wiphy = wdev->wiphy; - struct cfg80211_chan_def chandef; - enum nl80211_dfs_regions dfs_region; -@@ -10127,7 +10128,7 @@ static int nl80211_start_radar_detection - * can not already beacon - */ - if (wdev->valid_links && -- !wdev->links[0].ap.beacon_interval) { -+ !wdev->links[link_id].ap.beacon_interval) { - /* nothing */ - } else { - err = -EBUSY; -@@ -10135,7 +10136,7 @@ static int nl80211_start_radar_detection - } - } - -- if (wdev->links[0].cac_started) { -+ if (wdev->links[link_id].cac_started) { - err = -EBUSY; - goto unlock; - } -@@ -10156,7 +10157,7 @@ static int nl80211_start_radar_detection - cac_time_ms = IEEE80211_DFS_MIN_CAC_TIME_MS; - - err = rdev_start_radar_detection(rdev, dev, &chandef, cac_time_ms, -- 0); -+ link_id); - if (!err) { - switch (wdev->iftype) { - case NL80211_IFTYPE_AP: -@@ -10172,9 +10173,9 @@ static int nl80211_start_radar_detection - default: - break; - } -- wdev->links[0].cac_started = true; -- wdev->links[0].cac_start_time = jiffies; -- wdev->links[0].cac_time_ms = cac_time_ms; -+ wdev->links[link_id].cac_started = true; -+ wdev->links[link_id].cac_start_time = jiffies; -+ wdev->links[link_id].cac_time_ms = cac_time_ms; - } - unlock: - wiphy_unlock(wiphy); diff --git a/package/kernel/mac80211/patches/subsys/359-wifi-mac80211-filter-on-monitor-interfaces-based-on-.patch b/package/kernel/mac80211/patches/subsys/339-wifi-mac80211-filter-on-monitor-interfaces-based-on-.patch similarity index 100% rename from package/kernel/mac80211/patches/subsys/359-wifi-mac80211-filter-on-monitor-interfaces-based-on-.patch rename to package/kernel/mac80211/patches/subsys/339-wifi-mac80211-filter-on-monitor-interfaces-based-on-.patch diff --git a/package/kernel/mac80211/patches/subsys/360-wifi-cfg80211-report-per-wiphy-radio-antenna-mask.patch b/package/kernel/mac80211/patches/subsys/340-wifi-cfg80211-report-per-wiphy-radio-antenna-mask.patch similarity index 100% rename from package/kernel/mac80211/patches/subsys/360-wifi-cfg80211-report-per-wiphy-radio-antenna-mask.patch rename to package/kernel/mac80211/patches/subsys/340-wifi-cfg80211-report-per-wiphy-radio-antenna-mask.patch diff --git a/package/kernel/mac80211/patches/subsys/340-wifi-mac80211-handle-ieee80211_radar_detected-for-ML.patch b/package/kernel/mac80211/patches/subsys/340-wifi-mac80211-handle-ieee80211_radar_detected-for-ML.patch deleted file mode 100644 index 3f64864bd4..0000000000 --- a/package/kernel/mac80211/patches/subsys/340-wifi-mac80211-handle-ieee80211_radar_detected-for-ML.patch +++ /dev/null @@ -1,360 +0,0 @@ -From: Aditya Kumar Singh -Date: Fri, 6 Sep 2024 12:14:26 +0530 -Subject: [PATCH] wifi: mac80211: handle ieee80211_radar_detected() for MLO - -Currently DFS works under assumption there could be only one channel -context in the hardware. Hence, drivers just calls the function -ieee80211_radar_detected() passing the hardware structure. However, with -MLO, this obviously will not work since number of channel contexts will be -more than one and hence drivers would need to pass the channel information -as well on which the radar is detected. - -Also, when radar is detected in one of the links, other link's CAC should -not be cancelled. - -Hence, in order to support DFS with MLO, do the following changes - - * Add channel context conf pointer as an argument to the function - ieee80211_radar_detected(). During MLO, drivers would have to pass on - which channel context conf radar is detected. Otherwise, drivers could - just pass NULL. - * ieee80211_radar_detected() will iterate over all channel contexts - present and - * if channel context conf is passed, only mark that as radar - detected - * if NULL is passed, then mark all channel contexts as radar - detected - * Then as usual, schedule the radar detected work. - * In the worker, go over all the contexts again and for all such context - which is marked with radar detected, cancel the ongoing CAC by calling - ieee80211_dfs_cac_cancel() and then notify cfg80211 via - cfg80211_radar_event(). - * To cancel the CAC, pass the channel context as well where radar is - detected to ieee80211_dfs_cac_cancel(). This ensures that CAC is - canceled only on the links using the provided context, leaving other - links unaffected. - -This would also help in scenarios where there is split phy 5 GHz radio, -which is capable of DFS channels in both lower and upper band. In this -case, simultaneous radars can be detected. - -Signed-off-by: Aditya Kumar Singh -Link: https://patch.msgid.link/20240906064426.2101315-9-quic_adisi@quicinc.com -Signed-off-by: Johannes Berg ---- - ---- a/drivers/net/wireless/ath/ath10k/debug.c -+++ b/drivers/net/wireless/ath/ath10k/debug.c -@@ -3,7 +3,7 @@ - * Copyright (c) 2005-2011 Atheros Communications Inc. - * Copyright (c) 2011-2017 Qualcomm Atheros, Inc. - * Copyright (c) 2018, The Linux Foundation. All rights reserved. -- * Copyright (c) 2022 Qualcomm Innovation Center, Inc. All rights reserved. -+ * Copyright (c) 2022, 2024 Qualcomm Innovation Center, Inc. All rights reserved. - */ - - #include -@@ -1774,7 +1774,7 @@ static ssize_t ath10k_write_simulate_rad - if (!arvif->is_started) - return -EINVAL; - -- ieee80211_radar_detected(ar->hw); -+ ieee80211_radar_detected(ar->hw, NULL); - - return count; - } ---- a/drivers/net/wireless/ath/ath10k/mac.c -+++ b/drivers/net/wireless/ath/ath10k/mac.c -@@ -1437,7 +1437,7 @@ static void ath10k_recalc_radar_detectio - * by indicating that radar was detected. - */ - ath10k_warn(ar, "failed to start CAC: %d\n", ret); -- ieee80211_radar_detected(ar->hw); -+ ieee80211_radar_detected(ar->hw, NULL); - } - } - ---- a/drivers/net/wireless/ath/ath10k/wmi.c -+++ b/drivers/net/wireless/ath/ath10k/wmi.c -@@ -3990,7 +3990,7 @@ static void ath10k_radar_detected(struct - if (ar->dfs_block_radar_events) - ath10k_info(ar, "DFS Radar detected, but ignored as requested\n"); - else -- ieee80211_radar_detected(ar->hw); -+ ieee80211_radar_detected(ar->hw, NULL); - } - - static void ath10k_radar_confirmation_work(struct work_struct *work) ---- a/drivers/net/wireless/ath/ath11k/wmi.c -+++ b/drivers/net/wireless/ath/ath11k/wmi.c -@@ -8358,7 +8358,7 @@ ath11k_wmi_pdev_dfs_radar_detected_event - if (ar->dfs_block_radar_events) - ath11k_info(ab, "DFS Radar detected, but ignored as requested\n"); - else -- ieee80211_radar_detected(ar->hw); -+ ieee80211_radar_detected(ar->hw, NULL); - - exit: - rcu_read_unlock(); ---- a/drivers/net/wireless/ath/ath12k/wmi.c -+++ b/drivers/net/wireless/ath/ath12k/wmi.c -@@ -6789,7 +6789,7 @@ ath12k_wmi_pdev_dfs_radar_detected_event - if (ar->dfs_block_radar_events) - ath12k_info(ab, "DFS Radar detected, but ignored as requested\n"); - else -- ieee80211_radar_detected(ath12k_ar_to_hw(ar)); -+ ieee80211_radar_detected(ath12k_ar_to_hw(ar), NULL); - - exit: - rcu_read_unlock(); ---- a/drivers/net/wireless/ath/ath9k/dfs.c -+++ b/drivers/net/wireless/ath/ath9k/dfs.c -@@ -280,7 +280,7 @@ ath9k_dfs_process_radar_pulse(struct ath - if (!pd->add_pulse(pd, pe, NULL)) - return; - DFS_STAT_INC(sc, radar_detected); -- ieee80211_radar_detected(sc->hw); -+ ieee80211_radar_detected(sc->hw, NULL); - } - - /* ---- a/drivers/net/wireless/ath/ath9k/dfs_debug.c -+++ b/drivers/net/wireless/ath/ath9k/dfs_debug.c -@@ -116,7 +116,7 @@ static ssize_t write_file_simulate_radar - { - struct ath_softc *sc = file->private_data; - -- ieee80211_radar_detected(sc->hw); -+ ieee80211_radar_detected(sc->hw, NULL); - - return count; - } ---- a/drivers/net/wireless/mediatek/mt76/mt7615/mcu.c -+++ b/drivers/net/wireless/mediatek/mt76/mt7615/mcu.c -@@ -394,7 +394,7 @@ mt7615_mcu_rx_radar_detected(struct mt76 - if (mt76_phy_dfs_state(mphy) < MT_DFS_STATE_CAC) - return; - -- ieee80211_radar_detected(mphy->hw); -+ ieee80211_radar_detected(mphy->hw, NULL); - dev->hw_pattern++; - } - ---- a/drivers/net/wireless/mediatek/mt76/mt76x02_dfs.c -+++ b/drivers/net/wireless/mediatek/mt76/mt76x02_dfs.c -@@ -630,7 +630,7 @@ static void mt76x02_dfs_tasklet(struct t - radar_detected = mt76x02_dfs_check_detection(dev); - if (radar_detected) { - /* sw detector rx radar pattern */ -- ieee80211_radar_detected(dev->mt76.hw); -+ ieee80211_radar_detected(dev->mt76.hw, NULL); - mt76x02_dfs_detector_reset(dev); - - return; -@@ -658,7 +658,7 @@ static void mt76x02_dfs_tasklet(struct t - - /* hw detector rx radar pattern */ - dfs_pd->stats[i].hw_pattern++; -- ieee80211_radar_detected(dev->mt76.hw); -+ ieee80211_radar_detected(dev->mt76.hw, NULL); - mt76x02_dfs_detector_reset(dev); - - return; ---- a/drivers/net/wireless/mediatek/mt76/mt7915/mcu.c -+++ b/drivers/net/wireless/mediatek/mt76/mt7915/mcu.c -@@ -293,7 +293,7 @@ mt7915_mcu_rx_radar_detected(struct mt79 - &dev->rdd2_chandef, - GFP_ATOMIC); - else -- ieee80211_radar_detected(mphy->hw); -+ ieee80211_radar_detected(mphy->hw, NULL); - dev->hw_pattern++; - } - ---- a/drivers/net/wireless/mediatek/mt76/mt7996/mcu.c -+++ b/drivers/net/wireless/mediatek/mt76/mt7996/mcu.c -@@ -371,7 +371,7 @@ mt7996_mcu_rx_radar_detected(struct mt79 - &dev->rdd2_chandef, - GFP_ATOMIC); - else -- ieee80211_radar_detected(mphy->hw); -+ ieee80211_radar_detected(mphy->hw, NULL); - dev->hw_pattern++; - } - ---- a/drivers/net/wireless/ti/wl18xx/event.c -+++ b/drivers/net/wireless/ti/wl18xx/event.c -@@ -142,7 +142,7 @@ int wl18xx_process_mailbox_events(struct - wl18xx_radar_type_decode(mbox->radar_type)); - - if (!wl->radar_debug_mode) -- ieee80211_radar_detected(wl->hw); -+ ieee80211_radar_detected(wl->hw, NULL); - } - - if (vector & PERIODIC_SCAN_REPORT_EVENT_ID) { ---- a/drivers/net/wireless/virtual/mac80211_hwsim.c -+++ b/drivers/net/wireless/virtual/mac80211_hwsim.c -@@ -1146,7 +1146,7 @@ static int hwsim_write_simulate_radar(vo - { - struct mac80211_hwsim_data *data = dat; - -- ieee80211_radar_detected(data->hw); -+ ieee80211_radar_detected(data->hw, NULL); - - return 0; - } ---- a/include/net/mac80211.h -+++ b/include/net/mac80211.h -@@ -6717,8 +6717,11 @@ void ieee80211_cqm_beacon_loss_notify(st - * ieee80211_radar_detected - inform that a radar was detected - * - * @hw: pointer as obtained from ieee80211_alloc_hw() -+ * @chanctx_conf: Channel context on which radar is detected. Mandatory to -+ * pass a valid pointer during MLO. For non-MLO %NULL can be passed - */ --void ieee80211_radar_detected(struct ieee80211_hw *hw); -+void ieee80211_radar_detected(struct ieee80211_hw *hw, -+ struct ieee80211_chanctx_conf *chanctx_conf); - - /** - * ieee80211_chswitch_done - Complete channel switch process ---- a/net/mac80211/chan.c -+++ b/net/mac80211/chan.c -@@ -681,6 +681,7 @@ ieee80211_alloc_chanctx(struct ieee80211 - ctx->mode = mode; - ctx->conf.radar_enabled = false; - ctx->conf.radio_idx = radio_idx; -+ ctx->radar_detected = false; - _ieee80211_recalc_chanctx_min_def(local, ctx, NULL, false); - - return ctx; ---- a/net/mac80211/ieee80211_i.h -+++ b/net/mac80211/ieee80211_i.h -@@ -895,6 +895,8 @@ struct ieee80211_chanctx { - struct ieee80211_chan_req req; - - struct ieee80211_chanctx_conf conf; -+ -+ bool radar_detected; - }; - - struct mac80211_qos_map { -@@ -2632,7 +2634,8 @@ void ieee80211_recalc_chanctx_min_def(st - bool ieee80211_is_radar_required(struct ieee80211_local *local); - - void ieee80211_dfs_cac_timer_work(struct wiphy *wiphy, struct wiphy_work *work); --void ieee80211_dfs_cac_cancel(struct ieee80211_local *local); -+void ieee80211_dfs_cac_cancel(struct ieee80211_local *local, -+ struct ieee80211_chanctx *chanctx); - void ieee80211_dfs_radar_detected_work(struct wiphy *wiphy, - struct wiphy_work *work); - int ieee80211_send_action_csa(struct ieee80211_sub_if_data *sdata, ---- a/net/mac80211/pm.c -+++ b/net/mac80211/pm.c -@@ -32,7 +32,7 @@ int __ieee80211_suspend(struct ieee80211 - - ieee80211_scan_cancel(local); - -- ieee80211_dfs_cac_cancel(local); -+ ieee80211_dfs_cac_cancel(local, NULL); - - ieee80211_roc_purge(local, NULL); - ---- a/net/mac80211/util.c -+++ b/net/mac80211/util.c -@@ -3451,11 +3451,16 @@ u64 ieee80211_calculate_rx_timestamp(str - return ts; - } - --void ieee80211_dfs_cac_cancel(struct ieee80211_local *local) -+/* Cancel CAC for the interfaces under the specified @local. If @ctx is -+ * also provided, only the interfaces using that ctx will be canceled. -+ */ -+void ieee80211_dfs_cac_cancel(struct ieee80211_local *local, -+ struct ieee80211_chanctx *ctx) - { - struct ieee80211_sub_if_data *sdata; - struct cfg80211_chan_def chandef; - struct ieee80211_link_data *link; -+ struct ieee80211_chanctx_conf *chanctx_conf; - unsigned int link_id; - - lockdep_assert_wiphy(local->hw.wiphy); -@@ -3468,6 +3473,11 @@ void ieee80211_dfs_cac_cancel(struct iee - if (!link) - continue; - -+ chanctx_conf = sdata_dereference(link->conf->chanctx_conf, -+ sdata); -+ if (ctx && &ctx->conf != chanctx_conf) -+ continue; -+ - wiphy_delayed_work_cancel(local->hw.wiphy, - &link->dfs_cac_timer_work); - -@@ -3488,9 +3498,8 @@ void ieee80211_dfs_radar_detected_work(s - { - struct ieee80211_local *local = - container_of(work, struct ieee80211_local, radar_detected_work); -- struct cfg80211_chan_def chandef = local->hw.conf.chandef; -+ struct cfg80211_chan_def chandef; - struct ieee80211_chanctx *ctx; -- int num_chanctx = 0; - - lockdep_assert_wiphy(local->hw.wiphy); - -@@ -3498,25 +3507,46 @@ void ieee80211_dfs_radar_detected_work(s - if (ctx->replace_state == IEEE80211_CHANCTX_REPLACES_OTHER) - continue; - -- num_chanctx++; -+ if (!ctx->radar_detected) -+ continue; -+ -+ ctx->radar_detected = false; -+ - chandef = ctx->conf.def; -+ -+ ieee80211_dfs_cac_cancel(local, ctx); -+ cfg80211_radar_event(local->hw.wiphy, &chandef, GFP_KERNEL); - } -+} - -- ieee80211_dfs_cac_cancel(local); -+static void -+ieee80211_radar_mark_chan_ctx_iterator(struct ieee80211_hw *hw, -+ struct ieee80211_chanctx_conf *chanctx_conf, -+ void *data) -+{ -+ struct ieee80211_chanctx *ctx = -+ container_of(chanctx_conf, struct ieee80211_chanctx, -+ conf); - -- if (num_chanctx > 1) -- /* XXX: multi-channel is not supported yet */ -- WARN_ON(1); -- else -- cfg80211_radar_event(local->hw.wiphy, &chandef, GFP_KERNEL); -+ if (ctx->replace_state == IEEE80211_CHANCTX_REPLACES_OTHER) -+ return; -+ -+ if (data && data != chanctx_conf) -+ return; -+ -+ ctx->radar_detected = true; - } - --void ieee80211_radar_detected(struct ieee80211_hw *hw) -+void ieee80211_radar_detected(struct ieee80211_hw *hw, -+ struct ieee80211_chanctx_conf *chanctx_conf) - { - struct ieee80211_local *local = hw_to_local(hw); - - trace_api_radar_detected(local); - -+ ieee80211_iter_chan_contexts_atomic(hw, ieee80211_radar_mark_chan_ctx_iterator, -+ chanctx_conf); -+ - wiphy_work_queue(hw->wiphy, &local->radar_detected_work); - } - EXPORT_SYMBOL(ieee80211_radar_detected); diff --git a/package/kernel/mac80211/patches/subsys/361-wifi-mac80211-fix-vif-addr-when-switching-from-monit.patch b/package/kernel/mac80211/patches/subsys/341-wifi-mac80211-fix-vif-addr-when-switching-from-monit.patch similarity index 100% rename from package/kernel/mac80211/patches/subsys/361-wifi-mac80211-fix-vif-addr-when-switching-from-monit.patch rename to package/kernel/mac80211/patches/subsys/341-wifi-mac80211-fix-vif-addr-when-switching-from-monit.patch diff --git a/package/kernel/mac80211/patches/subsys/341-wifi-mac80211-skip-non-uploaded-keys-in-ieee80211_it.patch b/package/kernel/mac80211/patches/subsys/341-wifi-mac80211-skip-non-uploaded-keys-in-ieee80211_it.patch deleted file mode 100644 index b426d68c32..0000000000 --- a/package/kernel/mac80211/patches/subsys/341-wifi-mac80211-skip-non-uploaded-keys-in-ieee80211_it.patch +++ /dev/null @@ -1,79 +0,0 @@ -From: Felix Fietkau -Date: Sun, 6 Oct 2024 17:34:08 +0200 -Subject: [PATCH] wifi: mac80211: skip non-uploaded keys in ieee80211_iter_keys - -Sync iterator conditions with ieee80211_iter_keys_rcu. - -Fixes: 830af02f24fb ("mac80211: allow driver to iterate keys") -Signed-off-by: Felix Fietkau ---- - ---- a/net/mac80211/key.c -+++ b/net/mac80211/key.c -@@ -987,6 +987,26 @@ void ieee80211_reenable_keys(struct ieee - } - } - -+static void -+ieee80211_key_iter(struct ieee80211_hw *hw, -+ struct ieee80211_vif *vif, -+ struct ieee80211_key *key, -+ void (*iter)(struct ieee80211_hw *hw, -+ struct ieee80211_vif *vif, -+ struct ieee80211_sta *sta, -+ struct ieee80211_key_conf *key, -+ void *data), -+ void *iter_data) -+{ -+ /* skip keys of station in removal process */ -+ if (key->sta && key->sta->removed) -+ return; -+ if (!(key->flags & KEY_FLAG_UPLOADED_TO_HARDWARE)) -+ return; -+ iter(hw, vif, key->sta ? &key->sta->sta : NULL, -+ &key->conf, iter_data); -+} -+ - void ieee80211_iter_keys(struct ieee80211_hw *hw, - struct ieee80211_vif *vif, - void (*iter)(struct ieee80211_hw *hw, -@@ -1005,16 +1025,13 @@ void ieee80211_iter_keys(struct ieee8021 - if (vif) { - sdata = vif_to_sdata(vif); - list_for_each_entry_safe(key, tmp, &sdata->key_list, list) -- iter(hw, &sdata->vif, -- key->sta ? &key->sta->sta : NULL, -- &key->conf, iter_data); -+ ieee80211_key_iter(hw, vif, key, iter, iter_data); - } else { - list_for_each_entry(sdata, &local->interfaces, list) - list_for_each_entry_safe(key, tmp, - &sdata->key_list, list) -- iter(hw, &sdata->vif, -- key->sta ? &key->sta->sta : NULL, -- &key->conf, iter_data); -+ ieee80211_key_iter(hw, &sdata->vif, key, -+ iter, iter_data); - } - } - EXPORT_SYMBOL(ieee80211_iter_keys); -@@ -1031,17 +1048,8 @@ _ieee80211_iter_keys_rcu(struct ieee8021 - { - struct ieee80211_key *key; - -- list_for_each_entry_rcu(key, &sdata->key_list, list) { -- /* skip keys of station in removal process */ -- if (key->sta && key->sta->removed) -- continue; -- if (!(key->flags & KEY_FLAG_UPLOADED_TO_HARDWARE)) -- continue; -- -- iter(hw, &sdata->vif, -- key->sta ? &key->sta->sta : NULL, -- &key->conf, iter_data); -- } -+ list_for_each_entry_rcu(key, &sdata->key_list, list) -+ ieee80211_key_iter(hw, &sdata->vif, key, iter, iter_data); - } - - void ieee80211_iter_keys_rcu(struct ieee80211_hw *hw, diff --git a/package/kernel/mac80211/patches/subsys/362-wifi-mac80211-fix-incorrect-timing-to-initialize-sta.patch b/package/kernel/mac80211/patches/subsys/362-wifi-mac80211-fix-incorrect-timing-to-initialize-sta.patch deleted file mode 100644 index 94e51afd85..0000000000 --- a/package/kernel/mac80211/patches/subsys/362-wifi-mac80211-fix-incorrect-timing-to-initialize-sta.patch +++ /dev/null @@ -1,32 +0,0 @@ -From: Benjamin Lin -Date: Mon, 18 Nov 2024 16:07:22 +0800 -Subject: [PATCH] wifi: mac80211: fix incorrect timing to initialize - station NSS capability - -Station's spatial streaming capability should be initialized before -handling VHT OMN, because the handling requires the capability information. - -Fixes: a8bca3e9371d ("wifi: mac80211: track capability/opmode NSS separately") -Signed-off-by: Benjamin Lin ---- - ---- a/net/mac80211/cfg.c -+++ b/net/mac80211/cfg.c -@@ -1914,6 +1914,8 @@ static int sta_link_apply_parameters(str - params->eht_capa_len, - link_sta); - -+ ieee80211_sta_init_nss(link_sta); -+ - if (params->opmode_notif_used) { - /* returned value is only needed for rc update, but the - * rc isn't initialized here yet, so ignore it -@@ -1923,8 +1925,6 @@ static int sta_link_apply_parameters(str - sband->band); - } - -- ieee80211_sta_init_nss(link_sta); -- - return 0; - } - diff --git a/package/kernel/mac80211/patches/subsys/363-wifi-mac80211-ieee80211_i-Fix-memory-corruption-bug-.patch b/package/kernel/mac80211/patches/subsys/363-wifi-mac80211-ieee80211_i-Fix-memory-corruption-bug-.patch deleted file mode 100644 index dcdb89cd4a..0000000000 --- a/package/kernel/mac80211/patches/subsys/363-wifi-mac80211-ieee80211_i-Fix-memory-corruption-bug-.patch +++ /dev/null @@ -1,53 +0,0 @@ -From: "Gustavo A. R. Silva" -Date: Fri, 25 Oct 2024 16:05:50 -0600 -Subject: [PATCH] wifi: mac80211: ieee80211_i: Fix memory corruption bug in - struct ieee80211_chanctx - -Move the `struct ieee80211_chanctx_conf conf` to the end of -`struct ieee80211_chanctx` and fix a memory corruption bug -triggered e.g. in `hwsim_set_chanctx_magic()`: `radar_detected` -is being overwritten when `cp->magic = HWSIM_CHANCTX_MAGIC;` -See the function call sequence below: - -drv_add_chanctx(... struct ieee80211_chanctx *ctx) -> - local->ops->add_chanctx(&local->hw, &ctx->conf) -> - mac80211_hwsim_add_chanctx(... struct ieee80211_chanctx_conf *ctx) -> - hwsim_set_chanctx_magic(ctx) - -This also happens in a number of other drivers. - -Also, add a code comment to try to prevent people from introducing -new members after `struct ieee80211_chanctx_conf conf`. Notice that -`struct ieee80211_chanctx_conf` is a flexible structure --a structure -that contains a flexible-array member, so it should always be at -the end of any other containing structures. - -This change also fixes 50 of the following warnings: - -net/mac80211/ieee80211_i.h:895:39: warning: structure containing a flexible array member is not at the end of another structure [-Wflex-array-member-not-at-end] - --Wflex-array-member-not-at-end was introduced in GCC-14, and we are -getting ready to enable it, globally. - -Fixes: bca8bc0399ac ("wifi: mac80211: handle ieee80211_radar_detected() for MLO") -Signed-off-by: Gustavo A. R. Silva -Link: https://patch.msgid.link/ZxwWPrncTeSi1UTq@kspp -[also refer to other drivers in commit message] -Signed-off-by: Johannes Berg ---- - ---- a/net/mac80211/ieee80211_i.h -+++ b/net/mac80211/ieee80211_i.h -@@ -894,9 +894,10 @@ struct ieee80211_chanctx { - /* temporary data for search algorithm etc. */ - struct ieee80211_chan_req req; - -- struct ieee80211_chanctx_conf conf; -- - bool radar_detected; -+ -+ /* MUST be last - ends in a flexible-array member. */ -+ struct ieee80211_chanctx_conf conf; - }; - - struct mac80211_qos_map { diff --git a/package/kernel/mac80211/patches/subsys/364-mac80211-fix-user-power-when-emulating-chanctx.patch b/package/kernel/mac80211/patches/subsys/364-mac80211-fix-user-power-when-emulating-chanctx.patch deleted file mode 100644 index 15db2c54e4..0000000000 --- a/package/kernel/mac80211/patches/subsys/364-mac80211-fix-user-power-when-emulating-chanctx.patch +++ /dev/null @@ -1,24 +0,0 @@ -From: Ben Greear -Date: Thu, 10 Oct 2024 13:39:54 -0700 -Subject: [PATCH] mac80211: fix user-power when emulating chanctx - -ieee80211_calc_hw_conf_chan was ignoring the configured -user_txpower. If it is set, use it to potentially decrease -txpower as requested. - -Signed-off-by: Ben Greear -Link: https://patch.msgid.link/20241010203954.1219686-1-greearb@candelatech.com -Signed-off-by: Johannes Berg ---- - ---- a/net/mac80211/main.c -+++ b/net/mac80211/main.c -@@ -167,6 +167,8 @@ static u32 ieee80211_calc_hw_conf_chan(s - } - - power = ieee80211_chandef_max_power(&chandef); -+ if (local->user_power_level != IEEE80211_UNSET_POWER_LEVEL) -+ power = min(local->user_power_level, power); - - rcu_read_lock(); - list_for_each_entry_rcu(sdata, &local->interfaces, list) { diff --git a/package/kernel/mac80211/patches/subsys/365-wifi-cfg80211-Add-wiphy_delayed_work_pending.patch b/package/kernel/mac80211/patches/subsys/365-wifi-cfg80211-Add-wiphy_delayed_work_pending.patch deleted file mode 100644 index 981cc2433b..0000000000 --- a/package/kernel/mac80211/patches/subsys/365-wifi-cfg80211-Add-wiphy_delayed_work_pending.patch +++ /dev/null @@ -1,83 +0,0 @@ -From: Remi Pommarel -Date: Tue, 24 Sep 2024 21:28:04 +0200 -Subject: [PATCH] wifi: cfg80211: Add wiphy_delayed_work_pending() - -Add wiphy_delayed_work_pending() to check if any delayed work timer is -pending, that can be used to be sure that wiphy_delayed_work_queue() -won't postpone an already pending delayed work. - -Signed-off-by: Remi Pommarel -Link: https://patch.msgid.link/20240924192805.13859-2-repk@triplefau.lt -[fix return value kernel-doc] -Signed-off-by: Johannes Berg ---- - ---- a/include/net/cfg80211.h -+++ b/include/net/cfg80211.h -@@ -6141,6 +6141,50 @@ void wiphy_delayed_work_flush(struct wip - struct wiphy_delayed_work *dwork); - - /** -+ * wiphy_delayed_work_pending - Find out whether a wiphy delayable -+ * work item is currently pending. -+ * -+ * @wiphy: the wiphy, for debug purposes -+ * @dwork: the delayed work in question -+ * -+ * Return: true if timer is pending, false otherwise -+ * -+ * How wiphy_delayed_work_queue() works is by setting a timer which -+ * when it expires calls wiphy_work_queue() to queue the wiphy work. -+ * Because wiphy_delayed_work_queue() uses mod_timer(), if it is -+ * called twice and the second call happens before the first call -+ * deadline, the work will rescheduled for the second deadline and -+ * won't run before that. -+ * -+ * wiphy_delayed_work_pending() can be used to detect if calling -+ * wiphy_work_delayed_work_queue() would start a new work schedule -+ * or delayed a previous one. As seen below it cannot be used to -+ * detect precisely if the work has finished to execute nor if it -+ * is currently executing. -+ * -+ * CPU0 CPU1 -+ * wiphy_delayed_work_queue(wk) -+ * mod_timer(wk->timer) -+ * wiphy_delayed_work_pending(wk) -> true -+ * -+ * [...] -+ * expire_timers(wk->timer) -+ * detach_timer(wk->timer) -+ * wiphy_delayed_work_pending(wk) -> false -+ * wk->timer->function() | -+ * wiphy_work_queue(wk) | delayed work pending -+ * list_add_tail() | returns false but -+ * queue_work(cfg80211_wiphy_work) | wk->func() has not -+ * | been run yet -+ * [...] | -+ * cfg80211_wiphy_work() | -+ * wk->func() V -+ * -+ */ -+bool wiphy_delayed_work_pending(struct wiphy *wiphy, -+ struct wiphy_delayed_work *dwork); -+ -+/** - * enum ieee80211_ap_reg_power - regulatory power for an Access Point - * - * @IEEE80211_REG_UNSET_AP: Access Point has no regulatory power mode ---- a/net/wireless/core.c -+++ b/net/wireless/core.c -@@ -1735,6 +1735,13 @@ void wiphy_delayed_work_flush(struct wip - } - EXPORT_SYMBOL_GPL(wiphy_delayed_work_flush); - -+bool wiphy_delayed_work_pending(struct wiphy *wiphy, -+ struct wiphy_delayed_work *dwork) -+{ -+ return timer_pending(&dwork->timer); -+} -+EXPORT_SYMBOL_GPL(wiphy_delayed_work_pending); -+ - static int __init cfg80211_init(void) - { - int err; diff --git a/package/kernel/mac80211/patches/subsys/366-wifi-mac80211-Convert-color-collision-detection-to-w.patch b/package/kernel/mac80211/patches/subsys/366-wifi-mac80211-Convert-color-collision-detection-to-w.patch deleted file mode 100644 index ae72441c46..0000000000 --- a/package/kernel/mac80211/patches/subsys/366-wifi-mac80211-Convert-color-collision-detection-to-w.patch +++ /dev/null @@ -1,148 +0,0 @@ -From: Remi Pommarel -Date: Tue, 24 Sep 2024 21:28:05 +0200 -Subject: [PATCH] wifi: mac80211: Convert color collision detection to wiphy - work - -Call to ieee80211_color_collision_detection_work() needs wiphy lock to -be held (see lockdep assert in cfg80211_bss_color_notify()). Not locking -wiphy causes the following lockdep error: - - WARNING: CPU: 2 PID: 42 at net/wireless/nl80211.c:19505 cfg80211_bss_color_notify+0x1a4/0x25c - Modules linked in: - CPU: 2 PID: 42 Comm: kworker/u8:3 Tainted: G W 6.4.0-02327-g36c6cb260481 #1048 - Hardware name: - Workqueue: phy1 ieee80211_color_collision_detection_work - pstate: 60000005 (nZCv daif -PAN -UAO -TCO -DIT -SSBS BTYPE=--) - pc : cfg80211_bss_color_notify+0x1a4/0x25c - lr : cfg80211_bss_color_notify+0x1a0/0x25c - sp : ffff000002947d00 - x29: ffff000002947d00 x28: ffff800008e1a000 x27: ffff000002bd4705 - x26: ffff00000d034000 x25: ffff80000903cf40 x24: 0000000000000000 - x23: ffff00000cb70720 x22: 0000000000800000 x21: ffff800008dfb008 - x20: 000000000000008d x19: ffff00000d035fa8 x18: 0000000000000010 - x17: 0000000000000001 x16: 000003564b1ce96a x15: 000d69696d057970 - x14: 000000000000003b x13: 0000000000000001 x12: 0000000000040000 - x11: 0000000000000001 x10: ffff80000978f9c0 x9 : ffff0000028d3174 - x8 : ffff800008e30000 x7 : 0000000000000000 x6 : 0000000000000028 - x5 : 000000000002f498 x4 : ffff00000d034a80 x3 : 0000000000800000 - x2 : ffff800016143000 x1 : 0000000000000000 x0 : 0000000000000000 - Call trace: - cfg80211_bss_color_notify+0x1a4/0x25c - ieee80211_color_collision_detection_work+0x20/0x118 - process_one_work+0x294/0x554 - worker_thread+0x70/0x440 - kthread+0xf4/0xf8 - ret_from_fork+0x10/0x20 - irq event stamp: 77372 - hardirqs last enabled at (77371): [] _raw_spin_unlock_irq+0x2c/0x4c - hardirqs last disabled at (77372): [] el1_dbg+0x20/0x48 - softirqs last enabled at (77350): [] batadv_send_outstanding_bcast_packet+0xb8/0x120 - softirqs last disabled at (77348): [] batadv_send_outstanding_bcast_packet+0x80/0x120 - -The wiphy lock cannot be taken directly from color collision detection -delayed work (ieee80211_color_collision_detection_work()) because this -work is cancel_delayed_work_sync() under this wiphy lock causing a -potential deadlock( see [0] for details). - -To fix that ieee80211_color_collision_detection_work() could be -converted to a wiphy work and cancel_delayed_work_sync() can be simply -replaced by wiphy_delayed_work_cancel() serving the same purpose under -wiphy lock. - -This could potentially fix [1]. - -[0]: https://lore.kernel.org/linux-wireless/D4A40Q44OAY2.W3SIF6UEPBUN@freebox.fr/ -[1]: https://lore.kernel.org/lkml/000000000000612f290618eee3e5@google.com/ - -Reported-by: Nicolas Escande -Signed-off-by: Remi Pommarel -Link: https://patch.msgid.link/20240924192805.13859-3-repk@triplefau.lt -Signed-off-by: Johannes Berg ---- - ---- a/net/mac80211/cfg.c -+++ b/net/mac80211/cfg.c -@@ -4836,12 +4836,12 @@ void ieee80211_color_change_finalize_wor - ieee80211_color_change_finalize(link); - } - --void ieee80211_color_collision_detection_work(struct work_struct *work) -+void ieee80211_color_collision_detection_work(struct wiphy *wiphy, -+ struct wiphy_work *work) - { -- struct delayed_work *delayed_work = to_delayed_work(work); - struct ieee80211_link_data *link = -- container_of(delayed_work, struct ieee80211_link_data, -- color_collision_detect_work); -+ container_of(work, struct ieee80211_link_data, -+ color_collision_detect_work.work); - struct ieee80211_sub_if_data *sdata = link->sdata; - - cfg80211_obss_color_collision_notify(sdata->dev, link->color_bitmap, -@@ -4894,7 +4894,8 @@ ieee80211_obss_color_collision_notify(st - return; - } - -- if (delayed_work_pending(&link->color_collision_detect_work)) { -+ if (wiphy_delayed_work_pending(sdata->local->hw.wiphy, -+ &link->color_collision_detect_work)) { - rcu_read_unlock(); - return; - } -@@ -4903,9 +4904,9 @@ ieee80211_obss_color_collision_notify(st - /* queue the color collision detection event every 500 ms in order to - * avoid sending too much netlink messages to userspace. - */ -- ieee80211_queue_delayed_work(&sdata->local->hw, -- &link->color_collision_detect_work, -- msecs_to_jiffies(500)); -+ wiphy_delayed_work_queue(sdata->local->hw.wiphy, -+ &link->color_collision_detect_work, -+ msecs_to_jiffies(500)); - - rcu_read_unlock(); - } ---- a/net/mac80211/ieee80211_i.h -+++ b/net/mac80211/ieee80211_i.h -@@ -1056,7 +1056,7 @@ struct ieee80211_link_data { - } csa; - - struct wiphy_work color_change_finalize_work; -- struct delayed_work color_collision_detect_work; -+ struct wiphy_delayed_work color_collision_detect_work; - u64 color_bitmap; - - /* context reservation -- protected with wiphy mutex */ -@@ -2010,7 +2010,8 @@ int ieee80211_channel_switch(struct wiph - /* color change handling */ - void ieee80211_color_change_finalize_work(struct wiphy *wiphy, - struct wiphy_work *work); --void ieee80211_color_collision_detection_work(struct work_struct *work); -+void ieee80211_color_collision_detection_work(struct wiphy *wiphy, -+ struct wiphy_work *work); - - /* interface handling */ - #define MAC80211_SUPPORTED_FEATURES_TX (NETIF_F_IP_CSUM | NETIF_F_IPV6_CSUM | \ ---- a/net/mac80211/link.c -+++ b/net/mac80211/link.c -@@ -41,8 +41,8 @@ void ieee80211_link_init(struct ieee8021 - ieee80211_csa_finalize_work); - wiphy_work_init(&link->color_change_finalize_work, - ieee80211_color_change_finalize_work); -- INIT_DELAYED_WORK(&link->color_collision_detect_work, -- ieee80211_color_collision_detection_work); -+ wiphy_delayed_work_init(&link->color_collision_detect_work, -+ ieee80211_color_collision_detection_work); - INIT_LIST_HEAD(&link->assigned_chanctx_list); - INIT_LIST_HEAD(&link->reserved_chanctx_list); - wiphy_delayed_work_init(&link->dfs_cac_timer_work, -@@ -72,7 +72,8 @@ void ieee80211_link_stop(struct ieee8021 - if (link->sdata->vif.type == NL80211_IFTYPE_STATION) - ieee80211_mgd_stop_link(link); - -- cancel_delayed_work_sync(&link->color_collision_detect_work); -+ wiphy_delayed_work_cancel(link->sdata->local->hw.wiphy, -+ &link->color_collision_detect_work); - wiphy_work_cancel(link->sdata->local->hw.wiphy, - &link->color_change_finalize_work); - wiphy_work_cancel(link->sdata->local->hw.wiphy, From 3ad92b68f1c51855069d9b3c63b1e76a109e8444 Mon Sep 17 00:00:00 2001 From: Felix Fietkau Date: Mon, 30 Dec 2024 21:27:46 +0100 Subject: [PATCH 04/22] mt76: update to Git HEAD (2024-12-30) 109114146f9c mt76: only enable tx worker after setting the channel 5fe42ec88fd1 mt76: mt7915: ensure that only one sta entry is active per mac address 1884f568ba02 wifi: mt76: do not add wcid entries to sta poll list during MCU reset 71fa9124d107 wifi: mt76: mt7996: fix NULL pointer dereference in mt7996_mcu_sta_bfer_he eb85bb3fd5bf wifi: mt76: mt7915: fix eifs value on older chipsets 83e4d4a82e65 wifi: mt76: introduce mt792x_config_mac_addr_list routine b47e20b440ae wifi: mt76: mt7925: fix NULL deref check in mt7925_change_vif_links 3e3c484726f3 wifi: mt76: mt7925: fix wrong band_idx setting when enable sniffer mode 3f1401a0f035 wifi: mt76: mt7925: fix get wrong chip cap from incorrect pointer eede99f524e8 wifi: mt76: mt7925: fix the invalid ip address for arp offload c99e4d51b340 wifi: mt76: mt7996: fix overflows seen when writing limit attributes af983b2543ed wifi: mt76: mt7915: fix overflows seen when writing limit attributes af494e2dcc94 wifi: mt76: mt7915: exclude tx backoff time from airtime 6f6a1f7cb381 wifi: mt76: mt7996: exclude tx backoff time from airtime 7f65b1b28b4c wifi: mt76: connac: Extend mt76_connac_mcu_uni_add_dev for MLO 1b5e6abc2e7a wifi: mt76: mt7925: Fix incorrect MLD address in bss_mld_tlv for MLO support 72b4688b3912 wifi: mt76: mt7925: Fix incorrect WCID assignment for MLO 6bd2c044e67a wifi: mt76: mt7925: Fix incorrect WCID phy_idx assignment 1c04e9693466 wifi: mt76: mt7925: fix wrong parameter for related cmd of chan info 01e02947bdbf wifi: mt76: mt7925: Fix CNM Timeout with Single Active Link in MLO b90b1a1dc71b wifi: mt76: mt7925: Enhance mt7925_mac_link_bss_add to support MLO 53ec7a551f17 wifi: mt76: Enhance mt7925_mac_link_sta_add to support MLO 3c99ef40e0e7 wifi: mt76: mt7925: Update mt7925_mcu_sta_update for BC in ASSOC state 285efc6afaec wifi: mt76: mt7925: Update mt792x_rx_get_wcid for per-link STA e5c0d1289e6c wifi: mt76: mt7925: Update mt7925_unassign_vif_chanctx for per-link BSS 67dcd5c888c4 wifi: mt76: mt7925: Update secondary link PS flow fd4d6f87072f wifi: mt76: mt7925: Init secondary link PM state 6d972b5b9d6a wifi: mt76: mt7925: Update mt7925_mcu_uni_[tx,rx]_ba for MLO 3acc6cbb9556 wifi: mt76: mt7925: Cleanup MLO settings post-disconnection 0aab0c61ce92 wifi: mt76: mt7925: Properly handle responses for commands with events 15bead1b0041 wifi: mt76: do not hold queue lock during initial rx buffer alloc 732044a949d5 wifi: mt76: mt7925: config the dwell time by firmware 9ba311ec6afa wifi: mt76: mt7921: introduce CSA support 5d12c7404c22 wifi: mt76: mt7921: add rfkill_poll for hardware rfkill ef965d408b79 wifi: mt76: mt7925: replace zero-length array with flexible-array member f8563589c72d wifi: mt76: mt7921u: Add VID/PID for TP-Link TXE50UH Signed-off-by: Felix Fietkau (cherry picked from commit bff5260d7b2f706f6d32acbb4fbe5f10d7acca5c) --- package/kernel/mt76/Makefile | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/package/kernel/mt76/Makefile b/package/kernel/mt76/Makefile index b5cdc76572..d7fd80d331 100644 --- a/package/kernel/mt76/Makefile +++ b/package/kernel/mt76/Makefile @@ -8,9 +8,9 @@ PKG_LICENSE_FILES:= PKG_SOURCE_URL:=https://github.com/openwrt/mt76 PKG_SOURCE_PROTO:=git -PKG_SOURCE_DATE:=2024-10-28 -PKG_SOURCE_VERSION:=c246fa545119abe5097682316700f13c91399042 -PKG_MIRROR_HASH:=ff59d9588e6b114be8fe08013b55da975bc6bb4219b97b6fedb72246e9337c18 +PKG_SOURCE_DATE:=2024-12-30 +PKG_SOURCE_VERSION:=f8563589c72d93c35f9316c65de361061b785699 +PKG_MIRROR_HASH:=aba3906b44d7dc952add8786ab46a27512d04efbd3e6a7a40526707a2ff87445 PKG_MAINTAINER:=Felix Fietkau PKG_USE_NINJA:=0 From 85d1d03cab4068c7a36e9bc9a0aa9e0e93325657 Mon Sep 17 00:00:00 2001 From: Felix Fietkau Date: Fri, 3 Jan 2025 11:06:08 +0100 Subject: [PATCH 05/22] mt76: update to Git HEAD (2025-01-03) 46715044ecd2 wifi: mt76: mt7996: implement driver specific get_txpower function 959a2d40007f wifi: mt76: mt7996: initialize phy txpower Signed-off-by: Felix Fietkau (cherry picked from commit 65aff89f641f6adccac80ee73b02b99a904739d5) --- package/kernel/mt76/Makefile | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/package/kernel/mt76/Makefile b/package/kernel/mt76/Makefile index d7fd80d331..d603b6215f 100644 --- a/package/kernel/mt76/Makefile +++ b/package/kernel/mt76/Makefile @@ -8,9 +8,9 @@ PKG_LICENSE_FILES:= PKG_SOURCE_URL:=https://github.com/openwrt/mt76 PKG_SOURCE_PROTO:=git -PKG_SOURCE_DATE:=2024-12-30 -PKG_SOURCE_VERSION:=f8563589c72d93c35f9316c65de361061b785699 -PKG_MIRROR_HASH:=aba3906b44d7dc952add8786ab46a27512d04efbd3e6a7a40526707a2ff87445 +PKG_SOURCE_DATE:=2025-01-03 +PKG_SOURCE_VERSION:=959a2d40007f502d9465b8aede79e761f875abd3 +PKG_MIRROR_HASH:=a00a26a4685c053a639a95657804b09d0d4a1452744647871070beb6332b7c3a PKG_MAINTAINER:=Felix Fietkau PKG_USE_NINJA:=0 From 83afb428b089aa46e05744935aa25358a67a8b23 Mon Sep 17 00:00:00 2001 From: Felix Fietkau Date: Mon, 11 Nov 2024 19:52:14 +0100 Subject: [PATCH 06/22] build: remove broken dependency of metadata on toplevel .config variables Instead of relying on .config symbols for metadata, alter the DEFAULT variable of affected packages. Fixes enabling opkg vs apk among others. Signed-off-by: Felix Fietkau (cherry picked from commit 44598c233dd9a676bc34666968f33f8b9ff4dd0c) --- include/target.mk | 40 ++-------------------------------- package/system/apk/Makefile | 1 + package/system/opkg/Makefile | 1 + package/system/procd/Makefile | 3 +++ package/utils/busybox/Makefile | 2 ++ 5 files changed, 9 insertions(+), 38 deletions(-) diff --git a/include/target.mk b/include/target.mk index 0108bced99..02ea68b15c 100644 --- a/include/target.mk +++ b/include/target.mk @@ -90,45 +90,9 @@ else endif endif -ifneq ($(DUMP),) - # Parse generic config that might be set before a .config is generated to modify the - # default package configuration - # Keep DYNAMIC_DEF_PKG_CONF in sync with toplevel.mk to reflect the same configs - DYNAMIC_DEF_PKG_CONF := CONFIG_USE_APK CONFIG_SELINUX CONFIG_SMALL_FLASH CONFIG_SECCOMP - $(foreach config, $(DYNAMIC_DEF_PKG_CONF), \ - $(eval $(config) := $(shell grep "$(config)=y" $(TOPDIR)/.config 2>/dev/null)) \ - ) - # The config options that are enabled by default and where other default - # packages depends on needs to be set if they are missing in the .config. - ifeq ($(shell grep "CONFIG_SECCOMP" $(TOPDIR)/.config 2>/dev/null),) - ifeq ($(filter $(BOARD), uml),) - ifneq ($(filter $(ARCH), aarch64 arm armeb mips mipsel mips64 mips64el i386 powerpc x86_64),) - CONFIG_SECCOMP := y - endif - endif - endif -endif - -ifneq ($(CONFIG_USE_APK),) -DEFAULT_PACKAGES+=apk-mbedtls -else -DEFAULT_PACKAGES+=opkg -endif - -ifneq ($(CONFIG_SELINUX),) -DEFAULT_PACKAGES+=busybox-selinux procd-selinux -else -DEFAULT_PACKAGES+=busybox procd -endif - # include ujail on systems with enough storage -ifeq ($(CONFIG_SMALL_FLASH),) -DEFAULT_PACKAGES+=procd-ujail -endif - -# include seccomp ld-preload hooks if kernel supports it -ifneq ($(CONFIG_SECCOMP),) -DEFAULT_PACKAGES+=procd-seccomp +ifeq ($(filter small_flash,$(FEATURES)),) + DEFAULT_PACKAGES+=procd-ujail endif # Add device specific packages (here below to allow device type set from subtarget) diff --git a/package/system/apk/Makefile b/package/system/apk/Makefile index 8242e12ee9..7176d64ef2 100644 --- a/package/system/apk/Makefile +++ b/package/system/apk/Makefile @@ -36,6 +36,7 @@ define Package/apk-mbedtls $(Package/apk/default) TITLE += (mbedtls) DEPENDS +=+libmbedtls + DEFAULT:=y if USE_APK VARIANT:=mbedtls DEFAULT_VARIANT:=1 CONFLICTS:=apk-openssl diff --git a/package/system/opkg/Makefile b/package/system/opkg/Makefile index 9fea969ae9..e7c45e3523 100644 --- a/package/system/opkg/Makefile +++ b/package/system/opkg/Makefile @@ -39,6 +39,7 @@ define Package/opkg CATEGORY:=Base system TITLE:=opkg package manager DEPENDS:=+uclient-fetch +libpthread +libubox + DEFAULT:=y if !USE_APK URL:=$(PKG_SOURCE_URL) MENU:=1 endef diff --git a/package/system/procd/Makefile b/package/system/procd/Makefile index 88467c2e59..ec47047f4f 100644 --- a/package/system/procd/Makefile +++ b/package/system/procd/Makefile @@ -50,6 +50,7 @@ define Package/procd $(call Package/procd/Default) VARIANT:=default CONFLICTS:=procd-selinux + DEFAULT:=y if !SELINUX endef define Package/procd-selinux @@ -58,6 +59,7 @@ define Package/procd-selinux TITLE += with SELinux support PROVIDES:=procd VARIANT:=selinux + DEFAULT:=y if SELINUX endef define Package/procd-ujail @@ -73,6 +75,7 @@ define Package/procd-seccomp CATEGORY:=Base system DEPENDS:=@SECCOMP +libubox +libblobmsg-json TITLE:=OpenWrt process seccomp helper + utrace + DEFAULT:=y if SECCOMP endef define Package/uxc diff --git a/package/utils/busybox/Makefile b/package/utils/busybox/Makefile index 7d302bd159..4faa12b791 100644 --- a/package/utils/busybox/Makefile +++ b/package/utils/busybox/Makefile @@ -56,6 +56,7 @@ define Package/busybox $(call Package/busybox/Default) CONFLICTS:=busybox-selinux VARIANT:=default + DEFAULT:=y if !SELINUX endef define Package/busybox-selinux @@ -64,6 +65,7 @@ define Package/busybox-selinux DEPENDS += +libselinux VARIANT:=selinux PROVIDES:=busybox + DEFAULT:=y if SELINUX endef define Package/busybox/description From f97e729f8c7b978f0b18986bcaa496e1be336778 Mon Sep 17 00:00:00 2001 From: Felix Fietkau Date: Wed, 13 Nov 2024 07:04:31 +0100 Subject: [PATCH 07/22] build: fix including busybox, procd and apk/opkg in imagebuilder Since the image builder pulls package lists from metadata directly, add procd and busybox as depdendencies to base-files. As for the package manager itself, since it can be disabled it needs to be added directly in the image builder makefile Fixes: 44598c233dd9 ("build: remove broken dependency of metadata on toplevel .config variables") Signed-off-by: Felix Fietkau (cherry picked from commit 4c65359af49b6ccecd98987f842db5eba985f64b) --- package/base-files/Makefile | 6 +++++- package/system/procd/Makefile | 3 --- package/utils/busybox/Makefile | 2 -- target/imagebuilder/files/Makefile | 5 +++++ 4 files changed, 10 insertions(+), 6 deletions(-) diff --git a/package/base-files/Makefile b/package/base-files/Makefile index 4bcb4882d7..7ac4ea557f 100644 --- a/package/base-files/Makefile +++ b/package/base-files/Makefile @@ -39,7 +39,11 @@ endif define Package/base-files SECTION:=base CATEGORY:=Base system - DEPENDS:=+netifd +libc +jsonfilter +SIGNED_PACKAGES:usign +SIGNED_PACKAGES:openwrt-keyring +NAND_SUPPORT:ubi-utils +fstools +fwtool + DEPENDS:= \ + +netifd +libc +jsonfilter +SIGNED_PACKAGES:usign +SIGNED_PACKAGES:openwrt-keyring \ + +NAND_SUPPORT:ubi-utils +fstools +fwtool \ + +SELINUX:procd-selinux +!SELINUX:procd +SECCOMP:procd-seccomp \ + +SELINUX:busybox-selinux +!SELINUX:busybox TITLE:=Base filesystem for OpenWrt URL:=http://openwrt.org/ VERSION:=$(PKG_RELEASE)~$(lastword $(subst -, ,$(REVISION))) diff --git a/package/system/procd/Makefile b/package/system/procd/Makefile index ec47047f4f..88467c2e59 100644 --- a/package/system/procd/Makefile +++ b/package/system/procd/Makefile @@ -50,7 +50,6 @@ define Package/procd $(call Package/procd/Default) VARIANT:=default CONFLICTS:=procd-selinux - DEFAULT:=y if !SELINUX endef define Package/procd-selinux @@ -59,7 +58,6 @@ define Package/procd-selinux TITLE += with SELinux support PROVIDES:=procd VARIANT:=selinux - DEFAULT:=y if SELINUX endef define Package/procd-ujail @@ -75,7 +73,6 @@ define Package/procd-seccomp CATEGORY:=Base system DEPENDS:=@SECCOMP +libubox +libblobmsg-json TITLE:=OpenWrt process seccomp helper + utrace - DEFAULT:=y if SECCOMP endef define Package/uxc diff --git a/package/utils/busybox/Makefile b/package/utils/busybox/Makefile index 4faa12b791..7d302bd159 100644 --- a/package/utils/busybox/Makefile +++ b/package/utils/busybox/Makefile @@ -56,7 +56,6 @@ define Package/busybox $(call Package/busybox/Default) CONFLICTS:=busybox-selinux VARIANT:=default - DEFAULT:=y if !SELINUX endef define Package/busybox-selinux @@ -65,7 +64,6 @@ define Package/busybox-selinux DEPENDS += +libselinux VARIANT:=selinux PROVIDES:=busybox - DEFAULT:=y if SELINUX endef define Package/busybox/description diff --git a/target/imagebuilder/files/Makefile b/target/imagebuilder/files/Makefile index 54bc612840..811e8f14e5 100644 --- a/target/imagebuilder/files/Makefile +++ b/target/imagebuilder/files/Makefile @@ -138,6 +138,11 @@ _call_info: FORCE echo 'Available Profiles:' echo; $(PROFILE_LIST) +ifneq ($(CONFIG_USE_APK),) + DEFAULT_PACKAGES += apk-mbedtls +else + DEFAULT_PACKAGES += opkg +endif BUILD_PACKAGES:=$(sort $(DEFAULT_PACKAGES) $($(USER_PROFILE)_PACKAGES) kernel) # "-pkgname" in the package list means remove "pkgname" from the package list BUILD_PACKAGES:=$(filter-out $(filter -%,$(BUILD_PACKAGES)) $(patsubst -%,%,$(filter -%,$(BUILD_PACKAGES))),$(BUILD_PACKAGES)) From c22410e7a9cdd409f7515416a1e4a3e094822b8c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Petr=20=C5=A0tetiar?= Date: Sun, 17 Nov 2024 05:13:27 +0000 Subject: [PATCH 08/22] imagebuilder: move handling of DEFAULT_PACKAGES into shareable place MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit It seems, that handling of DEFAULT_PACKAGES is needed in more places, so lets move it into dedicated include file so it can be easily shared. Signed-off-by: Petr Štetiar Link: https://github.com/openwrt/openwrt/pull/16986 Signed-off-by: Robert Marko (cherry picked from commit 40be892a020e37869cdc188cd9a09bb7dc0a6872) --- include/default-packages.mk | 5 +++++ target/imagebuilder/files/Makefile | 1 + 2 files changed, 6 insertions(+) create mode 100644 include/default-packages.mk diff --git a/include/default-packages.mk b/include/default-packages.mk new file mode 100644 index 0000000000..c964e92a03 --- /dev/null +++ b/include/default-packages.mk @@ -0,0 +1,5 @@ +ifneq ($(CONFIG_USE_APK),) + DEFAULT_PACKAGES += apk-mbedtls +else + DEFAULT_PACKAGES += opkg +endif diff --git a/target/imagebuilder/files/Makefile b/target/imagebuilder/files/Makefile index 811e8f14e5..e9e08fb276 100644 --- a/target/imagebuilder/files/Makefile +++ b/target/imagebuilder/files/Makefile @@ -26,6 +26,7 @@ include $(INCLUDE_DIR)/debug.mk include $(INCLUDE_DIR)/depends.mk include $(INCLUDE_DIR)/rootfs.mk +include $(INCLUDE_DIR)/default-packages.mk include $(INCLUDE_DIR)/version.mk export REVISION export SOURCE_DATE_EPOCH From 19db092082e676e8193a5bbe77f2bb62853fd8f3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Petr=20=C5=A0tetiar?= Date: Sun, 17 Nov 2024 05:15:13 +0000 Subject: [PATCH 09/22] linux: fix missing default packages in profiles.json MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Robert reported, that in firmware images generated by ASU, there is `apk` package manager missing after the commit 44598c233dd9 ("build: remove broken dependency of metadata on toplevel .config variables"). That is happening, because apk got removed from `default_packages` list in `profiles.json`, which is being generated by `json_overview_image_info` Make target, which uses `scripts/json_overview_image_info.py` helper script, which gets the information from `DEFAULT_PACKAGES` Make variable. So lets fix it by providing `DEFAULT_PACKAGES` variable when its needed. The reason why we didn't added those packages as a dependency to base-files like any other packages, was to allow disabling them (in order to save space). Fixes: #16969 Fixes: openwrt/asu/issues/1084 Fixes: 44598c233dd9 ("build: remove broken dependency of metadata on toplevel .config variables") Reported-by: Robert Marko Signed-off-by: Petr Štetiar Link: https://github.com/openwrt/openwrt/pull/16986 Signed-off-by: Robert Marko (cherry picked from commit 90f0be8521a8608b0932c1ccb747c0ef1a085910) --- target/linux/Makefile | 1 + 1 file changed, 1 insertion(+) diff --git a/target/linux/Makefile b/target/linux/Makefile index eaf3198222..f1e20abf04 100644 --- a/target/linux/Makefile +++ b/target/linux/Makefile @@ -4,6 +4,7 @@ include $(TOPDIR)/rules.mk include $(INCLUDE_DIR)/target.mk +include $(INCLUDE_DIR)/default-packages.mk export TARGET_BUILD=1 From 933ae0699ae61b1e841c08ffe41aa7eea0ca673d Mon Sep 17 00:00:00 2001 From: Felix Fietkau Date: Mon, 2 Dec 2024 12:27:35 +0100 Subject: [PATCH 10/22] build: remove targetinfo invalidation based on .config Target info no longer depends on config settings Signed-off-by: Felix Fietkau (cherry picked from commit 3b661cfcf9158a3dc5be6f7e1e1340339c9423b5) --- include/toplevel.mk | 17 +---------------- 1 file changed, 1 insertion(+), 16 deletions(-) diff --git a/include/toplevel.mk b/include/toplevel.mk index e5f5e0fecd..092dff786c 100644 --- a/include/toplevel.mk +++ b/include/toplevel.mk @@ -75,22 +75,7 @@ endif _ignore = $(foreach p,$(IGNORE_PACKAGES),--ignore $(p)) -# Config that will invalidate the .targetinfo as they will affect -# DEFAULT_PACKAGES. -# Keep DYNAMIC_DEF_PKG_CONF in sync with target.mk to reflect the same configs -DYNAMIC_DEF_PKG_CONF := CONFIG_USE_APK CONFIG_SELINUX CONFIG_SMALL_FLASH CONFIG_SECCOMP -check-dynamic-def-pkg: FORCE - @+DEF_PKG_CONFS=""; \ - if [ -f $(TOPDIR)/.config ]; then \ - for config in $(DYNAMIC_DEF_PKG_CONF); do \ - DEF_PKG_CONFS="$$DEF_PKG_CONFS "$$(grep "$$config"=y $(TOPDIR)/.config); \ - done; \ - fi; \ - [ ! -f tmp/.packagedynamicdefault ] || OLD_DEF_PKG_CONFS=$$(cat tmp/.packagedynamicdefault); \ - [ "$$DEF_PKG_CONFS" = "$$OLD_DEF_PKG_CONFS" ] || rm -rf tmp/info/.targetinfo*; \ - mkdir -p tmp && echo "$$DEF_PKG_CONFS" > tmp/.packagedynamicdefault; - -prepare-tmpinfo: check-dynamic-def-pkg FORCE +prepare-tmpinfo: FORCE @+$(MAKE) -r -s $(STAGING_DIR_HOST)/.prereq-build $(PREP_MK) mkdir -p tmp/info feeds [ -e $(TOPDIR)/feeds/base ] || ln -sf $(TOPDIR)/package $(TOPDIR)/feeds/base From 184d1c93cbe47e70c8bb4b01ddf7dc9152a58e23 Mon Sep 17 00:00:00 2001 From: Robert Marko Date: Sat, 23 Nov 2024 14:29:49 +0100 Subject: [PATCH 11/22] config: rename SECCOMP to USE_SECCOMP It seems that we have some kind of a symbol name conflict which causes CONFIG_SECCOMP to always be read as y. Unfortunatelly, I could not figure out what is causing this, but simply renaming SECCOMP to USE_SECCOMP seems to properly work and leaves the symbol unset unless arch dependencies are satisfied. This fixes qoriq and others that dont support seccomp from failing due to procd-seccomp package being selected to get included but it cannot be built for them: ERROR: unable to select packages: procd-seccomp (no such package): required by: base-files-1637~52b6c92479[procd-seccomp] Fixes: 4c65359af49b ("build: fix including busybox, procd and apk/opkg in imagebuilder") Link: https://github.com/openwrt/openwrt/pull/17048 Signed-off-by: Robert Marko (cherry picked from commit a48ec449ccab0069e84a72837bf06ba543e53aec) --- config/Config-build.in | 2 +- package/base-files/Makefile | 2 +- package/system/procd/Makefile | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/config/Config-build.in b/config/Config-build.in index ae44985546..08acae63d3 100644 --- a/config/Config-build.in +++ b/config/Config-build.in @@ -423,7 +423,7 @@ menu "Global build settings" endchoice - config SECCOMP + config USE_SECCOMP bool "Enable SECCOMP" select KERNEL_SECCOMP select PACKAGE_procd-seccomp diff --git a/package/base-files/Makefile b/package/base-files/Makefile index 7ac4ea557f..c78c073699 100644 --- a/package/base-files/Makefile +++ b/package/base-files/Makefile @@ -42,7 +42,7 @@ define Package/base-files DEPENDS:= \ +netifd +libc +jsonfilter +SIGNED_PACKAGES:usign +SIGNED_PACKAGES:openwrt-keyring \ +NAND_SUPPORT:ubi-utils +fstools +fwtool \ - +SELINUX:procd-selinux +!SELINUX:procd +SECCOMP:procd-seccomp \ + +SELINUX:procd-selinux +!SELINUX:procd +USE_SECCOMP:procd-seccomp \ +SELINUX:busybox-selinux +!SELINUX:busybox TITLE:=Base filesystem for OpenWrt URL:=http://openwrt.org/ diff --git a/package/system/procd/Makefile b/package/system/procd/Makefile index 88467c2e59..7a2276a46d 100644 --- a/package/system/procd/Makefile +++ b/package/system/procd/Makefile @@ -71,7 +71,7 @@ endef define Package/procd-seccomp SECTION:=base CATEGORY:=Base system - DEPENDS:=@SECCOMP +libubox +libblobmsg-json + DEPENDS:=@USE_SECCOMP +libubox +libblobmsg-json TITLE:=OpenWrt process seccomp helper + utrace endef From efebdf077cb21b76124f492d048b84c4e63c1e2c Mon Sep 17 00:00:00 2001 From: Felix Fietkau Date: Thu, 2 Jan 2025 14:08:36 +0100 Subject: [PATCH 12/22] ubus: update to Git HEAD (2025-01-02) d996988ae55b libubus: close file descriptor after sending it from a request afa57cce0aff libubus: add support for using channels Signed-off-by: Felix Fietkau (cherry picked from commit f0df6e3a4a4996eca917fa17591b8f1d483dfa30) --- package/system/ubus/Makefile | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/package/system/ubus/Makefile b/package/system/ubus/Makefile index bef5e622d7..9a807852a2 100644 --- a/package/system/ubus/Makefile +++ b/package/system/ubus/Makefile @@ -5,9 +5,9 @@ PKG_RELEASE:=1 PKG_SOURCE_PROTO:=git PKG_SOURCE_URL=$(PROJECT_GIT)/project/ubus.git -PKG_SOURCE_DATE:=2024-10-20 -PKG_SOURCE_VERSION:=252a9b0c1774790fb9c25735d5a09c27dba895db -PKG_MIRROR_HASH:=72c21f02710d2314447670f1f1ea1833d2961f65fea3f9f94c060dda7c9d5914 +PKG_SOURCE_DATE:=2025-01-02 +PKG_SOURCE_VERSION:=afa57cce0aff82f4a7a0e509d4387ebc23dd3be7 +PKG_MIRROR_HASH:=a0b3c1961f5f49d31c34a44576ce44538c3ee97bfce97f86f732d7ecc1df9798 PKG_ABI_VERSION:=$(call abi_version_str,$(PKG_SOURCE_DATE)) CMAKE_INSTALL:=1 From 9b9622271e1da65ae0693868124471386f76999a Mon Sep 17 00:00:00 2001 From: Florian Maurer Date: Fri, 3 Jan 2025 13:28:42 +0100 Subject: [PATCH 13/22] ipq40xx: fix label MAC address for FritzBox 7520/7530 The MAC address of the GMAC is contained inside the CWMP-Account number on the label. Similar fix as to the 4040 in b22d382ae4eaa1af42930115d91855f402314cac Link #13240 Signed-off-by: Florian Maurer Link: https://github.com/openwrt/openwrt/pull/17467 Signed-off-by: Robert Marko (cherry picked from commit b2b6955f80d05a8cec69f8497df8bed44cf3c64d) --- .../arch/arm/boot/dts/qcom/qcom-ipq4019-fritzbox-7530.dts | 1 + 1 file changed, 1 insertion(+) diff --git a/target/linux/ipq40xx/files-6.6/arch/arm/boot/dts/qcom/qcom-ipq4019-fritzbox-7530.dts b/target/linux/ipq40xx/files-6.6/arch/arm/boot/dts/qcom/qcom-ipq4019-fritzbox-7530.dts index 2344ae7bf8..4f6cafb885 100644 --- a/target/linux/ipq40xx/files-6.6/arch/arm/boot/dts/qcom/qcom-ipq4019-fritzbox-7530.dts +++ b/target/linux/ipq40xx/files-6.6/arch/arm/boot/dts/qcom/qcom-ipq4019-fritzbox-7530.dts @@ -19,6 +19,7 @@ led-failsafe = &info_red; led-running = &power_green; led-upgrade = &info_red; + label-mac-device = &gmac; }; soc { From bbfebf85273cf8e7c99fa9d1e40c7fa6b5602390 Mon Sep 17 00:00:00 2001 From: Felix Fietkau Date: Fri, 3 Jan 2025 20:22:13 +0100 Subject: [PATCH 14/22] kernel: add workaround for page_pool_release warnings defer_list skbs held by NAPI can block releasing page pools. Work around this by scheduling rx softirq on all CPUs while trying to release a page pool. Signed-off-by: Felix Fietkau (cherry picked from commit 2b70b32aef9e8e1ff275872d551c610368079911) --- ...y-to-free-deferred-skbs-while-waitin.patch | 43 +++++++++++++++++++ 1 file changed, 43 insertions(+) create mode 100644 target/linux/generic/hack-6.6/610-net-page_pool-try-to-free-deferred-skbs-while-waitin.patch diff --git a/target/linux/generic/hack-6.6/610-net-page_pool-try-to-free-deferred-skbs-while-waitin.patch b/target/linux/generic/hack-6.6/610-net-page_pool-try-to-free-deferred-skbs-while-waitin.patch new file mode 100644 index 0000000000..36c28b94f6 --- /dev/null +++ b/target/linux/generic/hack-6.6/610-net-page_pool-try-to-free-deferred-skbs-while-waitin.patch @@ -0,0 +1,43 @@ +From: Felix Fietkau +Date: Fri, 3 Jan 2025 19:29:00 +0100 +Subject: [PATCH] net: page_pool: try to free deferred skbs while waiting for + pool release + +The NAPI defer list can accumulate no longer used skbs, which can be reused +during alloc. If this happens on a CPU that otherwise does not do any +rx softirq processing, skbs can be held indefinitely, causing warnings +on releasing page pools. +Deal with this by scheduling rx softirq on all CPUs. + +Patch by Lorenzo Bianconi + +Signed-off-by: Felix Fietkau +--- + +--- a/net/core/page_pool.c ++++ b/net/core/page_pool.c +@@ -862,12 +862,23 @@ static void page_pool_release_retry(stru + { + struct delayed_work *dwq = to_delayed_work(wq); + struct page_pool *pool = container_of(dwq, typeof(*pool), release_dw); +- int inflight; ++ int cpu, inflight; + + inflight = page_pool_release(pool); + if (!inflight) + return; + ++ /* Run NET_RX_SOFTIRQ in order to free pending skbs in softnet_data ++ * defer_list that can stay in the list until we have enough queued ++ * traffic. ++ */ ++ for_each_online_cpu(cpu) { ++ struct softnet_data *sd = &per_cpu(softnet_data, cpu); ++ ++ if (!cmpxchg(&sd->defer_ipi_scheduled, 0, 1)) ++ smp_call_function_single_async(cpu, &sd->defer_csd); ++ } ++ + /* Periodic warning */ + if (time_after_eq(jiffies, pool->defer_warn)) { + int sec = (s32)((u32)jiffies - (u32)pool->defer_start) / HZ; From 09fcac8bc079edb20eabda857544022e115973a9 Mon Sep 17 00:00:00 2001 From: John Audia Date: Thu, 2 Jan 2025 06:34:15 -0500 Subject: [PATCH 15/22] kernel: bump 6.6 to 6.6.69 Changelog: https://cdn.kernel.org/pub/linux/kernel/v6.x/ChangeLog-6.6.69 All patches automatically rebased. Build system: x86/64 Build-tested: bcm27xx/bcm2712, flogic/xiaomi_redmi-router-ax6000-ubootmod, ramips/tplink_archer-a6-v3 Run-tested: bcm27xx/bcm2712, flogic/xiaomi_redmi-router-ax6000-ubootmod, ramips/tplink_archer-a6-v3 Signed-off-by: John Audia Link: https://github.com/openwrt/openwrt/pull/17459 Signed-off-by: Nick Hainke (cherry picked from commit 89b2356b8c2fd420b49bacaa865fb9bd24173ecc) --- include/kernel-6.6 | 4 ++-- ...dwc3-Set-DMA-and-coherent-masks-early.patch | 8 ++++---- ...chdog-mediatek-mt7988-add-wdt-support.patch | 18 +++++++++--------- 3 files changed, 15 insertions(+), 15 deletions(-) diff --git a/include/kernel-6.6 b/include/kernel-6.6 index c2805b4540..6cee9d1e8c 100644 --- a/include/kernel-6.6 +++ b/include/kernel-6.6 @@ -1,2 +1,2 @@ -LINUX_VERSION-6.6 = .68 -LINUX_KERNEL_HASH-6.6.68 = 283ff410e3f352ceed161ae30c0020301326059db03e86efcb384d46ac5840e2 +LINUX_VERSION-6.6 = .69 +LINUX_KERNEL_HASH-6.6.69 = 9c6305567b75d99514cde6eb9de39973f3d5c857a75bd9dcdfca57041f8d4f34 diff --git a/target/linux/bcm27xx/patches-6.6/950-0519-usb-dwc3-Set-DMA-and-coherent-masks-early.patch b/target/linux/bcm27xx/patches-6.6/950-0519-usb-dwc3-Set-DMA-and-coherent-masks-early.patch index fe77f21211..551bfccc75 100644 --- a/target/linux/bcm27xx/patches-6.6/950-0519-usb-dwc3-Set-DMA-and-coherent-masks-early.patch +++ b/target/linux/bcm27xx/patches-6.6/950-0519-usb-dwc3-Set-DMA-and-coherent-masks-early.patch @@ -68,7 +68,7 @@ Signed-off-by: Jonathan Bell select SOC_BRCMSTB if ARCH_BRCMSTB --- a/drivers/phy/broadcom/phy-brcm-usb-init-synopsys.c +++ b/drivers/phy/broadcom/phy-brcm-usb-init-synopsys.c -@@ -335,6 +335,36 @@ static void usb_init_common_7216(struct +@@ -341,6 +341,36 @@ static void usb_init_common_7216(struct usb_init_common(params); } @@ -105,7 +105,7 @@ Signed-off-by: Jonathan Bell static void usb_init_xhci(struct brcm_usb_init_params *params) { pr_debug("%s\n", __func__); -@@ -380,6 +410,18 @@ static void usb_uninit_common_7211b0(str +@@ -386,6 +416,18 @@ static void usb_uninit_common_7211b0(str } @@ -124,7 +124,7 @@ Signed-off-by: Jonathan Bell static void usb_uninit_xhci(struct brcm_usb_init_params *params) { -@@ -434,6 +476,16 @@ static const struct brcm_usb_init_ops bc +@@ -440,6 +482,16 @@ static const struct brcm_usb_init_ops bc .set_dual_select = usb_set_dual_select, }; @@ -141,7 +141,7 @@ Signed-off-by: Jonathan Bell void brcm_usb_dvr_init_7216(struct brcm_usb_init_params *params) { -@@ -451,3 +503,10 @@ void brcm_usb_dvr_init_7211b0(struct brc +@@ -457,3 +509,10 @@ void brcm_usb_dvr_init_7211b0(struct brc params->family_name = "7211"; params->ops = &bcm7211b0_ops; } diff --git a/target/linux/mediatek/patches-6.6/251-v6.8-watchdog-mediatek-mt7988-add-wdt-support.patch b/target/linux/mediatek/patches-6.6/251-v6.8-watchdog-mediatek-mt7988-add-wdt-support.patch index c399b768b0..984034125c 100644 --- a/target/linux/mediatek/patches-6.6/251-v6.8-watchdog-mediatek-mt7988-add-wdt-support.patch +++ b/target/linux/mediatek/patches-6.6/251-v6.8-watchdog-mediatek-mt7988-add-wdt-support.patch @@ -18,7 +18,7 @@ Signed-off-by: Wim Van Sebroeck --- a/drivers/watchdog/mtk_wdt.c +++ b/drivers/watchdog/mtk_wdt.c -@@ -58,9 +58,13 @@ +@@ -59,9 +59,13 @@ #define WDT_SWSYSRST 0x18U #define WDT_SWSYS_RST_KEY 0x88000000 @@ -32,7 +32,7 @@ Signed-off-by: Wim Van Sebroeck static bool nowayout = WATCHDOG_NOWAYOUT; static unsigned int timeout; -@@ -71,10 +75,12 @@ struct mtk_wdt_dev { +@@ -72,10 +76,12 @@ struct mtk_wdt_dev { struct reset_controller_dev rcdev; bool disable_wdt_extrst; bool reset_by_toprgu; @@ -45,7 +45,7 @@ Signed-off-by: Wim Van Sebroeck }; static const struct mtk_wdt_data mt2712_data = { -@@ -89,6 +95,11 @@ static const struct mtk_wdt_data mt7986_ +@@ -94,6 +100,11 @@ static const struct mtk_wdt_data mt7986_ .toprgu_sw_rst_num = MT7986_TOPRGU_SW_RST_NUM, }; @@ -57,7 +57,7 @@ Signed-off-by: Wim Van Sebroeck static const struct mtk_wdt_data mt8183_data = { .toprgu_sw_rst_num = MT8183_TOPRGU_SW_RST_NUM, }; -@@ -109,6 +120,28 @@ static const struct mtk_wdt_data mt8195_ +@@ -114,6 +125,28 @@ static const struct mtk_wdt_data mt8195_ .toprgu_sw_rst_num = MT8195_TOPRGU_SW_RST_NUM, }; @@ -86,7 +86,7 @@ Signed-off-by: Wim Van Sebroeck static int toprgu_reset_update(struct reset_controller_dev *rcdev, unsigned long id, bool assert) { -@@ -119,6 +152,9 @@ static int toprgu_reset_update(struct re +@@ -124,6 +157,9 @@ static int toprgu_reset_update(struct re spin_lock_irqsave(&data->lock, flags); @@ -96,7 +96,7 @@ Signed-off-by: Wim Van Sebroeck tmp = readl(data->wdt_base + WDT_SWSYSRST); if (assert) tmp |= BIT(id); -@@ -127,6 +163,9 @@ static int toprgu_reset_update(struct re +@@ -132,6 +168,9 @@ static int toprgu_reset_update(struct re tmp |= WDT_SWSYS_RST_KEY; writel(tmp, data->wdt_base + WDT_SWSYSRST); @@ -106,7 +106,7 @@ Signed-off-by: Wim Van Sebroeck spin_unlock_irqrestore(&data->lock, flags); return 0; -@@ -412,6 +451,8 @@ static int mtk_wdt_probe(struct platform +@@ -417,6 +456,8 @@ static int mtk_wdt_probe(struct platform wdt_data->toprgu_sw_rst_num); if (err) return err; @@ -115,8 +115,8 @@ Signed-off-by: Wim Van Sebroeck } mtk_wdt->disable_wdt_extrst = -@@ -450,6 +491,7 @@ static const struct of_device_id mtk_wdt - { .compatible = "mediatek,mt6589-wdt" }, +@@ -456,6 +497,7 @@ static const struct of_device_id mtk_wdt + { .compatible = "mediatek,mt6735-wdt", .data = &mt6735_data }, { .compatible = "mediatek,mt6795-wdt", .data = &mt6795_data }, { .compatible = "mediatek,mt7986-wdt", .data = &mt7986_data }, + { .compatible = "mediatek,mt7988-wdt", .data = &mt7988_data }, From 14722242af819cdb168968c00dd6fda4303b0b3e Mon Sep 17 00:00:00 2001 From: Tianling Shen Date: Fri, 3 Jan 2025 20:37:41 +0800 Subject: [PATCH 16/22] rockchip: fix phy reset on rk356x The commit 7160820d742a ("phy: rockchip: naneng-combphy: fix phy reset") was backported to kernel 6.6 branch by upstream, however the correspond dtsi fixes was not, resulting the following error: ``` [ 0.225521] rockchip-naneng-combphy fe830000.phy: error -ENOENT: failed to get phy reset [ 0.227467] rockchip-naneng-combphy fe840000.phy: error -ENOENT: failed to get phy reset ``` So backport the dtsi fixes here manually. Fixes: 89b2356b8c2f ("kernel: bump 6.6 to 6.6.69") Signed-off-by: Tianling Shen Link: https://github.com/openwrt/openwrt/pull/17468 Signed-off-by: Robert Marko (cherry picked from commit 8a477bafb4637e3499f69f569133039ce060559e) --- ...dd-reset-names-for-combphy-on-rk3568.patch | 44 +++++++++++++++++++ 1 file changed, 44 insertions(+) create mode 100644 target/linux/rockchip/patches-6.6/016-v6.13-arm64-dts-rockchip-add-reset-names-for-combphy-on-rk3568.patch diff --git a/target/linux/rockchip/patches-6.6/016-v6.13-arm64-dts-rockchip-add-reset-names-for-combphy-on-rk3568.patch b/target/linux/rockchip/patches-6.6/016-v6.13-arm64-dts-rockchip-add-reset-names-for-combphy-on-rk3568.patch new file mode 100644 index 0000000000..7a8f86a46f --- /dev/null +++ b/target/linux/rockchip/patches-6.6/016-v6.13-arm64-dts-rockchip-add-reset-names-for-combphy-on-rk3568.patch @@ -0,0 +1,44 @@ +From 8b9c12757f919157752646faf3821abf2b7d2a64 Mon Sep 17 00:00:00 2001 +From: Chukun Pan +Date: Fri, 22 Nov 2024 15:30:05 +0800 +Subject: [PATCH] arm64: dts: rockchip: add reset-names for combphy on rk3568 + +The reset-names of combphy are missing, add it. + +Signed-off-by: Chukun Pan +Fixes: fd3ac6e80497 ("dt-bindings: phy: rockchip: rk3588 has two reset lines") +Link: https://lore.kernel.org/r/20241122073006.99309-1-amadeus@jmu.edu.cn +Signed-off-by: Heiko Stuebner +--- + arch/arm64/boot/dts/rockchip/rk3568.dtsi | 1 + + arch/arm64/boot/dts/rockchip/rk356x-base.dtsi | 2 ++ + 2 files changed, 3 insertions(+) + +--- a/arch/arm64/boot/dts/rockchip/rk3568.dtsi ++++ b/arch/arm64/boot/dts/rockchip/rk3568.dtsi +@@ -223,6 +223,7 @@ + assigned-clocks = <&pmucru CLK_PCIEPHY0_REF>; + assigned-clock-rates = <100000000>; + resets = <&cru SRST_PIPEPHY0>; ++ reset-names = "phy"; + rockchip,pipe-grf = <&pipegrf>; + rockchip,pipe-phy-grf = <&pipe_phy_grf0>; + #phy-cells = <1>; +--- a/arch/arm64/boot/dts/rockchip/rk356x.dtsi ++++ b/arch/arm64/boot/dts/rockchip/rk356x.dtsi +@@ -1747,6 +1747,7 @@ + assigned-clocks = <&pmucru CLK_PCIEPHY1_REF>; + assigned-clock-rates = <100000000>; + resets = <&cru SRST_PIPEPHY1>; ++ reset-names = "phy"; + rockchip,pipe-grf = <&pipegrf>; + rockchip,pipe-phy-grf = <&pipe_phy_grf1>; + #phy-cells = <1>; +@@ -1763,6 +1764,7 @@ + assigned-clocks = <&pmucru CLK_PCIEPHY2_REF>; + assigned-clock-rates = <100000000>; + resets = <&cru SRST_PIPEPHY2>; ++ reset-names = "phy"; + rockchip,pipe-grf = <&pipegrf>; + rockchip,pipe-phy-grf = <&pipe_phy_grf2>; + #phy-cells = <1>; From 43e1b47d70b4b7d43564b17f0e40346a2d26de30 Mon Sep 17 00:00:00 2001 From: Hauke Mehrtens Date: Sun, 22 Dec 2024 17:47:34 +0100 Subject: [PATCH 17/22] procd: update to Git HEAD (2024-12-22) 42d3937 jail/seccomp: add support for loongarch64 Link: https://github.com/openwrt/openwrt/pull/17335 Signed-off-by: Hauke Mehrtens (cherry picked from commit f69fc4c413357ab2e981f11eacd6101b6a59ab34) --- package/system/procd/Makefile | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/package/system/procd/Makefile b/package/system/procd/Makefile index 7a2276a46d..65cc0ad9f6 100644 --- a/package/system/procd/Makefile +++ b/package/system/procd/Makefile @@ -12,9 +12,9 @@ PKG_RELEASE:=1 PKG_SOURCE_PROTO:=git PKG_SOURCE_URL=$(PROJECT_GIT)/project/procd.git -PKG_MIRROR_HASH:=99139ce325d73f5b250d115703540acfac3bcdc8ee202f2d3aacf3083042bc70 -PKG_SOURCE_DATE:=2024-12-17 -PKG_SOURCE_VERSION:=fd01fb852302a2683d09ee1c2193d7c51e2b0ba8 +PKG_MIRROR_HASH:=41dbb5352eff931ecc78c4ce9a081645c26a7fb8dc57cdd6521a2f8d3a142567 +PKG_SOURCE_DATE:=2024-12-22 +PKG_SOURCE_VERSION:=42d3937654508b04da64969f9d764ac2ec411904 CMAKE_INSTALL:=1 PKG_LICENSE:=GPL-2.0 From 993ade9eb3cbc3e1a6aa2faa02220343a04eb725 Mon Sep 17 00:00:00 2001 From: Weijie Gao Date: Sun, 22 Dec 2024 18:32:54 +0800 Subject: [PATCH 18/22] config: enable SECCOMP support for loongarch64 Make USE_SECCOMP selectable for loongarch64 Signed-off-by: Weijie Gao Link: https://github.com/openwrt/openwrt/pull/17335 Signed-off-by: Hauke Mehrtens (cherry picked from commit b6b6148d7d19f7081551491192e161f46cb0bdb8) --- config/Config-build.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/Config-build.in b/config/Config-build.in index 08acae63d3..a9e968f944 100644 --- a/config/Config-build.in +++ b/config/Config-build.in @@ -427,7 +427,7 @@ menu "Global build settings" bool "Enable SECCOMP" select KERNEL_SECCOMP select PACKAGE_procd-seccomp - depends on (aarch64 || arm || armeb || mips || mipsel || mips64 || mips64el || i386 || powerpc || x86_64) + depends on (aarch64 || arm || armeb || mips || mipsel || mips64 || mips64el || i386 || loongarch64 || powerpc || x86_64) depends on !TARGET_uml default y help From cf887640a39b7823fa3e047bf1d3b7b98abd1fef Mon Sep 17 00:00:00 2001 From: Hauke Mehrtens Date: Sun, 22 Dec 2024 17:33:21 +0100 Subject: [PATCH 19/22] mbedtls: Deactivate ARIA block cipher by default The ARIA block cipher is pretty uncommon in TLS, deactivate it for now. This saves some space and reduces the possible variations and attack vectors of mbedtls. ARIA support was deactivated in OpenWrt 23.05 by default. Link: https://github.com/openwrt/openwrt/pull/17342 Signed-off-by: Hauke Mehrtens (cherry picked from commit 3c0ef48bc82cb11edd0b4fdbc4beaa3f95708967) --- package/libs/mbedtls/Config.in | 4 ++++ package/libs/mbedtls/Makefile | 1 + 2 files changed, 5 insertions(+) diff --git a/package/libs/mbedtls/Config.in b/package/libs/mbedtls/Config.in index 51f8bcbbdd..0a760ed2cb 100644 --- a/package/libs/mbedtls/Config.in +++ b/package/libs/mbedtls/Config.in @@ -8,6 +8,10 @@ config MBEDTLS_AES_C bool "MBEDTLS_AES_C" default y +config MBEDTLS_ARIA_C + bool "MBEDTLS_ARIA_C" + default n + config MBEDTLS_CAMELLIA_C bool "MBEDTLS_CAMELLIA_C" default n diff --git a/package/libs/mbedtls/Makefile b/package/libs/mbedtls/Makefile index 2efdf86cd2..f5bff13324 100644 --- a/package/libs/mbedtls/Makefile +++ b/package/libs/mbedtls/Makefile @@ -37,6 +37,7 @@ MBEDTLS_BUILD_OPTS_CURVES= \ MBEDTLS_BUILD_OPTS_CIPHERS= \ CONFIG_MBEDTLS_AES_C \ + CONFIG_MBEDTLS_ARIA_C \ CONFIG_MBEDTLS_CAMELLIA_C \ CONFIG_MBEDTLS_CCM_C \ CONFIG_MBEDTLS_CMAC_C \ From 111c62a06ab550c47b5d3fe759687ae4f7f1a580 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=81lvaro=20Fern=C3=A1ndez=20Rojas?= Date: Sat, 4 Jan 2025 00:46:00 +0100 Subject: [PATCH 20/22] rockchip: refresh patch MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Commit 8a477bafb4637e3499f69f569133039ce060559e backported an upstream patch without refreshing the patches. Fixes: 8a477bafb463 ("rockchip: fix phy reset on rk356x") Signed-off-by: Álvaro Fernández Rojas Link: https://github.com/openwrt/openwrt/pull/17474 Signed-off-by: Robert Marko (cherry picked from commit 484f670ed3d41e44375bfa7f8892e660d3c8c26a) --- .../301-arm64-dts-rockchip-add-DT-entry-for-RNG-to-RK3568.patch | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/target/linux/rockchip/patches-6.6/301-arm64-dts-rockchip-add-DT-entry-for-RNG-to-RK3568.patch b/target/linux/rockchip/patches-6.6/301-arm64-dts-rockchip-add-DT-entry-for-RNG-to-RK3568.patch index 130bf6723c..6ba8002c75 100644 --- a/target/linux/rockchip/patches-6.6/301-arm64-dts-rockchip-add-DT-entry-for-RNG-to-RK3568.patch +++ b/target/linux/rockchip/patches-6.6/301-arm64-dts-rockchip-add-DT-entry-for-RNG-to-RK3568.patch @@ -14,7 +14,7 @@ Signed-off-by: Daniel Golle --- a/arch/arm64/boot/dts/rockchip/rk3568.dtsi +++ b/arch/arm64/boot/dts/rockchip/rk3568.dtsi -@@ -257,6 +257,13 @@ +@@ -258,6 +258,13 @@ }; }; From 56b19f0d5095fd69739805620a3da64569620277 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=81lvaro=20Fern=C3=A1ndez=20Rojas?= Date: Mon, 30 Dec 2024 01:01:33 +0100 Subject: [PATCH 21/22] generic: 6.6: backport upstream Realtek PHY patches MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 8989bad54113 net: phy: realtek: add RTL8125D-internal PHY f87a17ed3b51 net: phy: realtek: merge the drivers for internal NBase-T PHY's Signed-off-by: Álvaro Fernández Rojas (cherry picked from commit fedb1f86b50986a962c899d7406566d991e030ee) --- ...merge-the-drivers-for-internal-NBase.patch | 136 ++++++++++++++++++ ...hy-realtek-add-RTL8125D-internal-PHY.patch | 29 ++++ ...-use-genphy_soft_reset-for-2.5G-PHYs.patch | 18 +-- ...sable-SGMII-in-band-AN-for-2-5G-PHYs.patch | 4 +- ...make-sure-paged-read-is-protected-by.patch | 2 +- ...-phy-realtek-introduce-rtl822x_probe.patch | 14 +- ...tek-detect-early-version-of-RTL8221B.patch | 4 +- ...ealtek-support-interrupt-of-RTL8221B.patch | 10 +- 8 files changed, 191 insertions(+), 26 deletions(-) create mode 100644 target/linux/generic/backport-6.6/781-18-v6.13-net-phy-realtek-merge-the-drivers-for-internal-NBase.patch create mode 100644 target/linux/generic/backport-6.6/781-19-v6.13-net-phy-realtek-add-RTL8125D-internal-PHY.patch diff --git a/target/linux/generic/backport-6.6/781-18-v6.13-net-phy-realtek-merge-the-drivers-for-internal-NBase.patch b/target/linux/generic/backport-6.6/781-18-v6.13-net-phy-realtek-merge-the-drivers-for-internal-NBase.patch new file mode 100644 index 0000000000..771f60df91 --- /dev/null +++ b/target/linux/generic/backport-6.6/781-18-v6.13-net-phy-realtek-merge-the-drivers-for-internal-NBase.patch @@ -0,0 +1,136 @@ +From f87a17ed3b51fba4dfdd8f8b643b5423a85fc551 Mon Sep 17 00:00:00 2001 +From: Heiner Kallweit +Date: Tue, 15 Oct 2024 07:47:14 +0200 +Subject: [PATCH] net: phy: realtek: merge the drivers for internal NBase-T + PHY's + +The Realtek RTL8125/RTL8126 NBase-T MAC/PHY chips have internal PHY's +which are register-compatible, at least for the registers we use here. +So let's use just one PHY driver to support all of them. +These internal PHY's exist also as external C45 PHY's, but on the +internal PHY's no access to MMD registers is possible. This can be +used to differentiate between the internal and external version. + +As a side effect the drivers for two now external-only drivers don't +require read_mmd/write_mmd hooks any longer. + +Signed-off-by: Heiner Kallweit +Link: https://patch.msgid.link/c57081a6-811f-4571-ab35-34f4ca6de9af@gmail.com +Signed-off-by: Paolo Abeni +--- + drivers/net/phy/realtek.c | 53 +++++++++++++++++++++++++++++++-------- + 1 file changed, 43 insertions(+), 10 deletions(-) + +--- a/drivers/net/phy/realtek.c ++++ b/drivers/net/phy/realtek.c +@@ -95,6 +95,7 @@ + + #define RTL_GENERIC_PHYID 0x001cc800 + #define RTL_8211FVD_PHYID 0x001cc878 ++#define RTL_8221B 0x001cc840 + #define RTL_8221B_VB_CG 0x001cc849 + #define RTL_8221B_VN_CG 0x001cc84a + #define RTL_8251B 0x001cc862 +@@ -1077,6 +1078,23 @@ static bool rtlgen_supports_2_5gbps(stru + return val >= 0 && val & MDIO_PMA_SPEED_2_5G; + } + ++/* On internal PHY's MMD reads over C22 always return 0. ++ * Check a MMD register which is known to be non-zero. ++ */ ++static bool rtlgen_supports_mmd(struct phy_device *phydev) ++{ ++ int val; ++ ++ phy_lock_mdio_bus(phydev); ++ __phy_write(phydev, MII_MMD_CTRL, MDIO_MMD_PCS); ++ __phy_write(phydev, MII_MMD_DATA, MDIO_PCS_EEE_ABLE); ++ __phy_write(phydev, MII_MMD_CTRL, MDIO_MMD_PCS | MII_MMD_CTRL_NOINCR); ++ val = __phy_read(phydev, MII_MMD_DATA); ++ phy_unlock_mdio_bus(phydev); ++ ++ return val > 0; ++} ++ + static int rtlgen_match_phy_device(struct phy_device *phydev) + { + return phydev->phy_id == RTL_GENERIC_PHYID && +@@ -1086,7 +1104,8 @@ static int rtlgen_match_phy_device(struc + static int rtl8226_match_phy_device(struct phy_device *phydev) + { + return phydev->phy_id == RTL_GENERIC_PHYID && +- rtlgen_supports_2_5gbps(phydev); ++ rtlgen_supports_2_5gbps(phydev) && ++ rtlgen_supports_mmd(phydev); + } + + static int rtlgen_is_c45_match(struct phy_device *phydev, unsigned int id, +@@ -1098,6 +1117,11 @@ static int rtlgen_is_c45_match(struct ph + return !is_c45 && (id == phydev->phy_id); + } + ++static int rtl8221b_match_phy_device(struct phy_device *phydev) ++{ ++ return phydev->phy_id == RTL_8221B && rtlgen_supports_mmd(phydev); ++} ++ + static int rtl8221b_vb_cg_c22_match_phy_device(struct phy_device *phydev) + { + return rtlgen_is_c45_match(phydev, RTL_8221B_VB_CG, false); +@@ -1118,9 +1142,21 @@ static int rtl8221b_vn_cg_c45_match_phy_ + return rtlgen_is_c45_match(phydev, RTL_8221B_VN_CG, true); + } + +-static int rtl8251b_c22_match_phy_device(struct phy_device *phydev) ++static int rtl_internal_nbaset_match_phy_device(struct phy_device *phydev) + { +- return rtlgen_is_c45_match(phydev, RTL_8251B, false); ++ if (phydev->is_c45) ++ return false; ++ ++ switch (phydev->phy_id) { ++ case RTL_GENERIC_PHYID: ++ case RTL_8221B: ++ case RTL_8251B: ++ break; ++ default: ++ return false; ++ } ++ ++ return rtlgen_supports_2_5gbps(phydev) && !rtlgen_supports_mmd(phydev); + } + + static int rtl8251b_c45_match_phy_device(struct phy_device *phydev) +@@ -1382,10 +1418,8 @@ static struct phy_driver realtek_drvs[] + .resume = rtlgen_resume, + .read_page = rtl821x_read_page, + .write_page = rtl821x_write_page, +- .read_mmd = rtl822x_read_mmd, +- .write_mmd = rtl822x_write_mmd, + }, { +- PHY_ID_MATCH_EXACT(0x001cc840), ++ .match_phy_device = rtl8221b_match_phy_device, + .name = "RTL8226B_RTL8221B 2.5Gbps PHY", + .get_features = rtl822x_get_features, + .config_aneg = rtl822x_config_aneg, +@@ -1396,8 +1430,6 @@ static struct phy_driver realtek_drvs[] + .resume = rtlgen_resume, + .read_page = rtl821x_read_page, + .write_page = rtl821x_write_page, +- .read_mmd = rtl822x_read_mmd, +- .write_mmd = rtl822x_write_mmd, + }, { + PHY_ID_MATCH_EXACT(0x001cc838), + .name = "RTL8226-CG 2.5Gbps PHY", +@@ -1475,8 +1507,9 @@ static struct phy_driver realtek_drvs[] + .read_page = rtl821x_read_page, + .write_page = rtl821x_write_page, + }, { +- .match_phy_device = rtl8251b_c22_match_phy_device, +- .name = "RTL8126A-internal 5Gbps PHY", ++ .match_phy_device = rtl_internal_nbaset_match_phy_device, ++ .name = "Realtek Internal NBASE-T PHY", ++ .flags = PHY_IS_INTERNAL, + .get_features = rtl822x_get_features, + .config_aneg = rtl822x_config_aneg, + .read_status = rtl822x_read_status, diff --git a/target/linux/generic/backport-6.6/781-19-v6.13-net-phy-realtek-add-RTL8125D-internal-PHY.patch b/target/linux/generic/backport-6.6/781-19-v6.13-net-phy-realtek-add-RTL8125D-internal-PHY.patch new file mode 100644 index 0000000000..4b9b9e8d48 --- /dev/null +++ b/target/linux/generic/backport-6.6/781-19-v6.13-net-phy-realtek-add-RTL8125D-internal-PHY.patch @@ -0,0 +1,29 @@ +From 8989bad541133c43550bff2b80edbe37b8fb9659 Mon Sep 17 00:00:00 2001 +From: Heiner Kallweit +Date: Thu, 17 Oct 2024 18:01:13 +0200 +Subject: [PATCH] net: phy: realtek: add RTL8125D-internal PHY + +The first boards show up with Realtek's RTL8125D. This MAC/PHY chip +comes with an integrated 2.5Gbps PHY with ID 0x001cc841. It's not +clear yet whether there's an external version of this PHY and how +Realtek calls it, therefore use the numeric id for now. + +Link: https://lore.kernel.org/netdev/2ada65e1-5dfa-456c-9334-2bc51272e9da@gmail.com/T/ +Signed-off-by: Heiner Kallweit +Message-ID: <7d2924de-053b-44d2-a479-870dc3878170@gmail.com> +Reviewed-by: Andrew Lunn +Signed-off-by: Andrew Lunn +--- + drivers/net/phy/realtek.c | 1 + + 1 file changed, 1 insertion(+) + +--- a/drivers/net/phy/realtek.c ++++ b/drivers/net/phy/realtek.c +@@ -1151,6 +1151,7 @@ static int rtl_internal_nbaset_match_phy + case RTL_GENERIC_PHYID: + case RTL_8221B: + case RTL_8251B: ++ case 0x001cc841: + break; + default: + return false; diff --git a/target/linux/generic/pending-6.6/720-01-net-phy-realtek-use-genphy_soft_reset-for-2.5G-PHYs.patch b/target/linux/generic/pending-6.6/720-01-net-phy-realtek-use-genphy_soft_reset-for-2.5G-PHYs.patch index 2b77b6e02f..8de57707a2 100644 --- a/target/linux/generic/pending-6.6/720-01-net-phy-realtek-use-genphy_soft_reset-for-2.5G-PHYs.patch +++ b/target/linux/generic/pending-6.6/720-01-net-phy-realtek-use-genphy_soft_reset-for-2.5G-PHYs.patch @@ -15,7 +15,7 @@ Signed-off-by: Daniel Golle --- a/drivers/net/phy/realtek.c +++ b/drivers/net/phy/realtek.c -@@ -1375,6 +1375,7 @@ static struct phy_driver realtek_drvs[] +@@ -1412,6 +1412,7 @@ static struct phy_driver realtek_drvs[] }, { .name = "RTL8226 2.5Gbps PHY", .match_phy_device = rtl8226_match_phy_device, @@ -23,15 +23,15 @@ Signed-off-by: Daniel Golle .get_features = rtl822x_get_features, .config_aneg = rtl822x_config_aneg, .read_status = rtl822x_read_status, -@@ -1387,6 +1388,7 @@ static struct phy_driver realtek_drvs[] +@@ -1422,6 +1423,7 @@ static struct phy_driver realtek_drvs[] }, { - PHY_ID_MATCH_EXACT(0x001cc840), + .match_phy_device = rtl8221b_match_phy_device, .name = "RTL8226B_RTL8221B 2.5Gbps PHY", + .soft_reset = genphy_soft_reset, .get_features = rtl822x_get_features, .config_aneg = rtl822x_config_aneg, .config_init = rtl822xb_config_init, -@@ -1401,6 +1403,7 @@ static struct phy_driver realtek_drvs[] +@@ -1434,6 +1436,7 @@ static struct phy_driver realtek_drvs[] }, { PHY_ID_MATCH_EXACT(0x001cc838), .name = "RTL8226-CG 2.5Gbps PHY", @@ -39,7 +39,7 @@ Signed-off-by: Daniel Golle .get_features = rtl822x_get_features, .config_aneg = rtl822x_config_aneg, .read_status = rtl822x_read_status, -@@ -1411,6 +1414,7 @@ static struct phy_driver realtek_drvs[] +@@ -1444,6 +1447,7 @@ static struct phy_driver realtek_drvs[] }, { PHY_ID_MATCH_EXACT(0x001cc848), .name = "RTL8226B-CG_RTL8221B-CG 2.5Gbps PHY", @@ -47,7 +47,7 @@ Signed-off-by: Daniel Golle .get_features = rtl822x_get_features, .config_aneg = rtl822x_config_aneg, .config_init = rtl822xb_config_init, -@@ -1423,6 +1427,7 @@ static struct phy_driver realtek_drvs[] +@@ -1456,6 +1460,7 @@ static struct phy_driver realtek_drvs[] }, { .match_phy_device = rtl8221b_vb_cg_c22_match_phy_device, .name = "RTL8221B-VB-CG 2.5Gbps PHY (C22)", @@ -55,7 +55,7 @@ Signed-off-by: Daniel Golle .get_features = rtl822x_get_features, .config_aneg = rtl822x_config_aneg, .config_init = rtl822xb_config_init, -@@ -1435,6 +1440,7 @@ static struct phy_driver realtek_drvs[] +@@ -1468,6 +1473,7 @@ static struct phy_driver realtek_drvs[] }, { .match_phy_device = rtl8221b_vb_cg_c45_match_phy_device, .name = "RTL8221B-VB-CG 2.5Gbps PHY (C45)", @@ -63,7 +63,7 @@ Signed-off-by: Daniel Golle .config_init = rtl822xb_config_init, .get_rate_matching = rtl822xb_get_rate_matching, .get_features = rtl822x_c45_get_features, -@@ -1445,6 +1451,7 @@ static struct phy_driver realtek_drvs[] +@@ -1478,6 +1484,7 @@ static struct phy_driver realtek_drvs[] }, { .match_phy_device = rtl8221b_vn_cg_c22_match_phy_device, .name = "RTL8221B-VM-CG 2.5Gbps PHY (C22)", @@ -71,7 +71,7 @@ Signed-off-by: Daniel Golle .get_features = rtl822x_get_features, .config_aneg = rtl822x_config_aneg, .config_init = rtl822xb_config_init, -@@ -1457,6 +1464,7 @@ static struct phy_driver realtek_drvs[] +@@ -1490,6 +1497,7 @@ static struct phy_driver realtek_drvs[] }, { .match_phy_device = rtl8221b_vn_cg_c45_match_phy_device, .name = "RTL8221B-VN-CG 2.5Gbps PHY (C45)", diff --git a/target/linux/generic/pending-6.6/720-02-net-phy-realtek-disable-SGMII-in-band-AN-for-2-5G-PHYs.patch b/target/linux/generic/pending-6.6/720-02-net-phy-realtek-disable-SGMII-in-band-AN-for-2-5G-PHYs.patch index cbef74d317..7e48c16515 100644 --- a/target/linux/generic/pending-6.6/720-02-net-phy-realtek-disable-SGMII-in-band-AN-for-2-5G-PHYs.patch +++ b/target/linux/generic/pending-6.6/720-02-net-phy-realtek-disable-SGMII-in-band-AN-for-2-5G-PHYs.patch @@ -20,7 +20,7 @@ Signed-off-by: Daniel Golle --- a/drivers/net/phy/realtek.c +++ b/drivers/net/phy/realtek.c -@@ -814,8 +814,8 @@ static int rtl822x_write_mmd(struct phy_ +@@ -815,8 +815,8 @@ static int rtl822x_write_mmd(struct phy_ static int rtl822xb_config_init(struct phy_device *phydev) { bool has_2500, has_sgmii; @@ -30,7 +30,7 @@ Signed-off-by: Daniel Golle has_2500 = test_bit(PHY_INTERFACE_MODE_2500BASEX, phydev->host_interfaces) || -@@ -865,7 +865,29 @@ static int rtl822xb_config_init(struct p +@@ -866,7 +866,29 @@ static int rtl822xb_config_init(struct p if (ret < 0) return ret; diff --git a/target/linux/generic/pending-6.6/720-03-net-phy-realtek-make-sure-paged-read-is-protected-by.patch b/target/linux/generic/pending-6.6/720-03-net-phy-realtek-make-sure-paged-read-is-protected-by.patch index 216fa918e1..722ec02cdc 100644 --- a/target/linux/generic/pending-6.6/720-03-net-phy-realtek-make-sure-paged-read-is-protected-by.patch +++ b/target/linux/generic/pending-6.6/720-03-net-phy-realtek-make-sure-paged-read-is-protected-by.patch @@ -18,7 +18,7 @@ Signed-off-by: Daniel Golle --- a/drivers/net/phy/realtek.c +++ b/drivers/net/phy/realtek.c -@@ -1092,9 +1092,11 @@ static bool rtlgen_supports_2_5gbps(stru +@@ -1093,9 +1093,11 @@ static bool rtlgen_supports_2_5gbps(stru { int val; diff --git a/target/linux/generic/pending-6.6/720-04-net-phy-realtek-introduce-rtl822x_probe.patch b/target/linux/generic/pending-6.6/720-04-net-phy-realtek-introduce-rtl822x_probe.patch index 08c13f34e4..1b9cdada6d 100644 --- a/target/linux/generic/pending-6.6/720-04-net-phy-realtek-introduce-rtl822x_probe.patch +++ b/target/linux/generic/pending-6.6/720-04-net-phy-realtek-introduce-rtl822x_probe.patch @@ -24,7 +24,7 @@ Signed-off-by: Daniel Golle #define RTL8366RB_POWER_SAVE 0x15 #define RTL8366RB_POWER_SAVE_ON BIT(12) -@@ -1152,6 +1156,25 @@ static int rtl8251b_c45_match_phy_device +@@ -1189,6 +1193,25 @@ static int rtl8251b_c45_match_phy_device return rtlgen_is_c45_match(phydev, RTL_8251B, true); } @@ -50,7 +50,7 @@ Signed-off-by: Daniel Golle static int rtlgen_resume(struct phy_device *phydev) { int ret = genphy_resume(phydev); -@@ -1427,6 +1450,7 @@ static struct phy_driver realtek_drvs[] +@@ -1460,6 +1483,7 @@ static struct phy_driver realtek_drvs[] }, { PHY_ID_MATCH_EXACT(0x001cc838), .name = "RTL8226-CG 2.5Gbps PHY", @@ -58,7 +58,7 @@ Signed-off-by: Daniel Golle .soft_reset = genphy_soft_reset, .get_features = rtl822x_get_features, .config_aneg = rtl822x_config_aneg, -@@ -1438,6 +1462,7 @@ static struct phy_driver realtek_drvs[] +@@ -1471,6 +1495,7 @@ static struct phy_driver realtek_drvs[] }, { PHY_ID_MATCH_EXACT(0x001cc848), .name = "RTL8226B-CG_RTL8221B-CG 2.5Gbps PHY", @@ -66,7 +66,7 @@ Signed-off-by: Daniel Golle .soft_reset = genphy_soft_reset, .get_features = rtl822x_get_features, .config_aneg = rtl822x_config_aneg, -@@ -1451,6 +1476,7 @@ static struct phy_driver realtek_drvs[] +@@ -1484,6 +1509,7 @@ static struct phy_driver realtek_drvs[] }, { .match_phy_device = rtl8221b_vb_cg_c22_match_phy_device, .name = "RTL8221B-VB-CG 2.5Gbps PHY (C22)", @@ -74,7 +74,7 @@ Signed-off-by: Daniel Golle .soft_reset = genphy_soft_reset, .get_features = rtl822x_get_features, .config_aneg = rtl822x_config_aneg, -@@ -1464,6 +1490,7 @@ static struct phy_driver realtek_drvs[] +@@ -1497,6 +1523,7 @@ static struct phy_driver realtek_drvs[] }, { .match_phy_device = rtl8221b_vb_cg_c45_match_phy_device, .name = "RTL8221B-VB-CG 2.5Gbps PHY (C45)", @@ -82,7 +82,7 @@ Signed-off-by: Daniel Golle .soft_reset = genphy_soft_reset, .config_init = rtl822xb_config_init, .get_rate_matching = rtl822xb_get_rate_matching, -@@ -1475,6 +1502,7 @@ static struct phy_driver realtek_drvs[] +@@ -1508,6 +1535,7 @@ static struct phy_driver realtek_drvs[] }, { .match_phy_device = rtl8221b_vn_cg_c22_match_phy_device, .name = "RTL8221B-VM-CG 2.5Gbps PHY (C22)", @@ -90,7 +90,7 @@ Signed-off-by: Daniel Golle .soft_reset = genphy_soft_reset, .get_features = rtl822x_get_features, .config_aneg = rtl822x_config_aneg, -@@ -1488,6 +1516,7 @@ static struct phy_driver realtek_drvs[] +@@ -1521,6 +1549,7 @@ static struct phy_driver realtek_drvs[] }, { .match_phy_device = rtl8221b_vn_cg_c45_match_phy_device, .name = "RTL8221B-VN-CG 2.5Gbps PHY (C45)", diff --git a/target/linux/generic/pending-6.6/720-05-net-phy-realtek-detect-early-version-of-RTL8221B.patch b/target/linux/generic/pending-6.6/720-05-net-phy-realtek-detect-early-version-of-RTL8221B.patch index 6938552d14..63ffd0a0c9 100644 --- a/target/linux/generic/pending-6.6/720-05-net-phy-realtek-detect-early-version-of-RTL8221B.patch +++ b/target/linux/generic/pending-6.6/720-05-net-phy-realtek-detect-early-version-of-RTL8221B.patch @@ -14,7 +14,7 @@ Signed-off-by: Daniel Golle Signed-off-by: Mieczyslaw Nalewaj --- a/drivers/net/phy/realtek.c +++ b/drivers/net/phy/realtek.c -@@ -1120,10 +1120,32 @@ static int rtl8226_match_phy_device(stru +@@ -1139,10 +1139,32 @@ static int rtl8226_match_phy_device(stru static int rtlgen_is_c45_match(struct phy_device *phydev, unsigned int id, bool is_c45) { @@ -49,4 +49,4 @@ Signed-off-by: Mieczyslaw Nalewaj + } } - static int rtl8221b_vb_cg_c22_match_phy_device(struct phy_device *phydev) + static int rtl8221b_match_phy_device(struct phy_device *phydev) diff --git a/target/linux/generic/pending-6.6/720-06-net-phy-realtek-support-interrupt-of-RTL8221B.patch b/target/linux/generic/pending-6.6/720-06-net-phy-realtek-support-interrupt-of-RTL8221B.patch index a796b8f011..c9e15fb463 100644 --- a/target/linux/generic/pending-6.6/720-06-net-phy-realtek-support-interrupt-of-RTL8221B.patch +++ b/target/linux/generic/pending-6.6/720-06-net-phy-realtek-support-interrupt-of-RTL8221B.patch @@ -12,7 +12,7 @@ Signed-off-by: Jianhui Zhao --- a/drivers/net/phy/realtek.c +++ b/drivers/net/phy/realtek.c -@@ -1332,6 +1332,51 @@ static irqreturn_t rtl9000a_handle_inter +@@ -1369,6 +1369,51 @@ static irqreturn_t rtl9000a_handle_inter return IRQ_HANDLED; } @@ -64,7 +64,7 @@ Signed-off-by: Jianhui Zhao static struct phy_driver realtek_drvs[] = { { PHY_ID_MATCH_EXACT(0x00008201), -@@ -1498,6 +1543,8 @@ static struct phy_driver realtek_drvs[] +@@ -1531,6 +1576,8 @@ static struct phy_driver realtek_drvs[] }, { .match_phy_device = rtl8221b_vb_cg_c22_match_phy_device, .name = "RTL8221B-VB-CG 2.5Gbps PHY (C22)", @@ -73,7 +73,7 @@ Signed-off-by: Jianhui Zhao .probe = rtl822x_probe, .soft_reset = genphy_soft_reset, .get_features = rtl822x_get_features, -@@ -1512,6 +1559,8 @@ static struct phy_driver realtek_drvs[] +@@ -1545,6 +1592,8 @@ static struct phy_driver realtek_drvs[] }, { .match_phy_device = rtl8221b_vb_cg_c45_match_phy_device, .name = "RTL8221B-VB-CG 2.5Gbps PHY (C45)", @@ -82,7 +82,7 @@ Signed-off-by: Jianhui Zhao .probe = rtl822x_probe, .soft_reset = genphy_soft_reset, .config_init = rtl822xb_config_init, -@@ -1524,6 +1573,8 @@ static struct phy_driver realtek_drvs[] +@@ -1557,6 +1606,8 @@ static struct phy_driver realtek_drvs[] }, { .match_phy_device = rtl8221b_vn_cg_c22_match_phy_device, .name = "RTL8221B-VM-CG 2.5Gbps PHY (C22)", @@ -91,7 +91,7 @@ Signed-off-by: Jianhui Zhao .probe = rtl822x_probe, .soft_reset = genphy_soft_reset, .get_features = rtl822x_get_features, -@@ -1538,6 +1589,8 @@ static struct phy_driver realtek_drvs[] +@@ -1571,6 +1622,8 @@ static struct phy_driver realtek_drvs[] }, { .match_phy_device = rtl8221b_vn_cg_c45_match_phy_device, .name = "RTL8221B-VN-CG 2.5Gbps PHY (C45)", From 56b2d856a245fbfc64496c50cc66c0205888ea5f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=81lvaro=20Fern=C3=A1ndez=20Rojas?= Date: Mon, 30 Dec 2024 01:01:33 +0100 Subject: [PATCH 22/22] generic: 6.6: backport upstream r8169 patches MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 7a3bcd39ae1f r8169: use helper r8169_mod_reg8_cond to simplify rtl_jumbo_config e3e9e9039fa6 r8169: align WAKE_PHY handling with r8125/r8126 vendor drivers 330dc2297c82 r8169: improve rtl_set_d3_pll_down c507e96b5763 r8169: improve __rtl8169_set_wol 83cb4b470c66 r8169: remove leftover locks after reverted change 2cd02f2fdd8a r8169: improve initialization of RSS registers on RTL8125/RTL8126 a3d8520e6a19 r8169: align RTL8126 EEE config with vendor driver 4af2f60bf737 r8169: align RTL8125/RTL8126 PHY config with vendor driver eb90f876b796 r8169: align RTL8125 EEE config with vendor driver b8bd8c44a266 r8169: fix inconsistent indenting in rtl8169_get_eth_mac_stats f75d1fbe7809 r8169: add support for RTL8125D c4e64095c00c r8169: enable EEE at 2.5G per default on RTL8125B d64113c6bb5e r8169: remove rtl_dash_loop_wait_high/low 1c105bacb160 r8169: avoid duplicated messages if loading firmware fails and switch to warn level ac48430368c1 r8169: don't take RTNL lock in rtl_task() e3fc5139bd8f r8169: implement additional ethtool stats ops b8bf38440ba9 r8169: enable SG/TSO on selected chip versions per default 854d71c555df r8169: remove original workaround for RTL8125 broken rx issue 1ffcc8d41306 r8169: add support for the temperature sensor being available from RTL8125B The following patches require backporting additional linux patches: e2015942e90a r8169: replace custom flag with disable_work() et al e340bff27e63 r8169: copy vendor driver 2.5G/5G EEE advertisement constraints Signed-off-by: Álvaro Fernández Rojas (cherry picked from commit 0eeba04a16fb72b13d90973ef8ba95f0549f973e) --- package/kernel/linux/modules/netdevices.mk | 2 +- ...t-for-the-temperature-sensor-being-a.patch | 83 ++++++++++ ...ginal-workaround-for-RTL8125-broken-.patch | 33 ++++ ...TSO-on-selected-chip-versions-per-de.patch | 52 +++++++ ...plement-additional-ethtool-stats-ops.patch | 130 ++++++++++++++++ ...169-don-t-take-RTNL-lock-in-rtl_task.patch | 50 ++++++ ...icated-messages-if-loading-firmware-.patch | 41 +++++ ...9-remove-rtl_dash_loop_wait_high-low.patch | 82 ++++++++++ ...-EEE-at-2.5G-per-default-on-RTL8125B.patch | 28 ++++ ...v6.13-r8169-add-support-for-RTL8125D.patch | 143 ++++++++++++++++++ ...istent-indenting-in-rtl8169_get_eth_.patch | 30 ++++ ...TL8125-EEE-config-with-vendor-driver.patch | 49 ++++++ ...125-RTL8126-PHY-config-with-vendor-d.patch | 46 ++++++ ...TL8126-EEE-config-with-vendor-driver.patch | 25 +++ ...itialization-of-RSS-registers-on-RTL.patch | 38 +++++ ...leftover-locks-after-reverted-change.patch | 113 ++++++++++++++ ...6.13-r8169-improve-__rtl8169_set_wol.patch | 108 +++++++++++++ ...13-r8169-improve-rtl_set_d3_pll_down.patch | 44 ++++++ ..._PHY-handling-with-r8125-r8126-vendo.patch | 29 ++++ ...-r8169_mod_reg8_cond-to-simplify-rtl.patch | 117 ++++++++++++++ 20 files changed, 1242 insertions(+), 1 deletion(-) create mode 100644 target/linux/generic/backport-6.6/780-24-v6.13-r8169-add-support-for-the-temperature-sensor-being-a.patch create mode 100644 target/linux/generic/backport-6.6/780-25-v6.13-r8169-remove-original-workaround-for-RTL8125-broken-.patch create mode 100644 target/linux/generic/backport-6.6/780-26-v6.13-r8169-enable-SG-TSO-on-selected-chip-versions-per-de.patch create mode 100644 target/linux/generic/backport-6.6/780-27-v6.13-r8169-implement-additional-ethtool-stats-ops.patch create mode 100644 target/linux/generic/backport-6.6/780-28-v6.13-r8169-don-t-take-RTNL-lock-in-rtl_task.patch create mode 100644 target/linux/generic/backport-6.6/780-30-v6.13-r8169-avoid-duplicated-messages-if-loading-firmware-.patch create mode 100644 target/linux/generic/backport-6.6/780-31-v6.13-r8169-remove-rtl_dash_loop_wait_high-low.patch create mode 100644 target/linux/generic/backport-6.6/780-32-v6.13-r8169-enable-EEE-at-2.5G-per-default-on-RTL8125B.patch create mode 100644 target/linux/generic/backport-6.6/780-33-v6.13-r8169-add-support-for-RTL8125D.patch create mode 100644 target/linux/generic/backport-6.6/780-34-v6.13-r8169-fix-inconsistent-indenting-in-rtl8169_get_eth_.patch create mode 100644 target/linux/generic/backport-6.6/780-35-v6.13-r8169-align-RTL8125-EEE-config-with-vendor-driver.patch create mode 100644 target/linux/generic/backport-6.6/780-36-v6.13-r8169-align-RTL8125-RTL8126-PHY-config-with-vendor-d.patch create mode 100644 target/linux/generic/backport-6.6/780-37-v6.13-r8169-align-RTL8126-EEE-config-with-vendor-driver.patch create mode 100644 target/linux/generic/backport-6.6/780-38-v6.13-r8169-improve-initialization-of-RSS-registers-on-RTL.patch create mode 100644 target/linux/generic/backport-6.6/780-39-v6.13-r8169-remove-leftover-locks-after-reverted-change.patch create mode 100644 target/linux/generic/backport-6.6/780-40-v6.13-r8169-improve-__rtl8169_set_wol.patch create mode 100644 target/linux/generic/backport-6.6/780-41-v6.13-r8169-improve-rtl_set_d3_pll_down.patch create mode 100644 target/linux/generic/backport-6.6/780-42-v6.13-r8169-align-WAKE_PHY-handling-with-r8125-r8126-vendo.patch create mode 100644 target/linux/generic/backport-6.6/780-43-v6.13-r8169-use-helper-r8169_mod_reg8_cond-to-simplify-rtl.patch diff --git a/package/kernel/linux/modules/netdevices.mk b/package/kernel/linux/modules/netdevices.mk index cd24fb3ecb..ee9654761b 100644 --- a/package/kernel/linux/modules/netdevices.mk +++ b/package/kernel/linux/modules/netdevices.mk @@ -953,7 +953,7 @@ $(eval $(call KernelPackage,8139cp)) define KernelPackage/r8169 SUBMENU:=$(NETWORK_DEVICES_MENU) TITLE:=RealTek RTL-8169 PCI Gigabit Ethernet Adapter kernel support - DEPENDS:=@PCI_SUPPORT +kmod-mii +r8169-firmware +kmod-phy-realtek +kmod-mdio-devres + DEPENDS:=@PCI_SUPPORT +kmod-mii +r8169-firmware +kmod-phy-realtek +kmod-mdio-devres +kmod-hwmon-core KCONFIG:= \ CONFIG_R8169 \ CONFIG_R8169_LEDS=y diff --git a/target/linux/generic/backport-6.6/780-24-v6.13-r8169-add-support-for-the-temperature-sensor-being-a.patch b/target/linux/generic/backport-6.6/780-24-v6.13-r8169-add-support-for-the-temperature-sensor-being-a.patch new file mode 100644 index 0000000000..2403da5d55 --- /dev/null +++ b/target/linux/generic/backport-6.6/780-24-v6.13-r8169-add-support-for-the-temperature-sensor-being-a.patch @@ -0,0 +1,83 @@ +From 1ffcc8d41306fd2e5f140b276820714a26a11cc4 Mon Sep 17 00:00:00 2001 +From: Heiner Kallweit +Date: Mon, 7 Oct 2024 20:34:12 +0200 +Subject: [PATCH] r8169: add support for the temperature sensor being available + from RTL8125B + +This adds support for the temperature sensor being available from +RTL8125B. Register information was taken from r8125 vendor driver. + +Signed-off-by: Heiner Kallweit +Reviewed-by: Simon Horman +Signed-off-by: David S. Miller +--- + drivers/net/ethernet/realtek/r8169_main.c | 44 +++++++++++++++++++++++ + 1 file changed, 44 insertions(+) + +--- a/drivers/net/ethernet/realtek/r8169_main.c ++++ b/drivers/net/ethernet/realtek/r8169_main.c +@@ -16,6 +16,7 @@ + #include + #include + #include ++#include + #include + #include + #include +@@ -5373,6 +5374,43 @@ static bool rtl_aspm_is_safe(struct rtl8 + return false; + } + ++static umode_t r8169_hwmon_is_visible(const void *drvdata, ++ enum hwmon_sensor_types type, ++ u32 attr, int channel) ++{ ++ return 0444; ++} ++ ++static int r8169_hwmon_read(struct device *dev, enum hwmon_sensor_types type, ++ u32 attr, int channel, long *val) ++{ ++ struct rtl8169_private *tp = dev_get_drvdata(dev); ++ int val_raw; ++ ++ val_raw = phy_read_paged(tp->phydev, 0xbd8, 0x12) & 0x3ff; ++ if (val_raw >= 512) ++ val_raw -= 1024; ++ ++ *val = 1000 * val_raw / 2; ++ ++ return 0; ++} ++ ++static const struct hwmon_ops r8169_hwmon_ops = { ++ .is_visible = r8169_hwmon_is_visible, ++ .read = r8169_hwmon_read, ++}; ++ ++static const struct hwmon_channel_info * const r8169_hwmon_info[] = { ++ HWMON_CHANNEL_INFO(temp, HWMON_T_INPUT), ++ NULL ++}; ++ ++static const struct hwmon_chip_info r8169_hwmon_chip_info = { ++ .ops = &r8169_hwmon_ops, ++ .info = r8169_hwmon_info, ++}; ++ + static int rtl_init_one(struct pci_dev *pdev, const struct pci_device_id *ent) + { + struct rtl8169_private *tp; +@@ -5547,6 +5585,12 @@ static int rtl_init_one(struct pci_dev * + if (rc) + return rc; + ++ /* The temperature sensor is available from RTl8125B */ ++ if (IS_REACHABLE(CONFIG_HWMON) && tp->mac_version >= RTL_GIGA_MAC_VER_63) ++ /* ignore errors */ ++ devm_hwmon_device_register_with_info(&pdev->dev, "nic_temp", tp, ++ &r8169_hwmon_chip_info, ++ NULL); + rc = register_netdev(dev); + if (rc) + return rc; diff --git a/target/linux/generic/backport-6.6/780-25-v6.13-r8169-remove-original-workaround-for-RTL8125-broken-.patch b/target/linux/generic/backport-6.6/780-25-v6.13-r8169-remove-original-workaround-for-RTL8125-broken-.patch new file mode 100644 index 0000000000..8c6e6d8dc4 --- /dev/null +++ b/target/linux/generic/backport-6.6/780-25-v6.13-r8169-remove-original-workaround-for-RTL8125-broken-.patch @@ -0,0 +1,33 @@ +From 854d71c555dfc3383c1fde7d9989b6046e21093d Mon Sep 17 00:00:00 2001 +From: Heiner Kallweit +Date: Wed, 9 Oct 2024 07:48:05 +0200 +Subject: [PATCH] r8169: remove original workaround for RTL8125 broken rx issue + +Now that we have b9c7ac4fe22c ("r8169: disable ALDPS per default for +RTL8125"), the first attempt to fix the issue shouldn't be needed +any longer. So let's effectively revert 621735f59064 ("r8169: fix +rare issue with broken rx after link-down on RTL8125") and see +whether anybody complains. + +Signed-off-by: Heiner Kallweit +Reviewed-by: Simon Horman +Link: https://patch.msgid.link/382d8c88-cbce-400f-ad62-fda0181c7e38@gmail.com +Signed-off-by: Jakub Kicinski +--- + drivers/net/ethernet/realtek/r8169_main.c | 4 ---- + 1 file changed, 4 deletions(-) + +--- a/drivers/net/ethernet/realtek/r8169_main.c ++++ b/drivers/net/ethernet/realtek/r8169_main.c +@@ -4779,11 +4779,7 @@ static void r8169_phylink_handler(struct + if (netif_carrier_ok(ndev)) { + rtl_link_chg_patch(tp); + pm_request_resume(d); +- netif_wake_queue(tp->dev); + } else { +- /* In few cases rx is broken after link-down otherwise */ +- if (rtl_is_8125(tp)) +- rtl_schedule_task(tp, RTL_FLAG_TASK_RESET_NO_QUEUE_WAKE); + pm_runtime_idle(d); + } + diff --git a/target/linux/generic/backport-6.6/780-26-v6.13-r8169-enable-SG-TSO-on-selected-chip-versions-per-de.patch b/target/linux/generic/backport-6.6/780-26-v6.13-r8169-enable-SG-TSO-on-selected-chip-versions-per-de.patch new file mode 100644 index 0000000000..dc05299628 --- /dev/null +++ b/target/linux/generic/backport-6.6/780-26-v6.13-r8169-enable-SG-TSO-on-selected-chip-versions-per-de.patch @@ -0,0 +1,52 @@ +From b8bf38440ba94e8ed8e2ae55c5dfb0276d30e843 Mon Sep 17 00:00:00 2001 +From: Heiner Kallweit +Date: Thu, 10 Oct 2024 12:58:02 +0200 +Subject: [PATCH] r8169: enable SG/TSO on selected chip versions per default + +Due to problem reports in the past SG and TSO/TSO6 are disabled per +default. It's not fully clear which chip versions are affected, so we +may impact also users of unaffected chip versions, unless they know +how to use ethtool for enabling SG/TSO/TSO6. +Vendor drivers r8168/r8125 enable SG/TSO/TSO6 for selected chip +versions per default, I'd interpret this as confirmation that these +chip versions are unaffected. So let's do the same here. + +Signed-off-by: Heiner Kallweit +Reviewed-by: Simon Horman +Signed-off-by: David S. Miller +--- + drivers/net/ethernet/realtek/r8169_main.c | 16 +++++++++++----- + 1 file changed, 11 insertions(+), 5 deletions(-) + +--- a/drivers/net/ethernet/realtek/r8169_main.c ++++ b/drivers/net/ethernet/realtek/r8169_main.c +@@ -5529,11 +5529,6 @@ static int rtl_init_one(struct pci_dev * + + dev->features |= dev->hw_features; + +- /* There has been a number of reports that using SG/TSO results in +- * tx timeouts. However for a lot of people SG/TSO works fine. +- * Therefore disable both features by default, but allow users to +- * enable them. Use at own risk! +- */ + if (rtl_chip_supports_csum_v2(tp)) { + dev->hw_features |= NETIF_F_SG | NETIF_F_TSO | NETIF_F_TSO6; + netif_set_tso_max_size(dev, RTL_GSO_MAX_SIZE_V2); +@@ -5544,6 +5539,17 @@ static int rtl_init_one(struct pci_dev * + netif_set_tso_max_segs(dev, RTL_GSO_MAX_SEGS_V1); + } + ++ /* There has been a number of reports that using SG/TSO results in ++ * tx timeouts. However for a lot of people SG/TSO works fine. ++ * It's not fully clear which chip versions are affected. Vendor ++ * drivers enable SG/TSO for certain chip versions per default, ++ * let's mimic this here. On other chip versions users can ++ * use ethtool to enable SG/TSO, use at own risk! ++ */ ++ if (tp->mac_version >= RTL_GIGA_MAC_VER_46 && ++ tp->mac_version != RTL_GIGA_MAC_VER_61) ++ dev->features |= dev->hw_features; ++ + dev->hw_features |= NETIF_F_RXALL; + dev->hw_features |= NETIF_F_RXFCS; + diff --git a/target/linux/generic/backport-6.6/780-27-v6.13-r8169-implement-additional-ethtool-stats-ops.patch b/target/linux/generic/backport-6.6/780-27-v6.13-r8169-implement-additional-ethtool-stats-ops.patch new file mode 100644 index 0000000000..faab0df7f4 --- /dev/null +++ b/target/linux/generic/backport-6.6/780-27-v6.13-r8169-implement-additional-ethtool-stats-ops.patch @@ -0,0 +1,130 @@ +From e3fc5139bd8ffaa1498adc21be4e8ecbc6aed508 Mon Sep 17 00:00:00 2001 +From: Heiner Kallweit +Date: Sun, 13 Oct 2024 11:17:39 +0200 +Subject: [PATCH] r8169: implement additional ethtool stats ops + +This adds support for ethtool standard statistics, and makes use of the +extended hardware statistics being available from RTl8125. + +Signed-off-by: Heiner Kallweit +Reviewed-by: Simon Horman +Link: https://patch.msgid.link/58e0da73-a7dd-4be3-82ae-d5b3f9069bde@gmail.com +Signed-off-by: Jakub Kicinski +--- + drivers/net/ethernet/realtek/r8169_main.c | 82 +++++++++++++++++++++++ + 1 file changed, 82 insertions(+) + +--- a/drivers/net/ethernet/realtek/r8169_main.c ++++ b/drivers/net/ethernet/realtek/r8169_main.c +@@ -2162,6 +2162,19 @@ static void rtl8169_get_ringparam(struct + data->tx_pending = NUM_TX_DESC; + } + ++static void rtl8169_get_pause_stats(struct net_device *dev, ++ struct ethtool_pause_stats *pause_stats) ++{ ++ struct rtl8169_private *tp = netdev_priv(dev); ++ ++ if (!rtl_is_8125(tp)) ++ return; ++ ++ rtl8169_update_counters(tp); ++ pause_stats->tx_pause_frames = le32_to_cpu(tp->counters->tx_pause_on); ++ pause_stats->rx_pause_frames = le32_to_cpu(tp->counters->rx_pause_on); ++} ++ + static void rtl8169_get_pauseparam(struct net_device *dev, + struct ethtool_pauseparam *data) + { +@@ -2188,6 +2201,69 @@ static int rtl8169_set_pauseparam(struct + return 0; + } + ++static void rtl8169_get_eth_mac_stats(struct net_device *dev, ++ struct ethtool_eth_mac_stats *mac_stats) ++{ ++ struct rtl8169_private *tp = netdev_priv(dev); ++ ++ rtl8169_update_counters(tp); ++ ++ mac_stats->FramesTransmittedOK = ++ le64_to_cpu(tp->counters->tx_packets); ++ mac_stats->SingleCollisionFrames = ++ le32_to_cpu(tp->counters->tx_one_collision); ++ mac_stats->MultipleCollisionFrames = ++ le32_to_cpu(tp->counters->tx_multi_collision); ++ mac_stats->FramesReceivedOK = ++ le64_to_cpu(tp->counters->rx_packets); ++ mac_stats->AlignmentErrors = ++ le16_to_cpu(tp->counters->align_errors); ++ mac_stats->FramesLostDueToIntMACXmitError = ++ le64_to_cpu(tp->counters->tx_errors); ++ mac_stats->BroadcastFramesReceivedOK = ++ le64_to_cpu(tp->counters->rx_broadcast); ++ mac_stats->MulticastFramesReceivedOK = ++ le32_to_cpu(tp->counters->rx_multicast); ++ ++ if (!rtl_is_8125(tp)) ++ return; ++ ++ mac_stats->AlignmentErrors = ++ le32_to_cpu(tp->counters->align_errors32); ++ mac_stats->OctetsTransmittedOK = ++ le64_to_cpu(tp->counters->tx_octets); ++ mac_stats->LateCollisions = ++ le32_to_cpu(tp->counters->tx_late_collision); ++ mac_stats->FramesAbortedDueToXSColls = ++ le32_to_cpu(tp->counters->tx_aborted32); ++ mac_stats->OctetsReceivedOK = ++ le64_to_cpu(tp->counters->rx_octets); ++ mac_stats->FramesLostDueToIntMACRcvError = ++ le32_to_cpu(tp->counters->rx_mac_error); ++ mac_stats->MulticastFramesXmittedOK = ++ le64_to_cpu(tp->counters->tx_multicast64); ++ mac_stats->BroadcastFramesXmittedOK = ++ le64_to_cpu(tp->counters->tx_broadcast64); ++ mac_stats->MulticastFramesReceivedOK = ++ le64_to_cpu(tp->counters->rx_multicast64); ++ mac_stats->FrameTooLongErrors = ++ le32_to_cpu(tp->counters->rx_frame_too_long); ++} ++ ++static void rtl8169_get_eth_ctrl_stats(struct net_device *dev, ++ struct ethtool_eth_ctrl_stats *ctrl_stats) ++{ ++ struct rtl8169_private *tp = netdev_priv(dev); ++ ++ if (!rtl_is_8125(tp)) ++ return; ++ ++ rtl8169_update_counters(tp); ++ ++ ctrl_stats->UnsupportedOpcodesReceived = ++ le32_to_cpu(tp->counters->rx_unknown_opcode); ++} ++ + static const struct ethtool_ops rtl8169_ethtool_ops = { + .supported_coalesce_params = ETHTOOL_COALESCE_USECS | + ETHTOOL_COALESCE_MAX_FRAMES, +@@ -2209,8 +2285,11 @@ static const struct ethtool_ops rtl8169_ + .get_link_ksettings = phy_ethtool_get_link_ksettings, + .set_link_ksettings = phy_ethtool_set_link_ksettings, + .get_ringparam = rtl8169_get_ringparam, ++ .get_pause_stats = rtl8169_get_pause_stats, + .get_pauseparam = rtl8169_get_pauseparam, + .set_pauseparam = rtl8169_set_pauseparam, ++ .get_eth_mac_stats = rtl8169_get_eth_mac_stats, ++ .get_eth_ctrl_stats = rtl8169_get_eth_ctrl_stats, + }; + + static enum mac_version rtl8169_get_mac_version(u16 xid, bool gmii) +@@ -3895,6 +3974,9 @@ static void rtl_hw_start_8125(struct rtl + break; + } + ++ /* enable extended tally counter */ ++ r8168_mac_ocp_modify(tp, 0xea84, 0, BIT(1) | BIT(0)); ++ + rtl_hw_config(tp); + } + diff --git a/target/linux/generic/backport-6.6/780-28-v6.13-r8169-don-t-take-RTNL-lock-in-rtl_task.patch b/target/linux/generic/backport-6.6/780-28-v6.13-r8169-don-t-take-RTNL-lock-in-rtl_task.patch new file mode 100644 index 0000000000..38b5035441 --- /dev/null +++ b/target/linux/generic/backport-6.6/780-28-v6.13-r8169-don-t-take-RTNL-lock-in-rtl_task.patch @@ -0,0 +1,50 @@ +From ac48430368c1a4f4e6c2fa92243b4b93fd25bee4 Mon Sep 17 00:00:00 2001 +From: Heiner Kallweit +Date: Wed, 16 Oct 2024 22:05:57 +0200 +Subject: [PATCH] r8169: don't take RTNL lock in rtl_task() + +There's not really a benefit here in taking the RTNL lock. The task +handler does exception handling only, so we're in trouble anyway when +we come here, and there's no need to protect against e.g. a parallel +ethtool call. +A benefit of removing the RTNL lock here is that we now can +synchronously cancel the workqueue from a context holding the RTNL mutex. + +Signed-off-by: Heiner Kallweit +Signed-off-by: Andrew Lunn +--- + drivers/net/ethernet/realtek/r8169_main.c | 8 ++------ + 1 file changed, 2 insertions(+), 6 deletions(-) + +--- a/drivers/net/ethernet/realtek/r8169_main.c ++++ b/drivers/net/ethernet/realtek/r8169_main.c +@@ -4802,10 +4802,8 @@ static void rtl_task(struct work_struct + container_of(work, struct rtl8169_private, wk.work); + int ret; + +- rtnl_lock(); +- + if (!test_bit(RTL_FLAG_TASK_ENABLED, tp->wk.flags)) +- goto out_unlock; ++ return; + + if (test_and_clear_bit(RTL_FLAG_TASK_TX_TIMEOUT, tp->wk.flags)) { + /* if chip isn't accessible, reset bus to revive it */ +@@ -4814,7 +4812,7 @@ static void rtl_task(struct work_struct + if (ret < 0) { + netdev_err(tp->dev, "Can't reset secondary PCI bus, detach NIC\n"); + netif_device_detach(tp->dev); +- goto out_unlock; ++ return; + } + } + +@@ -4833,8 +4831,6 @@ reset: + } else if (test_and_clear_bit(RTL_FLAG_TASK_RESET_NO_QUEUE_WAKE, tp->wk.flags)) { + rtl_reset_work(tp); + } +-out_unlock: +- rtnl_unlock(); + } + + static int rtl8169_poll(struct napi_struct *napi, int budget) diff --git a/target/linux/generic/backport-6.6/780-30-v6.13-r8169-avoid-duplicated-messages-if-loading-firmware-.patch b/target/linux/generic/backport-6.6/780-30-v6.13-r8169-avoid-duplicated-messages-if-loading-firmware-.patch new file mode 100644 index 0000000000..6430d32252 --- /dev/null +++ b/target/linux/generic/backport-6.6/780-30-v6.13-r8169-avoid-duplicated-messages-if-loading-firmware-.patch @@ -0,0 +1,41 @@ +From 1c105bacb160b5918e917ab811552b7be69fc69c Mon Sep 17 00:00:00 2001 +From: Heiner Kallweit +Date: Wed, 16 Oct 2024 22:29:39 +0200 +Subject: [PATCH] r8169: avoid duplicated messages if loading firmware fails + and switch to warn level + +In case of a problem with firmware loading we inform at the driver level, +in addition the firmware load code itself issues warnings. Therefore +switch to firmware_request_nowarn() to avoid duplicated error messages. +In addition switch to warn level because the firmware is optional and +typically just fixes compatibility issues. + +Signed-off-by: Heiner Kallweit +Reviewed-by: Simon Horman +Message-ID: +Signed-off-by: Andrew Lunn +--- + drivers/net/ethernet/realtek/r8169_firmware.c | 6 +++--- + 1 file changed, 3 insertions(+), 3 deletions(-) + +--- a/drivers/net/ethernet/realtek/r8169_firmware.c ++++ b/drivers/net/ethernet/realtek/r8169_firmware.c +@@ -215,7 +215,7 @@ int rtl_fw_request_firmware(struct rtl_f + { + int rc; + +- rc = request_firmware(&rtl_fw->fw, rtl_fw->fw_name, rtl_fw->dev); ++ rc = firmware_request_nowarn(&rtl_fw->fw, rtl_fw->fw_name, rtl_fw->dev); + if (rc < 0) + goto out; + +@@ -227,7 +227,7 @@ int rtl_fw_request_firmware(struct rtl_f + + return 0; + out: +- dev_err(rtl_fw->dev, "Unable to load firmware %s (%d)\n", +- rtl_fw->fw_name, rc); ++ dev_warn(rtl_fw->dev, "Unable to load firmware %s (%d)\n", ++ rtl_fw->fw_name, rc); + return rc; + } diff --git a/target/linux/generic/backport-6.6/780-31-v6.13-r8169-remove-rtl_dash_loop_wait_high-low.patch b/target/linux/generic/backport-6.6/780-31-v6.13-r8169-remove-rtl_dash_loop_wait_high-low.patch new file mode 100644 index 0000000000..4792e371b6 --- /dev/null +++ b/target/linux/generic/backport-6.6/780-31-v6.13-r8169-remove-rtl_dash_loop_wait_high-low.patch @@ -0,0 +1,82 @@ +From d64113c6bb5ea5a70b7c9c3a6bcadef307638187 Mon Sep 17 00:00:00 2001 +From: Heiner Kallweit +Date: Wed, 16 Oct 2024 22:31:10 +0200 +Subject: [PATCH] r8169: remove rtl_dash_loop_wait_high/low + +Remove rtl_dash_loop_wait_high/low to simplify the code. + +Signed-off-by: Heiner Kallweit +Reviewed-by: Simon Horman +Message-ID: +Signed-off-by: Andrew Lunn +--- + drivers/net/ethernet/realtek/r8169_main.c | 35 ++++++----------------- + 1 file changed, 8 insertions(+), 27 deletions(-) + +--- a/drivers/net/ethernet/realtek/r8169_main.c ++++ b/drivers/net/ethernet/realtek/r8169_main.c +@@ -1347,40 +1347,19 @@ static void rtl8168ep_stop_cmac(struct r + RTL_W8(tp, IBCR0, RTL_R8(tp, IBCR0) & ~0x01); + } + +-static void rtl_dash_loop_wait(struct rtl8169_private *tp, +- const struct rtl_cond *c, +- unsigned long usecs, int n, bool high) +-{ +- if (!tp->dash_enabled) +- return; +- rtl_loop_wait(tp, c, usecs, n, high); +-} +- +-static void rtl_dash_loop_wait_high(struct rtl8169_private *tp, +- const struct rtl_cond *c, +- unsigned long d, int n) +-{ +- rtl_dash_loop_wait(tp, c, d, n, true); +-} +- +-static void rtl_dash_loop_wait_low(struct rtl8169_private *tp, +- const struct rtl_cond *c, +- unsigned long d, int n) +-{ +- rtl_dash_loop_wait(tp, c, d, n, false); +-} +- + static void rtl8168dp_driver_start(struct rtl8169_private *tp) + { + r8168dp_oob_notify(tp, OOB_CMD_DRIVER_START); +- rtl_dash_loop_wait_high(tp, &rtl_dp_ocp_read_cond, 10000, 10); ++ if (tp->dash_enabled) ++ rtl_loop_wait_high(tp, &rtl_dp_ocp_read_cond, 10000, 10); + } + + static void rtl8168ep_driver_start(struct rtl8169_private *tp) + { + r8168ep_ocp_write(tp, 0x01, 0x180, OOB_CMD_DRIVER_START); + r8168ep_ocp_write(tp, 0x01, 0x30, r8168ep_ocp_read(tp, 0x30) | 0x01); +- rtl_dash_loop_wait_high(tp, &rtl_ep_ocp_read_cond, 10000, 30); ++ if (tp->dash_enabled) ++ rtl_loop_wait_high(tp, &rtl_ep_ocp_read_cond, 10000, 30); + } + + static void rtl8168_driver_start(struct rtl8169_private *tp) +@@ -1394,7 +1373,8 @@ static void rtl8168_driver_start(struct + static void rtl8168dp_driver_stop(struct rtl8169_private *tp) + { + r8168dp_oob_notify(tp, OOB_CMD_DRIVER_STOP); +- rtl_dash_loop_wait_low(tp, &rtl_dp_ocp_read_cond, 10000, 10); ++ if (tp->dash_enabled) ++ rtl_loop_wait_low(tp, &rtl_dp_ocp_read_cond, 10000, 10); + } + + static void rtl8168ep_driver_stop(struct rtl8169_private *tp) +@@ -1402,7 +1382,8 @@ static void rtl8168ep_driver_stop(struct + rtl8168ep_stop_cmac(tp); + r8168ep_ocp_write(tp, 0x01, 0x180, OOB_CMD_DRIVER_STOP); + r8168ep_ocp_write(tp, 0x01, 0x30, r8168ep_ocp_read(tp, 0x30) | 0x01); +- rtl_dash_loop_wait_low(tp, &rtl_ep_ocp_read_cond, 10000, 10); ++ if (tp->dash_enabled) ++ rtl_loop_wait_low(tp, &rtl_ep_ocp_read_cond, 10000, 10); + } + + static void rtl8168_driver_stop(struct rtl8169_private *tp) diff --git a/target/linux/generic/backport-6.6/780-32-v6.13-r8169-enable-EEE-at-2.5G-per-default-on-RTL8125B.patch b/target/linux/generic/backport-6.6/780-32-v6.13-r8169-enable-EEE-at-2.5G-per-default-on-RTL8125B.patch new file mode 100644 index 0000000000..4ec06cc601 --- /dev/null +++ b/target/linux/generic/backport-6.6/780-32-v6.13-r8169-enable-EEE-at-2.5G-per-default-on-RTL8125B.patch @@ -0,0 +1,28 @@ +From c4e64095c00cb2de413cd6b90be047c273bcd491 Mon Sep 17 00:00:00 2001 +From: Heiner Kallweit +Date: Thu, 17 Oct 2024 22:27:44 +0200 +Subject: [PATCH] r8169: enable EEE at 2.5G per default on RTL8125B + +Register a6d/12 is shadowing register MDIO_AN_EEE_ADV2. So this line +disables advertisement of EEE at 2.5G. Latest vendor driver r8125 +doesn't do this (any longer?), so this mode seems to be safe. +EEE saves quite some energy, therefore enable this mode per default. + +Signed-off-by: Heiner Kallweit +Reviewed-by: Simon Horman +Message-ID: <95dd5a0c-09ea-4847-94d9-b7aa3063e8ff@gmail.com> +Signed-off-by: Andrew Lunn +--- + drivers/net/ethernet/realtek/r8169_phy_config.c | 1 - + 1 file changed, 1 deletion(-) + +--- a/drivers/net/ethernet/realtek/r8169_phy_config.c ++++ b/drivers/net/ethernet/realtek/r8169_phy_config.c +@@ -99,7 +99,6 @@ static void rtl8125a_config_eee_phy(stru + + static void rtl8125b_config_eee_phy(struct phy_device *phydev) + { +- phy_modify_paged(phydev, 0xa6d, 0x12, 0x0001, 0x0000); + phy_modify_paged(phydev, 0xa6d, 0x14, 0x0010, 0x0000); + phy_modify_paged(phydev, 0xa42, 0x14, 0x0080, 0x0000); + phy_modify_paged(phydev, 0xa4a, 0x11, 0x0200, 0x0000); diff --git a/target/linux/generic/backport-6.6/780-33-v6.13-r8169-add-support-for-RTL8125D.patch b/target/linux/generic/backport-6.6/780-33-v6.13-r8169-add-support-for-RTL8125D.patch new file mode 100644 index 0000000000..81058e5e9f --- /dev/null +++ b/target/linux/generic/backport-6.6/780-33-v6.13-r8169-add-support-for-RTL8125D.patch @@ -0,0 +1,143 @@ +From f75d1fbe7809bc5ed134204b920fd9e2fc5db1df Mon Sep 17 00:00:00 2001 +From: Heiner Kallweit +Date: Thu, 24 Oct 2024 22:42:33 +0200 +Subject: [PATCH] r8169: add support for RTL8125D + +This adds support for new chip version RTL8125D, which can be found on +boards like Gigabyte X870E AORUS ELITE WIFI7. Firmware rtl8125d-1.fw +for this chip version is available in linux-firmware already. + +Signed-off-by: Heiner Kallweit +Reviewed-by: Simon Horman +Link: https://patch.msgid.link/d0306912-e88e-4c25-8b5d-545ae8834c0c@gmail.com +Signed-off-by: Jakub Kicinski +--- + drivers/net/ethernet/realtek/r8169.h | 1 + + drivers/net/ethernet/realtek/r8169_main.c | 23 +++++++++++++------ + .../net/ethernet/realtek/r8169_phy_config.c | 10 ++++++++ + 3 files changed, 27 insertions(+), 7 deletions(-) + +--- a/drivers/net/ethernet/realtek/r8169.h ++++ b/drivers/net/ethernet/realtek/r8169.h +@@ -68,6 +68,7 @@ enum mac_version { + /* support for RTL_GIGA_MAC_VER_60 has been removed */ + RTL_GIGA_MAC_VER_61, + RTL_GIGA_MAC_VER_63, ++ RTL_GIGA_MAC_VER_64, + RTL_GIGA_MAC_VER_65, + RTL_GIGA_MAC_VER_66, + RTL_GIGA_MAC_NONE +--- a/drivers/net/ethernet/realtek/r8169_main.c ++++ b/drivers/net/ethernet/realtek/r8169_main.c +@@ -56,6 +56,7 @@ + #define FIRMWARE_8107E_2 "rtl_nic/rtl8107e-2.fw" + #define FIRMWARE_8125A_3 "rtl_nic/rtl8125a-3.fw" + #define FIRMWARE_8125B_2 "rtl_nic/rtl8125b-2.fw" ++#define FIRMWARE_8125D_1 "rtl_nic/rtl8125d-1.fw" + #define FIRMWARE_8126A_2 "rtl_nic/rtl8126a-2.fw" + #define FIRMWARE_8126A_3 "rtl_nic/rtl8126a-3.fw" + +@@ -139,6 +140,7 @@ static const struct { + [RTL_GIGA_MAC_VER_61] = {"RTL8125A", FIRMWARE_8125A_3}, + /* reserve 62 for CFG_METHOD_4 in the vendor driver */ + [RTL_GIGA_MAC_VER_63] = {"RTL8125B", FIRMWARE_8125B_2}, ++ [RTL_GIGA_MAC_VER_64] = {"RTL8125D", FIRMWARE_8125D_1}, + [RTL_GIGA_MAC_VER_65] = {"RTL8126A", FIRMWARE_8126A_2}, + [RTL_GIGA_MAC_VER_66] = {"RTL8126A", FIRMWARE_8126A_3}, + }; +@@ -708,6 +710,7 @@ MODULE_FIRMWARE(FIRMWARE_8168FP_3); + MODULE_FIRMWARE(FIRMWARE_8107E_2); + MODULE_FIRMWARE(FIRMWARE_8125A_3); + MODULE_FIRMWARE(FIRMWARE_8125B_2); ++MODULE_FIRMWARE(FIRMWARE_8125D_1); + MODULE_FIRMWARE(FIRMWARE_8126A_2); + MODULE_FIRMWARE(FIRMWARE_8126A_3); + +@@ -2080,10 +2083,7 @@ static void rtl_set_eee_txidle_timer(str + tp->tx_lpi_timer = timer_val; + r8168_mac_ocp_write(tp, 0xe048, timer_val); + break; +- case RTL_GIGA_MAC_VER_61: +- case RTL_GIGA_MAC_VER_63: +- case RTL_GIGA_MAC_VER_65: +- case RTL_GIGA_MAC_VER_66: ++ case RTL_GIGA_MAC_VER_61 ... RTL_GIGA_MAC_VER_66: + tp->tx_lpi_timer = timer_val; + RTL_W16(tp, EEE_TXIDLE_TIMER_8125, timer_val); + break; +@@ -2295,6 +2295,9 @@ static enum mac_version rtl8169_get_mac_ + { 0x7cf, 0x64a, RTL_GIGA_MAC_VER_66 }, + { 0x7cf, 0x649, RTL_GIGA_MAC_VER_65 }, + ++ /* 8125D family. */ ++ { 0x7cf, 0x688, RTL_GIGA_MAC_VER_64 }, ++ + /* 8125B family. */ + { 0x7cf, 0x641, RTL_GIGA_MAC_VER_63 }, + +@@ -2562,9 +2565,7 @@ static void rtl_init_rxcfg(struct rtl816 + case RTL_GIGA_MAC_VER_61: + RTL_W32(tp, RxConfig, RX_FETCH_DFLT_8125 | RX_DMA_BURST); + break; +- case RTL_GIGA_MAC_VER_63: +- case RTL_GIGA_MAC_VER_65: +- case RTL_GIGA_MAC_VER_66: ++ case RTL_GIGA_MAC_VER_63 ... RTL_GIGA_MAC_VER_66: + RTL_W32(tp, RxConfig, RX_FETCH_DFLT_8125 | RX_DMA_BURST | + RX_PAUSE_SLOT_ON); + break; +@@ -3876,6 +3877,12 @@ static void rtl_hw_start_8125b(struct rt + rtl_hw_start_8125_common(tp); + } + ++static void rtl_hw_start_8125d(struct rtl8169_private *tp) ++{ ++ rtl_set_def_aspm_entry_latency(tp); ++ rtl_hw_start_8125_common(tp); ++} ++ + static void rtl_hw_start_8126a(struct rtl8169_private *tp) + { + rtl_set_def_aspm_entry_latency(tp); +@@ -3924,6 +3931,7 @@ static void rtl_hw_config(struct rtl8169 + [RTL_GIGA_MAC_VER_53] = rtl_hw_start_8117, + [RTL_GIGA_MAC_VER_61] = rtl_hw_start_8125a_2, + [RTL_GIGA_MAC_VER_63] = rtl_hw_start_8125b, ++ [RTL_GIGA_MAC_VER_64] = rtl_hw_start_8125d, + [RTL_GIGA_MAC_VER_65] = rtl_hw_start_8126a, + [RTL_GIGA_MAC_VER_66] = rtl_hw_start_8126a, + }; +@@ -3941,6 +3949,7 @@ static void rtl_hw_start_8125(struct rtl + /* disable interrupt coalescing */ + switch (tp->mac_version) { + case RTL_GIGA_MAC_VER_61: ++ case RTL_GIGA_MAC_VER_64: + for (i = 0xa00; i < 0xb00; i += 4) + RTL_W32(tp, i, 0); + break; +--- a/drivers/net/ethernet/realtek/r8169_phy_config.c ++++ b/drivers/net/ethernet/realtek/r8169_phy_config.c +@@ -1103,6 +1103,15 @@ static void rtl8125b_hw_phy_config(struc + rtl8125b_config_eee_phy(phydev); + } + ++static void rtl8125d_hw_phy_config(struct rtl8169_private *tp, ++ struct phy_device *phydev) ++{ ++ r8169_apply_firmware(tp); ++ rtl8125_legacy_force_mode(phydev); ++ rtl8168g_disable_aldps(phydev); ++ rtl8125b_config_eee_phy(phydev); ++} ++ + static void rtl8126a_hw_phy_config(struct rtl8169_private *tp, + struct phy_device *phydev) + { +@@ -1159,6 +1168,7 @@ void r8169_hw_phy_config(struct rtl8169_ + [RTL_GIGA_MAC_VER_53] = rtl8117_hw_phy_config, + [RTL_GIGA_MAC_VER_61] = rtl8125a_2_hw_phy_config, + [RTL_GIGA_MAC_VER_63] = rtl8125b_hw_phy_config, ++ [RTL_GIGA_MAC_VER_64] = rtl8125d_hw_phy_config, + [RTL_GIGA_MAC_VER_65] = rtl8126a_hw_phy_config, + [RTL_GIGA_MAC_VER_66] = rtl8126a_hw_phy_config, + }; diff --git a/target/linux/generic/backport-6.6/780-34-v6.13-r8169-fix-inconsistent-indenting-in-rtl8169_get_eth_.patch b/target/linux/generic/backport-6.6/780-34-v6.13-r8169-fix-inconsistent-indenting-in-rtl8169_get_eth_.patch new file mode 100644 index 0000000000..721e51ebf0 --- /dev/null +++ b/target/linux/generic/backport-6.6/780-34-v6.13-r8169-fix-inconsistent-indenting-in-rtl8169_get_eth_.patch @@ -0,0 +1,30 @@ +From b8bd8c44a266c9a7dcb907eab10fbb119e3f6494 Mon Sep 17 00:00:00 2001 +From: Heiner Kallweit +Date: Thu, 24 Oct 2024 22:48:59 +0200 +Subject: [PATCH] r8169: fix inconsistent indenting in + rtl8169_get_eth_mac_stats + +This fixes an inconsistent indenting introduced with e3fc5139bd8f +("r8169: implement additional ethtool stats ops"). + +Reported-by: kernel test robot +Closes: https://lore.kernel.org/oe-kbuild-all/202410220413.1gAxIJ4t-lkp@intel.com/ +Signed-off-by: Heiner Kallweit +Reviewed-by: Simon Horman +Link: https://patch.msgid.link/20fd6f39-3c1b-4af0-9adc-7d1f49728fad@gmail.com +Signed-off-by: Jakub Kicinski +--- + drivers/net/ethernet/realtek/r8169_main.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/drivers/net/ethernet/realtek/r8169_main.c ++++ b/drivers/net/ethernet/realtek/r8169_main.c +@@ -2227,7 +2227,7 @@ static void rtl8169_get_eth_mac_stats(st + le64_to_cpu(tp->counters->tx_broadcast64); + mac_stats->MulticastFramesReceivedOK = + le64_to_cpu(tp->counters->rx_multicast64); +- mac_stats->FrameTooLongErrors = ++ mac_stats->FrameTooLongErrors = + le32_to_cpu(tp->counters->rx_frame_too_long); + } + diff --git a/target/linux/generic/backport-6.6/780-35-v6.13-r8169-align-RTL8125-EEE-config-with-vendor-driver.patch b/target/linux/generic/backport-6.6/780-35-v6.13-r8169-align-RTL8125-EEE-config-with-vendor-driver.patch new file mode 100644 index 0000000000..de2be0165c --- /dev/null +++ b/target/linux/generic/backport-6.6/780-35-v6.13-r8169-align-RTL8125-EEE-config-with-vendor-driver.patch @@ -0,0 +1,49 @@ +From eb90f876b7961d702d7fc549e14614860f531e60 Mon Sep 17 00:00:00 2001 +From: Heiner Kallweit +Date: Thu, 31 Oct 2024 22:42:52 +0100 +Subject: [PATCH] r8169: align RTL8125 EEE config with vendor driver + +Align the EEE config for RTL8125A/RTL8125B with vendor driver r8125. +This should help to avoid compatibility issues. + +Signed-off-by: Heiner Kallweit +Link: https://patch.msgid.link/044c925e-8669-4b98-87df-95b4056f4f5f@gmail.com +Signed-off-by: Jakub Kicinski +--- + .../net/ethernet/realtek/r8169_phy_config.c | 18 ++++++++++++------ + 1 file changed, 12 insertions(+), 6 deletions(-) + +--- a/drivers/net/ethernet/realtek/r8169_phy_config.c ++++ b/drivers/net/ethernet/realtek/r8169_phy_config.c +@@ -89,19 +89,25 @@ static void rtl8168h_config_eee_phy(stru + phy_modify_paged(phydev, 0xa42, 0x14, 0x0000, 0x0080); + } + +-static void rtl8125a_config_eee_phy(struct phy_device *phydev) ++static void rtl8125_common_config_eee_phy(struct phy_device *phydev) + { +- rtl8168h_config_eee_phy(phydev); ++ phy_modify_paged(phydev, 0xa6d, 0x14, 0x0010, 0x0000); ++ phy_modify_paged(phydev, 0xa42, 0x14, 0x0080, 0x0000); ++ phy_modify_paged(phydev, 0xa4a, 0x11, 0x0200, 0x0000); ++} + ++static void rtl8125a_config_eee_phy(struct phy_device *phydev) ++{ ++ rtl8168g_config_eee_phy(phydev); ++ /* disable EEE at 2.5Gbps */ + phy_modify_paged(phydev, 0xa6d, 0x12, 0x0001, 0x0000); +- phy_modify_paged(phydev, 0xa6d, 0x14, 0x0010, 0x0000); ++ rtl8125_common_config_eee_phy(phydev); + } + + static void rtl8125b_config_eee_phy(struct phy_device *phydev) + { +- phy_modify_paged(phydev, 0xa6d, 0x14, 0x0010, 0x0000); +- phy_modify_paged(phydev, 0xa42, 0x14, 0x0080, 0x0000); +- phy_modify_paged(phydev, 0xa4a, 0x11, 0x0200, 0x0000); ++ rtl8168g_config_eee_phy(phydev); ++ rtl8125_common_config_eee_phy(phydev); + } + + static void rtl8169s_hw_phy_config(struct rtl8169_private *tp, diff --git a/target/linux/generic/backport-6.6/780-36-v6.13-r8169-align-RTL8125-RTL8126-PHY-config-with-vendor-d.patch b/target/linux/generic/backport-6.6/780-36-v6.13-r8169-align-RTL8125-RTL8126-PHY-config-with-vendor-d.patch new file mode 100644 index 0000000000..a546c426b4 --- /dev/null +++ b/target/linux/generic/backport-6.6/780-36-v6.13-r8169-align-RTL8125-RTL8126-PHY-config-with-vendor-d.patch @@ -0,0 +1,46 @@ +From 4af2f60bf7378bd5c92b15a528d8c6c7d02bed6c Mon Sep 17 00:00:00 2001 +From: Heiner Kallweit +Date: Thu, 31 Oct 2024 22:43:45 +0100 +Subject: [PATCH] r8169: align RTL8125/RTL8126 PHY config with vendor driver + +This aligns some parameters with vendor driver r8125/r8126 to avoid +compatibility issues. Note that for RTL8125B there's no functional +change, just the open-coded version of the function is replaced. + +Signed-off-by: Heiner Kallweit +Link: https://patch.msgid.link/a8a9d896-fbe6-41f2-bf87-666567d3cdb3@gmail.com +Signed-off-by: Jakub Kicinski +--- + drivers/net/ethernet/realtek/r8169_phy_config.c | 6 +++++- + 1 file changed, 5 insertions(+), 1 deletion(-) + +--- a/drivers/net/ethernet/realtek/r8169_phy_config.c ++++ b/drivers/net/ethernet/realtek/r8169_phy_config.c +@@ -1073,8 +1073,8 @@ static void rtl8125b_hw_phy_config(struc + struct phy_device *phydev) + { + r8169_apply_firmware(tp); ++ rtl8168g_enable_gphy_10m(phydev); + +- phy_modify_paged(phydev, 0xa44, 0x11, 0x0000, 0x0800); + phy_modify_paged(phydev, 0xac4, 0x13, 0x00f0, 0x0090); + phy_modify_paged(phydev, 0xad3, 0x10, 0x0003, 0x0001); + +@@ -1113,6 +1113,7 @@ static void rtl8125d_hw_phy_config(struc + struct phy_device *phydev) + { + r8169_apply_firmware(tp); ++ rtl8168g_enable_gphy_10m(phydev); + rtl8125_legacy_force_mode(phydev); + rtl8168g_disable_aldps(phydev); + rtl8125b_config_eee_phy(phydev); +@@ -1122,6 +1123,9 @@ static void rtl8126a_hw_phy_config(struc + struct phy_device *phydev) + { + r8169_apply_firmware(tp); ++ rtl8168g_enable_gphy_10m(phydev); ++ rtl8125_legacy_force_mode(phydev); ++ rtl8168g_disable_aldps(phydev); + } + + void r8169_hw_phy_config(struct rtl8169_private *tp, struct phy_device *phydev, diff --git a/target/linux/generic/backport-6.6/780-37-v6.13-r8169-align-RTL8126-EEE-config-with-vendor-driver.patch b/target/linux/generic/backport-6.6/780-37-v6.13-r8169-align-RTL8126-EEE-config-with-vendor-driver.patch new file mode 100644 index 0000000000..36c8041c94 --- /dev/null +++ b/target/linux/generic/backport-6.6/780-37-v6.13-r8169-align-RTL8126-EEE-config-with-vendor-driver.patch @@ -0,0 +1,25 @@ +From a3d8520e6a19ab018da6c7fc22512c913697a829 Mon Sep 17 00:00:00 2001 +From: Heiner Kallweit +Date: Thu, 31 Oct 2024 22:44:36 +0100 +Subject: [PATCH] r8169: align RTL8126 EEE config with vendor driver + +Align the EEE config for RTL8126A with vendor driver r8126 to avoid +compatibility issues. + +Signed-off-by: Heiner Kallweit +Link: https://patch.msgid.link/71e4859e-4cd0-4b6b-b7fa-621d7721992f@gmail.com +Signed-off-by: Jakub Kicinski +--- + drivers/net/ethernet/realtek/r8169_phy_config.c | 1 + + 1 file changed, 1 insertion(+) + +--- a/drivers/net/ethernet/realtek/r8169_phy_config.c ++++ b/drivers/net/ethernet/realtek/r8169_phy_config.c +@@ -1126,6 +1126,7 @@ static void rtl8126a_hw_phy_config(struc + rtl8168g_enable_gphy_10m(phydev); + rtl8125_legacy_force_mode(phydev); + rtl8168g_disable_aldps(phydev); ++ rtl8125_common_config_eee_phy(phydev); + } + + void r8169_hw_phy_config(struct rtl8169_private *tp, struct phy_device *phydev, diff --git a/target/linux/generic/backport-6.6/780-38-v6.13-r8169-improve-initialization-of-RSS-registers-on-RTL.patch b/target/linux/generic/backport-6.6/780-38-v6.13-r8169-improve-initialization-of-RSS-registers-on-RTL.patch new file mode 100644 index 0000000000..8cb79c82cf --- /dev/null +++ b/target/linux/generic/backport-6.6/780-38-v6.13-r8169-improve-initialization-of-RSS-registers-on-RTL.patch @@ -0,0 +1,38 @@ +From 2cd02f2fdd8a92e5b6b85ff64eab0fc549b30c07 Mon Sep 17 00:00:00 2001 +From: Heiner Kallweit +Date: Sat, 2 Nov 2024 14:49:01 +0100 +Subject: [PATCH] r8169: improve initialization of RSS registers on + RTL8125/RTL8126 + +Replace the register addresses with the names used in r8125/r8126 +vendor driver, and consider that RSS_CTRL_8125 is a 32 bit register. + +Signed-off-by: Heiner Kallweit +Link: https://patch.msgid.link/3bf2f340-b369-4174-97bf-fd38d4217492@gmail.com +Signed-off-by: Jakub Kicinski +--- + drivers/net/ethernet/realtek/r8169_main.c | 6 ++++-- + 1 file changed, 4 insertions(+), 2 deletions(-) + +--- a/drivers/net/ethernet/realtek/r8169_main.c ++++ b/drivers/net/ethernet/realtek/r8169_main.c +@@ -347,6 +347,8 @@ enum rtl8125_registers { + TxPoll_8125 = 0x90, + LEDSEL3 = 0x96, + MAC0_BKP = 0x19e0, ++ RSS_CTRL_8125 = 0x4500, ++ Q_NUM_CTRL_8125 = 0x4800, + EEE_TXIDLE_TIMER_8125 = 0x6048, + }; + +@@ -3770,8 +3772,8 @@ static void rtl_hw_start_8125_common(str + rtl_pcie_state_l2l3_disable(tp); + + RTL_W16(tp, 0x382, 0x221b); +- RTL_W8(tp, 0x4500, 0); +- RTL_W16(tp, 0x4800, 0); ++ RTL_W32(tp, RSS_CTRL_8125, 0); ++ RTL_W16(tp, Q_NUM_CTRL_8125, 0); + + /* disable UPS */ + r8168_mac_ocp_modify(tp, 0xd40a, 0x0010, 0x0000); diff --git a/target/linux/generic/backport-6.6/780-39-v6.13-r8169-remove-leftover-locks-after-reverted-change.patch b/target/linux/generic/backport-6.6/780-39-v6.13-r8169-remove-leftover-locks-after-reverted-change.patch new file mode 100644 index 0000000000..20c42955e3 --- /dev/null +++ b/target/linux/generic/backport-6.6/780-39-v6.13-r8169-remove-leftover-locks-after-reverted-change.patch @@ -0,0 +1,113 @@ +From 83cb4b470c66b37b19a347a35cea01e0cbdd258d Mon Sep 17 00:00:00 2001 +From: Heiner Kallweit +Date: Mon, 4 Nov 2024 23:16:20 +0100 +Subject: [PATCH] r8169: remove leftover locks after reverted change + +After e31a9fedc7d8 ("Revert "r8169: disable ASPM during NAPI poll"") +these locks aren't needed any longer. + +Signed-off-by: Heiner Kallweit +Link: https://patch.msgid.link/680f2606-ac7d-4ced-8694-e5033855da9b@gmail.com +Signed-off-by: Jakub Kicinski +--- + drivers/net/ethernet/realtek/r8169_main.c | 29 ++--------------------- + 1 file changed, 2 insertions(+), 27 deletions(-) + +--- a/drivers/net/ethernet/realtek/r8169_main.c ++++ b/drivers/net/ethernet/realtek/r8169_main.c +@@ -663,13 +663,9 @@ struct rtl8169_private { + struct work_struct work; + } wk; + +- raw_spinlock_t config25_lock; + raw_spinlock_t mac_ocp_lock; + struct mutex led_lock; /* serialize LED ctrl RMW access */ + +- raw_spinlock_t cfg9346_usage_lock; +- int cfg9346_usage_count; +- + unsigned supports_gmii:1; + unsigned aspm_manageable:1; + unsigned dash_enabled:1; +@@ -723,22 +719,12 @@ static inline struct device *tp_to_dev(s + + static void rtl_lock_config_regs(struct rtl8169_private *tp) + { +- unsigned long flags; +- +- raw_spin_lock_irqsave(&tp->cfg9346_usage_lock, flags); +- if (!--tp->cfg9346_usage_count) +- RTL_W8(tp, Cfg9346, Cfg9346_Lock); +- raw_spin_unlock_irqrestore(&tp->cfg9346_usage_lock, flags); ++ RTL_W8(tp, Cfg9346, Cfg9346_Lock); + } + + static void rtl_unlock_config_regs(struct rtl8169_private *tp) + { +- unsigned long flags; +- +- raw_spin_lock_irqsave(&tp->cfg9346_usage_lock, flags); +- if (!tp->cfg9346_usage_count++) +- RTL_W8(tp, Cfg9346, Cfg9346_Unlock); +- raw_spin_unlock_irqrestore(&tp->cfg9346_usage_lock, flags); ++ RTL_W8(tp, Cfg9346, Cfg9346_Unlock); + } + + static void rtl_pci_commit(struct rtl8169_private *tp) +@@ -749,24 +735,18 @@ static void rtl_pci_commit(struct rtl816 + + static void rtl_mod_config2(struct rtl8169_private *tp, u8 clear, u8 set) + { +- unsigned long flags; + u8 val; + +- raw_spin_lock_irqsave(&tp->config25_lock, flags); + val = RTL_R8(tp, Config2); + RTL_W8(tp, Config2, (val & ~clear) | set); +- raw_spin_unlock_irqrestore(&tp->config25_lock, flags); + } + + static void rtl_mod_config5(struct rtl8169_private *tp, u8 clear, u8 set) + { +- unsigned long flags; + u8 val; + +- raw_spin_lock_irqsave(&tp->config25_lock, flags); + val = RTL_R8(tp, Config5); + RTL_W8(tp, Config5, (val & ~clear) | set); +- raw_spin_unlock_irqrestore(&tp->config25_lock, flags); + } + + static bool rtl_is_8125(struct rtl8169_private *tp) +@@ -1572,7 +1552,6 @@ static void __rtl8169_set_wol(struct rtl + { WAKE_MAGIC, Config3, MagicPacket } + }; + unsigned int i, tmp = ARRAY_SIZE(cfg); +- unsigned long flags; + u8 options; + + rtl_unlock_config_regs(tp); +@@ -1591,14 +1570,12 @@ static void __rtl8169_set_wol(struct rtl + r8168_mac_ocp_modify(tp, 0xc0b6, BIT(0), 0); + } + +- raw_spin_lock_irqsave(&tp->config25_lock, flags); + for (i = 0; i < tmp; i++) { + options = RTL_R8(tp, cfg[i].reg) & ~cfg[i].mask; + if (wolopts & cfg[i].opt) + options |= cfg[i].mask; + RTL_W8(tp, cfg[i].reg, options); + } +- raw_spin_unlock_irqrestore(&tp->config25_lock, flags); + + switch (tp->mac_version) { + case RTL_GIGA_MAC_VER_02 ... RTL_GIGA_MAC_VER_06: +@@ -5498,8 +5475,6 @@ static int rtl_init_one(struct pci_dev * + tp->supports_gmii = ent->driver_data == RTL_CFG_NO_GBIT ? 0 : 1; + tp->ocp_base = OCP_STD_PHY_BASE; + +- raw_spin_lock_init(&tp->cfg9346_usage_lock); +- raw_spin_lock_init(&tp->config25_lock); + raw_spin_lock_init(&tp->mac_ocp_lock); + mutex_init(&tp->led_lock); + diff --git a/target/linux/generic/backport-6.6/780-40-v6.13-r8169-improve-__rtl8169_set_wol.patch b/target/linux/generic/backport-6.6/780-40-v6.13-r8169-improve-__rtl8169_set_wol.patch new file mode 100644 index 0000000000..8c88c078f2 --- /dev/null +++ b/target/linux/generic/backport-6.6/780-40-v6.13-r8169-improve-__rtl8169_set_wol.patch @@ -0,0 +1,108 @@ +From c507e96b5763b36b63ad50ad804341f72ea000e4 Mon Sep 17 00:00:00 2001 +From: Heiner Kallweit +Date: Wed, 6 Nov 2024 17:55:45 +0100 +Subject: [PATCH] r8169: improve __rtl8169_set_wol + +Add helper r8169_mod_reg8_cond() what allows to significantly simplify +__rtl8169_set_wol(). + +Signed-off-by: Heiner Kallweit +Reviewed-by: Simon Horman +Link: https://patch.msgid.link/697b197a-8eac-40c6-8847-27093cacec36@gmail.com +Signed-off-by: Jakub Kicinski +--- + drivers/net/ethernet/realtek/r8169_main.c | 55 ++++++++++------------- + 1 file changed, 24 insertions(+), 31 deletions(-) + +--- a/drivers/net/ethernet/realtek/r8169_main.c ++++ b/drivers/net/ethernet/realtek/r8169_main.c +@@ -749,6 +749,20 @@ static void rtl_mod_config5(struct rtl81 + RTL_W8(tp, Config5, (val & ~clear) | set); + } + ++static void r8169_mod_reg8_cond(struct rtl8169_private *tp, int reg, ++ u8 bits, bool cond) ++{ ++ u8 val, old_val; ++ ++ old_val = RTL_R8(tp, reg); ++ if (cond) ++ val = old_val | bits; ++ else ++ val = old_val & ~bits; ++ if (val != old_val) ++ RTL_W8(tp, reg, val); ++} ++ + static bool rtl_is_8125(struct rtl8169_private *tp) + { + return tp->mac_version >= RTL_GIGA_MAC_VER_61; +@@ -1539,58 +1553,37 @@ static void rtl8169_get_wol(struct net_d + + static void __rtl8169_set_wol(struct rtl8169_private *tp, u32 wolopts) + { +- static const struct { +- u32 opt; +- u16 reg; +- u8 mask; +- } cfg[] = { +- { WAKE_PHY, Config3, LinkUp }, +- { WAKE_UCAST, Config5, UWF }, +- { WAKE_BCAST, Config5, BWF }, +- { WAKE_MCAST, Config5, MWF }, +- { WAKE_ANY, Config5, LanWake }, +- { WAKE_MAGIC, Config3, MagicPacket } +- }; +- unsigned int i, tmp = ARRAY_SIZE(cfg); +- u8 options; +- + rtl_unlock_config_regs(tp); + + if (rtl_is_8168evl_up(tp)) { +- tmp--; + if (wolopts & WAKE_MAGIC) + rtl_eri_set_bits(tp, 0x0dc, MagicPacket_v2); + else + rtl_eri_clear_bits(tp, 0x0dc, MagicPacket_v2); + } else if (rtl_is_8125(tp)) { +- tmp--; + if (wolopts & WAKE_MAGIC) + r8168_mac_ocp_modify(tp, 0xc0b6, 0, BIT(0)); + else + r8168_mac_ocp_modify(tp, 0xc0b6, BIT(0), 0); ++ } else { ++ r8169_mod_reg8_cond(tp, Config3, MagicPacket, ++ wolopts & WAKE_MAGIC); + } + +- for (i = 0; i < tmp; i++) { +- options = RTL_R8(tp, cfg[i].reg) & ~cfg[i].mask; +- if (wolopts & cfg[i].opt) +- options |= cfg[i].mask; +- RTL_W8(tp, cfg[i].reg, options); +- } ++ r8169_mod_reg8_cond(tp, Config3, LinkUp, wolopts & WAKE_PHY); ++ r8169_mod_reg8_cond(tp, Config5, UWF, wolopts & WAKE_UCAST); ++ r8169_mod_reg8_cond(tp, Config5, BWF, wolopts & WAKE_BCAST); ++ r8169_mod_reg8_cond(tp, Config5, MWF, wolopts & WAKE_MCAST); ++ r8169_mod_reg8_cond(tp, Config5, LanWake, wolopts); + + switch (tp->mac_version) { + case RTL_GIGA_MAC_VER_02 ... RTL_GIGA_MAC_VER_06: +- options = RTL_R8(tp, Config1) & ~PMEnable; +- if (wolopts) +- options |= PMEnable; +- RTL_W8(tp, Config1, options); ++ r8169_mod_reg8_cond(tp, Config1, PMEnable, wolopts); + break; + case RTL_GIGA_MAC_VER_34: + case RTL_GIGA_MAC_VER_37: + case RTL_GIGA_MAC_VER_39 ... RTL_GIGA_MAC_VER_66: +- if (wolopts) +- rtl_mod_config2(tp, 0, PME_SIGNAL); +- else +- rtl_mod_config2(tp, PME_SIGNAL, 0); ++ r8169_mod_reg8_cond(tp, Config2, PME_SIGNAL, wolopts); + break; + default: + break; diff --git a/target/linux/generic/backport-6.6/780-41-v6.13-r8169-improve-rtl_set_d3_pll_down.patch b/target/linux/generic/backport-6.6/780-41-v6.13-r8169-improve-rtl_set_d3_pll_down.patch new file mode 100644 index 0000000000..e762617310 --- /dev/null +++ b/target/linux/generic/backport-6.6/780-41-v6.13-r8169-improve-rtl_set_d3_pll_down.patch @@ -0,0 +1,44 @@ +From 330dc2297c82953dff402e0b4176a5383a618538 Mon Sep 17 00:00:00 2001 +From: Heiner Kallweit +Date: Wed, 6 Nov 2024 17:56:28 +0100 +Subject: [PATCH] r8169: improve rtl_set_d3_pll_down + +Make use of new helper r8169_mod_reg8_cond() and move from a switch() +to an if() clause. Benefit is that we don't have to touch this piece of +code each time support for a new chip version is added. + +Signed-off-by: Heiner Kallweit +Reviewed-by: Simon Horman +Link: https://patch.msgid.link/e1ccdb85-a4ed-4800-89c2-89770ff06452@gmail.com +Signed-off-by: Jakub Kicinski +--- + drivers/net/ethernet/realtek/r8169_main.c | 18 +++++------------- + 1 file changed, 5 insertions(+), 13 deletions(-) + +--- a/drivers/net/ethernet/realtek/r8169_main.c ++++ b/drivers/net/ethernet/realtek/r8169_main.c +@@ -1432,19 +1432,11 @@ static enum rtl_dash_type rtl_get_dash_t + + static void rtl_set_d3_pll_down(struct rtl8169_private *tp, bool enable) + { +- switch (tp->mac_version) { +- case RTL_GIGA_MAC_VER_25 ... RTL_GIGA_MAC_VER_26: +- case RTL_GIGA_MAC_VER_29 ... RTL_GIGA_MAC_VER_30: +- case RTL_GIGA_MAC_VER_32 ... RTL_GIGA_MAC_VER_37: +- case RTL_GIGA_MAC_VER_39 ... RTL_GIGA_MAC_VER_66: +- if (enable) +- RTL_W8(tp, PMCH, RTL_R8(tp, PMCH) & ~D3_NO_PLL_DOWN); +- else +- RTL_W8(tp, PMCH, RTL_R8(tp, PMCH) | D3_NO_PLL_DOWN); +- break; +- default: +- break; +- } ++ if (tp->mac_version >= RTL_GIGA_MAC_VER_25 && ++ tp->mac_version != RTL_GIGA_MAC_VER_28 && ++ tp->mac_version != RTL_GIGA_MAC_VER_31 && ++ tp->mac_version != RTL_GIGA_MAC_VER_38) ++ r8169_mod_reg8_cond(tp, PMCH, D3_NO_PLL_DOWN, !enable); + } + + static void rtl_reset_packet_filter(struct rtl8169_private *tp) diff --git a/target/linux/generic/backport-6.6/780-42-v6.13-r8169-align-WAKE_PHY-handling-with-r8125-r8126-vendo.patch b/target/linux/generic/backport-6.6/780-42-v6.13-r8169-align-WAKE_PHY-handling-with-r8125-r8126-vendo.patch new file mode 100644 index 0000000000..de86c2f6cd --- /dev/null +++ b/target/linux/generic/backport-6.6/780-42-v6.13-r8169-align-WAKE_PHY-handling-with-r8125-r8126-vendo.patch @@ -0,0 +1,29 @@ +From e3e9e9039fa6ae885c7d5c954d7b9f105fa23e8f Mon Sep 17 00:00:00 2001 +From: Heiner Kallweit +Date: Wed, 6 Nov 2024 17:57:08 +0100 +Subject: [PATCH] r8169: align WAKE_PHY handling with r8125/r8126 vendor + drivers + +Vendor drivers r8125/r8126 apply this additional magic setting when +enabling WAKE_PHY, so do the same here. + +Signed-off-by: Heiner Kallweit +Reviewed-by: Simon Horman +Link: https://patch.msgid.link/51130715-45be-4db5-abb7-05d87e1f5df9@gmail.com +Signed-off-by: Jakub Kicinski +--- + drivers/net/ethernet/realtek/r8169_main.c | 3 +++ + 1 file changed, 3 insertions(+) + +--- a/drivers/net/ethernet/realtek/r8169_main.c ++++ b/drivers/net/ethernet/realtek/r8169_main.c +@@ -1563,6 +1563,9 @@ static void __rtl8169_set_wol(struct rtl + } + + r8169_mod_reg8_cond(tp, Config3, LinkUp, wolopts & WAKE_PHY); ++ if (rtl_is_8125(tp)) ++ r8168_mac_ocp_modify(tp, 0xe0c6, 0x3f, ++ wolopts & WAKE_PHY ? 0x13 : 0); + r8169_mod_reg8_cond(tp, Config5, UWF, wolopts & WAKE_UCAST); + r8169_mod_reg8_cond(tp, Config5, BWF, wolopts & WAKE_BCAST); + r8169_mod_reg8_cond(tp, Config5, MWF, wolopts & WAKE_MCAST); diff --git a/target/linux/generic/backport-6.6/780-43-v6.13-r8169-use-helper-r8169_mod_reg8_cond-to-simplify-rtl.patch b/target/linux/generic/backport-6.6/780-43-v6.13-r8169-use-helper-r8169_mod_reg8_cond-to-simplify-rtl.patch new file mode 100644 index 0000000000..5bcf06098a --- /dev/null +++ b/target/linux/generic/backport-6.6/780-43-v6.13-r8169-use-helper-r8169_mod_reg8_cond-to-simplify-rtl.patch @@ -0,0 +1,117 @@ +From 7a3bcd39ae1f0e3ab896d9df62339ab4297a0bfd Mon Sep 17 00:00:00 2001 +From: Heiner Kallweit +Date: Sat, 9 Nov 2024 23:12:12 +0100 +Subject: [PATCH] r8169: use helper r8169_mod_reg8_cond to simplify + rtl_jumbo_config + +Use recently added helper r8169_mod_reg8_cond() to simplify jumbo +mode configuration. + +Signed-off-by: Heiner Kallweit +Reviewed-by: Simon Horman +Link: https://patch.msgid.link/3df1d484-a02e-46e7-8f75-db5b428e422e@gmail.com +Signed-off-by: Jakub Kicinski +--- + drivers/net/ethernet/realtek/r8169_main.c | 77 ++++------------------- + 1 file changed, 11 insertions(+), 66 deletions(-) + +--- a/drivers/net/ethernet/realtek/r8169_main.c ++++ b/drivers/net/ethernet/realtek/r8169_main.c +@@ -2547,86 +2547,31 @@ static void rtl8169_init_ring_indexes(st + tp->dirty_tx = tp->cur_tx = tp->cur_rx = 0; + } + +-static void r8168c_hw_jumbo_enable(struct rtl8169_private *tp) +-{ +- RTL_W8(tp, Config3, RTL_R8(tp, Config3) | Jumbo_En0); +- RTL_W8(tp, Config4, RTL_R8(tp, Config4) | Jumbo_En1); +-} +- +-static void r8168c_hw_jumbo_disable(struct rtl8169_private *tp) +-{ +- RTL_W8(tp, Config3, RTL_R8(tp, Config3) & ~Jumbo_En0); +- RTL_W8(tp, Config4, RTL_R8(tp, Config4) & ~Jumbo_En1); +-} +- +-static void r8168dp_hw_jumbo_enable(struct rtl8169_private *tp) +-{ +- RTL_W8(tp, Config3, RTL_R8(tp, Config3) | Jumbo_En0); +-} +- +-static void r8168dp_hw_jumbo_disable(struct rtl8169_private *tp) +-{ +- RTL_W8(tp, Config3, RTL_R8(tp, Config3) & ~Jumbo_En0); +-} +- +-static void r8168e_hw_jumbo_enable(struct rtl8169_private *tp) +-{ +- RTL_W8(tp, MaxTxPacketSize, 0x24); +- RTL_W8(tp, Config3, RTL_R8(tp, Config3) | Jumbo_En0); +- RTL_W8(tp, Config4, RTL_R8(tp, Config4) | 0x01); +-} +- +-static void r8168e_hw_jumbo_disable(struct rtl8169_private *tp) +-{ +- RTL_W8(tp, MaxTxPacketSize, 0x3f); +- RTL_W8(tp, Config3, RTL_R8(tp, Config3) & ~Jumbo_En0); +- RTL_W8(tp, Config4, RTL_R8(tp, Config4) & ~0x01); +-} +- +-static void r8168b_1_hw_jumbo_enable(struct rtl8169_private *tp) +-{ +- RTL_W8(tp, Config4, RTL_R8(tp, Config4) | (1 << 0)); +-} +- +-static void r8168b_1_hw_jumbo_disable(struct rtl8169_private *tp) +-{ +- RTL_W8(tp, Config4, RTL_R8(tp, Config4) & ~(1 << 0)); +-} +- + static void rtl_jumbo_config(struct rtl8169_private *tp) + { + bool jumbo = tp->dev->mtu > ETH_DATA_LEN; + int readrq = 4096; + ++ if (jumbo && tp->mac_version >= RTL_GIGA_MAC_VER_17 && ++ tp->mac_version <= RTL_GIGA_MAC_VER_26) ++ readrq = 512; ++ + rtl_unlock_config_regs(tp); + switch (tp->mac_version) { + case RTL_GIGA_MAC_VER_17: +- if (jumbo) { +- readrq = 512; +- r8168b_1_hw_jumbo_enable(tp); +- } else { +- r8168b_1_hw_jumbo_disable(tp); +- } ++ r8169_mod_reg8_cond(tp, Config4, BIT(0), jumbo); + break; + case RTL_GIGA_MAC_VER_18 ... RTL_GIGA_MAC_VER_26: +- if (jumbo) { +- readrq = 512; +- r8168c_hw_jumbo_enable(tp); +- } else { +- r8168c_hw_jumbo_disable(tp); +- } ++ r8169_mod_reg8_cond(tp, Config3, Jumbo_En0, jumbo); ++ r8169_mod_reg8_cond(tp, Config4, Jumbo_En1, jumbo); + break; + case RTL_GIGA_MAC_VER_28: +- if (jumbo) +- r8168dp_hw_jumbo_enable(tp); +- else +- r8168dp_hw_jumbo_disable(tp); ++ r8169_mod_reg8_cond(tp, Config3, Jumbo_En0, jumbo); + break; + case RTL_GIGA_MAC_VER_31 ... RTL_GIGA_MAC_VER_33: +- if (jumbo) +- r8168e_hw_jumbo_enable(tp); +- else +- r8168e_hw_jumbo_disable(tp); ++ RTL_W8(tp, MaxTxPacketSize, jumbo ? 0x24 : 0x3f); ++ r8169_mod_reg8_cond(tp, Config3, Jumbo_En0, jumbo); ++ r8169_mod_reg8_cond(tp, Config4, BIT(0), jumbo); + break; + default: + break;