svn commit: r360540 - head/stand/libofw

Warner Losh imp at FreeBSD.org
Fri May 1 17:50:22 UTC 2020


Author: imp
Date: Fri May  1 17:50:21 2020
New Revision: 360540
URL: https://svnweb.freebsd.org/changeset/base/360540

Log:
  Remove more stray sparc64 ifdefs.
  
  Also, dmabuf appears to only be set for sparc64 case, but there was a
  comment at its only use that says it was broken for some apple
  adapters. #ifdef it all of that out now that nothing sets it.

Modified:
  head/stand/libofw/ofw_net.c

Modified: head/stand/libofw/ofw_net.c
==============================================================================
--- head/stand/libofw/ofw_net.c	Fri May  1 17:17:01 2020	(r360539)
+++ head/stand/libofw/ofw_net.c	Fri May  1 17:50:21 2020	(r360540)
@@ -73,7 +73,9 @@ struct netif_driver ofwnet = {
 
 static ihandle_t	netinstance;
 
+#ifdef BROKEN
 static void		*dmabuf;
+#endif
 
 static int
 ofwn_match(struct netif *nif, void *machdep_hint)
@@ -110,10 +112,12 @@ ofwn_put(struct iodesc *desc, void *pkt, size_t len)
 #endif
 	}
 
+#ifdef BROKEN
 	if (dmabuf) {
 		bcopy(pkt, dmabuf, sendlen);
 		pkt = dmabuf;
 	}
+#endif
 
 	rv = OF_write(netinstance, pkt, len);
 
@@ -203,11 +207,7 @@ ofwn_init(struct iodesc *desc, void *machdep_hint)
 	if ((ch = strchr(path, ':')) != NULL)
 		*ch = '\0';
 	netdev = OF_finddevice(path);
-#ifdef __sparc64__
-	if (OF_getprop(netdev, "mac-address", desc->myea, 6) == -1)
-#else
 	if (OF_getprop(netdev, "local-mac-address", desc->myea, 6) == -1)
-#endif
 		goto punt;
 
 	printf("boot: ethernet address: %s\n", ether_sprintf(desc->myea));
@@ -220,20 +220,6 @@ ofwn_init(struct iodesc *desc, void *machdep_hint)
 #if defined(NETIF_DEBUG)
 	printf("ofwn_init: Open Firmware instance handle: %08x\n", netinstance);
 #endif
-
-#ifndef __sparc64__
-	dmabuf = NULL;
-	if (OF_call_method("dma-alloc", netinstance, 1, 1, (64 * 1024), &dmabuf)
-	    < 0) {   
-		printf("Failed to allocate DMA buffer (got %p).\n", dmabuf);
-		goto punt;
-	}
-
-#if defined(NETIF_DEBUG)
-	printf("ofwn_init: allocated DMA buffer: %p\n", dmabuf);
-#endif
-#endif
-
 	return;
 
 punt:


More information about the svn-src-head mailing list