LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Wireless Networking (https://www.linuxquestions.org/questions/linux-wireless-networking-41/)
-   -   Simple HOWTO for 2.4.x kernels. (https://www.linuxquestions.org/questions/linux-wireless-networking-41/simple-howto-for-2-4-x-kernels-163192/)

DigitalVixen 03-27-2004 07:46 PM

Simple HOWTO for 2.4.x kernels. (Most cards)
 
Edit : This is NOT for the 2.6 series kernel! 2.6 handles modules very differently and this how-to will NOT work!!

This is a simple HOWTO to get your wireless card working in Linux.
All commands are given between `` '' and you'll have to edit most of them to suit your system. If you have any questions or adds to this HOW-TO, just post them below.
I should also add, that these drivers support a wide range of cards, and also should work independant on distribution, although things might have to be done slightly different for different distributions.

First off, we need a few programs;
wireless tools - you can download, search freshmeat for ``iwconfig'' and you'll find them.

Download and untar them using ``tar zxvf wireless_tools.26.tar.gz''
Now you can remove the downloaded file, you don't need it anymore ``rm wireless_tools.26.tar.gz''
Change directory to wireless_tools.26, ``cd wireless_tools.26''.
Now compile and install it using ``make && make install''.
If you get any errors, read the INSTALL file in the same directory, if all went well, we can cd out of the dir and delete it ``cd .. && rm -rf wireless_tools.26''.

Next we need to get the drivers, these are best to get from cvs.
If you have cvs installed, this command will download them for you ``cvs -z3 -d:pserver:anonymous@cvs.sourceforge.net:/cvsroot/madwifi co madwifi''.
CD into the new directory that was made ``cd madwifi''.
Now you need to figure a few things out on your own; what kernel version (KERNELRELEASE) you have and where the sources are (KERNELPATH). You will also have to know wheter your distribution uses /usr/local/bin or just /usr/bin (TOOLPREFIX), and finally you need to know what sort of CPU you are building for (TARGET). If it is x86 then we will use i386-elf. When you know these things do ``export KERNELPATH=/path/to/sources && export KERNELRELEASE=2.4.x && export TOOLPREFIX=/usr/bin/ && export TARGET=i386-elf''. and change everything after the '=' to what you need.
Now it should be safe to build it with make, ``make && make install''.
You may have to copy hal/linux/<your target arch>.opt_ah.h to hal/linux/opt_ah.h
``cp hal/linux/i386-elf.opt_ah.h hal/linux/opt_ah.h && make && make install''.

Now the drivers should be complete and ready to be used, now we test to load the new modules which should be in /lib/modules/<kernel number>/net. If they are modprobe will suffice, else you might have to locate them with ``find / -iname ath_hal.o'' and go to that directory.

Use modprobe first ``modprobe wlan && modprobe ath_hal && modprobe ath_pci''. Note that wlan and ath_hal must be loaded before ath_pci is.

If this doesn't work, change dir as I described above and do ``insmod wlan && insmod ath_hal && ath_pci''.

If they complain about symbolic links, you need to recompile your kernel. Edit the .config file in your kernel source directory and look for the line CONFIG_MODVERSIONS= make sure it says ``n''. If it doesn't, change the ``y'' to ``n'' and recompile your kernel. Note; you only need to remake your image! ``make bzImage''. Copy it to the correct place and reboot Linux.
Now you just might have to redo the wireless drivers, which is why we haven't deleted that directory yet, go back up and redo those steps.
After reboot you can test loading the modules again, if no errors you don't have to recompile your drivers.

Next, get the card up and running.
If you have another ethernet card running, it appears you will need to turn it off ``route del -net default && ifconfig eth0 down''.

There are now two ways to get an IP# to your netcard, either setting it by hand or get it from a DHCP server, i'll describe the latter first.

Bring up the interface first ``ifconfig ath0 up''.
If you want to use anything else than 802.11a, you need to specify a mode with ``iwpriv ath0 mode X''. Find out what you should replace X with by reading the manpages for iwconfig ``man iwconfig'' look for ``mode''.

Set your essid (ssid applys here too) ``iwconfig ath0 essid any''. You can replace ``any'' with your own essid but then you need to use "" around the name ``iwconfig ath0 essied "Digital"''.

If you have a wep key, set it now ``iwconfig ath0 key XXXXX''. Replace XXXXX with your WEP key.

Set the channel you want to use ``iwconfig ath0 channel 5''. Replace 5 with your channel.

If you want to specify bitrate (you do) use ``iwconfig ath0 rate 24MB''. Replace 24 with your bitrate.

Now call dhcp to get route, nameservers and ip# for you ``dhcpcd ath0''. This might take a few.

If all is fine, you can now reach your LAN and internet where that is available.

For static ip#, you do it slightly different.

Bring up the interface first ``ifconfig ath0 up 192.168.0.1''.
Change ``192.168.0.1'' to whatever IP# you want to use.

Find out what your gateways IP# is and set it
``route add default gw 192.168.0.254''. Replace ``192.168.0.254'' with your gateway's IP#.

Find out what your nameservers ip# is and add them to /etc/resolv.conf file.
``echo "nameserver 192.168.0.254" >> /etc/resolv.conf''.

Change 192.168.0.254 to your name servers ip#.

If you want to use anything else than 802.11a, you need to specify a mode with ``iwpriv ath0 mode X''. Find out what you should replace X with by reading the manpages for iwconfig ``man iwconfig'' look for ``mode''.

Set your essid (ssid applys here too) ``iwconfig ath0 essid any''. You can replace ``any'' with your own essid but then you need to use "" around the name ``iwconfig ath0 essied "Digital"''.

If you have a wep key, set it now ``iwconfig ath0 key XXXXX''. Replace XXXXX with your WEP key.

Set the channel you want to use ``iwconfig ath0 channel 5''. Replace 5 with your channel.

If you want to specify bitrate (you do) use ``iwconfig ath0 rate 24MB''. Replace 24 with your bitrate.

Should work, and if it doesn't maybe I've helped you a bit on the way at least :)

Good luck!
P.S Any comments would be nice :)

DigitalVAXen 03-27-2004 08:48 PM

Great!
 
Thanks for that excellent guide! Now I won't have trouble configuring laptops in the future (maybe I should stop formatting every few weeks or so...) and I don't have to hold someone's hand while they do it. Great work!

dethree 04-06-2004 10:47 PM

i was having a look at your guide and decide to give it a go, but unfortunately i failed on the exporting the KERNELSOURCE PATH part as written on your instruction and got this message:

Code:

bash-2.05b# export KERNELPATH=/usr/src/linux-2.4.22 && export KERNELRELEASE=2.4.22 && export TOOLPREFIX=/usr/bin && export TARGET=i386-elf
bash-2.05b# make && make install
make: *** No targets specified and no makefile found.  Stop.

so i stop going further and want to seek some advice on how to fix this.
i'm using the default slackware 9.1 with no updates yet and the card is WG311 PCI, P4 1.6.

please help

LavaDevil94 04-15-2004 07:43 PM

why dont you write for the tldp? this saved my sanity! after all the junk that had no step-by-step (despite the fact that we know this is linux ;) ), you pop up on a google search, and im connected! nice!

DigitalVixen 04-18-2004 07:25 PM

Thank you for the kind words LavaDevil, but writting for the TLDP takes better howto's than this :)

dethree make sure there are a make file in the directory from which you are running make and make install.

PhilWills 05-08-2004 02:43 PM

Recently installed fedora release 1 and tried to get this working for my Netgear WG311.

Initially ran into a problem with uudecode, but managed to find the shar utils rpm and install that.

Now however, when I try to make the drivers retrieved from cvs, I get the following error:

make -C /lib/modules/2.4.22-1.2115.nptl/ SUBDIRS=/home/phil/madwifi/ath_hal modules
make[2]: Entering directory `/lib/modules/2.4.22-1.2115.nptl'
make[2]: *** No rule to make target `modules'. Stop.

I specified KERNELRELEASE as 2.4.22, TARGET as TARGET and TOOLPREFIX as /usr/bin

Apologies if this is glaringly obvious. I've been using other people's UNIX systems for a while, but this is the first time I've tried installing my own.

DigitalVixen 05-12-2004 10:20 AM

Hi Phil!

First off, your TARGET should be defined as I386-elf if your computer is a x86 based computer (Pentium I-4, Athlon, K6 etc.).
The error you recieve is because you are trying to run the make in the wrong directory, where there are no make files.
I suggest you read through the how-to more carefully and try to do it the way it's done there, it should work.
Also make sure that KERNELPATH is the correct path to your KERNEL sources, typically this would be /usr/src/linux or /usr/src/linux-2.4.x. If I recall correctly the kernel sources you can install with RedHat/Fedora appears in a slightly different directory, but you should be able to locate them easily.

Good luck!

PhilWills 05-12-2004 03:53 PM

Apologies, my previous post contained a typo, I did correctly, specify the target as i386-elf. The problem I was getting then was actually because of the fact that, stupidly enough, I didn't have the kernel source installed anywhere.

I now have the kernel source installed, but upon my initial attempt to make the drivers in the madwifi directory, I got the following error:

make[1]: Entering directory `/home/phil/madwifi/ath_hal'
make -C /usr/src/linux-2.4 SUBDIRS=/home/phil/madwifi/ath_hal modules
make[2]: Entering directory `/usr/src/linux-2.4.22-1.2188.nptl'

The present kernel configuration has modules disabled.
Type 'make config' and enable loadable module support.
Then build a kernel with module support enabled.

------------------------------------------------------------

After cding to my kernel source directory and doing a make config with loadable module support, I then got it to compile, with a few warnings about unused variables, but nothing more worrying than that.

Thanks very much for all the help, DV.

ZeroPhade 05-18-2004 01:20 PM

Hello,

Im having a problem with the make && make install. I am a NEW user to linux, and i am using mandrake. i get the following error

when i do:

export KERNELPATH=/usr/bin && export KERNELRELEASE=2.6.3 && export TOOLPREFIX=/usr/bin && export TARGET=i386-elf

make && make install

i get this error:

makefile.inc:98: /lib/modules/2.6.3-4mdk/build/.config: no such file in directory

make: *** no rule to make target '/lib/modules/2.6.3-4mdk/build/.config'. stop.

is my KERNELPATH correct? this is all new to me. <--

:newbie:

Please help!

icarrasco 05-19-2004 05:02 AM

Hi
First of all your kernel is 2.6.x, so i'm not sure if it will work at all.

Your kernelpath is not that directory. Check if you have a usr/src dir. If you have probably you will have a directory inside that is linux-2.6.3 and a symlink linux.
If you have your kernelpath is /usr/src/linux-2.6.3 and (in the case you have the symlink) /usr/src/linux

I hope this help

ZeroPhade 05-19-2004 06:37 AM

Thank you icarrasco for your help!

still gives me the same error. is there anything i can do to get my D-link DWL-g650 to work with my vaio note book. i have spent like 4 days working on this with no luck. and me being new to this linux is really not helping much. hehe, i feel like just to reformat and go back to windows xp atleast its a easyer setup. Again thank you for your help icarrasco! I will give linux a couple more days. heh

icarrasco 05-19-2004 08:22 AM

Hi again

By the way, did you check if /lib/modules/2.6.3-4mdk/build/.config exists??? The thing is that i don't know what the hell is looking for a .config file there, since that dir is for the compiled modules...

I was checking out some pages that maybe could help you:

http://www.myselph.de/personal/mynewbox.shtml
http://kurumi.sakura.ne.jp/~chimari/TR2/index-e.html

In any case, if you cannot configure madwifi driver, you could try to use one of these wrappers. With those ones you would use the windows drivers

(This one is free, and was working with my conceptronic before i started to use madwifi)
http://ndiswrapper.sourceforge.net/

(This one isn't free...)
http://www.linuxant.com/driverloader/

I hope this helps.

In any case now i know that VAIO with DWL-g650 should work wth madwifi, since a collegue has it working with SuSE 9.0 (With kernel 2.4.x)

ZeroPhade 05-19-2004 05:36 PM

i uninstalled mandrake and Dl'ed the suse, it seems to work fine for now. thanks for all you r help icarrasco! i just have few bugs to work out with suse and the vaio. other then that seems to work great. :)

:Pengy: Oh btw im using Suse Linux 9.1 Pro.

again thank you!

Taqwus 05-20-2004 03:40 AM

I had the no rule to make target error I just copied the .config file from my /boot to /usr/src and named it .config it got rid of that problem
Also I was using the G650 card and I have to start Linux then insert the card to get it to work

futurewizard 05-25-2004 10:26 AM

Does this work for WG311 on ath chip set


All times are GMT -5. The time now is 11:57 PM.