Lines Matching refs:sas_device

71 	struct _sas_device *sas_device);
566 struct _sas_device *sas_device; in _scsih_determine_boot_device() local
595 sas_device = device; in _scsih_determine_boot_device()
596 sas_address = sas_device->sas_address; in _scsih_determine_boot_device()
597 device_name = sas_device->device_name; in _scsih_determine_boot_device()
598 enclosure_logical_id = sas_device->enclosure_logical_id; in _scsih_determine_boot_device()
599 slot = sas_device->slot; in _scsih_determine_boot_device()
729 struct _sas_device *sas_device; in __mpt3sas_get_sdev_by_rphy() local
733 list_for_each_entry(sas_device, &ioc->sas_device_list, list) { in __mpt3sas_get_sdev_by_rphy()
734 if (sas_device->rphy != rphy) in __mpt3sas_get_sdev_by_rphy()
736 sas_device_get(sas_device); in __mpt3sas_get_sdev_by_rphy()
737 return sas_device; in __mpt3sas_get_sdev_by_rphy()
740 sas_device = NULL; in __mpt3sas_get_sdev_by_rphy()
741 list_for_each_entry(sas_device, &ioc->sas_device_init_list, list) { in __mpt3sas_get_sdev_by_rphy()
742 if (sas_device->rphy != rphy) in __mpt3sas_get_sdev_by_rphy()
744 sas_device_get(sas_device); in __mpt3sas_get_sdev_by_rphy()
745 return sas_device; in __mpt3sas_get_sdev_by_rphy()
765 struct _sas_device *sas_device; in __mpt3sas_get_sdev_by_addr() local
772 list_for_each_entry(sas_device, &ioc->sas_device_list, list) { in __mpt3sas_get_sdev_by_addr()
773 if (sas_device->sas_address != sas_address) in __mpt3sas_get_sdev_by_addr()
775 if (sas_device->port != port) in __mpt3sas_get_sdev_by_addr()
777 sas_device_get(sas_device); in __mpt3sas_get_sdev_by_addr()
778 return sas_device; in __mpt3sas_get_sdev_by_addr()
781 list_for_each_entry(sas_device, &ioc->sas_device_init_list, list) { in __mpt3sas_get_sdev_by_addr()
782 if (sas_device->sas_address != sas_address) in __mpt3sas_get_sdev_by_addr()
784 if (sas_device->port != port) in __mpt3sas_get_sdev_by_addr()
786 sas_device_get(sas_device); in __mpt3sas_get_sdev_by_addr()
787 return sas_device; in __mpt3sas_get_sdev_by_addr()
807 struct _sas_device *sas_device; in mpt3sas_get_sdev_by_addr() local
811 sas_device = __mpt3sas_get_sdev_by_addr(ioc, in mpt3sas_get_sdev_by_addr()
815 return sas_device; in mpt3sas_get_sdev_by_addr()
821 struct _sas_device *sas_device; in __mpt3sas_get_sdev_by_handle() local
825 list_for_each_entry(sas_device, &ioc->sas_device_list, list) in __mpt3sas_get_sdev_by_handle()
826 if (sas_device->handle == handle) in __mpt3sas_get_sdev_by_handle()
829 list_for_each_entry(sas_device, &ioc->sas_device_init_list, list) in __mpt3sas_get_sdev_by_handle()
830 if (sas_device->handle == handle) in __mpt3sas_get_sdev_by_handle()
836 sas_device_get(sas_device); in __mpt3sas_get_sdev_by_handle()
837 return sas_device; in __mpt3sas_get_sdev_by_handle()
852 struct _sas_device *sas_device; in mpt3sas_get_sdev_by_handle() local
856 sas_device = __mpt3sas_get_sdev_by_handle(ioc, handle); in mpt3sas_get_sdev_by_handle()
859 return sas_device; in mpt3sas_get_sdev_by_handle()
871 struct _sas_device *sas_device, struct scsi_device *sdev, in _scsih_display_enclosure_chassis_info() argument
875 if (sas_device->enclosure_handle != 0) in _scsih_display_enclosure_chassis_info()
879 sas_device->enclosure_logical_id, in _scsih_display_enclosure_chassis_info()
880 sas_device->slot); in _scsih_display_enclosure_chassis_info()
881 if (sas_device->connector_name[0] != '\0') in _scsih_display_enclosure_chassis_info()
884 sas_device->enclosure_level, in _scsih_display_enclosure_chassis_info()
885 sas_device->connector_name); in _scsih_display_enclosure_chassis_info()
886 if (sas_device->is_chassis_slot_valid) in _scsih_display_enclosure_chassis_info()
888 sas_device->chassis_slot); in _scsih_display_enclosure_chassis_info()
890 if (sas_device->enclosure_handle != 0) in _scsih_display_enclosure_chassis_info()
894 sas_device->enclosure_logical_id, in _scsih_display_enclosure_chassis_info()
895 sas_device->slot); in _scsih_display_enclosure_chassis_info()
896 if (sas_device->connector_name[0] != '\0') in _scsih_display_enclosure_chassis_info()
899 sas_device->enclosure_level, in _scsih_display_enclosure_chassis_info()
900 sas_device->connector_name); in _scsih_display_enclosure_chassis_info()
901 if (sas_device->is_chassis_slot_valid) in _scsih_display_enclosure_chassis_info()
904 sas_device->chassis_slot); in _scsih_display_enclosure_chassis_info()
906 if (sas_device->enclosure_handle != 0) in _scsih_display_enclosure_chassis_info()
908 (u64)sas_device->enclosure_logical_id, in _scsih_display_enclosure_chassis_info()
909 sas_device->slot); in _scsih_display_enclosure_chassis_info()
910 if (sas_device->connector_name[0] != '\0') in _scsih_display_enclosure_chassis_info()
912 sas_device->enclosure_level, in _scsih_display_enclosure_chassis_info()
913 sas_device->connector_name); in _scsih_display_enclosure_chassis_info()
914 if (sas_device->is_chassis_slot_valid) in _scsih_display_enclosure_chassis_info()
916 sas_device->chassis_slot); in _scsih_display_enclosure_chassis_info()
930 struct _sas_device *sas_device) in _scsih_sas_device_remove() argument
934 if (!sas_device) in _scsih_sas_device_remove()
937 sas_device->handle, (u64)sas_device->sas_address); in _scsih_sas_device_remove()
939 _scsih_display_enclosure_chassis_info(ioc, sas_device, NULL, NULL); in _scsih_sas_device_remove()
946 if (!list_empty(&sas_device->list)) { in _scsih_sas_device_remove()
947 list_del_init(&sas_device->list); in _scsih_sas_device_remove()
948 sas_device_put(sas_device); in _scsih_sas_device_remove()
961 struct _sas_device *sas_device; in _scsih_device_remove_by_handle() local
968 sas_device = __mpt3sas_get_sdev_by_handle(ioc, handle); in _scsih_device_remove_by_handle()
969 if (sas_device) { in _scsih_device_remove_by_handle()
970 list_del_init(&sas_device->list); in _scsih_device_remove_by_handle()
971 sas_device_put(sas_device); in _scsih_device_remove_by_handle()
974 if (sas_device) { in _scsih_device_remove_by_handle()
975 _scsih_remove_device(ioc, sas_device); in _scsih_device_remove_by_handle()
976 sas_device_put(sas_device); in _scsih_device_remove_by_handle()
993 struct _sas_device *sas_device; in mpt3sas_device_remove_by_sas_address() local
1000 sas_device = __mpt3sas_get_sdev_by_addr(ioc, sas_address, port); in mpt3sas_device_remove_by_sas_address()
1001 if (sas_device) { in mpt3sas_device_remove_by_sas_address()
1002 list_del_init(&sas_device->list); in mpt3sas_device_remove_by_sas_address()
1003 sas_device_put(sas_device); in mpt3sas_device_remove_by_sas_address()
1006 if (sas_device) { in mpt3sas_device_remove_by_sas_address()
1007 _scsih_remove_device(ioc, sas_device); in mpt3sas_device_remove_by_sas_address()
1008 sas_device_put(sas_device); in mpt3sas_device_remove_by_sas_address()
1022 struct _sas_device *sas_device) in _scsih_sas_device_add() argument
1028 __func__, sas_device->handle, in _scsih_sas_device_add()
1029 (u64)sas_device->sas_address)); in _scsih_sas_device_add()
1031 dewtprintk(ioc, _scsih_display_enclosure_chassis_info(ioc, sas_device, in _scsih_sas_device_add()
1035 sas_device_get(sas_device); in _scsih_sas_device_add()
1036 list_add_tail(&sas_device->list, &ioc->sas_device_list); in _scsih_sas_device_add()
1040 clear_bit(sas_device->handle, ioc->pend_os_device_add); in _scsih_sas_device_add()
1044 if (!mpt3sas_transport_port_add(ioc, sas_device->handle, in _scsih_sas_device_add()
1045 sas_device->sas_address_parent, sas_device->port)) { in _scsih_sas_device_add()
1046 _scsih_sas_device_remove(ioc, sas_device); in _scsih_sas_device_add()
1047 } else if (!sas_device->starget) { in _scsih_sas_device_add()
1055 sas_device->sas_address, in _scsih_sas_device_add()
1056 sas_device->sas_address_parent, in _scsih_sas_device_add()
1057 sas_device->port); in _scsih_sas_device_add()
1058 _scsih_sas_device_remove(ioc, sas_device); in _scsih_sas_device_add()
1061 clear_bit(sas_device->handle, ioc->pend_os_device_add); in _scsih_sas_device_add()
1074 struct _sas_device *sas_device) in _scsih_sas_device_init_add() argument
1080 __func__, sas_device->handle, in _scsih_sas_device_init_add()
1081 (u64)sas_device->sas_address)); in _scsih_sas_device_init_add()
1083 dewtprintk(ioc, _scsih_display_enclosure_chassis_info(ioc, sas_device, in _scsih_sas_device_init_add()
1087 sas_device_get(sas_device); in _scsih_sas_device_init_add()
1088 list_add_tail(&sas_device->list, &ioc->sas_device_init_list); in _scsih_sas_device_init_add()
1089 _scsih_determine_boot_device(ioc, sas_device, 0); in _scsih_sas_device_init_add()
1796 struct _sas_device *sas_device; in scsih_change_queue_depth() local
1818 sas_device = __mpt3sas_get_sdev_from_target(ioc, sas_target_priv_data); in scsih_change_queue_depth()
1819 if (sas_device) { in scsih_change_queue_depth()
1820 if (sas_device->device_info & MPI2_SAS_DEVICE_INFO_SATA_DEVICE) in scsih_change_queue_depth()
1823 sas_device_put(sas_device); in scsih_change_queue_depth()
1873 struct _sas_device *sas_device; in scsih_target_alloc() local
1931 sas_device = __mpt3sas_get_sdev_by_rphy(ioc, rphy); in scsih_target_alloc()
1933 if (sas_device) { in scsih_target_alloc()
1934 sas_target_priv_data->handle = sas_device->handle; in scsih_target_alloc()
1935 sas_target_priv_data->sas_address = sas_device->sas_address; in scsih_target_alloc()
1936 sas_target_priv_data->port = sas_device->port; in scsih_target_alloc()
1937 sas_target_priv_data->sas_dev = sas_device; in scsih_target_alloc()
1938 sas_device->starget = starget; in scsih_target_alloc()
1939 sas_device->id = starget->id; in scsih_target_alloc()
1940 sas_device->channel = starget->channel; in scsih_target_alloc()
1941 if (test_bit(sas_device->handle, ioc->pd_handles)) in scsih_target_alloc()
1944 if (sas_device->fast_path) in scsih_target_alloc()
1963 struct _sas_device *sas_device; in scsih_target_destroy() local
2006 sas_device = __mpt3sas_get_sdev_from_target(ioc, sas_target_priv_data); in scsih_target_destroy()
2007 if (sas_device && (sas_device->starget == starget) && in scsih_target_destroy()
2008 (sas_device->id == starget->id) && in scsih_target_destroy()
2009 (sas_device->channel == starget->channel)) in scsih_target_destroy()
2010 sas_device->starget = NULL; in scsih_target_destroy()
2012 if (sas_device) { in scsih_target_destroy()
2017 sas_device_put(sas_device); in scsih_target_destroy()
2019 sas_device_put(sas_device); in scsih_target_destroy()
2044 struct _sas_device *sas_device; in scsih_slave_alloc() local
2091 sas_device = __mpt3sas_get_sdev_by_addr(ioc, in scsih_slave_alloc()
2094 if (sas_device && (sas_device->starget == NULL)) { in scsih_slave_alloc()
2098 sas_device->starget = starget; in scsih_slave_alloc()
2101 if (sas_device) in scsih_slave_alloc()
2102 sas_device_put(sas_device); in scsih_slave_alloc()
2121 struct _sas_device *sas_device; in scsih_slave_destroy() local
2149 sas_device = __mpt3sas_get_sdev_from_target(ioc, in scsih_slave_destroy()
2151 if (sas_device && !sas_target_priv_data->num_luns) in scsih_slave_destroy()
2152 sas_device->starget = NULL; in scsih_slave_destroy()
2154 if (sas_device) in scsih_slave_destroy()
2155 sas_device_put(sas_device); in scsih_slave_destroy()
2514 struct _sas_device *sas_device; in scsih_slave_configure() local
2697 sas_device = __mpt3sas_get_sdev_by_addr(ioc, in scsih_slave_configure()
2700 if (!sas_device) { in scsih_slave_configure()
2708 sas_device->volume_handle = volume_handle; in scsih_slave_configure()
2709 sas_device->volume_wwid = volume_wwid; in scsih_slave_configure()
2710 if (sas_device->device_info & MPI2_SAS_DEVICE_INFO_SSP_TARGET) { in scsih_slave_configure()
2711 qdepth = (sas_device->port_type > 1) ? in scsih_slave_configure()
2714 if (sas_device->device_info & in scsih_slave_configure()
2725 if (sas_device->device_info & MPI2_SAS_DEVICE_INFO_STP_TARGET) in scsih_slave_configure()
2727 else if (sas_device->device_info & in scsih_slave_configure()
2734 ds, handle, (unsigned long long)sas_device->sas_address, in scsih_slave_configure()
2735 sas_device->phy, (unsigned long long)sas_device->device_name); in scsih_slave_configure()
2737 _scsih_display_enclosure_chassis_info(NULL, sas_device, sdev, NULL); in scsih_slave_configure()
2739 sas_device_put(sas_device); in scsih_slave_configure()
3217 struct _sas_device *sas_device = NULL; in _scsih_tm_display_info() local
3262 sas_device = __mpt3sas_get_sdev_from_target(ioc, priv_target); in _scsih_tm_display_info()
3263 if (sas_device) { in _scsih_tm_display_info()
3269 sas_device->volume_handle, in _scsih_tm_display_info()
3270 (unsigned long long)sas_device->volume_wwid); in _scsih_tm_display_info()
3274 sas_device->handle, in _scsih_tm_display_info()
3275 (unsigned long long)sas_device->sas_address, in _scsih_tm_display_info()
3276 sas_device->phy); in _scsih_tm_display_info()
3278 _scsih_display_enclosure_chassis_info(NULL, sas_device, in _scsih_tm_display_info()
3281 sas_device_put(sas_device); in _scsih_tm_display_info()
3372 struct _sas_device *sas_device = NULL; in scsih_dev_reset() local
3401 sas_device = mpt3sas_get_sdev_from_target(ioc, in scsih_dev_reset()
3403 if (sas_device) in scsih_dev_reset()
3404 handle = sas_device->volume_handle; in scsih_dev_reset()
3434 if (sas_device) in scsih_dev_reset()
3435 sas_device_put(sas_device); in scsih_dev_reset()
3453 struct _sas_device *sas_device = NULL; in scsih_target_reset() local
3481 sas_device = mpt3sas_get_sdev_from_target(ioc, in scsih_target_reset()
3483 if (sas_device) in scsih_target_reset()
3484 handle = sas_device->volume_handle; in scsih_target_reset()
3513 if (sas_device) in scsih_target_reset()
3514 sas_device_put(sas_device); in scsih_target_reset()
3924 struct _sas_device *sas_device; in _scsih_block_io_device() local
3926 sas_device = mpt3sas_get_sdev_by_handle(ioc, handle); in _scsih_block_io_device()
3936 if (sas_device && sas_device->pend_sas_rphy_add) in _scsih_block_io_device()
3947 if (sas_device) in _scsih_block_io_device()
3948 sas_device_put(sas_device); in _scsih_block_io_device()
3965 struct _sas_device *sas_device; in _scsih_block_io_to_children_attached_to_ex() local
3977 sas_device = __mpt3sas_get_sdev_by_addr(ioc, in _scsih_block_io_to_children_attached_to_ex()
3980 if (sas_device) { in _scsih_block_io_to_children_attached_to_ex()
3981 set_bit(sas_device->handle, in _scsih_block_io_to_children_attached_to_ex()
3983 sas_device_put(sas_device); in _scsih_block_io_to_children_attached_to_ex()
4080 struct _sas_device *sas_device = NULL; in _scsih_tm_tr_send() local
4111 sas_device = __mpt3sas_get_sdev_by_handle(ioc, handle); in _scsih_tm_tr_send()
4112 if (sas_device && sas_device->starget && in _scsih_tm_tr_send()
4113 sas_device->starget->hostdata) { in _scsih_tm_tr_send()
4114 sas_target_priv_data = sas_device->starget->hostdata; in _scsih_tm_tr_send()
4116 sas_address = sas_device->sas_address; in _scsih_tm_tr_send()
4117 port = sas_device->port; in _scsih_tm_tr_send()
4120 if (!sas_device) { in _scsih_tm_tr_send()
4142 if (sas_device) { in _scsih_tm_tr_send()
4143 if (sas_device->enclosure_handle != 0) in _scsih_tm_tr_send()
4146 (u64)sas_device->enclosure_logical_id, in _scsih_tm_tr_send()
4147 sas_device->slot)); in _scsih_tm_tr_send()
4148 if (sas_device->connector_name[0] != '\0') in _scsih_tm_tr_send()
4151 sas_device->enclosure_level, in _scsih_tm_tr_send()
4152 sas_device->connector_name)); in _scsih_tm_tr_send()
4197 if (sas_device) in _scsih_tm_tr_send()
4198 sas_device_put(sas_device); in _scsih_tm_tr_send()
5333 struct _sas_device *sas_device = NULL; in _scsih_scsi_ioc_info() local
5483 sas_device = mpt3sas_get_sdev_from_target(ioc, priv_target); in _scsih_scsi_ioc_info()
5484 if (sas_device) { in _scsih_scsi_ioc_info()
5486 (u64)sas_device->sas_address, sas_device->phy); in _scsih_scsi_ioc_info()
5488 _scsih_display_enclosure_chassis_info(ioc, sas_device, in _scsih_scsi_ioc_info()
5491 sas_device_put(sas_device); in _scsih_scsi_ioc_info()
5531 struct _sas_device *sas_device; in _scsih_turn_on_pfa_led() local
5533 sas_device = mpt3sas_get_sdev_by_handle(ioc, handle); in _scsih_turn_on_pfa_led()
5534 if (!sas_device) in _scsih_turn_on_pfa_led()
5550 sas_device->pfa_led_on = 1; in _scsih_turn_on_pfa_led()
5560 sas_device_put(sas_device); in _scsih_turn_on_pfa_led()
5571 struct _sas_device *sas_device) in _scsih_turn_off_pfa_led() argument
5580 mpi_request.Slot = cpu_to_le16(sas_device->slot); in _scsih_turn_off_pfa_led()
5582 mpi_request.EnclosureHandle = cpu_to_le16(sas_device->enclosure_handle); in _scsih_turn_off_pfa_led()
5634 struct _sas_device *sas_device; in _scsih_smart_predicted_fault() local
5640 sas_device = __mpt3sas_get_sdev_by_handle(ioc, handle); in _scsih_smart_predicted_fault()
5641 if (!sas_device) in _scsih_smart_predicted_fault()
5644 starget = sas_device->starget; in _scsih_smart_predicted_fault()
5651 _scsih_display_enclosure_chassis_info(NULL, sas_device, NULL, starget); in _scsih_smart_predicted_fault()
5683 if (sas_device) in _scsih_smart_predicted_fault()
5684 sas_device_put(sas_device); in _scsih_smart_predicted_fault()
5951 struct _sas_device *sas_device; in _scsih_update_vphys_after_reset() local
6095 sas_device = mpt3sas_get_sdev_by_addr( in _scsih_update_vphys_after_reset()
6097 if (sas_device) in _scsih_update_vphys_after_reset()
6098 sas_device->port = mport; in _scsih_update_vphys_after_reset()
7190 struct _sas_device *sas_device = NULL; in _scsih_check_device() local
7224 sas_device = __mpt3sas_get_sdev_by_addr(ioc, in _scsih_check_device()
7227 if (!sas_device) in _scsih_check_device()
7230 if (unlikely(sas_device->handle != handle)) { in _scsih_check_device()
7231 starget = sas_device->starget; in _scsih_check_device()
7235 sas_device->handle, handle); in _scsih_check_device()
7237 sas_device->handle = handle; in _scsih_check_device()
7240 sas_device->enclosure_level = in _scsih_check_device()
7242 memcpy(sas_device->connector_name, in _scsih_check_device()
7244 sas_device->connector_name[4] = '\0'; in _scsih_check_device()
7246 sas_device->enclosure_level = 0; in _scsih_check_device()
7247 sas_device->connector_name[0] = '\0'; in _scsih_check_device()
7250 sas_device->enclosure_handle = in _scsih_check_device()
7252 sas_device->is_chassis_slot_valid = 0; in _scsih_check_device()
7254 sas_device->enclosure_handle); in _scsih_check_device()
7256 sas_device->enclosure_logical_id = in _scsih_check_device()
7260 sas_device->is_chassis_slot_valid = 1; in _scsih_check_device()
7261 sas_device->chassis_slot = in _scsih_check_device()
7283 if (sas_device) in _scsih_check_device()
7284 sas_device_put(sas_device); in _scsih_check_device()
7289 if (sas_device) in _scsih_check_device()
7290 sas_device_put(sas_device); in _scsih_check_device()
7310 struct _sas_device *sas_device; in _scsih_add_device() local
7353 sas_device = mpt3sas_get_sdev_by_addr(ioc, in _scsih_add_device()
7355 if (sas_device) { in _scsih_add_device()
7357 sas_device_put(sas_device); in _scsih_add_device()
7370 sas_device = kzalloc(sizeof(struct _sas_device), in _scsih_add_device()
7372 if (!sas_device) { in _scsih_add_device()
7378 kref_init(&sas_device->refcount); in _scsih_add_device()
7379 sas_device->handle = handle; in _scsih_add_device()
7382 &sas_device->sas_address_parent) != 0) in _scsih_add_device()
7385 sas_device->enclosure_handle = in _scsih_add_device()
7387 if (sas_device->enclosure_handle != 0) in _scsih_add_device()
7388 sas_device->slot = in _scsih_add_device()
7390 sas_device->device_info = device_info; in _scsih_add_device()
7391 sas_device->sas_address = sas_address; in _scsih_add_device()
7392 sas_device->phy = sas_device_pg0.PhyNum; in _scsih_add_device()
7393 sas_device->fast_path = (le16_to_cpu(sas_device_pg0.Flags) & in _scsih_add_device()
7395 sas_device->port = mpt3sas_get_port_by_id(ioc, port_id, 0); in _scsih_add_device()
7396 if (!sas_device->port) { in _scsih_add_device()
7404 sas_device->enclosure_level = in _scsih_add_device()
7406 memcpy(sas_device->connector_name, in _scsih_add_device()
7408 sas_device->connector_name[4] = '\0'; in _scsih_add_device()
7410 sas_device->enclosure_level = 0; in _scsih_add_device()
7411 sas_device->connector_name[0] = '\0'; in _scsih_add_device()
7414 sas_device->is_chassis_slot_valid = 0; in _scsih_add_device()
7416 sas_device->enclosure_logical_id = in _scsih_add_device()
7420 sas_device->is_chassis_slot_valid = 1; in _scsih_add_device()
7421 sas_device->chassis_slot = in _scsih_add_device()
7427 sas_device->device_name = le64_to_cpu(sas_device_pg0.DeviceName); in _scsih_add_device()
7428 sas_device->port_type = sas_device_pg0.MaxPortConnections; in _scsih_add_device()
7431 handle, sas_device->sas_address, sas_device->port_type); in _scsih_add_device()
7434 _scsih_sas_device_init_add(ioc, sas_device); in _scsih_add_device()
7436 _scsih_sas_device_add(ioc, sas_device); in _scsih_add_device()
7439 sas_device_put(sas_device); in _scsih_add_device()
7450 struct _sas_device *sas_device) in _scsih_remove_device() argument
7455 (sas_device->pfa_led_on)) { in _scsih_remove_device()
7456 _scsih_turn_off_pfa_led(ioc, sas_device); in _scsih_remove_device()
7457 sas_device->pfa_led_on = 0; in _scsih_remove_device()
7463 sas_device->handle, (u64)sas_device->sas_address)); in _scsih_remove_device()
7465 dewtprintk(ioc, _scsih_display_enclosure_chassis_info(ioc, sas_device, in _scsih_remove_device()
7468 if (sas_device->starget && sas_device->starget->hostdata) { in _scsih_remove_device()
7469 sas_target_priv_data = sas_device->starget->hostdata; in _scsih_remove_device()
7471 _scsih_ublock_io_device(ioc, sas_device->sas_address, in _scsih_remove_device()
7472 sas_device->port); in _scsih_remove_device()
7479 sas_device->sas_address, in _scsih_remove_device()
7480 sas_device->sas_address_parent, in _scsih_remove_device()
7481 sas_device->port); in _scsih_remove_device()
7484 sas_device->handle, (u64)sas_device->sas_address); in _scsih_remove_device()
7486 _scsih_display_enclosure_chassis_info(ioc, sas_device, NULL, NULL); in _scsih_remove_device()
7491 sas_device->handle, (u64)sas_device->sas_address)); in _scsih_remove_device()
7492 dewtprintk(ioc, _scsih_display_enclosure_chassis_info(ioc, sas_device, in _scsih_remove_device()
7786 struct _sas_device *sas_device; in _scsih_sas_device_status_change_event() local
7804 sas_device = __mpt3sas_get_sdev_by_addr(ioc, in _scsih_sas_device_status_change_event()
7808 if (!sas_device || !sas_device->starget) in _scsih_sas_device_status_change_event()
7811 target_priv_data = sas_device->starget->hostdata; in _scsih_sas_device_status_change_event()
7828 if (sas_device) in _scsih_sas_device_status_change_event()
7829 sas_device_put(sas_device); in _scsih_sas_device_status_change_event()
9107 struct _sas_device *sas_device; in _scsih_sas_pd_expose() local
9114 sas_device = __mpt3sas_get_sdev_by_handle(ioc, handle); in _scsih_sas_pd_expose()
9115 if (sas_device) { in _scsih_sas_pd_expose()
9116 sas_device->volume_handle = 0; in _scsih_sas_pd_expose()
9117 sas_device->volume_wwid = 0; in _scsih_sas_pd_expose()
9119 if (sas_device->starget && sas_device->starget->hostdata) { in _scsih_sas_pd_expose()
9120 starget = sas_device->starget; in _scsih_sas_pd_expose()
9127 if (!sas_device) in _scsih_sas_pd_expose()
9134 sas_device_put(sas_device); in _scsih_sas_pd_expose()
9147 struct _sas_device *sas_device; in _scsih_sas_pd_hide() local
9161 sas_device = __mpt3sas_get_sdev_by_handle(ioc, handle); in _scsih_sas_pd_hide()
9162 if (sas_device) { in _scsih_sas_pd_hide()
9164 if (sas_device->starget && sas_device->starget->hostdata) { in _scsih_sas_pd_hide()
9165 starget = sas_device->starget; in _scsih_sas_pd_hide()
9169 sas_device->volume_handle = volume_handle; in _scsih_sas_pd_hide()
9170 sas_device->volume_wwid = volume_wwid; in _scsih_sas_pd_hide()
9174 if (!sas_device) in _scsih_sas_pd_hide()
9183 sas_device_put(sas_device); in _scsih_sas_pd_hide()
9211 struct _sas_device *sas_device; in _scsih_sas_pd_add() local
9221 sas_device = mpt3sas_get_sdev_by_handle(ioc, handle); in _scsih_sas_pd_add()
9222 if (sas_device) { in _scsih_sas_pd_add()
9224 sas_device_put(sas_device); in _scsih_sas_pd_add()
9495 struct _sas_device *sas_device; in _scsih_sas_ir_physical_disk_event() local
9529 sas_device = mpt3sas_get_sdev_by_handle(ioc, handle); in _scsih_sas_ir_physical_disk_event()
9530 if (sas_device) { in _scsih_sas_ir_physical_disk_event()
9531 sas_device_put(sas_device); in _scsih_sas_ir_physical_disk_event()
9674 struct _sas_device *sas_device; in _scsih_update_device_qdepth() local
9683 sas_device = sas_device_priv_data->sas_target->sas_dev; in _scsih_update_device_qdepth()
9686 else if (sas_device && in _scsih_update_device_qdepth()
9687 sas_device->device_info & MPI2_SAS_DEVICE_INFO_SSP_TARGET) in _scsih_update_device_qdepth()
9688 qdepth = (sas_device->port_type > 1) ? in _scsih_update_device_qdepth()
9690 else if (sas_device && in _scsih_update_device_qdepth()
9691 sas_device->device_info & MPI2_SAS_DEVICE_INFO_SATA_DEVICE) in _scsih_update_device_qdepth()
9714 struct _sas_device *sas_device = NULL; in _scsih_mark_responding_sas_device() local
9729 list_for_each_entry(sas_device, &ioc->sas_device_list, list) { in _scsih_mark_responding_sas_device()
9730 if (sas_device->sas_address != le64_to_cpu( in _scsih_mark_responding_sas_device()
9733 if (sas_device->slot != le16_to_cpu(sas_device_pg0->Slot)) in _scsih_mark_responding_sas_device()
9735 if (sas_device->port != port) in _scsih_mark_responding_sas_device()
9737 sas_device->responding = 1; in _scsih_mark_responding_sas_device()
9738 starget = sas_device->starget; in _scsih_mark_responding_sas_device()
9750 sas_device->sas_address); in _scsih_mark_responding_sas_device()
9752 if (sas_device->enclosure_handle != 0) in _scsih_mark_responding_sas_device()
9756 sas_device->enclosure_logical_id, in _scsih_mark_responding_sas_device()
9757 sas_device->slot); in _scsih_mark_responding_sas_device()
9761 sas_device->enclosure_level = in _scsih_mark_responding_sas_device()
9763 memcpy(&sas_device->connector_name[0], in _scsih_mark_responding_sas_device()
9766 sas_device->enclosure_level = 0; in _scsih_mark_responding_sas_device()
9767 sas_device->connector_name[0] = '\0'; in _scsih_mark_responding_sas_device()
9770 sas_device->enclosure_handle = in _scsih_mark_responding_sas_device()
9772 sas_device->is_chassis_slot_valid = 0; in _scsih_mark_responding_sas_device()
9774 sas_device->enclosure_logical_id = le64_to_cpu( in _scsih_mark_responding_sas_device()
9778 sas_device->is_chassis_slot_valid = 1; in _scsih_mark_responding_sas_device()
9779 sas_device->chassis_slot = in _scsih_mark_responding_sas_device()
9784 if (sas_device->handle == le16_to_cpu( in _scsih_mark_responding_sas_device()
9788 sas_device->handle); in _scsih_mark_responding_sas_device()
9789 sas_device->handle = le16_to_cpu( in _scsih_mark_responding_sas_device()
10236 struct _sas_device *sas_device, *sas_device_next; in _scsih_remove_unresponding_devices() local
10258 list_for_each_entry_safe(sas_device, sas_device_next, in _scsih_remove_unresponding_devices()
10260 list_del_init(&sas_device->list); in _scsih_remove_unresponding_devices()
10261 sas_device_put(sas_device); in _scsih_remove_unresponding_devices()
10264 list_for_each_entry_safe(sas_device, sas_device_next, in _scsih_remove_unresponding_devices()
10266 if (!sas_device->responding) in _scsih_remove_unresponding_devices()
10267 list_move_tail(&sas_device->list, &head); in _scsih_remove_unresponding_devices()
10269 sas_device->responding = 0; in _scsih_remove_unresponding_devices()
10276 list_for_each_entry_safe(sas_device, sas_device_next, &head, list) { in _scsih_remove_unresponding_devices()
10277 _scsih_remove_device(ioc, sas_device); in _scsih_remove_unresponding_devices()
10278 list_del_init(&sas_device->list); in _scsih_remove_unresponding_devices()
10279 sas_device_put(sas_device); in _scsih_remove_unresponding_devices()
10388 struct _sas_device *sas_device; in _scsih_scan_for_devices_after_reset() local
10464 sas_device = mpt3sas_get_sdev_by_handle(ioc, handle); in _scsih_scan_for_devices_after_reset()
10465 if (sas_device) { in _scsih_scan_for_devices_after_reset()
10466 sas_device_put(sas_device); in _scsih_scan_for_devices_after_reset()
10577 sas_device = mpt3sas_get_sdev_by_addr(ioc, in _scsih_scan_for_devices_after_reset()
10580 if (sas_device) { in _scsih_scan_for_devices_after_reset()
10581 sas_device_put(sas_device); in _scsih_scan_for_devices_after_reset()
11423 struct _sas_device *sas_device; in _scsih_probe_boot_devices() local
11483 sas_device = device; in _scsih_probe_boot_devices()
11489 if (sas_device->starget) in _scsih_probe_boot_devices()
11492 handle = sas_device->handle; in _scsih_probe_boot_devices()
11493 sas_address_parent = sas_device->sas_address_parent; in _scsih_probe_boot_devices()
11494 sas_address = sas_device->sas_address; in _scsih_probe_boot_devices()
11495 port = sas_device->port; in _scsih_probe_boot_devices()
11496 list_move_tail(&sas_device->list, &ioc->sas_device_list); in _scsih_probe_boot_devices()
11507 _scsih_sas_device_remove(ioc, sas_device); in _scsih_probe_boot_devices()
11508 } else if (!sas_device->starget) { in _scsih_probe_boot_devices()
11513 _scsih_sas_device_remove(ioc, sas_device); in _scsih_probe_boot_devices()
11544 struct _sas_device *sas_device = NULL; in get_next_sas_device() local
11549 sas_device = list_first_entry(&ioc->sas_device_init_list, in get_next_sas_device()
11551 sas_device_get(sas_device); in get_next_sas_device()
11555 return sas_device; in get_next_sas_device()
11559 struct _sas_device *sas_device) in sas_device_make_active() argument
11573 if (!list_empty(&sas_device->list)) { in sas_device_make_active()
11574 list_del_init(&sas_device->list); in sas_device_make_active()
11575 sas_device_put(sas_device); in sas_device_make_active()
11578 sas_device_get(sas_device); in sas_device_make_active()
11579 list_add_tail(&sas_device->list, &ioc->sas_device_list); in sas_device_make_active()
11593 struct _sas_device *sas_device; in _scsih_probe_sas() local
11598 while ((sas_device = get_next_sas_device(ioc))) { in _scsih_probe_sas()
11599 if (!mpt3sas_transport_port_add(ioc, sas_device->handle, in _scsih_probe_sas()
11600 sas_device->sas_address_parent, sas_device->port)) { in _scsih_probe_sas()
11601 _scsih_sas_device_remove(ioc, sas_device); in _scsih_probe_sas()
11602 sas_device_put(sas_device); in _scsih_probe_sas()
11604 } else if (!sas_device->starget) { in _scsih_probe_sas()
11613 sas_device->sas_address, in _scsih_probe_sas()
11614 sas_device->sas_address_parent, in _scsih_probe_sas()
11615 sas_device->port); in _scsih_probe_sas()
11616 _scsih_sas_device_remove(ioc, sas_device); in _scsih_probe_sas()
11617 sas_device_put(sas_device); in _scsih_probe_sas()
11621 sas_device_make_active(ioc, sas_device); in _scsih_probe_sas()
11622 sas_device_put(sas_device); in _scsih_probe_sas()