Wireless Daemon for Linux
 help / color / mirror / Atom feed
From: Tim Kourt <tim.a.kourt@linux.intel.com>
To: iwd@lists.01.org
Subject: [PATCH v2 3/3] station: Subscribe to netconfig event notifier
Date: Wed, 09 Oct 2019 14:53:33 -0700	[thread overview]
Message-ID: <20191009215333.14547-3-tim.a.kourt@linux.intel.com> (raw)
In-Reply-To: <20191009215333.14547-1-tim.a.kourt@linux.intel.com>

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

---
 src/station.c | 20 +++++++++++++++++++-
 1 file changed, 19 insertions(+), 1 deletion(-)

diff --git a/src/station.c b/src/station.c
index af209ebb..9b31cd20 100644
--- a/src/station.c
+++ b/src/station.c
@@ -1314,6 +1314,22 @@ static void station_roam_failed(struct station *station)
 		station_roam_timeout_rearm(station, 60);
 }
 
+static void station_netconfig_event_handler(enum netconfig_event event,
+							void *user_data)
+{
+	struct station *station = user_data;
+
+	switch (event) {
+	case NETCONFIG_EVENT_CONNECTED:
+		station_enter_state(station, STATION_STATE_CONNECTED);
+
+		break;
+	default:
+		l_error("station: Unsupported netconfig event: %d.", event);
+		break;
+	}
+}
+
 static void station_reassociate_cb(struct netdev *netdev,
 					enum netdev_result result,
 					void *event_data,
@@ -2271,7 +2287,9 @@ static void station_connect_cb(struct netdev *netdev, enum netdev_result result,
 		netconfig_configure(station->netconfig,
 					network_get_settings(
 						station->connected_network),
-					netdev_get_address(station->netdev));
+					netdev_get_address(station->netdev),
+					station_netconfig_event_handler,
+					station);
 	else
 		station_enter_state(station, STATION_STATE_CONNECTED);
 }
-- 
2.13.6

  parent reply	other threads:[~2019-10-09 21:53 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-10-09 21:53 [PATCH v2 1/3] station: Move 'connected' logic out of enter state func Tim Kourt
2019-10-09 21:53 ` [PATCH v2 2/3] netconfig: Add netconfig event notifier Tim Kourt
2019-10-09 22:52   ` Denis Kenzior
2019-10-09 21:53 ` Tim Kourt [this message]
2019-10-09 22:06 ` [PATCH v2 1/3] station: Move 'connected' logic out of enter state func 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=20191009215333.14547-3-tim.a.kourt@linux.intel.com \
    --to=tim.a.kourt@linux.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox