<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<meta name="Generator" content="Microsoft Word 14 (filtered medium)">
<!--[if !mso]><style>v\:* {behavior:url(#default#VML);}
o\:* {behavior:url(#default#VML);}
w\:* {behavior:url(#default#VML);}
.shape {behavior:url(#default#VML);}
</style><![endif]--><style><!--
/* Font Definitions */
@font-face
        {font-family:SimSun;
        panose-1:2 1 6 0 3 1 1 1 1 1;}
@font-face
        {font-family:SimSun;
        panose-1:2 1 6 0 3 1 1 1 1 1;}
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
        {font-family:Tahoma;
        panose-1:2 11 6 4 3 5 4 4 2 4;}
@font-face
        {font-family:"\@SimSun";
        panose-1:2 1 6 0 3 1 1 1 1 1;}
@font-face
        {font-family:Verdana;
        panose-1:2 11 6 4 3 5 4 4 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0in;
        margin-bottom:.0001pt;
        font-size:11.0pt;
        font-family:"Calibri","sans-serif";}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:purple;
        text-decoration:underline;}
p
        {mso-style-priority:99;
        mso-margin-top-alt:auto;
        margin-right:0in;
        mso-margin-bottom-alt:auto;
        margin-left:0in;
        font-size:12.0pt;
        font-family:"Times New Roman","serif";}
p.MsoAcetate, li.MsoAcetate, div.MsoAcetate
        {mso-style-priority:99;
        mso-style-link:"Balloon Text Char";
        margin:0in;
        margin-bottom:.0001pt;
        font-size:8.0pt;
        font-family:"Tahoma","sans-serif";}
span.EmailStyle17
        {mso-style-type:personal-compose;
        font-family:"Calibri","sans-serif";
        color:#1F497D;}
span.BalloonTextChar
        {mso-style-name:"Balloon Text Char";
        mso-style-priority:99;
        mso-style-link:"Balloon Text";
        font-family:"Tahoma","sans-serif";}
.MsoChpDefault
        {mso-style-type:export-only;
        font-family:"Calibri","sans-serif";}
@page WordSection1
        {size:8.5in 11.0in;
        margin:1.0in 1.0in 1.0in 1.0in;}
div.WordSection1
        {page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
</head>
<body lang="EN-US" link="blue" vlink="purple">
<div class="WordSection1">
<p class="MsoNormal"><span style="color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="color:#1F497D">Hello All,<o:p></o:p></span></p>
<p class="MsoNormal"><span style="color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="color:#1F497D">My name is Sagi and I am quite new to NVME, actually making my first steps.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="color:#1F497D"><o:p> </o:p></span></p>
<p><span style="color:#1F497D">I am currently trying to send an NVME IDNTIFY command to the device, but unfortunately I keep getting “</span>The request could not be performed because of an I/O device error.”.<o:p></o:p></p>
<p><span style="color:#1F497D">The code I am using is largely taken from PT_IOCTL document.<o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-family:"Verdana","sans-serif";background:white;mso-highlight:white">  
<span style="color:blue">#define</span> <span style="color:#010001">NVME_PT_TIMEOUT</span> 240<o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-family:"Verdana","sans-serif";background:white;mso-highlight:white">        
<o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-family:"Verdana","sans-serif";background:white;mso-highlight:white">        
<o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-family:"Verdana","sans-serif";background:white;mso-highlight:white">        
<span style="color:#010001">BOOL</span> <span style="color:#010001">Status</span> = 0;<o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-family:"Verdana","sans-serif";background:white;mso-highlight:white">        
<span style="color:#010001">DWORD</span> <span style="color:#010001">Count</span> = 0;<o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-family:"Verdana","sans-serif";background:white;mso-highlight:white">        
<span style="color:#010001">DWORD</span> <span style="color:#010001">InputBufLen</span> = 0;<o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-family:"Verdana","sans-serif";background:white;mso-highlight:white">        
<span style="color:#010001">DWORD</span> <span style="color:#010001">OutputBufLen</span> = 0;<o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-family:"Verdana","sans-serif";background:white;mso-highlight:white">        
<span style="color:#010001">PNVME_PASS_THROUGH_IOCTL</span> <span style="color:#010001">
pInBuffer</span> = <span style="color:#010001">NULL</span>;<o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-family:"Verdana","sans-serif";background:white;mso-highlight:white">        
<span style="color:#010001">PNVME_PASS_THROUGH_IOCTL</span> <span style="color:#010001">
pOutBuffer</span> = <span style="color:#010001">NULL</span>;<o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-family:"Verdana","sans-serif";background:white;mso-highlight:white">        
<span style="color:#010001">DWORD</span> <span style="color:#010001">size_of_identify_buffer</span> =0x1000;
<span style="color:green">//4k<o:p></o:p></span></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-family:"Verdana","sans-serif";color:green;background:white;mso-highlight:white"><o:p> </o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-family:"Verdana","sans-serif";background:white;mso-highlight:white">        
<span style="color:green">/* Allocate input buffer to accommodate size of NVME_PASS_THRUGH_IOCTL only */<o:p></o:p></span></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-family:"Verdana","sans-serif";background:white;mso-highlight:white">        
<span style="color:#010001">InputBufLen</span> = <span style="color:blue">sizeof</span>(<span style="color:#010001">NVME_PASS_THROUGH_IOCTL</span>);<o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-family:"Verdana","sans-serif";background:white;mso-highlight:white">        
<span style="color:#010001">pInBuffer</span> = (<span style="color:#010001">PNVME_PASS_THROUGH_IOCTL</span>)
<span style="color:#010001">malloc</span>(<span style="color:#010001">InputBufLen</span>);
<o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-family:"Verdana","sans-serif";background:white;mso-highlight:white"><o:p> </o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-family:"Verdana","sans-serif";background:white;mso-highlight:white">        
<span style="color:green">/* Allocate output buffer to accommodate size of NVME_PASS_THRUGH_IOCTL and data */<o:p></o:p></span></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-family:"Verdana","sans-serif";background:white;mso-highlight:white">        
<span style="color:#010001">OutputBufLen</span> = <span style="color:blue">sizeof</span>(<span style="color:#010001">NVME_PASS_THROUGH_IOCTL</span>) +
<span style="color:#010001">size_of_identify_buffer</span> - 1;<o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-family:"Verdana","sans-serif";background:white;mso-highlight:white">        
<span style="color:#010001">pOutBuffer</span> = (<span style="color:#010001">PNVME_PASS_THROUGH_IOCTL</span>)
<span style="color:#010001">malloc</span>(<span style="color:#010001">OutputBufLen</span>);
<o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-family:"Verdana","sans-serif";background:white;mso-highlight:white"><o:p> </o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-family:"Verdana","sans-serif";background:white;mso-highlight:white"><o:p> </o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-family:"Verdana","sans-serif";background:white;mso-highlight:white">        
<span style="color:blue">if</span> (<span style="color:#010001">pInBuffer</span> ==
<span style="color:#010001">NULL</span> || <span style="color:#010001">pOutBuffer</span> ==
<span style="color:#010001">NULL</span>)<o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-family:"Verdana","sans-serif";background:white;mso-highlight:white">         {<o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-family:"Verdana","sans-serif";background:white;mso-highlight:white">                 
<span style="color:#010001">cout</span><<<span style="color:#A31515">"ERROR allocating buffers for identify command \n"</span>;<o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-family:"Verdana","sans-serif";background:white;mso-highlight:white">                 
<span style="color:blue">return</span> <span style="color:#010001">ERROR_INVALID_PARAM</span>;<o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-family:"Verdana","sans-serif";background:white;mso-highlight:white">         }<o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-family:"Verdana","sans-serif";background:white;mso-highlight:white">        
<o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-family:"Verdana","sans-serif";background:white;mso-highlight:white">        
<span style="color:green">/* Zero out the buffers */<o:p></o:p></span></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-family:"Verdana","sans-serif";background:white;mso-highlight:white">        
<span style="color:#010001">memset</span>(<span style="color:#010001">pInBuffer</span>, 0,
<span style="color:#010001">InputBufLen</span>);<o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-family:"Verdana","sans-serif";background:white;mso-highlight:white">        
<span style="color:#010001">memset</span>(<span style="color:#010001">pOutBuffer</span>, 0,
<span style="color:#010001">OutputBufLen</span>);<o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-family:"Verdana","sans-serif";background:white;mso-highlight:white"><o:p> </o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-family:"Verdana","sans-serif";background:white;mso-highlight:white"><o:p> </o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-family:"Verdana","sans-serif";background:white;mso-highlight:white">        
<span style="color:green">/* Populate SRB_IO_CONTROL fields in input buffer */<o:p></o:p></span></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-family:"Verdana","sans-serif";background:white;mso-highlight:white">        
<span style="color:#010001">pInBuffer</span>-><span style="color:#010001">SrbIoCtrl</span>.<span style="color:#010001">ControlCode</span> = (<span style="color:#010001">ULONG</span>)<span style="color:#010001">NVME_PASS_THROUGH_SRB_IO_CODE</span>;<o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-family:"Verdana","sans-serif";background:white;mso-highlight:white">        
<span style="color:#010001">pInBuffer</span>-><span style="color:#010001">SrbIoCtrl</span>.<span style="color:#010001">HeaderLength</span> =
<span style="color:blue">sizeof</span>(<span style="color:#010001">SRB_IO_CONTROL</span>);<o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-family:"Verdana","sans-serif";background:white;mso-highlight:white"><o:p> </o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-family:"Verdana","sans-serif";background:white;mso-highlight:white">        
<span style="color:#010001">memcpy</span>((<span style="color:#010001">UCHAR</span>*)(&<span style="color:#010001">pInBuffer</span>-><span style="color:#010001">SrbIoCtrl</span>.<span style="color:#010001">Signature</span>[0]),
<span style="color:#010001">NVME_SIG_STR</span>, <span style="color:#010001">NVME_SIG_STR_LEN</span>);<o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-family:"Verdana","sans-serif";background:white;mso-highlight:white">        
<span style="color:#010001">pInBuffer</span>-><span style="color:#010001">SrbIoCtrl</span>.<span style="color:#010001">Timeout</span> =
<span style="color:#010001">NVME_PT_TIMEOUT</span>;<o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-family:"Verdana","sans-serif";background:white;mso-highlight:white">        
<span style="color:#010001">pInBuffer</span>-><span style="color:#010001">SrbIoCtrl</span>.<span style="color:#010001">Length</span> =
<span style="color:#010001">InputBufLen</span> - <span style="color:blue">sizeof</span>(<span style="color:#010001">SRB_IO_CONTROL</span>);<o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-family:"Verdana","sans-serif";background:white;mso-highlight:white"><o:p> </o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-family:"Verdana","sans-serif";background:white;mso-highlight:white">       
<span style="color:#010001">pInBuffer</span>-><span style="color:#010001">Direction</span> =
<span style="color:#010001">NVME_FROM_DEV_TO_HOST</span>;<o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-family:"Verdana","sans-serif";background:white;mso-highlight:white">        
<o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-family:"Verdana","sans-serif";background:white;mso-highlight:white">        
<span style="color:#010001">pInBuffer</span>-><span style="color:#010001">NVMeCmd</span>[0]=0x6;<o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-family:"Verdana","sans-serif";background:white;mso-highlight:white">        
<span style="color:#010001">pInBuffer</span>-><span style="color:#010001">NVMeCmd</span>[10]=0x1;<o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-family:"Verdana","sans-serif";background:white;mso-highlight:white"><o:p> </o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-family:"Verdana","sans-serif";background:white;mso-highlight:white"><o:p> </o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-family:"Verdana","sans-serif";background:white;mso-highlight:white">        
<span style="color:#010001">pInBuffer</span>-><span style="color:#010001">DataBufferLen</span> =
<span style="color:#010001">ByteSizeTX</span>;<o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-family:"Verdana","sans-serif";background:white;mso-highlight:white">        
<span style="color:#010001">pInBuffer</span>-><span style="color:#010001">ReturnBufferLen</span>=<span style="color:#010001">OutputBufLen</span>;<o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-family:"Verdana","sans-serif";background:white;mso-highlight:white"><o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-family:"Verdana","sans-serif";background:white;mso-highlight:white">        
<o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-family:"Verdana","sans-serif";background:white;mso-highlight:white">        
<span style="color:#010001">Status</span> = <span style="color:#010001">DeviceIoControl</span>(<o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-family:"Verdana","sans-serif";background:white;mso-highlight:white">                 
<span style="color:#010001">disk_handle</span>,                                  <span style="color:green">
/* Handle to \\.\scsi device via CreateFile */<o:p></o:p></span></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-family:"Verdana","sans-serif";background:white;mso-highlight:white">                 
<span style="color:#010001">IOCTL_SCSI_MINIPORT</span>,   <span style="color:green">
/* IO control function to a miniport driver */<o:p></o:p></span></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-family:"Verdana","sans-serif";background:white;mso-highlight:white">                 
<span style="color:#010001">pInBuffer</span>         ,                      <span style="color:green">
/* Input buffer with data sent to driver */<o:p></o:p></span></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-family:"Verdana","sans-serif";background:white;mso-highlight:white">                 
<span style="color:#010001">InputBufLen</span>,                          <span style="color:green">
/* Length of data sent to driver (in bytes) */<o:p></o:p></span></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-family:"Verdana","sans-serif";background:white;mso-highlight:white">                 
<span style="color:#010001">pOutBuffer</span>,                             <span style="color:green">
/* Output buffer with data received from driver */<o:p></o:p></span></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-family:"Verdana","sans-serif";background:white;mso-highlight:white">                 
<span style="color:#010001">OutputBufLen</span>,                       <span style="color:green">
/* Length of data received from driver */<o:p></o:p></span></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-family:"Verdana","sans-serif";background:white;mso-highlight:white">                  &<span style="color:#010001">Count</span>,                                 
<span style="color:green">/* Bytes placed in DataBuffer */<o:p></o:p></span></span></p>
<p><span style="font-family:"Verdana","sans-serif";background:white;mso-highlight:white">                 
<span style="color:#010001">NULL</span>);                                   <span style="color:green">
/* NULL = no overlap */</span></span><span style="font-family:"Verdana","sans-serif";color:green"><o:p></o:p></span></p>
<p><span style="font-family:"Verdana","sans-serif";color:green"><o:p> </o:p></span></p>
<p><span style="color:#1F497D">In addition, I have launched “DebugView” on the test machine and I seem to get the following messages, produced by sending the IOCTL<o:p></o:p></span></p>
<p><span style="color:#1F497D">“<o:p></o:p></span></p>
<p><span style="color:#1F497D">55461250000 - STORMINI: NVMeProcessIoctl: Code = 0xe0002000, Signature = 0xNvmeMinið<o:p></o:p></span></p>
<p><span style="color:#1F497D">55461250000 - STORMINI: NVMeGetPhysAddr: <Error> Invalid phys addr.<o:p></o:p></span></p>
<p><span style="color:#1F497D">“<o:p></o:p></span></p>
<p><span style="color:#1F497D">Can you please help me to understand what am I doing wrong ?
<o:p></o:p></span></p>
<p><span style="color:#1F497D"><o:p> </o:p></span></p>
<p>Thank you, <o:p></o:p></p>
<p class="MsoNormal"><span style="color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><b><span style="font-size:14.0pt;color:#1F497D">Sagi Bar</span><span style="color:#1F497D"><br>
Test & Tools Staff FW Engineer<br>
</span></b><span style="font-size:12.0pt;font-family:"Times New Roman","serif";color:#1F497D"><img width="61" height="12" id="Picture_x0020_1" src="cid:image001.png@01CF954C.A683EAB0" alt="cid:image001.png@01CEA3CD.FE1957E0"><br>
</span><span style="color:#7F7F7F">7 Atir Yeda St, Kfar – Saba 44425, Israel<br>
T: +</span><span style="color:gray">972-9-7632774  </span><span style="color:#7F7F7F">| M: +</span><span style="color:gray">972-54-7665567 </span><span style="color:#7F7F7F"><o:p></o:p></span></p>
<p class="MsoNormal"><span style="color:#7F7F7F">F: +</span><span style="color:gray">972-3-5488666 </span><span style="color:#7F7F7F"><o:p></o:p></span></p>
<p class="MsoNormal"><span style="color:#1F497D"><a href="mailto:sagi.bar@SanDisk.com"><span style="color:blue">sagi.bar@SanDisk.com</span></a><o:p></o:p></span></p>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<br>
<hr>
<font face="Arial" color="Gray" size="2"><br>
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).<br>
<br>
</font>
</body>
</html>