linux-uconsole/drivers/net
Maciej Żenczykowski 1702d2c8b7 FROMGIT: net: cdc_ncm: switch to eth%d interface naming
[ Upstream commit c1a3d40673 ]

This is meant to make the host side cdc_ncm interface consistently
named just like the older CDC protocols: cdc_ether & cdc_ecm
(and even rndis_host), which all use 'FLAG_ETHER | FLAG_POINTTOPOINT'.

include/linux/usb/usbnet.h:
  #define FLAG_ETHER	0x0020		/* maybe use "eth%d" names */
  #define FLAG_WLAN	0x0080		/* use "wlan%d" names */
  #define FLAG_WWAN	0x0400		/* use "wwan%d" names */
  #define FLAG_POINTTOPOINT 0x1000	/* possibly use "usb%d" names */

drivers/net/usb/usbnet.c @ line 1711:
  strcpy (net->name, "usb%d");
  ...
  // heuristic:  "usb%d" for links we know are two-host,
  // else "eth%d" when there's reasonable doubt.  userspace
  // can rename the link if it knows better.
  if ((dev->driver_info->flags & FLAG_ETHER) != 0 &&
      ((dev->driver_info->flags & FLAG_POINTTOPOINT) == 0 ||
       (net->dev_addr [0] & 0x02) == 0))
          strcpy (net->name, "eth%d");
  /* WLAN devices should always be named "wlan%d" */
  if ((dev->driver_info->flags & FLAG_WLAN) != 0)
          strcpy(net->name, "wlan%d");
  /* WWAN devices should always be named "wwan%d" */
  if ((dev->driver_info->flags & FLAG_WWAN) != 0)
          strcpy(net->name, "wwan%d");

So by using ETHER | POINTTOPOINT the interface naming is
either usb%d or eth%d based on the global uniqueness of the
mac address of the device.

Without this 2.5gbps ethernet dongles which all seem to use the cdc_ncm
driver end up being called usb%d instead of eth%d even though they're
definitely not two-host.  (All 1gbps & 5gbps ethernet usb dongles I've
tested don't hit this problem due to use of different drivers, primarily
r8152 and aqc111)

Fixes tag is based purely on git blame, and is really just here to make
sure this hits LTS branches newer than v4.5.

Cc: Lorenzo Colitti <lorenzo@google.com>
Fixes: 4d06dd537f ("cdc_ncm: do not call usbnet_link_change from cdc_ncm_bind")
Signed-off-by: Maciej Żenczykowski <maze@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Sasha Levin <sashal@kernel.org>
(cherry picked from commit 11fac7e912 https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?h=linux-5.10.y&id=11fac7e9127078fe3275642742cf5e2336fa934a)
Bug: 181923048
Change-Id: If746c35d6a91c3071afbbca68466438fcd7d8f55
2021-07-08 04:01:26 +00:00
..
appletalk
arcnet
bonding Revert "net: bonding: fix error return code of bond_neigh_init()" 2021-03-30 14:32:08 +02:00
caif net: caif: remove BUG_ON(dev == NULL) in caif_xmit 2021-06-03 09:00:41 +02:00
can can: m_can: m_can_tx_work_queue(): fix tx_skb race condition 2021-05-19 10:13:08 +02:00
dsa net: dsa: sja1105: fix VL lookup command packing for P/Q/R/S 2021-06-03 09:00:38 +02:00
ethernet Merge 5.10.43 into android12-5.10 2021-06-12 14:48:14 +02:00
fddi FDDI: defxx: Make MMIO the configuration default except for EISA 2021-05-14 09:50:00 +02:00
fjes
hamradio
hippi
hyperv
ieee802154 drivers: net: fix memory leak in atusb_probe 2021-04-14 08:42:13 +02:00
ipa net: ipa: memory region array is variable size 2021-06-03 09:00:46 +02:00
ipvlan
mdio net: mdio: octeon: Fix some double free issues 2021-06-03 09:00:47 +02:00
netdevsim netdevsim: dev: Initialize FIB module after debugfs 2021-04-07 15:00:07 +02:00
pcs
phy net: phy: marvell: fix m88e1111_set_downshift 2021-05-14 09:50:42 +02:00
plip
ppp
slip
team
usb FROMGIT: net: cdc_ncm: switch to eth%d interface naming 2021-07-08 04:01:26 +00:00
vmxnet3
wan net: lapbether: Prevent racing when checking whether the netif is running 2021-05-14 09:50:29 +02:00
wimax staging: wimax/i2400m: fix byte-order issue 2021-05-11 14:47:16 +02:00
wireguard wireguard: allowedips: free empty intermediate nodes when removing single node 2021-06-10 13:39:24 +02:00
wireless FROMGIT: mac80211_hwsim: add concurrent channels scanning support over virtio 2021-06-29 14:17:14 -07:00
xen-netback xen-netback: take a reference to the RX task thread 2021-06-10 13:39:29 +02:00
bareudp.c
dummy.c
eql.c
geneve.c net: geneve: modify IP header check in geneve6_xmit_skb and geneve_xmit_skb 2021-05-14 09:50:43 +02:00
gtp.c net: icmp: pass zeroed opts from icmp{,v6}_ndo_send before sending 2021-03-04 11:38:46 +01:00
ifb.c
Kconfig This is the 5.10.24 stable release 2021-03-19 09:42:56 +01:00
LICENSE.SRC
loopback.c
macsec.c
macvlan.c
macvtap.c
Makefile
mdio.c
mii.c
net_failover.c
netconsole.c
nlmon.c
ntb_netdev.c
rionet.c
sb1000.c
Space.c
sungem_phy.c
tap.c net: fix dev_ifsioc_locked() race condition 2021-03-07 12:34:07 +01:00
thunderbolt.c
tun.c net: tun: set tun->dev->addr_len during TUNSETLINK processing 2021-04-14 08:42:13 +02:00
veth.c veth: Store queue_mapping independently of XDP prog presence 2021-03-30 14:31:56 +02:00
virtio_net.c This is the 5.10.39 stable release 2021-05-22 15:34:48 +02:00
vrf.c
vsockmon.c
vxlan.c vxlan: do not modify the shared tunnel info when PMTU triggers an ICMP reply 2021-04-14 08:42:06 +02:00
xen-netfront.c