Subject: Re: TECHNICAL INFO ON THE AST CARD WANTED
To: Chris G. Demetriou <cgd@alpha.bostic.com>
From: Bill Sommerfeld <sommerfeld@orchard.medford.ma.us>
List: current-users
Date: 08/12/1994 10:22:51
Try the following (tested) patch to ast.c; if you set "flags 1" on
ast0 you get the current behavior, while with "flags 0" it forces
"flags 1" on all the subdevices.

(I tested it with my card to make sure things still worked, and I also
tested the "ast0 ... flags 1" case to verify that the subdevices did
*not* get the flags set).

					- Bill

*** 1.1.1.2	1994/04/10 01:18:39
--- ast.c	1994/08/12 14:01:25
***************
*** 54,60 ****
--- 54,62 ----
  struct ast_attach_args {
  	u_short aa_iobase;
  	int aa_slave;
+ 	int aa_subflags;
  };
+ #define AST_NEEDS_IEN		1
  
  int
  astsubmatch(parent, self, aux)
***************
*** 66,72 ****
  	struct cfdata *cf = self->dv_cfdata;
  	int found, frobbed = 0;
  #ifdef NEWCONFIG
- 
  #define cf_slave cf_loc[6]
  	if (cf->cf_slave != -1 && cf->cf_slave != aa->aa_slave)
  		return 0;
--- 68,73 ----
***************
*** 85,90 ****
--- 86,92 ----
  		id->id_iobase = aa->aa_iobase;
  	}
  #endif
+ 	cf->cf_flags |= aa->aa_subflags;
  	found = isasubmatch(parent, self, aux);
  	if (found) {
  		sc->sc_slaves[aa->aa_slave] = self;
***************
*** 113,118 ****
--- 115,121 ----
  	struct ast_softc *sc = (void *)self;
  	struct isa_attach_args *ia = aux;
  	struct ast_attach_args aa;
+ 	struct cfdata *cf = sc->sc_dev.dv_cfdata;
  
  	/*
  	 * Enable the master interrupt.
***************
*** 120,125 ****
--- 123,132 ----
  	sc->sc_iobase = ia->ia_iobase;
  	outb(sc->sc_iobase | 0x1f, 0x80);
  	printf("\n");
+ 
+ 	aa.aa_subflags = 1;
+ 	if (cf->cf_flags & AST_NEEDS_IEN)
+ 		aa.aa_subflags &= ~1;
  
  	for (aa.aa_slave = 0, aa.aa_iobase = sc->sc_iobase;
  	    aa.aa_slave < 4;

------------------------------------------------------------------------------