Skip to content

Commit da6cbe5

Browse files
yangbolu1991mmahadevan108
authored andcommitted
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 6a4959a commit da6cbe5

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
@@ -367,7 +367,6 @@ int netc_eth_init_common(const struct device *dev)
367367

368368
int netc_eth_tx(const struct device *dev, struct net_pkt *pkt)
369369
{
370-
const struct netc_eth_config *cfg = dev->config;
371370
struct netc_eth_data *data = dev->data;
372371
netc_buffer_struct_t buff = {.buffer = data->tx_buff, .length = sizeof(data->tx_buff)};
373372
netc_frame_struct_t frame = {.buffArray = &buff, .length = 1};
@@ -376,6 +375,7 @@ int netc_eth_tx(const struct device *dev, struct net_pkt *pkt)
376375
size_t pkt_len = net_pkt_get_len(pkt);
377376
#if defined(NETC_HAS_NO_SWITCH_TAG_SUPPORT)
378377
struct ethernet_context *eth_ctx = net_if_l2_data(data->iface);
378+
const struct netc_eth_config *cfg = dev->config;
379379
#endif
380380
status_t result;
381381
int ret;
@@ -387,18 +387,16 @@ int netc_eth_tx(const struct device *dev, struct net_pkt *pkt)
387387

388388
iface_dst = data->iface;
389389

390-
if (cfg->pseudo_mac) {
391390
#if defined(NETC_HAS_NO_SWITCH_TAG_SUPPORT)
391+
if (cfg->pseudo_mac) {
392392
/* DSA conduit port not used */
393393
if (eth_ctx->dsa_port != DSA_CONDUIT_PORT) {
394394
return -ENOSYS;
395395
}
396396
/* DSA driver redirects the iface */
397397
iface_dst = pkt->iface;
398-
#else
399-
return -ENOSYS;
400-
#endif
401398
}
399+
#endif
402400

403401
k_mutex_lock(&data->tx_mutex, K_FOREVER);
404402

0 commit comments

Comments
 (0)