From adbc2d86fe08b948f2d58155c493b29cb7af9641 Mon Sep 17 00:00:00 2001 From: Chaitanya Tata Date: Mon, 4 Nov 2024 21:57:56 +0530 Subject: [PATCH 1/6] Revert "[nrf fromlist] manifest: hal_nordic: Pull RX processing fixes" This reverts commit a3a28dbbfc25e86e0b71aa5bc188bc399894f5f9. Signed-off-by: Chaitanya Tata (cherry picked from commit a7efd3449190af6c67eab6321b138383e128268a) --- west.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/west.yml b/west.yml index ccc137c1079..f2a65b025c9 100644 --- a/west.yml +++ b/west.yml @@ -188,7 +188,7 @@ manifest: groups: - hal - name: hal_nordic - revision: 0a753f99ea4899cfbb56e29ae40b4ded95a3ab77 + revision: cb7600a1be4c8b177867e6d463729c07dd3f6d73 path: modules/hal/nordic groups: - hal From 370d4fd51c96d63ce4398f2eac0e55581403a601 Mon Sep 17 00:00:00 2001 From: Chaitanya Tata Date: Mon, 4 Nov 2024 21:47:06 +0530 Subject: [PATCH 2/6] [nrf fromlist] manifest: hal_nordic: Pull logging level fix Fix the noise during boot. Upstream PR #: 80858 Signed-off-by: Chaitanya Tata (cherry picked from commit 0d1bb86bc5943a11c53e3ef842a4f997164cdf6a) --- west.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/west.yml b/west.yml index f2a65b025c9..7aec642cf8a 100644 --- a/west.yml +++ b/west.yml @@ -188,7 +188,7 @@ manifest: groups: - hal - name: hal_nordic - revision: cb7600a1be4c8b177867e6d463729c07dd3f6d73 + revision: 2d78179cc4f0601a891553132b13184fa51b6ef9 path: modules/hal/nordic groups: - hal From 5c760a8d61b7f04c09b54fc83a294143c38937b4 Mon Sep 17 00:00:00 2001 From: Chaitanya Tata Date: Mon, 4 Nov 2024 21:42:53 +0530 Subject: [PATCH 3/6] [nrf fromlist] drivers: nrfwifi: Add a NULL check for FMAC context In case the driver UP fails, the FMAC context will be NULL, so, add a NULL check in the DOWN. Fixes a crash seen when working with unprogrammed OTP (no MAC) that fails the interface UP. Upstream PR #: 80858 Signed-off-by: Chaitanya Tata (cherry picked from commit 0debaa0df79a6528c6b952155eaa6626136d4f8e) --- drivers/wifi/nrfwifi/src/net_if.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/wifi/nrfwifi/src/net_if.c b/drivers/wifi/nrfwifi/src/net_if.c index a4404cfb1a7..1a8b0c7361a 100644 --- a/drivers/wifi/nrfwifi/src/net_if.c +++ b/drivers/wifi/nrfwifi/src/net_if.c @@ -877,7 +877,7 @@ int nrf_wifi_if_stop_zep(const struct device *dev) } rpu_ctx_zep = vif_ctx_zep->rpu_ctx_zep; - if (!rpu_ctx_zep) { + if (!rpu_ctx_zep || !rpu_ctx_zep->rpu_ctx) { LOG_ERR("%s: rpu_ctx_zep is NULL", __func__); goto unlock; From d474935c00e4e59b6cc96c2363420273798bfd2c Mon Sep 17 00:00:00 2001 From: Chaitanya Tata Date: Mon, 4 Nov 2024 15:53:42 +0530 Subject: [PATCH 4/6] [nrf fromlist] drivers: nrfiwif: Enable recovery by default This is needed to ensure Wi-Fi can always be used. Upstream PR #: 80822 Signed-off-by: Chaitanya Tata (cherry picked from commit f2efee5e5f8eafd2438b36485bbab0f30588f1e6) --- drivers/wifi/nrfwifi/Kconfig.nrfwifi | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/wifi/nrfwifi/Kconfig.nrfwifi b/drivers/wifi/nrfwifi/Kconfig.nrfwifi index 36935ed8ba1..7087e20beb6 100644 --- a/drivers/wifi/nrfwifi/Kconfig.nrfwifi +++ b/drivers/wifi/nrfwifi/Kconfig.nrfwifi @@ -661,6 +661,7 @@ config NRF_WIFI_AP_DEAD_DETECT_TIMEOUT config NRF_WIFI_RPU_RECOVERY bool "RPU recovery mechanism" depends on NRF_WIFI_LOW_POWER + default y select EXPERIMENTAL help Enable RPU recovery mechanism to recover from RPU (nRF70) hang. From aab97de5c526f956ac2786a537ecfc1f87c7b86b Mon Sep 17 00:00:00 2001 From: Hongquan Li Date: Sun, 3 Nov 2024 14:23:25 +0800 Subject: [PATCH 5/6] [nrf fromlist] drivers/wifi/nrfwifi: Add buffer for discard bytes Some spi drivers do not allow the send buffer and receive buffer to be empty at the same time, if this happens it will cause the spi to be unable to communicate with the nrf7002, so add the receive buffer for the discard byte in the spim_xfer_rx. Fix #80686 Upstream PR #: 80787 Signed-off-by: Hongquan Li (cherry picked from commit e26e2a2bec50a85a42f81cb2fd23ec65a4f9c438) --- drivers/wifi/nrfwifi/src/qspi/src/spi_if.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/drivers/wifi/nrfwifi/src/qspi/src/spi_if.c b/drivers/wifi/nrfwifi/src/qspi/src/spi_if.c index 2cdf3662fd5..4bf9f464391 100644 --- a/drivers/wifi/nrfwifi/src/qspi/src/spi_if.c +++ b/drivers/wifi/nrfwifi/src/qspi/src/spi_if.c @@ -58,6 +58,7 @@ static int spim_xfer_rx(unsigned int addr, void *data, unsigned int len, unsigne addr & 0xFF, 0 /* dummy byte */ }; + uint8_t discard[sizeof(hdr) + 2 * 4]; const struct spi_buf tx_buf[] = { {.buf = hdr, .len = sizeof(hdr) }, @@ -67,12 +68,17 @@ static int spim_xfer_rx(unsigned int addr, void *data, unsigned int len, unsigne const struct spi_buf_set tx = { .buffers = tx_buf, .count = 2 }; const struct spi_buf rx_buf[] = { - {.buf = NULL, .len = sizeof(hdr) + discard_bytes}, + {.buf = discard, .len = sizeof(hdr) + discard_bytes}, {.buf = data, .len = len }, }; const struct spi_buf_set rx = { .buffers = rx_buf, .count = 2 }; + if (rx_buf[0].len > sizeof(discard)) { + LOG_ERR("Discard bytes too large, please adjust buf size"); + return -EINVAL; + } + return spi_transceive_dt(&spi_spec, &tx, &rx); } From 0ff755c09e0fad26b29ee2722a75f55b02e5c0f2 Mon Sep 17 00:00:00 2001 From: Chaitanya Tata Date: Tue, 5 Nov 2024 02:52:17 +0530 Subject: [PATCH 6/6] [nrf fromlist] drivers: nrfwifi: Fix CSUM support With introduction of Raw modes, nRF70 driver now advertises get_c onfig OP, but doesn't implement all types. This causes problems two-fold with checksum calculations: 1. The "config" isn't uninitialized, so, every call returns differnet values. So, for UDP header checksum would be done and pkt->chksumdone would be set. But for IPv4 header checksum might be skipped. 2. Even if we initialize to zero, then network stack gets all zeros and calculates checksum by itself rendering offload moot. There is another problem in #1, as there is only single flag for pkt for all checksum, nRF70 driver sees this and tells UMAC to skip checksum for the entire packet. The design isn't coherent, and should be converted to communicate per-type checksum status (some are filled by network stack and some HW). But as nRF70 support all checksum offloads, advertise all types for both RX and TX. Upstream PR #: 80882 Signed-off-by: Chaitanya Tata (cherry picked from commit 3017425856235f492647bb088892ee97ad74833c) --- drivers/wifi/nrfwifi/src/net_if.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/drivers/wifi/nrfwifi/src/net_if.c b/drivers/wifi/nrfwifi/src/net_if.c index 1a8b0c7361a..19b232b6fe3 100644 --- a/drivers/wifi/nrfwifi/src/net_if.c +++ b/drivers/wifi/nrfwifi/src/net_if.c @@ -980,10 +980,23 @@ int nrf_wifi_if_get_config_zep(const struct device *dev, goto unlock; } + memset(config, 0, sizeof(struct ethernet_config)); + if (type == ETHERNET_CONFIG_TYPE_TXINJECTION_MODE) { config->txinjection_mode = def_dev_ctx->vif_ctx[vif_ctx_zep->vif_idx]->txinjection_mode; } +#ifdef CONFIG_NRF70_TCP_IP_CHECKSUM_OFFLOAD + if (type == ETHERNET_CONFIG_TYPE_TX_CHECKSUM_SUPPORT || + type == ETHERNET_CONFIG_TYPE_RX_CHECKSUM_SUPPORT) { + config->chksum_support = ETHERNET_CHECKSUM_SUPPORT_IPV4_HEADER | + ETHERNET_CHECKSUM_SUPPORT_IPV4_ICMP | + ETHERNET_CHECKSUM_SUPPORT_IPV6_HEADER | + ETHERNET_CHECKSUM_SUPPORT_IPV6_ICMP | + ETHERNET_CHECKSUM_SUPPORT_TCP | + ETHERNET_CHECKSUM_SUPPORT_UDP; + } +#endif ret = 0; unlock: k_mutex_unlock(&vif_ctx_zep->vif_lock);