Subject: Re: Kernel fails to build with NDIS support
To: None <current-users@NetBSD.org>
From: Chris Tribo <ctribo@dtcc.edu>
List: current-users
Date: 10/09/2006 13:02:30
Here's the full boot log with back trace over serial connection:

 > boot -v
booting fd0a:netbsd (howto 0x20000)
2080528+6331332+138516 [173040+169674]=0x87c630
kenter: 0x00001000
acpi: wakecode is installed at 0x1000, size=376
Loaded initial symtab at 0xc09287f8, strtab at 0xc0952f64, # entries  
10132
Copyright (c) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,  
2005, 2006
     The NetBSD Foundation, Inc.  All rights reserved.
Copyright (c) 1982, 1986, 1989, 1991, 1993
     The Regents of the University of California.  All rights reserved.

NetBSD 4.99.3 (SoulCollector) #19: Mon Oct  9 10:28:23 EDT 2006
         root@atlantis.dtcc.edu:/usr/obj/sys/arch/i386/compile/ 
SoulCollector
total memory = 2034 MB
avail memory = 1990 MB
timecounter: Timecounters tick every 10.000 msec
timecounter: Timecounter "i8254" frequency 1193182 Hz quality 100
timecounter: selected timecounter "i8254" frequency 1193182 Hz  
quality 100
Calibrating TSC clock ... TSC clock: 2392403220 Hz
BIOS32 rev. 0 found at 0xffe90
mainbus0 (root)
cpu0 at mainbus0: apid 0 (boot processor)
cpu0: Intel Pentium Pro, II or III (686-class), 2392.38 MHz, id 0x6f6
cpu0: features  
bfebfbff<FPU,VME,DE,PSE,TSC,MSR,PAE,MCE,CX8,APIC,SEP,MTRR>
cpu0: features bfebfbff<PGE,MCA,CMOV,PAT,PSE36,CFLUSH,DS,ACPI,MMX>
cpu0: features bfebfbff<FXSR,SSE,SSE2,SS,HTT,TM,SBF>
cpu0: features2 e3bd<SSE3,MONITOR,DS-CPL,VMX,EST,TM2,xTPR>
cpu0: "Intel(R) Core(TM)2 CPU          6600  @ 2.40GHz"
cpu0: I-cache 32 KB 64B/line 8-way, D-cache 32 KB 64B/line 8-way
cpu0: using thermal monitor 1
cpu1 at mainbus0: apid 1 (application processor)
cpu1: not started
ioapic at mainbus0: not configured
acpi0 at mainbus0: Advanced Configuration and Power Interface
acpi0: using Intel ACPI CA subsystem version 20060217
acpi0: X/RSDT: OemId <DELL  , B8K    ,00000014>, AslId <ASL ,00000061>
acpi0: SCI interrupting at int 9
acpi0: fixed-feature power button present
timecounter: Timecounter "ACPI-Fast" frequency 3579545 Hz quality 1000
timecounter: selected timecounter "ACPI-Fast" frequency 3579545 Hz  
quality 1000
ACPI-Fast 24-bit timer
mpacpi: could not get bus number, assuming bus 0
LNKA: Links after initial probe:
Link Device LNKA:
Index  IRQ  Rtd  Ref  IRQs
     0   11   N     0  3 4 5 6 7 9 10 11 12 15 polarity 1 trigger 0

LNKA: Links after initial validation:
Link Device LNKA:
Index  IRQ  Rtd  Ref  IRQs
     0   11   N     0  3 4 5 6 7 9 10 11 12 15 polarity 1 trigger 0

LNKA: Links after disable:
Link Device LNKA:
Index  IRQ  Rtd  Ref  IRQs
     0   11   Y     0  3 4 5 6 7 9 10 11 12 15 polarity 1 trigger 0

LNKB: Links after initial probe:
Link Device LNKB:
Index  IRQ  Rtd  Ref  IRQs
     0   10   N     0  3 4 5 6 7 9 10 11 12 15 polarity 1 trigger 0

LNKB: Links after initial validation:
Link Device LNKB:
Index  IRQ  Rtd  Ref  IRQs
     0   10   N     0  3 4 5 6 7 9 10 11 12 15 polarity 1 trigger 0

LNKB: Links after disable:
Link Device LNKB:
Index  IRQ  Rtd  Ref  IRQs
     0   10   Y     0  3 4 5 6 7 9 10 11 12 15 polarity 1 trigger 0

LNKC: Links after initial probe:
Link Device LNKC:
Index  IRQ  Rtd  Ref  IRQs
     0    3   N     0  3 4 5 6 7 9 10 11 12 15 polarity 1 trigger 0

LNKC: Links after initial validation:
Link Device LNKC:
Index  IRQ  Rtd  Ref  IRQs
     0    3   N     0  3 4 5 6 7 9 10 11 12 15 polarity 1 trigger 0

LNKC: Links after disable:
Link Device LNKC:
Index  IRQ  Rtd  Ref  IRQs
     0    3   Y     0  3 4 5 6 7 9 10 11 12 15 polarity 1 trigger 0

LNKD: Links after initial probe:
Link Device LNKD:
Index  IRQ  Rtd  Ref  IRQs
     0  255   N     0  3 4 5 6 7 9 10 11 12 15 polarity 1 trigger 0

LNKD: Links after initial validation:
Link Device LNKD:
Index  IRQ  Rtd  Ref  IRQs
     0  255   N     0  3 4 5 6 7 9 10 11 12 15 polarity 1 trigger 0

LNKD: Links after disable:
Link Device LNKD:
Index  IRQ  Rtd  Ref  IRQs
     0  255   N     0  3 4 5 6 7 9 10 11 12 15 polarity 1 trigger 0

LNKA: ACPI: Found matching pin for 0.2.INTA at func 0: 11
LNKA: ACPI: Found matching pin for 0.26.INTA at func 0: 11
LNKB: ACPI: Found matching pin for 0.26.INTB at func 1: 10
LNKG: Links after initial probe:
Link Device LNKG:
Index  IRQ  Rtd  Ref  IRQs
     0    9   N     0  3 4 5 6 7 9 10 11 12 15 polarity 1 trigger 0

LNKG: Links after initial validation:
Link Device LNKG:
Index  IRQ  Rtd  Ref  IRQs
     0    9   N     0  3 4 5 6 7 9 10 11 12 15 polarity 1 trigger 0

LNKG: Links after disable:
Link Device LNKG:
Index  IRQ  Rtd  Ref  IRQs
     0    9   Y     0  3 4 5 6 7 9 10 11 12 15 polarity 1 trigger 0

LNKG: ACPI: Found matching pin for 0.26.INTC at func 7: 9
LNKA: ACPI: Found matching pin for 0.27.INTA at func 0: 11
LNKA: ACPI: Found matching pin for 0.28.INTA at func 0: 11
LNKH: Links after initial probe:
Link Device LNKH:
Index  IRQ  Rtd  Ref  IRQs
     0    5   N     0  3 4 5 6 7 9 10 11 12 15 polarity 1 trigger 0

LNKH: Links after initial validation:
Link Device LNKH:
Index  IRQ  Rtd  Ref  IRQs
     0    5   N     0  3 4 5 6 7 9 10 11 12 15 polarity 1 trigger 0

LNKH: Links after disable:
Link Device LNKH:
Index  IRQ  Rtd  Ref  IRQs
     0    5   Y     0  3 4 5 6 7 9 10 11 12 15 polarity 1 trigger 0

LNKH: ACPI: Found matching pin for 0.29.INTA at func 0: 5
LNKB: ACPI: Found matching pin for 0.29.INTB at func 1: 10
LNKC: ACPI: Found matching pin for 0.29.INTC at func 2: 3
LNKE: Links after initial probe:
Link Device LNKE:
Index  IRQ  Rtd  Ref  IRQs
     0    9   N     0  3 4 5 6 7 9 10 11 12 15 polarity 1 trigger 0

LNKE: Links after initial validation:
Link Device LNKE:
Index  IRQ  Rtd  Ref  IRQs
     0    9   N     0  3 4 5 6 7 9 10 11 12 15 polarity 1 trigger 0

LNKE: Links after disable:
Link Device LNKE:
Index  IRQ  Rtd  Ref  IRQs
     0    9   Y     0  3 4 5 6 7 9 10 11 12 15 polarity 1 trigger 0

LNKE: ACPI: Found matching pin for 0.31.INTC at func 2: 9
LNKA: ACPI: Found matching pin for 2.0.INTA at func 0: 11
ACPI Object Type 'Processor' (0x0c) at acpi0 not configured
ACPI Object Type 'Processor' (0x0c) at acpi0 not configured
ACPI Object Type 'Processor' (0x0c) at acpi0 not configured
ACPI Object Type 'Processor' (0x0c) at acpi0 not configured
acpibut0 at acpi0 (PNP0C0C): ACPI Power Button
PNP0A03 at acpi0 not configured
PNP0C01 at acpi0 not configured
PNP0200 at acpi0 not configured
PNP0C04 at acpi0 not configured
PNP0000 at acpi0 not configured
pcppi0 at acpi0 (PNP0800)
pcppi0: io 0x61
sysbeep0 at pcppi0
PNP0B00 at acpi0 not configured
attimer0 at acpi0 (PNP0100): AT Timer
attimer0: io 0x40-0x5f irq 0
PNP0700 at acpi0 not configured
com0 at acpi0 (PNP0501-1)
com0: io 0x3f8-0x3ff irq 4
com: ns16550a, working fifo
com0: console
PNP0C0F at acpi0 not configured
PNP0C0F at acpi0 not configured
PNP0C0F at acpi0 not configured
PNP0C0F at acpi0 not configured
PNP0C0F at acpi0 not configured
PNP0C0F at acpi0 not configured
PNP0C01 at acpi0 not configured
PNP0C02 at acpi0 not configured
pcppi0: attached to attimer0
pci0 at mainbus0 bus 0: configuration mode 1
pci0: i/o space, memory space enabled, rd/line, rd/mult, wr/inv ok
pchb0 at pci0 dev 0 function 0
pchb0: vendor 0x8086 product 0x2990 (rev. 0x02)
vga0 at pci0 dev 2 function 0: vendor 0x8086 product 0x2992 (rev. 0x02)
vga0: WARNING: ignoring 64-bit BAR @ 0x18
wsdisplay0 at vga0 kbdmux 1
wsmux1: connecting to wsdisplay0
vendor 0x8086 product 0x2993 (miscellaneous display, revision 0x02)  
at pci0 devd
uhci0 at pci0 dev 26 function 0: vendor 0x8086 product 0x2834 (rev.  
0x02)
uhci0: interrupting at irq 11
usb0 at uhci0: USB revision 1.0
uhub0 at usb0
uhub0: vendor 0x8086 UHCI root hub, class 9/0, rev 1.00/1.00, addr 1
uhub0: 2 ports with 2 removable, self powered
uhci1 at pci0 dev 26 function 1: vendor 0x8086 product 0x2835 (rev.  
0x02)
uhci1: interrupting at irq 10
usb1 at uhci1: USB revision 1.0
uhub1 at usb1
uhub1: vendor 0x8086 UHCI root hub, class 9/0, rev 1.00/1.00, addr 1
uhub1: 2 ports with 2 removable, self powered
ehci0 at pci0 dev 26 function 7: vendor 0x8086 product 0x283a (rev.  
0x02)
ehci0: interrupting at irq 9
ehci0: BIOS has given up ownership
ehci0: EHCI version 1.0
ehci0: companion controllers, 2 ports each: uhci0 uhci1
usb2 at ehci0: USB revision 2.0
uhub2 at usb2
uhub2: vendor 0x8086 EHCI root hub, class 9/0, rev 2.00/1.00, addr 1
uhub2: 4 ports with 4 removable, self powered
vendor 0x8086 product 0x284b (multimedia subclass 0x03, revision  
0x02) at pci0 d
ppb0 at pci0 dev 28 function 0: vendor 0x8086 product 0x283f (rev. 0x02)
pci1 at ppb0 bus 1
pci1: i/o space, memory space enabled, rd/line, wr/inv ok
ppb1 at pci0 dev 28 function 4: vendor 0x8086 product 0x2847 (rev. 0x02)
pci2 at ppb1 bus 2
pci2: i/o space, memory space enabled, rd/line, wr/inv ok
no match for KeBugCheckEx
no match for KeTickCount
In windrv_lookup():
name = PCI Bus
found driver object!
Matching vendor: 14e4, product: 167a, name: Broadcom NetXtreme 57xx  
Gigabit Conr
ndis0 at pci2 dev 0 function 0in ndis_attach_pci()
sc->ndis_mtag = c0305e20
unknown type
bus_space_map failed
pci_mem_find: void region
pci_mapreg_info() failed on BAR 0x18!
pci_mem_find: void region
pci_mapreg_info() failed on BAR 0x1c!
pci_mem_find: void region
pci_mapreg_info() failed on BAR 0x20!
pci_mem_find: void region
pci_mapreg_info() failed on BAR 0x24!
pci interrupt: irq 11
uhci2 at pci0 dev 29 function 0: vendor 0x8086 product 0x2830 (rev.  
0x02)
uhci2: interrupting at irq 5
usb3 at uhci2: USB revision 1.0
uhub3 at usb3
uhub3: vendor 0x8086 UHCI root hub, class 9/0, rev 1.00/1.00, addr 1
uhub3: 2 ports with 2 removable, self powered
uhci3 at pci0 dev 29 function 1: vendor 0x8086 product 0x2831 (rev.  
0x02)
uhci3: interrupting at irq 10
usb4 at uhci3: USB revision 1.0
uhub4 at usb4
uhub4: vendor 0x8086 UHCI root hub, class 9/0, rev 1.00/1.00, addr 1
uhub4: 2 ports with 2 removable, self powered
uhci4 at pci0 dev 29 function 2: vendor 0x8086 product 0x2832 (rev.  
0x02)
uhci4: interrupting at irq 3
usb5 at uhci4: USB revision 1.0
uhub5 at usb5
uhub5: vendor 0x8086 UHCI root hub, class 9/0, rev 1.00/1.00, addr 1
uhub5: 2 ports with 2 removable, self powered
ehci1 at pci0 dev 29 function 7: vendor 0x8086 product 0x2836 (rev.  
0x02)
ehci1: interrupting at irq 5
ehci1: BIOS has given up ownership
ehci1: EHCI version 1.0
ehci1: companion controllers, 2 ports each: uhci2 uhci3 uhci4
usb6 at ehci1: USB revision 2.0
uhub6 at usb6
uhub6: vendor 0x8086 EHCI root hub, class 9/0, rev 2.00/1.00, addr 1
uhub6: 6 ports with 6 removable, self powered
ppb2 at pci0 dev 30 function 0: vendor 0x8086 product 0x244e (rev. 0xf2)
pci3 at ppb2 bus 3
pci3: i/o space, memory space enabled
pcib0 at pci0 dev 31 function 0
pcib0: vendor 0x8086 product 0x2810 (rev. 0x02)
vendor 0x8086 product 0x2820 (IDE mass storage, interface 0x8f,  
revision 0x02) d
vendor 0x8086 product 0x283e (SMBus serial bus, revision 0x02) at  
pci0 dev 31 fd
vendor 0x8086 product 0x2825 (IDE mass storage, interface 0x85,  
revision 0x02) d
isa0 at pcib0
npx0 at isa0 port 0xf0-0xff
npx0: using exception 16
timecounter: Timecounter "TSC" frequency 2392403220 Hz quality 800
timecounter: Timecounter "clockinterrupt" frequency 100 Hz quality 0
md0: internal 5000 KB image area
in ndis_create_kthreads
in ndis_create_sysctls()
In windrv_lookup():
name = PCI Bus
found driver object!
In windrv_lookup():
name = (null)
found driver object!
in IoGetDriverObjectExtension
found
ndis0: NDIS API version: 5.1
sc->ndis_chars->nmc_version_major = 5
                         sc->ndis_chars->nmc_version_minor = 1
pci2: NDIS ERROR: c005000e (unknown error)
pci2: NDIS NUMERRORS: 1
pci2: argptr: 0xc0000001
pci2: NDIS ERROR: c0050014 (unknown error)
pci2: NDIS NUMERRORS: 1
pci2: argptr: 0x1
status = c0000001ndis0: init handler failed
extent `iomem' (0x0 - 0xffffffff), flags = 0x3
      0x0 - 0x9f3ff
      0xa0000 - 0xbffff
      0xc0000 - 0xc7fff
      0x100000 - 0x7f35efff
      0x7f62f000 - 0x7f62fbff
      0x7f62fc00 - 0x7f631bff
      0xdfdfbc00 - 0xdfdfbfff
      0xff980800 - 0xff980bff
extent_free: start 0x0, end 0xf
panic: extent_free: region not found
Stopped in pid 0.1 (swapper) at netbsd:cpu_Debugger+0x4:        leave
db> bt
cpu_Debugger(c02dfe40,ff980800,ff980bff,c0980b14,f) at  
netbsd:cpu_Debugger+0x4
panic(c02dfe5a,0,f,1000,0) at netbsd:panic+0x141
extent_free(c090db00,0,10,10,30) at netbsd:extent_free+0xfa
x86_memio_unmap(1,0,10,0,0) at netbsd:x86_memio_unmap+0x3c
bus_release_resource(c2cd5000,1,0,c294b9b0,d) at  
netbsd:bus_release_resource+0x3
6
ndis_detach(c2cd5000,0,3,1,0) at netbsd:ndis_detach+0xd2
ndis_attach(c2cd5000,c0303280,0,0,c092243c) at netbsd:ndis_attach+0xb7
kthread_run_deferred_queue(0,0,0,0,0) at  
netbsd:kthread_run_deferred_queue+0x29
main(fbff,c01002ac,0,0,0) at netbsd:main+0x19d


On Oct 9, 2006, at 11:15 AM, Chris Tribo wrote:

> Apparently NDIS doesn't want to compile without wi in the kernel.  
> So now that I have it compiled, I booted to:
>
> (bunch of warnings about void regions and ignoring 64-bit BARs)
>
> in IoGetDriverObjectExtension
> found
> ndis0: NDIS API version: 5.1
> sc->ndis_chars->nmc_version_major=5
>    sc->ndis_chars->nmc_version_minot = 1
> pci2: NDIS ERROR: c005000e (unknown error)
> pci2: NDIS NUMERRORS: 1
> pci2 argptr: 0xc00000001
> pci2: NDIS ERROR: c0050014 (unknown error)
> pci2: NDIS NUMERRORS: 1
> pci2: argptr: 0x1
> status = c00000001ndis0: init handler failed
> extent 'iomem' (0x0 - 0xffffffff), flags = 0x3
>  0x0 - 0x9f3ff
>  0xa0000 - 0xbffff
>  0xc0000 - 0cx7fff
>  0x100000 - 0x6f35efff
> ...
> extent_free: start 0x1, end 0x10
> panic: extent_free: region not found
> stopped in pid 0.1(swapper) at netbsd:cpu_Debugger+0x4: leave
> db> (keyboard non-functional)
>
>
>
> On Oct 4, 2006, at 3:59 PM, Chris Tribo wrote:
>
>> I copied the includes from if_wi_pci.c and if_ral_pci.c for the  
>> 802.11 layer into the ndis C files:
>>
>> #include <net80211/ieee80211_netbsd.h>
>> #include <net80211/ieee80211_var.h>
>> #include <net80211/ieee80211_rssadapt.h>
>> #include <net80211/ieee80211_radiotap.h>
>>
>>
>> And now I get:
>>
>> In file included from /usr/src/sys/dev/if_ndis/if_ndis_pci.c:68:
>> /usr/src/sys/net80211/ieee80211_rssadapt.h:75: error:  
>> 'IEEE80211_RATE_SIZE' undeclared here (not in a function)
>> cc1: warnings being treated as errors
>> /usr/src/sys/net80211/ieee80211_rssadapt.h:100: warning: 'struct  
>> ieee80211_frame' declared inside parameter list
>> /usr/src/sys/net80211/ieee80211_rssadapt.h:100: warning: its scope  
>> is only this definition or declaration, which is probably not what  
>> you want
>> /usr/src/sys/net80211/ieee80211_rssadapt.h:100: warning: 'struct  
>> ieee80211_rateset' declared inside parameter list
>> *** Error code 1
>>
>>
>> On Oct 4, 2006, at 3:38 PM, Chris Tribo wrote:
>>
>>> The man page only mentions needing COMPAT_NDIS and ndis* at pci?,  
>>> do I need to uncomment a wirless card to pull in the 802.11  
>>> layer? I had to define LKM to kill the lkmentry warnings, but  
>>> this isn't an LKM is it?
>>>
>>> making sure the kern library is up to date...
>>> `libkern.a' is up to date.
>>> #      link  SoulCollector/netbsd
>>> ld -Map netbsd.map --cref -T /usr/src/sys/arch/i386/conf/ 
>>> kern.ldscript -Ttext c0100000 -e start -X -o netbsd ${SYSTEM_OBJ}  
>>> ${EXTRA_OBJ} vers.o
>>> if_ndis.o: In function `ndis_media_status':
>>> if_ndis.c:(.text+0x5da): undefined reference to  
>>> `ieee80211_rate2media'
>>> if_ndis.c:(.text+0x648): undefined reference to  
>>> `ieee80211_rate2media'
>>> if_ndis.o: In function `ndis_setstate_80211':
>>> if_ndis.c:(.text+0xb7c): undefined reference to  
>>> `ieee80211_chan2ieee'
>>> if_ndis.c:(.text+0xb93): undefined reference to `ieee80211_mhz2ieee'
>>> if_ndis.o: In function `ndis_ticktask':
>>> if_ndis.c:(.text+0x14be): undefined reference to  
>>> `ieee80211_mhz2ieee'
>>> if_ndis.o: In function `ndis_detach':
>>> if_ndis.c:(.text+0x183a): undefined reference to  
>>> `ieee80211_ifdetach'
>>> if_ndis.o: In function `ndis_attach':
>>> if_ndis.c:(.text+0x20be): undefined reference to  
>>> `ieee80211_ieee2mhz'
>>> if_ndis.c:(.text+0x21e0): undefined reference to  
>>> `ieee80211_ifattach'
>>> if_ndis.c:(.text+0x21ed): undefined reference to  
>>> `ieee80211_media_change'
>>> if_ndis.c:(.text+0x21f3): undefined reference to  
>>> `ieee80211_media_init'
>>> if_ndis.o: In function `ndis_ioctl':
>>> if_ndis.c:(.text+0x2995): undefined reference to `ieee80211_ioctl'
>>> if_ndis.c:(.text+0x2adf): undefined reference to `ieee80211_ioctl'
>>> if_ndis.c:(.text+0x2e2b): undefined reference to  
>>> `ieee80211_mhz2ieee'
>>> kern_ndis.o: In function `ndis_lkmentry':
>>> kern_ndis.c:(.text+0x166a): undefined reference to `lkmdispatch'
>>> kern_ndis.c:(.text+0x1696): undefined reference to `lkmdispatch'
>>> kern_ndis.c:(.text+0x1635): undefined reference to `lkmdispatch'
>>> *** Error code 1
>>>
>>> Stop.
>>> make: stopped in /usr/src/sys/arch/i386/compile/obj/SoulCollector
>>>
>>>
>>>
>>>
>>>
>>
>>
>>
>>
>>
>
>
> !DSPAM:452a67a156732824742700!
>
>
>