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