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.

618 lines
18 KiB

  1. /*++
  2. Copyright (c) 1999 Microsoft Corporation
  3. Module Name:
  4. urb.c
  5. Abstract:
  6. WinDbg Extension Api
  7. implements !_urb
  8. Author:
  9. jd
  10. Environment:
  11. User Mode.
  12. Revision History:
  13. --*/
  14. #include "precomp.h"
  15. #include "usbhcdkd.h"
  16. PUCHAR
  17. UsbdFunctionName(
  18. USHORT Function
  19. )
  20. {
  21. switch(Function) {
  22. case URB_FUNCTION_SELECT_CONFIGURATION:
  23. return "URB_FUNCTION_SELECT_CONFIGURATION";
  24. case URB_FUNCTION_SELECT_INTERFACE:
  25. return "URB_FUNCTION_SELECT_INTERFACE";
  26. case URB_FUNCTION_ABORT_PIPE:
  27. return "URB_FUNCTION_ABORT_PIPE";
  28. case URB_FUNCTION_TAKE_FRAME_LENGTH_CONTROL:
  29. return "URB_FUNCTION_TAKE_FRAME_LENGTH_CONTROL";
  30. case URB_FUNCTION_RELEASE_FRAME_LENGTH_CONTROL:
  31. return "URB_FUNCTION_RELEASE_FRAME_LENGTH_CONTROL";
  32. case URB_FUNCTION_GET_FRAME_LENGTH:
  33. return "URB_FUNCTION_GET_FRAME_LENGTH";
  34. case URB_FUNCTION_SET_FRAME_LENGTH:
  35. return "URB_FUNCTION_SET_FRAME_LENGTH";
  36. case URB_FUNCTION_GET_CURRENT_FRAME_NUMBER :
  37. return "URB_FUNCTION_GET_CURRENT_FRAME_NUMBER";
  38. case URB_FUNCTION_CONTROL_TRANSFER:
  39. return "URB_FUNCTION_CONTROL_TRANSFER";
  40. case URB_FUNCTION_BULK_OR_INTERRUPT_TRANSFER:
  41. return "URB_FUNCTION_BULK_OR_INTERRUPT_TRANSFER";
  42. case URB_FUNCTION_ISOCH_TRANSFER:
  43. return "URB_FUNCTION_ISOCH_TRANSFER";
  44. case URB_FUNCTION_SYNC_RESET_PIPE_AND_CLEAR_STALL:
  45. return "URB_FUNCTION_SYNC_RESET_PIPE_AND_CLEAR_STALL";
  46. case URB_FUNCTION_GET_DESCRIPTOR_FROM_DEVICE:
  47. return "URB_FUNCTION_GET_DESCRIPTOR_FROM_DEVICE";
  48. case URB_FUNCTION_GET_DESCRIPTOR_FROM_ENDPOINT:
  49. return "URB_FUNCTION_GET_DESCRIPTOR_FROM_ENDPOINT";
  50. case URB_FUNCTION_GET_DESCRIPTOR_FROM_INTERFACE:
  51. return "URB_FUNCTION_GET_DESCRIPTOR_FROM_INTERFACE";
  52. case URB_FUNCTION_SET_DESCRIPTOR_TO_DEVICE:
  53. return "URB_FUNCTION_SET_DESCRIPTOR_TO_DEVICE";
  54. case URB_FUNCTION_SET_DESCRIPTOR_TO_ENDPOINT:
  55. return "URB_FUNCTION_SET_DESCRIPTOR_TO_ENDPOINT";
  56. case URB_FUNCTION_SET_DESCRIPTOR_TO_INTERFACE:
  57. return "URB_FUNCTION_SET_DESCRIPTOR_TO_INTERFACE";
  58. case URB_FUNCTION_SET_FEATURE_TO_DEVICE:
  59. return "URB_FUNCTION_SET_FEATURE_TO_DEVICE";
  60. case URB_FUNCTION_SET_FEATURE_TO_INTERFACE:
  61. return "URB_FUNCTION_SET_FEATURE_TO_INTERFACE";
  62. case URB_FUNCTION_SET_FEATURE_TO_ENDPOINT:
  63. return "URB_FUNCTION_SET_FEATURE_TO_ENDPOINT";
  64. case URB_FUNCTION_SET_FEATURE_TO_OTHER:
  65. return "URB_FUNCTION_SET_FEATURE_TO_OTHER";
  66. case URB_FUNCTION_CLEAR_FEATURE_TO_DEVICE:
  67. return "URB_FUNCTION_CLEAR_FEATURE_TO_DEVICE";
  68. case URB_FUNCTION_CLEAR_FEATURE_TO_INTERFACE:
  69. return "URB_FUNCTION_CLEAR_FEATURE_TO_INTERFACE";
  70. case URB_FUNCTION_CLEAR_FEATURE_TO_ENDPOINT:
  71. return "URB_FUNCTION_CLEAR_FEATURE_TO_ENDPOINT";
  72. case URB_FUNCTION_CLEAR_FEATURE_TO_OTHER:
  73. return "URB_FUNCTION_CLEAR_FEATURE_TO_OTHER";
  74. case URB_FUNCTION_GET_STATUS_FROM_DEVICE:
  75. return "URB_FUNCTION_GET_STATUS_FROM_DEVICE";
  76. case URB_FUNCTION_GET_STATUS_FROM_INTERFACE:
  77. return "URB_FUNCTION_GET_STATUS_FROM_INTERFACE";
  78. case URB_FUNCTION_GET_STATUS_FROM_ENDPOINT:
  79. return "URB_FUNCTION_GET_STATUS_FROM_ENDPOINT";
  80. case URB_FUNCTION_GET_STATUS_FROM_OTHER:
  81. return "URB_FUNCTION_GET_STATUS_FROM_OTHER";
  82. case URB_FUNCTION_VENDOR_DEVICE:
  83. return "URB_FUNCTION_VENDOR_DEVICE";
  84. case URB_FUNCTION_VENDOR_INTERFACE:
  85. return "URB_FUNCTION_VENDOR_INTERFACE";
  86. case URB_FUNCTION_VENDOR_ENDPOINT:
  87. return "URB_FUNCTION_VENDOR_ENDPOINT";
  88. case URB_FUNCTION_VENDOR_OTHER:
  89. return "URB_FUNCTION_VENDOR_OTHER";
  90. case URB_FUNCTION_CLASS_DEVICE:
  91. return "URB_FUNCTION_CLASS_DEVICE";
  92. case URB_FUNCTION_CLASS_INTERFACE:
  93. return "URB_FUNCTION_CLASS_INTERFACE";
  94. case URB_FUNCTION_CLASS_ENDPOINT:
  95. return "URB_FUNCTION_CLASS_ENDPOINT";
  96. case URB_FUNCTION_CLASS_OTHER:
  97. return "URB_FUNCTION_CLASS_OTHER";
  98. case URB_FUNCTION_GET_CONFIGURATION:
  99. return "URB_FUNCTION_GET_CONFIGURATION";
  100. case URB_FUNCTION_GET_INTERFACE:
  101. return "URB_FUNCTION_GET_INTERFACE";
  102. }
  103. return "???";
  104. }
  105. VOID
  106. DumpPipeRequest(
  107. MEMLOC MemLoc
  108. )
  109. {
  110. UCHAR cs[] = "_URB_PIPE_REQUEST";
  111. STRUC_ENTRY ap[] = {
  112. "PipeHandle", FT_PTR,
  113. "Reserved", FT_ULONG,
  114. };
  115. UsbDumpStruc(MemLoc, cs,
  116. &ap[0], sizeof(ap)/sizeof(STRUC_ENTRY));
  117. }
  118. VOID
  119. DumpControlTransfer(
  120. MEMLOC MemLoc
  121. )
  122. {
  123. UCHAR cs[] = "_TRANSFER_URB";
  124. ULONG f;
  125. PUSB_DEFAULT_PIPE_SETUP_PACKET setup;
  126. USB_DEFAULT_PIPE_SETUP_PACKET tmp;
  127. PUCHAR s;
  128. PUCHAR Dir_String[2] = {"HOST_TO_DEVICE",
  129. "DEVICE_TO_HOST"};
  130. PUCHAR Type_String[3] = {"STANDARD",
  131. "CLASS",
  132. "VENDOR"};
  133. PUCHAR Recipient_String[3] = {"DEVICE",
  134. "INTERFACE",
  135. "ENDPOINT"};
  136. #define MAX_BREQ 13
  137. PUCHAR bReq_String[MAX_BREQ] = {
  138. "USB_REQUEST_GET_STATUS", // 0
  139. "USB_REQUEST_CLEAR_FEATURE", // 1
  140. "", // 2
  141. "USB_REQUEST_SET_FEATURE", // 3
  142. "", // 4
  143. "USB_REQUEST_SET_ADDRESS", // 5
  144. "USB_REQUEST_GET_DESCRIPTOR", // 6
  145. "USB_REQUEST_SET_DESCRIPTOR", // 7
  146. "USB_REQUEST_GET_CONFIGURATION",// 8
  147. "USB_REQUEST_SET_CONFIGURATION",// 9
  148. "USB_REQUEST_GET_INTERFACE", // 10
  149. "USB_REQUEST_SET_INTERFACE", // 11
  150. "USB_REQUEST_SYNC_FRAME" // 12
  151. };
  152. FLAG_TABLE xferFlags[] = {
  153. "USBD_TRANSFER_DIRECTION_IN", USBD_TRANSFER_DIRECTION_IN,
  154. "USBD_SHORT_TRANSFER_OK", USBD_SHORT_TRANSFER_OK,
  155. "USBD_START_ISO_TRANSFER_ASAP", USBD_START_ISO_TRANSFER_ASAP
  156. };
  157. STRUC_ENTRY t[] = {
  158. "UsbdPipeHandle", FT_PTR,
  159. "TransferBufferLength", FT_ULONG,
  160. "TransferBuffer", FT_PTR,
  161. "TransferBufferMDL", FT_PTR,
  162. "ResevedMBNull", FT_PTR,
  163. "pd.HcdTransferContext", FT_PTR,
  164. };
  165. dprintf("*CONTROL TRANSFER\n");
  166. f = UsbReadFieldUlong(MemLoc, cs, "TransferFlags");
  167. dprintf("TransferFlags: %08.8x\n", f);
  168. UsbDumpFlags(f, xferFlags,
  169. sizeof(xferFlags)/sizeof(FLAG_TABLE));
  170. UsbDumpStruc(MemLoc, cs,
  171. &t[0], sizeof(t)/sizeof(STRUC_ENTRY));
  172. {
  173. ULONG64 addr;
  174. ULONG cb;
  175. addr = MemLoc + UsbFieldOffset(cs,
  176. "u.SetupPacket");
  177. ReadMemory(addr,
  178. &tmp,
  179. sizeof(tmp),
  180. &cb);
  181. }
  182. setup = (PUSB_DEFAULT_PIPE_SETUP_PACKET) &tmp;
  183. s = (PUCHAR) setup;
  184. dprintf(
  185. "<SetupPacket> %02.2x %02.2x %02.2x %02.2x %02.2x %02.2x %02.2x %02.2x\n",
  186. s[0], s[1], s[2], s[3], s[4], s[5], s[6], s[7]);
  187. dprintf("bmRequestType (%02.2x)\n", setup->bmRequestType.B);
  188. dprintf("\tRecipient %d - %s\n", setup->bmRequestType.Recipient,
  189. Recipient_String[setup->bmRequestType.Recipient]);
  190. dprintf("\tType %d - %s\n", setup->bmRequestType.Type,
  191. Type_String[setup->bmRequestType.Type]);
  192. dprintf("\tDir %d - %s\n", setup->bmRequestType.Dir,
  193. Dir_String[setup->bmRequestType.Dir]);
  194. dprintf("\tReserved %d\n", setup->bmRequestType.Reserved);
  195. dprintf("bRequest %d ", setup->bRequest);
  196. if (setup->bmRequestType.Type == 0 && setup->bRequest < MAX_BREQ) {
  197. dprintf("%s\n", bReq_String[setup->bRequest]);
  198. } else {
  199. dprintf("\n");
  200. }
  201. dprintf("wValue 0x%04.4x (LowByte %02.2x HiByte %02.2x)\n", setup->wValue.W,
  202. setup->wValue.LowByte, setup->wValue.HiByte);
  203. dprintf("wIndex 0x%04.4x\n", setup->wIndex);
  204. dprintf("wLength 0x%04.4x\n", setup->wLength);
  205. }
  206. VOID
  207. DumpAsyncTransfer(
  208. MEMLOC MemLoc
  209. )
  210. {
  211. ULONG flags;
  212. UCHAR cs[] = "_TRANSFER_URB";
  213. STRUC_ENTRY t[] = {
  214. "UsbdPipeHandle", FT_PTR,
  215. "TransferBufferLength", FT_ULONG,
  216. "TransferBuffer", FT_PTR,
  217. "TransferBufferMDL", FT_PTR,
  218. "ReservedMBNull", FT_PTR,
  219. "pd.HcdTransferContext", FT_PTR
  220. };
  221. FLAG_TABLE xferFlags[] = {
  222. "USBD_TRANSFER_DIRECTION_IN", USBD_TRANSFER_DIRECTION_IN,
  223. "USBD_SHORT_TRANSFER_OK", USBD_SHORT_TRANSFER_OK,
  224. "USBD_START_ISO_TRANSFER_ASAP", USBD_START_ISO_TRANSFER_ASAP
  225. };
  226. dprintf("*ASYNC TRANSFER\n");
  227. flags = UsbReadFieldUlong(MemLoc, cs, "TransferFlags");
  228. dprintf("TransferFlags: %08.8x\n", flags);
  229. UsbDumpFlags(flags, xferFlags,
  230. sizeof(xferFlags)/sizeof(FLAG_TABLE));
  231. UsbDumpStruc(MemLoc, cs,
  232. &t[0], sizeof(t)/sizeof(STRUC_ENTRY));
  233. }
  234. VOID
  235. DumpIsochTransfer(
  236. MEMLOC MemLoc
  237. )
  238. {
  239. ULONG flags;
  240. UCHAR s[64];
  241. UCHAR cs[] = "_TRANSFER_URB";
  242. STRUC_ENTRY t[] = {
  243. "UsbdPipeHandle", FT_PTR,
  244. "TransferBufferLength", FT_ULONG,
  245. "TransferBuffer", FT_PTR,
  246. "TransferBufferMDL", FT_PTR,
  247. "ReservedMBNull", FT_PTR,
  248. "pd.HcdTransferContext", FT_PTR,
  249. "u.Isoch.StartFrame", FT_ULONG,
  250. "u.Isoch.NumberOfPackets", FT_ULONG,
  251. "u.Isoch.ErrorCount", FT_ULONG
  252. };
  253. FLAG_TABLE xferFlags[] = {
  254. "USBD_TRANSFER_DIRECTION_IN", USBD_TRANSFER_DIRECTION_IN,
  255. "USBD_SHORT_TRANSFER_OK", USBD_SHORT_TRANSFER_OK,
  256. "USBD_START_ISO_TRANSFER_ASAP", USBD_START_ISO_TRANSFER_ASAP
  257. };
  258. ULONG p, i;
  259. dprintf("*ISOCH TRANSFER\n");
  260. flags = UsbReadFieldUlong(MemLoc, cs, "TransferFlags");
  261. dprintf("TransferFlags: %08.8x\n", flags);
  262. UsbDumpFlags(flags, xferFlags,
  263. sizeof(xferFlags)/sizeof(FLAG_TABLE));
  264. UsbDumpStruc(MemLoc, cs,
  265. &t[0], sizeof(t)/sizeof(STRUC_ENTRY));
  266. // attempt to dump the packet struc
  267. p = UsbReadFieldUlong(MemLoc, cs, "u.Isoch.NumberOfPackets");
  268. for (i=0; i<p; i++) {
  269. USBD_ISO_PACKET_DESCRIPTOR pd;
  270. MEMLOC t;
  271. ULONG cb;
  272. sprintf(s, "u.Isoch.IsoPacket[%d]", i);
  273. t = MemLoc + UsbFieldOffset(cs, s);
  274. ReadMemory(t,
  275. &pd,
  276. sizeof(pd),
  277. &cb);
  278. dprintf("Packet[%d]: Offset %08.8x Length %08.8x UsbdStatus %08.8x\n", i,
  279. pd.Offset, pd.Length, pd.Status);
  280. }
  281. }
  282. VOID
  283. DumpPipeInfo(
  284. MEMLOC MemLoc
  285. )
  286. {
  287. ULONG i;
  288. UCHAR cs[] = "_USBD_PIPE_INFORMATION";
  289. STRUC_ENTRY ps[] = {
  290. "MaximumPacketSize", FT_USHORT,
  291. "EndpointAddress", FT_UCHAR,
  292. "Interval", FT_UCHAR,
  293. "PipeType", FT_ULONG,
  294. "PipeHandle", FT_PTR,
  295. "MaximumTransferSize", FT_ULONG,
  296. "PipeFlags", FT_ULONG,
  297. };
  298. PrintfMemLoc("Pipe: ", MemLoc, "\n");
  299. UsbDumpStruc(MemLoc, cs,
  300. &ps[0], sizeof(ps)/sizeof(STRUC_ENTRY));
  301. #if 0
  302. dprintf("\t\tPipeType: ");
  303. switch(PipeInfo->PipeType) {
  304. case UsbdPipeTypeControl:
  305. dprintf("UsbdPipeTypeControl\n");
  306. break;
  307. case UsbdPipeTypeIsochronous:
  308. dprintf("UsbdPipeTypeIsochronous\n");
  309. break;
  310. case UsbdPipeTypeBulk:
  311. dprintf("UsbdPipeTypeBulk\n");
  312. break;
  313. case UsbdPipeTypeInterrupt:
  314. dprintf("UsbdPipeTypeInterrupt\n");
  315. break;
  316. }
  317. #endif
  318. }
  319. VOID
  320. DumpInterfaceInfo(
  321. MEMLOC MemLoc
  322. )
  323. {
  324. ULONG i, np;
  325. UCHAR cs[] = "_USBD_INTERFACE_INFORMATION";
  326. STRUC_ENTRY is[] = {
  327. "Length", FT_USHORT,
  328. "InterfaceNumber", FT_UCHAR,
  329. "AlternateSetting", FT_UCHAR,
  330. "Class", FT_UCHAR,
  331. "SubClass", FT_UCHAR,
  332. "Protocol", FT_UCHAR,
  333. "Reserved", FT_UCHAR,
  334. "InterfaceHandle", FT_PTR,
  335. "NumberOfPipes", FT_ULONG,
  336. };
  337. dprintf("Interface -----------------\n");
  338. UsbDumpStruc(MemLoc, cs,
  339. &is[0], sizeof(is)/sizeof(STRUC_ENTRY));
  340. np = UsbReadFieldUlong(MemLoc, cs, "NumberOfPipes");
  341. for (i=0; i < np; i++) {
  342. UCHAR s[80];
  343. MEMLOC p;
  344. dprintf("Pipe[%02.2d] -----------------\n", i);
  345. sprintf(s, "Pipes[%d]", i);
  346. p= MemLoc + UsbFieldOffset(cs, s);
  347. DumpPipeInfo(p);
  348. }
  349. }
  350. VOID
  351. DumpSelectConfiguration(
  352. MEMLOC MemLoc,
  353. ULONG UrbLength
  354. )
  355. {
  356. UCHAR cs[] = "_URB_SELECT_CONFIGURATION";
  357. UCHAR is[] = "_USBD_INTERFACE_INFORMATION";
  358. STRUC_ENTRY sc[] = {
  359. "ConfigurationHandle", FT_PTR,
  360. "ConfigurationDescriptor", FT_PTR,
  361. };
  362. MEMLOC start, end;
  363. ULONG i = 0;
  364. dprintf("*SELECT_CONFIG\n");
  365. UsbDumpStruc(MemLoc, cs,
  366. &sc[0], sizeof(sc)/sizeof(STRUC_ENTRY));
  367. start = MemLoc;
  368. end = start+UrbLength;
  369. start += UsbFieldOffset(cs, "Interface");
  370. while (start < end && i < 8) {
  371. ULONG length;
  372. length = UsbReadFieldUshort(start, is, "Length");
  373. DumpInterfaceInfo(start);
  374. start+=length;
  375. i++;
  376. }
  377. }
  378. VOID
  379. DumpSelectInterface(
  380. MEMLOC MemLoc,
  381. ULONG UrbLength
  382. )
  383. {
  384. UCHAR cs[] = "_URB_SELECT_INTERFACE";
  385. UCHAR is[] = "_USBD_INTERFACE_INFORMATION";
  386. STRUC_ENTRY sc[] = {
  387. "ConfigurationHandle", FT_PTR
  388. };
  389. MEMLOC start, end;
  390. ULONG i = 0;
  391. dprintf("*SELECT_INTERFACE\n");
  392. UsbDumpStruc(MemLoc, cs,
  393. &sc[0], sizeof(sc)/sizeof(STRUC_ENTRY));
  394. start = MemLoc;
  395. end = start+UrbLength;
  396. start += UsbFieldOffset(cs, "Interface");
  397. while (start < end && i < 8) {
  398. ULONG length;
  399. length = UsbReadFieldUshort(start, is, "Length");
  400. DumpInterfaceInfo(start);
  401. start+=length;
  402. i++;
  403. }
  404. }
  405. VOID
  406. DumpUrb(
  407. MEMLOC MemLoc
  408. )
  409. {
  410. UCHAR cs[] = "_URB_HEADER";
  411. ULONG f;
  412. USHORT func;
  413. STRUC_ENTRY urbHeader[] = {
  414. "Length", FT_USHORT,
  415. "Status", FT_ULONG,
  416. "UsbdDeviceHandle", FT_PTR,
  417. };
  418. FLAG_TABLE usbdFlags[] = {
  419. "USBPORT_REQUEST_IS_TRANSFER", USBPORT_REQUEST_IS_TRANSFER,
  420. "USBPORT_REQUEST_MDL_ALLOCATED", USBPORT_REQUEST_MDL_ALLOCATED,
  421. "USBPORT_REQUEST_USES_DEFAULT_PIPE", USBPORT_REQUEST_USES_DEFAULT_PIPE,
  422. "USBPORT_REQUEST_NO_DATA_PHASE", USBPORT_REQUEST_NO_DATA_PHASE,
  423. "USBPORT_RESET_DATA_TOGGLE", USBPORT_RESET_DATA_TOGGLE,
  424. "USBPORT_TRANSFER_ALLOCATED", USBPORT_TRANSFER_ALLOCATED
  425. };
  426. PrintfMemLoc("*URB @", MemLoc, "\n");
  427. func = UsbReadFieldUshort(MemLoc, cs, "Function");
  428. dprintf("Function: 0x%04.4x (%s)\n", func,
  429. UsbdFunctionName(func));
  430. UsbDumpStruc(MemLoc, cs,
  431. &urbHeader[0], sizeof(urbHeader)/sizeof(STRUC_ENTRY));
  432. f = UsbReadFieldUlong(MemLoc, cs, "UsbdFlags");
  433. dprintf("UsbdFlags: 0x%08.8x\n", f);
  434. UsbDumpFlags(f, usbdFlags,
  435. sizeof(usbdFlags)/sizeof(FLAG_TABLE));
  436. // dump the function specific stuff
  437. switch (func) {
  438. case URB_FUNCTION_CONTROL_TRANSFER:
  439. case URB_FUNCTION_GET_DESCRIPTOR_FROM_DEVICE:
  440. case URB_FUNCTION_GET_DESCRIPTOR_FROM_ENDPOINT:
  441. case URB_FUNCTION_GET_DESCRIPTOR_FROM_INTERFACE:
  442. case URB_FUNCTION_SET_DESCRIPTOR_TO_DEVICE:
  443. case URB_FUNCTION_SET_DESCRIPTOR_TO_ENDPOINT:
  444. case URB_FUNCTION_SET_DESCRIPTOR_TO_INTERFACE:
  445. case URB_FUNCTION_SET_FEATURE_TO_DEVICE:
  446. case URB_FUNCTION_SET_FEATURE_TO_INTERFACE:
  447. case URB_FUNCTION_SET_FEATURE_TO_ENDPOINT:
  448. case URB_FUNCTION_SET_FEATURE_TO_OTHER:
  449. case URB_FUNCTION_CLEAR_FEATURE_TO_DEVICE:
  450. case URB_FUNCTION_CLEAR_FEATURE_TO_INTERFACE:
  451. case URB_FUNCTION_CLEAR_FEATURE_TO_ENDPOINT:
  452. case URB_FUNCTION_CLEAR_FEATURE_TO_OTHER:
  453. case URB_FUNCTION_GET_STATUS_FROM_DEVICE:
  454. case URB_FUNCTION_GET_STATUS_FROM_INTERFACE:
  455. case URB_FUNCTION_GET_STATUS_FROM_ENDPOINT:
  456. case URB_FUNCTION_GET_STATUS_FROM_OTHER:
  457. case URB_FUNCTION_VENDOR_DEVICE:
  458. case URB_FUNCTION_VENDOR_INTERFACE:
  459. case URB_FUNCTION_VENDOR_ENDPOINT:
  460. case URB_FUNCTION_VENDOR_OTHER:
  461. case URB_FUNCTION_CLASS_DEVICE:
  462. case URB_FUNCTION_CLASS_INTERFACE:
  463. case URB_FUNCTION_CLASS_ENDPOINT:
  464. case URB_FUNCTION_CLASS_OTHER:
  465. case URB_FUNCTION_GET_CONFIGURATION:
  466. case URB_FUNCTION_GET_INTERFACE:
  467. DumpControlTransfer(MemLoc);
  468. break;
  469. case URB_FUNCTION_BULK_OR_INTERRUPT_TRANSFER:
  470. DumpAsyncTransfer(MemLoc);
  471. break;
  472. // case URB_FUNCTION_SELECT_INTERFACE:
  473. // DumpSelectInterface((PURB) rawUrb);
  474. // break;
  475. case URB_FUNCTION_SELECT_INTERFACE:
  476. DumpSelectInterface(MemLoc, UsbReadFieldUshort(MemLoc, cs, "Length"));
  477. break;
  478. case URB_FUNCTION_SELECT_CONFIGURATION:
  479. DumpSelectConfiguration(MemLoc, UsbReadFieldUshort(MemLoc, cs, "Length"));
  480. break;
  481. case URB_FUNCTION_ISOCH_TRANSFER:
  482. DumpIsochTransfer(MemLoc);
  483. break;
  484. case URB_FUNCTION_SYNC_RESET_PIPE_AND_CLEAR_STALL:
  485. DumpPipeRequest(MemLoc);
  486. break;
  487. case URB_FUNCTION_ABORT_PIPE:
  488. DumpPipeRequest(MemLoc);
  489. break;
  490. default:
  491. dprintf ("Don't know how to dump\n");
  492. }
  493. }
  494. DECLARE_API( _urb )
  495. /*++
  496. Routine Description:
  497. dumps the extension
  498. Arguments:
  499. args - Address flags
  500. Return Value:
  501. None
  502. --*/
  503. {
  504. MEMLOC addr;
  505. // fetch the list head
  506. addr = GetExpression(args);
  507. DumpUrb (addr);
  508. return S_OK;
  509. }