aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/ide.h
diff options
context:
space:
mode:
authorBartlomiej Zolnierkiewicz <bzolnier@gmail.com>2008-10-13 15:39:31 -0400
committerBartlomiej Zolnierkiewicz <bzolnier@gmail.com>2008-10-13 15:39:31 -0400
commit67c56364df843fb9e3ed1af014b8fbe4b22ff25d (patch)
tree586a85b1535038dea95ef2b0bff9f7d6c9fa442e /include/linux/ide.h
parent844b9468523c8c2c45b90df4efcabcbe4926b5ab (diff)
ide: add request_sense_{pc,rq} to ide_drive_t
Add 'struct ide_atapi_pc request_sense_pc' and 'request request_sense_rq' to ide_drive_t and use them instead of fields in struct ide_{floppy,tape}_obj. There should be no functional changes caused by this patch. Cc: Borislav Petkov <petkovbb@gmail.com> Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Diffstat (limited to 'include/linux/ide.h')
-rw-r--r--include/linux/ide.h134
1 files changed, 68 insertions, 66 deletions
diff --git a/include/linux/ide.h b/include/linux/ide.h
index 3bf2bf0a56dc..908b4fc9772c 100644
--- a/include/linux/ide.h
+++ b/include/linux/ide.h
@@ -322,7 +322,71 @@ typedef enum {
322 ide_started, /* a drive operation was started, handler was set */ 322 ide_started, /* a drive operation was started, handler was set */
323} ide_startstop_t; 323} ide_startstop_t;
324 324
325struct ide_atapi_pc; 325/* ATAPI packet command flags */
326enum {
327 /* set when an error is considered normal - no retry (ide-tape) */
328 PC_FLAG_ABORT = (1 << 0),
329 PC_FLAG_SUPPRESS_ERROR = (1 << 1),
330 PC_FLAG_WAIT_FOR_DSC = (1 << 2),
331 PC_FLAG_DMA_OK = (1 << 3),
332 PC_FLAG_DMA_IN_PROGRESS = (1 << 4),
333 PC_FLAG_DMA_ERROR = (1 << 5),
334 PC_FLAG_WRITING = (1 << 6),
335 /* command timed out */
336 PC_FLAG_TIMEDOUT = (1 << 7),
337};
338
339/*
340 * With each packet command, we allocate a buffer of IDE_PC_BUFFER_SIZE bytes.
341 * This is used for several packet commands (not for READ/WRITE commands).
342 */
343#define IDE_PC_BUFFER_SIZE 256
344
345struct ide_atapi_pc {
346 /* actual packet bytes */
347 u8 c[12];
348 /* incremented on each retry */
349 int retries;
350 int error;
351
352 /* bytes to transfer */
353 int req_xfer;
354 /* bytes actually transferred */
355 int xferred;
356
357 /* data buffer */
358 u8 *buf;
359 /* current buffer position */
360 u8 *cur_pos;
361 int buf_size;
362 /* missing/available data on the current buffer */
363 int b_count;
364
365 /* the corresponding request */
366 struct request *rq;
367
368 unsigned long flags;
369
370 /*
371 * those are more or less driver-specific and some of them are subject
372 * to change/removal later.
373 */
374 u8 pc_buf[IDE_PC_BUFFER_SIZE];
375
376 /* idetape only */
377 struct idetape_bh *bh;
378 char *b_data;
379
380 /* idescsi only for now */
381 struct scatterlist *sg;
382 unsigned int sg_cnt;
383
384 struct scsi_cmnd *scsi_cmd;
385 void (*done) (struct scsi_cmnd *);
386
387 unsigned long timeout;
388};
389
326struct ide_devset; 390struct ide_devset;
327struct ide_driver_s; 391struct ide_driver_s;
328 392
@@ -492,6 +556,9 @@ struct ide_drive_s {
492 void (*pc_callback)(struct ide_drive_s *, int); 556 void (*pc_callback)(struct ide_drive_s *, int);
493 557
494 unsigned long atapi_flags; 558 unsigned long atapi_flags;
559
560 struct ide_atapi_pc request_sense_pc;
561 struct request request_sense_rq;
495}; 562};
496 563
497typedef struct ide_drive_s ide_drive_t; 564typedef struct ide_drive_s ide_drive_t;
@@ -768,71 +835,6 @@ ide_decl_devset(pio_mode);
768ide_decl_devset(unmaskirq); 835ide_decl_devset(unmaskirq);
769ide_decl_devset(using_dma); 836ide_decl_devset(using_dma);
770 837
771/* ATAPI packet command flags */
772enum {
773 /* set when an error is considered normal - no retry (ide-tape) */
774 PC_FLAG_ABORT = (1 << 0),
775 PC_FLAG_SUPPRESS_ERROR = (1 << 1),
776 PC_FLAG_WAIT_FOR_DSC = (1 << 2),
777 PC_FLAG_DMA_OK = (1 << 3),
778 PC_FLAG_DMA_IN_PROGRESS = (1 << 4),
779 PC_FLAG_DMA_ERROR = (1 << 5),
780 PC_FLAG_WRITING = (1 << 6),
781 /* command timed out */
782 PC_FLAG_TIMEDOUT = (1 << 7),
783};
784
785/*
786 * With each packet command, we allocate a buffer of IDE_PC_BUFFER_SIZE bytes.
787 * This is used for several packet commands (not for READ/WRITE commands).
788 */
789#define IDE_PC_BUFFER_SIZE 256
790
791struct ide_atapi_pc {
792 /* actual packet bytes */
793 u8 c[12];
794 /* incremented on each retry */
795 int retries;
796 int error;
797
798 /* bytes to transfer */
799 int req_xfer;
800 /* bytes actually transferred */
801 int xferred;
802
803 /* data buffer */
804 u8 *buf;
805 /* current buffer position */
806 u8 *cur_pos;
807 int buf_size;
808 /* missing/available data on the current buffer */
809 int b_count;
810
811 /* the corresponding request */
812 struct request *rq;
813
814 unsigned long flags;
815
816 /*
817 * those are more or less driver-specific and some of them are subject
818 * to change/removal later.
819 */
820 u8 pc_buf[IDE_PC_BUFFER_SIZE];
821
822 /* idetape only */
823 struct idetape_bh *bh;
824 char *b_data;
825
826 /* idescsi only for now */
827 struct scatterlist *sg;
828 unsigned int sg_cnt;
829
830 struct scsi_cmnd *scsi_cmd;
831 void (*done) (struct scsi_cmnd *);
832
833 unsigned long timeout;
834};
835
836#ifdef CONFIG_IDE_PROC_FS 838#ifdef CONFIG_IDE_PROC_FS
837/* 839/*
838 * /proc/ide interface 840 * /proc/ide interface