Lines Matching full:vi
66 struct atto_ioctl_vda *vi, in esas2r_process_vda_ioctl() argument
74 vi->status = ATTO_STS_SUCCESS; in esas2r_process_vda_ioctl()
75 vi->vda_status = RS_PENDING; in esas2r_process_vda_ioctl()
77 if (vi->function >= vercnt) { in esas2r_process_vda_ioctl()
78 vi->status = ATTO_STS_INV_FUNC; in esas2r_process_vda_ioctl()
82 if (vi->version > esas2r_vdaioctl_versions[vi->function]) { in esas2r_process_vda_ioctl()
83 vi->status = ATTO_STS_INV_VERSION; in esas2r_process_vda_ioctl()
88 vi->status = ATTO_STS_DEGRADED; in esas2r_process_vda_ioctl()
92 if (vi->function != VDA_FUNC_SCSI) in esas2r_process_vda_ioctl()
95 rq->vrq->scsi.function = vi->function; in esas2r_process_vda_ioctl()
97 rq->interrupt_cx = vi; in esas2r_process_vda_ioctl()
99 switch (vi->function) { in esas2r_process_vda_ioctl()
102 if (vi->cmd.flash.sub_func != VDA_FLASH_FREAD in esas2r_process_vda_ioctl()
103 && vi->cmd.flash.sub_func != VDA_FLASH_FWRITE in esas2r_process_vda_ioctl()
104 && vi->cmd.flash.sub_func != VDA_FLASH_FINFO) { in esas2r_process_vda_ioctl()
105 vi->status = ATTO_STS_INV_FUNC; in esas2r_process_vda_ioctl()
109 if (vi->cmd.flash.sub_func != VDA_FLASH_FINFO) in esas2r_process_vda_ioctl()
110 datalen = vi->data_length; in esas2r_process_vda_ioctl()
113 rq->vrq->flash.sub_func = vi->cmd.flash.sub_func; in esas2r_process_vda_ioctl()
116 vi->cmd.flash.data.file.file_name, in esas2r_process_vda_ioctl()
117 sizeof(vi->cmd.flash.data.file.file_name)); in esas2r_process_vda_ioctl()
124 datalen = vi->data_length; in esas2r_process_vda_ioctl()
127 cpu_to_le32(vi->cmd.cli.cmd_rsp_len); in esas2r_process_vda_ioctl()
147 if (vi->data_length) { in esas2r_process_vda_ioctl()
150 if (vi->cmd.mgt.mgt_func == VDAMGT_DEV_HEALTH_REQ in esas2r_process_vda_ioctl()
151 || vi->cmd.mgt.mgt_func == VDAMGT_DEV_METRICS) { in esas2r_process_vda_ioctl()
156 payldlen = vi->data_length; in esas2r_process_vda_ioctl()
157 datalen = vi->cmd.mgt.data_length; in esas2r_process_vda_ioctl()
158 } else if (vi->cmd.mgt.mgt_func == VDAMGT_DEV_INFO2 in esas2r_process_vda_ioctl()
159 || vi->cmd.mgt.mgt_func == in esas2r_process_vda_ioctl()
161 datalen = vi->data_length; in esas2r_process_vda_ioctl()
164 vi->status = ATTO_STS_INV_PARAM; in esas2r_process_vda_ioctl()
180 vi->status = ATTO_STS_OUT_OF_RSRC; in esas2r_process_vda_ioctl()
185 datalen = vi->cmd.mgt.data_length; in esas2r_process_vda_ioctl()
198 rq->vrq->mgt.mgt_func = vi->cmd.mgt.mgt_func; in esas2r_process_vda_ioctl()
199 rq->vrq->mgt.scan_generation = vi->cmd.mgt.scan_generation; in esas2r_process_vda_ioctl()
201 cpu_to_le32(vi->cmd.mgt.dev_index); in esas2r_process_vda_ioctl()
203 esas2r_nuxi_mgt_data(rq->vrq->mgt.mgt_func, &vi->cmd.mgt.data); in esas2r_process_vda_ioctl()
209 if (vi->data_length in esas2r_process_vda_ioctl()
210 || vi->cmd.cfg.data_length == 0) { in esas2r_process_vda_ioctl()
211 vi->status = ATTO_STS_INV_PARAM; in esas2r_process_vda_ioctl()
215 if (vi->cmd.cfg.cfg_func == VDA_CFG_INIT) { in esas2r_process_vda_ioctl()
216 vi->status = ATTO_STS_INV_FUNC; in esas2r_process_vda_ioctl()
220 rq->vrq->cfg.sub_func = vi->cmd.cfg.cfg_func; in esas2r_process_vda_ioctl()
221 rq->vrq->cfg.length = cpu_to_le32(vi->cmd.cfg.data_length); in esas2r_process_vda_ioctl()
223 if (vi->cmd.cfg.cfg_func == VDA_CFG_GET_INIT) { in esas2r_process_vda_ioctl()
225 &vi->cmd.cfg.data, in esas2r_process_vda_ioctl()
226 vi->cmd.cfg.data_length); in esas2r_process_vda_ioctl()
231 vi->status = ATTO_STS_INV_FUNC; in esas2r_process_vda_ioctl()
240 vi->cmd.gsv.rsp_len = vercnt; in esas2r_process_vda_ioctl()
242 memcpy(vi->cmd.gsv.version_info, esas2r_vdaioctl_versions, in esas2r_process_vda_ioctl()
245 vi->vda_status = RS_SUCCESS; in esas2r_process_vda_ioctl()
250 vi->status = ATTO_STS_INV_FUNC; in esas2r_process_vda_ioctl()
259 vi->status = ATTO_STS_OUT_OF_RSRC; in esas2r_process_vda_ioctl()
272 struct atto_ioctl_vda *vi = (struct atto_ioctl_vda *)rq->interrupt_cx; in esas2r_complete_vda_ioctl() local
274 vi->vda_status = rq->req_stat; in esas2r_complete_vda_ioctl()
276 switch (vi->function) { in esas2r_complete_vda_ioctl()
279 if (vi->cmd.flash.sub_func == VDA_FLASH_FINFO in esas2r_complete_vda_ioctl()
280 || vi->cmd.flash.sub_func == VDA_FLASH_FREAD) in esas2r_complete_vda_ioctl()
281 vi->cmd.flash.data.file.file_size = in esas2r_complete_vda_ioctl()
288 vi->cmd.mgt.scan_generation = in esas2r_complete_vda_ioctl()
290 vi->cmd.mgt.dev_index = le16_to_cpu( in esas2r_complete_vda_ioctl()
293 if (vi->data_length == 0) in esas2r_complete_vda_ioctl()
294 vi->cmd.mgt.data_length = in esas2r_complete_vda_ioctl()
297 esas2r_nuxi_mgt_data(rq->vrq->mgt.mgt_func, &vi->cmd.mgt.data); in esas2r_complete_vda_ioctl()
302 if (vi->cmd.cfg.cfg_func == VDA_CFG_GET_INIT) { in esas2r_complete_vda_ioctl()
303 struct atto_ioctl_vda_cfg_cmd *cfg = &vi->cmd.cfg; in esas2r_complete_vda_ioctl()
328 &vi->cmd.cfg.data); in esas2r_complete_vda_ioctl()
335 vi->cmd.cli.cmd_rsp_len = in esas2r_complete_vda_ioctl()