Solved USRobotics BCMWL5 ndis driver issues on FreeBSD-7.2

aurora

Well-Known Member

Reaction score: 1
Messages: 250

I've just finished compiling the NDIS driver for my USRobotics USR5417 (BCM4318 chipset) WiFi PCI card. The resulting kernel driver formed by the ndisgen utility is BCMWL5_SYS.ko and it loads itself under the name ndis0 perfectly. I've configured everything that are outlined at the 31.3 Wireless Networking section of FreeBSD manual:

/boot/loader.conf:

Bash:
BCMWL5_SYS_load="YES"
ndis_load="YES"
if_ndis_load="YES"
wlan_scan_ap_load="YES"
wlan_scan_sta_load="YES"
wlan_wep_load="YES"
wlan_ccmp_load="YES"
wlan_tkip_load="YES"

/etc/rc.conf:
Bash:
ifconfig_ndis0="ssid MySSiD inet 192.168.1.198 netmask 255.255.255.0 bssid 00:11:92:da:da:da channel 11"

ifconfig lists all settings of the ndis0 except ssid, bssid and channel and it doesn't respond to ifconfig ndis0 up scan but it should because there are many Access Points around.

How to make the ndis0 scan the nearby AP's ?

Thanks!
 
Last edited:

richardpl

Aspiring Daemon

Reaction score: 69
Messages: 841

You are using 6.4?
what is displayed on console once module is loaded? This is extremly important!
what gives
# ifconfig ndis0 list scan ?
 

rocky

Member

Reaction score: 1
Messages: 97

@aurora72 I experienced a similiar problem on a Compaq Presario CQ40-401au.

I suddenly found an stupid way to fix it: after changing my ssid by using `ifconfig` I press the wireless button (the light color of button did not change... and no message showed in `dmesg`), the things worked.

Try to press the button to get it to work...
 
OP
aurora

aurora

Well-Known Member

Reaction score: 1
Messages: 250

Yes, exactly. I'm using the 6.4 version.
cat /var/log/messages | more (during startup)

Bash:
kernel: ndis0: <Dell TrueMobile 1300 WLAN Mini-PCI Card> mem 0xf3ffe000-0xf3ffffff irq 11 at device 16.0 on pci0
kernel: ndis0: NDIS API version: 5.1
kernel: ndis0: Ethernet address: 00:14:c1:0c:b9:4f

ifconfig ndis0 list scan returns nothing. ifconfig ndis0 scan returns nothing either and just hangs on, until ctrl-c is pressed. Here are the questions:

1- Considering that the expression <Dell TrueMobile 1300 WLAN Mini-PCI Card> PCI card is declared as a Mini-PCI card is originating from bcmwl5.inf , could it have been mistaken by the ndisgen while forming the BCMWL5_SYS.ko ?

2- The sample dmesg at the 11.8 Setting up the NICs section of the FreeBSD manual, has those 2 lines which my dmesg doesn't have:
Code:
ndis0: 11b rates: 1Mbps 2Mbps 5.5Mbps 11Mbps
ndis0: 11g rates: 6Mbps 9Mbps 12Mbps 18Mbps 36Mbps 48Mbps 54Mbps

Could this mean any part the of driver files or modules lack in my system?

Thanks.
 
Last edited:
OP
aurora

aurora

Well-Known Member

Reaction score: 1
Messages: 250

rocky said:
... after changing my ssid by using `ifconfig` I press the wireless button (the light color of button did not change... and no message showed in `dmesg`), the things worked...

I wish I could solve it by doing that, however my system 's got no such button as it's no Laptop computer. I have just rearranged my signature, take a look at it.
 

richardpl

Aspiring Daemon

Reaction score: 69
Messages: 841

aurora said:
1- In statement <Dell TrueMobile 1300 WLAN Mini-PCI Card> PCI card is declared as a Mini-PCI card. Considering this statement has originated from the bcmwl5.inf file, could it have been mistaken by the ndisgen process while forming the BCMWL5_SYS.ko file?
Depends, what's output of % pciconf -lv for such device before BCMWL5_SYS.ko module is loaded?

You could use # sysctl debug.ndis=1 to get more information on console.

Could you please post output of
Code:
ifconfig ndis0
and $ sysctl dev.ndis.0.
 
OP
aurora

aurora

Well-Known Member

Reaction score: 1
Messages: 250

I don't know how to run pciconf -lv before BCMWL5_SYS.ko module is loaded
Here is a mere output of pciconf -lv

Code:
ndis0@pci0:16:0    class=0x028000 card=0x011a16ec chip=0x431814e4 rev=0x02 hdr=0x00
        vendor   = 'Broadcom Corporation'
        device    = 'BCM43XX Broadcom 802.11b/g'
        class       = network
sysctl debug.ndis=1 gives unknown OID debug.ndis error.

ifconfig ndis0

Code:
ndis0:    flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> mtu 1500
        ether: 00:14:c1:0c:b9:4f
        media: IEEE 802.11 Wireless Ethernet autoselect
        status: no carrier
        ssid "" channel 1
        authmode OPEN privacy OFF txpowmax 100 bmiss 7 protmode CTS

sysctl dev.ndis.0 (written by hand)

Code:
dev.ndis.0.%descr: Dell TrueMobile 1300WLAN Mini-PCI card
dev.ndis.0.%driver: ndis
dev.ndis.0.%location: slot=16 function=0
dev.ndis.0.%pnpinfo: vendor=0x14e4 device=0x4318 subvendor=0x011a class=0x028000
dev.ndis.0.%parent: pci0
dev.ndis.0.RoamDelte: 1
dev.ndis.0.LOM: 0
dev.ndis.0.IBSSAllowed: 1
dev.ndis.0.ssid_auto_promote: 0
dev.ndis.0.MPC: 1
dev.ndis.0.RadioState: 0
dev.ndis.0.PowerStateMode: 2
dev.ndis.0.PLCPHeader: 0
dev.ndis.0.frag: 2346
dev.ndis.0.rts: 2347
dev.ndis.0.NetworkAddress:
dev.ndis.0.antdiv: -1
dev.ndis.0.FrameBursting: 0
dev.ndis.0.AfterBurner: 0
dev.ndis.0.gpio0: -1
dev.ndis.0.gpio1: -1
dev.ndis.0.gpio2: -1
dev.ndis.0.gpio3: -1
dev.ndis.0.gpiotimeinterval: 0xa005A
dev.ndis.0.EnableLEAP: 1
dev.ndis.0.Interference_Mode: -1
dev.ndis.0.ccx_rm: 1
dev.ndis.0.ccx_rm_limit: 300
dev.ndis.0.country: JP
dev.ndis.0.channel: 11
dev.ndis.0.WME: 0
dev.ndis.0.WVCCoexist: 0
dev.ndis.0.Managed: 1
dev.ndis.0.BTCOExist: 1
dev.ndis.0.abcap: 1
dev.ndis.0.RoamTrigger: -70
dev.ndis.0.IBSSSGMode: 0
dev.ndis.0.IBSSGProtection: 2
dev.ndis.0.LegacyMode: 0
dev.ndis.0.Rate: 0
dev.ndis.0.AbcompatMode: 0
dev.ndis.0.10280001: Dell TrueMobile 1300 WLAN Mini-PCI Card
dev.ndis.0.Environment: 1
dev.ndis.0.NDisVersion: 0x00050001
dev.ndis.0.BusTyoe: 5
dev.ndis.0.InterruptNumber: 11
dev.ndis.0.ForcePIO: UNSET
dev.ndis.0.NoRadio: UNSET
dev.ndis.0.AdaptorDesc: UNSET
dev.ndis.0.DriverDesc: UNSET
dev.ndis.0.Brand: UNSET
dev.ndis.0.WPA: UNSET
dev.ndis.0.band: UNSET
dev.ndis.0.RateA: UNSET
dev.ndis.0.AssocRoamPref: UNSET
dev.ndis.0.IBSSLink: UNSET
dev.ndis.0.PwrOut: UNSET
dev.ndis.0.BandPref: UNSET
dev.ndis.0.BadFramePreempt: UNSET
dev.ndis.0.11HNetworks: UNSET
dev.ndis.0.scan_channel_time: UNSET
dev.ndis.0.scan_unassoc_time: UNSET
dev.ndis.0.scan_home_time: UNSET
dev.ndis.0.scan_passive_time: UNSET
dev.ndis.0.scan_passes: UNSET
dev.ndis.0.EnableAutoConnect: UNSET
 
Last edited:

richardpl

Aspiring Daemon

Reaction score: 69
Messages: 841

Try to change
Code:
dev.ndis.0.RadioState
to 1 and
bring ndis0 up/down and see it if improve anything.
 
OP
aurora

aurora

Well-Known Member

Reaction score: 1
Messages: 250

sysctl dev.ndis.0.RadioState=1
Code:
ifconfig ndis0 down
ifconfig ndis0 up
ifconfig ndis0 scan

Again, after the ifconfig ndis0 up, it waited one or two seconds as if it's setting the ndis0 up. But still, ifconfig ndis0 scan yielded no results. I'm still worried about the absence of those 2 lines at dmesg

Bash:
ndis0: 11b rates: ... 11Mbps
ndis0: 11g rates: ... 54Mbps

In this thread 802.11b works, 11g not, Dell TrueMobile 1300 , those 2 lines are present. I guess my wifi card won't start scanning unless those lines appear at dmesg.
 
Last edited:

paradox

Member

Reaction score: 20
Messages: 97

>aurora72
is your wifi turn ON on the notebook?
also
you can upgrate to freebsd 7.x
or freebsd current
and use the bwi for your wifi
if ndis dosn't work
 
OP
aurora

aurora

Well-Known Member

Reaction score: 1
Messages: 250

paradox said:
>aurora72
is your wifi turn ON on the notebook?
I wish I had such a problem, so that it could be easily solved by turning the WiFi switch on. However, my system is a classical desktop with Pentium II and a PCI WiFi card, that is, no wifi button is present.
paradox said:
you can upgrate to freebsd 7.x
or freebsd current
and use the bwi for your wifi
if ndis dosn't work
Is there so much difference between 6.x & 7.x so as to cause this problem? WiFi technology was already established enough by the time version 6.x was released, wasn't it? And how do you use bwi? Are you sure you've spelled it correctly?
 
Last edited:
OP
aurora

aurora

Well-Known Member

Reaction score: 1
Messages: 250

paradox said:
i mean
bwi - broadcom wireless driver for freebsd
http://forums.freebsd.org/showthread.php?t=2477&page=2

That's fine, i.e. a Unix-native driver for BCM43XX Broadcom chipset is all very fine and I might as well go and get it and use it in the future. Actually, I might start using it right now, just to be able to use the wifi card now but I'd still like to make the NDISulated driver work because I'm in it for learning purposes, too. I'd like to see how it performs the NDIS way and what kind of configurations should be done, etc. So I'm still working on the NDISulated driver, trying to make it work and waiting for further suggestions all the while.

Thanks,
 
Last edited:

richardpl

Aspiring Daemon

Reaction score: 69
Messages: 841

Upgrading to 7.2 RELEASE is your best bet.
There may be conflict betwen NDISulator and net80211.
7.2 have usefull debug tools too.
 
OP
aurora

aurora

Well-Known Member

Reaction score: 1
Messages: 250

I have just upgraded to 7.2-RELEASE and things have improved a bit. ndis0 now records the ssid string to appear in the ifconfig ndis0. But the status is still no carrier Here's the output of ifconfig ndis0 (truncated)

Bash:
....
media: IEEE 802.11 Wireless Ethernet autoselect
status: no carrier
ssid LOVE channel 1 (2412 Mhz 11g)
authmode OPEN privacy OFF bmiss 7 scanvalid 60 bintval 0 txpowmax 100 bmiss 7 protmode CTS

ifconfig ndis0 scan doesn't return anything, it just hangs and only ctrl-c can stop it. Furthermore, I've tried

sysctl dev.ndis.0.RadioState=1
Bash:
ifconfig ndis0 down
ifconfig ndis0 up
ifconfig ndis0 scan

and the result is the same; it just hangs in scan mode. So, what should I do now, am I still missing something?

Thanks.
 
Last edited:

richardpl

Aspiring Daemon

Reaction score: 69
Messages: 841

try debug.ndis sysctl again.
First we need to know that scanning works at all.
 
OP
aurora

aurora

Well-Known Member

Reaction score: 1
Messages: 250

sysctl debug.ndis=1 prints

Code:
ndis_scan_results: 0 results
ndis_scan_results: 0 results
ndis_scan_results: 0 results
ndis_scan_results: 0 results
.....

until I have to press ctrl-c and even then it keeps on printing. I had to ctrl-alt-del to stop it.

Does this output ndis_scan_results: 0 mean that scanning works properly?

Thanks.
 
Last edited:

richardpl

Aspiring Daemon

Reaction score: 69
Messages: 841

aurora72 said:
Code:
# sysctl debug.ndis=1

returns

Code:
ndis_scan_results: 0 results
ndis_scan_results: 0 results
ndis_scan_results: 0 results
ndis_scan_results: 0 results
.....

until I have to press ctrl-c and even then it keeps on printing.

I had to ctrl-alt-del to stop it. Why doesn't ctrl-c stop it, have no idea.
That's kernel printfs, you disable it permanently typing # sysctl debug.ndis=0
or bringing ndis0 down.
aurora72 said:
ok anyway,does the output "ndis_scan_results: 0 results" mean that scanning works?
Yes, either there is nothing out there of RF is turned off.

Probably device comes with CD for Windows and utility that controls device.

The last idea I have is to start ndisgen(8) again but this time, before
pressing last enter]RadioState[/b] string and replace value "0" with "1" for every reoccurrence of RadioState in windrv.h

Here is example how it may look like:

Code:
{ "RadioState",
  "Radio On/Off [1=Disable] [0=Enable]",
{ "0" }, 1 },


What's output of % ifconfig -m ndis0
 
OP
aurora

aurora

Well-Known Member

Reaction score: 1
Messages: 250

It took me a while to get back to this thread, as I have, among other things, reinstalled the 7.2-RELEASE, 3 times!

Now, during the ndisgen before the last step (i.e. compiling the kernel module) I have edited the windrv.h which had 17 entries containing the term RadioState which looked like
Bash:
{ "RadioState",
  "Radio On/Off [1=Disable] [0=Enable]",
{ "0" }, 2 },

In all of those entries, I've replaced the value "0" with "1" but ndis0 still didn't work. It still hangs up at the ifconfig ndis0 scan The output of ifconfig -m ndis0 is now: (manually written & truncated)
Bash:
media IEEE 802.11 Wireless Ethernet autoselect
status no carrier
supported media
.....
media  fDM/54Mbps mode autoselect mediaoptadhoc
media  fDM/54Mbps mode autoselect
media  fDM/48Mbps mode autoselect mediaoptadhoc
media  fDM/48Mbps mode autoselect
.....
ssid MySSID channel 1 (2412 MHz 11g)
authmode OPEN privacy OFF bmiss 7 scanvalid 60 protmode CTS bintval 0

What else can be done?

Thanks.
 
Last edited:
OP
aurora

aurora

Well-Known Member

Reaction score: 1
Messages: 250

Thank you for the latest info.

I've found the patch-1.diff file and successfully made the patch on /usr/src/sys/dev/if_ndis/if_ndis.c

But after that, I guess I have to recompile the kernel, right? If I have to recompile the kernel, how do I make it compile only the part relating to if_ndis? That is, which name should I put for MODULES_OVERRIDE = before make buildkernel & make installkernel

Thanks.
 
Last edited:

richardpl

Aspiring Daemon

Reaction score: 69
Messages: 841

If you are using GENERIC kernel:

# cd /sys/modules/if_ndis && make && make install && make clean
 
OP
aurora

aurora

Well-Known Member

Reaction score: 1
Messages: 250

Scanning has finally worked!

After I've applied the patch to the if_ndis, ndis0 scan has finally started to scan wifi networks. Actually it hasn't initially. I've come across this old article titled HOWTO: NDISulate Windows Drivers on FreeBSD and noticed something small but significant:
Bash:
ls *.inf *.sys
bcmwl5.inf      bcmwl5.sys      bcmwl5a.inf     bcmwlntp.sys
cp bcmwl5.* /sys/modules/if_ndis
ls /sys/modules/if_ndis
Makefile        bcmwl5.inf      bcmwl5.sys
cd /sys/modules/if_ndis

Here the ndisgen operation was taking place under /sys/modules/if_ndis directory. Me, on the other hand was running ndisgen in an arbitrary directory which contained only the .inf & .sys files.

Only after I run the ndisgen in /sys/modules/if_ndis directory and using the newly formed bcmwl5_sys.ko file, did I finally manage to make ndis0 work properly and it started scanning the WiFi networks.

It's alright now but here's another problem: Though I've set up all of necessary TCP/IP settings such as
inet 192.168.1.198 netmask 255.255.255.0
route add default 192.168.1.1
ndis0 can't ping the the associated AP which is 192.168.1.1

If I ping the same AP using the rl0 ethernet device (of course over the ethernet cable) it pings perfectly. In case of ndis0 the ping returns just no route to host What could be missing here?

Thanks!
 
Last edited:

richardpl

Aspiring Daemon

Reaction score: 69
Messages: 841

aurora72 said:
Hello,

Having applied the patch to the if_ndis, at first I have failed again to make ndis0 scan the wifi networks. But I kept on trying because the same card on the same computer using windows 2000 was working and finally I have managed to make it scan.

I came across this old article
and noticed something minor but significant:
Code:
# ls *.inf *.sys
bcmwl5.inf      bcmwl5.sys      bcmwl5a.inf     bcmwlntp.sys
# cp bcmwl5.* /sys/modules/if_ndis
# ls /sys/modules/if_ndis
Makefile        bcmwl5.inf      bcmwl5.sys
# cd /sys/modules/if_ndis
Do not use obsolete information. There is no need to copy files to /sys/modules.

You need to patch /sys/dev/if_ndis/if_ndis.c, patch is in link I already gave to you. You also need FreeBSD source installed.
Then after you compiled if_ndis.ko module:
# cd /sys/modules/if_ndis && make && make install && make clean
you must install it to /boot/kernel with make install,
after that reboot because you probably have old if_ndis.ko already loaded.
You will also need to recompile bcmwl5_sys.ko too.

But now I have another problem: Though I 've set up all of necessary TCP/IP settings such as "inet 192.168.1.198 netmask 255.255.255.0" and "route add default 192.168.1.1" ndis0 just cannot ping the IP of its associated AP, which is 192.168.1.1

If I ping the same AP using the rl0 ethernet device (and using of course an ethernet cable) it pings perfectly. In case of ndis0 the ping simply returns "no route to host"

You need to edit /etc/resolv.conf

Please give ifconfig output again, it should be something like this:
Code:
ndis0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> metric 0 mtu 1500
        ether 0e:e0:ec:df:8d:1f
        inet 192.168.2.13 netmask 0xffffff00 broadcast 192.168.2.255
        media: IEEE 802.11 Wireless Ethernet OFDM/54Mbps mode 11g
        status: associated
        ssid FreeBSD channel 6 (2412 Mhz 11g) bssid 0a:bb:90:0a:ff:ec
        country US authmode OPEN privacy ON deftxkey 1 wepkey 1:104-bit
        txpower 30 bmiss 7 mcastrate 6 mgmtrate 6 scanvalid 60 protmode CTS
status must be associated
 
OP
aurora

aurora

Well-Known Member

Reaction score: 1
Messages: 250

richardpl said:
....
you must install it to /boot/kernel with make install,
...
Looks like I was initially missing the installation to /boot/kernel on make install and that was why it didn't scan at first. Now it works. By the way, after reinstalling the if_ndis module on a GENERIC kernel, is the kernel still counted as GENERIC?

ifconfig ndis0 is almost the same as yours:

Bash:
ndis0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> metric 0 mtu 1500
        ether 00:1e:83:20:57:83
        media: IEEE 802.11 Wireless Ethernet OFDM/54Mbps mode 11g
        status: associated
        ssid FreeBSD channel 6 (2412 Mhz 11g) bssid 0a:bb:90:0a:ff:ec
        country US authmode OPEN privacy WPA deftxkey 1 wepkey 1:104-bit
        txpower 30 bmiss 7 mcastrate 6 mgmtrate 6 scanvalid 60 protmode CTS

except the line which starts with inet. That line was missing in mine. But after a search on this forum, I guess I found out why it was missing: One had to write the ifconfig_ndis0 according to some convention in rc.conf I guess

Bash:
ifconfig_ndis0="WPA"
ifconfig_ndis0_alias0="inet 192.168.1.100 netmask 255.255.255.0"

After rearranging the rc.conf as above, did the inet line finally show up at the ifconfig ndis0 and then did it finally start to ping arbitrary hosts in the LAN and WAN, using either IP or hostname. I have even downloaded Firefox from the Internet using ndis0 at full speed.

I'm thankful for helping me make all this stuff possible. But though everything is now ok, there's just one more thing small but causing a little discomfort: The activity led on the Wifi PCI card just doesn't blink (or light) during wireless data transfer. I know it used to blink while using it in windows 2000. What can be done to make its led work again?

Thanks!
 
Last edited:
Top