GUI: Fix Tomato RAF theme for all builds. Compilation typo.
[tomato.git] / release / src-rt-6.x.4708 / linux / linux-2.6.36 / drivers / staging / rt2860 / rtusb_io.h
blob64a2fe43528427e1341f0f9c66fc16857b2ed81f
1 /*
2 *************************************************************************
3 * Ralink Tech Inc.
4 * 5F., No.36, Taiyuan St., Jhubei City,
5 * Hsinchu County 302,
6 * Taiwan, R.O.C.
8 * (c) Copyright 2002-2007, Ralink Technology, Inc.
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 *************************************************************************
28 #ifndef __RTUSB_IO_H__
29 #define __RTUSB_IO_H__
31 #include "rtmp_type.h"
33 /* New for MeetingHouse Api support */
34 #define CMDTHREAD_VENDOR_RESET 0x0D730101 /* cmd */
35 #define CMDTHREAD_VENDOR_UNPLUG 0x0D730102 /* cmd */
36 #define CMDTHREAD_VENDOR_SWITCH_FUNCTION 0x0D730103 /* cmd */
37 #define CMDTHREAD_MULTI_WRITE_MAC 0x0D730107 /* cmd */
38 #define CMDTHREAD_MULTI_READ_MAC 0x0D730108 /* cmd */
39 #define CMDTHREAD_VENDOR_EEPROM_WRITE 0x0D73010A /* cmd */
40 #define CMDTHREAD_VENDOR_EEPROM_READ 0x0D73010B /* cmd */
41 #define CMDTHREAD_VENDOR_ENTER_TESTMODE 0x0D73010C /* cmd */
42 #define CMDTHREAD_VENDOR_EXIT_TESTMODE 0x0D73010D /* cmd */
43 #define CMDTHREAD_VENDOR_WRITE_BBP 0x0D730119 /* cmd */
44 #define CMDTHREAD_VENDOR_READ_BBP 0x0D730118 /* cmd */
45 #define CMDTHREAD_VENDOR_WRITE_RF 0x0D73011A /* cmd */
46 #define CMDTHREAD_VENDOR_FLIP_IQ 0x0D73011D /* cmd */
47 #define CMDTHREAD_RESET_BULK_OUT 0x0D730210 /* cmd */
48 #define CMDTHREAD_RESET_BULK_IN 0x0D730211 /* cmd */
49 #define CMDTHREAD_SET_PSM_BIT 0x0D730212 /* cmd */
50 #define CMDTHREAD_SET_RADIO 0x0D730214 /* cmd */
51 #define CMDTHREAD_UPDATE_TX_RATE 0x0D730216 /* cmd */
52 #define CMDTHREAD_802_11_ADD_KEY_WEP 0x0D730218 /* cmd */
53 #define CMDTHREAD_RESET_FROM_ERROR 0x0D73021A /* cmd */
54 #define CMDTHREAD_LINK_DOWN 0x0D73021B /* cmd */
55 #define CMDTHREAD_RESET_FROM_NDIS 0x0D73021C /* cmd */
56 #define CMDTHREAD_CHECK_GPIO 0x0D730215 /* cmd */
57 #define CMDTHREAD_FORCE_WAKE_UP 0x0D730222 /* cmd */
58 #define CMDTHREAD_SET_BW 0x0D730225 /* cmd */
59 #define CMDTHREAD_SET_ASIC_WCID 0x0D730226 /* cmd */
60 #define CMDTHREAD_SET_ASIC_WCID_CIPHER 0x0D730227 /* cmd */
61 #define CMDTHREAD_QKERIODIC_EXECUT 0x0D73023D /* cmd */
62 #define RT_CMD_SET_KEY_TABLE 0x0D730228 /* cmd */
63 #define RT_CMD_SET_RX_WCID_TABLE 0x0D730229 /* cmd */
64 #define CMDTHREAD_SET_CLIENT_MAC_ENTRY 0x0D73023E /* cmd */
65 #define CMDTHREAD_SET_GROUP_KEY 0x0D73023F /* cmd */
66 #define CMDTHREAD_SET_PAIRWISE_KEY 0x0D730240 /* cmd */
68 #define CMDTHREAD_802_11_QUERY_HARDWARE_REGISTER 0x0D710105 /* cmd */
69 #define CMDTHREAD_802_11_SET_PHY_MODE 0x0D79010C /* cmd */
70 #define CMDTHREAD_802_11_SET_STA_CONFIG 0x0D790111 /* cmd */
71 #define CMDTHREAD_802_11_SET_PREAMBLE 0x0D790101 /* cmd */
72 #define CMDTHREAD_802_11_COUNTER_MEASURE 0x0D790102 /* cmd */
73 /* add by johnli, fix "in_interrupt" error when call "MacTableDeleteEntry" in Rx tasklet */
74 #define CMDTHREAD_UPDATE_PROTECT 0x0D790103 /* cmd */
75 /* end johnli */
77 /*CMDTHREAD_MULTI_READ_MAC */
78 /*CMDTHREAD_MULTI_WRITE_MAC */
79 /*CMDTHREAD_VENDOR_EEPROM_READ */
80 /*CMDTHREAD_VENDOR_EEPROM_WRITE */
81 struct rt_cmdhandler_tlv {
82 u16 Offset;
83 u16 Length;
84 u8 DataFirst;
87 struct rt_cmdqelmt;
89 struct rt_cmdqelmt {
90 u32 command;
91 void *buffer;
92 unsigned long bufferlength;
93 BOOLEAN CmdFromNdis;
94 BOOLEAN SetOperation;
95 struct rt_cmdqelmt *next;
98 struct rt_cmdq {
99 u32 size;
100 struct rt_cmdqelmt *head;
101 struct rt_cmdqelmt *tail;
102 u32 CmdQState;
105 #define EnqueueCmd(cmdq, cmdqelmt) \
107 if (cmdq->size == 0) \
108 cmdq->head = cmdqelmt; \
109 else \
110 cmdq->tail->next = cmdqelmt; \
111 cmdq->tail = cmdqelmt; \
112 cmdqelmt->next = NULL; \
113 cmdq->size++; \
116 /******************************************************************************
118 USB Cmd to ASIC Related MACRO
120 ******************************************************************************/
121 /* reset MAC of a station entry to 0xFFFFFFFFFFFF */
122 #define RTMP_STA_ENTRY_MAC_RESET(pAd, Wcid) \
123 { struct rt_set_asic_wcid SetAsicWcid; \
124 SetAsicWcid.WCID = Wcid; \
125 SetAsicWcid.SetTid = 0xffffffff; \
126 SetAsicWcid.DeleteTid = 0xffffffff; \
127 RTUSBEnqueueInternalCmd(pAd, CMDTHREAD_SET_ASIC_WCID, \
128 &SetAsicWcid, sizeof(struct rt_set_asic_wcid)); }
130 /* add this entry into ASIC RX WCID search table */
131 #define RTMP_STA_ENTRY_ADD(pAd, pEntry) \
132 RTUSBEnqueueInternalCmd(pAd, CMDTHREAD_SET_CLIENT_MAC_ENTRY, \
133 pEntry, sizeof(struct rt_mac_table_entry));
135 /* add by johnli, fix "in_interrupt" error when call "MacTableDeleteEntry" in Rx tasklet */
136 /* Set MAC register value according operation mode */
137 #define RTMP_UPDATE_PROTECT(pAd) \
138 RTUSBEnqueueInternalCmd(pAd, CMDTHREAD_UPDATE_PROTECT, NULL, 0);
139 /* end johnli */
141 /* remove Pair-wise key material from ASIC */
142 /* yet implement */
143 #define RTMP_STA_ENTRY_KEY_DEL(pAd, BssIdx, Wcid)
145 /* add Client security information into ASIC WCID table and IVEIV table */
146 #define RTMP_STA_SECURITY_INFO_ADD(pAd, apidx, KeyID, pEntry) \
147 { RTMP_STA_ENTRY_MAC_RESET(pAd, pEntry->Aid); \
148 if (pEntry->Aid >= 1) { \
149 struct rt_set_asic_wcid_attri SetAsicWcidAttri; \
150 SetAsicWcidAttri.WCID = pEntry->Aid; \
151 if ((pEntry->AuthMode <= Ndis802_11AuthModeAutoSwitch) && \
152 (pEntry->WepStatus == Ndis802_11Encryption1Enabled)) \
154 SetAsicWcidAttri.Cipher = pAd->SharedKey[apidx][KeyID].CipherAlg; \
156 else if (pEntry->AuthMode == Ndis802_11AuthModeWPANone) \
158 SetAsicWcidAttri.Cipher = pAd->SharedKey[apidx][KeyID].CipherAlg; \
160 else SetAsicWcidAttri.Cipher = 0; \
161 DBGPRINT(RT_DEBUG_TRACE, ("aid cipher = %ld\n",SetAsicWcidAttri.Cipher)); \
162 RTUSBEnqueueInternalCmd(pAd, CMDTHREAD_SET_ASIC_WCID_CIPHER, \
163 &SetAsicWcidAttri, sizeof(struct rt_set_asic_wcid_attri)); } }
165 /* Insert the BA bitmap to ASIC for the Wcid entry */
166 #define RTMP_ADD_BA_SESSION_TO_ASIC(_pAd, _Aid, _TID) \
167 do{ \
168 struct rt_set_asic_wcid SetAsicWcid; \
169 SetAsicWcid.WCID = (_Aid); \
170 SetAsicWcid.SetTid = (0x10000<<(_TID)); \
171 SetAsicWcid.DeleteTid = 0xffffffff; \
172 RTUSBEnqueueInternalCmd((_pAd), CMDTHREAD_SET_ASIC_WCID, &SetAsicWcid, sizeof(struct rt_set_asic_wcid)); \
173 }while(0)
175 /* Remove the BA bitmap from ASIC for the Wcid entry */
176 #define RTMP_DEL_BA_SESSION_FROM_ASIC(_pAd, _Wcid, _TID) \
177 do{ \
178 struct rt_set_asic_wcid SetAsicWcid; \
179 SetAsicWcid.WCID = (_Wcid); \
180 SetAsicWcid.SetTid = (0xffffffff); \
181 SetAsicWcid.DeleteTid = (0x10000<<(_TID) ); \
182 RTUSBEnqueueInternalCmd((_pAd), CMDTHREAD_SET_ASIC_WCID, &SetAsicWcid, sizeof(struct rt_set_asic_wcid)); \
183 }while(0)
185 #endif /* __RTUSB_IO_H__ // */