2 * Block OSM structures/API
4 * Copyright (C) 1999-2002 Red Hat Software
6 * Written by Alan Cox, Building Number Three Ltd
8 * This program is free software; you can redistribute it and/or modify it
9 * under the terms of the GNU General Public License as published by the
10 * Free Software Foundation; either version 2 of the License, or (at your
11 * option) any later version.
13 * This program is distributed in the hope that it will be useful, but
14 * WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 * General Public License for more details.
18 * For the purpose of avoiding doubt the preferred form of the work
19 * for making modifications shall be a standards compliant form such
20 * gzipped tar and not one requiring a proprietary or patent encumbered
25 * Multiple device handling error fixes,
26 * Added a queue depth.
28 * FC920 has an rmw bug. Dont or in the end marker.
29 * Removed queue walk, fixed for 64bitness.
30 * Rewrote much of the code over time
31 * Added indirect block lists
32 * Handle 64K limits on many controllers
33 * Don't use indirects on the Promise (breaks)
34 * Heavily chop down the queue depths
36 * Independent queues per IOP
37 * Support for dynamic device creation/deletion
39 * Support for larger I/Os through merge* functions
40 * (taken from DAC960 driver)
41 * Boji T Kannanthanam:
42 * Set the I2O Block devices to be detected in increasing
43 * order of TIDs during boot.
44 * Search and set the I2O block device that we boot off
45 * from as the first device to be claimed (as /dev/i2o/hda)
46 * Properly attach/detach I2O gendisk structure from the
47 * system gendisk list. The I2O block devices now appear in
49 * Markus Lidel <Markus.Lidel@shadowconnect.com>:
50 * Minor bugfixes for 2.6.
53 #ifndef I2O_BLOCK_OSM_H
54 #define I2O_BLOCK_OSM_H
56 #define I2O_BLOCK_RETRY_TIME HZ/4
57 #define I2O_BLOCK_MAX_OPEN_REQUESTS 50
59 /* I2O Block OSM mempool struct */
60 struct i2o_block_mempool
{
65 /* I2O Block device descriptor */
66 struct i2o_block_device
{
67 struct i2o_device
*i2o_dev
; /* pointer to I2O device */
69 spinlock_t lock
; /* queue lock */
70 struct list_head open_queue
; /* list of transfered, but unfinished
72 unsigned int open_queue_depth
; /* number of requests in the queue */
74 int rcache
; /* read cache flags */
75 int wcache
; /* write cache flags */
77 int power
; /* power state */
78 int media_change_flag
; /* media changed flag */
81 /* I2O Block device request */
82 struct i2o_block_request
84 struct list_head queue
;
85 struct request
*req
; /* corresponding request */
86 struct i2o_block_device
*i2o_blk_dev
; /* I2O block device */
87 int sg_dma_direction
; /* direction of DMA buffer read/write */
88 int sg_nents
; /* number of SG elements */
89 struct scatterlist sg_table
[I2O_MAX_SEGMENTS
]; /* SG table */
92 /* I2O Block device delayed request */
93 struct i2o_block_delayed_request
95 struct work_struct work
;
96 struct request_queue
*queue
;