关于pci_dev的定义

在Linux2.6中 pci_dev在哪儿定义的呢?
位置是/include/linux/pci/pci.h

内容为:
struct pci_dev {
  struct pci_dev *next;   /* Next device in the chain */
  u16 domain;    /* PCI domain (host bridge) */
  u8 bus, dev, func;   /* Bus inside domain, device and function */

  /* These fields are set by pci_fill_info() */
  int known_fields;   /* Set of info fields already known */
  u16 vendor_id, device_id;  /* Identity of the device */
  u16 device_class;   /* PCI device class */
  int irq;    /* IRQ number */
  pciaddr_t base_addr[6];  /* Base addresses */
  pciaddr_t size[6];   /* Region sizes */
  pciaddr_t rom_base_addr;  /* Expansion ROM base address */
  pciaddr_t rom_size;   /* Expansion ROM size */

  /* Fields used internally: */
  struct pci_access *access;
  struct pci_methods *methods;
  u8 *cache;    /* Cached config registers */
  int cache_len;
  int hdrtype;    /* Cached low 7 bits of header type, -1 if unknown */
  void *aux;    /* Auxillary data */
};

和以前的版本并不相同。

Linux2.4中定义与 /inlcude/linux/pci.h
内容为:
struct pci_dev {
            struct list_head global_list;
            struct list_head bus_list;
            struct pci_bus  *bus;
            struct pci_bus  *subordinate;
            void        *sysdata;
            struct proc_dir_entry *procent;
            unsigned int    devfn;
            unsigned short  vendor;
            unsigned short  device;
            unsigned short  subsystem_vendor;
            unsigned short  subsystem_device;
            unsigned int    class;
            u8      hdr_type;
            u8      rom_base_reg;
            struct pci_driver *driver;
            void        *driver_data;
            u64     dma_mask;
            u32             current_state;
            unsigned short vendor_compatible[DEVICE_COUNT_COMPATIBLE];
            unsigned short device_compatible[DEVICE_COUNT_COMPATIBLE];
            unsigned int    irq;
            struct resource resource[DEVICE_COUNT_RESOURCE];
            struct resource dma_resource[DEVICE_COUNT_DMA];
            struct resource irq_resource[DEVICE_COUNT_IRQ];
            char        name[80];
            char        slot_name[8];
            int     active;
            int     ro;
            unsigned short  regs;
            int (*prepare)(struct pci_dev *dev);
            int (*activate)(struct pci_dev *dev);
            int (*deactivate)(struct pci_dev *dev);
            };
            



posted on 2008-06-17 17:14  YZG  阅读(3289)  评论(1编辑  收藏  举报

导航