aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/staging/rt2860/rtmp_def.h
diff options
context:
space:
mode:
authorBartlomiej Zolnierkiewicz <bzolnier@gmail.com>2009-09-22 14:44:07 -0400
committerGreg Kroah-Hartman <gregkh@suse.de>2009-12-11 15:21:44 -0500
commitca97b8388838ee9ea4b4bad04948f8f7f8a607a3 (patch)
tree2f45db84158e603cbde3871fb9f5137448ef6773 /drivers/staging/rt2860/rtmp_def.h
parent3441d25f03a078d493777f165194f8623ec2750f (diff)
Staging: rt28x0: updates from vendor's V2.1.0.0 drivers
Port changes from: * 2009_0420_RT2860_Linux_STA_V2.1.0.0 * 2009_0302_RT2870_Linux_STA_v2.1.0.0 * 2009_0525_RT3070_Linux_STA_v2.1.1.0 to in-kernel drivers. From the RT2860 driver release note: [2.1.0.0] 1. New generation schema for multiple OS porting 2. Fixed Ad-hoc ping failed in noisy environment. (Probe Response has too many retry packet then cause "not enough space in MgmtRing") 3. Fixed WPA(2)PSK issue when group cipher of AP is WEP40 or WEP104. 4. Modified iwpriv ra0 get_site_survey: In scan list result: Security shows "NONE" when AP is OPEN/NONE, shows "WEP" when AP is OPEN/WEP or SHARED/WEP, shows "WPAPSK(WPA2PSK)/TKIP(AES)" when AP is WPAPSK(WPA2PSK)/TKIP(AES) shows "WPA(WPA2)/TKIP(AES)" when AP is WPA(WPA2)/TKIP(AES) 5. Support kthread. 6. Add New A band channel list region 15 contains the whole channels in the A band region 4 and the new CE channel 167,169,171,173 7. Add New IEEE802.11r functionality. 8. Fixed WPA2-Enterprise failed when AP reboot or turn off then turn on. 9. Fixed STA cannot connect to 11B only AP when the setting of is PHY_11GN. From the RT2870 driver release note: [V2.1.0.0] 1. New generation schema for multiple OS porting. 2. Fixed Ad-hoc ping failed in noisy environment. (Probe Response has too many retry packet then cause "not enough space in MgmtRing"). 3. Fixed WPS failed with D-Link DIR-628 in 5GHz. 4. Change FastRoaming in DAT file to AutoRoaming. 5. Support kthread. 6. Add New A band channel list region 15 contains the whole channels in the A band region and the new CE channel 167,169,171,173. 7. New IEEE802.11r functionality. From the RT3070 driver release note: Version V2.1.1.0 1. Linux kernel 2.6.29 support. 2. Fix eFuse write from BIN file bug. Version 2.1.0.0 1. New generation schema for multiple OS porting 2. Fixed Ad-hoc ping failed in noisy environment. 3. Modified iwpriv ra0 get_site_survey: 4. Change FastRoaming in DAT file to AutoRoaming. 5. Support kthread. 6. New IEEE802.11r functionality. Tested with RT2860 and RT3070 chipsets. Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/staging/rt2860/rtmp_def.h')
-rw-r--r--drivers/staging/rt2860/rtmp_def.h289
1 files changed, 144 insertions, 145 deletions
diff --git a/drivers/staging/rt2860/rtmp_def.h b/drivers/staging/rt2860/rtmp_def.h
index f5fee57fbe3..e999710c02f 100644
--- a/drivers/staging/rt2860/rtmp_def.h
+++ b/drivers/staging/rt2860/rtmp_def.h
@@ -41,6 +41,15 @@
41 41
42#include "oid.h" 42#include "oid.h"
43 43
44#undef AP_WSC_INCLUDED
45#undef STA_WSC_INCLUDED
46#undef WSC_INCLUDED
47
48
49
50#if defined(AP_WSC_INCLUDED) || defined(STA_WSC_INCLUDED)
51#define WSC_INCLUDED
52#endif
44// 53//
45// Debug information verbosity: lower values indicate higher urgency 54// Debug information verbosity: lower values indicate higher urgency
46// 55//
@@ -54,55 +63,28 @@
54#define NIC_TAG ((ULONG)'0682') 63#define NIC_TAG ((ULONG)'0682')
55#define NIC_DBG_STRING ("**RT28xx**") 64#define NIC_DBG_STRING ("**RT28xx**")
56 65
66#ifdef RTMP_MAC_USB
67#define TX_RING_SIZE 8 // 1
68#define PRIO_RING_SIZE 8
69#define MGMT_RING_SIZE 32 // PRIO_RING_SIZE
70#define RX_RING_SIZE 8
71#define MAX_TX_PROCESS 4
72#define LOCAL_TXBUF_SIZE 2048
73#endif // RTMP_MAC_USB //
74
75//#define PACKED
76
57#define RALINK_2883_VERSION ((UINT32)0x28830300) 77#define RALINK_2883_VERSION ((UINT32)0x28830300)
58#define RALINK_2880E_VERSION ((UINT32)0x28720200) 78#define RALINK_2880E_VERSION ((UINT32)0x28720200)
59#define RALINK_3070_VERSION ((UINT32)0x30700200) 79#define RALINK_3070_VERSION ((UINT32)0x30700200)
60 80
61//
62// NDIS version in use by the NIC driver.
63// The high byte is the major version. The low byte is the minor version.
64//
65#ifdef NDIS51_MINIPORT
66#define NIC_DRIVER_VERSION 0x0501
67#else
68#define NIC_DRIVER_VERSION 0x0500
69#endif
70
71//
72// NDIS media type, current is ethernet, change if native wireless supported
73//
74#define NIC_MEDIA_TYPE NdisMedium802_3
75#define NIC_PCI_HDR_LENGTH 0xe2
76#define NIC_MAX_PACKET_SIZE 2304
77#define NIC_HEADER_SIZE 14
78#define MAX_MAP_REGISTERS_NEEDED 32
79#define MIN_MAP_REGISTERS_NEEDED 2 //Todo: should consider fragment issue.
80
81//
82// interface type, we use PCI
83//
84#define NIC_INTERFACE_TYPE NdisInterfacePci
85#define NIC_INTERRUPT_MODE NdisInterruptLevelSensitive
86
87//
88// buffer size passed in NdisMQueryAdapterResources
89// We should only need three adapter resources (IO, interrupt and memory),
90// Some devices get extra resources, so have room for 10 resources
91// UF_SIZE (sizeof(NDIS_RESOURCE_LIST) + (10*sizeof(CM_PARTIAL_RESOURCE_DESCRIPTOR)))
92
93
94#define NIC_RESOURCE_B//
95// IO space length
96//
97#define NIC_MAP_IOSPACE_LENGTH sizeof(CSR_STRUC)
98
99#define MAX_RX_PKT_LEN 1520 81#define MAX_RX_PKT_LEN 1520
100 82
101// 83//
102// Entry number for each DMA descriptor ring 84// Entry number for each DMA descriptor ring
103// 85//
104 86
105#ifdef RT2860 87#ifdef RTMP_MAC_PCI
106#define TX_RING_SIZE 64 //64 88#define TX_RING_SIZE 64 //64
107#define MGMT_RING_SIZE 128 89#define MGMT_RING_SIZE 128
108#define RX_RING_SIZE 128 //64 90#define RX_RING_SIZE 128 //64
@@ -110,15 +92,7 @@
110#define MAX_DMA_DONE_PROCESS TX_RING_SIZE 92#define MAX_DMA_DONE_PROCESS TX_RING_SIZE
111#define MAX_TX_DONE_PROCESS TX_RING_SIZE //8 93#define MAX_TX_DONE_PROCESS TX_RING_SIZE //8
112#define LOCAL_TXBUF_SIZE 2 94#define LOCAL_TXBUF_SIZE 2
113#endif 95#endif // RTMP_MAC_PCI //
114#ifdef RT2870
115#define TX_RING_SIZE 8 // 1
116#define PRIO_RING_SIZE 8
117#define MGMT_RING_SIZE 32 // PRIO_RING_SIZE
118#define RX_RING_SIZE 8
119#define MAX_TX_PROCESS 4
120#define LOCAL_TXBUF_SIZE 2048
121#endif // RT2870 //
122 96
123#define MAX_RX_PROCESS 128 //64 //32 97#define MAX_RX_PROCESS 128 //64 //32
124#define NUM_OF_LOCAL_TXBUF 2 98#define NUM_OF_LOCAL_TXBUF 2
@@ -143,16 +117,43 @@
143#define MAX_RX_PROCESS_CNT (RX_RING_SIZE) 117#define MAX_RX_PROCESS_CNT (RX_RING_SIZE)
144 118
145 119
120/*
121 WMM Note: If memory of your system is not much, please reduce the definition;
122 or when you do WMM test, the queue for low priority AC will be full, i.e.
123 TX_RING_SIZE + MAX_PACKETS_IN_QUEUE packets for the AC will be buffered in
124 WLAN, maybe no any packet buffer can be got in Ethernet driver.
125
126 Sometimes no packet buffer can be got in Ethernet driver, the system will
127 send flow control packet to the sender to slow down its sending rate.
128 So no WMM can be saw in the air.
129*/
130
131/*
132 Need to use 64 in vxworks for test case WMM A5-T07
133 Two dnlink (10Mbps) from a WMM station to a non-WMM station.
134 If use 256, queue is not enough.
135 And in rt_main_end.c, clConfig.clNum = RX_RING_SIZE * 3; is changed to
136 clConfig.clNum = RX_RING_SIZE * 4;
137*/
138// TODO: For VxWorks the size is 256. Shall we cahnge the value as 256 for all OS?????
146#define MAX_PACKETS_IN_QUEUE (512) //(512) // to pass WMM A5-WPAPSK 139#define MAX_PACKETS_IN_QUEUE (512) //(512) // to pass WMM A5-WPAPSK
140
147#define MAX_PACKETS_IN_MCAST_PS_QUEUE 32 141#define MAX_PACKETS_IN_MCAST_PS_QUEUE 32
148#define MAX_PACKETS_IN_PS_QUEUE 128 //32 142#define MAX_PACKETS_IN_PS_QUEUE 128 //32
149#define WMM_NUM_OF_AC 4 /* AC0, AC1, AC2, and AC3 */ 143#define WMM_NUM_OF_AC 4 /* AC0, AC1, AC2, and AC3 */
150 144
145
146#ifdef RTMP_EFUSE_SUPPORT
147//2008/09/11:KH add to support efuse<--
151#define MAX_EEPROM_BIN_FILE_SIZE 1024 148#define MAX_EEPROM_BIN_FILE_SIZE 1024
149#define EFUSE_BUFFER_PATH "/tmp/RT30xxEEPROM.bin"
150//2008/09/11:KH add to support efuse-->
151#endif // RTMP_EFUSE_SUPPORT //
152 152
153// RxFilter 153// RxFilter
154#define STANORMAL 0x17f97 154#define STANORMAL 0x17f97
155#define APNORMAL 0x15f97 155#define APNORMAL 0x15f97
156#define PSPXLINK 0x17f93
156// 157//
157// RTMP_ADAPTER flags 158// RTMP_ADAPTER flags
158// 159//
@@ -203,9 +204,9 @@
203#define fOP_STATUS_TX_AMSDU_INUSED 0x00002000 204#define fOP_STATUS_TX_AMSDU_INUSED 0x00002000
204#define fOP_STATUS_MAX_RETRY_ENABLED 0x00004000 205#define fOP_STATUS_MAX_RETRY_ENABLED 0x00004000
205#define fOP_STATUS_WAKEUP_NOW 0x00008000 206#define fOP_STATUS_WAKEUP_NOW 0x00008000
206#define fOP_STATUS_ADVANCE_POWER_SAVE_PCIE_DEVICE 0x00020000 207#define fOP_STATUS_PCIE_DEVICE 0x00020000
208#define fOP_STATUS_ADVANCE_POWER_SAVE_PCIE_DEVICE fOP_STATUS_PCIE_DEVICE
207 209
208#ifdef RT2860
209// 210//
210// RTMP_ADAPTER PSFlags : related to advanced power save. 211// RTMP_ADAPTER PSFlags : related to advanced power save.
211// 212//
@@ -218,7 +219,8 @@
218// Indicate driver should IMMEDIATELY fo to sleep after receiving AP's beacon in which doesn't indicate unicate nor multicast packets for me 219// Indicate driver should IMMEDIATELY fo to sleep after receiving AP's beacon in which doesn't indicate unicate nor multicast packets for me
219//. This flag is used ONLY in RTMPHandleRxDoneInterrupt routine. 220//. This flag is used ONLY in RTMPHandleRxDoneInterrupt routine.
220#define fRTMP_PS_GO_TO_SLEEP_NOW 0x00000008 221#define fRTMP_PS_GO_TO_SLEEP_NOW 0x00000008
221#endif 222#define fRTMP_PS_TOGGLE_L1 0x00000010 // Use Toggle L1 mechanism for rt28xx PCIe
223
222 224
223#define CCKSETPROTECT 0x1 225#define CCKSETPROTECT 0x1
224#define OFDMSETPROTECT 0x2 226#define OFDMSETPROTECT 0x2
@@ -266,6 +268,7 @@
266#define fRX_FILTER_ACCEPT_MULTICAST NDIS_PACKET_TYPE_MULTICAST 268#define fRX_FILTER_ACCEPT_MULTICAST NDIS_PACKET_TYPE_MULTICAST
267#define fRX_FILTER_ACCEPT_BROADCAST NDIS_PACKET_TYPE_BROADCAST 269#define fRX_FILTER_ACCEPT_BROADCAST NDIS_PACKET_TYPE_BROADCAST
268#define fRX_FILTER_ACCEPT_ALL_MULTICAST NDIS_PACKET_TYPE_ALL_MULTICAST 270#define fRX_FILTER_ACCEPT_ALL_MULTICAST NDIS_PACKET_TYPE_ALL_MULTICAST
271#define fRX_FILTER_ACCEPT_PROMISCUOUS NDIS_PACKET_TYPE_PROMISCUOUS
269 272
270// 273//
271// Error code section 274// Error code section
@@ -321,17 +324,15 @@
321#define MAX_APCLI_NUM 0 324#define MAX_APCLI_NUM 0
322 325
323#define MAX_MBSSID_NUM 1 326#define MAX_MBSSID_NUM 1
324#if defined(RT2860) || defined(RT30xx)
325#ifdef MBSS_SUPPORT 327#ifdef MBSS_SUPPORT
326#undef MAX_MBSSID_NUM 328#undef MAX_MBSSID_NUM
327#define MAX_MBSSID_NUM (8 - MAX_MESH_NUM - MAX_APCLI_NUM) 329#define MAX_MBSSID_NUM (8 - MAX_MESH_NUM - MAX_APCLI_NUM)
328#endif // MBSS_SUPPORT // 330#endif // MBSS_SUPPORT //
329#endif
330 331
331/* sanity check for apidx */ 332/* sanity check for apidx */
332#define MBSS_MR_APIDX_SANITY_CHECK(apidx) \ 333#define MBSS_MR_APIDX_SANITY_CHECK(apidx) \
333 { if (apidx > MAX_MBSSID_NUM) { \ 334 { if (apidx > MAX_MBSSID_NUM) { \
334 printk("%s> Error! apidx = %d > MAX_MBSSID_NUM!\n", __func__, apidx); \ 335 DBGPRINT(RT_DEBUG_ERROR, ("%s> Error! apidx = %d > MAX_MBSSID_NUM!\n", __func__, apidx)); \
335 apidx = MAIN_MBSSID; } } 336 apidx = MAIN_MBSSID; } }
336 337
337#define VALID_WCID(_wcid) ((_wcid) > 0 && (_wcid) < MAX_LEN_OF_MAC_TABLE ) 338#define VALID_WCID(_wcid) ((_wcid) > 0 && (_wcid) < MAX_LEN_OF_MAC_TABLE )
@@ -397,6 +398,7 @@
397#define HASH_TABLE_SIZE 256 398#define HASH_TABLE_SIZE 256
398#define MAX_VIE_LEN 1024 // New for WPA cipher suite variable IE sizes. 399#define MAX_VIE_LEN 1024 // New for WPA cipher suite variable IE sizes.
399#define MAX_SUPPORT_MCS 32 400#define MAX_SUPPORT_MCS 32
401#define MAX_NUM_OF_BBP_LATCH 140
400 402
401//============================================================ 403//============================================================
402// ASIC WCID Table definition. 404// ASIC WCID Table definition.
@@ -515,6 +517,9 @@
515#define MLME_QOS_UNSPECIFY 32 517#define MLME_QOS_UNSPECIFY 32
516#define MLME_REQUEST_DECLINED 37 518#define MLME_REQUEST_DECLINED 37
517#define MLME_REQUEST_WITH_INVALID_PARAM 38 519#define MLME_REQUEST_WITH_INVALID_PARAM 38
520#define MLME_INVALID_GROUP_CIPHER 41
521#define MLME_INVALID_PAIRWISE_CIPHER 42
522#define MLME_INVALID_AKMP 43
518#define MLME_DLS_NOT_ALLOW_IN_QBSS 48 523#define MLME_DLS_NOT_ALLOW_IN_QBSS 48
519#define MLME_DEST_STA_NOT_IN_QBSS 49 524#define MLME_DEST_STA_NOT_IN_QBSS 49
520#define MLME_DEST_STA_IS_NOT_A_QSTA 50 525#define MLME_DEST_STA_IS_NOT_A_QSTA 50
@@ -569,6 +574,7 @@
569// For 802.11n D3.03 574// For 802.11n D3.03
570//#define IE_NEW_EXT_CHA_OFFSET 62 // 802.11n d1. New extension channel offset elemet 575//#define IE_NEW_EXT_CHA_OFFSET 62 // 802.11n d1. New extension channel offset elemet
571#define IE_SECONDARY_CH_OFFSET 62 // 802.11n D3.03 Secondary Channel Offset element 576#define IE_SECONDARY_CH_OFFSET 62 // 802.11n D3.03 Secondary Channel Offset element
577#define IE_WAPI 68 // WAPI information element
572#define IE_2040_BSS_COEXIST 72 // 802.11n D3.0.3 578#define IE_2040_BSS_COEXIST 72 // 802.11n D3.0.3
573#define IE_2040_BSS_INTOLERANT_REPORT 73 // 802.11n D3.03 579#define IE_2040_BSS_INTOLERANT_REPORT 73 // 802.11n D3.03
574#define IE_OVERLAPBSS_SCAN_PARM 74 // 802.11n D3.03 580#define IE_OVERLAPBSS_SCAN_PARM 74 // 802.11n D3.03
@@ -605,17 +611,22 @@
605#define SYNC_STATE_MACHINE 4 611#define SYNC_STATE_MACHINE 4
606#define MLME_CNTL_STATE_MACHINE 5 612#define MLME_CNTL_STATE_MACHINE 5
607#define WPA_PSK_STATE_MACHINE 6 613#define WPA_PSK_STATE_MACHINE 6
608#define LEAP_STATE_MACHINE 7 614//#define LEAP_STATE_MACHINE 7
609#define AIRONET_STATE_MACHINE 8 615#define AIRONET_STATE_MACHINE 8
610#define ACTION_STATE_MACHINE 9 616#define ACTION_STATE_MACHINE 9
611 617
612// AP MLME state machines 618// AP MLME state machines
613#define AP_ASSOC_STATE_MACHINE 11 619#define AP_ASSOC_STATE_MACHINE 11
614#define AP_AUTH_STATE_MACHINE 12 620#define AP_AUTH_STATE_MACHINE 12
615#define AP_AUTH_RSP_STATE_MACHINE 13
616#define AP_SYNC_STATE_MACHINE 14 621#define AP_SYNC_STATE_MACHINE 14
617#define AP_CNTL_STATE_MACHINE 15 622#define AP_CNTL_STATE_MACHINE 15
618#define AP_WPA_STATE_MACHINE 16 623#define WSC_STATE_MACHINE 17
624#define WSC_UPNP_STATE_MACHINE 18
625
626
627#define WPA_STATE_MACHINE 23
628
629
619 630
620// 631//
621// STA's CONTROL/CONNECT state machine: states, events, total function # 632// STA's CONTROL/CONNECT state machine: states, events, total function #
@@ -630,9 +641,9 @@
630#define CNTL_WAIT_AUTH2 7 641#define CNTL_WAIT_AUTH2 7
631#define CNTL_WAIT_OID_LIST_SCAN 8 642#define CNTL_WAIT_OID_LIST_SCAN 8
632#define CNTL_WAIT_OID_DISASSOC 9 643#define CNTL_WAIT_OID_DISASSOC 9
633#ifdef RT2870 644#ifdef RTMP_MAC_USB
634#define CNTL_WAIT_SCAN_FOR_CONNECT 10 645#define CNTL_WAIT_SCAN_FOR_CONNECT 10
635#endif // RT2870 // 646#endif // RTMP_MAC_USB //
636 647
637#define MT2_ASSOC_CONF 34 648#define MT2_ASSOC_CONF 34
638#define MT2_AUTH_CONF 35 649#define MT2_AUTH_CONF 35
@@ -646,6 +657,7 @@
646#define MT2_GET_CONF 43 657#define MT2_GET_CONF 43
647#define MT2_SET_CONF 44 658#define MT2_SET_CONF 44
648#define MT2_RESET_CONF 45 659#define MT2_RESET_CONF 45
660#define MT2_FT_OTD_CONF 46
649#define MT2_MLME_ROAMING_REQ 52 661#define MT2_MLME_ROAMING_REQ 52
650 662
651#define CNTL_FUNC_SIZE 1 663#define CNTL_FUNC_SIZE 1
@@ -691,8 +703,11 @@
691#define MT2_PEER_BA_CATE 3 703#define MT2_PEER_BA_CATE 3
692#define MT2_PEER_PUBLIC_CATE 4 704#define MT2_PEER_PUBLIC_CATE 4
693#define MT2_PEER_RM_CATE 5 705#define MT2_PEER_RM_CATE 5
706/* "FT_CATEGORY_BSS_TRANSITION equal to 6" is defined file of "dot11r_ft.h" */
694#define MT2_PEER_HT_CATE 7 // 7.4.7 707#define MT2_PEER_HT_CATE 7 // 7.4.7
695#define MAX_PEER_CATE_MSG 7 708#define MAX_PEER_CATE_MSG 7
709
710
696#define MT2_MLME_ADD_BA_CATE 8 711#define MT2_MLME_ADD_BA_CATE 8
697#define MT2_MLME_ORI_DELBA_CATE 9 712#define MT2_MLME_ORI_DELBA_CATE 9
698#define MT2_MLME_REC_DELBA_CATE 10 713#define MT2_MLME_REC_DELBA_CATE 10
@@ -822,35 +837,8 @@
822#define DLS_FUNC_SIZE (MAX_DLS_STATE * MAX_DLS_MSG) 837#define DLS_FUNC_SIZE (MAX_DLS_STATE * MAX_DLS_MSG)
823 838
824// 839//
825// STA's WPA-PSK State machine: states, events, total function # 840// WSC State machine: states, events, total function #
826// 841//
827#define WPA_PSK_IDLE 0
828#define MAX_WPA_PSK_STATE 1
829
830#define WPA_MACHINE_BASE 0
831#define MT2_EAPPacket 0
832#define MT2_EAPOLStart 1
833#define MT2_EAPOLLogoff 2
834#define MT2_EAPOLKey 3
835#define MT2_EAPOLASFAlert 4
836#define MAX_WPA_PSK_MSG 5
837
838#define WPA_PSK_FUNC_SIZE (MAX_WPA_PSK_STATE * MAX_WPA_PSK_MSG)
839
840//
841// STA's CISCO-AIRONET State machine: states, events, total function #
842//
843#define AIRONET_IDLE 0
844#define AIRONET_SCANNING 1
845#define MAX_AIRONET_STATE 2
846
847#define AIRONET_MACHINE_BASE 0
848#define MT2_AIRONET_MSG 0
849#define MT2_AIRONET_SCAN_REQ 1
850#define MT2_AIRONET_SCAN_DONE 2
851#define MAX_AIRONET_MSG 3
852
853#define AIRONET_FUNC_SIZE (MAX_AIRONET_STATE * MAX_AIRONET_MSG)
854 842
855// 843//
856// AP's CONTROL/CONNECT state machine: states, events, total function # 844// AP's CONTROL/CONNECT state machine: states, events, total function #
@@ -882,23 +870,12 @@
882#define AP_AUTH_MACHINE_BASE 0 870#define AP_AUTH_MACHINE_BASE 0
883#define APMT2_MLME_DEAUTH_REQ 0 871#define APMT2_MLME_DEAUTH_REQ 0
884#define APMT2_CLS2ERR 1 872#define APMT2_CLS2ERR 1
885#define AP_MAX_AUTH_MSG 2
886
887#define AP_AUTH_FUNC_SIZE (AP_MAX_AUTH_STATE * AP_MAX_AUTH_MSG)
888
889//
890// AP's AUTH-RSP state machine: states, events, total function #
891//
892#define AP_AUTH_RSP_IDLE 0
893#define AP_MAX_AUTH_RSP_STATE 1
894
895#define AP_AUTH_RSP_MACHINE_BASE 0
896#define APMT2_AUTH_CHALLENGE_TIMEOUT 0
897#define APMT2_PEER_AUTH_ODD 1
898#define APMT2_PEER_DEAUTH 2 873#define APMT2_PEER_DEAUTH 2
899#define AP_MAX_AUTH_RSP_MSG 3 874#define APMT2_PEER_AUTH_REQ 3
875#define APMT2_PEER_AUTH_CONFIRM 4
876#define AP_MAX_AUTH_MSG 5
900 877
901#define AP_AUTH_RSP_FUNC_SIZE (AP_MAX_AUTH_RSP_STATE * AP_MAX_AUTH_RSP_MSG) 878#define AP_AUTH_FUNC_SIZE (AP_MAX_AUTH_STATE * AP_MAX_AUTH_MSG)
902 879
903// 880//
904// AP's SYNC state machine: states, events, total function # 881// AP's SYNC state machine: states, events, total function #
@@ -919,20 +896,22 @@
919#define AP_SYNC_FUNC_SIZE (AP_MAX_SYNC_STATE * AP_MAX_SYNC_MSG) 896#define AP_SYNC_FUNC_SIZE (AP_MAX_SYNC_STATE * AP_MAX_SYNC_MSG)
920 897
921// 898//
922// AP's WPA state machine: states, events, total function # 899// Common WPA state machine: states, events, total function #
923// 900//
924#define AP_WPA_PTK 0 901#define WPA_PTK 0
925#define AP_MAX_WPA_PTK_STATE 1 902#define MAX_WPA_PTK_STATE 1
903
904#define WPA_MACHINE_BASE 0
905#define MT2_EAPPacket 0
906#define MT2_EAPOLStart 1
907#define MT2_EAPOLLogoff 2
908#define MT2_EAPOLKey 3
909#define MT2_EAPOLASFAlert 4
910#define MAX_WPA_MSG 5
911
912#define WPA_FUNC_SIZE (MAX_WPA_PTK_STATE * MAX_WPA_MSG)
926 913
927#define AP_WPA_MACHINE_BASE 0
928#define APMT2_EAPPacket 0
929#define APMT2_EAPOLStart 1
930#define APMT2_EAPOLLogoff 2
931#define APMT2_EAPOLKey 3
932#define APMT2_EAPOLASFAlert 4
933#define AP_MAX_WPA_MSG 5
934 914
935#define AP_WPA_FUNC_SIZE (AP_MAX_WPA_PTK_STATE * AP_MAX_WPA_MSG)
936 915
937// ============================================================================= 916// =============================================================================
938 917
@@ -1178,12 +1157,16 @@
1178#define REGION_4_A_BAND 4 // 149, 153, 157, 161, 165 1157#define REGION_4_A_BAND 4 // 149, 153, 157, 161, 165
1179#define REGION_5_A_BAND 5 // 149, 153, 157, 161 1158#define REGION_5_A_BAND 5 // 149, 153, 157, 161
1180#define REGION_6_A_BAND 6 // 36, 40, 44, 48 1159#define REGION_6_A_BAND 6 // 36, 40, 44, 48
1181#define REGION_7_A_BAND 7 // 36, 40, 44, 48, 52, 56, 60, 64, 100, 104, 108, 112, 116, 120, 124, 128, 132, 136, 140, 149, 153, 157, 161, 165 1160#define REGION_7_A_BAND 7 // 36, 40, 44, 48, 52, 56, 60, 64, 100, 104, 108, 112, 116, 120, 124, 128, 132, 136, 140, 149, 153, 157, 161, 165, 169, 173
1182#define REGION_8_A_BAND 8 // 52, 56, 60, 64 1161#define REGION_8_A_BAND 8 // 52, 56, 60, 64
1183#define REGION_9_A_BAND 9 // 36, 40, 44, 48, 52, 56, 60, 64, 100, 104, 108, 112, 116, 132, 136, 140, 149, 153, 157, 161, 165 1162#define REGION_9_A_BAND 9 // 36, 40, 44, 48, 52, 56, 60, 64, 100, 104, 108, 112, 116, 132, 136, 140, 149, 153, 157, 161, 165
1184#define REGION_10_A_BAND 10 // 36, 40, 44, 48, 149, 153, 157, 161, 165 1163#define REGION_10_A_BAND 10 // 36, 40, 44, 48, 149, 153, 157, 161, 165
1185#define REGION_11_A_BAND 11 // 36, 40, 44, 48, 52, 56, 60, 64, 100, 104, 108, 112, 116, 120, 149, 153, 157, 161 1164#define REGION_11_A_BAND 11 // 36, 40, 44, 48, 52, 56, 60, 64, 100, 104, 108, 112, 116, 120, 149, 153, 157, 161
1186#define REGION_MAXIMUM_A_BAND 11 1165#define REGION_12_A_BAND 12 // 36, 40, 44, 48, 52, 56, 60, 64, 100, 104, 108, 112, 116, 120, 124, 128, 132, 136, 140
1166#define REGION_13_A_BAND 13 // 52, 56, 60, 64, 100, 104, 108, 112, 116, 120, 124, 128, 132, 136, 140, 149, 153, 157, 161
1167#define REGION_14_A_BAND 14 // 36, 40, 44, 48, 52, 56, 60, 64, 100, 104, 108, 112, 116, 136, 140, 149, 153, 157, 161, 165
1168#define REGION_15_A_BAND 15 // 149, 153, 157, 161, 165, 169, 173
1169#define REGION_MAXIMUM_A_BAND 15
1187 1170
1188// pTxD->CipherAlg 1171// pTxD->CipherAlg
1189#define CIPHER_NONE 0 1172#define CIPHER_NONE 0
@@ -1196,15 +1179,6 @@
1196#define CIPHER_TKIP_NO_MIC 7 // MIC appended by driver: not a valid value in hardware key table 1179#define CIPHER_TKIP_NO_MIC 7 // MIC appended by driver: not a valid value in hardware key table
1197#define CIPHER_SMS4 8 1180#define CIPHER_SMS4 8
1198 1181
1199// value domain of pAd->RfIcType
1200#define RFIC_2820 1 // 2.4G 2T3R
1201#define RFIC_2850 2 // 2.4G/5G 2T3R
1202#define RFIC_2720 3 // 2.4G 1T2R
1203#define RFIC_2750 4 // 2.4G/5G 1T2R
1204#define RFIC_3020 5 // 2.4G 1T1R
1205#define RFIC_2020 6 // 2.4G B/G
1206#define RFIC_3021 7 // 2.4G 1T2R
1207#define RFIC_3022 8 // 2.4G 2T2R
1208 1182
1209// LED Status. 1183// LED Status.
1210#define LED_LINK_DOWN 0 1184#define LED_LINK_DOWN 0
@@ -1219,7 +1193,8 @@
1219// value domain of pAd->LedCntl.LedMode and E2PROM 1193// value domain of pAd->LedCntl.LedMode and E2PROM
1220#define LED_MODE_DEFAULT 0 1194#define LED_MODE_DEFAULT 0
1221#define LED_MODE_TWO_LED 1 1195#define LED_MODE_TWO_LED 1
1222#define LED_MODE_SIGNAL_STREGTH 8 // EEPROM define =8 1196//#define LED_MODE_SIGNAL_STREGTH 8 // EEPROM define =8
1197#define LED_MODE_SIGNAL_STREGTH 0x40 // EEPROM define = 64
1223 1198
1224// RC4 init value, used fro WEP & TKIP 1199// RC4 init value, used fro WEP & TKIP
1225#define PPPINITFCS32 0xffffffff /* Initial FCS value */ 1200#define PPPINITFCS32 0xffffffff /* Initial FCS value */
@@ -1305,7 +1280,12 @@
1305#define INT_APCLI 0x0400 1280#define INT_APCLI 0x0400
1306#define INT_MESH 0x0500 1281#define INT_MESH 0x0500
1307 1282
1308// Use bitmap to allow coexist of ATE_TXFRAME and ATE_RXFRAME(i.e.,to support LoopBack mode) 1283#define INF_MAIN_DEV_NAME "wlan"
1284#define INF_MBSSID_DEV_NAME "ra"
1285#define INF_WDS_DEV_NAME "wds"
1286#define INF_APCLI_DEV_NAME "apcli"
1287#define INF_MESH_DEV_NAME "mesh"
1288
1309 1289
1310// WEP Key TYPE 1290// WEP Key TYPE
1311#define WEP_HEXADECIMAL_TYPE 0 1291#define WEP_HEXADECIMAL_TYPE 0
@@ -1380,7 +1360,7 @@
1380#define MAX_NUM_OF_INIT_DLS_ENTRY 1 1360#define MAX_NUM_OF_INIT_DLS_ENTRY 1
1381#define MAX_NUM_OF_DLS_ENTRY MAX_NUMBER_OF_DLS_ENTRY 1361#define MAX_NUM_OF_DLS_ENTRY MAX_NUMBER_OF_DLS_ENTRY
1382 1362
1383//Block ACK , rt2860, kathy 1363//Block ACK, kathy
1384#define MAX_TX_REORDERBUF 64 1364#define MAX_TX_REORDERBUF 64
1385#define MAX_RX_REORDERBUF 64 1365#define MAX_RX_REORDERBUF 64
1386#define DEFAULT_TX_TIMEOUT 30 1366#define DEFAULT_TX_TIMEOUT 30
@@ -1392,29 +1372,13 @@
1392#define IW_ESSID_MAX_SIZE 32 1372#define IW_ESSID_MAX_SIZE 32
1393#endif 1373#endif
1394 1374
1395#ifdef MCAST_RATE_SPECIFIC
1396#define MCAST_DISABLE 0
1397#define MCAST_CCK 1
1398#define MCAST_OFDM 2
1399#define MCAST_HTMIX 3
1400#endif // MCAST_RATE_SPECIFIC //
1401
1402#ifdef RT2860
1403// For AsicRadioOff/AsicRadioOn/AsicForceWakeup function
1404// This is to indicate from where to call this function.
1405#define DOT11POWERSAVE 0 // TO do .11 power save sleep
1406#define GUIRADIO_OFF 1 // To perform Radio OFf command from GUI
1407#define RTMP_HALT 2 // Called from Halt handler.
1408#define GUI_IDLE_POWER_SAVE 3 // Call to sleep before link up with AP
1409#define FROM_TX 4 // Force wake up from Tx packet.
1410#endif
1411#ifdef RT2870
1412// For AsicRadioOff/AsicRadioOn function 1375// For AsicRadioOff/AsicRadioOn function
1413#define DOT11POWERSAVE 0 1376#define DOT11POWERSAVE 0
1414#define GUIRADIO_OFF 1 1377#define GUIRADIO_OFF 1
1415#define RTMP_HALT 2 1378#define RTMP_HALT 2
1416#define GUI_IDLE_POWER_SAVE 3 1379#define GUI_IDLE_POWER_SAVE 3
1417#endif 1380// --
1381
1418 1382
1419// definition for WpaSupport flag 1383// definition for WpaSupport flag
1420#define WPA_SUPPLICANT_DISABLE 0 1384#define WPA_SUPPLICANT_DISABLE 0
@@ -1458,6 +1422,41 @@
1458#define cpu2be16(x) SWAP16((x)) 1422#define cpu2be16(x) SWAP16((x))
1459#define be2cpu16(x) SWAP16((x)) 1423#define be2cpu16(x) SWAP16((x))
1460 1424
1425
1426#define ABS(_x, _y) ((_x) > (_y)) ? ((_x) -(_y)) : ((_y) -(_x))
1427
1428
1429#define A2Dec(_X, _p) \
1430{ \
1431 UCHAR *p; \
1432 _X = 0; \
1433 p = _p; \
1434 while (((*p >= '0') && (*p <= '9'))) \
1435 { \
1436 if ((*p >= '0') && (*p <= '9')) \
1437 _X = _X * 10 + *p - 48; \
1438 p++; \
1439 } \
1440}
1441
1442
1443#define A2Hex(_X, _p) \
1444do{ \
1445 char *__p; \
1446 (_X) = 0; \
1447 __p = (char *)(_p); \
1448 while (((*__p >= 'a') && (*__p <= 'f')) || ((*__p >= 'A') && (*__p <= 'F')) || ((*__p >= '0') && (*__p <= '9'))) \
1449 { \
1450 if ((*__p >= 'a') && (*__p <= 'f')) \
1451 (_X) = (_X) * 16 + *__p - 87; \
1452 else if ((*__p >= 'A') && (*__p <= 'F')) \
1453 (_X) = (_X) * 16 + *__p - 55; \
1454 else if ((*__p >= '0') && (*__p <= '9')) \
1455 (_X) = (_X) * 16 + *__p - 48; \
1456 __p++; \
1457 } \
1458}while(0)
1459
1461#endif // __RTMP_DEF_H__ 1460#endif // __RTMP_DEF_H__
1462 1461
1463 1462