📄 wlan_lib.h
字号:
/*** $Id: wlan_lib.h 1.42 2004/07/21 11:29:12 whsu Exp $*//******************************************************************************Copyright (c) 2002-2003 Inprocomm, Inc.All rights reserved. Copying, compilation, modification, distributionor any other use whatsoever of this material is strictly prohibitedexcept in accordance with a Software License Agreement with Inprocomm, Inc.******************************************************************************/#ifndef __WLAN_LIB_H#define __WLAN_LIB_H/************************************************************************* C O M P I L E R F L A G S**************************************************************************//************************************************************************* E X T E R N A L R E F E R E N C E S**************************************************************************//************************************************************************* C O N S T A N T S**************************************************************************/#define PARAM_MAX_SSID_LEN 32#define PARAM_MAX_PHRASE_LEN 64#define PARAM_MAX_KEY_LEN 32#define PARAM_MAC_ADDR_LEN 6/* Define regulation domain for function param_set_regDomain() */#define MIB_REG_DOMAIN_FCC 0x10 /* FCC (US) */#define MIB_REG_DOMAIN_IC 0x20 /* IC or DOC (Canada) */#define MIB_REG_DOMAIN_ETSI 0x30 /* ETSI (Europe) */#define MIB_REG_DOMAIN_SPAIN 0x31 /* Spain */#define MIB_REG_DOMAIN_FRANCE 0x32 /* France */#define MIB_REG_DOMAIN_JAPAN_1 0x40 /* MPHPT (Japan) Channel */#define MIB_REG_DOMAIN_JAPAN_2 0x41 /* MPHPT (Japan) Channel *//* Define RF testing mode for function param_set_rftestMode() */#define RFTEST_MODE_STOP 0#define RFTEST_MODE_RX 1#define RFTEST_MODE_TONE 2#define RFTEST_MODE_BURST 3typedef enum { Legacy_Associated, TOTAL_AUTH_STAGE} param_auth_stage_t;/* Define authMode for function param_set_authmode() */typedef enum { AuthMode_OPEN = 0, AuthMode_SHARED = 1, AuthMode_SWITCH = 2, AuthMode_OPEN_1X = 3, AuthMode_WPA = 4, AuthMode_WPAPSK = 5} param_authMode_t;/* Define cipherMode for functions * param_set_cipherMode(), param_set_wds_cipherMode(). * Please note only CipherMode_NONE , CipherMode_WEP40, CipherMode_WEP104 = 5, * and CipherMode_WEP128 can be param_set_cipherMode's parameter. Because WPA has different * mechanism to do key negotiation, please do not use param_set_cipherMode() to set TKIP or CCMP. */typedef enum { CipherMode_NONE = 0, /* Disable */ CipherMode_WEP40 = 1, CipherMode_TKIP = 2, CipherMode_WRAP = 3, /* Not supported */ CipherMode_CCMP = 4, CipherMode_WEP104 = 5, CipherMode_WEP128 = 6} param_cipherMode_t;/* Define bit-map of basic rate set for function param_set_basicRateSet() * Default: BasicRate_1M | BasicRate_2M | BasicRate_5_5M | BasicRate_11M */typedef enum { BasicRate_1M = 0x0001, BasicRate_2M = 0x0002, BasicRate_5_5M = 0x0004, BasicRate_11M = 0x0008, BasicRate_6M = 0x0010, BasicRate_9M = 0x0020, BasicRate_12M = 0x0040, BasicRate_18M = 0x0080, BasicRate_24M = 0x0100, BasicRate_36M = 0x0200, BasicRate_48M = 0x0400, BasicRate_54M = 0x0800} param_basicRate_t;typedef enum { RelayMode_SWITCH = 0, RelayMode_SWITCH_NO_FORWARD = 1, RelayMode_DATA_PIPE = 2} param_relayMode_t;/************************************************************************* D A T A T Y P E S**************************************************************************/typedef struct param_ssid_s { char ssid[PARAM_MAX_SSID_LEN]; int len;} param_ssid_t;typedef struct param_cipher_key_s { int len; unsigned char key[PARAM_MAX_KEY_LEN];} param_cipher_key_t;typedef unsigned char param_mac_addr_t[PARAM_MAC_ADDR_LEN];typedef unsigned char param_passphrase_t[PARAM_MAX_PHRASE_LEN + 1];typedef union param_req {/* Basic AP */ param_ssid_t ssid; /* refer to param_ssid_t */ int bcnPeriod; /* 20 ~ 1000 */ int dtimPeriod; /* 1 ~ 10 */ int setChannel; /* 1 ~ 14 based on regulation domain */ int curChannel; int rtsThreshold; /* 0 ~ 2347 */ int fragThreshold; /* 0 ~ 2346 */ int basicRateSet; /* refer to param_basicRate_t */ int rateMode; /* 0: b+g, 1: g only, 2: b only *//* Extra function */ int bcastSSID; /* 0: disable, 1: enable */ int ctsProtect; /* 0:auto, 1: always, 2: none */ int dataRate; /* 1Mbps will be 1000000 */ int burstMode; /* 0: disable, 1: enable */ int noRelay; /* 0: disable, 1: enable */ param_mac_addr_t killmac;/* Security */ param_authMode_t authmode; /* refer to param_authMode_t */ param_cipherMode_t cipherMode; /* refer to param_cipherMode_t */ int DefaultKeyId; /* 0, 1, 2, 3 */ int wepKeyId; /* 0, 1, 2, 3 */ param_cipher_key_t wepKey; param_passphrase_t passphrase; /* string *//* WDS */ int noStation; /* 0: disable, 1: enable */ int wds_rateMode; /* 0: 802.11b, 1: 802.11g */ param_mac_addr_t wds_addmac; param_mac_addr_t wds_delmac; param_cipher_key_t wds_cipherKey; param_cipherMode_t wds_cipherMode; /* refer to param_cipherMode_t *//* Regulation and EMI */ int regDomain; /* refer to MIB_REG_DOMAIN_FCC */ int rftestMode; /* 0:stop, 1:rx, 2:tone, 3:burst */ int rftestPower; /* 0 ~ 255 */} param_req_t;typedef struct cmd_key_s { unsigned char keyId; /* 0 ~ 3 */ unsigned char cipherMode; /* param_cipherMode_t */ unsigned char keyLen; /* max 32 */ unsigned char key[32];} cmd_key_t;/* * Structure used by wlan to store the log. */struct net_stat{ unsigned long txunicastframes; unsigned long txmulticastframes; unsigned long txfragments; unsigned long txsingleretryframes; unsigned long txmultipleretryframes; unsigned long txretrylimitexceeded; unsigned long txdiscards; unsigned long txbytes; unsigned long rxmulticastframes; unsigned long rxbytes; unsigned long rxfragments ; unsigned long rxfcserrors; unsigned long rxdiscardsnobuffer; unsigned long rxdiscardswepundecr;};typedef struct sta_status_ { short aid; /* STA's unique AID (1 .. 2007) or */ /* 0 if not yet assigned */ unsigned char adAddr[6]; /* Address of associated station */ unsigned char auth_state; /* Station status */ unsigned char ps_state; /* Station power save status */ unsigned long assoc_time; /* Associated time in unit of ticks */} sta_status_t;/************************************************************************* P U B L I C D A T A**************************************************************************//* A string shows the version of IPN2220.o */extern char *ipn2220_drv_ver;/************************************************************************* M A C R O S**************************************************************************//************************************************************************* F U N C T I O N D E C L A R A T I O N S**************************************************************************//* IPN2220 HW initialization */extern int i2220ap_pci_probe(void *dev);/* Restore IPN2220 and free memory */extern void i2220ap_remove_pci(void *dev);/* Create private data structure */extern void *i2220ap_priv_create(void *pdev, void *netdev, unsigned long membase);/* Free private data structure */extern void i2220ap_priv_destroy(void *dev);/* Change MAC address */extern int i2220ap_set_mac_address(void *dev, unsigned char *new_mac);/* Packet transmission */extern int i2220ap_hard_start_xmit(void *netdev, void* skb);/* IPN2220 interrupt routine */extern int i2220hw_interrupt(void *dev_priv);/* Defer interrupt routine */extern void do_isr_tasklet(void *dev_priv);/* Periodic time out checking routine */extern void do_timer_check(void);/*======================================================== * Utilitis for WDS management *=======================================================*//* To determine if this dev is already the main device * presenting the WLAN adaptor */extern int is_main_device(void *dev);/* To determine if this MAC address is already register as the * remote Access Point. Return true if yes, false if no. */extern int is_wds_by_mac(void *dev, unsigned char *addr);/*======================================================== * Functions of get/set parameter (IOCTL config) *=======================================================*/
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -