Lines Matching refs:reg

26 static int __ath_regd_init(struct ath_regulatory *reg);
117 static bool dynamic_country_user_possible(struct ath_regulatory *reg)
122 switch (reg->country_code) {
189 static bool ath_reg_dyn_country_user_allow(struct ath_regulatory *reg)
193 if (!dynamic_country_user_possible(reg))
205 static u16 ath_regd_get_eepromRD(struct ath_regulatory *reg)
207 return reg->current_rd & ~WORLDWIDE_ROAMING_FLAG;
210 bool ath_is_world_regd(struct ath_regulatory *reg)
212 return is_wwr_sku(ath_regd_get_eepromRD(reg));
223 ieee80211_regdomain *ath_world_regdomain(struct ath_regulatory *reg)
225 switch (reg->regpair->reg_domain) {
305 struct ath_regulatory *reg,
318 if (ath_reg_dyn_country_user_allow(reg))
336 struct ath_regulatory *reg,
350 __ath_reg_apply_beaconing_flags(wiphy, reg,
372 struct ath_regulatory *reg,
387 if (!ath_reg_dyn_country_user_allow(reg))
432 struct ath_regulatory *reg)
434 switch (reg->regpair->reg_domain) {
440 ath_reg_apply_beaconing_flags(wiphy, reg, initiator);
443 ath_reg_apply_beaconing_flags(wiphy, reg, initiator);
444 ath_reg_apply_ir_flags(wiphy, reg, initiator);
447 if (ath_reg_dyn_country_user_allow(reg))
448 ath_reg_apply_beaconing_flags(wiphy, reg, initiator);
465 struct ath_regulatory *reg,
471 !ath_is_world_regd(reg))
478 reg->current_rd = COUNTRY_ERD_FLAG;
479 reg->current_rd |= country_code;
481 __ath_regd_init(reg);
483 ath_reg_apply_world_flags(wiphy, request->initiator, reg);
489 struct ath_regulatory *reg,
492 if (__ath_reg_dyn_country(wiphy, reg, request))
497 reg->current_rd,
503 struct ath_regulatory *reg)
505 struct ath_common *common = container_of(reg, struct ath_common,
518 reg->region = request->dfs_region;
528 memcpy(reg, &common->reg_world_copy,
534 if (ath_reg_dyn_country_user_allow(reg))
535 ath_reg_dyn_country(wiphy, reg, request);
538 ath_reg_dyn_country(wiphy, reg, request);
544 static bool ath_regd_is_eeprom_valid(struct ath_regulatory *reg)
546 u16 rd = ath_regd_get_eepromRD(reg);
628 ath_regd_init_wiphy(struct ath_regulatory *reg,
639 if (ath_is_world_regd(reg)) {
644 regd = ath_world_regdomain(reg);
657 ath_reg_apply_world_flags(wiphy, NL80211_REGDOM_SET_BY_DRIVER, reg);
668 static void ath_regd_sanitize(struct ath_regulatory *reg)
670 if (reg->current_rd != COUNTRY_ERD_FLAG)
673 reg->current_rd = 0x64;
676 static int __ath_regd_init(struct ath_regulatory *reg)
681 if (!reg)
684 ath_regd_sanitize(reg);
686 printk(KERN_DEBUG "ath: EEPROM regdomain: 0x%0x\n", reg->current_rd);
688 if (!ath_regd_is_eeprom_valid(reg)) {
693 regdmn = ath_regd_get_eepromRD(reg);
694 reg->country_code = ath_regd_get_default_country(regdmn);
696 if (reg->country_code == CTRY_DEFAULT &&
700 reg->country_code = CTRY_UNITED_STATES;
703 if (reg->country_code == CTRY_DEFAULT) {
708 country = ath_regd_find_country(reg->country_code);
713 reg->country_code);
723 reg->regpair = ath_get_regpair(regdmn);
725 if (!reg->regpair) {
735 reg->alpha2[0] = country->isoName[0];
736 reg->alpha2[1] = country->isoName[1];
738 reg->alpha2[0] = '0';
739 reg->alpha2[1] = '0';
743 reg->alpha2[0], reg->alpha2[1]);
745 reg->regpair->reg_domain);
751 ath_regd_init(struct ath_regulatory *reg,
756 struct ath_common *common = container_of(reg, struct ath_common,
760 r = __ath_regd_init(reg);
764 if (ath_is_world_regd(reg))
765 memcpy(&common->reg_world_copy, reg,
768 ath_regd_init_wiphy(reg, wiphy, reg_notifier);
774 u32 ath_regd_get_band_ctl(struct ath_regulatory *reg,
777 if (!reg->regpair ||
778 (reg->country_code == CTRY_DEFAULT &&
779 is_wwr_sku(ath_regd_get_eepromRD(reg)))) {
783 if (ath_regd_get_eepromRD(reg) == CTRY_DEFAULT) {
784 switch (reg->region) {
798 return reg->regpair->reg_2ghz_ctl;
800 return reg->regpair->reg_5ghz_ctl;