Changeset View
Changeset View
Standalone View
Standalone View
head/sbin/nvmecontrol/wdc.c
Show First 20 Lines • Show All 75 Lines • ▼ Show 20 Lines | |||||
static void | static void | ||||
wdc_get_data(int fd, uint32_t opcode, uint32_t len, uint32_t off, uint32_t cmd, | wdc_get_data(int fd, uint32_t opcode, uint32_t len, uint32_t off, uint32_t cmd, | ||||
uint8_t *buffer, size_t buflen) | uint8_t *buffer, size_t buflen) | ||||
{ | { | ||||
struct nvme_pt_command pt; | struct nvme_pt_command pt; | ||||
memset(&pt, 0, sizeof(pt)); | memset(&pt, 0, sizeof(pt)); | ||||
pt.cmd.opc_fuse = NVME_CMD_SET_OPC(opcode); | pt.cmd.opc = opcode; | ||||
pt.cmd.cdw10 = htole32(len / sizeof(uint32_t)); /* - 1 like all the others ??? */ | pt.cmd.cdw10 = htole32(len / sizeof(uint32_t)); /* - 1 like all the others ??? */ | ||||
pt.cmd.cdw11 = htole32(off / sizeof(uint32_t)); | pt.cmd.cdw11 = htole32(off / sizeof(uint32_t)); | ||||
pt.cmd.cdw12 = htole32(cmd); | pt.cmd.cdw12 = htole32(cmd); | ||||
pt.buf = buffer; | pt.buf = buffer; | ||||
pt.len = buflen; | pt.len = buflen; | ||||
pt.is_read = 1; | pt.is_read = 1; | ||||
// printf("opcode %#x cdw10(len) %#x cdw11(offset?) %#x cdw12(cmd/sub) %#x buflen %zd\n", | // printf("opcode %#x cdw10(len) %#x cdw11(offset?) %#x cdw12(cmd/sub) %#x buflen %zd\n", | ||||
// (int)opcode, (int)cdw10, (int)cdw11, (int)cdw12, buflen); | // (int)opcode, (int)cdw10, (int)cdw11, (int)cdw12, buflen); | ||||
▲ Show 20 Lines • Show All 104 Lines • Show Last 20 Lines |