[PATCH v3] hostap: Support ht-cap over-rides.

Jouni Malinen j
Sun Dec 18 10:49:27 PST 2011


On Tue, Nov 22, 2011 at 12:37:40PM -0800, greearb at candelatech.com wrote:
> This allows ht-capabilities over-rides on kernels that
> support these features.

> diff --git a/src/drivers/driver.h b/src/drivers/driver.h
> @@ -26,6 +26,7 @@
> +#include "common/ieee802_11_defs.h"

I would prefer to not do this. driver.h tries to live mostly on its own
without pulling in many of the header files. Some driver wrappers live
outside the main hostap.git repository and the less dependencies there
are between them and some header files I consider more internal to the
core hostapd/wpa_supplicant, the better in general.

> @@ -516,6 +517,21 @@ struct wpa_driver_associate_params {
> +#ifdef CONFIG_HT_OVERRIDES
> +	struct ieee80211_ht_capabilities htcaps;
> +	struct ieee80211_ht_capabilities htcaps_mask;
> +#endif

i.e., these could be just const u8 *htcaps, *htcaps_mask and I would
drop the #ifdef from this case to keep driver.h API more independent of
the build configuration.


> diff --git a/src/drivers/driver_nl80211.c b/src/drivers/driver_nl80211.c
> index 7943595..9b8df69 100644
> --- a/src/drivers/driver_nl80211.c
> +++ b/src/drivers/driver_nl80211.c
> @@ -5617,6 +5617,16 @@ skip_auth_type:
> +#ifdef CONFIG_HT_OVERRIDES
> +	if (params->disable_ht)
> +		NLA_PUT_FLAG(msg, NL80211_ATTR_DISABLE_HT);
> +
> +	NLA_PUT(msg, NL80211_ATTR_HT_CAPABILITY, sizeof(params->htcaps),
> +		&params->htcaps);
> +	NLA_PUT(msg, NL80211_ATTR_HT_CAPABILITY_MASK, sizeof(params->htcaps_mask),
> +		&params->htcaps_mask);
> +#endif

I would drop the ifdef once params->htcaps != NULL can be used to see
whether the value is set. Obviously, same for
wpa_driver_nl80211_associate().


> diff --git a/src/drivers/nl80211_copy.h b/src/drivers/nl80211_copy.h

No need to include nl80211_copy.h changes in submissions. I'll sync this
directly with wireless-testing.git anyway.

> diff --git a/wpa_supplicant/config.c b/wpa_supplicant/config.c
> index b446a3f..35f446d 100644
> --- a/wpa_supplicant/config.c
> +++ b/wpa_supplicant/config.c
> @@ -1864,6 +1875,14 @@ void wpa_config_set_network_defaults(struct wpa_ssid *ssid)
> +#ifdef CONFIG_HT_OVERRIDES
> +	ssid->ht_mcs = strdup("");

Why? Wouldn't NULL work here?

> diff --git a/wpa_supplicant/wpa_supplicant.c b/wpa_supplicant/wpa_supplicant.c
> index 2b3140e..ceee620 100644
> --- a/wpa_supplicant/wpa_supplicant.c
> +++ b/wpa_supplicant/wpa_supplicant.c
> @@ -2165,6 +2167,163 @@ static struct wpa_supplicant * wpa_supplicant_alloc(void)
> +#ifdef CONFIG_HT_OVERRIDES
> +int wpa_set_htcap_mcs(struct wpa_supplicant *wpa_s,
> +int wpa_disable_max_amsdu(struct wpa_supplicant *wpa_s,
> +int wpa_set_ampdu_factor(struct wpa_supplicant *wpa_s,
> +int wpa_set_ampdu_density(struct wpa_supplicant *wpa_s,
> +int wpa_set_disable_ht40(struct wpa_supplicant *wpa_s,

Shouldn't these be static? Only the following
wpa_supplicant_apply_ht_overrides() calls them.

> diff --git a/wpa_supplicant/wpa_supplicant_i.h b/wpa_supplicant/wpa_supplicant_i.h
> @@ -36,6 +36,8 @@ struct scan_info;
> +struct ieee80211_ht_capabilities;

Should be able to drop that with these functions becoming static and
going away from this header file:

> @@ -514,6 +516,31 @@ struct wpa_supplicant {
> +#ifdef CONFIG_HT_OVERRIDES
> +int wpa_set_htcap_mcs(struct wpa_supplicant *wpa_s,
> +		      struct ieee80211_ht_capabilities *htcaps,
> +		      struct ieee80211_ht_capabilities *htcaps_mask,
> +		      const char *ht_mcs);
> +int wpa_disable_max_amsdu(struct wpa_supplicant *wpa_s,
> +			  struct ieee80211_ht_capabilities *htcaps,
> +			  struct ieee80211_ht_capabilities *htcaps_mask,
> +			  int disabled);
> +int wpa_set_ampdu_factor(struct wpa_supplicant *wpa_s,
> +			 struct ieee80211_ht_capabilities *htcaps,
> +			 struct ieee80211_ht_capabilities *htcaps_mask,
> +			 int factor);
> +int wpa_set_ampdu_density(struct wpa_supplicant *wpa_s,
> +			  struct ieee80211_ht_capabilities *htcaps,
> +			  struct ieee80211_ht_capabilities *htcaps_mask,
> +			  int density);
> +int wpa_set_disable_ht40(struct wpa_supplicant *wpa_s,
> +			 struct ieee80211_ht_capabilities *htcaps,
> +			 struct ieee80211_ht_capabilities *htcaps_mask,
> +			 int disabled);
> +#endif

-- 
Jouni Malinen                                            PGP id EFC895FA



More information about the Hostap mailing list