Subject: kern/34292: twa driver incorrectly reports drive size/description (w/patch)
To: None <kern-bug-people@netbsd.org, gnats-admin@netbsd.org,>
From: None <ahodgen@kill-9.org>
List: netbsd-bugs
Date: 08/26/2006 18:55:00
>Number:         34292
>Category:       kern
>Synopsis:       twa driver incorrectly reports drive size/description (w/patch)
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    kern-bug-people
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Sat Aug 26 18:55:00 +0000 2006
>Originator:     Aaron Hodgen
>Release:        NetBSD 3.99.24
>Organization:
>Environment:
NetBSD coors 3.99.24 NetBSD 3.99.24 (COORS.MP) #4: Sat Aug 26 14:05:46 EDT 2006  ahodgen@coors:/usr/obj/sys/arch/i386/compile/COORS.MP i386

>Description:
The twa driver reports all attached drives with the size/description of the first attached drive in the array.

>How-To-Repeat:
Boot with diffent size/type disks attached to the array.
>Fix:
Index: sys/dev/pci/twa.c
===================================================================
RCS file: /cvsroot/src/sys/dev/pci/twa.c,v
retrieving revision 1.10
diff -u -r1.10 twa.c
--- sys/dev/pci/twa.c   17 Aug 2006 17:11:28 -0000      1.10
+++ sys/dev/pci/twa.c   26 Aug 2006 18:21:15 -0000
@@ -3141,7 +3141,7 @@
                if ((*((char *)(p[7]->data + i)) & TWA_DRIVE_DETECTED) == 0)
                        continue;
 
-               rv = twa_get_param(sc, TWA_PARAM_DRIVE_TABLE,
+               rv = twa_get_param(sc, TWA_PARAM_DRIVE_TABLE+i,
                        TWA_PARAM_DRIVEMODELINDEX,
                        TWA_PARAM_DRIVEMODEL_LENGTH, NULL, &p[8]);
 
@@ -3151,7 +3151,7 @@
                        continue;
                }
 
-               rv = twa_get_param(sc, TWA_PARAM_DRIVE_TABLE,
+               rv = twa_get_param(sc, TWA_PARAM_DRIVE_TABLE+i,
                        TWA_PARAM_DRIVESIZEINDEX,
                        TWA_PARAM_DRIVESIZE_LENGTH, NULL, &p[9]);