diff mbox

hostapd: Advertise OBSS scan params based on driver capability

Message ID 1399376151-12570-1-git-send-email-rmanohar@qti.qualcomm.com
State Not Applicable
Headers show

Commit Message

Rajkumar Manoharan May 6, 2014, 11:35 a.m. UTC
Advertise OBSS scan params based on driver capabilities and also
set default value for obss scan interval as defined in IEEE Std
802.11-2012, 8.4.2.61 and MIB defval.

Signed-off-by: Rajkumar Manoharan <rmanohar@qti.qualcomm.com>
---
 src/ap/ap_config.c         | 1 +
 src/ap/ieee802_11_ht.c     | 3 ++-
 src/ap/ieee802_11_shared.c | 4 ++--
 3 files changed, 5 insertions(+), 3 deletions(-)

Comments

Paul Stewart May 6, 2014, 3:02 p.m. UTC | #1
Hi Rajkumar!  This functionality was originally added in order to allow
testing of OBSS functionality in clients of the AP.  In particular, there
wasn't a built in stipulation that the AP hardware / firmware support OBSS
action frames.  I don't mind having hostapd's default behavior being
predicated on the hardware being capable -- for example, you could set
obss_interval to 300 conditional on that hardware capability, but it would
be nice to preserve the ability to manually set this interval in the
configuration file regardless of the underlying hardware capability.



On Tue, May 6, 2014 at 4:35 AM, Rajkumar Manoharan <
rmanohar@qti.qualcomm.com> wrote:

> Advertise OBSS scan params based on driver capabilities and also
> set default value for obss scan interval as defined in IEEE Std
> 802.11-2012, 8.4.2.61 and MIB defval.
>
> Signed-off-by: Rajkumar Manoharan <rmanohar@qti.qualcomm.com>
> ---
>  src/ap/ap_config.c         | 1 +
>  src/ap/ieee802_11_ht.c     | 3 ++-
>  src/ap/ieee802_11_shared.c | 4 ++--
>  3 files changed, 5 insertions(+), 3 deletions(-)
>
> diff --git a/src/ap/ap_config.c b/src/ap/ap_config.c
> index 9680817..64c9795 100644
> --- a/src/ap/ap_config.c
> +++ b/src/ap/ap_config.c
> @@ -169,6 +169,7 @@ struct hostapd_config * hostapd_config_defaults(void)
>         conf->tx_queue[3] = txq_bk;
>
>         conf->ht_capab = HT_CAP_INFO_SMPS_DISABLED;
> +       conf->obss_interval = 300;
>
>         conf->ap_table_max_size = 255;
>         conf->ap_table_expiration_time = 60;
> diff --git a/src/ap/ieee802_11_ht.c b/src/ap/ieee802_11_ht.c
> index c0a7cd4..7020858 100644
> --- a/src/ap/ieee802_11_ht.c
> +++ b/src/ap/ieee802_11_ht.c
> @@ -46,7 +46,8 @@ u8 * hostapd_eid_ht_capabilities(struct hostapd_data
> *hapd, u8 *eid)
>
>         pos += sizeof(*cap);
>
> -       if (hapd->iconf->obss_interval) {
> +       if (hapd->iconf->obss_interval &&
> +           (hapd->iface->drv_flags & WPA_DRIVER_FLAGS_HT_2040_COEX)) {
>                 struct ieee80211_obss_scan_parameters *scan_params;
>
>                 *pos++ = WLAN_EID_OVERLAPPING_BSS_SCAN_PARAMS;
> diff --git a/src/ap/ieee802_11_shared.c b/src/ap/ieee802_11_shared.c
> index 12403f9..2755528 100644
> --- a/src/ap/ieee802_11_shared.c
> +++ b/src/ap/ieee802_11_shared.c
> @@ -170,7 +170,7 @@ static void hostapd_ext_capab_byte(struct hostapd_data
> *hapd, u8 *pos, int idx)
>
>         switch (idx) {
>         case 0: /* Bits 0-7 */
> -               if (hapd->iconf->obss_interval)
> +               if (hapd->iface->drv_flags & WPA_DRIVER_FLAGS_HT_2040_COEX)
>                         *pos |= 0x01; /* Bit 0 - Coexistence management */
>                 break;
>         case 1: /* Bits 8-15 */
> @@ -225,7 +225,7 @@ u8 * hostapd_eid_ext_capab(struct hostapd_data *hapd,
> u8 *eid)
>                 len = 4;
>         if (len < 3 && hapd->conf->wnm_sleep_mode)
>                 len = 3;
> -       if (len < 1 && hapd->iconf->obss_interval)
> +       if (len < 1 && (hapd->iface->drv_flags &
> WPA_DRIVER_FLAGS_HT_2040_COEX))
>                 len = 1;
>         if (len < 7 && hapd->conf->ssid.utf8_ssid)
>                 len = 7;
> --
> 1.9.2
>
> _______________________________________________
> HostAP mailing list
> HostAP@lists.shmoo.com
> http://lists.shmoo.com/mailman/listinfo/hostap
>
Rajkumar Manoharan May 6, 2014, 4:32 p.m. UTC | #2
On Tue, May 06, 2014 at 08:02:49AM -0700, Paul Stewart wrote:
>    Hi Rajkumar!  This functionality was originally added in order to allow
>    testing of OBSS functionality in clients of the AP.  In particular, there
>    wasn't a built in stipulation that the AP hardware / firmware support OBSS
>    action frames.  I don't mind having hostapd's default behavior being
>    predicated on the hardware being capable -- for example, you could set
>    obss_interval to 300 conditional on that hardware capability, but it would
>    be nice to preserve the ability to manually set this interval in the
>    configuration file regardless of the underlying hardware capability.
>
Paul,

Still it allows the user to overwrite obss_interval manually by config_file.

>      diff --git a/src/ap/ieee802_11_ht.c b/src/ap/ieee802_11_ht.c
>      index c0a7cd4..7020858 100644
>      --- a/src/ap/ieee802_11_ht.c
>      +++ b/src/ap/ieee802_11_ht.c
>      @@ -46,7 +46,8 @@ u8 * hostapd_eid_ht_capabilities(struct hostapd_data
>      *hapd, u8 *eid)
> 
>              pos += sizeof(*cap);
> 
>      -       if (hapd->iconf->obss_interval) {
>      +       if (hapd->iconf->obss_interval &&
>      +           (hapd->iface->drv_flags & WPA_DRIVER_FLAGS_HT_2040_COEX)) {
>                      struct ieee80211_obss_scan_parameters *scan_params;
>

Since AP side functionalities are recently added, OBSS scan trigger
interval is assigned with default and obss IE will be appended in beacon/probe resp
based on driver capabilities. Earlier the OBSS IE is added if obss_interval is
non-zero eventhough the driver does not support OBSS funtionalities.

Both station and AP mode 20/40 coex functionalities are validated in ath9k driver.

-Rajkumar
Paul Stewart May 6, 2014, 4:49 p.m. UTC | #3
On Tue, May 6, 2014 at 9:32 AM, Rajkumar Manoharan <
rmanohar@qti.qualcomm.com> wrote:

> On Tue, May 06, 2014 at 08:02:49AM -0700, Paul Stewart wrote:
> >    Hi Rajkumar!  This functionality was originally added in order to
> allow
> >    testing of OBSS functionality in clients of the AP.  In particular,
> there
> >    wasn't a built in stipulation that the AP hardware / firmware support
> OBSS
> >    action frames.  I don't mind having hostapd's default behavior being
> >    predicated on the hardware being capable -- for example, you could set
> >    obss_interval to 300 conditional on that hardware capability, but it
> would
> >    be nice to preserve the ability to manually set this interval in the
> >    configuration file regardless of the underlying hardware capability.
> >
> Paul,
>
> Still it allows the user to overwrite obss_interval manually by
> config_file.
>
> >      diff --git a/src/ap/ieee802_11_ht.c b/src/ap/ieee802_11_ht.c
> >      index c0a7cd4..7020858 100644
> >      --- a/src/ap/ieee802_11_ht.c
> >      +++ b/src/ap/ieee802_11_ht.c
> >      @@ -46,7 +46,8 @@ u8 * hostapd_eid_ht_capabilities(struct
> hostapd_data
> >      *hapd, u8 *eid)
> >
> >              pos += sizeof(*cap);
> >
> >      -       if (hapd->iconf->obss_interval) {
> >      +       if (hapd->iconf->obss_interval &&
> >      +           (hapd->iface->drv_flags &
> WPA_DRIVER_FLAGS_HT_2040_COEX)) {
>

This is an example of the concern I was bringing up.  This conditional will
trigger only if the driver flags contain  WPA_DRIVER_FLAGS_HT_2040_COEX.
 I'd like to be able to include this IE for testing purposes even if the
driver doesn't support this flag.

>                      struct ieee80211_obss_scan_parameters *scan_params;
> >
>
> Since AP side functionalities are recently added, OBSS scan trigger
> interval is assigned with default and obss IE will be appended in
> beacon/probe resp
> based on driver capabilities. Earlier the OBSS IE is added if
> obss_interval is
> non-zero eventhough the driver does not support OBSS funtionalities.
>
> Both station and AP mode 20/40 coex functionalities are validated in ath9k
> driver.
>
> -Rajkumar
> _______________________________________________
> HostAP mailing list
> HostAP@lists.shmoo.com
> http://lists.shmoo.com/mailman/listinfo/hostap
>
Rajkumar Manoharan May 6, 2014, 6:52 p.m. UTC | #4
On Tue, May 06, 2014 at 09:49:57AM -0700, Paul Stewart wrote:
>    On Tue, May 6, 2014 at 9:32 AM, Rajkumar Manoharan
>    <rmanohar@qti.qualcomm.com> wrote:
> 
>      On Tue, May 06, 2014 at 08:02:49AM -0700, Paul Stewart wrote:
>      >      diff --git a/src/ap/ieee802_11_ht.c b/src/ap/ieee802_11_ht.c
>      >      index c0a7cd4..7020858 100644
>      >      --- a/src/ap/ieee802_11_ht.c
>      >      +++ b/src/ap/ieee802_11_ht.c
>      >      @@ -46,7 +46,8 @@ u8 * hostapd_eid_ht_capabilities(struct
>      hostapd_data
>      >      *hapd, u8 *eid)
>      >
>      >              pos += sizeof(*cap);
>      >
>      >      -       if (hapd->iconf->obss_interval) {
>      >      +       if (hapd->iconf->obss_interval &&
>      >      +           (hapd->iface->drv_flags &
>      WPA_DRIVER_FLAGS_HT_2040_COEX)) {
> 
>    This is an example of the concern I was bringing up.  This conditional
>    will trigger only if the driver flags contain
>     WPA_DRIVER_FLAGS_HT_2040_COEX.  I'd like to be able to include this IE
>    for testing purposes even if the driver doesn't support this flag.
Hmm... I am not sure whether it is correct to set default based on
device capability. For WFA testing, there is no configuration steps for OBSS
scan interval and the expectation is that AP should advertise OBSS scan
param by default.

-Rajkumar
Paul Stewart May 6, 2014, 8:05 p.m. UTC | #5
On Tue, May 6, 2014 at 11:52 AM, Rajkumar Manoharan <
rmanohar@qti.qualcomm.com> wrote:

> On Tue, May 06, 2014 at 09:49:57AM -0700, Paul Stewart wrote:
> >    On Tue, May 6, 2014 at 9:32 AM, Rajkumar Manoharan
> >    <rmanohar@qti.qualcomm.com> wrote:
> >
> >      On Tue, May 06, 2014 at 08:02:49AM -0700, Paul Stewart wrote:
> >      >      diff --git a/src/ap/ieee802_11_ht.c b/src/ap/ieee802_11_ht.c
> >      >      index c0a7cd4..7020858 100644
> >      >      --- a/src/ap/ieee802_11_ht.c
> >      >      +++ b/src/ap/ieee802_11_ht.c
> >      >      @@ -46,7 +46,8 @@ u8 * hostapd_eid_ht_capabilities(struct
> >      hostapd_data
> >      >      *hapd, u8 *eid)
> >      >
> >      >              pos += sizeof(*cap);
> >      >
> >      >      -       if (hapd->iconf->obss_interval) {
> >      >      +       if (hapd->iconf->obss_interval &&
> >      >      +           (hapd->iface->drv_flags &
> >      WPA_DRIVER_FLAGS_HT_2040_COEX)) {
> >
> >    This is an example of the concern I was bringing up.  This conditional
> >    will trigger only if the driver flags contain
> >     WPA_DRIVER_FLAGS_HT_2040_COEX.  I'd like to be able to include this
> IE
> >    for testing purposes even if the driver doesn't support this flag.
> Hmm... I am not sure whether it is correct to set default based on
> device capability. For WFA testing, there is no configuration steps for
> OBSS
> scan interval and the expectation is that AP should advertise OBSS scan
> param by default.
>

I don't care so much what behavior is set by default.  I would just like
the ability to set it as necessary.  I don't mind that hostapd's default
behavior might be tuned to perform to WFA's specifications.  I just want to
be able to do my tests as well.  For example, there could be a special
value that obss_interval defaults to, which implies "defined by hardware
capability".  The config file can either disable OBSS by setting the value
explicitly to zero, or force OBSS by setting it to a non-zero value.


> -Rajkumar
> _______________________________________________
> HostAP mailing list
> HostAP@lists.shmoo.com
> http://lists.shmoo.com/mailman/listinfo/hostap
>
Rajkumar Manoharan May 7, 2014, 2:51 a.m. UTC | #6
On Tue, May 06, 2014 at 01:05:54PM -0700, Paul Stewart wrote:
>    On Tue, May 6, 2014 at 11:52 AM, Rajkumar Manoharan
>    <rmanohar@qti.qualcomm.com> wrote:
> 
>      On Tue, May 06, 2014 at 09:49:57AM -0700, Paul Stewart wrote:
>      >    On Tue, May 6, 2014 at 9:32 AM, Rajkumar Manoharan
>      >    <rmanohar@qti.qualcomm.com> wrote:
>      >
>      >      On Tue, May 06, 2014 at 08:02:49AM -0700, Paul Stewart wrote:
>      >      >      diff --git a/src/ap/ieee802_11_ht.c
>      b/src/ap/ieee802_11_ht.c
>      >      >      index c0a7cd4..7020858 100644
>      >      >      --- a/src/ap/ieee802_11_ht.c
>      >      >      +++ b/src/ap/ieee802_11_ht.c
>      >      >      @@ -46,7 +46,8 @@ u8 * hostapd_eid_ht_capabilities(struct
>      >      hostapd_data
>      >      >      *hapd, u8 *eid)
>      >      >
>      >      >              pos += sizeof(*cap);
>      >      >
>      >      >      -       if (hapd->iconf->obss_interval) {
>      >      >      +       if (hapd->iconf->obss_interval &&
>      >      >      +           (hapd->iface->drv_flags &
>      >      WPA_DRIVER_FLAGS_HT_2040_COEX)) {
>      >
>      >    This is an example of the concern I was bringing up.  This
>      conditional
>      >    will trigger only if the driver flags contain
>      >     WPA_DRIVER_FLAGS_HT_2040_COEX.  I'd like to be able to include
>      this IE
>      >    for testing purposes even if the driver doesn't support this flag.
>      Hmm... I am not sure whether it is correct to set default based on
>      device capability. For WFA testing, there is no configuration steps for
>      OBSS
>      scan interval and the expectation is that AP should advertise OBSS scan
>      param by default.
> 
>    I don't care so much what behavior is set by default.  I would just like
>    the ability to set it as necessary.  I don't mind that hostapd's default
>    behavior might be tuned to perform to WFA's specifications.  I just want
>    to be able to do my tests as well.  For example, there could be a special
>    value that obss_interval defaults to, which implies "defined by hardware
>    capability".  The config file can either disable OBSS by setting the value
>    explicitly to zero, or force OBSS by setting it to a non-zero value.
Sounds clear. Let me drop this change. Thanks for the review.

-Rajkumar
diff mbox

Patch

diff --git a/src/ap/ap_config.c b/src/ap/ap_config.c
index 9680817..64c9795 100644
--- a/src/ap/ap_config.c
+++ b/src/ap/ap_config.c
@@ -169,6 +169,7 @@  struct hostapd_config * hostapd_config_defaults(void)
 	conf->tx_queue[3] = txq_bk;
 
 	conf->ht_capab = HT_CAP_INFO_SMPS_DISABLED;
+	conf->obss_interval = 300;
 
 	conf->ap_table_max_size = 255;
 	conf->ap_table_expiration_time = 60;
diff --git a/src/ap/ieee802_11_ht.c b/src/ap/ieee802_11_ht.c
index c0a7cd4..7020858 100644
--- a/src/ap/ieee802_11_ht.c
+++ b/src/ap/ieee802_11_ht.c
@@ -46,7 +46,8 @@  u8 * hostapd_eid_ht_capabilities(struct hostapd_data *hapd, u8 *eid)
 
  	pos += sizeof(*cap);
 
-	if (hapd->iconf->obss_interval) {
+	if (hapd->iconf->obss_interval &&
+	    (hapd->iface->drv_flags & WPA_DRIVER_FLAGS_HT_2040_COEX)) {
 		struct ieee80211_obss_scan_parameters *scan_params;
 
 		*pos++ = WLAN_EID_OVERLAPPING_BSS_SCAN_PARAMS;
diff --git a/src/ap/ieee802_11_shared.c b/src/ap/ieee802_11_shared.c
index 12403f9..2755528 100644
--- a/src/ap/ieee802_11_shared.c
+++ b/src/ap/ieee802_11_shared.c
@@ -170,7 +170,7 @@  static void hostapd_ext_capab_byte(struct hostapd_data *hapd, u8 *pos, int idx)
 
 	switch (idx) {
 	case 0: /* Bits 0-7 */
-		if (hapd->iconf->obss_interval)
+		if (hapd->iface->drv_flags & WPA_DRIVER_FLAGS_HT_2040_COEX)
 			*pos |= 0x01; /* Bit 0 - Coexistence management */
 		break;
 	case 1: /* Bits 8-15 */
@@ -225,7 +225,7 @@  u8 * hostapd_eid_ext_capab(struct hostapd_data *hapd, u8 *eid)
 		len = 4;
 	if (len < 3 && hapd->conf->wnm_sleep_mode)
 		len = 3;
-	if (len < 1 && hapd->iconf->obss_interval)
+	if (len < 1 && (hapd->iface->drv_flags & WPA_DRIVER_FLAGS_HT_2040_COEX))
 		len = 1;
 	if (len < 7 && hapd->conf->ssid.utf8_ssid)
 		len = 7;