llsx 发表于 2009-12-10 14:22

Intel® PRO/Wireless for *BSD

原文地址:http://damien.bergamini.free.fr/ipw/iwi-freebsd.html

Installing firmware binary images
The firmware is a program executed by the adapter itself (not by the host CPU!). The adapter can't do anything before it has received its firmware. For licensing reasons, the firmware images are not shipped with the iwi driver. They are made available in ports and binary packages. The port was created by Florent Thoumie.
# pkg_add http://damien.bergamini.free.fr/iwifw/FreeBSD/iwi-firmware-1.3.tbz-->Ports:
# cd /usr/ports/net/iwi-firmware/
# make install clean
Pre-compiled binary package:
# pkg_add -r iwi-firmware-2.3_1
Configuring the adapter
Firstly, load the if_iwi module:
# kldload -v if_iwi
Then, make sure that your card is correctly recognized:
# dmesg | grep iwi
iwi0:mem 0xe0206000-0xe0206fff irq 11 at device 4.0 on pci2
iwi0: Ethernet address: xx:xx:xx:xx:xx:xx
Note that the output may vary slightly depending on your system configuration.
Now, you must download the firmware binary image to the adapter.
For instance, to download firmware for BSS mode:
# iwicontrol -i iwi0 -d /usr/local/libdata/if_iwi -m bss
At this point, check that everything is correct:
# ifconfig iwi0
iwi0: flags=8806 mtu 1500
        ether xx:xx:xx:xx:xx:xx
        media: IEEE 802.11 Wireless Ethernet autoselect (autoselect)
        status: no carrier
        ssid ""
        channel -1 authmode OPEN powersavemode OFF powersavesleep 100
        rtsthreshold 2312 protmode CTS txpower 100
        wepmode OFF weptxkey 0
Enabling the radio transmitter
All Centrino® laptops have the ability to enable/disable the radio transmitter via a button or a switch. The radio transmitter is usually off by default. To know if your radio transmitter is enabled or not, use the iwicontrol tool with the -r option:
# sysctl dev.iwi.0.radio
dev.iwi.0.radio: 1
If your adapter radio transmitter is off (=0), use your laptop switch to turn it on and re-run the above command to see if it has some effect. If your radio transmitter is still off, it is likely that your laptop uses a software switch that requires additionnal drivers to work. Unfortunately, not all those laptops are supported at this time. Post a message in the
forum
to indicate your laptop model/brand and we will see if we can do something to make it work.
On some laptops, turning the interface up with ifconfig or dhclient can automatically switch the radio ON.
Associating to an Access Point
If your radio transmitter is on, you can start scanning for an access point:
# ifconfig iwi0 inet 192.168.0.20 netmask 255.255.255.0
Replace 192.168.0.20 and 255.255.255.0 with a valid IP address and netmask on your wired network. Once you have done that, you should be able to ping hosts on the network. If you are experiencing problems with you wireless connection, make sure that you are associated to an access point:
# ifconfig iwi0
should return some information, and you should see:
status: associated
If not, you may be out of range of the access point or have a configuration problem. It may also be the case that your adapter radio transmitter is off.
Advanced configuration
To enable debugging:
# sysctl debug.iwi=10
If you are running FreeBSD 5.4:
# sysctl debug.net80211=10
If you are running FreeBSD 6:
# sysctl net.wlan.debug=-1
# sysctl net.wlan.0.debug=-1
To join a specific BSS network with network name my_net, use ifconfig with the ssid option:
# ifconfig iwi0 inet 192.168.0.20 netmask 0xffffff00 ssid my_net
To join a specific BSS network with 40bits WEP encryption enabled:
# ifconfig iwi0 inet 192.168.0.20 netmask 0xffffff00 ssid my_net \
      wepkey 0x1234567890 weptxkey 1 wepmode on
To join a specific BSS network with 104bits WEP encryption enabled:
# ifconfig iwi0 inet 192.168.0.20 netmask 0xffffff00 ssid my_net \
      wepkey 0x01020304050607080910111213 weptxkey 1 wepmode on
The configuration of the iwi interface through DHCP is the same as for any ethernet adapter. You can use the following command to configure it via DHCP:
# dhclient iwi0
To kill the firmware and reset the adapter:
# iwicontrol -i iwi0 -k
To get adapter internal statistics:
# iwicontrol -i iwi0
Current transmission rate                                 
Fragmentation threshold                                    
RTS threshold                                             
Number of frames submitted for transfer                     
Number of frames transmitted                              
Number of unicast frames transmitted                        
Number of unicast 802.11b frames transmitted at 1Mb/s      
Number of unicast 802.11b frames transmitted at 2Mb/s      
Number of unicast 802.11b frames transmitted at 5.5Mb/s   
Number of unicast 802.11b frames transmitted at 11Mb/s      
Number of unicast 802.11g frames transmitted at 1Mb/s      
Number of unicast 802.11g frames transmitted at 2Mb/s      
Number of unicast 802.11g frames transmitted at 5.5Mb/s   
Number of unicast 802.11g frames transmitted at 6Mb/s      
Number of unicast 802.11g frames transmitted at 9Mb/s      
Number of unicast 802.11g frames transmitted at 11Mb/s      
Number of unicast 802.11g frames transmitted at 12Mb/s      
Number of unicast 802.11g frames transmitted at 18Mb/s      
Number of unicast 802.11g frames transmitted at 24Mb/s      
Number of unicast 802.11g frames transmitted at 36Mb/s      
Number of unicast 802.11g frames transmitted at 48Mb/s      
Number of unicast 802.11g frames transmitted at 54Mb/s      
Number of multicast frames transmitted                     
Number of multicast 802.11b frames transmitted at 1Mb/s   
Number of multicast 802.11b frames transmitted at 2Mb/s   
Number of multicast 802.11b frames transmitted at 5.5Mb/s   
Number of multicast 802.11b frames transmitted at 11Mb/s   
Number of multicast 802.11g frames transmitted at 1Mb/s   
Number of multicast 802.11g frames transmitted at 2Mb/s   
Number of multicast 802.11g frames transmitted at 5.5Mb/s   
Number of multicast 802.11g frames transmitted at 6Mb/s   
Number of multicast 802.11g frames transmitted at 9Mb/s   
Number of multicast 802.11g frames transmitted at 11Mb/s   
Number of multicast 802.11g frames transmitted at 12Mb/s   
Number of multicast 802.11g frames transmitted at 18Mb/s   
Number of multicast 802.11g frames transmitted at 24Mb/s   
Number of multicast 802.11g frames transmitted at 36Mb/s   
Number of multicast 802.11g frames transmitted at 48Mb/s   
Number of multicast 802.11g frames transmitted at 54Mb/s   
Number of transmission retries                              
Number of transmission failures                           
Number of frames with a bad CRC received                  
Number of full scans                                       
Number of partial scans                                    
Number of bytes transmitted                                 
Current RSSI                                                
Number of beacons received                                 
Number of beacons missed                                    
WPA (802.11i)
This section is dedicated to users of FreeBSD 6 connecting to a WPA-capable access point. FreeBSD 5 does not support WPA. To know how to activate WPA in your access point, please refer to its documentation.
Now we will see how to setup WPA-PSK (pre-shared key) for your network. This authentication method does not require a radius server. For other authentication methods, refer to wpa_supplicant.conf(5).
First, create a file named /etc/wpa_supplicant.conf:
ctrl_interface_group=0
eapol_version=1
ap_scan=1
fast_reauth=1
network={
      ssid="my_ssid"
      key_mgmt=WPA-PSK
      psk="my_passphrase"
}
You'll probably need to load the following kernel modules by hand before things work:
# kldload -v wlan_acl wlan_wep wlan_ccmp wlan_tkip
Then, run wpa_supplicant with the following options:
# wpa_supplicant -i iwi0 -c /etc/wpa_supplicant.conf [-d]
The -d option can be used to enable debugging and to help fixing potential issues.


本文来自ChinaUnix博客,如果查看原文请点:http://blog.chinaunix.net/u/9816/showart_2116398.html
页: [1]
查看完整版本: Intel® PRO/Wireless for *BSD