OpenSSD Cosmos+ Platform Firmware  0.0.2
The firmware of Cosmos+ OpenSSD Platform for TOSHIBA nand flash module.
nvme_io_cmd.h File Reference
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

void handle_nvme_io_cmd (NVME_COMMAND *nvmeCmd)
 

Function Documentation

◆ handle_nvme_io_cmd()

void handle_nvme_io_cmd ( NVME_COMMAND nvmeCmd)

Definition at line 126 of file nvme_io_cmd.c.

127{
128 NVME_IO_COMMAND *nvmeIOCmd;
129 NVME_COMPLETION nvmeCPL;
130 unsigned int opc;
131
132 nvmeIOCmd = (NVME_IO_COMMAND *)nvmeCmd->cmdDword;
133 /* xil_printf("OPC = 0x%X\r\n", nvmeIOCmd->OPC);
134 xil_printf("PRP1[63:32] = 0x%X, PRP1[31:0] = 0x%X\r\n", nvmeIOCmd->PRP1[1],
135 nvmeIOCmd->PRP1[0]); xil_printf("PRP2[63:32] = 0x%X, PRP2[31:0] = 0x%X\r\n", nvmeIOCmd->PRP2[1],
136 nvmeIOCmd->PRP2[0]); xil_printf("dword10 = 0x%X\r\n", nvmeIOCmd->dword10); xil_printf("dword11 = 0x%X\r\n",
137 nvmeIOCmd->dword11); xil_printf("dword12 = 0x%X\r\n", nvmeIOCmd->dword12);*/
138
139 opc = (unsigned int)nvmeIOCmd->OPC;
140
141 switch (opc)
142 {
143 case IO_NVM_FLUSH:
144 {
145 xil_printf("IO Flush Command\r\n");
146 nvmeCPL.dword[0] = 0;
147 nvmeCPL.specific = 0x0;
148 set_auto_nvme_cpl(nvmeCmd->cmdSlotTag, nvmeCPL.specific, nvmeCPL.statusFieldWord);
149 break;
150 }
151 case IO_NVM_WRITE:
152 {
153 // xil_printf("IO Write Command\r\n");
154 handle_nvme_io_write(nvmeCmd->cmdSlotTag, nvmeIOCmd);
155 break;
156 }
157 case IO_NVM_READ:
158 {
159 // xil_printf("IO Read Command\r\n");
160 handle_nvme_io_read(nvmeCmd->cmdSlotTag, nvmeIOCmd);
161 break;
162 }
163 default:
164 {
165 xil_printf("Not Support IO Command OPC: %X\r\n", opc);
166 ASSERT(0);
167 break;
168 }
169 }
170}
#define ASSERT(cond,...)
Definition: debug.h:96
void set_auto_nvme_cpl(unsigned int cmdSlotTag, unsigned int specific, unsigned int statusFieldWord)
Definition: host_lld.c:260
#define IO_NVM_FLUSH
Definition: nvme.h:83
#define IO_NVM_READ
Definition: nvme.h:85
#define IO_NVM_WRITE
Definition: nvme.h:84
void handle_nvme_io_write(unsigned int cmdSlotTag, NVME_IO_COMMAND *nvmeIOCmd)
Definition: nvme_io_cmd.c:99
void handle_nvme_io_read(unsigned int cmdSlotTag, NVME_IO_COMMAND *nvmeIOCmd)
The entry function for translating the given NVMe command into slice requests.
Definition: nvme_io_cmd.c:72
unsigned short cmdSlotTag
Definition: nvme.h:208
unsigned int cmdDword[16]
Definition: nvme.h:233
The main structure of completion queue entry.
Definition: nvme.h:350
unsigned int specific
Definition: nvme.h:370
unsigned short statusFieldWord
Definition: nvme.h:358
unsigned int dword[2]
Definition: nvme.h:353
unsigned char OPC
Definition: nvme.h:296
Here is the call graph for this function:
Here is the caller graph for this function: