Leaked source code of windows server 2003
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.

744 lines
19 KiB

  1. /*++
  2. Copyright (c) 1999 Microsoft Corporation
  3. Module Name:
  4. usbohci.c
  5. Abstract:
  6. WinDbg Extension Api
  7. implements !_ohcitd
  8. !_ohcied
  9. !_ohciep
  10. !_ohcitfer
  11. Author:
  12. jd
  13. Environment:
  14. User Mode.
  15. Revision History:
  16. --*/
  17. #include "precomp.h"
  18. #include "usb.h"
  19. #include "usbhcdi.h"
  20. #include "..\miniport\usbohci\openhci.h"
  21. #include "..\miniport\usbohci\usbohci.h"
  22. #include "usbhcdkd.h"
  23. VOID
  24. DumpOHCI_EpTransfers(
  25. ULONG HeadP_MemLoc,
  26. ULONG TailP_MemLoc
  27. );
  28. VOID
  29. HwConditionCode(
  30. ULONG cc
  31. )
  32. {
  33. switch (cc) {
  34. case HcCC_NoError:
  35. dprintf("HcCC_NoError");
  36. break;
  37. case HcCC_CRC:
  38. dprintf("HcCC_CRC ");
  39. break;
  40. case HcCC_BitStuffing:
  41. dprintf("HcCC_BitStuffing");
  42. break;
  43. case HcCC_DataToggleMismatch:
  44. dprintf("HcCC_DataToggleMismatch");
  45. break;
  46. case HcCC_Stall:
  47. dprintf("HcCC_Stall ");
  48. break;
  49. case HcCC_DeviceNotResponding:
  50. dprintf("HcCC_DeviceNotResponding");
  51. break;
  52. case HcCC_PIDCheckFailure:
  53. dprintf("HcCC_PIDCheckFailure");
  54. break;
  55. case HcCC_UnexpectedPID:
  56. dprintf("HcCC_UnexpectedPID");
  57. break;
  58. case HcCC_DataOverrun:
  59. dprintf("HcCC_DataOverrun");
  60. break;
  61. case HcCC_DataUnderrun:
  62. dprintf("HcCC_DataUnderrun");
  63. break;
  64. case HcCC_BufferOverrun:
  65. dprintf("HcCC_BufferOverrun ");
  66. break;
  67. case HcCC_BufferUnderrun:
  68. dprintf("HcCC_BufferUnderrun");
  69. break;
  70. case HcCC_NotAccessed:
  71. dprintf("HcCC_NotAccessed");
  72. break;
  73. default:
  74. dprintf("???");
  75. break;
  76. }
  77. }
  78. VOID
  79. DumpOHCI_Td(
  80. MEMLOC MemLoc
  81. )
  82. {
  83. HCD_TRANSFER_DESCRIPTOR td;
  84. ULONG cb;
  85. ULONG i;
  86. // tds are a fixed size of 64/32 platforms so
  87. // we can just read it in
  88. ReadMemory(MemLoc,
  89. &td,
  90. sizeof(td),
  91. &cb);
  92. PrintfMemLoc("*USBOHCI TD ", MemLoc, "\n");
  93. dprintf("HwTD");
  94. if (td.HwTD.Asy.Isochronous) {
  95. // dump as iso
  96. dprintf("\tIsochronous %x, \n", td.HwTD.Iso.Isochronous);
  97. dprintf("\tStartingFrame: %x\n", td.HwTD.Iso.StartingFrame);
  98. dprintf("\tFrameCount: %d (%d frames) \n", td.HwTD.Iso.FrameCount,
  99. td.HwTD.Iso.FrameCount+1);
  100. // dump the psw
  101. dprintf("\tPSW:\n");
  102. for (i=0; i< td.HwTD.Iso.FrameCount+2; i++) {
  103. // input
  104. dprintf("\t\tinput:[%d].Offset: x%x - %d\n", i,
  105. td.HwTD.Packet[i].Offset,
  106. td.HwTD.Packet[i].Offset);
  107. dprintf("\t\tinput:[%d].Ones: x%x \n", i, td.HwTD.Packet[i].Ones);
  108. dprintf("\t\toutput:[%d].Size: %d\n", i, td.HwTD.Packet[i].Size);
  109. dprintf("\t\toutput:[%d].ConditionCode: %d\n", i, td.HwTD.Packet[i].ConditionCode);
  110. }
  111. } else {
  112. // dump as async
  113. dprintf("\tIsochronous %x, \n", td.HwTD.Asy.Isochronous);
  114. dprintf("\tShortXferOk: %x\n", td.HwTD.Asy.ShortXferOk);
  115. dprintf("\tDirection: %x\n", td.HwTD.Asy.Direction);
  116. dprintf("\tToggle: %x", td.HwTD.Asy.Toggle);
  117. dprintf("\tIntDelay: %x", td.HwTD.Asy.IntDelay);
  118. dprintf("\tErrorCount: %x\n", td.HwTD.Asy.ErrorCount);
  119. dprintf("\tConditionCode: x%x - ", td.HwTD.Asy.ConditionCode);
  120. HwConditionCode(td.HwTD.Asy.ConditionCode);
  121. dprintf("\n");
  122. switch (td.HwTD.Asy.Toggle) {
  123. case HcTDToggle_FromEd:
  124. dprintf("HcTDToggle_FromEd\n");
  125. break;
  126. case HcTDToggle_Data0:
  127. dprintf("HcTDToggle_Data0\n");
  128. break;
  129. case HcTDToggle_Data1:
  130. dprintf("HcTDToggle_Data1\n");
  131. break;
  132. }
  133. }
  134. // these fields are common for iso & async
  135. dprintf("\tCBP: ! %x\n", td.HwTD.CBP);
  136. dprintf("\tBE: ! %x\n", td.HwTD.BE);
  137. dprintf("\tNextTD: ! %x\n", td.HwTD.NextTD);
  138. dprintf("PhysicalAddress: %08.8x\n", td.PhysicalAddress);
  139. Sig(td.Sig, "");
  140. dprintf("Flags: 0x%08.8x\n", td.Flags);
  141. dprintf("EndpointData: %08.8x\n", td.EndpointData);
  142. dprintf("TransferContext: %08.8x\n", td.TransferContext);
  143. dprintf("TransferCount: 0x%08.8x\n", td.TransferCount);
  144. dprintf("FrameIndex: %d\n", td.FrameIndex);
  145. dprintf("NextHcdTD: %08.8x\n", td.NextHcdTD);
  146. }
  147. VOID
  148. DumpOHCI_Ed(
  149. ULONG MemLoc
  150. )
  151. {
  152. HCD_ENDPOINT_DESCRIPTOR ed;
  153. ULONG result;
  154. if (!ReadMemory (MemLoc, &ed, sizeof(ed), &result)) {
  155. BadMemLoc(MemLoc);
  156. return;
  157. }
  158. dprintf("*USBOHCI ED %08.8x\n", MemLoc);
  159. dprintf("HwED");
  160. dprintf("\tFunctionAddress: 0x%x\n", ed.HwED.FunctionAddress);
  161. dprintf("\tEndpointNumber: %x\n", ed.HwED.EndpointNumber);
  162. dprintf("\tDirection: %x\n", ed.HwED.Direction);
  163. dprintf("\tLowSpeed: %x\n", ed.HwED.LowSpeed);
  164. dprintf("\tsKip: %x\n", ed.HwED.sKip);
  165. dprintf("\tIsochronous: %x\n", ed.HwED.Isochronous);
  166. dprintf("\tMaxPacket: 0x%x\n", ed.HwED.MaxPacket);
  167. dprintf("\tTailP: ! %x\n", ed.HwED.TailP);
  168. dprintf("\tHeadP: ! %x", ed.HwED.HeadP);
  169. if (ed.HwED.HeadP & HcEDHeadP_HALT) {
  170. dprintf(" (halted)");
  171. }
  172. dprintf("\n");
  173. dprintf("\tNextED: %x\n", ed.HwED.NextED);
  174. dprintf("PhysicalAddress: %08.8x\n", ed.PhysicalAddress);
  175. Sig(ed.Sig, "");
  176. dprintf("EdFlags: 0x%08.8x\n", ed.EdFlags);
  177. dprintf("EndpointData: %08.8x\n", ed.EndpointData);
  178. dprintf("SwLink.List.Flink: %08.8x\n", ed.SwLink.List.Flink);
  179. dprintf("SwLink.List.Blink: %08.8x\n", ed.SwLink.List.Blink);
  180. }
  181. VOID
  182. DumpOHCI_EndpointData(
  183. MEMLOC MemLoc
  184. )
  185. {
  186. UCHAR cs[] = "usbohci!_ENDPOINT_DATA";
  187. PrintfMemLoc("*USBOHCI ENDPOINT_DATA ", MemLoc, "\n");
  188. Sig(UsbReadFieldUlong(MemLoc, cs, "Sig"), "");
  189. // dprintf("MaxPendingTransfers: 0x%08.8x\n", epData.MaxPendingTransfers);
  190. dprintf("PendingTransfers: 0x%08.8x\n",
  191. UsbReadFieldUlong(MemLoc, cs, "PendingTransfers"));
  192. PrintfMemLoc("StaticEd: ",
  193. UsbReadFieldPtr(MemLoc, cs, "StaticEd"),
  194. "\n");
  195. PrintfMemLoc("TdList: ",
  196. UsbReadFieldPtr(MemLoc, cs, "TdList"),
  197. "\n");
  198. PrintfMemLoc("HcdEd: ",
  199. UsbReadFieldPtr(MemLoc, cs, "HcdEd"),
  200. "\n");
  201. dprintf("TdCount: 0x%08.8x\n",
  202. UsbReadFieldUlong(MemLoc, cs, "TdCount"));
  203. PrintfMemLoc("HcdTailP: ",
  204. UsbReadFieldPtr(MemLoc, cs, "HcdTailP"),
  205. "\n");
  206. PrintfMemLoc("HcdHeadP: ",
  207. UsbReadFieldPtr(MemLoc, cs, "HcdHeadP"),
  208. "\n");
  209. // DumpOHCI_Ed(epData.HcdEd);
  210. // DumpOHCI_EpTransfers((ULONG) epData.HcdHeadP, (ULONG) epData.HcdTailP);
  211. }
  212. VOID
  213. DumpOHCI_TransferContext(
  214. ULONG MemLoc
  215. )
  216. {
  217. TRANSFER_CONTEXT tc;
  218. ULONG result;
  219. SIG s;
  220. if (!ReadMemory (MemLoc, &tc, sizeof(tc), &result)) {
  221. BadMemLoc(MemLoc);
  222. return;
  223. }
  224. dprintf("*USBOHCI TRANSFER_CONTEXT %08.8x\n", MemLoc);
  225. Sig(tc.Sig, "");
  226. dprintf("BytesTransferred: 0x%08.8x\n", tc.BytesTransferred);
  227. dprintf("TransferParameters: %x\n",
  228. tc.TransferParameters);
  229. dprintf("PendingTds: %d\n", tc.PendingTds);
  230. dprintf("Flags: %08.8x\n", tc.TcFlags);
  231. dprintf("UsbdStatus: 0x%08.8x\n", tc.UsbdStatus);
  232. dprintf("NextXferTd: %08.8x\n", tc.NextXferTd);
  233. dprintf("StatusTd: %08.8x\n", tc.StatusTd);
  234. dprintf("EndpointData: %08.8x\n", tc.EndpointData);
  235. }
  236. VOID
  237. DumpOHCI_EpTransfers(
  238. ULONG HeadP_MemLoc,
  239. ULONG TailP_MemLoc
  240. )
  241. {
  242. #if 0
  243. HCD_TRANSFER_DESCRIPTOR td;
  244. ULONG memLoc, result;
  245. // start at headp and walk to tail
  246. dprintf("\t TRANSFERS: HeadP\n");
  247. memLoc = HeadP_MemLoc;
  248. do {
  249. if (!ReadMemory (memLoc, &td, sizeof(td), &result)) {
  250. break;
  251. }
  252. dprintf("\t> TD %8.8x(! %8.8x) - Transfer %8.8x Next-> ! %8.8x\n",
  253. memLoc, td.PhysicalAddress, td.TransferContext.Pointer,
  254. td.HwTD.NextTD);
  255. if (memLoc == TailP_MemLoc) {
  256. break;
  257. }
  258. memLoc = (ULONG) td.NextHcdTD.Pointer;
  259. } while (1);
  260. #endif
  261. }
  262. VOID
  263. DumpOHCI_DeviceData(
  264. MEMLOC MemLoc,
  265. BOOLEAN Verbose
  266. )
  267. {
  268. UCHAR cs[] = "usbohci!_DEVICE_DATA";
  269. ULONG f, i;
  270. UCHAR fld[40], fld1[40], fld2[40], fld3[40], fld4[40];
  271. STRUC_ENTRY t[] = {
  272. "Sig", FT_SIG,
  273. "HC", FT_PTR,
  274. "BIOS_Interval", FT_ULONG,
  275. "SofModifyValue", FT_ULONG,
  276. "FrameHighPart", FT_ULONG,
  277. "HcHCCA", FT_PTR,
  278. "HcHCCAPhys", FT_ULONG,
  279. "HydraLsHsHackEd", FT_PTR,
  280. "StaticEDs", FT_PTR,
  281. "StaticEDsPhys", FT_ULONG,
  282. "ControllerFlavor", FT_ULONG,
  283. };
  284. ULONG period[] = {1, 2, 2, 4, 4, 4, 4, 8,
  285. 8, 8, 8, 8, 8, 8, 8,16,
  286. 16,16,16,16,16,16,16,16,
  287. 16,16,16,16,16,16,16,32,
  288. 32,32,32,32,32,32,32,32,
  289. 32,32,32,32,32,32,32,32,
  290. 32,32,32,32,32,32,32,32,
  291. 32,32,32,32,32,32,32,
  292. 0, 0};
  293. // FLAG_TABLE ddFlags[] = {
  294. // "EHCI_DD_FLAG_NOCHIRP", EHCI_DD_FLAG_NOCHIRP,
  295. // "EHCI_DD_FLAG_SOFT_ERROR_RETRY", EHCI_DD_FLAG_SOFT_ERROR_RETRY
  296. // };
  297. PrintfMemLoc("*USBOHCI DEVICE DATA ", MemLoc, "\n");
  298. UsbDumpStruc(MemLoc, cs,
  299. &t[0], sizeof(t)/sizeof(STRUC_ENTRY));
  300. if (Verbose) {
  301. for (i= 0; i< NO_ED_LISTS; i++) {
  302. dprintf("\t[%02.2d] (%2.2dms): ", i, period[i]);
  303. sprintf(fld , "StaticEDList[%d]", i);
  304. sprintf(fld1, "StaticEDList[%d].HwED", i);
  305. sprintf(fld2, "StaticEDList[%d].HwEDPhys", i);
  306. PrintfMemLoc("StaticED @ ",
  307. MemLoc + UsbFieldOffset(cs, fld),
  308. " ");
  309. PrintfMemLoc("HwED ",
  310. UsbReadFieldPtr(MemLoc, cs, fld1),
  311. " ");
  312. dprintf("(!%08.8x)\n",
  313. UsbReadFieldUlong(MemLoc, cs, fld2));
  314. sprintf(fld1, "StaticEDList[%d].NextIdx", i);
  315. sprintf(fld2, "StaticEDList[%d].EdFlags", i);
  316. sprintf(fld3, "StaticEDList[%d].HccaOffset", i);
  317. sprintf(fld4, "StaticEDList[%d].PhysicalHead", i);
  318. dprintf("\t\tNextIdx(%03.3d) EdFlags %08.8x Hcca Offset %d ",
  319. UsbReadFieldUlong(MemLoc, cs, fld1),
  320. UsbReadFieldUlong(MemLoc, cs, fld2),
  321. UsbReadFieldUlong(MemLoc, cs, fld3));
  322. PrintfMemLoc("PhysicalHead ",
  323. MemLoc + UsbFieldOffset(cs, fld4),
  324. "\n");
  325. sprintf(fld1, "StaticEDList[%d].TransferEdList.Flink", i);
  326. PrintfMemLoc("\t\tTransferEdList.Flink ",
  327. UsbReadFieldPtr(MemLoc, cs, fld1),
  328. "\n");
  329. sprintf(fld1, "StaticEDList[%d].TransferEdList.Blink", i);
  330. PrintfMemLoc("\t\tTransferEdList.Blink ",
  331. UsbReadFieldPtr(MemLoc, cs, fld1),
  332. "\n");
  333. }
  334. }
  335. }
  336. VOID
  337. DumpOHCI_Ints(
  338. ULONG i
  339. )
  340. {
  341. if (i & HcInt_SchedulingOverrun) {
  342. dprintf("\t HcInt_SchedulingOverrun \n");
  343. }
  344. if (i & HcInt_WritebackDoneHead) {
  345. dprintf("\t HcInt_WritebackDoneHead \n");
  346. }
  347. if (i & HcInt_StartOfFrame) {
  348. dprintf("\t HcInt_StartOfFrame \n");
  349. }
  350. if (i & HcInt_ResumeDetected) {
  351. dprintf("\t HcInt_ResumeDetected \n");
  352. }
  353. if (i & HcInt_UnrecoverableError) {
  354. dprintf("\t HcInt_UnrecoverableError \n");
  355. }
  356. if (i & HcInt_RootHubStatusChange) {
  357. dprintf("\t HcInt_RootHubStatusChange \n");
  358. }
  359. if (i & HcInt_OwnershipChange) {
  360. dprintf("\t HcInt_OwnershipChange \n");
  361. }
  362. if (i & HcInt_MasterInterruptEnable) {
  363. dprintf("\t HcInt_MasterInterruptEnable \n");
  364. }
  365. if (i & HcInt_FrameNumberOverflow) {
  366. dprintf("\t HcInt_FrameNumberOverflow \n");
  367. }
  368. dprintf("\n");
  369. }
  370. VOID
  371. DumpOHCI_OpRegs(
  372. MEMLOC MemLoc
  373. )
  374. {
  375. HC_OPERATIONAL_REGISTER hc;
  376. HC_CONTROL cmd;
  377. HC_COMMAND_STATUS sts;
  378. ULONG l, i, p;
  379. ULONG cb;
  380. ReadMemory(MemLoc,
  381. &hc,
  382. sizeof(HC_OPERATIONAL_REGISTER),
  383. &cb);
  384. PrintfMemLoc("*(ohci)HC_OPERATIONAL_REGISTER ", MemLoc, "\n");
  385. cmd = hc.HcControl;
  386. dprintf("\tHC_CONTROL %08.8x\n" , cmd.ul);
  387. dprintf("\t.ControlBulkServiceRatio: %d\n", cmd.ControlBulkServiceRatio);
  388. dprintf("\t.IsochronousEnable: %d\n", cmd.IsochronousEnable);
  389. dprintf("\t.ControlListEnable: %d\n", cmd.ControlListEnable);
  390. dprintf("\t.BulkListEnable: %d\n", cmd.BulkListEnable);
  391. dprintf("\t.HostControllerFunctionalState: %d\n", cmd.HostControllerFunctionalState);
  392. dprintf("Reset=0 Resume=1 Operational=2 Suspend=3\n");
  393. dprintf("\t.InterruptRouting: %d\n", cmd.InterruptRouting);
  394. dprintf("\t.RemoteWakeupConnected: %d\n", cmd.RemoteWakeupConnected);
  395. dprintf("\t.RemoteWakeupEnable: %d\n", cmd.RemoteWakeupEnable);
  396. dprintf("\n");
  397. sts = hc.HcCommandStatus;
  398. dprintf("\tHC_COMMAND_STATUS %08.8x\n" , sts.ul);
  399. dprintf("\t.HostControllerReset: %d\n", sts.HostControllerReset);
  400. dprintf("\t.ControlListFilled: %d\n", sts.ControlListFilled);
  401. dprintf("\t.BulkListFilled: %d\n", sts.BulkListFilled);
  402. dprintf("\t.OwnershipChangeRequest: %d\n", sts.OwnershipChangeRequest);
  403. dprintf("\t.SchedulingOverrunCount: %d\n", sts.SchedulingOverrunCount);
  404. dprintf("\n");
  405. dprintf("\tHcInterruptStatus: %08.8x\n" , hc.HcInterruptStatus);
  406. DumpOHCI_Ints(hc.HcInterruptStatus);
  407. dprintf("\tHcInterruptEnable: %08.8x\n" , hc.HcInterruptEnable);
  408. DumpOHCI_Ints(hc.HcInterruptEnable);
  409. dprintf("\tHcInterruptDisable: %08.8x\n" , hc.HcInterruptDisable);
  410. DumpOHCI_Ints(hc.HcInterruptDisable);
  411. dprintf("\tHcHCCA: %08.8x\n" , hc.HcHCCA);
  412. dprintf("\tHcPeriodCurrentED: %08.8x\n" , hc.HcPeriodCurrentED);
  413. dprintf("\tHcControlHeadED: %08.8x\n" , hc.HcControlHeadED);
  414. dprintf("\tHcControlCurrentED: %08.8x\n" , hc.HcControlCurrentED);
  415. dprintf("\tHcBulkHeadED: %08.8x\n" , hc.HcBulkHeadED);
  416. dprintf("\tHcBulkCurrentED: %08.8x\n" , hc.HcBulkCurrentED);
  417. dprintf("\tHcDoneHead: %08.8x\n" , hc.HcDoneHead);
  418. dprintf("\tHcFmInterval: %08.8x\n" , hc.HcFmInterval.ul);
  419. dprintf("\tHcFmRemaining: %08.8x\n" , hc.HcFmRemaining.ul);
  420. dprintf("\tHcFmNumber: %08.8x\n" , hc.HcFmNumber);
  421. dprintf("\tHcPeriodicStart: %08.8x\n" , hc.HcPeriodicStart);
  422. dprintf("\tHcLSThreshold: %08.8x\n" , hc.HcLSThreshold);
  423. dprintf("\t-------\n");
  424. dprintf("\tCurrent Frame Index = %d\n", hc.HcFmNumber & 0x0000001f);
  425. dprintf("\t-------\n");
  426. dprintf("\tHcRhDescriptorA: %08.8x\n" , hc.HcRhDescriptorA.ul);
  427. dprintf("\t\tNumberDownstreamPorts: %d\n" , hc.HcRhDescriptorA.s.NumberDownstreamPorts);
  428. dprintf("\t\tHubChars: %x\n" , hc.HcRhDescriptorA.s.HubChars);
  429. dprintf("\t\tPowerOnToPowerGoodTime: %d\n" , hc.HcRhDescriptorA.s.PowerOnToPowerGoodTime);
  430. dprintf("\tHcRhDescriptorB: %08.8x\n" , hc.HcRhDescriptorB.ul);
  431. dprintf("\tHcRhStatus: %08.8x\n" , hc.HcRhStatus);
  432. for (p=0; p< hc.HcRhDescriptorA.s.NumberDownstreamPorts; p++) {
  433. dprintf("\tHcRhPortStatus[%d]: %08.8x\n",p ,hc.HcRhPortStatus[p]);
  434. }
  435. }
  436. DECLARE_API( _ohcitd )
  437. /*++
  438. Routine Description:
  439. dumps the extension
  440. Arguments:
  441. args - Address flags
  442. Return Value:
  443. None
  444. --*/
  445. {
  446. MEMLOC addr;
  447. // fetch the list head
  448. addr = GetExpression(args);
  449. DumpOHCI_Td (addr);
  450. return S_OK;
  451. }
  452. DECLARE_API( _ohcied )
  453. /*++
  454. Routine Description:
  455. dumps the extension
  456. Arguments:
  457. args - Address flags
  458. Return Value:
  459. None
  460. --*/
  461. {
  462. ULONG memLoc;
  463. UCHAR buffer[256];
  464. ULONG len = 30;
  465. ULONG result;
  466. //UNREFERENCED_PARAMETER (dwProcessor);
  467. //UNREFERENCED_PARAMETER (dwCurrentPc);
  468. //UNREFERENCED_PARAMETER (hCurrentThread);
  469. //UNREFERENCED_PARAMETER (hCurrentProcess);
  470. buffer[0] = '\0';
  471. sscanf(args, "%lx, %s", &memLoc, buffer);
  472. if ('\0' != buffer[0]) {
  473. sscanf(buffer, "%d", &len);
  474. }
  475. DumpOHCI_Ed (memLoc);
  476. return S_OK;
  477. }
  478. DECLARE_API( _ohciep )
  479. /*++
  480. Routine Description:
  481. dumps the extension
  482. Arguments:
  483. args - Address flags
  484. Return Value:
  485. None
  486. --*/
  487. {
  488. MEMLOC addr;
  489. // fetch the list head
  490. addr = GetExpression(args);
  491. DumpOHCI_EndpointData (addr);
  492. return S_OK;
  493. }
  494. DECLARE_API( _ohcitfer )
  495. /*++
  496. Routine Description:
  497. dumps TRANSFER_CONTEXT
  498. Arguments:
  499. args - Address flags
  500. Return Value:
  501. None
  502. --*/
  503. {
  504. ULONG memLoc;
  505. UCHAR buffer[256];
  506. ULONG len = 30;
  507. ULONG result;
  508. //UNREFERENCED_PARAMETER (dwProcessor);
  509. //UNREFERENCED_PARAMETER (dwCurrentPc);
  510. //UNREFERENCED_PARAMETER (hCurrentThread);
  511. //UNREFERENCED_PARAMETER (hCurrentProcess);
  512. buffer[0] = '\0';
  513. sscanf(args, "%lx, %s", &memLoc, buffer);
  514. if ('\0' != buffer[0]) {
  515. sscanf(buffer, "%d", &len);
  516. }
  517. DumpOHCI_TransferContext (memLoc);
  518. return S_OK;
  519. }
  520. DECLARE_API( _ohciregs )
  521. /*++
  522. Routine Description:
  523. dumps the extension
  524. Arguments:
  525. args - Address flags
  526. Return Value:
  527. None
  528. --*/
  529. {
  530. MEMLOC addr;
  531. // fetch the list head
  532. addr = GetExpression(args);
  533. DumpOHCI_OpRegs(addr);
  534. return S_OK;
  535. }
  536. DECLARE_API( _ohcidd )
  537. /*++
  538. Routine Description:
  539. dumps the extension
  540. Arguments:
  541. args - Address flags
  542. Return Value:
  543. None
  544. --*/
  545. {
  546. MEMLOC addr;
  547. PCSTR s;
  548. UCHAR parm[32];
  549. GetExpressionEx( args, &addr, &s );
  550. sscanf(s, ",%s", &parm);
  551. dprintf("%s\n", parm);
  552. DumpOHCI_DeviceData(addr, parm[0] == 'v');
  553. return S_OK;
  554. }