Greg Kroah-Hartman | 9198099 | 2008-10-28 14:48:09 -0700 | [diff] [blame] | 1 | /* |
| 2 | ************************************************************************* |
| 3 | * Ralink Tech Inc. |
| 4 | * 5F., No.36, Taiyuan St., Jhubei City, |
| 5 | * Hsinchu County 302, |
| 6 | * Taiwan, R.O.C. |
| 7 | * |
| 8 | * (c) Copyright 2002-2007, Ralink Technology, Inc. |
| 9 | * |
| 10 | * This program is free software; you can redistribute it and/or modify * |
| 11 | * it under the terms of the GNU General Public License as published by * |
| 12 | * the Free Software Foundation; either version 2 of the License, or * |
| 13 | * (at your option) any later version. * |
| 14 | * * |
| 15 | * This program is distributed in the hope that it will be useful, * |
| 16 | * but WITHOUT ANY WARRANTY; without even the implied warranty of * |
| 17 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * |
| 18 | * GNU General Public License for more details. * |
| 19 | * * |
| 20 | * You should have received a copy of the GNU General Public License * |
| 21 | * along with this program; if not, write to the * |
| 22 | * Free Software Foundation, Inc., * |
| 23 | * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * |
| 24 | * * |
| 25 | ************************************************************************* |
| 26 | |
| 27 | Module Name: |
| 28 | rtmp_def.h |
| 29 | |
| 30 | Abstract: |
| 31 | Miniport related definition header |
| 32 | |
| 33 | Revision History: |
Justin P. Mattock | 6ccb5d7 | 2010-11-08 13:41:46 -0800 | [diff] [blame] | 34 | Who When What |
Greg Kroah-Hartman | 9198099 | 2008-10-28 14:48:09 -0700 | [diff] [blame] | 35 | -------- ---------- ---------------------------------------------- |
Justin P. Mattock | 6ccb5d7 | 2010-11-08 13:41:46 -0800 | [diff] [blame] | 36 | Paul Lin 08-01-2002 created |
| 37 | John Chang 08-05-2003 add definition for 11g & other drafts |
| 38 | Justin P. Mattock 11/07/2010 Fix some typos |
Greg Kroah-Hartman | 9198099 | 2008-10-28 14:48:09 -0700 | [diff] [blame] | 39 | */ |
| 40 | #ifndef __RTMP_DEF_H__ |
| 41 | #define __RTMP_DEF_H__ |
| 42 | |
| 43 | #include "oid.h" |
| 44 | |
Bartlomiej Zolnierkiewicz | cc27706 | 2009-12-11 12:23:15 -0800 | [diff] [blame] | 45 | /* */ |
| 46 | /* Debug information verbosity: lower values indicate higher urgency */ |
| 47 | /* */ |
Greg Kroah-Hartman | 9198099 | 2008-10-28 14:48:09 -0700 | [diff] [blame] | 48 | #define RT_DEBUG_OFF 0 |
| 49 | #define RT_DEBUG_ERROR 1 |
| 50 | #define RT_DEBUG_WARN 2 |
| 51 | #define RT_DEBUG_TRACE 3 |
| 52 | #define RT_DEBUG_INFO 4 |
| 53 | #define RT_DEBUG_LOUD 5 |
| 54 | |
Bartlomiej Zolnierkiewicz | 51126de | 2009-12-11 12:23:15 -0800 | [diff] [blame] | 55 | #define NIC_TAG ((unsigned long)'0682') |
| 56 | #define NIC_DBG_char ("**RT28xx**") |
Greg Kroah-Hartman | 9198099 | 2008-10-28 14:48:09 -0700 | [diff] [blame] | 57 | |
Bartlomiej Zolnierkiewicz | ca97b83 | 2009-09-22 20:44:07 +0200 | [diff] [blame] | 58 | #ifdef RTMP_MAC_USB |
Bartlomiej Zolnierkiewicz | cc27706 | 2009-12-11 12:23:15 -0800 | [diff] [blame] | 59 | #define TX_RING_SIZE 8 /* 1 */ |
Bartlomiej Zolnierkiewicz | ca97b83 | 2009-09-22 20:44:07 +0200 | [diff] [blame] | 60 | #define PRIO_RING_SIZE 8 |
Bartlomiej Zolnierkiewicz | cc27706 | 2009-12-11 12:23:15 -0800 | [diff] [blame] | 61 | #define MGMT_RING_SIZE 32 /* PRIO_RING_SIZE */ |
Bartlomiej Zolnierkiewicz | ca97b83 | 2009-09-22 20:44:07 +0200 | [diff] [blame] | 62 | #define RX_RING_SIZE 8 |
| 63 | #define MAX_TX_PROCESS 4 |
| 64 | #define LOCAL_TXBUF_SIZE 2048 |
Bartlomiej Zolnierkiewicz | cc27706 | 2009-12-11 12:23:15 -0800 | [diff] [blame] | 65 | #endif /* RTMP_MAC_USB // */ |
Bartlomiej Zolnierkiewicz | ca97b83 | 2009-09-22 20:44:07 +0200 | [diff] [blame] | 66 | |
Bartlomiej Zolnierkiewicz | cc27706 | 2009-12-11 12:23:15 -0800 | [diff] [blame] | 67 | /*#define PACKED */ |
Bartlomiej Zolnierkiewicz | ca97b83 | 2009-09-22 20:44:07 +0200 | [diff] [blame] | 68 | |
Bartlomiej Zolnierkiewicz | 51126de | 2009-12-11 12:23:15 -0800 | [diff] [blame] | 69 | #define RALINK_2883_VERSION ((u32)0x28830300) |
| 70 | #define RALINK_2880E_VERSION ((u32)0x28720200) |
| 71 | #define RALINK_3070_VERSION ((u32)0x30700200) |
Greg Kroah-Hartman | 9198099 | 2008-10-28 14:48:09 -0700 | [diff] [blame] | 72 | |
Greg Kroah-Hartman | 9198099 | 2008-10-28 14:48:09 -0700 | [diff] [blame] | 73 | #define MAX_RX_PKT_LEN 1520 |
| 74 | |
Bartlomiej Zolnierkiewicz | cc27706 | 2009-12-11 12:23:15 -0800 | [diff] [blame] | 75 | /* */ |
| 76 | /* Entry number for each DMA descriptor ring */ |
| 77 | /* */ |
Greg Kroah-Hartman | 9198099 | 2008-10-28 14:48:09 -0700 | [diff] [blame] | 78 | |
Bartlomiej Zolnierkiewicz | ca97b83 | 2009-09-22 20:44:07 +0200 | [diff] [blame] | 79 | #ifdef RTMP_MAC_PCI |
Bartlomiej Zolnierkiewicz | cc27706 | 2009-12-11 12:23:15 -0800 | [diff] [blame] | 80 | #define TX_RING_SIZE 64 /*64 */ |
Greg Kroah-Hartman | 9198099 | 2008-10-28 14:48:09 -0700 | [diff] [blame] | 81 | #define MGMT_RING_SIZE 128 |
Bartlomiej Zolnierkiewicz | cc27706 | 2009-12-11 12:23:15 -0800 | [diff] [blame] | 82 | #define RX_RING_SIZE 128 /*64 */ |
| 83 | #define MAX_TX_PROCESS TX_RING_SIZE /*8 */ |
Greg Kroah-Hartman | 9198099 | 2008-10-28 14:48:09 -0700 | [diff] [blame] | 84 | #define MAX_DMA_DONE_PROCESS TX_RING_SIZE |
Bartlomiej Zolnierkiewicz | cc27706 | 2009-12-11 12:23:15 -0800 | [diff] [blame] | 85 | #define MAX_TX_DONE_PROCESS TX_RING_SIZE /*8 */ |
Greg Kroah-Hartman | 9198099 | 2008-10-28 14:48:09 -0700 | [diff] [blame] | 86 | #define LOCAL_TXBUF_SIZE 2 |
Bartlomiej Zolnierkiewicz | cc27706 | 2009-12-11 12:23:15 -0800 | [diff] [blame] | 87 | #endif /* RTMP_MAC_PCI // */ |
Greg Kroah-Hartman | 9198099 | 2008-10-28 14:48:09 -0700 | [diff] [blame] | 88 | |
Bartlomiej Zolnierkiewicz | cc27706 | 2009-12-11 12:23:15 -0800 | [diff] [blame] | 89 | #define MAX_RX_PROCESS 128 /*64 //32 */ |
Greg Kroah-Hartman | 9198099 | 2008-10-28 14:48:09 -0700 | [diff] [blame] | 90 | #define NUM_OF_LOCAL_TXBUF 2 |
| 91 | #define TXD_SIZE 16 |
| 92 | #define TXWI_SIZE 16 |
| 93 | #define RXD_SIZE 16 |
| 94 | #define RXWI_SIZE 16 |
Bartlomiej Zolnierkiewicz | cc27706 | 2009-12-11 12:23:15 -0800 | [diff] [blame] | 95 | /* TXINFO_SIZE + TXWI_SIZE + 802.11 Header Size + AMSDU sub frame header */ |
| 96 | #define TX_DMA_1ST_BUFFER_SIZE 96 /* only the 1st physical buffer is pre-allocated */ |
| 97 | #define MGMT_DMA_BUFFER_SIZE 1536 /*2048 */ |
| 98 | #define RX_BUFFER_AGGRESIZE 3840 /*3904 //3968 //4096 //2048 //4096 */ |
| 99 | #define RX_BUFFER_NORMSIZE 3840 /*3904 //3968 //4096 //2048 //4096 */ |
Greg Kroah-Hartman | 9198099 | 2008-10-28 14:48:09 -0700 | [diff] [blame] | 100 | #define TX_BUFFER_NORMSIZE RX_BUFFER_NORMSIZE |
Bartlomiej Zolnierkiewicz | cc27706 | 2009-12-11 12:23:15 -0800 | [diff] [blame] | 101 | #define MAX_FRAME_SIZE 2346 /* Maximum 802.11 frame size */ |
| 102 | #define MAX_AGGREGATION_SIZE 3840 /*3904 //3968 //4096 */ |
Greg Kroah-Hartman | 9198099 | 2008-10-28 14:48:09 -0700 | [diff] [blame] | 103 | #define MAX_NUM_OF_TUPLE_CACHE 2 |
| 104 | #define MAX_MCAST_LIST_SIZE 32 |
| 105 | #define MAX_LEN_OF_VENDOR_DESC 64 |
Bartlomiej Zolnierkiewicz | cc27706 | 2009-12-11 12:23:15 -0800 | [diff] [blame] | 106 | /*#define MAX_SIZE_OF_MCAST_PSQ (NUM_OF_LOCAL_TXBUF >> 2) // AP won't spend more than 1/4 of total buffers on M/BCAST PSQ */ |
Greg Kroah-Hartman | 9198099 | 2008-10-28 14:48:09 -0700 | [diff] [blame] | 107 | #define MAX_SIZE_OF_MCAST_PSQ 32 |
| 108 | |
| 109 | #define MAX_RX_PROCESS_CNT (RX_RING_SIZE) |
| 110 | |
Bartlomiej Zolnierkiewicz | ca97b83 | 2009-09-22 20:44:07 +0200 | [diff] [blame] | 111 | /* |
| 112 | WMM Note: If memory of your system is not much, please reduce the definition; |
| 113 | or when you do WMM test, the queue for low priority AC will be full, i.e. |
| 114 | TX_RING_SIZE + MAX_PACKETS_IN_QUEUE packets for the AC will be buffered in |
Justin P. Mattock | 6ccb5d7 | 2010-11-08 13:41:46 -0800 | [diff] [blame] | 115 | WLAN, maybe no packet buffers can get into the Ethernet driver. |
Bartlomiej Zolnierkiewicz | ca97b83 | 2009-09-22 20:44:07 +0200 | [diff] [blame] | 116 | |
Justin P. Mattock | 6ccb5d7 | 2010-11-08 13:41:46 -0800 | [diff] [blame] | 117 | Sometimes no packet buffer can be get into the Ethernet driver, the system will |
Bartlomiej Zolnierkiewicz | ca97b83 | 2009-09-22 20:44:07 +0200 | [diff] [blame] | 118 | send flow control packet to the sender to slow down its sending rate. |
Justin P. Mattock | 6ccb5d7 | 2010-11-08 13:41:46 -0800 | [diff] [blame] | 119 | So no WMM can be seen in the air. |
Bartlomiej Zolnierkiewicz | ca97b83 | 2009-09-22 20:44:07 +0200 | [diff] [blame] | 120 | */ |
| 121 | |
| 122 | /* |
| 123 | Need to use 64 in vxworks for test case WMM A5-T07 |
| 124 | Two dnlink (10Mbps) from a WMM station to a non-WMM station. |
| 125 | If use 256, queue is not enough. |
| 126 | And in rt_main_end.c, clConfig.clNum = RX_RING_SIZE * 3; is changed to |
| 127 | clConfig.clNum = RX_RING_SIZE * 4; |
| 128 | */ |
Justin P. Mattock | 6ccb5d7 | 2010-11-08 13:41:46 -0800 | [diff] [blame] | 129 | /* TODO: For VxWorks the size is 256. Shall we change the value as 256 for all OS? */ |
Bartlomiej Zolnierkiewicz | cc27706 | 2009-12-11 12:23:15 -0800 | [diff] [blame] | 130 | #define MAX_PACKETS_IN_QUEUE (512) /*(512) // to pass WMM A5-WPAPSK */ |
Bartlomiej Zolnierkiewicz | ca97b83 | 2009-09-22 20:44:07 +0200 | [diff] [blame] | 131 | |
Greg Kroah-Hartman | 9198099 | 2008-10-28 14:48:09 -0700 | [diff] [blame] | 132 | #define MAX_PACKETS_IN_MCAST_PS_QUEUE 32 |
Bartlomiej Zolnierkiewicz | cc27706 | 2009-12-11 12:23:15 -0800 | [diff] [blame] | 133 | #define MAX_PACKETS_IN_PS_QUEUE 128 /*32 */ |
Bartlomiej Zolnierkiewicz | 52b81c8 | 2009-12-11 12:23:14 -0800 | [diff] [blame] | 134 | #define WMM_NUM_OF_AC 4 /* AC0, AC1, AC2, and AC3 */ |
Bartlomiej Zolnierkiewicz | ca97b83 | 2009-09-22 20:44:07 +0200 | [diff] [blame] | 135 | |
| 136 | #ifdef RTMP_EFUSE_SUPPORT |
Bartlomiej Zolnierkiewicz | cc27706 | 2009-12-11 12:23:15 -0800 | [diff] [blame] | 137 | /*2008/09/11:KH add to support efuse<-- */ |
Bartlomiej Zolnierkiewicz | 3a32ed1 | 2009-04-26 16:06:25 +0200 | [diff] [blame] | 138 | #define MAX_EEPROM_BIN_FILE_SIZE 1024 |
Bartlomiej Zolnierkiewicz | ca97b83 | 2009-09-22 20:44:07 +0200 | [diff] [blame] | 139 | #define EFUSE_BUFFER_PATH "/tmp/RT30xxEEPROM.bin" |
Bartlomiej Zolnierkiewicz | cc27706 | 2009-12-11 12:23:15 -0800 | [diff] [blame] | 140 | /*2008/09/11:KH add to support efuse--> */ |
| 141 | #endif /* RTMP_EFUSE_SUPPORT // */ |
Greg Kroah-Hartman | 9198099 | 2008-10-28 14:48:09 -0700 | [diff] [blame] | 142 | |
Bartlomiej Zolnierkiewicz | cc27706 | 2009-12-11 12:23:15 -0800 | [diff] [blame] | 143 | /* RxFilter */ |
Greg Kroah-Hartman | 9198099 | 2008-10-28 14:48:09 -0700 | [diff] [blame] | 144 | #define STANORMAL 0x17f97 |
| 145 | #define APNORMAL 0x15f97 |
Bartlomiej Zolnierkiewicz | ca97b83 | 2009-09-22 20:44:07 +0200 | [diff] [blame] | 146 | #define PSPXLINK 0x17f93 |
Bartlomiej Zolnierkiewicz | cc27706 | 2009-12-11 12:23:15 -0800 | [diff] [blame] | 147 | /* */ |
Bartlomiej Zolnierkiewicz | 62eb734 | 2009-12-11 12:23:16 -0800 | [diff] [blame] | 148 | /* struct rt_rtmp_adapter flags */ |
Bartlomiej Zolnierkiewicz | cc27706 | 2009-12-11 12:23:15 -0800 | [diff] [blame] | 149 | /* */ |
Greg Kroah-Hartman | 9198099 | 2008-10-28 14:48:09 -0700 | [diff] [blame] | 150 | #define fRTMP_ADAPTER_MAP_REGISTER 0x00000001 |
| 151 | #define fRTMP_ADAPTER_INTERRUPT_IN_USE 0x00000002 |
| 152 | #define fRTMP_ADAPTER_HARDWARE_ERROR 0x00000004 |
| 153 | #define fRTMP_ADAPTER_SCATTER_GATHER 0x00000008 |
| 154 | #define fRTMP_ADAPTER_SEND_PACKET_ERROR 0x00000010 |
| 155 | #define fRTMP_ADAPTER_MLME_RESET_IN_PROGRESS 0x00000020 |
| 156 | #define fRTMP_ADAPTER_HALT_IN_PROGRESS 0x00000040 |
| 157 | #define fRTMP_ADAPTER_RESET_IN_PROGRESS 0x00000080 |
| 158 | #define fRTMP_ADAPTER_NIC_NOT_EXIST 0x00000100 |
| 159 | #define fRTMP_ADAPTER_TX_RING_ALLOCATED 0x00000200 |
| 160 | #define fRTMP_ADAPTER_REMOVE_IN_PROGRESS 0x00000400 |
| 161 | #define fRTMP_ADAPTER_MIMORATE_INUSED 0x00000800 |
| 162 | #define fRTMP_ADAPTER_RX_RING_ALLOCATED 0x00001000 |
| 163 | #define fRTMP_ADAPTER_INTERRUPT_ACTIVE 0x00002000 |
| 164 | #define fRTMP_ADAPTER_BSS_SCAN_IN_PROGRESS 0x00004000 |
| 165 | #define fRTMP_ADAPTER_REASSOC_IN_PROGRESS 0x00008000 |
| 166 | #define fRTMP_ADAPTER_MEDIA_STATE_PENDING 0x00010000 |
| 167 | #define fRTMP_ADAPTER_RADIO_OFF 0x00020000 |
| 168 | #define fRTMP_ADAPTER_BULKOUT_RESET 0x00040000 |
| 169 | #define fRTMP_ADAPTER_BULKIN_RESET 0x00080000 |
| 170 | #define fRTMP_ADAPTER_RDG_ACTIVE 0x00100000 |
| 171 | #define fRTMP_ADAPTER_DYNAMIC_BE_TXOP_ACTIVE 0x00200000 |
| 172 | #define fRTMP_ADAPTER_SCAN_2040 0x04000000 |
| 173 | #define fRTMP_ADAPTER_RADIO_MEASUREMENT 0x08000000 |
| 174 | |
Justin P. Mattock | 6ccb5d7 | 2010-11-08 13:41:46 -0800 | [diff] [blame] | 175 | #define fRTMP_ADAPTER_START_UP 0x10000000 /*Device already initialized and enabled Tx/Rx. */ |
Greg Kroah-Hartman | 9198099 | 2008-10-28 14:48:09 -0700 | [diff] [blame] | 176 | #define fRTMP_ADAPTER_MEDIA_STATE_CHANGE 0x20000000 |
| 177 | #define fRTMP_ADAPTER_IDLE_RADIO_OFF 0x40000000 |
| 178 | |
Bartlomiej Zolnierkiewicz | cc27706 | 2009-12-11 12:23:15 -0800 | [diff] [blame] | 179 | /* */ |
| 180 | /* STA operation status flags */ |
| 181 | /* */ |
Greg Kroah-Hartman | 9198099 | 2008-10-28 14:48:09 -0700 | [diff] [blame] | 182 | #define fOP_STATUS_INFRA_ON 0x00000001 |
| 183 | #define fOP_STATUS_ADHOC_ON 0x00000002 |
| 184 | #define fOP_STATUS_BG_PROTECTION_INUSED 0x00000004 |
| 185 | #define fOP_STATUS_SHORT_SLOT_INUSED 0x00000008 |
| 186 | #define fOP_STATUS_SHORT_PREAMBLE_INUSED 0x00000010 |
| 187 | #define fOP_STATUS_RECEIVE_DTIM 0x00000020 |
| 188 | #define fOP_STATUS_MEDIA_STATE_CONNECTED 0x00000080 |
| 189 | #define fOP_STATUS_WMM_INUSED 0x00000100 |
| 190 | #define fOP_STATUS_AGGREGATION_INUSED 0x00000200 |
Bartlomiej Zolnierkiewicz | cc27706 | 2009-12-11 12:23:15 -0800 | [diff] [blame] | 191 | #define fOP_STATUS_DOZE 0x00000400 /* debug purpose */ |
| 192 | #define fOP_STATUS_PIGGYBACK_INUSED 0x00000800 /* piggy-back, and aggregation */ |
Greg Kroah-Hartman | 9198099 | 2008-10-28 14:48:09 -0700 | [diff] [blame] | 193 | #define fOP_STATUS_APSD_INUSED 0x00001000 |
| 194 | #define fOP_STATUS_TX_AMSDU_INUSED 0x00002000 |
| 195 | #define fOP_STATUS_MAX_RETRY_ENABLED 0x00004000 |
| 196 | #define fOP_STATUS_WAKEUP_NOW 0x00008000 |
Bartlomiej Zolnierkiewicz | ca97b83 | 2009-09-22 20:44:07 +0200 | [diff] [blame] | 197 | #define fOP_STATUS_PCIE_DEVICE 0x00020000 |
| 198 | #define fOP_STATUS_ADVANCE_POWER_SAVE_PCIE_DEVICE fOP_STATUS_PCIE_DEVICE |
Greg Kroah-Hartman | 9198099 | 2008-10-28 14:48:09 -0700 | [diff] [blame] | 199 | |
Bartlomiej Zolnierkiewicz | cc27706 | 2009-12-11 12:23:15 -0800 | [diff] [blame] | 200 | /* */ |
Bartlomiej Zolnierkiewicz | 62eb734 | 2009-12-11 12:23:16 -0800 | [diff] [blame] | 201 | /* struct rt_rtmp_adapter PSFlags : related to advanced power save. */ |
Bartlomiej Zolnierkiewicz | cc27706 | 2009-12-11 12:23:15 -0800 | [diff] [blame] | 202 | /* */ |
| 203 | /* Indicate whether driver can go to sleep mode from now. This flag is useful AFTER link up */ |
Adam McDaniel | ed291e8 | 2009-02-23 08:01:07 -0700 | [diff] [blame] | 204 | #define fRTMP_PS_CAN_GO_SLEEP 0x00000001 |
Bartlomiej Zolnierkiewicz | cc27706 | 2009-12-11 12:23:15 -0800 | [diff] [blame] | 205 | /* Indicate whether driver has issue a LinkControl command to PCIe L1 */ |
Adam McDaniel | ed291e8 | 2009-02-23 08:01:07 -0700 | [diff] [blame] | 206 | #define fRTMP_PS_SET_PCI_CLK_OFF_COMMAND 0x00000002 |
Bartlomiej Zolnierkiewicz | cc27706 | 2009-12-11 12:23:15 -0800 | [diff] [blame] | 207 | /* Indicate driver should disable kick off hardware to send packets from now. */ |
Adam McDaniel | ed291e8 | 2009-02-23 08:01:07 -0700 | [diff] [blame] | 208 | #define fRTMP_PS_DISABLE_TX 0x00000004 |
Justin P. Mattock | 6ccb5d7 | 2010-11-08 13:41:46 -0800 | [diff] [blame] | 209 | /* Indicate driver should IMMEDIATELY go to sleep after receiving AP's beacon in which doesn't indicate unicate nor multicast packets for me */ |
| 210 | /* This flag is used ONLY in RTMPHandleRxDoneInterrupt routine. */ |
Adam McDaniel | ed291e8 | 2009-02-23 08:01:07 -0700 | [diff] [blame] | 211 | #define fRTMP_PS_GO_TO_SLEEP_NOW 0x00000008 |
Bartlomiej Zolnierkiewicz | cc27706 | 2009-12-11 12:23:15 -0800 | [diff] [blame] | 212 | #define fRTMP_PS_TOGGLE_L1 0x00000010 /* Use Toggle L1 mechanism for rt28xx PCIe */ |
Bartlomiej Zolnierkiewicz | ca97b83 | 2009-09-22 20:44:07 +0200 | [diff] [blame] | 213 | |
Bartlomiej Zolnierkiewicz | e44fd1c | 2009-09-22 20:44:24 +0200 | [diff] [blame] | 214 | #ifdef RT3090 |
| 215 | #define WAKE_MCU_CMD 0x31 |
| 216 | #define SLEEP_MCU_CMD 0x30 |
| 217 | #define RFOFF_MCU_CMD 0x35 |
Bartlomiej Zolnierkiewicz | cc27706 | 2009-12-11 12:23:15 -0800 | [diff] [blame] | 218 | #endif /* RT3090 // */ |
Adam McDaniel | ed291e8 | 2009-02-23 08:01:07 -0700 | [diff] [blame] | 219 | |
Greg Kroah-Hartman | 9198099 | 2008-10-28 14:48:09 -0700 | [diff] [blame] | 220 | #define CCKSETPROTECT 0x1 |
| 221 | #define OFDMSETPROTECT 0x2 |
| 222 | #define MM20SETPROTECT 0x4 |
| 223 | #define MM40SETPROTECT 0x8 |
| 224 | #define GF20SETPROTECT 0x10 |
| 225 | #define GR40SETPROTECT 0x20 |
| 226 | #define ALLN_SETPROTECT (GR40SETPROTECT | GF20SETPROTECT | MM40SETPROTECT | MM20SETPROTECT) |
| 227 | |
Bartlomiej Zolnierkiewicz | cc27706 | 2009-12-11 12:23:15 -0800 | [diff] [blame] | 228 | /* */ |
| 229 | /* AP's client table operation status flags */ |
| 230 | /* */ |
| 231 | #define fCLIENT_STATUS_WMM_CAPABLE 0x00000001 /* CLIENT can parse QOS DATA frame */ |
| 232 | #define fCLIENT_STATUS_AGGREGATION_CAPABLE 0x00000002 /* CLIENT can receive Ralink's proprietary TX aggregation frame */ |
| 233 | #define fCLIENT_STATUS_PIGGYBACK_CAPABLE 0x00000004 /* CLIENT support piggy-back */ |
Greg Kroah-Hartman | 9198099 | 2008-10-28 14:48:09 -0700 | [diff] [blame] | 234 | #define fCLIENT_STATUS_AMSDU_INUSED 0x00000008 |
| 235 | #define fCLIENT_STATUS_SGI20_CAPABLE 0x00000010 |
| 236 | #define fCLIENT_STATUS_SGI40_CAPABLE 0x00000020 |
| 237 | #define fCLIENT_STATUS_TxSTBC_CAPABLE 0x00000040 |
| 238 | #define fCLIENT_STATUS_RxSTBC_CAPABLE 0x00000080 |
| 239 | #define fCLIENT_STATUS_HTC_CAPABLE 0x00000100 |
| 240 | #define fCLIENT_STATUS_RDG_CAPABLE 0x00000200 |
| 241 | #define fCLIENT_STATUS_MCSFEEDBACK_CAPABLE 0x00000400 |
Bartlomiej Zolnierkiewicz | 52b81c8 | 2009-12-11 12:23:14 -0800 | [diff] [blame] | 242 | #define fCLIENT_STATUS_APSD_CAPABLE 0x00000800 /* UAPSD STATION */ |
Greg Kroah-Hartman | 9198099 | 2008-10-28 14:48:09 -0700 | [diff] [blame] | 243 | |
Greg Kroah-Hartman | 9198099 | 2008-10-28 14:48:09 -0700 | [diff] [blame] | 244 | #define fCLIENT_STATUS_RALINK_CHIPSET 0x00100000 |
Bartlomiej Zolnierkiewicz | cc27706 | 2009-12-11 12:23:15 -0800 | [diff] [blame] | 245 | /* */ |
| 246 | /* STA configuration flags */ |
| 247 | /* */ |
Greg Kroah-Hartman | 9198099 | 2008-10-28 14:48:09 -0700 | [diff] [blame] | 248 | |
Bartlomiej Zolnierkiewicz | cc27706 | 2009-12-11 12:23:15 -0800 | [diff] [blame] | 249 | /* 802.11n Operating Mode Definition. 0-3 also used in ASICUPdateProtect switch case */ |
Greg Kroah-Hartman | 9198099 | 2008-10-28 14:48:09 -0700 | [diff] [blame] | 250 | #define HT_NO_PROTECT 0 |
| 251 | #define HT_LEGACY_PROTECT 1 |
| 252 | #define HT_40_PROTECT 2 |
| 253 | #define HT_2040_PROTECT 3 |
| 254 | #define HT_RTSCTS_6M 7 |
Bartlomiej Zolnierkiewicz | cc27706 | 2009-12-11 12:23:15 -0800 | [diff] [blame] | 255 | /*following is our own definition in order to turn on our ASIC protection register in INFRASTRUCTURE. */ |
| 256 | #define HT_ATHEROS 8 /* rt2860c has problem with atheros chip. we need to turn on RTS/CTS . */ |
| 257 | #define HT_FORCERTSCTS 9 /* Force turn on RTS/CTS first. then go to evaluate if this force RTS is necessary. */ |
Greg Kroah-Hartman | 9198099 | 2008-10-28 14:48:09 -0700 | [diff] [blame] | 258 | |
Bartlomiej Zolnierkiewicz | cc27706 | 2009-12-11 12:23:15 -0800 | [diff] [blame] | 259 | /* */ |
| 260 | /* RX Packet Filter control flags. Apply on pAd->PacketFilter */ |
| 261 | /* */ |
Greg Kroah-Hartman | 9198099 | 2008-10-28 14:48:09 -0700 | [diff] [blame] | 262 | #define fRX_FILTER_ACCEPT_DIRECT NDIS_PACKET_TYPE_DIRECTED |
| 263 | #define fRX_FILTER_ACCEPT_MULTICAST NDIS_PACKET_TYPE_MULTICAST |
| 264 | #define fRX_FILTER_ACCEPT_BROADCAST NDIS_PACKET_TYPE_BROADCAST |
| 265 | #define fRX_FILTER_ACCEPT_ALL_MULTICAST NDIS_PACKET_TYPE_ALL_MULTICAST |
Bartlomiej Zolnierkiewicz | ca97b83 | 2009-09-22 20:44:07 +0200 | [diff] [blame] | 266 | #define fRX_FILTER_ACCEPT_PROMISCUOUS NDIS_PACKET_TYPE_PROMISCUOUS |
Greg Kroah-Hartman | 9198099 | 2008-10-28 14:48:09 -0700 | [diff] [blame] | 267 | |
Bartlomiej Zolnierkiewicz | cc27706 | 2009-12-11 12:23:15 -0800 | [diff] [blame] | 268 | /* */ |
| 269 | /* Error code section */ |
| 270 | /* */ |
| 271 | /* NDIS_ERROR_CODE_ADAPTER_NOT_FOUND */ |
Greg Kroah-Hartman | 9198099 | 2008-10-28 14:48:09 -0700 | [diff] [blame] | 272 | #define ERRLOG_READ_PCI_SLOT_FAILED 0x00000101L |
| 273 | #define ERRLOG_WRITE_PCI_SLOT_FAILED 0x00000102L |
| 274 | #define ERRLOG_VENDOR_DEVICE_NOMATCH 0x00000103L |
| 275 | |
Bartlomiej Zolnierkiewicz | cc27706 | 2009-12-11 12:23:15 -0800 | [diff] [blame] | 276 | /* NDIS_ERROR_CODE_ADAPTER_DISABLED */ |
Greg Kroah-Hartman | 9198099 | 2008-10-28 14:48:09 -0700 | [diff] [blame] | 277 | #define ERRLOG_BUS_MASTER_DISABLED 0x00000201L |
| 278 | |
Bartlomiej Zolnierkiewicz | cc27706 | 2009-12-11 12:23:15 -0800 | [diff] [blame] | 279 | /* NDIS_ERROR_CODE_UNSUPPORTED_CONFIGURATION */ |
Greg Kroah-Hartman | 9198099 | 2008-10-28 14:48:09 -0700 | [diff] [blame] | 280 | #define ERRLOG_INVALID_SPEED_DUPLEX 0x00000301L |
| 281 | #define ERRLOG_SET_SECONDARY_FAILED 0x00000302L |
| 282 | |
Bartlomiej Zolnierkiewicz | cc27706 | 2009-12-11 12:23:15 -0800 | [diff] [blame] | 283 | /* NDIS_ERROR_CODE_OUT_OF_RESOURCES */ |
Greg Kroah-Hartman | 9198099 | 2008-10-28 14:48:09 -0700 | [diff] [blame] | 284 | #define ERRLOG_OUT_OF_MEMORY 0x00000401L |
| 285 | #define ERRLOG_OUT_OF_SHARED_MEMORY 0x00000402L |
| 286 | #define ERRLOG_OUT_OF_MAP_REGISTERS 0x00000403L |
| 287 | #define ERRLOG_OUT_OF_BUFFER_POOL 0x00000404L |
| 288 | #define ERRLOG_OUT_OF_NDIS_BUFFER 0x00000405L |
| 289 | #define ERRLOG_OUT_OF_PACKET_POOL 0x00000406L |
| 290 | #define ERRLOG_OUT_OF_NDIS_PACKET 0x00000407L |
| 291 | #define ERRLOG_OUT_OF_LOOKASIDE_MEMORY 0x00000408L |
| 292 | |
Bartlomiej Zolnierkiewicz | cc27706 | 2009-12-11 12:23:15 -0800 | [diff] [blame] | 293 | /* NDIS_ERROR_CODE_HARDWARE_FAILURE */ |
Greg Kroah-Hartman | 9198099 | 2008-10-28 14:48:09 -0700 | [diff] [blame] | 294 | #define ERRLOG_SELFTEST_FAILED 0x00000501L |
| 295 | #define ERRLOG_INITIALIZE_ADAPTER 0x00000502L |
| 296 | #define ERRLOG_REMOVE_MINIPORT 0x00000503L |
| 297 | |
Bartlomiej Zolnierkiewicz | cc27706 | 2009-12-11 12:23:15 -0800 | [diff] [blame] | 298 | /* NDIS_ERROR_CODE_RESOURCE_CONFLICT */ |
Greg Kroah-Hartman | 9198099 | 2008-10-28 14:48:09 -0700 | [diff] [blame] | 299 | #define ERRLOG_MAP_IO_SPACE 0x00000601L |
| 300 | #define ERRLOG_QUERY_ADAPTER_RESOURCES 0x00000602L |
| 301 | #define ERRLOG_NO_IO_RESOURCE 0x00000603L |
| 302 | #define ERRLOG_NO_INTERRUPT_RESOURCE 0x00000604L |
| 303 | #define ERRLOG_NO_MEMORY_RESOURCE 0x00000605L |
| 304 | |
Bartlomiej Zolnierkiewicz | cc27706 | 2009-12-11 12:23:15 -0800 | [diff] [blame] | 305 | /* WDS definition */ |
Greg Kroah-Hartman | 9198099 | 2008-10-28 14:48:09 -0700 | [diff] [blame] | 306 | #define MAX_WDS_ENTRY 4 |
Justin P. Mattock | 6ccb5d7 | 2010-11-08 13:41:46 -0800 | [diff] [blame] | 307 | #define WDS_PAIRWISE_KEY_OFFSET 60 /* WDS links use pairwise key#60 ~ 63 in ASIC pairwise key table */ |
Greg Kroah-Hartman | 9198099 | 2008-10-28 14:48:09 -0700 | [diff] [blame] | 308 | |
| 309 | #define WDS_DISABLE_MODE 0 |
| 310 | #define WDS_RESTRICT_MODE 1 |
| 311 | #define WDS_BRIDGE_MODE 2 |
| 312 | #define WDS_REPEATER_MODE 3 |
| 313 | #define WDS_LAZY_MODE 4 |
| 314 | |
Greg Kroah-Hartman | 9198099 | 2008-10-28 14:48:09 -0700 | [diff] [blame] | 315 | #define MAX_MESH_NUM 0 |
| 316 | |
| 317 | #define MAX_APCLI_NUM 0 |
Greg Kroah-Hartman | 9198099 | 2008-10-28 14:48:09 -0700 | [diff] [blame] | 318 | |
| 319 | #define MAX_MBSSID_NUM 1 |
| 320 | #ifdef MBSS_SUPPORT |
| 321 | #undef MAX_MBSSID_NUM |
| 322 | #define MAX_MBSSID_NUM (8 - MAX_MESH_NUM - MAX_APCLI_NUM) |
Bartlomiej Zolnierkiewicz | cc27706 | 2009-12-11 12:23:15 -0800 | [diff] [blame] | 323 | #endif /* MBSS_SUPPORT // */ |
Greg Kroah-Hartman | 9198099 | 2008-10-28 14:48:09 -0700 | [diff] [blame] | 324 | |
| 325 | /* sanity check for apidx */ |
| 326 | #define MBSS_MR_APIDX_SANITY_CHECK(apidx) \ |
| 327 | { if (apidx > MAX_MBSSID_NUM) { \ |
Bartlomiej Zolnierkiewicz | ca97b83 | 2009-09-22 20:44:07 +0200 | [diff] [blame] | 328 | DBGPRINT(RT_DEBUG_ERROR, ("%s> Error! apidx = %d > MAX_MBSSID_NUM!\n", __func__, apidx)); \ |
Greg Kroah-Hartman | 9198099 | 2008-10-28 14:48:09 -0700 | [diff] [blame] | 329 | apidx = MAIN_MBSSID; } } |
| 330 | |
| 331 | #define VALID_WCID(_wcid) ((_wcid) > 0 && (_wcid) < MAX_LEN_OF_MAC_TABLE ) |
| 332 | |
| 333 | #define MAIN_MBSSID 0 |
| 334 | #define FIRST_MBSSID 1 |
| 335 | |
Greg Kroah-Hartman | 9198099 | 2008-10-28 14:48:09 -0700 | [diff] [blame] | 336 | #define MAX_BEACON_SIZE 512 |
Bartlomiej Zolnierkiewicz | cc27706 | 2009-12-11 12:23:15 -0800 | [diff] [blame] | 337 | /* If the MAX_MBSSID_NUM is larger than 6, */ |
| 338 | /* it shall reserve some WCID space(wcid 222~253) for beacon frames. */ |
| 339 | /* - these wcid 238~253 are reserved for beacon#6(ra6). */ |
| 340 | /* - these wcid 222~237 are reserved for beacon#7(ra7). */ |
Greg Kroah-Hartman | 9198099 | 2008-10-28 14:48:09 -0700 | [diff] [blame] | 341 | #if defined(MAX_MBSSID_NUM) && (MAX_MBSSID_NUM == 8) |
| 342 | #define HW_RESERVED_WCID 222 |
| 343 | #elif defined(MAX_MBSSID_NUM) && (MAX_MBSSID_NUM == 7) |
| 344 | #define HW_RESERVED_WCID 238 |
| 345 | #else |
| 346 | #define HW_RESERVED_WCID 255 |
| 347 | #endif |
| 348 | |
Bartlomiej Zolnierkiewicz | cc27706 | 2009-12-11 12:23:15 -0800 | [diff] [blame] | 349 | /* Then dedicate wcid of DFS and Carrier-Sense. */ |
Greg Kroah-Hartman | 9198099 | 2008-10-28 14:48:09 -0700 | [diff] [blame] | 350 | #define DFS_CTS_WCID (HW_RESERVED_WCID - 1) |
| 351 | #define CS_CTS_WCID (HW_RESERVED_WCID - 2) |
| 352 | #define LAST_SPECIFIC_WCID (HW_RESERVED_WCID - 2) |
| 353 | |
Bartlomiej Zolnierkiewicz | cc27706 | 2009-12-11 12:23:15 -0800 | [diff] [blame] | 354 | /* If MAX_MBSSID_NUM is 8, the maximum available wcid for the associated STA is 211. */ |
| 355 | /* If MAX_MBSSID_NUM is 7, the maximum available wcid for the associated STA is 228. */ |
Greg Kroah-Hartman | 9198099 | 2008-10-28 14:48:09 -0700 | [diff] [blame] | 356 | #define MAX_AVAILABLE_CLIENT_WCID (LAST_SPECIFIC_WCID - MAX_MBSSID_NUM - 1) |
| 357 | |
Bartlomiej Zolnierkiewicz | cc27706 | 2009-12-11 12:23:15 -0800 | [diff] [blame] | 358 | /* TX need WCID to find Cipher Key */ |
| 359 | /* these wcid 212 ~ 219 are reserved for bc/mc packets if MAX_MBSSID_NUM is 8. */ |
Greg Kroah-Hartman | 9198099 | 2008-10-28 14:48:09 -0700 | [diff] [blame] | 360 | #define GET_GroupKey_WCID(__wcid, __bssidx) \ |
| 361 | { \ |
| 362 | __wcid = LAST_SPECIFIC_WCID - (MAX_MBSSID_NUM) + __bssidx; \ |
| 363 | } |
| 364 | |
| 365 | #define IsGroupKeyWCID(__wcid) (((__wcid) < LAST_SPECIFIC_WCID) && ((__wcid) >= (LAST_SPECIFIC_WCID - (MAX_MBSSID_NUM)))) |
| 366 | |
Bartlomiej Zolnierkiewicz | cc27706 | 2009-12-11 12:23:15 -0800 | [diff] [blame] | 367 | /* definition to support multiple BSSID */ |
Greg Kroah-Hartman | 9198099 | 2008-10-28 14:48:09 -0700 | [diff] [blame] | 368 | #define BSS0 0 |
| 369 | #define BSS1 1 |
| 370 | #define BSS2 2 |
| 371 | #define BSS3 3 |
| 372 | #define BSS4 4 |
| 373 | #define BSS5 5 |
| 374 | #define BSS6 6 |
| 375 | #define BSS7 7 |
| 376 | |
Bartlomiej Zolnierkiewicz | cc27706 | 2009-12-11 12:23:15 -0800 | [diff] [blame] | 377 | /*============================================================ */ |
| 378 | /* Length definitions */ |
Greg Kroah-Hartman | 9198099 | 2008-10-28 14:48:09 -0700 | [diff] [blame] | 379 | #define PEER_KEY_NO 2 |
| 380 | #define MAC_ADDR_LEN 6 |
| 381 | #define TIMESTAMP_LEN 8 |
Bartlomiej Zolnierkiewicz | cc27706 | 2009-12-11 12:23:15 -0800 | [diff] [blame] | 382 | #define MAX_LEN_OF_SUPPORTED_RATES MAX_LENGTH_OF_SUPPORT_RATES /* 1, 2, 5.5, 11, 6, 9, 12, 18, 24, 36, 48, 54 */ |
| 383 | #define MAX_LEN_OF_KEY 32 /* 32 octets == 256 bits, Redefine for WPA */ |
| 384 | #define MAX_NUM_OF_CHANNELS MAX_NUM_OF_CHS /* 14 channels @2.4G + 12@UNII + 4 @MMAC + 11 @HiperLAN2 + 7 @Japan + 1 as NULL termination */ |
| 385 | #define MAX_NUM_OF_11JCHANNELS 20 /* 14 channels @2.4G + 12@UNII + 4 @MMAC + 11 @HiperLAN2 + 7 @Japan + 1 as NULL termination */ |
Greg Kroah-Hartman | 9198099 | 2008-10-28 14:48:09 -0700 | [diff] [blame] | 386 | #define MAX_LEN_OF_SSID 32 |
| 387 | #define CIPHER_TEXT_LEN 128 |
| 388 | #define HASH_TABLE_SIZE 256 |
Bartlomiej Zolnierkiewicz | cc27706 | 2009-12-11 12:23:15 -0800 | [diff] [blame] | 389 | #define MAX_VIE_LEN 1024 /* New for WPA cipher suite variable IE sizes. */ |
Greg Kroah-Hartman | 9198099 | 2008-10-28 14:48:09 -0700 | [diff] [blame] | 390 | #define MAX_SUPPORT_MCS 32 |
Bartlomiej Zolnierkiewicz | ca97b83 | 2009-09-22 20:44:07 +0200 | [diff] [blame] | 391 | #define MAX_NUM_OF_BBP_LATCH 140 |
Greg Kroah-Hartman | 9198099 | 2008-10-28 14:48:09 -0700 | [diff] [blame] | 392 | |
Bartlomiej Zolnierkiewicz | cc27706 | 2009-12-11 12:23:15 -0800 | [diff] [blame] | 393 | /*============================================================ */ |
| 394 | /* ASIC WCID Table definition. */ |
| 395 | /*============================================================ */ |
| 396 | #define BSSID_WCID 1 /* in infra mode, always put bssid with this WCID */ |
Greg Kroah-Hartman | 9198099 | 2008-10-28 14:48:09 -0700 | [diff] [blame] | 397 | #define MCAST_WCID 0x0 |
| 398 | #define BSS0Mcast_WCID 0x0 |
| 399 | #define BSS1Mcast_WCID 0xf8 |
| 400 | #define BSS2Mcast_WCID 0xf9 |
| 401 | #define BSS3Mcast_WCID 0xfa |
| 402 | #define BSS4Mcast_WCID 0xfb |
| 403 | #define BSS5Mcast_WCID 0xfc |
| 404 | #define BSS6Mcast_WCID 0xfd |
| 405 | #define BSS7Mcast_WCID 0xfe |
| 406 | #define RESERVED_WCID 0xff |
| 407 | |
| 408 | #define MAX_NUM_OF_ACL_LIST MAX_NUMBER_OF_ACL |
| 409 | |
Bartlomiej Zolnierkiewicz | cc27706 | 2009-12-11 12:23:15 -0800 | [diff] [blame] | 410 | #define MAX_LEN_OF_MAC_TABLE MAX_NUMBER_OF_MAC /* if MAX_MBSSID_NUM is 8, this value can't be larger than 211 */ |
Greg Kroah-Hartman | 9198099 | 2008-10-28 14:48:09 -0700 | [diff] [blame] | 411 | |
| 412 | #if MAX_LEN_OF_MAC_TABLE>MAX_AVAILABLE_CLIENT_WCID |
Sebastian Dalfuß | 06aea99 | 2009-11-07 17:31:12 +0100 | [diff] [blame] | 413 | #error MAX_LEN_OF_MAC_TABLE can not be larger than MAX_AVAILABLE_CLIENT_WCID! |
Greg Kroah-Hartman | 9198099 | 2008-10-28 14:48:09 -0700 | [diff] [blame] | 414 | #endif |
| 415 | |
| 416 | #define MAX_NUM_OF_WDS_LINK_PERBSSID 3 |
| 417 | #define MAX_NUM_OF_WDS_LINK (MAX_NUM_OF_WDS_LINK_PERBSSID*MAX_MBSSID_NUM) |
| 418 | #define MAX_NUM_OF_EVENT MAX_NUMBER_OF_EVENT |
| 419 | #define WDS_LINK_START_WCID (MAX_LEN_OF_MAC_TABLE-1) |
| 420 | |
| 421 | #define NUM_OF_TID 8 |
| 422 | #define MAX_AID_BA 4 |
Bartlomiej Zolnierkiewicz | cc27706 | 2009-12-11 12:23:15 -0800 | [diff] [blame] | 423 | #define MAX_LEN_OF_BA_REC_TABLE ((NUM_OF_TID * MAX_LEN_OF_MAC_TABLE)/2) /* (NUM_OF_TID*MAX_AID_BA + 32) //Block ACK recipient */ |
| 424 | #define MAX_LEN_OF_BA_ORI_TABLE ((NUM_OF_TID * MAX_LEN_OF_MAC_TABLE)/2) /* (NUM_OF_TID*MAX_AID_BA + 32) // Block ACK originator */ |
Greg Kroah-Hartman | 9198099 | 2008-10-28 14:48:09 -0700 | [diff] [blame] | 425 | #define MAX_LEN_OF_BSS_TABLE 64 |
| 426 | #define MAX_REORDERING_MPDU_NUM 512 |
| 427 | |
Bartlomiej Zolnierkiewicz | cc27706 | 2009-12-11 12:23:15 -0800 | [diff] [blame] | 428 | /* key related definitions */ |
Greg Kroah-Hartman | 9198099 | 2008-10-28 14:48:09 -0700 | [diff] [blame] | 429 | #define SHARE_KEY_NUM 4 |
Bartlomiej Zolnierkiewicz | cc27706 | 2009-12-11 12:23:15 -0800 | [diff] [blame] | 430 | #define MAX_LEN_OF_SHARE_KEY 16 /* byte count */ |
| 431 | #define MAX_LEN_OF_PEER_KEY 16 /* byte count */ |
| 432 | #define PAIRWISE_KEY_NUM 64 /* in MAC ASIC pairwise key table */ |
Greg Kroah-Hartman | 9198099 | 2008-10-28 14:48:09 -0700 | [diff] [blame] | 433 | #define GROUP_KEY_NUM 4 |
| 434 | #define PMK_LEN 32 |
Bartlomiej Zolnierkiewicz | cc27706 | 2009-12-11 12:23:15 -0800 | [diff] [blame] | 435 | #define WDS_PAIRWISE_KEY_OFFSET 60 /* WDS links uses pairwise key#60 ~ 63 in ASIC pairwise key table */ |
| 436 | #define PMKID_NO 4 /* Number of PMKID saved supported */ |
Greg Kroah-Hartman | 9198099 | 2008-10-28 14:48:09 -0700 | [diff] [blame] | 437 | #define MAX_LEN_OF_MLME_BUFFER 2048 |
| 438 | |
Bartlomiej Zolnierkiewicz | cc27706 | 2009-12-11 12:23:15 -0800 | [diff] [blame] | 439 | /* power status related definitions */ |
Greg Kroah-Hartman | 9198099 | 2008-10-28 14:48:09 -0700 | [diff] [blame] | 440 | #define PWR_ACTIVE 0 |
| 441 | #define PWR_SAVE 1 |
Bartlomiej Zolnierkiewicz | cc27706 | 2009-12-11 12:23:15 -0800 | [diff] [blame] | 442 | #define PWR_MMPS 2 /*MIMO power save */ |
Greg Kroah-Hartman | 9198099 | 2008-10-28 14:48:09 -0700 | [diff] [blame] | 443 | |
Bartlomiej Zolnierkiewicz | cc27706 | 2009-12-11 12:23:15 -0800 | [diff] [blame] | 444 | /* Auth and Assoc mode related definitions */ |
Greg Kroah-Hartman | 9198099 | 2008-10-28 14:48:09 -0700 | [diff] [blame] | 445 | #define AUTH_MODE_OPEN 0x00 |
| 446 | #define AUTH_MODE_KEY 0x01 |
| 447 | |
Bartlomiej Zolnierkiewicz | cc27706 | 2009-12-11 12:23:15 -0800 | [diff] [blame] | 448 | /* BSS Type definitions */ |
| 449 | #define BSS_ADHOC 0 /* = Ndis802_11IBSS */ |
| 450 | #define BSS_INFRA 1 /* = Ndis802_11Infrastructure */ |
| 451 | #define BSS_ANY 2 /* = Ndis802_11AutoUnknown */ |
| 452 | #define BSS_MONITOR 3 /* = Ndis802_11Monitor */ |
Greg Kroah-Hartman | 9198099 | 2008-10-28 14:48:09 -0700 | [diff] [blame] | 453 | |
Bartlomiej Zolnierkiewicz | cc27706 | 2009-12-11 12:23:15 -0800 | [diff] [blame] | 454 | /* Reason code definitions */ |
Greg Kroah-Hartman | 9198099 | 2008-10-28 14:48:09 -0700 | [diff] [blame] | 455 | #define REASON_RESERVED 0 |
| 456 | #define REASON_UNSPECIFY 1 |
Bartlomiej Zolnierkiewicz | 51126de | 2009-12-11 12:23:15 -0800 | [diff] [blame] | 457 | #define REASON_NO_longER_VALID 2 |
Greg Kroah-Hartman | 9198099 | 2008-10-28 14:48:09 -0700 | [diff] [blame] | 458 | #define REASON_DEAUTH_STA_LEAVING 3 |
| 459 | #define REASON_DISASSOC_INACTIVE 4 |
| 460 | #define REASON_DISASSPC_AP_UNABLE 5 |
| 461 | #define REASON_CLS2ERR 6 |
| 462 | #define REASON_CLS3ERR 7 |
| 463 | #define REASON_DISASSOC_STA_LEAVING 8 |
| 464 | #define REASON_STA_REQ_ASSOC_NOT_AUTH 9 |
| 465 | #define REASON_INVALID_IE 13 |
| 466 | #define REASON_MIC_FAILURE 14 |
| 467 | #define REASON_4_WAY_TIMEOUT 15 |
| 468 | #define REASON_GROUP_KEY_HS_TIMEOUT 16 |
| 469 | #define REASON_IE_DIFFERENT 17 |
| 470 | #define REASON_MCIPHER_NOT_VALID 18 |
| 471 | #define REASON_UCIPHER_NOT_VALID 19 |
| 472 | #define REASON_AKMP_NOT_VALID 20 |
| 473 | #define REASON_UNSUPPORT_RSNE_VER 21 |
| 474 | #define REASON_INVALID_RSNE_CAP 22 |
| 475 | #define REASON_8021X_AUTH_FAIL 23 |
| 476 | #define REASON_CIPHER_SUITE_REJECTED 24 |
| 477 | #define REASON_DECLINED 37 |
| 478 | |
| 479 | #define REASON_QOS_UNSPECIFY 32 |
| 480 | #define REASON_QOS_LACK_BANDWIDTH 33 |
| 481 | #define REASON_POOR_CHANNEL_CONDITION 34 |
| 482 | #define REASON_QOS_OUTSIDE_TXOP_LIMITION 35 |
| 483 | #define REASON_QOS_QSTA_LEAVING_QBSS 36 |
| 484 | #define REASON_QOS_UNWANTED_MECHANISM 37 |
| 485 | #define REASON_QOS_MECH_SETUP_REQUIRED 38 |
| 486 | #define REASON_QOS_REQUEST_TIMEOUT 39 |
| 487 | #define REASON_QOS_CIPHER_NOT_SUPPORT 45 |
| 488 | |
Bartlomiej Zolnierkiewicz | cc27706 | 2009-12-11 12:23:15 -0800 | [diff] [blame] | 489 | /* Status code definitions */ |
Greg Kroah-Hartman | 9198099 | 2008-10-28 14:48:09 -0700 | [diff] [blame] | 490 | #define MLME_SUCCESS 0 |
| 491 | #define MLME_UNSPECIFY_FAIL 1 |
| 492 | #define MLME_CANNOT_SUPPORT_CAP 10 |
| 493 | #define MLME_REASSOC_DENY_ASSOC_EXIST 11 |
| 494 | #define MLME_ASSOC_DENY_OUT_SCOPE 12 |
| 495 | #define MLME_ALG_NOT_SUPPORT 13 |
| 496 | #define MLME_SEQ_NR_OUT_OF_SEQUENCE 14 |
| 497 | #define MLME_REJ_CHALLENGE_FAILURE 15 |
| 498 | #define MLME_REJ_TIMEOUT 16 |
| 499 | #define MLME_ASSOC_REJ_UNABLE_HANDLE_STA 17 |
| 500 | #define MLME_ASSOC_REJ_DATA_RATE 18 |
| 501 | |
| 502 | #define MLME_ASSOC_REJ_NO_EXT_RATE 22 |
| 503 | #define MLME_ASSOC_REJ_NO_EXT_RATE_PBCC 23 |
| 504 | #define MLME_ASSOC_REJ_NO_CCK_OFDM 24 |
| 505 | |
| 506 | #define MLME_QOS_UNSPECIFY 32 |
| 507 | #define MLME_REQUEST_DECLINED 37 |
| 508 | #define MLME_REQUEST_WITH_INVALID_PARAM 38 |
Bartlomiej Zolnierkiewicz | ca97b83 | 2009-09-22 20:44:07 +0200 | [diff] [blame] | 509 | #define MLME_INVALID_GROUP_CIPHER 41 |
| 510 | #define MLME_INVALID_PAIRWISE_CIPHER 42 |
| 511 | #define MLME_INVALID_AKMP 43 |
Greg Kroah-Hartman | 9198099 | 2008-10-28 14:48:09 -0700 | [diff] [blame] | 512 | #define MLME_DLS_NOT_ALLOW_IN_QBSS 48 |
| 513 | #define MLME_DEST_STA_NOT_IN_QBSS 49 |
| 514 | #define MLME_DEST_STA_IS_NOT_A_QSTA 50 |
| 515 | |
| 516 | #define MLME_INVALID_FORMAT 0x51 |
| 517 | #define MLME_FAIL_NO_RESOURCE 0x52 |
| 518 | #define MLME_STATE_MACHINE_REJECT 0x53 |
| 519 | #define MLME_MAC_TABLE_FAIL 0x54 |
| 520 | |
Bartlomiej Zolnierkiewicz | cc27706 | 2009-12-11 12:23:15 -0800 | [diff] [blame] | 521 | /* IE code */ |
Greg Kroah-Hartman | 9198099 | 2008-10-28 14:48:09 -0700 | [diff] [blame] | 522 | #define IE_SSID 0 |
| 523 | #define IE_SUPP_RATES 1 |
| 524 | #define IE_FH_PARM 2 |
| 525 | #define IE_DS_PARM 3 |
| 526 | #define IE_CF_PARM 4 |
| 527 | #define IE_TIM 5 |
| 528 | #define IE_IBSS_PARM 6 |
Bartlomiej Zolnierkiewicz | cc27706 | 2009-12-11 12:23:15 -0800 | [diff] [blame] | 529 | #define IE_COUNTRY 7 /* 802.11d */ |
| 530 | #define IE_802_11D_REQUEST 10 /* 802.11d */ |
| 531 | #define IE_QBSS_LOAD 11 /* 802.11e d9 */ |
| 532 | #define IE_EDCA_PARAMETER 12 /* 802.11e d9 */ |
| 533 | #define IE_TSPEC 13 /* 802.11e d9 */ |
| 534 | #define IE_TCLAS 14 /* 802.11e d9 */ |
| 535 | #define IE_SCHEDULE 15 /* 802.11e d9 */ |
Greg Kroah-Hartman | 9198099 | 2008-10-28 14:48:09 -0700 | [diff] [blame] | 536 | #define IE_CHALLENGE_TEXT 16 |
Bartlomiej Zolnierkiewicz | 51126de | 2009-12-11 12:23:15 -0800 | [diff] [blame] | 537 | #define IE_POWER_CONSTRAint 32 /* 802.11h d3.3 */ |
Bartlomiej Zolnierkiewicz | cc27706 | 2009-12-11 12:23:15 -0800 | [diff] [blame] | 538 | #define IE_POWER_CAPABILITY 33 /* 802.11h d3.3 */ |
| 539 | #define IE_TPC_REQUEST 34 /* 802.11h d3.3 */ |
| 540 | #define IE_TPC_REPORT 35 /* 802.11h d3.3 */ |
| 541 | #define IE_SUPP_CHANNELS 36 /* 802.11h d3.3 */ |
| 542 | #define IE_CHANNEL_SWITCH_ANNOUNCEMENT 37 /* 802.11h d3.3 */ |
| 543 | #define IE_MEASUREMENT_REQUEST 38 /* 802.11h d3.3 */ |
| 544 | #define IE_MEASUREMENT_REPORT 39 /* 802.11h d3.3 */ |
| 545 | #define IE_QUIET 40 /* 802.11h d3.3 */ |
| 546 | #define IE_IBSS_DFS 41 /* 802.11h d3.3 */ |
| 547 | #define IE_ERP 42 /* 802.11g */ |
| 548 | #define IE_TS_DELAY 43 /* 802.11e d9 */ |
| 549 | #define IE_TCLAS_PROCESSING 44 /* 802.11e d9 */ |
| 550 | #define IE_QOS_CAPABILITY 46 /* 802.11e d6 */ |
| 551 | #define IE_HT_CAP 45 /* 802.11n d1. HT CAPABILITY. ELEMENT ID TBD */ |
| 552 | #define IE_AP_CHANNEL_REPORT 51 /* 802.11k d6 */ |
| 553 | #define IE_HT_CAP2 52 /* 802.11n d1. HT CAPABILITY. ELEMENT ID TBD */ |
| 554 | #define IE_RSN 48 /* 802.11i d3.0 */ |
| 555 | #define IE_WPA2 48 /* WPA2 */ |
| 556 | #define IE_EXT_SUPP_RATES 50 /* 802.11g */ |
| 557 | #define IE_SUPP_REG_CLASS 59 /* 802.11y. Supported regulatory classes. */ |
| 558 | #define IE_EXT_CHANNEL_SWITCH_ANNOUNCEMENT 60 /* 802.11n */ |
| 559 | #define IE_ADD_HT 61 /* 802.11n d1. ADDITIONAL HT CAPABILITY. ELEMENT ID TBD */ |
| 560 | #define IE_ADD_HT2 53 /* 802.11n d1. ADDITIONAL HT CAPABILITY. ELEMENT ID TBD */ |
Greg Kroah-Hartman | 9198099 | 2008-10-28 14:48:09 -0700 | [diff] [blame] | 561 | |
Bartlomiej Zolnierkiewicz | cc27706 | 2009-12-11 12:23:15 -0800 | [diff] [blame] | 562 | /* For 802.11n D3.03 */ |
Justin P. Mattock | 6ccb5d7 | 2010-11-08 13:41:46 -0800 | [diff] [blame] | 563 | /*#define IE_NEW_EXT_CHA_OFFSET 62 // 802.11n d1. New extension channel offset element */ |
Bartlomiej Zolnierkiewicz | cc27706 | 2009-12-11 12:23:15 -0800 | [diff] [blame] | 564 | #define IE_SECONDARY_CH_OFFSET 62 /* 802.11n D3.03 Secondary Channel Offset element */ |
| 565 | #define IE_WAPI 68 /* WAPI information element */ |
| 566 | #define IE_2040_BSS_COEXIST 72 /* 802.11n D3.0.3 */ |
| 567 | #define IE_2040_BSS_INTOLERANT_REPORT 73 /* 802.11n D3.03 */ |
| 568 | #define IE_OVERLAPBSS_SCAN_PARM 74 /* 802.11n D3.03 */ |
| 569 | #define IE_EXT_CAPABILITY 127 /* 802.11n D3.03 */ |
Greg Kroah-Hartman | 9198099 | 2008-10-28 14:48:09 -0700 | [diff] [blame] | 570 | |
Bartlomiej Zolnierkiewicz | cc27706 | 2009-12-11 12:23:15 -0800 | [diff] [blame] | 571 | #define IE_WPA 221 /* WPA */ |
| 572 | #define IE_VENDOR_SPECIFIC 221 /* Wifi WMM (WME) */ |
Greg Kroah-Hartman | 9198099 | 2008-10-28 14:48:09 -0700 | [diff] [blame] | 573 | |
Bartlomiej Zolnierkiewicz | cc27706 | 2009-12-11 12:23:15 -0800 | [diff] [blame] | 574 | #define OUI_BROADCOM_HT 51 /* */ |
| 575 | #define OUI_BROADCOM_HTADD 52 /* */ |
| 576 | #define OUI_PREN_HT_CAP 51 /* */ |
| 577 | #define OUI_PREN_ADD_HT 52 /* */ |
Greg Kroah-Hartman | 9198099 | 2008-10-28 14:48:09 -0700 | [diff] [blame] | 578 | |
Bartlomiej Zolnierkiewicz | cc27706 | 2009-12-11 12:23:15 -0800 | [diff] [blame] | 579 | /* CCX information */ |
| 580 | #define IE_AIRONET_CKIP 133 /* CCX1.0 ID 85H for CKIP */ |
| 581 | #define IE_AP_TX_POWER 150 /* CCX 2.0 for AP transmit power */ |
| 582 | #define IE_MEASUREMENT_CAPABILITY 221 /* CCX 2.0 */ |
Greg Kroah-Hartman | 9198099 | 2008-10-28 14:48:09 -0700 | [diff] [blame] | 583 | #define IE_CCX_V2 221 |
Bartlomiej Zolnierkiewicz | cc27706 | 2009-12-11 12:23:15 -0800 | [diff] [blame] | 584 | #define IE_AIRONET_IPADDRESS 149 /* CCX ID 95H for IP Address */ |
| 585 | #define IE_AIRONET_CCKMREASSOC 156 /* CCX ID 9CH for CCKM Reassociation Request element */ |
Greg Kroah-Hartman | 9198099 | 2008-10-28 14:48:09 -0700 | [diff] [blame] | 586 | #define CKIP_NEGOTIATION_LENGTH 30 |
| 587 | #define AIRONET_IPADDRESS_LENGTH 10 |
| 588 | #define AIRONET_CCKMREASSOC_LENGTH 24 |
| 589 | |
Bartlomiej Zolnierkiewicz | cc27706 | 2009-12-11 12:23:15 -0800 | [diff] [blame] | 590 | /* ======================================================== */ |
| 591 | /* MLME state machine definition */ |
| 592 | /* ======================================================== */ |
Greg Kroah-Hartman | 9198099 | 2008-10-28 14:48:09 -0700 | [diff] [blame] | 593 | |
Bartlomiej Zolnierkiewicz | cc27706 | 2009-12-11 12:23:15 -0800 | [diff] [blame] | 594 | /* STA MLME state mahcines */ |
Greg Kroah-Hartman | 9198099 | 2008-10-28 14:48:09 -0700 | [diff] [blame] | 595 | #define ASSOC_STATE_MACHINE 1 |
| 596 | #define AUTH_STATE_MACHINE 2 |
| 597 | #define AUTH_RSP_STATE_MACHINE 3 |
| 598 | #define SYNC_STATE_MACHINE 4 |
| 599 | #define MLME_CNTL_STATE_MACHINE 5 |
| 600 | #define WPA_PSK_STATE_MACHINE 6 |
Bartlomiej Zolnierkiewicz | cc27706 | 2009-12-11 12:23:15 -0800 | [diff] [blame] | 601 | /*#define LEAP_STATE_MACHINE 7 */ |
Greg Kroah-Hartman | 9198099 | 2008-10-28 14:48:09 -0700 | [diff] [blame] | 602 | #define AIRONET_STATE_MACHINE 8 |
| 603 | #define ACTION_STATE_MACHINE 9 |
| 604 | |
Bartlomiej Zolnierkiewicz | cc27706 | 2009-12-11 12:23:15 -0800 | [diff] [blame] | 605 | /* AP MLME state machines */ |
Greg Kroah-Hartman | 9198099 | 2008-10-28 14:48:09 -0700 | [diff] [blame] | 606 | #define AP_ASSOC_STATE_MACHINE 11 |
| 607 | #define AP_AUTH_STATE_MACHINE 12 |
Greg Kroah-Hartman | 9198099 | 2008-10-28 14:48:09 -0700 | [diff] [blame] | 608 | #define AP_SYNC_STATE_MACHINE 14 |
| 609 | #define AP_CNTL_STATE_MACHINE 15 |
Bartlomiej Zolnierkiewicz | ca97b83 | 2009-09-22 20:44:07 +0200 | [diff] [blame] | 610 | #define WSC_STATE_MACHINE 17 |
| 611 | #define WSC_UPNP_STATE_MACHINE 18 |
| 612 | |
Bartlomiej Zolnierkiewicz | ca97b83 | 2009-09-22 20:44:07 +0200 | [diff] [blame] | 613 | #define WPA_STATE_MACHINE 23 |
| 614 | |
Bartlomiej Zolnierkiewicz | cc27706 | 2009-12-11 12:23:15 -0800 | [diff] [blame] | 615 | /* */ |
| 616 | /* STA's CONTROL/CONNECT state machine: states, events, total function # */ |
| 617 | /* */ |
Greg Kroah-Hartman | 9198099 | 2008-10-28 14:48:09 -0700 | [diff] [blame] | 618 | #define CNTL_IDLE 0 |
| 619 | #define CNTL_WAIT_DISASSOC 1 |
| 620 | #define CNTL_WAIT_JOIN 2 |
| 621 | #define CNTL_WAIT_REASSOC 3 |
| 622 | #define CNTL_WAIT_START 4 |
| 623 | #define CNTL_WAIT_AUTH 5 |
| 624 | #define CNTL_WAIT_ASSOC 6 |
| 625 | #define CNTL_WAIT_AUTH2 7 |
| 626 | #define CNTL_WAIT_OID_LIST_SCAN 8 |
| 627 | #define CNTL_WAIT_OID_DISASSOC 9 |
Bartlomiej Zolnierkiewicz | ca97b83 | 2009-09-22 20:44:07 +0200 | [diff] [blame] | 628 | #ifdef RTMP_MAC_USB |
Bartlomiej Zolnierkiewicz | 3a32ed1 | 2009-04-26 16:06:25 +0200 | [diff] [blame] | 629 | #define CNTL_WAIT_SCAN_FOR_CONNECT 10 |
Bartlomiej Zolnierkiewicz | cc27706 | 2009-12-11 12:23:15 -0800 | [diff] [blame] | 630 | #endif /* RTMP_MAC_USB // */ |
Greg Kroah-Hartman | 9198099 | 2008-10-28 14:48:09 -0700 | [diff] [blame] | 631 | |
| 632 | #define MT2_ASSOC_CONF 34 |
| 633 | #define MT2_AUTH_CONF 35 |
| 634 | #define MT2_DEAUTH_CONF 36 |
| 635 | #define MT2_DISASSOC_CONF 37 |
| 636 | #define MT2_REASSOC_CONF 38 |
| 637 | #define MT2_PWR_MGMT_CONF 39 |
| 638 | #define MT2_JOIN_CONF 40 |
| 639 | #define MT2_SCAN_CONF 41 |
| 640 | #define MT2_START_CONF 42 |
| 641 | #define MT2_GET_CONF 43 |
| 642 | #define MT2_SET_CONF 44 |
| 643 | #define MT2_RESET_CONF 45 |
Bartlomiej Zolnierkiewicz | ca97b83 | 2009-09-22 20:44:07 +0200 | [diff] [blame] | 644 | #define MT2_FT_OTD_CONF 46 |
Greg Kroah-Hartman | 9198099 | 2008-10-28 14:48:09 -0700 | [diff] [blame] | 645 | #define MT2_MLME_ROAMING_REQ 52 |
| 646 | |
| 647 | #define CNTL_FUNC_SIZE 1 |
| 648 | |
Bartlomiej Zolnierkiewicz | cc27706 | 2009-12-11 12:23:15 -0800 | [diff] [blame] | 649 | /* */ |
| 650 | /* STA's ASSOC state machine: states, events, total function # */ |
| 651 | /* */ |
Greg Kroah-Hartman | 9198099 | 2008-10-28 14:48:09 -0700 | [diff] [blame] | 652 | #define ASSOC_IDLE 0 |
| 653 | #define ASSOC_WAIT_RSP 1 |
| 654 | #define REASSOC_WAIT_RSP 2 |
| 655 | #define DISASSOC_WAIT_RSP 3 |
| 656 | #define MAX_ASSOC_STATE 4 |
| 657 | |
| 658 | #define ASSOC_MACHINE_BASE 0 |
| 659 | #define MT2_MLME_ASSOC_REQ 0 |
| 660 | #define MT2_MLME_REASSOC_REQ 1 |
| 661 | #define MT2_MLME_DISASSOC_REQ 2 |
| 662 | #define MT2_PEER_DISASSOC_REQ 3 |
| 663 | #define MT2_PEER_ASSOC_REQ 4 |
| 664 | #define MT2_PEER_ASSOC_RSP 5 |
| 665 | #define MT2_PEER_REASSOC_REQ 6 |
| 666 | #define MT2_PEER_REASSOC_RSP 7 |
| 667 | #define MT2_DISASSOC_TIMEOUT 8 |
| 668 | #define MT2_ASSOC_TIMEOUT 9 |
| 669 | #define MT2_REASSOC_TIMEOUT 10 |
| 670 | #define MAX_ASSOC_MSG 11 |
| 671 | |
| 672 | #define ASSOC_FUNC_SIZE (MAX_ASSOC_STATE * MAX_ASSOC_MSG) |
| 673 | |
Bartlomiej Zolnierkiewicz | cc27706 | 2009-12-11 12:23:15 -0800 | [diff] [blame] | 674 | /* */ |
| 675 | /* ACT state machine: states, events, total function # */ |
| 676 | /* */ |
Greg Kroah-Hartman | 9198099 | 2008-10-28 14:48:09 -0700 | [diff] [blame] | 677 | #define ACT_IDLE 0 |
| 678 | #define MAX_ACT_STATE 1 |
| 679 | |
| 680 | #define ACT_MACHINE_BASE 0 |
| 681 | |
Justin P. Mattock | 6ccb5d7 | 2010-11-08 13:41:46 -0800 | [diff] [blame] | 682 | /*Those PEER_xx_CATE number is based on real Categary value in IEEE spec. Please do not modify it by your self. */ |
Bartlomiej Zolnierkiewicz | cc27706 | 2009-12-11 12:23:15 -0800 | [diff] [blame] | 683 | /*Category */ |
Greg Kroah-Hartman | 9198099 | 2008-10-28 14:48:09 -0700 | [diff] [blame] | 684 | #define MT2_PEER_SPECTRUM_CATE 0 |
| 685 | #define MT2_PEER_QOS_CATE 1 |
| 686 | #define MT2_PEER_DLS_CATE 2 |
| 687 | #define MT2_PEER_BA_CATE 3 |
| 688 | #define MT2_PEER_PUBLIC_CATE 4 |
| 689 | #define MT2_PEER_RM_CATE 5 |
Bartlomiej Zolnierkiewicz | ca97b83 | 2009-09-22 20:44:07 +0200 | [diff] [blame] | 690 | /* "FT_CATEGORY_BSS_TRANSITION equal to 6" is defined file of "dot11r_ft.h" */ |
Bartlomiej Zolnierkiewicz | cc27706 | 2009-12-11 12:23:15 -0800 | [diff] [blame] | 691 | #define MT2_PEER_HT_CATE 7 /* 7.4.7 */ |
Greg Kroah-Hartman | 9198099 | 2008-10-28 14:48:09 -0700 | [diff] [blame] | 692 | #define MAX_PEER_CATE_MSG 7 |
Bartlomiej Zolnierkiewicz | ca97b83 | 2009-09-22 20:44:07 +0200 | [diff] [blame] | 693 | |
Greg Kroah-Hartman | 9198099 | 2008-10-28 14:48:09 -0700 | [diff] [blame] | 694 | #define MT2_MLME_ADD_BA_CATE 8 |
| 695 | #define MT2_MLME_ORI_DELBA_CATE 9 |
| 696 | #define MT2_MLME_REC_DELBA_CATE 10 |
| 697 | #define MT2_MLME_QOS_CATE 11 |
| 698 | #define MT2_MLME_DLS_CATE 12 |
| 699 | #define MT2_ACT_INVALID 13 |
| 700 | #define MAX_ACT_MSG 14 |
| 701 | |
Bartlomiej Zolnierkiewicz | cc27706 | 2009-12-11 12:23:15 -0800 | [diff] [blame] | 702 | /*Category field */ |
Greg Kroah-Hartman | 9198099 | 2008-10-28 14:48:09 -0700 | [diff] [blame] | 703 | #define CATEGORY_SPECTRUM 0 |
| 704 | #define CATEGORY_QOS 1 |
| 705 | #define CATEGORY_DLS 2 |
| 706 | #define CATEGORY_BA 3 |
| 707 | #define CATEGORY_PUBLIC 4 |
| 708 | #define CATEGORY_RM 5 |
| 709 | #define CATEGORY_HT 7 |
| 710 | |
Bartlomiej Zolnierkiewicz | cc27706 | 2009-12-11 12:23:15 -0800 | [diff] [blame] | 711 | /* DLS Action frame definition */ |
Greg Kroah-Hartman | 9198099 | 2008-10-28 14:48:09 -0700 | [diff] [blame] | 712 | #define ACTION_DLS_REQUEST 0 |
| 713 | #define ACTION_DLS_RESPONSE 1 |
| 714 | #define ACTION_DLS_TEARDOWN 2 |
| 715 | |
Bartlomiej Zolnierkiewicz | cc27706 | 2009-12-11 12:23:15 -0800 | [diff] [blame] | 716 | /*Spectrum Action field value 802.11h 7.4.1 */ |
| 717 | #define SPEC_MRQ 0 /* Request */ |
| 718 | #define SPEC_MRP 1 /*Report */ |
Greg Kroah-Hartman | 9198099 | 2008-10-28 14:48:09 -0700 | [diff] [blame] | 719 | #define SPEC_TPCRQ 2 |
| 720 | #define SPEC_TPCRP 3 |
| 721 | #define SPEC_CHANNEL_SWITCH 4 |
| 722 | |
Bartlomiej Zolnierkiewicz | cc27706 | 2009-12-11 12:23:15 -0800 | [diff] [blame] | 723 | /*BA Action field value */ |
Greg Kroah-Hartman | 9198099 | 2008-10-28 14:48:09 -0700 | [diff] [blame] | 724 | #define ADDBA_REQ 0 |
| 725 | #define ADDBA_RESP 1 |
| 726 | #define DELBA 2 |
| 727 | |
Bartlomiej Zolnierkiewicz | cc27706 | 2009-12-11 12:23:15 -0800 | [diff] [blame] | 728 | /*Public's Action field value in Public Category. Some in 802.11y and some in 11n */ |
| 729 | #define ACTION_BSS_2040_COEXIST 0 /* 11n */ |
| 730 | #define ACTION_DSE_ENABLEMENT 1 /* 11y D9.0 */ |
| 731 | #define ACTION_DSE_DEENABLEMENT 2 /* 11y D9.0 */ |
| 732 | #define ACTION_DSE_REG_LOCATION_ANNOUNCE 3 /* 11y D9.0 */ |
| 733 | #define ACTION_EXT_CH_SWITCH_ANNOUNCE 4 /* 11y D9.0 */ |
| 734 | #define ACTION_DSE_MEASUREMENT_REQ 5 /* 11y D9.0 */ |
| 735 | #define ACTION_DSE_MEASUREMENT_REPORT 6 /* 11y D9.0 */ |
| 736 | #define ACTION_MEASUREMENT_PILOT_ACTION 7 /* 11y D9.0 */ |
| 737 | #define ACTION_DSE_POWER_CONSTRAINT 8 /* 11y D9.0 */ |
Greg Kroah-Hartman | 9198099 | 2008-10-28 14:48:09 -0700 | [diff] [blame] | 738 | |
Bartlomiej Zolnierkiewicz | cc27706 | 2009-12-11 12:23:15 -0800 | [diff] [blame] | 739 | /*HT Action field value */ |
Greg Kroah-Hartman | 9198099 | 2008-10-28 14:48:09 -0700 | [diff] [blame] | 740 | #define NOTIFY_BW_ACTION 0 |
| 741 | #define SMPS_ACTION 1 |
| 742 | #define PSMP_ACTION 2 |
| 743 | #define SETPCO_ACTION 3 |
| 744 | #define MIMO_CHA_MEASURE_ACTION 4 |
| 745 | #define MIMO_N_BEACONFORM 5 |
| 746 | #define MIMO_BEACONFORM 6 |
| 747 | #define ANTENNA_SELECT 7 |
| 748 | #define HT_INFO_EXCHANGE 8 |
| 749 | |
| 750 | #define ACT_FUNC_SIZE (MAX_ACT_STATE * MAX_ACT_MSG) |
Bartlomiej Zolnierkiewicz | cc27706 | 2009-12-11 12:23:15 -0800 | [diff] [blame] | 751 | /* */ |
Justin P. Mattock | 6ccb5d7 | 2010-11-08 13:41:46 -0800 | [diff] [blame] | 752 | /* STA's AUTHENTICATION state machine: states, events, total function # */ |
Bartlomiej Zolnierkiewicz | cc27706 | 2009-12-11 12:23:15 -0800 | [diff] [blame] | 753 | /* */ |
Greg Kroah-Hartman | 9198099 | 2008-10-28 14:48:09 -0700 | [diff] [blame] | 754 | #define AUTH_REQ_IDLE 0 |
| 755 | #define AUTH_WAIT_SEQ2 1 |
| 756 | #define AUTH_WAIT_SEQ4 2 |
| 757 | #define MAX_AUTH_STATE 3 |
| 758 | |
| 759 | #define AUTH_MACHINE_BASE 0 |
| 760 | #define MT2_MLME_AUTH_REQ 0 |
| 761 | #define MT2_PEER_AUTH_EVEN 1 |
| 762 | #define MT2_AUTH_TIMEOUT 2 |
| 763 | #define MAX_AUTH_MSG 3 |
| 764 | |
| 765 | #define AUTH_FUNC_SIZE (MAX_AUTH_STATE * MAX_AUTH_MSG) |
| 766 | |
Bartlomiej Zolnierkiewicz | cc27706 | 2009-12-11 12:23:15 -0800 | [diff] [blame] | 767 | /* */ |
| 768 | /* STA's AUTH_RSP state machine: states, events, total function # */ |
| 769 | /* */ |
Greg Kroah-Hartman | 9198099 | 2008-10-28 14:48:09 -0700 | [diff] [blame] | 770 | #define AUTH_RSP_IDLE 0 |
| 771 | #define AUTH_RSP_WAIT_CHAL 1 |
| 772 | #define MAX_AUTH_RSP_STATE 2 |
| 773 | |
| 774 | #define AUTH_RSP_MACHINE_BASE 0 |
| 775 | #define MT2_AUTH_CHALLENGE_TIMEOUT 0 |
| 776 | #define MT2_PEER_AUTH_ODD 1 |
| 777 | #define MT2_PEER_DEAUTH 2 |
| 778 | #define MAX_AUTH_RSP_MSG 3 |
| 779 | |
| 780 | #define AUTH_RSP_FUNC_SIZE (MAX_AUTH_RSP_STATE * MAX_AUTH_RSP_MSG) |
| 781 | |
Bartlomiej Zolnierkiewicz | cc27706 | 2009-12-11 12:23:15 -0800 | [diff] [blame] | 782 | /* */ |
| 783 | /* STA's SYNC state machine: states, events, total function # */ |
| 784 | /* */ |
| 785 | #define SYNC_IDLE 0 /* merge NO_BSS,IBSS_IDLE,IBSS_ACTIVE and BSS in to 1 state */ |
Greg Kroah-Hartman | 9198099 | 2008-10-28 14:48:09 -0700 | [diff] [blame] | 786 | #define JOIN_WAIT_BEACON 1 |
| 787 | #define SCAN_LISTEN 2 |
| 788 | #define MAX_SYNC_STATE 3 |
| 789 | |
| 790 | #define SYNC_MACHINE_BASE 0 |
| 791 | #define MT2_MLME_SCAN_REQ 0 |
| 792 | #define MT2_MLME_JOIN_REQ 1 |
| 793 | #define MT2_MLME_START_REQ 2 |
| 794 | #define MT2_PEER_BEACON 3 |
| 795 | #define MT2_PEER_PROBE_RSP 4 |
| 796 | #define MT2_PEER_ATIM 5 |
| 797 | #define MT2_SCAN_TIMEOUT 6 |
| 798 | #define MT2_BEACON_TIMEOUT 7 |
| 799 | #define MT2_ATIM_TIMEOUT 8 |
| 800 | #define MT2_PEER_PROBE_REQ 9 |
| 801 | #define MAX_SYNC_MSG 10 |
| 802 | |
| 803 | #define SYNC_FUNC_SIZE (MAX_SYNC_STATE * MAX_SYNC_MSG) |
| 804 | |
Bartlomiej Zolnierkiewicz | cc27706 | 2009-12-11 12:23:15 -0800 | [diff] [blame] | 805 | /*Messages for the DLS state machine */ |
Greg Kroah-Hartman | 9198099 | 2008-10-28 14:48:09 -0700 | [diff] [blame] | 806 | #define DLS_IDLE 0 |
| 807 | #define MAX_DLS_STATE 1 |
| 808 | |
| 809 | #define DLS_MACHINE_BASE 0 |
| 810 | #define MT2_MLME_DLS_REQ 0 |
| 811 | #define MT2_PEER_DLS_REQ 1 |
| 812 | #define MT2_PEER_DLS_RSP 2 |
| 813 | #define MT2_MLME_DLS_TEAR_DOWN 3 |
| 814 | #define MT2_PEER_DLS_TEAR_DOWN 4 |
| 815 | #define MAX_DLS_MSG 5 |
| 816 | |
| 817 | #define DLS_FUNC_SIZE (MAX_DLS_STATE * MAX_DLS_MSG) |
| 818 | |
Bartlomiej Zolnierkiewicz | cc27706 | 2009-12-11 12:23:15 -0800 | [diff] [blame] | 819 | /* */ |
| 820 | /* WSC State machine: states, events, total function # */ |
| 821 | /* */ |
Greg Kroah-Hartman | 9198099 | 2008-10-28 14:48:09 -0700 | [diff] [blame] | 822 | |
Bartlomiej Zolnierkiewicz | cc27706 | 2009-12-11 12:23:15 -0800 | [diff] [blame] | 823 | /* */ |
| 824 | /* AP's CONTROL/CONNECT state machine: states, events, total function # */ |
| 825 | /* */ |
Greg Kroah-Hartman | 9198099 | 2008-10-28 14:48:09 -0700 | [diff] [blame] | 826 | #define AP_CNTL_FUNC_SIZE 1 |
| 827 | |
Bartlomiej Zolnierkiewicz | cc27706 | 2009-12-11 12:23:15 -0800 | [diff] [blame] | 828 | /* */ |
| 829 | /* AP's ASSOC state machine: states, events, total function # */ |
| 830 | /* */ |
Greg Kroah-Hartman | 9198099 | 2008-10-28 14:48:09 -0700 | [diff] [blame] | 831 | #define AP_ASSOC_IDLE 0 |
| 832 | #define AP_MAX_ASSOC_STATE 1 |
| 833 | |
| 834 | #define AP_ASSOC_MACHINE_BASE 0 |
| 835 | #define APMT2_MLME_DISASSOC_REQ 0 |
| 836 | #define APMT2_PEER_DISASSOC_REQ 1 |
| 837 | #define APMT2_PEER_ASSOC_REQ 2 |
| 838 | #define APMT2_PEER_REASSOC_REQ 3 |
| 839 | #define APMT2_CLS3ERR 4 |
| 840 | #define AP_MAX_ASSOC_MSG 5 |
| 841 | |
| 842 | #define AP_ASSOC_FUNC_SIZE (AP_MAX_ASSOC_STATE * AP_MAX_ASSOC_MSG) |
| 843 | |
Bartlomiej Zolnierkiewicz | cc27706 | 2009-12-11 12:23:15 -0800 | [diff] [blame] | 844 | /* */ |
| 845 | /* AP's AUTHENTICATION state machine: states, events, total function # */ |
| 846 | /* */ |
Greg Kroah-Hartman | 9198099 | 2008-10-28 14:48:09 -0700 | [diff] [blame] | 847 | #define AP_AUTH_REQ_IDLE 0 |
| 848 | #define AP_MAX_AUTH_STATE 1 |
| 849 | |
| 850 | #define AP_AUTH_MACHINE_BASE 0 |
| 851 | #define APMT2_MLME_DEAUTH_REQ 0 |
| 852 | #define APMT2_CLS2ERR 1 |
Bartlomiej Zolnierkiewicz | ca97b83 | 2009-09-22 20:44:07 +0200 | [diff] [blame] | 853 | #define APMT2_PEER_DEAUTH 2 |
| 854 | #define APMT2_PEER_AUTH_REQ 3 |
| 855 | #define APMT2_PEER_AUTH_CONFIRM 4 |
| 856 | #define AP_MAX_AUTH_MSG 5 |
Greg Kroah-Hartman | 9198099 | 2008-10-28 14:48:09 -0700 | [diff] [blame] | 857 | |
| 858 | #define AP_AUTH_FUNC_SIZE (AP_MAX_AUTH_STATE * AP_MAX_AUTH_MSG) |
| 859 | |
Bartlomiej Zolnierkiewicz | cc27706 | 2009-12-11 12:23:15 -0800 | [diff] [blame] | 860 | /* */ |
| 861 | /* AP's SYNC state machine: states, events, total function # */ |
| 862 | /* */ |
Greg Kroah-Hartman | 9198099 | 2008-10-28 14:48:09 -0700 | [diff] [blame] | 863 | #define AP_SYNC_IDLE 0 |
| 864 | #define AP_SCAN_LISTEN 1 |
| 865 | #define AP_MAX_SYNC_STATE 2 |
| 866 | |
| 867 | #define AP_SYNC_MACHINE_BASE 0 |
| 868 | #define APMT2_PEER_PROBE_REQ 0 |
| 869 | #define APMT2_PEER_BEACON 1 |
| 870 | #define APMT2_MLME_SCAN_REQ 2 |
| 871 | #define APMT2_PEER_PROBE_RSP 3 |
| 872 | #define APMT2_SCAN_TIMEOUT 4 |
| 873 | #define APMT2_MLME_SCAN_CNCL 5 |
| 874 | #define AP_MAX_SYNC_MSG 6 |
| 875 | |
| 876 | #define AP_SYNC_FUNC_SIZE (AP_MAX_SYNC_STATE * AP_MAX_SYNC_MSG) |
| 877 | |
Bartlomiej Zolnierkiewicz | cc27706 | 2009-12-11 12:23:15 -0800 | [diff] [blame] | 878 | /* */ |
| 879 | /* Common WPA state machine: states, events, total function # */ |
| 880 | /* */ |
Bartlomiej Zolnierkiewicz | ca97b83 | 2009-09-22 20:44:07 +0200 | [diff] [blame] | 881 | #define WPA_PTK 0 |
| 882 | #define MAX_WPA_PTK_STATE 1 |
Greg Kroah-Hartman | 9198099 | 2008-10-28 14:48:09 -0700 | [diff] [blame] | 883 | |
Bartlomiej Zolnierkiewicz | ca97b83 | 2009-09-22 20:44:07 +0200 | [diff] [blame] | 884 | #define WPA_MACHINE_BASE 0 |
| 885 | #define MT2_EAPPacket 0 |
| 886 | #define MT2_EAPOLStart 1 |
| 887 | #define MT2_EAPOLLogoff 2 |
| 888 | #define MT2_EAPOLKey 3 |
| 889 | #define MT2_EAPOLASFAlert 4 |
| 890 | #define MAX_WPA_MSG 5 |
Greg Kroah-Hartman | 9198099 | 2008-10-28 14:48:09 -0700 | [diff] [blame] | 891 | |
Bartlomiej Zolnierkiewicz | ca97b83 | 2009-09-22 20:44:07 +0200 | [diff] [blame] | 892 | #define WPA_FUNC_SIZE (MAX_WPA_PTK_STATE * MAX_WPA_MSG) |
| 893 | |
Bartlomiej Zolnierkiewicz | cc27706 | 2009-12-11 12:23:15 -0800 | [diff] [blame] | 894 | /* ============================================================================= */ |
Greg Kroah-Hartman | 9198099 | 2008-10-28 14:48:09 -0700 | [diff] [blame] | 895 | |
Bartlomiej Zolnierkiewicz | cc27706 | 2009-12-11 12:23:15 -0800 | [diff] [blame] | 896 | /* value domain of 802.11 header FC.Tyte, which is b3..b2 of the 1st-byte of MAC header */ |
Greg Kroah-Hartman | 9198099 | 2008-10-28 14:48:09 -0700 | [diff] [blame] | 897 | #define BTYPE_MGMT 0 |
| 898 | #define BTYPE_CNTL 1 |
| 899 | #define BTYPE_DATA 2 |
| 900 | |
Bartlomiej Zolnierkiewicz | cc27706 | 2009-12-11 12:23:15 -0800 | [diff] [blame] | 901 | /* value domain of 802.11 MGMT frame's FC.subtype, which is b7..4 of the 1st-byte of MAC header */ |
Greg Kroah-Hartman | 9198099 | 2008-10-28 14:48:09 -0700 | [diff] [blame] | 902 | #define SUBTYPE_ASSOC_REQ 0 |
| 903 | #define SUBTYPE_ASSOC_RSP 1 |
| 904 | #define SUBTYPE_REASSOC_REQ 2 |
| 905 | #define SUBTYPE_REASSOC_RSP 3 |
| 906 | #define SUBTYPE_PROBE_REQ 4 |
| 907 | #define SUBTYPE_PROBE_RSP 5 |
| 908 | #define SUBTYPE_BEACON 8 |
| 909 | #define SUBTYPE_ATIM 9 |
| 910 | #define SUBTYPE_DISASSOC 10 |
| 911 | #define SUBTYPE_AUTH 11 |
| 912 | #define SUBTYPE_DEAUTH 12 |
| 913 | #define SUBTYPE_ACTION 13 |
| 914 | #define SUBTYPE_ACTION_NO_ACK 14 |
| 915 | |
Bartlomiej Zolnierkiewicz | cc27706 | 2009-12-11 12:23:15 -0800 | [diff] [blame] | 916 | /* value domain of 802.11 CNTL frame's FC.subtype, which is b7..4 of the 1st-byte of MAC header */ |
Greg Kroah-Hartman | 9198099 | 2008-10-28 14:48:09 -0700 | [diff] [blame] | 917 | #define SUBTYPE_WRAPPER 7 |
| 918 | #define SUBTYPE_BLOCK_ACK_REQ 8 |
| 919 | #define SUBTYPE_BLOCK_ACK 9 |
| 920 | #define SUBTYPE_PS_POLL 10 |
| 921 | #define SUBTYPE_RTS 11 |
| 922 | #define SUBTYPE_CTS 12 |
| 923 | #define SUBTYPE_ACK 13 |
| 924 | #define SUBTYPE_CFEND 14 |
| 925 | #define SUBTYPE_CFEND_CFACK 15 |
| 926 | |
Bartlomiej Zolnierkiewicz | cc27706 | 2009-12-11 12:23:15 -0800 | [diff] [blame] | 927 | /* value domain of 802.11 DATA frame's FC.subtype, which is b7..4 of the 1st-byte of MAC header */ |
Greg Kroah-Hartman | 9198099 | 2008-10-28 14:48:09 -0700 | [diff] [blame] | 928 | #define SUBTYPE_DATA 0 |
| 929 | #define SUBTYPE_DATA_CFACK 1 |
| 930 | #define SUBTYPE_DATA_CFPOLL 2 |
| 931 | #define SUBTYPE_DATA_CFACK_CFPOLL 3 |
| 932 | #define SUBTYPE_NULL_FUNC 4 |
| 933 | #define SUBTYPE_CFACK 5 |
| 934 | #define SUBTYPE_CFPOLL 6 |
| 935 | #define SUBTYPE_CFACK_CFPOLL 7 |
| 936 | #define SUBTYPE_QDATA 8 |
| 937 | #define SUBTYPE_QDATA_CFACK 9 |
| 938 | #define SUBTYPE_QDATA_CFPOLL 10 |
| 939 | #define SUBTYPE_QDATA_CFACK_CFPOLL 11 |
| 940 | #define SUBTYPE_QOS_NULL 12 |
| 941 | #define SUBTYPE_QOS_CFACK 13 |
| 942 | #define SUBTYPE_QOS_CFPOLL 14 |
| 943 | #define SUBTYPE_QOS_CFACK_CFPOLL 15 |
| 944 | |
Bartlomiej Zolnierkiewicz | cc27706 | 2009-12-11 12:23:15 -0800 | [diff] [blame] | 945 | /* ACK policy of QOS Control field bit 6:5 */ |
| 946 | #define NORMAL_ACK 0x00 /* b6:5 = 00 */ |
| 947 | #define NO_ACK 0x20 /* b6:5 = 01 */ |
| 948 | #define NO_EXPLICIT_ACK 0x40 /* b6:5 = 10 */ |
| 949 | #define BLOCK_ACK 0x60 /* b6:5 = 11 */ |
Greg Kroah-Hartman | 9198099 | 2008-10-28 14:48:09 -0700 | [diff] [blame] | 950 | |
Bartlomiej Zolnierkiewicz | cc27706 | 2009-12-11 12:23:15 -0800 | [diff] [blame] | 951 | /* */ |
Justin P. Mattock | 6ccb5d7 | 2010-11-08 13:41:46 -0800 | [diff] [blame] | 952 | /* rtmp_data.c uses this definition */ |
Bartlomiej Zolnierkiewicz | cc27706 | 2009-12-11 12:23:15 -0800 | [diff] [blame] | 953 | /* */ |
Greg Kroah-Hartman | 9198099 | 2008-10-28 14:48:09 -0700 | [diff] [blame] | 954 | #define LENGTH_802_11 24 |
| 955 | #define LENGTH_802_11_AND_H 30 |
| 956 | #define LENGTH_802_11_CRC_H 34 |
| 957 | #define LENGTH_802_11_CRC 28 |
| 958 | #define LENGTH_802_11_WITH_ADDR4 30 |
| 959 | #define LENGTH_802_3 14 |
| 960 | #define LENGTH_802_3_TYPE 2 |
| 961 | #define LENGTH_802_1_H 8 |
| 962 | #define LENGTH_EAPOL_H 4 |
| 963 | #define LENGTH_WMMQOS_H 2 |
| 964 | #define LENGTH_CRC 4 |
| 965 | #define MAX_SEQ_NUMBER 0x0fff |
| 966 | #define LENGTH_802_3_NO_TYPE 12 |
Bartlomiej Zolnierkiewicz | 52b81c8 | 2009-12-11 12:23:14 -0800 | [diff] [blame] | 967 | #define LENGTH_802_1Q 4 /* VLAN related */ |
Greg Kroah-Hartman | 9198099 | 2008-10-28 14:48:09 -0700 | [diff] [blame] | 968 | |
Bartlomiej Zolnierkiewicz | cc27706 | 2009-12-11 12:23:15 -0800 | [diff] [blame] | 969 | /* STA_CSR4.field.TxResult */ |
Greg Kroah-Hartman | 9198099 | 2008-10-28 14:48:09 -0700 | [diff] [blame] | 970 | #define TX_RESULT_SUCCESS 0 |
| 971 | #define TX_RESULT_ZERO_LENGTH 1 |
| 972 | #define TX_RESULT_UNDER_RUN 2 |
| 973 | #define TX_RESULT_OHY_ERROR 4 |
| 974 | #define TX_RESULT_RETRY_FAIL 6 |
| 975 | |
Bartlomiej Zolnierkiewicz | cc27706 | 2009-12-11 12:23:15 -0800 | [diff] [blame] | 976 | /* All PHY rate summary in TXD */ |
| 977 | /* Preamble MODE in TxD */ |
Greg Kroah-Hartman | 9198099 | 2008-10-28 14:48:09 -0700 | [diff] [blame] | 978 | #define MODE_CCK 0 |
| 979 | #define MODE_OFDM 1 |
Greg Kroah-Hartman | 9198099 | 2008-10-28 14:48:09 -0700 | [diff] [blame] | 980 | #define MODE_HTMIX 2 |
| 981 | #define MODE_HTGREENFIELD 3 |
Bartlomiej Zolnierkiewicz | 1623267 | 2009-04-26 16:06:00 +0200 | [diff] [blame] | 982 | |
Bartlomiej Zolnierkiewicz | cc27706 | 2009-12-11 12:23:15 -0800 | [diff] [blame] | 983 | /* MCS for CCK. BW.SGI.STBC are reserved */ |
Bartlomiej Zolnierkiewicz | 51126de | 2009-12-11 12:23:15 -0800 | [diff] [blame] | 984 | #define MCS_longP_RATE_1 0 /* long preamble CCK 1Mbps */ |
| 985 | #define MCS_longP_RATE_2 1 /* long preamble CCK 1Mbps */ |
| 986 | #define MCS_longP_RATE_5_5 2 |
| 987 | #define MCS_longP_RATE_11 3 |
Bartlomiej Zolnierkiewicz | cc27706 | 2009-12-11 12:23:15 -0800 | [diff] [blame] | 988 | #define MCS_SHORTP_RATE_1 4 /* long preamble CCK 1Mbps. short is forbidden in 1Mbps */ |
| 989 | #define MCS_SHORTP_RATE_2 5 /* short preamble CCK 2Mbps */ |
Greg Kroah-Hartman | 9198099 | 2008-10-28 14:48:09 -0700 | [diff] [blame] | 990 | #define MCS_SHORTP_RATE_5_5 6 |
| 991 | #define MCS_SHORTP_RATE_11 7 |
Bartlomiej Zolnierkiewicz | cc27706 | 2009-12-11 12:23:15 -0800 | [diff] [blame] | 992 | /* To send duplicate legacy OFDM. set BW=BW_40. SGI.STBC are reserved */ |
| 993 | #define MCS_RATE_6 0 /* legacy OFDM */ |
| 994 | #define MCS_RATE_9 1 /* OFDM */ |
| 995 | #define MCS_RATE_12 2 /* OFDM */ |
| 996 | #define MCS_RATE_18 3 /* OFDM */ |
| 997 | #define MCS_RATE_24 4 /* OFDM */ |
| 998 | #define MCS_RATE_36 5 /* OFDM */ |
| 999 | #define MCS_RATE_48 6 /* OFDM */ |
| 1000 | #define MCS_RATE_54 7 /* OFDM */ |
| 1001 | /* HT */ |
| 1002 | #define MCS_0 0 /* 1S */ |
Greg Kroah-Hartman | 9198099 | 2008-10-28 14:48:09 -0700 | [diff] [blame] | 1003 | #define MCS_1 1 |
| 1004 | #define MCS_2 2 |
| 1005 | #define MCS_3 3 |
| 1006 | #define MCS_4 4 |
| 1007 | #define MCS_5 5 |
| 1008 | #define MCS_6 6 |
| 1009 | #define MCS_7 7 |
Bartlomiej Zolnierkiewicz | cc27706 | 2009-12-11 12:23:15 -0800 | [diff] [blame] | 1010 | #define MCS_8 8 /* 2S */ |
Greg Kroah-Hartman | 9198099 | 2008-10-28 14:48:09 -0700 | [diff] [blame] | 1011 | #define MCS_9 9 |
| 1012 | #define MCS_10 10 |
| 1013 | #define MCS_11 11 |
| 1014 | #define MCS_12 12 |
| 1015 | #define MCS_13 13 |
| 1016 | #define MCS_14 14 |
| 1017 | #define MCS_15 15 |
Bartlomiej Zolnierkiewicz | cc27706 | 2009-12-11 12:23:15 -0800 | [diff] [blame] | 1018 | #define MCS_16 16 /* 3*3 */ |
Greg Kroah-Hartman | 9198099 | 2008-10-28 14:48:09 -0700 | [diff] [blame] | 1019 | #define MCS_17 17 |
| 1020 | #define MCS_18 18 |
| 1021 | #define MCS_19 19 |
| 1022 | #define MCS_20 20 |
| 1023 | #define MCS_21 21 |
| 1024 | #define MCS_22 22 |
| 1025 | #define MCS_23 23 |
| 1026 | #define MCS_32 32 |
| 1027 | #define MCS_AUTO 33 |
| 1028 | |
Bartlomiej Zolnierkiewicz | cc27706 | 2009-12-11 12:23:15 -0800 | [diff] [blame] | 1029 | /* OID_HTPHYMODE */ |
| 1030 | /* MODE */ |
Greg Kroah-Hartman | 9198099 | 2008-10-28 14:48:09 -0700 | [diff] [blame] | 1031 | #define HTMODE_MM 0 |
| 1032 | #define HTMODE_GF 1 |
Greg Kroah-Hartman | 9198099 | 2008-10-28 14:48:09 -0700 | [diff] [blame] | 1033 | |
Bartlomiej Zolnierkiewicz | cc27706 | 2009-12-11 12:23:15 -0800 | [diff] [blame] | 1034 | /* Fixed Tx MODE - HT, CCK or OFDM */ |
Greg Kroah-Hartman | 9198099 | 2008-10-28 14:48:09 -0700 | [diff] [blame] | 1035 | #define FIXED_TXMODE_HT 0 |
| 1036 | #define FIXED_TXMODE_CCK 1 |
| 1037 | #define FIXED_TXMODE_OFDM 2 |
Bartlomiej Zolnierkiewicz | cc27706 | 2009-12-11 12:23:15 -0800 | [diff] [blame] | 1038 | /* BW */ |
Greg Kroah-Hartman | 9198099 | 2008-10-28 14:48:09 -0700 | [diff] [blame] | 1039 | #define BW_20 BAND_WIDTH_20 |
| 1040 | #define BW_40 BAND_WIDTH_40 |
| 1041 | #define BW_BOTH BAND_WIDTH_BOTH |
Bartlomiej Zolnierkiewicz | cc27706 | 2009-12-11 12:23:15 -0800 | [diff] [blame] | 1042 | #define BW_10 BAND_WIDTH_10 /* 802.11j has 10MHz. This definition is for internal usage. doesn't fill in the IE or other field. */ |
Greg Kroah-Hartman | 9198099 | 2008-10-28 14:48:09 -0700 | [diff] [blame] | 1043 | |
Bartlomiej Zolnierkiewicz | cc27706 | 2009-12-11 12:23:15 -0800 | [diff] [blame] | 1044 | /* SHORTGI */ |
| 1045 | #define GI_400 GAP_INTERVAL_400 /* only support in HT mode */ |
Greg Kroah-Hartman | 9198099 | 2008-10-28 14:48:09 -0700 | [diff] [blame] | 1046 | #define GI_BOTH GAP_INTERVAL_BOTH |
Greg Kroah-Hartman | 9198099 | 2008-10-28 14:48:09 -0700 | [diff] [blame] | 1047 | #define GI_800 GAP_INTERVAL_800 |
Bartlomiej Zolnierkiewicz | cc27706 | 2009-12-11 12:23:15 -0800 | [diff] [blame] | 1048 | /* STBC */ |
Greg Kroah-Hartman | 9198099 | 2008-10-28 14:48:09 -0700 | [diff] [blame] | 1049 | #define STBC_NONE 0 |
Bartlomiej Zolnierkiewicz | cc27706 | 2009-12-11 12:23:15 -0800 | [diff] [blame] | 1050 | #define STBC_USE 1 /* limited use in rt2860b phy */ |
| 1051 | #define RXSTBC_ONE 1 /* rx support of one spatial stream */ |
| 1052 | #define RXSTBC_TWO 2 /* rx support of 1 and 2 spatial stream */ |
| 1053 | #define RXSTBC_THR 3 /* rx support of 1~3 spatial stream */ |
| 1054 | /* MCS FEEDBACK */ |
| 1055 | #define MCSFBK_NONE 0 /* not support mcs feedback / */ |
| 1056 | #define MCSFBK_RSV 1 /* reserved */ |
| 1057 | #define MCSFBK_UNSOLICIT 2 /* only support unsolict mcs feedback */ |
| 1058 | #define MCSFBK_MRQ 3 /* response to both MRQ and unsolict mcs feedback */ |
Greg Kroah-Hartman | 9198099 | 2008-10-28 14:48:09 -0700 | [diff] [blame] | 1059 | |
Bartlomiej Zolnierkiewicz | cc27706 | 2009-12-11 12:23:15 -0800 | [diff] [blame] | 1060 | /* MIMO power safe */ |
Greg Kroah-Hartman | 9198099 | 2008-10-28 14:48:09 -0700 | [diff] [blame] | 1061 | #define MMPS_STATIC 0 |
| 1062 | #define MMPS_DYNAMIC 1 |
| 1063 | #define MMPS_RSV 2 |
| 1064 | #define MMPS_ENABLE 3 |
| 1065 | |
Bartlomiej Zolnierkiewicz | cc27706 | 2009-12-11 12:23:15 -0800 | [diff] [blame] | 1066 | /* A-MSDU size */ |
Greg Kroah-Hartman | 9198099 | 2008-10-28 14:48:09 -0700 | [diff] [blame] | 1067 | #define AMSDU_0 0 |
| 1068 | #define AMSDU_1 1 |
| 1069 | |
Bartlomiej Zolnierkiewicz | cc27706 | 2009-12-11 12:23:15 -0800 | [diff] [blame] | 1070 | /* MCS use 7 bits */ |
Greg Kroah-Hartman | 9198099 | 2008-10-28 14:48:09 -0700 | [diff] [blame] | 1071 | #define TXRATEMIMO 0x80 |
| 1072 | #define TXRATEMCS 0x7F |
| 1073 | #define TXRATEOFDM 0x7F |
| 1074 | #define RATE_1 0 |
| 1075 | #define RATE_2 1 |
| 1076 | #define RATE_5_5 2 |
| 1077 | #define RATE_11 3 |
Bartlomiej Zolnierkiewicz | cc27706 | 2009-12-11 12:23:15 -0800 | [diff] [blame] | 1078 | #define RATE_6 4 /* OFDM */ |
| 1079 | #define RATE_9 5 /* OFDM */ |
| 1080 | #define RATE_12 6 /* OFDM */ |
| 1081 | #define RATE_18 7 /* OFDM */ |
| 1082 | #define RATE_24 8 /* OFDM */ |
| 1083 | #define RATE_36 9 /* OFDM */ |
| 1084 | #define RATE_48 10 /* OFDM */ |
| 1085 | #define RATE_54 11 /* OFDM */ |
Greg Kroah-Hartman | 9198099 | 2008-10-28 14:48:09 -0700 | [diff] [blame] | 1086 | #define RATE_FIRST_OFDM_RATE RATE_6 |
| 1087 | #define RATE_LAST_OFDM_RATE RATE_54 |
Bartlomiej Zolnierkiewicz | cc27706 | 2009-12-11 12:23:15 -0800 | [diff] [blame] | 1088 | #define RATE_6_5 12 /* HT mix */ |
| 1089 | #define RATE_13 13 /* HT mix */ |
| 1090 | #define RATE_19_5 14 /* HT mix */ |
| 1091 | #define RATE_26 15 /* HT mix */ |
| 1092 | #define RATE_39 16 /* HT mix */ |
| 1093 | #define RATE_52 17 /* HT mix */ |
| 1094 | #define RATE_58_5 18 /* HT mix */ |
| 1095 | #define RATE_65 19 /* HT mix */ |
| 1096 | #define RATE_78 20 /* HT mix */ |
| 1097 | #define RATE_104 21 /* HT mix */ |
| 1098 | #define RATE_117 22 /* HT mix */ |
| 1099 | #define RATE_130 23 /* HT mix */ |
| 1100 | /*#define RATE_AUTO_SWITCH 255 // for StaCfg.FixedTxRate only */ |
Greg Kroah-Hartman | 9198099 | 2008-10-28 14:48:09 -0700 | [diff] [blame] | 1101 | #define HTRATE_0 12 |
| 1102 | #define RATE_FIRST_MM_RATE HTRATE_0 |
| 1103 | #define RATE_FIRST_HT_RATE HTRATE_0 |
| 1104 | #define RATE_LAST_HT_RATE HTRATE_0 |
| 1105 | |
Bartlomiej Zolnierkiewicz | cc27706 | 2009-12-11 12:23:15 -0800 | [diff] [blame] | 1106 | /* pTxWI->txop */ |
| 1107 | #define IFS_HTTXOP 0 /* The txop will be handles by ASIC. */ |
Greg Kroah-Hartman | 9198099 | 2008-10-28 14:48:09 -0700 | [diff] [blame] | 1108 | #define IFS_PIFS 1 |
| 1109 | #define IFS_SIFS 2 |
| 1110 | #define IFS_BACKOFF 3 |
| 1111 | |
Bartlomiej Zolnierkiewicz | cc27706 | 2009-12-11 12:23:15 -0800 | [diff] [blame] | 1112 | /* pTxD->RetryMode */ |
Bartlomiej Zolnierkiewicz | 51126de | 2009-12-11 12:23:15 -0800 | [diff] [blame] | 1113 | #define long_RETRY 1 |
Greg Kroah-Hartman | 9198099 | 2008-10-28 14:48:09 -0700 | [diff] [blame] | 1114 | #define SHORT_RETRY 0 |
| 1115 | |
Bartlomiej Zolnierkiewicz | cc27706 | 2009-12-11 12:23:15 -0800 | [diff] [blame] | 1116 | /* Country Region definition */ |
Greg Kroah-Hartman | 9198099 | 2008-10-28 14:48:09 -0700 | [diff] [blame] | 1117 | #define REGION_MINIMUM_BG_BAND 0 |
Bartlomiej Zolnierkiewicz | cc27706 | 2009-12-11 12:23:15 -0800 | [diff] [blame] | 1118 | #define REGION_0_BG_BAND 0 /* 1-11 */ |
| 1119 | #define REGION_1_BG_BAND 1 /* 1-13 */ |
| 1120 | #define REGION_2_BG_BAND 2 /* 10-11 */ |
| 1121 | #define REGION_3_BG_BAND 3 /* 10-13 */ |
| 1122 | #define REGION_4_BG_BAND 4 /* 14 */ |
| 1123 | #define REGION_5_BG_BAND 5 /* 1-14 */ |
| 1124 | #define REGION_6_BG_BAND 6 /* 3-9 */ |
| 1125 | #define REGION_7_BG_BAND 7 /* 5-13 */ |
| 1126 | #define REGION_31_BG_BAND 31 /* 5-13 */ |
Greg Kroah-Hartman | 9198099 | 2008-10-28 14:48:09 -0700 | [diff] [blame] | 1127 | #define REGION_MAXIMUM_BG_BAND 7 |
| 1128 | |
| 1129 | #define REGION_MINIMUM_A_BAND 0 |
Bartlomiej Zolnierkiewicz | cc27706 | 2009-12-11 12:23:15 -0800 | [diff] [blame] | 1130 | #define REGION_0_A_BAND 0 /* 36, 40, 44, 48, 52, 56, 60, 64, 149, 153, 157, 161, 165 */ |
| 1131 | #define REGION_1_A_BAND 1 /* 36, 40, 44, 48, 52, 56, 60, 64, 100, 104, 108, 112, 116, 120, 124, 128, 132, 136, 140 */ |
| 1132 | #define REGION_2_A_BAND 2 /* 36, 40, 44, 48, 52, 56, 60, 64 */ |
| 1133 | #define REGION_3_A_BAND 3 /* 52, 56, 60, 64, 149, 153, 157, 161 */ |
| 1134 | #define REGION_4_A_BAND 4 /* 149, 153, 157, 161, 165 */ |
| 1135 | #define REGION_5_A_BAND 5 /* 149, 153, 157, 161 */ |
| 1136 | #define REGION_6_A_BAND 6 /* 36, 40, 44, 48 */ |
| 1137 | #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 */ |
| 1138 | #define REGION_8_A_BAND 8 /* 52, 56, 60, 64 */ |
| 1139 | #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 */ |
| 1140 | #define REGION_10_A_BAND 10 /* 36, 40, 44, 48, 149, 153, 157, 161, 165 */ |
| 1141 | #define REGION_11_A_BAND 11 /* 36, 40, 44, 48, 52, 56, 60, 64, 100, 104, 108, 112, 116, 120, 149, 153, 157, 161 */ |
| 1142 | #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 */ |
| 1143 | #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 */ |
| 1144 | #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 */ |
| 1145 | #define REGION_15_A_BAND 15 /* 149, 153, 157, 161, 165, 169, 173 */ |
Bartlomiej Zolnierkiewicz | ca97b83 | 2009-09-22 20:44:07 +0200 | [diff] [blame] | 1146 | #define REGION_MAXIMUM_A_BAND 15 |
Greg Kroah-Hartman | 9198099 | 2008-10-28 14:48:09 -0700 | [diff] [blame] | 1147 | |
Bartlomiej Zolnierkiewicz | cc27706 | 2009-12-11 12:23:15 -0800 | [diff] [blame] | 1148 | /* pTxD->CipherAlg */ |
Greg Kroah-Hartman | 9198099 | 2008-10-28 14:48:09 -0700 | [diff] [blame] | 1149 | #define CIPHER_NONE 0 |
| 1150 | #define CIPHER_WEP64 1 |
| 1151 | #define CIPHER_WEP128 2 |
| 1152 | #define CIPHER_TKIP 3 |
| 1153 | #define CIPHER_AES 4 |
| 1154 | #define CIPHER_CKIP64 5 |
| 1155 | #define CIPHER_CKIP128 6 |
Bartlomiej Zolnierkiewicz | cc27706 | 2009-12-11 12:23:15 -0800 | [diff] [blame] | 1156 | #define CIPHER_TKIP_NO_MIC 7 /* MIC appended by driver: not a valid value in hardware key table */ |
Greg Kroah-Hartman | 9198099 | 2008-10-28 14:48:09 -0700 | [diff] [blame] | 1157 | #define CIPHER_SMS4 8 |
| 1158 | |
Bartlomiej Zolnierkiewicz | cc27706 | 2009-12-11 12:23:15 -0800 | [diff] [blame] | 1159 | /* LED Status. */ |
Greg Kroah-Hartman | 9198099 | 2008-10-28 14:48:09 -0700 | [diff] [blame] | 1160 | #define LED_LINK_DOWN 0 |
| 1161 | #define LED_LINK_UP 1 |
| 1162 | #define LED_RADIO_OFF 2 |
| 1163 | #define LED_RADIO_ON 3 |
| 1164 | #define LED_HALT 4 |
| 1165 | #define LED_WPS 5 |
| 1166 | #define LED_ON_SITE_SURVEY 6 |
| 1167 | #define LED_POWER_UP 7 |
| 1168 | |
Bartlomiej Zolnierkiewicz | cc27706 | 2009-12-11 12:23:15 -0800 | [diff] [blame] | 1169 | /* value domain of pAd->LedCntl.LedMode and E2PROM */ |
Greg Kroah-Hartman | 9198099 | 2008-10-28 14:48:09 -0700 | [diff] [blame] | 1170 | #define LED_MODE_DEFAULT 0 |
| 1171 | #define LED_MODE_TWO_LED 1 |
Bartlomiej Zolnierkiewicz | cc27706 | 2009-12-11 12:23:15 -0800 | [diff] [blame] | 1172 | /*#define LED_MODE_SIGNAL_STREGTH 8 // EEPROM define =8 */ |
| 1173 | #define LED_MODE_SIGNAL_STREGTH 0x40 /* EEPROM define = 64 */ |
Greg Kroah-Hartman | 9198099 | 2008-10-28 14:48:09 -0700 | [diff] [blame] | 1174 | |
Bartlomiej Zolnierkiewicz | cc27706 | 2009-12-11 12:23:15 -0800 | [diff] [blame] | 1175 | /* RC4 init value, used fro WEP & TKIP */ |
Bartlomiej Zolnierkiewicz | 52b81c8 | 2009-12-11 12:23:14 -0800 | [diff] [blame] | 1176 | #define PPPINITFCS32 0xffffffff /* Initial FCS value */ |
Greg Kroah-Hartman | 9198099 | 2008-10-28 14:48:09 -0700 | [diff] [blame] | 1177 | |
Bartlomiej Zolnierkiewicz | cc27706 | 2009-12-11 12:23:15 -0800 | [diff] [blame] | 1178 | /* value domain of pAd->StaCfg.PortSecured. 802.1X controlled port definition */ |
Greg Kroah-Hartman | 9198099 | 2008-10-28 14:48:09 -0700 | [diff] [blame] | 1179 | #define WPA_802_1X_PORT_SECURED 1 |
| 1180 | #define WPA_802_1X_PORT_NOT_SECURED 2 |
| 1181 | |
| 1182 | #define PAIRWISE_KEY 1 |
| 1183 | #define GROUP_KEY 2 |
| 1184 | |
Bartlomiej Zolnierkiewicz | cc27706 | 2009-12-11 12:23:15 -0800 | [diff] [blame] | 1185 | /*definition of DRS */ |
Greg Kroah-Hartman | 9198099 | 2008-10-28 14:48:09 -0700 | [diff] [blame] | 1186 | #define MAX_STEP_OF_TX_RATE_SWITCH 32 |
| 1187 | |
Bartlomiej Zolnierkiewicz | cc27706 | 2009-12-11 12:23:15 -0800 | [diff] [blame] | 1188 | /* pre-allocated free NDIS PACKET/BUFFER poll for internal usage */ |
Greg Kroah-Hartman | 9198099 | 2008-10-28 14:48:09 -0700 | [diff] [blame] | 1189 | #define MAX_NUM_OF_FREE_NDIS_PACKET 128 |
| 1190 | |
Bartlomiej Zolnierkiewicz | cc27706 | 2009-12-11 12:23:15 -0800 | [diff] [blame] | 1191 | /*Block ACK */ |
Greg Kroah-Hartman | 9198099 | 2008-10-28 14:48:09 -0700 | [diff] [blame] | 1192 | #define MAX_TX_REORDERBUF 64 |
| 1193 | #define MAX_RX_REORDERBUF 64 |
| 1194 | #define DEFAULT_TX_TIMEOUT 30 |
| 1195 | #define DEFAULT_RX_TIMEOUT 30 |
| 1196 | |
Bartlomiej Zolnierkiewicz | cc27706 | 2009-12-11 12:23:15 -0800 | [diff] [blame] | 1197 | /* definition of Recipient or Originator */ |
Greg Kroah-Hartman | 9198099 | 2008-10-28 14:48:09 -0700 | [diff] [blame] | 1198 | #define I_RECIPIENT TRUE |
| 1199 | #define I_ORIGINATOR FALSE |
| 1200 | |
| 1201 | #define DEFAULT_BBP_TX_POWER 0 |
| 1202 | #define DEFAULT_RF_TX_POWER 5 |
| 1203 | |
| 1204 | #define MAX_INI_BUFFER_SIZE 4096 |
Bartlomiej Zolnierkiewicz | cc27706 | 2009-12-11 12:23:15 -0800 | [diff] [blame] | 1205 | #define MAX_PARAM_BUFFER_SIZE (2048) /* enough for ACL (18*64) */ |
| 1206 | /*18 : the length of Mac address acceptable format "01:02:03:04:05:06;") */ |
| 1207 | /*64 : MAX_NUM_OF_ACL_LIST */ |
| 1208 | /* definition of pAd->OpMode */ |
Greg Kroah-Hartman | 9198099 | 2008-10-28 14:48:09 -0700 | [diff] [blame] | 1209 | #define OPMODE_STA 0 |
| 1210 | #define OPMODE_AP 1 |
Bartlomiej Zolnierkiewicz | cc27706 | 2009-12-11 12:23:15 -0800 | [diff] [blame] | 1211 | /*#define OPMODE_L3_BRG 2 // as AP and STA at the same time */ |
Greg Kroah-Hartman | 9198099 | 2008-10-28 14:48:09 -0700 | [diff] [blame] | 1212 | |
Bartlomiej Zolnierkiewicz | cc27706 | 2009-12-11 12:23:15 -0800 | [diff] [blame] | 1213 | /* ========================= AP rtmp_def.h =========================== */ |
| 1214 | /* value domain for pAd->EventTab.Log[].Event */ |
Bartlomiej Zolnierkiewicz | 51126de | 2009-12-11 12:23:15 -0800 | [diff] [blame] | 1215 | #define EVENT_RESET_ACCESS_POint 0 /* Log = "hh:mm:ss Restart Access Point" */ |
Bartlomiej Zolnierkiewicz | cc27706 | 2009-12-11 12:23:15 -0800 | [diff] [blame] | 1216 | #define EVENT_ASSOCIATED 1 /* Log = "hh:mm:ss STA 00:01:02:03:04:05 associated" */ |
| 1217 | #define EVENT_DISASSOCIATED 2 /* Log = "hh:mm:ss STA 00:01:02:03:04:05 left this BSS" */ |
| 1218 | #define EVENT_AGED_OUT 3 /* Log = "hh:mm:ss STA 00:01:02:03:04:05 was aged-out and removed from this BSS" */ |
Greg Kroah-Hartman | 9198099 | 2008-10-28 14:48:09 -0700 | [diff] [blame] | 1219 | #define EVENT_COUNTER_M 4 |
| 1220 | #define EVENT_INVALID_PSK 5 |
| 1221 | #define EVENT_MAX_EVENT_TYPE 6 |
Bartlomiej Zolnierkiewicz | cc27706 | 2009-12-11 12:23:15 -0800 | [diff] [blame] | 1222 | /* ==== end of AP rtmp_def.h ============ */ |
Greg Kroah-Hartman | 9198099 | 2008-10-28 14:48:09 -0700 | [diff] [blame] | 1223 | |
Bartlomiej Zolnierkiewicz | cc27706 | 2009-12-11 12:23:15 -0800 | [diff] [blame] | 1224 | /* definition RSSI Number */ |
Greg Kroah-Hartman | 9198099 | 2008-10-28 14:48:09 -0700 | [diff] [blame] | 1225 | #define RSSI_0 0 |
| 1226 | #define RSSI_1 1 |
| 1227 | #define RSSI_2 2 |
| 1228 | |
Bartlomiej Zolnierkiewicz | cc27706 | 2009-12-11 12:23:15 -0800 | [diff] [blame] | 1229 | /* definition of radar detection */ |
| 1230 | #define RD_NORMAL_MODE 0 /* Not found radar signal */ |
| 1231 | #define RD_SWITCHING_MODE 1 /* Found radar signal, and doing channel switch */ |
| 1232 | #define RD_SILENCE_MODE 2 /* After channel switch, need to be silence a while to ensure radar not found */ |
Greg Kroah-Hartman | 9198099 | 2008-10-28 14:48:09 -0700 | [diff] [blame] | 1233 | |
Bartlomiej Zolnierkiewicz | cc27706 | 2009-12-11 12:23:15 -0800 | [diff] [blame] | 1234 | /*Driver defined cid for mapping status and command. */ |
Greg Kroah-Hartman | 9198099 | 2008-10-28 14:48:09 -0700 | [diff] [blame] | 1235 | #define SLEEPCID 0x11 |
| 1236 | #define WAKECID 0x22 |
| 1237 | #define QUERYPOWERCID 0x33 |
| 1238 | #define OWNERMCU 0x1 |
| 1239 | #define OWNERCPU 0x0 |
| 1240 | |
Bartlomiej Zolnierkiewicz | cc27706 | 2009-12-11 12:23:15 -0800 | [diff] [blame] | 1241 | /* MBSSID definition */ |
Greg Kroah-Hartman | 9198099 | 2008-10-28 14:48:09 -0700 | [diff] [blame] | 1242 | #define ENTRY_NOT_FOUND 0xFF |
| 1243 | |
Greg Kroah-Hartman | 9198099 | 2008-10-28 14:48:09 -0700 | [diff] [blame] | 1244 | /* After Linux 2.6.9, |
| 1245 | * VLAN module use Private (from user) interface flags (netdevice->priv_flags). |
| 1246 | * #define IFF_802_1Q_VLAN 0x1 -- 802.1Q VLAN device. in if.h |
| 1247 | * ref to ip_sabotage_out() [ out->priv_flags & IFF_802_1Q_VLAN ] in br_netfilter.c |
| 1248 | * |
| 1249 | * For this reason, we MUST use EVEN value in priv_flags |
| 1250 | */ |
| 1251 | #define INT_MAIN 0x0100 |
| 1252 | #define INT_MBSSID 0x0200 |
| 1253 | #define INT_WDS 0x0300 |
| 1254 | #define INT_APCLI 0x0400 |
| 1255 | #define INT_MESH 0x0500 |
| 1256 | |
Bartlomiej Zolnierkiewicz | ca97b83 | 2009-09-22 20:44:07 +0200 | [diff] [blame] | 1257 | #define INF_MAIN_DEV_NAME "wlan" |
| 1258 | #define INF_MBSSID_DEV_NAME "ra" |
| 1259 | #define INF_WDS_DEV_NAME "wds" |
| 1260 | #define INF_APCLI_DEV_NAME "apcli" |
| 1261 | #define INF_MESH_DEV_NAME "mesh" |
| 1262 | |
Bartlomiej Zolnierkiewicz | cc27706 | 2009-12-11 12:23:15 -0800 | [diff] [blame] | 1263 | /* WEP Key TYPE */ |
Greg Kroah-Hartman | 9198099 | 2008-10-28 14:48:09 -0700 | [diff] [blame] | 1264 | #define WEP_HEXADECIMAL_TYPE 0 |
| 1265 | #define WEP_ASCII_TYPE 1 |
| 1266 | |
Bartlomiej Zolnierkiewicz | cc27706 | 2009-12-11 12:23:15 -0800 | [diff] [blame] | 1267 | /* WIRELESS EVENTS definition */ |
Greg Kroah-Hartman | 9198099 | 2008-10-28 14:48:09 -0700 | [diff] [blame] | 1268 | /* Max number of char in custom event, refer to wireless_tools.28/wireless.20.h */ |
| 1269 | #define IW_CUSTOM_MAX_LEN 255 /* In bytes */ |
| 1270 | |
Bartlomiej Zolnierkiewicz | cc27706 | 2009-12-11 12:23:15 -0800 | [diff] [blame] | 1271 | /* For system event - start */ |
Greg Kroah-Hartman | 9198099 | 2008-10-28 14:48:09 -0700 | [diff] [blame] | 1272 | #define IW_SYS_EVENT_FLAG_START 0x0200 |
| 1273 | #define IW_ASSOC_EVENT_FLAG 0x0200 |
| 1274 | #define IW_DISASSOC_EVENT_FLAG 0x0201 |
| 1275 | #define IW_DEAUTH_EVENT_FLAG 0x0202 |
| 1276 | #define IW_AGEOUT_EVENT_FLAG 0x0203 |
| 1277 | #define IW_COUNTER_MEASURES_EVENT_FLAG 0x0204 |
| 1278 | #define IW_REPLAY_COUNTER_DIFF_EVENT_FLAG 0x0205 |
| 1279 | #define IW_RSNIE_DIFF_EVENT_FLAG 0x0206 |
| 1280 | #define IW_MIC_DIFF_EVENT_FLAG 0x0207 |
| 1281 | #define IW_ICV_ERROR_EVENT_FLAG 0x0208 |
| 1282 | #define IW_MIC_ERROR_EVENT_FLAG 0x0209 |
| 1283 | #define IW_GROUP_HS_TIMEOUT_EVENT_FLAG 0x020A |
| 1284 | #define IW_PAIRWISE_HS_TIMEOUT_EVENT_FLAG 0x020B |
| 1285 | #define IW_RSNIE_SANITY_FAIL_EVENT_FLAG 0x020C |
| 1286 | #define IW_SET_KEY_DONE_WPA1_EVENT_FLAG 0x020D |
| 1287 | #define IW_SET_KEY_DONE_WPA2_EVENT_FLAG 0x020E |
| 1288 | #define IW_STA_LINKUP_EVENT_FLAG 0x020F |
| 1289 | #define IW_STA_LINKDOWN_EVENT_FLAG 0x0210 |
| 1290 | #define IW_SCAN_COMPLETED_EVENT_FLAG 0x0211 |
| 1291 | #define IW_SCAN_ENQUEUE_FAIL_EVENT_FLAG 0x0212 |
Justin P. Mattock | 6ccb5d7 | 2010-11-08 13:41:46 -0800 | [diff] [blame] | 1292 | /* if add new system event flag, please update the IW_SYS_EVENT_FLAG_END */ |
Greg Kroah-Hartman | 9198099 | 2008-10-28 14:48:09 -0700 | [diff] [blame] | 1293 | #define IW_SYS_EVENT_FLAG_END 0x0212 |
| 1294 | #define IW_SYS_EVENT_TYPE_NUM (IW_SYS_EVENT_FLAG_END - IW_SYS_EVENT_FLAG_START + 1) |
Bartlomiej Zolnierkiewicz | cc27706 | 2009-12-11 12:23:15 -0800 | [diff] [blame] | 1295 | /* For system event - end */ |
Greg Kroah-Hartman | 9198099 | 2008-10-28 14:48:09 -0700 | [diff] [blame] | 1296 | |
Bartlomiej Zolnierkiewicz | cc27706 | 2009-12-11 12:23:15 -0800 | [diff] [blame] | 1297 | /* For spoof attack event - start */ |
Greg Kroah-Hartman | 9198099 | 2008-10-28 14:48:09 -0700 | [diff] [blame] | 1298 | #define IW_SPOOF_EVENT_FLAG_START 0x0300 |
| 1299 | #define IW_CONFLICT_SSID_EVENT_FLAG 0x0300 |
| 1300 | #define IW_SPOOF_ASSOC_RESP_EVENT_FLAG 0x0301 |
| 1301 | #define IW_SPOOF_REASSOC_RESP_EVENT_FLAG 0x0302 |
| 1302 | #define IW_SPOOF_PROBE_RESP_EVENT_FLAG 0x0303 |
| 1303 | #define IW_SPOOF_BEACON_EVENT_FLAG 0x0304 |
| 1304 | #define IW_SPOOF_DISASSOC_EVENT_FLAG 0x0305 |
| 1305 | #define IW_SPOOF_AUTH_EVENT_FLAG 0x0306 |
| 1306 | #define IW_SPOOF_DEAUTH_EVENT_FLAG 0x0307 |
| 1307 | #define IW_SPOOF_UNKNOWN_MGMT_EVENT_FLAG 0x0308 |
| 1308 | #define IW_REPLAY_ATTACK_EVENT_FLAG 0x0309 |
Justin P. Mattock | 6ccb5d7 | 2010-11-08 13:41:46 -0800 | [diff] [blame] | 1309 | /* if add new spoof attack event flag, please update the IW_SPOOF_EVENT_FLAG_END */ |
Greg Kroah-Hartman | 9198099 | 2008-10-28 14:48:09 -0700 | [diff] [blame] | 1310 | #define IW_SPOOF_EVENT_FLAG_END 0x0309 |
| 1311 | #define IW_SPOOF_EVENT_TYPE_NUM (IW_SPOOF_EVENT_FLAG_END - IW_SPOOF_EVENT_FLAG_START + 1) |
Bartlomiej Zolnierkiewicz | cc27706 | 2009-12-11 12:23:15 -0800 | [diff] [blame] | 1312 | /* For spoof attack event - end */ |
Greg Kroah-Hartman | 9198099 | 2008-10-28 14:48:09 -0700 | [diff] [blame] | 1313 | |
Bartlomiej Zolnierkiewicz | cc27706 | 2009-12-11 12:23:15 -0800 | [diff] [blame] | 1314 | /* For flooding attack event - start */ |
Greg Kroah-Hartman | 9198099 | 2008-10-28 14:48:09 -0700 | [diff] [blame] | 1315 | #define IW_FLOOD_EVENT_FLAG_START 0x0400 |
| 1316 | #define IW_FLOOD_AUTH_EVENT_FLAG 0x0400 |
| 1317 | #define IW_FLOOD_ASSOC_REQ_EVENT_FLAG 0x0401 |
| 1318 | #define IW_FLOOD_REASSOC_REQ_EVENT_FLAG 0x0402 |
| 1319 | #define IW_FLOOD_PROBE_REQ_EVENT_FLAG 0x0403 |
| 1320 | #define IW_FLOOD_DISASSOC_EVENT_FLAG 0x0404 |
| 1321 | #define IW_FLOOD_DEAUTH_EVENT_FLAG 0x0405 |
| 1322 | #define IW_FLOOD_EAP_REQ_EVENT_FLAG 0x0406 |
Justin P. Mattock | 6ccb5d7 | 2010-11-08 13:41:46 -0800 | [diff] [blame] | 1323 | /* if add new flooding attack event flag, please update the IW_FLOOD_EVENT_FLAG_END */ |
Greg Kroah-Hartman | 9198099 | 2008-10-28 14:48:09 -0700 | [diff] [blame] | 1324 | #define IW_FLOOD_EVENT_FLAG_END 0x0406 |
| 1325 | #define IW_FLOOD_EVENT_TYPE_NUM (IW_FLOOD_EVENT_FLAG_END - IW_FLOOD_EVENT_FLAG_START + 1) |
Bartlomiej Zolnierkiewicz | cc27706 | 2009-12-11 12:23:15 -0800 | [diff] [blame] | 1326 | /* For flooding attack - end */ |
Greg Kroah-Hartman | 9198099 | 2008-10-28 14:48:09 -0700 | [diff] [blame] | 1327 | |
Bartlomiej Zolnierkiewicz | cc27706 | 2009-12-11 12:23:15 -0800 | [diff] [blame] | 1328 | /* End - WIRELESS EVENTS definition */ |
Greg Kroah-Hartman | 9198099 | 2008-10-28 14:48:09 -0700 | [diff] [blame] | 1329 | |
Bartlomiej Zolnierkiewicz | cc27706 | 2009-12-11 12:23:15 -0800 | [diff] [blame] | 1330 | /* definition for DLS, kathy */ |
Greg Kroah-Hartman | 9198099 | 2008-10-28 14:48:09 -0700 | [diff] [blame] | 1331 | #define MAX_NUM_OF_INIT_DLS_ENTRY 1 |
| 1332 | #define MAX_NUM_OF_DLS_ENTRY MAX_NUMBER_OF_DLS_ENTRY |
| 1333 | |
Bartlomiej Zolnierkiewicz | cc27706 | 2009-12-11 12:23:15 -0800 | [diff] [blame] | 1334 | /*Block ACK, kathy */ |
Greg Kroah-Hartman | 9198099 | 2008-10-28 14:48:09 -0700 | [diff] [blame] | 1335 | #define MAX_TX_REORDERBUF 64 |
| 1336 | #define MAX_RX_REORDERBUF 64 |
| 1337 | #define DEFAULT_TX_TIMEOUT 30 |
| 1338 | #define DEFAULT_RX_TIMEOUT 30 |
Greg Kroah-Hartman | 9198099 | 2008-10-28 14:48:09 -0700 | [diff] [blame] | 1339 | #define MAX_BARECI_SESSION 8 |
Greg Kroah-Hartman | 9198099 | 2008-10-28 14:48:09 -0700 | [diff] [blame] | 1340 | |
| 1341 | #ifndef IW_ESSID_MAX_SIZE |
| 1342 | /* Maximum size of the ESSID and pAd->nickname strings */ |
| 1343 | #define IW_ESSID_MAX_SIZE 32 |
| 1344 | #endif |
Greg Kroah-Hartman | 9198099 | 2008-10-28 14:48:09 -0700 | [diff] [blame] | 1345 | |
Bartlomiej Zolnierkiewicz | cc27706 | 2009-12-11 12:23:15 -0800 | [diff] [blame] | 1346 | /* For AsicRadioOff/AsicRadioOn function */ |
Bartlomiej Zolnierkiewicz | 3a32ed1 | 2009-04-26 16:06:25 +0200 | [diff] [blame] | 1347 | #define DOT11POWERSAVE 0 |
| 1348 | #define GUIRADIO_OFF 1 |
| 1349 | #define RTMP_HALT 2 |
| 1350 | #define GUI_IDLE_POWER_SAVE 3 |
Bartlomiej Zolnierkiewicz | cc27706 | 2009-12-11 12:23:15 -0800 | [diff] [blame] | 1351 | /* -- */ |
Bartlomiej Zolnierkiewicz | ca97b83 | 2009-09-22 20:44:07 +0200 | [diff] [blame] | 1352 | |
Bartlomiej Zolnierkiewicz | cc27706 | 2009-12-11 12:23:15 -0800 | [diff] [blame] | 1353 | /* definition for WpaSupport flag */ |
Greg Kroah-Hartman | 9198099 | 2008-10-28 14:48:09 -0700 | [diff] [blame] | 1354 | #define WPA_SUPPLICANT_DISABLE 0 |
| 1355 | #define WPA_SUPPLICANT_ENABLE 1 |
| 1356 | #define WPA_SUPPLICANT_ENABLE_WITH_WEB_UI 2 |
| 1357 | |
Bartlomiej Zolnierkiewicz | cc27706 | 2009-12-11 12:23:15 -0800 | [diff] [blame] | 1358 | /* Endian byte swapping codes */ |
Greg Kroah-Hartman | 9198099 | 2008-10-28 14:48:09 -0700 | [diff] [blame] | 1359 | #define SWAP16(x) \ |
Bartlomiej Zolnierkiewicz | 51126de | 2009-12-11 12:23:15 -0800 | [diff] [blame] | 1360 | ((u16)( \ |
| 1361 | (((u16)(x) & (u16)0x00ffU) << 8) | \ |
| 1362 | (((u16)(x) & (u16)0xff00U) >> 8) )) |
Greg Kroah-Hartman | 9198099 | 2008-10-28 14:48:09 -0700 | [diff] [blame] | 1363 | |
| 1364 | #define SWAP32(x) \ |
Bartlomiej Zolnierkiewicz | 51126de | 2009-12-11 12:23:15 -0800 | [diff] [blame] | 1365 | ((u32)( \ |
| 1366 | (((u32)(x) & (u32)0x000000ffUL) << 24) | \ |
| 1367 | (((u32)(x) & (u32)0x0000ff00UL) << 8) | \ |
| 1368 | (((u32)(x) & (u32)0x00ff0000UL) >> 8) | \ |
| 1369 | (((u32)(x) & (u32)0xff000000UL) >> 24) )) |
Greg Kroah-Hartman | 9198099 | 2008-10-28 14:48:09 -0700 | [diff] [blame] | 1370 | |
| 1371 | #define SWAP64(x) \ |
Bartlomiej Zolnierkiewicz | 51126de | 2009-12-11 12:23:15 -0800 | [diff] [blame] | 1372 | ((u64)( \ |
| 1373 | (u64)(((u64)(x) & (u64)0x00000000000000ffULL) << 56) | \ |
| 1374 | (u64)(((u64)(x) & (u64)0x000000000000ff00ULL) << 40) | \ |
| 1375 | (u64)(((u64)(x) & (u64)0x0000000000ff0000ULL) << 24) | \ |
| 1376 | (u64)(((u64)(x) & (u64)0x00000000ff000000ULL) << 8) | \ |
| 1377 | (u64)(((u64)(x) & (u64)0x000000ff00000000ULL) >> 8) | \ |
| 1378 | (u64)(((u64)(x) & (u64)0x0000ff0000000000ULL) >> 24) | \ |
| 1379 | (u64)(((u64)(x) & (u64)0x00ff000000000000ULL) >> 40) | \ |
| 1380 | (u64)(((u64)(x) & (u64)0xff00000000000000ULL) >> 56) )) |
Greg Kroah-Hartman | 9198099 | 2008-10-28 14:48:09 -0700 | [diff] [blame] | 1381 | |
Bartlomiej Zolnierkiewicz | 51126de | 2009-12-11 12:23:15 -0800 | [diff] [blame] | 1382 | #define cpu2le64(x) ((u64)(x)) |
| 1383 | #define le2cpu64(x) ((u64)(x)) |
| 1384 | #define cpu2le32(x) ((u32)(x)) |
| 1385 | #define le2cpu32(x) ((u32)(x)) |
| 1386 | #define cpu2le16(x) ((u16)(x)) |
| 1387 | #define le2cpu16(x) ((u16)(x)) |
Greg Kroah-Hartman | 9198099 | 2008-10-28 14:48:09 -0700 | [diff] [blame] | 1388 | #define cpu2be64(x) SWAP64((x)) |
| 1389 | #define be2cpu64(x) SWAP64((x)) |
| 1390 | #define cpu2be32(x) SWAP32((x)) |
| 1391 | #define be2cpu32(x) SWAP32((x)) |
| 1392 | #define cpu2be16(x) SWAP16((x)) |
| 1393 | #define be2cpu16(x) SWAP16((x)) |
| 1394 | |
Bartlomiej Zolnierkiewicz | ca97b83 | 2009-09-22 20:44:07 +0200 | [diff] [blame] | 1395 | #define ABS(_x, _y) ((_x) > (_y)) ? ((_x) -(_y)) : ((_y) -(_x)) |
| 1396 | |
Bartlomiej Zolnierkiewicz | ca97b83 | 2009-09-22 20:44:07 +0200 | [diff] [blame] | 1397 | #define A2Dec(_X, _p) \ |
| 1398 | { \ |
Bartlomiej Zolnierkiewicz | 51126de | 2009-12-11 12:23:15 -0800 | [diff] [blame] | 1399 | u8 *p; \ |
Bartlomiej Zolnierkiewicz | ca97b83 | 2009-09-22 20:44:07 +0200 | [diff] [blame] | 1400 | _X = 0; \ |
| 1401 | p = _p; \ |
| 1402 | while (((*p >= '0') && (*p <= '9'))) \ |
| 1403 | { \ |
| 1404 | if ((*p >= '0') && (*p <= '9')) \ |
| 1405 | _X = _X * 10 + *p - 48; \ |
| 1406 | p++; \ |
| 1407 | } \ |
| 1408 | } |
| 1409 | |
Bartlomiej Zolnierkiewicz | ca97b83 | 2009-09-22 20:44:07 +0200 | [diff] [blame] | 1410 | #define A2Hex(_X, _p) \ |
| 1411 | do{ \ |
| 1412 | char *__p; \ |
| 1413 | (_X) = 0; \ |
| 1414 | __p = (char *)(_p); \ |
| 1415 | while (((*__p >= 'a') && (*__p <= 'f')) || ((*__p >= 'A') && (*__p <= 'F')) || ((*__p >= '0') && (*__p <= '9'))) \ |
| 1416 | { \ |
| 1417 | if ((*__p >= 'a') && (*__p <= 'f')) \ |
| 1418 | (_X) = (_X) * 16 + *__p - 87; \ |
| 1419 | else if ((*__p >= 'A') && (*__p <= 'F')) \ |
| 1420 | (_X) = (_X) * 16 + *__p - 55; \ |
| 1421 | else if ((*__p >= '0') && (*__p <= '9')) \ |
| 1422 | (_X) = (_X) * 16 + *__p - 48; \ |
| 1423 | __p++; \ |
| 1424 | } \ |
| 1425 | }while(0) |
| 1426 | |
Bartlomiej Zolnierkiewicz | cc27706 | 2009-12-11 12:23:15 -0800 | [diff] [blame] | 1427 | #endif /* __RTMP_DEF_H__ */ |