xref: /openbmc/linux/drivers/net/wireless/ti/wl18xx/cmd.h (revision 234489ac)
1 /* SPDX-License-Identifier: GPL-2.0-only */
2 /*
3  * This file is part of wl18xx
4  *
5  * Copyright (C) 2011 Texas Instruments. All rights reserved.
6  */
7 
8 #ifndef __WL18XX_CMD_H__
9 #define __WL18XX_CMD_H__
10 
11 #include "../wlcore/wlcore.h"
12 #include "../wlcore/acx.h"
13 
14 struct wl18xx_cmd_channel_switch {
15 	struct wl1271_cmd_header header;
16 
17 	u8 role_id;
18 
19 	/* The new serving channel */
20 	u8 channel;
21 	/* Relative time of the serving channel switch in TBTT units */
22 	u8 switch_time;
23 	/* Stop the role TX, should expect it after radar detection */
24 	u8 stop_tx;
25 
26 	__le32 local_supported_rates;
27 
28 	u8 channel_type;
29 	u8 band;
30 
31 	u8 padding[2];
32 } __packed;
33 
34 struct wl18xx_cmd_smart_config_start {
35 	struct wl1271_cmd_header header;
36 
37 	__le32 group_id_bitmask;
38 } __packed;
39 
40 struct wl18xx_cmd_smart_config_set_group_key {
41 	struct wl1271_cmd_header header;
42 
43 	__le32 group_id;
44 
45 	u8 key[16];
46 } __packed;
47 
48 struct wl18xx_cmd_dfs_radar_debug {
49 	struct wl1271_cmd_header header;
50 
51 	u8 channel;
52 	u8 padding[3];
53 } __packed;
54 
55 struct wl18xx_cmd_dfs_master_restart {
56 	struct wl1271_cmd_header header;
57 
58 	u8 role_id;
59 	u8 padding[3];
60 } __packed;
61 
62 /* cac_start and cac_stop share the same params */
63 struct wlcore_cmd_cac_start {
64 	struct wl1271_cmd_header header;
65 
66 	u8 role_id;
67 	u8 channel;
68 	u8 band;
69 	u8 bandwidth;
70 } __packed;
71 
72 int wl18xx_cmd_channel_switch(struct wl1271 *wl,
73 			      struct wl12xx_vif *wlvif,
74 			      struct ieee80211_channel_switch *ch_switch);
75 int wl18xx_cmd_smart_config_start(struct wl1271 *wl, u32 group_bitmap);
76 int wl18xx_cmd_smart_config_stop(struct wl1271 *wl);
77 int wl18xx_cmd_smart_config_set_group_key(struct wl1271 *wl, u16 group_id,
78 					  u8 key_len, u8 *key);
79 int wl18xx_cmd_set_cac(struct wl1271 *wl, struct wl12xx_vif *wlvif, bool start);
80 int wl18xx_cmd_radar_detection_debug(struct wl1271 *wl, u8 channel);
81 int wl18xx_cmd_dfs_master_restart(struct wl1271 *wl, struct wl12xx_vif *wlvif);
82 #endif
83