From: pat-lkml <pat-lkml@erley.org>
To: linux-wireless <linux-wireless@vger.kernel.org>
Subject: [PATCH] iw: rename nl_handle to nl_sock for libnl-2.0
Date: Wed, 28 Jan 2009 18:10:04 -0500 [thread overview]
Message-ID: <4980E5CC.9040607@erley.org> (raw)
Upstream has renamed nl_handle to nl_sock. Update iw to the new names
and add #define for libnl-1.1.
Signed-off-by: Pat Erley <pat-lkml@erley.org>
---
In the future, should I keep pushing these sorts of patches, or should
we back them out and wait for a 'release' of libnl-2.0 and push them all
in then?
diff --git a/crda.c b/crda.c
index afc5df1..f2c471f 100644
--- a/crda.c
+++ b/crda.c
@@ -43,10 +43,11 @@ static inline int __genl_ctrl_alloc_cache(struct
nl_handle *h, struct nl_cache *
}
#define genl_ctrl_alloc_cache __genl_ctrl_alloc_cache
+#define nl_sock nl_handle
#endif /* CONFIG_LIBNL20 */
struct nl80211_state {
- struct nl_handle *nl_handle;
+ struct nl_sock *nl_sock;
struct nl_cache *nl_cache;
struct genl_family *nl80211;
};
@@ -55,22 +56,22 @@ static int nl80211_init(struct nl80211_state *state)
{
int err;
- state->nl_handle = nl_socket_alloc();
- if (!state->nl_handle) {
- fprintf(stderr, "Failed to allocate netlink handle.\n");
+ state->nl_sock = nl_socket_alloc();
+ if (!state->nl_sock) {
+ fprintf(stderr, "Failed to allocate netlink sock.\n");
return -ENOMEM;
}
- if (genl_connect(state->nl_handle)) {
+ if (genl_connect(state->nl_sock)) {
fprintf(stderr, "Failed to connect to generic netlink.\n");
err = -ENOLINK;
- goto out_handle_destroy;
+ goto out_sock_destroy;
}
- if (genl_ctrl_alloc_cache(state->nl_handle, &state->nl_cache)) {
+ if (genl_ctrl_alloc_cache(state->nl_sock, &state->nl_cache)) {
fprintf(stderr, "Failed to allocate generic netlink cache.\n");
err = -ENOMEM;
- goto out_handle_destroy;
+ goto out_sock_destroy;
}
state->nl80211 = genl_ctrl_search_by_name(state->nl_cache, "nl80211");
@@ -84,8 +85,8 @@ static int nl80211_init(struct nl80211_state *state)
out_cache_free:
nl_cache_free(state->nl_cache);
- out_handle_destroy:
- nl_socket_free(state->nl_handle);
+ out_sock_destroy:
+ nl_socket_free(state->nl_sock);
return err;
}
@@ -93,7 +94,7 @@ static void nl80211_cleanup(struct nl80211_state *state)
{
genl_family_put(state->nl80211);
nl_cache_free(state->nl_cache);
- nl_socket_free(state->nl_handle);
+ nl_socket_free(state->nl_sock);
}
static int reg_handler(struct nl_msg __attribute__((unused)) *msg,
@@ -294,7 +295,7 @@ int main(int argc, char **argv)
if (!cb)
goto cb_out;
- r = nl_send_auto_complete(nlstate.nl_handle, msg);
+ r = nl_send_auto_complete(nlstate.nl_sock, msg);
if (r < 0) {
fprintf(stderr, "Failed to send regulatory request: %d\n", r);
@@ -306,7 +307,7 @@ int main(int argc, char **argv)
nl_cb_err(cb, NL_CB_CUSTOM, error_handler, NULL);
if (!finished) {
- r = nl_wait_for_ack(nlstate.nl_handle);
+ r = nl_wait_for_ack(nlstate.nl_sock);
if (r < 0) {
fprintf(stderr, "Failed to set regulatory domain: "
"%d\n", r);
next reply other threads:[~2009-01-28 23:10 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-01-28 23:10 pat-lkml [this message]
2009-01-28 23:11 ` [PATCH] iw: rename nl_handle to nl_sock for libnl-2.0 pat-lkml
-- strict thread matches above, loose matches on Subject: below --
2009-01-28 23:11 pat-lkml
2009-01-29 0:04 ` Johannes Berg
2009-01-29 0:15 ` pat-lkml
2009-01-29 0:18 ` pat-lkml
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=4980E5CC.9040607@erley.org \
--to=pat-lkml@erley.org \
--cc=linux-wireless@vger.kernel.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.