3
0
mirror of https://git.kernel.org/pub/scm/network/wireless/iwd.git synced 2024-11-22 06:29:23 +01:00

station: add two new roaming states (FT/FW)

This adds two new station states to differentiate between
reassociation (ROAMING), Fast transition (FT_ROAMING) or a firmare
based roam (FW_ROAMING).
This commit is contained in:
James Prestwood 2022-09-28 11:33:50 -07:00 committed by Denis Kenzior
parent 174e9f2fe9
commit edf556cc7b
3 changed files with 30 additions and 9 deletions

View File

@ -197,6 +197,13 @@ static bool station_is_autoconnecting(struct station *station)
station->state == STATION_STATE_AUTOCONNECT_QUICK; station->state == STATION_STATE_AUTOCONNECT_QUICK;
} }
static bool station_is_roaming(struct station *station)
{
return station->state == STATION_STATE_ROAMING ||
station->state == STATION_STATE_FT_ROAMING ||
station->state == STATION_STATE_FW_ROAMING;
}
static bool station_debug_event(struct station *station, const char *name) static bool station_debug_event(struct station *station, const char *name)
{ {
struct l_dbus_message *signal; struct l_dbus_message *signal;
@ -1461,6 +1468,10 @@ static const char *station_state_to_string(enum station_state state)
return "disconnecting"; return "disconnecting";
case STATION_STATE_ROAMING: case STATION_STATE_ROAMING:
return "roaming"; return "roaming";
case STATION_STATE_FT_ROAMING:
return "ft-roaming";
case STATION_STATE_FW_ROAMING:
return "fw-roaming";
} }
return "invalid"; return "invalid";
@ -1599,6 +1610,8 @@ static void station_enter_state(struct station *station,
case STATION_STATE_DISCONNECTING: case STATION_STATE_DISCONNECTING:
break; break;
case STATION_STATE_ROAMING: case STATION_STATE_ROAMING:
case STATION_STATE_FT_ROAMING:
case STATION_STATE_FW_ROAMING:
station_set_evict_nocarrier(station, false); station_set_evict_nocarrier(station, false);
break; break;
} }
@ -1722,7 +1735,7 @@ static void station_reset_connection_state(struct station *station)
if (station->state == STATION_STATE_CONNECTED || if (station->state == STATION_STATE_CONNECTED ||
station->state == STATION_STATE_CONNECTING || station->state == STATION_STATE_CONNECTING ||
station->state == STATION_STATE_CONNECTING_AUTO || station->state == STATION_STATE_CONNECTING_AUTO ||
station->state == STATION_STATE_ROAMING) station_is_roaming(station))
network_disconnected(network); network_disconnected(network);
} }
@ -2055,7 +2068,7 @@ static void station_roam_failed(struct station *station)
* If we attempted a reassociation or a fast transition, and ended up * If we attempted a reassociation or a fast transition, and ended up
* here then we are now disconnected. * here then we are now disconnected.
*/ */
if (station->state == STATION_STATE_ROAMING) { if (station_is_roaming(station)) {
station_disassociated(station); station_disassociated(station);
return; return;
} }
@ -2245,7 +2258,7 @@ try_next:
station->connected_bss = bss; station->connected_bss = bss;
station->preparing_roam = false; station->preparing_roam = false;
station_enter_state(station, STATION_STATE_ROAMING); station_enter_state(station, STATION_STATE_FT_ROAMING);
return true; return true;
@ -2288,7 +2301,7 @@ static bool station_fast_transition(struct station *station,
station->connected_bss = bss; station->connected_bss = bss;
station->preparing_roam = false; station->preparing_roam = false;
station_enter_state(station, STATION_STATE_ROAMING); station_enter_state(station, STATION_STATE_FT_ROAMING);
return true; return true;
} else { } else {
@ -2742,7 +2755,8 @@ static bool station_cannot_roam(struct station *station)
disabled = false; disabled = false;
return disabled || station->preparing_roam || return disabled || station->preparing_roam ||
station->state == STATION_STATE_ROAMING; station->state == STATION_STATE_ROAMING ||
station->state == STATION_STATE_FT_ROAMING;
} }
#define WNM_REQUEST_MODE_PREFERRED_CANDIDATE_LIST (1 << 0) #define WNM_REQUEST_MODE_PREFERRED_CANDIDATE_LIST (1 << 0)
@ -3180,7 +3194,8 @@ static void station_disconnect_event(struct station *station, void *event_data)
event_data, station); event_data, station);
return; return;
case STATION_STATE_CONNECTED: case STATION_STATE_CONNECTED:
case STATION_STATE_ROAMING: case STATION_STATE_FT_ROAMING:
case STATION_STATE_FW_ROAMING:
station_disassociated(station); station_disassociated(station);
return; return;
default: default:
@ -3234,7 +3249,7 @@ static void station_netdev_event(struct netdev *netdev, enum netdev_event event,
station_signal_agent_notify(station); station_signal_agent_notify(station);
break; break;
case NETDEV_EVENT_ROAMING: case NETDEV_EVENT_ROAMING:
station_enter_state(station, STATION_STATE_ROAMING); station_enter_state(station, STATION_STATE_FW_ROAMING);
break; break;
case NETDEV_EVENT_ROAMED: case NETDEV_EVENT_ROAMED:
station_event_roamed(station, (struct scan_bss *) event_data); station_event_roamed(station, (struct scan_bss *) event_data);
@ -3246,7 +3261,7 @@ static void station_netdev_event(struct netdev *netdev, enum netdev_event event,
station_packets_lost(station, l_get_u32(event_data)); station_packets_lost(station, l_get_u32(event_data));
break; break;
case NETDEV_EVENT_FT_ROAMED: case NETDEV_EVENT_FT_ROAMED:
if (station->state != STATION_STATE_ROAMING) if (L_WARN_ON(station->state != STATION_STATE_FT_ROAMING))
return; return;
station_roamed(station); station_roamed(station);
@ -4069,6 +4084,8 @@ static bool station_property_get_state(struct l_dbus *dbus,
statestr = "disconnecting"; statestr = "disconnecting";
break; break;
case STATION_STATE_ROAMING: case STATION_STATE_ROAMING:
case STATION_STATE_FT_ROAMING:
case STATION_STATE_FW_ROAMING:
statestr = "roaming"; statestr = "roaming";
break; break;
} }

View File

@ -42,7 +42,9 @@ enum station_state {
STATION_STATE_CONNECTING_AUTO, STATION_STATE_CONNECTING_AUTO,
STATION_STATE_CONNECTED, STATION_STATE_CONNECTED,
STATION_STATE_DISCONNECTING, STATION_STATE_DISCONNECTING,
STATION_STATE_ROAMING STATION_STATE_ROAMING, /* Reassociation */
STATION_STATE_FT_ROAMING, /* Fast transition */
STATION_STATE_FW_ROAMING, /* Firmware roamed by itself */
}; };
enum station_event { enum station_event {

View File

@ -665,6 +665,8 @@ static void wsc_check_can_connect(struct wsc_station_dbus *wsc,
case STATION_STATE_AUTOCONNECT_QUICK: case STATION_STATE_AUTOCONNECT_QUICK:
case STATION_STATE_AUTOCONNECT_FULL: case STATION_STATE_AUTOCONNECT_FULL:
case STATION_STATE_ROAMING: case STATION_STATE_ROAMING:
case STATION_STATE_FT_ROAMING:
case STATION_STATE_FW_ROAMING:
l_warn("%s: invalid station state", __func__); l_warn("%s: invalid station state", __func__);
break; break;
} }