RT2870 Wireless Lan Linux Driver
rt2870.o/rt2870.ko
Linux kernel 2.4 and 2.6 series.
Tested in Redhat 7.3 or later.
Ralink 802.11n Wireless LAN Card.
This is a linux device driver for Ralink RT2870 USB ABGN WLAN Card.
- Makefile: Makefile
- *.c: c files
- *.h: header files
This driver implements basic IEEE802.11. Infrastructure and adhoc mode with open or shared or WPA-PSK or WPA2-PSK authentication method. NONE, WEP, TKIP and AES encryption.
$ tar -xvzf DPB_RT2870_Linux_STA_x.x.x.x.tgz
$ cd ./DPB_RT2870_Linux_STA_x.x.x.x
In Makefile set MODE = STA and TARGET = LINUX
Search ifeq ($(PLATFORM),PC)
and define the Linux kernel source. Modify to meet your needs.
In os/linux/config.mk
:
- Define the GCC and LD of the target machine
- Define the compiler flags CFLAGS
- Build for being controlled by NetworkManager or wpa_supplicant wext functions:
- Set
HAS_WPA_SUPPLICANT=y
- Set
HAS_NATIVE_WPA_SUPPLICANT_SUPPORT=y
cd wpa_supplicant-x.x.x
./wpa_supplicant -Dwext -ira0 -c wpa_supplicant.conf -d
- Set
- Build for being controlled by WpaSupplicant with Ralink Driver:
- Set
HAS_WPA_SUPPLICANT=y
- Set
HAS_NATIVE_WPA_SUPPLICANT_SUPPORT=n
cd wpa_supplicant-0.5.7
./wpa_supplicant -Dralink -ira0 -c wpa_supplicant.conf -d
- Set
Compile the driver source code:
$ make clean
$ make
Fix "error: too few arguments to function iwe_stream_add_event"
$ patch -i os/linux/sta_ioctl.c.patch os/linux/sta_ioctl.c
$ sudo cp RT2870STA.dat /etc/Wireless/RT2870STA/RT2870STA.dat
-
[kernel 2.4]
$/sbin/insmod rt2870sta.o
$/sbin/ifconfig ra0 inet YOUR_IP up
-
[kernel 2.6]
$/sbin/insmod rt2870sta.ko
$/sbin/ifconfig ra0 inet YOUR_IP up
`$/sbin/ifconfig ra0 down`
`$/sbin/rmmod rt2870sta`
RT2870 driver can be configured via following interfaces:
iwconfig
commandiwpriv
command- configuration file
iwconfig
comes with kernel. For iwpriv
usage and details, please refer to file iwpriv_usage.txt
.
Modify configuration file RT2870STA.dat
in /etc/Wireless/RT2870STA/RT2870STA.dat
.
Copy this file to /etc/Wireless/RT2870STA/RT2870STA.dat
This file is a binary file and will be read on loading rt.o module.
Use any text editor to modify settings according to your need.
[1] Set NetworkType to Adhoc
for using Adhoc-mode, otherwise use Infra
[2] Set Channel to 0
for auto-select on Infrastructure mode
[3] Set SSID for connecting to your Access-point.
[4] AuthMode can be: * WEPAUTO * OPEN * SHARED * WPAPSK * WPA2PSK * WPANONE
[5] EncrypType can be: * NONE * WEP * TKIP * AES
For more information refer to the README file.
Example:
#The word of "Default" must not be removed
Default
CountryRegion=5
CountryRegionABand=7
CountryCode=
SSID=Dennis2860AP
NetworkType=Infra
WirelessMode=9
Channel=0
BeaconPeriod=100
TxPower=100
BGProtection=0
TxPreamble=0
RTSThreshold=2347
FragThreshold=2346
TxBurst=1
WmmCapable=0
AckPolicy=0;0;0;0
AuthMode=OPEN
EncrypType=NONE
WPAPSK=
DefaultKeyID=1
Key1Type=0
Key1Str=
Key2Type=0
Key2Str=
Key3Type=0
Key3Str=
Key4Type=0
Key4Str=
PSMode=CAM
FastRoaming=0
RoamThreshold=70
HT_RDG=1
HT_EXTCHA=0
HT_OpMode=1
HT_MpduDensity=4
HT_BW=1
HT_AutoBA=1
HT_BADecline=0
HT_AMSDU=0
HT_BAWinSize=64
HT_GI=1
HT_MCS=33
HT_MIMOPSMode=3
EthConvertMode=
EthCloneMac=
IEEE80211H=0
TGnWifiTest=0
WirelessEvent=0
MeshId=MESH
MeshAutoLink=1
MeshAuthMode=OPEN
MeshEncrypType=NONE
MeshWPAKEY=
MeshDefaultkey=1
MeshWEPKEY=
CarrierDetect=0
WMM parameters: * WmmCapable Set it as 1 to turn on WMM Qos support * AckPolicy1~4 Ack policy which support normal Ack or no Ack (AC_BK, AC_BE, AC_VI, AC_VO)
All WMM parameters do not support iwpriv command but WmmCapable, please store all parameter to RT2870STA.dat, and restart driver.
-
Value Description 0 use 1 ~ 11 Channel 1 use 1 ~ 13 Channel 2 use 10 ~ 11 Channel 3 use 10 ~ 13 Channel 4 use 14 Channel 5 use 1 ~ 14 Channel 6 use 3 ~ 9 Channel 7 use 5 ~ 13 Channel 31 use 1 ~ 14 Channel (ch1-11:active scan, ch12-14 passive scan) -
Value Description 0 use 36, 40, 44, 48, 52, 56, 60, 64, 149, 153, 157, 161, 165 Channel 1 use 36, 40, 44, 48, 52, 56, 60, 64, 100, 104, 108, 112, 116, 120, 124, 128, 132, 136, 140 Channel 2 use 36, 40, 44, 48, 52, 56, 60, 64 Channel 3 use 52, 56, 60, 64, 149, 153, 157, 161 Channel 4 use 149, 153, 157, 161, 165 Channel 5 use 149, 153, 157, 161 Channel 6 use 36, 40, 44, 48 Channel 7 use 36, 40, 44, 48, 52, 56, 60, 64, 100, 104, 108, 112, 116, 120, 124, 128, 132, 136, 140, 149, 153, 157, 161, 165 Channel 8 use 52, 56, 60, 64 Channel 6 use 36, 40, 44, 48, 52, 56, 60, 64, 100, 104, 108, 112, 116, 132, 136, 140, 149, 153, 157, 161, 165 Channel 9 use 36, 40, 44, 48, 149, 153, 157, 161, 165 Channel 10 use 36, 40, 44, 48, 52, 56, 60, 64, 100, 104, 108, 112, 116, 120, 149, 153, 157, 161 Channel 11 use 52, 56, 60, 64 Channel -
AG, AR, AW, AU, AT, BS, BB, BM, BR, BE, BG, CA, KY, CL, CN, CO, CR, CY, CZ, DK, DO, EC, SV, FI, FR, DE, GR, GU, GT, HT, HN, HK, HU, IS, IN, ID, IE, IL, IT, JP, JO, LV, LI, LT, LU, MY, MT, MA, MX, NL, NZ, NO, PE, PT, PL, RO, RU, SA, CS, SG, SK, SI, ZA, KR, ES, SE, CH, TW, TR, GB, UA, AE, US, VE
Default Settings:
[0] 2.4 G - ch 1~11
[10] 5G - ch 52
64, 100140, 149~165 -
0
z, 132 ascii characters. -
Value Description 0 legacy 11b/g mixed 1 legacy 11B only 2 legacy 11A only Not support in RfIcType=1(id=RFIC_5225) and RfIcType=2(id=RFIC_5325) 3 legacy 11a/b/g mixed Not support in RfIcType=1(id=RFIC_5225) and RfIcType=2(id=RFIC_5325) 4 legacy 11G only 5 11ABGN mixed 6 11N only 7 11GN mixed 8 11AN mixed 9 11BGN mixed 10 11AGN mixed -
Depends on CountryRegion or CountryRegionABand
-
Value Description 0 Auto 1 Always on 2 Always off -
Value Description 0 Preamble Long 1 Preamble Short 2 Auto -
1~2347
-
256~2346
-
Value Description 0 Disable 1 Enable -
Value Description Infra infrastructure mode Adhoc adhoc mode -
Value Description OPEN For open system SHARED For shared key system WEPAUTO Auto switch between OPEN and SHARED WPAPSK For WPA pre-shared key (Infra) WPA2PSK For WPA2 pre-shared key (Infra) WPANONE For WPA pre-shared key (Adhoc) WPA Use WPA-Supplicant WPA2 Use WPA-Supplicant -
Value Description NONE For AuthMode=OPEN WEP For AuthMode=OPEN or AuthMode=SHARED TKIP For AuthMode=WPAPSK or WPA2PSK AES For AuthMode=WPAPSK or WPA2PSK -
1~4
-
Values:
- 10 or 26 hexadecimal characters eg: 012345678
- 5 or 13 ascii characters eg: passd
(usage :
iwpriv
only) -
Values:
- 0 hexadecimal type
- 1 assic type
(usage : reading profile only)
-
Values:
-
10 or 26 characters (key type=0)
-
5 or 13 characters (key type=1)
(usage : reading profile only)
-
-
Value Description 8~63 ASCII 64 HEX characters -
Value Description 0 Disable WMM 1 Enable WMM -
Value Description CAM Constantly Awake Mode Max_PSP Max Power Savings Fast_PSP Power Save Mode -
Value Description 0 Disabled 1 Enabled -
Positive Integer(dBm)
-
Value Description 0 Disabled 1 Enabled -
Value Description 0 Below 1 Above -
Value Description 0 HT mixed format 1 HT greenfield formatEnabled -
Based on 802.11n D2.0
Value Description 0 no restriction 1 1/4 �gs 2 1/2 �gs 3 1 �gs 4 2 �gs 5 4 �gs 6 8 �gs 7 16 �gs -
Value Description 0 20MHz 1 40MHz -
Value Description 0 Disabled 1 Enabled -
Value Description 0 Disabled 1 Enabled -
Value Description 0 Disabled 1 Enabled -
1 ~ 64
-
0 long GI 1 short GI
-
0 ~ 15 33: auto
(based on 802.11n D2.0) 0 Static SM Power Save Mode 1 Dynamic SM Power Save Mode 2 Reserved 3 SM enabled (not fully support yet)
-
- dongle
- clone
- hybrid
-
xx:xx:xx:xx:xx:xx
-
Value Description 0 Disabled 1 Enabled -
Value Description 0 Disabled 1 Enabled -
Value Description 0 Disabled 1 Enabled -
Length 1~32 ascii characters
-
Value Description 0 Disabled 1 Enabled -
Value Description OPEN For open system WPANONE For WPA pre-shared key (Adhoc) -
Value Description NONE For MeshAuthMode=OPEN WEP For MeshAuthMode=OPEN TKIP For MeshAuthMode=WPANONE AES For MeshAuthMode=WPANONE -
8~63 ASCII
or64 HEX characters
-
1~4
-
10 or 26 characters
5 or 13 characters
-
Value Description 0 Disabled 1 Enabled
If you want for rt2870 driver to auto-load at boot time:
-
Choose ra0 as first RT2870 WLAN card, ra1 for the second RT2870 WLAN card, etc.
-
Create/Edit
ifconfig-ra0
file in/etc/sysconfig/network-scripts/
, search for the linealias ra0 xxxx
and add/edit:alias ra0 rt2870sta
-
Create/Edit these lines in the file
/etc/sysconfig/network-scripts/ifcfg-ra0
:- DEVICE='ra0'
- ONBOOT='yes'
- For DHCP use add: BOOTPROTO='dhcp'
-
To ease the Default Gateway setting, add in
/etc/sysconfig/network
:- GATEWAY=x.x.x.x
Provides a 1-to-N MAC address mapping mechanism such that more than one PC behind the STA can transparently connect to the AP.
Provides a 1-to-1 MAC address mapping mechanism. STA can use own MAC as SA MAC or use user desired MAC as SA MAC or use source MAC of first packet coming from wired device as SA MAC.
NOTE: In this mode, only the PC who own the specified MAC can connect to the AP.
Provides a 1-to-N MAC address mapping mechanism such that more than one PC behind the STA can transparently connect to the AP.STA can use own MAC as SA MAC or use user desired MAC as SA MAC or use source MAC of first packet coming from wired device as SA MAC.
Please refer to "Config STA to link as dongle mode..." in iwpriv_usage.txt for related commands.