# FreeBSD 9 and Broadcom (Dell Vostro 3500), ndis method.



## valsorym (Dec 10, 2011)

Hi all,

Some time ago I created a similar topic. But the issue was never resolved.
But now I use FreeBSD 9.0 RC-2


```
FreeBSD qb 9.0-PRERELEASE FreeBSD 9.0-PRERELEASE #0: Sat Dec  3 22:44:52 UTC 2011
    root@qb:/usr/obj/usr/src/sys/VAHAGN  i386
```

*VAHAGN kernel it is just GENERIC kernel plus options graphic mode in console.    

Good men (user: thedonger) sent me a private message. He showed how to use ndisgen. I thank him. And I started to use ndisgen. My howto.


```
Installing FreeBSD 9.0 RC-2
                              (Broadcom WiFi)

------------------------------------------------------------------------------
    Broadcom WiFi connection problem  in Dell Vostro 3500 and FreeBSD 9.x.    
------------------------------------------------------------------------------
    Operating system FreeBSD doesn't has support Broadcom WiFi Wireless 4313
    chip. We must use NDISulator technology.

------------------------------------------------------------------------------
    Getting the Windows Xp driver to Broadcom WiFi.
------------------------------------------------------------------------------
    A. Visit the official site. Choose a model. Download the driver.
       My driver has name: Dell-Wireless WLAN 1501 Half Mini-Card (4313bg).exe
       *Don't worry, it is Windows exe file but it is just zip file.

    B. Download it driver to /tmp directory. Rename it to DWW4313.exe.

    C. Unpack it's.
       # mkdir -p DWW4313
       # mv DWW4313.exe ./DWW4313/
       # cd DWW4313/
       # unzip DWW4313.exe 
       Archive:  DWW4313.exe
       ...

       Now we have next files:
       # ls
       DRIVER_JPN   DRIVER_US   Setup.exe
       DRIVER_ROW   DWW4313.exe Version.txt

------------------------------------------------------------------------------
    Compiling a *.sys and if files.
------------------------------------------------------------------------------
    A. Copy bcmwl5.sys and bcmwl5.inf in /usr/src/sys/modules/if_ndis/.
       # cd  /tmp/DWW4313/DRIVER_US/
       # cp bcmwl5.inf bcmwl5.sys /usr/src/sys/modules/if_ndis/
       # cd /usr/src/sys/modules/if_ndis/

    B. Create *.ko file.
       # ndisgen bcmwl5.inf bcmwl5.sys
       * Just only clik Enter button.

       # ls
       Makefile bcmwl5.inf  bcmwl5.sys  bcmwl5_sys.ko

       # cp bcmwl5_sys.ko /boot/modules/


------------------------------------------------------------------------------
    Configure system.
------------------------------------------------------------------------------
    A. Load needed modules.
       # kldload ndis
       # kldload bcmwl5_sys

    B. Check the state.
       # ifconfig ndis0
       ndis0: flags=8802<BROADCAST,SIMPLEX,MULTICAST> metric 0 mtu 2290
              ether 1c:65:9d:27:f4:7e
              nd6 options=29<PERFORMNUD,IFDISABLED,AUTO_LINKLOCAL>
              media: IEEE 802.11 Wireless Ethernet autoselect (autoselect)
              status: no carrier

    *  Note
       1. Do not use ndis0. Create clone this device, for example:
          # ifconfig wlan0 create wlandev ndis0 

       2. Do not use ndis in /boot/loader.conf.

------------------------------------------------------------------------------
    Startup script.
------------------------------------------------------------------------------
    A. If you use encryption WPA2-Personal (TKIP + AES), IP issued by DHCP.
       # vim /etc/wifi_up
       #!/bin/sh

       kldload /boot/modules/bcmwl5_sys.ko
       kldload /boot/kernel/wlan_xauth.ko

       ifconfig wlan0 create wlandev ndis0 country UA channel 1 ssid YOUR-SID-NAME
  authmode shared deftxkey 1 wepmode mixed wepkey
       ifconfig wlan0 up
       wpa_supplicant -i wlan0 -D ndis -s -c /etc/wpa_supplicant.conf &
       dhclient wlan0
       
       # vim /etc/wpa_supplicant.conf
       network={
           ssid="YOUR-SID-NAME"
           psk="PASS-ASCII"
       }
       
       # chmod 1555 /etc/wifi_up
```

But after running */etc/wifi_up* I have:

```
# /etc/wifi_up
wlan0: no link .............. giving up

# ifconfig
...
ndis0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> metric 0 mtu 2290
    ether 1c:65:9d:27:f4:7e
    nd6 options=29<PERFORMNUD,IFDISABLED,AUTO_LINKLOCAL>
    media: IEEE 802.11 Wireless Ethernet autoselect mode 11g
    status: associated
wlan0: flags=8c43<UP,BROADCAST,RUNNING,OACTIVE,SIMPLEX,MULTICAST> metric 0 mtu 1500
    ether 1c:65:9d:27:f4:7e
    inet6 fe80::1e65:9dff:fe27:f47e%wlan0 prefixlen 64 scopeid 0x6 
    nd6 options=21<PERFORMNUD,AUTO_LINKLOCAL>
    media: IEEE 802.11 Wireless Ethernet autoselect (autoselect)
    status: no carrier
    ssid valsorym channel 1 (2412 MHz 11g)
    regdomain NONE country UA authmode 802.1x privacy MIXED
    deftxkey UNDEF txpower 30 bmiss 7 mcastrate 6 mgmtrate 6 scanvalid 60
    protmode CTS roaming MANUAL bintval 0
```

1. Why wlan0: ... "status: no carrier"?
2. And why my computer auto restarted after 3 - 5 minutes? x(


When I added in /etc/rc.conf.

```
hostname="qb"
defaultrouter="192.168.1.1"
wlans_ndis0="wlan0"
ifconfig_wlan0="WPA DHCP"
```

my computer autoreboots after I run *startx*. x( (Sometime I use OpenBox). I remove it. But my computer autoreboots again, and again.


----------



## valsorym (Dec 10, 2011)

I removed all. All that I created. Cleaned up /etc/rc.conf, remove the module from /boot/modules/ - everything that I did above.
I run *startx* - run OpenBox. Alt + F2 - run *gmrun*. I run any program lowriter, gnome-terminal, geany or others and the system will autoreboot. x(

In /var/log/ I have a lot of logfiles. What to look even necessary?

*Added after some time.
The reason to restart not in ndisgen, and bad sectors on the hard disk. I think .


----------



## valsorym (Dec 12, 2011)

Today, I reinstalled my system. I checked it. It does not restart itself. (No auto reboot). 
I tried again to configure *ndisgen*. And the system auto rebooted again. Okay, I reanimate my system use fsck(8). I boot it, and listening to music, use text editors, and rebuild my kernel. No auto reboot. 

I think, maybe I use bad driver? But this driver I used when I used Windows Xp in my Dell Vostro 3500 laptop. 

How  you think - what is it?


----------



## Nicholas (Jan 8, 2012)

Hi, doorways. Look here: http://forums.freebsd.org/showthread.php?t=28548, follow instructions from PC-BSD wiki. The WinXP driver works for me, though I have to *kldload* the module manually and not to restart netif.


----------

