work with NVMe driver
Vendor Specific Command
笔者刚开始使用pass through发送VSC的命令总是不能成功,最后发现是这个问题。
windows Inbox Driver 的pass through 机制要求如果要支持VSCcommand, 那么必须要有Command Support and Effects log,这个log里面填写所有主控芯片支持的命令。因此在设置一个新的命令之前需要在主控中实现Command Support and Effects log。
1. 首先在Identify里面需要将Log Page Attributes (LPA)的bit 1 置为1以告诉Host,我们支持Command Support and Effects log, 主机上电后会先发送Identify command,主机会解析收到的回复内容
2.后面主机会发行get log page command 来取走Command Support and Effects log.
3.主机解析完所有的Command Support and Effects log,就知道了你的主控芯片支持的命令列表,不在此列表中的命令使用pass through的时候都会被driver挡掉,DeviceIoControl函数的返回值为1(INVALID FUNCTION)
4. 在这之后你就可以愉快地发送命令了
5. DeviceIOControl函数的用法
PVOID buffer = NULL;
ULONG bufferLength =