From owner-freebsd-amd64@FreeBSD.ORG Wed Jul 20 17:04:05 2005 Return-Path: X-Original-To: freebsd-amd64@freebsd.org Delivered-To: freebsd-amd64@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 8EF9116A41F for ; Wed, 20 Jul 2005 17:04:05 +0000 (GMT) (envelope-from kjblack@gmail.com) Received: from zproxy.gmail.com (zproxy.gmail.com [64.233.162.196]) by mx1.FreeBSD.org (Postfix) with ESMTP id 1B75A43D48 for ; Wed, 20 Jul 2005 17:04:04 +0000 (GMT) (envelope-from kjblack@gmail.com) Received: by zproxy.gmail.com with SMTP id n29so1449897nzf for ; Wed, 20 Jul 2005 10:04:04 -0700 (PDT) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:reply-to:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=uNqTwdun3tAepIiQft+Vd64FdHVNNBHmtFiC2KpIcQSC3enHw4FKqK5UANlyo3x9fMzB3ZU0VtVbpIPLmcsKQOEVb0JFqCB+oQHZ35fo6EEVkZiOriI2s+Vx/OWzRyUsvBobgTX1S7K92jDOCj0NSqw2oBjjaIL//zwnEN0ygVY= Received: by 10.36.60.1 with SMTP id i1mr282101nza; Wed, 20 Jul 2005 10:03:30 -0700 (PDT) Received: by 10.36.22.10 with HTTP; Wed, 20 Jul 2005 10:03:28 -0700 (PDT) Message-ID: <1b1b33f10507201003320df3ef@mail.gmail.com> Date: Wed, 20 Jul 2005 13:03:28 -0400 From: Kelly Black To: jkim@niksun.com In-Reply-To: <200507201153.49441.jkim@niksun.com> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Content-Disposition: inline References: <1b1b33f1050720061764ca7eeb@mail.gmail.com> <200507201153.49441.jkim@niksun.com> Cc: freebsd-amd64@freebsd.org Subject: Re: Using ndisgen to create loadable module w/ broadcom on Compaq R3000z X-BeenThere: freebsd-amd64@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: Kelly Black List-Id: Porting FreeBSD to the AMD64 platform List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 20 Jul 2005 17:04:05 -0000 On 7/20/05, Jung-uk Kim wrote: > On Wednesday 20 July 2005 09:17 am, Kelly Black wrote: > > Hello, > > > > I have a compaq R300z (okay, I'm sorry already!) running > > freebsd-amd64 current. I recently tried to use ndisulator for the > > built in broadcom wireless and used the 64 bit windows drivers to > > try to generate a loadable module for the wireless device. I have > > had some trouble generating the loadable module, though. I last > > updated world and the kernel on Monday. > > > > I've tried searching the freebsd-amd64 and freebsd-current lists, > > and I've tried to search using google. So far I can't find anything > > to help. Has anyone managed to get this beast working? Any help > > would be appreciated. I will paste an overview of what I've tried > > below: > > > > Here is the device info: > > root@localhost# pciconf -lvvv > > none3@pci2:2:0: class=3D0x028000 card=3D0x12f4103c chip=3D0x432014e4 > > rev=3D0x03 hdr=3D0x00 vendor =3D 'Broadcom Corporation' > > device =3D 'BCM4306 802.11b/g Wireless LAN Controller' > > > > Copies of the driver files that I am using can be found at > > http://blackk.union.edu/~black/freebsd/BCMWL564.SYS > > http://blackk.union.edu/~black/freebsd/netbc564.inf.ascii > > This is a 64 bit driver, and the inf file was converted to ascii > > using iconv. > > > > Here is the message I get when I use ndisgen: > > Compiling stub... done. > > Linking loadable kernel module... /usr/bin/ld: windrv_stub.o: > > relocation R_X86_64_32S can not be used when making a shared > > object; recompile with -fPIC windrv_stub.o: could not read symbols: > > Bad value linking failed. Exiting. > > > > I read through the ndisgen script to try to figure out what it was > > doing. I then did this (I added -fPIC): > > > > /usr/bin/cc -D_KERNEL -DDRV_DATA_START=3DBCMWL564_SYS_drv_data_start > > -DDRV_NAME=3DBC MWL564_SYS -DDRV_DATA_END=3DBCMWL564_SYS_drv_data_end > > -I. /usr/share/misc/windrv_stub.c -data -symbolic -c -o > > windrv_stub.o -fPIC > > > > /usr/bin/ld -Bshareable -d -warn-common -o BCMWL564_SYS.ko > > windrv_stub.o windrv.o > > > > /usr/bin/ld -r -d -warn-common -o BCMWL564_SYS.o windrv_stub.o > > windrv.o > > > > (The files windrv_stub.o and others were created when ndisgen > > called ndiscvt so I just left them alone.) > > > > When I do this the file compiles and links with no error messages. > > It creates a file called BCMWL564_SYS.ko. When I try to load the > > file using kldload I get these messages: > > > > kldload: can't load /tmp/broadcom/BCMWL564_SYS.ko: Exec format > > error > > > > and from the console window: > > > > kldload: Unsupported file type > > kldload: unexpected relocation type 7 > > link_elf: symbol windrv_load undefined > > > > Any ideas? >=20 > Try the attached patch. I have been using this for months without a > problem. ;-) In fact, I sent it to Bill but he didn't reply. >=20 > Cheers, >=20 > Jung-uk Kim >=20 > > Sincerely, > > Kel >=20 >=20 >=20 Dear Jung-uk Kim, I tried to apply the diff using "patch" but it had trouble. I applied the patch by hand, and it now works. Thank you! I can see ndis0 and connect using dhclient. Did I say "thank you" yet? By the way, I just got back from a business trip and finally got to test your patches for the pccard issues. I borrowed a wireless card, and it worked great. Of course, now that I've applied your fix for ndis I no longer need your patch for the pccard! :-) Thank you again!!! Sincerely, Kel --=20 _______________________________________________________ Kelly Black Phone: (518) 388-8727 Department of Mathematics FAX: (603) 388-6005=20 Union College e-mail: kelly.black@union.edu Schenectady NY 12308 (USA) WWW: http://blackk.union.edu/~black