USB radio
Version 3 (Francisco Jiménez , 06/22/2014 03:59 pm)
1 | 3 | Francisco Jiménez | h1. USB radio <WORK IN PROGRESS> |
---|---|---|---|
2 | 1 | Gioacchino Mazzurco | |
3 | 1 | Gioacchino Mazzurco | To use USB radios kmod-ath9k-htc is needed, when an USB radio is plugged a folder is created in /sys/devices/platform/ehci-platform/usb1/*/*/ieee80211/ like /sys/devices/platform/ehci-platform/usb1/1-1/1-1\:1.0/ieee80211/phy2 |
4 | 1 | Gioacchino Mazzurco | |
5 | 1 | Gioacchino Mazzurco | OpenWrt wifi detect not detect this kind of devices, but if an entry is created in /etc/config/wireless describing the hardware and in particular specifing the path relative to /sys/devices it will capable of manage the device |
6 | 2 | Gioacchino Mazzurco | |
7 | 2 | Gioacchino Mazzurco | <pre> |
8 | 2 | Gioacchino Mazzurco | cd /sys/devices/ |
9 | 2 | Gioacchino Mazzurco | for physPath in platform/ehci-platform/usb*/*/*/ieee80211/* |
10 | 2 | Gioacchino Mazzurco | do |
11 | 2 | Gioacchino Mazzurco | phyName="$(basename ${physPath})" |
12 | 2 | Gioacchino Mazzurco | phyIndex="$(echo ${phyName} | grep -o '[0-9]*')" |
13 | 2 | Gioacchino Mazzurco | |
14 | 2 | Gioacchino Mazzurco | uci batch <<BATCH |
15 | 2 | Gioacchino Mazzurco | delete wireless.radio${phyIndex} |
16 | 2 | Gioacchino Mazzurco | |
17 | 2 | Gioacchino Mazzurco | set wireless.radio${phyIndex}=wifi-device |
18 | 2 | Gioacchino Mazzurco | set wireless.radio${phyIndex}.type=mac80211 |
19 | 2 | Gioacchino Mazzurco | set wireless.radio${phyIndex}.hwmode=11ng |
20 | 2 | Gioacchino Mazzurco | set wireless.radio${phyIndex}.path="$(echo ${physPath} | awk -F"ieee80211" '{print $1}')" |
21 | 2 | Gioacchino Mazzurco | add_list wireless.radio${phyIndex}.ht_capab="LDPC" |
22 | 2 | Gioacchino Mazzurco | add_list wireless.radio${phyIndex}.ht_capab="SHORT-GI-20" |
23 | 2 | Gioacchino Mazzurco | add_list wireless.radio${phyIndex}.ht_capab="SHORT-GI-40" |
24 | 2 | Gioacchino Mazzurco | add_list wireless.radio${phyIndex}.ht_capab="TX-STBC" |
25 | 2 | Gioacchino Mazzurco | add_list wireless.radio${phyIndex}.ht_capab="RX-STBC1" |
26 | 2 | Gioacchino Mazzurco | add_list wireless.radio${phyIndex}.ht_capab="DSSS_CCK-40" |
27 | 2 | Gioacchino Mazzurco | set wireless.radio${phyIndex}.htmode=HT20 |
28 | 2 | Gioacchino Mazzurco | set wireless.radio${phyIndex}.disabled=0 |
29 | 2 | Gioacchino Mazzurco | |
30 | 2 | Gioacchino Mazzurco | commit |
31 | 2 | Gioacchino Mazzurco | BATCH |
32 | 2 | Gioacchino Mazzurco | |
33 | 2 | Gioacchino Mazzurco | done |
34 | 2 | Gioacchino Mazzurco | |
35 | 2 | Gioacchino Mazzurco | </pre> |