Skip to content

Commit 9705fc0

Browse files
krish2718dkalowsk
authored andcommitted
[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 <[email protected]>
1 parent ae077b9 commit 9705fc0

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

drivers/wifi/nrfwifi/src/net_if.c

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -980,10 +980,23 @@ int nrf_wifi_if_get_config_zep(const struct device *dev,
980980
goto unlock;
981981
}
982982

983+
memset(config, 0, sizeof(struct ethernet_config));
984+
983985
if (type == ETHERNET_CONFIG_TYPE_TXINJECTION_MODE) {
984986
config->txinjection_mode =
985987
def_dev_ctx->vif_ctx[vif_ctx_zep->vif_idx]->txinjection_mode;
986988
}
989+
#ifdef CONFIG_NRF70_TCP_IP_CHECKSUM_OFFLOAD
990+
if (type == ETHERNET_CONFIG_TYPE_TX_CHECKSUM_SUPPORT ||
991+
type == ETHERNET_CONFIG_TYPE_RX_CHECKSUM_SUPPORT) {
992+
config->chksum_support = ETHERNET_CHECKSUM_SUPPORT_IPV4_HEADER |
993+
ETHERNET_CHECKSUM_SUPPORT_IPV4_ICMP |
994+
ETHERNET_CHECKSUM_SUPPORT_IPV6_HEADER |
995+
ETHERNET_CHECKSUM_SUPPORT_IPV6_ICMP |
996+
ETHERNET_CHECKSUM_SUPPORT_TCP |
997+
ETHERNET_CHECKSUM_SUPPORT_UDP;
998+
}
999+
#endif
9871000
ret = 0;
9881001
unlock:
9891002
k_mutex_unlock(&vif_ctx_zep->vif_lock);

0 commit comments

Comments
 (0)