]> git.proxmox.com Git - mirror_ubuntu-hirsute-kernel.git/blob - drivers/net/wireless/ath/wcn36xx/smd.h
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jikos/trivial
[mirror_ubuntu-hirsute-kernel.git] / drivers / net / wireless / ath / wcn36xx / smd.h
1 /*
2 * Copyright (c) 2013 Eugene Krasnikov <k.eugene.e@gmail.com>
3 *
4 * Permission to use, copy, modify, and/or distribute this software for any
5 * purpose with or without fee is hereby granted, provided that the above
6 * copyright notice and this permission notice appear in all copies.
7 *
8 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
9 * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
10 * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
11 * SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
12 * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION
13 * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
14 * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
15 */
16
17 #ifndef _SMD_H_
18 #define _SMD_H_
19
20 #include "wcn36xx.h"
21
22 /* Max shared size is 4k but we take less.*/
23 #define WCN36XX_NV_FRAGMENT_SIZE 3072
24
25 #define WCN36XX_HAL_BUF_SIZE 4096
26
27 #define HAL_MSG_TIMEOUT 500
28 #define WCN36XX_SMSM_WLAN_TX_ENABLE 0x00000400
29 #define WCN36XX_SMSM_WLAN_TX_RINGS_EMPTY 0x00000200
30 /* The PNO version info be contained in the rsp msg */
31 #define WCN36XX_FW_MSG_PNO_VERSION_MASK 0x8000
32
33 enum wcn36xx_fw_msg_result {
34 WCN36XX_FW_MSG_RESULT_SUCCESS = 0,
35 WCN36XX_FW_MSG_RESULT_SUCCESS_SYNC = 1,
36
37 WCN36XX_FW_MSG_RESULT_MEM_FAIL = 5,
38 };
39
40 /******************************/
41 /* SMD requests and responses */
42 /******************************/
43 struct wcn36xx_fw_msg_status_rsp {
44 u32 status;
45 } __packed;
46
47 /* wcn3620 returns this for tigger_ba */
48
49 struct wcn36xx_fw_msg_status_rsp_v2 {
50 u8 bss_id[6];
51 u32 status __packed;
52 u16 count_following_candidates __packed;
53 /* candidate list follows */
54 };
55
56 struct wcn36xx_hal_ind_msg {
57 struct list_head list;
58 u8 *msg;
59 size_t msg_len;
60 };
61
62 struct wcn36xx;
63
64 int wcn36xx_smd_open(struct wcn36xx *wcn);
65 void wcn36xx_smd_close(struct wcn36xx *wcn);
66
67 int wcn36xx_smd_load_nv(struct wcn36xx *wcn);
68 int wcn36xx_smd_start(struct wcn36xx *wcn);
69 int wcn36xx_smd_stop(struct wcn36xx *wcn);
70 int wcn36xx_smd_init_scan(struct wcn36xx *wcn, enum wcn36xx_hal_sys_mode mode);
71 int wcn36xx_smd_start_scan(struct wcn36xx *wcn);
72 int wcn36xx_smd_end_scan(struct wcn36xx *wcn);
73 int wcn36xx_smd_finish_scan(struct wcn36xx *wcn,
74 enum wcn36xx_hal_sys_mode mode);
75 int wcn36xx_smd_update_scan_params(struct wcn36xx *wcn);
76 int wcn36xx_smd_add_sta_self(struct wcn36xx *wcn, struct ieee80211_vif *vif);
77 int wcn36xx_smd_delete_sta_self(struct wcn36xx *wcn, u8 *addr);
78 int wcn36xx_smd_delete_sta(struct wcn36xx *wcn, u8 sta_index);
79 int wcn36xx_smd_join(struct wcn36xx *wcn, const u8 *bssid, u8 *vif, u8 ch);
80 int wcn36xx_smd_set_link_st(struct wcn36xx *wcn, const u8 *bssid,
81 const u8 *sta_mac,
82 enum wcn36xx_hal_link_state state);
83 int wcn36xx_smd_config_bss(struct wcn36xx *wcn, struct ieee80211_vif *vif,
84 struct ieee80211_sta *sta, const u8 *bssid,
85 bool update);
86 int wcn36xx_smd_delete_bss(struct wcn36xx *wcn, struct ieee80211_vif *vif);
87 int wcn36xx_smd_config_sta(struct wcn36xx *wcn, struct ieee80211_vif *vif,
88 struct ieee80211_sta *sta);
89 int wcn36xx_smd_send_beacon(struct wcn36xx *wcn, struct ieee80211_vif *vif,
90 struct sk_buff *skb_beacon, u16 tim_off,
91 u16 p2p_off);
92 int wcn36xx_smd_switch_channel(struct wcn36xx *wcn,
93 struct ieee80211_vif *vif, int ch);
94 int wcn36xx_smd_update_proberesp_tmpl(struct wcn36xx *wcn,
95 struct ieee80211_vif *vif,
96 struct sk_buff *skb);
97 int wcn36xx_smd_set_stakey(struct wcn36xx *wcn,
98 enum ani_ed_type enc_type,
99 u8 keyidx,
100 u8 keylen,
101 u8 *key,
102 u8 sta_index);
103 int wcn36xx_smd_set_bsskey(struct wcn36xx *wcn,
104 enum ani_ed_type enc_type,
105 u8 keyidx,
106 u8 keylen,
107 u8 *key);
108 int wcn36xx_smd_remove_stakey(struct wcn36xx *wcn,
109 enum ani_ed_type enc_type,
110 u8 keyidx,
111 u8 sta_index);
112 int wcn36xx_smd_remove_bsskey(struct wcn36xx *wcn,
113 enum ani_ed_type enc_type,
114 u8 keyidx);
115 int wcn36xx_smd_enter_bmps(struct wcn36xx *wcn, struct ieee80211_vif *vif);
116 int wcn36xx_smd_exit_bmps(struct wcn36xx *wcn, struct ieee80211_vif *vif);
117 int wcn36xx_smd_set_power_params(struct wcn36xx *wcn, bool ignore_dtim);
118 int wcn36xx_smd_keep_alive_req(struct wcn36xx *wcn,
119 struct ieee80211_vif *vif,
120 int packet_type);
121 int wcn36xx_smd_dump_cmd_req(struct wcn36xx *wcn, u32 arg1, u32 arg2,
122 u32 arg3, u32 arg4, u32 arg5);
123 int wcn36xx_smd_feature_caps_exchange(struct wcn36xx *wcn);
124 void set_feat_caps(u32 *bitmap, enum place_holder_in_cap_bitmap cap);
125 int get_feat_caps(u32 *bitmap, enum place_holder_in_cap_bitmap cap);
126 void clear_feat_caps(u32 *bitmap, enum place_holder_in_cap_bitmap cap);
127
128 int wcn36xx_smd_add_ba_session(struct wcn36xx *wcn,
129 struct ieee80211_sta *sta,
130 u16 tid,
131 u16 *ssn,
132 u8 direction,
133 u8 sta_index);
134 int wcn36xx_smd_add_ba(struct wcn36xx *wcn);
135 int wcn36xx_smd_del_ba(struct wcn36xx *wcn, u16 tid, u8 sta_index);
136 int wcn36xx_smd_trigger_ba(struct wcn36xx *wcn, u8 sta_index);
137
138 int wcn36xx_smd_update_cfg(struct wcn36xx *wcn, u32 cfg_id, u32 value);
139 #endif /* _SMD_H_ */