[Midnightbsd-cvs] src [10378] sync with freebsd

laffer1 at midnightbsd.org laffer1 at midnightbsd.org
Sun Jun 3 19:23:55 EDT 2018


Revision: 10378
          http://svnweb.midnightbsd.org/src/?rev=10378
Author:   laffer1
Date:     2018-06-03 19:23:54 -0400 (Sun, 03 Jun 2018)
Log Message:
-----------
sync with freebsd

Modified Paths:
--------------
    trunk/usr.sbin/ndiscvt/Makefile
    trunk/usr.sbin/ndiscvt/inf-parse.y
    trunk/usr.sbin/ndiscvt/inf-token.l
    trunk/usr.sbin/ndiscvt/inf.c
    trunk/usr.sbin/ndiscvt/inf.h
    trunk/usr.sbin/ndiscvt/ndiscvt.8
    trunk/usr.sbin/ndiscvt/ndiscvt.c
    trunk/usr.sbin/ndiscvt/ndisgen.8
    trunk/usr.sbin/ndiscvt/ndisgen.sh
    trunk/usr.sbin/ndiscvt/windrv_stub.c

Property Changed:
----------------
    trunk/usr.sbin/ndiscvt/inf-parse.y
    trunk/usr.sbin/ndiscvt/inf-token.l
    trunk/usr.sbin/ndiscvt/ndiscvt.8
    trunk/usr.sbin/ndiscvt/ndisgen.8
    trunk/usr.sbin/ndiscvt/ndisgen.sh

Modified: trunk/usr.sbin/ndiscvt/Makefile
===================================================================
--- trunk/usr.sbin/ndiscvt/Makefile	2018-06-03 23:21:35 UTC (rev 10377)
+++ trunk/usr.sbin/ndiscvt/Makefile	2018-06-03 23:23:54 UTC (rev 10378)
@@ -1,5 +1,5 @@
 # $MidnightBSD$
-# $FreeBSD: src/usr.sbin/ndiscvt/Makefile,v 1.7 2005/04/24 20:21:22 wpaul Exp $
+# $FreeBSD: stable/10/usr.sbin/ndiscvt/Makefile 291795 2015-12-04 18:22:31Z bdrewery $
 
 .PATH:	${.CURDIR}/../../sys/compat/ndis
 
@@ -11,7 +11,8 @@
 MAN=	ndiscvt.8
 MAN+=	ndisgen.8
 
-WARNS?=	3
+WARNS?=	4
+NO_WCAST_ALIGN=
 
 DPADD=  ${LIBL}
 LDADD=  -ll
@@ -23,8 +24,7 @@
 CLEANFILES= y.output
 
 FILES= windrv_stub.c
-FILESNAME= windrv_stub.c
-FILESDIR= /usr/share/misc
+FILESDIR= ${SHAREDIR}/misc
 
 SCRIPTS= ndisgen.sh
 

Modified: trunk/usr.sbin/ndiscvt/inf-parse.y
===================================================================
--- trunk/usr.sbin/ndiscvt/inf-parse.y	2018-06-03 23:21:35 UTC (rev 10377)
+++ trunk/usr.sbin/ndiscvt/inf-parse.y	2018-06-03 23:23:54 UTC (rev 10378)
@@ -1,3 +1,4 @@
+/* $MidnightBSD$ */
 %{
 /*
  * Copyright (c) 2003
@@ -32,7 +33,7 @@
  */
 
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/usr.sbin/ndiscvt/inf-parse.y,v 1.2 2004/01/02 04:31:06 wpaul Exp $");
+__FBSDID("$FreeBSD: stable/10/usr.sbin/ndiscvt/inf-parse.y 243906 2012-12-05 20:28:44Z bapt $");
 
 #include <stdio.h>
 #include <sys/types.h>
@@ -40,7 +41,6 @@
 
 #include "inf.h"
 
-extern int yyparse (void);
 extern int yylex (void);
 extern void yyerror(const char *);
 %}


Property changes on: trunk/usr.sbin/ndiscvt/inf-parse.y
___________________________________________________________________
Added: svn:keywords
## -0,0 +1 ##
+MidnightBSD=%H
\ No newline at end of property
Modified: trunk/usr.sbin/ndiscvt/inf-token.l
===================================================================
--- trunk/usr.sbin/ndiscvt/inf-token.l	2018-06-03 23:21:35 UTC (rev 10377)
+++ trunk/usr.sbin/ndiscvt/inf-token.l	2018-06-03 23:23:54 UTC (rev 10378)
@@ -1,3 +1,4 @@
+/* $MidnightBSD$ */
 %{
 /*
  * Copyright (c) 2003
@@ -32,7 +33,7 @@
  */
 
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/usr.sbin/ndiscvt/inf-token.l,v 1.3 2004/01/11 21:10:35 mdodd Exp $");
+__FBSDID("$FreeBSD: stable/10/usr.sbin/ndiscvt/inf-token.l 250227 2013-05-03 23:51:32Z jkim $");
 
 #include <regex.h>
 #include <ctype.h>
@@ -43,7 +44,6 @@
 #include "y.tab.h"
 
 int lineno = 1;
-#define YY_NO_UNPUT
 
 int yylex(void);
 void yyerror(const char *);
@@ -58,6 +58,9 @@
 
 %}
 
+%option nounput
+%option noinput
+
 %%
 
 [ \t]+			;


Property changes on: trunk/usr.sbin/ndiscvt/inf-token.l
___________________________________________________________________
Added: svn:keywords
## -0,0 +1 ##
+MidnightBSD=%H
\ No newline at end of property
Modified: trunk/usr.sbin/ndiscvt/inf.c
===================================================================
--- trunk/usr.sbin/ndiscvt/inf.c	2018-06-03 23:21:35 UTC (rev 10377)
+++ trunk/usr.sbin/ndiscvt/inf.c	2018-06-03 23:23:54 UTC (rev 10378)
@@ -1,3 +1,4 @@
+/* $MidnightBSD$ */
 /*
  * Copyright (c) 2003
  *	Bill Paul <wpaul at windriver.com>.  All rights reserved.
@@ -31,7 +32,7 @@
  */
 
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/usr.sbin/ndiscvt/inf.c,v 1.16.10.2 2008/08/22 03:15:50 thompsa Exp $");
+__FBSDID("$FreeBSD: stable/10/usr.sbin/ndiscvt/inf.c 288924 2015-10-06 15:30:41Z amdmi3 $");
 
 #include <stdio.h>
 #include <stdlib.h>
@@ -62,8 +63,10 @@
 		*find_section	(const char *);
 static void	dump_deviceids_pci	(void);
 static void	dump_deviceids_pcmcia	(void);
+static void	dump_deviceids_usb	(void);
 static void	dump_pci_id	(const char *);
 static void	dump_pcmcia_id	(const char *);
+static void	dump_usb_id	(const char *);
 static void	dump_regvals	(void);
 static void	dump_paramreg	(const struct section *,
 				const struct reg *, int);
@@ -83,6 +86,7 @@
 
 	dump_deviceids_pci();
 	dump_deviceids_pcmcia();
+	dump_deviceids_usb();
 	fprintf(outfp, "#ifdef NDIS_REGVALS\n");
 	dump_regvals();
 	fprintf(outfp, "#endif /* NDIS_REGVALS */\n");
@@ -252,6 +256,30 @@
 }
 
 static void
+dump_usb_id(const char *s)
+{
+	char *p;
+	char vidstr[7], pidstr[7];
+
+	p = strcasestr(s, "VID_");
+	if (p == NULL)
+		return;
+	p += 4;
+	strcpy(vidstr, "0x");
+	strncat(vidstr, p, 4);
+	p = strcasestr(s, "PID_");
+	if (p == NULL)
+		return;
+	p += 4;
+	strcpy(pidstr, "0x");
+	strncat(pidstr, p, 4);
+	if (p == NULL)
+		return;
+
+	fprintf(ofp, "\t\\\n\t{ %s, %s, ", vidstr, pidstr);
+}
+
+static void
 dump_deviceids_pci()
 {
 	struct assign *manf, *dev;
@@ -438,6 +466,99 @@
 }
 
 static void
+dump_deviceids_usb()
+{
+	struct assign *manf, *dev;
+	struct section *sec;
+	struct assign *assign;
+	char xpsec[256];
+	int first = 1, found = 0;
+
+	/* Find manufacturer name */
+	manf = find_assign("Manufacturer", NULL);
+
+nextmanf:
+
+	/* Find manufacturer section */
+	if (manf->vals[1] != NULL &&
+	    (strcasecmp(manf->vals[1], "NT.5.1") == 0 ||
+	    strcasecmp(manf->vals[1], "NTx86") == 0 ||
+	    strcasecmp(manf->vals[1], "NTx86.5.1") == 0 ||
+	    strcasecmp(manf->vals[1], "NTamd64") == 0)) {
+		/* Handle Windows XP INF files. */
+		snprintf(xpsec, sizeof(xpsec), "%s.%s",
+		    manf->vals[0], manf->vals[1]);
+		sec = find_section(xpsec);
+	} else
+		sec = find_section(manf->vals[0]);
+
+	/* See if there are any USB device definitions. */
+
+	TAILQ_FOREACH(assign, &ah, link) {
+		if (assign->section == sec) {
+			dev = find_assign("strings", assign->key);
+			if (strcasestr(assign->vals[1], "USB") != NULL) {
+				found++;
+				break;
+			}
+		}
+	}
+
+	if (found == 0)
+		goto done;
+
+	found = 0;
+
+	if (first == 1) {
+		/* Emit start of USB device table */
+		fprintf (ofp, "#define NDIS_USB_DEV_TABLE");
+		first = 0;
+	}
+
+retry:
+
+	/*
+	 * Now run through all the device names listed
+	 * in the manufacturer section and dump out the
+	 * device descriptions and vendor/device IDs.
+	 */
+
+	TAILQ_FOREACH(assign, &ah, link) {
+		if (assign->section == sec) {
+			dev = find_assign("strings", assign->key);
+			/* Emit device IDs. */
+			if (strcasestr(assign->vals[1], "USB") != NULL)
+				dump_usb_id(assign->vals[1]);
+			else
+				continue;
+			/* Emit device description */
+			fprintf (ofp, "\t\\\n\t\"%s\" },", dev->vals[0]);
+			found++;
+		}
+	}
+
+	/* Someone tried to fool us. Shame on them. */
+	if (!found) {
+		found++;
+		sec = find_section(manf->vals[0]);
+		goto retry;
+	}
+
+	/* Handle Manufacturer sections with multiple entries. */
+	manf = find_next_assign(manf);
+
+	if (manf != NULL)
+		goto nextmanf;
+
+done:
+	/* Emit end of table */
+
+	fprintf(ofp, "\n\n");
+
+	return;
+}
+
+static void
 dump_addreg(const char *s, int devidx)
 {
 	struct section *sec;
@@ -767,6 +888,12 @@
 void
 push_word (const char *w)
 {
+
+	if (idx == W_MAX) {
+		fprintf(stderr, "too many words; try bumping W_MAX in inf.h\n");
+		exit(1);
+	}
+
 	if (w && strlen(w))
 		words[idx++] = w;
 	else

Modified: trunk/usr.sbin/ndiscvt/inf.h
===================================================================
--- trunk/usr.sbin/ndiscvt/inf.h	2018-06-03 23:21:35 UTC (rev 10377)
+++ trunk/usr.sbin/ndiscvt/inf.h	2018-06-03 23:23:54 UTC (rev 10378)
@@ -1,10 +1,11 @@
+/* $MidnightBSD$ */
 /*
- * $Id: inf.h,v 1.1.1.2 2006-02-25 02:38:32 laffer1 Exp $
+ * $Id: inf.h,v 1.3 2003/11/30 21:58:16 winter Exp $
  *
- * $FreeBSD: src/usr.sbin/ndiscvt/inf.h,v 1.1 2003/12/11 22:38:14 wpaul Exp $
+ * $FreeBSD: stable/10/usr.sbin/ndiscvt/inf.h 288924 2015-10-06 15:30:41Z amdmi3 $
  */
 
-#define W_MAX	16
+#define W_MAX	32
 
 struct section {
 	const char *	name;

Modified: trunk/usr.sbin/ndiscvt/ndiscvt.8
===================================================================
--- trunk/usr.sbin/ndiscvt/ndiscvt.8	2018-06-03 23:21:35 UTC (rev 10377)
+++ trunk/usr.sbin/ndiscvt/ndiscvt.8	2018-06-03 23:23:54 UTC (rev 10378)
@@ -1,3 +1,4 @@
+.\" $MidnightBSD$
 .\" Copyright (c) 2003
 .\"	Bill Paul <wpaul at windriver.com> All rights reserved.
 .\"
@@ -28,7 +29,7 @@
 .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
 .\" THE POSSIBILITY OF SUCH DAMAGE.
 .\"
-.\" $FreeBSD: src/usr.sbin/ndiscvt/ndiscvt.8,v 1.9 2006/10/10 07:19:30 trhodes Exp $
+.\" $FreeBSD: stable/10/usr.sbin/ndiscvt/ndiscvt.8 236509 2012-06-03 11:29:48Z joel $
 .\"
 .Dd December 10, 2003
 .Dt NDISCVT 8
@@ -187,7 +188,7 @@
 the extra files can simply be copied to the
 .Pa /compat/ndis
 directory, and they will be loaded into the kernel on demand when the
-the driver needs them.
+driver needs them.
 .Pp
 If however the driver is required to bootstrap the system
 (i.e., if


Property changes on: trunk/usr.sbin/ndiscvt/ndiscvt.8
___________________________________________________________________
Added: svn:keywords
## -0,0 +1 ##
+MidnightBSD=%H
\ No newline at end of property
Modified: trunk/usr.sbin/ndiscvt/ndiscvt.c
===================================================================
--- trunk/usr.sbin/ndiscvt/ndiscvt.c	2018-06-03 23:21:35 UTC (rev 10377)
+++ trunk/usr.sbin/ndiscvt/ndiscvt.c	2018-06-03 23:23:54 UTC (rev 10378)
@@ -1,3 +1,4 @@
+/* $MidnightBSD$ */
 /*
  * Copyright (c) 2003
  *	Bill Paul <wpaul at windriver.com>.  All rights reserved.
@@ -31,7 +32,7 @@
  */
 
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/usr.sbin/ndiscvt/ndiscvt.c,v 1.13 2006/09/21 01:47:32 kan Exp $");
+__FBSDID("$FreeBSD: stable/10/usr.sbin/ndiscvt/ndiscvt.c 243074 2012-11-15 15:05:57Z eadler $");
 
 #include <sys/types.h>
 #include <sys/queue.h>
@@ -91,10 +92,8 @@
 	nt_hdr = (image_nt_header *)(x + dos_hdr->idh_lfanew);		\
 	sect_hdr = IMAGE_FIRST_SECTION(nt_hdr);
 
-static
-int insert_padding(imgbase, imglen)
-	void			**imgbase;
-	int			*imglen;
+static int
+insert_padding(void **imgbase, int *imglen)
 {
         image_section_header	*sect_hdr;
         image_dos_header	*dos_hdr;
@@ -192,7 +191,7 @@
 	    "objcopy -I binary -O elf32-i386-freebsd -B i386 %s %s.o\n",
 #endif
 #ifdef __amd64__
-	    "objcopy -I binary -O elf64-x86-64 -B i386 %s %s.o\n",
+	    "objcopy -I binary -O elf64-x86-64-freebsd -B i386 %s %s.o\n",
 #endif
 	    tname, outfile);
 	printf("%s", sysbuf);
@@ -207,9 +206,9 @@
 	}
 
 	snprintf(sysbuf, sizeof(sysbuf),
-	    "objcopy --redefine-sym _binary_%s_start=%s_drv_data_start "
+	    "objcopy --redefine-sym _binary_%s_start=ndis_%s_drv_data_start "
 	    "--strip-symbol _binary_%s_size "
-	    "--redefine-sym _binary_%s_end=%s_drv_data_end %s.o %s.o\n",
+	    "--redefine-sym _binary_%s_end=ndis_%s_drv_data_end %s.o %s.o\n",
 	    tname, sysfile, tname, tname, sysfile, outfile, outfile);
 	printf("%s", sysbuf);
 	system(sysbuf);
@@ -231,7 +230,7 @@
 	    "objcopy -I binary -O elf32-i386-freebsd -B i386 %s %s.o\n",
 #endif
 #ifdef __amd64__
-	    "objcopy -I binary -O elf64-x86-64 -B i386 %s %s.o\n",
+	    "objcopy -I binary -O elf64-x86-64-freebsd -B i386 %s %s.o\n",
 #endif
 	    firmfile, outfile);
 	printf("%s", sysbuf);
@@ -386,10 +385,10 @@
 			ptr++;
 		}
 		fprintf(outfp,
-		    "\nextern unsigned char %s_drv_data_start[];\n",
+		    "\nextern unsigned char ndis_%s_drv_data_start[];\n",
 		    sysfile);
 		fprintf(outfp, "static unsigned char *drv_data = "
-		    "%s_drv_data_start;\n\n", sysfile);
+		    "ndis_%s_drv_data_start;\n\n", sysfile);
 		bincvt(sysfile, outfile, img, fsize);
 		goto done;
 	}

Modified: trunk/usr.sbin/ndiscvt/ndisgen.8
===================================================================
--- trunk/usr.sbin/ndiscvt/ndisgen.8	2018-06-03 23:21:35 UTC (rev 10377)
+++ trunk/usr.sbin/ndiscvt/ndisgen.8	2018-06-03 23:23:54 UTC (rev 10378)
@@ -1,3 +1,4 @@
+.\" $MidnightBSD$
 .\" Copyright (c) 2005
 .\"	Bill Paul <wpaul at windriver.com> All rights reserved.
 .\"
@@ -28,7 +29,7 @@
 .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
 .\" THE POSSIBILITY OF SUCH DAMAGE.
 .\"
-.\" $FreeBSD: src/usr.sbin/ndiscvt/ndisgen.8,v 1.3.2.1 2008/08/21 05:34:37 weongyo Exp $
+.\" $FreeBSD: stable/10/usr.sbin/ndiscvt/ndisgen.8 180730 2008-07-23 05:50:17Z weongyo $
 .\"
 .Dd April 24, 2005
 .Dt NDISGEN 8


Property changes on: trunk/usr.sbin/ndiscvt/ndisgen.8
___________________________________________________________________
Added: svn:keywords
## -0,0 +1 ##
+MidnightBSD=%H
\ No newline at end of property
Modified: trunk/usr.sbin/ndiscvt/ndisgen.sh
===================================================================
--- trunk/usr.sbin/ndiscvt/ndisgen.sh	2018-06-03 23:21:35 UTC (rev 10377)
+++ trunk/usr.sbin/ndiscvt/ndisgen.sh	2018-06-03 23:23:54 UTC (rev 10378)
@@ -30,8 +30,8 @@
 # ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
 # THE POSSIBILITY OF SUCH DAMAGE.
 #
-# $FreeBSD: src/usr.sbin/ndiscvt/ndisgen.sh,v 1.5 2005/07/23 18:47:18 dougb Exp $
-#
+# $FreeBSD: stable/10/usr.sbin/ndiscvt/ndisgen.sh 261021 2014-01-22 10:35:30Z glebius $
+# $MidnightBSD$
 
 header () {
 clear
@@ -45,7 +45,7 @@
 header
 echo "	This script is designed to guide you through the process"
 echo "	of converting a Windows(r) binary driver module and .INF"
-echo "	specification file into a FreeBSD ELF kernel module for use"
+echo "	specification file into a MidnightBSD ELF kernel module for use"
 echo "	with the NDIS compatibility system."
 echo ""
 echo "	The following options are available:"
@@ -66,8 +66,8 @@
 echo "				General information"
 echo ""
 echo "	The NDIS compatibility system is designed to let you use Windows(r)"
-echo "	binary drivers for networking devices with FreeBSD, in cases where"
-echo "	a native FreeBSD driver is not available due to hardware manufacturer"
+echo "	binary drivers for networking devices with MidnightBSD, in cases where"
+echo "	a native BSD driver is not available due to hardware manufacturer"
 echo "	oversight or stupidity. NDIS stands for Network Driver Interface"
 echo "	Standard, and refers to the programming model used to write Windows(r)"
 echo "	network drivers. (These are often called \"NDIS miniport\" drivers.)"
@@ -74,10 +74,10 @@
 echo ""
 echo "	In order to use your network device in NDIS compatibility mode,"
 echo "	you need the Windows(r) driver that goes with it. Also, the driver"
-echo "	must be compiled for the same architecture as the release of FreeBSD"
+echo "	must be compiled for the same architecture as the release of BSD"
 echo "	you have installed. At this time, the i386 and amd64 architectures"
 echo "	are both supported. Note that you cannot use a Windows/i386 driver"
-echo "	with FreeBSD/amd64: you must obtain a Windows/amd64 driver."
+echo "	with BSD/amd64: you must obtain a Windows/amd64 driver."
 echo ""
 echo -n "	Press return to continue... "
 read KEYPRESS
@@ -139,7 +139,7 @@
 echo "				How does it all work?"
 echo ""
 echo "	The installer script uses the ndiscvt(1) utility to convert the .INF,"
-echo "	.SYS and optional firmware files into a FreeBSD kernel loadable module"
+echo "	.SYS and optional firmware files into a BSD kernel loadable module"
 echo "	(.ko) file. This module can be loaded via the kldload(8) utility or"
 echo "	loaded automatically via the /boot/loader.conf file. The ndiscvt(1)"
 echo "	utility extracts the device ID information and registry key data"
@@ -147,8 +147,8 @@
 echo "	the objcopy(1) utility to convert the .SYS file and optional firmware"
 echo "	files into ELF objects. The header file is compiled into a small C"
 echo "	stub file which contains a small amount of code to interface with"
-echo "	the FreeBSD module system. This stub is linked together with the"
-echo "	converted ELF objects to form a FreeBSD kernel module. A static ELF"
+echo "	the BSD module system. This stub is linked together with the"
+echo "	converted ELF objects to form a BSD kernel module. A static ELF"
 echo "	object (.o) file is also created. This file can be linked into a"
 echo "	static kernel image for those who want/need a fully linked kernel"
 echo "	image (possibly for embedded bootstrap purposes, or just plain old"
@@ -165,8 +165,8 @@
 echo ""
 echo "	Converting a driver requires the following utilities:"
 echo ""
-echo "	- The FreeBSD C compiler, cc(1) (part of the base install)."
-echo "	- The FreeBSD linker, ld(1) (part of the base install)."
+echo "	- The BSD C compiler, cc(1) (part of the base install)."
+echo "	- The BSD linker, ld(1) (part of the base install)."
 echo "	- The objcopy(1) utility (part of the base install)."
 echo "	- The ndiscvt(1) utility (part of the base install)."
 echo ""
@@ -268,10 +268,10 @@
 	echo ""
 	echo ""
 	echo "	Now you need to specify the name of the Windows(r) driver .SYS"
-	echo "	file for your device. Note that if you are running FreeBSD/amd64,"
+	echo "	file for your device. Note that if you are running BSD/amd64,"
 	echo "	then you must provide a driver that has been compiled for the"
 	echo "	64-bit Windows(r) platform. If a 64-bit driver is not available"
-	echo "	for your device, you must install FreeBSD/i386 and use the"
+	echo "	for your device, you must install BSD/i386 and use the"
 	echo "	32-bit driver instead."
 	echo ""
 	echo "	Please type in the path to the Windows(r) driver .SYS file now."
@@ -402,7 +402,7 @@
 echo ""
 echo "	The script will now try to generate the kernel driver module."
 echo "	This is the last step. Once this module is generated, you should"
-echo "	be able to load it just like any other FreeBSD driver module."
+echo "	be able to load it just like any other BSD driver module."
 echo ""
 echo "	Press enter to compile the stub module and generate the driver"
 echo -n "	module now: "
@@ -414,9 +414,9 @@
 echo "SRCS+= ${STUBFILE} ${DNAME}.h bus_if.h device_if.h"	>> ${MAKEFILE}
 echo "OBJS+=${FRMLIST} ${DNAME}.o"				>> ${MAKEFILE}
 echo "CFLAGS+=	\\"						>> ${MAKEFILE}
-echo "	-DDRV_DATA_START=${SYSBASE}_drv_data_start \\"		>> ${MAKEFILE}
-echo "	-DDRV_NAME=${SYSBASE} \\"				>> ${MAKEFILE}
-echo "	-DDRV_DATA_END=${SYSBASE}_drv_data_end"			>> ${MAKEFILE}
+echo "	-DDRV_DATA_START=ndis_${SYSBASE}_drv_data_start \\"		>> ${MAKEFILE}
+echo "	-DDRV_NAME=ndis_${SYSBASE} \\"				>> ${MAKEFILE}
+echo "	-DDRV_DATA_END=ndis_${SYSBASE}_drv_data_end"			>> ${MAKEFILE}
 echo "CLEANFILES+=	\\"					>> ${MAKEFILE}
 echo "	${INFFILE} \\"						>> ${MAKEFILE}
 echo "	${DNAME}.h \\"						>> ${MAKEFILE}
@@ -493,7 +493,7 @@
 	return
 }
 
-ICONVPATH=/usr/local/bin/iconv
+ICONVPATH=/usr/bin/iconv
 NDISCVT=/usr/sbin/ndiscvt
 STUBPATH=/usr/share/misc
 STUBFILE=windrv_stub.c


Property changes on: trunk/usr.sbin/ndiscvt/ndisgen.sh
___________________________________________________________________
Added: svn:keywords
## -0,0 +1 ##
+MidnightBSD=%H
\ No newline at end of property
Modified: trunk/usr.sbin/ndiscvt/windrv_stub.c
===================================================================
--- trunk/usr.sbin/ndiscvt/windrv_stub.c	2018-06-03 23:21:35 UTC (rev 10377)
+++ trunk/usr.sbin/ndiscvt/windrv_stub.c	2018-06-03 23:23:54 UTC (rev 10378)
@@ -1,3 +1,4 @@
+/* $MidnightBSD$ */
 /*-
  * Copyright (c) 2005
  *      Bill Paul <wpaul at windriver.com>.  All rights reserved.
@@ -31,7 +32,7 @@
  */
 
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/usr.sbin/ndiscvt/windrv_stub.c,v 1.2 2005/05/08 23:07:51 wpaul Exp $");
+__FBSDID("$FreeBSD: stable/10/usr.sbin/ndiscvt/windrv_stub.c 186507 2008-12-27 08:03:32Z weongyo $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -69,6 +70,11 @@
         char                    *ndis_name;
 };
 
+struct ndis_usb_type {
+	uint16_t		ndis_vid;
+	uint16_t		ndis_did;
+	char			*ndis_name;
+};
 
 #ifdef NDIS_PCI_DEV_TABLE
 static struct ndis_pci_type ndis_devs_pci[] = {
@@ -84,6 +90,13 @@
 };
 #endif
 
+#ifdef NDIS_USB_DEV_TABLE
+static struct ndis_usb_type ndis_devs_usb[] = {
+	NDIS_USB_DEV_TABLE
+	{ 0, 0, NULL }
+};
+#endif
+
 enum interface_type {
 	InterfaceTypeUndefined = -1,
 	Internal,
@@ -224,6 +237,10 @@
 		windrv_load(mod, drv_data_start, drv_data_len, PCMCIABus,
 		    ndis_devs_pccard, &ndis_regvals);
 #endif
+#ifdef NDIS_USB_DEV_TABLE
+		windrv_load(mod, drv_data_start, drv_data_len, PNPBus,
+		   ndis_devs_usb, &ndis_regvals);
+#endif
 		break;
 	case MOD_UNLOAD:
 		windrv_loaded--;
@@ -235,6 +252,9 @@
 #ifdef NDIS_PCMCIA_DEV_TABLE
 		windrv_unload(mod, drv_data_start, drv_data_len);
 #endif
+#ifdef NDIS_USB_DEV_TABLE
+		windrv_unload(mod, drv_data_start, drv_data_len);
+#endif
 		break;
 	case MOD_SHUTDOWN:
 		break;



More information about the Midnightbsd-cvs mailing list