Lines Matching defs:handle

72 static int _scsih_add_device(struct MPT3SAS_ADAPTER *ioc, u16 handle,
74 static int _scsih_pcie_add_device(struct MPT3SAS_ADAPTER *ioc, u16 handle);
78 _scsih_pcie_check_device(struct MPT3SAS_ADAPTER *ioc, u16 handle);
189 * @device_handle: device handle
242 * @handle: sas device handle (assigned by firmware)
266 u16 handle;
405 * _scsih_get_sas_address - set the sas_address for given device handle
407 * @handle: device handle
413 _scsih_get_sas_address(struct MPT3SAS_ADAPTER *ioc, u16 handle,
423 MPI2_SAS_DEVICE_PGAD_FORM_HANDLE, handle))) {
434 if ((handle <= ioc->sas_hba.num_phys) &&
443 /* we hit this because the given parent handle doesn't exist */
448 ioc_err(ioc, "handle(0x%04x), ioc_status(0x%04x), failure at %s:%d/%s()!\n",
449 handle, ioc_status, __FILE__, __LINE__, __func__);
665 __mpt3sas_get_sdev_by_handle(struct MPT3SAS_ADAPTER *ioc, u16 handle)
672 if (sas_device->handle == handle)
676 if (sas_device->handle == handle)
689 * @handle: sas device handle (assigned by firmware)
696 mpt3sas_get_sdev_by_handle(struct MPT3SAS_ADAPTER *ioc, u16 handle)
702 sas_device = __mpt3sas_get_sdev_by_handle(ioc, handle);
782 ioc_info(ioc, "removing handle(0x%04x), sas_addr(0x%016llx)\n",
783 sas_device->handle, (u64)sas_device->sas_address);
800 * _scsih_device_remove_by_handle - removing device object by handle
802 * @handle: device handle
805 _scsih_device_remove_by_handle(struct MPT3SAS_ADAPTER *ioc, u16 handle)
814 sas_device = __mpt3sas_get_sdev_by_handle(ioc, handle);
869 ioc_info(ioc, "%s: handle(0x%04x), sas_addr(0x%016llx)\n",
870 __func__, sas_device->handle,
882 clear_bit(sas_device->handle, ioc->pend_os_device_add);
886 if (!mpt3sas_transport_port_add(ioc, sas_device->handle,
902 clear_bit(sas_device->handle, ioc->pend_os_device_add);
920 ioc_info(ioc, "%s: handle(0x%04x), sas_addr(0x%016llx)\n",
921 __func__, sas_device->handle,
1006 __mpt3sas_get_pdev_by_handle(struct MPT3SAS_ADAPTER *ioc, u16 handle)
1013 if (pcie_device->handle == handle)
1017 if (pcie_device->handle == handle)
1031 * @handle: Firmware device handle
1036 * This searches for pcie_device based on handle, then return pcie_device
1040 mpt3sas_get_pdev_by_handle(struct MPT3SAS_ADAPTER *ioc, u16 handle)
1046 pcie_device = __mpt3sas_get_pdev_by_handle(ioc, handle);
1098 ioc_info(ioc, "removing handle(0x%04x), wwid(0x%016llx)\n",
1099 pcie_device->handle, (u64)pcie_device->wwid);
1133 * _scsih_pcie_device_remove_by_handle - removing pcie device object by handle
1135 * @handle: device handle
1138 _scsih_pcie_device_remove_by_handle(struct MPT3SAS_ADAPTER *ioc, u16 handle)
1149 pcie_device = __mpt3sas_get_pdev_by_handle(ioc, handle);
1188 ioc_info(ioc, "%s: handle (0x%04x), wwid(0x%016llx)\n",
1190 pcie_device->handle, (u64)pcie_device->wwid));
1210 clear_bit(pcie_device->handle, ioc->pend_os_device_add);
1218 clear_bit(pcie_device->handle, ioc->pend_os_device_add);
1221 clear_bit(pcie_device->handle, ioc->pend_os_device_add);
1239 ioc_info(ioc, "%s: handle (0x%04x), wwid(0x%016llx)\n",
1241 pcie_device->handle, (u64)pcie_device->wwid));
1292 * @handle: sas device handle (assigned by firmware)
1295 * This searches for raid_device based on handle, then return raid_device
1299 mpt3sas_raid_device_find_by_handle(struct MPT3SAS_ADAPTER *ioc, u16 handle)
1305 if (raid_device->handle != handle)
1355 ioc_info(ioc, "%s: handle(0x%04x), wwid(0x%016llx)\n",
1357 raid_device->handle, (u64)raid_device->wwid));
1385 * @handle: expander handle (assigned by firmware)
1388 * This searches for expander device based on handle, then returns the
1392 mpt3sas_scsih_expander_find_by_handle(struct MPT3SAS_ADAPTER *ioc, u16 handle)
1398 if (sas_expander->handle != handle)
1410 * @handle: enclosure handle (assigned by firmware)
1413 * This searches for enclosure device based on handle, then returns the
1417 mpt3sas_scsih_enclosure_find_by_handle(struct MPT3SAS_ADAPTER *ioc, u16 handle)
1423 if (le16_to_cpu(enclosure_dev->pg0.EnclosureHandle) != handle)
1720 sas_target_priv_data->handle = MPT3SAS_INVALID_DEVICE_HANDLE;
1728 sas_target_priv_data->handle = raid_device->handle;
1745 sas_target_priv_data->handle = pcie_device->handle;
1768 sas_target_priv_data->handle = sas_device->handle;
1774 if (test_bit(sas_device->handle, ioc->pd_handles))
1998 * @handle: device handle
2003 u16 handle, struct scsi_device *sdev)
2012 MPI2_SAS_DEVICE_PGAD_FORM_HANDLE, handle))) {
2086 u16 handle;
2089 handle = 0;
2097 handle = raid_device->handle;
2102 if (!handle)
2106 MPI2_RAID_VOLUME_PGAD_FORM_HANDLE, handle,
2147 u16 handle = 0;
2153 handle = raid_device->handle;
2160 MPI2_RAID_VOLUME_PGAD_FORM_HANDLE, handle,
2257 if ((mpt3sas_config_get_number_pds(ioc, raid_device->handle,
2277 MPI2_RAID_VOLUME_PGAD_FORM_HANDLE, raid_device->handle, sz))) {
2354 u16 handle, volume_handle = 0;
2362 handle = sas_target_priv_data->handle;
2368 raid_device = mpt3sas_raid_device_find_by_handle(ioc, handle);
2438 "%s: handle(0x%04x), wwid(0x%016llx),"
2440 r_level, raid_device->handle,
2462 if (mpt3sas_config_get_volume_handle(ioc, handle,
2494 "%s: handle(0x%04x), wwid(0x%016llx), port(%d)\n",
2495 ds, handle, (unsigned long long)pcie_device->wwid,
2547 "set ignore_delay_remove for handle(0x%04x)\n",
2548 sas_device_priv_data->sas_target->handle);
2562 sdev_printk(KERN_INFO, sdev, "%s: handle(0x%04x), " \
2564 ds, handle, (unsigned long long)sas_device->sas_address,
2573 _scsih_display_sata_capabilities(ioc, handle, sdev);
2710 * @handle: device handle
2715 mpt3sas_scsih_set_tm_flag(struct MPT3SAS_ADAPTER *ioc, u16 handle)
2727 if (sas_device_priv_data->sas_target->handle == handle) {
2738 * @handle: device handle
2743 mpt3sas_scsih_clear_tm_flag(struct MPT3SAS_ADAPTER *ioc, u16 handle)
2755 if (sas_device_priv_data->sas_target->handle == handle) {
2812 * @handle: device handle
2827 scsih_tm_post_processing(struct MPT3SAS_ADAPTER *ioc, u16 handle,
2838 " smid(%d), task_type(0x%02x), handle(0x%04x)\n",
2839 smid_task, type, handle);
2856 * @handle: device handle
2875 mpt3sas_scsih_issue_tm(struct MPT3SAS_ADAPTER *ioc, u16 handle, uint channel,
2927 ioc_info(ioc, "sending tm: handle(0x%04x), task_type(0x%02x), smid(%d), timeout(%d), tr_method(0x%x)\n",
2928 handle, type, smid_task, timeout, tr_method));
2935 mpi_request->DevHandle = cpu_to_le16(handle);
2942 mpt3sas_scsih_set_tm_flag(ioc, handle);
2982 * doesn't match with device handle on which this task abort
2992 if (le16_to_cpu(request->DevHandle) != handle)
2995 ioc_info(ioc, "Task abort tm failed: handle(0x%04x),"
2997 handle, timeout, tr_method, smid_task, msix_task);
3004 rc = scsih_tm_post_processing(ioc, handle, channel, id, lun,
3016 mpt3sas_scsih_clear_tm_flag(ioc, handle);
3021 int mpt3sas_scsih_issue_locked_tm(struct MPT3SAS_ADAPTER *ioc, u16 handle,
3028 ret = mpt3sas_scsih_issue_tm(ioc, handle, channel, id, lun, type,
3062 "%s handle(0x%04x), %s wwid(0x%016llx)\n",
3063 device_str, priv_target->handle,
3071 "handle(0x%04x), wwid(0x%016llx), port(%d)\n",
3072 pcie_device->handle,
3097 "volume handle(0x%04x), "
3103 "handle(0x%04x), sas_address(0x%016llx), phy(%d)\n",
3104 sas_device->handle,
3129 u16 handle;
3171 handle = sas_device_priv_data->sas_target->handle;
3172 pcie_device = mpt3sas_get_pdev_by_handle(ioc, handle);
3176 r = mpt3sas_scsih_issue_locked_tm(ioc, handle, scmd->device->channel,
3204 u16 handle;
3228 handle = 0;
3234 handle = sas_device->volume_handle;
3236 handle = sas_device_priv_data->sas_target->handle;
3238 if (!handle) {
3244 pcie_device = mpt3sas_get_pdev_by_handle(ioc, handle);
3253 r = mpt3sas_scsih_issue_locked_tm(ioc, handle, scmd->device->channel,
3285 u16 handle;
3308 handle = 0;
3314 handle = sas_device->volume_handle;
3316 handle = sas_device_priv_data->sas_target->handle;
3318 if (!handle) {
3324 pcie_device = mpt3sas_get_pdev_by_handle(ioc, handle);
3332 r = mpt3sas_scsih_issue_locked_tm(ioc, handle, scmd->device->channel,
3581 sdev_printk(KERN_INFO, sdev, "device_block, handle(0x%04x)\n",
3582 sas_device_priv_data->sas_target->handle);
3588 "device_block failed with return(%d) for handle(0x%04x)\n",
3589 r, sas_device_priv_data->sas_target->handle);
3607 "handle(0x%04x)\n", sas_device_priv_data->sas_target->handle);
3617 "device_unblock failed with return(%d) for handle(0x%04x) "
3619 r, sas_device_priv_data->sas_target->handle);
3624 "failed with return(%d) for handle(0x%04x)\n",
3625 r, sas_device_priv_data->sas_target->handle);
3631 " failed with return(%d) for handle(0x%04x)\n",
3632 r, sas_device_priv_data->sas_target->handle);
3656 "device_running, handle(0x%04x)\n",
3657 sas_device_priv_data->sas_target->handle));
3709 "%s skip device_block for SES handle(0x%04x)\n",
3710 __func__, sas_device_priv_data->sas_target->handle);
3720 * @handle: device handle
3725 _scsih_block_io_device(struct MPT3SAS_ADAPTER *ioc, u16 handle)
3731 sas_device = mpt3sas_get_sdev_by_handle(ioc, handle);
3737 if (sas_device_priv_data->sas_target->handle != handle)
3745 "%s skip device_block for SES handle(0x%04x)\n",
3746 __func__, sas_device_priv_data->sas_target->handle);
3785 set_bit(sas_device->handle,
3822 u16 handle;
3826 handle = le16_to_cpu(event_data->PHY[i].AttachedDevHandle);
3827 if (!handle)
3832 _scsih_block_io_device(ioc, handle);
3849 u16 handle;
3853 handle =
3855 if (!handle)
3860 _scsih_block_io_device(ioc, handle);
3866 * @handle: device handle
3879 _scsih_tm_tr_send(struct MPT3SAS_ADAPTER *ioc, u16 handle)
3894 ioc_info(ioc, "%s: host in pci error recovery: handle(0x%04x)\n",
3895 __func__, handle));
3901 ioc_info(ioc, "%s: host is not operational: handle(0x%04x)\n",
3902 __func__, handle));
3907 if (test_bit(handle, ioc->pd_handles))
3910 clear_bit(handle, ioc->pend_os_device_add);
3913 sas_device = __mpt3sas_get_sdev_by_handle(ioc, handle);
3923 pcie_device = __mpt3sas_get_pdev_by_handle(ioc, handle);
3941 ioc_info(ioc, "setting delete flag: handle(0x%04x), sas_addr(0x%016llx)\n",
3942 handle, (u64)sas_address));
3967 sas_target_priv_data->handle = MPT3SAS_INVALID_DEVICE_HANDLE;
3976 delayed_tr->handle = handle;
3979 ioc_info(ioc, "DELAYED:tr:handle(0x%04x), (open)\n",
3980 handle));
3985 ioc_info(ioc, "tr_send:handle(0x%04x), (open), smid(%d), cb(%d)\n",
3986 handle, smid, ioc->tm_tr_cb_idx));
3990 mpi_request->DevHandle = cpu_to_le16(handle);
3993 set_bit(handle, ioc->device_remove_in_progress);
4024 u16 handle;
4052 handle = le16_to_cpu(mpi_request_tm->DevHandle);
4053 if (handle != le16_to_cpu(mpi_reply->DevHandle)) {
4055 ioc_err(ioc, "spurious interrupt: handle(0x%04x:0x%04x), smid(%d)!!!\n",
4056 handle,
4063 ioc_info(ioc, "tr_complete:handle(0x%04x), (open) smid(%d), ioc_status(0x%04x), loginfo(0x%08x), completed(%d)\n",
4064 handle, smid, le16_to_cpu(mpi_reply->IOCStatus),
4074 delayed_sc->handle = le16_to_cpu(mpi_request_tm->DevHandle);
4077 ioc_info(ioc, "DELAYED:sc:handle(0x%04x), (open)\n",
4078 handle));
4083 ioc_info(ioc, "sc_send:handle(0x%04x), (open), smid(%d), cb(%d)\n",
4084 handle, smid_sas_ctrl, ioc->tm_sas_control_cb_idx));
4154 ioc_info(ioc, "sc_complete:handle(0x%04x), (open) smid(%d), ioc_status(0x%04x), loginfo(0x%08x)\n",
4173 * @handle: device handle
4181 _scsih_tm_tr_volume_send(struct MPT3SAS_ADAPTER *ioc, u16 handle)
4200 delayed_tr->handle = handle;
4203 ioc_info(ioc, "DELAYED:tr:handle(0x%04x), (open)\n",
4204 handle));
4209 ioc_info(ioc, "tr_send:handle(0x%04x), (open), smid(%d), cb(%d)\n",
4210 handle, smid, ioc->tm_tr_volume_cb_idx));
4214 mpi_request->DevHandle = cpu_to_le16(handle);
4234 u16 handle;
4252 handle = le16_to_cpu(mpi_request_tm->DevHandle);
4253 if (handle != le16_to_cpu(mpi_reply->DevHandle)) {
4255 ioc_err(ioc, "spurious interrupt: handle(0x%04x:0x%04x), smid(%d)!!!\n",
4256 handle, le16_to_cpu(mpi_reply->DevHandle),
4262 ioc_info(ioc, "tr_complete:handle(0x%04x), (open) smid(%d), ioc_status(0x%04x), loginfo(0x%08x), completed(%d)\n",
4263 handle, smid, le16_to_cpu(mpi_reply->IOCStatus),
4313 * @handle: device handle
4319 u16 smid, u16 handle)
4354 ioc_info(ioc, "sc_send:handle(0x%04x), (open), smid(%d), cb(%d)\n",
4355 handle, smid, ioc->tm_sas_control_cb_idx));
4360 mpi_request->DevHandle = cpu_to_le16(handle);
4397 delayed_sc->handle);
4425 _scsih_tm_tr_volume_send(ioc, delayed_tr->handle);
4435 _scsih_tm_tr_send(ioc, delayed_tr->handle);
4449 * This routine added to better handle cable breaker.
4465 u16 handle;
4468 handle = le16_to_cpu(event_data->PHY[i].AttachedDevHandle);
4469 if (!handle)
4474 _scsih_tm_tr_send(ioc, handle);
4491 handle = find_first_bit(ioc->blocking_handles,
4493 if (handle < ioc->facts.MaxDevHandle)
4494 _scsih_block_io_device(ioc, handle);
4495 } while (test_and_clear_bit(handle, ioc->blocking_handles));
4544 u16 handle, switch_handle;
4547 handle =
4549 if (!handle)
4553 _scsih_tm_tr_send(ioc, handle);
4600 * @handle: device handle
4605 _scsih_set_volume_delete_flag(struct MPT3SAS_ADAPTER *ioc, u16 handle)
4612 raid_device = mpt3sas_raid_device_find_by_handle(ioc, handle);
4619 ioc_info(ioc, "setting delete flag: handle(0x%04x), wwid(0x%016llx)\n",
4620 handle, (u64)raid_device->wwid));
4626 * _scsih_set_volume_handle_for_tr - set handle for target reset to volume
4627 * @handle: input handle
4628 * @a: handle for volume a
4629 * @b: handle for volume b
4632 * routine is to set the volume handle in either a or b. When the given
4633 * input handle is non-zero, or when a and b have not been set before.
4636 _scsih_set_volume_handle_for_tr(u16 handle, u16 *a, u16 *b)
4638 if (!handle || handle == *a || handle == *b)
4641 *a = handle;
4643 *b = handle;
4664 u16 handle, volume_handle, a, b;
4711 handle = le16_to_cpu(element->PhysDiskDevHandle);
4713 clear_bit(handle, ioc->pd_handles);
4715 _scsih_tm_tr_send(ioc, handle);
4720 delayed_tr->handle = handle;
4723 ioc_info(ioc, "DELAYED:tr:handle(0x%04x), (open)\n",
4724 handle));
4726 _scsih_tm_tr_send(ioc, handle);
4737 * This will handle the case when the cable connected to entire volume is
4953 u16 handle;
4973 /* invalid device handle */
4974 handle = sas_target_priv_data->handle;
4975 if (handle == MPT3SAS_INVALID_DEVICE_HANDLE) {
5047 mpi_request->DevHandle = cpu_to_le16(handle);
5079 ioc->put_smid_fast_path(ioc, smid, handle);
5164 desc_ioc_state = "scsi invalid dev handle";
5327 * @handle: device handle
5331 _scsih_turn_on_pfa_led(struct MPT3SAS_ADAPTER *ioc, u16 handle)
5337 sas_device = mpt3sas_get_sdev_by_handle(ioc, handle);
5346 mpi_request.DevHandle = cpu_to_le16(handle);
5407 * @handle: device handle
5411 _scsih_send_event_to_turn_on_pfa_led(struct MPT3SAS_ADAPTER *ioc, u16 handle)
5419 fw_event->device_handle = handle;
5428 * @handle: device handle
5432 _scsih_smart_predicted_fault(struct MPT3SAS_ADAPTER *ioc, u16 handle)
5442 /* only handle non-raid devices */
5444 sas_device = __mpt3sas_get_sdev_by_handle(ioc, handle);
5460 _scsih_send_event_to_turn_on_pfa_led(ioc, handle);
5482 event_data->DevHandle = cpu_to_le16(handle);
5558 cpu_to_le16(sas_device_priv_data->sas_target->handle);
5560 sas_device_priv_data->sas_target->handle);
5781 ioc->sas_hba.handle = le16_to_cpu(sas_iounit_pg0->
5783 ioc->sas_hba.phy[i].handle = ioc->sas_hba.handle;
5905 ioc->sas_hba.handle = le16_to_cpu(sas_iounit_pg0->
5907 ioc->sas_hba.phy[i].handle = ioc->sas_hba.handle;
5913 MPI2_SAS_DEVICE_PGAD_FORM_HANDLE, ioc->sas_hba.handle))) {
5921 ioc_info(ioc, "host_add: handle(0x%04x), sas_addr(0x%016llx), phys(%d)\n",
5922 ioc->sas_hba.handle,
5942 * @handle: expander handle
5949 _scsih_expander_add(struct MPT3SAS_ADAPTER *ioc, u16 handle)
5965 if (!handle)
5972 MPI2_SAS_EXPAND_PGAD_FORM_HNDL, handle))) {
5986 /* handle out of order topology events */
6023 sas_expander->handle = handle;
6028 ioc_info(ioc, "expander_add: handle(0x%04x), parent(0x%04x), sas_addr(0x%016llx), phys(%d)\n",
6029 handle, parent_handle,
6046 mpt3sas_port = mpt3sas_transport_port_add(ioc, handle,
6058 &expander_pg1, i, handle))) {
6064 sas_expander->phy[i].handle = handle;
6164 * @handle: sas device handle
6171 u16 handle, u8 access_status)
6218 ioc_err(ioc, "discovery errors(%s): sas_address(0x%016llx), handle(0x%04x)\n",
6219 desc, (u64)sas_address, handle);
6227 * @handle: attached device handle
6233 u64 parent_sas_address, u16 handle, u8 phy_number, u8 link_rate)
6247 MPI2_SAS_DEVICE_PGAD_FORM_HANDLE, handle)))
6254 /* wide port handling ~ we need only handle device once for the phy that
6273 if (unlikely(sas_device->handle != handle)) {
6277 "handle changed from(0x%04x) to (0x%04x)!!!\n",
6278 sas_device->handle, handle);
6279 sas_target_priv_data->handle = handle;
6280 sas_device->handle = handle;
6313 ioc_err(ioc, "device is not present handle(0x%04x), flags!!!\n",
6314 handle);
6319 if (_scsih_check_access_status(ioc, sas_address, handle,
6339 * @handle: sas device handle
6348 _scsih_add_device(struct MPT3SAS_ADAPTER *ioc, u16 handle, u8 phy_num,
6360 MPI2_SAS_DEVICE_PGAD_FORM_HANDLE, handle))) {
6378 set_bit(handle, ioc->pend_os_device_add);
6384 ioc_err(ioc, "device is not present handle(0x04%x)!!!\n",
6385 handle);
6390 if (_scsih_check_access_status(ioc, sas_address, handle,
6397 clear_bit(handle, ioc->pend_os_device_add);
6407 ioc_info(ioc, "Enclosure handle(0x%04x) doesn't match with enclosure device!\n",
6420 sas_device->handle = handle;
6491 ioc_info(ioc, "%s: enter: handle(0x%04x), sas_addr(0x%016llx)\n",
6493 sas_device->handle, (u64)sas_device->sas_address));
6502 sas_target_priv_data->handle =
6511 ioc_info(ioc, "removing handle(0x%04x), sas_addr(0x%016llx)\n",
6512 sas_device->handle, (u64)sas_device->sas_address);
6517 ioc_info(ioc, "%s: exit: handle(0x%04x), sas_addr(0x%016llx)\n",
6519 sas_device->handle, (u64)sas_device->sas_address));
6535 u16 handle;
6566 handle = le16_to_cpu(event_data->PHY[i].AttachedDevHandle);
6567 if (!handle)
6596 handle, status_str, link_rate, prev_link_rate);
6602 * _scsih_sas_topology_change_event - handle topology changes
6613 u16 parent_handle, handle;
6642 /* handle expander add */
6662 /* handle siblings events */
6680 handle = le16_to_cpu(event_data->PHY[i].AttachedDevHandle);
6681 if (!handle)
6695 handle, phy_number, link_rate);
6700 _scsih_check_device(ioc, sas_address, handle,
6703 if (!test_bit(handle, ioc->pend_os_device_add))
6714 handle, phy_number, link_rate);
6716 _scsih_add_device(ioc, handle, phy_number, 0);
6721 _scsih_device_remove_by_handle(ioc, handle);
6726 /* handle expander removal */
6801 * _scsih_sas_device_status_change_event - handle device status change
6847 "%s tm_busy flag for handle(0x%04x)\n",
6849 target_priv_data->handle);
6863 * @handle: sas device handle
6870 u16 handle, u8 access_status)
6887 "handle(0x%04x)\n ll only be added to the internal list",
6888 desc, (u64)wwid, handle);
6934 ioc_err(ioc, "NVMe discovery error(0x%02x): wwid(0x%016llx), handle(0x%04x)\n",
6935 access_status, (u64)wwid, handle);
6942 ioc_info(ioc, "NVMe discovery error(%s): wwid(0x%016llx), handle(0x%04x)\n",
6943 desc, (u64)wwid, handle);
6960 ioc_info(ioc, "%s: enter: handle(0x%04x), wwid(0x%016llx)\n",
6962 pcie_device->handle, (u64)pcie_device->wwid));
6980 sas_target_priv_data->handle = MPT3SAS_INVALID_DEVICE_HANDLE;
6983 ioc_info(ioc, "removing handle(0x%04x), wwid(0x%016llx)\n",
6984 pcie_device->handle, (u64)pcie_device->wwid);
6998 ioc_info(ioc, "%s: exit: handle(0x%04x), wwid(0x%016llx)\n",
7000 pcie_device->handle, (u64)pcie_device->wwid));
7021 * @handle: attached device handle
7024 _scsih_pcie_check_device(struct MPT3SAS_ADAPTER *ioc, u16 handle)
7037 &pcie_device_pg0, MPI26_PCIE_DEVICE_PGAD_FORM_HANDLE, handle)))
7058 if (unlikely(pcie_device->handle != handle)) {
7063 "handle changed from(0x%04x) to (0x%04x)!!!\n",
7064 pcie_device->handle, handle);
7065 sas_target_priv_data->handle = handle;
7066 pcie_device->handle = handle;
7083 ioc_info(ioc, "device is not present handle(0x%04x), flags!!!\n",
7084 handle);
7091 if (_scsih_check_pcie_access_status(ioc, wwid, handle,
7109 * @handle: pcie device handle
7116 _scsih_pcie_add_device(struct MPT3SAS_ADAPTER *ioc, u16 handle)
7127 &pcie_device_pg0, MPI26_PCIE_DEVICE_PGAD_FORM_HANDLE, handle))) {
7140 set_bit(handle, ioc->pend_os_device_add);
7146 ioc_err(ioc, "device is not present handle(0x04%x)!!!\n",
7147 handle);
7152 if (_scsih_check_pcie_access_status(ioc, wwid, handle,
7162 clear_bit(handle, ioc->pend_os_device_add);
7175 handle)) {
7202 pcie_device->handle = handle;
7278 u16 handle;
7309 handle =
7311 if (!handle)
7341 handle, status_str, link_rate, prev_link_rate);
7346 * _scsih_pcie_topology_change_event - handle PCIe topology
7358 u16 handle;
7379 /* handle siblings events */
7389 handle =
7391 if (!handle)
7408 _scsih_pcie_check_device(ioc, handle);
7417 pcie_device = __mpt3sas_get_pdev_by_handle(ioc, handle);
7425 if (!test_bit(handle, ioc->pend_os_device_add))
7429 ioc_info(ioc, "handle(0x%04x) device not found: convert event to a device add\n",
7430 handle));
7441 rc = _scsih_pcie_add_device(ioc, handle);
7453 _scsih_pcie_device_remove_by_handle(ioc, handle);
7525 * _scsih_pcie_device_status_change_event - handle device status
7608 * _scsih_sas_enclosure_dev_status_change_event - handle enclosure events
7673 * _scsih_sas_broadcast_primitive_event - handle broadcast events
7685 u16 smid, handle;
7745 handle = sas_device_priv_data->sas_target->handle;
7753 r = mpt3sas_scsih_issue_tm(ioc, handle, 0, 0, lun,
7794 r = mpt3sas_scsih_issue_tm(ioc, handle, sdev->channel, sdev->id,
7838 * _scsih_sas_discovery_event - handle discovery events
7887 ioc_warn(ioc, "SMP command sent to the expander (handle:0x%04x, sas_address:0x%016llx, physical_port:0x%02x) has failed\n",
7893 ioc_warn(ioc, "SMP command sent to the expander (handle:0x%04x, sas_address:0x%016llx, physical_port:0x%02x) has timed out\n",
7904 * _scsih_pcie_enumeration_event - handle enumeration events
7932 * @handle: device handle for physical disk
7938 _scsih_ir_fastpath(struct MPT3SAS_ADAPTER *ioc, u16 handle, u8 phys_disk_num)
7977 ioc_info(ioc, "IR RAID_ACTION: turning fast path on for handle(0x%04x), phys_disk_num (0x%02x)\n",
7978 handle, phys_disk_num));
8048 u16 handle = le16_to_cpu(element->VolDevHandle);
8051 mpt3sas_config_get_volume_wwid(ioc, handle, &wwid);
8074 raid_device->handle = handle;
8092 * @handle: volume device handle
8096 _scsih_sas_volume_delete(struct MPT3SAS_ADAPTER *ioc, u16 handle)
8104 raid_device = mpt3sas_raid_device_find_by_handle(ioc, handle);
8111 ioc_info(ioc, "removing handle(0x%04x), wwid(0x%016llx)\n",
8112 raid_device->handle, (u64)raid_device->wwid);
8135 u16 handle = le16_to_cpu(element->PhysDiskDevHandle);
8138 sas_device = __mpt3sas_get_sdev_by_handle(ioc, handle);
8142 clear_bit(handle, ioc->pd_handles);
8175 u16 handle = le16_to_cpu(element->PhysDiskDevHandle);
8179 mpt3sas_config_get_volume_handle(ioc, handle, &volume_handle);
8185 sas_device = __mpt3sas_get_sdev_by_handle(ioc, handle);
8187 set_bit(handle, ioc->pd_handles);
8202 _scsih_ir_fastpath(ioc, handle, element->PhysDiskNum);
8220 u16 handle = le16_to_cpu(element->PhysDiskDevHandle);
8222 _scsih_device_remove_by_handle(ioc, handle);
8236 u16 handle = le16_to_cpu(element->PhysDiskDevHandle);
8243 set_bit(handle, ioc->pd_handles);
8245 sas_device = mpt3sas_get_sdev_by_handle(ioc, handle);
8247 _scsih_ir_fastpath(ioc, handle, element->PhysDiskNum);
8253 MPI2_SAS_DEVICE_PGAD_FORM_HANDLE, handle))) {
8269 mpt3sas_transport_update_links(ioc, sas_address, handle,
8272 _scsih_ir_fastpath(ioc, handle, element->PhysDiskNum);
8273 _scsih_add_device(ioc, handle, 0, 1);
8346 pr_info("\t(%s:%s), vol handle(0x%04x), " \
8347 "pd handle(0x%04x), pd num(0x%02x)\n", element_str,
8355 * _scsih_sas_ir_config_change_event - handle ir configuration change events
8437 u16 handle;
8449 handle = le16_to_cpu(event_data->VolDevHandle);
8453 ioc_info(ioc, "%s: handle(0x%04x), old(0x%08x), new(0x%08x)\n",
8454 __func__, handle,
8460 _scsih_sas_volume_delete(ioc, handle);
8468 raid_device = mpt3sas_raid_device_find_by_handle(ioc, handle);
8474 mpt3sas_config_get_volume_wwid(ioc, handle, &wwid);
8490 raid_device->handle = handle;
8515 u16 handle, parent_handle;
8531 handle = le16_to_cpu(event_data->PhysDiskDevHandle);
8536 ioc_info(ioc, "%s: handle(0x%04x), old(0x%08x), new(0x%08x)\n",
8537 __func__, handle,
8549 set_bit(handle, ioc->pd_handles);
8551 sas_device = mpt3sas_get_sdev_by_handle(ioc, handle);
8559 handle))) {
8575 mpt3sas_transport_update_links(ioc, sas_address, handle,
8578 _scsih_add_device(ioc, handle, 0, 1);
8630 * _scsih_sas_ir_operation_status_event - handle RAID operation events
8644 u16 handle;
8655 handle = le16_to_cpu(event_data->VolDevHandle);
8656 raid_device = mpt3sas_raid_device_find_by_handle(ioc, handle);
8707 ioc_info(ioc, "Enclosure handle(0x%04x) doesn't match with enclosure device!\n",
8725 "handle(0x%04x), sas_addr(0x%016llx)\n",
8763 if (sas_device->handle == le16_to_cpu(
8767 sas_device->handle);
8768 sas_device->handle = le16_to_cpu(
8771 sas_target_priv_data->handle =
8836 u16 handle;
8844 handle = 0xFFFF;
8847 handle))) {
8852 handle = le16_to_cpu(sas_device_pg0.DevHandle);
8897 "handle(0x%04x), wwid(0x%016llx) ",
8898 pcie_device->handle,
8921 if (pcie_device->handle == le16_to_cpu(
8925 pcie_device->handle);
8926 pcie_device->handle = le16_to_cpu(
8929 sas_target_priv_data->handle =
8952 u16 handle;
8960 handle = 0xFFFF;
8963 handle))) {
8972 handle = le16_to_cpu(pcie_device_pg0.DevHandle);
8986 * @handle: device handle
8993 u16 handle)
9012 "handle(0x%04x), wwid(0x%016llx)\n", handle,
9022 if (raid_device->handle == handle) {
9028 raid_device->handle);
9029 raid_device->handle = handle;
9031 sas_target_priv_data->handle = handle;
9054 u16 handle;
9065 handle = 0xFFFF;
9067 &volume_pg1, MPI2_RAID_VOLUME_PGAD_FORM_GET_NEXT_HANDLE, handle))) {
9072 handle = le16_to_cpu(volume_pg1.DevHandle);
9075 &volume_pg0, MPI2_RAID_VOLUME_PGAD_FORM_HANDLE, handle,
9083 le64_to_cpu(volume_pg1.WWID), handle);
9098 handle = le16_to_cpu(pd_pg0.DevHandle);
9099 set_bit(handle, ioc->pd_handles);
9122 u16 handle = le16_to_cpu(expander_pg0->DevHandle);
9144 if (sas_expander->handle == handle)
9146 pr_info("\texpander(0x%016llx): handle changed" \
9149 sas_expander->handle, handle);
9150 sas_expander->handle = handle;
9152 sas_expander->phy[i].handle = handle;
9173 u16 handle;
9180 handle = 0xFFFF;
9182 MPI2_SAS_EXPAND_PGAD_FORM_GET_NEXT_HNDL, handle))) {
9189 handle = le16_to_cpu(expander_pg0.DevHandle);
9191 pr_info("\texpander present: handle(0x%04x), sas_addr(0x%016llx)\n",
9192 handle,
9268 raid_device->handle);
9299 struct _sas_node *sas_expander, u16 handle)
9307 &expander_pg1, i, handle))) {
9336 u16 handle, parent_handle;
9352 handle = 0xFFFF;
9354 MPI2_SAS_EXPAND_PGAD_FORM_GET_NEXT_HNDL, handle))) {
9362 handle = le16_to_cpu(expander_pg0.DevHandle);
9369 handle);
9371 ioc_info(ioc, "\tBEFORE adding expander: handle (0x%04x), sas_addr(0x%016llx)\n",
9372 handle,
9374 _scsih_expander_add(ioc, handle);
9375 ioc_info(ioc, "\tAFTER adding expander: handle (0x%04x), sas_addr(0x%016llx)\n",
9376 handle,
9401 handle = le16_to_cpu(pd_pg0.DevHandle);
9402 sas_device = mpt3sas_get_sdev_by_handle(ioc, handle);
9409 handle) != 0)
9421 ioc_info(ioc, "\tBEFORE adding phys disk: handle (0x%04x), sas_addr(0x%016llx)\n",
9422 handle,
9425 handle, sas_device_pg0.PhyNum,
9427 set_bit(handle, ioc->pd_handles);
9433 while (_scsih_add_device(ioc, handle, retry_count++,
9437 ioc_info(ioc, "\tAFTER adding phys disk: handle (0x%04x), sas_addr(0x%016llx)\n",
9438 handle,
9448 handle = 0xFFFF;
9450 &volume_pg1, MPI2_RAID_VOLUME_PGAD_FORM_GET_NEXT_HANDLE, handle))) {
9458 handle = le16_to_cpu(volume_pg1.DevHandle);
9466 &volume_pg0, MPI2_RAID_VOLUME_PGAD_FORM_HANDLE, handle,
9482 ioc_info(ioc, "\tBEFORE adding volume: handle (0x%04x)\n",
9485 ioc_info(ioc, "\tAFTER adding volume: handle (0x%04x)\n",
9497 handle = 0xFFFF;
9500 handle))) {
9508 handle = le16_to_cpu(sas_device_pg0.DevHandle);
9520 ioc_info(ioc, "\tBEFORE adding end device: handle (0x%04x), sas_addr(0x%016llx)\n",
9521 handle,
9523 mpt3sas_transport_update_links(ioc, sas_address, handle,
9530 while (_scsih_add_device(ioc, handle, retry_count++,
9534 ioc_info(ioc, "\tAFTER adding end device: handle (0x%04x), sas_addr(0x%016llx)\n",
9535 handle,
9543 handle = 0xFFFF;
9546 handle))) {
9554 handle = le16_to_cpu(pcie_device_pg0.DevHandle);
9566 _scsih_pcie_add_device(ioc, handle);
9568 ioc_info(ioc, "\tAFTER adding pcie end device: handle (0x%04x), wwid(0x%016llx)\n",
9569 handle, (u64)le64_to_cpu(pcie_device_pg0.WWID));
9798 /* handle these */
9969 ioc_info(ioc, "expander_remove: handle(0x%04x), sas_addr(0x%016llx)\n",
9970 sas_expander->handle, (unsigned long long)
10199 ioc_info(ioc, "removing handle(0x%04x), wwid(0x%016llx)\n",
10200 raid_device->handle, (u64)raid_device->wwid);
10298 u16 handle;
10342 handle = sas_device->handle;
10350 if (!mpt3sas_transport_port_add(ioc, handle,
10444 if (!mpt3sas_transport_port_add(ioc, sas_device->handle,