📄 pci.h
字号:
#define PCI_DEVICE_ID_LAVA_PARALLEL 0x8000#define PCI_DEVICE_ID_LAVA_DUAL_PAR_A 0x8002 /* The Lava Dual Parallel is */#define PCI_DEVICE_ID_LAVA_DUAL_PAR_B 0x8003 /* two PCI devices on a card */#define PCI_VENDOR_ID_SYMPHONY 0x1c1c#define PCI_DEVICE_ID_SYMPHONY_101 0x0001#define PCI_VENDOR_ID_TEKRAM 0x1de1#define PCI_DEVICE_ID_TEKRAM_DC290 0xdc29#define PCI_VENDOR_ID_3DLABS 0x3d3d#define PCI_DEVICE_ID_3DLABS_300SX 0x0001#define PCI_DEVICE_ID_3DLABS_500TX 0x0002#define PCI_DEVICE_ID_3DLABS_DELTA 0x0003#define PCI_DEVICE_ID_3DLABS_PERMEDIA 0x0004#define PCI_DEVICE_ID_3DLABS_MX 0x0006#define PCI_DEVICE_ID_3DLABS_PERMEDIA2 0x0007#define PCI_DEVICE_ID_3DLABS_GAMMA 0x0008#define PCI_DEVICE_ID_3DLABS_PERMEDIA2V 0x0009#define PCI_VENDOR_ID_AVANCE 0x4005#define PCI_DEVICE_ID_AVANCE_ALG2064 0x2064#define PCI_DEVICE_ID_AVANCE_2302 0x2302#define PCI_VENDOR_ID_NETVIN 0x4a14#define PCI_DEVICE_ID_NETVIN_NV5000SC 0x5000#define PCI_VENDOR_ID_S3 0x5333#define PCI_DEVICE_ID_S3_PLATO_PXS 0x0551#define PCI_DEVICE_ID_S3_ViRGE 0x5631#define PCI_DEVICE_ID_S3_TRIO 0x8811#define PCI_DEVICE_ID_S3_AURORA64VP 0x8812#define PCI_DEVICE_ID_S3_TRIO64UVP 0x8814#define PCI_DEVICE_ID_S3_ViRGE_VX 0x883d#define PCI_DEVICE_ID_S3_868 0x8880#define PCI_DEVICE_ID_S3_928 0x88b0#define PCI_DEVICE_ID_S3_864_1 0x88c0#define PCI_DEVICE_ID_S3_864_2 0x88c1#define PCI_DEVICE_ID_S3_964_1 0x88d0#define PCI_DEVICE_ID_S3_964_2 0x88d1#define PCI_DEVICE_ID_S3_968 0x88f0#define PCI_DEVICE_ID_S3_TRIO64V2 0x8901#define PCI_DEVICE_ID_S3_PLATO_PXG 0x8902#define PCI_DEVICE_ID_S3_ViRGE_DXGX 0x8a01#define PCI_DEVICE_ID_S3_ViRGE_GX2 0x8a10#define PCI_DEVICE_ID_S3_ViRGE_MX 0x8c01#define PCI_DEVICE_ID_S3_ViRGE_MXP 0x8c02#define PCI_DEVICE_ID_S3_ViRGE_MXPMV 0x8c03#define PCI_DEVICE_ID_S3_SONICVIBES 0xca00#define PCI_VENDOR_ID_DCI 0x6666#define PCI_DEVICE_ID_DCI_PCCOM4 0x0001#define PCI_VENDOR_ID_GENROCO 0x5555#define PCI_DEVICE_ID_GENROCO_HFP832 0x0003#define PCI_VENDOR_ID_INTEL 0x8086#define PCI_DEVICE_ID_INTEL_21145 0x0039#define PCI_DEVICE_ID_INTEL_82375 0x0482#define PCI_DEVICE_ID_INTEL_82424 0x0483#define PCI_DEVICE_ID_INTEL_82378 0x0484#define PCI_DEVICE_ID_INTEL_82430 0x0486#define PCI_DEVICE_ID_INTEL_82434 0x04a3#define PCI_DEVICE_ID_INTEL_I960 0x0960#define PCI_DEVICE_ID_INTEL_82092AA_0 0x1221#define PCI_DEVICE_ID_INTEL_82092AA_1 0x1222#define PCI_DEVICE_ID_INTEL_7116 0x1223#define PCI_DEVICE_ID_INTEL_82596 0x1226#define PCI_DEVICE_ID_INTEL_82865 0x1227#define PCI_DEVICE_ID_INTEL_82557 0x1229#define PCI_DEVICE_ID_INTEL_82437 0x122d#define PCI_DEVICE_ID_INTEL_82371FB_0 0x122e#define PCI_DEVICE_ID_INTEL_82371FB_1 0x1230#define PCI_DEVICE_ID_INTEL_82371MX 0x1234#define PCI_DEVICE_ID_INTEL_82437MX 0x1235#define PCI_DEVICE_ID_INTEL_82441 0x1237#define PCI_DEVICE_ID_INTEL_82380FB 0x124b#define PCI_DEVICE_ID_INTEL_82439 0x1250#define PCI_DEVICE_ID_INTEL_MEGARAID 0x1960#define PCI_DEVICE_ID_INTEL_82371SB_0 0x7000#define PCI_DEVICE_ID_INTEL_82371SB_1 0x7010#define PCI_DEVICE_ID_INTEL_82371SB_2 0x7020#define PCI_DEVICE_ID_INTEL_82437VX 0x7030#define PCI_DEVICE_ID_INTEL_82439TX 0x7100#define PCI_DEVICE_ID_INTEL_82371AB_0 0x7110#define PCI_DEVICE_ID_INTEL_82371AB 0x7111#define PCI_DEVICE_ID_INTEL_82371AB_2 0x7112#define PCI_DEVICE_ID_INTEL_82371AB_3 0x7113#define PCI_DEVICE_ID_INTEL_82443LX_0 0x7180#define PCI_DEVICE_ID_INTEL_82443LX_1 0x7181#define PCI_DEVICE_ID_INTEL_82443BX_0 0x7190#define PCI_DEVICE_ID_INTEL_82443BX_1 0x7191#define PCI_DEVICE_ID_INTEL_82443BX_2 0x7192#define PCI_DEVICE_ID_INTEL_P6 0x84c4#define PCI_DEVICE_ID_INTEL_82450GX 0x84c4#define PCI_DEVICE_ID_INTEL_82453GX 0x84c5#define PCI_DEVICE_ID_INTEL_82451NX 0x84ca#define PCI_DEVICE_ID_INTEL_82454NX 0x84cb#define PCI_VENDOR_ID_COMPUTONE 0x8e0e#define PCI_DEVICE_ID_COMPUTONE_IP2EX 0x0291#define PCI_VENDOR_ID_KTI 0x8e2e#define PCI_DEVICE_ID_KTI_ET32P2 0x3000#define PCI_VENDOR_ID_ADAPTEC 0x9004#define PCI_DEVICE_ID_ADAPTEC_7810 0x1078#define PCI_DEVICE_ID_ADAPTEC_7821 0x2178#define PCI_DEVICE_ID_ADAPTEC_38602 0x3860#define PCI_DEVICE_ID_ADAPTEC_7850 0x5078#define PCI_DEVICE_ID_ADAPTEC_7855 0x5578#define PCI_DEVICE_ID_ADAPTEC_5800 0x5800#define PCI_DEVICE_ID_ADAPTEC_3860 0x6038#define PCI_DEVICE_ID_ADAPTEC_1480A 0x6075#define PCI_DEVICE_ID_ADAPTEC_7860 0x6078#define PCI_DEVICE_ID_ADAPTEC_7861 0x6178#define PCI_DEVICE_ID_ADAPTEC_7870 0x7078#define PCI_DEVICE_ID_ADAPTEC_7871 0x7178#define PCI_DEVICE_ID_ADAPTEC_7872 0x7278#define PCI_DEVICE_ID_ADAPTEC_7873 0x7378#define PCI_DEVICE_ID_ADAPTEC_7874 0x7478#define PCI_DEVICE_ID_ADAPTEC_7895 0x7895#define PCI_DEVICE_ID_ADAPTEC_7880 0x8078#define PCI_DEVICE_ID_ADAPTEC_7881 0x8178#define PCI_DEVICE_ID_ADAPTEC_7882 0x8278#define PCI_DEVICE_ID_ADAPTEC_7883 0x8378#define PCI_DEVICE_ID_ADAPTEC_7884 0x8478#define PCI_DEVICE_ID_ADAPTEC_7885 0x8578#define PCI_DEVICE_ID_ADAPTEC_7886 0x8678#define PCI_DEVICE_ID_ADAPTEC_7887 0x8778#define PCI_DEVICE_ID_ADAPTEC_7888 0x8878#define PCI_DEVICE_ID_ADAPTEC_1030 0x8b78#define PCI_VENDOR_ID_ADAPTEC2 0x9005#define PCI_DEVICE_ID_ADAPTEC2_2940U2 0x0010#define PCI_DEVICE_ID_ADAPTEC2_2930U2 0x0011#define PCI_DEVICE_ID_ADAPTEC2_7890B 0x0013#define PCI_DEVICE_ID_ADAPTEC2_7890 0x001f#define PCI_DEVICE_ID_ADAPTEC2_3940U2 0x0050#define PCI_DEVICE_ID_ADAPTEC2_3950U2D 0x0051#define PCI_DEVICE_ID_ADAPTEC2_7896 0x005f#define PCI_DEVICE_ID_ADAPTEC2_7892A 0x0080#define PCI_DEVICE_ID_ADAPTEC2_7892B 0x0081#define PCI_DEVICE_ID_ADAPTEC2_7892D 0x0083#define PCI_DEVICE_ID_ADAPTEC2_7892P 0x008f#define PCI_DEVICE_ID_ADAPTEC2_7899A 0x00c0#define PCI_DEVICE_ID_ADAPTEC2_7899B 0x00c1#define PCI_DEVICE_ID_ADAPTEC2_7899D 0x00c3#define PCI_DEVICE_ID_ADAPTEC2_7899P 0x00cf#define PCI_VENDOR_ID_ATRONICS 0x907f#define PCI_DEVICE_ID_ATRONICS_2015 0x2015#define PCI_VENDOR_ID_HOLTEK 0x9412#define PCI_DEVICE_ID_HOLTEK_6565 0x6565#define PCI_VENDOR_ID_TIGERJET 0xe159#define PCI_DEVICE_ID_TIGERJET_300 0x0001#define PCI_VENDOR_ID_ARK 0xedd8#define PCI_DEVICE_ID_ARK_STING 0xa091#define PCI_DEVICE_ID_ARK_STINGARK 0xa099#define PCI_DEVICE_ID_ARK_2000MT 0xa0a1#define PCI_VENDOR_ID_INTERPHASE 0x107e#define PCI_DEVICE_ID_INTERPHASE_5526 0x0004#define PCI_DEVICE_ID_INTERPHASE_55x6 0x0005/* * The PCI interface treats multi-function devices as independent * devices. The slot/function address of each device is encoded * in a single byte as follows: * * 7:3 = slot * 2:0 = function */#define PCI_DEVFN(slot,func) ((((slot) & 0x1f) << 3) | ((func) & 0x07))#define PCI_SLOT(devfn) (((devfn) >> 3) & 0x1f)#define PCI_FUNC(devfn) ((devfn) & 0x07)#ifdef __KERNEL__#include <linux/types.h>#include <linux/config.h>/* * There is one pci_dev structure for each slot-number/function-number * combination: */struct pci_dev { struct pci_bus *bus; /* bus this device is on */ struct pci_dev *sibling; /* next device on this bus */ struct pci_dev *next; /* chain of all devices */ void *sysdata; /* hook for sys-specific extension */ struct proc_dir_entry *procent; /* device entry in /proc/bus/pci */ unsigned int devfn; /* encoded device & function index */ unsigned short vendor; unsigned short device; unsigned int class; /* 3 bytes: (base,sub,prog-if) */ unsigned int hdr_type; /* PCI header type */ unsigned int master : 1; /* set if device is master capable */ /* * In theory, the irq level can be read from configuration * space and all would be fine. However, old PCI chips don't * support these registers and return 0 instead. For example, * the Vision864-P rev 0 chip can uses INTA, but returns 0 in * the interrupt line and pin registers. pci_init() * initializes this field with the value at PCI_INTERRUPT_LINE * and it is the job of pcibios_fixup() to change it if * necessary. The field must not be 0 unless the device * cannot generate interrupts at all. */ unsigned int irq; /* irq generated by this device */ /* Base registers for this device, can be adjusted by * pcibios_fixup() as necessary. */ unsigned long base_address[6]; unsigned long rom_address;};struct pci_bus { struct pci_bus *parent; /* parent bus this bridge is on */ struct pci_bus *children; /* chain of P2P bridges on this bus */ struct pci_bus *next; /* chain of all PCI buses */ struct pci_dev *self; /* bridge device as seen by parent */ struct pci_dev *devices; /* devices behind this bridge */ void *sysdata; /* hook for sys-specific extension */ struct proc_dir_entry *procdir; /* directory entry in /proc/bus/pci */ unsigned char number; /* bus number */ unsigned char primary; /* number of primary bridge */ unsigned char secondary; /* number of secondary bridge */ unsigned char subordinate; /* max number of subordinate buses */};extern struct pci_bus pci_root; /* root bus */extern struct pci_dev *pci_devices; /* list of all devices *//* * Error values that may be returned by the PCI bios. */#define PCIBIOS_SUCCESSFUL 0x00#define PCIBIOS_FUNC_NOT_SUPPORTED 0x81#define PCIBIOS_BAD_VENDOR_ID 0x83#define PCIBIOS_DEVICE_NOT_FOUND 0x86#define PCIBIOS_BAD_REGISTER_NUMBER 0x87#define PCIBIOS_SET_FAILED 0x88#define PCIBIOS_BUFFER_TOO_SMALL 0x89/* Low-level architecture-dependent routines */int pcibios_present (void);void pcibios_init(void);void pcibios_fixup(void);void pcibios_fixup_bus(struct pci_bus *);char *pcibios_setup (char *str);int pcibios_read_config_byte (unsigned char bus, unsigned char dev_fn, unsigned char where, unsigned char *val);int pcibios_read_config_word (unsigned char bus, unsigned char dev_fn, unsigned char where, unsigned short *val);int pcibios_read_config_dword (unsigned char bus, unsigned char dev_fn, unsigned char where, unsigned int *val);int pcibios_write_config_byte (unsigned char bus, unsigned char dev_fn, unsigned char where, unsigned char val);int pcibios_write_config_word (unsigned char bus, unsigned char dev_fn, unsigned char where, unsigned short val);int pcibios_write_config_dword (unsigned char bus, unsigned char dev_fn, unsigned char where, unsigned int val);/* Don't use these in new code, use pci_find_... instead */int pcibios_find_class (unsigned int class_code, unsigned short index, unsigned char *bus, unsigned char *dev_fn);int pcibios_find_device (unsigned short vendor, unsigned short dev_id, unsigned short index, unsigned char *bus, unsigned char *dev_fn);/* Generic PCI interface functions */void pci_init(void);void pci_setup(char *str, int *ints);void pci_quirks_init(void);unsigned int pci_scan_bus(struct pci_bus *bus);struct pci_bus *pci_scan_peer_bridge(int bus);void pci_proc_init(void);void proc_old_pci_init(void);int get_pci_list(char *buf);int pci_proc_attach_device(struct pci_dev *dev);int pci_proc_detach_device(struct pci_dev *dev);struct pci_dev *pci_find_device (unsigned int vendor, unsigned int device, struct pci_dev *from);struct pci_dev *pci_find_class (unsigned int class, struct pci_dev *from);struct pci_dev *pci_find_slot (unsigned int bus, unsigned int devfn);#define pci_present pcibios_presentint pci_read_config_byte(struct pci_dev *dev, u8 where, u8 *val);int pci_read_config_word(struct pci_dev *dev, u8 where, u16 *val);int pci_read_config_dword(struct pci_dev *dev, u8 where, u32 *val);int pci_write_config_byte(struct pci_dev *dev, u8 where, u8 val);int pci_write_config_word(struct pci_dev *dev, u8 where, u16 val);int pci_write_config_dword(struct pci_dev *dev, u8 where, u32 val);void pci_set_master(struct pci_dev *dev);#ifndef CONFIG_PCI/* If the system does not have PCI, clearly these return errors. Define these as simple inline functions to avoid hair in drivers. */extern inline int pcibios_present(void) { return 0; }#define _PCI_NOP(o,s,t) \ extern inline int pcibios_##o##_config_##s## (u8 bus, u8 dfn, u8 where, t val) \ { return PCIBIOS_FUNC_NOT_SUPPORTED; } \ extern inline int pci_##o##_config_##s## (struct pci_dev *dev, u8 where, t val) \ { return PCIBIOS_FUNC_NOT_SUPPORTED; }#define _PCI_NOP_ALL(o,x) _PCI_NOP(o,byte,u8 x) \ _PCI_NOP(o,word,u16 x) \ _PCI_NOP(o,dword,u32 x)_PCI_NOP_ALL(read, *)_PCI_NOP_ALL(write,)extern inline struct pci_dev *pci_find_device(unsigned int vendor, unsigned int device, struct pci_dev *from){ return NULL; }extern inline struct pci_dev *pci_find_class(unsigned int class, struct pci_dev *from){ return NULL; }extern inline struct pci_dev *pci_find_slot(unsigned int bus, unsigned int devfn){ return NULL; }extern inline void pci_set_master(struct pci_dev *dev){ return; }#endif /* !CONFIG_PCI */#endif /* __KERNEL__ */#endif /* LINUX_PCI_H */
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -