1 /*
2  * Copyright (c) 2022 Qualcomm Innovation Center, Inc. All rights reserved.
3  *
4  * Permission to use, copy, modify, and/or distribute this software for
5  * any purpose with or without fee is hereby granted, provided that the
6  * above copyright notice and this permission notice appear in all
7  * copies.
8  *
9  * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
10  * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
11  * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE
12  * AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
13  * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
14  * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
15  * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
16  * PERFORMANCE OF THIS SOFTWARE.
17  */
18 
19 /**
20  * DOC: Contains mcc quota event public data structure definitions
21  */
22 
23 #ifndef _WLAN_P2P_MCC_QUOTA_PUBLIC_STRUCT_H_
24 #define _WLAN_P2P_MCC_QUOTA_PUBLIC_STRUCT_H_
25 
26 #include <qdf_types.h>
27 
28 struct wlan_objmgr_psoc;
29 struct wlan_objmgr_vdev;
30 
31 /*
32  * Max possible unique home channel numbers that host can receive to
33  * struct mcc_quota_info from FW event. In real case, for two MACs DBS,
34  * each MAC has two unique home channels, max home channel can't exceed 4.
35  */
36 #define MAX_MCC_QUOTA_CH_NUM 4
37 
38 /**
39  * enum mcc_quota_type - mcc channel quota type
40  * @QUOTA_TYPE_CLEAR: target exits MCC state and clear mcc quota information
41  * @QUOTA_TYPE_FIXED: channel time quota is fixed and will not be changed
42  * @QUOTA_TYPE_DYNAMIC: channel time quota is dynamic and targe may change
43  *   the quota based on the data activity
44  * @QUOTA_TYPE_UNKNOWN: unknown type
45  */
46 enum mcc_quota_type {
47 	QUOTA_TYPE_CLEAR,
48 	QUOTA_TYPE_FIXED,
49 	QUOTA_TYPE_DYNAMIC,
50 	QUOTA_TYPE_UNKNOWN = 0xff
51 };
52 
53 /**
54  * struct channel_quota - mcc channel quota
55  * @chan_mhz: frequency of the channel for which the quota is set
56  * @channel_time_quota: channel time quota expressed as percentage
57  */
58 struct channel_quota {
59 	uint32_t chan_mhz;
60 	uint32_t channel_time_quota;
61 };
62 
63 /**
64  * struct mcc_quota_info - mcc quota information
65  * @type: mcc quota type
66  * @num_chan_quota: number of channel quota in chan_quota
67  * @chan_quota: channel quota array
68  */
69 struct mcc_quota_info {
70 	enum mcc_quota_type type;
71 	uint32_t num_chan_quota;
72 	struct channel_quota chan_quota[MAX_MCC_QUOTA_CH_NUM];
73 };
74 #endif /* _WLAN_P2P_MCC_QUOTA_PUBLIC_STRUCT_H_ */
75