All of lore.kernel.org
 help / color / mirror / Atom feed
* iwd can start in AP mode
@ 2021-11-08  4:35 salahaldeen.altous
  0 siblings, 0 replies; 2+ messages in thread
From: salahaldeen.altous @ 2021-11-08  4:35 UTC (permalink / raw)
  To: iwd

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

>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(+)

diff --git a/src/manager.c b/src/manager.c
index 558b71b0..a1078713 100644
--- a/src/manager.c
+++ b/src/manager.c
@@ -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);
-- 
2.25.1

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

* Re: iwd can start in AP mode
@ 2021-11-11 20:43 Denis Kenzior
  0 siblings, 0 replies; 2+ messages in thread
From: Denis Kenzior @ 2021-11-11 20:43 UTC (permalink / raw)
  To: iwd

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

Hi Salahaldeen,

On 11/7/21 10:35 PM, salahaldeen.altous(a)leica-camera.com wrote:
>  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?

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

Regards,
-Denis

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

end of thread, other threads:[~2021-11-11 20:43 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-11-08  4:35 iwd can start in AP mode salahaldeen.altous
2021-11-11 20:43 Denis Kenzior

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.