svn commit: r296593 - head/sys/dev/hyperv/netvsc

Sepherosa Ziehau sephe at FreeBSD.org
Thu Mar 10 02:13:44 UTC 2016


Author: sephe
Date: Thu Mar 10 02:13:42 2016
New Revision: 296593
URL: https://svnweb.freebsd.org/changeset/base/296593

Log:
  hyperv/hn: Move if_initname to an earlier place
  
  So that functions shared w/ attach path could use if_printf().
  
  While I'm here, remove unnecessary if_dunit and if_dname assignment.
  
  MFC after:	1 week
  Sponsored by:	Microsoft OSTC
  Differential Revision:	https://reviews.freebsd.org/D5576

Modified:
  head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c

Modified: head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c
==============================================================================
--- head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c	Thu Mar 10 00:36:52 2016	(r296592)
+++ head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c	Thu Mar 10 02:13:42 2016	(r296593)
@@ -436,6 +436,7 @@ netvsc_attach(device_t dev)
 
 	ifp = sc->hn_ifp = if_alloc(IFT_ETHER);
 	ifp->if_softc = sc;
+	if_initname(ifp, device_get_name(dev), device_get_unit(dev));
 
 	ring_cnt = hn_ring_cnt;
 	if (ring_cnt <= 0 || ring_cnt >= mp_ncpus)
@@ -466,10 +467,6 @@ netvsc_attach(device_t dev)
 	sc->hn_tx_ring[0].hn_chan = chan;
 	vmbus_channel_cpu_set(chan, sc->hn_cpu);
 
-	if_initname(ifp, device_get_name(dev), device_get_unit(dev));
-	ifp->if_dunit = unit;
-	ifp->if_dname = NETVSC_DEVNAME;
-
 	ifp->if_flags = IFF_BROADCAST | IFF_SIMPLEX | IFF_MULTICAST;
 	ifp->if_ioctl = hn_ioctl;
 	ifp->if_init = hn_ifinit;


More information about the svn-src-all mailing list