linux/drivers/net/wireless/ath/ath6kl/wmi.h

/*
 * Copyright (c) 2010-2011 Atheros Communications Inc.
 * Copyright (c) 2011-2012 Qualcomm Atheros, Inc.
 *
 * Permission to use, copy, modify, and/or distribute this software for any
 * purpose with or without fee is hereby granted, provided that the above
 * copyright notice and this permission notice appear in all copies.
 *
 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
 * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
 * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
 * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
 * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
 * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
 * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
 */

/*
 * This file contains the definitions of the WMI protocol specified in the
 * Wireless Module Interface (WMI).  It includes definitions of all the
 * commands and events. Commands are messages from the host to the WM.
 * Events and Replies are messages from the WM to the host.
 */

#ifndef WMI_H
#define WMI_H

#include <linux/ieee80211.h>

#include "htc.h"

#define HTC_PROTOCOL_VERSION
#define WMI_PROTOCOL_VERSION
#define WMI_CONTROL_MSG_MAX_LEN
#define is_ethertype(type_or_len)

#define IP_ETHERTYPE

#define WMI_IMPLICIT_PSTREAM
#define WMI_MAX_THINSTREAM

#define SSID_IE_LEN_INDEX

/* Host side link management data structures */
#define SIG_QUALITY_THRESH_LVLS
#define SIG_QUALITY_UPPER_THRESH_LVLS
#define SIG_QUALITY_LOWER_THRESH_LVLS

#define A_BAND_24GHZ
#define A_BAND_5GHZ
#define ATH6KL_NUM_BANDS

/* in ms */
#define WMI_IMPLICIT_PSTREAM_INACTIVITY_INT

/*
 * There are no signed versions of __le16 and __le32, so for a temporary
 * solution come up with our own version. The idea is from fs/ntfs/types.h.
 *
 * Use a_ prefix so that it doesn't conflict if we get proper support to
 * linux/types.h.
 */
a_sle16;
a_sle32;

static inline a_sle32 a_cpu_to_sle32(s32 val)
{}

static inline s32 a_sle32_to_cpu(a_sle32 val)
{}

static inline a_sle16 a_cpu_to_sle16(s16 val)
{}

static inline s16 a_sle16_to_cpu(a_sle16 val)
{}

struct sq_threshold_params {};

struct wmi_data_sync_bufs {};

/* WMM stream classes */
#define WMM_NUM_AC
#define WMM_AC_BE
#define WMM_AC_BK
#define WMM_AC_VI
#define WMM_AC_VO

#define WMI_VOICE_USER_PRIORITY

struct wmi {};

struct host_app_area {} __packed;

enum wmi_msg_type {};

/*
 * Macros for operating on WMI_DATA_HDR (info) field
 */

#define WMI_DATA_HDR_MSG_TYPE_MASK
#define WMI_DATA_HDR_MSG_TYPE_SHIFT
#define WMI_DATA_HDR_UP_MASK
#define WMI_DATA_HDR_UP_SHIFT

/* In AP mode, the same bit (b5) is used to indicate Power save state in
 * the Rx dir and More data bit state in the tx direction.
 */
#define WMI_DATA_HDR_PS_MASK
#define WMI_DATA_HDR_PS_SHIFT

#define WMI_DATA_HDR_MORE

enum wmi_data_hdr_data_type {};

/* Bitmap of data header flags */
enum wmi_data_hdr_flags {};

#define WMI_DATA_HDR_DATA_TYPE_MASK
#define WMI_DATA_HDR_DATA_TYPE_SHIFT

/* Macros for operating on WMI_DATA_HDR (info2) field */
#define WMI_DATA_HDR_SEQNO_MASK
#define WMI_DATA_HDR_SEQNO_SHIFT

#define WMI_DATA_HDR_AMSDU_MASK
#define WMI_DATA_HDR_AMSDU_SHIFT

#define WMI_DATA_HDR_META_MASK
#define WMI_DATA_HDR_META_SHIFT

#define WMI_DATA_HDR_PAD_BEFORE_DATA_MASK
#define WMI_DATA_HDR_PAD_BEFORE_DATA_SHIFT

/* Macros for operating on WMI_DATA_HDR (info3) field */
#define WMI_DATA_HDR_IF_IDX_MASK

#define WMI_DATA_HDR_TRIG
#define WMI_DATA_HDR_EOSP

struct wmi_data_hdr {} __packed;

static inline u8 wmi_data_hdr_get_up(struct wmi_data_hdr *dhdr)
{}

static inline void wmi_data_hdr_set_up(struct wmi_data_hdr *dhdr,
				       u8 usr_pri)
{}

static inline u8 wmi_data_hdr_get_dot11(struct wmi_data_hdr *dhdr)
{}

static inline u16 wmi_data_hdr_get_seqno(struct wmi_data_hdr *dhdr)
{}

static inline u8 wmi_data_hdr_is_amsdu(struct wmi_data_hdr *dhdr)
{}

static inline u8 wmi_data_hdr_get_meta(struct wmi_data_hdr *dhdr)
{}

static inline u8 wmi_data_hdr_get_if_idx(struct wmi_data_hdr *dhdr)
{}

/* Tx meta version definitions */
#define WMI_MAX_TX_META_SZ
#define WMI_META_VERSION_1
#define WMI_META_VERSION_2

/* Flag to signal to FW to calculate TCP checksum */
#define WMI_META_V2_FLAG_CSUM_OFFLOAD

struct wmi_tx_meta_v1 {} __packed;

struct wmi_tx_meta_v2 {} __packed;

struct wmi_rx_meta_v1 {} __packed;

struct wmi_rx_meta_v2 {} __packed;

#define WMI_CMD_HDR_IF_ID_MASK

/* Control Path */
struct wmi_cmd_hdr {} __packed;

static inline u8 wmi_cmd_hdr_get_if_idx(struct wmi_cmd_hdr *chdr)
{}

/* List of WMI commands */
enum wmi_cmd_id {};

enum wmi_mgmt_frame_type {};

enum wmi_ie_field_type {};

/* WMI_CONNECT_CMDID  */
enum network_type {};

enum network_subtype {};

enum dot11_auth_mode {};

enum auth_mode {};

#define WMI_MAX_KEY_INDEX

#define WMI_MAX_KEY_LEN

/*
 * NB: these values are ordered carefully; there are lots of
 * implications in any reordering.  In particular beware
 * that 4 is not used to avoid conflicting with IEEE80211_F_PRIVACY.
 */
#define ATH6KL_CIPHER_WEP
#define ATH6KL_CIPHER_TKIP
#define ATH6KL_CIPHER_AES_OCB
#define ATH6KL_CIPHER_AES_CCM
#define ATH6KL_CIPHER_CKIP
#define ATH6KL_CIPHER_CCKM_KRK
#define ATH6KL_CIPHER_NONE

/*
 * 802.11 rate set.
 */
#define ATH6KL_RATE_MAXSIZE

#define ATH_OUI_TYPE
#define WPA_OUI_TYPE
#define WMM_PARAM_OUI_SUBTYPE
#define WMM_OUI_TYPE
#define WSC_OUT_TYPE

enum wmi_connect_ctrl_flags_bits {};

struct wmi_connect_cmd {} __packed;

/* WMI_RECONNECT_CMDID */
struct wmi_reconnect_cmd {} __packed;

/* WMI_ADD_CIPHER_KEY_CMDID */
enum key_usage {};

/*
 * Bit Flag
 * Bit 0 - Initialise TSC - default is Initialize
 */
#define KEY_OP_INIT_TSC
#define KEY_OP_INIT_RSC

/* default initialise the TSC & RSC */
#define KEY_OP_INIT_VAL
#define KEY_OP_VALID_MASK

struct wmi_add_cipher_key_cmd {} __packed;

/* WMI_DELETE_CIPHER_KEY_CMDID */
struct wmi_delete_cipher_key_cmd {} __packed;

#define WMI_KRK_LEN

/* WMI_ADD_KRK_CMDID */
struct wmi_add_krk_cmd {} __packed;

/* WMI_SETPMKID_CMDID */

#define WMI_PMKID_LEN

enum pmkid_enable_flg {};

struct wmi_setpmkid_cmd {} __packed;

/* WMI_START_SCAN_CMD */
enum wmi_scan_type {};

struct wmi_supp_rates {};

struct wmi_begin_scan_cmd {} __packed;

/* wmi_start_scan_cmd is to be deprecated. Use
 * wmi_begin_scan_cmd instead. The new structure supports P2P mgmt
 * operations using station interface.
 */
struct wmi_start_scan_cmd {} __packed;

/*
 *  Warning: scan control flag value of 0xFF is used to disable
 *  all flags in WMI_SCAN_PARAMS_CMD. Do not add any more
 *  flags here
 */
enum wmi_scan_ctrl_flags_bits {};

struct wmi_scan_params_cmd {} __packed;

/* WMI_ENABLE_SCHED_SCAN_CMDID */
struct wmi_enable_sched_scan_cmd {} __packed;

/* WMI_SET_BSS_FILTER_CMDID */
enum wmi_bss_filter {};

struct wmi_bss_filter_cmd {} __packed;

/* WMI_SET_PROBED_SSID_CMDID */
#define MAX_PROBED_SSIDS

enum wmi_ssid_flag {};

struct wmi_probed_ssid_cmd {} __packed;

/*
 * WMI_SET_LISTEN_INT_CMDID
 * The Listen interval is between 15 and 3000 TUs
 */
struct wmi_listen_int_cmd {} __packed;

/* WMI_SET_BMISS_TIME_CMDID */
struct wmi_bmiss_time_cmd {};

/* WMI_STA_ENHANCE_BMISS_CMDID */
struct wmi_sta_bmiss_enhance_cmd {} __packed;

struct wmi_set_regdomain_cmd {} __packed;

/* WMI_SET_POWER_MODE_CMDID */
enum wmi_power_mode {};

struct wmi_power_mode_cmd {} __packed;

/*
 * Policy to determine whether power save failure event should be sent to
 * host during scanning
 */
enum power_save_fail_event_policy {};

struct wmi_power_params_cmd {} __packed;

/*
 * Ratemask for below modes should be passed
 * to WMI_SET_TX_SELECT_RATES_CMDID.
 * AR6003 has 32 bit mask for each modes.
 * First 12 bits for legacy rates, 13 to 20
 * bits for HT 20 rates and 21 to 28 bits for
 * HT 40 rates
 */
enum wmi_mode_phy {};

/* WMI_SET_TX_SELECT_RATES_CMDID */
struct wmi_set_tx_select_rates32_cmd {} __packed;

/* WMI_SET_TX_SELECT_RATES_CMDID */
struct wmi_set_tx_select_rates64_cmd {} __packed;

/* WMI_SET_DISC_TIMEOUT_CMDID */
struct wmi_disc_timeout_cmd {} __packed;

enum dir_type {};

enum voiceps_cap_type {};

enum traffic_type {};

/* WMI_SYNCHRONIZE_CMDID */
struct wmi_sync_cmd {} __packed;

/* WMI_CREATE_PSTREAM_CMDID */
struct wmi_create_pstream_cmd {} __packed;

/* WMI_DELETE_PSTREAM_CMDID */
struct wmi_delete_pstream_cmd {} __packed;

/* WMI_SET_CHANNEL_PARAMS_CMDID */
enum wmi_phy_mode {};

#define WMI_MAX_CHANNELS

/*
 *  WMI_RSSI_THRESHOLD_PARAMS_CMDID
 *  Setting the polltime to 0 would disable polling. Threshold values are
 *  in the ascending order, and should agree to:
 *  (lowThreshold_lowerVal < lowThreshold_upperVal < highThreshold_lowerVal
 *   < highThreshold_upperVal)
 */

struct wmi_rssi_threshold_params_cmd {} __packed;

/*
 *  WMI_SNR_THRESHOLD_PARAMS_CMDID
 *  Setting the polltime to 0 would disable polling.
 */

struct wmi_snr_threshold_params_cmd {} __packed;

/* Don't report BSSs with signal (RSSI) below this threshold */
struct wmi_set_rssi_filter_cmd {} __packed;

enum wmi_preamble_policy {};

struct wmi_set_lpreamble_cmd {} __packed;

struct wmi_set_rts_cmd {} __packed;

/* WMI_SET_TX_PWR_CMDID */
struct wmi_set_tx_pwr_cmd {} __packed;

struct wmi_tx_pwr_reply {} __packed;

struct wmi_report_sleep_state_event {};

enum wmi_report_sleep_status {};
enum target_event_report_config {};

struct wmi_mcast_filter_cmd {} __packed;

#define ATH6KL_MCAST_FILTER_MAC_ADDR_SIZE
struct wmi_mcast_filter_add_del_cmd {} __packed;

struct wmi_set_htcap_cmd {} __packed;

/* Command Replies */

/* WMI_GET_CHANNEL_LIST_CMDID reply */
struct wmi_channel_list_reply {} __packed;

/* List of Events (target to host) */
enum wmi_event_id {};

struct wmi_ready_event_2 {} __packed;

/* WMI_PHY_CAPABILITY */
enum wmi_phy_cap {};

/* Connect Event */
struct wmi_connect_event {} __packed;

/* Disconnect Event */
enum wmi_disconnect_reason {};

/* AP mode disconnect proto_reasons */
enum ap_disconnect_reason {};

#define ATH6KL_COUNTRY_RD_SHIFT

struct ath6kl_wmi_regdomain {};

struct wmi_disconnect_event {} __packed;

/*
 * BSS Info Event.
 * Mechanism used to inform host of the presence and characteristic of
 * wireless networks present.  Consists of bss info header followed by
 * the beacon or probe-response frame body.  The 802.11 header is no included.
 */
enum wmi_bi_ftype {};

#define DEF_LRSSI_SCAN_PERIOD
#define DEF_LRSSI_ROAM_THRESHOLD
#define DEF_LRSSI_ROAM_FLOOR
#define DEF_SCAN_FOR_ROAM_INTVL

enum wmi_roam_ctrl {};

enum wmi_roam_mode {};

struct bss_bias {} __packed;

struct bss_bias_info {} __packed;

struct low_rssi_scan_params {} __packed;

struct roam_ctrl_cmd {} __packed;

struct set_beacon_int_cmd {} __packed;

struct set_dtim_cmd {} __packed;

/* BSS INFO HDR version 2.0 */
struct wmi_bss_info_hdr2 {} __packed;

/* Command Error Event */
enum wmi_error_code {};

struct wmi_cmd_error_event {} __packed;

struct wmi_pstream_timeout_event {} __packed;

/*
 * The WMI_NEIGHBOR_REPORT Event is generated by the target to inform
 * the host of BSS's it has found that matches the current profile.
 * It can be used by the host to cache PMKs and/to initiate pre-authentication
 * if the BSS supports it.  The first bssid is always the current associated
 * BSS.
 * The bssid and bssFlags information repeats according to the number
 * or APs reported.
 */
enum wmi_bss_flags {};

struct wmi_neighbor_info {} __packed;

struct wmi_neighbor_report_event {} __packed;

/* TKIP MIC Error Event */
struct wmi_tkip_micerr_event {} __packed;

enum wmi_scan_status {};

/* WMI_SCAN_COMPLETE_EVENTID */
struct wmi_scan_complete_event {} __packed;

#define MAX_OPT_DATA_LEN

/*
 * Special frame receive Event.
 * Mechanism used to inform host of the receiption of the special frames.
 * Consists of special frame info header followed by special frame body.
 * The 802.11 header is not included.
 */
struct wmi_opt_rx_info_hdr {} __packed;

/* Reporting statistic */
struct tx_stats {} __packed;

struct rx_stats {} __packed;

#define RATE_INDEX_WITHOUT_SGI_MASK
#define RATE_INDEX_MSB

struct tkip_ccmp_stats {} __packed;

struct pm_stats {} __packed;

struct cserv_stats {} __packed;

struct wlan_net_stats {} __packed;

struct arp_stats {} __packed;

struct wlan_wow_stats {} __packed;

struct wmi_target_stats {} __packed;

/*
 * WMI_RSSI_THRESHOLD_EVENTID.
 * Indicate the RSSI events to host. Events are indicated when we breach a
 * thresold value.
 */
enum wmi_rssi_threshold_val {};

struct wmi_rssi_threshold_event {} __packed;

enum wmi_snr_threshold_val {};

struct wmi_snr_threshold_event {} __packed;

/* WMI_REPORT_ROAM_TBL_EVENTID */
#define MAX_ROAM_TBL_CAND

struct wmi_bss_roam_info {} __packed;

struct wmi_target_roam_tbl {} __packed;

/* WMI_CAC_EVENTID */
enum cac_indication {};

#define WMM_TSPEC_IE_LEN

struct wmi_cac_event {} __packed;

/* WMI_APLIST_EVENTID */

enum aplist_ver {};

struct wmi_ap_info_v1 {} __packed;

wmi_ap_info __packed;

struct wmi_aplist_event {} __packed;

/* Developer Commands */

/*
 * WMI_SET_BITRATE_CMDID
 *
 * Get bit rate cmd uses same definition as set bit rate cmd
 */
enum wmi_bit_rate {};

struct wmi_bit_rate_reply {} __packed;

/*
 * WMI_SET_FIXRATES_CMDID
 *
 * Get fix rates cmd uses same definition as set fix rates cmd
 */
struct wmi_fix_rates_reply {} __packed;

enum roam_data_type {};

struct wmi_target_roam_time {} __packed;

enum wmi_txop_cfg {};

struct wmi_set_wmm_txop_cmd {} __packed;

struct wmi_set_keepalive_cmd {} __packed;

struct wmi_get_keepalive_cmd {} __packed;

struct wmi_set_appie_cmd {} __packed;

struct wmi_set_ie_cmd {} __packed;

/* Notify the WSC registration status to the target */
#define WSC_REG_ACTIVE
#define WSC_REG_INACTIVE

#define WOW_MAX_FILTERS_PER_LIST
#define WOW_PATTERN_SIZE

#define MAC_MAX_FILTERS_PER_LIST

struct wow_filter {} __packed;

#define MAX_IP_ADDRS

struct wmi_set_ip_cmd {} __packed;

enum ath6kl_wow_filters {};

enum ath6kl_host_mode {};

struct wmi_set_host_sleep_mode_cmd {} __packed;

enum ath6kl_wow_mode {};

struct wmi_set_wow_mode_cmd {} __packed;

struct wmi_add_wow_pattern_cmd {} __packed;

struct wmi_del_wow_pattern_cmd {} __packed;

/* WMI_SET_TXE_NOTIFY_CMDID */
struct wmi_txe_notify_cmd {} __packed;

/* WMI_TXE_NOTIFY_EVENTID */
struct wmi_txe_notify_event {} __packed;

/* WMI_SET_AKMP_PARAMS_CMD */

struct wmi_pmkid {} __packed;

/* WMI_GET_PMKID_LIST_CMD  Reply */
struct wmi_pmkid_list_reply {} __packed;

/* WMI_ADDBA_REQ_EVENTID */
struct wmi_addba_req_event {} __packed;

/* WMI_ADDBA_RESP_EVENTID */
struct wmi_addba_resp_event {} __packed;

/* WMI_DELBA_EVENTID
 * f/w received a DELBA for peer and processed it.
 * Host is notified of this
 */
struct wmi_delba_event {} __packed;

#define PEER_NODE_JOIN_EVENT
#define PEER_NODE_LEAVE_EVENT
#define PEER_FIRST_NODE_JOIN_EVENT
#define PEER_LAST_NODE_LEAVE_EVENT

struct wmi_peer_node_event {} __packed;

/* Transmit complete event data structure(s) */

/* version 1 of tx complete msg */
struct tx_complete_msg_v1 {} __packed;

struct wmi_tx_complete_event {} __packed;

/*
 * ------- AP Mode definitions --------------
 */

/*
 * !!! Warning !!!
 * -Changing the following values needs compilation of both driver and firmware
 */
#define AP_MAX_NUM_STA

/* Spl. AID used to set DTIM flag in the beacons */
#define MCAST_AID

#define DEF_AP_COUNTRY_CODE

/* Used with WMI_AP_SET_NUM_STA_CMDID */

/*
 * Used with WMI_AP_SET_MLME_CMDID
 */

/* MLME Commands */
#define WMI_AP_MLME_ASSOC
#define WMI_AP_DISASSOC
#define WMI_AP_DEAUTH
#define WMI_AP_MLME_AUTHORIZE
#define WMI_AP_MLME_UNAUTHORIZE

struct wmi_ap_set_mlme_cmd {} __packed;

struct wmi_ap_set_pvb_cmd {} __packed;

struct wmi_rx_frame_format_cmd {} __packed;

struct wmi_ap_hidden_ssid_cmd {} __packed;

struct wmi_set_inact_period_cmd {} __packed;

/* AP mode events */
struct wmi_ap_set_apsd_cmd {} __packed;

enum wmi_ap_apsd_buffered_traffic_flags {};

struct wmi_ap_apsd_buffered_traffic_cmd {} __packed;

/* WMI_PS_POLL_EVENT */
struct wmi_pspoll_event {} __packed;

struct wmi_per_sta_stat {} __packed;

struct wmi_ap_mode_stat {} __packed;

/* End of AP mode definitions */

struct wmi_remain_on_chnl_cmd {} __packed;

/* wmi_send_action_cmd is to be deprecated. Use
 * wmi_send_mgmt_cmd instead. The new structure supports P2P mgmt
 * operations using station interface.
 */
struct wmi_send_action_cmd {} __packed;

struct wmi_send_mgmt_cmd {} __packed;

struct wmi_tx_status_event {} __packed;

struct wmi_probe_req_report_cmd {} __packed;

struct wmi_disable_11b_rates_cmd {} __packed;

struct wmi_set_appie_extended_cmd {} __packed;

struct wmi_remain_on_chnl_event {} __packed;

struct wmi_cancel_remain_on_chnl_event {} __packed;

struct wmi_rx_action_event {} __packed;

struct wmi_p2p_capabilities_event {} __packed;

struct wmi_p2p_rx_probe_req_event {} __packed;

#define P2P_FLAG_CAPABILITIES_REQ
#define P2P_FLAG_MACADDR_REQ
#define P2P_FLAG_HMODEL_REQ

struct wmi_get_p2p_info {} __packed;

struct wmi_p2p_info_event {} __packed;

struct wmi_p2p_capabilities {} __packed;

struct wmi_p2p_macaddr {} __packed;

struct wmi_p2p_hmodel {} __packed;

struct wmi_p2p_probe_response_cmd {} __packed;

/* Extended WMI (WMIX)
 *
 * Extended WMIX commands are encapsulated in a WMI message with
 * cmd=WMI_EXTENSION_CMD.
 *
 * Extended WMI commands are those that are needed during wireless
 * operation, but which are not really wireless commands.  This allows,
 * for instance, platform-specific commands.  Extended WMI commands are
 * embedded in a WMI command message with WMI_COMMAND_ID=WMI_EXTENSION_CMDID.
 * Extended WMI events are similarly embedded in a WMI event message with
 * WMI_EVENT_ID=WMI_EXTENSION_EVENTID.
 */
struct wmix_cmd_hdr {} __packed;

enum wmix_command_id {};

enum wmix_event_id {};

/*
 * ------Error Detection support-------
 */

/*
 * WMIX_HB_CHALLENGE_RESP_CMDID
 * Heartbeat Challenge Response command
 */
struct wmix_hb_challenge_resp_cmd {} __packed;

struct ath6kl_wmix_dbglog_cfg_module_cmd {} __packed;

/* End of Extended WMI (WMIX) */

enum wmi_sync_flag {};

enum htc_endpoint_id ath6kl_wmi_get_control_ep(struct wmi *wmi);
void ath6kl_wmi_set_control_ep(struct wmi *wmi, enum htc_endpoint_id ep_id);
int ath6kl_wmi_dix_2_dot3(struct wmi *wmi, struct sk_buff *skb);
int ath6kl_wmi_data_hdr_add(struct wmi *wmi, struct sk_buff *skb,
			    u8 msg_type, u32 flags,
			    enum wmi_data_hdr_data_type data_type,
			    u8 meta_ver, void *tx_meta_info, u8 if_idx);

int ath6kl_wmi_dot11_hdr_remove(struct wmi *wmi, struct sk_buff *skb);
int ath6kl_wmi_dot3_2_dix(struct sk_buff *skb);
int ath6kl_wmi_implicit_create_pstream(struct wmi *wmi, u8 if_idx,
				       struct sk_buff *skb, u32 layer2_priority,
				       bool wmm_enabled, u8 *ac);

int ath6kl_wmi_control_rx(struct wmi *wmi, struct sk_buff *skb);

int ath6kl_wmi_cmd_send(struct wmi *wmi, u8 if_idx, struct sk_buff *skb,
			enum wmi_cmd_id cmd_id, enum wmi_sync_flag sync_flag);

int ath6kl_wmi_connect_cmd(struct wmi *wmi, u8 if_idx,
			   enum network_type nw_type,
			   enum dot11_auth_mode dot11_auth_mode,
			   enum auth_mode auth_mode,
			   enum ath6kl_crypto_type pairwise_crypto,
			   u8 pairwise_crypto_len,
			   enum ath6kl_crypto_type group_crypto,
			   u8 group_crypto_len, int ssid_len, u8 *ssid,
			   u8 *bssid, u16 channel, u32 ctrl_flags,
			   u8 nw_subtype);

int ath6kl_wmi_reconnect_cmd(struct wmi *wmi, u8 if_idx, u8 *bssid,
			     u16 channel);
int ath6kl_wmi_disconnect_cmd(struct wmi *wmi, u8 if_idx);

int ath6kl_wmi_beginscan_cmd(struct wmi *wmi, u8 if_idx,
			     enum wmi_scan_type scan_type,
			     u32 force_fgscan, u32 is_legacy,
			     u32 home_dwell_time, u32 force_scan_interval,
			     s8 num_chan, u16 *ch_list, u32 no_cck,
			     u32 *rates);
int ath6kl_wmi_enable_sched_scan_cmd(struct wmi *wmi, u8 if_idx, bool enable);

int ath6kl_wmi_scanparams_cmd(struct wmi *wmi, u8 if_idx, u16 fg_start_sec,
			      u16 fg_end_sec, u16 bg_sec,
			      u16 minact_chdw_msec, u16 maxact_chdw_msec,
			      u16 pas_chdw_msec, u8 short_scan_ratio,
			      u8 scan_ctrl_flag, u32 max_dfsch_act_time,
			      u16 maxact_scan_per_ssid);
int ath6kl_wmi_bssfilter_cmd(struct wmi *wmi, u8 if_idx, u8 filter,
			     u32 ie_mask);
int ath6kl_wmi_probedssid_cmd(struct wmi *wmi, u8 if_idx, u8 index, u8 flag,
			      u8 ssid_len, u8 *ssid);
int ath6kl_wmi_listeninterval_cmd(struct wmi *wmi, u8 if_idx,
				  u16 listen_interval,
				  u16 listen_beacons);
int ath6kl_wmi_bmisstime_cmd(struct wmi *wmi, u8 if_idx,
			     u16 bmiss_time, u16 num_beacons);
int ath6kl_wmi_powermode_cmd(struct wmi *wmi, u8 if_idx, u8 pwr_mode);
int ath6kl_wmi_pmparams_cmd(struct wmi *wmi, u8 if_idx, u16 idle_period,
			    u16 ps_poll_num, u16 dtim_policy,
			    u16 tx_wakup_policy, u16 num_tx_to_wakeup,
			    u16 ps_fail_event_policy);
int ath6kl_wmi_create_pstream_cmd(struct wmi *wmi, u8 if_idx,
				  struct wmi_create_pstream_cmd *pstream);
int ath6kl_wmi_delete_pstream_cmd(struct wmi *wmi, u8 if_idx, u8 traffic_class,
				  u8 tsid);
int ath6kl_wmi_disctimeout_cmd(struct wmi *wmi, u8 if_idx, u8 timeout);

int ath6kl_wmi_set_rts_cmd(struct wmi *wmi, u16 threshold);
int ath6kl_wmi_set_lpreamble_cmd(struct wmi *wmi, u8 if_idx, u8 status,
				 u8 preamble_policy);

int ath6kl_wmi_get_challenge_resp_cmd(struct wmi *wmi, u32 cookie, u32 source);
int ath6kl_wmi_config_debug_module_cmd(struct wmi *wmi, u32 valid, u32 config);

int ath6kl_wmi_get_stats_cmd(struct wmi *wmi, u8 if_idx);
int ath6kl_wmi_addkey_cmd(struct wmi *wmi, u8 if_idx, u8 key_index,
			  enum ath6kl_crypto_type key_type,
			  u8 key_usage, u8 key_len,
			  u8 *key_rsc, unsigned int key_rsc_len,
			  u8 *key_material,
			  u8 key_op_ctrl, u8 *mac_addr,
			  enum wmi_sync_flag sync_flag);
int ath6kl_wmi_add_krk_cmd(struct wmi *wmi, u8 if_idx, const u8 *krk);
int ath6kl_wmi_deletekey_cmd(struct wmi *wmi, u8 if_idx, u8 key_index);
int ath6kl_wmi_setpmkid_cmd(struct wmi *wmi, u8 if_idx, const u8 *bssid,
			    const u8 *pmkid, bool set);
int ath6kl_wmi_set_tx_pwr_cmd(struct wmi *wmi, u8 if_idx, u8 dbM);
int ath6kl_wmi_get_tx_pwr_cmd(struct wmi *wmi, u8 if_idx);
int ath6kl_wmi_get_roam_tbl_cmd(struct wmi *wmi);

int ath6kl_wmi_set_wmm_txop(struct wmi *wmi, u8 if_idx, enum wmi_txop_cfg cfg);
int ath6kl_wmi_set_keepalive_cmd(struct wmi *wmi, u8 if_idx,
				 u8 keep_alive_intvl);
int ath6kl_wmi_set_htcap_cmd(struct wmi *wmi, u8 if_idx,
			     enum nl80211_band band,
			     struct ath6kl_htcap *htcap);
int ath6kl_wmi_test_cmd(struct wmi *wmi, void *buf, size_t len);

s32 ath6kl_wmi_get_rate(struct wmi *wmi, s8 rate_index);

int ath6kl_wmi_set_ip_cmd(struct wmi *wmi, u8 if_idx,
			  __be32 ips0, __be32 ips1);
int ath6kl_wmi_set_host_sleep_mode_cmd(struct wmi *wmi, u8 if_idx,
				       enum ath6kl_host_mode host_mode);
int ath6kl_wmi_set_bitrate_mask(struct wmi *wmi, u8 if_idx,
				const struct cfg80211_bitrate_mask *mask);
int ath6kl_wmi_set_wow_mode_cmd(struct wmi *wmi, u8 if_idx,
				enum ath6kl_wow_mode wow_mode,
				u32 filter, u16 host_req_delay);
int ath6kl_wmi_add_wow_pattern_cmd(struct wmi *wmi, u8 if_idx,
				   u8 list_id, u8 filter_size,
				   u8 filter_offset, const u8 *filter,
				   const u8 *mask);
int ath6kl_wmi_del_wow_pattern_cmd(struct wmi *wmi, u8 if_idx,
				   u16 list_id, u16 filter_id);
int ath6kl_wmi_set_rssi_filter_cmd(struct wmi *wmi, u8 if_idx, s8 rssi);
int ath6kl_wmi_set_roam_lrssi_cmd(struct wmi *wmi, u8 lrssi);
int ath6kl_wmi_ap_set_dtim_cmd(struct wmi *wmi, u8 if_idx, u32 dtim_period);
int ath6kl_wmi_ap_set_beacon_intvl_cmd(struct wmi *wmi, u8 if_idx,
				       u32 beacon_interval);
int ath6kl_wmi_force_roam_cmd(struct wmi *wmi, const u8 *bssid);
int ath6kl_wmi_set_roam_mode_cmd(struct wmi *wmi, enum wmi_roam_mode mode);
int ath6kl_wmi_mcast_filter_cmd(struct wmi *wmi, u8 if_idx, bool mc_all_on);
int ath6kl_wmi_add_del_mcast_filter_cmd(struct wmi *wmi, u8 if_idx,
					u8 *filter, bool add_filter);
int ath6kl_wmi_sta_bmiss_enhance_cmd(struct wmi *wmi, u8 if_idx, bool enable);
int ath6kl_wmi_set_txe_notify(struct wmi *wmi, u8 idx,
			      u32 rate, u32 pkts, u32 intvl);
int ath6kl_wmi_set_regdomain_cmd(struct wmi *wmi, const char *alpha2);

/* AP mode uAPSD */
int ath6kl_wmi_ap_set_apsd(struct wmi *wmi, u8 if_idx, u8 enable);

int ath6kl_wmi_set_apsd_bfrd_traf(struct wmi *wmi,
						u8 if_idx, u16 aid,
						u16 bitmap, u32 flags);

u8 ath6kl_wmi_get_traffic_class(u8 user_priority);

u8 ath6kl_wmi_determine_user_priority(u8 *pkt, u32 layer2_pri);
/* AP mode */
int ath6kl_wmi_ap_hidden_ssid(struct wmi *wmi, u8 if_idx, bool enable);
int ath6kl_wmi_ap_profile_commit(struct wmi *wmip, u8 if_idx,
				 struct wmi_connect_cmd *p);

int ath6kl_wmi_ap_set_mlme(struct wmi *wmip, u8 if_idx, u8 cmd,
			   const u8 *mac, u16 reason);

int ath6kl_wmi_set_pvb_cmd(struct wmi *wmi, u8 if_idx, u16 aid, bool flag);

int ath6kl_wmi_set_rx_frame_format_cmd(struct wmi *wmi, u8 if_idx,
				       u8 rx_meta_version,
				       bool rx_dot11_hdr, bool defrag_on_host);

int ath6kl_wmi_set_appie_cmd(struct wmi *wmi, u8 if_idx, u8 mgmt_frm_type,
			     const u8 *ie, u8 ie_len);

int ath6kl_wmi_set_ie_cmd(struct wmi *wmi, u8 if_idx, u8 ie_id, u8 ie_field,
			  const u8 *ie_info, u8 ie_len);

/* P2P */
int ath6kl_wmi_disable_11b_rates_cmd(struct wmi *wmi, bool disable);

int ath6kl_wmi_remain_on_chnl_cmd(struct wmi *wmi, u8 if_idx, u32 freq,
				  u32 dur);

int ath6kl_wmi_send_mgmt_cmd(struct wmi *wmi, u8 if_idx, u32 id, u32 freq,
			       u32 wait, const u8 *data, u16 data_len,
			       u32 no_cck);

int ath6kl_wmi_send_probe_response_cmd(struct wmi *wmi, u8 if_idx, u32 freq,
				       const u8 *dst, const u8 *data,
				       u16 data_len);

int ath6kl_wmi_probe_report_req_cmd(struct wmi *wmi, u8 if_idx, bool enable);

int ath6kl_wmi_info_req_cmd(struct wmi *wmi, u8 if_idx, u32 info_req_flags);

int ath6kl_wmi_cancel_remain_on_chnl_cmd(struct wmi *wmi, u8 if_idx);

int ath6kl_wmi_set_appie_cmd(struct wmi *wmi, u8 if_idx, u8 mgmt_frm_type,
			     const u8 *ie, u8 ie_len);

int ath6kl_wmi_set_inact_period(struct wmi *wmi, u8 if_idx, int inact_timeout);

void ath6kl_wmi_sscan_timer(struct timer_list *t);

int ath6kl_wmi_get_challenge_resp_cmd(struct wmi *wmi, u32 cookie, u32 source);

struct ath6kl_vif *ath6kl_get_vif_by_index(struct ath6kl *ar, u8 if_idx);
void *ath6kl_wmi_init(struct ath6kl *devt);
void ath6kl_wmi_shutdown(struct wmi *wmi);
void ath6kl_wmi_reset(struct wmi *wmi);

#endif /* WMI_H */