summaryrefslogtreecommitdiff
path: root/mac/include/net/mcps802154_nl.h
blob: 9aa5a9b8f05642ab27f28608c632eacb834fecda (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
/*
 * This file is part of the UWB stack for linux.
 *
 * Copyright (c) 2020-2021 Qorvo US, Inc.
 *
 * This software is provided under the GNU General Public License, version 2
 * (GPLv2), as well as under a Qorvo commercial license.
 *
 * You may choose to use this software under the terms of the GPLv2 License,
 * version 2 ("GPLv2"), as published by the Free Software Foundation.
 * You should have received a copy of the GPLv2 along with this program.  If
 * not, see <http://www.gnu.org/licenses/>.
 *
 * This program is distributed under the GPLv2 in the hope that it will be
 * useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GPLv2 for more
 * details.
 *
 * If you cannot meet the requirements of the GPLv2, you may not use this
 * software for any purpose without first obtaining a commercial license from
 * Qorvo. Please contact Qorvo to inquire about licensing terms.
 */

#ifndef NET_MCPS802154_NL_H
#define NET_MCPS802154_NL_H

#define MCPS802154_GENL_NAME "mcps802154"

/**
 * enum mcps802154_commands - MCPS net link commands.
 *
 * @MCPS802154_CMD_GET_HW:
 *	Request information about a device, or dump request to get a list of all
 *	devices.
 * @MCPS802154_CMD_NEW_HW:
 *	Result from information request.
 * @MCPS802154_CMD_SET_SCHEDULER:
 *	Set the scheduler used to manage the schedule.
 * @MCPS802154_CMD_SET_SCHEDULER_PARAMS:
 *	Set the parameters of the current scheduler.
 * @MCPS802154_CMD_CALL_SCHEDULER:
 *	Call specific scheduler procedure.
 * @MCPS802154_CMD_SET_SCHEDULER_REGIONS:
 *	Set and configure the scheduler regions.
 * @MCPS802154_CMD_SET_REGIONS_PARAMS:
 *	Set the parameters of a specific region.
 * @MCPS802154_CMD_CALL_REGION:
 *	Call specific region procedure.
 * @MCPS802154_CMD_SET_CALIBRATIONS:
 *	Attempts to write the given value to the indicated calibration item.
 * @MCPS802154_CMD_GET_CALIBRATIONS:
 *	Requests information about a given calibration items.
 * @MCPS802154_CMD_LIST_CALIBRATIONS:
 *	Reports all calibrations existing.
 * @MCPS802154_CMD_TESTMODE:
 *	Run a testmode command with TESTDATA blob attribute to pass through
 *	to the driver.
 * @MCPS802154_CMD_CLOSE_SCHEDULER:
 *	Close current scheduler and its regions.
 * @MCPS802154_CMD_GET_PWR_STATS:
 *	Get the power statistics.
 *
 * @MCPS802154_CMD_UNSPEC: Invalid command.
 * @__MCPS802154_CMD_AFTER_LAST: Internal use.
 * @MCPS802154_CMD_MAX: Internal use.
 */
enum mcps802154_commands {
	MCPS802154_CMD_UNSPEC,

	MCPS802154_CMD_GET_HW, /* can dump */
	MCPS802154_CMD_NEW_HW,
	MCPS802154_CMD_SET_SCHEDULER,
	MCPS802154_CMD_SET_SCHEDULER_PARAMS,
	MCPS802154_CMD_CALL_SCHEDULER,
	MCPS802154_CMD_SET_SCHEDULER_REGIONS,
	MCPS802154_CMD_SET_REGIONS_PARAMS,
	MCPS802154_CMD_CALL_REGION,
	MCPS802154_CMD_SET_CALIBRATIONS,
	MCPS802154_CMD_GET_CALIBRATIONS,
	MCPS802154_CMD_LIST_CALIBRATIONS,
	MCPS802154_CMD_TESTMODE,
	MCPS802154_CMD_CLOSE_SCHEDULER,
	MCPS802154_CMD_GET_PWR_STATS,
	__MCPS802154_CMD_AFTER_LAST,
	MCPS802154_CMD_MAX = __MCPS802154_CMD_AFTER_LAST - 1
};

/**
 * enum mcps802154_attrs - Top level MCPS net link attributes.
 *
 * @MCPS802154_ATTR_HW:
 *	Hardware device index, internal to MCPS.
 * @MCPS802154_ATTR_WPAN_PHY_NAME:
 *	Name of corresponding wpan_phy device.
 * @MCPS802154_ATTR_SCHEDULER_NAME:
 *	Name of the scheduler.
 * @MCPS802154_ATTR_SCHEDULER_PARAMS:
 *	Parameters of the scheduler.
 * @MCPS802154_ATTR_SCHEDULER_REGIONS:
 *	Parameters of the regions.
 * @MCPS802154_ATTR_SCHEDULER_CALL:
 *	Call id of the scheduler's procedure, scheduler specific.
 * @MCPS802154_ATTR_SCHEDULER_CALL_PARAMS:
 *	Parameters of the scheduler's procedure, scheduler specific.
 * @MCPS802154_ATTR_SCHEDULER_REGION_CALL:
 *	Parameters of the region call, scheduler specific.
 * @MCPS802154_ATTR_TESTDATA:
 *	Testmode's data blob, passed through to the driver. It contains
 *	driver-specific attributes.
 * @MCPS802154_ATTR_CALIBRATIONS:
 *	Nested array of calibrations.
 * @MCPS802154_ATTR_PWR_STATS:
 * 	Nested power statistics data.
 *
 * @MCPS802154_ATTR_UNSPEC: Invalid command.
 * @__MCPS802154_ATTR_AFTER_LAST: Internal use.
 * @MCPS802154_ATTR_MAX: Internal use.
 */
enum mcps802154_attrs {
	MCPS802154_ATTR_UNSPEC,

	MCPS802154_ATTR_HW,
	MCPS802154_ATTR_WPAN_PHY_NAME,

	MCPS802154_ATTR_SCHEDULER_NAME,
	MCPS802154_ATTR_SCHEDULER_PARAMS,
	MCPS802154_ATTR_SCHEDULER_REGIONS,

	MCPS802154_ATTR_SCHEDULER_CALL,
	MCPS802154_ATTR_SCHEDULER_CALL_PARAMS,

	MCPS802154_ATTR_SCHEDULER_REGION_CALL,

	MCPS802154_ATTR_TESTDATA,

	MCPS802154_ATTR_CALIBRATIONS,

	MCPS802154_ATTR_PWR_STATS,

	__MCPS802154_ATTR_AFTER_LAST,
	MCPS802154_ATTR_MAX = __MCPS802154_ATTR_AFTER_LAST - 1
};

/**
 * enum mcps802154_region_attrs - Regions attributes.
 *
 * @MCPS802154_REGION_ATTR_ID:
 *	ID of the region, scheduler specific.
 * @MCPS802154_REGION_ATTR_NAME:
 *	Name of the region, caller specific.
 * @MCPS802154_REGION_ATTR_PARAMS:
 *	Parameters of the region.
 * @MCPS802154_REGION_ATTR_CALL:
 *	Call id of the region's procedure, scheduler specific.
 * @MCPS802154_REGION_ATTR_CALL_PARAMS:
 *	Parameters of the region's procedure, scheduler specific.
 *
 * @MCPS802154_REGION_UNSPEC: Invalid command.
 * @__MCPS802154_REGION_AFTER_LAST: Internal use.
 * @MCPS802154_REGION_MAX: Internal use.
 */
enum mcps802154_region_attrs {
	MCPS802154_REGION_UNSPEC,

	MCPS802154_REGION_ATTR_ID,
	MCPS802154_REGION_ATTR_NAME,
	MCPS802154_REGION_ATTR_PARAMS,
	MCPS802154_REGION_ATTR_CALL,
	MCPS802154_REGION_ATTR_CALL_PARAMS,

	__MCPS802154_REGION_AFTER_LAST,
	MCPS802154_REGION_MAX = __MCPS802154_REGION_AFTER_LAST - 1
};

/**
 * enum mcps802154_calibrations_attrs - Calibration item.
 *
 * @MCPS802154_CALIBRATIONS_ATTR_KEY:
 *	Calibration name.
 * @MCPS802154_CALIBRATIONS_ATTR_VALUE:
 *	Calibration value.
 * @MCPS802154_CALIBRATIONS_ATTR_STATUS:
 *	Status in case of error on write or read.
 *
 * @MCPS802154_CALIBRATIONS_ATTR_UNSPEC: Invalid command.
 * @__MCPS802154_CALIBRATIONS_ATTR_AFTER_LAST: Internal use.
 * @MCPS802154_CALIBRATIONS_ATTR_MAX: Internal use.
 */
enum mcps802154_calibrations_attrs {
	MCPS802154_CALIBRATIONS_ATTR_UNSPEC,

	MCPS802154_CALIBRATIONS_ATTR_KEY,
	MCPS802154_CALIBRATIONS_ATTR_VALUE,
	MCPS802154_CALIBRATIONS_ATTR_STATUS,

	__MCPS802154_CALIBRATIONS_ATTR_AFTER_LAST,
	MCPS802154_CALIBRATIONS_ATTR_MAX =
		__MCPS802154_CALIBRATIONS_ATTR_AFTER_LAST - 1
};

/**
 * enum mcps802154_nl_pwr_stats_state_attrs - Power state item.
 *
 * @MCPS802154_PWR_STATS_STATE_ATTR_TIME:
 * 	Time spent in this state.
 * @MCPS802154_PWR_STATS_STATE_ATTR_COUNT:
 * 	Number of transitions to this state.
 * @MCPS802154_PWR_STATS_STATE_ATTR_UNSPEC: Invalid command.
 * @__MCPS802154_PWR_STATS_STATE_ATTR_AFTER_LAST: Internal use.
 * @MCPS802154_PWR_STATS_STATE_ATTR_MAX: Internal use.
 */
enum mcps802154_nl_pwr_stats_state_attrs {
	MCPS802154_PWR_STATS_STATE_ATTR_UNSPEC,

	MCPS802154_PWR_STATS_STATE_ATTR_TIME,
	MCPS802154_PWR_STATS_STATE_ATTR_COUNT,

	__MCPS802154_PWR_STATS_STATE_ATTR_AFTER_LAST,
	MCPS802154_PWR_STATS_STATE_ATTR_MAX =
		__MCPS802154_PWR_STATS_STATE_ATTR_AFTER_LAST - 1
};

/**
 * enum mcps802154_pwr_stats_attrs - Power statistics item.
 *
 * @MCPS802154_PWR_STATS_ATTR_SLEEP:
 * 	Sleep state nested attribute.
 * @MCPS802154_PWR_STATS_ATTR_IDLE:
 * 	Idle state nested attribute.
 * @MCPS802154_PWR_STATS_ATTR_RX:
 * 	Rx state nested attribute.
 * @MCPS802154_PWR_STATS_ATTR_TX:
 * 	Tx state nested attribute.
 * @MCPS802154_PWR_STATS_ATTR_INTERRUPTS:
 * 	Interrupts count attribute.
 * @MCPS802154_PWR_STATS_ATTR_UNSPEC: Invalid command.
 * @__MCPS802154_PWR_STATS_ATTR_AFTER_LAST: Internal use.
 * @MCPS802154_PWR_STATS_ATTR_MAX: Internal use.
 */
enum mcps802154_pwr_stats_attrs {
	MCPS802154_PWR_STATS_ATTR_UNSPEC,

	MCPS802154_PWR_STATS_ATTR_SLEEP,
	MCPS802154_PWR_STATS_ATTR_IDLE,
	MCPS802154_PWR_STATS_ATTR_RX,
	MCPS802154_PWR_STATS_ATTR_TX,
	MCPS802154_PWR_STATS_ATTR_INTERRUPTS,

	__MCPS802154_PWR_STATS_ATTR_AFTER_LAST,
	MCPS802154_PWR_STATS_ATTR_MAX =
		__MCPS802154_PWR_STATS_ATTR_AFTER_LAST - 1
};

#endif /* NET_MCPS802154_NL_H */