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
17struct ieee80211_channel;
18struct ieee80211_bss_conf;
19struct ieee80211_tx_queue_params;
20struct cfg80211_scan_request;
21struct wfx_hif_req_add_key;
22struct wfx_dev;
23struct wfx_vif;
24
25struct 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
35void wfx_init_hif_cmd(struct wfx_hif_cmd *wfx_hif_cmd);
36int wfx_cmd_send(struct wfx_dev *wdev, struct wfx_hif_msg *request,
37		 void *reply, size_t reply_len, bool async);
38
39int wfx_hif_read_mib(struct wfx_dev *wdev, int vif_id, u16 mib_id, void *buf, size_t buf_size);
40int wfx_hif_write_mib(struct wfx_dev *wdev, int vif_id, u16 mib_id, void *buf, size_t buf_size);
41int wfx_hif_start(struct wfx_vif *wvif, const struct ieee80211_bss_conf *conf,
42		  const struct ieee80211_channel *channel);
43int wfx_hif_reset(struct wfx_vif *wvif, bool reset_stat);
44int wfx_hif_join(struct wfx_vif *wvif, const struct ieee80211_bss_conf *conf,
45		 struct ieee80211_channel *channel, const u8 *ssid, int ssidlen);
46int wfx_hif_map_link(struct wfx_vif *wvif, bool unmap, u8 *mac_addr, int sta_id, bool mfp);
47int wfx_hif_add_key(struct wfx_dev *wdev, const struct wfx_hif_req_add_key *arg);
48int wfx_hif_remove_key(struct wfx_dev *wdev, int idx);
49int wfx_hif_set_pm(struct wfx_vif *wvif, bool ps, int dynamic_ps_timeout);
50int wfx_hif_set_bss_params(struct wfx_vif *wvif, int aid, int beacon_lost_count);
51int wfx_hif_set_edca_queue_params(struct wfx_vif *wvif, u16 queue,
52				  const struct ieee80211_tx_queue_params *arg);
53int wfx_hif_beacon_transmit(struct wfx_vif *wvif, bool enable);
54int wfx_hif_update_ie_beacon(struct wfx_vif *wvif, const u8 *ies, size_t ies_len);
55int wfx_hif_scan(struct wfx_vif *wvif, struct cfg80211_scan_request *req80211,
56		 int chan_start, int chan_num);
57int wfx_hif_scan_uniq(struct wfx_vif *wvif, struct ieee80211_channel *chan, int duration);
58int wfx_hif_stop_scan(struct wfx_vif *wvif);
59int wfx_hif_configuration(struct wfx_dev *wdev, const u8 *conf, size_t len);
60int wfx_hif_shutdown(struct wfx_dev *wdev);
61
62#endif
63