Skip to content

Commit 80bfed3

Browse files
icsys-omhcarlescufi
authored andcommitted
drivers: ethernet: stm32: Disable HW checksums by default
Without this change, there's a difference between what the V2 Ethernet HAL claims to be its capabilities in eth_stm32_hal_get_capabilities() and what is actually enabled when CONFIG_ETH_STM32_HW_CHECKSUM is disabled. This difference somehow causes the checksum in outgoing packets to become 0, and hence seems to break networking at least on some PHYs. This commit disables HW checksums by default even when V2 driver is in use, and this hence fixes networking when CONFIG_ETH_STM32_HW_CHECKSUM is disabled. This fixes #57629. Signed-off-by: Ole Morten Haaland <[email protected]>
1 parent cbdd2f3 commit 80bfed3

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

drivers/ethernet/eth_stm32_hal.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1203,7 +1203,8 @@ static int eth_initialize(const struct device *dev)
12031203
memset(&tx_config, 0, sizeof(ETH_TxPacketConfig));
12041204
tx_config.Attributes = ETH_TX_PACKETS_FEATURES_CSUM |
12051205
ETH_TX_PACKETS_FEATURES_CRCPAD;
1206-
tx_config.ChecksumCtrl = ETH_CHECKSUM_IPHDR_PAYLOAD_INSERT_PHDR_CALC;
1206+
tx_config.ChecksumCtrl = IS_ENABLED(CONFIG_ETH_STM32_HW_CHECKSUM) ?
1207+
ETH_CHECKSUM_IPHDR_PAYLOAD_INSERT_PHDR_CALC : ETH_CHECKSUM_DISABLE;
12071208
tx_config.CRCPadCtrl = ETH_CRC_PAD_INSERT;
12081209
#endif /* CONFIG_SOC_SERIES_STM32H7X || CONFIG_ETH_STM32_HAL_API_V2 */
12091210

0 commit comments

Comments
 (0)