53 unsigned pcmd_count:5;
77 uint32_t additional_status:8;
105 ocs_memset(ctx->
cmd, 0, ARRAY_SIZE(ctx->
cmd));
108 if (sli_config->
emb) {
118 sgl[0] = ocs_addr32_lo(dma->phys);
119 sgl[1] = ocs_addr32_hi(dma->phys);
137 sli_config->
status = status;
138 if (sli_config->
emb) {
140 ocs_memcpy(ioctl_cmd,
151 ocs_dma_t dma = { 0 };
160 (
sizeof(*mcmd) != mcmd->
size)) {
161 ocs_log_test(ocs,
"malformed command m=%08x s=%08x\n",
168 ocs_log_err(hal->
os,
"no buffer for command\n");
174 if (sli_config->
emb) {
182 if (ocs_dma_alloc(ocs, &dma, mcmd->
out_bytes, 4096)) {
183 ocs_log_err(ocs,
"COMMON_READ_OBJECT - %" PRId64
"allocation failed\n",
203 ocs_log_err(ocs,
"COMMON_WRITE_OBJECT - %d allocation failed\n",
215 if (ocs_copy_from_user(dma.virt, (
void *)mcmd->
in_addr, mcmd->
in_bytes)) {
216 ocs_log_test(ocs,
"copy_from_user() failed\n");
229 if (ocs_dma_alloc(ocs, &dma, mcmd->
out_bytes, 4096)) {
230 ocs_log_err(ocs,
"COMMON_READ_OBJECT_LIST - %" PRId64
"lld allocation failed\n",
236 ocs_memset(dma.virt, 0, mcmd->
out_bytes);
253 ocs_log_test(ocs,
"in=%p (%" PRId64
") out=%p (%" PRId64
")\n",
256 ocs_log_test(ocs,
"unknown (opc=%#x)\n",
262 if (ocs_dma_alloc(ocs, &dma, max_bytes, 4096)) {
263 ocs_log_err(ocs,
"non-embedded - %u allocation failed\n", max_bytes);
268 if (ocs_copy_from_user(dma.virt, (
void *)mcmd->
in_addr, mcmd->
in_bytes)) {
269 ocs_log_test(ocs,
"copy_from_user failed\n");
275 ocs_sem_init(&waitsem, 0,
"waitsem");
285 ocs_log_err(hal->
os,
"Error posting mailbox command\n");
290 if (ocs_sem_p(&waitsem, OCS_SEM_FOREVER) == 0) {
293 ocs_log_test(ocs,
"copy_to_user failed\n");
298 ocs_log_test(ocs,
"hal command was interrupted\n");
302 ocs_dma_free(ocs, &dma);
312 ocs_sem_t *sem = ctx->
cb_arg;
uint32_t desired_write_length
sli4_bde_t host_buffer_descriptor[0]
Defines the structure of a FC SLI_CONFIG mailbox command.
#define SLI4_OPC_COMMON_SET_BE_CONFIGURATION_AND_RESOURCES
mailbox queue Element header
ocs_hal_rtn_e ocs_hal_command_queue(ocs_hal_t *hal, ocs_command_ctx_t *ctx)
Issue a SLI command.
#define SLI4_OPC_COMMON_SET_PHYSICAL_LINK_CONFIG
static void ocs_elxu_convert_cmd_to_iscsi(ocs_ioctl_elxu_mbox_t *mcmd, ocs_command_ctx_t *ctx, ocs_dma_t *dma)
Converts a FC SLI_CONFIG command to the iSCSI format.
ocs_command_ctx_t * ocs_hal_command_get_ctx(ocs_hal_t *hal)
Issue a SLI command.
int32_t ocs_elxu(ocs_t *ocs, ocs_ioctl_elxu_mbox_t *mcmd)
sli4_bde_t host_buffer_descriptor[0]
IOCTL_CMD_IOCTL_ELXU_MBOX ioctl structure.
struct sli4_bde_t::@23::@24 data
void ocs_hal_command_free_ctx(ocs_hal_t *hal, ocs_command_ctx_t *ctx)
Issue a SLI command.
#define SLI4_OPC_COMMON_WRITE_OBJECT
static int32_t __ocs_ioctl_mbox_cb(ocs_hal_t *hal, int32_t status, ocs_command_ctx_t *ctx)
sli4_bde_t host_buffer_descriptor[0]
#define SLI4_OPC_COMMON_READ_OBJECT
int32_t(* cb)(struct ocs_hal_s *, int32_t, struct ocs_command_ctx_s *)
#define SLI4_OPC_COMMON_READ_OBJECT_LIST
#define SLI4_OPC_COMMON_ISCSI_SET_TCP_PARAMETERS
uint8_t cmd[SLI4_BMBX_SIZE]
Defines the common mailbox header structure.
#define SLI4_BDE_TYPE_BDE_64
#define SLI4_OPC_COMMON_ISCSI_GET_CONNECTION_INFO
uint32_t actual_response_length
static void ocs_elxu_convert_status_to_fc(ocs_ioctl_elxu_mbox_t *mcmd, ocs_command_ctx_t *ctx, int32_t status)
Converts an iSCSI result back into the FC SLI_CONFIG format.
#define SLI4_OPC_COMMON_DELETE_OBJECT
#define SLI4_OPC_COMMON_READ_TRANSCEIVER_DATA