Project

General

Profile

Wireless autoconf » History » Version 6

Pau Escrich, 06/13/2011 06:00 PM

1 1 Pau Escrich
h1. Wireless autoconf
2 1 Pau Escrich
3 6 Pau Escrich
h2. Technical information (for developers)
4 1 Pau Escrich
Wireless configuration for file: /etc/config/qmp
5 1 Pau Escrich
6 1 Pau Escrich
These are the default parameters sharing all wireless interfaces
7 4 Pau Escrich
<pre>
8 4 Pau Escrich
config 'qmp' 'wireless'
9 3 Pau Escrich
 	option 'driver' 'mac80211'
10 3 Pau Escrich
 	option 'country' 'UZ'
11 1 Pau Escrich
 	option 'bssid' '02:CA:FF:EE:BA:BE'
12 4 Pau Escrich
</pre>
13 3 Pau Escrich
 
14 1 Pau Escrich
driver can be `mac80211` for athXk, and `madwifi` for madwifi
15 2 Pau Escrich
16 2 Pau Escrich
And these are the config parameters for each wifi interface.
17 3 Pau Escrich
<pre>
18 3 Pau Escrich
 config 'wireless'
19 3 Pau Escrich
 	option 'channel' '44'
20 3 Pau Escrich
 	option 'mode' 'adhoc'
21 3 Pau Escrich
 	option 'name' 'qmp'
22 3 Pau Escrich
 	option 'mac' '00:80:48:6b:25:b5'
23 3 Pau Escrich
 
24 3 Pau Escrich
 config 'wireless'
25 3 Pau Escrich
 	option 'channel' '10'
26 3 Pau Escrich
 	option 'mode' 'ap'
27 3 Pau Escrich
 	option 'name' 'qmp.cat-AP'
28 3 Pau Escrich
 	option 'mac' '00:80:48:6b:25:b6'
29 3 Pau Escrich
30 3 Pau Escrich
</pre>
31 5 Pau Escrich
32 5 Pau Escrich
To apply this configuration to device, you must execute this commands: 
33 5 Pau Escrich
<pre>
34 5 Pau Escrich
. /etc/qmp/qmp_wireless.sh
35 5 Pau Escrich
qmp_configure_wifi
36 5 Pau Escrich
</pre>
37 5 Pau Escrich
This function takes the parameters from UCI and using the templates from: /etc/qmp/templates creates the openwrt wireless config
38 5 Pau Escrich
Templates are named like that: wireless.mac80211.adhoc wireless.madwifi.ap
39 5 Pau Escrich
Separed by dots, second name is the driver to use and third one is the mode. 
40 5 Pau Escrich
41 5 Pau Escrich
These templates looks like this:
42 5 Pau Escrich
43 5 Pau Escrich
<pre>
44 5 Pau Escrich
config wifi-device #QMP_DEVICE
45 5 Pau Escrich
	option type     mac80211
46 5 Pau Escrich
	option macaddr	#QMP_MAC
47 5 Pau Escrich
	option channel  #QMP_CHANNEL
48 5 Pau Escrich
        option diversity 0 # 0:off, 1:on
49 5 Pau Escrich
        option txantenna 0 # 0:auto, 1:main, 2:aux
50 5 Pau Escrich
        option rxantenna 0 # 0:auto, 1:main, 2:aux
51 5 Pau Escrich
	option country	#QMP_COUNTRY
52 5 Pau Escrich
	option outdoor	1
53 5 Pau Escrich
#	option txpower  1 
54 5 Pau Escrich
55 5 Pau Escrich
config wifi-iface
56 5 Pau Escrich
	option device	#QMP_DEVICE
57 5 Pau Escrich
	option mode	adhoc
58 5 Pau Escrich
	option ssid	#QMP_SSID
59 5 Pau Escrich
	option bssid	#QMP_BSSID
60 5 Pau Escrich
	option encryption none
61 5 Pau Escrich
</pre>
62 5 Pau Escrich
As you can see, the special words starting witch #QMP will be replaced by UCI parameters. 
63 5 Pau Escrich
So you can play a little with templates. For example, there is a template named: `wireless.mac80211.adhoc-n`