Lines Matching refs:mad

216 	struct ibmvfc_mad_common *mad = &evt->iu.mad_common;
236 entry->op_code = be32_to_cpu(mad->opcode);
252 struct ibmvfc_mad_common *mad = &evt->xfer_iu->mad_common;
277 entry->op_code = be32_to_cpu(mad->opcode);
278 entry->u.end.status = be16_to_cpu(mad->status);
2157 struct ibmvfc_passthru_mad *mad;
2241 mad = &evt->iu.passthru;
2243 memset(mad, 0, sizeof(*mad));
2244 mad->common.version = cpu_to_be32(1);
2245 mad->common.opcode = cpu_to_be32(IBMVFC_PASSTHRU);
2246 mad->common.length = cpu_to_be16(sizeof(*mad) - sizeof(mad->fc_iu) - sizeof(mad->iu));
2248 mad->cmd_ioba.va = cpu_to_be64(be64_to_cpu(evt->crq.ioba) +
2250 mad->cmd_ioba.len = cpu_to_be32(sizeof(mad->iu));
2252 mad->iu.cmd_len = cpu_to_be32(job->request_payload.payload_len);
2253 mad->iu.rsp_len = cpu_to_be32(job->reply_payload.payload_len);
2254 mad->iu.flags = cpu_to_be32(fc_flags);
2255 mad->iu.cancel_key = cpu_to_be32(IBMVFC_PASSTHRU_CANCEL_KEY);
2257 mad->iu.cmd.va = cpu_to_be64(sg_dma_address(job->request_payload.sg_list));
2258 mad->iu.cmd.len = cpu_to_be32(sg_dma_len(job->request_payload.sg_list));
2259 mad->iu.rsp.va = cpu_to_be64(sg_dma_address(job->reply_payload.sg_list));
2260 mad->iu.rsp.len = cpu_to_be32(sg_dma_len(job->reply_payload.sg_list));
2261 mad->iu.scsi_id = cpu_to_be64(port_id);
2262 mad->iu.tag = cpu_to_be64((u64)evt);
2263 rsp_len = be32_to_cpu(mad->iu.rsp.len);
4263 struct ibmvfc_implicit_logout *mad;
4273 mad = &evt->iu.implicit_logout;
4274 memset(mad, 0, sizeof(*mad));
4275 mad->common.version = cpu_to_be32(1);
4276 mad->common.opcode = cpu_to_be32(IBMVFC_IMPLICIT_LOGOUT);
4277 mad->common.length = cpu_to_be16(sizeof(*mad));
4278 mad->old_scsi_id = cpu_to_be64(tgt->scsi_id);
4324 struct ibmvfc_passthru_mad *mad = &evt->xfer_iu->passthru;
4325 u32 status = be16_to_cpu(mad->common.status);
4475 * @mad: ibmvfc passthru mad struct
4481 static int ibmvfc_adisc_needs_plogi(struct ibmvfc_passthru_mad *mad,
4484 if (wwn_to_u64((u8 *)&mad->fc_iu.response[2]) != tgt->ids.port_name)
4486 if (wwn_to_u64((u8 *)&mad->fc_iu.response[4]) != tgt->ids.node_name)
4488 if (be32_to_cpu(mad->fc_iu.response[6]) != tgt->scsi_id)
4502 struct ibmvfc_passthru_mad *mad = &evt->xfer_iu->passthru;
4503 u32 status = be16_to_cpu(mad->common.status);
4513 if (ibmvfc_adisc_needs_plogi(mad, tgt))
4521 fc_reason = (be32_to_cpu(mad->fc_iu.response[1]) & 0x00ff0000) >> 16;
4522 fc_explain = (be32_to_cpu(mad->fc_iu.response[1]) & 0x0000ff00) >> 8;
4524 ibmvfc_get_cmd_error(be16_to_cpu(mad->iu.status), be16_to_cpu(mad->iu.error)),
4525 be16_to_cpu(mad->iu.status), be16_to_cpu(mad->iu.error),
4543 struct ibmvfc_passthru_mad *mad = &evt->iu.passthru;
4545 memset(mad, 0, sizeof(*mad));
4546 mad->common.version = cpu_to_be32(1);
4547 mad->common.opcode = cpu_to_be32(IBMVFC_PASSTHRU);
4548 mad->common.length = cpu_to_be16(sizeof(*mad) - sizeof(mad->fc_iu) - sizeof(mad->iu));
4549 mad->cmd_ioba.va = cpu_to_be64((u64)be64_to_cpu(evt->crq.ioba) +
4551 mad->cmd_ioba.len = cpu_to_be32(sizeof(mad->iu));
4552 mad->iu.cmd_len = cpu_to_be32(sizeof(mad->fc_iu.payload));
4553 mad->iu.rsp_len = cpu_to_be32(sizeof(mad->fc_iu.response));
4554 mad->iu.cmd.va = cpu_to_be64((u64)be64_to_cpu(evt->crq.ioba) +
4557 mad->iu.cmd.len = cpu_to_be32(sizeof(mad->fc_iu.payload));
4558 mad->iu.rsp.va = cpu_to_be64((u64)be64_to_cpu(evt->crq.ioba) +
4561 mad->iu.rsp.len = cpu_to_be32(sizeof(mad->fc_iu.response));
4665 struct ibmvfc_passthru_mad *mad;
4685 mad = &evt->iu.passthru;
4686 mad->iu.flags = cpu_to_be32(IBMVFC_FC_ELS);
4687 mad->iu.scsi_id = cpu_to_be64(tgt->scsi_id);
4688 mad->iu.cancel_key = cpu_to_be32(tgt->cancel_key);
4690 mad->fc_iu.payload[0] = cpu_to_be32(IBMVFC_ADISC);
4691 memcpy(&mad->fc_iu.payload[2], &vhost->login_buf->resp.port_name,
4693 memcpy(&mad->fc_iu.payload[4], &vhost->login_buf->resp.node_name,
4695 mad->fc_iu.payload[6] = cpu_to_be32(be64_to_cpu(vhost->login_buf->resp.scsi_id) & 0x00ffffff);
4959 struct ibmvfc_discover_targets *mad;
4970 mad = &evt->iu.discover_targets;
4971 memset(mad, 0, sizeof(*mad));
4972 mad->common.version = cpu_to_be32(1);
4973 mad->common.opcode = cpu_to_be32(IBMVFC_DISC_TARGETS);
4974 mad->common.length = cpu_to_be16(sizeof(*mad));
4975 mad->bufflen = cpu_to_be32(vhost->disc_buf_sz);
4976 mad->buffer.va = cpu_to_be64(vhost->disc_buf_dma);
4977 mad->buffer.len = cpu_to_be32(vhost->disc_buf_sz);
4978 mad->flags = cpu_to_be32(IBMVFC_DISC_TGT_PORT_ID_WWPN_LIST);
5039 struct ibmvfc_channel_setup_mad *mad;
5064 mad = &evt->iu.channel_setup;
5065 memset(mad, 0, sizeof(*mad));
5066 mad->common.version = cpu_to_be32(1);
5067 mad->common.opcode = cpu_to_be32(IBMVFC_CHANNEL_SETUP);
5068 mad->common.length = cpu_to_be16(sizeof(*mad));
5069 mad->buffer.va = cpu_to_be64(vhost->channel_setup_dma);
5070 mad->buffer.len = cpu_to_be32(sizeof(*vhost->channel_setup_buf));
5113 struct ibmvfc_channel_enquiry *mad;
5124 mad = &evt->iu.channel_enquiry;
5125 memset(mad, 0, sizeof(*mad));
5126 mad->common.version = cpu_to_be32(1);
5127 mad->common.opcode = cpu_to_be32(IBMVFC_CHANNEL_ENQUIRY);
5128 mad->common.length = cpu_to_be16(sizeof(*mad));
5131 mad->flags |= cpu_to_be32(IBMVFC_NO_CHANNELS_TO_CRQ_SUPPORT);
5133 mad->flags |= cpu_to_be32(IBMVFC_NO_N_TO_M_CHANNELS_SUPPORT);
5241 struct ibmvfc_npiv_login_mad *mad;
5255 mad = &evt->iu.npiv_login;
5256 memset(mad, 0, sizeof(struct ibmvfc_npiv_login_mad));
5257 mad->common.version = cpu_to_be32(1);
5258 mad->common.opcode = cpu_to_be32(IBMVFC_NPIV_LOGIN);
5259 mad->common.length = cpu_to_be16(sizeof(struct ibmvfc_npiv_login_mad));
5260 mad->buffer.va = cpu_to_be64(vhost->login_buf_dma);
5261 mad->buffer.len = cpu_to_be32(sizeof(*vhost->login_buf));
5310 struct ibmvfc_npiv_logout_mad *mad;
5322 mad = &evt->iu.npiv_logout;
5323 memset(mad, 0, sizeof(*mad));
5324 mad->common.version = cpu_to_be32(1);
5325 mad->common.opcode = cpu_to_be32(IBMVFC_NPIV_LOGOUT);
5326 mad->common.length = cpu_to_be16(sizeof(struct ibmvfc_npiv_logout_mad));