Lines Matching refs:mad
163 struct ibmvfc_mad_common *mad = &evt->iu.mad_common;
181 entry->op_code = mad->opcode;
197 struct ibmvfc_mad_common *mad = &evt->xfer_iu->mad_common;
218 entry->op_code = mad->opcode;
219 entry->u.end.status = mad->status;
1833 struct ibmvfc_passthru_mad *mad;
1908 mad = &evt->iu.passthru;
1910 memset(mad, 0, sizeof(*mad));
1911 mad->common.version = 1;
1912 mad->common.opcode = IBMVFC_PASSTHRU;
1913 mad->common.length = sizeof(*mad) - sizeof(mad->fc_iu) - sizeof(mad->iu);
1915 mad->cmd_ioba.va = (u64)evt->crq.ioba +
1917 mad->cmd_ioba.len = sizeof(mad->iu);
1919 mad->iu.cmd_len = job->request_payload.payload_len;
1920 mad->iu.rsp_len = job->reply_payload.payload_len;
1921 mad->iu.flags = fc_flags;
1922 mad->iu.cancel_key = IBMVFC_PASSTHRU_CANCEL_KEY;
1924 mad->iu.cmd.va = sg_dma_address(job->request_payload.sg_list);
1925 mad->iu.cmd.len = sg_dma_len(job->request_payload.sg_list);
1926 mad->iu.rsp.va = sg_dma_address(job->reply_payload.sg_list);
1927 mad->iu.rsp.len = sg_dma_len(job->reply_payload.sg_list);
1928 mad->iu.scsi_id = port_id;
1929 mad->iu.tag = (u64)evt;
1930 rsp_len = mad->iu.rsp.len;
3475 struct ibmvfc_implicit_logout *mad;
3487 mad = &evt->iu.implicit_logout;
3488 memset(mad, 0, sizeof(*mad));
3489 mad->common.version = 1;
3490 mad->common.opcode = IBMVFC_IMPLICIT_LOGOUT;
3491 mad->common.length = sizeof(*mad);
3492 mad->old_scsi_id = tgt->scsi_id;
3505 * @mad: ibmvfc passthru mad struct
3511 static int ibmvfc_adisc_needs_plogi(struct ibmvfc_passthru_mad *mad,
3514 if (memcmp(&mad->fc_iu.response[2], &tgt->ids.port_name,
3517 if (memcmp(&mad->fc_iu.response[4], &tgt->ids.node_name,
3520 if (mad->fc_iu.response[6] != tgt->scsi_id)
3534 struct ibmvfc_passthru_mad *mad = &evt->xfer_iu->passthru;
3535 u32 status = mad->common.status;
3545 if (ibmvfc_adisc_needs_plogi(mad, tgt))
3553 fc_reason = (mad->fc_iu.response[1] & 0x00ff0000) >> 16;
3554 fc_explain = (mad->fc_iu.response[1] & 0x0000ff00) >> 8;
3556 ibmvfc_get_cmd_error(mad->iu.status, mad->iu.error),
3557 mad->iu.status, mad->iu.error,
3575 struct ibmvfc_passthru_mad *mad = &evt->iu.passthru;
3577 memset(mad, 0, sizeof(*mad));
3578 mad->common.version = 1;
3579 mad->common.opcode = IBMVFC_PASSTHRU;
3580 mad->common.length = sizeof(*mad) - sizeof(mad->fc_iu) - sizeof(mad->iu);
3581 mad->cmd_ioba.va = (u64)evt->crq.ioba +
3583 mad->cmd_ioba.len = sizeof(mad->iu);
3584 mad->iu.cmd_len = sizeof(mad->fc_iu.payload);
3585 mad->iu.rsp_len = sizeof(mad->fc_iu.response);
3586 mad->iu.cmd.va = (u64)evt->crq.ioba +
3589 mad->iu.cmd.len = sizeof(mad->fc_iu.payload);
3590 mad->iu.rsp.va = (u64)evt->crq.ioba +
3593 mad->iu.rsp.len = sizeof(mad->fc_iu.response);
3683 struct ibmvfc_passthru_mad *mad;
3697 mad = &evt->iu.passthru;
3698 mad->iu.flags = IBMVFC_FC_ELS;
3699 mad->iu.scsi_id = tgt->scsi_id;
3700 mad->iu.cancel_key = tgt->cancel_key;
3702 mad->fc_iu.payload[0] = IBMVFC_ADISC;
3703 memcpy(&mad->fc_iu.payload[2], &vhost->login_buf->resp.port_name,
3705 memcpy(&mad->fc_iu.payload[4], &vhost->login_buf->resp.node_name,
3707 mad->fc_iu.payload[6] = vhost->login_buf->resp.scsi_id & 0x00ffffff;
3922 struct ibmvfc_discover_targets *mad;
3926 mad = &evt->iu.discover_targets;
3927 memset(mad, 0, sizeof(*mad));
3928 mad->common.version = 1;
3929 mad->common.opcode = IBMVFC_DISC_TARGETS;
3930 mad->common.length = sizeof(*mad);
3931 mad->bufflen = vhost->disc_buf_sz;
3932 mad->buffer.va = vhost->disc_buf_dma;
3933 mad->buffer.len = vhost->disc_buf_sz;
4032 struct ibmvfc_npiv_login_mad *mad;
4040 mad = &evt->iu.npiv_login;
4041 memset(mad, 0, sizeof(struct ibmvfc_npiv_login_mad));
4042 mad->common.version = 1;
4043 mad->common.opcode = IBMVFC_NPIV_LOGIN;
4044 mad->common.length = sizeof(struct ibmvfc_npiv_login_mad);
4045 mad->buffer.va = vhost->login_buf_dma;
4046 mad->buffer.len = sizeof(*vhost->login_buf);
4095 struct ibmvfc_npiv_logout_mad *mad;
4101 mad = &evt->iu.npiv_logout;
4102 memset(mad, 0, sizeof(*mad));
4103 mad->common.version = 1;
4104 mad->common.opcode = IBMVFC_NPIV_LOGOUT;
4105 mad->common.length = sizeof(struct ibmvfc_npiv_logout_mad);