Lines Matching refs:mrioc
23 static int mpi3mr_bsg_pel_abort(struct mpi3mr_ioc *mrioc) in mpi3mr_bsg_pel_abort() argument
30 if (mrioc->reset_in_progress) { in mpi3mr_bsg_pel_abort()
31 dprint_bsg_err(mrioc, "%s: reset in progress\n", __func__); in mpi3mr_bsg_pel_abort()
34 if (mrioc->stop_bsgs) { in mpi3mr_bsg_pel_abort()
35 dprint_bsg_err(mrioc, "%s: bsgs are blocked\n", __func__); in mpi3mr_bsg_pel_abort()
40 mutex_lock(&mrioc->pel_abort_cmd.mutex); in mpi3mr_bsg_pel_abort()
41 if (mrioc->pel_abort_cmd.state & MPI3MR_CMD_PENDING) { in mpi3mr_bsg_pel_abort()
42 dprint_bsg_err(mrioc, "%s: command is in use\n", __func__); in mpi3mr_bsg_pel_abort()
43 mutex_unlock(&mrioc->pel_abort_cmd.mutex); in mpi3mr_bsg_pel_abort()
46 mrioc->pel_abort_cmd.state = MPI3MR_CMD_PENDING; in mpi3mr_bsg_pel_abort()
47 mrioc->pel_abort_cmd.is_waiting = 1; in mpi3mr_bsg_pel_abort()
48 mrioc->pel_abort_cmd.callback = NULL; in mpi3mr_bsg_pel_abort()
54 mrioc->pel_abort_requested = 1; in mpi3mr_bsg_pel_abort()
55 init_completion(&mrioc->pel_abort_cmd.done); in mpi3mr_bsg_pel_abort()
56 retval = mpi3mr_admin_request_post(mrioc, &pel_abort_req, in mpi3mr_bsg_pel_abort()
60 dprint_bsg_err(mrioc, "%s: admin request post failed\n", in mpi3mr_bsg_pel_abort()
62 mrioc->pel_abort_requested = 0; in mpi3mr_bsg_pel_abort()
66 wait_for_completion_timeout(&mrioc->pel_abort_cmd.done, in mpi3mr_bsg_pel_abort()
68 if (!(mrioc->pel_abort_cmd.state & MPI3MR_CMD_COMPLETE)) { in mpi3mr_bsg_pel_abort()
69 mrioc->pel_abort_cmd.is_waiting = 0; in mpi3mr_bsg_pel_abort()
70 dprint_bsg_err(mrioc, "%s: command timedout\n", __func__); in mpi3mr_bsg_pel_abort()
71 if (!(mrioc->pel_abort_cmd.state & MPI3MR_CMD_RESET)) in mpi3mr_bsg_pel_abort()
72 mpi3mr_soft_reset_handler(mrioc, in mpi3mr_bsg_pel_abort()
77 if ((mrioc->pel_abort_cmd.ioc_status & MPI3_IOCSTATUS_STATUS_MASK) in mpi3mr_bsg_pel_abort()
79 dprint_bsg_err(mrioc, in mpi3mr_bsg_pel_abort()
81 __func__, (mrioc->pel_abort_cmd.ioc_status & in mpi3mr_bsg_pel_abort()
83 mrioc->pel_abort_cmd.ioc_loginfo); in mpi3mr_bsg_pel_abort()
87 if (mrioc->pel_abort_cmd.state & MPI3MR_CMD_REPLY_VALID) { in mpi3mr_bsg_pel_abort()
88 pel_reply = (struct mpi3_pel_reply *)mrioc->pel_abort_cmd.reply; in mpi3mr_bsg_pel_abort()
91 dprint_bsg_err(mrioc, in mpi3mr_bsg_pel_abort()
99 mrioc->pel_abort_cmd.state = MPI3MR_CMD_NOTUSED; in mpi3mr_bsg_pel_abort()
100 mutex_unlock(&mrioc->pel_abort_cmd.mutex); in mpi3mr_bsg_pel_abort()
115 struct mpi3mr_ioc *mrioc = NULL; in mpi3mr_bsg_verify_adapter() local
118 list_for_each_entry(mrioc, &mrioc_list, list) { in mpi3mr_bsg_verify_adapter()
119 if (mrioc->id == ioc_number) { in mpi3mr_bsg_verify_adapter()
121 return mrioc; in mpi3mr_bsg_verify_adapter()
139 static long mpi3mr_enable_logdata(struct mpi3mr_ioc *mrioc, in mpi3mr_enable_logdata() argument
144 if (!mrioc->logdata_buf) { in mpi3mr_enable_logdata()
145 mrioc->logdata_entry_sz = in mpi3mr_enable_logdata()
146 (mrioc->reply_sz - (sizeof(struct mpi3_event_notification_reply) - 4)) in mpi3mr_enable_logdata()
148 mrioc->logdata_buf_idx = 0; in mpi3mr_enable_logdata()
149 mrioc->logdata_buf = kcalloc(MPI3MR_BSG_LOGDATA_MAX_ENTRIES, in mpi3mr_enable_logdata()
150 mrioc->logdata_entry_sz, GFP_KERNEL); in mpi3mr_enable_logdata()
152 if (!mrioc->logdata_buf) in mpi3mr_enable_logdata()
177 static long mpi3mr_get_logdata(struct mpi3mr_ioc *mrioc, in mpi3mr_get_logdata() argument
180 u16 num_entries, sz, entry_sz = mrioc->logdata_entry_sz; in mpi3mr_get_logdata()
182 if ((!mrioc->logdata_buf) || (job->request_payload.payload_len < entry_sz)) in mpi3mr_get_logdata()
193 mrioc->logdata_buf, sz); in mpi3mr_get_logdata()
211 static long mpi3mr_bsg_pel_enable(struct mpi3mr_ioc *mrioc, in mpi3mr_bsg_pel_enable() argument
221 dprint_bsg_err(mrioc, "%s: invalid size argument\n", in mpi3mr_bsg_pel_enable()
231 dprint_bsg_err(mrioc, "%s: out of range class %d sent\n", in mpi3mr_bsg_pel_enable()
236 if (!mrioc->pel_enabled) in mpi3mr_bsg_pel_enable()
239 if ((mrioc->pel_class <= pel_enable.pel_class) && in mpi3mr_bsg_pel_enable()
240 !((mrioc->pel_locale & pel_enable.pel_locale) ^ in mpi3mr_bsg_pel_enable()
245 pel_enable.pel_locale |= mrioc->pel_locale; in mpi3mr_bsg_pel_enable()
247 if (mrioc->pel_class < pel_enable.pel_class) in mpi3mr_bsg_pel_enable()
248 pel_enable.pel_class = mrioc->pel_class; in mpi3mr_bsg_pel_enable()
250 rval = mpi3mr_bsg_pel_abort(mrioc); in mpi3mr_bsg_pel_enable()
252 dprint_bsg_err(mrioc, in mpi3mr_bsg_pel_enable()
261 tmp_class = mrioc->pel_class; in mpi3mr_bsg_pel_enable()
262 tmp_locale = mrioc->pel_locale; in mpi3mr_bsg_pel_enable()
263 mrioc->pel_class = pel_enable.pel_class; in mpi3mr_bsg_pel_enable()
264 mrioc->pel_locale = pel_enable.pel_locale; in mpi3mr_bsg_pel_enable()
265 mrioc->pel_enabled = 1; in mpi3mr_bsg_pel_enable()
266 rval = mpi3mr_pel_get_seqnum_post(mrioc, NULL); in mpi3mr_bsg_pel_enable()
268 mrioc->pel_class = tmp_class; in mpi3mr_bsg_pel_enable()
269 mrioc->pel_locale = tmp_locale; in mpi3mr_bsg_pel_enable()
270 mrioc->pel_enabled = 0; in mpi3mr_bsg_pel_enable()
271 dprint_bsg_err(mrioc, in mpi3mr_bsg_pel_enable()
293 static long mpi3mr_get_all_tgt_info(struct mpi3mr_ioc *mrioc, in mpi3mr_get_all_tgt_info() argument
304 dprint_bsg_err(mrioc, "%s: invalid size argument\n", in mpi3mr_get_all_tgt_info()
309 spin_lock_irqsave(&mrioc->tgtdev_lock, flags); in mpi3mr_get_all_tgt_info()
310 list_for_each_entry(tgtdev, &mrioc->tgtdev_list, list) in mpi3mr_get_all_tgt_info()
312 spin_unlock_irqrestore(&mrioc->tgtdev_lock, flags); in mpi3mr_get_all_tgt_info()
315 list_empty(&mrioc->tgtdev_list)) { in mpi3mr_get_all_tgt_info()
330 spin_lock_irqsave(&mrioc->tgtdev_lock, flags); in mpi3mr_get_all_tgt_info()
331 list_for_each_entry(tgtdev, &mrioc->tgtdev_list, list) { in mpi3mr_get_all_tgt_info()
344 spin_unlock_irqrestore(&mrioc->tgtdev_lock, flags); in mpi3mr_get_all_tgt_info()
370 static long mpi3mr_get_change_count(struct mpi3mr_ioc *mrioc, in mpi3mr_get_change_count() argument
376 chgcnt.change_count = mrioc->change_count; in mpi3mr_get_change_count()
397 static long mpi3mr_bsg_adp_reset(struct mpi3mr_ioc *mrioc, in mpi3mr_bsg_adp_reset() argument
406 dprint_bsg_err(mrioc, "%s: invalid size argument\n", in mpi3mr_bsg_adp_reset()
423 dprint_bsg_err(mrioc, "%s: unknown reset_type(%d)\n", in mpi3mr_bsg_adp_reset()
428 rval = mpi3mr_soft_reset_handler(mrioc, MPI3MR_RESET_FROM_APP, in mpi3mr_bsg_adp_reset()
432 dprint_bsg_err(mrioc, in mpi3mr_bsg_adp_reset()
449 static long mpi3mr_bsg_populate_adpinfo(struct mpi3mr_ioc *mrioc, in mpi3mr_bsg_populate_adpinfo() argument
457 adpinfo.pci_dev_id = mrioc->pdev->device; in mpi3mr_bsg_populate_adpinfo()
458 adpinfo.pci_dev_hw_rev = mrioc->pdev->revision; in mpi3mr_bsg_populate_adpinfo()
459 adpinfo.pci_subsys_dev_id = mrioc->pdev->subsystem_device; in mpi3mr_bsg_populate_adpinfo()
460 adpinfo.pci_subsys_ven_id = mrioc->pdev->subsystem_vendor; in mpi3mr_bsg_populate_adpinfo()
461 adpinfo.pci_bus = mrioc->pdev->bus->number; in mpi3mr_bsg_populate_adpinfo()
462 adpinfo.pci_dev = PCI_SLOT(mrioc->pdev->devfn); in mpi3mr_bsg_populate_adpinfo()
463 adpinfo.pci_func = PCI_FUNC(mrioc->pdev->devfn); in mpi3mr_bsg_populate_adpinfo()
464 adpinfo.pci_seg_id = pci_domain_nr(mrioc->pdev->bus); in mpi3mr_bsg_populate_adpinfo()
467 ioc_state = mpi3mr_get_iocstate(mrioc); in mpi3mr_bsg_populate_adpinfo()
470 else if ((mrioc->reset_in_progress) || (mrioc->stop_bsgs)) in mpi3mr_bsg_populate_adpinfo()
477 memcpy((u8 *)&adpinfo.driver_info, (u8 *)&mrioc->driver_info, in mpi3mr_bsg_populate_adpinfo()
502 struct mpi3mr_ioc *mrioc = NULL; in mpi3mr_bsg_process_drv_cmds() local
509 mrioc = mpi3mr_bsg_verify_adapter(drvrcmd->mrioc_id); in mpi3mr_bsg_process_drv_cmds()
510 if (!mrioc) in mpi3mr_bsg_process_drv_cmds()
514 rval = mpi3mr_bsg_populate_adpinfo(mrioc, job); in mpi3mr_bsg_process_drv_cmds()
518 if (mutex_lock_interruptible(&mrioc->bsg_cmds.mutex)) in mpi3mr_bsg_process_drv_cmds()
523 rval = mpi3mr_bsg_adp_reset(mrioc, job); in mpi3mr_bsg_process_drv_cmds()
526 rval = mpi3mr_get_all_tgt_info(mrioc, job); in mpi3mr_bsg_process_drv_cmds()
529 rval = mpi3mr_get_change_count(mrioc, job); in mpi3mr_bsg_process_drv_cmds()
532 rval = mpi3mr_enable_logdata(mrioc, job); in mpi3mr_bsg_process_drv_cmds()
535 rval = mpi3mr_get_logdata(mrioc, job); in mpi3mr_bsg_process_drv_cmds()
538 rval = mpi3mr_bsg_pel_enable(mrioc, job); in mpi3mr_bsg_process_drv_cmds()
546 mutex_unlock(&mrioc->bsg_cmds.mutex); in mpi3mr_bsg_process_drv_cmds()
646 static int mpi3mr_build_nvme_sgl(struct mpi3mr_ioc *mrioc, in mpi3mr_build_nvme_sgl() argument
655 u64 sgemod_mask = ((u64)((mrioc->facts.sge_mod_mask) << in mpi3mr_build_nvme_sgl()
656 mrioc->facts.sge_mod_shift) << 32); in mpi3mr_build_nvme_sgl()
657 u64 sgemod_val = ((u64)(mrioc->facts.sge_mod_value) << in mpi3mr_build_nvme_sgl()
658 mrioc->facts.sge_mod_shift) << 32; in mpi3mr_build_nvme_sgl()
675 dprint_bsg_err(mrioc, in mpi3mr_build_nvme_sgl()
705 static int mpi3mr_build_nvme_prp(struct mpi3mr_ioc *mrioc, in mpi3mr_build_nvme_prp() argument
718 u64 sgemod_mask = ((u64)((mrioc->facts.sge_mod_mask) << in mpi3mr_build_nvme_prp()
719 mrioc->facts.sge_mod_shift) << 32); in mpi3mr_build_nvme_prp()
720 u64 sgemod_val = ((u64)(mrioc->facts.sge_mod_value) << in mpi3mr_build_nvme_prp()
721 mrioc->facts.sge_mod_shift) << 32; in mpi3mr_build_nvme_prp()
725 tgtdev = mpi3mr_get_tgtdev_by_handle(mrioc, dev_handle); in mpi3mr_build_nvme_prp()
727 dprint_bsg_err(mrioc, "%s: invalid device handle 0x%04x\n", in mpi3mr_build_nvme_prp()
733 dprint_bsg_err(mrioc, in mpi3mr_build_nvme_prp()
758 mrioc->prp_sz = 0; in mpi3mr_build_nvme_prp()
759 mrioc->prp_list_virt = dma_alloc_coherent(&mrioc->pdev->dev, in mpi3mr_build_nvme_prp()
760 dev_pgsz, &mrioc->prp_list_dma, GFP_KERNEL); in mpi3mr_build_nvme_prp()
762 if (!mrioc->prp_list_virt) in mpi3mr_build_nvme_prp()
764 mrioc->prp_sz = dev_pgsz; in mpi3mr_build_nvme_prp()
780 prp_page = (__le64 *)mrioc->prp_list_virt; in mpi3mr_build_nvme_prp()
781 prp_page_dma = mrioc->prp_list_dma; in mpi3mr_build_nvme_prp()
790 dprint_bsg_err(mrioc, "%s: PRP page is not page aligned\n", in mpi3mr_build_nvme_prp()
806 dprint_bsg_err(mrioc, in mpi3mr_build_nvme_prp()
823 dprint_bsg_err(mrioc, in mpi3mr_build_nvme_prp()
851 dprint_bsg_err(mrioc, in mpi3mr_build_nvme_prp()
872 dprint_bsg_err(mrioc, in mpi3mr_build_nvme_prp()
890 dprint_bsg_err(mrioc, in mpi3mr_build_nvme_prp()
915 if (mrioc->prp_list_virt) { in mpi3mr_build_nvme_prp()
916 dma_free_coherent(&mrioc->pdev->dev, mrioc->prp_sz, in mpi3mr_build_nvme_prp()
917 mrioc->prp_list_virt, mrioc->prp_list_dma); in mpi3mr_build_nvme_prp()
918 mrioc->prp_list_virt = NULL; in mpi3mr_build_nvme_prp()
945 struct mpi3mr_ioc *mrioc = NULL; in mpi3mr_bsg_process_mpt_cmds() local
970 mrioc = mpi3mr_bsg_verify_adapter(karg->mrioc_id); in mpi3mr_bsg_process_mpt_cmds()
971 if (!mrioc) in mpi3mr_bsg_process_mpt_cmds()
1015 dprint_bsg_err(mrioc, "%s: data_out buffer length mismatch\n", in mpi3mr_bsg_process_mpt_cmds()
1021 dprint_bsg_err(mrioc, "%s: data_in buffer length mismatch\n", in mpi3mr_bsg_process_mpt_cmds()
1081 dprint_bsg_err(mrioc, "%s: invalid MPI message size\n", in mpi3mr_bsg_process_mpt_cmds()
1093 dprint_bsg_err(mrioc, "%s: invalid buffer entries passed\n", in mpi3mr_bsg_process_mpt_cmds()
1107 dprint_bsg_err(mrioc, in mpi3mr_bsg_process_mpt_cmds()
1115 dprint_bsg_err(mrioc, in mpi3mr_bsg_process_mpt_cmds()
1122 dprint_bsg_err(mrioc, in mpi3mr_bsg_process_mpt_cmds()
1142 drv_buf_iter->kern_buf = dma_alloc_coherent(&mrioc->pdev->dev, in mpi3mr_bsg_process_mpt_cmds()
1164 if (mutex_lock_interruptible(&mrioc->bsg_cmds.mutex)) { in mpi3mr_bsg_process_mpt_cmds()
1168 if (mrioc->bsg_cmds.state & MPI3MR_CMD_PENDING) { in mpi3mr_bsg_process_mpt_cmds()
1170 dprint_bsg_err(mrioc, "%s: command is in use\n", __func__); in mpi3mr_bsg_process_mpt_cmds()
1171 mutex_unlock(&mrioc->bsg_cmds.mutex); in mpi3mr_bsg_process_mpt_cmds()
1174 if (mrioc->unrecoverable) { in mpi3mr_bsg_process_mpt_cmds()
1175 dprint_bsg_err(mrioc, "%s: unrecoverable controller\n", in mpi3mr_bsg_process_mpt_cmds()
1178 mutex_unlock(&mrioc->bsg_cmds.mutex); in mpi3mr_bsg_process_mpt_cmds()
1181 if (mrioc->reset_in_progress) { in mpi3mr_bsg_process_mpt_cmds()
1182 dprint_bsg_err(mrioc, "%s: reset in progress\n", __func__); in mpi3mr_bsg_process_mpt_cmds()
1184 mutex_unlock(&mrioc->bsg_cmds.mutex); in mpi3mr_bsg_process_mpt_cmds()
1187 if (mrioc->stop_bsgs) { in mpi3mr_bsg_process_mpt_cmds()
1188 dprint_bsg_err(mrioc, "%s: bsgs are blocked\n", __func__); in mpi3mr_bsg_process_mpt_cmds()
1190 mutex_unlock(&mrioc->bsg_cmds.mutex); in mpi3mr_bsg_process_mpt_cmds()
1198 if (mpi3mr_build_nvme_prp(mrioc, in mpi3mr_bsg_process_mpt_cmds()
1202 mutex_unlock(&mrioc->bsg_cmds.mutex); in mpi3mr_bsg_process_mpt_cmds()
1207 if (mpi3mr_build_nvme_sgl(mrioc, in mpi3mr_bsg_process_mpt_cmds()
1211 mutex_unlock(&mrioc->bsg_cmds.mutex); in mpi3mr_bsg_process_mpt_cmds()
1215 dprint_bsg_err(mrioc, in mpi3mr_bsg_process_mpt_cmds()
1218 mutex_unlock(&mrioc->bsg_cmds.mutex); in mpi3mr_bsg_process_mpt_cmds()
1236 tgtdev = mpi3mr_get_tgtdev_by_handle(mrioc, dev_handle); in mpi3mr_bsg_process_mpt_cmds()
1245 mrioc->bsg_cmds.state = MPI3MR_CMD_PENDING; in mpi3mr_bsg_process_mpt_cmds()
1246 mrioc->bsg_cmds.is_waiting = 1; in mpi3mr_bsg_process_mpt_cmds()
1247 mrioc->bsg_cmds.callback = NULL; in mpi3mr_bsg_process_mpt_cmds()
1248 mrioc->bsg_cmds.is_sense = 0; in mpi3mr_bsg_process_mpt_cmds()
1249 mrioc->bsg_cmds.sensebuf = sense_buff_k; in mpi3mr_bsg_process_mpt_cmds()
1250 memset(mrioc->bsg_cmds.reply, 0, mrioc->reply_sz); in mpi3mr_bsg_process_mpt_cmds()
1252 if (mrioc->logging_level & MPI3_DEBUG_BSG_INFO) { in mpi3mr_bsg_process_mpt_cmds()
1253 dprint_bsg_info(mrioc, in mpi3mr_bsg_process_mpt_cmds()
1264 init_completion(&mrioc->bsg_cmds.done); in mpi3mr_bsg_process_mpt_cmds()
1265 rval = mpi3mr_admin_request_post(mrioc, mpi_req, in mpi3mr_bsg_process_mpt_cmds()
1270 mrioc->bsg_cmds.is_waiting = 0; in mpi3mr_bsg_process_mpt_cmds()
1271 dprint_bsg_err(mrioc, in mpi3mr_bsg_process_mpt_cmds()
1276 wait_for_completion_timeout(&mrioc->bsg_cmds.done, in mpi3mr_bsg_process_mpt_cmds()
1280 if (!(mrioc->bsg_cmds.state & MPI3MR_CMD_COMPLETE)) { in mpi3mr_bsg_process_mpt_cmds()
1281 mrioc->bsg_cmds.is_waiting = 0; in mpi3mr_bsg_process_mpt_cmds()
1283 if (mrioc->bsg_cmds.state & MPI3MR_CMD_RESET) in mpi3mr_bsg_process_mpt_cmds()
1285 dprint_bsg_err(mrioc, in mpi3mr_bsg_process_mpt_cmds()
1288 if (mrioc->logging_level & MPI3_DEBUG_BSG_ERROR) { in mpi3mr_bsg_process_mpt_cmds()
1301 mpi3mr_issue_tm(mrioc, in mpi3mr_bsg_process_mpt_cmds()
1305 &mrioc->host_tm_cmds, &resp_code, NULL); in mpi3mr_bsg_process_mpt_cmds()
1306 if (!(mrioc->bsg_cmds.state & MPI3MR_CMD_COMPLETE) && in mpi3mr_bsg_process_mpt_cmds()
1307 !(mrioc->bsg_cmds.state & MPI3MR_CMD_RESET)) in mpi3mr_bsg_process_mpt_cmds()
1308 mpi3mr_soft_reset_handler(mrioc, in mpi3mr_bsg_process_mpt_cmds()
1312 dprint_bsg_info(mrioc, "%s: bsg request is completed\n", __func__); in mpi3mr_bsg_process_mpt_cmds()
1314 if (mrioc->prp_list_virt) { in mpi3mr_bsg_process_mpt_cmds()
1315 dma_free_coherent(&mrioc->pdev->dev, mrioc->prp_sz, in mpi3mr_bsg_process_mpt_cmds()
1316 mrioc->prp_list_virt, mrioc->prp_list_dma); in mpi3mr_bsg_process_mpt_cmds()
1317 mrioc->prp_list_virt = NULL; in mpi3mr_bsg_process_mpt_cmds()
1320 if ((mrioc->bsg_cmds.ioc_status & MPI3_IOCSTATUS_STATUS_MASK) in mpi3mr_bsg_process_mpt_cmds()
1322 dprint_bsg_info(mrioc, in mpi3mr_bsg_process_mpt_cmds()
1325 (mrioc->bsg_cmds.ioc_status & MPI3_IOCSTATUS_STATUS_MASK), in mpi3mr_bsg_process_mpt_cmds()
1326 mrioc->bsg_cmds.ioc_loginfo); in mpi3mr_bsg_process_mpt_cmds()
1333 mrioc->reply_sz); in mpi3mr_bsg_process_mpt_cmds()
1340 if (mrioc->bsg_cmds.state & MPI3MR_CMD_REPLY_VALID) { in mpi3mr_bsg_process_mpt_cmds()
1344 mrioc->bsg_cmds.reply, mrioc->reply_sz); in mpi3mr_bsg_process_mpt_cmds()
1350 status_desc->ioc_status = mrioc->bsg_cmds.ioc_status; in mpi3mr_bsg_process_mpt_cmds()
1351 status_desc->ioc_log_info = mrioc->bsg_cmds.ioc_loginfo; in mpi3mr_bsg_process_mpt_cmds()
1358 if (erb_offset != 0xFF && mrioc->bsg_cmds.sensebuf && in mpi3mr_bsg_process_mpt_cmds()
1359 mrioc->bsg_cmds.is_sense) { in mpi3mr_bsg_process_mpt_cmds()
1384 mrioc->bsg_cmds.is_sense = 0; in mpi3mr_bsg_process_mpt_cmds()
1385 mrioc->bsg_cmds.sensebuf = NULL; in mpi3mr_bsg_process_mpt_cmds()
1386 mrioc->bsg_cmds.state = MPI3MR_CMD_NOTUSED; in mpi3mr_bsg_process_mpt_cmds()
1387 mutex_unlock(&mrioc->bsg_cmds.mutex); in mpi3mr_bsg_process_mpt_cmds()
1397 dma_free_coherent(&mrioc->pdev->dev, in mpi3mr_bsg_process_mpt_cmds()
1421 void mpi3mr_app_save_logdata(struct mpi3mr_ioc *mrioc, char *event_data, in mpi3mr_app_save_logdata() argument
1424 u32 index = mrioc->logdata_buf_idx, sz; in mpi3mr_app_save_logdata()
1427 if (!(mrioc->logdata_buf)) in mpi3mr_app_save_logdata()
1431 (mrioc->logdata_buf + (index * mrioc->logdata_entry_sz)); in mpi3mr_app_save_logdata()
1433 sz = min(mrioc->logdata_entry_sz, event_data_size); in mpi3mr_app_save_logdata()
1435 mrioc->logdata_buf_idx = in mpi3mr_app_save_logdata()
1482 void mpi3mr_bsg_exit(struct mpi3mr_ioc *mrioc) in mpi3mr_bsg_exit() argument
1484 struct device *bsg_dev = &mrioc->bsg_dev; in mpi3mr_bsg_exit()
1485 if (!mrioc->bsg_queue) in mpi3mr_bsg_exit()
1488 bsg_remove_queue(mrioc->bsg_queue); in mpi3mr_bsg_exit()
1489 mrioc->bsg_queue = NULL; in mpi3mr_bsg_exit()
1517 void mpi3mr_bsg_init(struct mpi3mr_ioc *mrioc) in mpi3mr_bsg_init() argument
1519 struct device *bsg_dev = &mrioc->bsg_dev; in mpi3mr_bsg_init()
1520 struct device *parent = &mrioc->shost->shost_gendev; in mpi3mr_bsg_init()
1527 dev_set_name(bsg_dev, "mpi3mrctl%u", mrioc->id); in mpi3mr_bsg_init()
1530 ioc_err(mrioc, "%s: bsg device add failed\n", in mpi3mr_bsg_init()
1536 mrioc->bsg_queue = bsg_setup_queue(bsg_dev, dev_name(bsg_dev), in mpi3mr_bsg_init()
1538 if (IS_ERR(mrioc->bsg_queue)) { in mpi3mr_bsg_init()
1539 ioc_err(mrioc, "%s: bsg registration failed\n", in mpi3mr_bsg_init()
1546 blk_queue_max_segments(mrioc->bsg_queue, MPI3MR_MAX_APP_XFER_SEGMENTS); in mpi3mr_bsg_init()
1547 blk_queue_max_hw_sectors(mrioc->bsg_queue, MPI3MR_MAX_APP_XFER_SECTORS); in mpi3mr_bsg_init()
1565 struct mpi3mr_ioc *mrioc = shost_priv(shost); in version_fw_show() local
1566 struct mpi3mr_compimg_ver *fwver = &mrioc->facts.fw_ver; in version_fw_show()
1587 struct mpi3mr_ioc *mrioc = shost_priv(shost); in fw_queue_depth_show() local
1589 return sysfs_emit(buf, "%d\n", mrioc->facts.max_reqs); in fw_queue_depth_show()
1606 struct mpi3mr_ioc *mrioc = shost_priv(shost); in op_req_q_count_show() local
1608 return sysfs_emit(buf, "%d\n", mrioc->num_op_req_q); in op_req_q_count_show()
1625 struct mpi3mr_ioc *mrioc = shost_priv(shost); in reply_queue_count_show() local
1627 return sysfs_emit(buf, "%d\n", mrioc->num_op_reply_q); in reply_queue_count_show()
1650 struct mpi3mr_ioc *mrioc = shost_priv(shost); in logging_level_show() local
1652 return sysfs_emit(buf, "%08xh\n", mrioc->logging_level); in logging_level_show()
1674 struct mpi3mr_ioc *mrioc = shost_priv(shost); in logging_level_store() local
1680 mrioc->logging_level = val; in logging_level_store()
1681 ioc_info(mrioc, "logging_level=%08xh\n", mrioc->logging_level); in logging_level_store()
1699 struct mpi3mr_ioc *mrioc = shost_priv(shost); in adp_state_show() local
1703 ioc_state = mpi3mr_get_iocstate(mrioc); in adp_state_show()
1706 else if ((mrioc->reset_in_progress) || (mrioc->stop_bsgs)) in adp_state_show()