mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2025-12-27 02:20:12 +01:00
wifi: mode changes must happen when device is down
With both WEXT and nl80211; this wasn't an issue before because devices can still scan in adhoc mode. But we do need to ensure that the device is in Infrastructure mode when we deactivate a Hotspot.
This commit is contained in:
parent
25f9801ebd
commit
7c34a37e73
1 changed files with 9 additions and 3 deletions
|
|
@ -980,10 +980,16 @@ deactivate (NMDevice *dev)
|
|||
/* Ensure we're in infrastructure mode after deactivation; some devices
|
||||
* (usually older ones) don't scan well in adhoc mode.
|
||||
*/
|
||||
wifi_utils_set_mode (priv->wifi_data, NM_802_11_MODE_INFRA);
|
||||
priv->mode = NM_802_11_MODE_INFRA;
|
||||
if (priv->mode != old_mode)
|
||||
if (wifi_utils_get_mode (priv->wifi_data) != NM_802_11_MODE_INFRA) {
|
||||
nm_device_hw_take_down (NM_DEVICE (self), TRUE);
|
||||
wifi_utils_set_mode (priv->wifi_data, NM_802_11_MODE_INFRA);
|
||||
nm_device_hw_bring_up (NM_DEVICE (self), TRUE, NULL);
|
||||
}
|
||||
|
||||
if (priv->mode != NM_802_11_MODE_INFRA) {
|
||||
priv->mode = NM_802_11_MODE_INFRA;
|
||||
g_object_notify (G_OBJECT (self), NM_DEVICE_WIFI_MODE);
|
||||
}
|
||||
|
||||
/* Ensure we trigger a scan after deactivating a Hotspot */
|
||||
if (old_mode == NM_802_11_MODE_AP) {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue