Use hostapd to set master mode?

Ahmad Ali Tabassam ahmadthe8 at yahoo.com
Mon Feb 23 03:43:06 EST 2009


Hi Grant
As for I know, it should work for 802.11g. e.i
hw_mode=g
channel=1
But it does not work for 802.11b
Best Regards 

Ahmad Ali Tabassam
Institute Industrial IT
University of Applied Sciences, Lemgo Germany


 


________________________________

From: Grant <emailgrant at gmail.com>
To: hostap at lists.shmoo.com
Sent: Sunday, February 22, 2009 12:29:28 PM
Subject: Re: Use hostapd to set master mode?


Hi
  Can you send the following
1. which chipset you are using. Atheros ???  like Atheros AR5212 etc.
2. which distribution. (for fedora see http://wireless.kernel.org/en/users/Download#DoIneedthisonFedora.3F)
3. which kernel version (as for I know 2.6.28 is in Fedora 10).

My instructions may not work on fedroa 10. because its kernel does not allow.  see detail, 
http://wireless.kernel.org/en/users/Download#DoIneedthisonFedora.3F

By defaut ath5k is not enabled in kernel 2.6.28
http://www.fht.lkams.kernel.org/pub/linux/kernel/v2.6/linux-2.6.28.tar.gz
unzip and see in the following file. /net/mac80211/cfg.c 

Lastly, as for I know for ath5k two for Atheros AR5xxx series patches are requried
1).

--- wireless-testing.orig/net/mac80211/cfg.c 2008-10-28 10:32:35.000000000 +0200
+++ wireless-testing/net/mac80211/cfg.c 2008-10-28 10:32:40.000000000 +0200
@@ -26,6 +26,8 @@
#ifdef CONFIG_MAC80211_MESH
case NL80211_IFTYPE_MESH_POINT:
#endif
+ case NL80211_IFTYPE_AP:
+ case NL80211_IFTYPE_AP_VLAN:
case NL80211_IFTYPE_WDS:
return true;
default:
 
2.)
--- wireless-testing/drivers/net/wireless/ath5k/base.c      2009-02-10 06:11:43.186470883 +0100
+++ wireless-testing/drivers/net/wireless/ath5k/base.c.old      2008-11-14 09:36:40.000000000 +0100
@@ -522,6 +501,7 @@
        hw->wiphy->interface_modes =
                BIT(NL80211_IFTYPE_STATION) |
                BIT(NL80211_IFTYPE_ADHOC) |
 +              BIT(NL80211_IFTYPE_AP) |
                BIT(NL80211_IFTYPE_MESH_POINT);

        hw->extra_tx_headroom = 2;
 
As the 1). is already in compat-wireless and I informed about the 2.).

Best Regards 

Ahmad Ali Tabassam
Institute Industrial IT
University of Applied Sciences, Lemgo Germany


 



________________________________
From: Grant <emailgrant at gmail.com>
To: Ahmad Ali Tabassam <ahmadthe8 at yahoo.com>
Sent: Sunday, February 22, 2009 4:12:37 PM
Subject: Re: Use hostapd to set master mode?

>> I'm on 2.6.28
>
> As I know 2.6.28 has the support for ath5k, but it has to be enabled in the
> kerenel. I suggest an easy way.
>
> The easy way to use the ath5k (Atheros) with nl80211 (driver), just download
> the compat-wireless for kernels >= 2.6.27 here: It will be nice if you
> follow the following steps.
>
> 1-download
>
> http://wireless.kernel.org/download/compat-wireless-2.6/compat-wireless-2.6.tar.bz2
>
> or download compat-wireless-old for kernels <= 2.6.26 here:
>
> http://wireless.kernel.org/download/compat-wireless-2.6/compat-wireless-old.tar.bz2
>
> 2-Add the following line if you want to use the ath5k with nl80211 as the
> master mode.
>
> --- wireless-testing/drivers/net/wireless/ath5k/base.c      2009-02-10
> 06:11:43.186470883 +0100
> +++ wireless-testing/drivers/net/wireless/ath5k/base.c.old      2008-11-14
> 09:36:40.000000000 +0100
> @@ -522,6 +501,7 @@
>        hw->wiphy->interface_modes =
>                BIT(NL80211_IFTYPE_STATION) |
>                BIT(NL80211_IFTYPE_ADHOC) |
> +              BIT(NL80211_IFTYPE_AP) |
>                BIT(NL80211_IFTYPE_MESH_POINT);
>
>        hw->extra_tx_headroom = 2;
>
> Note. If you are expert in the linux kernel, than you can understand it
> easily. Otherwise with out doing into the detail, jut follow.
>
> a-    Unzip the compat-wireless-XXX.tar
>
> b-    Add the line with plus (+) in the
> compat-wireless-XXX/drivers/net/wireless/ath5k/base.c. it should be in the
> same place as shown above.
>
> c-    Build and compile the compat-wireless-XXX. (make and make install)
>
>
>
> 3-      Then build and compile the hostapd for nl80211, I am sure you will
> have it working
>
> # Driver interface for drivers using the nl80211 kernel interface
>
>    CONFIG_DRIVER_NL80211=y
>
> The linbnl must be installed on your distribution
>
> Note. I was working on it (ath5k), without adding the line it does not work
>
> For more informations.
>
> http://wireless.kernel.org/en/users/Download
>
> http://wireless.kernel.org/en/users/Drivers/ath5k
>
> Best Regards
>
> Ahmad Ali Tabassam

Thank you for that, but after following your instructions I still get
the same "Failed to set interface ath0 to master mode" error.

- Grant


>>>>> I'm being told in #madwifi that I need to use hostapd to set master
>>>>> mode with ath5k since iwconfig gives me:
>>>>>
>>>>> ath0 does not support setting the mode to "master"
>>>>>
>>>>> I've always set master mode with iwconfig and then started hostapd to
>>>>> control authentication.  How can I use hostapd to set master mode?
>>>>
>>>> By starting it.. Just set driver=nl80211 in hostapd.conf and hostapd
>>>> takes care of the details.
>>>
>>> I just tried that but I get:
>>>
>>> Failed to set interface ath0 to master mode.
>>> nl80211 driver initialization failed.
>>> rmdir[ctrl_interface]: No such file or directory
>>> ELOOP: remaining socket: sock=5 eloop_data=...
>>>
>>> Could the problem be that my udev renames wlan0 to ath0, or is that
>>> just an arbitrary label?
>>>
>>
>>
>> What version kernel do you have?  nl80211 requires a pretty recent one.
>
> I'm on 2.6.28.  I've read that should do it but it doesn't seem to.  Any
> ideas?
>
> - Grant


>> i am plumbing to get an AP with hostapd and nl80211 working too, in my
>> case with driver p54_pci.
>> in order to get an interface in master mode, i have to use
>> # iw phy phy0 interface add myap type __ap
>> this gets me a seperate virtual interface that i can then use with
>> hostapd.
> No you can do this much easier..
> just load the driver and run hostapd.
> (Of course you have to set interface=wlan0 (depends on your setup) in hostapd.conf before)

Thanks to Ahmad, my interface will go into master mode after another
kernel patch, but I'm getting a new
error.  Depending on the channel I set in hostapd.conf, I get either:

"ioctl[SIOCSIFFLAGS]: Operation not permitted"

or:

"could not set channel for kernel driver"

and hostapd fails to start.  Do you know how to fix this?

- Grant


>> unfortunately it is still not operational.
>> i don't know if there is a better way to achieve the  same effect.
>> i  would be interested in one.
>> i am using kernel 2.6.29_rc5, iw 0.9.9 and hostapd 0.6.8.
>
> no error messages, no crda, no logs?
>
> Regards,
>        Chr
_______________________________________________
HostAP mailing list
HostAP at lists.shmoo.com
http://lists.shmoo.com/mailman/listinfo/hostap 


      
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.shmoo.com/pipermail/hostap/attachments/20090223/5f41be1c/attachment-0001.htm 


More information about the HostAP mailing list