summaryrefslogtreecommitdiffstats
path: root/include/linux/ide.h
diff options
context:
space:
mode:
authorBorislav Petkov <petkovbb@googlemail.com>2009-04-19 07:00:42 +0900
committerTejun Heo <tj@kernel.org>2009-04-19 07:00:42 +0900
commita1df5169f9bf08f6067029bfb840a05e282b1b97 (patch)
treef0ec5f74cc80f15d9d5720aa68997aa307f10dc1 /include/linux/ide.h
parentcbfd082abfcbed8c57a12636f36e9bead8d6cfc6 (diff)
ide: add helpers for preparing sense requests
This is in preparation of removing the queueing of a sense request out of the IRQ handler path. Use struct request_sense as a general sense buffer for all ATAPI devices ide-{floppy,tape,cd}. tj: * blk_get_request(__GFP_WAIT) can't be called from do_request() as it can cause deadlock. Converted to use inline struct request and blk_rq_init(). * Added xfer / cdb len selection depending on device type. * All sense prep logics folded into ide_prep_sense() which never fails. * hwif->rq clearing and sense_rq used handling moved into ide_queue_sense_rq(). * blk_rq_map_kern() conversion is moved to later patch. CC: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com> CC: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp> Signed-off-by: Borislav Petkov <petkovbb@gmail.com> Signed-off-by: Tejun Heo <tj@kernel.org>
Diffstat (limited to 'include/linux/ide.h')
-rw-r--r--include/linux/ide.h11
1 files changed, 11 insertions, 0 deletions
diff --git a/include/linux/ide.h b/include/linux/ide.h
index 846a1e13240..a69ccac5641 100644
--- a/include/linux/ide.h
+++ b/include/linux/ide.h
@@ -26,6 +26,9 @@
#include <asm/io.h>
#include <asm/mutex.h>
+/* for request_sense */
+#include <linux/cdrom.h>
+
#if defined(CONFIG_CRIS) || defined(CONFIG_FRV) || defined(CONFIG_MN10300)
# define SUPPORT_VLB_SYNC 0
#else
@@ -602,6 +605,11 @@ struct ide_drive_s {
struct ide_atapi_pc request_sense_pc;
struct request request_sense_rq;
+
+ /* current sense rq and buffer */
+ bool sense_rq_armed;
+ struct request sense_rq;
+ struct request_sense sense_data;
};
typedef struct ide_drive_s ide_drive_t;
@@ -1175,6 +1183,9 @@ int ide_set_media_lock(ide_drive_t *, struct gendisk *, int);
void ide_create_request_sense_cmd(ide_drive_t *, struct ide_atapi_pc *);
void ide_retry_pc(ide_drive_t *, struct gendisk *);
+void ide_prep_sense(ide_drive_t *drive, struct request *rq);
+void ide_queue_sense_rq(ide_drive_t *drive, void *special);
+
int ide_cd_expiry(ide_drive_t *);
int ide_cd_get_xferlen(struct request *);