# Neither my bcm43xx or madwifi cards are working--but used to

## vputz

I have an HTPC that has been death for wireless networking since day 1.  One is a Netgear card--I don't remember the name, but it uses Broadcom--and the other is a generic "Best Buy" Dynex card using the Atheros chipset, that I bought because I put one in my sister's Ubuntu machine and it worked out of the box with my AP.

```

freevo vputz # uname -r

2.6.20-gentoo-r7

freevo vputz # lspci

...

01:08.0 Network controller: Broadcom Corporation BCM4306 802.11b/g Wireless LAN Controller (rev 02)

01:09.0 Ethernet controller: Atheros Communications, Inc. AR5005G 802.11abg NIC (rev 01)

...

```

Good so far.  So one has a module right in the kernel, and the other has worked fine with my AP under a different OS.  What could be easier?

Sigh.

Modules are loaded, and links are installed for eth1 (the broadcom) and ath0 (the atheros).  I've installed madwifi-ng (0.9.3-r3), madwifi-ng-tools (0.9.3), and wpa_supplicant (0.5.7, and with the madwifi flag set).  Modules load fine and the ath0 and eth1 devices show up.

I have a very simple wpa_supplicant.conf:

```

freevo vputz # cat /etc/wpa_supplicant/wpa_supplicant.conf

# This is a network block that connects to any unsecured access point.

# We give it a low priority so any defined blocks are preferred.

ctrl_interface=/var/run/wpa_supplicant

#eapol_version=1

#ap_scan=0

#fast_reauth=1

network={

        key_mgmt=NONE

        priority=-9999999

}

network={

  ssid="wingedyak"

  key_mgmt=WPA-PSK

  proto=WPA

  pairwise=TKIP

  group=TKIP

  psk=my_psk_key

}

```

If I look at the interfaces with iwconfig, I get this:

```

freevo vputz # iwconfig

lo        no wireless extensions.

eth0      no wireless extensions.

wifi0     no wireless extensions.

ath0      IEEE 802.11g  ESSID:"wingedyak"  Nickname:""

          Mode:Managed  Frequency:2.437 GHz  Access Point: Not-Associated   

          Bit Rate:1 Mb/s   Tx-Power:15 dBm   Sensitivity=0/3  

          Retry:off   RTS thr:off   Fragment thr:off

          Encryption key:off

          Power Management:off

          Link Quality=26/94  Signal level=-67 dBm  Noise level=-93 dBm

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

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

eth1      IEEE 802.11b/g  ESSID:"wingedyak"  Nickname:"Broadcom 4306"

          Mode:Managed  Frequency=2.437 GHz  Access Point: 00:06:25:B8:BD:03   

          Bit Rate=1 Mb/s   Tx-Power=15 dBm   

          RTS thr:off   Fragment thr:off

          Encryption key:off

          Link Quality=0/100  Signal level=-256 dBm  Noise level=-256 dBm

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

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

```

Hey, looks pretty good, both of them see my network!

of course, ifconfig shows they aren't configured, even with wpa_supplicant running in the background after about 8 hours:

```

freevo vputz # ps ax | grep wpa

 5218 ?        Ss     0:00 /sbin/wpa_supplicant -Dmadwifi -c/etc/wpa_supplicant/wpa_supplicant.conf -W -B -iath0 -P/var/run/wpa_supplicant-ath0.pid

 5229 ?        Ss     0:00 /bin/wpa_cli -a/etc/wpa_supplicant/wpa_cli.sh -p/var/run/wpa_supplicant -iath0 -P/var/run/wpa_cli-ath0.pid -B

10845 ?        Ss     0:00 /sbin/wpa_supplicant -Dwext -c/etc/wpa_supplicant/wpa_supplicant.conf -W -B -ieth1 -P/var/run/wpa_supplicant-eth1.pid

10856 ?        Ss     0:00 /bin/wpa_cli -a/etc/wpa_supplicant/wpa_cli.sh -p/var/run/wpa_supplicant -ieth1 -P/var/run/wpa_cli-eth1.pid -B

10915 pts/0    R+     0:00 grep --colour=auto wpa

freevo vputz # ifconfig

ath0      Link encap:Ethernet  HWaddr 00:14:A5:CC:4A:D3  

          UP BROADCAST MULTICAST  MTU:1500  Metric:1

          RX packets:0 errors:0 dropped:0 overruns:0 frame:0

          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0

          collisions:0 txqueuelen:0 

          RX bytes:0 (0.0 b)  TX bytes:0 (0.0 b)

...eth0...

eth1      Link encap:Ethernet  HWaddr 00:06:25:3B:CF:76  

          UP BROADCAST MULTICAST  MTU:1500  Metric:1

          RX packets:0 errors:0 dropped:0 overruns:0 frame:0

          TX packets:219705 errors:0 dropped:0 overruns:0 carrier:0

          collisions:0 txqueuelen:1000 

          RX bytes:0 (0.0 b)  TX bytes:10181268 (9.7 Mb)

          Interrupt:5 

...lo...

wifi0     Link encap:UNSPEC  HWaddr 00-14-A5-CC-4A-D3-38-70-00-00-00-00-00-00-00-00  

          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1

          RX packets:316397 errors:0 dropped:0 overruns:0 frame:96610

          TX packets:75466 errors:0 dropped:0 overruns:0 carrier:0

          collisions:0 txqueuelen:199 

          RX bytes:36228769 (34.5 Mb)  TX bytes:5073484 (4.8 Mb)

          Interrupt:19 

```

Okay, fine.  Let's take a look at wpa_supplicant's response for ath0 (atheros):

```

freevo vputz # /sbin/wpa_supplicant -d -Dmadwifi -c/etc/wpa_supplicant/wpa_supplicant.conf -iath0

Initializing interface 'ath0' conf '/etc/wpa_supplicant/wpa_supplicant.conf' driver 'madwifi' ctrl_interface 'N/A' bridge 'N/A'

Configuration file '/etc/wpa_supplicant/wpa_supplicant.conf' -> '/etc/wpa_supplicant/wpa_supplicant.conf'

Reading configuration file '/etc/wpa_supplicant/wpa_supplicant.conf'

ctrl_interface='/var/run/wpa_supplicant'

Priority group 0

   id=1 ssid='wingedyak'

Priority group -9999999

   id=0 ssid=''

Initializing interface (2) 'ath0'

EAPOL: SUPP_PAE entering state DISCONNECTED

EAPOL: KEY_RX entering state NO_KEY_RECEIVE

EAPOL: SUPP_BE entering state INITIALIZE

EAP: EAP entering state DISABLED

EAPOL: External notification - portEnabled=0

EAPOL: External notification - portValid=0

SIOCGIWRANGE: WE(compiled)=21 WE(source)=13 enc_capa=0xf

  capabilities: key_mgmt 0xf enc 0xf

WEXT: Operstate: linkmode=1, operstate=5

Own MAC address: 00:14:a5:cc:4a:d3

wpa_driver_madwifi_del_key: keyidx=0

wpa_driver_madwifi_del_key: keyidx=1

wpa_driver_madwifi_del_key: keyidx=2

wpa_driver_madwifi_del_key: keyidx=3

wpa_driver_madwifi_set_countermeasures: enabled=0

wpa_driver_madwifi_set_drop_unencrypted: enabled=1

Setting scan request: 0 sec 100000 usec

Added interface ath0

RTM_NEWLINK: operstate=0 ifi_flags=0x1002 ()

Wireless event: cmd=0x8b06 len=8

Ignore event for foreign ifindex 3

RTM_NEWLINK: operstate=0 ifi_flags=0x11043 ([UP][RUNNING][LOWER_UP])

RTM_NEWLINK, IFLA_IFNAME: Interface 'ath0' added

RTM_NEWLINK: operstate=0 ifi_flags=0x11043 ([UP][RUNNING][LOWER_UP])

RTM_NEWLINK, IFLA_IFNAME: Interface 'ath0' added

RTM_NEWLINK: operstate=0 ifi_flags=0x11003 ([UP][LOWER_UP])

RTM_NEWLINK, IFLA_IFNAME: Interface 'ath0' added

State: DISCONNECTED -> SCANNING

Starting AP scan (broadcast SSID)

Trying to get current scan results first without requesting a new scan to speed up initial association

Received 0 bytes of scan results (0 BSSes)

Scan results: 0

Selecting BSS from priority group 0

Selecting BSS from priority group -9999999

No suitable AP found.

Setting scan request: 0 sec 0 usec

Starting AP scan (broadcast SSID)

RTM_NEWLINK: operstate=0 ifi_flags=0x11003 ([UP][LOWER_UP])

Wireless event: cmd=0x8b1a len=8

RTM_NEWLINK: operstate=0 ifi_flags=0x11003 ([UP][LOWER_UP])

Wireless event: cmd=0x8b19 len=8

Received 226 bytes of scan results (1 BSSes)

Scan results: 1

Selecting BSS from priority group 0

0: 00:06:25:b8:bd:03 ssid='wingedyak' wpa_ie_len=26 rsn_ie_len=0 caps=0x11

   selected based on WPA IE

Trying to associate with 00:06:25:b8:bd:03 (SSID='wingedyak' freq=2437 MHz)

Cancelling scan request

WPA: clearing own WPA/RSN IE

Automatic auth_alg selection: 0x1

WPA: using IEEE 802.11i/D3.0

WPA: Selected cipher suites: group 8 pairwise 8 key_mgmt 2 proto 1

WPA: set AP WPA IE - hexdump(len=26): dd 18 00 50 f2 01 01 00 00 50 f2 02 01 00 00 50 f2 02 01 00 00 50 f2 02 00 00

WPA: clearing AP RSN IE

WPA: using GTK TKIP

WPA: using PTK TKIP

WPA: using KEY_MGMT WPA-PSK

WPA: Set own WPA IE default - hexdump(len=24): dd 16 00 50 f2 01 01 00 00 50 f2 02 01 00 00 50 f2 02 01 00 00 50 f2 02

No keys have been configured - skip key clearing

wpa_driver_madwifi_set_drop_unencrypted: enabled=1

State: SCANNING -> ASSOCIATING

wpa_driver_wext_set_operstate: operstate 0->0 (DORMANT)

WEXT: Operstate: linkmode=-1, operstate=5

wpa_driver_madwifi_associate

ioctl[IEEE80211_IOCTL_SETMLME]: Invalid argument

wpa_driver_madwifi_associate: SETMLME[ASSOC] failed

Association request to the driver failed

Setting authentication timeout: 5 sec 0 usec

EAPOL: External notification - EAP success=0

EAPOL: External notification - EAP fail=0

EAPOL: External notification - portControl=Auto

RTM_NEWLINK: operstate=0 ifi_flags=0x11003 ([UP][LOWER_UP])

Wireless event: cmd=0x8b1a len=17

Authentication with 00:00:00:00:00:00 timed out.

Added BSSID 00:06:25:b8:bd:03 into blacklist

State: ASSOCIATING -> DISCONNECTED

wpa_driver_wext_set_operstate: operstate 0->0 (DORMANT)

WEXT: Operstate: linkmode=-1, operstate=5

No keys have been configured - skip key clearing

EAPOL: External notification - portEnabled=0

EAPOL: External notification - portValid=0

Setting scan request: 0 sec 0 usec

State: DISCONNECTED -> SCANNING

Starting AP scan (broadcast SSID)

RTM_NEWLINK: operstate=0 ifi_flags=0x11003 ([UP][LOWER_UP])

Wireless event: cmd=0x8b1a len=8

CTRL-EVENT-TERMINATING - signal 2 received

Removing interface ath0

State: SCANNING -> DISCONNECTED

wpa_driver_wext_set_operstate: operstate 0->0 (DORMANT)

WEXT: Operstate: linkmode=-1, operstate=5

No keys have been configured - skip key clearing

EAPOL: External notification - portEnabled=0

EAPOL: External notification - portValid=0

wpa_driver_madwifi_set_drop_unencrypted: enabled=0

wpa_driver_madwifi_set_countermeasures: enabled=0

No keys have been configured - skip key clearing

Removed BSSID 00:06:25:b8:bd:03 from blacklist (clear)

Cancelling scan request

Cancelling authentication timeout

WEXT: Operstate: linkmode=0, operstate=6

```

...and it just goes on.  Particularly interesting to me are the bits which say 

```

ioctl[IEEE80211_IOCTL_SETMLME]: Invalid argument

wpa_driver_madwifi_associate: SETMLME[ASSOC] failed

Association request to the driver failed

```

.

That sounds rather odd.  Okay, fine, let's try the eth1 interface, which is the bcm43xx module in the kernel and which, I must add, has worked fine in the past:

```

freevo vputz # /sbin/wpa_supplicant -d -Dwext -c/etc/wpa_supplicant/wpa_supplicant.conf -ieth1

Initializing interface 'eth1' conf '/etc/wpa_supplicant/wpa_supplicant.conf' driver 'wext' ctrl_interface 'N/A' bridge 'N/A'

Configuration file '/etc/wpa_supplicant/wpa_supplicant.conf' -> '/etc/wpa_supplicant/wpa_supplicant.conf'

Reading configuration file '/etc/wpa_supplicant/wpa_supplicant.conf'

ctrl_interface='/var/run/wpa_supplicant'

Priority group 0

   id=1 ssid='wingedyak'

Priority group -9999999

   id=0 ssid=''

Initializing interface (2) 'eth1'

EAPOL: SUPP_PAE entering state DISCONNECTED

EAPOL: KEY_RX entering state NO_KEY_RECEIVE

EAPOL: SUPP_BE entering state INITIALIZE

EAP: EAP entering state DISABLED

EAPOL: External notification - portEnabled=0

EAPOL: External notification - portValid=0

SIOCGIWRANGE: WE(compiled)=21 WE(source)=18 enc_capa=0xf

  capabilities: key_mgmt 0xf enc 0xf

WEXT: Operstate: linkmode=1, operstate=5

Own MAC address: 00:06:25:3b:cf:76

wpa_driver_wext_set_wpa

wpa_driver_wext_set_key: alg=0 key_idx=0 set_tx=0 seq_len=0 key_len=0

wpa_driver_wext_set_key: alg=0 key_idx=1 set_tx=0 seq_len=0 key_len=0

wpa_driver_wext_set_key: alg=0 key_idx=2 set_tx=0 seq_len=0 key_len=0

wpa_driver_wext_set_key: alg=0 key_idx=3 set_tx=0 seq_len=0 key_len=0

wpa_driver_wext_set_countermeasures

wpa_driver_wext_set_drop_unencrypted

Setting scan request: 0 sec 100000 usec

Added interface eth1

RTM_NEWLINK: operstate=0 ifi_flags=0x1002 ()

Wireless event: cmd=0x8b06 len=8

RTM_NEWLINK: operstate=0 ifi_flags=0x1003 ([UP])

RTM_NEWLINK, IFLA_IFNAME: Interface 'eth1' added

RTM_NEWLINK: operstate=0 ifi_flags=0x1003 ([UP])

RTM_NEWLINK, IFLA_IFNAME: Interface 'eth1' added

State: DISCONNECTED -> SCANNING

Starting AP scan (broadcast SSID)

Trying to get current scan results first without requesting a new scan to speed up initial association

ioctl[SIOCGIWSCAN]: Resource temporarily unavailable

Scan results: -1

Failed to get scan results

Failed to get scan results - try scanning again

Setting scan request: 0 sec 0 usec

Starting AP scan (broadcast SSID)

RTM_NEWLINK: operstate=0 ifi_flags=0x1003 ([UP])

Wireless event: cmd=0x8b19 len=8

Received 258 bytes of scan results (1 BSSes)

Scan results: 1

Selecting BSS from priority group 0

0: 00:06:25:b8:bd:03 ssid='wingedyak' wpa_ie_len=26 rsn_ie_len=0 caps=0x11

   selected based on WPA IE

Trying to associate with 00:06:25:b8:bd:03 (SSID='wingedyak' freq=2437 MHz)

Cancelling scan request

WPA: clearing own WPA/RSN IE

Automatic auth_alg selection: 0x1

WPA: using IEEE 802.11i/D3.0

WPA: Selected cipher suites: group 8 pairwise 8 key_mgmt 2 proto 1

WPA: set AP WPA IE - hexdump(len=26): dd 18 00 50 f2 01 01 00 00 50 f2 02 01 00 00 50 f2 02 01 00 00 50 f2 02 00 00

WPA: clearing AP RSN IE

WPA: using GTK TKIP

WPA: using PTK TKIP

WPA: using KEY_MGMT WPA-PSK

WPA: Set own WPA IE default - hexdump(len=24): dd 16 00 50 f2 01 01 00 00 50 f2 02 01 00 00 50 f2 02 01 00 00 50 f2 02

No keys have been configured - skip key clearing

wpa_driver_wext_set_drop_unencrypted

State: SCANNING -> ASSOCIATING

wpa_driver_wext_set_operstate: operstate 0->0 (DORMANT)

WEXT: Operstate: linkmode=-1, operstate=5

wpa_driver_wext_associate

ioctl[SIOCSIWFREQ]: Invalid argument

Association request to the driver failed

Setting authentication timeout: 5 sec 0 usec

EAPOL: External notification - EAP success=0

EAPOL: External notification - EAP fail=0

EAPOL: External notification - portControl=Auto

RTM_NEWLINK: operstate=0 ifi_flags=0x1003 ([UP])

Wireless event: cmd=0x8b06 len=8

RTM_NEWLINK: operstate=0 ifi_flags=0x1003 ([UP])

Wireless event: cmd=0x8b1a len=17

Authentication with 00:00:00:00:00:00 timed out.

Added BSSID 00:06:25:b8:bd:03 into blacklist

State: ASSOCIATING -> DISCONNECTED

wpa_driver_wext_set_operstate: operstate 0->0 (DORMANT)

WEXT: Operstate: linkmode=-1, operstate=5

No keys have been configured - skip key clearing

EAPOL: External notification - portEnabled=0

EAPOL: External notification - portValid=0

Setting scan request: 0 sec 0 usec

State: DISCONNECTED -> SCANNING

Starting AP scan (broadcast SSID)

RTM_NEWLINK: operstate=0 ifi_flags=0x1003 ([UP])

Wireless event: cmd=0x8b19 len=8

Received 258 bytes of scan results (1 BSSes)

Scan results: 1

Selecting BSS from priority group 0

0: 00:06:25:b8:bd:03 ssid='wingedyak' wpa_ie_len=26 rsn_ie_len=0 caps=0x11

   selected based on WPA IE

Trying to associate with 00:06:25:b8:bd:03 (SSID='wingedyak' freq=2437 MHz)

Cancelling scan request

WPA: clearing own WPA/RSN IE

Automatic auth_alg selection: 0x1

WPA: using IEEE 802.11i/D3.0

WPA: Selected cipher suites: group 8 pairwise 8 key_mgmt 2 proto 1

WPA: set AP WPA IE - hexdump(len=26): dd 18 00 50 f2 01 01 00 00 50 f2 02 01 00 00 50 f2 02 01 00 00 50 f2 02 00 00

WPA: clearing AP RSN IE

WPA: using GTK TKIP

WPA: using PTK TKIP

WPA: using KEY_MGMT WPA-PSK

WPA: Set own WPA IE default - hexdump(len=24): dd 16 00 50 f2 01 01 00 00 50 f2 02 01 00 00 50 f2 02 01 00 00 50 f2 02

No keys have been configured - skip key clearing

wpa_driver_wext_set_drop_unencrypted

State: SCANNING -> ASSOCIATING

wpa_driver_wext_set_operstate: operstate 0->0 (DORMANT)

WEXT: Operstate: linkmode=-1, operstate=5

wpa_driver_wext_associate

ioctl[SIOCSIWFREQ]: Invalid argument

Association request to the driver failed

Setting authentication timeout: 5 sec 0 usec

EAPOL: External notification - EAP success=0

EAPOL: External notification - EAP fail=0

EAPOL: External notification - portControl=Auto

RTM_NEWLINK: operstate=0 ifi_flags=0x1003 ([UP])

Wireless event: cmd=0x8b06 len=8

RTM_NEWLINK: operstate=0 ifi_flags=0x1003 ([UP])

Wireless event: cmd=0x8b1a len=17

CTRL-EVENT-TERMINATING - signal 2 received

Removing interface eth1

State: ASSOCIATING -> DISCONNECTED

wpa_driver_wext_set_operstate: operstate 0->0 (DORMANT)

WEXT: Operstate: linkmode=-1, operstate=5

No keys have been configured - skip key clearing

EAPOL: External notification - portEnabled=0

EAPOL: External notification - portValid=0

wpa_driver_wext_set_wpa

wpa_driver_wext_set_drop_unencrypted

wpa_driver_wext_set_countermeasures

No keys have been configured - skip key clearing

Removed BSSID 00:06:25:b8:bd:03 from blacklist (clear)

Cancelling scan request

Cancelling authentication timeout

WEXT: Operstate: linkmode=0, operstate=6

...

```

No workee.  I do notice these lines and have to wonder if it's related:

```

wpa_driver_wext_associate

ioctl[SIOCSIWFREQ]: Invalid argument

Association request to the driver failed

```

Neither driver seems happy with associating.  My wife's Windows laptop sees my network and connects just fine.  My friend's mac sees my network and connects just fine.  My sister's compact wee machine running windows and Ubuntu and using the same atheros card sees my network and connects just fine.  But for my Gentoo HTPC, I have to run a 100' ethernet cable across the house just to try and maintain it.

What am I missing?

----------

## vputz

Bump, just in case some folks read forums on weekdays but not weekends when I posted this... sorry to sound desperate, but I'm sure there must be a solution...

----------

## defenderBG

why do u use wpa_supplient??? u have no encryption!

try the following:

iwconfig ath0 essid wingedyak

dhcpcd ath0

what u are doing here is to set your connection to wingedyak and ask the wireless (probably router) for an ip-address via dhcpcd.

----------

## vputz

Hm, not sure what you're meaning there.  I do in fact have the router set up for WPA-PSK; the key is very long (it's not actually 'my_psk_key') and other laptops and my sister's computer have connected via WPA-PSK to the router.

Now, if you're pointing out something horribly obvious that I've missed in wpa_supplicant.conf, groovy.  But the router indeed is using WPA-PSK, and the HTPC was once connecting to it with the same wpa_supplicant.conf entry for the wingedyak ssid using th BCM43xx card.

----------

## defenderBG

 *vputz wrote:*   

> 
> 
> ```
> 
> freevo vputz # iwconfig
> ...

 

If it was set to use some kind of encryption, than it would have been on, not off!

and now i have seen something more fishy:

Mode:Managed  Frequency:2.437 GHz  Access Point: Not-Associated

wow! there is something wrong... try reconfiguring wpa_suppliant or try using iwconfig (comes with wireless-tools)

iwconfig ath0 essid <essid> key <key>

dhcpcd ath0

----------

## vputz

Sure we're not conflating stuff iwconfig is supposed to do for WEP and wpa_supplicant does for WPA?

In any case, heck with it, I figured I'd try switching the router to WEP for the moment and try that using just iwconfig.

Unfortunately...

Still no luck.  I can use iwconfig to set ssid and key, and I can use iwlist to scan and it sees my access point, but I can't evidently associate or something, and I can't "dhcpd ath0" (it just times out).

I even copied over wpa_supplicant.conf from my handheld zaurus running Linux, and damned if it doesn't connect but my Gentoo box keeps giving me "association request to the driver failed" errors.

THIS SUCKS.

----------

## defenderBG

 *vputz wrote:*   

> THIS SUCKS.

 

++

well... u can see the wlans with iwlist, so a misconfiguration of the kernel is not that much possible...

and... dhcpd is not what u need.... http://oob.freeshell.org/nzwireless/dhcpd.html

u need dhcpcd!!! the dhcpcd is the client and dhcpd is the server!

for dhcpcd to work, u need to have a working dhcpd on your router. just in case u are not sure what it is all about..  check the config from ur wifes comp and set it on ur computer:

ifconfig ath0 <ip_add> netmask <subnet>

route add default gw <ip of the router>

echo 'nameserver <ip of the router>' >> /etc/resolv.conf

and test it with

ping google.com

----------

## semtex

Hi!

I already had a lot of WLAN problems, can u post your /etc/conf.d/net file here?

----------

## vputz

 *semtex wrote:*   

> Hi!
> 
> I already had a lot of WLAN problems, can u post your /etc/conf.d/net file here?

 

Sure thing:

```

vputz@freevo ~ $ cat /etc/conf.d/net

# This blank configuration will automatically use DHCP for any net.*

# scripts in /etc/init.d.  To create a more complete configuration,

# please review /etc/conf.d/net.example and save your configuration

# in /etc/conf.d/net (this file :]!).

config_eth0=( "dhcp" )

dhcp_eth0="nodns nontp nonis"

modules=( "wpa_supplicant" )

wpa_supplicant_eth1="-Dwext"

wpa_timeout_eth1=60

wpa_supplicant_ath0="-Dmadwifi"

wpa_timeout_ath0=60

```

And I just mistyped above, sorry--I was using dhcpcd.  Here's a failed attempt to bring it up manually with eth1 (the broadcom) and the AP set to use WEP, which I'd rather not do but I'll take some connectivity over none.  Given that I was using WPA with the same card for over a year, I feel certain WPA is still possible and I'm just missing something big and obvious.

```

freevo vputz # ifconfig eth1 up

freevo vputz # iwconfig eth1

eth1      IEEE 802.11b/g  ESSID:off/any  Nickname:"Broadcom 4306"

          Mode:Managed  Frequency=2.484 GHz  Access Point: 00:06:25:B8:BD:03   

          Bit Rate=1 Mb/s   Tx-Power=15 dBm   

          RTS thr:off   Fragment thr:off

          Encryption key:off

          Link Quality=0/100  Signal level=-256 dBm  Noise level=-256 dBm

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

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

freevo vputz # iwconfig eth1 essid wingedyak key 2E353BC58A

freevo vputz # iwconfig eth1

eth1      IEEE 802.11b/g  ESSID:"wingedyak"  Nickname:"Broadcom 4306"

          Mode:Managed  Frequency=2.437 GHz  Access Point: 00:06:25:B8:BD:03   

          Bit Rate=1 Mb/s   Tx-Power=15 dBm   

          RTS thr:off   Fragment thr:off

          Encryption key:2E35-3BC5-8A   Security mode:open

          Link Quality=0/100  Signal level=-256 dBm  Noise level=-256 dBm

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

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

freevo vputz # dhcpcd eth1

freevo vputz # dhcpcd -d eth1

Info, eth1: dhcpcd 3.0.16 starting

Info, eth1: hardware address = 00:06:25:3b:cf:76

Info, eth1: broadcasting for a lease

Debug, eth1: sending DHCP_DISCOVER with xid 25148954

Debug, eth1: waiting on select for 20 seconds

Debug, eth1: sending DHCP_DISCOVER with xid 25148954

Debug, eth1: sending DHCP_DISCOVER with xid 25148954

Debug, eth1: sending DHCP_DISCOVER with xid 25148954

Debug, eth1: sending DHCP_DISCOVER with xid 25148954

Debug, eth1: sending DHCP_DISCOVER with xid 25148954

Debug, eth1: sending DHCP_DISCOVER with xid 25148954

Error, eth1: timed out

Info, eth1: exiting

freevo vputz # iwlist eth1 scan

eth1      Scan completed :

          Cell 01 - Address: 00:06:25:B8:BD:03

                    ESSID:"wingedyak"

                    Protocol:IEEE 802.11bg

                    Mode:Master

                    Channel:6

                    Encryption key:on

                    Bit Rates:1 Mb/s; 2 Mb/s; 5.5 Mb/s; 6 Mb/s; 9 Mb/s

                              11 Mb/s; 12 Mb/s; 18 Mb/s; 24 Mb/s; 36 Mb/s

                              48 Mb/s; 54 Mb/s

                    Quality=85/100  Signal level=-61 dBm  Noise level=-54 dBm

                    Extra: Last beacon: 250ms ago

```

Note that it seems to be seeing the router, but I'm confused that the iwlist scan shows quality at 85/100, but iwconfig shows "link quality 0/100".

----------

## defenderBG

it means that u are not connected...hm... can u disable the encrytion, just to test if there is a connectivity if there is no encrytion.

i think there was something in the kernel to allow encryption, and i just want to see if it might be the problem. If u get to work that way, then just right it here... when i am home i will take a look in the kernel...

----------

## vputz

Yeah, I'm at work now too, so won't be able to touch it until I get home.  Pretty sure I had kernel stuff on for encryption, but not positive on that machine; I set it to change to 2.6.20-gentoo-r8 just in case there was a problem with 2.6.20-gentoo-r7.  I had some other weirdnesses too... like it's an athlon/k7 system with the MTRR option checked in the kernel, but no  /proc/mtrr file, which may explain my difficulties with nvidia too.

Eh, who knows.  Rough time for the ol' HTPC, that's all I know.

----------

## defenderBG

 *vputz wrote:*   

> like it's an athlon/k7 system with the MTRR option checked in the kernel, but no  /proc/mtrr file, which may explain my difficulties with nvidia too.

 

i am using as well this kernel and have no problems. for the mtrr u either have to build it in kernel or load it via modprobe.

What i find wierd in your config is that u don't get the encryption type... for example:

```
Hyperius orlin # iwlist wlan0 scanning

wlan0     Scan completed :

          Cell 01 - Address: 00:11:24:09:58:F7

                    ESSID:"airport"

                    Protocol:IEEE 802.11g

                    Mode:Managed

                    Frequency:2.422 GHz (Channel 3)

                    Quality:3/100  Signal level:-94 dBm  Noise level:-96 dBm

                    Encryption key:on

                    Bit Rates:1 Mb/s; 2 Mb/s; 5.5 Mb/s; 11 Mb/s; 6 Mb/s

                              9 Mb/s; 12 Mb/s; 18 Mb/s; 24 Mb/s; 36 Mb/s

                              48 Mb/s; 54 Mb/s

                    Extra:bcn_int=100

                    Extra:atim=0

                    IE: IEEE 802.11i/WPA2 Version 1

                        Group Cipher : TKIP

                        Pairwise Ciphers (2) : CCMP TKIP

                        Authentication Suites (1) : PSK

                    IE: WPA Version 1

                        Group Cipher : TKIP

                        Pairwise Ciphers (1) : TKIP

                        Authentication Suites (1) : PSK

```

----------

## vputz

Weirdly, mtrr was configured, but I went to -r8 and now /proc/mtrr looks fine.  But starting X still crashes the system instantly, black screen, no net access, no log written.  Whee.

Anyway, made some progress.  Trying wpa-supplicant with the madwifi driver and the router in WEP at least complained:

```

...

Scan results: 1

Selecting BSS from priority group 5

0: 00:06:25:b8:bd:03 ssid='wingedyak' wpa_ie_len=0 rsn_ie_len=0 caps=0x11

   skip - no WPA/RSN IE

No suitable AP found.

Setting scan request: 5 sec 0 usec

...

```

...but putting the router back on WPA and manually loading the wlan_tkip module gets me this...

```

freevo log # iwlist ath0 scan

ath0      Scan completed :

          Cell 01 - Address: 00:06:25:B8:BD:03

                    ESSID:"wingedyak"

                    Mode:Master

                    Frequency:2.437 GHz (Channel 6)

                    Quality=21/94  Signal level=-74 dBm  Noise level=-95 dBm

                    Encryption key:on

                    Bit Rates:1 Mb/s; 2 Mb/s; 5.5 Mb/s; 11 Mb/s; 18 Mb/s

                              24 Mb/s; 36 Mb/s; 54 Mb/s; 6 Mb/s; 9 Mb/s

                              12 Mb/s; 48 Mb/s

                    Extra:bcn_int=100

                    IE: WPA Version 1

                        Group Cipher : TKIP 

                        Pairwise Ciphers (1) : TKIP 

                        Authentication Suites (1) : PSK  

freevo log # iwlist eth1 scan

eth1      Scan completed :

          Cell 01 - Address: 00:06:25:B8:BD:03

                    ESSID:"wingedyak"

                    Protocol:IEEE 802.11bg

                    Mode:Master

                    Channel:6

                    Encryption key:on

                    Bit Rates:1 Mb/s; 2 Mb/s; 5.5 Mb/s; 6 Mb/s; 9 Mb/s

                              11 Mb/s; 12 Mb/s; 18 Mb/s; 24 Mb/s; 36 Mb/s

                              48 Mb/s; 54 Mb/s

                    Quality=84/100  Signal level=-63 dBm  Noise level=-54 dBm

                    IE: WPA Version 1

                        Group Cipher : TKIP 

                        Pairwise Ciphers (1) : TKIP 

                        Authentication Suites (1) : PSK  

                    Extra: Last beacon: 240ms ago

```

...which at least looks a little better.

However, wpa_supplicant still gives these sorts of errors for both cards.

ath0:

```

...

State: SCANNING -> ASSOCIATING

wpa_driver_wext_set_operstate: operstate 0->0 (DORMANT)

WEXT: Operstate: linkmode=-1, operstate=5

wpa_driver_madwifi_associate

ioctl[IEEE80211_IOCTL_SETMLME]: Invalid argument

wpa_driver_madwifi_associate: SETMLME[ASSOC] failed

Association request to the driver failed

...

```

eth1:

```

State: SCANNING -> ASSOCIATING

wpa_driver_wext_set_operstate: operstate 0->0 (DORMANT)

WEXT: Operstate: linkmode=-1, operstate=5

wpa_driver_wext_associate

ioctl[SIOCSIWFREQ]: Invalid argument

Association request to the driver failed

Setting authentication timeout: 5 sec 0 usec

```

Both of them try and associate and then give me this "association request to the driver failed" message after going from "scanning" to "associating".  I can't help but think that's my problem, but I've no idea at all what to do.

----------

## vputz

Addendum: only ath0 and eth1 support scanning, which conflicts with what you did earlier.  IE

```

freevo log # iwlist wlan0 scan 

wlan0     Interface doesn't support scanning.

```

What I really wish is that I could just put a wire there.  I have grown now to hate linux wireless networking with a deep and abiding passion.

----------

## defenderBG

well... it was an example from my computer and my wireless is wlan0  :Wink: 

i would assume u have problems with ioctl:

http://en.wikipedia.org/wiki/Ioctl

it is a part from device-mapper

try reemerging it, reboot and try again.

hope it will work.

I read as well, that there is a broadcast key for wpa?!?! don't know what it means, apperantly there are some problems with it and most wlans for linux.

----------

## mhill

I'm having the same problem on ath0 as vputz.  I have a Linksys WRT54GL set up in AP mode, WPA2 with WPA-PSK and TKIP.  I'm trying to associate to it using a Linksys WPC55AG PCMCIA card.  Just for background:

$ emerge --info

 *Quote:*   

> Portage 2.1.2.7 (default-linux/x86/2007.0/desktop, gcc-4.1.2, glibc-2.5-r1, 2.6.21-gentoo i686)
> 
> =================================================================
> 
> System uname: 2.6.21-gentoo i686 Mobile Intel(R) Pentium(R) 4 - M CPU 1.80GHz
> ...

 

$ dmesg | egrep -i 'ath|wifi|wlan'

 *Quote:*   

> ath_hal: module license 'Proprietary' taints kernel.
> 
> ath_hal: 0.9.18.0 (AR5210, AR5211, AR5212, RF5111, RF5112, RF2413, RF5413)
> 
> wlan: 0.8.4.2 (0.9.3)
> ...

 

I *did* notice the following instructions in /usr/share/doc/madwifi-ng-0.9.3-r3/README.bz2:

 *Quote:*   

> When using wpa_supplicant with a
> 
> recent linux kernel, it is preferred to use the 'wext' driver backend,
> 
> rather than the private MadWifi ioctl's.  This means that '-D wext'
> ...

 

Accordingly, I have set wpa_supplicant_ath0="-Dwext" in my conf.d/net file.  When I was using -Dmadwifi, I was getting the weird errors mentioned by other people as well:

 *Quote:*   

> ....
> 
> wpa_driver_madwifi_associate
> 
> ioctl[IEEE80211_IOCTL_SETMLME]: Invalid argument
> ...

 

$ cat /etc/conf.d/net

 *Quote:*   

> config_eth0="dhcp"
> 
> dhcp_eth0="nontp"
> 
> modules=( "wpa_supplicant" )
> ...

 

$ cat /etc/wpa_supplicant/wpa_supplicant.conf

 *Quote:*   

> ctrl_interface=/var/run/wpa_supplicant
> 
> ap_scan=1                               # Doesn't find the AP if not set to 1 !!
> 
> network={
> ...

 

Here are a couple cycles it goes through:

 *Quote:*   

> State: DISCONNECTED -> SCANNING
> 
> Starting AP scan (broadcast SSID)
> 
> Trying to get current scan results first without requesting a new scan to speed up initial association
> ...

 

$ iwlist ath0 scan

 *Quote:*   

> ath0      Scan completed :
> 
>           Cell 01 - Address: 00:1A:70:4C:A8:C5
> 
>                     ESSID:"iow490jwe409jhjg09jbh"
> ...

 

I don't know what else to try.  (Except I don't want to try running unprotected, for obvious reasons, or getting WEP to work.)

----------

## -troubadix-

I had the same problem and I solved it by using the Kernel Version 2.6.20.  I don`t know where the problem is located but for me it works.

-troubadix-

----------

## mhill

Thanks, troubadix.  It's a long story, but I finally got it working.  Turns out the problem doesn't seem to have been on the system end...  I got the Linksys router about a week before the wifi card, and I played around with it.  I got bored pretty quickly with the default firmware, and started playing around with DD-WRT and then OpenWRT.  (There was a reason I bought the WRT54G*L* model, after all.    :Smile:    )  Fortunately, a friend of mine had bought the same router model, and gotten a Belkin card working with it pretty effortlessly.  I took my system over and was able to get authenticated to his AP with WPA2.  The only difference was the firmware; he had left the stock firmware on.  So when I got home, I reflashed back to the stock firmware, and voila!  I was able to authenticate.

----------

