samples: net: dsa: convert to new dsa core driver
Converted to new dsa core driver. And adapted mimxrt1180_evk to it. Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
This commit is contained in:
parent
14e4e12441
commit
4eb1669ac6
4 changed files with 9 additions and 1 deletions
|
@ -5,6 +5,7 @@ CONFIG_SHELL_BACKEND_RTT=y
|
|||
CONFIG_SHELL_BACKEND_SERIAL=n
|
||||
CONFIG_LOG_BACKEND_RTT=n
|
||||
|
||||
CONFIG_NET_DSA_DEPRECATED=y
|
||||
CONFIG_NET_CONFIG_SETTINGS=y
|
||||
CONFIG_NET_CONFIG_NEED_IPV6=y
|
||||
CONFIG_NET_CONFIG_NEED_IPV4=y
|
||||
|
|
|
@ -25,7 +25,6 @@ CONFIG_NET_SHELL=y
|
|||
|
||||
# DSA support
|
||||
CONFIG_NET_DSA=y
|
||||
CONFIG_NET_DSA_DEPRECATED=y
|
||||
|
||||
# Ethernet is needed for LLDP
|
||||
CONFIG_NET_L2_ETHERNET=y
|
||||
|
|
|
@ -8,7 +8,11 @@
|
|||
#ifndef __DSA_SAMPLE__
|
||||
#define __DSA_SAMPLE__
|
||||
|
||||
#if defined(CONFIG_NET_DSA_DEPRECATED)
|
||||
#include <zephyr/net/dsa.h>
|
||||
#else
|
||||
#include <zephyr/net/dsa_core.h>
|
||||
#endif
|
||||
#include <zephyr/net/ethernet.h>
|
||||
|
||||
extern struct ud user_data;
|
||||
|
|
|
@ -30,7 +30,11 @@ static void dsa_iface_find_cb(struct net_if *iface, void *user_data)
|
|||
|
||||
/* Get user interfaces */
|
||||
for (int i = 0; i < ARRAY_SIZE(ifaces->lan); i++) {
|
||||
#if defined(CONFIG_NET_DSA_DEPRECATED)
|
||||
struct net_if *user = dsa_get_slave_port(iface, i);
|
||||
#else
|
||||
struct net_if *user = dsa_user_get_iface(iface, i);
|
||||
#endif
|
||||
|
||||
if (user == NULL) {
|
||||
continue;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue