xref: /openwifi/user_space/sdrctl_src/nl80211_testmode_def.h (revision 14124d7306727ee7bbae83655e3d9ecacc4c3bee)
1 //---nl80211 cmd testmode definitions
2 //---should be used in driver sdr.c and user space app like sdrctl, iw
3 
4 enum openwifi_testmode_attr {
5 	__OPENWIFI_ATTR_INVALID = 0,
6 	OPENWIFI_ATTR_CMD = 1,
7 	OPENWIFI_ATTR_GAP = 2,
8 	OPENWIFI_ATTR_ADDR0 = 3,
9 	OPENWIFI_ATTR_ADDR1 = 4,
10 	OPENWIFI_ATTR_SLICE_TOTAL0 = 5,
11 	OPENWIFI_ATTR_SLICE_START0 = 6,
12 	OPENWIFI_ATTR_SLICE_END0 = 7,
13 	OPENWIFI_ATTR_SLICE_TOTAL1 = 8,
14 	OPENWIFI_ATTR_SLICE_START1 = 9,
15 	OPENWIFI_ATTR_SLICE_END1 = 10,
16 	OPENWIFI_ATTR_RSSI_TH = 11,
17 
18 	REG_ATTR_ADDR = 12,
19 	REG_ATTR_VAL = 13,
20 
21 	/* keep last */
22 	__OPENWIFI_ATTR_AFTER_LAST,
23 	OPENWIFI_ATTR_MAX	= __OPENWIFI_ATTR_AFTER_LAST - 1
24 };
25 
26 enum openwifi_testmode_cmd {
27 	OPENWIFI_CMD_SET_GAP = 0,
28 	OPENWIFI_CMD_GET_GAP = 1,
29 
30 	OPENWIFI_CMD_SET_ADDR0 = 2,
31 	OPENWIFI_CMD_GET_ADDR0 = 3,
32 
33 	OPENWIFI_CMD_SET_ADDR1 = 4,
34 	OPENWIFI_CMD_GET_ADDR1 = 5,
35 
36 	OPENWIFI_CMD_SET_SLICE_TOTAL0 = 6,
37 	OPENWIFI_CMD_GET_SLICE_TOTAL0 = 7,
38 
39 	OPENWIFI_CMD_SET_SLICE_START0 = 8,
40 	OPENWIFI_CMD_GET_SLICE_START0 = 9,
41 
42 	OPENWIFI_CMD_SET_SLICE_END0 = 10,
43 	OPENWIFI_CMD_GET_SLICE_END0 = 11,
44 
45 	OPENWIFI_CMD_SET_SLICE_TOTAL1 = 12,
46 	OPENWIFI_CMD_GET_SLICE_TOTAL1 = 13,
47 
48 	OPENWIFI_CMD_SET_SLICE_START1 = 14,
49 	OPENWIFI_CMD_GET_SLICE_START1 = 15,
50 
51 	OPENWIFI_CMD_SET_SLICE_END1 = 16,
52 	OPENWIFI_CMD_GET_SLICE_END1 = 17,
53 
54 	OPENWIFI_CMD_SET_RSSI_TH = 18,
55 	OPENWIFI_CMD_GET_RSSI_TH = 19,
56 
57 	REG_CMD_SET = 20,
58 	REG_CMD_GET = 21,
59 };
60 
61 static const struct nla_policy openwifi_testmode_policy[OPENWIFI_ATTR_MAX + 1] = {
62 	[OPENWIFI_ATTR_CMD] = { .type = NLA_U32 },
63 	[OPENWIFI_ATTR_GAP] = { .type = NLA_U32 },
64 	[OPENWIFI_ATTR_ADDR0] = { .type = NLA_U32 },
65 	[OPENWIFI_ATTR_ADDR1] = { .type = NLA_U32 },
66 	[OPENWIFI_ATTR_SLICE_TOTAL0] = { .type = NLA_U32 },
67 	[OPENWIFI_ATTR_SLICE_START0] = { .type = NLA_U32 },
68 	[OPENWIFI_ATTR_SLICE_END0] = { .type = NLA_U32 },
69 	[OPENWIFI_ATTR_SLICE_TOTAL1] = { .type = NLA_U32 },
70 	[OPENWIFI_ATTR_SLICE_START1] = { .type = NLA_U32 },
71 	[OPENWIFI_ATTR_SLICE_END1] = { .type = NLA_U32 },
72 	[OPENWIFI_ATTR_RSSI_TH] = { .type = NLA_U32 },
73 
74 	[REG_ATTR_ADDR] = { .type = NLA_U32 },
75 	[REG_ATTR_VAL] = { .type = NLA_U32 },
76 };
77