trying to use ndis driver on FreeBSD 5.2.1-p6 (long)

Gianmarco gmarco at giovannelli.it
Tue May 11 17:41:20 PDT 2004


I am trying to use the ndis framework on FreeBSD 5.2.1-p6. 
I really don't know if it is possible but I explain what I did:

1) 
I took some files from a 5-CURRENT (of 5 minutes ago) and I copied them on my 
src (5.2.1-p6) tree.

The files are (path relative to /usr/src):

./usr.sbin/ndiscvt/Makefile
./usr.sbin/ndiscvt/inf-parse.y
./usr.sbin/ndiscvt/inf-token.l
./usr.sbin/ndiscvt/inf.c
./usr.sbin/ndiscvt/inf.h
./usr.sbin/ndiscvt/ndiscvt.8
./usr.sbin/ndiscvt/ndiscvt.c

./sys/modules/ndis/Makefile

./sys/modules/if_ndis/Makefile
./sys/modules/if_ndis/bcmwl5.inf
./sys/modules/if_ndis/bcmwl5.sys
# These last two are the dell truemobile 1300 wifi card files

./sys/compat/ndis/cfg_var.h
./sys/compat/ndis/hal_var.h
./sys/compat/ndis/kern_ndis.c
./sys/compat/ndis/ndis_var.h
./sys/compat/ndis/ntoskrnl_var.h
./sys/compat/ndis/pe_var.h
./sys/compat/ndis/resource_var.h
./sys/compat/ndis/subr_hal.c
./sys/compat/ndis/subr_ndis.c
./sys/compat/ndis/subr_ntoskrnl.c
./sys/compat/ndis/subr_pe.c

./sys/dev/if_ndis/if_ndis.c
./sys/dev/if_ndis/if_ndis_pccard.c
./sys/dev/if_ndis/if_ndis_pci.c
./sys/dev/if_ndis/if_ndisvar.h


2) 
# cd usr.sbin/ndiscvt
# make
[...]
cc -O -pipe -mcpu=pentiumpro -I. -I/usr/src/usr.sbin/ndiscvt 
-I/usr/src/usr.sbin/ndiscvt/../../sys -Wsystem-headers -Werror -Wall 
-Wno-format-y2k -W -Wstrict-prototypes -Wmissing-prototypes -Wpointer-arith 
-Wreturn-type -Wcast-qual -Wwrite-strings -Wswitch -Wshadow -Wcast-align 
-Wno-uninitialized   -o ndiscvt ndiscvt.o subr_pe.o inf.o inf-token.o 
inf-parse.o -ll
gzip -cn ndiscvt.8 > ndiscvt.8.gz

# make install
install -s -o root -g wheel -m 555   ndiscvt /usr/sbin
install -o root -g wheel -m 444 ndiscvt.8.gz  /usr/share/man/man8

3) 
# cd /sys/modules/ndis
# make
Warning: Object directory not changed from original /usr/src/sys/modules/ndis
@ -> /usr/src/sys
machine -> /usr/src/sys/i386/include
touch opt_bdg.h
awk -f @/tools/makeobjops.awk @/kern/device_if.m -h
awk -f @/tools/makeobjops.awk @/kern/bus_if.m -h
awk -f @/tools/makeobjops.awk @/dev/pci/pci_if.m -h
awk -f @/tools/vnode_if.awk @/kern/vnode_if.src -h
[...]
cc -O -pipe -mcpu=pentiumpro  -D_KERNEL -Wall -Wredundant-decls 
-Wnested-externs -Wstrict-prototypes  -Wmissing-prototypes -Wpointer-arith 
-Winline -Wcast-qual  -fformat-extensions -std=c99 -DKLD_MODULE -nostdinc -I-   
-I. -I@ -I@/../include -I/usr/include -finline-limit=15000 -fno-common  
-mno-align-long-strings -mpreferred-stack-boundary=2 -ffreestanding -Wall 
-Wredundant-decls -Wnested-externs -Wstrict-prototypes  -Wmissing-prototypes 
-Wpointer-arith -Winline -Wcast-qual  -fformat-extensions -std=c99 
-c /usr/src/sys/modules/ndis/../../compat/ndis/kern_ndis.c
ld  -d -warn-common -r -d -o ndis.kld subr_pe.o subr_ndis.o subr_hal.o 
subr_ntoskrnl.o kern_ndis.o
touch /usr/src/sys/modules/ndis/export_syms
awk -f /usr/src/sys/modules/ndis/../../conf/kmod_syms.awk 
ndis.kld  /usr/src/sys/modules/ndis/export_syms |  xargs -J% objcopy % 
ndis.kld
ld -Bshareable  -d -warn-common -o ndis.ko ndis.kld

# make load
/sbin/kldload -v /usr/src/sys/modules/ndis/ndis.ko
Loaded /usr/src/sys/modules/ndis/ndis.ko, id=5

4) 
# cd /sys/modules/if_ndis
# ndiscvt -i bcmwl5.inf -s bcmwl5.sys -o ndis_driver_data.h
# make
cc -O -pipe -mcpu=pentiumpro  -D_KERNEL -Wall -Wredundant-decls 
-Wnested-externs -Wstrict-prototypes  -Wmissing-prototypes -Wpointer-arith 
-Winline -Wcast-qual  -fformat-extensions -std=c99 -DKLD_MODULE -nostdinc -I-   
-I. -I@ -I@/../include -finline-limit=15000 -fno-common  
-mno-align-long-strings -mpreferred-stack-boundary=2 -ffreestanding -Wall 
-Wredundant-decls -Wnested-externs -Wstrict-prototypes  -Wmissing-prototypes 
-Wpointer-arith -Winline -Wcast-qual  -fformat-extensions -std=c99 
-c /usr/src/sys/modules/if_ndis/../../dev/if_ndis/if_ndis.c

/usr/src/sys/dev/if_ndis/if_ndis.c: In function `ndis_ticktask':
/usr/src/sys/dev/if_ndis/if_ndis.c:1067: error: structure has no member named 
`if_link_state'
/usr/src/sys/dev/if_ndis/if_ndis.c:1067: error: `LINK_STATE_UP' undeclared 
(first use in this function)
/usr/src/sys/dev/if_ndis/if_ndis.c:1067: error: (Each undeclared identifier is 
reported only once
/usr/src/sys/dev/if_ndis/if_ndis.c:1067: error: for each function it appears 
in.)
/usr/src/sys/dev/if_ndis/if_ndis.c:1074: error: structure has no member named 
`if_link_state'
/usr/src/sys/dev/if_ndis/if_ndis.c:1074: error: `LINK_STATE_DOWN' undeclared 
(first use in this function)
*** Error code 1


What's going wrong ? Have I missed some files ?
Any help is really appreciated.

Thanks.
Gianmarco


More information about the freebsd-mobile mailing list