From mboxrd@z Thu Jan 1 00:00:00 1970 From: =?ISO-8859-2?Q?Micha=B3_Miros=B3aw?= Subject: Re: [PATCH v4] mmc: Add ioctl to let userspace apps send ACMDs Date: Tue, 12 Apr 2011 16:21:38 +0200 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-2 Content-Transfer-Encoding: QUOTED-PRINTABLE Return-path: Received: from mail-qy0-f181.google.com ([209.85.216.181]:44571 "EHLO mail-qy0-f181.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755069Ab1DLOV7 convert rfc822-to-8bit (ORCPT ); Tue, 12 Apr 2011 10:21:59 -0400 Received: by qyg14 with SMTP id 14so4675203qyg.19 for ; Tue, 12 Apr 2011 07:21:58 -0700 (PDT) In-Reply-To: Sender: linux-mmc-owner@vger.kernel.org List-Id: linux-mmc@vger.kernel.org To: John Calixto Cc: linux-mmc@vger.kernel.org, Arnd Bergmann , Chris Ball , Andrei Warkentin 2011/4/11 John Calixto : [...] > --- /dev/null > +++ b/include/linux/mmc/ioctl.h > @@ -0,0 +1,32 @@ > +#ifndef _MMC_IOCTL_H > +#define _MMC_IOCTL_H > +struct mmc_ioc_cmd { > + =A0 =A0 =A0 /* implies direction of data. =A0true =3D write, false = =3D read */ > + =A0 =A0 =A0 int write_flag; > + > + =A0 =A0 =A0 __u32 opcode; > + =A0 =A0 =A0 __u32 arg; > + =A0 =A0 =A0 __u32 response[4]; =A0/* CMD response */ > + =A0 =A0 =A0 unsigned int flags; > + =A0 =A0 =A0 unsigned int blksz; > + =A0 =A0 =A0 unsigned int blocks; > + > + =A0 =A0 =A0 /* > + =A0 =A0 =A0 =A0* Sleep at least postsleep_min_us useconds, and at m= ost > + =A0 =A0 =A0 =A0* postsleep_max_us useconds *after* issuing command.= =A0Needed for some > + =A0 =A0 =A0 =A0* read commands for which cards have no other way of= indicating > + =A0 =A0 =A0 =A0* they're ready for the next command (i.e. there is = no equivalent of a > + =A0 =A0 =A0 =A0* "busy" indicator for read operations). > + =A0 =A0 =A0 =A0*/ > + =A0 =A0 =A0 unsigned int postsleep_min_us; > + =A0 =A0 =A0 unsigned int postsleep_max_us; > + > + =A0 =A0 =A0 /* > + =A0 =A0 =A0 =A0* Override driver-computed timeouts. =A0Note the dif= ference in units! > + =A0 =A0 =A0 =A0*/ > + =A0 =A0 =A0 unsigned int data_timeout_ns; > + =A0 =A0 =A0 unsigned int cmd_timeout_ms; > + =A0 =A0 =A0 __u64 data_ptr; =A0/* DAT buffer */ This will be more natural if you have an anonymous union here: union { __u64 data_ptr_l; void *data_ptr; }; > +}; > +#define MMC_IOC_ACMD _IOWR(MMC_BLOCK_MAJOR, 0, struct mmc_ioc_cmd) > +#endif =A0/* _MMC_IOCTL_H */ Best Regards, Micha=B3 Miros=B3aw