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
23
#include <
zephyr/dt-bindings/ethernet/dsa_tag_proto.h
>
24
25
#ifdef __cplusplus
26
extern
"C"
{
27
#endif
28
32
struct
dsa_tag_register
{
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
*/
60
struct
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
*/
70
struct
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
*/
77
void
dsa_tag_setup(
const
struct
device
*dev_cpu);
78
80
84
85
#endif
/* ZEPHYR_INCLUDE_NET_DSA_TAG_H_ */
dsa_tag_proto.h
device
Runtime device structure (in ROM) per driver instance.
Definition
device.h:513
dsa_tag_register
Registration information for a dsa tag protocol.
Definition
dsa_tag.h:32
dsa_tag_register::proto
int proto
Protocol ID.
Definition
dsa_tag.h:34
net_if
Network Interface structure.
Definition
net_if.h:726
net_pkt
Network packet.
Definition
net_pkt.h:91
net_pkt::iface
struct net_if * iface
Network interface.
Definition
net_pkt.h:114
zephyr
net
dsa_tag.h
Generated on
for Zephyr API Documentation by
1.15.0