Lines Matching defs:sdev
91 struct scsi_device *sdev = to_scsi_device(device);
99 ap = ata_shost_to_port(sdev->host);
102 dev = ata_scsi_find_dev(ap, sdev);
131 struct scsi_device *sdev = to_scsi_device(device);
148 ap = ata_shost_to_port(sdev->host);
151 dev = ata_scsi_find_dev(ap, sdev);
247 * @sdev: SCSI device for which BIOS geometry is to be determined
248 * @bdev: block device associated with @sdev
263 int ata_std_bios_param(struct scsi_device *sdev, struct block_device *bdev,
277 * @sdev: SCSI device to adjust device capacity for
279 * This function is called if a partition on @sdev extends beyond
285 void ata_scsi_unlock_native_capacity(struct scsi_device *sdev)
287 struct ata_port *ap = ata_shost_to_port(sdev->host);
293 dev = ata_scsi_find_dev(ap, sdev);
308 * @sdev: SCSI device to get identify data for
317 static int ata_get_identity(struct ata_port *ap, struct scsi_device *sdev,
320 struct ata_device *dev = ata_scsi_find_dev(ap, sdev);
991 void ata_scsi_sdev_config(struct scsi_device *sdev)
993 sdev->use_10_for_rw = 1;
994 sdev->use_10_for_ms = 1;
995 sdev->no_write_same = 1;
1002 sdev->max_device_blocked = 1;
1026 int ata_scsi_dev_config(struct scsi_device *sdev, struct ata_device *dev)
1028 struct request_queue *q = sdev->request_queue;
1037 sdev->sector_size = ATA_SECT_SIZE;
1045 sdev->dma_drain_len = ATAPI_MAX_DRAIN;
1046 sdev->dma_drain_buf = kmalloc(sdev->dma_drain_len,
1048 if (!sdev->dma_drain_buf) {
1053 sdev->sector_size = ata_id_logical_sector_size(dev->id);
1054 sdev->manage_start_stop = 1;
1064 if (sdev->sector_size > PAGE_SIZE)
1067 sdev->sector_size);
1069 blk_queue_update_dma_alignment(q, sdev->sector_size - 1);
1072 set_bit(SDEV_EVT_MEDIA_CHANGE, sdev->supported_events);
1077 depth = min(sdev->host->can_queue, ata_id_queue_depth(dev->id));
1079 scsi_change_queue_depth(sdev, depth);
1083 sdev->security_supported = 1;
1085 dev->sdev = sdev;
1091 * @sdev: SCSI device to examine
1101 int ata_scsi_slave_config(struct scsi_device *sdev)
1103 struct ata_port *ap = ata_shost_to_port(sdev->host);
1104 struct ata_device *dev = __ata_scsi_find_dev(ap, sdev);
1107 ata_scsi_sdev_config(sdev);
1110 rc = ata_scsi_dev_config(sdev, dev);
1118 * @sdev: SCSI device to be destroyed
1120 * @sdev is about to be destroyed for hot/warm unplugging. If
1122 * dev->sdev, this function doesn't have to do anything.
1124 * Clear dev->sdev, schedule the device for ATA detach and invoke
1130 void ata_scsi_slave_destroy(struct scsi_device *sdev)
1132 struct ata_port *ap = ata_shost_to_port(sdev->host);
1140 dev = __ata_scsi_find_dev(ap, sdev);
1141 if (dev && dev->sdev) {
1143 dev->sdev = NULL;
1149 kfree(sdev->dma_drain_buf);
2610 /* SCSI EH automatically locks door if sdev->locked is
2617 * If door lock fails, always clear sdev->locked to
2621 * sure qc->dev->sdev isn't NULL before dereferencing.
2623 if (qc->cdb[0] == ALLOW_MEDIUM_REMOVAL && qc->dev->sdev)
2624 qc->dev->sdev->locked = 0;
4329 struct scsi_device *sdev = dev->sdev;
4343 sdev->sdev_gendev.of_node = child;
4364 struct scsi_device *sdev;
4367 if (dev->sdev)
4375 sdev = __scsi_add_device(ap->scsi_host, channel, id, 0,
4377 if (!IS_ERR(sdev)) {
4378 dev->sdev = sdev;
4380 scsi_device_put(sdev);
4382 dev->sdev = NULL;
4393 if (!dev->sdev)
4434 * function is called with host lock which protects dev->sdev
4445 if (dev->sdev) {
4446 scsi_device_set_state(dev->sdev, SDEV_OFFLINE);
4465 struct scsi_device *sdev;
4477 /* clearing dev->sdev is protected by host lock */
4478 sdev = dev->sdev;
4479 dev->sdev = NULL;
4481 if (sdev) {
4482 /* If user initiated unplug races with us, sdev can go
4486 if (scsi_device_get(sdev) == 0) {
4487 /* The following ensures the attached sdev is
4492 scsi_device_set_state(sdev, SDEV_OFFLINE);
4495 sdev = NULL;
4502 if (sdev) {
4504 dev_name(&sdev->sdev_gendev));
4506 scsi_remove_device(sdev);
4507 scsi_device_put(sdev);
4545 if (dev->sdev)
4546 sdev_evt_send_simple(dev->sdev, SDEV_EVT_MEDIA_CHANGE,
4685 struct scsi_device *sdev = dev->sdev;
4687 if (!sdev)
4689 if (scsi_device_get(sdev))
4693 scsi_rescan_device(&(sdev->sdev_gendev));
4694 scsi_device_put(sdev);