/* TRANSMISSION HANDLING CODE egress (DSA slave ports -> ETH)  */
int dsa_tx(const struct device *dev, struct net_pkt *pkt)
/* TRANSMISSION HANDLING CODE egress (DSA slave ports -> ETH)  */
int dsa_tx(const struct device *dev, struct net_pkt *pkt)
{
	struct net_if *iface_master, *iface;
	struct ethernet_context *ctx;
	struct dsa_context *context;
	iface = net_if_lookup_by_dev(dev);
	if (dsa_is_port_master(iface)) {
		ctx = net_if_l2_data(iface);
		context = ctx->dsa_ctx;
		return ctx->dsa_send(dev,
				     context->dapi->dsa_xmit_pkt(iface, pkt));
	}
	context = dev->data;
	iface_master = context->iface_master;
	if (iface_master == NULL) {
		NET_ERR("DSA: No master interface!");
		return -ENODEV;
	}
	ctx = net_if_l2_data(iface_master);
	return ctx->dsa_send(net_if_get_device(iface_master),
			     context->dapi->dsa_xmit_pkt(iface, pkt));
}