wiphy: remove white/blacklist from wiphy_init

wiphy will now use getters for the phy white/black list.
This commit is contained in:
James Prestwood 2019-10-11 12:29:28 -07:00 committed by Denis Kenzior
parent cc2d4f97e2
commit 97bac236c8
4 changed files with 18 additions and 5 deletions

View File

@ -33,6 +33,9 @@ void netdev_shutdown(void);
const char *iwd_get_iface_whitelist(void);
const char *iwd_get_iface_blacklist(void);
const char *iwd_get_phy_whitelist(void);
const char *iwd_get_phy_blacklist(void);
struct iwd_module_desc {
const char *name;
int (*init)(void);

View File

@ -112,6 +112,16 @@ const char *iwd_get_iface_blacklist(void)
return nointerfaces;
}
const char *iwd_get_phy_whitelist(void)
{
return phys;
}
const char *iwd_get_phy_blacklist(void)
{
return nophys;
}
static void usage(void)
{
printf("iwd - Wireless daemon\n"
@ -164,7 +174,7 @@ static void nl80211_appeared(const struct l_genl_family_info *info,
plugin_init(plugins, noplugins);
if (!wiphy_init(nl80211, phys, nophys))
if (!wiphy_init(nl80211))
l_error("Unable to init wiphy functionality");
}

View File

@ -1150,12 +1150,13 @@ static void setup_wiphy_interface(struct l_dbus_interface *interface)
NULL);
}
bool wiphy_init(struct l_genl_family *in, const char *whitelist,
const char *blacklist)
bool wiphy_init(struct l_genl_family *in)
{
const struct l_settings *config = iwd_get_config();
const char *s = l_settings_get_value(config, "General",
"mac_randomize_bytes");
const char *whitelist = iwd_get_phy_whitelist();
const char *blacklist = iwd_get_phy_blacklist();
if (s && !strcmp(s, "nic"))
mac_randomize_bytes = 3;

View File

@ -82,6 +82,5 @@ uint32_t wiphy_state_watch_add(struct wiphy *wiphy,
wiphy_destroy_func_t destroy);
bool wiphy_state_watch_remove(struct wiphy *wiphy, uint32_t id);
bool wiphy_init(struct l_genl_family *in, const char *whitelist,
const char *blacklist);
bool wiphy_init(struct l_genl_family *in);
bool wiphy_exit(void);