*******************************************************************
Setting Up and Using LINUX DRIVERS For The RT2400-based 802.11b PCI andPCMCIA Wireless Network Adaptors
*******************************************************************
- A HOWTO for the Open Source code (1.1.1-b1) will be drafted and available in the next 1-2 days.
*******************************************************************
v0.01 - 18/02/2004 Steve Withers, Kapiti, New Zealand
v0.02 - 19/02/2004
- Corrected the kmalloc patch URL (Section C)
- revised the compile instructions (Sections E and F)
- revised the first interface startup instructions (Section G)
v0.03 - 20/02/2004
- reformatted the instructions for obtaining the source code (Section 'B')
- minor change to comment regarding console command (Section H)
v0.03-1 - 20/02/2004
- Added Section I - a simple command list / script by "~tv~" to be run at startup
v0.03-2 - 22/02/2004
- Added reference to encryption to Section G
v0.03-3 - 24/02/2004 (serial)
- Updated insmod section
v0.03-4 - 24/02/2004
- change "insmod" to 'modprobe' in the sample script - Section H and I
v0.04 - 01/03/2004
- Revised Section H to include reference to modules.conf, the wireless startup script and placement for automatic operation.
v0.1 - 27/04/2004
- reviewed and revised in light of a couple of months experience.
- A HOWTO for the Open Source code (1.1.1-b1) will be drafted and available in the next 1-2 days.
******************************************************************
NOTE: These instructions assume static IP addressing is being used.
If you try these instructions and they don't work, please let me know at what point things went wrong - if you're able to tell.
A. Can you compile software?
*******************************
Make sure your system has the kernel source and gcc compiler installedand working correctly. If you installed your system as a "developer workstation" or "everything" or some similar option, you should be OK. If not, check what you need to do for your distro. Many, if not mostwill be ready to go.
If you don't know, carry on with these instructions and it will become obvious if you're not set up right as your attempts to compile with"make" will fail. (The instructions below worked on Xandros Linux 2.0 (Debian). Consultthe forums at
www.xandros.com for information on how to install andcorrectly configure the kernel source if you are using Xandros 2.0.)
Xandros 2.0 Specific Info:
***************************
For Xandros, in particular, you must download:
1 The "C/C++ Development Tools". They are in the "Xandros Networks" software tree under "New Appilications" -> "Development".
2. The relevant kernel source for the installed kernel ("uname -a" at a command prompt will tell you what kernel you have).
3. Install the QT3 development tools. In Xandros Networks, search on "qt3" and look at the 'expert view' list of search results. You will see "libqt3-mnt-dev". You can't compile the "RaConfig" utility if this is not installed.
Setting up software compilation on Xandros 2.0 - logged in a root:
1. Extract the kernel source into /usr/src. If required, rename the resulting /usr/src/xandros-kernel-source-2.4.24 (or whatever) directory so that it matches the running kernel version (in this case 2.4.24-x1).
2. From the /usr/src directory, make a symbolic link called "/usr/src/linux" that points to this source directory:
ln -sf /usr/src/xandros-kernel-source-2.4.24-x1 linux
3. Copy the "/boot/config-2.4.24-x1" file to /usr/src/linux as ".config"
4. In /usr/src/linux, run "make oldconfig"
5. Then run "make dep"
6. Run "depmod -a"
You should now be ready to compile the rt2400 module and related configuration utility, RaConfig, on your Xandros 2.0 Linux system - as per the instructions below.
B. Getting the driver Source Code
***************************************
Go to
http://www.minitar.com/index.php?maincat=download and get this file:
"Linux Source code for PCI and PCMCIA Wireless cards - v1.1.0(5/2/2004)" Download (0.17MB)
C. Getting the 'kmalloc Patch'
**********************************
Save the text at this URL as a file. I did a "save link target as..." on this link from the Minitar forums to save the file to my hard drive via my browser.
http://home.austarnet.com.au/screwba...-kmalloc.patch
D. Preparing to Compile
*****************************
1. Extract the source. It will create a folder called /rt2400_linux.This folder will contain two subfolders: Module and Utility
2. Copy the kmalloc file into the /rt2400_linux folder.
3. If you are NOT using Red Hat Linux, then make the following manual changes to the files designated in the /rt2400_linux/Utility folder. It is more or less obvious where they need to go. Think 'like with like'and you should be fine. Left is what you need to add and right is whatfile you need to add it to:
#include <malloc.h> (added to Utility/qhexvalidator.cpp)
#include "errno.h" (added to Utility/raconfigform.cpp)
#include <errno.h> (added to Utility/raconfig.cpp)
4. Apply the kmalloc patch from within the /rt2400_linux folder:
patch -p0 < rt2400_linux-1.1.0-kmalloc.patch (or the filename u gave it)
You should now be ready to compile the driver module and the RaConfig utility.
E. Compile the RT2400 Module
*********************************
Open a console or xterm (a command prompt window).
A more or less standard way of compiling software has been developed. You execute a series of commands - usually in the directory where "Configure" script is for the source you extracted.
1. ./Configure (checks your system to see if "make" has what it needs)
2. make (compiles and links the source into executable program files)
3. use "su" to make yourself super-user (root)
4. make install (This runs a script that places the compiled files where they can be used. If not on Red hat Linux, the module will be put in the right place, but the boot script setup will fail. That is probably a good thing - depending on your distro)
5. Exit from super user by typing 'exit'.
If the above commands worked without an error (other than failing to place the boot script on non-Red Hat systems), the driver should now be compiled and in place.
NOTE: The ./Configure will probably not work if your kernel source is not properly installed. Otherwise...carry on with the make as above.
F. Compile the RaConfig utility
********************************
Open a console or xterm (a command prompt window).
1. As in E., above, this time do a ./Configure in the Utility folder. It will ask you where to find QT3.1 or later. On Xandros 2.0 this is in /usr/share/qt3. Locate qt3 on your system - or install it if you need to - and provide the correctpath to it. QT is a package that supports the development of GUI (graphical user Interface) applications - like RaConfig.
2. Carry on with the other steps if the Configure succeeds:
1. make
2 'su' to super-user
3. make install
4. exit super user mode by typing 'exit'.
You should now have the RaConfig utility compiled and in place.
NOTE: You can run this utility as a regular user.
G. Bringing up the wireless interface the first time
****************************************************
NOTE: Encryption - I have not used encryption of any sort in the setup so far, in an effort to avoid complicating any connection issues. Once we have the device operating properly, adding encryption is straightforward - as in the documentation.
1. In a console or xterm, 'su' to super user and enter "modprobe rt2400". This should load the wireless module. Listing the modules using "lsmod" should see "rt2400" at the top of the list with status "(unused)". You should also add the following line to your /etc/modules.conf such that ra0 is associated with your newly compiled module.
alias ra0 rt2400
2. Bring up the network interface - still as super user - with:
ifconfig ra0 up
3. Run "RaConfig" to create a profile: ESSID, channel, link speed,etc... You may not be able to set all these within RaConfig. If you find you can't, not to worry, you can use the "iwconfig" command to do it later.
On the "Profiles" page in the gui utility, Set the profile as"active" after you have saved it. You do need to save a profile and set it to 'active'.
4. On the "Site Survey" page, if there is no AP (wireless Access Point) already visible, try clicking on "Rescan".....if it is not greyed out. If it is greyed out, theny our driver module probably isn't talking correctly to the wireless card and it can't see the AP. If it CAN see the AP, then click on "Connect" and RaConfig will retain knowledge of this AP.
5. At this point, do an "iwconfig ra0" to see if the card has picked upthe ESSID you set in RaConfig. If not, then do this:
iwconfig ra0 ESSID <your ESSID>
You may get a message saying the card is busy. If you do, then:
a. ifconfig ra0 down
b. ifconfig ra0 up
c. iwconfig ra0
(NOTE: I've noticed that later, once encryption is set, this "busy" condition no longer occurs every time.....though I have not nailed down whether it is warm boot vs cold boot or some other variable)
You should now see the ESSID you specified has been set. I don't why it won't accept the ESSID without restarting the interface, but this is how I have got round it and it works every time.
6. We're almost there. Now we configure the network.
ifconfig ra0 <ip address> netmask <255.whatever.0> broadcast <broadcast IP.255>
NOTE: I use static IP addresses. If you use DHCP, these instructions won't be much use from here. I'd appreciate some advice on how to proceed with DHCP.
Carrying on with the static IP setup....Try pinging another IP address on your network if you have one active...and if it's OK, then add a network definition to the ra0 interface:
route add -net <net - eg: 10.1.1.0/24> gw <eg: 10.1.1.1>
Then add a default route:
route add default gw <gateway ip>
H: Last Steps - Assuming all went well above
***********************************************
1. Update /etc/modules.conf by adding:
alias ra0 rt2400
as a new line.
On my Xandros 2.0 Linux system, I had to manually update "/etc/modutils/aliases" as Xandros 2.0 generates modules.conf each time it boots and uses this file as a base list for all permanently-required modules. But check to make sure your Linux distro hasn't ALREADY added it before adding it (again).
2. The following script should work fine. Give it a name, then - as root:
a. Copy it to a directory on your PATH (eg: /usr/local/bin)
b. Make it executable by adding the x permission either via the GUI or using CHMOD
c. add this script to your system's startup script set. On Xandros 2.0 this is /etc/init.d/bootmisc.sh. On your distro it will likely be something else.
NOTE: This version also includes encryption which the above HOWTO does not address as it is intended only to get you to the point where your RT2400 wireless adaptor is functioning on a network.
Here's the script:
#!/bin/sh
#bring up the card so iwconfig works with it
ifconfig ra0 up
#set wireless params as needed
#some parameters are dependent on others so the order may be important,
#particularly be sure to set at least the mode and authentication-type #BEFORE you start scanning
iwconfig ra0 mode Managed
#key and encryption optional
iwconfig ra0 key [1] xxxxxxxxxxxxxxxxxxxxxxxxx
iwconfig ra0 enc restrict
#setting the essid starts scanning
iwconfig ra0 essid YOUR_ESSID
#settings for static IP
ifconfig ra0 xxx.xxx.xxx.xxx netmask xxx.xxx.xxx.xxx broadcast xxx.xxx.xxx.xxx
## Now....you can:
route add -net <net - eg: 10.1.1.0/24> gw <eg: 10.1.1.1>
## Then add a default route:
route add default gw <gateway ip>
## ....OR.....
#if only card, or really is your default uplink:
ip route add default via yyy.yyy.yyy.yyy dev ra0
**************************************************************
Steve Withers :-)