mirror of
https://git.kernel.org/pub/scm/network/wireless/iwd.git
synced 2024-11-26 02:19:26 +01:00
anqp: utilize IWD_MODULE
This converts anqp into an IWD module.
This commit is contained in:
parent
369c5fbd0b
commit
2ab8d4bbed
12
src/anqp.c
12
src/anqp.c
@ -474,11 +474,11 @@ static void anqp_mlme_notify(struct l_genl_msg *msg, void *user_data)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
bool anqp_init(struct l_genl_family *in)
|
static int anqp_init(void)
|
||||||
{
|
{
|
||||||
struct l_genl *genl = iwd_get_genl();
|
struct l_genl *genl = iwd_get_genl();
|
||||||
|
|
||||||
nl80211 = in;
|
nl80211 = l_genl_family_new(genl, NL80211_GENL_NAME);
|
||||||
|
|
||||||
anqp_requests = l_queue_new();
|
anqp_requests = l_queue_new();
|
||||||
|
|
||||||
@ -492,13 +492,14 @@ bool anqp_init(struct l_genl_family *in)
|
|||||||
NULL, NULL))
|
NULL, NULL))
|
||||||
l_error("Registering for MLME notification failed");
|
l_error("Registering for MLME notification failed");
|
||||||
|
|
||||||
return true;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
void anqp_exit(void)
|
static void anqp_exit(void)
|
||||||
{
|
{
|
||||||
struct l_genl *genl = iwd_get_genl();
|
struct l_genl *genl = iwd_get_genl();
|
||||||
|
|
||||||
|
l_genl_family_free(nl80211);
|
||||||
nl80211 = NULL;
|
nl80211 = NULL;
|
||||||
|
|
||||||
l_queue_destroy(anqp_requests, anqp_destroy);
|
l_queue_destroy(anqp_requests, anqp_destroy);
|
||||||
@ -507,3 +508,6 @@ void anqp_exit(void)
|
|||||||
|
|
||||||
l_genl_remove_unicast_watch(genl, unicast_watch);
|
l_genl_remove_unicast_watch(genl, unicast_watch);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
IWD_MODULE(anqp, anqp_init, anqp_exit);
|
||||||
|
IWD_MODULE_DEPENDS(anqp, netdev);
|
||||||
|
@ -38,6 +38,3 @@ uint32_t anqp_request(uint32_t ifindex, const uint8_t *addr,
|
|||||||
struct scan_bss *bss, const uint8_t *anqp, size_t len,
|
struct scan_bss *bss, const uint8_t *anqp, size_t len,
|
||||||
anqp_response_func_t cb, void *user_data,
|
anqp_response_func_t cb, void *user_data,
|
||||||
anqp_destroy_func_t destroy);
|
anqp_destroy_func_t destroy);
|
||||||
|
|
||||||
bool anqp_init(struct l_genl_family *in);
|
|
||||||
void anqp_exit(void);
|
|
||||||
|
@ -155,7 +155,6 @@ static void nl80211_appeared(const struct l_genl_family_info *info,
|
|||||||
plugin_init(plugins, noplugins);
|
plugin_init(plugins, noplugins);
|
||||||
|
|
||||||
manager_init(nl80211, interfaces, nointerfaces);
|
manager_init(nl80211, interfaces, nointerfaces);
|
||||||
anqp_init(nl80211);
|
|
||||||
|
|
||||||
if (!wiphy_init(nl80211, phys, nophys))
|
if (!wiphy_init(nl80211, phys, nophys))
|
||||||
l_error("Unable to init wiphy functionality");
|
l_error("Unable to init wiphy functionality");
|
||||||
@ -492,7 +491,6 @@ int main(int argc, char *argv[])
|
|||||||
|
|
||||||
if (nl80211) {
|
if (nl80211) {
|
||||||
manager_exit();
|
manager_exit();
|
||||||
anqp_exit();
|
|
||||||
wiphy_exit();
|
wiphy_exit();
|
||||||
l_genl_family_free(nl80211);
|
l_genl_family_free(nl80211);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user