PCMCIA fun

Richard Zidlicky rz at linux-m68k.org
Thu Mar 18 22:13:48 GMT 2004


On Thu, Mar 18, 2004 at 08:45:01AM -0800, David Hinds wrote:
> On Thu, Mar 18, 2004 at 10:14:44AM +0100, Geert Uytterhoeven wrote:
> > 
> > That's a bug in rsrc_mgr.c: since PCMCIA is ISA, it should use isa_readl()
> > instead of readl().
> 
> This is not a true statement.  PCMCIA is no more ISA or PCMCIA than,
> say, SCSI.  It only describes the point-to-point interface to a
> device, and PCMCIA interfaces may appear on ISA, PCI, SBUS, etc host
> busses.

I can see how you can use readl on PCI or SBUS, but what is supposed to
happen on true 16 bit ISA?

> > > - drivers/net/pcmcia/pcnet_cs.c:
> > >   The first one I tried (since it's my normal Ethernet card). It didn't
> > >   compile cleanly: it uses __raw_writew() and __raw_readw() to transfer
> > >   date to/from the shared memory buffer on some cards, and we don't have
> > >   those. I'm not sure how to define them though, should they be "native"
> > >   byte order? That would mean I have to byte-swap them on Gayle, right?
> > >   I can't test these since I don't have a shared-memory NE2000 clone.
> > 
> > Ugh, __raw_{write,read}w() are architecture-dependant, and not to be used by
> > common code.
> 
> I'm not sure I follow.  All low-level IO services are architecture
> dependant, right?  Do you mean that the existence of these calls is
> architecture dependant?  They seem to be available on at least all
> widely used architectures, and while many drivers do not use them,
> there are quite a few that do.

the difference between readw/writew and__raw_readw/__raw_writew appears
to be that the former fix bus endianness on some architectures, the _raw
ones dont. By using the later ones we basically rely on bus specific
properties. In pcnet_cs.c we do not know on which type of bus the 
PCMCIA is on, so this can't be right.

Eg on my m68k machine the ISA bus is byteswapped (nothing to do with
CPU endianness) and I am sure that 
  #define __raw_readw readw
would be the only way to get pcnet_cs.c working on that machine.

Richard



More information about the linux-pcmcia mailing list