Subject: port-i386/1717: ultrastor driver fails to find 24f, u?4_init broke
To: None <gnats-bugs@gnats.netbsd.org>
From: Andrew Gillham <gillhaa@ghost.whirlpool.com>
List: netbsd-bugs
Date: 11/02/1995 12:43:16
>Number:         1717
>Category:       port-i386
>Synopsis:       ultrastor driver fails to find 24f, u?4_init broke
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    gnats-admin (GNATS administrator)
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Thu Nov  2 13:05:01 1995
>Last-Modified:
>Originator:     Andrew Gillham
>Organization:
Whirlpool Corporation
>Release:        November 1, 1995
>Environment:
System: NetBSD ghost 1.1_ALPHA NetBSD 1.1_ALPHA (GHOST) #2: Sun Oct 22 11:48:58 EDT 1995 root@ghost:/usr/src/sys/arch/i386/compile/GHOST i386

I have a different machine with an Ultrastor 24f EISA SCSI controller.

>Description:
	The uha? driver (/sys/dev/isa/ultra14f.c) does not fill in the
	correct information once it has probed a 24f.  It locates it,
	but then attempts to attach it at IOBASEUNK.
	Also, u14_init and u24_init have bogus 'outb' calls with the
	parameters reversed.
>How-To-Repeat:
	Try to use NetBSD/i386 with an Ultrastor controller, specifically
	an EISA 24f.
>Fix:
	Here is a diff that resolves both problems.  It is known working
	on a friend's machine with an Ultrastor 24f.


*** ultra14f.c.orig	Thu Nov  2 12:34:52 1995
--- ultra14f.c	Thu Nov  2 12:34:37 1995
***************
*** 1041,1046 ****
--- 1041,1048 ----
  		uha_id = config2 & U24_HOSTID_MASK;
  
  		uha->sc_drq = DRQUNK;
+ 		uha->sc_iobase = iobase;
+ 		ia->ia_iobase = iobase;
  
  		switch (irq_ch) {
  		case U24_IRQ10:
***************
*** 1100,1107 ****
  	printf("u14_init: lmask=%02x, smask=%02x\n",
  	    inb(iobase + U14_LMASK), inb(iobase + U14_SMASK));
  #endif
! 	outb(0xd1, iobase + U14_LMASK);	/* XXX */
! 	outb(0x91, iobase + U14_SMASK);	/* XXX */
  }
  
  void
--- 1102,1109 ----
  	printf("u14_init: lmask=%02x, smask=%02x\n",
  	    inb(iobase + U14_LMASK), inb(iobase + U14_SMASK));
  #endif
! 	outb(iobase + U14_LMASK, 0xd1);	/* XXX */
! 	outb(iobase + U14_SMASK, 0x91);	/* XXX */
  }
  
  void
***************
*** 1118,1125 ****
  	printf("u24_init: lmask=%02x, smask=%02x\n",
  	    inb(iobase + U24_LMASK), inb(iobase + U24_SMASK));
  #endif
! 	outb(0xd2, iobase + U24_LMASK);	/* XXX */
! 	outb(0x92, iobase + U24_SMASK);	/* XXX */
  }
  
  void
--- 1120,1127 ----
  	printf("u24_init: lmask=%02x, smask=%02x\n",
  	    inb(iobase + U24_LMASK), inb(iobase + U24_SMASK));
  #endif
! 	outb(iobase + U24_LMASK, 0xd2);	/* XXX */
! 	outb(iobase + U24_SMASK, 0x92);	/* XXX */
  }
  
  void
>Audit-Trail:
>Unformatted: