[nvmewin] Issues with sending NVME IDENTIFY command using the community driver
Sagi Bar
Sagi.Bar at sandisk.com
Tue Jul 1 06:56:31 PDT 2014
Hello All,
My name is Sagi and I am quite new to NVME, actually making my first steps.
I am currently trying to send an NVME IDNTIFY command to the device, but unfortunately I keep getting "The request could not be performed because of an I/O device error.".
The code I am using is largely taken from PT_IOCTL document.
#define NVME_PT_TIMEOUT 240
BOOL Status = 0;
DWORD Count = 0;
DWORD InputBufLen = 0;
DWORD OutputBufLen = 0;
PNVME_PASS_THROUGH_IOCTL pInBuffer = NULL;
PNVME_PASS_THROUGH_IOCTL pOutBuffer = NULL;
DWORD size_of_identify_buffer =0x1000; //4k
/* Allocate input buffer to accommodate size of NVME_PASS_THRUGH_IOCTL only */
InputBufLen = sizeof(NVME_PASS_THROUGH_IOCTL);
pInBuffer = (PNVME_PASS_THROUGH_IOCTL) malloc(InputBufLen);
/* Allocate output buffer to accommodate size of NVME_PASS_THRUGH_IOCTL and data */
OutputBufLen = sizeof(NVME_PASS_THROUGH_IOCTL) + size_of_identify_buffer - 1;
pOutBuffer = (PNVME_PASS_THROUGH_IOCTL) malloc(OutputBufLen);
if (pInBuffer == NULL || pOutBuffer == NULL)
{
cout<<"ERROR allocating buffers for identify command \n";
return ERROR_INVALID_PARAM;
}
/* Zero out the buffers */
memset(pInBuffer, 0, InputBufLen);
memset(pOutBuffer, 0, OutputBufLen);
/* Populate SRB_IO_CONTROL fields in input buffer */
pInBuffer->SrbIoCtrl.ControlCode = (ULONG)NVME_PASS_THROUGH_SRB_IO_CODE;
pInBuffer->SrbIoCtrl.HeaderLength = sizeof(SRB_IO_CONTROL);
memcpy((UCHAR*)(&pInBuffer->SrbIoCtrl.Signature[0]), NVME_SIG_STR, NVME_SIG_STR_LEN);
pInBuffer->SrbIoCtrl.Timeout = NVME_PT_TIMEOUT;
pInBuffer->SrbIoCtrl.Length = InputBufLen - sizeof(SRB_IO_CONTROL);
pInBuffer->Direction = NVME_FROM_DEV_TO_HOST;
pInBuffer->NVMeCmd[0]=0x6;
pInBuffer->NVMeCmd[10]=0x1;
pInBuffer->DataBufferLen = ByteSizeTX;
pInBuffer->ReturnBufferLen=OutputBufLen;
Status = DeviceIoControl(
disk_handle, /* Handle to \\.\scsi device via CreateFile */
IOCTL_SCSI_MINIPORT, /* IO control function to a miniport driver */
pInBuffer , /* Input buffer with data sent to driver */
InputBufLen, /* Length of data sent to driver (in bytes) */
pOutBuffer, /* Output buffer with data received from driver */
OutputBufLen, /* Length of data received from driver */
&Count, /* Bytes placed in DataBuffer */
NULL); /* NULL = no overlap */
In addition, I have launched "DebugView" on the test machine and I seem to get the following messages, produced by sending the IOCTL
"
55461250000 - STORMINI: NVMeProcessIoctl: Code = 0xe0002000, Signature = 0xNvmeMinið
55461250000 - STORMINI: NVMeGetPhysAddr: <Error> Invalid phys addr.
"
Can you please help me to understand what am I doing wrong ?
Thank you,
Sagi Bar
Test & Tools Staff FW Engineer
[cid:image001.png at 01CEA3CD.FE1957E0]
7 Atir Yeda St, Kfar - Saba 44425, Israel
T: +972-9-7632774 | M: +972-54-7665567
F: +972-3-5488666
sagi.bar at SanDisk.com<mailto:sagi.bar at SanDisk.com>
________________________________
PLEASE NOTE: The information contained in this electronic mail message is intended only for the use of the designated recipient(s) named above. If the reader of this message is not the intended recipient, you are hereby notified that you have received this message in error and that any review, dissemination, distribution, or copying of this message is strictly prohibited. If you have received this communication in error, please notify the sender by telephone or e-mail (as shown above) immediately and destroy any and all copies of this message in your possession (whether hard copies or electronically stored copies).
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openfabrics.org/pipermail/nvmewin/attachments/20140701/99ef83b3/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image001.png
Type: image/png
Size: 2139 bytes
Desc: image001.png
URL: <http://lists.openfabrics.org/pipermail/nvmewin/attachments/20140701/99ef83b3/attachment.png>
More information about the nvmewin
mailing list