PageRenderTime 47ms CodeModel.GetById 21ms RepoModel.GetById 0ms app.codeStats 0ms

/drivers/net/wireless/tiwlan1251/pform/linux/inc/windows_types.h

http://github.com/CyanogenMod/cm-kernel
C Header | 194 lines | 130 code | 27 blank | 37 comment | 0 complexity | 6c0ded0f32ebba1a57fed0cb6ed05d8a MD5 | raw file
Possible License(s): AGPL-1.0, GPL-2.0, LGPL-2.0
  1. /****************************************************************************
  2. **+-----------------------------------------------------------------------+**
  3. **| |**
  4. **| Copyright(c) 1998 - 2008 Texas Instruments. All rights reserved. |**
  5. **| All rights reserved. |**
  6. **| |**
  7. **| Redistribution and use in source and binary forms, with or without |**
  8. **| modification, are permitted provided that the following conditions |**
  9. **| are met: |**
  10. **| |**
  11. **| * Redistributions of source code must retain the above copyright |**
  12. **| notice, this list of conditions and the following disclaimer. |**
  13. **| * Redistributions in binary form must reproduce the above copyright |**
  14. **| notice, this list of conditions and the following disclaimer in |**
  15. **| the documentation and/or other materials provided with the |**
  16. **| distribution. |**
  17. **| * Neither the name Texas Instruments nor the names of its |**
  18. **| contributors may be used to endorse or promote products derived |**
  19. **| from this software without specific prior written permission. |**
  20. **| |**
  21. **| THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS |**
  22. **| "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT |**
  23. **| LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR |**
  24. **| A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT |**
  25. **| OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, |**
  26. **| SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT |**
  27. **| LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, |**
  28. **| DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY |**
  29. **| THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |**
  30. **| (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |**
  31. **| OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |**
  32. **| |**
  33. **+-----------------------------------------------------------------------+**
  34. ****************************************************************************/
  35. #ifndef _WINDOWS_TYPES_H
  36. #define _WINDOWS_TYPES_H
  37. #include "osTIType.h"
  38. #include "ioctl_init.h"
  39. /*typedef tiBOOL BOOLEAN, *PBOOLEAN;*/
  40. typedef UINT16 USHORT, *PUSHORT;
  41. typedef char CHAR;
  42. typedef const char * LPCSTR;
  43. #define IN
  44. #define OUT
  45. #define NDIS_MAX_STRING_LEN 361
  46. typedef struct _STRING {
  47. USHORT Length;
  48. USHORT MaximumLength;
  49. PCHAR Buffer;
  50. } ANSI_STRING, *PANSI_STRING, UNICODE_STRING, *PUNICODE_STRING;
  51. typedef ANSI_STRING NDIS_STRING, *PNDIS_STRING;
  52. typedef void * NDIS_HANDLE;
  53. typedef int NDIS_STATUS, *PNDIS_STATUS;
  54. typedef ULONG NDIS_OID, *PNDIS_OID;
  55. #define PCI_TYPE0_ADDRESSES 6
  56. #define PCI_TYPE1_ADDRESSES 2
  57. typedef LARGE_INTEGER NDIS_PHYSICAL_ADDRESS;
  58. typedef PVOID *PDEVICE_OBJECT, *PDRIVER_OBJECT;
  59. typedef UINT32 NDIS_MINIPORT_INTERRUPT, NDIS_MINIPORT_TIMER, NDIS_SPIN_LOCK;
  60. typedef UINT32 PNDIS_PACKET, *PPNDIS_PACKET;
  61. typedef enum _NDIS_PARAMETER_TYPE {
  62. NdisParameterInteger,
  63. NdisParameterHexInteger,
  64. NdisParameterString,
  65. NdisParameterMultiString,
  66. NdisParameterBinary
  67. } NDIS_PARAMETER_TYPE, *PNDIS_PARAMETER_TYPE;
  68. typedef struct {
  69. USHORT Length;
  70. PVOID Buffer;
  71. } BINARY_DATA;
  72. typedef struct _NDIS_CONFIGURATION_PARAMETER {
  73. NDIS_PARAMETER_TYPE ParameterType;
  74. union {
  75. ULONG IntegerData;
  76. NDIS_STRING StringData;
  77. BINARY_DATA BinaryData;
  78. } ParameterData;
  79. char StringBuffer[NDIS_MAX_STRING_LEN];
  80. } NDIS_CONFIGURATION_PARAMETER, *PNDIS_CONFIGURATION_PARAMETER;
  81. typedef tiUINT32 NTSTATUS;
  82. #ifndef NDIS_STATUS_SUCCESS
  83. # define NDIS_STATUS_SUCCESS ((NDIS_STATUS)0x00000000L)
  84. # define NDIS_STATUS_PENDING ((NDIS_STATUS)0x00000103L)
  85. # define NDIS_STATUS_RESET_END ((NDIS_STATUS)0x40010005L)
  86. # define NDIS_STATUS_MEDIA_SPECIFIC_INDICATION ((NDIS_STATUS)0x40010012L)
  87. # define NDIS_STATUS_FAILURE ((NDIS_STATUS)0xC0000001L)
  88. # define NDIS_STATUS_ADAPTER_NOT_FOUND ((NDIS_STATUS)0xC0010006L)
  89. # define NDIS_STATUS_INVALID_LENGTH ((NDIS_STATUS)0xC0010014L)
  90. # define NDIS_STATUS_BUFFER_TOO_SHORT ((NDIS_STATUS)0xC0010016L)
  91. # define NDIS_STATUS_INVALID_OID ((NDIS_STATUS)0xC0010017L)
  92. #endif /* NDIS_STATUS_SUCCESS */
  93. #define STATUS_SUCCESS 0
  94. #define STATUS_INVALID_PARAMETER -1
  95. #define NdisZeroMemory(p, size) os_memoryZero( NULL, p, size )
  96. #define NdisMoveMemory(d, s, size) os_memoryCopy( NULL, d, s, size )
  97. NDIS_STATUS NdisUnicodeStringToAnsiString( IN OUT PANSI_STRING DestinationString,
  98. IN PUNICODE_STRING SourceString );
  99. VOID NdisReadConfiguration( OUT PNDIS_STATUS Status, OUT PNDIS_CONFIGURATION_PARAMETER *ParameterValue,
  100. IN NDIS_HANDLE ConfigurationHandle, IN PNDIS_STRING Keyword, IN NDIS_PARAMETER_TYPE ParameterType );
  101. VOID NdisWriteConfiguration( OUT PNDIS_STATUS Status, IN NDIS_HANDLE ConfigurationHandle,
  102. IN PNDIS_STRING Keyword, IN PNDIS_CONFIGURATION_PARAMETER ParameterValue );
  103. VOID NdisReadNetworkAddress( OUT PNDIS_STATUS Status, OUT PVOID *NetworkAddress, OUT PUINT NetworkAddressLength,
  104. IN NDIS_HANDLE ConfigurationHandle );
  105. typedef struct _NDIS_PACKET_POOL {
  106. NDIS_SPIN_LOCK SpinLock;
  107. struct _NDIS_PACKET *FreeList;
  108. UINT PacketLength;
  109. UCHAR Buffer[1];
  110. } NDIS_PACKET_POOL, * PNDIS_PACKET_POOL;
  111. typedef enum _NDIS_802_11_STATUS_TYPE
  112. {
  113. Ndis802_11StatusType_Authentication,
  114. Ndis802_11StatusTypeMax /* not a real type, defined as an upper bound*/
  115. } NDIS_802_11_STATUS_TYPE, *PNDIS_802_11_STATUS_TYPE;
  116. typedef UCHAR NDIS_802_11_MAC_ADDRESS[6];
  117. typedef struct _NDIS_802_11_STATUS_INDICATION
  118. {
  119. NDIS_802_11_STATUS_TYPE StatusType;
  120. } NDIS_802_11_STATUS_INDICATION, *PNDIS_802_11_STATUS_INDICATION;
  121. typedef struct _NDIS_802_11_AUTHENTICATION_REQUEST
  122. {
  123. ULONG Length; /* Length of structure*/
  124. NDIS_802_11_MAC_ADDRESS Bssid;
  125. ULONG Flags;
  126. } NDIS_802_11_AUTHENTICATION_REQUEST, *PNDIS_802_11_AUTHENTICATION_REQUEST;
  127. typedef tiINT32 NDIS_802_11_RSSI; /* in dBm*/
  128. typedef struct _NDIS_802_11_TEST
  129. {
  130. ULONG Length;
  131. ULONG Type;
  132. union {
  133. struct _AuthenticationEvent {
  134. NDIS_802_11_STATUS_INDICATION Status;
  135. NDIS_802_11_AUTHENTICATION_REQUEST Request[1];
  136. } AuthenticationEvent;
  137. NDIS_802_11_RSSI RssiTrigger;
  138. };
  139. } NDIS_802_11_TEST, *PNDIS_802_11_TEST;
  140. /* Added new encryption types*/
  141. /* Also aliased typedef to new name*/
  142. typedef enum _NDIS_802_11_WEP_STATUS
  143. {
  144. Ndis802_11WEPEnabled,
  145. Ndis802_11Encryption1Enabled = Ndis802_11WEPEnabled,
  146. Ndis802_11WEPDisabled,
  147. Ndis802_11EncryptionDisabled = Ndis802_11WEPDisabled,
  148. Ndis802_11WEPKeyAbsent,
  149. Ndis802_11Encryption1KeyAbsent = Ndis802_11WEPKeyAbsent,
  150. Ndis802_11WEPNotSupported,
  151. Ndis802_11EncryptionNotSupported = Ndis802_11WEPNotSupported,
  152. Ndis802_11Encryption2Enabled,
  153. Ndis802_11Encryption2KeyAbsent,
  154. Ndis802_11Encryption3Enabled,
  155. Ndis802_11Encryption3KeyAbsent
  156. } NDIS_802_11_WEP_STATUS, *PNDIS_802_11_WEP_STATUS,
  157. NDIS_802_11_ENCRYPTION_STATUS, *PNDIS_802_11_ENCRYPTION_STATUS;
  158. #ifdef TI_DBG
  159. #ifdef __KERNEL__
  160. #define DbgPrint printk
  161. #else
  162. #define DbgPrint printf
  163. #endif
  164. #else
  165. #define DbgPrint
  166. #endif
  167. #endif /* _WINDOWS_TYPES_H */