Re: A question on IOCTL interface for MMC

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi All,
Let me explain things in detail :-

My INTENT / REQUIREMENT is to test "ALL"  the SD/MMC Commands and NOT
just the Read/Write(data transfer) Commands.

How can this be helpful
  1. It can be used to validate the SD/MMC Core flows(Command specific
code paths)
  2. The Card Enumeration can be done from user space or for that
matter any sequence of commands can be sent from the user space.
  3. Individual commands can be tested with this interface, which is
good for the Buggy IP/Hardware testing. This provides fine control
over testing.

To do this I had two options
  1. Use the Block layer IOCTL.
  2. Write my own kernel module and hack MMC Core to call command
specific functions. This would be similar to "mmc_test.c" module.

APPROACH 1 : Using the Block Layer IOCTL

  Block Layer IOCTL expects only the READ/WRITE commands and hence its
  limited in functionality. I cannot send commands other than
Read/Write, say CMD 2 or
  CMD 0.
  Also you said that the Block Layer cannot be modified to add support for the
  non read/write commands. How should I go about this ?

   OR

  Can we have an IOCTL in MMC Core like the one at Block layer.

    Or

  Can we have a kernel module which can directly call the driver by bypassing
  mmc_core.

APPROACH 2 :

  I have already tested a Kernel Module that uses the sysfs interface to
  send commands. MMC Core will have to be binded to this kernel module.
  This is similar to mmc_test.c module usage.

  Commands will be sent via the sys file and response can be got from the card.
  As of now, the response is not sent to the user space but just to
/var/log/messages.

  MMC Core has to be hacked to export certain functions which will be called
  from the module.

  Is this ok and  can I submit this code.

Cheers,
Shashi


On Fri, Oct 21, 2011 at 10:04 AM, Shashidhar Hiremath
<shashidharh@xxxxxxxxxxxxxxx> wrote:
> thanks for the reply Andrei,
>  through the IOCTL, I am actually trying to send a command to the
> device and validate the response.So, when I send the command using the
> IOCTL, I actually get a Input/Output Error. The reason I feel is that
> the command is sent to the block layer and since block layer only
> supports the read/write commands,even when I send command zero ,it
> treats it like a read/write command.
>
> On Thu, Oct 20, 2011 at 8:25 PM, Andrei Warkentin <awarkentin@xxxxxxxxxx> wrote:
>> Hi,
>>
>> ----- Original Message -----
>>> From: "Shashidhar Hiremath" <shashidharh@xxxxxxxxxxxxxxx>
>>> To: "Chris Ball" <cjb@xxxxxxxxxx>, "J Freyensee" <james_p_freyensee@xxxxxxxxxxxxxxx>, "John Calixto"
>>> <john.calixto@xxxxxxxxxxxxxx>, linux-mmc@xxxxxxxxxxxxxxx
>>> Sent: Thursday, October 20, 2011 1:09:00 AM
>>> Subject: A question on IOCTL interface for MMC
>>>
>>> Hi ,
>>>   I am planning to use the existing IOCTL interface for SD/MMC
>>>   present
>>> in the kernel.
>>>   Since, the IOCTL interface expects a read/write flag and the MMC
>>> IOCTL is actually an interface to block layer I feel without
>>> modifying
>>> the block layer for the support of non-read write commands ,I may not
>>> be able to test the non-read/write commands through the IOCTL
>>> interface .
>>
>> Unsure what you mean. Certainly it's up to you how to handle the data
>> you pass to the ioctl(). The "in" and "out" just says whether you
>> are passing data to the kernel or expecting something back, no more -
>> no less.
>>
>> What are you actually trying to do? What are you trying to expose or control
>> through an ioctl?
>>
>> A
>>
>
>
>
> --
> regards,
> Shashidhar Hiremath
>
--
To unsubscribe from this list: send the line "unsubscribe linux-mmc" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux USB Devel]     [Linux Media]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux