Re: [PATCH 1/3] hostapd: update to 2022-05-08

2022-06-11 Thread Stefan Lippers-Hollmann
Hi

On 2022-06-12, Stefan Lippers-Hollmann wrote:
> On 2022-06-07, David Bauer wrote:
> > Update hostapd to Git HEAD from 2022-05-08. This allows us to take
> > advantage of background radar-detection ad well as BSS color collision.
>
> I'm noticing a build failure for wpad-full-openssl since this patch
> series went in, Debian/ unstable build host (x86_64), x86_64 build
> target:

Looking into this further suggests OPENSSL_NO_DEPRECATED=y being the
cause of this build failure

[...]
> ../src/crypto/crypto_openssl.c: In function 'crypto_rsa_oaep_sha256_encrypt':
> ../src/crypto/crypto_openssl.c:4003:13: warning: implicit declaration of 
> function 'EVP_PKEY_CTX_set_rsa_padding'; did you mean 
> 'EVP_PKEY_CTX_set_dh_pad'? [-Wimplicit-function-declaration]
>  4003 | EVP_PKEY_CTX_set_rsa_padding(pkctx, 
> RSA_PKCS1_OAEP_PADDING) <= 0 ||
>   | ^~~~
>   | EVP_PKEY_CTX_set_dh_pad
> ../src/crypto/crypto_openssl.c:4003:49: error: 'RSA_PKCS1_OAEP_PADDING' 
> undeclared (first use in this function)
>  4003 | EVP_PKEY_CTX_set_rsa_padding(pkctx, 
> RSA_PKCS1_OAEP_PADDING) <= 0 ||
>   | ^~
> ../src/crypto/crypto_openssl.c:4003:49: note: each undeclared identifier is 
> reported only once for each function it appears in
> ../src/crypto/crypto_openssl.c:4004:13: warning: implicit declaration of 
> function 'EVP_PKEY_CTX_set_rsa_oaep_md'; did you mean 
> 'EVP_PKEY_CTX_set_dh_kdf_md'? [-Wimplicit-function-declaration]
>  4004 | EVP_PKEY_CTX_set_rsa_oaep_md(pkctx, EVP_sha256()) <= 0 ||
>   | ^~~~
>   | EVP_PKEY_CTX_set_dh_kdf_md
> ../src/crypto/crypto_openssl.c: In function 'crypto_rsa_oaep_sha256_decrypt':
> ../src/crypto/crypto_openssl.c:4040:49: error: 'RSA_PKCS1_OAEP_PADDING' 
> undeclared (first use in this function)
>  4040 | EVP_PKEY_CTX_set_rsa_padding(pkctx, 
> RSA_PKCS1_OAEP_PADDING) <= 0 ||
>   | ^~
> make[4]: *** [../src/build.rules:86: 
> /tmp/pkg/openwrt/build_dir/target-x86_64_musl/hostapd-wpad-full-openssl/hostapd-2022-05-08-b859b9bc/build/hostapd/src/crypto/crypto_openssl.o]
>  Error 1

[...]

> CONFIG_OPENSSL_NO_DEPRECATED=y
> # CONFIG_OPENSSL_WITH_DEPRECATED is not set

and indeed, setting

CONFIG_OPENSSL_WITH_DEPRECATED=y
# CONFIG_OPENSSL_NO_DEPRECATED is not set

instead avoids the build failure.

Sorry for the noise.

Regards
Stefan Lippers-Hollmann

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


Re: [PATCH 1/3] hostapd: update to 2022-05-08

2022-06-11 Thread Stefan Lippers-Hollmann
Hi

On 2022-06-07, David Bauer wrote:
> Update hostapd to Git HEAD from 2022-05-08. This allows us to take
> advantage of background radar-detection ad well as BSS color collision.

I'm noticing a build failure for wpad-full-openssl since this patch
series went in, Debian/ unstable build host (x86_64), x86_64 build
target:

make[4]: Entering directory 
'/tmp/pkg/openwrt/build_dir/target-x86_64_musl/hostapd-wpad-full-openssl/hostapd-2022-05-08-b859b9bc/hostapd'
x86_64-openwrt-linux-musl-gcc -c -o 
/tmp/pkg/openwrt/build_dir/target-x86_64_musl/hostapd-wpad-full-openssl/hostapd-2022-05-08-b859b9bc/build/hostapd/src/crypto/crypto_openssl.o
 -I/tmp/pkg/openwrt/staging_dir/target-x86_64_musl/usr/include/libnl-tiny 
-I/tmp/pkg/openwrt/build_dir/target-x86_64_musl/hostapd-wpad-full-openssl/hostapd-2022-05-08-b859b9bc/src/crypto
 -I/tmp/pkg/openwrt/staging_dir/toolchain-x86_64_gcc-11.3.0_musl/usr/include 
-I/tmp/pkg/openwrt/staging_dir/toolchain-x86_64_gcc-11.3.0_musl/include/fortify 
-I/tmp/pkg/openwrt/staging_dir/toolchain-x86_64_gcc-11.3.0_musl/include 
-DCONFIG_LIBNL20 -D_GNU_SOURCE -DCONFIG_MSG_MIN_PRIORITY=3 -Os -pipe 
-fno-caller-saves -fno-plt -fhonour-copts -Wno-error=unused-but-set-variable 
-Wno-error=unused-result 
-fmacro-prefix-map=/tmp/pkg/openwrt/build_dir/target-x86_64_musl/hostapd-wpad-full-openssl/hostapd-2022-05-08-b859b9bc=hostapd-2022-05-08-b859b9bc
 -Wformat -Werror=format-security -DPIC -fpic -fstack-protector 
-D_FORTIFY_SOURCE=1 -Wl,-z,now -Wl,-z,relro -ffunction-sections -fdata-sections 
-flto 
-I/tmp/pkg/openwrt/build_dir/target-x86_64_musl/hostapd-wpad-full-openssl/hostapd-2022-05-08-b859b9bc/src
 
-I/tmp/pkg/openwrt/build_dir/target-x86_64_musl/hostapd-wpad-full-openssl/hostapd-2022-05-08-b859b9bc/src/utils
 -DHOSTAPD -DCONFIG_TAXONOMY -DCONFIG_ELOOP_EPOLL -DUBUS_SUPPORT 
-DCONFIG_FULL_DYNAMIC_VLAN -DCONFIG_CTRL_IFACE_MIB -DCONFIG_CTRL_IFACE_UNIX 
-DCONFIG_CTRL_IFACE -DCONFIG_RSN_PREAUTH -DCONFIG_SUITEB192 -DCONFIG_IEEE80211R 
-DCONFIG_IEEE80211R_AP -DCONFIG_ETH_P_OUI -DCONFIG_SAE -DCONFIG_OWE 
-DCONFIG_AIRTIME_POLICY -DCONFIG_FILS -DCONFIG_WNM -DCONFIG_WNM_AP 
-DCONFIG_IEEE80211AC -DCONFIG_DRIVER_WIRED -DCONFIG_DRIVER_NL80211 
-DCONFIG_RFKILL -DCONFIG_DRIVER_WIRED -DCONFIG_DRIVER_NL80211 -DCONFIG_ERP 
-DEAP_SERVER_MD5 -DEAP_SERVER_TLS -DEAP_SERVER_PEAP -DEAP_SERVER_TTLS 
-DEAP_SERVER_MSCHAPV2 -DEAP_SERVER_GTC -DEAP_SERVER_FAST -DCONFIG_WPS 
-DEAP_SERVER_WSC -DEAP_SERVER_IDENTITY -DEAP_SERVER -DPKCS12_FUNCS 
-DEAP_TLS_FUNCS -DCRYPTO_RSA_OAEP_SHA256 
-DTLS_DEFAULT_CIPHERS=\"DEFAULT:!EXP:!LOW\" -DCONFIG_DES -DCONFIG_SHA256 
-DCONFIG_SHA384 -DCONFIG_SHA512 -DCONFIG_ECC -DCONFIG_NO_RANDOM_POOL 
-DCONFIG_IPV6 -DNEED_AP_MLME -DCONFIG_HS20 -DCONFIG_INTERWORKING 
-DCONFIG_PROXYARP -DCONFIG_ACS -DCONFIG_DEBUG_SYSLOG 
-I/tmp/pkg/openwrt/staging_dir/target-x86_64_musl/usr/include/libnl-tiny 
-I/tmp/pkg/openwrt/build_dir/target-x86_64_musl/hostapd-wpad-full-openssl/hostapd-2022-05-08-b859b9bc/src/crypto
 -I/tmp/pkg/openwrt/staging_dir/toolchain-x86_64_gcc-11.3.0_musl/usr/include 
-I/tmp/pkg/openwrt/staging_dir/toolchain-x86_64_gcc-11.3.0_musl/include/fortify 
-I/tmp/pkg/openwrt/staging_dir/toolchain-x86_64_gcc-11.3.0_musl/include 
-DCONFIG_LIBNL20 -D_GNU_SOURCE -DCONFIG_MSG_MIN_PRIORITY=3 
-I/tmp/pkg/openwrt/build_dir/target-x86_64_musl/hostapd-wpad-full-openssl/hostapd-2022-05-08-b859b9bc/src
 
-I/tmp/pkg/openwrt/build_dir/target-x86_64_musl/hostapd-wpad-full-openssl/hostapd-2022-05-08-b859b9bc/src/utils
 -DCONFIG_ELOOP_EPOLL -DUBUS_SUPPORT -DCONFIG_HT_OVERRIDES 
-DCONFIG_VHT_OVERRIDES -DCONFIG_BACKEND_FILE -DCONFIG_SUITEB192 
-DCONFIG_IEEE80211R -DCONFIG_MESH -DCONFIG_SAE -DCONFIG_OWE -DCONFIG_FILS 
-DCONFIG_WNM -DCONFIG_IBSS_RSN -DCONFIG_HS20 -DCONFIG_INTERWORKING 
-DCONFIG_DRIVER_WIRED -DCONFIG_DRIVER_NL80211 -DCONFIG_RFKILL -DCONFIG_ERP 
-DEAP_TLS -DEAP_PEAP -DEAP_TTLS -DEAP_MD5 -DEAP_MSCHAPv2 -DEAP_GTC -DEAP_OTP 
-DEAP_LEAP -DEAP_FAST -DCONFIG_WPS -DEAP_WSC -DIEEE8021X_EAPOL -DCONFIG_AP 
-DCONFIG_CTRL_IFACE_MIB -DEAP_SERVER -DEAP_SERVER_IDENTITY -DCONFIG_IEEE80211AC 
-DNEED_AP_MLME -DEAP_SERVER_WSC -DCONFIG_ACS -DPKCS12_FUNCS -DCONFIG_SMARTCARD 
-DCRYPTO_RSA_OAEP_SHA256 -DEAP_TLS_OPENSSL 
-DTLS_DEFAULT_CIPHERS=\"DEFAULT:!EXP:!LOW\" -DCONFIG_DES -DCONFIG_SHA256 
-DCONFIG_HMAC_SHA256_KDF -DCONFIG_HMAC_SHA384_KDF -DCONFIG_HMAC_SHA512_KDF 
-DCONFIG_SHA384 -DCONFIG_SHA512 -DCONFIG_ECC -DCONFIG_NO_RANDOM_POOL 
-DCONFIG_CTRL_IFACE -DCONFIG_CTRL_IFACE_UNIX -DCONFIG_IPV6 
-DCONFIG_NO_LINUX_PACKET_SOCKET_WAR -DCONFIG_SME -DCONFIG_DEBUG_SYSLOG 
-DLOG_HOSTAPD=LOG_DAEMON -DCONFIG_BGSCAN_SIMPLE -DCONFIG_BGSCAN -DCONFIG_GAS 
-DCONFIG_OFFCHANNEL ../src/crypto/crypto_openssl.c
../src/crypto/crypto_openssl.c: In function 'crypto_rsa_oaep_sha256_encrypt':
../src/crypto/crypto_openssl.c:4003:13: warning: implicit declaration of 
function 'EVP_PKEY_CTX_set_rsa_padding'; did you mean 
'EVP_PKEY_CTX_set_dh_pad'? [-Wimplicit-function-declaration]
 4003 | EVP_PKEY_CTX_set_rsa_padding(pkctx, 

Re: [PATCH] uqmi: fix compilation with GCC12

2022-06-11 Thread Bjørn Mork
e9hack  writes:

> The 'dangling pointer' issue can be fix without using malloc().
>
> --- a/dev.c   2022-05-04 02:18:17.0 +0200
> +++ b/dev.c   2022-06-11 08:48:21.185567953 +0200
> @@ -206,6 +206,7 @@ void qmi_request_cancel(struct qmi_dev *
>  int qmi_request_wait(struct qmi_dev *qmi, struct qmi_request *req)
>  {
>   bool complete = false;
> + bool *c;
>   bool cancelled;
>   if (!req->pending)
> @@ -226,8 +227,10 @@ int qmi_request_wait(struct qmi_dev *qmi
>   uloop_cancelled = cancelled;
>   }
>  -if (req->complete == )
> - req->complete = NULL;
> + c = req->complete;
> + req->complete = NULL;
> + if (c != )
> + req->complete = c;
>   return req->ret;
>  }

How about just fixing GCC instead?  Having all sorts of funny and
pointless code just to avoid bogus compiler warnings is kind of stupid,
isn't it?

If GCC can't do better that this, then it's much better to disable that
warning.


Bjørn

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


Re: [PATCH v1 2/2] ath79: D-Link DAP-2xxx (QCA953x): convert ath9k caldata to nvmem

2022-06-11 Thread Sander Vanheule
Hi Christian,

On Sat, 2022-06-11 at 15:01 +0200, Christian Lamparter wrote:
> On 11/06/2022 14:05, Sander Vanheule wrote:
> > Convert the calibration data reference for the ath9k radio to an
> > nvmem-cell, replacing the downstream mtd-cal-data property.
> > 
> > Cc: Sebastian Schaper 
> > Signed-off-by: Sander Vanheule 
> > ---
> >   target/linux/ath79/dts/qca953x_dlink_dap-2xxx.dtsi | 13 -
> >   1 file changed, 12 insertions(+), 1 deletion(-)
> > 
> > diff --git a/target/linux/ath79/dts/qca953x_dlink_dap-2xxx.dtsi
> > b/target/linux/ath79/dts/qca953x_dlink_dap-2xxx.dtsi
> > index 59c09dbe1b62..1bce67c871b7 100644
> > --- a/target/linux/ath79/dts/qca953x_dlink_dap-2xxx.dtsi
> > +++ b/target/linux/ath79/dts/qca953x_dlink_dap-2xxx.dtsi
> > @@ -54,5 +54,16 @@
> >    {
> > status = "okay";
> >   
> > -   mtd-cal-data = < 0x1000>;
> > +   nvmem-cells = <_ath9k>;
> > +   nvmem-cell-names = "calibration";
> > +};
> > +
> > + {
> > +   compatible = "nvmem-cells";
> > +   #address-cells = <1>;
> > +   #size-cells = <1>;
> > +
> > +   cal_ath9k: calibration@1000 {
> > +   reg = <0x1000 0x440>;
> > +   };
> >   };
> 
> you could merge the content of the  { compatible = "nvmem-cells" ... }
> right into the "new" "partition@ff000 { label = "art" ... }" from your first
> patch of this series.
> 
> This would likely make the extra art-label redundant too.
> (Personally, I think it is better to keep the information together,
> if it's all in the same file anyway.)

I've heard different opinions about this, perhaps because you end up nesting 
quite deep. In this
case everything can indeed be contained to the (unlabeled) ART partition. The 
latter is also how I
would prefer it actually, but these are the first changes of this type I've 
submitted. I'll update
in v2.

Best,
Sander

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


Re: [PATCH v1 2/2] ath79: D-Link DAP-2xxx (QCA953x): convert ath9k caldata to nvmem

2022-06-11 Thread Christian Lamparter

On 11/06/2022 14:05, Sander Vanheule wrote:

Convert the calibration data reference for the ath9k radio to an
nvmem-cell, replacing the downstream mtd-cal-data property.

Cc: Sebastian Schaper 
Signed-off-by: Sander Vanheule 
---
  target/linux/ath79/dts/qca953x_dlink_dap-2xxx.dtsi | 13 -
  1 file changed, 12 insertions(+), 1 deletion(-)

diff --git a/target/linux/ath79/dts/qca953x_dlink_dap-2xxx.dtsi 
b/target/linux/ath79/dts/qca953x_dlink_dap-2xxx.dtsi
index 59c09dbe1b62..1bce67c871b7 100644
--- a/target/linux/ath79/dts/qca953x_dlink_dap-2xxx.dtsi
+++ b/target/linux/ath79/dts/qca953x_dlink_dap-2xxx.dtsi
@@ -54,5 +54,16 @@
   {
status = "okay";
  
-	mtd-cal-data = < 0x1000>;

+   nvmem-cells = <_ath9k>;
+   nvmem-cell-names = "calibration";
+};
+
+ {
+   compatible = "nvmem-cells";
+   #address-cells = <1>;
+   #size-cells = <1>;
+
+   cal_ath9k: calibration@1000 {
+   reg = <0x1000 0x440>;
+   };
  };


you could merge the content of the  { compatible = "nvmem-cells" ... }
right into the "new" "partition@ff000 { label = "art" ... }" from your first
patch of this series.

This would likely make the extra art-label redundant too.
(Personally, I think it is better to keep the information together,
if it's all in the same file anyway.)

Cheers,
Christian

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


[PATCH v1 1/2] ath79: D-Link DAP-2xxx (QCA953x): move art partition to DTSI

2022-06-11 Thread Sander Vanheule
The art partition containing the radio calibration data is in the same
location for all supported devices. Move the definition to the base file
so the reference from the wmac node can reference the same file.

Cc: Sebastian Schaper 
Signed-off-by: Sander Vanheule 
---
 target/linux/ath79/dts/qca9533_dlink_dap-2230-a1.dts | 6 --
 target/linux/ath79/dts/qca9533_dlink_dap-3320-a1.dts | 6 --
 target/linux/ath79/dts/qca953x_dlink_dap-2xxx.dtsi   | 6 ++
 3 files changed, 6 insertions(+), 12 deletions(-)

diff --git a/target/linux/ath79/dts/qca9533_dlink_dap-2230-a1.dts 
b/target/linux/ath79/dts/qca9533_dlink_dap-2230-a1.dts
index 3717a35ae30c..90383690b972 100644
--- a/target/linux/ath79/dts/qca9533_dlink_dap-2230-a1.dts
+++ b/target/linux/ath79/dts/qca9533_dlink_dap-2230-a1.dts
@@ -46,10 +46,4 @@
reg = <0xf5 0xa>;
read-only;
};
-
-   art: partition@ff {
-   label = "art";
-   reg = <0xff 0x1>;
-   read-only;
-   };
 };
diff --git a/target/linux/ath79/dts/qca9533_dlink_dap-3320-a1.dts 
b/target/linux/ath79/dts/qca9533_dlink_dap-3320-a1.dts
index c186a7ee442d..5758b0d2a31c 100644
--- a/target/linux/ath79/dts/qca9533_dlink_dap-3320-a1.dts
+++ b/target/linux/ath79/dts/qca9533_dlink_dap-3320-a1.dts
@@ -46,10 +46,4 @@
reg = <0xf6 0x9>;
read-only;
};
-
-   art: partition@ff {
-   label = "art";
-   reg = <0xff 0x1>;
-   read-only;
-   };
 };
diff --git a/target/linux/ath79/dts/qca953x_dlink_dap-2xxx.dtsi 
b/target/linux/ath79/dts/qca953x_dlink_dap-2xxx.dtsi
index 71d9fffbe3e5..59c09dbe1b62 100644
--- a/target/linux/ath79/dts/qca953x_dlink_dap-2xxx.dtsi
+++ b/target/linux/ath79/dts/qca953x_dlink_dap-2xxx.dtsi
@@ -41,6 +41,12 @@
reg = <0x6 0x1>;
read-only;
};
+
+   art: partition@ff {
+   label = "art";
+   reg = <0xff 0x1>;
+   read-only;
+   };
};
};
 };
-- 
2.36.1


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


[PATCH v1 0/2] ath79: convert QCA953x-based D-Link DAP-2xxx to nvmem

2022-06-11 Thread Sander Vanheule
Convert the QCA9533 based devices to nvmem-cell based calibration data
extraction, so the downstream mtd-cal-data property can be dropped.

Sander Vanheule (2):
  ath79: D-Link DAP-2xxx (QCA953x): move art partition to DTSI
  ath79: D-Link DAP-2xxx (QCA953x): convert ath9k caldata to nvmem

 .../ath79/dts/qca9533_dlink_dap-2230-a1.dts   |  6 --
 .../ath79/dts/qca9533_dlink_dap-3320-a1.dts   |  6 --
 .../ath79/dts/qca953x_dlink_dap-2xxx.dtsi | 19 ++-
 3 files changed, 18 insertions(+), 13 deletions(-)

-- 
2.36.1


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


[PATCH v1 2/2] ath79: D-Link DAP-2xxx (QCA953x): convert ath9k caldata to nvmem

2022-06-11 Thread Sander Vanheule
Convert the calibration data reference for the ath9k radio to an
nvmem-cell, replacing the downstream mtd-cal-data property.

Cc: Sebastian Schaper 
Signed-off-by: Sander Vanheule 
---
 target/linux/ath79/dts/qca953x_dlink_dap-2xxx.dtsi | 13 -
 1 file changed, 12 insertions(+), 1 deletion(-)

diff --git a/target/linux/ath79/dts/qca953x_dlink_dap-2xxx.dtsi 
b/target/linux/ath79/dts/qca953x_dlink_dap-2xxx.dtsi
index 59c09dbe1b62..1bce67c871b7 100644
--- a/target/linux/ath79/dts/qca953x_dlink_dap-2xxx.dtsi
+++ b/target/linux/ath79/dts/qca953x_dlink_dap-2xxx.dtsi
@@ -54,5 +54,16 @@
  {
status = "okay";
 
-   mtd-cal-data = < 0x1000>;
+   nvmem-cells = <_ath9k>;
+   nvmem-cell-names = "calibration";
+};
+
+ {
+   compatible = "nvmem-cells";
+   #address-cells = <1>;
+   #size-cells = <1>;
+
+   cal_ath9k: calibration@1000 {
+   reg = <0x1000 0x440>;
+   };
 };
-- 
2.36.1


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


[PATCH v1 6/6] ath79: D-Link DAP-3662 A1: convert ath10k caldata to nvmem

2022-06-11 Thread Sander Vanheule
Add the PCIe node for the ath10k radio to the devicetree, and refer to
the art partition for the calibration data using nvmem-cells.

MAC address assignment is moved to '10_fix_wifi_mac', so the device can
then be removed from the caldata extraction script '11-ath10k-caldata'.

Cc: Sebastian Schaper 
Signed-off-by: Sander Vanheule 
---
 .../linux/ath79/dts/qca9558_dlink_dap-3662-a1.dts  | 14 ++
 .../etc/hotplug.d/firmware/11-ath10k-caldata   |  4 
 .../etc/hotplug.d/ieee80211/10_fix_wifi_mac|  7 ++-
 3 files changed, 16 insertions(+), 9 deletions(-)

diff --git a/target/linux/ath79/dts/qca9558_dlink_dap-3662-a1.dts 
b/target/linux/ath79/dts/qca9558_dlink_dap-3662-a1.dts
index 1ecc987a4f2c..27883f721cf5 100644
--- a/target/linux/ath79/dts/qca9558_dlink_dap-3662-a1.dts
+++ b/target/linux/ath79/dts/qca9558_dlink_dap-3662-a1.dts
@@ -93,4 +93,18 @@
 
  {
status = "okay";
+
+   wifi@0,0 {
+   compatible = "qcom,ath10k";
+   reg = <0 0 0 0 0>;
+
+   nvmem-cells = <_ath10k>;
+   nvmem-cell-names = "calibration";
+   };
+};
+
+ {
+   cal_ath10k: calibration@5000 {
+   reg = <0x5000 0x844>;
+   };
 };
diff --git 
a/target/linux/ath79/generic/base-files/etc/hotplug.d/firmware/11-ath10k-caldata
 
b/target/linux/ath79/generic/base-files/etc/hotplug.d/firmware/11-ath10k-caldata
index 2223b8f33a95..55604c7562f2 100644
--- 
a/target/linux/ath79/generic/base-files/etc/hotplug.d/firmware/11-ath10k-caldata
+++ 
b/target/linux/ath79/generic/base-files/etc/hotplug.d/firmware/11-ath10k-caldata
@@ -67,10 +67,6 @@ case "$FIRMWARE" in
caldata_extract "art" 0x5000 0x844
ath10k_patch_mac $(macaddr_add $(mtd_get_mac_binary art 0x0) -1)
;;
-   dlink,dap-3662-a1)
-   caldata_extract "art" 0x5000 0x844
-   ath10k_patch_mac $(mtd_get_mac_ascii bdcfg wlanmac_a)
-   ;;
dlink,dir-859-a1)
caldata_extract "art" 0x5000 0x844
ath10k_patch_mac $(mtd_get_mac_ascii devdata "wlan5mac")
diff --git 
a/target/linux/ath79/generic/base-files/etc/hotplug.d/ieee80211/10_fix_wifi_mac 
b/target/linux/ath79/generic/base-files/etc/hotplug.d/ieee80211/10_fix_wifi_mac
index fc74d3dd4a00..95ff6083c7f8 100644
--- 
a/target/linux/ath79/generic/base-files/etc/hotplug.d/ieee80211/10_fix_wifi_mac
+++ 
b/target/linux/ath79/generic/base-files/etc/hotplug.d/ieee80211/10_fix_wifi_mac
@@ -26,13 +26,10 @@ case "$board" in
dlink,dap-3320-a1)
mtd_get_mac_ascii bdcfg "wlanmac" > /sys${DEVPATH}/macaddress
;;
-   dlink,dap-3662-a1)
-   [ "$PHYNBR" -eq 1 ] && \
-   mtd_get_mac_ascii bdcfg "wlanmac" > 
/sys${DEVPATH}/macaddress
-   ;;
dlink,dap-2660-a1|\
dlink,dap-2680-a1|\
-   dlink,dap-2695-a1)
+   dlink,dap-2695-a1|\
+   dlink,dap-3662-a1)
[ "$PHYNBR" -eq 0 ] && \
mtd_get_mac_ascii bdcfg "wlanmac_a" > 
/sys${DEVPATH}/macaddress
[ "$PHYNBR" -eq 1 ] && \
-- 
2.36.1


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


[PATCH v1 5/6] ath79: D-Link DAP-2695 A1: convert ath10k caldata to nvmem

2022-06-11 Thread Sander Vanheule
Add the PCIe node for the ath10k radio to the devicetree, and refer to
the art partition for the calibration data using nvmem-cells.

MAC address assignment is moved to '10_fix_wifi_mac', so the device can
then be removed from the caldata extraction script '11-ath10k-caldata'.

Cc: Sebastian Schaper 
Signed-off-by: Sander Vanheule 
---
 .../linux/ath79/dts/qca9558_dlink_dap-2695-a1.dts  | 14 ++
 .../etc/hotplug.d/firmware/11-ath10k-caldata   |  1 -
 .../etc/hotplug.d/ieee80211/10_fix_wifi_mac|  4 ++--
 3 files changed, 16 insertions(+), 3 deletions(-)

diff --git a/target/linux/ath79/dts/qca9558_dlink_dap-2695-a1.dts 
b/target/linux/ath79/dts/qca9558_dlink_dap-2695-a1.dts
index 4a13f639d173..e96ee79a98c2 100644
--- a/target/linux/ath79/dts/qca9558_dlink_dap-2695-a1.dts
+++ b/target/linux/ath79/dts/qca9558_dlink_dap-2695-a1.dts
@@ -106,4 +106,18 @@
 
  {
status = "okay";
+
+   wifi@0,0 {
+   compatible = "qcom,ath10k";
+   reg = <0 0 0 0 0>;
+
+   nvmem-cells = <_ath10k>;
+   nvmem-cell-names = "calibration";
+   };
+};
+
+ {
+   cal_ath10k: calibration@5000 {
+   reg = <0x5000 0x844>;
+   };
 };
diff --git 
a/target/linux/ath79/generic/base-files/etc/hotplug.d/firmware/11-ath10k-caldata
 
b/target/linux/ath79/generic/base-files/etc/hotplug.d/firmware/11-ath10k-caldata
index b27fbe415065..2223b8f33a95 100644
--- 
a/target/linux/ath79/generic/base-files/etc/hotplug.d/firmware/11-ath10k-caldata
+++ 
b/target/linux/ath79/generic/base-files/etc/hotplug.d/firmware/11-ath10k-caldata
@@ -67,7 +67,6 @@ case "$FIRMWARE" in
caldata_extract "art" 0x5000 0x844
ath10k_patch_mac $(macaddr_add $(mtd_get_mac_binary art 0x0) -1)
;;
-   dlink,dap-2695-a1|\
dlink,dap-3662-a1)
caldata_extract "art" 0x5000 0x844
ath10k_patch_mac $(mtd_get_mac_ascii bdcfg wlanmac_a)
diff --git 
a/target/linux/ath79/generic/base-files/etc/hotplug.d/ieee80211/10_fix_wifi_mac 
b/target/linux/ath79/generic/base-files/etc/hotplug.d/ieee80211/10_fix_wifi_mac
index fbd5344a1e82..fc74d3dd4a00 100644
--- 
a/target/linux/ath79/generic/base-files/etc/hotplug.d/ieee80211/10_fix_wifi_mac
+++ 
b/target/linux/ath79/generic/base-files/etc/hotplug.d/ieee80211/10_fix_wifi_mac
@@ -26,13 +26,13 @@ case "$board" in
dlink,dap-3320-a1)
mtd_get_mac_ascii bdcfg "wlanmac" > /sys${DEVPATH}/macaddress
;;
-   dlink,dap-2695-a1|\
dlink,dap-3662-a1)
[ "$PHYNBR" -eq 1 ] && \
mtd_get_mac_ascii bdcfg "wlanmac" > 
/sys${DEVPATH}/macaddress
;;
dlink,dap-2660-a1|\
-   dlink,dap-2680-a1)
+   dlink,dap-2680-a1|\
+   dlink,dap-2695-a1)
[ "$PHYNBR" -eq 0 ] && \
mtd_get_mac_ascii bdcfg "wlanmac_a" > 
/sys${DEVPATH}/macaddress
[ "$PHYNBR" -eq 1 ] && \
-- 
2.36.1


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


[PATCH v1 3/6] ath79: D-Link DAP-2680 A1: convert ath10k caldata to nvmem

2022-06-11 Thread Sander Vanheule
Add the PCIe node for the ath10k radio to the devicetree, and refer to
the art partition for the calibration data using nvmem-cells.

MAC address assignment is moved to '10_fix_wifi_mac', so the device can
then be removed from the caldata extraction script '11-ath10k-caldata'.

Cc: Sebastian Schaper 
Signed-off-by: Sander Vanheule 
---
 .../linux/ath79/dts/qca9558_dlink_dap-2680-a1.dts  | 14 ++
 .../etc/hotplug.d/firmware/11-ath10k-caldata   |  6 --
 .../etc/hotplug.d/ieee80211/10_fix_wifi_mac|  7 ++-
 3 files changed, 20 insertions(+), 7 deletions(-)

diff --git a/target/linux/ath79/dts/qca9558_dlink_dap-2680-a1.dts 
b/target/linux/ath79/dts/qca9558_dlink_dap-2680-a1.dts
index 0593fd29f418..09503da52b60 100644
--- a/target/linux/ath79/dts/qca9558_dlink_dap-2680-a1.dts
+++ b/target/linux/ath79/dts/qca9558_dlink_dap-2680-a1.dts
@@ -79,4 +79,18 @@
 
  {
status = "okay";
+
+   wifi@0,0 {
+   compatible = "qcom,ath10k";
+   reg = <0 0 0 0 0>;
+
+   nvmem-cells = <_ath10k>;
+   nvmem-cell-names = "calibration";
+   };
+};
+
+ {
+   cal_ath10k: calibration@5000 {
+   reg = <0x5000 0x2f20>;
+   };
 };
diff --git 
a/target/linux/ath79/generic/base-files/etc/hotplug.d/firmware/11-ath10k-caldata
 
b/target/linux/ath79/generic/base-files/etc/hotplug.d/firmware/11-ath10k-caldata
index 668fd76af3a4..74a625ca840c 100644
--- 
a/target/linux/ath79/generic/base-files/etc/hotplug.d/firmware/11-ath10k-caldata
+++ 
b/target/linux/ath79/generic/base-files/etc/hotplug.d/firmware/11-ath10k-caldata
@@ -199,12 +199,6 @@ case "$FIRMWARE" in
/lib/firmware/ath10k/QCA9888/hw2.0/board.bin
rm /lib/firmware/ath10k/QCA9888/hw2.0/board-2.bin
;;
-   dlink,dap-2680-a1)
-   caldata_extract "art" 0x5000 0x2f20
-   ath10k_patch_mac $(mtd_get_mac_ascii bdcfg wlanmac_a)
-   ln -sf /lib/firmware/ath10k/pre-cal-pci-\:00\:00.0.bin \
-   /lib/firmware/ath10k/QCA9888/hw2.0/board.bin
-   ;;
dlink,dir-842-c1|\
dlink,dir-842-c2|\
dlink,dir-842-c3)
diff --git 
a/target/linux/ath79/generic/base-files/etc/hotplug.d/ieee80211/10_fix_wifi_mac 
b/target/linux/ath79/generic/base-files/etc/hotplug.d/ieee80211/10_fix_wifi_mac
index a4f82c54e271..d5a2471a99a9 100644
--- 
a/target/linux/ath79/generic/base-files/etc/hotplug.d/ieee80211/10_fix_wifi_mac
+++ 
b/target/linux/ath79/generic/base-files/etc/hotplug.d/ieee80211/10_fix_wifi_mac
@@ -27,12 +27,17 @@ case "$board" in
mtd_get_mac_ascii bdcfg "wlanmac" > /sys${DEVPATH}/macaddress
;;
dlink,dap-2660-a1|\
-   dlink,dap-2680-a1|\
dlink,dap-2695-a1|\
dlink,dap-3662-a1)
[ "$PHYNBR" -eq 1 ] && \
mtd_get_mac_ascii bdcfg "wlanmac" > 
/sys${DEVPATH}/macaddress
;;
+   dlink,dap-2680-a1)
+   [ "$PHYNBR" -eq 0 ] && \
+   mtd_get_mac_ascii bdcfg "wlanmac_a" > 
/sys${DEVPATH}/macaddress
+   [ "$PHYNBR" -eq 1 ] && \
+   mtd_get_mac_ascii bdcfg "wlanmac" > 
/sys${DEVPATH}/macaddress
+   ;;
iodata,wn-ac1600dgr)
# There is no eeprom data for 5 GHz wlan in "art" partition
# which would allow to patch the macaddress
-- 
2.36.1


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


[PATCH v1 2/6] ath79: D-Link DAP-2xxx (QCA955x): convert ath9k caldata to nvmem

2022-06-11 Thread Sander Vanheule
Convert the calibration data reference for the ath9k radio to an
nvmem-cell, replacing the downstream mtd-cal-data property.

Cc: Sebastian Schaper 
Signed-off-by: Sander Vanheule 
---
 target/linux/ath79/dts/qca955x_dlink_dap-2xxx.dtsi | 13 -
 1 file changed, 12 insertions(+), 1 deletion(-)

diff --git a/target/linux/ath79/dts/qca955x_dlink_dap-2xxx.dtsi 
b/target/linux/ath79/dts/qca955x_dlink_dap-2xxx.dtsi
index 21fde53cc867..46eda3789f48 100644
--- a/target/linux/ath79/dts/qca955x_dlink_dap-2xxx.dtsi
+++ b/target/linux/ath79/dts/qca955x_dlink_dap-2xxx.dtsi
@@ -54,5 +54,16 @@
  {
status = "okay";
 
-   mtd-cal-data = < 0x1000>;
+   nvmem-cells = <_ath9k>;
+   nvmem-cell-names = "calibration";
+};
+
+ {
+   compatible = "nvmem-cells";
+   #address-cells = <1>;
+   #size-cells = <1>;
+
+   cal_ath9k: calibration@1000 {
+   reg = <0x1000 0x440>;
+   };
 };
-- 
2.36.1


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


[PATCH v1 1/6] ath79: D-Link DAP-2xxx (QCA955x): move art partition to DTSI

2022-06-11 Thread Sander Vanheule
The art partition containing the radio calibration data is in the same
location for all supported devices. Move the definition to the base file
so the reference from the wmac node can reference the same file.

Cc: Sebastian Schaper 
Signed-off-by: Sander Vanheule 
---
 target/linux/ath79/dts/qca9557_dlink_dap-2660-a1.dts | 6 --
 target/linux/ath79/dts/qca9558_dlink_dap-2680-a1.dts | 6 --
 target/linux/ath79/dts/qca9558_dlink_dap-2695-a1.dts | 6 --
 target/linux/ath79/dts/qca9558_dlink_dap-3662-a1.dts | 6 --
 target/linux/ath79/dts/qca955x_dlink_dap-2xxx.dtsi   | 6 ++
 5 files changed, 6 insertions(+), 24 deletions(-)

diff --git a/target/linux/ath79/dts/qca9557_dlink_dap-2660-a1.dts 
b/target/linux/ath79/dts/qca9557_dlink_dap-2660-a1.dts
index 622f4410b33f..039007942631 100644
--- a/target/linux/ath79/dts/qca9557_dlink_dap-2660-a1.dts
+++ b/target/linux/ath79/dts/qca9557_dlink_dap-2660-a1.dts
@@ -51,12 +51,6 @@
reg = <0xf5 0xa>;
read-only;
};
-
-   art: partition@ff {
-   label = "art";
-   reg = <0xff 0x1>;
-   read-only;
-   };
 };
 
  {
diff --git a/target/linux/ath79/dts/qca9558_dlink_dap-2680-a1.dts 
b/target/linux/ath79/dts/qca9558_dlink_dap-2680-a1.dts
index 7549c0a6970d..0593fd29f418 100644
--- a/target/linux/ath79/dts/qca9558_dlink_dap-2680-a1.dts
+++ b/target/linux/ath79/dts/qca9558_dlink_dap-2680-a1.dts
@@ -51,12 +51,6 @@
reg = <0xf5 0xa>;
read-only;
};
-
-   art: partition@ff {
-   label = "art";
-   reg = <0xff 0x1>;
-   read-only;
-   };
 };
 
  {
diff --git a/target/linux/ath79/dts/qca9558_dlink_dap-2695-a1.dts 
b/target/linux/ath79/dts/qca9558_dlink_dap-2695-a1.dts
index f5a350b33fd0..4a13f639d173 100644
--- a/target/linux/ath79/dts/qca9558_dlink_dap-2695-a1.dts
+++ b/target/linux/ath79/dts/qca9558_dlink_dap-2695-a1.dts
@@ -63,12 +63,6 @@
reg = <0xfe 0x01>;
read-only;
};
-
-   art: partition@ff {
-   label = "art";
-   reg = <0xff 0x01>;
-   read-only;
-   };
 };
 
  {
diff --git a/target/linux/ath79/dts/qca9558_dlink_dap-3662-a1.dts 
b/target/linux/ath79/dts/qca9558_dlink_dap-3662-a1.dts
index 55ac061a56c8..1ecc987a4f2c 100644
--- a/target/linux/ath79/dts/qca9558_dlink_dap-3662-a1.dts
+++ b/target/linux/ath79/dts/qca9558_dlink_dap-3662-a1.dts
@@ -51,12 +51,6 @@
reg = <0xf6 0x9>;
read-only;
};
-
-   art: partition@ff {
-   label = "art";
-   reg = <0xff 0x1>;
-   read-only;
-   };
 };
 
  {
diff --git a/target/linux/ath79/dts/qca955x_dlink_dap-2xxx.dtsi 
b/target/linux/ath79/dts/qca955x_dlink_dap-2xxx.dtsi
index 1047dfddeb14..21fde53cc867 100644
--- a/target/linux/ath79/dts/qca955x_dlink_dap-2xxx.dtsi
+++ b/target/linux/ath79/dts/qca955x_dlink_dap-2xxx.dtsi
@@ -41,6 +41,12 @@
reg = <0x6 0x1>;
read-only;
};
+
+   art: partition@ff {
+   label = "art";
+   reg = <0xff 0x1>;
+   read-only;
+   };
};
};
 };
-- 
2.36.1


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


[PATCH v1 4/6] ath79: D-Link DAP-2660 A1: convert ath10k caldata to nvmem

2022-06-11 Thread Sander Vanheule
Add the PCIe node for the ath10k radio to the devicetree, and refer to
the art partition for the calibration data using nvmem-cells.

MAC address assignment is moved to '10_fix_wifi_mac', so the device can
then be removed from the caldata extraction script '11-ath10k-caldata'.

Cc: Sebastian Schaper 
Signed-off-by: Sander Vanheule 
---
 .../linux/ath79/dts/qca9557_dlink_dap-2660-a1.dts  | 14 ++
 .../etc/hotplug.d/firmware/11-ath10k-caldata   |  1 -
 .../etc/hotplug.d/ieee80211/10_fix_wifi_mac|  2 +-
 3 files changed, 15 insertions(+), 2 deletions(-)

diff --git a/target/linux/ath79/dts/qca9557_dlink_dap-2660-a1.dts 
b/target/linux/ath79/dts/qca9557_dlink_dap-2660-a1.dts
index 039007942631..93e2fc0d974d 100644
--- a/target/linux/ath79/dts/qca9557_dlink_dap-2660-a1.dts
+++ b/target/linux/ath79/dts/qca9557_dlink_dap-2660-a1.dts
@@ -79,4 +79,18 @@
 
  {
status = "okay";
+
+   wifi@0,0 {
+   compatible = "qcom,ath10k";
+   reg = <0 0 0 0 0>;
+
+   nvmem-cells = <_ath10k>;
+   nvmem-cell-names = "calibration";
+   };
+};
+
+ {
+   cal_ath10k: calibration@5000 {
+   reg = <0x5000 0x844>;
+   };
 };
diff --git 
a/target/linux/ath79/generic/base-files/etc/hotplug.d/firmware/11-ath10k-caldata
 
b/target/linux/ath79/generic/base-files/etc/hotplug.d/firmware/11-ath10k-caldata
index 74a625ca840c..b27fbe415065 100644
--- 
a/target/linux/ath79/generic/base-files/etc/hotplug.d/firmware/11-ath10k-caldata
+++ 
b/target/linux/ath79/generic/base-files/etc/hotplug.d/firmware/11-ath10k-caldata
@@ -67,7 +67,6 @@ case "$FIRMWARE" in
caldata_extract "art" 0x5000 0x844
ath10k_patch_mac $(macaddr_add $(mtd_get_mac_binary art 0x0) -1)
;;
-   dlink,dap-2660-a1|\
dlink,dap-2695-a1|\
dlink,dap-3662-a1)
caldata_extract "art" 0x5000 0x844
diff --git 
a/target/linux/ath79/generic/base-files/etc/hotplug.d/ieee80211/10_fix_wifi_mac 
b/target/linux/ath79/generic/base-files/etc/hotplug.d/ieee80211/10_fix_wifi_mac
index d5a2471a99a9..fbd5344a1e82 100644
--- 
a/target/linux/ath79/generic/base-files/etc/hotplug.d/ieee80211/10_fix_wifi_mac
+++ 
b/target/linux/ath79/generic/base-files/etc/hotplug.d/ieee80211/10_fix_wifi_mac
@@ -26,12 +26,12 @@ case "$board" in
dlink,dap-3320-a1)
mtd_get_mac_ascii bdcfg "wlanmac" > /sys${DEVPATH}/macaddress
;;
-   dlink,dap-2660-a1|\
dlink,dap-2695-a1|\
dlink,dap-3662-a1)
[ "$PHYNBR" -eq 1 ] && \
mtd_get_mac_ascii bdcfg "wlanmac" > 
/sys${DEVPATH}/macaddress
;;
+   dlink,dap-2660-a1|\
dlink,dap-2680-a1)
[ "$PHYNBR" -eq 0 ] && \
mtd_get_mac_ascii bdcfg "wlanmac_a" > 
/sys${DEVPATH}/macaddress
-- 
2.36.1


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


[PATCH v1 0/6] ath79: convert QCA955x-based D-Link DAP-2xxx to nvmem

2022-06-11 Thread Sander Vanheule
Convert the QCA955x based devices to nvmem-cell based calibration data
extraction, so this can be removed from the init scripts.

Sander Vanheule (6):
  ath79: D-Link DAP-2xxx (QCA955x): move art partition to DTSI
  ath79: D-Link DAP-2xxx (QCA955x): convert ath9k caldata to nvmem
  ath79: D-Link DAP-2680 A1: convert ath10k caldata to nvmem
  ath79: D-Link DAP-2660 A1: convert ath10k caldata to nvmem
  ath79: D-Link DAP-2695 A1: convert ath10k caldata to nvmem
  ath79: D-Link DAP-3662 A1: convert ath10k caldata to nvmem

 .../ath79/dts/qca9557_dlink_dap-2660-a1.dts   | 20 +--
 .../ath79/dts/qca9558_dlink_dap-2680-a1.dts   | 20 +--
 .../ath79/dts/qca9558_dlink_dap-2695-a1.dts   | 20 +--
 .../ath79/dts/qca9558_dlink_dap-3662-a1.dts   | 20 +--
 .../ath79/dts/qca955x_dlink_dap-2xxx.dtsi | 19 +-
 .../etc/hotplug.d/firmware/11-ath10k-caldata  | 12 ---
 .../etc/hotplug.d/ieee80211/10_fix_wifi_mac   |  2 ++
 7 files changed, 76 insertions(+), 37 deletions(-)

-- 
2.36.1


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


[PATCH] trace: fix memory leak in main

2022-06-11 Thread junnanx . xu
From: XU Junnan 

Signed-off-by: XU Junnan 
---
 trace/trace.c | 4 
 1 file changed, 4 insertions(+)

diff --git a/trace/trace.c b/trace/trace.c
index d895798..6fd321f 100644
--- a/trace/trace.c
+++ b/trace/trace.c
@@ -381,6 +381,10 @@ int main(int argc, char **argv, char **envp)
ULOG_ERR("failed to exec %s: %m\n", _argv[0]);
 
free(_argv);
+   if (_envp[0])
+   free(_envp[0]);
+   if (newenv == 2 && _envp[1])
+   free(_envp[1]);
free(_envp);
return ret;
}
-- 
2.36.1.windows.1


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


[PATCH] trace:fix memory leak in main

2022-06-11 Thread junnanx . xu
From: Junnan XU 

Signed-off-by: Junnan XU 
---
 trace/trace.c | 4 
 1 file changed, 4 insertions(+)

diff --git a/trace/trace.c b/trace/trace.c
index d895798..6fd321f 100644
--- a/trace/trace.c
+++ b/trace/trace.c
@@ -381,6 +381,10 @@ int main(int argc, char **argv, char **envp)
ULOG_ERR("failed to exec %s: %m\n", _argv[0]);
 
free(_argv);
+   if (_envp[0])
+   free(_envp[0]);
+   if (newenv == 2 && _envp[1])
+   free(_envp[1]);
free(_envp);
return ret;
}
-- 
2.36.1.windows.1


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


Re: [PATCH v3] ath79: D-Link DAP-2680: select QCA9984 firmware

2022-06-11 Thread Sander Vanheule
On Sat, 2022-05-21 at 22:59 +0200, Stijn Segers wrote:
> The DAP-2680 has a QCA9984 radio [1], but the commit adding support
> mistakenly adds the QCA99x0 firmware package. See forum topic [2].
> 
> [1] https://wikidevi.wi-cat.ru/D-Link_DAP-2680_rev_A1
> [2] https://forum.openwrt.org/t/missing-5ghz-radio-on-dlink-dap-2680/
> 
> Fixes: 5b58710fad21 ("ath79: add support for D-Link DAP-2680 A1")
> 
> Signed-off-by: Stijn Segers 
> Tested-by: Alessandro Fellin 

Merged to master, and backported to 22.03 for fixes. Thanks!

Best,
Sander

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


Re: [PATCH] uqmi: fix compilation with GCC12

2022-06-11 Thread e9hack

The 'dangling pointer' issue can be fix without using malloc().

--- a/dev.c 2022-05-04 02:18:17.0 +0200
+++ b/dev.c 2022-06-11 08:48:21.185567953 +0200
@@ -206,6 +206,7 @@ void qmi_request_cancel(struct qmi_dev *
 int qmi_request_wait(struct qmi_dev *qmi, struct qmi_request *req)
 {
bool complete = false;
+   bool *c;
bool cancelled;
 
 	if (!req->pending)

@@ -226,8 +227,10 @@ int qmi_request_wait(struct qmi_dev *qmi
uloop_cancelled = cancelled;
}
 
-	if (req->complete == )

-   req->complete = NULL;
+   c = req->complete;
+   req->complete = NULL;
+   if (c != )
+   req->complete = c;
 
 	return req->ret;

 }


Am 09.06.2022 um 03:47 schrieb Rosen Penev:

GCC12 doesn't seem to see that the completed member gets nulled. Use
malloc to work around this.

Signed-off-by: Rosen Penev 
---
  commands-nas.c | 2 +-
  dev.c  | 9 +
  2 files changed, 6 insertions(+), 5 deletions(-)

diff --git a/commands-nas.c b/commands-nas.c
index 476cd61..9c0a626 100644
--- a/commands-nas.c
+++ b/commands-nas.c
@@ -710,7 +710,7 @@ static void
  cmd_nas_get_cell_location_info_cb(struct qmi_dev *qmi, struct qmi_request 
*req, struct qmi_msg *msg)
  {
struct qmi_nas_get_cell_location_info_response res;
-   void *c, *t, *cell, *freq;
+   void *c = NULL, *t, *cell, *freq;
int i, j;
  
  	qmi_parse_nas_get_cell_location_info_response(msg, );

diff --git a/dev.c b/dev.c
index bd10207..b1cf2a3 100644
--- a/dev.c
+++ b/dev.c
@@ -205,7 +205,7 @@ void qmi_request_cancel(struct qmi_dev *qmi, struct 
qmi_request *req)
  
  int qmi_request_wait(struct qmi_dev *qmi, struct qmi_request *req)

  {
-   bool complete = false;
+   bool *complete = malloc(sizeof(bool));
bool cancelled;
  
  	if (!req->pending)

@@ -214,8 +214,8 @@ int qmi_request_wait(struct qmi_dev *qmi, struct 
qmi_request *req)
if (req->complete)
*req->complete = true;
  
-	req->complete = 

-   while (!complete) {
+   req->complete = complete;
+   while (!*complete) {
cancelled = uloop_cancelled;
uloop_cancelled = false;
uloop_run();
@@ -226,9 +226,10 @@ int qmi_request_wait(struct qmi_dev *qmi, struct 
qmi_request *req)
uloop_cancelled = cancelled;
}
  
-	if (req->complete == )

+   if (req->complete == complete)
req->complete = NULL;
  
+	free(complete);

return req->ret;
  }
  



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