Subject: port-i386/3526: problems with wds.c
To: None <gnats-bugs@gnats.netbsd.org>
From: Michael C. Richardson <mcr@sandelman.ottawa.on.ca>
List: netbsd-bugs
Date: 04/23/1997 16:25:45
>Number:         3526
>Category:       port-i386
>Synopsis:       wds always probes true
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    gnats-admin (GNATS administrator)
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Wed Apr 23 13:35:01 1997
>Last-Modified:
>Originator:     Michael C. Richardson
>Organization:
Sandelman Software Works
>Release:        1.2
>Environment:
	
System: NetBSD istari.sandelman.ottawa.on.ca 1.2D NetBSD 1.2D (SSW) #5: Wed Apr 16 15:33:15 EDT 1997 mcr@istari.sandelman.ottawa.on.ca:/j/netbsd/src/sys/arch/i386/compile/SSW i386
Architecture: i386

>Description:
	dev/isa/wds.c's wds_find seems to return the wrong sense, and
	so wds? always probes true
>How-To-Repeat:
	Boot a -current kernel with wds? defined, but no cards installed.
>Fix:
*** /w/netbsd/src/sys/dev/isa/wds.c	Sat Mar 29 07:22:58 1997
--- wds.c	Wed Apr 23 16:22:37 1997
***************
*** 849,859 ****
  		delay(100);
  	}
  	if (!i)
! 		return 1;
  
  	bus_space_write_1(iot, ioh, WDS_CMD, WDSC_NOOP);
  	if ((bus_space_read_1(iot, ioh, WDS_STAT) & WDSS_RDY) != 0)
! 		return 1;
  
  	bus_space_write_1(iot, ioh, WDS_HCR, WDSH_SCSIRESET|WDSH_ASCRESET);
  	delay(10000);
--- 849,859 ----
  		delay(100);
  	}
  	if (!i)
! 		return 0;
  
  	bus_space_write_1(iot, ioh, WDS_CMD, WDSC_NOOP);
  	if ((bus_space_read_1(iot, ioh, WDS_STAT) & WDSS_RDY) != 0)
! 		return 0;
  
  	bus_space_write_1(iot, ioh, WDS_HCR, WDSH_SCSIRESET|WDSH_ASCRESET);
  	delay(10000);
***************
*** 862,868 ****
  	wds_wait(iot, ioh, WDS_STAT, WDSS_RDY, WDSS_RDY);
  	if (bus_space_read_1(iot, ioh, WDS_IRQSTAT) != 1)
  		if (bus_space_read_1(iot, ioh, WDS_IRQSTAT) != 7)
! 			return 1;
  
  	for (i = 2000; i; i--) {
  		if ((bus_space_read_1(iot, ioh, WDS_STAT) & WDSS_RDY) != 0)
--- 862,868 ----
  	wds_wait(iot, ioh, WDS_STAT, WDSS_RDY, WDSS_RDY);
  	if (bus_space_read_1(iot, ioh, WDS_IRQSTAT) != 1)
  		if (bus_space_read_1(iot, ioh, WDS_IRQSTAT) != 7)
! 			return 0;
  
  	for (i = 2000; i; i--) {
  		if ((bus_space_read_1(iot, ioh, WDS_STAT) & WDSS_RDY) != 0)
***************
*** 870,876 ****
  		delay(100);
  	}
  	if (!i)
! 		return 1;
  
  	if (sc) {
  #ifdef notyet
--- 870,876 ----
  		delay(100);
  	}
  	if (!i)
! 		return 0;
  
  	if (sc) {
  #ifdef notyet
***************
*** 881,887 ****
  		sc->sc_scsi_dev = 7;
  	}
  
! 	return 0;
  }
  
  /*
--- 881,887 ----
  		sc->sc_scsi_dev = 7;
  	}
  
! 	return 1;
  }
  
  /*

>Audit-Trail:
>Unformatted: