Commit graph

31 commits

Author SHA1 Message Date
Maochen Wang 001ac3976a modules: hostap: fix hostap compile error and support enterprise
Fix compile error when enable enterprise security mode.

Signed-off-by: Maochen Wang <maochen.wang@nxp.com>
2024-06-20 12:47:18 +02:00
Eric Ackermann 4f72df466c net: Support partial checksum offloading
The Xilinx AXI Ethernet subsystem is capable of RX/Tx checksum
offloading. While it supports computing IP and UDP/TCP checksums, it
does not support computing ICMP checksums and only computes IP checksums
for ICMP messages. Thus, this patch adds an additional configuration for
ethernet drivers that indicates for which protocols checksum offloading
is (to be) supported. This flag is then considered by the IP subsystem
in determining when flags need to be computed in software.

Signed-off-by: Eric Ackermann <eric.ackermann@cispa.de>
2024-06-14 17:10:43 -04:00
Yong Cong Sin bbe5e1e6eb build: namespace the generated headers with zephyr/
Namespaced the generated headers with `zephyr` to prevent
potential conflict with other headers.

Introduce a temporary Kconfig `LEGACY_GENERATED_INCLUDE_PATH`
that is enabled by default. This allows the developers to
continue the use of the old include paths for the time being
until it is deprecated and eventually removed. The Kconfig will
generate a build-time warning message, similar to the
`CONFIG_TIMER_RANDOM_GENERATOR`.

Updated the includes path of in-tree sources accordingly.

Most of the changes here are scripted, check the PR for more
info.

Signed-off-by: Yong Cong Sin <ycsin@meta.com>
2024-05-28 22:03:55 +02:00
Robert Lubos 87bacf378d net: l2: ethernet: arp: Fix ARP probe target HW address matching
According to RFC3927 and RFC5227, an ARP probe target HW address should
be set to all-zeroes:

"The 'target hardware address' field is ignored and
SHOULD be set to all zeroes."

Hence, we should allow the ARP probes to have all-zeroes target HW
address as well.

Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
2024-05-28 17:49:03 +02:00
Jukka Rissanen f1852b4a1d net: doc: ethernet.h: Document header file properly
Documentation to various public features was missing.
Also some of the public features were marked in hidden section.

Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
2024-05-21 15:41:19 -07:00
Jukka Rissanen 07599e3a53 net: vlan: Add a function to check if interface is VLAN one
We were missing a helper function that can be used to check
whether the given function is the virtual VLAN interface.

Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
2024-04-25 11:06:23 +00:00
Jukka Rissanen e52b708178 net: ethernet: Add more protocol types
Add ETH_P_CAN, ETH_P_CANFD and ETH_P_HDLC protocol types so that they
can be used in following commits.

Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
2024-04-04 17:02:11 +02:00
Jukka Rissanen 2058d8f139 net: ethernet: VLAN overhaul and refactoring
Re-implement the VLAN support inside the network stack.
All the user facing APIs stay as is but internally the VLANs
are implemented using the L2 virtual interfaces.

Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
2024-03-28 09:41:38 +00:00
Angelo Dureghello 9eef10d436 net: ethernet: add definition for mac address length
Add a define for the mac address length, to be used as needed
in place of hardcoded 6.

Signed-off-by: Angelo Dureghello <adureghello@baylibre.com>
2024-03-27 14:31:21 +00:00
Pieter De Gendt e99b5228a1 drivers: ethernet: Introduce ETH_DRIVER_RAW_MODE option
Add a Kconfig symbol to allow building ethernet device driver without
an L2 layer.

Signed-off-by: Pieter De Gendt <pieter.degendt@basalte.be>
2024-03-20 08:05:55 -05:00
Pieter De Gendt 253139455c include: net: ethernet: Add ETH_NET_DEVICE_INIT_INSTANCE
Add a macro variant for ethernet devices with instances.

Signed-off-by: Pieter De Gendt <pieter.degendt@basalte.be>
2024-03-20 08:05:55 -05:00
Pieter De Gendt 64bc618725 net: ethernet: mgmt: Add HW MAC address filtering
Add an ethernet management API to set or unset HW MAC address filtering.

Signed-off-by: Pieter De Gendt <pieter.degendt@basalte.be>
2024-03-18 10:14:34 +01:00
Vivekananda Uppunda db4bf8d409 net: l2: ethernet: bring in TX-Injection mode to l2 ethernet
This set of changes brings in raw packet tx injection mode
feature to ethernet and removes it from being a Wi-Fi only feature.

It was earlier envisaged as Wi-Fi net management feature only.

Signed-off-by: Vivekananda Uppunda <vivekananda.uppunda@nordicsemi.no>
2024-01-24 00:08:38 -05:00
Lukasz Majewski 25addd0984 net: ethernet: Add support for setting T1S PLCA parameters
The Zephyr's core ethernet code had to be adjusted to support setting T1S
PLCA parameters from user Zephyr programs.

Such approach allows more flexibility, as T1S network configuration;
especially PLCA node numbers, can be assigned not only via device tree
at compile time. For example user can read them from EEPROM and then
configure the network accordingly.

For now - the union in struct ethernet_t1s_param only consists of plca
structure. This can change in the future, when other T1S OA parameters -
like Receive/Transmit Cut-Through Enable (bits RXCTE/TXCTE in OA_CONFIG0
register) are made adjustable from user program.

Signed-off-by: Lukasz Majewski <lukma@denx.de>
2023-11-29 10:06:30 +01:00
Weiwei Guo 631dce5866 net: ethernet: add PTP multicast default MAC address
All except peer delay message in PTP protocol use multicast MAC
address is 01:1b:19:00:00:00

Signed-off-by: Weiwei Guo <guoweiwei@syriusrobotics.com>
2023-07-05 12:35:34 +00:00
Chaitanya Tata b9411b75df net: ethernet: Fix build and doc error
The API should be defined independent of L2_PTP define, this fixes build
error and also the doc error, as the next function will have two doxygen
headers.

Signed-off-by: Chaitanya Tata <Chaitanya.Tata@nordicsemi.no>
2023-06-26 16:12:32 +02:00
Chaitanya Tata 2606ba445b net: l2: Add support to identify Wi-Fi interfaces
Wi-Fi is based on L2 Ethernet, so, all drivers are registered as
Ethernet L2, but in order to distinguish true Ethernet and Wi-Fi
devices, add a L2 type within Ethernet.

Also, handle offloaded net devices that also offload Wi-Fi.

This approach is better than adding a new Wi-Fi L2 as that would mean
invasive changes which are unnecessary.

Signed-off-by: Chaitanya Tata <Chaitanya.Tata@nordicsemi.no>
2023-06-26 16:12:32 +02:00
Luca Fancellu b3f5db0c71 net: eth: Fix ethernet max header size on VLAN presence
Currently NET_ETH_MAX_HDR_SIZE is computed as the size of the
structure struct net_eth_hdr, but this does not take into account
the additional 4 bytes on the ethernet frame header in the presence
of VLAN, fix the issue using the size of struct net_eth_vlan_hdr
when CONFIG_NET_VLAN is enabled.

Signed-off-by: Luca Fancellu <luca.fancellu@arm.com>
2023-06-21 09:32:15 +02:00
Krishna T 7952197a89 net: shell: Add MAC address validation
Validate MAC address before setting, add new helper APIs to cover all
cases.

Signed-off-by: Krishna T <krishna.t@nordicsemi.no>
2023-01-12 19:07:44 +01:00
Gerard Marull-Paretas a659548a30 net: fix pm argument documentation
The `pm` field is used to provide a reference to pre-allocated PM
resources. Its usage as a callback was removed a while ago, and these
headers missed the migration.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2022-10-04 10:13:34 +02:00
Gerard Marull-Paretas cfd3560e1b device: s/Z_DEVICE_DT_DEV_NAME/Z_DEVICE_DT_DEV_ID
Rename Z_DEVICE_DT_DEV_NAME to Z_DEVICE_DT_DEV_ID to make it more clear,
as the macro is generating a token that identifies the created struct
device.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2022-10-04 10:13:34 +02:00
Gerard Marull-Paretas 3426050f5f device: Z_DEVICE_STATE_DEFINE doesn't need node_id
The macro is not using node_id, so remove it from the arg list. Do the
same for I2C/CAN "sub-macros".

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2022-10-04 10:13:34 +02:00
Gerard Marull-Paretas 92c9db2e82 device: rename some *DEVICE*DEFINE* arguments
drv_name -> name
pm_device -> pm
data_ptr -> data
cfg_ptr -> config
api_ptr -> api
state_ptr -> state

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2022-10-04 10:13:34 +02:00
Gerard Marull-Paretas 33161222d7 device: s/dev_name/dev_id
The usage of dev_name is misleading, since it does not represent the
device name (struct device name field) but the name given to the defined
struct device. In practice, it is used as a kind of unique device
identtifier, so let's rename it to dev_id.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2022-10-04 10:13:34 +02:00
Gerard Marull-Paretas 4c5e0aaab3 device: remove ; from Z_DEVICE_STATE_DEFINE
This results in more idiomatic usage of the macro.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2022-10-04 10:13:34 +02:00
Florian Grandel dbb6907ac0 net: ethernet: introduce IEEE802154 protocol
This constant is required to prepare for introduction of AF_PACKET
support for IEEE 802.15.4 L2.

Signed-off-by: Florian Grandel <jerico.dev@gmail.com>
2022-08-31 21:52:37 +00:00
Kumar Gala 2779d8964d net: Use DEVICE_DT_NAME
Make networking use DEVICE_DT_NAME so the name is consistent with
how DEVICE_DT_DEFINE works.

Signed-off-by: Kumar Gala <galak@kernel.org>
2022-08-23 16:23:37 +02:00
Gerard Marull-Paretas a7c3e7e84a doxygen: remove redundant usages of def
The def command Indicates that a comment block contains documentation
for a #define macro. This is useful if the comment block documents a
macro not adjacent to it, e.g.

```c
/**
 * @def MAX(x,y)
 * @brief Computes the maximum of @a x and @a y.
 */
 #ifdef XXX
 #define MAX(x,y) ...
 #endif
```

However, it is not necessary if the comment is adjacent to the
definition, e.g.

```c
/**
 * @brief Computes the maximum of @a x and @a y.
 */
 #define MAX(x,y) ...
```

This patch removes all unnecessary def entries in-tree.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2022-08-09 12:29:28 +02:00
Krishna T b754e63d1b net: ethernet: Add EAPoL ether type support
Wi-Fi protocol uses EAPoL ether type frames for authentication, so, add
support for that ether type so that they are not dropped.

Though we have NET_ETHERNET_FORWARD_UNRECOGNISED_ETHERTYPE to allow
unknown frames to be passed up the stack, but this might cause
performance penalty.

Signed-off-by: Krishna T <krishna.t@nordicsemi.no>
2022-08-08 14:03:54 +02:00
Gerard Marull-Paretas fb9b3bcd93 include: migrate includes to <zephyr/...>
In order to bring consistency in-tree, migrate all includes within
include directory to the new prefix <zephyr/...>. Note that the
conversion has been scripted, refer to zephyrproject-rtos#45388 for more
details.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2022-05-06 20:03:00 +02:00
Yuval Peress 53ef68d459 include: Prefix includes to use a scope
Move include paths and add new target_include_directories to support
backwards compatibility:
* /include -> /include/zephyr
  example: <irq.h> -> <zephyr/irq.h>

Issue #41543

Signed-off-by: Yuval Peress <peress@google.com>
2022-04-08 19:03:32 +02:00
Renamed from include/net/ethernet.h (Browse further)