Back to home page

LXR

 
 

    


File indexing completed on 2025-05-11 08:23:53

0001 /* 11/02/95                                                                   */
0002 /*----------------------------------------------------------------------------*/
0003 /*      Plug and Play header definitions                                      */
0004 /*----------------------------------------------------------------------------*/
0005 
0006 /* Structure map for PnP on PowerPC Reference Platform                        */
0007 /* See Plug and Play ISA Specification, Version 1.0, May 28, 1993.  It        */
0008 /* (or later versions) is available on Compuserve in the PLUGPLAY area.       */
0009 /* This code has extensions to that specification, namely new short and       */
0010 /* long tag types for platform dependent information                          */
0011 
0012 /* Warning: LE notation used throughout this file                             */
0013 
0014 /* For enum's: if given in hex then they are bit significant, i.e.            */
0015 /* only one bit is on for each enum                                           */
0016 
0017 
0018 #ifndef _PNP_
0019 #define _PNP_
0020 
0021 #ifndef ASM
0022 #define MAX_MEM_REGISTERS 9
0023 #define MAX_IO_PORTS 20
0024 #define MAX_IRQS 7
0025 /*#define MAX_DMA_CHANNELS 7*/
0026 
0027 /* Interrupt controllers */
0028 
0029 #define PNPinterrupt0 "PNP0000"      /* AT Interrupt Controller               */
0030 #define PNPinterrupt1 "PNP0001"      /* EISA Interrupt Controller             */
0031 #define PNPinterrupt2 "PNP0002"      /* MCA Interrupt Controller              */
0032 #define PNPinterrupt3 "PNP0003"      /* APIC                                  */
0033 #define PNPExtInt     "IBM000D"      /* PowerPC Extended Interrupt Controller */
0034 
0035 /* Timers */
0036 
0037 #define PNPtimer0     "PNP0100"      /* AT Timer                              */
0038 #define PNPtimer1     "PNP0101"      /* EISA Timer                            */
0039 #define PNPtimer2     "PNP0102"      /* MCA Timer                             */
0040 
0041 /* DMA controllers */
0042 
0043 #define PNPdma0       "PNP0200"      /* AT DMA Controller                     */
0044 #define PNPdma1       "PNP0201"      /* EISA DMA Controller                   */
0045 #define PNPdma2       "PNP0202"      /* MCA DMA Controller                    */
0046 
0047 /* start of August 15, 1994 additions */
0048 /* CMOS */
0049 #define PNPCMOS       "IBM0009"      /* CMOS                                  */
0050 
0051 /* L2 Cache */
0052 #define PNPL2         "IBM0007"      /* L2 Cache                              */
0053 
0054 /* NVRAM */
0055 #define PNPNVRAM      "IBM0008"      /* NVRAM                                 */
0056 
0057 /* Power Management */
0058 #define PNPPM         "IBM0005"      /* Power Management                      */
0059 /* end of August 15, 1994 additions */
0060 
0061 /* Keyboards */
0062 
0063 #define PNPkeyboard0  "PNP0300"      /* IBM PC/XT KB Cntlr (83 key, no mouse) */
0064 #define PNPkeyboard1  "PNP0301"      /* Olivetti ICO (102 key)                */
0065 #define PNPkeyboard2  "PNP0302"      /* IBM PC/AT KB Cntlr (84 key)           */
0066 #define PNPkeyboard3  "PNP0303"      /* IBM Enhanced (101/2 key, PS/2 mouse)  */
0067 #define PNPkeyboard4  "PNP0304"      /* Nokia 1050 KB Cntlr                   */
0068 #define PNPkeyboard5  "PNP0305"      /* Nokia 9140 KB Cntlr                   */
0069 #define PNPkeyboard6  "PNP0306"      /* Standard Japanese KB Cntlr            */
0070 #define PNPkeyboard7  "PNP0307"      /* Microsoft Windows (R) KB Cntlr        */
0071 
0072 /* Parallel port controllers */
0073 
0074 #define PNPparallel0 "PNP0400"       /* Standard LPT Parallel Port            */
0075 #define PNPparallel1 "PNP0401"       /* ECP Parallel Port                     */
0076 #define PNPepp       "IBM001C"       /* EPP Parallel Port                     */
0077 
0078 /* Serial port controllers */
0079 
0080 #define PNPserial0   "PNP0500"       /* Standard PC Serial port               */
0081 #define PNPSerial1   "PNP0501"       /* 16550A Compatible Serial port         */
0082 
0083 /* Disk controllers */
0084 
0085 #define PNPdisk0     "PNP0600"       /* Generic ESDI/IDE/ATA Compat HD Cntlr  */
0086 #define PNPdisk1     "PNP0601"       /* Plus Hardcard II                      */
0087 #define PNPdisk2     "PNP0602"       /* Plus Hardcard IIXL/EZ                 */
0088 
0089 /* Diskette controllers */
0090 
0091 #define PNPdiskette0 "PNP0700"       /* PC Standard Floppy Disk Controller    */
0092 
0093 /* Display controllers */
0094 
0095 #define PNPdisplay0  "PNP0900"       /* VGA Compatible                        */
0096 #define PNPdisplay1  "PNP0901"       /* Video Seven VGA                       */
0097 #define PNPdisplay2  "PNP0902"       /* 8514/A Compatible                     */
0098 #define PNPdisplay3  "PNP0903"       /* Trident VGA                           */
0099 #define PNPdisplay4  "PNP0904"       /* Cirrus Logic Laptop VGA               */
0100 #define PNPdisplay5  "PNP0905"       /* Cirrus Logic VGA                      */
0101 #define PNPdisplay6  "PNP0906"       /* Tseng ET4000 or ET4000/W32            */
0102 #define PNPdisplay7  "PNP0907"       /* Western Digital VGA                   */
0103 #define PNPdisplay8  "PNP0908"       /* Western Digital Laptop VGA            */
0104 #define PNPdisplay9  "PNP0909"       /* S3                                    */
0105 #define PNPdisplayA  "PNP090A"       /* ATI Ultra Pro/Plus (Mach 32)          */
0106 #define PNPdisplayB  "PNP090B"       /* ATI Ultra (Mach 8)                    */
0107 #define PNPdisplayC  "PNP090C"       /* XGA Compatible                        */
0108 #define PNPdisplayD  "PNP090D"       /* ATI VGA Wonder                        */
0109 #define PNPdisplayE  "PNP090E"       /* Weitek P9000 Graphics Adapter         */
0110 #define PNPdisplayF  "PNP090F"       /* Oak Technology VGA                    */
0111 
0112 /* Peripheral busses */
0113 
0114 #define PNPbuses0    "PNP0A00"       /* ISA Bus                               */
0115 #define PNPbuses1    "PNP0A01"       /* EISA Bus                              */
0116 #define PNPbuses2    "PNP0A02"       /* MCA Bus                               */
0117 #define PNPbuses3    "PNP0A03"       /* PCI Bus                               */
0118 #define PNPbuses4    "PNP0A04"       /* VESA/VL Bus                           */
0119 
0120 /* RTC, BIOS, planar devices */
0121 
0122 #define PNPspeaker0  "PNP0800"       /* AT Style Speaker Sound                */
0123 #define PNPrtc0      "PNP0B00"       /* AT RTC                                */
0124 #define PNPpnpbios0  "PNP0C00"       /* PNP BIOS (only created by root enum)  */
0125 #define PNPpnpbios1  "PNP0C01"       /* System Board Memory Device            */
0126 #define PNPpnpbios2  "PNP0C02"       /* Math Coprocessor                      */
0127 #define PNPpnpbios3  "PNP0C03"       /* PNP BIOS Event Notification Interrupt */
0128 
0129 /* PCMCIA controller */
0130 
0131 #define PNPpcmcia0   "PNP0E00"       /* Intel 82365 Compatible PCMCIA Cntlr   */
0132 
0133 /* Mice */
0134 
0135 #define PNPmouse0    "PNP0F00"       /* Microsoft Bus Mouse                   */
0136 #define PNPmouse1    "PNP0F01"       /* Microsoft Serial Mouse                */
0137 #define PNPmouse2    "PNP0F02"       /* Microsoft Inport Mouse                */
0138 #define PNPmouse3    "PNP0F03"       /* Microsoft PS/2 Mouse                  */
0139 #define PNPmouse4    "PNP0F04"       /* Mousesystems Mouse                    */
0140 #define PNPmouse5    "PNP0F05"       /* Mousesystems 3 Button Mouse - COM2    */
0141 #define PNPmouse6    "PNP0F06"       /* Genius Mouse - COM1                   */
0142 #define PNPmouse7    "PNP0F07"       /* Genius Mouse - COM2                   */
0143 #define PNPmouse8    "PNP0F08"       /* Logitech Serial Mouse                 */
0144 #define PNPmouse9    "PNP0F09"       /* Microsoft Ballpoint Serial Mouse      */
0145 #define PNPmouseA    "PNP0F0A"       /* Microsoft PNP Mouse                   */
0146 #define PNPmouseB    "PNP0F0B"       /* Microsoft PNP Ballpoint Mouse         */
0147 
0148 /* Modems */
0149 
0150 #define PNPmodem0    "PNP9000"       /* Specific IDs TBD                      */
0151 
0152 /* Network controllers */
0153 
0154 #define PNPnetworkC9 "PNP80C9"       /* IBM Token Ring                        */
0155 #define PNPnetworkCA "PNP80CA"       /* IBM Token Ring II                     */
0156 #define PNPnetworkCB "PNP80CB"       /* IBM Token Ring II/Short               */
0157 #define PNPnetworkCC "PNP80CC"       /* IBM Token Ring 4/16Mbs                */
0158 #define PNPnetwork27 "PNP8327"       /* IBM Token Ring (All types)            */
0159 #define PNPnetworket "IBM0010"       /* IBM Ethernet used by Power PC         */
0160 #define PNPneteisaet "IBM2001"       /* IBM Ethernet EISA adapter             */
0161 #define PNPAMD79C970 "IBM0016"       /* AMD 79C970 (PCI Ethernet)             */
0162 
0163 /* SCSI controllers */
0164 
0165 #define PNPscsi0     "PNPA000"       /* Adaptec 154x Compatible SCSI Cntlr    */
0166 #define PNPscsi1     "PNPA001"       /* Adaptec 174x Compatible SCSI Cntlr    */
0167 #define PNPscsi2     "PNPA002"       /* Future Domain 16-700 Compat SCSI Cntlr*/
0168 #define PNPscsi3     "PNPA003"       /* Panasonic CDROM Adapter (SBPro/SB16)  */
0169 #define PNPscsiF     "IBM000F"       /* NCR 810 SCSI Controller               */
0170 #define PNPscsi825   "IBM001B"       /* NCR 825 SCSI Controller               */
0171 #define PNPscsi875   "IBM0018"       /* NCR 875 SCSI Controller               */
0172 
0173 /* Sound/Video, Multimedia */
0174 
0175 #define PNPmm0       "PNPB000"       /* Sound Blaster Compatible Sound Device */
0176 #define PNPmm1       "PNPB001"       /* MS Windows Sound System Compat Device */
0177 #define PNPmmF       "IBM000E"       /* Crystal CS4231 Audio Device           */
0178 #define PNPv7310     "IBM0015"       /* ASCII V7310 Video Capture Device      */
0179 #define PNPmm4232    "IBM0017"       /* Crystal CS4232 Audio Device           */
0180 #define PNPpmsyn     "IBM001D"       /* YMF 289B chip (Yamaha)                */
0181 #define PNPgp4232    "IBM0012"       /* Crystal CS4232 Game Port              */
0182 #define PNPmidi4232  "IBM0013"       /* Crystal CS4232 MIDI                   */
0183 
0184 /* Operator Panel */
0185 #define PNPopctl     "IBM000B"       /* Operator's panel                      */
0186 
0187 /* Service Processor */
0188 #define PNPsp        "IBM0011"       /* IBM Service Processor                 */
0189 #define PNPLTsp      "IBM001E"       /* Lightning/Terlingua Support Processor */
0190 #define PNPLTmsp     "IBM001F"       /* Lightning/Terlingua Mini-SP           */
0191 
0192 /* Memory Controller */
0193 #define PNPmemctl    "IBM000A"       /* Memory controller                     */
0194 
0195 /* Graphics Assist */
0196 #define PNPg_assist  "IBM0014"       /* Graphics Assist                       */
0197 
0198 /* Miscellaneous Device Controllers */
0199 #define PNPtablet    "IBM0019"       /* IBM Tablet Controller                 */
0200 
0201 /* PNP Packet Handles */
0202 
0203 #define S1_Packet                0x0A   /* Version resource                   */
0204 #define S2_Packet                0x15   /* Logical DEVID (without flags)      */
0205 #define S2_Packet_flags          0x16   /* Logical DEVID (with flags)         */
0206 #define S3_Packet                0x1C   /* Compatible device ID               */
0207 #define S4_Packet                0x22   /* IRQ resource (without flags)       */
0208 #define S4_Packet_flags          0x23   /* IRQ resource (with flags)          */
0209 #define S5_Packet                0x2A   /* DMA resource                       */
0210 #define S6_Packet                0x30   /* Depend funct start (w/o priority)  */
0211 #define S6_Packet_priority       0x31   /* Depend funct start (w/ priority)   */
0212 #define S7_Packet                0x38   /* Depend funct end                   */
0213 #define S8_Packet                0x47   /* I/O port resource (w/o fixed loc)  */
0214 #define S9_Packet_fixed          0x4B   /* I/O port resource (w/ fixed loc)   */
0215 #define S14_Packet               0x71   /* Vendor defined                     */
0216 #define S15_Packet               0x78   /* End of resource (w/o checksum)     */
0217 #define S15_Packet_checksum      0x79   /* End of resource (w/ checksum)      */
0218 #define L1_Packet                0x81   /* Memory range                       */
0219 #define L1_Shadow                0x20   /* Memory is shadowable               */
0220 #define L1_32bit_mem             0x18   /* 32-bit memory only                 */
0221 #define L1_8_16bit_mem           0x10   /* 8- and 16-bit supported            */
0222 #define L1_Decode_Hi             0x04   /* decode supports high address       */
0223 #define L1_Cache                 0x02   /* read cacheable, write-through      */
0224 #define L1_Writeable             0x01   /* Memory is writeable                */
0225 #define L2_Packet                0x82   /* ANSI ID string                     */
0226 #define L3_Packet                0x83   /* Unicode ID string                  */
0227 #define L4_Packet                0x84   /* Vendor defined                     */
0228 #define L5_Packet                0x85   /* Large I/O                          */
0229 #define L6_Packet                0x86   /* 32-bit Fixed Loc Mem Range Desc    */
0230 #define END_TAG                  0x78   /* End of resource                    */
0231 #define DF_START_TAG             0x30   /* Dependent function start           */
0232 #define DF_START_TAG_priority    0x31   /* Dependent function start           */
0233 #define DF_END_TAG               0x38   /* Dependent function end             */
0234 #define SUBOPTIMAL_CONFIGURATION 0x2    /* Priority byte sub optimal config   */
0235 
0236 /* Device Base Type Codes */
0237 
0238 typedef enum _PnP_BASE_TYPE {
0239   Reserved = 0,
0240   MassStorageDevice = 1,
0241   NetworkInterfaceController = 2,
0242   DisplayController = 3,
0243   MultimediaController = 4,
0244   MemoryController = 5,
0245   BridgeController = 6,
0246   CommunicationsDevice = 7,
0247   SystemPeripheral = 8,
0248   InputDevice = 9,
0249   ServiceProcessor = 0x0A,              /* 11/2/95                            */
0250   } PnP_BASE_TYPE;
0251 
0252 /* Device Sub Type Codes */
0253 
0254 typedef enum _PnP_SUB_TYPE {
0255   SCSIController = 0,
0256   IDEController = 1,
0257   FloppyController = 2,
0258   IPIController = 3,
0259   OtherMassStorageController = 0x80,
0260 
0261   EthernetController = 0,
0262   TokenRingController = 1,
0263   FDDIController = 2,
0264   OtherNetworkController = 0x80,
0265 
0266   VGAController= 0,
0267   SVGAController= 1,
0268   XGAController= 2,
0269   OtherDisplayController = 0x80,
0270 
0271   VideoController = 0,
0272   AudioController = 1,
0273   OtherMultimediaController = 0x80,
0274 
0275   RAM = 0,
0276   FLASH = 1,
0277   OtherMemoryDevice = 0x80,
0278 
0279   HostProcessorBridge = 0,
0280   ISABridge = 1,
0281   EISABridge = 2,
0282   MicroChannelBridge = 3,
0283   PCIBridge = 4,
0284   PCMCIABridge = 5,
0285   VMEBridge = 6,
0286   OtherBridgeDevice = 0x80,
0287 
0288   RS232Device = 0,
0289   ATCompatibleParallelPort = 1,
0290   OtherCommunicationsDevice = 0x80,
0291 
0292   ProgrammableInterruptController = 0,
0293   DMAController = 1,
0294   SystemTimer = 2,
0295   RealTimeClock = 3,
0296   L2Cache = 4,
0297   NVRAM = 5,
0298   PowerManagement = 6,
0299   CMOS = 7,
0300   OperatorPanel = 8,
0301   ServiceProcessorClass1 = 9,
0302   ServiceProcessorClass2 = 0xA,
0303   ServiceProcessorClass3 = 0xB,
0304   GraphicAssist = 0xC,
0305   SystemPlanar = 0xF,                   /* 10/5/95                            */
0306   OtherSystemPeripheral = 0x80,
0307 
0308   KeyboardController = 0,
0309   Digitizer = 1,
0310   MouseController = 2,
0311   TabletController = 3,                 /* 10/27/95                           */
0312   OtherInputController = 0x80,
0313 
0314   GeneralMemoryController = 0,
0315   } PnP_SUB_TYPE;
0316 
0317 /* Device Interface Type Codes */
0318 
0319 typedef enum _PnP_INTERFACE {
0320   General = 0,
0321   GeneralSCSI = 0,
0322   GeneralIDE = 0,
0323   ATACompatible = 1,
0324 
0325   GeneralFloppy = 0,
0326   Compatible765 = 1,
0327   NS398_Floppy = 2,                     /* NS Super I/O wired to use index
0328                                            register at port 398 and data
0329                                            register at port 399               */
0330   NS26E_Floppy = 3,                     /* Ports 26E and 26F                  */
0331   NS15C_Floppy = 4,                     /* Ports 15C and 15D                  */
0332   NS2E_Floppy = 5,                      /* Ports 2E and 2F                    */
0333   CHRP_Floppy = 6,                      /* CHRP Floppy in PR*P system         */
0334 
0335   GeneralIPI = 0,
0336 
0337   GeneralEther = 0,
0338   GeneralToken = 0,
0339   GeneralFDDI = 0,
0340 
0341   GeneralVGA = 0,
0342   GeneralSVGA = 0,
0343   GeneralXGA = 0,
0344 
0345   GeneralVideo = 0,
0346   GeneralAudio = 0,
0347   CS4232Audio = 1,                      /* CS 4232 Plug 'n Play Configured    */
0348 
0349   GeneralRAM = 0,
0350   GeneralFLASH = 0,
0351   PCIMemoryController = 0,              /* PCI Config Method                  */
0352   RS6KMemoryController = 1,             /* RS6K Config Method                 */
0353 
0354   GeneralHostBridge = 0,
0355   GeneralISABridge = 0,
0356   GeneralEISABridge = 0,
0357   GeneralMCABridge = 0,
0358   GeneralPCIBridge = 0,
0359   PCIBridgeDirect = 0,
0360   PCIBridgeIndirect = 1,
0361   PCIBridgeRS6K = 2,
0362   GeneralPCMCIABridge = 0,
0363   GeneralVMEBridge = 0,
0364 
0365   GeneralRS232 = 0,
0366   COMx = 1,
0367   Compatible16450 = 2,
0368   Compatible16550 = 3,
0369   NS398SerPort = 4,                     /* NS Super I/O wired to use index
0370                                            register at port 398 and data
0371                                            register at port 399               */
0372   NS26ESerPort = 5,                     /* Ports 26E and 26F                  */
0373   NS15CSerPort = 6,                     /* Ports 15C and 15D                  */
0374   NS2ESerPort = 7,                      /* Ports 2E and 2F                    */
0375 
0376   GeneralParPort = 0,
0377   LPTx = 1,
0378   NS398ParPort = 2,                     /* NS Super I/O wired to use index
0379                                            register at port 398 and data
0380                                            register at port 399               */
0381   NS26EParPort = 3,                     /* Ports 26E and 26F                  */
0382   NS15CParPort = 4,                     /* Ports 15C and 15D                  */
0383   NS2EParPort = 5,                      /* Ports 2E and 2F                    */
0384 
0385   GeneralPIC = 0,
0386   ISA_PIC = 1,
0387   EISA_PIC = 2,
0388   MPIC = 3,
0389   RS6K_PIC = 4,
0390 
0391   GeneralDMA = 0,
0392   ISA_DMA = 1,
0393   EISA_DMA = 2,
0394 
0395   GeneralTimer = 0,
0396   ISA_Timer = 1,
0397   EISA_Timer = 2,
0398   GeneralRTC = 0,
0399   ISA_RTC = 1,
0400 
0401   StoreThruOnly = 1,
0402   StoreInEnabled = 2,
0403   RS6KL2Cache = 3,
0404 
0405   IndirectNVRAM = 0,                    /* Indirectly addressed               */
0406   DirectNVRAM = 1,                      /* Memory Mapped                      */
0407   IndirectNVRAM24 = 2,                  /* Indirectly addressed - 24 bit      */
0408 
0409   GeneralPowerManagement = 0,
0410   EPOWPowerManagement = 1,
0411   PowerControl = 2,                    /* d1378                   */
0412 
0413   GeneralCMOS = 0,
0414 
0415   GeneralOPPanel = 0,
0416   HarddiskLight = 1,
0417   CDROMLight = 2,
0418   PowerLight = 3,
0419   KeyLock = 4,
0420   ANDisplay = 5,                        /* AlphaNumeric Display               */
0421   SystemStatusLED = 6,                  /* 3 digit 7 segment LED              */
0422   CHRP_SystemStatusLED = 7,             /* CHRP LEDs in PR*P system           */
0423 
0424   GeneralServiceProcessor = 0,
0425 
0426   TransferData = 1,
0427   IGMC32 = 2,
0428   IGMC64 = 3,
0429 
0430   GeneralSystemPlanar = 0,              /* 10/5/95                            */
0431 
0432   } PnP_INTERFACE;
0433 
0434 /* PnP resources */
0435 
0436 /* Compressed ASCII is 5 bits per char; 00001=A ... 11010=Z */
0437 
0438 typedef struct _SERIAL_ID {
0439   unsigned char VendorID0;              /*    Bit(7)=0                        */
0440                                         /*    Bits(6:2)=1st character in      */
0441                                         /*       compressed ASCII             */
0442                                         /*    Bits(1:0)=2nd character in      */
0443                                         /*       compressed ASCII bits(4:3)   */
0444   unsigned char VendorID1;              /*    Bits(7:5)=2nd character in      */
0445                                         /*       compressed ASCII bits(2:0)   */
0446                                         /*    Bits(4:0)=3rd character in      */
0447                                         /*       compressed ASCII             */
0448   unsigned char VendorID2;              /* Product number - vendor assigned   */
0449   unsigned char VendorID3;              /* Product number - vendor assigned   */
0450 
0451 /* Serial number is to provide uniqueness if more than one board of same      */
0452 /* type is in system.  Must be "FFFFFFFF" if feature not supported.           */
0453 
0454   unsigned char Serial0;                /* Unique serial number bits (7:0)    */
0455   unsigned char Serial1;                /* Unique serial number bits (15:8)   */
0456   unsigned char Serial2;                /* Unique serial number bits (23:16)  */
0457   unsigned char Serial3;                /* Unique serial number bits (31:24)  */
0458   unsigned char Checksum;
0459   } SERIAL_ID;
0460 
0461 typedef enum _PnPItemName {
0462   Unused = 0,
0463   PnPVersion = 1,
0464   LogicalDevice = 2,
0465   CompatibleDevice = 3,
0466   IRQFormat = 4,
0467   DMAFormat = 5,
0468   StartDepFunc = 6,
0469   EndDepFunc = 7,
0470   IOPort = 8,
0471   FixedIOPort = 9,
0472   Res1 = 10,
0473   Res2 = 11,
0474   Res3 = 12,
0475   SmallVendorItem = 14,
0476   EndTag = 15,
0477   MemoryRange = 1,
0478   ANSIIdentifier = 2,
0479   UnicodeIdentifier = 3,
0480   LargeVendorItem = 4,
0481   MemoryRange32 = 5,
0482   MemoryRangeFixed32 = 6,
0483   } PnPItemName;
0484 
0485 /* Define a bunch of access functions for the bits in the tag field */
0486 
0487 /* Tag type - 0 = small; 1 = large */
0488 #define tag_type(t) (((t) & 0x80)>>7)
0489 #define set_tag_type(t,v) (t = (t & 0x7f) | ((v)<<7))
0490 
0491 /* Small item name is 4 bits - one of PnPItemName enum above */
0492 #define tag_small_item_name(t) (((t) & 0x78)>>3)
0493 #define set_tag_small_item_name(t,v) (t = (t & 0x07) | ((v)<<3))
0494 
0495 /* Small item count is 3 bits - count of further bytes in packet */
0496 #define tag_small_count(t) ((t) & 0x07)
0497 #define set_tag_count(t,v) (t = (t & 0x78) | (v))
0498 
0499 /* Large item name is 7 bits - one of PnPItemName enum above */
0500 #define tag_large_item_name(t) ((t) & 0x7f)
0501 #define set_tag_large_item_name(t,v) (t = (t | 0x80) | (v))
0502 
0503 /* a PnP resource is a bunch of contiguous TAG packets ending with an end tag */
0504 
0505 typedef union _PnP_TAG_PACKET {
0506   struct _S1_Pack{                      /* VERSION PACKET                     */
0507     unsigned char Tag;                  /* small tag = 0x0a                   */
0508     unsigned char Version[2];           /* PnP version, Vendor version        */
0509     } S1_Pack;
0510 
0511   struct _S2_Pack{                      /* LOGICAL DEVICE ID PACKET           */
0512     unsigned char Tag;                  /* small tag = 0x15 or 0x16           */
0513     unsigned char DevId[4];             /* Logical device id                  */
0514     unsigned char Flags[2];             /* bit(0) boot device;                */
0515                                         /* bit(7:1) cmd in range x31-x37      */
0516                                         /* bit(7:0) cmd in range x28-x3f (opt)*/
0517     } S2_Pack;
0518 
0519   struct _S3_Pack{                      /* COMPATIBLE DEVICE ID PACKET        */
0520     unsigned char Tag;                  /* small tag = 0x1c                   */
0521     unsigned char CompatId[4];          /* Compatible device id               */
0522     } S3_Pack;
0523 
0524   struct _S4_Pack{                      /* IRQ PACKET                         */
0525     unsigned char Tag;                  /* small tag = 0x22 or 0x23           */
0526     unsigned char IRQMask[2];           /* bit(0) is IRQ0, ...;               */
0527                                         /* bit(0) is IRQ8 ...                 */
0528     unsigned char IRQInfo;              /* optional; assume bit(0)=1; else    */
0529                                         /*  bit(0) - high true edge sensitive */
0530                                         /*  bit(1) - low true edge sensitive  */
0531                                         /*  bit(2) - high true level sensitive*/
0532                                         /*  bit(3) - low true level sensitive */
0533                                         /*  bit(7:4) - must be 0              */
0534     } S4_Pack;
0535 
0536   struct _S5_Pack{                      /* DMA PACKET                         */
0537     unsigned char Tag;                  /* small tag = 0x2a                   */
0538     unsigned char DMAMask;              /* bit(0) is channel 0 ...            */
0539     unsigned char DMAInfo;
0540     } S5_Pack;
0541 
0542   struct _S6_Pack{                      /* START DEPENDENT FUNCTION PACKET    */
0543     unsigned char Tag;                  /* small tag = 0x30 or 0x31           */
0544     unsigned char Priority;             /* Optional; if missing then x01; else*/
0545                                         /*  x00 = best possible               */
0546                                         /*  x01 = acceptible                  */
0547                                         /*  x02 = sub-optimal but functional  */
0548     } S6_Pack;
0549 
0550   struct _S7_Pack{                      /* END DEPENDENT FUNCTION PACKET      */
0551     unsigned char Tag;                  /* small tag = 0x38                   */
0552     } S7_Pack;
0553 
0554   struct _S8_Pack{                      /* VARIABLE I/O PORT PACKET           */
0555     unsigned char Tag;                  /* small tag x47                      */
0556     unsigned char IOInfo;               /* x0  = decode only bits(9:0);       */
0557 #define  ISAAddr16bit         0x01      /* x01 = decode bits(15:0)            */
0558     unsigned char RangeMin[2];          /* Min base address                   */
0559     unsigned char RangeMax[2];          /* Max base address                   */
0560     unsigned char IOAlign;              /* base alignmt, incr in 1B blocks    */
0561     unsigned char IONum;                /* number of contiguous I/O ports     */
0562     } S8_Pack;
0563 
0564   struct _S9_Pack{                      /* FIXED I/O PORT PACKET              */
0565     unsigned char Tag;                  /* small tag = 0x4b                   */
0566     unsigned char Range[2];             /* base address 10 bits               */
0567     unsigned char IONum;                /* number of contiguous I/O ports     */
0568     } S9_Pack;
0569 
0570   struct _S14_Pack{                     /* VENDOR DEFINED PACKET              */
0571     unsigned char Tag;                  /* small tag = 0x7m m = 1-7           */
0572     union _S14_Data{
0573       unsigned char Data[7];            /* Vendor defined                     */
0574       struct _S14_PPCPack{              /* Pr*p s14 pack                      */
0575          unsigned char Type;            /* 00=non-IBM                         */
0576          unsigned char PPCData[6];      /* Vendor defined                     */
0577         } S14_PPCPack;
0578       } S14_Data;
0579     } S14_Pack;
0580 
0581   struct _S15_Pack{                     /* END PACKET                         */
0582     unsigned char Tag;                  /* small tag = 0x78 or 0x79           */
0583     unsigned char Check;                /* optional - checksum                */
0584     } S15_Pack;
0585 
0586   struct _L1_Pack{                      /* MEMORY RANGE PACKET                */
0587     unsigned char Tag;                  /* large tag = 0x81                   */
0588     unsigned char Count0;               /* x09                                */
0589     unsigned char Count1;               /* x00                                */
0590     unsigned char Data[9];              /* a variable array of bytes,         */
0591                                         /* count in tag                       */
0592     } L1_Pack;
0593 
0594   struct _L2_Pack{                      /* ANSI ID STRING PACKET              */
0595     unsigned char Tag;                  /* large tag = 0x82                   */
0596     unsigned char Count0;               /* Length of string                   */
0597     unsigned char Count1;
0598     unsigned char Identifier[1];        /* a variable array of bytes,         */
0599                                         /* count in tag                       */
0600     } L2_Pack;
0601 
0602   struct _L3_Pack{                      /* UNICODE ID STRING PACKET           */
0603     unsigned char Tag;                  /* large tag = 0x83                   */
0604     unsigned char Count0;               /* Length + 2 of string               */
0605     unsigned char Count1;
0606     unsigned char Country0;             /* TBD                                */
0607     unsigned char Country1;             /* TBD                                */
0608     unsigned char Identifier[1];        /* a variable array of bytes,         */
0609                                         /* count in tag                       */
0610     } L3_Pack;
0611 
0612   struct _L4_Pack{                      /* VENDOR DEFINED PACKET              */
0613     unsigned char Tag;                  /* large tag = 0x84                   */
0614     unsigned char Count0;
0615     unsigned char Count1;
0616     union _L4_Data{
0617       unsigned char Data[1];            /* a variable array of bytes,         */
0618                                         /* count in tag                       */
0619       struct _L4_PPCPack{               /* Pr*p L4 packet                     */
0620          unsigned char Type;            /* 00=non-IBM                         */
0621          unsigned char PPCData[1];      /* a variable array of bytes,         */
0622                                         /* count in tag                       */
0623         } L4_PPCPack;
0624       } L4_Data;
0625     } L4_Pack;
0626 
0627   struct _L5_Pack{
0628     unsigned char Tag;                  /* large tag = 0x85                   */
0629     unsigned char Count0;               /* Count = 17                         */
0630     unsigned char Count1;
0631     unsigned char Data[17];
0632     } L5_Pack;
0633 
0634   struct _L6_Pack{
0635     unsigned char Tag;                  /* large tag = 0x86                   */
0636     unsigned char Count0;               /* Count = 9                          */
0637     unsigned char Count1;
0638     unsigned char Data[9];
0639     } L6_Pack;
0640 
0641   } PnP_TAG_PACKET;
0642 
0643 #endif /* ASM */
0644 #endif  /* ndef _PNP_ */