Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 22 Dec 1995 13:06:26 +0500 (GMT+0500)
From:      "Serge A. Babkin" <babkin@hq.icb.chel.su>
To:        bde@zeta.org.au
Cc:        erich@jake.lodgenet.com, ptitz@base.dux.ru, alexis@ww.net, hackers@freebsd.org
Subject:   Digiboard patch
Message-ID:  <199512220806.NAA15789@hq.icb.chel.su>

next in thread | raw e-mail | index | archive | help
Hi!

I have made a patch for Digiboard. It does:

1. Fixes the bug with erroneous resending of the output buffer

2. Fixes the problem with panics when some verisons of Digiboard report
events on nonexisting ports

3. Fixes the bug with registering the device for lsdev

I have created this patch on a slightly old version of driver but it
applies very well to -current (I tested):

-------------------------- cut here----------------------------------------
*** 1.44	1995/12/22 07:26:52
--- dgb.c	1995/12/22 07:42:08
***************
*** 434,440 ****
  	&kdc_isa0,		/* parent */
  	0,			/* parentdata */
  	DC_UNCONFIGURED,
! 	"DigiBoard multiport card"
  } };
  
  static void
--- 434,441 ----
  	&kdc_isa0,		/* parent */
  	0,			/* parentdata */
  	DC_UNCONFIGURED,
! 	"DigiBoard multiport card",
! 	DC_CLS_SERIAL,
  } };
  
  static void
***************
*** 450,456 ****
  	kdc_dgb[unit].kdc_isa = id;
  
  	/* now we assume that multiport is always 'open' for simplicity */
! 	kdc_dgb[unit].kdc_state = DC_BUSY;
  	dev_attach(&kdc_dgb[unit]);
  }
  
--- 451,457 ----
  	kdc_dgb[unit].kdc_isa = id;
  
  	/* now we assume that multiport is always 'open' for simplicity */
! 	kdc_dgb[unit].kdc_state = DC_UNKNOWN;
  	dev_attach(&kdc_dgb[unit]);
  }
  
***************
*** 872,877 ****
--- 873,880 ----
  
  	hidewin(sc);
  
+ 	dgbregisterdev(dev);
+ 
  	/* register the polling function */
  	timeout(dgbpoll, (void *)unit, hz/25);
  
***************
*** 1217,1229 ****
  		lstat=eventbuf[3];
  
  		port=&sc->ports[pnum];
- 		bc=port->brdchan;
  		tp=&sc->ttys[pnum];
  
  		if(pnum>=sc->numports || port->status==DISABLED) {
  			printf("dgb%d: port %d: got event on nonexisting port\n",unit,pnum);
  		} else if(port->used || port->wopeners>0 ) {
  
  			if( !(event & ALL_IND) ) 
  				printf("dgb%d: port%d: ? event 0x%x mstat 0x%x lstat 0x%x\n",
  					unit, pnum, event, mstat, lstat);
--- 1220,1233 ----
  		lstat=eventbuf[3];
  
  		port=&sc->ports[pnum];
  		tp=&sc->ttys[pnum];
  
  		if(pnum>=sc->numports || port->status==DISABLED) {
  			printf("dgb%d: port %d: got event on nonexisting port\n",unit,pnum);
  		} else if(port->used || port->wopeners>0 ) {
  
+ 			bc=port->brdchan;
+ 
  			if( !(event & ALL_IND) ) 
  				printf("dgb%d: port%d: ? event 0x%x mstat 0x%x lstat 0x%x\n",
  					unit, pnum, event, mstat, lstat);
***************
*** 1375,1388 ****
  #endif
  			end_of_buffer:
  			}
  		} else {
  			DPRINT4("dgb%d: port %d: got event 0x%x on closed port\n",
  				unit,pnum,event);
  			bc->rout=bc->rin;
  			bc->idata=bc->iempty=bc->ilow=0;
  		}
- 			
- 		bc->idata=1; 
  
  		tail= (tail+4) & (FEP_IMAX-FEP_ISTART-4);
  	}
--- 1379,1393 ----
  #endif
  			end_of_buffer:
  			}
+ 			bc->idata=1; 
+ 
  		} else {
+ 			bc=port->brdchan;
  			DPRINT4("dgb%d: port %d: got event 0x%x on closed port\n",
  				unit,pnum,event);
  			bc->rout=bc->rin;
  			bc->idata=bc->iempty=bc->ilow=0;
  		}
  
  		tail= (tail+4) & (FEP_IMAX-FEP_ISTART-4);
  	}
***************
*** 1928,1933 ****
--- 1933,1940 ----
  
  		ocount=q_to_b(&tp->t_outq, port->txptr+head, size);
  		head+=ocount;
+ 		if(head>=port->txbufsize)
+ 			head-=port->txbufsize;
  
  		setwin(sc,0);
  		bc->tin=head;



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199512220806.NAA15789>