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.

903 lines
22 KiB

  1. /*++
  2. Copyright (c) 1999 Microsoft Corporation
  3. Module Name:
  4. usbohci.c
  5. Abstract:
  6. WinDbg Extension Api
  7. implements !_ehcitd
  8. !_ehciqh
  9. !_ehciep
  10. Author:
  11. jd
  12. Environment:
  13. User Mode.
  14. Revision History:
  15. --*/
  16. #include "precomp.h"
  17. #include "usb.h"
  18. #include "usbhcdi.h"
  19. #include "..\miniport\usbehci\ehci.h"
  20. #include "..\miniport\usbehci\usbehci.h"
  21. #include "usbhcdkd.h"
  22. VOID
  23. DumpEHCI_qTD(
  24. PHW_QUEUE_ELEMENT_TD qTd
  25. )
  26. {
  27. ULONG i;
  28. dprintf("\t qTD\n");
  29. dprintf("\t Next_qTD: %08.8x\n", qTd->Next_qTD);
  30. dprintf("\t AltNext_qTD: %08.8x\n", qTd->AltNext_qTD);
  31. dprintf("\t Token: 0x%08.8x\n", qTd->Token.ul);
  32. dprintf("\t\t PingState: 0x%x\n", qTd->Token.PingState);
  33. dprintf("\t\t SplitXstate: 0x%x\n", qTd->Token.SplitXstate);
  34. dprintf("\t\t MissedMicroFrame: 0x%x\n", qTd->Token.MissedMicroFrame);
  35. dprintf("\t\t XactErr: 0x%x\n", qTd->Token.XactErr);
  36. dprintf("\t\t BabbleDetected: 0x%x\n", qTd->Token.BabbleDetected);
  37. dprintf("\t\t DataBufferError: 0x%x\n", qTd->Token.DataBufferError);
  38. dprintf("\t\t Halted: 0x%x\n", qTd->Token.Halted);
  39. dprintf("\t\t Active: 0x%x\n", qTd->Token.Active);
  40. dprintf("\t\t Pid: 0x%x - ", qTd->Token.Pid);
  41. switch(qTd->Token.Pid) {
  42. case HcTOK_Out:
  43. dprintf("HcTOK_Out\n");
  44. break;
  45. case HcTOK_In:
  46. dprintf("HcTOK_In\n");
  47. break;
  48. case HcTOK_Setup:
  49. dprintf("HcTOK_Setup\n");
  50. break;
  51. case HcTOK_Reserved:
  52. dprintf("HcTOK_Reserved\n");
  53. break;
  54. }
  55. dprintf("\t\t ErrorCounter: 0x%x\n", qTd->Token.ErrorCounter);
  56. dprintf("\t\t C_Page: 0x%x\n", qTd->Token.C_Page);
  57. dprintf("\t\t InterruptOnComplete: 0x%x\n", qTd->Token.InterruptOnComplete);
  58. dprintf("\t\t BytesToTransfer: 0x%x\n", qTd->Token.BytesToTransfer);
  59. dprintf("\t\t DataToggle: 0x%x\n", qTd->Token.DataToggle);
  60. for (i=0; i<5; i++) {
  61. dprintf("\t BufferPage[%d]: 0x %05.5x-%03.3x %08.8x\n", i,
  62. qTd->BufferPage[i].BufferPointer,
  63. qTd->BufferPage[i].CurrentOffset,
  64. qTd->BufferPage[i].ul);
  65. }
  66. }
  67. VOID
  68. DumpEHCI_Td(
  69. ULONG MemLoc
  70. )
  71. {
  72. HCD_TRANSFER_DESCRIPTOR td;
  73. ULONG result;
  74. ULONG i;
  75. if (!ReadMemory (MemLoc, &td, sizeof(td), &result)) {
  76. BadMemLoc(MemLoc);
  77. return;
  78. }
  79. if (td.Sig != SIG_HCD_TD) {
  80. dprintf("%08.8x is not a TD\n", MemLoc);
  81. }
  82. dprintf("*USBEHCI TD %08.8x\n", MemLoc);
  83. Sig(td.Sig, "");
  84. DumpEHCI_qTD(&td.HwTD);
  85. dprintf("Packet:");
  86. for (i=0; i<8; i++) {
  87. dprintf("%02.2x ", td.Packet[i]);
  88. }
  89. dprintf("\n");
  90. dprintf("PhysicalAddress: %08.8x\n",td.PhysicalAddress);
  91. dprintf("EndpointData: %08.8x\n",td.EndpointData);
  92. dprintf("TransferLength : %08.8x\n", td.TransferLength);
  93. dprintf("TransferContext: %08.8x\n",td.TransferContext);
  94. dprintf("Flags: %08.8x\n",td.Flags);
  95. if (td.Flags & TD_FLAG_BUSY) {
  96. dprintf("\tTD_FLAG_BUSY\n");
  97. }
  98. if (td.Flags & TD_FLAG_XFER) {
  99. dprintf("\tTD_FLAG_XFER\n");
  100. }
  101. if (td.Flags & TD_FLAG_DONE) {
  102. dprintf("\tTD_FLAG_DONE\n");
  103. }
  104. if (td.Flags & TD_FLAG_SKIP) {
  105. dprintf("\tTD_FLAG_SKIP\n");
  106. }
  107. if (td.Flags & TD_FLAG_DUMMY) {
  108. dprintf("\tTD_FLAG_DUMMY\n");
  109. }
  110. dprintf("NextHcdTD: %08.8x\n",td.NextHcdTD);
  111. dprintf("AltNextHcdTD: %08.8x\n",td.AltNextHcdTD);
  112. }
  113. VOID
  114. DumpEHCI_SiTd(
  115. ULONG MemLoc
  116. )
  117. {
  118. HCD_SI_TRANSFER_DESCRIPTOR td;
  119. ULONG result;
  120. ULONG i;
  121. if (!ReadMemory (MemLoc, &td, sizeof(td), &result)) {
  122. BadMemLoc(MemLoc);
  123. return;
  124. }
  125. if (td.Sig != SIG_HCD_SITD) {
  126. dprintf("%08.8x is not a SiTD\n", MemLoc);
  127. }
  128. dprintf("*USBEHCI SiTD %08.8x\n", MemLoc);
  129. Sig(td.Sig, "");
  130. dprintf("Packet: %08.8x\n",td.Packet);
  131. dprintf("PhysicalAddress: %08.8x\n",td.PhysicalAddress);
  132. dprintf("NextLink: %08.8x\n",td.HwTD.NextLink.HwAddress);
  133. dprintf("Caps: %08.8x\n",td.HwTD.Caps.ul);
  134. dprintf("Control: %08.8x\n",td.HwTD.Control.ul);
  135. dprintf("State: %08.8x\n",td.HwTD.State.ul);
  136. dprintf("BufferPointer0: %08.8x\n",td.HwTD.BufferPointer0.ul);
  137. dprintf("BufferPointer1: %08.8x\n",td.HwTD.BufferPointer1.ul);
  138. dprintf("BackPointer: %08.8x\n",td.HwTD.BackPointer.HwAddress);
  139. }
  140. VOID
  141. DumpEHCI_iTd(
  142. MEMLOC MemLoc
  143. )
  144. {
  145. HCD_HSISO_TRANSFER_DESCRIPTOR td;
  146. ULONG i, cb;
  147. ULONG flags;
  148. UCHAR s[64];
  149. UCHAR cs[] = "usbehci!_HCD_HSISO_TRANSFER_DESCRIPTOR";
  150. STRUC_ENTRY t[] = {
  151. "Sig", FT_SIG,
  152. "PhysicalAddress", FT_ULONG,
  153. "HostFrame", FT_ULONG,
  154. "FirstPacket.Pointer", FT_PTR,
  155. "Transfer.Pointer", FT_PTR,
  156. "ReservedMBNull", FT_PTR,
  157. };
  158. ReadMemory(MemLoc,
  159. &td,
  160. sizeof(td),
  161. &cb);
  162. if (td.Sig != SIG_HCD_ITD) {
  163. dprintf("not a iTD\n");
  164. }
  165. PrintfMemLoc("*USBEHCI iTD ", MemLoc, "\n");
  166. UsbDumpStruc(MemLoc, cs,
  167. &t[0], sizeof(t)/sizeof(STRUC_ENTRY));
  168. dprintf("\t NextLink %08.8x\n", td.HwTD.NextLink.HwAddress);
  169. dprintf("\t (%08.8x)BufferPointer0 %08.8x\n", td.HwTD.BufferPointer0.ul,
  170. td.HwTD.BufferPointer0.BufferPointer);
  171. dprintf("\t\t Dev x%x Ept x%x\n", td.HwTD.BufferPointer0.DeviceAddress,
  172. td.HwTD.BufferPointer0.EndpointNumber);
  173. dprintf("\t (%08.8x)BufferPointer1 %08.8x\n", td.HwTD.BufferPointer1.ul,
  174. td.HwTD.BufferPointer1.BufferPointer);
  175. dprintf("\t\t MaxPacketSize x%x\n", td.HwTD.BufferPointer1.MaxPacketSize);
  176. dprintf("\t (%08.8x)BufferPointer2 %08.8x\n", td.HwTD.BufferPointer2.ul,
  177. td.HwTD.BufferPointer2.BufferPointer);
  178. dprintf("\t\t Multi x%x\n", td.HwTD.BufferPointer2.Multi);
  179. dprintf("\t (%08.8x)BufferPointer3 %08.8x\n", td.HwTD.BufferPointer3.ul,
  180. td.HwTD.BufferPointer3.BufferPointer);
  181. dprintf("\t (%08.8x)BufferPointer4 %08.8x\n", td.HwTD.BufferPointer4.ul,
  182. td.HwTD.BufferPointer4.BufferPointer);
  183. dprintf("\t (%08.8x)BufferPointer5 %08.8x\n", td.HwTD.BufferPointer5.ul,
  184. td.HwTD.BufferPointer5.BufferPointer);
  185. dprintf("\t (%08.8x)BufferPointer6 %08.8x\n", td.HwTD.BufferPointer6.ul,
  186. td.HwTD.BufferPointer6.BufferPointer);
  187. for (i=0; i<8; i++) {
  188. dprintf("\t Transaction[%d](%08.8x)\n",
  189. i, td.HwTD.Transaction[i].ul);
  190. dprintf("\t Transaction[%d].Offset %08.8x\n",
  191. i, td.HwTD.Transaction[i].Offset);
  192. dprintf("\t Transaction[%d].PageSelect %d\n",
  193. i, td.HwTD.Transaction[i].PageSelect);
  194. dprintf("\t Transaction[%d].Length %08.8x\n",
  195. i, td.HwTD.Transaction[i].Length);
  196. dprintf("\t\t active %d ioc %d - xerr:%d babble:%d dataerr:%d\n",
  197. td.HwTD.Transaction[i].Active,
  198. td.HwTD.Transaction[i].InterruptOnComplete,
  199. td.HwTD.Transaction[i].XactError,
  200. td.HwTD.Transaction[i].BabbleDetect,
  201. td.HwTD.Transaction[i].DataBufferError
  202. );
  203. }
  204. }
  205. VOID
  206. DumpEHCI_Qh(
  207. MEMLOC MemLoc
  208. )
  209. {
  210. HCD_QUEUEHEAD_DESCRIPTOR qh;
  211. ULONG cb;
  212. FLAG_TABLE qhFlags[] = {
  213. "EHCI_QH_FLAG_IN_SCHEDULE", EHCI_QH_FLAG_IN_SCHEDULE,
  214. "EHCI_QH_FLAG_QH_REMOVED", EHCI_QH_FLAG_QH_REMOVED,
  215. "EHCI_QH_FLAG_STATIC", EHCI_QH_FLAG_STATIC,
  216. "EHCI_QH_FLAG_HIGHSPEED", EHCI_QH_FLAG_HIGHSPEED,
  217. };
  218. ReadMemory(MemLoc,
  219. &qh,
  220. sizeof(qh),
  221. &cb);
  222. if (qh.Sig != SIG_HCD_AQH &&
  223. qh.Sig != SIG_HCD_QH) {
  224. }
  225. PrintfMemLoc("*USBEHCI QH ", MemLoc, "\n");
  226. dprintf("*USBEHCI QH %08.8x\n", MemLoc);
  227. Sig(qh.Sig, "");
  228. dprintf("PhysicalAddress %08.8x\n", qh.PhysicalAddress);
  229. dprintf("Flags: %08.8x\n", qh.QhFlags);
  230. UsbDumpFlags(qh.QhFlags, qhFlags,
  231. sizeof(qhFlags)/sizeof(FLAG_TABLE));
  232. dprintf("EndpointData: %08.8x\n", qh.EndpointData);
  233. dprintf("NextQh: %08.8x\n", qh.NextQh);
  234. dprintf("PrevQh: %08.8x\n", qh.PrevQh);
  235. dprintf("PrevQh: %d\n", qh.Ordinal);
  236. dprintf("HwQH\n");
  237. dprintf("\t HwQH.HLink %08.8x\n", qh.HwQH.HLink.HwAddress);
  238. dprintf("\t HwQH.EpChars %08.8x\n", qh.HwQH.EpChars.ul);
  239. dprintf("\t\t DeviceAddress: 0x%x\n", qh.HwQH.EpChars.DeviceAddress);
  240. dprintf("\t\t EndpointNumber: 0x%x\n", qh.HwQH.EpChars.EndpointNumber);
  241. dprintf("\t\t EndpointSpeed: 0x%x", qh.HwQH.EpChars.EndpointSpeed);
  242. switch(qh.HwQH.EpChars.EndpointSpeed) {
  243. case HcEPCHAR_FullSpeed:
  244. dprintf("HcEPCHAR_FullSpeed");
  245. break;
  246. case HcEPCHAR_HighSpeed:
  247. dprintf("HcEPCHAR_HighSpeed");
  248. break;
  249. case HcEPCHAR_LowSpeed:
  250. dprintf("HcEPCHAR_LowSpeed");
  251. break;
  252. case HcEPCHAR_Reserved:
  253. dprintf("HcEPCHAR_Reserved");
  254. break;
  255. }
  256. dprintf("\n");
  257. dprintf("\t\t DataToggleControl: 0x%x\n", qh.HwQH.EpChars.DataToggleControl);
  258. dprintf("\t\t HeadOfReclimationList: 0x%x\n", qh.HwQH.EpChars.HeadOfReclimationList);
  259. dprintf("\t\t MaximumPacketLength: 0x%x - %d\n",
  260. qh.HwQH.EpChars.MaximumPacketLength, qh.HwQH.EpChars.MaximumPacketLength);
  261. dprintf("\t\t ControlEndpointFlag: %d\n", qh.HwQH.EpChars.ControlEndpointFlag);
  262. dprintf("\t\t NakReloadCount: %d\n", qh.HwQH.EpChars.NakReloadCount);
  263. dprintf("\t HwQH.EpCaps %08.8x\n", qh.HwQH.EpCaps.ul);
  264. dprintf("\t\t InterruptScheduleMask: 0x%x\n", qh.HwQH.EpCaps.InterruptScheduleMask);
  265. dprintf("\t\t SplitCompletionMask: 0x%x\n", qh.HwQH.EpCaps.SplitCompletionMask);
  266. dprintf("\t\t HubAddress: 0x%x\n", qh.HwQH.EpCaps.HubAddress);
  267. dprintf("\t\t PortNumber: 0x%x\n", qh.HwQH.EpCaps.PortNumber);
  268. dprintf("\t\t HighBWPipeMultiplier: 0x%x\n", qh.HwQH.EpCaps.HighBWPipeMultiplier);
  269. dprintf("\t HwQH.CurrentTD %08.8x\n", qh.HwQH.CurrentTD.HwAddress);
  270. dprintf("\t HwQH.Overlay\n");
  271. DumpEHCI_qTD((PHW_QUEUE_ELEMENT_TD)&qh.HwQH.Overlay);
  272. }
  273. VOID
  274. DumpEHCI_EndpointData(
  275. MEMLOC MemLoc
  276. )
  277. {
  278. UCHAR cs[] = "usbehci!_ENDPOINT_DATA";
  279. UCHAR ts[] = "usbehci!_HCD_TRANSFER_DESCRIPTOR";
  280. ULONG f, i=0;
  281. MEMLOC head, tail, m;
  282. STRUC_ENTRY t[] = {
  283. "Sig", FT_SIG,
  284. "QueueHead", FT_PTR,
  285. "PendingTransfers", FT_ULONG,
  286. "MaxPendingTransfers", FT_ULONG,
  287. "HcdTailP", FT_PTR,
  288. "HcdHeadP", FT_PTR,
  289. "StaticQH", FT_PTR,
  290. "PeriodTableEntry", FT_PTR,
  291. "TdList", FT_PTR,
  292. "SiTdList", FT_PTR,
  293. "TdCount", FT_ULONG,
  294. "PrevEndpoint", FT_PTR,
  295. "NextEndpoint", FT_PTR,
  296. "DummyTd", FT_PTR,
  297. "LastFrame", FT_ULONG,
  298. "TransferList.Flink", FT_PTR,
  299. "TransferList.Blink", FT_PTR,
  300. //"MaxErrorCount", FT_ULONG,
  301. };
  302. FLAG_TABLE epFlags[] = {
  303. "EHCI_EDFLAG_HALTED", EHCI_EDFLAG_HALTED,
  304. "EHCI_EDFLAG_NOHALT", EHCI_EDFLAG_NOHALT
  305. };
  306. PrintfMemLoc("*USBEHCI ENDPOINT_DATA ", MemLoc, "\n");
  307. UsbDumpStruc(MemLoc, cs,
  308. &t[0], sizeof(t)/sizeof(STRUC_ENTRY));
  309. f = UsbReadFieldUlong(MemLoc, cs, "Flags");
  310. dprintf("Flags: 0x%08.8x\n", f);
  311. UsbDumpFlags(f, epFlags,
  312. sizeof(epFlags)/sizeof(FLAG_TABLE));
  313. DumpEndpointParameters(MemLoc + UsbFieldOffset(cs, "Parameters"));
  314. // dump the transfers
  315. head = UsbReadFieldPtr(MemLoc, cs, "HcdHeadP");
  316. tail = UsbReadFieldPtr(MemLoc, cs, "HcdTailP");
  317. PrintfMemLoc("<HEAD> ", head, "\n");
  318. while (head != tail && i<10) {
  319. i++;
  320. dprintf("\t TD ");
  321. PrintfMemLoc("", head, " ");
  322. dprintf ("[%08.8x] ",
  323. UsbReadFieldUlong(head, ts, "PhysicalAddress"));
  324. m = UsbReadFieldPtr(head, ts, "TransferContext");
  325. PrintfMemLoc("XFER ", m, "\n");
  326. head = UsbReadFieldPtr(head, ts, "NextHcdTD");
  327. }
  328. PrintfMemLoc("<TAIL> ", tail, "\n");
  329. }
  330. VOID
  331. DumpEHCI_DumpTfer(
  332. ULONG MemLoc
  333. )
  334. {
  335. TRANSFER_CONTEXT tc;
  336. ULONG result;
  337. SIG s;
  338. if (!ReadMemory (MemLoc, &tc, sizeof(tc), &result)) {
  339. BadMemLoc(MemLoc);
  340. return;
  341. }
  342. if (tc.Sig != SIG_EHCI_TRANSFER) {
  343. dprintf("%08.8x is not TRANSFER_CONTEXT\n", MemLoc);
  344. }
  345. Sig(tc.Sig, "");
  346. dprintf("PendingTds: 0x%08.8x\n", tc.PendingTds);
  347. dprintf("TransferParameters: 0x%08.8x\n", tc.TransferParameters);
  348. dprintf("UsbdStatus: 0x%08.8x\n", tc.UsbdStatus);
  349. dprintf("BytesTransferred: 0x%08.8x\n", tc.BytesTransferred);
  350. dprintf("XactErrCounter: %d\n", tc.XactErrCounter);
  351. dprintf("EndpointData: 0x%08.8x\n", tc.EndpointData);
  352. }
  353. VOID
  354. DumpEHCI_DeviceData(
  355. MEMLOC MemLoc
  356. )
  357. {
  358. UCHAR cs[] = "usbehci!_DEVICE_DATA";
  359. ULONG f;
  360. STRUC_ENTRY t[] = {
  361. "Sig", FT_SIG,
  362. "OperationalRegisters", FT_PTR,
  363. "CapabilitiesRegisters", FT_PTR,
  364. "EnabledInterrupts", FT_ULONG,
  365. "AsyncQueueHead", FT_PTR,
  366. "ControllerFlavor", FT_ULONG,
  367. "FrameNumberHighPart", FT_ULONG,
  368. "PortResetChange", FT_ULONG,
  369. "PortSuspendChange", FT_ULONG,
  370. "PortConnectChange", FT_ULONG,
  371. "IrqStatus", FT_ULONG,
  372. "NumberOfPorts", FT_USHORT,
  373. "PortPowerControl", FT_USHORT,
  374. "HighSpeedDeviceAttached", FT_ULONG,
  375. "FrameListBaseAddress", FT_PTR,
  376. "FrameListBasePhys", FT_ULONG,
  377. "IsoEndpointListHead", FT_PTR
  378. };
  379. FLAG_TABLE ddFlags[] = {
  380. "EHCI_DD_FLAG_NOCHIRP", EHCI_DD_FLAG_NOCHIRP,
  381. "EHCI_DD_FLAG_SOFT_ERROR_RETRY", EHCI_DD_FLAG_SOFT_ERROR_RETRY
  382. };
  383. PrintfMemLoc("*USBEHCI DEVICE DATA ", MemLoc, "\n");
  384. UsbDumpStruc(MemLoc, cs,
  385. &t[0], sizeof(t)/sizeof(STRUC_ENTRY));
  386. f = UsbReadFieldUlong(MemLoc, cs, "Flags");
  387. dprintf("Flags: 0x%08.8x\n", f);
  388. UsbDumpFlags(f, ddFlags,
  389. sizeof(ddFlags)/sizeof(FLAG_TABLE));
  390. DumpEHCI_StaticQHs(MemLoc);
  391. }
  392. VOID
  393. DumpEHCI_StaticQHs(
  394. MEMLOC MemLoc
  395. )
  396. {
  397. UCHAR cs[] = "usbehci!_DEVICE_DATA";
  398. ULONG i;
  399. MEMLOC m;
  400. UCHAR s[64];
  401. UCHAR t[64];
  402. ULONG p[65] = {
  403. 1, 2, 2, 4, 4, 4, 4, 8,
  404. 8, 8, 8, 8, 8, 8, 8,16,
  405. 16,16,16,16,16,16,16,16,
  406. 16,16,16,16,16,16,16,32,
  407. 32,32,32,32,32,32,32,32,
  408. 32,32,32,32,32,32,32,32,
  409. 32,32,32,32,32,32,32,32,
  410. 32,32,32,32,32,32,32,0,0};
  411. for (i=0; i< 65; i++) {
  412. sprintf(s, "StaticQH[%d] (%d):", i, p[i]);
  413. sprintf(t, "StaticInterruptQH[%d]", i);
  414. m = UsbReadFieldPtr(MemLoc, cs, t);
  415. PrintfMemLoc(s, m, "\n");
  416. }
  417. }
  418. VOID
  419. DumpEHCI_OpRegs(
  420. MEMLOC MemLoc,
  421. ULONG NumPorts
  422. )
  423. {
  424. PHC_OPERATIONAL_REGISTER hcOp;
  425. USBCMD cmd;
  426. USBSTS sts;
  427. ULONG l, i;
  428. USBINTR irqE;
  429. ULONG cb;
  430. l = sizeof(HC_OPERATIONAL_REGISTER) + sizeof(PORTSC) * NumPorts;
  431. hcOp = malloc(l);
  432. if (!hcOp) {
  433. return;
  434. }
  435. ReadMemory(MemLoc,
  436. hcOp,
  437. l,
  438. &cb);
  439. PrintfMemLoc("*(ehci)HC_OPERATIONAL_REGISTER ", MemLoc, "\n");
  440. cmd = hcOp->UsbCommand;
  441. dprintf("\tUSBCMD %08.8x\n" , cmd.ul);
  442. dprintf("\t.HostControllerRun: %d\n", cmd.HostControllerRun);
  443. dprintf("\t.HostControllerReset: %d\n", cmd.HostControllerReset);
  444. dprintf("\t.FrameListSize: %d\n", cmd.FrameListSize);
  445. dprintf("\t.PeriodicScheduleEnable: %d\n", cmd.PeriodicScheduleEnable);
  446. dprintf("\t.AsyncScheduleEnable: %d\n", cmd.AsyncScheduleEnable);
  447. dprintf("\t.IntOnAsyncAdvanceDoorbell: %d\n", cmd.IntOnAsyncAdvanceDoorbell);
  448. dprintf("\t.HostControllerLightReset: %d\n", cmd.HostControllerLightReset);
  449. dprintf("\t.InterruptThreshold: %d\n", cmd.InterruptThreshold);
  450. dprintf("\n");
  451. sts = hcOp->UsbStatus;
  452. dprintf("\tUSBSTS %08.8x\n" , sts.ul);
  453. dprintf("\t.UsbInterrupt: %d\n", sts.UsbInterrupt);
  454. dprintf("\t.UsbError: %d\n", sts.UsbError);
  455. dprintf("\t.PortChangeDetect: %d\n", sts.PortChangeDetect);
  456. dprintf("\t.FrameListRollover: %d\n", sts.FrameListRollover);
  457. dprintf("\t.HostSystemError: %d\n", sts.HostSystemError);
  458. dprintf("\t.IntOnAsyncAdvance: %d\n", sts.IntOnAsyncAdvance);
  459. dprintf("\t----\n");
  460. dprintf("\t.HcHalted: %d\n", sts.HcHalted);
  461. dprintf("\t.Reclimation: %d\n", sts.Reclimation);
  462. dprintf("\t.PeriodicScheduleStatus: %d\n", sts.PeriodicScheduleStatus);
  463. dprintf("\t.AsyncScheduleStatus: %d\n", sts.AsyncScheduleStatus);
  464. dprintf("\n");
  465. irqE = hcOp->UsbInterruptEnable;
  466. dprintf("\tUSBINTR %08.8x\n" , irqE.ul);
  467. dprintf("\t.UsbInterrupt: %d\n", irqE.UsbInterrupt);
  468. dprintf("\t.UsbError: %d\n", irqE.UsbError);
  469. dprintf("\t.PortChangeDetect: %d\n", irqE.PortChangeDetect);
  470. dprintf("\t.FrameListRollover: %d\n", irqE.FrameListRollover);
  471. dprintf("\t.HostSystemError: %d\n", irqE.HostSystemError);
  472. dprintf("\t.IntOnAsyncAdvance: %d\n", irqE.IntOnAsyncAdvance);
  473. dprintf("\tPeriodicListBase %08.8x\n" , hcOp->PeriodicListBase);
  474. dprintf("\tAsyncListAddr %08.8x\n" , hcOp->AsyncListAddr);
  475. for (i=0; i<NumPorts; i++) {
  476. PORTSC p;
  477. p.ul = hcOp->PortRegister[i].ul;
  478. dprintf("\tPortSC[%d] %08.8x\n", i, p.ul);
  479. dprintf("\t\tPortConnect x%x\n", p.PortConnect);
  480. dprintf("\t\tPortConnectChange x%x\n", p.PortConnectChange);
  481. dprintf("\t\tPortEnable x%x\n", p.PortEnable);
  482. dprintf("\t\tPortEnableChange x%x\n", p.PortEnableChange);
  483. dprintf("\t\tOvercurrentActive x%x\n", p.OvercurrentActive);
  484. dprintf("\t\tOvercurrentChange x%x\n", p.OvercurrentChange);
  485. dprintf("\t\tForcePortResume x%x\n", p.ForcePortResume);
  486. dprintf("\t\tPortSuspend x%x\n", p.PortSuspend);
  487. dprintf("\t\tPortReset x%x\n", p.PortReset);
  488. dprintf("\t\tHighSpeedDevice x%x\n", p.HighSpeedDevice);
  489. dprintf("\t\tLineStatus x%x\n", p.LineStatus);
  490. dprintf("\t\tPortPower x%x\n", p.PortPower);
  491. dprintf("\t\tPortOwnedByCC x%x\n", p.PortOwnedByCC);
  492. dprintf("\t\tPortIndicator x%x\n", p.PortIndicator);
  493. dprintf("\t\tPortTestControl x%x\n", p.PortTestControl);
  494. dprintf("\t\tWakeOnConnect x%x\n", p.WakeOnConnect);
  495. dprintf("\t\tWakeOnDisconnect x%x\n", p.WakeOnDisconnect);
  496. dprintf("\t\tWakeOnOvercurrent x%x\n", p.WakeOnOvercurrent);
  497. }
  498. free(hcOp);
  499. }
  500. DECLARE_API( _ehcidd )
  501. /*++
  502. Routine Description:
  503. dumps the extension
  504. Arguments:
  505. args - Address flags
  506. Return Value:
  507. None
  508. --*/
  509. {
  510. MEMLOC addr;
  511. // fetch the list head
  512. addr = GetExpression(args);
  513. DumpEHCI_DeviceData(addr);
  514. return S_OK;
  515. }
  516. DECLARE_API( _ehciitd )
  517. /*++
  518. Routine Description:
  519. dumps the extension
  520. Arguments:
  521. args - Address flags
  522. Return Value:
  523. None
  524. --*/
  525. {
  526. MEMLOC addr;
  527. // fetch the list head
  528. addr = GetExpression(args);
  529. DumpEHCI_iTd (addr);
  530. return S_OK;
  531. }
  532. DECLARE_API( _ehcitd )
  533. /*++
  534. Routine Description:
  535. dumps the extension
  536. Arguments:
  537. args - Address flags
  538. Return Value:
  539. None
  540. --*/
  541. {
  542. ULONG memLoc;
  543. UCHAR buffer[256];
  544. ULONG len = 30;
  545. ULONG result;
  546. //UNREFERENCED_PARAMETER (dwProcessor);
  547. //UNREFERENCED_PARAMETER (dwCurrentPc);
  548. //UNREFERENCED_PARAMETER (hCurrentThread);
  549. //UNREFERENCED_PARAMETER (hCurrentProcess);
  550. buffer[0] = '\0';
  551. sscanf(args, "%lx, %s", &memLoc, buffer);
  552. if ('\0' != buffer[0]) {
  553. sscanf(buffer, "%d", &len);
  554. }
  555. DumpEHCI_Td (memLoc);
  556. return S_OK;
  557. }
  558. DECLARE_API( _ehcisitd )
  559. /*++
  560. Routine Description:
  561. dumps the extension
  562. Arguments:
  563. args - Address flags
  564. Return Value:
  565. None
  566. --*/
  567. {
  568. ULONG memLoc;
  569. UCHAR buffer[256];
  570. ULONG len = 30;
  571. ULONG result;
  572. //UNREFERENCED_PARAMETER (dwProcessor);
  573. //UNREFERENCED_PARAMETER (dwCurrentPc);
  574. //UNREFERENCED_PARAMETER (hCurrentThread);
  575. //UNREFERENCED_PARAMETER (hCurrentProcess);
  576. buffer[0] = '\0';
  577. sscanf(args, "%lx, %s", &memLoc, buffer);
  578. if ('\0' != buffer[0]) {
  579. sscanf(buffer, "%d", &len);
  580. }
  581. DumpEHCI_SiTd (memLoc);
  582. return S_OK;
  583. }
  584. DECLARE_API( _ehciqh )
  585. /*++
  586. Routine Description:
  587. dumps the extension
  588. Arguments:
  589. args - Address flags
  590. Return Value:
  591. None
  592. --*/
  593. {
  594. MEMLOC addr;
  595. // fetch the list head
  596. addr = GetExpression(args);
  597. DumpEHCI_Qh(addr);
  598. return S_OK;
  599. }
  600. DECLARE_API( _ehciep )
  601. /*++
  602. Routine Description:
  603. dumps the extension
  604. Arguments:
  605. args - Address flags
  606. Return Value:
  607. None
  608. --*/
  609. {
  610. MEMLOC addr;
  611. // fetch the list head
  612. addr = GetExpression(args);
  613. DumpEHCI_EndpointData (addr);
  614. return S_OK;
  615. }
  616. DECLARE_API( _ehcitfer )
  617. /*++
  618. Routine Description:
  619. dumps the extension
  620. Arguments:
  621. args - Address flags
  622. Return Value:
  623. None
  624. --*/
  625. {
  626. ULONG memLoc;
  627. UCHAR buffer[256];
  628. ULONG len = 30;
  629. ULONG result;
  630. //UNREFERENCED_PARAMETER (dwProcessor);
  631. //UNREFERENCED_PARAMETER (dwCurrentPc);
  632. //UNREFERENCED_PARAMETER (hCurrentThread);
  633. //UNREFERENCED_PARAMETER (hCurrentProcess);
  634. buffer[0] = '\0';
  635. sscanf(args, "%lx, %s", &memLoc, buffer);
  636. if ('\0' != buffer[0]) {
  637. sscanf(buffer, "%d", &len);
  638. }
  639. DumpEHCI_DumpTfer(memLoc);
  640. return S_OK;
  641. }
  642. DECLARE_API( _ehciregs )
  643. /*++
  644. Routine Description:
  645. dumps the extension
  646. Arguments:
  647. args - Address flags
  648. Return Value:
  649. None
  650. --*/
  651. {
  652. MEMLOC addr;
  653. PCSTR s;
  654. ULONG parm = 0;
  655. GetExpressionEx( args, &addr, &s );
  656. if (s[0] != '\0') {
  657. sscanf(s, ",%d", &parm);
  658. }
  659. DumpEHCI_OpRegs(addr, parm);
  660. return S_OK;
  661. }