Senin, 16 Juni 2008

Broadcom BCM4311 802.11g mini-PCIe (14E4:4324) Wireless Adapter using ndiswrapper Installation

Step 1 - Remove any existing copies of ndiswrapper that you may have
user@ubuntu:~$ ndiswrapper

If you get an error stating that the program is not installed then proceed to the Step 2.
Here is how to remove a copy that was installed using apt-get:
user@ubuntu:~$ sudo apt-get remove ndiswrapper

If you have an existing copy that you installed using make then change to the driver's directory and remove it using make:
user@ubuntu:~$ make uninstall


Run ndiswrapper once more to make sure that you get the not installed error message:
user@ubuntu:~$ ndiswrapper

It is also advisable to remove ndiswrapper module from kernel when using ndiswrapper 1.29
user@ubuntu:~$ sudo rmmod ndiswrapper

recommend that you reboot before continuing particularly using ndiswrapper 1.29.
As of 01/17/2007, the Latest ndiswrapper version is 1.34 - several successful installs already.
Step 2 - Disable any Competing Drivers
The Ubuntu 6.10 Edgy Eft release has a kernel driver for this device that is called bcm43xx. Prior releases may have this device as well. In order to use ndiswrapper you must put the bcm43xx in the black list file.
echo 'blacklist bcm43xx' | sudo tee -a /etc/modprobe.d/blacklist

The blacklisted module will not be loaded on reboot from now on.
Check the contents of the /etc/iftab file and make sure that no other device has the wlan0 driver name reserved for it:
user@ubuntu:~$ cat /etc/iftab

If there are any lines assigning the name wlan0 to a MAC identifier then either remove that line or comment it out with the "#" character.
Step 3 - Prepare the Linux build environment
You will need to install the essential build files to compile the driver:
user@ubuntu:~$ sudo apt-get update
user@ubuntu:~$ sudo apt-get install build-essential

Install the correct headers for your version of Ubuntu: (don't worry if it tells you that yours are up to date.)
user@ubuntu:~$ sudo apt-get install linux-headers-`uname -r`
user@ubuntu:~$ sudo ln -s /usr/src/linux-`uname -r` /lib/modules/`uname -r`/build

Step 4 - Download the latest version of the ndiswrapper driver
Download the latest version of the ndiswrapper from sourceforge:
[WWW] http://sourceforge.net/projects/ndiswrapper
At the time I originally wrote this the latest version was 1.28:
[WWW] http://downloads.sourceforge.net/ndiswrapper/ndiswrapper-1.28.tar.gz?modtime=1162136432&big_mirror=0
Or, from the command line:
user@ubuntu:~$ sudo wget http://downloads.sourceforge.net/ndiswrapper/ndiswrapper-1.28.tar.gz

Now 1.35 is available:
user@ubuntu:~$ sudo wget http://downloads.sourceforge.net/ndiswrapper/ndiswrapper-1.35.tar.gz

1.46 is now available (June 6th, 2007) and has been used successfully. Just replace 1.28 or 1.35 below with 1.46:
user@ubuntu:~$ sudo wget http://downloads.sourceforge.net/ndiswrapper/ndiswrapper-1.46.tar.gz

Move the file from the Desktop, or from wherever you download it, to your home directory. You can open you home directory from the middle top menu called "Places" by selecting "Home Folder" and then copying the file into your home using your mouse pointer.
It should be noted that as the ndiswrapper is further developed it could be the case that any particular NDIS driver's compatibility could become broken for awhile.
Step 5 - Extract and install the ndiswrapper using make
Using tar extract the archived driver and change directories into the build area.
user@ubuntu:~$ tar xvzf ndiswrapper-1.28.tar.gz
user@ubuntu:~$ cd ndiswrapper-1.28

Make the driver with the commands "make distclean", "make", and "make install":
user@ubuntu:~/ndiswrapper-1.28$ make distclean
user@ubuntu:~/ndiswrapper-1.28$ make
user@ubuntu:~/ndiswrapper-1.28$ sudo make install

The make process will take several minutes to complete.
You can now check the ndiswrapper to see that it is installed correctly. You should see something similar to:
user@ubuntu:~/ndiswrapper-1.28$ ndiswrapper -v
utils version: 1.9
driver version: 1.28
vermagic: 2.6.17-10-generic SMP mod_unload 586 REGPARM gcc-4.1

Obtain the Windows NDIS drivers that you intend to use with the device. In this case we are going to download the drivers from the Hewlett Packard or Compaq web sites.
For another device you should look at the ndiswrapper site's device listing and obtain your drivers from the described location. Or if you only have the install CD you can try to use those drivers, but it might not work.
The driver that we are using can be obtained from Hewlett Packard. Download this file and put it into your home directory.
user@ubuntu:~/ndiswrapper-1.28$ sudo wget ftp://ftp.hp.com/pub/softpaq/sp33001-33500/sp33008.exe -O${HOME}/sp33008.exe

Once we've got the archive file from a manufacturer, the "cabextract" tool will be required to extract the archive:
Edit the /etc/apt/sources.list and uncomment the line for the universe repository and then run apt-get update and install:
user@ubuntu:~/ndiswrapper-1.28$ gksudo gedit /etc/apt/sources.list

Find and uncomment these lines:
deb http://us.archive.ubuntu.com/ubuntu/ edgy universe
deb-src http://us.archive.ubuntu.com/ubuntu/ edgy universe

and
deb http://security.ubuntu.com/ubuntu edgy-security universe
deb-src http://security.ubuntu.com/ubuntu edgy-security universe

Run apt-get update and install the cabextract and unzip package:
user@ubuntu:~/ndiswrapper-1.28$ sudo apt-get update
user@ubuntu:~/ndiswrapper-1.28$ sudo apt-get install cabextract unzip

Create the directory bcm4311 and move the file sp33008.exe into it and extract the file using cabextract or unzip:
user@ubuntu:~/ndiswrapper-1.28$ cd ~
user@ubuntu:~$ mkdir bcm4311
user@ubuntu:~$ mv sp33008.exe bcm4311
user@ubuntu:~$ cd bcm4311
user@ubuntu:~/bcm4311$ cabextract sp33008.exe

or if above fails
user@ubuntu:~/bcm4311$ unzip sp33008.exe

Now we can install the drivers:
user@ubuntu:~/bcm4311$ sudo ndiswrapper -i bcmwl5.inf

You should see output similar to this during the install:
installing bcmwl5 ...
forcing parameter IBSSGMode from 0 to 2
forcing parameter IBSSGMode from 0 to 2
forcing parameter IBSSGMode from 0 to 2
forcing parameter IBSSGMode from 0 to 2
forcing parameter IBSSGMode from 0 to 2
forcing parameter IBSSGMode from 0 to 2
forcing parameter IBSSGMode from 0 to 2
forcing parameter IBSSGMode from 0 to 2
forcing parameter IBSSGMode from 0 to 2
forcing parameter IBSSGMode from 0 to 2
forcing parameter IBSSGMode from 0 to 2
forcing parameter IBSSGMode from 0 to 2
forcing parameter IBSSGMode from 0 to 2
forcing parameter IBSSGMode from 0 to 2
forcing parameter IBSSGMode from 0 to 2
forcing parameter IBSSGMode from 0 to 2
forcing parameter IBSSGMode from 0 to 2
forcing parameter IBSSGMode from 0 to 2
forcing parameter IBSSGMode from 0 to 2
forcing parameter IBSSGMode from 0 to 2

You should not receive any warnings or errors.
Using ndiswrapper we can list the installed driver to make sure that we have it:
user@ubuntu:~bcm4311$ ndiswrapper -l
installed drivers:
bcmwl5 driver installed, hardware (14E4:4324) present (alternate driver: bcm43xx)

If all you see is the driver, but there is no message displayed about the hardware being present, then you need to tell ndiswrapper to use your driver with your device. You will need to determine what the device ID is by typing 'lspci -n' or 'lsusb'. Once you have the device ID, then use the driver:
user@ubuntu:~/bcm4311$ sudo ndiswrapper -a 14E4:4324 bcmwl5

Make sure you fill in '14E4:4324' with YOUR device id, and 'bcmwl5' with your driver.
We can also look inside the directory where the drivers get stored by ndiswrapper:
user@ubuntu:~/bcm4311$ ls /etc/ndiswrapper
bcmwl5

And the contents of the bcmwl5 subdirectory are:
user@ubuntu:~/bcm4311$ ls /etc/ndiswrapper/bcmwl5
14E4:4311:1363:103C.5.conf 14E4:4319:1359:103C.5.conf
14E4:4311:1364:103C.5.conf 14E4:4319:135A:103C.5.conf
14E4:4311:1365:103C.5.conf 14E4:4319.5.conf
14E4:4311.5.conf 14E4:4320:00E7:0E11.5.conf
14E4:4312:135F:103C.5.conf 14E4:4320:12F4:103C.5.conf
14E4:4312:1360:103C.5.conf 14E4:4320:12F8:103C.5.conf
14E4:4312:1361:103C.5.conf 14E4:4320:12FA:103C.5.conf
14E4:4312:1362:103C.5.conf 14E4:4320:12FB:103C.5.conf
14E4:4312.5.conf 14E4:4320.5.conf
14E4:4318:1355:103C.5.conf 14E4:4324:12F9:103C.5.conf
14E4:4318:1356:103C.5.conf 14E4:4324:12FC:103C.5.conf
14E4:4318:1357:103C.5.conf 14E4:4324.5.conf
14E4:4318.5.conf bcmwl5.inf
14E4:4319:1358:103C.5.conf bcmwl5.sys

Move the 14E4:4324.5.conf file into .conf:
user@ubuntu:~/bcm4311$ sudo cp /etc/ndiswrapper/bcmwl5/14E4:4324.5.conf /etc/ndiswrapper/bcmwl5/.conf

Edit the new .conf file:
On 1.28: I also didn't need to edit this file. (FYI, DLink router.) --Jamie Jackson
On 1.29: altering config file proved to be not needed. --Teaker1s
On 1.34: No changes to config file required. --AntiFlash
On 1.35: My ndiswrapper -l showed 14E4:4311, so I used an appropriate .conf file and made no changes to it - is it a good idea? -- grybba
On 1.43: My ndiswrapper -l showed 14E4:4311, so I used the appropriate .conf file and made no changes to it, and it worked fine -- cro
user@ubuntu:~/bcm4311$ gksudo gedit /etc/ndiswrapper/bcmwl5/.conf

Change the .conf file and change the ninth line from "Afterburner|1" to "Afterburner|0"
NdisVersion|0x50001
Environment|1
class_guid|4d36e972-e325-11ce-bfc1-08002be10318
NetworkAddress|XX:XX:XX:XX:XX:XX
driver_version|Broadcom,03/23/2006, 4.40.19.0
BusType|5

11HNetworks|1
Afterburner|0

This turns off a Broadcom extention to the 802.11x standards that improves throughput when you are using all Broadcom devices. It also will not let this device work with my Linksys Access Point unless it is turned off. Perhaps this would not be necessary with some Broadcom Access Points?
Bring up the driver:
user@ubuntu:~/bcm4311$ sudo depmod -a
user@ubuntu:~/bcm4311$ sudo modprobe ndiswrapper

If you do not get any errors and your system does not immediately freeze the driver should now be loaded. Do not reboot until we have made some basic checks and installed the driver permanently.
Step 6 - Install the device and configure the network settings
Issuing an iwconfig command should reveal that your device is waiting to be configured, similar to this one:
user@ubuntu:~/bcm4311$ iwconfig
lo no wireless extensions.

eth0 no wireless extensions.

wlan0 IEEE 802.11b ESSID:off/any
Mode:Managed Frequency:2.412 GHz Access Point: Not-Associated
Bit Rate:11 Mb/s
RTS thr:2432 B Fragment thr:2432 B
Power Management:off
Link Quality:95/100 Signal level:-35 dBm Noise level:-96 dBm
Rx invalid nwid:0 Rx invalid crypt:0 Rx invalid frag:0
Tx excessive retries:0 Invalid misc:0 Missed beacon:0

sit0 no wireless extensions.

If your device shows up as wlan0 then you should be able to put your data in through the System-->Administration-->Networking applet.
(If your wireless device initially shows up as eth1, go back to step 2 and comment out the eth1 line in /etc/iftab. Then resume the rest of the instructions. If you don't comment out the eth1 entry, ndiswrapper won't be able to alias the device as wlan0.)
If it is eth1 or some other name then you should put in the data in interfaces using the gedit editor as explained below and fix the name as is described later in the procedure as well.
You just need to end up with the record formats that I am showing in my example. I used gedit to put the required record into the /etc/network/interfaces file: (note that the Xs are your actual WEP key.)
user@ubuntu:~/bcm4311$ gksudo gedit /etc/network/interfaces

Create a record that looks like this: (Note we are using 128bit WEP encryption in this example.)
iface wlan0 inet dhcp
wireless-essid My_Essid
wireless-key XXXXXXXXXXXXXXXXXXXXXXXXXX
auto wlan0

Save the file.
Make the driver permanent using the ndiswrapper method:
user@ubuntu:~/bcm4311$ sudo ndiswrapper -m
adding "alias wlan0 ndiswrapper" to /etc/modprobe.d/ndiswrapper ...
couldn't add module alias: at /usr/sbin/ndiswrapper line 717.
user@ubuntu:~/bcm4311$

Critical Notice: Check the file /etc/modprobe.d/ndiswrapper file and make sure that the ndiswrapper alias is wlan0 an not something else such as eth1.
Use cat to look at /etc/modprobe.d/ndiswrapper and ensure that it contains the line "alias wlan0 ndiswrapper" and nothing else:
user@ubuntu:~/bcm4311$ cat /etc/modprobe.d/ndiswrapper

Make sure that it contains only the wlan0 identifier and no other:
alias wlan0 ndiswrapper
If it contains anything else edit /etc/modprobe.d/ndiswrapper and ensure that it contains the line "alias wlan0 ndiswrapper" and nothing else:
user@ubuntu:~/bcm4311$ gksudo gedit /etc/modprobe.d/ndiswrapper

Save the file.
Reboot your system in preparation for testing and validation of your work.
Step 7 - Testing the device
Now when we run iwconfig we should see that your ESSID and Access Point fields have been filled in with your access point's correct information and the Frequency field shows the correctly detected frequency:
user@ubuntu:~bcm4311$ iwconfig
lo no wireless extensions.

eth0 no wireless extensions.

wlan0 IEEE 802.11b ESSID:"My_Essid"
Mode:Managed Frequency:2.412 GHz Access Point: 00:08:74:02:01:FC
Bit Rate:11 Mb/s
RTS thr:2432 B Fragment thr:2432 B
Power Management:off
Link Quality:95/100 Signal level:-35 dBm Noise level:-96 dBm
Rx invalid nwid:0 Rx invalid crypt:0 Rx invalid frag:0
Tx excessive retries:0 Invalid misc:0 Missed beacon:0

sit0 no wireless extensions.


The ESSID field should contain the name of your wireless network and the Access Point field should be filled in with the MAC identifier of your access point.
Run a "netstat -rn" command, and you should see that the correct routing is setup:
user@ubuntu:~$ netstat -rn
Kernel IP routing table
Destination Gateway Genmask Flags MSS Window irtt Iface
192.168.0.0 0.0.0.0 255.255.255.0 U 0 0 0 wlan0
0.0.0.0 192.168.0.2 0.0.0.0 UG 0 0 0 wlan0
user@ubuntu:~$

In this case 192.168.0.2 is the gateway address to an Internet router.
If everthing looks good then all of your network data has been entered correctly.
Step 8 - Controlling the device
My system does not restart this device on startup, so I use the ifup and ifdown commands to control it. Scanning is supported in iwlist so you can scan for networks and wifi-radar works as well.
You can now control the device with ifup and ifdown:
user@ubuntu:~$ sudo ifdown wlan0
user@ubuntu:~$ sudo ifup wlan0
user@ubuntu:~$ sudo iwlist wlan0 scanning

Removing and inserting the device should remove and setup the network correctly, at least it does with this device.
If you need to restore or change your system's route to the internet you can use dhclient:
user@ubuntu:~$ sudo dhclient wlan0

when you are happy that your wireless networking is correct then
gksudo gedit /etc/modules

Add the word ndiswrapper and save the file using "save as" this will then load everytime you boot
Hopefully, you have arrived at the end of this procedure with a working device. Refer questions to the Networking & Wireless section of the forums.

Tidak ada komentar:

Posting Komentar

Silahkan kirim komentar anda tentang blog ini dengan bahasa yang sopan dan santun.