linux/drivers/net/wireless/marvell/mwifiex/main.h

/* SPDX-License-Identifier: GPL-2.0-only */
/*
 * NXP Wireless LAN device driver: major data structures and prototypes
 *
 * Copyright 2011-2020 NXP
 */

#ifndef _MWIFIEX_MAIN_H_
#define _MWIFIEX_MAIN_H_

#include <linux/completion.h>
#include <linux/kernel.h>
#include <linux/kstrtox.h>
#include <linux/module.h>
#include <linux/sched.h>
#include <linux/semaphore.h>
#include <linux/ip.h>
#include <linux/skbuff.h>
#include <linux/if_arp.h>
#include <linux/etherdevice.h>
#include <net/sock.h>
#include <net/lib80211.h>
#include <linux/vmalloc.h>
#include <linux/firmware.h>
#include <linux/ctype.h>
#include <linux/of.h>
#include <linux/idr.h>
#include <linux/inetdevice.h>
#include <linux/devcoredump.h>
#include <linux/err.h>
#include <linux/gfp.h>
#include <linux/interrupt.h>
#include <linux/io.h>
#include <linux/of_platform.h>
#include <linux/platform_device.h>
#include <linux/pm_runtime.h>
#include <linux/slab.h>
#include <linux/of_irq.h>
#include <linux/workqueue.h>

#include "decl.h"
#include "ioctl.h"
#include "util.h"
#include "fw.h"
#include "pcie.h"
#include "usb.h"
#include "sdio.h"

extern const char driver_version[];
extern bool mfg_mode;
extern bool aggr_ctrl;

struct mwifiex_adapter;
struct mwifiex_private;

enum {};

#define MWIFIEX_DRIVER_MODE_STA
#define MWIFIEX_DRIVER_MODE_UAP
#define MWIFIEX_DRIVER_MODE_P2P
#define MWIFIEX_DRIVER_MODE_BITMASK

#define MWIFIEX_MAX_AP

#define MWIFIEX_MAX_PKTS_TXQ

#define MWIFIEX_DEFAULT_WATCHDOG_TIMEOUT

#define MWIFIEX_TIMER_10S
#define MWIFIEX_TIMER_1S

#define MAX_TX_PENDING
#define LOW_TX_PENDING

#define HIGH_RX_PENDING
#define LOW_RX_PENDING

#define MWIFIEX_UPLD_SIZE

#define MAX_EVENT_SIZE

#define MWIFIEX_FW_DUMP_SIZE

#define ARP_FILTER_MAX_BUF_SIZE

#define MWIFIEX_KEY_BUFFER_SIZE
#define MWIFIEX_DEFAULT_LISTEN_INTERVAL
#define MWIFIEX_MAX_REGION_CODE

#define DEFAULT_BCN_AVG_FACTOR
#define DEFAULT_DATA_AVG_FACTOR

#define FIRST_VALID_CHANNEL
#define DEFAULT_AD_HOC_CHANNEL
#define DEFAULT_AD_HOC_CHANNEL_A

#define DEFAULT_BCN_MISS_TIMEOUT

#define MAX_SCAN_BEACON_BUFFER

#define SCAN_BEACON_ENTRY_PAD

#define MWIFIEX_PASSIVE_SCAN_CHAN_TIME
#define MWIFIEX_ACTIVE_SCAN_CHAN_TIME
#define MWIFIEX_SPECIFIC_SCAN_CHAN_TIME
#define MWIFIEX_DEF_SCAN_CHAN_GAP_TIME

#define SCAN_RSSI(RSSI)

#define MWIFIEX_MAX_TOTAL_SCAN_TIME

#define WPA_GTK_OUI_OFFSET
#define RSN_GTK_OUI_OFFSET

#define MWIFIEX_OUI_NOT_PRESENT
#define MWIFIEX_OUI_PRESENT

#define PKT_TYPE_MGMT

/*
 * Do not check for data_received for USB, as data_received
 * is handled in mwifiex_usb_recv for USB
 */
#define IS_CARD_RX_RCVD(adapter)

#define MWIFIEX_TYPE_CMD
#define MWIFIEX_TYPE_DATA
#define MWIFIEX_TYPE_AGGR_DATA
#define MWIFIEX_TYPE_EVENT

#define MAX_BITMAP_RATES_SIZE

#define MAX_CHANNEL_BAND_BG
#define MAX_CHANNEL_BAND_A

#define MAX_FREQUENCY_BAND_BG

#define MWIFIEX_EVENT_HEADER_LEN
#define MWIFIEX_UAP_EVENT_EXTRA_HEADER

#define MWIFIEX_TYPE_LEN
#define MWIFIEX_USB_TYPE_CMD
#define MWIFIEX_USB_TYPE_DATA
#define MWIFIEX_USB_TYPE_EVENT

/* Threshold for tx_timeout_cnt before we trigger a card reset */
#define TX_TIMEOUT_THRESHOLD

#define MWIFIEX_DRV_INFO_SIZE_MAX

/* Address alignment */
#define MWIFIEX_ALIGN_ADDR(p, a)

#define MWIFIEX_MAC_LOCAL_ADMIN_BIT

/**
 *enum mwifiex_debug_level  -  marvell wifi debug level
 */
enum MWIFIEX_DEBUG_LEVEL {};

#define MWIFIEX_DEFAULT_DEBUG_MASK

__printf(3, 4)
void _mwifiex_dbg(const struct mwifiex_adapter *adapter, int mask,
		  const char *fmt, ...);
#define mwifiex_dbg(adapter, mask, fmt, ...)

#define DEBUG_DUMP_DATA_MAX_LEN
#define mwifiex_dbg_dump(adapter, dbg_mask, str, buf, len)

/** Min BGSCAN interval 15 second */
#define MWIFIEX_BGSCAN_INTERVAL
/** default repeat count */
#define MWIFIEX_BGSCAN_REPEAT_COUNT

struct mwifiex_dbg {};

enum MWIFIEX_HARDWARE_STATUS {};

enum MWIFIEX_802_11_POWER_MODE {};

struct mwifiex_tx_param {};

enum MWIFIEX_PS_STATE {};

enum mwifiex_iface_type {};

struct mwifiex_add_ba_param {};

struct mwifiex_tx_aggr {};

enum mwifiex_ba_status {};

struct mwifiex_ra_list_tbl {};

struct mwifiex_tid_tbl {};

#define WMM_HIGHEST_PRIORITY
#define HIGH_PRIO_TID
#define LOW_PRIO_TID
#define NO_PKT_PRIO_TID
#define MWIFIEX_WMM_DRV_DELAY_MAX

struct mwifiex_wmm_desc {};

struct mwifiex_802_11_security {};

struct ieee_types_header {} __packed;

struct ieee_types_vendor_specific {} __packed;

struct ieee_types_generic {} __packed;

struct ieee_types_bss_co_2040 {} __packed;

struct ieee_types_extcap {} __packed;

struct ieee_types_vht_cap {} __packed;

struct ieee_types_vht_oper {} __packed;

struct ieee_types_aid {} __packed;

struct mwifiex_bssdescriptor {};

struct mwifiex_current_bss_params {};

struct mwifiex_sleep_period {};

struct mwifiex_wep_key {};

#define MAX_REGION_CHANNEL_NUM

struct mwifiex_chan_freq_power {};

enum state_11d_t {};

#define MWIFIEX_MAX_TRIPLET_802_11D

struct mwifiex_802_11d_domain_reg {};

struct mwifiex_vendor_spec_cfg_ie {};

struct wps {};

struct mwifiex_roc_cfg {};

enum mwifiex_iface_work_flags {};

enum mwifiex_adapter_work_flags {};

struct mwifiex_band_config {} __packed;

struct mwifiex_channel_band {};

struct mwifiex_private {};


struct mwifiex_tx_ba_stream_tbl {};

struct mwifiex_rx_reorder_tbl;

struct reorder_tmr_cnxt {};

struct mwifiex_rx_reorder_tbl {};

struct mwifiex_bss_prio_node {};

struct mwifiex_bss_prio_tbl {};

struct cmd_ctrl_node {};

struct mwifiex_bss_priv {};

struct mwifiex_tdls_capab {};

struct mwifiex_station_stats {};

/* This is AP/TDLS specific structure which stores information
 * about associated/peer STA
 */
struct mwifiex_sta_node {};

struct mwifiex_auto_tdls_peer {};

#define MWIFIEX_TYPE_AGGR_DATA_V2
#define MWIFIEX_BUS_AGGR_MODE_LEN_V2
#define MWIFIEX_BUS_AGGR_MAX_LEN
#define MWIFIEX_BUS_AGGR_MAX_NUM
struct bus_aggr_params {};

struct mwifiex_if_ops {};

struct mwifiex_adapter {};

void mwifiex_process_tx_queue(struct mwifiex_adapter *adapter);

int mwifiex_init_lock_list(struct mwifiex_adapter *adapter);

void mwifiex_set_trans_start(struct net_device *dev);

void mwifiex_stop_net_dev_queue(struct net_device *netdev,
		struct mwifiex_adapter *adapter);

void mwifiex_wake_up_net_dev_queue(struct net_device *netdev,
		struct mwifiex_adapter *adapter);

int mwifiex_init_priv(struct mwifiex_private *priv);
void mwifiex_free_priv(struct mwifiex_private *priv);

int mwifiex_init_fw(struct mwifiex_adapter *adapter);

int mwifiex_init_fw_complete(struct mwifiex_adapter *adapter);

void mwifiex_shutdown_drv(struct mwifiex_adapter *adapter);

int mwifiex_dnld_fw(struct mwifiex_adapter *, struct mwifiex_fw_image *);

int mwifiex_recv_packet(struct mwifiex_private *priv, struct sk_buff *skb);
int mwifiex_uap_recv_packet(struct mwifiex_private *priv,
			    struct sk_buff *skb);

int mwifiex_process_mgmt_packet(struct mwifiex_private *priv,
				struct sk_buff *skb);

int mwifiex_process_event(struct mwifiex_adapter *adapter);

int mwifiex_complete_cmd(struct mwifiex_adapter *adapter,
			 struct cmd_ctrl_node *cmd_node);

int mwifiex_send_cmd(struct mwifiex_private *priv, u16 cmd_no,
		     u16 cmd_action, u32 cmd_oid, void *data_buf, bool sync);

void mwifiex_cmd_timeout_func(struct timer_list *t);

int mwifiex_get_debug_info(struct mwifiex_private *,
			   struct mwifiex_debug_info *);

int mwifiex_alloc_cmd_buffer(struct mwifiex_adapter *adapter);
void mwifiex_free_cmd_buffer(struct mwifiex_adapter *adapter);
void mwifiex_free_cmd_buffers(struct mwifiex_adapter *adapter);
void mwifiex_cancel_all_pending_cmd(struct mwifiex_adapter *adapter);
void mwifiex_cancel_pending_scan_cmd(struct mwifiex_adapter *adapter);
void mwifiex_cancel_scan(struct mwifiex_adapter *adapter);

void mwifiex_recycle_cmd_node(struct mwifiex_adapter *adapter,
			      struct cmd_ctrl_node *cmd_node);

void mwifiex_insert_cmd_to_pending_q(struct mwifiex_adapter *adapter,
				     struct cmd_ctrl_node *cmd_node);

int mwifiex_exec_next_cmd(struct mwifiex_adapter *adapter);
int mwifiex_process_cmdresp(struct mwifiex_adapter *adapter);
int mwifiex_handle_rx_packet(struct mwifiex_adapter *adapter,
			     struct sk_buff *skb);
int mwifiex_process_tx(struct mwifiex_private *priv, struct sk_buff *skb,
		       struct mwifiex_tx_param *tx_param);
int mwifiex_send_null_packet(struct mwifiex_private *priv, u8 flags);
int mwifiex_write_data_complete(struct mwifiex_adapter *adapter,
				struct sk_buff *skb, int aggr, int status);
void mwifiex_clean_txrx(struct mwifiex_private *priv);
u8 mwifiex_check_last_packet_indication(struct mwifiex_private *priv);
void mwifiex_check_ps_cond(struct mwifiex_adapter *adapter);
void mwifiex_process_sleep_confirm_resp(struct mwifiex_adapter *, u8 *,
					u32);
int mwifiex_cmd_enh_power_mode(struct mwifiex_private *priv,
			       struct host_cmd_ds_command *cmd,
			       u16 cmd_action, uint16_t ps_bitmap,
			       struct mwifiex_ds_auto_ds *auto_ds);
int mwifiex_ret_enh_power_mode(struct mwifiex_private *priv,
			       struct host_cmd_ds_command *resp,
			       struct mwifiex_ds_pm_cfg *pm_cfg);
void mwifiex_process_hs_config(struct mwifiex_adapter *adapter);
void mwifiex_hs_activated_event(struct mwifiex_private *priv,
					u8 activated);
int mwifiex_set_hs_params(struct mwifiex_private *priv, u16 action,
			  int cmd_type, struct mwifiex_ds_hs_cfg *hs_cfg);
int mwifiex_ret_802_11_hs_cfg(struct mwifiex_private *priv,
			      struct host_cmd_ds_command *resp);
int mwifiex_process_rx_packet(struct mwifiex_private *priv,
			      struct sk_buff *skb);
int mwifiex_sta_prepare_cmd(struct mwifiex_private *, uint16_t cmd_no,
			    u16 cmd_action, u32 cmd_oid,
			    void *data_buf, void *cmd_buf);
int mwifiex_uap_prepare_cmd(struct mwifiex_private *priv, uint16_t cmd_no,
			    u16 cmd_action, u32 cmd_oid,
			    void *data_buf, void *cmd_buf);
int mwifiex_process_sta_cmdresp(struct mwifiex_private *, u16 cmdresp_no,
				struct host_cmd_ds_command *resp);
int mwifiex_process_sta_rx_packet(struct mwifiex_private *,
				  struct sk_buff *skb);
int mwifiex_process_uap_rx_packet(struct mwifiex_private *priv,
				  struct sk_buff *skb);
int mwifiex_handle_uap_rx_forward(struct mwifiex_private *priv,
				  struct sk_buff *skb);
int mwifiex_process_sta_event(struct mwifiex_private *);
int mwifiex_process_uap_event(struct mwifiex_private *);
void mwifiex_delete_all_station_list(struct mwifiex_private *priv);
void mwifiex_wmm_del_peer_ra_list(struct mwifiex_private *priv,
				  const u8 *ra_addr);
void mwifiex_process_sta_txpd(struct mwifiex_private *priv,
			      struct sk_buff *skb);
void mwifiex_process_uap_txpd(struct mwifiex_private *priv,
			      struct sk_buff *skb);
int mwifiex_sta_init_cmd(struct mwifiex_private *, u8 first_sta, bool init);
int mwifiex_cmd_802_11_scan(struct host_cmd_ds_command *cmd,
			    struct mwifiex_scan_cmd_config *scan_cfg);
void mwifiex_queue_scan_cmd(struct mwifiex_private *priv,
			    struct cmd_ctrl_node *cmd_node);
int mwifiex_ret_802_11_scan(struct mwifiex_private *priv,
			    struct host_cmd_ds_command *resp);
int mwifiex_associate(struct mwifiex_private *priv,
		      struct mwifiex_bssdescriptor *bss_desc);
int mwifiex_cmd_802_11_associate(struct mwifiex_private *priv,
				 struct host_cmd_ds_command *cmd,
				 struct mwifiex_bssdescriptor *bss_desc);
int mwifiex_ret_802_11_associate(struct mwifiex_private *priv,
				 struct host_cmd_ds_command *resp);
void mwifiex_reset_connect_state(struct mwifiex_private *priv, u16 reason,
				 bool from_ap);
u8 mwifiex_band_to_radio_type(u8 band);
int mwifiex_deauthenticate(struct mwifiex_private *priv, u8 *mac);
void mwifiex_deauthenticate_all(struct mwifiex_adapter *adapter);
int mwifiex_adhoc_start(struct mwifiex_private *priv,
			struct cfg80211_ssid *adhoc_ssid);
int mwifiex_adhoc_join(struct mwifiex_private *priv,
		       struct mwifiex_bssdescriptor *bss_desc);
int mwifiex_cmd_802_11_ad_hoc_start(struct mwifiex_private *priv,
				    struct host_cmd_ds_command *cmd,
				    struct cfg80211_ssid *req_ssid);
int mwifiex_cmd_802_11_ad_hoc_join(struct mwifiex_private *priv,
				   struct host_cmd_ds_command *cmd,
				   struct mwifiex_bssdescriptor *bss_desc);
int mwifiex_ret_802_11_ad_hoc(struct mwifiex_private *priv,
			      struct host_cmd_ds_command *resp);
int mwifiex_cmd_802_11_bg_scan_query(struct host_cmd_ds_command *cmd);
struct mwifiex_chan_freq_power *mwifiex_get_cfp(struct mwifiex_private *priv,
						u8 band, u16 channel, u32 freq);
u32 mwifiex_index_to_data_rate(struct mwifiex_private *priv,
			       u8 index, u8 ht_info);
u32 mwifiex_index_to_acs_data_rate(struct mwifiex_private *priv,
				   u8 index, u8 ht_info);
u32 mwifiex_find_freq_from_band_chan(u8, u8);
int mwifiex_cmd_append_vsie_tlv(struct mwifiex_private *priv, u16 vsie_mask,
				u8 **buffer);
u32 mwifiex_get_active_data_rates(struct mwifiex_private *priv,
				    u8 *rates);
u32 mwifiex_get_supported_rates(struct mwifiex_private *priv, u8 *rates);
u32 mwifiex_get_rates_from_cfg80211(struct mwifiex_private *priv,
				    u8 *rates, u8 radio_type);
u8 mwifiex_is_rate_auto(struct mwifiex_private *priv);
extern u16 region_code_index[MWIFIEX_MAX_REGION_CODE];
void mwifiex_save_curr_bcn(struct mwifiex_private *priv);
void mwifiex_free_curr_bcn(struct mwifiex_private *priv);
int mwifiex_cmd_get_hw_spec(struct mwifiex_private *priv,
			    struct host_cmd_ds_command *cmd);
int mwifiex_ret_get_hw_spec(struct mwifiex_private *priv,
			    struct host_cmd_ds_command *resp);
int is_command_pending(struct mwifiex_adapter *adapter);
void mwifiex_init_priv_params(struct mwifiex_private *priv,
						struct net_device *dev);
int mwifiex_set_secure_params(struct mwifiex_private *priv,
			      struct mwifiex_uap_bss_param *bss_config,
			      struct cfg80211_ap_settings *params);
void mwifiex_set_ht_params(struct mwifiex_private *priv,
			   struct mwifiex_uap_bss_param *bss_cfg,
			   struct cfg80211_ap_settings *params);
void mwifiex_set_vht_params(struct mwifiex_private *priv,
			    struct mwifiex_uap_bss_param *bss_cfg,
			    struct cfg80211_ap_settings *params);
void mwifiex_set_tpc_params(struct mwifiex_private *priv,
			    struct mwifiex_uap_bss_param *bss_cfg,
			    struct cfg80211_ap_settings *params);
void mwifiex_set_uap_rates(struct mwifiex_uap_bss_param *bss_cfg,
			   struct cfg80211_ap_settings *params);
void mwifiex_set_vht_width(struct mwifiex_private *priv,
			   enum nl80211_chan_width width,
			   bool ap_11ac_disable);
void
mwifiex_set_wmm_params(struct mwifiex_private *priv,
		       struct mwifiex_uap_bss_param *bss_cfg,
		       struct cfg80211_ap_settings *params);
void mwifiex_set_ba_params(struct mwifiex_private *priv);

void mwifiex_update_ampdu_txwinsize(struct mwifiex_adapter *pmadapter);
void mwifiex_bt_coex_wlan_param_update_event(struct mwifiex_private *priv,
					     struct sk_buff *event_skb);

void mwifiex_set_11ac_ba_params(struct mwifiex_private *priv);
int mwifiex_cmd_802_11_scan_ext(struct mwifiex_private *priv,
				struct host_cmd_ds_command *cmd,
				void *data_buf);
int mwifiex_ret_802_11_scan_ext(struct mwifiex_private *priv,
				struct host_cmd_ds_command *resp);
int mwifiex_handle_event_ext_scan_report(struct mwifiex_private *priv,
					 void *buf);
int mwifiex_cmd_802_11_bg_scan_config(struct mwifiex_private *priv,
				      struct host_cmd_ds_command *cmd,
				      void *data_buf);
int mwifiex_stop_bg_scan(struct mwifiex_private *priv);

/*
 * This function checks if the queuing is RA based or not.
 */
static inline u8
mwifiex_queuing_ra_based(struct mwifiex_private *priv)
{}

/*
 * This function copies rates.
 */
static inline u32
mwifiex_copy_rates(u8 *dest, u32 pos, u8 *src, int len)
{}

/*
 * This function returns the correct private structure pointer based
 * upon the BSS type and BSS number.
 */
static inline struct mwifiex_private *
mwifiex_get_priv_by_id(struct mwifiex_adapter *adapter,
		       u8 bss_num, u8 bss_type)
{}

/*
 * This function returns the first available private structure pointer
 * based upon the BSS role.
 */
static inline struct mwifiex_private *
mwifiex_get_priv(struct mwifiex_adapter *adapter,
		 enum mwifiex_bss_role bss_role)
{}

/*
 * This function checks available bss_num when adding new interface or
 * changing interface type.
 */
static inline u8
mwifiex_get_unused_bss_num(struct mwifiex_adapter *adapter, u8 bss_type)
{}

/*
 * This function returns the first available unused private structure pointer.
 */
static inline struct mwifiex_private *
mwifiex_get_unused_priv_by_bss_type(struct mwifiex_adapter *adapter,
				    u8 bss_type)
{}

/*
 * This function returns the driver private structure of a network device.
 */
static inline struct mwifiex_private *
mwifiex_netdev_get_priv(struct net_device *dev)
{}

/*
 * This function checks if a skb holds a management frame.
 */
static inline bool mwifiex_is_skb_mgmt_frame(struct sk_buff *skb)
{}

/* This function retrieves channel closed for operation by Channel
 * Switch Announcement.
 */
static inline u8
mwifiex_11h_get_csa_closed_channel(struct mwifiex_private *priv)
{}

static inline u8 mwifiex_is_any_intf_active(struct mwifiex_private *priv)
{}

static inline u8 mwifiex_is_tdls_link_setup(u8 status)
{}

/* Disable platform specific wakeup interrupt */
static inline void mwifiex_disable_wake(struct mwifiex_adapter *adapter)
{}

/* Enable platform specific wakeup interrupt */
static inline void mwifiex_enable_wake(struct mwifiex_adapter *adapter)
{}

int mwifiex_init_shutdown_fw(struct mwifiex_private *priv,
			     u32 func_init_shutdown);

int mwifiex_add_card(void *card, struct completion *fw_done,
		     struct mwifiex_if_ops *if_ops, u8 iface_type,
		     struct device *dev);
int mwifiex_remove_card(struct mwifiex_adapter *adapter);

void mwifiex_get_version(struct mwifiex_adapter *adapter, char *version,
			 int maxlen);
int mwifiex_request_set_multicast_list(struct mwifiex_private *priv,
			struct mwifiex_multicast_list *mcast_list);
int mwifiex_copy_mcast_addr(struct mwifiex_multicast_list *mlist,
			    struct net_device *dev);
int mwifiex_wait_queue_complete(struct mwifiex_adapter *adapter,
				struct cmd_ctrl_node *cmd_queued);
int mwifiex_bss_start(struct mwifiex_private *priv, struct cfg80211_bss *bss,
		      struct cfg80211_ssid *req_ssid);
int mwifiex_cancel_hs(struct mwifiex_private *priv, int cmd_type);
int mwifiex_enable_hs(struct mwifiex_adapter *adapter);
int mwifiex_disable_auto_ds(struct mwifiex_private *priv);
int mwifiex_drv_get_data_rate(struct mwifiex_private *priv, u32 *rate);
int mwifiex_request_scan(struct mwifiex_private *priv,
			 struct cfg80211_ssid *req_ssid);
int mwifiex_scan_networks(struct mwifiex_private *priv,
			  const struct mwifiex_user_scan_cfg *user_scan_in);
int mwifiex_set_radio(struct mwifiex_private *priv, u8 option);

int mwifiex_set_encode(struct mwifiex_private *priv, struct key_params *kp,
		       const u8 *key, int key_len, u8 key_index,
		       const u8 *mac_addr, int disable);

int mwifiex_set_gen_ie(struct mwifiex_private *priv, const u8 *ie, int ie_len);

int mwifiex_get_ver_ext(struct mwifiex_private *priv, u32 version_str_sel);

int mwifiex_remain_on_chan_cfg(struct mwifiex_private *priv, u16 action,
			       struct ieee80211_channel *chan,
			       unsigned int duration);

int mwifiex_get_stats_info(struct mwifiex_private *priv,
			   struct mwifiex_ds_get_stats *log);

int mwifiex_reg_write(struct mwifiex_private *priv, u32 reg_type,
		      u32 reg_offset, u32 reg_value);

int mwifiex_reg_read(struct mwifiex_private *priv, u32 reg_type,
		     u32 reg_offset, u32 *value);

int mwifiex_eeprom_read(struct mwifiex_private *priv, u16 offset, u16 bytes,
			u8 *value);

int mwifiex_set_11n_httx_cfg(struct mwifiex_private *priv, int data);

int mwifiex_get_11n_httx_cfg(struct mwifiex_private *priv, int *data);

int mwifiex_set_tx_rate_cfg(struct mwifiex_private *priv, int tx_rate_index);

int mwifiex_get_tx_rate_cfg(struct mwifiex_private *priv, int *tx_rate_index);

int mwifiex_drv_set_power(struct mwifiex_private *priv, u32 *ps_mode);

int mwifiex_drv_get_driver_version(struct mwifiex_adapter *adapter,
				   char *version, int max_len);

int mwifiex_set_tx_power(struct mwifiex_private *priv,
			 struct mwifiex_power_cfg *power_cfg);

int mwifiex_main_process(struct mwifiex_adapter *);

int mwifiex_queue_tx_pkt(struct mwifiex_private *priv, struct sk_buff *skb);

int mwifiex_get_bss_info(struct mwifiex_private *,
			 struct mwifiex_bss_info *);
int mwifiex_fill_new_bss_desc(struct mwifiex_private *priv,
			      struct cfg80211_bss *bss,
			      struct mwifiex_bssdescriptor *bss_desc);
int mwifiex_update_bss_desc_with_ie(struct mwifiex_adapter *adapter,
				    struct mwifiex_bssdescriptor *bss_entry);
int mwifiex_check_network_compatibility(struct mwifiex_private *priv,
					struct mwifiex_bssdescriptor *bss_desc);

u8 mwifiex_chan_type_to_sec_chan_offset(enum nl80211_channel_type chan_type);
u8 mwifiex_get_chan_type(struct mwifiex_private *priv);

struct wireless_dev *mwifiex_add_virtual_intf(struct wiphy *wiphy,
					      const char *name,
					      unsigned char name_assign_type,
					      enum nl80211_iftype type,
					      struct vif_params *params);
int mwifiex_del_virtual_intf(struct wiphy *wiphy, struct wireless_dev *wdev);

void mwifiex_set_sys_config_invalid_data(struct mwifiex_uap_bss_param *config);

int mwifiex_add_wowlan_magic_pkt_filter(struct mwifiex_adapter *adapter);

int mwifiex_set_mgmt_ies(struct mwifiex_private *priv,
			 struct cfg80211_beacon_data *data);
int mwifiex_del_mgmt_ies(struct mwifiex_private *priv);
u8 *mwifiex_11d_code_2_region(u8 code);
void mwifiex_uap_set_channel(struct mwifiex_private *priv,
			     struct mwifiex_uap_bss_param *bss_cfg,
			     struct cfg80211_chan_def chandef);
int mwifiex_config_start_uap(struct mwifiex_private *priv,
			     struct mwifiex_uap_bss_param *bss_cfg);
void mwifiex_uap_del_sta_data(struct mwifiex_private *priv,
			      struct mwifiex_sta_node *node);

void mwifiex_config_uap_11d(struct mwifiex_private *priv,
			    struct cfg80211_beacon_data *beacon_data);

void mwifiex_init_11h_params(struct mwifiex_private *priv);
int mwifiex_is_11h_active(struct mwifiex_private *priv);
int mwifiex_11h_activate(struct mwifiex_private *priv, bool flag);

void mwifiex_11h_process_join(struct mwifiex_private *priv, u8 **buffer,
			      struct mwifiex_bssdescriptor *bss_desc);
int mwifiex_11h_handle_event_chanswann(struct mwifiex_private *priv);
int mwifiex_dnld_dt_cfgdata(struct mwifiex_private *priv,
			    struct device_node *node, const char *prefix);
void mwifiex_dnld_txpwr_table(struct mwifiex_private *priv);

extern const struct ethtool_ops mwifiex_ethtool_ops;

void mwifiex_del_all_sta_list(struct mwifiex_private *priv);
void mwifiex_del_sta_entry(struct mwifiex_private *priv, const u8 *mac);
void
mwifiex_set_sta_ht_cap(struct mwifiex_private *priv, const u8 *ies,
		       int ies_len, struct mwifiex_sta_node *node);
struct mwifiex_sta_node *
mwifiex_add_sta_entry(struct mwifiex_private *priv, const u8 *mac);
struct mwifiex_sta_node *
mwifiex_get_sta_entry(struct mwifiex_private *priv, const u8 *mac);
u8 mwifiex_is_tdls_chan_switching(struct mwifiex_private *priv);
u8 mwifiex_is_tdls_off_chan(struct mwifiex_private *priv);
u8 mwifiex_is_send_cmd_allowed(struct mwifiex_private *priv);
int mwifiex_send_tdls_data_frame(struct mwifiex_private *priv, const u8 *peer,
				 u8 action_code, u8 dialog_token,
				 u16 status_code, const u8 *extra_ies,
				 size_t extra_ies_len);
int mwifiex_send_tdls_action_frame(struct mwifiex_private *priv, const u8 *peer,
				   u8 action_code, u8 dialog_token,
				   u16 status_code, const u8 *extra_ies,
				   size_t extra_ies_len);
void mwifiex_process_tdls_action_frame(struct mwifiex_private *priv,
				       u8 *buf, int len);
int mwifiex_tdls_oper(struct mwifiex_private *priv, const u8 *peer, u8 action);
int mwifiex_get_tdls_link_status(struct mwifiex_private *priv, const u8 *mac);
int mwifiex_get_tdls_list(struct mwifiex_private *priv,
			  struct tdls_peer_info *buf);
void mwifiex_disable_all_tdls_links(struct mwifiex_private *priv);
bool mwifiex_is_bss_in_11ac_mode(struct mwifiex_private *priv);
u8 mwifiex_get_center_freq_index(struct mwifiex_private *priv, u8 band,
				 u32 pri_chan, u8 chan_bw);
int mwifiex_init_channel_scan_gap(struct mwifiex_adapter *adapter);

int mwifiex_tdls_check_tx(struct mwifiex_private *priv, struct sk_buff *skb);
void mwifiex_flush_auto_tdls_list(struct mwifiex_private *priv);
void mwifiex_auto_tdls_update_peer_status(struct mwifiex_private *priv,
					  const u8 *mac, u8 link_status);
void mwifiex_auto_tdls_update_peer_signal(struct mwifiex_private *priv,
					  u8 *mac, s8 snr, s8 nflr);
void mwifiex_check_auto_tdls(struct timer_list *t);
void mwifiex_add_auto_tdls_peer(struct mwifiex_private *priv, const u8 *mac);
void mwifiex_setup_auto_tdls_timer(struct mwifiex_private *priv);
void mwifiex_clean_auto_tdls(struct mwifiex_private *priv);
int mwifiex_config_tdls_enable(struct mwifiex_private *priv);
int mwifiex_config_tdls_disable(struct mwifiex_private *priv);
int mwifiex_config_tdls_cs_params(struct mwifiex_private *priv);
int mwifiex_stop_tdls_cs(struct mwifiex_private *priv, const u8 *peer_mac);
int mwifiex_start_tdls_cs(struct mwifiex_private *priv, const u8 *peer_mac,
			  u8 primary_chan, u8 second_chan_offset, u8 band);

int mwifiex_cmd_issue_chan_report_request(struct mwifiex_private *priv,
					  struct host_cmd_ds_command *cmd,
					  void *data_buf);
int mwifiex_11h_handle_chanrpt_ready(struct mwifiex_private *priv,
				     struct sk_buff *skb);

void mwifiex_parse_tx_status_event(struct mwifiex_private *priv,
				   void *event_body);

struct sk_buff *
mwifiex_clone_skb_for_tx_status(struct mwifiex_private *priv,
				struct sk_buff *skb, u8 flag, u64 *cookie);
void mwifiex_dfs_cac_work_queue(struct work_struct *work);
void mwifiex_dfs_chan_sw_work_queue(struct work_struct *work);
void mwifiex_abort_cac(struct mwifiex_private *priv);
int mwifiex_stop_radar_detection(struct mwifiex_private *priv,
				 struct cfg80211_chan_def *chandef);
int mwifiex_11h_handle_radar_detected(struct mwifiex_private *priv,
				      struct sk_buff *skb);

void mwifiex_hist_data_set(struct mwifiex_private *priv, u8 rx_rate, s8 snr,
			   s8 nflr);
void mwifiex_hist_data_reset(struct mwifiex_private *priv);
void mwifiex_hist_data_add(struct mwifiex_private *priv,
			   u8 rx_rate, s8 snr, s8 nflr);
u8 mwifiex_adjust_data_rate(struct mwifiex_private *priv,
			    u8 rx_rate, u8 ht_info);

void mwifiex_drv_info_dump(struct mwifiex_adapter *adapter);
void mwifiex_prepare_fw_dump_info(struct mwifiex_adapter *adapter);
void mwifiex_upload_device_dump(struct mwifiex_adapter *adapter);
void *mwifiex_alloc_dma_align_buf(int rx_len, gfp_t flags);
void mwifiex_fw_dump_event(struct mwifiex_private *priv);
void mwifiex_queue_main_work(struct mwifiex_adapter *adapter);
int mwifiex_get_wakeup_reason(struct mwifiex_private *priv, u16 action,
			      int cmd_type,
			      struct mwifiex_ds_wakeup_reason *wakeup_reason);
int mwifiex_get_chan_info(struct mwifiex_private *priv,
			  struct mwifiex_channel_band *channel_band);
int mwifiex_ret_wakeup_reason(struct mwifiex_private *priv,
			      struct host_cmd_ds_command *resp,
			      struct host_cmd_ds_wakeup_reason *wakeup_reason);
void mwifiex_coex_ampdu_rxwinsize(struct mwifiex_adapter *adapter);
void mwifiex_11n_delba(struct mwifiex_private *priv, int tid);
int mwifiex_send_domain_info_cmd_fw(struct wiphy *wiphy);
void mwifiex_process_tx_pause_event(struct mwifiex_private *priv,
				    struct sk_buff *event);
void mwifiex_process_multi_chan_event(struct mwifiex_private *priv,
				      struct sk_buff *event_skb);
void mwifiex_multi_chan_resync(struct mwifiex_adapter *adapter);
int mwifiex_set_mac_address(struct mwifiex_private *priv,
			    struct net_device *dev,
			    bool external, u8 *new_mac);
void mwifiex_devdump_tmo_func(unsigned long function_context);

#ifdef CONFIG_DEBUG_FS
void mwifiex_debugfs_init(void);
void mwifiex_debugfs_remove(void);

void mwifiex_dev_debugfs_init(struct mwifiex_private *priv);
void mwifiex_dev_debugfs_remove(struct mwifiex_private *priv);
#endif
int mwifiex_reinit_sw(struct mwifiex_adapter *adapter);
int mwifiex_shutdown_sw(struct mwifiex_adapter *adapter);
#endif /* !_MWIFIEX_MAIN_H_ */