Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions arch/arm/configs/imx6_wirenboard_defconfig
Original file line numberDiff line numberDiff line change
Expand Up@@ -186,6 +186,7 @@ CONFIG_VETH=m
# CONFIG_NET_VENDOR_CIRRUS is not set
# CONFIG_NET_VENDOR_EZCHIP is not set
# CONFIG_NET_VENDOR_FARADAY is not set
CONFIG_FEC_SPECIAL_INTERFACE_NAMES=y
# CONFIG_NET_VENDOR_HISILICON is not set
# CONFIG_NET_VENDOR_INTEL is not set
# CONFIG_NET_VENDOR_MARVELL is not set
Expand Down
6 changes: 6 additions & 0 deletions debian/changelog
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
linux-wb (5.10.35-wb116) stable; urgency=medium

* fec: use ethFECX interface names to reorder them in userspace

-- Nikita Maslov <nikita.maslov@wirenboard.ru> Wed, 06 Jul 2022 17:20:48 +0300

linux-wb (5.10.35-wb115) stable; urgency=medium

* wb7: removed adc (a1-a3, vin) noise (fixups in sun4i-gpadc-iio driver)
Expand Down
8 changes: 8 additions & 0 deletions drivers/net/ethernet/freescale/Kconfig
Original file line numberDiff line numberDiff line change
Expand Up@@ -32,6 +32,14 @@ config FEC
Say Y here if you want to use the built-in 10/100 Fast ethernet
controller on some Motorola ColdFire and Freescale i.MX processors.

config FEC_SPECIAL_INTERFACE_NAMES
bool "Use special interface names for FEC devices (ethFECX)"
depends on FEC
help
This option makes FEC driver use special interface names
(ethFEC0, ethFEC1, ...) instead of eth0, eth1, ... so
they can be renamed/reordered in userspace.

config FEC_MPC52xx
tristate "FEC MPC52xx driver"
depends on PPC_MPC52xx && PPC_BESTCOMM
Expand Down
15 changes: 15 additions & 0 deletions drivers/net/ethernet/freescale/fec_main.c
Original file line numberDiff line numberDiff line change
Expand Up@@ -3530,8 +3530,23 @@ fec_probe(struct platform_device *pdev)
fec_enet_get_queue_num(pdev, &num_tx_qs, &num_rx_qs);

/* Init network device */
#ifdef CONFIG_FEC_SPECIAL_INTERFACE_NAMES
/*
* Since interface name swapping is broken in systemd since Debian stretch,
* we can use special names like ethFECX in order
* to rename them in userspace afterwards.
*
* For that we use alloc_netdev_mqs() which is wrapped
* in alloc_etherdev_mqs() (at least in 5.10.35).
*/
ndev = alloc_netdev_mqs(sizeof(struct fec_enet_private) +
FEC_STATS_SIZE, "ethFEC%d", NET_NAME_UNKNOWN,
ether_setup, num_tx_qs, num_rx_qs);
#else
ndev = alloc_etherdev_mqs(sizeof(struct fec_enet_private) +
FEC_STATS_SIZE, num_tx_qs, num_rx_qs);
#endif

if (!ndev)
return -ENOMEM;

Expand Down