pnp.h
上传用户:jlfgdled
上传日期:2013-04-10
资源大小:33168k
文件大小:28k
源码类别:

Linux/Unix编程

开发平台:

Unix_Linux

  1. /*
  2.  * BK Id: SCCS/s.pnp.h 1.5 05/17/01 18:14:25 cort
  3.  */
  4. #ifdef __KERNEL__
  5. /* 11/02/95                                                                   */
  6. /*----------------------------------------------------------------------------*/
  7. /*      Plug and Play header definitions                                      */
  8. /*----------------------------------------------------------------------------*/
  9. /* Structure map for PnP on PowerPC Reference Platform                        */
  10. /* See Plug and Play ISA Specification, Version 1.0, May 28, 1993.  It        */
  11. /* (or later versions) is available on Compuserve in the PLUGPLAY area.       */
  12. /* This code has extensions to that specification, namely new short and       */
  13. /* long tag types for platform dependent information                          */
  14. /* Warning: LE notation used throughout this file                             */
  15. /* For enum's: if given in hex then they are bit significant, i.e.            */
  16. /* only one bit is on for each enum                                           */
  17. #ifndef _PNP_
  18. #define _PNP_
  19. #ifndef __ASSEMBLY__
  20. #define MAX_MEM_REGISTERS 9
  21. #define MAX_IO_PORTS 20
  22. #define MAX_IRQS 7
  23. /*#define MAX_DMA_CHANNELS 7*/
  24. /* Interrupt controllers */
  25. #define PNPinterrupt0 "PNP0000"      /* AT Interrupt Controller               */
  26. #define PNPinterrupt1 "PNP0001"      /* EISA Interrupt Controller             */
  27. #define PNPinterrupt2 "PNP0002"      /* MCA Interrupt Controller              */
  28. #define PNPinterrupt3 "PNP0003"      /* APIC                                  */
  29. #define PNPExtInt     "IBM000D"      /* PowerPC Extended Interrupt Controller */
  30. /* Timers */
  31. #define PNPtimer0     "PNP0100"      /* AT Timer                              */
  32. #define PNPtimer1     "PNP0101"      /* EISA Timer                            */
  33. #define PNPtimer2     "PNP0102"      /* MCA Timer                             */
  34. /* DMA controllers */
  35. #define PNPdma0       "PNP0200"      /* AT DMA Controller                     */
  36. #define PNPdma1       "PNP0201"      /* EISA DMA Controller                   */
  37. #define PNPdma2       "PNP0202"      /* MCA DMA Controller                    */
  38. /* start of August 15, 1994 additions */
  39. /* CMOS */
  40. #define PNPCMOS       "IBM0009"      /* CMOS                                  */
  41. /* L2 Cache */
  42. #define PNPL2         "IBM0007"      /* L2 Cache                              */
  43. /* NVRAM */
  44. #define PNPNVRAM      "IBM0008"      /* NVRAM                                 */
  45. /* Power Management */
  46. #define PNPPM         "IBM0005"      /* Power Management                      */
  47. /* end of August 15, 1994 additions */
  48. /* Keyboards */
  49. #define PNPkeyboard0  "PNP0300"      /* IBM PC/XT KB Cntlr (83 key, no mouse) */
  50. #define PNPkeyboard1  "PNP0301"      /* Olivetti ICO (102 key)                */
  51. #define PNPkeyboard2  "PNP0302"      /* IBM PC/AT KB Cntlr (84 key)           */
  52. #define PNPkeyboard3  "PNP0303"      /* IBM Enhanced (101/2 key, PS/2 mouse)  */
  53. #define PNPkeyboard4  "PNP0304"      /* Nokia 1050 KB Cntlr                   */
  54. #define PNPkeyboard5  "PNP0305"      /* Nokia 9140 KB Cntlr                   */
  55. #define PNPkeyboard6  "PNP0306"      /* Standard Japanese KB Cntlr            */
  56. #define PNPkeyboard7  "PNP0307"      /* Microsoft Windows (R) KB Cntlr        */
  57. /* Parallel port controllers */
  58. #define PNPparallel0 "PNP0400"       /* Standard LPT Parallel Port            */
  59. #define PNPparallel1 "PNP0401"       /* ECP Parallel Port                     */
  60. #define PNPepp       "IBM001C"       /* EPP Parallel Port                     */
  61. /* Serial port controllers */
  62. #define PNPserial0   "PNP0500"       /* Standard PC Serial port               */
  63. #define PNPSerial1   "PNP0501"       /* 16550A Compatible Serial port         */
  64. /* Disk controllers */
  65. #define PNPdisk0     "PNP0600"       /* Generic ESDI/IDE/ATA Compat HD Cntlr  */
  66. #define PNPdisk1     "PNP0601"       /* Plus Hardcard II                      */
  67. #define PNPdisk2     "PNP0602"       /* Plus Hardcard IIXL/EZ                 */
  68. /* Diskette controllers */
  69. #define PNPdiskette0 "PNP0700"       /* PC Standard Floppy Disk Controller    */
  70. /* Display controllers */
  71. #define PNPdisplay0  "PNP0900"       /* VGA Compatible                        */
  72. #define PNPdisplay1  "PNP0901"       /* Video Seven VGA                       */
  73. #define PNPdisplay2  "PNP0902"       /* 8514/A Compatible                     */
  74. #define PNPdisplay3  "PNP0903"       /* Trident VGA                           */
  75. #define PNPdisplay4  "PNP0904"       /* Cirrus Logic Laptop VGA               */
  76. #define PNPdisplay5  "PNP0905"       /* Cirrus Logic VGA                      */
  77. #define PNPdisplay6  "PNP0906"       /* Tseng ET4000 or ET4000/W32            */
  78. #define PNPdisplay7  "PNP0907"       /* Western Digital VGA                   */
  79. #define PNPdisplay8  "PNP0908"       /* Western Digital Laptop VGA            */
  80. #define PNPdisplay9  "PNP0909"       /* S3                                    */
  81. #define PNPdisplayA  "PNP090A"       /* ATI Ultra Pro/Plus (Mach 32)          */
  82. #define PNPdisplayB  "PNP090B"       /* ATI Ultra (Mach 8)                    */
  83. #define PNPdisplayC  "PNP090C"       /* XGA Compatible                        */
  84. #define PNPdisplayD  "PNP090D"       /* ATI VGA Wonder                        */
  85. #define PNPdisplayE  "PNP090E"       /* Weitek P9000 Graphics Adapter         */
  86. #define PNPdisplayF  "PNP090F"       /* Oak Technology VGA                    */
  87. /* Peripheral busses */
  88. #define PNPbuses0    "PNP0A00"       /* ISA Bus                               */
  89. #define PNPbuses1    "PNP0A01"       /* EISA Bus                              */
  90. #define PNPbuses2    "PNP0A02"       /* MCA Bus                               */
  91. #define PNPbuses3    "PNP0A03"       /* PCI Bus                               */
  92. #define PNPbuses4    "PNP0A04"       /* VESA/VL Bus                           */
  93. /* RTC, BIOS, planar devices */
  94. #define PNPspeaker0  "PNP0800"       /* AT Style Speaker Sound                */
  95. #define PNPrtc0      "PNP0B00"       /* AT RTC                                */
  96. #define PNPpnpbios0  "PNP0C00"       /* PNP BIOS (only created by root enum)  */
  97. #define PNPpnpbios1  "PNP0C01"       /* System Board Memory Device            */
  98. #define PNPpnpbios2  "PNP0C02"       /* Math Coprocessor                      */
  99. #define PNPpnpbios3  "PNP0C03"       /* PNP BIOS Event Notification Interrupt */
  100. /* PCMCIA controller */
  101. #define PNPpcmcia0   "PNP0E00"       /* Intel 82365 Compatible PCMCIA Cntlr   */
  102. /* Mice */
  103. #define PNPmouse0    "PNP0F00"       /* Microsoft Bus Mouse                   */
  104. #define PNPmouse1    "PNP0F01"       /* Microsoft Serial Mouse                */
  105. #define PNPmouse2    "PNP0F02"       /* Microsoft Inport Mouse                */
  106. #define PNPmouse3    "PNP0F03"       /* Microsoft PS/2 Mouse                  */
  107. #define PNPmouse4    "PNP0F04"       /* Mousesystems Mouse                    */
  108. #define PNPmouse5    "PNP0F05"       /* Mousesystems 3 Button Mouse - COM2    */
  109. #define PNPmouse6    "PNP0F06"       /* Genius Mouse - COM1                   */
  110. #define PNPmouse7    "PNP0F07"       /* Genius Mouse - COM2                   */
  111. #define PNPmouse8    "PNP0F08"       /* Logitech Serial Mouse                 */
  112. #define PNPmouse9    "PNP0F09"       /* Microsoft Ballpoint Serial Mouse      */
  113. #define PNPmouseA    "PNP0F0A"       /* Microsoft PNP Mouse                   */
  114. #define PNPmouseB    "PNP0F0B"       /* Microsoft PNP Ballpoint Mouse         */
  115. /* Modems */
  116. #define PNPmodem0    "PNP9000"       /* Specific IDs TBD                      */
  117. /* Network controllers */
  118. #define PNPnetworkC9 "PNP80C9"       /* IBM Token Ring                        */
  119. #define PNPnetworkCA "PNP80CA"       /* IBM Token Ring II                     */
  120. #define PNPnetworkCB "PNP80CB"       /* IBM Token Ring II/Short               */
  121. #define PNPnetworkCC "PNP80CC"       /* IBM Token Ring 4/16Mbs                */
  122. #define PNPnetwork27 "PNP8327"       /* IBM Token Ring (All types)            */
  123. #define PNPnetworket "IBM0010"       /* IBM Ethernet used by Power PC         */
  124. #define PNPneteisaet "IBM2001"       /* IBM Ethernet EISA adapter             */
  125. #define PNPAMD79C970 "IBM0016"       /* AMD 79C970 (PCI Ethernet)             */
  126. /* SCSI controllers */
  127. #define PNPscsi0     "PNPA000"       /* Adaptec 154x Compatible SCSI Cntlr    */
  128. #define PNPscsi1     "PNPA001"       /* Adaptec 174x Compatible SCSI Cntlr    */
  129. #define PNPscsi2     "PNPA002"       /* Future Domain 16-700 Compat SCSI Cntlr*/
  130. #define PNPscsi3     "PNPA003"       /* Panasonic CDROM Adapter (SBPro/SB16)  */
  131. #define PNPscsiF     "IBM000F"       /* NCR 810 SCSI Controller               */
  132. #define PNPscsi825   "IBM001B"       /* NCR 825 SCSI Controller               */
  133. #define PNPscsi875   "IBM0018"       /* NCR 875 SCSI Controller               */
  134. /* Sound/Video, Multimedia */
  135. #define PNPmm0       "PNPB000"       /* Sound Blaster Compatible Sound Device */
  136. #define PNPmm1       "PNPB001"       /* MS Windows Sound System Compat Device */
  137. #define PNPmmF       "IBM000E"       /* Crystal CS4231 Audio Device           */
  138. #define PNPv7310     "IBM0015"       /* ASCII V7310 Video Capture Device      */
  139. #define PNPmm4232    "IBM0017"       /* Crystal CS4232 Audio Device           */
  140. #define PNPpmsyn     "IBM001D"       /* YMF 289B chip (Yamaha)                */
  141. #define PNPgp4232    "IBM0012"       /* Crystal CS4232 Game Port              */
  142. #define PNPmidi4232  "IBM0013"       /* Crystal CS4232 MIDI                   */
  143. /* Operator Panel */
  144. #define PNPopctl     "IBM000B"       /* Operator's panel                      */
  145. /* Service Processor */
  146. #define PNPsp        "IBM0011"       /* IBM Service Processor                 */
  147. #define PNPLTsp      "IBM001E"       /* Lightning/Terlingua Support Processor */
  148. #define PNPLTmsp     "IBM001F"       /* Lightning/Terlingua Mini-SP           */
  149. /* Memory Controller */
  150. #define PNPmemctl    "IBM000A"       /* Memory controller                     */
  151. /* Graphics Assist */
  152. #define PNPg_assist  "IBM0014"       /* Graphics Assist                       */
  153. /* Miscellaneous Device Controllers */
  154. #define PNPtablet    "IBM0019"       /* IBM Tablet Controller                 */
  155. /* PNP Packet Handles */
  156. #define S1_Packet                0x0A   /* Version resource                   */
  157. #define S2_Packet                0x15   /* Logical DEVID (without flags)      */
  158. #define S2_Packet_flags          0x16   /* Logical DEVID (with flags)         */
  159. #define S3_Packet                0x1C   /* Compatible device ID               */
  160. #define S4_Packet                0x22   /* IRQ resource (without flags)       */
  161. #define S4_Packet_flags          0x23   /* IRQ resource (with flags)          */
  162. #define S5_Packet                0x2A   /* DMA resource                       */
  163. #define S6_Packet                0x30   /* Depend funct start (w/o priority)  */
  164. #define S6_Packet_priority       0x31   /* Depend funct start (w/ priority)   */
  165. #define S7_Packet                0x38   /* Depend funct end                   */
  166. #define S8_Packet                0x47   /* I/O port resource (w/o fixed loc)  */
  167. #define S9_Packet_fixed          0x4B   /* I/O port resource (w/ fixed loc)   */
  168. #define S14_Packet               0x71   /* Vendor defined                     */
  169. #define S15_Packet               0x78   /* End of resource (w/o checksum)     */
  170. #define S15_Packet_checksum      0x79   /* End of resource (w/ checksum)      */
  171. #define L1_Packet                0x81   /* Memory range                       */
  172. #define L1_Shadow                0x20   /* Memory is shadowable               */
  173. #define L1_32bit_mem             0x18   /* 32-bit memory only                 */
  174. #define L1_8_16bit_mem           0x10   /* 8- and 16-bit supported            */
  175. #define L1_Decode_Hi             0x04   /* decode supports high address       */
  176. #define L1_Cache                 0x02   /* read cacheable, write-through      */
  177. #define L1_Writeable             0x01   /* Memory is writeable                */
  178. #define L2_Packet                0x82   /* ANSI ID string                     */
  179. #define L3_Packet                0x83   /* Unicode ID string                  */
  180. #define L4_Packet                0x84   /* Vendor defined                     */
  181. #define L5_Packet                0x85   /* Large I/O                          */
  182. #define L6_Packet                0x86   /* 32-bit Fixed Loc Mem Range Desc    */
  183. #define END_TAG                  0x78   /* End of resource                    */
  184. #define DF_START_TAG             0x30   /* Dependent function start           */
  185. #define DF_START_TAG_priority    0x31   /* Dependent function start           */
  186. #define DF_END_TAG               0x38   /* Dependent function end             */
  187. #define SUBOPTIMAL_CONFIGURATION 0x2    /* Priority byte sub optimal config   */
  188. /* Device Base Type Codes */
  189. typedef enum _PnP_BASE_TYPE {
  190.   Reserved = 0,
  191.   MassStorageDevice = 1,
  192.   NetworkInterfaceController = 2,
  193.   DisplayController = 3,
  194.   MultimediaController = 4,
  195.   MemoryController = 5,
  196.   BridgeController = 6,
  197.   CommunicationsDevice = 7,
  198.   SystemPeripheral = 8,
  199.   InputDevice = 9,
  200.   ServiceProcessor = 0x0A,              /* 11/2/95                            */
  201.   } PnP_BASE_TYPE;
  202. /* Device Sub Type Codes */
  203. typedef enum _PnP_SUB_TYPE {
  204.   SCSIController = 0,
  205.   IDEController = 1,
  206.   FloppyController = 2,
  207.   IPIController = 3,
  208.   OtherMassStorageController = 0x80,
  209.   EthernetController = 0,
  210.   TokenRingController = 1,
  211.   FDDIController = 2,
  212.   OtherNetworkController = 0x80,
  213.   VGAController= 0,
  214.   SVGAController= 1,
  215.   XGAController= 2,
  216.   OtherDisplayController = 0x80,
  217.   VideoController = 0,
  218.   AudioController = 1,
  219.   OtherMultimediaController = 0x80,
  220.   RAM = 0,
  221.   FLASH = 1,
  222.   OtherMemoryDevice = 0x80,
  223.   HostProcessorBridge = 0,
  224.   ISABridge = 1,
  225.   EISABridge = 2,
  226.   MicroChannelBridge = 3,
  227.   PCIBridge = 4,
  228.   PCMCIABridge = 5,
  229.   VMEBridge = 6,
  230.   OtherBridgeDevice = 0x80,
  231.   RS232Device = 0,
  232.   ATCompatibleParallelPort = 1,
  233.   OtherCommunicationsDevice = 0x80,
  234.   ProgrammableInterruptController = 0,
  235.   DMAController = 1,
  236.   SystemTimer = 2,
  237.   RealTimeClock = 3,
  238.   L2Cache = 4,
  239.   NVRAM = 5,
  240.   PowerManagement = 6,
  241.   CMOS = 7,
  242.   OperatorPanel = 8,
  243.   ServiceProcessorClass1 = 9,
  244.   ServiceProcessorClass2 = 0xA,
  245.   ServiceProcessorClass3 = 0xB,
  246.   GraphicAssist = 0xC,
  247.   SystemPlanar = 0xF,                   /* 10/5/95                            */
  248.   OtherSystemPeripheral = 0x80,
  249.   KeyboardController = 0,
  250.   Digitizer = 1,
  251.   MouseController = 2,
  252.   TabletController = 3,                 /* 10/27/95                           */
  253.   OtherInputController = 0x80,
  254.   GeneralMemoryController = 0,
  255.   } PnP_SUB_TYPE;
  256. /* Device Interface Type Codes */
  257. typedef enum _PnP_INTERFACE {
  258.   General = 0,
  259.   GeneralSCSI = 0,
  260.   GeneralIDE = 0,
  261.   ATACompatible = 1,
  262.   GeneralFloppy = 0,
  263.   Compatible765 = 1,
  264.   NS398_Floppy = 2,                     /* NS Super I/O wired to use index
  265.                                            register at port 398 and data
  266.                                            register at port 399               */
  267.   NS26E_Floppy = 3,                     /* Ports 26E and 26F                  */
  268.   NS15C_Floppy = 4,                     /* Ports 15C and 15D                  */
  269.   NS2E_Floppy = 5,                      /* Ports 2E and 2F                    */
  270.   CHRP_Floppy = 6,                      /* CHRP Floppy in PR*P system         */
  271.   GeneralIPI = 0,
  272.   GeneralEther = 0,
  273.   GeneralToken = 0,
  274.   GeneralFDDI = 0,
  275.   GeneralVGA = 0,
  276.   GeneralSVGA = 0,
  277.   GeneralXGA = 0,
  278.   GeneralVideo = 0,
  279.   GeneralAudio = 0,
  280.   CS4232Audio = 1,                      /* CS 4232 Plug 'n Play Configured    */
  281.   GeneralRAM = 0,
  282.   GeneralFLASH = 0,
  283.   PCIMemoryController = 0,              /* PCI Config Method                  */
  284.   RS6KMemoryController = 1,             /* RS6K Config Method                 */
  285.   GeneralHostBridge = 0,
  286.   GeneralISABridge = 0,
  287.   GeneralEISABridge = 0,
  288.   GeneralMCABridge = 0,
  289.   GeneralPCIBridge = 0,
  290.   PCIBridgeDirect = 0,
  291.   PCIBridgeIndirect = 1,
  292.   PCIBridgeRS6K = 2,
  293.   GeneralPCMCIABridge = 0,
  294.   GeneralVMEBridge = 0,
  295.   GeneralRS232 = 0,
  296.   COMx = 1,
  297.   Compatible16450 = 2,
  298.   Compatible16550 = 3,
  299.   NS398SerPort = 4,                     /* NS Super I/O wired to use index
  300.                                            register at port 398 and data
  301.                                            register at port 399               */
  302.   NS26ESerPort = 5,                     /* Ports 26E and 26F                  */
  303.   NS15CSerPort = 6,                     /* Ports 15C and 15D                  */
  304.   NS2ESerPort = 7,                      /* Ports 2E and 2F                    */
  305.   GeneralParPort = 0,
  306.   LPTx = 1,
  307.   NS398ParPort = 2,                     /* NS Super I/O wired to use index
  308.                                            register at port 398 and data
  309.                                            register at port 399               */
  310.   NS26EParPort = 3,                     /* Ports 26E and 26F                  */
  311.   NS15CParPort = 4,                     /* Ports 15C and 15D                  */
  312.   NS2EParPort = 5,                      /* Ports 2E and 2F                    */
  313.   GeneralPIC = 0,
  314.   ISA_PIC = 1,
  315.   EISA_PIC = 2,
  316.   MPIC = 3,
  317.   RS6K_PIC = 4,
  318.   GeneralDMA = 0,
  319.   ISA_DMA = 1,
  320.   EISA_DMA = 2,
  321.   GeneralTimer = 0,
  322.   ISA_Timer = 1,
  323.   EISA_Timer = 2,
  324.   GeneralRTC = 0,
  325.   ISA_RTC = 1,
  326.   StoreThruOnly = 1,
  327.   StoreInEnabled = 2,
  328.   RS6KL2Cache = 3,
  329.   IndirectNVRAM = 0,                    /* Indirectly addressed               */
  330.   DirectNVRAM = 1,                      /* Memory Mapped                      */
  331.   IndirectNVRAM24 = 2,                  /* Indirectly addressed - 24 bit      */
  332.   GeneralPowerManagement = 0,
  333.   EPOWPowerManagement = 1,
  334.   PowerControl = 2,                    // d1378
  335.   GeneralCMOS = 0,
  336.   GeneralOPPanel = 0,
  337.   HarddiskLight = 1,
  338.   CDROMLight = 2,
  339.   PowerLight = 3,
  340.   KeyLock = 4,
  341.   ANDisplay = 5,                        /* AlphaNumeric Display               */
  342.   SystemStatusLED = 6,                  /* 3 digit 7 segment LED              */
  343.   CHRP_SystemStatusLED = 7,             /* CHRP LEDs in PR*P system           */
  344.   GeneralServiceProcessor = 0,
  345.   TransferData = 1,
  346.   IGMC32 = 2,
  347.   IGMC64 = 3,
  348.   GeneralSystemPlanar = 0,              /* 10/5/95                            */
  349.   } PnP_INTERFACE;
  350. /* PnP resources */
  351. /* Compressed ASCII is 5 bits per char; 00001=A ... 11010=Z */
  352. typedef struct _SERIAL_ID {
  353.   unsigned char VendorID0;              /*    Bit(7)=0                        */
  354.                                         /*    Bits(6:2)=1st character in      */
  355.                                         /*       compressed ASCII             */
  356.                                         /*    Bits(1:0)=2nd character in      */
  357.                                         /*       compressed ASCII bits(4:3)   */
  358.   unsigned char VendorID1;              /*    Bits(7:5)=2nd character in      */
  359.                                         /*       compressed ASCII bits(2:0)   */
  360.                                         /*    Bits(4:0)=3rd character in      */
  361.                                         /*       compressed ASCII             */
  362.   unsigned char VendorID2;              /* Product number - vendor assigned   */
  363.   unsigned char VendorID3;              /* Product number - vendor assigned   */
  364. /* Serial number is to provide uniqueness if more than one board of same      */
  365. /* type is in system.  Must be "FFFFFFFF" if feature not supported.           */
  366.   unsigned char Serial0;                /* Unique serial number bits (7:0)    */
  367.   unsigned char Serial1;                /* Unique serial number bits (15:8)   */
  368.   unsigned char Serial2;                /* Unique serial number bits (23:16)  */
  369.   unsigned char Serial3;                /* Unique serial number bits (31:24)  */
  370.   unsigned char Checksum;
  371.   } SERIAL_ID;
  372. typedef enum _PnPItemName {
  373.   Unused = 0,
  374.   PnPVersion = 1,
  375.   LogicalDevice = 2,
  376.   CompatibleDevice = 3,
  377.   IRQFormat = 4,
  378.   DMAFormat = 5,
  379.   StartDepFunc = 6,
  380.   EndDepFunc = 7,
  381.   IOPort = 8,
  382.   FixedIOPort = 9,
  383.   Res1 = 10,
  384.   Res2 = 11,
  385.   Res3 = 12,
  386.   SmallVendorItem = 14,
  387.   EndTag = 15,
  388.   MemoryRange = 1,
  389.   ANSIIdentifier = 2,
  390.   UnicodeIdentifier = 3,
  391.   LargeVendorItem = 4,
  392.   MemoryRange32 = 5,
  393.   MemoryRangeFixed32 = 6,
  394.   } PnPItemName;
  395. /* Define a bunch of access functions for the bits in the tag field */
  396. /* Tag type - 0 = small; 1 = large */
  397. #define tag_type(t) (((t) & 0x80)>>7)
  398. #define set_tag_type(t,v) (t = (t & 0x7f) | ((v)<<7))
  399. /* Small item name is 4 bits - one of PnPItemName enum above */
  400. #define tag_small_item_name(t) (((t) & 0x78)>>3)
  401. #define set_tag_small_item_name(t,v) (t = (t & 0x07) | ((v)<<3))
  402. /* Small item count is 3 bits - count of further bytes in packet */
  403. #define tag_small_count(t) ((t) & 0x07)
  404. #define set_tag_count(t,v) (t = (t & 0x78) | (v))
  405. /* Large item name is 7 bits - one of PnPItemName enum above */
  406. #define tag_large_item_name(t) ((t) & 0x7f)
  407. #define set_tag_large_item_name(t,v) (t = (t | 0x80) | (v))
  408. /* a PnP resource is a bunch of contiguous TAG packets ending with an end tag */
  409. typedef union _PnP_TAG_PACKET {
  410.   struct _S1_Pack{                      /* VERSION PACKET                     */
  411.     unsigned char Tag;                  /* small tag = 0x0a                   */
  412.     unsigned char Version[2];           /* PnP version, Vendor version        */
  413.     } S1_Pack;
  414.   struct _S2_Pack{                      /* LOGICAL DEVICE ID PACKET           */
  415.     unsigned char Tag;                  /* small tag = 0x15 or 0x16           */
  416.     unsigned char DevId[4];             /* Logical device id                  */
  417.     unsigned char Flags[2];             /* bit(0) boot device;                */
  418.                                         /* bit(7:1) cmd in range x31-x37      */
  419.                                         /* bit(7:0) cmd in range x28-x3f (opt)*/
  420.     } S2_Pack;
  421.   struct _S3_Pack{                      /* COMPATIBLE DEVICE ID PACKET        */
  422.     unsigned char Tag;                  /* small tag = 0x1c                   */
  423.     unsigned char CompatId[4];          /* Compatible device id               */
  424.     } S3_Pack;
  425.   struct _S4_Pack{                      /* IRQ PACKET                         */
  426.     unsigned char Tag;                  /* small tag = 0x22 or 0x23           */
  427.     unsigned char IRQMask[2];           /* bit(0) is IRQ0, ...;               */
  428.                                         /* bit(0) is IRQ8 ...                 */
  429.     unsigned char IRQInfo;              /* optional; assume bit(0)=1; else    */
  430.                                         /*  bit(0) - high true edge sensitive */
  431.                                         /*  bit(1) - low true edge sensitive  */
  432.                                         /*  bit(2) - high true level sensitive*/
  433.                                         /*  bit(3) - low true level sensitive */
  434.                                         /*  bit(7:4) - must be 0              */
  435.     } S4_Pack;
  436.   struct _S5_Pack{                      /* DMA PACKET                         */
  437.     unsigned char Tag;                  /* small tag = 0x2a                   */
  438.     unsigned char DMAMask;              /* bit(0) is channel 0 ...            */
  439.     unsigned char DMAInfo;
  440.     } S5_Pack;
  441.   struct _S6_Pack{                      /* START DEPENDENT FUNCTION PACKET    */
  442.     unsigned char Tag;                  /* small tag = 0x30 or 0x31           */
  443.     unsigned char Priority;             /* Optional; if missing then x01; else*/
  444.                                         /*  x00 = best possible               */
  445.                                         /*  x01 = acceptible                  */
  446.                                         /*  x02 = sub-optimal but functional  */
  447.     } S6_Pack;
  448.   struct _S7_Pack{                      /* END DEPENDENT FUNCTION PACKET      */
  449.     unsigned char Tag;                  /* small tag = 0x38                   */
  450.     } S7_Pack;
  451.   struct _S8_Pack{                      /* VARIABLE I/O PORT PACKET           */
  452.     unsigned char Tag;                  /* small tag x47                      */
  453.     unsigned char IOInfo;               /* x0  = decode only bits(9:0);       */
  454. #define  ISAAddr16bit         0x01      /* x01 = decode bits(15:0)            */
  455.     unsigned char RangeMin[2];          /* Min base address                   */
  456.     unsigned char RangeMax[2];          /* Max base address                   */
  457.     unsigned char IOAlign;              /* base alignmt, incr in 1B blocks    */
  458.     unsigned char IONum;                /* number of contiguous I/O ports     */
  459.     } S8_Pack;
  460.   struct _S9_Pack{                      /* FIXED I/O PORT PACKET              */
  461.     unsigned char Tag;                  /* small tag = 0x4b                   */
  462.     unsigned char Range[2];             /* base address 10 bits               */
  463.     unsigned char IONum;                /* number of contiguous I/O ports     */
  464.     } S9_Pack;
  465.   struct _S14_Pack{                     /* VENDOR DEFINED PACKET              */
  466.     unsigned char Tag;                  /* small tag = 0x7m m = 1-7           */
  467.     union _S14_Data{
  468.       unsigned char Data[7];            /* Vendor defined                     */
  469.       struct _S14_PPCPack{              /* Pr*p s14 pack                      */
  470.          unsigned char Type;            /* 00=non-IBM                         */
  471.          unsigned char PPCData[6];      /* Vendor defined                     */
  472.         } S14_PPCPack;
  473.       } S14_Data;
  474.     } S14_Pack;
  475.   struct _S15_Pack{                     /* END PACKET                         */
  476.     unsigned char Tag;                  /* small tag = 0x78 or 0x79           */
  477.     unsigned char Check;                /* optional - checksum                */
  478.     } S15_Pack;
  479.   struct _L1_Pack{                      /* MEMORY RANGE PACKET                */
  480.     unsigned char Tag;                  /* large tag = 0x81                   */
  481.     unsigned char Count0;               /* x09                                */
  482.     unsigned char Count1;               /* x00                                */
  483.     unsigned char Data[9];              /* a variable array of bytes,         */
  484.                                         /* count in tag                       */
  485.     } L1_Pack;
  486.   struct _L2_Pack{                      /* ANSI ID STRING PACKET              */
  487.     unsigned char Tag;                  /* large tag = 0x82                   */
  488.     unsigned char Count0;               /* Length of string                   */
  489.     unsigned char Count1;
  490.     unsigned char Identifier[1];        /* a variable array of bytes,         */
  491.                                         /* count in tag                       */
  492.     } L2_Pack;
  493.   struct _L3_Pack{                      /* UNICODE ID STRING PACKET           */
  494.     unsigned char Tag;                  /* large tag = 0x83                   */
  495.     unsigned char Count0;               /* Length + 2 of string               */
  496.     unsigned char Count1;
  497.     unsigned char Country0;             /* TBD                                */
  498.     unsigned char Country1;             /* TBD                                */
  499.     unsigned char Identifier[1];        /* a variable array of bytes,         */
  500.                                         /* count in tag                       */
  501.     } L3_Pack;
  502.   struct _L4_Pack{                      /* VENDOR DEFINED PACKET              */
  503.     unsigned char Tag;                  /* large tag = 0x84                   */
  504.     unsigned char Count0;
  505.     unsigned char Count1;
  506.     union _L4_Data{
  507.       unsigned char Data[1];            /* a variable array of bytes,         */
  508.                                         /* count in tag                       */
  509.       struct _L4_PPCPack{               /* Pr*p L4 packet                     */
  510.          unsigned char Type;            /* 00=non-IBM                         */
  511.          unsigned char PPCData[1];      /* a variable array of bytes,         */
  512.                                         /* count in tag                       */
  513.         } L4_PPCPack;
  514.       } L4_Data;
  515.     } L4_Pack;
  516.   struct _L5_Pack{
  517.     unsigned char Tag;                  /* large tag = 0x85                   */
  518.     unsigned char Count0;               /* Count = 17                         */
  519.     unsigned char Count1;
  520.     unsigned char Data[17];
  521.     } L5_Pack;
  522.   struct _L6_Pack{
  523.     unsigned char Tag;                  /* large tag = 0x86                   */
  524.     unsigned char Count0;               /* Count = 9                          */
  525.     unsigned char Count1;
  526.     unsigned char Data[9];
  527.     } L6_Pack;
  528.   } PnP_TAG_PACKET;
  529. #endif /* __ASSEMBLY__ */
  530. #endif  /* ndef _PNP_ */
  531. #endif /* __KERNEL__ */