MCPcopy Create free account
hub / github.com/F-Stack/f-stack / mc_status_to_error

Function mc_status_to_error

dpdk/drivers/bus/fslmc/mc/mc_sys.c:22–53  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

20static rte_spinlock_t mc_portal_lock = RTE_SPINLOCK_INITIALIZER;
21
22static int mc_status_to_error(enum mc_cmd_status status)
23{
24 switch (status) {
25 case MC_CMD_STATUS_OK:
26 return 0;
27 case MC_CMD_STATUS_AUTH_ERR:
28 return -EACCES; /* Token error */
29 case MC_CMD_STATUS_NO_PRIVILEGE:
30 return -EPERM; /* Permission denied */
31 case MC_CMD_STATUS_DMA_ERR:
32 return -EIO; /* Input/Output error */
33 case MC_CMD_STATUS_CONFIG_ERR:
34 return -EINVAL; /* Device not configured */
35 case MC_CMD_STATUS_TIMEOUT:
36 return -ETIMEDOUT; /* Operation timed out */
37 case MC_CMD_STATUS_NO_RESOURCE:
38 return -ENAVAIL; /* Resource temporarily unavailable */
39 case MC_CMD_STATUS_NO_MEMORY:
40 return -ENOMEM; /* Cannot allocate memory */
41 case MC_CMD_STATUS_BUSY:
42 return -EBUSY; /* Device busy */
43 case MC_CMD_STATUS_UNSUPPORTED_OP:
44 return -ENOTSUP; /* Operation not supported by device */
45 case MC_CMD_STATUS_INVALID_STATE:
46 return -ENODEV; /* Invalid device state */
47 default:
48 break;
49 }
50
51 /* Not expected to reach here */
52 return -EINVAL;
53}
54
55int mc_send_command(struct fsl_mc_io *mc_io, struct mc_command *cmd)
56{

Callers 1

mc_send_commandFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected