Wireless autoconf » History » Version 6

« Previous - Version 6/15 (diff) - Next » - Current version
Pau Escrich, 06/13/2011 06:00 PM

Wireless autoconf

Technical information (for developers)
Wireless configuration for file: /etc/config/qmp

These are the default parameters sharing all wireless interfaces

config 'qmp' 'wireless'
     option 'driver' 'mac80211'
     option 'country' 'UZ'
     option 'bssid' '02:CA:FF:EE:BA:BE'

driver can be `mac80211` for athXk, and `madwifi` for madwifi

And these are the config parameters for each wifi interface.

 config 'wireless'
     option 'channel' '44'
     option 'mode' 'adhoc'
     option 'name' 'qmp'
     option 'mac' '00:80:48:6b:25:b5'

 config 'wireless'
     option 'channel' '10'
     option 'mode' 'ap'
     option 'name' ''
     option 'mac' '00:80:48:6b:25:b6'

To apply this configuration to device, you must execute this commands:

. /etc/qmp/

This function takes the parameters from UCI and using the templates from: /etc/qmp/templates creates the openwrt wireless config
Templates are named like that: wireless.mac80211.adhoc wireless.madwifi.ap
Separed by dots, second name is the driver to use and third one is the mode.

These templates looks like this:

config wifi-device #QMP_DEVICE
    option type     mac80211
    option macaddr    #QMP_MAC
    option channel  #QMP_CHANNEL
        option diversity 0 # 0:off, 1:on
        option txantenna 0 # 0:auto, 1:main, 2:aux
        option rxantenna 0 # 0:auto, 1:main, 2:aux
    option country    #QMP_COUNTRY
    option outdoor    1
#    option txpower  1 

config wifi-iface
    option device    #QMP_DEVICE
    option mode    adhoc
    option ssid    #QMP_SSID
    option bssid    #QMP_BSSID
    option encryption none

As you can see, the special words starting witch #QMP will be replaced by UCI parameters.
So you can play a little with templates. For example, there is a template named: `wireless.mac80211.adhoc-n`