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.

60 lines
1.1 KiB

  1. /*++
  2. Copyright (c) 2001 Microsoft Corporation
  3. Module Name:
  4. pcienum.h
  5. Abstract:
  6. This module contains support routines for the Pci bus enumeration.
  7. Author:
  8. Bassam Tabbara (bassamt) 05-Aug-2001
  9. Environment:
  10. Real mode
  11. --*/
  12. #define PCI_ITERATOR_IS_VALID(i) (i & 0x8000)
  13. #define PCI_ITERATOR_TO_BUS(i) (UCHAR)(((i) >> 8) & 0x7f)
  14. #define PCI_ITERATOR_TO_DEVICE(i) (UCHAR)(((i) >> 3) & 0x1f)
  15. #define PCI_ITERATOR_TO_FUNCTION(i) (UCHAR)(((i) >> 0) & 0x7)
  16. #define PCI_TO_ITERATOR(b,d,f) ((USHORT)(0x8000 | ((b)<<8) | ((d)<<3) | (f)))
  17. //
  18. // methods
  19. //
  20. ULONG PciReadConfig
  21. (
  22. USHORT nDevIt,
  23. ULONG cbOffset,
  24. UCHAR * pbBuffer,
  25. ULONG cbLength
  26. );
  27. ULONG PciWriteConfig
  28. (
  29. USHORT nDevIt,
  30. ULONG cbOffset,
  31. UCHAR * pbBuffer,
  32. ULONG cbLength
  33. );
  34. USHORT PciFindDevice
  35. (
  36. USHORT nVendorId, // 0 = Wildcard
  37. USHORT nDeviceId, // 0 = Wildcard
  38. USHORT nBegDevIt // 0 = begin enumeration
  39. );
  40. BOOLEAN PciInit(PCI_REGISTRY_INFO *pPCIReg);