xref: /wlan-dirver/qca-wifi-host-cmn/umac/regulatory/core/src/reg_db_parser.h (revision 6ecd284e5a94a1c96e26d571dd47419ac305990d)
1 /*
2  * Copyright (c) 2017-2018 The Linux Foundation. All rights reserved.
3  *
4  *
5  * Permission to use, copy, modify, and/or distribute this software for
6  * any purpose with or without fee is hereby granted, provided that the
7  * above copyright notice and this permission notice appear in all
8  * copies.
9  *
10  * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
11  * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
12  * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE
13  * AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
14  * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
15  * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
16  * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
17  * PERFORMANCE OF THIS SOFTWARE.
18  */
19 
20 /**
21  * DOC: reg_db.h
22  * This file contains regulatory data base parser function declarations
23  */
24 
25 #include <reg_services_public_struct.h>
26 
27 extern const struct country_code_to_reg_domain g_all_countries[];
28 extern const struct reg_domain_pair g_reg_dmn_pairs[];
29 extern const struct regulatory_rule reg_rules_2g[];
30 extern const struct regdomain regdomains_2g[];
31 extern const struct regulatory_rule reg_rules_5g[];
32 extern const struct regdomain regdomains_5g[];
33 
34 QDF_STATUS reg_is_country_code_valid(uint8_t *alpha2);
35 
36 QDF_STATUS reg_regrules_assign(uint8_t dmn_id_2g,
37 		uint8_t dmn_id_5g,
38 		uint8_t ant_gain_2g,
39 		uint8_t ant_gain_5g,
40 		struct cur_regulatory_info *reg_info);
41 
42 QDF_STATUS reg_get_cur_reginfo(struct cur_regulatory_info *reg_info,
43 		uint16_t country_index,
44 		uint16_t regdmn_pair);
45 
46 QDF_STATUS  reg_get_rdpair_from_country_iso(uint8_t *alpha,
47 		uint16_t *country_index,
48 		uint16_t *regdmn_pair);
49 
50 QDF_STATUS reg_get_rdpair_from_country_code(uint16_t cc,
51 		uint16_t *country_index,
52 		uint16_t *regdmn_pair);
53 
54 QDF_STATUS reg_get_rdpair_from_regdmn_id(uint16_t regdmn_id,
55 		uint16_t *regdmn_pair);
56