Lines Matching refs:mad

151 	struct ibmvfc_mad_common *mad = &evt->iu.mad_common;
169 entry->op_code = be32_to_cpu(mad->opcode);
185 struct ibmvfc_mad_common *mad = &evt->xfer_iu->mad_common;
206 entry->op_code = be32_to_cpu(mad->opcode);
207 entry->u.end.status = be16_to_cpu(mad->status);
1871 struct ibmvfc_passthru_mad *mad;
1950 mad = &evt->iu.passthru;
1952 memset(mad, 0, sizeof(*mad));
1953 mad->common.version = cpu_to_be32(1);
1954 mad->common.opcode = cpu_to_be32(IBMVFC_PASSTHRU);
1955 mad->common.length = cpu_to_be16(sizeof(*mad) - sizeof(mad->fc_iu) - sizeof(mad->iu));
1957 mad->cmd_ioba.va = cpu_to_be64(be64_to_cpu(evt->crq.ioba) +
1959 mad->cmd_ioba.len = cpu_to_be32(sizeof(mad->iu));
1961 mad->iu.cmd_len = cpu_to_be32(job->request_payload.payload_len);
1962 mad->iu.rsp_len = cpu_to_be32(job->reply_payload.payload_len);
1963 mad->iu.flags = cpu_to_be32(fc_flags);
1964 mad->iu.cancel_key = cpu_to_be32(IBMVFC_PASSTHRU_CANCEL_KEY);
1966 mad->iu.cmd.va = cpu_to_be64(sg_dma_address(job->request_payload.sg_list));
1967 mad->iu.cmd.len = cpu_to_be32(sg_dma_len(job->request_payload.sg_list));
1968 mad->iu.rsp.va = cpu_to_be64(sg_dma_address(job->reply_payload.sg_list));
1969 mad->iu.rsp.len = cpu_to_be32(sg_dma_len(job->reply_payload.sg_list));
1970 mad->iu.scsi_id = cpu_to_be64(port_id);
1971 mad->iu.tag = cpu_to_be64((u64)evt);
1972 rsp_len = be32_to_cpu(mad->iu.rsp.len);
3619 struct ibmvfc_implicit_logout *mad;
3627 mad = &evt->iu.implicit_logout;
3628 memset(mad, 0, sizeof(*mad));
3629 mad->common.version = cpu_to_be32(1);
3630 mad->common.opcode = cpu_to_be32(IBMVFC_IMPLICIT_LOGOUT);
3631 mad->common.length = cpu_to_be16(sizeof(*mad));
3632 mad->old_scsi_id = cpu_to_be64(tgt->scsi_id);
3671 struct ibmvfc_passthru_mad *mad = &evt->xfer_iu->passthru;
3672 u32 status = be16_to_cpu(mad->common.status);
3815 * @mad: ibmvfc passthru mad struct
3821 static int ibmvfc_adisc_needs_plogi(struct ibmvfc_passthru_mad *mad,
3824 if (wwn_to_u64((u8 *)&mad->fc_iu.response[2]) != tgt->ids.port_name)
3826 if (wwn_to_u64((u8 *)&mad->fc_iu.response[4]) != tgt->ids.node_name)
3828 if (be32_to_cpu(mad->fc_iu.response[6]) != tgt->scsi_id)
3842 struct ibmvfc_passthru_mad *mad = &evt->xfer_iu->passthru;
3843 u32 status = be16_to_cpu(mad->common.status);
3853 if (ibmvfc_adisc_needs_plogi(mad, tgt))
3861 fc_reason = (be32_to_cpu(mad->fc_iu.response[1]) & 0x00ff0000) >> 16;
3862 fc_explain = (be32_to_cpu(mad->fc_iu.response[1]) & 0x0000ff00) >> 8;
3864 ibmvfc_get_cmd_error(be16_to_cpu(mad->iu.status), be16_to_cpu(mad->iu.error)),
3865 be16_to_cpu(mad->iu.status), be16_to_cpu(mad->iu.error),
3883 struct ibmvfc_passthru_mad *mad = &evt->iu.passthru;
3885 memset(mad, 0, sizeof(*mad));
3886 mad->common.version = cpu_to_be32(1);
3887 mad->common.opcode = cpu_to_be32(IBMVFC_PASSTHRU);
3888 mad->common.length = cpu_to_be16(sizeof(*mad) - sizeof(mad->fc_iu) - sizeof(mad->iu));
3889 mad->cmd_ioba.va = cpu_to_be64((u64)be64_to_cpu(evt->crq.ioba) +
3891 mad->cmd_ioba.len = cpu_to_be32(sizeof(mad->iu));
3892 mad->iu.cmd_len = cpu_to_be32(sizeof(mad->fc_iu.payload));
3893 mad->iu.rsp_len = cpu_to_be32(sizeof(mad->fc_iu.response));
3894 mad->iu.cmd.va = cpu_to_be64((u64)be64_to_cpu(evt->crq.ioba) +
3897 mad->iu.cmd.len = cpu_to_be32(sizeof(mad->fc_iu.payload));
3898 mad->iu.rsp.va = cpu_to_be64((u64)be64_to_cpu(evt->crq.ioba) +
3901 mad->iu.rsp.len = cpu_to_be32(sizeof(mad->fc_iu.response));
3992 struct ibmvfc_passthru_mad *mad;
4006 mad = &evt->iu.passthru;
4007 mad->iu.flags = cpu_to_be32(IBMVFC_FC_ELS);
4008 mad->iu.scsi_id = cpu_to_be64(tgt->scsi_id);
4009 mad->iu.cancel_key = cpu_to_be32(tgt->cancel_key);
4011 mad->fc_iu.payload[0] = cpu_to_be32(IBMVFC_ADISC);
4012 memcpy(&mad->fc_iu.payload[2], &vhost->login_buf->resp.port_name,
4014 memcpy(&mad->fc_iu.payload[4], &vhost->login_buf->resp.node_name,
4016 mad->fc_iu.payload[6] = cpu_to_be32(be64_to_cpu(vhost->login_buf->resp.scsi_id) & 0x00ffffff);
4269 struct ibmvfc_discover_targets *mad;
4273 mad = &evt->iu.discover_targets;
4274 memset(mad, 0, sizeof(*mad));
4275 mad->common.version = cpu_to_be32(1);
4276 mad->common.opcode = cpu_to_be32(IBMVFC_DISC_TARGETS);
4277 mad->common.length = cpu_to_be16(sizeof(*mad));
4278 mad->bufflen = cpu_to_be32(vhost->disc_buf_sz);
4279 mad->buffer.va = cpu_to_be64(vhost->disc_buf_dma);
4280 mad->buffer.len = cpu_to_be32(vhost->disc_buf_sz);
4281 mad->flags = cpu_to_be32(IBMVFC_DISC_TGT_PORT_ID_WWPN_LIST);
4382 struct ibmvfc_npiv_login_mad *mad;
4390 mad = &evt->iu.npiv_login;
4391 memset(mad, 0, sizeof(struct ibmvfc_npiv_login_mad));
4392 mad->common.version = cpu_to_be32(1);
4393 mad->common.opcode = cpu_to_be32(IBMVFC_NPIV_LOGIN);
4394 mad->common.length = cpu_to_be16(sizeof(struct ibmvfc_npiv_login_mad));
4395 mad->buffer.va = cpu_to_be64(vhost->login_buf_dma);
4396 mad->buffer.len = cpu_to_be32(sizeof(*vhost->login_buf));
4445 struct ibmvfc_npiv_logout_mad *mad;
4451 mad = &evt->iu.npiv_logout;
4452 memset(mad, 0, sizeof(*mad));
4453 mad->common.version = cpu_to_be32(1);
4454 mad->common.opcode = cpu_to_be32(IBMVFC_NPIV_LOGOUT);
4455 mad->common.length = cpu_to_be16(sizeof(struct ibmvfc_npiv_logout_mad));