Zephyr API Documentation 4.1.99
A Scalable Open Source RTOS
 4.1.99
All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
Distributed Switch Architecture (DSA)

Distributed Switch Architecture (DSA) . More...

Data Structures

struct  dsa_switch_context
 DSA switch context data. More...
 
struct  dsa_api
 Structure to provide DSA switch api callbacks - it is an augmented struct ethernet_api. More...
 
struct  dsa_port_config
 Structure of DSA port configuration. More...
 

Macros

#define DSA_PORT_INST_INIT(port, n, cfg)
 Macro for DSA port instance initialization.
 
#define DSA_SWITCH_INST_INIT(n, _dapi, data, fn)
 Macro for DSA switch instance initialization.
 

Functions

struct net_ifdsa_user_get_iface (struct net_if *iface, int port_idx)
 Get network interface of a user port.
 

Detailed Description

Distributed Switch Architecture (DSA) .

Since
4.2
Version
0.8.0

Macro Definition Documentation

◆ DSA_PORT_INST_INIT

#define DSA_PORT_INST_INIT ( port,
n,
cfg )

#include <zephyr/net/dsa_core.h>

Value:
dsa_port_initialize, NULL, &dsa_switch_context_##n, cfg, \
CONFIG_ETH_INIT_PRIORITY, &dsa_eth_api, ETHERNET_L2, \
NET_L2_GET_CTX_TYPE(ETHERNET_L2), NET_ETH_MTU);
#define DEVICE_DT_NAME(node_id)
Return a string name for a devicetree node.
Definition device.h:199
#define DT_REG_ADDR(node_id)
Get a node's (only) register block address.
Definition devicetree.h:2461
#define NET_ETH_MTU
Ethernet MTU size.
Definition ethernet.h:122
#define NET_DEVICE_INIT_INSTANCE(dev_id, name, instance, init_fn, pm, data, config, prio, api, l2, l2_ctx_type, mtu)
Create multiple network interfaces and bind them to network device.
Definition net_if.h:3535
#define CONCAT(...)
Concatenate input arguments.
Definition util.h:312
#define NULL
Definition iar_missing_defs.h:20

Macro for DSA port instance initialization.

Parameters
portDSA port node identifier.
nDSA instance number.
cfgPointer to dsa_port_config.

◆ DSA_SWITCH_INST_INIT

#define DSA_SWITCH_INST_INIT ( n,
_dapi,
data,
fn )

#include <zephyr/net/dsa_core.h>

Value:
struct dsa_switch_context dsa_switch_context_##n = { \
.dapi = _dapi, \
.prv_data = data, \
.init_ports = 0, \
.num_ports = DT_INST_CHILD_NUM_STATUS_OKAY(n), \
}; \
DT_INST_FOREACH_CHILD_STATUS_OKAY_VARGS(n, fn, n);
#define DT_INST_CHILD_NUM_STATUS_OKAY(inst)
Get the number of child nodes of a given node.
Definition devicetree.h:3961
DSA switch context data.
Definition dsa_core.h:79

Macro for DSA switch instance initialization.

Parameters
nDSA instance number.
_dapiPointer to dsa_api.
dataPointer to private data.
fnDSA port instance init function.

Function Documentation

◆ dsa_user_get_iface()

struct net_if * dsa_user_get_iface ( struct net_if * iface,
int port_idx )

#include <zephyr/net/dsa_core.h>

Get network interface of a user port.

Parameters
ifaceConduit port
[in]port_idxPort index
Returns
network interface of the user if successful
NULL if user port does not exist