mirror of
https://github.com/coolsnowwolf/lede.git
synced 2025-07-30 22:36:58 +08:00
mac80211:update ath10k upstream patches
This commit is contained in:
parent
6105915786
commit
bbe99b4fdf
@ -0,0 +1,37 @@
|
||||
From: Linus Lüssing <ll@simonwunderlich.de>
|
||||
Date: Wed, 5 Feb 2020 20:10:43 +0100
|
||||
Subject: ath10k: increase rx buffer size to 2048
|
||||
|
||||
Before, only frames with a maximum size of 1528 bytes could be
|
||||
transmitted between two 802.11s nodes.
|
||||
|
||||
For batman-adv for instance, which adds its own header to each frame,
|
||||
we typically need an MTU of at least 1532 bytes to be able to transmit
|
||||
without fragmentation.
|
||||
|
||||
This patch now increases the maxmimum frame size from 1528 to 1656
|
||||
bytes.
|
||||
|
||||
Tested with two ath10k devices in 802.11s mode, as well as with
|
||||
batman-adv on top of 802.11s with forwarding disabled.
|
||||
|
||||
Fix originally found and developed by Ben Greear.
|
||||
|
||||
Link: https://github.com/greearb/ath10k-ct/issues/89
|
||||
Link: https://github.com/greearb/ath10k-ct/commit/9e5ab25027e0971fa24ccf93373324c08c4e992d
|
||||
Cc: Ben Greear <greearb@candelatech.com>
|
||||
Signed-off-by: Linus Lüssing <ll@simonwunderlich.de>
|
||||
|
||||
Forwarded: https://patchwork.kernel.org/patch/11367055/
|
||||
|
||||
--- a/drivers/net/wireless/ath/ath10k/htt.h
|
||||
+++ b/drivers/net/wireless/ath/ath10k/htt.h
|
||||
@@ -2004,7 +2004,7 @@ struct htt_rx_desc {
|
||||
* Should be: sizeof(struct htt_host_rx_desc) + max rx MSDU size,
|
||||
* rounded up to a cache line size.
|
||||
*/
|
||||
-#define HTT_RX_BUF_SIZE 1920
|
||||
+#define HTT_RX_BUF_SIZE 2048
|
||||
#define HTT_RX_MSDU_SIZE (HTT_RX_BUF_SIZE - (int)sizeof(struct htt_rx_desc))
|
||||
|
||||
/* Refill a bunch of RX buffers for each refill round so that FW/HW can handle
|
@ -0,0 +1,11 @@
|
||||
--- a/drivers/net/wireless/ath/ath10k/htt.h
|
||||
+++ b/drivers/net/wireless/ath/ath10k/htt.h
|
||||
@@ -238,7 +238,7 @@ enum htt_rx_ring_flags {
|
||||
};
|
||||
|
||||
#define HTT_RX_RING_SIZE_MIN 128
|
||||
-#define HTT_RX_RING_SIZE_MAX 2048
|
||||
+#define HTT_RX_RING_SIZE_MAX 512
|
||||
#define HTT_RX_RING_SIZE HTT_RX_RING_SIZE_MAX
|
||||
#define HTT_RX_RING_FILL_LEVEL (((HTT_RX_RING_SIZE) / 2) - 1)
|
||||
#define HTT_RX_RING_FILL_LEVEL_DUAL_MAC (HTT_RX_RING_SIZE - 1)
|
@ -0,0 +1,38 @@
|
||||
--- a/drivers/net/wireless/ath/ath10k/pci.c
|
||||
+++ b/drivers/net/wireless/ath/ath10k/pci.c
|
||||
@@ -142,7 +142,7 @@ static struct ce_attr host_ce_config_wla
|
||||
.flags = CE_ATTR_FLAGS,
|
||||
.src_nentries = 0,
|
||||
.src_sz_max = 2048,
|
||||
- .dest_nentries = 512,
|
||||
+ .dest_nentries = 128,
|
||||
.recv_cb = ath10k_pci_htt_htc_rx_cb,
|
||||
},
|
||||
|
||||
@@ -151,7 +151,7 @@ static struct ce_attr host_ce_config_wla
|
||||
.flags = CE_ATTR_FLAGS,
|
||||
.src_nentries = 0,
|
||||
.src_sz_max = 2048,
|
||||
- .dest_nentries = 128,
|
||||
+ .dest_nentries = 64,
|
||||
.recv_cb = ath10k_pci_htc_rx_cb,
|
||||
},
|
||||
|
||||
@@ -178,7 +178,7 @@ static struct ce_attr host_ce_config_wla
|
||||
.flags = CE_ATTR_FLAGS,
|
||||
.src_nentries = 0,
|
||||
.src_sz_max = 512,
|
||||
- .dest_nentries = 512,
|
||||
+ .dest_nentries = 128,
|
||||
.recv_cb = ath10k_pci_htt_rx_cb,
|
||||
},
|
||||
|
||||
@@ -203,7 +203,7 @@ static struct ce_attr host_ce_config_wla
|
||||
.flags = CE_ATTR_FLAGS,
|
||||
.src_nentries = 0,
|
||||
.src_sz_max = 2048,
|
||||
- .dest_nentries = 128,
|
||||
+ .dest_nentries = 96,
|
||||
.recv_cb = ath10k_pci_pktlog_rx_cb,
|
||||
},
|
||||
|
@ -0,0 +1,26 @@
|
||||
From 1766e608ba1114220f3b3598e77aa53b50c38a6e Mon Sep 17 00:00:00 2001
|
||||
From: Jouni Malinen <jouni@codeaurora.org>
|
||||
Date: Mon, 14 Oct 2019 19:27:47 +0300
|
||||
Subject: [PATCH] wolfSSL: Fix crypto_bignum_sub()
|
||||
|
||||
The initial crypto wrapper implementation for wolfSSL seems to have
|
||||
included a copy-paste error in crypto_bignum_sub() implementation that
|
||||
was identical to crypto_bignum_add() while mp_sub() should have been
|
||||
used instead of mp_add().
|
||||
|
||||
Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
|
||||
---
|
||||
src/crypto/crypto_wolfssl.c | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
--- a/src/crypto/crypto_wolfssl.c
|
||||
+++ b/src/crypto/crypto_wolfssl.c
|
||||
@@ -1151,7 +1151,7 @@ int crypto_bignum_sub(const struct crypt
|
||||
if (TEST_FAIL())
|
||||
return -1;
|
||||
|
||||
- return mp_add((mp_int *) a, (mp_int *) b,
|
||||
+ return mp_sub((mp_int *) a, (mp_int *) b,
|
||||
(mp_int *) r) == MP_OKAY ? 0 : -1;
|
||||
}
|
||||
|
@ -0,0 +1,31 @@
|
||||
From 6a28c4dbc102de3fed9db44637f47a10e7adfb78 Mon Sep 17 00:00:00 2001
|
||||
From: Jouni Malinen <j@w1.fi>
|
||||
Date: Sat, 16 May 2020 21:01:51 +0300
|
||||
Subject: [PATCH 1/3] wolfssl: Fix compiler warnings on size_t printf format
|
||||
use
|
||||
|
||||
Signed-off-by: Jouni Malinen <j@w1.fi>
|
||||
---
|
||||
src/crypto/tls_wolfssl.c | 4 ++--
|
||||
1 file changed, 2 insertions(+), 2 deletions(-)
|
||||
|
||||
--- a/src/crypto/tls_wolfssl.c
|
||||
+++ b/src/crypto/tls_wolfssl.c
|
||||
@@ -1741,7 +1741,7 @@ struct wpabuf * tls_connection_encrypt(v
|
||||
if (!conn)
|
||||
return NULL;
|
||||
|
||||
- wpa_printf(MSG_DEBUG, "SSL: encrypt: %ld bytes", wpabuf_len(in_data));
|
||||
+ wpa_printf(MSG_DEBUG, "SSL: encrypt: %zu bytes", wpabuf_len(in_data));
|
||||
|
||||
wolfssl_reset_out_data(&conn->output);
|
||||
|
||||
@@ -1792,7 +1792,7 @@ struct wpabuf * tls_connection_decrypt(v
|
||||
}
|
||||
wpabuf_put(buf, res);
|
||||
|
||||
- wpa_printf(MSG_DEBUG, "SSL: decrypt: %ld bytes", wpabuf_len(buf));
|
||||
+ wpa_printf(MSG_DEBUG, "SSL: decrypt: %zu bytes", wpabuf_len(buf));
|
||||
|
||||
return buf;
|
||||
}
|
@ -0,0 +1,49 @@
|
||||
From eb595b3e3ab531645a5bde71cf6385335b7a4b95 Mon Sep 17 00:00:00 2001
|
||||
From: Jouni Malinen <j@w1.fi>
|
||||
Date: Sat, 16 May 2020 21:02:17 +0300
|
||||
Subject: [PATCH 2/3] wolfssl: Fix crypto_bignum_rand() implementation
|
||||
|
||||
The previous implementation used mp_rand_prime() to generate a random
|
||||
value in range 0..m. That is insanely slow way of generating a random
|
||||
value since mp_rand_prime() is for generating a random _prime_ which is
|
||||
not what is needed here. Replace that implementation with generationg of
|
||||
a random value in the requested range without doing any kind of prime
|
||||
number checks or loops to reject values that are not primes.
|
||||
|
||||
This speeds up SAE and EAP-pwd routines by couple of orders of
|
||||
magnitude..
|
||||
|
||||
Signed-off-by: Jouni Malinen <j@w1.fi>
|
||||
---
|
||||
src/crypto/crypto_wolfssl.c | 12 +++++++-----
|
||||
1 file changed, 7 insertions(+), 5 deletions(-)
|
||||
|
||||
--- a/src/crypto/crypto_wolfssl.c
|
||||
+++ b/src/crypto/crypto_wolfssl.c
|
||||
@@ -1084,19 +1084,21 @@ int crypto_bignum_rand(struct crypto_big
|
||||
{
|
||||
int ret = 0;
|
||||
WC_RNG rng;
|
||||
+ size_t len;
|
||||
+ u8 *buf;
|
||||
|
||||
if (TEST_FAIL())
|
||||
return -1;
|
||||
if (wc_InitRng(&rng) != 0)
|
||||
return -1;
|
||||
- if (mp_rand_prime((mp_int *) r,
|
||||
- (mp_count_bits((mp_int *) m) + 7) / 8 * 2,
|
||||
- &rng, NULL) != 0)
|
||||
- ret = -1;
|
||||
- if (ret == 0 &&
|
||||
+ len = (mp_count_bits((mp_int *) m) + 7) / 8;
|
||||
+ buf = os_malloc(len);
|
||||
+ if (!buf || wc_RNG_GenerateBlock(&rng, buf, len) != 0 ||
|
||||
+ mp_read_unsigned_bin((mp_int *) r, buf, len) != MP_OKAY ||
|
||||
mp_mod((mp_int *) r, (mp_int *) m, (mp_int *) r) != 0)
|
||||
ret = -1;
|
||||
wc_FreeRng(&rng);
|
||||
+ bin_clear_free(buf, len);
|
||||
return ret;
|
||||
}
|
||||
|
@ -0,0 +1,26 @@
|
||||
From 79488da576aeeb9400e1742fab7f463eed0fa7a1 Mon Sep 17 00:00:00 2001
|
||||
From: Jouni Malinen <j@w1.fi>
|
||||
Date: Sat, 16 May 2020 21:07:45 +0300
|
||||
Subject: [PATCH 3/3] wolfssl: Do not hardcode include directory in
|
||||
wpa_supplicant build
|
||||
|
||||
This is not really appropriate for any kind of cross compilations and is
|
||||
not really needed in general since system specific values can be set in
|
||||
.config.
|
||||
|
||||
Signed-off-by: Jouni Malinen <j@w1.fi>
|
||||
---
|
||||
wpa_supplicant/Makefile | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
--- a/wpa_supplicant/Makefile
|
||||
+++ b/wpa_supplicant/Makefile
|
||||
@@ -1086,7 +1086,7 @@ endif
|
||||
|
||||
ifeq ($(CONFIG_TLS), wolfssl)
|
||||
ifdef TLS_FUNCS
|
||||
-CFLAGS += -DWOLFSSL_DER_LOAD -I/usr/local/include/wolfssl
|
||||
+CFLAGS += -DWOLFSSL_DER_LOAD
|
||||
OBJS += ../src/crypto/tls_wolfssl.o
|
||||
endif
|
||||
OBJS += ../src/crypto/crypto_wolfssl.o
|
Loading…
x
Reference in New Issue
Block a user