treewide: remove redundant IS_ERR() before error code check
[linux/fpc-iii.git] / drivers / staging / wfx / sta.h
blobcf99a8a74a81b2f67f3130eac14a75a038150ca9
1 /* SPDX-License-Identifier: GPL-2.0-only */
2 /*
3 * Implementation of mac80211 API.
5 * Copyright (c) 2017-2019, Silicon Laboratories, Inc.
6 * Copyright (c) 2010, ST-Ericsson
7 */
8 #ifndef WFX_STA_H
9 #define WFX_STA_H
11 #include <net/mac80211.h>
13 #include "hif_api_cmd.h"
15 struct wfx_dev;
16 struct wfx_vif;
18 enum wfx_state {
19 WFX_STATE_PASSIVE = 0,
20 WFX_STATE_PRE_STA,
21 WFX_STATE_STA,
22 WFX_STATE_IBSS,
23 WFX_STATE_AP,
26 struct wfx_hif_event {
27 struct list_head link;
28 struct hif_ind_event evt;
31 struct wfx_grp_addr_table {
32 bool enable;
33 int num_addresses;
34 u8 address_list[8][ETH_ALEN];
37 struct wfx_sta_priv {
38 int link_id;
39 int vif_id;
40 u8 buffered[IEEE80211_NUM_TIDS];
41 // Ensure atomicity of "buffered" and calls to ieee80211_sta_set_buffered()
42 spinlock_t lock;
45 // mac80211 interface
46 int wfx_start(struct ieee80211_hw *hw);
47 void wfx_stop(struct ieee80211_hw *hw);
48 int wfx_config(struct ieee80211_hw *hw, u32 changed);
49 int wfx_set_rts_threshold(struct ieee80211_hw *hw, u32 value);
50 u64 wfx_prepare_multicast(struct ieee80211_hw *hw,
51 struct netdev_hw_addr_list *mc_list);
52 void wfx_configure_filter(struct ieee80211_hw *hw, unsigned int changed_flags,
53 unsigned int *total_flags, u64 unused);
55 int wfx_add_interface(struct ieee80211_hw *hw, struct ieee80211_vif *vif);
56 void wfx_remove_interface(struct ieee80211_hw *hw, struct ieee80211_vif *vif);
57 void wfx_flush(struct ieee80211_hw *hw, struct ieee80211_vif *vif,
58 u32 queues, bool drop);
59 int wfx_conf_tx(struct ieee80211_hw *hw, struct ieee80211_vif *vif,
60 u16 queue, const struct ieee80211_tx_queue_params *params);
61 void wfx_bss_info_changed(struct ieee80211_hw *hw, struct ieee80211_vif *vif,
62 struct ieee80211_bss_conf *info, u32 changed);
63 int wfx_sta_add(struct ieee80211_hw *hw, struct ieee80211_vif *vif,
64 struct ieee80211_sta *sta);
65 int wfx_sta_remove(struct ieee80211_hw *hw, struct ieee80211_vif *vif,
66 struct ieee80211_sta *sta);
67 void wfx_sta_notify(struct ieee80211_hw *hw, struct ieee80211_vif *vif,
68 enum sta_notify_cmd cmd, struct ieee80211_sta *sta);
69 int wfx_set_tim(struct ieee80211_hw *hw, struct ieee80211_sta *sta, bool set);
70 int wfx_ampdu_action(struct ieee80211_hw *hw, struct ieee80211_vif *vif,
71 struct ieee80211_ampdu_params *params);
72 int wfx_add_chanctx(struct ieee80211_hw *hw,
73 struct ieee80211_chanctx_conf *conf);
74 void wfx_remove_chanctx(struct ieee80211_hw *hw,
75 struct ieee80211_chanctx_conf *conf);
76 void wfx_change_chanctx(struct ieee80211_hw *hw,
77 struct ieee80211_chanctx_conf *conf, u32 changed);
78 int wfx_assign_vif_chanctx(struct ieee80211_hw *hw, struct ieee80211_vif *vif,
79 struct ieee80211_chanctx_conf *conf);
80 void wfx_unassign_vif_chanctx(struct ieee80211_hw *hw,
81 struct ieee80211_vif *vif,
82 struct ieee80211_chanctx_conf *conf);
84 // WSM Callbacks
85 void wfx_suspend_resume_mc(struct wfx_vif *wvif, enum sta_notify_cmd cmd);
87 // Other Helpers
88 void wfx_cqm_bssloss_sm(struct wfx_vif *wvif, int init, int good, int bad);
89 void wfx_update_filtering(struct wfx_vif *wvif);
90 int wfx_fwd_probe_req(struct wfx_vif *wvif, bool enable);
91 u32 wfx_rate_mask_to_hw(struct wfx_dev *wdev, u32 rates);
93 #endif /* WFX_STA_H */