⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 umi.h

📁 Microsoft WinCE 6.0 BSP FINAL release source code for use with the i.MX27ADS TO2 WCE600_FINAL_MX27_S
💻 H
📖 第 1 页 / 共 5 页
字号:
//---------------------------------------------------------------------------
//Copyright (C) 2006, Freescale Semiconductor, Inc. All Rights Reserved.
// THIS SOURCE CODE, AND ITS USE AND DISTRIBUTION, IS SUBJECT TO THE TERMS
// AND CONDITIONS OF THE APPLICABLE LICENSE AGREEMENT 
//--------------------------------------------------------------------------
//
// File:  umi.h
// Header file for platform specific SDIO WLAN functions
//------------------------------------------------------------------------------

#ifndef UMI_INCLUDED_H
#define UMI_INCLUDED_H

#include "wb_types.h"
#include "mib_id.h"

#include "msgid.h"
#include "statistics.h"
#include "ieee_address.h"

/***************************************************************************/
/***                       Types and Defines                             ***/
/***************************************************************************/

#define UMI_MAX_MSDU_LENGTH             (1560)

typedef uint16 UMI_STATUS;
#define UMI_OK                          0
#define UMI_NOT_INITIALISED             1
#define UMI_BAD_PARAMETER               2
#define UMI_BAD_VALUE                   3
#define UMI_BAD_LENGTH                  4
#define UMI_MC_BUSY                     5
#define UMI_ALREADY_ENABLED             6
//#define UMI_HW_FAILURE                  7
#define UMI_BSS_ALREADY_ACTIVE          8
//#define UMI_BSS_HAS_NO_CFP              9
#define UMI_REQ_FAILED                  9
//#define UMI_BSS_UNKNOWN                 10
#define UMI_STATION_UNKNOWN             11
//#define UMI_NOT_ENABLED                 12
#define UMI_OUT_OF_MEMORY               13
#define UMI_TIMEOUT                     14
#define UMI_NOT_CONNECTED               15
#define UMI_UNKNOWN_OBJECT              16
#define UMI_READ_ONLY                   17
#define UMI_WRITE_ONLY                  18
//#define UMI_RATE_MISMATCH               19
//#define UMI_TRANSFER_ALREADY_ACTIVE     20
//#define UMI_TRANSFER_FAILED             21
#define UMI_NOT_SUPPORTED               22
#define UMI_RSN_IE_FORMAT_ERROR         23
#define UMI_RSN_BAD_CAPABILITIES        24
#define UMI_INTERNAL_MAC_ERROR          25
#define UMI_CONNECTING_TO_BSS           26   /* if scan req received when trying to connect to BSS */
#define UMI_NO_BSS_RADIO_MEAS_CAPABILITY  27

/* Status codes for memory allocation */
#define UMI_ALLOC_OK                    UMI_OK
#define UMI_ALLOC_FAILED                UMI_OUT_OF_MEMORY
#define UMI_ALLOC_FWD_POOL_OK           26

typedef uint16 UMI_BSS_TYPE;
#define UMI_BSS_INFRA                   0
#define UMI_BSS_INFRA_PCF               1
#define UMI_BSS_ADHOC                   2
#define UMI_BSS_ANY                     3

typedef uint16 UMI_NETWORK_STATUS;
#define UMI_BSS_CREATED                 0 /* We have created a network (BSS)                   */
#define UMI_BSS_CONNECTING              1 /* STA is connecting to BSS/IBSS                     */
#define UMI_BSS_CONNECTED               2 /* STA has connected to network (auth and assoc)     */
#define UMI_BSS_FAILED                  4 /* STA is unable to connect with any network         */

/* Reason for network disconnection */
#define UMI_BSS_NEW_NETWORK             0 /* Reason unknown or not applicable                  */
#define UMI_BSS_JOINED                  1 /* Reason unknown or not applicable                  */
#define UMI_BSS_DEAUTHENTICATED         2 /* STA has been deauthenticated by AP                */
#define UMI_BSS_DISASSOCIATED           3 /* STA has been disassociated by AP                  */
#define UMI_BSS_JOIN_FAILED             4 /* Join has failed or timed out                      */
#define UMI_BSS_AUTH_FAILED             5 /* Authentication has failed                         */
#define UMI_BSS_ASSOC_FAILED            6 /* Association has failed                            */
#define UMI_BSS_BEACON_TIMEOUT          7 /* STA has lost contact with IBSS network            */
#define UMI_BSS_ROAMING                 8 /* STA is roaming to another BSS                     */
#define UMI_BSS_MANUAL_DISCONNECT       9 /* UMI has forced a disconnet                        */
#define UMI_BSS_NO_NETWORK              10 /* There is no network to join                      */
#define UMI_BSS_IBSS_COALESCE           11 /* We are coasescing with another IBSS              */
#define UMI_BSS_AUTH_TIMEOUT            12 /* Authentication has timed out                     */
#define UMI_BSS_ASSOC_TIMEOUT           13 /* Association has timed out                        */
#define UMI_BSS_CHANNEL_SWITCH          14 /* STA is switching to new channel as directed by AP */
#define UMI_BSS_COUNTRY_UNKNOWN         15 /* Join has failed due to unknown Country           */

typedef uint16 UMI_CONNECTION_STATUS;
#define UMI_CONNECTED                   0
#define UMI_DISCONNECTED                1
#define UMI_RECONNECTED                 2

typedef uint16 UMI_PCF_CAPABILITY;
#define UMI_NO_PCF                      0
#define UMI_HAS_PCF                     1

typedef uint16 UMI_ACCESS_PROTOCOL;
#define UMI_USE_DCF                     0
#define UMI_USE_PCF                     1

/* RSN key types */
#define UMI_RSN_PAIRWISE_KEY            0
#define UMI_RSN_GROUP_KEY               1

/* RSN security event codes */
#define UMI_RSN_EVENT_TKIP_ICV_ERROR    0x0001
#define UMI_RSN_EVENT_TKIP_MIC_FAILURE  0x0002
#define UMI_RSN_EVENT_TKIP_REPLAY       0x0004
#define UMI_RSN_EVENT_CCMP_MIC_FAILURE  0x0008
#define UMI_RSN_EVENT_CCMP_REPLAY       0x0010
#define UMI_RSN_EVENT_REKEY_PACKETS     0x0020
#define UMI_RSN_EVENT_MASK              0x003f

/* RSN key index options */
#define UMI_RSN_USE_DEFAULT_KEY_INDEX   4
#define UMI_RSN_USE_PER_ASSOCIATION_KEY 5

/* Key management suite selectors */
#define UMI_RSN_KEY_MGMT_SUITE_802_1X      1
#define UMI_RSN_KEY_MGMT_SUITE_PRESHARED   2

/* General capability bit masks */
#define UMI_RSN_CAPS_PREAUTH_SUPPORTED     0x01
#define UMI_RSN_CAPS_DEFAULT_PAIWISE_KEY   0x02
#define UMI_RSN_CAPS_PTKSA_REPLAY_MASK     0x0C
#define UMI_RSN_CAPS_GTKSA_REPLAY_MASK     0x30
#define UMI_RSN_CAPS_PTKSA_REPLAY_SHIFT    2
#define UMI_RSN_CAPS_GTKSA_REPLAY_SHIFT    4

/* RSN modes */
#define UMI_RSN_MODE_SUPPORTED          1
#define UMI_RSN_MODE_UNSUPPORTED        0

/* RSN 802.1X station role */
#define UMI_RSN_AUTHENTICATOR           0
#define UMI_RSN_SUPPLICANT              1

/* RSN Cipher Suite selectors (as per 802.11i) */
#define UMI_RSN_CIPHER_SUITE_NONE       0
#define UMI_RSN_CIPHER_SUITE_WEP40      1
#define UMI_RSN_CIPHER_SUITE_TKIP       2
#define UMI_RSN_CIPHER_SUITE_WRAP       3
#define UMI_RSN_CIPHER_SUITE_CCMP       4
#define UMI_RSN_CIPHER_SUITE_WEP104     5

/* RSN field sizes */
#define UMI_RSN_IE_MAX_LEN              MIB_RSN_IE_MAX_LEN
#define UMI_RSN_SEQ_NUM_LEN             6
#define UMI_RSN_TK1_LEN                 16
#define UMI_RSN_TK2_LEN                 16

/* RSN_CAPS IE type fields */
#define UMI_RSN_CAPS_NONE                           0x00000000

/* Group Cipher Suites */
#define UMI_RSN_CAPS_GROUP_CIPHER_SUITE_MASK        0x0000003F
#define UMI_RSN_CAPS_GROUP_CIPHER_SUITE_NONE        0x00000001
#define UMI_RSN_CAPS_GROUP_CIPHER_SUITE_WEP40       0x00000002
#define UMI_RSN_CAPS_GROUP_CIPHER_SUITE_TKIP        0x00000004
#define UMI_RSN_CAPS_GROUP_CIPHER_SUITE_WRAP        0x00000008
#define UMI_RSN_CAPS_GROUP_CIPHER_SUITE_CCMP        0x00000010
#define UMI_RSN_CAPS_GROUP_CIPHER_SUITE_WEP104      0x00000020

/* Pairwise Cipher Suites */
#define UMI_RSN_CAPS_PAIRWISE_CIPHER_SUITE_MASK     0x00000FC0
#define UMI_RSN_CAPS_PAIRWISE_CIPHER_SUITE_NONE     0x00000040
#define UMI_RSN_CAPS_PAIRWISE_CIPHER_SUITE_WEP40    0x00000080
#define UMI_RSN_CAPS_PAIRWISE_CIPHER_SUITE_TKIP     0x00000100
#define UMI_RSN_CAPS_PAIRWISE_CIPHER_SUITE_WRAP     0x00000200
#define UMI_RSN_CAPS_PAIRWISE_CIPHER_SUITE_CCMP     0x00000400
#define UMI_RSN_CAPS_PAIRWISE_CIPHER_SUITE_WEP104   0x00000800

/* Authenticated Key Management Suites */
#define UMI_RSN_CAPS_AUTH_SUITE_MASK                0x00003000
#define UMI_RSN_CAPS_AUTH_SUITE_IEEE802_1X          0x00001000
#define UMI_RSN_CAPS_AUTH_SUITE_PRESHARED_KEY       0x00002000

/* General capabilities */
#define UMI_RSN_CAPS_GENERAL_CAPS_MASK              0x000FC000
#define UMI_RSN_CAPS_DEFAULT_GENERAL_CAPS           0x00000000
#define UMI_RSN_CAPS_PRE_AUTH_SUPPORTED             0x00004000
#define UMI_RSN_CAPS_USE_DEFAULT_PAIRWISE_KEY       0x00008000
#define UMI_RSN_CAPS_REPLAY_CNT_PW_MASK             0x00030000
#define UMI_RSN_CAPS_REPLAY_CNT_GP_MASK             0x000C0000
#define UMI_RSN_CAPS_REPLAY_CNT_PW_SHIFT            16
#define UMI_RSN_CAPS_REPLAY_CNT_GP_SHIFT            18
#define UMI_RSN_CAPS_REPLAY_CNT_PW_1                0x00000000
#define UMI_RSN_CAPS_REPLAY_CNT_PW_2                0x00010000
#define UMI_RSN_CAPS_REPLAY_CNT_PW_4                0x00020000
#define UMI_RSN_CAPS_REPLAY_CNT_PW_16               0x00030000
#define UMI_RSN_CAPS_REPLAY_CNT_GP_1                0x00000000
#define UMI_RSN_CAPS_REPLAY_CNT_GP_2                0x00040000
#define UMI_RSN_CAPS_REPLAY_CNT_GP_4                0x00080000
#define UMI_RSN_CAPS_REPLAY_CNT_GP_16               0x000C0000

/* Info Element type */
#define UMI_RSN_CAPS_IE_TYPE_MASK                   0x30000000
#define UMI_RSN_CAPS_IE_TYPE_IEEE                   0x10000000
#define UMI_RSN_CAPS_IE_TYPE_WECA                   0x20000000

/* RSN Info Element types */
#define UMI_RSN_IE_ID_IEEE              48
#define UMI_RSN_IE_ID_WECA              221


/* RSN Supported Versions */
#define UMI_RSN_IE_SUPPORTED_IEEE_VERSION               (1)
#define UMI_RSN_IE_SUPPORTED_WECA_VERSION               (1)

/* RSN Organisation identifiers */
#define UMI_RSN_OUI_IEEE_OCTET_0                        (0x00)
#define UMI_RSN_OUI_IEEE_OCTET_1                        (0x0F)
#define UMI_RSN_OUI_IEEE_OCTET_2                        (0xAC)

#define UMI_RSN_OUI_WECA_OCTET_0                        (0x00)
#define UMI_RSN_OUI_WECA_OCTET_1                        (0x50)
#define UMI_RSN_OUI_WECA_OCTET_2                        (0xF2)
#define UMI_RSN_OUI_WECA_TYPE_WPA                       (0x01)

/* RSN IE field sizes in octets */

/* RSN IE Header sizes */
#define UMI_RSN_IE_HEADER_LEN                           (2)
#define UMI_RSN_IE_ID_OFFSET                            (0)
#define UMI_RSN_IE_LENGTH_OFFSET                        (1)

/* RSN IE Payload sizes */
#define UMI_RSN_IE_VERSION_LEN                          (2)
#define UMI_RSN_IE_WECA_OUI_LEN                         (4)
#define UMI_RSN_IE_SUITE_SELECTOR_LEN                   (4)
#define UMI_RSN_IE_SUITE_COUNT_LEN                      (2)
#define UMI_RSN_IE_CAPABILITIES_LEN                     (2)
#define UMI_RSN_IE_PMKID_COUNT_LEN                      (2)
#define UMI_RSN_IE_PMKID_KEY_LEN                        (16)

/* Maximum allowable suite selectors */
#define UMI_RSN_IE_MAX_PAIRWISE_CIPHER_SUITES           (4)
#define UMI_RSN_IE_MAX_AUTH_SUITES                      (2)
#define UMI_RSN_IE_MAX_PMKIDS                           (2)  // TBD


/* PHY stuff */
#define UMI_SNR_VALUE_OFFSET            100
#define UMI_UWA_CLEARSTATS_CLEARALL_ID  0xFF


/* Message between the MC and UM have a header.  The MC only needs the position
   of the type field within the message and the length of the header.  All other
   elements of the header are unused in the LM */

struct UMI_MSG;

PREPACK typedef struct UMI_MSG
{
    struct UMI_MSG  *psNext;       /* Used to link list structures */
    uint8  u8Pad1;
    uint8  u8Persistent;
    uint16 u16MsgId;
    uint32 u32Pad2;
    uint8  abData[1];
} POSTPACK UMI_MSG;

PREPACK typedef struct UMI_MSG_HEADER
{
    UMI_MSG  *psNext;       /* Used to link list structures */
    uint8  u8Pad1;
    uint8  u8Persistent;
    uint16 u16MsgId;
    uint32 u32Pad2;
} POSTPACK UMI_MSG_HEADER;




/* See cm1290 for current breakdown of mailbox message buffer sizes */
#define UMI_MAN_BLOCK_SIZE 280
#define UMI_MAN_DATA_SIZE (UMI_MAN_BLOCK_SIZE - sizeof(UMI_MSG_HEADER))


#define UMI_DEBUG_BLOCK_SIZE 48
#define UMI_DEBUG_DATA_SIZE (UMI_DEBUG_BLOCK_SIZE-(sizeof(uint16)+sizeof(uint16)))



/* RSN Information Element */
#define UMI_RSN_IE MIB_RSN_IE_PARAMS


/* custom shorthand for representing RSN IE */
PREPACK typedef struct
{
    uint32  u32CapsMap;
} POSTPACK UMI_RSN_CAPS;

/* Frame information element */
PREPACK typedef struct {
    uint8      u8Code;     /* element code                              */
    uint8      u8Length;   /* Length of element (not inc hcode and len) */
    uint8      u8Data[1];  /* Start of variable len data                */
} POSTPACK   UMI_FM_ELEMENT;


/***************************************************************************/
/***                         Message IDs                                 ***/
/***************************************************************************/

#define UMI_MSG_ID_INVALID              (MSG_COMP_MASK | MSG_NUM_MASK)

/* message NULL reserved K_NULL_MSG  */

#define MC_MAN_READY_IND               0x3001 /*(MSG_IND + MSG_UMI_COMP + UMI_MAN_MSG + 1)*/
#define UM_MAN_READY_RES               0x2001 /*(MSG_RES + MSG_UMI_COMP + UMI_MAN_MSG + 1)*/

#define UM_MAN_SET_MIB_REQ             0x0002 /*(MSG_REQ + MSG_UMI_COMP + UMI_MAN_MSG + 2)*/
#define MC_MAN_SET_MIB_CFM             0x1002 /*(MSG_CFM + MSG_UMI_COMP + UMI_MAN_MSG + 2)*/

#define UM_MAN_GET_MIB_REQ             0x0003 /*(MSG_REQ + MSG_UMI_COMP + UMI_MAN_MSG + 3)*/
#define MC_MAN_GET_MIB_CFM             0x1003 /*(MSG_CFM + MSG_UMI_COMP + UMI_MAN_MSG + 3)*/

#define UM_MAN_SCAN_REQ                0x0004 /*(MSG_REQ + MSG_UMI_COMP + UMI_MAN_MSG + 4)*/
#define MC_MAN_SCAN_CFM                0x1004 /*(MSG_CFM + MSG_UMI_COMP + UMI_MAN_MSG + 4)*/
#define MC_MAN_SCAN_COMPLETE_IND       0x3004 /*(MSG_IND + MSG_UMI_COMP + UMI_MAN_MSG + 4)*/
#define UM_MAN_SCAN_COMPLETE_RES       0x2004 /*(MSG_RES + MSG_UMI_COMP + UMI_MAN_MSG + 4)*/

#define MC_MAN_BSS_FOUND_IND           0x3005 /*(MSG_IND + MSG_UMI_COMP + UMI_MAN_MSG + 5)*/
#define UM_MAN_BSS_FOUND_RES           0x2005 /*(MSG_RES + MSG_UMI_COMP + UMI_MAN_MSG + 5)*/

#define UM_MAN_ACTIVATE_REQ            0x0006 /*(MSG_REQ + MSG_UMI_COMP + UMI_MAN_MSG + 6)*/

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -