# Help with DWL-122 USB Wireless Adapter

## shawndubya

I cannot seem to get this to work. I'm trying to use the linux-wlan-ng drivers (tried both emerging 0.2.0-r2 and downloading 0.2.1-pre16 from website, with same results). I'm currently using a 0.2.1-pre11 ebuild which I modified to get the 0.2.1-pre14 build. I followed instructions on this thread which seemed to help some, but when I try to start net.wlan0, it tries to bring it up for awhile, but then simply fails with "Failed to bring wlan0 up". dmesg says:

```

ident: nic h/w: id=0x8026 1.0.0

ident: pri f/w: id=0x15 1.1.3

ident: sta f/w: id=0x1f 1.7.1

MFI:SUP:role=0x00:id=0x01:var=0x01:b/t=1/1

CFI:SUP:role=0x00:id=0x02:var=0x02:b/t=1/1

PRI:SUP:role=0x00:id=0x03:var=0x01:b/t=1/4

STA:SUP:role=0x00:id=0x04:var=0x01:b/t=1/12

PRI-CFI:ACT:role=0x01:id=0x02:var=0x02:b/t=1/1

STA-CFI:ACT:role=0x01:id=0x02:var=0x02:b/t=1/1

STA-MFI:ACT:role=0x01:id=0x01:var=0x01:b/t=1/1

Prism2 card SN: 000000000000

p80211knetdev_hard_start_xmit: Tx attempt prior to association, frame dropped.

p80211knetdev_hard_start_xmit: Tx attempt prior to association, frame dropped.

p80211knetdev_hard_start_xmit: Tx attempt prior to association, frame dropped.

p80211knetdev_hard_start_xmit: Tx attempt prior to association, frame dropped.

```

with the final 4 lines being output by net.wlan0 start.

I know USB is working, because I have a USB keyboard. Networking in general works because net.eth0 works fine. It looks like it is recognizing the prism2_usb module correctly. If I say 'ifconfig' it doesn't display wlan0, but 'ifconfig wlan0' does display it (not sure if that is useful). 

Any ideas?

----------

## shawndubya

bump. Anyone have experience in setting up wireless USB? Searching through the forums usually helps figure out just about anything, but no luck in this case   :Sad: 

----------

## juliancoccia

I have posted a DWL-122 HOWTO in my blog:

http://julian.coccia.com/article-53.html

Here is a copy JIC:

Installation was long but smooth. It requires kernel sources and a locally compiled kernel, as any precompiled kernel with sources will cause dependency errors when executing depmod:

```
/sbin/depmod -a

depmod: *** Unresolved symbols in /lib/modules/2.4.20/net/p80211.o

depmod: *** Unresolved symbols in /lib/modules/2.4.20/usb/prism2_usb.o

```

I realized it would be rather hard for an inexperienced user to get this device to work. That is the reason why I wanted to write something about it. So here is a quick HOWTO:

- First become root and cd into your src directory:

```
su -

cd /usr/src
```

- Get the latest kernel source from www.kernel.org. I used 2.4.23 as I wanted to keep it simple, but I'll try it on 2.6 next.

```
wget ftp://ftp.kernel.org/pub/linux/kernel/v2.4/linux-2.4.23.tar.bz2
```

- Uncompress your kernel and make a symlink so that it can be accessible as /usr/src/linux

```
tar -jxf linux-2.4.23.tar.bz2

rm linux

ln -s linux-2.4.23 linux
```

- cd into your new kernel and compile it:

make menuconfig (spend a few minutes here configuring your kernel properly, one of the pleasures of opensource)

```

make dep && make bzImage modules modules_install

cp arch/i386/boot/bzImage /boot/vmlinuz-2.4.23

cp System.map /boot/System.map-2.4.23

```

- Create the right entries in your bootloader. This instructions will depend on the bootloader and distro you are using. In my case it is GRUB running on Debian, therefore the configuration file is located at /boot/grub/menu.lst. It would be /boot/grub/grub.conf in RedHat and /etc/lilo.conf for LILO users. All you have to do in all cases is create a new section as follows (for lilo users, it is slightly different):

```
title Linux kernel 2.4.23

root (hd0,0)

kernel /boot/vmlinuz-2.4.23 root=/dev/hda2
```

(make sure you set the right root parameters, check your existing menu options for clues. Lilo users must now execute lilo)

- Reboot your machine choosing the new kernel and log in as root again.

- Get the latest linux-wlan-ng drivers (0.2.1-pre16 in this case), uncompress and configure as follows:

```
wget ftp://ftp.linux-wlan.org/pub/linux-wlan-ng/linux-wlan-ng-0.2.1-pre16.tar.gz

tar -zxf linux-wlan-ng-0.2.1-pre16.tar.gz

cd linux-wlan-ng-0.2.1-pre16

./Configure

-------------- Linux WLAN Configuration Script -------------

The default responses are correct for most users.

Build Prism2.x PCMCIA Card Services (_cs) driver? (y/n) [y]: n

Build Prism2 PLX9052 based PCI (_plx) adapter driver? (y/n) [n]: n

Build Prism2.5 native PCI (_pci) driver? (y/n) [n]: n

Build Prism2.5 USB (_usb) driver? (y/n) [n]: y

Linux source directory [/usr/src/linux]:

The kernel source tree is version 2.4.23.

Alternate target install root directory on host []:

Module install directory [/lib/modules/2.4.23]:

It looks like you have a System V init file setup.

Prefix for build host compiler? (rarely needed) []:

Build for debugging (see doc/config.debug) (y/n) [n]:

Configuration successful.

```

- Compile and install with:

```
make all

make install
```

- That's all. Now you can tail /var/log/messages -f and plug in your Wifi usb adapter. You will see something like this:

```
Dec 22 19:40:01 laptop kernel: hub.c: new USB device 00:07.2-2, assigned address 2

Dec 22 19:40:01 laptop kernel: usb.c: USB device 2 (vend/prod 0x2001/0x3700) is not claimed by any active driver.

Dec 22 19:40:04 laptop /etc/hotplug/usb.agent: Setup prism2_usb for USB product 2001/3700/132

Dec 22 19:40:05 laptop /etc/hotplug/wlan.agent: WLAN startup on null (null)

Dec 22 19:40:05 laptop kernel: prism2_init: prism2_usb.o: 0.2.1-pre16 Loaded

Dec 22 19:40:05 laptop kernel: prism2_init: dev_info is: prism2_usb

Dec 22 19:40:05 laptop kernel: usb.c: registered new driver prism2_usb

Dec 22 19:40:05 laptop /etc/hotplug/wlan.agent: WLAN p80211 starting!

Dec 22 19:40:05 laptop /etc/hotplug/wlan.agent: WLAN register on wlan0 (prism2_usb)

Dec 22 19:40:05 laptop /etc/hotplug/wlan.agent: WLAN wlan0 registered.

Dec 22 19:40:05 laptop /etc/hotplug/net.agent: invoke ifup wlan0

Dec 22 19:40:05 laptop wland[1071]: wland daemon init successful

Dec 22 19:40:05 laptop wland[1071]: netlink socket opened and bound successfully

Dec 22 19:40:05 laptop /etc/hotplug/wlan.agent: /sbin/prism2dl not found, aborting firmware download.

Dec 22 19:40:06 laptop kernel: ident: nic h/w: id=0x8026 1.0.0

Dec 22 19:40:06 laptop kernel: ident: pri f/w: id=0x15 1.1.3

Dec 22 19:40:06 laptop kernel: ident: sta f/w: id=0x1f 1.7.1

Dec 22 19:40:06 laptop kernel: MFI:SUP:role=0x00:id=0x01:var=0x01:b/t=1/1

Dec 22 19:40:06 laptop kernel: CFI:SUP:role=0x00:id=0x02:var=0x02:b/t=1/1

Dec 22 19:40:06 laptop kernel: PRI:SUP:role=0x00:id=0x03:var=0x01:b/t=1/4

Dec 22 19:40:06 laptop kernel: STA:SUP:role=0x00:id=0x04:var=0x01:b/t=1/12

Dec 22 19:40:06 laptop kernel: PRI-CFI:ACT:role=0x01:id=0x02:var=0x02:b/t=1/1

Dec 22 19:40:06 laptop kernel: STA-CFI:ACT:role=0x01:id=0x02:var=0x02:b/t=1/1

Dec 22 19:40:06 laptop kernel: STA-MFI:ACT:role=0x01:id=0x01:var=0x01:b/t=1/1

Dec 22 19:40:06 laptop kernel: Prism2 card SN: 000000000000

Dec 22 19:40:11 laptop /etc/hotplug/wlan.agent: WLAN wlan0 brought up successfully.

Dec 22 19:40:11 laptop /etc/hotplug/wlan.agent: WLAN bringing up layer 3+ with /sbin/ifup

Dec 22 19:40:11 laptop kernel: linkstatus=CONNECTED

```

- Now you need to configure your network accordingly with your access point. Edit /etc/wlan/wlan.conf and set your SSID as follows:

```
SSID_wlan0="mywlan"

ENABLE_wlan0=y
```

- This means you will need a /etc/wlan/wlancfg-mywlan file. You can use the included wlancfg-DEFAULT for reference. You might want to try first with the default configuration, disabling WEP on your access point, but do not forget to enable it once you know it works:

```
cp /etc/wlan/wlancfg-DEFAULT /etc/wlan/wlancfg-mywlan
```

Note: When enabling WEP make sure there are NO spaces/tabs after "=" in the line dot11WEPDefaultKey0=00:01.... otherwise it WILL NOT WORK !!!. I have submitted this info, and hopefully will be corrected in future versions.

- Configure now your IP:

```
ifconfig wlan0 192.168.0.2 netmask 255.255.255.0

route add -net default gw 192.168.0.1
```

Note: This IP configuration will work with most default configurations. Make sure you set the right local (wlan0) and gateway (gw) ip addresses. You may even have DHCP enabled on your access point, in that case you can obtain your ip automatically with dhclient

That should get you going. Enjoy

Julian

----------

## shawndubya

Thanks for the post. Unfortunately I already returned it and gave up on getting the box to work. Didn't give up on Gentoo though -- I still have that as my main box. Just gave up on having a separate HTPC, which is what the device was for. I must have had something not configured correctly, because my kernel setup matched yours. Oh well, now there will at least be some info next time someone searches!

shawn.

----------

## digital diesel

Well I read your post specifically looking for what usb WIFI NIC i should get.  Thanks for your help, i just bid on one on ebay.  i'm sure i'll have more Q's later.

To be continued.........

----------

## eurowombat

I've tried what you mentioned in your blog entry, USE="usb -pci" emerge linux-wlan-ng, but no dice.  lsmod indicates that the module p80211 used by [prism2_usb], but ifconfig doesn't indicate any active wlan device.  and when i perform " tail /var/log/messages -f", nothing happens after 

"usb.c: USB device 2 (vend/prod 0x2001/0x3700) is not claimed by any active driver."

additionally, lsusb indicates that I have no /proc/bus/usb directory, which leads me to believe I have larger problems at hand.  I left the default USB kernel options and the usb host controller knows when something is plugged in or removed as indicated above.

I'm not sure where to go from here.  any help would be appreciated and is desperately needed.

----------

## juliancoccia

Make sure the version you are pulling is 0.2.1-pre13 or later. It looks to me that you are running an earlier version that does not include the DWL-122 patch.

Try emerge -s linux-wlan-ng and you'll find out. Otherwise you can download the file manually from this address: 

ftp://ftp.linux-wlan.org/pub/linux-wlan-ng/

Cheers,

Julian

----------

## eurowombat

I was just using whatever was on the latest gentoo livecd... hopefully tomorrow when I'm near a wired connection I can bring it to life, meanwhile I'm trying on a knoppix system.

----------

## eurowombat

I restarted and installed again fixing a myriad of issues.  the walkthrough appears to have worked up to a point.  the usb device is indeed detected and picks up my network.  however, as any good wireless user does, I've enabled wep.

so say my network SSID is 'foo', iwconfig wlan0 shows that the device has picked up my 'foo; network.  but i cannot do anything since I have wep enabled and I can't get the USB device to pick up the settings.  I copied the DEFAULT wlancfg file to /etc/wlan/wlancfg-foo, and included my passkey with no spaces after the '=' and set the options at the top to true instead of false when they had to do with encryption and privacy.  are there any other options I need to change from the default?  I did not include the passphrase and key0, since the config file said it wasn't necessary.

every time i try to ping -c3 www.yahoo.com, I get an error, host not found.

i've been searching around the forums trying to find the answer but to no avail.

-s

----------

## juliancoccia

You must include the value for dot11WEPDefaultKey0=, otherwise it won't work. It should match the 64 or 128 key you set in your access point. However, I would strongly suggest you to disable wep temporarily just to narrow down the possibilities.

I am also assuming foo is the SSID you assigned to your access point.

Sorry if these are stupid suggestions, but I have to ask them. 

Also, before pinging yahoo.com try pinging the IP address of your access point. Even before that do ifconfig -a and see if you got an IP address and ping your own IP address as well.

Anyway, please let me know what happens.

Regards,

Julian

----------

## eurowombat

I tried some of your suggestions:

no wep for now...

first, pinging the router: network unreachable...

so i did ifconfig wlan0 192.168.1.110, giving my card a free address. How do I get it to acquire this through dhcp (the router is configured as a dhcp server).

now i can ping the router and other machines on the network.

iwconfig wlan0 does not show up with an ip address or anything, the ip address i set from ifconfig is not associating with the usb adapter.  

so that's the update, 

thanks for your patience and help.

--update

dhcpcd wlan0 seems to have done the trick.  how can i get this to run at startup?

-s

----------

## juliancoccia

A quick and dirty way to fix it would be by adding the dhcpcd command to /etc/conf.d/local.start  :Wink: 

----------

## SDALLSTAR

I am having troubles getting my dwl-122 to work. I am a total newbie at this. I took these steps to get to my current position.

1. emerged the wlan-ng driver

2.  emergeed the hotplug driver

3.  Copied the wlancfg default to /etc/wlan/wlan.conf (my wlancfg-DEFAULT was in /etc/conf.d/ instead of /etc/wlan for some reason)

4.  Here is my wlan.conf in /etc/wlan/wlan.conf

```

#! /bin/sh 

# Wireless LAN adapter configuration

#

# etc/wlan/wlan.conf

#

# Copyright (C) 1999 AbsoluteValue Systems, Inc.  All Rights Reserved.

# --------------------------------------------------------------------

#

# linux-wlan

#

#   The contents of this file are subject to the Mozilla Public

#   License Version 1.1 (the "License"); you may not use this file

#   except in compliance with the License. You may obtain a copy of

#   the License at http://www.mozilla.org/MPL/

#

#   Software distributed under the License is distributed on an "AS

#   IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or

#   implied. See the License for the specific language governing

#   rights and limitations under the License.

#

#   Alternatively, the contents of this file may be used under the

#   terms of the GNU Public License version 2 (the "GPL"), in which

#   case the provisions of the GPL are applicable instead of the

#   above.  If you wish to allow the use of your version of this file

#   only under the terms of the GPL and not to allow others to use

#   your version of this file under the MPL, indicate your decision

#   by deleting the provisions above and replace them with the notice

#   and other provisions required by the GPL.  If you do not delete

#   the provisions above, a recipient may use your version of this

#   file under either the MPL or the GPL.

#

# --------------------------------------------------------------------

#

# Inquiries regarding the linux-wlan Open Source project can be

# made directly to:

#

# AbsoluteValue Systems Inc.

# info@linux-wlan.com

# http://www.linux-wlan.com

#

# --------------------------------------------------------------------

#

# Portions of the development of this software were funded by 

# Intersil Corporation as part of PRISM(R) chipset product development.

#

# --------------------------------------------------------------------

# This file is sourced by all configuration scripts.

#

# The WLAN_DEVICES variable identifies the device names of each WLAN device.

# If you have more than one, make sure each one is identified in a whitespace

# separated list that's assigned to WLAN_DEVICES.

WLAN_DEVICES="wlan0"

# Below is the list of channels to scan, when we scan.

ChannelList="01:02:03:04:05:06:07:08:09:0a:0b:00:00:00"

# Below is the min and max time we linger on a channel during a scan.

ChannelMinTime=200

ChannelMaxTime=250

# And here we have the master scan toggle. 

WLAN_SCAN=n

##########

# Note:  To bind to a specific network, change the SSID to something different

#        and create the file /etc/wlan/wlancfg-<SSID> with your network-

#        specific settings.  If this file is not present, the settings in

#        /etc/wlancfg/wlancfg-DEFAULT are used.

#

# for example:

#    SSID_wlan0="linux-wlan"

# This expects a file called "/etc/wlan/wlancfg-linux-wlan" to be present.

#

# Use a SSID of "" to associate with any network in range.

#########

SSID_wlan0="mywlan"

ENABLE_wlan0=y

#SSID_wlan1=""

#ENABLE_wlan1=n

#SSID_wlan2=""

#ENABLE_wlan2=n

```

5. Here is my wlancfg-mywlan in /etc/wlan

```

#=======USER MIB SETTINGS=============================

# You can add the assignments for various MIB items

#  of your choosing to this variable, separated by 

#  whitespace.  The wlan-ng script will then set each one.

# Just uncomment the variable and set the assignments 

#  the way you want them.

#USER_MIBS="p2CnfRoamingMode=1 p2CnfShortPreamble=mixed"

#=======WEP===========================================

# [Dis/En]able WEP.  Settings only matter if PrivacyInvoked is true

lnxreq_hostWEPEncrypt=false     # true|false

lnxreq_hostWEPDecrypt=false     # true|false

dot11PrivacyInvoked=false   # true|false

dot11WEPDefaultKeyID=0      # 0|1|2|3

dot11ExcludeUnencrypted=true   # true|false, in AP this means WEP is required.

# If PRIV_GENSTR is not empty, use PRIV_GENTSTR to generate 

#  keys (just a convenience)

PRIV_GENERATOR=/sbin/keygen   # nwepgen, Neesus compatible

PRIV_KEY128=false      # keylength to generate

PRIV_GENSTR=""

# or set them explicitly.  Set genstr or keys, not both.

dot11WEPDefaultKey0=      # format: xx:xx:xx:xx:xx   or

dot11WEPDefaultKey1=      #         xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx

dot11WEPDefaultKey2=      #  e.g.   01:20:03:40:05   or

dot11WEPDefaultKey3=      #         01:02:03:04:05:06:07:08:09:0a:0b:0c:0d

#=======SELECT STATION MODE===================

IS_ADHOC=n          # y|n, y - adhoc, n - infrastructure

#======= INFRASTRUCTURE STATION  ===================

# What kind of authentication?

AuthType="opensystem"      # opensystem | sharedkey (requires WEP)

#======= ADHOC STATION ============================

BCNINT=100         # Beacon interval (in Kus)

CHANNEL=6         # DS channel for BSS (1-14, depends 

            #   on regulatory domain)

BASICRATES="2 4"      # Rates for mgmt&ctl frames (in 500Kb/s)

OPRATES="2 4 11 22"      # Supported rates in BSS (in 500Kb/s)

```

6. when i type "ifconfig wlan0 192.168.0.2 netmask 255.255.255.0"

I get:

SIOCSIFADDR: No such device

wlan0: unknown interface: No such device

SIOCSIFNETMASK: No such device

So i know that the wlan0 is not working at all. Im not sure how to go about fixing it. One thing to note, I have an ethernet card already installed and working on this system

----------

## juliancoccia

The DWL-122 support patch was merged into wlan-ng version 0.2.1-pre13. If you are running a previous version it will just not work. I don't know what happened, but by the time I wrote the article I am almost sure the latest available via portage was that version. 

Anyway, do emerge -s linux-wlan-ng  and check the available version. If it is earlier than 0.2.1-pre13 you'll have to download it and installed manually it is explained in the article in detail. Here it is again JIC: http://julian.coccia.com/article-53.html

----------

## SDALLSTAR

ahh, the version is 0.2.0-rc3. Ill try the update

/edit

That worked perfectly. Thanks alot for your help. I just downloaded the new version and installed. Since I had already configured everything, it worked first time through. Thanks for helping a newbie  :Smile: 

----------

## eurowombat

me again...

I have everything working fine with the adapter and WEP-disabled networks, however when I turn WEP on my access point, I cannot get the device to talk to the network.

My AP SSID is "NYC"

so I created a config file: wlancfg-NYC

in this config file, I set the following:

```

dot11PrivacyInvoked=true

dot11WEPDefaultKEY0=AB:CD:EF:01:23 # obviously not my real key

```

that should do it right?

wlan.conf was edited such that: 

```

SSID_wlan0=""

ENABLE_wlan0=y

SSID_wlan1="NYC"

ENABLE_wlan1=y

```

I ran wlancfg wlan0 to see why dhcpcd wlan0 was not assigning an address and noticed the following:

```

dot11PrivacyInvoked=false

```

however, when I erase my wlancfg-NYC file and edit the wlancfg-DEFAULT file to include my wep settings, i get:

```

dot11PrivacyInvoked=true

```

so now it's enabled, but dhcpcd wlan0 still fails to communicate with the AP. 

any solutions? I'm not really concerned about people sniffing my wireless packets, mostly people connecting to my box and leeching my bandwidth.  I may just do MAC filtering to get around this, though I'd rather have WEP just work... any suggestions?

----------

