kfree(wlc_cm);
}
-const char *wlc_channel_country_abbrev(wlc_cm_info_t *wlc_cm)
-{
- return wlc_cm->country_abbrev;
-}
-
-u8 wlc_channel_locale_flags(wlc_cm_info_t *wlc_cm)
-{
- struct wlc_info *wlc = wlc_cm->wlc;
-
- return wlc_cm->bandstate[wlc->band->bandunit].locale_flags;
-}
-
u8 wlc_channel_locale_flags_in_band(wlc_cm_info_t *wlc_cm, uint bandunit)
{
return wlc_cm->bandstate[bandunit].locale_flags;
}
-/* return chanvec for a given country code and band */
-bool
-wlc_channel_get_chanvec(struct wlc_info *wlc, const char *country_abbrev,
- int bandtype, chanvec_t *channels)
-{
- const country_info_t *country;
- const locale_info_t *locale = NULL;
-
- country = wlc_country_lookup(wlc, country_abbrev);
- if (country == NULL)
- return false;
-
- if (bandtype == WLC_BAND_2G)
- locale = wlc_get_locale_2g(country->locale_2G);
- else if (bandtype == WLC_BAND_5G)
- locale = wlc_get_locale_5g(country->locale_5G);
- if (locale == NULL)
- return false;
-
- wlc_locale_get_channels(locale, channels);
- return true;
-}
-
/* set the driver's current country and regulatory information using a country code
* as the source. Lookup built in country information found with the country code.
*/
val));
}
-/* Is the 40 MHz allowed for the current locale and specified band? */
-bool wlc_valid_40chanspec_in_band(wlc_cm_info_t *wlc_cm, uint bandunit)
-{
- struct wlc_info *wlc = wlc_cm->wlc;
-
- return (((wlc_cm->bandstate[bandunit].
- locale_flags & (WLC_NO_MIMO | WLC_NO_40MHZ)) == 0)
- && wlc->bandstate[bandunit]->mimo_cap_40);
-}
-
static void
wlc_channel_min_txpower_limits_with_local_constraint(wlc_cm_info_t *wlc_cm,
struct txpwr_limits *txpwr,
&txpwr);
}
-int
-wlc_channel_set_txpower_limit(wlc_cm_info_t *wlc_cm,
- u8 local_constraint_qdbm)
-{
- struct wlc_info *wlc = wlc_cm->wlc;
- struct txpwr_limits txpwr;
-
- wlc_channel_reg_limits(wlc_cm, wlc->chanspec, &txpwr);
-
- wlc_channel_min_txpower_limits_with_local_constraint(wlc_cm, &txpwr,
- local_constraint_qdbm);
-
- wlc_phy_txpower_limit_set(wlc->band->pi, &txpwr, wlc->chanspec);
-
- return 0;
-}
-
#ifdef POWER_DBG
static void wlc_phy_txpower_limits_dump(txpwr_limits_t *txpwr)
{
return false;
}
-bool wlc_valid_chanspec(wlc_cm_info_t *wlc_cm, chanspec_t chspec)
-{
- return wlc_valid_chanspec_ext(wlc_cm, chspec, false);
-}
-
bool wlc_valid_chanspec_db(wlc_cm_info_t *wlc_cm, chanspec_t chspec)
{
return wlc_valid_chanspec_ext(wlc_cm, chspec, true);
const char *country_abbrev,
const char *ccode, int regrev);
-extern const char *wlc_channel_country_abbrev(wlc_cm_info_t *wlc_cm);
-extern u8 wlc_channel_locale_flags(wlc_cm_info_t *wlc_cm);
extern u8 wlc_channel_locale_flags_in_band(wlc_cm_info_t *wlc_cm,
uint bandunit);
#define VALID_CHANNEL20_IN_BAND(wlc, bandunit, val) \
wlc_valid_channel20_in_band((wlc)->cmi, bandunit, val)
#define VALID_CHANNEL20(wlc, val) wlc_valid_channel20((wlc)->cmi, val)
-#define VALID_40CHANSPEC_IN_BAND(wlc, bandunit) wlc_valid_40chanspec_in_band((wlc)->cmi, bandunit)
-extern bool wlc_valid_chanspec(wlc_cm_info_t *wlc_cm, chanspec_t chspec);
extern bool wlc_valid_chanspec_db(wlc_cm_info_t *wlc_cm, chanspec_t chspec);
extern bool wlc_valid_channel20_db(wlc_cm_info_t *wlc_cm, uint val);
extern bool wlc_valid_channel20_in_band(wlc_cm_info_t *wlc_cm, uint bandunit,
uint val);
extern bool wlc_valid_channel20(wlc_cm_info_t *wlc_cm, uint val);
-extern bool wlc_valid_40chanspec_in_band(wlc_cm_info_t *wlc_cm, uint bandunit);
extern void wlc_channel_reg_limits(wlc_cm_info_t *wlc_cm,
chanspec_t chanspec,
extern void wlc_channel_set_chanspec(wlc_cm_info_t *wlc_cm,
chanspec_t chanspec,
u8 local_constraint_qdbm);
-extern int wlc_channel_set_txpower_limit(wlc_cm_info_t *wlc_cm,
- u8 local_constraint_qdbm);
extern const country_info_t *wlc_country_lookup(struct wlc_info *wlc,
const char *ccode);
extern bool wlc_japan(struct wlc_info *wlc);
extern u8 wlc_get_regclass(wlc_cm_info_t *wlc_cm, chanspec_t chanspec);
-extern bool wlc_channel_get_chanvec(struct wlc_info *wlc,
- const char *country_abbrev, int bandtype,
- chanvec_t *channels);
#endif /* _WLC_CHANNEL_H */