Up till now the size of net buffer chunk was set to only 64B. This
approach was acceptable for IPv4 support as all headers would fit into
64B of allocated continuous memory.
With enabled support for IPv6 one would observe following errors when
Neighbor Discovery [ND] is performed:
net_pkt: Uncontiguous data cannot be linearized
net_ipv6_nd: DROP: NULL NA header
net_icmpv6: ICMPv6 handling failure (-5)
As some IPv6 headers span on multiple 64B net_pkt buffer instances.
To fix this error - the received chunks are stored to large enough single
net_pkt buffer fragment.
Signed-off-by: Stefan Bigler <linux@bigler.io>
Signed-off-by: Lukasz Majewski <lukma@denx.de>
To change mac or enable/disable promiscous mode transmit/receive does not
need to be disabled.
Disabling and enabling again leads to not transmitting anything afterwards.
Signed-off-by: Stefan Bigler <linux@bigler.io>
Signed-off-by: Lukasz Majewski <lukma@denx.de>
Up till now the configuration of LAN865x was NOT allowing any
multicast frames to be received.
However, those are required for correct handling of IPv6's Neighbor
Discovery [ND] protocol.
This patch - by setting all bits in hash enable register - allows
all muticast MAC addresses to be recived.
Of course - more granular approach to specify set of addresses to
be allowed would be better and will be added in the future.
Signed-off-by: Stefan Bigler <linux@bigler.io>
[Cleanup + modified comment]
Signed-off-by: Lukasz Majewski <lukma@denx.de>
Add extra information regarding the case when ZAREFE (0b01) combination
is set for RFA in OA_CONFIG0 register.
Signed-off-by: Lukasz Majewski <lukma@denx.de>
Add required initialisation of OCOTP. The IMXRT10XX
variants don't support fuseWords to be greater than 1.
MAC0 fuse map address is 0x22 instead of 0x620.
Fill in mac_addr buffer correctly.
Signed-off-by: Matthias Alleman <matthias.alleman@basalte.be>
Switch from `DT_INST_NODE_HAS_PROP(n, zephyr_random_mac_address)`
to `DT_INST_PROP(n, zephyr_random_mac_address)` since the property
is always present and we are interested in its value.
Signed-off-by: Maksim Salau <maksim.salau@gmail.com>
Rename it from litex,eth to litex,liteeth
to reflect the new name of the driver.
Zero got removed from the litex
ethernet compatible, as it now supports
multiple instances.
Signed-off-by: Fin Maaß <f.maass@vogl-electronic.com>
Moved the definition of the phy device from depending on stm32hx
series SOC to its own #if...#else...#endif. This way mdio support
can be enabled on any stm32 soc that supports it by defining the
mdio node in the devicetree.
I have tested this in a custom board.
Signed-off-by: Rahul Arasikere <arasikere.rahul@gmail.com>
Iface name which is used by native posix ethernet driver can only be
specified at compile-time. I wanted to run two instances of the same
program on native posix but did not want to make two separate builds only
to change the iface name. I have implemented getting the iface name from
command line.
Signed-off-by: Kacper Dalach <dalachowsky@gmail.com>
the dts binding of the ethernet-phy has the option
"no-reset" and the according driver already has the
right logic to make use of it, but unfortunately
the connection between them was missing.
Signed-off-by: Fin Maaß <f.maass@vogl-electronic.com>
Fix the busy wait in the MDIO driver that was causing timing
problems in systems with real time requirements performing tasks
more frequently than about a millisecond.
Restructure the code to be less redundant and change the busy wait
kconfig to microseconds instead of millliseconds. Also actually signal
to the mdio driver that it can use the interrupt instead of busy
waiting, this seems to have been forgotten.
Signed-off-by: Declan Snyder <declan.snyder@nxp.com>
When CONFIG_NET_STATISTICS=y is enabled, build fails
due to wrong interface pointer.
Fixes#75515
Signed-off-by: Sylvio Alves <sylvio.alves@espressif.com>
In fixed-link mode, mdio remains unconfigured. This results in a null
pointer dereference, triggering a bus fault
Signed-off-by: Benjamin Bigler <benjamin.bigler@securiton.ch>
As of recent update of stm32f7 HAL to cube version V1.17.2
the workaround for misspelled HAL_ETH_PTP_CONFIGURATED macro
is not needed anymore, and causes PTP support to fail to compile.
Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
Instead of mixing floats and doubles, convert the code to
use double so that we avoid float->double conversion warning
from compiler.
Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
This addresses the coverity issue ID 363724.
This issue seems to have been a false positive, but the root complaint
from coverity was that within the callstack of ENET_Up, some functions
use the buffer config pointer as an array, whereas in the zephyr driver
it is declared as a singleton. Address it by redeclaring this as an
array of size 1 instead of a singleton.
Signed-off-by: Declan Snyder <declan.snyder@nxp.com>
This commit fixes coverity issue 392512.
The issue was that the return value of clock_control_on was not being
checked. Fix by checking the return value.
Signed-off-by: Declan Snyder <declan.snyder@nxp.com>
When external PHY has crystal, ESP32 can be configured
to use custom GPIO as clock source for it. However, due to
latest clock subsystem and hal updates, current driver
fails to build and blocks its usage.
Signed-off-by: Sylvio Alves <sylvio.alves@espressif.com>
Both MDIO and Ethernet drivers share the same clock subsystem.
After clock control update in #73807, clock_control_on()
now returns -EALREADY for already initialized clock subsystem.
As a result, ethernet driver won't initialize as needed.
Fixes#74440
Signed-off-by: Sylvio Alves <sylvio.alves@espressif.com>
Move OA-related TX and RX buffers out from the device data.
Don't define the buffers without the `spi-oa` property. That
saves ~32KB when using generic spi protocol.
Rearrange device data fields to reduce byte holes found with
Pahole.
Signed-off-by: Georgij Cernysiov <geo.cgv@gmail.com>
The following Kconfigs:
- `CONFIG_ETH_STM32_HAL_RANDOM_MAC`
- `CONFIG_ETH_STM32_HAL_USER_STATIC_MAC`
- `CONFIG_ETH_STM32_HAL_MAC3`
- `CONFIG_ETH_STM32_HAL_MAC4`
- `CONFIG_ETH_STM32_HAL_MAC5`
have been deprecated for more than 2 releases, user should
have switched to the devicetree method now, remove them.
Signed-off-by: Yong Cong Sin <ycsin@meta.com>
Fixed#74370, the issue is caused by the update to introduce MMIO
mapping, after MMIO mapping, should use data->base for device
base memory address.
Signed-off-by: Jiafei Pan <Jiafei.Pan@nxp.com>
Replaced the software `reverse` function, used for bit reversal, with
the intrinsic `__RBIT` function.
This utilizes the hardware bit-reversal instruction for improved
efficiency.
Signed-off-by: Pisit Sawangvonganan <pisit@ndrsolution.com>
Adding MMIO mapping support in ENET module driver before MDIO, MAC
and PTP drivers initialization, so that they can reuse this mapping.
Signed-off-by: Jiafei Pan <Jiafei.Pan@nxp.com>
The RGMII specifies output TXC/RXC and TXD/RXD without any clock skew.
Need to add skew on clock line to make sure the other side sample
right data. This can also be done in PCB traces.
This patch is to enable RGMII TX/RX delay to ensure timing.
Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
Add conditions to enable ptp_clock driver implementation
for native_posix when PTP subsystem is enabled.
Signed-off-by: Adam Wojasinski <awojasinski@baylibre.com>
Add handling of net_pkt flags that can be used to indicate that the
network packet should be timestamped.
Signed-off-by: Adam Wojasinski <awojasinski@baylibre.com>
This is part of a series to move memory management functions
away from the z_ namespace and into its own namespace. Also
make documentation available via doxygen.
Signed-off-by: Daniel Leung <daniel.leung@intel.com>
This renames z_phys_map() and z_phys_unmap() to
k_mem_map_phys_bare() and k_mem_unmap_phys_bare()
respectively. This is part of the series to move memory
management functions away from the z_ namespace.
Signed-off-by: Daniel Leung <daniel.leung@intel.com>
nxp,unique-mac actually is not meant to be universally
unique, the LAA bit should therefore be set, and fix the
description of the property in the binding to clarify
the intended usage of this property.
Signed-off-by: Declan Snyder <declan.snyder@nxp.com>
Fix KSZ8081 binding properties:
- reset-gpios and interrupt-gpios are generally standard
properties and therefore should not be using a special name
- mc, is not the correct vendor prefix for microchip
Signed-off-by: Declan Snyder <declan.snyder@nxp.com>
Align the name of the ETH PTP Config Status values
depending on the stm32HAL serie
to be the HAL_ETH_PTP_NOT_CONFIGURATED/HAL_ETH_PTP_CONFIGURATED
or HAL_ETH_PTP_NOT_CONFIGURED/HAL_ETH_PTP_CONFIGURED
Signed-off-by: Francois Ramu <francois.ramu@st.com>
Add driver for Realtek RTL8211F 10/100/1000M ethernet PHY.
This driver implements vendor specific behaviour like
detecting link state change by GPIO interrupt, which is not
present in the generic MII driver.
Fixes: #66348
Signed-off-by: Stanislav Poboril <stanislav.poboril@nxp.com>