summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorBorislav Petkov <petkovbb@googlemail.com>2008-02-22 11:51:31 +1100
committerStephen Rothwell <sfr@canb.auug.org.au>2008-02-22 11:51:31 +1100
commit0fc307aad1b3f3b7994c2ae770ecd1a03f017d5d (patch)
tree8257f530cd2dfa2dadc369ce71ba286419dbd5eb /include
parentda985a72a851b70a5d18dd8f17d2fded97232d65 (diff)
ide: add generic packet command representation ide_atapi_pc
This new struct unifies ide{-floppy,-tape,-scsi}'s view of a packet command. For now, it represents the common denominator between the three drivers while adding driver- specific members at the end of the struct which will be merged/simplified into the generic ATAPI handling code in later steps, or removed completely. Bart: - move struct ide_atapi_pc outside of #ifdef/#endif CONFIG_IDE_PROC_FS Signed-off-by: Borislav Petkov <petkovbb@gmail.com> Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Diffstat (limited to 'include')
-rw-r--r--include/linux/ide.h47
1 files changed, 47 insertions, 0 deletions
diff --git a/include/linux/ide.h b/include/linux/ide.h
index e78851ea07ea..9a84939b7e52 100644
--- a/include/linux/ide.h
+++ b/include/linux/ide.h
@@ -597,6 +597,53 @@ int set_io_32bit(ide_drive_t *, int);
int set_pio_mode(ide_drive_t *, int);
int set_using_dma(ide_drive_t *, int);
+struct ide_atapi_pc {
+ /* actual packet bytes */
+ u8 c[12];
+ /* incremented on each retry */
+ int retries;
+ int error;
+
+ /* bytes to transfer */
+ int req_xfer;
+ /* bytes actually transferred */
+ int xferred;
+
+ /* data buffer */
+ u8 *buf;
+ /* current buffer position */
+ u8 *cur_pos;
+ int buf_size;
+ /* missing/available data on the current buffer */
+ int b_count;
+
+ /* the corresponding request */
+ struct request *rq;
+
+ unsigned long flags;
+
+ /*
+ * those are more or less driver-specific and some of them are subject
+ * to change/removal later.
+ */
+ u8 pc_buf[256];
+ void (*idefloppy_callback) (ide_drive_t *);
+ ide_startstop_t (*idetape_callback) (ide_drive_t *);
+
+ /* idetape only */
+ struct idetape_bh *bh;
+ char *b_data;
+
+ /* idescsi only for now */
+ struct scatterlist *sg;
+ unsigned int sg_cnt;
+
+ struct scsi_cmnd *scsi_cmd;
+ void (*done) (struct scsi_cmnd *);
+
+ unsigned long timeout;
+};
+
#ifdef CONFIG_IDE_PROC_FS
/*
* configurable drive settings