* [PATCH] [libata] quick fix for vendor and model names
@ 2004-04-06 17:54 Justin Cormack
2004-06-19 20:17 ` Jeff Garzik
0 siblings, 1 reply; 2+ messages in thread
From: Justin Cormack @ 2004-04-06 17:54 UTC (permalink / raw)
To: Kernel mailing list
[-- Attachment #1: Type: text/plain, Size: 298 bytes --]
ok, so transport attributes arent happening for libata. Howabout this
little patch to fix up the vendor and model names in the common case
when they are 3 chars + 16 chars (like almost all hard drives) so the
model names arent truncated in this case. Otherwise leaves things as
they are.
Justin
[-- Attachment #2: libata-hackpatch --]
[-- Type: text/x-patch, Size: 934 bytes --]
diff -urN linux-2.6.5-orig/drivers/scsi/libata-scsi.c linux-2.6.5/drivers/scsi/libata-scsi.c
--- linux-2.6.5-orig/drivers/scsi/libata-scsi.c 2004-04-04 03:36:57.000000000 +0000
+++ linux-2.6.5/drivers/scsi/libata-scsi.c 2004-04-06 17:10:57.000000000 +0000
@@ -464,11 +464,17 @@
memcpy(rbuf, hdr, sizeof(hdr));
if (buflen > 36) {
- memcpy(&rbuf[8], args->dev->vendor, 8);
- memcpy(&rbuf[16], args->dev->product, 16);
+ /* hack for common ata vendor/product strings */
+ if (args->dev->product[3] == ' ') {
+ memcpy(&rbuf[8], args->dev->product, 4);
+ memset(&rbuf[12], ' ', 4);
+ memcpy(&rbuf[16], &args->dev->product[4], 16);
+ } else {
+ memcpy(&rbuf[8], args->dev->vendor, 8);
+ memcpy(&rbuf[16], args->dev->product, 16);
+ }
memcpy(&rbuf[32], DRV_VERSION, 4);
}
-
if (buflen > 63) {
const u8 versions[] = {
0x60, /* SAM-3 (no version claimed) */
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [PATCH] [libata] quick fix for vendor and model names
2004-04-06 17:54 [PATCH] [libata] quick fix for vendor and model names Justin Cormack
@ 2004-06-19 20:17 ` Jeff Garzik
0 siblings, 0 replies; 2+ messages in thread
From: Jeff Garzik @ 2004-06-19 20:17 UTC (permalink / raw)
To: Justin Cormack; +Cc: Kernel mailing list
Justin Cormack wrote:
> ok, so transport attributes arent happening for libata. Howabout this
> little patch to fix up the vendor and model names in the common case
> when they are 3 chars + 16 chars (like almost all hard drives) so the
> model names arent truncated in this case. Otherwise leaves things as
> they are.
This isn't true for Maxtor or Seagate, two high-volume ATA device vendors.
Jeff
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2004-06-19 20:17 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-04-06 17:54 [PATCH] [libata] quick fix for vendor and model names Justin Cormack
2004-06-19 20:17 ` Jeff Garzik
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox