aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/ath/ath10k/wmi-ops.h
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net/wireless/ath/ath10k/wmi-ops.h')
-rw-r--r--drivers/net/wireless/ath/ath10k/wmi-ops.h194
1 files changed, 191 insertions, 3 deletions
diff --git a/drivers/net/wireless/ath/ath10k/wmi-ops.h b/drivers/net/wireless/ath/ath10k/wmi-ops.h
index c8b64e7a6089..47fe2e756bec 100644
--- a/drivers/net/wireless/ath/ath10k/wmi-ops.h
+++ b/drivers/net/wireless/ath/ath10k/wmi-ops.h
@@ -45,6 +45,10 @@ struct wmi_ops {
45 struct wmi_rdy_ev_arg *arg); 45 struct wmi_rdy_ev_arg *arg);
46 int (*pull_fw_stats)(struct ath10k *ar, struct sk_buff *skb, 46 int (*pull_fw_stats)(struct ath10k *ar, struct sk_buff *skb,
47 struct ath10k_fw_stats *stats); 47 struct ath10k_fw_stats *stats);
48 int (*pull_roam_ev)(struct ath10k *ar, struct sk_buff *skb,
49 struct wmi_roam_ev_arg *arg);
50 int (*pull_wow_event)(struct ath10k *ar, struct sk_buff *skb,
51 struct wmi_wow_ev_arg *arg);
48 52
49 struct sk_buff *(*gen_pdev_suspend)(struct ath10k *ar, u32 suspend_opt); 53 struct sk_buff *(*gen_pdev_suspend)(struct ath10k *ar, u32 suspend_opt);
50 struct sk_buff *(*gen_pdev_resume)(struct ath10k *ar); 54 struct sk_buff *(*gen_pdev_resume)(struct ath10k *ar);
@@ -81,7 +85,8 @@ struct wmi_ops {
81 struct sk_buff *(*gen_vdev_wmm_conf)(struct ath10k *ar, u32 vdev_id, 85 struct sk_buff *(*gen_vdev_wmm_conf)(struct ath10k *ar, u32 vdev_id,
82 const struct wmi_wmm_params_all_arg *arg); 86 const struct wmi_wmm_params_all_arg *arg);
83 struct sk_buff *(*gen_peer_create)(struct ath10k *ar, u32 vdev_id, 87 struct sk_buff *(*gen_peer_create)(struct ath10k *ar, u32 vdev_id,
84 const u8 peer_addr[ETH_ALEN]); 88 const u8 peer_addr[ETH_ALEN],
89 enum wmi_peer_type peer_type);
85 struct sk_buff *(*gen_peer_delete)(struct ath10k *ar, u32 vdev_id, 90 struct sk_buff *(*gen_peer_delete)(struct ath10k *ar, u32 vdev_id,
86 const u8 peer_addr[ETH_ALEN]); 91 const u8 peer_addr[ETH_ALEN]);
87 struct sk_buff *(*gen_peer_flush)(struct ath10k *ar, u32 vdev_id, 92 struct sk_buff *(*gen_peer_flush)(struct ath10k *ar, u32 vdev_id,
@@ -148,6 +153,27 @@ struct wmi_ops {
148 u32 num_ac); 153 u32 num_ac);
149 struct sk_buff *(*gen_sta_keepalive)(struct ath10k *ar, 154 struct sk_buff *(*gen_sta_keepalive)(struct ath10k *ar,
150 const struct wmi_sta_keepalive_arg *arg); 155 const struct wmi_sta_keepalive_arg *arg);
156 struct sk_buff *(*gen_wow_enable)(struct ath10k *ar);
157 struct sk_buff *(*gen_wow_add_wakeup_event)(struct ath10k *ar, u32 vdev_id,
158 enum wmi_wow_wakeup_event event,
159 u32 enable);
160 struct sk_buff *(*gen_wow_host_wakeup_ind)(struct ath10k *ar);
161 struct sk_buff *(*gen_wow_add_pattern)(struct ath10k *ar, u32 vdev_id,
162 u32 pattern_id,
163 const u8 *pattern,
164 const u8 *mask,
165 int pattern_len,
166 int pattern_offset);
167 struct sk_buff *(*gen_wow_del_pattern)(struct ath10k *ar, u32 vdev_id,
168 u32 pattern_id);
169 struct sk_buff *(*gen_update_fw_tdls_state)(struct ath10k *ar,
170 u32 vdev_id,
171 enum wmi_tdls_state state);
172 struct sk_buff *(*gen_tdls_peer_update)(struct ath10k *ar,
173 const struct wmi_tdls_peer_update_cmd_arg *arg,
174 const struct wmi_tdls_peer_capab_arg *cap,
175 const struct wmi_channel_arg *chan);
176 struct sk_buff *(*gen_adaptive_qcs)(struct ath10k *ar, bool enable);
151}; 177};
152 178
153int ath10k_wmi_cmd_send(struct ath10k *ar, struct sk_buff *skb, u32 cmd_id); 179int ath10k_wmi_cmd_send(struct ath10k *ar, struct sk_buff *skb, u32 cmd_id);
@@ -274,6 +300,26 @@ ath10k_wmi_pull_fw_stats(struct ath10k *ar, struct sk_buff *skb,
274} 300}
275 301
276static inline int 302static inline int
303ath10k_wmi_pull_roam_ev(struct ath10k *ar, struct sk_buff *skb,
304 struct wmi_roam_ev_arg *arg)
305{
306 if (!ar->wmi.ops->pull_roam_ev)
307 return -EOPNOTSUPP;
308
309 return ar->wmi.ops->pull_roam_ev(ar, skb, arg);
310}
311
312static inline int
313ath10k_wmi_pull_wow_event(struct ath10k *ar, struct sk_buff *skb,
314 struct wmi_wow_ev_arg *arg)
315{
316 if (!ar->wmi.ops->pull_wow_event)
317 return -EOPNOTSUPP;
318
319 return ar->wmi.ops->pull_wow_event(ar, skb, arg);
320}
321
322static inline int
277ath10k_wmi_mgmt_tx(struct ath10k *ar, struct sk_buff *msdu) 323ath10k_wmi_mgmt_tx(struct ath10k *ar, struct sk_buff *msdu)
278{ 324{
279 struct ieee80211_tx_info *info = IEEE80211_SKB_CB(msdu); 325 struct ieee80211_tx_info *info = IEEE80211_SKB_CB(msdu);
@@ -624,14 +670,15 @@ ath10k_wmi_vdev_wmm_conf(struct ath10k *ar, u32 vdev_id,
624 670
625static inline int 671static inline int
626ath10k_wmi_peer_create(struct ath10k *ar, u32 vdev_id, 672ath10k_wmi_peer_create(struct ath10k *ar, u32 vdev_id,
627 const u8 peer_addr[ETH_ALEN]) 673 const u8 peer_addr[ETH_ALEN],
674 enum wmi_peer_type peer_type)
628{ 675{
629 struct sk_buff *skb; 676 struct sk_buff *skb;
630 677
631 if (!ar->wmi.ops->gen_peer_create) 678 if (!ar->wmi.ops->gen_peer_create)
632 return -EOPNOTSUPP; 679 return -EOPNOTSUPP;
633 680
634 skb = ar->wmi.ops->gen_peer_create(ar, vdev_id, peer_addr); 681 skb = ar->wmi.ops->gen_peer_create(ar, vdev_id, peer_addr, peer_type);
635 if (IS_ERR(skb)) 682 if (IS_ERR(skb))
636 return PTR_ERR(skb); 683 return PTR_ERR(skb);
637 684
@@ -1060,4 +1107,145 @@ ath10k_wmi_sta_keepalive(struct ath10k *ar,
1060 return ath10k_wmi_cmd_send(ar, skb, cmd_id); 1107 return ath10k_wmi_cmd_send(ar, skb, cmd_id);
1061} 1108}
1062 1109
1110static inline int
1111ath10k_wmi_wow_enable(struct ath10k *ar)
1112{
1113 struct sk_buff *skb;
1114 u32 cmd_id;
1115
1116 if (!ar->wmi.ops->gen_wow_enable)
1117 return -EOPNOTSUPP;
1118
1119 skb = ar->wmi.ops->gen_wow_enable(ar);
1120 if (IS_ERR(skb))
1121 return PTR_ERR(skb);
1122
1123 cmd_id = ar->wmi.cmd->wow_enable_cmdid;
1124 return ath10k_wmi_cmd_send(ar, skb, cmd_id);
1125}
1126
1127static inline int
1128ath10k_wmi_wow_add_wakeup_event(struct ath10k *ar, u32 vdev_id,
1129 enum wmi_wow_wakeup_event event,
1130 u32 enable)
1131{
1132 struct sk_buff *skb;
1133 u32 cmd_id;
1134
1135 if (!ar->wmi.ops->gen_wow_add_wakeup_event)
1136 return -EOPNOTSUPP;
1137
1138 skb = ar->wmi.ops->gen_wow_add_wakeup_event(ar, vdev_id, event, enable);
1139 if (IS_ERR(skb))
1140 return PTR_ERR(skb);
1141
1142 cmd_id = ar->wmi.cmd->wow_enable_disable_wake_event_cmdid;
1143 return ath10k_wmi_cmd_send(ar, skb, cmd_id);
1144}
1145
1146static inline int
1147ath10k_wmi_wow_host_wakeup_ind(struct ath10k *ar)
1148{
1149 struct sk_buff *skb;
1150 u32 cmd_id;
1151
1152 if (!ar->wmi.ops->gen_wow_host_wakeup_ind)
1153 return -EOPNOTSUPP;
1154
1155 skb = ar->wmi.ops->gen_wow_host_wakeup_ind(ar);
1156 if (IS_ERR(skb))
1157 return PTR_ERR(skb);
1158
1159 cmd_id = ar->wmi.cmd->wow_hostwakeup_from_sleep_cmdid;
1160 return ath10k_wmi_cmd_send(ar, skb, cmd_id);
1161}
1162
1163static inline int
1164ath10k_wmi_wow_add_pattern(struct ath10k *ar, u32 vdev_id, u32 pattern_id,
1165 const u8 *pattern, const u8 *mask,
1166 int pattern_len, int pattern_offset)
1167{
1168 struct sk_buff *skb;
1169 u32 cmd_id;
1170
1171 if (!ar->wmi.ops->gen_wow_add_pattern)
1172 return -EOPNOTSUPP;
1173
1174 skb = ar->wmi.ops->gen_wow_add_pattern(ar, vdev_id, pattern_id,
1175 pattern, mask, pattern_len,
1176 pattern_offset);
1177 if (IS_ERR(skb))
1178 return PTR_ERR(skb);
1179
1180 cmd_id = ar->wmi.cmd->wow_add_wake_pattern_cmdid;
1181 return ath10k_wmi_cmd_send(ar, skb, cmd_id);
1182}
1183
1184static inline int
1185ath10k_wmi_wow_del_pattern(struct ath10k *ar, u32 vdev_id, u32 pattern_id)
1186{
1187 struct sk_buff *skb;
1188 u32 cmd_id;
1189
1190 if (!ar->wmi.ops->gen_wow_del_pattern)
1191 return -EOPNOTSUPP;
1192
1193 skb = ar->wmi.ops->gen_wow_del_pattern(ar, vdev_id, pattern_id);
1194 if (IS_ERR(skb))
1195 return PTR_ERR(skb);
1196
1197 cmd_id = ar->wmi.cmd->wow_del_wake_pattern_cmdid;
1198 return ath10k_wmi_cmd_send(ar, skb, cmd_id);
1199}
1200
1201static inline int
1202ath10k_wmi_update_fw_tdls_state(struct ath10k *ar, u32 vdev_id,
1203 enum wmi_tdls_state state)
1204{
1205 struct sk_buff *skb;
1206
1207 if (!ar->wmi.ops->gen_update_fw_tdls_state)
1208 return -EOPNOTSUPP;
1209
1210 skb = ar->wmi.ops->gen_update_fw_tdls_state(ar, vdev_id, state);
1211 if (IS_ERR(skb))
1212 return PTR_ERR(skb);
1213
1214 return ath10k_wmi_cmd_send(ar, skb, ar->wmi.cmd->tdls_set_state_cmdid);
1215}
1216
1217static inline int
1218ath10k_wmi_tdls_peer_update(struct ath10k *ar,
1219 const struct wmi_tdls_peer_update_cmd_arg *arg,
1220 const struct wmi_tdls_peer_capab_arg *cap,
1221 const struct wmi_channel_arg *chan)
1222{
1223 struct sk_buff *skb;
1224
1225 if (!ar->wmi.ops->gen_tdls_peer_update)
1226 return -EOPNOTSUPP;
1227
1228 skb = ar->wmi.ops->gen_tdls_peer_update(ar, arg, cap, chan);
1229 if (IS_ERR(skb))
1230 return PTR_ERR(skb);
1231
1232 return ath10k_wmi_cmd_send(ar, skb,
1233 ar->wmi.cmd->tdls_peer_update_cmdid);
1234}
1235
1236static inline int
1237ath10k_wmi_adaptive_qcs(struct ath10k *ar, bool enable)
1238{
1239 struct sk_buff *skb;
1240
1241 if (!ar->wmi.ops->gen_adaptive_qcs)
1242 return -EOPNOTSUPP;
1243
1244 skb = ar->wmi.ops->gen_adaptive_qcs(ar, enable);
1245 if (IS_ERR(skb))
1246 return PTR_ERR(skb);
1247
1248 return ath10k_wmi_cmd_send(ar, skb, ar->wmi.cmd->adaptive_qcs_cmdid);
1249}
1250
1063#endif 1251#endif