summaryrefslogtreecommitdiff
path: root/drivers/staging/vt6656/key.h
diff options
context:
space:
mode:
authorForest Bond <forest@alittletooquiet.net>2009-06-13 07:38:31 -0400
committerGreg Kroah-Hartman <gregkh@suse.de>2009-09-15 12:01:32 -0700
commit92b96797118e5836294a6d42a5a8e10b86f50e3f (patch)
tree1eceb1d70adc634da006f38c951a515de746e2c2 /drivers/staging/vt6656/key.h
parent36c7928c3e948cf8862d4b5c3df27c5a841cb503 (diff)
Staging: Add pristine upstream vt6656 driver sources to drivers/staging/vt6656.
Add pristine upstream vt6656 driver sources to drivers/staging/vt6656. These files were copied from the driver directory in the upstream source archive, available here: http://www.viaarena.com/Driver/VT6656_Linux_src_v1.19_12_x86.zip After copying, trailing whitespace was stripped. This is GPL-licensed code. Signed-off-by: Forest Bond <forest@alittletooquiet.net> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/staging/vt6656/key.h')
-rw-r--r--drivers/staging/vt6656/key.h196
1 files changed, 196 insertions, 0 deletions
diff --git a/drivers/staging/vt6656/key.h b/drivers/staging/vt6656/key.h
new file mode 100644
index 000000000000..6777406df02b
--- /dev/null
+++ b/drivers/staging/vt6656/key.h
@@ -0,0 +1,196 @@
+/*
+ * Copyright (c) 1996, 2003 VIA Networking Technologies, Inc.
+ * All rights reserved.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with this program; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ *
+ * File: key.h
+ *
+ * Purpose: Implement functions for 802.11i Key management
+ *
+ * Author: Jerry Chen
+ *
+ * Date: May 29, 2003
+ *
+ */
+
+
+#ifndef __KEY_H__
+#define __KEY_H__
+
+#if !defined(__TTYPE_H__)
+#include "ttype.h"
+#endif
+
+#if !defined(__TETHER_H__)
+#include "tether.h"
+#endif
+
+#if !defined(__80211MGR_H__)
+#include "80211mgr.h"
+#endif
+
+/*--------------------- Export Definitions -------------------------*/
+#define MAX_GROUP_KEY 4
+#define MAX_KEY_TABLE 11
+#define MAX_KEY_LEN 32
+#define AES_KEY_LEN 16
+
+
+#define AUTHENTICATOR_KEY 0x10000000
+#define USE_KEYRSC 0x20000000
+#define PAIRWISE_KEY 0x40000000
+#define TRANSMIT_KEY 0x80000000
+
+#define GROUP_KEY 0x00000000
+
+#define KEY_CTL_WEP 0x00
+#define KEY_CTL_NONE 0x01
+#define KEY_CTL_TKIP 0x02
+#define KEY_CTL_CCMP 0x03
+#define KEY_CTL_INVALID 0xFF
+
+
+typedef struct tagSKeyItem
+{
+ BOOL bKeyValid;
+ ULONG uKeyLength;
+ BYTE abyKey[MAX_KEY_LEN];
+ QWORD KeyRSC;
+ DWORD dwTSC47_16;
+ WORD wTSC15_0;
+ BYTE byCipherSuite;
+ BYTE byReserved0;
+ DWORD dwKeyIndex;
+ PVOID pvKeyTable;
+} SKeyItem, DEF* PSKeyItem; //64
+
+typedef struct tagSKeyTable
+{
+ BYTE abyBSSID[U_ETHER_ADDR_LEN]; //6
+ BYTE byReserved0[2]; //8
+ SKeyItem PairwiseKey;
+ SKeyItem GroupKey[MAX_GROUP_KEY]; //64*5 = 320, 320+8=328
+ DWORD dwGTKeyIndex; // GroupTransmitKey Index
+ BOOL bInUse;
+ WORD wKeyCtl;
+ BOOL bSoftWEP;
+ BYTE byReserved1[6];
+} SKeyTable, DEF* PSKeyTable; //352
+
+typedef struct tagSKeyManagement
+{
+ SKeyTable KeyTable[MAX_KEY_TABLE];
+} SKeyManagement, DEF* PSKeyManagement;
+
+/*--------------------- Export Types ------------------------------*/
+
+/*--------------------- Export Macros ------------------------------*/
+
+/*--------------------- Export Classes ----------------------------*/
+
+/*--------------------- Export Variables --------------------------*/
+
+/*--------------------- Export Functions --------------------------*/
+#ifdef __cplusplus
+extern "C" { /* Assume C declarations for C++ */
+#endif /* __cplusplus */
+
+VOID KeyvInitTable(PVOID pDeviceHandler, PSKeyManagement pTable);
+
+BOOL KeybGetKey(
+ IN PSKeyManagement pTable,
+ IN PBYTE pbyBSSID,
+ IN DWORD dwKeyIndex,
+ OUT PSKeyItem *pKey
+ );
+
+BOOL KeybSetKey(
+ PVOID pDeviceHandler,
+ PSKeyManagement pTable,
+ PBYTE pbyBSSID,
+ DWORD dwKeyIndex,
+ ULONG uKeyLength,
+ PQWORD pKeyRSC,
+ PBYTE pbyKey,
+ BYTE byKeyDecMode
+ );
+
+BOOL KeybRemoveKey(
+ PVOID pDeviceHandler,
+ PSKeyManagement pTable,
+ PBYTE pbyBSSID,
+ DWORD dwKeyIndex
+ );
+
+BOOL KeybRemoveAllKey (
+ PVOID pDeviceHandler,
+ PSKeyManagement pTable,
+ PBYTE pbyBSSID
+ );
+
+VOID KeyvRemoveWEPKey(
+ PVOID pDeviceHandler,
+ PSKeyManagement pTable,
+ DWORD dwKeyIndex
+ );
+
+VOID KeyvRemoveAllWEPKey(
+ PVOID pDeviceHandler,
+ PSKeyManagement pTable
+ );
+
+BOOL KeybGetTransmitKey(
+ IN PSKeyManagement pTable,
+ IN PBYTE pbyBSSID,
+ IN DWORD dwKeyType,
+ OUT PSKeyItem *pKey
+ );
+
+BOOL KeybCheckPairewiseKey(
+ IN PSKeyManagement pTable,
+ OUT PSKeyItem *pKey
+ );
+
+BOOL KeybSetDefaultKey (
+ PVOID pDeviceHandler,
+ PSKeyManagement pTable,
+ DWORD dwKeyIndex,
+ ULONG uKeyLength,
+ PQWORD pKeyRSC,
+ PBYTE pbyKey,
+ BYTE byKeyDecMode
+ );
+
+BOOL KeybSetAllGroupKey (
+ PVOID pDeviceHandler,
+ PSKeyManagement pTable,
+ DWORD dwKeyIndex,
+ ULONG uKeyLength,
+ PQWORD pKeyRSC,
+ PBYTE pbyKey,
+ BYTE byKeyDecMode
+ );
+
+
+#ifdef __cplusplus
+} /* End of extern "C" { */
+
+#endif /* __cplusplus */
+
+
+#endif // __KEY_H__
+