Subject: Re: ATM en0 driver on sbus
To: Eduardo E. Horvath <eeh@one-o.com>
From: Ruibiao Qiu <ruibiao@arl.wustl.edu>
List: port-sparc
Date: 08/14/1998 12:52:34
On Fri, 14 Aug 1998, Eduardo E. Horvath wrote:

>On Thu, 13 Aug 1998, Chuck Cranor wrote:

>> >When I did 'make depend', it showed two redefinition warnings of
>> >bus_space_read_4 and bus_space_write_4 in if_en.c and
>> >machine/sbus.h.  

>> the problem here is that i created if_en_sbus.c before the sparc
>> port had the bus_space functions available so I faked it in midwayreg.h.
>> now that sparc has those macros this hack should be turned off.

>You should be using bus_dmamem_alloc() and bus_dmamem_map() for any memory
>that the chip will be doing DMA to/from (see dev/sbus/if_le.c).  There
>also should be calls to bus_dmamap_sync() (which I don't think we're doing
>now) before and after accessing any of the memory that was DMA'ed from or
>to.  This is needed for any possible flushing of the CPU's cache or any
>I/O cache, although this is usually a non-issue since most of our hardware
>does consistent DMA.

>Lookin in `midwayreg.h', It would be a good idea to remove the
>compatibility bus.h stuff since there's the line:

>#define vtophys(x) ((u_int32_t)(x))     /* sun4c dvma */

So, for me to use the driver, what should I do to make it work?

I commented out the #defines in midwayreg.h, and got make depend
pass.  Then, I ran into following warnings:

o implicit declarations of bus_space_read_4 and bus_space_write_4

o arg mismatch in en_attach, long int format, int arg, (arg 9)

Thanks in advance

          Regards

            Ruibiao

/~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\
   Ruibiao Qiu                      ruibiao@arl.wustl.edu
   Research Assistant               ruibiao@cs.wustl.edu
   Applied Research Laboratory      rq1@cec.wustl.edu
   Department of Computer Science   ruibiao@acm.org
   Washington University            http://www.arl.wustl.edu/~ruibiao
   Campus Box 1045                  http://www.cs.wustl.edu/~ruibiao
   One Brookings Drive              Tel. (314)935-8563
   St. Louis, MO 63130-4899 USA     Fax  (314)935-7302
\____________________________________________________________________/