⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 pci.h.txt

📁 linux内核学习笔记 希望想看的人可以很快下载到
💻 TXT
字号:
any problems,send mail to sindybear@163.com


相关文件
	

**************************基本数据结构*******************************
(1)struct pci_dev {
        struct list_head global_list;   /* 连接所有的pci设备 */
        struct list_head bus_list;      /* 连接在同一条总线上的设备 */
        struct pci_bus  *bus;           /* 该设备所在的总线 */
        struct pci_bus  *subordinate;   /* bus this device bridges to */

        void            *sysdata;       /* hook for sys-specific extension */
        struct proc_dir_entry *procent; /* proc系统中的入口 /proc/bus/pci */

        unsigned int    devfn;          /* encoded device & function index */
        unsigned short  vendor;
        unsigned short  device;
        unsigned short  subsystem_vendor;
        unsigned short  subsystem_device;
        unsigned int    class;          /* 设备所属的类,3个字节 */
        u8              hdr_type;       /* PCI header type (`multi' flag maskedout) */
        u8              rom_base_reg;   /* which config register controls the RM */
        struct pci_driver *driver;      /* which driver has allocated this devie */
	void            *driver_data;   /* 这个设备的私有数据结构 */
        u64             dma_mask;       /* Mask of the bits of bus address this
                                           device implements.  Normally this is
                                           0xffffffff.  You only need to change
                                           this if your device has broken DMA
                                           or supports 64-bit transfers.  */

        u32             current_state;  /* Current operating state. In ACPI-spek,
                                           this is D0-D3, D0 being fully functinal,
                                           and D3 being off. */

        /* device is compatible with these IDs */
        unsigned short vendor_compatible[DEVICE_COUNT_COMPATIBLE];	//4个元素
        unsigned short device_compatible[DEVICE_COUNT_COMPATIBLE];	//4个元素

        /*
         * Instead of touching interrupt line and base address registers
         * directly, use the values stored here. They might be different!
         */
        unsigned int    irq;
        struct resource resource[DEVICE_COUNT_RESOURCE]; // 12个元素,I/O and memory regins + expansion ROMs */
        struct resource dma_resource[DEVICE_COUNT_DMA];	 //两个数组元素
        struct resource irq_resource[DEVICE_COUNT_IRQ];	 //两个IRQ元素
        char            name[80];       /* 设备名称 */
        char            slot_name[8];   /* slot 名 */

	/* 以下是ISA设备的东西 */
        int             active;         /* ISAPnP: device is active */	
        int             ro;             /* ISAPnP: read only */
        unsigned short  regs;           /* ISAPnP: supported registers */

        int (*prepare)(struct pci_dev *dev);    /* ISAPnP 钩子函数 */	
        int (*activate)(struct pci_dev *dev);
        int (*deactivate)(struct pci_dev *dev);
};

(2)struct pci_driver {
        struct list_head node;
        char *name;
        const struct pci_device_id *id_table;   /* NULL if wants all devices */
        int  (*probe)  (struct pci_dev *dev, const struct pci_device_id *id);	/* New device inserted */
        void (*remove) (struct pci_dev *dev);   /* Device removed (NULL if not hot-plug capable driver) */
        int  (*save_state) (struct pci_dev *dev, u32 state);    /* Save Deviceontext */
        int  (*suspend) (struct pci_dev *dev, u32 state);       /* Device suspsded */
        int  (*resume) (struct pci_dev *dev);                   /* Device wokenup */
        int  (*enable_wake) (struct pci_dev *dev, u32 state, int enable);   /*nable wake event */
};


*********************************************************************

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -