From 871480933a1c28f8a9fed4c4d34d06c439a7a422 Mon Sep 17 00:00:00 2001 From: Srikant Patnaik Date: Sun, 11 Jan 2015 12:28:04 +0530 Subject: Moved, renamed, and deleted files The original directory structure was scattered and unorganized. Changes are basically to make it look like kernel structure. --- .../src/driver/include/CoreConfigSimulator.h | 20 + .../src/driver/include/CoreConfigurator.h | 492 ++++++++ .../src/driver/include/FIFO_Buffer.h | 23 + .../src/driver/include/NMI_host_AP.h | 422 +++++++ .../src/driver/include/host_interface.h | 1212 ++++++++++++++++++++ .../Nmc1000_Release7.2/src/driver/include/itypes.h | 59 + .../src/driver/include/linux_wlan_common.h | 134 +++ .../src/driver/include/nmi_type.h | 34 + .../src/driver/include/nmi_wlan.h | 347 ++++++ .../src/driver/include/nmi_wlan_cfg.h | 33 + .../src/driver/include/nmi_wlan_if.h | 950 +++++++++++++++ 11 files changed, 3726 insertions(+) create mode 100755 drivers/net/wireless/nmi/Nmc1000_Release7.2/src/driver/include/CoreConfigSimulator.h create mode 100755 drivers/net/wireless/nmi/Nmc1000_Release7.2/src/driver/include/CoreConfigurator.h create mode 100755 drivers/net/wireless/nmi/Nmc1000_Release7.2/src/driver/include/FIFO_Buffer.h create mode 100755 drivers/net/wireless/nmi/Nmc1000_Release7.2/src/driver/include/NMI_host_AP.h create mode 100755 drivers/net/wireless/nmi/Nmc1000_Release7.2/src/driver/include/host_interface.h create mode 100755 drivers/net/wireless/nmi/Nmc1000_Release7.2/src/driver/include/itypes.h create mode 100755 drivers/net/wireless/nmi/Nmc1000_Release7.2/src/driver/include/linux_wlan_common.h create mode 100755 drivers/net/wireless/nmi/Nmc1000_Release7.2/src/driver/include/nmi_type.h create mode 100755 drivers/net/wireless/nmi/Nmc1000_Release7.2/src/driver/include/nmi_wlan.h create mode 100755 drivers/net/wireless/nmi/Nmc1000_Release7.2/src/driver/include/nmi_wlan_cfg.h create mode 100755 drivers/net/wireless/nmi/Nmc1000_Release7.2/src/driver/include/nmi_wlan_if.h (limited to 'drivers/net/wireless/nmi/Nmc1000_Release7.2/src/driver/include') diff --git a/drivers/net/wireless/nmi/Nmc1000_Release7.2/src/driver/include/CoreConfigSimulator.h b/drivers/net/wireless/nmi/Nmc1000_Release7.2/src/driver/include/CoreConfigSimulator.h new file mode 100755 index 00000000..8df2ab35 --- /dev/null +++ b/drivers/net/wireless/nmi/Nmc1000_Release7.2/src/driver/include/CoreConfigSimulator.h @@ -0,0 +1,20 @@ + +/*! +* @file CoreConfigSimulator.h +* @brief +* @author +* @sa CoreConfigSimulator.c +* @date 1 Mar 2012 +* @version 1.0 +*/ + + +#ifndef CORECONFIGSIMULATOR_H +#define CORECONFIGSIMULATOR_H + + +extern NMI_Sint32 CoreConfigSimulatorInit(void); +extern NMI_Sint32 CoreConfigSimulatorDeInit(void); + + +#endif \ No newline at end of file diff --git a/drivers/net/wireless/nmi/Nmc1000_Release7.2/src/driver/include/CoreConfigurator.h b/drivers/net/wireless/nmi/Nmc1000_Release7.2/src/driver/include/CoreConfigurator.h new file mode 100755 index 00000000..3782e806 --- /dev/null +++ b/drivers/net/wireless/nmi/Nmc1000_Release7.2/src/driver/include/CoreConfigurator.h @@ -0,0 +1,492 @@ + +/*! +* @file CoreConfigurator.h +* @brief +* @author +* @sa CoreConfigurator.c +* @date 1 Mar 2012 +* @version 1.0 +*/ + + +#ifndef CORECONFIGURATOR_H +#define CORECONFIGURATOR_H + +#include "NMI_OsWrapper/include/NMI_OSWrapper.h" +#include "nmi_wlan_if.h" +/*****************************************************************************/ +/* Constants */ +/*****************************************************************************/ +/* Number of WID Options Supported */ +#define NUM_BASIC_SWITCHES 45 +#define NUM_FHSS_SWITCHES 0 + +#ifdef MAC_802_11N +#define NUM_11N_BASIC_SWITCHES 25 +#define NUM_11N_HUT_SWITCHES 47 +#else /* MAC_802_11N */ +#define NUM_11N_BASIC_SWITCHES 0 +#define NUM_11N_HUT_SWITCHES 0 +#endif /* MAC_802_11N */ + +extern NMI_Uint16 g_num_total_switches; + +#define MAC_HDR_LEN 24 /* No Address4 - non-ESS */ +#define MAX_SSID_LEN 33 +#define FCS_LEN 4 +#define TIME_STAMP_LEN 8 +#define BEACON_INTERVAL_LEN 2 +#define CAP_INFO_LEN 2 +#define STATUS_CODE_LEN 2 +#define AID_LEN 2 +#define IE_HDR_LEN 2 + + +/* Operating Mode: SET */ +#define SET_CFG 0 +/* Operating Mode: GET */ +#define GET_CFG 1 + +#define MAX_PACKET_BUFF_SIZE 1596 + +#define MAX_STRING_LEN 256 +#define MAX_SURVEY_RESULT_FRAG_SIZE MAX_STRING_LEN +#define SURVEY_RESULT_LENGTH 44 +#define MAX_ASSOC_RESP_FRAME_SIZE MAX_STRING_LEN + +#define STATUS_MSG_LEN 8 +#define MAC_CONNECTED 1 +#define MAC_DISCONNECTED 0 + + + +/*****************************************************************************/ +/* Function Macros */ +/*****************************************************************************/ +#define MAKE_WORD16(lsb, msb) (((NMI_Uint16)(msb) << 8) & 0xFF00) | (lsb) +#define MAKE_WORD32(lsw, msw) (((NMI_Uint32)(msw) << 16) & 0xFFFF0000) | (lsw) + + +/*****************************************************************************/ +/* Type Definitions */ +/*****************************************************************************/ +/* WID Data Types */ +#if 0 +typedef enum {WID_CHAR = 0, + WID_SHORT = 1, + WID_INT = 2, + WID_STR = 3, + WID_ADR = 4, + WID_BIN = 5, + WID_IP = 6, + WID_UNDEF = 7, + WID_TYPE_FORCE_32BIT = 0xFFFFFFFF +} tenuWIDtype; + +/* WLAN Identifiers */ +typedef enum {WID_NIL = -1, + + /* EMAC Character WID list */ + WID_BSS_TYPE = 0x0000, + WID_CURRENT_TX_RATE = 0x0001, + WID_CURRENT_CHANNEL = 0x0002, + WID_PREAMBLE = 0x0003, + WID_11G_OPERATING_MODE = 0x0004, + WID_STATUS = 0x0005, + WID_11G_PROT_MECH = 0x0006, + WID_SCAN_TYPE = 0x0007, + WID_PRIVACY_INVOKED = 0x0008, + WID_KEY_ID = 0x0009, + WID_QOS_ENABLE = 0x000A, + WID_POWER_MANAGEMENT = 0x000B, + WID_11I_MODE = 0x000C, + WID_AUTH_TYPE = 0x000D, + WID_SITE_SURVEY = 0x000E, + WID_LISTEN_INTERVAL = 0x000F, + WID_DTIM_PERIOD = 0x0010, + WID_ACK_POLICY = 0x0011, + WID_RESET = 0x0012, + WID_PCF_MODE = 0x0013, + WID_CFP_PERIOD = 0x0014, + WID_BCAST_SSID = 0x0015, + WID_PHY_TEST_PATTERN = 0x0016, + WID_DISCONNECT = 0x0016, + WID_READ_ADDR_SDRAM = 0x0017, + WID_TX_POWER_LEVEL_11A = 0x0018, + WID_REKEY_POLICY = 0x0019, + WID_SHORT_SLOT_ALLOWED = 0x001A, + WID_PHY_ACTIVE_REG = 0x001B, + WID_PHY_ACTIVE_REG_VAL = 0x001C, + WID_TX_POWER_LEVEL_11B = 0x001D, + WID_START_SCAN_REQ = 0x001E, + WID_RSSI = 0x001F, + WID_JOIN_REQ = 0x0020, + WID_ANTENNA_SELECTION = 0x0021, + WID_USER_CONTROL_ON_TX_POWER = 0x0027, + WID_MEMORY_ACCESS_8BIT = 0x0029, + WID_UAPSD_SUPPORT_AP = 0x002A, + WID_CURRENT_MAC_STATUS = 0x0031, + WID_AUTO_RX_SENSITIVITY = 0x0032, + WID_DATAFLOW_CONTROL = 0x0033, + WID_SCAN_FILTER = 0x0036, + WID_LINK_LOSS_THRESHOLD = 0x0037, + WID_AUTORATE_TYPE = 0x0038, + WID_CCA_THRESHOLD = 0x0039, + WID_802_11H_DFS_MODE = 0x003B, + WID_802_11H_TPC_MODE = 0x003C, + WID_DEVICE_READY = 0x003D, + WID_PM_NULL_FRAME_INTERVAL = 0x003E, + WID_PM_ACTIVITY_TIMER = 0x003F, + WID_PM_NULL_FRAME_WAIT_ENABLE = 0x0040, + WID_SCAN_WAIT_TIME = 0x0041, + WID_WSC_IE_EN = 0x0042, + WID_WPS_START = 0x0043, + WID_WPS_DEV_MODE = 0x0044, + WID_BT_COEXISTENCE = 0x0050, + WID_TRACKING_ROAMING = 0x0070, + WID_NUM_PKTS_FOR_RSSI_AVG = 0x0071, + WID_FHSS_SCAN_CHAN_INDEX = 0x0072, + WID_FHSS_SCAN_STEP_INDEX = 0x0073, + + /* NMAC Character WID list */ + WID_11N_PROT_MECH = 0x0080, + WID_11N_ERP_PROT_TYPE = 0x0081, + WID_11N_ENABLE = 0x0082, + WID_11N_OPERATING_MODE = 0x0083, + WID_11N_OBSS_NONHT_DETECTION = 0x0084, + WID_11N_HT_PROT_TYPE = 0x0085, + WID_11N_RIFS_PROT_ENABLE = 0x0086, + WID_11N_SMPS_MODE = 0x0087, + WID_11N_CURRENT_TX_MCS = 0x0088, + WID_11N_PRINT_STATS = 0x0089, + WID_HUT_FCS_CORRUPT_MODE = 0x008A, + WID_HUT_RESTART = 0x008B, + WID_HUT_TX_FORMAT = 0x008C, + WID_11N_SHORT_GI_20MHZ_ENABLE = 0x008D, + WID_HUT_BANDWIDTH = 0x008E, + WID_HUT_OP_BAND = 0x008F, + WID_HUT_STBC = 0x0090, + WID_HUT_ESS = 0x0091, + WID_HUT_ANTSET = 0x0092, + WID_HUT_HT_OP_MODE = 0x0093, + WID_HUT_RIFS_MODE = 0x0094, + WID_HUT_SMOOTHING_REC = 0x0095, + WID_HUT_SOUNDING_PKT = 0x0096, + WID_HUT_HT_CODING = 0x0097, + WID_HUT_TEST_DIR = 0x0098, + WID_HUT_CAPTURE_MODE = 0x0099, + WID_HUT_PHY_TEST_MODE = 0x009A, + WID_HUT_PHY_TEST_RATE_HI = 0x009B, + WID_HUT_PHY_TEST_RATE_LO = 0x009C, + WID_HUT_DISABLE_RXQ_REPLENISH = 0x009D, + WID_HUT_KEY_ORIGIN = 0x009E, + WID_HUT_BCST_PERCENT = 0x009F, + WID_HUT_GROUP_CIPHER_TYPE = 0x00A0, + WID_TX_ABORT_CONFIG = 0x00A1, + WID_HOST_DATA_IF_TYPE = 0x00A2, + WID_HOST_CONFIG_IF_TYPE = 0x00A3, + WID_HUT_TSF_TEST_MODE = 0x00A4, + WID_HUT_TSSI_VALUE = 0x00A5, + WID_HUT_PKT_TSSI_VALUE = 0x00A5, + WID_REG_TSSI_11B_VALUE = 0x00A6, + WID_REG_TSSI_11G_VALUE = 0x00A7, + WID_REG_TSSI_11N_VALUE = 0x00A8, + WID_TX_CALIBRATION = 0x00A9, + WID_DSCR_TSSI_11B_VALUE = 0x00AA, + WID_DSCR_TSSI_11G_VALUE = 0x00AB, + WID_DSCR_TSSI_11N_VALUE = 0x00AC, + WID_HUT_RSSI_EX = 0x00AD, + WID_HUT_ADJ_RSSI_EX = 0x00AE, + WID_11N_IMMEDIATE_BA_ENABLED = 0x00AF, + WID_11N_TXOP_PROT_DISABLE = 0x00B0, + WID_TX_POWER_LEVEL_11N = 0x00B1, + WID_HUT_MGMT_PERCENT = 0x00B3, + WID_HUT_MGMT_BCST_PERCENT = 0x00B4, + WID_HUT_MGMT_ALLOW_HT = 0x00B5, + WID_HUT_UC_MGMT_TYPE = 0x00B6, + WID_HUT_BC_MGMT_TYPE = 0x00B7, + WID_HUT_11W_MFP_REQUIRED_TX = 0x00B8, + WID_HUT_11W_MFP_PEER_CAPABLE = 0x00B9, + WID_HUT_11W_TX_IGTK_ID = 0x00BA, + WID_11W_ENABLE = 0x00BB, + WID_11W_MGMT_PROT_REQ = 0x00BC, + WID_USER_SEC_CHANNEL_OFFSET = 0x00C0, + WID_2040_COEXISTENCE = 0x00C1, + WID_HUT_FC_TXOP_MOD = 0x00C2, + WID_HUT_FC_PROT_TYPE = 0x00C3, + WID_HUT_SEC_CCA_ASSERT = 0x00C4, + WID_2040_ENABLE = 0x00C5, + WID_2040_CURR_CHANNEL_OFFSET = 0x00C6, + WID_2040_40MHZ_INTOLERANT = 0x00C7, + + + /* Custom Character WID list */ + WID_POWER_SAVE = 0x0100, + WID_WAKE_STATUS = 0x0101, + WID_WAKE_CONTROL = 0x0102, + WID_CCA_BUSY_START = 0x0103, + + /* EMAC Short WID list */ + WID_RTS_THRESHOLD = 0x1000, + WID_FRAG_THRESHOLD = 0x1001, + WID_SHORT_RETRY_LIMIT = 0x1002, + WID_LONG_RETRY_LIMIT = 0x1003, + WID_CFP_MAX_DUR = 0x1004, + WID_PHY_TEST_FRAME_LEN = 0x1005, + WID_BEACON_INTERVAL = 0x1006, + WID_MEMORY_ACCESS_16BIT = 0x1008, + WID_RX_SENSE = 0x100B, + WID_ACTIVE_SCAN_TIME = 0x100C, + WID_PASSIVE_SCAN_TIME = 0x100D, + WID_SITE_SURVEY_SCAN_TIME = 0x100E, + WID_JOIN_START_TIMEOUT = 0x100F, + WID_AUTH_TIMEOUT = 0x1010, + WID_ASOC_TIMEOUT = 0x1011, + WID_11I_PROTOCOL_TIMEOUT = 0x1012, + WID_EAPOL_RESPONSE_TIMEOUT = 0x1013, + WID_WPS_PASS_ID = 0x1017, + WID_WPS_CONFIG_METHOD = 0x1018, + WID_FHSS_INIT_SCAN_TIME = 0x1070, + WID_FHSS_ROAM_SCAN_TIME = 0x1071, + + /* NMAC Short WID list */ + WID_11N_RF_REG_VAL = 0x1080, + WID_HUT_FRAME_LEN = 0x1081, + WID_HUT_TXOP_LIMIT = 0x1082, + WID_HUT_SIG_QUAL_AVG = 0x1083, + WID_HUT_SIG_QUAL_AVG_CNT = 0x1084, + WID_11N_SIG_QUAL_VAL = 0x1085, + WID_HUT_RSSI_EX_COUNT = 0x1086, + WID_HUT_UC_MGMT_FRAME_LEN = 0x1088, + WID_HUT_BC_MGMT_FRAME_LEN = 0x1089, + + /* Custom Short WID list */ + + WID_CCA_BUSY_STATUS = 0x1100, + + /* EMAC Integer WID list */ + WID_FAILED_COUNT = 0x2000, + WID_RETRY_COUNT = 0x2001, + WID_MULTIPLE_RETRY_COUNT = 0x2002, + WID_FRAME_DUPLICATE_COUNT = 0x2003, + WID_ACK_FAILURE_COUNT = 0x2004, + WID_RECEIVED_FRAGMENT_COUNT = 0x2005, + WID_MCAST_RECEIVED_FRAME_COUNT = 0x2006, + WID_FCS_ERROR_COUNT = 0x2007, + WID_SUCCESS_FRAME_COUNT = 0x2008, + WID_PHY_TEST_PKT_CNT = 0x2009, + WID_HUT_TX_COUNT = 0x200A, + WID_TX_FRAGMENT_COUNT = 0x200B, + WID_TX_MULTICAST_FRAME_COUNT = 0x200C, + WID_RTS_SUCCESS_COUNT = 0x200D, + WID_RTS_FAILURE_COUNT = 0x200E, + WID_WEP_UNDECRYPTABLE_COUNT = 0x200F, + WID_REKEY_PERIOD = 0x2010, + WID_REKEY_PACKET_COUNT = 0x2011, + WID_1X_SERV_ADDR = 0x2012, + WID_STACK_IP_ADDR = 0x2013, + WID_STACK_NETMASK_ADDR = 0x2014, + WID_HW_RX_COUNT = 0x2015, + WID_MEMORY_ADDRESS = 0x201E, + WID_MEMORY_ACCESS_32BIT = 0x201F, + WID_RF_REG_VAL = 0x2021, + WID_FIRMWARE_INFO = 0x2023, + WID_DEV_OS_VERSION = 0x2025, + WID_ROAM_RSSI_THESHOLDS = 0x2070, + WID_TRACK_INTERVAL_SEC = 0x2071, + WID_FHSS_HOPPING_PARAMS = 0x2072, + WID_FHSS_HOP_DWELL_TIME = 0x2073, + + /* NMAC Integer WID list */ + WID_11N_PHY_ACTIVE_REG_VAL = 0x2080, + WID_HUT_NUM_TX_PKTS = 0x2081, + WID_HUT_TX_TIME_TAKEN = 0x2082, + WID_HUT_TX_TEST_TIME = 0x2083, + WID_HUT_LOG_INTERVAL = 0x2084, + + /* EMAC String WID list */ + WID_SSID = 0x3000, + WID_FIRMWARE_VERSION = 0x3001, + WID_OPERATIONAL_RATE_SET = 0x3002, + WID_BSSID = 0x3003, +#if 0 + WID_WEP_KEY_VALUE0 = 0x3004, +#endif + WID_11I_PSK = 0x3008, + WID_11E_P_ACTION_REQ = 0x3009, + WID_1X_KEY = 0x300A, + WID_HARDWARE_VERSION = 0x300B, + WID_MAC_ADDR = 0x300C, + WID_HUT_DEST_ADDR = 0x300D, + /*WID_HUT_STATS = 0x300E,*/ + WID_PHY_VERSION = 0x300F, + WID_SUPP_USERNAME = 0x3010, + WID_SUPP_PASSWORD = 0x3011, + WID_SITE_SURVEY_RESULTS = 0x3012, + WID_RX_POWER_LEVEL = 0x3013, + WID_MANUFACTURER = 0x3026, /*Added for CAPI tool */ + WID_MODEL_NAME = 0x3027, /*Added for CAPI tool */ + WID_MODEL_NUM = 0x3028, /*Added for CAPI tool */ + WID_DEVICE_NAME = 0x3029, /*Added for CAPI tool */ + + WID_ASSOC_RES_INFO = 0x3020, + + /* NMAC String WID list */ + WID_11N_P_ACTION_REQ = 0x3080, + WID_HUT_TEST_ID = 0x3081, + WID_PMKID_INFO = 0x3082, + + /* Custom String WID list */ + WID_FLASH_DATA = 0x3100, + WID_EEPROM_DATA = 0x3101, + WID_SERIAL_NUMBER = 0x3102, + + /* EMAC Binary WID list */ + WID_UAPSD_CONFIG = 0x4001, + WID_UAPSD_STATUS = 0x4002, + WID_AC_PARAMS_AP = 0x4003, + WID_AC_PARAMS_STA = 0x4004, + WID_NEWORK_INFO = 0x4005, + WID_WPS_CRED_LIST = 0x4006, + WID_PRIM_DEV_TYPE = 0x4007, + WID_STA_JOIN_INFO = 0x4008, + WID_CONNECTED_STA_LIST = 0x4009, + + /* NMAC Binary WID list */ + WID_11N_AUTORATE_TABLE = 0x4080, + WID_HUT_TX_PATTERN = 0x4081, + WID_HUT_STATS = 0x4082, + WID_HUT_LOG_STATS = 0x4083, + + /*BugID_3746 WID to add IE to be added in next probe request*/ + WID_INFO_ELEMENT_PROBE = 0x4085, + /*BugID_3746 WID to add IE to be added in next associate request*/ + WID_INFO_ELEMENT_ASSOCIATE = 0x4086, + + /* Miscellaneous WIDs */ + WID_ALL = 0x7FFE, + WID_MAX = 0xFFFF +} tenuWIDid; +#endif + +/* Status Codes for Authentication and Association Frames */ +typedef enum +{ + SUCCESSFUL_STATUSCODE = 0, + UNSPEC_FAIL = 1, + UNSUP_CAP = 10, + REASOC_NO_ASOC = 11, + FAIL_OTHER = 12, + UNSUPT_ALG = 13, + AUTH_SEQ_FAIL = 14, + CHLNG_FAIL = 15, + AUTH_TIMEOUT = 16, + AP_FULL = 17, + UNSUP_RATE = 18, + SHORT_PREAMBLE_UNSUP = 19, + PBCC_UNSUP = 20, + CHANNEL_AGIL_UNSUP = 21, + SHORT_SLOT_UNSUP = 25, + OFDM_DSSS_UNSUP = 26, + CONNECT_STS_FORCE_16_BIT = 0xFFFF +} tenuConnectSts; + +typedef struct +{ + NMI_Uint16 u16WIDid; + tenuWIDtype enuWIDtype; + NMI_Sint32 s32ValueSize; + NMI_Sint8 *ps8WidVal; + +}tstrWID; +/* This structure is used to support parsing of the received 'N' message */ +typedef struct +{ + NMI_Sint8 s8rssi; + NMI_Uint16 u16CapInfo; + NMI_Uint8 au8ssid[MAX_SSID_LEN]; + NMI_Uint8 u8SsidLen; + NMI_Uint8 au8bssid[6]; + NMI_Uint16 u16BeaconPeriod; + NMI_Uint8 u8DtimPeriod; + NMI_Uint8 u8channel; + unsigned long u32TimeRcvdInScanCached; /* of type unsigned long to be accepted by the linux kernel macro time_after() */ + unsigned long u32TimeRcvdInScan; + NMI_Bool bNewNetwork; +#ifdef AGING_ALG + NMI_Uint8 u8Found; +#endif + NMI_Uint8 *pu8IEs; + NMI_Uint16 u16IEsLen; + void* pJoinParams; +}tstrNetworkInfo; + +/* This structure is used to support parsing of the received Association Response frame */ +typedef struct +{ + NMI_Uint16 u16capability; + NMI_Uint16 u16ConnectStatus; + NMI_Uint16 u16AssocID; + NMI_Uint8 *pu8RespIEs; + NMI_Uint16 u16RespIEsLen; +}tstrConnectRespInfo; + + +typedef struct +{ + NMI_Uint8 au8bssid[6]; + NMI_Uint8* pu8ReqIEs; + size_t ReqIEsLen; + NMI_Uint8 *pu8RespIEs; + NMI_Uint16 u16RespIEsLen; + NMI_Uint16 u16ConnectStatus; +}tstrConnectInfo; + + + +typedef struct +{ + NMI_Uint16 u16reason; + NMI_Uint8 * ie; + size_t ie_len; +}tstrDisconnectNotifInfo; + +#ifndef CONNECT_DIRECT +typedef struct wid_site_survey_reslts +{ + NMI_Char SSID[MAX_SSID_LEN]; + NMI_Uint8 BssType; + NMI_Uint8 Channel; + NMI_Uint8 SecurityStatus; + NMI_Uint8 BSSID[6]; + NMI_Char RxPower; + NMI_Uint8 Reserved; + +}wid_site_survey_reslts_s; +#endif + +extern NMI_Sint32 CoreConfiguratorInit(void); +extern NMI_Sint32 CoreConfiguratorDeInit(void); + +extern NMI_Sint32 SendConfigPkt(NMI_Uint8 u8Mode, tstrWID* pstrWIDs, + NMI_Uint32 u32WIDsCount,NMI_Bool bRespRequired); +extern NMI_Sint32 ParseNetworkInfo(NMI_Uint8* pu8MsgBuffer, tstrNetworkInfo** ppstrNetworkInfo); +extern NMI_Sint32 DeallocateNetworkInfo(tstrNetworkInfo* pstrNetworkInfo); + +extern NMI_Sint32 ParseAssocRespInfo(NMI_Uint8* pu8Buffer, NMI_Uint32 u32BufferLen, + tstrConnectRespInfo** ppstrConnectRespInfo); +extern NMI_Sint32 DeallocateAssocRespInfo(tstrConnectRespInfo* pstrConnectRespInfo); + +#ifndef CONNECT_DIRECT +extern NMI_Sint32 ParseSurveyResults(NMI_Uint8 ppu8RcvdSiteSurveyResults[][MAX_SURVEY_RESULT_FRAG_SIZE], + wid_site_survey_reslts_s** ppstrSurveyResults, + NMI_Uint32* pu32SurveyResultsCount); +extern NMI_Sint32 DeallocateSurveyResults(wid_site_survey_reslts_s* pstrSurveyResults); +#endif + +extern NMI_Sint32 SendRawPacket(NMI_Sint8* pspacket, NMI_Sint32 s32PacketLen); +extern void NetworkInfoReceived(NMI_Uint8* pu8Buffer,NMI_Uint32 u32Length); +void GnrlAsyncInfoReceived(NMI_Uint8* pu8Buffer, NMI_Uint32 u32Length); +void host_int_ScanCompleteReceived(NMI_Uint8 * pu8Buffer, NMI_Uint32 u32Length); + +#endif diff --git a/drivers/net/wireless/nmi/Nmc1000_Release7.2/src/driver/include/FIFO_Buffer.h b/drivers/net/wireless/nmi/Nmc1000_Release7.2/src/driver/include/FIFO_Buffer.h new file mode 100755 index 00000000..086ca1ac --- /dev/null +++ b/drivers/net/wireless/nmi/Nmc1000_Release7.2/src/driver/include/FIFO_Buffer.h @@ -0,0 +1,23 @@ + +#include "NMI_OsWrapper/include/NMI_OSWrapper.h" + + +#define tHANDLE void * + +typedef struct +{ + NMI_Uint8 *pu8Buffer; + NMI_Uint32 u32BufferLength; + NMI_Uint32 u32WriteOffset; + NMI_Uint32 u32ReadOffset; + NMI_Uint32 u32TotalBytes; + NMI_SemaphoreHandle SemBuffer; +}tstrFifoHandler; + + +extern NMI_Uint32 FIFO_InitBuffer(tHANDLE * hBuffer,NMI_Uint32 u32BufferLength); +extern NMI_Uint32 FIFO_DeInit(tHANDLE hFifo); +extern NMI_Uint32 FIFO_ReadBytes(tHANDLE hFifo,NMI_Uint8 *pu8Buffer,NMI_Uint32 u32BytesToRead, + NMI_Uint32 *pu32BytesRead); +extern NMI_Uint32 FIFO_WriteBytes(tHANDLE hFifo,NMI_Uint8 *pu8Buffer,NMI_Uint32 u32BytesToWrite, + NMI_Bool bForceOverWrite); \ No newline at end of file diff --git a/drivers/net/wireless/nmi/Nmc1000_Release7.2/src/driver/include/NMI_host_AP.h b/drivers/net/wireless/nmi/Nmc1000_Release7.2/src/driver/include/NMI_host_AP.h new file mode 100755 index 00000000..9b5c839d --- /dev/null +++ b/drivers/net/wireless/nmi/Nmc1000_Release7.2/src/driver/include/NMI_host_AP.h @@ -0,0 +1,422 @@ +#ifndef __NMI_HOST_AP__ +#define __NMI_HOST_AP__ + +#include "nmi_wlan_if.h" +#include "nmi_wlan.h" +#include "host_interface.h" +#include "../linux/include/NMI_WFI_NetDevice.h" + +#ifdef NMI_FULLY_HOSTING_AP +/*! +* @file NMI_host_AP.h +* @brief code related to AP fully hosting mode on NMI driver +* @author Abd Al-Rahman Diab +* @date 09 APRIL 2013 +* @version 1.0 +*/ + + +#define ITIM 5 /* Traffic Information Map */ +#define DEFAULT_TIM_LEN 4 +#define FCS_LEN 4 +#define VBMAP_SIZE 256 + +#define MAX_LISTEN_INT 10 +#define VBMAP_SIZE 256 +#define MIN_TIM_LEN 4 +#define PS_PKT_Q_MAX_LEN 16 +#define PS_BUFF_TO 500 /* Time out for discarding a packets in */ + /* PS queues in millisecs */ +#define AGING_THR_IN_SEC 60 /* 60 Seconds */ + +#define WORD_OFFSET_4 4 +#define TX_DSCR_NEXT_ADDR_WORD_OFFSET WORD_OFFSET_4 + + +#define WIFI_PERIPH_BASE 0x00000000 +#define WIFI_PA_BASE (WIFI_PERIPH_BASE+0x9800) +#define PA_BASE WIFI_PA_BASE + +#define rMAC_DTIM_COUNT_ADDR (( NMI_Uint32 )(PA_BASE + 0x021C)) +#define rMAC_BEACON_PERIOD (( NMI_Uint32 )(PA_BASE + 0x020C)) +#define rMAC_DTIM_PERIOD (( NMI_Uint32 )(PA_BASE + 0x0210)) +#define rMAC_TSF_CON (( NMI_Uint32 )(PA_BASE + 0x0200)) + + +#define BEST_EFFORT_PRIORITY 0 + +#define NORMAL_ACK 0 +#define BCAST_NO_ACK 4 + + +#define PROTOCOL_VERSION 0x00 +#define MAX_MSDU_LEN 1596 +#define PS_POLL_LEN 20 + + +#define QOS_CTRL_FIELD_LEN 2 +#define HT_CTRL_FIELD_LEN 4 /* Length of HT Control Field */ + +#define IS_MANAGMEMENT 0x100 +#define IS_MANAGMEMENT_CALLBACK 0x080 +#define IS_MGMT_STATUS_SUCCES 0x040 +#define GET_PKT_OFFSET(a) (((a) >> 22) & 0x1ff) + + +/* Maximum number of hash values possible for the Sta Entry Table */ +#define MAX_HASH_VALUES 16 + + +#define SNAP_HDR_ID_LEN 6 + +#define ETH_PKT_TYPE_OFFSET 12 +#define IP_TYPE 0x0800 +#define ARP_TYPE 0x0806 +#define ONE_X_TYPE 0x888E +#define VLAN_TYPE 0x8100 +#define LLTD_TYPE 0x88D9 +#define UDP_TYPE 0x11 +#define TCP_TYPE 0x06 + + +/*****************************************************************************/ +/* Function Macros */ +/*****************************************************************************/ + +#define NEXT_ELEMENT_ADDR(base, ofst) (*((NMI_Uint32 *)((NMI_Uint8 *)base + ofst))) + + + +/*****************************************************************************/ +/* Enums */ +/*****************************************************************************/ + +/* Basic Frame Type Codes (2-bit) */ +typedef enum {CONTROL = 0x04, + DATA_BASICTYPE = 0x08, + MANAGEMENT = 0x00, + RESERVED = 0x0C +} BASICTYPE_T; + +typedef enum {ACTIVE_PS = 0, + POWER_SAVE = 1 +} STA_PS_STATE_T; + + +typedef enum {AID0_BIT = 0, + DTIM_BIT = 1 +} TIMBIT_T; + + +typedef enum {RE_Q_ERROR = 0, + NO_PKT_IN_QUEUE = 1, + PKT_REQUEUED = 2, + END_OF_QUEUE = 3, + PKT_NOT_REQUEUED = 4 +} REQUEUE_STATUS_T; + + +/* Data Pathes */ +typedef enum {HOST_TO_WLAN = 0, + WLAN_TO_WLAN = 1, + MONITOR_TO_WLAN = 2 +} Data_Interface; + +/* Capability Information field bit assignments */ +typedef enum{ESS = 0x01, /* ESS capability */ + IBSS = 0x02, /* IBSS mode */ + POLLABLE = 0x04, /* CF Pollable */ + POLLREQ = 0x08, /* Request to be polled */ + PRIVACY = 0x10, /* WEP encryption supported */ + SHORTPREAMBLE = 0x20, /* Short Preamble is supported */ + SHORTSLOT = 0x400, /* Short Slot is supported */ + PBCC = 0x40, /* PBCC */ + CHANNELAGILITY = 0x80, /* Channel Agility */ + SPECTRUM_MGMT = 0x100, /* Spectrum Management */ + DSSS_OFDM = 0x2000 /* DSSS-OFDM */ +} CAPABILITY_T; + +/* Authentication/Association states of STAs maintained by the Access Point */ +typedef enum {AUTH_COMPLETE = 1, /* Authenticated */ + AUTH_KEY_SEQ1 = 2, /* Shared Key Auth (Sequence 1) done */ + ASOC = 3 /* Associated */ +} STATIONSTATE_T; + +typedef enum {TYPE_OFFSET = 0, + LENGTH_OFFSET = 1, + DTIM_CNT_OFFSET = 2, + DTIM_PERIOD_OFFSET = 3, + BMAP_CTRL_OFFSET = 4, + TIM_OFFSET = 5 +} OFFSET_T; + +/* Frame Type and Subtype Codes (6-bit) */ +typedef enum {ASSOC_REQ = 0x00, + ASSOC_RSP = 0x10, + REASSOC_REQ = 0x20, + REASSOC_RSP = 0x30, + PROBE_REQ = 0x40, + PROBE_RSP = 0x50, + BEACON = 0x80, + ATIM = 0x90, + DISASOC = 0xA0, + AUTH = 0xB0, + DEAUTH = 0xC0, + ACTION = 0xD0, + PS_POLL = 0xA4, + RTS = 0xB4, + CTS = 0xC4, + ACK = 0xD4, + CFEND = 0xE4, + CFEND_ACK = 0xF4, + DATA = 0x08, + DATA_ACK = 0x18, + DATA_POLL = 0x28, + DATA_POLL_ACK = 0x38, + NULL_FRAME = 0x48, + CFACK = 0x58, + CFPOLL = 0x68, + CFPOLL_ACK = 0x78, + QOS_DATA = 0x88, + QOS_DATA_ACK = 0x98, + QOS_DATA_POLL = 0xA8, + QOS_DATA_POLL_ACK = 0xB8, + QOS_NULL_FRAME = 0xC8, + QOS_CFPOLL = 0xE8, + QOS_CFPOLL_ACK = 0xF8, + BLOCKACK_REQ = 0x84, + BLOCKACK = 0x94 +} TYPESUBTYPE_T; + + +/*****************************************************************************/ +/* Structures */ +/*****************************************************************************/ + +typedef struct _q_entry_t +{ + void *fa; /* Pointer to the element in the queue */ + struct _q_entry_t *tqe_next; /* Pointer to the next element */ + struct _q_entry_t *tqe_prev; /* Pointer to the previous element */ +} q_entry_t; + +typedef struct +{ + q_entry_t *head; + q_entry_t *tail; +} q_head_t; + +typedef struct +{ + void *head; /* Head Element of the List */ + void *tail; /* Tail Element of the List */ + NMI_Uint16 count; /* Number of Elements in the List */ + NMI_Uint16 lnk_byte_ofst; /* Offset to Link Pointer in the List in Bytes */ +} list_buff_t; + + +/* Basic rate set. This contains the set of basic rates supported by any */ +/* IBSS. */ +typedef struct +{ + NMI_Uint8 rates[MAX_RATES_SUPPORTED]; + NMI_Uint8 num_rates; +} rate_t; + +typedef struct { + int size; + void* buff; +}beacon_data; + +typedef struct { + NMI_Uint16 u16beacon_len; + NMI_Uint8 *u8beacon_frame; + NMI_Uint8 u8tim_element_index; + NMI_Uint16 u16tim_element_trailer_len; + NMI_Uint8 u8vbmap[VBMAP_SIZE]; + NMI_Uint8 u8DTIMPeriod; + NMI_Uint16 u16Beacon_Period; +}beacon_info; + +typedef struct +{ + NMI_Uint8 service_class; /* Service class extracted from header */ + NMI_Uint8 priority_val; /* Priority value extracted from header */ + NMI_Uint8 u8hdr_len; /* Length of header including offset */ + NMI_Uint16 u16data_len; /* Length of the frame excluding headers */ + NMI_Uint16 u16rx_len; /* Length of the frame including the headers */ + NMI_Uint8 *u8sa_entry; /* Source Address station entry */ + NMI_Uint8 *u8msa; /* MAC header start address */ + NMI_Uint8 u8addr1[6]; /* Address1 field extracted from header */ + NMI_Uint8 u8addr2[6]; /* Address2 field extracted from header */ + NMI_Uint8 u8addr3[6]; /* Address3 field extracted from header */ + NMI_Uint8 *u8sa; /* Pointer to source address */ + NMI_Uint8 *u8da; /* Pointer to destination address */ + NMI_Uint8 *u8bssid; /* Pointer to BSSID */ + NMI_Uint8 *u8ta; /* Pointer to Transmitter address */ + BASICTYPE_T enumType; /* Packet type extracted from the header */ + NMI_Uint8 u8Sub_type; /* Packet Sub type extracted from the header */ + NMI_Uint8 u8frm_ds; /* From DS field of MAC header */ + NMI_Uint8 u8to_ds; /* To DS field of MAC header */ + NMI_Bool bIs_grp_addr; /* Group address flag */ +} wlan_rx_t; + +typedef struct { + int quit; + + /** + input interface functions + **/ + nmi_wlan_os_func_t os_func; + nmi_wlan_io_func_t io_func; + nmi_wlan_net_func_t net_func; + nmi_wlan_indicate_func_t indicate_func; + + /** + host interface functions + **/ + nmi_hif_func_t hif_func; + void *hif_lock; + + /** + configuration interface functions + **/ + nmi_cfg_func_t cif_func; + int cfg_frame_in_use; + nmi_cfg_frame_t cfg_frame; + uint32_t cfg_frame_offset; + int cfg_seq_no; + void *cfg_wait; + + /** + RX buffer + **/ + uint32_t rx_buffer_size; + //uint8_t *rx_buffer; + //uint32_t rx_buffer_offset; + + /** + TX buffer + **/ + uint32_t tx_buffer_size; + uint8_t *tx_buffer; + uint32_t tx_buffer_offset; + + /** + TX queue + **/ + void *txq_lock; + + /*Added by Amr - BugID_4720*/ + void *txq_add_to_head_lock; + void *txq_spinlock; + unsigned long txq_spinlock_flags; + + struct txq_entry_t *txq_head; + struct txq_entry_t *txq_tail; + int txq_entries; + void *txq_wait; + int txq_exit; + + /** + RX queue + **/ + void *rxq_lock; + struct rxq_entry_t *rxq_head; + struct rxq_entry_t *rxq_tail; + int rxq_entries; + void *rxq_wait; + int rxq_exit; + +#if DMA_VER == DMA_VER_2 + int use_dma_v2; +#endif +} nmi_wlan_dev_t; + + +typedef struct { + u32 supp_rates[IEEE80211_NUM_BANDS]; + NMI_Uint8 addr[ETH_ALEN]; /* MAC address of the STA */ + NMI_Uint16 u16AID; /* Association ID of the STA */ + STATIONSTATE_T state; /* Auth/Asoc state of the STA */ + struct ieee80211_sta_ht_cap ht_cap; + //struct ieee80211_sta_vht_cap vht_cap; + NMI_Uint32 aging_cnt; /* Aging cnt for STA */ + rate_t op_rates; /* Operational rates of the STA */ + STA_PS_STATE_T ps_state; /* Power save state of the STA */ + + list_buff_t ps_q_lgcy; /* Power save queue for the STA */ + NMI_Uint16 num_ps_pkt; /* Number of UC pkts queued in PSQ */ + NMI_Uint16 num_qd_pkt; /* Number of UC pkts queued in HW */ + NMI_Bool ps_poll_rsp_qed; /* Flag to indicate PS poll rsp is */ + /* already queued and pending */ + +} NMI_ieee80211_sta; + +#if 0 +/* Association element structure. This is the element structure to which the */ +/* element pointers of the association table entries point. */ +typedef struct +{ + + + + + NMI_Uint16 listen_interval; /* Listen Interval of the STA */ + + + +} asoc_entry_t; +#endif + +typedef struct table_elmnt_t +{ + NMI_Uint8 key[6]; /* Key, i.e. the MAC address */ + void* element; /* Pointer to the table element */ + struct table_elmnt_t* next_hash_elmnt; /* Pointer to next bucket element */ +} table_elmnt_t; + +/*****************************************************************************/ +/* Data Types */ +/*****************************************************************************/ + +typedef table_elmnt_t* table_t[MAX_HASH_VALUES]; + +/*****************************************************************************/ +/* Extern Variable Declarations */ +/*****************************************************************************/ + +extern table_t g_sta_table; +extern linux_wlan_t* g_linux_wlan; + + + NMI_Sint32 host_add_beacon(NMI_WFIDrvHandle hWFIDrv, NMI_Uint32 u32Interval, + NMI_Uint32 u32DTIMPeriod, + NMI_Uint32 u32HeadLen, NMI_Uint8* pu8Head, + NMI_Uint32 u32TailLen, NMI_Uint8* pu8Tail); + + NMI_Sint32 host_del_beacon(NMI_WFIDrvHandle hWFIDrv); + +inline void NMI_AP_AddSta(u8 *mac, struct station_parameters *params); +inline void NMI_AP_EditSta(u8 *mac, struct station_parameters *params); +inline void NMI_AP_RemoveSta(u8 *mac); + + void process_tbtt_isr(void); + + nmi_wlan_dev_t* Get_wlan_context(NMI_Uint16* pu16size); + + #ifdef NMI_AP_EXTERNAL_MLME +int nmi_wlan_txq_add_mgmt_pkt(void *priv, uint8_t *buffer, uint32_t buffer_size, nmi_tx_complete_func_t func); +#endif + +int nmi_FH_wlan_txq_add_net_pkt(void *priv, uint8_t *buffer, uint32_t buffer_size, nmi_tx_complete_func_t func); + +void NMI_Process_rx_frame(NMI_Uint8 *u8Buff, NMI_Uint32 u32Size); + +int NMI_Xmit_data(void* ptx_data, Data_Interface InterfaceType); + +NMI_Bool filter_monitor_data_frames(NMI_Uint8 *buf, NMI_Uint16 len); + +#endif // NMI_FULLY_HOSTING_AP + +#endif diff --git a/drivers/net/wireless/nmi/Nmc1000_Release7.2/src/driver/include/host_interface.h b/drivers/net/wireless/nmi/Nmc1000_Release7.2/src/driver/include/host_interface.h new file mode 100755 index 00000000..81964337 --- /dev/null +++ b/drivers/net/wireless/nmi/Nmc1000_Release7.2/src/driver/include/host_interface.h @@ -0,0 +1,1212 @@ +/*! +* @file host_interface.h +* @brief File containg host interface APIs +* @author zsalah +* @sa host_interface.c +* @date 8 March 2012 +* @version 1.0 +*/ + +#ifndef HOST_INT_H +#define HOST_INT_H + +#include "CoreConfigurator.h" +#include "CoreConfigSimulator.h" +/*****************************************************************************/ +/* Macros */ +/*****************************************************************************/ +#if 0 +#define WID_BSS_TYPE 0x0000 +#define WID_CURRENT_TX_RATE 0x0001 +#define WID_CURRENT_CHANNEL 0x0002 +#define WID_PREAMBLE 0x0003 +#define WID_STATUS 0x0005 +#define WID_SCAN_TYPE 0x0007 +#define WID_KEY_ID 0x0009 +#define WID_DTIM_PERIOD 0x0010 +#define WID_POWER_MANAGEMENT 0x000B +#define WID_AUTH_TYPE 0x000D +#define WID_SITE_SURVEY 0x000E +#define WID_DTIM_PERIOD 0x0010 +#define WID_DISCONNECT 0x0016 +#define WID_SHORT_SLOT_ALLOWED 0x001A +#define WID_START_SCAN_REQ 0x001E +#define WID_RSSI 0x001F +#define WID_JOIN_REQ 0x0020 +#define WID_11N_TXOP_PROT_DISABLE 0x00B0 +#define WID_RTS_THRESHOLD 0x1000 +#define WID_FRAG_THRESHOLD 0x1001 +#define WID_SHORT_RETRY_LIMIT 0x1002 +#define WID_LONG_RETRY_LIMIT 0x1003 +#define WID_BEACON_INTERVAL 0x1006 +#define WID_ACTIVE_SCAN_TIME 0x100C +#define WID_PASSIVE_SCAN_TIME 0x100D +#define WID_SITE_SURVEY_SCAN_TIME 0x100E +#define WID_AUTH_TIMEOUT 0x1010 +#define WID_11I_PSK 0x3008 +#define WID_SITE_SURVEY_RESULTS 0x3012 +#define WID_ADD_PTK 0x301B +#define WID_ADD_RX_GTK 0x301C +#define WID_ADD_TX_GTK 0x301D +#define WID_ADD_WEP_KEY 0x3019 +#define WID_REMOVE_WEP_KEY 0x301A +#define WID_REMOVE_KEY 0x301E +#define WID_ASSOC_REQ_INFO 0x301F +#define WID_ASSOC_RES_INFO 0x3020 +#define WID_PMKID_INFO 0x3082 +#define WID_SCAN_CHANNEL_LIST 0x4084 +#define WID_11I_MODE 0x000C +#endif +#define FAIL 0x0000 +#define SUCCESS 0x0001 + +#define BIT2 ((NMI_Uint32)(1 << 2)) +#define BIT1 ((NMI_Uint32)(1 << 1)) +#define BIT0 ((NMI_Uint32)(1 << 0)) + +#define AP_MODE 0x01 +#define STATION_MODE 0x02 + + +#define MAX_NUM_STA 8 +#define ACTIVE_SCAN_TIME 10 +#define PASSIVE_SCAN_TIME 1200 +#define MIN_SCAN_TIME 10 +#define MAX_SCAN_TIME 1200 +#define DEFAULT_SCAN 0 +#define USER_SCAN BIT0 +#define OBSS_PERIODIC_SCAN BIT1 +#define OBSS_ONETIME_SCAN BIT2 +#define GTK_RX_KEY_BUFF_LEN 24 +#define ADDKEY 0x1 +#define REMOVEKEY 0x2 +#define DEFAULTKEY 0x4 +#define ADDKEY_AP 0x8 +#define MAX_NUM_SCANNED_NETWORKS 100 //30 // rachel +#define MAX_NUM_SCANNED_NETWORKS_SHADOW 130 +#define MAX_NUM_PROBED_SSID 10 /*One more than the number of scanned ssids*/ +#define CHANNEL_SCAN_TIME 250//250 + +#define TX_MIC_KEY_LEN 8 +#define RX_MIC_KEY_LEN 8 +#define PTK_KEY_LEN 16 + +#define TX_MIC_KEY_MSG_LEN 26 +#define RX_MIC_KEY_MSG_LEN 48 +#define PTK_KEY_MSG_LEN 39 + +#define PMKSA_KEY_LEN 22 +#define ETH_ALEN 6 +#define PMKID_LEN 16 +#define NMI_MAX_NUM_PMKIDS 16 +#define NMI_SUPP_MCS_SET_SIZE 16 +#define NMI_ADD_STA_LENGTH 40 /* Not including the rates field cause it has variable length*/ +#define SCAN_EVENT_DONE_ABORTED +/*****************************************************************************/ +/* Data Types */ +/*****************************************************************************/ +//typedef unsigned char uint8; +//typedef signed char int8; +//typedef unsigned short uint16; +//typedef unsigned long uint32; +//typedef uint32 Bool; + +#if 0 +typedef enum {WID_CHAR = 0, + WID_SHORT = 1, + WID_INT = 2, + WID_STR = 3, + WID_ADR = 4, + WID_BIN = 5, + WID_IP = 6, + WID_UNDEF = 7 +} WID_TYPE_T; +#endif +typedef struct +{ + NMI_Uint16 cfg_wid; + WID_TYPE_T cfg_type; + NMI_Sint8 *pu8Para; +} cfg_param_t; + +typedef struct _tstrStatistics +{ + NMI_Uint8 u8LinkSpeed; + NMI_Sint8 s8RSSI; + NMI_Uint32 u32TxCount; + NMI_Uint32 u32RxCount; + NMI_Uint32 u32TxFailureCount; + +}tstrStatistics; + + +typedef enum +{ + HOST_IF_IDLE = 0, + HOST_IF_SCANNING = 1, + HOST_IF_WAITING_CONN_REQ = 2, + HOST_IF_WAITING_CONN_RESP = 3, + HOST_IF_CONNECTED = 4, + HOST_IF_P2P_LISTEN =5, + HOST_IF_FORCE_32BIT = 0xFFFFFFFF +}tenuHostIFstate; + +typedef struct _tstrHostIFpmkid +{ + NMI_Uint8 bssid[ETH_ALEN]; + NMI_Uint8 pmkid[PMKID_LEN]; +}tstrHostIFpmkid; + +typedef struct _tstrHostIFpmkidAttr +{ + NMI_Uint8 numpmkid; + tstrHostIFpmkid pmkidlist[NMI_MAX_NUM_PMKIDS]; +}tstrHostIFpmkidAttr; +#if 0 +/* Scan type parameter for scan request */ +typedef enum +{ + PASSIVE_SCAN = 0, + ACTIVE_SCAN = 1, + NUM_SCANTYPE +} tenuScanType; + +typedef enum {SITE_SURVEY_1CH = 0, + SITE_SURVEY_ALL_CH = 1, + SITE_SURVEY_OFF = 2 +} SITE_SURVEY_T; +#endif +typedef enum{AUTORATE = 0, + MBPS_1 = 1, + MBPS_2 = 2, + MBPS_5_5 = 5, + MBPS_11 = 11, + MBPS_6 = 6, + MBPS_9 = 9, + MBPS_12 = 12, + MBPS_18 = 18, + MBPS_24 = 24, + MBPS_36 = 36, + MBPS_48 = 48, + MBPS_54 = 54 + +}CURRENT_TX_RATE_T; + +typedef struct +{ + NMI_Uint32 u32SetCfgFlag; + NMI_Uint8 ht_enable; + NMI_Uint8 bss_type; + NMI_Uint8 auth_type; + NMI_Uint16 auth_timeout; + NMI_Uint8 power_mgmt_mode; + NMI_Uint16 short_retry_limit; + NMI_Uint16 long_retry_limit; + NMI_Uint16 frag_threshold; + NMI_Uint16 rts_threshold; + NMI_Uint16 preamble_type; + NMI_Uint8 short_slot_allowed; + NMI_Uint8 txop_prot_disabled; + NMI_Uint16 beacon_interval; + NMI_Uint16 dtim_period; + SITE_SURVEY_T site_survey_enabled; + NMI_Uint16 site_survey_scan_time; + NMI_Uint8 scan_source; + NMI_Uint16 active_scan_time; + NMI_Uint16 passive_scan_time; + CURRENT_TX_RATE_T curr_tx_rate; + +}tstrCfgParamVal; + +typedef enum { + RETRY_SHORT = 1 << 0, + RETRY_LONG = 1 << 1, + FRAG_THRESHOLD = 1 << 2, + RTS_THRESHOLD = 1 << 3, + BSS_TYPE = 1 << 4, + AUTH_TYPE = 1 << 5, + AUTHEN_TIMEOUT = 1 << 6, + POWER_MANAGEMENT = 1 << 7, + PREAMBLE = 1 << 8, + SHORT_SLOT_ALLOWED = 1 << 9, + TXOP_PROT_DISABLE = 1 << 10, + BEACON_INTERVAL = 1 << 11, + DTIM_PERIOD = 1 << 12, + SITE_SURVEY = 1 << 13, + SITE_SURVEY_SCAN_TIME = 1 << 14, + ACTIVE_SCANTIME = 1 << 15, + PASSIVE_SCANTIME = 1 << 16, + CURRENT_TX_RATE = 1 << 17, + HT_ENABLE = 1 <<18, +}tenuCfgParam; + +typedef struct +{ + NMI_Uint8 au8bssid[6]; + NMI_Sint8 s8rssi; +}tstrFoundNetworkInfo; + +typedef enum {SCAN_EVENT_NETWORK_FOUND = 0, +SCAN_EVENT_DONE = 1, +SCAN_EVENT_ABORTED = 2, +SCAN_EVENT_FORCE_32BIT = 0xFFFFFFFF +}tenuScanEvent; + +typedef enum +{ + CONN_DISCONN_EVENT_CONN_RESP = 0, + CONN_DISCONN_EVENT_DISCONN_NOTIF = 1, + CONN_DISCONN_EVENT_FORCE_32BIT = 0xFFFFFFFF +}tenuConnDisconnEvent; + +typedef enum +{ + WEP, + WPARxGtk, + //WPATxGtk, + WPAPtk, + PMKSA, +}tenuKeyType; + + +/*Scan callBack function definition*/ +typedef void(*tNMIpfScanResult)(tenuScanEvent, tstrNetworkInfo*, void*,void*); + +/*Connect callBack function definition*/ +typedef void(*tNMIpfConnectResult)(tenuConnDisconnEvent, + tstrConnectInfo*, + NMI_Uint8, + tstrDisconnectNotifInfo*, + void*); + +#ifdef NMI_P2P +typedef void(*tNMIpfRemainOnChanExpired)(void*); /*Remain on channel expiration callback function*/ +typedef void(*tNMIpfRemainOnChanReady)(void*); /*Remain on channel callback function*/ +#endif + +//typedef NMI_Uint32 NMI_WFIDrvHandle; +typedef struct +{ + NMI_Sint32 s32Dummy; +} +*NMI_WFIDrvHandle; + +/*! +* @struct tstrRcvdNetworkInfo +* @brief Structure to hold Received Asynchronous Network info +* @details +* @todo +* @sa +* @author Mostafa Abu Bakr +* @date 25 March 2012 +* @version 1.0 +*/ +typedef struct _tstrRcvdNetworkInfo +{ + NMI_Uint8* pu8Buffer; + NMI_Uint32 u32Length; +} tstrRcvdNetworkInfo; + +/*BugID_4156*/ +typedef struct _tstrHiddenNetworkInfo +{ + NMI_Uint8 *pu8ssid; + NMI_Uint8 u8ssidlen; + +}tstrHiddenNetworkInfo; + +typedef struct _tstrHiddenNetwork +{ + //MAX_SSID_LEN + tstrHiddenNetworkInfo *pstrHiddenNetworkInfo; + NMI_Uint8 u8ssidnum; + +} tstrHiddenNetwork; + +typedef struct +{ + /* Scan user call back function */ + tNMIpfScanResult pfUserScanResult; + + /* User specific parameter to be delivered through the Scan User Callback function */ + void* u32UserScanPvoid; + + NMI_Uint32 u32RcvdChCount; + tstrFoundNetworkInfo astrFoundNetworkInfo[MAX_NUM_SCANNED_NETWORKS]; +}tstrNMI_UsrScanReq; + +typedef struct +{ + NMI_Uint8* pu8bssid; + NMI_Uint8* pu8ssid; + NMI_Uint8 u8security; + AUTHTYPE_T tenuAuth_type; + size_t ssidLen; + NMI_Uint8* pu8ConnReqIEs; + size_t ConnReqIEsLen; + /* Connect user call back function */ + tNMIpfConnectResult pfUserConnectResult; + NMI_Bool IsHTCapable; + /* User specific parameter to be delivered through the Connect User Callback function */ + void* u32UserConnectPvoid; +}tstrNMI_UsrConnReq; + +#ifdef NMI_P2P +typedef struct +{ + + NMI_Uint16 u16Channel; + NMI_Uint32 u32duration; + tNMIpfRemainOnChanExpired pRemainOnChanExpired; + tNMIpfRemainOnChanReady pRemainOnChanReady; + void * pVoid; +}tstrHostIfRemainOnChan; + +typedef struct +{ + +NMI_Bool bReg; +NMI_Uint16 u16FrameType; +NMI_Uint8 u8Regid; + + +}tstrHostIfRegisterFrame; + +#define ACTION 0xD0 +#define PROBE_REQ 0x40 +#define PROBE_RESP 0x50 +#define ACTION_FRM_IDX 0 +#define PROBE_REQ_IDX 1 + + +enum p2p_listen_state +{ + P2P_IDLE, + P2P_LISTEN, + P2P_GRP_FORMATION +}; + +#endif +typedef struct +{ + /* Scan user structure */ + tstrNMI_UsrScanReq strNMI_UsrScanReq; + + /* Connect User structure */ + tstrNMI_UsrConnReq strNMI_UsrConnReq; + + #ifdef NMI_P2P + /*Remain on channel struvture*/ + tstrHostIfRemainOnChan strHostIfRemainOnChan; + NMI_Uint8 u8RemainOnChan_pendingreq; + NMI_Uint64 u64P2p_MgmtTimeout; + NMI_Uint8 u8P2PConnect; + #endif + + tenuHostIFstate enuHostIFstate; + + //NMI_Bool bPendingConnRequest; + + #ifndef CONNECT_DIRECT + NMI_Uint32 u32SurveyResultsCount; + wid_site_survey_reslts_s astrSurveyResults[MAX_NUM_SCANNED_NETWORKS]; + #endif + + NMI_Uint8 au8AssociatedBSSID[ETH_ALEN]; + tstrCfgParamVal strCfgValues; +}tstrNMI_WFIDrv; + +/*! +* @enum tenuNMI_StaFlag +* @brief Used to decode the station flag set and mask in tstrNMI_AddStaParam +* @details +* @todo +* @sa tstrNMI_AddStaParam, enum nl80211_sta_flags +* @author Enumeraion's creator +* @date 12 July 2012 +* @version 1.0 Description +*/ + +typedef enum +{ + NMI_STA_FLAG_INVALID = 0, + NMI_STA_FLAG_AUTHORIZED, /*!< station is authorized (802.1X)*/ + NMI_STA_FLAG_SHORT_PREAMBLE, /*!< station is capable of receiving frames with short barker preamble*/ + NMI_STA_FLAG_WME, /*!< station is WME/QoS capable*/ + NMI_STA_FLAG_MFP, /*!< station uses management frame protection*/ + NMI_STA_FLAG_AUTHENTICATED /*!< station is authenticated*/ +}tenuNMI_StaFlag; + +typedef struct +{ + NMI_Uint8 au8BSSID[ETH_ALEN]; + NMI_Uint16 u16AssocID; + NMI_Uint8 u8NumRates; + NMI_Uint8* pu8Rates; + NMI_Bool bIsHTSupported; + NMI_Uint16 u16HTCapInfo; + NMI_Uint8 u8AmpduParams; + NMI_Uint8 au8SuppMCsSet[16]; + NMI_Uint16 u16HTExtParams; + NMI_Uint32 u32TxBeamformingCap; + NMI_Uint8 u8ASELCap; + NMI_Uint16 u16FlagsMask; /**/ + NMI_Uint16 u16FlagsSet; /*>> \n") +#define FN_OUT //PRINT_D("<<<\n") + +//#define LINUX_RX_SIZE (8*1024) +#define LINUX_TX_SIZE (64*1024) + +#if defined (NM73131_0_BOARD) + +#define MODALIAS "nmc_spi" +#define GPIO_NUM IRQ_NMC1000_GPIO + +#elif defined (BEAGLE_BOARD) + #define SPI_CHANNEL 4 + + #if SPI_CHANNEL == 4 + #define MODALIAS "nmc_spi4" + #define GPIO_NUM 162 + #else + #define MODALIAS "nmc_spi3" + #define GPIO_NUM 133 + #endif +#elif defined(PANDA_BOARD) + #define MODALIAS "NMI_SPI" + #define GPIO_NUM 139 +#elif defined(PLAT_WMS8304) // rachel + #define MODALIAS "nmi_spi" + #define GPIO_NUM 139 +#else + #define MODALIAS "NMI_SPI" + #define GPIO_NUM 139 + +#endif + + +void linux_wlan_enable_irq(void); +#endif diff --git a/drivers/net/wireless/nmi/Nmc1000_Release7.2/src/driver/include/nmi_type.h b/drivers/net/wireless/nmi/Nmc1000_Release7.2/src/driver/include/nmi_type.h new file mode 100755 index 00000000..b04901b5 --- /dev/null +++ b/drivers/net/wireless/nmi/Nmc1000_Release7.2/src/driver/include/nmi_type.h @@ -0,0 +1,34 @@ +//////////////////////////////////////////////////////////////////////////// +// +// Copyright (c) Newport Media Inc. All rights reserved. +// +// Module Name: nmi_type.h +// +// +////////////////////////////////////////////////////////////////////////////// +#ifndef NMI_TYPE_H +#define NMI_TYPE_H + +/******************************************** + + Type Defines + +********************************************/ +#ifdef WIN32 +typedef char int8_t; +typedef short int16_t; +typedef long int32_t; +typedef unsigned char uint8_t; +typedef unsigned short uint16_t; +typedef unsigned long uint32_t; +#else +#ifdef _linux_ +/*typedef unsigned char uint8_t; +typedef unsigned short uint16_t; +typedef unsigned long uint32_t;*/ +#include +#else +#include "NMI_OSWrapper.h" +#endif +#endif +#endif diff --git a/drivers/net/wireless/nmi/Nmc1000_Release7.2/src/driver/include/nmi_wlan.h b/drivers/net/wireless/nmi/Nmc1000_Release7.2/src/driver/include/nmi_wlan.h new file mode 100755 index 00000000..086f9cfb --- /dev/null +++ b/drivers/net/wireless/nmi/Nmc1000_Release7.2/src/driver/include/nmi_wlan.h @@ -0,0 +1,347 @@ +#ifndef NMI_WLAN_H +#define NMI_WLAN_H + +#include "nmi_type.h" + + +#define ISNMC1000(id) (((id & 0xfffff000) == 0x100000) ? 1 : 0) + +/** + DMA_VER_1: Old DMA interface introduced since A0. It exists in all + later versions and all versions are backward compatible with this interface. +**/ +#define DMA_VER_1 (1) +/** + DMA_VER_21: DMA interface introduced in D0/E0 versions and later. It uses + fewer number of registers to setup the TX/RX DMA and makes used of SDIO + CMD52 mapped registers and SPI internal registers for faster SDIO and SPI + DMAs respectively. +**/ +#define DMA_VER_2 (2) + +#ifdef USE_DMA_VER_1 +#define DMA_VER DMA_VER_1 +#else +#define DMA_VER DMA_VER_2 +#endif + + +/******************************************** + + Mac eth header length + +********************************************/ + +#define MAX_MAC_HDR_LEN 26 //QOS_MAC_HDR_LEN +#define SUB_MSDU_HEADER_LENGTH 14 +#define SNAP_HDR_LEN 8 +#define ETHERNET_HDR_LEN 14 +#define WORD_ALIGNMENT_PAD 0 + +#define ETH_ETHERNET_HDR_OFFSET (MAX_MAC_HDR_LEN + SUB_MSDU_HEADER_LENGTH + \ + SNAP_HDR_LEN - ETHERNET_HDR_LEN + WORD_ALIGNMENT_PAD) + +/*Bug3959: transmitting mgmt frames received from host*/ +#define HOST_HDR_OFFSET 4 +#define ETHERNET_HDR_LEN 14 +#define IP_HDR_LEN 20 +#define IP_HDR_OFFSET ETHERNET_HDR_LEN +#define UDP_HDR_OFFSET (IP_HDR_LEN + IP_HDR_OFFSET) +#define UDP_HDR_LEN 8 +#define UDP_DATA_OFFSET (UDP_HDR_OFFSET + UDP_HDR_LEN) +#define ETH_CONFIG_PKT_HDR_LEN UDP_DATA_OFFSET + +#define ETH_CONFIG_PKT_HDR_OFFSET (ETH_ETHERNET_HDR_OFFSET + \ + ETH_CONFIG_PKT_HDR_LEN) +#define ACTION 0xD0 +#define PROBE_REQ 0x40 +#ifdef NMI_FULLY_HOSTING_AP +#define FH_TX_HOST_HDR_OFFSET 24 +#endif + +/******************************************** + + Endian Conversion + +********************************************/ + +#define BYTE_SWAP(val) ((((val) & 0x000000FF) << 24) + \ + (((val) & 0x0000FF00) << 8) + \ + (((val) & 0x00FF0000) >> 8) + \ + (((val) & 0xFF000000) >> 24)) + +/******************************************** + + Register Defines + +********************************************/ +#define NMI_PERIPH_REG_BASE 0x1000 +#define NMI_CHIPID (NMI_PERIPH_REG_BASE) +#define NMI_GLB_RESET_0 (NMI_PERIPH_REG_BASE + 0x400) +#define NMI_PIN_MUX_0 (NMI_PERIPH_REG_BASE + 0x408) +#define NMI_HOST_TX_CTRL (NMI_PERIPH_REG_BASE + 0x6c) +#define NMI_HOST_RX_CTRL_0 (NMI_PERIPH_REG_BASE + 0x70) +#define NMI_HOST_RX_CTRL_1 (NMI_PERIPH_REG_BASE + 0x74) +#define NMI_HOST_VMM_CTL (NMI_PERIPH_REG_BASE + 0x78) +#define NMI_HOST_RX_CTRL (NMI_PERIPH_REG_BASE + 0x80) +#define NMI_HOST_RX_EXTRA_SIZE (NMI_PERIPH_REG_BASE + 0x84) +#define NMI_HOST_TX_CTRL_1 (NMI_PERIPH_REG_BASE + 0x88) +#define NMI_MISC (NMI_PERIPH_REG_BASE+0x428) +#define NMI_INTR_REG_BASE (NMI_PERIPH_REG_BASE+0xa00) +#define NMI_INTR_ENABLE (NMI_INTR_REG_BASE) +#define NMI_INTR2_ENABLE (NMI_INTR_REG_BASE+4) + +#define NMI_INTR_POLARITY (NMI_INTR_REG_BASE+0x10) +#define NMI_INTR_TYPE (NMI_INTR_REG_BASE+0x20) +#define NMI_INTR_CLEAR (NMI_INTR_REG_BASE+0x30) +#define NMI_INTR_STATUS (NMI_INTR_REG_BASE+0x40) + +#define NMI_VMM_TBL_SIZE 64 +#define NMI_VMM_TX_TBL_BASE (0x150400) +#define NMI_VMM_RX_TBL_BASE (0x150500) + +#define NMI_VMM_BASE 0x150000 +#define NMI_VMM_CORE_CTL (NMI_VMM_BASE) +#define NMI_VMM_TBL_CTL (NMI_VMM_BASE+0x4) +#define NMI_VMM_TBL_ENTRY (NMI_VMM_BASE+0x8) +#define NMI_VMM_TBL0_SIZE (NMI_VMM_BASE+0xc) +#define NMI_VMM_TO_HOST_SIZE (NMI_VMM_BASE+0x10) +#define NMI_VMM_CORE_CFG (NMI_VMM_BASE+0x14) +#define NMI_VMM_TBL_ACTIVE (NMI_VMM_BASE+040) +#define NMI_VMM_TBL_STATUS (NMI_VMM_BASE+0x44) + +#define NMI_SPI_REG_BASE 0xe800 +#define NMI_SPI_CTL (NMI_SPI_REG_BASE) +#define NMI_SPI_MASTER_DMA_ADDR (NMI_SPI_REG_BASE+0x4) +#define NMI_SPI_MASTER_DMA_COUNT (NMI_SPI_REG_BASE+0x8) +#define NMI_SPI_SLAVE_DMA_ADDR (NMI_SPI_REG_BASE+0xc) +#define NMI_SPI_SLAVE_DMA_COUNT (NMI_SPI_REG_BASE+0x10) +#define NMI_SPI_TX_MODE (NMI_SPI_REG_BASE+0x20) +#define NMI_SPI_PROTOCOL_CONFIG (NMI_SPI_REG_BASE+0x24) +#define NMI_SPI_INTR_CTL (NMI_SPI_REG_BASE+0x2c) + +#define NMI_SPI_PROTOCOL_OFFSET (NMI_SPI_PROTOCOL_CONFIG-NMI_SPI_REG_BASE) + +#define NMI_AHB_DATA_MEM_BASE 0x30000 +#define NMI_AHB_SHARE_MEM_BASE 0xd0000 + +#define NMI_VMM_TBL_RX_SHADOW_BASE NMI_AHB_SHARE_MEM_BASE /* Bug 4477 fix */ +#define NMI_VMM_TBL_RX_SHADOW_SIZE (256) /* Bug 4477 fix */ + +#define _NMI_INT_STATS_PRE_D0 0x1488 +#define _NMI_INT_STATS_D0_AND_LATER 0x149c + +/* + * General purpose register 1 + * Bit 0: SDIO interrupt type: (This bit is ignored in case of SPI bus.) + * 1: SDIO uses a GPIO as interrupt. + * 0, SDIO native interrupt SDIO_DAT1 used. + * Bit 1: CLK type used + * 1: RTC clock is supplied externally from host + * 0: Use internal 80Mhz clock + */ + +#define _NMI_GP_REG_1_PRE_D0 0x148c +#define _NMI_GP_REG_1_D0_AND_LATER 0x14a0 + +#define NMI_HAVE_SDIO_IRQ_GPIO (1 << 0) +#define NMI_HAVE_RTC (1 << 1) +#define NMI_HAVE_DMA_VER_2 (1 << 2) +#define NMI_HAVE_VCO_14_SUPPLY (1 << 3) + + + +/******************************************** + + Wlan Defines + +********************************************/ +#define NMI_CFG_PKT 1 +#define NMI_NET_PKT 0 +/*Bug3959: transmitting mgmt frames received from host*/ +#ifdef NMI_AP_EXTERNAL_MLME +#define NMI_MGMT_PKT 2 + +#ifdef NMI_FULLY_HOSTING_AP +#define NMI_FH_DATA_PKT 4 +#endif + +#endif /*NMI_AP_EXTERNAL_MLME*/ +#define NMI_CFG_SET 1 +#define NMI_CFG_QUERY 0 + +#define NMI_CFG_RSP 1 +#define NMI_CFG_RSP_STATUS 2 +#define NMI_CFG_RSP_SCAN 3 + +#ifdef NMI_SDIO +#define NMI_PLL_TO 4 +#else +#define NMI_PLL_TO 2 +#endif + +/*******************************************/ +/* CA Interrupt flags. */ +/*******************************************/ +#define PLL_INT (1<<0) +#define DATA_INT (1<<1) +#define SLEEP_INT (1<<2) +#define ABORT_INT (1<<31) + +#if DMA_VER == DMA_VER_2 +/*******************************************/ +/* E0 and later Interrupt flags. */ +/*******************************************/ +/*******************************************/ +/* E0 and later Interrupt flags. */ +/* IRQ Status word */ +/* 15:0 = DMA count in words. */ +/* 16: INT0 flag */ +/* 17: INT1 flag */ +/* 18: INT2 flag */ +/* 19: INT3 flag */ +/* 20: INT4 flag */ +/* 21: INT5 flag */ +/*******************************************/ +#define IRG_FLAGS_OFFSET 16 +#define IRQ_DMA_WD_CNT_MASK ((1ul << IRG_FLAGS_OFFSET) - 1) +#define INT_0 (1<<(IRG_FLAGS_OFFSET)) +#define INT_1 (1<<(IRG_FLAGS_OFFSET+1)) +#define INT_2 (1<<(IRG_FLAGS_OFFSET+2)) +#define INT_3 (1<<(IRG_FLAGS_OFFSET+3)) +#define INT_4 (1<<(IRG_FLAGS_OFFSET+4)) +#define INT_5 (1<<(IRG_FLAGS_OFFSET+5)) +#define MAX_NUM_INT (6) + +/*******************************************/ +/* E0 and later Interrupt flags. */ +/* IRQ Clear word */ +/* 0: Clear INT0 */ +/* 1: Clear INT1 */ +/* 2: Clear INT2 */ +/* 3: Clear INT3 */ +/* 4: Clear INT4 */ +/* 5: Clear INT5 */ +/* 6: Select VMM table 1 */ +/* 7: Select VMM table 2 */ +/* 8: Enable VMM */ +/*******************************************/ +#define CLR_INT0 (1 << 0) +#define CLR_INT1 (1 << 1) +#define CLR_INT2 (1 << 2) +#define CLR_INT3 (1 << 3) +#define CLR_INT4 (1 << 4) +#define CLR_INT5 (1 << 5) +#define SEL_VMM_TBL0 (1 << 6) +#define SEL_VMM_TBL1 (1 << 7) +#define EN_VMM (1 << 8) + +#define DATA_INT_EXT INT_0 +#define PLL_INT_EXT INT_1 +#define SLEEP_INT_EXT INT_2 +#define ALL_INT_EXT (DATA_INT_EXT|PLL_INT_EXT|SLEEP_INT_EXT) +#define NUM_INT_EXT (3) + +#define DATA_INT_CLR CLR_INT0 +#define PLL_INT_CLR CLR_INT1 +#define SLEEP_INT_CLR CLR_INT2 + +#define ENABLE_RX_VMM (SEL_VMM_TBL1 | EN_VMM) +#define ENABLE_TX_VMM (SEL_VMM_TBL0 | EN_VMM) + +#endif /* ENABLE_FAST_DMA */ + +/*time for expiring the semaphores of cfg packets*/ +#define CFG_PKTS_TIMEOUT 2000 +/******************************************** + + Debug Type + +********************************************/ +typedef void (*nmi_debug_func)(uint32_t, char *, ...); + +/******************************************** + + Tx/Rx Queue Structure + +********************************************/ + +struct txq_entry_t { + struct txq_entry_t *next; + struct txq_entry_t *prev; + int type; + int tcp_PendingAck_index; + uint8_t *buffer; + int buffer_size; + void *priv; + int status; + void (*tx_complete_func)(void *, int); +}; + +struct rxq_entry_t { + struct rxq_entry_t *next; + uint8_t *buffer; + int buffer_size; +}; + +/******************************************** + + Host IF Structure + +********************************************/ + +typedef struct { + int (*hif_init)(nmi_wlan_inp_t *, nmi_debug_func); + int (*hif_deinit)(void *); + int (*hif_read_reg)(uint32_t, uint32_t *); + int (*hif_write_reg)(uint32_t, uint32_t); + int (*hif_block_rx)(uint32_t, uint8_t *, uint32_t); + int (*hif_block_tx)(uint32_t, uint8_t *, uint32_t); + int (*hif_sync)(void); + int (*hif_clear_int)(void); +#if DMA_VER == DMA_VER_2 + int (*hif_read_int)(uint32_t *); + int (*hif_clear_int_ext)(uint32_t); + int (*hif_read_size)(uint32_t *); + int (*hif_block_tx_ext)(uint32_t, uint8_t *, uint32_t); + int (*hif_block_rx_ext)(uint32_t, uint8_t *, uint32_t); + int (*hif_sync_ext)(int); +#endif /* DMA_VER == DMA_VER_2 */ + void (*hif_set_max_bus_speed)(void); + void (*hif_set_default_bus_speed)(void); +} nmi_hif_func_t; + +/******************************************** + + Configuration Structure + +********************************************/ + +#define MAX_CFG_FRAME_SIZE 1468 + +typedef struct { + uint8_t ether_header[14]; + uint8_t ip_header[20]; + uint8_t udp_header[8]; + uint8_t wid_header[4]; + uint8_t frame[MAX_CFG_FRAME_SIZE]; +} nmi_cfg_frame_t; + +typedef struct { + int (*wlan_tx)(uint8_t *, uint32_t, nmi_tx_complete_func_t); +} nmi_wlan_cfg_func_t; + +typedef struct { + int type; + uint32_t seq_no; +} nmi_cfg_rsp_t; + +typedef struct { + int (*cfg_wid_set)(uint8_t *, uint32_t, uint16_t, uint8_t *, int); + int (*cfg_wid_get)(uint8_t *, uint32_t, uint16_t); + int (*cfg_wid_get_val)(uint16_t, uint8_t *, uint32_t); + int (*rx_indicate)(uint8_t *, int, nmi_cfg_rsp_t *); + int (*cfg_init)(nmi_debug_func); +} nmi_cfg_func_t; + +#endif diff --git a/drivers/net/wireless/nmi/Nmc1000_Release7.2/src/driver/include/nmi_wlan_cfg.h b/drivers/net/wireless/nmi/Nmc1000_Release7.2/src/driver/include/nmi_wlan_cfg.h new file mode 100755 index 00000000..5f604cdf --- /dev/null +++ b/drivers/net/wireless/nmi/Nmc1000_Release7.2/src/driver/include/nmi_wlan_cfg.h @@ -0,0 +1,33 @@ +//////////////////////////////////////////////////////////////////////////// +// +// Copyright (c) Newport Media Inc. All rights reserved. +// +// Module Name: nmi_wlan_cfg.h +// +// +////////////////////////////////////////////////////////////////////////////// + +#ifndef NMI_WLAN_CFG_H +#define NMI_WLAN_CFG_H + +typedef struct { + uint16_t id; + uint16_t val; +} nmi_cfg_byte_t; + +typedef struct { + uint16_t id; + uint16_t val; +} nmi_cfg_hword_t; + +typedef struct { + uint32_t id; + uint32_t val; +} nmi_cfg_word_t; + +typedef struct { + uint32_t id; + uint8_t *str; +} nmi_cfg_str_t; + +#endif diff --git a/drivers/net/wireless/nmi/Nmc1000_Release7.2/src/driver/include/nmi_wlan_if.h b/drivers/net/wireless/nmi/Nmc1000_Release7.2/src/driver/include/nmi_wlan_if.h new file mode 100755 index 00000000..b97362d0 --- /dev/null +++ b/drivers/net/wireless/nmi/Nmc1000_Release7.2/src/driver/include/nmi_wlan_if.h @@ -0,0 +1,950 @@ +//////////////////////////////////////////////////////////////////////////// +// +// Copyright (c) Newport Media Inc. All rights reserved. +// +// Module Name: nmi_wlan_if.h +// +// +////////////////////////////////////////////////////////////////////////////// + + +#ifndef NMI_WLAN_IF_H +#define NMI_WLAN_IF_H + +/*bug 3887: [AP] Allow Management frames to be passed to the host*/ +#define NMI_AP_EXTERNAL_MLME +//#define NMI_P2P +//#define NMI_FULLY_HOSTING_AP +//#define USE_OLD_SPI_SW + +//#define NMC1000_SINGLE_TRANSFER + +#include "nmi_type.h" +#include "linux_wlan_common.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 (1 << 0) +#define HIF_SDIO_GPIO_IRQ (1 << 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 { + uint32_t read_write:1; + uint32_t function:3; + uint32_t raw:1; + uint32_t address:17; + uint32_t data:8; +} sdio_cmd52_t; + +typedef struct { + //struct { + uint32_t read_write:1; + uint32_t function:3; + uint32_t block_mode:1; + uint32_t increment:1; + uint32_t address:17; + uint32_t count:9; + //} bit; + uint8_t *buffer; + uint32_t block_size; +} sdio_cmd53_t; + +typedef struct { + void (*os_sleep)(uint32_t); + void (*os_atomic_sleep)(uint32_t); + void (*os_debug)(uint8_t *); + void *(*os_malloc)(uint32_t); + void *(*os_malloc_atomic)(uint32_t); + void (*os_free)(void *); + void (*os_lock)(void *); + void (*os_unlock)(void *); + int (*os_wait)(void *,NMI_Uint32); + void (*os_signal)(void *); + void (*os_enter_cs)(void *); + void (*os_leave_cs)(void *); + + /*Added by Amr - BugID_4720*/ + void (*os_spin_lock)(void *, unsigned long *); + void (*os_spin_unlock)(void *, unsigned long *); + +} nmi_wlan_os_func_t; + +typedef struct { + int io_type; + int (*io_init)(void *); + void (*io_deinit)(void *); + union { + struct { + int (*sdio_cmd52)(sdio_cmd52_t *); + int (*sdio_cmd53)(sdio_cmd53_t *); + int (*sdio_set_max_speed)(void); + int (*sdio_set_default_speed)(void); + } sdio; + struct { + int (*spi_max_speed)(void); + int (*spi_tx)(uint8_t *, uint32_t); + int (*spi_rx)(uint8_t *, uint32_t); + int (*spi_trx)(uint8_t *, uint8_t *, uint32_t); + } spi; + } u; +} nmi_wlan_io_func_t; + +typedef struct { + void (*rx_indicate)(uint8_t *, uint32_t); + void (*rx_complete)(void); +} nmi_wlan_net_func_t; + +typedef struct { + void (*mac_indicate)(int); +} nmi_wlan_indicate_func_t; +#define NMI_MAC_INDICATE_STATUS 0x1 +#define NMI_MAC_STATUS_INIT -1 +#define NMI_MAC_STATUS_READY 0 +#define NMI_MAC_STATUS_CONNECT 1 + +#define NMI_MAC_INDICATE_SCAN 0x2 + +typedef struct { + void *os_private; + + void *hif_critical_section; + + uint32_t tx_buffer_size; + void *txq_critical_section; + + /*Added by Amr - BugID_4720*/ + void *txq_add_to_head_critical_section; + void *txq_spin_lock; + + void *txq_wait_event; + + //uint32_t rx_buffer_size; + void *rxq_critical_section; + void *rxq_wait_event; + + void *cfg_wait_event; +} nmi_wlan_os_context_t; + +typedef struct { + nmi_wlan_os_context_t os_context; + nmi_wlan_os_func_t os_func; + nmi_wlan_io_func_t io_func; + nmi_wlan_net_func_t net_func; + nmi_wlan_indicate_func_t indicate_func; +} nmi_wlan_inp_t; + +#if 0 +typedef struct { + int start; + uint32_t id; + void *buffer; + uint32_t buffer_size; + int commit; +} nmi_wlan_cfg_set_t; + +typedef struct { + int start; + uint32_t id; + int commit; +} nmi_wlan_cfg_get_t; + +typedef struct { + uint32_t id; + void *buffer; + uint32_t buffer_size; +} nmi_wlan_cfg_val_t; +#endif + +typedef void (*nmi_tx_complete_func_t)(void *, int); + +#define NMI_TX_ERR_NO_BUF (-2) + +typedef struct { + int (*wlan_firmware_download)(const uint8_t *, uint32_t); + int (*wlan_start)(void); + int (*wlan_stop)(void); + int (*wlan_add_to_tx_que)(void *, uint8_t *, uint32_t, nmi_tx_complete_func_t); + int (*wlan_handle_tx_que)(uint32_t *); + void (*wlan_handle_rx_que)(void); + void (*wlan_handle_rx_isr)(void); + void (*wlan_cleanup)(void); + int (*wlan_cfg_set)(int, uint32_t, uint8_t *, uint32_t, int); + int (*wlan_cfg_get)(int, uint32_t, int); + int (*wlan_cfg_get_value)(uint32_t, uint8_t *, uint32_t); + /*Bug3959: transmitting mgmt frames received from host*/ + #if defined(NMI_AP_EXTERNAL_MLME) || defined(NMI_P2P) + int(*wlan_add_mgmt_to_tx_que)(void *, uint8_t *, uint32_t, nmi_tx_complete_func_t); + + #ifdef NMI_FULLY_HOSTING_AP + int(*wlan_add_data_to_tx_que)(void *, uint8_t *, uint32_t, nmi_tx_complete_func_t); + #endif + + #endif +} nmi_wlan_oup_t; + +/******************************************** + + Wlan Configuration ID + +********************************************/ + +#define MAX_SSID_LEN 33 +#define MAX_RATES_SUPPORTED 12 + +#define INFINITE_SLEEP_TIME (NMI_Uint32)0xFFFFFFFF + +#ifdef NMI_PARSE_SCAN_IN_HOST +typedef enum{ + SUPP_RATES_IE = 1, + EXT_SUPP_RATES_IE =50, + HT_CAPABILITY_IE =45, + RSN_IE = 48, + WPA_IE = 221, + WMM_IE=221, +}BEACON_IE; +#endif +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, /* basic rate: 1, 2 Mbps, otherwise: 5, 11 Mbps */ + G_ONLY_MODE, /* basic rate: 6, 12, 24 Mbps, otherwise: 9, 18, 36, 48, 54 Mbps */ + G_MIXED_11B_1_MODE, /* basic rate: 1, 2, 5.5, 11 Mbps, otherwise: all on */ + G_MIXED_11B_2_MODE, /* basic rate: 1, 2, 5, 11, 6, 12, 24 Mbps, 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 + +/*bug3819: */ +#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 { + 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; + +typedef enum{ + OPEN_SYSTEM = 1, + SHARED_KEY = 2, + ANY = 3, + IEEE8021 =5 +} AUTHTYPE_T; + +typedef enum { + SITE_SURVEY_1CH = 0, + SITE_SURVEY_ALL_CH = 1, + SITE_SURVEY_OFF = 2 +} SITE_SURVEY_T; + +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 = 0x10 +} CH_FILTER_T; + +typedef enum { + AUTO_PROT = 0, /* Auto */ + NO_PROT, /* Do not use any protection */ + ERP_PROT, /* Protect all ERP frame exchanges */ + HT_PROT, /* Protect all HT frame exchanges */ + GF_PROT, /* Protect all GF frame exchanges */ +} N_PROTECTION_MODE_T; + +typedef enum { + G_SELF_CTS_PROT, + G_RTS_CTS_PROT, +} G_PROTECTION_MODE_T; + +typedef enum { + HT_MIXED_MODE = 1, + HT_ONLY_20MHZ_MODE, + HT_ONLY_20_40MHZ_MODE, +} N_OPERATING_MODE_T; + +typedef enum { + NO_DETECT = 0, + DETECT_ONLY = 1, + DETECT_PROTECT = 2, + DETECT_PROTECT_REPORT = 3, +} N_OBSS_DETECTION_T; + +typedef enum { + RTS_CTS_NONHT_PROT = 0, /* RTS-CTS at non-HT rate */ + FIRST_FRAME_NONHT_PROT, /* First frame at non-HT rate */ + LSIG_TXOP_PROT, /* LSIG TXOP Protection */ + FIRST_FRAME_MIXED_PROT, /* First frame at Mixed format */ +} N_PROTECTION_TYPE_T; + +typedef enum { + STATIC_MODE = 1, + DYNAMIC_MODE = 2, + MIMO_MODE = 3, /* power save disable */ +} N_SMPS_MODE_T; + +typedef enum { + DISABLE_SELF_CTS, + ENABLE_SELF_CTS, + DISABLE_TX_ABORT, + ENABLE_TX_ABORT, + HW_TRIGGER_ABORT, + SW_TRIGGER_ABORT, +} TX_ABORT_OPTION_T; + +typedef enum { + WID_CHAR = 0, + WID_SHORT = 1, + WID_INT = 2, + WID_STR = 3, + WID_BIN_DATA = 4, + WID_BIN = 5, + WID_IP = 6, + WID_ADR = 7, + WID_UNDEF = 8, + WID_TYPE_FORCE_32BIT = 0xFFFFFFFF + +} WID_TYPE_T,tenuWIDtype; + +typedef enum { + WID_NIL = 0xffff, + + + /* BSS Type */ + /* -------------------------------------------------------------- */ + /* Configuration : Infrastructure Independent Access Point */ + /* Values to set : 0 1 2 */ + /* -------------------------------------------------------------- */ + WID_BSS_TYPE = 0x0000, + + /* Transmit Rate */ + /* -------------------------------------------------------------- */ + /* Configuration : 1 2 5.5 11 6 9 12 18 24 36 48 54 */ + /* Values to set : 1 2 5 11 6 9 12 18 24 36 48 54 */ + /* -------------------------------------------------------------- */ + WID_CURRENT_TX_RATE = 0x0001, + + /* Channel */ + /* ------------------------------------------------------------------- */ + /* Configuration(g) : 1 2 3 4 5 6 7 8 9 10 11 12 13 14 */ + /* Values to set : 1 2 3 4 5 6 7 8 9 10 11 12 13 14 */ + /* -------------------------------------------------------------------- */ + WID_CURRENT_CHANNEL = 0x0002, + + /* Preamble */ + /* -------------------------------------------------------------- */ + /* Configuration : short long Auto */ + /* Values to set : 0 1 2 */ + /* -------------------------------------------------------------- */ + WID_PREAMBLE = 0x0003, + + /* 11g operating mode (ignored if 11g not present) */ + /* -------------------------------------------------------------- */ + /* Configuration : HighPerf Compat(RSet #1) Compat(RSet #2) */ + /* Values to set : 1 2 3 */ + /* -------------------------------------------------------------- */ + WID_11G_OPERATING_MODE = 0x0004, + + /* Mac status (response only) */ + /* -------------------------------------------------------------- */ + /* Configuration : disconnect connect */ + /* Values to get : 0 1 */ + /* -------------------------------------------------------------- */ + WID_STATUS = 0x0005, + + /* Scan type */ + /* -------------------------------------------------------------- */ + /* Configuration : Passive Scanning Active Scanning */ + /* Values to set : 0 1 */ + /* -------------------------------------------------------------- */ + WID_SCAN_TYPE = 0x0007, + + /* Key Id (WEP default key Id) */ + /* -------------------------------------------------------------- */ + /* Configuration : Any value between 0 to 3 */ + /* Values to set : Same value. Default is 0 */ + /* -------------------------------------------------------------- */ + WID_KEY_ID = 0x0009, + + /* QoS Enable */ + /* -------------------------------------------------------------- */ + /* Configuration : QoS Disable WMM Enable */ + /* Values to set : 0 1 */ + /* -------------------------------------------------------------- */ + WID_QOS_ENABLE = 0x000A, + + /* Power Management */ + /* ------------------------------------------------------------------ */ + /* Configuration : NO_POWERSAVE MIN_POWERSAVE MAX_POWERSAVE */ + /* Values to set : 0 1 2 */ + /* ------------------------------------------------------------------ */ + WID_POWER_MANAGEMENT = 0x000B, + + /* WEP/802 11I Configuration */ + /* ------------------------------------------------------------------ */ + /* Configuration : Disable WP40 WP104 WPA-AES WPA-TKIP RSN-AES RSN-TKIP */ + /* Values (0x) : 00 03 07 29 49 31 51 */ + /* */ + /* Configuration : WPA-AES+TKIP RSN-AES+TKIP */ + /* Values (0x) : 69 71 */ + /* ------------------------------------------------------------------ */ + WID_11I_MODE = 0x000C, + + /* WEP Configuration: Used in BSS STA mode only when WEP is enabled */ + /* ------------------------------------------------------------------ */ + /* Configuration : Open System Shared Key Any Type | 802.1x Auth */ + /* Values (0x) : 01 02 03 | BIT2 */ + /* ------------------------------------------------------------------ */ + WID_AUTH_TYPE = 0x000D, + + /* Site Survey Type */ + /* -------------------------------------------------------------- */ + /* Configuration : Values to set */ + /* Survey 1 Channel : 0 */ + /* survey all Channels : 1 */ + /* Disable Site Survey : 2 */ + /* -------------------------------------------------------------- */ + WID_SITE_SURVEY = 0x000E, + + /* Listen Interval */ + /* -------------------------------------------------------------- */ + /* Configuration : Any value between 1 to 255 */ + /* Values to set : Same value. Default is 3 */ + /* -------------------------------------------------------------- */ + WID_LISTEN_INTERVAL = 0x000F, + + /* DTIM Period */ + /* -------------------------------------------------------------- */ + /* Configuration : Any value between 1 to 255 */ + /* Values to set : Same value. Default is 3 */ + /* -------------------------------------------------------------- */ + WID_DTIM_PERIOD = 0x0010, + + /* ACK Policy */ + /* -------------------------------------------------------------- */ + /* Configuration : Normal Ack No Ack */ + /* Values to set : 0 1 */ + /* -------------------------------------------------------------- */ + WID_ACK_POLICY = 0x0011, + + /* Reset MAC (Set only) */ + /* -------------------------------------------------------------- */ + /* Configuration : Don't Reset Reset No Request */ + /* Values to set : 0 1 2 */ + /* -------------------------------------------------------------- */ + WID_RESET = 0x0012, + + /* Broadcast SSID Option: Setting this will adhere to "" SSID element */ + /* ------------------------------------------------------------------ */ + /* Configuration : Enable Disable */ + /* Values to set : 1 0 */ + /* ------------------------------------------------------------------ */ + WID_BCAST_SSID = 0x0015, + + /* Disconnect (Station) */ + /* ------------------------------------------------------------------ */ + /* Configuration : Association ID */ + /* Values to set : Association ID */ + /* ------------------------------------------------------------------ */ + WID_DISCONNECT = 0x0016, + + /* 11a Tx Power Level */ + /* -------------------------------------------------------------------- */ + /* Configuration : Sets TX Power (Higher the value greater the power) */ + /* Values to set : Any value between 0 and 63 (inclusive; Default is 48)*/ + /* -------------------------------------------------------------------- */ + WID_TX_POWER_LEVEL_11A = 0x0018, + + /* Group Key Update Policy Selection */ + /* -------------------------------------------------------------------- */ + /* Configuration : Disabled timeBased packetBased timePacketBased */ + /* Values to set : 1 2 3 4 */ + /* -------------------------------------------------------------------- */ + WID_REKEY_POLICY = 0x0019, + + /* Allow Short Slot */ + /* -------------------------------------------------------------- */ + /* Configuration : Disallow Short Slot Allow Short Slot */ + /* (Enable Only Long Slot) (Enable Short Slot if applicable)*/ + /* Values to set : 0 1 */ + /* -------------------------------------------------------------- */ + WID_SHORT_SLOT_ALLOWED = 0x001A, + + WID_PHY_ACTIVE_REG = 0x001B, + + /* 11b Tx Power Level */ + /* -------------------------------------------------------------------- */ + /* Configuration : Sets TX Power (Higher the value greater the power) */ + /* Values to set : Any value between 0 and 63 (inclusive; Default is 48)*/ + /* -------------------------------------------------------------------- */ + WID_TX_POWER_LEVEL_11B = 0x001D, + + /* Scan Request */ + /* -------------------------------------------------------------------- */ + /* Configuration : Request default scan */ + /* Values to set : 0 */ + /* -------------------------------------------------------------------- */ + WID_START_SCAN_REQ = 0x001E, + + /* Rssi (get only) */ + /* -------------------------------------------------------------------- */ + /* Configuration : */ + /* Values to get : Rssi value */ + /* -------------------------------------------------------------------- */ + WID_RSSI = 0x001F, + + /* Join Request */ + /* -------------------------------------------------------------------- */ + /* Configuration : Request to join */ + /* Values to set : index of scan result */ + /* -------------------------------------------------------------------- */ + WID_JOIN_REQ = 0x0020, + + WID_LINKSPEED = 0x0026, + + /* Enable User Control of TX Power */ + /* -------------------------------------------------------------------- */ + /* Configuration : Disable Enable */ + /* Values to set : 0 1 */ + /* -------------------------------------------------------------------- */ + WID_USER_CONTROL_ON_TX_POWER = 0x0027, + + WID_MEMORY_ACCESS_8BIT = 0x0029, + + /* Enable Auto RX Sensitivity feature */ + /* -------------------------------------------------------------------- */ + /* Configuration : Disable Enable */ + /* Values to set : 0 1 */ + /* -------------------------------------------------------------------- */ + WID_AUTO_RX_SENSITIVITY = 0x0032, + + /* Receive Buffer Based Ack */ + /* -------------------------------------------------------------------- */ + /* Configuration : Disable Enable */ + /* Values to set : 0 1 */ + /* -------------------------------------------------------------------- */ + WID_DATAFLOW_CONTROL = 0x0033, + + /* Scan Filter */ + /* -------------------------------------------------------------------- */ + /* Configuration : Class No filter AP only Station Only */ + /* Values to set : 0 1 2 */ + /* Configuration : Priority High Rssi Low Rssi Detect */ + /* Values to set : 0 0x4 0x08 */ + /* Configuration : Channel filter off filter on */ + /* Values to set : 0 0x10 */ + /* -------------------------------------------------------------------- */ + WID_SCAN_FILTER = 0x0036, + + /* Link Loss Threshold (measure in the beacon period) */ + /* -------------------------------------------------------------------- */ + /* Configuration : Any value between 10 and 254 (Set to 255 to disable it) */ + /* Values to set : Same value. Default is 10 */ + /* -------------------------------------------------------------------- */ + WID_LINK_LOSS_THRESHOLD = 0x0037, + #ifdef NMI_P2P + WID_REMAIN_ON_CHAN = 0x003D, + #endif + /* NMAC Character WID list */ + WID_WPS_START = 0x0043, + + /* Protection mode for MAC */ + /* -------------------------------------------------------------- */ + /* Configuration : Auto No protection ERP HT GF */ + /* Values to set : 0 1 2 3 4 */ + /* -------------------------------------------------------------- */ + WID_11N_PROT_MECH = 0x0080, + + /* ERP Protection type for MAC */ + /* -------------------------------------------------------------- */ + /* Configuration : Self-CTS RTS-CTS */ + /* Values to set : 0 1 */ + /* -------------------------------------------------------------- */ + WID_11N_ERP_PROT_TYPE = 0x0081, + + /* HT Option Enable */ + /* -------------------------------------------------------------- */ + /* Configuration : HT Enable HT Disable */ + /* Values to set : 1 0 */ + /* -------------------------------------------------------------- */ + WID_11N_ENABLE = 0x0082, + + /* 11n Operating mode (Note that 11g operating mode will also be */ + /* used in addition to this, if this is set to HT Mixed mode) */ + /* -------------------------------------------------------------- */ + /* Configuration : HT Mixed HT Only-20MHz HT Only-20/40MHz */ + /* Values to set : 1 2 3 */ + /* -------------------------------------------------------------- */ + WID_11N_OPERATING_MODE = 0x0083, + + /* 11n OBSS non-HT STA Detection flag */ + /* -------------------------------------------------------------- */ + /* Configuration : Do not detect */ + /* Values to set : 0 */ + /* Configuration : Detect, do not protect or report */ + /* Values to set : 1 */ + /* Configuration : Detect, protect and do not report */ + /* Values to set : 2 */ + /* Configuration : Detect, protect and report to other BSS */ + /* Values to set : 3 */ + /* -------------------------------------------------------------- */ + WID_11N_OBSS_NONHT_DETECTION = 0x0084, + + /* 11n HT Protection Type */ + /* -------------------------------------------------------------- */ + /* Configuration : RTS-CTS First Frame Exchange at non-HT-rate */ + /* Values to set : 0 1 */ + /* Configuration : LSIG TXOP First Frame Exchange in Mixed Fmt */ + /* Values to set : 2 3 */ + /* -------------------------------------------------------------- */ + WID_11N_HT_PROT_TYPE = 0x0085, + + /* 11n RIFS Protection Enable Flag */ + /* -------------------------------------------------------------- */ + /* Configuration : Disable Enable */ + /* Values to set : 0 1 */ + /* -------------------------------------------------------------- */ + WID_11N_RIFS_PROT_ENABLE = 0x0086, + + /* SMPS Mode */ + /* -------------------------------------------------------------- */ + /* Configuration : Static Dynamic MIMO (Power Save Disabled) */ + /* Values to set : 1 2 3 */ + /* -------------------------------------------------------------- */ + WID_11N_SMPS_MODE = 0x0087, + + /* Current transmit MCS */ + /* -------------------------------------------------------------- */ + /* Configuration : MCS Index for data rate */ + /* Values to set : 0 to 7 */ + /* -------------------------------------------------------------- */ + WID_11N_CURRENT_TX_MCS = 0x0088, + + WID_11N_PRINT_STATS = 0x0089, + + /* 11n Short GI Enable Flag */ + /* -------------------------------------------------------------- */ + /* Configuration : Disable Enable */ + /* Values to set : 0 1 */ + /* -------------------------------------------------------------- */ + WID_11N_SHORT_GI_ENABLE = 0x008D, + + /* 11n RIFS Enable Flag */ + /* -------------------------------------------------------------- */ + /* Configuration : Disable Enable */ + /* Values to set : 0 1 */ + /* -------------------------------------------------------------- */ + WID_RIFS_MODE = 0x0094, + + /* TX Abort Feature */ + /* -------------------------------------------------------------- */ + /* Configuration : Disable Self CTS Enable Self CTS */ + /* Values to set : 0 1 */ + /* Configuration : Disable TX Abort Enable TX Abort */ + /* Values to set : 2 3 */ + /* Configuration : Enable HW TX Abort Enable SW TX Abort */ + /* Values to set : 4 5 */ + /* -------------------------------------------------------------- */ + WID_TX_ABORT_CONFIG = 0x00A1, + + WID_REG_TSSI_11B_VALUE = 0x00A6, + WID_REG_TSSI_11G_VALUE = 0x00A7, + WID_REG_TSSI_11N_VALUE = 0x00A8, + WID_TX_CALIBRATION = 0x00A9, + WID_DSCR_TSSI_11B_VALUE = 0x00AA, + WID_DSCR_TSSI_11G_VALUE = 0x00AB, + WID_DSCR_TSSI_11N_VALUE = 0x00AC, + + /* Immediate Block-Ack Support */ + /* -------------------------------------------------------------- */ + /* Configuration : Disable Enable */ + /* Values to set : 0 1 */ + /* -------------------------------------------------------------- */ + WID_11N_IMMEDIATE_BA_ENABLED = 0x00AF, + + /* TXOP Disable Flag */ + /* -------------------------------------------------------------- */ + /* Configuration : Disable Enable */ + /* Values to set : 1 0 */ + /* -------------------------------------------------------------- */ + WID_11N_TXOP_PROT_DISABLE = 0x00B0, + + + WID_TX_POWER_LEVEL_11N = 0x00B1, + + /* Custom Character WID list */ + WID_PC_TEST_MODE = 0x00C8, + /*bug3819: */ + /* SCAN Complete notification WID*/ + WID_SCAN_COMPLETE =0x00C9, + +#ifdef NMI_AP_EXTERNAL_MLME + WID_DEL_BEACON = 0x00CA, +#endif + + WID_LOGTerminal_Switch = 0x00CD, + /* EMAC Short WID list */ + /* RTS Threshold */ + /* -------------------------------------------------------------- */ + /* Configuration : Any value between 256 to 2347 */ + /* Values to set : Same value. Default is 2347 */ + /* -------------------------------------------------------------- */ + WID_RTS_THRESHOLD = 0x1000, + + /* Fragmentation Threshold */ + /* -------------------------------------------------------------- */ + /* Configuration : Any value between 256 to 2346 */ + /* Values to set : Same value. Default is 2346 */ + /* -------------------------------------------------------------- */ + WID_FRAG_THRESHOLD = 0x1001, + + WID_SHORT_RETRY_LIMIT = 0x1002, + WID_LONG_RETRY_LIMIT = 0x1003, + WID_BEACON_INTERVAL = 0x1006, + WID_MEMORY_ACCESS_16BIT = 0x1008, + WID_RX_SENSE = 0x100B, + WID_ACTIVE_SCAN_TIME = 0x100C, + WID_PASSIVE_SCAN_TIME = 0x100D, + + WID_SITE_SURVEY_SCAN_TIME = 0x100E, + WID_JOIN_START_TIMEOUT = 0x100F, + WID_AUTH_TIMEOUT = 0x1010, + WID_ASOC_TIMEOUT = 0x1011, + WID_11I_PROTOCOL_TIMEOUT = 0x1012, + WID_EAPOL_RESPONSE_TIMEOUT = 0x1013, + + /* NMAC Short WID list */ + WID_11N_SIG_QUAL_VAL = 0x1085, + WID_CCA_THRESHOLD = 0x1087, + + /* Custom Short WID list */ + + /* EMAC Integer WID list */ + WID_FAILED_COUNT = 0x2000, + WID_RETRY_COUNT = 0x2001, + WID_MULTIPLE_RETRY_COUNT = 0x2002, + WID_FRAME_DUPLICATE_COUNT = 0x2003, + WID_ACK_FAILURE_COUNT = 0x2004, + WID_RECEIVED_FRAGMENT_COUNT = 0x2005, + WID_MCAST_RECEIVED_FRAME_COUNT = 0x2006, + WID_FCS_ERROR_COUNT = 0x2007, + WID_SUCCESS_FRAME_COUNT = 0x2008, + WID_HUT_TX_COUNT = 0x200A, + WID_TX_FRAGMENT_COUNT = 0x200B, + WID_TX_MULTICAST_FRAME_COUNT = 0x200C, + WID_RTS_SUCCESS_COUNT = 0x200D, + WID_RTS_FAILURE_COUNT = 0x200E, + WID_WEP_UNDECRYPTABLE_COUNT = 0x200F, + WID_REKEY_PERIOD = 0x2010, + WID_REKEY_PACKET_COUNT = 0x2011, + WID_1X_SERV_ADDR = 0x2012, + WID_STACK_IP_ADDR = 0x2013, + WID_STACK_NETMASK_ADDR = 0x2014, + WID_HW_RX_COUNT = 0x2015, + WID_MEMORY_ADDRESS = 0x201E, + WID_MEMORY_ACCESS_32BIT = 0x201F, + WID_RF_REG_VAL = 0x2021, + + /* NMAC Integer WID list */ + WID_11N_PHY_ACTIVE_REG_VAL = 0x2080, + + /* Custom Integer WID list */ + WID_GET_INACTIVE_TIME = 0x2084, + /* EMAC String WID list */ + WID_SSID = 0x3000, + WID_FIRMWARE_VERSION = 0x3001, + WID_OPERATIONAL_RATE_SET = 0x3002, + WID_BSSID = 0x3003, + WID_WEP_KEY_VALUE = 0x3004, + WID_11I_PSK = 0x3008, + WID_11E_P_ACTION_REQ = 0x3009, + WID_1X_KEY = 0x300A, + WID_HARDWARE_VERSION = 0x300B, + WID_MAC_ADDR = 0x300C, + WID_HUT_DEST_ADDR = 0x300D, + WID_PHY_VERSION = 0x300F, + WID_SUPP_USERNAME = 0x3010, + WID_SUPP_PASSWORD = 0x3011, + WID_SITE_SURVEY_RESULTS = 0x3012, + WID_RX_POWER_LEVEL = 0x3013, + WID_SET_STA_MAC_INACTIVE_TIME = 0x3017, + WID_ADD_WEP_KEY = 0x3019, + WID_REMOVE_WEP_KEY = 0x301A, + WID_ADD_PTK = 0x301B, + WID_ADD_RX_GTK = 0x301C, + WID_ADD_TX_GTK = 0x301D, + WID_REMOVE_KEY = 0x301E, + WID_ASSOC_REQ_INFO = 0x301F, + WID_ASSOC_RES_INFO = 0x3020, + WID_MANUFACTURER = 0x3026, /*Added for CAPI tool */ + WID_MODEL_NAME = 0x3027, /*Added for CAPI tool */ + WID_MODEL_NUM = 0x3028, /*Added for CAPI tool */ + WID_DEVICE_NAME = 0x3029, /*Added for CAPI tool */ + + /* NMAC String WID list */ + WID_11N_P_ACTION_REQ = 0x3080, + WID_HUT_TEST_ID = 0x3081, + WID_PMKID_INFO = 0x3082, + WID_FIRMWARE_INFO = 0x3083, + #ifdef NMI_P2P + WID_REGISTER_FRAME = 0x3084, + #endif + /*BugID_4156*/ + WID_SSID_PROBE_REQ = 0x3997, + /*BugID_4124 WID to trigger modified Join Request using SSID and BSSID instead of bssListIdx (used by WID_JOIN_REQ)*/ + WID_JOIN_REQ_EXTENDED = 0x3998, + + + + + /* Custom String WID list */ + + /* EMAC Binary WID list */ + WID_UAPSD_CONFIG = 0x4001, + WID_UAPSD_STATUS = 0x4002, + WID_WMM_AP_AC_PARAMS = 0x4003, + WID_WMM_STA_AC_PARAMS = 0x4004, + WID_NETWORK_INFO = 0x4005, + WID_STA_JOIN_INFO = 0x4006, + WID_CONNECTED_STA_LIST = 0x4007, + + /* NMAC Binary WID list */ + WID_11N_AUTORATE_TABLE = 0x4080, + + + /*Added here by Amr - BugID 4134*/ + WID_SCAN_CHANNEL_LIST = 0x4084, + + /*BugID_3746 WID to add IE to be added in next probe request*/ + WID_INFO_ELEMENT_PROBE = 0x4085, + /*BugID_3746 WID to add IE to be added in next associate request*/ + WID_INFO_ELEMENT_ASSOCIATE = 0x4086, + WID_ADD_STA = 0X4087, + WID_REMOVE_STA = 0X4088, + WID_EDIT_STA = 0X4089, + WID_ADD_BEACON = 0x408a, + + /* Miscellaneous WIDs */ + WID_ALL = 0x7FFE, + WID_MAX = 0xFFFF +} WID_T; + +int nmi_wlan_init(nmi_wlan_inp_t *inp, nmi_wlan_oup_t *oup); + +void nmi_bus_set_max_speed(void); +void nmi_bus_set_default_speed(void); +uint32_t nmi_get_chipid(uint8_t update); + + +#endif -- cgit