[RFC 2/3] wpa_supplicant: Add freq_to_channel utility function
Sun Jul 17 00:20:30 PDT 2011
On Sun, Jul 17, 2011 at 11:36:06AM +0530, Rajkumar Manoharan wrote:
> This patch defines freq_to_channel utility function that returns
> regulatory class, channel number and band for the given frequency.
> diff --git a/src/drivers/nl80211_copy.h b/src/drivers/nl80211_copy.h
> - * enum nl80211_band - Frequency band
> - * @NL80211_BAND_2GHZ: 2.4 GHz ISM band
This file is a copy of a header file from the Linux kernel and it must
not be edited within hostap.git.
> diff --git a/src/utils/common.c b/src/utils/common.c
> +enum nl80211_band freq_to_channel(int freq, u8 *reg_class,
> + u8 *channel)
No nl80211 definitions should be used outside
src/drivers/driver_nl80211.c, i.e., you will need to define a driver
independent way of doing this (just a new enum). Please also note that
this function returns an undefined value if freq is not recognized. It
would be better to return an explicit error value instead (and that will
be trivial with the nl80211_band replaced).
Jouni Malinen PGP id EFC895FA
More information about the Hostap