Btrfs: device_list_add() should not update list when mounted
[linux/fpc-iii.git] / drivers / staging / vt6655 / key.h
blob4b8b4b6bd6cd7c557e338e580fb3ecf42fde76ff
1 /*
2 * Copyright (c) 1996, 2003 VIA Networking Technologies, Inc.
3 * All rights reserved.
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; either version 2 of the License, or
8 * (at your option) any later version.
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
15 * You should have received a copy of the GNU General Public License along
16 * with this program; if not, write to the Free Software Foundation, Inc.,
17 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
20 * File: key.h
22 * Purpose: Implement functions for 802.11i Key management
24 * Author: Jerry Chen
26 * Date: May 29, 2003
30 #ifndef __KEY_H__
31 #define __KEY_H__
33 #include "ttype.h"
34 #include "tether.h"
35 #include "80211mgr.h"
37 /*--------------------- Export Definitions -------------------------*/
38 #define MAX_GROUP_KEY 4
39 #define MAX_KEY_TABLE 11
40 #define MAX_KEY_LEN 32
41 #define AES_KEY_LEN 16
43 #define AUTHENTICATOR_KEY 0x10000000
44 #define USE_KEYRSC 0x20000000
45 #define PAIRWISE_KEY 0x40000000
46 #define TRANSMIT_KEY 0x80000000
48 #define GROUP_KEY 0x00000000
50 #define KEY_CTL_WEP 0x00
51 #define KEY_CTL_NONE 0x01
52 #define KEY_CTL_TKIP 0x02
53 #define KEY_CTL_CCMP 0x03
54 #define KEY_CTL_INVALID 0xFF
56 typedef struct tagSKeyItem
58 bool bKeyValid;
59 unsigned long uKeyLength;
60 unsigned char abyKey[MAX_KEY_LEN];
61 QWORD KeyRSC;
62 unsigned long dwTSC47_16;
63 unsigned short wTSC15_0;
64 unsigned char byCipherSuite;
65 unsigned char byReserved0;
66 unsigned long dwKeyIndex;
67 void *pvKeyTable;
68 } SKeyItem, *PSKeyItem; //64
70 typedef struct tagSKeyTable
72 unsigned char abyBSSID[ETH_ALEN]; //6
73 unsigned char byReserved0[2]; //8
74 SKeyItem PairwiseKey;
75 SKeyItem GroupKey[MAX_GROUP_KEY]; //64*5 = 320, 320+8=328
76 unsigned long dwGTKeyIndex; // GroupTransmitKey Index
77 bool bInUse;
78 //2006-1116-01,<Modify> by NomadZhao
79 bool bSoftWEP;
80 unsigned short wKeyCtl; // for address of wKeyCtl at align 4
82 unsigned char byReserved1[6];
83 } SKeyTable, *PSKeyTable; //348
85 typedef struct tagSKeyManagement
87 SKeyTable KeyTable[MAX_KEY_TABLE];
88 } SKeyManagement, *PSKeyManagement;
90 /*--------------------- Export Types ------------------------------*/
92 /*--------------------- Export Macros ------------------------------*/
94 /*--------------------- Export Classes ----------------------------*/
96 /*--------------------- Export Variables --------------------------*/
98 /*--------------------- Export Functions --------------------------*/
100 void KeyvInitTable(PSKeyManagement pTable, unsigned long dwIoBase);
102 bool KeybGetKey(
103 PSKeyManagement pTable,
104 unsigned char *pbyBSSID,
105 unsigned long dwKeyIndex,
106 PSKeyItem *pKey
109 bool KeybSetKey(
110 PSKeyManagement pTable,
111 unsigned char *pbyBSSID,
112 unsigned long dwKeyIndex,
113 unsigned long uKeyLength,
114 PQWORD pKeyRSC,
115 unsigned char *pbyKey,
116 unsigned char byKeyDecMode,
117 unsigned long dwIoBase,
118 unsigned char byLocalID
121 bool KeybSetDefaultKey(
122 PSKeyManagement pTable,
123 unsigned long dwKeyIndex,
124 unsigned long uKeyLength,
125 PQWORD pKeyRSC,
126 unsigned char *pbyKey,
127 unsigned char byKeyDecMode,
128 unsigned long dwIoBase,
129 unsigned char byLocalID
132 bool KeybRemoveKey(
133 PSKeyManagement pTable,
134 unsigned char *pbyBSSID,
135 unsigned long dwKeyIndex,
136 unsigned long dwIoBase
139 bool KeybGetTransmitKey(
140 PSKeyManagement pTable,
141 unsigned char *pbyBSSID,
142 unsigned long dwKeyType,
143 PSKeyItem *pKey
146 bool KeybCheckPairewiseKey(
147 PSKeyManagement pTable,
148 PSKeyItem *pKey
151 bool KeybRemoveAllKey(
152 PSKeyManagement pTable,
153 unsigned char *pbyBSSID,
154 unsigned long dwIoBase
157 void KeyvRemoveWEPKey(
158 PSKeyManagement pTable,
159 unsigned long dwKeyIndex,
160 unsigned long dwIoBase
163 void KeyvRemoveAllWEPKey(
164 PSKeyManagement pTable,
165 unsigned long dwIoBase
168 bool KeybSetAllGroupKey(
169 PSKeyManagement pTable,
170 unsigned long dwKeyIndex,
171 unsigned long uKeyLength,
172 PQWORD pKeyRSC,
173 unsigned char *pbyKey,
174 unsigned char byKeyDecMode,
175 unsigned long dwIoBase,
176 unsigned char byLocalID
179 #endif // __KEY_H__