Commit fb1c00ef authored by 薛德章's avatar 薛德章

Ralink RT73 chipset based USB WIFI driver. Fix bug 4609

This driver is got from serialmonkey. It's a CVS hourly
tarball(CVS-20080626). This patch was tested on the 2 different
USB WIFI dongle:
ASUS WL-167g (VendorID:0b05, ProductID:1723)
PLANEX GW-US54HP (VendorID:2019, ProductID:ab01)
Now support WEP 64bit and 128bit in manageed mode with
HEX key and ASCII key.
Serialmonkey Website: http://rt2x00.serialmonkey.com
parent 11c1e25e
...@@ -561,5 +561,6 @@ config RTL8187 ...@@ -561,5 +561,6 @@ config RTL8187
source "drivers/net/wireless/hostap/Kconfig" source "drivers/net/wireless/hostap/Kconfig"
source "drivers/net/wireless/bcm43xx/Kconfig" source "drivers/net/wireless/bcm43xx/Kconfig"
source "drivers/net/wireless/zd1211rw/Kconfig" source "drivers/net/wireless/zd1211rw/Kconfig"
source "drivers/net/wireless/rt73/Kconfig"
endmenu endmenu
...@@ -47,3 +47,4 @@ obj-$(CONFIG_LIBERTAS) += libertas/ ...@@ -47,3 +47,4 @@ obj-$(CONFIG_LIBERTAS) += libertas/
rtl8187-objs := rtl8187_dev.o rtl8187_rtl8225.o rtl8187-objs := rtl8187_dev.o rtl8187_rtl8225.o
obj-$(CONFIG_RTL8187) += rtl8187.o obj-$(CONFIG_RTL8187) += rtl8187.o
obj-$(CONFIG_RT73) += rt73/
/***************************************************************************
* RT2x00 SourceForge Project - http://rt2400.sourceforge.net *
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 2 of the License, or *
* (at your option) any later version. *
* *
* This program is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
* GNU General Public License for more details. *
* *
* You should have received a copy of the GNU General Public License *
* along with this program; if not, write to the *
* Free Software Foundation, Inc., *
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
* *
* Licensed under the GNU GPL *
* Original code supplied under license from RaLink Inc, 2003. *
***************************************************************************/
Changelog for 802.11g rt73 driver
Version: CVS
* Detect ARM big endian compile mode.
* Port suspend/resume from Ralink version of driver.
* More scheduling while atomic fixes: remove superfluous spin locks.
* Fix open-after-close problems.
* Reduce leaks and Oops when handling exceptions.
* "raw" debug message fixups.
* Tag all (ok, most) log messages with module name.
* Provide pre-up configuration. Do periodic functions in process
context. Fix "SIOSSIFFLAGS: Invalid argument" on kernel 2.6.24.
* Move Bulk input handling to process context. Fix thread signal
handling. More debug message routing fixes.
* Fix ARM alignment requirements for USB control input with help
from daniel_matthes.
* Debug message routing fixes.
* Handle private ioctls ok when more than one adapter attached.
* Handle 64 character keys on pre-up.
* 2.6 kernels now use /etc/modprobe.d/ralink for module alias.
* Fix 'make arm' target compile error.
* Fix big endian compiler variable propagation. Thanks to Adam Sjgren.
* Forward compatibility for 2.6.24. Thanks to Adam Baker.
* Fix incomplete queue element, multi-context service drop fix.
* Provide interface name module option parameter.
* Load firmware for 2.4 kernels. Patch by Graham Gower.
Back out problem queue element, multi-context changes till fixed.
* Propagate incomplete queue element, multi- context service drop fixes.
Patch by Ben Hutchings.
* Fix vendor and product endian conversion in probe. Patch by chris_ppc
extended to 2.4 conditional compile path.
* Fix 2.6 compile problem w/prev patch. Discovery/diagnosis/resolution
by xqterry.
* Fix Bug #1763773 - does not build on 2.6.5. Needed for early 2.6
series kernels.
* Change debug handling to conform with rt2500/rt2570 drivers.
* Forward compatibility with kernel 2.6.22-rc4 xxx_net_device macros.
* msleep & co. for selected pre- 2.4.29 kernels (InsaneBoarder234 problem).
* Forward compatibility with kernel 2.6.22-rc4 skbuff changes. Put all
version compatibility macros in rt_config.h.
* Remove cruft (again).
* Fix default Makefile target.
* Fixes for iwlist freq output
* Integration into kernel firmware loading framework
* Removal of hardcoded backup firmware
* Compatibility fixes for kernels >= 2.6.20
* Rtutilt support
* 64-bit support
* ARM fixes
* SMP/PREEMPT Support
* Compatibility fixes for kernels >= 2.6.19
* Jiffies fix for connection stability
* Packet injection support
* Prism header in RFMON
* RFMON support
* Ethtool support
* Initial baseline code from Ralink (1.0.3.6)
The rt2x00 FAQ has been moved to our Wiki. Please see http://rt2x00.serialmonkey.com/wiki/index.php/FAQ.
config RT73
tristate "Ralink RT73 chipset USB-wireless support"
depends on USB && IEEE80211_SOFTMAC && MAC80211 && WLAN_80211 && EXPERIMENTAL
select WIRELESS_EXT
select FW_LOADER
---help---
This is an experimental driver for the Ralink RT73 wireless
chip, present in many USB-wireless adapters.
Device firmware is required inside this driver: rt73.bin
config RT73_DEBUG
bool "Ralink RT73 debugging"
depends on RT73
---help---
RT73 debugging messages. Choosing Y will result in additional debug
messages being saved to your kernel logs, which may help debug any
problems.
This diff is collapsed.
obj-$(CONFIG_RT73) += rt73.o
rt73-objs := assoc.o auth.o auth_rsp.o connect.o \
md5.o mlme.o rt2x00debug.o rtmp_info.o rtmp_init.o \
rtmp_main.o rtmp_tkip.o rtmp_wep.o rtusb_bulk.o \
rtusb_data.o rtusb_io.o sanity.o sync.o wpa.o
EXTRA_CFLAGS += -DAGGREGATION_SUPPORT -DWMM_SUPPORT -DRTMP_EMBEDDED
ifeq ($(CONFIG_RT73_DEBUG),y)
EXTRA_CFLAGS += -DDBG
endif
Installation instructions for the Legacy rt73 module
[http://rt2x00.serialmonkey.com]
==================
Build Instructions
==================
1. Unpack the driver sources and go to the Module directory:
$ tar -xvzf rt73-cvs-daily.tar.gz
$ cd ./rt73-cvs-YYYYMMDDHH/Module
2. Compile the driver sources:
$ make
3. Install the driver (as root):
# make install
====================
INVOCATION
====================
Load the driver:
$ modprobe rt73 [ifname=<name>] [debug=<mask>] [firmName=<file>]
<name> is the name of the device and defaults to "wlan%d". If more
than one adapter is installed, successive devices will be named
wlan0, wlan1, etc. If you wish to use a different scheme - say
eth*, and there are already wired ethernet devices named eth0 and
eth1, then specifying <name> as "eth%d" gives the adapter the name
"eth2".
<mask> is a decimal or hex number. See TESTING file. Ignored if
driver compiled without debug support.
<file> is the name of a firmware file and defaults to "rt73.bin"
if omitted. Only the basename - not the full path - may be
specified.
Start it up:
$ ifup wlan0 # If using Debian - or
$ ifconfig wlan0 up
$ iwlist wlan0 scan
If everything is ok, you should see a list of surrounding Access
Points. It means you can jump to the configuration section. Otherwise,
check out the following install notes...
_________
NOTES:
* Firmware file (rt73.bin)
The rt73 chipset uses a firmware file which is loaded in device
memory using the kernel firmware_class facility. 'make install'
copy the firmware file to the standard firmwares location:
/lib/firmware.
However some linux distributions divert from the standard and e.g.
use /lib/firmware/<KERNEL_VERSION>. If this is your case, you will
have to manually move the firmware file to the right location.
If you have problems with firmware loading, please ask on your
distro's support media (forum, etc).
* Driver alias
rt73 uses wlan* as its modprobe alias. This means you can have
several devices and they will be named wlan0, wlan1, etc.
If for some reason you want this interface number 'static' (e.g.
if you have several wlan devices and their numbers change on
reboot) you can change the rt73 alias in /etc/modprobe.d/ralink
(2.6 kernels) or /etc/modules.conf (2.4 kernels) back to wlan0 (or
wlan1, etc).
However the proper way to achieve this purpose is to use a udev
rule based on the wlan MAC address, for example:
KERNEL=="wlan*", SYSFS{address}=="00:de:ad:be:ef:00", NAME="wlan0"
(See:
http://www.reactivated.net/writing_udev_rules.html#example-netif)
* Module parameters
You can load the rt73 module with two optional parameters:
firmName=<FILE_NAME> Use another firmware file.
debug=<DEBUG_MASK> Set debug verbosity (see below).
==============================
Wireless Station Configuration
==============================
The wlan interface should be configured using standard wireless
extension tools.
GUI CONFIG:
If you're looking for a GUI config tool we provide RutilT on our
download page
[http://rt2x00.serialmonkey.com/wiki/index.php/Downloads].
MANUAL CONFIG:
1. Set the interface mode and bring it up
# iwconfig wlan0 mode managed
# ifconfig wlan0 up
2. Set your target network / Access Point
If you just want to join a wireless network, set its ESSID:
# iwconfig wlan0 essid <ESSID>
If you want to associate with a specific AP, set its MAC
address:
# iwconfig wlan0 ap <BSSID>
3. Set encryption if needed
a) WEP (802.11b)
Choose the authentication mode (open/restricted):
# iwconfig wlan0 key open
Or:
# iwconfig wlan0 key restricted
Set the encryption key:
# iwconfig wlan0 key <KEY>
b) WPA (802.11g)
Set the authentication mode:
# iwpriv wlan0 set AuthMode=WPAPSK
Set the encryption key:
# iwpriv wlan0 set WPAPSK=<KEY>
Set the encryption type:
# iwpriv wlan0 set EncrypType=TKIP
c) WPA2 (802.11i)
Set the authentication mode:
# iwpriv wlan0 set AuthMode=WPA2PSK
Set the encryption key:
# iwpriv wlan0 set WPAPSK=<KEY>
Set the encryption type:
# iwpriv wlan0 set EncrypType=AES
4. Check that you're associated with an AP
# iwconfig wlan0
If everything's ok, you can now configure the wlan0 interface
statically or dynamically (DHCP). If you need more wireless config
details and examples (Adhoc mode e.g.), see iwpriv_usage.txt (included
in driver sources). Otherwise, read the following config notes...
_________
NOTES:
* Auto-load on boot
If you want your device to come up on boot the best is to use your
specific linux distribution's tools (boot scripts, etc).
If you need support doing so, ask on your distro's support media.
* wpa_supplicant
wpa_supplicant is a userland WPA/WPA2/802.1X layer. This driver is
not compatible with it. As most wpa_supplicant features are
embedded into our driver, you should not need it though.
If you need to use a feature that only wpa_supplicant provides:
- either use our next-generation rt2x00 driver which
is compatible with wpa_supplicant
- or patch wpa_supplicant to make it work with rt73 (more info:
http://mjh.name/Ralink_rt73_wpa_supplicant_rt2x00_wpa2)
==================
Misc. information
==================
* hostapd
hostapd allows your wlan device to act like an Access Point. Legacy
drivers are _not_ compatible with it, but our next-generation
rt2x00 drivers are.
* Network auditing
Our drivers allow you to peform in-depth wireless network auditing.
Most of the following settings require that you bring the
interface down beforehand.
You can set a custom MAC address as you would do for any other
ethernet interface:
# ifconfig wlan0 hw ether <MAC_ADDRESS>
You can put your wlan interface in promiscuous mode as you would
do for any other interface:
# ifconfig wlan0 promisc
You can put your interface in monitor mode and have it listen to all
802.11 frames around:
# iwconfig wlan0 mode monitor
You can also inject 802.11 frames on the fly. To enable injection,
run:
# iwpriv wlan0 rfmontx 1
* Testing / debugging
If you experience any driver related problem you can ask for
support on our mailing list or our legacy driver forum.
Before asking for help, read the TESTING file and follow its
advice. Do *not* post messages like: "wlan does not work. please
help!".
Below are the steps you need to follow to help out the team with
testing/debugging of the rt73 kernel module:
1. Get the latest source from the CVS tree.
Easiest way to do this is to download the hourly tarball from our
website: http://rt2x00.serialmonkey.com/rt73-cvs-daily.tar.gz
Alternatively, you can anonymously check out the current CVS code:
cvs -d:pserver:anonymous@rt2400.cvs.sourceforge.net:/cvsroot/rt2400 login
cvs -z3 -d:pserver:anonymous@rt2400.cvs.sourceforge.net:/cvsroot/rt2400 \
co -P source/rt73
2. Compile the module with debug logging:
$ make clean
$ make debug
3. Ensure there are no copies of the module left in memory:
# ifconfig wlan0 down
# rmmod rt73
4. Load the module with full debug enabled:
# insmod rt73.ko debug=31
Then proceed as usual (config, ifup, etc)...
5. Check the debug output.
It is located in your system log file (most likely /var/log/debug
or /var/log/syslog). If you don't see any debug you probably need
to add the following line to your /etc/syslog.conf and reboot:
kern.=debug /var/log/debug
If you system hard-locks before it's able to log anything
interesting in these files, you'll have to rely on the netconsole
module to remotely log your kernel messages to another box (see
netconsole.txt in your kernel sources Documentation folder).
6. Report the following to the rt2400-devel mailing list (or rt73
forum):
* Steps to reproduce the bug
* The _whole_content_ of your debugging output
* Your module details, i.e. the output of:
# modinfo rt73.ko
* Your kernel details, i.e. the output of:
$ uname -a
* Your rt73 hardware manufacturer, model and revision
* Anything else you think may help us resolve the issue (even a
patch if you are so inclined)
7. Monitor the mailing list (or forum thread) for replies/further
queries. :-)
Whenever we do major changes to the source - and always just before a
release - we will call for testing to be done before we make the
general release. You're very much welcome to help us with this testing
and report any success/issue you experience with this code.
!!!! NOTE !!!!
AS PER STEP 6 ABOVE: Please provide the *whole* debug output! The last
few lines are hardly any good.
If it's large (which it will be) then GZip it. Either attach it to
your forum post or, if you're going to report via the mailing list,
upload it somewhere and give a link to it (or email it directly to the
developer you are working with).
!!!! END NOTE !!!!
This diff is collapsed.
This diff is collapsed.
/***************************************************************************
* RT2x00 SourceForge Project - http://rt2x00.serialmonkey.com *
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 2 of the License, or *
* (at your option) any later version. *
* *
* This program is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
* GNU General Public License for more details. *
* *
* You should have received a copy of the GNU General Public License *
* along with this program; if not, write to the *
* Free Software Foundation, Inc., *
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
* *
* Licensed under the GNU GPL *
* Original code supplied under license from RaLink Inc, 2004. *
***************************************************************************/
/***************************************************************************
* Module Name: auth_rsp.c
*
* Abstract:
*
* Revision History:
* Who When What
* -------- ---------- -----------------------------
* Name Date Modification logs
*
***************************************************************************/
#include "rt_config.h"
/*
==========================================================================
Description:
authentication state machine init procedure
Parameters:
Sm - the state machine
Note:
the state machine looks like the following
AUTH_RSP_IDLE AUTH_RSP_WAIT_CHAL
MT2_AUTH_CHALLENGE_TIMEOUT auth_rsp_challenge_timeout_action auth_rsp_challenge_timeout_action
MT2_PEER_AUTH_ODD peer_auth_at_auth_rsp_idle_action peer_auth_at_auth_rsp_wait_action
MT2_PEER_DEAUTH peer_deauth_action peer_deauth_action
==========================================================================
*/
VOID AuthRspStateMachineInit(
IN PRTMP_ADAPTER pAd,
IN PSTATE_MACHINE Sm,
IN STATE_MACHINE_FUNC Trans[])
{
ULONG Now;
StateMachineInit(Sm, (STATE_MACHINE_FUNC*)Trans, MAX_AUTH_RSP_STATE, MAX_AUTH_RSP_MSG, (STATE_MACHINE_FUNC)Drop, AUTH_RSP_IDLE, AUTH_RSP_MACHINE_BASE);
// column 1
StateMachineSetAction(Sm, AUTH_RSP_IDLE, MT2_PEER_DEAUTH, (STATE_MACHINE_FUNC)PeerDeauthAction);
// column 2
StateMachineSetAction(Sm, AUTH_RSP_WAIT_CHAL, MT2_PEER_DEAUTH, (STATE_MACHINE_FUNC)PeerDeauthAction);
// initialize the random number generator
Now = jiffies;
LfsrInit(pAd, Now);
}
/*
==========================================================================
Description:
==========================================================================
*/
VOID PeerAuthSimpleRspGenAndSend(
IN PRTMP_ADAPTER pAd,
IN PHEADER_802_11 pHdr80211,
IN USHORT Alg,
IN USHORT Seq,
IN USHORT Reason,
IN USHORT Status)
{
HEADER_802_11 AuthHdr;
UINT FrameLen = 0;
PUCHAR pOutBuffer = NULL;
USHORT NStatus;
// allocate and send out Auth_Rsp frame
NStatus = MlmeAllocateMemory(pAd, (PVOID)&pOutBuffer); //Get an unused nonpaged memory
if (NStatus != NDIS_STATUS_SUCCESS)
return;
if (Reason == MLME_SUCCESS)
{
DBGPRINT(RT_DEBUG_TRACE, "Send AUTH response (seq#2)...\n");
MgtMacHeaderInit(pAd, &AuthHdr, SUBTYPE_AUTH, 0, pHdr80211->Addr2, pAd->MlmeAux.Bssid);
MakeOutgoingFrame(pOutBuffer, &FrameLen,
sizeof(HEADER_802_11), &AuthHdr,
2, &Alg,
2, &Seq,
2, &Reason,
END_OF_ARGS);
MiniportMMRequest(pAd, pOutBuffer, FrameLen);
}
else
{
DBGPRINT(RT_DEBUG_TRACE, "Peer AUTH fail...\n");
return;
}
}
/*
==========================================================================
Description:
==========================================================================
*/
VOID PeerDeauthAction(
IN PRTMP_ADAPTER pAd,
IN PMLME_QUEUE_ELEM Elem)
{
UCHAR Addr2[MAC_ADDR_LEN];
USHORT Reason;
if (PeerDeauthSanity(pAd, Elem->Msg, Elem->MsgLen, Addr2, &Reason))
{
if (INFRA_ON(pAd) && MAC_ADDR_EQUAL(Addr2, &pAd->PortCfg.Bssid))
{
DBGPRINT(RT_DEBUG_TRACE,
"AUTH_RSP - receive DE-AUTH from our AP Reason=%d\n",
le16_to_cpu(Reason));
LinkDown(pAd, TRUE);
}
}
else
{
DBGPRINT(RT_DEBUG_TRACE,"AUTH_RSP - PeerDeauthAction() sanity check fail\n");
}
}
This diff is collapsed.
iwpriv
=================
This is detailed explanation of each parameters for iwpriv.
Before reading this document, make sure you already read README.
-------------------------------------------------------------------------------------------------------
USAGE_1:
iwpriv wlan0 set [parameters]=[val]
NOTE:
Execute one iwpriv/set command simultaneously.
DESCRIPTION
[parameters] [val] /{range}
----------------- -------------------------------------------------
CountryRegion {0~7}
::Set country region
0: 1 ~ 11 ch
1: 1 ~ 13 ch
2: 10, 11 ch
3: 10 ~ 13 ch
4: 14 ch
5: 1 ~ 14 ch
6: 3 ~ 9 ch
7: 5 ~ 13 ch
CountryRegionABand {0~10}
::Set country region for A band
0: 36, 40, 44, 48, 52, 56, 60, 64, 149, 153, 157, 161, 165 ch
1: 36, 40, 44, 48, 52, 56, 60, 64, 100, 104, 108, 112, 116, 120, 124, 128, 132, 136, 140 ch
2: 36, 40, 44, 48, 52, 56, 60, 64 ch
3: 52, 56, 60, 64, 149, 153, 157, 161 ch
4: 149, 153, 157, 161, 165 ch
5: 149, 153, 157, 161 ch
6: 36, 40, 44, 48 ch
7: 36, 40, 44, 48, 52, 56, 60, 64, 100, 104, 108, 112, 116, 120, 124, 128, 132, 136, 140, 149, 153, 157, 161, 165 ch
8: 52, 56, 60, 64 ch
9: 34, 38, 42, 46 ch
10: 34, 36, 38, 40, 42, 44, 46, 48, 52, 56, 60, 64 ch
SSID {0~z, 1~32 ascii characters}
::Set AP SSID
WirelessMode {0~4}
::Set Wireless Mode
0:11b/g mixed,
1:11B only,
2:11A only
3:11a/b/g mixed,
4:11G only
TxRate {0~12}
::Set TxRate of Infrastructure mode
0:Auto, 1:1Mbps,
2:2Mbps, 3:5.5Mbps,
4:11Mbps, 5:6Mbps,
6:9Mbps, 7:12Mbps,
8:18Mbps, 9:24Mbps,
10:36Mbps, 11:48Mbps,
12:54Mbps
Channel depends on CountryRegion or CountryRegionABand
::Set Channel
BGProtection {0~2}
::Set 11B/11G Protection
0:Auto,
1:Always on,
2:Always off
TxPreamble {0~2}
::Set TxPreamble
0:Preamble Long,
1:Preamble Short,
2:Auto
RTSThreshold {1~2347}
::Set RTS Threshold
FragThreshold {256~2346}
::Set Fragment Threshold
TxBurst {0,1}
::Set TxBurst Enable or Disable
0:Disable,
1:Enable
NetworkType {Infra,Adhoc}
::Set Network type
AdhocOfdm {0~3}
::Set Adhoc Wireless Mode
0: WIFI mode(11b rates only),
1: b/g mixed,
2: 11g only,
3: 11a only
AuthMode {OPEN,SHARED,WEPAUTO,WPAPSK,WPA2PSK,WPANONE}
::Set Authentication Mode
EncrypType {NONE,WEP,TKIP,AES}
::Set Encryption Type
DefaultKeyID {1~4}
::Set Default Key ID
Key1 {5 ascii characters or 10 hex number or
13 ascii characters or 26 hex numbers}
::Set Key1 String
Key2 {5 ascii characters or 10 hex number or
13 ascii characters or 26 hex numbers}
::Set Key2 String
Key3 {5 ascii characters or 10 hex number or
13 ascii characters or 26 hex numbers}
::Set Key3 String
Key4 {5 ascii characters or 10 hex number or
13 ascii characters or 26 hex numbers}
::Set Key4 String
WPAPSK {8~63 ascii or 64 hex characters}
::WPA Pre-Shared Key
PSMode {CAM, MAX_PSP, FAST_PSP}
::Set Power Saving Mode
IEEE80211H {0,1}
::Set IEEE80211H Enable or Disable
0: Disable
1: Enable spectrum management
(This field can be enable only in A band)
-------------------------------------------------------------------------------------------------------
USAGE_2:
iwpriv wlan0 [parameters] [val]
DESCRIPTION
[parameters] [val] range explaination
----------------- ----------------------- ------------------------------------------
auth {1~5} 1:OPEN Authentication Mode
2:SHARED
3:WPAPSK
4:WPA2PSK
5:WPANONE
enc {1~4} 1:NONE Encryption Type
2:WEP
3:TKIP
4:AES
wpapsk {8~64 chars} WPAPSK/WPA2PSK Password
psm {0~2} 0:constantly awake mode (CAM) Power Saving Mode
1:MAX_PSP
2:FAST_PSP
-------------------------------------------------------------------------------------------------------
Examples
=================
-------------------------------------------------------------------------------------------------------
a> Config STA to link with AP which is OPEN/NONE(Authentication/Encryption)
1. iwpriv wlan0 set NetworkType=Infra
2. iwpriv wlan0 set AuthMode=OPEN
3. iwpriv wlan0 set EncrypType=NONE
4. iwpriv wlan0 set SSID="AP's SSID"
b> Config STA to link with AP and OPEN/WEP(Authentication/Encryption).
Default Key ID = 3
1. iwconfig wlan0 key [3]
2. iwconfig wlan0 key s:abcde
3. iwconfig wlan0 essid "AP's SSID"
c> Config STA to link with AP which is SHARED/WEP(Authentication/Encryption).
1. iwpriv wlan0 set NetworkType=Infra
2. iwpriv wlan0 set AuthMode=SHARED
3. iwpriv wlan0 set EncrypType=WEP
4. iwpriv wlan0 set Key1="AP's wep key"
5. iwpriv wlan0 set DefaultKeyID=1
6. iwpriv wlan0 set SSID="AP's SSID"
d> Config STA to link with AP which is WPAPSK/TKIP(Authentication/Encryption)
1. iwpriv wlan0 set NetworkType=Infra
2. iwpriv wlan0 set AuthMode=WPAPSK
3. iwpriv wlan0 set EncrypType=TKIP
4. iwpriv wlan0 set SSID="AP's SSID"
5. iwpriv wlan0 set WPAPSK="12345678"
6. iwpriv wlan0 set SSID="AP's SSID"
p.s Step 4 is part of generating wpapsk password and is necessary.
e> Config STA to link with AP which is WPAPSK/AES(Authentication/Encryption)
1. iwconfig wlan0 mode managed
2. iwpriv wlan0 auth 3
3. iwpriv wlan0 enc 4
4. iwconfig wlan0 essid "AP's SSID"
5. iwpriv wlan0 wpapsk 12345678
6. iwconfig wlan0 essid "AP's SSID"
f> Config STA to link with AP which is WPA2PSK/TKIP(Authentication/Encryption)
1. iwpriv wlan0 set NetworkType=Infra
2. iwpriv wlan0 set AuthMode=WPA2PSK
3. iwpriv wlan0 set EncrypType=TKIP
4. iwpriv wlan0 set SSID="AP's SSID"
5. iwpriv wlan0 set WPAPSK="12345678"
6. iwpriv wlan0 set SSID="AP's SSID"
g> Config STA to create/link as adhoc mode, which is OPEN/NONE(Authentication/Encryption)
1. iwpriv wlan0 set NetworkType=Adhoc
2. iwpriv wlan0 set AuthMode=OPEN
3. iwpriv wlan0 set EncrypType=NONE
4. iwpriv wlan0 set SSID="Adhoc's SSID"
h> Config STA to create/link as adhoc mode, which is WPANONE/TKIP(Authentication/Encryption)
1. iwpriv wlan0 set NetworkType=Adhoc
2. iwpriv wlan0 set AuthMode=WPANONE
3. iwpriv wlan0 set EncrypType=TKIP
4. iwpriv wlan0 set SSID="AP's SSID"
5. iwpriv wlan0 set WPAPSK=12345678
6. iwpriv wlan0 set SSID="AP's SSID"
i> Get site survey
iwpriv wlan0 get_site_survey
j> Get Statistics
iwpriv wlan0 stat ; read statistic counter
iwpriv wlan0 set ResetCounter=0 ; reset statistic counter
k> Link with any AP without security ; set ANY SSID (ssidLen=0)
usage: iwconfig ra0 essid ""
or
usage: iwpriv ra0 set SSID=""
===================================================================
iwlist
=================
This is detailed explanation of each parameters for iwlist.
-------------------------------------------------------------------------------------------------------
iwlist wlan0 scanning ; list the results after scanning(manual rescan)
=======================================================================================================
iwconfig
=================
The following are our support in standard configuration - iwconfig
-------------------------------------------------------------------------------------------------------
iwconfig wlan0 essid {NN|on|off} ; set ssid
iwconfig wlan0 mode {managed|ad-hoc|...} ; set wireless mode
iwconfig wlan0 freq N.NNNN[k|M|G]] ; set frequency
iwconfig wlan0 channel N ; set channel
iwconfig wlan0 ap {N|off|auto} ; set ap address
iwconfig wlan0 nick N ; set nickname
iwconfig wlan0 rate {N|auto|fixed} ; set rate
iwconfig wlan0 rts {N|auto|fixed|off} ; set rts threshold
iwconfig wlan0 frag {N|auto|fixed|off} ; set fragment threshold
iwconfig wlan0 enc {NNNN-NNNN|off} ; set encryption type
iwconfig wlan0 power {period N|timeout N} ; set power management modes
iwconfig wlan0 key {[id]|s:pswd|pswd} ; set wep key
*** Please refer to man page of 'iwconfig', 'iwlist' and 'iwpriv'. ***
This diff is collapsed.
/***************************************************************************
* RT2x00 SourceForge Project - http://rt2x00.serialmonkey.com *
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 2 of the License, or *
* (at your option) any later version. *
* *
* This program is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
* GNU General Public License for more details. *
* *
* You should have received a copy of the GNU General Public License *
* along with this program; if not, write to the *
* Free Software Foundation, Inc., *
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
* *
* Licensed under the GNU GPL *
* Original code supplied under license from RaLink Inc, 2004. *
***************************************************************************/
/***************************************************************************
* Module Name: md5.h
*
* Abstract:
*
* Revision History:
* Who When What
* -------- ---------- -----------------------------
*
***************************************************************************/
#ifndef MD5_H
#define MD5_H
#define MD5_MAC_LEN 16
#define SHA_DIGEST_LEN 20
struct MD5Context {
u32 buf[4];
u32 bits[2];
u8 in[64];
};
void MD5Init(struct MD5Context *context);
void MD5Update(struct MD5Context *context, unsigned char *buf, unsigned len);
void MD5Final(unsigned char digest[16], struct MD5Context *context);
void MD5Transform(u32 buf[4], u32 in[16]);
typedef struct MD5Context MD5_CTX;
void md5_mac(u8 *key, size_t key_len, u8 *data, size_t data_len, u8 *mac);
void hmac_md5(u8 *key, size_t key_len, u8 *data, size_t data_len, u8 *mac);
//
// SHA context
//
typedef struct
{
ULONG H[5];
ULONG W[80];
INT lenW;
ULONG sizeHi, sizeLo;
} SHA_CTX;
VOID SHAInit(SHA_CTX *ctx);
VOID SHAHashBlock(SHA_CTX *ctx);
VOID SHAUpdate(SHA_CTX *ctx, unsigned char *dataIn, int len);
VOID SHAFinal(SHA_CTX *ctx, unsigned char hashout[20]);
#endif // MD5_H
#ifndef _AES_H
#define _AES_H
typedef struct
{
uint32 erk[64]; // encryption round keys
uint32 drk[64]; // decryption round keys
int nr; // number of rounds
}aes_context;
int aes_set_key( aes_context *ctx, uint8 *key, int nbits );
void aes_encrypt( aes_context *ctx, uint8 input[16], uint8 output[16] );
void aes_decrypt( aes_context *ctx, uint8 input[16], uint8 output[16] );
void hmac_sha1(unsigned char *text, int text_len, unsigned char *key, int key_len, unsigned char *digest);
void F(char *password, unsigned char *ssid, int ssidlength, int iterations, int count, unsigned char *output);
int PasswordHash(char *password, unsigned char *ssid, int ssidlength, unsigned char *output);
#endif // aes.h
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment