From nobody@FreeBSD.ORG  Mon Oct 30 05:40:56 2000
Return-Path: <nobody@FreeBSD.ORG>
Received: by hub.freebsd.org (Postfix, from userid 32767)
	id 2933937B479; Mon, 30 Oct 2000 05:40:56 -0800 (PST)
Message-Id: <20001030134056.2933937B479@hub.freebsd.org>
Date: Mon, 30 Oct 2000 05:40:56 -0800 (PST)
From: adam@algroup.co.uk
Sender: nobody@FreeBSD.ORG
To: freebsd-gnats-submit@FreeBSD.org
Subject: advansys wide scsi driver does not support more than 7 drives
X-Send-Pr-Version: www-1.0

>Number:         22417
>Category:       kern
>Synopsis:       [adw] [patch] advansys wide scsi driver does not support more than 7 drives
>Confidential:   no
>Severity:       serious
>Priority:       high
>Responsible:    gibbs
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Mon Oct 30 05:50:01 PST 2000
>Closed-Date:    Tue Sep 06 19:23:44 UTC 2011
>Last-Modified:  Tue Sep 06 19:23:44 UTC 2011
>Originator:     Adam Laurie
>Release:        4.1.1-STABLE
>Organization:
A.L. Digital Ltd.
>Environment:
FreeBSD tobermory 4.1.1-STABLE FreeBSD 4.1.1-STABLE #0: Fri Oct 20 13:12:24 GMT 2000     root@tobermory:/usr/src/sys/compile/TOBERMORY  i386

>Description:
it appears that advansys ultra2 scsi controller (tested with model ASB3940U2W) code is 
hardwired to 3 bit SCSI IDs, causing hangup during boot if more than 
3 bits worth of drives are present (or, presumably, any drive 
with an id higher than 7).

dmesg:

adw0: <AdvanSys 38C0800 Ultra2 SCSI Adapter> port 0xd800-0xd8ff mem 0xff8ffc00-0xff8ffcff irq 9 at device 11.0 on pci1
adw0: SCSI ID 0, High & Low SE Term Enabled, LVD Term Enabled, Queue Depth 253

(yes, I know having it set to SCSI id 0 is weird, but we have to because of 
the way the external drive chassis autonumbers).
>How-To-Repeat:
attach more than 7 scsi drives to an advansys controller.
>Fix:
the following patch was our attempt at a quick fix, which didn't work, but 
it's a start... :)

bash-2.03$ diff -u /usr/src/sys/dev/advansys/advlib.h.orig /usr/src/sys/dev/advansys/advlib.h
--- /usr/src/sys/dev/advansys/advlib.h.orig     Fri Oct 20 12:56:52 2000
+++ /usr/src/sys/dev/advansys/advlib.h  Mon Oct 30 10:56:14 2000
@@ -54,8 +54,8 @@
 
 typedef u_int8_t target_bit_vector;
 #define        TARGET_BIT_VECTOR_SET -1
-#define ADV_SCSI_ID_BITS       3
-#define ADV_MAX_TID            7
+#define ADV_SCSI_ID_BITS       4
+#define ADV_MAX_TID            15
 #define ADV_MAX_LUN            7
 
 /* Enumeration of board types */
@@ -297,7 +297,7 @@
 #define                EEPROM_SET_SCSIID(ep, id)                       \
                (ep).scsi_id_dma_speed &= ~EEPROM_SCSI_ID_MASK; \
                (ep).scsi_id_dma_speed |= ((id) & EEPROM_SCSI_ID_MASK)
-       u_int8_t        sdtr_data[8];
+       u_int8_t        sdtr_data[ADV_MAX_TID+1];
        u_int8_t        adapter_info[6];
 
        u_int16_t       cntl;


>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: freebsd-bugs->gibbs 
Responsible-Changed-By: gibbs 
Responsible-Changed-When: Wed Nov 1 07:56:41 PST 2000 
Responsible-Changed-Why:  
I wrote the adw driver, so I'll take a look at this.  The patch supplied 
only affects the adv driver which, by definition, only supports narrow 
busses. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=22417 
State-Changed-From-To: open->suspended 
State-Changed-By: linimon 
State-Changed-When: Tue Nov 29 05:58:22 GMT 2005 
State-Changed-Why:  
Mark this aging PR as suspended. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=22417 
State-Changed-From-To: suspended->closed 
State-Changed-By: gibbs 
State-Changed-When: Tue Sep 6 19:23:15 UTC 2011 
State-Changed-Why:  
Timed out. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=22417 
>Unformatted:
