xref: /wlan-dirver/qca-wifi-host-cmn/umac/regulatory/core/src/reg_opclass.h (revision fa47688f04ef001a6dcafaebdcc3c031f15ee75e)
1 /*
2  * Copyright (c) 2017-2019 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_opclass.h
22  * This file provides prototypes of the regulatory opclass functions
23  */
24 
25 #ifndef __REG_OPCLASS_H__
26 #define __REG_OPCLASS_H__
27 
28 #ifdef HOST_OPCLASS
29 /**
30  * reg_dmn_get_chanwidth_from_opclass() - Get channel width from opclass.
31  * @country: Country code
32  * @channel: Channel number
33  * @opclass: Operating class
34  *
35  * Return: Channel width
36  */
37 uint16_t reg_dmn_get_chanwidth_from_opclass(uint8_t *country, uint8_t channel,
38 					    uint8_t opclass);
39 
40 /**
41  * reg_dmn_get_opclass_from_channel() - Get operating class from channel.
42  * @country: Country code.
43  * @channel: Channel number.
44  * @offset: Operating class offset.
45  *
46  * Return: Error code.
47  */
48 uint16_t reg_dmn_get_opclass_from_channel(uint8_t *country, uint8_t channel,
49 					  uint8_t offset);
50 
51 /**
52  * reg_dmn_set_curr_opclasses() - Set current operating class
53  * @num_classes: Number of classes
54  * @class: Pointer to operating class.
55  *
56  * Return: Error code.
57  */
58 uint16_t reg_dmn_set_curr_opclasses(uint8_t num_classes, uint8_t *class);
59 
60 /**
61  * reg_dmn_get_curr_opclasses() - Get current supported operating classes.
62  * @num_classes: Number of classes.
63  * @class: Pointer to operating class.
64  *
65  * Return: Error code.
66  */
67 uint16_t reg_dmn_get_curr_opclasses(uint8_t *num_classes, uint8_t *class);
68 
69 #else
70 
71 static inline uint16_t reg_dmn_get_chanwidth_from_opclass(
72 		uint8_t *country, uint8_t channel, uint8_t opclass)
73 {
74 	return 0;
75 }
76 
77 static inline uint16_t reg_dmn_set_curr_opclasses(
78 		uint8_t num_classes, uint8_t *class)
79 {
80 	return 0;
81 }
82 
83 static inline uint16_t reg_dmn_get_curr_opclasses(
84 		uint8_t *num_classes, uint8_t *class)
85 {
86 	return 0;
87 }
88 
89 static inline uint16_t reg_dmn_get_opclass_from_channel(
90 		uint8_t *country, uint8_t channel, uint8_t offset)
91 {
92 	return 0;
93 }
94 #endif
95 #endif
96