/* ///////////////////////////////////////////////////////////////////////// */
/* */
/* Copyright (c) Atmel Corporation. All rights reserved. */
/* */
/* Module Name: wilc_wlan_if.h */
/* */
/* */
/* ///////////////////////////////////////////////////////////////////////// */
#ifndef WILC_WLAN_IF_H
#define WILC_WLAN_IF_H
#include <linux/semaphore.h>
#include "linux_wlan_common.h"
#include <linux/netdevice.h>
/********************************************
*
* Debug Flags
*
********************************************/
#define N_INIT 0x00000001
#define N_ERR 0x00000002
#define N_TXQ 0x00000004
#define N_INTR 0x00000008
#define N_RXQ 0x00000010
/********************************************
*
* Host Interface Defines
*
********************************************/
#define HIF_SDIO (0)
#define HIF_SPI BIT(0)
#define HIF_SDIO_GPIO_IRQ BIT(2)
/********************************************
*
* Tx/Rx Buffer Size Defines
*
********************************************/
#define CE_TX_BUFFER_SIZE (64 * 1024)
#define CE_RX_BUFFER_SIZE (384 * 1024)
/********************************************
*
* Wlan Interface Defines
*
********************************************/
typedef struct {
u32 read_write: 1;
u32 function: 3;
u32 raw: 1;
u32 address: 17;
u32 data: 8;
} sdio_cmd52_t;
typedef struct {
/* struct { */
u32 read_write: 1;
u32 function: 3;
u32 block_mode: 1;
u32 increment: 1;
u32 address: 17;
u32 count: 9;
/* } bit; */
u8 *buffer;
u32 block_size;
} sdio_cmd53_t;
#define WILC_MAC_INDICATE_STATUS 0x1
#define WILC_MAC_STATUS_INIT -1
#define WILC_MAC_STATUS_READY 0
#define WILC_MAC_STATUS_CONNECT 1
#define WILC_MAC_INDICATE_SCAN 0x2
struct tx_complete_data {
int size;
void *buff;
u8 *pBssid;
struct sk_buff *skb;
};
typedef void (*wilc_tx_complete_func_t)(void *, int);
#define WILC_TX_ERR_NO_BUF (-2)
/********************************************
*
* Wlan Configuration ID
*
********************************************/
#define MAX_SSID_LEN 33
#define MAX_RATES_SUPPORTED 12
#define INFINITE_SLEEP_TIME ((u32)0xFFFFFFFF)
typedef enum {
SUPP_RATES_IE = 1,
EXT_SUPP_RATES_IE = 50,
HT_CAPABILITY_IE = 45,
RSN_IE = 48,
WPA_IE = 221,
WMM_IE = 221,
P2P_IE = 221,
} BEACON_IE;
typedef enum {
INFRASTRUCTURE = 0,
INDEPENDENT,
AP,
} BSSTYPE_T;
typedef enum {
RATE_AUTO = 0,
RATE_1MB = 1,
RATE_2MB = 2,
RATE_5MB = 5,
RATE_6MB = 6,
RATE_9MB = 9,
RATE_11MB = 11,
RATE_12MB = 12,
RATE_18MB = 18,
RATE_24MB = 24,
RATE_26MB = 36,
RATE_48MB = 48,
RATE_54MB = 54
} TX_RATE_T;
typedef enum {
B_ONLY_MODE = 0, /* 1, 2 M, otherwise 5, 11 M */
G_ONLY_MODE, /* 6,12,24 otherwise 9,18,36,48,54 */
G_MIXED_11B_1_MODE, /* 1,2,5.5,11 otherwise all on */
G_MIXED_11B_2_MODE, /* 1,2,5,11,6,12,24 otherwise all on */
} G_OPERATING_MODE_T;
typedef enum {
G_SHORT_PREAMBLE = 0, /* Short Preamble */
G_LONG_PREAMBLE = 1, /* Long Preamble */
G_AUTO_PREAMBLE = 2, /* Auto Preamble Selection */
} G_PREAMBLE_T;
#define MAC_CONNECTED 1
#define MAC_DISCONNECTED 0
#define SCAN_DONE TRUE
typedef enum {
PASSIVE_SCAN = 0,
ACTIVE_SCAN = 1,
} SCANTYPE_T;
typedef enum {
NO_POWERSAVE = 0,
MIN_FAST_PS = 1,
MAX_FAST_PS = 2,
MIN_PSPOLL_PS = 3,
MAX_PSPOLL_PS = 4
} USER_PS_MODE_T;
typedef enum {
CHIP_WAKEDUP = 0,
CHIP_SLEEPING_AUTO = 1,
CHIP_SLEEPING_MANUAL = 2
} CHIP_PS_STATE_T;
typedef enum {
ACQUIRE_ONLY = 0,
ACQUIRE_AND_WAKEUP = 1,
} BUS_ACQUIRE_T;
typedef enum {
RELEASE_ONLY = 0,
RELEASE_ALLOW_SLEEP = 1,
} BUS_RELEASE_T;
typedef enum {
NO_SECURITY = 0,
WEP_40 = 0x3,
WEP_104 = 0x7,
WPA_AES = 0x29,
WPA_TKIP = 0x49,
WPA_AES_TKIP = 0x69, /* Aes or Tkip */
WPA2_AES = 0x31,
WPA2_TKIP = 0x51,
WPA2_AES_TKIP = 0x71, /* Aes or Tkip */
} SECURITY_T;
enum AUTHTYPE {
OPEN_SYSTEM = 1,
SHARED_KEY = 2,
ANY = 3,
IEEE8021 = 5
};
enum SITESURVEY {
SITE_SURVEY_1CH = 0,
SITE_SURVEY_ALL_CH = 1,
SITE_SURVEY_OFF = 2
};
typedef enum {
NORMAL_ACK = 0,
NO_ACK,
} ACK_POLICY_T;
typedef enum {
DONT_RESET = 0,
DO_RESET = 1,
NO_REQUEST = 2,
} RESET_REQ_T;
typedef enum {
REKEY_DISABLE = 1,
REKEY_TIME_BASE,
REKEY_PKT_BASE,
REKEY_TIME_PKT_BASE
} RSNA_REKEY_POLICY_T;
typedef enum {
FILTER_NO = 0x00,
FILTER_AP_ONLY = 0x01,
FILTER_STA_ONLY = 0x02
} SCAN_CLASS_FITLER_T;
typedef enum {
PRI_HIGH_RSSI = 0x00,
PRI_LOW_RSSI = 0x04,
PRI_DETECT = 0x08
} SCAN_PRI_T;
typedef enum {
CH_FILTER_OFF = 0x00,
CH_FILTER_ON =