diff options
author | Borislav Petkov <petkovbb@googlemail.com> | 2008-04-17 18:46:26 -0400 |
---|---|---|
committer | Bartlomiej Zolnierkiewicz <bzolnier@gmail.com> | 2008-04-17 18:46:26 -0400 |
commit | 8303b46e18b58b2d0257e6842e60b50ac880a6d1 (patch) | |
tree | 865a2ddf450d0a55b45790659b82a390af9f2b23 | |
parent | 346331f82823682fb5c2df6e827db25d95cc2e92 (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>
-rw-r--r-- | include/linux/ide.h | 47 |
1 files changed, 47 insertions, 0 deletions
diff --git a/include/linux/ide.h b/include/linux/ide.h index 3b691cce00e1..e9b1def1e66a 100644 --- a/include/linux/ide.h +++ b/include/linux/ide.h | |||
@@ -595,6 +595,53 @@ int set_io_32bit(ide_drive_t *, int); | |||
595 | int set_pio_mode(ide_drive_t *, int); | 595 | int set_pio_mode(ide_drive_t *, int); |
596 | int set_using_dma(ide_drive_t *, int); | 596 | int set_using_dma(ide_drive_t *, int); |
597 | 597 | ||
598 | struct ide_atapi_pc { | ||
599 | /* actual packet bytes */ | ||
600 | u8 c[12]; | ||
601 | /* incremented on each retry */ | ||
602 | int retries; | ||
603 | int error; | ||
604 | |||
605 | /* bytes to transfer */ | ||
606 | int req_xfer; | ||
607 | /* bytes actually transferred */ | ||
608 | int xferred; | ||
609 | |||
610 | /* data buffer */ | ||
611 | u8 *buf; | ||
612 | /* current buffer position */ | ||
613 | u8 *cur_pos; | ||
614 | int buf_size; | ||
615 | /* missing/available data on the current buffer */ | ||
616 | int b_count; | ||
617 | |||
618 | /* the corresponding request */ | ||
619 | struct request *rq; | ||
620 | |||
621 | unsigned long flags; | ||
622 | |||
623 | /* | ||
624 | * those are more or less driver-specific and some of them are subject | ||
625 | * to change/removal later. | ||
626 | */ | ||
627 | u8 pc_buf[256]; | ||
628 | void (*idefloppy_callback) (ide_drive_t *); | ||
629 | ide_startstop_t (*idetape_callback) (ide_drive_t *); | ||
630 | |||
631 | /* idetape only */ | ||
632 | struct idetape_bh *bh; | ||
633 | char *b_data; | ||
634 | |||
635 | /* idescsi only for now */ | ||
636 | struct scatterlist *sg; | ||
637 | unsigned int sg_cnt; | ||
638 | |||
639 | struct scsi_cmnd *scsi_cmd; | ||
640 | void (*done) (struct scsi_cmnd *); | ||
641 | |||
642 | unsigned long timeout; | ||
643 | }; | ||
644 | |||
598 | #ifdef CONFIG_IDE_PROC_FS | 645 | #ifdef CONFIG_IDE_PROC_FS |
599 | /* | 646 | /* |
600 | * configurable drive settings | 647 | * configurable drive settings |