mirror of https://github.com/aredn/aredn.git
Add initial support for a monitor interface to be used for SSID based identification.
ref BBHN->ticket:28
This commit is contained in:
parent
a93d48e849
commit
c61d58e172
|
@ -38,3 +38,6 @@ config interface dtdlink
|
|||
option proto static
|
||||
option ipaddr <dtdlink_ip>
|
||||
option netmask 255.0.0.0
|
||||
|
||||
config interface wifi_mon
|
||||
option proto none
|
||||
|
|
|
@ -12,3 +12,7 @@ config wifi-iface
|
|||
option ssid "<wifi_ssid>"
|
||||
option encryption none
|
||||
|
||||
config wifi-iface
|
||||
option device radio0
|
||||
option network wifi_mon
|
||||
option mode monitor
|
||||
|
|
|
@ -65,7 +65,8 @@ sub aimmode_start {
|
|||
# Prep the system
|
||||
system('/etc/init.d/linkled stop');
|
||||
system('/etc/init.d/olsrd stop');
|
||||
system('/sbin/ifconfig wlan0 down');
|
||||
system('/sbin/ifdown wifi');
|
||||
system('/sbin/ifdown wifi_mon');
|
||||
system('/usr/sbin/iw phy phy0 interface add mon0 type monitor');
|
||||
system('/usr/sbin/iw dev mon0 set channel 1');
|
||||
system('/sbin/ifconfig mon0 up');
|
||||
|
@ -93,8 +94,9 @@ sub aimmode_shutdown {
|
|||
close ($LINK3_led);
|
||||
close ($LINK2_led);
|
||||
close ($LINK1_led);
|
||||
# Brining up wifi is a bit more complicated than just ifconfig up so we let `wifi` handle it ... Wifi takes a bit to finish so sleep 10s
|
||||
system('/sbin/wifi');
|
||||
# Brining up wifi is a bit more complicated than just ifconfig up so we let `ifup` handle it ... takes a bit to finish so sleep 10s
|
||||
system('ifup wifi');
|
||||
system('ifup wifi_mon');
|
||||
print "Please wait while we restart the services";
|
||||
sleep 10;
|
||||
system('/etc/init.d/olsrd start');
|
||||
|
|
|
@ -140,8 +140,10 @@ if($parms{button_apply} or $parms{button_save})
|
|||
$cmd .= "echo $wifi_txant > /sys/kernel/debug/ieee80211/phy0/ath9k/tx_chainmask;";
|
||||
} else {
|
||||
$cmd .= "ifdown wifi >/dev/null 2>&1;";
|
||||
$cmd .= "ifdown wifi_mon >/dev/null 2>&1;";
|
||||
$cmd .= "iw phy phy0 set antenna $wifi_txantenna $wifi_rxantenna >/dev/null 2>&1;";
|
||||
$cmd .= "ifup wifi >/dev/null 2>&1;";
|
||||
$cmd .= "ifup wifi_mon >/dev/null 2>&1;";
|
||||
}
|
||||
$cmd .= "iw phy phy0 set distance $wifi_distance >/dev/null 2>&1;";
|
||||
$cmd .= "iwconfig wlan0 txpower $wifi_txpower >/dev/null 2>&1;";
|
||||
|
|
Loading…
Reference in New Issue