# Madwifi Problems: couldn't load module 'wlan_scan_sta' (-38)

## cheuschober

Hi. I'm trying to get my Atheros 5004 based minipci card working under madwifi but it's not playing nicely and I need some help. I know it works under 'nixes as it's worked in debian and bsd but this is my first gentoo and I'm not certain what I should do. I've browsed the forums looking for other peoples troubles and or solutions. Below is a list of outputs that seem relevant and that I know have been asked for in the past. If there's anything else I can do please let me know. Thanks.

~Chad

relevant dmesg (after 'modprobe ath_pci')

```

ath_pci: 0.9.4.5 (0.9.2)

ACPI: PCI Interrupt 0000:06:09.0[A] -> Link [LNK1] -> GSI 11 (level, high) -> IRQ 11

wifi0: 11a rates: 6Mbps 9Mbps 12Mbps 18Mbps 24Mbps 36Mbps 48Mbps 54Mbps

wifi0: 11b rates: 1Mbps 2Mbps 5.5Mbps 11Mbps

wifi0: 11g rates: 1Mbps 2Mbps 5.5Mbps 11Mbps 6Mbps 9Mbps 12Mbps 18Mbps 24Mbps 36Mbps 48Mbps 54Mbps

wifi0: turboA rates: 6Mbps 9Mbps 12Mbps 18Mbps 24Mbps 36Mbps 48Mbps 54Mbps

wifi0: turboG rates: 6Mbps 12Mbps 18Mbps 24Mbps 36Mbps 48Mbps 54Mbps

wifi0: H/W encryption support: WEP AES AES_CCM TKIP

wifi0: mac 5.9 phy 4.3 radio 3.6

wifi0: Use hw queue 1 for WME_AC_BE traffic

wifi0: Use hw queue 0 for WME_AC_BK traffic

wifi0: Use hw queue 2 for WME_AC_VI traffic

wifi0: Use hw queue 3 for WME_AC_VO traffic

wifi0: Use hw queue 8 for CAB traffic

wifi0: Use hw queue 9 for beacons

couldn't load module 'wlan_scan_sta' (-38)

unable to load wlan_scan_sta

wifi0: Atheros 5212: mem=0xb3400000, irq=11
```

lsmod

```
Module                  Size  Used by

ath_pci                88296  0

ath_rate_sample        14208  1 ath_pci

wlan                  188256  3 ath_pci,ath_rate_sample

ath_hal               216688  3 ath_pci,ath_rate_sample

snd_hda_intel          16092  0

snd_hda_codec         187520  1 snd_hda_intel
```

lspci | grep 'Atheros'

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

cat /usr/src/linux/.conf | grep 'CONFIG_CRYPTO'

```
CONFIG_CRYPTO=y

# CONFIG_CRYPTO_HMAC is not set

# CONFIG_CRYPTO_NULL is not set

# CONFIG_CRYPTO_MD4 is not set

CONFIG_CRYPTO_MD5=y

# CONFIG_CRYPTO_SHA1 is not set

# CONFIG_CRYPTO_SHA256 is not set

# CONFIG_CRYPTO_SHA512 is not set

# CONFIG_CRYPTO_WP512 is not set

# CONFIG_CRYPTO_TGR192 is not set

CONFIG_CRYPTO_DES=y

CONFIG_CRYPTO_BLOWFISH=y

CONFIG_CRYPTO_TWOFISH=y

# CONFIG_CRYPTO_SERPENT is not set

CONFIG_CRYPTO_AES=y

CONFIG_CRYPTO_AES_X86_64=y

# CONFIG_CRYPTO_CAST5 is not set

# CONFIG_CRYPTO_CAST6 is not set

# CONFIG_CRYPTO_TEA is not set

CONFIG_CRYPTO_ARC4=y

# CONFIG_CRYPTO_KHAZAD is not set

# CONFIG_CRYPTO_ANUBIS is not set

# CONFIG_CRYPTO_DEFLATE is not set

# CONFIG_CRYPTO_MICHAEL_MIC is not set

# CONFIG_CRYPTO_CRC32C is not set

# CONFIG_CRYPTO_TEST is not set
```

for i in CONFIG_PACKET CONFIG_NET CONFIG_INET CONFIG_NET_RADIO; do grep $i[^A-Z] /usr/src/linux/.config; done

```
CONFIG_PACKET=y

# CONFIG_PACKET_MMAP is not set

CONFIG_NET=y

# CONFIG_NET_KEY is not set

# CONFIG_NET_IPIP is not set

# CONFIG_NET_IPGRE is not set

CONFIG_NET_SCHED=y

# CONFIG_NET_SCH_CLK_JIFFIES is not set

CONFIG_NET_SCH_CLK_GETTIMEOFDAY=y

# CONFIG_NET_SCH_CLK_CPU is not set

CONFIG_NET_SCH_CBQ=y

CONFIG_NET_SCH_HTB=y

CONFIG_NET_SCH_HFSC=y

CONFIG_NET_SCH_PRIO=y

CONFIG_NET_SCH_RED=y

CONFIG_NET_SCH_SFQ=y

# CONFIG_NET_SCH_TEQL is not set

# CONFIG_NET_SCH_TBF is not set

CONFIG_NET_SCH_GRED=y

# CONFIG_NET_SCH_DSMARK is not set

# CONFIG_NET_SCH_NETEM is not set

# CONFIG_NET_SCH_INGRESS is not set

CONFIG_NET_CLS=y

CONFIG_NET_CLS_BASIC=y

CONFIG_NET_CLS_TCINDEX=y

CONFIG_NET_CLS_ROUTE4=y

CONFIG_NET_CLS_ROUTE=y

CONFIG_NET_CLS_FW=y

CONFIG_NET_CLS_U32=y

CONFIG_NET_CLS_RSVP=y

CONFIG_NET_CLS_RSVP6=y

CONFIG_NET_EMATCH=y

CONFIG_NET_EMATCH_STACK=32

CONFIG_NET_EMATCH_CMP=y

CONFIG_NET_EMATCH_NBYTE=y

# CONFIG_NET_EMATCH_U32 is not set

CONFIG_NET_EMATCH_META=y

# CONFIG_NET_EMATCH_TEXT is not set

CONFIG_NET_CLS_ACT=y

CONFIG_NET_ACT_POLICE=y

# CONFIG_NET_ACT_GACT is not set

# CONFIG_NET_ACT_MIRRED is not set

# CONFIG_NET_ACT_PEDIT is not set

# CONFIG_NET_ACT_SIMP is not set

# CONFIG_NET_CLS_IND is not set

CONFIG_NET_ESTIMATOR=y

# CONFIG_NET_PKTGEN is not set

# CONFIG_NET_TCPPROBE is not set

CONFIG_NET_ETHERNET=y

# CONFIG_NET_VENDOR_3COM is not set

CONFIG_NET_TULIP=y

CONFIG_NET_PCI=y

CONFIG_NET_RADIO=y

# CONFIG_NET_WIRELESS_RTNETLINK is not set

CONFIG_NET_WIRELESS=y

# CONFIG_NET_PCMCIA is not set

# CONFIG_NET_FC is not set

CONFIG_NET_POLL_CONTROLLER=y

CONFIG_NET_DMA=y

CONFIG_INET=y

# CONFIG_INET_AH is not set

# CONFIG_INET_ESP is not set

# CONFIG_INET_IPCOMP is not set

# CONFIG_INET_XFRM_TUNNEL is not set

# CONFIG_INET_TUNNEL is not set

# CONFIG_INET_XFRM_MODE_TRANSPORT is not set

# CONFIG_INET_XFRM_MODE_TUNNEL is not set

CONFIG_INET_DIAG=y

CONFIG_INET_TCP_DIAG=y

# CONFIG_INET6_AH is not set

# CONFIG_INET6_ESP is not set

# CONFIG_INET6_IPCOMP is not set

# CONFIG_INET6_XFRM_TUNNEL is not set

# CONFIG_INET6_TUNNEL is not set

# CONFIG_INET6_XFRM_MODE_TRANSPORT is not set

# CONFIG_INET6_XFRM_MODE_TUNNEL is not set

CONFIG_NET_RADIO=y
```

emerge madwifi-ng

```
Calculating dependencies... done!

>>> Emerging (1 of 1) net-wireless/madwifi-ng-0.9.2 to /

 * madwifi-0.9.2.tar.bz2 MD5 ;-) ...                                                                                        [ ok ]

 * madwifi-0.9.2.tar.bz2 RMD160 ;-) ...                                                                                     [ ok ]

 * madwifi-0.9.2.tar.bz2 SHA1 ;-) ...                                                                                       [ ok ]

 * madwifi-0.9.2.tar.bz2 SHA256 ;-) ...                                                                                     [ ok ]

 * madwifi-0.9.2.tar.bz2 size ;-) ...                                                                                       [ ok ]

 * checking ebuild checksums ;-) ...                                                                                        [ ok ]

 * checking auxfile checksums ;-) ...                                                                                       [ ok ]

 * checking miscfile checksums ;-) ...                                                                                      [ ok ]

 * checking madwifi-0.9.2.tar.bz2 ;-) ...                                                                                   [ ok ]

 * Determining the location of the kernel source code

 * Found kernel source directory:

 *     /usr/src/linux

 * Found kernel object directory:

 *     /lib/modules/2.6.18-gentoo-r4/build

 * Found sources for kernel version:

 *     2.6.18-gentoo-r4

 * Checking for suitable kernel configuration options...                                                                    [ ok ]

>>> Unpacking source...

>>> Unpacking madwifi-0.9.2.tar.bz2 to /var/tmp/portage/madwifi-ng-0.9.2/work

 * Applying madwifi-ng-0.9.2-ath_intr.diff ...                                                                              [ ok ]

 * Applying madwifi-ng-0.9.2-config.h.diff ...                                                                              [ ok ]

 * Applying madwifi-ng-0.9.2-crypto_cipher_encrypt_one.diff ...                                                             [ ok ]

 * Converting madwifi-0.9.2/ath/Makefile to use M= instead of SUBDIRS= ...                                                  [ ok ]

 * Converting madwifi-0.9.2/net80211/Makefile to use M= instead of SUBDIRS= ...                                             [ ok ]

 * Converting madwifi-0.9.2/ath_rate/amrr/Makefile to use M= instead of SUBDIRS= ...                                        [ ok ]

 * Converting madwifi-0.9.2/ath_rate/onoe/Makefile to use M= instead of SUBDIRS= ...                                        [ ok ]

 * Converting madwifi-0.9.2/ath_rate/sample/Makefile to use M= instead of SUBDIRS= ...                                      [ ok ]

>>> Source unpacked.

>>> Compiling source in /var/tmp/portage/madwifi-ng-0.9.2/work/madwifi-0.9.2 ...

 * Applying madwifi-ng-uudecode-gcda-fix.patch ...                                                                          [ ok ]

The following settings will be used for compilation:

TARGET       : x86_64-elf

OS           : linux

ARCH         : amd64

BUS          : PCI

KERNELRELEASE: 2.6.18-gentoo-r4

KERNELPATH   : /lib/modules/2.6.18-gentoo-r4/build

KERNELCONF   : /lib/modules/2.6.18-gentoo-r4/build/.config

KMODPATH     : /lib/modules/2.6.18-gentoo-r4/net

KMODSUF      : ko

 * Preparing ath_hal module

make -C /lib/modules/2.6.18-gentoo-r4/build M=/var/tmp/portage/madwifi-ng-0.9.2/work/madwifi-0.9.2/ath modules

make[1]: Entering directory `/usr/src/linux-2.6.18-gentoo-r4'

  CC [M]  /var/tmp/portage/madwifi-ng-0.9.2/work/madwifi-0.9.2/ath/ah_osdep.o

  HOSTCC  /var/tmp/portage/madwifi-ng-0.9.2/work/madwifi-0.9.2/ath/uudecode.o

  CC [M]  /var/tmp/portage/madwifi-ng-0.9.2/work/madwifi-0.9.2/ath/if_ath.o

  CC [M]  /var/tmp/portage/madwifi-ng-0.9.2/work/madwifi-0.9.2/ath/if_ath_pci.o

  HOSTLD  /var/tmp/portage/madwifi-ng-0.9.2/work/madwifi-0.9.2/ath/uudecode

  UUDECODE /var/tmp/portage/madwifi-ng-0.9.2/work/madwifi-0.9.2/ath/x86_64-elf.hal.o

  LD [M]  /var/tmp/portage/madwifi-ng-0.9.2/work/madwifi-0.9.2/ath/ath_pci.o

  LD [M]  /var/tmp/portage/madwifi-ng-0.9.2/work/madwifi-0.9.2/ath/ath_hal.o

  Building modules, stage 2.

  MODPOST

WARNING: "ath_rate_setupxtxdesc" [/var/tmp/portage/madwifi-ng-0.9.2/work/madwifi-0.9.2/ath/ath_pci.ko] undefined!

WARNING: "ath_rate_newstate" [/var/tmp/portage/madwifi-ng-0.9.2/work/madwifi-0.9.2/ath/ath_pci.ko] undefined!

WARNING: "ieee80211_find_txnode" [/var/tmp/portage/madwifi-ng-0.9.2/work/madwifi-0.9.2/ath/ath_pci.ko] undefined!

WARNING: "ieee80211_getrssi" [/var/tmp/portage/madwifi-ng-0.9.2/work/madwifi-0.9.2/ath/ath_pci.ko] undefined!

WARNING: "ieee80211_chan2mode" [/var/tmp/portage/madwifi-ng-0.9.2/work/madwifi-0.9.2/ath/ath_pci.ko] undefined!

WARNING: "ieee80211_crypto_encap" [/var/tmp/portage/madwifi-ng-0.9.2/work/madwifi-0.9.2/ath/ath_pci.ko] undefined!

WARNING: "ieee80211_dturbo_switch" [/var/tmp/portage/madwifi-ng-0.9.2/work/madwifi-0.9.2/ath/ath_pci.ko] undefined!

WARNING: "ath_rate_findrate" [/var/tmp/portage/madwifi-ng-0.9.2/work/madwifi-0.9.2/ath/ath_pci.ko] undefined!

WARNING: "ath_rate_node_init" [/var/tmp/portage/madwifi-ng-0.9.2/work/madwifi-0.9.2/ath/ath_pci.ko] undefined!

WARNING: "ieee80211_state_name" [/var/tmp/portage/madwifi-ng-0.9.2/work/madwifi-0.9.2/ath/ath_pci.ko] undefined!

WARNING: "ieee80211_chan2ieee" [/var/tmp/portage/madwifi-ng-0.9.2/work/madwifi-0.9.2/ath/ath_pci.ko] undefined!

WARNING: "ieee80211_mark_dfs" [/var/tmp/portage/madwifi-ng-0.9.2/work/madwifi-0.9.2/ath/ath_pci.ko] undefined!

WARNING: "ieee80211_announce" [/var/tmp/portage/madwifi-ng-0.9.2/work/madwifi-0.9.2/ath/ath_pci.ko] undefined!

WARNING: "ieee80211_vap_detach" [/var/tmp/portage/madwifi-ng-0.9.2/work/madwifi-0.9.2/ath/ath_pci.ko] undefined!

WARNING: "ieee80211_start_running" [/var/tmp/portage/madwifi-ng-0.9.2/work/madwifi-0.9.2/ath/ath_pci.ko] undefined!

WARNING: "ieee80211_media_status" [/var/tmp/portage/madwifi-ng-0.9.2/work/madwifi-0.9.2/ath/ath_pci.ko] undefined!

WARNING: "ieee80211_input_all" [/var/tmp/portage/madwifi-ng-0.9.2/work/madwifi-0.9.2/ath/ath_pci.ko] undefined!

WARNING: "ieee80211_wme_acnames" [/var/tmp/portage/madwifi-ng-0.9.2/work/madwifi-0.9.2/ath/ath_pci.ko] undefined!

WARNING: "ieee80211_create_vap" [/var/tmp/portage/madwifi-ng-0.9.2/work/madwifi-0.9.2/ath/ath_pci.ko] undefined!

WARNING: "ath_rate_detach" [/var/tmp/portage/madwifi-ng-0.9.2/work/madwifi-0.9.2/ath/ath_pci.ko] undefined!

WARNING: "ieee80211_send_qosnulldata" [/var/tmp/portage/madwifi-ng-0.9.2/work/madwifi-0.9.2/ath/ath_pci.ko] undefined!

WARNING: "ath_rate_node_cleanup" [/var/tmp/portage/madwifi-ng-0.9.2/work/madwifi-0.9.2/ath/ath_pci.ko] undefined!

WARNING: "ieee80211_ibss_merge" [/var/tmp/portage/madwifi-ng-0.9.2/work/madwifi-0.9.2/ath/ath_pci.ko] undefined!

WARNING: "ieee80211_vap_attach" [/var/tmp/portage/madwifi-ng-0.9.2/work/madwifi-0.9.2/ath/ath_pci.ko] undefined!

WARNING: "ieee80211_iterate_nodes" [/var/tmp/portage/madwifi-ng-0.9.2/work/madwifi-0.9.2/ath/ath_pci.ko] undefined!

WARNING: "ieee80211_getcfframe" [/var/tmp/portage/madwifi-ng-0.9.2/work/madwifi-0.9.2/ath/ath_pci.ko] undefined!

WARNING: "ieee80211_beacon_alloc" [/var/tmp/portage/madwifi-ng-0.9.2/work/madwifi-0.9.2/ath/ath_pci.ko] undefined!

WARNING: "ieee80211_beacon_miss" [/var/tmp/portage/madwifi-ng-0.9.2/work/madwifi-0.9.2/ath/ath_pci.ko] undefined!

WARNING: "ieee80211_media_change" [/var/tmp/portage/madwifi-ng-0.9.2/work/madwifi-0.9.2/ath/ath_pci.ko] undefined!

WARNING: "ieee80211_crypto_delkey" [/var/tmp/portage/madwifi-ng-0.9.2/work/madwifi-0.9.2/ath/ath_pci.ko] undefined!

WARNING: "ieee80211_note" [/var/tmp/portage/madwifi-ng-0.9.2/work/madwifi-0.9.2/ath/ath_pci.ko] undefined!

WARNING: "ieee80211_cipher_none" [/var/tmp/portage/madwifi-ng-0.9.2/work/madwifi-0.9.2/ath/ath_pci.ko] undefined!

WARNING: "ieee80211_stop_running" [/var/tmp/portage/madwifi-ng-0.9.2/work/madwifi-0.9.2/ath/ath_pci.ko] undefined!

WARNING: "ieee80211_dfs_test_return" [/var/tmp/portage/madwifi-ng-0.9.2/work/madwifi-0.9.2/ath/ath_pci.ko] undefined!

WARNING: "ieee80211_ioctl_create_vap" [/var/tmp/portage/madwifi-ng-0.9.2/work/madwifi-0.9.2/ath/ath_pci.ko] undefined!

WARNING: "ieee80211_dump_pkt" [/var/tmp/portage/madwifi-ng-0.9.2/work/madwifi-0.9.2/ath/ath_pci.ko] undefined!

WARNING: "ath_rate_dynamic_proc_register" [/var/tmp/portage/madwifi-ng-0.9.2/work/madwifi-0.9.2/ath/ath_pci.ko] undefined!

WARNING: "ieee80211_crypto_setkey" [/var/tmp/portage/madwifi-ng-0.9.2/work/madwifi-0.9.2/ath/ath_pci.ko] undefined!

WARNING: "ieee80211_crypto_newkey" [/var/tmp/portage/madwifi-ng-0.9.2/work/madwifi-0.9.2/ath/ath_pci.ko] undefined!

WARNING: "ath_rate_newassoc" [/var/tmp/portage/madwifi-ng-0.9.2/work/madwifi-0.9.2/ath/ath_pci.ko] undefined!

WARNING: "ieee80211_input_monitor" [/var/tmp/portage/madwifi-ng-0.9.2/work/madwifi-0.9.2/ath/ath_pci.ko] undefined!

WARNING: "ieee80211_free_node" [/var/tmp/portage/madwifi-ng-0.9.2/work/madwifi-0.9.2/ath/ath_pci.ko] undefined!

WARNING: "ieee80211_ifdetach" [/var/tmp/portage/madwifi-ng-0.9.2/work/madwifi-0.9.2/ath/ath_pci.ko] undefined!

WARNING: "ieee80211_vap_setup" [/var/tmp/portage/madwifi-ng-0.9.2/work/madwifi-0.9.2/ath/ath_pci.ko] undefined!

WARNING: "ether_sprintf" [/var/tmp/portage/madwifi-ng-0.9.2/work/madwifi-0.9.2/ath/ath_pci.ko] undefined!

WARNING: "ath_rate_attach" [/var/tmp/portage/madwifi-ng-0.9.2/work/madwifi-0.9.2/ath/ath_pci.ko] undefined!

WARNING: "ieee80211_find_rxnode" [/var/tmp/portage/madwifi-ng-0.9.2/work/madwifi-0.9.2/ath/ath_pci.ko] undefined!

WARNING: "ieee80211_find_channel" [/var/tmp/portage/madwifi-ng-0.9.2/work/madwifi-0.9.2/ath/ath_pci.ko] undefined!

WARNING: "ieee80211_beacon_update" [/var/tmp/portage/madwifi-ng-0.9.2/work/madwifi-0.9.2/ath/ath_pci.ko] undefined!

WARNING: "ieee80211_ifattach" [/var/tmp/portage/madwifi-ng-0.9.2/work/madwifi-0.9.2/ath/ath_pci.ko] undefined!

WARNING: "ieee80211_input" [/var/tmp/portage/madwifi-ng-0.9.2/work/madwifi-0.9.2/ath/ath_pci.ko] undefined!

WARNING: "ieee80211_encap" [/var/tmp/portage/madwifi-ng-0.9.2/work/madwifi-0.9.2/ath/ath_pci.ko] undefined!

WARNING: "ath_rate_tx_complete" [/var/tmp/portage/madwifi-ng-0.9.2/work/madwifi-0.9.2/ath/ath_pci.ko] undefined!

  CC      /var/tmp/portage/madwifi-ng-0.9.2/work/madwifi-0.9.2/ath/ath_hal.mod.o

  CC      /var/tmp/portage/madwifi-ng-0.9.2/work/madwifi-0.9.2/ath/ath_pci.mod.o

  LD [M]  /var/tmp/portage/madwifi-ng-0.9.2/work/madwifi-0.9.2/ath/ath_hal.ko

  LD [M]  /var/tmp/portage/madwifi-ng-0.9.2/work/madwifi-0.9.2/ath/ath_pci.ko

make[1]: Leaving directory `/usr/src/linux-2.6.18-gentoo-r4'

 * Preparing wlan module

make -C /lib/modules/2.6.18-gentoo-r4/build M=/var/tmp/portage/madwifi-ng-0.9.2/work/madwifi-0.9.2/net80211 modules

make[1]: Entering directory `/usr/src/linux-2.6.18-gentoo-r4'

  CC [M]  /var/tmp/portage/madwifi-ng-0.9.2/work/madwifi-0.9.2/net80211/if_media.o

  CC [M]  /var/tmp/portage/madwifi-ng-0.9.2/work/madwifi-0.9.2/net80211/ieee80211.o

  CC [M]  /var/tmp/portage/madwifi-ng-0.9.2/work/madwifi-0.9.2/net80211/ieee80211_beacon.o

  CC [M]  /var/tmp/portage/madwifi-ng-0.9.2/work/madwifi-0.9.2/net80211/ieee80211_crypto.o

  CC [M]  /var/tmp/portage/madwifi-ng-0.9.2/work/madwifi-0.9.2/net80211/ieee80211_crypto_none.o

  CC [M]  /var/tmp/portage/madwifi-ng-0.9.2/work/madwifi-0.9.2/net80211/ieee80211_input.o

  CC [M]  /var/tmp/portage/madwifi-ng-0.9.2/work/madwifi-0.9.2/net80211/ieee80211_node.o

  CC [M]  /var/tmp/portage/madwifi-ng-0.9.2/work/madwifi-0.9.2/net80211/ieee80211_output.o

  CC [M]  /var/tmp/portage/madwifi-ng-0.9.2/work/madwifi-0.9.2/net80211/ieee80211_power.o

  CC [M]  /var/tmp/portage/madwifi-ng-0.9.2/work/madwifi-0.9.2/net80211/ieee80211_proto.o

  CC [M]  /var/tmp/portage/madwifi-ng-0.9.2/work/madwifi-0.9.2/net80211/ieee80211_scan.o

  CC [M]  /var/tmp/portage/madwifi-ng-0.9.2/work/madwifi-0.9.2/net80211/ieee80211_wireless.o

  CC [M]  /var/tmp/portage/madwifi-ng-0.9.2/work/madwifi-0.9.2/net80211/ieee80211_linux.o

  CC [M]  /var/tmp/portage/madwifi-ng-0.9.2/work/madwifi-0.9.2/net80211/ieee80211_monitor.o

  CC [M]  /var/tmp/portage/madwifi-ng-0.9.2/work/madwifi-0.9.2/net80211/ieee80211_acl.o

  CC [M]  /var/tmp/portage/madwifi-ng-0.9.2/work/madwifi-0.9.2/net80211/ieee80211_crypto_ccmp.o

  CC [M]  /var/tmp/portage/madwifi-ng-0.9.2/work/madwifi-0.9.2/net80211/ieee80211_scan_ap.o

  CC [M]  /var/tmp/portage/madwifi-ng-0.9.2/work/madwifi-0.9.2/net80211/ieee80211_scan_sta.o

  CC [M]  /var/tmp/portage/madwifi-ng-0.9.2/work/madwifi-0.9.2/net80211/ieee80211_crypto_tkip.o

  CC [M]  /var/tmp/portage/madwifi-ng-0.9.2/work/madwifi-0.9.2/net80211/ieee80211_crypto_wep.o

  CC [M]  /var/tmp/portage/madwifi-ng-0.9.2/work/madwifi-0.9.2/net80211/ieee80211_xauth.o

  LD [M]  /var/tmp/portage/madwifi-ng-0.9.2/work/madwifi-0.9.2/net80211/wlan.o

  LD [M]  /var/tmp/portage/madwifi-ng-0.9.2/work/madwifi-0.9.2/net80211/wlan_wep.o

  LD [M]  /var/tmp/portage/madwifi-ng-0.9.2/work/madwifi-0.9.2/net80211/wlan_tkip.o

  LD [M]  /var/tmp/portage/madwifi-ng-0.9.2/work/madwifi-0.9.2/net80211/wlan_ccmp.o

  LD [M]  /var/tmp/portage/madwifi-ng-0.9.2/work/madwifi-0.9.2/net80211/wlan_acl.o

  LD [M]  /var/tmp/portage/madwifi-ng-0.9.2/work/madwifi-0.9.2/net80211/wlan_xauth.o

  LD [M]  /var/tmp/portage/madwifi-ng-0.9.2/work/madwifi-0.9.2/net80211/wlan_scan_sta.o

  LD [M]  /var/tmp/portage/madwifi-ng-0.9.2/work/madwifi-0.9.2/net80211/wlan_scan_ap.o

  Building modules, stage 2.

  MODPOST

  CC      /var/tmp/portage/madwifi-ng-0.9.2/work/madwifi-0.9.2/net80211/wlan.mod.o

  CC      /var/tmp/portage/madwifi-ng-0.9.2/work/madwifi-0.9.2/net80211/wlan_acl.mod.o

  CC      /var/tmp/portage/madwifi-ng-0.9.2/work/madwifi-0.9.2/net80211/wlan_ccmp.mod.o

  CC      /var/tmp/portage/madwifi-ng-0.9.2/work/madwifi-0.9.2/net80211/wlan_scan_ap.mod.o

  CC      /var/tmp/portage/madwifi-ng-0.9.2/work/madwifi-0.9.2/net80211/wlan_scan_sta.mod.o

  CC      /var/tmp/portage/madwifi-ng-0.9.2/work/madwifi-0.9.2/net80211/wlan_tkip.mod.o

  CC      /var/tmp/portage/madwifi-ng-0.9.2/work/madwifi-0.9.2/net80211/wlan_wep.mod.o

  CC      /var/tmp/portage/madwifi-ng-0.9.2/work/madwifi-0.9.2/net80211/wlan_xauth.mod.o

  LD [M]  /var/tmp/portage/madwifi-ng-0.9.2/work/madwifi-0.9.2/net80211/wlan.ko

  LD [M]  /var/tmp/portage/madwifi-ng-0.9.2/work/madwifi-0.9.2/net80211/wlan_acl.ko

  LD [M]  /var/tmp/portage/madwifi-ng-0.9.2/work/madwifi-0.9.2/net80211/wlan_ccmp.ko

  LD [M]  /var/tmp/portage/madwifi-ng-0.9.2/work/madwifi-0.9.2/net80211/wlan_scan_ap.ko

  LD [M]  /var/tmp/portage/madwifi-ng-0.9.2/work/madwifi-0.9.2/net80211/wlan_scan_sta.ko

  LD [M]  /var/tmp/portage/madwifi-ng-0.9.2/work/madwifi-0.9.2/net80211/wlan_tkip.ko

  LD [M]  /var/tmp/portage/madwifi-ng-0.9.2/work/madwifi-0.9.2/net80211/wlan_wep.ko

  LD [M]  /var/tmp/portage/madwifi-ng-0.9.2/work/madwifi-0.9.2/net80211/wlan_xauth.ko

make[1]: Leaving directory `/usr/src/linux-2.6.18-gentoo-r4'

 * Preparing ath_rate_sample module

make -C /lib/modules/2.6.18-gentoo-r4/build M=/var/tmp/portage/madwifi-ng-0.9.2/work/madwifi-0.9.2/ath_rate/sample modules

make[1]: Entering directory `/usr/src/linux-2.6.18-gentoo-r4'

  CC [M]  /var/tmp/portage/madwifi-ng-0.9.2/work/madwifi-0.9.2/ath_rate/sample/sample.o

  LD [M]  /var/tmp/portage/madwifi-ng-0.9.2/work/madwifi-0.9.2/ath_rate/sample/ath_rate_sample.o

  Building modules, stage 2.

  MODPOST

WARNING: "ieee80211_proc_vcreate" [/var/tmp/portage/madwifi-ng-0.9.2/work/madwifi-0.9.2/ath_rate/sample/ath_rate_sample.ko] undefined!

WARNING: "ieee80211_iterate_nodes" [/var/tmp/portage/madwifi-ng-0.9.2/work/madwifi-0.9.2/ath_rate/sample/ath_rate_sample.ko] undefined!

WARNING: "ath_hal_computetxtime" [/var/tmp/portage/madwifi-ng-0.9.2/work/madwifi-0.9.2/ath_rate/sample/ath_rate_sample.ko] undefined!

WARNING: "ether_sprintf" [/var/tmp/portage/madwifi-ng-0.9.2/work/madwifi-0.9.2/ath_rate/sample/ath_rate_sample.ko] undefined!

  CC      /var/tmp/portage/madwifi-ng-0.9.2/work/madwifi-0.9.2/ath_rate/sample/ath_rate_sample.mod.o

  LD [M]  /var/tmp/portage/madwifi-ng-0.9.2/work/madwifi-0.9.2/ath_rate/sample/ath_rate_sample.ko

make[1]: Leaving directory `/usr/src/linux-2.6.18-gentoo-r4'

>>> Source compiled.

>>> Test phase [not enabled]: net-wireless/madwifi-ng-0.9.2

>>> Install madwifi-ng-0.9.2 into /var/tmp/portage/madwifi-ng-0.9.2/image/ category net-wireless

 * Installing ath_hal module

 * Installing wlan module

 * Installing wlan_acl module

 * Installing wlan_ccmp module

 * Installing wlan_tkip module

 * Installing wlan_wep module

 * Installing wlan_xauth module

 * Installing wlan_scan_sta module

 * Installing wlan_scan_ap module

 * Installing ath_rate_sample module

 * Installing ath_pci module

 * Preparing file for modules.d ...                                                                                         [ ok ]

>>> Completed installing madwifi-ng-0.9.2 into /var/tmp/portage/madwifi-ng-0.9.2/image/

man:

strip: x86_64-pc-linux-gnu-strip --strip-unneeded

>>> Merging net-wireless/madwifi-ng-0.9.2 to /

--- /etc/

--- /etc/modules.d/

>>> /etc/modules.d/ath_pci

--- /lib/

--- /lib/modules/

--- /lib/modules/2.6.18-gentoo-r4/

--- /lib/modules/2.6.18-gentoo-r4/net/

>>> /lib/modules/2.6.18-gentoo-r4/net/wlan_xauth.ko

>>> /lib/modules/2.6.18-gentoo-r4/net/wlan_scan_sta.ko

>>> /lib/modules/2.6.18-gentoo-r4/net/wlan_scan_ap.ko

>>> /lib/modules/2.6.18-gentoo-r4/net/wlan_ccmp.ko

>>> /lib/modules/2.6.18-gentoo-r4/net/ath_hal.ko

>>> /lib/modules/2.6.18-gentoo-r4/net/ath_pci.ko

>>> /lib/modules/2.6.18-gentoo-r4/net/wlan_acl.ko

>>> /lib/modules/2.6.18-gentoo-r4/net/ath_rate_sample.ko

>>> /lib/modules/2.6.18-gentoo-r4/net/wlan_wep.ko

>>> /lib/modules/2.6.18-gentoo-r4/net/wlan_tkip.ko

>>> /lib/modules/2.6.18-gentoo-r4/net/wlan.ko

--- /usr/

--- /usr/share/

--- /usr/share/doc/

--- /usr/share/doc/madwifi-ng-0.9.2/

>>> /usr/share/doc/madwifi-ng-0.9.2/README.gz

>>> /usr/share/doc/madwifi-ng-0.9.2/THANKS.gz

>>> /usr/share/doc/madwifi-ng-0.9.2/users-guide.pdf.gz

>>> /usr/share/doc/madwifi-ng-0.9.2/WEP-HOWTO.txt.gz

--- /usr/include/

--- /usr/include/madwifi/

--- /usr/include/madwifi/net80211/

>>> /usr/include/madwifi/net80211/if_athproto.h

>>> /usr/include/madwifi/net80211/ieee80211_linux.h

>>> /usr/include/madwifi/net80211/ieee80211_crypto.h

>>> /usr/include/madwifi/net80211/ieee80211_monitor.h

>>> /usr/include/madwifi/net80211/if_ethersubr.h

>>> /usr/include/madwifi/net80211/ieee80211_radiotap.h

>>> /usr/include/madwifi/net80211/ieee80211_var.h

>>> /usr/include/madwifi/net80211/if_llc.h

>>> /usr/include/madwifi/net80211/ieee80211_ioctl.h

>>> /usr/include/madwifi/net80211/ieee80211_power.h

>>> /usr/include/madwifi/net80211/if_media.h

>>> /usr/include/madwifi/net80211/ieee80211_proto.h

>>> /usr/include/madwifi/net80211/ieee80211_node.h

>>> /usr/include/madwifi/net80211/ieee80211_scan.h

>>> /usr/include/madwifi/net80211/version.h

>>> /usr/include/madwifi/net80211/ieee80211.h

>>> /usr/include/madwifi/net80211/_ieee80211.h

--- /usr/include/madwifi/include/

>>> /usr/include/madwifi/include/compat.h

>>> Safely unmerging already-installed instance...

--- !mtime obj /usr/share/doc/madwifi-ng-0.9.2/users-guide.pdf.gz

--- !mtime obj /usr/share/doc/madwifi-ng-0.9.2/WEP-HOWTO.txt.gz

--- !mtime obj /usr/share/doc/madwifi-ng-0.9.2/THANKS.gz

--- !mtime obj /usr/share/doc/madwifi-ng-0.9.2/README.gz

--- !mtime obj /usr/include/madwifi/net80211/version.h

--- !mtime obj /usr/include/madwifi/net80211/if_media.h

--- !mtime obj /usr/include/madwifi/net80211/if_llc.h

--- !mtime obj /usr/include/madwifi/net80211/if_ethersubr.h

--- !mtime obj /usr/include/madwifi/net80211/if_athproto.h

--- !mtime obj /usr/include/madwifi/net80211/ieee80211_var.h

--- !mtime obj /usr/include/madwifi/net80211/ieee80211_scan.h

--- !mtime obj /usr/include/madwifi/net80211/ieee80211_radiotap.h

--- !mtime obj /usr/include/madwifi/net80211/ieee80211_proto.h

--- !mtime obj /usr/include/madwifi/net80211/ieee80211_power.h

--- !mtime obj /usr/include/madwifi/net80211/ieee80211_node.h

--- !mtime obj /usr/include/madwifi/net80211/ieee80211_monitor.h

--- !mtime obj /usr/include/madwifi/net80211/ieee80211_linux.h

--- !mtime obj /usr/include/madwifi/net80211/ieee80211_ioctl.h

--- !mtime obj /usr/include/madwifi/net80211/ieee80211_crypto.h

--- !mtime obj /usr/include/madwifi/net80211/ieee80211.h

--- !mtime obj /usr/include/madwifi/net80211/_ieee80211.h

--- !mtime obj /usr/include/madwifi/include/compat.h

--- cfgpro obj /lib/modules/2.6.18-gentoo-r4/net/wlan_xauth.ko

--- cfgpro obj /lib/modules/2.6.18-gentoo-r4/net/wlan_wep.ko

--- cfgpro obj /lib/modules/2.6.18-gentoo-r4/net/wlan_tkip.ko

--- cfgpro obj /lib/modules/2.6.18-gentoo-r4/net/wlan_scan_sta.ko

--- cfgpro obj /lib/modules/2.6.18-gentoo-r4/net/wlan_scan_ap.ko

--- cfgpro obj /lib/modules/2.6.18-gentoo-r4/net/wlan_ccmp.ko

--- cfgpro obj /lib/modules/2.6.18-gentoo-r4/net/wlan_acl.ko

--- cfgpro obj /lib/modules/2.6.18-gentoo-r4/net/wlan.ko

--- cfgpro obj /lib/modules/2.6.18-gentoo-r4/net/ath_rate_sample.ko

--- cfgpro obj /lib/modules/2.6.18-gentoo-r4/net/ath_pci.ko

--- cfgpro obj /lib/modules/2.6.18-gentoo-r4/net/ath_hal.ko

--- cfgpro dir /lib/modules/2.6.18-gentoo-r4/net

--- cfgpro dir /lib/modules/2.6.18-gentoo-r4

--- cfgpro obj /etc/modules.d/ath_pci

--- cfgpro dir /etc/modules.d

--- !empty dir /usr/share/doc/madwifi-ng-0.9.2

--- !empty dir /usr/share/doc

--- !empty dir /usr/share

--- !empty dir /usr/include/madwifi/net80211

--- !empty dir /usr/include/madwifi/include

--- !empty dir /usr/include/madwifi

--- !empty dir /usr/include

--- !empty dir /usr

--- !empty dir /lib/modules

--- !empty dir /lib

--- !empty dir /etc

 * Removing net-wireless/madwifi-ng-0.9.2 from moduledb.

>>> Regenerating /etc/ld.so.cache...

>>> Original instance of package unmerged safely.

 * Removing old ath_rate modules

 * Updating module dependencies for 2.6.18-gentoo-r4 ...                                                                    [ ok ]

 * Adding module to moduledb.

 *

 * Interfaces (athX) are now automatically created upon loading the ath_pci

 * module.

 *

 * The type of the created interface can be controlled through the 'autocreate'

 * module parameter.

 *

 * If you use net-wireless/wpa_supplicant or net-wireless/hostapd with madwifi

 * you should remerge them now.

 *

>>> Regenerating /etc/ld.so.cache...

>>> net-wireless/madwifi-ng-0.9.2 merged.

>>> No packages selected for removal by clean.

>>> Auto-cleaning packages...

>>> No outdated packages were found on your system.

 * GNU info directory index is up-to-date.
```

----------

## cheuschober

I should also note that I can manually load 'wlan_scan_sta' but I'm concerned by this error message. If I can manually load the module and the module works then where could the problem be with the auto load? How can I correct it?

Many thanks.

----------

## fernercc

Check out the modules autoload file in /etc

----------

## cheuschober

 *fernercc wrote:*   

> Check out the modules autoload file in /etc

 

Yes, I know I could add the module in question to modules.autoload but the point is that ath_pci tries to load the module itself and fails/errors. I would much rather see that ath_pci is corrected than just try to load the module twice knowing full-well that the first time is going to be a failure.

Best,

~C

----------

## sdunne

Getting exactly the same problem myself with my Netgear WPN511. I also see the initial load attempt fail. I symlinked /etc/init.d/net.ath0 to net.lo and have /etc/conf.d/net modded as below. 

```

lspci

02:00.0 Ethernet controller: Atheros Communications, Inc. AR5212 802.11abg NIC (rev 01)

/etc/conf.d/net

config_ath0=( "dhcp" )

modules=( "wpa_supplicant" )

wpa_supplicant_ath0="-Dmadwifi" # For Atheros based cards

/var/log/messages

Jan  9 00:01:12 xxxx ath_hal: module license 'Proprietary' taints kernel.

Jan  9 00:01:12 xxxx ath_hal: 0.9.17.2 (AR5210, AR5211, AR5212, RF5111, RF5112, RF2413, RF5413)

Jan  9 00:01:12 xxxx wlan: 0.8.4.2 (0.9.2.1)

Jan  9 00:01:12 xxxx ath_rate_sample: 1.2 (0.9.2.1)

Jan  9 00:01:12 xxxx ath_pci: 0.9.4.5 (0.9.2.1)

Jan  9 00:01:12 xxxx PCI: Enabling device 0000:02:00.0 (0000 -> 0002)

Jan  9 00:01:12 xxxx ACPI: PCI Interrupt 0000:02:00.0[A] -> Link [LNK5] -> GSI 11 (level, low) -> IRQ 11

Jan  9 00:01:12 xxxx wifi0: 11b rates: 1Mbps 2Mbps 5.5Mbps 11Mbps

Jan  9 00:01:12 xxxx wifi0: 11g rates: 1Mbps 2Mbps 5.5Mbps 11Mbps 6Mbps 9Mbps 12Mbps 18Mbps 24Mbps 36Mbps 48Mbps 54Mbps

Jan  9 00:01:12 xxxx wifi0: turboG rates: 6Mbps 12Mbps 18Mbps 24Mbps 36Mbps 48Mbps 54Mbps

Jan  9 00:01:12 xxxx wifi0: H/W encryption support: WEP AES AES_CCM TKIP

Jan  9 00:01:12 xxxx wifi0: mac 7.9 phy 4.5 radio 5.6

Jan  9 00:01:12 xxxx wifi0: Use hw queue 1 for WME_AC_BE traffic

Jan  9 00:01:12 xxxx wifi0: Use hw queue 0 for WME_AC_BK traffic

Jan  9 00:01:12 xxxx wifi0: Use hw queue 2 for WME_AC_VI traffic

Jan  9 00:01:12 xxxx wifi0: Use hw queue 3 for WME_AC_VO traffic

Jan  9 00:01:12 xxxx wifi0: Use hw queue 8 for CAB traffic

Jan  9 00:01:12 xxxx wifi0: Use hw queue 9 for beacons

Jan  9 00:01:12 xxxx couldn't load module 'wlan_scan_sta' (-38)             <<<======= Here !!

Jan  9 00:01:12 xxxx unable to load wlan_scan_sta

Jan  9 00:01:12 xxxx wifi0: Atheros 5212: mem=0x32000000, irq=11

```

Annoying because when I initially started playing with madwifi-ng, I *could* and did get a AP scan. Now I can't  :Sad:  I also seem unable to connect to my with WPA2_PSK (or RSN as it seems to be in wpa_supplicant.conf)

```
 kernel is 2.6.18-gentoo-r6

* net-wireless/wpa_supplicant 

     Available versions:  0.4.9 0.5.4 ~0.5.5 ~0.5.6

     Installed:           0.5.4

     Homepage:            http://hostap.epitest.fi/wpa_supplicant/

     Description:         IEEE 802.1X/WPA supplicant for secure wireless transfers

* net-wireless/madwifi-ng

     Available versions:  0.9.2 0.9.2.1

     Installed:           0.9.2.1

     Homepage:            http://www.madwifi.org/

     Description:         Next Generation driver for Atheros based IEEE 802.11a/b/g wireless LAN cards

* net-wireless/madwifi-ng-tools

     Available versions:  0.9.2

     Installed:           0.9.2

     Homepage:            http://www.madwifi.org/

     Description:         Next Generation tools for configuration of Atheros based IEEE 802.11a/b/g wireless LAN cards

```

----------

## Chris W

Is udev coldplug  trying to start a service as soon as it sees the module go in, but before wifi0 is autocreated?

Perhaps try again after rebooting with RC_PLUG_SERVICES="!net.*" in /etc/conf.d/rc

----------

## Big Jim Slade

I'm getting the same thing with my madwifi.... I've put wlan_scan_sta, wlan_wep and wlan_scan_ap in the autoload deal because none of them would load on boot.  However, even with these in autoload I still can't associate on boot.  Instead, after the machine boots, I have to manually run "ifconfig ath0 up" and then it will associate.  Also, if I try to start it with the script, whether ath0 is up or down, it won't associate... it'll bring ath0 down if it is up and won't bring it back up.

What's the story with this module, and why do I have to manually bring up the interface in order for it to associate?

----------

## Chris W

 *Big Jim Slade wrote:*   

> I'm getting the same thing with my madwifi.... I've put wlan_scan_sta, wlan_wep and wlan_scan_ap in the autoload deal because none of them would load on boot.  

   You should only require wlan_scan_ap if you are trying to set up an access point.   wlan_wep should load when you try to set a WEP key.

 *Quote:*   

> However, even with these in autoload I still can't associate on boot.  Instead, after the machine boots, I have to manually run "ifconfig ath0 up" and then it will associate.  Also, if I try to start it with the script, whether ath0 is up or down, it won't associate... it'll bring ath0 down if it is up and won't bring it back up.

   Odd.  Assuming that you have net.ath0 in the default run level then I cannot explain this behaviour: I've never seen it.   When net.ath0 runs it should do an 'ifconfig ath0 up' as part of the process.   Does the script work as expected after you have manually upped/downed the interface once?

To help diagnose could you:  remove all the ath* and wlan* modules from the autoload file

 Remove net.ath0 from the boot/default run levels (rc-update del net.ath0)

 Run depmod to rebuild module dependencies 

 Reboot

 Ensure you are running the kernel pointed to by /usr/src/linux and against which you built madwifi.  

 post the output of lsmod, ifconfig ath0

 post the output of depmod -eF /usr/src/linux/System.map /lib/modules/$(uname -r)/net/{ath,wlan}*, perhaps there are broken dependencies  It is possible that the coldplug/hotplug support in udev is loading the ath_pci stuff and breaking in some ugly way.  If this is the case then lsmod will show ath_pci and probably others despite us not having loaded any module explicitly.

The content of your ath0 related /etc/conf.d/net entries would also be good to see.

----------

## sdunne

 *Chris W wrote:*   

> To help diagnose could you: 
> 
>  remove all the ath* and wlan* modules from the autoload file
> 
>  Remove net.ath0 from the boot/default run levels (rc-update del net.ath0)
> ...

 

OK, modules.autoload/kernel-2.6 cleared of ath* and wlan*

rc-update del net.ath0 run and rc-update show verifies it.                     

depmod run, no output produced.

lappie rebooted

kernel is "Linux xxxx 2.6.18-gentoo-r6 #11 Wed Jan 17 00:21:47 GMT 2007 i686 Intel(R) Pentium(R) 4 CPU 2.40GHz GenuineIntel GNU/Linux"

ls --lsa /usr/src/linux "0 lrwxrwxrwx 1 root root 23 Jan  4 09:41 /usr/src/linux -> linux-2.6.18-gentoo-r6/" This is the kernel madwifi-ng was compiled against.

lsmod

```

Module                  Size  Used by

snd_seq                36528  0 

snd_pcm_oss            33440  0 

snd_mixer_oss          12544  1 snd_pcm_oss

ath_pci                71456  0 

ath_rate_sample        11008  1 ath_pci

wlan                  152924  3 ath_pci,ath_rate_sample

ath_hal               189392  3 ath_pci,ath_rate_sample

snd_ali5451            16268  0 

snd_ac97_codec         79008  1 snd_ali5451

snd_ac97_bus            2048  1 snd_ac97_codec

snd_pcm                54792  3 snd_pcm_oss,snd_ali5451,snd_ac97_codec

snd_timer              15364  2 snd_seq,snd_pcm

snd                    36068  7 snd_seq,snd_pcm_oss,snd_mixer_oss,snd_ali5451,snd_ac97_codec,snd_pcm,snd_timer

snd_page_alloc          7048  1 snd_pcm

```

ifconfig ath0

```

ath0      Link encap:Ethernet  HWaddr 55:55:55:55:55:55 (hidden by me)  

          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)

```

depmod -eF /usr/src/linux/System.map /lib/modules/$(uname -r)/net/{ath,wlan}*

No output

Relevant /etc/conf.d/net

```
modules=( "ifconfig" )

config_ath0=( "dhcpd" )

modules=( "wpa_supplicant" )

wpa_supplicant_ath0="-dd -Dmadwifi" # For Atheros based cards

```

Just in case, here's a full copy of /etc/conf.d/net, with comments stripped as per the strip coments thread in tips.

```
xxxx /etc/wpa_supplicant $ confcat /etc/conf.d/net    

modules=( "ifconfig" )

modules=( "ifconfig" )

config_eth0=( "55.55.55.55/28" ) #hidden by me

config_ath0=( "dhcp" )

routes_eth0=(

        "default via 55.55.55.1"            # IPv4 default route

)

modules=( "wpa_supplicant" )

wpa_supplicant_ath0="-dd -Dmadwifi" # For Atheros based cards
```

----------

## sdunne

FYI: Without re-adding net.ath0 to rc-update and re-enabling the modules/autoload.d ath* and wan* entries, I can't reboot and reconnect to my main AP with WPA2 RSN. 

Re-enabling everything and rebooting, it comes up automatically !!

----------

## cheuschober

sdunne's woes are confirmed. I have the same behaviour with my WPA2 RSN network. Unless I manually enable/start these modules connection to the network doesn't happen nor does scanning for access points. Hearing that sdunne is running the same form of network I wouldn't be surprised if this was a more fringe-level issue, now, as I would suspect a majority of users are still on WEP networks or draft 802.11i (commonly, WPA).

----------

## Chris W

I'm quite happily using two madwifi cards as AP and station using WPA2

The ath* modules have loaded during boot (udev coldplug).  I have specifically disabled that because I only want some of my interfaces to start, and only when I'm ready from them.  Could you try again with 

```
RC_COLDPLUG="no"
```

 in /etc/conf.d/rc?  An alternate approach could be: 

```
RC_COLDPLUG="yes"

RC_PLUG_SERVICES="!net.*"
```

----------

## sdunne

Chris

  OK, I modded /etc/conf.d/rc as per your second suggestion. FYi I'm running udev 103, and have removed coldplug, hotplug-base & hotplug to give udev free reign. Even after doing this, emerge world keeps wanting to pull hotplug & hotplug-base back in again  :Sad: 

After confirming wlan* and ath* were commented out of /etc/modules.autoload.d/kernel-2.6, I rebooted and verified that wifi wasn't working. /etc/init.d/net.ath0 is still in rc-update the same as net.eth0. 

Stephen

== 

confcat /etc/conf.d/rc

```
xxxx ~ $ confcat /etc/conf.d/rc

RC_TTY_NUMBER=11

RC_PARALLEL_STARTUP="no"

RC_INTERACTIVE="yes"

RC_HOTPLUG="yes"

RC_COLDPLUG="yes"

RC_PLUG_SERVICES="!net.*"

RC_NET_STRICT_CHECKING="no"

RC_DOWN_INTERFACE="yes"

RC_VOLUME_ORDER="raid evms lvm dm"

RC_VERBOSE="no"

RC_BOOTLOG="no"

RC_BOOTCHART="no"

RC_USE_FSTAB="no"

RC_USE_CONFIG_PROFILE="yes"

RC_FORCE_AUTO="no"

RC_DEVICES="auto"

RC_DEVICE_TARBALL="no"

RC_SWAP_ERASE="no"

RC_DMESG_LEVEL="1"

RC_RETRY_KILL="yes"

RC_RETRY_TIMEOUT=1

RC_RETRY_COUNT=5

RC_FAIL_ON_ZOMBIE="no"

RC_KILL_CHILDREN="no"

RC_WAIT_ON_START="0.1"

svcdir="/var/lib/init.d"

svcmount="no"

svcfstype="tmpfs"

svcsize=2048
```

Post reboot lsmod

```
xxxx ~ $ lsmod

Module                  Size  Used by

ath_pci                71456  0 

ath_rate_sample        11008  1 ath_pci

wlan                  152924  3 ath_pci,ath_rate_sample

ath_hal               189392  3 ath_pci,ath_rate_sample
```

```
xxxx ~ $ emw

These are the packages that would be merged, in order:

Calculating world dependencies... done!

[ebuild  N    ] sys-apps/hotplug-base-20040401  40 kB 

[ebuild  N    ] sys-apps/hotplug-20040923-r2  0 kB 

Total size of downloads: 40 kB

Would you like to merge these packages? [Yes/No] n

Quitting.

xxxx ~ $ alias emw

alias emw='emerge -uDNav world'
```

Last edited by sdunne on Sun Jan 21, 2007 1:01 am; edited 1 time in total

----------

## cheuschober

sdunne: what does your dmesg give when ath_pci is started (in the new environment) ?

----------

## sdunne

I've posted the whole of /var/log/dmesg to be on the safe side !

Stephen

== 

 *Quote:*   

> Linux version 2.6.18-gentoo-r6 (root@xxxx) (gcc version 4.1.1 (Gentoo 4.1.1-r3)) #12 Sun Jan 21 00:52:14 GMT 2007
> 
> BIOS-provided physical RAM map:
> 
>  BIOS-e820: 0000000000000000 -000000000009f800 (usable)
> ...

 

----------

## Chris W

 *sdunne wrote:*   

> I've posted the whole of /var/log/dmesg to be on the safe side !
> 
> ```
> 
> ---8<---snip---
> ...

 

The third last line indicates that udev's coldplug, for whatever reason, cannot load these modules properly.  Would you be able to try the other RC_COLD_PLUG setting?

If you manually remove and load these modules do you get the same 

```
couldn't load module 'wlan_scan_sta' (-38)
```

 message? 

```
for module in ath{_{pci,rate_{amrr,onoe,sample},hal}} wlan{_{wep,tkip,ccmp,acl,xauth,scan_{sta,ap}},}

do

         grep -q ^$module /proc/modules && modprobe -r $module

done

modprobe ath_pci

lsmod

ifconfig ath0 up

iwlist ath0 scan

ifconfig ath0 down

dmesg | egrep 'ath|wifi|wlan'
```

----------

## cheuschober

Christ W: I can't speak for sdunne but considering that I have the same exact problem I would assume a similar response.

No, is your answer.

Manually modprobing these modules causes no error.

----------

## sdunne

 *Chris W wrote:*   

> The third last line indicates that udev's coldplug, for whatever reason, cannot load these modules properly.  Would you be able to try the other RC_COLD_PLUG setting?

 

Sure.. btw thanks for all your help so far  :Very Happy: 

OK, rebooted with the RC_COLD_PLUG="no". /etc/init.d/net.ath0 fails now, dead as a dodo

 *Quote:*   

> xxxx ~ $ /etc/init.d/net.ath0 restart
> 
>  * Starting ath0
> 
>  *   Bringing up ath0
> ...

 

I'm about to hit the sack now, I'll try the manual loading tomorrow.

Stephen

----------

## Chris W

That is the answer I expect.  I checking that the issue is with udev coldplug and not a more general module autoloading/dependency thing.  The next step is to remove udev coldplug with RC_COLDPLUG="no" and fall back to using the modules.autoload.d/kernel-2.6 file.

----------

## sdunne

Chris

OK, I'll revert to that tomorrow and confirm if everything is working again.

As an aside, do you have any pointers to any documents discussing how udev, hotplug and coldplug ought to interact under gentoo ? 

I'll go googling tomorrow in any case as I'd like to get my head around how this stuff should behave. Now I really am hitting the sack !

----------

## Big Jim Slade

Okay, I got the wireless working.  I don't know exactly what it was that worked, but...

I did as suggested above by Chris W with removing the modules and running depmod and all that with essentially the same results as sdunne.  Still no work anyway... So, I decided to remerge madwifi-ng and kind of "start over" in a sense.  At that point, I modprobed ath_pci, wlan_scan_sta and wlan_wep and manually associated with the router.  So, I put wlan_scan_sta and wlan_wep in the autoload and restarted.  Once the machine was back up I ran the net.ath0 script and it worked.  And... now it comes up on boot.

Strange thing though, dmesg still reports that it cannot load wlan_scan_sta... that, I suppose is trying to load with ath_pci and it works because autoload is loading it afterwards.

I think there might be something else I did that may have helped, but I can't remember what now.  

Anyway, long story short... maybe just try rebuilding madwifi-ng if you haven't tried that yet?

----------

## Chris W

 *sdunne wrote:*   

> As an aside, do you have any pointers to any documents discussing how udev, hotplug and coldplug ought to interact under gentoo ? 

 

No, not really.  I just traced the use of the RC_COLDPLUG environment variable in the startup scripts to see what it did.  I've also seen a few posts around the forums on issues with the starting of services (like net.ath0) when the machine interface is found.

----------

## cheuschober

 *Big Jim Slade wrote:*   

>  I modprobed ath_pci, wlan_scan_sta and wlan_wep and manually associated with the router.  So, I put wlan_scan_sta and wlan_wep in the autoload and restarted

 

I think part of the point of this thread was that the above step shouldn't be necessary and it concerns me that it is.

----------

## Lubomir

To solve that problem you just have to enable CONFIG_KMOD in the kernel and reemerge madwifi   :Wink: 

----------

## Eil

 *Lubomir wrote:*   

> To solve that problem you just have to enable CONFIG_KMOD in the kernel and reemerge madwifi  

 

Right on, that worked for me. In menuconfig, the option is called "Automatic kernel module loading".

----------

## Big Jim Slade

That may be part of it... but it didn't solve my latest go 'round with madwifi-ng (this time on my desktop).  I had re-emerged madwifi a couple times, but the script would still not bring up net.ath0 or associate with an AP.  After I did a world update it started working (as did udev, which had previously complained about not being "available" during boot) and the appropriate modules autoloaded without having to be explicitly set.  I suspect that an upgrade of baselayout was necessary... don't remember what version I had, but it got updated in the process.

So... if you've enabled CONFIG_KMOD, rebuilt madwifi-ng and things still don't work... maybe see if you need to update base-layout?  Or, maybe there's another package out there that's responsible.

----------

