Projecte

General

Perfil

Wireless autoconf » Historial » Versió 5

Pau Escrich, 13-06-2011 17:59

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