1 //============================================================================
5 // Define the IOCTL codes.
8 // --------------------------------------------------------------------------
10 // Copyright (c) 2002-2004 Winbond Electronics Corp. All rights reserved.
11 //=============================================================================
16 // PD43 Keep it - Used with the Win33 application
17 // #include <winioctl.h>
19 //========================================================
20 // 20040108 ADD the follow for test
21 //========================================================
22 #define INFORMATION_LENGTH sizeof(unsigned int)
24 #define WB32_IOCTL_INDEX 0x0900 //קďĽHŤKŹŰŽe//
26 #define Wb32_RegisterRead CTL_CODE( \
27 FILE_DEVICE_UNKNOWN, \
28 WB32_IOCTL_INDEX + 0, \
32 #define Wb32_RegisterWrite CTL_CODE( \
33 FILE_DEVICE_UNKNOWN, \
34 WB32_IOCTL_INDEX + 1, \
38 #define Wb32_SendPacket CTL_CODE( \
39 FILE_DEVICE_UNKNOWN, \
40 WB32_IOCTL_INDEX + 2, \
44 #define Wb32_QuerySendResult CTL_CODE( \
45 FILE_DEVICE_UNKNOWN, \
46 WB32_IOCTL_INDEX + 3, \
50 #define Wb32_SetFragmentThreshold CTL_CODE( \
51 FILE_DEVICE_UNKNOWN, \
52 WB32_IOCTL_INDEX + 4, \
56 #define Wb32_SetLinkStatus CTL_CODE( \
57 FILE_DEVICE_UNKNOWN, \
58 WB32_IOCTL_INDEX + 5, \
62 #define Wb32_SetBulkIn CTL_CODE( \
63 FILE_DEVICE_UNKNOWN, \
64 WB32_IOCTL_INDEX + 6, \
68 #define Wb32_LoopbackTest CTL_CODE( \
69 FILE_DEVICE_UNKNOWN, \
70 WB32_IOCTL_INDEX + 7, \
74 #define Wb35_EEPromRead CTL_CODE( \
75 FILE_DEVICE_UNKNOWN, \
76 WB32_IOCTL_INDEX + 8, \
80 #define Wb35_EEPromWrite CTL_CODE( \
81 FILE_DEVICE_UNKNOWN, \
82 WB32_IOCTL_INDEX + 9, \
86 #define Wb35_FlashReadData CTL_CODE( \
87 FILE_DEVICE_UNKNOWN, \
88 WB32_IOCTL_INDEX + 10, \
92 #define Wb35_FlashWrite CTL_CODE( \
93 FILE_DEVICE_UNKNOWN, \
94 WB32_IOCTL_INDEX + 11, \
98 #define Wb35_FlashWriteBurst CTL_CODE( \
99 FILE_DEVICE_UNKNOWN, \
100 WB32_IOCTL_INDEX + 12, \
104 #define Wb35_TxBurstStart CTL_CODE( \
105 FILE_DEVICE_UNKNOWN, \
106 WB32_IOCTL_INDEX + 13, \
110 #define Wb35_TxBurstStop CTL_CODE( \
111 FILE_DEVICE_UNKNOWN, \
112 WB32_IOCTL_INDEX + 14, \
116 #define Wb35_TxBurstStatus CTL_CODE( \
117 FILE_DEVICE_UNKNOWN, \
118 WB32_IOCTL_INDEX + 15, \
122 // For IOCTL interface
123 //================================================
124 #define LINKNAME_STRING "\\DosDevices\\W35UND"
125 #define NTDEVICE_STRING "\\Device\\W35UND"
126 #define APPLICATION_LINK "\\\\.\\W35UND"
128 #define WB_IOCTL_INDEX 0x0800
129 #define WB_IOCTL_TS_INDEX WB_IOCTL_INDEX + 60
130 #define WB_IOCTL_DUT_INDEX WB_IOCTL_TS_INDEX + 40
132 //=============================================================================
133 // IOCTLS defined for DUT (Device Under Test)
135 // IOCTL_WB_802_11_DUT_MAC_ADDRESS
136 // Query: Return the dot11StationID
137 // Set : Set the dot11StationID. Demo only.
139 #define IOCTL_WB_802_11_DUT_MAC_ADDRESS CTL_CODE( \
140 FILE_DEVICE_UNKNOWN, \
141 WB_IOCTL_DUT_INDEX + 1, \
145 // IOCTL_WB_802_11_DUT_BSS_DESCRIPTION
146 // Query: Return the info. of the current connected BSS.
149 #define IOCTL_WB_802_11_DUT_BSS_DESCRIPTION CTL_CODE( \
150 FILE_DEVICE_UNKNOWN, \
151 WB_IOCTL_DUT_INDEX + 2, \
155 // IOCTL_WB_802_11_DUT_TX_RATE
156 // Query: Return the current transmission rate.
157 // Set : Set the transmission rate of the Tx packets.
159 #define IOCTL_WB_802_11_DUT_TX_RATE CTL_CODE( \
160 FILE_DEVICE_UNKNOWN, \
161 WB_IOCTL_DUT_INDEX + 3, \
165 // IOCTL_WB_802_11_DUT_CURRENT_STA_STATE
166 // Query: Return the current STA state. (WB_STASTATE type)
169 #define IOCTL_WB_802_11_DUT_CURRENT_STA_STATE CTL_CODE( \
170 FILE_DEVICE_UNKNOWN, \
171 WB_IOCTL_DUT_INDEX + 4, \
175 /////////// 10/31/02' Added /////////////////////
177 // IOCTL_WB_802_11_DUT_START_IBSS_REQUEST
179 // Set : Start a new IBSS
181 #define IOCTL_WB_802_11_DUT_START_IBSS_REQUEST CTL_CODE( \
182 FILE_DEVICE_UNKNOWN, \
183 WB_IOCTL_DUT_INDEX + 5, \
187 // IOCTL_WB_802_11_DUT_JOIN_REQUEST
189 // Set : Synchronize with the selected BSS
191 #define IOCTL_WB_802_11_DUT_JOIN_REQUEST CTL_CODE( \
192 FILE_DEVICE_UNKNOWN, \
193 WB_IOCTL_DUT_INDEX + 6, \
197 // IOCTL_WB_802_11_DUT_AUTHEN_REQUEST
199 // Set : Authenticate with the BSS
201 #define IOCTL_WB_802_11_DUT_AUTHEN_REQUEST CTL_CODE( \
202 FILE_DEVICE_UNKNOWN, \
203 WB_IOCTL_DUT_INDEX + 7, \
207 // IOCTL_WB_802_11_DUT_DEAUTHEN_REQUEST
209 // Set : DeAuthenticate withe the BSS
211 #define IOCTL_WB_802_11_DUT_DEAUTHEN_REQUEST CTL_CODE( \
212 FILE_DEVICE_UNKNOWN, \
213 WB_IOCTL_DUT_INDEX + 8, \
217 // IOCTL_WB_802_11_DUT_ASSOC_REQUEST
219 // Set : Associate withe the BSS
221 #define IOCTL_WB_802_11_DUT_ASSOC_REQUEST CTL_CODE( \
222 FILE_DEVICE_UNKNOWN, \
223 WB_IOCTL_DUT_INDEX + 9, \
227 // IOCTL_WB_802_11_DUT_REASSOC_REQUEST
229 // Set : ReAssociate withe the BSS
231 #define IOCTL_WB_802_11_DUT_REASSOC_REQUEST CTL_CODE( \
232 FILE_DEVICE_UNKNOWN, \
233 WB_IOCTL_DUT_INDEX + 10, \
238 // IOCTL_WB_802_11_DUT_DISASSOC_REQUEST
240 // Set : DisAssociate withe the BSS
242 #define IOCTL_WB_802_11_DUT_DISASSOC_REQUEST CTL_CODE( \
243 FILE_DEVICE_UNKNOWN, \
244 WB_IOCTL_DUT_INDEX + 11, \
248 // IOCTL_WB_802_11_DUT_FRAG_THRESHOLD
249 // Query: Return the dot11FragmentThreshold
250 // Set : Set the dot11FragmentThreshold
252 #define IOCTL_WB_802_11_DUT_FRAG_THRESHOLD CTL_CODE( \
253 FILE_DEVICE_UNKNOWN, \
254 WB_IOCTL_DUT_INDEX + 12, \
258 // IOCTL_WB_802_11_DUT_RTS_THRESHOLD
259 // Query: Return the dot11RTSThreshold
260 // Set : Set the dot11RTSThresold
262 #define IOCTL_WB_802_11_DUT_RTS_THRESHOLD CTL_CODE( \
263 FILE_DEVICE_UNKNOWN, \
264 WB_IOCTL_DUT_INDEX + 13, \
268 // IOCTL_WB_802_11_DUT_WEP_KEYMODE
269 // Query: Get the WEP key mode.
270 // Set : Set the WEP key mode: disable/64 bits/128 bits
272 #define IOCTL_WB_802_11_DUT_WEP_KEYMODE CTL_CODE( \
273 FILE_DEVICE_UNKNOWN, \
274 WB_IOCTL_DUT_INDEX + 14, \
278 // IOCTL_WB_802_11_DUT_WEP_KEYVALUE
280 // Set : fill in the WEP key value
282 #define IOCTL_WB_802_11_DUT_WEP_KEYVALUE CTL_CODE( \
283 FILE_DEVICE_UNKNOWN, \
284 WB_IOCTL_DUT_INDEX + 15, \
288 // IOCTL_WB_802_11_DUT_RESET
290 // Set : Reset S/W and H/W
292 #define IOCTL_WB_802_11_DUT_RESET CTL_CODE( \
293 FILE_DEVICE_UNKNOWN, \
294 WB_IOCTL_DUT_INDEX + 16, \
298 // IOCTL_WB_802_11_DUT_POWER_SAVE
300 // Set : Set Power Save Mode
302 #define IOCTL_WB_802_11_DUT_POWER_SAVE CTL_CODE( \
303 FILE_DEVICE_UNKNOWN, \
304 WB_IOCTL_DUT_INDEX + 17, \
308 // IOCTL_WB_802_11_DUT_BSSID_LIST_SCAN
312 #define IOCTL_WB_802_11_DUT_BSSID_LIST_SCAN CTL_CODE( \
313 FILE_DEVICE_UNKNOWN, \
314 WB_IOCTL_DUT_INDEX + 18, \
318 // IOCTL_WB_802_11_DUT_BSSID_LIST
319 // Query: Return the BSS info of BSSs in the last scanning process
322 #define IOCTL_WB_802_11_DUT_BSSID_LIST CTL_CODE( \
323 FILE_DEVICE_UNKNOWN, \
324 WB_IOCTL_DUT_INDEX + 19, \
328 // IOCTL_WB_802_11_DUT_STATISTICS
329 // Query: Return the statistics of Tx/Rx.
332 #define IOCTL_WB_802_11_DUT_STATISTICS CTL_CODE( \
333 FILE_DEVICE_UNKNOWN, \
334 WB_IOCTL_DUT_INDEX + 20, \
338 // IOCTL_WB_802_11_DUT_ACCEPT_BEACON
339 // Query: Return the current mode to accept beacon or not.
340 // Set : Enable or disable allowing the HW-MAC to pass the beacon to the SW-MAC
341 // Arguments: unsigned char
343 #define IOCTL_WB_802_11_DUT_ACCEPT_BEACON CTL_CODE( \
344 FILE_DEVICE_UNKNOWN, \
345 WB_IOCTL_DUT_INDEX + 21, \
349 // IOCTL_WB_802_11_DUT_ROAMING
350 // Query: Return the roaming function status
351 // Set : Enable/Disable the roaming function.
352 #define IOCTL_WB_802_11_DUT_ROAMING CTL_CODE( \
353 FILE_DEVICE_UNKNOWN, \
354 WB_IOCTL_DUT_INDEX + 22, \
358 // IOCTL_WB_802_11_DUT_DTO
359 // Query: Return the DTO(Data Throughput Optimization)
360 // function status (TRUE or FALSE)
361 // Set : Enable/Disable the DTO function.
363 #define IOCTL_WB_802_11_DUT_DTO CTL_CODE( \
364 FILE_DEVICE_UNKNOWN, \
365 WB_IOCTL_DUT_INDEX + 23, \
369 // IOCTL_WB_802_11_DUT_ANTENNA_DIVERSITY
370 // Query: Return the antenna diversity status. (TRUE/ON or FALSE/OFF)
371 // Set : Enable/Disable the antenna diversity.
373 #define IOCTL_WB_802_11_DUT_ANTENNA_DIVERSITY CTL_CODE( \
374 FILE_DEVICE_UNKNOWN, \
375 WB_IOCTL_DUT_INDEX + 24, \
379 //-------------- new added for a+b+g ---------------------
380 // IOCTL_WB_802_11_DUT_MAC_OPERATION_MODE
381 // Query: Return the MAC operation mode. (MODE_802_11_BG, MODE_802_11_A,
382 // MODE_802_11_ABG, MODE_802_11_BG_IBSS)
383 // Set : Set the MAC operation mode.
385 #define IOCTL_WB_802_11_DUT_MAC_OPERATION_MODE CTL_CODE( \
386 FILE_DEVICE_UNKNOWN, \
387 WB_IOCTL_DUT_INDEX + 25, \
391 // IOCTL_WB_802_11_DUT_TX_RATE_REDEFINED
392 // Query: Return the current tx rate which follows the definition in spec. (for
393 // example, 5.5M => 0x0b)
396 #define IOCTL_WB_802_11_DUT_TX_RATE_REDEFINED CTL_CODE( \
397 FILE_DEVICE_UNKNOWN, \
398 WB_IOCTL_DUT_INDEX + 26, \
402 // IOCTL_WB_802_11_DUT_PREAMBLE_MODE
403 // Query: Return the preamble mode. (auto or long)
404 // Set : Set the preamble mode.
406 #define IOCTL_WB_802_11_DUT_PREAMBLE_MODE CTL_CODE( \
407 FILE_DEVICE_UNKNOWN, \
408 WB_IOCTL_DUT_INDEX + 27, \
412 // IOCTL_WB_802_11_DUT_SLOT_TIME_MODE
413 // Query: Return the slot time mode. (auto or long)
414 // Set : Set the slot time mode.
416 #define IOCTL_WB_802_11_DUT_SLOT_TIME_MODE CTL_CODE( \
417 FILE_DEVICE_UNKNOWN, \
418 WB_IOCTL_DUT_INDEX + 28, \
421 //------------------------------------------------------------------
423 // IOCTL_WB_802_11_DUT_ADVANCE_STATUS
427 #define IOCTL_WB_802_11_DUT_ADVANCE_STATUS CTL_CODE( \
428 FILE_DEVICE_UNKNOWN, \
429 WB_IOCTL_DUT_INDEX + 29, \
433 // IOCTL_WB_802_11_DUT_TX_RATE_MODE
434 // Query: Return the tx rate mode. (RATE_AUTO, RATE_1M, .., RATE_54M, RATE_MAX)
435 // Set : Set the tx rate mode. (RATE_AUTO, RATE_1M, .., RATE_54M, RATE_MAX)
437 #define IOCTL_WB_802_11_DUT_TX_RATE_MODE CTL_CODE( \
438 FILE_DEVICE_UNKNOWN, \
439 WB_IOCTL_DUT_INDEX + 30, \
443 // IOCTL_WB_802_11_DUT_DTO_PARA
444 // Query: Return the DTO parameters
445 // Set : Set the DTO parameters
447 #define IOCTL_WB_802_11_DUT_DTO_PARA CTL_CODE( \
448 FILE_DEVICE_UNKNOWN, \
449 WB_IOCTL_DUT_INDEX + 31, \
453 // IOCTL_WB_802_11_DUT_EVENT_LOG
454 // Query: Return event log
455 // Set : Reset event log
457 #define IOCTL_WB_802_11_DUT_EVENT_LOG CTL_CODE( \
458 FILE_DEVICE_UNKNOWN, \
459 WB_IOCTL_DUT_INDEX + 32, \
463 // IOCTL_WB_802_11_DUT_CWMIN
464 // Query: NONE(It will be obtained by IOCTL_WB_802_11_DUT_ADVANCE_STATUS)
465 // Set : Set CWMin value
467 #define IOCTL_WB_802_11_DUT_CWMIN CTL_CODE( \
468 FILE_DEVICE_UNKNOWN, \
469 WB_IOCTL_DUT_INDEX + 33, \
473 // IOCTL_WB_802_11_DUT_CWMAX
474 // Query: NONE(It will be obtained by IOCTL_WB_802_11_DUT_ADVANCE_STATUS)
475 // Set : Set CWMax value
477 #define IOCTL_WB_802_11_DUT_CWMAX CTL_CODE( \
478 FILE_DEVICE_UNKNOWN, \
479 WB_IOCTL_DUT_INDEX + 34, \
484 //==========================================================
485 // IOCTLs for Testing
487 // IOCTL_WB_802_11_TS_SET_CXX_REG
489 // Set : Write the value to one of Cxx register.
491 #define IOCTL_WB_802_11_TS_SET_CXX_REG CTL_CODE( \
492 FILE_DEVICE_UNKNOWN, \
493 WB_IOCTL_TS_INDEX + 0, \
497 // IOCTL_WB_802_11_TS_GET_CXX_REG
498 // Query: Return the value of the Cxx register.
499 // Set : Write the reg no. (0x00, 0x04, 0x08 etc)
501 #define IOCTL_WB_802_11_TS_GET_CXX_REG CTL_CODE( \
502 FILE_DEVICE_UNKNOWN, \
503 WB_IOCTL_TS_INDEX + 1, \
507 // IOCTL_WB_802_11_TS_SET_DXX_REG
509 // Set : Write the value to one of Dxx register.
511 #define IOCTL_WB_802_11_TS_SET_DXX_REG CTL_CODE( \
512 FILE_DEVICE_UNKNOWN, \
513 WB_IOCTL_TS_INDEX + 2, \
517 // IOCTL_WB_802_11_TS_GET_DXX_REG
518 // Query: Return the value of the Dxx register.
519 // Set : Write the reg no. (0x00, 0x04, 0x08 etc)
521 #define IOCTL_WB_802_11_TS_GET_DXX_REG CTL_CODE( \
522 FILE_DEVICE_UNKNOWN, \
523 WB_IOCTL_TS_INDEX + 3, \
527 //============================================================
530 #define IOCTL_WB_802_11_TS_TX_RATE CTL_CODE( \
531 FILE_DEVICE_UNKNOWN, \
532 WB_IOCTL_TS_INDEX + 4, \
536 #define IOCTL_WB_802_11_TS_CURRENT_CHANNEL CTL_CODE( \
537 FILE_DEVICE_UNKNOWN, \
538 WB_IOCTL_TS_INDEX + 5, \
542 #define IOCTL_WB_802_11_TS_ENABLE_SEQNO CTL_CODE( \
543 FILE_DEVICE_UNKNOWN, \
544 WB_IOCTL_TS_INDEX + 6, \
548 #define IOCTL_WB_802_11_TS_ENALBE_ACKEDPACKET CTL_CODE( \
549 FILE_DEVICE_UNKNOWN, \
550 WB_IOCTL_TS_INDEX + 7, \
554 #define IOCTL_WB_802_11_TS_INHIBIT_CRC CTL_CODE( \
555 FILE_DEVICE_UNKNOWN, \
556 WB_IOCTL_TS_INDEX + 8, \
560 #define IOCTL_WB_802_11_TS_RESET_RCV_COUNTER CTL_CODE( \
561 FILE_DEVICE_UNKNOWN, \
562 WB_IOCTL_TS_INDEX + 9, \
566 #define IOCTL_WB_802_11_TS_SET_TX_TRIGGER CTL_CODE( \
567 FILE_DEVICE_UNKNOWN, \
568 WB_IOCTL_TS_INDEX + 10, \
572 #define IOCTL_WB_802_11_TS_FAILED_TX_COUNT CTL_CODE( \
573 FILE_DEVICE_UNKNOWN, \
574 WB_IOCTL_TS_INDEX + 11, \
579 #define IOCTL_WB_802_11_TS_TX_POWER CTL_CODE( \
580 FILE_DEVICE_UNKNOWN, \
581 WB_IOCTL_TS_INDEX + 12, \
585 #define IOCTL_WB_802_11_TS_MODE_ENABLE CTL_CODE( \
586 FILE_DEVICE_UNKNOWN, \
587 WB_IOCTL_TS_INDEX + 13, \
591 #define IOCTL_WB_802_11_TS_MODE_DISABLE CTL_CODE( \
592 FILE_DEVICE_UNKNOWN, \
593 WB_IOCTL_TS_INDEX + 14, \
597 #define IOCTL_WB_802_11_TS_ANTENNA CTL_CODE( \
598 FILE_DEVICE_UNKNOWN, \
599 WB_IOCTL_TS_INDEX + 15, \
603 #define IOCTL_WB_802_11_TS_ADAPTER_INFO CTL_CODE( \
604 FILE_DEVICE_UNKNOWN, \
605 WB_IOCTL_TS_INDEX + 16, \
609 #define IOCTL_WB_802_11_TS_MAC_ADDRESS CTL_CODE( \
610 FILE_DEVICE_UNKNOWN, \
611 WB_IOCTL_TS_INDEX + 17, \
615 #define IOCTL_WB_802_11_TS_BSSID CTL_CODE( \
616 FILE_DEVICE_UNKNOWN, \
617 WB_IOCTL_TS_INDEX + 18, \
621 #define IOCTL_WB_802_11_TS_RF_PARAMETER CTL_CODE( \
622 FILE_DEVICE_UNKNOWN, \
623 WB_IOCTL_TS_INDEX + 19, \
627 #define IOCTL_WB_802_11_TS_FILTER CTL_CODE( \
628 FILE_DEVICE_UNKNOWN, \
629 WB_IOCTL_TS_INDEX + 20, \
633 #define IOCTL_WB_802_11_TS_CALIBRATION CTL_CODE( \
634 FILE_DEVICE_UNKNOWN, \
635 WB_IOCTL_TS_INDEX + 21, \
639 #define IOCTL_WB_802_11_TS_BSS_MODE CTL_CODE( \
640 FILE_DEVICE_UNKNOWN, \
641 WB_IOCTL_TS_INDEX + 22, \
645 #define IOCTL_WB_802_11_TS_SET_SSID CTL_CODE( \
646 FILE_DEVICE_UNKNOWN, \
647 WB_IOCTL_TS_INDEX + 23, \
651 #define IOCTL_WB_802_11_TS_IBSS_CHANNEL CTL_CODE( \
652 FILE_DEVICE_UNKNOWN, \
653 WB_IOCTL_TS_INDEX + 24, \
657 // set/query the slot time value(short or long slot time)
658 #define IOCTL_WB_802_11_TS_SLOT_TIME CTL_CODE( \
659 FILE_DEVICE_UNKNOWN, \
660 WB_IOCTL_TS_INDEX + 25, \
664 #define IOCTL_WB_802_11_TS_SLOT_TIME CTL_CODE( \
665 FILE_DEVICE_UNKNOWN, \
666 WB_IOCTL_TS_INDEX + 25, \
670 #define IOCTL_WB_802_11_TS_RX_STATISTICS CTL_CODE( \
671 FILE_DEVICE_UNKNOWN, \
672 WB_IOCTL_TS_INDEX + 26, \
676 #endif // #ifndef _IOCTLS_H