From c1ef7cfb41497068d0d0fea6817eb370d91baef3 Mon Sep 17 00:00:00 2001 From: Chris Buechler Date: Wed, 18 Mar 2015 23:52:46 -0500 Subject: [PATCH] Add option for wireless standard "auto", to omit "mode" entirely from ifconfig. This shouldn't be necessary, but specifying mode has proven to trigger driver problems that don't exist if it's left unspecified (such as FreeBSD PR 198680). Chosing "auto" fixes ath(4) BSS mode issues otherwise preventing it from connecting. --- etc/inc/interfaces.inc | 14 ++++++++++---- usr/local/www/interfaces.php | 5 +++++ 2 files changed, 15 insertions(+), 4 deletions(-) diff --git a/etc/inc/interfaces.inc b/etc/inc/interfaces.inc index 5571de123a..7e9ef7ff9d 100644 --- a/etc/inc/interfaces.inc +++ b/etc/inc/interfaces.inc @@ -2325,7 +2325,10 @@ function interface_wireless_configure($if, &$wl, &$wlcfg) { $wlcmd[] = "up"; /* Set a/b/g standard */ $standard = str_replace(" Turbo", "", $wlcfg['standard']); - $wlcmd[] = "mode " . escapeshellarg($standard); + /* skip mode entirely for "auto" */ + if ($wlcfg['standard'] != "auto") { + $wlcmd[] = "mode " . escapeshellarg($standard); + } /* XXX: Disable ampdu for now on mwl when running in 11n mode * to prevent massive packet loss under certain conditions. */ @@ -2694,10 +2697,13 @@ EOD; } } - /* The mode must be specified in a separate command before ifconfig + /* 20150318 cmb - Note: the below no longer appears to be true on FreeBSD 10.x, so don't set + * mode twice (for now at least). This can be removed entirely in the future if no problems are found + + * The mode must be specified in a separate command before ifconfig * will allow the mode and channel at the same time in the next. */ - mwexec("/sbin/ifconfig " . escapeshellarg($if) . " mode " . escapeshellarg($standard)); - fwrite($wlan_setup_log, "/sbin/ifconfig " . escapeshellarg($if) . " mode " . escapeshellarg($standard) . "\n"); + //mwexec("/sbin/ifconfig " . escapeshellarg($if) . " mode " . escapeshellarg($standard)); + //fwrite($wlan_setup_log, "/sbin/ifconfig " . escapeshellarg($if) . " mode " . escapeshellarg($standard) . "\n"); /* configure wireless */ $wlcmd_args = implode(" ", $wlcmd); diff --git a/usr/local/www/interfaces.php b/usr/local/www/interfaces.php index 2248aaad36..8ca3247a4a 100644 --- a/usr/local/www/interfaces.php +++ b/usr/local/www/interfaces.php @@ -2950,6 +2950,11 @@ $types6 = array("none" => gettext("None"), "staticv6" => gettext("Static IPv6"),