truct tq_struct plug_tq;
/*
* Boolean that indicates whether this queue is plugged or not.
*/
int plugged:1;
/*
* Boolean that indicates whether current_request is active or
* not.
*/
int head_active:1;
/*
* Boolean that indicates you will use blk_started_sectors
* and blk_finished_sectors in addition to blk_started_io
* and blk_finished_io. It enables the throttling code to
* help keep the sectors in flight to a reasonable value
*/
int can_throttle:1;
unsigned long bounce_pfn;
/*
* Is meant to protect the queue in the future instead of
* io_request_lock
*/
spinlock_t queue_lock;
/*
* Tasks wait here for free read and write requests
*/
wait_queue_head_t wait_for_requests;
struct request *last_request;
};
缓冲区和对缓冲区相应的I/O操作在此任务队列中相关联,等待内核的调度.如果是字符设备就不需要此数据结构.而
块设备的read(),write()函数则在buffer_queue的initize和设备请求队列进行处理请求时候传递给request_fn().
struct request_queue_t{}设备请求队列的变量类型,驱动程序在初始化的时候需要填写request_fn().
其他的数据结构还有 I/O port,Irq,DMA 资源分配,符合POSIX标准的ioctl的cmd的构造和定义,以及描述设备自身的
相关数据结构定义-如设备的控制寄存器的相关数据结构定义,BIOS里的参数定义,设备类型定义等.