lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Date:	Wed, 7 Mar 2007 09:55:30 -0800
From:	David Brownell <david-b@...bell.net>
To:	ngustavson@...cinc.com
Cc:	Linux Kernel list <linux-kernel@...r.kernel.org>
Subject: Re: passing function pointers through platform devices?

> I'm developing an SPI- bus >MMC/SD block driver translation layer.

Another one?  There's already been significant work in that area.  See for
example

  http://marc.theaimsgroup.com/?l=linux-kernel&m=117000652529003&w=2

Which admittedly didn't behave when I just put it onto my test rig,
but seems nonetheless to be a significant step forward.  It's not like
everyone has hardware that can use such a driver after all!


> As part of this layer the write protect and card detect lines need to be read.
> The method for determining the state of these lines will be board specific.

Example, one usually wants card detect to be an IRQ, to avoid polling...


> Is it appropriate to pass a function pointer through a platform device 
> (declared in the mach initialization) to implement card_available and 
> write_protect function calls?

That's how it's done in that patch.  The model being what the PXA MMC/SD
card driver does, since that's the most generic model I found ... handling
for example systems which need to poll for card detect, as well as ones
that can use real gpio based IRQs.  The mmc_spi driver doesn't need to know
which kind of platform it's got.

- Dave



 
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ