| Summary: | net-wireless/hostapd + prism54 wireless card doesn't work in master mode with baselayout-2 | ||
|---|---|---|---|
| Product: | Gentoo Linux | Reporter: | Lorenzo Raschi <ded1549> |
| Component: | [OLD] baselayout | Assignee: | Bjarke Istrup Pedersen (RETIRED) <gurligebis> |
| Status: | RESOLVED FIXED | ||
| Severity: | normal | CC: | mobile+disabled |
| Priority: | Normal | ||
| Version: | unspecified | ||
| Hardware: | AMD64 | ||
| OS: | Linux | ||
| Whiteboard: | |||
| Package list: | Runtime testing required: | --- | |
| Attachments: |
My kernel .config
My kernel .config |
||
|
Description
Lorenzo Raschi
2011-05-15 15:06:16 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. 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. 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
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. 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 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) 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 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. Created attachment 274103 [details]
My kernel .config
Created attachment 274105 [details]
My kernel .config
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
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
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. |