Lines Matching full:iface

26 int dsa_register_master_tx(struct net_if *iface, dsa_send_t fn)  in dsa_register_master_tx()  argument
28 struct ethernet_context *ctx = net_if_l2_data(iface); in dsa_register_master_tx()
35 bool dsa_is_port_master(struct net_if *iface) in dsa_is_port_master() argument
37 /* First check if iface points to ETH interface */ in dsa_is_port_master()
38 if (net_if_l2(iface) == &NET_L2_GET_NAME(ETHERNET)) { in dsa_is_port_master()
40 if (net_eth_get_hw_capabilities(iface) & in dsa_is_port_master()
49 bool dsa_is_port_master(struct net_if *iface) in dsa_is_port_master() argument
59 static int dsa_check_iface(struct net_if *iface) in dsa_check_iface() argument
61 if (net_if_l2(iface) != &NET_L2_GET_NAME(ETHERNET)) { in dsa_check_iface()
65 if (!((net_eth_get_hw_capabilities(iface) & ETHERNET_DSA_MASTER_PORT) || in dsa_check_iface()
66 (net_eth_get_hw_capabilities(iface) & ETHERNET_DSA_SLAVE_PORT))) { in dsa_check_iface()
74 int dsa_register_recv_callback(struct net_if *iface, dsa_net_recv_cb_t cb) in dsa_register_recv_callback() argument
79 ret = dsa_check_iface(iface); in dsa_register_recv_callback()
85 ctx = net_if_l2_data(iface); in dsa_register_recv_callback()
92 struct net_if *dsa_net_recv(struct net_if *iface, struct net_pkt **pkt) in dsa_net_recv() argument
99 if (*pkt == NULL || iface == NULL) { in dsa_net_recv()
103 c = net_if_l2_data(iface); in dsa_net_recv()
107 return iface; in dsa_net_recv()
112 return iface; in dsa_net_recv()
115 iface_sw = ctx->dapi->dsa_get_iface(iface, *pkt); in dsa_net_recv()
137 return iface; in dsa_net_recv()
145 struct net_if *iface_master, *iface; in dsa_tx() local
149 iface = net_if_lookup_by_dev(dev); in dsa_tx()
150 if (dsa_is_port_master(iface)) { in dsa_tx()
157 ctx = net_if_l2_data(iface); in dsa_tx()
160 context->dapi->dsa_xmit_pkt(iface, pkt)); in dsa_tx()
183 context->dapi->dsa_xmit_pkt(iface, pkt)); in dsa_tx()
186 struct net_if *dsa_get_slave_port(struct net_if *iface, int slave_num) in dsa_get_slave_port() argument
191 eth_ctx = net_if_l2_data(iface); in dsa_get_slave_port()
193 LOG_ERR("Iface %p context not available!", iface); in dsa_get_slave_port()
206 int dsa_switch_read(struct net_if *iface, uint16_t reg_addr, uint8_t *value) in dsa_switch_read() argument
208 const struct device *dev = net_if_get_device(iface); in dsa_switch_read()
216 int dsa_switch_write(struct net_if *iface, uint16_t reg_addr, uint8_t value) in dsa_switch_write() argument
218 const struct device *dev = net_if_get_device(iface); in dsa_switch_write()
229 * @param iface DSA interface
237 int dsa_switch_set_mac_table_entry(struct net_if *iface, in dsa_switch_set_mac_table_entry() argument
243 const struct device *dev = net_if_get_device(iface); in dsa_switch_set_mac_table_entry()
255 * @param iface DSA interface
261 int dsa_switch_get_mac_table_entry(struct net_if *iface, in dsa_switch_get_mac_table_entry() argument
265 const struct device *dev = net_if_get_device(iface); in dsa_switch_get_mac_table_entry()