LinuxQuestions.org
Support LQ: Use code LQ3 and save $3 on Domain Registration
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices

Reply
 
Search this Thread
Old 11-26-2005, 06:47 PM   #1
masoni
LQ Newbie
 
Registered: May 2003
Location: Drayton, Norwich, UK
Distribution: Slackware
Posts: 1

Rep: Reputation: 0
Lightbulb Atheros/MadWifi pccard hack


I've just upgraded to the latest version of the MadWifi driver (madwifi.org).

A change has been made to the code so that my pccard now gets added as 'wifi0' when it is plugged in.

wlanconfig must then be run to create the network device (I used ath<n> ) against which a network interface can be configured.

To do this automatically when the card is insert I modified /etc/hotplug/net.agent and added the following code

Code:
            # Run ifrename as needed - Jean II
            # Remap interface names based on MAC address. This workaround
            # the dreaded configuration problem "all my cards are 'eth0'"...
            # This needs to be done before ifup otherwise ifup will get
            # confused by the name changed and because iface need to be
            # down to change its name.
            if [ -x /usr/sbin/ifrename ] && [ -r /etc/iftab ]; then
                debug_mesg invoke ifrename for $INTERFACE
                NEWNAME=`/usr/sbin/ifrename -i $INTERFACE`
                if [ -n "$NEWNAME" ]; then
                    debug_mesg iface $INTERFACE is remapped to $NEWNAME
                    INTERFACE=$NEWNAME
                fi;
            fi

            # Additional hack for MadWifi
            #if [ `/sbin/iwconfig 2>&1 | grep "^wifi.*no wireless extentions"` ] ; then
            if [[ "$INTERFACE" =~ "wifi[0-9]+" ]]; then
                NEWNAME=`/usr/local/bin/wlanconfig ath create wlandev $INTERFACE  wlanmode sta`
                INTERFACE=$NEWNAME
            fi


            # Slackware Linux:

It's worth mentioning that the number assigned to the device name is set by the kernel and increments everytime the card is ejected and re-inserted between reboots.
wlanconfig should let you hardcode the number (e.g wlanconfig ath0 ....) but I kept getting an ioctl error when I try.

rc.inet1.conf may need duplicate entries if you intend to pop the card in and out between reboots.

you can use wlanconfig to destroy the 'ath' device but this only works while the device is running so I couldn't think of any way to automate this when the card is ejected.

I hope this information helps someone else.

Iain
 
Old 11-28-2005, 06:18 AM   #2
Charred
Member
 
Registered: Mar 2005
Location: Utah, USA
Distribution: Slackware 11
Posts: 816
Blog Entries: 2

Rep: Reputation: 30
Good to know for when I upgrade. I'll keep an eye out for it!


Aaaaand off the zero-replies list we go...
 
Old 12-04-2005, 07:28 PM   #3
tlaurenzo
LQ Newbie
 
Registered: Dec 2005
Posts: 1

Rep: Reputation: 0
Try this

if [[ "$INTERFACE" =~ "wifi[0-9]+" ]]; then
VAPNAME=`/usr/local/bin/wlanconfig ath create wlandev $INTERFACE wlanmode sta`
/sbin/ifrename -i $VAPNAME
fi

I put the above code in place of the previously suggested modifications. In addition to a line in /etc/iftab, this causes the newly created ath? interface to immediately be renamed to wlan9, which is something that the Fedora network profile tools can grab onto.

The iftab entry is a little tricky because the base wifi? interface shares the MAC address of the virtual ath? interface. I used something this (with the mac address of my card inserted):
wlan9 mac FF:FF:FF:FF:FF:FF iwproto IEEE*

This forces the matching rule to only work on the interface with wireless extensions enabled (ie. the ath? interface, not the wifi? interface).

It all works now, and when I plug the Atheros card in, I immediately get a wlan9 interface that comes up and acquires its address.

TJ
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
madwifi/ndiswrapper on Atheros AR5004G biggjimmy7 Linux - Wireless Networking 7 01-05-2008 12:11 PM
Atheros 5004g, MadWiFi and WPA mrmcctt Linux - Wireless Networking 11 08-09-2005 01:30 AM
madwifi - atheros - and WPA-PSK , anyone? dimgr Linux - Wireless Networking 1 07-05-2005 05:24 AM
Need help with Madwifi/Atheros on Slack10.1 d4m Linux - Wireless Networking 1 06-26-2005 10:01 AM
Atheros AR5004G and madwifi/ndiswrapper biggjimmy7 Linux - Wireless Networking 1 05-03-2005 02:17 PM


All times are GMT -5. The time now is 01:30 PM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration