Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 367393 - net-wireless/hostapd + prism54 wireless card doesn't work in master mode with baselayout-2
Summary: net-wireless/hostapd + prism54 wireless card doesn't work in master mode with...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] baselayout (show other bugs)
Hardware: AMD64 Linux
: Normal normal (vote)
Assignee: Bjarke Istrup Pedersen (RETIRED)
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-05-15 15:06 UTC by Lorenzo Raschi
Modified: 2011-05-21 10:09 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
My kernel .config (kernelconfig.txt,70.15 KB, text/plain)
2011-05-20 12:43 UTC, Lorenzo Raschi
Details
My kernel .config (kernelconfig.txt,70.15 KB, text/plain)
2011-05-20 12:44 UTC, Lorenzo Raschi
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Lorenzo Raschi 2011-05-15 15:06:16 UTC
Hello,

I have just migrated to baselayout-2 on my gentoo AMD64 router. Since them, my prism54 minipci card stopped working in master mode. At first, new baselayout required wpa_supplicant when I started the wireless interface. Installing and configuring wpa_supplicant didn't sort out the problem.
I fixed the problem removing wpa_supplicant.sh from /lib64/rc/net, but I don't think it's an elegant way to sort this problem.

Reproducible: Always

Steps to Reproduce:
1. migrate from baselayout1 to baselayout2
2. start wireless network interface configured in master mode

Actual Results:  
1) if wpa_supplicant is not installed, baselayout asks for it
2) if wpa_supplicant is installed, wifi no longer starts in master mode

Expected Results:  
wireless wifi brings up in master mode, as it did with baselayout1

emerge --info

Portage 2.1.9.42 (default/linux/amd64/10.0/no-multilib, gcc-4.4.5, libc-0-r0, 2.6.38.6 x86_64)
=================================================================
System uname: Linux-2.6.38.6-x86_64-Intel-R-_Core-TM-2_Duo_CPU_E8400_@_3.00GHz-with-gentoo-2.0.2
Timestamp of tree: Sun, 15 May 2011 14:15:01 +0000
app-shells/bash:     4.1_p9
dev-lang/python:     2.7.1-r1, 3.1.3-r1
sys-apps/baselayout: 2.0.2
sys-apps/openrc:     0.8.2-r1
sys-apps/sandbox:    2.4
sys-devel/autoconf:  2.65-r1
sys-devel/automake:  1.10.3, 1.11.1
sys-devel/binutils:  2.20.1-r1
sys-devel/gcc:       4.4.5
sys-devel/gcc-config: 1.4.1-r1
sys-devel/libtool:   2.2.10
sys-devel/make:      3.81-r2
sys-kernel/linux-headers: 2.6.36.1
sys-libs/glibc:      2.11.3
virtual/os-headers:  0
ACCEPT_KEYWORDS="amd64"
ACCEPT_LICENSE="* -@EULA"
CBUILD="x86_64-pc-linux-gnu"
CFLAGS="-O3 -march=core2 -pipe -fomit-frame-pointer"
CHOST="x86_64-pc-linux-gnu"
CONFIG_PROTECT="/etc /var/qmail/alias /var/qmail/control /var/vpopmail/etc"
CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/env.d /etc/fonts/fonts.conf /etc/gconf /etc/gentoo-release /etc/php/apache2-php5.3/ext-active/ /etc/php/cgi-php5.3/ext-active/ /etc/php/cli-php5.3/ext-active/ /etc/revdep-rebuild /etc/sandbox.d /etc/terminfo"
CXXFLAGS="-O3 -march=core2 -pipe -fomit-frame-pointer"
DISTDIR="/tmp"
FEATURES="assume-digests binpkg-logs distlocks fixlafiles fixpackages news parallel-fetch protect-owned sandbox sfperms strict unknown-features-warn unmerge-logs unmerge-orphans userfetch"
FFLAGS=""
GENTOO_MIRRORS="ftp://de-mirror.org/distro/gentoo/"
LANG="en_US.ISO-8859-1"
LDFLAGS="-Wl,-O1 -Wl,--as-needed"
MAKEOPTS="-j3"
PKGDIR="/usr/portage/packages"
PORTAGE_CONFIGROOT="/"
PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --compress --force --whole-file
 --delete --stats --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages"
PORTAGE_TMPDIR="/tmp"
PORTDIR="/usr/portage"
PORTDIR_OVERLAY="/usr/local/portage"
SYNC="rsync://rsync.fr.gentoo.org/gentoo-portage"
USE="acl acpi activefilter afpacket alaw alsa amd64 amuled async atm audiofile authfile bzip2 caps cgi clamav cli cpudetection cracklib crypt curl cxx daemon deprecated dhcp digitalradio dump dynamicplugin eap-tls faac flac ftp g722 g729 gd gdbm h323 hpn iconv ipv6 javascript jpeg jpeg2k libedit lids lighttpd lm_sensors logmail mad mhash mmx modules mp3 mudflap ncurses network nls nptl nptlonly ogg openmp openssh padlock pcap pcre php pmu png pop3d python remote samba schroedinger sensord session softquota sqlite sse sse2 sse3 ssl subversion svg swat sysfs syslog sysvipc tcpd theora threads tiff truetype ulaw unicode urandom usb vhosts vorbis vpopmail x264 xinetd xml zlib" ALSA_CARDS="ali5451 als4000 atiixp atiixp-modem bt87x ca0106 cmipci emu10k1x ens1370 ens1371 es1938 es1968 fm801 hda-intel intel8x0 intel8x0m maestro3 trident usb-audio via82xx via82xx-modem ymfpci" ALSA_PCM_PLUGINS="adpcm alaw asym copy dmix dshare dsnoop empty extplug file hooks iec958 ioplug ladspa lfloat linear meter mmap_emul mulaw multi null plug rate route share shm softvol" APACHE2_MODULES="actions alias auth_basic authn_alias authn_anon authn_dbm authn_default authn_file authz_dbm authz_default authz_groupfile authz_host authz_owner authz_user autoindex cache cgi cgid dav dav_fs dav_lock deflate dir disk_cache env expires ext_filter file_cache filter headers include info log_config logio mem_cache mime mime_magic negotiation rewrite setenvif speling status unique_id userdir usertrack vhost_alias" CAMERAS="ptp2" COLLECTD_PLUGINS="df interface irq load memory rrdtool swap syslog" ELIBC="glibc" GPSD_PROTOCOLS="ashtech aivdm earthmate evermore fv18 garmin garmintxt gpsclock itrax mtk3301 nmea ntrip
 navcom oceanserver oldstyle oncore rtcm104v2 rtcm104v3 sirf superstar2 timing tsip tripmate tnt ubx" INPUT_DEVICES="keyboard mouse evdev" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" PHP_TARGETS="php5-3" RUBY_TARGETS="ruby18" USERLAND="GNU" VIDEO_CARDS="fbdev glint intel mach64 mga neomagic nouveau nv r128 radeon savage sis tdfx trident vesa via vmware dummy v4l" XTABLES_ADDONS="quota2 psd pknock lscan length2 ipv4options ipset ipp2p iface geoip fuzzy condition tee tarpit sysrq steal rawnat logmark ipmark dhcpmac delude chaos account"
Unset:  CPPFLAGS, CTARGET, EMERGE_DEFAULT_OPTS, INSTALL_MASK, LC_ALL, LINGUAS, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS
Comment 1 Bjarke Istrup Pedersen (RETIRED) gentoo-dev 2011-05-17 12:24:26 UTC
It works fine for me.

Here is my config for my wireless interface in /etc/conf.d/net :

----------------------------
config_wlan0="null"
modules="!iwconfig !wpa_supplicant"
----------------------------

Here is the setting for the LAN bridge which it belongs to:

----------------------------
config_br0="192.168.5.1 netmask 255.255.255.0"
bridge_br0="lan0 lan1"
rc_need_br0="net.lan0 net.lan1"
brctl_br0="setfd 0 stp off"
----------------------------

Then make sure these three is configured in hostapd.conf :

----------------------------
interface=wlan0
bridge=br0
driver=nl80211
----------------------------

Then make sure these are in the correct runlevels:

net.wlan0 : NO RUNLEVEL!
net.br0   : boot
hostapd   : default

This is how I have it configured on two different routers with a PCI p54 card.
Comment 2 Bjarke Istrup Pedersen (RETIRED) gentoo-dev 2011-05-17 12:25:26 UTC
Also as a note, the problem is that you want to bring it into master mode which is wrong, since only hostapd should be doing that.
Comment 3 Lorenzo Raschi 2011-05-17 21:42:42 UTC
Thank you for the help.

I don't want a bridge because I want to limit wifi to some services only, so my wlan has a different subnet than the wired one.

I restored wpa_supplicant.sh into /lib64/rc/net and I put the line modules="!wpa_supplicant" as you suggested into my /etc/conf.d/net; now wpa_supplicant is no longer called, which is OK.

My actual /etc/conf.d/net (wireless section):

config_eth2="192.168.2.254 netmask 255.255.255.0 brd 192.168.2.255"
essid_eth2="myWireless"
mode_eth2="master"
modules="!wpa_supplicant"


/etc/hostapd/hostapd.conf:

interface=eth2
driver=prism54
debug=3
dump_file=/tmp/hostapd.dump


With the command "/etc/init.d/net.eth2 start" the eth2 starts succesfully and works perfectly. I tested it with my cellphone.

 * Bringing up interface eth2
 *   Configuring wireless network for eth2
 *     eth2 configured as SSID "myWireless"
 *     in master mode (WEP disabled)
 *   192.168.2.254 ...            [ ok ]
 *   Waiting for IPv6 addresses   [ ok ]

If I execute "/etc/init.d/hostapd start" instead of "/etc/init.d/net.eth2 start" as you suggested the result is:

 * Starting hostapd ...
 * start-stop-daemon: failed to start `/usr/sbin/hostapd'     [ !! ]
 * ERROR: hostapd failed to start

It fails either with net.eth2 in up or down state.

With --debug the result is:

-----start-----start-----start-----start-----start-----

+ _conf_d=/etc/init.d/../conf.d
+ _c=hostapd
+ '[' -n hostapd -a hostapd '!=' hostapd ']'
+ unset _c
+ sourcex -e /etc/init.d/../conf.d/hostapd.default
+ '[' -e = -e ']'
+ shift
+ '[' -e /etc/init.d/../conf.d/hostapd.default ']'
+ return 1
+ sourcex -e /etc/init.d/../conf.d/hostapd
+ '[' -e = -e ']'
+ shift
+ '[' -e /etc/init.d/../conf.d/hostapd ']'
+ . /etc/init.d/../conf.d/hostapd
++ INTERFACES=eth2
++ CONFIGS=/etc/hostapd/hostapd.conf
++ OPTIONS=
+ unset _conf_d
+ sourcex -e /etc/rc.conf
+ '[' -e = -e ']'
+ shift
+ '[' -e /etc/rc.conf ']'
+ . /etc/rc.conf
++ rc_parallel=NO
++ rc_interactive=YES
++ rc_shell=/sbin/sulogin
++ rc_depend_strict=YES
++ rc_hotplug='*'
++ rc_logger=YES
++ unicode=YES
++ rc_tty_number=12
+ '[' -n '' ']'
+ sourcex /etc/init.d/hostapd
+ '[' /etc/init.d/hostapd = -e ']'
+ . /etc/init.d/hostapd
++ opts='start stop reload'
+ unset _d
+ unset _f
+ '[' -n start ']'
+ '[' start = depend ']'
+ for _cmd in describe start stop status '${extra_commands:-$opts}' '$extra_started_commands'
+ '[' describe = start ']'
+ for _cmd in describe start stop status '${extra_commands:-$opts}' '$extra_started_commands'
+ '[' start = start ']'
++ command -v start
+ '[' start = start ']'
+ yesno
+ '[' -z '' ']'
+ return 1
+ unset _cmd
++ command -v start_pre
+ '[' '' = start_pre ']'
+ start
+ checkconfig
+ local file
+ for file in '${CONFIGS}'
+ '[' '!' -r /etc/hostapd/hostapd.conf ']'
+ ebegin 'Starting hostapd'
+ local _r
+ /lib64/rc/bin/ebegin 'Starting hostapd'
 * Starting hostapd ...+ _r=1
+ export EINFO_LASTCMD=ebegin
+ EINFO_LASTCMD=ebegin
+ return 1
+ start-stop-daemon --start --exec /usr/sbin/hostapd -- -B /etc/hostapd/hostapd.conf

 * start-stop-daemon: failed to start `/usr/sbin/hostapd'
+ eend 1
+ local _r
+ /lib64/rc/bin/eend 1
 [ !! ]
+ _r=0
+ export EINFO_LASTCMD=eend
+ EINFO_LASTCMD=eend
+ return 0
++ command -v start_post
+ '[' '' = start_post ']'
+ shift
+ continue 2
+ '[' -n '' ']'                                       

-----end-----end-----end-----end-----end-----end-----

In your opinion, why start-stop-daemon --start --exec /usr/sbin/hostapd -- -B /etc/hostapd/hostapd.conf fails? There's nothing useful in the system log and the debug file I chosen in hostapd.conf isn't created. The file /etc/hostapd/hostapd.conf exists.

Regards,

Lorenzo
Comment 4 Bjarke Istrup Pedersen (RETIRED) gentoo-dev 2011-05-18 08:59:52 UTC
Hmm, you are using the prism54 driver?

From what I know, it has been deprecated for quiet a while.

Could you try and use the p54 driver in the kernel instead, and configure hostapd to use the nl80211 driver?
That would rename it to wlan0 instead.

Also, if you aren't already using it, please try and upgrade hostapd to 0.7.3

I'm pretty sure the problem is related to the prism54 driver combined with maybe an older version of hostapd.
Comment 5 Lorenzo Raschi 2011-05-18 20:21:38 UTC
Hello,

I'm using the prism54 driver built into the 2.6.38.6 kernel (vanilla). The hostapd version is the 0.7.3.
I'll try your advise tomorrow; too tired tonight! :-)

Thanks a lot for your support,

Lorenzo
Comment 6 Bjarke Istrup Pedersen (RETIRED) gentoo-dev 2011-05-19 06:37:13 UTC
Okay, in that case, it's most likely the driver yes :)

Let me know if that works.

For anyone else reading this - please try and use the mac80211 drivers, they are working much better than the older ones. (If in doubt, look at the name of your interface, if it's wlanX, it's most likely a mac80211 driver - if it's ethX, it's most likely not)
Comment 7 Lorenzo Raschi 2011-05-19 20:12:30 UTC
Ok, I'm trying your advise.

Prism54 driver is compiled as a module, so I can load and unload whenever I want for testing purpose.

# lsmod
Module                  Size  Used by
prism54                52858  0
p54pci                  8268  0
p54common              24200  1 p54pci

# uname -a
Linux tuxserver 2.6.38.6 #1 SMP Thu May 12 19:11:25 CEST 2011 x86_64 Intel(R) Core(TM)2 Duo CPU E8400 @ 3.00GHz GenuineIntel GNU/Linux    

# hostapd -v
hostapd v0.7.3
User space daemon for IEEE 802.11 AP management,
IEEE 802.1X/WPA/WPA2/EAP/RADIUS Authenticator
Copyright (c) 2002-2010, Jouni Malinen <j@w1.fi> and contributors    

First of all, I modified hostapd.conf file:

interface=wlan0
#interface=eth2

#driver=hostap
#driver=prism54
driver=nl80211  

[..]

After it, I executed the command "rc-update del net.eth2", after it I rebooted. I haven't added hostapd to the default runlevel for now because I can debug it better with "/etc/init.d/hostapd start" command.

Despite it, eth2 still brings up after a reboot instead wlan0, I don't know why.

Interestingly, if I remove all three p54 module with rmmod and reload them with modprobe, wlan0 brings up instead eth2!

# iwconfig

wlan0     IEEE 802.11bg  ESSID:off/any
          Mode:Managed  Access Point: Not-Associated   Tx-Power=20 dBm
          Retry  long limit:7   RTS thr:off   Fragment thr:off
          Encryption key:off
          Power Management:off    

Time to start hostapd:

# /etc/init.d/net.wlan0 stop
 * WARNING: net.wlan0 is already stopped 

# /etc/init.d/hostapd start
 * Caching service dependencies ...         [ ok ]
 * Bringing up interface wlan0
 *   Configuring wireless network for wlan0
Error for wireless request "Set Mode" (8B06) :
    SET failed on device wlan0 ; Invalid argument.
 *     wlan0 connected to SSID "myWireless"
 *     in managed mode (WEP disabled)
 *   No configuration specified; defaulting to DHCP
 *   dhcp ...
 *     nothing provides `dhcp'              [ !! ]

iwconfig give me the same error if I try to put wlan0 in master mode:

# iwconfig wlan0 mode master
Error for wireless request "Set Mode" (8B06) :  SET failed on device wlan0 ; Invalid argument. 

Thank you for your help!!!!

Lorenzo
Comment 8 Bjarke Istrup Pedersen (RETIRED) gentoo-dev 2011-05-20 07:57:40 UTC
I think the problem is that you still have the prism54 module, which gets loaded.
Try removing it (deleting the file from the /lib/modules folder), so there only is the p54 modules.

So far so good.
Could you try and attach your .config file for your kernel - looks like you are missing something.
Comment 9 Lorenzo Raschi 2011-05-20 12:43:29 UTC
Created attachment 274103 [details]
My kernel .config
Comment 10 Lorenzo Raschi 2011-05-20 12:44:11 UTC
Created attachment 274105 [details]
My kernel .config
Comment 11 Lorenzo Raschi 2011-05-20 12:47:53 UTC
OK, I think you have done a step in the right direction.

As you suggested, I removed prism54 module.

# lsmod
Module                  Size  Used by
p54pci                  8003  0
p54common              25420  1 p54pci

Now, at reboot, I see the wlan0.

# iwconfig

[..]

wlan0     IEEE 802.11bg  ESSID:"myWireless"
          Mode:Managed  Frequency:2.432 GHz  Access Point: Not-Associated
          Tx-Power=20 dBm
          Retry  long limit:7   RTS thr:off   Fragment thr:off
          Encryption key:off
          Power Management:off  

I changed /etc/conf.d/hostapd and /etc/hostapd/hostapd.conf in order to use wlan0 and nl80211 instead eth2 and prism54.

So I executed "/etc/init.d/hostapd start":

 * Starting hostapd ...
 * start-stop-daemon: failed to start `/usr/sbin/hostapd'                 [ !! ]
 * ERROR: hostapd failed to start 

With --debug:

+ ebegin 'Starting hostapd'
 * Starting hostapd ...
+ start-stop-daemon --start --exec /usr/sbin/hostapd -- -B /etc/hostapd/hostapd.conf
 * start-stop-daemon: failed to start `/usr/sbin/hostapd'
+ eend 1                                                                  [ !! ]+ exit 1
 * ERROR: hostapd failed to start  

I attached my .config, as you requested.

Thank you,

Lorenzo
Comment 12 Lorenzo Raschi 2011-05-20 19:48:02 UTC
I FOUND THE PROBLEM!!!!

There's some misterious settings in hostapd.conf which work great with prism54 but not with nl80211.

I got rid of everything in this file and I left only:

# less /etc/hostapd/hostapd.conf
interface=wlan0
driver=nl80211
ctrl_interface=/var/run/hostapd
ssid=myWireless
country_code=IT
hw_mode=g
channel=5

Now wireless is up and running with baselayout-2!!!

# iwconfig
wlan0     IEEE 802.11bg  Mode:Master  Frequency:2.432 GHz  Tx-Power=20 dBm
          Retry  long limit:7   RTS thr:off   Fragment thr:off
          Power Management:off

ppp0      no wireless extensions.

mon.wlan0  IEEE 802.11bg  Mode:Monitor  Tx-Power=20 dBm
          Retry  long limit:7   RTS thr:off   Fragment thr:off
          Power Management:off  

I want to say thank you for your excellent support!!!!!! I'm really amazed!

For future reference, I post my /etc.conf.d/net also (useful if someone doesn't want to use wlan into a bridge):

-----cut-----cut-----cut-----cut-----cut-----cut-----cut-----

config_eth0="192.168.1.254 netmask 255.255.255.0 brd 192.168.1.255"
mtu_eth0="7000"
config_wlan0="192.168.2.254 netmask 255.255.255.0 brd 192.168.2.255"
dns_server_eth0="62.149.128.4 62.149.132.4"
channel_wlan0="5"
essid_wlan0="myWireless"
mode_wlan0="master"
modules_wlan0="!wpa_supplicant"
config_ppp0="ppp"
link_ppp0="8.35"                # PPPoA requires the ATM VC's address
plugins_ppp0="pppoa vc-encaps"  # Required plugin for PPPoA with an option
pppd_ppp0="+ipv6 noipdefault defaultroute usepeerdns user xxx password yyy"
routes_ppp0="::/0"   

-----cut-----cut-----cut-----cut-----cut-----cut-----cut-----

PS: I left the "IN_PROGRESS" status because I don't know if I have to select "FIXED" or "INVALID" into "RESOVED" status. 

Bye!!!!

Lorenzo
Comment 13 Bjarke Istrup Pedersen (RETIRED) gentoo-dev 2011-05-21 10:09:38 UTC
Great, happy it worked out for you :)

I'll remember to suggest people a simple hostapd.conf to test with, if they have problems in the future.