Buildroot Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [PATCH 0/4] hostapd: new configuration options
@ 2017-12-23 19:06 Alexander Mukhin
  2017-12-23 19:06 ` [Buildroot] [PATCH 1/4] hostapd: select VLAN support Alexander Mukhin
                   ` (4 more replies)
  0 siblings, 5 replies; 19+ messages in thread
From: Alexander Mukhin @ 2017-12-23 19:06 UTC (permalink / raw)
  To: buildroot

Below is the list of patches for hostapd to give user more control
on which options to include in the build. As a byproduct, we can drop
dependencies on netlink and threads if the options selected
do not require them.

Alexander Mukhin (4):
  hostapd: select VLAN support
  hostapd: select driver support
  hostapd: make ACS dependent on nl80211
  hostapd: drop default netlink dependency

 package/hostapd/Config.in  | 58 ++++++++++++++++++++++++++++++++++++++++++----
 package/hostapd/hostapd.mk | 51 ++++++++++++++++++++++++++++++----------
 2 files changed, 92 insertions(+), 17 deletions(-)

-- 
2.11.0

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

* [Buildroot] [PATCH 1/4] hostapd: select VLAN support
  2017-12-23 19:06 [Buildroot] [PATCH 0/4] hostapd: new configuration options Alexander Mukhin
@ 2017-12-23 19:06 ` Alexander Mukhin
  2017-12-29 21:32   ` Thomas Petazzoni
  2017-12-23 19:06 ` [Buildroot] [PATCH 2/4] hostapd: select driver support Alexander Mukhin
                   ` (3 subsequent siblings)
  4 siblings, 1 reply; 19+ messages in thread
From: Alexander Mukhin @ 2017-12-23 19:06 UTC (permalink / raw)
  To: buildroot

Add configuration options for hostapd to select which kind
of VLAN support to build.

Signed-off-by: Alexander Mukhin <alexander.i.mukhin@gmail.com>
---
 package/hostapd/Config.in  | 23 +++++++++++++++++++++++
 package/hostapd/hostapd.mk | 16 +++++++++++++---
 2 files changed, 36 insertions(+), 3 deletions(-)

diff --git a/package/hostapd/Config.in b/package/hostapd/Config.in
index 40c7015e73..84156e8f11 100644
--- a/package/hostapd/Config.in
+++ b/package/hostapd/Config.in
@@ -43,6 +43,29 @@ config BR2_PACKAGE_HOSTAPD_WPS
 	help
 	  Enable support for Wi-Fi Protected Setup.
 
+config BR2_PACKAGE_HOSTAPD_VLAN
+	bool "Enable VLAN support"
+	default y
+	help
+	  Enable support for VLANs.
+
+config BR2_PACKAGE_HOSTAPD_VLAN_DYNAMIC
+	bool "Enable dynamic VLAN support"
+	default y
+	depends on BR2_PACKAGE_HOSTAPD_VLAN
+	help
+	  Enable support for fully dynamic VLANs.
+	  This enables hostapd to automatically create
+	  bridge and VLAN interfaces if necessary.
+
+config BR2_PACKAGE_HOSTAPD_VLAN_NETLINK
+	bool "Use netlink-based API for VLAN operations"
+	default y
+	depends on BR2_PACKAGE_HOSTAPD_VLAN
+	help
+	  Use netlink-based kernel API for VLAN operations
+	  instead of ioctl().
+
 endif
 
 comment "hostapd needs a toolchain w/ threads"
diff --git a/package/hostapd/hostapd.mk b/package/hostapd/hostapd.mk
index 0ed1631421..04ffa35758 100644
--- a/package/hostapd/hostapd.mk
+++ b/package/hostapd/hostapd.mk
@@ -18,15 +18,13 @@ HOSTAPD_LICENSE_FILES = README
 HOSTAPD_CONFIG_SET =
 
 HOSTAPD_CONFIG_ENABLE = \
-	CONFIG_FULL_DYNAMIC_VLAN \
 	CONFIG_HS20 \
 	CONFIG_IEEE80211AC \
 	CONFIG_IEEE80211N \
 	CONFIG_IEEE80211R \
 	CONFIG_INTERNAL_LIBTOMMATH \
 	CONFIG_INTERWORKING \
-	CONFIG_LIBNL32 \
-	CONFIG_VLAN_NETLINK
+	CONFIG_LIBNL32
 
 HOSTAPD_CONFIG_DISABLE =
 
@@ -74,6 +72,18 @@ ifeq ($(BR2_PACKAGE_HOSTAPD_WPS),y)
 HOSTAPD_CONFIG_ENABLE += CONFIG_WPS
 endif
 
+ifneq ($(BR2_PACKAGE_HOSTAPD_VLAN),y)
+HOSTAPD_CONFIG_ENABLE += CONFIG_NO_VLAN
+endif
+
+ifeq ($(BR2_PACKAGE_HOSTAPD_VLAN_DYNAMIC),y)
+HOSTAPD_CONFIG_ENABLE += CONFIG_FULL_DYNAMIC_VLAN
+endif
+
+ifeq ($(BR2_PACKAGE_HOSTAPD_VLAN_NETLINK),y)
+HOSTAPD_CONFIG_ENABLE += CONFIG_VLAN_NETLINK
+endif
+
 define HOSTAPD_CONFIGURE_CMDS
 	cp $(@D)/hostapd/defconfig $(HOSTAPD_CONFIG)
 	sed -i $(patsubst %,-e 's/^#\(%\)/\1/',$(HOSTAPD_CONFIG_ENABLE)) \
-- 
2.11.0

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

* [Buildroot] [PATCH 2/4] hostapd: select driver support
  2017-12-23 19:06 [Buildroot] [PATCH 0/4] hostapd: new configuration options Alexander Mukhin
  2017-12-23 19:06 ` [Buildroot] [PATCH 1/4] hostapd: select VLAN support Alexander Mukhin
@ 2017-12-23 19:06 ` Alexander Mukhin
  2017-12-24 20:49   ` Sergey Matyukevich
  2017-12-29 21:36   ` [Buildroot] [PATCH 2/4] hostapd: select driver support Thomas Petazzoni
  2017-12-23 19:06 ` [Buildroot] [PATCH 3/4] hostapd: make ACS dependent on nl80211 Alexander Mukhin
                   ` (2 subsequent siblings)
  4 siblings, 2 replies; 19+ messages in thread
From: Alexander Mukhin @ 2017-12-23 19:06 UTC (permalink / raw)
  To: buildroot

Add configuration options for hostapd to select which
drivers to build.

Signed-off-by: Alexander Mukhin <alexander.i.mukhin@gmail.com>
---
 package/hostapd/Config.in  | 17 +++++++++++++++++
 package/hostapd/hostapd.mk |  8 ++++++++
 2 files changed, 25 insertions(+)

diff --git a/package/hostapd/Config.in b/package/hostapd/Config.in
index 84156e8f11..509797a44a 100644
--- a/package/hostapd/Config.in
+++ b/package/hostapd/Config.in
@@ -14,11 +14,28 @@ config BR2_PACKAGE_HOSTAPD
 
 if BR2_PACKAGE_HOSTAPD
 
+config BR2_PACKAGE_HOSTAPD_DRIVER_HOSTAP
+	bool "Enable hostap driver"
+	default y
+	help
+	  Enable support for Host AP driver.
+
+config BR2_PACKAGE_HOSTAPD_DRIVER_NL80211
+	bool "Enable nl80211 driver"
+	default y
+	help
+	  Enable support for drivers using the nl80211 kernel interface.
+
 config BR2_PACKAGE_HOSTAPD_DRIVER_RTW
 	bool "Enable rtl871xdrv driver"
 	help
 	  Enable support for Realtek wireless chips.
 
+comment "at least one driver must be selected"
+	depends on !BR2_PACKAGE_HOSTAPD_DRIVER_HOSTAP
+	depends on !BR2_PACKAGE_HOSTAPD_DRIVER_NL80211
+	depends on !BR2_PACKAGE_HOSTAPD_DRIVER_RTW
+
 config BR2_PACKAGE_HOSTAPD_ACS
 	bool "Enable ACS"
 	default y
diff --git a/package/hostapd/hostapd.mk b/package/hostapd/hostapd.mk
index 04ffa35758..143efe9627 100644
--- a/package/hostapd/hostapd.mk
+++ b/package/hostapd/hostapd.mk
@@ -45,6 +45,14 @@ HOSTAPD_CONFIG_DISABLE += CONFIG_EAP_PWD
 HOSTAPD_CONFIG_EDITS += 's/\#\(CONFIG_TLS=\).*/\1internal/'
 endif
 
+ifneq ($(BR2_PACKAGE_HOSTAPD_DRIVER_HOSTAP),y)
+HOSTAPD_CONFIG_DISABLE += CONFIG_DRIVER_HOSTAP
+endif
+
+ifneq ($(BR2_PACKAGE_HOSTAPD_DRIVER_NL80211),y)
+HOSTAPD_CONFIG_DISABLE += CONFIG_DRIVER_NL80211
+endif
+
 ifeq ($(BR2_PACKAGE_HOSTAPD_DRIVER_RTW),y)
 HOSTAPD_PATCH += https://github.com/pritambaral/hostapd-rtl871xdrv/raw/master/rtlxdrv.patch
 HOSTAPD_CONFIG_SET += CONFIG_DRIVER_RTW
-- 
2.11.0

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

* [Buildroot] [PATCH 3/4] hostapd: make ACS dependent on nl80211
  2017-12-23 19:06 [Buildroot] [PATCH 0/4] hostapd: new configuration options Alexander Mukhin
  2017-12-23 19:06 ` [Buildroot] [PATCH 1/4] hostapd: select VLAN support Alexander Mukhin
  2017-12-23 19:06 ` [Buildroot] [PATCH 2/4] hostapd: select driver support Alexander Mukhin
@ 2017-12-23 19:06 ` Alexander Mukhin
  2017-12-29 21:37   ` Thomas Petazzoni
  2017-12-23 19:06 ` [Buildroot] [PATCH 4/4] hostapd: drop default netlink dependency Alexander Mukhin
  2017-12-24 20:51 ` [Buildroot] [PATCH 0/4] hostapd: new configuration options Sergey Matyukevich
  4 siblings, 1 reply; 19+ messages in thread
From: Alexander Mukhin @ 2017-12-23 19:06 UTC (permalink / raw)
  To: buildroot

ACS is supported for nl80211 driver only.

Signed-off-by: Alexander Mukhin <alexander.i.mukhin@gmail.com>
---
 package/hostapd/Config.in | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/package/hostapd/Config.in b/package/hostapd/Config.in
index 509797a44a..57cec469c6 100644
--- a/package/hostapd/Config.in
+++ b/package/hostapd/Config.in
@@ -39,6 +39,7 @@ comment "at least one driver must be selected"
 config BR2_PACKAGE_HOSTAPD_ACS
 	bool "Enable ACS"
 	default y
+	depends on BR2_PACKAGE_HOSTAPD_DRIVER_NL80211
 	help
 	  Enable support for standard ACS (Automatic Channel Selection).
 	  Some propietary drivers use a custom algorithm which requires
@@ -46,6 +47,9 @@ config BR2_PACKAGE_HOSTAPD_ACS
 	  causing hostapd to use the standard one which doesn't work
 	  for those cases.
 
+comment "ACS is currently only supported through the nl80211 driver"
+	depends on !BR2_PACKAGE_HOSTAPD_DRIVER_NL80211
+
 config BR2_PACKAGE_HOSTAPD_EAP
 	bool "Enable EAP"
 	depends on !BR2_STATIC_LIBS
-- 
2.11.0

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

* [Buildroot] [PATCH 4/4] hostapd: drop default netlink dependency
  2017-12-23 19:06 [Buildroot] [PATCH 0/4] hostapd: new configuration options Alexander Mukhin
                   ` (2 preceding siblings ...)
  2017-12-23 19:06 ` [Buildroot] [PATCH 3/4] hostapd: make ACS dependent on nl80211 Alexander Mukhin
@ 2017-12-23 19:06 ` Alexander Mukhin
  2017-12-29 21:38   ` Thomas Petazzoni
  2017-12-24 20:51 ` [Buildroot] [PATCH 0/4] hostapd: new configuration options Sergey Matyukevich
  4 siblings, 1 reply; 19+ messages in thread
From: Alexander Mukhin @ 2017-12-23 19:06 UTC (permalink / raw)
  To: buildroot

Get rid of netlink and threads dependency if the options selected
allow so.

Signed-off-by: Alexander Mukhin <alexander.i.mukhin@gmail.com>
---
 package/hostapd/Config.in  | 16 ++++++++++------
 package/hostapd/hostapd.mk | 29 +++++++++++++++++++----------
 2 files changed, 29 insertions(+), 16 deletions(-)

diff --git a/package/hostapd/Config.in b/package/hostapd/Config.in
index 57cec469c6..115563f564 100644
--- a/package/hostapd/Config.in
+++ b/package/hostapd/Config.in
@@ -1,8 +1,6 @@
 config BR2_PACKAGE_HOSTAPD
 	bool "hostapd"
-	depends on BR2_TOOLCHAIN_HAS_THREADS # libnl
 	depends on BR2_USE_MMU # fork()
-	select BR2_PACKAGE_LIBNL
 	help
 	  User space daemon for wireless access points.
 
@@ -23,9 +21,14 @@ config BR2_PACKAGE_HOSTAPD_DRIVER_HOSTAP
 config BR2_PACKAGE_HOSTAPD_DRIVER_NL80211
 	bool "Enable nl80211 driver"
 	default y
+	depends on BR2_TOOLCHAIN_HAS_THREADS # libnl
+	select BR2_PACKAGE_LIBNL
 	help
 	  Enable support for drivers using the nl80211 kernel interface.
 
+comment "nl80211 driver needs a toolchain w/ threads"
+	depends on !BR2_TOOLCHAIN_HAS_THREADS
+
 config BR2_PACKAGE_HOSTAPD_DRIVER_RTW
 	bool "Enable rtl871xdrv driver"
 	help
@@ -83,12 +86,13 @@ config BR2_PACKAGE_HOSTAPD_VLAN_NETLINK
 	bool "Use netlink-based API for VLAN operations"
 	default y
 	depends on BR2_PACKAGE_HOSTAPD_VLAN
+	depends on BR2_TOOLCHAIN_HAS_THREADS # libnl
+	select BR2_PACKAGE_LIBNL
 	help
 	  Use netlink-based kernel API for VLAN operations
 	  instead of ioctl().
 
-endif
-
-comment "hostapd needs a toolchain w/ threads"
+comment "netlink-based VLAN support needs a toolchain w/ threads"
 	depends on !BR2_TOOLCHAIN_HAS_THREADS
-	depends on BR2_USE_MMU
+
+endif
diff --git a/package/hostapd/hostapd.mk b/package/hostapd/hostapd.mk
index 143efe9627..9b73c596f8 100644
--- a/package/hostapd/hostapd.mk
+++ b/package/hostapd/hostapd.mk
@@ -11,8 +11,8 @@ HOSTAPD_PATCH = \
 	http://w1.fi/security/2017-1/rebased-v2.6-0005-Fix-PTK-rekeying-to-generate-a-new-ANonce.patch
 HOSTAPD_SUBDIR = hostapd
 HOSTAPD_CONFIG = $(HOSTAPD_DIR)/$(HOSTAPD_SUBDIR)/.config
-HOSTAPD_DEPENDENCIES = host-pkgconf libnl
-HOSTAPD_CFLAGS = $(TARGET_CFLAGS) -I$(STAGING_DIR)/usr/include/libnl3/
+HOSTAPD_DEPENDENCIES = host-pkgconf
+HOSTAPD_CFLAGS = $(TARGET_CFLAGS)
 HOSTAPD_LICENSE = BSD-3-Clause
 HOSTAPD_LICENSE_FILES = README
 HOSTAPD_CONFIG_SET =
@@ -23,17 +23,11 @@ HOSTAPD_CONFIG_ENABLE = \
 	CONFIG_IEEE80211N \
 	CONFIG_IEEE80211R \
 	CONFIG_INTERNAL_LIBTOMMATH \
-	CONFIG_INTERWORKING \
-	CONFIG_LIBNL32
+	CONFIG_INTERWORKING
 
 HOSTAPD_CONFIG_DISABLE =
 
-# libnl-3 needs -lm (for rint) and -lpthread if linking statically
-# And library order matters hence stick -lnl-3 first since it's appended
-# in the hostapd Makefiles as in LIBS+=-lnl-3 ... thus failing
-ifeq ($(BR2_STATIC_LIBS),y)
-HOSTAPD_LIBS += -lnl-3 -lm -lpthread
-endif
+HOSTAPD_USE_NL =
 
 # Try to use openssl if it's already available
 ifeq ($(BR2_PACKAGE_LIBOPENSSL),y)
@@ -51,6 +45,8 @@ endif
 
 ifneq ($(BR2_PACKAGE_HOSTAPD_DRIVER_NL80211),y)
 HOSTAPD_CONFIG_DISABLE += CONFIG_DRIVER_NL80211
+else
+HOSTAPD_USE_NL = y
 endif
 
 ifeq ($(BR2_PACKAGE_HOSTAPD_DRIVER_RTW),y)
@@ -89,9 +85,22 @@ HOSTAPD_CONFIG_ENABLE += CONFIG_FULL_DYNAMIC_VLAN
 endif
 
 ifeq ($(BR2_PACKAGE_HOSTAPD_VLAN_NETLINK),y)
+HOSTAPD_USE_NL = y
 HOSTAPD_CONFIG_ENABLE += CONFIG_VLAN_NETLINK
 endif
 
+ifeq ($(HOSTAPD_USE_NL),y)
+HOSTAPD_DEPENDENCIES += libnl
+HOSTAPD_CFLAGS += -I$(STAGING_DIR)/usr/include/libnl3/
+HOSTAPD_CONFIG_ENABLE += CONFIG_LIBNL32
+# libnl-3 needs -lm (for rint) and -lpthread if linking statically
+# And library order matters hence stick -lnl-3 first since it's appended
+# in the hostapd Makefiles as in LIBS+=-lnl-3 ... thus failing
+ifeq ($(BR2_STATIC_LIBS),y)
+HOSTAPD_LIBS += -lnl-3 -lm -lpthread
+endif
+endif
+
 define HOSTAPD_CONFIGURE_CMDS
 	cp $(@D)/hostapd/defconfig $(HOSTAPD_CONFIG)
 	sed -i $(patsubst %,-e 's/^#\(%\)/\1/',$(HOSTAPD_CONFIG_ENABLE)) \
-- 
2.11.0

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

* [Buildroot] [PATCH 2/4] hostapd: select driver support
  2017-12-23 19:06 ` [Buildroot] [PATCH 2/4] hostapd: select driver support Alexander Mukhin
@ 2017-12-24 20:49   ` Sergey Matyukevich
  2017-12-27 19:12     ` Alexander Mukhin
                       ` (2 more replies)
  2017-12-29 21:36   ` [Buildroot] [PATCH 2/4] hostapd: select driver support Thomas Petazzoni
  1 sibling, 3 replies; 19+ messages in thread
From: Sergey Matyukevich @ 2017-12-24 20:49 UTC (permalink / raw)
  To: buildroot

Hello Alexander,

> Add configuration options for hostapd to select which
> drivers to build.
> 
> Signed-off-by: Alexander Mukhin <alexander.i.mukhin@gmail.com>

[...]

> +comment "at least one driver must be selected"
> +	depends on !BR2_PACKAGE_HOSTAPD_DRIVER_HOSTAP
> +	depends on !BR2_PACKAGE_HOSTAPD_DRIVER_NL80211
> +	depends on !BR2_PACKAGE_HOSTAPD_DRIVER_RTW
> +

Does it makes sense to enforce enablement of at least one driver ?

Another option would be to add DRIVER_NONE to the list of drivers,
and enable it by default if no other actual wired/wireless driver
has been selected. According to example hostapd.conf only 'none'
driver is needed if hostapd is built as a standalone RADIUS server.

Regards,
Sergey

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

* [Buildroot] [PATCH 0/4] hostapd: new configuration options
  2017-12-23 19:06 [Buildroot] [PATCH 0/4] hostapd: new configuration options Alexander Mukhin
                   ` (3 preceding siblings ...)
  2017-12-23 19:06 ` [Buildroot] [PATCH 4/4] hostapd: drop default netlink dependency Alexander Mukhin
@ 2017-12-24 20:51 ` Sergey Matyukevich
  4 siblings, 0 replies; 19+ messages in thread
From: Sergey Matyukevich @ 2017-12-24 20:51 UTC (permalink / raw)
  To: buildroot

> Below is the list of patches for hostapd to give user more control
> on which options to include in the build. As a byproduct, we can drop
> dependencies on netlink and threads if the options selected
> do not require them.
> 
> Alexander Mukhin (4):
>   hostapd: select VLAN support
>   hostapd: select driver support
>   hostapd: make ACS dependent on nl80211
>   hostapd: drop default netlink dependency

For the whole patch set:
Reviewed-by: Sergey Matyukevich <geomatsi@gmail.com>

Regards,
Sergey

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

* [Buildroot] [PATCH 2/4] hostapd: select driver support
  2017-12-24 20:49   ` Sergey Matyukevich
@ 2017-12-27 19:12     ` Alexander Mukhin
  2017-12-27 19:29     ` [Buildroot] [PATCH 1/2] hostapd: add support for wired driver Alexander Mukhin
  2017-12-27 19:29     ` [Buildroot] [PATCH 2/2] hostapd: select DRIVER_NONE if no other drivers enabled Alexander Mukhin
  2 siblings, 0 replies; 19+ messages in thread
From: Alexander Mukhin @ 2017-12-27 19:12 UTC (permalink / raw)
  To: buildroot

Hello Sergey,

> Does it makes sense to enforce enablement of at least one driver ?
> 
> Another option would be to add DRIVER_NONE to the list of drivers,
> and enable it by default if no other actual wired/wireless driver
> has been selected. According to example hostapd.conf only 'none'
> driver is needed if hostapd is built as a standalone RADIUS server.

Yes, I agree with you.
I'll send a patch for that.

-- 
Cheers,
Alexander.

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

* [Buildroot] [PATCH 1/2] hostapd: add support for wired driver
  2017-12-24 20:49   ` Sergey Matyukevich
  2017-12-27 19:12     ` Alexander Mukhin
@ 2017-12-27 19:29     ` Alexander Mukhin
  2017-12-27 22:15       ` Thomas Petazzoni
  2017-12-27 19:29     ` [Buildroot] [PATCH 2/2] hostapd: select DRIVER_NONE if no other drivers enabled Alexander Mukhin
  2 siblings, 1 reply; 19+ messages in thread
From: Alexander Mukhin @ 2017-12-27 19:29 UTC (permalink / raw)
  To: buildroot

Add support for the wired authenticator (disabled by default).

Signed-off-by: Alexander Mukhin <alexander.i.mukhin@gmail.com>
---

These patches are meant to be applied after the series I sent before
(see hostapd: new configuration options)

 package/hostapd/Config.in  | 7 +++++++
 package/hostapd/hostapd.mk | 4 ++++
 2 files changed, 11 insertions(+)

diff --git a/package/hostapd/Config.in b/package/hostapd/Config.in
index 115563f564..bfb5447c1e 100644
--- a/package/hostapd/Config.in
+++ b/package/hostapd/Config.in
@@ -34,10 +34,17 @@ config BR2_PACKAGE_HOSTAPD_DRIVER_RTW
 	help
 	  Enable support for Realtek wireless chips.
 
+config BR2_PACKAGE_HOSTAPD_DRIVER_WIRED
+	bool "Enable wired driver"
+	default y
+	help
+	  Enable support for wired authenticator.
+
 comment "at least one driver must be selected"
 	depends on !BR2_PACKAGE_HOSTAPD_DRIVER_HOSTAP
 	depends on !BR2_PACKAGE_HOSTAPD_DRIVER_NL80211
 	depends on !BR2_PACKAGE_HOSTAPD_DRIVER_RTW
+	depends on !BR2_PACKAGE_HOSTAPD_DRIVER_WIRED
 
 config BR2_PACKAGE_HOSTAPD_ACS
 	bool "Enable ACS"
diff --git a/package/hostapd/hostapd.mk b/package/hostapd/hostapd.mk
index 9b73c596f8..1700335c1a 100644
--- a/package/hostapd/hostapd.mk
+++ b/package/hostapd/hostapd.mk
@@ -54,6 +54,10 @@ HOSTAPD_PATCH += https://github.com/pritambaral/hostapd-rtl871xdrv/raw/master/rt
 HOSTAPD_CONFIG_SET += CONFIG_DRIVER_RTW
 endif
 
+ifeq ($(BR2_PACKAGE_HOSTAPD_DRIVER_WIRED),y)
+HOSTAPD_CONFIG_ENABLE += CONFIG_DRIVER_WIRED
+endif
+
 ifeq ($(BR2_PACKAGE_HOSTAPD_ACS),y)
 HOSTAPD_CONFIG_ENABLE += CONFIG_ACS
 endif
-- 
2.11.0

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

* [Buildroot] [PATCH 2/2] hostapd: select DRIVER_NONE if no other drivers enabled
  2017-12-24 20:49   ` Sergey Matyukevich
  2017-12-27 19:12     ` Alexander Mukhin
  2017-12-27 19:29     ` [Buildroot] [PATCH 1/2] hostapd: add support for wired driver Alexander Mukhin
@ 2017-12-27 19:29     ` Alexander Mukhin
  2017-12-27 22:17       ` Thomas Petazzoni
  2 siblings, 1 reply; 19+ messages in thread
From: Alexander Mukhin @ 2017-12-27 19:29 UTC (permalink / raw)
  To: buildroot

Select DRIVER_NONE if no wireless or wired drivers selected.
This may be the case when building hostapd as a standalone
RADIUS server.

Apply wireless-specific options only if we have at least one
wireless driver enabled. Otherwise, an attempt to build
a wired-only or RADIUS-only hostapd will fail.

Signed-off-by: Alexander Mukhin <alexander.i.mukhin@gmail.com>
---
 package/hostapd/Config.in  |  6 ------
 package/hostapd/hostapd.mk | 36 +++++++++++++++++++++++++++++-------
 2 files changed, 29 insertions(+), 13 deletions(-)

diff --git a/package/hostapd/Config.in b/package/hostapd/Config.in
index bfb5447c1e..2ce26e79aa 100644
--- a/package/hostapd/Config.in
+++ b/package/hostapd/Config.in
@@ -40,12 +40,6 @@ config BR2_PACKAGE_HOSTAPD_DRIVER_WIRED
 	help
 	  Enable support for wired authenticator.
 
-comment "at least one driver must be selected"
-	depends on !BR2_PACKAGE_HOSTAPD_DRIVER_HOSTAP
-	depends on !BR2_PACKAGE_HOSTAPD_DRIVER_NL80211
-	depends on !BR2_PACKAGE_HOSTAPD_DRIVER_RTW
-	depends on !BR2_PACKAGE_HOSTAPD_DRIVER_WIRED
-
 config BR2_PACKAGE_HOSTAPD_ACS
 	bool "Enable ACS"
 	default y
diff --git a/package/hostapd/hostapd.mk b/package/hostapd/hostapd.mk
index 1700335c1a..e6c981dbe5 100644
--- a/package/hostapd/hostapd.mk
+++ b/package/hostapd/hostapd.mk
@@ -17,18 +17,14 @@ HOSTAPD_LICENSE = BSD-3-Clause
 HOSTAPD_LICENSE_FILES = README
 HOSTAPD_CONFIG_SET =
 
-HOSTAPD_CONFIG_ENABLE = \
-	CONFIG_HS20 \
-	CONFIG_IEEE80211AC \
-	CONFIG_IEEE80211N \
-	CONFIG_IEEE80211R \
-	CONFIG_INTERNAL_LIBTOMMATH \
-	CONFIG_INTERWORKING
+HOSTAPD_CONFIG_ENABLE = CONFIG_INTERNAL_LIBTOMMATH
 
 HOSTAPD_CONFIG_DISABLE =
 
 HOSTAPD_USE_NL =
 
+HOSTAPD_USE_WIRELESS_DRIVERS =
+
 # Try to use openssl if it's already available
 ifeq ($(BR2_PACKAGE_LIBOPENSSL),y)
 HOSTAPD_DEPENDENCIES += libopenssl
@@ -39,25 +35,51 @@ HOSTAPD_CONFIG_DISABLE += CONFIG_EAP_PWD
 HOSTAPD_CONFIG_EDITS += 's/\#\(CONFIG_TLS=\).*/\1internal/'
 endif
 
+# Select which drivers to build
 ifneq ($(BR2_PACKAGE_HOSTAPD_DRIVER_HOSTAP),y)
 HOSTAPD_CONFIG_DISABLE += CONFIG_DRIVER_HOSTAP
+else
+HOSTAPD_USE_WIRELESS_DRIVERS = y
 endif
 
 ifneq ($(BR2_PACKAGE_HOSTAPD_DRIVER_NL80211),y)
 HOSTAPD_CONFIG_DISABLE += CONFIG_DRIVER_NL80211
 else
 HOSTAPD_USE_NL = y
+HOSTAPD_USE_WIRELESS_DRIVERS = y
 endif
 
 ifeq ($(BR2_PACKAGE_HOSTAPD_DRIVER_RTW),y)
 HOSTAPD_PATCH += https://github.com/pritambaral/hostapd-rtl871xdrv/raw/master/rtlxdrv.patch
 HOSTAPD_CONFIG_SET += CONFIG_DRIVER_RTW
+HOSTAPD_USE_WIRELESS_DRIVERS = y
 endif
 
 ifeq ($(BR2_PACKAGE_HOSTAPD_DRIVER_WIRED),y)
 HOSTAPD_CONFIG_ENABLE += CONFIG_DRIVER_WIRED
 endif
 
+# Enable CONFIG_DRIVER_NONE if no other drivers enabled
+ifneq ($(BR2_PACKAGE_HOSTAPD_DRIVER_HOSTAP),y)
+ifneq ($(BR2_PACKAGE_HOSTAPD_DRIVER_NL80211),y)
+ifneq ($(BR2_PACKAGE_HOSTAPD_DRIVER_RTW),y)
+ifneq ($(BR2_PACKAGE_HOSTAPD_DRIVER_WIRED),y)
+HOSTAPD_CONFIG_ENABLE += CONFIG_DRIVER_NONE
+endif
+endif
+endif
+endif
+
+# Add options for wireless drivers
+ifeq ($(HOSTAPD_USE_WIRELESS_DRIVERS),y)
+HOSTAPD_CONFIG_ENABLE += \
+	CONFIG_HS20 \
+	CONFIG_IEEE80211AC \
+	CONFIG_IEEE80211N \
+	CONFIG_IEEE80211R \
+	CONFIG_INTERWORKING
+endif
+
 ifeq ($(BR2_PACKAGE_HOSTAPD_ACS),y)
 HOSTAPD_CONFIG_ENABLE += CONFIG_ACS
 endif
-- 
2.11.0

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

* [Buildroot] [PATCH 1/2] hostapd: add support for wired driver
  2017-12-27 19:29     ` [Buildroot] [PATCH 1/2] hostapd: add support for wired driver Alexander Mukhin
@ 2017-12-27 22:15       ` Thomas Petazzoni
  0 siblings, 0 replies; 19+ messages in thread
From: Thomas Petazzoni @ 2017-12-27 22:15 UTC (permalink / raw)
  To: buildroot

Hello,

On Wed, 27 Dec 2017 22:29:00 +0300, Alexander Mukhin wrote:
> Add support for the wired authenticator (disabled by default).

disabled by default...

> These patches are meant to be applied after the series I sent before
> (see hostapd: new configuration options)

Could you please send a single series instead ? This makes the
dependency much clearer.

> +config BR2_PACKAGE_HOSTAPD_DRIVER_WIRED
> +	bool "Enable wired driver"
> +	default y

... but you're defaulting to "y".

Best regards,

Thomas
-- 
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux and Kernel engineering
http://free-electrons.com

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

* [Buildroot] [PATCH 2/2] hostapd: select DRIVER_NONE if no other drivers enabled
  2017-12-27 19:29     ` [Buildroot] [PATCH 2/2] hostapd: select DRIVER_NONE if no other drivers enabled Alexander Mukhin
@ 2017-12-27 22:17       ` Thomas Petazzoni
  0 siblings, 0 replies; 19+ messages in thread
From: Thomas Petazzoni @ 2017-12-27 22:17 UTC (permalink / raw)
  To: buildroot

Hello,

On Wed, 27 Dec 2017 22:29:28 +0300, Alexander Mukhin wrote:

> diff --git a/package/hostapd/hostapd.mk b/package/hostapd/hostapd.mk
> index 1700335c1a..e6c981dbe5 100644
> --- a/package/hostapd/hostapd.mk
> +++ b/package/hostapd/hostapd.mk
> @@ -17,18 +17,14 @@ HOSTAPD_LICENSE = BSD-3-Clause
>  HOSTAPD_LICENSE_FILES = README
>  HOSTAPD_CONFIG_SET =
>  
> -HOSTAPD_CONFIG_ENABLE = \
> -	CONFIG_HS20 \
> -	CONFIG_IEEE80211AC \
> -	CONFIG_IEEE80211N \
> -	CONFIG_IEEE80211R \
> -	CONFIG_INTERNAL_LIBTOMMATH \
> -	CONFIG_INTERWORKING
> +HOSTAPD_CONFIG_ENABLE = CONFIG_INTERNAL_LIBTOMMATH
>  
>  HOSTAPD_CONFIG_DISABLE =
>  
>  HOSTAPD_USE_NL =
>  
> +HOSTAPD_USE_WIRELESS_DRIVERS =

I think this would be better handled via a hidden Config.in option,
something like:

config BR2_PACKAGE_HOSTAPD_HAS_WIFI_DRIVERS
	bool

config BR2_PACKAGE_HOSTAPD_<something>
	bool "something"
	select BR2_PACKAGE_HOSTAPD_HAS_WIFI_DRIVERS

> +# Enable CONFIG_DRIVER_NONE if no other drivers enabled
> +ifneq ($(BR2_PACKAGE_HOSTAPD_DRIVER_HOSTAP),y)
> +ifneq ($(BR2_PACKAGE_HOSTAPD_DRIVER_NL80211),y)
> +ifneq ($(BR2_PACKAGE_HOSTAPD_DRIVER_RTW),y)
> +ifneq ($(BR2_PACKAGE_HOSTAPD_DRIVER_WIRED),y)

Perhaps this could be simplified to:

ifeq ($(BR2_PACKAGE_HOSTAPD_HAS_WIFI_DRIVERS)$(BR2_PACKAGE_HOSTAPD_DRIVER_WIRED),)

> +HOSTAPD_CONFIG_ENABLE += CONFIG_DRIVER_NONE
> +endif
> +endif
> +endif
> +endif
> +
> +# Add options for wireless drivers
> +ifeq ($(HOSTAPD_USE_WIRELESS_DRIVERS),y)

This would use BR2_PACKAGE_HOSTAPD_HAS_WIFI_DRIVERS.

Best regards,

Thomas
-- 
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux and Kernel engineering
http://free-electrons.com

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

* [Buildroot] [PATCH 1/4] hostapd: select VLAN support
  2017-12-23 19:06 ` [Buildroot] [PATCH 1/4] hostapd: select VLAN support Alexander Mukhin
@ 2017-12-29 21:32   ` Thomas Petazzoni
  0 siblings, 0 replies; 19+ messages in thread
From: Thomas Petazzoni @ 2017-12-29 21:32 UTC (permalink / raw)
  To: buildroot

Hello,

On Sat, 23 Dec 2017 22:06:14 +0300, Alexander Mukhin wrote:

> +ifneq ($(BR2_PACKAGE_HOSTAPD_VLAN),y)

This is better written as:

ifeq ($(BR2_PACKAGE_HOSTAPD_VLAN),)

So I've fixed that, and applied your patch. Thanks!

Thomas
-- 
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux and Kernel engineering
http://free-electrons.com

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

* [Buildroot] [PATCH 2/4] hostapd: select driver support
  2017-12-23 19:06 ` [Buildroot] [PATCH 2/4] hostapd: select driver support Alexander Mukhin
  2017-12-24 20:49   ` Sergey Matyukevich
@ 2017-12-29 21:36   ` Thomas Petazzoni
  1 sibling, 0 replies; 19+ messages in thread
From: Thomas Petazzoni @ 2017-12-29 21:36 UTC (permalink / raw)
  To: buildroot

Hello,

On Sat, 23 Dec 2017 22:06:15 +0300, Alexander Mukhin wrote:
> Add configuration options for hostapd to select which
> drivers to build.
> 
> Signed-off-by: Alexander Mukhin <alexander.i.mukhin@gmail.com>

Since you got some feedback on this patch, could you send a new
iteration of your hostapd series ? It should also include the two other
patches you sent as a separate series, to be clearer.

Thanks!

Thomas
-- 
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux and Kernel engineering
http://free-electrons.com

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

* [Buildroot] [PATCH 3/4] hostapd: make ACS dependent on nl80211
  2017-12-23 19:06 ` [Buildroot] [PATCH 3/4] hostapd: make ACS dependent on nl80211 Alexander Mukhin
@ 2017-12-29 21:37   ` Thomas Petazzoni
  2017-12-30  9:50     ` Alexander Mukhin
  0 siblings, 1 reply; 19+ messages in thread
From: Thomas Petazzoni @ 2017-12-29 21:37 UTC (permalink / raw)
  To: buildroot

Hello,

On Sat, 23 Dec 2017 22:06:16 +0300, Alexander Mukhin wrote:
> ACS is supported for nl80211 driver only.
> 
> Signed-off-by: Alexander Mukhin <alexander.i.mukhin@gmail.com>

Could you add more details here? Do you see a build failure? Runtime
failure?

If CONFIG_ACS=y doesn't build when CONFIG_DRIVER_NL80211 is disabled,
then this fix should be part of PATCH 2/4, otherwise PATCH 2/4
introduces a build regression.

Thanks!

Thomas
-- 
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux and Kernel engineering
http://free-electrons.com

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

* [Buildroot] [PATCH 4/4] hostapd: drop default netlink dependency
  2017-12-23 19:06 ` [Buildroot] [PATCH 4/4] hostapd: drop default netlink dependency Alexander Mukhin
@ 2017-12-29 21:38   ` Thomas Petazzoni
  0 siblings, 0 replies; 19+ messages in thread
From: Thomas Petazzoni @ 2017-12-29 21:38 UTC (permalink / raw)
  To: buildroot

Hello,

On Sat, 23 Dec 2017 22:06:17 +0300, Alexander Mukhin wrote:

> -# libnl-3 needs -lm (for rint) and -lpthread if linking statically
> -# And library order matters hence stick -lnl-3 first since it's appended
> -# in the hostapd Makefiles as in LIBS+=-lnl-3 ... thus failing
> -ifeq ($(BR2_STATIC_LIBS),y)
> -HOSTAPD_LIBS += -lnl-3 -lm -lpthread
> -endif
> +HOSTAPD_USE_NL =

Instead of this, just use:

ifeq ($(BR2_PACKAGE_LIBNL),y)

Thanks!

Thomas
-- 
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux and Kernel engineering
http://free-electrons.com

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

* [Buildroot] [PATCH 3/4] hostapd: make ACS dependent on nl80211
  2017-12-29 21:37   ` Thomas Petazzoni
@ 2017-12-30  9:50     ` Alexander Mukhin
  2017-12-30 10:18       ` Thomas Petazzoni
  0 siblings, 1 reply; 19+ messages in thread
From: Alexander Mukhin @ 2017-12-30  9:50 UTC (permalink / raw)
  To: buildroot

Hello,

> > ACS is supported for nl80211 driver only.
> > 
> Could you add more details here? Do you see a build failure? Runtime
> failure?
> 
> If CONFIG_ACS=y doesn't build when CONFIG_DRIVER_NL80211 is disabled,
> then this fix should be part of PATCH 2/4, otherwise PATCH 2/4
> introduces a build regression.

My guide here is hostapd's defconfig, where it's stated that "ACS is
currently only supported through the nl80211 driver". Search through the
source code also reveals ACS machinery in the nl80211 driver only.

hostapd builds successively with ACS enabled and nl80211 disabled, but
an attempt to use ACS by setting a wireless channel to 0 results in a
runtime failure (driver doesn't accept this value).

-- 
Best regards,
Alexander.

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

* [Buildroot] [PATCH 3/4] hostapd: make ACS dependent on nl80211
  2017-12-30  9:50     ` Alexander Mukhin
@ 2017-12-30 10:18       ` Thomas Petazzoni
  2017-12-30 12:09         ` Alexander Mukhin
  0 siblings, 1 reply; 19+ messages in thread
From: Thomas Petazzoni @ 2017-12-30 10:18 UTC (permalink / raw)
  To: buildroot

Hello,

On Sat, 30 Dec 2017 12:50:00 +0300, Alexander Mukhin wrote:

> > > ACS is supported for nl80211 driver only.
> > >   
> > Could you add more details here? Do you see a build failure? Runtime
> > failure?
> > 
> > If CONFIG_ACS=y doesn't build when CONFIG_DRIVER_NL80211 is disabled,
> > then this fix should be part of PATCH 2/4, otherwise PATCH 2/4
> > introduces a build regression.  
> 
> My guide here is hostapd's defconfig, where it's stated that "ACS is
> currently only supported through the nl80211 driver". Search through the
> source code also reveals ACS machinery in the nl80211 driver only.
> 
> hostapd builds successively with ACS enabled and nl80211 disabled, but
> an attempt to use ACS by setting a wireless channel to 0 results in a
> runtime failure (driver doesn't accept this value).

Thanks for this additional explanation. Could you include this in the
commit log in the next iteration of this patch series ?

Thanks!

Thomas
-- 
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux and Kernel engineering
http://free-electrons.com

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

* [Buildroot] [PATCH 3/4] hostapd: make ACS dependent on nl80211
  2017-12-30 10:18       ` Thomas Petazzoni
@ 2017-12-30 12:09         ` Alexander Mukhin
  0 siblings, 0 replies; 19+ messages in thread
From: Alexander Mukhin @ 2017-12-30 12:09 UTC (permalink / raw)
  To: buildroot

Hello,

On Sat, Dec 30, 2017 at 11:18:56AM +0100, Thomas Petazzoni wrote:
> 
> Thanks for this additional explanation. Could you include this in the
> commit log in the next iteration of this patch series ?
>

Yes, I'll surely do.

-- 
Cheers,
Alexander. 

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

end of thread, other threads:[~2017-12-30 12:09 UTC | newest]

Thread overview: 19+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-12-23 19:06 [Buildroot] [PATCH 0/4] hostapd: new configuration options Alexander Mukhin
2017-12-23 19:06 ` [Buildroot] [PATCH 1/4] hostapd: select VLAN support Alexander Mukhin
2017-12-29 21:32   ` Thomas Petazzoni
2017-12-23 19:06 ` [Buildroot] [PATCH 2/4] hostapd: select driver support Alexander Mukhin
2017-12-24 20:49   ` Sergey Matyukevich
2017-12-27 19:12     ` Alexander Mukhin
2017-12-27 19:29     ` [Buildroot] [PATCH 1/2] hostapd: add support for wired driver Alexander Mukhin
2017-12-27 22:15       ` Thomas Petazzoni
2017-12-27 19:29     ` [Buildroot] [PATCH 2/2] hostapd: select DRIVER_NONE if no other drivers enabled Alexander Mukhin
2017-12-27 22:17       ` Thomas Petazzoni
2017-12-29 21:36   ` [Buildroot] [PATCH 2/4] hostapd: select driver support Thomas Petazzoni
2017-12-23 19:06 ` [Buildroot] [PATCH 3/4] hostapd: make ACS dependent on nl80211 Alexander Mukhin
2017-12-29 21:37   ` Thomas Petazzoni
2017-12-30  9:50     ` Alexander Mukhin
2017-12-30 10:18       ` Thomas Petazzoni
2017-12-30 12:09         ` Alexander Mukhin
2017-12-23 19:06 ` [Buildroot] [PATCH 4/4] hostapd: drop default netlink dependency Alexander Mukhin
2017-12-29 21:38   ` Thomas Petazzoni
2017-12-24 20:51 ` [Buildroot] [PATCH 0/4] hostapd: new configuration options Sergey Matyukevich

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox