From: Borislav Petkov <petkovbb@googlemail.com>
To: bzolnier@gmail.com
Cc: linux-kernel@vger.kernel.org, linux-ide@vger.kernel.org,
Borislav Petkov <petkovbb@gmail.com>
Subject: [PATCH 1/4] ide: add generic packet command representation ide_atapi_pc
Date: Mon, 11 Feb 2008 09:34:37 +0100 [thread overview]
Message-ID: <1202718880-1793-2-git-send-email-petkovbb@gmail.com> (raw)
In-Reply-To: <1202718880-1793-1-git-send-email-petkovbb@gmail.com>
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.
Signed-off-by: Borislav Petkov <petkovbb@gmail.com>
---
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 e4eddd4..aae98d7 100644
--- a/include/linux/ide.h
+++ b/include/linux/ide.h
@@ -629,6 +629,53 @@ typedef struct ide_settings_s {
int ide_add_setting(ide_drive_t *, const char *, int, int, int, int, int, int, void *, ide_procset_t *set);
+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;
+};
+
/*
* /proc/ide interface
*/
--
1.5.3.7
next prev parent reply other threads:[~2008-02-11 8:35 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-02-11 8:34 [PATCH 0/4] ide: generic packet command representation Borislav Petkov
2008-02-11 8:34 ` Borislav Petkov [this message]
2008-02-11 8:34 ` [PATCH 2/4] ide-floppy: convert driver to using generic ide_atapi_pc Borislav Petkov
2008-02-11 8:34 ` [PATCH 3/4] ide-tape: " Borislav Petkov
2008-02-11 8:34 ` [PATCH 4/4] ide-scsi: " Borislav Petkov
2008-02-12 0:09 ` [PATCH 0/4] ide: generic packet command representation Bartlomiej Zolnierkiewicz
2008-02-12 5:59 ` Borislav Petkov
[not found] ` <200802121328.48515.bzolnier@gmail.com>
2008-02-12 15:25 ` [PATCH] ide-scsi: do non-atomic pc->flags testing Borislav Petkov
2008-02-12 20:17 ` Bartlomiej Zolnierkiewicz
2008-02-15 14:04 ` [PATCH 0/4] ide: generic packet command representation Jan Engelhardt
2008-02-15 14:24 ` Alan Cox
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1202718880-1793-2-git-send-email-petkovbb@gmail.com \
--to=petkovbb@googlemail.com \
--cc=bzolnier@gmail.com \
--cc=linux-ide@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=petkovbb@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).