iwub
驱动牛犊
驱动牛犊
  • 注册日期2002-10-09
  • 最后登录2009-06-22
  • 粉丝0
  • 关注0
  • 积分7分
  • 威望60点
  • 贡献值0点
  • 好评度17点
  • 原创分0分
  • 专家分0分
阅读:1956回复:0

SdBusSubmitRequest CMD52 CMD53 wrong

楼主#
更多 发布于:2005-06-13 11:17
The SD bus need transmit block one by one.
I do not know what is the block size of each?
and what different between SDTT_SINGLE_BLOCK and SDTT_MULTI_BLOCK?


How to send the image file down to the HW?
Idefine a function as below, but the return of the sdrp->ResponseData is
1000h
and the sdrp->ResponseLength is 4 all the time.

why?
Who knows difference in Response1 to Response5?
THX,

SD_API_STATUS SdioCommand52(IN PMRVDRV_ADAPTER Adapter, int rw,
       UCHAR fn, BOOLEAN raw, ULONG addr,
       UCHAR *pValue, ULONG len);

  PSDBUS_REQUEST_PACKET sdrp =NULL;
  SD_RW_DIRECT_ARGUMENT sdIoArgument;
  SDCMD_DESCRIPTOR IoDirectDesc={
      SDCMD_IO_RW_DIRECT,//SD_COMMAND_CODE        Cmd
   SDCC_STANDARD,     //SD_COMMAND_CLASS       CmdClass
   SDTD_READ,         //SD_TRANSFER_DIRECTION  TransferDirection
   SDTT_CMD_ONLY,     //SD_TRANSFER_TYPE       TransferType
   SDRT_5 };          //SD_RESPONSE_TYPE       ResponseType
  KdPrint((\"SdioCommand52()  ------>len = %x\\n\",len));
  if(rw)  //if write
      IoDirectDesc.TransferDirection=SDTD_WRITE;
     //addr +=0x80000000;
  sdrp = ExAllocatePool(NonPagedPool,sizeof(SDBUS_REQUEST_PACKET));

  RtlZeroMemory(sdrp,sizeof(SDBUS_REQUEST_PACKET));
  sdrp->RequestFunction = SDRF_DEVICE_COMMAND;
  NdisMoveMemory(&(sdrp->Parameters.DeviceCommand.CmdDesc),
               &IoDirectDesc,sizeof(SDCMD_DESCRIPTOR));
  sdIoArgument.u.AsULONG = 0;
     sdIoArgument.u.bits.Address = addr;//Offset;
  sdIoArgument.u.bits.Function =
Adapter->FunctionNumber;//1;//pDevExt->FunctionNumber;
     KdPrint((\"SdioCommand52: FucntionNumber = %x
,sdrp->Parameters.DeviceCommand.Argument
=%x\\n\",Adapter->FunctionNumber,sdrp->Parameters.DeviceCommand.Argument));

               /*
if(IoDirectDesc.TransferDirection==SDTD_READ)
 sdIoArgument.u.bits.WriteToDevice = 0;
else
  sdIoArgument.u.bits.WriteToDevice = 1;
*/   sdIoArgument.u.bits.WriteToDevice = rw;
  sdrp->Parameters.DeviceCommand.Argument = sdIoArgument.u.AsULONG;
   //sdIoArgument.u.bits.Address = addr;

   Status = SdBusSubmitRequest(Adapter->SdBusIfStd.Context,sdrp);
      //KdPrint((\"SdioCommand52: SdBusSubmitRequest()  2 success
Information = %s\\n\",sdrp->Information));
iwub
游客

返回顶部