Skip to content

Commit bc1c11f

Browse files
committed
drivers: eth_nxp_imx_netc: allow to transmit DSA tag frame
Allowed to transmit DSA tag frame. Signed-off-by: Yangbo Lu <[email protected]>
1 parent ab90049 commit bc1c11f

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

drivers/ethernet/nxp_imx_netc/eth_nxp_imx_netc.c

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -294,7 +294,6 @@ int netc_eth_init_common(const struct device *dev)
294294

295295
int netc_eth_tx(const struct device *dev, struct net_pkt *pkt)
296296
{
297-
const struct netc_eth_config *cfg = dev->config;
298297
struct netc_eth_data *data = dev->data;
299298
netc_buffer_struct_t buff = {.buffer = data->tx_buff, .length = sizeof(data->tx_buff)};
300299
netc_frame_struct_t frame = {.buffArray = &buff, .length = 1};
@@ -303,6 +302,7 @@ int netc_eth_tx(const struct device *dev, struct net_pkt *pkt)
303302
size_t pkt_len = net_pkt_get_len(pkt);
304303
#if defined(NETC_HAS_NO_SWITCH_TAG_SUPPORT)
305304
struct ethernet_context *eth_ctx = net_if_l2_data(data->iface);
305+
const struct netc_eth_config *cfg = dev->config;
306306
#endif
307307
status_t result;
308308
int ret;
@@ -314,18 +314,16 @@ int netc_eth_tx(const struct device *dev, struct net_pkt *pkt)
314314

315315
iface_dst = data->iface;
316316

317-
if (cfg->pseudo_mac) {
318317
#if defined(NETC_HAS_NO_SWITCH_TAG_SUPPORT)
318+
if (cfg->pseudo_mac) {
319319
/* DSA conduit port not used */
320320
if (eth_ctx->dsa_port != DSA_CONDUIT_PORT) {
321321
return -ENOSYS;
322322
}
323323
/* DSA driver redirects the iface */
324324
iface_dst = pkt->iface;
325-
#else
326-
return -ENOSYS;
327-
#endif
328325
}
326+
#endif
329327

330328
k_mutex_lock(&data->tx_mutex, K_FOREVER);
331329

0 commit comments

Comments
 (0)