Zephyr API Documentation 4.3.99
A Scalable Open Source RTOS
Loading...
Searching...
No Matches
dsa_tag.h
Go to the documentation of this file.
1/*
2 * SPDX-FileCopyrightText: Copyright 2025-2026 NXP
3 * SPDX-License-Identifier: Apache-2.0
4 */
5
10
11#ifndef ZEPHYR_INCLUDE_NET_DSA_TAG_H_
12#define ZEPHYR_INCLUDE_NET_DSA_TAG_H_
13
22
24
25#ifdef __cplusplus
26extern "C" {
27#endif
28
34 int proto;
35
37 struct net_if *(*recv)(struct net_if *iface, struct net_pkt *pkt);
38
40 struct net_pkt *(*xmit)(struct net_if *iface, struct net_pkt *pkt);
41};
42
43#define DSA_TAG_REGISTER(_proto, _recv, _xmit) \
44 static const STRUCT_SECTION_ITERABLE(dsa_tag_register, __dsa_tag_register_##_proto) = { \
45 .proto = _proto, \
46 .recv = _recv, \
47 .xmit = _xmit, \
48 }
49
51
52/*
53 * DSA tag protocol handles packet received by untagging
54 *
55 * param iface: Interface of DSA conduit port on which receives the packet
56 * param pkt: Network packet
57 *
58 * Returns: Interface of DSA user port to redirect
59 */
60struct net_if *dsa_tag_recv(struct net_if *iface, struct net_pkt *pkt);
61
62/*
63 * DSA tag protocol handles packet transmitted by tagging
64 *
65 * param iface: Interface of DSA user port to transmit
66 * param pkt: Network packet
67 *
68 * Returns: Network packet tagged
69 */
70struct net_pkt *dsa_tag_xmit(struct net_if *iface, struct net_pkt *pkt);
71
72/*
73 * Set up DSA tag protocol
74 *
75 * param dev_cpu: Device of DSA CPU port
76 */
77void dsa_tag_setup(const struct device *dev_cpu);
78
80
84
85#endif /* ZEPHYR_INCLUDE_NET_DSA_TAG_H_ */
Runtime device structure (in ROM) per driver instance.
Definition device.h:513
Registration information for a dsa tag protocol.
Definition dsa_tag.h:32
int proto
Protocol ID.
Definition dsa_tag.h:34
Network Interface structure.
Definition net_if.h:726
Network packet.
Definition net_pkt.h:91
struct net_if * iface
Network interface.
Definition net_pkt.h:114