Subject: Re: twe(4) question for NetBSD-1.6/i386
To: None <tech-kern@netbsd.org>
From: Brian Buhrow <buhrow@lothlorien.nfbcal.org>
List: tech-kern
Date: 12/06/2002 01:34:36
	Following up again on my own adventures with the twe(4) driver, I've
got things working.  Below is the patch I needed to use to get the card
communicating with the driver.  The stock driver is very quick to timeout
when polling the card.  This is a 12-port card with 12 200GB disks attached
to it.  It takes a while to do a soft reset and a config.
	I'll send-pr this diff file, which should easily 
apply to 1.6 and 1.6-current, and hope it gets integrated into the release.
 I think we should be able to support any sized Escalade card out of the
box, and I believe this simple patch does just that.
-thanks
-Brian

*** twe.c	Fri Dec  6 00:21:48 2002
--- twe.c.fcs	Sun May 26 09:05:36 2002
***************
*** 373,379 ****
  	    TWE_CTL_CLEAR_ERROR_STS |
  	    TWE_CTL_DISABLE_INTRS);
  
! 	if (twe_status_wait(sc, TWE_STS_ATTN_INTR, 150)) {
  		printf("%s: no attention interrupt\n",
  		    sc->sc_dv.dv_xname);
  		return (-1);
--- 373,379 ----
  	    TWE_CTL_CLEAR_ERROR_STS |
  	    TWE_CTL_DISABLE_INTRS);
  
! 	if (twe_status_wait(sc, TWE_STS_ATTN_INTR, 15)) {
  		printf("%s: no attention interrupt\n",
  		    sc->sc_dv.dv_xname);
  		return (-1);
***************
*** 633,639 ****
  	/* Submit the command and either wait or let the callback handle it. */
  	if (func == NULL) {
  		s = splbio();
! 		rv = twe_ccb_poll(sc, ccb, 500);
  		twe_ccb_unmap(sc, ccb);
  		twe_ccb_free(sc, ccb);
  		splx(s);
--- 633,639 ----
  	/* Submit the command and either wait or let the callback handle it. */
  	if (func == NULL) {
  		s = splbio();
! 		rv = twe_ccb_poll(sc, ccb, 5);
  		twe_ccb_unmap(sc, ccb);
  		twe_ccb_free(sc, ccb);
  		splx(s);