diff options
author | Borislav Petkov <petkovbb@googlemail.com> | 2009-04-18 18:00:42 -0400 |
---|---|---|
committer | Jens Axboe <jens.axboe@oracle.com> | 2009-04-28 01:37:30 -0400 |
commit | e69d800f7e8797a8e3423380ee9d8ca1cb90c388 (patch) | |
tree | 4f2241b44bf56db7e8f977b742a5e56f53424596 /include/linux/ide.h | |
parent | 1f181d2b1569dfb88a584a6e1847e9e1c7645951 (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.h | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/include/linux/ide.h b/include/linux/ide.h index 846a1e132407..a69ccac56411 100644 --- a/include/linux/ide.h +++ b/include/linux/ide.h | |||
@@ -26,6 +26,9 @@ | |||
26 | #include <asm/io.h> | 26 | #include <asm/io.h> |
27 | #include <asm/mutex.h> | 27 | #include <asm/mutex.h> |
28 | 28 | ||
29 | /* for request_sense */ | ||
30 | #include <linux/cdrom.h> | ||
31 | |||
29 | #if defined(CONFIG_CRIS) || defined(CONFIG_FRV) || defined(CONFIG_MN10300) | 32 | #if defined(CONFIG_CRIS) || defined(CONFIG_FRV) || defined(CONFIG_MN10300) |
30 | # define SUPPORT_VLB_SYNC 0 | 33 | # define SUPPORT_VLB_SYNC 0 |
31 | #else | 34 | #else |
@@ -602,6 +605,11 @@ struct ide_drive_s { | |||
602 | 605 | ||
603 | struct ide_atapi_pc request_sense_pc; | 606 | struct ide_atapi_pc request_sense_pc; |
604 | struct request request_sense_rq; | 607 | struct request request_sense_rq; |
608 | |||
609 | /* current sense rq and buffer */ | ||
610 | bool sense_rq_armed; | ||
611 | struct request sense_rq; | ||
612 | struct request_sense sense_data; | ||
605 | }; | 613 | }; |
606 | 614 | ||
607 | typedef struct ide_drive_s ide_drive_t; | 615 | typedef struct ide_drive_s ide_drive_t; |
@@ -1175,6 +1183,9 @@ int ide_set_media_lock(ide_drive_t *, struct gendisk *, int); | |||
1175 | void ide_create_request_sense_cmd(ide_drive_t *, struct ide_atapi_pc *); | 1183 | void ide_create_request_sense_cmd(ide_drive_t *, struct ide_atapi_pc *); |
1176 | void ide_retry_pc(ide_drive_t *, struct gendisk *); | 1184 | void ide_retry_pc(ide_drive_t *, struct gendisk *); |
1177 | 1185 | ||
1186 | void ide_prep_sense(ide_drive_t *drive, struct request *rq); | ||
1187 | void ide_queue_sense_rq(ide_drive_t *drive, void *special); | ||
1188 | |||
1178 | int ide_cd_expiry(ide_drive_t *); | 1189 | int ide_cd_expiry(ide_drive_t *); |
1179 | 1190 | ||
1180 | int ide_cd_get_xferlen(struct request *); | 1191 | int ide_cd_get_xferlen(struct request *); |