none
IO are passed in what format between Sd Bus library and SdHost Class Driver ? RRS feed

  • Question

  • Hi,

    I was trying to analyze the data that is received by the SDHost Class Driver.
    For this task I built upper filter driver and attach to the SDHost Class Driver. The Filter Driver can intercept the IRPs (main read/write/DeviceIoControl) passing to the class driver and debug print the information on the debugger.

    But, I don't see IRP information coming on the Debugger. I think the IRPs has been modified in other format by upper layers before sending to the SdHost Driver.

    If my understanding is correct till this point, can someone give me an idea about in which format IOs are send to the SdHost Driver. Or what other ways can I analyze the Data received by the driver.

    Meanwhile, I am aware of the following statement provided in SD Card Driver Stack msdn document.

    "All device drivers in the SD stack, whether native or vendor-supplied, must communicate with the SD bus driver by calling routines in the static SD bus library (sdbus.lib). SD drivers must link to this library when they compile.

    SD device drivers cannot directly access the host-controller register set, nor can they embed pass-through commands for the host controller in I/O request packets (IRPs). SD device drivers issue commands to the host controller by calling the SD bus library routines, and then the library generates the appropriate SD commands for the host controller. "

    But my task here was somehow to see if there is a way to bypass Sd bus library.

    Thanks and Regards,
    Rakendra

    Wednesday, October 26, 2016 12:35 PM

Answers

  • Your task of bypassing the SD Bus Library is doomed to fail.  I have not looked at SD drivers recently, but there is nothing in the kernel that stops the library from doing direct calls with no IRP's involved.   More importantly this is an undocumented interface, so even if you find a way to do this for a revision of Windows, it is highly likely it will not work in the future.

    What is the real problem you are trying to solve?  I.E. why can't you use the standard stack and the SD Bus Library?


    Don Burn Windows Driver Consulting Website: http://www.windrvr.com

    Wednesday, October 26, 2016 12:56 PM

All replies

  • Your task of bypassing the SD Bus Library is doomed to fail.  I have not looked at SD drivers recently, but there is nothing in the kernel that stops the library from doing direct calls with no IRP's involved.   More importantly this is an undocumented interface, so even if you find a way to do this for a revision of Windows, it is highly likely it will not work in the future.

    What is the real problem you are trying to solve?  I.E. why can't you use the standard stack and the SD Bus Library?


    Don Burn Windows Driver Consulting Website: http://www.windrvr.com

    Wednesday, October 26, 2016 12:56 PM
  • Thanks for the quick response Don.

    My goal here is to be able to send all eMMC Commands from the application layer.

    Using standard stack and SD Bus library, though I am able to send many eMMC Commands successfully, but there still are lot of eMMC Commands that fail with ACCESS_DENIED error. 

    Actually, here goes the complete story:

    Initially I had build a lower filter driver to SCSIAdapter class driver. I was successfully able to open and initialize the SD Bus interface using calls to SD Bus library. Using this driver, I was able to issue eMMC Commands to the attached eMMC device successfully from the application.

    But, still there were many eMMC commands that failed and showed ACCESS_DENIED error.

    Observing from the Event Logs and the Driver logs, I was able to determine that the commands never reached eMMC and were failed by SdBus Library.

    Thus, to further able to understand how data is send between SdBus and SdHost Class driver I made the upper filter driver to SDHost Class Driver. This driver can intercepts the IRPs to be received by the SdHost Class Driver.

    But, as I mentioned earlier, that I am not able to see any IRP information in the driver logs. Thus, I think that data is not exchanged in IRP format.

    Thanks and Regards,
    Rakendra



    Friday, October 28, 2016 2:01 PM
  • This is one I think you will need to discuss with Microsoft directly.   Perhaps one of the Microsoft developers on this forum can suggest a contact for the SD Bus support, otherwise you may need to go through Windows support.


    Don Burn Windows Driver Consulting Website: http://www.windrvr.com

    Friday, October 28, 2016 2:10 PM
  • Thanks for your response Don. 
    Is there anyone who can suggest a contact for SD Bus Support here. ?

    Thanks and Regards.
    Rakendra

    Friday, November 11, 2016 2:08 PM
  • For the update and for reference of other developers in the forum.

    I went through the Microsoft support system to seek response to the some commands being failed by SDBUS library.
    Their response was that "We do block various commands from being sent to the hardware for reliability and security purposes."


    Thanks and Regards,
    Rakendra


    Sunday, February 19, 2017 8:50 AM