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.

157 lines
3.1 KiB

  1. /*++
  2. Copyright (c) 1999 Microsoft Corporation
  3. Module Name:
  4. errata.c
  5. Abstract:
  6. documented errata for all of our favorite types of
  7. openhci USB controllers.
  8. Environment:
  9. Kernel mode
  10. Revision History:
  11. 12-31-99 : created jdunn
  12. --*/
  13. #include "common.h"
  14. /*
  15. Hydra Errata
  16. The folllowing code is specific for the COMPAQ Hydra OHCI hardware
  17. design -- it should not be executed on other controllers
  18. */
  19. // Hydra HighSpeed/LowSpeed Data Corruption Bug
  20. VOID
  21. InitializeHydraHsLsFix(
  22. )
  23. /*++
  24. Routine Description:
  25. Data corruption can occur on the Hydra part when iso transfers
  26. follow lowspeed interrupt transfers.
  27. The classic repro of this bug is playing 'dance of the surgar
  28. plum fairys' on USB speakers while moving the USB mouse. This
  29. generates low speed interrupt INs and High speed ISO OUTs.
  30. The 'fix' is to introduce a 'specific delay before the HS Iso
  31. transfers and after teh LS interrupt transfers.
  32. (31) -\
  33. (15)-\
  34. (32) -/ \
  35. (7 )-\
  36. (33) -\ / \
  37. (16)-/ \
  38. (34) -/
  39. Arguments:
  40. Return Value:
  41. none
  42. --*/
  43. {
  44. PHCD_ENDPOINT_DESCRIPTOR ed;
  45. PHCD_DEVICE_DATA deviceData;
  46. PHCD_TRANSFER_DESCRIPTOR td;
  47. ULONG i;
  48. OpenHCI_KdPrint((1, "'*** WARNING: Turning on HS/LS Fix ***\n"));
  49. //
  50. // **
  51. // WARNING:
  52. /*
  53. The folllowing code is specific for the COMPAQ OHCI hardware
  54. design -- it should not be executed on other controllers
  55. */
  56. /* Dummy ED must look like this:
  57. ED->TD->XXX
  58. XXX is bogus address 0xABADBABE
  59. (HeadP points to TD)
  60. (TailP points to XXX)
  61. TD has CBP=0 and BE=0
  62. NextTD points to XXX
  63. TD will never be retired by the hardware
  64. */
  65. //
  66. // create a dummy interrupt ED with period 1
  67. //
  68. deviceData = (PHCD_DEVICE_DATA) DeviceObject->DeviceExtension;
  69. // Reserve the 17 dummy EDs+TDs
  70. //
  71. OpenHCI_ReserveDescriptors(deviceData, 34);
  72. // add 17 dummy EDs+TDs
  73. //
  74. for (i=0; i< 17; i++) {
  75. ed = InsertEDForEndpoint(deviceData, NULL, ED_INTERRUPT_1ms,
  76. &td);
  77. OHCI_ASSERT(td);
  78. ed->Endpoint = NULL;
  79. ed->HcED.FunctionAddress = 0;
  80. ed->HcED.EndpointNumber = 0;
  81. ed->HcED.Direction = 0;
  82. ed->HcED.LowSpeed = 0;
  83. ed->HcED.sKip = 1;
  84. ed->HcED.Isochronous = 0;
  85. ed->HcED.MaxPacket = 0;
  86. //fixup the TD
  87. td->Canceled = FALSE;
  88. td->NextHcdTD = (PVOID)-1;
  89. td->UsbdRequest = MAGIC_SIG;
  90. td->HcTD.CBP = 0;
  91. td->HcTD.BE = 0;
  92. td->HcTD.Control = 0;
  93. td->HcTD.NextTD = 0xABADBABE;
  94. // set head/Tail pointers
  95. // ed->HcED.HeadP = td->PhysicalAddress;
  96. // ed->HcED.TailP = 0xABADBABE;
  97. // turn it on
  98. LOGENTRY(G, 'MagI', 0, ed, td);
  99. //TEST_TRAP();
  100. //ed->HcED.sKip = 0;
  101. }
  102. return STATUS_SUCCESS;
  103. }
  104. /*
  105. NEC Errata
  106. */