From 8f7992876253261a65e7cacdfc108c9e8480cbb1 Mon Sep 17 00:00:00 2001 From: CN_SZTL Date: Mon, 10 Aug 2020 22:11:17 +0800 Subject: [PATCH 01/10] sunxi: nanopi-r1: set device packages --- target/linux/sunxi/image/cortex-a7.mk | 3 +++ 1 file changed, 3 insertions(+) diff --git a/target/linux/sunxi/image/cortex-a7.mk b/target/linux/sunxi/image/cortex-a7.mk index ad76fba63e..464a6ab704 100644 --- a/target/linux/sunxi/image/cortex-a7.mk +++ b/target/linux/sunxi/image/cortex-a7.mk @@ -60,6 +60,9 @@ TARGET_DEVICES += friendlyarm_nanopi-duo2 define Device/friendlyarm_nanopi-r1 DEVICE_VENDOR := FriendlyARM DEVICE_MODEL:=FriendlyARM NanoPi R1 + DEVICE_PACKAGES := kmod-rtc-sunxi kmod-usb2 kmod-usb-net-rtl8152 \ + kmod-brcmfmac kmod-leds-gpio kmod-ledtrig-heartbeat wpad-basic \ + brcmfmac-firmware-43430-sdio SOC := sun8i-h3 endef TARGET_DEVICES += friendlyarm_nanopi-r1 From a7be45c86a05f443a86c2abdbe0d3a6e60d05cd9 Mon Sep 17 00:00:00 2001 From: Hauke Mehrtens Date: Fri, 7 Aug 2020 19:02:57 +0200 Subject: [PATCH 02/10] mac80211: Update to 4.19.137-1 b43 and b43legacy now support ieee80211w, hardware crypto will be deactivated in such cases. Signed-off-by: Hauke Mehrtens --- package/kernel/mac80211/Makefile | 6 +++--- package/kernel/mac80211/broadcom.mk | 4 ++-- .../ath/930-ath10k_add_tpt_led_trigger.patch | 4 ++-- ...handling-for-VHT160-in-recent-firmwares.patch | 2 +- ...ontrolling-support-for-various-chipsets.patch | 6 +++--- .../975-ath10k-use-tpt-trigger-by-default.patch | 2 +- ...pport-for-configuring-management-packet.patch | 4 ++-- ...ssible-out-of-bound-access-of-ath10k_ra.patch | 2 +- ...correct-multicast-broadcast-rate-settin.patch | 4 ++-- ...ve-set-but-not-used-variables-sfdoff-an.patch | 4 ++-- ...board_type-used-for-nvram-file-selectio.patch | 2 +- ...c-add-support-for-CYW43012-SDIO-chipset.patch | 16 ++++++++-------- ...te-43012-F2-watermark-setting-to-fix-DM.patch | 2 +- ...fmac-disable-command-decode-in-sdio_aos.patch | 2 +- ...ck-and-dump-trap-info-during-sdio-probe.patch | 10 +++++----- ...t-brcmf_attach-and-brcmf_detach-functio.patch | 2 +- ...set-F2-blocksize-and-watermark-for-4359.patch | 2 +- ...-Fix-OOB-interrupt-initialization-on-br.patch | 4 ++-- .../mac80211/patches/subsys/210-ap_scan.patch | 2 +- ...trel-Enable-STBC-and-LDPC-for-VHT-Rates.patch | 2 +- ...mac80211-fix-tx-status-for-no-ack-cases.patch | 14 +++++++------- ...airtime-accounting-and-scheduling-to-TX.patch | 2 +- ...0211-add-TX_NEEDS_ALIGNED4_SKBS-hw-flag.patch | 12 ++++++------ ...-drop-redundant-rcu_read_lock-unlock-ca.patch | 10 +++++----- .../357-mac80211-optimize-skb-resizing.patch | 2 +- ...211-un-schedule-TXQs-on-powersave-start.patch | 2 +- .../522-mac80211_configure_antenna_gain.patch | 4 ++-- 27 files changed, 64 insertions(+), 64 deletions(-) diff --git a/package/kernel/mac80211/Makefile b/package/kernel/mac80211/Makefile index 1ea326a699..b71a004096 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:=4.19.120-1 +PKG_VERSION:=4.19.137-1 PKG_RELEASE:=1 -PKG_SOURCE_URL:=@KERNEL/linux/kernel/projects/backports/stable/v4.19.120/ -PKG_HASH:=2bafd75da301a30a5f2b98f433b6545d7b58c1fc3af15e9e9aa085df7f9db1d4 +PKG_SOURCE_URL:=@KERNEL/linux/kernel/projects/backports/stable/v4.19.137/ +PKG_HASH:=dc5eea4f77fc5c43b69e38f46fbf766880fa4bdeef83dcc8dcc85aa6b645bb7c PKG_SOURCE:=backports-$(PKG_VERSION).tar.xz PKG_BUILD_DIR:=$(KERNEL_BUILD_DIR)/backports-$(PKG_VERSION) diff --git a/package/kernel/mac80211/broadcom.mk b/package/kernel/mac80211/broadcom.mk index a58d78a6a4..a777d19b72 100644 --- a/package/kernel/mac80211/broadcom.mk +++ b/package/kernel/mac80211/broadcom.mk @@ -105,7 +105,7 @@ define KernelPackage/b43 CONFIG_HW_RANDOM=y # Depend on PCI_SUPPORT to make sure we can select kmod-bcma or kmod-ssb DEPENDS += \ - @PCI_SUPPORT +kmod-mac80211 \ + @PCI_SUPPORT +@DRIVER_11W_SUPPORT +kmod-mac80211 \ $(if $(CONFIG_PACKAGE_B43_USE_SSB),+kmod-ssb) \ $(if $(CONFIG_PACKAGE_B43_USE_BCMA),+kmod-bcma) FILES:=$(PKG_BUILD_DIR)/drivers/net/wireless/broadcom/b43/b43.ko @@ -347,7 +347,7 @@ define KernelPackage/b43legacy URL:=https://wireless.wiki.kernel.org/en/users/drivers/b43 KCONFIG:= \ CONFIG_HW_RANDOM=y - DEPENDS+= +kmod-mac80211 +!(TARGET_brcm47xx||TARGET_brcm63xx):kmod-ssb @!TARGET_brcm47xx_mips74k +b43legacy-firmware + DEPENDS+= +kmod-mac80211 +!(TARGET_brcm47xx||TARGET_brcm63xx):kmod-ssb @!TARGET_brcm47xx_mips74k +b43legacy-firmware +@DRIVER_11W_SUPPORT FILES:=$(PKG_BUILD_DIR)/drivers/net/wireless/broadcom/b43legacy/b43legacy.ko AUTOLOAD:=$(call AutoProbe,b43legacy) MENU:=1 diff --git a/package/kernel/mac80211/patches/ath/930-ath10k_add_tpt_led_trigger.patch b/package/kernel/mac80211/patches/ath/930-ath10k_add_tpt_led_trigger.patch index 4bcde171a9..bdf08710e6 100644 --- a/package/kernel/mac80211/patches/ath/930-ath10k_add_tpt_led_trigger.patch +++ b/package/kernel/mac80211/patches/ath/930-ath10k_add_tpt_led_trigger.patch @@ -1,6 +1,6 @@ --- a/drivers/net/wireless/ath/ath10k/mac.c +++ b/drivers/net/wireless/ath/ath10k/mac.c -@@ -8297,6 +8297,21 @@ static int ath10k_mac_init_rd(struct ath +@@ -8300,6 +8300,21 @@ static int ath10k_mac_init_rd(struct ath return 0; } @@ -22,7 +22,7 @@ int ath10k_mac_register(struct ath10k *ar) { static const u32 cipher_suites[] = { -@@ -8581,6 +8596,12 @@ int ath10k_mac_register(struct ath10k *a +@@ -8584,6 +8599,12 @@ int ath10k_mac_register(struct ath10k *a wiphy_ext_feature_set(ar->hw->wiphy, NL80211_EXT_FEATURE_CQM_RSSI_LIST); diff --git a/package/kernel/mac80211/patches/ath/973-ath10k_fix-band_center_freq-handling-for-VHT160-in-recent-firmwares.patch b/package/kernel/mac80211/patches/ath/973-ath10k_fix-band_center_freq-handling-for-VHT160-in-recent-firmwares.patch index 4984fc6699..c26ea96095 100644 --- a/package/kernel/mac80211/patches/ath/973-ath10k_fix-band_center_freq-handling-for-VHT160-in-recent-firmwares.patch +++ b/package/kernel/mac80211/patches/ath/973-ath10k_fix-band_center_freq-handling-for-VHT160-in-recent-firmwares.patch @@ -13,7 +13,7 @@ v2: fix trailing whitespace issue and fix some typos within the commit note 2 files changed, 8 insertions(+), 10 deletions(-) --- a/drivers/net/wireless/ath/ath10k/mac.c +++ b/drivers/net/wireless/ath/ath10k/mac.c -@@ -4480,13 +4480,6 @@ static struct ieee80211_sta_vht_cap ath1 +@@ -4483,13 +4483,6 @@ static struct ieee80211_sta_vht_cap ath1 vht_cap.cap |= val; } 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/ath/974-ath10k_add-LED-and-GPIO-controlling-support-for-various-chipsets.patch index a13fb036ad..7b812b0fc1 100644 --- a/package/kernel/mac80211/patches/ath/974-ath10k_add-LED-and-GPIO-controlling-support-for-various-chipsets.patch +++ b/package/kernel/mac80211/patches/ath/974-ath10k_add-LED-and-GPIO-controlling-support-for-various-chipsets.patch @@ -415,7 +415,7 @@ v13: /* Rates */ --- a/drivers/net/wireless/ath/ath10k/wmi-ops.h +++ b/drivers/net/wireless/ath/ath10k/wmi-ops.h -@@ -216,7 +216,10 @@ struct wmi_ops { +@@ -217,7 +217,10 @@ struct wmi_ops { struct sk_buff *(*gen_echo)(struct ath10k *ar, u32 value); struct sk_buff *(*gen_pdev_get_tpc_table_cmdid)(struct ath10k *ar, u32 param); @@ -426,7 +426,7 @@ v13: }; int ath10k_wmi_cmd_send(struct ath10k *ar, struct sk_buff *skb, u32 cmd_id); -@@ -1054,6 +1057,35 @@ ath10k_wmi_force_fw_hang(struct ath10k * +@@ -1064,6 +1067,35 @@ ath10k_wmi_force_fw_hang(struct ath10k * return ath10k_wmi_cmd_send(ar, skb, ar->wmi.cmd->force_fw_hang_cmdid); } @@ -464,7 +464,7 @@ v13: { --- a/drivers/net/wireless/ath/ath10k/wmi-tlv.c +++ b/drivers/net/wireless/ath/ath10k/wmi-tlv.c -@@ -3976,6 +3976,8 @@ static const struct wmi_ops wmi_tlv_ops +@@ -3991,6 +3991,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/ath/975-ath10k-use-tpt-trigger-by-default.patch b/package/kernel/mac80211/patches/ath/975-ath10k-use-tpt-trigger-by-default.patch index e60a213a30..e33793bb39 100644 --- a/package/kernel/mac80211/patches/ath/975-ath10k-use-tpt-trigger-by-default.patch +++ b/package/kernel/mac80211/patches/ath/975-ath10k-use-tpt-trigger-by-default.patch @@ -42,7 +42,7 @@ Signed-off-by: Mathias Kresin if (ret) --- a/drivers/net/wireless/ath/ath10k/mac.c +++ b/drivers/net/wireless/ath/ath10k/mac.c -@@ -8613,7 +8613,7 @@ int ath10k_mac_register(struct ath10k *a +@@ -8616,7 +8616,7 @@ int ath10k_mac_register(struct ath10k *a wiphy_ext_feature_set(ar->hw->wiphy, NL80211_EXT_FEATURE_CQM_RSSI_LIST); #ifdef CPTCFG_MAC80211_LEDS diff --git a/package/kernel/mac80211/patches/ath/977-ath10k-add-support-for-configuring-management-packet.patch b/package/kernel/mac80211/patches/ath/977-ath10k-add-support-for-configuring-management-packet.patch index a750e232df..4f68f04ed2 100644 --- a/package/kernel/mac80211/patches/ath/977-ath10k-add-support-for-configuring-management-packet.patch +++ b/package/kernel/mac80211/patches/ath/977-ath10k-add-support-for-configuring-management-packet.patch @@ -43,7 +43,7 @@ Origin: backport, https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux static int ath10k_mac_get_max_vht_mcs_map(u16 mcs_map, int nss) { switch ((mcs_map >> (2 * nss)) & 0x3) { -@@ -5482,9 +5498,10 @@ static void ath10k_bss_info_changed(stru +@@ -5485,9 +5501,10 @@ static void ath10k_bss_info_changed(stru struct cfg80211_chan_def def; u32 vdev_param, pdev_param, slottime, preamble; u16 bitrate, hw_value; @@ -56,7 +56,7 @@ Origin: backport, https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux mutex_lock(&ar->conf_mutex); -@@ -5690,6 +5707,30 @@ static void ath10k_bss_info_changed(stru +@@ -5693,6 +5710,30 @@ static void ath10k_bss_info_changed(stru arvif->vdev_id, ret); } diff --git a/package/kernel/mac80211/patches/ath/978-ath10k-fix-possible-out-of-bound-access-of-ath10k_ra.patch b/package/kernel/mac80211/patches/ath/978-ath10k-fix-possible-out-of-bound-access-of-ath10k_ra.patch index 218301ca3a..1c7c612eea 100644 --- a/package/kernel/mac80211/patches/ath/978-ath10k-fix-possible-out-of-bound-access-of-ath10k_ra.patch +++ b/package/kernel/mac80211/patches/ath/978-ath10k-fix-possible-out-of-bound-access-of-ath10k_ra.patch @@ -26,7 +26,7 @@ Origin: backport, https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux if (ath10k_rates[i].bitrate == bitrate) return hw_value_prefix | ath10k_rates[i].hw_value; } -@@ -5713,22 +5713,22 @@ static void ath10k_bss_info_changed(stru +@@ -5716,22 +5716,22 @@ static void ath10k_bss_info_changed(stru return; } diff --git a/package/kernel/mac80211/patches/ath/979-ath10k-fix-incorrect-multicast-broadcast-rate-settin.patch b/package/kernel/mac80211/patches/ath/979-ath10k-fix-incorrect-multicast-broadcast-rate-settin.patch index 58422304b6..26dc801805 100644 --- a/package/kernel/mac80211/patches/ath/979-ath10k-fix-incorrect-multicast-broadcast-rate-settin.patch +++ b/package/kernel/mac80211/patches/ath/979-ath10k-fix-incorrect-multicast-broadcast-rate-settin.patch @@ -17,7 +17,7 @@ Origin: other, https://patchwork.kernel.org/patch/10723033/ --- a/drivers/net/wireless/ath/ath10k/mac.c +++ b/drivers/net/wireless/ath/ath10k/mac.c -@@ -5498,8 +5498,8 @@ static void ath10k_bss_info_changed(stru +@@ -5501,8 +5501,8 @@ static void ath10k_bss_info_changed(stru struct cfg80211_chan_def def; u32 vdev_param, pdev_param, slottime, preamble; u16 bitrate, hw_value; @@ -28,7 +28,7 @@ Origin: other, https://patchwork.kernel.org/patch/10723033/ enum nl80211_band band; const struct ieee80211_supported_band *sband; -@@ -5672,7 +5672,11 @@ static void ath10k_bss_info_changed(stru +@@ -5675,7 +5675,11 @@ static void ath10k_bss_info_changed(stru if (changed & BSS_CHANGED_MCAST_RATE && !ath10k_mac_vif_chan(arvif->vif, &def)) { band = def.chan->band; diff --git a/package/kernel/mac80211/patches/brcm/305-v4.20-0001-brcmfmac-remove-set-but-not-used-variables-sfdoff-an.patch b/package/kernel/mac80211/patches/brcm/305-v4.20-0001-brcmfmac-remove-set-but-not-used-variables-sfdoff-an.patch index 2eb937367f..ddf3d65a2b 100644 --- a/package/kernel/mac80211/patches/brcm/305-v4.20-0001-brcmfmac-remove-set-but-not-used-variables-sfdoff-an.patch +++ b/package/kernel/mac80211/patches/brcm/305-v4.20-0001-brcmfmac-remove-set-but-not-used-variables-sfdoff-an.patch @@ -39,7 +39,7 @@ Signed-off-by: Kalle Valo num = 0; /* Validate all the subframe headers */ -@@ -3426,7 +3425,6 @@ static int brcmf_sdio_bus_preinit(struct +@@ -3428,7 +3427,6 @@ static int brcmf_sdio_bus_preinit(struct struct brcmf_sdio_dev *sdiodev = bus_if->bus_priv.sdio; struct brcmf_sdio *bus = sdiodev->bus; struct brcmf_core *core = bus->sdio_core; @@ -47,7 +47,7 @@ Signed-off-by: Kalle Valo u32 value; int err; -@@ -3467,7 +3465,6 @@ static int brcmf_sdio_bus_preinit(struct +@@ -3469,7 +3467,6 @@ static int brcmf_sdio_bus_preinit(struct if (sdiodev->sg_support) { bus->txglom = false; value = 1; diff --git a/package/kernel/mac80211/patches/brcm/320-v5.0-0004-brcmfmac-Set-board_type-used-for-nvram-file-selectio.patch b/package/kernel/mac80211/patches/brcm/320-v5.0-0004-brcmfmac-Set-board_type-used-for-nvram-file-selectio.patch index 5dcff90c47..9b06d40dc6 100644 --- a/package/kernel/mac80211/patches/brcm/320-v5.0-0004-brcmfmac-Set-board_type-used-for-nvram-file-selectio.patch +++ b/package/kernel/mac80211/patches/brcm/320-v5.0-0004-brcmfmac-Set-board_type-used-for-nvram-file-selectio.patch @@ -67,7 +67,7 @@ Signed-off-by: Kalle Valo fwreq->bus_nr = devinfo->pdev->bus->number; --- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c +++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c -@@ -4213,6 +4213,7 @@ brcmf_sdio_prepare_fw_request(struct brc +@@ -4215,6 +4215,7 @@ brcmf_sdio_prepare_fw_request(struct brc fwreq->items[BRCMF_SDIO_FW_CODE].type = BRCMF_FW_TYPE_BINARY; fwreq->items[BRCMF_SDIO_FW_NVRAM].type = BRCMF_FW_TYPE_NVRAM; diff --git a/package/kernel/mac80211/patches/brcm/329-v5.0-0004-brcmfmac-add-support-for-CYW43012-SDIO-chipset.patch b/package/kernel/mac80211/patches/brcm/329-v5.0-0004-brcmfmac-add-support-for-CYW43012-SDIO-chipset.patch index daf1cddb94..d572c52130 100644 --- a/package/kernel/mac80211/patches/brcm/329-v5.0-0004-brcmfmac-add-support-for-CYW43012-SDIO-chipset.patch +++ b/package/kernel/mac80211/patches/brcm/329-v5.0-0004-brcmfmac-add-support-for-CYW43012-SDIO-chipset.patch @@ -100,7 +100,7 @@ Signed-off-by: Kalle Valo if (on) { /* device WAKEUP through KSO: * write bit 0 & read back until -@@ -2414,6 +2424,14 @@ static int brcmf_sdio_tx_ctrlframe(struc +@@ -2416,6 +2426,14 @@ static int brcmf_sdio_tx_ctrlframe(struc return ret; } @@ -115,7 +115,7 @@ Signed-off-by: Kalle Valo static void brcmf_sdio_bus_stop(struct device *dev) { struct brcmf_bus *bus_if = dev_get_drvdata(dev); -@@ -2421,7 +2439,7 @@ static void brcmf_sdio_bus_stop(struct d +@@ -2423,7 +2441,7 @@ static void brcmf_sdio_bus_stop(struct d struct brcmf_sdio *bus = sdiodev->bus; struct brcmf_core *core = bus->sdio_core; u32 local_hostintmask; @@ -124,7 +124,7 @@ Signed-off-by: Kalle Valo int err; brcmf_dbg(TRACE, "Enter\n"); -@@ -2448,9 +2466,14 @@ static void brcmf_sdio_bus_stop(struct d +@@ -2450,9 +2468,14 @@ static void brcmf_sdio_bus_stop(struct d /* Force backplane clocks to assure F2 interrupt propagates */ saveclk = brcmf_sdiod_readb(sdiodev, SBSDIO_FUNC1_CHIPCLKCSR, &err); @@ -142,7 +142,7 @@ Signed-off-by: Kalle Valo if (err) brcmf_err("Failed to force clock for F2: err %d\n", err); -@@ -3343,20 +3366,45 @@ err: +@@ -3345,20 +3368,45 @@ err: return bcmerror; } @@ -190,7 +190,7 @@ Signed-off-by: Kalle Valo brcmf_sdiod_writeb(bus->sdiodev, SBSDIO_FUNC1_WAKEUPCTRL, val, &err); if (err) { brcmf_err("error writing SBSDIO_FUNC1_WAKEUPCTRL\n"); -@@ -3365,8 +3413,7 @@ static void brcmf_sdio_sr_init(struct br +@@ -3367,8 +3415,7 @@ static void brcmf_sdio_sr_init(struct br /* Add CMD14 Support */ brcmf_sdiod_func0_wb(bus->sdiodev, SDIO_CCCR_BRCM_CARDCAP, @@ -200,7 +200,7 @@ Signed-off-by: Kalle Valo &err); if (err) { brcmf_err("error writing SDIO_CCCR_BRCM_CARDCAP\n"); -@@ -3374,7 +3421,7 @@ static void brcmf_sdio_sr_init(struct br +@@ -3376,7 +3423,7 @@ static void brcmf_sdio_sr_init(struct br } brcmf_sdiod_writeb(bus->sdiodev, SBSDIO_FUNC1_CHIPCLKCSR, @@ -209,7 +209,7 @@ Signed-off-by: Kalle Valo if (err) { brcmf_err("error writing SBSDIO_FUNC1_CHIPCLKCSR\n"); return; -@@ -4065,7 +4112,7 @@ static void brcmf_sdio_firmware_callback +@@ -4067,7 +4114,7 @@ static void brcmf_sdio_firmware_callback const struct firmware *code; void *nvram; u32 nvram_len; @@ -218,7 +218,7 @@ Signed-off-by: Kalle Valo u8 devctl; brcmf_dbg(TRACE, "Enter: dev=%s, err=%d\n", dev_name(dev), err); -@@ -4099,8 +4146,11 @@ static void brcmf_sdio_firmware_callback +@@ -4101,8 +4148,11 @@ static void brcmf_sdio_firmware_callback /* Force clocks on backplane to be sure F2 interrupt propagates */ saveclk = brcmf_sdiod_readb(sdiod, SBSDIO_FUNC1_CHIPCLKCSR, &err); if (!err) { diff --git a/package/kernel/mac80211/patches/brcm/329-v5.0-0006-brcmfmac-update-43012-F2-watermark-setting-to-fix-DM.patch b/package/kernel/mac80211/patches/brcm/329-v5.0-0006-brcmfmac-update-43012-F2-watermark-setting-to-fix-DM.patch index defee89879..64e70b5170 100644 --- a/package/kernel/mac80211/patches/brcm/329-v5.0-0006-brcmfmac-update-43012-F2-watermark-setting-to-fix-DM.patch +++ b/package/kernel/mac80211/patches/brcm/329-v5.0-0006-brcmfmac-update-43012-F2-watermark-setting-to-fix-DM.patch @@ -29,7 +29,7 @@ Signed-off-by: Kalle Valo #ifdef DEBUG -@@ -4187,6 +4188,17 @@ static void brcmf_sdio_firmware_callback +@@ -4189,6 +4190,17 @@ static void brcmf_sdio_firmware_callback CY_4373_F2_WATERMARK | SBSDIO_MESBUSYCTRL_ENAB, &err); break; diff --git a/package/kernel/mac80211/patches/brcm/329-v5.0-0008-brcmfmac-disable-command-decode-in-sdio_aos.patch b/package/kernel/mac80211/patches/brcm/329-v5.0-0008-brcmfmac-disable-command-decode-in-sdio_aos.patch index d99a01426b..26d42f1b1a 100644 --- a/package/kernel/mac80211/patches/brcm/329-v5.0-0008-brcmfmac-disable-command-decode-in-sdio_aos.patch +++ b/package/kernel/mac80211/patches/brcm/329-v5.0-0008-brcmfmac-disable-command-decode-in-sdio_aos.patch @@ -30,7 +30,7 @@ Signed-off-by: Kalle Valo --- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c +++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c -@@ -3369,7 +3369,11 @@ err: +@@ -3371,7 +3371,11 @@ err: static bool brcmf_sdio_aos_no_decode(struct brcmf_sdio *bus) { diff --git a/package/kernel/mac80211/patches/brcm/349-v5.1-0005-brcmfmac-check-and-dump-trap-info-during-sdio-probe.patch b/package/kernel/mac80211/patches/brcm/349-v5.1-0005-brcmfmac-check-and-dump-trap-info-during-sdio-probe.patch index 2f48fdc9c2..f77a2d3f28 100644 --- a/package/kernel/mac80211/patches/brcm/349-v5.1-0005-brcmfmac-check-and-dump-trap-info-during-sdio-probe.patch +++ b/package/kernel/mac80211/patches/brcm/349-v5.1-0005-brcmfmac-check-and-dump-trap-info-during-sdio-probe.patch @@ -18,7 +18,7 @@ Signed-off-by: Kalle Valo --- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c +++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c -@@ -3011,21 +3011,35 @@ static int brcmf_sdio_trap_info(struct s +@@ -3013,21 +3013,35 @@ static int brcmf_sdio_trap_info(struct s if (error < 0) return error; @@ -69,7 +69,7 @@ Signed-off-by: Kalle Valo return 0; } -@@ -3079,8 +3093,10 @@ static int brcmf_sdio_checkdied(struct b +@@ -3081,8 +3095,10 @@ static int brcmf_sdio_checkdied(struct b else if (sh.flags & SDPCM_SHARED_ASSERT) brcmf_err("assertion in dongle\n"); @@ -81,7 +81,7 @@ Signed-off-by: Kalle Valo return 0; } -@@ -4211,7 +4227,7 @@ static void brcmf_sdio_firmware_callback +@@ -4213,7 +4229,7 @@ static void brcmf_sdio_firmware_callback } else { /* Disable F2 again */ sdio_disable_func(sdiod->func2); @@ -90,7 +90,7 @@ Signed-off-by: Kalle Valo } if (brcmf_chip_sr_capable(bus->ci)) { -@@ -4232,8 +4248,10 @@ static void brcmf_sdio_firmware_callback +@@ -4234,8 +4250,10 @@ static void brcmf_sdio_firmware_callback } /* If we didn't come up, turn off backplane clock */ @@ -102,7 +102,7 @@ Signed-off-by: Kalle Valo sdio_release_host(sdiod->func1); -@@ -4247,12 +4265,15 @@ static void brcmf_sdio_firmware_callback +@@ -4249,12 +4267,15 @@ static void brcmf_sdio_firmware_callback err = brcmf_attach(sdiod->dev, sdiod->settings); if (err != 0) { brcmf_err("brcmf_attach failed\n"); diff --git a/package/kernel/mac80211/patches/brcm/392-v5.4-0002-brcmfmac-split-brcmf_attach-and-brcmf_detach-functio.patch b/package/kernel/mac80211/patches/brcm/392-v5.4-0002-brcmfmac-split-brcmf_attach-and-brcmf_detach-functio.patch index 11d1b9db31..d1a2d8d7c7 100644 --- a/package/kernel/mac80211/patches/brcm/392-v5.4-0002-brcmfmac-split-brcmf_attach-and-brcmf_detach-functio.patch +++ b/package/kernel/mac80211/patches/brcm/392-v5.4-0002-brcmfmac-split-brcmf_attach-and-brcmf_detach-functio.patch @@ -153,7 +153,7 @@ Signed-off-by: Kalle Valo kfree(bus->msgbuf->flowrings); --- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c +++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c -@@ -4252,17 +4252,26 @@ static void brcmf_sdio_firmware_callback +@@ -4254,17 +4254,26 @@ static void brcmf_sdio_firmware_callback sdiod->bus_if->chip = bus->ci->chip; sdiod->bus_if->chiprev = bus->ci->chiprev; diff --git a/package/kernel/mac80211/patches/brcm/414-v5.6-0002-brcmfmac-set-F2-blocksize-and-watermark-for-4359.patch b/package/kernel/mac80211/patches/brcm/414-v5.6-0002-brcmfmac-set-F2-blocksize-and-watermark-for-4359.patch index 34f597482b..8d88fbfc84 100644 --- a/package/kernel/mac80211/patches/brcm/414-v5.6-0002-brcmfmac-set-F2-blocksize-and-watermark-for-4359.patch +++ b/package/kernel/mac80211/patches/brcm/414-v5.6-0002-brcmfmac-set-F2-blocksize-and-watermark-for-4359.patch @@ -57,7 +57,7 @@ Signed-off-by: Kalle Valo #ifdef DEBUG -@@ -4210,6 +4212,19 @@ static void brcmf_sdio_firmware_callback +@@ -4212,6 +4214,19 @@ static void brcmf_sdio_firmware_callback brcmf_sdiod_writeb(sdiod, SBSDIO_DEVICE_CTL, devctl, &err); break; diff --git a/package/kernel/mac80211/patches/brcm/418-v5.6-brcmfmac-sdio-Fix-OOB-interrupt-initialization-on-br.patch b/package/kernel/mac80211/patches/brcm/418-v5.6-brcmfmac-sdio-Fix-OOB-interrupt-initialization-on-br.patch index 3b1b00c1d5..66c710a928 100644 --- a/package/kernel/mac80211/patches/brcm/418-v5.6-brcmfmac-sdio-Fix-OOB-interrupt-initialization-on-br.patch +++ b/package/kernel/mac80211/patches/brcm/418-v5.6-brcmfmac-sdio-Fix-OOB-interrupt-initialization-on-br.patch @@ -29,7 +29,7 @@ Signed-off-by: Kalle Valo --- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c +++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c -@@ -4247,6 +4247,12 @@ static void brcmf_sdio_firmware_callback +@@ -4249,6 +4249,12 @@ static void brcmf_sdio_firmware_callback } if (err == 0) { @@ -42,7 +42,7 @@ Signed-off-by: Kalle Valo /* Allow full data communication using DPC from now on. */ brcmf_sdiod_change_state(bus->sdiodev, BRCMF_SDIOD_DATA); -@@ -4263,12 +4269,6 @@ static void brcmf_sdio_firmware_callback +@@ -4265,12 +4271,6 @@ static void brcmf_sdio_firmware_callback sdio_release_host(sdiod->func1); diff --git a/package/kernel/mac80211/patches/subsys/210-ap_scan.patch b/package/kernel/mac80211/patches/subsys/210-ap_scan.patch index 214ec05539..6c8da3651e 100644 --- a/package/kernel/mac80211/patches/subsys/210-ap_scan.patch +++ b/package/kernel/mac80211/patches/subsys/210-ap_scan.patch @@ -1,6 +1,6 @@ --- a/net/mac80211/cfg.c +++ b/net/mac80211/cfg.c -@@ -2188,7 +2188,7 @@ static int ieee80211_scan(struct wiphy * +@@ -2189,7 +2189,7 @@ static int ieee80211_scan(struct wiphy * * the frames sent while scanning on other channel will be * lost) */ diff --git a/package/kernel/mac80211/patches/subsys/303-mac80211-minstrel-Enable-STBC-and-LDPC-for-VHT-Rates.patch b/package/kernel/mac80211/patches/subsys/303-mac80211-minstrel-Enable-STBC-and-LDPC-for-VHT-Rates.patch index 5cce4936e1..a119f1cdec 100644 --- a/package/kernel/mac80211/patches/subsys/303-mac80211-minstrel-Enable-STBC-and-LDPC-for-VHT-Rates.patch +++ b/package/kernel/mac80211/patches/subsys/303-mac80211-minstrel-Enable-STBC-and-LDPC-for-VHT-Rates.patch @@ -10,7 +10,7 @@ Signed-off-by: Chaitanya TK --- a/include/linux/ieee80211.h +++ b/include/linux/ieee80211.h -@@ -1659,6 +1659,7 @@ struct ieee80211_mu_edca_param_set { +@@ -1668,6 +1668,7 @@ struct ieee80211_mu_edca_param_set { #define IEEE80211_VHT_CAP_RXSTBC_3 0x00000300 #define IEEE80211_VHT_CAP_RXSTBC_4 0x00000400 #define IEEE80211_VHT_CAP_RXSTBC_MASK 0x00000700 diff --git a/package/kernel/mac80211/patches/subsys/305-mac80211-fix-tx-status-for-no-ack-cases.patch b/package/kernel/mac80211/patches/subsys/305-mac80211-fix-tx-status-for-no-ack-cases.patch index 5b5daf8ad1..2a9823f666 100644 --- a/package/kernel/mac80211/patches/subsys/305-mac80211-fix-tx-status-for-no-ack-cases.patch +++ b/package/kernel/mac80211/patches/subsys/305-mac80211-fix-tx-status-for-no-ack-cases.patch @@ -12,7 +12,7 @@ Signed-off-by: Johannes Berg --- a/net/mac80211/status.c +++ b/net/mac80211/status.c -@@ -719,6 +719,7 @@ static void __ieee80211_tx_status(struct +@@ -718,6 +718,7 @@ static void __ieee80211_tx_status(struct int rates_idx; bool send_to_cooked; bool acked; @@ -20,7 +20,7 @@ Signed-off-by: Johannes Berg struct ieee80211_bar *bar; int shift = 0; int tid = IEEE80211_NUM_TIDS; -@@ -736,6 +737,8 @@ static void __ieee80211_tx_status(struct +@@ -735,6 +736,8 @@ static void __ieee80211_tx_status(struct clear_sta_flag(sta, WLAN_STA_SP); acked = !!(info->flags & IEEE80211_TX_STAT_ACK); @@ -29,7 +29,7 @@ Signed-off-by: Johannes Berg /* mesh Peer Service Period support */ if (ieee80211_vif_is_mesh(&sta->sdata->vif) && -@@ -800,12 +803,12 @@ static void __ieee80211_tx_status(struct +@@ -799,12 +802,12 @@ static void __ieee80211_tx_status(struct ieee80211_handle_filtered_frame(local, sta, skb); return; } else { @@ -44,7 +44,7 @@ Signed-off-by: Johannes Berg sta->status_stats.msdu_failed[tid]++; sta->status_stats.msdu_retries[tid] += -@@ -826,7 +829,7 @@ static void __ieee80211_tx_status(struct +@@ -825,7 +828,7 @@ static void __ieee80211_tx_status(struct acked, info->status.tx_time); if (ieee80211_hw_check(&local->hw, REPORTS_TX_ACK_STATUS)) { @@ -53,7 +53,7 @@ Signed-off-by: Johannes Berg if (sta->status_stats.lost_packets) sta->status_stats.lost_packets = 0; -@@ -834,6 +837,8 @@ static void __ieee80211_tx_status(struct +@@ -833,6 +836,8 @@ static void __ieee80211_tx_status(struct if (test_sta_flag(sta, WLAN_STA_TDLS_PEER_AUTH)) sta->status_stats.last_tdls_pkt_time = jiffies; @@ -62,7 +62,7 @@ Signed-off-by: Johannes Berg } else { ieee80211_lost_packet(sta, info); } -@@ -959,7 +964,7 @@ void ieee80211_tx_status_ext(struct ieee +@@ -958,7 +963,7 @@ void ieee80211_tx_status_ext(struct ieee sta = container_of(pubsta, struct sta_info, sta); @@ -71,7 +71,7 @@ Signed-off-by: Johannes Berg sta->status_stats.retry_failed++; sta->status_stats.retry_count += retry_count; -@@ -974,6 +979,8 @@ void ieee80211_tx_status_ext(struct ieee +@@ -973,6 +978,8 @@ void ieee80211_tx_status_ext(struct ieee sta->status_stats.last_tdls_pkt_time = jiffies; } else if (test_sta_flag(sta, WLAN_STA_PS_STA)) { return; diff --git a/package/kernel/mac80211/patches/subsys/322-mac80211-Add-airtime-accounting-and-scheduling-to-TX.patch b/package/kernel/mac80211/patches/subsys/322-mac80211-Add-airtime-accounting-and-scheduling-to-TX.patch index 3b2f382430..a09cf3d749 100644 --- a/package/kernel/mac80211/patches/subsys/322-mac80211-Add-airtime-accounting-and-scheduling-to-TX.patch +++ b/package/kernel/mac80211/patches/subsys/322-mac80211-Add-airtime-accounting-and-scheduling-to-TX.patch @@ -385,7 +385,7 @@ Signed-off-by: Johannes Berg */ --- a/net/mac80211/status.c +++ b/net/mac80211/status.c -@@ -828,6 +828,12 @@ static void __ieee80211_tx_status(struct +@@ -827,6 +827,12 @@ static void __ieee80211_tx_status(struct ieee80211_sta_tx_notify(sta->sdata, (void *) skb->data, acked, info->status.tx_time); diff --git a/package/kernel/mac80211/patches/subsys/351-mac80211-add-TX_NEEDS_ALIGNED4_SKBS-hw-flag.patch b/package/kernel/mac80211/patches/subsys/351-mac80211-add-TX_NEEDS_ALIGNED4_SKBS-hw-flag.patch index a9ebfac36d..784b4b027a 100644 --- a/package/kernel/mac80211/patches/subsys/351-mac80211-add-TX_NEEDS_ALIGNED4_SKBS-hw-flag.patch +++ b/package/kernel/mac80211/patches/subsys/351-mac80211-add-TX_NEEDS_ALIGNED4_SKBS-hw-flag.patch @@ -113,7 +113,7 @@ Signed-off-by: Felix Fietkau if (!(mshdr->flags & MESH_FLAGS_AE)) { --- a/net/mac80211/rx.c +++ b/net/mac80211/rx.c -@@ -2597,7 +2597,7 @@ ieee80211_rx_h_mesh_fwding(struct ieee80 +@@ -2621,7 +2621,7 @@ ieee80211_rx_h_mesh_fwding(struct ieee80 struct ieee80211_local *local = rx->local; struct ieee80211_sub_if_data *sdata = rx->sdata; struct ieee80211_if_mesh *ifmsh = &sdata->u.mesh; @@ -122,7 +122,7 @@ Signed-off-by: Felix Fietkau int tailroom = 0; hdr = (struct ieee80211_hdr *) skb->data; -@@ -2690,7 +2690,9 @@ ieee80211_rx_h_mesh_fwding(struct ieee80 +@@ -2714,7 +2714,9 @@ ieee80211_rx_h_mesh_fwding(struct ieee80 if (sdata->crypto_tx_tailroom_needed_cnt) tailroom = IEEE80211_ENCRYPT_TAILROOM; @@ -133,7 +133,7 @@ Signed-off-by: Felix Fietkau sdata->encrypt_headroom, tailroom, GFP_ATOMIC); if (!fwd_skb) -@@ -2722,6 +2724,12 @@ ieee80211_rx_h_mesh_fwding(struct ieee80 +@@ -2746,6 +2748,12 @@ ieee80211_rx_h_mesh_fwding(struct ieee80 return RX_DROP_MONITOR; } @@ -159,7 +159,7 @@ Signed-off-by: Felix Fietkau struct rcu_head rcu_head; --- a/net/mac80211/status.c +++ b/net/mac80211/status.c -@@ -515,6 +515,7 @@ static void ieee80211_report_used_skb(st +@@ -514,6 +514,7 @@ static void ieee80211_report_used_skb(st { struct ieee80211_tx_info *info = IEEE80211_SKB_CB(skb); struct ieee80211_hdr *hdr = (void *)skb->data; @@ -167,7 +167,7 @@ Signed-off-by: Felix Fietkau bool acked = info->flags & IEEE80211_TX_STAT_ACK; if (dropped) -@@ -531,7 +532,7 @@ static void ieee80211_report_used_skb(st +@@ -530,7 +531,7 @@ static void ieee80211_report_used_skb(st skb->dev = NULL; } else { unsigned int hdr_size = @@ -176,7 +176,7 @@ Signed-off-by: Felix Fietkau /* Check to see if packet is a TDLS teardown packet */ if (ieee80211_is_data(hdr->frame_control) && -@@ -655,9 +656,22 @@ void ieee80211_tx_monitor(struct ieee802 +@@ -654,9 +655,22 @@ void ieee80211_tx_monitor(struct ieee802 struct sk_buff *skb2; struct ieee80211_tx_info *info = IEEE80211_SKB_CB(skb); struct ieee80211_sub_if_data *sdata; diff --git a/package/kernel/mac80211/patches/subsys/353-mac80211-mesh-drop-redundant-rcu_read_lock-unlock-ca.patch b/package/kernel/mac80211/patches/subsys/353-mac80211-mesh-drop-redundant-rcu_read_lock-unlock-ca.patch index bcbec4cd6d..0e13e2fecc 100644 --- a/package/kernel/mac80211/patches/subsys/353-mac80211-mesh-drop-redundant-rcu_read_lock-unlock-ca.patch +++ b/package/kernel/mac80211/patches/subsys/353-mac80211-mesh-drop-redundant-rcu_read_lock-unlock-ca.patch @@ -9,7 +9,7 @@ Signed-off-by: Felix Fietkau --- a/net/mac80211/mesh_hwmp.c +++ b/net/mac80211/mesh_hwmp.c -@@ -1115,16 +1115,13 @@ int mesh_nexthop_resolve(struct ieee8021 +@@ -1122,16 +1122,13 @@ int mesh_nexthop_resolve(struct ieee8021 struct mesh_path *mpath; struct sk_buff *skb_to_free = NULL; u8 *target_addr = hdr->addr3; @@ -28,7 +28,7 @@ Signed-off-by: Felix Fietkau /* no nexthop found, start resolving */ mpath = mesh_path_lookup(sdata, target_addr); -@@ -1132,8 +1129,7 @@ int mesh_nexthop_resolve(struct ieee8021 +@@ -1139,8 +1136,7 @@ int mesh_nexthop_resolve(struct ieee8021 mpath = mesh_path_add(sdata, target_addr); if (IS_ERR(mpath)) { mesh_path_discard_frame(sdata, skb); @@ -38,7 +38,7 @@ Signed-off-by: Felix Fietkau } } -@@ -1147,13 +1143,10 @@ int mesh_nexthop_resolve(struct ieee8021 +@@ -1154,13 +1150,10 @@ int mesh_nexthop_resolve(struct ieee8021 info->flags |= IEEE80211_TX_INTFL_NEED_TXPROCESSING; ieee80211_set_qos_hdr(sdata, skb); skb_queue_tail(&mpath->frame_queue, skb); @@ -53,7 +53,7 @@ Signed-off-by: Felix Fietkau } /** -@@ -1173,13 +1166,10 @@ int mesh_nexthop_lookup(struct ieee80211 +@@ -1180,13 +1173,10 @@ int mesh_nexthop_lookup(struct ieee80211 struct sta_info *next_hop; struct ieee80211_hdr *hdr = (struct ieee80211_hdr *) skb->data; u8 *target_addr = hdr->addr3; @@ -68,7 +68,7 @@ Signed-off-by: Felix Fietkau if (time_after(jiffies, mpath->exp_time - -@@ -1194,12 +1184,10 @@ int mesh_nexthop_lookup(struct ieee80211 +@@ -1201,12 +1191,10 @@ int mesh_nexthop_lookup(struct ieee80211 memcpy(hdr->addr1, next_hop->sta.addr, ETH_ALEN); memcpy(hdr->addr2, sdata->vif.addr, ETH_ALEN); ieee80211_mps_set_frame_flags(sdata, next_hop, hdr); diff --git a/package/kernel/mac80211/patches/subsys/357-mac80211-optimize-skb-resizing.patch b/package/kernel/mac80211/patches/subsys/357-mac80211-optimize-skb-resizing.patch index a2d53b6007..5d53425f8d 100644 --- a/package/kernel/mac80211/patches/subsys/357-mac80211-optimize-skb-resizing.patch +++ b/package/kernel/mac80211/patches/subsys/357-mac80211-optimize-skb-resizing.patch @@ -36,7 +36,7 @@ Signed-off-by: Felix Fietkau void ieee80211_apply_htcap_overrides(struct ieee80211_sub_if_data *sdata, --- a/net/mac80211/status.c +++ b/net/mac80211/status.c -@@ -672,6 +672,11 @@ void ieee80211_tx_monitor(struct ieee802 +@@ -671,6 +671,11 @@ void ieee80211_tx_monitor(struct ieee802 } } diff --git a/package/kernel/mac80211/patches/subsys/359-mac80211-un-schedule-TXQs-on-powersave-start.patch b/package/kernel/mac80211/patches/subsys/359-mac80211-un-schedule-TXQs-on-powersave-start.patch index 1abb2db7c2..e839376cc1 100644 --- a/package/kernel/mac80211/patches/subsys/359-mac80211-un-schedule-TXQs-on-powersave-start.patch +++ b/package/kernel/mac80211/patches/subsys/359-mac80211-un-schedule-TXQs-on-powersave-start.patch @@ -12,7 +12,7 @@ Signed-off-by: Felix Fietkau --- a/net/mac80211/rx.c +++ b/net/mac80211/rx.c -@@ -1508,7 +1508,15 @@ static void sta_ps_start(struct sta_info +@@ -1507,7 +1507,15 @@ static void sta_ps_start(struct sta_info return; for (tid = 0; tid < ARRAY_SIZE(sta->sta.txq); tid++) { diff --git a/package/kernel/mac80211/patches/subsys/522-mac80211_configure_antenna_gain.patch b/package/kernel/mac80211/patches/subsys/522-mac80211_configure_antenna_gain.patch index 07d2af21cb..82b45b08f9 100644 --- a/package/kernel/mac80211/patches/subsys/522-mac80211_configure_antenna_gain.patch +++ b/package/kernel/mac80211/patches/subsys/522-mac80211_configure_antenna_gain.patch @@ -57,7 +57,7 @@ __NL80211_ATTR_AFTER_LAST, --- a/net/mac80211/cfg.c +++ b/net/mac80211/cfg.c -@@ -2456,6 +2456,19 @@ static int ieee80211_get_tx_power(struct +@@ -2457,6 +2457,19 @@ static int ieee80211_get_tx_power(struct return 0; } @@ -77,7 +77,7 @@ static int ieee80211_set_wds_peer(struct wiphy *wiphy, struct net_device *dev, const u8 *addr) { -@@ -3845,6 +3858,7 @@ const struct cfg80211_ops mac80211_confi +@@ -3846,6 +3859,7 @@ const struct cfg80211_ops mac80211_confi .set_wiphy_params = ieee80211_set_wiphy_params, .set_tx_power = ieee80211_set_tx_power, .get_tx_power = ieee80211_get_tx_power, From 53f3c8819fcb15abf275b9c934aa9ac03876a311 Mon Sep 17 00:00:00 2001 From: Christoph Krapp Date: Mon, 10 Aug 2020 21:22:26 +0200 Subject: [PATCH 03/10] ar71xx: fix ZyXEL NBG6616 wifi switch The device uses a rf-kill switch instead of a button. Furthermore the GPIO is active high. Signed-off-by: Christoph Krapp (cherry picked from commit 0af656e978f1adac4061516d9d2e661e101ba64c) --- target/linux/ar71xx/files/arch/mips/ath79/mach-nbg6716.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/target/linux/ar71xx/files/arch/mips/ath79/mach-nbg6716.c b/target/linux/ar71xx/files/arch/mips/ath79/mach-nbg6716.c index 1c08e53f15..b0fbb78d82 100644 --- a/target/linux/ar71xx/files/arch/mips/ath79/mach-nbg6716.c +++ b/target/linux/ar71xx/files/arch/mips/ath79/mach-nbg6716.c @@ -203,11 +203,11 @@ static struct gpio_keys_button nbg6616_gpio_keys[] __initdata = { }, { .desc = "RFKILL button", - .type = EV_KEY, + .type = EV_SW, .code = KEY_RFKILL, .debounce_interval = NBG6716_KEYS_DEBOUNCE_INTERVAL, .gpio = NBG6716_GPIO_BTN_RFKILL, - .active_low = 1, + .active_low = 0, }, { .desc = "WPS button", From 6d48688828687d1290793b7623e80a247f89bfba Mon Sep 17 00:00:00 2001 From: AmadeusGhost <42570690+AmadeusGhost@users.noreply.github.com> Date: Tue, 11 Aug 2020 19:01:10 +0800 Subject: [PATCH 04/10] rtl88x2bu: build with mac80211 --- package/ctcgfw/rtl88x2bu/Makefile | 31 +++++++++-------- .../patches/001-use-kernel-byteorder.patch | 15 +++++++++ .../rtl88x2bu/patches/020-remove-iwreq.patch | 33 +++++++++++++++++++ 3 files changed, 63 insertions(+), 16 deletions(-) create mode 100644 package/ctcgfw/rtl88x2bu/patches/001-use-kernel-byteorder.patch create mode 100644 package/ctcgfw/rtl88x2bu/patches/020-remove-iwreq.patch diff --git a/package/ctcgfw/rtl88x2bu/Makefile b/package/ctcgfw/rtl88x2bu/Makefile index 2634805082..d53833366f 100644 --- a/package/ctcgfw/rtl88x2bu/Makefile +++ b/package/ctcgfw/rtl88x2bu/Makefile @@ -9,11 +9,11 @@ PKG_LICENSE_FILES:= PKG_SOURCE_URL:=https://github.com/cilynx/rtl88x2bu.git PKG_SOURCE_PROTO:=git -PKG_SOURCE_DATE:=2020-06-05 -PKG_SOURCE_VERSION:=64aa087c5ead11960425125c955dcfe98233202e -PKG_MIRROR_HASH:=3532897af3cd3b327c825708d1c4db750c171647ddeaf21fb003f575f6b1ec82 +PKG_SOURCE_DATE:=2020-07-21 +PKG_SOURCE_VERSION:=a2abcaf523dfab2afeda8cc2cdb5e3c9510fc5f3 +PKG_MIRROR_HASH:=ba79fb9a823a38c5acf22999210645ba881da0b5498ee765383dc5eaa8234e62 -PKG_MAINTAINER:=ElonH +PKG_MAINTAINER:=[CTCGFW] Project OpenWrt PKG_BUILD_PARALLEL:=1 STAMP_CONFIGURED_DEPENDS := $(STAGING_DIR)/usr/include/mac80211-backport/backport/autoconf.h @@ -21,26 +21,24 @@ STAMP_CONFIGURED_DEPENDS := $(STAGING_DIR)/usr/include/mac80211-backport/backpor include $(INCLUDE_DIR)/kernel.mk include $(INCLUDE_DIR)/package.mk -NOSTDINC_FLAGS = \ - -I$(PKG_BUILD_DIR)/include \ - -I$(STAGING_DIR)/usr/include/mac80211-backport/uapi \ - -I$(STAGING_DIR)/usr/include/mac80211-backport \ - -I$(STAGING_DIR)/usr/include/mac80211/uapi \ - -I$(STAGING_DIR)/usr/include/mac80211 \ - -include backport/autoconf.h \ - -include backport/backport.h - -NOSTDINC_FLAGS+=-DCONFIG_IOCTL_CFG80211 -DRTW_USE_CFG80211_STA_EVENT -DCONFIG_CONCURRENT_MODE -DBUILD_OPENWRT - define KernelPackage/rtl88x2bu SUBMENU:=Wireless Drivers TITLE:=Realtek 8812BU/8822BU support - DEPENDS:=+@USB_SUPPORT +@DRIVER_11N_SUPPORT +@DRIVER_11AC_SUPPORT +kmod-mac80211 +kmod-usb-core + DEPENDS:=+kmod-cfg80211 +kmod-usb-core +@DRIVER_11N_SUPPORT +@DRIVER_11AC_SUPPORT FILES:=$(PKG_BUILD_DIR)/rtl88x2bu.ko AUTOLOAD:=$(call AutoProbe,rtl88x2bu) PROVIDES:=kmod-rtl88x2bu endef +NOSTDINC_FLAGS = \ + -I$(PKG_BUILD_DIR) \ + -I$(PKG_BUILD_DIR)/include \ + -I$(STAGING_DIR)/usr/include/mac80211-backport \ + -I$(STAGING_DIR)/usr/include/mac80211-backport/uapi \ + -I$(STAGING_DIR)/usr/include/mac80211 \ + -I$(STAGING_DIR)/usr/include/mac80211/uapi \ + -include backport/backport.h + EXTRA_CFLAGS=-DCONFIG_IOCTL_CFG80211 -DRTW_USE_CFG80211_STA_EVENT -DCONFIG_RADIO_WORK -DCONFIG_CONCURRENT_MODE # CONFIG_IOCTL_CFG80211: If kernel version is after 2.6.35, we recommend user to use the new nl80211 API. @@ -53,6 +51,7 @@ define Build/Compile +$(MAKE) $(PKG_JOBS) -C "$(LINUX_DIR)" \ $(KERNEL_MAKE_FLAGS) \ M="$(PKG_BUILD_DIR)" \ + NOSTDINC_FLAGS="$(NOSTDINC_FLAGS)" \ USER_EXTRA_CFLAGS="$(EXTRA_CFLAGS)" \ CONFIG_RTL8822BU=m \ USER_MODULE_NAME=rtl88x2bu \ diff --git a/package/ctcgfw/rtl88x2bu/patches/001-use-kernel-byteorder.patch b/package/ctcgfw/rtl88x2bu/patches/001-use-kernel-byteorder.patch new file mode 100644 index 0000000000..e75a278339 --- /dev/null +++ b/package/ctcgfw/rtl88x2bu/patches/001-use-kernel-byteorder.patch @@ -0,0 +1,15 @@ +Fix compile problem when rtw_byteorder.h and asm/byteorder.h gets +included in addition for example indirectly, do not use realtek own copy +of the byteorder headers. + +--- a/include/drv_types.h ++++ b/include/drv_types.h +@@ -25,7 +25,7 @@ + #include + #include + #include +-#include ++#include + #include + #include + #include diff --git a/package/ctcgfw/rtl88x2bu/patches/020-remove-iwreq.patch b/package/ctcgfw/rtl88x2bu/patches/020-remove-iwreq.patch new file mode 100644 index 0000000000..ed184e6faf --- /dev/null +++ b/package/ctcgfw/rtl88x2bu/patches/020-remove-iwreq.patch @@ -0,0 +1,33 @@ +diff --git a/include/linux/wireless.h b/include/linux/wireless.h +index c7f4a6c..f7ef486 100644 +--- a/include/linux/wireless.h ++++ b/include/linux/wireless.h +@@ -18,10 +18,11 @@ + + /***************************** INCLUDES *****************************/ + +-#if 0 ++#if 1 + #include /* for __u* and __s* typedefs */ + #include /* for "struct sockaddr" et al */ + #include /* for IFNAMSIZ and co... */ ++ #include + #else + #define __user + /* typedef uint16_t __u16; */ +@@ -37,6 +38,8 @@ struct compat_iw_point { + __u16 flags; + }; + #endif ++ ++#if 0 + /* --------------------------- SUBTYPES --------------------------- */ + /* + * For all data larger than 16 octets, we need to use a +@@ -83,5 +86,6 @@ struct iwreq { + /* Data part (defined just above) */ + union iwreq_data u; + }; ++#endif + + #endif /* _LINUX_WIRELESS_H */ From 7ad50134075919984217aa4d355533b30c073832 Mon Sep 17 00:00:00 2001 From: AmadeusGhost <42570690+AmadeusGhost@users.noreply.github.com> Date: Tue, 11 Aug 2020 19:02:00 +0800 Subject: [PATCH 05/10] rtl8821cu: build with mac80211 --- package/ctcgfw/rtl8821cu/Makefile | 29 ++++++++-------- .../patches/001-use-kernel-byteorder.patch | 15 +++++++++ .../020-compatible-with-kernel-5.4.patch | 13 -------- .../rtl8821cu/patches/020-remove-iwreq.patch | 33 +++++++++++++++++++ ...c.patch => 030-fix-build-on-powerpc.patch} | 0 .../rtl8821cu/patches/040-wireless-5.x.patch | 27 +++++++++++++++ 6 files changed, 89 insertions(+), 28 deletions(-) create mode 100644 package/ctcgfw/rtl8821cu/patches/001-use-kernel-byteorder.patch delete mode 100644 package/ctcgfw/rtl8821cu/patches/020-compatible-with-kernel-5.4.patch create mode 100644 package/ctcgfw/rtl8821cu/patches/020-remove-iwreq.patch rename package/ctcgfw/rtl8821cu/patches/{010-fix-build-on-powerpc.patch => 030-fix-build-on-powerpc.patch} (100%) create mode 100644 package/ctcgfw/rtl8821cu/patches/040-wireless-5.x.patch diff --git a/package/ctcgfw/rtl8821cu/Makefile b/package/ctcgfw/rtl8821cu/Makefile index 7287b990b1..58457eb336 100644 --- a/package/ctcgfw/rtl8821cu/Makefile +++ b/package/ctcgfw/rtl8821cu/Makefile @@ -15,9 +15,9 @@ PKG_LICENSE:=GPLv3 PKG_SOURCE_URL:=https://github.com/brektrou/rtl8821CU.git PKG_SOURCE_PROTO:=git -PKG_SOURCE_DATE:=2020-03-02 -PKG_SOURCE_VERSION:=7756a7ab6b4dfd105d36d8433a72802ac0620d53 -PKG_MIRROR_HASH:=4e9ac6bcedc0d3fc7d4b44be2076d6b9838d404ce0b8a8158b12287e9c0f53b6 +PKG_SOURCE_DATE:=2020-07-27 +PKG_SOURCE_VERSION:=93b04bfcd293fdd7d98d5a7c964ae9416a40159c +PKG_MIRROR_HASH:=0b0c12c69efa680481abc3a7703a1a224f7fcd6271f8eb3c038fbaef02945bfa PKG_MAINTAINER:=[CTCGFW] Project OpenWrt PKG_BUILD_PARALLEL:=1 @@ -27,21 +27,10 @@ STAMP_CONFIGURED_DEPENDS := $(STAGING_DIR)/usr/include/mac80211-backport/backpor include $(INCLUDE_DIR)/kernel.mk include $(INCLUDE_DIR)/package.mk -NOSTDINC_FLAGS = \ - -I$(PKG_BUILD_DIR)/include \ - -I$(STAGING_DIR)/usr/include/mac80211-backport/uapi \ - -I$(STAGING_DIR)/usr/include/mac80211-backport \ - -I$(STAGING_DIR)/usr/include/mac80211/uapi \ - -I$(STAGING_DIR)/usr/include/mac80211 \ - -include backport/autoconf.h \ - -include backport/backport.h - -NOSTDINC_FLAGS+=-DCONFIG_IOCTL_CFG80211 -DRTW_USE_CFG80211_STA_EVENT -DCONFIG_CONCURRENT_MODE -DBUILD_OPENWRT - define KernelPackage/rtl8821cu SUBMENU:=Wireless Drivers TITLE:=Realtek rtl8821cu Support - DEPENDS:=+@USB_SUPPORT +@DRIVER_11N_SUPPORT +@DRIVER_11AC_SUPPORT +kmod-mac80211 +kmod-usb-core + DEPENDS:=+kmod-cfg80211 +kmod-usb-core +@DRIVER_11N_SUPPORT +@DRIVER_11AC_SUPPORT FILES:=$(PKG_BUILD_DIR)/rtl8821cu.ko AUTOLOAD:=$(call AutoProbe,rtl8821cu) PROVIDES:=kmod-rtl8821cu @@ -51,6 +40,15 @@ define KernelPackage/rtl8821cu/description Kernel module for rtl8821cu wireless module. endef +NOSTDINC_FLAGS = \ + -I$(PKG_BUILD_DIR) \ + -I$(PKG_BUILD_DIR)/include \ + -I$(STAGING_DIR)/usr/include/mac80211-backport \ + -I$(STAGING_DIR)/usr/include/mac80211-backport/uapi \ + -I$(STAGING_DIR)/usr/include/mac80211 \ + -I$(STAGING_DIR)/usr/include/mac80211/uapi \ + -include backport/backport.h + EXTRA_KCONFIG:=\ CONFIG_RTL8821CU=m \ USER_MODULE_NAME=rtl8821cu @@ -76,6 +74,7 @@ endif MAKE_OPTS:= \ $(KERNEL_MAKE_FLAGS) \ M="$(PKG_BUILD_DIR)" \ + NOSTDINC_FLAGS="$(NOSTDINC_FLAGS)" \ USER_EXTRA_CFLAGS="$(EXTRA_CFLAGS)" \ $(EXTRA_KCONFIG) diff --git a/package/ctcgfw/rtl8821cu/patches/001-use-kernel-byteorder.patch b/package/ctcgfw/rtl8821cu/patches/001-use-kernel-byteorder.patch new file mode 100644 index 0000000000..e75a278339 --- /dev/null +++ b/package/ctcgfw/rtl8821cu/patches/001-use-kernel-byteorder.patch @@ -0,0 +1,15 @@ +Fix compile problem when rtw_byteorder.h and asm/byteorder.h gets +included in addition for example indirectly, do not use realtek own copy +of the byteorder headers. + +--- a/include/drv_types.h ++++ b/include/drv_types.h +@@ -25,7 +25,7 @@ + #include + #include + #include +-#include ++#include + #include + #include + #include diff --git a/package/ctcgfw/rtl8821cu/patches/020-compatible-with-kernel-5.4.patch b/package/ctcgfw/rtl8821cu/patches/020-compatible-with-kernel-5.4.patch deleted file mode 100644 index a6f5344843..0000000000 --- a/package/ctcgfw/rtl8821cu/patches/020-compatible-with-kernel-5.4.patch +++ /dev/null @@ -1,13 +0,0 @@ -diff --git a/os_dep/linux/os_intfs.c b/os_dep/linux/os_intfs.c -index 345af67..54a07db 100644 ---- a/os_dep/linux/os_intfs.c -+++ b/os_dep/linux/os_intfs.c -@@ -1562,7 +1562,7 @@ static u16 rtw_select_queue(struct net_device *dev, struct sk_buff *skb - #else - , void *accel_priv - #endif -- #if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 14, 0) -+ #if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 14, 0) && LINUX_VERSION_CODE < KERNEL_VERSION(5, 2, 0) - , select_queue_fallback_t fallback - #endif - #endif diff --git a/package/ctcgfw/rtl8821cu/patches/020-remove-iwreq.patch b/package/ctcgfw/rtl8821cu/patches/020-remove-iwreq.patch new file mode 100644 index 0000000000..ed184e6faf --- /dev/null +++ b/package/ctcgfw/rtl8821cu/patches/020-remove-iwreq.patch @@ -0,0 +1,33 @@ +diff --git a/include/linux/wireless.h b/include/linux/wireless.h +index c7f4a6c..f7ef486 100644 +--- a/include/linux/wireless.h ++++ b/include/linux/wireless.h +@@ -18,10 +18,11 @@ + + /***************************** INCLUDES *****************************/ + +-#if 0 ++#if 1 + #include /* for __u* and __s* typedefs */ + #include /* for "struct sockaddr" et al */ + #include /* for IFNAMSIZ and co... */ ++ #include + #else + #define __user + /* typedef uint16_t __u16; */ +@@ -37,6 +38,8 @@ struct compat_iw_point { + __u16 flags; + }; + #endif ++ ++#if 0 + /* --------------------------- SUBTYPES --------------------------- */ + /* + * For all data larger than 16 octets, we need to use a +@@ -83,5 +86,6 @@ struct iwreq { + /* Data part (defined just above) */ + union iwreq_data u; + }; ++#endif + + #endif /* _LINUX_WIRELESS_H */ diff --git a/package/ctcgfw/rtl8821cu/patches/010-fix-build-on-powerpc.patch b/package/ctcgfw/rtl8821cu/patches/030-fix-build-on-powerpc.patch similarity index 100% rename from package/ctcgfw/rtl8821cu/patches/010-fix-build-on-powerpc.patch rename to package/ctcgfw/rtl8821cu/patches/030-fix-build-on-powerpc.patch diff --git a/package/ctcgfw/rtl8821cu/patches/040-wireless-5.x.patch b/package/ctcgfw/rtl8821cu/patches/040-wireless-5.x.patch new file mode 100644 index 0000000000..a2af2c5b32 --- /dev/null +++ b/package/ctcgfw/rtl8821cu/patches/040-wireless-5.x.patch @@ -0,0 +1,27 @@ +diff --git a/os_dep/linux/os_intfs.c b/os_dep/linux/os_intfs.c +index c4b5157..cdb9388 100755 +--- a/os_dep/linux/os_intfs.c ++++ b/os_dep/linux/os_intfs.c +@@ -1302,6 +1302,14 @@ unsigned int rtw_classify8021d(struct sk_buff *skb) + } + + ++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,19,0)) ++static u16 rtw_select_queue(struct net_device *dev, struct sk_buff *skb ++ , struct net_device *sb_dev ++ #if (LINUX_VERSION_CODE < KERNEL_VERSION(5,2,0)) ++ , select_queue_fallback_t fallback ++ #endif ++) ++#else + static u16 rtw_select_queue(struct net_device *dev, struct sk_buff *skb + #if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 13, 0) + , void *accel_priv +@@ -1310,6 +1318,7 @@ static u16 rtw_select_queue(struct net_device *dev, struct sk_buff *skb + #endif + #endif + ) ++#endif + { + _adapter *padapter = rtw_netdev_priv(dev); + struct mlme_priv *pmlmepriv = &padapter->mlmepriv; From bdc50d7088a61049d8f94506cd94a5f8c56ec2d6 Mon Sep 17 00:00:00 2001 From: CN_SZTL Date: Tue, 11 Aug 2020 22:33:49 +0800 Subject: [PATCH 06/10] kernel: bump 4.19 to 4.19.139 Resolve conflicted: - 950-0259-lan78xx-Debounce-link-events-to-minimize-poll-storm.patch Refreshed all patches. Compile-test-on: bcm27xx Signed-off-by: CN_SZTL --- include/kernel-version.mk | 4 +- ...mware-loader-for-uPD720201-and-uPD72.patch | 6 +- .../802-usb-xhci-force-msi-renesas-xhci.patch | 2 +- ...8xx-Enable-LEDs-and-auto-negotiation.patch | 6 +- ...78xx-Read-initial-EEE-status-from-DT.patch | 2 +- ...Disable-TCP-Segmentation-Offload-TSO.patch | 4 +- ...e-enabling-of-EEE-into-PHY-init-code.patch | 4 +- ...e-link-events-to-minimize-poll-storm.patch | 18 +- ...xx-EEE-support-is-now-a-PHY-property.patch | 2 +- ...use-default-alignment-for-rx-buffers.patch | 2 +- ...Show-that-the-VIA-VL805-supports-LPM.patch | 4 +- ...or-host-controllers-that-don-t-updat.patch | 4 +- ...40-crypto-qce-switch-to-skcipher-API.patch | 1018 +++++++++++++---- ...ce-fix-ctr-aes-qce-block-chunk-sizes.patch | 6 +- ...crypto-qce-fix-xts-aes-qce-key-sizes.patch | 8 +- ...-save-a-sg-table-slot-for-result-buf.patch | 14 +- ...44-crypto-qce-update-the-skcipher-IV.patch | 6 +- ...qce-initialize-fallback-only-for-AES.patch | 6 +- ...e-use-cryptlen-when-adding-extra-sgl.patch | 14 +- ...-use-AES-fallback-for-small-requests.patch | 16 +- ...-handle-AES-XTS-cases-that-qce-fails.patch | 8 +- ...e-allow-building-only-hashes-ciphers.patch | 29 +- .../0001-eth-sync-from-mtk-lede.patch | 10 +- 23 files changed, 832 insertions(+), 361 deletions(-) diff --git a/include/kernel-version.mk b/include/kernel-version.mk index 62c427cef2..31eb64eaf3 100644 --- a/include/kernel-version.mk +++ b/include/kernel-version.mk @@ -8,11 +8,11 @@ endif LINUX_VERSION-4.9 = .232 LINUX_VERSION-4.14 = .193 -LINUX_VERSION-4.19 = .138 +LINUX_VERSION-4.19 = .139 LINUX_KERNEL_HASH-4.9.232 = 58f472e82345dc719a1d6d7bae01e5aa73387cd83308acd2c92371f7d5bc4f60 LINUX_KERNEL_HASH-4.14.193 = 0b0fb41d4430e1a42738b341cbfd2f41951aa5cd02acabbd53f076119c8b9f03 -LINUX_KERNEL_HASH-4.19.138 = d15c27d05f6c527269b75b30cc72972748e55720e7e00ad8abbaa4fe3b1d5e02 +LINUX_KERNEL_HASH-4.19.139 = 9c4ebf21fe949f80fbcfbbd6e7fe181040d325e89475e230ab53ef01f9d55605 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/apm821xx/patches-4.19/801-usb-xhci-add-firmware-loader-for-uPD720201-and-uPD72.patch b/target/linux/apm821xx/patches-4.19/801-usb-xhci-add-firmware-loader-for-uPD720201-and-uPD72.patch index e5000c911f..950c810da3 100644 --- a/target/linux/apm821xx/patches-4.19/801-usb-xhci-add-firmware-loader-for-uPD720201-and-uPD72.patch +++ b/target/linux/apm821xx/patches-4.19/801-usb-xhci-add-firmware-loader-for-uPD720201-and-uPD72.patch @@ -44,7 +44,7 @@ Signed-off-by: Christian Lamparter #include "xhci.h" #include "xhci-trace.h" -@@ -268,6 +270,458 @@ static void xhci_pme_acpi_rtd3_enable(st +@@ -272,6 +274,458 @@ static void xhci_pme_acpi_rtd3_enable(st static void xhci_pme_acpi_rtd3_enable(struct pci_dev *dev) { } #endif /* CONFIG_ACPI */ @@ -503,7 +503,7 @@ Signed-off-by: Christian Lamparter /* called during probe() after chip reset completes */ static int xhci_pci_setup(struct usb_hcd *hcd) { -@@ -309,6 +763,22 @@ static int xhci_pci_probe(struct pci_dev +@@ -313,6 +767,22 @@ static int xhci_pci_probe(struct pci_dev struct hc_driver *driver; struct usb_hcd *hcd; @@ -526,7 +526,7 @@ Signed-off-by: Christian Lamparter driver = (struct hc_driver *)id->driver_data; /* Prevent runtime suspending between USB-2 and USB-3 initialization */ -@@ -367,6 +837,16 @@ static void xhci_pci_remove(struct pci_d +@@ -371,6 +841,16 @@ static void xhci_pci_remove(struct pci_d { struct xhci_hcd *xhci; diff --git a/target/linux/apm821xx/patches-4.19/802-usb-xhci-force-msi-renesas-xhci.patch b/target/linux/apm821xx/patches-4.19/802-usb-xhci-force-msi-renesas-xhci.patch index 8ada844214..3f58377d4e 100644 --- a/target/linux/apm821xx/patches-4.19/802-usb-xhci-force-msi-renesas-xhci.patch +++ b/target/linux/apm821xx/patches-4.19/802-usb-xhci-force-msi-renesas-xhci.patch @@ -13,7 +13,7 @@ produce a noisy warning. --- a/drivers/usb/host/xhci-pci.c +++ b/drivers/usb/host/xhci-pci.c -@@ -218,6 +218,7 @@ static void xhci_pci_quirks(struct devic +@@ -221,6 +221,7 @@ static void xhci_pci_quirks(struct devic pdev->device == 0x0015) { xhci->quirks |= XHCI_RESET_ON_RESUME; xhci->quirks |= XHCI_ZERO_64B_REGS; diff --git a/target/linux/bcm27xx/patches-4.19/950-0032-lan78xx-Enable-LEDs-and-auto-negotiation.patch b/target/linux/bcm27xx/patches-4.19/950-0032-lan78xx-Enable-LEDs-and-auto-negotiation.patch index 4f7bde1885..3f59db2cbe 100644 --- a/target/linux/bcm27xx/patches-4.19/950-0032-lan78xx-Enable-LEDs-and-auto-negotiation.patch +++ b/target/linux/bcm27xx/patches-4.19/950-0032-lan78xx-Enable-LEDs-and-auto-negotiation.patch @@ -14,7 +14,7 @@ Signed-off-by: Phil Elwell --- a/drivers/net/usb/lan78xx.c +++ b/drivers/net/usb/lan78xx.c -@@ -2477,6 +2477,11 @@ static int lan78xx_reset(struct lan78xx_ +@@ -2473,6 +2473,11 @@ static int lan78xx_reset(struct lan78xx_ int ret = 0; unsigned long timeout; u8 sig; @@ -26,7 +26,7 @@ Signed-off-by: Phil Elwell ret = lan78xx_read_reg(dev, HW_CFG, &buf); buf |= HW_CFG_LRST_; -@@ -2530,6 +2535,9 @@ static int lan78xx_reset(struct lan78xx_ +@@ -2526,6 +2531,9 @@ static int lan78xx_reset(struct lan78xx_ ret = lan78xx_read_reg(dev, HW_CFG, &buf); buf |= HW_CFG_MEF_; @@ -36,7 +36,7 @@ Signed-off-by: Phil Elwell ret = lan78xx_write_reg(dev, HW_CFG, buf); ret = lan78xx_read_reg(dev, USB_CFG0, &buf); -@@ -2585,6 +2593,9 @@ static int lan78xx_reset(struct lan78xx_ +@@ -2581,6 +2589,9 @@ static int lan78xx_reset(struct lan78xx_ buf |= MAC_CR_AUTO_DUPLEX_ | MAC_CR_AUTO_SPEED_; } } diff --git a/target/linux/bcm27xx/patches-4.19/950-0120-lan78xx-Read-initial-EEE-status-from-DT.patch b/target/linux/bcm27xx/patches-4.19/950-0120-lan78xx-Read-initial-EEE-status-from-DT.patch index b5e688c3bf..7aa3c7e745 100644 --- a/target/linux/bcm27xx/patches-4.19/950-0120-lan78xx-Read-initial-EEE-status-from-DT.patch +++ b/target/linux/bcm27xx/patches-4.19/950-0120-lan78xx-Read-initial-EEE-status-from-DT.patch @@ -15,7 +15,7 @@ Signed-off-by: Phil Elwell --- a/drivers/net/usb/lan78xx.c +++ b/drivers/net/usb/lan78xx.c -@@ -2659,6 +2659,22 @@ static int lan78xx_open(struct net_devic +@@ -2655,6 +2655,22 @@ static int lan78xx_open(struct net_devic netif_dbg(dev, ifup, dev->net, "phy initialised successfully"); diff --git a/target/linux/bcm27xx/patches-4.19/950-0127-net-lan78xx-Disable-TCP-Segmentation-Offload-TSO.patch b/target/linux/bcm27xx/patches-4.19/950-0127-net-lan78xx-Disable-TCP-Segmentation-Offload-TSO.patch index bd9987d8ad..2b39efa03b 100644 --- a/target/linux/bcm27xx/patches-4.19/950-0127-net-lan78xx-Disable-TCP-Segmentation-Offload-TSO.patch +++ b/target/linux/bcm27xx/patches-4.19/950-0127-net-lan78xx-Disable-TCP-Segmentation-Offload-TSO.patch @@ -21,7 +21,7 @@ Signed-off-by: Dave Stevenson --- a/drivers/net/usb/lan78xx.c +++ b/drivers/net/usb/lan78xx.c -@@ -440,6 +440,15 @@ static int msg_level = -1; +@@ -436,6 +436,15 @@ static int msg_level = -1; module_param(msg_level, int, 0); MODULE_PARM_DESC(msg_level, "Override default message level"); @@ -37,7 +37,7 @@ Signed-off-by: Dave Stevenson static int lan78xx_read_reg(struct lan78xx_net *dev, u32 index, u32 *data) { u32 *buf = kmalloc(sizeof(u32), GFP_KERNEL); -@@ -3010,8 +3019,14 @@ static int lan78xx_bind(struct lan78xx_n +@@ -2940,8 +2949,14 @@ static int lan78xx_bind(struct lan78xx_n if (DEFAULT_RX_CSUM_ENABLE) dev->net->features |= NETIF_F_RXCSUM; diff --git a/target/linux/bcm27xx/patches-4.19/950-0128-lan78xx-Move-enabling-of-EEE-into-PHY-init-code.patch b/target/linux/bcm27xx/patches-4.19/950-0128-lan78xx-Move-enabling-of-EEE-into-PHY-init-code.patch index 2b1a3c1ab7..9685f43ee4 100644 --- a/target/linux/bcm27xx/patches-4.19/950-0128-lan78xx-Move-enabling-of-EEE-into-PHY-init-code.patch +++ b/target/linux/bcm27xx/patches-4.19/950-0128-lan78xx-Move-enabling-of-EEE-into-PHY-init-code.patch @@ -16,7 +16,7 @@ Signed-off-by: Phil Elwell --- a/drivers/net/usb/lan78xx.c +++ b/drivers/net/usb/lan78xx.c -@@ -2191,6 +2191,22 @@ static int lan78xx_phy_init(struct lan78 +@@ -2187,6 +2187,22 @@ static int lan78xx_phy_init(struct lan78 mii_adv = (u32)mii_advertise_flowctrl(dev->fc_request_control); phydev->advertising |= mii_adv_to_ethtool_adv_t(mii_adv); @@ -39,7 +39,7 @@ Signed-off-by: Phil Elwell if (phydev->mdio.dev.of_node) { u32 reg; int len; -@@ -2668,22 +2684,6 @@ static int lan78xx_open(struct net_devic +@@ -2664,22 +2680,6 @@ static int lan78xx_open(struct net_devic netif_dbg(dev, ifup, dev->net, "phy initialised successfully"); diff --git a/target/linux/bcm27xx/patches-4.19/950-0259-lan78xx-Debounce-link-events-to-minimize-poll-storm.patch b/target/linux/bcm27xx/patches-4.19/950-0259-lan78xx-Debounce-link-events-to-minimize-poll-storm.patch index 33fde5fc6f..1929a882ee 100644 --- a/target/linux/bcm27xx/patches-4.19/950-0259-lan78xx-Debounce-link-events-to-minimize-poll-storm.patch +++ b/target/linux/bcm27xx/patches-4.19/950-0259-lan78xx-Debounce-link-events-to-minimize-poll-storm.patch @@ -16,7 +16,7 @@ See: https://github.com/raspberrypi/linux/issues/2447 --- a/drivers/net/usb/lan78xx.c +++ b/drivers/net/usb/lan78xx.c -@@ -449,6 +449,11 @@ static bool enable_tso; +@@ -445,6 +445,11 @@ static bool enable_tso; module_param(enable_tso, bool, 0644); MODULE_PARM_DESC(enable_tso, "Enables TCP segmentation offload"); @@ -28,17 +28,17 @@ See: https://github.com/raspberrypi/linux/issues/2447 static int lan78xx_read_reg(struct lan78xx_net *dev, u32 index, u32 *data) { u32 *buf = kmalloc(sizeof(u32), GFP_KERNEL); -@@ -3843,7 +3848,12 @@ static int lan78xx_probe(struct usb_inte - dev->pipe_intr = usb_rcvintpipe(dev->udev, - dev->ep_intr->desc.bEndpointAddress & - USB_ENDPOINT_NUMBER_MASK); -- period = dev->ep_intr->desc.bInterval; +@@ -3787,7 +3792,12 @@ static int lan78xx_probe(struct usb_inte + netdev->max_mtu = MAX_SINGLE_PACKET_SIZE; + netif_set_gso_max_size(netdev, MAX_SINGLE_PACKET_SIZE - MAX_HEADER); + +- period = ep_intr->desc.bInterval; + if (int_urb_interval_ms <= 0) -+ period = dev->ep_intr->desc.bInterval; ++ period = ep_intr->desc.bInterval; + else + period = int_urb_interval_ms * INT_URB_MICROFRAMES_PER_MS; -+ + netif_notice(dev, probe, netdev, "int urb period %d\n", period); - ++ maxp = usb_maxpacket(dev->udev, dev->pipe_intr, 0); buf = kmalloc(maxp, GFP_KERNEL); + if (buf) { diff --git a/target/linux/bcm27xx/patches-4.19/950-0316-lan78xx-EEE-support-is-now-a-PHY-property.patch b/target/linux/bcm27xx/patches-4.19/950-0316-lan78xx-EEE-support-is-now-a-PHY-property.patch index b37640dbed..b387136beb 100644 --- a/target/linux/bcm27xx/patches-4.19/950-0316-lan78xx-EEE-support-is-now-a-PHY-property.patch +++ b/target/linux/bcm27xx/patches-4.19/950-0316-lan78xx-EEE-support-is-now-a-PHY-property.patch @@ -15,7 +15,7 @@ Signed-off-by: Phil Elwell --- a/drivers/net/usb/lan78xx.c +++ b/drivers/net/usb/lan78xx.c -@@ -2196,7 +2196,7 @@ static int lan78xx_phy_init(struct lan78 +@@ -2192,7 +2192,7 @@ static int lan78xx_phy_init(struct lan78 mii_adv = (u32)mii_advertise_flowctrl(dev->fc_request_control); phydev->advertising |= mii_adv_to_ethtool_adv_t(mii_adv); diff --git a/target/linux/bcm27xx/patches-4.19/950-0413-lan78xx-use-default-alignment-for-rx-buffers.patch b/target/linux/bcm27xx/patches-4.19/950-0413-lan78xx-use-default-alignment-for-rx-buffers.patch index 6b93888db9..9700c2c09f 100644 --- a/target/linux/bcm27xx/patches-4.19/950-0413-lan78xx-use-default-alignment-for-rx-buffers.patch +++ b/target/linux/bcm27xx/patches-4.19/950-0413-lan78xx-use-default-alignment-for-rx-buffers.patch @@ -12,7 +12,7 @@ in both dwc_otg and in ipv6 processing. --- a/drivers/net/usb/lan78xx.c +++ b/drivers/net/usb/lan78xx.c -@@ -3257,7 +3257,7 @@ static int rx_submit(struct lan78xx_net +@@ -3187,7 +3187,7 @@ static int rx_submit(struct lan78xx_net size_t size = dev->rx_urb_size; int ret = 0; diff --git a/target/linux/bcm27xx/patches-4.19/950-0476-usb-xhci-Show-that-the-VIA-VL805-supports-LPM.patch b/target/linux/bcm27xx/patches-4.19/950-0476-usb-xhci-Show-that-the-VIA-VL805-supports-LPM.patch index 69b0ffbf9e..694bf90a00 100644 --- a/target/linux/bcm27xx/patches-4.19/950-0476-usb-xhci-Show-that-the-VIA-VL805-supports-LPM.patch +++ b/target/linux/bcm27xx/patches-4.19/950-0476-usb-xhci-Show-that-the-VIA-VL805-supports-LPM.patch @@ -10,7 +10,7 @@ Signed-off-by: Phil Elwell --- a/drivers/usb/host/xhci-pci.c +++ b/drivers/usb/host/xhci-pci.c -@@ -225,6 +225,10 @@ static void xhci_pci_quirks(struct devic +@@ -228,6 +228,10 @@ static void xhci_pci_quirks(struct devic pdev->device == 0x3432) xhci->quirks |= XHCI_BROKEN_STREAMS; @@ -19,5 +19,5 @@ Signed-off-by: Phil Elwell + xhci->quirks |= XHCI_LPM_SUPPORT; + if (pdev->vendor == PCI_VENDOR_ID_ASMEDIA && - pdev->device == 0x1042) + pdev->device == PCI_DEVICE_ID_ASMEDIA_1042_XHCI) xhci->quirks |= XHCI_BROKEN_STREAMS; diff --git a/target/linux/bcm27xx/patches-4.19/950-0609-xhci-add-quirk-for-host-controllers-that-don-t-updat.patch b/target/linux/bcm27xx/patches-4.19/950-0609-xhci-add-quirk-for-host-controllers-that-don-t-updat.patch index 011a1eceba..29dc71d95f 100644 --- a/target/linux/bcm27xx/patches-4.19/950-0609-xhci-add-quirk-for-host-controllers-that-don-t-updat.patch +++ b/target/linux/bcm27xx/patches-4.19/950-0609-xhci-add-quirk-for-host-controllers-that-don-t-updat.patch @@ -23,7 +23,7 @@ Signed-off-by: Jonathan Bell --- a/drivers/usb/host/xhci-pci.c +++ b/drivers/usb/host/xhci-pci.c -@@ -226,8 +226,10 @@ static void xhci_pci_quirks(struct devic +@@ -229,8 +229,10 @@ static void xhci_pci_quirks(struct devic xhci->quirks |= XHCI_BROKEN_STREAMS; if (pdev->vendor == PCI_VENDOR_ID_VIA && @@ -34,7 +34,7 @@ Signed-off-by: Jonathan Bell + } if (pdev->vendor == PCI_VENDOR_ID_ASMEDIA && - pdev->device == 0x1042) + pdev->device == PCI_DEVICE_ID_ASMEDIA_1042_XHCI) --- a/drivers/usb/host/xhci-ring.c +++ b/drivers/usb/host/xhci-ring.c @@ -520,7 +520,10 @@ void xhci_find_new_dequeue_state(struct diff --git a/target/linux/ipq40xx/patches-4.19/040-crypto-qce-switch-to-skcipher-API.patch b/target/linux/ipq40xx/patches-4.19/040-crypto-qce-switch-to-skcipher-API.patch index 2adfe622e3..f13f614fd4 100644 --- a/target/linux/ipq40xx/patches-4.19/040-crypto-qce-switch-to-skcipher-API.patch +++ b/target/linux/ipq40xx/patches-4.19/040-crypto-qce-switch-to-skcipher-API.patch @@ -17,8 +17,6 @@ Reviewed-by: Stanimir Varbanov Signed-off-by: Ard Biesheuvel Backported-to-4.19-by: Eneas U de Queiroz -diff --git a/drivers/crypto/qce/Makefile b/drivers/crypto/qce/Makefile -index 19a7f899acff..8caa04e1ec43 100644 --- a/drivers/crypto/qce/Makefile +++ b/drivers/crypto/qce/Makefile @@ -4,4 +4,4 @@ qcrypto-objs := core.o \ @@ -27,8 +25,6 @@ index 19a7f899acff..8caa04e1ec43 100644 sha.o \ - ablkcipher.o + skcipher.o -diff --git a/drivers/crypto/qce/cipher.h b/drivers/crypto/qce/cipher.h -index 2b0278bb6e92..f93fab1dd1ff 100644 --- a/drivers/crypto/qce/cipher.h +++ b/drivers/crypto/qce/cipher.h @@ -53,12 +53,12 @@ struct qce_cipher_reqctx { @@ -48,11 +44,9 @@ index 2b0278bb6e92..f93fab1dd1ff 100644 +extern const struct qce_algo_ops skcipher_ops; #endif /* _CIPHER_H_ */ -diff --git a/drivers/crypto/qce/common.c b/drivers/crypto/qce/common.c -index 1fb5fde7fc03..e0202755682b 100644 --- a/drivers/crypto/qce/common.c +++ b/drivers/crypto/qce/common.c -@@ -312,13 +312,13 @@ static int qce_setup_regs_ahash(struct crypto_async_request *async_req, +@@ -312,13 +312,13 @@ go_proc: return 0; } @@ -70,7 +64,7 @@ index 1fb5fde7fc03..e0202755682b 100644 struct qce_device *qce = tmpl->qce; __be32 enckey[QCE_MAX_CIPHER_KEY_SIZE / sizeof(__be32)] = {0}; __be32 enciv[QCE_MAX_IV_SIZE / sizeof(__be32)] = {0}; -@@ -397,8 +397,8 @@ int qce_start(struct crypto_async_request *async_req, u32 type, u32 totallen, +@@ -397,8 +397,8 @@ int qce_start(struct crypto_async_reques u32 offset) { switch (type) { @@ -81,8 +75,6 @@ index 1fb5fde7fc03..e0202755682b 100644 case CRYPTO_ALG_TYPE_AHASH: return qce_setup_regs_ahash(async_req, totallen, offset); default: -diff --git a/drivers/crypto/qce/common.h b/drivers/crypto/qce/common.h -index a4addd4f7d6c..3252efa41e7a 100644 --- a/drivers/crypto/qce/common.h +++ b/drivers/crypto/qce/common.h @@ -18,6 +18,7 @@ @@ -102,8 +94,6 @@ index a4addd4f7d6c..3252efa41e7a 100644 struct ahash_alg ahash; } alg; struct qce_device *qce; -diff --git a/drivers/crypto/qce/core.c b/drivers/crypto/qce/core.c -index 1c3b36b75467..bf409edc23ab 100644 --- a/drivers/crypto/qce/core.c +++ b/drivers/crypto/qce/core.c @@ -30,7 +30,7 @@ @@ -115,248 +105,371 @@ index 1c3b36b75467..bf409edc23ab 100644 &ahash_ops, }; -diff --git a/drivers/crypto/qce/ablkcipher.c b/drivers/crypto/qce/skcipher.c -similarity index 62% -rename from drivers/crypto/qce/ablkcipher.c -rename to drivers/crypto/qce/skcipher.c -index 3658c46ef9c7..0376bb969834 100644 --- a/drivers/crypto/qce/ablkcipher.c -+++ b/drivers/crypto/qce/skcipher.c -@@ -20,14 +20,14 @@ - - #include "cipher.h" - ++++ /dev/null +@@ -1,431 +0,0 @@ +-/* +- * Copyright (c) 2010-2014, The Linux Foundation. All rights reserved. +- * +- * This program is free software; you can redistribute it and/or modify +- * it under the terms of the GNU General Public License version 2 and +- * only version 2 as published by the Free Software Foundation. +- * +- * This program is distributed in the hope that it will be useful, +- * but WITHOUT ANY WARRANTY; without even the implied warranty of +- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +- * GNU General Public License for more details. +- */ +- +-#include +-#include +-#include +-#include +-#include +-#include +- +-#include "cipher.h" +- -static LIST_HEAD(ablkcipher_algs); -+static LIST_HEAD(skcipher_algs); - +- -static void qce_ablkcipher_done(void *data) -+static void qce_skcipher_done(void *data) - { - struct crypto_async_request *async_req = data; +-{ +- struct crypto_async_request *async_req = data; - struct ablkcipher_request *req = ablkcipher_request_cast(async_req); - struct qce_cipher_reqctx *rctx = ablkcipher_request_ctx(req); - struct qce_alg_template *tmpl = to_cipher_tmpl(async_req->tfm); -+ struct skcipher_request *req = skcipher_request_cast(async_req); -+ struct qce_cipher_reqctx *rctx = skcipher_request_ctx(req); -+ struct qce_alg_template *tmpl = to_cipher_tmpl(crypto_skcipher_reqtfm(req)); - struct qce_device *qce = tmpl->qce; - enum dma_data_direction dir_src, dir_dst; - u32 status; -@@ -40,7 +40,7 @@ static void qce_ablkcipher_done(void *data) - - error = qce_dma_terminate_all(&qce->dma); - if (error) +- struct qce_device *qce = tmpl->qce; +- enum dma_data_direction dir_src, dir_dst; +- u32 status; +- int error; +- bool diff_dst; +- +- diff_dst = (req->src != req->dst) ? true : false; +- dir_src = diff_dst ? DMA_TO_DEVICE : DMA_BIDIRECTIONAL; +- dir_dst = diff_dst ? DMA_FROM_DEVICE : DMA_BIDIRECTIONAL; +- +- error = qce_dma_terminate_all(&qce->dma); +- if (error) - dev_dbg(qce->dev, "ablkcipher dma termination error (%d)\n", -+ dev_dbg(qce->dev, "skcipher dma termination error (%d)\n", - error); - - if (diff_dst) -@@ -51,18 +51,18 @@ static void qce_ablkcipher_done(void *data) - - error = qce_check_status(qce, &status); - if (error < 0) +- error); +- +- if (diff_dst) +- dma_unmap_sg(qce->dev, rctx->src_sg, rctx->src_nents, dir_src); +- dma_unmap_sg(qce->dev, rctx->dst_sg, rctx->dst_nents, dir_dst); +- +- sg_free_table(&rctx->dst_tbl); +- +- error = qce_check_status(qce, &status); +- if (error < 0) - dev_dbg(qce->dev, "ablkcipher operation error (%x)\n", status); -+ dev_dbg(qce->dev, "skcipher operation error (%x)\n", status); - - qce->async_req_done(tmpl->qce, error); - } - - static int +- +- qce->async_req_done(tmpl->qce, error); +-} +- +-static int -qce_ablkcipher_async_req_handle(struct crypto_async_request *async_req) -+qce_skcipher_async_req_handle(struct crypto_async_request *async_req) - { +-{ - struct ablkcipher_request *req = ablkcipher_request_cast(async_req); - struct qce_cipher_reqctx *rctx = ablkcipher_request_ctx(req); - struct crypto_ablkcipher *ablkcipher = crypto_ablkcipher_reqtfm(req); - struct qce_alg_template *tmpl = to_cipher_tmpl(async_req->tfm); -+ struct skcipher_request *req = skcipher_request_cast(async_req); -+ struct qce_cipher_reqctx *rctx = skcipher_request_ctx(req); -+ struct crypto_skcipher *skcipher = crypto_skcipher_reqtfm(req); -+ struct qce_alg_template *tmpl = to_cipher_tmpl(crypto_skcipher_reqtfm(req)); - struct qce_device *qce = tmpl->qce; - enum dma_data_direction dir_src, dir_dst; - struct scatterlist *sg; -@@ -70,17 +70,17 @@ qce_ablkcipher_async_req_handle(struct crypto_async_request *async_req) - gfp_t gfp; - int ret; - +- struct qce_device *qce = tmpl->qce; +- enum dma_data_direction dir_src, dir_dst; +- struct scatterlist *sg; +- bool diff_dst; +- gfp_t gfp; +- int ret; +- - rctx->iv = req->info; - rctx->ivsize = crypto_ablkcipher_ivsize(ablkcipher); - rctx->cryptlen = req->nbytes; -+ rctx->iv = req->iv; -+ rctx->ivsize = crypto_skcipher_ivsize(skcipher); -+ rctx->cryptlen = req->cryptlen; - - diff_dst = (req->src != req->dst) ? true : false; - dir_src = diff_dst ? DMA_TO_DEVICE : DMA_BIDIRECTIONAL; - dir_dst = diff_dst ? DMA_FROM_DEVICE : DMA_BIDIRECTIONAL; - +- +- diff_dst = (req->src != req->dst) ? true : false; +- dir_src = diff_dst ? DMA_TO_DEVICE : DMA_BIDIRECTIONAL; +- dir_dst = diff_dst ? DMA_FROM_DEVICE : DMA_BIDIRECTIONAL; +- - rctx->src_nents = sg_nents_for_len(req->src, req->nbytes); -+ rctx->src_nents = sg_nents_for_len(req->src, req->cryptlen); - if (diff_dst) +- if (diff_dst) - rctx->dst_nents = sg_nents_for_len(req->dst, req->nbytes); -+ rctx->dst_nents = sg_nents_for_len(req->dst, req->cryptlen); - else - rctx->dst_nents = rctx->src_nents; - if (rctx->src_nents < 0) { -@@ -133,13 +133,13 @@ qce_ablkcipher_async_req_handle(struct crypto_async_request *async_req) - - ret = qce_dma_prep_sgs(&qce->dma, rctx->src_sg, rctx->src_nents, - rctx->dst_sg, rctx->dst_nents, +- else +- rctx->dst_nents = rctx->src_nents; +- if (rctx->src_nents < 0) { +- dev_err(qce->dev, "Invalid numbers of src SG.\n"); +- return rctx->src_nents; +- } +- if (rctx->dst_nents < 0) { +- dev_err(qce->dev, "Invalid numbers of dst SG.\n"); +- return -rctx->dst_nents; +- } +- +- rctx->dst_nents += 1; +- +- gfp = (req->base.flags & CRYPTO_TFM_REQ_MAY_SLEEP) ? +- GFP_KERNEL : GFP_ATOMIC; +- +- ret = sg_alloc_table(&rctx->dst_tbl, rctx->dst_nents, gfp); +- if (ret) +- return ret; +- +- sg_init_one(&rctx->result_sg, qce->dma.result_buf, QCE_RESULT_BUF_SZ); +- +- sg = qce_sgtable_add(&rctx->dst_tbl, req->dst); +- if (IS_ERR(sg)) { +- ret = PTR_ERR(sg); +- goto error_free; +- } +- +- sg = qce_sgtable_add(&rctx->dst_tbl, &rctx->result_sg); +- if (IS_ERR(sg)) { +- ret = PTR_ERR(sg); +- goto error_free; +- } +- +- sg_mark_end(sg); +- rctx->dst_sg = rctx->dst_tbl.sgl; +- +- ret = dma_map_sg(qce->dev, rctx->dst_sg, rctx->dst_nents, dir_dst); +- if (ret < 0) +- goto error_free; +- +- if (diff_dst) { +- ret = dma_map_sg(qce->dev, req->src, rctx->src_nents, dir_src); +- if (ret < 0) +- goto error_unmap_dst; +- rctx->src_sg = req->src; +- } else { +- rctx->src_sg = rctx->dst_sg; +- } +- +- ret = qce_dma_prep_sgs(&qce->dma, rctx->src_sg, rctx->src_nents, +- rctx->dst_sg, rctx->dst_nents, - qce_ablkcipher_done, async_req); -+ qce_skcipher_done, async_req); - if (ret) - goto error_unmap_src; - - qce_dma_issue_pending(&qce->dma); - +- if (ret) +- goto error_unmap_src; +- +- qce_dma_issue_pending(&qce->dma); +- - ret = qce_start(async_req, tmpl->crypto_alg_type, req->nbytes, 0); -+ ret = qce_start(async_req, tmpl->crypto_alg_type, req->cryptlen, 0); - if (ret) - goto error_terminate; - -@@ -157,12 +157,11 @@ qce_ablkcipher_async_req_handle(struct crypto_async_request *async_req) - return ret; - } - +- if (ret) +- goto error_terminate; +- +- return 0; +- +-error_terminate: +- qce_dma_terminate_all(&qce->dma); +-error_unmap_src: +- if (diff_dst) +- dma_unmap_sg(qce->dev, req->src, rctx->src_nents, dir_src); +-error_unmap_dst: +- dma_unmap_sg(qce->dev, rctx->dst_sg, rctx->dst_nents, dir_dst); +-error_free: +- sg_free_table(&rctx->dst_tbl); +- return ret; +-} +- -static int qce_ablkcipher_setkey(struct crypto_ablkcipher *ablk, const u8 *key, -+static int qce_skcipher_setkey(struct crypto_skcipher *ablk, const u8 *key, - unsigned int keylen) - { +- unsigned int keylen) +-{ - struct crypto_tfm *tfm = crypto_ablkcipher_tfm(ablk); - struct qce_cipher_ctx *ctx = crypto_tfm_ctx(tfm); - unsigned long flags = to_cipher_tmpl(tfm)->alg_flags; -+ struct qce_cipher_ctx *ctx = crypto_skcipher_ctx(ablk); -+ unsigned long flags = to_cipher_tmpl(ablk)->alg_flags; - int ret; - - if (!key || !keylen) -@@ -180,7 +179,7 @@ static int qce_ablkcipher_setkey(struct crypto_ablkcipher *ablk, const u8 *key, - u32 tmp[DES_EXPKEY_WORDS]; - - ret = des_ekey(tmp, key); +- int ret; +- +- if (!key || !keylen) +- return -EINVAL; +- +- if (IS_AES(flags)) { +- switch (keylen) { +- case AES_KEYSIZE_128: +- case AES_KEYSIZE_256: +- break; +- default: +- goto fallback; +- } +- } else if (IS_DES(flags)) { +- u32 tmp[DES_EXPKEY_WORDS]; +- +- ret = des_ekey(tmp, key); - if (!ret && crypto_ablkcipher_get_flags(ablk) & -+ if (!ret && crypto_skcipher_get_flags(ablk) & - CRYPTO_TFM_REQ_WEAK_KEY) - goto weakkey; - } -@@ -194,16 +193,15 @@ static int qce_ablkcipher_setkey(struct crypto_ablkcipher *ablk, const u8 *key, - ctx->enc_keylen = keylen; - return ret; - weakkey: +- CRYPTO_TFM_REQ_WEAK_KEY) +- goto weakkey; +- } +- +- ctx->enc_keylen = keylen; +- memcpy(ctx->enc_key, key, keylen); +- return 0; +-fallback: +- ret = crypto_skcipher_setkey(ctx->fallback, key, keylen); +- if (!ret) +- ctx->enc_keylen = keylen; +- return ret; +-weakkey: - crypto_ablkcipher_set_flags(ablk, CRYPTO_TFM_RES_WEAK_KEY); -+ crypto_skcipher_set_flags(ablk, CRYPTO_TFM_RES_WEAK_KEY); - return -EINVAL; - } - +- return -EINVAL; +-} +- -static int qce_ablkcipher_crypt(struct ablkcipher_request *req, int encrypt) -+static int qce_skcipher_crypt(struct skcipher_request *req, int encrypt) - { +-{ - struct crypto_tfm *tfm = - crypto_ablkcipher_tfm(crypto_ablkcipher_reqtfm(req)); - struct qce_cipher_ctx *ctx = crypto_tfm_ctx(tfm); - struct qce_cipher_reqctx *rctx = ablkcipher_request_ctx(req); -+ struct crypto_skcipher *tfm = crypto_skcipher_reqtfm(req); -+ struct qce_cipher_ctx *ctx = crypto_skcipher_ctx(tfm); -+ struct qce_cipher_reqctx *rctx = skcipher_request_ctx(req); - struct qce_alg_template *tmpl = to_cipher_tmpl(tfm); - int ret; - -@@ -218,7 +216,7 @@ static int qce_ablkcipher_crypt(struct ablkcipher_request *req, int encrypt) - skcipher_request_set_callback(subreq, req->base.flags, - NULL, NULL); - skcipher_request_set_crypt(subreq, req->src, req->dst, +- struct qce_alg_template *tmpl = to_cipher_tmpl(tfm); +- int ret; +- +- rctx->flags = tmpl->alg_flags; +- rctx->flags |= encrypt ? QCE_ENCRYPT : QCE_DECRYPT; +- +- if (IS_AES(rctx->flags) && ctx->enc_keylen != AES_KEYSIZE_128 && +- ctx->enc_keylen != AES_KEYSIZE_256) { +- SKCIPHER_REQUEST_ON_STACK(subreq, ctx->fallback); +- +- skcipher_request_set_tfm(subreq, ctx->fallback); +- skcipher_request_set_callback(subreq, req->base.flags, +- NULL, NULL); +- skcipher_request_set_crypt(subreq, req->src, req->dst, - req->nbytes, req->info); -+ req->cryptlen, req->iv); - ret = encrypt ? crypto_skcipher_encrypt(subreq) : - crypto_skcipher_decrypt(subreq); - skcipher_request_zero(subreq); -@@ -228,37 +226,37 @@ static int qce_ablkcipher_crypt(struct ablkcipher_request *req, int encrypt) - return tmpl->qce->async_req_enqueue(tmpl->qce, &req->base); - } - +- ret = encrypt ? crypto_skcipher_encrypt(subreq) : +- crypto_skcipher_decrypt(subreq); +- skcipher_request_zero(subreq); +- return ret; +- } +- +- return tmpl->qce->async_req_enqueue(tmpl->qce, &req->base); +-} +- -static int qce_ablkcipher_encrypt(struct ablkcipher_request *req) -+static int qce_skcipher_encrypt(struct skcipher_request *req) - { +-{ - return qce_ablkcipher_crypt(req, 1); -+ return qce_skcipher_crypt(req, 1); - } - +-} +- -static int qce_ablkcipher_decrypt(struct ablkcipher_request *req) -+static int qce_skcipher_decrypt(struct skcipher_request *req) - { +-{ - return qce_ablkcipher_crypt(req, 0); -+ return qce_skcipher_crypt(req, 0); - } - +-} +- -static int qce_ablkcipher_init(struct crypto_tfm *tfm) -+static int qce_skcipher_init(struct crypto_skcipher *tfm) - { +-{ - struct qce_cipher_ctx *ctx = crypto_tfm_ctx(tfm); -+ struct qce_cipher_ctx *ctx = crypto_skcipher_ctx(tfm); - - memset(ctx, 0, sizeof(*ctx)); +- +- memset(ctx, 0, sizeof(*ctx)); - tfm->crt_ablkcipher.reqsize = sizeof(struct qce_cipher_reqctx); -+ crypto_skcipher_set_reqsize(tfm, sizeof(struct qce_cipher_reqctx)); - +- - ctx->fallback = crypto_alloc_skcipher(crypto_tfm_alg_name(tfm), 0, - CRYPTO_ALG_ASYNC | - CRYPTO_ALG_NEED_FALLBACK); -+ ctx->fallback = crypto_alloc_skcipher(crypto_tfm_alg_name(&tfm->base), -+ 0, CRYPTO_ALG_ASYNC | -+ CRYPTO_ALG_NEED_FALLBACK); - return PTR_ERR_OR_ZERO(ctx->fallback); - } - +- return PTR_ERR_OR_ZERO(ctx->fallback); +-} +- -static void qce_ablkcipher_exit(struct crypto_tfm *tfm) -+static void qce_skcipher_exit(struct crypto_skcipher *tfm) - { +-{ - struct qce_cipher_ctx *ctx = crypto_tfm_ctx(tfm); -+ struct qce_cipher_ctx *ctx = crypto_skcipher_ctx(tfm); - - crypto_free_skcipher(ctx->fallback); - } - +- +- crypto_free_skcipher(ctx->fallback); +-} +- -struct qce_ablkcipher_def { -+struct qce_skcipher_def { - unsigned long flags; - const char *name; - const char *drv_name; -@@ -268,7 +266,7 @@ struct qce_ablkcipher_def { - unsigned int max_keysize; - }; - +- unsigned long flags; +- const char *name; +- const char *drv_name; +- unsigned int blocksize; +- unsigned int ivsize; +- unsigned int min_keysize; +- unsigned int max_keysize; +-}; +- -static const struct qce_ablkcipher_def ablkcipher_def[] = { -+static const struct qce_skcipher_def skcipher_def[] = { - { - .flags = QCE_ALG_AES | QCE_MODE_ECB, - .name = "ecb(aes)", -@@ -343,89 +341,89 @@ static const struct qce_ablkcipher_def ablkcipher_def[] = { - }, - }; - +- { +- .flags = QCE_ALG_AES | QCE_MODE_ECB, +- .name = "ecb(aes)", +- .drv_name = "ecb-aes-qce", +- .blocksize = AES_BLOCK_SIZE, +- .ivsize = AES_BLOCK_SIZE, +- .min_keysize = AES_MIN_KEY_SIZE, +- .max_keysize = AES_MAX_KEY_SIZE, +- }, +- { +- .flags = QCE_ALG_AES | QCE_MODE_CBC, +- .name = "cbc(aes)", +- .drv_name = "cbc-aes-qce", +- .blocksize = AES_BLOCK_SIZE, +- .ivsize = AES_BLOCK_SIZE, +- .min_keysize = AES_MIN_KEY_SIZE, +- .max_keysize = AES_MAX_KEY_SIZE, +- }, +- { +- .flags = QCE_ALG_AES | QCE_MODE_CTR, +- .name = "ctr(aes)", +- .drv_name = "ctr-aes-qce", +- .blocksize = AES_BLOCK_SIZE, +- .ivsize = AES_BLOCK_SIZE, +- .min_keysize = AES_MIN_KEY_SIZE, +- .max_keysize = AES_MAX_KEY_SIZE, +- }, +- { +- .flags = QCE_ALG_AES | QCE_MODE_XTS, +- .name = "xts(aes)", +- .drv_name = "xts-aes-qce", +- .blocksize = AES_BLOCK_SIZE, +- .ivsize = AES_BLOCK_SIZE, +- .min_keysize = AES_MIN_KEY_SIZE, +- .max_keysize = AES_MAX_KEY_SIZE, +- }, +- { +- .flags = QCE_ALG_DES | QCE_MODE_ECB, +- .name = "ecb(des)", +- .drv_name = "ecb-des-qce", +- .blocksize = DES_BLOCK_SIZE, +- .ivsize = 0, +- .min_keysize = DES_KEY_SIZE, +- .max_keysize = DES_KEY_SIZE, +- }, +- { +- .flags = QCE_ALG_DES | QCE_MODE_CBC, +- .name = "cbc(des)", +- .drv_name = "cbc-des-qce", +- .blocksize = DES_BLOCK_SIZE, +- .ivsize = DES_BLOCK_SIZE, +- .min_keysize = DES_KEY_SIZE, +- .max_keysize = DES_KEY_SIZE, +- }, +- { +- .flags = QCE_ALG_3DES | QCE_MODE_ECB, +- .name = "ecb(des3_ede)", +- .drv_name = "ecb-3des-qce", +- .blocksize = DES3_EDE_BLOCK_SIZE, +- .ivsize = 0, +- .min_keysize = DES3_EDE_KEY_SIZE, +- .max_keysize = DES3_EDE_KEY_SIZE, +- }, +- { +- .flags = QCE_ALG_3DES | QCE_MODE_CBC, +- .name = "cbc(des3_ede)", +- .drv_name = "cbc-3des-qce", +- .blocksize = DES3_EDE_BLOCK_SIZE, +- .ivsize = DES3_EDE_BLOCK_SIZE, +- .min_keysize = DES3_EDE_KEY_SIZE, +- .max_keysize = DES3_EDE_KEY_SIZE, +- }, +-}; +- -static int qce_ablkcipher_register_one(const struct qce_ablkcipher_def *def, -+static int qce_skcipher_register_one(const struct qce_skcipher_def *def, - struct qce_device *qce) - { - struct qce_alg_template *tmpl; +- struct qce_device *qce) +-{ +- struct qce_alg_template *tmpl; - struct crypto_alg *alg; -+ struct skcipher_alg *alg; - int ret; - - tmpl = kzalloc(sizeof(*tmpl), GFP_KERNEL); - if (!tmpl) - return -ENOMEM; - +- int ret; +- +- tmpl = kzalloc(sizeof(*tmpl), GFP_KERNEL); +- if (!tmpl) +- return -ENOMEM; +- - alg = &tmpl->alg.crypto; -+ alg = &tmpl->alg.skcipher; - +- - snprintf(alg->cra_name, CRYPTO_MAX_ALG_NAME, "%s", def->name); - snprintf(alg->cra_driver_name, CRYPTO_MAX_ALG_NAME, "%s", -+ snprintf(alg->base.cra_name, CRYPTO_MAX_ALG_NAME, "%s", def->name); -+ snprintf(alg->base.cra_driver_name, CRYPTO_MAX_ALG_NAME, "%s", - def->drv_name); - +- def->drv_name); +- - alg->cra_blocksize = def->blocksize; - alg->cra_ablkcipher.ivsize = def->ivsize; - alg->cra_ablkcipher.min_keysize = def->min_keysize; @@ -375,6 +488,420 @@ index 3658c46ef9c7..0376bb969834 100644 - alg->cra_init = qce_ablkcipher_init; - alg->cra_exit = qce_ablkcipher_exit; - INIT_LIST_HEAD(&alg->cra_list); +- +- INIT_LIST_HEAD(&tmpl->entry); +- tmpl->crypto_alg_type = CRYPTO_ALG_TYPE_ABLKCIPHER; +- tmpl->alg_flags = def->flags; +- tmpl->qce = qce; +- +- ret = crypto_register_alg(alg); +- if (ret) { +- kfree(tmpl); +- dev_err(qce->dev, "%s registration failed\n", alg->cra_name); +- return ret; +- } +- +- list_add_tail(&tmpl->entry, &ablkcipher_algs); +- dev_dbg(qce->dev, "%s is registered\n", alg->cra_name); +- return 0; +-} +- +-static void qce_ablkcipher_unregister(struct qce_device *qce) +-{ +- struct qce_alg_template *tmpl, *n; +- +- list_for_each_entry_safe(tmpl, n, &ablkcipher_algs, entry) { +- crypto_unregister_alg(&tmpl->alg.crypto); +- list_del(&tmpl->entry); +- kfree(tmpl); +- } +-} +- +-static int qce_ablkcipher_register(struct qce_device *qce) +-{ +- int ret, i; +- +- for (i = 0; i < ARRAY_SIZE(ablkcipher_def); i++) { +- ret = qce_ablkcipher_register_one(&ablkcipher_def[i], qce); +- if (ret) +- goto err; +- } +- +- return 0; +-err: +- qce_ablkcipher_unregister(qce); +- return ret; +-} +- +-const struct qce_algo_ops ablkcipher_ops = { +- .type = CRYPTO_ALG_TYPE_ABLKCIPHER, +- .register_algs = qce_ablkcipher_register, +- .unregister_algs = qce_ablkcipher_unregister, +- .async_req_handle = qce_ablkcipher_async_req_handle, +-}; +--- /dev/null ++++ b/drivers/crypto/qce/skcipher.c +@@ -0,0 +1,429 @@ ++/* ++ * Copyright (c) 2010-2014, The Linux Foundation. All rights reserved. ++ * ++ * This program is free software; you can redistribute it and/or modify ++ * it under the terms of the GNU General Public License version 2 and ++ * only version 2 as published by the Free Software Foundation. ++ * ++ * This program is distributed in the hope that it will be useful, ++ * but WITHOUT ANY WARRANTY; without even the implied warranty of ++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ * GNU General Public License for more details. ++ */ ++ ++#include ++#include ++#include ++#include ++#include ++#include ++ ++#include "cipher.h" ++ ++static LIST_HEAD(skcipher_algs); ++ ++static void qce_skcipher_done(void *data) ++{ ++ struct crypto_async_request *async_req = data; ++ struct skcipher_request *req = skcipher_request_cast(async_req); ++ struct qce_cipher_reqctx *rctx = skcipher_request_ctx(req); ++ struct qce_alg_template *tmpl = to_cipher_tmpl(crypto_skcipher_reqtfm(req)); ++ struct qce_device *qce = tmpl->qce; ++ enum dma_data_direction dir_src, dir_dst; ++ u32 status; ++ int error; ++ bool diff_dst; ++ ++ diff_dst = (req->src != req->dst) ? true : false; ++ dir_src = diff_dst ? DMA_TO_DEVICE : DMA_BIDIRECTIONAL; ++ dir_dst = diff_dst ? DMA_FROM_DEVICE : DMA_BIDIRECTIONAL; ++ ++ error = qce_dma_terminate_all(&qce->dma); ++ if (error) ++ dev_dbg(qce->dev, "skcipher dma termination error (%d)\n", ++ error); ++ ++ if (diff_dst) ++ dma_unmap_sg(qce->dev, rctx->src_sg, rctx->src_nents, dir_src); ++ dma_unmap_sg(qce->dev, rctx->dst_sg, rctx->dst_nents, dir_dst); ++ ++ sg_free_table(&rctx->dst_tbl); ++ ++ error = qce_check_status(qce, &status); ++ if (error < 0) ++ dev_dbg(qce->dev, "skcipher operation error (%x)\n", status); ++ ++ qce->async_req_done(tmpl->qce, error); ++} ++ ++static int ++qce_skcipher_async_req_handle(struct crypto_async_request *async_req) ++{ ++ struct skcipher_request *req = skcipher_request_cast(async_req); ++ struct qce_cipher_reqctx *rctx = skcipher_request_ctx(req); ++ struct crypto_skcipher *skcipher = crypto_skcipher_reqtfm(req); ++ struct qce_alg_template *tmpl = to_cipher_tmpl(crypto_skcipher_reqtfm(req)); ++ struct qce_device *qce = tmpl->qce; ++ enum dma_data_direction dir_src, dir_dst; ++ struct scatterlist *sg; ++ bool diff_dst; ++ gfp_t gfp; ++ int ret; ++ ++ rctx->iv = req->iv; ++ rctx->ivsize = crypto_skcipher_ivsize(skcipher); ++ rctx->cryptlen = req->cryptlen; ++ ++ diff_dst = (req->src != req->dst) ? true : false; ++ dir_src = diff_dst ? DMA_TO_DEVICE : DMA_BIDIRECTIONAL; ++ dir_dst = diff_dst ? DMA_FROM_DEVICE : DMA_BIDIRECTIONAL; ++ ++ rctx->src_nents = sg_nents_for_len(req->src, req->cryptlen); ++ if (diff_dst) ++ rctx->dst_nents = sg_nents_for_len(req->dst, req->cryptlen); ++ else ++ rctx->dst_nents = rctx->src_nents; ++ if (rctx->src_nents < 0) { ++ dev_err(qce->dev, "Invalid numbers of src SG.\n"); ++ return rctx->src_nents; ++ } ++ if (rctx->dst_nents < 0) { ++ dev_err(qce->dev, "Invalid numbers of dst SG.\n"); ++ return -rctx->dst_nents; ++ } ++ ++ rctx->dst_nents += 1; ++ ++ gfp = (req->base.flags & CRYPTO_TFM_REQ_MAY_SLEEP) ? ++ GFP_KERNEL : GFP_ATOMIC; ++ ++ ret = sg_alloc_table(&rctx->dst_tbl, rctx->dst_nents, gfp); ++ if (ret) ++ return ret; ++ ++ sg_init_one(&rctx->result_sg, qce->dma.result_buf, QCE_RESULT_BUF_SZ); ++ ++ sg = qce_sgtable_add(&rctx->dst_tbl, req->dst); ++ if (IS_ERR(sg)) { ++ ret = PTR_ERR(sg); ++ goto error_free; ++ } ++ ++ sg = qce_sgtable_add(&rctx->dst_tbl, &rctx->result_sg); ++ if (IS_ERR(sg)) { ++ ret = PTR_ERR(sg); ++ goto error_free; ++ } ++ ++ sg_mark_end(sg); ++ rctx->dst_sg = rctx->dst_tbl.sgl; ++ ++ ret = dma_map_sg(qce->dev, rctx->dst_sg, rctx->dst_nents, dir_dst); ++ if (ret < 0) ++ goto error_free; ++ ++ if (diff_dst) { ++ ret = dma_map_sg(qce->dev, req->src, rctx->src_nents, dir_src); ++ if (ret < 0) ++ goto error_unmap_dst; ++ rctx->src_sg = req->src; ++ } else { ++ rctx->src_sg = rctx->dst_sg; ++ } ++ ++ ret = qce_dma_prep_sgs(&qce->dma, rctx->src_sg, rctx->src_nents, ++ rctx->dst_sg, rctx->dst_nents, ++ qce_skcipher_done, async_req); ++ if (ret) ++ goto error_unmap_src; ++ ++ qce_dma_issue_pending(&qce->dma); ++ ++ ret = qce_start(async_req, tmpl->crypto_alg_type, req->cryptlen, 0); ++ if (ret) ++ goto error_terminate; ++ ++ return 0; ++ ++error_terminate: ++ qce_dma_terminate_all(&qce->dma); ++error_unmap_src: ++ if (diff_dst) ++ dma_unmap_sg(qce->dev, req->src, rctx->src_nents, dir_src); ++error_unmap_dst: ++ dma_unmap_sg(qce->dev, rctx->dst_sg, rctx->dst_nents, dir_dst); ++error_free: ++ sg_free_table(&rctx->dst_tbl); ++ return ret; ++} ++ ++static int qce_skcipher_setkey(struct crypto_skcipher *ablk, const u8 *key, ++ unsigned int keylen) ++{ ++ struct qce_cipher_ctx *ctx = crypto_skcipher_ctx(ablk); ++ unsigned long flags = to_cipher_tmpl(ablk)->alg_flags; ++ int ret; ++ ++ if (!key || !keylen) ++ return -EINVAL; ++ ++ if (IS_AES(flags)) { ++ switch (keylen) { ++ case AES_KEYSIZE_128: ++ case AES_KEYSIZE_256: ++ break; ++ default: ++ goto fallback; ++ } ++ } else if (IS_DES(flags)) { ++ u32 tmp[DES_EXPKEY_WORDS]; ++ ++ ret = des_ekey(tmp, key); ++ if (!ret && crypto_skcipher_get_flags(ablk) & ++ CRYPTO_TFM_REQ_WEAK_KEY) ++ goto weakkey; ++ } ++ ++ ctx->enc_keylen = keylen; ++ memcpy(ctx->enc_key, key, keylen); ++ return 0; ++fallback: ++ ret = crypto_skcipher_setkey(ctx->fallback, key, keylen); ++ if (!ret) ++ ctx->enc_keylen = keylen; ++ return ret; ++weakkey: ++ crypto_skcipher_set_flags(ablk, CRYPTO_TFM_RES_WEAK_KEY); ++ return -EINVAL; ++} ++ ++static int qce_skcipher_crypt(struct skcipher_request *req, int encrypt) ++{ ++ struct crypto_skcipher *tfm = crypto_skcipher_reqtfm(req); ++ struct qce_cipher_ctx *ctx = crypto_skcipher_ctx(tfm); ++ struct qce_cipher_reqctx *rctx = skcipher_request_ctx(req); ++ struct qce_alg_template *tmpl = to_cipher_tmpl(tfm); ++ int ret; ++ ++ rctx->flags = tmpl->alg_flags; ++ rctx->flags |= encrypt ? QCE_ENCRYPT : QCE_DECRYPT; ++ ++ if (IS_AES(rctx->flags) && ctx->enc_keylen != AES_KEYSIZE_128 && ++ ctx->enc_keylen != AES_KEYSIZE_256) { ++ SKCIPHER_REQUEST_ON_STACK(subreq, ctx->fallback); ++ ++ skcipher_request_set_tfm(subreq, ctx->fallback); ++ skcipher_request_set_callback(subreq, req->base.flags, ++ NULL, NULL); ++ skcipher_request_set_crypt(subreq, req->src, req->dst, ++ req->cryptlen, req->iv); ++ ret = encrypt ? crypto_skcipher_encrypt(subreq) : ++ crypto_skcipher_decrypt(subreq); ++ skcipher_request_zero(subreq); ++ return ret; ++ } ++ ++ return tmpl->qce->async_req_enqueue(tmpl->qce, &req->base); ++} ++ ++static int qce_skcipher_encrypt(struct skcipher_request *req) ++{ ++ return qce_skcipher_crypt(req, 1); ++} ++ ++static int qce_skcipher_decrypt(struct skcipher_request *req) ++{ ++ return qce_skcipher_crypt(req, 0); ++} ++ ++static int qce_skcipher_init(struct crypto_skcipher *tfm) ++{ ++ struct qce_cipher_ctx *ctx = crypto_skcipher_ctx(tfm); ++ ++ memset(ctx, 0, sizeof(*ctx)); ++ crypto_skcipher_set_reqsize(tfm, sizeof(struct qce_cipher_reqctx)); ++ ++ ctx->fallback = crypto_alloc_skcipher(crypto_tfm_alg_name(&tfm->base), ++ 0, CRYPTO_ALG_ASYNC | ++ CRYPTO_ALG_NEED_FALLBACK); ++ return PTR_ERR_OR_ZERO(ctx->fallback); ++} ++ ++static void qce_skcipher_exit(struct crypto_skcipher *tfm) ++{ ++ struct qce_cipher_ctx *ctx = crypto_skcipher_ctx(tfm); ++ ++ crypto_free_skcipher(ctx->fallback); ++} ++ ++struct qce_skcipher_def { ++ unsigned long flags; ++ const char *name; ++ const char *drv_name; ++ unsigned int blocksize; ++ unsigned int ivsize; ++ unsigned int min_keysize; ++ unsigned int max_keysize; ++}; ++ ++static const struct qce_skcipher_def skcipher_def[] = { ++ { ++ .flags = QCE_ALG_AES | QCE_MODE_ECB, ++ .name = "ecb(aes)", ++ .drv_name = "ecb-aes-qce", ++ .blocksize = AES_BLOCK_SIZE, ++ .ivsize = AES_BLOCK_SIZE, ++ .min_keysize = AES_MIN_KEY_SIZE, ++ .max_keysize = AES_MAX_KEY_SIZE, ++ }, ++ { ++ .flags = QCE_ALG_AES | QCE_MODE_CBC, ++ .name = "cbc(aes)", ++ .drv_name = "cbc-aes-qce", ++ .blocksize = AES_BLOCK_SIZE, ++ .ivsize = AES_BLOCK_SIZE, ++ .min_keysize = AES_MIN_KEY_SIZE, ++ .max_keysize = AES_MAX_KEY_SIZE, ++ }, ++ { ++ .flags = QCE_ALG_AES | QCE_MODE_CTR, ++ .name = "ctr(aes)", ++ .drv_name = "ctr-aes-qce", ++ .blocksize = AES_BLOCK_SIZE, ++ .ivsize = AES_BLOCK_SIZE, ++ .min_keysize = AES_MIN_KEY_SIZE, ++ .max_keysize = AES_MAX_KEY_SIZE, ++ }, ++ { ++ .flags = QCE_ALG_AES | QCE_MODE_XTS, ++ .name = "xts(aes)", ++ .drv_name = "xts-aes-qce", ++ .blocksize = AES_BLOCK_SIZE, ++ .ivsize = AES_BLOCK_SIZE, ++ .min_keysize = AES_MIN_KEY_SIZE, ++ .max_keysize = AES_MAX_KEY_SIZE, ++ }, ++ { ++ .flags = QCE_ALG_DES | QCE_MODE_ECB, ++ .name = "ecb(des)", ++ .drv_name = "ecb-des-qce", ++ .blocksize = DES_BLOCK_SIZE, ++ .ivsize = 0, ++ .min_keysize = DES_KEY_SIZE, ++ .max_keysize = DES_KEY_SIZE, ++ }, ++ { ++ .flags = QCE_ALG_DES | QCE_MODE_CBC, ++ .name = "cbc(des)", ++ .drv_name = "cbc-des-qce", ++ .blocksize = DES_BLOCK_SIZE, ++ .ivsize = DES_BLOCK_SIZE, ++ .min_keysize = DES_KEY_SIZE, ++ .max_keysize = DES_KEY_SIZE, ++ }, ++ { ++ .flags = QCE_ALG_3DES | QCE_MODE_ECB, ++ .name = "ecb(des3_ede)", ++ .drv_name = "ecb-3des-qce", ++ .blocksize = DES3_EDE_BLOCK_SIZE, ++ .ivsize = 0, ++ .min_keysize = DES3_EDE_KEY_SIZE, ++ .max_keysize = DES3_EDE_KEY_SIZE, ++ }, ++ { ++ .flags = QCE_ALG_3DES | QCE_MODE_CBC, ++ .name = "cbc(des3_ede)", ++ .drv_name = "cbc-3des-qce", ++ .blocksize = DES3_EDE_BLOCK_SIZE, ++ .ivsize = DES3_EDE_BLOCK_SIZE, ++ .min_keysize = DES3_EDE_KEY_SIZE, ++ .max_keysize = DES3_EDE_KEY_SIZE, ++ }, ++}; ++ ++static int qce_skcipher_register_one(const struct qce_skcipher_def *def, ++ struct qce_device *qce) ++{ ++ struct qce_alg_template *tmpl; ++ struct skcipher_alg *alg; ++ int ret; ++ ++ tmpl = kzalloc(sizeof(*tmpl), GFP_KERNEL); ++ if (!tmpl) ++ return -ENOMEM; ++ ++ alg = &tmpl->alg.skcipher; ++ ++ snprintf(alg->base.cra_name, CRYPTO_MAX_ALG_NAME, "%s", def->name); ++ snprintf(alg->base.cra_driver_name, CRYPTO_MAX_ALG_NAME, "%s", ++ def->drv_name); ++ + alg->base.cra_blocksize = def->blocksize; + alg->ivsize = def->ivsize; + alg->min_keysize = def->min_keysize; @@ -393,71 +920,54 @@ index 3658c46ef9c7..0376bb969834 100644 + + alg->init = qce_skcipher_init; + alg->exit = qce_skcipher_exit; - - INIT_LIST_HEAD(&tmpl->entry); -- tmpl->crypto_alg_type = CRYPTO_ALG_TYPE_ABLKCIPHER; ++ ++ INIT_LIST_HEAD(&tmpl->entry); + tmpl->crypto_alg_type = CRYPTO_ALG_TYPE_SKCIPHER; - tmpl->alg_flags = def->flags; - tmpl->qce = qce; - -- ret = crypto_register_alg(alg); ++ tmpl->alg_flags = def->flags; ++ tmpl->qce = qce; ++ + ret = crypto_register_skcipher(alg); - if (ret) { - kfree(tmpl); -- dev_err(qce->dev, "%s registration failed\n", alg->cra_name); ++ if (ret) { ++ kfree(tmpl); + dev_err(qce->dev, "%s registration failed\n", alg->base.cra_name); - return ret; - } - -- list_add_tail(&tmpl->entry, &ablkcipher_algs); -- dev_dbg(qce->dev, "%s is registered\n", alg->cra_name); ++ return ret; ++ } ++ + list_add_tail(&tmpl->entry, &skcipher_algs); + dev_dbg(qce->dev, "%s is registered\n", alg->base.cra_name); - return 0; - } - --static void qce_ablkcipher_unregister(struct qce_device *qce) ++ return 0; ++} ++ +static void qce_skcipher_unregister(struct qce_device *qce) - { - struct qce_alg_template *tmpl, *n; - -- list_for_each_entry_safe(tmpl, n, &ablkcipher_algs, entry) { -- crypto_unregister_alg(&tmpl->alg.crypto); ++{ ++ struct qce_alg_template *tmpl, *n; ++ + list_for_each_entry_safe(tmpl, n, &skcipher_algs, entry) { + crypto_unregister_skcipher(&tmpl->alg.skcipher); - list_del(&tmpl->entry); - kfree(tmpl); - } - } - --static int qce_ablkcipher_register(struct qce_device *qce) ++ list_del(&tmpl->entry); ++ kfree(tmpl); ++ } ++} ++ +static int qce_skcipher_register(struct qce_device *qce) - { - int ret, i; - -- for (i = 0; i < ARRAY_SIZE(ablkcipher_def); i++) { -- ret = qce_ablkcipher_register_one(&ablkcipher_def[i], qce); ++{ ++ int ret, i; ++ + for (i = 0; i < ARRAY_SIZE(skcipher_def); i++) { + ret = qce_skcipher_register_one(&skcipher_def[i], qce); - if (ret) - goto err; - } - - return 0; - err: -- qce_ablkcipher_unregister(qce); ++ if (ret) ++ goto err; ++ } ++ ++ return 0; ++err: + qce_skcipher_unregister(qce); - return ret; - } - --const struct qce_algo_ops ablkcipher_ops = { -- .type = CRYPTO_ALG_TYPE_ABLKCIPHER, -- .register_algs = qce_ablkcipher_register, -- .unregister_algs = qce_ablkcipher_unregister, -- .async_req_handle = qce_ablkcipher_async_req_handle, ++ return ret; ++} ++ +const struct qce_algo_ops skcipher_ops = { + .type = CRYPTO_ALG_TYPE_SKCIPHER, + .register_algs = qce_skcipher_register, + .unregister_algs = qce_skcipher_unregister, + .async_req_handle = qce_skcipher_async_req_handle, - }; ++}; diff --git a/target/linux/ipq40xx/patches-4.19/041-crypto-qce-fix-ctr-aes-qce-block-chunk-sizes.patch b/target/linux/ipq40xx/patches-4.19/041-crypto-qce-fix-ctr-aes-qce-block-chunk-sizes.patch index 7d822c59d6..59f7445a15 100644 --- a/target/linux/ipq40xx/patches-4.19/041-crypto-qce-fix-ctr-aes-qce-block-chunk-sizes.patch +++ b/target/linux/ipq40xx/patches-4.19/041-crypto-qce-fix-ctr-aes-qce-block-chunk-sizes.patch @@ -9,8 +9,6 @@ size belongs. Signed-off-by: Eneas U de Queiroz -diff --git a/drivers/crypto/qce/skcipher.c b/drivers/crypto/qce/skcipher.c -index 0376bb969834..0776286cfc9e 100644 --- a/drivers/crypto/qce/skcipher.c +++ b/drivers/crypto/qce/skcipher.c @@ -261,6 +261,7 @@ struct qce_skcipher_def { @@ -21,7 +19,7 @@ index 0376bb969834..0776286cfc9e 100644 unsigned int ivsize; unsigned int min_keysize; unsigned int max_keysize; -@@ -289,7 +290,8 @@ static const struct qce_skcipher_def skcipher_def[] = { +@@ -289,7 +290,8 @@ static const struct qce_skcipher_def skc .flags = QCE_ALG_AES | QCE_MODE_CTR, .name = "ctr(aes)", .drv_name = "ctr-aes-qce", @@ -31,7 +29,7 @@ index 0376bb969834..0776286cfc9e 100644 .ivsize = AES_BLOCK_SIZE, .min_keysize = AES_MIN_KEY_SIZE, .max_keysize = AES_MAX_KEY_SIZE, -@@ -359,6 +361,7 @@ static int qce_skcipher_register_one(const struct qce_skcipher_def *def, +@@ -359,6 +361,7 @@ static int qce_skcipher_register_one(con def->drv_name); alg->base.cra_blocksize = def->blocksize; diff --git a/target/linux/ipq40xx/patches-4.19/042-crypto-qce-fix-xts-aes-qce-key-sizes.patch b/target/linux/ipq40xx/patches-4.19/042-crypto-qce-fix-xts-aes-qce-key-sizes.patch index dd58dcd801..50b888351c 100644 --- a/target/linux/ipq40xx/patches-4.19/042-crypto-qce-fix-xts-aes-qce-key-sizes.patch +++ b/target/linux/ipq40xx/patches-4.19/042-crypto-qce-fix-xts-aes-qce-key-sizes.patch @@ -8,11 +8,9 @@ skcipher_def, and halved when checking if it is AES-128/192/256. Signed-off-by: Eneas U de Queiroz -diff --git a/drivers/crypto/qce/skcipher.c b/drivers/crypto/qce/skcipher.c -index 0776286cfc9e..9b1bb32515b4 100644 --- a/drivers/crypto/qce/skcipher.c +++ b/drivers/crypto/qce/skcipher.c -@@ -168,7 +168,7 @@ static int qce_skcipher_setkey(struct crypto_skcipher *ablk, const u8 *key, +@@ -168,7 +168,7 @@ static int qce_skcipher_setkey(struct cr return -EINVAL; if (IS_AES(flags)) { @@ -21,7 +19,7 @@ index 0776286cfc9e..9b1bb32515b4 100644 case AES_KEYSIZE_128: case AES_KEYSIZE_256: break; -@@ -203,13 +203,15 @@ static int qce_skcipher_crypt(struct skcipher_request *req, int encrypt) +@@ -203,13 +203,15 @@ static int qce_skcipher_crypt(struct skc struct qce_cipher_ctx *ctx = crypto_skcipher_ctx(tfm); struct qce_cipher_reqctx *rctx = skcipher_request_ctx(req); struct qce_alg_template *tmpl = to_cipher_tmpl(tfm); @@ -39,7 +37,7 @@ index 0776286cfc9e..9b1bb32515b4 100644 SKCIPHER_REQUEST_ON_STACK(subreq, ctx->fallback); skcipher_request_set_tfm(subreq, ctx->fallback); -@@ -302,8 +304,8 @@ static const struct qce_skcipher_def skcipher_def[] = { +@@ -302,8 +304,8 @@ static const struct qce_skcipher_def skc .drv_name = "xts-aes-qce", .blocksize = AES_BLOCK_SIZE, .ivsize = AES_BLOCK_SIZE, diff --git a/target/linux/ipq40xx/patches-4.19/043-crypto-qce-save-a-sg-table-slot-for-result-buf.patch b/target/linux/ipq40xx/patches-4.19/043-crypto-qce-save-a-sg-table-slot-for-result-buf.patch index 9f107db035..95650690fb 100644 --- a/target/linux/ipq40xx/patches-4.19/043-crypto-qce-save-a-sg-table-slot-for-result-buf.patch +++ b/target/linux/ipq40xx/patches-4.19/043-crypto-qce-save-a-sg-table-slot-for-result-buf.patch @@ -21,11 +21,9 @@ for the result buffer is guaranteed to be unused. Signed-off-by: Eneas U de Queiroz -diff --git a/drivers/crypto/qce/dma.c b/drivers/crypto/qce/dma.c -index 4797e795c9b9..db560c3d3e4f 100644 --- a/drivers/crypto/qce/dma.c +++ b/drivers/crypto/qce/dma.c -@@ -55,7 +55,8 @@ void qce_dma_release(struct qce_dma_data *dma) +@@ -55,7 +55,8 @@ void qce_dma_release(struct qce_dma_data } struct scatterlist * @@ -35,7 +33,7 @@ index 4797e795c9b9..db560c3d3e4f 100644 { struct scatterlist *sg = sgt->sgl, *sg_last = NULL; -@@ -68,12 +69,13 @@ qce_sgtable_add(struct sg_table *sgt, struct scatterlist *new_sgl) +@@ -68,12 +69,13 @@ qce_sgtable_add(struct sg_table *sgt, st if (!sg) return ERR_PTR(-EINVAL); @@ -50,11 +48,9 @@ index 4797e795c9b9..db560c3d3e4f 100644 } return sg_last; -diff --git a/drivers/crypto/qce/dma.h b/drivers/crypto/qce/dma.h -index 130235d17bb4..0be71f7f7a58 100644 --- a/drivers/crypto/qce/dma.h +++ b/drivers/crypto/qce/dma.h -@@ -50,6 +50,7 @@ int qce_dma_prep_sgs(struct qce_dma_data *dma, struct scatterlist *sg_in, +@@ -50,6 +50,7 @@ int qce_dma_prep_sgs(struct qce_dma_data void qce_dma_issue_pending(struct qce_dma_data *dma); int qce_dma_terminate_all(struct qce_dma_data *dma); struct scatterlist * @@ -63,11 +59,9 @@ index 130235d17bb4..0be71f7f7a58 100644 + int max_ents); #endif /* _DMA_H_ */ -diff --git a/drivers/crypto/qce/skcipher.c b/drivers/crypto/qce/skcipher.c -index 12f882032544..33d998f5cf5f 100644 --- a/drivers/crypto/qce/skcipher.c +++ b/drivers/crypto/qce/skcipher.c -@@ -103,13 +103,13 @@ qce_skcipher_async_req_handle(struct crypto_async_request *async_req) +@@ -103,13 +103,13 @@ qce_skcipher_async_req_handle(struct cry sg_init_one(&rctx->result_sg, qce->dma.result_buf, QCE_RESULT_BUF_SZ); diff --git a/target/linux/ipq40xx/patches-4.19/044-crypto-qce-update-the-skcipher-IV.patch b/target/linux/ipq40xx/patches-4.19/044-crypto-qce-update-the-skcipher-IV.patch index de7829e767..33be510a82 100644 --- a/target/linux/ipq40xx/patches-4.19/044-crypto-qce-update-the-skcipher-IV.patch +++ b/target/linux/ipq40xx/patches-4.19/044-crypto-qce-update-the-skcipher-IV.patch @@ -7,11 +7,9 @@ Update the IV after the completion of each cipher operation. Signed-off-by: Eneas U de Queiroz -diff --git a/drivers/crypto/qce/skcipher.c b/drivers/crypto/qce/skcipher.c -index 33d998f5cf5f..51377395ed53 100644 --- a/drivers/crypto/qce/skcipher.c +++ b/drivers/crypto/qce/skcipher.c -@@ -29,6 +29,7 @@ static void qce_skcipher_done(void *data) +@@ -29,6 +29,7 @@ static void qce_skcipher_done(void *data struct qce_cipher_reqctx *rctx = skcipher_request_ctx(req); struct qce_alg_template *tmpl = to_cipher_tmpl(crypto_skcipher_reqtfm(req)); struct qce_device *qce = tmpl->qce; @@ -19,7 +17,7 @@ index 33d998f5cf5f..51377395ed53 100644 enum dma_data_direction dir_src, dir_dst; u32 status; int error; -@@ -53,6 +54,7 @@ static void qce_skcipher_done(void *data) +@@ -53,6 +54,7 @@ static void qce_skcipher_done(void *data if (error < 0) dev_dbg(qce->dev, "skcipher operation error (%x)\n", status); diff --git a/target/linux/ipq40xx/patches-4.19/046-crypto-qce-initialize-fallback-only-for-AES.patch b/target/linux/ipq40xx/patches-4.19/046-crypto-qce-initialize-fallback-only-for-AES.patch index b673884ba2..e3adaf864e 100644 --- a/target/linux/ipq40xx/patches-4.19/046-crypto-qce-initialize-fallback-only-for-AES.patch +++ b/target/linux/ipq40xx/patches-4.19/046-crypto-qce-initialize-fallback-only-for-AES.patch @@ -12,11 +12,9 @@ restricted to AES. Signed-off-by: Eneas U de Queiroz -diff --git a/drivers/crypto/qce/skcipher.c b/drivers/crypto/qce/skcipher.c -index 51377395ed53..5a4863091f2a 100644 --- a/drivers/crypto/qce/skcipher.c +++ b/drivers/crypto/qce/skcipher.c -@@ -246,7 +246,15 @@ static int qce_skcipher_init(struct crypto_skcipher *tfm) +@@ -246,7 +246,15 @@ static int qce_skcipher_init(struct cryp memset(ctx, 0, sizeof(*ctx)); crypto_skcipher_set_reqsize(tfm, sizeof(struct qce_cipher_reqctx)); @@ -32,7 +30,7 @@ index 51377395ed53..5a4863091f2a 100644 ctx->fallback = crypto_alloc_skcipher(crypto_tfm_alg_name(&tfm->base), 0, CRYPTO_ALG_ASYNC | CRYPTO_ALG_NEED_FALLBACK); -@@ -375,14 +383,18 @@ static int qce_skcipher_register_one(const struct qce_skcipher_def *def, +@@ -375,14 +383,18 @@ static int qce_skcipher_register_one(con alg->base.cra_priority = 300; alg->base.cra_flags = CRYPTO_ALG_ASYNC | diff --git a/target/linux/ipq40xx/patches-4.19/047-crypto-qce-use-cryptlen-when-adding-extra-sgl.patch b/target/linux/ipq40xx/patches-4.19/047-crypto-qce-use-cryptlen-when-adding-extra-sgl.patch index 8003f7502a..aabc8fd622 100644 --- a/target/linux/ipq40xx/patches-4.19/047-crypto-qce-use-cryptlen-when-adding-extra-sgl.patch +++ b/target/linux/ipq40xx/patches-4.19/047-crypto-qce-use-cryptlen-when-adding-extra-sgl.patch @@ -20,11 +20,9 @@ destination buffer to req->cryptlen before appending the result buf. Signed-off-by: Eneas U de Queiroz -diff --git a/drivers/crypto/qce/dma.c b/drivers/crypto/qce/dma.c -index db560c3d3e4f..0ae9d28afa69 100644 --- a/drivers/crypto/qce/dma.c +++ b/drivers/crypto/qce/dma.c -@@ -56,9 +56,10 @@ void qce_dma_release(struct qce_dma_data *dma) +@@ -56,9 +56,10 @@ void qce_dma_release(struct qce_dma_data struct scatterlist * qce_sgtable_add(struct sg_table *sgt, struct scatterlist *new_sgl, @@ -36,7 +34,7 @@ index db560c3d3e4f..0ae9d28afa69 100644 while (sg) { if (!sg_page(sg)) -@@ -69,13 +70,13 @@ qce_sgtable_add(struct sg_table *sgt, struct scatterlist *new_sgl, +@@ -69,13 +70,13 @@ qce_sgtable_add(struct sg_table *sgt, st if (!sg) return ERR_PTR(-EINVAL); @@ -54,11 +52,9 @@ index db560c3d3e4f..0ae9d28afa69 100644 } return sg_last; -diff --git a/drivers/crypto/qce/dma.h b/drivers/crypto/qce/dma.h -index 0be71f7f7a58..710d5e370293 100644 --- a/drivers/crypto/qce/dma.h +++ b/drivers/crypto/qce/dma.h -@@ -51,6 +51,6 @@ void qce_dma_issue_pending(struct qce_dma_data *dma); +@@ -51,6 +51,6 @@ void qce_dma_issue_pending(struct qce_dm int qce_dma_terminate_all(struct qce_dma_data *dma); struct scatterlist * qce_sgtable_add(struct sg_table *sgt, struct scatterlist *sg_add, @@ -66,11 +62,9 @@ index 0be71f7f7a58..710d5e370293 100644 + unsigned int max_len); #endif /* _DMA_H_ */ -diff --git a/drivers/crypto/qce/skcipher.c b/drivers/crypto/qce/skcipher.c -index 5af74f2431ca..188eb234ba2c 100644 --- a/drivers/crypto/qce/skcipher.c +++ b/drivers/crypto/qce/skcipher.c -@@ -105,13 +105,14 @@ qce_skcipher_async_req_handle(struct crypto_async_request *async_req) +@@ -105,13 +105,14 @@ qce_skcipher_async_req_handle(struct cry sg_init_one(&rctx->result_sg, qce->dma.result_buf, QCE_RESULT_BUF_SZ); diff --git a/target/linux/ipq40xx/patches-4.19/048-crypto-qce-use-AES-fallback-for-small-requests.patch b/target/linux/ipq40xx/patches-4.19/048-crypto-qce-use-AES-fallback-for-small-requests.patch index 60ebe95c36..514fde7b63 100644 --- a/target/linux/ipq40xx/patches-4.19/048-crypto-qce-use-AES-fallback-for-small-requests.patch +++ b/target/linux/ipq40xx/patches-4.19/048-crypto-qce-use-AES-fallback-for-small-requests.patch @@ -24,13 +24,11 @@ in CPU usage. Signed-off-by: Eneas U de Queiroz -diff --git a/drivers/crypto/Kconfig b/drivers/crypto/Kconfig -index c1595750864e..a0c4d85de4c3 100644 --- a/drivers/crypto/Kconfig +++ b/drivers/crypto/Kconfig -@@ -640,6 +640,29 @@ choice - - endchoice +@@ -585,6 +585,29 @@ config CRYPTO_DEV_QCE + hardware. To compile this driver as a module, choose M here. The + module will be called qcrypto. +config CRYPTO_DEV_QCE_SW_MAX_LEN + int "Default maximum request size to use software for AES" @@ -58,8 +56,6 @@ index c1595750864e..a0c4d85de4c3 100644 config CRYPTO_DEV_QCOM_RNG tristate "Qualcomm Random Number Generator Driver" depends on ARCH_QCOM || COMPILE_TEST -diff --git a/drivers/crypto/qce/skcipher.c b/drivers/crypto/qce/skcipher.c -index 188eb234ba2c..9b72fec2ab2e 100644 --- a/drivers/crypto/qce/skcipher.c +++ b/drivers/crypto/qce/skcipher.c @@ -13,6 +13,7 @@ @@ -84,7 +80,7 @@ index 188eb234ba2c..9b72fec2ab2e 100644 static LIST_HEAD(skcipher_algs); static void qce_skcipher_done(void *data) -@@ -170,15 +178,7 @@ static int qce_skcipher_setkey(struct crypto_skcipher *ablk, const u8 *key, +@@ -170,15 +178,7 @@ static int qce_skcipher_setkey(struct cr if (!key || !keylen) return -EINVAL; @@ -101,7 +97,7 @@ index 188eb234ba2c..9b72fec2ab2e 100644 u32 tmp[DES_EXPKEY_WORDS]; ret = des_ekey(tmp, key); -@@ -189,8 +189,8 @@ static int qce_skcipher_setkey(struct crypto_skcipher *ablk, const u8 *key, +@@ -189,8 +189,8 @@ static int qce_skcipher_setkey(struct cr ctx->enc_keylen = keylen; memcpy(ctx->enc_key, key, keylen); @@ -112,7 +108,7 @@ index 188eb234ba2c..9b72fec2ab2e 100644 ret = crypto_skcipher_setkey(ctx->fallback, key, keylen); if (!ret) ctx->enc_keylen = keylen; -@@ -213,8 +213,9 @@ static int qce_skcipher_crypt(struct skcipher_request *req, int encrypt) +@@ -213,8 +213,9 @@ static int qce_skcipher_crypt(struct skc rctx->flags |= encrypt ? QCE_ENCRYPT : QCE_DECRYPT; keylen = IS_XTS(rctx->flags) ? ctx->enc_keylen >> 1 : ctx->enc_keylen; diff --git a/target/linux/ipq40xx/patches-4.19/049-crypto-qce-handle-AES-XTS-cases-that-qce-fails.patch b/target/linux/ipq40xx/patches-4.19/049-crypto-qce-handle-AES-XTS-cases-that-qce-fails.patch index eee2241d19..00dc3791ab 100644 --- a/target/linux/ipq40xx/patches-4.19/049-crypto-qce-handle-AES-XTS-cases-that-qce-fails.patch +++ b/target/linux/ipq40xx/patches-4.19/049-crypto-qce-handle-AES-XTS-cases-that-qce-fails.patch @@ -9,8 +9,6 @@ fallback cipher handle them. Signed-off-by: Eneas U de Queiroz -diff --git a/drivers/crypto/qce/common.c b/drivers/crypto/qce/common.c -index 3849d7bcaeb0..3e0fcd7613f1 100644 --- a/drivers/crypto/qce/common.c +++ b/drivers/crypto/qce/common.c @@ -23,8 +23,6 @@ @@ -22,8 +20,6 @@ index 3849d7bcaeb0..3e0fcd7613f1 100644 static inline u32 qce_read(struct qce_device *qce, u32 offset) { return readl(qce->base + offset); -diff --git a/drivers/crypto/qce/common.h b/drivers/crypto/qce/common.h -index 3252efa41e7a..5f9d3c4e3ead 100644 --- a/drivers/crypto/qce/common.h +++ b/drivers/crypto/qce/common.h @@ -20,6 +20,9 @@ @@ -36,11 +32,9 @@ index 3252efa41e7a..5f9d3c4e3ead 100644 /* key size in bytes */ #define QCE_SHA_HMAC_KEY_SIZE 64 #define QCE_MAX_CIPHER_KEY_SIZE AES_KEYSIZE_256 -diff --git a/drivers/crypto/qce/skcipher.c b/drivers/crypto/qce/skcipher.c -index 9b72fec2ab2e..e46cb8269640 100644 --- a/drivers/crypto/qce/skcipher.c +++ b/drivers/crypto/qce/skcipher.c -@@ -213,9 +213,14 @@ static int qce_skcipher_crypt(struct skcipher_request *req, int encrypt) +@@ -213,9 +213,14 @@ static int qce_skcipher_crypt(struct skc rctx->flags |= encrypt ? QCE_ENCRYPT : QCE_DECRYPT; keylen = IS_XTS(rctx->flags) ? ctx->enc_keylen >> 1 : ctx->enc_keylen; diff --git a/target/linux/ipq40xx/patches-4.19/051-crypto-qce-allow-building-only-hashes-ciphers.patch b/target/linux/ipq40xx/patches-4.19/051-crypto-qce-allow-building-only-hashes-ciphers.patch index 3d4214929c..11f711940d 100644 --- a/target/linux/ipq40xx/patches-4.19/051-crypto-qce-allow-building-only-hashes-ciphers.patch +++ b/target/linux/ipq40xx/patches-4.19/051-crypto-qce-allow-building-only-hashes-ciphers.patch @@ -5,8 +5,6 @@ Subject: [PATCH] crypto: qce - allow building only hashes/ciphers Signed-off-by: Eneas U de Queiroz -diff --git a/drivers/crypto/Kconfig b/drivers/crypto/Kconfig -index a8c4ce07fc9d..c1595750864e 100644 --- a/drivers/crypto/Kconfig +++ b/drivers/crypto/Kconfig @@ -573,6 +573,14 @@ config CRYPTO_DEV_QCE @@ -28,10 +26,6 @@ index a8c4ce07fc9d..c1595750864e 100644 select CRYPTO_XTS select CRYPTO_CTR select CRYPTO_BLKCIPHER -- help -- This driver supports Qualcomm crypto engine accelerator -- hardware. To compile this driver as a module, choose M here. The -- module will be called qcrypto. + +config CRYPTO_DEV_QCE_SHA + bool @@ -41,7 +35,10 @@ index a8c4ce07fc9d..c1595750864e 100644 + prompt "Algorithms enabled for QCE acceleration" + default CRYPTO_DEV_QCE_ENABLE_ALL + depends on CRYPTO_DEV_QCE -+ help + help +- This driver supports Qualcomm crypto engine accelerator +- hardware. To compile this driver as a module, choose M here. The +- module will be called qcrypto. + This option allows to choose whether to build support for all algorihtms + (default), hashes-only, or skciphers-only. + @@ -84,10 +81,8 @@ index a8c4ce07fc9d..c1595750864e 100644 + +endchoice - config CRYPTO_DEV_QCOM_RNG - tristate "Qualcomm Random Number Generator Driver" -diff --git a/drivers/crypto/qce/Makefile b/drivers/crypto/qce/Makefile -index 8caa04e1ec43..14ade8a7d664 100644 + config CRYPTO_DEV_QCE_SW_MAX_LEN + int "Default maximum request size to use software for AES" --- a/drivers/crypto/qce/Makefile +++ b/drivers/crypto/qce/Makefile @@ -2,6 +2,7 @@ @@ -101,11 +96,9 @@ index 8caa04e1ec43..14ade8a7d664 100644 + +qcrypto-$(CONFIG_CRYPTO_DEV_QCE_SHA) += sha.o +qcrypto-$(CONFIG_CRYPTO_DEV_QCE_SKCIPHER) += skcipher.o -diff --git a/drivers/crypto/qce/common.c b/drivers/crypto/qce/common.c -index e0202755682b..3849d7bcaeb0 100644 --- a/drivers/crypto/qce/common.c +++ b/drivers/crypto/qce/common.c -@@ -53,52 +53,56 @@ qce_clear_array(struct qce_device *qce, u32 offset, unsigned int len) +@@ -51,52 +51,56 @@ qce_clear_array(struct qce_device *qce, qce_write(qce, offset + i * sizeof(u32), 0); } @@ -198,7 +191,7 @@ index e0202755682b..3849d7bcaeb0 100644 static u32 qce_auth_cfg(unsigned long flags, u32 key_size) { u32 cfg = 0; -@@ -145,88 +149,6 @@ static u32 qce_auth_cfg(unsigned long flags, u32 key_size) +@@ -143,88 +147,6 @@ static u32 qce_auth_cfg(unsigned long fl return cfg; } @@ -287,7 +280,7 @@ index e0202755682b..3849d7bcaeb0 100644 static int qce_setup_regs_ahash(struct crypto_async_request *async_req, u32 totallen, u32 offset) { -@@ -311,6 +233,87 @@ static int qce_setup_regs_ahash(struct crypto_async_request *async_req, +@@ -309,6 +231,87 @@ go_proc: return 0; } @@ -375,7 +368,7 @@ index e0202755682b..3849d7bcaeb0 100644 static int qce_setup_regs_skcipher(struct crypto_async_request *async_req, u32 totallen, u32 offset) -@@ -392,15 +395,20 @@ static int qce_setup_regs_skcipher(struct crypto_async_request *async_req, +@@ -390,15 +393,20 @@ static int qce_setup_regs_skcipher(struc return 0; } @@ -396,8 +389,6 @@ index e0202755682b..3849d7bcaeb0 100644 default: return -EINVAL; } -diff --git a/drivers/crypto/qce/core.c b/drivers/crypto/qce/core.c -index bf409edc23ab..4ad79b67fc51 100644 --- a/drivers/crypto/qce/core.c +++ b/drivers/crypto/qce/core.c @@ -30,8 +30,12 @@ diff --git a/target/linux/mediatek/patches-4.19/0001-eth-sync-from-mtk-lede.patch b/target/linux/mediatek/patches-4.19/0001-eth-sync-from-mtk-lede.patch index 814f66cc4e..0232bd203a 100644 --- a/target/linux/mediatek/patches-4.19/0001-eth-sync-from-mtk-lede.patch +++ b/target/linux/mediatek/patches-4.19/0001-eth-sync-from-mtk-lede.patch @@ -983,7 +983,7 @@ }; static const struct net_device_ops mtk_netdev_ops = { -@@ -2463,6 +2519,7 @@ static int mtk_probe(struct platform_dev +@@ -2465,6 +2521,7 @@ static int mtk_probe(struct platform_dev { struct resource *res = platform_get_resource(pdev, IORESOURCE_MEM, 0); struct device_node *mac_np; @@ -991,7 +991,7 @@ struct mtk_eth *eth; int err; int i; -@@ -2471,7 +2528,8 @@ static int mtk_probe(struct platform_dev +@@ -2473,7 +2530,8 @@ static int mtk_probe(struct platform_dev if (!eth) return -ENOMEM; @@ -1001,7 +1001,7 @@ eth->dev = &pdev->dev; eth->base = devm_ioremap_resource(&pdev->dev, res); -@@ -2489,26 +2547,37 @@ static int mtk_probe(struct platform_dev +@@ -2491,26 +2549,37 @@ static int mtk_probe(struct platform_dev return PTR_ERR(eth->ethsys); } @@ -1048,7 +1048,7 @@ eth->irq[i] = platform_get_irq(pdev, i); if (eth->irq[i] < 0) { dev_err(&pdev->dev, "no IRQ%d resource found\n", i); -@@ -2552,15 +2621,22 @@ static int mtk_probe(struct platform_dev +@@ -2554,15 +2623,22 @@ static int mtk_probe(struct platform_dev goto err_deinit_hw; } @@ -1079,7 +1079,7 @@ err = mtk_mdio_init(eth); if (err) -@@ -2626,27 +2702,48 @@ static int mtk_remove(struct platform_de +@@ -2628,27 +2704,48 @@ static int mtk_remove(struct platform_de } static const struct mtk_soc_data mt2701_data = { From c2c5bc8041a1e3b7df39c2aebc3109c4bb3812b6 Mon Sep 17 00:00:00 2001 From: CN_SZTL Date: Tue, 11 Aug 2020 22:54:05 +0800 Subject: [PATCH 07/10] ipq40xx: revert changes of some patches Signed-off-by: CN_SZTL --- ...pto-qce-fix-ctr-aes-qce-block-chunk-sizes.patch | 6 ++++-- .../042-crypto-qce-fix-xts-aes-qce-key-sizes.patch | 8 +++++--- ...o-qce-save-a-sg-table-slot-for-result-buf.patch | 14 ++++++++++---- .../044-crypto-qce-update-the-skcipher-IV.patch | 6 ++++-- ...ypto-qce-initialize-fallback-only-for-AES.patch | 6 ++++-- ...to-qce-use-cryptlen-when-adding-extra-sgl.patch | 14 ++++++++++---- ...o-qce-handle-AES-XTS-cases-that-qce-fails.patch | 8 +++++++- 7 files changed, 44 insertions(+), 18 deletions(-) diff --git a/target/linux/ipq40xx/patches-4.19/041-crypto-qce-fix-ctr-aes-qce-block-chunk-sizes.patch b/target/linux/ipq40xx/patches-4.19/041-crypto-qce-fix-ctr-aes-qce-block-chunk-sizes.patch index 59f7445a15..7d822c59d6 100644 --- a/target/linux/ipq40xx/patches-4.19/041-crypto-qce-fix-ctr-aes-qce-block-chunk-sizes.patch +++ b/target/linux/ipq40xx/patches-4.19/041-crypto-qce-fix-ctr-aes-qce-block-chunk-sizes.patch @@ -9,6 +9,8 @@ size belongs. Signed-off-by: Eneas U de Queiroz +diff --git a/drivers/crypto/qce/skcipher.c b/drivers/crypto/qce/skcipher.c +index 0376bb969834..0776286cfc9e 100644 --- a/drivers/crypto/qce/skcipher.c +++ b/drivers/crypto/qce/skcipher.c @@ -261,6 +261,7 @@ struct qce_skcipher_def { @@ -19,7 +21,7 @@ Signed-off-by: Eneas U de Queiroz unsigned int ivsize; unsigned int min_keysize; unsigned int max_keysize; -@@ -289,7 +290,8 @@ static const struct qce_skcipher_def skc +@@ -289,7 +290,8 @@ static const struct qce_skcipher_def skcipher_def[] = { .flags = QCE_ALG_AES | QCE_MODE_CTR, .name = "ctr(aes)", .drv_name = "ctr-aes-qce", @@ -29,7 +31,7 @@ Signed-off-by: Eneas U de Queiroz .ivsize = AES_BLOCK_SIZE, .min_keysize = AES_MIN_KEY_SIZE, .max_keysize = AES_MAX_KEY_SIZE, -@@ -359,6 +361,7 @@ static int qce_skcipher_register_one(con +@@ -359,6 +361,7 @@ static int qce_skcipher_register_one(const struct qce_skcipher_def *def, def->drv_name); alg->base.cra_blocksize = def->blocksize; diff --git a/target/linux/ipq40xx/patches-4.19/042-crypto-qce-fix-xts-aes-qce-key-sizes.patch b/target/linux/ipq40xx/patches-4.19/042-crypto-qce-fix-xts-aes-qce-key-sizes.patch index 50b888351c..dd58dcd801 100644 --- a/target/linux/ipq40xx/patches-4.19/042-crypto-qce-fix-xts-aes-qce-key-sizes.patch +++ b/target/linux/ipq40xx/patches-4.19/042-crypto-qce-fix-xts-aes-qce-key-sizes.patch @@ -8,9 +8,11 @@ skcipher_def, and halved when checking if it is AES-128/192/256. Signed-off-by: Eneas U de Queiroz +diff --git a/drivers/crypto/qce/skcipher.c b/drivers/crypto/qce/skcipher.c +index 0776286cfc9e..9b1bb32515b4 100644 --- a/drivers/crypto/qce/skcipher.c +++ b/drivers/crypto/qce/skcipher.c -@@ -168,7 +168,7 @@ static int qce_skcipher_setkey(struct cr +@@ -168,7 +168,7 @@ static int qce_skcipher_setkey(struct crypto_skcipher *ablk, const u8 *key, return -EINVAL; if (IS_AES(flags)) { @@ -19,7 +21,7 @@ Signed-off-by: Eneas U de Queiroz case AES_KEYSIZE_128: case AES_KEYSIZE_256: break; -@@ -203,13 +203,15 @@ static int qce_skcipher_crypt(struct skc +@@ -203,13 +203,15 @@ static int qce_skcipher_crypt(struct skcipher_request *req, int encrypt) struct qce_cipher_ctx *ctx = crypto_skcipher_ctx(tfm); struct qce_cipher_reqctx *rctx = skcipher_request_ctx(req); struct qce_alg_template *tmpl = to_cipher_tmpl(tfm); @@ -37,7 +39,7 @@ Signed-off-by: Eneas U de Queiroz SKCIPHER_REQUEST_ON_STACK(subreq, ctx->fallback); skcipher_request_set_tfm(subreq, ctx->fallback); -@@ -302,8 +304,8 @@ static const struct qce_skcipher_def skc +@@ -302,8 +304,8 @@ static const struct qce_skcipher_def skcipher_def[] = { .drv_name = "xts-aes-qce", .blocksize = AES_BLOCK_SIZE, .ivsize = AES_BLOCK_SIZE, diff --git a/target/linux/ipq40xx/patches-4.19/043-crypto-qce-save-a-sg-table-slot-for-result-buf.patch b/target/linux/ipq40xx/patches-4.19/043-crypto-qce-save-a-sg-table-slot-for-result-buf.patch index 95650690fb..9f107db035 100644 --- a/target/linux/ipq40xx/patches-4.19/043-crypto-qce-save-a-sg-table-slot-for-result-buf.patch +++ b/target/linux/ipq40xx/patches-4.19/043-crypto-qce-save-a-sg-table-slot-for-result-buf.patch @@ -21,9 +21,11 @@ for the result buffer is guaranteed to be unused. Signed-off-by: Eneas U de Queiroz +diff --git a/drivers/crypto/qce/dma.c b/drivers/crypto/qce/dma.c +index 4797e795c9b9..db560c3d3e4f 100644 --- a/drivers/crypto/qce/dma.c +++ b/drivers/crypto/qce/dma.c -@@ -55,7 +55,8 @@ void qce_dma_release(struct qce_dma_data +@@ -55,7 +55,8 @@ void qce_dma_release(struct qce_dma_data *dma) } struct scatterlist * @@ -33,7 +35,7 @@ Signed-off-by: Eneas U de Queiroz { struct scatterlist *sg = sgt->sgl, *sg_last = NULL; -@@ -68,12 +69,13 @@ qce_sgtable_add(struct sg_table *sgt, st +@@ -68,12 +69,13 @@ qce_sgtable_add(struct sg_table *sgt, struct scatterlist *new_sgl) if (!sg) return ERR_PTR(-EINVAL); @@ -48,9 +50,11 @@ Signed-off-by: Eneas U de Queiroz } return sg_last; +diff --git a/drivers/crypto/qce/dma.h b/drivers/crypto/qce/dma.h +index 130235d17bb4..0be71f7f7a58 100644 --- a/drivers/crypto/qce/dma.h +++ b/drivers/crypto/qce/dma.h -@@ -50,6 +50,7 @@ int qce_dma_prep_sgs(struct qce_dma_data +@@ -50,6 +50,7 @@ int qce_dma_prep_sgs(struct qce_dma_data *dma, struct scatterlist *sg_in, void qce_dma_issue_pending(struct qce_dma_data *dma); int qce_dma_terminate_all(struct qce_dma_data *dma); struct scatterlist * @@ -59,9 +63,11 @@ Signed-off-by: Eneas U de Queiroz + int max_ents); #endif /* _DMA_H_ */ +diff --git a/drivers/crypto/qce/skcipher.c b/drivers/crypto/qce/skcipher.c +index 12f882032544..33d998f5cf5f 100644 --- a/drivers/crypto/qce/skcipher.c +++ b/drivers/crypto/qce/skcipher.c -@@ -103,13 +103,13 @@ qce_skcipher_async_req_handle(struct cry +@@ -103,13 +103,13 @@ qce_skcipher_async_req_handle(struct crypto_async_request *async_req) sg_init_one(&rctx->result_sg, qce->dma.result_buf, QCE_RESULT_BUF_SZ); diff --git a/target/linux/ipq40xx/patches-4.19/044-crypto-qce-update-the-skcipher-IV.patch b/target/linux/ipq40xx/patches-4.19/044-crypto-qce-update-the-skcipher-IV.patch index 33be510a82..de7829e767 100644 --- a/target/linux/ipq40xx/patches-4.19/044-crypto-qce-update-the-skcipher-IV.patch +++ b/target/linux/ipq40xx/patches-4.19/044-crypto-qce-update-the-skcipher-IV.patch @@ -7,9 +7,11 @@ Update the IV after the completion of each cipher operation. Signed-off-by: Eneas U de Queiroz +diff --git a/drivers/crypto/qce/skcipher.c b/drivers/crypto/qce/skcipher.c +index 33d998f5cf5f..51377395ed53 100644 --- a/drivers/crypto/qce/skcipher.c +++ b/drivers/crypto/qce/skcipher.c -@@ -29,6 +29,7 @@ static void qce_skcipher_done(void *data +@@ -29,6 +29,7 @@ static void qce_skcipher_done(void *data) struct qce_cipher_reqctx *rctx = skcipher_request_ctx(req); struct qce_alg_template *tmpl = to_cipher_tmpl(crypto_skcipher_reqtfm(req)); struct qce_device *qce = tmpl->qce; @@ -17,7 +19,7 @@ Signed-off-by: Eneas U de Queiroz enum dma_data_direction dir_src, dir_dst; u32 status; int error; -@@ -53,6 +54,7 @@ static void qce_skcipher_done(void *data +@@ -53,6 +54,7 @@ static void qce_skcipher_done(void *data) if (error < 0) dev_dbg(qce->dev, "skcipher operation error (%x)\n", status); diff --git a/target/linux/ipq40xx/patches-4.19/046-crypto-qce-initialize-fallback-only-for-AES.patch b/target/linux/ipq40xx/patches-4.19/046-crypto-qce-initialize-fallback-only-for-AES.patch index e3adaf864e..b673884ba2 100644 --- a/target/linux/ipq40xx/patches-4.19/046-crypto-qce-initialize-fallback-only-for-AES.patch +++ b/target/linux/ipq40xx/patches-4.19/046-crypto-qce-initialize-fallback-only-for-AES.patch @@ -12,9 +12,11 @@ restricted to AES. Signed-off-by: Eneas U de Queiroz +diff --git a/drivers/crypto/qce/skcipher.c b/drivers/crypto/qce/skcipher.c +index 51377395ed53..5a4863091f2a 100644 --- a/drivers/crypto/qce/skcipher.c +++ b/drivers/crypto/qce/skcipher.c -@@ -246,7 +246,15 @@ static int qce_skcipher_init(struct cryp +@@ -246,7 +246,15 @@ static int qce_skcipher_init(struct crypto_skcipher *tfm) memset(ctx, 0, sizeof(*ctx)); crypto_skcipher_set_reqsize(tfm, sizeof(struct qce_cipher_reqctx)); @@ -30,7 +32,7 @@ Signed-off-by: Eneas U de Queiroz ctx->fallback = crypto_alloc_skcipher(crypto_tfm_alg_name(&tfm->base), 0, CRYPTO_ALG_ASYNC | CRYPTO_ALG_NEED_FALLBACK); -@@ -375,14 +383,18 @@ static int qce_skcipher_register_one(con +@@ -375,14 +383,18 @@ static int qce_skcipher_register_one(const struct qce_skcipher_def *def, alg->base.cra_priority = 300; alg->base.cra_flags = CRYPTO_ALG_ASYNC | diff --git a/target/linux/ipq40xx/patches-4.19/047-crypto-qce-use-cryptlen-when-adding-extra-sgl.patch b/target/linux/ipq40xx/patches-4.19/047-crypto-qce-use-cryptlen-when-adding-extra-sgl.patch index aabc8fd622..8003f7502a 100644 --- a/target/linux/ipq40xx/patches-4.19/047-crypto-qce-use-cryptlen-when-adding-extra-sgl.patch +++ b/target/linux/ipq40xx/patches-4.19/047-crypto-qce-use-cryptlen-when-adding-extra-sgl.patch @@ -20,9 +20,11 @@ destination buffer to req->cryptlen before appending the result buf. Signed-off-by: Eneas U de Queiroz +diff --git a/drivers/crypto/qce/dma.c b/drivers/crypto/qce/dma.c +index db560c3d3e4f..0ae9d28afa69 100644 --- a/drivers/crypto/qce/dma.c +++ b/drivers/crypto/qce/dma.c -@@ -56,9 +56,10 @@ void qce_dma_release(struct qce_dma_data +@@ -56,9 +56,10 @@ void qce_dma_release(struct qce_dma_data *dma) struct scatterlist * qce_sgtable_add(struct sg_table *sgt, struct scatterlist *new_sgl, @@ -34,7 +36,7 @@ Signed-off-by: Eneas U de Queiroz while (sg) { if (!sg_page(sg)) -@@ -69,13 +70,13 @@ qce_sgtable_add(struct sg_table *sgt, st +@@ -69,13 +70,13 @@ qce_sgtable_add(struct sg_table *sgt, struct scatterlist *new_sgl, if (!sg) return ERR_PTR(-EINVAL); @@ -52,9 +54,11 @@ Signed-off-by: Eneas U de Queiroz } return sg_last; +diff --git a/drivers/crypto/qce/dma.h b/drivers/crypto/qce/dma.h +index 0be71f7f7a58..710d5e370293 100644 --- a/drivers/crypto/qce/dma.h +++ b/drivers/crypto/qce/dma.h -@@ -51,6 +51,6 @@ void qce_dma_issue_pending(struct qce_dm +@@ -51,6 +51,6 @@ void qce_dma_issue_pending(struct qce_dma_data *dma); int qce_dma_terminate_all(struct qce_dma_data *dma); struct scatterlist * qce_sgtable_add(struct sg_table *sgt, struct scatterlist *sg_add, @@ -62,9 +66,11 @@ Signed-off-by: Eneas U de Queiroz + unsigned int max_len); #endif /* _DMA_H_ */ +diff --git a/drivers/crypto/qce/skcipher.c b/drivers/crypto/qce/skcipher.c +index 5af74f2431ca..188eb234ba2c 100644 --- a/drivers/crypto/qce/skcipher.c +++ b/drivers/crypto/qce/skcipher.c -@@ -105,13 +105,14 @@ qce_skcipher_async_req_handle(struct cry +@@ -105,13 +105,14 @@ qce_skcipher_async_req_handle(struct crypto_async_request *async_req) sg_init_one(&rctx->result_sg, qce->dma.result_buf, QCE_RESULT_BUF_SZ); diff --git a/target/linux/ipq40xx/patches-4.19/049-crypto-qce-handle-AES-XTS-cases-that-qce-fails.patch b/target/linux/ipq40xx/patches-4.19/049-crypto-qce-handle-AES-XTS-cases-that-qce-fails.patch index 00dc3791ab..eee2241d19 100644 --- a/target/linux/ipq40xx/patches-4.19/049-crypto-qce-handle-AES-XTS-cases-that-qce-fails.patch +++ b/target/linux/ipq40xx/patches-4.19/049-crypto-qce-handle-AES-XTS-cases-that-qce-fails.patch @@ -9,6 +9,8 @@ fallback cipher handle them. Signed-off-by: Eneas U de Queiroz +diff --git a/drivers/crypto/qce/common.c b/drivers/crypto/qce/common.c +index 3849d7bcaeb0..3e0fcd7613f1 100644 --- a/drivers/crypto/qce/common.c +++ b/drivers/crypto/qce/common.c @@ -23,8 +23,6 @@ @@ -20,6 +22,8 @@ Signed-off-by: Eneas U de Queiroz static inline u32 qce_read(struct qce_device *qce, u32 offset) { return readl(qce->base + offset); +diff --git a/drivers/crypto/qce/common.h b/drivers/crypto/qce/common.h +index 3252efa41e7a..5f9d3c4e3ead 100644 --- a/drivers/crypto/qce/common.h +++ b/drivers/crypto/qce/common.h @@ -20,6 +20,9 @@ @@ -32,9 +36,11 @@ Signed-off-by: Eneas U de Queiroz /* key size in bytes */ #define QCE_SHA_HMAC_KEY_SIZE 64 #define QCE_MAX_CIPHER_KEY_SIZE AES_KEYSIZE_256 +diff --git a/drivers/crypto/qce/skcipher.c b/drivers/crypto/qce/skcipher.c +index 9b72fec2ab2e..e46cb8269640 100644 --- a/drivers/crypto/qce/skcipher.c +++ b/drivers/crypto/qce/skcipher.c -@@ -213,9 +213,14 @@ static int qce_skcipher_crypt(struct skc +@@ -213,9 +213,14 @@ static int qce_skcipher_crypt(struct skcipher_request *req, int encrypt) rctx->flags |= encrypt ? QCE_ENCRYPT : QCE_DECRYPT; keylen = IS_XTS(rctx->flags) ? ctx->enc_keylen >> 1 : ctx->enc_keylen; From 6a30e4c16678ec7e19a2f5445d16e8083330a1e9 Mon Sep 17 00:00:00 2001 From: CN_SZTL Date: Tue, 11 Aug 2020 23:01:41 +0800 Subject: [PATCH 08/10] luci-app-turboacc: drop outdated command --- package/lean/luci-app-turboacc/root/etc/init.d/turboacc | 1 - 1 file changed, 1 deletion(-) diff --git a/package/lean/luci-app-turboacc/root/etc/init.d/turboacc b/package/lean/luci-app-turboacc/root/etc/init.d/turboacc index 8da72c9200..70bab74434 100755 --- a/package/lean/luci-app-turboacc/root/etc/init.d/turboacc +++ b/package/lean/luci-app-turboacc/root/etc/init.d/turboacc @@ -184,7 +184,6 @@ EOF } stop_dnscache() { - killall -9 "AdGuardHome" 2>"/dev/null" killall -9 "dnscache" 2>"/dev/null" kill -9 $(ps | grep dnscache-while.sh | grep -v "grep" | awk '{print $1}') 2>"/dev/null" rm -rf "/var/dnscache" "/var/run/dnscache" From 5267a2aed65caf8342cc41ac5f40664f5f58d2bb Mon Sep 17 00:00:00 2001 From: CN_SZTL Date: Tue, 11 Aug 2020 23:28:54 +0800 Subject: [PATCH 09/10] shortcut-fe: drop useless file --- package/lean/shortcut-fe/Makefile | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/package/lean/shortcut-fe/Makefile b/package/lean/shortcut-fe/Makefile index 99017f3f59..f0abdf82f0 100644 --- a/package/lean/shortcut-fe/Makefile +++ b/package/lean/shortcut-fe/Makefile @@ -37,12 +37,12 @@ define KernelPackage/shortcut-fe/Description Shortcut is an in-Linux-kernel IP packet forwarding engine. endef -define KernelPackage/shortcut-fe/install - $(INSTALL_DIR) $(1)/etc/init.d - $(INSTALL_BIN) ./files/etc/init.d/shortcut-fe $(1)/etc/init.d - $(INSTALL_DIR) $(1)/usr/bin - $(INSTALL_BIN) ./files/usr/bin/sfe_dump $(1)/usr/bin -endef +#define KernelPackage/shortcut-fe/install +# $(INSTALL_DIR) $(1)/etc/init.d +# $(INSTALL_BIN) ./files/etc/init.d/shortcut-fe $(1)/etc/init.d +# $(INSTALL_DIR) $(1)/usr/bin +# $(INSTALL_BIN) ./files/usr/bin/sfe_dump $(1)/usr/bin +#endef define KernelPackage/shortcut-fe-cm SECTION:=kernel From 1465f170087ec3c88cb69e453656649088fe0d88 Mon Sep 17 00:00:00 2001 From: CN_SZTL Date: Wed, 12 Aug 2020 00:07:59 +0800 Subject: [PATCH 10/10] luci-app-ssr-plus: bump to 180-5 --- package/lean/luci-app-ssr-plus/Makefile | 2 +- .../luci-app-ssr-plus/root/etc/ssr/china_ssr.txt | 6 ++++++ .../luci-app-ssr-plus/root/etc/ssr/gfw_list.conf | 16 ++++++++++++---- .../luci-app-ssr-plus/root/usr/bin/ssr-switch | 5 ++--- 4 files changed, 21 insertions(+), 8 deletions(-) diff --git a/package/lean/luci-app-ssr-plus/Makefile b/package/lean/luci-app-ssr-plus/Makefile index f5df4d459c..4062dc175d 100644 --- a/package/lean/luci-app-ssr-plus/Makefile +++ b/package/lean/luci-app-ssr-plus/Makefile @@ -2,7 +2,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=luci-app-ssr-plus PKG_VERSION:=180 -PKG_RELEASE:=3 +PKG_RELEASE:=5 include $(INCLUDE_DIR)/package.mk diff --git a/package/lean/luci-app-ssr-plus/root/etc/ssr/china_ssr.txt b/package/lean/luci-app-ssr-plus/root/etc/ssr/china_ssr.txt index e8079c796a..a1d03fd668 100644 --- a/package/lean/luci-app-ssr-plus/root/etc/ssr/china_ssr.txt +++ b/package/lean/luci-app-ssr-plus/root/etc/ssr/china_ssr.txt @@ -4069,6 +4069,11 @@ 103.153.138.0/23 103.153.146.0/23 103.153.160.0/23 +103.154.18.0/23 +103.154.30.0/23 +103.154.32.0/23 +103.154.40.0/23 +103.154.66.0/23 103.192.0.0/22 103.192.4.0/22 103.192.8.0/22 @@ -6117,6 +6122,7 @@ 153.101.0.0/16 153.118.0.0/15 154.8.128.0/17 +156.59.0.0/16 157.0.0.0/16 157.18.0.0/16 157.61.0.0/16 diff --git a/package/lean/luci-app-ssr-plus/root/etc/ssr/gfw_list.conf b/package/lean/luci-app-ssr-plus/root/etc/ssr/gfw_list.conf index 7f787ddbaa..09e5df1623 100644 --- a/package/lean/luci-app-ssr-plus/root/etc/ssr/gfw_list.conf +++ b/package/lean/luci-app-ssr-plus/root/etc/ssr/gfw_list.conf @@ -1820,8 +1820,6 @@ server=/compileheart.com/127.0.0.1#5335 ipset=/compileheart.com/gfwlist server=/compress.to/127.0.0.1#5335 ipset=/compress.to/gfwlist -server=/connect.facebook.net/127.0.0.1#5335 -ipset=/connect.facebook.net/gfwlist server=/conoha.jp/127.0.0.1#5335 ipset=/conoha.jp/gfwlist server=/contactmagazine.net/127.0.0.1#5335 @@ -2716,6 +2714,8 @@ server=/facebook.hu/127.0.0.1#5335 ipset=/facebook.hu/gfwlist server=/facebook.in/127.0.0.1#5335 ipset=/facebook.in/gfwlist +server=/facebook.net/127.0.0.1#5335 +ipset=/facebook.net/gfwlist server=/facebook.nl/127.0.0.1#5335 ipset=/facebook.nl/gfwlist server=/facebook.se/127.0.0.1#5335 @@ -3650,6 +3650,8 @@ server=/google.vu/127.0.0.1#5335 ipset=/google.vu/gfwlist server=/google.ws/127.0.0.1#5335 ipset=/google.ws/gfwlist +server=/googleanalytics.com/127.0.0.1#5335 +ipset=/googleanalytics.com/gfwlist server=/googleapis.com/127.0.0.1#5335 ipset=/googleapis.com/gfwlist server=/googleapps.com/127.0.0.1#5335 @@ -3702,6 +3704,8 @@ server=/googlesile.com/127.0.0.1#5335 ipset=/googlesile.com/gfwlist server=/googlesource.com/127.0.0.1#5335 ipset=/googlesource.com/gfwlist +server=/googlesyndication.com/127.0.0.1#5335 +ipset=/googlesyndication.com/gfwlist server=/googleusercontent.com/127.0.0.1#5335 ipset=/googleusercontent.com/gfwlist server=/googlevideo.com/127.0.0.1#5335 @@ -4486,6 +4490,8 @@ server=/inmediahk.net/127.0.0.1#5335 ipset=/inmediahk.net/gfwlist server=/innermongolia.org/127.0.0.1#5335 ipset=/innermongolia.org/gfwlist +server=/inoreader.com/127.0.0.1#5335 +ipset=/inoreader.com/gfwlist server=/inote.tw/127.0.0.1#5335 ipset=/inote.tw/gfwlist server=/insecam.org/127.0.0.1#5335 @@ -5714,6 +5720,8 @@ server=/my.pcloud.com/127.0.0.1#5335 ipset=/my.pcloud.com/gfwlist server=/my03.com/127.0.0.1#5335 ipset=/my03.com/gfwlist +server=/myactimes.com/127.0.0.1#5335 +ipset=/myactimes.com/gfwlist server=/myanniu.com/127.0.0.1#5335 ipset=/myanniu.com/gfwlist server=/myaudiocast.com/127.0.0.1#5335 @@ -6112,8 +6120,6 @@ server=/nwtca.org/127.0.0.1#5335 ipset=/nwtca.org/gfwlist server=/ny.stgloballink.com/127.0.0.1#5335 ipset=/ny.stgloballink.com/gfwlist -server=/ny.visiontimes.com/127.0.0.1#5335 -ipset=/ny.visiontimes.com/gfwlist server=/nyaa.eu/127.0.0.1#5335 ipset=/nyaa.eu/gfwlist server=/nyaa.si/127.0.0.1#5335 @@ -7478,6 +7484,8 @@ server=/skyvegas.com/127.0.0.1#5335 ipset=/skyvegas.com/gfwlist server=/skyxvpn.com/127.0.0.1#5335 ipset=/skyxvpn.com/gfwlist +server=/sl-reverse.com/127.0.0.1#5335 +ipset=/sl-reverse.com/gfwlist server=/slaytizle.com/127.0.0.1#5335 ipset=/slaytizle.com/gfwlist server=/sleazydream.com/127.0.0.1#5335 diff --git a/package/lean/luci-app-ssr-plus/root/usr/bin/ssr-switch b/package/lean/luci-app-ssr-plus/root/usr/bin/ssr-switch index b4338458c9..c73d975604 100755 --- a/package/lean/luci-app-ssr-plus/root/usr/bin/ssr-switch +++ b/package/lean/luci-app-ssr-plus/root/usr/bin/ssr-switch @@ -81,9 +81,8 @@ test_proxy() { local serverport=$(uci_get_by_name $1 server_port) ipset add ss_spec_wan_ac $servername 2>/dev/null ret1=$? - ret=$(tcping -q -c 3 -i 1 -t 2 -p $serverport $servername) - #echo "$(date "+%Y-%m-%d %H:%M:%S") test_proxy> name: $servername, ret1: $ret1, ret: $ret" >> /tmp/ssrplus.log - if [ "$ret" -gt "0" ]; then + tcping -q -c 3 -i 1 -t 2 -p $serverport $servername + if [ "$?" -gt "0" ]; then [ "$ret1" == "0" ] && ipset del ss_spec_wan_ac $servername 2>/dev/null return 1 fi