Project

General

Profile

Wireless autoconf » History » Version 8

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

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