~ubuntu-branches/ubuntu/precise/pciutils/precise

« back to all changes in this revision

Viewing changes to lib/header.h

  • Committer: Bazaar Package Importer
  • Author(s): Anibal Monsalve Salazar
  • Date: 2010-06-26 14:17:57 UTC
  • mfrom: (2.1.18 sid)
  • Revision ID: james.westby@ubuntu.com-20100626141757-xsp7xqv15qotwels
Tags: 1:3.1.7-4
Update pci.ids with snapshot dated 2010-06-12

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
/*
2
2
 *      The PCI Library -- PCI Header Structure (based on <linux/pci.h>)
3
3
 *
4
 
 *      Copyright (c) 1997--2007 Martin Mares <mj@ucw.cz>
 
4
 *      Copyright (c) 1997--2010 Martin Mares <mj@ucw.cz>
5
5
 *
6
6
 *      Can be freely distributed and used under the terms of the GNU GPL.
7
7
 */
187
187
#define  PCI_CAP_ID_AGP         0x02    /* Accelerated Graphics Port */
188
188
#define  PCI_CAP_ID_VPD         0x03    /* Vital Product Data */
189
189
#define  PCI_CAP_ID_SLOTID      0x04    /* Slot Identification */
190
 
#define  PCI_CAP_ID_MSI         0x05    /* Message Signalled Interrupts */
 
190
#define  PCI_CAP_ID_MSI         0x05    /* Message Signaled Interrupts */
191
191
#define  PCI_CAP_ID_CHSWP       0x06    /* CompactPCI HotSwap */
192
192
#define  PCI_CAP_ID_PCIX        0x07    /* PCI-X */
193
193
#define  PCI_CAP_ID_HT          0x08    /* HyperTransport */
216
216
#define PCI_EXT_CAP_ID_RCILINK  0x06    /* Root Complex Internal Link Declaration */
217
217
#define PCI_EXT_CAP_ID_RCECOLL  0x07    /* Root Complex Event Collector */
218
218
#define PCI_EXT_CAP_ID_MFVC     0x08    /* Multi-Function Virtual Channel */
 
219
#define PCI_EXT_CAP_ID_VC2      0x09    /* Virtual Channel (2nd ID) */
219
220
#define PCI_EXT_CAP_ID_RBCB     0x0a    /* Root Bridge Control Block */
220
221
#define PCI_EXT_CAP_ID_VNDR     0x0b    /* Vendor specific */
221
222
#define PCI_EXT_CAP_ID_ACS      0x0d    /* Access Controls */
 
223
#define PCI_EXT_CAP_ID_ARI      0x0e    /* Alternative Routing-ID Interpretation */
 
224
#define PCI_EXT_CAP_ID_ATS      0x0f    /* Address Translation Service */
 
225
#define PCI_EXT_CAP_ID_SRIOV    0x10    /* Single Root I/O Virtualization */
 
226
 
 
227
/*** Definitions of capabilities ***/
222
228
 
223
229
/* Power Management Registers */
224
230
 
235
241
#define  PCI_PM_CAP_PME_D3_COLD 0x8000  /* PME can be asserted from D3cold */
236
242
#define PCI_PM_CTRL             4       /* PM control and status register */
237
243
#define  PCI_PM_CTRL_STATE_MASK 0x0003  /* Current power state (D0 to D3) */
 
244
#define  PCI_PM_CTRL_NO_SOFT_RST        0x0008  /* No Soft Reset from D3hot to D0 */
238
245
#define  PCI_PM_CTRL_PME_ENABLE 0x0100  /* PME pin enable */
239
246
#define  PCI_PM_CTRL_DATA_SEL_MASK      0x1e00  /* PM table data index */
240
247
#define  PCI_PM_CTRL_DATA_SCALE_MASK    0x6000  /* PM table data scaling factor */
278
285
#define  PCI_AGP_COMMAND_RATE1  0x0001  /* Use 1x rate (4x in AGP3 mode) */
279
286
#define PCI_AGP_SIZEOF          12
280
287
 
 
288
/* Vital Product Data */
 
289
 
 
290
#define PCI_VPD_ADDR            2       /* Address to access (15 bits!) */
 
291
#define  PCI_VPD_ADDR_MASK      0x7fff  /* Address mask */
 
292
#define  PCI_VPD_ADDR_F         0x8000  /* Write 0, 1 indicates completion */
 
293
#define PCI_VPD_DATA            4       /* 32-bits of data returned here */
 
294
 
281
295
/* Slot Identification */
282
296
 
283
297
#define PCI_SID_ESR             2       /* Expansion Slot Register */
285
299
#define  PCI_SID_ESR_FIC        0x20    /* First In Chassis Flag */
286
300
#define PCI_SID_CHASSIS_NR      3       /* Chassis Number */
287
301
 
288
 
/* Message Signalled Interrupts registers */
 
302
/* Message Signaled Interrupts registers */
289
303
 
290
304
#define PCI_MSI_FLAGS           2       /* Various flags */
291
305
#define  PCI_MSI_FLAGS_MASK_BIT 0x100   /* interrupt masking & reporting supported */
698
712
#define PCI_HT_RM_CNT1          10      /* Retry Count 1 Register */
699
713
#define PCI_HT_RM_SIZEOF        12
700
714
 
 
715
/* Vendor-Specific Capability (see PCI_EVNDR_xxx for the PCIe version) */
 
716
#define PCI_VNDR_LENGTH         2       /* Length byte */
 
717
 
701
718
/* PCI Express */
702
719
#define PCI_EXP_FLAGS           0x2     /* Capabilities register */
703
720
#define PCI_EXP_FLAGS_VERS      0x000f  /* Capability version */
825
842
#define  PCI_EXP_RTSTA_PME_REQID   0x0000ffff /* PME Requester ID */
826
843
#define  PCI_EXP_RTSTA_PME_STATUS  0x00010000 /* PME Status */
827
844
#define  PCI_EXP_RTSTA_PME_PENDING 0x00020000 /* PME is Pending */
 
845
#define PCI_EXP_DEVCAP2                 0x24    /* Device capabilities 2 */
 
846
#define PCI_EXP_DEVCTL2                 0x28    /* Device Control */
 
847
#define  PCI_EXP_DEV2_TIMEOUT_RANGE(x)  ((x) & 0xf) /* Completion Timeout Ranges Supported */
 
848
#define  PCI_EXP_DEV2_TIMEOUT_VALUE(x)  ((x) & 0xf) /* Completion Timeout Value */
 
849
#define  PCI_EXP_DEV2_TIMEOUT_DIS       0x0010  /* Completion Timeout Disable Supported */
 
850
#define  PCI_EXP_DEV2_ARI               0x0020  /* ARI Forwarding */
 
851
#define PCI_EXP_DEVSTA2                 0x2a    /* Device Status */
 
852
#define PCI_EXP_LNKCAP2                 0x2c    /* Link Capabilities */
 
853
#define PCI_EXP_LNKCTL2                 0x30    /* Link Control */
 
854
#define  PCI_EXP_LNKCTL2_SPEED(x)       ((x) & 0xf) /* Target Link Speed */
 
855
#define  PCI_EXP_LNKCTL2_CMPLNC         0x0010  /* Enter Compliance */
 
856
#define  PCI_EXP_LNKCTL2_SPEED_DIS      0x0020  /* Hardware Autonomous Speed Disable */
 
857
#define  PCI_EXP_LNKCTL2_DEEMPHASIS(x)  (((x) >> 6) & 1) /* Selectable De-emphasis */
 
858
#define  PCI_EXP_LNKCTL2_MARGIN(x)      (((x) >> 7) & 7) /* Transmit Margin */
 
859
#define  PCI_EXP_LNKCTL2_MOD_CMPLNC     0x0400  /* Enter Modified Compliance */
 
860
#define  PCI_EXP_LNKCTL2_CMPLNC_SOS     0x0800  /* Compliance SOS */
 
861
#define  PCI_EXP_LNKCTL2_COM_DEEMPHASIS(x) (((x) >> 12) & 1) /* Compliance De-emphasis */
 
862
#define PCI_EXP_LNKSTA2                 0x32    /* Link Status */
 
863
#define  PCI_EXP_LINKSTA2_DEEMPHASIS(x) ((x) & 1)       /* Current De-emphasis Level */
 
864
#define PCI_EXP_SLTCAP2                 0x34    /* Slot Capabilities */
 
865
#define PCI_EXP_SLTCTL2                 0x38    /* Slot Control */
 
866
#define PCI_EXP_SLTSTA2                 0x3a    /* Slot Status */
828
867
 
829
868
/* MSI-X */
830
869
#define  PCI_MSIX_ENABLE        0x8000
831
870
#define  PCI_MSIX_MASK          0x4000
832
 
#define  PCI_MSIX_TABSIZE       0x03ff
 
871
#define  PCI_MSIX_TABSIZE       0x07ff
833
872
#define PCI_MSIX_TABLE          4
834
873
#define PCI_MSIX_PBA            8
835
874
#define  PCI_MSIX_BIR           0x7
838
877
#define PCI_SSVID_VENDOR        4
839
878
#define PCI_SSVID_DEVICE        6
840
879
 
 
880
/* PCI Advanced Features */
 
881
#define PCI_AF_CAP              3
 
882
#define  PCI_AF_CAP_TP          0x01
 
883
#define  PCI_AF_CAP_FLR         0x02
 
884
#define PCI_AF_CTRL             4
 
885
#define  PCI_AF_CTRL_FLR        0x01
 
886
#define PCI_AF_STATUS           5
 
887
#define  PCI_AF_STATUS_TP       0x01
 
888
 
 
889
/* SATA Host Bus Adapter */
 
890
#define PCI_SATA_HBA_BARS       4
 
891
#define PCI_SATA_HBA_REG0       8
 
892
 
 
893
/*** Definitions of extended capabilities ***/
 
894
 
841
895
/* Advanced Error Reporting */
842
896
#define PCI_ERR_UNCOR_STATUS    4       /* Uncorrectable Error Status */
843
 
#define  PCI_ERR_UNC_TRAIN      0x00000001      /* Training */
 
897
#define  PCI_ERR_UNC_TRAIN      0x00000001      /* Undefined in PCIe rev1.1 & 2.0 spec */
844
898
#define  PCI_ERR_UNC_DLP        0x00000010      /* Data Link Protocol */
 
899
#define  PCI_ERR_UNC_SDES       0x00000020      /* Surprise Down Error */
845
900
#define  PCI_ERR_UNC_POISON_TLP 0x00001000      /* Poisoned TLP */
846
901
#define  PCI_ERR_UNC_FCP        0x00002000      /* Flow Control Protocol */
847
902
#define  PCI_ERR_UNC_COMP_TIME  0x00004000      /* Completion Timeout */
851
906
#define  PCI_ERR_UNC_MALF_TLP   0x00040000      /* Malformed TLP */
852
907
#define  PCI_ERR_UNC_ECRC       0x00080000      /* ECRC Error Status */
853
908
#define  PCI_ERR_UNC_UNSUP      0x00100000      /* Unsupported Request */
 
909
#define  PCI_ERR_UNC_ACS_VIOL   0x00200000      /* ACS Violation */
854
910
#define PCI_ERR_UNCOR_MASK      8       /* Uncorrectable Error Mask */
855
911
        /* Same bits as above */
856
912
#define PCI_ERR_UNCOR_SEVER     12      /* Uncorrectable Error Severity */
861
917
#define  PCI_ERR_COR_BAD_DLLP   0x00000080      /* Bad DLLP Status */
862
918
#define  PCI_ERR_COR_REP_ROLL   0x00000100      /* REPLAY_NUM Rollover */
863
919
#define  PCI_ERR_COR_REP_TIMER  0x00001000      /* Replay Timer Timeout */
 
920
#define  PCI_ERR_COR_REP_ANFE   0x00002000      /* Advisory Non-Fatal Error */
864
921
#define PCI_ERR_COR_MASK        20      /* Correctable Error Mask */
865
922
        /* Same bits as above */
866
923
#define PCI_ERR_CAP             24      /* Advanced Error Capabilities */
896
953
#define PCI_PWR_CAP             12      /* Capability */
897
954
#define  PCI_PWR_CAP_BUDGET(x)  ((x) & 1)       /* Included in system budget */
898
955
 
 
956
/* Root Complex Link */
 
957
#define PCI_RCLINK_ESD          4       /* Element Self Description */
 
958
#define PCI_RCLINK_LINK1        16      /* First Link Entry */
 
959
#define  PCI_RCLINK_LINK_DESC   0       /* Link Entry: Description */
 
960
#define  PCI_RCLINK_LINK_ADDR   8       /* Link Entry: Address (64-bit) */
 
961
#define  PCI_RCLINK_LINK_SIZE   16      /* Link Entry: sizeof */
 
962
 
 
963
/* PCIe Vendor-Specific Capability */
 
964
#define PCI_EVNDR_HEADER        4       /* Vendor-Specific Header */
 
965
#define PCI_EVNDR_REGISTERS     8       /* Vendor-Specific Registers */
 
966
 
 
967
/* Access Control Services */
 
968
#define PCI_ACS_CAP             0x04    /* ACS Capability Register */
 
969
#define PCI_ACS_CAP_VALID       0x0001  /* ACS Source Validation */
 
970
#define PCI_ACS_CAP_BLOCK       0x0002  /* ACS Translation Blocking */
 
971
#define PCI_ACS_CAP_REQ_RED     0x0004  /* ACS P2P Request Redirect */
 
972
#define PCI_ACS_CAP_CMPLT_RED   0x0008  /* ACS P2P Completion Redirect */
 
973
#define PCI_ACS_CAP_FORWARD     0x0010  /* ACS Upstream Forwarding */
 
974
#define PCI_ACS_CAP_EGRESS      0x0020  /* ACS P2P Egress Control */
 
975
#define PCI_ACS_CAP_TRANS       0x0040  /* ACS Direct Translated P2P */
 
976
#define PCI_ACS_CAP_VECTOR(x)   (((x) >> 8) & 0xff) /* Egress Control Vector Size */
 
977
#define PCI_ACS_CTRL            0x06    /* ACS Control Register */
 
978
#define PCI_ACS_CTRL_VALID      0x0001  /* ACS Source Validation Enable */
 
979
#define PCI_ACS_CTRL_BLOCK      0x0002  /* ACS Translation Blocking Enable */
 
980
#define PCI_ACS_CTRL_REQ_RED    0x0004  /* ACS P2P Request Redirect Enable */
 
981
#define PCI_ACS_CTRL_CMPLT_RED  0x0008  /* ACS P2P Completion Redirect Enable */
 
982
#define PCI_ACS_CTRL_FORWARD    0x0010  /* ACS Upstream Forwarding Enable */
 
983
#define PCI_ACS_CTRL_EGRESS     0x0020  /* ACS P2P Egress Control Enable */
 
984
#define PCI_ACS_CTRL_TRANS      0x0040  /* ACS Direct Translated P2P Enable */
 
985
#define PCI_ACS_EGRESS_CTRL     0x08    /* Egress Control Vector */
 
986
 
 
987
/* Alternative Routing-ID Interpretation */
 
988
#define PCI_ARI_CAP             0x04    /* ARI Capability Register */
 
989
#define  PCI_ARI_CAP_MFVC       0x0001  /* MFVC Function Groups Capability */
 
990
#define  PCI_ARI_CAP_ACS        0x0002  /* ACS Function Groups Capability */
 
991
#define  PCI_ARI_CAP_NFN(x)     (((x) >> 8) & 0xff) /* Next Function Number */
 
992
#define PCI_ARI_CTRL            0x06    /* ARI Control Register */
 
993
#define  PCI_ARI_CTRL_MFVC      0x0001  /* MFVC Function Groups Enable */
 
994
#define  PCI_ARI_CTRL_ACS       0x0002  /* ACS Function Groups Enable */
 
995
#define  PCI_ARI_CTRL_FG(x)     (((x) >> 4) & 7) /* Function Group */
 
996
 
 
997
/* Address Translation Service */
 
998
#define PCI_ATS_CAP             0x04    /* ATS Capability Register */
 
999
#define  PCI_ATS_CAP_IQD(x)     ((x) & 0x1f) /* Invalidate Queue Depth */
 
1000
#define PCI_ATS_CTRL            0x06    /* ATS Control Register */
 
1001
#define  PCI_ATS_CTRL_STU(x)    ((x) & 0x1f) /* Smallest Translation Unit */
 
1002
#define  PCI_ATS_CTRL_ENABLE    0x8000  /* ATS Enable */
 
1003
 
 
1004
/* Single Root I/O Virtualization */
 
1005
#define PCI_IOV_CAP             0x04    /* SR-IOV Capability Register */
 
1006
#define  PCI_IOV_CAP_VFM        0x00000001 /* VF Migration Capable */
 
1007
#define  PCI_IOV_CAP_IMN(x)     ((x) >> 21) /* VF Migration Interrupt Message Number */
 
1008
#define PCI_IOV_CTRL            0x08    /* SR-IOV Control Register */
 
1009
#define  PCI_IOV_CTRL_VFE       0x0001  /* VF Enable */
 
1010
#define  PCI_IOV_CTRL_VFME      0x0002  /* VF Migration Enable */
 
1011
#define  PCI_IOV_CTRL_VFMIE     0x0004  /* VF Migration Interrupt Enable */
 
1012
#define  PCI_IOV_CTRL_MSE       0x0008  /* VF MSE */
 
1013
#define  PCI_IOV_CTRL_ARI       0x0010  /* ARI Capable Hierarchy */
 
1014
#define PCI_IOV_STATUS          0x0a    /* SR-IOV Status Register */
 
1015
#define  PCI_IOV_STATUS_MS      0x0001  /* VF Migration Status */
 
1016
#define PCI_IOV_INITIALVF       0x0c    /* Number of VFs that are initially associated */
 
1017
#define PCI_IOV_TOTALVF         0x0e    /* Maximum number of VFs that could be associated */
 
1018
#define PCI_IOV_NUMVF           0x10    /* Number of VFs that are available */
 
1019
#define PCI_IOV_FDL             0x12    /* Function Dependency Link */
 
1020
#define PCI_IOV_OFFSET          0x14    /* First VF Offset */
 
1021
#define PCI_IOV_STRIDE          0x16    /* Routing ID offset from one VF to the next one */
 
1022
#define PCI_IOV_DID             0x1a    /* VF Device ID */
 
1023
#define PCI_IOV_SUPPS           0x1c    /* Supported Page Sizes */
 
1024
#define PCI_IOV_SYSPS           0x20    /* System Page Size */
 
1025
#define PCI_IOV_BAR_BASE        0x24    /* VF BAR0, VF BAR1, ... VF BAR5 */
 
1026
#define PCI_IOV_NUM_BAR         6       /* Number of VF BARs */
 
1027
#define PCI_IOV_MSAO            0x3c    /* VF Migration State Array Offset */
 
1028
#define PCI_IOV_MSA_BIR(x)      ((x) & 7) /* VF Migration State BIR */
 
1029
#define PCI_IOV_MSA_OFFSET(x)   ((x) & 0xfffffff8) /* VF Migration State Offset */
 
1030
 
899
1031
/*
900
1032
 * The PCI interface treats multi-function devices as independent
901
1033
 * devices.  The slot/function address of each device is encoded