Subject: Re: Is sbdsp.c misusing bus_space_write_1?
To: John F. Woods <jfw@funhouse.com>
From: Manuel Bouyer <bouyer@antioche.lip6.fr>
List: current-users
Date: 07/03/1998 16:27:00
On Jul 3, John F. Woods wrote
> In studying the soundblaster driver (to figure out how to write a proper
> ProAudio Spectrum driver), I noticed that sbdsp.c has the following
> code:
> 
> 	if (bus_space_map(iot, JAZZ16_CONFIG_PORT, 1, 0, &ioh)) {
>            ...
> 	}
> 	bus_space_write_1(iot, ioh, 0, JAZZ16_WAKEUP);
> 	delay(10000);			/* delay 10 ms */
> 	bus_space_write_1(iot, ioh, 0, JAZZ16_SETBASE);
> 	bus_space_write_1(iot, ioh, 0, sc->sc_iobase & 0x70);
> 
> Now, does bus_space_map create a mapping which you apply local offsets
> to, or does it simply validate certain regions of the given mapped
> space which you still must supply correct offsets to?  (In other
> words, should those 0s be JAZZ16_CONFIG_PORT?)

No. The base adress of the mapped region is given in bus_space_map, and is
stored in a opaque way in the ioh. In the bus_space(read,write) you just
give the offset from the base address. 
This code looks perfectly valid to me.

--
Manuel Bouyer, LIP6, Universite Paris VI.           Manuel.Bouyer@lip6.fr
--