Re: [OpenWrt-Devel] [PATCH] ramips: Fix WiFi after 5f7396ebef09b224edf08b0bda113613a42f0928

2018-05-31 Thread Rosen Penev
On Thu, May 31, 2018 at 10:02 PM, Felix Fietkau  wrote:
> On 2018-05-29 20:03, Rosen Penev wrote:
>> That commit exposed a bug in the DTS files used by mt7621 where the wrong
>> reg value for pcie1 (and potentially pcie2) was being used. This was
>> causing WiFi failures for interfaces in pcie1.
>>
>> eg. 2.4GHz working but not 5GHz.
>>
>> As all of these dts entries are already specified in mt7621.dtsi, remove
>> them.
>>
>> Signed-off-by: Rosen Penev 
> Did you verify that the EEPROM related settings in the .dts are still
> used? It looks to me like you actually broke that with this patch.
I did not. One user says it fixed his WiFi and another says it broke it.

On further investigation, it seems the problem is something to do with
the interrupts. cat /proc/interrupts shows interrupts 23,24,25 whereas
I believe it used to show 24,25,26 for the pcie interfaces.

I hope to get this sorted out by the weekend.
>
> - Felix

___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/listinfo/openwrt-devel


Re: [OpenWrt-Devel] [PATCH] ramips: Fix WiFi after 5f7396ebef09b224edf08b0bda113613a42f0928

2018-05-31 Thread Felix Fietkau
On 2018-05-29 20:03, Rosen Penev wrote:
> That commit exposed a bug in the DTS files used by mt7621 where the wrong
> reg value for pcie1 (and potentially pcie2) was being used. This was
> causing WiFi failures for interfaces in pcie1.
> 
> eg. 2.4GHz working but not 5GHz.
> 
> As all of these dts entries are already specified in mt7621.dtsi, remove
> them.
> 
> Signed-off-by: Rosen Penev 
Did you verify that the EEPROM related settings in the .dts are still
used? It looks to me like you actually broke that with this patch.

- Felix

___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/listinfo/openwrt-devel


[OpenWrt-Devel] [RFC 2/3] ath25: factor out Fonera 2.0g kernel options

2018-05-31 Thread Sergey Ryazanov
Disable SoCs and PCI options in the common ath25 kernel config and
enable required options on per-subtarget basis. E.g. generic config
activates all SoCs but keeps PCI support disabled, and fon2202 config
activates only AR2315 but with the PCI support.

Signed-off-by: Sergey Ryazanov 
---
 target/linux/ath25/config-4.14| 14 ++
 target/linux/ath25/fon2202/config-default | 10 ++
 target/linux/ath25/generic/config-default |  6 ++
 3 files changed, 18 insertions(+), 12 deletions(-)
 create mode 100644 target/linux/ath25/fon2202/config-default
 create mode 100644 target/linux/ath25/generic/config-default

diff --git a/target/linux/ath25/config-4.14 b/target/linux/ath25/config-4.14
index 4d3f0c697e..742c8fd78c 100644
--- a/target/linux/ath25/config-4.14
+++ b/target/linux/ath25/config-4.14
@@ -23,7 +23,6 @@ CONFIG_ARCH_USE_QUEUED_RWLOCKS=y
 CONFIG_ARCH_USE_QUEUED_SPINLOCKS=y
 CONFIG_ARCH_WANT_IPC_PARSE_VERSION=y
 CONFIG_ATH25=y
-CONFIG_BLK_MQ_PCI=y
 CONFIG_CEVT_R4K=y
 CONFIG_CLONE_BACKWARDS=y
 CONFIG_CMDLINE="console=ttyS0,9600 rootfstype=squashfs,jffs2"
@@ -60,8 +59,6 @@ CONFIG_GENERIC_SCHED_CLOCK=y
 CONFIG_GENERIC_SMP_IDLE_THREAD=y
 CONFIG_GENERIC_TIME_VSYSCALL=y
 CONFIG_GPIOLIB=y
-CONFIG_GPIO_AR2315=y
-CONFIG_GPIO_AR5312=y
 CONFIG_GPIO_SYSFS=y
 # CONFIG_GRO_CELLS is not set
 CONFIG_HANDLE_DOMAIN_IRQ=y
@@ -103,7 +100,6 @@ CONFIG_HAVE_PERF_EVENTS=y
 CONFIG_HAVE_REGS_AND_STACK_ACCESS_API=y
 CONFIG_HAVE_SYSCALL_TRACEPOINTS=y
 CONFIG_HAVE_VIRT_CPU_ACCOUNTING_GEN=y
-CONFIG_HW_HAS_PCI=y
 CONFIG_HW_RANDOM=y
 CONFIG_HZ_PERIODIC=y
 CONFIG_INITRAMFS_SOURCE=""
@@ -125,7 +121,6 @@ CONFIG_MIPS_CMDLINE_FROM_BOOTLOADER=y
 CONFIG_MIPS_L1_CACHE_SHIFT=5
 # CONFIG_MIPS_MACHINE is not set
 CONFIG_MODULES_USE_ELF_REL=y
-CONFIG_MTD_AR2315=y
 CONFIG_MTD_CFI_ADV_OPTIONS=y
 # CONFIG_MTD_CFI_GEOMETRY is not set
 # CONFIG_MTD_CFI_INTELEXT is not set
@@ -140,10 +135,6 @@ CONFIG_NET_AR231X=y
 CONFIG_NO_GENERIC_PCI_IOPORT_MAP=y
 # CONFIG_NO_IOPORT_MAP is not set
 # CONFIG_OF is not set
-CONFIG_PCI=y
-CONFIG_PCI_AR2315=y
-CONFIG_PCI_DISABLE_COMMON_QUIRKS=y
-CONFIG_PCI_DOMAINS=y
 CONFIG_PCI_DRIVERS_LEGACY=y
 CONFIG_PERF_USE_VMALLOC=y
 CONFIG_PGTABLE_LEVELS=2
@@ -155,8 +146,8 @@ CONFIG_PHYLIB=y
 # CONFIG_SERIAL_8250_FSL is not set
 CONFIG_SERIAL_8250_NR_UARTS=1
 CONFIG_SERIAL_8250_RUNTIME_UARTS=1
-CONFIG_SOC_AR2315=y
-CONFIG_SOC_AR5312=y
+# CONFIG_SOC_AR2315 is not set
+# CONFIG_SOC_AR5312 is not set
 CONFIG_SRCU=y
 # CONFIG_SWAP is not set
 CONFIG_SWCONFIG=y
@@ -168,4 +159,3 @@ CONFIG_SYS_SUPPORTS_ARBIT_HZ=y
 CONFIG_SYS_SUPPORTS_BIG_ENDIAN=y
 CONFIG_TICK_CPU_ACCOUNTING=y
 CONFIG_TINY_SRCU=y
-CONFIG_USB_SUPPORT=y
diff --git a/target/linux/ath25/fon2202/config-default 
b/target/linux/ath25/fon2202/config-default
new file mode 100644
index 00..ca9ca2f3d7
--- /dev/null
+++ b/target/linux/ath25/fon2202/config-default
@@ -0,0 +1,10 @@
+CONFIG_BLK_MQ_PCI=y
+CONFIG_GPIO_AR2315=y
+CONFIG_HW_HAS_PCI=y
+CONFIG_MTD_AR2315=y
+CONFIG_PCI=y
+CONFIG_PCI_AR2315=y
+CONFIG_PCI_DISABLE_COMMON_QUIRKS=y
+CONFIG_PCI_DOMAINS=y
+CONFIG_SOC_AR2315=y
+CONFIG_USB_SUPPORT=y
diff --git a/target/linux/ath25/generic/config-default 
b/target/linux/ath25/generic/config-default
new file mode 100644
index 00..3d7551110b
--- /dev/null
+++ b/target/linux/ath25/generic/config-default
@@ -0,0 +1,6 @@
+CONFIG_GPIO_AR2315=y
+CONFIG_GPIO_AR5312=y
+CONFIG_MTD_AR2315=y
+# CONFIG_PCI_AR2315 is not set
+CONFIG_SOC_AR2315=y
+CONFIG_SOC_AR5312=y
-- 
2.16.1


___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/listinfo/openwrt-devel


[OpenWrt-Devel] [RFC 1/3] ath25: factor out Fonera 2.0g to subtarget

2018-05-31 Thread Sergey Ryazanov
Add subtargets to the ath25 target. One is for generic firmware images
(including Ubnt), and another one is for Fonera 2.0g (FON2202) firmware
buid. Subtargets now are mostly identical due to identical configs.

This just a preparation for moving some uniq Fonera features (e.g. PCI &
USB support) to dedicated subtarget in order to debloat generic
firmware.

Signed-off-by: Sergey Ryazanov 
---
 target/linux/ath25/Makefile|  5 +-
 target/linux/ath25/fon2202/profiles/00-default.mk  | 16 +
 target/linux/ath25/fon2202/target.mk   |  5 ++
 .../ath25/{ => generic}/profiles/00-default.mk |  0
 target/linux/ath25/generic/target.mk   |  5 ++
 target/linux/ath25/image/Makefile  | 71 ++---
 target/linux/ath25/image/fon2202.mk| 16 +
 target/linux/ath25/image/generic.mk| 73 ++
 8 files changed, 122 insertions(+), 69 deletions(-)
 create mode 100644 target/linux/ath25/fon2202/profiles/00-default.mk
 create mode 100644 target/linux/ath25/fon2202/target.mk
 rename target/linux/ath25/{ => generic}/profiles/00-default.mk (100%)
 create mode 100644 target/linux/ath25/generic/target.mk
 create mode 100644 target/linux/ath25/image/fon2202.mk
 create mode 100644 target/linux/ath25/image/generic.mk

diff --git a/target/linux/ath25/Makefile b/target/linux/ath25/Makefile
index cb8b7ec1be..19e1c98ad4 100644
--- a/target/linux/ath25/Makefile
+++ b/target/linux/ath25/Makefile
@@ -10,14 +10,11 @@ ARCH:=mips
 BOARD:=ath25
 BOARDNAME:=Atheros AR231x/AR5312
 FEATURES:=squashfs low_mem small_flash
+SUBTARGETS:=generic fon2202
 MAINTAINER:=Sergey Ryazanov 
 
 KERNEL_PATCHVER:=4.14
 
-define Target/Description
-   Build firmware images for Atheros SoC boards
-endef
-
 include $(INCLUDE_DIR)/target.mk
 
 DEFAULT_PACKAGES += wpad-mini kmod-ath5k swconfig kmod-gpio-button-hotplug
diff --git a/target/linux/ath25/fon2202/profiles/00-default.mk 
b/target/linux/ath25/fon2202/profiles/00-default.mk
new file mode 100644
index 00..130ecd50d0
--- /dev/null
+++ b/target/linux/ath25/fon2202/profiles/00-default.mk
@@ -0,0 +1,16 @@
+#
+# Copyright (C) 2011 OpenWrt.org
+#
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+#
+
+define Profile/Default
+   NAME:=Default Profile
+   PRIORITY:=1
+endef
+
+define Profile/Default/Description
+   Default package set for Fonera 2.0g (FON2202).
+endef
+$(eval $(call Profile,Default))
diff --git a/target/linux/ath25/fon2202/target.mk 
b/target/linux/ath25/fon2202/target.mk
new file mode 100644
index 00..0c83b0494e
--- /dev/null
+++ b/target/linux/ath25/fon2202/target.mk
@@ -0,0 +1,5 @@
+BOARDNAME:=Fonera 2.0g (FON2202)
+
+define Target/Description
+   Build firmware images for Fonera 2.0g (FON2202) wireless router.
+endef
diff --git a/target/linux/ath25/profiles/00-default.mk 
b/target/linux/ath25/generic/profiles/00-default.mk
similarity index 100%
rename from target/linux/ath25/profiles/00-default.mk
rename to target/linux/ath25/generic/profiles/00-default.mk
diff --git a/target/linux/ath25/generic/target.mk 
b/target/linux/ath25/generic/target.mk
new file mode 100644
index 00..e534009efa
--- /dev/null
+++ b/target/linux/ath25/generic/target.mk
@@ -0,0 +1,5 @@
+BOARDNAME:=Generic
+
+define Target/Description
+   Build firmware images for generic Atheros AR231x/AR5312 based boards.
+endef
diff --git a/target/linux/ath25/image/Makefile 
b/target/linux/ath25/image/Makefile
index 5a20bdb644..0d8917944e 100644
--- a/target/linux/ath25/image/Makefile
+++ b/target/linux/ath25/image/Makefile
@@ -7,14 +7,12 @@
 include $(TOPDIR)/rules.mk
 include $(INCLUDE_DIR)/image.mk
 
-define Build/mkfwimage
-   $(STAGING_DIR_HOST)/bin/mkfwimage \
-   -B $(1).$(VERSION_DIST).$(REVISION) \
-   -k $(IMAGE_KERNEL) \
-   -r $(IMAGE_ROOTFS) \
-   -o $@.new && \
-   mv $@.new $@
-endef
+ifeq ($(SUBTARGET),generic)
+include ./generic.mk
+endif
+ifeq ($(SUBTARGET),fon2202)
+include ./fon2202.mk
+endif
 
 define Build/combined-image
-sh $(TOPDIR)/scripts/combined-image.sh \
@@ -24,19 +22,6 @@ define Build/combined-image
mv $@.new $@
 endef
 
-define Build/mkmylofw
-   $(STAGING_DIR_HOST)/bin/mkmylofw -B $(1) \
-   -p0x02:0x13:ah:0x80041000:linux:$(IMAGE_KERNEL) \
-   -p0x15:0x2a:::rootfs:$(IMAGE_ROOTFS) \
-   $@.new && \
-   mv $@.new $@
-endef
-
-define Build/gzip-kernel
-   gzip -9n -c $@ > $@.gz
-   dd if=$@.gz of=$@ bs=65536 conv=sync
-endef
-
 define Build/lzma-kernel
$(STAGING_DIR_HOST)/bin/lzma e $@ $@.l7
dd if=$@.l7 of=$@ bs=65536 conv=sync
@@ -60,48 +45,4 @@ define Device/Default
   FILESYSTEMS := squashfs
 endef
 
-define Device/generic
-  DEVICE_TITLE := Generic Images
-  IMAGES := kernel.lzma kernel.elf kernel.gz rootfs.bin 

[OpenWrt-Devel] [RFC 3/3] ath25: fon2202: add packages for USB support

2018-05-31 Thread Sergey Ryazanov
Add required packages for USB support to DEFAULT_PACKAGES of Fonera 2.0g
subtarget.

Signed-off-by: Sergey Ryazanov 
---
 target/linux/ath25/fon2202/target.mk | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/target/linux/ath25/fon2202/target.mk 
b/target/linux/ath25/fon2202/target.mk
index 0c83b0494e..aa9644354b 100644
--- a/target/linux/ath25/fon2202/target.mk
+++ b/target/linux/ath25/fon2202/target.mk
@@ -1,4 +1,7 @@
 BOARDNAME:=Fonera 2.0g (FON2202)
+FEATURES+=usb
+
+DEFAULT_PACKAGES += kmod-usb-core kmod-usb-ehci kmod-usb2 kmod-usb2-pci
 
 define Target/Description
Build firmware images for Fonera 2.0g (FON2202) wireless router.
-- 
2.16.1


___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/listinfo/openwrt-devel


[OpenWrt-Devel] [RFC 0/3] ath25: move Fonera 2.0g to subtarget

2018-05-31 Thread Sergey Ryazanov
This series adds a new ath25 subtarget for the Fonera 2.0g (FON2202)
router. This router is unique since it have a USB port and uses PCI
controller of AR2315 SoC. AFAIK, there are no other AR231x based routers
which at least uses SoC's PCI controller.

This series have two goals:
* simplify building of image with all packets that are required for
* FON2202 USB support
* debloat the generic kernel by disabling the PCI support

The second goal was achieved only partially. On the one hand the
uncompressed (ELF) kernel become smaller by ~120kb, lzma-compressed
kernel become smaller by ~38kb, but on the other hand the 64kb alignment
kills this reduction. See the size reduction details below.

   ELF LZMA   Padded
 old generic   4209348  1368408  1376256
 new generic   4079044  1328723  1376256

Sergey Ryazanov (3):
  ath25: factor out Fonera 2.0g to subtarget
  ath25: factor out Fonera 2.0g kernel options
  ath25: fon2202: add packages for USB support

 target/linux/ath25/Makefile|  5 +-
 target/linux/ath25/config-4.14 | 14 +
 target/linux/ath25/fon2202/config-default  | 10 +++
 target/linux/ath25/fon2202/profiles/00-default.mk  | 16 +
 target/linux/ath25/fon2202/target.mk   |  8 +++
 target/linux/ath25/generic/config-default  |  6 ++
 .../ath25/{ => generic}/profiles/00-default.mk |  0
 target/linux/ath25/generic/target.mk   |  5 ++
 target/linux/ath25/image/Makefile  | 71 ++---
 target/linux/ath25/image/fon2202.mk| 16 +
 target/linux/ath25/image/generic.mk| 73 ++
 11 files changed, 143 insertions(+), 81 deletions(-)
 create mode 100644 target/linux/ath25/fon2202/config-default
 create mode 100644 target/linux/ath25/fon2202/profiles/00-default.mk
 create mode 100644 target/linux/ath25/fon2202/target.mk
 create mode 100644 target/linux/ath25/generic/config-default
 rename target/linux/ath25/{ => generic}/profiles/00-default.mk (100%)
 create mode 100644 target/linux/ath25/generic/target.mk
 create mode 100644 target/linux/ath25/image/fon2202.mk
 create mode 100644 target/linux/ath25/image/generic.mk

-- 
2.16.1


___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/listinfo/openwrt-devel


Re: [OpenWrt-Devel] [PATCH] mpc85xx: revert enabling the crypto acceleration driver in the kernel config instead of packaging it

2018-05-31 Thread Achim Gottinger



Am 31.05.2018 um 20:12 schrieb Achim Gottinger:



Am 31.05.2018 um 19:12 schrieb Achim Gottinger:

Hello List,

Since the commit 
https://git.openwrt.org/?p=openwrt/openwrt.git;a=commit;h=c00e5a4f09115ec976fac7dc380f576ef6a24fab 
strongswan is broken on WDR4900v1.
An bug report can be seen here: 
https://bugs.openwrt.org/index.php?do=details_id=1262.
To get strongswan working again i made an patch which reverts the 
changes from above commit.
Now if the caam modules are loaded strongswan still fails but without 
the caam modules loades it works as expected.
With the caam modules build in caam can not be disabled by the 
openwrt user.


---
diff --git a/package/kernel/linux/modules/crypto.mk 
b/package/kernel/linux/modules/crypto.mk

index 2ea2d2c0e7..4074e2679a 100644
--- a/package/kernel/linux/modules/crypto.mk
+++ b/package/kernel/linux/modules/crypto.mk
@@ -271,6 +271,31 @@ endef

 $(eval $(call KernelPackage,crypto-hmac))

+define KernelPackage/crypto-hw-caam
+  TITLE:=Freescale CAAM driver (SEC4)
+  DEPENDS:=@TARGET_mpc85xx +kmod-crypto-aead +kmod-crypto-authenc 
+kmod-crypto-hash +kmod-random-core

+  KCONFIG:= \
+   CONFIG_CRYPTO_HW=y \
+   CONFIG_CRYPTO_DEV_FSL_CAAM \
+   CONFIG_CRYPTO_DEV_FSL_CAAM_JR \
+   CONFIG_CRYPTO_DEV_FSL_CAAM_CRYPTO_API \
+   CONFIG_CRYPTO_DEV_FSL_CAAM_AHASH_API \
+   CONFIG_CRYPTO_DEV_FSL_CAAM_RNG_API \
+   CONFIG_CRYPTO_DEV_FSL_CAAM_RINGSIZE=9 \
+   CONFIG_CRYPTO_DEV_FSL_CAAM_IMX=n \
+   CONFIG_CRYPTO_DEV_FSL_CAAM_INTC=n \
+   CONFIG_CRYPTO_DEV_FSL_CAAM_DEBUG=n
+  FILES:= \
+   $(LINUX_DIR)/drivers/crypto/caam/caam.ko \
+   $(LINUX_DIR)/drivers/crypto/caam/caamalg.ko \
+   $(LINUX_DIR)/drivers/crypto/caam/caamhash.ko \
+   $(LINUX_DIR)/drivers/crypto/caam/caam_jr.ko \
+   $(LINUX_DIR)/drivers/crypto/caam/caamrng.ko
+  AUTOLOAD:=$(call AutoLoad,09,caam caamalg caamhash caam_jr caamrng)
+  $(call AddDepends/crypto)
+endef
+
+$(eval $(call KernelPackage,crypto-hw-caam))

 define KernelPackage/crypto-hw-ccp
   TITLE:=AMD Cryptographic Coprocessor
diff --git a/target/linux/mpc85xx/config-4.9 
b/target/linux/mpc85xx/config-4.9

index 68568c4a62..dc2e5a8820 100644
--- a/target/linux/mpc85xx/config-4.9
+++ b/target/linux/mpc85xx/config-4.9
@@ -47,16 +47,16 @@ CONFIG_CRYPTO_AEAD2=y
 CONFIG_CRYPTO_AKCIPHER=y
 CONFIG_CRYPTO_AKCIPHER2=y
 CONFIG_CRYPTO_AUTHENC=y
-CONFIG_CRYPTO_DEV_FSL_CAAM=y
-CONFIG_CRYPTO_DEV_FSL_CAAM_AHASH_API=y
-CONFIG_CRYPTO_DEV_FSL_CAAM_CRYPTO_API=y
+#CONFIG_CRYPTO_DEV_FSL_CAAM=y
+#CONFIG_CRYPTO_DEV_FSL_CAAM_AHASH_API=y
+#CONFIG_CRYPTO_DEV_FSL_CAAM_CRYPTO_API=y
 # CONFIG_CRYPTO_DEV_FSL_CAAM_DEBUG is not set
 # CONFIG_CRYPTO_DEV_FSL_CAAM_IMX is not set
 # CONFIG_CRYPTO_DEV_FSL_CAAM_INTC is not set
-CONFIG_CRYPTO_DEV_FSL_CAAM_JR=y
-CONFIG_CRYPTO_DEV_FSL_CAAM_PKC_API=y
-CONFIG_CRYPTO_DEV_FSL_CAAM_RINGSIZE=9
-CONFIG_CRYPTO_DEV_FSL_CAAM_RNG_API=y
+#CONFIG_CRYPTO_DEV_FSL_CAAM_JR=y
+#CONFIG_CRYPTO_DEV_FSL_CAAM_PKC_API=y
+#CONFIG_CRYPTO_DEV_FSL_CAAM_RINGSIZE=9
+#CONFIG_CRYPTO_DEV_FSL_CAAM_RNG_API=y
 CONFIG_CRYPTO_HASH=y
 CONFIG_CRYPTO_HASH2=y
 CONFIG_CRYPTO_HW=y
---

___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/listinfo/openwrt-devel


Had to modify the patch to include the caam_pkc.ko module. I also 
found that the caamrng.ko module does not load. In case this breaks 
things would it make sense to use two targets one with and one without 
build in caam support. I mainly use  openwrt  for vpn routers so I 
rely on working strongswan packages.


-
diff --git a/package/kernel/linux/modules/crypto.mk 
b/package/kernel/linux/modules/crypto.mk

index 2ea2d2c0e7..dbb0d59012 100644
--- a/package/kernel/linux/modules/crypto.mk
+++ b/package/kernel/linux/modules/crypto.mk
@@ -271,6 +271,33 @@ endef

 $(eval $(call KernelPackage,crypto-hmac))

+define KernelPackage/crypto-hw-caam
+  TITLE:=Freescale CAAM driver (SEC4)
+  DEPENDS:=@TARGET_mpc85xx +kmod-crypto-aead +kmod-crypto-authenc 
+kmod-crypto-hash +kmod-random-core

+  KCONFIG:= \
+   CONFIG_CRYPTO_HW=y \
+   CONFIG_CRYPTO_DEV_FSL_CAAM \
+   CONFIG_CRYPTO_DEV_FSL_CAAM_JR \
+   CONFIG_CRYPTO_DEV_FSL_CAAM_CRYPTO_API \
+   CONFIG_CRYPTO_DEV_FSL_CAAM_AHASH_API \
+   CONFIG_CRYPTO_DEV_FSL_CAAM_PKC_API \
+   CONFIG_CRYPTO_DEV_FSL_CAAM_RNG_API \
+   CONFIG_CRYPTO_DEV_FSL_CAAM_RINGSIZE=9 \
+   CONFIG_CRYPTO_DEV_FSL_CAAM_IMX=n \
+   CONFIG_CRYPTO_DEV_FSL_CAAM_INTC=n \
+   CONFIG_CRYPTO_DEV_FSL_CAAM_DEBUG=n
+  FILES:= \
+   $(LINUX_DIR)/drivers/crypto/caam/caam.ko \
+   $(LINUX_DIR)/drivers/crypto/caam/caamalg.ko \
+   $(LINUX_DIR)/drivers/crypto/caam/caamhash.ko \
+   $(LINUX_DIR)/drivers/crypto/caam/caam_pkc.ko \
+   $(LINUX_DIR)/drivers/crypto/caam/caam_jr.ko \
+   $(LINUX_DIR)/drivers/crypto/caam/caamrng.ko
+  AUTOLOAD:=$(call 

[OpenWrt-Devel] [PATCH] kernel: bump to 4.9.105

2018-05-31 Thread Kevin Darbyshire-Bryant via openwrt-devel
The sender domain has a DMARC Reject/Quarantine policy which disallows
sending mailing list messages using the original "From" header.

To mitigate this problem, the original message has been wrapped
automatically by the mailing list software.--- Begin Message ---
Refresh patches.

Drop patches that have been upstreamed:
target/linux/ar71xx/patches-4.9/106-01-MIPS-ath79-fix-AR724X_PLL_REG_PCIE_CONFIG-offset.patch
target/linux/generic/backport-4.9/095-v4.12-ipv6-Need-to-export-ipv6_push_frag_opts-for-tunnelin.patch
target/linux/generic/pending-4.9/180-net-phy-at803x-add-support-for-AT8032.patch
target/linux/generic/pending-4.9/181-net-usb-add-lte-modem-wistron-neweb-d18q1.patch
target/linux/generic/pending-4.9/182-net-qmi_wwan-add-BroadMobi-BM806U-2020-2033.patch

Compile & run tested: ar71xx Archer C7 v2

Signed-off-by: Kevin Darbyshire-Bryant 
---
 include/kernel-version.mk  |   4 +-
 ...h79-fix-AR724X_PLL_REG_PCIE_CONFIG-offset.patch |  29 --
 .../902-at803x-add-reset-gpio-pdata.patch  |   8 +-
 ...oid-suspending-if-we-re-in-gadget-mode-18.patch |   2 +-
 .../linux/brcm47xx/patches-4.9/159-cpu_fixes.patch |   8 +-
 ...tsq-move-tsq_flags-close-to-sk_wmem_alloc.patch |   2 +-
 .../050-usb-dwc2-Remove-unnecessary-kfree.patch|   2 +-
 ...llocate-struct-bgmac-just-once-don-t-copy.patch |   6 +-
 .../090-net-generalize-napi_complete_done.patch|  18 +-
 ...o-export-ipv6_push_frag_opts-for-tunnelin.patch |  36 --
 ...er.h-prevent-redefinition-of-struct-ethhd.patch |   2 +-
 .../hack-4.9/773-bgmac-add-srab-switch.patch   |   6 +-
 .../generic/hack-4.9/901-debloat_sock_diag.patch   |   2 +-
 ...-.rename2-and-add-RENAME_WHITEOUT-support.patch |   6 +-
 .../141-jffs2-add-RENAME_EXCHANGE-support.patch|   8 +-
 ...180-net-phy-at803x-add-support-for-AT8032.patch |  70 ---
 ...net-usb-add-lte-modem-wistron-neweb-d18q1.patch |  61 ---
 ...t-qmi_wwan-add-BroadMobi-BM806U-2020-2033.patch |  28 --
 .../pending-4.9/630-packet_socket_type.patch   |   6 +-
 .../666-Add-support-for-MAP-E-FMRs-mesh-mode.patch |  10 +-
 ...t-phy-at803x-allow-to-configure-via-pdata.patch |  12 +-
 .../735-net-phy-at803x-fix-at8033-sgmii-mode.patch |   2 +-
 .../generic/pending-4.9/834-ledtrig-libata.patch   |   8 +-
 .../pending-4.9/890-uart_optional_sysrq.patch  |   2 +-
 .../ixp4xx/patches-4.9/160-delayed_uart_io.patch   |   4 +-
 .../202-core-linux-support-layerscape.patch|   2 +-
 .../patches-4.9/702-pci-support-layerscape.patch   |   2 +-
 .../704-fsl-mc-layerscape-support.patch|   2 +-
 .../patches-4.9/810-iommu-support-layerscape.patch |   8 +-
 .../816-tty-serial-support-layerscape.patch|  10 +-
 .../patches-4.9/817-usb-support-layerscape.patch   |  32 +-
 .../100-powerpc-85xx-tl-wdr4900-v1-support.patch   |   4 +-
 .../sunxi/patches-4.9/0050-stmmac-form-4-10.patch  | 120 +++---
 .../sunxi/patches-4.9/0051-stmmac-form-4-11.patch  |  36 +-
 .../sunxi/patches-4.9/0052-stmmac-form-4-12.patch  | 468 ++---
 .../sunxi/patches-4.9/0053-stmmac-form-4-13.patch  |  16 +-
 36 files changed, 400 insertions(+), 642 deletions(-)
 delete mode 100644 
target/linux/ar71xx/patches-4.9/106-01-MIPS-ath79-fix-AR724X_PLL_REG_PCIE_CONFIG-offset.patch
 delete mode 100644 
target/linux/generic/backport-4.9/095-v4.12-ipv6-Need-to-export-ipv6_push_frag_opts-for-tunnelin.patch
 delete mode 100644 
target/linux/generic/pending-4.9/180-net-phy-at803x-add-support-for-AT8032.patch
 delete mode 100644 
target/linux/generic/pending-4.9/181-net-usb-add-lte-modem-wistron-neweb-d18q1.patch
 delete mode 100644 
target/linux/generic/pending-4.9/182-net-qmi_wwan-add-BroadMobi-BM806U-2020-2033.patch

diff --git a/include/kernel-version.mk b/include/kernel-version.mk
index 2c6adc8ab0..877fa880f5 100644
--- a/include/kernel-version.mk
+++ b/include/kernel-version.mk
@@ -4,12 +4,12 @@ LINUX_RELEASE?=1
 
 LINUX_VERSION-3.18 = .71
 LINUX_VERSION-4.4 = .121
-LINUX_VERSION-4.9 = .102
+LINUX_VERSION-4.9 = .105
 LINUX_VERSION-4.14 = .44
 
 LINUX_KERNEL_HASH-3.18.71 = 
5abc9778ad44ce02ed6c8ab52ece8a21c6d20d21f6ed8a19287b4a38a50c1240
 LINUX_KERNEL_HASH-4.4.121 = 
44a88268b5088dc326b30c9b9133ac35a9a200b636b7268d08f32abeae6ca729
-LINUX_KERNEL_HASH-4.9.102 = 
d155a36ba52d5809805cd370902582ac373c5b23a958c6424325684447119dc5
+LINUX_KERNEL_HASH-4.9.105 = 
d085d228e3ac1fdbdf5a31bb8154e4e8a0943a9085f0384842601db8e9d96dc4
 LINUX_KERNEL_HASH-4.14.44 = 
2eb356e6af25f6ca65affe7704be8c4e0cdf224505e7441ac9d5b6e8d96ec8e4
 
 remove_uri_prefix=$(subst git://,,$(subst http://,,$(subst https://,,$(1
diff --git 
a/target/linux/ar71xx/patches-4.9/106-01-MIPS-ath79-fix-AR724X_PLL_REG_PCIE_CONFIG-offset.patch
 
b/target/linux/ar71xx/patches-4.9/106-01-MIPS-ath79-fix-AR724X_PLL_REG_PCIE_CONFIG-offset.patch
deleted file mode 100644
index e785b30eff..00
--- 
a/target/linux/ar71xx/patches-4.9/106-01-MIPS-ath79-fix-AR724X_PLL_REG_PCIE_CONFIG-offset.patch
+++ /dev/null
@@ -1,29 +0,0 @@
-From 

Re: [OpenWrt-Devel] [PATCH] mpc85xx: revert enabling the crypto acceleration driver in the kernel config instead of packaging it

2018-05-31 Thread Achim Gottinger



Am 31.05.2018 um 19:12 schrieb Achim Gottinger:

Hello List,

Since the commit 
https://git.openwrt.org/?p=openwrt/openwrt.git;a=commit;h=c00e5a4f09115ec976fac7dc380f576ef6a24fab 
strongswan is broken on WDR4900v1.
An bug report can be seen here: 
https://bugs.openwrt.org/index.php?do=details_id=1262.
To get strongswan working again i made an patch which reverts the 
changes from above commit.
Now if the caam modules are loaded strongswan still fails but without 
the caam modules loades it works as expected.
With the caam modules build in caam can not be disabled by the openwrt 
user.


---
diff --git a/package/kernel/linux/modules/crypto.mk 
b/package/kernel/linux/modules/crypto.mk

index 2ea2d2c0e7..4074e2679a 100644
--- a/package/kernel/linux/modules/crypto.mk
+++ b/package/kernel/linux/modules/crypto.mk
@@ -271,6 +271,31 @@ endef

 $(eval $(call KernelPackage,crypto-hmac))

+define KernelPackage/crypto-hw-caam
+  TITLE:=Freescale CAAM driver (SEC4)
+  DEPENDS:=@TARGET_mpc85xx +kmod-crypto-aead +kmod-crypto-authenc 
+kmod-crypto-hash +kmod-random-core

+  KCONFIG:= \
+   CONFIG_CRYPTO_HW=y \
+   CONFIG_CRYPTO_DEV_FSL_CAAM \
+   CONFIG_CRYPTO_DEV_FSL_CAAM_JR \
+   CONFIG_CRYPTO_DEV_FSL_CAAM_CRYPTO_API \
+   CONFIG_CRYPTO_DEV_FSL_CAAM_AHASH_API \
+   CONFIG_CRYPTO_DEV_FSL_CAAM_RNG_API \
+   CONFIG_CRYPTO_DEV_FSL_CAAM_RINGSIZE=9 \
+   CONFIG_CRYPTO_DEV_FSL_CAAM_IMX=n \
+   CONFIG_CRYPTO_DEV_FSL_CAAM_INTC=n \
+   CONFIG_CRYPTO_DEV_FSL_CAAM_DEBUG=n
+  FILES:= \
+   $(LINUX_DIR)/drivers/crypto/caam/caam.ko \
+   $(LINUX_DIR)/drivers/crypto/caam/caamalg.ko \
+   $(LINUX_DIR)/drivers/crypto/caam/caamhash.ko \
+   $(LINUX_DIR)/drivers/crypto/caam/caam_jr.ko \
+   $(LINUX_DIR)/drivers/crypto/caam/caamrng.ko
+  AUTOLOAD:=$(call AutoLoad,09,caam caamalg caamhash caam_jr caamrng)
+  $(call AddDepends/crypto)
+endef
+
+$(eval $(call KernelPackage,crypto-hw-caam))

 define KernelPackage/crypto-hw-ccp
   TITLE:=AMD Cryptographic Coprocessor
diff --git a/target/linux/mpc85xx/config-4.9 
b/target/linux/mpc85xx/config-4.9

index 68568c4a62..dc2e5a8820 100644
--- a/target/linux/mpc85xx/config-4.9
+++ b/target/linux/mpc85xx/config-4.9
@@ -47,16 +47,16 @@ CONFIG_CRYPTO_AEAD2=y
 CONFIG_CRYPTO_AKCIPHER=y
 CONFIG_CRYPTO_AKCIPHER2=y
 CONFIG_CRYPTO_AUTHENC=y
-CONFIG_CRYPTO_DEV_FSL_CAAM=y
-CONFIG_CRYPTO_DEV_FSL_CAAM_AHASH_API=y
-CONFIG_CRYPTO_DEV_FSL_CAAM_CRYPTO_API=y
+#CONFIG_CRYPTO_DEV_FSL_CAAM=y
+#CONFIG_CRYPTO_DEV_FSL_CAAM_AHASH_API=y
+#CONFIG_CRYPTO_DEV_FSL_CAAM_CRYPTO_API=y
 # CONFIG_CRYPTO_DEV_FSL_CAAM_DEBUG is not set
 # CONFIG_CRYPTO_DEV_FSL_CAAM_IMX is not set
 # CONFIG_CRYPTO_DEV_FSL_CAAM_INTC is not set
-CONFIG_CRYPTO_DEV_FSL_CAAM_JR=y
-CONFIG_CRYPTO_DEV_FSL_CAAM_PKC_API=y
-CONFIG_CRYPTO_DEV_FSL_CAAM_RINGSIZE=9
-CONFIG_CRYPTO_DEV_FSL_CAAM_RNG_API=y
+#CONFIG_CRYPTO_DEV_FSL_CAAM_JR=y
+#CONFIG_CRYPTO_DEV_FSL_CAAM_PKC_API=y
+#CONFIG_CRYPTO_DEV_FSL_CAAM_RINGSIZE=9
+#CONFIG_CRYPTO_DEV_FSL_CAAM_RNG_API=y
 CONFIG_CRYPTO_HASH=y
 CONFIG_CRYPTO_HASH2=y
 CONFIG_CRYPTO_HW=y
---

___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/listinfo/openwrt-devel


Had to modify the patch to include the caam_pkc.ko module. I also found 
that the caamrng.ko module does not load. In case this breaks things 
would it make sense to use two targets one with and one without build in 
caam support. I mainly use  openwrt  for vpn routers so I rely on 
working strongswan packages.


-
diff --git a/package/kernel/linux/modules/crypto.mk 
b/package/kernel/linux/modules/crypto.mk

index 2ea2d2c0e7..dbb0d59012 100644
--- a/package/kernel/linux/modules/crypto.mk
+++ b/package/kernel/linux/modules/crypto.mk
@@ -271,6 +271,33 @@ endef

 $(eval $(call KernelPackage,crypto-hmac))

+define KernelPackage/crypto-hw-caam
+  TITLE:=Freescale CAAM driver (SEC4)
+  DEPENDS:=@TARGET_mpc85xx +kmod-crypto-aead +kmod-crypto-authenc 
+kmod-crypto-hash +kmod-random-core

+  KCONFIG:= \
+   CONFIG_CRYPTO_HW=y \
+   CONFIG_CRYPTO_DEV_FSL_CAAM \
+   CONFIG_CRYPTO_DEV_FSL_CAAM_JR \
+   CONFIG_CRYPTO_DEV_FSL_CAAM_CRYPTO_API \
+   CONFIG_CRYPTO_DEV_FSL_CAAM_AHASH_API \
+   CONFIG_CRYPTO_DEV_FSL_CAAM_PKC_API \
+   CONFIG_CRYPTO_DEV_FSL_CAAM_RNG_API \
+   CONFIG_CRYPTO_DEV_FSL_CAAM_RINGSIZE=9 \
+   CONFIG_CRYPTO_DEV_FSL_CAAM_IMX=n \
+   CONFIG_CRYPTO_DEV_FSL_CAAM_INTC=n \
+   CONFIG_CRYPTO_DEV_FSL_CAAM_DEBUG=n
+  FILES:= \
+   $(LINUX_DIR)/drivers/crypto/caam/caam.ko \
+   $(LINUX_DIR)/drivers/crypto/caam/caamalg.ko \
+   $(LINUX_DIR)/drivers/crypto/caam/caamhash.ko \
+   $(LINUX_DIR)/drivers/crypto/caam/caam_pkc.ko \
+   $(LINUX_DIR)/drivers/crypto/caam/caam_jr.ko \
+   $(LINUX_DIR)/drivers/crypto/caam/caamrng.ko
+  AUTOLOAD:=$(call AutoLoad,09,caam caamalg caamhash caam_jr caam_pkc 

[OpenWrt-Devel] [PATCH] mpc85xx: revert enabling the crypto acceleration driver in the kernel config instead of packaging it

2018-05-31 Thread Achim Gottinger

Hello List,

Since the commit 
https://git.openwrt.org/?p=openwrt/openwrt.git;a=commit;h=c00e5a4f09115ec976fac7dc380f576ef6a24fab 
strongswan is broken on WDR4900v1.
An bug report can be seen here: 
https://bugs.openwrt.org/index.php?do=details_id=1262.
To get strongswan working again i made an patch which reverts the 
changes from above commit.
Now if the caam modules are loaded strongswan still fails but without 
the caam modules loades it works as expected.

With the caam modules build in caam can not be disabled by the openwrt user.

---
diff --git a/package/kernel/linux/modules/crypto.mk 
b/package/kernel/linux/modules/crypto.mk

index 2ea2d2c0e7..4074e2679a 100644
--- a/package/kernel/linux/modules/crypto.mk
+++ b/package/kernel/linux/modules/crypto.mk
@@ -271,6 +271,31 @@ endef

 $(eval $(call KernelPackage,crypto-hmac))

+define KernelPackage/crypto-hw-caam
+  TITLE:=Freescale CAAM driver (SEC4)
+  DEPENDS:=@TARGET_mpc85xx +kmod-crypto-aead +kmod-crypto-authenc 
+kmod-crypto-hash +kmod-random-core

+  KCONFIG:= \
+   CONFIG_CRYPTO_HW=y \
+   CONFIG_CRYPTO_DEV_FSL_CAAM \
+   CONFIG_CRYPTO_DEV_FSL_CAAM_JR \
+   CONFIG_CRYPTO_DEV_FSL_CAAM_CRYPTO_API \
+   CONFIG_CRYPTO_DEV_FSL_CAAM_AHASH_API \
+   CONFIG_CRYPTO_DEV_FSL_CAAM_RNG_API \
+   CONFIG_CRYPTO_DEV_FSL_CAAM_RINGSIZE=9 \
+   CONFIG_CRYPTO_DEV_FSL_CAAM_IMX=n \
+   CONFIG_CRYPTO_DEV_FSL_CAAM_INTC=n \
+   CONFIG_CRYPTO_DEV_FSL_CAAM_DEBUG=n
+  FILES:= \
+   $(LINUX_DIR)/drivers/crypto/caam/caam.ko \
+   $(LINUX_DIR)/drivers/crypto/caam/caamalg.ko \
+   $(LINUX_DIR)/drivers/crypto/caam/caamhash.ko \
+   $(LINUX_DIR)/drivers/crypto/caam/caam_jr.ko \
+   $(LINUX_DIR)/drivers/crypto/caam/caamrng.ko
+  AUTOLOAD:=$(call AutoLoad,09,caam caamalg caamhash caam_jr caamrng)
+  $(call AddDepends/crypto)
+endef
+
+$(eval $(call KernelPackage,crypto-hw-caam))

 define KernelPackage/crypto-hw-ccp
   TITLE:=AMD Cryptographic Coprocessor
diff --git a/target/linux/mpc85xx/config-4.9 
b/target/linux/mpc85xx/config-4.9

index 68568c4a62..dc2e5a8820 100644
--- a/target/linux/mpc85xx/config-4.9
+++ b/target/linux/mpc85xx/config-4.9
@@ -47,16 +47,16 @@ CONFIG_CRYPTO_AEAD2=y
 CONFIG_CRYPTO_AKCIPHER=y
 CONFIG_CRYPTO_AKCIPHER2=y
 CONFIG_CRYPTO_AUTHENC=y
-CONFIG_CRYPTO_DEV_FSL_CAAM=y
-CONFIG_CRYPTO_DEV_FSL_CAAM_AHASH_API=y
-CONFIG_CRYPTO_DEV_FSL_CAAM_CRYPTO_API=y
+#CONFIG_CRYPTO_DEV_FSL_CAAM=y
+#CONFIG_CRYPTO_DEV_FSL_CAAM_AHASH_API=y
+#CONFIG_CRYPTO_DEV_FSL_CAAM_CRYPTO_API=y
 # CONFIG_CRYPTO_DEV_FSL_CAAM_DEBUG is not set
 # CONFIG_CRYPTO_DEV_FSL_CAAM_IMX is not set
 # CONFIG_CRYPTO_DEV_FSL_CAAM_INTC is not set
-CONFIG_CRYPTO_DEV_FSL_CAAM_JR=y
-CONFIG_CRYPTO_DEV_FSL_CAAM_PKC_API=y
-CONFIG_CRYPTO_DEV_FSL_CAAM_RINGSIZE=9
-CONFIG_CRYPTO_DEV_FSL_CAAM_RNG_API=y
+#CONFIG_CRYPTO_DEV_FSL_CAAM_JR=y
+#CONFIG_CRYPTO_DEV_FSL_CAAM_PKC_API=y
+#CONFIG_CRYPTO_DEV_FSL_CAAM_RINGSIZE=9
+#CONFIG_CRYPTO_DEV_FSL_CAAM_RNG_API=y
 CONFIG_CRYPTO_HASH=y
 CONFIG_CRYPTO_HASH2=y
 CONFIG_CRYPTO_HW=y
---

___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/listinfo/openwrt-devel


[OpenWrt-Devel] [PATCH] mtd: mark as nonshared to fix FS#484

2018-05-31 Thread Mirko Parthey
The mtd tool is built with different configurations depending on the
target. For example, brcm47xx adds the fixtrx subcommand, without which
an image fails when booting the second time.

Mark the mtd package as nonshared to really fix FS#484.

Signed-off-by: Mirko Parthey 
---
 package/system/mtd/Makefile | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/package/system/mtd/Makefile b/package/system/mtd/Makefile
index 01277d9..9ae03a7 100644
--- a/package/system/mtd/Makefile
+++ b/package/system/mtd/Makefile
@@ -17,6 +17,8 @@ STAMP_PREPARED := $(STAMP_PREPARED)_$(call 
confvar,CONFIG_MTD_REDBOOT_PARTS)
 PKG_LICENSE:=GPL-2.0+
 PKG_LICENSE_FILES:=
 
+PKG_FLAGS:=nonshared
+
 include $(INCLUDE_DIR)/package.mk
 
 define Package/mtd
-- 
2.1.4


___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/listinfo/openwrt-devel


[OpenWrt-Devel] [PATCH v2.1 4/4] ustream-ssl: openssl-1.1 compatibility

2018-05-31 Thread Eneas U de Queiroz via openwrt-devel
The sender domain has a DMARC Reject/Quarantine policy which disallows
sending mailing list messages using the original "From" header.

To mitigate this problem, the original message has been wrapped
automatically by the mailing list software.--- Begin Message ---
I've rewritten the patch, removing deprecated API.

It is much cleaner now; ustream-io-openssl.c has no #if's, and they're
minimized in ustream-openssl.c.

Signed-off-by: Eneas U de Queiroz 
---
 openssl_bio_compat.h | 34 ++
 ustream-io-openssl.c | 46 ++
 ustream-openssl.c| 30 +++---
 3 files changed, 75 insertions(+), 35 deletions(-)
 create mode 100644 openssl_bio_compat.h

diff --git a/openssl_bio_compat.h b/openssl_bio_compat.h
new file mode 100644
index 000..dedc412
--- /dev/null
+++ b/openssl_bio_compat.h
@@ -0,0 +1,34 @@
+#ifndef OPENSSL_BIO_COMPAT_H
+#define OPENSSL_BIO_COMPAT_H
+
+#include 
+#if OPENSSL_VERSION_NUMBER < 0x1010L
+
+#include 
+#include 
+
+#define BIO_get_data(b) (b->ptr)
+#define BIO_set_data(b, v) (b->ptr = v)
+#define BIO_set_init(b, v) (b->init = v)
+#define BIO_set_shutdown(b, v) (b->flags = v)
+#define BIO_meth_set_write(m, f) (m->bwrite = f)
+#define BIO_meth_set_read(m, f) (m->bread = f)
+#define BIO_meth_set_puts(m, f) (m->bputs = f)
+#define BIO_meth_set_gets(m, f) (m->bgets = f)
+#define BIO_meth_set_ctrl(m, f) (m->ctrl = f)
+#define BIO_meth_set_create(m, f) (m->create = f)
+#define BIO_meth_set_destroy(m, f) (m->destroy = f)
+
+static inline BIO_METHOD *BIO_meth_new(int type, const char *name)
+{
+   BIO_METHOD *bm = calloc(1, sizeof(BIO_METHOD));
+   if (bm) {
+   bm->type = type;
+   bm->name = name;
+   }
+   return bm;
+}
+
+#endif /* OPENSSL_VERSION_NUMBER */
+
+#endif /* OPENSSL_BIO_COMPAT_H */
diff --git a/ustream-io-openssl.c b/ustream-io-openssl.c
index 6711055..aa9f401 100644
--- a/ustream-io-openssl.c
+++ b/ustream-io-openssl.c
@@ -21,15 +21,15 @@
 #include 
 
 #include "ustream-ssl.h"
+#include "openssl_bio_compat.h"
 #include "ustream-internal.h"
 
 static int
 s_ustream_new(BIO *b)
 {
-   b->init = 1;
-   b->num = 0;
-   b->ptr = NULL;
-   b->flags = 0;
+   BIO_set_init(b, 1);
+   BIO_set_data(b, NULL);
+   BIO_set_shutdown(b, 0);
return 1;
 }
 
@@ -39,9 +39,9 @@ s_ustream_free(BIO *b)
if (!b)
return 0;
 
-   b->ptr = NULL;
-   b->init = 0;
-   b->flags = 0;
+   BIO_set_data(b, NULL);
+   BIO_set_init(b, 0);
+   BIO_set_shutdown(b, 0);
return 1;
 }
 
@@ -55,7 +55,7 @@ s_ustream_read(BIO *b, char *buf, int len)
if (!buf || len <= 0)
return 0;
 
-   s = (struct ustream *)b->ptr;
+   s = (struct ustream *)BIO_get_data(b);
if (!s)
return 0;
 
@@ -84,7 +84,7 @@ s_ustream_write(BIO *b, const char *buf, int len)
if (!buf || len <= 0)
return 0;
 
-   s = (struct ustream *)b->ptr;
+   s = (struct ustream *)BIO_get_data(b);
if (!s)
return 0;
 
@@ -116,25 +116,23 @@ static long s_ustream_ctrl(BIO *b, int cmd, long num, 
void *ptr)
};
 }
 
-static BIO_METHOD methods_ustream = {
-   100 | BIO_TYPE_SOURCE_SINK,
-   "ustream",
-   s_ustream_write,
-   s_ustream_read,
-   s_ustream_puts,
-   s_ustream_gets,
-   s_ustream_ctrl,
-   s_ustream_new,
-   s_ustream_free,
-   NULL,
-};
-
 static BIO *ustream_bio_new(struct ustream *s)
 {
BIO *bio;
 
-   bio = BIO_new(_ustream);
-   bio->ptr = s;
+   BIO_METHOD *methods_ustream;
+
+   methods_ustream = BIO_meth_new(100 | BIO_TYPE_SOURCE_SINK, "ustream");
+   BIO_meth_set_write(methods_ustream, s_ustream_write);
+   BIO_meth_set_read(methods_ustream, s_ustream_read);
+   BIO_meth_set_puts(methods_ustream, s_ustream_puts);
+   BIO_meth_set_gets(methods_ustream, s_ustream_gets);
+   BIO_meth_set_ctrl(methods_ustream, s_ustream_ctrl);
+   BIO_meth_set_create(methods_ustream, s_ustream_new);
+   BIO_meth_set_destroy(methods_ustream, s_ustream_free);
+   bio = BIO_new(methods_ustream);
+   BIO_set_data(bio, s);
+
return bio;
 }
 
diff --git a/ustream-openssl.c b/ustream-openssl.c
index 91bc4e8..c6839ea 100644
--- a/ustream-openssl.c
+++ b/ustream-openssl.c
@@ -25,35 +25,43 @@
 __hidden struct ustream_ssl_ctx *
 __ustream_ssl_context_new(bool server)
 {
-   static bool _init = false;
const void *m;
SSL_CTX *c;
 
+#if OPENSSL_VERSION_NUMBER < 0x1010L
+   static bool _init = false;
+
if (!_init) {
SSL_load_error_strings();
SSL_library_init();
_init = true;
}
-
-   if (server)
-#ifdef CYASSL_OPENSSL_H_
-   m = SSLv23_server_method();
-#else
-   m = TLSv1_2_server_method();
+# define 

[OpenWrt-Devel] [PATCH] iwinfo: add channel survey

2018-05-31 Thread PolynomialDivision
Add channel survey data.

Signed-off-by: Nick Hainke 
---
 include/iwinfo.h | 11 +++
 iwinfo_cli.c | 31 -
 iwinfo_nl80211.c | 59 +++-
 3 files changed, 99 insertions(+), 2 deletions(-)

diff --git a/include/iwinfo.h b/include/iwinfo.h
index 929f697..004896e 100644
--- a/include/iwinfo.h
+++ b/include/iwinfo.h
@@ -157,6 +157,16 @@ struct iwinfo_scanlist_entry {
struct iwinfo_crypto_entry crypto;
 };
 
+struct iwinfo_survey_entry {
+   uint32_t frequency;
+   int8_t noise;
+   uint64_t channel_time;
+   uint64_t channel_time_busy;
+   uint64_t channel_time_ext_busy;
+   uint64_t channel_time_rx;
+   uint64_t channel_time_tx;
+};
+
 struct iwinfo_country_entry {
uint16_t iso3166;
char ccode[4];
@@ -203,6 +213,7 @@ struct iwinfo_ops {
int (*bitrate)(const char *, int *);
int (*signal)(const char *, int *);
int (*noise)(const char *, int *);
+   int (*survey)(const char *ifname, struct iwinfo_survey_entry *entry);
int (*quality)(const char *, int *);
int (*quality_max)(const char *, int *);
int (*mbssid_support)(const char *, int *);
diff --git a/iwinfo_cli.c b/iwinfo_cli.c
index 49c9035..3d8b82c 100644
--- a/iwinfo_cli.c
+++ b/iwinfo_cli.c
@@ -116,6 +116,18 @@ static char * format_signal(int sig)
return buf;
 }
 
+static char * format_channel_time(uint64_t time)
+{
+   static char buf[30];
+
+   if (!time)
+   snprintf(buf, sizeof(buf), "unknown");
+   else
+   snprintf(buf, sizeof(buf), "%llu ms", time);
+
+   return buf;
+}
+
 static char * format_noise(int noise)
 {
static char buf[10];
@@ -531,6 +543,19 @@ static char * print_phyname(const struct iwinfo_ops *iw, 
const char *ifname)
return "?";
 }
 
+static void print_survey(const struct iwinfo_ops *iw, const char *ifname)
+{
+   struct iwinfo_survey_entry entry;
+   iw->survey(ifname, );
+   printf("%s\tESSID:\t\t\t\t%s\n", ifname, print_ssid(iw, ifname));
+   printf("\tChannel:\t\t\t%s (%s)\n", print_channel(iw, ifname), 
format_frequency(entry.frequency));
+   printf("\tNoise:\t\t\t\t%s\n", format_noise(entry.noise));
+   printf("\tchannel Active Time:\t\t%s\n", 
format_channel_time(entry.channel_time));
+   printf("\tChannel Busy 
Time:\t\t%s\n",format_channel_time(entry.channel_time_busy));
+   printf("\tExtension Channel Busy 
Time:\t%s\n",format_channel_time(entry.channel_time_ext_busy));
+   printf("\tChannel Receive 
Time:\t\t%s\n",format_channel_time(entry.channel_time_rx));
+   printf("\tChannel Transmit 
Time:\t\t%s\n",format_channel_time(entry.channel_time_tx));
+}
 
 static void print_info(const struct iwinfo_ops *iw, const char *ifname)
 {
@@ -805,6 +830,7 @@ int main(int argc, char **argv)
"Usage:\n"
"   iwinfo  info\n"
"   iwinfo  scan\n"
+   "   iwinfo  survey\n"
"   iwinfo  txpowerlist\n"
"   iwinfo  freqlist\n"
"   iwinfo  assoclist\n"
@@ -883,7 +909,10 @@ int main(int argc, char **argv)
break;
 
case 's':
-   print_scanlist(iw, argv[1]);
+   if(argv[i][1] == 'c')
+   print_scanlist(iw, argv[1]);
+   else
+   print_survey(iw, argv[1]);
break;
 
case 't':
diff --git a/iwinfo_nl80211.c b/iwinfo_nl80211.c
index ecd2d6a..2c741a3 100644
--- a/iwinfo_nl80211.c
+++ b/iwinfo_nl80211.c
@@ -1357,6 +1357,63 @@ static int nl80211_get_signal(const char *ifname, int 
*buf)
return -1;
 }
 
+static int nl80211_get_channel_survey_cb(struct nl_msg *msg, void *arg)
+{
+   struct iwinfo_survey_entry *entry = arg;
+   struct nlattr *tb[NL80211_ATTR_MAX + 1];
+   struct genlmsghdr *gnlh = nlmsg_data(nlmsg_hdr(msg));
+   struct nlattr *si[NL80211_SURVEY_INFO_MAX + 1];
+
+   static struct nla_policy sp[NL80211_SURVEY_INFO_MAX + 1] = {
+   [NL80211_SURVEY_INFO_FREQUENCY] = { .type = NLA_U32 },
+   [NL80211_SURVEY_INFO_NOISE] = { .type = NLA_U8  },
+   };
+
+   nla_parse(tb, NL80211_ATTR_MAX, genlmsg_attrdata(gnlh, 0),
+ genlmsg_attrlen(gnlh, 0), NULL);
+
+   if (!tb[NL80211_ATTR_SURVEY_INFO])
+   return NL_SKIP;
+
+   if (nla_parse_nested(si, NL80211_SURVEY_INFO_MAX,
+tb[NL80211_ATTR_SURVEY_INFO], 
sp))
+   return NL_SKIP;
+
+   if (si[NL80211_SURVEY_INFO_IN_USE])

[OpenWrt-Devel] [PATCH] ath10k-ct: Update driver to latest

2018-05-31 Thread Koen Vandeputte
127f98189ee5 ath10k:  Fix bad return w/out unlock, compile w/out debugfs
b8f48f3c138f Fix survey-dump for 4.7, 4.9 and 4.13 kernels.
fa8259ad5d6d ath10k-ct:  Support survey dump in 10.1 firmware.
2853e1337ecf ath10k-ct:  Add 4.16 ath10k-ct driver to package.

Signed-off-by: Koen Vandeputte 
CC: Ben Greear 
---


Please also cherrypick to 18.06


 package/kernel/ath10k-ct/Makefile | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/package/kernel/ath10k-ct/Makefile 
b/package/kernel/ath10k-ct/Makefile
index 9c69dee72f64..e5d505b9f66c 100644
--- a/package/kernel/ath10k-ct/Makefile
+++ b/package/kernel/ath10k-ct/Makefile
@@ -8,9 +8,9 @@ PKG_LICENSE_FILES:=
 
 PKG_SOURCE_URL:=https://github.com/greearb/ath10k-ct.git
 PKG_SOURCE_PROTO:=git
-PKG_SOURCE_DATE:=2018-03-16
-PKG_SOURCE_VERSION:=30827f7d5b9841905c4efe918da2d95fc518c921
-PKG_MIRROR_HASH:=aac023d7f9b09becf27058b1d09ae6d068b14bb6f10c5b5a248c7ee5ecff04dc
+PKG_SOURCE_DATE:=2018-05-30
+PKG_SOURCE_VERSION:=127f98189ee57260ed175a60d6654a43c32a8f4b
+PKG_MIRROR_HASH:=f8856c9d950d3b12ce0d8770e56e861df14878a1b3601592205c5d51edc794ac
 
 # Build the 4.13 ath10k-ct driver version.  Other options are "-4.9", or
 # leave un-defined for 4.7 kernel.  Probably this should match as closely as
-- 
2.7.4


___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/listinfo/openwrt-devel


Re: [OpenWrt-Devel] Build failure ath10k-CT without mac80211 debug

2018-05-31 Thread Koen Vandeputte



On 2018-05-30 17:30, Koen Vandeputte wrote:



On 2018-05-30 17:12, Ben Greear wrote:

I have fixed this in ath10k-ct repo, thanks for the bug report.

In case you are able to update OpenWRT to use the latest ath10k-ct
repo, please feel free to submit a patch.  Otherwise, I'll update
OpenWRT when I have a chance to work on it again.

Thanks,
Ben



Hi Ben,

Thanks for fixing this!
I'll submit an OpenWrt patch tomorrow after testing it.

Regards,

Koen


Hi Ben,

I can confirm building the driver without mac80211 DebugFS enabled is fixed


Thanks again,

Koen

___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/listinfo/openwrt-devel