Add initial support for a monitor interface to be used for SSID based identification.

ref BBHN->ticket:28
This commit is contained in:
Conrad Lara - KG6JEI 2014-04-18 08:53:54 -07:00
parent a93d48e849
commit c61d58e172
4 changed files with 14 additions and 3 deletions

View File

@ -38,3 +38,6 @@ config interface dtdlink
option proto static option proto static
option ipaddr <dtdlink_ip> option ipaddr <dtdlink_ip>
option netmask 255.0.0.0 option netmask 255.0.0.0
config interface wifi_mon
option proto none

View File

@ -12,3 +12,7 @@ config wifi-iface
option ssid "<wifi_ssid>" option ssid "<wifi_ssid>"
option encryption none option encryption none
config wifi-iface
option device radio0
option network wifi_mon
option mode monitor

View File

@ -65,7 +65,8 @@ sub aimmode_start {
# Prep the system # Prep the system
system('/etc/init.d/linkled stop'); system('/etc/init.d/linkled stop');
system('/etc/init.d/olsrd 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 phy phy0 interface add mon0 type monitor');
system('/usr/sbin/iw dev mon0 set channel 1'); system('/usr/sbin/iw dev mon0 set channel 1');
system('/sbin/ifconfig mon0 up'); system('/sbin/ifconfig mon0 up');
@ -93,8 +94,9 @@ sub aimmode_shutdown {
close ($LINK3_led); close ($LINK3_led);
close ($LINK2_led); close ($LINK2_led);
close ($LINK1_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 # 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('/sbin/wifi'); system('ifup wifi');
system('ifup wifi_mon');
print "Please wait while we restart the services"; print "Please wait while we restart the services";
sleep 10; sleep 10;
system('/etc/init.d/olsrd start'); system('/etc/init.d/olsrd start');

View File

@ -140,8 +140,10 @@ if($parms{button_apply} or $parms{button_save})
$cmd .= "echo $wifi_txant > /sys/kernel/debug/ieee80211/phy0/ath9k/tx_chainmask;"; $cmd .= "echo $wifi_txant > /sys/kernel/debug/ieee80211/phy0/ath9k/tx_chainmask;";
} else { } else {
$cmd .= "ifdown wifi >/dev/null 2>&1;"; $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 .= "iw phy phy0 set antenna $wifi_txantenna $wifi_rxantenna >/dev/null 2>&1;";
$cmd .= "ifup wifi >/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 .= "iw phy phy0 set distance $wifi_distance >/dev/null 2>&1;";
$cmd .= "iwconfig wlan0 txpower $wifi_txpower >/dev/null 2>&1;"; $cmd .= "iwconfig wlan0 txpower $wifi_txpower >/dev/null 2>&1;";