xref: /openbmc/linux/drivers/net/wireless/silabs/wfx/sta.h (revision 0d4bb5e4)
1 /* SPDX-License-Identifier: GPL-2.0-only */
2 /*
3  * Implementation of mac80211 API.
4  *
5  * Copyright (c) 2017-2020, Silicon Laboratories, Inc.
6  * Copyright (c) 2010, ST-Ericsson
7  */
8 #ifndef WFX_STA_H
9 #define WFX_STA_H
10 
11 #include <net/mac80211.h>
12 
13 struct wfx_dev;
14 struct wfx_vif;
15 
16 struct wfx_sta_priv {
17 	int link_id;
18 	int vif_id;
19 };
20 
21 /* mac80211 interface */
22 int wfx_start(struct ieee80211_hw *hw);
23 void wfx_stop(struct ieee80211_hw *hw);
24 int wfx_config(struct ieee80211_hw *hw, u32 changed);
25 int wfx_set_rts_threshold(struct ieee80211_hw *hw, u32 value);
26 void wfx_set_default_unicast_key(struct ieee80211_hw *hw, struct ieee80211_vif *vif, int idx);
27 void wfx_configure_filter(struct ieee80211_hw *hw, unsigned int changed_flags,
28 			  unsigned int *total_flags, u64 unused);
29 
30 int wfx_add_interface(struct ieee80211_hw *hw, struct ieee80211_vif *vif);
31 void wfx_remove_interface(struct ieee80211_hw *hw, struct ieee80211_vif *vif);
32 int wfx_start_ap(struct ieee80211_hw *hw, struct ieee80211_vif *vif,
33 		 struct ieee80211_bss_conf *link_conf);
34 void wfx_stop_ap(struct ieee80211_hw *hw, struct ieee80211_vif *vif,
35 		 struct ieee80211_bss_conf *link_conf);
36 int wfx_join_ibss(struct ieee80211_hw *hw, struct ieee80211_vif *vif);
37 void wfx_leave_ibss(struct ieee80211_hw *hw, struct ieee80211_vif *vif);
38 int wfx_conf_tx(struct ieee80211_hw *hw, struct ieee80211_vif *vif,
39 		unsigned int link_id, u16 queue,
40 		const struct ieee80211_tx_queue_params *params);
41 void wfx_bss_info_changed(struct ieee80211_hw *hw, struct ieee80211_vif *vif,
42 			  struct ieee80211_bss_conf *info, u64 changed);
43 int wfx_sta_add(struct ieee80211_hw *hw, struct ieee80211_vif *vif, struct ieee80211_sta *sta);
44 int wfx_sta_remove(struct ieee80211_hw *hw, struct ieee80211_vif *vif, struct ieee80211_sta *sta);
45 void wfx_sta_notify(struct ieee80211_hw *hw, struct ieee80211_vif *vif,
46 		    enum sta_notify_cmd cmd, struct ieee80211_sta *sta);
47 int wfx_set_tim(struct ieee80211_hw *hw, struct ieee80211_sta *sta, bool set);
48 int wfx_ampdu_action(struct ieee80211_hw *hw, struct ieee80211_vif *vif,
49 		     struct ieee80211_ampdu_params *params);
50 int wfx_add_chanctx(struct ieee80211_hw *hw, struct ieee80211_chanctx_conf *conf);
51 void wfx_remove_chanctx(struct ieee80211_hw *hw, struct ieee80211_chanctx_conf *conf);
52 void wfx_change_chanctx(struct ieee80211_hw *hw, struct ieee80211_chanctx_conf *conf, u32 changed);
53 int wfx_assign_vif_chanctx(struct ieee80211_hw *hw, struct ieee80211_vif *vif,
54 			   struct ieee80211_bss_conf *link_conf,
55 			   struct ieee80211_chanctx_conf *conf);
56 void wfx_unassign_vif_chanctx(struct ieee80211_hw *hw, struct ieee80211_vif *vif,
57 			      struct ieee80211_bss_conf *link_conf,
58 			      struct ieee80211_chanctx_conf *conf);
59 
60 /* Hardware API Callbacks */
61 void wfx_cooling_timeout_work(struct work_struct *work);
62 void wfx_suspend_hot_dev(struct wfx_dev *wdev, enum sta_notify_cmd cmd);
63 void wfx_suspend_resume_mc(struct wfx_vif *wvif, enum sta_notify_cmd cmd);
64 void wfx_event_report_rssi(struct wfx_vif *wvif, u8 raw_rcpi_rssi);
65 int wfx_update_pm(struct wfx_vif *wvif);
66 
67 /* Other Helpers */
68 void wfx_reset(struct wfx_vif *wvif);
69 u32 wfx_rate_mask_to_hw(struct wfx_dev *wdev, u32 rates);
70 
71 #endif
72