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