xref: /linux/drivers/net/wireless/silabs/wfx/hif_tx.h (revision 24bce201d79807b668bf9d9e0aca801c5c0d5f78)
1 /* SPDX-License-Identifier: GPL-2.0-only */
2 /*
3  * Implementation of the host-to-chip commands (aka request/confirmation) of the
4  * hardware API.
5  *
6  * Copyright (c) 2017-2020, Silicon Laboratories, Inc.
7  * Copyright (c) 2010, ST-Ericsson
8  * Copyright (C) 2010, ST-Ericsson SA
9  */
10 #ifndef WFX_HIF_TX_H
11 #define WFX_HIF_TX_H
12 
13 #include <linux/types.h>
14 #include <linux/mutex.h>
15 #include <linux/completion.h>
16 
17 struct ieee80211_channel;
18 struct ieee80211_bss_conf;
19 struct ieee80211_tx_queue_params;
20 struct cfg80211_scan_request;
21 struct wfx_hif_req_add_key;
22 struct wfx_dev;
23 struct wfx_vif;
24 
25 struct wfx_hif_cmd {
26 	struct mutex       lock;
27 	struct completion  ready;
28 	struct completion  done;
29 	struct wfx_hif_msg *buf_send;
30 	void               *buf_recv;
31 	size_t             len_recv;
32 	int                ret;
33 };
34 
35 void wfx_init_hif_cmd(struct wfx_hif_cmd *wfx_hif_cmd);
36 int wfx_cmd_send(struct wfx_dev *wdev, struct wfx_hif_msg *request,
37 		 void *reply, size_t reply_len, bool async);
38 
39 int wfx_hif_read_mib(struct wfx_dev *wdev, int vif_id, u16 mib_id, void *buf, size_t buf_size);
40 int wfx_hif_write_mib(struct wfx_dev *wdev, int vif_id, u16 mib_id, void *buf, size_t buf_size);
41 int wfx_hif_start(struct wfx_vif *wvif, const struct ieee80211_bss_conf *conf,
42 		  const struct ieee80211_channel *channel);
43 int wfx_hif_reset(struct wfx_vif *wvif, bool reset_stat);
44 int wfx_hif_join(struct wfx_vif *wvif, const struct ieee80211_bss_conf *conf,
45 		 struct ieee80211_channel *channel, const u8 *ssid, int ssidlen);
46 int wfx_hif_map_link(struct wfx_vif *wvif, bool unmap, u8 *mac_addr, int sta_id, bool mfp);
47 int wfx_hif_add_key(struct wfx_dev *wdev, const struct wfx_hif_req_add_key *arg);
48 int wfx_hif_remove_key(struct wfx_dev *wdev, int idx);
49 int wfx_hif_set_pm(struct wfx_vif *wvif, bool ps, int dynamic_ps_timeout);
50 int wfx_hif_set_bss_params(struct wfx_vif *wvif, int aid, int beacon_lost_count);
51 int wfx_hif_set_edca_queue_params(struct wfx_vif *wvif, u16 queue,
52 				  const struct ieee80211_tx_queue_params *arg);
53 int wfx_hif_beacon_transmit(struct wfx_vif *wvif, bool enable);
54 int wfx_hif_update_ie_beacon(struct wfx_vif *wvif, const u8 *ies, size_t ies_len);
55 int wfx_hif_scan(struct wfx_vif *wvif, struct cfg80211_scan_request *req80211,
56 		 int chan_start, int chan_num);
57 int wfx_hif_stop_scan(struct wfx_vif *wvif);
58 int wfx_hif_configuration(struct wfx_dev *wdev, const u8 *conf, size_t len);
59 int wfx_hif_shutdown(struct wfx_dev *wdev);
60 
61 #endif
62