Skip to content

Commit e1ba85e

Browse files
Bas van Loonkartben
authored andcommitted
drivers: ethernet: Fix DSA tag size for KSZ8863.
Allow DSA_TAG_SIZE to be set based on the size determined by Kconfig and the enabled switch hardware. This fixes support for the KSZ8863 which also has a tail tag of one byte. Signed-off-by: Bas van Loon <[email protected]>
1 parent 30aa720 commit e1ba85e

File tree

2 files changed

+10
-6
lines changed

2 files changed

+10
-6
lines changed

drivers/ethernet/Kconfig.dsa

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,14 @@ config DSA_KSZ_TAIL_TAGGING
4545
help
4646
Add support for tail tagging on DSA device.
4747

48+
config DSA_TAG_SIZE
49+
int "DSA tag size in bytes"
50+
default 1 if DSA_KSZ8794 || DSA_KSZ8863
51+
default 0
52+
depends on DSA_KSZ_TAIL_TAGGING
53+
help
54+
Set the DSA tag length in bytes.
55+
4856
config DSA_SPI
4957
bool "Support for PHY SPI interface"
5058
depends on SPI && (DSA_KSZ8794 || DSA_KSZ8863)

include/zephyr/net/dsa.h

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -28,12 +28,8 @@
2828
#define NET_DSA_PORT_MAX_COUNT 8
2929
#define DSA_STATUS_PERIOD_MS K_MSEC(1000)
3030

31-
/*
32-
* Size of the DSA TAG:
33-
* - KSZ8794 - 1 byte
34-
*/
35-
#if defined(CONFIG_DSA_KSZ8794) && defined(CONFIG_DSA_KSZ_TAIL_TAGGING)
36-
#define DSA_TAG_SIZE 1
31+
#ifdef CONFIG_DSA_TAG_SIZE
32+
#define DSA_TAG_SIZE CONFIG_DSA_TAG_SIZE
3733
#else
3834
#define DSA_TAG_SIZE 0
3935
#endif

0 commit comments

Comments
 (0)