linux/drivers/net/wireless/rsi/rsi_mgmt.h

/*
 * Copyright (c) 2014 Redpine Signals 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.
 */

#ifndef __RSI_MGMT_H__
#define __RSI_MGMT_H__

#include <linux/sort.h>
#include "rsi_boot_params.h"
#include "rsi_main.h"

#define MAX_MGMT_PKT_SIZE
#define RSI_NEEDED_HEADROOM
#define RSI_RCV_BUFFER_LEN

#define RSI_11B_MODE
#define RSI_11G_MODE
#define RETRY_COUNT
#define RETRY_LONG
#define RETRY_SHORT
#define WMM_SHORT_SLOT_TIME
#define SIFS_DURATION

#define EAPOL4_PACKET_LEN
#define KEY_TYPE_CLEAR
#define RSI_PAIRWISE_KEY
#define RSI_GROUP_KEY

/* EPPROM_READ_ADDRESS */
#define WLAN_MAC_EEPROM_ADDR
#define WLAN_MAC_MAGIC_WORD_LEN
#define WLAN_HOST_MODE_LEN
#define WLAN_FW_VERSION_LEN
#define MAGIC_WORD
#define WLAN_EEPROM_RFTYPE_ADDR

/*WOWLAN RESUME WAKEUP TYPES*/
#define RSI_UNICAST_MAGIC_PKT
#define RSI_BROADCAST_MAGICPKT
#define RSI_EAPOL_PKT
#define RSI_DISCONNECT_PKT
#define RSI_HW_BMISS_PKT
#define RSI_INSERT_SEQ_IN_FW

#define WOW_MAX_FILTERS_PER_LIST
#define WOW_PATTERN_SIZE

/* Receive Frame Types */
#define RSI_RX_DESC_MSG_TYPE_OFFSET
#define TA_CONFIRM_TYPE
#define RX_DOT11_MGMT
#define TX_STATUS_IND
#define BEACON_EVENT_IND
#define EAPOL4_CONFIRM
#define PROBEREQ_CONFIRM
#define CARD_READY_IND
#define SLEEP_NOTIFY_IND
#define RSI_TX_STATUS_TYPE
#define RSI_TX_STATUS

#define RSI_DELETE_PEER
#define RSI_ADD_PEER
#define START_AMPDU_AGGR
#define STOP_AMPDU_AGGR
#define INTERNAL_MGMT_PKT

#define PUT_BBP_RESET
#define BBP_REG_WRITE
#define RF_RESET_ENABLE
#define RATE_INFO_ENABLE
#define MORE_DATA_PRESENT
#define RSI_BROADCAST_PKT
#define RSI_DESC_REQUIRE_CFM_TO_HOST
#define RSI_ADD_DELTA_TSF_VAP_ID
#define RSI_FETCH_RETRY_CNT_FRM_HST
#define RSI_QOS_ENABLE
#define RSI_REKEY_PURPOSE
#define RSI_ENCRYPT_PKT
#define RSI_SET_PS_ENABLE

#define RSI_CMDDESC_40MHZ
#define RSI_CMDDESC_UPPER_20_ENABLE
#define RSI_CMDDESC_LOWER_20_ENABLE
#define RSI_CMDDESC_FULL_40_ENABLE
#define UPPER_20_ENABLE
#define LOWER_20_ENABLE
#define FULL40M_ENABLE

#define RSI_LMAC_CLOCK_80MHZ
#define RSI_ENABLE_40MHZ
#define ENABLE_SHORTGI_RATE

#define RX_BA_INDICATION
#define RSI_TBL_SZ
#define MAX_RETRIES
#define RSI_IFTYPE_STATION

#define STD_RATE_MCS7
#define STD_RATE_MCS6
#define STD_RATE_MCS5
#define STD_RATE_MCS4
#define STD_RATE_MCS3
#define STD_RATE_MCS2
#define STD_RATE_MCS1
#define STD_RATE_MCS0
#define STD_RATE_54
#define STD_RATE_48
#define STD_RATE_36
#define STD_RATE_24
#define STD_RATE_18
#define STD_RATE_12
#define STD_RATE_11
#define STD_RATE_09
#define STD_RATE_06
#define STD_RATE_5_5
#define STD_RATE_02
#define STD_RATE_01

#define RSI_RF_TYPE
#define RSI_RATE_00
#define RSI_RATE_1
#define RSI_RATE_2
#define RSI_RATE_5_5
#define RSI_RATE_11
#define RSI_RATE_6
#define RSI_RATE_9
#define RSI_RATE_12
#define RSI_RATE_18
#define RSI_RATE_24
#define RSI_RATE_36
#define RSI_RATE_48
#define RSI_RATE_54
#define RSI_RATE_MCS0
#define RSI_RATE_MCS1
#define RSI_RATE_MCS2
#define RSI_RATE_MCS3
#define RSI_RATE_MCS4
#define RSI_RATE_MCS5
#define RSI_RATE_MCS6
#define RSI_RATE_MCS7
#define RSI_RATE_MCS7_SG
#define RSI_RATE_AUTO

#define BW_20MHZ
#define BW_40MHZ

#define EP_2GHZ_20MHZ
#define EP_2GHZ_40MHZ
#define EP_5GHZ_20MHZ
#define EP_5GHZ_40MHZ

#define SIFS_TX_11N_VALUE
#define SIFS_TX_11B_VALUE
#define SHORT_SLOT_VALUE
#define LONG_SLOT_VALUE
#define OFDM_ACK_TOUT_VALUE
#define CCK_ACK_TOUT_VALUE
#define LONG_PREAMBLE
#define SHORT_PREAMBLE

#define RSI_SUPP_FILTERS

#define ANTENNA_SEL_INT
#define ANTENNA_SEL_UFL
#define ANTENNA_MASK_VALUE
#define ANTENNA_SEL_TYPE

/* Rx filter word definitions */
#define PROMISCOUS_MODE
#define ALLOW_DATA_ASSOC_PEER
#define ALLOW_MGMT_ASSOC_PEER
#define ALLOW_CTRL_ASSOC_PEER
#define DISALLOW_BEACONS
#define ALLOW_CONN_PEER_MGMT_WHILE_BUF_FULL
#define DISALLOW_BROADCAST_DATA

#define RSI_MPDU_DENSITY
#define RSI_CHAN_RADAR
#define RSI_BEACON_INTERVAL
#define RSI_DTIM_COUNT

#define RSI_PS_DISABLE_IND
#define RSI_PS_ENABLE
#define RSI_PS_DISABLE
#define RSI_DEEP_SLEEP
#define RSI_CONNECTED_SLEEP
#define RSI_SLEEP_REQUEST
#define RSI_WAKEUP_REQUEST

#define RSI_IEEE80211_UAPSD_QUEUES

#define RSI_DESC_VAP_ID_MASK
#define RSI_DESC_VAP_ID_OFST
#define RSI_DATA_DESC_MAC_BBP_INFO
#define RSI_DATA_DESC_NO_ACK_IND
#define RSI_DATA_DESC_QOS_EN
#define RSI_DATA_DESC_NORMAL_FRAME
#define RSI_DATA_DESC_DTIM_BEACON_GATED_FRAME
#define RSI_DATA_DESC_BEACON_FRAME
#define RSI_DATA_DESC_DTIM_BEACON
#define RSI_DATA_DESC_INSERT_TSF
#define RSI_DATA_DESC_INSERT_SEQ_NO

#ifdef CONFIG_PM
#define RSI_WOW_ANY
#define RSI_WOW_GTK_REKEY
#define RSI_WOW_MAGIC_PKT
#define RSI_WOW_DISCONNECT
#endif

#define RSI_MAX_TX_AGGR_FRMS
#define RSI_MAX_RX_AGGR_FRMS

#define RSI_MAX_SCAN_SSIDS
#define RSI_MAX_SCAN_IE_LEN

enum opmode {};

enum vap_status {};

enum peer_type {};
extern struct ieee80211_rate rsi_rates[12];
extern const u16 rsi_mcsrates[8];

enum sta_notify_events {};

/* Send Frames Types */
enum cmd_frame_type {};

struct rsi_mac_frame {} __packed;

#define PWR_SAVE_WAKEUP_IND
#define TCP_CHECK_SUM_OFFLOAD
#define CONFIRM_REQUIRED_TO_HOST
#define ADD_DELTA_TSF
#define FETCH_RETRY_CNT_FROM_HOST_DESC
#define EOSP_INDICATION
#define REQUIRE_TSF_SYNC_CONFIRM
#define ENCAP_MGMT_PKT
#define DESC_IMMEDIATE_WAKEUP

struct rsi_xtended_desc {};

struct rsi_cmd_desc_dword0 {};

struct rsi_cmd_desc_dword1 {};

struct rsi_cmd_desc_dword2 {};

struct rsi_cmd_desc_dword3 {};

struct rsi_cmd_desc {};

struct rsi_boot_params {} __packed;

struct rsi_boot_params_9116 {} __packed;

struct rsi_peer_notify {} __packed;

/* Aggregation params flags */
#define RSI_AGGR_PARAMS_TID_MASK
#define RSI_AGGR_PARAMS_START
#define RSI_AGGR_PARAMS_RX_AGGR
struct rsi_aggr_params {} __packed;

struct rsi_bb_rf_prog {} __packed;

struct rsi_chan_config {} __packed;

struct rsi_vap_caps {} __packed;

struct rsi_ant_sel_frame {} __packed;

struct rsi_dynamic_s {} __packed;

/* Key descriptor flags */
#define RSI_KEY_TYPE_BROADCAST
#define RSI_WEP_KEY
#define RSI_WEP_KEY_104
#define RSI_CIPHER_WPA
#define RSI_CIPHER_TKIP
#define RSI_KEY_MODE_AP
#define RSI_PROTECT_DATA_FRAMES
#define RSI_KEY_ID_MASK
#define RSI_KEY_ID_OFFSET
struct rsi_set_key {} __packed;

struct rsi_auto_rate {} __packed;

#define QUIET_INFO_VALID
#define QUIET_ENABLE
struct rsi_block_unblock_data {} __packed;

struct qos_params {} __packed;

struct rsi_radio_caps {} __packed;

/* ULP GPIO flags */
#define RSI_GPIO_MOTION_SENSOR_ULP_WAKEUP
#define RSI_GPIO_SLEEP_IND_FROM_DEVICE
#define RSI_GPIO_2_ULP
#define RSI_GPIO_PUSH_BUTTON_ULP_WAKEUP

/* SOC GPIO flags */
#define RSI_GPIO_0_PSPI_CSN_0
#define RSI_GPIO_1_PSPI_CSN_1
#define RSI_GPIO_2_HOST_WAKEUP_INTR
#define RSI_GPIO_3_PSPI_DATA_0
#define RSI_GPIO_4_PSPI_DATA_1
#define RSI_GPIO_5_PSPI_DATA_2
#define RSI_GPIO_6_PSPI_DATA_3
#define RSI_GPIO_7_I2C_SCL
#define RSI_GPIO_8_I2C_SDA
#define RSI_GPIO_9_UART1_RX
#define RSI_GPIO_10_UART1_TX
#define RSI_GPIO_11_UART1_RTS_I2S_CLK
#define RSI_GPIO_12_UART1_CTS_I2S_WS
#define RSI_GPIO_13_DBG_UART_RX_I2S_DIN
#define RSI_GPIO_14_DBG_UART_RX_I2S_DOUT
#define RSI_GPIO_15_LP_WAKEUP_BOOT_BYPASS
#define RSI_GPIO_16_LED_0
#define RSI_GPIO_17_BTCOEX_WLAN_ACT_EXT_ANT_SEL
#define RSI_GPIO_18_BTCOEX_BT_PRIO_EXT_ANT_SEL
#define RSI_GPIO_19_BTCOEX_BT_ACT_EXT_ON_OFF
#define RSI_GPIO_20_RF_RESET
#define RSI_GPIO_21_SLEEP_IND_FROM_DEVICE

#define RSI_UNUSED_SOC_GPIO_BITMAP

#define RSI_UNUSED_ULP_GPIO_BITMAP
struct rsi_config_vals {} __packed;

/* Packet info flags */
#define RSI_EEPROM_HDR_SIZE_OFFSET
#define RSI_EEPROM_HDR_SIZE_MASK
#define RSI_EEPROM_LEN_OFFSET
#define RSI_EEPROM_LEN_MASK

struct rsi_eeprom_read_frame {} __packed;

struct rsi_request_ps {} __packed;

struct rsi_wowlan_req {} __packed;

#define RSI_START_BGSCAN
#define RSI_STOP_BGSCAN
#define HOST_BG_SCAN_TRIG
struct rsi_bgscan_config {} __packed;

struct rsi_bgscan_probe {} __packed;

#define RSI_DUTY_CYCLING
#define RSI_END_OF_FRAME
#define RSI_SIFS_TX_ENABLE
#define RSI_DPD
struct rsi_wlan_9116_features {};

static inline u32 rsi_get_queueno(u8 *addr, u16 offset)
{}

static inline u32 rsi_get_length(u8 *addr, u16 offset)
{}

static inline u8 rsi_get_extended_desc(u8 *addr, u16 offset)
{}

static inline u8 rsi_get_rssi(u8 *addr)
{}

static inline u8 rsi_get_channel(u8 *addr)
{}

static inline void rsi_set_len_qno(__le16 *addr, u16 len, u8 qno)
{}

int rsi_handle_card_ready(struct rsi_common *common, u8 *msg);
int rsi_mgmt_pkt_recv(struct rsi_common *common, u8 *msg);
int rsi_set_vap_capabilities(struct rsi_common *common, enum opmode mode,
			     u8 *mac_addr, u8 vap_id, u8 vap_status);
int rsi_send_aggregation_params_frame(struct rsi_common *common, u16 tid,
				      u16 ssn, u8 buf_size, u8 event,
				      u8 sta_id);
int rsi_hal_load_key(struct rsi_common *common, u8 *data, u16 key_len,
		     u8 key_type, u8 key_id, u32 cipher, s16 sta_id,
		     struct ieee80211_vif *vif);
int rsi_set_channel(struct rsi_common *common,
		    struct ieee80211_channel *channel);
int rsi_send_vap_dynamic_update(struct rsi_common *common);
int rsi_send_block_unblock_frame(struct rsi_common *common, bool event);
int rsi_hal_send_sta_notify_frame(struct rsi_common *common, enum opmode opmode,
				  u8 notify_event, const unsigned char *bssid,
				  u8 qos_enable, u16 aid, u16 sta_id,
				  struct ieee80211_vif *vif);
void rsi_inform_bss_status(struct rsi_common *common, enum opmode opmode,
			   u8 status, const u8 *addr, u8 qos_enable, u16 aid,
			   struct ieee80211_sta *sta, u16 sta_id,
			   u16 assoc_cap, struct ieee80211_vif *vif);
void rsi_indicate_pkt_to_os(struct rsi_common *common, struct sk_buff *skb);
int rsi_mac80211_attach(struct rsi_common *common);
void rsi_indicate_tx_status(struct rsi_hw *common, struct sk_buff *skb,
			    int status);
bool rsi_is_cipher_wep(struct rsi_common *common);
void rsi_core_qos_processor(struct rsi_common *common);
void rsi_core_xmit(struct rsi_common *common, struct sk_buff *skb);
int rsi_send_mgmt_pkt(struct rsi_common *common, struct sk_buff *skb);
int rsi_send_data_pkt(struct rsi_common *common, struct sk_buff *skb);
int rsi_band_check(struct rsi_common *common, struct ieee80211_channel *chan);
int rsi_send_rx_filter_frame(struct rsi_common *common, u16 rx_filter_word);
int rsi_send_radio_params_update(struct rsi_common *common);
int rsi_set_antenna(struct rsi_common *common, u8 antenna);
#ifdef CONFIG_PM
int rsi_send_wowlan_request(struct rsi_common *common, u16 flags,
			    u16 sleep_status);
#endif
int rsi_send_ps_request(struct rsi_hw *adapter, bool enable,
			struct ieee80211_vif *vif);
void init_bgscan_params(struct rsi_common *common);
int rsi_send_bgscan_params(struct rsi_common *common, int enable);
int rsi_send_bgscan_probe_req(struct rsi_common *common,
			      struct ieee80211_vif *vif);
#endif