Subject: kern/13621: esp driver would not handle interrupt
To: None <gnats-bugs@gnats.netbsd.org>
From: None <h_itoh@de.neec.fc.nec.co.jp>
List: netbsd-bugs
Date: 08/02/2001 19:53:57
>Number:         13621
>Category:       kern
>Synopsis:       esp driver would not handle interrupt
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    kern-bug-people
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Thu Aug 02 19:51:00 PDT 2001
>Closed-Date:
>Last-Modified:
>Originator:     ITOH Hideki
>Release:        NetBSD 1.5W (2001/07/16)
>Organization:
NEC Engineering, Ltd.
>Environment:
NetBSD thomas 1.5W NetBSD 1.5W (THOMAS) #66: Fri Aug  3 10:05:05 JST 2001     hideki@thomas:/usr/src/sys/arch/i386/compile/THOMAS i386
>Description:
My PC is stopped after sending scsi command "test unit ready", when I insert or boot system with PC Card supported by esp driver.
It seems that esp driver would not establish the interrupt handler.
>How-To-Repeat:
Insert or boot system with PC Card supported by esp driver.
>Fix:
Below is a patch to fix this problem

--- esp_pcmcia.c.org	Tue Jul 31 19:48:53 2001
+++ esp_pcmcia.c	Fri Aug  3 10:19:41 2001
@@ -83,7 +83,7 @@
 void	esp_pcmcia_attach __P((struct device *, struct device *, void *));  
 void	esp_pcmcia_init __P((struct esp_pcmcia_softc *));
 int	esp_pcmcia_detach __P((struct device *, int));
-int	esp_pcmcia_enable __P((void *, int));
+int	esp_pcmcia_enable __P((struct device *, int));
 
 struct cfattach esp_pcmcia_ca = {
 	sizeof(struct esp_pcmcia_softc), esp_pcmcia_match, esp_pcmcia_attach,
@@ -202,6 +202,7 @@
 	esc->sc_flags |= ESP_PCMCIA_ATTACHING;
 	sc->sc_adapter.adapt_minphys = minphys;
 	sc->sc_adapter.adapt_request = ncr53c9x_scsipi_request;
+	sc->sc_adapter.adapt_enable = esp_pcmcia_enable;
 	ncr53c9x_attach(sc);
 	esc->sc_flags &= ~ESP_PCMCIA_ATTACHING;
 	esc->sc_flags |= ESP_PCMCIA_ATTACHED;
@@ -286,10 +287,10 @@
 
 int
 esp_pcmcia_enable(arg, onoff)
-	void *arg;
+	struct device *arg;
 	int onoff;
 {
-	struct esp_pcmcia_softc *esc = arg;
+	struct esp_pcmcia_softc *esc = (void *)arg;
 
 	if (onoff) {
 #ifdef ESP_PCMCIA_POLL

>Release-Note:
>Audit-Trail:
>Unformatted: