Lines Matching refs:shost

115 	struct Scsi_Host *shost;  member
143 data->shost = NULL; in scsi_complete_async_scans()
214 struct Scsi_Host *shost = dev_to_shost(starget->dev.parent); in scsi_alloc_sdev() local
218 sdev = kzalloc(sizeof(*sdev) + shost->transportt->device_size, in scsi_alloc_sdev()
226 sdev->host = shost; in scsi_alloc_sdev()
263 if (shost_use_blk_mq(shost)) in scsi_alloc_sdev()
278 (shost->bqt || shost->hostt->use_blk_tags)) { in scsi_alloc_sdev()
280 sdev->host->cmd_per_lun, shost->bqt, in scsi_alloc_sdev()
281 shost->hostt->tag_alloc_policy); in scsi_alloc_sdev()
287 if (shost->hostt->slave_alloc) { in scsi_alloc_sdev()
288 ret = shost->hostt->slave_alloc(sdev); in scsi_alloc_sdev()
313 struct Scsi_Host *shost = dev_to_shost(dev->parent); in scsi_target_destroy() local
318 spin_lock_irqsave(shost->host_lock, flags); in scsi_target_destroy()
319 if (shost->hostt->target_destroy) in scsi_target_destroy()
320 shost->hostt->target_destroy(starget); in scsi_target_destroy()
322 spin_unlock_irqrestore(shost->host_lock, flags); in scsi_target_destroy()
350 struct Scsi_Host *shost = dev_to_shost(parent); in __scsi_find_target() local
354 list_for_each_entry(starget, &shost->__targets, siblings) { in __scsi_find_target()
413 struct Scsi_Host *shost = dev_to_shost(parent); in scsi_alloc_target() local
417 + shost->transportt->target_size; in scsi_alloc_target()
431 dev_set_name(dev, "target%d:%d:%d", shost->host_no, channel, id); in scsi_alloc_target()
443 spin_lock_irqsave(shost->host_lock, flags); in scsi_alloc_target()
449 list_add_tail(&starget->siblings, &shost->__targets); in scsi_alloc_target()
450 spin_unlock_irqrestore(shost->host_lock, flags); in scsi_alloc_target()
453 if (shost->hostt->target_alloc) { in scsi_alloc_target()
454 error = shost->hostt->target_alloc(starget); in scsi_alloc_target()
476 spin_unlock_irqrestore(shost->host_lock, flags); in scsi_alloc_target()
1053 struct Scsi_Host *shost = dev_to_shost(starget->dev.parent); in scsi_probe_and_add_lun() local
1083 ((shost->unchecked_isa_dma) ? __GFP_DMA : 0)); in scsi_probe_and_add_lun()
1156 res = scsi_add_lun(sdev, result, &bflags, shost->async_scan); in scsi_probe_and_add_lun()
1201 struct Scsi_Host *shost = dev_to_shost(starget->dev.parent); in scsi_sequential_lun_scan() local
1206 max_dev_lun = min(max_scsi_luns, shost->max_lun); in scsi_sequential_lun_scan()
1213 max_dev_lun = shost->max_lun; in scsi_sequential_lun_scan()
1240 max_dev_lun = shost->max_lun; in scsi_sequential_lun_scan()
1366 struct Scsi_Host *shost = dev_to_shost(&starget->dev); in scsi_report_lun_scan() local
1381 (!(bflags & BLIST_REPORTLUN2) || shost->max_lun <= 8)) in scsi_report_lun_scan()
1399 shost->host_no, sdev->channel, sdev->id); in scsi_report_lun_scan()
1528 struct scsi_device *__scsi_add_device(struct Scsi_Host *shost, uint channel, in __scsi_add_device() argument
1532 struct device *parent = &shost->shost_gendev; in __scsi_add_device()
1543 mutex_lock(&shost->scan_mutex); in __scsi_add_device()
1544 if (!shost->async_scan) in __scsi_add_device()
1547 if (scsi_host_scan_allowed(shost) && scsi_autopm_get_host(shost) == 0) { in __scsi_add_device()
1549 scsi_autopm_put_host(shost); in __scsi_add_device()
1551 mutex_unlock(&shost->scan_mutex); in __scsi_add_device()
1594 struct Scsi_Host *shost = dev_to_shost(parent); in __scsi_scan_target() local
1599 if (shost->this_id == id) in __scsi_scan_target()
1662 struct Scsi_Host *shost = dev_to_shost(parent); in scsi_scan_target() local
1667 mutex_lock(&shost->scan_mutex); in scsi_scan_target()
1668 if (!shost->async_scan) in scsi_scan_target()
1671 if (scsi_host_scan_allowed(shost) && scsi_autopm_get_host(shost) == 0) { in scsi_scan_target()
1673 scsi_autopm_put_host(shost); in scsi_scan_target()
1675 mutex_unlock(&shost->scan_mutex); in scsi_scan_target()
1679 static void scsi_scan_channel(struct Scsi_Host *shost, unsigned int channel, in scsi_scan_channel() argument
1685 for (id = 0; id < shost->max_id; ++id) { in scsi_scan_channel()
1695 if (shost->reverse_ordering) in scsi_scan_channel()
1699 order_id = shost->max_id - id - 1; in scsi_scan_channel()
1702 __scsi_scan_target(&shost->shost_gendev, channel, in scsi_scan_channel()
1706 __scsi_scan_target(&shost->shost_gendev, channel, in scsi_scan_channel()
1710 int scsi_scan_host_selected(struct Scsi_Host *shost, unsigned int channel, in scsi_scan_host_selected() argument
1713 SCSI_LOG_SCAN_BUS(3, shost_printk (KERN_INFO, shost, in scsi_scan_host_selected()
1717 if (((channel != SCAN_WILD_CARD) && (channel > shost->max_channel)) || in scsi_scan_host_selected()
1718 ((id != SCAN_WILD_CARD) && (id >= shost->max_id)) || in scsi_scan_host_selected()
1719 ((lun != SCAN_WILD_CARD) && (lun >= shost->max_lun))) in scsi_scan_host_selected()
1722 mutex_lock(&shost->scan_mutex); in scsi_scan_host_selected()
1723 if (!shost->async_scan) in scsi_scan_host_selected()
1726 if (scsi_host_scan_allowed(shost) && scsi_autopm_get_host(shost) == 0) { in scsi_scan_host_selected()
1728 for (channel = 0; channel <= shost->max_channel; in scsi_scan_host_selected()
1730 scsi_scan_channel(shost, channel, id, lun, in scsi_scan_host_selected()
1733 scsi_scan_channel(shost, channel, id, lun, rescan); in scsi_scan_host_selected()
1734 scsi_autopm_put_host(shost); in scsi_scan_host_selected()
1736 mutex_unlock(&shost->scan_mutex); in scsi_scan_host_selected()
1741 static void scsi_sysfs_add_devices(struct Scsi_Host *shost) in scsi_sysfs_add_devices() argument
1744 shost_for_each_device(sdev, shost) { in scsi_sysfs_add_devices()
1751 if (!scsi_host_scan_allowed(shost) || in scsi_sysfs_add_devices()
1767 static struct async_scan_data *scsi_prep_async_scan(struct Scsi_Host *shost) in scsi_prep_async_scan() argument
1775 if (shost->async_scan) { in scsi_prep_async_scan()
1776 shost_printk(KERN_INFO, shost, "%s called twice\n", __func__); in scsi_prep_async_scan()
1784 data->shost = scsi_host_get(shost); in scsi_prep_async_scan()
1785 if (!data->shost) in scsi_prep_async_scan()
1789 mutex_lock(&shost->scan_mutex); in scsi_prep_async_scan()
1790 spin_lock_irqsave(shost->host_lock, flags); in scsi_prep_async_scan()
1791 shost->async_scan = 1; in scsi_prep_async_scan()
1792 spin_unlock_irqrestore(shost->host_lock, flags); in scsi_prep_async_scan()
1793 mutex_unlock(&shost->scan_mutex); in scsi_prep_async_scan()
1818 struct Scsi_Host *shost; in scsi_finish_async_scan() local
1824 shost = data->shost; in scsi_finish_async_scan()
1826 mutex_lock(&shost->scan_mutex); in scsi_finish_async_scan()
1828 if (!shost->async_scan) { in scsi_finish_async_scan()
1829 shost_printk(KERN_INFO, shost, "%s called twice\n", __func__); in scsi_finish_async_scan()
1831 mutex_unlock(&shost->scan_mutex); in scsi_finish_async_scan()
1837 scsi_sysfs_add_devices(shost); in scsi_finish_async_scan()
1839 spin_lock_irqsave(shost->host_lock, flags); in scsi_finish_async_scan()
1840 shost->async_scan = 0; in scsi_finish_async_scan()
1841 spin_unlock_irqrestore(shost->host_lock, flags); in scsi_finish_async_scan()
1843 mutex_unlock(&shost->scan_mutex); in scsi_finish_async_scan()
1854 scsi_autopm_put_host(shost); in scsi_finish_async_scan()
1855 scsi_host_put(shost); in scsi_finish_async_scan()
1859 static void do_scsi_scan_host(struct Scsi_Host *shost) in do_scsi_scan_host() argument
1861 if (shost->hostt->scan_finished) { in do_scsi_scan_host()
1863 if (shost->hostt->scan_start) in do_scsi_scan_host()
1864 shost->hostt->scan_start(shost); in do_scsi_scan_host()
1866 while (!shost->hostt->scan_finished(shost, jiffies - start)) in do_scsi_scan_host()
1869 scsi_scan_host_selected(shost, SCAN_WILD_CARD, SCAN_WILD_CARD, in do_scsi_scan_host()
1877 struct Scsi_Host *shost = data->shost; in do_scan_async() local
1879 do_scsi_scan_host(shost); in do_scan_async()
1887 void scsi_scan_host(struct Scsi_Host *shost) in scsi_scan_host() argument
1893 if (scsi_autopm_get_host(shost) < 0) in scsi_scan_host()
1896 data = scsi_prep_async_scan(shost); in scsi_scan_host()
1898 do_scsi_scan_host(shost); in scsi_scan_host()
1899 scsi_autopm_put_host(shost); in scsi_scan_host()
1912 void scsi_forget_host(struct Scsi_Host *shost) in scsi_forget_host() argument
1918 spin_lock_irqsave(shost->host_lock, flags); in scsi_forget_host()
1919 list_for_each_entry(sdev, &shost->__devices, siblings) { in scsi_forget_host()
1922 spin_unlock_irqrestore(shost->host_lock, flags); in scsi_forget_host()
1926 spin_unlock_irqrestore(shost->host_lock, flags); in scsi_forget_host()
1946 struct scsi_device *scsi_get_host_dev(struct Scsi_Host *shost) in scsi_get_host_dev() argument
1951 mutex_lock(&shost->scan_mutex); in scsi_get_host_dev()
1952 if (!scsi_host_scan_allowed(shost)) in scsi_get_host_dev()
1954 starget = scsi_alloc_target(&shost->shost_gendev, 0, shost->this_id); in scsi_get_host_dev()
1965 mutex_unlock(&shost->scan_mutex); in scsi_get_host_dev()