Lines Matching refs:alpha2
91 .alpha2[0] = '0',
92 .alpha2[1] = '0',
244 .alpha2 = "00",
367 bool is_world_regdom(const char *alpha2) in is_world_regdom() argument
369 if (!alpha2) in is_world_regdom()
371 return alpha2[0] == '0' && alpha2[1] == '0'; in is_world_regdom()
374 static bool is_alpha2_set(const char *alpha2) in is_alpha2_set() argument
376 if (!alpha2) in is_alpha2_set()
378 return alpha2[0] && alpha2[1]; in is_alpha2_set()
381 static bool is_unknown_alpha2(const char *alpha2) in is_unknown_alpha2() argument
383 if (!alpha2) in is_unknown_alpha2()
389 return alpha2[0] == '9' && alpha2[1] == '9'; in is_unknown_alpha2()
392 static bool is_intersected_alpha2(const char *alpha2) in is_intersected_alpha2() argument
394 if (!alpha2) in is_intersected_alpha2()
401 return alpha2[0] == '9' && alpha2[1] == '8'; in is_intersected_alpha2()
404 static bool is_an_alpha2(const char *alpha2) in is_an_alpha2() argument
406 if (!alpha2) in is_an_alpha2()
408 return isalpha(alpha2[0]) && isalpha(alpha2[1]); in is_an_alpha2()
418 static bool regdom_changes(const char *alpha2) in regdom_changes() argument
424 return !alpha2_equal(r->alpha2, alpha2); in regdom_changes()
563 static int call_crda(const char *alpha2) in call_crda() argument
570 alpha2[0], alpha2[1]); in call_crda()
577 if (!is_world_regdom((char *) alpha2)) in call_crda()
579 alpha2[0], alpha2[1]); in call_crda()
595 static inline int call_crda(const char *alpha2) in call_crda() argument
605 u8 alpha2[2]; member
856 country->alpha2[0], country->alpha2[1]); in set_wmm_rule()
902 int reg_query_regdb_wmm(char *alpha2, int freq, struct ieee80211_reg_rule *rule) in reg_query_regdb_wmm() argument
915 if (alpha2_equal(alpha2, country->alpha2)) in reg_query_regdb_wmm()
939 regdom->alpha2[0] = country->alpha2[0]; in regdb_query_country()
940 regdom->alpha2[1] = country->alpha2[1]; in regdb_query_country()
981 static int query_regdb(const char *alpha2) in query_regdb() argument
993 if (alpha2_equal(alpha2, country->alpha2)) in query_regdb()
1047 static int query_regdb_file(const char *alpha2) in query_regdb_file() argument
1054 return query_regdb(alpha2); in query_regdb_file()
1056 alpha2 = kmemdup(alpha2, 2, GFP_KERNEL); in query_regdb_file()
1057 if (!alpha2) in query_regdb_file()
1062 (void *)alpha2, regdb_fw_cb); in query_regdb_file()
1064 kfree(alpha2); in query_regdb_file()
1107 request->alpha2[0] = current_regdomain->alpha2[0]; in reg_reload_regdb()
1108 request->alpha2[1] = current_regdomain->alpha2[1]; in reg_reload_regdb()
1123 if (query_regdb_file(request->alpha2) == 0) in reg_query_database()
1126 if (call_crda(request->alpha2) == 0) in reg_query_database()
1132 bool reg_is_valid_request(const char *alpha2) in reg_is_valid_request() argument
1139 return alpha2_equal(lr->alpha2, alpha2); in reg_is_valid_request()
1553 rd->alpha2[0] = '9'; in regdom_intersect()
1554 rd->alpha2[1] = '8'; in regdom_intersect()
2067 !regdom_changes(pending_request->alpha2)) in reg_ignore_cell_hint()
2126 !is_world_regdom(lr->alpha2)) { in ignore_reg_update()
2144 if (is_world_regdom(cr->alpha2) || (wr && is_world_regdom(wr->alpha2))) in reg_is_world_roaming()
2707 regdom_changes(lr->alpha2)) in __reg_process_hint_user()
2710 if (!regdom_changes(user_request->alpha2)) in __reg_process_hint_user()
2738 user_alpha2[0] = user_request->alpha2[0]; in reg_process_hint_user()
2739 user_alpha2[1] = user_request->alpha2[1]; in reg_process_hint_user()
2752 if (regdom_changes(driver_request->alpha2)) in __reg_process_hint_driver()
2763 !regdom_changes(driver_request->alpha2)) in __reg_process_hint_driver()
2840 if (regdom_changes(country_ie_request->alpha2)) in __reg_process_hint_country_ie()
2848 if (unlikely(!is_an_alpha2(country_ie_request->alpha2))) in __reg_process_hint_country_ie()
2863 if (regdom_changes(country_ie_request->alpha2)) in __reg_process_hint_country_ie()
2868 if (regdom_changes(country_ie_request->alpha2)) in __reg_process_hint_country_ie()
3164 request.alpha2[0] = regd->alpha2[0]; in reg_process_self_managed_hint()
3165 request.alpha2[1] = regd->alpha2[1]; in reg_process_self_managed_hint()
3200 request->alpha2[0] = toupper(request->alpha2[0]); in queue_regulatory_request()
3201 request->alpha2[1] = toupper(request->alpha2[1]); in queue_regulatory_request()
3214 static int regulatory_hint_core(const char *alpha2) in regulatory_hint_core() argument
3222 request->alpha2[0] = alpha2[0]; in regulatory_hint_core()
3223 request->alpha2[1] = alpha2[1]; in regulatory_hint_core()
3233 int regulatory_hint_user(const char *alpha2, in regulatory_hint_user() argument
3238 if (WARN_ON(!alpha2)) in regulatory_hint_user()
3241 if (!is_world_regdom(alpha2) && !is_an_alpha2(alpha2)) in regulatory_hint_user()
3249 request->alpha2[0] = alpha2[0]; in regulatory_hint_user()
3250 request->alpha2[1] = alpha2[1]; in regulatory_hint_user()
3307 int regulatory_hint(struct wiphy *wiphy, const char *alpha2) in regulatory_hint() argument
3311 if (WARN_ON(!alpha2 || !wiphy)) in regulatory_hint()
3322 request->alpha2[0] = alpha2[0]; in regulatory_hint()
3323 request->alpha2[1] = alpha2[1]; in regulatory_hint()
3338 char alpha2[2]; in regulatory_hint_country_ie() local
3353 alpha2[0] = country_ie[0]; in regulatory_hint_country_ie()
3354 alpha2[1] = country_ie[1]; in regulatory_hint_country_ie()
3377 request->alpha2[0] = alpha2[0]; in regulatory_hint_country_ie()
3378 request->alpha2[1] = alpha2[1]; in regulatory_hint_country_ie()
3392 static void restore_alpha2(char *alpha2, bool reset_user) in restore_alpha2() argument
3395 alpha2[0] = '9'; in restore_alpha2()
3396 alpha2[1] = '7'; in restore_alpha2()
3414 alpha2[0] = ieee80211_regdom[0]; in restore_alpha2()
3415 alpha2[1] = ieee80211_regdom[1]; in restore_alpha2()
3420 alpha2[0] = user_alpha2[0]; in restore_alpha2()
3421 alpha2[1] = user_alpha2[1]; in restore_alpha2()
3426 alpha2[0] = ieee80211_regdom[0]; in restore_alpha2()
3427 alpha2[1] = ieee80211_regdom[1]; in restore_alpha2()
3470 char alpha2[2]; in restore_regulatory_settings() local
3491 restore_alpha2(alpha2, reset_user); in restore_regulatory_settings()
3517 world_alpha2[0] = cfg80211_world_regdom->alpha2[0]; in restore_regulatory_settings()
3518 world_alpha2[1] = cfg80211_world_regdom->alpha2[1]; in restore_regulatory_settings()
3527 if (cached && (!is_an_alpha2(alpha2) || in restore_regulatory_settings()
3535 if (is_an_alpha2(alpha2) && in restore_regulatory_settings()
3536 !regulatory_hint_user(alpha2, NL80211_USER_REG_HINT_USER)) { in restore_regulatory_settings()
3559 if (is_an_alpha2(alpha2)) in restore_regulatory_settings()
3560 regulatory_hint_user(alpha2, NL80211_USER_REG_HINT_USER); in restore_regulatory_settings()
3760 if (is_intersected_alpha2(rd->alpha2)) { in print_regdomain()
3772 } else if (is_world_regdom(rd->alpha2)) { in print_regdomain()
3775 if (is_unknown_alpha2(rd->alpha2)) in print_regdomain()
3780 rd->alpha2[0], rd->alpha2[1]); in print_regdomain()
3783 rd->alpha2[0], rd->alpha2[1]); in print_regdomain()
3793 pr_debug("Regulatory domain: %c%c\n", rd->alpha2[0], rd->alpha2[1]); in print_regdomain_info()
3799 if (!is_world_regdom(rd->alpha2)) in reg_set_rd_core()
3810 if (!regdom_changes(rd->alpha2)) in reg_set_rd_user()
3815 rd->alpha2[0], rd->alpha2[1]); in reg_set_rd_user()
3844 if (is_world_regdom(rd->alpha2)) in reg_set_rd_driver()
3847 if (!regdom_changes(rd->alpha2)) in reg_set_rd_driver()
3852 rd->alpha2[0], rd->alpha2[1]); in reg_set_rd_driver()
3906 if (!is_alpha2_set(rd->alpha2) && !is_an_alpha2(rd->alpha2) && in reg_set_rd_country_ie()
3907 !is_unknown_alpha2(rd->alpha2)) in reg_set_rd_country_ie()
3918 rd->alpha2[0], rd->alpha2[1]); in reg_set_rd_country_ie()
3949 if (!reg_is_valid_request(rd->alpha2)) { in set_regdom()
4027 rd->alpha2[0], rd->alpha2[1])) { in __regulatory_set_wiphy_regd()
4290 err = regulatory_hint_core(cfg80211_world_regdom->alpha2); in regulatory_init_db()