svn commit: r270337 - head/sys/dev/xen/netback

Roger Pau Monné royger at FreeBSD.org
Fri Aug 22 15:34:57 UTC 2014


Author: royger
Date: Fri Aug 22 15:34:56 2014
New Revision: 270337
URL: http://svnweb.freebsd.org/changeset/base/270337

Log:
  netback: remove dead code
  
  Remove the xen_net_read_mac function since it's not used anymore.
  
  Sponsored by: Citrix Systems R&D

Modified:
  head/sys/dev/xen/netback/netback.c

Modified: head/sys/dev/xen/netback/netback.c
==============================================================================
--- head/sys/dev/xen/netback/netback.c	Fri Aug 22 15:16:41 2014	(r270336)
+++ head/sys/dev/xen/netback/netback.c	Fri Aug 22 15:34:56 2014	(r270337)
@@ -152,7 +152,6 @@ static void	xnb_attach_failed(struct xnb
 static int	xnb_shutdown(struct xnb_softc *xnb);
 static int	create_netdev(device_t dev);
 static int	xnb_detach(device_t dev);
-static int	xen_net_read_mac(device_t dev, uint8_t mac[]);
 static int	xnb_ifmedia_upd(struct ifnet *ifp);
 static void	xnb_ifmedia_sts(struct ifnet *ifp, struct ifmediareq *ifmr);
 static void 	xnb_intr(void *arg);
@@ -2467,42 +2466,6 @@ xnb_ifinit(void *xsc)
 	mtx_unlock(&xnb->sc_lock);
 }
 
-
-/**
- * Read the 'mac' node at the given device's node in the store, and parse that
- * as colon-separated octets, placing result the given mac array.  mac must be
- * a preallocated array of length ETHER_ADDR_LEN ETH_ALEN (as declared in
- * net/ethernet.h).
- * Return 0 on success, or errno on error.
- */
-static int
-xen_net_read_mac(device_t dev, uint8_t mac[])
-{
-	char *s, *e, *macstr;
-	const char *path;
-	int error = 0;
-	int i;
-
-	path = xenbus_get_node(dev);
-	error = xs_read(XST_NIL, path, "mac", NULL, (void **) &macstr);
-	if (error != 0) {
-		xenbus_dev_fatal(dev, error, "parsing %s/mac", path);
-	} else {
-	        s = macstr;
-	        for (i = 0; i < ETHER_ADDR_LEN; i++) {
-		        mac[i] = strtoul(s, &e, 16);
-		        if (s == e || (e[0] != ':' && e[0] != 0)) {
-				error = ENOENT;
-				break;
-		        }
-		        s = &e[1];
-	        }
-	        free(macstr, M_XENBUS);
-	}
-	return error;
-}
-
-
 /**
  * Callback used by the generic networking code to tell us when our carrier
  * state has changed.  Since we don't have a physical carrier, we don't care


More information about the svn-src-all mailing list