[PATCH v7 3/4] hostapd: add survey dump support

Jouni Malinen j
Sun Oct 30 10:45:32 PDT 2011

On Fri, Jul 29, 2011 at 02:42:59PM -0700, Luis R. Rodriguez wrote:
> This adds survey dump support for all frequencies
> and for specific desired frequencies. This will later
> be used by ACS code for spectrum heuristics.

> diff --git a/src/drivers/driver.h b/src/drivers/driver.h
> @@ -2274,6 +2291,30 @@ struct wpa_driver_ops {
> +	/*
> +	 * get_survey - Retrieve survey data
> +	 * @priv: Private driver interface data
> +	 * @freq: if set survey data for the specified frequency is only
> +	 *	being requested. If not set all survey data is requested.
> +	 * Returns: 0 on success, -1 on failure

> +	int (*get_survey)(void *priv, unsigned int freq);

Why does this not actually return the results? It looks like the only
driver wrapper implementation of get_survey() just fetches the data and
immediately generates EVENT_SURVEY with that data.. That results in a
bit complex function call sequence without any clear benefit. Or is
there an assumption that some driver wrappers would not be able to
deliver this data immediately?

Now the results get combined in hostapd_event_get_survey() in
drv_callbacks.c even though this looks very much ACS-specific
information and all this processing would fit better in acs.c
(acs_roc_next() where hostapd_drv_get_survey() call could get the
results immediately). It would probably be cleaner to just merge patches
3 and 4 together and not try to make the survey dump support look more
generic than part of ACS. The driver_nl80211.c patch could be in a
separate patch, though.

Jouni Malinen                                            PGP id EFC895FA

More information about the Hostap mailing list