/*1* Block OSM structures/API2*3* Copyright (C) 1999-2002 Red Hat Software4*5* Written by Alan Cox, Building Number Three Ltd6*7* This program is free software; you can redistribute it and/or modify it8* under the terms of the GNU General Public License as published by the9* Free Software Foundation; either version 2 of the License, or (at your10* option) any later version.11*12* This program is distributed in the hope that it will be useful, but13* WITHOUT ANY WARRANTY; without even the implied warranty of14* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU15* General Public License for more details.16*17* For the purpose of avoiding doubt the preferred form of the work18* for making modifications shall be a standards compliant form such19* gzipped tar and not one requiring a proprietary or patent encumbered20* tool to unpack.21*22* Fixes/additions:23* Steve Ralston:24* Multiple device handling error fixes,25* Added a queue depth.26* Alan Cox:27* FC920 has an rmw bug. Dont or in the end marker.28* Removed queue walk, fixed for 64bitness.29* Rewrote much of the code over time30* Added indirect block lists31* Handle 64K limits on many controllers32* Don't use indirects on the Promise (breaks)33* Heavily chop down the queue depths34* Deepak Saxena:35* Independent queues per IOP36* Support for dynamic device creation/deletion37* Code cleanup38* Support for larger I/Os through merge* functions39* (taken from DAC960 driver)40* Boji T Kannanthanam:41* Set the I2O Block devices to be detected in increasing42* order of TIDs during boot.43* Search and set the I2O block device that we boot off44* from as the first device to be claimed (as /dev/i2o/hda)45* Properly attach/detach I2O gendisk structure from the46* system gendisk list. The I2O block devices now appear in47* /proc/partitions.48* Markus Lidel <[email protected]>:49* Minor bugfixes for 2.6.50*/5152#ifndef I2O_BLOCK_OSM_H53#define I2O_BLOCK_OSM_H5455#define I2O_BLOCK_RETRY_TIME HZ/456#define I2O_BLOCK_MAX_OPEN_REQUESTS 505758/* request queue sizes */59#define I2O_BLOCK_REQ_MEMPOOL_SIZE 326061#define KERNEL_SECTOR_SHIFT 962#define KERNEL_SECTOR_SIZE (1 << KERNEL_SECTOR_SHIFT)6364/* I2O Block OSM mempool struct */65struct i2o_block_mempool {66struct kmem_cache *slab;67mempool_t *pool;68};6970/* I2O Block device descriptor */71struct i2o_block_device {72struct i2o_device *i2o_dev; /* pointer to I2O device */73struct gendisk *gd;74spinlock_t lock; /* queue lock */75struct list_head open_queue; /* list of transferred, but unfinished76requests */77unsigned int open_queue_depth; /* number of requests in the queue */7879int rcache; /* read cache flags */80int wcache; /* write cache flags */81int flags;82u16 power; /* power state */83int media_change_flag; /* media changed flag */84};8586/* I2O Block device request */87struct i2o_block_request {88struct list_head queue;89struct request *req; /* corresponding request */90struct i2o_block_device *i2o_blk_dev; /* I2O block device */91struct device *dev; /* device used for DMA */92int sg_nents; /* number of SG elements */93struct scatterlist sg_table[I2O_MAX_PHYS_SEGMENTS]; /* SG table */94};9596/* I2O Block device delayed request */97struct i2o_block_delayed_request {98struct delayed_work work;99struct request_queue *queue;100};101102#endif103104105