From rivers@dignus.com Mon May  3 10:44:49 1999
Return-Path: <rivers@dignus.com>
Received: from smtp2.vnet.net (smtp2.vnet.net [166.82.1.32])
	by hub.freebsd.org (Postfix) with ESMTP id A1F4314D5C
	for <FreeBSD-gnats-submit@freebsd.org>; Mon,  3 May 1999 10:44:48 -0700 (PDT)
	(envelope-from rivers@dignus.com)
Received: from dignus.com (ponds.vnet.net [166.82.177.48])
	by smtp2.vnet.net (8.9.1a/8.9.1) with ESMTP id NAA02516
	for <FreeBSD-gnats-submit@freebsd.org>; Mon, 3 May 1999 13:45:56 -0400 (EDT)
Received: from lakes.dignus.com (lakes.dignus.com [10.0.0.3])
	by dignus.com (8.9.2/8.8.5) with ESMTP id NAA00311
	for <FreeBSD-gnats-submit@freebsd.org>; Mon, 3 May 1999 13:44:45 -0400 (EDT)
Received: (from rivers@localhost) by lakes.dignus.com (8.9.2/8.6.9) id NAA45948; Mon, 3 May 1999 13:43:57 -0400 (EDT)
Message-Id: <199905031743.NAA45948@lakes.dignus.com>
Date: Mon, 3 May 1999 13:43:57 -0400 (EDT)
From: Thomas David Rivers <rivers@dignus.com>
Reply-To: rivers@dignus.com
To: FreeBSD-gnats-submit@freebsd.org
Subject: Adaptec 1542B version 3.10 not recognized.
X-Send-Pr-Version: 3.2

>Number:         11469
>Category:       kern
>Synopsis:       Adaptec 1542B version 3.10 not recognized.
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    freebsd-bugs
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Mon May  3 10:50:01 PDT 1999
>Closed-Date:    Tue May 11 02:14:46 MDT 1999
>Last-Modified:  Tue May 11 02:16:03 MDT 1999
>Originator:     Thomas David Rivers
>Release:        FreeBSD 3.1-RELEASE i386
>Organization:
Dignus, LLC
>Environment:

	Adaptect 1542B - Version 3.10 (from 1988)

>Description:

	The probe in version 3.1 for adaptec drivers checks the
	GEOMETRY_REG.  If the value is 0xff or 0x00, the probe
	succeeds.  Unfortunately, for version 3.10 of the 1542B,
	the value returned is 0x7f.  This could also be because
	there are no disk drives on the SCSI bus, only tape drives.

>How-To-Repeat:

	Get a version 3.10 Adaptec 1542B, put nothing on the SCSI
	bus and watch the probe fail.

>Fix:

	The following context diff to /sys/dev/aha.c corrects the problem
	for me.  It also adds a little to the debugging information
	when you boot with the -v option.	

*** aha.c.ori	Wed Jan 20 01:21:26 1999
--- aha.c	Mon May  3 12:56:10 1999
***************
*** 352,357 ****
--- 352,358 ----
  	aha->fw_major = board_id.firmware_rev_major;
  	aha->fw_minor = board_id.firmware_rev_minor;
  	aha->boardid = board_id.board_type;
+ 	PRVERB(("%s: Firmware # %d %d - Board Type 0x%02x\n", aha_name(aha), aha->fw_major, aha->fw_minor, aha->boardid));
  
  	/*
  	 * The Buslogic cards have an id of either 0x41 or 0x42.  So
***************
*** 378,386 ****
  		/* Wait 10ms before reading */
  		DELAY(10000);
  		status = aha_inb(aha, GEOMETRY_REG);
! 		if (status != 0xff && status != 0x00) {
! 			PRVERB(("%s: Geometry Register test failed\n",
! 				aha_name(aha)));
  			return (ENXIO);
  		}
  	}
--- 379,387 ----
  		/* Wait 10ms before reading */
  		DELAY(10000);
  		status = aha_inb(aha, GEOMETRY_REG);
! 		if (status != 0xff && status != 0x00 && status != 0x7f) {
! 			PRVERB(("%s: Geometry Register test failed, status = 0x%02x \n",
! 				aha_name(aha), status));
  			return (ENXIO);
  		}
  	}


>Release-Note:
>Audit-Trail:
State-Changed-From-To: open->closed 
State-Changed-By: imp 
State-Changed-When: Tue May 11 02:14:46 MDT 1999 
State-Changed-Why:  
This has been corrected in -current.  It ill go into -stable at the 
latest after the current stable freeze is over, hopefully before so 
that it can be in 3.2. 
>Unformatted:
