Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 14 Sep 2016 08:24:01 +0000 (UTC)
From:      Sepherosa Ziehau <sephe@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r305793 - head/sys/dev/hyperv/netvsc
Message-ID:  <201609140824.u8E8O1L4018702@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: sephe
Date: Wed Sep 14 08:24:01 2016
New Revision: 305793
URL: https://svnweb.freebsd.org/changeset/base/305793

Log:
  hyperv/hn: Cleanup hn_ioctl.
  
  MFC after:	1 week
  Sponsored by:	Microsoft
  Differential Revision:	https://reviews.freebsd.org/D7869

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	Wed Sep 14 08:08:45 2016	(r305792)
+++ head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c	Wed Sep 14 08:24:01 2016	(r305793)
@@ -1495,27 +1495,11 @@ hn_ioctl(struct ifnet *ifp, u_long cmd, 
 {
 	struct hn_softc *sc = ifp->if_softc;
 	struct ifreq *ifr = (struct ifreq *)data;
-#ifdef INET
-	struct ifaddr *ifa = (struct ifaddr *)data;
-#endif
 	int mask, error = 0;
 	int retry_cnt = 500;
 	
-	switch(cmd) {
-
-	case SIOCSIFADDR:
-#ifdef INET
-		if (ifa->ifa_addr->sa_family == AF_INET) {
-			ifp->if_flags |= IFF_UP;
-			if (!(ifp->if_drv_flags & IFF_DRV_RUNNING))
-				hn_init(sc);
-			arp_ifinit(ifp, ifa);
-		} else
-#endif
-		error = ether_ioctl(ifp, cmd, data);
-		break;
+	switch (cmd) {
 	case SIOCSIFMTU:
-		/* Check MTU value change */
 		if (ifp->if_mtu == ifr->ifr_mtu)
 			break;
 
@@ -1589,6 +1573,7 @@ hn_ioctl(struct ifnet *ifp, u_long cmd, 
 		sc->temp_unusable = FALSE;
 		NV_UNLOCK(sc);
 		break;
+
 	case SIOCSIFFLAGS:
 		do {
                        NV_LOCK(sc);
@@ -1639,8 +1624,8 @@ hn_ioctl(struct ifnet *ifp, u_long cmd, 
 		sc->temp_unusable = FALSE;
 		NV_UNLOCK(sc);
 		sc->hn_if_flags = ifp->if_flags;
-		error = 0;
 		break;
+
 	case SIOCSIFCAP:
 		NV_LOCK(sc);
 
@@ -1679,30 +1664,27 @@ hn_ioctl(struct ifnet *ifp, u_long cmd, 
 		}
 
 		NV_UNLOCK(sc);
-		error = 0;
 		break;
+
 	case SIOCADDMULTI:
 	case SIOCDELMULTI:
-#ifdef notyet
-		/* Fixme:  Multicast mode? */
-		if (ifp->if_drv_flags & IFF_DRV_RUNNING) {
-			NV_LOCK(sc);
-			netvsc_setmulti(sc);
-			NV_UNLOCK(sc);
-			error = 0;
-		}
-#endif
-		error = EINVAL;
+		/* Always all-multi */
+		/*
+		 * TODO:
+		 * Enable/disable all-multi according to the emptiness of
+		 * the mcast address list.
+		 */
 		break;
+
 	case SIOCSIFMEDIA:
 	case SIOCGIFMEDIA:
 		error = ifmedia_ioctl(ifp, ifr, &sc->hn_media, cmd);
 		break;
+
 	default:
 		error = ether_ioctl(ifp, cmd, data);
 		break;
 	}
-
 	return (error);
 }
 



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201609140824.u8E8O1L4018702>