11 typedef U32 NDIS_STATUS
;
21 typedef unsigned long long ULONGLONG
;
23 #define NDIS_MAJOR_VERSION 0x5
24 #define NDIS_MINOR_VERSION 0x1
25 #define ZD1205_DRIVER_VERSION ((NDIS_MAJOR_VERSION * 0x100) + (NDIS_MINOR_VERSION))
27 #define OID_GEN_MEDIA_CONNECT_STATUS 0x00010114
28 #define OID_GEN_DRIVER_VERSION 0x00010116
29 #define OID_802_3_CURRENT_ADDRESS 0x01010102
30 #define OID_802_11_DESIRED_RATES 0x0D010210
31 #define OID_802_11_CONFIGURATION 0x0D010211
32 #define OID_ZDX_802_11_CONFIGURATION 0xFF12FF11
33 #define OID_802_11_INFRASTRUCTURE_MODE 0x0D010108
34 #define OID_ZDX_802_11_INFRASTRUCTURE_MODE 0xFF12FF08
35 #define OID_ZDX_802_11_SSID 0xFF12FF02
36 #define OID_802_11_NETWORK_TYPE_IN_USE 0x0D010204
37 #define OID_ZD_RD 0xFF129902
38 #define OID_ZD_CUSTOM 0xFF129901
39 #define OID_ZD_IO32 0xFF0201AC
40 #define OID_ZD_GET_TALLIES 0xFF02018D
41 #define OID_ZD_SET_TALLIES 0xFF02018D
42 #define OID_ZD_GETRID 0xFF010181
43 #define OID_ZD_SETRID 0xFF010181
49 #define STATUS_SUCCESS (0x00000000L)
50 #define STATUS_PENDING (0x00000103L)
51 #define STATUS_INSUFFICIENT_RESOURCES (0xC000009AL)
52 #define STATUS_NOT_SUPPORTED (0xC00000BBL)
54 #define NDIS_STATUS_SUCCESS ((NDIS_STATUS)STATUS_SUCCESS)
55 #define NDIS_STATUS_PENDING ((NDIS_STATUS)STATUS_PENDING)
56 #define NDIS_STATUS_NOT_RECOGNIZED ((NDIS_STATUS)0x00010001L)
57 #define NDIS_STATUS_NOT_COPIED ((NDIS_STATUS)0x00010002L)
58 #define NDIS_STATUS_NOT_ACCEPTED ((NDIS_STATUS)0x00010003L)
59 #define NDIS_STATUS_CALL_ACTIVE ((NDIS_STATUS)0x00010007L)
61 #define NDIS_STATUS_ONLINE ((NDIS_STATUS)0x40010003L)
62 #define NDIS_STATUS_RESET_START ((NDIS_STATUS)0x40010004L)
63 #define NDIS_STATUS_RESET_END ((NDIS_STATUS)0x40010005L)
64 #define NDIS_STATUS_RING_STATUS ((NDIS_STATUS)0x40010006L)
65 #define NDIS_STATUS_CLOSED ((NDIS_STATUS)0x40010007L)
66 #define NDIS_STATUS_WAN_LINE_UP ((NDIS_STATUS)0x40010008L)
67 #define NDIS_STATUS_WAN_LINE_DOWN ((NDIS_STATUS)0x40010009L)
68 #define NDIS_STATUS_WAN_FRAGMENT ((NDIS_STATUS)0x4001000AL)
69 #define NDIS_STATUS_MEDIA_CONNECT ((NDIS_STATUS)0x4001000BL)
70 #define NDIS_STATUS_MEDIA_DISCONNECT ((NDIS_STATUS)0x4001000CL)
71 #define NDIS_STATUS_HARDWARE_LINE_UP ((NDIS_STATUS)0x4001000DL)
72 #define NDIS_STATUS_HARDWARE_LINE_DOWN ((NDIS_STATUS)0x4001000EL)
73 #define NDIS_STATUS_INTERFACE_UP ((NDIS_STATUS)0x4001000FL)
74 #define NDIS_STATUS_INTERFACE_DOWN ((NDIS_STATUS)0x40010010L)
75 #define NDIS_STATUS_MEDIA_BUSY ((NDIS_STATUS)0x40010011L)
76 #define NDIS_STATUS_MEDIA_SPECIFIC_INDICATION ((NDIS_STATUS)0x40010012L)
77 #define NDIS_STATUS_WW_INDICATION NDIS_STATUS_MEDIA_SPECIFIC_INDICATION
78 #define NDIS_STATUS_LINK_SPEED_CHANGE ((NDIS_STATUS)0x40010013L)
79 #define NDIS_STATUS_WAN_GET_STATS ((NDIS_STATUS)0x40010014L)
80 #define NDIS_STATUS_WAN_CO_FRAGMENT ((NDIS_STATUS)0x40010015L)
81 #define NDIS_STATUS_WAN_CO_LINKPARAMS ((NDIS_STATUS)0x40010016L)
83 #define NDIS_STATUS_NOT_RESETTABLE ((NDIS_STATUS)0x80010001L)
84 #define NDIS_STATUS_SOFT_ERRORS ((NDIS_STATUS)0x80010003L)
85 #define NDIS_STATUS_HARD_ERRORS ((NDIS_STATUS)0x80010004L)
86 #define NDIS_STATUS_BUFFER_OVERFLOW ((NDIS_STATUS)STATUS_BUFFER_OVERFLOW)
88 #define NDIS_STATUS_FAILURE ((NDIS_STATUS) STATUS_UNSUCCESSFUL)
89 #define NDIS_STATUS_RESOURCES ((NDIS_STATUS)STATUS_INSUFFICIENT_RESOURCES)
90 #define NDIS_STATUS_CLOSING ((NDIS_STATUS)0xC0010002L)
91 #define NDIS_STATUS_BAD_VERSION ((NDIS_STATUS)0xC0010004L)
92 #define NDIS_STATUS_BAD_CHARACTERISTICS ((NDIS_STATUS)0xC0010005L)
93 #define NDIS_STATUS_ADAPTER_NOT_FOUND ((NDIS_STATUS)0xC0010006L)
94 #define NDIS_STATUS_OPEN_FAILED ((NDIS_STATUS)0xC0010007L)
95 #define NDIS_STATUS_DEVICE_FAILED ((NDIS_STATUS)0xC0010008L)
96 #define NDIS_STATUS_MULTICAST_FULL ((NDIS_STATUS)0xC0010009L)
97 #define NDIS_STATUS_MULTICAST_EXISTS ((NDIS_STATUS)0xC001000AL)
98 #define NDIS_STATUS_MULTICAST_NOT_FOUND ((NDIS_STATUS)0xC001000BL)
99 #define NDIS_STATUS_REQUEST_ABORTED ((NDIS_STATUS)0xC001000CL)
100 #define NDIS_STATUS_RESET_IN_PROGRESS ((NDIS_STATUS)0xC001000DL)
101 #define NDIS_STATUS_CLOSING_INDICATING ((NDIS_STATUS)0xC001000EL)
102 #define NDIS_STATUS_NOT_SUPPORTED ((NDIS_STATUS)STATUS_NOT_SUPPORTED)
103 #define NDIS_STATUS_INVALID_PACKET ((NDIS_STATUS)0xC001000FL)
104 #define NDIS_STATUS_OPEN_LIST_FULL ((NDIS_STATUS)0xC0010010L)
105 #define NDIS_STATUS_ADAPTER_NOT_READY ((NDIS_STATUS)0xC0010011L)
106 #define NDIS_STATUS_ADAPTER_NOT_OPEN ((NDIS_STATUS)0xC0010012L)
107 #define NDIS_STATUS_NOT_INDICATING ((NDIS_STATUS)0xC0010013L)
108 #define NDIS_STATUS_INVALID_LENGTH ((NDIS_STATUS)0xC0010014L)
109 #define NDIS_STATUS_INVALID_DATA ((NDIS_STATUS)0xC0010015L)
110 #define NDIS_STATUS_BUFFER_TOO_SHORT ((NDIS_STATUS)0xC0010016L)
111 #define NDIS_STATUS_INVALID_OID ((NDIS_STATUS)0xC0010017L)
112 #define NDIS_STATUS_ADAPTER_REMOVED ((NDIS_STATUS)0xC0010018L)
113 #define NDIS_STATUS_UNSUPPORTED_MEDIA ((NDIS_STATUS)0xC0010019L)
114 #define NDIS_STATUS_GROUP_ADDRESS_IN_USE ((NDIS_STATUS)0xC001001AL)
115 #define NDIS_STATUS_FILE_NOT_FOUND ((NDIS_STATUS)0xC001001BL)
116 #define NDIS_STATUS_ERROR_READING_FILE ((NDIS_STATUS)0xC001001CL)
117 #define NDIS_STATUS_ALREADY_MAPPED ((NDIS_STATUS)0xC001001DL)
118 #define NDIS_STATUS_RESOURCE_CONFLICT ((NDIS_STATUS)0xC001001EL)
119 #define NDIS_STATUS_NO_CABLE ((NDIS_STATUS)0xC001001FL)
121 #define NDIS_STATUS_INVALID_SAP ((NDIS_STATUS)0xC0010020L)
122 #define NDIS_STATUS_SAP_IN_USE ((NDIS_STATUS)0xC0010021L)
123 #define NDIS_STATUS_INVALID_ADDRESS ((NDIS_STATUS)0xC0010022L)
124 #define NDIS_STATUS_VC_NOT_ACTIVATED ((NDIS_STATUS)0xC0010023L)
126 #define NDIS_STATUS_DEST_OUT_OF_ORDER ((NDIS_STATUS)0xC0010024L)
128 #define NDIS_STATUS_VC_NOT_AVAILABLE ((NDIS_STATUS)0xC0010025L)
130 #define NDIS_STATUS_CELLRATE_NOT_AVAILABLE ((NDIS_STATUS)0xC0010026L)
132 #define NDIS_STATUS_INCOMPATABLE_QOS ((NDIS_STATUS)0xC0010027L)
134 #define NDIS_STATUS_AAL_PARAMS_UNSUPPORTED ((NDIS_STATUS)0xC0010028L)
136 #define NDIS_STATUS_NO_ROUTE_TO_DESTINATION ((NDIS_STATUS)0xC0010029L)
138 #define NDIS_STATUS_TOKEN_RING_OPEN_ERROR ((NDIS_STATUS)0xC0011000L)
139 #define NDIS_STATUS_INVALID_DEVICE_REQUEST ((NDIS_STATUS)STATUS_INVALID_DEVICE_REQUEST)
140 #define NDIS_STATUS_NETWORK_UNREACHABLE ((NDIS_STATUS)STATUS_NETWORK_UNREACHABLE)
142 #define NDIS_802_11_LENGTH_SSID 32
145 //#define ZD_GENERIC_OID_HDR_LEN 16
147 // NDIS 802_11 structure
149 typedef struct _NDIS_802_11_CONFIGURATION_FH
151 ULONG Length
; // Length of structure
152 ULONG HopPattern
; // As defined by 802.11, MSB set
153 ULONG HopSet
; // to one if non-802.11
154 ULONG DwellTime
; // units are Kusec
155 } NDIS_802_11_CONFIGURATION_FH
, *PNDIS_802_11_CONFIGURATION_FH
;
157 typedef struct _NDIS_802_11_CONFIGURATION
159 ULONG Length
; // Length of structure
160 ULONG BeaconPeriod
; // units are Kusec
161 ULONG ATIMWindow
; // units are Kusec
162 ULONG DSConfig
; // Frequency, units are kHz
163 NDIS_802_11_CONFIGURATION_FH FHConfig
;
164 } NDIS_802_11_CONFIGURATION
, *PNDIS_802_11_CONFIGURATION
;
166 typedef struct _NDIS_802_11_SSID
168 ULONG SsidLength
; // length of SSID field below, in bytes;
171 UCHAR Ssid
[NDIS_802_11_LENGTH_SSID
];
172 } NDIS_802_11_SSID
, *PNDIS_802_11_SSID
;
174 typedef struct _ZD_RD_STRUCT
179 } ZD_RD_STRUCT
, *PZD_RD_STRUCT
;
181 typedef struct _ZD_CUSTOM_STRUCT
183 ULONG ZDCustomLength
;
186 } ZD_CUSTOM_STRUCT
, *PZD_CUSTOM_STRUCT
;
188 typedef struct _RID_STRUCT
195 typedef RID_STRUCT
* PRID_STRUCT
;
197 typedef struct _LOCAL_TALLY_STRUCT
199 ULONG txUnicastFrames_L
;
200 ULONG txUnicastFrames_H
;
201 ULONG txMulticastFrames_L
;
202 ULONG txMulticastFrames_H
;
207 ULONG txMultiOctets_L
;
208 ULONG txMultiOctets_H
;
213 ULONG txMultipleRetriesFrames_L
;
214 ULONG txMultipleRetriesFrames_H
;
215 ULONG txRetryLimitExceeded_L
;
216 ULONG txRetryLimitExceeded_H
;
220 ULONG rxUnicastFrames_L
;
221 ULONG rxUnicastFrames_H
;
222 ULONG rxMulticastFrames_L
;
223 ULONG rxMulticastFrames_H
;
224 ULONG rxPLCPCRCErrCnt_L
;
225 ULONG rxPLCPCRCErrCnt_H
;
228 ULONG rxMultiOctets_L
;
229 ULONG rxMultiOctets_H
;
230 ULONG rxCRC32ErrCnt_L
;
231 ULONG rxCRC32ErrCnt_H
;
232 ULONG rxDiscardedCnt_L
;
233 ULONG rxDiscardedCnt_H
;
236 ULONG rxDecrypFailCnt_L
;
237 ULONG rxDecrypFailCnt_H
;
242 } LOCAL_TALLY_STRUCT
;
243 typedef LOCAL_TALLY_STRUCT
* PLOCAL_TALLY_STRUCT
;
244 // Defines the state of the LAN media
246 typedef enum _NDIS_MEDIA_STATE
248 NdisMediaStateConnected
,
249 NdisMediaStateDisconnected
250 } NDIS_MEDIA_STATE
, *PNDIS_MEDIA_STATE
;
252 typedef enum _NDIS_802_11_NETWORK_INFRASTRUCTURE
255 Ndis802_11Infrastructure
,
256 Ndis802_11AutoUnknown
,
257 Ndis802_11InfrastructureMax
// Not a real value, defined as upper bound
258 } NDIS_802_11_NETWORK_INFRASTRUCTURE
, *PNDIS_802_11_NETWORK_INFRASTRUCTURE
;
260 typedef enum _NDIS_802_11_NETWORK_TYPE
267 Ndis802_11NetworkTypeMax
268 } NDIS_802_11_NETWORK_TYPE
, *PNDIS_802_11_NETWORK_TYPE
;
269 typedef enum _ZD_802_11_PREAMBLE_MODE
274 } ZD_802_11_PREAMBLE_MODE
, *PZD_802_11_PREAMBLE_MODE
;
276 typedef enum _ZD_CUSTOM_FUNC_ID
278 ZDAdapterOperationMode
= 0x00,
280 ZDCommQuality
= 0x11,
281 ZDPreambleMode
= 0x30,
282 ZDDesiredSSID
= 0x31,
283 ZDAdapterRegion
= 0x32,
284 ZDAdapterSupportChannel
= 0x33,
286 ZDMultiDomainCapability
= 0x35,
287 ZDGetAccessPointStationList
= 0x50,
288 ZDAccessPointFilterMode
= 0x51,
289 ZDAccessPointFilterList
= 0x52,
290 ZDAccessPointHideSSID
= 0x53,
291 ZDAccessPointTxPower
= 0x54,
292 ZDAccessPointBasicRate
= 0x55,
293 ZDDelOneStationFromAPStationList
= 0x60,
294 ZDFirmwareVersion
= 0x70,
298 ZDTxPowerLevel
= 0x74,
300 ZDUseGinUsb1_1
= 0x76,
301 ZDApWirelessMode
= 0x77,
302 ZDApProtectionMode
= 0x78,
303 } ZD_CUSTOM_FUNC_ID
, *PZD_CUSTOM_FUNC_ID
;
305 // Function ID define for OID_ZD_RD
306 #define ZDAccessPHYRegister4B 0
307 #define ZDAccessPHYRegister2B 1
308 #define ZDAccessPHYRegister1B 2
309 #define ZDAccessMACRegister4B 3
310 #define ZDAccessMACRegister2B 4
311 #define ZDAccessMACRegister1B 5
312 #define ZDAccessROMData 6
313 #define ZDROMUpdate 7
314 #define ZDContinuousTx 8
315 #define ZDGetNICAdapterTally 9
316 #define ZDSetMACAddress 10
317 #define ZDBootCodeUpdate 11
318 #define ZDFlashErase 12
319 #define ZDFlashProgram 13
320 #define ZDFlashRead 14
321 #define ZDEEPROMDataWrite 15
322 #define ZDTxPowerGainControl 16
323 #define ZDFlashIDQuery 17
324 #define ZDFlashGetChkSum 18
325 #define ZDFlashGetSubChkSum 19
327 // Function ID define for OID_ZD_GETRID
328 #define RID_MONITOR 0xFFFE
329 /* Definition of commands */
330 #define CMD_QUERY_DEVICE_STATUS 0x10
331 #define CMD_DEVICE_STATUS_RESPONSE 0x11
332 #define CMD_QUERY_INFORMATION 0x20
333 #define CMD_QUERY_INFORMATION_RESPONSE 0x21
334 #define CMD_SET_INFORMATION 0x30
335 #define CMD_SET_INFORMATINO_RESPONSE 0x31
337 /* Definition for some special usage */
338 #define EEPROM_SIZE 0x1000
340 /* Definition for Continuous Tx request */
341 #define ContTx_Start 0
342 #define ContTx_Stop 1
344 /* Definition flags for Continuous Tx mode */
345 #define ContTx_Normal 0
347 #define ContTx_CarrierSuppression 2
349 #define LONG_PREAMBLE 0
350 #define SHORT_PREAMBLE 1
353 #define INDEPENDENT_BSS 0x0
354 #define INFRASTRUCTURE_BSS 0x1
355 #define PSEUDO_IBSS 0x3
359 #define AP_RX_FILTER 0x0400feff
360 #define STA_RX_FILTER 0x0000ffff
363 /* Macro definition */
365 #define ZDPRODUCTDBG(args...) do { printk(KERN_DEBUG args); } while (0)
367 #define ZDPRODUCTDBG(args...) do { } while (0)
370 // EEPROM Memmory Map Region
371 #define E2P_SUBID 0x0900
372 #define E2P_POD 0x0904
373 #define E2P_MACADDR_P1 0x0908
374 #define E2P_MACADDR_P2 0x090C
375 #define E2P_PWR_CAL_VALUE 0x0910
376 #define E2P_PWR_INT_VALUE 0x0920
377 #define E2P_ALLOWED_CHANNEL 0x0930
378 //#define E2P_PHY_REG 0x0934
379 #define E2P_FEATURE_BITMAP 0x0964
380 //#define E2P_END 0x09FF
382 int zdproduction_ioctl(struct zd1205_private
*macp
, struct zd_point
*p
);
384 NDIS_STATUS
ZD1205EM_Custom_QueryInformation(
385 PVOID NDIS_HANDLE
, // IN
387 PVOID InformationBuffer
, // IN
388 ULONG InformationBufferLength
, // IN
389 PULONG BytesWritten
, // OUT
390 PULONG BytesNeeded
// OUT
393 NDIS_STATUS
ZD1205EM_Custom_SetInformation(
394 PVOID NDIS_HANDLE
, // IN
396 PVOID InformationBuffer
, // IN
397 ULONG InformationBufferLength
, // IN
398 PULONG BytesRead
, // OUT
399 PULONG BytesNeeded
// OUT