1
/***************************************************************************
2
* RT2x00 SourceForge Project - http://rt2x00.sourceforge.net *
4
* This program is free software; you can redistribute it and/or modify *
5
* it under the terms of the GNU General Public License as published by *
6
* the Free Software Foundation; either version 2 of the License, or *
7
* (at your option) any later version. *
9
* This program is distributed in the hope that it will be useful, *
10
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
11
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
12
* GNU General Public License for more details. *
14
* You should have received a copy of the GNU General Public License *
15
* along with this program; if not, write to the *
16
* Free Software Foundation, Inc., *
17
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
19
* Licensed under the GNU GPL *
20
* Original code supplied under license from RaLink Inc, 2004. *
21
***************************************************************************/
23
/***************************************************************************
24
* Module Name: rtmp_type.h
30
* -------- ---------- -------------------------------
31
* Name Date Modification logs
32
* Jan Lee 2005-06-01 Release
33
* MathiasK 04-07-2005 Endian fix
34
***************************************************************************/
36
#ifndef __RTMP_TYPE_H__
37
#define __RTMP_TYPE_H__
39
typedef unsigned short UINT16;
40
typedef unsigned long UINT32;
41
typedef unsigned long long UINT64;
43
// Endian byte swapping codes
46
(((UINT16)(x) & (UINT16) 0x00ffU) << 8) | \
47
(((UINT16)(x) & (UINT16) 0xff00U) >> 8) ))
51
(((UINT32)(x) & (UINT32) 0x000000ffUL) << 24) | \
52
(((UINT32)(x) & (UINT32) 0x0000ff00UL) << 8) | \
53
(((UINT32)(x) & (UINT32) 0x00ff0000UL) >> 8) | \
54
(((UINT32)(x) & (UINT32) 0xff000000UL) >> 24) ))
58
(UINT64)(((UINT64)(x) & (UINT64) 0x00000000000000ffULL) << 56) | \
59
(UINT64)(((UINT64)(x) & (UINT64) 0x000000000000ff00ULL) << 40) | \
60
(UINT64)(((UINT64)(x) & (UINT64) 0x0000000000ff0000ULL) << 24) | \
61
(UINT64)(((UINT64)(x) & (UINT64) 0x00000000ff000000ULL) << 8) | \
62
(UINT64)(((UINT64)(x) & (UINT64) 0x000000ff00000000ULL) >> 8) | \
63
(UINT64)(((UINT64)(x) & (UINT64) 0x0000ff0000000000ULL) >> 24) | \
64
(UINT64)(((UINT64)(x) & (UINT64) 0x00ff000000000000ULL) >> 40) | \
65
(UINT64)(((UINT64)(x) & (UINT64) 0xff00000000000000ULL) >> 56) ))
69
#define cpu2le64(x) SWAP64((x))
70
#define le2cpu64(x) SWAP64((x))
71
#define cpu2le32(x) SWAP32((x))
72
#define le2cpu32(x) SWAP32((x))
73
#define cpu2le16(x) SWAP16((x))
74
#define le2cpu16(x) SWAP16((x))
75
#define cpu2be64(x) ((UINT64)(x))
76
#define be2cpu64(x) ((UINT64)(x))
77
#define cpu2be32(x) ((UINT32)(x))
78
#define be2cpu32(x) ((UINT32)(x))
79
#define cpu2be16(x) ((UINT16)(x))
80
#define be2cpu16(x) ((UINT16)(x))
82
#else // Little_Endian
84
#define cpu2le64(x) ((UINT64)(x))
85
#define le2cpu64(x) ((UINT64)(x))
86
#define cpu2le32(x) ((UINT32)(x))
87
#define le2cpu32(x) ((UINT32)(x))
88
#define cpu2le16(x) ((UINT16)(x))
89
#define le2cpu16(x) ((UINT16)(x))
90
#define cpu2be64(x) SWAP64((x))
91
#define be2cpu64(x) SWAP64((x))
92
#define cpu2be32(x) SWAP32((x))
93
#define be2cpu32(x) SWAP32((x))
94
#define cpu2be16(x) SWAP16((x))
95
#define be2cpu16(x) SWAP16((x))
99
// Ralink timer control block
100
typedef struct _RALINK_TIMER_STRUCT {
101
struct timer_list Timer;
102
ULONG TimerValue; // Timer value in milliseconds
103
BOOLEAN State; // True if timer cancelled
104
} RALINK_TIMER_STRUCT, *PRALINK_TIMER_STRUCT;
106
typedef struct _RSN_IE_HEADER_STRUCT {
109
USHORT Version; // Little endian format
110
} RSN_IE_HEADER_STRUCT, *PRSN_IE_HEADER_STRUCT;
112
// Cipher suite selector types
113
typedef struct _CIPHER_SUITE_STRUCT {
116
} CIPHER_SUITE_STRUCT, *PCIPHER_SUITE_STRUCT;
118
// Authentication and Key Management suite selector
119
typedef struct _AKM_SUITE_STRUCT {
122
} AKM_SUITE_STRUCT, *PAKM_SUITE_STRUCT;
125
typedef struct _RSN_CAPABILITY {
127
USHORT GTKSAReplayCnt:2;
128
USHORT PTKSAReplayCnt:2;
131
} RSN_CAPABILITY, *PRSN_CAPABILITY;
133
#endif // __RTMP_TYPE_H__