ndis/if_ndis kernel configuration patch
Stijn Hoop
stijn at win.tue.nl
Wed Sep 1 00:56:16 PDT 2004
Hi,
after I got frustrated by forgetting to manually make the if_ndis module after
an upgrade to -CURRENT, and subsequently having to fix /boot/loader.conf
again, I was motivated enough to try and think of a way to integrate
ndis/if_ndis into the build system.
Attached is my first try at this. Since most of the stuff has been copy &
pasted there's bound to be something wrong here, but I have verified that
having
NDIS_INF=/path/to/ndis.inf
NDIS_SYS=/path/to/ndis.sys
in /etc/make.conf makes the if_ndis module build, and I also compiled
a static kernel with
device ndisapi
device ndis
options NDIS_INF
makeoptions NDIS_INF=/path/to/ndis.inf
options NDIS_SYS
makeoptions NDIS_SYS=/path/to/ndis.sys
which booted & detected my Dell Truemobile 1300 card fine.
I did ran into 2 build errors when statically compiling ndisapi/ndis -- maybe
the kernel build has stricter CFLAGS? Also attached is a patch to fix those
warnings.
Any comments most welcome.
--Stijn
--
I have great faith in fools -- self confidence my friends call it.
-- Edgar Allan Poe
-------------- next part --------------
Index: conf/files.i386
===================================================================
RCS file: /freebsd/cvsroot/src/sys/conf/files.i386,v
retrieving revision 1.504
diff -u -u -r1.504 files.i386
--- conf/files.i386 16 Aug 2004 12:25:47 -0000 1.504
+++ conf/files.i386 1 Sep 2004 07:42:35 -0000
@@ -56,6 +56,11 @@
compile-with "uudecode < $S/contrib/dev/ath/freebsd/i386-elf.hal.o.uu" \
no-implicit-rule
#
+ndis_driver_data.h optional ndis ndis_inf ndis_sys \
+ compile-with "ndiscvt -i ${NDIS_INF} -s ${NDIS_SYS} > ${.TARGET}" \
+ no-obj no-implicit-rule before-depend \
+ clean "ndis_driver_data.h"
+#
#
compat/linux/linux_file.c optional compat_linux
compat/linux/linux_getcwd.c optional compat_linux
Index: conf/options.i386
===================================================================
RCS file: /freebsd/cvsroot/src/sys/conf/options.i386,v
retrieving revision 1.215
diff -u -u -r1.215 options.i386
--- conf/options.i386 19 Aug 2004 20:58:23 -0000 1.215
+++ conf/options.i386 1 Sep 2004 07:49:30 -0000
@@ -162,3 +162,6 @@
# Device options
DEV_APIC opt_apic.h
DEV_NPX opt_npx.h
+
+NDIS_INF opt_dontuse.h
+NDIS_SYS opt_dontuse.h
Index: i386/conf/NOTES
===================================================================
RCS file: /freebsd/cvsroot/src/sys/i386/conf/NOTES,v
retrieving revision 1.1172
diff -u -u -r1.1172 NOTES
--- i386/conf/NOTES 30 Aug 2004 23:03:57 -0000 1.1172
+++ i386/conf/NOTES 1 Sep 2004 07:47:24 -0000
@@ -511,6 +511,7 @@
# Intel EtherExpress
# lnc: Lance/PCnet cards (Isolan, Novell NE2100, NE32-VL, AMD Am7990 and
# Am79C960)
+# ndis: NDISulator, support for using Windows(R) drivers using a wrapper
# oltr: Olicom ISA token-ring adapters OC-3115, OC-3117, OC-3118 and OC-3133.
# Olicom PCI token-ring adapters OC-3136, OC-3137, OC-3139, OC-3140,
# OC-3141, OC-3540 and OC-3250.
@@ -583,6 +584,13 @@
device ath_hal # Atheros HAL (includes binary component)
#device wlan # 802.11 layer
+device ndisapi # NDISulator API wrapper
+#device ndis # NDIS driver wrapper interface
+#options NDIS_INF
+#makeoptions NDIS_INF=bcmwl5.inf
+#options NDIS_SYS
+#makeoptions NDIS_SYS=bcmwl5.sys
+
#
# ATA raid adapters
#
Index: modules/Makefile
===================================================================
RCS file: /freebsd/cvsroot/src/sys/modules/Makefile,v
retrieving revision 1.397
diff -u -u -r1.397 Makefile
--- modules/Makefile 30 Aug 2004 03:37:36 -0000 1.397
+++ modules/Makefile 1 Sep 2004 06:14:16 -0000
@@ -94,6 +94,7 @@
if_faith \
if_gif \
if_gre \
+ ${_if_ndis} \
if_ppp \
if_sl \
if_stf \
@@ -301,6 +302,9 @@
_i2c= i2c
_ibcs2= ibcs2
_ie= ie
+.if defined(NDIS_INF) && defined(NDIS_SYS)
+_if_ndis= if_ndis
+.endif
_io= io
_linprocfs= linprocfs
_linux= linux
Index: modules/if_ndis/Makefile
===================================================================
RCS file: /freebsd/cvsroot/src/sys/modules/if_ndis/Makefile,v
retrieving revision 1.4
diff -u -u -r1.4 Makefile
--- modules/if_ndis/Makefile 26 May 2004 00:53:04 -0000 1.4
+++ modules/if_ndis/Makefile 1 Sep 2004 06:13:34 -0000
@@ -6,4 +6,11 @@
SRCS= if_ndis.c if_ndis_pci.c if_ndis_pccard.c
SRCS+= opt_bdg.h device_if.h bus_if.h pci_if.h card_if.h pccarddevs.h
+.if defined(NDIS_INF) && defined(NDIS_SYS)
+SRCS+= ndis_driver_data.h
+
+ndis_driver_data.h: ${NDIS_INF} ${NDIS_SYS}
+ ndiscvt -i ${NDIS_INF} -s ${NDIS_SYS} -o ${.OBJDIR}/ndis_driver_data.h
+.endif
+
.include <bsd.kmod.mk>
-------------- next part --------------
Index: compat/ndis/subr_ndis.c
===================================================================
RCS file: /freebsd/cvsroot/src/sys/compat/ndis/subr_ndis.c,v
retrieving revision 1.67
diff -u -u -r1.67 subr_ndis.c
--- compat/ndis/subr_ndis.c 16 Aug 2004 19:25:27 -0000 1.67
+++ compat/ndis/subr_ndis.c 1 Sep 2004 08:18:22 -0000
@@ -2875,7 +2875,7 @@
__stdcall ndis_proc workfunc;
work = ctx;
- workfunc = work->nwi_func;
+ workfunc = (__stdcall ndis_proc)work->nwi_func;
workfunc(work, work->nwi_ctx);
return;
}
Index: compat/ndis/subr_ntoskrnl.c
===================================================================
RCS file: /freebsd/cvsroot/src/sys/compat/ndis/subr_ntoskrnl.c,v
retrieving revision 1.43
diff -u -u -r1.43 subr_ntoskrnl.c
--- compat/ndis/subr_ntoskrnl.c 16 Aug 2004 18:52:37 -0000 1.43
+++ compat/ndis/subr_ntoskrnl.c 1 Sep 2004 08:18:41 -0000
@@ -1694,7 +1694,7 @@
uint8_t irql;
dpc = arg;
- dpcfunc = (kdpc_func)dpc->k_deferedfunc;
+ dpcfunc = (__stdcall kdpc_func)dpc->k_deferedfunc;
irql = ntoskrnl_raise_irql(DISPATCH_LEVEL);
dpcfunc(dpc, dpc->k_deferredctx, dpc->k_sysarg1, dpc->k_sysarg2);
ntoskrnl_lower_irql(irql);
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 187 bytes
Desc: not available
Url : http://lists.freebsd.org/pipermail/freebsd-hackers/attachments/20040901/28499f1f/attachment.bin
More information about the freebsd-hackers
mailing list