Giter VIP home page Giter VIP logo

Comments (14)

sirosiro avatar sirosiro commented on May 18, 2024 1

Any update on this?

Does a new doc explained relations between the IOCTL_STORAGE_PROTOCOL_COMMAND and the Common Effect Log of NVMe v1.2 spec?
I think the document should explain a relation to NVMe v1.2 spec by the inbox driver (stornvme.sys). please refer below the link.

https://social.msdn.microsoft.com/Forums/windowshardware/en-US/5a2cda6f-83de-43d3-91c7-3fdc02c4971c/how-to-send-nvme-admin-command-in-windows-10?forum=wdk

And, Dose the document explain how to use extended buffers([Data-to-Device Buffer] [Data-from-Device Buffer]) with vender command?

from windows-driver-samples.

jmrossy avatar jmrossy commented on May 18, 2024

Kouichi, thanks for bringing this to our attention. We're preparing a new doc page to describe the correct usage of this IOCTL. We'll share a link to that when it's live.

from windows-driver-samples.

aym2k avatar aym2k commented on May 18, 2024

Any updates on the new doc?
I found this:
https://msdn.microsoft.com/en-us/library/windows/hardware/dn932068(v=vs.85).aspx

https://msdn.microsoft.com/en-us/library/windows/hardware/dn931814(v=vs.85).aspx

from windows-driver-samples.

sirosiro avatar sirosiro commented on May 18, 2024

I found already those documents when I opened this issue. Even if it was updated, I think it is not enough information to use this IOCTL.
I found out an important comment on the "ntddstor.h" file. (simler souce exist at "http://pastebin.com/VHxcWAbp".) according to that:

//
// Parameter for IOCTL_STORAGE_PROTOCOL_COMMAND
// Buffer layout: <STORAGE_PROTOCOL_COMMAND> [Error Info Buffer] [Data-to-Device Buffer] [Data-from-Device Buffer]
//

//
// Additional notes when STORAGE_PROTOCOL_TYPE is ProtocolTypeNvme:
// 1. When flag STORAGE_PROTOCOL_COMMAND_FLAG_ADAPTER_REQUEST is set, or the request is sent through adapter, namespace Id from "Command" field is used;
// otherwise, the underneath driver should determine namespace Id from the device that receives the command.
// 2. When a command fails, the "ErrorCode" field contains value from NVMe Completion Queue Entry - DW3 - Status Field.
// 3. "CommandLength" field must have value of 64. e.g. STORAGE_PROTOCOL_COMMAND_LENGTH_NVME.
// 4. "CommandSpecific" field must have value of either STORAGE_PROTOCOL_SPECIFIC_NVME_ADMIN_COMMAND, or STORAGE_PROTOCOL_SPECIFIC_NVME_NVM_COMMAND.
// 5. When a command succeeds, field "FixedProtocolReturnData" may contain value from NVMe Completion Queue Entry - DW0.
//

And I tried to make a sample program with these information but it was not working correctly.
I can't find out more detailed description than the MSDN except the "ntddstor.h" file yet.
I need a usage example, or more detail document.

from windows-driver-samples.

psycholliu avatar psycholliu commented on May 18, 2024

Hi, sirosiro
I am facing the same problem about IOCTL_STORAGE_PROTOCOL_COMMAND,have you solved this problem? and How? if you give me a usage of this ioctl, will help a lot. thanks.

from windows-driver-samples.

sirosiro avatar sirosiro commented on May 18, 2024

Hi, psycholliu,
Unfortunately, I don't resolve it yet. but I found out an information recently. that is below:

https://msdn.microsoft.com/en-us/library/windows/desktop/mt718131(v=vs.85).aspx

This page explaining to how to sending a vendor-specific command, but I don't tried it yet.
I hope it'll be helpful for you. :)

from windows-driver-samples.

psycholliu avatar psycholliu commented on May 18, 2024

Hi sirosiro,
Thanks for your reply. I have gone though https://msdn.microsoft.com/en-us/library/windows/desktop/mt718131(v=vs.85).aspx, and I have tried to send nvme IO Command(read command) with IOCTL_STORAGE_PROTOCOL_COMMAND, but failed with errorcode 87(parameter error)。thanks again!

from windows-driver-samples.

side1out avatar side1out commented on May 18, 2024

I too am stuck on the 0x87 error. The bug whether it be documentation or otherwise has been reported to Microsoft. It has just moved into the active state. I too tried many variations of the sample code with no luck. I get the 87 result with about anything I do which leads me to believe this command does not work at all meaning it is not coming down to command registers or buffers.

from windows-driver-samples.

markg1 avatar markg1 commented on May 18, 2024

IOCTL_STORAGE_PROTOCOL_COMMAND is intended for sending vendor-specific commands only.
•Vendor Specific Admin Commands (C0h – FFh)
•Vendor Specific NVMe Commands (80h – FFh)
Sending an NVMe read command (Opcode 02h) will generate an error from this IOCTL.

Also your NVMe drive must support CEL.

from windows-driver-samples.

wm1 avatar wm1 commented on May 18, 2024

markg1 highlighted the problem in your experiments. And they are documented at https://msdn.microsoft.com/en-us/library/windows/desktop/mt718131(v=vs.85).aspx

from windows-driver-samples.

erikhugintech avatar erikhugintech commented on May 18, 2024

IOCTL_STORAGE_PROTOCOL_COMMAND is intended for sending vendor-specific commands only.
•Vendor Specific Admin Commands (C0h – FFh)
•Vendor Specific NVMe Commands (80h – FFh)

How can I get a namespace list? You block pass-through Identify, and you don't support Identify CNS 02 with IOCTL_STORAGE_QUERY_PROPERTY.

Have you considered not blocking commands that don't do any damage, or do you actually have a rationale behind forcing the use of incomplete and needlessly complicated abstraction layers for completely harmless commands?

from windows-driver-samples.

markg1 avatar markg1 commented on May 18, 2024

I have not tried this, but based on nvme.h and provided info, I would suggest you try
following the Example: NVMe Identify query at https://msdn.microsoft.com/en-us/library/windows/desktop/mt718131(v=vs.85).aspx. But replace the line:

protocolData->ProtocolDataRequestValue = NVME_IDENTIFY_CNS_CONTROLLER;
with
protocolData->ProtocolDataRequestValue = NVME_IDENTIFY_CNS_ACTIVE_NAMESPACES;

Good luck.

from windows-driver-samples.

RealCool1983 avatar RealCool1983 commented on May 18, 2024

I have not tried this, but based on nvme.h and provided info, I would suggest you try
following the Example: NVMe Identify query at https://msdn.microsoft.com/en-us/library/windows/desktop/mt718131(v=vs.85).aspx. But replace the line:

protocolData->ProtocolDataRequestValue = NVME_IDENTIFY_CNS_CONTROLLER;
with
protocolData->ProtocolDataRequestValue = NVME_IDENTIFY_CNS_ACTIVE_NAMESPACES;

Good luck.

I try, but it can't work @@

from windows-driver-samples.

mannanal avatar mannanal commented on May 18, 2024

Please refer to https://docs.microsoft.com/en-us/windows-hardware/drivers/storage/nvme-features-supported-by-stornvme for any clarifications on command supported

Currently, IOCTL_STORAGE_QUERY_PROPERTY with identify option NVME_IDENTIFY_CNS_ACTIVE_NAMESPACES is not supported

from windows-driver-samples.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.