Lines Matching +full:no +full:- +full:eeprom
2 * Copyright (c) 2008-2009 Atheros Communications Inc.
10 * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
36 #define ATH_2GHZ_CH01_11 REG_RULE(2412-10, 2462+10, 40, 0, 20, 0)
39 #define ATH_2GHZ_CH12_13 REG_RULE(2467-10, 2472+10, 40, 0, 20,\
41 #define ATH_2GHZ_CH14 REG_RULE(2484-10, 2484+10, 40, 0, 20,\
46 #define ATH_5GHZ_5150_5350 REG_RULE(5150-10, 5350+10, 80, 0, 30,\
48 #define ATH_5GHZ_5470_5850 REG_RULE(5470-10, 5850+10, 80, 0, 30,\
50 #define ATH_5GHZ_5725_5850 REG_RULE(5725-10, 5850+10, 80, 0, 30,\
122 switch (reg->country_code) { in dynamic_country_user_possible()
207 return reg->current_rd & ~WORLDWIDE_ROAMING_FLAG; in ath_regd_get_eepromRD()
225 switch (reg->regpair->reg_domain) { in ath_world_regdomain()
261 if (reg->country_code == CTRY_INDIA) in ath_is_radar_freq()
271 reg_rule = freq_reg_info(wiphy, MHZ_TO_KHZ(ch->center_freq)); in ath_force_clear_no_ir_chan()
275 if (!(reg_rule->flags & NL80211_RRF_NO_IR)) in ath_force_clear_no_ir_chan()
276 if (ch->flags & IEEE80211_CHAN_NO_IR) in ath_force_clear_no_ir_chan()
277 ch->flags &= ~IEEE80211_CHAN_NO_IR; in ath_force_clear_no_ir_chan()
293 ch->flags |= IEEE80211_CHAN_NO_IR; in ath_force_no_ir_chan()
313 if (ath_is_radar_freq(ch->center_freq, reg) || in __ath_reg_apply_beaconing_flags()
314 (ch->flags & IEEE80211_CHAN_RADAR)) in __ath_reg_apply_beaconing_flags()
326 if (ch->beacon_found) in __ath_reg_apply_beaconing_flags()
327 ch->flags &= ~IEEE80211_CHAN_NO_IR; in __ath_reg_apply_beaconing_flags()
334 * - We enable initiating radiation if the country IE says its fine:
335 * - If no country IE has been processed and a we determine we have
349 if (!wiphy->bands[band]) in ath_reg_apply_beaconing_flags()
351 sband = wiphy->bands[band]; in ath_reg_apply_beaconing_flags()
352 for (i = 0; i < sband->n_channels; i++) { in ath_reg_apply_beaconing_flags()
353 ch = &sband->channels[i]; in ath_reg_apply_beaconing_flags()
363 * @reg: regulatory structure - used for country selection
366 * If no country IE has been received always enable passive scan
367 * and no-ibss on these channels. This is only done for specific
382 sband = wiphy->bands[NL80211_BAND_2GHZ]; in ath_reg_apply_ir_flags()
403 /* Always apply Radar/DFS rules on freq range 5500 MHz - 5700 MHz */
411 if (!wiphy->bands[NL80211_BAND_5GHZ]) in ath_reg_apply_radar_flags()
414 sband = wiphy->bands[NL80211_BAND_5GHZ]; in ath_reg_apply_radar_flags()
416 for (i = 0; i < sband->n_channels; i++) { in ath_reg_apply_radar_flags()
417 ch = &sband->channels[i]; in ath_reg_apply_radar_flags()
418 if (!ath_is_radar_freq(ch->center_freq, reg)) in ath_reg_apply_radar_flags()
423 * - If STA mode does not yet have DFS supports disable in ath_reg_apply_radar_flags()
425 * - If adhoc mode does not support DFS yet then in ath_reg_apply_radar_flags()
427 * - If AP mode does not yet support radar detection/DFS in ath_reg_apply_radar_flags()
430 if (!(ch->flags & IEEE80211_CHAN_DISABLED)) in ath_reg_apply_radar_flags()
431 ch->flags |= IEEE80211_CHAN_RADAR | in ath_reg_apply_radar_flags()
440 switch (reg->regpair->reg_domain) { in ath_reg_apply_world_flags()
467 return -1; in ath_regd_find_country_by_name()
477 if (request->initiator == NL80211_REGDOM_SET_BY_COUNTRY_IE && in __ath_reg_dyn_country()
479 return -EINVAL; in __ath_reg_dyn_country()
481 country_code = ath_regd_find_country_by_name(request->alpha2); in __ath_reg_dyn_country()
482 if (country_code == (u16) -1) in __ath_reg_dyn_country()
483 return -EINVAL; in __ath_reg_dyn_country()
485 reg->current_rd = COUNTRY_ERD_FLAG; in __ath_reg_dyn_country()
486 reg->current_rd |= country_code; in __ath_reg_dyn_country()
490 ath_reg_apply_world_flags(wiphy, request->initiator, reg); in __ath_reg_dyn_country()
504 reg->current_rd, in ath_reg_dyn_country()
505 reg_initiator_name(request->initiator)); in ath_reg_dyn_country()
525 reg->region = request->dfs_region; in ath_reg_notifier_apply()
526 switch (request->initiator) { in ath_reg_notifier_apply()
529 * If common->reg_world_copy is world roaming it means we *were* in ath_reg_notifier_apply()
532 if (!ath_is_world_regd(&common->reg_world_copy)) in ath_reg_notifier_apply()
535 memcpy(reg, &common->reg_world_copy, in ath_reg_notifier_apply()
557 /* EEPROM value is a country code */ in ath_regd_is_eeprom_valid()
560 "ath: EEPROM indicates we should expect " in ath_regd_is_eeprom_valid()
566 /* EEPROM value is a regpair value */ in ath_regd_is_eeprom_valid()
568 printk(KERN_DEBUG "ath: EEPROM indicates we " in ath_regd_is_eeprom_valid()
579 /* EEPROM country code to regpair mapping */
592 /* EEPROM rd code to regpair mapping */
605 /* Returns the map of the EEPROM set RD to a country code */
642 wiphy->reg_notifier = reg_notifier; in ath_regd_init_wiphy()
643 wiphy->regulatory_flags |= REGULATORY_STRICT_REG | in ath_regd_init_wiphy()
652 wiphy->regulatory_flags |= REGULATORY_COUNTRY_IE_FOLLOW_POWER; in ath_regd_init_wiphy()
669 * Some users have reported their EEPROM programmed with
677 if (reg->current_rd != COUNTRY_ERD_FLAG) in ath_regd_sanitize()
679 printk(KERN_DEBUG "ath: EEPROM regdomain sanitized\n"); in ath_regd_sanitize()
680 reg->current_rd = 0x64; in ath_regd_sanitize()
689 return -EINVAL; in __ath_regd_init()
693 printk(KERN_DEBUG "ath: EEPROM regdomain: 0x%0x\n", reg->current_rd); in __ath_regd_init()
696 pr_err("Invalid EEPROM contents\n"); in __ath_regd_init()
697 return -EINVAL; in __ath_regd_init()
701 reg->country_code = ath_regd_get_default_country(regdmn); in __ath_regd_init()
703 if (reg->country_code == CTRY_DEFAULT && in __ath_regd_init()
705 printk(KERN_DEBUG "ath: EEPROM indicates default " in __ath_regd_init()
707 reg->country_code = CTRY_UNITED_STATES; in __ath_regd_init()
710 if (reg->country_code == CTRY_DEFAULT) { in __ath_regd_init()
713 printk(KERN_DEBUG "ath: doing EEPROM country->regdmn " in __ath_regd_init()
715 country = ath_regd_find_country(reg->country_code); in __ath_regd_init()
718 "ath: no valid country maps found for " in __ath_regd_init()
720 reg->country_code); in __ath_regd_init()
721 return -EINVAL; in __ath_regd_init()
723 regdmn = country->regDmnEnum; in __ath_regd_init()
730 reg->regpair = ath_get_regpair(regdmn); in __ath_regd_init()
732 if (!reg->regpair) { in __ath_regd_init()
734 "No regulatory domain pair found, cannot continue\n"); in __ath_regd_init()
735 return -EINVAL; in __ath_regd_init()
742 reg->alpha2[0] = country->isoName[0]; in __ath_regd_init()
743 reg->alpha2[1] = country->isoName[1]; in __ath_regd_init()
745 reg->alpha2[0] = '0'; in __ath_regd_init()
746 reg->alpha2[1] = '0'; in __ath_regd_init()
750 reg->alpha2[0], reg->alpha2[1]); in __ath_regd_init()
752 reg->regpair->reg_domain); in __ath_regd_init()
772 memcpy(&common->reg_world_copy, reg, in ath_regd_init()
784 if (!reg->regpair || in ath_regd_get_band_ctl()
785 (reg->country_code == CTRY_DEFAULT && in ath_regd_get_band_ctl()
791 switch (reg->region) { in ath_regd_get_band_ctl()
805 return reg->regpair->reg_2ghz_ctl; in ath_regd_get_band_ctl()
807 return reg->regpair->reg_5ghz_ctl; in ath_regd_get_band_ctl()