From: <sezeroz@ttnet.net.tr>
To: <linux-kernel@vger.kernel.org>
Cc: <marcelo.tosatti@cyclades.com>
Subject: 2.4.28-rc1, more lost patches [1/10]
Date: Wed, 27 Oct 2004 12:42:42 +0300 [thread overview]
Message-ID: <20041027094242.KAZP6935.fep01.ttnet.net.tr@localhost> (raw)
[-- Attachment #1: Type: text/plain, Size: 50 bytes --]
[7/10] ide-scsi v0.94 from -ac/redhat. (By ???)
[-- Attachment #2: ide-scsi_v0.94.patch --]
[-- Type: application/octet-stream, Size: 2455 bytes --]
from in -ac/redhat.
diff -urN 28rc1/drivers/scsi/ide-scsi.c 28rc1_aac/drivers/scsi/ide-scsi.c
--- 28rc1/drivers/scsi/ide-scsi.c 2003-11-28 20:26:20.000000000 +0200
+++ 28rc1_aac/drivers/scsi/ide-scsi.c 2004-10-24 00:58:11.000000000 +0300
@@ -1,5 +1,5 @@
/*
- * linux/drivers/scsi/ide-scsi.c Version 0.93 June 10, 2002
+ * linux/drivers/scsi/ide-scsi.c Version 0.94 Sept 09, 2003
*
* Copyright (C) 1996 - 1999 Gadi Oxman <gadio@netvision.net.il>
* Copyright (C) 2001 - 2002 Andre Hedrick <andre@linux-ide.org>
@@ -35,9 +35,12 @@
* Ver 0.92 Mar 21 02 Include DevFs support
* Borsenkow Andrej <Andrej.Borsenkow@mow.siemens.ru>
* Ver 0.93 Jun 10 02 Fix "off by one" error in transforms
+ * Ver 0.94 Sep 09 03 Added transform for reading ATAPI tape drive block
+ * limits (ATAPI tapes report block limits in mode
+ * page 0x2A, not by "read block limits" command)
*/
-#define IDESCSI_VERSION "0.93"
+#define IDESCSI_VERSION "0.94"
#include <linux/module.h>
#include <linux/config.h>
@@ -234,6 +237,25 @@
pc->buffer_size += 4;
}
}
+ if (drive->media == ide_tape) {
+ if (sc[0] == READ_BLOCK_LIMITS) { /* IDE tapes have blk lmts in mode page 0x2a */
+ if (!scsi_buf)
+ return;
+ /* buffer size should be 6 for READ_BLOCK_LIMITS */
+ /* we need 12 bytes (4 for header + 8 for mode page */
+ if ((atapi_buf = kmalloc(12, GFP_ATOMIC)) == NULL)
+ return;
+ memset(atapi_buf, 0, 12);
+ memset (c, 0, 12);
+ c[0] = MODE_SENSE;
+ c[1] = 8; /* no block descriptors */
+ c[2] = 0x2A; /* mode page 0x2A */
+ c[4] = 12; /* buffer length 12 decimal */
+ pc->buffer = atapi_buf;
+ pc->request_transfer = 12;
+ pc->buffer_size = 12;
+ }
+ }
}
static inline void idescsi_transform_pc2 (ide_drive_t *drive, idescsi_pc_t *pc)
@@ -262,7 +284,19 @@
/* response data format */
scsi_buf[3] = (scsi_buf[3] & 0xf0) | 2;
}
+ }
+ if (drive->media == ide_tape) {
+ if (sc[0] == READ_BLOCK_LIMITS) {
+ memset(scsi_buf, 0, pc->scsi_cmd->request_bufflen);
+ /* granularity of 9 (always 9 for ide tapes) */
+ scsi_buf[0] = 9;
+ /* block length of 1024 bytes supported? */
+ scsi_buf[2] = (atapi_buf[11] & 0x04) ? 4 : 2;
+ /* block length of 512 bytes supported? */
+ scsi_buf[4] = (atapi_buf[11] & 0x02) ? 2 : 4;
+ }
}
+
if (atapi_buf && atapi_buf != scsi_buf)
kfree(atapi_buf);
}
next reply other threads:[~2004-10-27 9:47 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-10-27 9:42 sezeroz [this message]
-- strict thread matches above, loose matches on Subject: below --
2004-10-27 12:59 2.4.28-rc1, more lost patches [1/10] O.Sezer
2004-10-27 9:51 sezeroz
2004-10-27 9:29 sezeroz
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=20041027094242.KAZP6935.fep01.ttnet.net.tr@localhost \
--to=sezeroz@ttnet.net.tr \
--cc=linux-kernel@vger.kernel.org \
--cc=marcelo.tosatti@cyclades.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