Skip to contentSkip to conversation

iwd can start in AP mode

PATCH salahaldeen.altous at leica-camera.com 2 participants 2 messages Nov 8, 2021 – Nov 11, 2021

lore
Share & tools
lore

salahaldeen.altous at leica-camera.com

#0 lore raw
Quoted 1 line

From e8357b81a20f44d3473f652ef233b6598f72273f Mon Sep 17 00:00:00 2001

From: Salahaldeen Altous <salahaldeen.altous(a)leica-camera.com>
Date: Mon, 8 Nov 2021 05:16:26 +0100
Subject: [PATCH] iwd can start in AP mode

By default iwd starts in station mode. This can be changed by setting the Mode parameter to ap in the main.conf General section. Example [General]
Mode=ap

---
 src/manager.c | 7 +++++++
 1 file changed, 7 insertions(+)
src/manager.c +7 -0
index 558b71b0..a1078713 100644
@@ -197,6 +197,8 @@ static void manager_create_interfaces(struct wiphy_setup_state *state)
 	char ifname[10];
 	uint32_t iftype;
 	unsigned cmd_id;
+	const char *mode_str;
+	const struct l_settings *config = iwd_get_config();
 
 	if (state->aborted)
 		return;
@@ -223,6 +225,11 @@ static void manager_create_interfaces(struct wiphy_setup_state *state)
 	snprintf(ifname, sizeof(ifname), "wlan%i", (int) state->id);
 	l_debug("creating %s", ifname);
 	iftype = NL80211_IFTYPE_STATION;
+	mode_str = l_settings_get_value(config, "General", "Mode");
+	if (mode_str) {
+		if (!strcmp(mode_str, "ap"))
+			iftype = NL80211_IFTYPE_AP;
+	}
 
 	msg = l_genl_msg_new(NL80211_CMD_NEW_INTERFACE);
 	l_genl_msg_append_attr(msg, NL80211_ATTR_WIPHY, 4, &state->id);
Signature · 1 line
2.25.1
#1 lore raw

Hi Salahaldeen,

Quoted 9 lines · salahaldeen.altous(a)leica-camera.com

From e8357b81a20f44d3473f652ef233b6598f72273f Mon Sep 17 00:00:00 2001
From: Salahaldeen Altous <salahaldeen.altous(a)leica-camera.com>
Date: Mon, 8 Nov 2021 05:16:26 +0100
Subject: [PATCH] iwd can start in AP mode

By default iwd starts in station mode. This can be changed by setting the Mode parameter to ap in the main.conf General section. Example [General]
Mode=ap

So does Mode=ap imply that we should only create AP interfaces, or does that imply AP + p2p? Looks like the current implementation would still try and create p2p interfaces as well.

Perhaps we should name this ap+p2p for now until we implement other combinations? Also, could you add a quick description of this setting in src/iwd.config.rst?

Quoted 4 lines
---
  src/manager.c | 7 +++++++
  1 file changed, 7 insertions(+)

Regards,
-Denis