|
@@ -16,8 +16,10 @@
|
|
|
|
|
|
#include <linux/kernel.h>
|
|
#include <linux/kernel.h>
|
|
#include <linux/slab.h>
|
|
#include <linux/slab.h>
|
|
|
|
+#include <net/cfg80211.h>
|
|
|
|
+#include <net/mac80211.h>
|
|
#include <net/wireless.h>
|
|
#include <net/wireless.h>
|
|
-#include "ath9k.h"
|
|
|
|
|
|
+#include "regd.h"
|
|
#include "regd_common.h"
|
|
#include "regd_common.h"
|
|
|
|
|
|
/*
|
|
/*
|
|
@@ -56,7 +58,7 @@
|
|
|
|
|
|
/* Can be used for:
|
|
/* Can be used for:
|
|
* 0x60, 0x61, 0x62 */
|
|
* 0x60, 0x61, 0x62 */
|
|
-static const struct ieee80211_regdomain ath9k_world_regdom_60_61_62 = {
|
|
|
|
|
|
+static const struct ieee80211_regdomain ath_world_regdom_60_61_62 = {
|
|
.n_reg_rules = 5,
|
|
.n_reg_rules = 5,
|
|
.alpha2 = "99",
|
|
.alpha2 = "99",
|
|
.reg_rules = {
|
|
.reg_rules = {
|
|
@@ -66,7 +68,7 @@ static const struct ieee80211_regdomain ath9k_world_regdom_60_61_62 = {
|
|
};
|
|
};
|
|
|
|
|
|
/* Can be used by 0x63 and 0x65 */
|
|
/* Can be used by 0x63 and 0x65 */
|
|
-static const struct ieee80211_regdomain ath9k_world_regdom_63_65 = {
|
|
|
|
|
|
+static const struct ieee80211_regdomain ath_world_regdom_63_65 = {
|
|
.n_reg_rules = 4,
|
|
.n_reg_rules = 4,
|
|
.alpha2 = "99",
|
|
.alpha2 = "99",
|
|
.reg_rules = {
|
|
.reg_rules = {
|
|
@@ -77,7 +79,7 @@ static const struct ieee80211_regdomain ath9k_world_regdom_63_65 = {
|
|
};
|
|
};
|
|
|
|
|
|
/* Can be used by 0x64 only */
|
|
/* Can be used by 0x64 only */
|
|
-static const struct ieee80211_regdomain ath9k_world_regdom_64 = {
|
|
|
|
|
|
+static const struct ieee80211_regdomain ath_world_regdom_64 = {
|
|
.n_reg_rules = 3,
|
|
.n_reg_rules = 3,
|
|
.alpha2 = "99",
|
|
.alpha2 = "99",
|
|
.reg_rules = {
|
|
.reg_rules = {
|
|
@@ -87,7 +89,7 @@ static const struct ieee80211_regdomain ath9k_world_regdom_64 = {
|
|
};
|
|
};
|
|
|
|
|
|
/* Can be used by 0x66 and 0x69 */
|
|
/* Can be used by 0x66 and 0x69 */
|
|
-static const struct ieee80211_regdomain ath9k_world_regdom_66_69 = {
|
|
|
|
|
|
+static const struct ieee80211_regdomain ath_world_regdom_66_69 = {
|
|
.n_reg_rules = 3,
|
|
.n_reg_rules = 3,
|
|
.alpha2 = "99",
|
|
.alpha2 = "99",
|
|
.reg_rules = {
|
|
.reg_rules = {
|
|
@@ -97,7 +99,7 @@ static const struct ieee80211_regdomain ath9k_world_regdom_66_69 = {
|
|
};
|
|
};
|
|
|
|
|
|
/* Can be used by 0x67, 0x6A and 0x68 */
|
|
/* Can be used by 0x67, 0x6A and 0x68 */
|
|
-static const struct ieee80211_regdomain ath9k_world_regdom_67_68_6A = {
|
|
|
|
|
|
+static const struct ieee80211_regdomain ath_world_regdom_67_68_6A = {
|
|
.n_reg_rules = 4,
|
|
.n_reg_rules = 4,
|
|
.alpha2 = "99",
|
|
.alpha2 = "99",
|
|
.reg_rules = {
|
|
.reg_rules = {
|
|
@@ -113,50 +115,53 @@ static inline bool is_wwr_sku(u16 regd)
|
|
(regd == WORLD);
|
|
(regd == WORLD);
|
|
}
|
|
}
|
|
|
|
|
|
-static u16 ath9k_regd_get_eepromRD(struct ath9k_regulatory *reg)
|
|
|
|
|
|
+static u16 ath_regd_get_eepromRD(struct ath_regulatory *reg)
|
|
{
|
|
{
|
|
return reg->current_rd & ~WORLDWIDE_ROAMING_FLAG;
|
|
return reg->current_rd & ~WORLDWIDE_ROAMING_FLAG;
|
|
}
|
|
}
|
|
|
|
|
|
-bool ath9k_is_world_regd(struct ath9k_regulatory *reg)
|
|
|
|
|
|
+bool ath_is_world_regd(struct ath_regulatory *reg)
|
|
{
|
|
{
|
|
- return is_wwr_sku(ath9k_regd_get_eepromRD(reg));
|
|
|
|
|
|
+ return is_wwr_sku(ath_regd_get_eepromRD(reg));
|
|
}
|
|
}
|
|
|
|
+EXPORT_SYMBOL(ath_is_world_regd);
|
|
|
|
|
|
-const struct ieee80211_regdomain *ath9k_default_world_regdomain(void)
|
|
|
|
|
|
+const struct ieee80211_regdomain *ath_default_world_regdomain(void)
|
|
{
|
|
{
|
|
/* this is the most restrictive */
|
|
/* this is the most restrictive */
|
|
- return &ath9k_world_regdom_64;
|
|
|
|
|
|
+ return &ath_world_regdom_64;
|
|
}
|
|
}
|
|
|
|
+EXPORT_SYMBOL(ath_default_world_regdomain);
|
|
|
|
|
|
const struct
|
|
const struct
|
|
-ieee80211_regdomain *ath9k_world_regdomain(struct ath9k_regulatory *reg)
|
|
|
|
|
|
+ieee80211_regdomain *ath_world_regdomain(struct ath_regulatory *reg)
|
|
{
|
|
{
|
|
switch (reg->regpair->regDmnEnum) {
|
|
switch (reg->regpair->regDmnEnum) {
|
|
case 0x60:
|
|
case 0x60:
|
|
case 0x61:
|
|
case 0x61:
|
|
case 0x62:
|
|
case 0x62:
|
|
- return &ath9k_world_regdom_60_61_62;
|
|
|
|
|
|
+ return &ath_world_regdom_60_61_62;
|
|
case 0x63:
|
|
case 0x63:
|
|
case 0x65:
|
|
case 0x65:
|
|
- return &ath9k_world_regdom_63_65;
|
|
|
|
|
|
+ return &ath_world_regdom_63_65;
|
|
case 0x64:
|
|
case 0x64:
|
|
- return &ath9k_world_regdom_64;
|
|
|
|
|
|
+ return &ath_world_regdom_64;
|
|
case 0x66:
|
|
case 0x66:
|
|
case 0x69:
|
|
case 0x69:
|
|
- return &ath9k_world_regdom_66_69;
|
|
|
|
|
|
+ return &ath_world_regdom_66_69;
|
|
case 0x67:
|
|
case 0x67:
|
|
case 0x68:
|
|
case 0x68:
|
|
case 0x6A:
|
|
case 0x6A:
|
|
- return &ath9k_world_regdom_67_68_6A;
|
|
|
|
|
|
+ return &ath_world_regdom_67_68_6A;
|
|
default:
|
|
default:
|
|
WARN_ON(1);
|
|
WARN_ON(1);
|
|
- return ath9k_default_world_regdomain();
|
|
|
|
|
|
+ return ath_default_world_regdomain();
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
+EXPORT_SYMBOL(ath_world_regdomain);
|
|
|
|
|
|
/* Frequency is one where radar detection is required */
|
|
/* Frequency is one where radar detection is required */
|
|
-static bool ath9k_is_radar_freq(u16 center_freq)
|
|
|
|
|
|
+static bool ath_is_radar_freq(u16 center_freq)
|
|
{
|
|
{
|
|
return (center_freq >= 5260 && center_freq <= 5700);
|
|
return (center_freq >= 5260 && center_freq <= 5700);
|
|
}
|
|
}
|
|
@@ -170,7 +175,7 @@ static bool ath9k_is_radar_freq(u16 center_freq)
|
|
* received a beacon on a channel we can enable active scan and
|
|
* received a beacon on a channel we can enable active scan and
|
|
* adhoc (or beaconing).
|
|
* adhoc (or beaconing).
|
|
*/
|
|
*/
|
|
-static void ath9k_reg_apply_beaconing_flags(
|
|
|
|
|
|
+static void ath_reg_apply_beaconing_flags(
|
|
struct wiphy *wiphy,
|
|
struct wiphy *wiphy,
|
|
enum nl80211_reg_initiator initiator)
|
|
enum nl80211_reg_initiator initiator)
|
|
{
|
|
{
|
|
@@ -193,7 +198,7 @@ static void ath9k_reg_apply_beaconing_flags(
|
|
|
|
|
|
ch = &sband->channels[i];
|
|
ch = &sband->channels[i];
|
|
|
|
|
|
- if (ath9k_is_radar_freq(ch->center_freq) ||
|
|
|
|
|
|
+ if (ath_is_radar_freq(ch->center_freq) ||
|
|
(ch->flags & IEEE80211_CHAN_RADAR))
|
|
(ch->flags & IEEE80211_CHAN_RADAR))
|
|
continue;
|
|
continue;
|
|
|
|
|
|
@@ -229,7 +234,7 @@ static void ath9k_reg_apply_beaconing_flags(
|
|
}
|
|
}
|
|
|
|
|
|
/* Allows active scan scan on Ch 12 and 13 */
|
|
/* Allows active scan scan on Ch 12 and 13 */
|
|
-static void ath9k_reg_apply_active_scan_flags(
|
|
|
|
|
|
+static void ath_reg_apply_active_scan_flags(
|
|
struct wiphy *wiphy,
|
|
struct wiphy *wiphy,
|
|
enum nl80211_reg_initiator initiator)
|
|
enum nl80211_reg_initiator initiator)
|
|
{
|
|
{
|
|
@@ -280,7 +285,7 @@ static void ath9k_reg_apply_active_scan_flags(
|
|
}
|
|
}
|
|
|
|
|
|
/* Always apply Radar/DFS rules on freq range 5260 MHz - 5700 MHz */
|
|
/* Always apply Radar/DFS rules on freq range 5260 MHz - 5700 MHz */
|
|
-void ath9k_reg_apply_radar_flags(struct wiphy *wiphy)
|
|
|
|
|
|
+void ath_reg_apply_radar_flags(struct wiphy *wiphy)
|
|
{
|
|
{
|
|
struct ieee80211_supported_band *sband;
|
|
struct ieee80211_supported_band *sband;
|
|
struct ieee80211_channel *ch;
|
|
struct ieee80211_channel *ch;
|
|
@@ -293,7 +298,7 @@ void ath9k_reg_apply_radar_flags(struct wiphy *wiphy)
|
|
|
|
|
|
for (i = 0; i < sband->n_channels; i++) {
|
|
for (i = 0; i < sband->n_channels; i++) {
|
|
ch = &sband->channels[i];
|
|
ch = &sband->channels[i];
|
|
- if (!ath9k_is_radar_freq(ch->center_freq))
|
|
|
|
|
|
+ if (!ath_is_radar_freq(ch->center_freq))
|
|
continue;
|
|
continue;
|
|
/* We always enable radar detection/DFS on this
|
|
/* We always enable radar detection/DFS on this
|
|
* frequency range. Additionally we also apply on
|
|
* frequency range. Additionally we also apply on
|
|
@@ -311,31 +316,33 @@ void ath9k_reg_apply_radar_flags(struct wiphy *wiphy)
|
|
IEEE80211_CHAN_PASSIVE_SCAN;
|
|
IEEE80211_CHAN_PASSIVE_SCAN;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
+EXPORT_SYMBOL(ath_reg_apply_radar_flags);
|
|
|
|
|
|
-void ath9k_reg_apply_world_flags(struct wiphy *wiphy,
|
|
|
|
- enum nl80211_reg_initiator initiator,
|
|
|
|
- struct ath9k_regulatory *reg)
|
|
|
|
|
|
+void ath_reg_apply_world_flags(struct wiphy *wiphy,
|
|
|
|
+ enum nl80211_reg_initiator initiator,
|
|
|
|
+ struct ath_regulatory *reg)
|
|
{
|
|
{
|
|
switch (reg->regpair->regDmnEnum) {
|
|
switch (reg->regpair->regDmnEnum) {
|
|
case 0x60:
|
|
case 0x60:
|
|
case 0x63:
|
|
case 0x63:
|
|
case 0x66:
|
|
case 0x66:
|
|
case 0x67:
|
|
case 0x67:
|
|
- ath9k_reg_apply_beaconing_flags(wiphy, initiator);
|
|
|
|
|
|
+ ath_reg_apply_beaconing_flags(wiphy, initiator);
|
|
break;
|
|
break;
|
|
case 0x68:
|
|
case 0x68:
|
|
- ath9k_reg_apply_beaconing_flags(wiphy, initiator);
|
|
|
|
- ath9k_reg_apply_active_scan_flags(wiphy, initiator);
|
|
|
|
|
|
+ ath_reg_apply_beaconing_flags(wiphy, initiator);
|
|
|
|
+ ath_reg_apply_active_scan_flags(wiphy, initiator);
|
|
break;
|
|
break;
|
|
}
|
|
}
|
|
return;
|
|
return;
|
|
}
|
|
}
|
|
|
|
+EXPORT_SYMBOL(ath_reg_apply_world_flags);
|
|
|
|
|
|
-static int ath9k_reg_notifier_apply(struct wiphy *wiphy,
|
|
|
|
- struct regulatory_request *request, struct ath9k_regulatory *reg)
|
|
|
|
|
|
+int ath_reg_notifier_apply(struct wiphy *wiphy,
|
|
|
|
+ struct regulatory_request *request, struct ath_regulatory *reg)
|
|
{
|
|
{
|
|
/* We always apply this */
|
|
/* We always apply this */
|
|
- ath9k_reg_apply_radar_flags(wiphy);
|
|
|
|
|
|
+ ath_reg_apply_radar_flags(wiphy);
|
|
|
|
|
|
switch (request->initiator) {
|
|
switch (request->initiator) {
|
|
case NL80211_REGDOM_SET_BY_DRIVER:
|
|
case NL80211_REGDOM_SET_BY_DRIVER:
|
|
@@ -343,28 +350,19 @@ static int ath9k_reg_notifier_apply(struct wiphy *wiphy,
|
|
case NL80211_REGDOM_SET_BY_USER:
|
|
case NL80211_REGDOM_SET_BY_USER:
|
|
break;
|
|
break;
|
|
case NL80211_REGDOM_SET_BY_COUNTRY_IE:
|
|
case NL80211_REGDOM_SET_BY_COUNTRY_IE:
|
|
- if (ath9k_is_world_regd(reg))
|
|
|
|
- ath9k_reg_apply_world_flags(wiphy, request->initiator,
|
|
|
|
- reg);
|
|
|
|
|
|
+ if (ath_is_world_regd(reg))
|
|
|
|
+ ath_reg_apply_world_flags(wiphy, request->initiator,
|
|
|
|
+ reg);
|
|
break;
|
|
break;
|
|
}
|
|
}
|
|
|
|
|
|
return 0;
|
|
return 0;
|
|
}
|
|
}
|
|
|
|
+EXPORT_SYMBOL(ath_reg_notifier_apply);
|
|
|
|
|
|
-int ath9k_reg_notifier(struct wiphy *wiphy, struct regulatory_request *request)
|
|
|
|
|
|
+bool ath_regd_is_eeprom_valid(struct ath_regulatory *reg)
|
|
{
|
|
{
|
|
- struct ieee80211_hw *hw = wiphy_to_ieee80211_hw(wiphy);
|
|
|
|
- struct ath_wiphy *aphy = hw->priv;
|
|
|
|
- struct ath_softc *sc = aphy->sc;
|
|
|
|
- struct ath9k_regulatory *reg = &sc->sc_ah->regulatory;
|
|
|
|
-
|
|
|
|
- return ath9k_reg_notifier_apply(wiphy, request, reg);
|
|
|
|
-}
|
|
|
|
-
|
|
|
|
-bool ath9k_regd_is_eeprom_valid(struct ath9k_regulatory *reg)
|
|
|
|
-{
|
|
|
|
- u16 rd = ath9k_regd_get_eepromRD(reg);
|
|
|
|
|
|
+ u16 rd = ath_regd_get_eepromRD(reg);
|
|
int i;
|
|
int i;
|
|
|
|
|
|
if (rd & COUNTRY_ERD_FLAG) {
|
|
if (rd & COUNTRY_ERD_FLAG) {
|
|
@@ -380,13 +378,14 @@ bool ath9k_regd_is_eeprom_valid(struct ath9k_regulatory *reg)
|
|
return true;
|
|
return true;
|
|
}
|
|
}
|
|
printk(KERN_DEBUG
|
|
printk(KERN_DEBUG
|
|
- "ath9k: invalid regulatory domain/country code 0x%x\n", rd);
|
|
|
|
|
|
+ "ath: invalid regulatory domain/country code 0x%x\n", rd);
|
|
return false;
|
|
return false;
|
|
}
|
|
}
|
|
|
|
+EXPORT_SYMBOL(ath_regd_is_eeprom_valid);
|
|
|
|
|
|
/* EEPROM country code to regpair mapping */
|
|
/* EEPROM country code to regpair mapping */
|
|
static struct country_code_to_enum_rd*
|
|
static struct country_code_to_enum_rd*
|
|
-ath9k_regd_find_country(u16 countryCode)
|
|
|
|
|
|
+ath_regd_find_country(u16 countryCode)
|
|
{
|
|
{
|
|
int i;
|
|
int i;
|
|
|
|
|
|
@@ -399,7 +398,7 @@ ath9k_regd_find_country(u16 countryCode)
|
|
|
|
|
|
/* EEPROM rd code to regpair mapping */
|
|
/* EEPROM rd code to regpair mapping */
|
|
static struct country_code_to_enum_rd*
|
|
static struct country_code_to_enum_rd*
|
|
-ath9k_regd_find_country_by_rd(int regdmn)
|
|
|
|
|
|
+ath_regd_find_country_by_rd(int regdmn)
|
|
{
|
|
{
|
|
int i;
|
|
int i;
|
|
|
|
|
|
@@ -411,13 +410,13 @@ ath9k_regd_find_country_by_rd(int regdmn)
|
|
}
|
|
}
|
|
|
|
|
|
/* Returns the map of the EEPROM set RD to a country code */
|
|
/* Returns the map of the EEPROM set RD to a country code */
|
|
-static u16 ath9k_regd_get_default_country(u16 rd)
|
|
|
|
|
|
+static u16 ath_regd_get_default_country(u16 rd)
|
|
{
|
|
{
|
|
if (rd & COUNTRY_ERD_FLAG) {
|
|
if (rd & COUNTRY_ERD_FLAG) {
|
|
struct country_code_to_enum_rd *country = NULL;
|
|
struct country_code_to_enum_rd *country = NULL;
|
|
u16 cc = rd & ~COUNTRY_ERD_FLAG;
|
|
u16 cc = rd & ~COUNTRY_ERD_FLAG;
|
|
|
|
|
|
- country = ath9k_regd_find_country(cc);
|
|
|
|
|
|
+ country = ath_regd_find_country(cc);
|
|
if (country != NULL)
|
|
if (country != NULL)
|
|
return cc;
|
|
return cc;
|
|
}
|
|
}
|
|
@@ -426,7 +425,7 @@ static u16 ath9k_regd_get_default_country(u16 rd)
|
|
}
|
|
}
|
|
|
|
|
|
static struct reg_dmn_pair_mapping*
|
|
static struct reg_dmn_pair_mapping*
|
|
-ath9k_get_regpair(int regdmn)
|
|
|
|
|
|
+ath_get_regpair(int regdmn)
|
|
{
|
|
{
|
|
int i;
|
|
int i;
|
|
|
|
|
|
@@ -439,18 +438,18 @@ ath9k_get_regpair(int regdmn)
|
|
return NULL;
|
|
return NULL;
|
|
}
|
|
}
|
|
|
|
|
|
-int ath9k_regd_init(struct ath9k_regulatory *reg)
|
|
|
|
|
|
+int ath_regd_init(struct ath_regulatory *reg)
|
|
{
|
|
{
|
|
struct country_code_to_enum_rd *country = NULL;
|
|
struct country_code_to_enum_rd *country = NULL;
|
|
u16 regdmn;
|
|
u16 regdmn;
|
|
|
|
|
|
- if (!ath9k_regd_is_eeprom_valid(reg)) {
|
|
|
|
- printk(KERN_DEBUG "ath9k: Invalid EEPROM contents\n");
|
|
|
|
|
|
+ if (!ath_regd_is_eeprom_valid(reg)) {
|
|
|
|
+ printk(KERN_DEBUG "ath: Invalid EEPROM contents\n");
|
|
return -EINVAL;
|
|
return -EINVAL;
|
|
}
|
|
}
|
|
|
|
|
|
- regdmn = ath9k_regd_get_eepromRD(reg);
|
|
|
|
- reg->country_code = ath9k_regd_get_default_country(regdmn);
|
|
|
|
|
|
+ regdmn = ath_regd_get_eepromRD(reg);
|
|
|
|
+ reg->country_code = ath_regd_get_default_country(regdmn);
|
|
|
|
|
|
if (reg->country_code == CTRY_DEFAULT &&
|
|
if (reg->country_code == CTRY_DEFAULT &&
|
|
regdmn == CTRY_DEFAULT)
|
|
regdmn == CTRY_DEFAULT)
|
|
@@ -459,26 +458,26 @@ int ath9k_regd_init(struct ath9k_regulatory *reg)
|
|
if (reg->country_code == CTRY_DEFAULT) {
|
|
if (reg->country_code == CTRY_DEFAULT) {
|
|
country = NULL;
|
|
country = NULL;
|
|
} else {
|
|
} else {
|
|
- country = ath9k_regd_find_country(reg->country_code);
|
|
|
|
|
|
+ country = ath_regd_find_country(reg->country_code);
|
|
if (country == NULL) {
|
|
if (country == NULL) {
|
|
printk(KERN_DEBUG
|
|
printk(KERN_DEBUG
|
|
- "ath9k: Country is NULL!!!!, cc= %d\n",
|
|
|
|
|
|
+ "ath: Country is NULL!!!!, cc= %d\n",
|
|
reg->country_code);
|
|
reg->country_code);
|
|
return -EINVAL;
|
|
return -EINVAL;
|
|
} else
|
|
} else
|
|
regdmn = country->regDmnEnum;
|
|
regdmn = country->regDmnEnum;
|
|
}
|
|
}
|
|
|
|
|
|
- reg->regpair = ath9k_get_regpair(regdmn);
|
|
|
|
|
|
+ reg->regpair = ath_get_regpair(regdmn);
|
|
|
|
|
|
if (!reg->regpair) {
|
|
if (!reg->regpair) {
|
|
- printk(KERN_DEBUG "ath9k: "
|
|
|
|
|
|
+ printk(KERN_DEBUG "ath: "
|
|
"No regulatory domain pair found, cannot continue\n");
|
|
"No regulatory domain pair found, cannot continue\n");
|
|
return -EINVAL;
|
|
return -EINVAL;
|
|
}
|
|
}
|
|
|
|
|
|
if (!country)
|
|
if (!country)
|
|
- country = ath9k_regd_find_country_by_rd(regdmn);
|
|
|
|
|
|
+ country = ath_regd_find_country_by_rd(regdmn);
|
|
|
|
|
|
if (country) {
|
|
if (country) {
|
|
reg->alpha2[0] = country->isoName[0];
|
|
reg->alpha2[0] = country->isoName[0];
|
|
@@ -488,21 +487,21 @@ int ath9k_regd_init(struct ath9k_regulatory *reg)
|
|
reg->alpha2[1] = '0';
|
|
reg->alpha2[1] = '0';
|
|
}
|
|
}
|
|
|
|
|
|
- printk(KERN_DEBUG "ath9k: Country alpha2 being used: %c%c\n",
|
|
|
|
|
|
+ printk(KERN_DEBUG "ath: Country alpha2 being used: %c%c\n",
|
|
reg->alpha2[0], reg->alpha2[1]);
|
|
reg->alpha2[0], reg->alpha2[1]);
|
|
- printk(KERN_DEBUG "ath9k: Regpair detected: 0x%0x\n",
|
|
|
|
|
|
+ printk(KERN_DEBUG "ath: Regpair detected: 0x%0x\n",
|
|
reg->regpair->regDmnEnum);
|
|
reg->regpair->regDmnEnum);
|
|
|
|
|
|
return 0;
|
|
return 0;
|
|
}
|
|
}
|
|
|
|
+EXPORT_SYMBOL(ath_regd_init);
|
|
|
|
|
|
-static
|
|
|
|
-u32 ath9k_regd_get_band_ctl(struct ath9k_regulatory *reg,
|
|
|
|
- enum ieee80211_band band)
|
|
|
|
|
|
+u32 ath_regd_get_band_ctl(struct ath_regulatory *reg,
|
|
|
|
+ enum ieee80211_band band)
|
|
{
|
|
{
|
|
if (!reg->regpair ||
|
|
if (!reg->regpair ||
|
|
(reg->country_code == CTRY_DEFAULT &&
|
|
(reg->country_code == CTRY_DEFAULT &&
|
|
- is_wwr_sku(ath9k_regd_get_eepromRD(reg)))) {
|
|
|
|
|
|
+ is_wwr_sku(ath_regd_get_eepromRD(reg)))) {
|
|
return SD_NO_CTL;
|
|
return SD_NO_CTL;
|
|
}
|
|
}
|
|
|
|
|
|
@@ -517,17 +516,4 @@ u32 ath9k_regd_get_band_ctl(struct ath9k_regulatory *reg,
|
|
|
|
|
|
return NO_CTL;
|
|
return NO_CTL;
|
|
}
|
|
}
|
|
-
|
|
|
|
-u32 ath9k_regd_get_ctl(struct ath9k_regulatory *reg, struct ath9k_channel *chan)
|
|
|
|
-{
|
|
|
|
- u32 ctl = ath9k_regd_get_band_ctl(reg, chan->chan->band);
|
|
|
|
-
|
|
|
|
- if (IS_CHAN_B(chan))
|
|
|
|
- ctl |= CTL_11B;
|
|
|
|
- else if (IS_CHAN_G(chan))
|
|
|
|
- ctl |= CTL_11G;
|
|
|
|
- else
|
|
|
|
- ctl |= CTL_11A;
|
|
|
|
-
|
|
|
|
- return ctl;
|
|
|
|
-}
|
|
|
|
|
|
+EXPORT_SYMBOL(ath_regd_get_band_ctl);
|