mirror of
https://git.kernel.org/pub/scm/network/wireless/iwd.git
synced 2024-12-21 11:52:34 +01:00
netdev: Move operstate operations out of wiphy.c
Also make netdev_set_linkmode_and_operstate static
This commit is contained in:
parent
dd4b0dc3d3
commit
75ce550de9
@ -103,7 +103,7 @@ static size_t rta_add_u8(void *rta_buf, unsigned short type, uint8_t value)
|
||||
return RTA_SPACE(sizeof(uint8_t));
|
||||
}
|
||||
|
||||
void netdev_set_linkmode_and_operstate(uint32_t ifindex,
|
||||
static void netdev_set_linkmode_and_operstate(uint32_t ifindex,
|
||||
uint8_t linkmode, uint8_t operstate,
|
||||
netdev_command_func_t callback, void *user_data)
|
||||
{
|
||||
@ -175,6 +175,9 @@ static void netdev_free(void *data)
|
||||
netdev->associate_msg = NULL;
|
||||
}
|
||||
|
||||
netdev_set_linkmode_and_operstate(netdev->index, 0, IF_OPER_DOWN,
|
||||
NULL, NULL);
|
||||
|
||||
l_free(netdev);
|
||||
}
|
||||
|
||||
@ -1014,6 +1017,9 @@ static void netdev_get_interface_callback(struct l_genl_msg *msg,
|
||||
|
||||
l_queue_push_tail(netdev_list, netdev);
|
||||
|
||||
netdev_set_linkmode_and_operstate(netdev->index, 1,
|
||||
IF_OPER_DORMANT, NULL, NULL);
|
||||
|
||||
l_debug("Found interface %s[%d]", netdev->name, netdev->index);
|
||||
device_create(wiphy, netdev);
|
||||
}
|
||||
|
@ -53,10 +53,6 @@ typedef void (*netdev_event_func_t)(struct netdev *netdev,
|
||||
typedef void (*netdev_disconnect_cb_t)(struct netdev *netdev, bool result,
|
||||
void *user_data);
|
||||
|
||||
void netdev_set_linkmode_and_operstate(uint32_t ifindex,
|
||||
uint8_t linkmode, uint8_t operstate,
|
||||
netdev_command_func_t cb, void *user_data);
|
||||
|
||||
const uint8_t *netdev_get_address(struct netdev *netdev);
|
||||
uint32_t netdev_get_ifindex(struct netdev *netdev);
|
||||
uint32_t netdev_get_iftype(struct netdev *netdev);
|
||||
|
@ -655,9 +655,6 @@ struct device *device_create(struct wiphy *wiphy, struct netdev *netdev)
|
||||
|
||||
__device_watch_call_added(device);
|
||||
|
||||
netdev_set_linkmode_and_operstate(device->index, 1,
|
||||
IF_OPER_DORMANT, NULL, NULL);
|
||||
|
||||
scan_ifindex_add(device->index);
|
||||
device_enter_state(device, DEVICE_STATE_AUTOCONNECT);
|
||||
|
||||
@ -700,9 +697,6 @@ static void device_free(void *user)
|
||||
l_io_destroy(device->eapol_io);
|
||||
|
||||
scan_ifindex_remove(device->index);
|
||||
netdev_set_linkmode_and_operstate(device->index, 0, IF_OPER_DOWN,
|
||||
NULL, NULL);
|
||||
|
||||
l_free(device);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user