xref: /linux/drivers/net/wireless/ti/wl18xx/cmd.h (revision 93df8a1ed6231727c5db94a80b1a6bd5ee67cec3)
1 /*
2  * This file is part of wl18xx
3  *
4  * Copyright (C) 2011 Texas Instruments. All rights reserved.
5  *
6  * This program is free software; you can redistribute it and/or
7  * modify it under the terms of the GNU General Public License
8  * version 2 as published by the Free Software Foundation.
9  *
10  * This program is distributed in the hope that it will be useful, but
11  * WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
13  * General Public License for more details.
14  *
15  * You should have received a copy of the GNU General Public License
16  * along with this program; if not, write to the Free Software
17  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
18  * 02110-1301 USA
19  *
20  */
21 
22 #ifndef __WL18XX_CMD_H__
23 #define __WL18XX_CMD_H__
24 
25 #include "../wlcore/wlcore.h"
26 #include "../wlcore/acx.h"
27 
28 struct wl18xx_cmd_channel_switch {
29 	struct wl1271_cmd_header header;
30 
31 	u8 role_id;
32 
33 	/* The new serving channel */
34 	u8 channel;
35 	/* Relative time of the serving channel switch in TBTT units */
36 	u8 switch_time;
37 	/* Stop the role TX, should expect it after radar detection */
38 	u8 stop_tx;
39 
40 	__le32 local_supported_rates;
41 
42 	u8 channel_type;
43 	u8 band;
44 
45 	u8 padding[2];
46 } __packed;
47 
48 struct wl18xx_cmd_smart_config_start {
49 	struct wl1271_cmd_header header;
50 
51 	__le32 group_id_bitmask;
52 } __packed;
53 
54 struct wl18xx_cmd_smart_config_set_group_key {
55 	struct wl1271_cmd_header header;
56 
57 	__le32 group_id;
58 
59 	u8 key[16];
60 } __packed;
61 
62 struct wl18xx_cmd_dfs_radar_debug {
63 	struct wl1271_cmd_header header;
64 
65 	u8 channel;
66 	u8 padding[3];
67 } __packed;
68 
69 struct wl18xx_cmd_dfs_master_restart {
70 	struct wl1271_cmd_header header;
71 
72 	u8 role_id;
73 	u8 padding[3];
74 } __packed;
75 
76 /* cac_start and cac_stop share the same params */
77 struct wlcore_cmd_cac_start {
78 	struct wl1271_cmd_header header;
79 
80 	u8 role_id;
81 	u8 channel;
82 	u8 band;
83 	u8 bandwidth;
84 } __packed;
85 
86 int wl18xx_cmd_channel_switch(struct wl1271 *wl,
87 			      struct wl12xx_vif *wlvif,
88 			      struct ieee80211_channel_switch *ch_switch);
89 int wl18xx_cmd_smart_config_start(struct wl1271 *wl, u32 group_bitmap);
90 int wl18xx_cmd_smart_config_stop(struct wl1271 *wl);
91 int wl18xx_cmd_smart_config_set_group_key(struct wl1271 *wl, u16 group_id,
92 					  u8 key_len, u8 *key);
93 int wl18xx_cmd_set_cac(struct wl1271 *wl, struct wl12xx_vif *wlvif, bool start);
94 int wl18xx_cmd_radar_detection_debug(struct wl1271 *wl, u8 channel);
95 int wl18xx_cmd_dfs_master_restart(struct wl1271 *wl, struct wl12xx_vif *wlvif);
96 #endif
97