From owner-freebsd-current@FreeBSD.ORG Sat Nov 25 18:59:45 2006 Return-Path: X-Original-To: freebsd-current@freebsd.org Delivered-To: freebsd-current@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 367B116A416 for ; Sat, 25 Nov 2006 18:59:45 +0000 (UTC) (envelope-from scottl@samsco.org) Received: from pooker.samsco.org (pooker.samsco.org [168.103.85.57]) by mx1.FreeBSD.org (Postfix) with ESMTP id 5D3ED43D72 for ; Sat, 25 Nov 2006 18:58:45 +0000 (GMT) (envelope-from scottl@samsco.org) Received: from [192.168.254.14] (imini.samsco.home [192.168.254.14]) (authenticated bits=0) by pooker.samsco.org (8.13.4/8.13.4) with ESMTP id kAPIxSgC018363; Sat, 25 Nov 2006 11:59:33 -0700 (MST) (envelope-from scottl@samsco.org) Message-ID: <45689290.70300@samsco.org> Date: Sat, 25 Nov 2006 11:59:28 -0700 From: Scott Long User-Agent: Mozilla/5.0 (Macintosh; U; PPC Mac OS X Mach-O; en-US; rv:1.7.7) Gecko/20050416 X-Accept-Language: en-us, en MIME-Version: 1.0 To: Scot Hetzel References: <790a9fff0611251051md2ef50cja84440ba3cc7942f@mail.gmail.com> In-Reply-To: <790a9fff0611251051md2ef50cja84440ba3cc7942f@mail.gmail.com> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-1.4 required=3.8 tests=ALL_TRUSTED autolearn=failed version=3.1.1 X-Spam-Checker-Version: SpamAssassin 3.1.1 (2006-03-10) on pooker.samsco.org Cc: Bill Paul , FreeBSD-CURRENT Subject: Re: Latest Broadcom NDIS driver requires 4 additional functions X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 25 Nov 2006 18:59:45 -0000 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: port 0x8400-0x840f mem > 0xc0003000-0xc0003fff at device 20.0 on pci0 > device_attach: ichsmb0 attach returned 6 > ndis0: 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