3
0
mirror of https://git.kernel.org/pub/scm/network/wireless/iwd.git synced 2024-11-20 04:19:25 +01:00

netdev: Implement new_wiphy hint

When a new wiphy is added, the kernel usually adds a default STA
interface as well.  This interface is currently not signaled over
nl80211 in any way.

This implements a selective dump of the wiphy interfaces in order to
obtain the newly added netdev.  Selective dump is currently not
supported by the kernel, so all netdevs will be returned.  A patch on
linux-wireless is pending that implements the selective dump
functionality.
This commit is contained in:
Denis Kenzior 2016-07-01 14:39:25 -05:00
parent 943acddb49
commit 005213a3d4
2 changed files with 13 additions and 0 deletions

View File

@ -1358,6 +1358,18 @@ static void netdev_link_notify(uint16_t type, const void *data, uint32_t len,
} }
} }
void netdev_new_wiphy_hint(uint32_t wiphy_id)
{
struct l_genl_msg *msg;
msg = l_genl_msg_new_sized(NL80211_CMD_GET_INTERFACE, 8);
l_genl_msg_append_attr(msg, NL80211_ATTR_WIPHY, 4, &wiphy_id);
if (!l_genl_family_dump(nl80211, msg, netdev_get_interface_callback,
NULL, NULL))
l_error("Getting wiphy %d interface info failed", wiphy_id);
}
static bool netdev_watch_match(const void *a, const void *b) static bool netdev_watch_match(const void *a, const void *b)
{ {
const struct netdev_watch *item = a; const struct netdev_watch *item = a;

View File

@ -69,6 +69,7 @@ int netdev_disconnect(struct netdev *netdev,
netdev_disconnect_cb_t cb, void *user_data); netdev_disconnect_cb_t cb, void *user_data);
struct netdev *netdev_find(int ifindex); struct netdev *netdev_find(int ifindex);
void netdev_new_wiphy_hint(uint32_t wiphy_id);
uint32_t netdev_watch_add(struct netdev *netdev, netdev_watch_func_t func, uint32_t netdev_watch_add(struct netdev *netdev, netdev_watch_func_t func,
void *user_data); void *user_data);