From 55ded1c2658de67a235dca096266b77e7d5dc51f Mon Sep 17 00:00:00 2001 From: Felix Fietkau Date: Fri, 4 Jun 2021 09:11:37 +0200 Subject: [PATCH 01/35] netifd: update to the latest version 61a71e5e49c3 bridge: dynamically create vlans for hotplug members cb6ee9608e10 bridge: fix dynamic delete of hotplug vlans 7f199050f395 wireless: pass the real network ifname to the setup script 50381d0a2998 bridge: allow adding/removing VLANs to configured member ports via hotplug Signed-off-by: Felix Fietkau --- package/network/config/netifd/Makefile | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/package/network/config/netifd/Makefile b/package/network/config/netifd/Makefile index 2f6b779e6d..aaffb57df7 100644 --- a/package/network/config/netifd/Makefile +++ b/package/network/config/netifd/Makefile @@ -5,9 +5,9 @@ PKG_RELEASE:=1 PKG_SOURCE_PROTO:=git PKG_SOURCE_URL=$(PROJECT_GIT)/project/netifd.git -PKG_SOURCE_DATE:=2021-05-26 -PKG_SOURCE_VERSION:=899c2a4520526d43113f73cf673f20e2486a40fb -PKG_MIRROR_HASH:=354905192b30af88ea953241ed332555e67cdb7e3b54dd139250bf1e6ad3a709 +PKG_SOURCE_DATE:=2021-06-04 +PKG_SOURCE_VERSION:=50381d0a2998f6c0fc4823f0c2aa4206063d549e +PKG_MIRROR_HASH:=2718df3d3538c93ac77accf55716fb341741df3d231aac59e04dd1f80f558889 PKG_MAINTAINER:=Felix Fietkau PKG_LICENSE:=GPL-2.0 From 89bd8607f8cdacea7e8d13c1233a2a8b13fdf64c Mon Sep 17 00:00:00 2001 From: Felix Fietkau Date: Thu, 3 Jun 2021 15:21:00 +0200 Subject: [PATCH 02/35] hostapd: fix bringing up vlan interfaces with the no-bridge option Signed-off-by: Felix Fietkau --- .../hostapd/patches/710-vlan_no_bridge.patch | 22 +++++++++++++------ 1 file changed, 15 insertions(+), 7 deletions(-) diff --git a/package/network/services/hostapd/patches/710-vlan_no_bridge.patch b/package/network/services/hostapd/patches/710-vlan_no_bridge.patch index d5aa33520b..73db32e54a 100644 --- a/package/network/services/hostapd/patches/710-vlan_no_bridge.patch +++ b/package/network/services/hostapd/patches/710-vlan_no_bridge.patch @@ -10,16 +10,24 @@ #define DYNAMIC_VLAN_NAMING_END 2 --- a/src/ap/vlan_full.c +++ b/src/ap/vlan_full.c -@@ -466,6 +466,9 @@ void vlan_newlink(const char *ifname, st - - wpa_printf(MSG_DEBUG, "VLAN: vlan_newlink(%s)", ifname); +@@ -475,6 +475,9 @@ void vlan_newlink(const char *ifname, st + if (!vlan) + return; + if (hapd->conf->ssid.vlan_no_bridge) -+ return; ++ goto out; + - for (vlan = hapd->conf->vlan; vlan; vlan = vlan->next) { - if (vlan->configured || - os_strcmp(ifname, vlan->ifname) != 0) + vlan->configured = 1; + + notempty = vlan->vlan_desc.notempty; +@@ -506,6 +509,7 @@ void vlan_newlink(const char *ifname, st + ifname, br_name, tagged[i], hapd); + } + ++out: + ifconfig_up(ifname); + } + --- a/hostapd/config_file.c +++ b/hostapd/config_file.c @@ -3366,6 +3366,8 @@ static int hostapd_config_fill(struct ho From 3394af677cadd1f9b877100312c830d87488fcfb Mon Sep 17 00:00:00 2001 From: Ansuel Smith Date: Wed, 2 Jun 2021 01:49:50 +0200 Subject: [PATCH 03/35] mac80211: split ath patch in dedicated subdir The ath patch number is already large and adding other patch for ath11k will add more confusion with the patch numbering. Since the support of ath11k based device is imminent, prepare the mac80211 ath patch dir and split it in the dedicated ath5k, ath9k, ath10k and ath11k (empty for now). Signed-off-by: Ansuel Smith --- package/kernel/mac80211/Makefile | 8 ++++++++ .../{ath => ath10k}/080-ath10k_thermal_config.patch | 0 ...0k-add-CCMP-PN-replay-protection-for-fragmented-.patch | 0 ...ath10k-drop-fragments-with-multicast-DA-for-PCIe.patch | 0 ...ath10k-drop-fragments-with-multicast-DA-for-SDIO.patch | 0 ...0k-drop-MPDU-which-has-discard-flag-set-by-firmw.patch | 0 ...th10k-Fix-TKIP-Michael-MIC-verification-for-PCIe.patch | 0 ...0k-Validate-first-subframe-of-A-MSDU-before-proc.patch | 0 .../921-ath10k_init_devices_synchronously.patch | 0 .../922-ath10k-increase-rx-buffer-size-to-2048.patch | 0 .../{ath => ath10k}/930-ath10k_add_tpt_led_trigger.patch | 0 ...nd-GPIO-controlling-support-for-various-chipsets.patch | 0 .../975-ath10k-use-tpt-trigger-by-default.patch | 0 .../980-ath10k-fix-max-antenna-gain-unit.patch | 0 ...0k-adjust-tx-power-reduction-for-US-regulatory-d.patch | 0 .../{ath => ath5k}/201-ath5k-WAR-for-AR71xx-PCI-bug.patch | 0 .../{ath => ath5k}/411-ath5k_allow_adhoc_and_ap.patch | 0 .../{ath => ath5k}/420-ath5k_disable_fast_cc.patch | 0 .../patches/{ath => ath5k}/430-add_ath5k_platform.patch | 0 .../patches/{ath => ath5k}/432-ath5k_add_pciids.patch | 0 .../{ath => ath5k}/440-ath5k_channel_bw_debugfs.patch | 0 .../350-ath9k_hw-reset-AHB-WMAC-interface-on-AR91xx.patch | 0 .../351-ath9k_hw-issue-external-reset-for-QCA955x.patch | 0 .../354-ath9k-force-rx_clear-when-disabling-rx.patch | 0 ...rt-ath9k-interpret-requested-txpower-in-EIRP-dom.patch | 0 ...k-adjust-tx-power-reduction-for-US-regulatory-do.patch | 0 .../patches/{ath => ath9k}/401-ath9k_blink_default.patch | 0 .../{ath => ath9k}/410-ath9k_allow_adhoc_and_ap.patch | 0 ...450-ath9k-enabled-MFP-capability-unconditionally.patch | 0 .../patches/{ath => ath9k}/500-ath9k_eeprom_debugfs.patch | 0 .../patches/{ath => ath9k}/501-ath9k_ahb_init.patch | 0 .../{ath => ath9k}/510-ath9k_intr_mitigation_tweak.patch | 0 .../patches/{ath => ath9k}/511-ath9k_reduce_rxbuf.patch | 0 .../{ath => ath9k}/512-ath9k_channelbw_debugfs.patch | 0 .../patches/{ath => ath9k}/513-ath9k_add_pci_ids.patch | 0 .../patches/{ath => ath9k}/530-ath9k_extra_leds.patch | 0 .../{ath => ath9k}/531-ath9k_extra_platform_leds.patch | 0 .../{ath => ath9k}/540-ath9k_reduce_ani_interval.patch | 0 .../patches/{ath => ath9k}/542-ath9k_debugfs_diag.patch | 0 .../{ath => ath9k}/543-ath9k_entropy_from_adc.patch | 0 .../544-ath9k-ar933x-usb-hang-workaround.patch | 0 .../patches/{ath => ath9k}/545-ath9k_ani_ws_detect.patch | 0 .../{ath => ath9k}/547-ath9k_led_defstate_fix.patch | 0 .../{ath => ath9k}/548-ath9k_enable_gpio_chip.patch | 0 .../{ath => ath9k}/549-ath9k_enable_gpio_buttons.patch | 0 .../{ath => ath9k}/550-ath9k-disable-bands-via-dt.patch | 0 .../{ath => ath9k}/551-ath9k_ubnt_uap_plus_hsr.patch | 0 .../552-ahb_of.patch => ath9k/552-ath9k-ahb_of.patch} | 0 .../patches/{ath => ath9k}/553-ath9k_of_gpio_mask.patch | 0 49 files changed, 8 insertions(+) rename package/kernel/mac80211/patches/{ath => ath10k}/080-ath10k_thermal_config.patch (100%) rename package/kernel/mac80211/patches/{ath => ath10k}/300-ath10k-add-CCMP-PN-replay-protection-for-fragmented-.patch (100%) rename package/kernel/mac80211/patches/{ath => ath10k}/301-ath10k-drop-fragments-with-multicast-DA-for-PCIe.patch (100%) rename package/kernel/mac80211/patches/{ath => ath10k}/302-ath10k-drop-fragments-with-multicast-DA-for-SDIO.patch (100%) rename package/kernel/mac80211/patches/{ath => ath10k}/303-ath10k-drop-MPDU-which-has-discard-flag-set-by-firmw.patch (100%) rename package/kernel/mac80211/patches/{ath => ath10k}/304-ath10k-Fix-TKIP-Michael-MIC-verification-for-PCIe.patch (100%) rename package/kernel/mac80211/patches/{ath => ath10k}/305-ath10k-Validate-first-subframe-of-A-MSDU-before-proc.patch (100%) rename package/kernel/mac80211/patches/{ath => ath10k}/921-ath10k_init_devices_synchronously.patch (100%) rename package/kernel/mac80211/patches/{ath => ath10k}/922-ath10k-increase-rx-buffer-size-to-2048.patch (100%) rename package/kernel/mac80211/patches/{ath => ath10k}/930-ath10k_add_tpt_led_trigger.patch (100%) rename package/kernel/mac80211/patches/{ath => ath10k}/974-ath10k_add-LED-and-GPIO-controlling-support-for-various-chipsets.patch (100%) rename package/kernel/mac80211/patches/{ath => ath10k}/975-ath10k-use-tpt-trigger-by-default.patch (100%) rename package/kernel/mac80211/patches/{ath => ath10k}/980-ath10k-fix-max-antenna-gain-unit.patch (100%) rename package/kernel/mac80211/patches/{ath => ath10k}/981-ath10k-adjust-tx-power-reduction-for-US-regulatory-d.patch (100%) rename package/kernel/mac80211/patches/{ath => ath5k}/201-ath5k-WAR-for-AR71xx-PCI-bug.patch (100%) rename package/kernel/mac80211/patches/{ath => ath5k}/411-ath5k_allow_adhoc_and_ap.patch (100%) rename package/kernel/mac80211/patches/{ath => ath5k}/420-ath5k_disable_fast_cc.patch (100%) rename package/kernel/mac80211/patches/{ath => ath5k}/430-add_ath5k_platform.patch (100%) rename package/kernel/mac80211/patches/{ath => ath5k}/432-ath5k_add_pciids.patch (100%) rename package/kernel/mac80211/patches/{ath => ath5k}/440-ath5k_channel_bw_debugfs.patch (100%) rename package/kernel/mac80211/patches/{ath => ath9k}/350-ath9k_hw-reset-AHB-WMAC-interface-on-AR91xx.patch (100%) rename package/kernel/mac80211/patches/{ath => ath9k}/351-ath9k_hw-issue-external-reset-for-QCA955x.patch (100%) rename package/kernel/mac80211/patches/{ath => ath9k}/354-ath9k-force-rx_clear-when-disabling-rx.patch (100%) rename package/kernel/mac80211/patches/{ath => ath9k}/356-Revert-ath9k-interpret-requested-txpower-in-EIRP-dom.patch (100%) rename package/kernel/mac80211/patches/{ath => ath9k}/365-ath9k-adjust-tx-power-reduction-for-US-regulatory-do.patch (100%) rename package/kernel/mac80211/patches/{ath => ath9k}/401-ath9k_blink_default.patch (100%) rename package/kernel/mac80211/patches/{ath => ath9k}/410-ath9k_allow_adhoc_and_ap.patch (100%) rename package/kernel/mac80211/patches/{ath => ath9k}/450-ath9k-enabled-MFP-capability-unconditionally.patch (100%) rename package/kernel/mac80211/patches/{ath => ath9k}/500-ath9k_eeprom_debugfs.patch (100%) rename package/kernel/mac80211/patches/{ath => ath9k}/501-ath9k_ahb_init.patch (100%) rename package/kernel/mac80211/patches/{ath => ath9k}/510-ath9k_intr_mitigation_tweak.patch (100%) rename package/kernel/mac80211/patches/{ath => ath9k}/511-ath9k_reduce_rxbuf.patch (100%) rename package/kernel/mac80211/patches/{ath => ath9k}/512-ath9k_channelbw_debugfs.patch (100%) rename package/kernel/mac80211/patches/{ath => ath9k}/513-ath9k_add_pci_ids.patch (100%) rename package/kernel/mac80211/patches/{ath => ath9k}/530-ath9k_extra_leds.patch (100%) rename package/kernel/mac80211/patches/{ath => ath9k}/531-ath9k_extra_platform_leds.patch (100%) rename package/kernel/mac80211/patches/{ath => ath9k}/540-ath9k_reduce_ani_interval.patch (100%) rename package/kernel/mac80211/patches/{ath => ath9k}/542-ath9k_debugfs_diag.patch (100%) rename package/kernel/mac80211/patches/{ath => ath9k}/543-ath9k_entropy_from_adc.patch (100%) rename package/kernel/mac80211/patches/{ath => ath9k}/544-ath9k-ar933x-usb-hang-workaround.patch (100%) rename package/kernel/mac80211/patches/{ath => ath9k}/545-ath9k_ani_ws_detect.patch (100%) rename package/kernel/mac80211/patches/{ath => ath9k}/547-ath9k_led_defstate_fix.patch (100%) rename package/kernel/mac80211/patches/{ath => ath9k}/548-ath9k_enable_gpio_chip.patch (100%) rename package/kernel/mac80211/patches/{ath => ath9k}/549-ath9k_enable_gpio_buttons.patch (100%) rename package/kernel/mac80211/patches/{ath => ath9k}/550-ath9k-disable-bands-via-dt.patch (100%) rename package/kernel/mac80211/patches/{ath => ath9k}/551-ath9k_ubnt_uap_plus_hsr.patch (100%) rename package/kernel/mac80211/patches/{ath/552-ahb_of.patch => ath9k/552-ath9k-ahb_of.patch} (100%) rename package/kernel/mac80211/patches/{ath => ath9k}/553-ath9k_of_gpio_mask.patch (100%) diff --git a/package/kernel/mac80211/Makefile b/package/kernel/mac80211/Makefile index 4d10de09a7..92167ebf3b 100644 --- a/package/kernel/mac80211/Makefile +++ b/package/kernel/mac80211/Makefile @@ -501,6 +501,10 @@ define Build/Patch $(call PatchDir,$(PKG_BUILD_DIR),$(PATCH_DIR)/build,build/) $(call PatchDir,$(PKG_BUILD_DIR),$(PATCH_DIR)/subsys,subsys/) $(call PatchDir,$(PKG_BUILD_DIR),$(PATCH_DIR)/ath,ath/) + $(call PatchDir,$(PKG_BUILD_DIR),$(PATCH_DIR)/ath5k,ath5k/) + $(call PatchDir,$(PKG_BUILD_DIR),$(PATCH_DIR)/ath9k,ath9k/) + $(call PatchDir,$(PKG_BUILD_DIR),$(PATCH_DIR)/ath10k,ath10k/) + $(call PatchDir,$(PKG_BUILD_DIR),$(PATCH_DIR)/ath11k,ath11k/) $(call PatchDir,$(PKG_BUILD_DIR),$(PATCH_DIR)/rt2x00,rt2x00/) $(call PatchDir,$(PKG_BUILD_DIR),$(PATCH_DIR)/mwl,mwl/) $(call PatchDir,$(PKG_BUILD_DIR),$(PATCH_DIR)/brcm,brcm/) @@ -512,6 +516,10 @@ define Quilt/Refresh/Package $(call Quilt/RefreshDir,$(PKG_BUILD_DIR),$(PATCH_DIR)/build,build/) $(call Quilt/RefreshDir,$(PKG_BUILD_DIR),$(PATCH_DIR)/subsys,subsys/) $(call Quilt/RefreshDir,$(PKG_BUILD_DIR),$(PATCH_DIR)/ath,ath/) + $(call Quilt/RefreshDir,$(PKG_BUILD_DIR),$(PATCH_DIR)/ath5k,ath5k/) + $(call Quilt/RefreshDir,$(PKG_BUILD_DIR),$(PATCH_DIR)/ath9k,ath9k/) + $(call Quilt/RefreshDir,$(PKG_BUILD_DIR),$(PATCH_DIR)/ath10k,ath10k/) + $(call Quilt/RefreshDir,$(PKG_BUILD_DIR),$(PATCH_DIR)/ath11k,ath11k/) $(call Quilt/RefreshDir,$(PKG_BUILD_DIR),$(PATCH_DIR)/rt2x00,rt2x00/) $(call Quilt/RefreshDir,$(PKG_BUILD_DIR),$(PATCH_DIR)/mwl,mwl/) $(call Quilt/RefreshDir,$(PKG_BUILD_DIR),$(PATCH_DIR)/brcm,brcm/) diff --git a/package/kernel/mac80211/patches/ath/080-ath10k_thermal_config.patch b/package/kernel/mac80211/patches/ath10k/080-ath10k_thermal_config.patch similarity index 100% rename from package/kernel/mac80211/patches/ath/080-ath10k_thermal_config.patch rename to package/kernel/mac80211/patches/ath10k/080-ath10k_thermal_config.patch diff --git a/package/kernel/mac80211/patches/ath/300-ath10k-add-CCMP-PN-replay-protection-for-fragmented-.patch b/package/kernel/mac80211/patches/ath10k/300-ath10k-add-CCMP-PN-replay-protection-for-fragmented-.patch similarity index 100% rename from package/kernel/mac80211/patches/ath/300-ath10k-add-CCMP-PN-replay-protection-for-fragmented-.patch rename to package/kernel/mac80211/patches/ath10k/300-ath10k-add-CCMP-PN-replay-protection-for-fragmented-.patch diff --git a/package/kernel/mac80211/patches/ath/301-ath10k-drop-fragments-with-multicast-DA-for-PCIe.patch b/package/kernel/mac80211/patches/ath10k/301-ath10k-drop-fragments-with-multicast-DA-for-PCIe.patch similarity index 100% rename from package/kernel/mac80211/patches/ath/301-ath10k-drop-fragments-with-multicast-DA-for-PCIe.patch rename to package/kernel/mac80211/patches/ath10k/301-ath10k-drop-fragments-with-multicast-DA-for-PCIe.patch diff --git a/package/kernel/mac80211/patches/ath/302-ath10k-drop-fragments-with-multicast-DA-for-SDIO.patch b/package/kernel/mac80211/patches/ath10k/302-ath10k-drop-fragments-with-multicast-DA-for-SDIO.patch similarity index 100% rename from package/kernel/mac80211/patches/ath/302-ath10k-drop-fragments-with-multicast-DA-for-SDIO.patch rename to package/kernel/mac80211/patches/ath10k/302-ath10k-drop-fragments-with-multicast-DA-for-SDIO.patch diff --git a/package/kernel/mac80211/patches/ath/303-ath10k-drop-MPDU-which-has-discard-flag-set-by-firmw.patch b/package/kernel/mac80211/patches/ath10k/303-ath10k-drop-MPDU-which-has-discard-flag-set-by-firmw.patch similarity index 100% rename from package/kernel/mac80211/patches/ath/303-ath10k-drop-MPDU-which-has-discard-flag-set-by-firmw.patch rename to package/kernel/mac80211/patches/ath10k/303-ath10k-drop-MPDU-which-has-discard-flag-set-by-firmw.patch diff --git a/package/kernel/mac80211/patches/ath/304-ath10k-Fix-TKIP-Michael-MIC-verification-for-PCIe.patch b/package/kernel/mac80211/patches/ath10k/304-ath10k-Fix-TKIP-Michael-MIC-verification-for-PCIe.patch similarity index 100% rename from package/kernel/mac80211/patches/ath/304-ath10k-Fix-TKIP-Michael-MIC-verification-for-PCIe.patch rename to package/kernel/mac80211/patches/ath10k/304-ath10k-Fix-TKIP-Michael-MIC-verification-for-PCIe.patch diff --git a/package/kernel/mac80211/patches/ath/305-ath10k-Validate-first-subframe-of-A-MSDU-before-proc.patch b/package/kernel/mac80211/patches/ath10k/305-ath10k-Validate-first-subframe-of-A-MSDU-before-proc.patch similarity index 100% rename from package/kernel/mac80211/patches/ath/305-ath10k-Validate-first-subframe-of-A-MSDU-before-proc.patch rename to package/kernel/mac80211/patches/ath10k/305-ath10k-Validate-first-subframe-of-A-MSDU-before-proc.patch diff --git a/package/kernel/mac80211/patches/ath/921-ath10k_init_devices_synchronously.patch b/package/kernel/mac80211/patches/ath10k/921-ath10k_init_devices_synchronously.patch similarity index 100% rename from package/kernel/mac80211/patches/ath/921-ath10k_init_devices_synchronously.patch rename to package/kernel/mac80211/patches/ath10k/921-ath10k_init_devices_synchronously.patch diff --git a/package/kernel/mac80211/patches/ath/922-ath10k-increase-rx-buffer-size-to-2048.patch b/package/kernel/mac80211/patches/ath10k/922-ath10k-increase-rx-buffer-size-to-2048.patch similarity index 100% rename from package/kernel/mac80211/patches/ath/922-ath10k-increase-rx-buffer-size-to-2048.patch rename to package/kernel/mac80211/patches/ath10k/922-ath10k-increase-rx-buffer-size-to-2048.patch diff --git a/package/kernel/mac80211/patches/ath/930-ath10k_add_tpt_led_trigger.patch b/package/kernel/mac80211/patches/ath10k/930-ath10k_add_tpt_led_trigger.patch similarity index 100% rename from package/kernel/mac80211/patches/ath/930-ath10k_add_tpt_led_trigger.patch rename to package/kernel/mac80211/patches/ath10k/930-ath10k_add_tpt_led_trigger.patch diff --git a/package/kernel/mac80211/patches/ath/974-ath10k_add-LED-and-GPIO-controlling-support-for-various-chipsets.patch b/package/kernel/mac80211/patches/ath10k/974-ath10k_add-LED-and-GPIO-controlling-support-for-various-chipsets.patch similarity index 100% rename from package/kernel/mac80211/patches/ath/974-ath10k_add-LED-and-GPIO-controlling-support-for-various-chipsets.patch rename to package/kernel/mac80211/patches/ath10k/974-ath10k_add-LED-and-GPIO-controlling-support-for-various-chipsets.patch diff --git a/package/kernel/mac80211/patches/ath/975-ath10k-use-tpt-trigger-by-default.patch b/package/kernel/mac80211/patches/ath10k/975-ath10k-use-tpt-trigger-by-default.patch similarity index 100% rename from package/kernel/mac80211/patches/ath/975-ath10k-use-tpt-trigger-by-default.patch rename to package/kernel/mac80211/patches/ath10k/975-ath10k-use-tpt-trigger-by-default.patch diff --git a/package/kernel/mac80211/patches/ath/980-ath10k-fix-max-antenna-gain-unit.patch b/package/kernel/mac80211/patches/ath10k/980-ath10k-fix-max-antenna-gain-unit.patch similarity index 100% rename from package/kernel/mac80211/patches/ath/980-ath10k-fix-max-antenna-gain-unit.patch rename to package/kernel/mac80211/patches/ath10k/980-ath10k-fix-max-antenna-gain-unit.patch diff --git a/package/kernel/mac80211/patches/ath/981-ath10k-adjust-tx-power-reduction-for-US-regulatory-d.patch b/package/kernel/mac80211/patches/ath10k/981-ath10k-adjust-tx-power-reduction-for-US-regulatory-d.patch similarity index 100% rename from package/kernel/mac80211/patches/ath/981-ath10k-adjust-tx-power-reduction-for-US-regulatory-d.patch rename to package/kernel/mac80211/patches/ath10k/981-ath10k-adjust-tx-power-reduction-for-US-regulatory-d.patch diff --git a/package/kernel/mac80211/patches/ath/201-ath5k-WAR-for-AR71xx-PCI-bug.patch b/package/kernel/mac80211/patches/ath5k/201-ath5k-WAR-for-AR71xx-PCI-bug.patch similarity index 100% rename from package/kernel/mac80211/patches/ath/201-ath5k-WAR-for-AR71xx-PCI-bug.patch rename to package/kernel/mac80211/patches/ath5k/201-ath5k-WAR-for-AR71xx-PCI-bug.patch diff --git a/package/kernel/mac80211/patches/ath/411-ath5k_allow_adhoc_and_ap.patch b/package/kernel/mac80211/patches/ath5k/411-ath5k_allow_adhoc_and_ap.patch similarity index 100% rename from package/kernel/mac80211/patches/ath/411-ath5k_allow_adhoc_and_ap.patch rename to package/kernel/mac80211/patches/ath5k/411-ath5k_allow_adhoc_and_ap.patch diff --git a/package/kernel/mac80211/patches/ath/420-ath5k_disable_fast_cc.patch b/package/kernel/mac80211/patches/ath5k/420-ath5k_disable_fast_cc.patch similarity index 100% rename from package/kernel/mac80211/patches/ath/420-ath5k_disable_fast_cc.patch rename to package/kernel/mac80211/patches/ath5k/420-ath5k_disable_fast_cc.patch diff --git a/package/kernel/mac80211/patches/ath/430-add_ath5k_platform.patch b/package/kernel/mac80211/patches/ath5k/430-add_ath5k_platform.patch similarity index 100% rename from package/kernel/mac80211/patches/ath/430-add_ath5k_platform.patch rename to package/kernel/mac80211/patches/ath5k/430-add_ath5k_platform.patch diff --git a/package/kernel/mac80211/patches/ath/432-ath5k_add_pciids.patch b/package/kernel/mac80211/patches/ath5k/432-ath5k_add_pciids.patch similarity index 100% rename from package/kernel/mac80211/patches/ath/432-ath5k_add_pciids.patch rename to package/kernel/mac80211/patches/ath5k/432-ath5k_add_pciids.patch diff --git a/package/kernel/mac80211/patches/ath/440-ath5k_channel_bw_debugfs.patch b/package/kernel/mac80211/patches/ath5k/440-ath5k_channel_bw_debugfs.patch similarity index 100% rename from package/kernel/mac80211/patches/ath/440-ath5k_channel_bw_debugfs.patch rename to package/kernel/mac80211/patches/ath5k/440-ath5k_channel_bw_debugfs.patch diff --git a/package/kernel/mac80211/patches/ath/350-ath9k_hw-reset-AHB-WMAC-interface-on-AR91xx.patch b/package/kernel/mac80211/patches/ath9k/350-ath9k_hw-reset-AHB-WMAC-interface-on-AR91xx.patch similarity index 100% rename from package/kernel/mac80211/patches/ath/350-ath9k_hw-reset-AHB-WMAC-interface-on-AR91xx.patch rename to package/kernel/mac80211/patches/ath9k/350-ath9k_hw-reset-AHB-WMAC-interface-on-AR91xx.patch diff --git a/package/kernel/mac80211/patches/ath/351-ath9k_hw-issue-external-reset-for-QCA955x.patch b/package/kernel/mac80211/patches/ath9k/351-ath9k_hw-issue-external-reset-for-QCA955x.patch similarity index 100% rename from package/kernel/mac80211/patches/ath/351-ath9k_hw-issue-external-reset-for-QCA955x.patch rename to package/kernel/mac80211/patches/ath9k/351-ath9k_hw-issue-external-reset-for-QCA955x.patch diff --git a/package/kernel/mac80211/patches/ath/354-ath9k-force-rx_clear-when-disabling-rx.patch b/package/kernel/mac80211/patches/ath9k/354-ath9k-force-rx_clear-when-disabling-rx.patch similarity index 100% rename from package/kernel/mac80211/patches/ath/354-ath9k-force-rx_clear-when-disabling-rx.patch rename to package/kernel/mac80211/patches/ath9k/354-ath9k-force-rx_clear-when-disabling-rx.patch diff --git a/package/kernel/mac80211/patches/ath/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 similarity index 100% rename from package/kernel/mac80211/patches/ath/356-Revert-ath9k-interpret-requested-txpower-in-EIRP-dom.patch rename to package/kernel/mac80211/patches/ath9k/356-Revert-ath9k-interpret-requested-txpower-in-EIRP-dom.patch diff --git a/package/kernel/mac80211/patches/ath/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 similarity index 100% rename from package/kernel/mac80211/patches/ath/365-ath9k-adjust-tx-power-reduction-for-US-regulatory-do.patch rename to package/kernel/mac80211/patches/ath9k/365-ath9k-adjust-tx-power-reduction-for-US-regulatory-do.patch diff --git a/package/kernel/mac80211/patches/ath/401-ath9k_blink_default.patch b/package/kernel/mac80211/patches/ath9k/401-ath9k_blink_default.patch similarity index 100% rename from package/kernel/mac80211/patches/ath/401-ath9k_blink_default.patch rename to package/kernel/mac80211/patches/ath9k/401-ath9k_blink_default.patch diff --git a/package/kernel/mac80211/patches/ath/410-ath9k_allow_adhoc_and_ap.patch b/package/kernel/mac80211/patches/ath9k/410-ath9k_allow_adhoc_and_ap.patch similarity index 100% rename from package/kernel/mac80211/patches/ath/410-ath9k_allow_adhoc_and_ap.patch rename to package/kernel/mac80211/patches/ath9k/410-ath9k_allow_adhoc_and_ap.patch diff --git a/package/kernel/mac80211/patches/ath/450-ath9k-enabled-MFP-capability-unconditionally.patch b/package/kernel/mac80211/patches/ath9k/450-ath9k-enabled-MFP-capability-unconditionally.patch similarity index 100% rename from package/kernel/mac80211/patches/ath/450-ath9k-enabled-MFP-capability-unconditionally.patch rename to package/kernel/mac80211/patches/ath9k/450-ath9k-enabled-MFP-capability-unconditionally.patch diff --git a/package/kernel/mac80211/patches/ath/500-ath9k_eeprom_debugfs.patch b/package/kernel/mac80211/patches/ath9k/500-ath9k_eeprom_debugfs.patch similarity index 100% rename from package/kernel/mac80211/patches/ath/500-ath9k_eeprom_debugfs.patch rename to package/kernel/mac80211/patches/ath9k/500-ath9k_eeprom_debugfs.patch diff --git a/package/kernel/mac80211/patches/ath/501-ath9k_ahb_init.patch b/package/kernel/mac80211/patches/ath9k/501-ath9k_ahb_init.patch similarity index 100% rename from package/kernel/mac80211/patches/ath/501-ath9k_ahb_init.patch rename to package/kernel/mac80211/patches/ath9k/501-ath9k_ahb_init.patch diff --git a/package/kernel/mac80211/patches/ath/510-ath9k_intr_mitigation_tweak.patch b/package/kernel/mac80211/patches/ath9k/510-ath9k_intr_mitigation_tweak.patch similarity index 100% rename from package/kernel/mac80211/patches/ath/510-ath9k_intr_mitigation_tweak.patch rename to package/kernel/mac80211/patches/ath9k/510-ath9k_intr_mitigation_tweak.patch diff --git a/package/kernel/mac80211/patches/ath/511-ath9k_reduce_rxbuf.patch b/package/kernel/mac80211/patches/ath9k/511-ath9k_reduce_rxbuf.patch similarity index 100% rename from package/kernel/mac80211/patches/ath/511-ath9k_reduce_rxbuf.patch rename to package/kernel/mac80211/patches/ath9k/511-ath9k_reduce_rxbuf.patch diff --git a/package/kernel/mac80211/patches/ath/512-ath9k_channelbw_debugfs.patch b/package/kernel/mac80211/patches/ath9k/512-ath9k_channelbw_debugfs.patch similarity index 100% rename from package/kernel/mac80211/patches/ath/512-ath9k_channelbw_debugfs.patch rename to package/kernel/mac80211/patches/ath9k/512-ath9k_channelbw_debugfs.patch diff --git a/package/kernel/mac80211/patches/ath/513-ath9k_add_pci_ids.patch b/package/kernel/mac80211/patches/ath9k/513-ath9k_add_pci_ids.patch similarity index 100% rename from package/kernel/mac80211/patches/ath/513-ath9k_add_pci_ids.patch rename to package/kernel/mac80211/patches/ath9k/513-ath9k_add_pci_ids.patch diff --git a/package/kernel/mac80211/patches/ath/530-ath9k_extra_leds.patch b/package/kernel/mac80211/patches/ath9k/530-ath9k_extra_leds.patch similarity index 100% rename from package/kernel/mac80211/patches/ath/530-ath9k_extra_leds.patch rename to package/kernel/mac80211/patches/ath9k/530-ath9k_extra_leds.patch diff --git a/package/kernel/mac80211/patches/ath/531-ath9k_extra_platform_leds.patch b/package/kernel/mac80211/patches/ath9k/531-ath9k_extra_platform_leds.patch similarity index 100% rename from package/kernel/mac80211/patches/ath/531-ath9k_extra_platform_leds.patch rename to package/kernel/mac80211/patches/ath9k/531-ath9k_extra_platform_leds.patch diff --git a/package/kernel/mac80211/patches/ath/540-ath9k_reduce_ani_interval.patch b/package/kernel/mac80211/patches/ath9k/540-ath9k_reduce_ani_interval.patch similarity index 100% rename from package/kernel/mac80211/patches/ath/540-ath9k_reduce_ani_interval.patch rename to package/kernel/mac80211/patches/ath9k/540-ath9k_reduce_ani_interval.patch diff --git a/package/kernel/mac80211/patches/ath/542-ath9k_debugfs_diag.patch b/package/kernel/mac80211/patches/ath9k/542-ath9k_debugfs_diag.patch similarity index 100% rename from package/kernel/mac80211/patches/ath/542-ath9k_debugfs_diag.patch rename to package/kernel/mac80211/patches/ath9k/542-ath9k_debugfs_diag.patch diff --git a/package/kernel/mac80211/patches/ath/543-ath9k_entropy_from_adc.patch b/package/kernel/mac80211/patches/ath9k/543-ath9k_entropy_from_adc.patch similarity index 100% rename from package/kernel/mac80211/patches/ath/543-ath9k_entropy_from_adc.patch rename to package/kernel/mac80211/patches/ath9k/543-ath9k_entropy_from_adc.patch diff --git a/package/kernel/mac80211/patches/ath/544-ath9k-ar933x-usb-hang-workaround.patch b/package/kernel/mac80211/patches/ath9k/544-ath9k-ar933x-usb-hang-workaround.patch similarity index 100% rename from package/kernel/mac80211/patches/ath/544-ath9k-ar933x-usb-hang-workaround.patch rename to package/kernel/mac80211/patches/ath9k/544-ath9k-ar933x-usb-hang-workaround.patch diff --git a/package/kernel/mac80211/patches/ath/545-ath9k_ani_ws_detect.patch b/package/kernel/mac80211/patches/ath9k/545-ath9k_ani_ws_detect.patch similarity index 100% rename from package/kernel/mac80211/patches/ath/545-ath9k_ani_ws_detect.patch rename to package/kernel/mac80211/patches/ath9k/545-ath9k_ani_ws_detect.patch diff --git a/package/kernel/mac80211/patches/ath/547-ath9k_led_defstate_fix.patch b/package/kernel/mac80211/patches/ath9k/547-ath9k_led_defstate_fix.patch similarity index 100% rename from package/kernel/mac80211/patches/ath/547-ath9k_led_defstate_fix.patch rename to package/kernel/mac80211/patches/ath9k/547-ath9k_led_defstate_fix.patch diff --git a/package/kernel/mac80211/patches/ath/548-ath9k_enable_gpio_chip.patch b/package/kernel/mac80211/patches/ath9k/548-ath9k_enable_gpio_chip.patch similarity index 100% rename from package/kernel/mac80211/patches/ath/548-ath9k_enable_gpio_chip.patch rename to package/kernel/mac80211/patches/ath9k/548-ath9k_enable_gpio_chip.patch diff --git a/package/kernel/mac80211/patches/ath/549-ath9k_enable_gpio_buttons.patch b/package/kernel/mac80211/patches/ath9k/549-ath9k_enable_gpio_buttons.patch similarity index 100% rename from package/kernel/mac80211/patches/ath/549-ath9k_enable_gpio_buttons.patch rename to package/kernel/mac80211/patches/ath9k/549-ath9k_enable_gpio_buttons.patch diff --git a/package/kernel/mac80211/patches/ath/550-ath9k-disable-bands-via-dt.patch b/package/kernel/mac80211/patches/ath9k/550-ath9k-disable-bands-via-dt.patch similarity index 100% rename from package/kernel/mac80211/patches/ath/550-ath9k-disable-bands-via-dt.patch rename to package/kernel/mac80211/patches/ath9k/550-ath9k-disable-bands-via-dt.patch diff --git a/package/kernel/mac80211/patches/ath/551-ath9k_ubnt_uap_plus_hsr.patch b/package/kernel/mac80211/patches/ath9k/551-ath9k_ubnt_uap_plus_hsr.patch similarity index 100% rename from package/kernel/mac80211/patches/ath/551-ath9k_ubnt_uap_plus_hsr.patch rename to package/kernel/mac80211/patches/ath9k/551-ath9k_ubnt_uap_plus_hsr.patch diff --git a/package/kernel/mac80211/patches/ath/552-ahb_of.patch b/package/kernel/mac80211/patches/ath9k/552-ath9k-ahb_of.patch similarity index 100% rename from package/kernel/mac80211/patches/ath/552-ahb_of.patch rename to package/kernel/mac80211/patches/ath9k/552-ath9k-ahb_of.patch diff --git a/package/kernel/mac80211/patches/ath/553-ath9k_of_gpio_mask.patch b/package/kernel/mac80211/patches/ath9k/553-ath9k_of_gpio_mask.patch similarity index 100% rename from package/kernel/mac80211/patches/ath/553-ath9k_of_gpio_mask.patch rename to package/kernel/mac80211/patches/ath9k/553-ath9k_of_gpio_mask.patch From eaf2e32c12655d7fb58e158086a784393dc6f69a Mon Sep 17 00:00:00 2001 From: Sven Eckelmann Date: Mon, 23 Nov 2020 13:41:34 +0100 Subject: [PATCH 04/35] ath79: Add support for OpenMesh A60 Device specifications: ====================== * Qualcomm/Atheros QCA9558 ver 1 rev 0 * 720/600/240 MHz (CPU/DDR/AHB) * 128 MB of RAM * 16 MB of SPI NOR flash - 2x 7 MB available; but one of the 7 MB regions is the recovery image * 3T3R 2.4 GHz Wi-Fi (11n) * 3T3R 5 GHz Wi-Fi (11ac) * multi-color LED (controlled via red/green/blue GPIOs) * 1x GPIO-button (reset) * external h/w watchdog (enabled by default)) * TTL pins are on board (arrow points to VCC, then follows: GND, TX, RX) * 2x ethernet - eth0 + Label: Ethernet 1 + AR8035 ethernet PHY (RGMII) + 10/100/1000 Mbps Ethernet + 802.3af POE + used as WAN interface - eth1 + Label: Ethernet 2 + AR8031 ethernet PHY (SGMII) + 10/100/1000 Mbps Ethernet + used as LAN interface * 1x USB * internal antennas Flashing instructions: ====================== Various methods can be used to install the actual image on the flash. Two easy ones are: ap51-flash ---------- The tool ap51-flash (https://github.com/ap51-flash/ap51-flash) should be used to transfer the image to the u-boot when the device boots up. initramfs from TFTP ------------------- The serial console must be used to access the u-boot shell during bootup. It can then be used to first boot up the initramfs image from a TFTP server (here with the IP 192.168.1.21): setenv serverip 192.168.1.21 setenv ipaddr 192.168.1.1 tftpboot 0c00000 .bin && bootm $fileaddr The actual sysupgrade image can then be transferred (on the LAN port) to the device via scp .bin root@192.168.1.1:/tmp/ On the device, the sysupgrade must then be started using sysupgrade -n /tmp/.bin Signed-off-by: Sven Eckelmann --- package/boot/uboot-envtools/files/ath79 | 1 + .../linux/ath79/dts/qca9558_openmesh_a60.dts | 8 + .../linux/ath79/dts/qca9558_openmesh_a60.dtsi | 180 ++++++++++++++++++ .../generic/base-files/etc/board.d/02_network | 1 + .../etc/hotplug.d/firmware/11-ath10k-caldata | 1 + .../base-files/lib/upgrade/platform.sh | 1 + target/linux/ath79/image/generic.mk | 10 + 7 files changed, 202 insertions(+) create mode 100644 target/linux/ath79/dts/qca9558_openmesh_a60.dts create mode 100644 target/linux/ath79/dts/qca9558_openmesh_a60.dtsi diff --git a/package/boot/uboot-envtools/files/ath79 b/package/boot/uboot-envtools/files/ath79 index 7b0692e59f..1fc484df52 100644 --- a/package/boot/uboot-envtools/files/ath79 +++ b/package/boot/uboot-envtools/files/ath79 @@ -48,6 +48,7 @@ netgear,wnr2200-16m|\ netgear,wnr612-v2|\ ocedo,koala|\ ocedo,raccoon|\ +openmesh,a60|\ openmesh,mr600-v1|\ openmesh,mr600-v2|\ openmesh,mr900-v1|\ diff --git a/target/linux/ath79/dts/qca9558_openmesh_a60.dts b/target/linux/ath79/dts/qca9558_openmesh_a60.dts new file mode 100644 index 0000000000..473f055b49 --- /dev/null +++ b/target/linux/ath79/dts/qca9558_openmesh_a60.dts @@ -0,0 +1,8 @@ +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT + +#include "qca9558_openmesh_a60.dtsi" + +/ { + compatible = "openmesh,a60", "qca,qca9558"; + model = "OpenMesh A60"; +}; diff --git a/target/linux/ath79/dts/qca9558_openmesh_a60.dtsi b/target/linux/ath79/dts/qca9558_openmesh_a60.dtsi new file mode 100644 index 0000000000..9938e5f4c0 --- /dev/null +++ b/target/linux/ath79/dts/qca9558_openmesh_a60.dtsi @@ -0,0 +1,180 @@ +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT + +#include "qca955x.dtsi" + +#include +#include + +/ { + chosen { + /delete-property/ bootargs; + }; + + aliases { + serial0 = &uart; + led-boot = &led_status_green; + led-failsafe = &led_status_green; + led-running = &led_status_green; + led-upgrade = &led_status_green; + label-mac-device = ð0; + }; + + keys { + compatible = "gpio-keys"; + + reset { + label = "reset"; + linux,code = ; + gpios = <&gpio 17 GPIO_ACTIVE_LOW>; + }; + }; + + leds { + compatible = "gpio-leds"; + + status_blue { + label = "blue:status"; + gpios = <&gpio 13 GPIO_ACTIVE_HIGH>; + }; + + status_red { + label = "red:status"; + gpios = <&gpio 22 GPIO_ACTIVE_HIGH>; + }; + + led_status_green: status_green { + label = "green:status"; + gpios = <&gpio 23 GPIO_ACTIVE_HIGH>; + }; + }; + + watchdog { + compatible = "linux,wdt-gpio"; + gpios = <&gpio 16 GPIO_ACTIVE_LOW>; + hw_algo = "toggle"; + /* hw_margin_ms is actually 300s but driver limits it to 60s */ + hw_margin_ms = <60000>; + always-running; + }; +}; + +&usb_phy1 { + status = "okay"; +}; + +&usb1 { + status = "okay"; +}; + +&spi { + status = "okay"; + + flash@0 { + compatible = "jedec,spi-nor"; + reg = <0>; + spi-max-frequency = <40000000>; + + /* partitions are passed via bootloader */ + partitions { + compatible = "fixed-partitions"; + #address-cells = <1>; + #size-cells = <1>; + + partition@0 { + label = "u-boot"; + reg = <0x000000 0x040000>; + read-only; + }; + + partition@40000 { + label = "u-boot-env"; + reg = <0x040000 0x010000>; + }; + + partition@50000 { + label = "custom"; + reg = <0x050000 0x060000>; + read-only; + }; + + partition@b0000 { + label = "inactive"; + reg = <0x0b0000 0x7a0000>; + }; + + partition@850000 { + label = "inactive2"; + reg = <0x850000 0x7a0000>; + }; + + art: partition@ff0000 { + label = "ART"; + reg = <0xff0000 0x010000>; + read-only; + }; + }; + }; +}; + +&mdio0 { + status = "okay"; + + phy-mask = <0x6>; + + phy1: ethernet-phy@1 { + reg = <1>; + eee-broken-100tx; + eee-broken-1000t; + }; + + phy2: ethernet-phy@2 { + reg = <2>; + eee-broken-100tx; + eee-broken-1000t; + at803x-override-sgmii-link-check; + }; +}; + +ð0 { + status = "okay"; + + pll-data = <0x82000101 0x80000101 0x80001313>; + + mtd-mac-address = <&art 0x0>; + + phy-mode = "rgmii-id"; + phy-handle = <&phy1>; + + gmac-config { + device = <&gmac>; + rgmii-enabled = <1>; + rxd-delay = <3>; + rxdv-delay = <3>; + txd-delay = <0>; + txen-delay = <0>; + }; +}; + +ð1 { + status = "okay"; + + pll-data = <0x03000101 0x80000101 0x80001313>; + + mtd-mac-address = <&art 0x6>; + + qca955x-sgmii-fixup; + + phy-handle = <&phy2>; +}; + +&wmac { + status = "okay"; + + mtd-cal-data = <&art 0x1000>; + mtd-mac-address = <&art 0x0>; + mtd-mac-address-increment = <2>; +}; + +&pcie0 { + status = "okay"; +}; diff --git a/target/linux/ath79/generic/base-files/etc/board.d/02_network b/target/linux/ath79/generic/base-files/etc/board.d/02_network index 4133b9d7d3..d2b55f0ba6 100644 --- a/target/linux/ath79/generic/base-files/etc/board.d/02_network +++ b/target/linux/ath79/generic/base-files/etc/board.d/02_network @@ -170,6 +170,7 @@ ath79_setup_interfaces() comfast,cf-e120a-v3|\ comfast,cf-e314n-v2|\ compex,wpj531-16m|\ + openmesh,a60|\ openmesh,om2p-v4|\ openmesh,om2p-hs-v4|\ plasmacloud,pa300|\ diff --git a/target/linux/ath79/generic/base-files/etc/hotplug.d/firmware/11-ath10k-caldata b/target/linux/ath79/generic/base-files/etc/hotplug.d/firmware/11-ath10k-caldata index 9e4b4496e5..1402c5529a 100644 --- a/target/linux/ath79/generic/base-files/etc/hotplug.d/firmware/11-ath10k-caldata +++ b/target/linux/ath79/generic/base-files/etc/hotplug.d/firmware/11-ath10k-caldata @@ -98,6 +98,7 @@ case "$FIRMWARE" in caldata_extract "art" 0x5000 0x844 ath10k_patch_mac $(mtd_get_mac_binary art 0xc) ;; + openmesh,a60|\ openmesh,mr1750-v1|\ openmesh,mr1750-v2) caldata_extract "ART" 0x5000 0x844 diff --git a/target/linux/ath79/generic/base-files/lib/upgrade/platform.sh b/target/linux/ath79/generic/base-files/lib/upgrade/platform.sh index f8b1c13677..9b6a0cf9bc 100644 --- a/target/linux/ath79/generic/base-files/lib/upgrade/platform.sh +++ b/target/linux/ath79/generic/base-files/lib/upgrade/platform.sh @@ -65,6 +65,7 @@ platform_do_upgrade() { jjplus,ja76pf2) redboot_fis_do_upgrade "$1" linux ;; + openmesh,a60|\ openmesh,mr600-v1|\ openmesh,mr600-v2|\ openmesh,mr900-v1|\ diff --git a/target/linux/ath79/image/generic.mk b/target/linux/ath79/image/generic.mk index 2e23e4e72c..7c26f5dc1f 100644 --- a/target/linux/ath79/image/generic.mk +++ b/target/linux/ath79/image/generic.mk @@ -1628,6 +1628,16 @@ define Device/openmesh_common_256k openmesh-image ce_type=$$$$(OPENMESH_CE_TYPE) | append-metadata endef +define Device/openmesh_a60 + $(Device/openmesh_common_64k) + SOC := qca9558 + DEVICE_MODEL := A60 + DEVICE_PACKAGES += kmod-ath10k-ct ath10k-firmware-qca988x-ct kmod-usb2 + OPENMESH_CE_TYPE := A60 + SUPPORTED_DEVICES += a60 +endef +TARGET_DEVICES += openmesh_a60 + define Device/openmesh_mr600-v1 $(Device/openmesh_common_64k) SOC := ar9344 From 9a172797e593c061f6759a37eaeba2956ad8d72f Mon Sep 17 00:00:00 2001 From: Sven Eckelmann Date: Mon, 23 Nov 2020 13:41:34 +0100 Subject: [PATCH 05/35] ath79: Add support for OpenMesh A40 Device specifications: ====================== * Qualcomm/Atheros QCA9558 ver 1 rev 0 * 720/600/240 MHz (CPU/DDR/AHB) * 128 MB of RAM * 16 MB of SPI NOR flash - 2x 7 MB available; but one of the 7 MB regions is the recovery image * 2T2R 2.4 GHz Wi-Fi (11n) * 2T2R 5 GHz Wi-Fi (11ac) * multi-color LED (controlled via red/green/blue GPIOs) * 1x GPIO-button (reset) * external h/w watchdog (enabled by default)) * TTL pins are on board (arrow points to VCC, then follows: GND, TX, RX) * 2x ethernet - eth0 + Label: Ethernet 1 + AR8035 ethernet PHY (RGMII) + 10/100/1000 Mbps Ethernet + 802.3af POE + used as WAN interface - eth1 + Label: Ethernet 2 + AR8035 ethernet PHY (SGMII) + 10/100/1000 Mbps Ethernet + used as LAN interface * 1x USB * internal antennas Flashing instructions: ====================== Various methods can be used to install the actual image on the flash. Two easy ones are: ap51-flash ---------- The tool ap51-flash (https://github.com/ap51-flash/ap51-flash) should be used to transfer the image to the u-boot when the device boots up. initramfs from TFTP ------------------- The serial console must be used to access the u-boot shell during bootup. It can then be used to first boot up the initramfs image from a TFTP server (here with the IP 192.168.1.21): setenv serverip 192.168.1.21 setenv ipaddr 192.168.1.1 tftpboot 0c00000 .bin && bootm $fileaddr The actual sysupgrade image can then be transferred (on the LAN port) to the device via scp .bin root@192.168.1.1:/tmp/ On the device, the sysupgrade must then be started using sysupgrade -n /tmp/.bin Signed-off-by: Sven Eckelmann --- package/boot/uboot-envtools/files/ath79 | 1 + target/linux/ath79/dts/qca9558_openmesh_a40.dts | 8 ++++++++ .../ath79/generic/base-files/etc/board.d/02_network | 1 + .../etc/hotplug.d/firmware/11-ath10k-caldata | 1 + .../ath79/generic/base-files/lib/upgrade/platform.sh | 1 + target/linux/ath79/image/generic.mk | 10 ++++++++++ 6 files changed, 22 insertions(+) create mode 100644 target/linux/ath79/dts/qca9558_openmesh_a40.dts diff --git a/package/boot/uboot-envtools/files/ath79 b/package/boot/uboot-envtools/files/ath79 index 1fc484df52..91ba587bf8 100644 --- a/package/boot/uboot-envtools/files/ath79 +++ b/package/boot/uboot-envtools/files/ath79 @@ -48,6 +48,7 @@ netgear,wnr2200-16m|\ netgear,wnr612-v2|\ ocedo,koala|\ ocedo,raccoon|\ +openmesh,a40|\ openmesh,a60|\ openmesh,mr600-v1|\ openmesh,mr600-v2|\ diff --git a/target/linux/ath79/dts/qca9558_openmesh_a40.dts b/target/linux/ath79/dts/qca9558_openmesh_a40.dts new file mode 100644 index 0000000000..d2b817031a --- /dev/null +++ b/target/linux/ath79/dts/qca9558_openmesh_a40.dts @@ -0,0 +1,8 @@ +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT + +#include "qca9558_openmesh_a60.dtsi" + +/ { + compatible = "openmesh,a40", "qca,qca9558"; + model = "OpenMesh A40"; +}; diff --git a/target/linux/ath79/generic/base-files/etc/board.d/02_network b/target/linux/ath79/generic/base-files/etc/board.d/02_network index d2b55f0ba6..87aaf0bcad 100644 --- a/target/linux/ath79/generic/base-files/etc/board.d/02_network +++ b/target/linux/ath79/generic/base-files/etc/board.d/02_network @@ -170,6 +170,7 @@ ath79_setup_interfaces() comfast,cf-e120a-v3|\ comfast,cf-e314n-v2|\ compex,wpj531-16m|\ + openmesh,a40|\ openmesh,a60|\ openmesh,om2p-v4|\ openmesh,om2p-hs-v4|\ diff --git a/target/linux/ath79/generic/base-files/etc/hotplug.d/firmware/11-ath10k-caldata b/target/linux/ath79/generic/base-files/etc/hotplug.d/firmware/11-ath10k-caldata index 1402c5529a..a7986a98ec 100644 --- a/target/linux/ath79/generic/base-files/etc/hotplug.d/firmware/11-ath10k-caldata +++ b/target/linux/ath79/generic/base-files/etc/hotplug.d/firmware/11-ath10k-caldata @@ -98,6 +98,7 @@ case "$FIRMWARE" in caldata_extract "art" 0x5000 0x844 ath10k_patch_mac $(mtd_get_mac_binary art 0xc) ;; + openmesh,a40|\ openmesh,a60|\ openmesh,mr1750-v1|\ openmesh,mr1750-v2) diff --git a/target/linux/ath79/generic/base-files/lib/upgrade/platform.sh b/target/linux/ath79/generic/base-files/lib/upgrade/platform.sh index 9b6a0cf9bc..20041e4c95 100644 --- a/target/linux/ath79/generic/base-files/lib/upgrade/platform.sh +++ b/target/linux/ath79/generic/base-files/lib/upgrade/platform.sh @@ -65,6 +65,7 @@ platform_do_upgrade() { jjplus,ja76pf2) redboot_fis_do_upgrade "$1" linux ;; + openmesh,a40|\ openmesh,a60|\ openmesh,mr600-v1|\ openmesh,mr600-v2|\ diff --git a/target/linux/ath79/image/generic.mk b/target/linux/ath79/image/generic.mk index 7c26f5dc1f..86aae57266 100644 --- a/target/linux/ath79/image/generic.mk +++ b/target/linux/ath79/image/generic.mk @@ -1628,6 +1628,16 @@ define Device/openmesh_common_256k openmesh-image ce_type=$$$$(OPENMESH_CE_TYPE) | append-metadata endef +define Device/openmesh_a40 + $(Device/openmesh_common_64k) + SOC := qca9558 + DEVICE_MODEL := A40 + DEVICE_PACKAGES += kmod-ath10k-ct ath10k-firmware-qca988x-ct kmod-usb2 + OPENMESH_CE_TYPE := A60 + SUPPORTED_DEVICES += a40 +endef +TARGET_DEVICES += openmesh_a40 + define Device/openmesh_a60 $(Device/openmesh_common_64k) SOC := qca9558 From 1eb481206dd4173f9e19f83e4b05892cd1035c74 Mon Sep 17 00:00:00 2001 From: Zoltan HERPAI Date: Mon, 3 Aug 2020 23:07:21 +0200 Subject: [PATCH 06/35] ath79: add support for Qualcomm AP143 reference boards Specifications: SoC: QCA9533 DRAM: 32Mb DDR1 Flash: 8/16Mb SPI-NOR LAN: 4x 10/100Mbps via AR8229 switch (integrated into SoC) on GMII WAN: 1x 10/100Mbps via MII WLAN: QCA9530 USB: 1x 2.0 UART: standard QCA UART header JTAG: yes Button: 1x WPS, 1x reset LEDs: 8x LEDs A version with 4Mb flash is also available, but due to lack of enough space it's not supported. As the original flash layout does not provide enough space for the kernel (1472k), the firmware uses OKLI and concat flash to overcome the limitation without changing the boot address of the bootloaders. Installation: 1. Original bootloader Connect the board to ethernet Set up a server with an IP address of 192.168.1.10 Make the openwrt-ath79-generic-qca_ap143-8m-squashfs-factory.bin available via TFTP tftpboot 0x80060000 openwrt-ath79-generic-qca_ap143-8m-squashfs-factory.bin erase 0x9f050000 +$filesize cp.b $fileaddr 0x9f050000 $filesize Reboot the board. 2. pepe2k's u-boot_mod Connect the board to ethernet Set up a server with an IP address of 192.168.1.10 Make the openwrt-ath79-generic-qca_ap143-8m-squashfs-factory.bin available via TFTP, as "firmware.bin" run fw_upg Reboot the board. For the 16M version of the board, please use openwrt-ath79-generic-qca_ap143-16m-squashfs-factory.bin Signed-off-by: Zoltan HERPAI [use fwconcatX names, drop redundant uart status, fix IMAGE_SIZE, set up IMAGE/factory.bin without metadata] Signed-off-by: Adrian Schmutzler --- .../linux/ath79/dts/qca9533_qca_ap143-16m.dts | 49 +++++++ .../linux/ath79/dts/qca9533_qca_ap143-8m.dts | 49 +++++++ target/linux/ath79/dts/qca9533_qca_ap143.dtsi | 125 ++++++++++++++++++ .../generic/base-files/etc/board.d/01_leds | 8 ++ .../generic/base-files/etc/board.d/02_network | 4 +- target/linux/ath79/image/Makefile | 4 + target/linux/ath79/image/generic.mk | 37 ++++++ 7 files changed, 275 insertions(+), 1 deletion(-) create mode 100644 target/linux/ath79/dts/qca9533_qca_ap143-16m.dts create mode 100644 target/linux/ath79/dts/qca9533_qca_ap143-8m.dts create mode 100644 target/linux/ath79/dts/qca9533_qca_ap143.dtsi diff --git a/target/linux/ath79/dts/qca9533_qca_ap143-16m.dts b/target/linux/ath79/dts/qca9533_qca_ap143-16m.dts new file mode 100644 index 0000000000..31e61de175 --- /dev/null +++ b/target/linux/ath79/dts/qca9533_qca_ap143-16m.dts @@ -0,0 +1,49 @@ +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT + +#include "qca9533_qca_ap143.dtsi" + +/ { + model = "Qualcomm Atheros AP143 (16M) reference board"; + compatible = "qca,ap143-16m", "qca,qca9533"; + + virtual_flash { + compatible = "mtd-concat"; + devices = <&fwconcat0 &fwconcat1>; + + partitions { + compatible = "fixed-partitions"; + #address-cells = <1>; + #size-cells = <1>; + + partition@0 { + reg = <0x0 0x0>; + label = "firmware"; + compatible = "openwrt,uimage", "denx,uimage"; + openwrt,ih-magic = ; + }; + }; + }; +}; + +&partitions { + fwconcat0: partition@50000 { + label = "fwconcat0"; + reg = <0x050000 0xe30000>; + }; + + partition@e80000 { + label = "loader"; + reg = <0xe80000 0x10000>; + }; + + fwconcat1: partition@e90000 { + label = "fwconcat1"; + reg = <0xe90000 0x160000>; + }; + + art: partition@ff0000 { + label = "art"; + reg = <0xff0000 0x010000>; + read-only; + }; +}; diff --git a/target/linux/ath79/dts/qca9533_qca_ap143-8m.dts b/target/linux/ath79/dts/qca9533_qca_ap143-8m.dts new file mode 100644 index 0000000000..bdb93420b5 --- /dev/null +++ b/target/linux/ath79/dts/qca9533_qca_ap143-8m.dts @@ -0,0 +1,49 @@ +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT + +#include "qca9533_qca_ap143.dtsi" + +/ { + model = "Qualcomm Atheros AP143 (8M) reference board"; + compatible = "qca,ap143-8m", "qca,qca9533"; + + virtual_flash { + compatible = "mtd-concat"; + devices = <&fwconcat0 &fwconcat1>; + + partitions { + compatible = "fixed-partitions"; + #address-cells = <1>; + #size-cells = <1>; + + partition@0 { + reg = <0x0 0x0>; + label = "firmware"; + compatible = "openwrt,uimage", "denx,uimage"; + openwrt,ih-magic = ; + }; + }; + }; +}; + +&partitions { + fwconcat0: partition@50000 { + label = "fwconcat0"; + reg = <0x050000 0x630000>; + }; + + partition@680000 { + label = "loader"; + reg = <0x680000 0x10000>; + }; + + fwconcat1: partition@690000 { + label = "fwconcat1"; + reg = <0x690000 0x160000>; + }; + + art: partition@7f0000 { + label = "art"; + reg = <0x7f0000 0x010000>; + read-only; + }; +}; diff --git a/target/linux/ath79/dts/qca9533_qca_ap143.dtsi b/target/linux/ath79/dts/qca9533_qca_ap143.dtsi new file mode 100644 index 0000000000..95a24175a5 --- /dev/null +++ b/target/linux/ath79/dts/qca9533_qca_ap143.dtsi @@ -0,0 +1,125 @@ +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT + +#include "qca953x.dtsi" + +#include +#include +#include + +/ { + aliases { + led-boot = &led_wps; + led-failsafe = &led_wps; + led-running = &led_wps; + led-upgrade = &led_wps; + }; + + leds { + compatible = "gpio-leds"; + + wan { + label = "green:wan"; + gpios = <&gpio 4 GPIO_ACTIVE_LOW>; + }; + + wlan { + label = "green:wlan"; + gpios = <&gpio 12 GPIO_ACTIVE_LOW>; + linux,default-trigger = "phy0tpt"; + }; + + lan1 { + label = "green:lan1"; + gpios = <&gpio 16 GPIO_ACTIVE_LOW>; + }; + + lan2 { + label = "green:lan2"; + gpios = <&gpio 15 GPIO_ACTIVE_LOW>; + }; + + lan3 { + label = "green:lan3"; + gpios = <&gpio 14 GPIO_ACTIVE_LOW>; + }; + + lan4 { + label = "green:lan4"; + gpios = <&gpio 11 GPIO_ACTIVE_LOW>; + }; + + led_wps: wps { + label = "green:wps"; + gpios = <&gpio 13 GPIO_ACTIVE_LOW>; + }; + }; + + keys { + compatible = "gpio-keys"; + + wps { + label = "WPS button"; + linux,code = ; + gpios = <&gpio 17 GPIO_ACTIVE_LOW>; + debounce-interval = <60>; + }; + }; +}; + +&spi { + status = "okay"; + + flash@0 { + compatible = "jedec,spi-nor"; + reg = <0>; + spi-max-frequency = <25000000>; + + partitions: partitions { + compatible = "fixed-partitions"; + #address-cells = <1>; + #size-cells = <1>; + + partition@0 { + label = "u-boot"; + reg = <0x000000 0x040000>; + read-only; + }; + + partition@40000 { + label = "u-boot-env"; + reg = <0x040000 0x010000>; + read-only; + }; + }; + }; +}; + +ð0 { + status = "okay"; + + mtd-mac-address = <&art 0x0>; + + phy-handle = <&swphy4>; +}; + +ð1 { + mtd-mac-address = <&art 0x6>; + + gmac-config { + device = <&gmac>; + }; +}; + +&wmac { + status = "okay"; + + mtd-cal-data = <&art 0x1000>; +}; + +&usb0 { + status = "okay"; +}; + +&usb_phy { + status = "okay"; +}; diff --git a/target/linux/ath79/generic/base-files/etc/board.d/01_leds b/target/linux/ath79/generic/base-files/etc/board.d/01_leds index 1990353394..8ead3ec0a3 100644 --- a/target/linux/ath79/generic/base-files/etc/board.d/01_leds +++ b/target/linux/ath79/generic/base-files/etc/board.d/01_leds @@ -260,6 +260,14 @@ pcs,cr3000) ucidef_set_led_switch "lan3" "LAN3" "blue:lan3" "switch0" "0x10" ucidef_set_led_switch "lan4" "LAN4" "blue:lan4" "switch0" "0x02" ;; +qca,ap143-8m|\ +qca,ap143-16m) + ucidef_set_led_netdev "wan" "WAN" "green:wan" "eth1" + ucidef_set_led_switch "lan1" "LAN1" "green:lan1" "switch0" "0x02" + ucidef_set_led_switch "lan2" "LAN2" "green:lan2" "switch0" "0x04" + ucidef_set_led_switch "lan3" "LAN3" "green:lan3" "switch0" "0x08" + ucidef_set_led_switch "lan4" "LAN4" "green:lan4" "switch0" "0x10" + ;; qihoo,c301) ucidef_set_led_wlan "wlan" "WLAN" "green:wlan" "phy0tpt" ;; diff --git a/target/linux/ath79/generic/base-files/etc/board.d/02_network b/target/linux/ath79/generic/base-files/etc/board.d/02_network index 87aaf0bcad..8ea52af67a 100644 --- a/target/linux/ath79/generic/base-files/etc/board.d/02_network +++ b/target/linux/ath79/generic/base-files/etc/board.d/02_network @@ -192,7 +192,9 @@ ath79_setup_interfaces() ucidef_add_switch "switch0" \ "0@eth0" "1:wan" "2:lan" ;; - comfast,cf-e560ac) + comfast,cf-e560ac|\ + qca,ap143-8m|\ + qca,ap143-16m) ucidef_set_interface_wan "eth1" ucidef_add_switch "switch0" \ "0@eth0" "1:lan" "2:lan" "3:lan" "4:lan" diff --git a/target/linux/ath79/image/Makefile b/target/linux/ath79/image/Makefile index 3c126f479e..aa8665fbb2 100644 --- a/target/linux/ath79/image/Makefile +++ b/target/linux/ath79/image/Makefile @@ -48,6 +48,10 @@ define Build/append-loader-okli cat "$(KDIR)/loader-$(word 1,$(1)).$(LOADER_TYPE)" >> "$@" endef +define Build/append-loader-okli-uimage + cat "$(KDIR)/loader-$(word 1,$(1)).uImage" >> "$@" +endef + define Build/relocate-kernel rm -rf $@.relocate $(CP) ../../generic/image/relocate $@.relocate diff --git a/target/linux/ath79/image/generic.mk b/target/linux/ath79/image/generic.mk index 86aae57266..4d3f455e49 100644 --- a/target/linux/ath79/image/generic.mk +++ b/target/linux/ath79/image/generic.mk @@ -1900,6 +1900,43 @@ define Device/plasmacloud_pa300e endef TARGET_DEVICES += plasmacloud_pa300e +define Device/qca_ap143 + SOC := qca9533 + DEVICE_VENDOR := Qualcomm Atheros + DEVICE_MODEL := AP143 + DEVICE_PACKAGES := kmod-usb2 + SUPPORTED_DEVICES += ap143 + LOADER_TYPE := bin + LOADER_FLASH_OFFS := 0x50000 + KERNEL := kernel-bin | append-dtb | lzma | uImage lzma -M 0x4f4b4c49 + COMPILE := loader-$(1).bin loader-$(1).uImage + COMPILE/loader-$(1).bin := loader-okli-compile + COMPILE/loader-$(1).uImage := append-loader-okli $(1) | pad-to 64k | lzma | \ + uImage lzma +endef + +define Device/qca_ap143-8m + $(Device/qca_ap143) + DEVICE_VARIANT := (8M) + IMAGE_SIZE := 7744k + IMAGES += factory.bin + IMAGE/factory.bin := append-kernel | pad-to $$$$(BLOCKSIZE) | \ + append-rootfs | pad-rootfs | check-size | pad-to 6336k | \ + append-loader-okli-uimage $(1) | pad-to 64k +endef +TARGET_DEVICES += qca_ap143-8m + +define Device/qca_ap143-16m + $(Device/qca_ap143) + DEVICE_VARIANT := (16M) + IMAGE_SIZE := 15936k + IMAGES += factory.bin + IMAGE/factory.bin := append-kernel | pad-to $$$$(BLOCKSIZE) | \ + append-rootfs | pad-rootfs | check-size | pad-to 14528k | \ + append-loader-okli-uimage $(1) | pad-to 64k +endef +TARGET_DEVICES += qca_ap143-16m + define Device/qihoo_c301 $(Device/seama) SOC := ar9344 From fbc2feadd4e56483db485217f69a1e2149e7693f Mon Sep 17 00:00:00 2001 From: Philipp Borgers Date: Wed, 2 Jun 2021 11:01:32 +0200 Subject: [PATCH 07/35] ramips: enable additional UART on MikroTik RouterBOARD M33G The RouterBOARD M33G has an additional UART that should be enabled by default. Signed-off-by: Philipp Borgers --- target/linux/ramips/dts/mt7621_mikrotik_routerboard-m33g.dts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/target/linux/ramips/dts/mt7621_mikrotik_routerboard-m33g.dts b/target/linux/ramips/dts/mt7621_mikrotik_routerboard-m33g.dts index affbaf35b7..d457c43426 100644 --- a/target/linux/ramips/dts/mt7621_mikrotik_routerboard-m33g.dts +++ b/target/linux/ramips/dts/mt7621_mikrotik_routerboard-m33g.dts @@ -127,3 +127,7 @@ &pcie { status = "okay"; }; + +&uartlite3 { + status = "okay"; +}; From 305c1b8d746b363f655c2f8d5a6497cca10a5d4e Mon Sep 17 00:00:00 2001 From: Felix Fietkau Date: Fri, 4 Jun 2021 09:12:07 +0200 Subject: [PATCH 08/35] hostapd: configure inter-AP communication interface for 802.11r In setups using VLAN bridge filtering, hostapd may need to communicate using a VLAN interface on top of the bridge, instead of using the bridge directly Signed-off-by: Felix Fietkau --- .../network/services/hostapd/files/hostapd.sh | 1 + .../hostapd/patches/730-ft_iface.patch | 38 +++++++++++++++++++ 2 files changed, 39 insertions(+) create mode 100644 package/network/services/hostapd/patches/730-ft_iface.patch diff --git a/package/network/services/hostapd/files/hostapd.sh b/package/network/services/hostapd/files/hostapd.sh index 1fa22cb69e..cf85019d56 100644 --- a/package/network/services/hostapd/files/hostapd.sh +++ b/package/network/services/hostapd/files/hostapd.sh @@ -805,6 +805,7 @@ hostapd_set_bss_options() { ;; esac + [ -n "$network_ifname" ] && append bss_conf "ft_iface=$network_ifname" "$N" append bss_conf "mobility_domain=$mobility_domain" "$N" append bss_conf "ft_psk_generate_local=$ft_psk_generate_local" "$N" append bss_conf "ft_over_ds=$ft_over_ds" "$N" diff --git a/package/network/services/hostapd/patches/730-ft_iface.patch b/package/network/services/hostapd/patches/730-ft_iface.patch new file mode 100644 index 0000000000..793e8e0194 --- /dev/null +++ b/package/network/services/hostapd/patches/730-ft_iface.patch @@ -0,0 +1,38 @@ +--- a/hostapd/config_file.c ++++ b/hostapd/config_file.c +@@ -3031,6 +3031,8 @@ static int hostapd_config_fill(struct ho + wpa_printf(MSG_INFO, + "Line %d: Obsolete peerkey parameter ignored", line); + #ifdef CONFIG_IEEE80211R_AP ++ } else if (os_strcmp(buf, "ft_iface") == 0) { ++ os_strlcpy(bss->ft_iface, pos, sizeof(bss->ft_iface)); + } else if (os_strcmp(buf, "mobility_domain") == 0) { + if (os_strlen(pos) != 2 * MOBILITY_DOMAIN_ID_LEN || + hexstr2bin(pos, bss->mobility_domain, +--- a/src/ap/ap_config.h ++++ b/src/ap/ap_config.h +@@ -277,6 +277,7 @@ struct airtime_sta_weight { + struct hostapd_bss_config { + char iface[IFNAMSIZ + 1]; + char bridge[IFNAMSIZ + 1]; ++ char ft_iface[IFNAMSIZ + 1]; + char vlan_bridge[IFNAMSIZ + 1]; + char wds_bridge[IFNAMSIZ + 1]; + +--- a/src/ap/wpa_auth_glue.c ++++ b/src/ap/wpa_auth_glue.c +@@ -1565,8 +1565,12 @@ int hostapd_setup_wpa(struct hostapd_dat + wpa_key_mgmt_ft(hapd->conf->wpa_key_mgmt)) { + const char *ft_iface; + +- ft_iface = hapd->conf->bridge[0] ? hapd->conf->bridge : +- hapd->conf->iface; ++ if (hapd->conf->ft_iface[0]) ++ ft_iface = hapd->conf->ft_iface; ++ else if (hapd->conf->bridge[0]) ++ ft_iface = hapd->conf->bridge; ++ else ++ ft_iface = hapd->conf->iface; + hapd->l2 = l2_packet_init(ft_iface, NULL, ETH_P_RRB, + hostapd_rrb_receive, hapd, 1); + if (!hapd->l2) { From b126d9c3a3d3c8fe0937bcdfffabe8df941d2c06 Mon Sep 17 00:00:00 2001 From: Robert Marko Date: Wed, 25 Nov 2020 14:23:58 +0100 Subject: [PATCH 09/35] ipq40xx: add netgear wac510 support This adds support for the Netgear WAC510 Insight Managed Smart Cloud Wireless Access Point, an indoor dual-band, dual-radio 802.11ac business-class wireless AP with integrated omnidirectional antennae and two 10/100/1000 Mbps Ethernet ports. For more information see: Specifications: SoC: Qualcomm IPQ4018 (DAKOTA) ARM Quad-Core RAM: 256 MiB Flash1: 2 MiB Winbond W25Q16JV SPI-NOR Flash2: 128 MiB Winbond W25N01GVZEIG SPI-NAND Ethernet: Built-in IPQ4018 (SoC, QCA8072 PHY), 2x 1000/100/10 port, WAN port active IEEE 802.3af/at PoE in Wireless1: Built-in IPQ4018 (SoC) 802.11b/g/n 2x2:2, 3 dBi antennae Wireless2: Built-in IPQ4018 (SoC) 802.11a/n/ac 2x2:2, 4 dBi antennae Input: (Optional) Barrel 12 V 2.5 A Power, Reset button SW1 LEDs: Power, Insight, WAN PoE, LAN, 2.4G WLAN, 5G WLAN Serial: Header J2 1 - 3.3 Volt (Do NOT connect!) 2 - TX 3 - RX 4 - Ground WARNING: The serial port needs a TTL/RS-232 3.3 volt level converter! The Serial settings are 115200-8-N-1. Installation via Stock Web Interface: BTW: The default factory console/web interface login user/password are admin/password. In the web interface navigating to Management - Maintenance - Upgrade - 'Firmware Upgrade' will show you what is currently installed e.g.: Manage Firmware Current Firmware Version: V5.0.10.2 Backup Firmware Version: V1.2.5.11 Under 'Upgrade Options' choose Local (alternatively SFTP would be available) then click/select 'Browse File' on the right side, choose openwrt-ipq40xx-generic-netgear_wac510-squashfs-nand-factory.tar and hit the Upgrade button below. After a minute or two your browser should indicate completion printing 'Firmware update complete.' and 'Rebooting AP...'. Note that OpenWrt will use the WAN PoE port as actual WAN port defaulting to DHCP client but NOT allowing LuCI access, use LAN port defaulting to 192.168.1.1/24 to access LuCI. Installation via TFTP Requiring Serial U-Boot Access: Connect to the device's serial port and hit any key to stop autoboot. Upload and boot the initramfs based OpenWrt image as follows: (IPQ40xx) # setenv serverip 192.168.1.1 (IPQ40xx) # setenv ipaddr 192.168.1.2 (IPQ40xx) # tftpboot openwrt-ipq40xx-generic-netgear_wac510-initramfs-fit-uImage.itb (IPQ40xx) # bootm Note: This only runs OpenWrt from RAM and has not installed anything to flash as of yet. One may permanently install OpenWrt as follows: Check the MTD device number of the active partition: root@OpenWrt:/# dmesg | grep 'set to be root filesystem' [ 1.010084] mtd: device 9 (rootfs) set to be root filesystem Upload the factory image ending with .ubi to /tmp (e.g. using scp or tftp). Then flash the image as follows (substituting the 9 in mtd9 below with whatever number reported above): root@OpenWrt:/# ubiformat /dev/mtd9 -f /tmp/openwrt-ipq40xx-generic-netgear_wac510-squashfs-nand-factory.ubi And reboot. Dual Image Configuration: The default U-Boot boot command bootipq uses the U-Boot environment variables primary/secondary to decide which image to boot. E.g. primary=0, secondary=3800000 uses rootfs while primary=3800000, secondary=0 uses rootfs_1. Switching their values changes the active partition. E.g. from within U-Boot: (IPQ40xx) # setenv primary 0 (IPQ40xx) # setenv secondary 3800000 (IPQ40xx) # saveenv Or from a OpenWrt userspace serial/SSH console: fw_setenv primary 0 fw_setenv secondary 3800000 Note that if you install two copies of OpenWrt then each will have its independent configuration not like when switching partitions on the stock firmware. BTW: The kernel log shows which boot partition is active: [ 2.439050] ubi0: attached mtd9 (name "rootfs", size 56 MiB) vs. [ 2.978785] ubi0: attached mtd10 (name "rootfs_1", size 56 MiB) Note: After 3 failed boot attempts it automatically switches partition. Signed-off-by: Robert Marko Signed-off-by: Marcel Ziswiler [squashed netgear-tar commit into main and rename netgear-tar for now, until it is made generic.] Signed-off-by: Christian Lamparter --- package/boot/uboot-envtools/files/ipq40xx | 1 + package/firmware/ipq-wifi/Makefile | 2 + .../ipq40xx/base-files/etc/board.d/02_network | 1 + .../etc/hotplug.d/firmware/11-ath10k-caldata | 8 + .../ipq40xx/base-files/etc/init.d/bootcount | 3 + .../base-files/lib/upgrade/platform.sh | 1 + .../arch/arm/boot/dts/qcom-ipq4018-wac510.dts | 371 ++++++++++++++++++ target/linux/ipq40xx/image/generic.mk | 25 ++ .../901-arm-boot-add-dts-files.patch | 3 +- 9 files changed, 414 insertions(+), 1 deletion(-) create mode 100644 target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4018-wac510.dts diff --git a/package/boot/uboot-envtools/files/ipq40xx b/package/boot/uboot-envtools/files/ipq40xx index 88390f534c..1462aa991d 100644 --- a/package/boot/uboot-envtools/files/ipq40xx +++ b/package/boot/uboot-envtools/files/ipq40xx @@ -36,6 +36,7 @@ edgecore,ecw5211|\ glinet,gl-ap1300|\ glinet,gl-b1300|\ luma,wrtq-329acn|\ +netgear,wac510|\ openmesh,a42|\ openmesh,a62|\ plasmacloud,pa1200|\ diff --git a/package/firmware/ipq-wifi/Makefile b/package/firmware/ipq-wifi/Makefile index e3b25bb556..e63e3b3ba1 100644 --- a/package/firmware/ipq-wifi/Makefile +++ b/package/firmware/ipq-wifi/Makefile @@ -47,6 +47,7 @@ ALLWIFIBOARDS:= \ mikrotik_sxtsq-5-ac \ mobipromo_cm520-79f \ nec_wg2600hp3 \ + netgear_wac510 \ plasmacloud_pa1200 \ plasmacloud_pa2200 \ qxwlan_e2600ac @@ -132,6 +133,7 @@ $(eval $(call generate-ipq-wifi-package,mikrotik_hap-ac2,Mikrotik hAP ac2)) $(eval $(call generate-ipq-wifi-package,mikrotik_sxtsq-5-ac,MikroTik SXTsq 5 ac)) $(eval $(call generate-ipq-wifi-package,mobipromo_cm520-79f,MobiPromo CM520-79F)) $(eval $(call generate-ipq-wifi-package,nec_wg2600hp3,NEC Platforms WG2600HP3)) +$(eval $(call generate-ipq-wifi-package,netgear_wac510,Netgear WAC510)) $(eval $(call generate-ipq-wifi-package,plasmacloud_pa1200,Plasma Cloud PA1200)) $(eval $(call generate-ipq-wifi-package,plasmacloud_pa2200,Plasma Cloud PA2200)) $(eval $(call generate-ipq-wifi-package,qxwlan_e2600ac,Qxwlan E2600AC)) diff --git a/target/linux/ipq40xx/base-files/etc/board.d/02_network b/target/linux/ipq40xx/base-files/etc/board.d/02_network index 6a94fe3ff4..ecdbac8f86 100644 --- a/target/linux/ipq40xx/base-files/etc/board.d/02_network +++ b/target/linux/ipq40xx/base-files/etc/board.d/02_network @@ -17,6 +17,7 @@ ipq40xx_setup_interfaces() engenius,emr3500|\ engenius,ens620ext|\ luma,wrtq-329acn|\ + netgear,wac510|\ plasmacloud,pa1200|\ plasmacloud,pa2200) ucidef_set_interfaces_lan_wan "eth0" "eth1" diff --git a/target/linux/ipq40xx/base-files/etc/hotplug.d/firmware/11-ath10k-caldata b/target/linux/ipq40xx/base-files/etc/hotplug.d/firmware/11-ath10k-caldata index b12c9af9a7..42cb295496 100644 --- a/target/linux/ipq40xx/base-files/etc/hotplug.d/firmware/11-ath10k-caldata +++ b/target/linux/ipq40xx/base-files/etc/hotplug.d/firmware/11-ath10k-caldata @@ -150,6 +150,10 @@ case "$FIRMWARE" in caldata_extract "ART" 0x1000 0x2f20 ath10k_patch_mac $(mtd_get_mac_binary dnidata 0x0) ;; + netgear,wac510) + caldata_extract "0:ART" 0x1000 0x2f20 + ath10k_patch_mac $(mtd_get_mac_binary "0:MANUDATA" 0x6) + ;; zyxel,nbg6617 |\ zyxel,wre6606) caldata_extract "ART" 0x1000 0x2f20 @@ -260,6 +264,10 @@ case "$FIRMWARE" in caldata_extract "ART" 0x5000 0x2f20 ath10k_patch_mac $(mtd_get_mac_binary dnidata 0xc) ;; + netgear,wac510) + caldata_extract "0:ART" 0x5000 0x2f20 + ath10k_patch_mac $(macaddr_add $(mtd_get_mac_binary "0:MANUDATA" 0x6) +16) + ;; zyxel,nbg6617 |\ zyxel,wre6606) caldata_extract "ART" 0x5000 0x2f20 diff --git a/target/linux/ipq40xx/base-files/etc/init.d/bootcount b/target/linux/ipq40xx/base-files/etc/init.d/bootcount index d2a4abcadd..9abfbddc43 100755 --- a/target/linux/ipq40xx/base-files/etc/init.d/bootcount +++ b/target/linux/ipq40xx/base-files/etc/init.d/bootcount @@ -13,5 +13,8 @@ boot() { linksys,mr8300) mtd resetbc s_env || true ;; + netgear,wac510) + fw_setenv boot_cnt=0 + ;; esac } diff --git a/target/linux/ipq40xx/base-files/lib/upgrade/platform.sh b/target/linux/ipq40xx/base-files/lib/upgrade/platform.sh index 54683977cd..68027be666 100644 --- a/target/linux/ipq40xx/base-files/lib/upgrade/platform.sh +++ b/target/linux/ipq40xx/base-files/lib/upgrade/platform.sh @@ -72,6 +72,7 @@ platform_do_upgrade() { glinet,gl-ap1300 |\ luma,wrtq-329acn |\ mobipromo,cm520-79f |\ + netgear,wac510 |\ qxwlan,e2600ac-c2) nand_do_upgrade "$1" ;; diff --git a/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4018-wac510.dts b/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4018-wac510.dts new file mode 100644 index 0000000000..20e12855f4 --- /dev/null +++ b/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4018-wac510.dts @@ -0,0 +1,371 @@ +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT +/* Copyright (c) 2020, Robert Marko */ + +#include "qcom-ipq4019.dtsi" +#include +#include +#include + +/ { + model = "Netgear WAC510"; + compatible = "netgear,wac510"; + + aliases { + led-boot = &led_power_amber; + led-failsafe = &led_power_amber; + led-running = &led_power_green; + led-upgrade = &led_power_amber; + label-mac-device = &gmac0; + }; + + chosen { + bootargs-append = " root=/dev/ubiblock0_1"; + }; + + soc { + rng@22000 { + status = "okay"; + }; + + ess-psgmii@98000 { + status = "okay"; + }; + + counter@4a1000 { + compatible = "qcom,qca-gcnt"; + reg = <0x4a1000 0x4>; + }; + + tcsr@1949000 { + compatible = "qcom,tcsr"; + reg = <0x1949000 0x100>; + qcom,wifi_glb_cfg = ; + }; + + tcsr@194b000 { + status = "okay"; + + compatible = "qcom,tcsr"; + reg = <0x194b000 0x100>; + qcom,usb-hsphy-mode-select = ; + }; + + ess_tcsr@1953000 { + compatible = "qcom,tcsr"; + reg = <0x1953000 0x1000>; + qcom,ess-interface-select = ; + }; + + tcsr@1957000 { + compatible = "qcom,tcsr"; + reg = <0x1957000 0x100>; + qcom,wifi_noc_memtype_m0_m2 = ; + }; + + usb2: usb2@60f8800 { + status = "okay"; + }; + + usb3: usb3@8af8800 { + status = "okay"; + }; + + crypto@8e3a000 { + status = "okay"; + }; + + watchdog@b017000 { + status = "okay"; + }; + + ess-switch@c000000 { + status = "okay"; + }; + + edma@c080000 { + status = "okay"; + }; + }; + + keys { + compatible = "gpio-keys"; + + reset { + label = "reset"; + gpios = <&tlmm 63 GPIO_ACTIVE_LOW>; + linux,code = ; + }; + }; + + led_spi { + compatible = "spi-gpio"; + #address-cells = <1>; + #size-cells = <0>; + + sck-gpios = <&tlmm 5 GPIO_ACTIVE_HIGH>; + mosi-gpios = <&tlmm 4 GPIO_ACTIVE_HIGH>; + num-chipselects = <0>; + + ssr: ssr@0 { + compatible = "fairchild,74hc595"; + reg = <0>; + gpio-controller; + #gpio-cells = <2>; + registers-number = <1>; + spi-max-frequency = <1000000>; + }; + }; + + leds { + compatible = "gpio-leds"; + + led_power_amber: power_amber { + label = "amber:power"; + gpios = <&ssr 6 GPIO_ACTIVE_LOW>; + panic-indicator; + }; + + led_power_green: power_green { + label = "green:power"; + gpios = <&ssr 5 GPIO_ACTIVE_LOW>; + }; + + wlan2g_blue { + label = "blue:wlan2g"; + gpios = <&ssr 4 GPIO_ACTIVE_LOW>; + linux,default-trigger = "phy0tpt"; + }; + + wlan2g_green { + label = "green:wlan2g"; + gpios = <&ssr 3 GPIO_ACTIVE_LOW>; + linux,default-trigger = "phy0radio"; + }; + + wlan5g_blue { + label = "blue:wlan5g"; + gpios = <&ssr 2 GPIO_ACTIVE_LOW>; + linux,default-trigger = "phy1tpt"; + }; + + wlan5g_green { + label = "green:wlan5g"; + gpios = <&ssr 1 GPIO_ACTIVE_LOW>; + linux,default-trigger = "phy1radio"; + }; + + act_green { + label = "green:act"; + gpios = <&ssr 0 GPIO_ACTIVE_LOW>; + }; + }; +}; + +&qpic_bam { + status = "okay"; +}; + +&tlmm { + mdio_pins: mdio_pinmux { + mux_1 { + pins = "gpio53"; + function = "mdio"; + bias-pull-up; + }; + + mux_2 { + pins = "gpio52"; + function = "mdc"; + bias-pull-up; + }; + }; + + serial_pins: serial_pinmux { + mux { + pins = "gpio60", "gpio61"; + function = "blsp_uart0"; + bias-disable; + }; + }; + + spi_0_pins: spi_0_pinmux { + pinmux { + function = "blsp_spi0"; + pins = "gpio55", "gpio56", "gpio57"; + drive-strength = <12>; + bias-disable; + }; + + pinmux_cs { + function = "gpio"; + pins = "gpio54", "gpio59"; + drive-strength = <2>; + bias-disable; + output-high; + }; + }; +}; + +&blsp_dma { + status = "okay"; +}; + +&blsp1_spi1 { + status = "okay"; + + pinctrl-0 = <&spi_0_pins>; + pinctrl-names = "default"; + cs-gpios = <&tlmm 54 GPIO_ACTIVE_HIGH>, + <&tlmm 59 GPIO_ACTIVE_HIGH>; + + flash@0 { + compatible = "jedec,spi-nor"; + spi-max-frequency = <50000000>; + reg = <0>; + + partitions { + compatible = "fixed-partitions"; + #address-cells = <1>; + #size-cells = <1>; + + partition@0 { + label = "0:SBL1"; + reg = <0x00000000 0x00040000>; + read-only; + }; + + partition@40000 { + label = "0:MIBIB"; + reg = <0x00040000 0x00020000>; + read-only; + }; + + partition@60000 { + label = "0:QSEE"; + reg = <0x00060000 0x00060000>; + read-only; + }; + + partition@c0000 { + label = "0:CDT"; + reg = <0x000c0000 0x00010000>; + read-only; + }; + + partition@d0000 { + label = "0:DDRPARAMS"; + reg = <0x000d0000 0x00010000>; + read-only; + }; + + partition@e0000 { + label = "0:APPSBLENV"; + reg = <0x000e0000 0x00010000>; + }; + + partition@f0000 { + label = "0:APPSBL"; + reg = <0x000f0000 0x000f0000>; + read-only; + }; + + partition@1e0000 { + label = "0:MANUDATA"; + reg = <0x001e0000 0x00010000>; + read-only; + }; + + partition@1f0000 { + label = "0:ART"; + reg = <0x001f0000 0x00010000>; + read-only; + }; + }; + }; + + nand@1 { + compatible = "spi-nand"; + reg = <1>; + spi-max-frequency = <48000000>; + + partitions { + compatible = "fixed-partitions"; + #address-cells = <1>; + #size-cells = <1>; + + partition@0 { + label = "rootfs"; + reg = <0x00000000 0x03800000>; + }; + + partition@3800000 { + label = "rootfs_1"; + reg = <0x03800000 0x03800000>; + }; + + partition@7000000 { + label = "var_config"; + reg = <0x07000000 0x00f00000>; + read-only; + }; + + partition@7f00000 { + label = "Oops_log"; + reg = <0x07f00000 0x000c0000>; + read-only; + }; + }; + }; +}; + +&blsp1_uart1 { + status = "okay"; + + pinctrl-0 = <&serial_pins>; + pinctrl-names = "default"; +}; + +&cryptobam { + status = "okay"; +}; + +&mdio { + status = "okay"; + + pinctrl-0 = <&mdio_pins>; + pinctrl-names = "default"; + reset-gpios = <&tlmm 62 GPIO_ACTIVE_LOW>; + reset-delay-us = <2000>; +}; + +&gmac0 { + qcom,forced_duplex = <1>; + qcom,forced_speed = <1000>; + qcom,phy_mdio_addr = <3>; + qcom,poll_required = <1>; + vlan_tag = <1 0x10>; +}; + +&wifi0 { + status = "okay"; + + qcom,ath10k-calibration-variant = "Netgear-WAC510"; +}; + +&wifi1 { + status = "okay"; + + qcom,ath10k-calibration-variant = "Netgear-WAC510"; +}; + +&usb3_ss_phy { + status = "okay"; +}; + +&usb3_hs_phy { + status = "okay"; +}; + +&usb2_hs_phy { + status = "okay"; +}; diff --git a/target/linux/ipq40xx/image/generic.mk b/target/linux/ipq40xx/image/generic.mk index 4e40b8be50..2d6186ed99 100644 --- a/target/linux/ipq40xx/image/generic.mk +++ b/target/linux/ipq40xx/image/generic.mk @@ -62,6 +62,16 @@ define Build/mkmylofw_32m @mv $@.new $@ endef +define Build/wac5xx-netgear-tar + mkdir $@.tmp + mv $@ $@.tmp/wac5xx-ubifs-root.img + md5sum $@.tmp/wac5xx-ubifs-root.img > $@.tmp/wac5xx-ubifs-root.md5sum + echo "WAC505 WAC510" > $@.tmp/metadata.txt + echo "WAC505_V9.9.9.9" > $@.tmp/version + tar -C $@.tmp/ -cf $@ . + rm -rf $@.tmp +endef + define Build/qsdk-ipq-factory-nand-askey $(TOPDIR)/scripts/mkits-qsdk-ipq-image.sh $@.its\ askey_kernel $(IMAGE_KERNEL) \ @@ -636,6 +646,21 @@ define Device/netgear_ex6150v2 endef TARGET_DEVICES += netgear_ex6150v2 +define Device/netgear_wac510 + $(call Device/FitImage) + $(call Device/UbiFit) + DEVICE_VENDOR := Netgear + DEVICE_MODEL := WAC510 + SOC := qcom-ipq4018 + DEVICE_DTS_CONFIG := config@5 + BLOCKSIZE := 128k + PAGESIZE := 2048 + IMAGES += nand-factory.tar + IMAGE/nand-factory.tar := append-ubi | wac5xx-netgear-tar + DEVICE_PACKAGES := uboot-envtools +endef +TARGET_DEVICES += netgear_wac510 + define Device/openmesh_a42 $(call Device/FitImageLzma) DEVICE_VENDOR := OpenMesh diff --git a/target/linux/ipq40xx/patches-5.4/901-arm-boot-add-dts-files.patch b/target/linux/ipq40xx/patches-5.4/901-arm-boot-add-dts-files.patch index 6b7c68bf63..0447fb6012 100644 --- a/target/linux/ipq40xx/patches-5.4/901-arm-boot-add-dts-files.patch +++ b/target/linux/ipq40xx/patches-5.4/901-arm-boot-add-dts-files.patch @@ -10,7 +10,7 @@ Signed-off-by: John Crispin --- a/arch/arm/boot/dts/Makefile +++ b/arch/arm/boot/dts/Makefile -@@ -837,11 +837,60 @@ dtb-$(CONFIG_ARCH_QCOM) += \ +@@ -837,11 +837,61 @@ dtb-$(CONFIG_ARCH_QCOM) += \ qcom-apq8074-dragonboard.dtb \ qcom-apq8084-ifc6540.dtb \ qcom-apq8084-mtp.dtb \ @@ -37,6 +37,7 @@ Signed-off-by: John Crispin + qcom-ipq4019-oap100.dtb \ + qcom-ipq4018-pa1200.dtb \ + qcom-ipq4018-rt-ac58u.dtb \ ++ qcom-ipq4018-wac510.dtb \ + qcom-ipq4018-wre6606.dtb \ + qcom-ipq4018-wrtq-329acn.dtb \ qcom-ipq4019-ap.dk01.1-c1.dtb \ From 251c995cbb1ea5ad1de14775312c2bd19ed10439 Mon Sep 17 00:00:00 2001 From: Aashish Kulkarni Date: Tue, 2 Mar 2021 10:40:14 +0530 Subject: [PATCH 10/35] ramips: add support for Linksys E5600 This submission relied heavily on the work of Linksys EA7300 v1/ v2. Specifications: * SoC: MediaTek MT7621A (880 MHz 2c/4t) * RAM: 128M DDR3-1600 * Flash: 128M NAND * Eth: MediaTek MT7621A (10/100/1000 Mbps x5) * Radio: MT7603E/MT7613BE (2.4 GHz & 5 GHz) * Antennae: 2 internal fixed in the casing and 2 on the PCB * LEDs: Blue (x4 Ethernet) Blue+Orange (x2 Power + WPS and Internet) * Buttons: Reset (x1) WPS (x1) Installation: Flash factory image through GUI. This device has 2 partitions for the firmware called firmware and alt_firmware. To successfully flash and boot the device, the device should have been running from alt_firmware partition. To get the device booted through alt_firmware partition, download the OEM firmware from Linksys website and upgrade the firmware from web GUI. Once this is done, flash the OpenWrt Factory firmware from web GUI. Reverting to factory firmware: 1. Boot to 'alt_firmware'(where stock firmware resides) by doing one of the following: Press the "wps" button as soon as power LED turns on when booting. (OR) Hard-reset the router consecutively three times to force it to boot from 'alt_firmware'. 2. To remove any traces of OpenWRT from your router simply flash the OEM image at this point. Signed-off-by: Aashish Kulkarni [fix hanging indents and wrap to 74 characters per line, add kmod-mt7663-firmware-sta package for 5GHz STA mode to work, remove sysupgrade.bin and concatenate IMAGES instead in mt7621.mk, set default-state "on" for power LED] Signed-off-by: Sannihith Kinnera [move check-size before append-metadata, remove trailing whitespace] Signed-off-by: Adrian Schmutzler --- .../linux/ramips/dts/mt7621_linksys_e5600.dts | 182 ++++++++++++++++++ target/linux/ramips/image/mt7621.mk | 23 +++ .../mt7621/base-files/etc/board.d/01_leds | 3 + .../mt7621/base-files/etc/board.d/02_network | 1 + .../etc/hotplug.d/ieee80211/10_fix_wifi_mac | 1 + .../mt7621/base-files/etc/init.d/bootcount | 1 + .../mt7621/base-files/lib/upgrade/platform.sh | 1 + 7 files changed, 212 insertions(+) create mode 100644 target/linux/ramips/dts/mt7621_linksys_e5600.dts diff --git a/target/linux/ramips/dts/mt7621_linksys_e5600.dts b/target/linux/ramips/dts/mt7621_linksys_e5600.dts new file mode 100644 index 0000000000..91db315914 --- /dev/null +++ b/target/linux/ramips/dts/mt7621_linksys_e5600.dts @@ -0,0 +1,182 @@ +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT + +#include "mt7621.dtsi" + +#include +#include + +/ { + compatible = "linksys,e5600", "mediatek,mt7621-soc"; + model = "Linksys E5600"; + + aliases { + led-boot = &led_power; + led-failsafe = &led_power; + led-running = &led_power; + led-upgrade = &led_power; + }; + + chosen { + bootargs = "console=ttyS0,115200"; + }; + + keys { + compatible = "gpio-keys"; + + reset { + label = "reset"; + gpios = <&gpio 12 GPIO_ACTIVE_LOW>; + linux,code = ; + }; + + wps { + label = "wps"; + gpios = <&gpio 17 GPIO_ACTIVE_LOW>; + linux,code = ; + }; + }; + + leds { + compatible = "gpio-leds"; + + wps { + label = "amber:wps"; + gpios = <&gpio 5 GPIO_ACTIVE_HIGH>; + }; + + led_power: power { + label = "blue:power"; + gpios = <&gpio 10 GPIO_ACTIVE_HIGH>; + default-state = "on"; + }; + + wan_amber { + label = "amber:wan"; + gpios = <&gpio 13 GPIO_ACTIVE_HIGH>; + }; + + wan_blue { + label = "blue:wan"; + gpios = <&gpio 15 GPIO_ACTIVE_HIGH>; + }; + }; +}; + +&nand { + status = "okay"; + + partitions { + compatible = "fixed-partitions"; + #address-cells = <1>; + #size-cells = <1>; + + partition@0 { + label = "boot"; + reg = <0x0 0x80000>; + read-only; + }; + + partition@80000 { + label = "u_env"; + reg = <0x80000 0x40000>; + read-only; + }; + + factory: partition@c0000 { + label = "factory"; + reg = <0xc0000 0x40000>; + read-only; + }; + + partition@100000 { + label = "s_env"; + reg = <0x100000 0x40000>; + }; + + partition@140000 { + label = "devinfo"; + reg = <0x140000 0x40000>; + read-only; + }; + + partition@180000 { + label = "kernel"; + reg = <0x180000 0x400000>; + }; + + partition@580000 { + label = "ubi"; + reg = <0x580000 0x1a00000>; + }; + + partition@1f80000 { + label = "alt_firmware"; + reg = <0x1f80000 0x1e00000>; + }; + + partition@3d80000 { + label = "gdata"; + reg = <0x3d80000 0x4200000>; + }; + }; +}; + +&state_default { + gpio { + groups = "uart2", "uart3", "jtag"; + function = "gpio"; + }; +}; + +&pcie { + status = "okay"; +}; + +&pcie0 { + mt76@0,0 { + compatible = "mediatek,mt76"; + reg = <0x0000 0 0 0 0>; + mediatek,mtd-eeprom = <&factory 0x0000>; + }; +}; + +&pcie1 { + mt76@0,0 { + compatible = "mediatek,mt76"; + reg = <0x0000 0 0 0 0>; + mediatek,mtd-eeprom = <&factory 0x8000>; + }; +}; + +&switch0 { + ports { + port@0 { + status = "okay"; + label = "lan1"; + }; + + port@1 { + status = "okay"; + label = "lan2"; + }; + + port@2 { + status = "okay"; + label = "lan3"; + }; + + port@3 { + status = "okay"; + label = "lan4"; + }; + + port@4 { + status = "okay"; + label = "wan"; + }; + }; +}; + +&xhci { + status = "disabled"; +}; diff --git a/target/linux/ramips/image/mt7621.mk b/target/linux/ramips/image/mt7621.mk index 20433f783d..04f84ac1fe 100644 --- a/target/linux/ramips/image/mt7621.mk +++ b/target/linux/ramips/image/mt7621.mk @@ -22,6 +22,10 @@ define Build/elecom-wrc-gs-factory mv $@.new $@ endef +define Build/gemtek-trailer + printf "%s%08X" ".GEMTEK." "$$(cksum $@ | cut -d ' ' -f1)" >> $@ +endef + define Build/iodata-factory $(eval fw_size=$(word 1,$(1))) $(eval fw_type=$(word 2,$(1))) @@ -762,6 +766,25 @@ define Device/lenovo_newifi-d1 endef TARGET_DEVICES += lenovo_newifi-d1 +define Device/linksys_e5600 + $(Device/dsa-migration) + $(Device/uimage-lzma-loader) + BLOCKSIZE := 128k + PAGESIZE := 2048 + KERNEL_SIZE := 4096k + IMAGE_SIZE := 26624k + DEVICE_VENDOR := Linksys + DEVICE_MODEL := E5600 + DEVICE_PACKAGES := kmod-mt7603 kmod-mt7615e kmod-mt7663-firmware-ap \ + kmod-mt7663-firmware-sta uboot-envtools + UBINIZE_OPTS := -E 5 + IMAGES += factory.bin + IMAGE/sysupgrade.bin := sysupgrade-tar | check-size | append-metadata + IMAGE/factory.bin := append-kernel | pad-to $$$$(KERNEL_SIZE) | \ + append-ubi | check-size | gemtek-trailer +endef +TARGET_DEVICES += linksys_e5600 + define Device/linksys_ea7xxx $(Device/dsa-migration) $(Device/uimage-lzma-loader) diff --git a/target/linux/ramips/mt7621/base-files/etc/board.d/01_leds b/target/linux/ramips/mt7621/base-files/etc/board.d/01_leds index 427983e44b..9e67d458de 100644 --- a/target/linux/ramips/mt7621/base-files/etc/board.d/01_leds +++ b/target/linux/ramips/mt7621/base-files/etc/board.d/01_leds @@ -46,6 +46,9 @@ gnubee,gb-pc2) ucidef_set_led_netdev "lan1" "lan1" "green:lan1" "lan1" ucidef_set_led_netdev "lan2" "lan2" "green:lan2" "lan2" ;; +linksys,e5600) + ucidef_set_led_netdev "wan" "wan link" "blue:wan" "wan" "link" + ;; linksys,ea7300-v1|\ linksys,ea7300-v2|\ linksys,ea7500-v2) diff --git a/target/linux/ramips/mt7621/base-files/etc/board.d/02_network b/target/linux/ramips/mt7621/base-files/etc/board.d/02_network index 9c946fa7f7..df69e1c432 100644 --- a/target/linux/ramips/mt7621/base-files/etc/board.d/02_network +++ b/target/linux/ramips/mt7621/base-files/etc/board.d/02_network @@ -127,6 +127,7 @@ ramips_setup_macs() zbtlink,zbt-wg3526-32m) label_mac=$(mtd_get_mac_binary factory 0x4) ;; + linksys,e5600|\ linksys,ea7300-v1|\ linksys,ea7300-v2|\ linksys,ea7500-v2) diff --git a/target/linux/ramips/mt7621/base-files/etc/hotplug.d/ieee80211/10_fix_wifi_mac b/target/linux/ramips/mt7621/base-files/etc/hotplug.d/ieee80211/10_fix_wifi_mac index 427bde4e38..49b7f23ce9 100644 --- a/target/linux/ramips/mt7621/base-files/etc/hotplug.d/ieee80211/10_fix_wifi_mac +++ b/target/linux/ramips/mt7621/base-files/etc/hotplug.d/ieee80211/10_fix_wifi_mac @@ -18,6 +18,7 @@ case "$board" in [ "$PHYNBR" = "1" ] && \ macaddr_setbit_la "$(mtd_get_mac_binary Factory 0x4)" > /sys${DEVPATH}/macaddress ;; + linksys,e5600|\ linksys,ea7300-v1|\ linksys,ea7300-v2|\ linksys,ea7500-v2) diff --git a/target/linux/ramips/mt7621/base-files/etc/init.d/bootcount b/target/linux/ramips/mt7621/base-files/etc/init.d/bootcount index a155458d3f..cfaa62485c 100755 --- a/target/linux/ramips/mt7621/base-files/etc/init.d/bootcount +++ b/target/linux/ramips/mt7621/base-files/etc/init.d/bootcount @@ -8,6 +8,7 @@ boot() { [ -n "$(fw_printenv bootcount bootchanged 2>/dev/null)" ] &&\ echo -e "bootcount\nbootchanged\n" | /usr/sbin/fw_setenv -s - ;; + linksys,e5600|\ linksys,ea7300-v1|\ linksys,ea7300-v2|\ linksys,ea7500-v2) diff --git a/target/linux/ramips/mt7621/base-files/lib/upgrade/platform.sh b/target/linux/ramips/mt7621/base-files/lib/upgrade/platform.sh index 98e429fdbf..7b57ee7776 100755 --- a/target/linux/ramips/mt7621/base-files/lib/upgrade/platform.sh +++ b/target/linux/ramips/mt7621/base-files/lib/upgrade/platform.sh @@ -50,6 +50,7 @@ platform_do_upgrade() { dlink,dir-2660-a1|\ hiwifi,hc5962|\ jcg,q20|\ + linksys,e5600|\ linksys,ea7300-v1|\ linksys,ea7300-v2|\ linksys,ea7500-v2|\ From 6d23e474ad9d0eba935696c66db4fb6e2037bb72 Mon Sep 17 00:00:00 2001 From: Jonathan Sturges Date: Sat, 5 Jun 2021 08:17:42 -0400 Subject: [PATCH 11/35] ramips: add support for Amped Wireless ALLY router and extender Amped Wireless ALLY is a whole-home WiFi kit, with a router (model ALLY-R1900K) and an Extender (model ALLY-00X19K). Both are devices are 11ac and based on MediaTek MT7621AT and MT7615N chips. The units are nearly identical, except the Extender lacks a USB port and has a single Ethernet port. Specification: - SoC: MediaTek MT7621AT (2C/4T) @ 880MHz - RAM: 128MB DDR3 (Nanya NT5CC64M16GP-DI) - FLASH: 128MB NAND (Winbond W29N01GVSIAA) - WiFi: 2.4/5 GHz 4T4R - 2.4GHz MediaTek MT7615N bgn - 5GHz MediaTek MT7615N nac - Switch: SoC integrated Gigabit Switch - USB: 1x USB3 (Router only) - BTN: Reset, WPS - LED: single RGB - UART: through-hole on PCB. J1: pin1 (square pad, towards rear)=3.3V, pin2=RX, pin3=GND, pin4=TX. Settings: 57600/8N1. Note regarding dual system partitions ------------------------------------- The vendor firmware and boot loader use a dual partition scheme. The boot partition is decided by the bootImage U-boot environment variable: 0 for the 1st partition, 1 for the 2nd. OpenWrt does not support this scheme and will always use the first OS partition. It will set bootImage to 0 during installation, making sure the first partition is selected by the boot loader. Also, because we can't be sure which partition is active to begin with, a 2-step flash process is used. We first flash an initramfs image, then follow with a regular sysupgrade. Installation: Router (ALLY-R1900K) 1) Install the flashable initramfs image via the OEM web-interface. (Alternatively, you can use the TFTP recovery method below.) You can use WiFi or Ethernet. The direct URL is: http://192.168.3.1/07_06_00_firmware.html a. No login is needed, and you'll be in their setup wizard. b. You might get a warning about not being connected to the Internet. c. Towards the bottom of the page will be a section entitled "Or Manually Upgrade Firmware from a File:" where you can manually choose and upload a firmware file. d: Click "Choose File", select the OpenWRT "initramfs" image and click "Upload." 2) The Router will flash the OpenWrt initramfs image and reboot. After booting, LuCI will be available on 192.168.1.1. 3) Log into LuCI as root; there is no password. 4) Optional (but recommended) is to backup the OEM firmware before continuing; see process below. 5) Complete the Installation by flashing a full OpenWRT image. Note: you may use the sysupgrade command line tool in lieu of the UI if you prefer. a. Choose System -> Backup/Flash Firmware. b. Click "Flash Image..." under "Flash new firmware image" c. Click "Browse..." and then select the sysupgrade file. d. Click Upload to upload the sysupgrade file. e. Important: uncheck "Keep settings and retain the current configuration" for this initial installation. f. Click "Continue" to flash the firmware. g. The device will reboot and OpenWRT is installed. Extender (ALLY-00X19K) 1) This device requires a TFTP recovery procedure to do an initial load of OpenWRT. Start by configuring a computer as a TFTP client: a. Install a TFTP client (server not necessary) b. Configure an Ethernet interface to 192.168.1.x/24; don't use .1 or .6 c. Connect the Ethernet to the sole Ethernet port on the X19K. 2) Put the ALLY Extender in TFTP recovery mode. a. Do this by pressing and holding the reset button on the bottom while connecting the power. b. As soon as the LED lights up green (roughly 2-3 seconds), release the button. 3) Start the TFTP transfer of the Initramfs image from your setup machine. For example, from Linux: tftp -v -m binary 192.168.1.6 69 -c put initramfs.bin 4) The Extender will flash the OpenWrt initramfs image and reboot. After booting, LuCI will be available on 192.168.1.1. 5) Log into LuCI as root; there is no password. 6) Optional (but recommended) is to backup the OEM firmware before continuing; see process below. 7) Complete the Installation by flashing a full OpenWRT image. Note: you may use the sysupgrade command line tool in lieu of the UI if you prefer. a. Choose System -> Backup/Flash Firmware. b. Click "Flash Image..." under "Flash new firmware image" c. Click "Browse..." and then select the sysupgrade file. d. Click Upload to upload the sysupgrade file. e. Important: uncheck "Keep settings and retain the current configuration" for this initial installation. f. Click "Continue" to flash the firmware. g. The device will reboot and OpenWRT is installed. Backup the OEM Firmware: ----------------------- There isn't any downloadable firmware for the ALLY devices on the Amped Wireless web site. Reverting back to the OEM firmware is not possible unless we have a backup of the original OEM firmware. The OEM firmware may be stored on either /dev/mtd3 ("firmware") or /dev/mtd6 ("oem"). We can't be sure which was overwritten with the initramfs image, so backup both partitions to be safe. 1) Once logged into LuCI, navigate to System -> Backup/Flash Firmware. 2) Under "Save mtdblock contents," first select "firmware" and click "Save mtdblock" to download the image. 3) Repeat the process, but select "oem" from the pull-down menu. Revert to the OEM Firmware: -------------------------- * U-boot TFTP: Follow the TFTP recovery steps for the Extender, and use the backup image. * OpenWrt "Flash Firmware" interface: Upload the backup image and select "Force update" before continuing. Signed-off-by: Jonathan Sturges --- package/boot/uboot-envtools/files/ramips | 4 + .../dts/mt7621_ampedwireless_ally-00x19k.dts | 21 ++ .../dts/mt7621_ampedwireless_ally-r1900k.dts | 32 ++++ .../ramips/dts/mt7621_ampedwireless_ally.dtsi | 179 ++++++++++++++++++ target/linux/ramips/image/mt7621.mk | 27 +++ .../mt7621/base-files/etc/board.d/02_network | 47 +++-- .../mt7621/base-files/lib/upgrade/platform.sh | 8 + 7 files changed, 300 insertions(+), 18 deletions(-) create mode 100644 target/linux/ramips/dts/mt7621_ampedwireless_ally-00x19k.dts create mode 100644 target/linux/ramips/dts/mt7621_ampedwireless_ally-r1900k.dts create mode 100644 target/linux/ramips/dts/mt7621_ampedwireless_ally.dtsi diff --git a/package/boot/uboot-envtools/files/ramips b/package/boot/uboot-envtools/files/ramips index ee2d95115c..a59f647685 100644 --- a/package/boot/uboot-envtools/files/ramips +++ b/package/boot/uboot-envtools/files/ramips @@ -25,6 +25,10 @@ allnet,all0256n-8m|\ allnet,all5002) ubootenv_add_uci_config "/dev/mtd1" "0x0" "0x10000" "0x10000" ;; +ampedwireless,ally-00x19k|\ +ampedwireless,ally-r1900k) + ubootenv_add_uci_config "/dev/mtd1" "0x0" "0x1000" "0x20000" "4" + ;; buffalo,wsr-1166dhp|\ buffalo,wsr-600dhp|\ mediatek,linkit-smart-7688|\ diff --git a/target/linux/ramips/dts/mt7621_ampedwireless_ally-00x19k.dts b/target/linux/ramips/dts/mt7621_ampedwireless_ally-00x19k.dts new file mode 100644 index 0000000000..51d41c7fb4 --- /dev/null +++ b/target/linux/ramips/dts/mt7621_ampedwireless_ally-00x19k.dts @@ -0,0 +1,21 @@ +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT + +#include "mt7621_ampedwireless_ally.dtsi" + +/ { + compatible = "ampedwireless,ally-00x19k", "mediatek,mt7621-soc"; + model = "Amped Wireless ALLY-00X19K"; +}; + +&switch0 { + ports { + port@2 { + status = "okay"; + label = "lan"; + }; + }; +}; + +&xhci { + status = "disabled"; +}; diff --git a/target/linux/ramips/dts/mt7621_ampedwireless_ally-r1900k.dts b/target/linux/ramips/dts/mt7621_ampedwireless_ally-r1900k.dts new file mode 100644 index 0000000000..cd2536e179 --- /dev/null +++ b/target/linux/ramips/dts/mt7621_ampedwireless_ally-r1900k.dts @@ -0,0 +1,32 @@ +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT + +#include "mt7621_ampedwireless_ally.dtsi" + +/ { + compatible = "ampedwireless,ally-r1900k", "mediatek,mt7621-soc"; + model = "Amped Wireless ALLY-R1900K"; +}; + +&switch0 { + ports { + port@1 { + status = "okay"; + label = "wan"; + }; + + port@2 { + status = "okay"; + label = "lan1"; + }; + + port@3 { + status = "okay"; + label = "lan2"; + }; + + port@4 { + status = "okay"; + label = "lan3"; + }; + }; +}; diff --git a/target/linux/ramips/dts/mt7621_ampedwireless_ally.dtsi b/target/linux/ramips/dts/mt7621_ampedwireless_ally.dtsi new file mode 100644 index 0000000000..7736b06e43 --- /dev/null +++ b/target/linux/ramips/dts/mt7621_ampedwireless_ally.dtsi @@ -0,0 +1,179 @@ +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT + +#include "mt7621.dtsi" + +#include +#include + +/ { + aliases { + led-boot = &led_status_amber; + led-failsafe = &led_status_amber; + led-running = &led_status_green; + led-upgrade = &led_status_red; + }; + + keys { + compatible = "gpio-keys"; + + led_switch { + label = "led_switch"; + gpios = <&gpio 13 GPIO_ACTIVE_HIGH>; + linux,code = ; + linux,input-type = ; + }; + + reset { + label = "reset"; + gpios = <&gpio 16 GPIO_ACTIVE_LOW>; + linux,code = ; + }; + + wps { + label = "wps"; + gpios = <&gpio 18 GPIO_ACTIVE_HIGH>; + linux,code = ; + }; + }; + + leds { + compatible = "gpio-leds"; + + led_status_green: status_green { + label = "green:status"; + gpios = <&gpio 7 GPIO_ACTIVE_HIGH>; + }; + + led_status_red: status_red { + label = "red:status"; + gpios = <&gpio 12 GPIO_ACTIVE_HIGH>; + }; + + led_status_amber: status_amber { + label = "amber:status"; + gpios = <&gpio 14 GPIO_ACTIVE_HIGH>; + }; + }; +}; + +&pcie { + status = "okay"; +}; + +&pcie0 { + wifi@0,0 { + compatible = "pci14c3,7615"; + reg = <0x0000 0 0 0 0>; + mediatek,mtd-eeprom = <&factory 0x0000>; + ieee80211-freq-limit = <2400000 2500000>; + }; +}; + +&pcie1 { + wifi@0,0 { + compatible = "pci14c3,7615"; + reg = <0x0000 0 0 0 0>; + mediatek,mtd-eeprom = <&factory 0x8000>; + ieee80211-freq-limit = <5000000 6000000>; + }; +}; + +&state_default { + gpio { + groups = "uart2", "uart3", "jtag", "wdt"; + function = "gpio"; + }; +}; + +&nand { + status = "okay"; + + partitions { + compatible = "fixed-partitions"; + #address-cells = <1>; + #size-cells = <1>; + + partition@0 { + label = "u-boot"; + reg = <0x0 0x80000>; + read-only; + }; + + partition@80000 { + label = "u-boot-env"; + reg = <0x80000 0x80000>; + }; + + factory: partition@100000 { + label = "factory"; + reg = <0x100000 0x40000>; + read-only; + }; + + /* + * uboot expects to find kernels at 0x140000 & 0x2140000, + * referred to as Uimage & Uimage1 in factory FW, respectively. + * U-boot variable 'bootImage' controls which is booted; + * 0 for the first, 1 for the 2nd. + * There's a 3rd partition, Uimage2 (0x4140000), which + * I expected to be a recovery image, but is actually blank. + * + * A kernel is considered suitable for handing control over + * if its linux magic number exists & uImage CRC are correct. + * If either of those conditions fail, 'bootImage' value + * is toggled in uboot env & a restart performed in the hope that the + * alternate kernel is okay. + * + * Note uboot's tftp flash install writes the transferred + * image to the active kernel partition. + */ + + partition@140000 { + label = "kernel"; + reg = <0x140000 0x400000>; + }; + + partition@540000 { + label = "ubi"; + reg = <0x540000 0x1c00000>; + }; + + partition@2140000 { + label = "oem"; + reg = <0x2140000 0x2000000>; + }; + + partition@4140000 { + label = "backup"; + reg = <0x4140000 0x2000000>; + }; + + partition@6140000 { + label = "chime"; + reg = <0x6140000 0xa00000>; + }; + + partition@6b40000 { + label = "data"; + reg = <0x6b40000 0xa00000>; + }; + + partition@7540000 { + label = "reserved"; + reg = <0x7540000 0x840000>; + read-only; + }; + + partition@7d80000 { + label = "nvram"; + reg = <0x7d80000 0x100000>; + read-only; + }; + + partition@7e80000 { + label = "hwconfig"; + reg = <0x7e80000 0x100000>; + read-only; + }; + }; +}; diff --git a/target/linux/ramips/image/mt7621.mk b/target/linux/ramips/image/mt7621.mk index 04f84ac1fe..4b8ec4ceb1 100644 --- a/target/linux/ramips/image/mt7621.mk +++ b/target/linux/ramips/image/mt7621.mk @@ -126,6 +126,33 @@ define Device/alfa-network_quad-e4g endef TARGET_DEVICES += alfa-network_quad-e4g +define Device/ampedwireless_ally_common + $(Device/dsa-migration) + DEVICE_VENDOR := Amped Wireless + DEVICE_PACKAGES := kmod-mt7615e kmod-mt7615-firmware uboot-envtools + IMAGE_SIZE := 32768k + KERNEL_SIZE := 4096k + BLOCKSIZE := 128k + PAGESIZE := 2048 + UBINIZE_OPTS := -E 5 + KERNEL_INITRAMFS := $(KERNEL_DTB) | uImage lzma -n 'flashable-initramfs' |\ + edimax-header -s CSYS -m RN68 -f 0x001c0000 -S 0x01100000 + IMAGE/sysupgrade.bin := sysupgrade-tar | append-metadata +endef + +define Device/ampedwireless_ally-r1900k + $(Device/ampedwireless_ally_common) + DEVICE_MODEL := ALLY-R1900K + DEVICE_PACKAGES += kmod-usb3 +endef +TARGET_DEVICES += ampedwireless_ally-r1900k + +define Device/ampedwireless_ally-00x19k + $(Device/ampedwireless_ally_common) + DEVICE_MODEL := ALLY-00X19K +endef +TARGET_DEVICES += ampedwireless_ally-00x19k + define Device/asiarf_ap7621-001 $(Device/dsa-migration) IMAGE_SIZE := 16000k diff --git a/target/linux/ramips/mt7621/base-files/etc/board.d/02_network b/target/linux/ramips/mt7621/base-files/etc/board.d/02_network index df69e1c432..b31c99e6f1 100644 --- a/target/linux/ramips/mt7621/base-files/etc/board.d/02_network +++ b/target/linux/ramips/mt7621/base-files/etc/board.d/02_network @@ -8,6 +8,26 @@ ramips_setup_interfaces() local board="$1" case $board in + ampedwireless,ally-00x19k|\ + edimax,re23s|\ + mikrotik,routerboard-m11g|\ + netgear,ex6150|\ + thunder,timecloud|\ + tplink,re350-v1|\ + tplink,re500-v1|\ + tplink,re650-v1|\ + ubnt,unifi-6-lite|\ + ubnt,unifi-nanohd) + ucidef_set_interface_lan "lan" + ;; + ampedwireless,ally-r1900k|\ + gehua,ghl-r-001|\ + hiwifi,hc5962|\ + xiaomi,mi-router-3-pro|\ + xiaomi,mi-router-ac2100|\ + xiaomi,redmi-router-ac2100) + ucidef_set_interfaces_lan_wan "lan1 lan2 lan3" "wan" + ;; asiarf,ap7621-001|\ winstars,ws-wn583a6) ucidef_set_interfaces_lan_wan "lan" "wan" @@ -23,24 +43,6 @@ ramips_setup_interfaces() xiaomi,mi-router-4a-gigabit) ucidef_set_interfaces_lan_wan "lan1 lan2" "wan" ;; - edimax,re23s|\ - mikrotik,routerboard-m11g|\ - netgear,ex6150|\ - thunder,timecloud|\ - tplink,re350-v1|\ - tplink,re500-v1|\ - tplink,re650-v1|\ - ubnt,unifi-6-lite|\ - ubnt,unifi-nanohd) - ucidef_set_interface_lan "lan" - ;; - gehua,ghl-r-001|\ - hiwifi,hc5962|\ - xiaomi,mi-router-3-pro|\ - xiaomi,mi-router-ac2100|\ - xiaomi,redmi-router-ac2100) - ucidef_set_interfaces_lan_wan "lan1 lan2 lan3" "wan" - ;; gnubee,gb-pc1|\ gnubee,gb-pc2) ucidef_set_interface_lan "lan1 lan2" @@ -85,6 +87,15 @@ ramips_setup_macs() local label_mac="" case $board in + ampedwireless,ally-00x19k) + lan_mac=$(mtd_get_mac_ascii hwconfig HW.LAN.MAC.Address) + label_mac=$lan_mac + ;; + ampedwireless,ally-r1900k) + lan_mac=$(mtd_get_mac_ascii hwconfig HW.LAN.MAC.Address) + wan_mac=$(mtd_get_mac_ascii hwconfig HW.WAN.MAC.Address) + label_mac=$lan_mac + ;; asus,rt-ac65p|\ asus,rt-ac85p) wan_mac=$(mtd_get_mac_ascii u-boot-env et1macaddr) diff --git a/target/linux/ramips/mt7621/base-files/lib/upgrade/platform.sh b/target/linux/ramips/mt7621/base-files/lib/upgrade/platform.sh index 7b57ee7776..689a0e51ae 100755 --- a/target/linux/ramips/mt7621/base-files/lib/upgrade/platform.sh +++ b/target/linux/ramips/mt7621/base-files/lib/upgrade/platform.sh @@ -27,6 +27,12 @@ platform_do_upgrade() { fi } ;; + ampedwireless,ally-00x19k|\ + ampedwireless,ally-r1900k) + if [ "$(fw_printenv --lock / -n bootImage 2>/dev/null)" != "0" ]; then + fw_setenv --lock / bootImage 0 || exit 1 + fi + ;; mikrotik,routerboard-750gr3|\ mikrotik,routerboard-760igs|\ mikrotik,routerboard-m11g|\ @@ -43,6 +49,8 @@ platform_do_upgrade() { esac case "$board" in + ampedwireless,ally-00x19k|\ + ampedwireless,ally-r1900k|\ asus,rt-ac65p|\ asus,rt-ac85p|\ dlink,dir-1960-a1|\ From b232680f847f4ea8d058849a51dedebb8e398a01 Mon Sep 17 00:00:00 2001 From: Tee Hao Wei Date: Tue, 18 May 2021 03:46:36 +0800 Subject: [PATCH 12/35] ramips: add support for Linksys EA8100 v1 Specifications: - SoC: MT7621AT - RAM: 256MB - Flash: 128MB NAND - Ethernet: 5 Gigabit ports - WiFi: 2.4G/5G MT7615N - USB: 1 USB 3.0, 1 USB 2.0 This device is very similar to the EA7300 v1/v2 and EA7500 v2. Installation: Upload the generated factory image through the factory web interface. (following part taken from EA7300 v2 commit message:) This might fail due to the A/B nature of this device. When flashing, OEM firmware writes over the non-booted partition. If booted from 'A', flashing over 'B' won't work. To get around this, you should flash the OEM image over itself. This will then boot the router from 'B' and allow you to flash OpenWRT without problems. Reverting to factory firmware: Hard-reset the router three times to force it to boot from 'B.' This is where the stock firmware resides. To remove any traces of OpenWRT from your router simply flash the OEM image at this point. With thanks to Leon Poon (@LeonPoon) for the initial bringup. Signed-off-by: Tee Hao Wei [add missing entry in 10_fix_wifi_mac] Signed-off-by: Adrian Schmutzler --- package/boot/uboot-envtools/files/ramips | 1 + target/linux/ramips/dts/mt7621_linksys_ea8100-v1.dts | 8 ++++++++ target/linux/ramips/image/mt7621.mk | 8 ++++++++ target/linux/ramips/mt7621/base-files/etc/board.d/01_leds | 3 ++- .../linux/ramips/mt7621/base-files/etc/board.d/02_network | 3 ++- .../base-files/etc/hotplug.d/ieee80211/10_fix_wifi_mac | 3 ++- .../linux/ramips/mt7621/base-files/etc/init.d/bootcount | 3 ++- .../ramips/mt7621/base-files/lib/upgrade/platform.sh | 1 + 8 files changed, 26 insertions(+), 4 deletions(-) create mode 100644 target/linux/ramips/dts/mt7621_linksys_ea8100-v1.dts diff --git a/package/boot/uboot-envtools/files/ramips b/package/boot/uboot-envtools/files/ramips index a59f647685..2bb04997f9 100644 --- a/package/boot/uboot-envtools/files/ramips +++ b/package/boot/uboot-envtools/files/ramips @@ -53,6 +53,7 @@ jcg,q20) linksys,ea7300-v1|\ linksys,ea7300-v2|\ linksys,ea7500-v2|\ +linksys,ea8100-v1|\ xiaomi,mi-router-3g|\ xiaomi,mi-router-3-pro|\ xiaomi,mi-router-4|\ diff --git a/target/linux/ramips/dts/mt7621_linksys_ea8100-v1.dts b/target/linux/ramips/dts/mt7621_linksys_ea8100-v1.dts new file mode 100644 index 0000000000..6cc2219aec --- /dev/null +++ b/target/linux/ramips/dts/mt7621_linksys_ea8100-v1.dts @@ -0,0 +1,8 @@ +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT + +#include "mt7621_linksys_ea7xxx.dtsi" + +/ { + compatible = "linksys,ea8100-v1", "mediatek,mt7621-soc"; + model = "Linksys EA8100"; +}; diff --git a/target/linux/ramips/image/mt7621.mk b/target/linux/ramips/image/mt7621.mk index 4b8ec4ceb1..96a66b2398 100644 --- a/target/linux/ramips/image/mt7621.mk +++ b/target/linux/ramips/image/mt7621.mk @@ -854,6 +854,14 @@ define Device/linksys_ea7500-v2 endef TARGET_DEVICES += linksys_ea7500-v2 +define Device/linksys_ea8100-v1 + $(Device/linksys_ea7xxx) + DEVICE_MODEL := EA8100 + DEVICE_VARIANT := v1 + LINKSYS_HWNAME := EA8100 +endef +TARGET_DEVICES += linksys_ea8100-v1 + define Device/linksys_re6500 $(Device/dsa-migration) IMAGE_SIZE := 7872k diff --git a/target/linux/ramips/mt7621/base-files/etc/board.d/01_leds b/target/linux/ramips/mt7621/base-files/etc/board.d/01_leds index 9e67d458de..5322bc9db0 100644 --- a/target/linux/ramips/mt7621/base-files/etc/board.d/01_leds +++ b/target/linux/ramips/mt7621/base-files/etc/board.d/01_leds @@ -51,7 +51,8 @@ linksys,e5600) ;; linksys,ea7300-v1|\ linksys,ea7300-v2|\ -linksys,ea7500-v2) +linksys,ea7500-v2|\ +linksys,ea8100-v1) ucidef_set_led_netdev "lan1" "lan1 link" "green:lan1" "lan1" "link" ucidef_set_led_netdev "lan2" "lan2 link" "green:lan2" "lan2" "link" ucidef_set_led_netdev "lan3" "lan3 link" "green:lan3" "lan3" "link" diff --git a/target/linux/ramips/mt7621/base-files/etc/board.d/02_network b/target/linux/ramips/mt7621/base-files/etc/board.d/02_network index b31c99e6f1..d84d3e317f 100644 --- a/target/linux/ramips/mt7621/base-files/etc/board.d/02_network +++ b/target/linux/ramips/mt7621/base-files/etc/board.d/02_network @@ -141,7 +141,8 @@ ramips_setup_macs() linksys,e5600|\ linksys,ea7300-v1|\ linksys,ea7300-v2|\ - linksys,ea7500-v2) + linksys,ea7500-v2|\ + linksys,ea8100-v1) lan_mac=$(mtd_get_mac_ascii devinfo hw_mac_addr) wan_mac=$lan_mac label_mac=$lan_mac diff --git a/target/linux/ramips/mt7621/base-files/etc/hotplug.d/ieee80211/10_fix_wifi_mac b/target/linux/ramips/mt7621/base-files/etc/hotplug.d/ieee80211/10_fix_wifi_mac index 49b7f23ce9..bd0f0254c6 100644 --- a/target/linux/ramips/mt7621/base-files/etc/hotplug.d/ieee80211/10_fix_wifi_mac +++ b/target/linux/ramips/mt7621/base-files/etc/hotplug.d/ieee80211/10_fix_wifi_mac @@ -21,7 +21,8 @@ case "$board" in linksys,e5600|\ linksys,ea7300-v1|\ linksys,ea7300-v2|\ - linksys,ea7500-v2) + linksys,ea7500-v2|\ + linksys,ea8100-v1) hw_mac_addr=$(mtd_get_mac_ascii devinfo hw_mac_addr) [ "$PHYNBR" = "0" ] && macaddr_add $hw_mac_addr 1 > /sys${DEVPATH}/macaddress [ "$PHYNBR" = "1" ] && macaddr_add $hw_mac_addr 2 > /sys${DEVPATH}/macaddress diff --git a/target/linux/ramips/mt7621/base-files/etc/init.d/bootcount b/target/linux/ramips/mt7621/base-files/etc/init.d/bootcount index cfaa62485c..d3525ea0c9 100755 --- a/target/linux/ramips/mt7621/base-files/etc/init.d/bootcount +++ b/target/linux/ramips/mt7621/base-files/etc/init.d/bootcount @@ -11,7 +11,8 @@ boot() { linksys,e5600|\ linksys,ea7300-v1|\ linksys,ea7300-v2|\ - linksys,ea7500-v2) + linksys,ea7500-v2|\ + linksys,ea8100-v1) mtd resetbc s_env || true ;; samknows,whitebox-v8) diff --git a/target/linux/ramips/mt7621/base-files/lib/upgrade/platform.sh b/target/linux/ramips/mt7621/base-files/lib/upgrade/platform.sh index 689a0e51ae..4943ad1305 100755 --- a/target/linux/ramips/mt7621/base-files/lib/upgrade/platform.sh +++ b/target/linux/ramips/mt7621/base-files/lib/upgrade/platform.sh @@ -62,6 +62,7 @@ platform_do_upgrade() { linksys,ea7300-v1|\ linksys,ea7300-v2|\ linksys,ea7500-v2|\ + linksys,ea8100-v1|\ netgear,r6220|\ netgear,r6260|\ netgear,r6350|\ From da8428d277cd3373b05330cb3b4f93aef717c5ab Mon Sep 17 00:00:00 2001 From: Lauro Moreno Date: Wed, 28 Oct 2020 14:59:47 -0600 Subject: [PATCH 13/35] ipq806x: add support for Askey RT4230W REV6 This adds support for the Askey RT4230W REV6 (Branded by Spectrum/Charter as RAC2V1K) At this time, there's no way to reinstall the stock firmware so don't install this on a router that's being rented. Specifications: Qualcomm IPQ8065 1 GB of RAM (DDR3) 512 MB Flash (NAND) 2x Wave 2 WiFi cards (QCA9984) 5x 10/100/1000 Mbps Ethernet (Switch: QCA8337) 1x LED (Controlled by a microcontroller that switches it between red and blue with different patterns) 1x USB 3.0 Type-A 12V DC Power Input UART header on PCB - pinout from top to bottom is RX, TX, GND, 5V Port settings are 115200n8 More information: https://forum.openwrt.org/t/askey-rac2v1k-support/15830 https://deviwiki.com/wiki/Askey_RAC2V1K To check what revision your router is, restore one of these config backups through the stock firmware to get ssh access then run "cat /proc/device-tree/model". https://forum.openwrt.org/t/askey-rac2v1k-support/15830/17 The revision number on the board doesn't seem to be very consistent so that's why this is needed. You can also run printenv in the uboot console and if machid is set to 177d, that means your router is rev6. Note: Don't install this if the router is being rented from an ISP. The defined partition layout is different from the OEM one and even if you changed the layout to match, backing up and restoring the OEM firmware breaks /overlay so nothing will save and the router will likely enter a bootloop. How to install: Method 1: Install without opening the case using SSH and tftp You'll need: RAC2V1K-SSH.zip: https://github.com/lmore377/openwrt-rt4230w/blob/master/RAC2V1K-SSH.zip initramfs and sysupgrade images Connect to one of the router's LAN ports Download the RAC2V1K-SSH.zip file and restore the config file that corresponds to your router's firmware (If you're firmware is newer than what's in the zip file, just restore the 1.1.16 file) After a reboot, you should be able to ssh into the router with username: "4230w" and password: "linuxbox" or "admin". Run the following commannds fw_setenv ipaddr 10.42.0.10 #IP of router, can be anything as long as it's in the same subnet as the server fw_setenv serverip 10.42.0.1# #IP of tftp server that's set up in next steps fw_setenv bootdelay 8 fw_setenv bootcmd "tftpboot initramfs.bin; bootm; bootipq" Don't reboot the router yet. Install and set up a tftp server on your computer Set a static ip on the ethernet interface of your computer (use this for serverip in the above commands) Rename the initramfs image to initramfs.bin, and host it with the tftp server Reboot the router. If you set up everything right, the router led should switch over to a slow blue glow which means openwrt is booted. If for some reason the file doesn't get loaded into ram properly, it should still boot to the OEM firmware. After openwrt boots, ssh into it and run these commands: fw_setenv bootcmd "setenv mtdids nand0=nand0 && setenv mtdparts mtdparts=nand0:0x1A000000@0x2400000(firmware) && ubi part firmware && ubi read 0x44000000 kernel 0x6e0000 && bootm" fw_setenv bootdelay 2 After openwrt boots up, figure out a way to get the sysupgrade file onto it (scp, custom build with usb kernel module included, wget, etc.) then flash it with sysupgrade. After it finishes flashing, it should reboot, the light should start flashing blue, then when the light starts "breathing" blue that means openwrt is booted. Method 2: Install with serial access (Do this if something fails and you can't boot after using method 1) You'll need: initramfs and sysupgrade images Serial access: https://openwrt.org/inbox/toh/askey/askey_rt4230w_rev6#opening_the_case Install and set up a tftp server Set a static ip on the ethernet interface of your computer Download the initramfs image, rename it to initramfs.bin, and host it with the tftp server Connect the wan port of the router to your computer Interrupt U-Boot and run these commands: setenv serverip 10.42.0.1 (You can use whatever ip you set for the computer) setenv ipaddr 10.42.0.10 (Can be any ip as long as it's in the same subnet) setenv bootcmd "setenv mtdids nand0=nand0 && set mtdparts mtdparts=nand0:0x1A000000@0x2400000(firmware) && ubi part firmware && ubi read 0x44000000 kernel 0x6e0000 && bootm" saveenv tftpboot initramfs.bin bootm After openwrt boots up, figure out a way to get the sysupgrade file onto it (scp, custom build with usb kernel module included, wget, etc.) then flash it with sysupgrade. After it finishes flashing, it should reboot, the light should start flashing blue, then when the light starts "breathing" blue that means openwrt is booted. Signed-off-by: Lauro Moreno [add entry in 5.10 patch, fix whitespace issues] Signed-off-by: Adrian Schmutzler --- package/boot/uboot-envtools/files/ipq806x | 3 + .../ipq806x/base-files/etc/board.d/02_network | 1 + .../etc/hotplug.d/firmware/11-ath10k-caldata | 2 + .../base-files/lib/upgrade/platform.sh | 19 +- .../boot/dts/qcom-ipq8065-rt4230w-rev6.dts | 303 ++++++++++++++++++ target/linux/ipq806x/image/Makefile | 13 + .../0069-arm-boot-add-dts-files.patch | 3 +- .../0069-arm-boot-add-dts-files.patch | 3 +- 8 files changed, 336 insertions(+), 11 deletions(-) create mode 100644 target/linux/ipq806x/files/arch/arm/boot/dts/qcom-ipq8065-rt4230w-rev6.dts diff --git a/package/boot/uboot-envtools/files/ipq806x b/package/boot/uboot-envtools/files/ipq806x index 222d801f17..7e1d71a7e9 100644 --- a/package/boot/uboot-envtools/files/ipq806x +++ b/package/boot/uboot-envtools/files/ipq806x @@ -30,6 +30,9 @@ ubootenv_mtdinfo () { } case "$board" in +askey,rt4230w-rev6) + ubootenv_add_uci_config "/dev/mtd9" "0x0" "0x40000" "0x20000" + ;; edgecore,ecw5410) ubootenv_add_uci_config "/dev/mtd11" "0x0" "0x10000" "0x10000" ;; diff --git a/target/linux/ipq806x/base-files/etc/board.d/02_network b/target/linux/ipq806x/base-files/etc/board.d/02_network index abdab89857..22d607b0ec 100644 --- a/target/linux/ipq806x/base-files/etc/board.d/02_network +++ b/target/linux/ipq806x/base-files/etc/board.d/02_network @@ -11,6 +11,7 @@ board_config_update board=$(board_name) case "$board" in +askey,rt4230w-rev6 |\ asrock,g10 |\ nec,wg2600hp) ucidef_add_switch "switch0" \ diff --git a/target/linux/ipq806x/base-files/etc/hotplug.d/firmware/11-ath10k-caldata b/target/linux/ipq806x/base-files/etc/hotplug.d/firmware/11-ath10k-caldata index fca35516ec..5592590d52 100644 --- a/target/linux/ipq806x/base-files/etc/hotplug.d/firmware/11-ath10k-caldata +++ b/target/linux/ipq806x/base-files/etc/hotplug.d/firmware/11-ath10k-caldata @@ -9,6 +9,7 @@ board=$(board_name) case "$FIRMWARE" in "ath10k/pre-cal-pci-0000:01:00.0.bin") case $board in + askey,rt4230w-rev6 |\ asrock,g10) if [ -b "$(find_mtd_part 0:art)" ]; then caldata_extract "0:art" 0x1000 0x2f20 @@ -68,6 +69,7 @@ case "$FIRMWARE" in ;; "ath10k/pre-cal-pci-0001:01:00.0.bin") case $board in + askey,rt4230w-rev6 |\ asrock,g10) if [ -b "$(find_mtd_part 0:art)" ]; then caldata_extract "0:art" 0x5000 0x2f20 diff --git a/target/linux/ipq806x/base-files/lib/upgrade/platform.sh b/target/linux/ipq806x/base-files/lib/upgrade/platform.sh index 4dc612492c..a5e18201df 100644 --- a/target/linux/ipq806x/base-files/lib/upgrade/platform.sh +++ b/target/linux/ipq806x/base-files/lib/upgrade/platform.sh @@ -10,15 +10,7 @@ platform_check_image() { platform_do_upgrade() { case "$(board_name)" in - asrock,g10) - asrock_upgrade_prepare - nand_do_upgrade "$1" - ;; - buffalo,wxr-2533dhp) - buffalo_upgrade_prepare_ubi - CI_ROOTPART="ubi_rootfs" - nand_do_upgrade "$1" - ;; + askey,rt4230w-rev6 |\ compex,wpq864|\ netgear,d7800 |\ netgear,r7500 |\ @@ -28,6 +20,15 @@ platform_do_upgrade() { qcom,ipq8064-ap161) nand_do_upgrade "$1" ;; + asrock,g10) + asrock_upgrade_prepare + nand_do_upgrade "$1" + ;; + buffalo,wxr-2533dhp) + buffalo_upgrade_prepare_ubi + CI_ROOTPART="ubi_rootfs" + nand_do_upgrade "$1" + ;; edgecore,ecw5410) part="$(awk -F 'ubi.mtd=' '{printf $2}' /proc/cmdline | sed -e 's/ .*$//')" if [ "$part" = "rootfs1" ]; then diff --git a/target/linux/ipq806x/files/arch/arm/boot/dts/qcom-ipq8065-rt4230w-rev6.dts b/target/linux/ipq806x/files/arch/arm/boot/dts/qcom-ipq8065-rt4230w-rev6.dts new file mode 100644 index 0000000000..7342de4bec --- /dev/null +++ b/target/linux/ipq806x/files/arch/arm/boot/dts/qcom-ipq8065-rt4230w-rev6.dts @@ -0,0 +1,303 @@ +// SPDX-License-Identifier: GPL-2.0-or-later + +#include "qcom-ipq8065.dtsi" +#include + +/ { + model = "Askey RT4230W REV6"; + compatible = "askey,rt4230w-rev6", "qcom,ipq8065", "qcom,ipq8064"; + + memory@0 { + reg = <0x42000000 0x3e000000>; + device_type = "memory"; + }; + + aliases { + led-boot = &ledctrl3; + led-failsafe = &ledctrl1; + led-running = &ledctrl2; + led-upgrade = &ledctrl3; + }; + + chosen { + bootargs = "rootfstype=squashfs noinitrd"; + }; + + keys { + compatible = "gpio-keys"; + pinctrl-0 = <&button_pins>; + pinctrl-names = "default"; + + reset { + label = "reset"; + gpios = <&qcom_pinmux 54 GPIO_ACTIVE_LOW>; + linux,code = ; + }; + + wps { + label = "wps"; + gpios = <&qcom_pinmux 68 GPIO_ACTIVE_LOW>; + linux,code = ; + }; + }; + + leds { + compatible = "gpio-leds"; + pinctrl-0 = <&led_pins>; + pinctrl-names = "default"; + + ledctrl1: ledctrl1 { + label = "ledctrl1"; + gpios = <&qcom_pinmux 22 GPIO_ACTIVE_HIGH>; + }; + + ledctrl2: ledctrl2 { + label = "ledctrl2"; + gpios = <&qcom_pinmux 23 GPIO_ACTIVE_HIGH>; + }; + + ledctrl3: ledctrl3 { + label = "ledctrl3"; + gpios = <&qcom_pinmux 24 GPIO_ACTIVE_HIGH>; + }; + }; +}; + +&qcom_pinmux { + button_pins: button_pins { + mux { + pins = "gpio54", "gpio68"; + function = "gpio"; + drive-strength = <2>; + bias-pull-up; + }; + }; + + led_pins: led_pins { + mux { + pins = "gpio22", "gpio23", "gpio24"; + function = "gpio"; + drive-strength = <2>; + bias-pull-down; + }; + }; + + rgmii2_pins: rgmii2_pins { + mux { + pins = "gpio27", "gpio28", "gpio29", "gpio30", "gpio31", + "gpio51", "gpio52", "gpio59", "gpio60", "gpio61", "gpio62"; + function = "rgmii2"; + drive-strength = <8>; + bias-disable; + }; + + tx { + pins = "gpio27", "gpio28", "gpio29", "gpio30", "gpio31", "gpio32"; + input-disable; + }; + }; +}; + +&nand_controller { + status = "okay"; + + pinctrl-0 = <&nand_pins>; + pinctrl-names = "default"; + + nand@0 { + reg = <0>; + compatible = "qcom,nandcs"; + + nand-ecc-strength = <4>; + nand-bus-width = <8>; + nand-ecc-step-size = <512>; + + partitions { + compatible = "fixed-partitions"; + #address-cells = <1>; + #size-cells = <1>; + + partition@0 { + label = "0:SBL1"; + reg = <0x0000000 0x0040000>; + read-only; + }; + partition@40000 { + label = "0:MIBIB"; + reg = <0x0040000 0x0140000>; + read-only; + }; + partition@180000 { + label = "0:SBL2"; + reg = <0x0180000 0x0140000>; + read-only; + }; + partition@2c0000 { + label = "0:SBL3"; + reg = <0x02c0000 0x0280000>; + read-only; + }; + partition@540000 { + label = "0:DDRCONFIG"; + reg = <0x0540000 0x0120000>; + read-only; + }; + partition@660000 { + label = "0:SSD"; + reg = <0x0660000 0x0120000>; + read-only; + }; + partition@780000 { + label = "0:TZ"; + reg = <0x0780000 0x0280000>; + read-only; + }; + partition@a00000 { + label = "0:RPM"; + reg = <0x0a00000 0x0280000>; + read-only; + }; + partition@c80000 { + label = "0:APPSBL"; + reg = <0x0c80000 0x0500000>; + read-only; + }; + partition@1180000 { + label = "0:APPSBLENV"; + reg = <0x1180000 0x0080000>; + }; + ART: partition@1200000 { + label = "0:ART"; + reg = <0x1200000 0x0140000>; + read-only; + }; + partition@1340000 { + label = "0:BOOTCONFIG"; + reg = <0x1340000 0x0060000>; + read-only; + }; + partition@13a0000 { + label = "0:SBL2_1"; + reg = <0x13a0000 0x0140000>; + read-only; + }; + partition@14e0000 { + label = "0:SBL3_1"; + reg = <0x14e0000 0x0280000>; + read-only; + }; + partition@1760000 { + label = "0:DDRCONFIG_1"; + reg = <0x1760000 0x0120000>; + read-only; + }; + partition@1880000 { + label = "0:SSD_1"; + reg = <0x1880000 0x0120000>; + read-only; + }; + partition@19a0000 { + label = "0:TZ_1"; + reg = <0x19a0000 0x0280000>; + read-only; + }; + partition@1c20000 { + label = "0:RPM_1"; + reg = <0x1c20000 0x0280000>; + read-only; + }; + partition@1ea0000 { + label = "0:BOOTCONFIG1"; + reg = <0x1ea0000 0x0060000>; + read-only; + }; + partition@1f00000 { + label = "0:APPSBL_1"; + reg = <0x1f00000 0x0500000>; + read-only; + }; + partition@2400000 { + label = "ubi"; + reg = <0x2400000 0x1a000000>; + }; + }; + }; +}; + +&mdio0 { + status = "okay"; + + pinctrl-0 = <&mdio0_pins>; + pinctrl-names = "default"; + + phy0: ethernet-phy@0 { + reg = <0x0>; + qca,ar8327-initvals = < + 0x00004 0x7600000 /* PAD0_MODE */ + 0x00008 0x1000000 /* PAD5_MODE */ + 0x0000c 0x80 /* PAD6_MODE */ + 0x000e4 0xaa545 /* MAC_POWER_SEL */ + 0x000e0 0xc74164de /* SGMII_CTRL */ + 0x0007c 0x4e /* PORT0_STATUS */ + 0x00094 0x4e /* PORT6_STATUS */ + 0x00050 0xcf02cf02 /* LED_CTRL_0 */ + 0x00054 0xc832c832 /* LED_CTRL_1 */ + >; + }; +}; + +&gmac0 { + status = "okay"; + phy-mode = "rgmii"; + qcom,id = <0>; + + mtd-mac-address = <&ART 0x0>; + + pinctrl-0 = <&rgmii2_pins>; + pinctrl-names = "default"; + + fixed-link { + speed = <1000>; + full-duplex; + }; +}; + +&gmac1 { + status = "okay"; + phy-mode = "sgmii"; + qcom,id = <1>; + + mtd-mac-address = <&ART 0x6>; + + fixed-link { + speed = <1000>; + full-duplex; + }; +}; + +&adm_dma { + status = "okay"; +}; + +&usb3_0 { + status = "okay"; + clocks = <&gcc USB30_1_MASTER_CLK>; +}; + +&usb3_1 { + status = "okay"; + clocks = <&gcc USB30_0_MASTER_CLK>; +}; + +&pcie0 { + status = "okay"; + reset-gpio = <&qcom_pinmux 3 GPIO_ACTIVE_HIGH>; + /delete-property/ perst-gpios; +}; + +&pcie1 { + status = "okay"; + reset-gpio = <&qcom_pinmux 48 GPIO_ACTIVE_HIGH>; + /delete-property/ perst-gpios; + force_gen1 = <1>; +}; diff --git a/target/linux/ipq806x/image/Makefile b/target/linux/ipq806x/image/Makefile index 6c091be335..e53fba1e1d 100644 --- a/target/linux/ipq806x/image/Makefile +++ b/target/linux/ipq806x/image/Makefile @@ -90,6 +90,19 @@ define Device/ZyXELImage IMAGE/sysupgrade.bin/squashfs := append-rootfs | pad-to $$$$(BLOCKSIZE) | sysupgrade-tar rootfs=$$$$@ | append-metadata endef +define Device/askey_rt4230w-rev6 + $(call Device/LegacyImage) + DEVICE_VENDOR := Askey + DEVICE_MODEL := RT4230W + DEVICE_VARIANT := REV6 + SOC := qcom-ipq8065 + BLOCKSIZE := 128k + PAGESIZE := 2048 + DEVICE_PACKAGES := ath10k-firmware-qca9984-ct + KERNEL_IN_UBI := 1 +endef +TARGET_DEVICES += askey_rt4230w-rev6 + define Device/asrock_g10 $(call Device/FitImage) $(call Device/UbiFit) diff --git a/target/linux/ipq806x/patches-5.10/0069-arm-boot-add-dts-files.patch b/target/linux/ipq806x/patches-5.10/0069-arm-boot-add-dts-files.patch index a8e17afd42..87d6b65694 100644 --- a/target/linux/ipq806x/patches-5.10/0069-arm-boot-add-dts-files.patch +++ b/target/linux/ipq806x/patches-5.10/0069-arm-boot-add-dts-files.patch @@ -10,7 +10,7 @@ Signed-off-by: John Crispin --- a/arch/arm/boot/dts/Makefile +++ b/arch/arm/boot/dts/Makefile -@@ -907,8 +907,25 @@ dtb-$(CONFIG_ARCH_QCOM) += \ +@@ -907,8 +907,26 @@ dtb-$(CONFIG_ARCH_QCOM) += \ qcom-ipq4019-ap.dk04.1-c3.dtb \ qcom-ipq4019-ap.dk07.1-c1.dtb \ qcom-ipq4019-ap.dk07.1-c2.dtb \ @@ -32,6 +32,7 @@ Signed-off-by: John Crispin + qcom-ipq8064-wxr-2533dhp.dtb \ + qcom-ipq8065-nbg6817.dtb \ + qcom-ipq8065-r7800.dtb \ ++ qcom-ipq8065-rt4230w-rev6.dtb \ + qcom-ipq8068-ecw5410.dtb \ qcom-msm8660-surf.dtb \ qcom-msm8960-cdp.dtb \ diff --git a/target/linux/ipq806x/patches-5.4/0069-arm-boot-add-dts-files.patch b/target/linux/ipq806x/patches-5.4/0069-arm-boot-add-dts-files.patch index 055a4cbc30..b97d36fd7c 100644 --- a/target/linux/ipq806x/patches-5.4/0069-arm-boot-add-dts-files.patch +++ b/target/linux/ipq806x/patches-5.4/0069-arm-boot-add-dts-files.patch @@ -10,7 +10,7 @@ Signed-off-by: John Crispin --- a/arch/arm/boot/dts/Makefile +++ b/arch/arm/boot/dts/Makefile -@@ -842,7 +842,24 @@ dtb-$(CONFIG_ARCH_QCOM) += \ +@@ -842,7 +842,25 @@ dtb-$(CONFIG_ARCH_QCOM) += \ qcom-ipq4019-ap.dk04.1-c3.dtb \ qcom-ipq4019-ap.dk07.1-c1.dtb \ qcom-ipq4019-ap.dk07.1-c2.dtb \ @@ -31,6 +31,7 @@ Signed-off-by: John Crispin + qcom-ipq8064-wxr-2533dhp.dtb \ + qcom-ipq8065-nbg6817.dtb \ + qcom-ipq8065-r7800.dtb \ ++ qcom-ipq8065-rt4230w-rev6.dtb \ + qcom-ipq8068-ecw5410.dtb \ qcom-msm8660-surf.dtb \ qcom-msm8960-cdp.dtb \ From 01f29a0c72e88e12c2c1a44bc8ac28c986fb8d35 Mon Sep 17 00:00:00 2001 From: Adrian Schmutzler Date: Sat, 5 Jun 2021 17:47:56 +0200 Subject: [PATCH 14/35] umbim: fix whitespace issues Make leading whitespaces consistent and remove trailing one. Signed-off-by: Adrian Schmutzler --- package/network/utils/umbim/Makefile | 2 +- .../network/utils/umbim/files/lib/netifd/proto/mbim.sh | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/package/network/utils/umbim/Makefile b/package/network/utils/umbim/Makefile index cc34002f6e..984f8354de 100644 --- a/package/network/utils/umbim/Makefile +++ b/package/network/utils/umbim/Makefile @@ -1,7 +1,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=umbim -PKG_RELEASE:=1 +PKG_RELEASE:=$(AUTORELEASE) PKG_SOURCE_PROTO:=git PKG_SOURCE_URL=$(PROJECT_GIT)/project/umbim.git diff --git a/package/network/utils/umbim/files/lib/netifd/proto/mbim.sh b/package/network/utils/umbim/files/lib/netifd/proto/mbim.sh index 9b5729a7ab..804870d7d4 100755 --- a/package/network/utils/umbim/files/lib/netifd/proto/mbim.sh +++ b/package/network/utils/umbim/files/lib/netifd/proto/mbim.sh @@ -91,7 +91,7 @@ _proto_mbim_setup() { tid=$((tid + 1)) echo "mbim[$$]" "Checking subscriber" - umbim $DBG -n -t $tid -d $device subscriber || { + umbim $DBG -n -t $tid -d $device subscriber || { echo "mbim[$$]" "Subscriber init failed" proto_notify_error "$interface" NO_SUBSCRIBER return 1 @@ -99,7 +99,7 @@ _proto_mbim_setup() { tid=$((tid + 1)) echo "mbim[$$]" "Register with network" - umbim $DBG -n -t $tid -d $device registration || { + umbim $DBG -n -t $tid -d $device registration || { echo "mbim[$$]" "Subscriber registration failed" proto_notify_error "$interface" NO_REGISTRATION return 1 @@ -107,13 +107,13 @@ _proto_mbim_setup() { tid=$((tid + 1)) echo "mbim[$$]" "Attach to network" - umbim $DBG -n -t $tid -d $device attach || { + umbim $DBG -n -t $tid -d $device attach || { echo "mbim[$$]" "Failed to attach to network" proto_notify_error "$interface" ATTACH_FAILED return 1 } tid=$((tid + 1)) - + echo "mbim[$$]" "Connect to network" while ! umbim $DBG -n -t $tid -d $device connect "$apn" "$auth" "$username" "$password"; do tid=$((tid + 1)) From 6bc4c0ae3eb3dff6e410b5b012ab0bec267adb5a Mon Sep 17 00:00:00 2001 From: Adrian Schmutzler Date: Sat, 5 Jun 2021 17:59:39 +0200 Subject: [PATCH 15/35] umbim: fix return value of proto_mbim_setup() The variable name appears to be mistyped. Suggested-by: Howard Chu Signed-off-by: Adrian Schmutzler --- package/network/utils/umbim/files/lib/netifd/proto/mbim.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package/network/utils/umbim/files/lib/netifd/proto/mbim.sh b/package/network/utils/umbim/files/lib/netifd/proto/mbim.sh index 804870d7d4..abbabd6625 100755 --- a/package/network/utils/umbim/files/lib/netifd/proto/mbim.sh +++ b/package/network/utils/umbim/files/lib/netifd/proto/mbim.sh @@ -155,7 +155,7 @@ proto_mbim_setup() { sleep 15 } - return $rt + return $ret } proto_mbim_teardown() { From 7b9a0c264cb9dc2c5a946a0aa9a290427a5e559c Mon Sep 17 00:00:00 2001 From: Michael Pratt Date: Tue, 4 May 2021 23:32:00 -0400 Subject: [PATCH 16/35] ath79: use dynamic partitioning for TP-Link CPE series CPExxx and WBSxxx boards with AR9344 SOC use the OKLI lzma kernel loader with the offset of 3 blocks of length 4k (0x3000) in order to have a fake "kernel" that cannot grow larger than how it is defined in the now static OEM partition table. Before recent changes to the mtdsplit driver, the uImage parser for OKLI only supported images that started exactly on an eraseblock boundary. The mtdsplit parser for uImage now supports identifying images with any magic number value and at any offset from the eraseblock boundary using DTS properties to define those values. So, it is no longer necessary to use fixed sizes for kernel and rootfs Tested-by: Andrew Cameron [CPE510 v2] Tested-by: Bernhard Geier [WBS210 v2] Tested-by: Petrov [CPE210 v1] Signed-off-by: Michael Pratt --- target/linux/ath79/dts/ar9344_tplink_cpe.dtsi | 18 +++------- tools/firmware-utils/src/tplink-safeloader.c | 33 +++++++------------ 2 files changed, 15 insertions(+), 36 deletions(-) diff --git a/target/linux/ath79/dts/ar9344_tplink_cpe.dtsi b/target/linux/ath79/dts/ar9344_tplink_cpe.dtsi index d4b7de440a..fd6aa0f08b 100644 --- a/target/linux/ath79/dts/ar9344_tplink_cpe.dtsi +++ b/target/linux/ath79/dts/ar9344_tplink_cpe.dtsi @@ -4,6 +4,7 @@ #include #include +#include / { aliases { @@ -59,20 +60,9 @@ partition@40000 { label = "firmware"; reg = <0x040000 0x780000>; - - compatible = "fixed-partitions"; - #address-cells = <1>; - #size-cells = <1>; - - partition@0 { - label = "kernel"; - reg = <0x000000 0x300000>; - }; - - partition@300000 { - label = "rootfs"; - reg = <0x300000 0x480000>; - }; + compatible = "openwrt,uimage", "denx,uimage"; + openwrt,ih-magic = ; + openwrt,offset = <0x3000>; }; partition@7c0000 { diff --git a/tools/firmware-utils/src/tplink-safeloader.c b/tools/firmware-utils/src/tplink-safeloader.c index 878a0afbe5..e5974325ae 100644 --- a/tools/firmware-utils/src/tplink-safeloader.c +++ b/tools/firmware-utils/src/tplink-safeloader.c @@ -156,8 +156,7 @@ static struct device_info boards[] = { {"default-mac", 0x30000, 0x00020}, {"product-info", 0x31100, 0x00100}, {"signature", 0x32000, 0x00400}, - {"os-image", 0x40000, 0x300000}, - {"file-system", 0x340000, 0x470000}, + {"firmware", 0x40000, 0x770000}, {"soft-version", 0x7b0000, 0x00100}, {"support-list", 0x7b1000, 0x00400}, {"user-config", 0x7c0000, 0x10000}, @@ -279,8 +278,7 @@ static struct device_info boards[] = { {"default-mac", 0x30000, 0x00020}, {"product-info", 0x31100, 0x00100}, {"signature", 0x32000, 0x00400}, - {"os-image", 0x40000, 0x300000}, - {"file-system", 0x340000, 0x470000}, + {"firmware", 0x40000, 0x770000}, {"soft-version", 0x7b0000, 0x00100}, {"support-list", 0x7b1000, 0x00400}, {"user-config", 0x7c0000, 0x10000}, @@ -358,8 +356,7 @@ static struct device_info boards[] = { {"default-mac", 0x30000, 0x00020}, {"product-info", 0x31100, 0x00100}, {"signature", 0x32000, 0x00400}, - {"os-image", 0x40000, 0x300000}, - {"file-system", 0x340000, 0x470000}, + {"firmware", 0x40000, 0x770000}, {"soft-version", 0x7b0000, 0x00100}, {"support-list", 0x7b1000, 0x00400}, {"user-config", 0x7c0000, 0x10000}, @@ -400,8 +397,7 @@ static struct device_info boards[] = { {"default-mac", 0x30000, 0x00020}, {"product-info", 0x31100, 0x00100}, {"signature", 0x32000, 0x00400}, - {"os-image", 0x40000, 0x300000}, - {"file-system", 0x340000, 0x470000}, + {"firmware", 0x40000, 0x770000}, {"soft-version", 0x7b0000, 0x00100}, {"support-list", 0x7b1000, 0x00400}, {"user-config", 0x7c0000, 0x10000}, @@ -445,8 +441,7 @@ static struct device_info boards[] = { {"default-mac", 0x30000, 0x00020}, {"product-info", 0x31100, 0x00100}, {"signature", 0x32000, 0x00400}, - {"os-image", 0x40000, 0x300000}, - {"file-system", 0x340000, 0x470000}, + {"firmware", 0x40000, 0x770000}, {"soft-version", 0x7b0000, 0x00100}, {"support-list", 0x7b1000, 0x00400}, {"user-config", 0x7c0000, 0x10000}, @@ -485,8 +480,7 @@ static struct device_info boards[] = { {"default-mac", 0x30000, 0x00020}, {"product-info", 0x31100, 0x00100}, {"signature", 0x32000, 0x00400}, - {"os-image", 0x40000, 0x300000}, - {"file-system", 0x340000, 0x470000}, + {"firmware", 0x40000, 0x770000}, {"soft-version", 0x7b0000, 0x00100}, {"support-list", 0x7b1000, 0x00400}, {"user-config", 0x7c0000, 0x10000}, @@ -525,8 +519,7 @@ static struct device_info boards[] = { {"default-mac", 0x30000, 0x00020}, {"product-info", 0x31100, 0x00100}, {"signature", 0x32000, 0x00400}, - {"os-image", 0x40000, 0x300000}, - {"file-system", 0x340000, 0x470000}, + {"firmware", 0x40000, 0x770000}, {"soft-version", 0x7b0000, 0x00100}, {"support-list", 0x7b1000, 0x00400}, {"user-config", 0x7c0000, 0x10000}, @@ -557,8 +550,7 @@ static struct device_info boards[] = { {"default-mac", 0x30000, 0x00020}, {"product-info", 0x31100, 0x00100}, {"signature", 0x32000, 0x00400}, - {"os-image", 0x40000, 0x300000}, - {"file-system", 0x340000, 0x470000}, + {"firmware", 0x40000, 0x770000}, {"soft-version", 0x7b0000, 0x00100}, {"support-list", 0x7b1000, 0x00400}, {"user-config", 0x7c0000, 0x10000}, @@ -589,8 +581,7 @@ static struct device_info boards[] = { {"default-mac", 0x30000, 0x00020}, {"product-info", 0x31100, 0x00100}, {"signature", 0x32000, 0x00400}, - {"os-image", 0x40000, 0x300000}, - {"file-system", 0x340000, 0x470000}, + {"firmware", 0x40000, 0x770000}, {"soft-version", 0x7b0000, 0x00100}, {"support-list", 0x7b1000, 0x00400}, {"user-config", 0x7c0000, 0x10000}, @@ -622,8 +613,7 @@ static struct device_info boards[] = { {"default-mac", 0x30000, 0x00020}, {"product-info", 0x31100, 0x00100}, {"signature", 0x32000, 0x00400}, - {"os-image", 0x40000, 0x300000}, - {"file-system", 0x340000, 0x470000}, + {"firmware", 0x40000, 0x770000}, {"soft-version", 0x7b0000, 0x00100}, {"support-list", 0x7b1000, 0x00400}, {"user-config", 0x7c0000, 0x10000}, @@ -655,8 +645,7 @@ static struct device_info boards[] = { {"default-mac", 0x30000, 0x00020}, {"product-info", 0x31100, 0x00100}, {"signature", 0x32000, 0x00400}, - {"os-image", 0x40000, 0x300000}, - {"file-system", 0x340000, 0x470000}, + {"firmware", 0x40000, 0x770000}, {"soft-version", 0x7b0000, 0x00100}, {"support-list", 0x7b1000, 0x00400}, {"user-config", 0x7c0000, 0x10000}, From 9b144cef4348eb49e33ad63bcb369544215313a5 Mon Sep 17 00:00:00 2001 From: Daniele Castro Date: Tue, 11 May 2021 13:17:50 +0100 Subject: [PATCH 17/35] bcm63xx: drop USB LEDs for Technicolor TG582N / ADB P.DG A4001N Remove the USB status red and green LEDs for - ADB P.DG A4001N A-000-1A1-AX - Technicolor TG582N - Technicolor TG582N Telecom Italia After having mounted an SMD socket for the flash memory for JTAG reverse engineering, and so be able to easly swap between OpenWrt and the stock FW, it turned out that the stock FW does not light up the red and green USB LEDs exactly as I remembered. Signed-off-by: Daniele Castro [improve commit title] Signed-off-by: Adrian Schmutzler --- target/linux/bcm63xx/base-files/etc/board.d/01_leds | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/target/linux/bcm63xx/base-files/etc/board.d/01_leds b/target/linux/bcm63xx/base-files/etc/board.d/01_leds index 33c70981de..75e8afef9d 100644 --- a/target/linux/bcm63xx/base-files/etc/board.d/01_leds +++ b/target/linux/bcm63xx/base-files/etc/board.d/01_leds @@ -27,10 +27,9 @@ adb,a4001n1) ucidef_set_led_usbdev "usb" "USB" "green:3g" "1-1" ;; adb,pdg-a4001n-a-000-1a1-ax|\ +technicolor,tg582n|\ technicolor,tg582n-telecom-italia) ucidef_set_led_netdev "wlan0" "WIFI" "green:wifi" "wlan0" - ucidef_set_led_usbdev "usb1" "USB1" "green:service" "1-1" - ucidef_set_led_usbdev "usb2" "USB2" "red:service" "2-1" ;; adb,av4202n) ucidef_set_led_netdev "wlan0" "WLAN" "blue:wifi" "wlan0" @@ -92,10 +91,6 @@ sercomm,h500-s-lowi|\ sercomm,h500-s-vfes) ucidef_set_led_netdev "wan" "WAN" "green:internet" "eth0.2" ;; -technicolor,tg582n) - ucidef_set_led_netdev "wlan0" "WIFI" "green:wifi" "wlan0" - ucidef_set_led_usbdev "usb" "USB" "red:power" "1-1" - ;; telsey,cpva502plus) ucidef_set_led_netdev "lan" "LAN" "amber:link" "eth0" ;; From 4a9f389ed2dcee18a5c5e1f0d4e5c406f9290579 Mon Sep 17 00:00:00 2001 From: Shiji Yang Date: Sun, 16 May 2021 21:21:09 +0800 Subject: [PATCH 18/35] ramips: split Youku YK1 to YK-L1 and YK-L1c Device specifications: * Model: Youku YK-L1/L1c * CPU: MT7620A * RAM: 128 MiB * Flash: 32 MiB (YK-L1)/ 16 MiB (YK-L1c) * LAN: 2* 10M/100M Ports * WAN: 1* 10M/100M Port * USB: 1* USB2.0 * SD: 1* MicroSD socket * UART: 1* TTL, Baudrate 57600 Descriptions: Previous supported device YOUKU yk1 is actually Youku YK-L1. Though they look really different, the only hardware difference between the two models is flash size, YK-L1 has 32 MiB flash but YK-L1c has 16MiB. It seems that YK-L1c can compatible with YK-L1's firmware but it's better to split it to different models. It is easy to identify the models by looking at the label on the bottom of the device. The label has the model number "YK-L1" or "YK-L1c". Due to different flash sizes, YK-L1c that using previous YK-L1's firmware needs to apply "force update" to install compatible firmware, so please backup config file before system upgrade. Signed-off-by: Shiji Yang [use more specific name for DTSI] Signed-off-by: Adrian Schmutzler --- .../linux/ramips/dts/mt7620a_youku_yk-l1.dts | 12 +++++++++++ ...youku_yk1.dts => mt7620a_youku_yk-l1.dtsi} | 7 ++----- .../linux/ramips/dts/mt7620a_youku_yk-l1c.dts | 12 +++++++++++ target/linux/ramips/image/mt7620.mk | 20 ++++++++++++++----- .../mt7620/base-files/etc/board.d/02_network | 6 ++++-- 5 files changed, 45 insertions(+), 12 deletions(-) create mode 100644 target/linux/ramips/dts/mt7620a_youku_yk-l1.dts rename target/linux/ramips/dts/{mt7620a_youku_yk1.dts => mt7620a_youku_yk-l1.dtsi} (93%) create mode 100644 target/linux/ramips/dts/mt7620a_youku_yk-l1c.dts diff --git a/target/linux/ramips/dts/mt7620a_youku_yk-l1.dts b/target/linux/ramips/dts/mt7620a_youku_yk-l1.dts new file mode 100644 index 0000000000..5155318b0c --- /dev/null +++ b/target/linux/ramips/dts/mt7620a_youku_yk-l1.dts @@ -0,0 +1,12 @@ +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT + +#include "mt7620a_youku_yk-l1.dtsi" + +/ { + compatible = "youku,yk-l1", "ralink,mt7620a-soc"; + model = "Youku YK-L1"; +}; + +&firmware { + reg = <0x50000 0x1fb0000>; +}; diff --git a/target/linux/ramips/dts/mt7620a_youku_yk1.dts b/target/linux/ramips/dts/mt7620a_youku_yk-l1.dtsi similarity index 93% rename from target/linux/ramips/dts/mt7620a_youku_yk1.dts rename to target/linux/ramips/dts/mt7620a_youku_yk-l1.dtsi index 2e59e5bf6e..61062a3179 100644 --- a/target/linux/ramips/dts/mt7620a_youku_yk1.dts +++ b/target/linux/ramips/dts/mt7620a_youku_yk-l1.dtsi @@ -4,9 +4,6 @@ #include / { - compatible = "youku,yk1", "ralink,mt7620a-soc"; - model = "YOUKU YK1"; - aliases { led-boot = &led_power; led-failsafe = &led_power; @@ -88,10 +85,10 @@ read-only; }; - partition@50000 { + firmware: partition@50000 { compatible = "denx,uimage"; label = "firmware"; - reg = <0x50000 0x1fb0000>; + /* reg property is set based on flash size in DTS files */ }; }; }; diff --git a/target/linux/ramips/dts/mt7620a_youku_yk-l1c.dts b/target/linux/ramips/dts/mt7620a_youku_yk-l1c.dts new file mode 100644 index 0000000000..c59f0101bd --- /dev/null +++ b/target/linux/ramips/dts/mt7620a_youku_yk-l1c.dts @@ -0,0 +1,12 @@ +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT + +#include "mt7620a_youku_yk-l1.dtsi" + +/ { + compatible = "youku,yk-l1c", "ralink,mt7620a-soc"; + model = "Youku YK-L1c"; +}; + +&firmware { + reg = <0x50000 0xfb0000>; +}; diff --git a/target/linux/ramips/image/mt7620.mk b/target/linux/ramips/image/mt7620.mk index ddb09baa08..fe41512f36 100644 --- a/target/linux/ramips/image/mt7620.mk +++ b/target/linux/ramips/image/mt7620.mk @@ -1112,16 +1112,26 @@ define Device/xiaomi_miwifi-mini endef TARGET_DEVICES += xiaomi_miwifi-mini -define Device/youku_yk1 +define Device/youku_yk-l1 SOC := mt7620a IMAGE_SIZE := 32448k - DEVICE_VENDOR := YOUKU - DEVICE_MODEL := YK1 + DEVICE_VENDOR := Youku + DEVICE_MODEL := YK-L1 DEVICE_PACKAGES := kmod-usb2 kmod-usb-ohci kmod-sdhci-mt7620 \ kmod-usb-ledtrig-usbport - SUPPORTED_DEVICES += youku-yk1 + SUPPORTED_DEVICES += youku-yk1 youku,yk1 endef -TARGET_DEVICES += youku_yk1 +TARGET_DEVICES += youku_yk-l1 + +define Device/youku_yk-l1c + SOC := mt7620a + IMAGE_SIZE := 16064k + DEVICE_VENDOR := Youku + DEVICE_MODEL := YK-L1c + DEVICE_PACKAGES := kmod-usb2 kmod-usb-ohci kmod-sdhci-mt7620 \ + kmod-usb-ledtrig-usbport +endef +TARGET_DEVICES += youku_yk-l1c define Device/yukai_bocco SOC := mt7620a diff --git a/target/linux/ramips/mt7620/base-files/etc/board.d/02_network b/target/linux/ramips/mt7620/base-files/etc/board.d/02_network index 17fa48c739..e2e2614483 100644 --- a/target/linux/ramips/mt7620/base-files/etc/board.d/02_network +++ b/target/linux/ramips/mt7620/base-files/etc/board.d/02_network @@ -215,7 +215,8 @@ ramips_setup_interfaces() ucidef_add_switch "switch0" \ "0:lan" "4:wan" "6@eth0" ;; - youku,yk1) + youku,yk-l1|\ + youku,yk-l1c) ucidef_add_switch "switch0" \ "0:lan" "1:lan" "4:wan" "6@eth0" ;; @@ -338,7 +339,8 @@ ramips_setup_macs() lenovo,newifi-y1s|\ ohyeah,oy-0001|\ wavlink,wl-wn530hg4|\ - youku,yk1) + youku,yk-l1|\ + youku,yk-l1c) wan_mac=$(mtd_get_mac_binary factory 0x2e) ;; linksys,e1700) From 6f648ed7e639060902df1d652fedd176f4aa9f98 Mon Sep 17 00:00:00 2001 From: Adrian Schmutzler Date: Sat, 5 Jun 2021 23:54:37 +0200 Subject: [PATCH 19/35] treewide: remove "+" sign for increment with macaddr_add Many people appear to use an unneeded "+" prefix for the increment when calculating a MAC address with macaddr_add. Since this is not required and used inconsistently [*], just remove it. [*] As a funny side-fact, copy-pasting has led to almost all hotplug.d files using the "+", while nearly all of the 02_network files are not using it. Signed-off-by: Adrian Schmutzler --- .../etc/hotplug.d/firmware/10-ath9k-eeprom | 2 +- .../etc/hotplug.d/firmware/11-ath10k-caldata | 30 +++++++++---------- .../etc/hotplug.d/firmware/10-ath9k-eeprom | 4 +-- .../etc/hotplug.d/firmware/11-ath10k-caldata | 4 +-- .../etc/hotplug.d/firmware/11-ath10k-caldata | 18 +++++------ .../lib/preinit/05_set_iface_mac_ipq40xx.sh | 14 ++++----- .../etc/hotplug.d/firmware/11-ath10k-caldata | 12 ++++---- .../etc/hotplug.d/firmware/11-ath10k-caldata | 2 +- .../etc/hotplug.d/firmware/12-ath9k-eeprom | 2 +- .../etc/hotplug.d/firmware/12-ath9k-eeprom | 4 +-- .../base-files/etc/uci-defaults/03_wireless | 4 +-- .../armv8/base-files/etc/board.d/02_network | 2 +- 12 files changed, 49 insertions(+), 49 deletions(-) diff --git a/target/linux/ath79/generic/base-files/etc/hotplug.d/firmware/10-ath9k-eeprom b/target/linux/ath79/generic/base-files/etc/hotplug.d/firmware/10-ath9k-eeprom index 08d9e017a7..62f2f1e8b4 100644 --- a/target/linux/ath79/generic/base-files/etc/hotplug.d/firmware/10-ath9k-eeprom +++ b/target/linux/ath79/generic/base-files/etc/hotplug.d/firmware/10-ath9k-eeprom @@ -40,7 +40,7 @@ case "$FIRMWARE" in engenius,ecb1200|\ engenius,ecb1750) caldata_extract "art" 0x1000 0x440 - ath9k_patch_mac $(macaddr_add $(mtd_get_mac_ascii u-boot-env athaddr) +1) + ath9k_patch_mac $(macaddr_add $(mtd_get_mac_ascii u-boot-env athaddr) 1) ;; engenius,epg5000|\ iodata,wn-ac1167dgr|\ diff --git a/target/linux/ath79/generic/base-files/etc/hotplug.d/firmware/11-ath10k-caldata b/target/linux/ath79/generic/base-files/etc/hotplug.d/firmware/11-ath10k-caldata index a7986a98ec..b7cb2da8cd 100644 --- a/target/linux/ath79/generic/base-files/etc/hotplug.d/firmware/11-ath10k-caldata +++ b/target/linux/ath79/generic/base-files/etc/hotplug.d/firmware/11-ath10k-caldata @@ -15,7 +15,7 @@ case "$FIRMWARE" in engenius,enstationac-v1|\ glinet,gl-x750) caldata_extract "art" 0x5000 0x844 - ath10k_patch_mac $(macaddr_add $(mtd_get_mac_binary art 0x0) +2) + ath10k_patch_mac $(macaddr_add $(mtd_get_mac_binary art 0x0) 2) ;; avm,fritz1750e|\ avm,fritzdvbc) @@ -79,15 +79,15 @@ case "$FIRMWARE" in sitecom,wlr-7100|\ zyxel,nbg6616) caldata_extract "art" 0x5000 0x844 - ath10k_patch_mac $(macaddr_add $(mtd_get_mac_ascii u-boot-env ethaddr) +1) + ath10k_patch_mac $(macaddr_add $(mtd_get_mac_ascii u-boot-env ethaddr) 1) ;; engenius,ews511ap) caldata_extract "art" 0x5000 0x844 - ath10k_patch_mac $(macaddr_add $(cat /sys/class/net/eth0/address) +1) + ath10k_patch_mac $(macaddr_add $(cat /sys/class/net/eth0/address) 1) ;; glinet,gl-ar750) caldata_extract "art" 0x5000 0x844 - ath10k_patch_mac $(macaddr_add $(mtd_get_mac_binary art 0x0) +1) + ath10k_patch_mac $(macaddr_add $(mtd_get_mac_binary art 0x0) 1) ;; nec,wg800hp) caldata_extract "art" 0x5000 0x844 @@ -103,11 +103,11 @@ case "$FIRMWARE" in openmesh,mr1750-v1|\ openmesh,mr1750-v2) caldata_extract "ART" 0x5000 0x844 - ath10k_patch_mac $(macaddr_add $(cat /sys/class/net/eth0/address) +16) + ath10k_patch_mac $(macaddr_add $(cat /sys/class/net/eth0/address) 16) ;; openmesh,om5p-ac-v2) caldata_extract "art" 0x5000 0x844 - ath10k_patch_mac $(macaddr_add $(cat /sys/class/net/eth0/address) +16) + ath10k_patch_mac $(macaddr_add $(cat /sys/class/net/eth0/address) 16) ;; qihoo,c301) caldata_extract "radiocfg" 0x5000 0x844 @@ -130,22 +130,22 @@ case "$FIRMWARE" in ;; tplink,archer-d50-v1) caldata_extract "art" 0x5000 0x844 - ath10k_patch_mac $(macaddr_add $(mtd_get_mac_binary romfile 0xf100) +2) + ath10k_patch_mac $(macaddr_add $(mtd_get_mac_binary romfile 0xf100) 2) ;; tplink,archer-d7-v1|\ tplink,archer-d7b-v1) caldata_extract "art" 0x5000 0x844 - ath10k_patch_mac $(macaddr_add $(mtd_get_mac_binary romfs 0xf100) +2) + ath10k_patch_mac $(macaddr_add $(mtd_get_mac_binary romfs 0xf100) 2) ;; tplink,eap245-v1|\ tplink,re450-v2|\ tplink,re450-v3) caldata_extract "art" 0x5000 0x844 - ath10k_patch_mac $(macaddr_add $(mtd_get_mac_binary info 0x8) +1) + ath10k_patch_mac $(macaddr_add $(mtd_get_mac_binary info 0x8) 1) ;; tplink,re350k-v1) caldata_extract "art" 0x5000 0x844 - ath10k_patch_mac $(macaddr_add $(mtd_get_mac_binary info 0x8) +2) + ath10k_patch_mac $(macaddr_add $(mtd_get_mac_binary info 0x8) 2) ;; tplink,re355-v1|\ tplink,re450-v1) @@ -154,7 +154,7 @@ case "$FIRMWARE" in ;; tplink,tl-wpa8630-v1) caldata_extract "art" 0x5000 0x844 - ath10k_patch_mac $(macaddr_add $(mtd_get_mac_binary u-boot 0x0fc00) +1) + ath10k_patch_mac $(macaddr_add $(mtd_get_mac_binary u-boot 0x0fc00) 1) ;; esac ;; @@ -162,7 +162,7 @@ case "$FIRMWARE" in case $board in sitecom,wlr-8100) caldata_extract "art" 0x5000 0x844 - ath10k_patch_mac $(macaddr_add $(mtd_get_mac_ascii u-boot-env ethaddr) +1) + ath10k_patch_mac $(macaddr_add $(mtd_get_mac_ascii u-boot-env ethaddr) 1) ;; esac ;; @@ -180,7 +180,7 @@ case "$FIRMWARE" in comfast,cf-ew72|\ comfast,cf-wr752ac-v1) caldata_extract "art" 0x5000 0x2f20 - ath10k_patch_mac $(macaddr_add $(mtd_get_mac_binary art 0x0) +2) + ath10k_patch_mac $(macaddr_add $(mtd_get_mac_binary art 0x0) 2) ln -sf /lib/firmware/ath10k/pre-cal-pci-0000\:00\:00.0.bin \ /lib/firmware/ath10k/QCA9888/hw2.0/board.bin rm /lib/firmware/ath10k/QCA9888/hw2.0/board-2.bin @@ -237,13 +237,13 @@ case "$FIRMWARE" in tplink,tl-wpa8630p-v2.0-eu|\ tplink,tl-wpa8630p-v2.1-eu) caldata_extract "art" 0x5000 0x2f20 - ath10k_patch_mac $(macaddr_add $(mtd_get_mac_binary info 0x8) +1) + ath10k_patch_mac $(macaddr_add $(mtd_get_mac_binary info 0x8) 1) ln -sf /lib/firmware/ath10k/pre-cal-pci-0000\:00\:00.0.bin \ /lib/firmware/ath10k/QCA9888/hw2.0/board.bin ;; tplink,eap245-v3) caldata_extract "art" 0x5000 0x2f20 - ath10k_patch_mac $(macaddr_add $(mtd_get_mac_binary info 0x8) +1) + ath10k_patch_mac $(macaddr_add $(mtd_get_mac_binary info 0x8) 1) ;; yuncore,a782|\ yuncore,xd4200) diff --git a/target/linux/ath79/mikrotik/base-files/etc/hotplug.d/firmware/10-ath9k-eeprom b/target/linux/ath79/mikrotik/base-files/etc/hotplug.d/firmware/10-ath9k-eeprom index 7ef6fdbe0f..d9425d4437 100644 --- a/target/linux/ath79/mikrotik/base-files/etc/hotplug.d/firmware/10-ath9k-eeprom +++ b/target/linux/ath79/mikrotik/base-files/etc/hotplug.d/firmware/10-ath9k-eeprom @@ -26,10 +26,10 @@ case "$FIRMWARE" in mikrotik,routerboard-lhg-2nd|\ mikrotik,routerboard-sxt-5nd-r2|\ mikrotik,routerboard-wapr-2nd) - caldata_mikrotik_ath9k 0x1000 0x440 $(macaddr_add "$mac_base" +1) + caldata_mikrotik_ath9k 0x1000 0x440 $(macaddr_add "$mac_base" 1) ;; mikrotik,routerboard-wap-g-5hact2hnd) - caldata_mikrotik_ath9k 0x1000 0x440 $(macaddr_add "$mac_base" +2) + caldata_mikrotik_ath9k 0x1000 0x440 $(macaddr_add "$mac_base" 2) ;; *) caldata_die "board $board is not supported yet" diff --git a/target/linux/ath79/nand/base-files/etc/hotplug.d/firmware/11-ath10k-caldata b/target/linux/ath79/nand/base-files/etc/hotplug.d/firmware/11-ath10k-caldata index d5fd3db24d..f8cc8f1a2b 100644 --- a/target/linux/ath79/nand/base-files/etc/hotplug.d/firmware/11-ath10k-caldata +++ b/target/linux/ath79/nand/base-files/etc/hotplug.d/firmware/11-ath10k-caldata @@ -16,11 +16,11 @@ case "$FIRMWARE" in glinet,gl-ar750s-nor|\ glinet,gl-ar750s-nor-nand) caldata_extract "art" 0x5000 0x844 - ath10k_patch_mac $(macaddr_add $(mtd_get_mac_binary art 0x0) +1) + ath10k_patch_mac $(macaddr_add $(mtd_get_mac_binary art 0x0) 1) ;; zyxel,nbg6716) caldata_extract "art" 0x5000 0x844 - ath10k_patch_mac $(macaddr_add $(mtd_get_mac_ascii u-boot-env ethaddr) +1) + ath10k_patch_mac $(macaddr_add $(mtd_get_mac_ascii u-boot-env ethaddr) 1) ;; esac ;; diff --git a/target/linux/ipq40xx/base-files/etc/hotplug.d/firmware/11-ath10k-caldata b/target/linux/ipq40xx/base-files/etc/hotplug.d/firmware/11-ath10k-caldata index 42cb295496..87876ad844 100644 --- a/target/linux/ipq40xx/base-files/etc/hotplug.d/firmware/11-ath10k-caldata +++ b/target/linux/ipq40xx/base-files/etc/hotplug.d/firmware/11-ath10k-caldata @@ -12,7 +12,7 @@ case "$FIRMWARE" in meraki,mr33) caldata_extract_ubi "ART" 0x9000 0x844 caldata_valid "4408" || caldata_extract "ART" 0x9000 0x844 - ath10k_patch_mac $(macaddr_add $(get_mac_binary "/sys/bus/i2c/devices/0-0050/eeprom" 0x66) +1) + ath10k_patch_mac $(macaddr_add $(get_mac_binary "/sys/bus/i2c/devices/0-0050/eeprom" 0x66) 1) ;; esac ;; @@ -128,7 +128,7 @@ case "$FIRMWARE" in ;; engenius,ens620ext) caldata_extract "ART" 0x1000 0x2f20 - ath10k_patch_mac $(macaddr_add $(mtd_get_mac_ascii u-boot-env ethaddr) +2) + ath10k_patch_mac $(macaddr_add $(mtd_get_mac_ascii u-boot-env ethaddr) 2) ;; linksys,ea8300 |\ linksys,mr8300) @@ -138,7 +138,7 @@ case "$FIRMWARE" in meraki,mr33) caldata_extract_ubi "ART" 0x1000 0x2f20 caldata_valid "202f" || caldata_extract "ART" 0x1000 0x2f20 - ath10k_patch_mac $(macaddr_add $(get_mac_binary "/sys/bus/i2c/devices/0-0050/eeprom" 0x66) +2) + ath10k_patch_mac $(macaddr_add $(get_mac_binary "/sys/bus/i2c/devices/0-0050/eeprom" 0x66) 2) ;; mikrotik,hap-ac2) wlan_data="/sys/firmware/mikrotik/hard_config/wlan_data" @@ -180,7 +180,7 @@ case "$FIRMWARE" in aruba,ap-303h |\ aruba,ap-365) caldata_extract "ART" 0x5000 0x2f20 - ath10k_patch_mac $(macaddr_add $(mtd_get_mac_binary mfginfo 0x1D) +1) + ath10k_patch_mac $(macaddr_add $(mtd_get_mac_binary mfginfo 0x1D) 1) ;; asus,map-ac2200) caldata_extract_ubi "Factory" 0x5000 0x2f20 @@ -233,15 +233,15 @@ case "$FIRMWARE" in ;; engenius,emd1) caldata_extract "0:ART" 0x5000 0x2f20 - ath10k_patch_mac $(macaddr_add $(mtd_get_mac_ascii 0:APPSBLENV wlanaddr) +1) + ath10k_patch_mac $(macaddr_add $(mtd_get_mac_ascii 0:APPSBLENV wlanaddr) 1) ;; engenius,emr3500) caldata_extract "0:ART" 0x5000 0x2f20 - ath10k_patch_mac $(macaddr_add $(mtd_get_mac_ascii 0:APPSBLENV ethaddr) +1) + ath10k_patch_mac $(macaddr_add $(mtd_get_mac_ascii 0:APPSBLENV ethaddr) 1) ;; engenius,ens620ext) caldata_extract "ART" 0x5000 0x2f20 - ath10k_patch_mac $(macaddr_add $(mtd_get_mac_ascii u-boot-env ethaddr) +3) + ath10k_patch_mac $(macaddr_add $(mtd_get_mac_ascii u-boot-env ethaddr) 3) ;; linksys,ea8300 |\ linksys,mr8300) @@ -251,7 +251,7 @@ case "$FIRMWARE" in meraki,mr33) caldata_extract_ubi "ART" 0x5000 0x2f20 caldata_valid "202f" || caldata_extract "ART" 0x5000 0x2f20 - ath10k_patch_mac $(macaddr_add $(get_mac_binary "/sys/bus/i2c/devices/0-0050/eeprom" 0x66) +3) + ath10k_patch_mac $(macaddr_add $(get_mac_binary "/sys/bus/i2c/devices/0-0050/eeprom" 0x66) 3) ;; mikrotik,hap-ac2|\ mikrotik,sxtsq-5-ac) @@ -266,7 +266,7 @@ case "$FIRMWARE" in ;; netgear,wac510) caldata_extract "0:ART" 0x5000 0x2f20 - ath10k_patch_mac $(macaddr_add $(mtd_get_mac_binary "0:MANUDATA" 0x6) +16) + ath10k_patch_mac $(macaddr_add $(mtd_get_mac_binary "0:MANUDATA" 0x6) 16) ;; zyxel,nbg6617 |\ zyxel,wre6606) diff --git a/target/linux/ipq40xx/base-files/lib/preinit/05_set_iface_mac_ipq40xx.sh b/target/linux/ipq40xx/base-files/lib/preinit/05_set_iface_mac_ipq40xx.sh index 0d606c75b5..51ba7071e7 100644 --- a/target/linux/ipq40xx/base-files/lib/preinit/05_set_iface_mac_ipq40xx.sh +++ b/target/linux/ipq40xx/base-files/lib/preinit/05_set_iface_mac_ipq40xx.sh @@ -4,8 +4,8 @@ preinit_set_mac_address() { case $(board_name) in asus,map-ac2200) base_mac=$(mtd_get_mac_binary_ubi Factory 0x1006) - ip link set dev eth0 address $(macaddr_add "$base_mac" +1) - ip link set dev eth1 address $(macaddr_add "$base_mac" +3) + ip link set dev eth0 address $(macaddr_add "$base_mac" 1) + ip link set dev eth1 address $(macaddr_add "$base_mac" 3) ;; ezviz,cs-w3-wd1200g-eup) ip link set dev eth0 address $(mtd_get_mac_binary "ART" 0x6) @@ -13,13 +13,13 @@ preinit_set_mac_address() { ;; engenius,eap2200) base_mac=$(cat /sys/class/net/eth0/address) - ip link set dev eth1 address $(macaddr_add "${base_mac}" +1) + ip link set dev eth1 address $(macaddr_add "$base_mac" 1) ;; linksys,ea8300|\ linksys,mr8300) base_mac=$(mtd_get_mac_ascii devinfo hw_mac_addr) - ip link set dev eth0 address "${base_mac}" - ip link set dev eth1 address $(macaddr_add "${base_mac}" 1) + ip link set dev eth0 address "$base_mac" + ip link set dev eth1 address $(macaddr_add "$base_mac" 1) ;; meraki,mr33) mac_lan=$(get_mac_binary "/sys/bus/i2c/devices/0-0050/eeprom" 0x66) @@ -27,8 +27,8 @@ preinit_set_mac_address() { ;; zyxel,nbg6617) base_mac=$(cat /sys/class/net/eth0/address) - ip link set dev eth0 address $(macaddr_add "$base_mac" +2) - ip link set dev eth1 address $(macaddr_add "$base_mac" +3) + ip link set dev eth0 address $(macaddr_add "$base_mac" 2) + ip link set dev eth1 address $(macaddr_add "$base_mac" 3) esac } diff --git a/target/linux/ipq806x/base-files/etc/hotplug.d/firmware/11-ath10k-caldata b/target/linux/ipq806x/base-files/etc/hotplug.d/firmware/11-ath10k-caldata index 5592590d52..d2bdf034b7 100644 --- a/target/linux/ipq806x/base-files/etc/hotplug.d/firmware/11-ath10k-caldata +++ b/target/linux/ipq806x/base-files/etc/hotplug.d/firmware/11-ath10k-caldata @@ -33,7 +33,7 @@ case "$FIRMWARE" in linksys,ea7500-v1 |\ linksys,ea8500) caldata_extract "art" 0x1000 0x2f20 - ath10k_patch_mac $(macaddr_add $(mtd_get_mac_ascii devinfo hw_mac_addr) +1) + ath10k_patch_mac $(macaddr_add $(mtd_get_mac_ascii devinfo hw_mac_addr) 1) ;; nec,wg2600hp |\ nec,wg2600hp3) @@ -44,7 +44,7 @@ case "$FIRMWARE" in netgear,r7500v2 |\ netgear,r7800) caldata_extract "art" 0x1000 0x2f20 - ath10k_patch_mac $(macaddr_add $(mtd_get_mac_binary art 0x6) +1) + ath10k_patch_mac $(macaddr_add $(mtd_get_mac_binary art 0x6) 1) ;; tplink,ad7200 |\ tplink,c2600) @@ -58,11 +58,11 @@ case "$FIRMWARE" in zyxel,nbg6817) if [ -b "$(find_mtd_part 0:art)" ]; then caldata_extract "0:art" 0x1000 0x2f20 - ath10k_patch_mac $(macaddr_add $(mtd_get_mac_ascii 0:appsblenv ethaddr) +1) + ath10k_patch_mac $(macaddr_add $(mtd_get_mac_ascii 0:appsblenv ethaddr) 1) else # XXX: drop upper case after kernel v5.4 is gone (qcom-smem) caldata_extract "0:ART" 0x1000 0x2f20 - ath10k_patch_mac $(macaddr_add $(mtd_get_mac_ascii 0:APPSBLENV ethaddr) +1) + ath10k_patch_mac $(macaddr_add $(mtd_get_mac_ascii 0:APPSBLENV ethaddr) 1) fi ;; esac @@ -85,7 +85,7 @@ case "$FIRMWARE" in linksys,ea7500-v1 |\ linksys,ea8500) caldata_extract "art" 0x5000 0x2f20 - ath10k_patch_mac $(macaddr_add $(mtd_get_mac_ascii devinfo hw_mac_addr) +2) + ath10k_patch_mac $(macaddr_add $(mtd_get_mac_ascii devinfo hw_mac_addr) 2) ;; nec,wg2600hp |\ nec,wg2600hp3) @@ -96,7 +96,7 @@ case "$FIRMWARE" in netgear,r7500v2 |\ netgear,r7800) caldata_extract "art" 0x5000 0x2f20 - ath10k_patch_mac $(macaddr_add $(mtd_get_mac_binary art 0x6) +2) + ath10k_patch_mac $(macaddr_add $(mtd_get_mac_binary art 0x6) 2) ;; tplink,ad7200 |\ tplink,c2600) diff --git a/target/linux/lantiq/xrx200/base-files/etc/hotplug.d/firmware/11-ath10k-caldata b/target/linux/lantiq/xrx200/base-files/etc/hotplug.d/firmware/11-ath10k-caldata index 4202187d4f..c555aa2c12 100644 --- a/target/linux/lantiq/xrx200/base-files/etc/hotplug.d/firmware/11-ath10k-caldata +++ b/target/linux/lantiq/xrx200/base-files/etc/hotplug.d/firmware/11-ath10k-caldata @@ -10,7 +10,7 @@ case "$FIRMWARE" in case $board in bt,homehub-v5a) caldata_extract_ubi "caldata" 0x5000 0x844 - ath10k_patch_mac $(macaddr_add $(mtd_get_mac_binary_ubi caldata 0x110c) +3) + ath10k_patch_mac $(macaddr_add $(mtd_get_mac_binary_ubi caldata 0x110c) 3) ;; *) caldata_die "board $board is not supported yet" diff --git a/target/linux/lantiq/xrx200/base-files/etc/hotplug.d/firmware/12-ath9k-eeprom b/target/linux/lantiq/xrx200/base-files/etc/hotplug.d/firmware/12-ath9k-eeprom index 03664b3fd3..09d26f7f85 100644 --- a/target/linux/lantiq/xrx200/base-files/etc/hotplug.d/firmware/12-ath9k-eeprom +++ b/target/linux/lantiq/xrx200/base-files/etc/hotplug.d/firmware/12-ath9k-eeprom @@ -29,7 +29,7 @@ case "$FIRMWARE" in ;; bt,homehub-v5a) caldata_extract_ubi "caldata" 0x1000 0x1000 - ath9k_patch_mac_crc $(macaddr_add $(mtd_get_mac_binary_ubi caldata 0x110c) +2) 0x10c + ath9k_patch_mac_crc $(macaddr_add $(mtd_get_mac_binary_ubi caldata 0x110c) 2) 0x10c ;; tplink,tdw8970|\ tplink,tdw8980) diff --git a/target/linux/lantiq/xway/base-files/etc/hotplug.d/firmware/12-ath9k-eeprom b/target/linux/lantiq/xway/base-files/etc/hotplug.d/firmware/12-ath9k-eeprom index 9aea4eed64..98bb9af694 100644 --- a/target/linux/lantiq/xway/base-files/etc/hotplug.d/firmware/12-ath9k-eeprom +++ b/target/linux/lantiq/xway/base-files/etc/hotplug.d/firmware/12-ath9k-eeprom @@ -39,11 +39,11 @@ case "$FIRMWARE" in ;; bt,homehub-v3a) caldata_extract_swap "art-copy" 0x0 0x1000 - ath9k_patch_mac_crc $(macaddr_add $(mtd_get_mac_ascii u-boot-env ethaddr) +2) 0x10c + ath9k_patch_mac_crc $(macaddr_add $(mtd_get_mac_ascii u-boot-env ethaddr) 2) 0x10c ;; netgear,dgn3500|netgear,dgn3500b) caldata_extract "calibration" 0xf000 0x1000 - ath9k_patch_mac_crc $(macaddr_add $(mtd_get_mac_ascii u-boot-env ethaddr) +2) 0x20c + ath9k_patch_mac_crc $(macaddr_add $(mtd_get_mac_ascii u-boot-env ethaddr) 2) 0x20c ;; avm,fritz7312|avm,fritz7320) caldata_extract "urlader" 0x985 0x1000 diff --git a/target/linux/mvebu/cortexa9/base-files/etc/uci-defaults/03_wireless b/target/linux/mvebu/cortexa9/base-files/etc/uci-defaults/03_wireless index 2039aeaf1b..f9526e3d86 100644 --- a/target/linux/mvebu/cortexa9/base-files/etc/uci-defaults/03_wireless +++ b/target/linux/mvebu/cortexa9/base-files/etc/uci-defaults/03_wireless @@ -17,8 +17,8 @@ linksys,wrt1900acs|\ linksys,wrt3200acm|\ linksys,wrt32x) SKU=$(strings /dev/mtd3|sed -ne 's/^cert_region=//p') - WIFIMAC2G=$(macaddr_add $(mtd_get_mac_ascii devinfo hw_mac_addr) +1) - WIFIMAC5G=$(macaddr_add $WIFIMAC2G +1) + WIFIMAC2G=$(macaddr_add $(mtd_get_mac_ascii devinfo hw_mac_addr) 1) + WIFIMAC5G=$(macaddr_add $WIFIMAC2G 1) case "$SKU" in AP) REGD=CN diff --git a/target/linux/rockchip/armv8/base-files/etc/board.d/02_network b/target/linux/rockchip/armv8/base-files/etc/board.d/02_network index f5e88cc148..8371913f8a 100644 --- a/target/linux/rockchip/armv8/base-files/etc/board.d/02_network +++ b/target/linux/rockchip/armv8/base-files/etc/board.d/02_network @@ -33,7 +33,7 @@ rockchip_setup_macs() case "$board" in friendlyarm,nanopi-r2s) wan_mac=$(nanopi_r2s_generate_mac) - lan_mac=$(macaddr_add "$wan_mac" +1) + lan_mac=$(macaddr_add "$wan_mac" 1) ;; esac From da77b9c2f185db72a2917aa2e18f0c8bb164d3c4 Mon Sep 17 00:00:00 2001 From: Rui Salvaterra Date: Thu, 3 Jun 2021 11:12:02 +0100 Subject: [PATCH 20/35] kernel: bump 5.10 to 5.10.42 Deleted (reverse-appliable): generic/pending-5.10/110-perf-jevents-fix-getting-maximum-number-of-fds.patch Manually refreshed: ramips/patches-5.10/835-asoc-add-mt7620-support.patch Signed-off-by: Rui Salvaterra --- include/kernel-version.mk | 4 +-- ...support-for-boot-console-with-arbitr.patch | 2 +- ...ow_offload-handle-netdevice-events-f.patch | 2 +- ...pi-poll-functionality-to-__napi_poll.patch | 8 ++--- ...threaded-able-napi-poll-loop-support.patch | 10 +++---- ...tribute-to-control-napi-threaded-mod.patch | 4 +-- ...ween-napi-kthread-mode-and-busy-poll.patch | 6 ++-- ...up-on-napi_disable-for-threaded-napi.patch | 4 +-- ...ble-separate-replace-destroy-and-sta.patch | 6 ++-- ...ble-consolidate-skb_try_make_writabl.patch | 8 ++--- ...ble-move-FLOW_OFFLOAD_DIR_MAX-away-f.patch | 4 +-- ...wtable-fast-NAT-functions-never-fail.patch | 10 +++---- ...-forwarding-path-for-dsa-slave-ports.patch | 4 +-- ...filter-flowtable-add-xmit-path-types.patch | 2 +- ...ble-use-dev_fill_forward_path-to-obt.patch | 2 +- ...ble-use-dev_fill_forward_path-to-obt.patch | 2 +- ...netfilter-flowtable-add-vlan-support.patch | 2 +- ...ow_offload-use-direct-xmit-if-hardwa.patch | 2 +- ...ble-bridge-vlan-hardware-offload-and.patch | 2 +- ...sa-slave-add-support-for-TC_SETUP_FT.patch | 2 +- ...k_eth_soc-fix-parsing-packets-in-GDM.patch | 6 ++-- ..._eth_soc-add-support-for-initializin.patch | 16 +++++----- ..._eth_soc-add-flow-offloading-support.patch | 8 ++--- ..._eth_soc-unmap-RX-data-before-callin.patch | 4 +-- ...et-mtk_eth_soc-fix-build_skb-cleanup.patch | 4 +-- ...net-mtk_eth_soc-use-napi_consume_skb.patch | 12 ++++---- ..._eth_soc-remove-unnecessary-TX-queue.patch | 6 ++-- ..._eth_soc-use-larger-burst-size-for-Q.patch | 2 +- ..._eth_soc-implement-dynamic-interrupt.patch | 30 +++++++++---------- ..._eth_soc-cache-HW-pointer-of-last-fr.patch | 12 ++++---- ..._eth_soc-only-read-the-full-RX-descr.patch | 4 +-- ..._eth_soc-reduce-unnecessary-interrup.patch | 4 +-- ...et-mtk_eth_soc-rework-NAPI-callbacks.patch | 6 ++-- ..._eth_soc-set-PPE-flow-hash-as-skb-ha.patch | 4 +-- ..._eth_soc-use-iopoll.h-macro-for-DMA-.patch | 2 +- ...r-when-a-non-legacy-FDB-operation-fa.patch | 4 +-- ...e-switchdev_notifier_fdb_info-in-dsa.patch | 8 ++--- ...tchdev-event-implementation-under-th.patch | 4 +-- ...ly-in-dsa_slave_switchdev_event-if-w.patch | 2 +- ...or-SWITCHDEV_-FDB-DEL-_ADD_TO_DEVICE.patch | 6 ++-- ...-mt7530-Add-support-for-EEE-features.patch | 6 ++-- ...-netfilter-add-xt_FLOWOFFLOAD-target.patch | 6 ++-- .../661-use_fq_codel_by_default.patch | 6 ++-- ...ts-fix-getting-maximum-number-of-fds.patch | 24 --------------- .../pending-5.10/630-packet_socket_type.patch | 16 +++++----- ...T-skip-GRO-for-foreign-MAC-addresses.patch | 10 +++---- ...local-addresses-in-assisted-CPU-port.patch | 2 +- ...bridge-addresses-in-assisted-CPU-por.patch | 2 +- ...tic-FDB-entries-on-foreign-interface.patch | 4 +-- .../patches-5.10/410-bt-mtk-serial-fix.patch | 2 +- ..._eth_soc-add-support-for-coherent-DM.patch | 6 ++-- .../323-mt7621-memory-detect.patch | 2 +- ...ethernet-mediatek-support-net-labels.patch | 4 +-- .../835-asoc-add-mt7620-support.patch | 18 ----------- 54 files changed, 148 insertions(+), 190 deletions(-) delete mode 100644 target/linux/generic/pending-5.10/110-perf-jevents-fix-getting-maximum-number-of-fds.patch diff --git a/include/kernel-version.mk b/include/kernel-version.mk index 7ea028d9d3..de25e1a9c7 100644 --- a/include/kernel-version.mk +++ b/include/kernel-version.mk @@ -7,10 +7,10 @@ ifdef CONFIG_TESTING_KERNEL endif LINUX_VERSION-5.4 = .123 -LINUX_VERSION-5.10 = .41 +LINUX_VERSION-5.10 = .42 LINUX_KERNEL_HASH-5.4.123 = 8efe33fffb661d14422877b775fb38de373e04ad640f5d0c8f57144ddb1022de -LINUX_KERNEL_HASH-5.10.41 = f604759de80767c4f8bdc500eec730dc161bc914a48bd366b748c176701a6771 +LINUX_KERNEL_HASH-5.10.42 = 8ba027c73bd67b8ded2649a741d2f018db630c1cbc081700d8ffd07ab0d906e5 remove_uri_prefix=$(subst git://,,$(subst http://,,$(subst https://,,$(1)))) sanitize_uri=$(call qstrip,$(subst @,_,$(subst :,_,$(subst .,_,$(subst -,_,$(subst /,_,$(1))))))) diff --git a/target/linux/ath79/patches-5.10/921-serial-core-add-support-for-boot-console-with-arbitr.patch b/target/linux/ath79/patches-5.10/921-serial-core-add-support-for-boot-console-with-arbitr.patch index ef4a349ea7..9785fbfe54 100644 --- a/target/linux/ath79/patches-5.10/921-serial-core-add-support-for-boot-console-with-arbitr.patch +++ b/target/linux/ath79/patches-5.10/921-serial-core-add-support-for-boot-console-with-arbitr.patch @@ -30,7 +30,7 @@ Signed-off-by: Sungbo Eo uport->cons->cflag = 0; } /* -@@ -2121,8 +2123,10 @@ uart_set_options(struct uart_port *port, +@@ -2123,8 +2125,10 @@ uart_set_options(struct uart_port *port, * Allow the setting of the UART parameters with a NULL console * too: */ diff --git a/target/linux/generic/backport-5.10/343-netfilter-nft_flow_offload-handle-netdevice-events-f.patch b/target/linux/generic/backport-5.10/343-netfilter-nft_flow_offload-handle-netdevice-events-f.patch index 137264cb9f..d300af3342 100644 --- a/target/linux/generic/backport-5.10/343-netfilter-nft_flow_offload-handle-netdevice-events-f.patch +++ b/target/linux/generic/backport-5.10/343-netfilter-nft_flow_offload-handle-netdevice-events-f.patch @@ -10,7 +10,7 @@ Signed-off-by: Pablo Neira Ayuso --- a/net/netfilter/nf_flow_table_core.c +++ b/net/netfilter/nf_flow_table_core.c -@@ -577,13 +577,41 @@ void nf_flow_table_free(struct nf_flowta +@@ -576,13 +576,41 @@ void nf_flow_table_free(struct nf_flowta } EXPORT_SYMBOL_GPL(nf_flow_table_free); diff --git a/target/linux/generic/backport-5.10/600-v5.12-net-extract-napi-poll-functionality-to-__napi_poll.patch b/target/linux/generic/backport-5.10/600-v5.12-net-extract-napi-poll-functionality-to-__napi_poll.patch index 6001455615..877ccb2aee 100644 --- a/target/linux/generic/backport-5.10/600-v5.12-net-extract-napi-poll-functionality-to-__napi_poll.patch +++ b/target/linux/generic/backport-5.10/600-v5.12-net-extract-napi-poll-functionality-to-__napi_poll.patch @@ -18,7 +18,7 @@ Signed-off-by: David S. Miller --- a/net/core/dev.c +++ b/net/core/dev.c -@@ -6753,15 +6753,10 @@ void __netif_napi_del(struct napi_struct +@@ -6772,15 +6772,10 @@ void __netif_napi_del(struct napi_struct } EXPORT_SYMBOL(__netif_napi_del); @@ -35,7 +35,7 @@ Signed-off-by: David S. Miller weight = n->weight; /* This NAPI_STATE_SCHED test is for avoiding a race -@@ -6781,7 +6776,7 @@ static int napi_poll(struct napi_struct +@@ -6800,7 +6795,7 @@ static int napi_poll(struct napi_struct n->poll, work, weight); if (likely(work < weight)) @@ -44,7 +44,7 @@ Signed-off-by: David S. Miller /* Drivers must not modify the NAPI state if they * consume the entire weight. In such cases this code -@@ -6790,7 +6785,7 @@ static int napi_poll(struct napi_struct +@@ -6809,7 +6804,7 @@ static int napi_poll(struct napi_struct */ if (unlikely(napi_disable_pending(n))) { napi_complete(n); @@ -53,7 +53,7 @@ Signed-off-by: David S. Miller } if (n->gro_bitmask) { -@@ -6808,12 +6803,29 @@ static int napi_poll(struct napi_struct +@@ -6827,12 +6822,29 @@ static int napi_poll(struct napi_struct if (unlikely(!list_empty(&n->poll_list))) { pr_warn_once("%s: Budget exhausted after napi rescheduled\n", n->dev ? n->dev->name : "backlog"); diff --git a/target/linux/generic/backport-5.10/601-v5.12-net-implement-threaded-able-napi-poll-loop-support.patch b/target/linux/generic/backport-5.10/601-v5.12-net-implement-threaded-able-napi-poll-loop-support.patch index 832c2839da..43267b5d74 100644 --- a/target/linux/generic/backport-5.10/601-v5.12-net-implement-threaded-able-napi-poll-loop-support.patch +++ b/target/linux/generic/backport-5.10/601-v5.12-net-implement-threaded-able-napi-poll-loop-support.patch @@ -131,7 +131,7 @@ Signed-off-by: David S. Miller static int __dev_open(struct net_device *dev, struct netlink_ext_ack *extack) { const struct net_device_ops *ops = dev->netdev_ops; -@@ -4254,6 +4276,21 @@ int gro_normal_batch __read_mostly = 8; +@@ -4255,6 +4277,21 @@ int gro_normal_batch __read_mostly = 8; static inline void ____napi_schedule(struct softnet_data *sd, struct napi_struct *napi) { @@ -153,7 +153,7 @@ Signed-off-by: David S. Miller list_add_tail(&napi->poll_list, &sd->poll_list); __raise_softirq_irqoff(NET_RX_SOFTIRQ); } -@@ -6706,6 +6743,12 @@ void netif_napi_add(struct net_device *d +@@ -6725,6 +6762,12 @@ void netif_napi_add(struct net_device *d set_bit(NAPI_STATE_NPSVC, &napi->state); list_add_rcu(&napi->dev_list, &dev->napi_list); napi_hash_add(napi); @@ -166,7 +166,7 @@ Signed-off-by: David S. Miller } EXPORT_SYMBOL(netif_napi_add); -@@ -6722,9 +6765,28 @@ void napi_disable(struct napi_struct *n) +@@ -6741,9 +6784,28 @@ void napi_disable(struct napi_struct *n) hrtimer_cancel(&n->timer); clear_bit(NAPI_STATE_DISABLE, &n->state); @@ -195,7 +195,7 @@ Signed-off-by: David S. Miller static void flush_gro_hash(struct napi_struct *napi) { int i; -@@ -6750,6 +6812,11 @@ void __netif_napi_del(struct napi_struct +@@ -6769,6 +6831,11 @@ void __netif_napi_del(struct napi_struct flush_gro_hash(napi); napi->gro_bitmask = 0; @@ -207,7 +207,7 @@ Signed-off-by: David S. Miller } EXPORT_SYMBOL(__netif_napi_del); -@@ -6831,6 +6898,51 @@ static int napi_poll(struct napi_struct +@@ -6850,6 +6917,51 @@ static int napi_poll(struct napi_struct return work; } diff --git a/target/linux/generic/backport-5.10/602-v5.12-net-add-sysfs-attribute-to-control-napi-threaded-mod.patch b/target/linux/generic/backport-5.10/602-v5.12-net-add-sysfs-attribute-to-control-napi-threaded-mod.patch index d205ebb6b4..c54e2b2fe2 100644 --- a/target/linux/generic/backport-5.10/602-v5.12-net-add-sysfs-attribute-to-control-napi-threaded-mod.patch +++ b/target/linux/generic/backport-5.10/602-v5.12-net-add-sysfs-attribute-to-control-napi-threaded-mod.patch @@ -57,7 +57,7 @@ Signed-off-by: David S. Miller * @n: NAPI context --- a/net/core/dev.c +++ b/net/core/dev.c -@@ -4280,8 +4280,9 @@ static inline void ____napi_schedule(str +@@ -4281,8 +4281,9 @@ static inline void ____napi_schedule(str if (test_bit(NAPI_STATE_THREADED, &napi->state)) { /* Paired with smp_mb__before_atomic() in @@ -69,7 +69,7 @@ Signed-off-by: David S. Miller * wake_up_process() when it's not NULL. */ thread = READ_ONCE(napi->thread); -@@ -6716,6 +6717,49 @@ static void init_gro_hash(struct napi_st +@@ -6735,6 +6736,49 @@ static void init_gro_hash(struct napi_st napi->gro_bitmask = 0; } diff --git a/target/linux/generic/backport-5.10/603-v5.12-net-fix-race-between-napi-kthread-mode-and-busy-poll.patch b/target/linux/generic/backport-5.10/603-v5.12-net-fix-race-between-napi-kthread-mode-and-busy-poll.patch index 92e7ec9e85..cff4e8b173 100644 --- a/target/linux/generic/backport-5.10/603-v5.12-net-fix-race-between-napi-kthread-mode-and-busy-poll.patch +++ b/target/linux/generic/backport-5.10/603-v5.12-net-fix-race-between-napi-kthread-mode-and-busy-poll.patch @@ -45,7 +45,7 @@ Cc: Hannes Frederic Sowa enum gro_result { --- a/net/core/dev.c +++ b/net/core/dev.c -@@ -4287,6 +4287,8 @@ static inline void ____napi_schedule(str +@@ -4288,6 +4288,8 @@ static inline void ____napi_schedule(str */ thread = READ_ONCE(napi->thread); if (thread) { @@ -54,7 +54,7 @@ Cc: Hannes Frederic Sowa wake_up_process(thread); return; } -@@ -6508,7 +6510,8 @@ bool napi_complete_done(struct napi_stru +@@ -6527,7 +6529,8 @@ bool napi_complete_done(struct napi_stru WARN_ON_ONCE(!(val & NAPIF_STATE_SCHED)); @@ -64,7 +64,7 @@ Cc: Hannes Frederic Sowa /* If STATE_MISSED was set, leave STATE_SCHED set, * because we will call napi->poll() one more time. -@@ -6944,16 +6947,25 @@ static int napi_poll(struct napi_struct +@@ -6963,16 +6966,25 @@ static int napi_poll(struct napi_struct static int napi_thread_wait(struct napi_struct *napi) { diff --git a/target/linux/generic/backport-5.10/604-v5.12-net-fix-hangup-on-napi_disable-for-threaded-napi.patch b/target/linux/generic/backport-5.10/604-v5.12-net-fix-hangup-on-napi_disable-for-threaded-napi.patch index 4b83641291..0b7639af1c 100644 --- a/target/linux/generic/backport-5.10/604-v5.12-net-fix-hangup-on-napi_disable-for-threaded-napi.patch +++ b/target/linux/generic/backport-5.10/604-v5.12-net-fix-hangup-on-napi_disable-for-threaded-napi.patch @@ -34,7 +34,7 @@ Signed-off-by: Jakub Kicinski --- a/net/core/dev.c +++ b/net/core/dev.c -@@ -6951,7 +6951,7 @@ static int napi_thread_wait(struct napi_ +@@ -6970,7 +6970,7 @@ static int napi_thread_wait(struct napi_ set_current_state(TASK_INTERRUPTIBLE); @@ -43,7 +43,7 @@ Signed-off-by: Jakub Kicinski /* Testing SCHED_THREADED bit here to make sure the current * kthread owns this napi and could poll on this napi. * Testing SCHED bit is not enough because SCHED bit might be -@@ -6969,6 +6969,7 @@ static int napi_thread_wait(struct napi_ +@@ -6988,6 +6988,7 @@ static int napi_thread_wait(struct napi_ set_current_state(TASK_INTERRUPTIBLE); } __set_current_state(TASK_RUNNING); diff --git a/target/linux/generic/backport-5.10/610-v5.13-01-netfilter-flowtable-separate-replace-destroy-and-sta.patch b/target/linux/generic/backport-5.10/610-v5.13-01-netfilter-flowtable-separate-replace-destroy-and-sta.patch index 86184dd450..957b741eac 100644 --- a/target/linux/generic/backport-5.10/610-v5.13-01-netfilter-flowtable-separate-replace-destroy-and-sta.patch +++ b/target/linux/generic/backport-5.10/610-v5.13-01-netfilter-flowtable-separate-replace-destroy-and-sta.patch @@ -30,7 +30,7 @@ Signed-off-by: Pablo Neira Ayuso struct flow_offload_work { struct list_head list; -@@ -826,7 +828,12 @@ static void flow_offload_work_handler(st +@@ -827,7 +829,12 @@ static void flow_offload_work_handler(st static void flow_offload_queue_work(struct flow_offload_work *offload) { @@ -44,7 +44,7 @@ Signed-off-by: Pablo Neira Ayuso } static struct flow_offload_work * -@@ -898,8 +905,11 @@ void nf_flow_offload_stats(struct nf_flo +@@ -899,8 +906,11 @@ void nf_flow_offload_stats(struct nf_flo void nf_flow_table_offload_flush(struct nf_flowtable *flowtable) { @@ -58,7 +58,7 @@ Signed-off-by: Pablo Neira Ayuso } static int nf_flow_table_block_setup(struct nf_flowtable *flowtable, -@@ -1011,15 +1021,33 @@ EXPORT_SYMBOL_GPL(nf_flow_table_offload_ +@@ -1012,15 +1022,33 @@ EXPORT_SYMBOL_GPL(nf_flow_table_offload_ int nf_flow_table_offload_init(void) { diff --git a/target/linux/generic/backport-5.10/610-v5.13-04-netfilter-flowtable-consolidate-skb_try_make_writabl.patch b/target/linux/generic/backport-5.10/610-v5.13-04-netfilter-flowtable-consolidate-skb_try_make_writabl.patch index 2a4ecbaf53..9fd01b465e 100644 --- a/target/linux/generic/backport-5.10/610-v5.13-04-netfilter-flowtable-consolidate-skb_try_make_writabl.patch +++ b/target/linux/generic/backport-5.10/610-v5.13-04-netfilter-flowtable-consolidate-skb_try_make_writabl.patch @@ -14,7 +14,7 @@ Signed-off-by: Pablo Neira Ayuso --- a/net/netfilter/nf_flow_table_core.c +++ b/net/netfilter/nf_flow_table_core.c -@@ -395,9 +395,6 @@ static int nf_flow_nat_port_tcp(struct s +@@ -394,9 +394,6 @@ static int nf_flow_nat_port_tcp(struct s { struct tcphdr *tcph; @@ -24,7 +24,7 @@ Signed-off-by: Pablo Neira Ayuso tcph = (void *)(skb_network_header(skb) + thoff); inet_proto_csum_replace2(&tcph->check, skb, port, new_port, false); -@@ -409,9 +406,6 @@ static int nf_flow_nat_port_udp(struct s +@@ -408,9 +405,6 @@ static int nf_flow_nat_port_udp(struct s { struct udphdr *udph; @@ -34,7 +34,7 @@ Signed-off-by: Pablo Neira Ayuso udph = (void *)(skb_network_header(skb) + thoff); if (udph->check || skb->ip_summed == CHECKSUM_PARTIAL) { inet_proto_csum_replace2(&udph->check, skb, port, -@@ -447,9 +441,6 @@ int nf_flow_snat_port(const struct flow_ +@@ -446,9 +440,6 @@ int nf_flow_snat_port(const struct flow_ struct flow_ports *hdr; __be16 port, new_port; @@ -44,7 +44,7 @@ Signed-off-by: Pablo Neira Ayuso hdr = (void *)(skb_network_header(skb) + thoff); switch (dir) { -@@ -478,9 +469,6 @@ int nf_flow_dnat_port(const struct flow_ +@@ -477,9 +468,6 @@ int nf_flow_dnat_port(const struct flow_ struct flow_ports *hdr; __be16 port, new_port; diff --git a/target/linux/generic/backport-5.10/610-v5.13-06-netfilter-flowtable-move-FLOW_OFFLOAD_DIR_MAX-away-f.patch b/target/linux/generic/backport-5.10/610-v5.13-06-netfilter-flowtable-move-FLOW_OFFLOAD_DIR_MAX-away-f.patch index 473647dcbb..64a0e42079 100644 --- a/target/linux/generic/backport-5.10/610-v5.13-06-netfilter-flowtable-move-FLOW_OFFLOAD_DIR_MAX-away-f.patch +++ b/target/linux/generic/backport-5.10/610-v5.13-06-netfilter-flowtable-move-FLOW_OFFLOAD_DIR_MAX-away-f.patch @@ -24,7 +24,7 @@ Signed-off-by: Pablo Neira Ayuso union { --- a/net/netfilter/nf_flow_table_core.c +++ b/net/netfilter/nf_flow_table_core.c -@@ -454,8 +454,6 @@ int nf_flow_snat_port(const struct flow_ +@@ -453,8 +453,6 @@ int nf_flow_snat_port(const struct flow_ new_port = flow->tuplehash[FLOW_OFFLOAD_DIR_ORIGINAL].tuple.src_port; hdr->dest = new_port; break; @@ -33,7 +33,7 @@ Signed-off-by: Pablo Neira Ayuso } return nf_flow_nat_port(skb, thoff, protocol, port, new_port); -@@ -482,8 +480,6 @@ int nf_flow_dnat_port(const struct flow_ +@@ -481,8 +479,6 @@ int nf_flow_dnat_port(const struct flow_ new_port = flow->tuplehash[FLOW_OFFLOAD_DIR_ORIGINAL].tuple.dst_port; hdr->source = new_port; break; diff --git a/target/linux/generic/backport-5.10/610-v5.13-07-netfilter-flowtable-fast-NAT-functions-never-fail.patch b/target/linux/generic/backport-5.10/610-v5.13-07-netfilter-flowtable-fast-NAT-functions-never-fail.patch index 71bb394fe2..2224e095c9 100644 --- a/target/linux/generic/backport-5.10/610-v5.13-07-netfilter-flowtable-fast-NAT-functions-never-fail.patch +++ b/target/linux/generic/backport-5.10/610-v5.13-07-netfilter-flowtable-fast-NAT-functions-never-fail.patch @@ -11,7 +11,7 @@ Signed-off-by: Pablo Neira Ayuso --- a/include/net/netfilter/nf_flow_table.h +++ b/include/net/netfilter/nf_flow_table.h -@@ -229,12 +229,12 @@ void nf_flow_table_free(struct nf_flowta +@@ -228,12 +228,12 @@ void nf_flow_table_free(struct nf_flowta void flow_offload_teardown(struct flow_offload *flow); @@ -32,7 +32,7 @@ Signed-off-by: Pablo Neira Ayuso __be16 source, dest; --- a/net/netfilter/nf_flow_table_core.c +++ b/net/netfilter/nf_flow_table_core.c -@@ -389,20 +389,17 @@ static void nf_flow_offload_work_gc(stru +@@ -388,20 +388,17 @@ static void nf_flow_offload_work_gc(stru queue_delayed_work(system_power_efficient_wq, &flow_table->gc_work, HZ); } @@ -57,7 +57,7 @@ Signed-off-by: Pablo Neira Ayuso { struct udphdr *udph; -@@ -413,30 +410,24 @@ static int nf_flow_nat_port_udp(struct s +@@ -412,30 +409,24 @@ static int nf_flow_nat_port_udp(struct s if (!udph->check) udph->check = CSUM_MANGLED_0; } @@ -95,7 +95,7 @@ Signed-off-by: Pablo Neira Ayuso { struct flow_ports *hdr; __be16 port, new_port; -@@ -456,13 +447,13 @@ int nf_flow_snat_port(const struct flow_ +@@ -455,13 +446,13 @@ int nf_flow_snat_port(const struct flow_ break; } @@ -113,7 +113,7 @@ Signed-off-by: Pablo Neira Ayuso { struct flow_ports *hdr; __be16 port, new_port; -@@ -482,7 +473,7 @@ int nf_flow_dnat_port(const struct flow_ +@@ -481,7 +472,7 @@ int nf_flow_dnat_port(const struct flow_ break; } diff --git a/target/linux/generic/backport-5.10/610-v5.13-16-net-dsa-resolve-forwarding-path-for-dsa-slave-ports.patch b/target/linux/generic/backport-5.10/610-v5.13-16-net-dsa-resolve-forwarding-path-for-dsa-slave-ports.patch index 62f18a09af..1d3021a575 100644 --- a/target/linux/generic/backport-5.10/610-v5.13-16-net-dsa-resolve-forwarding-path-for-dsa-slave-ports.patch +++ b/target/linux/generic/backport-5.10/610-v5.13-16-net-dsa-resolve-forwarding-path-for-dsa-slave-ports.patch @@ -31,7 +31,7 @@ Signed-off-by: Pablo Neira Ayuso --- a/net/dsa/slave.c +++ b/net/dsa/slave.c -@@ -1617,6 +1617,21 @@ static struct devlink_port *dsa_slave_ge +@@ -1619,6 +1619,21 @@ static struct devlink_port *dsa_slave_ge return dp->ds->devlink ? &dp->devlink_port : NULL; } @@ -53,7 +53,7 @@ Signed-off-by: Pablo Neira Ayuso static const struct net_device_ops dsa_slave_netdev_ops = { .ndo_open = dsa_slave_open, .ndo_stop = dsa_slave_close, -@@ -1642,6 +1657,7 @@ static const struct net_device_ops dsa_s +@@ -1644,6 +1659,7 @@ static const struct net_device_ops dsa_s .ndo_vlan_rx_kill_vid = dsa_slave_vlan_rx_kill_vid, .ndo_get_devlink_port = dsa_slave_get_devlink_port, .ndo_change_mtu = dsa_slave_change_mtu, diff --git a/target/linux/generic/backport-5.10/610-v5.13-17-netfilter-flowtable-add-xmit-path-types.patch b/target/linux/generic/backport-5.10/610-v5.13-17-netfilter-flowtable-add-xmit-path-types.patch index e0fdf49b91..6052f67faa 100644 --- a/target/linux/generic/backport-5.10/610-v5.13-17-netfilter-flowtable-add-xmit-path-types.patch +++ b/target/linux/generic/backport-5.10/610-v5.13-17-netfilter-flowtable-add-xmit-path-types.patch @@ -33,7 +33,7 @@ Signed-off-by: Pablo Neira Ayuso u16 mtu; -@@ -158,7 +164,8 @@ static inline __s32 nf_flow_timeout_delt +@@ -157,7 +163,8 @@ static inline __s32 nf_flow_timeout_delt struct nf_flow_route { struct { diff --git a/target/linux/generic/backport-5.10/610-v5.13-18-netfilter-flowtable-use-dev_fill_forward_path-to-obt.patch b/target/linux/generic/backport-5.10/610-v5.13-18-netfilter-flowtable-use-dev_fill_forward_path-to-obt.patch index 1fe8739ba6..9541ce8867 100644 --- a/target/linux/generic/backport-5.10/610-v5.13-18-netfilter-flowtable-use-dev_fill_forward_path-to-obt.patch +++ b/target/linux/generic/backport-5.10/610-v5.13-18-netfilter-flowtable-use-dev_fill_forward_path-to-obt.patch @@ -20,7 +20,7 @@ Signed-off-by: Pablo Neira Ayuso --- a/include/net/netfilter/nf_flow_table.h +++ b/include/net/netfilter/nf_flow_table.h -@@ -165,6 +165,9 @@ static inline __s32 nf_flow_timeout_delt +@@ -164,6 +164,9 @@ static inline __s32 nf_flow_timeout_delt struct nf_flow_route { struct { struct dst_entry *dst; diff --git a/target/linux/generic/backport-5.10/610-v5.13-19-netfilter-flowtable-use-dev_fill_forward_path-to-obt.patch b/target/linux/generic/backport-5.10/610-v5.13-19-netfilter-flowtable-use-dev_fill_forward_path-to-obt.patch index e42d2558f2..457e218d9b 100644 --- a/target/linux/generic/backport-5.10/610-v5.13-19-netfilter-flowtable-use-dev_fill_forward_path-to-obt.patch +++ b/target/linux/generic/backport-5.10/610-v5.13-19-netfilter-flowtable-use-dev_fill_forward_path-to-obt.patch @@ -49,7 +49,7 @@ Signed-off-by: Pablo Neira Ayuso }; struct flow_offload_tuple_rhash { -@@ -168,6 +175,11 @@ struct nf_flow_route { +@@ -167,6 +174,11 @@ struct nf_flow_route { struct { u32 ifindex; } in; diff --git a/target/linux/generic/backport-5.10/610-v5.13-20-netfilter-flowtable-add-vlan-support.patch b/target/linux/generic/backport-5.10/610-v5.13-20-netfilter-flowtable-add-vlan-support.patch index 976054c5ab..86a1129880 100644 --- a/target/linux/generic/backport-5.10/610-v5.13-20-netfilter-flowtable-add-vlan-support.patch +++ b/target/linux/generic/backport-5.10/610-v5.13-20-netfilter-flowtable-add-vlan-support.patch @@ -46,7 +46,7 @@ Signed-off-by: Pablo Neira Ayuso u16 mtu; union { struct dst_entry *dst_cache; -@@ -174,6 +180,11 @@ struct nf_flow_route { +@@ -173,6 +179,11 @@ struct nf_flow_route { struct dst_entry *dst; struct { u32 ifindex; diff --git a/target/linux/generic/backport-5.10/610-v5.13-26-netfilter-nft_flow_offload-use-direct-xmit-if-hardwa.patch b/target/linux/generic/backport-5.10/610-v5.13-26-netfilter-nft_flow_offload-use-direct-xmit-if-hardwa.patch index 98ecf9886a..56bb9fd56b 100644 --- a/target/linux/generic/backport-5.10/610-v5.13-26-netfilter-nft_flow_offload-use-direct-xmit-if-hardwa.patch +++ b/target/linux/generic/backport-5.10/610-v5.13-26-netfilter-nft_flow_offload-use-direct-xmit-if-hardwa.patch @@ -23,7 +23,7 @@ Signed-off-by: Pablo Neira Ayuso u8 h_source[ETH_ALEN]; u8 h_dest[ETH_ALEN]; } out; -@@ -188,6 +189,7 @@ struct nf_flow_route { +@@ -187,6 +188,7 @@ struct nf_flow_route { } in; struct { u32 ifindex; diff --git a/target/linux/generic/backport-5.10/610-v5.13-27-netfilter-flowtable-bridge-vlan-hardware-offload-and.patch b/target/linux/generic/backport-5.10/610-v5.13-27-netfilter-flowtable-bridge-vlan-hardware-offload-and.patch index 06d75ddea9..7fa58ba844 100644 --- a/target/linux/generic/backport-5.10/610-v5.13-27-netfilter-flowtable-bridge-vlan-hardware-offload-and.patch +++ b/target/linux/generic/backport-5.10/610-v5.13-27-netfilter-flowtable-bridge-vlan-hardware-offload-and.patch @@ -35,7 +35,7 @@ Signed-off-by: Pablo Neira Ayuso u16 mtu; union { struct dst_entry *dst_cache; -@@ -185,7 +186,8 @@ struct nf_flow_route { +@@ -184,7 +185,8 @@ struct nf_flow_route { u16 id; __be16 proto; } encap[NF_FLOW_TABLE_ENCAP_MAX]; diff --git a/target/linux/generic/backport-5.10/610-v5.13-30-dsa-slave-add-support-for-TC_SETUP_FT.patch b/target/linux/generic/backport-5.10/610-v5.13-30-dsa-slave-add-support-for-TC_SETUP_FT.patch index e7a33ce787..72675dc294 100644 --- a/target/linux/generic/backport-5.10/610-v5.13-30-dsa-slave-add-support-for-TC_SETUP_FT.patch +++ b/target/linux/generic/backport-5.10/610-v5.13-30-dsa-slave-add-support-for-TC_SETUP_FT.patch @@ -17,7 +17,7 @@ Signed-off-by: Pablo Neira Ayuso --- a/net/dsa/slave.c +++ b/net/dsa/slave.c -@@ -1237,14 +1237,32 @@ static int dsa_slave_setup_tc_block(stru +@@ -1239,14 +1239,32 @@ static int dsa_slave_setup_tc_block(stru } } diff --git a/target/linux/generic/backport-5.10/610-v5.13-31-net-ethernet-mtk_eth_soc-fix-parsing-packets-in-GDM.patch b/target/linux/generic/backport-5.10/610-v5.13-31-net-ethernet-mtk_eth_soc-fix-parsing-packets-in-GDM.patch index 8361c992ae..b763984732 100644 --- a/target/linux/generic/backport-5.10/610-v5.13-31-net-ethernet-mtk_eth_soc-fix-parsing-packets-in-GDM.patch +++ b/target/linux/generic/backport-5.10/610-v5.13-31-net-ethernet-mtk_eth_soc-fix-parsing-packets-in-GDM.patch @@ -19,7 +19,7 @@ Signed-off-by: Pablo Neira Ayuso #include "mtk_eth_soc.h" -@@ -1264,13 +1265,12 @@ static int mtk_poll_rx(struct napi_struc +@@ -1285,13 +1286,12 @@ static int mtk_poll_rx(struct napi_struc break; /* find out which mac the packet come from. values start at 1 */ @@ -38,7 +38,7 @@ Signed-off-by: Pablo Neira Ayuso if (unlikely(mac < 0 || mac >= MTK_MAC_COUNT || !eth->netdev[mac])) -@@ -2233,6 +2233,9 @@ static void mtk_gdm_config(struct mtk_et +@@ -2254,6 +2254,9 @@ static void mtk_gdm_config(struct mtk_et val |= config; @@ -58,7 +58,7 @@ Signed-off-by: Pablo Neira Ayuso #define MTK_GDMA_ICS_EN BIT(22) #define MTK_GDMA_TCS_EN BIT(21) #define MTK_GDMA_UCS_EN BIT(20) -@@ -305,6 +306,7 @@ +@@ -318,6 +319,7 @@ #define RX_DMA_L4_VALID_PDMA BIT(30) /* when PDMA is used */ #define RX_DMA_FPORT_SHIFT 19 #define RX_DMA_FPORT_MASK 0x7 diff --git a/target/linux/generic/backport-5.10/610-v5.13-32-net-ethernet-mtk_eth_soc-add-support-for-initializin.patch b/target/linux/generic/backport-5.10/610-v5.13-32-net-ethernet-mtk_eth_soc-add-support-for-initializin.patch index 73697615c3..4fd6f8a36b 100644 --- a/target/linux/generic/backport-5.10/610-v5.13-32-net-ethernet-mtk_eth_soc-add-support-for-initializin.patch +++ b/target/linux/generic/backport-5.10/610-v5.13-32-net-ethernet-mtk_eth_soc-add-support-for-initializin.patch @@ -27,7 +27,7 @@ Signed-off-by: Pablo Neira Ayuso obj-$(CONFIG_NET_MEDIATEK_STAR_EMAC) += mtk_star_emac.o --- a/drivers/net/ethernet/mediatek/mtk_eth_soc.c +++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c -@@ -2258,12 +2258,17 @@ static int mtk_open(struct net_device *d +@@ -2279,12 +2279,17 @@ static int mtk_open(struct net_device *d /* we run 2 netdevs on the same dma ring so we only bring it up once */ if (!refcount_read(ð->dma_refcnt)) { @@ -47,7 +47,7 @@ Signed-off-by: Pablo Neira Ayuso napi_enable(ð->tx_napi); napi_enable(ð->rx_napi); -@@ -2330,6 +2335,9 @@ static int mtk_stop(struct net_device *d +@@ -2351,6 +2356,9 @@ static int mtk_stop(struct net_device *d mtk_dma_free(eth); @@ -57,7 +57,7 @@ Signed-off-by: Pablo Neira Ayuso return 0; } -@@ -3058,6 +3066,13 @@ static int mtk_probe(struct platform_dev +@@ -3079,6 +3087,13 @@ static int mtk_probe(struct platform_dev goto err_free_dev; } @@ -71,7 +71,7 @@ Signed-off-by: Pablo Neira Ayuso for (i = 0; i < MTK_MAX_DEVS; i++) { if (!eth->netdev[i]) continue; -@@ -3132,6 +3147,7 @@ static const struct mtk_soc_data mt7621_ +@@ -3153,6 +3168,7 @@ static const struct mtk_soc_data mt7621_ .hw_features = MTK_HW_FEATURES, .required_clks = MT7621_CLKS_BITMAP, .required_pctl = false, @@ -79,7 +79,7 @@ Signed-off-by: Pablo Neira Ayuso }; static const struct mtk_soc_data mt7622_data = { -@@ -3140,6 +3156,7 @@ static const struct mtk_soc_data mt7622_ +@@ -3161,6 +3177,7 @@ static const struct mtk_soc_data mt7622_ .hw_features = MTK_HW_FEATURES, .required_clks = MT7622_CLKS_BITMAP, .required_pctl = false, @@ -105,7 +105,7 @@ Signed-off-by: Pablo Neira Ayuso #define MTK_GDMA_DROP_ALL 0x7777 /* Unicast Filter MAC Address Register - Low */ -@@ -302,6 +304,12 @@ +@@ -315,6 +317,12 @@ #define RX_DMA_VID(_x) ((_x) & 0xfff) /* QDMA descriptor rxd4 */ @@ -118,7 +118,7 @@ Signed-off-by: Pablo Neira Ayuso #define RX_DMA_L4_VALID BIT(24) #define RX_DMA_L4_VALID_PDMA BIT(30) /* when PDMA is used */ #define RX_DMA_FPORT_SHIFT 19 -@@ -799,6 +807,7 @@ struct mtk_soc_data { +@@ -819,6 +827,7 @@ struct mtk_soc_data { u32 caps; u32 required_clks; bool required_pctl; @@ -126,7 +126,7 @@ Signed-off-by: Pablo Neira Ayuso netdev_features_t hw_features; }; -@@ -898,6 +907,8 @@ struct mtk_eth { +@@ -918,6 +927,8 @@ struct mtk_eth { u32 tx_int_status_reg; u32 rx_dma_l4_valid; int ip_align; diff --git a/target/linux/generic/backport-5.10/610-v5.13-33-net-ethernet-mtk_eth_soc-add-flow-offloading-support.patch b/target/linux/generic/backport-5.10/610-v5.13-33-net-ethernet-mtk_eth_soc-add-flow-offloading-support.patch index 030c3fda9c..599757d413 100644 --- a/target/linux/generic/backport-5.10/610-v5.13-33-net-ethernet-mtk_eth_soc-add-flow-offloading-support.patch +++ b/target/linux/generic/backport-5.10/610-v5.13-33-net-ethernet-mtk_eth_soc-add-flow-offloading-support.patch @@ -21,7 +21,7 @@ Signed-off-by: Pablo Neira Ayuso obj-$(CONFIG_NET_MEDIATEK_STAR_EMAC) += mtk_star_emac.o --- a/drivers/net/ethernet/mediatek/mtk_eth_soc.c +++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c -@@ -2813,6 +2813,7 @@ static const struct net_device_ops mtk_n +@@ -2834,6 +2834,7 @@ static const struct net_device_ops mtk_n #ifdef CONFIG_NET_POLL_CONTROLLER .ndo_poll_controller = mtk_poll_controller, #endif @@ -29,7 +29,7 @@ Signed-off-by: Pablo Neira Ayuso }; static int mtk_add_mac(struct mtk_eth *eth, struct device_node *np) -@@ -3071,6 +3072,10 @@ static int mtk_probe(struct platform_dev +@@ -3092,6 +3093,10 @@ static int mtk_probe(struct platform_dev eth->base + MTK_ETH_PPE_BASE, 2); if (err) goto err_free_dev; @@ -60,7 +60,7 @@ Signed-off-by: Pablo Neira Ayuso #define MTK_HW_FEATURES_MT7628 (NETIF_F_SG | NETIF_F_RXCSUM) #define NEXT_DESP_IDX(X, Y) (((X) + 1) & ((Y) - 1)) -@@ -909,6 +911,7 @@ struct mtk_eth { +@@ -929,6 +931,7 @@ struct mtk_eth { int ip_align; struct mtk_ppe ppe; @@ -68,7 +68,7 @@ Signed-off-by: Pablo Neira Ayuso }; /* struct mtk_mac - the structure that holds the info about the MACs of the -@@ -953,4 +956,9 @@ int mtk_gmac_sgmii_path_setup(struct mtk +@@ -973,4 +976,9 @@ int mtk_gmac_sgmii_path_setup(struct mtk int mtk_gmac_gephy_path_setup(struct mtk_eth *eth, int mac_id); int mtk_gmac_rgmii_path_setup(struct mtk_eth *eth, int mac_id); diff --git a/target/linux/generic/backport-5.10/610-v5.13-38-net-ethernet-mtk_eth_soc-unmap-RX-data-before-callin.patch b/target/linux/generic/backport-5.10/610-v5.13-38-net-ethernet-mtk_eth_soc-unmap-RX-data-before-callin.patch index ff88c9e84b..e99302ecda 100644 --- a/target/linux/generic/backport-5.10/610-v5.13-38-net-ethernet-mtk_eth_soc-unmap-RX-data-before-callin.patch +++ b/target/linux/generic/backport-5.10/610-v5.13-38-net-ethernet-mtk_eth_soc-unmap-RX-data-before-callin.patch @@ -17,7 +17,7 @@ Signed-off-by: David S. Miller --- a/drivers/net/ethernet/mediatek/mtk_eth_soc.c +++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c -@@ -1298,6 +1298,9 @@ static int mtk_poll_rx(struct napi_struc +@@ -1319,6 +1319,9 @@ static int mtk_poll_rx(struct napi_struc goto release_desc; } @@ -27,7 +27,7 @@ Signed-off-by: David S. Miller /* receive data */ skb = build_skb(data, ring->frag_size); if (unlikely(!skb)) { -@@ -1307,8 +1310,6 @@ static int mtk_poll_rx(struct napi_struc +@@ -1328,8 +1331,6 @@ static int mtk_poll_rx(struct napi_struc } skb_reserve(skb, NET_SKB_PAD + NET_IP_ALIGN); diff --git a/target/linux/generic/backport-5.10/610-v5.13-39-net-ethernet-mtk_eth_soc-fix-build_skb-cleanup.patch b/target/linux/generic/backport-5.10/610-v5.13-39-net-ethernet-mtk_eth_soc-fix-build_skb-cleanup.patch index dee26ccff1..a82518882a 100644 --- a/target/linux/generic/backport-5.10/610-v5.13-39-net-ethernet-mtk_eth_soc-fix-build_skb-cleanup.patch +++ b/target/linux/generic/backport-5.10/610-v5.13-39-net-ethernet-mtk_eth_soc-fix-build_skb-cleanup.patch @@ -16,7 +16,7 @@ Signed-off-by: David S. Miller --- a/drivers/net/ethernet/mediatek/mtk_eth_soc.c +++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c -@@ -1304,9 +1304,9 @@ static int mtk_poll_rx(struct napi_struc +@@ -1325,9 +1325,9 @@ static int mtk_poll_rx(struct napi_struc /* receive data */ skb = build_skb(data, ring->frag_size); if (unlikely(!skb)) { @@ -28,7 +28,7 @@ Signed-off-by: David S. Miller } skb_reserve(skb, NET_SKB_PAD + NET_IP_ALIGN); -@@ -1326,6 +1326,7 @@ static int mtk_poll_rx(struct napi_struc +@@ -1347,6 +1347,7 @@ static int mtk_poll_rx(struct napi_struc skb_record_rx_queue(skb, 0); napi_gro_receive(napi, skb); diff --git a/target/linux/generic/backport-5.10/610-v5.13-40-net-ethernet-mtk_eth_soc-use-napi_consume_skb.patch b/target/linux/generic/backport-5.10/610-v5.13-40-net-ethernet-mtk_eth_soc-use-napi_consume_skb.patch index 1d1845fa84..5972b9afa7 100644 --- a/target/linux/generic/backport-5.10/610-v5.13-40-net-ethernet-mtk_eth_soc-use-napi_consume_skb.patch +++ b/target/linux/generic/backport-5.10/610-v5.13-40-net-ethernet-mtk_eth_soc-use-napi_consume_skb.patch @@ -14,7 +14,7 @@ Signed-off-by: David S. Miller --- a/drivers/net/ethernet/mediatek/mtk_eth_soc.c +++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c -@@ -858,7 +858,8 @@ static int txd_to_idx(struct mtk_tx_ring +@@ -879,7 +879,8 @@ static int txd_to_idx(struct mtk_tx_ring return ((void *)dma - (void *)ring->dma) / sizeof(*dma); } @@ -24,7 +24,7 @@ Signed-off-by: David S. Miller { if (MTK_HAS_CAPS(eth->soc->caps, MTK_QDMA)) { if (tx_buf->flags & MTK_TX_FLAGS_SINGLE0) { -@@ -890,8 +891,12 @@ static void mtk_tx_unmap(struct mtk_eth +@@ -911,8 +912,12 @@ static void mtk_tx_unmap(struct mtk_eth tx_buf->flags = 0; if (tx_buf->skb && @@ -39,7 +39,7 @@ Signed-off-by: David S. Miller tx_buf->skb = NULL; } -@@ -1069,7 +1074,7 @@ err_dma: +@@ -1090,7 +1095,7 @@ err_dma: tx_buf = mtk_desc_to_tx_buf(ring, itxd); /* unmap dma */ @@ -48,7 +48,7 @@ Signed-off-by: David S. Miller itxd->txd3 = TX_DMA_LS0 | TX_DMA_OWNER_CPU; if (!MTK_HAS_CAPS(eth->soc->caps, MTK_QDMA)) -@@ -1388,7 +1393,7 @@ static int mtk_poll_tx_qdma(struct mtk_e +@@ -1409,7 +1414,7 @@ static int mtk_poll_tx_qdma(struct mtk_e done[mac]++; budget--; } @@ -57,7 +57,7 @@ Signed-off-by: David S. Miller ring->last_free = desc; atomic_inc(&ring->free_count); -@@ -1425,7 +1430,7 @@ static int mtk_poll_tx_pdma(struct mtk_e +@@ -1446,7 +1451,7 @@ static int mtk_poll_tx_pdma(struct mtk_e budget--; } @@ -66,7 +66,7 @@ Signed-off-by: David S. Miller desc = &ring->dma[cpu]; ring->last_free = desc; -@@ -1627,7 +1632,7 @@ static void mtk_tx_clean(struct mtk_eth +@@ -1648,7 +1653,7 @@ static void mtk_tx_clean(struct mtk_eth if (ring->buf) { for (i = 0; i < MTK_DMA_SIZE; i++) diff --git a/target/linux/generic/backport-5.10/610-v5.13-42-net-ethernet-mtk_eth_soc-remove-unnecessary-TX-queue.patch b/target/linux/generic/backport-5.10/610-v5.13-42-net-ethernet-mtk_eth_soc-remove-unnecessary-TX-queue.patch index 67a7e3baed..56d4a82824 100644 --- a/target/linux/generic/backport-5.10/610-v5.13-42-net-ethernet-mtk_eth_soc-remove-unnecessary-TX-queue.patch +++ b/target/linux/generic/backport-5.10/610-v5.13-42-net-ethernet-mtk_eth_soc-remove-unnecessary-TX-queue.patch @@ -16,7 +16,7 @@ Signed-off-by: David S. Miller --- a/drivers/net/ethernet/mediatek/mtk_eth_soc.c +++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c -@@ -1131,17 +1131,6 @@ static void mtk_wake_queue(struct mtk_et +@@ -1152,17 +1152,6 @@ static void mtk_wake_queue(struct mtk_et } } @@ -34,7 +34,7 @@ Signed-off-by: David S. Miller static netdev_tx_t mtk_start_xmit(struct sk_buff *skb, struct net_device *dev) { struct mtk_mac *mac = netdev_priv(dev); -@@ -1162,7 +1151,7 @@ static netdev_tx_t mtk_start_xmit(struct +@@ -1183,7 +1172,7 @@ static netdev_tx_t mtk_start_xmit(struct tx_num = mtk_cal_txd_req(skb); if (unlikely(atomic_read(&ring->free_count) <= tx_num)) { @@ -43,7 +43,7 @@ Signed-off-by: David S. Miller netif_err(eth, tx_queued, dev, "Tx Ring full when queue awake!\n"); spin_unlock(ð->page_lock); -@@ -1188,7 +1177,7 @@ static netdev_tx_t mtk_start_xmit(struct +@@ -1209,7 +1198,7 @@ static netdev_tx_t mtk_start_xmit(struct goto drop; if (unlikely(atomic_read(&ring->free_count) <= ring->thresh)) diff --git a/target/linux/generic/backport-5.10/610-v5.13-43-net-ethernet-mtk_eth_soc-use-larger-burst-size-for-Q.patch b/target/linux/generic/backport-5.10/610-v5.13-43-net-ethernet-mtk_eth_soc-use-larger-burst-size-for-Q.patch index 7c95b33578..a192250e28 100644 --- a/target/linux/generic/backport-5.10/610-v5.13-43-net-ethernet-mtk_eth_soc-use-larger-burst-size-for-Q.patch +++ b/target/linux/generic/backport-5.10/610-v5.13-43-net-ethernet-mtk_eth_soc-use-larger-burst-size-for-Q.patch @@ -15,7 +15,7 @@ Signed-off-by: David S. Miller --- a/drivers/net/ethernet/mediatek/mtk_eth_soc.c +++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c -@@ -2193,7 +2193,7 @@ static int mtk_start_dma(struct mtk_eth +@@ -2214,7 +2214,7 @@ static int mtk_start_dma(struct mtk_eth if (MTK_HAS_CAPS(eth->soc->caps, MTK_QDMA)) { mtk_w32(eth, MTK_TX_WB_DDONE | MTK_TX_DMA_EN | diff --git a/target/linux/generic/backport-5.10/610-v5.13-45-net-ethernet-mtk_eth_soc-implement-dynamic-interrupt.patch b/target/linux/generic/backport-5.10/610-v5.13-45-net-ethernet-mtk_eth_soc-implement-dynamic-interrupt.patch index ef4d2e875b..207d8397d8 100644 --- a/target/linux/generic/backport-5.10/610-v5.13-45-net-ethernet-mtk_eth_soc-implement-dynamic-interrupt.patch +++ b/target/linux/generic/backport-5.10/610-v5.13-45-net-ethernet-mtk_eth_soc-implement-dynamic-interrupt.patch @@ -28,7 +28,7 @@ Signed-off-by: David S. Miller MediaTek SoC family. --- a/drivers/net/ethernet/mediatek/mtk_eth_soc.c +++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c -@@ -1233,12 +1233,13 @@ static void mtk_update_rx_cpu_idx(struct +@@ -1254,12 +1254,13 @@ static void mtk_update_rx_cpu_idx(struct static int mtk_poll_rx(struct napi_struct *napi, int budget, struct mtk_eth *eth) { @@ -43,7 +43,7 @@ Signed-off-by: David S. Miller while (done < budget) { struct net_device *netdev; -@@ -1312,6 +1313,7 @@ static int mtk_poll_rx(struct napi_struc +@@ -1333,6 +1334,7 @@ static int mtk_poll_rx(struct napi_struc else skb_checksum_none_assert(skb); skb->protocol = eth_type_trans(skb, netdev); @@ -51,7 +51,7 @@ Signed-off-by: David S. Miller if (netdev->features & NETIF_F_HW_VLAN_CTAG_RX && (trxd.rxd2 & RX_DMA_VTAG)) -@@ -1344,6 +1346,12 @@ rx_done: +@@ -1365,6 +1367,12 @@ rx_done: mtk_update_rx_cpu_idx(eth); } @@ -64,7 +64,7 @@ Signed-off-by: David S. Miller return done; } -@@ -1436,6 +1444,7 @@ static int mtk_poll_tx_pdma(struct mtk_e +@@ -1457,6 +1465,7 @@ static int mtk_poll_tx_pdma(struct mtk_e static int mtk_poll_tx(struct mtk_eth *eth, int budget) { struct mtk_tx_ring *ring = ð->tx_ring; @@ -72,7 +72,7 @@ Signed-off-by: David S. Miller unsigned int done[MTK_MAX_DEVS]; unsigned int bytes[MTK_MAX_DEVS]; int total = 0, i; -@@ -1453,8 +1462,14 @@ static int mtk_poll_tx(struct mtk_eth *e +@@ -1474,8 +1483,14 @@ static int mtk_poll_tx(struct mtk_eth *e continue; netdev_completed_queue(eth->netdev[i], done[i], bytes[i]); total += done[i]; @@ -87,7 +87,7 @@ Signed-off-by: David S. Miller if (mtk_queue_stopped(eth) && (atomic_read(&ring->free_count) > ring->thresh)) mtk_wake_queue(eth); -@@ -2129,6 +2144,7 @@ static irqreturn_t mtk_handle_irq_rx(int +@@ -2150,6 +2165,7 @@ static irqreturn_t mtk_handle_irq_rx(int { struct mtk_eth *eth = _eth; @@ -95,7 +95,7 @@ Signed-off-by: David S. Miller if (likely(napi_schedule_prep(ð->rx_napi))) { __napi_schedule(ð->rx_napi); mtk_rx_irq_disable(eth, MTK_RX_DONE_INT); -@@ -2141,6 +2157,7 @@ static irqreturn_t mtk_handle_irq_tx(int +@@ -2162,6 +2178,7 @@ static irqreturn_t mtk_handle_irq_tx(int { struct mtk_eth *eth = _eth; @@ -103,7 +103,7 @@ Signed-off-by: David S. Miller if (likely(napi_schedule_prep(ð->tx_napi))) { __napi_schedule(ð->tx_napi); mtk_tx_irq_disable(eth, MTK_TX_DONE_INT); -@@ -2325,6 +2342,9 @@ static int mtk_stop(struct net_device *d +@@ -2346,6 +2363,9 @@ static int mtk_stop(struct net_device *d napi_disable(ð->tx_napi); napi_disable(ð->rx_napi); @@ -113,7 +113,7 @@ Signed-off-by: David S. Miller if (MTK_HAS_CAPS(eth->soc->caps, MTK_QDMA)) mtk_stop_dma(eth, MTK_QDMA_GLO_CFG); mtk_stop_dma(eth, MTK_PDMA_GLO_CFG); -@@ -2377,6 +2397,64 @@ err_disable_clks: +@@ -2398,6 +2418,64 @@ err_disable_clks: return ret; } @@ -178,7 +178,7 @@ Signed-off-by: David S. Miller static int mtk_hw_init(struct mtk_eth *eth) { int i, val, ret; -@@ -2398,9 +2476,6 @@ static int mtk_hw_init(struct mtk_eth *e +@@ -2419,9 +2497,6 @@ static int mtk_hw_init(struct mtk_eth *e goto err_disable_pm; } @@ -188,7 +188,7 @@ Signed-off-by: David S. Miller /* disable delay and normal interrupt */ mtk_tx_irq_disable(eth, ~0); mtk_rx_irq_disable(eth, ~0); -@@ -2439,11 +2514,11 @@ static int mtk_hw_init(struct mtk_eth *e +@@ -2460,11 +2535,11 @@ static int mtk_hw_init(struct mtk_eth *e /* Enable RX VLan Offloading */ mtk_w32(eth, 1, MTK_CDMP_EG_CTRL); @@ -203,7 +203,7 @@ Signed-off-by: David S. Miller mtk_tx_irq_disable(eth, ~0); mtk_rx_irq_disable(eth, ~0); -@@ -2948,6 +3023,13 @@ static int mtk_probe(struct platform_dev +@@ -2969,6 +3044,13 @@ static int mtk_probe(struct platform_dev spin_lock_init(ð->page_lock); spin_lock_init(ð->tx_irq_lock); spin_lock_init(ð->rx_irq_lock); @@ -269,7 +269,7 @@ Signed-off-by: David S. Miller /* QDMA Interrupt grouping registers */ #define MTK_QDMA_INT_GRP1 0x1a20 -@@ -843,6 +849,7 @@ struct mtk_sgmii { +@@ -863,6 +869,7 @@ struct mtk_sgmii { * @page_lock: Make sure that register operations are atomic * @tx_irq__lock: Make sure that IRQ register operations are atomic * @rx_irq__lock: Make sure that IRQ register operations are atomic @@ -277,7 +277,7 @@ Signed-off-by: David S. Miller * @dummy_dev: we run 2 netdevs on 1 physical DMA ring and need a * dummy for NAPI to work * @netdev: The netdev instances -@@ -861,6 +868,14 @@ struct mtk_sgmii { +@@ -881,6 +888,14 @@ struct mtk_sgmii { * @rx_ring_qdma: Pointer to the memory holding info about the QDMA RX ring * @tx_napi: The TX NAPI struct * @rx_napi: The RX NAPI struct @@ -292,7 +292,7 @@ Signed-off-by: David S. Miller * @scratch_ring: Newer SoCs need memory for a second HW managed TX ring * @phy_scratch_ring: physical address of scratch_ring * @scratch_head: The scratch memory that scratch_ring points to. -@@ -905,6 +920,18 @@ struct mtk_eth { +@@ -925,6 +940,18 @@ struct mtk_eth { const struct mtk_soc_data *soc; diff --git a/target/linux/generic/backport-5.10/610-v5.13-46-net-ethernet-mtk_eth_soc-cache-HW-pointer-of-last-fr.patch b/target/linux/generic/backport-5.10/610-v5.13-46-net-ethernet-mtk_eth_soc-cache-HW-pointer-of-last-fr.patch index db21878e92..c2252ed728 100644 --- a/target/linux/generic/backport-5.10/610-v5.13-46-net-ethernet-mtk_eth_soc-cache-HW-pointer-of-last-fr.patch +++ b/target/linux/generic/backport-5.10/610-v5.13-46-net-ethernet-mtk_eth_soc-cache-HW-pointer-of-last-fr.patch @@ -17,7 +17,7 @@ Signed-off-by: David S. Miller --- a/drivers/net/ethernet/mediatek/mtk_eth_soc.c +++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c -@@ -1364,7 +1364,7 @@ static int mtk_poll_tx_qdma(struct mtk_e +@@ -1385,7 +1385,7 @@ static int mtk_poll_tx_qdma(struct mtk_e struct mtk_tx_buf *tx_buf; u32 cpu, dma; @@ -26,7 +26,7 @@ Signed-off-by: David S. Miller dma = mtk_r32(eth, MTK_QTX_DRX_PTR); desc = mtk_qdma_phys_to_virt(ring, cpu); -@@ -1398,6 +1398,7 @@ static int mtk_poll_tx_qdma(struct mtk_e +@@ -1419,6 +1419,7 @@ static int mtk_poll_tx_qdma(struct mtk_e cpu = next_cpu; } @@ -34,7 +34,7 @@ Signed-off-by: David S. Miller mtk_w32(eth, cpu, MTK_QTX_CRX_PTR); return budget; -@@ -1598,6 +1599,7 @@ static int mtk_tx_alloc(struct mtk_eth * +@@ -1619,6 +1620,7 @@ static int mtk_tx_alloc(struct mtk_eth * atomic_set(&ring->free_count, MTK_DMA_SIZE - 2); ring->next_free = &ring->dma[0]; ring->last_free = &ring->dma[MTK_DMA_SIZE - 1]; @@ -42,7 +42,7 @@ Signed-off-by: David S. Miller ring->thresh = MAX_SKB_FRAGS; /* make sure that all changes to the dma ring are flushed before we -@@ -1611,9 +1613,7 @@ static int mtk_tx_alloc(struct mtk_eth * +@@ -1632,9 +1634,7 @@ static int mtk_tx_alloc(struct mtk_eth * mtk_w32(eth, ring->phys + ((MTK_DMA_SIZE - 1) * sz), MTK_QTX_CRX_PTR); @@ -55,7 +55,7 @@ Signed-off-by: David S. Miller } else { --- a/drivers/net/ethernet/mediatek/mtk_eth_soc.h +++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.h -@@ -636,6 +636,7 @@ struct mtk_tx_buf { +@@ -656,6 +656,7 @@ struct mtk_tx_buf { * @phys: The physical addr of tx_buf * @next_free: Pointer to the next free descriptor * @last_free: Pointer to the last free descriptor @@ -63,7 +63,7 @@ Signed-off-by: David S. Miller * @thresh: The threshold of minimum amount of free descriptors * @free_count: QDMA uses a linked list. Track how many free descriptors * are present -@@ -646,6 +647,7 @@ struct mtk_tx_ring { +@@ -666,6 +667,7 @@ struct mtk_tx_ring { dma_addr_t phys; struct mtk_tx_dma *next_free; struct mtk_tx_dma *last_free; diff --git a/target/linux/generic/backport-5.10/610-v5.13-47-net-ethernet-mtk_eth_soc-only-read-the-full-RX-descr.patch b/target/linux/generic/backport-5.10/610-v5.13-47-net-ethernet-mtk_eth_soc-only-read-the-full-RX-descr.patch index f1a3fbd864..09b8b3afb9 100644 --- a/target/linux/generic/backport-5.10/610-v5.13-47-net-ethernet-mtk_eth_soc-only-read-the-full-RX-descr.patch +++ b/target/linux/generic/backport-5.10/610-v5.13-47-net-ethernet-mtk_eth_soc-only-read-the-full-RX-descr.patch @@ -16,7 +16,7 @@ Signed-off-by: David S. Miller --- a/drivers/net/ethernet/mediatek/mtk_eth_soc.c +++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c -@@ -777,13 +777,18 @@ static inline int mtk_max_buf_size(int f +@@ -798,13 +798,18 @@ static inline int mtk_max_buf_size(int f return buf_size; } @@ -37,7 +37,7 @@ Signed-off-by: David S. Miller } /* the qdma core needs scratch memory to be setup */ -@@ -1255,8 +1260,7 @@ static int mtk_poll_rx(struct napi_struc +@@ -1276,8 +1281,7 @@ static int mtk_poll_rx(struct napi_struc rxd = &ring->dma[idx]; data = ring->data[idx]; diff --git a/target/linux/generic/backport-5.10/610-v5.13-48-net-ethernet-mtk_eth_soc-reduce-unnecessary-interrup.patch b/target/linux/generic/backport-5.10/610-v5.13-48-net-ethernet-mtk_eth_soc-reduce-unnecessary-interrup.patch index 21e14ed1e5..411374c2e7 100644 --- a/target/linux/generic/backport-5.10/610-v5.13-48-net-ethernet-mtk_eth_soc-reduce-unnecessary-interrup.patch +++ b/target/linux/generic/backport-5.10/610-v5.13-48-net-ethernet-mtk_eth_soc-reduce-unnecessary-interrup.patch @@ -14,7 +14,7 @@ Signed-off-by: David S. Miller --- a/drivers/net/ethernet/mediatek/mtk_eth_soc.c +++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c -@@ -1519,8 +1519,8 @@ static int mtk_napi_tx(struct napi_struc +@@ -1540,8 +1540,8 @@ static int mtk_napi_tx(struct napi_struc if (status & MTK_TX_DONE_INT) return budget; @@ -25,7 +25,7 @@ Signed-off-by: David S. Miller return tx_done; } -@@ -1553,8 +1553,9 @@ poll_again: +@@ -1574,8 +1574,9 @@ poll_again: remain_budget -= rx_done; goto poll_again; } diff --git a/target/linux/generic/backport-5.10/610-v5.13-49-net-ethernet-mtk_eth_soc-rework-NAPI-callbacks.patch b/target/linux/generic/backport-5.10/610-v5.13-49-net-ethernet-mtk_eth_soc-rework-NAPI-callbacks.patch index 9bc948015d..d0926325d9 100644 --- a/target/linux/generic/backport-5.10/610-v5.13-49-net-ethernet-mtk_eth_soc-rework-NAPI-callbacks.patch +++ b/target/linux/generic/backport-5.10/610-v5.13-49-net-ethernet-mtk_eth_soc-rework-NAPI-callbacks.patch @@ -17,7 +17,7 @@ Signed-off-by: David S. Miller --- a/drivers/net/ethernet/mediatek/mtk_eth_soc.c +++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c -@@ -1496,7 +1496,6 @@ static void mtk_handle_status_irq(struct +@@ -1517,7 +1517,6 @@ static void mtk_handle_status_irq(struct static int mtk_napi_tx(struct napi_struct *napi, int budget) { struct mtk_eth *eth = container_of(napi, struct mtk_eth, tx_napi); @@ -25,7 +25,7 @@ Signed-off-by: David S. Miller int tx_done = 0; if (MTK_HAS_CAPS(eth->soc->caps, MTK_QDMA)) -@@ -1505,21 +1504,19 @@ static int mtk_napi_tx(struct napi_struc +@@ -1526,21 +1525,19 @@ static int mtk_napi_tx(struct napi_struc tx_done = mtk_poll_tx(eth, budget); if (unlikely(netif_msg_intr(eth))) { @@ -52,7 +52,7 @@ Signed-off-by: David S. Miller mtk_tx_irq_enable(eth, MTK_TX_DONE_INT); return tx_done; -@@ -1528,36 +1525,33 @@ static int mtk_napi_tx(struct napi_struc +@@ -1549,36 +1546,33 @@ static int mtk_napi_tx(struct napi_struc static int mtk_napi_rx(struct napi_struct *napi, int budget) { struct mtk_eth *eth = container_of(napi, struct mtk_eth, rx_napi); diff --git a/target/linux/generic/backport-5.10/610-v5.13-50-net-ethernet-mtk_eth_soc-set-PPE-flow-hash-as-skb-ha.patch b/target/linux/generic/backport-5.10/610-v5.13-50-net-ethernet-mtk_eth_soc-set-PPE-flow-hash-as-skb-ha.patch index 2355a4831d..ab298ec42b 100644 --- a/target/linux/generic/backport-5.10/610-v5.13-50-net-ethernet-mtk_eth_soc-set-PPE-flow-hash-as-skb-ha.patch +++ b/target/linux/generic/backport-5.10/610-v5.13-50-net-ethernet-mtk_eth_soc-set-PPE-flow-hash-as-skb-ha.patch @@ -24,7 +24,7 @@ Signed-off-by: David S. Miller #include #include "mtk_eth_soc.h" -@@ -1250,6 +1251,7 @@ static int mtk_poll_rx(struct napi_struc +@@ -1271,6 +1272,7 @@ static int mtk_poll_rx(struct napi_struc struct net_device *netdev; unsigned int pktlen; dma_addr_t dma_addr; @@ -32,7 +32,7 @@ Signed-off-by: David S. Miller int mac; ring = mtk_get_rx_ring(eth); -@@ -1319,6 +1321,12 @@ static int mtk_poll_rx(struct napi_struc +@@ -1340,6 +1342,12 @@ static int mtk_poll_rx(struct napi_struc skb->protocol = eth_type_trans(skb, netdev); bytes += pktlen; diff --git a/target/linux/generic/backport-5.10/610-v5.13-51-net-ethernet-mtk_eth_soc-use-iopoll.h-macro-for-DMA-.patch b/target/linux/generic/backport-5.10/610-v5.13-51-net-ethernet-mtk_eth_soc-use-iopoll.h-macro-for-DMA-.patch index fd2fb0f7c4..26bb33e42c 100644 --- a/target/linux/generic/backport-5.10/610-v5.13-51-net-ethernet-mtk_eth_soc-use-iopoll.h-macro-for-DMA-.patch +++ b/target/linux/generic/backport-5.10/610-v5.13-51-net-ethernet-mtk_eth_soc-use-iopoll.h-macro-for-DMA-.patch @@ -19,7 +19,7 @@ Signed-off-by: David S. Miller --- a/drivers/net/ethernet/mediatek/mtk_eth_soc.c +++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c -@@ -2033,25 +2033,22 @@ static int mtk_set_features(struct net_d +@@ -2054,25 +2054,22 @@ static int mtk_set_features(struct net_d /* wait for DMA to finish whatever it is doing before we start using it again */ static int mtk_dma_busy_wait(struct mtk_eth *eth) { diff --git a/target/linux/generic/backport-5.10/771-v5.12-net-dsa-be-louder-when-a-non-legacy-FDB-operation-fa.patch b/target/linux/generic/backport-5.10/771-v5.12-net-dsa-be-louder-when-a-non-legacy-FDB-operation-fa.patch index e6126dbd91..77ce3b6b1e 100644 --- a/target/linux/generic/backport-5.10/771-v5.12-net-dsa-be-louder-when-a-non-legacy-FDB-operation-fa.patch +++ b/target/linux/generic/backport-5.10/771-v5.12-net-dsa-be-louder-when-a-non-legacy-FDB-operation-fa.patch @@ -25,7 +25,7 @@ Signed-off-by: Jakub Kicinski --- a/net/dsa/slave.c +++ b/net/dsa/slave.c -@@ -2109,7 +2109,9 @@ static void dsa_slave_switchdev_event_wo +@@ -2111,7 +2111,9 @@ static void dsa_slave_switchdev_event_wo err = dsa_port_fdb_add(dp, fdb_info->addr, fdb_info->vid); if (err) { @@ -36,7 +36,7 @@ Signed-off-by: Jakub Kicinski break; } fdb_info->offloaded = true; -@@ -2124,9 +2126,11 @@ static void dsa_slave_switchdev_event_wo +@@ -2126,9 +2128,11 @@ static void dsa_slave_switchdev_event_wo err = dsa_port_fdb_del(dp, fdb_info->addr, fdb_info->vid); if (err) { diff --git a/target/linux/generic/backport-5.10/772-v5.12-net-dsa-don-t-use-switchdev_notifier_fdb_info-in-dsa.patch b/target/linux/generic/backport-5.10/772-v5.12-net-dsa-don-t-use-switchdev_notifier_fdb_info-in-dsa.patch index f542bb4d11..c7e7763bfc 100644 --- a/target/linux/generic/backport-5.10/772-v5.12-net-dsa-don-t-use-switchdev_notifier_fdb_info-in-dsa.patch +++ b/target/linux/generic/backport-5.10/772-v5.12-net-dsa-don-t-use-switchdev_notifier_fdb_info-in-dsa.patch @@ -54,7 +54,7 @@ Signed-off-by: Jakub Kicinski struct sk_buff * (*xmit)(struct sk_buff *skb, --- a/net/dsa/slave.c +++ b/net/dsa/slave.c -@@ -2084,76 +2084,66 @@ static int dsa_slave_netdevice_event(str +@@ -2086,76 +2086,66 @@ static int dsa_slave_netdevice_event(str return NOTIFY_DONE; } @@ -167,7 +167,7 @@ Signed-off-by: Jakub Kicinski } /* Called under rcu_read_lock() */ -@@ -2161,7 +2151,9 @@ static int dsa_slave_switchdev_event(str +@@ -2163,7 +2153,9 @@ static int dsa_slave_switchdev_event(str unsigned long event, void *ptr) { struct net_device *dev = switchdev_notifier_info_to_dev(ptr); @@ -177,7 +177,7 @@ Signed-off-by: Jakub Kicinski int err; if (event == SWITCHDEV_PORT_ATTR_SET) { -@@ -2174,20 +2166,32 @@ static int dsa_slave_switchdev_event(str +@@ -2176,20 +2168,32 @@ static int dsa_slave_switchdev_event(str if (!dsa_slave_dev_check(dev)) return NOTIFY_DONE; @@ -213,7 +213,7 @@ Signed-off-by: Jakub Kicinski dev_hold(dev); break; default: -@@ -2197,10 +2201,6 @@ static int dsa_slave_switchdev_event(str +@@ -2199,10 +2203,6 @@ static int dsa_slave_switchdev_event(str dsa_schedule_work(&switchdev_work->work); return NOTIFY_OK; diff --git a/target/linux/generic/backport-5.10/773-v5.12-net-dsa-move-switchdev-event-implementation-under-th.patch b/target/linux/generic/backport-5.10/773-v5.12-net-dsa-move-switchdev-event-implementation-under-th.patch index d2acb3c895..984578a326 100644 --- a/target/linux/generic/backport-5.10/773-v5.12-net-dsa-move-switchdev-event-implementation-under-th.patch +++ b/target/linux/generic/backport-5.10/773-v5.12-net-dsa-move-switchdev-event-implementation-under-th.patch @@ -20,7 +20,7 @@ Signed-off-by: Jakub Kicinski --- a/net/dsa/slave.c +++ b/net/dsa/slave.c -@@ -2156,31 +2156,29 @@ static int dsa_slave_switchdev_event(str +@@ -2158,31 +2158,29 @@ static int dsa_slave_switchdev_event(str struct dsa_port *dp; int err; @@ -68,7 +68,7 @@ Signed-off-by: Jakub Kicinski fdb_info = ptr; if (!fdb_info->added_by_user) { -@@ -2193,13 +2191,12 @@ static int dsa_slave_switchdev_event(str +@@ -2195,13 +2193,12 @@ static int dsa_slave_switchdev_event(str switchdev_work->vid = fdb_info->vid; dev_hold(dev); diff --git a/target/linux/generic/backport-5.10/774-v5.12-net-dsa-exit-early-in-dsa_slave_switchdev_event-if-w.patch b/target/linux/generic/backport-5.10/774-v5.12-net-dsa-exit-early-in-dsa_slave_switchdev_event-if-w.patch index 591950a49e..652efa2567 100644 --- a/target/linux/generic/backport-5.10/774-v5.12-net-dsa-exit-early-in-dsa_slave_switchdev_event-if-w.patch +++ b/target/linux/generic/backport-5.10/774-v5.12-net-dsa-exit-early-in-dsa_slave_switchdev_event-if-w.patch @@ -30,7 +30,7 @@ Signed-off-by: Jakub Kicinski --- a/net/dsa/slave.c +++ b/net/dsa/slave.c -@@ -2169,6 +2169,9 @@ static int dsa_slave_switchdev_event(str +@@ -2171,6 +2171,9 @@ static int dsa_slave_switchdev_event(str dp = dsa_slave_to_port(dev); diff --git a/target/linux/generic/backport-5.10/775-v5.12-net-dsa-listen-for-SWITCHDEV_-FDB-DEL-_ADD_TO_DEVICE.patch b/target/linux/generic/backport-5.10/775-v5.12-net-dsa-listen-for-SWITCHDEV_-FDB-DEL-_ADD_TO_DEVICE.patch index 91e170964f..e875408a3d 100644 --- a/target/linux/generic/backport-5.10/775-v5.12-net-dsa-listen-for-SWITCHDEV_-FDB-DEL-_ADD_TO_DEVICE.patch +++ b/target/linux/generic/backport-5.10/775-v5.12-net-dsa-listen-for-SWITCHDEV_-FDB-DEL-_ADD_TO_DEVICE.patch @@ -170,7 +170,7 @@ Signed-off-by: Jakub Kicinski */ --- a/net/dsa/slave.c +++ b/net/dsa/slave.c -@@ -2146,6 +2146,28 @@ static void dsa_slave_switchdev_event_wo +@@ -2148,6 +2148,28 @@ static void dsa_slave_switchdev_event_wo dev_put(dp->slave); } @@ -199,7 +199,7 @@ Signed-off-by: Jakub Kicinski /* Called under rcu_read_lock() */ static int dsa_slave_switchdev_event(struct notifier_block *unused, unsigned long event, void *ptr) -@@ -2164,10 +2186,37 @@ static int dsa_slave_switchdev_event(str +@@ -2166,10 +2188,37 @@ static int dsa_slave_switchdev_event(str return notifier_from_errno(err); case SWITCHDEV_FDB_ADD_TO_DEVICE: case SWITCHDEV_FDB_DEL_TO_DEVICE: @@ -240,7 +240,7 @@ Signed-off-by: Jakub Kicinski if (!dp->ds->ops->port_fdb_add || !dp->ds->ops->port_fdb_del) return NOTIFY_DONE; -@@ -2182,18 +2231,13 @@ static int dsa_slave_switchdev_event(str +@@ -2184,18 +2233,13 @@ static int dsa_slave_switchdev_event(str switchdev_work->port = dp->index; switchdev_work->event = event; diff --git a/target/linux/generic/backport-5.10/781-v5.13-net-dsa-mt7530-Add-support-for-EEE-features.patch b/target/linux/generic/backport-5.10/781-v5.13-net-dsa-mt7530-Add-support-for-EEE-features.patch index f85d5cdaad..28576bbfd6 100644 --- a/target/linux/generic/backport-5.10/781-v5.13-net-dsa-mt7530-Add-support-for-EEE-features.patch +++ b/target/linux/generic/backport-5.10/781-v5.13-net-dsa-mt7530-Add-support-for-EEE-features.patch @@ -17,7 +17,7 @@ Signed-off-by: David S. Miller --- a/drivers/net/dsa/mt7530.c +++ b/drivers/net/dsa/mt7530.c -@@ -2277,6 +2277,17 @@ static void mt753x_phylink_mac_link_up(s +@@ -2269,6 +2269,17 @@ static void mt753x_phylink_mac_link_up(s mcr |= PMCR_RX_FC_EN; } @@ -35,7 +35,7 @@ Signed-off-by: David S. Miller mt7530_set(priv, MT7530_PMCR_P(port), mcr); } -@@ -2507,6 +2518,36 @@ mt753x_phy_write(struct dsa_switch *ds, +@@ -2499,6 +2510,36 @@ mt753x_phy_write(struct dsa_switch *ds, return priv->info->phy_write(ds, port, regnum, val); } @@ -72,7 +72,7 @@ Signed-off-by: David S. Miller static const struct dsa_switch_ops mt7530_switch_ops = { .get_tag_protocol = mtk_get_tag_protocol, .setup = mt753x_setup, -@@ -2535,6 +2576,8 @@ static const struct dsa_switch_ops mt753 +@@ -2527,6 +2568,8 @@ static const struct dsa_switch_ops mt753 .phylink_mac_an_restart = mt753x_phylink_mac_an_restart, .phylink_mac_link_down = mt753x_phylink_mac_link_down, .phylink_mac_link_up = mt753x_phylink_mac_link_up, diff --git a/target/linux/generic/hack-5.10/650-netfilter-add-xt_FLOWOFFLOAD-target.patch b/target/linux/generic/hack-5.10/650-netfilter-add-xt_FLOWOFFLOAD-target.patch index 7d5f847435..44e897f10a 100644 --- a/target/linux/generic/hack-5.10/650-netfilter-add-xt_FLOWOFFLOAD-target.patch +++ b/target/linux/generic/hack-5.10/650-netfilter-add-xt_FLOWOFFLOAD-target.patch @@ -767,7 +767,7 @@ Signed-off-by: Felix Fietkau #include #include #include -@@ -356,8 +355,7 @@ flow_offload_lookup(struct nf_flowtable +@@ -355,8 +354,7 @@ flow_offload_lookup(struct nf_flowtable } EXPORT_SYMBOL_GPL(flow_offload_lookup); @@ -777,7 +777,7 @@ Signed-off-by: Felix Fietkau void (*iter)(struct flow_offload *flow, void *data), void *data) { -@@ -389,6 +387,7 @@ nf_flow_table_iterate(struct nf_flowtabl +@@ -388,6 +386,7 @@ nf_flow_table_iterate(struct nf_flowtabl return err; } @@ -807,7 +807,7 @@ Signed-off-by: Felix Fietkau +#endif /* _XT_FLOWOFFLOAD_H */ --- a/include/net/netfilter/nf_flow_table.h +++ b/include/net/netfilter/nf_flow_table.h -@@ -266,6 +266,10 @@ void nf_flow_table_free(struct nf_flowta +@@ -265,6 +265,10 @@ void nf_flow_table_free(struct nf_flowta void flow_offload_teardown(struct flow_offload *flow); diff --git a/target/linux/generic/hack-5.10/661-use_fq_codel_by_default.patch b/target/linux/generic/hack-5.10/661-use_fq_codel_by_default.patch index ceabf81249..863738e2ef 100644 --- a/target/linux/generic/hack-5.10/661-use_fq_codel_by_default.patch +++ b/target/linux/generic/hack-5.10/661-use_fq_codel_by_default.patch @@ -14,7 +14,7 @@ Signed-off-by: Felix Fietkau --- a/include/net/sch_generic.h +++ b/include/net/sch_generic.h -@@ -578,12 +578,13 @@ extern struct Qdisc_ops noop_qdisc_ops; +@@ -611,12 +611,13 @@ extern struct Qdisc_ops noop_qdisc_ops; extern struct Qdisc_ops pfifo_fast_ops; extern struct Qdisc_ops mq_qdisc_ops; extern struct Qdisc_ops noqueue_qdisc_ops; @@ -82,8 +82,8 @@ Signed-off-by: Felix Fietkau +const struct Qdisc_ops *default_qdisc_ops = &fq_codel_qdisc_ops; EXPORT_SYMBOL(default_qdisc_ops); - /* Main transmission queue. */ -@@ -1018,12 +1018,12 @@ static void attach_one_default_qdisc(str + static void qdisc_maybe_clear_missed(struct Qdisc *q, +@@ -1062,12 +1062,12 @@ static void attach_one_default_qdisc(str void *_unused) { struct Qdisc *qdisc; diff --git a/target/linux/generic/pending-5.10/110-perf-jevents-fix-getting-maximum-number-of-fds.patch b/target/linux/generic/pending-5.10/110-perf-jevents-fix-getting-maximum-number-of-fds.patch deleted file mode 100644 index d221b05625..0000000000 --- a/target/linux/generic/pending-5.10/110-perf-jevents-fix-getting-maximum-number-of-fds.patch +++ /dev/null @@ -1,24 +0,0 @@ -From: Felix Fietkau -Date: Tue, 25 May 2021 18:00:34 +0200 -Subject: [PATCH] perf jevents: fix getting maximum number of fds - -On some hosts, rlim.rlim_max can be returned as RLIM_INFINITY. -By casting it to int, it is interpreted as -1, which will cause get_maxfds -to return 0, causing "Invalid argument" errors in nftw() calls. -Fix this by casting the second argument of min() to rlim_t instead. - -Fixes: 80eeb67fe577 ("perf jevents: Program to convert JSON file") -Signed-off-by: Felix Fietkau ---- - ---- a/tools/perf/pmu-events/jevents.c -+++ b/tools/perf/pmu-events/jevents.c -@@ -894,7 +894,7 @@ static int get_maxfds(void) - struct rlimit rlim; - - if (getrlimit(RLIMIT_NOFILE, &rlim) == 0) -- return min((int)rlim.rlim_max / 2, 512); -+ return min(rlim.rlim_max / 2, (rlim_t)512); - - return 512; - } diff --git a/target/linux/generic/pending-5.10/630-packet_socket_type.patch b/target/linux/generic/pending-5.10/630-packet_socket_type.patch index 7ea1765f11..6a6e2fdc2a 100644 --- a/target/linux/generic/pending-5.10/630-packet_socket_type.patch +++ b/target/linux/generic/pending-5.10/630-packet_socket_type.patch @@ -30,7 +30,7 @@ Signed-off-by: Felix Fietkau #define PACKET_FANOUT_LB 1 --- a/net/packet/af_packet.c +++ b/net/packet/af_packet.c -@@ -1817,6 +1817,7 @@ static int packet_rcv_spkt(struct sk_buf +@@ -1818,6 +1818,7 @@ static int packet_rcv_spkt(struct sk_buf { struct sock *sk; struct sockaddr_pkt *spkt; @@ -38,7 +38,7 @@ Signed-off-by: Felix Fietkau /* * When we registered the protocol we saved the socket in the data -@@ -1824,6 +1825,7 @@ static int packet_rcv_spkt(struct sk_buf +@@ -1825,6 +1826,7 @@ static int packet_rcv_spkt(struct sk_buf */ sk = pt->af_packet_priv; @@ -46,7 +46,7 @@ Signed-off-by: Felix Fietkau /* * Yank back the headers [hope the device set this -@@ -1836,7 +1838,7 @@ static int packet_rcv_spkt(struct sk_buf +@@ -1837,7 +1839,7 @@ static int packet_rcv_spkt(struct sk_buf * so that this procedure is noop. */ @@ -55,7 +55,7 @@ Signed-off-by: Felix Fietkau goto out; if (!net_eq(dev_net(dev), sock_net(sk))) -@@ -2074,12 +2076,12 @@ static int packet_rcv(struct sk_buff *sk +@@ -2075,12 +2077,12 @@ static int packet_rcv(struct sk_buff *sk unsigned int snaplen, res; bool is_drop_n_account = false; @@ -71,7 +71,7 @@ Signed-off-by: Felix Fietkau if (!net_eq(dev_net(dev), sock_net(sk))) goto drop; -@@ -2205,12 +2207,12 @@ static int tpacket_rcv(struct sk_buff *s +@@ -2206,12 +2208,12 @@ static int tpacket_rcv(struct sk_buff *s BUILD_BUG_ON(TPACKET_ALIGN(sizeof(*h.h2)) != 32); BUILD_BUG_ON(TPACKET_ALIGN(sizeof(*h.h3)) != 48); @@ -87,7 +87,7 @@ Signed-off-by: Felix Fietkau if (!net_eq(dev_net(dev), sock_net(sk))) goto drop; -@@ -3309,6 +3311,7 @@ static int packet_create(struct net *net +@@ -3315,6 +3317,7 @@ static int packet_create(struct net *net mutex_init(&po->pg_vec_lock); po->rollover = NULL; po->prot_hook.func = packet_rcv; @@ -95,7 +95,7 @@ Signed-off-by: Felix Fietkau if (sock->type == SOCK_PACKET) po->prot_hook.func = packet_rcv_spkt; -@@ -3943,6 +3946,16 @@ packet_setsockopt(struct socket *sock, i +@@ -3949,6 +3952,16 @@ packet_setsockopt(struct socket *sock, i po->xmit = val ? packet_direct_xmit : dev_queue_xmit; return 0; } @@ -112,7 +112,7 @@ Signed-off-by: Felix Fietkau default: return -ENOPROTOOPT; } -@@ -3999,6 +4012,13 @@ static int packet_getsockopt(struct sock +@@ -4005,6 +4018,13 @@ static int packet_getsockopt(struct sock case PACKET_VNET_HDR: val = po->has_vnet_hdr; break; diff --git a/target/linux/generic/pending-5.10/680-NET-skip-GRO-for-foreign-MAC-addresses.patch b/target/linux/generic/pending-5.10/680-NET-skip-GRO-for-foreign-MAC-addresses.patch index 3b485e3cc9..33d64ab3da 100644 --- a/target/linux/generic/pending-5.10/680-NET-skip-GRO-for-foreign-MAC-addresses.patch +++ b/target/linux/generic/pending-5.10/680-NET-skip-GRO-for-foreign-MAC-addresses.patch @@ -32,7 +32,7 @@ Signed-off-by: Felix Fietkau __u16 tc_index; /* traffic control index */ --- a/net/core/dev.c +++ b/net/core/dev.c -@@ -6018,6 +6018,9 @@ static enum gro_result dev_gro_receive(s +@@ -6037,6 +6037,9 @@ static enum gro_result dev_gro_receive(s int same_flow; int grow; @@ -42,7 +42,7 @@ Signed-off-by: Felix Fietkau if (netif_elide_gro(skb->dev)) goto normal; -@@ -7987,6 +7990,48 @@ static void __netdev_adjacent_dev_unlink +@@ -8006,6 +8009,48 @@ static void __netdev_adjacent_dev_unlink &upper_dev->adj_list.lower); } @@ -91,7 +91,7 @@ Signed-off-by: Felix Fietkau static int __netdev_upper_dev_link(struct net_device *dev, struct net_device *upper_dev, bool master, void *upper_priv, void *upper_info, -@@ -8038,6 +8083,7 @@ static int __netdev_upper_dev_link(struc +@@ -8057,6 +8102,7 @@ static int __netdev_upper_dev_link(struc if (ret) return ret; @@ -99,7 +99,7 @@ Signed-off-by: Felix Fietkau ret = call_netdevice_notifiers_info(NETDEV_CHANGEUPPER, &changeupper_info.info); ret = notifier_to_errno(ret); -@@ -8134,6 +8180,7 @@ static void __netdev_upper_dev_unlink(st +@@ -8153,6 +8199,7 @@ static void __netdev_upper_dev_unlink(st __netdev_adjacent_dev_unlink_neighbour(dev, upper_dev); @@ -107,7 +107,7 @@ Signed-off-by: Felix Fietkau call_netdevice_notifiers_info(NETDEV_CHANGEUPPER, &changeupper_info.info); -@@ -8920,6 +8967,7 @@ int dev_set_mac_address(struct net_devic +@@ -8939,6 +8986,7 @@ int dev_set_mac_address(struct net_devic if (err) return err; dev->addr_assign_type = NET_ADDR_SET; diff --git a/target/linux/generic/pending-5.10/765-net-dsa-Include-local-addresses-in-assisted-CPU-port.patch b/target/linux/generic/pending-5.10/765-net-dsa-Include-local-addresses-in-assisted-CPU-port.patch index c86a854212..145efa57c3 100644 --- a/target/linux/generic/pending-5.10/765-net-dsa-Include-local-addresses-in-assisted-CPU-port.patch +++ b/target/linux/generic/pending-5.10/765-net-dsa-Include-local-addresses-in-assisted-CPU-port.patch @@ -18,7 +18,7 @@ Signed-off-by: Tobias Waldekranz --- a/net/dsa/slave.c +++ b/net/dsa/slave.c -@@ -2189,10 +2189,12 @@ static int dsa_slave_switchdev_event(str +@@ -2191,10 +2191,12 @@ static int dsa_slave_switchdev_event(str fdb_info = ptr; if (dsa_slave_dev_check(dev)) { diff --git a/target/linux/generic/pending-5.10/766-net-dsa-Include-bridge-addresses-in-assisted-CPU-por.patch b/target/linux/generic/pending-5.10/766-net-dsa-Include-bridge-addresses-in-assisted-CPU-por.patch index bf356422de..53f1232955 100644 --- a/target/linux/generic/pending-5.10/766-net-dsa-Include-bridge-addresses-in-assisted-CPU-por.patch +++ b/target/linux/generic/pending-5.10/766-net-dsa-Include-bridge-addresses-in-assisted-CPU-por.patch @@ -15,7 +15,7 @@ Signed-off-by: Tobias Waldekranz --- a/net/dsa/slave.c +++ b/net/dsa/slave.c -@@ -2203,7 +2203,11 @@ static int dsa_slave_switchdev_event(str +@@ -2205,7 +2205,11 @@ static int dsa_slave_switchdev_event(str struct net_device *br_dev; struct dsa_slave_priv *p; diff --git a/target/linux/generic/pending-5.10/767-net-dsa-Sync-static-FDB-entries-on-foreign-interface.patch b/target/linux/generic/pending-5.10/767-net-dsa-Sync-static-FDB-entries-on-foreign-interface.patch index 84ad38f6eb..49418d3b86 100644 --- a/target/linux/generic/pending-5.10/767-net-dsa-Sync-static-FDB-entries-on-foreign-interface.patch +++ b/target/linux/generic/pending-5.10/767-net-dsa-Sync-static-FDB-entries-on-foreign-interface.patch @@ -28,7 +28,7 @@ Signed-off-by: Tobias Waldekranz --- a/net/dsa/slave.c +++ b/net/dsa/slave.c -@@ -2196,9 +2196,12 @@ static int dsa_slave_switchdev_event(str +@@ -2198,9 +2198,12 @@ static int dsa_slave_switchdev_event(str else if (!fdb_info->added_by_user) return NOTIFY_OK; } else { @@ -44,7 +44,7 @@ Signed-off-by: Tobias Waldekranz */ struct net_device *br_dev; struct dsa_slave_priv *p; -@@ -2220,7 +2223,8 @@ static int dsa_slave_switchdev_event(str +@@ -2222,7 +2225,8 @@ static int dsa_slave_switchdev_event(str dp = p->dp->cpu_dp; diff --git a/target/linux/mediatek/patches-5.10/410-bt-mtk-serial-fix.patch b/target/linux/mediatek/patches-5.10/410-bt-mtk-serial-fix.patch index 2e474dd5fe..8dc680d180 100644 --- a/target/linux/mediatek/patches-5.10/410-bt-mtk-serial-fix.patch +++ b/target/linux/mediatek/patches-5.10/410-bt-mtk-serial-fix.patch @@ -19,7 +19,7 @@ }, [PORT_NPCM] = { .name = "Nuvoton 16550", -@@ -2687,6 +2687,11 @@ serial8250_do_set_termios(struct uart_po +@@ -2699,6 +2699,11 @@ serial8250_do_set_termios(struct uart_po unsigned long flags; unsigned int baud, quot, frac = 0; diff --git a/target/linux/mediatek/patches-5.10/700-net-ethernet-mtk_eth_soc-add-support-for-coherent-DM.patch b/target/linux/mediatek/patches-5.10/700-net-ethernet-mtk_eth_soc-add-support-for-coherent-DM.patch index 0b028cdcee..e131bfdf17 100644 --- a/target/linux/mediatek/patches-5.10/700-net-ethernet-mtk_eth_soc-add-support-for-coherent-DM.patch +++ b/target/linux/mediatek/patches-5.10/700-net-ethernet-mtk_eth_soc-add-support-for-coherent-DM.patch @@ -37,7 +37,7 @@ Signed-off-by: Felix Fietkau #include #include #include -@@ -2473,6 +2474,13 @@ static int mtk_hw_init(struct mtk_eth *e +@@ -2494,6 +2495,13 @@ static int mtk_hw_init(struct mtk_eth *e if (ret) goto err_disable_pm; @@ -51,7 +51,7 @@ Signed-off-by: Felix Fietkau if (MTK_HAS_CAPS(eth->soc->caps, MTK_SOC_MT7628)) { ret = device_reset(eth->dev); if (ret) { -@@ -3053,6 +3061,16 @@ static int mtk_probe(struct platform_dev +@@ -3074,6 +3082,16 @@ static int mtk_probe(struct platform_dev } } @@ -70,7 +70,7 @@ Signed-off-by: Felix Fietkau GFP_KERNEL); --- a/drivers/net/ethernet/mediatek/mtk_eth_soc.h +++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.h -@@ -437,6 +437,12 @@ +@@ -450,6 +450,12 @@ #define RSTCTRL_FE BIT(6) #define RSTCTRL_PPE BIT(31) diff --git a/target/linux/ramips/patches-5.10/323-mt7621-memory-detect.patch b/target/linux/ramips/patches-5.10/323-mt7621-memory-detect.patch index e87263d3c9..40fc5b71d9 100644 --- a/target/linux/ramips/patches-5.10/323-mt7621-memory-detect.patch +++ b/target/linux/ramips/patches-5.10/323-mt7621-memory-detect.patch @@ -118,7 +118,7 @@ Signed-off-by: Chuanhong Guo --- a/arch/mips/ralink/of.c +++ b/arch/mips/ralink/of.c -@@ -83,6 +83,8 @@ void __init plat_mem_setup(void) +@@ -85,6 +85,8 @@ void __init plat_mem_setup(void) of_scan_flat_dt(early_init_dt_find_memory, NULL); if (memory_dtb) of_scan_flat_dt(early_init_dt_scan_memory, NULL); diff --git a/target/linux/ramips/patches-5.10/700-net-ethernet-mediatek-support-net-labels.patch b/target/linux/ramips/patches-5.10/700-net-ethernet-mediatek-support-net-labels.patch index e94999b73e..c32c16a908 100644 --- a/target/linux/ramips/patches-5.10/700-net-ethernet-mediatek-support-net-labels.patch +++ b/target/linux/ramips/patches-5.10/700-net-ethernet-mediatek-support-net-labels.patch @@ -14,7 +14,7 @@ Signed-off-by: René van Dorst --- a/drivers/net/ethernet/mediatek/mtk_eth_soc.c +++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c -@@ -2893,6 +2893,7 @@ static const struct net_device_ops mtk_n +@@ -2914,6 +2914,7 @@ static const struct net_device_ops mtk_n static int mtk_add_mac(struct mtk_eth *eth, struct device_node *np) { @@ -22,7 +22,7 @@ Signed-off-by: René van Dorst const __be32 *_id = of_get_property(np, "reg", NULL); phy_interface_t phy_mode; struct phylink *phylink; -@@ -2985,6 +2986,9 @@ static int mtk_add_mac(struct mtk_eth *e +@@ -3006,6 +3007,9 @@ static int mtk_add_mac(struct mtk_eth *e eth->netdev[id]->max_mtu = MTK_MAX_RX_LENGTH - MTK_RX_ETH_HLEN; diff --git a/target/linux/ramips/patches-5.10/835-asoc-add-mt7620-support.patch b/target/linux/ramips/patches-5.10/835-asoc-add-mt7620-support.patch index 0393c23f65..255c8d751a 100644 --- a/target/linux/ramips/patches-5.10/835-asoc-add-mt7620-support.patch +++ b/target/linux/ramips/patches-5.10/835-asoc-add-mt7620-support.patch @@ -18,24 +18,6 @@ Signed-off-by: John Crispin create mode 100644 sound/soc/ralink/mt7620-i2s.c create mode 100644 sound/soc/ralink/mt7620-wm8960.c ---- a/arch/mips/ralink/of.c -+++ b/arch/mips/ralink/of.c -@@ -13,6 +13,7 @@ - #include - #include - #include -+#include - #include - #include - -@@ -24,6 +25,7 @@ - #include "common.h" - - __iomem void *rt_sysc_membase; -+EXPORT_SYMBOL(rt_sysc_membase); - __iomem void *rt_memc_membase; - - __iomem void *plat_of_remap_node(const char *node) --- a/sound/soc/Kconfig +++ b/sound/soc/Kconfig @@ -60,6 +60,7 @@ source "sound/soc/mxs/Kconfig" From 752cd29904c9304125005b34354b75b968bfc449 Mon Sep 17 00:00:00 2001 From: John Audia Date: Thu, 3 Jun 2021 14:46:59 -0400 Subject: [PATCH 21/35] kernel: bump 5.4 to 5.4.124 Manually rebased: generic/hack-5.4/662-remove_pfifo_fast.patch All other patches automatically rebased. Build system: x86_64 Build-tested: ipq806x/R7800 Run-tested: ipq806x/R7800 No dmesg regressions, everything functional Signed-off-by: John Audia [manual changes to ramips/patches-5.10/835-asoc-add-mt7620-support.patch] Signed-off-by: Hauke Mehrtens --- include/kernel-version.mk | 4 +- ...support-for-boot-console-with-arbitr.patch | 2 +- ...ast-GRO-for-skbs-with-Ethernet-heade.patch | 2 +- ...t7530-add-support-for-port-mirroring.patch | 4 +- ...an-option-for-drivers-to-always-rece.patch | 4 +- ...3-v5.8-net-dsa-mt7530-fix-VLAN-setup.patch | 6 +-- ...iatek-Integrate-GDM-PSE-setup-operat.patch | 6 +-- ...iatek-Refine-the-timing-of-GDM-PSE-s.patch | 6 +-- ...diatek-Enable-GDM-GDMA_DROP_ALL-mode.patch | 2 +- ...r-when-a-non-legacy-FDB-operation-fa.patch | 4 +- ...e-switchdev_notifier_fdb_info-in-dsa.patch | 8 ++-- ...tchdev-event-implementation-under-th.patch | 4 +- ...ly-in-dsa_slave_switchdev_event-if-w.patch | 2 +- ...or-SWITCHDEV_-FDB-DEL-_ADD_TO_DEVICE.patch | 6 +-- .../661-use_fq_codel_by_default.patch | 6 +-- .../hack-5.4/662-remove_pfifo_fast.patch | 21 +++++++++- ...-support-hardware-flow-table-offload.patch | 4 +- ...T-skip-GRO-for-foreign-MAC-addresses.patch | 10 ++--- ...dd-support-for-threaded-NAPI-polling.patch | 14 +++---- ...-net-dsa-mt7530-Support-EEE-features.patch | 6 +-- ...local-addresses-in-assisted-CPU-port.patch | 2 +- ...bridge-addresses-in-assisted-CPU-por.patch | 2 +- ...tic-FDB-entries-on-foreign-interface.patch | 4 +- ...net-mtk_eth_soc-use-napi_consume_skb.patch | 12 +++--- ..._eth_soc-fix-unnecessary-tx-queue-st.patch | 6 +-- ..._eth_soc-use-larger-burst-size-for-q.patch | 2 +- ..._eth_soc-implement-dynamic-interrupt.patch | 26 ++++++------ ..._eth_soc-cache-hardware-pointer-of-l.patch | 12 +++--- ..._eth_soc-only-read-the-full-rx-descr.patch | 4 +- ..._eth_soc-unmap-rx-data-before-callin.patch | 4 +- ..._eth_soc-avoid-rearming-interrupt-if.patch | 4 +- ...k_eth_soc-fix-parsing-packets-in-GDM.patch | 6 +-- ..._eth_soc-set-PPE-flow-hash-as-skb-ha.patch | 4 +- ...iatek-mtk_eth_soc-add-support-for-in.patch | 16 ++++---- ...iatek-mtk_eth_soc-add-flow-offloadin.patch | 12 +++--- ...the-xmit-timestamp-to-avoid-watchdog.patch | 2 +- ...5-usb-dwc3-add-otg-properties-update.patch | 2 +- ...e-resolved-link-config-via-mac_link_.patch | 4 +- ...se-resolved-link-config-in-mac_link_.patch | 8 ++-- ...xtend-device-data-ready-for-adding-a.patch | 12 +++--- ...530-Add-the-support-of-MT7531-switch.patch | 40 +++++++++---------- ..._eth_soc-add-support-for-coherent-DM.patch | 6 +-- ...-the-commandline-from-the-devicetree.patch | 2 +- .../0048-asoc-add-mt7620-support.patch | 18 --------- ...ethernet-mediatek-support-net-labels.patch | 4 +- 45 files changed, 168 insertions(+), 167 deletions(-) diff --git a/include/kernel-version.mk b/include/kernel-version.mk index de25e1a9c7..85178f5195 100644 --- a/include/kernel-version.mk +++ b/include/kernel-version.mk @@ -6,10 +6,10 @@ ifdef CONFIG_TESTING_KERNEL KERNEL_PATCHVER:=$(KERNEL_TESTING_PATCHVER) endif -LINUX_VERSION-5.4 = .123 +LINUX_VERSION-5.4 = .124 LINUX_VERSION-5.10 = .42 -LINUX_KERNEL_HASH-5.4.123 = 8efe33fffb661d14422877b775fb38de373e04ad640f5d0c8f57144ddb1022de +LINUX_KERNEL_HASH-5.4.124 = f7f29dda2b042d7b5986d18274413131cf70e17288c05e9a683df1f46c507d82 LINUX_KERNEL_HASH-5.10.42 = 8ba027c73bd67b8ded2649a741d2f018db630c1cbc081700d8ffd07ab0d906e5 remove_uri_prefix=$(subst git://,,$(subst http://,,$(subst https://,,$(1)))) diff --git a/target/linux/ath79/patches-5.4/921-serial-core-add-support-for-boot-console-with-arbitr.patch b/target/linux/ath79/patches-5.4/921-serial-core-add-support-for-boot-console-with-arbitr.patch index dac2064cbb..2a2aafa568 100644 --- a/target/linux/ath79/patches-5.4/921-serial-core-add-support-for-boot-console-with-arbitr.patch +++ b/target/linux/ath79/patches-5.4/921-serial-core-add-support-for-boot-console-with-arbitr.patch @@ -30,7 +30,7 @@ Signed-off-by: Sungbo Eo uport->cons->cflag = 0; } /* -@@ -2108,8 +2110,10 @@ uart_set_options(struct uart_port *port, +@@ -2110,8 +2112,10 @@ uart_set_options(struct uart_port *port, * Allow the setting of the UART parameters with a NULL console * too: */ diff --git a/target/linux/generic/backport-5.4/700-v5.5-net-core-allow-fast-GRO-for-skbs-with-Ethernet-heade.patch b/target/linux/generic/backport-5.4/700-v5.5-net-core-allow-fast-GRO-for-skbs-with-Ethernet-heade.patch index a942a53809..eeea18bb9c 100644 --- a/target/linux/generic/backport-5.4/700-v5.5-net-core-allow-fast-GRO-for-skbs-with-Ethernet-heade.patch +++ b/target/linux/generic/backport-5.4/700-v5.5-net-core-allow-fast-GRO-for-skbs-with-Ethernet-heade.patch @@ -66,7 +66,7 @@ Signed-off-by: David S. Miller --- a/net/core/dev.c +++ b/net/core/dev.c -@@ -5404,8 +5404,7 @@ static inline void skb_gro_reset_offset( +@@ -5423,8 +5423,7 @@ static inline void skb_gro_reset_offset( NAPI_GRO_CB(skb)->frag0 = NULL; NAPI_GRO_CB(skb)->frag0_len = 0; diff --git a/target/linux/generic/backport-5.4/745-v5.7-net-dsa-mt7530-add-support-for-port-mirroring.patch b/target/linux/generic/backport-5.4/745-v5.7-net-dsa-mt7530-add-support-for-port-mirroring.patch index e788118259..d4e6f8664d 100644 --- a/target/linux/generic/backport-5.4/745-v5.7-net-dsa-mt7530-add-support-for-port-mirroring.patch +++ b/target/linux/generic/backport-5.4/745-v5.7-net-dsa-mt7530-add-support-for-port-mirroring.patch @@ -17,7 +17,7 @@ Signed-off-by: David S. Miller --- a/drivers/net/dsa/mt7530.c +++ b/drivers/net/dsa/mt7530.c -@@ -1153,6 +1153,64 @@ mt7530_port_vlan_del(struct dsa_switch * +@@ -1145,6 +1145,64 @@ mt7530_port_vlan_del(struct dsa_switch * return 0; } @@ -82,7 +82,7 @@ Signed-off-by: David S. Miller static enum dsa_tag_protocol mtk_get_tag_protocol(struct dsa_switch *ds, int port) { -@@ -1530,6 +1588,8 @@ static const struct dsa_switch_ops mt753 +@@ -1522,6 +1580,8 @@ static const struct dsa_switch_ops mt753 .port_vlan_prepare = mt7530_port_vlan_prepare, .port_vlan_add = mt7530_port_vlan_add, .port_vlan_del = mt7530_port_vlan_del, diff --git a/target/linux/generic/backport-5.4/752-v5.8-net-dsa-provide-an-option-for-drivers-to-always-rece.patch b/target/linux/generic/backport-5.4/752-v5.8-net-dsa-provide-an-option-for-drivers-to-always-rece.patch index 921821a899..52d9351b70 100644 --- a/target/linux/generic/backport-5.4/752-v5.8-net-dsa-provide-an-option-for-drivers-to-always-rece.patch +++ b/target/linux/generic/backport-5.4/752-v5.8-net-dsa-provide-an-option-for-drivers-to-always-rece.patch @@ -101,7 +101,7 @@ Signed-off-by: David S. Miller return 0; /* Do not deprogram the CPU port as it may be shared with other user -@@ -1118,7 +1118,7 @@ static int dsa_slave_vlan_rx_add_vid(str +@@ -1120,7 +1120,7 @@ static int dsa_slave_vlan_rx_add_vid(str * need to emulate the switchdev prepare + commit phase. */ if (dp->bridge_dev) { @@ -110,7 +110,7 @@ Signed-off-by: David S. Miller return 0; /* br_vlan_get_info() returns -EINVAL or -ENOENT if the -@@ -1152,7 +1152,7 @@ static int dsa_slave_vlan_rx_kill_vid(st +@@ -1154,7 +1154,7 @@ static int dsa_slave_vlan_rx_kill_vid(st * need to emulate the switchdev prepare + commit phase. */ if (dp->bridge_dev) { diff --git a/target/linux/generic/backport-5.4/753-v5.8-net-dsa-mt7530-fix-VLAN-setup.patch b/target/linux/generic/backport-5.4/753-v5.8-net-dsa-mt7530-fix-VLAN-setup.patch index c9c2a6392e..eea9bf28d1 100644 --- a/target/linux/generic/backport-5.4/753-v5.8-net-dsa-mt7530-fix-VLAN-setup.patch +++ b/target/linux/generic/backport-5.4/753-v5.8-net-dsa-mt7530-fix-VLAN-setup.patch @@ -15,7 +15,7 @@ Signed-off-by: David S. Miller --- a/drivers/net/dsa/mt7530.c +++ b/drivers/net/dsa/mt7530.c -@@ -1093,12 +1093,6 @@ mt7530_port_vlan_add(struct dsa_switch * +@@ -1085,12 +1085,6 @@ mt7530_port_vlan_add(struct dsa_switch * struct mt7530_priv *priv = ds->priv; u16 vid; @@ -28,7 +28,7 @@ Signed-off-by: David S. Miller mutex_lock(&priv->reg_mutex); for (vid = vlan->vid_begin; vid <= vlan->vid_end; ++vid) { -@@ -1124,12 +1118,6 @@ mt7530_port_vlan_del(struct dsa_switch * +@@ -1116,12 +1110,6 @@ mt7530_port_vlan_del(struct dsa_switch * struct mt7530_priv *priv = ds->priv; u16 vid, pvid; @@ -41,7 +41,7 @@ Signed-off-by: David S. Miller mutex_lock(&priv->reg_mutex); pvid = priv->ports[port].pvid; -@@ -1242,6 +1230,7 @@ mt7530_setup(struct dsa_switch *ds) +@@ -1234,6 +1222,7 @@ mt7530_setup(struct dsa_switch *ds) * as two netdev instances. */ dn = ds->ports[MT7530_CPU_PORT].master->dev.of_node->parent; diff --git a/target/linux/generic/backport-5.4/760-net-ethernet-mediatek-Integrate-GDM-PSE-setup-operat.patch b/target/linux/generic/backport-5.4/760-net-ethernet-mediatek-Integrate-GDM-PSE-setup-operat.patch index 4df1fd2677..e352b0380e 100644 --- a/target/linux/generic/backport-5.4/760-net-ethernet-mediatek-Integrate-GDM-PSE-setup-operat.patch +++ b/target/linux/generic/backport-5.4/760-net-ethernet-mediatek-Integrate-GDM-PSE-setup-operat.patch @@ -10,7 +10,7 @@ Signed-off-by: David S. Miller --- a/drivers/net/ethernet/mediatek/mtk_eth_soc.c +++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c -@@ -2211,6 +2211,28 @@ static int mtk_start_dma(struct mtk_eth +@@ -2232,6 +2232,28 @@ static int mtk_start_dma(struct mtk_eth return 0; } @@ -39,7 +39,7 @@ Signed-off-by: David S. Miller static int mtk_open(struct net_device *dev) { struct mtk_mac *mac = netdev_priv(dev); -@@ -2406,8 +2428,6 @@ static int mtk_hw_init(struct mtk_eth *e +@@ -2427,8 +2449,6 @@ static int mtk_hw_init(struct mtk_eth *e mtk_w32(eth, 0, MTK_QDMA_DELAY_INT); mtk_tx_irq_disable(eth, ~0); mtk_rx_irq_disable(eth, ~0); @@ -48,7 +48,7 @@ Signed-off-by: David S. Miller /* FE int grouping */ mtk_w32(eth, MTK_TX_DONE_INT, MTK_PDMA_INT_GRP1); -@@ -2416,18 +2436,7 @@ static int mtk_hw_init(struct mtk_eth *e +@@ -2437,18 +2457,7 @@ static int mtk_hw_init(struct mtk_eth *e mtk_w32(eth, MTK_RX_DONE_INT, MTK_QDMA_INT_GRP2); mtk_w32(eth, 0x21021000, MTK_FE_INT_GRP); diff --git a/target/linux/generic/backport-5.4/761-net-ethernet-mediatek-Refine-the-timing-of-GDM-PSE-s.patch b/target/linux/generic/backport-5.4/761-net-ethernet-mediatek-Refine-the-timing-of-GDM-PSE-s.patch index cdcd6a1a33..d18d9f93eb 100644 --- a/target/linux/generic/backport-5.4/761-net-ethernet-mediatek-Refine-the-timing-of-GDM-PSE-s.patch +++ b/target/linux/generic/backport-5.4/761-net-ethernet-mediatek-Refine-the-timing-of-GDM-PSE-s.patch @@ -15,7 +15,7 @@ Signed-off-by: David S. Miller --- a/drivers/net/ethernet/mediatek/mtk_eth_soc.c +++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c -@@ -2215,6 +2215,9 @@ static void mtk_gdm_config(struct mtk_et +@@ -2236,6 +2236,9 @@ static void mtk_gdm_config(struct mtk_et { int i; @@ -25,7 +25,7 @@ Signed-off-by: David S. Miller for (i = 0; i < MTK_MAC_COUNT; i++) { u32 val = mtk_r32(eth, MTK_GDMA_FWD_CFG(i)); -@@ -2253,6 +2256,8 @@ static int mtk_open(struct net_device *d +@@ -2274,6 +2277,8 @@ static int mtk_open(struct net_device *d if (err) return err; @@ -34,7 +34,7 @@ Signed-off-by: David S. Miller napi_enable(ð->tx_napi); napi_enable(ð->rx_napi); mtk_tx_irq_enable(eth, MTK_TX_DONE_INT); -@@ -2436,8 +2441,6 @@ static int mtk_hw_init(struct mtk_eth *e +@@ -2457,8 +2462,6 @@ static int mtk_hw_init(struct mtk_eth *e mtk_w32(eth, MTK_RX_DONE_INT, MTK_QDMA_INT_GRP2); mtk_w32(eth, 0x21021000, MTK_FE_INT_GRP); diff --git a/target/linux/generic/backport-5.4/762-net-ethernet-mediatek-Enable-GDM-GDMA_DROP_ALL-mode.patch b/target/linux/generic/backport-5.4/762-net-ethernet-mediatek-Enable-GDM-GDMA_DROP_ALL-mode.patch index b8c40ef665..e25f1211eb 100644 --- a/target/linux/generic/backport-5.4/762-net-ethernet-mediatek-Enable-GDM-GDMA_DROP_ALL-mode.patch +++ b/target/linux/generic/backport-5.4/762-net-ethernet-mediatek-Enable-GDM-GDMA_DROP_ALL-mode.patch @@ -12,7 +12,7 @@ Signed-off-by: David S. Miller --- a/drivers/net/ethernet/mediatek/mtk_eth_soc.c +++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c -@@ -2310,6 +2310,8 @@ static int mtk_stop(struct net_device *d +@@ -2331,6 +2331,8 @@ static int mtk_stop(struct net_device *d if (!refcount_dec_and_test(ð->dma_refcnt)) return 0; diff --git a/target/linux/generic/backport-5.4/771-v5.12-net-dsa-be-louder-when-a-non-legacy-FDB-operation-fa.patch b/target/linux/generic/backport-5.4/771-v5.12-net-dsa-be-louder-when-a-non-legacy-FDB-operation-fa.patch index 967502f022..297175855b 100644 --- a/target/linux/generic/backport-5.4/771-v5.12-net-dsa-be-louder-when-a-non-legacy-FDB-operation-fa.patch +++ b/target/linux/generic/backport-5.4/771-v5.12-net-dsa-be-louder-when-a-non-legacy-FDB-operation-fa.patch @@ -25,7 +25,7 @@ Signed-off-by: Jakub Kicinski --- a/net/dsa/slave.c +++ b/net/dsa/slave.c -@@ -1590,7 +1590,9 @@ static void dsa_slave_switchdev_event_wo +@@ -1592,7 +1592,9 @@ static void dsa_slave_switchdev_event_wo err = dsa_port_fdb_add(dp, fdb_info->addr, fdb_info->vid); if (err) { @@ -36,7 +36,7 @@ Signed-off-by: Jakub Kicinski break; } fdb_info->offloaded = true; -@@ -1605,9 +1607,11 @@ static void dsa_slave_switchdev_event_wo +@@ -1607,9 +1609,11 @@ static void dsa_slave_switchdev_event_wo err = dsa_port_fdb_del(dp, fdb_info->addr, fdb_info->vid); if (err) { diff --git a/target/linux/generic/backport-5.4/772-v5.12-net-dsa-don-t-use-switchdev_notifier_fdb_info-in-dsa.patch b/target/linux/generic/backport-5.4/772-v5.12-net-dsa-don-t-use-switchdev_notifier_fdb_info-in-dsa.patch index ad7c242280..e9b74053e0 100644 --- a/target/linux/generic/backport-5.4/772-v5.12-net-dsa-don-t-use-switchdev_notifier_fdb_info-in-dsa.patch +++ b/target/linux/generic/backport-5.4/772-v5.12-net-dsa-don-t-use-switchdev_notifier_fdb_info-in-dsa.patch @@ -54,7 +54,7 @@ Signed-off-by: Jakub Kicinski struct sk_buff * (*xmit)(struct sk_buff *skb, --- a/net/dsa/slave.c +++ b/net/dsa/slave.c -@@ -1565,76 +1565,66 @@ static int dsa_slave_netdevice_event(str +@@ -1567,76 +1567,66 @@ static int dsa_slave_netdevice_event(str return NOTIFY_DONE; } @@ -167,7 +167,7 @@ Signed-off-by: Jakub Kicinski } /* Called under rcu_read_lock() */ -@@ -1642,7 +1632,9 @@ static int dsa_slave_switchdev_event(str +@@ -1644,7 +1634,9 @@ static int dsa_slave_switchdev_event(str unsigned long event, void *ptr) { struct net_device *dev = switchdev_notifier_info_to_dev(ptr); @@ -177,7 +177,7 @@ Signed-off-by: Jakub Kicinski int err; if (event == SWITCHDEV_PORT_ATTR_SET) { -@@ -1655,20 +1647,32 @@ static int dsa_slave_switchdev_event(str +@@ -1657,20 +1649,32 @@ static int dsa_slave_switchdev_event(str if (!dsa_slave_dev_check(dev)) return NOTIFY_DONE; @@ -213,7 +213,7 @@ Signed-off-by: Jakub Kicinski dev_hold(dev); break; default: -@@ -1678,10 +1682,6 @@ static int dsa_slave_switchdev_event(str +@@ -1680,10 +1684,6 @@ static int dsa_slave_switchdev_event(str dsa_schedule_work(&switchdev_work->work); return NOTIFY_OK; diff --git a/target/linux/generic/backport-5.4/773-v5.12-net-dsa-move-switchdev-event-implementation-under-th.patch b/target/linux/generic/backport-5.4/773-v5.12-net-dsa-move-switchdev-event-implementation-under-th.patch index 619c71c7bb..b46cd7545e 100644 --- a/target/linux/generic/backport-5.4/773-v5.12-net-dsa-move-switchdev-event-implementation-under-th.patch +++ b/target/linux/generic/backport-5.4/773-v5.12-net-dsa-move-switchdev-event-implementation-under-th.patch @@ -20,7 +20,7 @@ Signed-off-by: Jakub Kicinski --- a/net/dsa/slave.c +++ b/net/dsa/slave.c -@@ -1637,31 +1637,29 @@ static int dsa_slave_switchdev_event(str +@@ -1639,31 +1639,29 @@ static int dsa_slave_switchdev_event(str struct dsa_port *dp; int err; @@ -68,7 +68,7 @@ Signed-off-by: Jakub Kicinski fdb_info = ptr; if (!fdb_info->added_by_user) { -@@ -1674,13 +1672,12 @@ static int dsa_slave_switchdev_event(str +@@ -1676,13 +1674,12 @@ static int dsa_slave_switchdev_event(str switchdev_work->vid = fdb_info->vid; dev_hold(dev); diff --git a/target/linux/generic/backport-5.4/774-v5.12-net-dsa-exit-early-in-dsa_slave_switchdev_event-if-w.patch b/target/linux/generic/backport-5.4/774-v5.12-net-dsa-exit-early-in-dsa_slave_switchdev_event-if-w.patch index 25e0d30e1a..d38c3901cf 100644 --- a/target/linux/generic/backport-5.4/774-v5.12-net-dsa-exit-early-in-dsa_slave_switchdev_event-if-w.patch +++ b/target/linux/generic/backport-5.4/774-v5.12-net-dsa-exit-early-in-dsa_slave_switchdev_event-if-w.patch @@ -30,7 +30,7 @@ Signed-off-by: Jakub Kicinski --- a/net/dsa/slave.c +++ b/net/dsa/slave.c -@@ -1650,6 +1650,9 @@ static int dsa_slave_switchdev_event(str +@@ -1652,6 +1652,9 @@ static int dsa_slave_switchdev_event(str dp = dsa_slave_to_port(dev); diff --git a/target/linux/generic/backport-5.4/775-v5.12-net-dsa-listen-for-SWITCHDEV_-FDB-DEL-_ADD_TO_DEVICE.patch b/target/linux/generic/backport-5.4/775-v5.12-net-dsa-listen-for-SWITCHDEV_-FDB-DEL-_ADD_TO_DEVICE.patch index ecc74ea050..4aa85e5750 100644 --- a/target/linux/generic/backport-5.4/775-v5.12-net-dsa-listen-for-SWITCHDEV_-FDB-DEL-_ADD_TO_DEVICE.patch +++ b/target/linux/generic/backport-5.4/775-v5.12-net-dsa-listen-for-SWITCHDEV_-FDB-DEL-_ADD_TO_DEVICE.patch @@ -172,7 +172,7 @@ Signed-off-by: DENG Qingfang */ --- a/net/dsa/slave.c +++ b/net/dsa/slave.c -@@ -1627,6 +1627,25 @@ static void dsa_slave_switchdev_event_wo +@@ -1629,6 +1629,25 @@ static void dsa_slave_switchdev_event_wo dev_put(dp->slave); } @@ -198,7 +198,7 @@ Signed-off-by: DENG Qingfang /* Called under rcu_read_lock() */ static int dsa_slave_switchdev_event(struct notifier_block *unused, unsigned long event, void *ptr) -@@ -1645,10 +1664,37 @@ static int dsa_slave_switchdev_event(str +@@ -1647,10 +1666,37 @@ static int dsa_slave_switchdev_event(str return notifier_from_errno(err); case SWITCHDEV_FDB_ADD_TO_DEVICE: case SWITCHDEV_FDB_DEL_TO_DEVICE: @@ -239,7 +239,7 @@ Signed-off-by: DENG Qingfang if (!dp->ds->ops->port_fdb_add || !dp->ds->ops->port_fdb_del) return NOTIFY_DONE; -@@ -1663,18 +1709,13 @@ static int dsa_slave_switchdev_event(str +@@ -1665,18 +1711,13 @@ static int dsa_slave_switchdev_event(str switchdev_work->port = dp->index; switchdev_work->event = event; diff --git a/target/linux/generic/hack-5.4/661-use_fq_codel_by_default.patch b/target/linux/generic/hack-5.4/661-use_fq_codel_by_default.patch index 10197eeb04..6d0a54c01d 100644 --- a/target/linux/generic/hack-5.4/661-use_fq_codel_by_default.patch +++ b/target/linux/generic/hack-5.4/661-use_fq_codel_by_default.patch @@ -14,7 +14,7 @@ Signed-off-by: Felix Fietkau --- a/include/net/sch_generic.h +++ b/include/net/sch_generic.h -@@ -570,12 +570,13 @@ extern struct Qdisc_ops noop_qdisc_ops; +@@ -603,12 +603,13 @@ extern struct Qdisc_ops noop_qdisc_ops; extern struct Qdisc_ops pfifo_fast_ops; extern struct Qdisc_ops mq_qdisc_ops; extern struct Qdisc_ops noqueue_qdisc_ops; @@ -82,8 +82,8 @@ Signed-off-by: Felix Fietkau +const struct Qdisc_ops *default_qdisc_ops = &fq_codel_qdisc_ops; EXPORT_SYMBOL(default_qdisc_ops); - /* Main transmission queue. */ -@@ -1035,12 +1035,12 @@ static void attach_one_default_qdisc(str + static void qdisc_maybe_clear_missed(struct Qdisc *q, +@@ -1079,12 +1079,12 @@ static void attach_one_default_qdisc(str void *_unused) { struct Qdisc *qdisc; diff --git a/target/linux/generic/hack-5.4/662-remove_pfifo_fast.patch b/target/linux/generic/hack-5.4/662-remove_pfifo_fast.patch index 27946f8cec..9df3a8258d 100644 --- a/target/linux/generic/hack-5.4/662-remove_pfifo_fast.patch +++ b/target/linux/generic/hack-5.4/662-remove_pfifo_fast.patch @@ -10,7 +10,7 @@ Signed-off-by: Felix Fietkau --- a/net/sched/sch_generic.c +++ b/net/sched/sch_generic.c -@@ -595,211 +595,6 @@ struct Qdisc_ops noqueue_qdisc_ops __rea +@@ -620,230 +620,6 @@ struct Qdisc_ops noqueue_qdisc_ops __rea .owner = THIS_MODULE, }; @@ -64,8 +64,10 @@ Signed-off-by: Felix Fietkau -{ - struct pfifo_fast_priv *priv = qdisc_priv(qdisc); - struct sk_buff *skb = NULL; +- bool need_retry = true; - int band; - +-retry: - for (band = 0; band < PFIFO_FAST_BANDS && !skb; band++) { - struct skb_array *q = band2list(priv, band); - @@ -76,6 +78,23 @@ Signed-off-by: Felix Fietkau - } - if (likely(skb)) { - qdisc_update_stats_at_dequeue(qdisc, skb); +- } else if (need_retry && +- test_bit(__QDISC_STATE_MISSED, &qdisc->state)) { +- /* Delay clearing the STATE_MISSED here to reduce +- * the overhead of the second spin_trylock() in +- * qdisc_run_begin() and __netif_schedule() calling +- * in qdisc_run_end(). +- */ +- clear_bit(__QDISC_STATE_MISSED, &qdisc->state); +- +- /* Make sure dequeuing happens after clearing +- * STATE_MISSED. +- */ +- smp_mb__after_atomic(); +- +- need_retry = false; +- +- goto retry; - } else { - WRITE_ONCE(qdisc->empty, true); - } diff --git a/target/linux/generic/pending-5.4/647-net-dsa-support-hardware-flow-table-offload.patch b/target/linux/generic/pending-5.4/647-net-dsa-support-hardware-flow-table-offload.patch index 392a37b345..85c606c455 100644 --- a/target/linux/generic/pending-5.4/647-net-dsa-support-hardware-flow-table-offload.patch +++ b/target/linux/generic/pending-5.4/647-net-dsa-support-hardware-flow-table-offload.patch @@ -38,7 +38,7 @@ Signed-off-by: Felix Fietkau #include "dsa_priv.h" -@@ -1221,6 +1225,27 @@ static struct devlink_port *dsa_slave_ge +@@ -1223,6 +1227,27 @@ static struct devlink_port *dsa_slave_ge return dp->ds->devlink ? &dp->devlink_port : NULL; } @@ -66,7 +66,7 @@ Signed-off-by: Felix Fietkau static const struct net_device_ops dsa_slave_netdev_ops = { .ndo_open = dsa_slave_open, .ndo_stop = dsa_slave_close, -@@ -1245,6 +1270,9 @@ static const struct net_device_ops dsa_s +@@ -1247,6 +1272,9 @@ static const struct net_device_ops dsa_s .ndo_vlan_rx_add_vid = dsa_slave_vlan_rx_add_vid, .ndo_vlan_rx_kill_vid = dsa_slave_vlan_rx_kill_vid, .ndo_get_devlink_port = dsa_slave_get_devlink_port, diff --git a/target/linux/generic/pending-5.4/680-NET-skip-GRO-for-foreign-MAC-addresses.patch b/target/linux/generic/pending-5.4/680-NET-skip-GRO-for-foreign-MAC-addresses.patch index d8d993fbd8..8871f3457a 100644 --- a/target/linux/generic/pending-5.4/680-NET-skip-GRO-for-foreign-MAC-addresses.patch +++ b/target/linux/generic/pending-5.4/680-NET-skip-GRO-for-foreign-MAC-addresses.patch @@ -32,7 +32,7 @@ Signed-off-by: Felix Fietkau __u16 tc_index; /* traffic control index */ --- a/net/core/dev.c +++ b/net/core/dev.c -@@ -5470,6 +5470,9 @@ static enum gro_result dev_gro_receive(s +@@ -5489,6 +5489,9 @@ static enum gro_result dev_gro_receive(s int same_flow; int grow; @@ -42,7 +42,7 @@ Signed-off-by: Felix Fietkau if (netif_elide_gro(skb->dev)) goto normal; -@@ -7265,6 +7268,48 @@ static void __netdev_adjacent_dev_unlink +@@ -7284,6 +7287,48 @@ static void __netdev_adjacent_dev_unlink &upper_dev->adj_list.lower); } @@ -91,7 +91,7 @@ Signed-off-by: Felix Fietkau static int __netdev_upper_dev_link(struct net_device *dev, struct net_device *upper_dev, bool master, void *upper_priv, void *upper_info, -@@ -7315,6 +7360,7 @@ static int __netdev_upper_dev_link(struc +@@ -7334,6 +7379,7 @@ static int __netdev_upper_dev_link(struc if (ret) return ret; @@ -99,7 +99,7 @@ Signed-off-by: Felix Fietkau ret = call_netdevice_notifiers_info(NETDEV_CHANGEUPPER, &changeupper_info.info); ret = notifier_to_errno(ret); -@@ -7408,6 +7454,7 @@ void netdev_upper_dev_unlink(struct net_ +@@ -7427,6 +7473,7 @@ void netdev_upper_dev_unlink(struct net_ __netdev_adjacent_dev_unlink_neighbour(dev, upper_dev); @@ -107,7 +107,7 @@ Signed-off-by: Felix Fietkau call_netdevice_notifiers_info(NETDEV_CHANGEUPPER, &changeupper_info.info); -@@ -8138,6 +8185,7 @@ int dev_set_mac_address(struct net_devic +@@ -8157,6 +8204,7 @@ int dev_set_mac_address(struct net_devic if (err) return err; dev->addr_assign_type = NET_ADDR_SET; diff --git a/target/linux/generic/pending-5.4/690-net-add-support-for-threaded-NAPI-polling.patch b/target/linux/generic/pending-5.4/690-net-add-support-for-threaded-NAPI-polling.patch index a3b71b1896..b30482468b 100644 --- a/target/linux/generic/pending-5.4/690-net-add-support-for-threaded-NAPI-polling.patch +++ b/target/linux/generic/pending-5.4/690-net-add-support-for-threaded-NAPI-polling.patch @@ -95,7 +95,7 @@ Signed-off-by: Felix Fietkau static int netif_rx_internal(struct sk_buff *skb); static int call_netdevice_notifiers_info(unsigned long val, -@@ -5912,6 +5913,11 @@ void __napi_schedule(struct napi_struct +@@ -5931,6 +5932,11 @@ void __napi_schedule(struct napi_struct { unsigned long flags; @@ -107,7 +107,7 @@ Signed-off-by: Felix Fietkau local_irq_save(flags); ____napi_schedule(this_cpu_ptr(&softnet_data), n); local_irq_restore(flags); -@@ -5959,6 +5965,11 @@ EXPORT_SYMBOL(napi_schedule_prep); +@@ -5978,6 +5984,11 @@ EXPORT_SYMBOL(napi_schedule_prep); */ void __napi_schedule_irqoff(struct napi_struct *n) { @@ -119,7 +119,7 @@ Signed-off-by: Felix Fietkau ____napi_schedule(this_cpu_ptr(&softnet_data), n); } EXPORT_SYMBOL(__napi_schedule_irqoff); -@@ -6220,9 +6231,89 @@ static void init_gro_hash(struct napi_st +@@ -6239,9 +6250,89 @@ static void init_gro_hash(struct napi_st napi->gro_bitmask = 0; } @@ -209,7 +209,7 @@ Signed-off-by: Felix Fietkau INIT_LIST_HEAD(&napi->poll_list); hrtimer_init(&napi->timer, CLOCK_MONOTONIC, HRTIMER_MODE_REL_PINNED); napi->timer.function = napi_watchdog; -@@ -6239,6 +6330,7 @@ void netif_napi_add(struct net_device *d +@@ -6258,6 +6349,7 @@ void netif_napi_add(struct net_device *d #ifdef CONFIG_NETPOLL napi->poll_owner = -1; #endif @@ -217,7 +217,7 @@ Signed-off-by: Felix Fietkau set_bit(NAPI_STATE_SCHED, &napi->state); set_bit(NAPI_STATE_NPSVC, &napi->state); list_add_rcu(&napi->dev_list, &dev->napi_list); -@@ -6279,6 +6371,7 @@ static void flush_gro_hash(struct napi_s +@@ -6298,6 +6390,7 @@ static void flush_gro_hash(struct napi_s void netif_napi_del(struct napi_struct *napi) { might_sleep(); @@ -225,7 +225,7 @@ Signed-off-by: Felix Fietkau if (napi_hash_del(napi)) synchronize_net(); list_del_init(&napi->dev_list); -@@ -6291,50 +6384,18 @@ EXPORT_SYMBOL(netif_napi_del); +@@ -6310,50 +6403,18 @@ EXPORT_SYMBOL(netif_napi_del); static int napi_poll(struct napi_struct *n, struct list_head *repoll) { @@ -280,7 +280,7 @@ Signed-off-by: Felix Fietkau /* Some drivers may have called napi_schedule * prior to exhausting their budget. -@@ -10314,6 +10375,10 @@ static int __init net_dev_init(void) +@@ -10333,6 +10394,10 @@ static int __init net_dev_init(void) sd->backlog.weight = weight_p; } diff --git a/target/linux/generic/pending-5.4/761-net-dsa-mt7530-Support-EEE-features.patch b/target/linux/generic/pending-5.4/761-net-dsa-mt7530-Support-EEE-features.patch index 0fd4151ad0..e8f35b6e1f 100644 --- a/target/linux/generic/pending-5.4/761-net-dsa-mt7530-Support-EEE-features.patch +++ b/target/linux/generic/pending-5.4/761-net-dsa-mt7530-Support-EEE-features.patch @@ -9,7 +9,7 @@ Content-Transfer-Encoding: 8bit Signed-off-by: René van Dorst --- a/drivers/net/dsa/mt7530.c +++ b/drivers/net/dsa/mt7530.c -@@ -1417,9 +1417,13 @@ static void mt7530_phylink_mac_config(st +@@ -1409,9 +1409,13 @@ static void mt7530_phylink_mac_config(st switch (state->speed) { case SPEED_1000: mcr_new |= PMCR_FORCE_SPEED_1000; @@ -23,7 +23,7 @@ Signed-off-by: René van Dorst break; } if (state->duplex == DUPLEX_FULL) { -@@ -1555,6 +1559,54 @@ mt7530_phylink_mac_link_state(struct dsa +@@ -1547,6 +1551,54 @@ mt7530_phylink_mac_link_state(struct dsa return 1; } @@ -78,7 +78,7 @@ Signed-off-by: René van Dorst static const struct dsa_switch_ops mt7530_switch_ops = { .get_tag_protocol = mtk_get_tag_protocol, .setup = mt7530_setup, -@@ -1582,6 +1634,8 @@ static const struct dsa_switch_ops mt753 +@@ -1574,6 +1626,8 @@ static const struct dsa_switch_ops mt753 .phylink_mac_config = mt7530_phylink_mac_config, .phylink_mac_link_down = mt7530_phylink_mac_link_down, .phylink_mac_link_up = mt7530_phylink_mac_link_up, diff --git a/target/linux/generic/pending-5.4/765-net-dsa-Include-local-addresses-in-assisted-CPU-port.patch b/target/linux/generic/pending-5.4/765-net-dsa-Include-local-addresses-in-assisted-CPU-port.patch index 618ccf0982..e1a7a0e448 100644 --- a/target/linux/generic/pending-5.4/765-net-dsa-Include-local-addresses-in-assisted-CPU-port.patch +++ b/target/linux/generic/pending-5.4/765-net-dsa-Include-local-addresses-in-assisted-CPU-port.patch @@ -18,7 +18,7 @@ Signed-off-by: Tobias Waldekranz --- a/net/dsa/slave.c +++ b/net/dsa/slave.c -@@ -1695,10 +1695,12 @@ static int dsa_slave_switchdev_event(str +@@ -1697,10 +1697,12 @@ static int dsa_slave_switchdev_event(str fdb_info = ptr; if (dsa_slave_dev_check(dev)) { diff --git a/target/linux/generic/pending-5.4/766-net-dsa-Include-bridge-addresses-in-assisted-CPU-por.patch b/target/linux/generic/pending-5.4/766-net-dsa-Include-bridge-addresses-in-assisted-CPU-por.patch index ed34c7ad24..f985adf736 100644 --- a/target/linux/generic/pending-5.4/766-net-dsa-Include-bridge-addresses-in-assisted-CPU-por.patch +++ b/target/linux/generic/pending-5.4/766-net-dsa-Include-bridge-addresses-in-assisted-CPU-por.patch @@ -15,7 +15,7 @@ Signed-off-by: Tobias Waldekranz --- a/net/dsa/slave.c +++ b/net/dsa/slave.c -@@ -1709,7 +1709,11 @@ static int dsa_slave_switchdev_event(str +@@ -1711,7 +1711,11 @@ static int dsa_slave_switchdev_event(str struct net_device *br_dev; struct dsa_slave_priv *p; diff --git a/target/linux/generic/pending-5.4/767-net-dsa-Sync-static-FDB-entries-on-foreign-interface.patch b/target/linux/generic/pending-5.4/767-net-dsa-Sync-static-FDB-entries-on-foreign-interface.patch index 94f45c6be4..984d9805f6 100644 --- a/target/linux/generic/pending-5.4/767-net-dsa-Sync-static-FDB-entries-on-foreign-interface.patch +++ b/target/linux/generic/pending-5.4/767-net-dsa-Sync-static-FDB-entries-on-foreign-interface.patch @@ -28,7 +28,7 @@ Signed-off-by: Tobias Waldekranz --- a/net/dsa/slave.c +++ b/net/dsa/slave.c -@@ -1702,9 +1702,12 @@ static int dsa_slave_switchdev_event(str +@@ -1704,9 +1704,12 @@ static int dsa_slave_switchdev_event(str else if (!fdb_info->added_by_user) return NOTIFY_OK; } else { @@ -44,7 +44,7 @@ Signed-off-by: Tobias Waldekranz */ struct net_device *br_dev; struct dsa_slave_priv *p; -@@ -1726,7 +1729,8 @@ static int dsa_slave_switchdev_event(str +@@ -1728,7 +1731,8 @@ static int dsa_slave_switchdev_event(str dp = p->dp->cpu_dp; diff --git a/target/linux/generic/pending-5.4/770-00-net-ethernet-mtk_eth_soc-use-napi_consume_skb.patch b/target/linux/generic/pending-5.4/770-00-net-ethernet-mtk_eth_soc-use-napi_consume_skb.patch index 9909c4c963..2f0c7934f5 100644 --- a/target/linux/generic/pending-5.4/770-00-net-ethernet-mtk_eth_soc-use-napi_consume_skb.patch +++ b/target/linux/generic/pending-5.4/770-00-net-ethernet-mtk_eth_soc-use-napi_consume_skb.patch @@ -9,7 +9,7 @@ Signed-off-by: Felix Fietkau --- a/drivers/net/ethernet/mediatek/mtk_eth_soc.c +++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c -@@ -853,7 +853,8 @@ static int txd_to_idx(struct mtk_tx_ring +@@ -874,7 +874,8 @@ static int txd_to_idx(struct mtk_tx_ring return ((void *)dma - (void *)ring->dma) / sizeof(*dma); } @@ -19,7 +19,7 @@ Signed-off-by: Felix Fietkau { if (MTK_HAS_CAPS(eth->soc->caps, MTK_QDMA)) { if (tx_buf->flags & MTK_TX_FLAGS_SINGLE0) { -@@ -885,8 +886,12 @@ static void mtk_tx_unmap(struct mtk_eth +@@ -906,8 +907,12 @@ static void mtk_tx_unmap(struct mtk_eth tx_buf->flags = 0; if (tx_buf->skb && @@ -34,7 +34,7 @@ Signed-off-by: Felix Fietkau tx_buf->skb = NULL; } -@@ -1064,7 +1069,7 @@ err_dma: +@@ -1085,7 +1090,7 @@ err_dma: tx_buf = mtk_desc_to_tx_buf(ring, itxd); /* unmap dma */ @@ -43,7 +43,7 @@ Signed-off-by: Felix Fietkau itxd->txd3 = TX_DMA_LS0 | TX_DMA_OWNER_CPU; if (!MTK_HAS_CAPS(eth->soc->caps, MTK_QDMA)) -@@ -1382,7 +1387,7 @@ static int mtk_poll_tx_qdma(struct mtk_e +@@ -1403,7 +1408,7 @@ static int mtk_poll_tx_qdma(struct mtk_e done[mac]++; budget--; } @@ -52,7 +52,7 @@ Signed-off-by: Felix Fietkau ring->last_free = desc; atomic_inc(&ring->free_count); -@@ -1419,7 +1424,7 @@ static int mtk_poll_tx_pdma(struct mtk_e +@@ -1440,7 +1445,7 @@ static int mtk_poll_tx_pdma(struct mtk_e budget--; } @@ -61,7 +61,7 @@ Signed-off-by: Felix Fietkau desc = &ring->dma[cpu]; ring->last_free = desc; -@@ -1621,7 +1626,7 @@ static void mtk_tx_clean(struct mtk_eth +@@ -1642,7 +1647,7 @@ static void mtk_tx_clean(struct mtk_eth if (ring->buf) { for (i = 0; i < MTK_DMA_SIZE; i++) diff --git a/target/linux/generic/pending-5.4/770-03-net-ethernet-mtk_eth_soc-fix-unnecessary-tx-queue-st.patch b/target/linux/generic/pending-5.4/770-03-net-ethernet-mtk_eth_soc-fix-unnecessary-tx-queue-st.patch index fd28bb8692..6eeae6985f 100644 --- a/target/linux/generic/pending-5.4/770-03-net-ethernet-mtk_eth_soc-fix-unnecessary-tx-queue-st.patch +++ b/target/linux/generic/pending-5.4/770-03-net-ethernet-mtk_eth_soc-fix-unnecessary-tx-queue-st.patch @@ -12,7 +12,7 @@ Signed-off-by: Felix Fietkau --- a/drivers/net/ethernet/mediatek/mtk_eth_soc.c +++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c -@@ -1126,17 +1126,6 @@ static void mtk_wake_queue(struct mtk_et +@@ -1147,17 +1147,6 @@ static void mtk_wake_queue(struct mtk_et } } @@ -30,7 +30,7 @@ Signed-off-by: Felix Fietkau static int mtk_start_xmit(struct sk_buff *skb, struct net_device *dev) { struct mtk_mac *mac = netdev_priv(dev); -@@ -1157,7 +1146,7 @@ static int mtk_start_xmit(struct sk_buff +@@ -1178,7 +1167,7 @@ static int mtk_start_xmit(struct sk_buff tx_num = mtk_cal_txd_req(skb); if (unlikely(atomic_read(&ring->free_count) <= tx_num)) { @@ -39,7 +39,7 @@ Signed-off-by: Felix Fietkau netif_err(eth, tx_queued, dev, "Tx Ring full when queue awake!\n"); spin_unlock(ð->page_lock); -@@ -1183,7 +1172,7 @@ static int mtk_start_xmit(struct sk_buff +@@ -1204,7 +1193,7 @@ static int mtk_start_xmit(struct sk_buff goto drop; if (unlikely(atomic_read(&ring->free_count) <= ring->thresh)) diff --git a/target/linux/generic/pending-5.4/770-04-net-ethernet-mtk_eth_soc-use-larger-burst-size-for-q.patch b/target/linux/generic/pending-5.4/770-04-net-ethernet-mtk_eth_soc-use-larger-burst-size-for-q.patch index e135f27f95..cd042ce409 100644 --- a/target/linux/generic/pending-5.4/770-04-net-ethernet-mtk_eth_soc-use-larger-burst-size-for-q.patch +++ b/target/linux/generic/pending-5.4/770-04-net-ethernet-mtk_eth_soc-use-larger-burst-size-for-q.patch @@ -10,7 +10,7 @@ Signed-off-by: Felix Fietkau --- a/drivers/net/ethernet/mediatek/mtk_eth_soc.c +++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c -@@ -2187,7 +2187,7 @@ static int mtk_start_dma(struct mtk_eth +@@ -2208,7 +2208,7 @@ static int mtk_start_dma(struct mtk_eth if (MTK_HAS_CAPS(eth->soc->caps, MTK_QDMA)) { mtk_w32(eth, MTK_TX_WB_DDONE | MTK_TX_DMA_EN | diff --git a/target/linux/generic/pending-5.4/770-06-net-ethernet-mtk_eth_soc-implement-dynamic-interrupt.patch b/target/linux/generic/pending-5.4/770-06-net-ethernet-mtk_eth_soc-implement-dynamic-interrupt.patch index 8720ab503c..9302f0b1f7 100644 --- a/target/linux/generic/pending-5.4/770-06-net-ethernet-mtk_eth_soc-implement-dynamic-interrupt.patch +++ b/target/linux/generic/pending-5.4/770-06-net-ethernet-mtk_eth_soc-implement-dynamic-interrupt.patch @@ -20,7 +20,7 @@ Signed-off-by: Felix Fietkau MediaTek SoC family. --- a/drivers/net/ethernet/mediatek/mtk_eth_soc.c +++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c -@@ -1228,12 +1228,13 @@ static void mtk_update_rx_cpu_idx(struct +@@ -1249,12 +1249,13 @@ static void mtk_update_rx_cpu_idx(struct static int mtk_poll_rx(struct napi_struct *napi, int budget, struct mtk_eth *eth) { @@ -35,7 +35,7 @@ Signed-off-by: Felix Fietkau while (done < budget) { struct net_device *netdev; -@@ -1307,6 +1308,7 @@ static int mtk_poll_rx(struct napi_struc +@@ -1328,6 +1329,7 @@ static int mtk_poll_rx(struct napi_struc else skb_checksum_none_assert(skb); skb->protocol = eth_type_trans(skb, netdev); @@ -43,7 +43,7 @@ Signed-off-by: Felix Fietkau if (netdev->features & NETIF_F_HW_VLAN_CTAG_RX && (trxd.rxd2 & RX_DMA_VTAG)) -@@ -1338,6 +1340,12 @@ rx_done: +@@ -1359,6 +1361,12 @@ rx_done: mtk_update_rx_cpu_idx(eth); } @@ -56,7 +56,7 @@ Signed-off-by: Felix Fietkau return done; } -@@ -1430,6 +1438,7 @@ static int mtk_poll_tx_pdma(struct mtk_e +@@ -1451,6 +1459,7 @@ static int mtk_poll_tx_pdma(struct mtk_e static int mtk_poll_tx(struct mtk_eth *eth, int budget) { struct mtk_tx_ring *ring = ð->tx_ring; @@ -64,7 +64,7 @@ Signed-off-by: Felix Fietkau unsigned int done[MTK_MAX_DEVS]; unsigned int bytes[MTK_MAX_DEVS]; int total = 0, i; -@@ -1447,8 +1456,14 @@ static int mtk_poll_tx(struct mtk_eth *e +@@ -1468,8 +1477,14 @@ static int mtk_poll_tx(struct mtk_eth *e continue; netdev_completed_queue(eth->netdev[i], done[i], bytes[i]); total += done[i]; @@ -79,7 +79,7 @@ Signed-off-by: Felix Fietkau if (mtk_queue_stopped(eth) && (atomic_read(&ring->free_count) > ring->thresh)) mtk_wake_queue(eth); -@@ -2123,6 +2138,7 @@ static irqreturn_t mtk_handle_irq_rx(int +@@ -2144,6 +2159,7 @@ static irqreturn_t mtk_handle_irq_rx(int { struct mtk_eth *eth = _eth; @@ -87,7 +87,7 @@ Signed-off-by: Felix Fietkau if (likely(napi_schedule_prep(ð->rx_napi))) { __napi_schedule(ð->rx_napi); mtk_rx_irq_disable(eth, MTK_RX_DONE_INT); -@@ -2135,6 +2151,7 @@ static irqreturn_t mtk_handle_irq_tx(int +@@ -2156,6 +2172,7 @@ static irqreturn_t mtk_handle_irq_tx(int { struct mtk_eth *eth = _eth; @@ -95,7 +95,7 @@ Signed-off-by: Felix Fietkau if (likely(napi_schedule_prep(ð->tx_napi))) { __napi_schedule(ð->tx_napi); mtk_tx_irq_disable(eth, MTK_TX_DONE_INT); -@@ -2311,6 +2328,9 @@ static int mtk_stop(struct net_device *d +@@ -2332,6 +2349,9 @@ static int mtk_stop(struct net_device *d napi_disable(ð->tx_napi); napi_disable(ð->rx_napi); @@ -105,7 +105,7 @@ Signed-off-by: Felix Fietkau if (MTK_HAS_CAPS(eth->soc->caps, MTK_QDMA)) mtk_stop_dma(eth, MTK_QDMA_GLO_CFG); mtk_stop_dma(eth, MTK_PDMA_GLO_CFG); -@@ -2360,6 +2380,64 @@ err_disable_clks: +@@ -2381,6 +2401,64 @@ err_disable_clks: return ret; } @@ -170,7 +170,7 @@ Signed-off-by: Felix Fietkau static int mtk_hw_init(struct mtk_eth *eth) { int i, val, ret; -@@ -2381,9 +2459,6 @@ static int mtk_hw_init(struct mtk_eth *e +@@ -2402,9 +2480,6 @@ static int mtk_hw_init(struct mtk_eth *e goto err_disable_pm; } @@ -180,7 +180,7 @@ Signed-off-by: Felix Fietkau /* disable delay and normal interrupt */ mtk_tx_irq_disable(eth, ~0); mtk_rx_irq_disable(eth, ~0); -@@ -2422,11 +2497,10 @@ static int mtk_hw_init(struct mtk_eth *e +@@ -2443,11 +2518,10 @@ static int mtk_hw_init(struct mtk_eth *e /* Enable RX VLan Offloading */ mtk_w32(eth, 1, MTK_CDMP_EG_CTRL); @@ -194,7 +194,7 @@ Signed-off-by: Felix Fietkau mtk_tx_irq_disable(eth, ~0); mtk_rx_irq_disable(eth, ~0); -@@ -2930,6 +3004,13 @@ static int mtk_probe(struct platform_dev +@@ -2951,6 +3025,13 @@ static int mtk_probe(struct platform_dev spin_lock_init(ð->page_lock); spin_lock_init(ð->tx_irq_lock); spin_lock_init(ð->rx_irq_lock); @@ -260,7 +260,7 @@ Signed-off-by: Felix Fietkau /* QDMA Interrupt grouping registers */ #define MTK_QDMA_INT_GRP1 0x1a20 -@@ -892,6 +898,18 @@ struct mtk_eth { +@@ -912,6 +918,18 @@ struct mtk_eth { const struct mtk_soc_data *soc; diff --git a/target/linux/generic/pending-5.4/770-08-net-ethernet-mtk_eth_soc-cache-hardware-pointer-of-l.patch b/target/linux/generic/pending-5.4/770-08-net-ethernet-mtk_eth_soc-cache-hardware-pointer-of-l.patch index a7231d826c..b280b6cf4b 100644 --- a/target/linux/generic/pending-5.4/770-08-net-ethernet-mtk_eth_soc-cache-hardware-pointer-of-l.patch +++ b/target/linux/generic/pending-5.4/770-08-net-ethernet-mtk_eth_soc-cache-hardware-pointer-of-l.patch @@ -11,7 +11,7 @@ Signed-off-by: Felix Fietkau --- a/drivers/net/ethernet/mediatek/mtk_eth_soc.c +++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c -@@ -1358,7 +1358,7 @@ static int mtk_poll_tx_qdma(struct mtk_e +@@ -1379,7 +1379,7 @@ static int mtk_poll_tx_qdma(struct mtk_e struct mtk_tx_buf *tx_buf; u32 cpu, dma; @@ -20,7 +20,7 @@ Signed-off-by: Felix Fietkau dma = mtk_r32(eth, MTK_QTX_DRX_PTR); desc = mtk_qdma_phys_to_virt(ring, cpu); -@@ -1392,6 +1392,7 @@ static int mtk_poll_tx_qdma(struct mtk_e +@@ -1413,6 +1413,7 @@ static int mtk_poll_tx_qdma(struct mtk_e cpu = next_cpu; } @@ -28,7 +28,7 @@ Signed-off-by: Felix Fietkau mtk_w32(eth, cpu, MTK_QTX_CRX_PTR); return budget; -@@ -1592,6 +1593,7 @@ static int mtk_tx_alloc(struct mtk_eth * +@@ -1613,6 +1614,7 @@ static int mtk_tx_alloc(struct mtk_eth * atomic_set(&ring->free_count, MTK_DMA_SIZE - 2); ring->next_free = &ring->dma[0]; ring->last_free = &ring->dma[MTK_DMA_SIZE - 1]; @@ -36,7 +36,7 @@ Signed-off-by: Felix Fietkau ring->thresh = MAX_SKB_FRAGS; /* make sure that all changes to the dma ring are flushed before we -@@ -1605,9 +1607,7 @@ static int mtk_tx_alloc(struct mtk_eth * +@@ -1626,9 +1628,7 @@ static int mtk_tx_alloc(struct mtk_eth * mtk_w32(eth, ring->phys + ((MTK_DMA_SIZE - 1) * sz), MTK_QTX_CRX_PTR); @@ -49,7 +49,7 @@ Signed-off-by: Felix Fietkau } else { --- a/drivers/net/ethernet/mediatek/mtk_eth_soc.h +++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.h -@@ -624,6 +624,7 @@ struct mtk_tx_buf { +@@ -644,6 +644,7 @@ struct mtk_tx_buf { * @phys: The physical addr of tx_buf * @next_free: Pointer to the next free descriptor * @last_free: Pointer to the last free descriptor @@ -57,7 +57,7 @@ Signed-off-by: Felix Fietkau * @thresh: The threshold of minimum amount of free descriptors * @free_count: QDMA uses a linked list. Track how many free descriptors * are present -@@ -634,6 +635,7 @@ struct mtk_tx_ring { +@@ -654,6 +655,7 @@ struct mtk_tx_ring { dma_addr_t phys; struct mtk_tx_dma *next_free; struct mtk_tx_dma *last_free; diff --git a/target/linux/generic/pending-5.4/770-09-net-ethernet-mtk_eth_soc-only-read-the-full-rx-descr.patch b/target/linux/generic/pending-5.4/770-09-net-ethernet-mtk_eth_soc-only-read-the-full-rx-descr.patch index 1b7a0a9aca..c2f5013e26 100644 --- a/target/linux/generic/pending-5.4/770-09-net-ethernet-mtk_eth_soc-only-read-the-full-rx-descr.patch +++ b/target/linux/generic/pending-5.4/770-09-net-ethernet-mtk_eth_soc-only-read-the-full-rx-descr.patch @@ -11,7 +11,7 @@ Signed-off-by: Felix Fietkau --- a/drivers/net/ethernet/mediatek/mtk_eth_soc.c +++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c -@@ -772,13 +772,18 @@ static inline int mtk_max_buf_size(int f +@@ -793,13 +793,18 @@ static inline int mtk_max_buf_size(int f return buf_size; } @@ -32,7 +32,7 @@ Signed-off-by: Felix Fietkau } /* the qdma core needs scratch memory to be setup */ -@@ -1250,8 +1255,7 @@ static int mtk_poll_rx(struct napi_struc +@@ -1271,8 +1276,7 @@ static int mtk_poll_rx(struct napi_struc rxd = &ring->dma[idx]; data = ring->data[idx]; diff --git a/target/linux/generic/pending-5.4/770-10-net-ethernet-mtk_eth_soc-unmap-rx-data-before-callin.patch b/target/linux/generic/pending-5.4/770-10-net-ethernet-mtk_eth_soc-unmap-rx-data-before-callin.patch index 2e1d2bb79d..285fcf8971 100644 --- a/target/linux/generic/pending-5.4/770-10-net-ethernet-mtk_eth_soc-unmap-rx-data-before-callin.patch +++ b/target/linux/generic/pending-5.4/770-10-net-ethernet-mtk_eth_soc-unmap-rx-data-before-callin.patch @@ -11,7 +11,7 @@ Signed-off-by: Felix Fietkau --- a/drivers/net/ethernet/mediatek/mtk_eth_soc.c +++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c -@@ -1293,17 +1293,18 @@ static int mtk_poll_rx(struct napi_struc +@@ -1314,17 +1314,18 @@ static int mtk_poll_rx(struct napi_struc goto release_desc; } @@ -34,7 +34,7 @@ Signed-off-by: Felix Fietkau pktlen = RX_DMA_GET_PLEN0(trxd.rxd2); skb->dev = netdev; skb_put(skb, pktlen); -@@ -1321,6 +1322,7 @@ static int mtk_poll_rx(struct napi_struc +@@ -1342,6 +1343,7 @@ static int mtk_poll_rx(struct napi_struc skb_record_rx_queue(skb, 0); napi_gro_receive(napi, skb); diff --git a/target/linux/generic/pending-5.4/770-11-net-ethernet-mtk_eth_soc-avoid-rearming-interrupt-if.patch b/target/linux/generic/pending-5.4/770-11-net-ethernet-mtk_eth_soc-avoid-rearming-interrupt-if.patch index e56799eb16..4036e32354 100644 --- a/target/linux/generic/pending-5.4/770-11-net-ethernet-mtk_eth_soc-avoid-rearming-interrupt-if.patch +++ b/target/linux/generic/pending-5.4/770-11-net-ethernet-mtk_eth_soc-avoid-rearming-interrupt-if.patch @@ -10,7 +10,7 @@ Signed-off-by: Felix Fietkau --- a/drivers/net/ethernet/mediatek/mtk_eth_soc.c +++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c -@@ -1515,8 +1515,8 @@ static int mtk_napi_tx(struct napi_struc +@@ -1536,8 +1536,8 @@ static int mtk_napi_tx(struct napi_struc if (status & MTK_TX_DONE_INT) return budget; @@ -21,7 +21,7 @@ Signed-off-by: Felix Fietkau return tx_done; } -@@ -1549,8 +1549,9 @@ poll_again: +@@ -1570,8 +1570,9 @@ poll_again: remain_budget -= rx_done; goto poll_again; } diff --git a/target/linux/generic/pending-5.4/770-13-net-ethernet-mtk_eth_soc-fix-parsing-packets-in-GDM.patch b/target/linux/generic/pending-5.4/770-13-net-ethernet-mtk_eth_soc-fix-parsing-packets-in-GDM.patch index 16993b9d80..b1bde7bbff 100644 --- a/target/linux/generic/pending-5.4/770-13-net-ethernet-mtk_eth_soc-fix-parsing-packets-in-GDM.patch +++ b/target/linux/generic/pending-5.4/770-13-net-ethernet-mtk_eth_soc-fix-parsing-packets-in-GDM.patch @@ -18,7 +18,7 @@ Signed-off-by: Felix Fietkau #include "mtk_eth_soc.h" -@@ -1259,13 +1260,12 @@ static int mtk_poll_rx(struct napi_struc +@@ -1280,13 +1281,12 @@ static int mtk_poll_rx(struct napi_struc break; /* find out which mac the packet come from. values start at 1 */ @@ -37,7 +37,7 @@ Signed-off-by: Felix Fietkau if (unlikely(mac < 0 || mac >= MTK_MAC_COUNT || !eth->netdev[mac])) -@@ -2247,6 +2247,9 @@ static void mtk_gdm_config(struct mtk_et +@@ -2268,6 +2268,9 @@ static void mtk_gdm_config(struct mtk_et val |= config; @@ -57,7 +57,7 @@ Signed-off-by: Felix Fietkau #define MTK_GDMA_ICS_EN BIT(22) #define MTK_GDMA_TCS_EN BIT(21) #define MTK_GDMA_UCS_EN BIT(20) -@@ -311,6 +312,7 @@ +@@ -324,6 +325,7 @@ #define RX_DMA_L4_VALID_PDMA BIT(30) /* when PDMA is used */ #define RX_DMA_FPORT_SHIFT 19 #define RX_DMA_FPORT_MASK 0x7 diff --git a/target/linux/generic/pending-5.4/770-14-net-ethernet-mtk_eth_soc-set-PPE-flow-hash-as-skb-ha.patch b/target/linux/generic/pending-5.4/770-14-net-ethernet-mtk_eth_soc-set-PPE-flow-hash-as-skb-ha.patch index 68ae19ec6e..4ab3d84163 100644 --- a/target/linux/generic/pending-5.4/770-14-net-ethernet-mtk_eth_soc-set-PPE-flow-hash-as-skb-ha.patch +++ b/target/linux/generic/pending-5.4/770-14-net-ethernet-mtk_eth_soc-set-PPE-flow-hash-as-skb-ha.patch @@ -18,7 +18,7 @@ Signed-off-by: Felix Fietkau #include #include "mtk_eth_soc.h" -@@ -1246,6 +1247,7 @@ static int mtk_poll_rx(struct napi_struc +@@ -1267,6 +1268,7 @@ static int mtk_poll_rx(struct napi_struc struct net_device *netdev; unsigned int pktlen; dma_addr_t dma_addr; @@ -26,7 +26,7 @@ Signed-off-by: Felix Fietkau int mac; ring = mtk_get_rx_ring(eth); -@@ -1315,6 +1317,12 @@ static int mtk_poll_rx(struct napi_struc +@@ -1336,6 +1338,12 @@ static int mtk_poll_rx(struct napi_struc skb->protocol = eth_type_trans(skb, netdev); bytes += pktlen; diff --git a/target/linux/generic/pending-5.4/770-15-net-ethernet-mediatek-mtk_eth_soc-add-support-for-in.patch b/target/linux/generic/pending-5.4/770-15-net-ethernet-mediatek-mtk_eth_soc-add-support-for-in.patch index 2614502f5a..f609f11d2c 100644 --- a/target/linux/generic/pending-5.4/770-15-net-ethernet-mediatek-mtk_eth_soc-add-support-for-in.patch +++ b/target/linux/generic/pending-5.4/770-15-net-ethernet-mediatek-mtk_eth_soc-add-support-for-in.patch @@ -24,7 +24,7 @@ Signed-off-by: Felix Fietkau +mtk_eth-y := mtk_eth_soc.o mtk_sgmii.o mtk_eth_path.o mtk_ppe.o --- a/drivers/net/ethernet/mediatek/mtk_eth_soc.c +++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c -@@ -2280,12 +2280,17 @@ static int mtk_open(struct net_device *d +@@ -2301,12 +2301,17 @@ static int mtk_open(struct net_device *d /* we run 2 netdevs on the same dma ring so we only bring it up once */ if (!refcount_read(ð->dma_refcnt)) { @@ -44,7 +44,7 @@ Signed-off-by: Felix Fietkau napi_enable(ð->tx_napi); napi_enable(ð->rx_napi); -@@ -2355,6 +2360,9 @@ static int mtk_stop(struct net_device *d +@@ -2376,6 +2381,9 @@ static int mtk_stop(struct net_device *d mtk_dma_free(eth); @@ -54,7 +54,7 @@ Signed-off-by: Felix Fietkau return 0; } -@@ -3144,6 +3152,13 @@ static int mtk_probe(struct platform_dev +@@ -3165,6 +3173,13 @@ static int mtk_probe(struct platform_dev goto err_free_dev; } @@ -68,7 +68,7 @@ Signed-off-by: Felix Fietkau for (i = 0; i < MTK_MAX_DEVS; i++) { if (!eth->netdev[i]) continue; -@@ -3218,6 +3233,7 @@ static const struct mtk_soc_data mt7621_ +@@ -3239,6 +3254,7 @@ static const struct mtk_soc_data mt7621_ .hw_features = MTK_HW_FEATURES, .required_clks = MT7621_CLKS_BITMAP, .required_pctl = false, @@ -76,7 +76,7 @@ Signed-off-by: Felix Fietkau }; static const struct mtk_soc_data mt7622_data = { -@@ -3226,6 +3242,7 @@ static const struct mtk_soc_data mt7622_ +@@ -3247,6 +3263,7 @@ static const struct mtk_soc_data mt7622_ .hw_features = MTK_HW_FEATURES, .required_clks = MT7622_CLKS_BITMAP, .required_pctl = false, @@ -102,7 +102,7 @@ Signed-off-by: Felix Fietkau #define MTK_GDMA_DROP_ALL 0x7777 /* Unicast Filter MAC Address Register - Low */ -@@ -308,6 +310,12 @@ +@@ -321,6 +323,12 @@ #define RX_DMA_VID(_x) ((_x) & 0xfff) /* QDMA descriptor rxd4 */ @@ -115,7 +115,7 @@ Signed-off-by: Felix Fietkau #define RX_DMA_L4_VALID BIT(24) #define RX_DMA_L4_VALID_PDMA BIT(30) /* when PDMA is used */ #define RX_DMA_FPORT_SHIFT 19 -@@ -807,6 +815,7 @@ struct mtk_soc_data { +@@ -827,6 +835,7 @@ struct mtk_soc_data { u32 caps; u32 required_clks; bool required_pctl; @@ -123,7 +123,7 @@ Signed-off-by: Felix Fietkau netdev_features_t hw_features; }; -@@ -918,6 +927,8 @@ struct mtk_eth { +@@ -938,6 +947,8 @@ struct mtk_eth { u32 tx_int_status_reg; u32 rx_dma_l4_valid; int ip_align; diff --git a/target/linux/generic/pending-5.4/770-16-net-ethernet-mediatek-mtk_eth_soc-add-flow-offloadin.patch b/target/linux/generic/pending-5.4/770-16-net-ethernet-mediatek-mtk_eth_soc-add-flow-offloadin.patch index f63ed28998..b0f06f603b 100644 --- a/target/linux/generic/pending-5.4/770-16-net-ethernet-mediatek-mtk_eth_soc-add-flow-offloadin.patch +++ b/target/linux/generic/pending-5.4/770-16-net-ethernet-mediatek-mtk_eth_soc-add-flow-offloadin.patch @@ -29,7 +29,7 @@ Signed-off-by: Felix Fietkau #include #include "mtk_eth_soc.h" -@@ -1327,8 +1329,12 @@ static int mtk_poll_rx(struct napi_struc +@@ -1348,8 +1350,12 @@ static int mtk_poll_rx(struct napi_struc (trxd.rxd2 & RX_DMA_VTAG)) __vlan_hwaccel_put_tag(skb, htons(ETH_P_8021Q), RX_DMA_VID(trxd.rxd3)); @@ -44,7 +44,7 @@ Signed-off-by: Felix Fietkau skip_rx: ring->data[idx] = new_data; -@@ -2861,6 +2867,25 @@ static int mtk_set_rxnfc(struct net_devi +@@ -2882,6 +2888,25 @@ static int mtk_set_rxnfc(struct net_devi return ret; } @@ -70,7 +70,7 @@ Signed-off-by: Felix Fietkau static const struct ethtool_ops mtk_ethtool_ops = { .get_link_ksettings = mtk_get_link_ksettings, .set_link_ksettings = mtk_set_link_ksettings, -@@ -2892,6 +2917,7 @@ static const struct net_device_ops mtk_n +@@ -2913,6 +2938,7 @@ static const struct net_device_ops mtk_n #ifdef CONFIG_NET_POLL_CONTROLLER .ndo_poll_controller = mtk_poll_controller, #endif @@ -78,7 +78,7 @@ Signed-off-by: Felix Fietkau }; static int mtk_add_mac(struct mtk_eth *eth, struct device_node *np) -@@ -3157,6 +3183,10 @@ static int mtk_probe(struct platform_dev +@@ -3178,6 +3204,10 @@ static int mtk_probe(struct platform_dev eth->base + MTK_ETH_PPE_BASE, 2); if (err) goto err_free_dev; @@ -91,7 +91,7 @@ Signed-off-by: Felix Fietkau for (i = 0; i < MTK_MAX_DEVS; i++) { --- a/drivers/net/ethernet/mediatek/mtk_eth_soc.h +++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.h -@@ -929,6 +929,7 @@ struct mtk_eth { +@@ -949,6 +949,7 @@ struct mtk_eth { int ip_align; struct mtk_ppe ppe; @@ -99,7 +99,7 @@ Signed-off-by: Felix Fietkau }; /* struct mtk_mac - the structure that holds the info about the MACs of the -@@ -973,4 +974,12 @@ int mtk_gmac_sgmii_path_setup(struct mtk +@@ -993,4 +994,12 @@ int mtk_gmac_sgmii_path_setup(struct mtk int mtk_gmac_gephy_path_setup(struct mtk_eth *eth, int mac_id); int mtk_gmac_rgmii_path_setup(struct mtk_eth *eth, int mac_id); diff --git a/target/linux/layerscape/patches-5.4/701-net-0029-sdk_dpaa-update-the-xmit-timestamp-to-avoid-watchdog.patch b/target/linux/layerscape/patches-5.4/701-net-0029-sdk_dpaa-update-the-xmit-timestamp-to-avoid-watchdog.patch index 7f925f8946..044e7013a0 100644 --- a/target/linux/layerscape/patches-5.4/701-net-0029-sdk_dpaa-update-the-xmit-timestamp-to-avoid-watchdog.patch +++ b/target/linux/layerscape/patches-5.4/701-net-0029-sdk_dpaa-update-the-xmit-timestamp-to-avoid-watchdog.patch @@ -59,7 +59,7 @@ Signed-off-by: Camelia Groza */ --- a/net/sched/sch_generic.c +++ b/net/sched/sch_generic.c -@@ -440,6 +440,13 @@ static void dev_watchdog(struct timer_li +@@ -465,6 +465,13 @@ static void dev_watchdog(struct timer_li txq->trans_timeout++; break; } diff --git a/target/linux/layerscape/patches-5.4/820-usb-0005-usb-dwc3-add-otg-properties-update.patch b/target/linux/layerscape/patches-5.4/820-usb-0005-usb-dwc3-add-otg-properties-update.patch index 9d3f2ecfda..e3d18a9948 100644 --- a/target/linux/layerscape/patches-5.4/820-usb-0005-usb-dwc3-add-otg-properties-update.patch +++ b/target/linux/layerscape/patches-5.4/820-usb-0005-usb-dwc3-add-otg-properties-update.patch @@ -54,7 +54,7 @@ Signed-off-by: Peter Chen * All 3.1 IP version constants are greater than the 3.0 IP --- a/drivers/usb/dwc3/gadget.c +++ b/drivers/usb/dwc3/gadget.c -@@ -3574,6 +3574,10 @@ int dwc3_gadget_init(struct dwc3 *dwc) +@@ -3575,6 +3575,10 @@ int dwc3_gadget_init(struct dwc3 *dwc) dwc->gadget.sg_supported = true; dwc->gadget.name = "dwc3-gadget"; dwc->gadget.lpm_capable = true; diff --git a/target/linux/mediatek/patches-5.4/0601-net-dsa-propagate-resolved-link-config-via-mac_link_.patch b/target/linux/mediatek/patches-5.4/0601-net-dsa-propagate-resolved-link-config-via-mac_link_.patch index 7938751124..913784372b 100644 --- a/target/linux/mediatek/patches-5.4/0601-net-dsa-propagate-resolved-link-config-via-mac_link_.patch +++ b/target/linux/mediatek/patches-5.4/0601-net-dsa-propagate-resolved-link-config-via-mac_link_.patch @@ -64,7 +64,7 @@ Signed-off-by: David S. Miller --- a/drivers/net/dsa/mt7530.c +++ b/drivers/net/dsa/mt7530.c -@@ -1450,7 +1450,9 @@ static void mt7530_phylink_mac_link_down +@@ -1442,7 +1442,9 @@ static void mt7530_phylink_mac_link_down static void mt7530_phylink_mac_link_up(struct dsa_switch *ds, int port, unsigned int mode, phy_interface_t interface, @@ -90,7 +90,7 @@ Signed-off-by: David S. Miller mv88e6xxx_mac_link_force(ds, port, LINK_FORCED_UP); --- a/drivers/net/dsa/sja1105/sja1105_main.c +++ b/drivers/net/dsa/sja1105/sja1105_main.c -@@ -830,7 +830,9 @@ static void sja1105_mac_link_down(struct +@@ -831,7 +831,9 @@ static void sja1105_mac_link_down(struct static void sja1105_mac_link_up(struct dsa_switch *ds, int port, unsigned int mode, phy_interface_t interface, diff --git a/target/linux/mediatek/patches-5.4/0602-net-dsa-mt7530-use-resolved-link-config-in-mac_link_.patch b/target/linux/mediatek/patches-5.4/0602-net-dsa-mt7530-use-resolved-link-config-in-mac_link_.patch index de5b260778..0f437ae153 100644 --- a/target/linux/mediatek/patches-5.4/0602-net-dsa-mt7530-use-resolved-link-config-in-mac_link_.patch +++ b/target/linux/mediatek/patches-5.4/0602-net-dsa-mt7530-use-resolved-link-config-in-mac_link_.patch @@ -51,7 +51,7 @@ Signed-off-by: David S. Miller mutex_unlock(&priv->reg_mutex); } -@@ -1405,8 +1394,7 @@ static void mt7530_phylink_mac_config(st +@@ -1397,8 +1386,7 @@ static void mt7530_phylink_mac_config(st mcr_cur = mt7530_read(priv, MT7530_PMCR_P(port)); mcr_new = mcr_cur; @@ -61,7 +61,7 @@ Signed-off-by: David S. Miller mcr_new |= PMCR_IFG_XMIT(1) | PMCR_MAC_MODE | PMCR_BACKOFF_EN | PMCR_BACKPR_EN | PMCR_FORCE_MODE; -@@ -1414,26 +1402,6 @@ static void mt7530_phylink_mac_config(st +@@ -1406,26 +1394,6 @@ static void mt7530_phylink_mac_config(st if (port == 5 && dsa_is_user_port(ds, 5)) mcr_new |= PMCR_EXT_PHY; @@ -88,7 +88,7 @@ Signed-off-by: David S. Miller if (mcr_new != mcr_cur) mt7530_write(priv, MT7530_PMCR_P(port), mcr_new); } -@@ -1444,7 +1412,7 @@ static void mt7530_phylink_mac_link_down +@@ -1436,7 +1404,7 @@ static void mt7530_phylink_mac_link_down { struct mt7530_priv *priv = ds->priv; @@ -97,7 +97,7 @@ Signed-off-by: David S. Miller } static void mt7530_phylink_mac_link_up(struct dsa_switch *ds, int port, -@@ -1455,8 +1423,31 @@ static void mt7530_phylink_mac_link_up(s +@@ -1447,8 +1415,31 @@ static void mt7530_phylink_mac_link_up(s bool tx_pause, bool rx_pause) { struct mt7530_priv *priv = ds->priv; diff --git a/target/linux/mediatek/patches-5.4/0603-net-dsa-mt7530-Extend-device-data-ready-for-adding-a.patch b/target/linux/mediatek/patches-5.4/0603-net-dsa-mt7530-Extend-device-data-ready-for-adding-a.patch index 04189e8e31..9ac5599a25 100644 --- a/target/linux/mediatek/patches-5.4/0603-net-dsa-mt7530-Extend-device-data-ready-for-adding-a.patch +++ b/target/linux/mediatek/patches-5.4/0603-net-dsa-mt7530-Extend-device-data-ready-for-adding-a.patch @@ -47,7 +47,7 @@ Signed-off-by: Sean Wang return -EINVAL; } -@@ -1342,12 +1344,11 @@ mt7530_setup(struct dsa_switch *ds) +@@ -1334,12 +1336,11 @@ mt7530_setup(struct dsa_switch *ds) return 0; } @@ -63,7 +63,7 @@ Signed-off-by: Sean Wang switch (port) { case 0: /* Internal phy */ -@@ -1356,33 +1357,114 @@ static void mt7530_phylink_mac_config(st +@@ -1348,33 +1349,114 @@ static void mt7530_phylink_mac_config(st case 3: case 4: if (state->interface != PHY_INTERFACE_MODE_GMII) @@ -189,7 +189,7 @@ Signed-off-by: Sean Wang return; } -@@ -1450,61 +1532,44 @@ static void mt7530_phylink_mac_link_up(s +@@ -1442,61 +1524,44 @@ static void mt7530_phylink_mac_link_up(s mt7530_set(priv, MT7530_PMCR_P(port), mcr); } @@ -274,7 +274,7 @@ Signed-off-by: Sean Wang phylink_set(mask, Pause); phylink_set(mask, Asym_Pause); -@@ -1600,12 +1665,45 @@ static int mt7530_set_mac_eee(struct dsa +@@ -1592,12 +1657,45 @@ static int mt7530_set_mac_eee(struct dsa return 0; } @@ -323,7 +323,7 @@ Signed-off-by: Sean Wang .get_ethtool_stats = mt7530_get_ethtool_stats, .get_sset_count = mt7530_get_sset_count, .port_enable = mt7530_port_enable, -@@ -1622,18 +1720,43 @@ static const struct dsa_switch_ops mt753 +@@ -1614,18 +1712,43 @@ static const struct dsa_switch_ops mt753 .port_vlan_del = mt7530_port_vlan_del, .port_mirror_add = mt7530_port_mirror_add, .port_mirror_del = mt7530_port_mirror_del, @@ -372,7 +372,7 @@ Signed-off-by: Sean Wang { /* sentinel */ }, }; MODULE_DEVICE_TABLE(of, mt7530_of_match); -@@ -1671,8 +1794,21 @@ mt7530_probe(struct mdio_device *mdiodev +@@ -1663,8 +1786,21 @@ mt7530_probe(struct mdio_device *mdiodev /* Get the hardware identifier from the devicetree node. * We will need it for some of the clock and regulator setup. */ diff --git a/target/linux/mediatek/patches-5.4/0604-net-dsa-mt7530-Add-the-support-of-MT7531-switch.patch b/target/linux/mediatek/patches-5.4/0604-net-dsa-mt7530-Add-the-support-of-MT7531-switch.patch index 9333f03aaf..8434c61b50 100644 --- a/target/linux/mediatek/patches-5.4/0604-net-dsa-mt7530-Add-the-support-of-MT7531-switch.patch +++ b/target/linux/mediatek/patches-5.4/0604-net-dsa-mt7530-Add-the-support-of-MT7531-switch.patch @@ -394,7 +394,7 @@ Signed-off-by: Sean Wang */ mt7530_write(priv, MT7530_PCR_P(port), PCR_MATRIX(dsa_user_ports(priv->ds))); -@@ -1130,27 +1454,42 @@ mt7530_port_vlan_del(struct dsa_switch * +@@ -1122,27 +1446,42 @@ mt7530_port_vlan_del(struct dsa_switch * return 0; } @@ -444,7 +444,7 @@ Signed-off-by: Sean Wang val = mt7530_read(priv, MT7530_PCR_P(port)); if (ingress) { -@@ -1165,7 +1504,7 @@ static int mt7530_port_mirror_add(struct +@@ -1157,7 +1496,7 @@ static int mt7530_port_mirror_add(struct return 0; } @@ -453,7 +453,7 @@ Signed-off-by: Sean Wang struct dsa_mall_mirror_tc_entry *mirror) { struct mt7530_priv *priv = ds->priv; -@@ -1182,9 +1521,9 @@ static void mt7530_port_mirror_del(struc +@@ -1174,9 +1513,9 @@ static void mt7530_port_mirror_del(struc mt7530_write(priv, MT7530_PCR_P(port), val); if (!priv->mirror_rx && !priv->mirror_tx) { @@ -466,7 +466,7 @@ Signed-off-by: Sean Wang } } -@@ -1290,7 +1629,7 @@ mt7530_setup(struct dsa_switch *ds) +@@ -1282,7 +1621,7 @@ mt7530_setup(struct dsa_switch *ds) PCR_MATRIX_CLR); if (dsa_is_cpu_port(ds, i)) @@ -475,7 +475,7 @@ Signed-off-by: Sean Wang else mt7530_port_disable(ds, i); -@@ -1344,6 +1683,118 @@ mt7530_setup(struct dsa_switch *ds) +@@ -1336,6 +1675,118 @@ mt7530_setup(struct dsa_switch *ds) return 0; } @@ -594,7 +594,7 @@ Signed-off-by: Sean Wang static bool mt7530_phy_mode_supported(struct dsa_switch *ds, int port, const struct phylink_link_state *state) -@@ -1382,6 +1833,47 @@ unsupported: +@@ -1374,6 +1825,47 @@ unsupported: return false; } @@ -642,7 +642,7 @@ Signed-off-by: Sean Wang static bool mt753x_phy_mode_supported(struct dsa_switch *ds, int port, const struct phylink_link_state *state) -@@ -1414,6 +1906,227 @@ mt7530_mac_config(struct dsa_switch *ds, +@@ -1406,6 +1898,227 @@ mt7530_mac_config(struct dsa_switch *ds, return 0; } @@ -870,7 +870,7 @@ Signed-off-by: Sean Wang static int mt753x_mac_config(struct dsa_switch *ds, int port, unsigned int mode, const struct phylink_link_state *state) -@@ -1449,6 +2162,8 @@ mt753x_phylink_mac_config(struct dsa_swi +@@ -1441,6 +2154,8 @@ mt753x_phylink_mac_config(struct dsa_swi if (mt753x_mac_config(ds, port, mode, state) < 0) goto unsupported; @@ -879,7 +879,7 @@ Signed-off-by: Sean Wang break; case 6: /* 1st cpu port */ if (priv->p6_interface == state->interface) -@@ -1468,7 +2183,8 @@ unsupported: +@@ -1460,7 +2175,8 @@ unsupported: return; } @@ -889,7 +889,7 @@ Signed-off-by: Sean Wang dev_err(ds->dev, "%s: in-band negotiation unsupported\n", __func__); return; -@@ -1478,7 +2194,7 @@ unsupported: +@@ -1470,7 +2186,7 @@ unsupported: mcr_new = mcr_cur; mcr_new &= ~PMCR_LINK_SETTINGS_MASK; mcr_new |= PMCR_IFG_XMIT(1) | PMCR_MAC_MODE | PMCR_BACKOFF_EN | @@ -898,7 +898,7 @@ Signed-off-by: Sean Wang /* Are we connected to external phy */ if (port == 5 && dsa_is_user_port(ds, 5)) -@@ -1488,7 +2204,18 @@ unsupported: +@@ -1480,7 +2196,18 @@ unsupported: mt7530_write(priv, MT7530_PMCR_P(port), mcr_new); } @@ -918,7 +918,7 @@ Signed-off-by: Sean Wang unsigned int mode, phy_interface_t interface) { -@@ -1497,7 +2224,19 @@ static void mt7530_phylink_mac_link_down +@@ -1489,7 +2216,19 @@ static void mt7530_phylink_mac_link_down mt7530_clear(priv, MT7530_PMCR_P(port), PMCR_LINK_SETTINGS_MASK); } @@ -939,7 +939,7 @@ Signed-off-by: Sean Wang unsigned int mode, phy_interface_t interface, struct phy_device *phydev, -@@ -1507,18 +2246,29 @@ static void mt7530_phylink_mac_link_up(s +@@ -1499,18 +2238,29 @@ static void mt7530_phylink_mac_link_up(s struct mt7530_priv *priv = ds->priv; u32 mcr; @@ -971,7 +971,7 @@ Signed-off-by: Sean Wang break; } if (duplex == DUPLEX_FULL) { -@@ -1532,6 +2282,45 @@ static void mt7530_phylink_mac_link_up(s +@@ -1524,6 +2274,45 @@ static void mt7530_phylink_mac_link_up(s mt7530_set(priv, MT7530_PMCR_P(port), mcr); } @@ -1017,7 +1017,7 @@ Signed-off-by: Sean Wang static void mt7530_mac_port_validate(struct dsa_switch *ds, int port, unsigned long *supported) -@@ -1540,6 +2329,14 @@ mt7530_mac_port_validate(struct dsa_swit +@@ -1532,6 +2321,14 @@ mt7530_mac_port_validate(struct dsa_swit phylink_set(supported, 1000baseX_Full); } @@ -1032,7 +1032,7 @@ Signed-off-by: Sean Wang static void mt753x_phylink_validate(struct dsa_switch *ds, int port, unsigned long *supported, -@@ -1556,7 +2353,8 @@ mt753x_phylink_validate(struct dsa_switc +@@ -1548,7 +2345,8 @@ mt753x_phylink_validate(struct dsa_switc phylink_set_port_modes(mask); @@ -1042,7 +1042,7 @@ Signed-off-by: Sean Wang phylink_set(mask, 10baseT_Half); phylink_set(mask, 10baseT_Full); phylink_set(mask, 100baseT_Half); -@@ -1575,6 +2373,11 @@ mt753x_phylink_validate(struct dsa_switc +@@ -1567,6 +2365,11 @@ mt753x_phylink_validate(struct dsa_switc linkmode_and(supported, supported, mask); linkmode_and(state->advertising, state->advertising, mask); @@ -1054,7 +1054,7 @@ Signed-off-by: Sean Wang } static int -@@ -1665,6 +2468,63 @@ static int mt7530_set_mac_eee(struct dsa +@@ -1657,6 +2460,63 @@ static int mt7530_set_mac_eee(struct dsa return 0; } @@ -1118,7 +1118,7 @@ Signed-off-by: Sean Wang static int mt753x_phylink_mac_link_state(struct dsa_switch *ds, int port, struct phylink_link_state *state) -@@ -1718,13 +2578,14 @@ static const struct dsa_switch_ops mt753 +@@ -1710,13 +2570,14 @@ static const struct dsa_switch_ops mt753 .port_vlan_prepare = mt7530_port_vlan_prepare, .port_vlan_add = mt7530_port_vlan_add, .port_vlan_del = mt7530_port_vlan_del, @@ -1137,7 +1137,7 @@ Signed-off-by: Sean Wang .get_mac_eee = mt7530_get_mac_eee, .set_mac_eee = mt7530_set_mac_eee, }; -@@ -1752,11 +2613,26 @@ static const struct mt753x_info mt753x_t +@@ -1744,11 +2605,26 @@ static const struct mt753x_info mt753x_t .mac_port_get_state = mt7530_phylink_mac_link_state, .mac_port_config = mt7530_mac_config, }, diff --git a/target/linux/mediatek/patches-5.4/1011-net-ethernet-mtk_eth_soc-add-support-for-coherent-DM.patch b/target/linux/mediatek/patches-5.4/1011-net-ethernet-mtk_eth_soc-add-support-for-coherent-DM.patch index 98886767a2..e75d76b9cc 100644 --- a/target/linux/mediatek/patches-5.4/1011-net-ethernet-mtk_eth_soc-add-support-for-coherent-DM.patch +++ b/target/linux/mediatek/patches-5.4/1011-net-ethernet-mtk_eth_soc-add-support-for-coherent-DM.patch @@ -37,7 +37,7 @@ Signed-off-by: Felix Fietkau #include #include #include -@@ -2485,6 +2486,13 @@ static int mtk_hw_init(struct mtk_eth *e +@@ -2506,6 +2507,13 @@ static int mtk_hw_init(struct mtk_eth *e if (ret) goto err_disable_pm; @@ -51,7 +51,7 @@ Signed-off-by: Felix Fietkau if (MTK_HAS_CAPS(eth->soc->caps, MTK_SOC_MT7628)) { ret = device_reset(eth->dev); if (ret) { -@@ -3083,6 +3091,16 @@ static int mtk_probe(struct platform_dev +@@ -3104,6 +3112,16 @@ static int mtk_probe(struct platform_dev } } @@ -70,7 +70,7 @@ Signed-off-by: Felix Fietkau GFP_KERNEL); --- a/drivers/net/ethernet/mediatek/mtk_eth_soc.h +++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.h -@@ -435,6 +435,12 @@ +@@ -448,6 +448,12 @@ #define RSTCTRL_FE BIT(6) #define RSTCTRL_PPE BIT(31) diff --git a/target/linux/ramips/patches-5.4/0007-MIPS-ralink-copy-the-commandline-from-the-devicetree.patch b/target/linux/ramips/patches-5.4/0007-MIPS-ralink-copy-the-commandline-from-the-devicetree.patch index 54af571d85..c05ee8018d 100644 --- a/target/linux/ramips/patches-5.4/0007-MIPS-ralink-copy-the-commandline-from-the-devicetree.patch +++ b/target/linux/ramips/patches-5.4/0007-MIPS-ralink-copy-the-commandline-from-the-devicetree.patch @@ -10,7 +10,7 @@ Signed-off-by: John Crispin --- a/arch/mips/ralink/of.c +++ b/arch/mips/ralink/of.c -@@ -80,6 +80,8 @@ void __init plat_mem_setup(void) +@@ -82,6 +82,8 @@ void __init plat_mem_setup(void) __dt_setup_arch(dtb); diff --git a/target/linux/ramips/patches-5.4/0048-asoc-add-mt7620-support.patch b/target/linux/ramips/patches-5.4/0048-asoc-add-mt7620-support.patch index d0d4141a8d..cffdc4f4a1 100644 --- a/target/linux/ramips/patches-5.4/0048-asoc-add-mt7620-support.patch +++ b/target/linux/ramips/patches-5.4/0048-asoc-add-mt7620-support.patch @@ -18,24 +18,6 @@ Signed-off-by: John Crispin create mode 100644 sound/soc/ralink/mt7620-i2s.c create mode 100644 sound/soc/ralink/mt7620-wm8960.c ---- a/arch/mips/ralink/of.c -+++ b/arch/mips/ralink/of.c -@@ -13,6 +13,7 @@ - #include - #include - #include -+#include - #include - #include - -@@ -24,6 +25,7 @@ - #include "common.h" - - __iomem void *rt_sysc_membase; -+EXPORT_SYMBOL(rt_sysc_membase); - __iomem void *rt_memc_membase; - - __iomem void *plat_of_remap_node(const char *node) --- a/sound/soc/Kconfig +++ b/sound/soc/Kconfig @@ -60,6 +60,7 @@ source "sound/soc/mxs/Kconfig" diff --git a/target/linux/ramips/patches-5.4/401-net-ethernet-mediatek-support-net-labels.patch b/target/linux/ramips/patches-5.4/401-net-ethernet-mediatek-support-net-labels.patch index 6583fca60b..b011b140c7 100644 --- a/target/linux/ramips/patches-5.4/401-net-ethernet-mediatek-support-net-labels.patch +++ b/target/linux/ramips/patches-5.4/401-net-ethernet-mediatek-support-net-labels.patch @@ -14,7 +14,7 @@ Signed-off-by: René van Dorst --- a/drivers/net/ethernet/mediatek/mtk_eth_soc.c +++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c -@@ -2922,6 +2922,7 @@ static const struct net_device_ops mtk_n +@@ -2943,6 +2943,7 @@ static const struct net_device_ops mtk_n static int mtk_add_mac(struct mtk_eth *eth, struct device_node *np) { @@ -22,7 +22,7 @@ Signed-off-by: René van Dorst const __be32 *_id = of_get_property(np, "reg", NULL); struct phylink *phylink; int phy_mode, id, err; -@@ -3014,6 +3015,9 @@ static int mtk_add_mac(struct mtk_eth *e +@@ -3035,6 +3036,9 @@ static int mtk_add_mac(struct mtk_eth *e eth->netdev[id]->max_mtu = MTK_MAX_RX_LENGTH - MTK_RX_ETH_HLEN; From 2e10ed925e1e07c28570731a429efa5e7de3b826 Mon Sep 17 00:00:00 2001 From: Michael Yartys Date: Thu, 3 Jun 2021 23:50:12 +0200 Subject: [PATCH 22/35] ath10k-ct: update to latest version Changelog: - ath10k-ct: Add security fixes. - ath10k-ct: Add 5.12 kernel version. - ath10k-ct: Fix the beacon/mcast/bcast override issue - ath10k-ct 5.7: Fix setting mcast/bcast/beacon rate from debugfs. - ath10k-ct: Add 5.11 driver. Delete upstreamed patch and refresh the rest. Also, use the opportunity to set PKG_RELEASE to $(AUTORELEASE). Runtime-tested on ipq806x (Netgear R7800). Signed-off-by: Michael Yartys --- package/kernel/ath10k-ct/Makefile | 8 ++-- ...64-ath10k-commit-rates-from-mac80211.patch | 37 ------------------- ...rolling-support-for-various-chipsets.patch | 4 +- ...02-ath10k-use-tpt-trigger-by-default.patch | 4 +- 4 files changed, 8 insertions(+), 45 deletions(-) delete mode 100644 package/kernel/ath10k-ct/patches/164-ath10k-commit-rates-from-mac80211.patch diff --git a/package/kernel/ath10k-ct/Makefile b/package/kernel/ath10k-ct/Makefile index a225bd8b19..f06d7cf132 100644 --- a/package/kernel/ath10k-ct/Makefile +++ b/package/kernel/ath10k-ct/Makefile @@ -1,16 +1,16 @@ include $(TOPDIR)/rules.mk PKG_NAME:=ath10k-ct -PKG_RELEASE=2 +PKG_RELEASE=$(AUTORELEASE) PKG_LICENSE:=GPLv2 PKG_LICENSE_FILES:= PKG_SOURCE_URL:=https://github.com/greearb/ath10k-ct.git PKG_SOURCE_PROTO:=git -PKG_SOURCE_DATE:=2021-01-11 -PKG_SOURCE_VERSION:=9fe1df7d4f783b6b0cd1c99d11979e5a6e6fc40b -PKG_MIRROR_HASH:=4e30e256716611045e930b95eadaa8bfcadd5bdd8bbe3869cfe0f377920e812b +PKG_SOURCE_DATE:=2021-06-03 +PKG_SOURCE_VERSION:=b44cd7b2e7b0df5995ece18f358d4dfc40834ba1 +PKG_MIRROR_HASH:=59f961ad425eb1a48fa9c391a325cc0f23845daec9d12673445d3077f9756cf0 # Build the 5.10 ath10k-ct driver version. # Probably this should match as closely as diff --git a/package/kernel/ath10k-ct/patches/164-ath10k-commit-rates-from-mac80211.patch b/package/kernel/ath10k-ct/patches/164-ath10k-commit-rates-from-mac80211.patch deleted file mode 100644 index 842f3ea2a5..0000000000 --- a/package/kernel/ath10k-ct/patches/164-ath10k-commit-rates-from-mac80211.patch +++ /dev/null @@ -1,37 +0,0 @@ -From: Sven Eckelmann -Date: Tue, 26 Feb 2019 08:06:35 +0100 -Subject: ath10k-ct: apply mac80211 rates to ath10k-ct rate state - -The rates from mac80211 have to be copied to the state of ath10k-ct or -otherwise the ath10k_check_apply_special_rates function overwrites -them again with some default values. This breaks for example the -mcast_rate set for a wifi-iface. - -Signed-off-by: Sven Eckelmann - ---- a/ath10k-5.10/mac.c -+++ b/ath10k-5.10/mac.c -@@ -6774,6 +6774,7 @@ static void ath10k_recalculate_mgmt_rate - return; - } - -+ arvif->mgt_rate[def->chan->band] = hw_rate_code; - vdev_param = ar->wmi.vdev_param->mgmt_rate; - ret = ath10k_wmi_vdev_set_param(ar, arvif->vdev_id, vdev_param, - hw_rate_code); -@@ -7000,6 +7001,7 @@ static void ath10k_bss_info_changed(stru - "mac vdev %d mcast_rate %x\n", - arvif->vdev_id, rate); - -+ arvif->mcast_rate[band] = rate; - vdev_param = ar->wmi.vdev_param->mcast_data_rate; - ret = ath10k_wmi_vdev_set_param(ar, arvif->vdev_id, - vdev_param, rate); -@@ -7008,6 +7010,7 @@ static void ath10k_bss_info_changed(stru - "failed to set mcast rate on vdev %i: %d\n", - arvif->vdev_id, ret); - -+ arvif->bcast_rate[band] = rate; - vdev_param = ar->wmi.vdev_param->bcast_data_rate; - ret = ath10k_wmi_vdev_set_param(ar, arvif->vdev_id, - vdev_param, rate); diff --git a/package/kernel/ath10k-ct/patches/201-ath10k-add-LED-and-GPIO-controlling-support-for-various-chipsets.patch b/package/kernel/ath10k-ct/patches/201-ath10k-add-LED-and-GPIO-controlling-support-for-various-chipsets.patch index 749e796148..691b504c0f 100644 --- a/package/kernel/ath10k-ct/patches/201-ath10k-add-LED-and-GPIO-controlling-support-for-various-chipsets.patch +++ b/package/kernel/ath10k-ct/patches/201-ath10k-add-LED-and-GPIO-controlling-support-for-various-chipsets.patch @@ -210,7 +210,7 @@ v13: #include "htt.h" #include "htc.h" -@@ -1551,6 +1552,13 @@ struct ath10k { +@@ -1557,6 +1558,13 @@ struct ath10k { } testmode; struct { @@ -445,7 +445,7 @@ v13: { --- a/ath10k-5.10/wmi-tlv.c +++ b/ath10k-5.10/wmi-tlv.c -@@ -4585,6 +4585,8 @@ static const struct wmi_ops wmi_tlv_ops +@@ -4594,6 +4594,8 @@ static const struct wmi_ops wmi_tlv_ops .gen_echo = ath10k_wmi_tlv_op_gen_echo, .gen_vdev_spectral_conf = ath10k_wmi_tlv_op_gen_vdev_spectral_conf, .gen_vdev_spectral_enable = ath10k_wmi_tlv_op_gen_vdev_spectral_enable, diff --git a/package/kernel/ath10k-ct/patches/202-ath10k-use-tpt-trigger-by-default.patch b/package/kernel/ath10k-ct/patches/202-ath10k-use-tpt-trigger-by-default.patch index eae779ef58..6205c9b661 100644 --- a/package/kernel/ath10k-ct/patches/202-ath10k-use-tpt-trigger-by-default.patch +++ b/package/kernel/ath10k-ct/patches/202-ath10k-use-tpt-trigger-by-default.patch @@ -16,7 +16,7 @@ Signed-off-by: Mathias Kresin --- a/ath10k-5.10/core.h +++ b/ath10k-5.10/core.h -@@ -1659,6 +1659,10 @@ struct ath10k { +@@ -1665,6 +1665,10 @@ struct ath10k { u8 csi_data[4096]; u16 csi_data_len; @@ -42,7 +42,7 @@ Signed-off-by: Mathias Kresin if (ret) --- a/ath10k-5.10/mac.c +++ b/ath10k-5.10/mac.c -@@ -11400,7 +11400,7 @@ int ath10k_mac_register(struct ath10k *a +@@ -11403,7 +11403,7 @@ int ath10k_mac_register(struct ath10k *a ar->hw->weight_multiplier = ATH10K_AIRTIME_WEIGHT_MULTIPLIER; #ifdef CPTCFG_MAC80211_LEDS From 8716dda0743454e3949b815613542a4d00fc2a09 Mon Sep 17 00:00:00 2001 From: Mark Carroll Date: Sat, 8 May 2021 11:42:50 +0000 Subject: [PATCH 23/35] x86: kernel: enable Fusion-MPT SAS driver Compile in MPT SAS driver required to mount rootfs on some VMWare systems (e.g. required for 1&1 IONOS). Signed-off-by: Mark Carroll --- target/linux/x86/64/config-5.10 | 1 + target/linux/x86/64/config-5.4 | 1 + 2 files changed, 2 insertions(+) diff --git a/target/linux/x86/64/config-5.10 b/target/linux/x86/64/config-5.10 index 7c5a698c97..2db2f4998b 100644 --- a/target/linux/x86/64/config-5.10 +++ b/target/linux/x86/64/config-5.10 @@ -184,6 +184,7 @@ CONFIG_FRAMEBUFFER_CONSOLE=y CONFIG_FRAMEBUFFER_CONSOLE_DETECT_PRIMARY=y # CONFIG_FRAMEBUFFER_CONSOLE_ROTATION is not set CONFIG_FREEZER=y +CONFIG_FUSION_SAS=y CONFIG_FW_CACHE=y CONFIG_GART_IOMMU=y CONFIG_GENERIC_BUG_RELATIVE_POINTERS=y diff --git a/target/linux/x86/64/config-5.4 b/target/linux/x86/64/config-5.4 index ef03eaa234..b97b9f64c1 100644 --- a/target/linux/x86/64/config-5.4 +++ b/target/linux/x86/64/config-5.4 @@ -183,6 +183,7 @@ CONFIG_FRAMEBUFFER_CONSOLE=y CONFIG_FRAMEBUFFER_CONSOLE_DETECT_PRIMARY=y # CONFIG_FRAMEBUFFER_CONSOLE_ROTATION is not set CONFIG_FREEZER=y +CONFIG_FUSION_SAS=y CONFIG_GART_IOMMU=y CONFIG_GENERIC_BUG_RELATIVE_POINTERS=y CONFIG_GENERIC_CPU=y From 2fdb7053f9e77ed7ae4be0cdbf8a59f79988ee20 Mon Sep 17 00:00:00 2001 From: Kuan-Yi Li Date: Sun, 30 May 2021 07:35:38 +0800 Subject: [PATCH 24/35] kernel: usb: add kmod-usb-gadget-ncm Add kernel module package for USB Network Control Model (NCM) Gadget support. Signed-off-by: Kuan-Yi Li --- package/kernel/linux/modules/usb.mk | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/package/kernel/linux/modules/usb.mk b/package/kernel/linux/modules/usb.mk index 9e8752cc64..3249b854d6 100644 --- a/package/kernel/linux/modules/usb.mk +++ b/package/kernel/linux/modules/usb.mk @@ -179,6 +179,23 @@ endef $(eval $(call KernelPackage,usb-gadget-eth)) +define KernelPackage/usb-gadget-ncm + TITLE:=USB Network Control Model (NCM) Gadget support + KCONFIG:=CONFIG_USB_G_NCM + DEPENDS:=+kmod-usb-gadget +kmod-usb-lib-composite \ + +kmod-usb-gadget-eth + FILES:= \ + $(LINUX_DIR)/drivers/usb/gadget/function/usb_f_ncm.ko \ + $(LINUX_DIR)/drivers/usb/gadget/legacy/g_ncm.ko + AUTOLOAD:=$(call AutoLoad,52,usb_f_ncm) + $(call AddDepends/usb) +endef + +define KernelPackage/usb-gadget-ncm/description + Kernel support for USB Network Control Model (NCM) Gadget +endef + +$(eval $(call KernelPackage,usb-gadget-ncm)) define KernelPackage/usb-gadget-serial TITLE:=USB Serial Gadget support From e34cc5eb377ce94a8e1717546a4e156a9bd4984b Mon Sep 17 00:00:00 2001 From: Martin Schiller Date: Wed, 19 May 2021 12:33:26 +0200 Subject: [PATCH 25/35] layerscape: armv8_64b: enable CONFIG_ARM_PSCI_CPUIDLE Enable PSCI firmware based CPUidle driver. PSCI firmware is the standard power management control for all ARM64 based platforms. Signed-off-by: Martin Schiller --- target/linux/layerscape/armv8_64b/config-5.4 | 1 + 1 file changed, 1 insertion(+) diff --git a/target/linux/layerscape/armv8_64b/config-5.4 b/target/linux/layerscape/armv8_64b/config-5.4 index ac2a6f1918..f72154f290 100644 --- a/target/linux/layerscape/armv8_64b/config-5.4 +++ b/target/linux/layerscape/armv8_64b/config-5.4 @@ -56,6 +56,7 @@ CONFIG_ARM_GIC_V3_ITS=y CONFIG_ARM_GIC_V3_ITS_FSL_MC=y CONFIG_ARM_GIC_V3_ITS_PCI=y # CONFIG_ARM_PL172_MPMC is not set +CONFIG_ARM_PSCI_CPUIDLE=y CONFIG_ARM_PSCI_FW=y CONFIG_ARM_SMMU=y # CONFIG_ARM_SMMU_DISABLE_BYPASS_BY_DEFAULT is not set From 6fb27e8e6d05ed426f200242fdc1710f6f849127 Mon Sep 17 00:00:00 2001 From: Alex Henrie Date: Thu, 3 Jun 2021 22:37:49 -0600 Subject: [PATCH 26/35] ipq806x: fix LAN and WAN port assignments on TP-Link AD7200 LAN port 4 was swapped with the WAN port and the remaining three LAN ports were numbered in reverse order from their labels on the case. Fixes: 1a775a4fd033 ("ipq806x: add support for TP-Link Talon AD7200") Signed-off-by: Alex Henrie --- target/linux/ipq806x/base-files/etc/board.d/02_network | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/target/linux/ipq806x/base-files/etc/board.d/02_network b/target/linux/ipq806x/base-files/etc/board.d/02_network index 22d607b0ec..1a1cec51aa 100644 --- a/target/linux/ipq806x/base-files/etc/board.d/02_network +++ b/target/linux/ipq806x/base-files/etc/board.d/02_network @@ -57,7 +57,6 @@ nec,wg2600hp3) "2:lan" "3:lan" "4:lan" "5:lan" "0@eth1" "1:wan" "6@eth0" ;; netgear,r7800 |\ -tplink,ad7200 |\ tplink,c2600) ucidef_add_switch "switch0" \ "1:lan:4" "2:lan:3" "3:lan:2" "4:lan:1" "6@eth1" "5:wan" "0@eth0" @@ -72,6 +71,10 @@ qcom,ipq8064-db149) ucidef_add_switch "switch0" \ "1:lan" "2:lan" "3:lan" "4:lan" "6u@eth1" "5:wan" "0u@eth0" ;; +tplink,ad7200) + ucidef_add_switch "switch0" \ + "2:lan:1" "3:lan:2" "4:lan:3" "5:lan:4" "6@eth1" "1:wan" "0@eth0" + ;; ubnt,unifi-ac-hd) ucidef_set_interface_lan "eth0 eth1" ;; From 74417f8b3a803c59995887e20437394e1abeaaa2 Mon Sep 17 00:00:00 2001 From: Hauke Mehrtens Date: Fri, 28 May 2021 18:35:40 +0200 Subject: [PATCH 27/35] toolchain: gdb: Add optional python support Compile gdb with python support optionally. To use the Python support in gdb some extra python files are needed, install them too. While at it also install other shared files which we did not install before. If gdb is built without Python support the python folder does not exists. Signed-off-by: Hauke Mehrtens --- toolchain/Config.in | 8 ++++++++ toolchain/gdb/Makefile | 11 ++++++++++- 2 files changed, 18 insertions(+), 1 deletion(-) diff --git a/toolchain/Config.in b/toolchain/Config.in index 6dda9af92d..8ff5438d79 100644 --- a/toolchain/Config.in +++ b/toolchain/Config.in @@ -259,6 +259,14 @@ config GDB help Enable if you want to build the gdb. +config GDB_PYTHON + bool + depends on GDB + prompt "Build gdb with python binding" + + help + Enable the python bindings for GDB to allow using python in the gdb shell. + config USE_GLIBC default y if !TOOLCHAINOPTS && !EXTERNAL_TOOLCHAIN && !NATIVE_TOOLCHAIN && (arc) bool diff --git a/toolchain/gdb/Makefile b/toolchain/gdb/Makefile index 05e3c7de3c..2708eff869 100644 --- a/toolchain/gdb/Makefile +++ b/toolchain/gdb/Makefile @@ -36,7 +36,6 @@ HOST_CONFIGURE_ARGS = \ --without-included-gettext \ --enable-threads \ --with-expat \ - --without-python \ --disable-unit-tests \ --disable-ubsan \ --disable-binutils \ @@ -44,11 +43,21 @@ HOST_CONFIGURE_ARGS = \ --disable-gas \ --disable-sim +ifneq ($(CONFIG_GDB_PYTHON),) + HOST_CONFIGURE_ARGS+= --with-python +else + HOST_CONFIGURE_ARGS:= --without-python +endif + define Host/Install mkdir -p $(TOOLCHAIN_DIR)/bin $(INSTALL_BIN) $(HOST_BUILD_DIR)/gdb/gdb $(TOOLCHAIN_DIR)/bin/$(TARGET_CROSS)gdb ln -fs $(TARGET_CROSS)gdb $(TOOLCHAIN_DIR)/bin/$(GNU_TARGET_NAME)-gdb strip $(TOOLCHAIN_DIR)/bin/$(TARGET_CROSS)gdb + mkdir -p $(TOOLCHAIN_DIR)/share/gdb + -cp -R $(HOST_BUILD_DIR)/gdb/data-directory/python $(TOOLCHAIN_DIR)/share/gdb/ + cp -R $(HOST_BUILD_DIR)/gdb/data-directory/syscalls $(TOOLCHAIN_DIR)/share/gdb/ + cp -R $(HOST_BUILD_DIR)/gdb/data-directory/system-gdbinit $(TOOLCHAIN_DIR)/share/gdb/ endef define Host/Clean From 609aa3978393d7436e5c9caba89d3356af021c80 Mon Sep 17 00:00:00 2001 From: Rui Salvaterra Date: Thu, 27 May 2021 11:56:37 +0100 Subject: [PATCH 28/35] tools/isl: bump to 0.24 Tested with Graphite and -floop-nest-optimize, without issues. Signed-off-by: Rui Salvaterra --- tools/isl/Makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/isl/Makefile b/tools/isl/Makefile index c1000e1e31..be372fe2a8 100644 --- a/tools/isl/Makefile +++ b/tools/isl/Makefile @@ -7,11 +7,11 @@ include $(TOPDIR)/rules.mk PKG_NAME:=isl -PKG_VERSION:=0.20 +PKG_VERSION:=0.24 PKG_SOURCE_URL:=http://isl.gforge.inria.fr PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz -PKG_HASH:=a5596a9fb8a5b365cb612e4b9628735d6e67e9178fae134a816ae195017e77aa +PKG_HASH:=043105cc544f416b48736fff8caf077fb0663a717d06b1113f16e391ac99ebad HOST_BUILD_PARALLEL:=1 From 1984a6bbcaac95c439dd4a6eba2f78c54e9be215 Mon Sep 17 00:00:00 2001 From: Tomasz Maciej Nowak Date: Tue, 25 May 2021 15:26:06 +0200 Subject: [PATCH 29/35] ipq40xx: add uboot-envtools to default packages When support for Luma WRTQ-329ACN was added, the instructions for flashing this device include using tools from uboot-envtools package. Unfortunately the OpenWrt buildroot system omits packages from DEVICE_PACKAGES when CONFIG_TARGET_MULTI_PROFILE, CONFIG_TARGET_PER_DEVICE_ROOTFS, CONFIG_TARGET_ALL_PROFILES are set. In result the official images are without tools mentioned in the instruction. The workoround for the fashing would be installing uboot-envtools when booted with initramfs image, but not always the access to internet is available. The other method would be to issue the necesary command in U-Boot environment but some serial terminals default configuration don't work well with pasting lines longer than 80 chars. Therefore add uboot-envtools to default packages, which adds really small flash footprint to rootfs, where increased size usually is not an issue. Signed-off-by: Tomasz Maciej Nowak --- target/linux/ipq40xx/Makefile | 3 ++- target/linux/ipq40xx/image/generic.mk | 28 ++++++++++++--------------- 2 files changed, 14 insertions(+), 17 deletions(-) diff --git a/target/linux/ipq40xx/Makefile b/target/linux/ipq40xx/Makefile index 43b1fcb0f9..400612376c 100644 --- a/target/linux/ipq40xx/Makefile +++ b/target/linux/ipq40xx/Makefile @@ -18,6 +18,7 @@ DEFAULT_PACKAGES += \ kmod-usb-dwc3-qcom \ kmod-leds-gpio kmod-gpio-button-hotplug swconfig \ kmod-ath10k-ct wpad-basic-wolfssl \ - kmod-usb3 kmod-usb-dwc3 ath10k-firmware-qca4019-ct + kmod-usb3 kmod-usb-dwc3 ath10k-firmware-qca4019-ct \ + uboot-envtools $(eval $(call BuildTarget)) diff --git a/target/linux/ipq40xx/image/generic.mk b/target/linux/ipq40xx/image/generic.mk index 2d6186ed99..68e565594d 100644 --- a/target/linux/ipq40xx/image/generic.mk +++ b/target/linux/ipq40xx/image/generic.mk @@ -131,8 +131,7 @@ define Device/alfa-network_ap120c-ac DEVICE_VENDOR := ALFA Network DEVICE_MODEL := AP120C-AC SOC := qcom-ipq4018 - DEVICE_PACKAGES := kmod-usb-acm \ - kmod-tpm-i2c-atmel uboot-envtools + DEVICE_PACKAGES := kmod-usb-acm kmod-tpm-i2c-atmel BLOCKSIZE := 128k PAGESIZE := 2048 IMAGE_SIZE := 65536k @@ -151,7 +150,6 @@ endef define Device/aruba_ap-303 $(call Device/aruba_glenmorangie) DEVICE_MODEL := AP-303 - DEVICE_PACKAGES += uboot-envtools endef TARGET_DEVICES += aruba_ap-303 @@ -164,7 +162,7 @@ TARGET_DEVICES += aruba_ap-303h define Device/aruba_ap-365 $(call Device/aruba_glenmorangie) DEVICE_MODEL := AP-365 - DEVICE_PACKAGES += kmod-hwmon-ad7418 uboot-envtools + DEVICE_PACKAGES += kmod-hwmon-ad7418 endef TARGET_DEVICES += aruba_ap-365 @@ -247,7 +245,7 @@ define Device/buffalo_wtr-m2133hp DEVICE_VENDOR := Buffalo DEVICE_MODEL := WTR-M2133HP SOC := qcom-ipq4019 - DEVICE_PACKAGES := uboot-envtools ath10k-firmware-qca9984-ct ipq-wifi-buffalo_wtr-m2133hp + DEVICE_PACKAGES := ath10k-firmware-qca9984-ct ipq-wifi-buffalo_wtr-m2133hp BLOCKSIZE := 128k PAGESIZE := 2048 endef @@ -328,7 +326,7 @@ define Device/devolo_magic-2-wifi-next IMAGE_SIZE := 26624k IMAGES := sysupgrade.bin IMAGE/sysupgrade.bin := append-kernel | append-rootfs | pad-rootfs | append-metadata - DEVICE_PACKAGES := ipq-wifi-devolo_magic-2-wifi-next uboot-envtools + DEVICE_PACKAGES := ipq-wifi-devolo_magic-2-wifi-next endef TARGET_DEVICES += devolo_magic-2-wifi-next @@ -367,7 +365,7 @@ define Device/edgecore_ecw5211 SOC := qcom-ipq4018 BLOCKSIZE := 128k PAGESIZE := 2048 - DEVICE_PACKAGES := kmod-tpm-i2c-atmel kmod-usb-acm uboot-envtools + DEVICE_PACKAGES := kmod-tpm-i2c-atmel kmod-usb-acm endef TARGET_DEVICES += edgecore_ecw5211 @@ -551,7 +549,6 @@ define Device/linksys_ea6350v3 UBINIZE_OPTS := -E 5 IMAGES += factory.bin IMAGE/factory.bin := append-kernel | append-uImage-fakehdr filesystem | pad-to $$$$(KERNEL_SIZE) | append-ubi | linksys-image type=EA6350v3 - DEVICE_PACKAGES := uboot-envtools endef TARGET_DEVICES += linksys_ea6350v3 @@ -567,7 +564,7 @@ define Device/linksys_ea8300 UBINIZE_OPTS := -E 5 # EOD marks to "hide" factory sig at EOF IMAGES += factory.bin IMAGE/factory.bin := append-kernel | pad-to $$$$(KERNEL_SIZE) | append-ubi | linksys-image type=EA8300 - DEVICE_PACKAGES := uboot-envtools ath10k-firmware-qca9888-ct ipq-wifi-linksys_ea8300 kmod-usb-ledtrig-usbport + DEVICE_PACKAGES := ath10k-firmware-qca9888-ct ipq-wifi-linksys_ea8300 kmod-usb-ledtrig-usbport endef TARGET_DEVICES += linksys_ea8300 @@ -583,7 +580,7 @@ define Device/linksys_mr8300 UBINIZE_OPTS := -E 5 # EOD marks to "hide" factory sig at EOF IMAGES += factory.bin IMAGE/factory.bin := append-kernel | pad-to $$$$(KERNEL_SIZE) | append-ubi | linksys-image type=MR8300 - DEVICE_PACKAGES := uboot-envtools ath10k-firmware-qca9888-ct ipq-wifi-linksys_mr8300-v0 kmod-usb-ledtrig-usbport + DEVICE_PACKAGES := ath10k-firmware-qca9888-ct ipq-wifi-linksys_mr8300-v0 kmod-usb-ledtrig-usbport endef TARGET_DEVICES += linksys_mr8300 @@ -592,7 +589,7 @@ define Device/luma_wrtq-329acn DEVICE_VENDOR := Luma Home DEVICE_MODEL := WRTQ-329ACN SOC := qcom-ipq4018 - DEVICE_PACKAGES := ipq-wifi-luma_wrtq-329acn kmod-ath3k kmod-eeprom-at24 kmod-i2c-gpio uboot-envtools + DEVICE_PACKAGES := ipq-wifi-luma_wrtq-329acn kmod-ath3k kmod-eeprom-at24 kmod-i2c-gpio IMAGE_SIZE := 76632k BLOCKSIZE := 128k PAGESIZE := 2048 @@ -673,7 +670,6 @@ define Device/openmesh_a42 IMAGES += factory.bin IMAGE/factory.bin := append-rootfs | pad-rootfs | openmesh-image ce_type=A42 IMAGE/sysupgrade.bin/squashfs := append-rootfs | pad-rootfs | sysupgrade-tar rootfs=$$$$@ | append-metadata - DEVICE_PACKAGES := uboot-envtools endef TARGET_DEVICES += openmesh_a42 @@ -689,7 +685,7 @@ define Device/openmesh_a62 IMAGES += factory.bin IMAGE/factory.bin := append-rootfs | pad-rootfs | openmesh-image ce_type=A62 IMAGE/sysupgrade.bin/squashfs := append-rootfs | pad-rootfs | sysupgrade-tar rootfs=$$$$@ | append-metadata - DEVICE_PACKAGES := ath10k-firmware-qca9888-ct uboot-envtools + DEVICE_PACKAGES := ath10k-firmware-qca9888-ct endef TARGET_DEVICES += openmesh_a62 @@ -705,7 +701,7 @@ define Device/plasmacloud_pa1200 IMAGES += factory.bin IMAGE/factory.bin := append-rootfs | pad-rootfs | openmesh-image ce_type=PA1200 IMAGE/sysupgrade.bin/squashfs := append-rootfs | pad-rootfs | sysupgrade-tar rootfs=$$$$@ | append-metadata - DEVICE_PACKAGES := uboot-envtools ipq-wifi-plasmacloud-pa1200 + DEVICE_PACKAGES := ipq-wifi-plasmacloud-pa1200 endef TARGET_DEVICES += plasmacloud_pa1200 @@ -721,7 +717,7 @@ define Device/plasmacloud_pa2200 IMAGES += factory.bin IMAGE/factory.bin := append-rootfs | pad-rootfs | openmesh-image ce_type=PA2200 IMAGE/sysupgrade.bin/squashfs := append-rootfs | pad-rootfs | sysupgrade-tar rootfs=$$$$@ | append-metadata - DEVICE_PACKAGES := ath10k-firmware-qca9888-ct ipq-wifi-plasmacloud-pa2200 uboot-envtools + DEVICE_PACKAGES := ath10k-firmware-qca9888-ct ipq-wifi-plasmacloud-pa2200 endef TARGET_DEVICES += plasmacloud_pa2200 @@ -815,7 +811,7 @@ define Device/zyxel_nbg6617 # this minimum-size. However, the larger image can be flashed both ways. IMAGE/factory.bin := append-rootfs | pad-rootfs | pad-to 64k | check-size $$$$(ROOTFS_SIZE) | zyxel-ras-image separate-kernel IMAGE/sysupgrade.bin/squashfs := append-rootfs | pad-rootfs | check-size $$$$(ROOTFS_SIZE) | sysupgrade-tar rootfs=$$$$@ | append-metadata - DEVICE_PACKAGES := uboot-envtools kmod-usb-ledtrig-usbport + DEVICE_PACKAGES := kmod-usb-ledtrig-usbport endef TARGET_DEVICES += zyxel_nbg6617 From db014428b153215a2bdffc80ea44a3a03a1e18cd Mon Sep 17 00:00:00 2001 From: Tomasz Maciej Nowak Date: Tue, 25 May 2021 14:53:43 +0200 Subject: [PATCH 30/35] mvebu: armada-37xx: remove ethernet alias patch This patch has been added with initial support for ESPRESSObin board and mistakenly it affects all boards with this SoC. Drop this patch since the aliases are now in upstream dts for ESPRESSObin. If any boards are relying on this, please add the respective alias to that board dts. Signed-off-by: Tomasz Maciej Nowak --- ...ts-marvell-armada37xx-Add-eth0-alias.patch | 20 ------------------- ...itch-PHY-operation-mode-to-2500base.patch} | 0 ...mada-xp-linksys-mamba-resize-kernel.patch} | 0 ...16-armada-370-dts-fix-crypto-engine.patch} | 0 4 files changed, 20 deletions(-) delete mode 100644 target/linux/mvebu/patches-5.10/314-arm64-dts-marvell-armada37xx-Add-eth0-alias.patch rename target/linux/mvebu/patches-5.10/{315-arm64-dts-uDPU-switch-PHY-operation-mode-to-2500base.patch => 314-arm64-dts-uDPU-switch-PHY-operation-mode-to-2500base.patch} (100%) rename target/linux/mvebu/patches-5.10/{316-armada-xp-linksys-mamba-resize-kernel.patch => 315-armada-xp-linksys-mamba-resize-kernel.patch} (100%) rename target/linux/mvebu/patches-5.10/{317-armada-370-dts-fix-crypto-engine.patch => 316-armada-370-dts-fix-crypto-engine.patch} (100%) diff --git a/target/linux/mvebu/patches-5.10/314-arm64-dts-marvell-armada37xx-Add-eth0-alias.patch b/target/linux/mvebu/patches-5.10/314-arm64-dts-marvell-armada37xx-Add-eth0-alias.patch deleted file mode 100644 index e989f59d5c..0000000000 --- a/target/linux/mvebu/patches-5.10/314-arm64-dts-marvell-armada37xx-Add-eth0-alias.patch +++ /dev/null @@ -1,20 +0,0 @@ -From be893f672e340b56ca60f2f6c32fdd713a5852f5 Mon Sep 17 00:00:00 2001 -From: Kevin Mihelich -Date: Tue, 4 Jul 2017 19:25:28 -0600 -Subject: arm64: dts: marvell: armada37xx: Add eth0 alias - -Signed-off-by: Kevin Mihelich ---- - arch/arm64/boot/dts/marvell/armada-37xx.dtsi | 1 + - 1 file changed, 1 insertion(+) - ---- a/arch/arm64/boot/dts/marvell/armada-37xx.dtsi -+++ b/arch/arm64/boot/dts/marvell/armada-37xx.dtsi -@@ -18,6 +18,7 @@ - #size-cells = <2>; - - aliases { -+ ethernet0 = ð0; - serial0 = &uart0; - serial1 = &uart1; - }; diff --git a/target/linux/mvebu/patches-5.10/315-arm64-dts-uDPU-switch-PHY-operation-mode-to-2500base.patch b/target/linux/mvebu/patches-5.10/314-arm64-dts-uDPU-switch-PHY-operation-mode-to-2500base.patch similarity index 100% rename from target/linux/mvebu/patches-5.10/315-arm64-dts-uDPU-switch-PHY-operation-mode-to-2500base.patch rename to target/linux/mvebu/patches-5.10/314-arm64-dts-uDPU-switch-PHY-operation-mode-to-2500base.patch diff --git a/target/linux/mvebu/patches-5.10/316-armada-xp-linksys-mamba-resize-kernel.patch b/target/linux/mvebu/patches-5.10/315-armada-xp-linksys-mamba-resize-kernel.patch similarity index 100% rename from target/linux/mvebu/patches-5.10/316-armada-xp-linksys-mamba-resize-kernel.patch rename to target/linux/mvebu/patches-5.10/315-armada-xp-linksys-mamba-resize-kernel.patch diff --git a/target/linux/mvebu/patches-5.10/317-armada-370-dts-fix-crypto-engine.patch b/target/linux/mvebu/patches-5.10/316-armada-370-dts-fix-crypto-engine.patch similarity index 100% rename from target/linux/mvebu/patches-5.10/317-armada-370-dts-fix-crypto-engine.patch rename to target/linux/mvebu/patches-5.10/316-armada-370-dts-fix-crypto-engine.patch From e9c9b5ec72e4ec8add23515a76bd5de5e7cac2a1 Mon Sep 17 00:00:00 2001 From: Tomasz Maciej Nowak Date: Mon, 24 May 2021 14:41:14 +0200 Subject: [PATCH 31/35] kernel: package Synopsys Designware PCI to I2C controller This is present on Roqos Core RC10 and needed to control LED matrix. Signed-off-by: Tomasz Maciej Nowak --- package/kernel/linux/modules/i2c.mk | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/package/kernel/linux/modules/i2c.mk b/package/kernel/linux/modules/i2c.mk index ca6463c81b..f429763227 100644 --- a/package/kernel/linux/modules/i2c.mk +++ b/package/kernel/linux/modules/i2c.mk @@ -84,6 +84,35 @@ endef $(eval $(call KernelPackage,i2c-algo-pcf)) +I2C_DWCORE_MODULES:= \ + CONFIG_I2C_DESIGNWARE_CORE:drivers/i2c/busses/i2c-designware-core + +define KernelPackage/i2c-designware-core + $(call i2c_defaults,$(I2C_DWCORE_MODULES),58) + TITLE:=Synopsys DesignWare I2C core + DEPENDS:=+kmod-i2c-core +!LINUX_5_4:kmod-regmap-core + HIDDEN:=y +endef + +$(eval $(call KernelPackage,i2c-designware-core)) + + +I2C_DWPCI_MODULES:= \ + CONFIG_I2C_DESIGNWARE_PCI:drivers/i2c/busses/i2c-designware-pci + +define KernelPackage/i2c-designware-pci + $(call i2c_defaults,$(I2C_DWPCI_MODULES),59) + TITLE:=Synopsys DesignWare PCI + DEPENDS:=+kmod-i2c-designware-core +endef + +define KernelPackage/i2c-designware-pci/description + Support for Synopsys DesignWare I2C controller. Only master mode is supported. +endef + +$(eval $(call KernelPackage,i2c-designware-pci)) + + I2C_GPIO_MODULES:= \ CONFIG_I2C_GPIO:drivers/i2c/busses/i2c-gpio From 09448d8ff30d7c1474c8dd0a762efe0417c471bd Mon Sep 17 00:00:00 2001 From: Tomasz Maciej Nowak Date: Mon, 24 May 2021 14:41:15 +0200 Subject: [PATCH 32/35] x86: add Roqos Core RC10 ethernet interfaces eth0 -> single NIC (i211at) eth1 -> single NIC (i211at) -> 4-port unmanaged switch (BCM53125U) Notes UART is exposed on J4 connector, pinout starting from pin marked 1: 1. GND, 2. NC?, 3. NC?, 4. RX, 5. TX, 6. NC? baud: 115200, parity: none, flow control: none The board is setup by coreboot with UEFI. To enter setup screen hold ESC key on boot. The 5-LED multicolor matrix is attached on first I2C device named "Synopsys DesignWare I2C adapter" at address 0x60. Controlling values are stored in /opt/roqos/etc/rcLED.conf of original firmware. Remember to backup the original firmware, there are no downloadable copies. Signed-off-by: Tomasz Maciej Nowak --- target/linux/x86/base-files/etc/board.d/02_network | 3 +++ 1 file changed, 3 insertions(+) diff --git a/target/linux/x86/base-files/etc/board.d/02_network b/target/linux/x86/base-files/etc/board.d/02_network index 581daf49b6..30035dcbe9 100644 --- a/target/linux/x86/base-files/etc/board.d/02_network +++ b/target/linux/x86/base-files/etc/board.d/02_network @@ -11,6 +11,9 @@ case "$(board_name)" in pc-engines-apu1|pc-engines-apu2|pc-engines-apu3) ucidef_set_interfaces_lan_wan "eth1 eth2" "eth0" ;; +roqos-roqos-core-rc10) + ucidef_set_interfaces_lan_wan "eth1" "eth0" + ;; sophos-sg-105|sophos-xg-105) ucidef_set_interfaces_lan_wan "eth0 eth2 eth3" "eth1" ;; From ff2bb16730f629d54bde8ba85c75d8614741e3fd Mon Sep 17 00:00:00 2001 From: Josef Schlehofer Date: Sat, 1 May 2021 08:51:12 +0200 Subject: [PATCH 33/35] linux-firmware: update to version 20210315 and trim down broadcom FW MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit In there linux-firmware repository located in kernel, there were removed old broadcom firmware [1] as they seem to be likely vulnerable to KrØØk vulnerability (CVE-2019-15126), because Cypress released new versions and superseded by it. In OpenWrt, there is Makefile for cypress-firmware, which already provides the same named packages like it was in linux-firmware. For example, cypress-firmware-43455-sdio provides brcmfmac-firmware-43455-sdio [2]. Changelog between 2020118 and 20210315: 3568f96 (tag: 20210315) linux-firmware: Update firmware file for Intel Bluetooth AX210 9e96e50 linux-firmware: Update firmware file for Intel Bluetooth AX200 c8d0db5 linux-firmware: Update firmware file for Intel Bluetooth AX201 5e2a387 Merge tag 'iwlwifi-fw-2021-03-05-v3' of git://git.kernel.org/pub/scm/linux/kernel/git/iwlwifi/linux-firmware into main b0d3e31 rtw88: 8822c: Update normal firmware to v9.9.6 5a2fd63 iwlwifi: add new FWs from core59-66 release 4f54906 iwlwifi: update 9000-family firmwares 11b7607 iwlwifi: update 7265D firmware e425f76 Merge branch 'add-silabs-wf200' of github.com:jerome-pouiller/linux-firmware into main 5ecd13f Mellanox: Add new mlxsw_spectrum firmware xx.2008.2406 58fb90a linux-firmware: add frimware for mediatek bluetooth chip (MT7921) e576a1b rtw89: 8852a: add firmware v0.9.12.2 048a7cb WHENCE: add missing symlink for BananaPi M3 aa6c6e7 Add symlink for BananaPi M2 to brcmfmac43430-sdio config 58825f7 brcm: Fix Raspberry Pi 4B NVRAM file 520f71b silabs: add new firmware for WF200 f7915a0 amdgpu: add initial firmware for green sardine 80cb579 rtw88: RTL8822C: Update normal firmware to v9.9.5 b79d239 (tag: 20210208) Merge branch 'DG1-guc-huc-ADLS-dmc' of git://anongit.freedesktop.org/drm/drm-firmware into main 66970e1 Merge branch 'qcom-rb5' of https://github.com/lumag/linux-firmware into main cf6fc2b Mellanox: Add new mlxsw_spectrum firmware xx.2008.2304 391fd50 linux-firmware: add firmware for MT7921 c5e3240 rtw88: RTL8821C: Update firmware to v24.8 d33d2d8 linux-firmware: Update firmware file for Intel Bluetooth AX210 3027ae4 linux-firmware: Update firmware file for Intel Bluetooth AX200 13979c3 linux-firmware: Update firmware file for Intel Bluetooth AX201 348d8a9 i915: Add DMC v2.01 for ADL-S f33f1f7 i915: Add HuC v7.7.1 for DG1 6a422f5 i915: Add GuC v49.0.1 for DG1 df822a8 qcom: Add venus firmware files for VPU-1.0 11a1db1 qcom: Add SM8250 Compute DSP firmware e55248b qcom: Add SM8250 Audio DSP firmware da74cc6 qcom: add firmware files for Adreno a650 0578970 brcm: Link RPi4's WiFi firmware with DMI machine name. d528862 brcm: Add NVRAM for Vamrs 96boards Rock960 870b805 brcm: Update Raspberry Pi 3B+/4B NVRAM for downstream changes a28a590 cypress: Fix link direction 060ad8b cypress: Link the new cypress firmware to the old brcm files 0f0aefd brcm: remove old brcm firmwares that have newer cypress variants f580dc2 rtl_bt: Update RTL8822C BT(UART I/F) FW to 0x059A_25CB 7df2220 rtl_bt: Update RTL8822C BT(USB I/F) FW to 0x099a_7253 e79405d rtl_bt: Add firmware and config files for RTL8852A BT USB chip ef3813d rtl_bt: Update RTL8821C BT(USB I/F) FW to 0x829a_7644 646f159 (tag: 20201218) make AP6212 in bananpi m2 plus/zero work 28185ec linux-firmware: Update firmware file for Intel Bluetooth AX210 23da869 linux-firmware: Update firmware file for Intel Bluetooth AX200 2099248 linux-firmware: Update firmware file for Intel Bluetooth AX201 94de5e2 linux-firmware: Update firmware file for Intel Bluetooth 9560 27a3689 linux-firmware: Update firmware file for Intel Bluetooth 9260 5c3c4af Merge branch 'lt9611uxc' of https://github.com/lumag/linux-firmware into main aaed4a8 Merge branch 'v1.1.6' of https://github.com/irui-wang/linux_fw_vpu_v1.1.6 into main d8c9865 Merge branch 'master' of https://github.com/sampnimm/linux-firmware-BT into main 63ab3db linux-firmware: add firmware for Lontium LT9611UXC DSI to HDMI bridge 0fe0fe0 mediatek: update MT8173 VPU firmware to v1.1.6 1a08ec9 QCA : Updated firmware files for WCN3991 7455a36 Merge branch 'guc_v49' of git://anongit.freedesktop.org/drm/drm-firmware into main 7eb7fda linux-firmware: Update firmware file for Intel Bluetooth AX210 5cbf459 linux-firmware: Update firmware file for Intel Bluetooth AX210 c487f7d i915: Add GuC firmware v49.0.1 for all platforms d9ffb07 i915: Remove duplicate KBL DMC entry b362fd4 Mellanox: Add new mlxsw_spectrum firmware xx.2008.2018 bc9cd0b linux-firmware: Update AMD SEV firmware 54c797a amdgpu: add sienna cichlid firmware for 20.45 1340e9c amdgpu: update vega20 firmware for 20.45 b260c9c amdgpu: update vega12 firmware for 20.45 d683bd5 amdgpu: update vega10 firmware for 20.45 7c81cc2 amdgpu: update renoir firmware for 20.45 3619e57 amdgpu: update navi14 firmware for 20.45 68ce0fb amdgpu: update navi12 firmware for 20.45 e889b80 amdgpu: update navi10 firmware for 20.45 f4edc15 amdgpu: update raven2 firmware for 20.45 e71210f amdgpu: update raven firmware for 20.45 [1] https://git.kernel.org/pub/scm/linux/kernel/git/firmware/linux-firmware.git/commit/?id=0f0aefd733f70beae4c0246edbd2c158d5ce974c [2] https://github.com/openwrt/openwrt/blob/eeda8652f1655d4f9c11e9c9f51ddcd3377d119a/package/firmware/cypress-firmware/Makefile#L124 Signed-off-by: Josef Schlehofer --- package/firmware/linux-firmware/Makefile | 6 ++--- package/firmware/linux-firmware/broadcom.mk | 27 --------------------- target/linux/sunxi/image/cortexa7.mk | 8 +++--- 3 files changed, 7 insertions(+), 34 deletions(-) diff --git a/package/firmware/linux-firmware/Makefile b/package/firmware/linux-firmware/Makefile index 7fb99dd2ce..e2fee3b6a2 100644 --- a/package/firmware/linux-firmware/Makefile +++ b/package/firmware/linux-firmware/Makefile @@ -8,12 +8,12 @@ include $(TOPDIR)/rules.mk PKG_NAME:=linux-firmware -PKG_VERSION:=20201118 -PKG_RELEASE:=3 +PKG_VERSION:=20210315 +PKG_RELEASE:=1 PKG_SOURCE_URL:=@KERNEL/linux/kernel/firmware PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz -PKG_HASH:=863d5a31da725b856a917280d1e3014929b3bc3d4e6e5faecf530c13afb7e2b9 +PKG_HASH:=a2348f03492713dca9aef202496c6e58f5e63ee5bec6a7bdfcf8b18ce7155e70 PKG_MAINTAINER:=Felix Fietkau diff --git a/package/firmware/linux-firmware/broadcom.mk b/package/firmware/linux-firmware/broadcom.mk index 00f7076104..26f6534632 100644 --- a/package/firmware/linux-firmware/broadcom.mk +++ b/package/firmware/linux-firmware/broadcom.mk @@ -34,24 +34,6 @@ define Package/brcmfmac-firmware-4329-sdio/install endef $(eval $(call BuildPackage,brcmfmac-firmware-4329-sdio)) -Package/brcmfmac-firmware-43362-sdio = $(call Package/firmware-default,Broadcom BCM43362 FullMac SDIO firmware) -define Package/brcmfmac-firmware-43362-sdio/install - $(INSTALL_DIR) $(1)/lib/firmware/brcm - $(INSTALL_DATA) \ - $(PKG_BUILD_DIR)/brcm/brcmfmac43362-sdio.bin \ - $(1)/lib/firmware/brcm/brcmfmac43362-sdio.bin -endef -$(eval $(call BuildPackage,brcmfmac-firmware-43362-sdio)) - -Package/brcmfmac-firmware-43430-sdio = $(call Package/firmware-default,Broadcom BCM43430 FullMac SDIO firmware) -define Package/brcmfmac-firmware-43430-sdio/install - $(INSTALL_DIR) $(1)/lib/firmware/brcm - $(INSTALL_DATA) \ - $(PKG_BUILD_DIR)/brcm/brcmfmac43430-sdio.bin \ - $(1)/lib/firmware/brcm/brcmfmac43430-sdio.bin -endef -$(eval $(call BuildPackage,brcmfmac-firmware-43430-sdio)) - Package/brcmfmac-firmware-43430-sdio-rpi-3b = $(call Package/firmware-default,Broadcom BCM43430 NVRAM for Raspberry Pi 3B) define Package/brcmfmac-firmware-43430-sdio-rpi-3b/install $(INSTALL_DIR) $(1)/lib/firmware/brcm @@ -79,15 +61,6 @@ define Package/brcmfmac-firmware-43430a0-sdio/install endef $(eval $(call BuildPackage,brcmfmac-firmware-43430a0-sdio)) -Package/brcmfmac-firmware-43455-sdio = $(call Package/firmware-default,Broadcom BCM43455 FullMac SDIO firmware) -define Package/brcmfmac-firmware-43455-sdio/install - $(INSTALL_DIR) $(1)/lib/firmware/brcm - $(INSTALL_DATA) \ - $(PKG_BUILD_DIR)/brcm/brcmfmac43455-sdio.bin \ - $(1)/lib/firmware/brcm/brcmfmac43455-sdio.bin -endef -$(eval $(call BuildPackage,brcmfmac-firmware-43455-sdio)) - Package/brcmfmac-firmware-43455-sdio-rpi-3b-plus = $(call Package/firmware-default,Broadcom BCM43455 NVRAM for Raspberry Pi 3B+) define Package/brcmfmac-firmware-43455-sdio-rpi-3b-plus/install $(INSTALL_DIR) $(1)/lib/firmware/brcm diff --git a/target/linux/sunxi/image/cortexa7.mk b/target/linux/sunxi/image/cortexa7.mk index 01474a20cb..59f11bc83c 100644 --- a/target/linux/sunxi/image/cortexa7.mk +++ b/target/linux/sunxi/image/cortexa7.mk @@ -23,7 +23,7 @@ define Device/friendlyarm_nanopi-m1-plus DEVICE_VENDOR := FriendlyARM DEVICE_MODEL := NanoPi M1 Plus DEVICE_PACKAGES:=kmod-rtc-sunxi kmod-leds-gpio kmod-brcmfmac \ - brcmfmac-firmware-43430-sdio wpad-basic-wolfssl + cypress-firmware-43430-sdio wpad-basic-wolfssl SOC := sun8i-h3 endef TARGET_DEVICES += friendlyarm_nanopi-m1-plus @@ -39,7 +39,7 @@ define Device/friendlyarm_nanopi-neo-air DEVICE_VENDOR := FriendlyARM DEVICE_MODEL := NanoPi NEO Air DEVICE_PACKAGES := kmod-rtc-sunxi kmod-leds-gpio kmod-brcmfmac \ - brcmfmac-firmware-43430-sdio wpad-basic-wolfssl + cypress-firmware-43430-sdio wpad-basic-wolfssl SOC := sun8i-h3 endef TARGET_DEVICES += friendlyarm_nanopi-neo-air @@ -48,7 +48,7 @@ define Device/friendlyarm_nanopi-r1 DEVICE_VENDOR := FriendlyARM DEVICE_MODEL := NanoPi R1 DEVICE_PACKAGES := kmod-rtc-sunxi kmod-usb-net-rtl8152 kmod-leds-gpio \ - kmod-brcmfmac brcmfmac-firmware-43430-sdio wpad-basic-wolfssl + kmod-brcmfmac cypress-firmware-43430-sdio wpad-basic-wolfssl SOC := sun8i-h3 endef TARGET_DEVICES += friendlyarm_nanopi-r1 @@ -81,7 +81,7 @@ define Device/sinovoip_bananapi-m2-berry DEVICE_VENDOR := Sinovoip DEVICE_MODEL := Banana Pi M2 Berry DEVICE_PACKAGES:=kmod-rtc-sunxi kmod-ata-sunxi kmod-brcmfmac \ - brcmfmac-firmware-43430-sdio wpad-basic-wolfssl + cypress-firmware-43430-sdio wpad-basic-wolfssl SUPPORTED_DEVICES:=lemaker,bananapi-m2-berry SOC := sun8i-v40 endef From 3c46ba053d899df65dc07e373c64d1925d30f88e Mon Sep 17 00:00:00 2001 From: Felix Fietkau Date: Sun, 6 Jun 2021 10:40:05 +0200 Subject: [PATCH 34/35] mt76: update to the latest version Add mt7915e dependency on kmod-thermal 22b690334c0f mt76: mt7915: do not fail if the cooling device could not be registered Signed-off-by: Felix Fietkau --- package/kernel/mt76/Makefile | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/package/kernel/mt76/Makefile b/package/kernel/mt76/Makefile index 8a98c4bfc0..e4051d8347 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:=2021-06-02 -PKG_SOURCE_VERSION:=b9f09f530223893c0880c3b08fdb2afe55d152e1 -PKG_MIRROR_HASH:=4a8a8189c70d2f169ec69484c74af9221c1c3b62932624b049f3b23988f11d89 +PKG_SOURCE_DATE:=2021-06-06 +PKG_SOURCE_VERSION:=22b690334c0f49b11534cc2e331c9d5e17c4a0bc +PKG_MIRROR_HASH:=ff5e563935919d2e40c1e7254ef3bc06f7ecc5e69f8ddd12903e8f5de942d630 PKG_MAINTAINER:=Felix Fietkau PKG_BUILD_PARALLEL:=1 @@ -213,7 +213,7 @@ endef define KernelPackage/mt7915e $(KernelPackage/mt76-default) TITLE:=MediaTek MT7915e wireless driver - DEPENDS+=@PCI_SUPPORT +kmod-mt7615-common +kmod-hwmon-core +@DRIVER_11AX_SUPPORT + DEPENDS+=@PCI_SUPPORT +kmod-mt7615-common +kmod-hwmon-core +kmod-thermal +@DRIVER_11AX_SUPPORT FILES:= $(PKG_BUILD_DIR)/mt7915/mt7915e.ko AUTOLOAD:=$(call AutoProbe,mt7915e) endef From 04a260911ca0f10a0e37c487c220e1aae3623dda Mon Sep 17 00:00:00 2001 From: Hauke Mehrtens Date: Sat, 5 Jun 2021 18:21:57 +0200 Subject: [PATCH 35/35] mac80211: Update to backports-5.10.42 The removed patches were integrated upstream. The brcmf_driver_work workqueue was removed in brcmfmac with kernel 5.10.42, the asynchronous call was covered to a synchronous call. There is no need to wait any more. This part was removed manually from this patch: brcm/860-brcmfmac-register-wiphy-s-during-module_init.patch Signed-off-by: Hauke Mehrtens --- package/kernel/mac80211/Makefile | 6 +- .../patches/ath/402-ath_regd_optional.patch | 2 +- .../ath10k/080-ath10k_thermal_config.patch | 2 +- ...PN-replay-protection-for-fragmented-.patch | 180 ---- ...fragments-with-multicast-DA-for-PCIe.patch | 66 -- ...fragments-with-multicast-DA-for-SDIO.patch | 40 - ...-which-has-discard-flag-set-by-firmw.patch | 54 -- ...IP-Michael-MIC-verification-for-PCIe.patch | 48 - ...first-subframe-of-A-MSDU-before-proc.patch | 109 --- ...rolling-support-for-various-chipsets.patch | 4 +- .../ath9k/551-ath9k_ubnt_uap_plus_hsr.patch | 2 +- ...-register-wiphy-s-during-module_init.patch | 10 - .../patches/build/001-fix_build.patch | 8 +- ...700-mwl8k-missing-pci-id-for-WNR854T.patch | 2 +- ...940-mwl8k_init_devices_synchronously.patch | 4 +- .../602-rt2x00-introduce-rt2x00eeprom.patch | 2 +- ...8821ae-upgrade-PHY-and-RF-parameters.patch | 817 ------------------ .../100-remove-cryptoapi-dependencies.patch | 20 +- .../subsys/150-disable_addr_notifier.patch | 6 +- ...ort-immediate-reconnect-request-hint.patch | 4 +- ...-driver-based-disconnect-with-reconn.patch | 34 +- ...-get_default_func-move-default-flow-.patch | 2 +- ...add-rx-decapsulation-offload-support.patch | 26 +- ...-Rx-timestamp-calculation-for-all-pr.patch | 2 +- ...1-assure-all-fragments-are-encrypted.patch | 69 -- ...-mixed-key-and-fragment-cache-attack.patch | 87 -- ...y-handle-A-MSDUs-that-start-with-an-.patch | 66 -- ...-mitigate-A-MSDU-aggregation-attacks.patch | 40 - ...mac80211-drop-A-MSDUs-on-old-ciphers.patch | 54 -- ...80211-add-fragment-cache-to-sta_info.patch | 313 ------- ...heck-defrag-PN-against-current-frame.patch | 109 --- ...-prevent-attacks-on-TKIP-WEP-as-well.patch | 62 -- ...-accept-forward-invalid-EAPOL-frames.patch | 94 -- ...protection-against-mixed-key-and-fra.patch | 68 -- 34 files changed, 63 insertions(+), 2349 deletions(-) delete mode 100644 package/kernel/mac80211/patches/ath10k/300-ath10k-add-CCMP-PN-replay-protection-for-fragmented-.patch delete mode 100644 package/kernel/mac80211/patches/ath10k/301-ath10k-drop-fragments-with-multicast-DA-for-PCIe.patch delete mode 100644 package/kernel/mac80211/patches/ath10k/302-ath10k-drop-fragments-with-multicast-DA-for-SDIO.patch delete mode 100644 package/kernel/mac80211/patches/ath10k/303-ath10k-drop-MPDU-which-has-discard-flag-set-by-firmw.patch delete mode 100644 package/kernel/mac80211/patches/ath10k/304-ath10k-Fix-TKIP-Michael-MIC-verification-for-PCIe.patch delete mode 100644 package/kernel/mac80211/patches/ath10k/305-ath10k-Validate-first-subframe-of-A-MSDU-before-proc.patch delete mode 100644 package/kernel/mac80211/patches/rtl/001-v5.12-rtlwifi-8821ae-upgrade-PHY-and-RF-parameters.patch delete mode 100644 package/kernel/mac80211/patches/subsys/380-mac80211-assure-all-fragments-are-encrypted.patch delete mode 100644 package/kernel/mac80211/patches/subsys/381-mac80211-prevent-mixed-key-and-fragment-cache-attack.patch delete mode 100644 package/kernel/mac80211/patches/subsys/382-mac80211-properly-handle-A-MSDUs-that-start-with-an-.patch delete mode 100644 package/kernel/mac80211/patches/subsys/383-cfg80211-mitigate-A-MSDU-aggregation-attacks.patch delete mode 100644 package/kernel/mac80211/patches/subsys/384-mac80211-drop-A-MSDUs-on-old-ciphers.patch delete mode 100644 package/kernel/mac80211/patches/subsys/385-mac80211-add-fragment-cache-to-sta_info.patch delete mode 100644 package/kernel/mac80211/patches/subsys/386-mac80211-check-defrag-PN-against-current-frame.patch delete mode 100644 package/kernel/mac80211/patches/subsys/387-mac80211-prevent-attacks-on-TKIP-WEP-as-well.patch delete mode 100644 package/kernel/mac80211/patches/subsys/388-mac80211-do-not-accept-forward-invalid-EAPOL-frames.patch delete mode 100644 package/kernel/mac80211/patches/subsys/389-mac80211-extend-protection-against-mixed-key-and-fra.patch diff --git a/package/kernel/mac80211/Makefile b/package/kernel/mac80211/Makefile index 92167ebf3b..a8a84f843a 100644 --- a/package/kernel/mac80211/Makefile +++ b/package/kernel/mac80211/Makefile @@ -10,10 +10,10 @@ include $(INCLUDE_DIR)/kernel.mk PKG_NAME:=mac80211 -PKG_VERSION:=5.10.34-1 +PKG_VERSION:=5.10.42-1 PKG_RELEASE:=1 -PKG_SOURCE_URL:=@KERNEL/linux/kernel/projects/backports/stable/v5.10.34/ -PKG_HASH:=03c4ca6bf47d4e50b91b61bc2943a98c788439e56ce2b4080bc4c94141c2c15b +PKG_SOURCE_URL:=@KERNEL/linux/kernel/projects/backports/stable/v5.10.42/ +PKG_HASH:=6876520105240844fdb32d1dcdf2bfdea291a37a96f16c892fda3776ba714fcb PKG_SOURCE:=backports-$(PKG_VERSION).tar.xz PKG_BUILD_DIR:=$(KERNEL_BUILD_DIR)/backports-$(PKG_VERSION) diff --git a/package/kernel/mac80211/patches/ath/402-ath_regd_optional.patch b/package/kernel/mac80211/patches/ath/402-ath_regd_optional.patch index 3c9180b113..bf87d3551a 100644 --- a/package/kernel/mac80211/patches/ath/402-ath_regd_optional.patch +++ b/package/kernel/mac80211/patches/ath/402-ath_regd_optional.patch @@ -82,7 +82,7 @@ help --- a/local-symbols +++ b/local-symbols -@@ -86,6 +86,7 @@ ADM8211= +@@ -85,6 +85,7 @@ ADM8211= ATH_COMMON= WLAN_VENDOR_ATH= ATH_DEBUG= diff --git a/package/kernel/mac80211/patches/ath10k/080-ath10k_thermal_config.patch b/package/kernel/mac80211/patches/ath10k/080-ath10k_thermal_config.patch index 55d48daa79..d183419a47 100644 --- a/package/kernel/mac80211/patches/ath10k/080-ath10k_thermal_config.patch +++ b/package/kernel/mac80211/patches/ath10k/080-ath10k_thermal_config.patch @@ -37,7 +37,7 @@ void ath10k_thermal_event_temperature(struct ath10k *ar, int temperature); --- a/local-symbols +++ b/local-symbols -@@ -143,6 +143,7 @@ ATH10K_SNOC= +@@ -144,6 +144,7 @@ ATH10K_SNOC= ATH10K_DEBUG= ATH10K_DEBUGFS= ATH10K_SPECTRAL= diff --git a/package/kernel/mac80211/patches/ath10k/300-ath10k-add-CCMP-PN-replay-protection-for-fragmented-.patch b/package/kernel/mac80211/patches/ath10k/300-ath10k-add-CCMP-PN-replay-protection-for-fragmented-.patch deleted file mode 100644 index 0ce49b22ab..0000000000 --- a/package/kernel/mac80211/patches/ath10k/300-ath10k-add-CCMP-PN-replay-protection-for-fragmented-.patch +++ /dev/null @@ -1,180 +0,0 @@ -From: Wen Gong -Date: Tue, 11 May 2021 20:02:52 +0200 -Subject: [PATCH] ath10k: add CCMP PN replay protection for fragmented - frames for PCIe - -PN replay check for not fragmented frames is finished in the firmware, -but this was not done for fragmented frames when ath10k is used with -QCA6174/QCA6377 PCIe. mac80211 has the function -ieee80211_rx_h_defragment() for PN replay check for fragmented frames, -but this does not get checked with QCA6174 due to the -ieee80211_has_protected() condition not matching the cleared Protected -bit case. - -Validate the PN of received fragmented frames within ath10k when CCMP is -used and drop the fragment if the PN is not correct (incremented by -exactly one from the previous fragment). This applies only for -QCA6174/QCA6377 PCIe. - -Tested-on: QCA6174 hw3.2 PCI WLAN.RM.4.4.1-00110-QCARMSWP-1 - -Cc: stable@vger.kernel.org -Signed-off-by: Wen Gong -Signed-off-by: Jouni Malinen -Signed-off-by: Johannes Berg ---- - ---- a/drivers/net/wireless/ath/ath10k/htt.h -+++ b/drivers/net/wireless/ath/ath10k/htt.h -@@ -846,6 +846,7 @@ enum htt_security_types { - - #define ATH10K_HTT_TXRX_PEER_SECURITY_MAX 2 - #define ATH10K_TXRX_NUM_EXT_TIDS 19 -+#define ATH10K_TXRX_NON_QOS_TID 16 - - enum htt_security_flags { - #define HTT_SECURITY_TYPE_MASK 0x7F ---- a/drivers/net/wireless/ath/ath10k/htt_rx.c -+++ b/drivers/net/wireless/ath/ath10k/htt_rx.c -@@ -1746,16 +1746,87 @@ static void ath10k_htt_rx_h_csum_offload - msdu->ip_summed = ath10k_htt_rx_get_csum_state(msdu); - } - -+static u64 ath10k_htt_rx_h_get_pn(struct ath10k *ar, struct sk_buff *skb, -+ u16 offset, -+ enum htt_rx_mpdu_encrypt_type enctype) -+{ -+ struct ieee80211_hdr *hdr; -+ u64 pn = 0; -+ u8 *ehdr; -+ -+ hdr = (struct ieee80211_hdr *)(skb->data + offset); -+ ehdr = skb->data + offset + ieee80211_hdrlen(hdr->frame_control); -+ -+ if (enctype == HTT_RX_MPDU_ENCRYPT_AES_CCM_WPA2) { -+ pn = ehdr[0]; -+ pn |= (u64)ehdr[1] << 8; -+ pn |= (u64)ehdr[4] << 16; -+ pn |= (u64)ehdr[5] << 24; -+ pn |= (u64)ehdr[6] << 32; -+ pn |= (u64)ehdr[7] << 40; -+ } -+ return pn; -+} -+ -+static bool ath10k_htt_rx_h_frag_pn_check(struct ath10k *ar, -+ struct sk_buff *skb, -+ u16 peer_id, -+ u16 offset, -+ enum htt_rx_mpdu_encrypt_type enctype) -+{ -+ struct ath10k_peer *peer; -+ union htt_rx_pn_t *last_pn, new_pn = {0}; -+ struct ieee80211_hdr *hdr; -+ bool more_frags; -+ u8 tid, frag_number; -+ u32 seq; -+ -+ peer = ath10k_peer_find_by_id(ar, peer_id); -+ if (!peer) { -+ ath10k_dbg(ar, ATH10K_DBG_HTT, "invalid peer for frag pn check\n"); -+ return false; -+ } -+ -+ hdr = (struct ieee80211_hdr *)(skb->data + offset); -+ if (ieee80211_is_data_qos(hdr->frame_control)) -+ tid = ieee80211_get_tid(hdr); -+ else -+ tid = ATH10K_TXRX_NON_QOS_TID; -+ -+ last_pn = &peer->frag_tids_last_pn[tid]; -+ new_pn.pn48 = ath10k_htt_rx_h_get_pn(ar, skb, offset, enctype); -+ more_frags = ieee80211_has_morefrags(hdr->frame_control); -+ frag_number = le16_to_cpu(hdr->seq_ctrl) & IEEE80211_SCTL_FRAG; -+ seq = (__le16_to_cpu(hdr->seq_ctrl) & IEEE80211_SCTL_SEQ) >> 4; -+ -+ if (frag_number == 0) { -+ last_pn->pn48 = new_pn.pn48; -+ peer->frag_tids_seq[tid] = seq; -+ } else { -+ if (seq != peer->frag_tids_seq[tid]) -+ return false; -+ -+ if (new_pn.pn48 != last_pn->pn48 + 1) -+ return false; -+ -+ last_pn->pn48 = new_pn.pn48; -+ } -+ -+ return true; -+} -+ - static void ath10k_htt_rx_h_mpdu(struct ath10k *ar, - struct sk_buff_head *amsdu, - struct ieee80211_rx_status *status, - bool fill_crypt_header, - u8 *rx_hdr, -- enum ath10k_pkt_rx_err *err) -+ enum ath10k_pkt_rx_err *err, -+ u16 peer_id, -+ bool frag) - { - struct sk_buff *first; - struct sk_buff *last; -- struct sk_buff *msdu; -+ struct sk_buff *msdu, *temp; - struct htt_rx_desc *rxd; - struct ieee80211_hdr *hdr; - enum htt_rx_mpdu_encrypt_type enctype; -@@ -1768,6 +1839,7 @@ static void ath10k_htt_rx_h_mpdu(struct - bool is_decrypted; - bool is_mgmt; - u32 attention; -+ bool frag_pn_check = true; - - if (skb_queue_empty(amsdu)) - return; -@@ -1866,6 +1938,24 @@ static void ath10k_htt_rx_h_mpdu(struct - } - - skb_queue_walk(amsdu, msdu) { -+ if (frag && !fill_crypt_header && is_decrypted && -+ enctype == HTT_RX_MPDU_ENCRYPT_AES_CCM_WPA2) -+ frag_pn_check = ath10k_htt_rx_h_frag_pn_check(ar, -+ msdu, -+ peer_id, -+ 0, -+ enctype); -+ -+ if (!frag_pn_check) { -+ /* Discard the fragment with invalid PN */ -+ temp = msdu->prev; -+ __skb_unlink(msdu, amsdu); -+ dev_kfree_skb_any(msdu); -+ msdu = temp; -+ frag_pn_check = true; -+ continue; -+ } -+ - ath10k_htt_rx_h_csum_offload(msdu); - ath10k_htt_rx_h_undecap(ar, msdu, status, first_hdr, enctype, - is_decrypted); -@@ -2071,7 +2161,8 @@ static int ath10k_htt_rx_handle_amsdu(st - ath10k_htt_rx_h_unchain(ar, &amsdu, &drop_cnt, &unchain_cnt); - - ath10k_htt_rx_h_filter(ar, &amsdu, rx_status, &drop_cnt_filter); -- ath10k_htt_rx_h_mpdu(ar, &amsdu, rx_status, true, first_hdr, &err); -+ ath10k_htt_rx_h_mpdu(ar, &amsdu, rx_status, true, first_hdr, &err, 0, -+ false); - msdus_to_queue = skb_queue_len(&amsdu); - ath10k_htt_rx_h_enqueue(ar, &amsdu, rx_status); - -@@ -3027,7 +3118,7 @@ static int ath10k_htt_rx_in_ord_ind(stru - ath10k_htt_rx_h_ppdu(ar, &amsdu, status, vdev_id); - ath10k_htt_rx_h_filter(ar, &amsdu, status, NULL); - ath10k_htt_rx_h_mpdu(ar, &amsdu, status, false, NULL, -- NULL); -+ NULL, peer_id, frag); - ath10k_htt_rx_h_enqueue(ar, &amsdu, status); - break; - case -EAGAIN: diff --git a/package/kernel/mac80211/patches/ath10k/301-ath10k-drop-fragments-with-multicast-DA-for-PCIe.patch b/package/kernel/mac80211/patches/ath10k/301-ath10k-drop-fragments-with-multicast-DA-for-PCIe.patch deleted file mode 100644 index 7288c66612..0000000000 --- a/package/kernel/mac80211/patches/ath10k/301-ath10k-drop-fragments-with-multicast-DA-for-PCIe.patch +++ /dev/null @@ -1,66 +0,0 @@ -From: Wen Gong -Date: Tue, 11 May 2021 20:02:53 +0200 -Subject: [PATCH] ath10k: drop fragments with multicast DA for PCIe - -Fragmentation is not used with multicast frames. Discard unexpected -fragments with multicast DA. This fixes CVE-2020-26145. - -Tested-on: QCA6174 hw3.2 PCI WLAN.RM.4.4.1-00110-QCARMSWP-1 - -Cc: stable@vger.kernel.org -Signed-off-by: Wen Gong -Signed-off-by: Jouni Malinen -Signed-off-by: Johannes Berg ---- - ---- a/drivers/net/wireless/ath/ath10k/htt_rx.c -+++ b/drivers/net/wireless/ath/ath10k/htt_rx.c -@@ -1768,6 +1768,16 @@ static u64 ath10k_htt_rx_h_get_pn(struct - return pn; - } - -+static bool ath10k_htt_rx_h_frag_multicast_check(struct ath10k *ar, -+ struct sk_buff *skb, -+ u16 offset) -+{ -+ struct ieee80211_hdr *hdr; -+ -+ hdr = (struct ieee80211_hdr *)(skb->data + offset); -+ return !is_multicast_ether_addr(hdr->addr1); -+} -+ - static bool ath10k_htt_rx_h_frag_pn_check(struct ath10k *ar, - struct sk_buff *skb, - u16 peer_id, -@@ -1839,7 +1849,7 @@ static void ath10k_htt_rx_h_mpdu(struct - bool is_decrypted; - bool is_mgmt; - u32 attention; -- bool frag_pn_check = true; -+ bool frag_pn_check = true, multicast_check = true; - - if (skb_queue_empty(amsdu)) - return; -@@ -1946,13 +1956,20 @@ static void ath10k_htt_rx_h_mpdu(struct - 0, - enctype); - -- if (!frag_pn_check) { -- /* Discard the fragment with invalid PN */ -+ if (frag) -+ multicast_check = ath10k_htt_rx_h_frag_multicast_check(ar, -+ msdu, -+ 0); -+ -+ if (!frag_pn_check || !multicast_check) { -+ /* Discard the fragment with invalid PN or multicast DA -+ */ - temp = msdu->prev; - __skb_unlink(msdu, amsdu); - dev_kfree_skb_any(msdu); - msdu = temp; - frag_pn_check = true; -+ multicast_check = true; - continue; - } - diff --git a/package/kernel/mac80211/patches/ath10k/302-ath10k-drop-fragments-with-multicast-DA-for-SDIO.patch b/package/kernel/mac80211/patches/ath10k/302-ath10k-drop-fragments-with-multicast-DA-for-SDIO.patch deleted file mode 100644 index 85d9ce65e2..0000000000 --- a/package/kernel/mac80211/patches/ath10k/302-ath10k-drop-fragments-with-multicast-DA-for-SDIO.patch +++ /dev/null @@ -1,40 +0,0 @@ -From: Wen Gong -Date: Tue, 11 May 2021 20:02:54 +0200 -Subject: [PATCH] ath10k: drop fragments with multicast DA for SDIO - -Fragmentation is not used with multicast frames. Discard unexpected -fragments with multicast DA. This fixes CVE-2020-26145. - -Tested-on: QCA6174 hw3.2 SDIO WLAN.RMH.4.4.1-00049 - -Cc: stable@vger.kernel.org -Signed-off-by: Wen Gong -Signed-off-by: Jouni Malinen -Signed-off-by: Johannes Berg ---- - ---- a/drivers/net/wireless/ath/ath10k/htt_rx.c -+++ b/drivers/net/wireless/ath/ath10k/htt_rx.c -@@ -2617,6 +2617,13 @@ static bool ath10k_htt_rx_proc_rx_frag_i - rx_desc = (struct htt_hl_rx_desc *)(skb->data + tot_hdr_len); - rx_desc_info = __le32_to_cpu(rx_desc->info); - -+ hdr = (struct ieee80211_hdr *)((u8 *)rx_desc + rx_hl->fw_desc.len); -+ -+ if (is_multicast_ether_addr(hdr->addr1)) { -+ /* Discard the fragment with multicast DA */ -+ goto err; -+ } -+ - if (!MS(rx_desc_info, HTT_RX_DESC_HL_INFO_ENCRYPTED)) { - spin_unlock_bh(&ar->data_lock); - return ath10k_htt_rx_proc_rx_ind_hl(htt, &resp->rx_ind_hl, skb, -@@ -2624,8 +2631,6 @@ static bool ath10k_htt_rx_proc_rx_frag_i - HTT_RX_NON_TKIP_MIC); - } - -- hdr = (struct ieee80211_hdr *)((u8 *)rx_desc + rx_hl->fw_desc.len); -- - if (ieee80211_has_retry(hdr->frame_control)) - goto err; - diff --git a/package/kernel/mac80211/patches/ath10k/303-ath10k-drop-MPDU-which-has-discard-flag-set-by-firmw.patch b/package/kernel/mac80211/patches/ath10k/303-ath10k-drop-MPDU-which-has-discard-flag-set-by-firmw.patch deleted file mode 100644 index 03bce4231b..0000000000 --- a/package/kernel/mac80211/patches/ath10k/303-ath10k-drop-MPDU-which-has-discard-flag-set-by-firmw.patch +++ /dev/null @@ -1,54 +0,0 @@ -From: Wen Gong -Date: Tue, 11 May 2021 20:02:55 +0200 -Subject: [PATCH] ath10k: drop MPDU which has discard flag set by firmware - for SDIO - -When the discard flag is set by the firmware for an MPDU, it should be -dropped. This allows a mitigation for CVE-2020-24588 to be implemented -in the firmware. - -Tested-on: QCA6174 hw3.2 SDIO WLAN.RMH.4.4.1-00049 - -Cc: stable@vger.kernel.org -Signed-off-by: Wen Gong -Signed-off-by: Jouni Malinen -Signed-off-by: Johannes Berg ---- - ---- a/drivers/net/wireless/ath/ath10k/htt_rx.c -+++ b/drivers/net/wireless/ath/ath10k/htt_rx.c -@@ -2312,6 +2312,11 @@ static bool ath10k_htt_rx_proc_rx_ind_hl - fw_desc = &rx->fw_desc; - rx_desc_len = fw_desc->len; - -+ if (fw_desc->u.bits.discard) { -+ ath10k_dbg(ar, ATH10K_DBG_HTT, "htt discard mpdu\n"); -+ goto err; -+ } -+ - /* I have not yet seen any case where num_mpdu_ranges > 1. - * qcacld does not seem handle that case either, so we introduce the - * same limitiation here as well. ---- a/drivers/net/wireless/ath/ath10k/rx_desc.h -+++ b/drivers/net/wireless/ath/ath10k/rx_desc.h -@@ -1282,7 +1282,19 @@ struct fw_rx_desc_base { - #define FW_RX_DESC_UDP (1 << 6) - - struct fw_rx_desc_hl { -- u8 info0; -+ union { -+ struct { -+ u8 discard:1, -+ forward:1, -+ any_err:1, -+ dup_err:1, -+ reserved:1, -+ inspect:1, -+ extension:2; -+ } bits; -+ u8 info0; -+ } u; -+ - u8 version; - u8 len; - u8 flags; diff --git a/package/kernel/mac80211/patches/ath10k/304-ath10k-Fix-TKIP-Michael-MIC-verification-for-PCIe.patch b/package/kernel/mac80211/patches/ath10k/304-ath10k-Fix-TKIP-Michael-MIC-verification-for-PCIe.patch deleted file mode 100644 index da9d6802bd..0000000000 --- a/package/kernel/mac80211/patches/ath10k/304-ath10k-Fix-TKIP-Michael-MIC-verification-for-PCIe.patch +++ /dev/null @@ -1,48 +0,0 @@ -From: Wen Gong -Date: Tue, 11 May 2021 20:02:56 +0200 -Subject: [PATCH] ath10k: Fix TKIP Michael MIC verification for PCIe - -TKIP Michael MIC was not verified properly for PCIe cases since the -validation steps in ieee80211_rx_h_michael_mic_verify() in mac80211 did -not get fully executed due to unexpected flag values in -ieee80211_rx_status. - -Fix this by setting the flags property to meet mac80211 expectations for -performing Michael MIC validation there. This fixes CVE-2020-26141. It -does the same as ath10k_htt_rx_proc_rx_ind_hl() for SDIO which passed -MIC verification case. This applies only to QCA6174/QCA9377 PCIe. - -Tested-on: QCA6174 hw3.2 PCI WLAN.RM.4.4.1-00110-QCARMSWP-1 - -Cc: stable@vger.kernel.org -Signed-off-by: Wen Gong -Signed-off-by: Jouni Malinen -Signed-off-by: Johannes Berg ---- - ---- a/drivers/net/wireless/ath/ath10k/htt_rx.c -+++ b/drivers/net/wireless/ath/ath10k/htt_rx.c -@@ -1974,6 +1974,11 @@ static void ath10k_htt_rx_h_mpdu(struct - } - - ath10k_htt_rx_h_csum_offload(msdu); -+ -+ if (frag && !fill_crypt_header && -+ enctype == HTT_RX_MPDU_ENCRYPT_TKIP_WPA) -+ status->flag &= ~RX_FLAG_MMIC_STRIPPED; -+ - ath10k_htt_rx_h_undecap(ar, msdu, status, first_hdr, enctype, - is_decrypted); - -@@ -1991,6 +1996,11 @@ static void ath10k_htt_rx_h_mpdu(struct - - hdr = (void *)msdu->data; - hdr->frame_control &= ~__cpu_to_le16(IEEE80211_FCTL_PROTECTED); -+ -+ if (frag && !fill_crypt_header && -+ enctype == HTT_RX_MPDU_ENCRYPT_TKIP_WPA) -+ status->flag &= ~RX_FLAG_IV_STRIPPED & -+ ~RX_FLAG_MMIC_STRIPPED; - } - } - diff --git a/package/kernel/mac80211/patches/ath10k/305-ath10k-Validate-first-subframe-of-A-MSDU-before-proc.patch b/package/kernel/mac80211/patches/ath10k/305-ath10k-Validate-first-subframe-of-A-MSDU-before-proc.patch deleted file mode 100644 index 0bdbed78d5..0000000000 --- a/package/kernel/mac80211/patches/ath10k/305-ath10k-Validate-first-subframe-of-A-MSDU-before-proc.patch +++ /dev/null @@ -1,109 +0,0 @@ -From: Sriram R -Date: Tue, 11 May 2021 20:02:57 +0200 -Subject: [PATCH] ath10k: Validate first subframe of A-MSDU before - processing the list - -In certain scenarios a normal MSDU can be received as an A-MSDU when -the A-MSDU present bit of a QoS header gets flipped during reception. -Since this bit is unauthenticated, the hardware crypto engine can pass -the frame to the driver without any error indication. - -This could result in processing unintended subframes collected in the -A-MSDU list. Hence, validate A-MSDU list by checking if the first frame -has a valid subframe header. - -Comparing the non-aggregated MSDU and an A-MSDU, the fields of the first -subframe DA matches the LLC/SNAP header fields of a normal MSDU. -In order to avoid processing such frames, add a validation to -filter such A-MSDU frames where the first subframe header DA matches -with the LLC/SNAP header pattern. - -Tested-on: QCA9984 hw1.0 PCI 10.4-3.10-00047 - -Cc: stable@vger.kernel.org -Signed-off-by: Sriram R -Signed-off-by: Jouni Malinen -Signed-off-by: Johannes Berg ---- - ---- a/drivers/net/wireless/ath/ath10k/htt_rx.c -+++ b/drivers/net/wireless/ath/ath10k/htt_rx.c -@@ -2108,14 +2108,62 @@ static void ath10k_htt_rx_h_unchain(stru - ath10k_unchain_msdu(amsdu, unchain_cnt); - } - -+static bool ath10k_htt_rx_validate_amsdu(struct ath10k *ar, -+ struct sk_buff_head *amsdu) -+{ -+ u8 *subframe_hdr; -+ struct sk_buff *first; -+ bool is_first, is_last; -+ struct htt_rx_desc *rxd; -+ struct ieee80211_hdr *hdr; -+ size_t hdr_len, crypto_len; -+ enum htt_rx_mpdu_encrypt_type enctype; -+ int bytes_aligned = ar->hw_params.decap_align_bytes; -+ -+ first = skb_peek(amsdu); -+ -+ rxd = (void *)first->data - sizeof(*rxd); -+ hdr = (void *)rxd->rx_hdr_status; -+ -+ is_first = !!(rxd->msdu_end.common.info0 & -+ __cpu_to_le32(RX_MSDU_END_INFO0_FIRST_MSDU)); -+ is_last = !!(rxd->msdu_end.common.info0 & -+ __cpu_to_le32(RX_MSDU_END_INFO0_LAST_MSDU)); -+ -+ /* Return in case of non-aggregated msdu */ -+ if (is_first && is_last) -+ return true; -+ -+ /* First msdu flag is not set for the first msdu of the list */ -+ if (!is_first) -+ return false; -+ -+ enctype = MS(__le32_to_cpu(rxd->mpdu_start.info0), -+ RX_MPDU_START_INFO0_ENCRYPT_TYPE); -+ -+ hdr_len = ieee80211_hdrlen(hdr->frame_control); -+ crypto_len = ath10k_htt_rx_crypto_param_len(ar, enctype); -+ -+ subframe_hdr = (u8 *)hdr + round_up(hdr_len, bytes_aligned) + -+ crypto_len; -+ -+ /* Validate if the amsdu has a proper first subframe. -+ * There are chances a single msdu can be received as amsdu when -+ * the unauthenticated amsdu flag of a QoS header -+ * gets flipped in non-SPP AMSDU's, in such cases the first -+ * subframe has llc/snap header in place of a valid da. -+ * return false if the da matches rfc1042 pattern -+ */ -+ if (ether_addr_equal(subframe_hdr, rfc1042_header)) -+ return false; -+ -+ return true; -+} -+ - static bool ath10k_htt_rx_amsdu_allowed(struct ath10k *ar, - struct sk_buff_head *amsdu, - struct ieee80211_rx_status *rx_status) - { -- /* FIXME: It might be a good idea to do some fuzzy-testing to drop -- * invalid/dangerous frames. -- */ -- - if (!rx_status->freq) { - ath10k_dbg(ar, ATH10K_DBG_HTT, "no channel configured; ignoring frame(s)!\n"); - return false; -@@ -2126,6 +2174,11 @@ static bool ath10k_htt_rx_amsdu_allowed( - return false; - } - -+ if (!ath10k_htt_rx_validate_amsdu(ar, amsdu)) { -+ ath10k_dbg(ar, ATH10K_DBG_HTT, "invalid amsdu received\n"); -+ return false; -+ } -+ - return true; - } - diff --git a/package/kernel/mac80211/patches/ath10k/974-ath10k_add-LED-and-GPIO-controlling-support-for-various-chipsets.patch b/package/kernel/mac80211/patches/ath10k/974-ath10k_add-LED-and-GPIO-controlling-support-for-various-chipsets.patch index 5e74687826..ce8effe3c3 100644 --- a/package/kernel/mac80211/patches/ath10k/974-ath10k_add-LED-and-GPIO-controlling-support-for-various-chipsets.patch +++ b/package/kernel/mac80211/patches/ath10k/974-ath10k_add-LED-and-GPIO-controlling-support-for-various-chipsets.patch @@ -114,7 +114,7 @@ v13: ath10k_core-$(CONFIG_DEV_COREDUMP) += coredump.o --- a/local-symbols +++ b/local-symbols -@@ -146,6 +146,7 @@ ATH10K_DEBUG= +@@ -145,6 +145,7 @@ ATH10K_DEBUG= ATH10K_DEBUGFS= ATH10K_SPECTRAL= ATH10K_THERMAL= @@ -456,7 +456,7 @@ v13: { --- a/drivers/net/wireless/ath/ath10k/wmi-tlv.c +++ b/drivers/net/wireless/ath/ath10k/wmi-tlv.c -@@ -4591,6 +4591,8 @@ static const struct wmi_ops wmi_tlv_ops +@@ -4594,6 +4594,8 @@ static const struct wmi_ops wmi_tlv_ops .gen_echo = ath10k_wmi_tlv_op_gen_echo, .gen_vdev_spectral_conf = ath10k_wmi_tlv_op_gen_vdev_spectral_conf, .gen_vdev_spectral_enable = ath10k_wmi_tlv_op_gen_vdev_spectral_enable, diff --git a/package/kernel/mac80211/patches/ath9k/551-ath9k_ubnt_uap_plus_hsr.patch b/package/kernel/mac80211/patches/ath9k/551-ath9k_ubnt_uap_plus_hsr.patch index cd2bdbf1a0..acb9ad443c 100644 --- a/package/kernel/mac80211/patches/ath9k/551-ath9k_ubnt_uap_plus_hsr.patch +++ b/package/kernel/mac80211/patches/ath9k/551-ath9k_ubnt_uap_plus_hsr.patch @@ -371,7 +371,7 @@ --- a/local-symbols +++ b/local-symbols -@@ -113,6 +113,7 @@ ATH9K_WOW= +@@ -112,6 +112,7 @@ ATH9K_WOW= ATH9K_RFKILL= ATH9K_CHANNEL_CONTEXT= ATH9K_PCOEM= diff --git a/package/kernel/mac80211/patches/brcm/860-brcmfmac-register-wiphy-s-during-module_init.patch b/package/kernel/mac80211/patches/brcm/860-brcmfmac-register-wiphy-s-during-module_init.patch index dc2295db1b..c9730e29fd 100644 --- a/package/kernel/mac80211/patches/brcm/860-brcmfmac-register-wiphy-s-during-module_init.patch +++ b/package/kernel/mac80211/patches/brcm/860-brcmfmac-register-wiphy-s-during-module_init.patch @@ -11,16 +11,6 @@ module loads successfully. Signed-off-by: RafaÅ‚ MiÅ‚ecki --- ---- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/core.c -+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/core.c -@@ -1557,6 +1557,7 @@ int __init brcmf_core_init(void) - { - if (!schedule_work(&brcmf_driver_work)) - return -EBUSY; -+ flush_work(&brcmf_driver_work); - - return 0; - } --- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/firmware.c +++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/firmware.c @@ -431,6 +431,7 @@ struct brcmf_fw { diff --git a/package/kernel/mac80211/patches/build/001-fix_build.patch b/package/kernel/mac80211/patches/build/001-fix_build.patch index e57ca190e4..8f63d36e2e 100644 --- a/package/kernel/mac80211/patches/build/001-fix_build.patch +++ b/package/kernel/mac80211/patches/build/001-fix_build.patch @@ -55,8 +55,8 @@ - echo "" ;\ - done \ - ) > Kconfig.kernel ;\ -- kver=$$($(MAKE) --no-print-directory -C $(KLIB_BUILD) kernelversion | \ -- sed 's/^\(\([3-5]\|2\.6\)\.[0-9]\+\).*/\1/;t;d') ;\ +- kver=$$($(MAKE) --no-print-directory -C $(KLIB_BUILD) M=$(BACKPORT_DIR) \ +- kernelversion | sed 's/^\(\([3-5]\|2\.6\)\.[0-9]\+\).*/\1/;t;d');\ - test "$$kver" != "" || echo "Kernel version parse failed!" ;\ - test "$$kver" != "" ;\ - kvers="$$(seq 14 39 | sed 's/^/2.6./')" ;\ @@ -112,8 +112,8 @@ + @echo " done." + +Kconfig.versions: Kconfig.kernel -+ @kver=$$($(MAKE) --no-print-directory -C $(KLIB_BUILD) kernelversion | \ -+ sed 's/^\(\([3-5]\|2\.6\)\.[0-9]\+\).*/\1/;t;d') ;\ ++ @kver=$$($(MAKE) --no-print-directory -C $(KLIB_BUILD) M=$(BACKPORT_DIR) \ ++ kernelversion | sed 's/^\(\([3-5]\|2\.6\)\.[0-9]\+\).*/\1/;t;d');\ + test "$$kver" != "" || echo "Kernel version parse failed!" ;\ + test "$$kver" != "" ;\ + kvers="$$(seq 14 39 | sed 's/^/2.6./')" ;\ 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 cfa40e1bd2..d358cfe367 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 -@@ -5694,6 +5694,7 @@ MODULE_FIRMWARE("mwl8k/fmimage_8366.fw") +@@ -5695,6 +5695,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/940-mwl8k_init_devices_synchronously.patch b/package/kernel/mac80211/patches/mwl/940-mwl8k_init_devices_synchronously.patch index f3130f7ae7..a35cf1875a 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 -@@ -6279,6 +6279,8 @@ static int mwl8k_probe(struct pci_dev *p +@@ -6280,6 +6280,8 @@ static int mwl8k_probe(struct pci_dev *p priv->running_bsses = 0; @@ -9,7 +9,7 @@ return rc; err_stop_firmware: -@@ -6312,8 +6314,6 @@ static void mwl8k_remove(struct pci_dev +@@ -6313,8 +6315,6 @@ static void mwl8k_remove(struct pci_dev return; priv = hw->priv; diff --git a/package/kernel/mac80211/patches/rt2x00/602-rt2x00-introduce-rt2x00eeprom.patch b/package/kernel/mac80211/patches/rt2x00/602-rt2x00-introduce-rt2x00eeprom.patch index 1c52132da6..e74d9a9aa0 100644 --- a/package/kernel/mac80211/patches/rt2x00/602-rt2x00-introduce-rt2x00eeprom.patch +++ b/package/kernel/mac80211/patches/rt2x00/602-rt2x00-introduce-rt2x00eeprom.patch @@ -1,6 +1,6 @@ --- a/local-symbols +++ b/local-symbols -@@ -333,6 +333,7 @@ RT2X00_LIB_FIRMWARE= +@@ -332,6 +332,7 @@ RT2X00_LIB_FIRMWARE= RT2X00_LIB_CRYPTO= RT2X00_LIB_LEDS= RT2X00_LIB_DEBUGFS= diff --git a/package/kernel/mac80211/patches/rtl/001-v5.12-rtlwifi-8821ae-upgrade-PHY-and-RF-parameters.patch b/package/kernel/mac80211/patches/rtl/001-v5.12-rtlwifi-8821ae-upgrade-PHY-and-RF-parameters.patch deleted file mode 100644 index 7b6cd99d82..0000000000 --- a/package/kernel/mac80211/patches/rtl/001-v5.12-rtlwifi-8821ae-upgrade-PHY-and-RF-parameters.patch +++ /dev/null @@ -1,817 +0,0 @@ -From 8f392a72419c4b10e84e635e51bee24670975364 Mon Sep 17 00:00:00 2001 -From: Ping-Ke Shih -Date: Fri, 19 Feb 2021 13:26:07 +0800 -Subject: [PATCH] rtlwifi: 8821ae: upgrade PHY and RF parameters - -New parameters with new format and its parser are updated by the -commit 84d26fda52e2 ("rtlwifi: Update 8821ae new phy parameters and its parser."), -but some parameters are missing. Use this commit to update to the novel -parameters that use new format. - -Fixes: 84d26fda52e2 ("rtlwifi: Update 8821ae new phy parameters and its parser") -Signed-off-by: Ping-Ke Shih -Tested-by: Kai-Heng Feng ---- - .../realtek/rtlwifi/rtl8821ae/table.c | 500 +++++++++++++----- - 1 file changed, 370 insertions(+), 130 deletions(-) - ---- a/drivers/net/wireless/realtek/rtlwifi/rtl8821ae/table.c -+++ b/drivers/net/wireless/realtek/rtlwifi/rtl8821ae/table.c -@@ -249,7 +249,7 @@ u32 RTL8821AE_PHY_REG_ARRAY[] = { - 0x824, 0x00030FE0, - 0x828, 0x00000000, - 0x82C, 0x002081DD, -- 0x830, 0x2AAA8E24, -+ 0x830, 0x2AAAEEC8, - 0x834, 0x0037A706, - 0x838, 0x06489B44, - 0x83C, 0x0000095B, -@@ -324,10 +324,10 @@ u32 RTL8821AE_PHY_REG_ARRAY[] = { - 0x9D8, 0x00000000, - 0x9DC, 0x00000000, - 0x9E0, 0x00005D00, -- 0x9E4, 0x00000002, -+ 0x9E4, 0x00000003, - 0x9E8, 0x00000001, - 0xA00, 0x00D047C8, -- 0xA04, 0x01FF000C, -+ 0xA04, 0x01FF800C, - 0xA08, 0x8C8A8300, - 0xA0C, 0x2E68000F, - 0xA10, 0x9500BB78, -@@ -1320,7 +1320,11 @@ u32 RTL8821AE_RADIOA_ARRAY[] = { - 0x083, 0x00021800, - 0x084, 0x00028000, - 0x085, 0x00048000, -+ 0x80000111, 0x00000000, 0x40000000, 0x00000000, -+ 0x086, 0x0009483A, -+ 0xA0000000, 0x00000000, - 0x086, 0x00094838, -+ 0xB0000000, 0x00000000, - 0x087, 0x00044980, - 0x088, 0x00048000, - 0x089, 0x0000D480, -@@ -1409,36 +1413,32 @@ u32 RTL8821AE_RADIOA_ARRAY[] = { - 0x03C, 0x000CA000, - 0x0EF, 0x00000000, - 0x0EF, 0x00001100, -- 0xFF0F0104, 0xABCD, -+ 0x80000111, 0x00000000, 0x40000000, 0x00000000, - 0x034, 0x0004ADF3, - 0x034, 0x00049DF0, -- 0xFF0F0204, 0xCDEF, -+ 0x90000110, 0x00000000, 0x40000000, 0x00000000, - 0x034, 0x0004ADF3, - 0x034, 0x00049DF0, -- 0xFF0F0404, 0xCDEF, -- 0x034, 0x0004ADF3, -- 0x034, 0x00049DF0, -- 0xFF0F0200, 0xCDEF, -+ 0x90000210, 0x00000000, 0x40000000, 0x00000000, - 0x034, 0x0004ADF5, - 0x034, 0x00049DF2, -- 0xFF0F02C0, 0xCDEF, -+ 0x9000020c, 0x00000000, 0x40000000, 0x00000000, -+ 0x034, 0x0004A0F3, -+ 0x034, 0x000490B1, -+ 0x9000040c, 0x00000000, 0x40000000, 0x00000000, - 0x034, 0x0004A0F3, - 0x034, 0x000490B1, -- 0xCDCDCDCD, 0xCDCD, -+ 0x90000200, 0x00000000, 0x40000000, 0x00000000, -+ 0x034, 0x0004ADF5, -+ 0x034, 0x00049DF2, -+ 0x90000410, 0x00000000, 0x40000000, 0x00000000, -+ 0x034, 0x0004ADF3, -+ 0x034, 0x00049DF0, -+ 0xA0000000, 0x00000000, - 0x034, 0x0004ADF7, - 0x034, 0x00049DF3, -- 0xFF0F0104, 0xDEAD, -- 0xFF0F0104, 0xABCD, -- 0x034, 0x00048DED, -- 0x034, 0x00047DEA, -- 0x034, 0x00046DE7, -- 0x034, 0x00045CE9, -- 0x034, 0x00044CE6, -- 0x034, 0x000438C6, -- 0x034, 0x00042886, -- 0x034, 0x00041486, -- 0x034, 0x00040447, -- 0xFF0F0204, 0xCDEF, -+ 0xB0000000, 0x00000000, -+ 0x80000111, 0x00000000, 0x40000000, 0x00000000, - 0x034, 0x00048DED, - 0x034, 0x00047DEA, - 0x034, 0x00046DE7, -@@ -1448,7 +1448,7 @@ u32 RTL8821AE_RADIOA_ARRAY[] = { - 0x034, 0x00042886, - 0x034, 0x00041486, - 0x034, 0x00040447, -- 0xFF0F0404, 0xCDEF, -+ 0x90000110, 0x00000000, 0x40000000, 0x00000000, - 0x034, 0x00048DED, - 0x034, 0x00047DEA, - 0x034, 0x00046DE7, -@@ -1458,7 +1458,17 @@ u32 RTL8821AE_RADIOA_ARRAY[] = { - 0x034, 0x00042886, - 0x034, 0x00041486, - 0x034, 0x00040447, -- 0xFF0F02C0, 0xCDEF, -+ 0x9000020c, 0x00000000, 0x40000000, 0x00000000, -+ 0x034, 0x000480AE, -+ 0x034, 0x000470AB, -+ 0x034, 0x0004608B, -+ 0x034, 0x00045069, -+ 0x034, 0x00044048, -+ 0x034, 0x00043045, -+ 0x034, 0x00042026, -+ 0x034, 0x00041023, -+ 0x034, 0x00040002, -+ 0x9000040c, 0x00000000, 0x40000000, 0x00000000, - 0x034, 0x000480AE, - 0x034, 0x000470AB, - 0x034, 0x0004608B, -@@ -1468,7 +1478,17 @@ u32 RTL8821AE_RADIOA_ARRAY[] = { - 0x034, 0x00042026, - 0x034, 0x00041023, - 0x034, 0x00040002, -- 0xCDCDCDCD, 0xCDCD, -+ 0x90000410, 0x00000000, 0x40000000, 0x00000000, -+ 0x034, 0x00048DED, -+ 0x034, 0x00047DEA, -+ 0x034, 0x00046DE7, -+ 0x034, 0x00045CE9, -+ 0x034, 0x00044CE6, -+ 0x034, 0x000438C6, -+ 0x034, 0x00042886, -+ 0x034, 0x00041486, -+ 0x034, 0x00040447, -+ 0xA0000000, 0x00000000, - 0x034, 0x00048DEF, - 0x034, 0x00047DEC, - 0x034, 0x00046DE9, -@@ -1478,38 +1498,36 @@ u32 RTL8821AE_RADIOA_ARRAY[] = { - 0x034, 0x0004248A, - 0x034, 0x0004108D, - 0x034, 0x0004008A, -- 0xFF0F0104, 0xDEAD, -- 0xFF0F0200, 0xABCD, -+ 0xB0000000, 0x00000000, -+ 0x80000210, 0x00000000, 0x40000000, 0x00000000, - 0x034, 0x0002ADF4, -- 0xFF0F02C0, 0xCDEF, -+ 0x9000020c, 0x00000000, 0x40000000, 0x00000000, -+ 0x034, 0x0002A0F3, -+ 0x9000040c, 0x00000000, 0x40000000, 0x00000000, - 0x034, 0x0002A0F3, -- 0xCDCDCDCD, 0xCDCD, -+ 0x90000200, 0x00000000, 0x40000000, 0x00000000, -+ 0x034, 0x0002ADF4, -+ 0xA0000000, 0x00000000, - 0x034, 0x0002ADF7, -- 0xFF0F0200, 0xDEAD, -- 0xFF0F0104, 0xABCD, -- 0x034, 0x00029DF4, -- 0xFF0F0204, 0xCDEF, -+ 0xB0000000, 0x00000000, -+ 0x80000111, 0x00000000, 0x40000000, 0x00000000, - 0x034, 0x00029DF4, -- 0xFF0F0404, 0xCDEF, -+ 0x90000110, 0x00000000, 0x40000000, 0x00000000, - 0x034, 0x00029DF4, -- 0xFF0F0200, 0xCDEF, -+ 0x90000210, 0x00000000, 0x40000000, 0x00000000, - 0x034, 0x00029DF1, -- 0xFF0F02C0, 0xCDEF, -+ 0x9000020c, 0x00000000, 0x40000000, 0x00000000, -+ 0x034, 0x000290F0, -+ 0x9000040c, 0x00000000, 0x40000000, 0x00000000, - 0x034, 0x000290F0, -- 0xCDCDCDCD, 0xCDCD, -+ 0x90000200, 0x00000000, 0x40000000, 0x00000000, -+ 0x034, 0x00029DF1, -+ 0x90000410, 0x00000000, 0x40000000, 0x00000000, -+ 0x034, 0x00029DF4, -+ 0xA0000000, 0x00000000, - 0x034, 0x00029DF2, -- 0xFF0F0104, 0xDEAD, -- 0xFF0F0104, 0xABCD, -- 0x034, 0x00028DF1, -- 0x034, 0x00027DEE, -- 0x034, 0x00026DEB, -- 0x034, 0x00025CEC, -- 0x034, 0x00024CE9, -- 0x034, 0x000238CA, -- 0x034, 0x00022889, -- 0x034, 0x00021489, -- 0x034, 0x0002044A, -- 0xFF0F0204, 0xCDEF, -+ 0xB0000000, 0x00000000, -+ 0x80000111, 0x00000000, 0x40000000, 0x00000000, - 0x034, 0x00028DF1, - 0x034, 0x00027DEE, - 0x034, 0x00026DEB, -@@ -1519,7 +1537,7 @@ u32 RTL8821AE_RADIOA_ARRAY[] = { - 0x034, 0x00022889, - 0x034, 0x00021489, - 0x034, 0x0002044A, -- 0xFF0F0404, 0xCDEF, -+ 0x90000110, 0x00000000, 0x40000000, 0x00000000, - 0x034, 0x00028DF1, - 0x034, 0x00027DEE, - 0x034, 0x00026DEB, -@@ -1529,7 +1547,7 @@ u32 RTL8821AE_RADIOA_ARRAY[] = { - 0x034, 0x00022889, - 0x034, 0x00021489, - 0x034, 0x0002044A, -- 0xFF0F02C0, 0xCDEF, -+ 0x9000020c, 0x00000000, 0x40000000, 0x00000000, - 0x034, 0x000280AF, - 0x034, 0x000270AC, - 0x034, 0x0002608B, -@@ -1539,7 +1557,27 @@ u32 RTL8821AE_RADIOA_ARRAY[] = { - 0x034, 0x00022026, - 0x034, 0x00021023, - 0x034, 0x00020002, -- 0xCDCDCDCD, 0xCDCD, -+ 0x9000040c, 0x00000000, 0x40000000, 0x00000000, -+ 0x034, 0x000280AF, -+ 0x034, 0x000270AC, -+ 0x034, 0x0002608B, -+ 0x034, 0x00025069, -+ 0x034, 0x00024048, -+ 0x034, 0x00023045, -+ 0x034, 0x00022026, -+ 0x034, 0x00021023, -+ 0x034, 0x00020002, -+ 0x90000410, 0x00000000, 0x40000000, 0x00000000, -+ 0x034, 0x00028DF1, -+ 0x034, 0x00027DEE, -+ 0x034, 0x00026DEB, -+ 0x034, 0x00025CEC, -+ 0x034, 0x00024CE9, -+ 0x034, 0x000238CA, -+ 0x034, 0x00022889, -+ 0x034, 0x00021489, -+ 0x034, 0x0002044A, -+ 0xA0000000, 0x00000000, - 0x034, 0x00028DEE, - 0x034, 0x00027DEB, - 0x034, 0x00026CCD, -@@ -1549,27 +1587,24 @@ u32 RTL8821AE_RADIOA_ARRAY[] = { - 0x034, 0x00022849, - 0x034, 0x00021449, - 0x034, 0x0002004D, -- 0xFF0F0104, 0xDEAD, -- 0xFF0F02C0, 0xABCD, -+ 0xB0000000, 0x00000000, -+ 0x8000020c, 0x00000000, 0x40000000, 0x00000000, -+ 0x034, 0x0000A0D7, -+ 0x034, 0x000090D3, -+ 0x034, 0x000080B1, -+ 0x034, 0x000070AE, -+ 0x9000040c, 0x00000000, 0x40000000, 0x00000000, - 0x034, 0x0000A0D7, - 0x034, 0x000090D3, - 0x034, 0x000080B1, - 0x034, 0x000070AE, -- 0xCDCDCDCD, 0xCDCD, -+ 0xA0000000, 0x00000000, - 0x034, 0x0000ADF7, - 0x034, 0x00009DF4, - 0x034, 0x00008DF1, - 0x034, 0x00007DEE, -- 0xFF0F02C0, 0xDEAD, -- 0xFF0F0104, 0xABCD, -- 0x034, 0x00006DEB, -- 0x034, 0x00005CEC, -- 0x034, 0x00004CE9, -- 0x034, 0x000038CA, -- 0x034, 0x00002889, -- 0x034, 0x00001489, -- 0x034, 0x0000044A, -- 0xFF0F0204, 0xCDEF, -+ 0xB0000000, 0x00000000, -+ 0x80000111, 0x00000000, 0x40000000, 0x00000000, - 0x034, 0x00006DEB, - 0x034, 0x00005CEC, - 0x034, 0x00004CE9, -@@ -1577,7 +1612,7 @@ u32 RTL8821AE_RADIOA_ARRAY[] = { - 0x034, 0x00002889, - 0x034, 0x00001489, - 0x034, 0x0000044A, -- 0xFF0F0404, 0xCDEF, -+ 0x90000110, 0x00000000, 0x40000000, 0x00000000, - 0x034, 0x00006DEB, - 0x034, 0x00005CEC, - 0x034, 0x00004CE9, -@@ -1585,7 +1620,7 @@ u32 RTL8821AE_RADIOA_ARRAY[] = { - 0x034, 0x00002889, - 0x034, 0x00001489, - 0x034, 0x0000044A, -- 0xFF0F02C0, 0xCDEF, -+ 0x9000020c, 0x00000000, 0x40000000, 0x00000000, - 0x034, 0x0000608D, - 0x034, 0x0000506B, - 0x034, 0x0000404A, -@@ -1593,7 +1628,23 @@ u32 RTL8821AE_RADIOA_ARRAY[] = { - 0x034, 0x00002044, - 0x034, 0x00001025, - 0x034, 0x00000004, -- 0xCDCDCDCD, 0xCDCD, -+ 0x9000040c, 0x00000000, 0x40000000, 0x00000000, -+ 0x034, 0x0000608D, -+ 0x034, 0x0000506B, -+ 0x034, 0x0000404A, -+ 0x034, 0x00003047, -+ 0x034, 0x00002044, -+ 0x034, 0x00001025, -+ 0x034, 0x00000004, -+ 0x90000410, 0x00000000, 0x40000000, 0x00000000, -+ 0x034, 0x00006DEB, -+ 0x034, 0x00005CEC, -+ 0x034, 0x00004CE9, -+ 0x034, 0x000038CA, -+ 0x034, 0x00002889, -+ 0x034, 0x00001489, -+ 0x034, 0x0000044A, -+ 0xA0000000, 0x00000000, - 0x034, 0x00006DCD, - 0x034, 0x00005CCD, - 0x034, 0x00004CCA, -@@ -1601,11 +1652,11 @@ u32 RTL8821AE_RADIOA_ARRAY[] = { - 0x034, 0x00002888, - 0x034, 0x00001488, - 0x034, 0x00000486, -- 0xFF0F0104, 0xDEAD, -+ 0xB0000000, 0x00000000, - 0x0EF, 0x00000000, - 0x018, 0x0001712A, - 0x0EF, 0x00000040, -- 0xFF0F0104, 0xABCD, -+ 0x80000111, 0x00000000, 0x40000000, 0x00000000, - 0x035, 0x00000187, - 0x035, 0x00008187, - 0x035, 0x00010187, -@@ -1615,7 +1666,7 @@ u32 RTL8821AE_RADIOA_ARRAY[] = { - 0x035, 0x00040188, - 0x035, 0x00048188, - 0x035, 0x00050188, -- 0xFF0F0204, 0xCDEF, -+ 0x90000110, 0x00000000, 0x40000000, 0x00000000, - 0x035, 0x00000187, - 0x035, 0x00008187, - 0x035, 0x00010187, -@@ -1625,7 +1676,37 @@ u32 RTL8821AE_RADIOA_ARRAY[] = { - 0x035, 0x00040188, - 0x035, 0x00048188, - 0x035, 0x00050188, -- 0xFF0F0404, 0xCDEF, -+ 0x90000210, 0x00000000, 0x40000000, 0x00000000, -+ 0x035, 0x00000128, -+ 0x035, 0x00008128, -+ 0x035, 0x00010128, -+ 0x035, 0x000201C8, -+ 0x035, 0x000281C8, -+ 0x035, 0x000301C8, -+ 0x035, 0x000401C8, -+ 0x035, 0x000481C8, -+ 0x035, 0x000501C8, -+ 0x9000040c, 0x00000000, 0x40000000, 0x00000000, -+ 0x035, 0x00000145, -+ 0x035, 0x00008145, -+ 0x035, 0x00010145, -+ 0x035, 0x00020196, -+ 0x035, 0x00028196, -+ 0x035, 0x00030196, -+ 0x035, 0x000401C7, -+ 0x035, 0x000481C7, -+ 0x035, 0x000501C7, -+ 0x90000200, 0x00000000, 0x40000000, 0x00000000, -+ 0x035, 0x00000128, -+ 0x035, 0x00008128, -+ 0x035, 0x00010128, -+ 0x035, 0x000201C8, -+ 0x035, 0x000281C8, -+ 0x035, 0x000301C8, -+ 0x035, 0x000401C8, -+ 0x035, 0x000481C8, -+ 0x035, 0x000501C8, -+ 0x90000410, 0x00000000, 0x40000000, 0x00000000, - 0x035, 0x00000187, - 0x035, 0x00008187, - 0x035, 0x00010187, -@@ -1635,7 +1716,7 @@ u32 RTL8821AE_RADIOA_ARRAY[] = { - 0x035, 0x00040188, - 0x035, 0x00048188, - 0x035, 0x00050188, -- 0xCDCDCDCD, 0xCDCD, -+ 0xA0000000, 0x00000000, - 0x035, 0x00000145, - 0x035, 0x00008145, - 0x035, 0x00010145, -@@ -1645,11 +1726,11 @@ u32 RTL8821AE_RADIOA_ARRAY[] = { - 0x035, 0x000401C7, - 0x035, 0x000481C7, - 0x035, 0x000501C7, -- 0xFF0F0104, 0xDEAD, -+ 0xB0000000, 0x00000000, - 0x0EF, 0x00000000, - 0x018, 0x0001712A, - 0x0EF, 0x00000010, -- 0xFF0F0104, 0xABCD, -+ 0x80000111, 0x00000000, 0x40000000, 0x00000000, - 0x036, 0x00085733, - 0x036, 0x0008D733, - 0x036, 0x00095733, -@@ -1662,7 +1743,7 @@ u32 RTL8821AE_RADIOA_ARRAY[] = { - 0x036, 0x000CE4B4, - 0x036, 0x000D64B4, - 0x036, 0x000DE4B4, -- 0xFF0F0204, 0xCDEF, -+ 0x90000110, 0x00000000, 0x40000000, 0x00000000, - 0x036, 0x00085733, - 0x036, 0x0008D733, - 0x036, 0x00095733, -@@ -1675,7 +1756,46 @@ u32 RTL8821AE_RADIOA_ARRAY[] = { - 0x036, 0x000CE4B4, - 0x036, 0x000D64B4, - 0x036, 0x000DE4B4, -- 0xFF0F0404, 0xCDEF, -+ 0x90000210, 0x00000000, 0x40000000, 0x00000000, -+ 0x036, 0x000063B5, -+ 0x036, 0x0000E3B5, -+ 0x036, 0x000163B5, -+ 0x036, 0x0001E3B5, -+ 0x036, 0x000263B5, -+ 0x036, 0x0002E3B5, -+ 0x036, 0x000363B5, -+ 0x036, 0x0003E3B5, -+ 0x036, 0x000463B5, -+ 0x036, 0x0004E3B5, -+ 0x036, 0x000563B5, -+ 0x036, 0x0005E3B5, -+ 0x9000040c, 0x00000000, 0x40000000, 0x00000000, -+ 0x036, 0x000056B3, -+ 0x036, 0x0000D6B3, -+ 0x036, 0x000156B3, -+ 0x036, 0x0001D6B3, -+ 0x036, 0x00026634, -+ 0x036, 0x0002E634, -+ 0x036, 0x00036634, -+ 0x036, 0x0003E634, -+ 0x036, 0x000467B4, -+ 0x036, 0x0004E7B4, -+ 0x036, 0x000567B4, -+ 0x036, 0x0005E7B4, -+ 0x90000200, 0x00000000, 0x40000000, 0x00000000, -+ 0x036, 0x000063B5, -+ 0x036, 0x0000E3B5, -+ 0x036, 0x000163B5, -+ 0x036, 0x0001E3B5, -+ 0x036, 0x000263B5, -+ 0x036, 0x0002E3B5, -+ 0x036, 0x000363B5, -+ 0x036, 0x0003E3B5, -+ 0x036, 0x000463B5, -+ 0x036, 0x0004E3B5, -+ 0x036, 0x000563B5, -+ 0x036, 0x0005E3B5, -+ 0x90000410, 0x00000000, 0x40000000, 0x00000000, - 0x036, 0x00085733, - 0x036, 0x0008D733, - 0x036, 0x00095733, -@@ -1688,7 +1808,7 @@ u32 RTL8821AE_RADIOA_ARRAY[] = { - 0x036, 0x000CE4B4, - 0x036, 0x000D64B4, - 0x036, 0x000DE4B4, -- 0xCDCDCDCD, 0xCDCD, -+ 0xA0000000, 0x00000000, - 0x036, 0x000056B3, - 0x036, 0x0000D6B3, - 0x036, 0x000156B3, -@@ -1701,103 +1821,162 @@ u32 RTL8821AE_RADIOA_ARRAY[] = { - 0x036, 0x0004E7B4, - 0x036, 0x000567B4, - 0x036, 0x0005E7B4, -- 0xFF0F0104, 0xDEAD, -+ 0xB0000000, 0x00000000, - 0x0EF, 0x00000000, - 0x0EF, 0x00000008, -- 0xFF0F0104, 0xABCD, -+ 0x80000111, 0x00000000, 0x40000000, 0x00000000, - 0x03C, 0x000001C8, - 0x03C, 0x00000492, -- 0xFF0F0204, 0xCDEF, -+ 0x90000110, 0x00000000, 0x40000000, 0x00000000, - 0x03C, 0x000001C8, - 0x03C, 0x00000492, -- 0xFF0F0404, 0xCDEF, -+ 0x90000210, 0x00000000, 0x40000000, 0x00000000, -+ 0x03C, 0x000001B6, -+ 0x03C, 0x00000492, -+ 0x9000040c, 0x00000000, 0x40000000, 0x00000000, -+ 0x03C, 0x0000022A, -+ 0x03C, 0x00000594, -+ 0x90000200, 0x00000000, 0x40000000, 0x00000000, -+ 0x03C, 0x000001B6, -+ 0x03C, 0x00000492, -+ 0x90000410, 0x00000000, 0x40000000, 0x00000000, - 0x03C, 0x000001C8, - 0x03C, 0x00000492, -- 0xCDCDCDCD, 0xCDCD, -+ 0xA0000000, 0x00000000, - 0x03C, 0x0000022A, - 0x03C, 0x00000594, -- 0xFF0F0104, 0xDEAD, -- 0xFF0F0104, 0xABCD, -+ 0xB0000000, 0x00000000, -+ 0x80000111, 0x00000000, 0x40000000, 0x00000000, - 0x03C, 0x00000800, -- 0xFF0F0204, 0xCDEF, -+ 0x90000110, 0x00000000, 0x40000000, 0x00000000, - 0x03C, 0x00000800, -- 0xFF0F0404, 0xCDEF, -+ 0x90000210, 0x00000000, 0x40000000, 0x00000000, - 0x03C, 0x00000800, -- 0xFF0F02C0, 0xCDEF, -+ 0x9000020c, 0x00000000, 0x40000000, 0x00000000, - 0x03C, 0x00000820, -- 0xCDCDCDCD, 0xCDCD, -+ 0x9000040c, 0x00000000, 0x40000000, 0x00000000, -+ 0x03C, 0x00000820, -+ 0x90000200, 0x00000000, 0x40000000, 0x00000000, -+ 0x03C, 0x00000800, -+ 0x90000410, 0x00000000, 0x40000000, 0x00000000, -+ 0x03C, 0x00000800, -+ 0xA0000000, 0x00000000, - 0x03C, 0x00000900, -- 0xFF0F0104, 0xDEAD, -+ 0xB0000000, 0x00000000, - 0x0EF, 0x00000000, - 0x018, 0x0001712A, - 0x0EF, 0x00000002, -- 0xFF0F0104, 0xABCD, -+ 0x80000111, 0x00000000, 0x40000000, 0x00000000, - 0x008, 0x0004E400, -- 0xFF0F0204, 0xCDEF, -+ 0x90000110, 0x00000000, 0x40000000, 0x00000000, - 0x008, 0x0004E400, -- 0xFF0F0404, 0xCDEF, -+ 0x90000210, 0x00000000, 0x40000000, 0x00000000, -+ 0x008, 0x00002000, -+ 0x9000020c, 0x00000000, 0x40000000, 0x00000000, -+ 0x008, 0x00002000, -+ 0x9000040c, 0x00000000, 0x40000000, 0x00000000, -+ 0x008, 0x00002000, -+ 0x90000200, 0x00000000, 0x40000000, 0x00000000, -+ 0x008, 0x00002000, -+ 0x90000410, 0x00000000, 0x40000000, 0x00000000, - 0x008, 0x0004E400, -- 0xCDCDCDCD, 0xCDCD, -+ 0xA0000000, 0x00000000, - 0x008, 0x00002000, -- 0xFF0F0104, 0xDEAD, -+ 0xB0000000, 0x00000000, - 0x0EF, 0x00000000, - 0x0DF, 0x000000C0, -- 0x01F, 0x00040064, -- 0xFF0F0104, 0xABCD, -+ 0x01F, 0x00000064, -+ 0x80000111, 0x00000000, 0x40000000, 0x00000000, - 0x058, 0x000A7284, - 0x059, 0x000600EC, -- 0xFF0F0204, 0xCDEF, -+ 0x90000110, 0x00000000, 0x40000000, 0x00000000, - 0x058, 0x000A7284, - 0x059, 0x000600EC, -- 0xFF0F0404, 0xCDEF, -+ 0x9000020c, 0x00000000, 0x40000000, 0x00000000, -+ 0x058, 0x00081184, -+ 0x059, 0x0006016C, -+ 0x9000040c, 0x00000000, 0x40000000, 0x00000000, -+ 0x058, 0x00081184, -+ 0x059, 0x0006016C, -+ 0x90000200, 0x00000000, 0x40000000, 0x00000000, -+ 0x058, 0x00081184, -+ 0x059, 0x0006016C, -+ 0x90000410, 0x00000000, 0x40000000, 0x00000000, - 0x058, 0x000A7284, - 0x059, 0x000600EC, -- 0xCDCDCDCD, 0xCDCD, -+ 0xA0000000, 0x00000000, - 0x058, 0x00081184, - 0x059, 0x0006016C, -- 0xFF0F0104, 0xDEAD, -- 0xFF0F0104, 0xABCD, -+ 0xB0000000, 0x00000000, -+ 0x80000111, 0x00000000, 0x40000000, 0x00000000, - 0x061, 0x000E8D73, - 0x062, 0x00093FC5, -- 0xFF0F0204, 0xCDEF, -+ 0x90000110, 0x00000000, 0x40000000, 0x00000000, - 0x061, 0x000E8D73, - 0x062, 0x00093FC5, -- 0xFF0F0404, 0xCDEF, -+ 0x90000210, 0x00000000, 0x40000000, 0x00000000, -+ 0x061, 0x000EFD83, -+ 0x062, 0x00093FCC, -+ 0x9000040c, 0x00000000, 0x40000000, 0x00000000, -+ 0x061, 0x000EAD53, -+ 0x062, 0x00093BC4, -+ 0x90000200, 0x00000000, 0x40000000, 0x00000000, -+ 0x061, 0x000EFD83, -+ 0x062, 0x00093FCC, -+ 0x90000410, 0x00000000, 0x40000000, 0x00000000, - 0x061, 0x000E8D73, - 0x062, 0x00093FC5, -- 0xCDCDCDCD, 0xCDCD, -+ 0xA0000000, 0x00000000, - 0x061, 0x000EAD53, - 0x062, 0x00093BC4, -- 0xFF0F0104, 0xDEAD, -- 0xFF0F0104, 0xABCD, -+ 0xB0000000, 0x00000000, -+ 0x80000111, 0x00000000, 0x40000000, 0x00000000, - 0x063, 0x000110E9, -- 0xFF0F0204, 0xCDEF, -+ 0x90000110, 0x00000000, 0x40000000, 0x00000000, - 0x063, 0x000110E9, -- 0xFF0F0404, 0xCDEF, -+ 0x90000210, 0x00000000, 0x40000000, 0x00000000, -+ 0x063, 0x000110EB, -+ 0x9000020c, 0x00000000, 0x40000000, 0x00000000, - 0x063, 0x000110E9, -- 0xFF0F0200, 0xCDEF, -- 0x063, 0x000710E9, -- 0xFF0F02C0, 0xCDEF, -+ 0x9000040c, 0x00000000, 0x40000000, 0x00000000, - 0x063, 0x000110E9, -- 0xCDCDCDCD, 0xCDCD, -+ 0x90000200, 0x00000000, 0x40000000, 0x00000000, -+ 0x063, 0x000110EB, -+ 0x90000410, 0x00000000, 0x40000000, 0x00000000, -+ 0x063, 0x000110E9, -+ 0xA0000000, 0x00000000, - 0x063, 0x000714E9, -- 0xFF0F0104, 0xDEAD, -- 0xFF0F0104, 0xABCD, -+ 0xB0000000, 0x00000000, -+ 0x80000111, 0x00000000, 0x40000000, 0x00000000, -+ 0x064, 0x0001C27C, -+ 0x90000110, 0x00000000, 0x40000000, 0x00000000, -+ 0x064, 0x0001C27C, -+ 0x90000210, 0x00000000, 0x40000000, 0x00000000, - 0x064, 0x0001C27C, -- 0xFF0F0204, 0xCDEF, -+ 0x9000040c, 0x00000000, 0x40000000, 0x00000000, -+ 0x064, 0x0001C67C, -+ 0x90000200, 0x00000000, 0x40000000, 0x00000000, - 0x064, 0x0001C27C, -- 0xFF0F0404, 0xCDEF, -+ 0x90000410, 0x00000000, 0x40000000, 0x00000000, - 0x064, 0x0001C27C, -- 0xCDCDCDCD, 0xCDCD, -+ 0xA0000000, 0x00000000, - 0x064, 0x0001C67C, -- 0xFF0F0104, 0xDEAD, -- 0xFF0F0200, 0xABCD, -+ 0xB0000000, 0x00000000, -+ 0x80000111, 0x00000000, 0x40000000, 0x00000000, -+ 0x065, 0x00091016, -+ 0x90000110, 0x00000000, 0x40000000, 0x00000000, -+ 0x065, 0x00091016, -+ 0x90000210, 0x00000000, 0x40000000, 0x00000000, - 0x065, 0x00093016, -- 0xFF0F02C0, 0xCDEF, -+ 0x9000020c, 0x00000000, 0x40000000, 0x00000000, - 0x065, 0x00093015, -- 0xCDCDCDCD, 0xCDCD, -+ 0x9000040c, 0x00000000, 0x40000000, 0x00000000, -+ 0x065, 0x00093015, -+ 0x90000200, 0x00000000, 0x40000000, 0x00000000, -+ 0x065, 0x00093016, -+ 0xA0000000, 0x00000000, - 0x065, 0x00091016, -- 0xFF0F0200, 0xDEAD, -+ 0xB0000000, 0x00000000, - 0x018, 0x00000006, - 0x0EF, 0x00002000, - 0x03B, 0x0003824B, -@@ -1895,9 +2074,10 @@ u32 RTL8821AE_RADIOA_ARRAY[] = { - 0x0B4, 0x0001214C, - 0x0B7, 0x0003000C, - 0x01C, 0x000539D2, -+ 0x0C4, 0x000AFE00, - 0x018, 0x0001F12A, -- 0x0FE, 0x00000000, -- 0x0FE, 0x00000000, -+ 0xFFE, 0x00000000, -+ 0xFFE, 0x00000000, - 0x018, 0x0001712A, - - }; -@@ -2017,6 +2197,7 @@ u32 RTL8812AE_MAC_REG_ARRAY[] = { - u32 RTL8812AE_MAC_1T_ARRAYLEN = ARRAY_SIZE(RTL8812AE_MAC_REG_ARRAY); - - u32 RTL8821AE_MAC_REG_ARRAY[] = { -+ 0x421, 0x0000000F, - 0x428, 0x0000000A, - 0x429, 0x00000010, - 0x430, 0x00000000, -@@ -2485,7 +2666,7 @@ u32 RTL8821AE_AGC_TAB_ARRAY[] = { - 0x81C, 0xA6360001, - 0x81C, 0xA5380001, - 0x81C, 0xA43A0001, -- 0x81C, 0xA33C0001, -+ 0x81C, 0x683C0001, - 0x81C, 0x673E0001, - 0x81C, 0x66400001, - 0x81C, 0x65420001, -@@ -2519,7 +2700,66 @@ u32 RTL8821AE_AGC_TAB_ARRAY[] = { - 0x81C, 0x017A0001, - 0x81C, 0x017C0001, - 0x81C, 0x017E0001, -- 0xFF0F02C0, 0xABCD, -+ 0x8000020c, 0x00000000, 0x40000000, 0x00000000, -+ 0x81C, 0xFB000101, -+ 0x81C, 0xFA020101, -+ 0x81C, 0xF9040101, -+ 0x81C, 0xF8060101, -+ 0x81C, 0xF7080101, -+ 0x81C, 0xF60A0101, -+ 0x81C, 0xF50C0101, -+ 0x81C, 0xF40E0101, -+ 0x81C, 0xF3100101, -+ 0x81C, 0xF2120101, -+ 0x81C, 0xF1140101, -+ 0x81C, 0xF0160101, -+ 0x81C, 0xEF180101, -+ 0x81C, 0xEE1A0101, -+ 0x81C, 0xED1C0101, -+ 0x81C, 0xEC1E0101, -+ 0x81C, 0xEB200101, -+ 0x81C, 0xEA220101, -+ 0x81C, 0xE9240101, -+ 0x81C, 0xE8260101, -+ 0x81C, 0xE7280101, -+ 0x81C, 0xE62A0101, -+ 0x81C, 0xE52C0101, -+ 0x81C, 0xE42E0101, -+ 0x81C, 0xE3300101, -+ 0x81C, 0xA5320101, -+ 0x81C, 0xA4340101, -+ 0x81C, 0xA3360101, -+ 0x81C, 0x87380101, -+ 0x81C, 0x863A0101, -+ 0x81C, 0x853C0101, -+ 0x81C, 0x843E0101, -+ 0x81C, 0x69400101, -+ 0x81C, 0x68420101, -+ 0x81C, 0x67440101, -+ 0x81C, 0x66460101, -+ 0x81C, 0x49480101, -+ 0x81C, 0x484A0101, -+ 0x81C, 0x474C0101, -+ 0x81C, 0x2A4E0101, -+ 0x81C, 0x29500101, -+ 0x81C, 0x28520101, -+ 0x81C, 0x27540101, -+ 0x81C, 0x26560101, -+ 0x81C, 0x25580101, -+ 0x81C, 0x245A0101, -+ 0x81C, 0x235C0101, -+ 0x81C, 0x055E0101, -+ 0x81C, 0x04600101, -+ 0x81C, 0x03620101, -+ 0x81C, 0x02640101, -+ 0x81C, 0x01660101, -+ 0x81C, 0x01680101, -+ 0x81C, 0x016A0101, -+ 0x81C, 0x016C0101, -+ 0x81C, 0x016E0101, -+ 0x81C, 0x01700101, -+ 0x81C, 0x01720101, -+ 0x9000040c, 0x00000000, 0x40000000, 0x00000000, - 0x81C, 0xFB000101, - 0x81C, 0xFA020101, - 0x81C, 0xF9040101, -@@ -2578,7 +2818,7 @@ u32 RTL8821AE_AGC_TAB_ARRAY[] = { - 0x81C, 0x016E0101, - 0x81C, 0x01700101, - 0x81C, 0x01720101, -- 0xCDCDCDCD, 0xCDCD, -+ 0xA0000000, 0x00000000, - 0x81C, 0xFF000101, - 0x81C, 0xFF020101, - 0x81C, 0xFE040101, -@@ -2637,7 +2877,7 @@ u32 RTL8821AE_AGC_TAB_ARRAY[] = { - 0x81C, 0x046E0101, - 0x81C, 0x03700101, - 0x81C, 0x02720101, -- 0xFF0F02C0, 0xDEAD, -+ 0xB0000000, 0x00000000, - 0x81C, 0x01740101, - 0x81C, 0x01760101, - 0x81C, 0x01780101, diff --git a/package/kernel/mac80211/patches/subsys/100-remove-cryptoapi-dependencies.patch b/package/kernel/mac80211/patches/subsys/100-remove-cryptoapi-dependencies.patch index ec6ecbcfce..ca02dfb06f 100644 --- a/package/kernel/mac80211/patches/subsys/100-remove-cryptoapi-dependencies.patch +++ b/package/kernel/mac80211/patches/subsys/100-remove-cryptoapi-dependencies.patch @@ -379,7 +379,7 @@ #endif /* AES_GCM_H */ --- a/net/mac80211/wpa.c +++ b/net/mac80211/wpa.c -@@ -311,7 +311,8 @@ ieee80211_crypto_tkip_decrypt(struct iee +@@ -312,7 +312,8 @@ ieee80211_crypto_tkip_decrypt(struct iee } @@ -389,7 +389,7 @@ { __le16 mask_fc; int a4_included, mgmt; -@@ -341,14 +342,8 @@ static void ccmp_special_blocks(struct s +@@ -342,14 +343,8 @@ static void ccmp_special_blocks(struct s else qos_tid = 0; @@ -406,7 +406,7 @@ /* Nonce: Nonce Flags | A2 | PN * Nonce Flags: Priority (b0..b3) | Management (b4) | Reserved (b5..b7) -@@ -356,6 +351,8 @@ static void ccmp_special_blocks(struct s +@@ -357,6 +352,8 @@ static void ccmp_special_blocks(struct s b_0[1] = qos_tid | (mgmt << 4); memcpy(&b_0[2], hdr->addr2, ETH_ALEN); memcpy(&b_0[8], pn, IEEE80211_CCMP_PN_LEN); @@ -415,7 +415,7 @@ /* AAD (extra authenticate-only data) / masked 802.11 header * FC | A1 | A2 | A3 | SC | [A4] | [QC] */ -@@ -412,7 +409,7 @@ static int ccmp_encrypt_skb(struct ieee8 +@@ -413,7 +410,7 @@ static int ccmp_encrypt_skb(struct ieee8 u8 *pos; u8 pn[6]; u64 pn64; @@ -424,7 +424,7 @@ u8 b_0[AES_BLOCK_SIZE]; if (info->control.hw_key && -@@ -467,9 +464,11 @@ static int ccmp_encrypt_skb(struct ieee8 +@@ -468,9 +465,11 @@ static int ccmp_encrypt_skb(struct ieee8 return 0; pos += IEEE80211_CCMP_HDR_LEN; @@ -439,7 +439,7 @@ } -@@ -542,13 +541,13 @@ ieee80211_crypto_ccmp_decrypt(struct iee +@@ -543,13 +542,13 @@ ieee80211_crypto_ccmp_decrypt(struct iee u8 aad[2 * AES_BLOCK_SIZE]; u8 b_0[AES_BLOCK_SIZE]; /* hardware didn't decrypt/verify MIC */ @@ -455,7 +455,7 @@ return RX_DROP_UNUSABLE; } -@@ -643,7 +642,7 @@ static int gcmp_encrypt_skb(struct ieee8 +@@ -646,7 +645,7 @@ static int gcmp_encrypt_skb(struct ieee8 u8 *pos; u8 pn[6]; u64 pn64; @@ -464,7 +464,7 @@ u8 j_0[AES_BLOCK_SIZE]; if (info->control.hw_key && -@@ -700,8 +699,10 @@ static int gcmp_encrypt_skb(struct ieee8 +@@ -703,8 +702,10 @@ static int gcmp_encrypt_skb(struct ieee8 pos += IEEE80211_GCMP_HDR_LEN; gcmp_special_blocks(skb, pn, j_0, aad); @@ -477,7 +477,7 @@ } ieee80211_tx_result -@@ -1128,9 +1129,9 @@ ieee80211_crypto_aes_gmac_encrypt(struct +@@ -1133,9 +1134,9 @@ ieee80211_crypto_aes_gmac_encrypt(struct struct ieee80211_key *key = tx->key; struct ieee80211_mmie_16 *mmie; struct ieee80211_hdr *hdr; @@ -489,7 +489,7 @@ if (WARN_ON(skb_queue_len(&tx->skbs) != 1)) return TX_DROP; -@@ -1176,7 +1177,7 @@ ieee80211_crypto_aes_gmac_decrypt(struct +@@ -1181,7 +1182,7 @@ ieee80211_crypto_aes_gmac_decrypt(struct struct ieee80211_rx_status *status = IEEE80211_SKB_RXCB(skb); struct ieee80211_key *key = rx->key; struct ieee80211_mmie_16 *mmie; diff --git a/package/kernel/mac80211/patches/subsys/150-disable_addr_notifier.patch b/package/kernel/mac80211/patches/subsys/150-disable_addr_notifier.patch index 9589235f71..8d086625e4 100644 --- a/package/kernel/mac80211/patches/subsys/150-disable_addr_notifier.patch +++ b/package/kernel/mac80211/patches/subsys/150-disable_addr_notifier.patch @@ -18,7 +18,7 @@ static int ieee80211_ifa6_changed(struct notifier_block *nb, unsigned long data, void *arg) { -@@ -1312,14 +1312,14 @@ int ieee80211_register_hw(struct ieee802 +@@ -1315,14 +1315,14 @@ int ieee80211_register_hw(struct ieee802 rtnl_unlock(); @@ -35,7 +35,7 @@ local->ifa6_notifier.notifier_call = ieee80211_ifa6_changed; result = register_inet6addr_notifier(&local->ifa6_notifier); if (result) -@@ -1328,13 +1328,13 @@ int ieee80211_register_hw(struct ieee802 +@@ -1331,13 +1331,13 @@ int ieee80211_register_hw(struct ieee802 return 0; @@ -52,7 +52,7 @@ fail_ifa: #endif wiphy_unregister(local->hw.wiphy); -@@ -1362,10 +1362,10 @@ void ieee80211_unregister_hw(struct ieee +@@ -1365,10 +1365,10 @@ void ieee80211_unregister_hw(struct ieee tasklet_kill(&local->tx_pending_tasklet); tasklet_kill(&local->tasklet); diff --git a/package/kernel/mac80211/patches/subsys/300-cfg80211-support-immediate-reconnect-request-hint.patch b/package/kernel/mac80211/patches/subsys/300-cfg80211-support-immediate-reconnect-request-hint.patch index 807d496080..8fe8723cfe 100644 --- a/package/kernel/mac80211/patches/subsys/300-cfg80211-support-immediate-reconnect-request-hint.patch +++ b/package/kernel/mac80211/patches/subsys/300-cfg80211-support-immediate-reconnect-request-hint.patch @@ -33,7 +33,7 @@ Signed-off-by: Johannes Berg * cfg80211_rx_unprot_mlme_mgmt - notification of unprotected mlme mgmt frame --- a/net/mac80211/mlme.c +++ b/net/mac80211/mlme.c -@@ -2729,7 +2729,7 @@ static void ieee80211_report_disconnect( +@@ -2734,7 +2734,7 @@ static void ieee80211_report_disconnect( }; if (tx) @@ -42,7 +42,7 @@ Signed-off-by: Johannes Berg else cfg80211_rx_mlme_mgmt(sdata->dev, buf, len); -@@ -4719,7 +4719,8 @@ void ieee80211_mgd_quiesce(struct ieee80 +@@ -4724,7 +4724,8 @@ void ieee80211_mgd_quiesce(struct ieee80 if (ifmgd->auth_data) ieee80211_destroy_auth_data(sdata, false); cfg80211_tx_mlme_mgmt(sdata->dev, frame_buf, diff --git a/package/kernel/mac80211/patches/subsys/301-mac80211-support-driver-based-disconnect-with-reconn.patch b/package/kernel/mac80211/patches/subsys/301-mac80211-support-driver-based-disconnect-with-reconn.patch index 59a154a543..31621ebf11 100644 --- a/package/kernel/mac80211/patches/subsys/301-mac80211-support-driver-based-disconnect-with-reconn.patch +++ b/package/kernel/mac80211/patches/subsys/301-mac80211-support-driver-based-disconnect-with-reconn.patch @@ -34,7 +34,7 @@ Signed-off-by: Johannes Berg * @vif: &struct ieee80211_vif pointer from the add_interface callback. --- a/net/mac80211/ieee80211_i.h +++ b/net/mac80211/ieee80211_i.h -@@ -461,7 +461,9 @@ struct ieee80211_if_managed { +@@ -450,7 +450,9 @@ struct ieee80211_if_managed { unsigned long probe_timeout; int probe_send_count; bool nullfunc_failed; @@ -47,7 +47,7 @@ Signed-off-by: Johannes Berg struct ieee80211_mgd_auth_data *auth_data; --- a/net/mac80211/mlme.c +++ b/net/mac80211/mlme.c -@@ -2720,7 +2720,7 @@ EXPORT_SYMBOL(ieee80211_ap_probereq_get) +@@ -2725,7 +2725,7 @@ EXPORT_SYMBOL(ieee80211_ap_probereq_get) static void ieee80211_report_disconnect(struct ieee80211_sub_if_data *sdata, const u8 *buf, size_t len, bool tx, @@ -56,7 +56,7 @@ Signed-off-by: Johannes Berg { struct ieee80211_event event = { .type = MLME_EVENT, -@@ -2729,7 +2729,7 @@ static void ieee80211_report_disconnect( +@@ -2734,7 +2734,7 @@ static void ieee80211_report_disconnect( }; if (tx) @@ -65,7 +65,7 @@ Signed-off-by: Johannes Berg else cfg80211_rx_mlme_mgmt(sdata->dev, buf, len); -@@ -2751,13 +2751,18 @@ static void __ieee80211_disconnect(struc +@@ -2756,13 +2756,18 @@ static void __ieee80211_disconnect(struc tx = !sdata->csa_block_tx; @@ -89,7 +89,7 @@ Signed-off-by: Johannes Berg tx, frame_buf); mutex_lock(&local->mtx); sdata->vif.csa_active = false; -@@ -2770,7 +2775,9 @@ static void __ieee80211_disconnect(struc +@@ -2775,7 +2780,9 @@ static void __ieee80211_disconnect(struc mutex_unlock(&local->mtx); ieee80211_report_disconnect(sdata, frame_buf, sizeof(frame_buf), tx, @@ -100,7 +100,7 @@ Signed-off-by: Johannes Berg sdata_unlock(sdata); } -@@ -2789,6 +2796,13 @@ static void ieee80211_beacon_connection_ +@@ -2794,6 +2801,13 @@ static void ieee80211_beacon_connection_ sdata_info(sdata, "Connection to AP %pM lost\n", ifmgd->bssid); __ieee80211_disconnect(sdata); @@ -114,7 +114,7 @@ Signed-off-by: Johannes Berg } else { ieee80211_mgd_probe_ap(sdata, true); } -@@ -2827,6 +2841,21 @@ void ieee80211_connection_loss(struct ie +@@ -2832,6 +2846,21 @@ void ieee80211_connection_loss(struct ie } EXPORT_SYMBOL(ieee80211_connection_loss); @@ -136,7 +136,7 @@ Signed-off-by: Johannes Berg static void ieee80211_destroy_auth_data(struct ieee80211_sub_if_data *sdata, bool assoc) -@@ -3130,7 +3159,7 @@ static void ieee80211_rx_mgmt_deauth(str +@@ -3135,7 +3164,7 @@ static void ieee80211_rx_mgmt_deauth(str ieee80211_set_disassoc(sdata, 0, 0, false, NULL); ieee80211_report_disconnect(sdata, (u8 *)mgmt, len, false, @@ -145,7 +145,7 @@ Signed-off-by: Johannes Berg return; } -@@ -3179,7 +3208,8 @@ static void ieee80211_rx_mgmt_disassoc(s +@@ -3184,7 +3213,8 @@ static void ieee80211_rx_mgmt_disassoc(s ieee80211_set_disassoc(sdata, 0, 0, false, NULL); @@ -155,7 +155,7 @@ Signed-off-by: Johannes Berg } static void ieee80211_get_rates(struct ieee80211_supported_band *sband, -@@ -4199,7 +4229,8 @@ static void ieee80211_rx_mgmt_beacon(str +@@ -4204,7 +4234,8 @@ static void ieee80211_rx_mgmt_beacon(str true, deauth_buf); ieee80211_report_disconnect(sdata, deauth_buf, sizeof(deauth_buf), true, @@ -165,7 +165,7 @@ Signed-off-by: Johannes Berg return; } -@@ -4344,7 +4375,7 @@ static void ieee80211_sta_connection_los +@@ -4349,7 +4380,7 @@ static void ieee80211_sta_connection_los tx, frame_buf); ieee80211_report_disconnect(sdata, frame_buf, sizeof(frame_buf), true, @@ -174,7 +174,7 @@ Signed-off-by: Johannes Berg } static int ieee80211_auth(struct ieee80211_sub_if_data *sdata) -@@ -5434,7 +5465,8 @@ int ieee80211_mgd_auth(struct ieee80211_ +@@ -5439,7 +5470,8 @@ int ieee80211_mgd_auth(struct ieee80211_ ieee80211_report_disconnect(sdata, frame_buf, sizeof(frame_buf), true, @@ -184,7 +184,7 @@ Signed-off-by: Johannes Berg } sdata_info(sdata, "authenticate with %pM\n", req->bss->bssid); -@@ -5506,7 +5538,8 @@ int ieee80211_mgd_assoc(struct ieee80211 +@@ -5511,7 +5543,8 @@ int ieee80211_mgd_assoc(struct ieee80211 ieee80211_report_disconnect(sdata, frame_buf, sizeof(frame_buf), true, @@ -194,7 +194,7 @@ Signed-off-by: Johannes Berg } if (ifmgd->auth_data && !ifmgd->auth_data->done) { -@@ -5805,7 +5838,7 @@ int ieee80211_mgd_deauth(struct ieee8021 +@@ -5810,7 +5843,7 @@ int ieee80211_mgd_deauth(struct ieee8021 ieee80211_destroy_auth_data(sdata, false); ieee80211_report_disconnect(sdata, frame_buf, sizeof(frame_buf), true, @@ -203,7 +203,7 @@ Signed-off-by: Johannes Berg return 0; } -@@ -5825,7 +5858,7 @@ int ieee80211_mgd_deauth(struct ieee8021 +@@ -5830,7 +5863,7 @@ int ieee80211_mgd_deauth(struct ieee8021 ieee80211_destroy_assoc_data(sdata, false, true); ieee80211_report_disconnect(sdata, frame_buf, sizeof(frame_buf), true, @@ -212,7 +212,7 @@ Signed-off-by: Johannes Berg return 0; } -@@ -5840,7 +5873,7 @@ int ieee80211_mgd_deauth(struct ieee8021 +@@ -5845,7 +5878,7 @@ int ieee80211_mgd_deauth(struct ieee8021 req->reason_code, tx, frame_buf); ieee80211_report_disconnect(sdata, frame_buf, sizeof(frame_buf), true, @@ -221,7 +221,7 @@ Signed-off-by: Johannes Berg return 0; } -@@ -5873,7 +5906,7 @@ int ieee80211_mgd_disassoc(struct ieee80 +@@ -5878,7 +5911,7 @@ int ieee80211_mgd_disassoc(struct ieee80 frame_buf); ieee80211_report_disconnect(sdata, frame_buf, sizeof(frame_buf), true, diff --git a/package/kernel/mac80211/patches/subsys/311-net-fq_impl-drop-get_default_func-move-default-flow-.patch b/package/kernel/mac80211/patches/subsys/311-net-fq_impl-drop-get_default_func-move-default-flow-.patch index f8748ef123..33dbb5eb90 100644 --- a/package/kernel/mac80211/patches/subsys/311-net-fq_impl-drop-get_default_func-move-default-flow-.patch +++ b/package/kernel/mac80211/patches/subsys/311-net-fq_impl-drop-get_default_func-move-default-flow-.patch @@ -68,7 +68,7 @@ Signed-off-by: Felix Fietkau static int fq_init(struct fq *fq, int flows_cnt) --- a/net/mac80211/ieee80211_i.h +++ b/net/mac80211/ieee80211_i.h -@@ -857,7 +857,6 @@ enum txq_info_flags { +@@ -846,7 +846,6 @@ enum txq_info_flags { */ struct txq_info { struct fq_tin tin; diff --git a/package/kernel/mac80211/patches/subsys/315-mac80211-add-rx-decapsulation-offload-support.patch b/package/kernel/mac80211/patches/subsys/315-mac80211-add-rx-decapsulation-offload-support.patch index 09407f3b1d..b8bb2930f5 100644 --- a/package/kernel/mac80211/patches/subsys/315-mac80211-add-rx-decapsulation-offload-support.patch +++ b/package/kernel/mac80211/patches/subsys/315-mac80211-add-rx-decapsulation-offload-support.patch @@ -132,7 +132,7 @@ Signed-off-by: Felix Fietkau #endif /* __MAC80211_DRIVER_OPS */ --- a/net/mac80211/iface.c +++ b/net/mac80211/iface.c -@@ -839,7 +839,7 @@ static const struct net_device_ops ieee8 +@@ -835,7 +835,7 @@ static const struct net_device_ops ieee8 }; @@ -141,7 +141,7 @@ Signed-off-by: Felix Fietkau { switch (iftype) { /* P2P GO and client are mapped to AP/STATION types */ -@@ -859,7 +859,7 @@ static bool ieee80211_set_sdata_offload_ +@@ -855,7 +855,7 @@ static bool ieee80211_set_sdata_offload_ flags = sdata->vif.offload_flags; if (ieee80211_hw_check(&local->hw, SUPPORTS_TX_ENCAP_OFFLOAD) && @@ -150,7 +150,7 @@ Signed-off-by: Felix Fietkau flags |= IEEE80211_OFFLOAD_ENCAP_ENABLED; if (!ieee80211_hw_check(&local->hw, SUPPORTS_TX_FRAG) && -@@ -872,10 +872,21 @@ static bool ieee80211_set_sdata_offload_ +@@ -868,10 +868,21 @@ static bool ieee80211_set_sdata_offload_ flags &= ~IEEE80211_OFFLOAD_ENCAP_ENABLED; } @@ -172,7 +172,7 @@ Signed-off-by: Felix Fietkau return true; } -@@ -893,7 +904,7 @@ static void ieee80211_set_vif_encap_ops( +@@ -889,7 +900,7 @@ static void ieee80211_set_vif_encap_ops( } if (!ieee80211_hw_check(&local->hw, SUPPORTS_TX_ENCAP_OFFLOAD) || @@ -183,7 +183,7 @@ Signed-off-by: Felix Fietkau enabled = bss->vif.offload_flags & IEEE80211_OFFLOAD_ENCAP_ENABLED; --- a/net/mac80211/rx.c +++ b/net/mac80211/rx.c -@@ -4114,7 +4114,9 @@ void ieee80211_check_fast_rx(struct sta_ +@@ -4198,7 +4198,9 @@ void ieee80211_check_fast_rx(struct sta_ .vif_type = sdata->vif.type, .control_port_protocol = sdata->control_port_protocol, }, *old, *new = NULL; @@ -193,7 +193,7 @@ Signed-off-by: Felix Fietkau /* use sparse to check that we don't return without updating */ __acquire(check_fast_rx); -@@ -4227,6 +4229,17 @@ void ieee80211_check_fast_rx(struct sta_ +@@ -4311,6 +4313,17 @@ void ieee80211_check_fast_rx(struct sta_ if (assign) new = kmemdup(&fastrx, sizeof(fastrx), GFP_KERNEL); @@ -211,7 +211,7 @@ Signed-off-by: Felix Fietkau spin_lock_bh(&sta->lock); old = rcu_dereference_protected(sta->fast_rx, true); rcu_assign_pointer(sta->fast_rx, new); -@@ -4273,6 +4286,108 @@ void ieee80211_check_fast_rx_iface(struc +@@ -4357,6 +4370,108 @@ void ieee80211_check_fast_rx_iface(struc mutex_unlock(&local->sta_mtx); } @@ -320,7 +320,7 @@ Signed-off-by: Felix Fietkau static bool ieee80211_invoke_fast_rx(struct ieee80211_rx_data *rx, struct ieee80211_fast_rx *fast_rx) { -@@ -4293,9 +4408,6 @@ static bool ieee80211_invoke_fast_rx(str +@@ -4377,9 +4492,6 @@ static bool ieee80211_invoke_fast_rx(str } addrs __aligned(2); struct ieee80211_sta_rx_stats *stats = &sta->rx_stats; @@ -330,7 +330,7 @@ Signed-off-by: Felix Fietkau /* for parallel-rx, we need to have DUP_VALIDATED, otherwise we write * to a common data structure; drivers can implement that per queue * but we don't have that information in mac80211 -@@ -4369,32 +4481,6 @@ static bool ieee80211_invoke_fast_rx(str +@@ -4453,32 +4565,6 @@ static bool ieee80211_invoke_fast_rx(str pskb_trim(skb, skb->len - fast_rx->icv_len)) goto drop; @@ -363,7 +363,7 @@ Signed-off-by: Felix Fietkau if (rx->key && !ieee80211_has_protected(hdr->frame_control)) goto drop; -@@ -4406,12 +4492,6 @@ static bool ieee80211_invoke_fast_rx(str +@@ -4490,12 +4576,6 @@ static bool ieee80211_invoke_fast_rx(str return true; } @@ -376,7 +376,7 @@ Signed-off-by: Felix Fietkau /* do the header conversion - first grab the addresses */ ether_addr_copy(addrs.da, skb->data + fast_rx->da_offs); ether_addr_copy(addrs.sa, skb->data + fast_rx->sa_offs); -@@ -4420,62 +4500,14 @@ static bool ieee80211_invoke_fast_rx(str +@@ -4504,62 +4584,14 @@ static bool ieee80211_invoke_fast_rx(str /* push the addresses in front */ memcpy(skb_push(skb, sizeof(addrs)), &addrs, sizeof(addrs)); @@ -443,7 +443,7 @@ Signed-off-by: Felix Fietkau stats->dropped++; return true; } -@@ -4529,6 +4561,47 @@ static bool ieee80211_prepare_and_rx_han +@@ -4613,6 +4645,47 @@ static bool ieee80211_prepare_and_rx_han return true; } @@ -491,7 +491,7 @@ Signed-off-by: Felix Fietkau /* * This is the actual Rx frames handler. as it belongs to Rx path it must * be called with rcu_read_lock protection. -@@ -4766,15 +4839,20 @@ void ieee80211_rx_list(struct ieee80211_ +@@ -4850,15 +4923,20 @@ void ieee80211_rx_list(struct ieee80211_ * if it was previously present. * Also, frames with less than 16 bytes are dropped. */ diff --git a/package/kernel/mac80211/patches/subsys/373-mac80211-support-Rx-timestamp-calculation-for-all-pr.patch b/package/kernel/mac80211/patches/subsys/373-mac80211-support-Rx-timestamp-calculation-for-all-pr.patch index c432d77b2e..117fb35fcf 100644 --- a/package/kernel/mac80211/patches/subsys/373-mac80211-support-Rx-timestamp-calculation-for-all-pr.patch +++ b/package/kernel/mac80211/patches/subsys/373-mac80211-support-Rx-timestamp-calculation-for-all-pr.patch @@ -15,7 +15,7 @@ Signed-off-by: Johannes Berg --- a/net/mac80211/ieee80211_i.h +++ b/net/mac80211/ieee80211_i.h -@@ -1600,13 +1600,8 @@ ieee80211_have_rx_timestamp(struct ieee8 +@@ -1587,13 +1587,8 @@ ieee80211_have_rx_timestamp(struct ieee8 { WARN_ON_ONCE(status->flag & RX_FLAG_MACTIME_START && status->flag & RX_FLAG_MACTIME_END); diff --git a/package/kernel/mac80211/patches/subsys/380-mac80211-assure-all-fragments-are-encrypted.patch b/package/kernel/mac80211/patches/subsys/380-mac80211-assure-all-fragments-are-encrypted.patch deleted file mode 100644 index 69398459f1..0000000000 --- a/package/kernel/mac80211/patches/subsys/380-mac80211-assure-all-fragments-are-encrypted.patch +++ /dev/null @@ -1,69 +0,0 @@ -From: Mathy Vanhoef -Date: Tue, 11 May 2021 20:02:42 +0200 -Subject: [PATCH] mac80211: assure all fragments are encrypted - -Do not mix plaintext and encrypted fragments in protected Wi-Fi -networks. This fixes CVE-2020-26147. - -Previously, an attacker was able to first forward a legitimate encrypted -fragment towards a victim, followed by a plaintext fragment. The -encrypted and plaintext fragment would then be reassembled. For further -details see Section 6.3 and Appendix D in the paper "Fragment and Forge: -Breaking Wi-Fi Through Frame Aggregation and Fragmentation". - -Because of this change there are now two equivalent conditions in the -code to determine if a received fragment requires sequential PNs, so we -also move this test to a separate function to make the code easier to -maintain. - -Cc: stable@vger.kernel.org -Signed-off-by: Mathy Vanhoef -Signed-off-by: Johannes Berg ---- - ---- a/net/mac80211/rx.c -+++ b/net/mac80211/rx.c -@@ -2204,6 +2204,16 @@ ieee80211_reassemble_find(struct ieee802 - return NULL; - } - -+static bool requires_sequential_pn(struct ieee80211_rx_data *rx, __le16 fc) -+{ -+ return rx->key && -+ (rx->key->conf.cipher == WLAN_CIPHER_SUITE_CCMP || -+ rx->key->conf.cipher == WLAN_CIPHER_SUITE_CCMP_256 || -+ rx->key->conf.cipher == WLAN_CIPHER_SUITE_GCMP || -+ rx->key->conf.cipher == WLAN_CIPHER_SUITE_GCMP_256) && -+ ieee80211_has_protected(fc); -+} -+ - static ieee80211_rx_result debug_noinline - ieee80211_rx_h_defragment(struct ieee80211_rx_data *rx) - { -@@ -2248,12 +2258,7 @@ ieee80211_rx_h_defragment(struct ieee802 - /* This is the first fragment of a new frame. */ - entry = ieee80211_reassemble_add(rx->sdata, frag, seq, - rx->seqno_idx, &(rx->skb)); -- if (rx->key && -- (rx->key->conf.cipher == WLAN_CIPHER_SUITE_CCMP || -- rx->key->conf.cipher == WLAN_CIPHER_SUITE_CCMP_256 || -- rx->key->conf.cipher == WLAN_CIPHER_SUITE_GCMP || -- rx->key->conf.cipher == WLAN_CIPHER_SUITE_GCMP_256) && -- ieee80211_has_protected(fc)) { -+ if (requires_sequential_pn(rx, fc)) { - int queue = rx->security_idx; - - /* Store CCMP/GCMP PN so that we can verify that the -@@ -2295,11 +2300,7 @@ ieee80211_rx_h_defragment(struct ieee802 - u8 pn[IEEE80211_CCMP_PN_LEN], *rpn; - int queue; - -- if (!rx->key || -- (rx->key->conf.cipher != WLAN_CIPHER_SUITE_CCMP && -- rx->key->conf.cipher != WLAN_CIPHER_SUITE_CCMP_256 && -- rx->key->conf.cipher != WLAN_CIPHER_SUITE_GCMP && -- rx->key->conf.cipher != WLAN_CIPHER_SUITE_GCMP_256)) -+ if (!requires_sequential_pn(rx, fc)) - return RX_DROP_UNUSABLE; - memcpy(pn, entry->last_pn, IEEE80211_CCMP_PN_LEN); - for (i = IEEE80211_CCMP_PN_LEN - 1; i >= 0; i--) { diff --git a/package/kernel/mac80211/patches/subsys/381-mac80211-prevent-mixed-key-and-fragment-cache-attack.patch b/package/kernel/mac80211/patches/subsys/381-mac80211-prevent-mixed-key-and-fragment-cache-attack.patch deleted file mode 100644 index de0f89a5b0..0000000000 --- a/package/kernel/mac80211/patches/subsys/381-mac80211-prevent-mixed-key-and-fragment-cache-attack.patch +++ /dev/null @@ -1,87 +0,0 @@ -From: Mathy Vanhoef -Date: Tue, 11 May 2021 20:02:43 +0200 -Subject: [PATCH] mac80211: prevent mixed key and fragment cache attacks - -Simultaneously prevent mixed key attacks (CVE-2020-24587) and fragment -cache attacks (CVE-2020-24586). This is accomplished by assigning a -unique color to every key (per interface) and using this to track which -key was used to decrypt a fragment. When reassembling frames, it is -now checked whether all fragments were decrypted using the same key. - -To assure that fragment cache attacks are also prevented, the ID that is -assigned to keys is unique even over (re)associations and (re)connects. -This means fragments separated by a (re)association or (re)connect will -not be reassembled. Because mac80211 now also prevents the reassembly of -mixed encrypted and plaintext fragments, all cache attacks are prevented. - -Cc: stable@vger.kernel.org -Signed-off-by: Mathy Vanhoef -Signed-off-by: Johannes Berg ---- - ---- a/net/mac80211/ieee80211_i.h -+++ b/net/mac80211/ieee80211_i.h -@@ -97,6 +97,7 @@ struct ieee80211_fragment_entry { - u8 rx_queue; - bool check_sequential_pn; /* needed for CCMP/GCMP */ - u8 last_pn[6]; /* PN of the last fragment if CCMP was used */ -+ unsigned int key_color; - }; - - ---- a/net/mac80211/key.c -+++ b/net/mac80211/key.c -@@ -799,6 +799,7 @@ int ieee80211_key_link(struct ieee80211_ - struct ieee80211_sub_if_data *sdata, - struct sta_info *sta) - { -+ static atomic_t key_color = ATOMIC_INIT(0); - struct ieee80211_key *old_key; - int idx = key->conf.keyidx; - bool pairwise = key->conf.flags & IEEE80211_KEY_FLAG_PAIRWISE; -@@ -850,6 +851,12 @@ int ieee80211_key_link(struct ieee80211_ - key->sdata = sdata; - key->sta = sta; - -+ /* -+ * Assign a unique ID to every key so we can easily prevent mixed -+ * key and fragment cache attacks. -+ */ -+ key->color = atomic_inc_return(&key_color); -+ - increment_tailroom_need_count(sdata); - - ret = ieee80211_key_replace(sdata, sta, pairwise, old_key, key); ---- a/net/mac80211/key.h -+++ b/net/mac80211/key.h -@@ -128,6 +128,8 @@ struct ieee80211_key { - } debugfs; - #endif - -+ unsigned int color; -+ - /* - * key config, must be last because it contains key - * material as variable length member ---- a/net/mac80211/rx.c -+++ b/net/mac80211/rx.c -@@ -2265,6 +2265,7 @@ ieee80211_rx_h_defragment(struct ieee802 - * next fragment has a sequential PN value. - */ - entry->check_sequential_pn = true; -+ entry->key_color = rx->key->color; - memcpy(entry->last_pn, - rx->key->u.ccmp.rx_pn[queue], - IEEE80211_CCMP_PN_LEN); -@@ -2302,6 +2303,11 @@ ieee80211_rx_h_defragment(struct ieee802 - - if (!requires_sequential_pn(rx, fc)) - return RX_DROP_UNUSABLE; -+ -+ /* Prevent mixed key and fragment cache attacks */ -+ if (entry->key_color != rx->key->color) -+ return RX_DROP_UNUSABLE; -+ - memcpy(pn, entry->last_pn, IEEE80211_CCMP_PN_LEN); - for (i = IEEE80211_CCMP_PN_LEN - 1; i >= 0; i--) { - pn[i]++; diff --git a/package/kernel/mac80211/patches/subsys/382-mac80211-properly-handle-A-MSDUs-that-start-with-an-.patch b/package/kernel/mac80211/patches/subsys/382-mac80211-properly-handle-A-MSDUs-that-start-with-an-.patch deleted file mode 100644 index d59fa05091..0000000000 --- a/package/kernel/mac80211/patches/subsys/382-mac80211-properly-handle-A-MSDUs-that-start-with-an-.patch +++ /dev/null @@ -1,66 +0,0 @@ -From: Mathy Vanhoef -Date: Tue, 11 May 2021 20:02:44 +0200 -Subject: [PATCH] mac80211: properly handle A-MSDUs that start with an - RFC 1042 header - -Properly parse A-MSDUs whose first 6 bytes happen to equal a rfc1042 -header. This can occur in practice when the destination MAC address -equals AA:AA:03:00:00:00. More importantly, this simplifies the next -patch to mitigate A-MSDU injection attacks. - -Cc: stable@vger.kernel.org -Signed-off-by: Mathy Vanhoef -Signed-off-by: Johannes Berg ---- - ---- a/include/net/cfg80211.h -+++ b/include/net/cfg80211.h -@@ -5637,7 +5637,7 @@ unsigned int ieee80211_get_mesh_hdrlen(s - */ - int ieee80211_data_to_8023_exthdr(struct sk_buff *skb, struct ethhdr *ehdr, - const u8 *addr, enum nl80211_iftype iftype, -- u8 data_offset); -+ u8 data_offset, bool is_amsdu); - - /** - * ieee80211_data_to_8023 - convert an 802.11 data frame to 802.3 -@@ -5649,7 +5649,7 @@ int ieee80211_data_to_8023_exthdr(struct - static inline int ieee80211_data_to_8023(struct sk_buff *skb, const u8 *addr, - enum nl80211_iftype iftype) - { -- return ieee80211_data_to_8023_exthdr(skb, NULL, addr, iftype, 0); -+ return ieee80211_data_to_8023_exthdr(skb, NULL, addr, iftype, 0, false); - } - - /** ---- a/net/mac80211/rx.c -+++ b/net/mac80211/rx.c -@@ -2696,7 +2696,7 @@ __ieee80211_rx_h_amsdu(struct ieee80211_ - if (ieee80211_data_to_8023_exthdr(skb, ðhdr, - rx->sdata->vif.addr, - rx->sdata->vif.type, -- data_offset)) -+ data_offset, true)) - return RX_DROP_UNUSABLE; - - ieee80211_amsdu_to_8023s(skb, &frame_list, dev->dev_addr, ---- a/net/wireless/util.c -+++ b/net/wireless/util.c -@@ -541,7 +541,7 @@ EXPORT_SYMBOL(ieee80211_get_mesh_hdrlen) - - int ieee80211_data_to_8023_exthdr(struct sk_buff *skb, struct ethhdr *ehdr, - const u8 *addr, enum nl80211_iftype iftype, -- u8 data_offset) -+ u8 data_offset, bool is_amsdu) - { - struct ieee80211_hdr *hdr = (struct ieee80211_hdr *) skb->data; - struct { -@@ -629,7 +629,7 @@ int ieee80211_data_to_8023_exthdr(struct - skb_copy_bits(skb, hdrlen, &payload, sizeof(payload)); - tmp.h_proto = payload.proto; - -- if (likely((ether_addr_equal(payload.hdr, rfc1042_header) && -+ if (likely((!is_amsdu && ether_addr_equal(payload.hdr, rfc1042_header) && - tmp.h_proto != htons(ETH_P_AARP) && - tmp.h_proto != htons(ETH_P_IPX)) || - ether_addr_equal(payload.hdr, bridge_tunnel_header))) diff --git a/package/kernel/mac80211/patches/subsys/383-cfg80211-mitigate-A-MSDU-aggregation-attacks.patch b/package/kernel/mac80211/patches/subsys/383-cfg80211-mitigate-A-MSDU-aggregation-attacks.patch deleted file mode 100644 index 8ea78dca84..0000000000 --- a/package/kernel/mac80211/patches/subsys/383-cfg80211-mitigate-A-MSDU-aggregation-attacks.patch +++ /dev/null @@ -1,40 +0,0 @@ -From: Mathy Vanhoef -Date: Tue, 11 May 2021 20:02:45 +0200 -Subject: [PATCH] cfg80211: mitigate A-MSDU aggregation attacks - -Mitigate A-MSDU injection attacks (CVE-2020-24588) by detecting if the -destination address of a subframe equals an RFC1042 (i.e., LLC/SNAP) -header, and if so dropping the complete A-MSDU frame. This mitigates -known attacks, although new (unknown) aggregation-based attacks may -remain possible. - -This defense works because in A-MSDU aggregation injection attacks, a -normal encrypted Wi-Fi frame is turned into an A-MSDU frame. This means -the first 6 bytes of the first A-MSDU subframe correspond to an RFC1042 -header. In other words, the destination MAC address of the first A-MSDU -subframe contains the start of an RFC1042 header during an aggregation -attack. We can detect this and thereby prevent this specific attack. -For details, see Section 7.2 of "Fragment and Forge: Breaking Wi-Fi -Through Frame Aggregation and Fragmentation". - -Note that for kernel 4.9 and above this patch depends on "mac80211: -properly handle A-MSDUs that start with a rfc1042 header". Otherwise -this patch has no impact and attacks will remain possible. - -Cc: stable@vger.kernel.org -Signed-off-by: Mathy Vanhoef -Signed-off-by: Johannes Berg ---- - ---- a/net/wireless/util.c -+++ b/net/wireless/util.c -@@ -775,6 +775,9 @@ void ieee80211_amsdu_to_8023s(struct sk_ - remaining = skb->len - offset; - if (subframe_len > remaining) - goto purge; -+ /* mitigate A-MSDU aggregation injection attacks */ -+ if (ether_addr_equal(eth.h_dest, rfc1042_header)) -+ goto purge; - - offset += sizeof(struct ethhdr); - last = remaining <= subframe_len + padding; diff --git a/package/kernel/mac80211/patches/subsys/384-mac80211-drop-A-MSDUs-on-old-ciphers.patch b/package/kernel/mac80211/patches/subsys/384-mac80211-drop-A-MSDUs-on-old-ciphers.patch deleted file mode 100644 index 1b5084c37d..0000000000 --- a/package/kernel/mac80211/patches/subsys/384-mac80211-drop-A-MSDUs-on-old-ciphers.patch +++ /dev/null @@ -1,54 +0,0 @@ -From: Johannes Berg -Date: Tue, 11 May 2021 20:02:46 +0200 -Subject: [PATCH] mac80211: drop A-MSDUs on old ciphers - -With old ciphers (WEP and TKIP) we shouldn't be using A-MSDUs -since A-MSDUs are only supported if we know that they are, and -the only practical way for that is HT support which doesn't -support old ciphers. - -However, we would normally accept them anyway. Since we check -the MMIC before deaggregating A-MSDUs, and the A-MSDU bit in -the QoS header is not protected in TKIP (or WEP), this enables -attacks similar to CVE-2020-24588. To prevent that, drop A-MSDUs -completely with old ciphers. - -Cc: stable@vger.kernel.org -Signed-off-by: Johannes Berg ---- - ---- a/net/mac80211/rx.c -+++ b/net/mac80211/rx.c -@@ -6,7 +6,7 @@ - * Copyright 2007-2010 Johannes Berg - * Copyright 2013-2014 Intel Mobile Communications GmbH - * Copyright(c) 2015 - 2017 Intel Deutschland GmbH -- * Copyright (C) 2018-2020 Intel Corporation -+ * Copyright (C) 2018-2021 Intel Corporation - */ - - #include -@@ -2753,6 +2753,23 @@ ieee80211_rx_h_amsdu(struct ieee80211_rx - if (is_multicast_ether_addr(hdr->addr1)) - return RX_DROP_UNUSABLE; - -+ if (rx->key) { -+ /* -+ * We should not receive A-MSDUs on pre-HT connections, -+ * and HT connections cannot use old ciphers. Thus drop -+ * them, as in those cases we couldn't even have SPP -+ * A-MSDUs or such. -+ */ -+ switch (rx->key->conf.cipher) { -+ case WLAN_CIPHER_SUITE_WEP40: -+ case WLAN_CIPHER_SUITE_WEP104: -+ case WLAN_CIPHER_SUITE_TKIP: -+ return RX_DROP_UNUSABLE; -+ default: -+ break; -+ } -+ } -+ - return __ieee80211_rx_h_amsdu(rx, 0); - } - diff --git a/package/kernel/mac80211/patches/subsys/385-mac80211-add-fragment-cache-to-sta_info.patch b/package/kernel/mac80211/patches/subsys/385-mac80211-add-fragment-cache-to-sta_info.patch deleted file mode 100644 index b536126d38..0000000000 --- a/package/kernel/mac80211/patches/subsys/385-mac80211-add-fragment-cache-to-sta_info.patch +++ /dev/null @@ -1,313 +0,0 @@ -From: Johannes Berg -Date: Tue, 11 May 2021 20:02:47 +0200 -Subject: [PATCH] mac80211: add fragment cache to sta_info - -Prior patches protected against fragmentation cache attacks -by coloring keys, but this shows that it can lead to issues -when multiple stations use the same sequence number. Add a -fragment cache to struct sta_info (in addition to the one in -the interface) to separate fragments for different stations -properly. - -This then automatically clear most of the fragment cache when a -station disconnects (or reassociates) from an AP, or when client -interfaces disconnect from the network, etc. - -On the way, also fix the comment there since this brings us in line -with the recommendation in 802.11-2016 ("An AP should support ..."). -Additionally, remove a useless condition (since there's no problem -purging an already empty list). - -Cc: stable@vger.kernel.org -Signed-off-by: Johannes Berg ---- - ---- a/net/mac80211/ieee80211_i.h -+++ b/net/mac80211/ieee80211_i.h -@@ -50,12 +50,6 @@ struct ieee80211_local; - #define IEEE80211_ENCRYPT_HEADROOM 8 - #define IEEE80211_ENCRYPT_TAILROOM 18 - --/* IEEE 802.11 (Ch. 9.5 Defragmentation) requires support for concurrent -- * reception of at least three fragmented frames. This limit can be increased -- * by changing this define, at the cost of slower frame reassembly and -- * increased memory use (about 2 kB of RAM per entry). */ --#define IEEE80211_FRAGMENT_MAX 4 -- - /* power level hasn't been configured (or set to automatic) */ - #define IEEE80211_UNSET_POWER_LEVEL INT_MIN - -@@ -88,19 +82,6 @@ extern const u8 ieee80211_ac_to_qos_mask - - #define IEEE80211_MAX_NAN_INSTANCE_ID 255 - --struct ieee80211_fragment_entry { -- struct sk_buff_head skb_list; -- unsigned long first_frag_time; -- u16 seq; -- u16 extra_len; -- u16 last_frag; -- u8 rx_queue; -- bool check_sequential_pn; /* needed for CCMP/GCMP */ -- u8 last_pn[6]; /* PN of the last fragment if CCMP was used */ -- unsigned int key_color; --}; -- -- - struct ieee80211_bss { - u32 device_ts_beacon, device_ts_presp; - -@@ -912,9 +893,7 @@ struct ieee80211_sub_if_data { - - char name[IFNAMSIZ]; - -- /* Fragment table for host-based reassembly */ -- struct ieee80211_fragment_entry fragments[IEEE80211_FRAGMENT_MAX]; -- unsigned int fragment_next; -+ struct ieee80211_fragment_cache frags; - - /* TID bitmap for NoAck policy */ - u16 noack_map; -@@ -2329,4 +2308,7 @@ u32 ieee80211_calc_expected_tx_airtime(s - #define debug_noinline - #endif - -+void ieee80211_init_frag_cache(struct ieee80211_fragment_cache *cache); -+void ieee80211_destroy_frag_cache(struct ieee80211_fragment_cache *cache); -+ - #endif /* IEEE80211_I_H */ ---- a/net/mac80211/iface.c -+++ b/net/mac80211/iface.c -@@ -8,7 +8,7 @@ - * Copyright 2008, Johannes Berg - * Copyright 2013-2014 Intel Mobile Communications GmbH - * Copyright (c) 2016 Intel Deutschland GmbH -- * Copyright (C) 2018-2020 Intel Corporation -+ * Copyright (C) 2018-2021 Intel Corporation - */ - #include - #include -@@ -679,16 +679,12 @@ static void ieee80211_set_multicast_list - */ - static void ieee80211_teardown_sdata(struct ieee80211_sub_if_data *sdata) - { -- int i; -- - /* free extra data */ - ieee80211_free_keys(sdata, false); - - ieee80211_debugfs_remove_netdev(sdata); - -- for (i = 0; i < IEEE80211_FRAGMENT_MAX; i++) -- __skb_queue_purge(&sdata->fragments[i].skb_list); -- sdata->fragment_next = 0; -+ ieee80211_destroy_frag_cache(&sdata->frags); - - if (ieee80211_vif_is_mesh(&sdata->vif)) - ieee80211_mesh_teardown_sdata(sdata); -@@ -2038,8 +2034,7 @@ int ieee80211_if_add(struct ieee80211_lo - sdata->wdev.wiphy = local->hw.wiphy; - sdata->local = local; - -- for (i = 0; i < IEEE80211_FRAGMENT_MAX; i++) -- skb_queue_head_init(&sdata->fragments[i].skb_list); -+ ieee80211_init_frag_cache(&sdata->frags); - - INIT_LIST_HEAD(&sdata->key_list); - ---- a/net/mac80211/rx.c -+++ b/net/mac80211/rx.c -@@ -2133,19 +2133,34 @@ ieee80211_rx_h_decrypt(struct ieee80211_ - return result; - } - -+void ieee80211_init_frag_cache(struct ieee80211_fragment_cache *cache) -+{ -+ int i; -+ -+ for (i = 0; i < ARRAY_SIZE(cache->entries); i++) -+ skb_queue_head_init(&cache->entries[i].skb_list); -+} -+ -+void ieee80211_destroy_frag_cache(struct ieee80211_fragment_cache *cache) -+{ -+ int i; -+ -+ for (i = 0; i < ARRAY_SIZE(cache->entries); i++) -+ __skb_queue_purge(&cache->entries[i].skb_list); -+} -+ - static inline struct ieee80211_fragment_entry * --ieee80211_reassemble_add(struct ieee80211_sub_if_data *sdata, -+ieee80211_reassemble_add(struct ieee80211_fragment_cache *cache, - unsigned int frag, unsigned int seq, int rx_queue, - struct sk_buff **skb) - { - struct ieee80211_fragment_entry *entry; - -- entry = &sdata->fragments[sdata->fragment_next++]; -- if (sdata->fragment_next >= IEEE80211_FRAGMENT_MAX) -- sdata->fragment_next = 0; -+ entry = &cache->entries[cache->next++]; -+ if (cache->next >= IEEE80211_FRAGMENT_MAX) -+ cache->next = 0; - -- if (!skb_queue_empty(&entry->skb_list)) -- __skb_queue_purge(&entry->skb_list); -+ __skb_queue_purge(&entry->skb_list); - - __skb_queue_tail(&entry->skb_list, *skb); /* no need for locking */ - *skb = NULL; -@@ -2160,14 +2175,14 @@ ieee80211_reassemble_add(struct ieee8021 - } - - static inline struct ieee80211_fragment_entry * --ieee80211_reassemble_find(struct ieee80211_sub_if_data *sdata, -+ieee80211_reassemble_find(struct ieee80211_fragment_cache *cache, - unsigned int frag, unsigned int seq, - int rx_queue, struct ieee80211_hdr *hdr) - { - struct ieee80211_fragment_entry *entry; - int i, idx; - -- idx = sdata->fragment_next; -+ idx = cache->next; - for (i = 0; i < IEEE80211_FRAGMENT_MAX; i++) { - struct ieee80211_hdr *f_hdr; - struct sk_buff *f_skb; -@@ -2176,7 +2191,7 @@ ieee80211_reassemble_find(struct ieee802 - if (idx < 0) - idx = IEEE80211_FRAGMENT_MAX - 1; - -- entry = &sdata->fragments[idx]; -+ entry = &cache->entries[idx]; - if (skb_queue_empty(&entry->skb_list) || entry->seq != seq || - entry->rx_queue != rx_queue || - entry->last_frag + 1 != frag) -@@ -2217,6 +2232,7 @@ static bool requires_sequential_pn(struc - static ieee80211_rx_result debug_noinline - ieee80211_rx_h_defragment(struct ieee80211_rx_data *rx) - { -+ struct ieee80211_fragment_cache *cache = &rx->sdata->frags; - struct ieee80211_hdr *hdr; - u16 sc; - __le16 fc; -@@ -2238,6 +2254,9 @@ ieee80211_rx_h_defragment(struct ieee802 - goto out_no_led; - } - -+ if (rx->sta) -+ cache = &rx->sta->frags; -+ - if (likely(!ieee80211_has_morefrags(fc) && frag == 0)) - goto out; - -@@ -2256,7 +2275,7 @@ ieee80211_rx_h_defragment(struct ieee802 - - if (frag == 0) { - /* This is the first fragment of a new frame. */ -- entry = ieee80211_reassemble_add(rx->sdata, frag, seq, -+ entry = ieee80211_reassemble_add(cache, frag, seq, - rx->seqno_idx, &(rx->skb)); - if (requires_sequential_pn(rx, fc)) { - int queue = rx->security_idx; -@@ -2284,7 +2303,7 @@ ieee80211_rx_h_defragment(struct ieee802 - /* This is a fragment for a frame that should already be pending in - * fragment cache. Add this fragment to the end of the pending entry. - */ -- entry = ieee80211_reassemble_find(rx->sdata, frag, seq, -+ entry = ieee80211_reassemble_find(cache, frag, seq, - rx->seqno_idx, hdr); - if (!entry) { - I802_DEBUG_INC(rx->local->rx_handlers_drop_defrag); ---- a/net/mac80211/sta_info.c -+++ b/net/mac80211/sta_info.c -@@ -4,7 +4,7 @@ - * Copyright 2006-2007 Jiri Benc - * Copyright 2013-2014 Intel Mobile Communications GmbH - * Copyright (C) 2015 - 2017 Intel Deutschland GmbH -- * Copyright (C) 2018-2020 Intel Corporation -+ * Copyright (C) 2018-2021 Intel Corporation - */ - - #include -@@ -393,6 +393,8 @@ struct sta_info *sta_info_alloc(struct i - - u64_stats_init(&sta->rx_stats.syncp); - -+ ieee80211_init_frag_cache(&sta->frags); -+ - sta->sta_state = IEEE80211_STA_NONE; - - /* Mark TID as unreserved */ -@@ -1103,6 +1105,8 @@ static void __sta_info_destroy_part2(str - - ieee80211_sta_debugfs_remove(sta); - -+ ieee80211_destroy_frag_cache(&sta->frags); -+ - cleanup_single_sta(sta); - } - ---- a/net/mac80211/sta_info.h -+++ b/net/mac80211/sta_info.h -@@ -3,7 +3,7 @@ - * Copyright 2002-2005, Devicescape Software, Inc. - * Copyright 2013-2014 Intel Mobile Communications GmbH - * Copyright(c) 2015-2017 Intel Deutschland GmbH -- * Copyright(c) 2020 Intel Corporation -+ * Copyright(c) 2020-2021 Intel Corporation - */ - - #ifndef STA_INFO_H -@@ -439,6 +439,33 @@ struct ieee80211_sta_rx_stats { - }; - - /* -+ * IEEE 802.11-2016 (10.6 "Defragmentation") recommends support for "concurrent -+ * reception of at least one MSDU per access category per associated STA" -+ * on APs, or "at least one MSDU per access category" on other interface types. -+ * -+ * This limit can be increased by changing this define, at the cost of slower -+ * frame reassembly and increased memory use while fragments are pending. -+ */ -+#define IEEE80211_FRAGMENT_MAX 4 -+ -+struct ieee80211_fragment_entry { -+ struct sk_buff_head skb_list; -+ unsigned long first_frag_time; -+ u16 seq; -+ u16 extra_len; -+ u16 last_frag; -+ u8 rx_queue; -+ bool check_sequential_pn; /* needed for CCMP/GCMP */ -+ u8 last_pn[6]; /* PN of the last fragment if CCMP was used */ -+ unsigned int key_color; -+}; -+ -+struct ieee80211_fragment_cache { -+ struct ieee80211_fragment_entry entries[IEEE80211_FRAGMENT_MAX]; -+ unsigned int next; -+}; -+ -+/* - * The bandwidth threshold below which the per-station CoDel parameters will be - * scaled to be more lenient (to prevent starvation of slow stations). This - * value will be scaled by the number of active stations when it is being -@@ -531,6 +558,7 @@ struct ieee80211_sta_rx_stats { - * @status_stats.last_ack_signal: last ACK signal - * @status_stats.ack_signal_filled: last ACK signal validity - * @status_stats.avg_ack_signal: average ACK signal -+ * @frags: fragment cache - */ - struct sta_info { - /* General information, mostly static */ -@@ -639,6 +667,8 @@ struct sta_info { - - struct cfg80211_chan_def tdls_chandef; - -+ struct ieee80211_fragment_cache frags; -+ - /* keep last! */ - struct ieee80211_sta sta; - }; diff --git a/package/kernel/mac80211/patches/subsys/386-mac80211-check-defrag-PN-against-current-frame.patch b/package/kernel/mac80211/patches/subsys/386-mac80211-check-defrag-PN-against-current-frame.patch deleted file mode 100644 index fb2747a609..0000000000 --- a/package/kernel/mac80211/patches/subsys/386-mac80211-check-defrag-PN-against-current-frame.patch +++ /dev/null @@ -1,109 +0,0 @@ -From: Johannes Berg -Date: Tue, 11 May 2021 20:02:48 +0200 -Subject: [PATCH] mac80211: check defrag PN against current frame - -As pointed out by Mathy Vanhoef, we implement the RX PN check -on fragmented frames incorrectly - we check against the last -received PN prior to the new frame, rather than to the one in -this frame itself. - -Prior patches addressed the security issue here, but in order -to be able to reason better about the code, fix it to really -compare against the current frame's PN, not the last stored -one. - -Cc: stable@vger.kernel.org -Signed-off-by: Johannes Berg ---- - ---- a/net/mac80211/ieee80211_i.h -+++ b/net/mac80211/ieee80211_i.h -@@ -227,8 +227,15 @@ struct ieee80211_rx_data { - */ - int security_idx; - -- u32 tkip_iv32; -- u16 tkip_iv16; -+ union { -+ struct { -+ u32 iv32; -+ u16 iv16; -+ } tkip; -+ struct { -+ u8 pn[IEEE80211_CCMP_PN_LEN]; -+ } ccm_gcm; -+ }; - }; - - struct ieee80211_csa_settings { ---- a/net/mac80211/rx.c -+++ b/net/mac80211/rx.c -@@ -2318,7 +2318,6 @@ ieee80211_rx_h_defragment(struct ieee802 - if (entry->check_sequential_pn) { - int i; - u8 pn[IEEE80211_CCMP_PN_LEN], *rpn; -- int queue; - - if (!requires_sequential_pn(rx, fc)) - return RX_DROP_UNUSABLE; -@@ -2333,8 +2332,8 @@ ieee80211_rx_h_defragment(struct ieee802 - if (pn[i]) - break; - } -- queue = rx->security_idx; -- rpn = rx->key->u.ccmp.rx_pn[queue]; -+ -+ rpn = rx->ccm_gcm.pn; - if (memcmp(pn, rpn, IEEE80211_CCMP_PN_LEN)) - return RX_DROP_UNUSABLE; - memcpy(entry->last_pn, pn, IEEE80211_CCMP_PN_LEN); ---- a/net/mac80211/wpa.c -+++ b/net/mac80211/wpa.c -@@ -3,6 +3,7 @@ - * Copyright 2002-2004, Instant802 Networks, Inc. - * Copyright 2008, Jouni Malinen - * Copyright (C) 2016-2017 Intel Deutschland GmbH -+ * Copyright (C) 2020-2021 Intel Corporation - */ - - #include -@@ -167,8 +168,8 @@ ieee80211_rx_h_michael_mic_verify(struct - - update_iv: - /* update IV in key information to be able to detect replays */ -- rx->key->u.tkip.rx[rx->security_idx].iv32 = rx->tkip_iv32; -- rx->key->u.tkip.rx[rx->security_idx].iv16 = rx->tkip_iv16; -+ rx->key->u.tkip.rx[rx->security_idx].iv32 = rx->tkip.iv32; -+ rx->key->u.tkip.rx[rx->security_idx].iv16 = rx->tkip.iv16; - - return RX_CONTINUE; - -@@ -294,8 +295,8 @@ ieee80211_crypto_tkip_decrypt(struct iee - key, skb->data + hdrlen, - skb->len - hdrlen, rx->sta->sta.addr, - hdr->addr1, hwaccel, rx->security_idx, -- &rx->tkip_iv32, -- &rx->tkip_iv16); -+ &rx->tkip.iv32, -+ &rx->tkip.iv16); - if (res != TKIP_DECRYPT_OK) - return RX_DROP_UNUSABLE; - -@@ -552,6 +553,8 @@ ieee80211_crypto_ccmp_decrypt(struct iee - } - - memcpy(key->u.ccmp.rx_pn[queue], pn, IEEE80211_CCMP_PN_LEN); -+ if (unlikely(ieee80211_is_frag(hdr))) -+ memcpy(rx->ccm_gcm.pn, pn, IEEE80211_CCMP_PN_LEN); - } - - /* Remove CCMP header and MIC */ -@@ -782,6 +785,8 @@ ieee80211_crypto_gcmp_decrypt(struct iee - } - - memcpy(key->u.gcmp.rx_pn[queue], pn, IEEE80211_GCMP_PN_LEN); -+ if (unlikely(ieee80211_is_frag(hdr))) -+ memcpy(rx->ccm_gcm.pn, pn, IEEE80211_CCMP_PN_LEN); - } - - /* Remove GCMP header and MIC */ diff --git a/package/kernel/mac80211/patches/subsys/387-mac80211-prevent-attacks-on-TKIP-WEP-as-well.patch b/package/kernel/mac80211/patches/subsys/387-mac80211-prevent-attacks-on-TKIP-WEP-as-well.patch deleted file mode 100644 index bc582a6cc2..0000000000 --- a/package/kernel/mac80211/patches/subsys/387-mac80211-prevent-attacks-on-TKIP-WEP-as-well.patch +++ /dev/null @@ -1,62 +0,0 @@ -From: Johannes Berg -Date: Tue, 11 May 2021 20:02:49 +0200 -Subject: [PATCH] mac80211: prevent attacks on TKIP/WEP as well - -Similar to the issues fixed in previous patches, TKIP and WEP -should be protected even if for TKIP we have the Michael MIC -protecting it, and WEP is broken anyway. - -However, this also somewhat protects potential other algorithms -that drivers might implement. - -Cc: stable@vger.kernel.org -Signed-off-by: Johannes Berg ---- - ---- a/net/mac80211/rx.c -+++ b/net/mac80211/rx.c -@@ -2284,6 +2284,7 @@ ieee80211_rx_h_defragment(struct ieee802 - * next fragment has a sequential PN value. - */ - entry->check_sequential_pn = true; -+ entry->is_protected = true; - entry->key_color = rx->key->color; - memcpy(entry->last_pn, - rx->key->u.ccmp.rx_pn[queue], -@@ -2296,6 +2297,9 @@ ieee80211_rx_h_defragment(struct ieee802 - sizeof(rx->key->u.gcmp.rx_pn[queue])); - BUILD_BUG_ON(IEEE80211_CCMP_PN_LEN != - IEEE80211_GCMP_PN_LEN); -+ } else if (rx->key && ieee80211_has_protected(fc)) { -+ entry->is_protected = true; -+ entry->key_color = rx->key->color; - } - return RX_QUEUED; - } -@@ -2337,6 +2341,14 @@ ieee80211_rx_h_defragment(struct ieee802 - if (memcmp(pn, rpn, IEEE80211_CCMP_PN_LEN)) - return RX_DROP_UNUSABLE; - memcpy(entry->last_pn, pn, IEEE80211_CCMP_PN_LEN); -+ } else if (entry->is_protected && -+ (!rx->key || !ieee80211_has_protected(fc) || -+ rx->key->color != entry->key_color)) { -+ /* Drop this as a mixed key or fragment cache attack, even -+ * if for TKIP Michael MIC should protect us, and WEP is a -+ * lost cause anyway. -+ */ -+ return RX_DROP_UNUSABLE; - } - - skb_pull(rx->skb, ieee80211_hdrlen(fc)); ---- a/net/mac80211/sta_info.h -+++ b/net/mac80211/sta_info.h -@@ -455,7 +455,8 @@ struct ieee80211_fragment_entry { - u16 extra_len; - u16 last_frag; - u8 rx_queue; -- bool check_sequential_pn; /* needed for CCMP/GCMP */ -+ u8 check_sequential_pn:1, /* needed for CCMP/GCMP */ -+ is_protected:1; - u8 last_pn[6]; /* PN of the last fragment if CCMP was used */ - unsigned int key_color; - }; diff --git a/package/kernel/mac80211/patches/subsys/388-mac80211-do-not-accept-forward-invalid-EAPOL-frames.patch b/package/kernel/mac80211/patches/subsys/388-mac80211-do-not-accept-forward-invalid-EAPOL-frames.patch deleted file mode 100644 index 9a0b78def1..0000000000 --- a/package/kernel/mac80211/patches/subsys/388-mac80211-do-not-accept-forward-invalid-EAPOL-frames.patch +++ /dev/null @@ -1,94 +0,0 @@ -From: Johannes Berg -Date: Tue, 11 May 2021 20:02:50 +0200 -Subject: [PATCH] mac80211: do not accept/forward invalid EAPOL frames - -EAPOL frames are used for authentication and key management between the -AP and each individual STA associated in the BSS. Those frames are not -supposed to be sent by one associated STA to another associated STA -(either unicast for broadcast/multicast). - -Similarly, in 802.11 they're supposed to be sent to the authenticator -(AP) address. - -Since it is possible for unexpected EAPOL frames to result in misbehavior -in supplicant implementations, it is better for the AP to not allow such -cases to be forwarded to other clients either directly, or indirectly if -the AP interface is part of a bridge. - -Accept EAPOL (control port) frames only if they're transmitted to the -own address, or, due to interoperability concerns, to the PAE group -address. - -Disable forwarding of EAPOL (or well, the configured control port -protocol) frames back to wireless medium in all cases. Previously, these -frames were accepted from fully authenticated and authorized stations -and also from unauthenticated stations for one of the cases. - -Additionally, to avoid forwarding by the bridge, rewrite the PAE group -address case to the local MAC address. - -Cc: stable@vger.kernel.org -Co-developed-by: Jouni Malinen -Signed-off-by: Jouni Malinen -Signed-off-by: Johannes Berg ---- - ---- a/net/mac80211/rx.c -+++ b/net/mac80211/rx.c -@@ -2541,13 +2541,13 @@ static bool ieee80211_frame_allowed(stru - struct ethhdr *ehdr = (struct ethhdr *) rx->skb->data; - - /* -- * Allow EAPOL frames to us/the PAE group address regardless -- * of whether the frame was encrypted or not. -+ * Allow EAPOL frames to us/the PAE group address regardless of -+ * whether the frame was encrypted or not, and always disallow -+ * all other destination addresses for them. - */ -- if (ehdr->h_proto == rx->sdata->control_port_protocol && -- (ether_addr_equal(ehdr->h_dest, rx->sdata->vif.addr) || -- ether_addr_equal(ehdr->h_dest, pae_group_addr))) -- return true; -+ if (unlikely(ehdr->h_proto == rx->sdata->control_port_protocol)) -+ return ether_addr_equal(ehdr->h_dest, rx->sdata->vif.addr) || -+ ether_addr_equal(ehdr->h_dest, pae_group_addr); - - if (ieee80211_802_1x_port_control(rx) || - ieee80211_drop_unencrypted(rx, fc)) -@@ -2572,8 +2572,28 @@ static void ieee80211_deliver_skb_to_loc - cfg80211_rx_control_port(dev, skb, noencrypt); - dev_kfree_skb(skb); - } else { -+ struct ethhdr *ehdr = (void *)skb_mac_header(skb); -+ - memset(skb->cb, 0, sizeof(skb->cb)); - -+ /* -+ * 802.1X over 802.11 requires that the authenticator address -+ * be used for EAPOL frames. However, 802.1X allows the use of -+ * the PAE group address instead. If the interface is part of -+ * a bridge and we pass the frame with the PAE group address, -+ * then the bridge will forward it to the network (even if the -+ * client was not associated yet), which isn't supposed to -+ * happen. -+ * To avoid that, rewrite the destination address to our own -+ * address, so that the authenticator (e.g. hostapd) will see -+ * the frame, but bridge won't forward it anywhere else. Note -+ * that due to earlier filtering, the only other address can -+ * be the PAE group address. -+ */ -+ if (unlikely(skb->protocol == sdata->control_port_protocol && -+ !ether_addr_equal(ehdr->h_dest, sdata->vif.addr))) -+ ether_addr_copy(ehdr->h_dest, sdata->vif.addr); -+ - /* deliver to local stack */ - if (rx->list) - #if LINUX_VERSION_IS_GEQ(4,19,0) -@@ -2617,6 +2637,7 @@ ieee80211_deliver_skb(struct ieee80211_r - if ((sdata->vif.type == NL80211_IFTYPE_AP || - sdata->vif.type == NL80211_IFTYPE_AP_VLAN) && - !(sdata->flags & IEEE80211_SDATA_DONT_BRIDGE_PACKETS) && -+ ehdr->h_proto != rx->sdata->control_port_protocol && - (sdata->vif.type != NL80211_IFTYPE_AP_VLAN || !sdata->u.vlan.sta)) { - if (is_multicast_ether_addr(ehdr->h_dest) && - ieee80211_vif_get_num_mcast_if(sdata) != 0) { diff --git a/package/kernel/mac80211/patches/subsys/389-mac80211-extend-protection-against-mixed-key-and-fra.patch b/package/kernel/mac80211/patches/subsys/389-mac80211-extend-protection-against-mixed-key-and-fra.patch deleted file mode 100644 index 17809263e9..0000000000 --- a/package/kernel/mac80211/patches/subsys/389-mac80211-extend-protection-against-mixed-key-and-fra.patch +++ /dev/null @@ -1,68 +0,0 @@ -From: Wen Gong -Date: Tue, 11 May 2021 20:02:51 +0200 -Subject: [PATCH] mac80211: extend protection against mixed key and - fragment cache attacks - -For some chips/drivers, e.g., QCA6174 with ath10k, the decryption is -done by the hardware, and the Protected bit in the Frame Control field -is cleared in the lower level driver before the frame is passed to -mac80211. In such cases, the condition for ieee80211_has_protected() is -not met in ieee80211_rx_h_defragment() of mac80211 and the new security -validation steps are not executed. - -Extend mac80211 to cover the case where the Protected bit has been -cleared, but the frame is indicated as having been decrypted by the -hardware. This extends protection against mixed key and fragment cache -attack for additional drivers/chips. This fixes CVE-2020-24586 and -CVE-2020-24587 for such cases. - -Tested-on: QCA6174 hw3.2 PCI WLAN.RM.4.4.1-00110-QCARMSWP-1 - -Cc: stable@vger.kernel.org -Signed-off-by: Wen Gong -Signed-off-by: Jouni Malinen -Signed-off-by: Johannes Berg ---- - ---- a/net/mac80211/rx.c -+++ b/net/mac80211/rx.c -@@ -2239,6 +2239,7 @@ ieee80211_rx_h_defragment(struct ieee802 - unsigned int frag, seq; - struct ieee80211_fragment_entry *entry; - struct sk_buff *skb; -+ struct ieee80211_rx_status *status = IEEE80211_SKB_RXCB(rx->skb); - - hdr = (struct ieee80211_hdr *)rx->skb->data; - fc = hdr->frame_control; -@@ -2297,7 +2298,9 @@ ieee80211_rx_h_defragment(struct ieee802 - sizeof(rx->key->u.gcmp.rx_pn[queue])); - BUILD_BUG_ON(IEEE80211_CCMP_PN_LEN != - IEEE80211_GCMP_PN_LEN); -- } else if (rx->key && ieee80211_has_protected(fc)) { -+ } else if (rx->key && -+ (ieee80211_has_protected(fc) || -+ (status->flag & RX_FLAG_DECRYPTED))) { - entry->is_protected = true; - entry->key_color = rx->key->color; - } -@@ -2342,13 +2345,19 @@ ieee80211_rx_h_defragment(struct ieee802 - return RX_DROP_UNUSABLE; - memcpy(entry->last_pn, pn, IEEE80211_CCMP_PN_LEN); - } else if (entry->is_protected && -- (!rx->key || !ieee80211_has_protected(fc) || -+ (!rx->key || -+ (!ieee80211_has_protected(fc) && -+ !(status->flag & RX_FLAG_DECRYPTED)) || - rx->key->color != entry->key_color)) { - /* Drop this as a mixed key or fragment cache attack, even - * if for TKIP Michael MIC should protect us, and WEP is a - * lost cause anyway. - */ - return RX_DROP_UNUSABLE; -+ } else if (entry->is_protected && rx->key && -+ entry->key_color != rx->key->color && -+ (status->flag & RX_FLAG_DECRYPTED)) { -+ return RX_DROP_UNUSABLE; - } - - skb_pull(rx->skb, ieee80211_hdrlen(fc));