All of lore.kernel.org
 help / color / mirror / Atom feed
From: Andrew Zaborowski <andrew.zaborowski@intel.com>
To: iwd@lists.01.org
Subject: [PATCH 2/4] rrm: Switch to new frame watch API
Date: Thu, 16 Jan 2020 03:40:58 +0100	[thread overview]
Message-ID: <20200116024100.18371-2-andrew.zaborowski@intel.com> (raw)
In-Reply-To: <20200116024100.18371-1-andrew.zaborowski@intel.com>

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

---
 src/rrm.c | 16 +++++++++++-----
 1 file changed, 11 insertions(+), 5 deletions(-)

diff --git a/src/rrm.c b/src/rrm.c
index a117dce3..64d4afd3 100644
--- a/src/rrm.c
+++ b/src/rrm.c
@@ -39,6 +39,7 @@
 #include "src/scan.h"
 #include "src/nl80211util.h"
 #include "src/wiphy.h"
+#include "src/frame-xchg.h"
 
 #include "linux/nl80211.h"
 
@@ -658,10 +659,9 @@ static void rrm_station_watch_cb(enum station_state state, void *userdata)
 	}
 }
 
-static void rrm_frame_watch_cb(struct netdev *netdev,
-				const struct mmpdu_header *mpdu,
+static void rrm_frame_watch_cb(const struct mmpdu_header *mpdu,
 				const void *body, size_t body_len,
-				void *user_data)
+				int rssi, void *user_data)
 {
 	struct rrm_state *rrm = user_data;
 	const uint8_t *request = body;
@@ -769,8 +769,8 @@ static void rrm_new_state(struct netdev *netdev)
 	rrm->ifindex = netdev_get_ifindex(netdev);
 	rrm->wdev_id = netdev_get_wdev_id(netdev);
 
-	netdev_frame_watch_add(netdev, frame_type, prefix, sizeof(prefix),
-					rrm_frame_watch_cb, rrm);
+	frame_watch_add(rrm->wdev_id, 0, frame_type, prefix, sizeof(prefix),
+					rrm_frame_watch_cb, rrm, NULL);
 
 	l_queue_push_head(states, rrm);
 }
@@ -794,6 +794,12 @@ static void rrm_netdev_watch(struct netdev *netdev,
 		rrm_new_state(netdev);
 		return;
 	case NETDEV_WATCH_EVENT_DEL:
+		/*
+		 * We're triggered on L80211_CMD_DEL_INTERFACE and RTM_DELLINK which
+		 * also cause all frame watches to be unregistered so we don't have
+		 * to do this here.
+		 */
+
 		rrm = l_queue_remove_if(states, match_ifindex,
 						L_UINT_TO_PTR(ifindex));
 		if (rrm) {
-- 
2.20.1

  reply	other threads:[~2020-01-16  2:40 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-01-16  2:40 [PATCH 1/4] device: Switch to new frame watch API Andrew Zaborowski
2020-01-16  2:40 ` Andrew Zaborowski [this message]
2020-01-16 17:39   ` [PATCH 2/4] rrm: " Denis Kenzior
2020-01-16  2:40 ` [PATCH 3/4] netdev: " Andrew Zaborowski
2020-01-16  2:41 ` [PATCH 4/4] netdev: Drop the netdev_frame_watch API Andrew Zaborowski

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=20200116024100.18371-2-andrew.zaborowski@intel.com \
    --to=andrew.zaborowski@intel.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 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.