As discussed in bug #118516, here's my first attempt in creating a "wlanconfig" module. It's based on the bridging module and works in the main task => creating the athX devices. The module is placed at /lib/rcscripts/net.modules.d/madwifi. The required configuration in /etc/conf.d/net is madwifi_wifi0="ath0" config_wifi0=( "null" ) and /etc/conf.d/wireless one needs to specify the mode. # Set the mode of the interface (managed, ad-hoc, master or auto) # The default is auto # If it's ad-hoc or master you also may need to specify the channel below #mode_eth0="auto" mode_ath0="ad-hoc" All the other parameters work as expected (Altough you cannot do any mode-changing, such as dropping to ad-hoc for scan). Enjoy and try it out..Tested with baselayout 1.11.14-r3. I don't know how this integrates with the changes in 1.12.
Created attachment 78278 [details] Madwifi rcscript Place this to /lib/rcscripts/net.modules.d/madwifi.
Oh, and you can specify multiple athX interfaces. What needs work is the error handling and bringing down the athX-ifaces gracefully when going down.
Oh and one last thing: To use this, you need to get rid of the udev rule mentioned in bug #118516 (the file /etc/udev/rules.d/65-madwifi.rules).
This module will not be accepted into baselayout as it is device specific. That's not to say that this module is bad as it looks good and appears to work. Either solution could be bundled with the madwifi-tools ebuild, but I prefer the udev solution myself as that does not depend on any baselayout version (the module API has changed a bit for baselayout-1.12).
Baselayout or madwifi-tools, whichever is better. I went with baselayout due to the same logic as bridging is in baselayout (should't the bridge module be installed with bridge-utils, then?) Anyway I'm opposed to the udev idea (as I mentioned with in the other bug report) because it deviates from the single location for all net&wireless settings (ie. it's putting stuff outside /etc/conf.d/). It wouldn't be so bad if madwifi-driver would allow changing the mode from managed to ad-hoc via iwconfig (and thus, would work like any other card, ie. one single "ath0" would be enough for all needs). However, that is not going to happen for a long while.
(In reply to comment #5) > should't the bridge module be installed with bridge-utils, then? Yes it should and will be shortly after baselayout-1.12 goes stable. > Anyway I'm opposed to the udev idea (as I mentioned with in the other bug > report) because it deviates from the single location for all net&wireless > settings (ie. it's putting stuff outside /etc/conf.d/). > It wouldn't be so bad if madwifi-driver would allow changing the mode from > managed to ad-hoc via iwconfig (and thus, would work like any other card, ie. > one single "ath0" would be enough for all needs). However, that is not going to > happen for a long while. Whereas I happen to be apposed to the whole wlanconfig idea and prefer the way things used to be before this madwifi-ng stuff. I'm also the person that has the final say as what goes into the baselayout modules. At the end of the day, me saying no is probably the best idea as it leaves the final solution with the mobile team in deciding which they prefer - udev or a baselayout module.
I would prefer the current approach of using an udev rule. If the other approach is to be used, it will have to be maintained by someone else.
(In reply to comment #7) > I would prefer the current approach of using an udev rule. If the other > approach is to be used, it will have to be maintained by someone else. I doubt that I have enough experience with Gentoo core to start actively maintaining this - especially if it requires running ~ARCH baselayout (with the API changes and all). I'm happy in using this with my own laptop(s), but not quite confident enough in starting to offer this as a "production"-quality piece of scriptwriting.. Any other takers? Oh well, I hope http://madwifi.org/ticket/176 get's resolved sometime before the Atheros chipset is completely obsolete.
I'm sorry, but I will close this as WONTFIX. Thank you for working on this, though. Keep up the good work, and keep the high quality bug reports coming. :)
Created attachment 90373 [details] wlanconfig.sh Sorry to comment on this quite old bug, but I'd like to have a baselayout module for the madwifi cards. The udev rule has been deprecated. It was only creating one ath* device, taking the next available free number. But wlanconfig allows us to name the interface and create more than one for a base interface. Now the kernel module still creates only one interface automatically. With the baselayout module more can be created when needed. My code does it the other way round, instead of hooking wifi* and creating the interfaces as a result, it hooks the ath* config and dynamically creates the interface on a specified base interface.
Created attachment 90387 [details] wlanconfig.sh small touchup
(In reply to comment #10) > Sorry to comment on this quite old bug, but I'd like to have a baselayout > module for the madwifi cards. baselayout will not provide one > The udev rule has been deprecated. It was only > creating one ath* device, taking the next available free number. But wlanconfig > allows us to name the interface and create more than one for a base interface. > Now the kernel module still creates only one interface automatically. Things are now back to normal - yay.