Skip to content

Commit 6509141

Browse files
Wei Shuaidavem330
authored andcommitted
usbnet: add new flag FLAG_NOARP for usb net devices
We do have some USB net devices, which cannot do ARP. so we can introduce a new flag FLAG_NOARP, then client drivers can easily handle this kind of devices Signed-off-by: Wei Shuai <cpuwolf@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
1 parent f91f334 commit 6509141

2 files changed

Lines changed: 5 additions & 0 deletions

File tree

‎drivers/net/usb/usbnet.c‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1448,6 +1448,10 @@ usbnet_probe (struct usb_interface *udev, const struct usb_device_id *prod)
14481448
if ((dev->driver_info->flags & FLAG_WWAN) != 0)
14491449
strcpy(net->name, "wwan%d");
14501450

1451+
/* devices that cannot do ARP */
1452+
if ((dev->driver_info->flags & FLAG_NOARP) != 0)
1453+
net->flags |= IFF_NOARP;
1454+
14511455
/* maybe the remote can't receive an Ethernet MTU */
14521456
if (net->mtu > (dev->hard_mtu - net->hard_header_len))
14531457
net->mtu = dev->hard_mtu - net->hard_header_len;

‎include/linux/usb/usbnet.h‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,7 @@ struct driver_info {
100100
#define FLAG_LINK_INTR 0x0800 /* updates link (carrier) status */
101101

102102
#define FLAG_POINTTOPOINT 0x1000 /* possibly use "usb%d" names */
103+
#define FLAG_NOARP 0x2000 /* device can't do ARP */
103104

104105
/*
105106
* Indicates to usbnet, that USB driver accumulates multiple IP packets.

0 commit comments

Comments
 (0)