Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 25 Nov 2006 11:59:28 -0700
From:      Scott Long <scottl@samsco.org>
To:        Scot Hetzel <swhetzel@gmail.com>
Cc:        Bill Paul <wpaul@windriver.com>, FreeBSD-CURRENT <freebsd-current@freebsd.org>
Subject:   Re: Latest Broadcom NDIS driver requires 4 additional functions
Message-ID:  <45689290.70300@samsco.org>
In-Reply-To: <790a9fff0611251051md2ef50cja84440ba3cc7942f@mail.gmail.com>
References:  <790a9fff0611251051md2ef50cja84440ba3cc7942f@mail.gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help
Scot Hetzel wrote:

> I'm trying to upgrade my ndis driver from version 3.100.64.0 to
> 4.40.19.0, but when I try to load the driver I get a Fatal trap 12
> error.
> 
> #fetch ftp://ftp.hp.com/pub/softpaq/sp33001-33500/sp33008.exe
> #cabextract -q -L -F 'bcmwl5*' sp33008.exe
> #ndisgen bcmwl5.inf bcmwl564.sys
> #kldloadd ./bcmwl564_sys.ko
> no match for strrchr
> no match for MmFreeContiguousMemorySpecifyCache
> no match for MmAllocateContiguousMemorySpecifyCache
> no match for MmGetPhysicalAddress
> ichsmb0: <SMBus Controller> port 0x8400-0x840f mem
> 0xc0003000-0xc0003fff at device 20.0 on pci0
> device_attach: ichsmb0 attach returned 6
> ndis0: <Broadcom 802.11b/g WLAN> mem 0xc0204000-0xc0205fff irq 21 at
> device 20.0 on pci6
> ndis0: NDIS API Version: 5.1
> fpudna in kernel mode!
> ntoskrnl dummy called...
> 
> Fatal trap 12: page fault while in kernel mode
> cpuid = 0; apic id = 00
> fault virtual address = 0x1a
> fault code                = supervisor read, page not present
> instruction pointer   = 0x8:0xffffffffa2b1b1eb
> stack pointer           = 0x10:0xffffffffa2a6f100
> frame pointer          = 0x10:0xffffffffa2b82140
> code segment         = base 0x0, limit 0xfffff, type 0x1b
>                              = DPL 0, pres 1, long 1, def32 0, gran 1
> processor eflags      = intrrupt enabled, resume, IOPL=0
> current process      = 1503 (kldload)
> [thread pid 1503 tid 100099]
> stopped at 0xffffffffa2b1b1eb:   cmpb (%rax, %rdx, 1), %cl
> db>bt
> tracing pid 1503 tid 100099 td 0xffffff002f569810
> bcmwl564_sys_drv_data_start() at 0xffffffffa2b1b1eb
> (null)() at 0x11600000000
> 
> NOTE: This fatal trap 12 was caused by the missing strrchr function,
> after implementing only that function, and recompiling the ndis.ko
> module  the driver nolonger crashed the kernel.
> 
> I was able to create the first 3 functions for the NDIS compatibility
> layer, but I'm not sure how to find the Physical address from the
> Virtual Address for the MmGetPhysicalAddress function.
> 
> Implemented Functions:
>      stricmp
>      strrchr
>      MmAllocateContiguousMemory
>      MmAllocateContiguousMemorySpecifyCache
>      MmFreeContiguousMemory
>      MmFreeContiguousMemorySpecifyCache
> 
> Unimplemented Functions:
>      memchr - implemented but causes "cast discards qualifiers from
> pointer target type" (copied from lib/libc/string/memchr.c)
>      MmGetPhysicalAddress - needs to be implemented
> 
> Any ideas as to how to fix memchr, and implement MmGetPhysicalAddress?
> 

Since there is no need to be portable across architectures with ndis, 
you can just map MmGetPhysicalAddress to vtophys().  If GART/IOMMU 
support happens for i386 or amd64 then this will need to be revisited.

S



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?45689290.70300>