Lines Matching refs:evt_struct
583 static void init_event_struct(struct srp_event_struct *evt_struct,
588 evt_struct->cmnd = NULL;
589 evt_struct->cmnd_done = NULL;
590 evt_struct->sync_srp = NULL;
591 evt_struct->crq.format = format;
592 evt_struct->crq.timeout = cpu_to_be16(timeout);
593 evt_struct->done = done;
639 struct srp_event_struct *evt_struct,
650 if (evt_struct->cmnd)
651 scsi_dma_unmap(evt_struct->cmnd);
681 struct srp_event_struct *evt_struct,
719 if (!evt_struct->ext_list) {
720 evt_struct->ext_list = (struct srp_direct_buf *)
723 &evt_struct->ext_list_token, 0);
724 if (!evt_struct->ext_list) {
734 total_length = map_sg_list(cmd, sg_mapped, evt_struct->ext_list);
737 indirect->table_desc.va = cpu_to_be64(evt_struct->ext_list_token);
740 memcpy(indirect->desc_list, evt_struct->ext_list,
755 struct srp_event_struct *evt_struct,
775 return map_sg_data(cmd, evt_struct, srp_cmd, dev);
841 * @evt_struct: struct srp_event_struct that timed out
847 struct srp_event_struct *evt_struct = from_timer(evt_struct, t, timer);
848 struct ibmvscsi_host_data *hostdata = evt_struct->hostdata;
851 evt_struct->iu.srp.cmd.opcode);
862 * @evt_struct: evt_struct to be sent
869 static int ibmvscsi_send_srp_event(struct srp_event_struct *evt_struct,
873 __be64 *crq_as_u64 = (__be64 *)&evt_struct->crq;
884 if (evt_struct->crq.format == VIOSRP_SRP_FORMAT) {
899 evt_struct->iu.srp.login_req.opcode != SRP_LOGIN_REQ)
906 evt_struct->iu.srp.cmd.opcode != SRP_TSK_MGMT) {
927 *evt_struct->xfer_iu = evt_struct->iu;
928 evt_struct->xfer_iu->srp.rsp.tag = (u64)evt_struct;
934 list_add_tail(&evt_struct->list, &hostdata->sent);
936 timer_setup(&evt_struct->timer, ibmvscsi_timeout, 0);
938 evt_struct->timer.expires = jiffies + (timeout * HZ);
939 add_timer(&evt_struct->timer);
945 list_del(&evt_struct->list);
946 del_timer(&evt_struct->timer);
967 unmap_cmd_data(&evt_struct->iu.srp.cmd, evt_struct, hostdata->dev);
969 free_event_struct(&hostdata->pool, evt_struct);
975 unmap_cmd_data(&evt_struct->iu.srp.cmd, evt_struct, hostdata->dev);
977 if (evt_struct->cmnd != NULL) {
978 evt_struct->cmnd->result = DID_ERROR << 16;
979 evt_struct->cmnd_done(evt_struct->cmnd);
980 } else if (evt_struct->done)
981 evt_struct->done(evt_struct);
983 free_event_struct(&hostdata->pool, evt_struct);
989 * @evt_struct: srp_event_struct to be handled
994 static void handle_cmd_rsp(struct srp_event_struct *evt_struct)
996 struct srp_rsp *rsp = &evt_struct->xfer_iu->srp.rsp;
997 struct scsi_cmnd *cmnd = evt_struct->cmnd;
1001 dev_warn(evt_struct->hostdata->dev,
1011 unmap_cmd_data(&evt_struct->iu.srp.cmd,
1012 evt_struct,
1013 evt_struct->hostdata->dev);
1022 if (evt_struct->cmnd_done)
1023 evt_struct->cmnd_done(cmnd);
1045 struct srp_event_struct *evt_struct;
1052 evt_struct = get_event_struct(&hostdata->pool);
1053 if (!evt_struct)
1057 srp_cmd = &evt_struct->iu.srp.cmd;
1063 if (!map_data_for_srp_cmd(cmnd, evt_struct, srp_cmd, hostdata->dev)) {
1067 free_event_struct(&hostdata->pool, evt_struct);
1071 init_event_struct(evt_struct,
1076 evt_struct->cmnd = cmnd;
1077 evt_struct->cmnd_done = done;
1087 cpu_to_be64(be64_to_cpu(evt_struct->crq.IU_data_ptr) +
1092 return ibmvscsi_send_srp_event(evt_struct, hostdata, 0);
1150 * @evt_struct: srp_event_struct with the response
1155 static void login_rsp(struct srp_event_struct *evt_struct)
1157 struct ibmvscsi_host_data *hostdata = evt_struct->hostdata;
1158 switch (evt_struct->xfer_iu->srp.login_rsp.opcode) {
1163 evt_struct->xfer_iu->srp.login_rej.reason);
1169 evt_struct->xfer_iu->srp.login_rsp.opcode);
1183 be32_to_cpu(evt_struct->xfer_iu->srp.login_rsp.req_lim_delta));
1201 struct srp_event_struct *evt_struct = get_event_struct(&hostdata->pool);
1203 BUG_ON(!evt_struct);
1204 init_event_struct(evt_struct, login_rsp,
1207 login = &evt_struct->iu.srp.login_req;
1221 rc = ibmvscsi_send_srp_event(evt_struct, hostdata, login_timeout * 2);
1229 * @evt_struct: srp_event_struct with the response
1233 static void capabilities_rsp(struct srp_event_struct *evt_struct)
1235 struct ibmvscsi_host_data *hostdata = evt_struct->hostdata;
1237 if (evt_struct->xfer_iu->mad.capabilities.common.status) {
1239 evt_struct->xfer_iu->mad.capabilities.common.status);
1265 struct srp_event_struct *evt_struct;
1270 evt_struct = get_event_struct(&hostdata->pool);
1271 BUG_ON(!evt_struct);
1273 init_event_struct(evt_struct, capabilities_rsp,
1276 req = &evt_struct->iu.mad.capabilities;
1317 if (ibmvscsi_send_srp_event(evt_struct, hostdata, info_timeout * 2))
1324 * @evt_struct: srp_event_struct with the response
1329 static void fast_fail_rsp(struct srp_event_struct *evt_struct)
1331 struct ibmvscsi_host_data *hostdata = evt_struct->hostdata;
1332 u16 status = be16_to_cpu(evt_struct->xfer_iu->mad.fast_fail.common.status);
1355 struct srp_event_struct *evt_struct;
1362 evt_struct = get_event_struct(&hostdata->pool);
1363 BUG_ON(!evt_struct);
1365 init_event_struct(evt_struct, fast_fail_rsp, VIOSRP_MAD_FORMAT, info_timeout);
1367 fast_fail_mad = &evt_struct->iu.mad.fast_fail;
1373 rc = ibmvscsi_send_srp_event(evt_struct, hostdata, info_timeout * 2);
1380 * @evt_struct: srp_event_struct with the response
1385 static void adapter_info_rsp(struct srp_event_struct *evt_struct)
1387 struct ibmvscsi_host_data *hostdata = evt_struct->hostdata;
1389 if (evt_struct->xfer_iu->mad.adapter_info.common.status) {
1391 evt_struct->xfer_iu->mad.adapter_info.common.status);
1435 struct srp_event_struct *evt_struct;
1438 evt_struct = get_event_struct(&hostdata->pool);
1439 BUG_ON(!evt_struct);
1441 init_event_struct(evt_struct,
1446 req = &evt_struct->iu.mad.adapter_info;
1454 if (ibmvscsi_send_srp_event(evt_struct, hostdata, info_timeout * 2))
1470 * Note that after returning from this call, the evt_struct is freed.
1471 * the caller waiting on this completion shouldn't touch the evt_struct
1474 static void sync_completion(struct srp_event_struct *evt_struct)
1477 if (evt_struct->sync_srp)
1478 *evt_struct->sync_srp = *evt_struct->xfer_iu;
1480 complete(&evt_struct->comp);
1771 struct srp_event_struct *evt_struct =
1826 if (!valid_event_struct(&hostdata->pool, evt_struct)) {
1828 evt_struct);
1832 if (atomic_read(&evt_struct->free)) {
1834 evt_struct);
1839 atomic_add(be32_to_cpu(evt_struct->xfer_iu->srp.rsp.req_lim_delta),
1842 del_timer(&evt_struct->timer);
1844 if ((crq->status != VIOSRP_OK && crq->status != VIOSRP_OK2) && evt_struct->cmnd)
1845 evt_struct->cmnd->result = DID_ERROR << 16;
1846 if (evt_struct->done)
1847 evt_struct->done(evt_struct);
1855 spin_lock_irqsave(evt_struct->hostdata->host->host_lock, flags);
1856 list_del(&evt_struct->list);
1857 free_event_struct(&evt_struct->hostdata->pool, evt_struct);
1858 spin_unlock_irqrestore(evt_struct->hostdata->host->host_lock, flags);