netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] net: usbnet: update addr_assign_type if appropriate
@ 2013-08-22 11:45 Bjørn Mork
       [not found] ` <1377171946-19133-1-git-send-email-bjorn-yOkvZcmFvRU@public.gmane.org>
  2013-08-30 18:18 ` Bjørn Mork
  0 siblings, 2 replies; 7+ messages in thread
From: Bjørn Mork @ 2013-08-22 11:45 UTC (permalink / raw)
  To: netdev-u79uwXL29TY76Z2rM5mHXA
  Cc: linux-usb-u79uwXL29TY76Z2rM5mHXA, Oliver Neukum, Bjørn Mork

This module generates a common default address on init,
using eth_random_addr. Set addr_assign_type to let
userspace know the address is random unless it was
overridden by the minidriver.

Signed-off-by: Bjørn Mork <bjorn-yOkvZcmFvRU@public.gmane.org>
---
 drivers/net/usb/usbnet.c |    4 ++++
 1 file changed, 4 insertions(+)

diff --git a/drivers/net/usb/usbnet.c b/drivers/net/usb/usbnet.c
index e4811d7..74a8e3c 100644
--- a/drivers/net/usb/usbnet.c
+++ b/drivers/net/usb/usbnet.c
@@ -1629,6 +1629,10 @@ usbnet_probe (struct usb_interface *udev, const struct usb_device_id *prod)
 		dev->rx_urb_size = dev->hard_mtu;
 	dev->maxpacket = usb_maxpacket (dev->udev, dev->out, 1);
 
+	/* let userspace know we have a random address */
+	if (ether_addr_equal(net->dev_addr, node_id))
+		net->addr_assign_type = NET_ADDR_RANDOM;
+
 	if ((dev->driver_info->flags & FLAG_WLAN) != 0)
 		SET_NETDEV_DEVTYPE(net, &wlan_type);
 	if ((dev->driver_info->flags & FLAG_WWAN) != 0)
-- 
1.7.10.4

--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply related	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2013-08-30 19:19 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-08-22 11:45 [PATCH] net: usbnet: update addr_assign_type if appropriate Bjørn Mork
     [not found] ` <1377171946-19133-1-git-send-email-bjorn-yOkvZcmFvRU@public.gmane.org>
2013-08-23  7:22   ` Oliver Neukum
2013-08-30 18:18 ` Bjørn Mork
2013-08-30 18:41   ` David Miller
     [not found]     ` <20130830.144118.1671225313340653567.davem-fT/PcQaiUtIeIZ0/mPfg9Q@public.gmane.org>
2013-08-30 18:56       ` Bjørn Mork
     [not found]         ` <8761unxb1s.fsf-lbf33ChDnrE/G1V5fR+Y7Q@public.gmane.org>
2013-08-30 19:14           ` David Miller
2013-08-30 19:19             ` Bjørn Mork

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).