Wireless Daemon for Linux
 help / color / mirror / Atom feed
From: James Prestwood <prestwoj@gmail.com>
To: iwd@lists.linux.dev
Cc: James Prestwood <prestwoj@gmail.com>
Subject: [PATCH 2/4] wiphy: remove nl80211 from wiphy object
Date: Wed,  7 Sep 2022 16:31:59 -0700	[thread overview]
Message-ID: <20220907233201.227577-2-prestwoj@gmail.com> (raw)
In-Reply-To: <20220907233201.227577-1-prestwoj@gmail.com>

The nl80211 object is already a global and there is no need
to track this in wiphy itself.
---
 src/wiphy.c | 8 ++------
 1 file changed, 2 insertions(+), 6 deletions(-)

diff --git a/src/wiphy.c b/src/wiphy.c
index 28d4b66e..f295d87d 100644
--- a/src/wiphy.c
+++ b/src/wiphy.c
@@ -118,7 +118,6 @@ struct wiphy {
 	uint8_t extended_capabilities[EXT_CAP_LEN + 2]; /* max bitmap size + IE header */
 	uint8_t *iftype_extended_capabilities[NUM_NL80211_IFTYPES];
 	uint8_t rm_enabled_capabilities[7]; /* 5 size max + header */
-	struct l_genl_family *nl80211;
 	char regdom_country[2];
 	/* Work queue for this radio */
 	struct l_queue *work;
@@ -375,7 +374,6 @@ static void wiphy_free(void *data)
 	l_free(wiphy->model_str);
 	l_free(wiphy->vendor_str);
 	l_free(wiphy->driver_str);
-	l_genl_family_free(wiphy->nl80211);
 	l_queue_destroy(wiphy->work, destroy_work);
 	l_free(wiphy);
 }
@@ -1756,11 +1754,9 @@ static void wiphy_register(struct wiphy *wiphy)
 struct wiphy *wiphy_create(uint32_t wiphy_id, const char *name)
 {
 	struct wiphy *wiphy;
-	struct l_genl *genl = iwd_get_genl();
 
 	wiphy = wiphy_new(wiphy_id);
 	l_strlcpy(wiphy->name, name, sizeof(wiphy->name));
-	wiphy->nl80211 = l_genl_family_new(genl, NL80211_GENL_NAME);
 	l_queue_push_head(wiphy_list, wiphy);
 
 	if (!wiphy_is_managed(name))
@@ -2099,8 +2095,8 @@ static void wiphy_get_reg_domain(struct wiphy *wiphy)
 	msg = l_genl_msg_new(NL80211_CMD_GET_REG);
 	l_genl_msg_append_attr(msg, NL80211_ATTR_WIPHY, 4, &wiphy->id);
 
-	wiphy->get_reg_id = l_genl_family_send(wiphy->nl80211, msg,
-						wiphy_get_reg_cb, wiphy, NULL);
+	wiphy->get_reg_id = l_genl_family_send(nl80211, msg, wiphy_get_reg_cb,
+						wiphy, NULL);
 	if (!wiphy->get_reg_id) {
 		l_error("Error sending NL80211_CMD_GET_REG for %s", wiphy->name);
 		l_genl_msg_unref(msg);
-- 
2.34.3


  reply	other threads:[~2022-09-07 23:32 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-09-07 23:31 [PATCH 1/4] doc: document [General].Country main.conf option James Prestwood
2022-09-07 23:31 ` James Prestwood [this message]
2022-09-08 14:53   ` [PATCH 2/4] wiphy: remove nl80211 from wiphy object Denis Kenzior
2022-09-07 23:32 ` [PATCH 3/4] wiphy: only do global GET_REG once James Prestwood
2022-09-08 15:55   ` Denis Kenzior
2022-09-07 23:32 ` [PATCH 4/4] wiphy: support country code override James Prestwood
2022-09-08 16:00   ` 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=20220907233201.227577-2-prestwoj@gmail.com \
    --to=prestwoj@gmail.com \
    --cc=iwd@lists.linux.dev \
    /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