linux/drivers/net/wireless/ath/regd.c

/*
 * Copyright (c) 2008-2009 Atheros Communications Inc.
 *
 * Permission to use, copy, modify, and/or distribute this software for any
 * purpose with or without fee is hereby granted, provided that the above
 * copyright notice and this permission notice appear in all copies.
 *
 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
 * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
 * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
 * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
 * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
 * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
 * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
 */

#define pr_fmt(fmt)

#include <linux/kernel.h>
#include <linux/export.h>
#include <net/cfg80211.h>
#include <net/mac80211.h>
#include "regd.h"
#include "regd_common.h"

static int __ath_regd_init(struct ath_regulatory *reg);

/*
 * This is a set of common rules used by our world regulatory domains.
 * We have 12 world regulatory domains. To save space we consolidate
 * the regulatory domains in 5 structures by frequency and change
 * the flags on our reg_notifier() on a case by case basis.
 */

/* Only these channels all allow active scan on all world regulatory domains */
#define ATH_2GHZ_CH01_11

/* We enable active scan on these a case by case basis by regulatory domain */
#define ATH_2GHZ_CH12_13
#define ATH_2GHZ_CH14

/* We allow IBSS on these on a case by case basis by regulatory domain */
#define ATH_5GHZ_5150_5350
#define ATH_5GHZ_5470_5850
#define ATH_5GHZ_5725_5850

#define ATH_2GHZ_ALL

#define ATH_5GHZ_ALL

/* This one skips what we call "mid band" */
#define ATH_5GHZ_NO_MIDBAND

/* Can be used for:
 * 0x60, 0x61, 0x62 */
static const struct ieee80211_regdomain ath_world_regdom_60_61_62 =;

/* Can be used by 0x63 and 0x65 */
static const struct ieee80211_regdomain ath_world_regdom_63_65 =;

/* Can be used by 0x64 only */
static const struct ieee80211_regdomain ath_world_regdom_64 =;

/* Can be used by 0x66 and 0x69 */
static const struct ieee80211_regdomain ath_world_regdom_66_69 =;

/* Can be used by 0x67, 0x68, 0x6A and 0x6C */
static const struct ieee80211_regdomain ath_world_regdom_67_68_6A_6C =;

static bool dynamic_country_user_possible(struct ath_regulatory *reg)
{}

static bool ath_reg_dyn_country_user_allow(struct ath_regulatory *reg)
{}

static inline bool is_wwr_sku(u16 regd)
{}

static u16 ath_regd_get_eepromRD(struct ath_regulatory *reg)
{}

bool ath_is_world_regd(struct ath_regulatory *reg)
{}
EXPORT_SYMBOL();

static const struct ieee80211_regdomain *ath_default_world_regdomain(void)
{}

static const struct
ieee80211_regdomain *ath_world_regdomain(struct ath_regulatory *reg)
{}

bool ath_is_49ghz_allowed(u16 regdomain)
{}
EXPORT_SYMBOL();

/* Frequency is one where radar detection is required */
static bool ath_is_radar_freq(u16 center_freq,
			      struct ath_regulatory *reg)

{}

static void ath_force_clear_no_ir_chan(struct wiphy *wiphy,
				       struct ieee80211_channel *ch)
{}

static void ath_force_clear_no_ir_freq(struct wiphy *wiphy, u16 center_freq)
{}

static void ath_force_no_ir_chan(struct ieee80211_channel *ch)
{}

static void ath_force_no_ir_freq(struct wiphy *wiphy, u16 center_freq)
{}

static void
__ath_reg_apply_beaconing_flags(struct wiphy *wiphy,
				struct ath_regulatory *reg,
				enum nl80211_reg_initiator initiator,
				struct ieee80211_channel *ch)
{}

/*
 * These exception rules do not apply radar frequencies.
 *
 * - We enable initiating radiation if the country IE says its fine:
 * - If no country IE has been processed and a we determine we have
 *   received a beacon on a channel we can enable initiating radiation.
 */
static void
ath_reg_apply_beaconing_flags(struct wiphy *wiphy,
			      struct ath_regulatory *reg,
			      enum nl80211_reg_initiator initiator)
{}

/**
 * ath_reg_apply_ir_flags()
 * @wiphy: the wiphy to use
 * @reg: regulatory structure - used for country selection
 * @initiator: the regulatory hint initiator
 *
 * If no country IE has been received always enable passive scan
 * and no-ibss on these channels. This is only done for specific
 * regulatory SKUs.
 *
 * If a country IE has been received check its rule for this
 * channel first before enabling active scan. The passive scan
 * would have been enforced by the initial processing of our
 * custom regulatory domain.
 */
static void
ath_reg_apply_ir_flags(struct wiphy *wiphy,
		       struct ath_regulatory *reg,
		       enum nl80211_reg_initiator initiator)
{}

/* Always apply Radar/DFS rules on freq range 5500 MHz - 5700 MHz */
static void ath_reg_apply_radar_flags(struct wiphy *wiphy,
				      struct ath_regulatory *reg)
{}

static void ath_reg_apply_world_flags(struct wiphy *wiphy,
				      enum nl80211_reg_initiator initiator,
				      struct ath_regulatory *reg)
{}

u16 ath_regd_find_country_by_name(char *alpha2)
{}
EXPORT_SYMBOL();

static int __ath_reg_dyn_country(struct wiphy *wiphy,
				 struct ath_regulatory *reg,
				 struct regulatory_request *request)
{}

static void ath_reg_dyn_country(struct wiphy *wiphy,
				struct ath_regulatory *reg,
				struct regulatory_request *request)
{}

void ath_reg_notifier_apply(struct wiphy *wiphy,
			    struct regulatory_request *request,
			    struct ath_regulatory *reg)
{}
EXPORT_SYMBOL();

static bool ath_regd_is_eeprom_valid(struct ath_regulatory *reg)
{}

/* EEPROM country code to regpair mapping */
static struct country_code_to_enum_rd*
ath_regd_find_country(u16 countryCode)
{}

/* EEPROM rd code to regpair mapping */
static struct country_code_to_enum_rd*
ath_regd_find_country_by_rd(int regdmn)
{}

/* Returns the map of the EEPROM set RD to a country code */
static u16 ath_regd_get_default_country(u16 rd)
{}

static struct reg_dmn_pair_mapping*
ath_get_regpair(int regdmn)
{}

static int
ath_regd_init_wiphy(struct ath_regulatory *reg,
		    struct wiphy *wiphy,
		    void (*reg_notifier)(struct wiphy *wiphy,
					 struct regulatory_request *request))
{}

/*
 * Some users have reported their EEPROM programmed with
 * 0x8000 set, this is not a supported regulatory domain
 * but since we have more than one user with it we need
 * a solution for them. We default to 0x64, which is the
 * default Atheros world regulatory domain.
 */
static void ath_regd_sanitize(struct ath_regulatory *reg)
{}

static int __ath_regd_init(struct ath_regulatory *reg)
{}

int
ath_regd_init(struct ath_regulatory *reg,
	      struct wiphy *wiphy,
	      void (*reg_notifier)(struct wiphy *wiphy,
				   struct regulatory_request *request))
{}
EXPORT_SYMBOL();

u32 ath_regd_get_band_ctl(struct ath_regulatory *reg,
			  enum nl80211_band band)
{}
EXPORT_SYMBOL();