# Wireless configuration : how to configure successfully ?

## moonlight

Hello all,

Using my wireless network card (D-Links DWL-g650 A1 (rev 01)) and my wireless router (Belkin Wireless Router 54G (F5D7230df4)) for quite some time successfully under Windows XP (euhh); I gave it a try last weekend under my Gentoo Linux configuration using the latest kernel build 2.6.5.

 lspci -v :

```

03:06.0 Network controller: Harris Semiconductor D-Links DWL-g650 A1 (rev 01)

        Subsystem: Unknown device 17cf:0014

        Flags: bus master, medium devsel, latency 80, IRQ 18

        Memory at d2004000 (32-bit, non-prefetchable) [size=8K]

        Capabilities: [dc] Power Management version 1

```

lspci -n :

```

03:06.0 Class 0280: 1260:3890 (rev 01)

```

I have checked the prism54 site, http://prism54.org/supported_cards.php, and could conclude that my card can use the prism54 Driver, which supports all Prism GT, Prism Duette and Prism Indigo chipset based wireless cards. Correct   :Question:  ?

Afterwards I have read and followed all information that I could find in the README file; 

http://prism54.org/cgi-bin/cvsweb/prism54-ng/README?rev=HEAD

. So far so good !

```

Requirements

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

 * kernel source tree (supported versions 2.4.23+ or 2.6.3+)

 * firmware: http://prism54.org/firmware/

    mkdir -p /usr/lib/hotplug/firmware

   cd /usr/lib/hotplug/firmware

   # Firmware will be available soon, for now we

   # brought it down since we have no official license

   # for free redistribution

   wget http://prism54.org/firmware/isl3890

   # You may want to test older version of firmware 

   # if you have problems with the latest

 * compiler/binutils for kernel compilation

 * wireless-tools

 * firmware utilities (see below for distribution notes)

 * Kernel requirements:

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

   v2.6:

    CONFIG_EXPERIMENTAL: y

    CONFIG_CLEAN_COMPILE: n

    CONFIG_STANDALONE: n

      Code maturity level options  --->

         Prompt for development and/or incomplete code/drivers

         Select only drivers expected to compile cleanly

         Select only drivers that don't need 

            compile-time external firmware

   CONFIG_HOTPLUG : y

      Bus options (PCI, PCMCIA, EISA, MCA, ISA) --->

         Support for hot-pluggable devices

   CONFIG_FW_LOADER: m/y (either one will work) 

      Generic Driver Options  --->

         Hotplug firmware loading support   

   CONFIG_NET_RADIO : y

   CONFIG_NET_WIRELESS : y

      Device Drivers --->

         Networking Support --->

            Wireless Lan drivers

   For PCMCIA Cards :

   CONFIG_PCMCIA && CONFIG_CARDBUS

      Bus options (PCI, PCMCIA, EISA, MCA, ISA) --->

         PCMCIA/CardBus support --->

          PCMCIA/CardBus support (m or y)

          CardBus yenta-compatible bridge support (m or y)

   

   You need sysfs mounted:

   mkdir /sys

   Add "none /sys sysfs defaults 0 0" to /etc/fstab

   mount /sys

Firmware/hotplug

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

 This driver needs to upload the firmware to the NIC's ram on initialization

 it does so by requesting the firmware from the hotplug subsystem by asking

 for "isl3890" or "isl3877" depending on the hardware detected. We don't 

 actually know of any card using isl3877 so if you do let us know ;)

 Make sure the hotplug system has been setup properly, otherwise you

 might get errors in the kernel log stating that request_firmware() has failed

  *) does "cat /proc/sys/kernel/hotplug" show something like "/sbin/hotplug"?

  *) is /sbin/hotplug present?

  *) is the "firmware" agent is present (call /sbin/hotplug without

     any argument to show a list of available agents)

  *) have you copied the firmware file into the folder expected by

     firmware.agent? (usually "/usr/lib/hotplug/firmware/")

  *) for 2.6.x you need to mount sysfs!

Other issues not directly related to firmware uploading:

  *) [cardbus] have 'yenta_socket' module loaded in order to make cardbus

     card visible to the kernel pci subsystem? (check with lspci(1) whether

     device is visible to the kernel)

```

iwconfig gives following result :

```

laptop root # iwconfig

plip0     no wireless extensions.

lo        no wireless extensions.

dummy0    no wireless extensions.

eth0      no wireless extensions.

eth1      NOT READY!  ESSID:off/any

          Mode:Managed  Channel:6  Access Point: 00:00:00:00:00:00

          Tx-Power=31 dBm   Sensitivity=0/200

          Retry min limit:0   RTS thr=0 B   Fragment thr=0 B

          Encryption key:off

          Link Quality:0  Signal level:0  Noise level:0

          Rx invalid nwid:0  Rx invalid crypt:0  Rx invalid frag:0

          Tx excessive retries:0  Invalid misc:0   Missed beacon:0

ppp0      no wireless extensions.

laptop root #

```

Next things to be done (eth1 in my specific case   :Question:  )

Client Mode

-----------

ifconfig eth1 up

iwconfig eth1 mode Managed # not necessary since this is the default

Scanning for APs

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

iwlist eth1 scanning

This results into :

```

laptop root # iwconfig

plip0     no wireless extensions.

lo        no wireless extensions.

dummy0    no wireless extensions.

eth0      no wireless extensions.

eth1      IEEE 802.11b/g  Mode:Managed  Channel:40

          Access Point: 00:00:00:00:00:00  Bit Rate:0kb/s   Tx-Power=31 dBm

          Sensitivity=20/200

          Retry min limit:8   RTS thr:2347 B   Fragment thr:2346 B

          Encryption key:off

          Link Quality:0  Signal level:0  Noise level:0

          Rx invalid nwid:0  Rx invalid crypt:0  Rx invalid frag:0

          Tx excessive retries:0  Invalid misc:0   Missed beacon:0

ppp0      no wireless extensions.

laptop root #iwlist eth1 scanning

eth1      No scan results

laptop root # 

```

The last part to be executed was a specific Gentoo related part :

Gentoo:

 # ACCEPT_KEYWORDS="~x86" 

	* emerge pcmcia-cs-tools

 	* emerge sys-apps/hotplug 

	* etc-update

However, here I am blocked now   :Sad:  ,  I have allready installed succesfully pcmcia-cs; but pcmcia-cs-tools never succeeded.

```

laptop root # emerge search pcmcia-cs

Searching...

[ Results for search key : pcmcia-cs ]

[ Applications found : 3 ]

*  sys-apps/pcmcia-cs

      Latest version available: 3.2.7

      Latest version installed: 3.2.7

      Size of downloaded files: 1,266 kB

      Homepage:    http://pcmcia-cs.sourceforge.net

      Description: PCMCIA tools for Linux

      License:     GPL-2

*  sys-apps/pcmcia-cs-drivers [ Masked ]

      Latest version available: 3.2.4

      Latest version installed: [ Not Installed ]

      Size of downloaded files: 1,266 kB

      Homepage:    http://pcmcia-cs.sourceforge.net

      Description: pcmcia-cs drivers

      License:     GPL-2

*  sys-apps/pcmcia-cs-tools

      Latest version available: 3.2.4

      Latest version installed: [ Not Installed ]

      Size of downloaded files: 1,233 kB

      Homepage:    http://pcmcia-cs.sourceforge.net

      Description: PCMCIA tools for Linux

      License:     GPL-2

laptop root #

```

Hereafter you can find the result of the emerge of pcmci-cs-tools, after adding a package.unmask (/etc/portage) :

```

laptop root # emerge pcmcia-cs-tools

Calculating dependencies ...done!

>>> emerge (1 of 1) sys-apps/pcmcia-cs-tools-3.2.4 to /

>>> md5 src_uri ;-) pcmcia-cs-3.2.4.tar.gz

>>> Unpacking source...

>>> Unpacking pcmcia-cs-3.2.4.tar.gz to /var/tmp/portage/pcmcia-cs-tools-3.2.4/work

>>> Source unpacked.

apm

    -------- Linux PCMCIA Configuration Script --------

The default responses for each question are correct for most users.

Consult the PCMCIA-HOWTO for additional info about each option.

Build 'trusting' versions of card utilities (y/n) [n]

Include 32-bit (CardBus) card support (y/n) [y]

Include PnP BIOS resource checking (y/n) [n]

Module install directory [/lib/modules/2.6.5-gentoo]

Kernel configuration options:

    Kernel-tree PCMCIA support is disabled.

    Symmetric multiprocessing support is disabled.

    Preemptive kernel support is enabled.

    High memory support is disabled.

    PCI BIOS support is enabled.

    Power management (APM) support is enabled.

    SCSI support is enabled.

    IEEE 1394 (FireWire) support is disabled.

    Networking support is enabled.

     Radio network interface support is enabled.

     Token Ring device support is disabled.

     Fast switching is disabled.

     Frame Diverter is disabled.

    Module version checking is enabled.

    Kernel debugging support is enabled.

     Memory leak detection support is disabled.

     Spinlock debugging is disabled.

    Preemptive kernel patch is enabled.

    /proc filesystem support is enabled.

    PAE support is disabled.

2.5.0 and later kernels require that PCMCIA be configured in the

    kernel source tree.  To fix, reconfigure and rebuild your

    kernel with PCMCIA enabled.

Configuration failed.

!!! ERROR: sys-apps/pcmcia-cs-tools-3.2.4 failed.

!!! Function src_compile, Line 57, Exitcode 1

!!! failed configuring

laptop root #

```

Anybody any idea what I did wrong; what I can try next ? At this moment I don't know what to do next ?

A strange thing to me is that when emerging pcmcia-cs, I don't have any problem and also the message  *Quote:*   

>  Kernel-tree PCMCIA support is enabled 

  is popping up in stead of  *Quote:*   

> Kernel-tree PCMCIA support is disabled

 . The point is that PCMCIA is enabled in my kernel (otherwise I couldn't emerge successfully pcmcia-cs).

If anybody has the same problems; if anybody can help me to go wireless under Gentoo; please reply.

Greetz, Moonlight

Maybe some last info about my Gentoo system :

```

laptop root # emerge --info

Portage 2.0.50-r5 (default-x86-1.4, gcc-3.3.3, glibc-2.3.3_pre20040207-r0, 2.6.5-gentoo)

=================================================================

System uname: 2.6.5-gentoo i686 Mobile Intel(R) Pentium(R) 4     CPU 2.80GHz

Gentoo Base System version 1.4.4

Autoconf: sys-devel/autoconf-2.59-r3

Automake: sys-devel/automake-1.8.3

ACCEPT_KEYWORDS="x86 ~x86"

AUTOCLEAN="yes"

CFLAGS="-O2 -mcpu=i686 -pipe"

CHOST="i686-pc-linux-gnu"

COMPILER="gcc3"

CONFIG_PROTECT="/etc /usr/X11R6/lib/X11/xkb /usr/kde/2/share/config /usr/kde/3.1/share/config /usr/kde/3.2/share/config /usr/kde/3/share/config /usr/lib/mozilla/defaults/pref /usr/share/config /var/qmail/control"

CONFIG_PROTECT_MASK="/etc/gconf /etc/terminfo /etc/env.d"

CXXFLAGS="-O2 -mcpu=i686 -pipe"

DISTDIR="/usr/portage/distfiles"

FEATURES="autoaddcvs ccache"

GENTOO_MIRRORS="http://212.219.247.21/sites/www.ibiblio.org/gentoo/ http://212.219.56.131/sites/www.ibiblio.org/gentoo/ http://212.219.247.15/sites/www.ibiblio.org/gentoo/"

MAKEOPTS="-j2"

PKGDIR="/usr/portage/packages"

PORTAGE_TMPDIR="/var/tmp"

PORTDIR="/usr/portage"

PORTDIR_OVERLAY=""

SYNC="rsync://rsync.gentoo.org/gentoo-portage"

USE="X alsa apm arts avi berkdb cdr crypt cups encode esd foomaticdb gdbm gif gpm gtk2 imlib java jpeg kde libg++ libwww mad mikmod motif mozilla mpeg mysql ncurses nls oggvorbis opengl oss pam pdflib perl png python qt quicktime readline sdl slang spell ssl svga tcltk tcpd truetype x86 xml2 xmms xv zlib"

```

----------

## ianhinder

I experienced exactly the same thing.  However, I am able to use the wireless card without installing the pcmcia-cs-tools package.  After you have done the 

ifconfig eth1 up

and

iwconfig eth1

what happens if you type ifconfig?  Does it show eth1 as available?  Can you ping your access point?  Do you get a light on your PCMCIA card?  Do you see any interesting messages in /var/log/message?  I get messages about firmware being uploaded etc.  My access point has encryption enabled, so I have to use

iwconfig eth1 essid <id> key <key>

before it will see anything, but it seems to just work.

PS I'm using a NetGear 511

----------

## ianhinder

Just had a thought.  I also edited /etc/conf.d/net to contain the line

iface_eth1="dhcp"

(if you're not using DHCP, then put the full ifconfig line in)

and created a symbolic link /etc/init.d/net.eth1 to /etc/init.d/net.eth0.  Then you can start the wireless card with

/etc/init.d/net.eth1 start

But you need to be careful if you have a wired connection as well, because it seems that if you unplug it without bringing the interface down (/etc/init.d/net.eth0 stop) then the routing information for that card is still present, and by default packets will try to use the ethernet instead of the wireless network.  So I think it's best to first bring eth0 down, then bring eth1 up.

Another perl of wisdom, which I should probably report as a bug: the dhcp invocation in the /etc/init.d/net.eth0 script by default asks for an infinite time dhcp lease.  If this is granted, then the dhcp program quits immediately, which is not what the script intended.  The fix for this is to always ask for a finite lease time.

----------

## UberLord

Try the scripts in my .sig for easy and (relatively) painless wireless config

----------

