mirror of
https://git.kernel.org/pub/scm/network/wireless/iwd.git
synced 2025-02-02 06:44:13 +01:00
device: Move device_disassociated out of wiphy.c
This commit is contained in:
parent
64604ed59c
commit
6bd71066ff
24
src/device.c
24
src/device.c
@ -26,6 +26,9 @@
|
|||||||
|
|
||||||
#include <ell/ell.h>
|
#include <ell/ell.h>
|
||||||
|
|
||||||
|
#include "src/common.h"
|
||||||
|
#include "src/dbus.h"
|
||||||
|
#include "src/network.h"
|
||||||
#include "src/device.h"
|
#include "src/device.h"
|
||||||
|
|
||||||
struct device_watchlist_item {
|
struct device_watchlist_item {
|
||||||
@ -112,6 +115,27 @@ void __device_watch_call_removed(struct device *device)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void device_disassociated(struct device *device)
|
||||||
|
{
|
||||||
|
struct network *network = device->connected_network;
|
||||||
|
struct l_dbus *dbus = dbus_get_bus();
|
||||||
|
|
||||||
|
if (!network)
|
||||||
|
return;
|
||||||
|
|
||||||
|
network_disconnected(network);
|
||||||
|
|
||||||
|
device->connected_bss = NULL;
|
||||||
|
device->connected_network = NULL;
|
||||||
|
|
||||||
|
device_enter_state(device, DEVICE_STATE_AUTOCONNECT);
|
||||||
|
|
||||||
|
l_dbus_property_changed(dbus, device_get_path(device),
|
||||||
|
IWD_DEVICE_INTERFACE, "ConnectedNetwork");
|
||||||
|
l_dbus_property_changed(dbus, network_get_path(network),
|
||||||
|
IWD_NETWORK_INTERFACE, "Connected");
|
||||||
|
}
|
||||||
|
|
||||||
bool device_init(void)
|
bool device_init(void)
|
||||||
{
|
{
|
||||||
device_watches = l_queue_new();
|
device_watches = l_queue_new();
|
||||||
|
@ -77,6 +77,7 @@ uint32_t device_get_ifindex(struct device *device);
|
|||||||
const uint8_t *device_get_address(struct device *device);
|
const uint8_t *device_get_address(struct device *device);
|
||||||
|
|
||||||
void device_enter_state(struct device *device, enum device_state state);
|
void device_enter_state(struct device *device, enum device_state state);
|
||||||
|
void device_disassociated(struct device *device);
|
||||||
void device_connect_network(struct device *device, struct network *network,
|
void device_connect_network(struct device *device, struct network *network,
|
||||||
struct scan_bss *bss,
|
struct scan_bss *bss,
|
||||||
struct l_dbus_message *message);
|
struct l_dbus_message *message);
|
||||||
|
@ -24,6 +24,7 @@
|
|||||||
|
|
||||||
struct device;
|
struct device;
|
||||||
struct network;
|
struct network;
|
||||||
|
struct scan_bss;
|
||||||
|
|
||||||
bool network_seen(struct network *network, struct timespec *when);
|
bool network_seen(struct network *network, struct timespec *when);
|
||||||
bool network_connected(struct network *network);
|
bool network_connected(struct network *network);
|
||||||
|
21
src/wiphy.c
21
src/wiphy.c
@ -184,27 +184,6 @@ void device_enter_state(struct device *device, enum device_state state)
|
|||||||
device->state = state;
|
device->state = state;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void device_disassociated(struct device *device)
|
|
||||||
{
|
|
||||||
struct network *network = device->connected_network;
|
|
||||||
struct l_dbus *dbus = dbus_get_bus();
|
|
||||||
|
|
||||||
if (!network)
|
|
||||||
return;
|
|
||||||
|
|
||||||
network_disconnected(network);
|
|
||||||
|
|
||||||
device->connected_bss = NULL;
|
|
||||||
device->connected_network = NULL;
|
|
||||||
|
|
||||||
device_enter_state(device, DEVICE_STATE_AUTOCONNECT);
|
|
||||||
|
|
||||||
l_dbus_property_changed(dbus, device_get_path(device),
|
|
||||||
IWD_DEVICE_INTERFACE, "ConnectedNetwork");
|
|
||||||
l_dbus_property_changed(dbus, network_get_path(network),
|
|
||||||
IWD_NETWORK_INTERFACE, "Connected");
|
|
||||||
}
|
|
||||||
|
|
||||||
static void device_lost_beacon(struct device *device)
|
static void device_lost_beacon(struct device *device)
|
||||||
{
|
{
|
||||||
if (device->connect_pending)
|
if (device->connect_pending)
|
||||||
|
Loading…
Reference in New Issue
Block a user