Source code of Windows XP (NT5)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

790 lines
33 KiB

  1. /*++
  2. Copyright (c) 1996 Microsoft Corporation
  3. Module Name:
  4. usb.c
  5. Abstract: USB lower filter driver
  6. Author:
  7. Kenneth D. Ray
  8. Environment:
  9. Kernel mode
  10. Revision History:
  11. --*/
  12. #include <wdm.h>
  13. #include "valueadd.h"
  14. #include "local.h"
  15. #include "usbdi.h"
  16. #include "usbdlib.h"
  17. VOID
  18. VA_PrintURB (
  19. IN PURB Urb,
  20. IN ULONG PrintMask
  21. );
  22. NTSTATUS
  23. VA_FilterURB_Comp (
  24. IN PDEVICE_OBJECT Device,
  25. IN PIRP Irp,
  26. IN PVOID Context
  27. );
  28. NTSTATUS
  29. VA_FilterURB (
  30. IN PDEVICE_OBJECT DeviceObject,
  31. IN PIRP Irp
  32. )
  33. /*++
  34. Routine Description:
  35. The default dispatch routine. If this filter does not recognize the
  36. IRP, then it should send it down, unmodified.
  37. No completion routine is required.
  38. As we have NO idea which function we are happily passing on, we can make
  39. NO assumptions about whether or not it will be called at raised IRQL.
  40. For this reason, this function must be in put into non-paged pool
  41. (aka the default location).
  42. Arguments:
  43. DeviceObject - pointer to a device object.
  44. Irp - pointer to an I/O Request Packet.
  45. Return Value:
  46. NT status code
  47. --*/
  48. {
  49. PVA_USB_DATA usbData;
  50. NTSTATUS status;
  51. PIO_STACK_LOCATION stack;
  52. PURB urb;
  53. stack = IoGetCurrentIrpStackLocation (Irp);
  54. usbData = (PVA_USB_DATA) DeviceObject->DeviceExtension;
  55. ASSERT (IRP_MJ_INTERNAL_DEVICE_CONTROL == stack->MajorFunction);
  56. if(DeviceObject == Global.ControlObject) {
  57. //
  58. // This irp was sent to the control device object, which knows not
  59. // how to deal with this IRP. It is therefore an error.
  60. //
  61. Irp->IoStatus.Information = 0;
  62. Irp->IoStatus.Status = STATUS_NOT_SUPPORTED;
  63. IoCompleteRequest(Irp, IO_NO_INCREMENT);
  64. return STATUS_NOT_SUPPORTED;
  65. }
  66. //
  67. // This IRP was sent to the filter driver.
  68. // Since we do not know what to do with the IRP, we should pass
  69. // it on along down the stack.
  70. //
  71. InterlockedIncrement (&usbData->OutstandingIO);
  72. if (usbData->Removed) {
  73. status = STATUS_DELETE_PENDING;
  74. Irp->IoStatus.Information = 0;
  75. Irp->IoStatus.Status = status;
  76. IoCompleteRequest (Irp, IO_NO_INCREMENT);
  77. } else {
  78. switch (stack->Parameters.DeviceIoControl.IoControlCode) {
  79. case IOCTL_INTERNAL_USB_SUBMIT_URB:
  80. urb = stack->Parameters.Others.Argument1;
  81. if (VA_PRINT_BEFORE & usbData->PrintMask) {
  82. VA_PrintURB (urb, usbData->PrintMask);
  83. }
  84. if (VA_PRINT_AFTER & usbData->PrintMask) {
  85. //
  86. // Copy the stack arguments
  87. //
  88. IoCopyCurrentIrpStackLocationToNext (Irp);
  89. //
  90. // Hook the IRP so that we might print after
  91. //
  92. IoSetCompletionRoutine (Irp,
  93. VA_FilterURB_Comp,
  94. usbData,
  95. TRUE,
  96. TRUE,
  97. TRUE);
  98. } else {
  99. //
  100. // Send the IRP on unchanged.
  101. //
  102. IoSkipCurrentIrpStackLocation (Irp);
  103. }
  104. status = IoCallDriver (usbData->TopOfStack, Irp);
  105. break;
  106. default:
  107. //
  108. // Send the IRP on unchanged.
  109. //
  110. IoSkipCurrentIrpStackLocation (Irp);
  111. status = IoCallDriver (usbData->TopOfStack, Irp);
  112. break;
  113. }
  114. }
  115. if (0 == InterlockedDecrement (&usbData->OutstandingIO)) {
  116. KeSetEvent (&usbData->RemoveEvent, 0, FALSE);
  117. }
  118. return status;
  119. }
  120. NTSTATUS
  121. VA_FilterURB_Comp (
  122. IN PDEVICE_OBJECT Device,
  123. IN PIRP Irp,
  124. IN PVOID Context
  125. )
  126. {
  127. PVA_USB_DATA usbData;
  128. PURB urb;
  129. UNREFERENCED_PARAMETER (Device);
  130. urb = IoGetCurrentIrpStackLocation(Irp)->Parameters.Others.Argument1;
  131. usbData = (PVA_USB_DATA) Context;
  132. VA_PrintURB (urb, usbData->PrintMask);
  133. return STATUS_SUCCESS;
  134. }
  135. VOID
  136. VA_PrintURB (
  137. IN PURB Urb,
  138. IN ULONG PrintMask
  139. )
  140. /*++
  141. Routine Description:
  142. Print to the debugger the given Urb
  143. --*/
  144. {
  145. BOOLEAN again = TRUE;
  146. ULONG i;
  147. #define HEADER(URB) \
  148. VA_KdPrint (("URB: Len (%x) Status (%x) Dev Handle (%x) Flags (%x)\n",\
  149. URB->UrbHeader.Length, \
  150. URB->UrbHeader.Status, \
  151. URB->UrbHeader.UsbdDeviceHandle, \
  152. URB->UrbHeader.UsbdFlags))
  153. while (Urb && again) {
  154. again = FALSE;
  155. switch (Urb->UrbHeader.Function) {
  156. case URB_FUNCTION_SELECT_INTERFACE:
  157. if (PrintMask & VA_PRINT_COMMAND) {
  158. HEADER(Urb);
  159. VA_KdPrint (("Select Interface: ConfigHandle (%x) Interface (%x)\n",
  160. Urb->UrbSelectInterface.ConfigurationHandle,
  161. Urb->UrbSelectInterface.Interface));
  162. }
  163. break;
  164. case URB_FUNCTION_SELECT_CONFIGURATION:
  165. if (PrintMask & VA_PRINT_COMMAND) {
  166. HEADER(Urb);
  167. VA_KdPrint (("Select Config: Config Desc (%x) Hand (%x) Int (%x)\n",
  168. Urb->UrbSelectConfiguration.ConfigurationDescriptor,
  169. Urb->UrbSelectConfiguration.ConfigurationHandle,
  170. Urb->UrbSelectConfiguration.Interface));
  171. }
  172. break;
  173. case URB_FUNCTION_ABORT_PIPE:
  174. if (PrintMask & VA_PRINT_COMMAND) {
  175. HEADER(Urb);
  176. VA_KdPrint (("Abort Pipe: (%x)\n",
  177. Urb->UrbPipeRequest.PipeHandle));
  178. }
  179. break;
  180. case URB_FUNCTION_RESET_PIPE:
  181. if (PrintMask & VA_PRINT_COMMAND) {
  182. HEADER(Urb);
  183. VA_KdPrint (("Reset Pipe: (%x)\n",
  184. Urb->UrbPipeRequest.PipeHandle));
  185. }
  186. break;
  187. case URB_FUNCTION_TAKE_FRAME_LENGTH_CONTROL:
  188. if (PrintMask & VA_PRINT_COMMAND) {
  189. HEADER(Urb);
  190. VA_KdPrint (("Get Frame Length Control \n"));
  191. }
  192. break;
  193. case URB_FUNCTION_RELEASE_FRAME_LENGTH_CONTROL:
  194. if (PrintMask & VA_PRINT_COMMAND) {
  195. HEADER(Urb);
  196. VA_KdPrint (("Release Frame Length Control \n"));
  197. }
  198. break;
  199. case URB_FUNCTION_GET_FRAME_LENGTH:
  200. if (PrintMask & VA_PRINT_COMMAND) {
  201. HEADER(Urb);
  202. VA_KdPrint (("Get Frame Length (%x) Num (%x) \n",
  203. Urb->UrbGetFrameLength.FrameLength,
  204. Urb->UrbGetFrameLength.FrameNumber));
  205. }
  206. break;
  207. case URB_FUNCTION_SET_FRAME_LENGTH:
  208. if (PrintMask & VA_PRINT_COMMAND) {
  209. HEADER(Urb);
  210. VA_KdPrint (("Set Frame Length Delta (0x%x) \n",
  211. Urb->UrbSetFrameLength.FrameLengthDelta));
  212. }
  213. break;
  214. case URB_FUNCTION_GET_CURRENT_FRAME_NUMBER:
  215. if (PrintMask & VA_PRINT_COMMAND) {
  216. HEADER(Urb);
  217. VA_KdPrint (("Current Frame Number (%x) \n",
  218. Urb->UrbGetCurrentFrameNumber.FrameNumber));
  219. }
  220. break;
  221. case URB_FUNCTION_CONTROL_TRANSFER:
  222. if (PrintMask & VA_PRINT_CONTROL) {
  223. HEADER(Urb);
  224. VA_KdPrint (("Control Xfer: Pipe (%x) Flags (%x) "
  225. "Len (%x) Buffer (%x) MDL (%x) HCA (%x) "
  226. "SetupPacket: %02.02x %02.02x %02.02x %02.02x "
  227. "%02.02x %02.02x %02.02x %02.02x\n",
  228. Urb->UrbControlTransfer.PipeHandle,
  229. Urb->UrbControlTransfer.TransferFlags,
  230. Urb->UrbControlTransfer.TransferBufferLength,
  231. Urb->UrbControlTransfer.TransferBuffer,
  232. Urb->UrbControlTransfer.TransferBufferMDL,
  233. &Urb->UrbControlTransfer.hca,
  234. (ULONG) Urb->UrbControlTransfer.SetupPacket[0],
  235. (ULONG) Urb->UrbControlTransfer.SetupPacket[1],
  236. (ULONG) Urb->UrbControlTransfer.SetupPacket[2],
  237. (ULONG) Urb->UrbControlTransfer.SetupPacket[3],
  238. (ULONG) Urb->UrbControlTransfer.SetupPacket[4],
  239. (ULONG) Urb->UrbControlTransfer.SetupPacket[5],
  240. (ULONG) Urb->UrbControlTransfer.SetupPacket[6],
  241. (ULONG) Urb->UrbControlTransfer.SetupPacket[7]));
  242. }
  243. Urb = Urb->UrbControlTransfer.UrbLink;
  244. again = TRUE;
  245. break;
  246. case URB_FUNCTION_BULK_OR_INTERRUPT_TRANSFER:
  247. if (PrintMask & VA_PRINT_TRANSFER) {
  248. HEADER(Urb);
  249. VA_KdPrint (("Bulk | Interrupt Xfer: Pipe (%x) Flags (%x) "
  250. "Len (%x) Buffer (%x) MDL (%x) HCA (%x)\n",
  251. Urb->UrbBulkOrInterruptTransfer.PipeHandle,
  252. Urb->UrbBulkOrInterruptTransfer.TransferFlags,
  253. Urb->UrbBulkOrInterruptTransfer.TransferBufferLength,
  254. Urb->UrbBulkOrInterruptTransfer.TransferBuffer,
  255. Urb->UrbBulkOrInterruptTransfer.TransferBufferMDL,
  256. &Urb->UrbControlTransfer.hca));
  257. }
  258. Urb = Urb->UrbBulkOrInterruptTransfer.UrbLink;
  259. again = TRUE;
  260. break;
  261. case URB_FUNCTION_ISOCH_TRANSFER:
  262. if (PrintMask & VA_PRINT_TRANSFER) {
  263. PUSBD_ISO_PACKET_DESCRIPTOR packet;
  264. HEADER(Urb);
  265. VA_KdPrint (("Isoch Xfer: Pipe (%x) Flags (%x) "
  266. "Len (%x) Buffer (%x) MDL (%x) HCA (%x) "
  267. "StartFrame (%x) NumPkts (%x) ErrorCount (%x)\n",
  268. Urb->UrbIsochronousTransfer.PipeHandle,
  269. Urb->UrbIsochronousTransfer.TransferFlags,
  270. Urb->UrbIsochronousTransfer.TransferBufferLength,
  271. Urb->UrbIsochronousTransfer.TransferBuffer,
  272. Urb->UrbIsochronousTransfer.TransferBufferMDL,
  273. &Urb->UrbIsochronousTransfer.hca,
  274. Urb->UrbIsochronousTransfer.StartFrame,
  275. Urb->UrbIsochronousTransfer.NumberOfPackets,
  276. Urb->UrbIsochronousTransfer.ErrorCount));
  277. for (i = 0, packet = &Urb->UrbIsochronousTransfer.IsoPacket[0];
  278. i < Urb->UrbIsochronousTransfer.NumberOfPackets;
  279. i++, packet++) {
  280. VA_KdPrint (("Offset: (%x), Length (%x), Status (%x)\n",
  281. packet->Offset,
  282. packet->Length,
  283. packet->Status));
  284. }
  285. }
  286. break;
  287. case URB_FUNCTION_GET_DESCRIPTOR_FROM_DEVICE:
  288. if (PrintMask & VA_PRINT_DESCRIPTOR) {
  289. HEADER(Urb);
  290. VA_KdPrint (("Device Desc: Length (%x) Buffer (%x) MDL (%x) "
  291. "Index (%x) Type (%x) Lang (%x) HCA (%x)\n",
  292. Urb->UrbControlDescriptorRequest.TransferBufferLength,
  293. Urb->UrbControlDescriptorRequest.TransferBuffer,
  294. Urb->UrbControlDescriptorRequest.TransferBufferMDL,
  295. Urb->UrbControlDescriptorRequest.Index,
  296. Urb->UrbControlDescriptorRequest.DescriptorType,
  297. Urb->UrbControlDescriptorRequest.LanguageId,
  298. &Urb->UrbControlDescriptorRequest.hca));
  299. }
  300. Urb = Urb->UrbControlDescriptorRequest.UrbLink;
  301. again = TRUE;
  302. break;
  303. case URB_FUNCTION_GET_DESCRIPTOR_FROM_ENDPOINT:
  304. if (PrintMask & VA_PRINT_DESCRIPTOR) {
  305. VA_KdPrint (("Endpoint Desc: Length (%x) Buffer (%x) MDL (%x) "
  306. "Index (%x) Type (%x) Lang (%x) HCA (%x)\n",
  307. Urb->UrbControlDescriptorRequest.TransferBufferLength,
  308. Urb->UrbControlDescriptorRequest.TransferBuffer,
  309. Urb->UrbControlDescriptorRequest.TransferBufferMDL,
  310. Urb->UrbControlDescriptorRequest.Index,
  311. Urb->UrbControlDescriptorRequest.DescriptorType,
  312. Urb->UrbControlDescriptorRequest.LanguageId,
  313. &Urb->UrbControlDescriptorRequest.hca));
  314. }
  315. Urb = Urb->UrbControlDescriptorRequest.UrbLink;
  316. again = TRUE;
  317. break;
  318. case URB_FUNCTION_GET_DESCRIPTOR_FROM_INTERFACE:
  319. if (PrintMask & VA_PRINT_DESCRIPTOR) {
  320. HEADER(Urb);
  321. VA_KdPrint (("Interface Desc: Length (%x) Buffer (%x) MDL (%x) "
  322. "Index (%x) Type (%x) Lang (%x) HCA (%x)\n",
  323. Urb->UrbControlDescriptorRequest.TransferBufferLength,
  324. Urb->UrbControlDescriptorRequest.TransferBuffer,
  325. Urb->UrbControlDescriptorRequest.TransferBufferMDL,
  326. Urb->UrbControlDescriptorRequest.Index,
  327. Urb->UrbControlDescriptorRequest.DescriptorType,
  328. Urb->UrbControlDescriptorRequest.LanguageId,
  329. &Urb->UrbControlDescriptorRequest.hca));
  330. }
  331. Urb = Urb->UrbBulkOrInterruptTransfer.UrbLink;
  332. again = TRUE;
  333. break;
  334. case URB_FUNCTION_SET_DESCRIPTOR_TO_DEVICE:
  335. if (PrintMask & VA_PRINT_DESCRIPTOR) {
  336. HEADER(Urb);
  337. VA_KdPrint (("SET Device Desc: Length (%x) Buffer (%x) MDL (%x) "
  338. "Index (%x) Type (%x) Lang (%x) HCA (%x)\n",
  339. Urb->UrbControlDescriptorRequest.TransferBufferLength,
  340. Urb->UrbControlDescriptorRequest.TransferBuffer,
  341. Urb->UrbControlDescriptorRequest.TransferBufferMDL,
  342. Urb->UrbControlDescriptorRequest.Index,
  343. Urb->UrbControlDescriptorRequest.DescriptorType,
  344. Urb->UrbControlDescriptorRequest.LanguageId,
  345. &Urb->UrbControlDescriptorRequest.hca));
  346. }
  347. Urb = Urb->UrbControlDescriptorRequest.UrbLink;
  348. again = TRUE;
  349. break;
  350. case URB_FUNCTION_SET_DESCRIPTOR_TO_ENDPOINT:
  351. if (PrintMask & VA_PRINT_DESCRIPTOR) {
  352. HEADER(Urb);
  353. VA_KdPrint (("SET End Desc: Length (%x) Buffer (%x) MDL (%x) "
  354. "Index (%x) Type (%x) Lang (%x) HCA (%x)\n",
  355. Urb->UrbControlDescriptorRequest.TransferBufferLength,
  356. Urb->UrbControlDescriptorRequest.TransferBuffer,
  357. Urb->UrbControlDescriptorRequest.TransferBufferMDL,
  358. Urb->UrbControlDescriptorRequest.Index,
  359. Urb->UrbControlDescriptorRequest.DescriptorType,
  360. Urb->UrbControlDescriptorRequest.LanguageId,
  361. &Urb->UrbControlDescriptorRequest.hca));
  362. }
  363. Urb = Urb->UrbControlDescriptorRequest.UrbLink;
  364. again = TRUE;
  365. break;
  366. case URB_FUNCTION_SET_DESCRIPTOR_TO_INTERFACE:
  367. if (PrintMask & VA_PRINT_DESCRIPTOR) {
  368. HEADER(Urb);
  369. VA_KdPrint (("SET Intrfc Desc: Len (%x) Buffer (%x) MDL (%x) "
  370. "Index (%x) Type (%x) Lang (%x) HCA (%x)\n",
  371. Urb->UrbControlDescriptorRequest.TransferBufferLength,
  372. Urb->UrbControlDescriptorRequest.TransferBuffer,
  373. Urb->UrbControlDescriptorRequest.TransferBufferMDL,
  374. Urb->UrbControlDescriptorRequest.Index,
  375. Urb->UrbControlDescriptorRequest.DescriptorType,
  376. Urb->UrbControlDescriptorRequest.LanguageId,
  377. &Urb->UrbControlDescriptorRequest.hca));
  378. }
  379. Urb = Urb->UrbControlDescriptorRequest.UrbLink;
  380. again = TRUE;
  381. break;
  382. case URB_FUNCTION_SET_FEATURE_TO_DEVICE:
  383. if (PrintMask & VA_PRINT_FEATURE) {
  384. HEADER(Urb);
  385. VA_KdPrint (("Set Dev Feature: Selector (%x) Index (%x)\n",
  386. Urb->UrbControlFeatureRequest.FeatureSelector,
  387. Urb->UrbControlFeatureRequest.Index));
  388. }
  389. Urb = Urb->UrbControlFeatureRequest.UrbLink;
  390. again = TRUE;
  391. break;
  392. case URB_FUNCTION_SET_FEATURE_TO_INTERFACE:
  393. if (PrintMask & VA_PRINT_FEATURE) {
  394. HEADER(Urb);
  395. VA_KdPrint (("Set Interface Feature: Selector (%x) Index (%x)\n",
  396. Urb->UrbControlFeatureRequest.FeatureSelector,
  397. Urb->UrbControlFeatureRequest.Index));
  398. }
  399. Urb = Urb->UrbControlFeatureRequest.UrbLink;
  400. again = TRUE;
  401. break;
  402. case URB_FUNCTION_SET_FEATURE_TO_ENDPOINT:
  403. if (PrintMask & VA_PRINT_FEATURE) {
  404. HEADER(Urb);
  405. VA_KdPrint (("Set Endpoint Feature: Selector (%x) Index (%x)\n",
  406. Urb->UrbControlFeatureRequest.FeatureSelector,
  407. Urb->UrbControlFeatureRequest.Index));
  408. }
  409. Urb = Urb->UrbControlFeatureRequest.UrbLink;
  410. again = TRUE;
  411. break;
  412. case URB_FUNCTION_SET_FEATURE_TO_OTHER:
  413. if (PrintMask & VA_PRINT_FEATURE) {
  414. HEADER(Urb);
  415. VA_KdPrint (("Set Other Feature: Selector (%x) Index (%x)\n",
  416. Urb->UrbControlFeatureRequest.FeatureSelector,
  417. Urb->UrbControlFeatureRequest.Index));
  418. }
  419. Urb = Urb->UrbControlFeatureRequest.UrbLink;
  420. again = TRUE;
  421. break;
  422. case URB_FUNCTION_CLEAR_FEATURE_TO_DEVICE:
  423. if (PrintMask & VA_PRINT_FEATURE) {
  424. HEADER(Urb);
  425. VA_KdPrint (("Clear Device Feature: Selector (%x) Index (%x)\n",
  426. Urb->UrbControlFeatureRequest.FeatureSelector,
  427. Urb->UrbControlFeatureRequest.Index));
  428. }
  429. Urb = Urb->UrbControlFeatureRequest.UrbLink;
  430. again = TRUE;
  431. break;
  432. case URB_FUNCTION_CLEAR_FEATURE_TO_INTERFACE:
  433. if (PrintMask & VA_PRINT_FEATURE) {
  434. HEADER(Urb);
  435. VA_KdPrint (("Clear Interface Feature: Selector (%x) Index (%x)\n",
  436. Urb->UrbControlFeatureRequest.FeatureSelector,
  437. Urb->UrbControlFeatureRequest.Index));
  438. }
  439. Urb = Urb->UrbControlFeatureRequest.UrbLink;
  440. again = TRUE;
  441. break;
  442. case URB_FUNCTION_CLEAR_FEATURE_TO_ENDPOINT:
  443. if (PrintMask & VA_PRINT_FEATURE) {
  444. HEADER(Urb);
  445. VA_KdPrint (("Clear Endpoint Feature: Selector (%x) Index (%x)\n",
  446. Urb->UrbControlFeatureRequest.FeatureSelector,
  447. Urb->UrbControlFeatureRequest.Index));
  448. }
  449. Urb = Urb->UrbControlFeatureRequest.UrbLink;
  450. again = TRUE;
  451. break;
  452. case URB_FUNCTION_CLEAR_FEATURE_TO_OTHER:
  453. if (PrintMask & VA_PRINT_FEATURE) {
  454. HEADER(Urb);
  455. VA_KdPrint (("Clear Other Feature: Selector (%x) Index (%x)\n",
  456. Urb->UrbControlFeatureRequest.FeatureSelector,
  457. Urb->UrbControlFeatureRequest.Index));
  458. }
  459. Urb = Urb->UrbControlFeatureRequest.UrbLink;
  460. again = TRUE;
  461. break;
  462. case URB_FUNCTION_GET_STATUS_FROM_DEVICE:
  463. if (PrintMask & VA_PRINT_COMMAND) {
  464. HEADER(Urb);
  465. VA_KdPrint (("Get Device Status: len (%x) Buffer (%x) MDL (%x) "
  466. "Index (%x)\n",
  467. Urb->UrbControlGetStatusRequest.TransferBufferLength,
  468. Urb->UrbControlGetStatusRequest.TransferBuffer,
  469. Urb->UrbControlGetStatusRequest.TransferBufferMDL,
  470. Urb->UrbControlGetStatusRequest.Index));
  471. }
  472. Urb = Urb->UrbControlGetStatusRequest.UrbLink;
  473. again = TRUE;
  474. break;
  475. case URB_FUNCTION_GET_STATUS_FROM_INTERFACE:
  476. if (PrintMask & VA_PRINT_COMMAND) {
  477. HEADER(Urb);
  478. VA_KdPrint (("Get Interface Status: len (%x) Buffer (%x) MDL (%x) "
  479. "Index (%x)\n",
  480. Urb->UrbControlGetStatusRequest.TransferBufferLength,
  481. Urb->UrbControlGetStatusRequest.TransferBuffer,
  482. Urb->UrbControlGetStatusRequest.TransferBufferMDL,
  483. Urb->UrbControlGetStatusRequest.Index));
  484. }
  485. Urb = Urb->UrbControlGetStatusRequest.UrbLink;
  486. again = TRUE;
  487. break;
  488. case URB_FUNCTION_GET_STATUS_FROM_ENDPOINT:
  489. if (PrintMask & VA_PRINT_COMMAND) {
  490. HEADER(Urb);
  491. VA_KdPrint (("Get Endpoint Status: len (%x) Buffer (%x) MDL (%x) "
  492. "Index (%x)\n",
  493. Urb->UrbControlGetStatusRequest.TransferBufferLength,
  494. Urb->UrbControlGetStatusRequest.TransferBuffer,
  495. Urb->UrbControlGetStatusRequest.TransferBufferMDL,
  496. Urb->UrbControlGetStatusRequest.Index));
  497. }
  498. Urb = Urb->UrbControlGetStatusRequest.UrbLink;
  499. again = TRUE;
  500. break;
  501. case URB_FUNCTION_GET_STATUS_FROM_OTHER:
  502. if (PrintMask & VA_PRINT_COMMAND) {
  503. HEADER(Urb);
  504. VA_KdPrint (("Get Other Status: len (%x) Buffer (%x) MDL (%x) "
  505. "Index (%x)\n",
  506. Urb->UrbControlGetStatusRequest.TransferBufferLength,
  507. Urb->UrbControlGetStatusRequest.TransferBuffer,
  508. Urb->UrbControlGetStatusRequest.TransferBufferMDL,
  509. Urb->UrbControlGetStatusRequest.Index));
  510. }
  511. Urb = Urb->UrbControlGetStatusRequest.UrbLink;
  512. again = TRUE;
  513. break;
  514. case URB_FUNCTION_VENDOR_DEVICE:
  515. if (PrintMask & VA_PRINT_FEATURE) {
  516. HEADER(Urb);
  517. VA_KdPrint (("Vendor Device Req: len (%x) Buffer (%x) MDL (%x) "
  518. "Flags (%x) RequestTypeBits (%x) "
  519. "Request (%x) Value (%x) Index (%x)\n",
  520. Urb->UrbControlVendorClassRequest.TransferBufferLength,
  521. Urb->UrbControlVendorClassRequest.TransferBuffer,
  522. Urb->UrbControlVendorClassRequest.TransferBufferMDL,
  523. Urb->UrbControlVendorClassRequest.TransferFlags,
  524. Urb->UrbControlVendorClassRequest.RequestTypeReservedBits,
  525. Urb->UrbControlVendorClassRequest.Request,
  526. Urb->UrbControlVendorClassRequest.Value,
  527. Urb->UrbControlVendorClassRequest.Index));
  528. }
  529. Urb = Urb->UrbBulkOrInterruptTransfer.UrbLink;
  530. again = TRUE;
  531. break;
  532. case URB_FUNCTION_VENDOR_INTERFACE:
  533. if (PrintMask & VA_PRINT_FEATURE) {
  534. HEADER(Urb);
  535. VA_KdPrint (("Vendor Intfc Req: len (%x) Buffer (%x) MDL (%x) "
  536. "Flags (%x) RequestTypeBits (%x) "
  537. "Request (%x) Value (%x) Index (%x)\n",
  538. Urb->UrbControlVendorClassRequest.TransferBufferLength,
  539. Urb->UrbControlVendorClassRequest.TransferBuffer,
  540. Urb->UrbControlVendorClassRequest.TransferBufferMDL,
  541. Urb->UrbControlVendorClassRequest.TransferFlags,
  542. Urb->UrbControlVendorClassRequest.RequestTypeReservedBits,
  543. Urb->UrbControlVendorClassRequest.Request,
  544. Urb->UrbControlVendorClassRequest.Value,
  545. Urb->UrbControlVendorClassRequest.Index));
  546. }
  547. Urb = Urb->UrbControlVendorClassRequest.UrbLink;
  548. again = TRUE;
  549. break;
  550. case URB_FUNCTION_VENDOR_ENDPOINT:
  551. if (PrintMask & VA_PRINT_FEATURE) {
  552. HEADER(Urb);
  553. VA_KdPrint (("Vendor Endpt Req: len (%x) Buffer (%x) MDL (%x) "
  554. "Flags (%x) RequestTypeBits (%x) "
  555. "Request (%x) Value (%x) Index (%x)\n",
  556. Urb->UrbControlVendorClassRequest.TransferBufferLength,
  557. Urb->UrbControlVendorClassRequest.TransferBuffer,
  558. Urb->UrbControlVendorClassRequest.TransferBufferMDL,
  559. Urb->UrbControlVendorClassRequest.TransferFlags,
  560. Urb->UrbControlVendorClassRequest.RequestTypeReservedBits,
  561. Urb->UrbControlVendorClassRequest.Request,
  562. Urb->UrbControlVendorClassRequest.Value,
  563. Urb->UrbControlVendorClassRequest.Index));
  564. }
  565. Urb = Urb->UrbControlVendorClassRequest.UrbLink;
  566. again = TRUE;
  567. break;
  568. case URB_FUNCTION_VENDOR_OTHER:
  569. if (PrintMask & VA_PRINT_FEATURE) {
  570. HEADER(Urb);
  571. VA_KdPrint (("Vendor Other Req: len (%x) Buffer (%x) MDL (%x) "
  572. "Flags (%x) RequestTypeBits (%x) "
  573. "Request (%x) Value (%x) Index (%x)\n",
  574. Urb->UrbControlVendorClassRequest.TransferBufferLength,
  575. Urb->UrbControlVendorClassRequest.TransferBuffer,
  576. Urb->UrbControlVendorClassRequest.TransferBufferMDL,
  577. Urb->UrbControlVendorClassRequest.TransferFlags,
  578. Urb->UrbControlVendorClassRequest.RequestTypeReservedBits,
  579. Urb->UrbControlVendorClassRequest.Request,
  580. Urb->UrbControlVendorClassRequest.Value,
  581. Urb->UrbControlVendorClassRequest.Index));
  582. }
  583. Urb = Urb->UrbControlVendorClassRequest.UrbLink;
  584. again = TRUE;
  585. break;
  586. case URB_FUNCTION_CLASS_DEVICE:
  587. if (PrintMask & VA_PRINT_FEATURE) {
  588. HEADER(Urb);
  589. VA_KdPrint (("Class Device Req: len (%x) Buffer (%x) MDL (%x) "
  590. "Flags (%x) RequestTypeBits (%x) "
  591. "Request (%x) Value (%x) Index (%x)\n",
  592. Urb->UrbControlVendorClassRequest.TransferBufferLength,
  593. Urb->UrbControlVendorClassRequest.TransferBuffer,
  594. Urb->UrbControlVendorClassRequest.TransferBufferMDL,
  595. Urb->UrbControlVendorClassRequest.TransferFlags,
  596. Urb->UrbControlVendorClassRequest.RequestTypeReservedBits,
  597. Urb->UrbControlVendorClassRequest.Request,
  598. Urb->UrbControlVendorClassRequest.Value,
  599. Urb->UrbControlVendorClassRequest.Index));
  600. }
  601. Urb = Urb->UrbControlVendorClassRequest.UrbLink;
  602. again = TRUE;
  603. break;
  604. case URB_FUNCTION_CLASS_INTERFACE:
  605. if (PrintMask & VA_PRINT_FEATURE) {
  606. HEADER(Urb);
  607. VA_KdPrint (("Class Intface Req: len (%x) Buffer (%x) MDL (%x) "
  608. "Flags (%x) RequestTypeBits (%x) "
  609. "Request (%x) Value (%x) Index (%x)\n",
  610. Urb->UrbControlVendorClassRequest.TransferBufferLength,
  611. Urb->UrbControlVendorClassRequest.TransferBuffer,
  612. Urb->UrbControlVendorClassRequest.TransferBufferMDL,
  613. Urb->UrbControlVendorClassRequest.TransferFlags,
  614. Urb->UrbControlVendorClassRequest.RequestTypeReservedBits,
  615. Urb->UrbControlVendorClassRequest.Request,
  616. Urb->UrbControlVendorClassRequest.Value,
  617. Urb->UrbControlVendorClassRequest.Index));
  618. }
  619. Urb = Urb->UrbControlVendorClassRequest.UrbLink;
  620. again = TRUE;
  621. break;
  622. case URB_FUNCTION_CLASS_ENDPOINT:
  623. if (PrintMask & VA_PRINT_FEATURE) {
  624. HEADER(Urb);
  625. VA_KdPrint (("Class Endpnt Req: len (%x) Buffer (%x) MDL (%x) "
  626. "Flags (%x) RequestTypeBits (%x) "
  627. "Request (%x) Value (%x) Index (%x)\n",
  628. Urb->UrbControlVendorClassRequest.TransferBufferLength,
  629. Urb->UrbControlVendorClassRequest.TransferBuffer,
  630. Urb->UrbControlVendorClassRequest.TransferBufferMDL,
  631. Urb->UrbControlVendorClassRequest.TransferFlags,
  632. Urb->UrbControlVendorClassRequest.RequestTypeReservedBits,
  633. Urb->UrbControlVendorClassRequest.Request,
  634. Urb->UrbControlVendorClassRequest.Value,
  635. Urb->UrbControlVendorClassRequest.Index));
  636. }
  637. Urb = Urb->UrbControlVendorClassRequest.UrbLink;
  638. again = TRUE;
  639. break;
  640. case URB_FUNCTION_CLASS_OTHER:
  641. if (PrintMask & VA_PRINT_FEATURE) {
  642. HEADER(Urb);
  643. VA_KdPrint (("Class Other Req: len (%x) Buffer (%x) MDL (%x) "
  644. "Flags (%x) RequestTypeBits (%x) "
  645. "Request (%x) Value (%x) Index (%x)\n",
  646. Urb->UrbControlVendorClassRequest.TransferBufferLength,
  647. Urb->UrbControlVendorClassRequest.TransferBuffer,
  648. Urb->UrbControlVendorClassRequest.TransferBufferMDL,
  649. Urb->UrbControlVendorClassRequest.TransferFlags,
  650. Urb->UrbControlVendorClassRequest.RequestTypeReservedBits,
  651. Urb->UrbControlVendorClassRequest.Request,
  652. Urb->UrbControlVendorClassRequest.Value,
  653. Urb->UrbControlVendorClassRequest.Index));
  654. }
  655. Urb = Urb->UrbControlVendorClassRequest.UrbLink;
  656. again = TRUE;
  657. break;
  658. case URB_FUNCTION_GET_CONFIGURATION:
  659. if (PrintMask & VA_PRINT_COMMAND) {
  660. HEADER(Urb);
  661. VA_KdPrint (("Get Configuration: len (%x) Buffer (%x) MDL (%x) "
  662. "\n",
  663. Urb->UrbControlGetConfigurationRequest.TransferBufferLength,
  664. Urb->UrbControlGetConfigurationRequest.TransferBuffer,
  665. Urb->UrbControlGetConfigurationRequest.TransferBufferMDL));
  666. }
  667. Urb = Urb->UrbControlGetConfigurationRequest.UrbLink;
  668. again = TRUE;
  669. break;
  670. case URB_FUNCTION_GET_INTERFACE:
  671. if (PrintMask & VA_PRINT_COMMAND) {
  672. HEADER(Urb);
  673. VA_KdPrint (("Get Interface: len (%x) Buffer (%x) MDL (%x) "
  674. "\n",
  675. Urb->UrbControlGetInterfaceRequest.TransferBufferLength,
  676. Urb->UrbControlGetInterfaceRequest.TransferBuffer,
  677. Urb->UrbControlGetInterfaceRequest.TransferBufferMDL));
  678. }
  679. Urb = Urb->UrbControlGetInterfaceRequest.UrbLink;
  680. again = TRUE;
  681. break;
  682. default:
  683. VA_KdPrint (("WARNING\n", Urb));
  684. VA_KdPrint (("WARNING Unkown Urb (%x)\n", Urb));
  685. VA_KdPrint (("WARNING\n", Urb));
  686. }
  687. }
  688. }