All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/4] device: Switch to new frame watch API
@ 2020-01-16  2:40 Andrew Zaborowski
  2020-01-16  2:40 ` [PATCH 2/4] rrm: " Andrew Zaborowski
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: Andrew Zaborowski @ 2020-01-16  2:40 UTC (permalink / raw)
  To: iwd

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

---
 src/device.c | 21 +++++++++++++--------
 1 file changed, 13 insertions(+), 8 deletions(-)

diff --git a/src/device.c b/src/device.c
index 0ad1ccbf..c24d7ed1 100644
--- a/src/device.c
+++ b/src/device.c
@@ -37,6 +37,7 @@
 #include "src/scan.h"
 #include "src/netdev.h"
 #include "src/dbus.h"
+#include "src/frame-xchg.h"
 #include "src/station.h"
 
 struct device {
@@ -48,16 +49,13 @@ struct device {
 	bool powered : 1;		/* Current IFUP state */
 	bool dbus_powered : 1;		/* Last IFUP state wanted via D-Bus */
 
-	uint32_t ap_roam_watch;
 	uint32_t wiphy_rfkill_watch;
 };
 
 static uint32_t netdev_watch;
 
-static void device_ap_roam_frame_event(struct netdev *netdev,
-		const struct mmpdu_header *hdr,
-		const void *body, size_t body_len,
-		void *user_data)
+static void device_ap_roam_frame_event(const struct mmpdu_header *hdr,
+		const void *body, size_t body_len, int rssi, void *user_data)
 {
 	struct device *device = user_data;
 	struct station *station = station_find(device->index);
@@ -325,9 +323,9 @@ static struct device *device_create(struct wiphy *wiphy, struct netdev *netdev)
 	/*
 	 * register for AP roam transition watch
 	 */
-	device->ap_roam_watch = netdev_frame_watch_add(netdev, 0x00d0,
+	frame_watch_add(netdev_get_wdev_id(netdev), 0, 0x00d0,
 			action_ap_roam_prefix, sizeof(action_ap_roam_prefix),
-			device_ap_roam_frame_event, device);
+			device_ap_roam_frame_event, device, NULL);
 
 	device->powered = netdev_get_is_up(netdev);
 
@@ -343,9 +341,16 @@ static void device_free(struct device *device)
 {
 	l_debug("");
 
-	netdev_frame_watch_remove(device->netdev, device->ap_roam_watch);
 	wiphy_state_watch_remove(device->wiphy, device->wiphy_rfkill_watch);
 
+	/*
+	 * We're triggered on NETDEV_WATCH_EVENT_DEL or device_exit.  The former
+	 * is triggered on NL80211_CMD_DEL_INTERFACE and RTM_DELLINK which
+	 * also cause all frame watches to be unregistered so we don't have
+	 * to do this here.  device_exit is triggered under the same conditions
+	 * as frame_xchg_exit.
+	 */
+
 	l_free(device);
 }
 
-- 
2.20.1

^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2020-01-16 17:39 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-01-16  2:40 [PATCH 1/4] device: Switch to new frame watch API Andrew Zaborowski
2020-01-16  2:40 ` [PATCH 2/4] rrm: " Andrew Zaborowski
2020-01-16 17:39   ` 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

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.