Lines Matching refs:smid
296 _base_get_chain(struct MPT3SAS_ADAPTER *ioc, u16 smid, in _base_get_chain() argument
305 chain_virt = base_chain + (smid * ioc->facts.MaxChainDepth * in _base_get_chain()
322 _base_get_chain_phys(struct MPT3SAS_ADAPTER *ioc, u16 smid, in _base_get_chain_phys() argument
331 chain_phys = base_chain_phys + (smid * ioc->facts.MaxChainDepth * in _base_get_chain_phys()
348 _base_get_buffer_bar0(struct MPT3SAS_ADAPTER *ioc, u16 smid) in _base_get_buffer_bar0() argument
355 return chain_end + (smid * 64 * 1024); in _base_get_buffer_bar0()
369 _base_get_buffer_phys_bar0(struct MPT3SAS_ADAPTER *ioc, u16 smid) in _base_get_buffer_phys_bar0() argument
375 return chain_end_phys + (smid * 64 * 1024); in _base_get_buffer_phys_bar0()
418 void *mpi_request, u16 smid) in _clone_sg_entries() argument
457 scmd = mpt3sas_scsih_scsi_lookup_get(ioc, smid); in _clone_sg_entries()
482 buffer_iomem = _base_get_buffer_bar0(ioc, smid); in _clone_sg_entries()
483 buffer_iomem_phys = _base_get_buffer_phys_bar0(ioc, smid); in _clone_sg_entries()
516 smid, sge_chain_count); in _clone_sg_entries()
520 smid, sge_chain_count); in _clone_sg_entries()
617 u16 smid; in _base_sync_drv_fw_timestamp() local
628 smid = mpt3sas_base_get_smid(ioc, ioc->scsih_cb_idx); in _base_sync_drv_fw_timestamp()
629 if (!smid) { in _base_sync_drv_fw_timestamp()
634 mpi_request = mpt3sas_base_get_msg_frame(ioc, smid); in _base_sync_drv_fw_timestamp()
635 ioc->scsih_cmds.smid = smid; in _base_sync_drv_fw_timestamp()
645 ioc->put_smid_default(ioc, smid); in _base_sync_drv_fw_timestamp()
1379 _base_display_reply_info(struct MPT3SAS_ADAPTER *ioc, u16 smid, u8 msix_index, in _base_display_reply_info() argument
1397 mpt3sas_base_get_msg_frame(ioc, smid)); in _base_display_reply_info()
1423 mpt3sas_base_done(struct MPT3SAS_ADAPTER *ioc, u16 smid, u8 msix_index, in mpt3sas_base_done() argument
1430 return mpt3sas_check_for_pending_internal_cmds(ioc, smid); in mpt3sas_base_done()
1461 u16 smid; in _base_async_event() local
1474 smid = mpt3sas_base_get_smid(ioc, ioc->base_cb_idx); in _base_async_event()
1475 if (!smid) { in _base_async_event()
1491 ack_request = mpt3sas_base_get_msg_frame(ioc, smid); in _base_async_event()
1498 ioc->put_smid_default(ioc, smid); in _base_async_event()
1512 _get_st_from_smid(struct MPT3SAS_ADAPTER *ioc, u16 smid) in _get_st_from_smid() argument
1516 if (WARN_ON(!smid) || in _get_st_from_smid()
1517 WARN_ON(smid >= ioc->hi_priority_smid)) in _get_st_from_smid()
1520 cmd = mpt3sas_scsih_scsi_lookup_get(ioc, smid); in _get_st_from_smid()
1535 _base_get_cb_idx(struct MPT3SAS_ADAPTER *ioc, u16 smid) in _base_get_cb_idx() argument
1541 if (smid < ioc->hi_priority_smid) { in _base_get_cb_idx()
1544 if (smid < ctl_smid) { in _base_get_cb_idx()
1545 st = _get_st_from_smid(ioc, smid); in _base_get_cb_idx()
1548 } else if (smid == ctl_smid) in _base_get_cb_idx()
1550 } else if (smid < ioc->internal_smid) { in _base_get_cb_idx()
1551 i = smid - ioc->hi_priority_smid; in _base_get_cb_idx()
1553 } else if (smid <= ioc->hba_queue_depth) { in _base_get_cb_idx()
1554 i = smid - ioc->internal_smid; in _base_get_cb_idx()
1676 u16 smid; in _base_process_reply_queue() local
1702 smid = le16_to_cpu(rpf->Default.DescriptorTypeDependent1); in _base_process_reply_queue()
1709 cb_idx = _base_get_cb_idx(ioc, smid); in _base_process_reply_queue()
1712 rc = mpt_callbacks[cb_idx](ioc, smid, in _base_process_reply_queue()
1715 mpt3sas_base_free_smid(ioc, smid); in _base_process_reply_queue()
1724 if (smid) { in _base_process_reply_queue()
1725 cb_idx = _base_get_cb_idx(ioc, smid); in _base_process_reply_queue()
1728 rc = mpt_callbacks[cb_idx](ioc, smid, in _base_process_reply_queue()
1732 smid, msix_index, reply); in _base_process_reply_queue()
1735 smid); in _base_process_reply_queue()
2130 u16 smid = st->smid; in _base_get_chain_buffer_tracker() local
2132 atomic_read(&ioc->chain_lookup[smid - 1].chain_offset); in _base_get_chain_buffer_tracker()
2137 chain_req = &ioc->chain_lookup[smid - 1].chains_per_smid[chain_offset]; in _base_get_chain_buffer_tracker()
2138 atomic_inc(&ioc->chain_lookup[smid - 1].chain_offset); in _base_get_chain_buffer_tracker()
2257 _base_build_nvme_prp(struct MPT3SAS_ADAPTER *ioc, u16 smid, in _base_build_nvme_prp() argument
2285 prp_page = (__le64 *)mpt3sas_base_get_pcie_sgl(ioc, smid); in _base_build_nvme_prp()
2286 prp_page_dma = mpt3sas_base_get_pcie_sgl_dma(ioc, smid); in _base_build_nvme_prp()
2427 u16 smid, int sge_count) in base_make_prp_nvme() argument
2478 curr_buff = mpt3sas_base_get_pcie_sgl(ioc, smid); in base_make_prp_nvme()
2479 msg_dma = mpt3sas_base_get_pcie_sgl_dma(ioc, smid); in base_make_prp_nvme()
2590 Mpi25SCSIIORequest_t *mpi_request, u16 smid, struct scsi_cmnd *scmd, in _base_check_pcie_native_sgl() argument
2611 smid, sges_left); in _base_check_pcie_native_sgl()
2674 struct scsi_cmnd *scmd, u16 smid, struct _pcie_device *unused) in _base_build_sg_scmd() argument
2690 mpi_request = mpt3sas_base_get_msg_frame(ioc, smid); in _base_build_sg_scmd()
2815 struct scsi_cmnd *scmd, u16 smid, struct _pcie_device *pcie_device) in _base_build_sg_scmd_ieee() argument
2830 mpi_request = mpt3sas_base_get_msg_frame(ioc, smid); in _base_build_sg_scmd_ieee()
2842 smid, scmd, pcie_device) == 0)) { in _base_build_sg_scmd_ieee()
3756 mpt3sas_base_get_msg_frame(struct MPT3SAS_ADAPTER *ioc, u16 smid) in mpt3sas_base_get_msg_frame() argument
3758 return (void *)(ioc->request + (smid * ioc->request_sz)); in mpt3sas_base_get_msg_frame()
3769 mpt3sas_base_get_sense_buffer(struct MPT3SAS_ADAPTER *ioc, u16 smid) in mpt3sas_base_get_sense_buffer() argument
3771 return (void *)(ioc->sense + ((smid - 1) * SCSI_SENSE_BUFFERSIZE)); in mpt3sas_base_get_sense_buffer()
3782 mpt3sas_base_get_sense_buffer_dma(struct MPT3SAS_ADAPTER *ioc, u16 smid) in mpt3sas_base_get_sense_buffer_dma() argument
3784 return cpu_to_le32(ioc->sense_dma + ((smid - 1) * in mpt3sas_base_get_sense_buffer_dma()
3796 mpt3sas_base_get_pcie_sgl(struct MPT3SAS_ADAPTER *ioc, u16 smid) in mpt3sas_base_get_pcie_sgl() argument
3798 return (void *)(ioc->pcie_sg_lookup[smid - 1].pcie_sgl); in mpt3sas_base_get_pcie_sgl()
3809 mpt3sas_base_get_pcie_sgl_dma(struct MPT3SAS_ADAPTER *ioc, u16 smid) in mpt3sas_base_get_pcie_sgl_dma() argument
3811 return ioc->pcie_sg_lookup[smid - 1].pcie_sgl_dma; in mpt3sas_base_get_pcie_sgl_dma()
3899 u16 smid; in mpt3sas_base_get_smid() local
3911 smid = request->smid; in mpt3sas_base_get_smid()
3914 return smid; in mpt3sas_base_get_smid()
3930 u16 smid; in mpt3sas_base_get_smid_scsiio() local
3948 smid = tag + 1; in mpt3sas_base_get_smid_scsiio()
3950 request->smid = smid; in mpt3sas_base_get_smid_scsiio()
3953 return smid; in mpt3sas_base_get_smid_scsiio()
3968 u16 smid; in mpt3sas_base_get_smid_hpr() local
3979 smid = request->smid; in mpt3sas_base_get_smid_hpr()
3982 return smid; in mpt3sas_base_get_smid_hpr()
4001 if (WARN_ON(st->smid == 0)) in mpt3sas_base_clear_st()
4006 atomic_set(&ioc->chain_lookup[st->smid - 1].chain_offset, 0); in mpt3sas_base_clear_st()
4007 st->smid = 0; in mpt3sas_base_clear_st()
4016 mpt3sas_base_free_smid(struct MPT3SAS_ADAPTER *ioc, u16 smid) in mpt3sas_base_free_smid() argument
4021 if (smid < ioc->hi_priority_smid) { in mpt3sas_base_free_smid()
4025 st = _get_st_from_smid(ioc, smid); in mpt3sas_base_free_smid()
4032 request = mpt3sas_base_get_msg_frame(ioc, smid); in mpt3sas_base_free_smid()
4037 ioc->io_queue_num[smid - 1] = 0; in mpt3sas_base_free_smid()
4042 if (smid < ioc->internal_smid) { in mpt3sas_base_free_smid()
4044 i = smid - ioc->hi_priority_smid; in mpt3sas_base_free_smid()
4047 } else if (smid <= ioc->hba_queue_depth) { in mpt3sas_base_free_smid()
4049 i = smid - ioc->internal_smid; in mpt3sas_base_free_smid()
4114 _base_set_and_get_msix_index(struct MPT3SAS_ADAPTER *ioc, u16 smid) in _base_set_and_get_msix_index() argument
4118 if (smid < ioc->hi_priority_smid) in _base_set_and_get_msix_index()
4119 st = _get_st_from_smid(ioc, smid); in _base_set_and_get_msix_index()
4136 u16 smid, u16 handle) in _base_put_smid_mpi_ep_scsi_io() argument
4141 __le32 *mfp = (__le32 *)mpt3sas_base_get_msg_frame(ioc, smid); in _base_put_smid_mpi_ep_scsi_io()
4143 _clone_sg_entries(ioc, (void *) mfp, smid); in _base_put_smid_mpi_ep_scsi_io()
4145 MPI_FRAME_START_OFFSET + (smid * ioc->request_sz); in _base_put_smid_mpi_ep_scsi_io()
4149 descriptor.SCSIIO.MSIxIndex = _base_set_and_get_msix_index(ioc, smid); in _base_put_smid_mpi_ep_scsi_io()
4150 descriptor.SCSIIO.SMID = cpu_to_le16(smid); in _base_put_smid_mpi_ep_scsi_io()
4164 _base_put_smid_scsi_io(struct MPT3SAS_ADAPTER *ioc, u16 smid, u16 handle) in _base_put_smid_scsi_io() argument
4171 descriptor.SCSIIO.MSIxIndex = _base_set_and_get_msix_index(ioc, smid); in _base_put_smid_scsi_io()
4172 descriptor.SCSIIO.SMID = cpu_to_le16(smid); in _base_put_smid_scsi_io()
4186 _base_put_smid_fast_path(struct MPT3SAS_ADAPTER *ioc, u16 smid, in _base_put_smid_fast_path() argument
4194 descriptor.SCSIIO.MSIxIndex = _base_set_and_get_msix_index(ioc, smid); in _base_put_smid_fast_path()
4195 descriptor.SCSIIO.SMID = cpu_to_le16(smid); in _base_put_smid_fast_path()
4209 _base_put_smid_hi_priority(struct MPT3SAS_ADAPTER *ioc, u16 smid, in _base_put_smid_hi_priority() argument
4217 __le32 *mfp = (__le32 *)mpt3sas_base_get_msg_frame(ioc, smid); in _base_put_smid_hi_priority()
4222 + (smid * ioc->request_sz); in _base_put_smid_hi_priority()
4232 descriptor.HighPriority.SMID = cpu_to_le16(smid); in _base_put_smid_hi_priority()
4251 mpt3sas_base_put_smid_nvme_encap(struct MPT3SAS_ADAPTER *ioc, u16 smid) in mpt3sas_base_put_smid_nvme_encap() argument
4258 descriptor.Default.MSIxIndex = _base_set_and_get_msix_index(ioc, smid); in mpt3sas_base_put_smid_nvme_encap()
4259 descriptor.Default.SMID = cpu_to_le16(smid); in mpt3sas_base_put_smid_nvme_encap()
4272 _base_put_smid_default(struct MPT3SAS_ADAPTER *ioc, u16 smid) in _base_put_smid_default() argument
4279 __le32 *mfp = (__le32 *)mpt3sas_base_get_msg_frame(ioc, smid); in _base_put_smid_default()
4281 _clone_sg_entries(ioc, (void *) mfp, smid); in _base_put_smid_default()
4284 MPI_FRAME_START_OFFSET + (smid * ioc->request_sz); in _base_put_smid_default()
4290 descriptor.Default.MSIxIndex = _base_set_and_get_msix_index(ioc, smid); in _base_put_smid_default()
4291 descriptor.Default.SMID = cpu_to_le16(smid); in _base_put_smid_default()
4313 _base_put_smid_scsi_io_atomic(struct MPT3SAS_ADAPTER *ioc, u16 smid, in _base_put_smid_scsi_io_atomic() argument
4320 descriptor.MSIxIndex = _base_set_and_get_msix_index(ioc, smid); in _base_put_smid_scsi_io_atomic()
4321 descriptor.SMID = cpu_to_le16(smid); in _base_put_smid_scsi_io_atomic()
4335 _base_put_smid_fast_path_atomic(struct MPT3SAS_ADAPTER *ioc, u16 smid, in _base_put_smid_fast_path_atomic() argument
4342 descriptor.MSIxIndex = _base_set_and_get_msix_index(ioc, smid); in _base_put_smid_fast_path_atomic()
4343 descriptor.SMID = cpu_to_le16(smid); in _base_put_smid_fast_path_atomic()
4358 _base_put_smid_hi_priority_atomic(struct MPT3SAS_ADAPTER *ioc, u16 smid, in _base_put_smid_hi_priority_atomic() argument
4366 descriptor.SMID = cpu_to_le16(smid); in _base_put_smid_hi_priority_atomic()
4380 _base_put_smid_default_atomic(struct MPT3SAS_ADAPTER *ioc, u16 smid) in _base_put_smid_default_atomic() argument
4386 descriptor.MSIxIndex = _base_set_and_get_msix_index(ioc, smid); in _base_put_smid_default_atomic()
4387 descriptor.SMID = cpu_to_le16(smid); in _base_put_smid_default_atomic()
4659 u16 smid, ioc_status; in _base_display_fwpkg_version() local
4679 smid = mpt3sas_base_get_smid(ioc, ioc->base_cb_idx); in _base_display_fwpkg_version()
4680 if (!smid) { in _base_display_fwpkg_version()
4687 mpi_request = mpt3sas_base_get_msg_frame(ioc, smid); in _base_display_fwpkg_version()
4688 ioc->base_cmds.smid = smid; in _base_display_fwpkg_version()
4696 ioc->put_smid_default(ioc, smid); in _base_display_fwpkg_version()
7149 u16 smid; in mpt3sas_base_sas_iounit_control() local
7168 smid = mpt3sas_base_get_smid(ioc, ioc->base_cb_idx); in mpt3sas_base_sas_iounit_control()
7169 if (!smid) { in mpt3sas_base_sas_iounit_control()
7177 request = mpt3sas_base_get_msg_frame(ioc, smid); in mpt3sas_base_sas_iounit_control()
7178 ioc->base_cmds.smid = smid; in mpt3sas_base_sas_iounit_control()
7184 ioc->put_smid_default(ioc, smid); in mpt3sas_base_sas_iounit_control()
7230 u16 smid; in mpt3sas_base_scsi_enclosure_processor() local
7249 smid = mpt3sas_base_get_smid(ioc, ioc->base_cb_idx); in mpt3sas_base_scsi_enclosure_processor()
7250 if (!smid) { in mpt3sas_base_scsi_enclosure_processor()
7258 request = mpt3sas_base_get_msg_frame(ioc, smid); in mpt3sas_base_scsi_enclosure_processor()
7259 ioc->base_cmds.smid = smid; in mpt3sas_base_scsi_enclosure_processor()
7263 ioc->put_smid_default(ioc, smid); in mpt3sas_base_scsi_enclosure_processor()
7610 mpt3sas_port_enable_done(struct MPT3SAS_ADAPTER *ioc, u16 smid, u8 msix_index, in mpt3sas_port_enable_done() argument
7661 u16 smid; in _base_send_port_enable() local
7671 smid = mpt3sas_base_get_smid(ioc, ioc->port_enable_cb_idx); in _base_send_port_enable()
7672 if (!smid) { in _base_send_port_enable()
7678 mpi_request = mpt3sas_base_get_msg_frame(ioc, smid); in _base_send_port_enable()
7679 ioc->port_enable_cmds.smid = smid; in _base_send_port_enable()
7684 ioc->put_smid_default(ioc, smid); in _base_send_port_enable()
7722 u16 smid; in mpt3sas_port_enable() local
7731 smid = mpt3sas_base_get_smid(ioc, ioc->port_enable_cb_idx); in mpt3sas_port_enable()
7732 if (!smid) { in mpt3sas_port_enable()
7739 mpi_request = mpt3sas_base_get_msg_frame(ioc, smid); in mpt3sas_port_enable()
7740 ioc->port_enable_cmds.smid = smid; in mpt3sas_port_enable()
7744 ioc->put_smid_default(ioc, smid); in mpt3sas_port_enable()
7833 u16 smid; in _base_event_notification() local
7844 smid = mpt3sas_base_get_smid(ioc, ioc->base_cb_idx); in _base_event_notification()
7845 if (!smid) { in _base_event_notification()
7850 mpi_request = mpt3sas_base_get_msg_frame(ioc, smid); in _base_event_notification()
7851 ioc->base_cmds.smid = smid; in _base_event_notification()
7860 ioc->put_smid_default(ioc, smid); in _base_event_notification()
8136 u16 smid; in _base_make_ioc_operational() local
8176 smid = ioc->hi_priority_smid; in _base_make_ioc_operational()
8177 for (i = 0; i < ioc->hi_priority_depth; i++, smid++) { in _base_make_ioc_operational()
8179 ioc->hpr_lookup[i].smid = smid; in _base_make_ioc_operational()
8186 smid = ioc->internal_smid; in _base_make_ioc_operational()
8187 for (i = 0; i < ioc->internal_depth; i++, smid++) { in _base_make_ioc_operational()
8189 ioc->internal_lookup[i].smid = smid; in _base_make_ioc_operational()
8691 mpt3sas_base_free_smid(ioc, ioc->transport_cmds.smid); in _base_clear_outstanding_mpt_commands()
8696 mpt3sas_base_free_smid(ioc, ioc->base_cmds.smid); in _base_clear_outstanding_mpt_commands()
8702 mpt3sas_base_free_smid(ioc, ioc->port_enable_cmds.smid); in _base_clear_outstanding_mpt_commands()
8713 mpt3sas_base_free_smid(ioc, ioc->config_cmds.smid); in _base_clear_outstanding_mpt_commands()
8714 ioc->config_cmds.smid = USHRT_MAX; in _base_clear_outstanding_mpt_commands()