Tugger the SLUGger!SLUG Mailing List Archives

Re: [SLUG] wlan-ng with prism2_usb


G'day all!

Firstly, a disclaimer:
Prism2_usb is the spawn of satan.

Moving on.

The commands you send to the device are long and horrible, and I find it's a lot easier to put all the commands in a script.

There are a lot of problems with the driver when it comes to changing settings once you've set them, so the first thing you need is unload and reload the drivers into the kernel with a:

rmmod prism2_usb
modprobe prism2_usb

Right now it'll have the driver loaded, but you won't be able to do anything with it. You'll need to "enable" the device so you can start sending commands to it.

wlanctl-ng wlan0 lnxreq_ifstate ifstate=enable

So now you'll be able to tell the card what you want it to do. To associate with an access point with no wep:

wlanctl-ng wlan0 lnxreq_autojoin ssid="Your ssid here" authtype=opensystem

To associate with an access point with wep:

wlanctl-ng wlan0 dot11req_mibset mibattribute=p2CnfRoamingMode=1
wlanctl-ng wlan0 dot11req_mibset mibattribute=dot11WEPDefaultKeyID=0
wlanctl-ng wlan0 dot11req_mibset mibattribute=dot11ExcludeUnencrypted=true
wlanctl-ng wlan0 dot11req_mibset mibattribute=dot11PrivacyInvoked=true
wlanctl-ng wlan0 dot11req_mibset mibattribute=dot11WEPDefaultKey0=DE:AD:BE:AT:C0:FF:EE:CA:FE:CA:BB:A9:E0
wlanctl-ng wlan0 lnxreq_autojoin ssid="Your ssid here" authtype=opensystem

Yes, that's right, you have to enter your WEP key in hex. I'd suggest
http://www.andrewscompanies.com/tools/wep.asp
for a quick way to convert your key to hex, unless you want to use "deadbeatcoffeecafecabbage0".

To create an ad-hoc network:

wlanctl-ng wlan0 dot11req_start ssid="Your ssid here" bsstype=independent \
dschannel=5 beaconperiod=100 dtimperiod=3 probedelay=100 \
cfpollable=false cfpollreq=false basicrate1=11 operationalrate1=11 \
basicrate2=8 operationalrate2=8 basicrate3=4 operationalrate3=4  \
basicrate4=2 operationalrate4=2

That was a long, wasn't it?

Now you know why it's so horrible. :-)

I've never tried getting stuff going with hotplug, so I don't know whether I can help you there. Generally I create a script for each network I want to associate with and then just invoke it in my initscripts or by hand.

I'm in the process (and have been for a while because i'm lazy) of writing a wrapper script similar in style to the wireless-tools programme iwconfig.

If I ever get it finished i'll post it here.

Lindsay


Howard Lowndes wrote:

I'm working on getting a DLink DWL122 USB wifi dongle to work.

I can get it to work when I manually type in the commands, but using the /etc/init.d/wlan rc script doesn't work.

I think it might have something to do with hotplug but I am not sure what.

Does anyone have a wlan rc script they are prepared to share other than the one that is in the wlan-ng package, or can offer some other solution, or suggest where I should be looking in hotplug.

System is FC4 with 2.6.12 kernel