#ifndef __MAC80211_DRIVER_OPS
#define __MAC80211_DRIVER_OPS
#include <net/mac80211.h>
#include "ieee80211_i.h"
#include "trace.h"
#define check_sdata_in_driver(sdata) …
static inline struct ieee80211_sub_if_data *
get_bss_sdata(struct ieee80211_sub_if_data *sdata)
{ … }
static inline void drv_tx(struct ieee80211_local *local,
struct ieee80211_tx_control *control,
struct sk_buff *skb)
{ … }
static inline void drv_sync_rx_queues(struct ieee80211_local *local,
struct sta_info *sta)
{ … }
static inline void drv_get_et_strings(struct ieee80211_sub_if_data *sdata,
u32 sset, u8 *data)
{ … }
static inline void drv_get_et_stats(struct ieee80211_sub_if_data *sdata,
struct ethtool_stats *stats,
u64 *data)
{ … }
static inline int drv_get_et_sset_count(struct ieee80211_sub_if_data *sdata,
int sset)
{ … }
int drv_start(struct ieee80211_local *local);
void drv_stop(struct ieee80211_local *local, bool suspend);
#ifdef CONFIG_PM
static inline int drv_suspend(struct ieee80211_local *local,
struct cfg80211_wowlan *wowlan)
{ … }
static inline int drv_resume(struct ieee80211_local *local)
{ … }
static inline void drv_set_wakeup(struct ieee80211_local *local,
bool enabled)
{ … }
#endif
int drv_add_interface(struct ieee80211_local *local,
struct ieee80211_sub_if_data *sdata);
int drv_change_interface(struct ieee80211_local *local,
struct ieee80211_sub_if_data *sdata,
enum nl80211_iftype type, bool p2p);
void drv_remove_interface(struct ieee80211_local *local,
struct ieee80211_sub_if_data *sdata);
static inline int drv_config(struct ieee80211_local *local, u32 changed)
{ … }
static inline void drv_vif_cfg_changed(struct ieee80211_local *local,
struct ieee80211_sub_if_data *sdata,
u64 changed)
{ … }
void drv_link_info_changed(struct ieee80211_local *local,
struct ieee80211_sub_if_data *sdata,
struct ieee80211_bss_conf *info,
int link_id, u64 changed);
static inline u64 drv_prepare_multicast(struct ieee80211_local *local,
struct netdev_hw_addr_list *mc_list)
{ … }
static inline void drv_configure_filter(struct ieee80211_local *local,
unsigned int changed_flags,
unsigned int *total_flags,
u64 multicast)
{ … }
static inline void drv_config_iface_filter(struct ieee80211_local *local,
struct ieee80211_sub_if_data *sdata,
unsigned int filter_flags,
unsigned int changed_flags)
{ … }
static inline int drv_set_tim(struct ieee80211_local *local,
struct ieee80211_sta *sta, bool set)
{ … }
int drv_set_key(struct ieee80211_local *local,
enum set_key_cmd cmd,
struct ieee80211_sub_if_data *sdata,
struct ieee80211_sta *sta,
struct ieee80211_key_conf *key);
static inline void drv_update_tkip_key(struct ieee80211_local *local,
struct ieee80211_sub_if_data *sdata,
struct ieee80211_key_conf *conf,
struct sta_info *sta, u32 iv32,
u16 *phase1key)
{ … }
static inline int drv_hw_scan(struct ieee80211_local *local,
struct ieee80211_sub_if_data *sdata,
struct ieee80211_scan_request *req)
{ … }
static inline void drv_cancel_hw_scan(struct ieee80211_local *local,
struct ieee80211_sub_if_data *sdata)
{ … }
static inline int
drv_sched_scan_start(struct ieee80211_local *local,
struct ieee80211_sub_if_data *sdata,
struct cfg80211_sched_scan_request *req,
struct ieee80211_scan_ies *ies)
{ … }
static inline int drv_sched_scan_stop(struct ieee80211_local *local,
struct ieee80211_sub_if_data *sdata)
{ … }
static inline void drv_sw_scan_start(struct ieee80211_local *local,
struct ieee80211_sub_if_data *sdata,
const u8 *mac_addr)
{ … }
static inline void drv_sw_scan_complete(struct ieee80211_local *local,
struct ieee80211_sub_if_data *sdata)
{ … }
static inline int drv_get_stats(struct ieee80211_local *local,
struct ieee80211_low_level_stats *stats)
{ … }
static inline void drv_get_key_seq(struct ieee80211_local *local,
struct ieee80211_key *key,
struct ieee80211_key_seq *seq)
{ … }
static inline int drv_set_frag_threshold(struct ieee80211_local *local,
u32 value)
{ … }
static inline int drv_set_rts_threshold(struct ieee80211_local *local,
u32 value)
{ … }
static inline int drv_set_coverage_class(struct ieee80211_local *local,
s16 value)
{ … }
static inline void drv_sta_notify(struct ieee80211_local *local,
struct ieee80211_sub_if_data *sdata,
enum sta_notify_cmd cmd,
struct ieee80211_sta *sta)
{ … }
static inline int drv_sta_add(struct ieee80211_local *local,
struct ieee80211_sub_if_data *sdata,
struct ieee80211_sta *sta)
{ … }
static inline void drv_sta_remove(struct ieee80211_local *local,
struct ieee80211_sub_if_data *sdata,
struct ieee80211_sta *sta)
{ … }
#ifdef CONFIG_MAC80211_DEBUGFS
static inline void drv_vif_add_debugfs(struct ieee80211_local *local,
struct ieee80211_sub_if_data *sdata)
{ … }
static inline void drv_link_add_debugfs(struct ieee80211_local *local,
struct ieee80211_sub_if_data *sdata,
struct ieee80211_bss_conf *link_conf,
struct dentry *dir)
{ … }
static inline void drv_sta_add_debugfs(struct ieee80211_local *local,
struct ieee80211_sub_if_data *sdata,
struct ieee80211_sta *sta,
struct dentry *dir)
{ … }
static inline void drv_link_sta_add_debugfs(struct ieee80211_local *local,
struct ieee80211_sub_if_data *sdata,
struct ieee80211_link_sta *link_sta,
struct dentry *dir)
{ … }
#else
static inline void drv_vif_add_debugfs(struct ieee80211_local *local,
struct ieee80211_sub_if_data *sdata)
{
might_sleep();
}
#endif
static inline void drv_sta_pre_rcu_remove(struct ieee80211_local *local,
struct ieee80211_sub_if_data *sdata,
struct sta_info *sta)
{ … }
__must_check
int drv_sta_state(struct ieee80211_local *local,
struct ieee80211_sub_if_data *sdata,
struct sta_info *sta,
enum ieee80211_sta_state old_state,
enum ieee80211_sta_state new_state);
__must_check
int drv_sta_set_txpwr(struct ieee80211_local *local,
struct ieee80211_sub_if_data *sdata,
struct sta_info *sta);
void drv_sta_rc_update(struct ieee80211_local *local,
struct ieee80211_sub_if_data *sdata,
struct ieee80211_sta *sta, u32 changed);
static inline void drv_sta_rate_tbl_update(struct ieee80211_local *local,
struct ieee80211_sub_if_data *sdata,
struct ieee80211_sta *sta)
{ … }
static inline void drv_sta_statistics(struct ieee80211_local *local,
struct ieee80211_sub_if_data *sdata,
struct ieee80211_sta *sta,
struct station_info *sinfo)
{ … }
int drv_conf_tx(struct ieee80211_local *local,
struct ieee80211_link_data *link, u16 ac,
const struct ieee80211_tx_queue_params *params);
u64 drv_get_tsf(struct ieee80211_local *local,
struct ieee80211_sub_if_data *sdata);
void drv_set_tsf(struct ieee80211_local *local,
struct ieee80211_sub_if_data *sdata,
u64 tsf);
void drv_offset_tsf(struct ieee80211_local *local,
struct ieee80211_sub_if_data *sdata,
s64 offset);
void drv_reset_tsf(struct ieee80211_local *local,
struct ieee80211_sub_if_data *sdata);
static inline int drv_tx_last_beacon(struct ieee80211_local *local)
{ … }
int drv_ampdu_action(struct ieee80211_local *local,
struct ieee80211_sub_if_data *sdata,
struct ieee80211_ampdu_params *params);
static inline int drv_get_survey(struct ieee80211_local *local, int idx,
struct survey_info *survey)
{ … }
static inline void drv_rfkill_poll(struct ieee80211_local *local)
{ … }
static inline void drv_flush(struct ieee80211_local *local,
struct ieee80211_sub_if_data *sdata,
u32 queues, bool drop)
{ … }
static inline void drv_flush_sta(struct ieee80211_local *local,
struct ieee80211_sub_if_data *sdata,
struct sta_info *sta)
{ … }
static inline void drv_channel_switch(struct ieee80211_local *local,
struct ieee80211_sub_if_data *sdata,
struct ieee80211_channel_switch *ch_switch)
{ … }
static inline int drv_set_antenna(struct ieee80211_local *local,
u32 tx_ant, u32 rx_ant)
{ … }
static inline int drv_get_antenna(struct ieee80211_local *local,
u32 *tx_ant, u32 *rx_ant)
{ … }
static inline int drv_remain_on_channel(struct ieee80211_local *local,
struct ieee80211_sub_if_data *sdata,
struct ieee80211_channel *chan,
unsigned int duration,
enum ieee80211_roc_type type)
{ … }
static inline int
drv_cancel_remain_on_channel(struct ieee80211_local *local,
struct ieee80211_sub_if_data *sdata)
{ … }
static inline int drv_set_ringparam(struct ieee80211_local *local,
u32 tx, u32 rx)
{ … }
static inline void drv_get_ringparam(struct ieee80211_local *local,
u32 *tx, u32 *tx_max, u32 *rx, u32 *rx_max)
{ … }
static inline bool drv_tx_frames_pending(struct ieee80211_local *local)
{ … }
static inline int drv_set_bitrate_mask(struct ieee80211_local *local,
struct ieee80211_sub_if_data *sdata,
const struct cfg80211_bitrate_mask *mask)
{ … }
static inline void drv_set_rekey_data(struct ieee80211_local *local,
struct ieee80211_sub_if_data *sdata,
struct cfg80211_gtk_rekey_data *data)
{ … }
static inline void drv_event_callback(struct ieee80211_local *local,
struct ieee80211_sub_if_data *sdata,
const struct ieee80211_event *event)
{ … }
static inline void
drv_release_buffered_frames(struct ieee80211_local *local,
struct sta_info *sta, u16 tids, int num_frames,
enum ieee80211_frame_release_type reason,
bool more_data)
{ … }
static inline void
drv_allow_buffered_frames(struct ieee80211_local *local,
struct sta_info *sta, u16 tids, int num_frames,
enum ieee80211_frame_release_type reason,
bool more_data)
{ … }
static inline void drv_mgd_prepare_tx(struct ieee80211_local *local,
struct ieee80211_sub_if_data *sdata,
struct ieee80211_prep_tx_info *info)
{ … }
static inline void drv_mgd_complete_tx(struct ieee80211_local *local,
struct ieee80211_sub_if_data *sdata,
struct ieee80211_prep_tx_info *info)
{ … }
static inline void
drv_mgd_protect_tdls_discover(struct ieee80211_local *local,
struct ieee80211_sub_if_data *sdata,
int link_id)
{ … }
static inline int drv_add_chanctx(struct ieee80211_local *local,
struct ieee80211_chanctx *ctx)
{ … }
static inline void drv_remove_chanctx(struct ieee80211_local *local,
struct ieee80211_chanctx *ctx)
{ … }
static inline void drv_change_chanctx(struct ieee80211_local *local,
struct ieee80211_chanctx *ctx,
u32 changed)
{ … }
int drv_assign_vif_chanctx(struct ieee80211_local *local,
struct ieee80211_sub_if_data *sdata,
struct ieee80211_bss_conf *link_conf,
struct ieee80211_chanctx *ctx);
void drv_unassign_vif_chanctx(struct ieee80211_local *local,
struct ieee80211_sub_if_data *sdata,
struct ieee80211_bss_conf *link_conf,
struct ieee80211_chanctx *ctx);
int drv_switch_vif_chanctx(struct ieee80211_local *local,
struct ieee80211_vif_chanctx_switch *vifs,
int n_vifs, enum ieee80211_chanctx_switch_mode mode);
static inline int drv_start_ap(struct ieee80211_local *local,
struct ieee80211_sub_if_data *sdata,
struct ieee80211_bss_conf *link_conf)
{ … }
static inline void drv_stop_ap(struct ieee80211_local *local,
struct ieee80211_sub_if_data *sdata,
struct ieee80211_bss_conf *link_conf)
{ … }
static inline void
drv_reconfig_complete(struct ieee80211_local *local,
enum ieee80211_reconfig_type reconfig_type)
{ … }
static inline void
drv_set_default_unicast_key(struct ieee80211_local *local,
struct ieee80211_sub_if_data *sdata,
int key_idx)
{ … }
#if IS_ENABLED(CONFIG_IPV6)
static inline void drv_ipv6_addr_change(struct ieee80211_local *local,
struct ieee80211_sub_if_data *sdata,
struct inet6_dev *idev)
{ … }
#endif
static inline void
drv_channel_switch_beacon(struct ieee80211_sub_if_data *sdata,
struct cfg80211_chan_def *chandef)
{ … }
static inline int
drv_pre_channel_switch(struct ieee80211_sub_if_data *sdata,
struct ieee80211_channel_switch *ch_switch)
{ … }
static inline int
drv_post_channel_switch(struct ieee80211_link_data *link)
{ … }
static inline void
drv_abort_channel_switch(struct ieee80211_link_data *link)
{ … }
static inline void
drv_channel_switch_rx_beacon(struct ieee80211_sub_if_data *sdata,
struct ieee80211_channel_switch *ch_switch)
{ … }
static inline int drv_join_ibss(struct ieee80211_local *local,
struct ieee80211_sub_if_data *sdata)
{ … }
static inline void drv_leave_ibss(struct ieee80211_local *local,
struct ieee80211_sub_if_data *sdata)
{ … }
static inline u32 drv_get_expected_throughput(struct ieee80211_local *local,
struct sta_info *sta)
{ … }
static inline int drv_get_txpower(struct ieee80211_local *local,
struct ieee80211_sub_if_data *sdata, int *dbm)
{ … }
static inline int
drv_tdls_channel_switch(struct ieee80211_local *local,
struct ieee80211_sub_if_data *sdata,
struct ieee80211_sta *sta, u8 oper_class,
struct cfg80211_chan_def *chandef,
struct sk_buff *tmpl_skb, u32 ch_sw_tm_ie)
{ … }
static inline void
drv_tdls_cancel_channel_switch(struct ieee80211_local *local,
struct ieee80211_sub_if_data *sdata,
struct ieee80211_sta *sta)
{ … }
static inline void
drv_tdls_recv_channel_switch(struct ieee80211_local *local,
struct ieee80211_sub_if_data *sdata,
struct ieee80211_tdls_ch_sw_params *params)
{ … }
static inline void drv_wake_tx_queue(struct ieee80211_local *local,
struct txq_info *txq)
{ … }
static inline void schedule_and_wake_txq(struct ieee80211_local *local,
struct txq_info *txqi)
{ … }
static inline int drv_can_aggregate_in_amsdu(struct ieee80211_local *local,
struct sk_buff *head,
struct sk_buff *skb)
{ … }
static inline int
drv_get_ftm_responder_stats(struct ieee80211_local *local,
struct ieee80211_sub_if_data *sdata,
struct cfg80211_ftm_responder_stats *ftm_stats)
{ … }
static inline int drv_start_pmsr(struct ieee80211_local *local,
struct ieee80211_sub_if_data *sdata,
struct cfg80211_pmsr_request *request)
{ … }
static inline void drv_abort_pmsr(struct ieee80211_local *local,
struct ieee80211_sub_if_data *sdata,
struct cfg80211_pmsr_request *request)
{ … }
static inline int drv_start_nan(struct ieee80211_local *local,
struct ieee80211_sub_if_data *sdata,
struct cfg80211_nan_conf *conf)
{ … }
static inline void drv_stop_nan(struct ieee80211_local *local,
struct ieee80211_sub_if_data *sdata)
{ … }
static inline int drv_nan_change_conf(struct ieee80211_local *local,
struct ieee80211_sub_if_data *sdata,
struct cfg80211_nan_conf *conf,
u32 changes)
{ … }
static inline int drv_add_nan_func(struct ieee80211_local *local,
struct ieee80211_sub_if_data *sdata,
const struct cfg80211_nan_func *nan_func)
{ … }
static inline void drv_del_nan_func(struct ieee80211_local *local,
struct ieee80211_sub_if_data *sdata,
u8 instance_id)
{ … }
static inline int drv_set_tid_config(struct ieee80211_local *local,
struct ieee80211_sub_if_data *sdata,
struct ieee80211_sta *sta,
struct cfg80211_tid_config *tid_conf)
{ … }
static inline int drv_reset_tid_config(struct ieee80211_local *local,
struct ieee80211_sub_if_data *sdata,
struct ieee80211_sta *sta, u8 tids)
{ … }
static inline void drv_update_vif_offload(struct ieee80211_local *local,
struct ieee80211_sub_if_data *sdata)
{ … }
static inline void drv_sta_set_4addr(struct ieee80211_local *local,
struct ieee80211_sub_if_data *sdata,
struct ieee80211_sta *sta, bool enabled)
{ … }
static inline void drv_sta_set_decap_offload(struct ieee80211_local *local,
struct ieee80211_sub_if_data *sdata,
struct ieee80211_sta *sta,
bool enabled)
{ … }
static inline void drv_add_twt_setup(struct ieee80211_local *local,
struct ieee80211_sub_if_data *sdata,
struct ieee80211_sta *sta,
struct ieee80211_twt_setup *twt)
{ … }
static inline void drv_twt_teardown_request(struct ieee80211_local *local,
struct ieee80211_sub_if_data *sdata,
struct ieee80211_sta *sta,
u8 flowid)
{ … }
static inline int drv_net_fill_forward_path(struct ieee80211_local *local,
struct ieee80211_sub_if_data *sdata,
struct ieee80211_sta *sta,
struct net_device_path_ctx *ctx,
struct net_device_path *path)
{ … }
static inline int drv_net_setup_tc(struct ieee80211_local *local,
struct ieee80211_sub_if_data *sdata,
struct net_device *dev,
enum tc_setup_type type, void *type_data)
{ … }
static inline bool drv_can_activate_links(struct ieee80211_local *local,
struct ieee80211_sub_if_data *sdata,
u16 active_links)
{ … }
int drv_change_vif_links(struct ieee80211_local *local,
struct ieee80211_sub_if_data *sdata,
u16 old_links, u16 new_links,
struct ieee80211_bss_conf *old[IEEE80211_MLD_MAX_NUM_LINKS]);
int drv_change_sta_links(struct ieee80211_local *local,
struct ieee80211_sub_if_data *sdata,
struct ieee80211_sta *sta,
u16 old_links, u16 new_links);
static inline enum ieee80211_neg_ttlm_res
drv_can_neg_ttlm(struct ieee80211_local *local,
struct ieee80211_sub_if_data *sdata,
struct ieee80211_neg_ttlm *neg_ttlm)
{ … }
#endif