aboutsummaryrefslogtreecommitdiffstats
path: root/package/kernel/mac80211/files
Commit message (Collapse)AuthorAgeFilesLines
* mac80211: print an error if wifi teardown failsBob Cantor2021-06-281-0/+4
| | | | | | | | | drv_mac80211_teardown fails silently if the device to be torn down is not defined. This commit prints an error message. branches affected: trunk, 21.02 Signed-off-by: Bob Cantor <coxede6557@w3boats.com>
* mac80211: always call wireless_set_data (FS#3784)Bob Cantor2021-06-281-4/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When wifi is turned off, drv_mac80211_teardown sometimes fails (silently) because the device to be torn down is not defined. This situation arises if drv_mac80211_setup was called twice when wifi was turned on. This commit ensures that the device to be torn down is always defined in drv_mac80211_teardown. Steps to reproduce: 1) Use /sbin/wifi to turn on wifi. uci set wireless.@wifi-iface[0].disabled=0 uci set wireless.@wifi-device[0].disabled=0 uci commit wifi 2) Use /sbin/wifi to turn off wifi. uci set wireless.@wifi-device[0].disabled=1 uci commit wifi 3) Observe that wifi is still up. branches affected: trunk, 21.02 Signed-off-by: Bob Cantor <coxede6557@w3boats.com>
* mac80211: fix no_reload logic (FS#3902)Bob Cantor2021-06-281-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If drv_mac80211_setup is called twice with the same wifi configuration, then the second call returns early with error HOSTAPD_START_FAILED. (wifi works nevertheless, despite the fact that setup is incomplete. But "ubus call network.wireless status" erroneously reports that radio0 is down.) The relevant part of drv_mac80211_setup is, if [ "$no_reload" != "0" ]; then add_ap=1 ubus wait_for hostapd local hostapd_res="$(ubus call hostapd config_add "{\"iface\":\"$primary_ap\", \"config\":\"${hostapd_conf_file}\"}")" ret="$?" [ "$ret" != 0 -o -z "$hostapd_res" ] && { wireless_setup_failed HOSTAPD_START_FAILED return } wireless_add_process "$(jsonfilter -s "$hostapd_res" -l 1 -e @.pid)" "/usr/sbin/hostapd" 1 1 fi This commit sets no_reload = 0 during the second call of drv_mac80211_setup. It is perhaps worth providing a way to reproduce the situation where drv_mac80211_setup is called twice. When /sbin/wifi is used to turn on wifi, uci set wireless.@wifi-iface[0].disabled=0 uci set wireless.@wifi-device[0].disabled=0 uci commit wifi /sbin/wifi makes the following ubus calls, ubus call network reload ubus call network.wireless down ubus call network.wireless up The first and third ubus calls both call drv_mac80211_setup, while the second ubus call triggers wireless_device_setup_cancel. So the call sequence becomes, drv_mac80211_setup wireless_device_setup_cancel drv_mac80211_setup In contrast, when LuCI is used to turn on wifi only a single call is made to drv_mac80211_setup. branches affected: trunk, 21.02 Signed-off-by: Bob Cantor <coxede6557@w3boats.com>
* mac80211: fix processing HE capabilities (FS#3871)Felix Fietkau2021-06-171-1/+1
| | | | | | Use the right argument to fix setting unsupported capabilities to 0 Signed-off-by: Felix Fietkau <nbd@nbd.name>
* mac80211: rely on iwinfo for phy->path and path->phy lookupsFelix Fietkau2021-06-103-41/+3
| | | | | | This avoids inconsistencies from having multiple implementations do the same thing Signed-off-by: Felix Fietkau <nbd@nbd.name>
* mac80211: fix typoFelix Fietkau2021-06-031-1/+1
| | | | | | Remove stray parenthesis Signed-off-by: Felix Fietkau <nbd@nbd.name>
* mac80211: do not enable VHT in the default config on 2.4 GHzFelix Fietkau2021-06-021-1/+1
| | | | | | | Some drivers advertise it, but it's not supported at the moment Reported-by: John Thomson <git@johnthomson.fastmail.com.au> Signed-off-by: Felix Fietkau <nbd@nbd.name>
* mac80211: fix detecting VHT capabilities when generating the default configFelix Fietkau2021-06-021-1/+1
| | | | | | | The colon does not directly follow the "VHT Capabilities" string Reported-by: John Thomson <git@johnthomson.fastmail.com.au> Signed-off-by: Felix Fietkau <nbd@nbd.name>
* mac80211: add more HE capabilitiesFelix Fietkau2021-05-261-5/+81
| | | | Signed-off-by: Felix Fietkau <nbd@nbd.name>
* mac80211: fix center freq selection for 6 GHzFelix Fietkau2021-05-261-6/+20
| | | | Signed-off-by: Felix Fietkau <nbd@nbd.name>
* mac80211: set hostapd op_class for 6 GHzFelix Fietkau2021-05-261-0/+8
| | | | | | This is needed to disambiguate it from 5 GHz channels Signed-off-by: Felix Fietkau <nbd@nbd.name>
* mac80211: rework default config scriptFelix Fietkau2021-05-261-20/+85
| | | | | | | Emit the new band option instead of hwmode Support 6 GHz band and HE options Signed-off-by: Felix Fietkau <nbd@nbd.name>
* mac80211: make use of the new 'band' optionFelix Fietkau2021-05-261-14/+31
| | | | | | | Use it to look up frequencies only in the configured band to better deal with channel number overlap Signed-off-by: Felix Fietkau <nbd@nbd.name>
* mac80211: fix incorrect parameterDavid Bauer2021-02-011-1/+1
| | | | | | | he_mu_beamformer only accepts values of 0 and 1 according to the hostapd documentation. Signed-off-by: David Bauer <mail@david-bauer.net>
* mac80211: improve error handling when adding hostapd configDaniel Golle2021-01-141-7/+7
| | | | Signed-off-by: Daniel Golle <daniel@makrotopia.org>
* mac80211: use hostapd PID returned from config_addDaniel Golle2021-01-101-2/+1
| | | | | | | Use PID returned from config_add instead of querying procd when adding configuration to hostapd. Signed-off-by: Daniel Golle <daniel@makrotopia.org>
* mac80211: add 802.11ad-supportGary Cooper2021-01-051-0/+6
| | | | | | This adds logic to properly populate defaults in /etc/config/wireless. Signed-off-by: Gary Cooper <gaco@bitmessage.de>
* hostapd: do not restart hostapd instance on wireless restartsFelix Fietkau2020-12-311-1/+1
| | | | | | Add the flag that prevents netifd from killing hostapd/wpa_supplicant Signed-off-by: Felix Fietkau <nbd@nbd.name>
* mac80211: fix MAC address allocations when local bit set on base addrPaul Fertser2020-12-221-2/+2
| | | | | | | | | | | | | | | Testing with hwsim reveals two problems: 1. phyX/addresses has two addresses and mac80211_get_addr keeps returning the last one when asked for more; 2. The base address has the local bit set and the operation unsets it. Fix both. Fixes: 866790fd827cb0187353cdf484eb46a9b38fb6ba Reported-by: Zero_Chaos Signed-off-by: Paul Fertser <fercerpav@gmail.com>
* mac80211: Fix wpa_supplicant config removal ubus callSven Eckelmann2020-10-281-1/+1
| | | | | | | | | | | | | | | If mac80211_setup_supplicant() is called with enabled=0 then it should just destroy the interface and remove the configuration from wpa_supplicant. But the ubus method call always returned Command failed: Method not found because the actual name of the method is "config_remove". Fixes: b5516603dd90 ("mac80211: more wifi reconf related fixes") Signed-off-by: Sven Eckelmann <sven@narfation.org> [bump PKG_RELEASE] Signed-off-by: David Bauer <mail@david-bauer.net>
* mac80211: pass phy name to hostapd_set_bss_optionsDavid Bauer2020-10-281-1/+1
| | | | | | | | | | | | hostapd_set_bss_options expects the PHY as second and the VIF as third argument. However, only the VIF was passed as second argument without a third argument at all. This was never a problem, as both PHY and VIF were never accessed. However, with FTM support the PHY is needed to determine the HW support when configuring the BSS. Signed-off-by: David Bauer <mail@david-bauer.net>
* mac80211: add support for specifying a per-device scan listFelix Fietkau2020-09-291-0/+2
| | | | | | | This is useful to bring up multiple client mode interfaces on a single channel much faster without having to scan through a lot of channels Signed-off-by: Felix Fietkau <nbd@nbd.name>
* mac80211: select the first available channel for 5GHz interfacesDavide Fioravanti2020-09-201-2/+2
| | | | | | | | | | Some 5GHz wifi interfaces, especially in Tri-band routers, can't use channel 36. In these cases, the default configuration for 5GHz interfaces, once enabled, doesn't work. This patch selects the first non-disabled channel for 5GHz interfaces. Signed-off-by: Davide Fioravanti <pantanastyle@gmail.com>
* mac80211: add preliminary support for enabling 802.11ax in configFelix Fietkau2020-09-041-12/+37
| | | | | | No advanced features are configurable yet, just basic enabling of HE modes Signed-off-by: Felix Fietkau <nbd@nbd.name>
* mac80211: don't kill wireless daemon on teardownDavid Bauer2020-07-311-2/+0
| | | | | | | | Don't kill the wireless daemon on teardown. hostapd as well as wpa_supplicant are managed by procd which would detect the shutdown of either process as a crash loop. Signed-off-by: David Bauer <mail@david-bauer.net>
* hostapd: fix incorrect service nameDavid Bauer2020-07-311-1/+1
| | | | | | | | | | | | | | When retrieving the PID for hostapd and wpa_supplicant via ubus the wrong service name is currently used. This leads to the following error in the log: netifd: radio0 (1409): WARNING (wireless_add_process): executable path /usr/sbin/wpad does not match process path (/proc/exe) Fixing the service name retrieves the correct PID and therefore the warning won't occur. Signed-off-by: David Bauer <mail@david-bauer.net>
* mac80211: create channel list for fixed channel operationDavid Bauer2020-07-201-0/+3
| | | | | | | | | | | | Currently a device which has a DFS channel selected using the UCI channel setting might switch to a non-DFS channel in case no chanlist is provided (UCI setting "channels") when the radio detects a DFS event. Automatically add a chanlist consisting of the configured channel when the device does not operate in auto-channel mode and no chanlist set to circumvent this issue. Signed-off-by: David Bauer <mail@david-bauer.net>
* mac80211: allow ACS restriction with fixed channelJan Hoffmann2020-07-061-1/+1
| | | | | | | | | | | This can be useful when a DFS channel is configured, as the ACS channel list is taken into account when switching channels after a radar event. For example, this allows to prevent the SRD channels from being used in that case. Signed-off-by: Jan Hoffmann <jan@3e8.eu> [reorder structure] Signed-off-by: David Bauer <mail@david-bauer.net>
* mac80211: fix use of local variableLeon M. George2020-06-241-1/+1
| | | | | | | | | | mac80211_get_addr is called from mac80211_generate_mac, where the local variable initialisation id="${macidx:-0}" suggests that macidx is not always defined. Probably, idx was supposed to be used instead of $(($macidx + 1)). Fixes: 4d99db168cf7 ("mac80211: try to get interface addresses from wiphy sysfs 'addresses' if no mask is set") Signed-off-by: Leon M. George <leon@georgemail.eu>
* hostapd: add support for wifi-station and wifi-vlan sectionsJohn Crispin2020-06-041-1/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch adds support for 2 new uci sections. config wifi-vlan # iface is optional. if it is not defined the vlan will apply # to all interfaces option iface default_radio0 option name guest option vid 100 option network guest config wifi-station # iface is optional. if it is not defined the station will apply # to all interfaces option iface default_radio0 # mac is optional. if it is not defined it will be a catch all # for any sta using this key option mac '00:11:22:33:44:55' # vid is optional. if it is not defined, the sta will be part of # the primary iface. option vid 100 option key testtest With this patch applied it is possible to use multiple PSKs on a single BSS. Signed-off-by: John Crispin <john@phrozen.org>
* mac80211: fix wifi teardownJohn Crispin2020-05-301-4/+6
| | | | | | reverts part of the recent wifi reconf patch. Signed-off-by: John Crispin <john@phrozen.org>
* mac80211: Fix setting radio htmode when using mesh modeEnrique Rodríguez Valencia2020-05-281-0/+1
| | | | | | | When configuring the radio in legacy mode from luci, the htmode is not set correctly to NOHT, causing the radio in mesh mode to be set to HT40. Signed-off-by: Enrique Rodríguez Valencia <enrique.rodriguez@galgus.net>
* mac80211: replace backticks by $(...)Adrian Schmutzler2020-05-131-1/+1
| | | | | | This replaces deprecated backticks by more versatile $(...) syntax. Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
* mac80211: distance config: allow "auto" as a valueAli MJ Al-Nasrawy2020-05-091-1/+2
| | | | | | | | | The user can now enable the ACK timeout estimation algorithm (dynack) for drivers that support it. It is also expected that the distance config accepts the same values as: $ iw phyX set distance XXX Signed-off-by: Ali MJ Al-Nasrawy <alimjalnasrawy@gmail.com>
* mac80211: more wifi reconf related fixesJohn Crispin2020-05-041-18/+24
| | | | | | | | | | | * uci state was not getting reset properly during teardown * AP+STA co-exist state was not flushed properly upon channel switch * remove a debug logger call * properly teardown supplicant instances when they get disabled * add md5 config support for supplicant * don't call wpa_supplicant_prepare_interface twice Signed-off-by: John Crispin <john@phrozen.org>
* mac80211: make sure existing iface belongs to correct (fullmac) phyDaniel Golle2020-04-171-8/+18
| | | | | | | | | | | | | | Some FullMAC cfg80211 wireless devices do not support virtual interfaces, hence there is script logic to keep the existing network device. Improve this to support renaming the interface if needed and make sure the existing interface actually belongs to the right phy. Change calls to 'iw' to avoid outputing warnings and errors to not confuse users of such devices. Also bump PKG_RELEASE which has been forgotten in the previous two mac80211 changes. Signed-off-by: Daniel Golle <daniel@makrotopia.org>
* mac80211: fix detecting existing interfaceDaniel Golle2020-04-171-1/+1
| | | | | | | | | Instead of using the actual interface name, a hard-coded 'wlan0' has slipped into the script. Replace it. Fixes: ccf2aa9d4b ("mac80211: detect existing interface before adding") Reported-by: John Crispin <john@phrozen.org> Signed-off-by: Daniel Golle <daniel@makrotopia.org>
* mac80211: adapt for single-instance wpadDaniel Golle2020-04-141-7/+7
| | | | Signed-off-by: Daniel Golle <daniel@makrotopia.org>
* hostapd: fix no_reload logicJohn Crispin2020-03-271-2/+4
| | | | | | | the code would unconditionally tear down all interfaces upon a reconf. This should only be done when the reconf call fails. Signed-off-by: John Crispin <john@phrozen.org>
* mac80211: do not try to setup hostapd-managed interfaces.Oldřich Jedlička2020-03-201-7/+11
| | | | | | | | | | | | | | | | | | | | | | For virtual access points (when multiple SSIDs are used for one physical AP), there exist one physical network interface and multiple virtual interfaces, which are fully under control of hostapd. When networking is setup, the script `/lib/netifd/wireless/mac80211.sh` is called, which tries to bring the interface up by a call to `ip link set dev <iface> up`. This call might fail for virtual APs, because the virtual interface might not have been created by hostapd yet. There are some artifical delays in the script most probably to handle this, but when DFS channel availability check on 5GHz band is issued, hostapd can delay creating virtual interfaces by a minute. In order to fix this (or work around it), do not try to bring the interface up (this is responsibility of hostapd anyway) and do not try to set txpower on the virtual interface. Fixes FS#2698. Signed-off-by: Oldřich Jedlička <oldium.pro@gmail.com>
* mac80211: enhance wifi reloadJohn Crispin2020-02-251-1/+8
| | | | | | If the reconf call fails force a full restart of the radio. Signed-off-by: John Crispin <john@phrozen.org>
* mac80211: expose chanbw support to debugfs for ath9k_htcTomislav Požega2020-02-131-1/+1
| | | | | | | This will ensure the htc suffixed driver also gets created chanbw debugfs entry. Signed-off-by: Tomislav Požega <pozega.tomislav@gmail.com>
* mac80211: add support for wds_bridge hostapd featureDaniel Golle2020-01-221-2/+6
| | | | | | | | | | | | | hostapd allows putting WDS (4addr mode) clients into a separate bridge other than the bridge regular (3addr mode) clients end up in. This is useful for example giving WDS clients access to several VLANs (trunking) while regular clients will end up inside a specific VLAN. Add 'wds_bridge' config parameter for wifi-iface which contains the name of the bridge. hostapd-mini already supports this feature, so all needed is to add the UCI wrapping in mac80211.sh. Signed-off-by: Daniel Golle <daniel@makrotopia.org>
* mac80211: fix MAC address allocations if the local bit is set on the base addrFelix Fietkau2020-01-151-1/+1
| | | | | | | If it's set, don't subtract 1 from the interface index encoded into the first byte of the address Signed-off-by: Felix Fietkau <nbd@nbd.name>
* mac80211: fix list_phy_interfaces for multiple wiphys on the same deviceFelix Fietkau2020-01-141-1/+10
| | | | | | | Network interfaces are looked up based on the device behind a phy, so the phy needs to be checked separately Signed-off-by: Felix Fietkau <nbd@nbd.name>
* mac80211: fix txpower when using DFS channelsDavid Bauer2019-12-161-2/+7
| | | | | | | | | | | With this patch, txpower for the PHY is applied when configuring the PHY instead of the VIF. Otherwise, the configured txpower is not applied for the first initialized VIF when using DFS channels, as it is currently applied too early when the CAC hasn't finished. Reported-by: Martin Weinelt <martin@darmstadt.freifunk.net Signed-off-by: David Bauer <mail@david-bauer.net> Tested-by: Martin Weinelt <martin@darmstadt.freifunk.net>
* mac80211: don't call md5sum on non-existing fileDaniel Golle2019-12-081-1/+1
| | | | | | | | | | | | If no AP is configured, hostapd-${phy}.conf is not being created, hence md5sum fails and causes log pollution: netifd: radio1 (3183): md5sum: can't open '/var/run/hostapd-phy1.conf': No such file or directoy Hence make sure the file exists when calling md5sum. Fixes: a5bc9787d4 ("mac80211: add support for dynamically reconfiguring wifi") Signed-off-by: Daniel Golle <daniel@makrotopia.org>
* hostapd: re-introduce process trackingDaniel Golle2019-12-081-0/+3
| | | | | | | | | | | Before commit 60fb4c92b6 ("hostapd: add ubus reload") netifd was tracking hostapd/wpa_supplicant and restarting wifi in case of a process crash. Restore this behaviour by tracking the PIDs of hostapd and wpa_supplicant. Also make sure hostapd and/or wpa_supplicant have been started before emmitting ubus calls to them using ubus wait_for. Signed-off-by: Daniel Golle <daniel@makrotopia.org>
* mac80211: track unmanaged interfacesDaniel Golle2019-12-081-3/+42
| | | | | | | | | In addition to wpa_supplicant and hostapd managed interfaces, also track unmanaged interfaces. This is used to make sure that running 'wifi' always returns into a clean state regardless of what the user did before. Signed-off-by: Daniel Golle <daniel@makrotopia.org>
* mac80211: unify setup of iw htmode for mesh and adhocSantiago Piccinini2019-11-291-49/+16
| | | | | | | | | This also fixes mac80211_prepare_vif iw set channel in monitor or mesh mode. Signed-off-by: Santiago Piccinini <spiccinini@altermundi.net> Signed-off-by: Daniel Golle <daniel@makrotopia.org> [daniel@makrotopia.org: fixed commit message]