红联Linux门户
Linux帮助

Install RALINK wireless PCI card on linux

发布时间:2008-02-26 00:22:41来源:红联作者:Jadonose
I just lost one day in order to configure "Linksys WMP54G PCI card v4.1" on Fedora 7, and I want share what I do, hope useful for other user.
I add some stuff in order to solve the problem of network startup that doesn't able to verify the LINK Status of RALINK RT61 driver.

I discover that the Link status of Ralink is not detected by the "ethtool" application, used on Fedora script to detect the status of device.

So the result on network startup is the following:
...
Determining IP information for ra0... failed; no link present. Check cable?
---

and your ra0 device is put DOWN after that.

Note that this problem "should" be related to the Ralink module that not implement alla features of other nic devices.
See step 8) for detail.

Follow all Installation instruction:

1) Download driver from Ralink Home » Support » Linux
http://www.ralinktech.com.tw/data/IS...1.1.1.0.tar.gz

These is the driver for Linksys WMP54G PCI that use RT61 chipset, I read that same old linksys cards use different chipset.

Check it on driver for Windows CDROM: you should find rt61.sys file.

2) Build Module rt61.ko following the instruction below see also the README inside S_Linux_STA_6x_D_1.1.1.0.tar.gz

2.1> $tar -xvzf RT61_Linux_STA_Drv_x.x.x.x.tar.gz
go to "./RT61_Linux_STA_Drv_x.x.x.x/Module" directory.

2.2> $cp Makefile.6 ./Makefile # [kernel 2.6]

2.3> $make all # compile driver source code

2.4> $cp rt2561.bin /etc/Wireless/RT61STA/ # copy firmware
$cp rt2561s.bin /etc/Wireless/RT61STA/
$cp rt2661.bin /etc/Wireless/RT61STA/

2.5> $dos2unix rt61sta.dat
$cp rt61sta.dat /etc/Wireless/RT61STA/rt61sta.dat
# !!!check if it is a binary file before loading !!!

3) Check that modules "rt61pci rt2x00pci rt2x00lib" are NOT LOADED, and add alias for ra0

Use command lsmod to find if these module are loaded. if true you must avoid loading of these tree driver on boot.
So add the modules on the BLACKLIST, edit the file /etc/modprobe.conf, and add the following lines:

blacklist rt61pci
blacklist rt2x00pci
blacklist rt2x00lib

edit the file /etc/modprobe.conf, and add the following line

alias ra0 rt61

So the my file is the following:
# cat /etc/modprobe.conf
blacklist rt61pci
blacklist rt2x00pci
blacklist rt2x00lib
alias eth0 skge
alias eth1 sky2
alias scsi_hostadapter ahci
alias snd-card-0 snd-hda-intel
options snd-card-0 index=0
options snd-hda-intel index=0
alias ra0 rt61

4) Configure the RT61 wireless connection editing the file:/etc/Wireless/RT61STA/rt61sta.dat

The my config file confiured as WPA-PSK TKIP is the following:

# cat /etc/Wireless/RT61STA/rt61sta.dat
[Default]
CountryRegion=0
CountryRegionABand=7
WirelessMode=0
SSID=Marte
NetworkType=Managed
Channel=0
AuthMode=WPAPSK
EncrypType=TKIP
DefaultKeyID=0
Key1Type=0
Key1Str=
Key2Type=0
Key2Str=
Key3Type=0
Key3Str=
Key4Type=0
Key4Str=
WPAPSK=912345678
TxBurst=0
PktAggregate=0
WmmCapable=0
APSDCapable=0
APSDAC=0;0;0;0
BGProtection=0
IEEE80211H=0
TxRate=0
RTSThreshold=2347
FragThreshold=2346
RoamThreshold=75
PSMode=CAM
TxPreamble=0
FastRoaming=0

Please check the Redame of RT61 driver for detail.

5) Load module rt61:and check device

modprobe rt61

now if modules is loaded you should see the wireless network card, type

iwconfig

ra0 RT61 Wireless ESSID:"Marte" Nickname:"Matrix"
Mode:Managed Frequency:2.462 GHz Access Point: 00:C0:02:04:C7:2E
Bit Rate=54 Mb/s
RTS thr:off Fragment thr:off
Encryption key:D3C9-FA20-4F6A-9CD8-961D-ACC2-08C9-C88D

6) Add new configuration file for device ra0: /etc/sysconfig/network-scripts/ifcfg-ra0

# cat ifcfg-ra0

# Please read /usr/share/doc/initscripts-*/sysconfig.txt
# for the documentation of these parameters.
TYPE=Wireless
DEVICE=ra0
HWADDR=00:1a:70:3b:0c:d6
BOOTPROTO=dhcp
NETMASK=
DHCP_HOSTNAME=
IPADDR=
DOMAIN=
ONBOOT=yes
USERCTL=no
IPV6INIT=no
PEERDNS=yes
ESSID=Marte
CHANNEL=1
MODE=Managed
RATE='54 Mb/s'

7) Now you should able to configure manually the wireless connection by the following command:

### UP ra0 ###

modprobe rt61
ifconfig ra0 up
dhclient ra0 -d

### Down ra0 ###

kill the dhclient
ifconfig ra0 down
rmmod rt61

also you can assign a static ip as follow:
### UP ra0 ip static ###

modprobe rt61
ifconfig ra0 10.60.2.5 up
dhclient ra0 -d

8) Patch Fedora 7 scripts for DHCP startup of ra0 device

edit the file /etc/sysconfig/network-scripts/network-functions

and replace the function: check_ethtool () whit the following one...., I add some stuff to avoid abort of startup of ra0 device due to link status problem.

check_ethtool ()
{
# Change for driver RT61 WMP54G (Gianluca Calicchia 26/Ago/2007)
if [ "$1" = "ra0" ];then
echo $"RT61 Device assuming: Link detected: yes (Module rt61.ko)"
return 1
fi
# End Change

[ -x /sbin/ethtool ] || return 2
output=`LC_ALL=C ethtool $1 2>&1`
echo $output | LC_ALL=C grep -q "Link detected: yes" && return 1
echo $output | LC_ALL=C grep -q "Link detected: no" && return 0 || return 2
}

Work for me I hope work also for you
文章评论

共有 0 条评论