Commit Graph

35 Commits (5f8f8a366136a07df661e31decce2458357c167a)

Author SHA1 Message Date
Christian Lamparter 5f8f8a3661 base-files, mac80211, broadcom-wl: wifi detection and configuration
Currently, the wifi detection script is executed as part of
the (early) boot process. Pluggable wifi USB devices, which
are inserted at a later time are not automatically
detected and therefore they don't show up in LuCI.

A user has to deal with wifi detection manually, or restart
the router.

However, the current "sleep 1" window - which the boot
process waits for wifi devices to "settle down" - is too
short to detect wifi devices for some routers anyway.

For example, this can happen with USB WLAN devices on the
WNDR4700. This is because the usb controller needs to load
its firmware from UBI and initialize, before it can operate.

The issue can be seen on a BT HomeHub 5A as well as soon as
the caldata are on an ubi volume. This is because the ath9k
card has to be initialized by owl-loader first. Which has to
wait for the firmware extraction script to retrieve the pci
initialization values inside the caldata.

This patch moves the wifi configuration to hotplug scripts.
For mac80211, the wifi configuration will now automatically
run any time a "ieee80211" device is added. Likewise
broadcom-wl's script checks for new "net" devices which
have the "wl$NUMBER" moniker.

Issues with spawning multiple interface configuration - in
case the detection script is run concurrently - have been
resolved by using a named section for the initial
configuration. Concurrent configuration scripts will now
simply overwrite the same existing configuration.

A workaround which preserves the "sleep 1" window for just
the first boot has been added. This allows the existing
brcm47xx boot and mvebu uci-default scripts to correctly
setup the initial mac addresses and regulatory domain.

And finally, the patch renames the "wifi detect" into
"wifi config". As the script no longer produces any output
that has to be redirected or appended to the configuration
file.

Thanks to Martin Blumenstingl for helping with the implementation
and testing of the patch.

Acked-by: Jo-Philipp Wich <jo@mein.io>
Signed-off-by: Mathias Kresin <dev@kresin.me>
Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
8 years ago
Mathias Kresin ba3540db62 base-files: generate /etc/config/wireless, if it doesn't exist
This patch adds a check in "wifi detect" to test if the wireless
configuration file does exist. If it doesn't exist, an empty
/etc/config/wireless file will be created.

This is necessary because uci doesn't create new files,
instead the tool just exits with "uci: Entry not found".

Signed-off-by: Mathias Kresin <dev@kresin.me>
Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
8 years ago
Christian Lamparter 5a8a986dd5 base-files: remove non-working filter option for wifi detect
This patch removes the non-working wifi driver filter for
the wifi detection script.

I figured that rather than replacing ${2:-$DRIVERS} with
${1:-$DRIVERS}, it would be better to remove it. Nobody
needed it in the previous years.

Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
8 years ago
John Crispin 20940138ac scripts: fix wrong usage of '==' operator
[base-files] shell-scripting: fix wrong usage of '==' operator

normally the '==' is used for invoking a regex parser and is a bashism.
all of the fixes just want to compare a string. the used busybox-ash
will silently "ignore" this mistake, but make it portable/clean at least.

this patch does not change the behavior/logic of the scripts.

Signed-off-by: Bastian Bittorf <bittorf@bluebottle.com>

SVN-Revision: 42911
10 years ago
Felix Fietkau b656a56225 /sbin/wifi: reload network/wireless on wifi restart
Signed-off-by: Felix Fietkau <nbd@openwrt.org>

SVN-Revision: 39036
11 years ago
Luka Perkov 3ceb6b3274 base-files: fix whitespaces
Signed-off-by: Luka Perkov <luka@openwrt.org>

SVN-Revision: 39006
11 years ago
Felix Fietkau 6e0fafd816 wifi: restart netifd wifi interfaces on the "up" command like the old variant
Signed-off-by: Felix Fietkau <nbd@openwrt.org>

SVN-Revision: 38990
11 years ago
Felix Fietkau 3c50feca19 wifi: rename the "reload" (restarting non-netifd wifi) command to "reload_legacy"
Add a new "reload" command that reloads the netifd config as well

Signed-off-by: Felix Fietkau <nbd@openwrt.org>

SVN-Revision: 38989
11 years ago
Felix Fietkau 498d84fc4e netifd: add wireless configuration support and port mac80211 to the new framework
Signed-off-by: Felix Fietkau <nbd@openwrt.org>

SVN-Revision: 38988
11 years ago
Jo-Philipp Wich f2dde4f5ba base-files: allow wireless ifaces to be part of multiple networks
SVN-Revision: 32503
12 years ago
Jo-Philipp Wich 9ae901445b /etc/functions.sh => /lib/functions.sh
SVN-Revision: 32062
12 years ago
Jo-Philipp Wich a73fffe857 base-files: properly handle wifi ifaces with no network attached, useful for unmanaged interfaces like used for batman or monitoring
SVN-Revision: 28860
13 years ago
Felix Fietkau dab5ebaa76 netifd: ensure that a bridge gets created before hostapd needs it, hostapd must not attempt to create the bridge by itself
SVN-Revision: 28745
13 years ago
Florian Fainelli ebe7bdba88 adds a --help option to /sbin/wifi
Signed-off-by: Sebastian Philipp <sebastian@spawnhost.de>

SVN-Revision: 24258
14 years ago
Felix Fietkau 3e75044a95 wifi: fix duplicate ht capabilities in the hostapd config file by clearing the list at config load time
SVN-Revision: 22099
14 years ago
Felix Fietkau 19555b702e /sbin/wifi: improve reliability of restarts by resetting the state properly
SVN-Revision: 19495
14 years ago
Felix Fietkau 62d7bb6ecd fix a typo in the hwmode handling in /sbin/wifi (thx, maddes)
SVN-Revision: 19313
15 years ago
Jo-Philipp Wich cb30b52ec1 base-files, mac80211 (#6491) - fix wep key handling in iw with mac80211 based drivers - sanitize keys where necessary - put a procedure prepare_key_wep() into /sbin/wifi for use by other driver backends
SVN-Revision: 19118
15 years ago
Hauke Mehrtens 90fc200a60 In wifi_fixup_hwmode the value 11bg for hwmode was not transfered to bg.
SVN-Revision: 15180
15 years ago
Felix Fietkau ca749bea97 wifi: fix hostapd + autochannel
SVN-Revision: 15055
15 years ago
Jo-Philipp Wich 9a72419724 - fix mac assignment for broadcom vifs in bridging mode - thanks abramoff1 for spotting this - fix possible regression with different interface protocols - bump PKG_RELEASE
SVN-Revision: 15042
15 years ago
Jo-Philipp Wich 7e6c947e4b sync macs with vif bssids in broadcom.sh, fixes multi-ssid with wpa
SVN-Revision: 15028
15 years ago
Felix Fietkau a4f11ca22e use pidfiles for hostapd/wpa_supplicant instead of killing all processes when bringing an interface down - fixes an issue with random hostapd death
SVN-Revision: 13078
16 years ago
Felix Fietkau c0e753bcdc make sure that the dhcp client (or other processes necessary to get a connection) gets restarted when the wifi is restarted
SVN-Revision: 13026
16 years ago
Felix Fietkau 0cf1a58282 Here comes the new UCI. Enjoy :)
SVN-Revision: 10367
17 years ago
Felix Fietkau b085680b96 tab/whitespace fix
SVN-Revision: 8338
17 years ago
Felix Fietkau 600d29f61e fix an error message
SVN-Revision: 8109
17 years ago
Felix Fietkau b13426e21b keep track of the wifi interface state in /var/state/wireless
SVN-Revision: 8108
17 years ago
Felix Fietkau e58d9626f2 add a workaround for the hostapd killed issue when using more than one wifi card (#1928, #2040)
SVN-Revision: 8077
17 years ago
Felix Fietkau 90d54c0faa more fixes
SVN-Revision: 7639
17 years ago
Felix Fietkau 2954f04b41 small cleanup
SVN-Revision: 6663
17 years ago
Mike Baker a738f566e6 add a new 'option disabled' to wifi-device
SVN-Revision: 6576
17 years ago
Felix Fietkau 4215478ffe move config_get_bool from /sbin/wifi to /etc/functions.sh
SVN-Revision: 6407
17 years ago
Felix Fietkau 20e82c48ef fix typo in /sbin/wifi (#1016 - thanks, dairiki)
SVN-Revision: 5689
18 years ago
Felix Fietkau 59a06c71cb rename default/ to files/
SVN-Revision: 5622
18 years ago