Wireless Daemon for Linux
 help / color / mirror / Atom feed
From: Andrew Zaborowski <balrogg@gmail.com>
To: iwd@lists.01.org
Subject: [PATCH 03/11] netdev: Extend checks for P2P scenarios
Date: Mon, 21 Oct 2019 15:55:02 +0200	[thread overview]
Message-ID: <20191021135510.12657-3-balrogg@gmail.com> (raw)
In-Reply-To: <20191021135510.12657-1-balrogg@gmail.com>

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

From: Andrew Zaborowski <andrew.zaborowski@intel.com>

Extend the iftype-based checks to handle the P2P iftypes and remove a
warning that may be triggered in normal situations in the P2P scenarios.
---
 src/netdev.c | 20 ++++++++++++++------
 1 file changed, 14 insertions(+), 6 deletions(-)

diff --git a/src/netdev.c b/src/netdev.c
index 23fd980d..d9357a22 100644
--- a/src/netdev.c
+++ b/src/netdev.c
@@ -1470,12 +1470,14 @@ void netdev_handshake_failed(struct handshake_state *hs, uint16_t reason_code)
 
 	switch (netdev->type) {
 	case NL80211_IFTYPE_STATION:
+	case NL80211_IFTYPE_P2P_CLIENT:
 		msg = netdev_build_cmd_disconnect(netdev, reason_code);
 		netdev->disconnect_cmd_id = l_genl_family_send(nl80211, msg,
 							netdev_disconnect_cb,
 							netdev, NULL);
 		break;
 	case NL80211_IFTYPE_AP:
+	case NL80211_IFTYPE_P2P_GO:
 		msg = netdev_build_cmd_del_station(netdev, nhs->super.spa,
 				reason_code, false);
 		if (!l_genl_family_send(nl80211, msg, NULL, NULL, NULL))
@@ -2465,7 +2467,8 @@ int netdev_connect(struct netdev *netdev, struct scan_bss *bss,
 	struct eapol_sm *sm = NULL;
 	bool is_rsn = hs->supplicant_ie != NULL;
 
-	if (netdev->type != NL80211_IFTYPE_STATION)
+	if (netdev->type != NL80211_IFTYPE_STATION &&
+			netdev->type != NL80211_IFTYPE_P2P_CLIENT)
 		return -ENOTSUP;
 
 	if (netdev->connected)
@@ -2521,7 +2524,8 @@ int netdev_connect_wsc(struct netdev *netdev, struct scan_bss *bss,
 	size_t ie_len;
 	struct eapol_sm *sm;
 
-	if (netdev->type != NL80211_IFTYPE_STATION)
+	if (netdev->type != NL80211_IFTYPE_STATION &&
+			netdev->type != NL80211_IFTYPE_P2P_CLIENT)
 		return -ENOTSUP;
 
 	if (netdev->connected)
@@ -2564,7 +2568,8 @@ int netdev_disconnect(struct netdev *netdev,
 {
 	struct l_genl_msg *disconnect;
 
-	if (netdev->type != NL80211_IFTYPE_STATION)
+	if (netdev->type != NL80211_IFTYPE_STATION &&
+			netdev->type != NL80211_IFTYPE_P2P_CLIENT)
 		return -ENOTSUP;
 
 	if (!netdev->connected)
@@ -3441,10 +3446,8 @@ static void netdev_mlme_notify(struct l_genl_msg *msg, void *user_data)
 		}
 	}
 
-	if (!netdev) {
-		l_warn("MLME notification is missing ifindex attribute");
+	if (!netdev)
 		return;
-	}
 
 	switch (cmd) {
 	case NL80211_CMD_AUTHENTICATE:
@@ -4395,6 +4398,11 @@ static void netdev_getlink_cb(int error, uint16_t type, const void *data,
 
 	netdev_newlink_notify(ifi, bytes);
 
+	/* Don't do anything automatically for P2P interfaces */
+	if (netdev->type == NL80211_IFTYPE_P2P_CLIENT ||
+			netdev->type == NL80211_IFTYPE_P2P_GO)
+		return;
+
 	/*
 	 * If the interface is UP, reset it to ensure a clean state.
 	 * Otherwise, if we need to set a random mac, do so.  If not, just
-- 
2.20.1

  parent reply	other threads:[~2019-10-21 13:55 UTC|newest]

Thread overview: 36+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-10-21 13:55 [PATCH 01/11] netdev: Add a wdev_id based frame watch API Andrew Zaborowski
2019-10-21 13:55 ` [PATCH 02/11] netdev: Report RSSI to frame watch callbacks Andrew Zaborowski
2019-10-22  3:34   ` Denis Kenzior
2019-10-22 13:46     ` Andrew Zaborowski
2019-10-21 13:55 ` Andrew Zaborowski [this message]
2019-10-22  3:36   ` [PATCH 03/11] netdev: Extend checks for P2P scenarios Denis Kenzior
2019-10-21 13:55 ` [PATCH 04/11] eapol: Move the EAP event handler to handshake state Andrew Zaborowski
2019-10-22  4:11   ` Denis Kenzior
2019-10-22 14:00     ` Andrew Zaborowski
2019-10-22 14:34       ` Denis Kenzior
2019-10-21 13:55 ` [PATCH 05/11] unit: Update test-wsc to use handshake_state_set_eap_event_func Andrew Zaborowski
2019-10-21 13:55 ` [PATCH 06/11] wsc: Replace netdev_connect_wsc with netdev_connect usage Andrew Zaborowski
2019-10-21 13:55 ` [PATCH 07/11] netdev: Drop unused netdev_connect_wsc Andrew Zaborowski
2019-10-21 13:55 ` [PATCH 08/11] wsc: Add wsc_new_p2p_enrollee, refactor Andrew Zaborowski
2019-10-22 14:47   ` Denis Kenzior
2019-10-22 23:46     ` Andrew Zaborowski
2019-10-21 13:55 ` [PATCH 09/11] wsc: Accept extra IEs in wsc_new_p2p_enrollee Andrew Zaborowski
2019-10-21 13:55 ` [PATCH 10/11] wiphy: Add wiphy_get_max_roc_duration Andrew Zaborowski
2019-10-22  3:26   ` Denis Kenzior
2019-10-21 13:55 ` [PATCH 11/11] wiphy: Add wiphy_get_supported_rates Andrew Zaborowski
2019-10-22 14:53 ` [PATCH 01/11] netdev: Add a wdev_id based frame watch API Denis Kenzior
2019-10-22 23:56   ` Andrew Zaborowski
2019-10-23  0:23     ` Denis Kenzior
2019-10-23  1:04       ` Andrew Zaborowski
2019-10-23  1:32         ` Denis Kenzior
2019-10-24  0:59           ` Andrew Zaborowski
2019-10-24  2:53             ` Denis Kenzior
2019-10-24  3:22               ` Andrew Zaborowski
2019-10-24 15:29                 ` Denis Kenzior
2019-10-24 21:47                   ` Andrew Zaborowski
2019-10-24 22:16                     ` Denis Kenzior
2019-10-24 22:45                       ` Andrew Zaborowski
2019-10-25  1:27                         ` Denis Kenzior
2019-10-25  2:59                           ` Andrew Zaborowski
2019-10-25  3:56                             ` Denis Kenzior
2019-10-25  4:42                               ` 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=20191021135510.12657-3-balrogg@gmail.com \
    --to=balrogg@gmail.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