ref: 30ea7ad58affeea1a0df11cb423eee10161fa9f5
parent: c4e51c5678d7f359bf0d33dba8f0bd422d979725
author: cinap_lenrek <cinap_lenrek@felloff.net>
date: Tue Aug 29 05:52:53 EDT 2017
sdnvme: pass 0 instead of 0xffffffff as NSID for identify controller and create completion/submission queue commands (thanks Ori_B) Samsung SSD 960 EVO fails with invalid namespace error otherwise...
--- a/sys/src/9/pc/sdnvme.c
+++ b/sys/src/9/pc/sdnvme.c
@@ -394,7 +394,7 @@
/* CQID1: shared completion queue */
cq = &ctlr->cq[1];
cqalloc(ctlr, cq, lgsize);
- e = qcmd(&ws, ctlr, 1, 0x05, ~0, nil, cq->base, 1<<lgsize);
+ e = qcmd(&ws, ctlr, 1, 0x05, 0, nil, cq->base, 1<<lgsize);
e[10] = (cq - ctlr->cq) | cq->mask<<16;
e[11] = 3; /* IEN | PC */
checkstatus(wcmd(&ws), "create completion queue");
@@ -403,7 +403,7 @@
for(i=1; i<=conf.nmach; i++){
sq = &ctlr->sq[i];
sqalloc(ctlr, sq, 12);
- e = qcmd(&ws, ctlr, 1, 0x01, ~0, nil, sq->base, 0x1000);
+ e = qcmd(&ws, ctlr, 1, 0x01, 0, nil, sq->base, 0x1000);
e[10] = i | sq->mask<<16;
e[11] = (cq - ctlr->cq)<<16 | 1; /* CQID<<16 | PC */
checkstatus(wcmd(&ws), "create submission queue");
@@ -428,7 +428,7 @@
if((ctlr->nsid = mallocalign(0x1000, ctlr->mps, 0, 0)) == nil)
error(Enomem);
- e = qcmd(&ws, ctlr, 1, 0x06, ~0, nil, ctlr->ident, 0x1000);
+ e = qcmd(&ws, ctlr, 1, 0x06, 0, nil, ctlr->ident, 0x1000);
e[10] = 1; // identify controller
checkstatus(wcmd(&ws), "identify controller");