Wireless Daemon for Linux
 help / color / mirror / Atom feed
From: James Prestwood <prestwoj@gmail.com>
To: iwd@lists.01.org
Subject: [PATCH v2 07/12] wiphy: remove white/blacklist from wiphy_init
Date: Fri, 11 Oct 2019 12:29:28 -0700	[thread overview]
Message-ID: <20191011192933.13550-7-prestwoj@gmail.com> (raw)
In-Reply-To: <20191011192933.13550-1-prestwoj@gmail.com>

[-- Attachment #1: Type: text/plain, Size: 2451 bytes --]

wiphy will now use getters for the phy white/black list.
---
 src/iwd.h   |  3 +++
 src/main.c  | 12 +++++++++++-
 src/wiphy.c |  5 +++--
 src/wiphy.h |  3 +--
 4 files changed, 18 insertions(+), 5 deletions(-)

diff --git a/src/iwd.h b/src/iwd.h
index 8814c244..6073fae5 100644
--- a/src/iwd.h
+++ b/src/iwd.h
@@ -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);
diff --git a/src/main.c b/src/main.c
index 761d869e..50a1499d 100644
--- a/src/main.c
+++ b/src/main.c
@@ -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");
 }
 
diff --git a/src/wiphy.c b/src/wiphy.c
index b672afd4..3316a084 100644
--- a/src/wiphy.c
+++ b/src/wiphy.c
@@ -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;
diff --git a/src/wiphy.h b/src/wiphy.h
index 10cf5373..ac94585f 100644
--- a/src/wiphy.h
+++ b/src/wiphy.h
@@ -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);
-- 
2.17.1

  parent reply	other threads:[~2019-10-11 19:29 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-10-11 19:29 [PATCH v2 01/12] main: move module init into nl80211_appeared James Prestwood
2019-10-11 19:29 ` [PATCH v2 02/12] netdev: utilize IWD_MODULE James Prestwood
2019-10-11 19:29 ` [PATCH v2 03/12] eapol: " James Prestwood
2019-10-11 19:29 ` [PATCH v2 04/12] anqp: " James Prestwood
2019-10-11 19:29 ` [PATCH v2 05/12] manager: remove white/black list from argument James Prestwood
2019-10-11 19:29 ` [PATCH v2 06/12] manager: utilize IWD_MODULE James Prestwood
2019-10-11 19:29 ` James Prestwood [this message]
2019-10-11 19:29 ` [PATCH v2 08/12] wiphy: " James Prestwood
2019-10-11 19:29 ` [PATCH v2 09/12] eap: remove mtu argument from eap_init James Prestwood
2019-10-11 19:29 ` [PATCH v2 10/12] wired: update with new eap_init James Prestwood
2019-10-11 19:29 ` [PATCH v2 11/12] unit: update wsc/eapol " James Prestwood
2019-10-11 19:29 ` [PATCH v2 12/12] eap: utilize IWD_MODULE James Prestwood
2019-10-11 20:49 ` [PATCH v2 01/12] main: move module init into nl80211_appeared Denis Kenzior

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20191011192933.13550-7-prestwoj@gmail.com \
    --to=prestwoj@gmail.com \
    --cc=iwd@lists.01.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox