* [Buildroot] [PATCH 1/3] hostapd: select driver support
2017-12-30 15:57 [Buildroot] [PATCH 0/3] hostapd: driver selection options Alexander Mukhin
@ 2017-12-30 15:57 ` Alexander Mukhin
2018-02-06 14:12 ` Bryce Ferguson
2018-02-06 14:27 ` Sam Voss
2017-12-30 15:57 ` [Buildroot] [PATCH 2/3] hostapd: make ACS dependent on nl80211 Alexander Mukhin
` (3 subsequent siblings)
4 siblings, 2 replies; 11+ messages in thread
From: Alexander Mukhin @ 2017-12-30 15:57 UTC (permalink / raw)
To: buildroot
Add support for the wired driver. Add configuration options to select
which drivers to build. Select DRIVER_NONE if no other drivers enabled
(this may be the case when building hostapd as a standalone RADIUS
server).
Update makefile logic and apply wireless-specific options only if 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 | 31 +++++++++++++++++++++++++++++++
package/hostapd/hostapd.mk | 31 ++++++++++++++++++++++++++-----
2 files changed, 57 insertions(+), 5 deletions(-)
diff --git a/package/hostapd/Config.in b/package/hostapd/Config.in
index 84156e8f11..f6182a9268 100644
--- a/package/hostapd/Config.in
+++ b/package/hostapd/Config.in
@@ -14,11 +14,42 @@ config BR2_PACKAGE_HOSTAPD
if BR2_PACKAGE_HOSTAPD
+config BR2_PACKAGE_HOSTAPD_DRIVER_HOSTAP
+ bool "Enable hostap driver"
+ default y
+ select BR2_PACKAGE_HOSTAPD_HAS_WIFI_DRIVERS
+ help
+ Enable support for Host AP driver.
+
+config BR2_PACKAGE_HOSTAPD_DRIVER_NL80211
+ bool "Enable nl80211 driver"
+ default y
+ select BR2_PACKAGE_HOSTAPD_HAS_WIFI_DRIVERS
+ help
+ Enable support for drivers using the nl80211 kernel interface.
+
config BR2_PACKAGE_HOSTAPD_DRIVER_RTW
bool "Enable rtl871xdrv driver"
+ select BR2_PACKAGE_HOSTAPD_HAS_WIFI_DRIVERS
help
Enable support for Realtek wireless chips.
+config BR2_PACKAGE_HOSTAPD_DRIVER_WIRED
+ bool "Enable wired driver"
+ help
+ Enable support for wired authenticator.
+
+config BR2_PACKAGE_HOSTAPD_DRIVER_NONE
+ bool
+ default y
+ 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_HAS_WIFI_DRIVERS
+ bool
+
config BR2_PACKAGE_HOSTAPD_ACS
bool "Enable ACS"
default y
diff --git a/package/hostapd/hostapd.mk b/package/hostapd/hostapd.mk
index 1696670383..f9072784eb 100644
--- a/package/hostapd/hostapd.mk
+++ b/package/hostapd/hostapd.mk
@@ -18,12 +18,7 @@ HOSTAPD_LICENSE_FILES = README
HOSTAPD_CONFIG_SET =
HOSTAPD_CONFIG_ENABLE = \
- CONFIG_HS20 \
- CONFIG_IEEE80211AC \
- CONFIG_IEEE80211N \
- CONFIG_IEEE80211R \
CONFIG_INTERNAL_LIBTOMMATH \
- CONFIG_INTERWORKING \
CONFIG_LIBNL32
HOSTAPD_CONFIG_DISABLE =
@@ -45,11 +40,37 @@ HOSTAPD_CONFIG_DISABLE += CONFIG_EAP_PWD
HOSTAPD_CONFIG_EDITS += 's/\#\(CONFIG_TLS=\).*/\1internal/'
endif
+ifeq ($(BR2_PACKAGE_HOSTAPD_DRIVER_HOSTAP),)
+HOSTAPD_CONFIG_DISABLE += CONFIG_DRIVER_HOSTAP
+endif
+
+ifeq ($(BR2_PACKAGE_HOSTAPD_DRIVER_NL80211),)
+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
endif
+ifeq ($(BR2_PACKAGE_HOSTAPD_DRIVER_WIRED),y)
+HOSTAPD_CONFIG_ENABLE += CONFIG_DRIVER_WIRED
+endif
+
+ifeq ($(BR2_PACKAGE_HOSTAPD_DRIVER_NONE),y)
+HOSTAPD_CONFIG_ENABLE += CONFIG_DRIVER_NONE
+endif
+
+# Add options for wireless drivers
+ifeq ($(BR2_PACKAGE_HOSTAPD_HAS_WIFI_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] 11+ messages in thread* [Buildroot] [PATCH 1/3] hostapd: select driver support
2017-12-30 15:57 ` [Buildroot] [PATCH 1/3] hostapd: select driver support Alexander Mukhin
@ 2018-02-06 14:12 ` Bryce Ferguson
2018-02-06 14:27 ` Sam Voss
1 sibling, 0 replies; 11+ messages in thread
From: Bryce Ferguson @ 2018-02-06 14:12 UTC (permalink / raw)
To: buildroot
+Sam
^ permalink raw reply [flat|nested] 11+ messages in thread
* [Buildroot] [PATCH 1/3] hostapd: select driver support
2017-12-30 15:57 ` [Buildroot] [PATCH 1/3] hostapd: select driver support Alexander Mukhin
2018-02-06 14:12 ` Bryce Ferguson
@ 2018-02-06 14:27 ` Sam Voss
1 sibling, 0 replies; 11+ messages in thread
From: Sam Voss @ 2018-02-06 14:27 UTC (permalink / raw)
To: buildroot
On Sat, Dec 30, 2017 at 4:57 PM, Alexander Mukhin
<alexander.i.mukhin@gmail.com> wrote:
> Add support for the wired driver. Add configuration options to select
> which drivers to build. Select DRIVER_NONE if no other drivers enabled
> (this may be the case when building hostapd as a standalone RADIUS
> server).
>
> Update makefile logic and apply wireless-specific options only if 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>
Reviewed-by: Sam Voss <sam.voss@rockwellcollins.com>
> ---
> package/hostapd/Config.in | 31 +++++++++++++++++++++++++++++++
> package/hostapd/hostapd.mk | 31 ++++++++++++++++++++++++++-----
> 2 files changed, 57 insertions(+), 5 deletions(-)
>
> diff --git a/package/hostapd/Config.in b/package/hostapd/Config.in
> index 84156e8f11..f6182a9268 100644
> --- a/package/hostapd/Config.in
> +++ b/package/hostapd/Config.in
> @@ -14,11 +14,42 @@ config BR2_PACKAGE_HOSTAPD
>
> if BR2_PACKAGE_HOSTAPD
>
> +config BR2_PACKAGE_HOSTAPD_DRIVER_HOSTAP
> + bool "Enable hostap driver"
> + default y
> + select BR2_PACKAGE_HOSTAPD_HAS_WIFI_DRIVERS
> + help
> + Enable support for Host AP driver.
> +
> +config BR2_PACKAGE_HOSTAPD_DRIVER_NL80211
> + bool "Enable nl80211 driver"
> + default y
> + select BR2_PACKAGE_HOSTAPD_HAS_WIFI_DRIVERS
> + help
> + Enable support for drivers using the nl80211 kernel interface.
> +
> config BR2_PACKAGE_HOSTAPD_DRIVER_RTW
> bool "Enable rtl871xdrv driver"
> + select BR2_PACKAGE_HOSTAPD_HAS_WIFI_DRIVERS
> help
> Enable support for Realtek wireless chips.
>
> +config BR2_PACKAGE_HOSTAPD_DRIVER_WIRED
> + bool "Enable wired driver"
> + help
> + Enable support for wired authenticator.
> +
> +config BR2_PACKAGE_HOSTAPD_DRIVER_NONE
> + bool
> + default y
> + 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_HAS_WIFI_DRIVERS
> + bool
> +
> config BR2_PACKAGE_HOSTAPD_ACS
> bool "Enable ACS"
> default y
> diff --git a/package/hostapd/hostapd.mk b/package/hostapd/hostapd.mk
> index 1696670383..f9072784eb 100644
> --- a/package/hostapd/hostapd.mk
> +++ b/package/hostapd/hostapd.mk
> @@ -18,12 +18,7 @@ HOSTAPD_LICENSE_FILES = README
> HOSTAPD_CONFIG_SET =
>
> HOSTAPD_CONFIG_ENABLE = \
> - CONFIG_HS20 \
> - CONFIG_IEEE80211AC \
> - CONFIG_IEEE80211N \
> - CONFIG_IEEE80211R \
> CONFIG_INTERNAL_LIBTOMMATH \
> - CONFIG_INTERWORKING \
> CONFIG_LIBNL32
>
> HOSTAPD_CONFIG_DISABLE =
> @@ -45,11 +40,37 @@ HOSTAPD_CONFIG_DISABLE += CONFIG_EAP_PWD
> HOSTAPD_CONFIG_EDITS += 's/\#\(CONFIG_TLS=\).*/\1internal/'
> endif
>
> +ifeq ($(BR2_PACKAGE_HOSTAPD_DRIVER_HOSTAP),)
> +HOSTAPD_CONFIG_DISABLE += CONFIG_DRIVER_HOSTAP
> +endif
> +
> +ifeq ($(BR2_PACKAGE_HOSTAPD_DRIVER_NL80211),)
> +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
> endif
>
> +ifeq ($(BR2_PACKAGE_HOSTAPD_DRIVER_WIRED),y)
> +HOSTAPD_CONFIG_ENABLE += CONFIG_DRIVER_WIRED
> +endif
> +
> +ifeq ($(BR2_PACKAGE_HOSTAPD_DRIVER_NONE),y)
> +HOSTAPD_CONFIG_ENABLE += CONFIG_DRIVER_NONE
> +endif
> +
> +# Add options for wireless drivers
> +ifeq ($(BR2_PACKAGE_HOSTAPD_HAS_WIFI_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
>
> _______________________________________________
> buildroot mailing list
> buildroot at busybox.net
> http://lists.busybox.net/mailman/listinfo/buildroot
^ permalink raw reply [flat|nested] 11+ messages in thread
* [Buildroot] [PATCH 2/3] hostapd: make ACS dependent on nl80211
2017-12-30 15:57 [Buildroot] [PATCH 0/3] hostapd: driver selection options Alexander Mukhin
2017-12-30 15:57 ` [Buildroot] [PATCH 1/3] hostapd: select driver support Alexander Mukhin
@ 2017-12-30 15:57 ` Alexander Mukhin
2018-02-06 14:13 ` Bryce Ferguson
2018-02-06 14:22 ` Sam Voss
2017-12-30 15:57 ` [Buildroot] [PATCH 3/3] hostapd: drop default dependency on netlink Alexander Mukhin
` (2 subsequent siblings)
4 siblings, 2 replies; 11+ messages in thread
From: Alexander Mukhin @ 2017-12-30 15:57 UTC (permalink / raw)
To: buildroot
According to hostapd's defconfig file, ACS is currently only supported
through the nl80211 driver. Search through the source code also confirms
that ACS machinery is present in the nl80211 driver only.
Although hostapd can be built with ACS enabled and nl80211 disabled, an
attempt to use ACS with other drivers by setting a wireless channel to 0
results in a runtime failure (driver doesn't accept this value). So we
might save a user from selecting a meaningless combination by making ACS
dependent on nl80211.
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 f6182a9268..d23e5e1dca 100644
--- a/package/hostapd/Config.in
+++ b/package/hostapd/Config.in
@@ -53,6 +53,7 @@ config BR2_PACKAGE_HOSTAPD_HAS_WIFI_DRIVERS
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
@@ -60,6 +61,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] 11+ messages in thread* [Buildroot] [PATCH 2/3] hostapd: make ACS dependent on nl80211
2017-12-30 15:57 ` [Buildroot] [PATCH 2/3] hostapd: make ACS dependent on nl80211 Alexander Mukhin
@ 2018-02-06 14:13 ` Bryce Ferguson
2018-02-06 14:22 ` Sam Voss
1 sibling, 0 replies; 11+ messages in thread
From: Bryce Ferguson @ 2018-02-06 14:13 UTC (permalink / raw)
To: buildroot
+Sam
On Sat, Dec 30, 2017 at 9:57 AM, Alexander Mukhin
<alexander.i.mukhin@gmail.com> wrote:
> According to hostapd's defconfig file, ACS is currently only supported
> through the nl80211 driver. Search through the source code also confirms
> that ACS machinery is present in the nl80211 driver only.
>
> Although hostapd can be built with ACS enabled and nl80211 disabled, an
> attempt to use ACS with other drivers by setting a wireless channel to 0
> results in a runtime failure (driver doesn't accept this value). So we
> might save a user from selecting a meaningless combination by making ACS
> dependent on nl80211.
>
> Signed-off-by: Alexander Mukhin <alexander.i.mukhin@gmail.com>
Bryce Ferguson
Software Engineer
Airborne Information Solutions \ RC Linux Platform
400 Collins Rd NE Cedar Rapids, Iowa 52498
Bryce.Ferguson at rockwellcollins.com
^ permalink raw reply [flat|nested] 11+ messages in thread
* [Buildroot] [PATCH 2/3] hostapd: make ACS dependent on nl80211
2017-12-30 15:57 ` [Buildroot] [PATCH 2/3] hostapd: make ACS dependent on nl80211 Alexander Mukhin
2018-02-06 14:13 ` Bryce Ferguson
@ 2018-02-06 14:22 ` Sam Voss
1 sibling, 0 replies; 11+ messages in thread
From: Sam Voss @ 2018-02-06 14:22 UTC (permalink / raw)
To: buildroot
On Sat, Dec 30, 2017 at 4:57 PM, Alexander Mukhin
<alexander.i.mukhin@gmail.com> wrote:
> According to hostapd's defconfig file, ACS is currently only supported
> through the nl80211 driver. Search through the source code also confirms
> that ACS machinery is present in the nl80211 driver only.
>
> Although hostapd can be built with ACS enabled and nl80211 disabled, an
> attempt to use ACS with other drivers by setting a wireless channel to 0
> results in a runtime failure (driver doesn't accept this value). So we
> might save a user from selecting a meaningless combination by making ACS
> dependent on nl80211.
>
> Signed-off-by: Alexander Mukhin <alexander.i.mukhin@gmail.com>
Reviewed-by: Sam Voss <sam.voss@rockwellcollins.com>
> ---
> package/hostapd/Config.in | 4 ++++
> 1 file changed, 4 insertions(+)
>
> diff --git a/package/hostapd/Config.in b/package/hostapd/Config.in
> index f6182a9268..d23e5e1dca 100644
> --- a/package/hostapd/Config.in
> +++ b/package/hostapd/Config.in
> @@ -53,6 +53,7 @@ config BR2_PACKAGE_HOSTAPD_HAS_WIFI_DRIVERS
> 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
> @@ -60,6 +61,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
>
> _______________________________________________
> buildroot mailing list
> buildroot at busybox.net
> http://lists.busybox.net/mailman/listinfo/buildroot
^ permalink raw reply [flat|nested] 11+ messages in thread
* [Buildroot] [PATCH 3/3] hostapd: drop default dependency on netlink
2017-12-30 15:57 [Buildroot] [PATCH 0/3] hostapd: driver selection options Alexander Mukhin
2017-12-30 15:57 ` [Buildroot] [PATCH 1/3] hostapd: select driver support Alexander Mukhin
2017-12-30 15:57 ` [Buildroot] [PATCH 2/3] hostapd: make ACS dependent on nl80211 Alexander Mukhin
@ 2017-12-30 15:57 ` Alexander Mukhin
2018-02-06 14:23 ` Sam Voss
2018-02-06 14:11 ` [Buildroot] [PATCH 0/3] hostapd: driver selection options Bryce Ferguson
2018-04-02 16:33 ` Thomas Petazzoni
4 siblings, 1 reply; 11+ messages in thread
From: Alexander Mukhin @ 2017-12-30 15:57 UTC (permalink / raw)
To: buildroot
Get rid of netlink dependency if the options selected allow that.
Signed-off-by: Alexander Mukhin <alexander.i.mukhin@gmail.com>
---
package/hostapd/Config.in | 17 +++++++++++------
package/hostapd/hostapd.mk | 28 ++++++++++++++++------------
2 files changed, 27 insertions(+), 18 deletions(-)
diff --git a/package/hostapd/Config.in b/package/hostapd/Config.in
index d23e5e1dca..d60ed08cd6 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.
@@ -24,10 +22,15 @@ 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
select BR2_PACKAGE_HOSTAPD_HAS_WIFI_DRIVERS
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"
select BR2_PACKAGE_HOSTAPD_HAS_WIFI_DRIVERS
@@ -97,12 +100,14 @@ 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_PACKAGE_HOSTAPD_VLAN
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 f9072784eb..fa8226805d 100644
--- a/package/hostapd/hostapd.mk
+++ b/package/hostapd/hostapd.mk
@@ -11,25 +11,16 @@ 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 =
-HOSTAPD_CONFIG_ENABLE = \
- CONFIG_INTERNAL_LIBTOMMATH \
- CONFIG_LIBNL32
+HOSTAPD_CONFIG_ENABLE = CONFIG_INTERNAL_LIBTOMMATH
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
-
# Try to use openssl if it's already available
ifeq ($(BR2_PACKAGE_LIBOPENSSL),y)
HOSTAPD_DEPENDENCIES += libopenssl
@@ -105,6 +96,19 @@ ifeq ($(BR2_PACKAGE_HOSTAPD_VLAN_NETLINK),y)
HOSTAPD_CONFIG_ENABLE += CONFIG_VLAN_NETLINK
endif
+# Options for building with libnl
+ifeq ($(BR2_PACKAGE_LIBNL),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] 11+ messages in thread
* [Buildroot] [PATCH 3/3] hostapd: drop default dependency on netlink
2017-12-30 15:57 ` [Buildroot] [PATCH 3/3] hostapd: drop default dependency on netlink Alexander Mukhin
@ 2018-02-06 14:23 ` Sam Voss
0 siblings, 0 replies; 11+ messages in thread
From: Sam Voss @ 2018-02-06 14:23 UTC (permalink / raw)
To: buildroot
On Sat, Dec 30, 2017 at 4:57 PM, Alexander Mukhin
<alexander.i.mukhin@gmail.com> wrote:
> Get rid of netlink dependency if the options selected allow that.
>
> Signed-off-by: Alexander Mukhin <alexander.i.mukhin@gmail.com>
Reviewed-by: Sam Voss <sam.voss@rockwellcollins.com>
> ---
> package/hostapd/Config.in | 17 +++++++++++------
> package/hostapd/hostapd.mk | 28 ++++++++++++++++------------
> 2 files changed, 27 insertions(+), 18 deletions(-)
>
> diff --git a/package/hostapd/Config.in b/package/hostapd/Config.in
> index d23e5e1dca..d60ed08cd6 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.
>
> @@ -24,10 +22,15 @@ 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
> select BR2_PACKAGE_HOSTAPD_HAS_WIFI_DRIVERS
> 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"
> select BR2_PACKAGE_HOSTAPD_HAS_WIFI_DRIVERS
> @@ -97,12 +100,14 @@ 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_PACKAGE_HOSTAPD_VLAN
> 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 f9072784eb..fa8226805d 100644
> --- a/package/hostapd/hostapd.mk
> +++ b/package/hostapd/hostapd.mk
> @@ -11,25 +11,16 @@ 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 =
>
> -HOSTAPD_CONFIG_ENABLE = \
> - CONFIG_INTERNAL_LIBTOMMATH \
> - CONFIG_LIBNL32
> +HOSTAPD_CONFIG_ENABLE = CONFIG_INTERNAL_LIBTOMMATH
>
> 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
> -
> # Try to use openssl if it's already available
> ifeq ($(BR2_PACKAGE_LIBOPENSSL),y)
> HOSTAPD_DEPENDENCIES += libopenssl
> @@ -105,6 +96,19 @@ ifeq ($(BR2_PACKAGE_HOSTAPD_VLAN_NETLINK),y)
> HOSTAPD_CONFIG_ENABLE += CONFIG_VLAN_NETLINK
> endif
>
> +# Options for building with libnl
> +ifeq ($(BR2_PACKAGE_LIBNL),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
>
> _______________________________________________
> buildroot mailing list
> buildroot at busybox.net
> http://lists.busybox.net/mailman/listinfo/buildroot
^ permalink raw reply [flat|nested] 11+ messages in thread
* [Buildroot] [PATCH 0/3] hostapd: driver selection options
2017-12-30 15:57 [Buildroot] [PATCH 0/3] hostapd: driver selection options Alexander Mukhin
` (2 preceding siblings ...)
2017-12-30 15:57 ` [Buildroot] [PATCH 3/3] hostapd: drop default dependency on netlink Alexander Mukhin
@ 2018-02-06 14:11 ` Bryce Ferguson
2018-04-02 16:33 ` Thomas Petazzoni
4 siblings, 0 replies; 11+ messages in thread
From: Bryce Ferguson @ 2018-02-06 14:11 UTC (permalink / raw)
To: buildroot
+Sam
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.busybox.net/pipermail/buildroot/attachments/20180206/e28f5ebb/attachment.html>
^ permalink raw reply [flat|nested] 11+ messages in thread* [Buildroot] [PATCH 0/3] hostapd: driver selection options
2017-12-30 15:57 [Buildroot] [PATCH 0/3] hostapd: driver selection options Alexander Mukhin
` (3 preceding siblings ...)
2018-02-06 14:11 ` [Buildroot] [PATCH 0/3] hostapd: driver selection options Bryce Ferguson
@ 2018-04-02 16:33 ` Thomas Petazzoni
4 siblings, 0 replies; 11+ messages in thread
From: Thomas Petazzoni @ 2018-04-02 16:33 UTC (permalink / raw)
To: buildroot
Hello,
On Sat, 30 Dec 2017 18:57:33 +0300, Alexander Mukhin wrote:
> Alexander Mukhin (3):
> hostapd: select driver support
> hostapd: make ACS dependent on nl80211
> hostapd: drop default dependency on netlink
Series applied, thanks. On the last patch, we just did a minor tweak to
use a if BR2_PACKAGE_HOSTAPD_VLAN ... endif block instead of
duplicating the depends on dependency.
Best regards,
Thomas
--
Thomas Petazzoni, CTO, Bootlin (formerly Free Electrons)
Embedded Linux and Kernel engineering
https://bootlin.com
^ permalink raw reply [flat|nested] 11+ messages in thread