[PATCH v2] cmd: net: add a 'net list' command to list network devs

Tim Harvey tharvey at gateworks.com
Mon Jun 14 17:36:09 CEST 2021

On Sat, Jun 12, 2021 at 12:02 PM Ramon Fried <rfried.dev at gmail.com> wrote:
> Hi Tim.
> The patch fails build in several boards (Malta variants):
> +cmd/net.c: In function 'do_net_list':
> 42+cmd/net.c:487:34: error: initialization of 'const struct udevice *'
> from incompatible pointer type 'struct eth_device *'
> [-Werror=incompatible-pointer-types]
> 43+ 487 | const struct udevice *current = eth_get_dev();
> 44+ | ^~~~~~~~~~~


Looks like my patch only works for DM_ETH. If I were to implement this
for legacy eth it would probably be a mess as the device list is a
static struct in net/eth_legacy.c. I'm not sure how to tell how many
boards are out there that are not yet converted to DM_ETH and am not
sure when legacy eth goes away. How about if I just add #ifdef
CONFIG_DM_ETH around the whole thing and it isn't supported for legacy

Best Regards,


More information about the U-Boot mailing list