Lines Matching refs:sdev
173 struct scsi_device *sdev = to_scsi_device(device); in ata_scsi_park_show() local
181 ap = ata_shost_to_port(sdev->host); in ata_scsi_park_show()
184 dev = ata_scsi_find_dev(ap, sdev); in ata_scsi_park_show()
213 struct scsi_device *sdev = to_scsi_device(device); in ata_scsi_park_store() local
230 ap = ata_shost_to_port(sdev->host); in ata_scsi_park_store()
233 dev = ata_scsi_find_dev(ap, sdev); in ata_scsi_park_store()
323 struct scsi_device *sdev = to_scsi_device(dev); in ata_scsi_activity_show() local
324 struct ata_port *ap = ata_shost_to_port(sdev->host); in ata_scsi_activity_show()
325 struct ata_device *atadev = ata_scsi_find_dev(ap, sdev); in ata_scsi_activity_show()
337 struct scsi_device *sdev = to_scsi_device(dev); in ata_scsi_activity_store() local
338 struct ata_port *ap = ata_shost_to_port(sdev->host); in ata_scsi_activity_store()
339 struct ata_device *atadev = ata_scsi_find_dev(ap, sdev); in ata_scsi_activity_store()
392 int ata_std_bios_param(struct scsi_device *sdev, struct block_device *bdev, in ata_std_bios_param() argument
413 void ata_scsi_unlock_native_capacity(struct scsi_device *sdev) in ata_scsi_unlock_native_capacity() argument
415 struct ata_port *ap = ata_shost_to_port(sdev->host); in ata_scsi_unlock_native_capacity()
421 dev = ata_scsi_find_dev(ap, sdev); in ata_scsi_unlock_native_capacity()
444 static int ata_get_identity(struct ata_port *ap, struct scsi_device *sdev, in ata_get_identity() argument
447 struct ata_device *dev = ata_scsi_find_dev(ap, sdev); in ata_get_identity()
1092 static void ata_scsi_sdev_config(struct scsi_device *sdev) in ata_scsi_sdev_config() argument
1094 sdev->use_10_for_rw = 1; in ata_scsi_sdev_config()
1095 sdev->use_10_for_ms = 1; in ata_scsi_sdev_config()
1096 sdev->no_report_opcodes = 1; in ata_scsi_sdev_config()
1097 sdev->no_write_same = 1; in ata_scsi_sdev_config()
1104 sdev->max_device_blocked = 1; in ata_scsi_sdev_config()
1133 static int ata_scsi_dev_config(struct scsi_device *sdev, in ata_scsi_dev_config() argument
1136 struct request_queue *q = sdev->request_queue; in ata_scsi_dev_config()
1147 sdev->sector_size = ATA_SECT_SIZE; in ata_scsi_dev_config()
1161 sdev->sector_size = ata_id_logical_sector_size(dev->id); in ata_scsi_dev_config()
1162 sdev->manage_start_stop = 1; in ata_scsi_dev_config()
1172 if (sdev->sector_size > PAGE_SIZE) in ata_scsi_dev_config()
1175 sdev->sector_size); in ata_scsi_dev_config()
1177 blk_queue_update_dma_alignment(q, sdev->sector_size - 1); in ata_scsi_dev_config()
1180 set_bit(SDEV_EVT_MEDIA_CHANGE, sdev->supported_events); in ata_scsi_dev_config()
1185 depth = min(sdev->host->can_queue, ata_id_queue_depth(dev->id)); in ata_scsi_dev_config()
1187 scsi_change_queue_depth(sdev, depth); in ata_scsi_dev_config()
1192 dev->sdev = sdev; in ata_scsi_dev_config()
1208 int ata_scsi_slave_config(struct scsi_device *sdev) in ata_scsi_slave_config() argument
1210 struct ata_port *ap = ata_shost_to_port(sdev->host); in ata_scsi_slave_config()
1211 struct ata_device *dev = __ata_scsi_find_dev(ap, sdev); in ata_scsi_slave_config()
1214 ata_scsi_sdev_config(sdev); in ata_scsi_slave_config()
1217 rc = ata_scsi_dev_config(sdev, dev); in ata_scsi_slave_config()
1236 void ata_scsi_slave_destroy(struct scsi_device *sdev) in ata_scsi_slave_destroy() argument
1238 struct ata_port *ap = ata_shost_to_port(sdev->host); in ata_scsi_slave_destroy()
1239 struct request_queue *q = sdev->request_queue; in ata_scsi_slave_destroy()
1247 dev = __ata_scsi_find_dev(ap, sdev); in ata_scsi_slave_destroy()
1248 if (dev && dev->sdev) { in ata_scsi_slave_destroy()
1250 dev->sdev = NULL; in ata_scsi_slave_destroy()
1271 int __ata_change_queue_depth(struct ata_port *ap, struct scsi_device *sdev, in __ata_change_queue_depth() argument
1277 if (queue_depth < 1 || queue_depth == sdev->queue_depth) in __ata_change_queue_depth()
1278 return sdev->queue_depth; in __ata_change_queue_depth()
1280 dev = ata_scsi_find_dev(ap, sdev); in __ata_change_queue_depth()
1282 return sdev->queue_depth; in __ata_change_queue_depth()
1294 queue_depth = min(queue_depth, sdev->host->can_queue); in __ata_change_queue_depth()
1298 if (sdev->queue_depth == queue_depth) in __ata_change_queue_depth()
1301 return scsi_change_queue_depth(sdev, queue_depth); in __ata_change_queue_depth()
1319 int ata_scsi_change_queue_depth(struct scsi_device *sdev, int queue_depth) in ata_scsi_change_queue_depth() argument
1321 struct ata_port *ap = ata_shost_to_port(sdev->host); in ata_scsi_change_queue_depth()
1323 return __ata_change_queue_depth(ap, sdev, queue_depth); in ata_scsi_change_queue_depth()
2688 if (qc->cdb[0] == ALLOW_MEDIUM_REMOVAL && qc->dev->sdev) in atapi_qc_complete()
2689 qc->dev->sdev->locked = 0; in atapi_qc_complete()
3728 struct scsi_device *sdev; in ata_scsi_scan_host() local
3731 if (dev->sdev) in ata_scsi_scan_host()
3739 sdev = __scsi_add_device(ap->scsi_host, channel, id, 0, in ata_scsi_scan_host()
3741 if (!IS_ERR(sdev)) { in ata_scsi_scan_host()
3742 dev->sdev = sdev; in ata_scsi_scan_host()
3743 scsi_device_put(sdev); in ata_scsi_scan_host()
3745 dev->sdev = NULL; in ata_scsi_scan_host()
3756 if (!dev->sdev) in ata_scsi_scan_host()
3808 if (dev->sdev) { in ata_scsi_offline_dev()
3809 scsi_device_set_state(dev->sdev, SDEV_OFFLINE); in ata_scsi_offline_dev()
3828 struct scsi_device *sdev; in ata_scsi_remove_dev() local
3841 sdev = dev->sdev; in ata_scsi_remove_dev()
3842 dev->sdev = NULL; in ata_scsi_remove_dev()
3844 if (sdev) { in ata_scsi_remove_dev()
3849 if (scsi_device_get(sdev) == 0) { in ata_scsi_remove_dev()
3855 scsi_device_set_state(sdev, SDEV_OFFLINE); in ata_scsi_remove_dev()
3858 sdev = NULL; in ata_scsi_remove_dev()
3865 if (sdev) { in ata_scsi_remove_dev()
3867 dev_name(&sdev->sdev_gendev)); in ata_scsi_remove_dev()
3869 scsi_remove_device(sdev); in ata_scsi_remove_dev()
3870 scsi_device_put(sdev); in ata_scsi_remove_dev()
3908 if (dev->sdev) in ata_scsi_media_change_notify()
3909 sdev_evt_send_simple(dev->sdev, SDEV_EVT_MEDIA_CHANGE, in ata_scsi_media_change_notify()
4069 struct scsi_device *sdev = dev->sdev; in ata_scsi_dev_rescan() local
4071 if (!sdev) in ata_scsi_dev_rescan()
4073 if (scsi_device_get(sdev)) in ata_scsi_dev_rescan()
4077 scsi_rescan_device(&(sdev->sdev_gendev)); in ata_scsi_dev_rescan()
4078 scsi_device_put(sdev); in ata_scsi_dev_rescan()
4227 int ata_sas_slave_configure(struct scsi_device *sdev, struct ata_port *ap) in ata_sas_slave_configure() argument
4229 ata_scsi_sdev_config(sdev); in ata_sas_slave_configure()
4230 ata_scsi_dev_config(sdev, ap->link.device); in ata_sas_slave_configure()