Subject: kern/3103: bug in aic7xxx.c
To: None <gnats-bugs@gnats.netbsd.org>
From: Anders Hjalmarsson <econahja@econahja.econ.gu.se>
List: netbsd-bugs
Date: 01/12/1997 23:56:39
>Number:         3103
>Category:       kern
>Synopsis:       ahc(4) no longer probes the second SCSI bus on AHA-2742
>Confidential:   no
>Severity:       serious
>Priority:       high
>Responsible:    kern-bug-people (Kernel Bug People)
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Sun Jan 12 15:05:00 1997
>Last-Modified:
>Originator:     Anders Hjalmarsson
>Organization:
	
>Release:        NetBSD-current from a few days ago
>Environment:
System: NetBSD econahja.econ.gu.se 1.2B NetBSD 1.2B (ECONAHJA) #2: Sun Jan 12 23:19:22 MET 1997 econahja@econahja.econ.gu.se:/usr/src/sys/arch/i386/compile/ECONAHJA i386

>Description:
	The ahc driver no longer finds all devices on the second bus
	because max_target is not initialized for the second bus.
	It apparently gets the value 0.

>How-To-Repeat:
	Look at the output while booting on a machine with an AHA-2742
>Fix:
Set ahc->sc_link.max_target before copying ahc->sc_link to ahc->sc_link_b

Patch from:
$NetBSD: aic7xxx.c,v 1.19 1996/12/10 21:27:58 thorpej Exp $

*** aic7xxx.c.old	Wed Dec 11 13:20:13 1996
--- aic7xxx.c	Sun Jan 12 22:40:17 1997
***************
*** 646,651 ****
--- 646,656 ----
  #elif defined(__NetBSD__)
  	ahc->sc_link.adapter_target = ahc->our_id;
  	ahc->sc_link.channel = 0;
+ 	/*
+ 	 * Set up max_target.
+ 	 */
+ 	ahc->sc_link.max_target = (ahc->type & AHC_WIDE) ? 15 : 7;
+ 
  #endif
  	ahc->sc_link.adapter_softc = ahc;
  	ahc->sc_link.adapter = &ahc_switch;
***************
*** 704,714 ****
  		scbus = NULL;	/* Upper-level SCSI code owns this now */
  	}
  #elif defined(__NetBSD__)
- 	/*
- 	 * Set up max_target.
- 	 */
- 	ahc->sc_link.max_target = (ahc->type & AHC_WIDE) ? 15 : 7;
- 
  	/*
  	 * ask the adapter what subunits are present
  	 */
--- 709,714 ----
>Audit-Trail:
>Unformatted: