Driver for networking device Microchip ENC28J60 is used as SPI slave,
moved to DTS type definition. Samples echo_client and echo_server use
this device on Arduino 101 board.
Signed-off-by: Andrei Gansari <andrei.gansari@nxp.com>
Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
When used suitable config overlay, qemu_cortex_m3 with Ethernet
support can be started with just usual "make run".
An example of such overlay is included with samples/net/echo_server,
can be built and run with:
make BOARD=qemu_cortex_m3 \
CONF_FILE="prj.conf overlay-qemu_cortex_m3_eth.conf" run
Signed-off-by: Paul Sokolovsky <paul.sokolovsky@linaro.org>
The Kconfig option ETH_SAM_GMAC was missing it's dependency on
NET_L2_ETHERNET. Before this patch Kconfig was allowing users to
enable the driver, but the driver was not added because the CMake code
only adds the driver when NET_L2_ETHERNET.
Signed-off-by: Sebastian Bøe <sebastian.boe@nordicsemi.no>
There is no need to reserve any space for each frag, as the l2 will
allocate a frag for the ethernet header, arp will do the same.
This is one step further to removing the concept of ll reserve.
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
We were reading gPTP header from wrong position when parsing
it in RX and TX.
Fixes#11827
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
Check clock_control_on return value now that it is checking appropriate
bus is used in the request.
Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
Update such statistic on all drivers.
Also, remove TX stats in native and stellaris drivers: such update is
done in L2 now.
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
It's now either L2 which unref the pkt on successful tx, or net_if on
error.
Also removing pkt->frags check, net_core.c:net_send_data() does it
already.
And using data_len in logging instead of net_pkt_get_len(), which one is
currently greedy (it goes over all net_bufs).
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
L2 is the one who requests the packet to be sent, and not via net_if API
anymore. Stellaris driver was merged right after this behaviour change
and was thus lacking the proper modification.
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
The driver can be tested using different networking emulation
approaches.
This approach will work across multiple Qemu instances. There can be
more than one Qemu instance, run using the following command. They
would appear to be on the same Ethernet network.
$ qemu-system-arm -M lm3s6965evb \
-serial stdio \
-net nic \
-net socket,mcast=230.0.0.1:1234 \
-kernel zephyr.elf
This approach will work with other virtualization technologies that
support connecting to a VDE switch, like VirtualBox and User Mode
Linux. The switch can be started using the following command.
$ vde_switch --sock /tmp/switch
Qemu can be connected to the switch using the following command.
$ qemu-system-arm -M lm3s6965evb \
-serial stdio \
-net nic \
-net vde,sock=/tmp/switch \
-kernel zephyr.elf
Signed-off-by: Fadhel Habeeb <fadhel@zilogic.com>
Signed-off-by: Nirav Parmar <niravparmar@zilogic.com>
Signed-off-by: Vijay Kumar B <vijaykumar@zilogic.com>
If gPTP is enabled, then enable also PTP clock driver so that
gPTP sync starts to work properly for native_posix board.
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
The PTP driver was init too late which prevented gPTP from
working in native_posix board.
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
If compiling with gPTP support for native_posix board, then avoid
compile error that is seen with gptp sample application.
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
Now instead of such path:
net_if_send_data -> L2's send -> net_if tx_queue -> net_if_tx -> driver
net_if's send
It will be:
net_if_send_data -> net_if tx_queue -> net_if_tx -> L2's send -> driver
net_if's send
Only Ethernet is adapted, but 15.4 and bt will follow up.
All Ethernet drivers are made compatible with that new scheme also.
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
Enables Networking hardware on i.MX-RT type drivers.
Reuses the same eth_mcux driver used by Kinetis family; initialization
sequence refactored to work with this board as well. Unlike Kinetis
family, i.MX has a single ENET interrupt and we need to discriminate
between interrupts using a status register.
Signed-off-by: Andrei Gansari <andrei.gansari@nxp.com>
These changes were obtained by running a script created by
Ulf Magnusson <Ulf.Magnusson@nordicsemi.no> for the following
specification:
1. Read the contents of all dts_fixup.h files in Zephyr
2. Check the left-hand side of the #define macros (i.e. the X in
#define X Y)
3. Check if that name is also the name of a Kconfig option
3.a If it is, then do nothing
3.b If it is not, then replace CONFIG_ with DT_ or add DT_ if it
has neither of these two prefixes
4. Replace the use of the changed #define in the code itself
(.c, .h, .ld)
Additionally, some tweaks had to be added to this script to catch some
of the macros used in the code in a parameterized form, e.g.:
- CONFIG_GPIO_STM32_GPIO##__SUFFIX##_BASE_ADDRESS
- CONFIG_UART_##idx##_TX_PIN
- I2C_SBCON_##_num##_BASE_ADDR
and to prevent adding DT_ prefix to the following symbols:
- FLASH_START
- FLASH_SIZE
- SRAM_START
- SRAM_SIZE
- _ROM_ADDR
- _ROM_SIZE
- _RAM_ADDR
- _RAM_SIZE
which are surprisingly also defined in some dts_fixup.h files.
Finally, some manual corrections had to be done as well:
- name##_IRQ -> DT_##name##_IRQ in uart_stm32.c
Signed-off-by: Andrzej Głąbek <andrzej.glabek@nordicsemi.no>
The error check was wrong, if we could send the packet then
we free it. If sending fails, then let the caller to decide
what to do with the packet.
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
Add "Multicast Promiscuous Enabled" (RCTL_MPE) bit definition and
use it for the receive control register (RCTL) initialization.
Multicast needs to be enabled in order for IPv6 auto-configuration
to succeed.
Signed-off-by: Oleg Zhurakivskyy <oleg.zhurakivskyy@intel.com>
The initial sequence was wrong and led to the missing interrupt
problem with netdev backends where the incoming traffic
appears immediately (tap).
Signed-off-by: Oleg Zhurakivskyy <oleg.zhurakivskyy@intel.com>
Introduce new Kconfig option for selecting either slip or ethernet
connectivity to host.
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
Change the default behaviour of the host network interface
setup. Now user needs to execute net-setup.sh script from
net-tools project to setup host ethernet interface. The script
needs to be run as a root user. Then zephyr.exe can be started
as a normal user.
Example:
cd net-tools
sudo ./net-setup.sh
This will create zeth network interface and set IP address and
routes properly. See other command line options by typing
./net-setup.sh --help
Old behaviour is still there if one enables
CONFIG_ETH_NATIVE_POSIX_STARTUP_AUTOMATIC=y
in which case one needs to use the command
sudo --preserve-env zephyr.exe
to start the Zephyr process.
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
Partially replaces Kinetis MCUX driver configuration from Kconfig to
Device Tree. Interrputs moved from defines configuration to DT.
Signed-off-by: Andrei Gansari <andrei.gansari@nxp.com>
This patch adds a driver for Intel PRO/1000 Gigabit Ethernet controller.
The driver currently supports only a single instance of the NIC.
Signed-off-by: Oleg Zhurakivskyy <oleg.zhurakivskyy@intel.com>
Adding spaces around "=" when definining Kconfig template so
that is more consistent with overall style of these template
variables.
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
Starting with glibc 2.20, there is warning when _BSD_SOURCE is defined
but not _DEFAULT_SOURCE (in /usr/include/features.h around line 184).
Sanitycheck turns this warning into error. So define _DEFAULT_SOURCE
at build time for native.
Signed-off-by: Daniel Leung <daniel.leung@intel.com>
Fix 2 compile issues in RedHat/CentOS 7 for the native
ethernet driver due to a oldish glibc, which does not include
by default the needed structures.
+
Separate the native ethernet driver into its own library,
and set NO_POSIX_CHEATS for it, in case the Zephyr POSIX
library would eventually add support for any of the host functions
used in this driver.
Signed-off-by: Alberto Escolar Piedras <alpi@oticon.com>
Calculate proper initial PTP clock divisors based on the MCK value.
Additionally do not allow adjusting the rate of the clock. This does not
seem to work properly with current gPTP rate adjustment algorithm.
Having proper PTP clock divisors and callbacks that allow getting,
setting and adjusting current time is sufficient for proper gPTP
support.
Signed-off-by: Tomasz Gorochowik <tgorochowik@antmicro.com>
Any word started with underscore followed by and uppercase letter or a
second underscore is a reserved word according with C99.
Signed-off-by: Flavio Ceolin <flavio.ceolin@intel.com>
The return of memset is never checked. This patch explicitly ignore
the return to avoid MISRA-C violations.
The only directory excluded directory was ext/* since it contains
only imported code.
Signed-off-by: Flavio Ceolin <flavio.ceolin@intel.com>
After read first packet and if ERDPT < ERXRDPT,cause read Rx FIFO error.
The fix is to set ERDPT properly before reading next packet.
Fixed#9537
Signed-off-by: Frank Li <lgl88911@163.com>
The eth_stm32_hal has been tested to work correctly on Nucleo-F207ZG,
Nucleo-F429ZI, Nucleo-F746ZG and Nucleo-F767ZI.
Signed-off-by: Daniel Egger <daniel@eggers-club.de>
Consistently use
config FOO
bool/int/hex/string "Prompt text"
instead of
config FOO
bool/int/hex/string
prompt "Prompt text"
(...and a bunch of other variations that e.g. swapped the order of the
type and the 'prompt', or put other properties between them).
The shorthand is fully equivalent to using 'prompt'. It saves lines and
avoids tricking people into thinking there is some semantic difference.
Most of the grunt work was done by a modified version of
https://unix.stackexchange.com/questions/26284/how-can-i-use-sed-to-replace-a-multi-line-string/26290#26290, but some
of the rarer variations had to be converted manually.
Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>