@@ -1770,6 +1770,7 @@ static void station_reset_connection_state(struct station *station)
if (station->state == STATION_STATE_CONNECTED ||
station->state == STATION_STATE_CONNECTING ||
station->state == STATION_STATE_CONNECTING_AUTO ||
+ station->state == STATION_STATE_NETCONFIG ||
station_is_roaming(station))
network_disconnected(network);
}
@@ -2045,8 +2046,7 @@ static void station_netconfig_event_handler(enum netconfig_event event,
dbus_pending_reply(&station->connect_pending, reply);
}
- if (L_IN_SET(station->state, STATION_STATE_CONNECTING,
- STATION_STATE_CONNECTING_AUTO))
+ if (station->state == STATION_STATE_NETCONFIG)
network_connect_failed(station->connected_network,
false);
@@ -2072,9 +2072,14 @@ static bool netconfig_after_roam(struct station *station)
network_get_settings(network)))
return false;
- return netconfig_configure(station->netconfig,
+ if (!netconfig_configure(station->netconfig,
station_netconfig_event_handler,
- station);
+ station))
+ return false;
+
+ station_enter_state(station, STATION_STATE_NETCONFIG);
+
+ return true;
}
static void station_roamed(struct station *station)
@@ -3253,6 +3258,8 @@ static void station_connect_ok(struct station *station)
station_netconfig_event_handler,
station)))
return;
+
+ station_enter_state(station, STATION_STATE_NETCONFIG);
} else
station_enter_state(station, STATION_STATE_CONNECTED);
}
@@ -4064,8 +4071,10 @@ static struct l_dbus_message *station_dbus_scan(struct l_dbus *dbus,
if (station->dbus_scan_id)
return dbus_error_busy(message);
- if (station->state == STATION_STATE_CONNECTING ||
- station->state == STATION_STATE_CONNECTING_AUTO)
+ if (L_IN_SET(station->state, STATION_STATE_CONNECTING,
+ STATION_STATE_CONNECTING_AUTO,
+ STATION_STATE_NETCONFIG) ||
+ station_is_roaming(station))
return dbus_error_busy(message);
station->dbus_scan_subset_idx = 0;
@@ -4288,7 +4297,14 @@ static bool station_property_get_state(struct l_dbus *dbus,
case STATION_STATE_ROAMING:
case STATION_STATE_FT_ROAMING:
case STATION_STATE_FW_ROAMING:
- statestr = "roaming";
+ /*
+ * Stay in a connecting state if roaming before netconfig
+ * has finished
+ */
+ if (station->netconfig_after_roam)
+ statestr = "connecting";
+ else
+ statestr = "roaming";
break;
}
@@ -5022,8 +5038,10 @@ static struct l_dbus_message *station_debug_scan(struct l_dbus *dbus,
if (station->dbus_scan_id)
return dbus_error_busy(message);
- if (station->state == STATION_STATE_CONNECTING ||
- station->state == STATION_STATE_CONNECTING_AUTO)
+ if (L_IN_SET(station->state, STATION_STATE_CONNECTING,
+ STATION_STATE_CONNECTING_AUTO,
+ STATION_STATE_NETCONFIG) ||
+ station_is_roaming(station))
return dbus_error_busy(message);
if (!l_dbus_message_get_arguments(message, "aq", &iter))