From 077e6dba20e74a455a0452379d2a965c7e1b01ad Mon Sep 17 00:00:00 2001 From: Borislav Petkov Date: Fri, 1 May 2009 21:21:02 +0200 Subject: ide-atapi: switch to rq->resid_len Now that we have rq->resid_len, use it to account partial completion amount during the lifetime of an rq, decrementing it on each successful transfer. As a result, get rid of now unused pc->xferred. While at it, remove noisy debug call in ide_prep_sense. Signed-off-by: Borislav Petkov --- include/linux/ide.h | 2 -- 1 file changed, 2 deletions(-) (limited to 'include/linux/ide.h') diff --git a/include/linux/ide.h b/include/linux/ide.h index 34c128f0a33..745a393af27 100644 --- a/include/linux/ide.h +++ b/include/linux/ide.h @@ -357,8 +357,6 @@ struct ide_atapi_pc { /* bytes to transfer */ int req_xfer; - /* bytes actually transferred */ - int xferred; /* data buffer */ u8 *buf; -- cgit v1.2.3 From 5a0e43b5e2ee9a295f864c38f0e853b1a4fc3892 Mon Sep 17 00:00:00 2001 From: Borislav Petkov Date: Fri, 1 May 2009 23:27:11 +0200 Subject: ide-atapi: add a len-parameter to ide_queue_pc_tail This is in preparation for removing ide_atapi_pc. There should be no functional change resulting from this patch. Signed-off-by: Borislav Petkov --- include/linux/ide.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'include/linux/ide.h') diff --git a/include/linux/ide.h b/include/linux/ide.h index 745a393af27..7e15bd1eaae 100644 --- a/include/linux/ide.h +++ b/include/linux/ide.h @@ -1160,7 +1160,8 @@ enum { REQ_IDETAPE_WRITE = (1 << 3), }; -int ide_queue_pc_tail(ide_drive_t *, struct gendisk *, struct ide_atapi_pc *); +int ide_queue_pc_tail(ide_drive_t *, struct gendisk *, struct ide_atapi_pc *, + unsigned int); int ide_do_test_unit_ready(ide_drive_t *, struct gendisk *); int ide_do_start_stop(ide_drive_t *, struct gendisk *, int); -- cgit v1.2.3 From b13345f39dadbabdabaf8819cf6df26913da9e8d Mon Sep 17 00:00:00 2001 From: Borislav Petkov Date: Sat, 2 May 2009 10:26:12 +0200 Subject: ide-atapi: add a buffer-arg to ide_queue_pc_tail This is in preparation of removing ide_atapi_pc. Expose the buffer as an argument to ide_queue_pc_tail with later replacing it with local buffer or even kmalloc'ed one if needed due to stack usage constraints. Also, add the possibility of passing a NULL-ptr buffer for cmds which don't transfer data besides the cdb. While at it, switch to local buffer in idetape_get_mode_sense_results(). There should be no functional change resulting from this patch. Signed-off-by: Borislav Petkov --- include/linux/ide.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'include/linux/ide.h') diff --git a/include/linux/ide.h b/include/linux/ide.h index 7e15bd1eaae..4cd7157a403 100644 --- a/include/linux/ide.h +++ b/include/linux/ide.h @@ -1161,7 +1161,7 @@ enum { }; int ide_queue_pc_tail(ide_drive_t *, struct gendisk *, struct ide_atapi_pc *, - unsigned int); + void *, unsigned int); int ide_do_test_unit_ready(ide_drive_t *, struct gendisk *); int ide_do_start_stop(ide_drive_t *, struct gendisk *, int); -- cgit v1.2.3 From 19f52a784f7ecb5b51cd73cc4514614b600b995a Mon Sep 17 00:00:00 2001 From: Borislav Petkov Date: Mon, 4 May 2009 09:53:03 +0200 Subject: ide-atapi: remove pc->buf Now after all users of pc->buf have been converted, remove the 64B buffer embedded in each packet command. There should be no functional change resulting from this patch. Signed-off-by: Borislav Petkov --- include/linux/ide.h | 11 ----------- 1 file changed, 11 deletions(-) (limited to 'include/linux/ide.h') diff --git a/include/linux/ide.h b/include/linux/ide.h index 4cd7157a403..59aedcd7fae 100644 --- a/include/linux/ide.h +++ b/include/linux/ide.h @@ -341,11 +341,6 @@ enum { PC_FLAG_WRITING = (1 << 6), }; -/* - * With each packet command, we allocate a buffer of IDE_PC_BUFFER_SIZE bytes. - * This is used for several packet commands (not for READ/WRITE commands). - */ -#define IDE_PC_BUFFER_SIZE 64 #define ATAPI_WAIT_PC (60 * HZ) struct ide_atapi_pc { @@ -358,10 +353,6 @@ struct ide_atapi_pc { /* bytes to transfer */ int req_xfer; - /* data buffer */ - u8 *buf; - int buf_size; - /* the corresponding request */ struct request *rq; @@ -371,8 +362,6 @@ struct ide_atapi_pc { * those are more or less driver-specific and some of them are subject * to change/removal later. */ - u8 pc_buf[IDE_PC_BUFFER_SIZE]; - unsigned long timeout; }; -- cgit v1.2.3 From 103f7033bd0f7b65ff3e0a5ea72449d08010b031 Mon Sep 17 00:00:00 2001 From: Borislav Petkov Date: Sun, 26 Apr 2009 10:39:07 +0200 Subject: ide: unify interrupt reason checking Add ide_check_ireason() function that handles all ATAPI devices. Reorganize all unlikely cases in ireason checking further down in the code path. In addition, add PFX for printks originating from ide-atapi. Finally, remove ide_cd_check_ireason. Signed-off-by: Borislav Petkov --- include/linux/ide.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'include/linux/ide.h') diff --git a/include/linux/ide.h b/include/linux/ide.h index 59aedcd7fae..70a2c94d668 100644 --- a/include/linux/ide.h +++ b/include/linux/ide.h @@ -1125,6 +1125,8 @@ void SELECT_MASK(ide_drive_t *, int); u8 ide_read_error(ide_drive_t *); void ide_read_bcount_and_ireason(ide_drive_t *, u16 *, u8 *); +int ide_check_ireason(ide_drive_t *, struct request *, int, int, int); + int ide_check_atapi_device(ide_drive_t *, const char *); void ide_init_pc(struct ide_atapi_pc *); -- cgit v1.2.3