summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStephen Hemminger <stephen.hemminger@vyatta.com>2010-11-29 17:16:38 -0800
committerStephen Hemminger <stephen.hemminger@vyatta.com>2010-11-29 17:16:38 -0800
commitb88f20567219686be5a024b6ce0ceaf849712654 (patch)
tree68db3d604eee0bac3cddae3a278d3b6cc7ee1fa2
parent93097c2dc51c8b7b2b4e75f274622b2259477bba (diff)
parentfdef8b73c4208d97c2d799bde3dd837a871e9666 (diff)
downloadvyatta-cfg-system-b88f20567219686be5a024b6ce0ceaf849712654.tar.gz
vyatta-cfg-system-b88f20567219686be5a024b6ce0ceaf849712654.zip
Merge branch 'mendocino' of vm:rel/vyatta-cfg-system into mendocino
-rwxr-xr-xscripts/system/vyatta_interface_rescan19
1 files changed, 19 insertions, 0 deletions
diff --git a/scripts/system/vyatta_interface_rescan b/scripts/system/vyatta_interface_rescan
index a33f8ee9..e93bbdfc 100755
--- a/scripts/system/vyatta_interface_rescan
+++ b/scripts/system/vyatta_interface_rescan
@@ -84,6 +84,18 @@ sub get_hwid {
return $hwaddr;
}
+# Determine phy for wlan device
+# (This is ugly)
+sub get_phy {
+ my $wlan = shift;
+ my $phypath = "/sys/class/net/$wlan/phy80211";
+
+ # link should be: ../../ieee80211/phy0
+ return unless (readlink($phypath) =~ m!../../ieee80211/(phy[0-9]+)$!);
+
+ return $1;
+}
+
# vyatta_net_name leaves files in /dev/.udev/vyatta
# the filename is the interface and the contents are the hardware id
sub interface_rescan {
@@ -112,6 +124,13 @@ sub interface_rescan {
syslog(LOG_INFO, "add config for %s hw-id %s", $ifname, $hwaddr);
$xcp->create_node(['interfaces',$ifpath,"hw-id $hwaddr"]);
+
+ # Add existing phy entry for wireless
+ if ($ifname =~ /^wlan/) {
+ my $phy = get_phy($ifname);
+ $xcp->create_node(['interfaces',$ifpath,"physical-device $phy"]) if $phy;
+ }
+
}
# Rewrite new config file