Evil: TI ACX111 non-success

Bill Paul wpaul at FreeBSD.ORG
Mon Aug 16 12:11:31 PDT 2004

> I managed to get rid of the "can't re-use a leaf" messaged by deleting
> the duplicate entry in ndis_driver_data.h.

I fixed the "can't re-use a leaf" problem recently. The routine that
creates the sysctls now checks to make sure it doesn't create duplicates.

> For some reason, whenever I
> try to load if_ndis.ko (ndis.ko is already loaded), I get messages about
> amdpm. Perhaps ndis returning 6 and failing to load is a result of the
> same return value from trying to attach amdpm.

Please download the ndisulator code as of today and try again. I finally
got my hands on one of these cards and managed to make it work. The main
reason it didn't work was that I wasn't mapping the PCI shared memory
ranges correctly. This chip has two ranges, specified in PCIR_BAR(0)
and PCIR_BAR(1). Most devices with two memory ranges put the second
range in PCIR_BAR(2), and if_ndis_pci.c was explicitly checking for
this. Since PCIR_BAR(2) is not used on this chip, it would botch the
test and incorrectly save the resource handles.

Along the way, I also discovered a problem with the firmware loading
code, which I fixed.

NOTE: you need more than just the .sys and .inf files to make this card
work. If you look carefully on the CD that came with your card, you'll
see there are three .bin files along with the driver:

# pwd
/cdrom/Driver/Windows XP
# ls -l
total 582
-rw-r--r--  1 12934  547   70724 Oct  2  2003 FW1130.BIN
-rw-r--r--  1 12934  547   76208 Oct 19  2003 FwRad16.bin
-rw-r--r--  1 12934  547   78368 Oct 19  2003 FwRad17.bin
-rwxr-xr-x  1 12934  547  360704 Dec  2  2003 netwg311.sys
-rw-r--r--  1 12934  547   11187 Dec 15  2003 wg311v2.inf

In particular, it seems this driver wants the FwRad16.bin image.

There are three ways you load the firmware files:

1) If you plan to load the ndis.ko and if_ndis.ko kernel modules AFTER
   THE KERNEL HAS ALREADY BOOTED, then all you need to do is put the
   .bin files in /compat/ndis and the driver will load them automatically.
   This only works when you load the driver from a multiuser state, because
   reading files this way only works once filesystems have been mounted.

2) If you want to pre-load the driver via the /boot/loader.conf file so
   that it is available when the kernel boots, do the following:

	# ndiscvt -f FwRad16.bin
        # cp FwRad16.bin.ko /boot/kernel
        edit /boot/loader.conf and add a lines that say:


   If things work correctly, kldstat should show you something like this:

	# kldstat
	Id Refs Address    Size     Name
 	1    9 0xc0400000 5e16d8   kernel
 	2    2 0xc09e2000 12728    ndis.ko
 	3    1 0xc09f5000 618d8    if_ndis.ko
 	4    1 0xc0a57000 13dc4    FwRad16.bin.ko
 	5    1 0xc0a6b000 51ac8    acpi.ko

3) The ndiscvt(8) utility will create both a FwRad16.bin.ko and a
   FwRad16.bin.o file. If you're one of those people who insists on 
   statically compiling the driver into your kernel, then you can
   link the FwRad16.bin.o into your kernel image.

When the driver loads, you should see the following:

ndis0: <NETGEAR WG311v2 802.11g Wireless PCI Adapter> mem 0xfb020000-0xfb03ffff,0xfb000000-0xfb001fff irq 23 at device 7.0 on pci0
ndis0: NDIS API version: 5.1
ndis0: 11b rates: 1Mbps 2Mbps 5.5Mbps 11Mbps
ndis0: 11g rates:  6Mbps 9Mbps 12Mbps 18Mbps 24Mbps 36Mbps 48Mbps 54Mbps


-Bill Paul            (510) 749-2329 | Senior Engineer, Master of Unix-Fu
                 wpaul at windriver.com | Wind River Systems
              <adamw> you're just BEGGING to face the moose

More information about the freebsd-current mailing list