linux/drivers/staging/ks7010/ks_hostif.h

/* SPDX-License-Identifier: GPL-2.0 */
/*
 *   Driver for KeyStream wireless LAN
 *
 *   Copyright (c) 2005-2008 KeyStream Corp.
 *   Copyright (C) 2009 Renesas Technology Corp.
 */

#ifndef _KS_HOSTIF_H_
#define _KS_HOSTIF_H_

#include <linux/compiler.h>
#include <linux/ieee80211.h>

/*
 * HOST-MAC I/F events
 */
#define HIF_DATA_REQ
#define HIF_DATA_IND
#define HIF_MIB_GET_REQ
#define HIF_MIB_GET_CONF
#define HIF_MIB_SET_REQ
#define HIF_MIB_SET_CONF
#define HIF_POWER_MGMT_REQ
#define HIF_POWER_MGMT_CONF
#define HIF_START_REQ
#define HIF_START_CONF
#define HIF_CONNECT_IND
#define HIF_STOP_REQ
#define HIF_STOP_CONF
#define HIF_PS_ADH_SET_REQ
#define HIF_PS_ADH_SET_CONF
#define HIF_INFRA_SET_REQ
#define HIF_INFRA_SET_CONF
#define HIF_ADH_SET_REQ
#define HIF_ADH_SET_CONF
#define HIF_AP_SET_REQ
#define HIF_AP_SET_CONF
#define HIF_ASSOC_INFO_IND
#define HIF_MIC_FAILURE_REQ
#define HIF_MIC_FAILURE_CONF
#define HIF_SCAN_REQ
#define HIF_SCAN_CONF
#define HIF_PHY_INFO_REQ
#define HIF_PHY_INFO_CONF
#define HIF_SLEEP_REQ
#define HIF_SLEEP_CONF
#define HIF_PHY_INFO_IND
#define HIF_SCAN_IND
#define HIF_INFRA_SET2_REQ
#define HIF_INFRA_SET2_CONF
#define HIF_ADH_SET2_REQ
#define HIF_ADH_SET2_CONF

#define HIF_REQ_MAX

/*
 * HOST-MAC I/F data structure
 * Byte alignment Little Endian
 */

struct hostif_hdr {} __packed;

struct hostif_data_request {} __packed;

#define TYPE_PMK1
#define TYPE_GMK1
#define TYPE_GMK2

#define CHANNEL_LIST_MAX_SIZE
struct channel_list {} __packed;

/**
 * enum mib_attribute - Management Information Base attribute
 * Attribute value used for accessing and updating MIB
 *
 * @DOT11_MAC_ADDRESS: MAC Address (R)
 * @DOT11_PRODUCT_VERSION: FirmWare Version (R)
 * @DOT11_RTS_THRESHOLD: RTS Threshold (R/W)
 * @DOT11_FRAGMENTATION_THRESHOLD: Fragment Threshold (R/W)
 * @DOT11_PRIVACY_INVOKED: WEP ON/OFF (W)
 * @DOT11_WEP_DEFAULT_KEY_ID: WEP Index (W)
 * @DOT11_WEP_DEFAULT_KEY_VALUE1: WEP Key#1(TKIP AES: PairwiseTemporalKey) (W)
 * @DOT11_WEP_DEFAULT_KEY_VALUE2: WEP Key#2(TKIP AES: GroupKey1) (W)
 * @DOT11_WEP_DEFAULT_KEY_VALUE3: WEP Key#3(TKIP AES: GroupKey2) (W)
 * @DOT11_WEP_DEFAULT_KEY_VALUE4: WEP Key#4 (W)
 * @DOT11_WEP_LIST: WEP LIST
 * @DOT11_DESIRED_SSID: SSID
 * @DOT11_CURRENT_CHANNEL: channel set
 * @DOT11_OPERATION_RATE_SET: rate set
 * @LOCAL_AP_SEARCH_INTERVAL: AP search interval (R/W)
 * @LOCAL_CURRENTADDRESS: MAC Address change (W)
 * @LOCAL_MULTICAST_ADDRESS: Multicast Address (W)
 * @LOCAL_MULTICAST_FILTER: Multicast Address Filter enable/disable (W)
 * @LOCAL_SEARCHED_AP_LIST: AP list (R)
 * @LOCAL_LINK_AP_STATUS: Link AP status (R)
 * @LOCAL_PACKET_STATISTICS: tx,rx packets statistics
 * @LOCAL_AP_SCAN_LIST_TYPE_SET: AP_SCAN_LIST_TYPE
 * @DOT11_RSN_ENABLED: WPA enable/disable (W)
 * @LOCAL_RSN_MODE: RSN mode WPA/WPA2 (W)
 * @DOT11_RSN_CONFIG_MULTICAST_CIPHER: GroupKeyCipherSuite (W)
 * @DOT11_RSN_CONFIG_UNICAST_CIPHER: PairwiseKeyCipherSuite (W)
 * @DOT11_RSN_CONFIG_AUTH_SUITE: AuthenticationKeyManagementSuite (W)
 * @DOT11_RSN_CONFIG_VERSION: RSN version (W)
 * @LOCAL_RSN_CONFIG_ALL: RSN CONFIG ALL (W)
 * @DOT11_PMK_TSC: PMK_TSC (W)
 * @DOT11_GMK1_TSC: GMK1_TSC (W)
 * @DOT11_GMK2_TSC: GMK2_TSC (W)
 * @DOT11_GMK3_TSC: GMK3_TSC
 * @LOCAL_PMK: Pairwise Master Key cache (W)
 * @LOCAL_REGION: Region setting
 * @LOCAL_WPS_ENABLE: WiFi Protected Setup
 * @LOCAL_WPS_PROBE_REQ: WPS Probe Request
 * @LOCAL_GAIN: Carrer sense threshold for demo ato show
 * @LOCAL_EEPROM_SUM: EEPROM checksum information
 */
enum mib_attribute {};

struct hostif_mib_get_request {} __packed;

/**
 * enum mib_data_type - Message Information Base data type.
 * @MIB_VALUE_TYPE_NULL: NULL type
 * @MIB_VALUE_TYPE_INT: INTEGER type
 * @MIB_VALUE_TYPE_BOOL: BOOL type
 * @MIB_VALUE_TYPE_COUNT32: unused
 * @MIB_VALUE_TYPE_OSTRING: Chunk of memory
 */
enum mib_data_type {};

struct hostif_mib_value {} __packed;

struct hostif_mib_get_confirm_t {} __packed;

struct hostif_mib_set_request_t {} __packed;

struct hostif_power_mgmt_request {} __packed;

enum power_mgmt_mode_type {};

#define RESULT_SUCCESS
#define RESULT_INVALID_PARAMETERS
#define RESULT_NOT_SUPPORTED
/* #define	RESULT_ALREADY_RUNNING    3 */
#define RESULT_ALREADY_RUNNING

struct hostif_start_request {} __packed;

struct ssid {} __packed;

#define RATE_SET_MAX_SIZE
struct rate_set8 {} __packed;

struct fh_parms {} __packed;

struct ds_parms {} __packed;

struct cf_parms {} __packed;

struct ibss_parms {} __packed;

struct rsn_t {} __packed;

struct erp_params_t {} __packed;

struct rate_set16 {} __packed;

struct ap_info {} __packed;

struct link_ap_info {} __packed;

#define RESULT_CONNECT
#define RESULT_DISCONNECT

struct hostif_stop_request {} __packed;

#define D_11B_ONLY_MODE
#define D_11G_ONLY_MODE
#define D_11BG_COMPATIBLE_MODE
#define D_11A_ONLY_MODE

#define CTS_MODE_FALSE
#define CTS_MODE_TRUE

struct hostif_request {} __packed;

/**
 * struct hostif_ps_adhoc_set_request - pseudo adhoc mode
 * @capability: bit5  : preamble
 *              bit6  : pbcc - Not supported always 0
 *              bit10 : ShortSlotTime
 *              bit13 : DSSS-OFDM - Not supported always 0
 */
struct hostif_ps_adhoc_set_request {} __packed;

#define AUTH_TYPE_OPEN_SYSTEM
#define AUTH_TYPE_SHARED_KEY

/**
 * struct hostif_infrastructure_set_request
 * @capability: bit5  : preamble
 *              bit6  : pbcc - Not supported always 0
 *              bit10 : ShortSlotTime
 *              bit13 : DSSS-OFDM - Not supported always 0
 */
struct hostif_infrastructure_set_request {} __packed;

/**
 * struct hostif_adhoc_set_request
 * @capability: bit5  : preamble
 *              bit6  : pbcc - Not supported always 0
 *              bit10 : ShortSlotTime
 *              bit13 : DSSS-OFDM - Not supported always 0
 */
struct hostif_adhoc_set_request {} __packed;

/**
 * struct hostif_adhoc_set2_request
 * @capability: bit5  : preamble
 *              bit6  : pbcc - Not supported always 0
 *              bit10 : ShortSlotTime
 *              bit13 : DSSS-OFDM - Not supported always 0
 */
struct hostif_adhoc_set2_request {} __packed;

struct association_request {} __packed;

struct association_response {} __packed;

struct hostif_bss_scan_request {} __packed;

struct hostif_phy_information_request {} __packed;

enum sleep_mode_type {};

struct hostif_sleep_request {} __packed;

struct hostif_mic_failure_request {} __packed;

#define BASIC_RATE
#define RATE_MASK

#define TX_RATE_AUTO
#define TX_RATE_1M_FIXED
#define TX_RATE_2M_FIXED
#define TX_RATE_1_2M_AUTO
#define TX_RATE_5M_FIXED
#define TX_RATE_11M_FIXED

#define TX_RATE_FULL_AUTO
#define TX_RATE_11_AUTO
#define TX_RATE_11B_AUTO
#define TX_RATE_11BG_AUTO
#define TX_RATE_MANUAL_AUTO
#define TX_RATE_FIXED

/* 11b rate */
#define TX_RATE_1M
#define TX_RATE_2M
#define TX_RATE_5M
#define TX_RATE_11M

/* 11g rate */
#define TX_RATE_6M
#define TX_RATE_12M
#define TX_RATE_24M
#define TX_RATE_9M
#define TX_RATE_18M
#define TX_RATE_36M
#define TX_RATE_48M
#define TX_RATE_54M

static inline bool is_11b_rate(u8 rate)
{}

static inline bool is_ofdm_rate(u8 rate)
{}

static inline bool is_11bg_rate(u8 rate)
{}

static inline bool is_ofdm_ext_rate(u8 rate)
{}

enum connect_status_type {};

enum preamble_type {};

enum multicast_filter_type {};

#define NIC_MAX_MCAST_LIST

#define HIF_EVENT_MASK

static inline bool is_hif_ind(unsigned short event)
{}

static inline bool is_hif_conf(unsigned short event)
{}

#ifdef __KERNEL__

#include "ks_wlan.h"

/* function prototype */
int hostif_data_request(struct ks_wlan_private *priv, struct sk_buff *skb);
void hostif_receive(struct ks_wlan_private *priv, unsigned char *p,
		    unsigned int size);
void hostif_sme_enqueue(struct ks_wlan_private *priv, u16 event);
int hostif_init(struct ks_wlan_private *priv);
void hostif_exit(struct ks_wlan_private *priv);
int ks_wlan_hw_tx(struct ks_wlan_private *priv, void *p, unsigned long size,
		  void (*complete_handler)(struct ks_wlan_private *priv,
					   struct sk_buff *skb),
		  struct sk_buff *skb);
void send_packet_complete(struct ks_wlan_private *priv, struct sk_buff *skb);

void ks_wlan_hw_wakeup_request(struct ks_wlan_private *priv);
int ks_wlan_hw_power_save(struct ks_wlan_private *priv);

#define KS7010_SIZE_ALIGNMENT

static inline size_t hif_align_size(size_t size)
{}

#endif /* __KERNEL__ */

#endif /* _KS_HOSTIF_H_ */