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) {
258 struct ath_regulatory *reg)
261 if (reg->country_code == CTRY_INDIA)
309 struct ath_regulatory *reg,
313 if (ath_is_radar_freq(ch->center_freq, reg) ||
322 if (ath_reg_dyn_country_user_allow(reg))
340 struct ath_regulatory *reg,
354 __ath_reg_apply_beaconing_flags(wiphy, reg,
363 * @reg: regulatory structure - used for country selection
377 struct ath_regulatory *reg,
392 if (!ath_reg_dyn_country_user_allow(reg))
405 struct ath_regulatory *reg)
418 if (!ath_is_radar_freq(ch->center_freq, reg))
438 struct ath_regulatory *reg)
440 switch (reg->regpair->reg_domain) {
446 ath_reg_apply_beaconing_flags(wiphy, reg, initiator);
449 ath_reg_apply_beaconing_flags(wiphy, reg, initiator);
450 ath_reg_apply_ir_flags(wiphy, reg, initiator);
453 if (ath_reg_dyn_country_user_allow(reg))
454 ath_reg_apply_beaconing_flags(wiphy, reg, initiator);
472 struct ath_regulatory *reg,
478 !ath_is_world_regd(reg))
485 reg->current_rd = COUNTRY_ERD_FLAG;
486 reg->current_rd |= country_code;
488 __ath_regd_init(reg);
490 ath_reg_apply_world_flags(wiphy, request->initiator, reg);
496 struct ath_regulatory *reg,
499 if (__ath_reg_dyn_country(wiphy, reg, request))
504 reg->current_rd,
510 struct ath_regulatory *reg)
512 struct ath_common *common = container_of(reg, struct ath_common,
515 ath_reg_apply_radar_flags(wiphy, reg);
525 reg->region = request->dfs_region;
535 memcpy(reg, &common->reg_world_copy,
541 if (ath_reg_dyn_country_user_allow(reg))
542 ath_reg_dyn_country(wiphy, reg, request);
545 ath_reg_dyn_country(wiphy, reg, request);
551 static bool ath_regd_is_eeprom_valid(struct ath_regulatory *reg)
553 u16 rd = ath_regd_get_eepromRD(reg);
635 ath_regd_init_wiphy(struct ath_regulatory *reg,
646 if (ath_is_world_regd(reg)) {
651 regd = ath_world_regdomain(reg);
663 ath_reg_apply_radar_flags(wiphy, reg);
664 ath_reg_apply_world_flags(wiphy, NL80211_REGDOM_SET_BY_DRIVER, reg);
675 static void ath_regd_sanitize(struct ath_regulatory *reg)
677 if (reg->current_rd != COUNTRY_ERD_FLAG)
680 reg->current_rd = 0x64;
683 static int __ath_regd_init(struct ath_regulatory *reg)
688 if (!reg)
691 ath_regd_sanitize(reg);
693 printk(KERN_DEBUG "ath: EEPROM regdomain: 0x%0x\n", reg->current_rd);
695 if (!ath_regd_is_eeprom_valid(reg)) {
700 regdmn = ath_regd_get_eepromRD(reg);
701 reg->country_code = ath_regd_get_default_country(regdmn);
703 if (reg->country_code == CTRY_DEFAULT &&
707 reg->country_code = CTRY_UNITED_STATES;
710 if (reg->country_code == CTRY_DEFAULT) {
715 country = ath_regd_find_country(reg->country_code);
720 reg->country_code);
730 reg->regpair = ath_get_regpair(regdmn);
732 if (!reg->regpair) {
742 reg->alpha2[0] = country->isoName[0];
743 reg->alpha2[1] = country->isoName[1];
745 reg->alpha2[0] = '0';
746 reg->alpha2[1] = '0';
750 reg->alpha2[0], reg->alpha2[1]);
752 reg->regpair->reg_domain);
758 ath_regd_init(struct ath_regulatory *reg,
763 struct ath_common *common = container_of(reg, struct ath_common,
767 r = __ath_regd_init(reg);
771 if (ath_is_world_regd(reg))
772 memcpy(&common->reg_world_copy, reg,
775 ath_regd_init_wiphy(reg, wiphy, reg_notifier);
781 u32 ath_regd_get_band_ctl(struct ath_regulatory *reg,
784 if (!reg->regpair ||
785 (reg->country_code == CTRY_DEFAULT &&
786 is_wwr_sku(ath_regd_get_eepromRD(reg)))) {
790 if (ath_regd_get_eepromRD(reg) == CTRY_DEFAULT) {
791 switch (reg->region) {
805 return reg->regpair->reg_2ghz_ctl;
807 return reg->regpair->reg_5ghz_ctl;