Lines Matching refs:shost

121 	struct Scsi_Host *shost;  member
165 data->shost = NULL; in scsi_complete_async_scans()
286 struct Scsi_Host *shost = dev_to_shost(starget->dev.parent); in scsi_alloc_sdev() local
289 sdev = kzalloc(sizeof(*sdev) + shost->transportt->device_size, in scsi_alloc_sdev()
297 sdev->host = shost; in scsi_alloc_sdev()
337 scsi_init_limits(shost, &lim); in scsi_alloc_sdev()
367 if (shost->hostt->sdev_init) { in scsi_alloc_sdev()
368 ret = shost->hostt->sdev_init(sdev); in scsi_alloc_sdev()
393 struct Scsi_Host *shost = dev_to_shost(dev->parent); in scsi_target_destroy() local
399 spin_lock_irqsave(shost->host_lock, flags); in scsi_target_destroy()
400 if (shost->hostt->target_destroy) in scsi_target_destroy()
401 shost->hostt->target_destroy(starget); in scsi_target_destroy()
403 spin_unlock_irqrestore(shost->host_lock, flags); in scsi_target_destroy()
431 struct Scsi_Host *shost = dev_to_shost(parent); in __scsi_find_target() local
435 list_for_each_entry(starget, &shost->__targets, siblings) { in __scsi_find_target()
495 struct Scsi_Host *shost = dev_to_shost(parent); in scsi_alloc_target() local
499 + shost->transportt->target_size; in scsi_alloc_target()
513 dev_set_name(dev, "target%d:%d:%d", shost->host_no, channel, id); in scsi_alloc_target()
526 spin_lock_irqsave(shost->host_lock, flags); in scsi_alloc_target()
532 list_add_tail(&starget->siblings, &shost->__targets); in scsi_alloc_target()
533 spin_unlock_irqrestore(shost->host_lock, flags); in scsi_alloc_target()
536 if (shost->hostt->target_alloc) { in scsi_alloc_target()
537 error = shost->hostt->target_alloc(starget); in scsi_alloc_target()
560 spin_unlock_irqrestore(shost->host_lock, flags); in scsi_alloc_target()
1184 struct Scsi_Host *shost = dev_to_shost(starget->dev.parent); in scsi_probe_and_add_lun() local
1286 res = scsi_add_lun(sdev, result, &bflags, shost->async_scan); in scsi_probe_and_add_lun()
1332 struct Scsi_Host *shost = dev_to_shost(starget->dev.parent); in scsi_sequential_lun_scan() local
1337 max_dev_lun = min(max_scsi_luns, shost->max_lun); in scsi_sequential_lun_scan()
1344 max_dev_lun = shost->max_lun; in scsi_sequential_lun_scan()
1371 max_dev_lun = shost->max_lun; in scsi_sequential_lun_scan()
1428 struct Scsi_Host *shost = dev_to_shost(&starget->dev); in scsi_report_lun_scan() local
1468 (!(bflags & BLIST_REPORTLUN2) || shost->max_lun <= 8)) in scsi_report_lun_scan()
1601 struct scsi_device *__scsi_add_device(struct Scsi_Host *shost, uint channel, in __scsi_add_device() argument
1605 struct device *parent = &shost->shost_gendev; in __scsi_add_device()
1616 mutex_lock(&shost->scan_mutex); in __scsi_add_device()
1617 if (!shost->async_scan) in __scsi_add_device()
1620 if (scsi_host_scan_allowed(shost) && scsi_autopm_get_host(shost) == 0) { in __scsi_add_device()
1623 scsi_autopm_put_host(shost); in __scsi_add_device()
1625 mutex_unlock(&shost->scan_mutex); in __scsi_add_device()
1746 struct Scsi_Host *shost = dev_to_shost(parent); in __scsi_scan_target() local
1751 if (shost->this_id == id) in __scsi_scan_target()
1817 struct Scsi_Host *shost = dev_to_shost(parent); in scsi_scan_target() local
1826 mutex_lock(&shost->scan_mutex); in scsi_scan_target()
1827 if (!shost->async_scan) in scsi_scan_target()
1830 if (scsi_host_scan_allowed(shost) && scsi_autopm_get_host(shost) == 0) { in scsi_scan_target()
1832 scsi_autopm_put_host(shost); in scsi_scan_target()
1834 mutex_unlock(&shost->scan_mutex); in scsi_scan_target()
1838 static void scsi_scan_channel(struct Scsi_Host *shost, unsigned int channel, in scsi_scan_channel() argument
1845 for (id = 0; id < shost->max_id; ++id) { in scsi_scan_channel()
1855 if (shost->reverse_ordering) in scsi_scan_channel()
1859 order_id = shost->max_id - id - 1; in scsi_scan_channel()
1862 __scsi_scan_target(&shost->shost_gendev, channel, in scsi_scan_channel()
1866 __scsi_scan_target(&shost->shost_gendev, channel, in scsi_scan_channel()
1870 int scsi_scan_host_selected(struct Scsi_Host *shost, unsigned int channel, in scsi_scan_host_selected() argument
1874 SCSI_LOG_SCAN_BUS(3, shost_printk (KERN_INFO, shost, in scsi_scan_host_selected()
1878 if (((channel != SCAN_WILD_CARD) && (channel > shost->max_channel)) || in scsi_scan_host_selected()
1879 ((id != SCAN_WILD_CARD) && (id >= shost->max_id)) || in scsi_scan_host_selected()
1880 ((lun != SCAN_WILD_CARD) && (lun >= shost->max_lun))) in scsi_scan_host_selected()
1883 mutex_lock(&shost->scan_mutex); in scsi_scan_host_selected()
1884 if (!shost->async_scan) in scsi_scan_host_selected()
1887 if (scsi_host_scan_allowed(shost) && scsi_autopm_get_host(shost) == 0) { in scsi_scan_host_selected()
1889 for (channel = 0; channel <= shost->max_channel; in scsi_scan_host_selected()
1891 scsi_scan_channel(shost, channel, id, lun, in scsi_scan_host_selected()
1894 scsi_scan_channel(shost, channel, id, lun, rescan); in scsi_scan_host_selected()
1895 scsi_autopm_put_host(shost); in scsi_scan_host_selected()
1897 mutex_unlock(&shost->scan_mutex); in scsi_scan_host_selected()
1902 static void scsi_sysfs_add_devices(struct Scsi_Host *shost) in scsi_sysfs_add_devices() argument
1905 shost_for_each_device(sdev, shost) { in scsi_sysfs_add_devices()
1912 if (!scsi_host_scan_allowed(shost) || in scsi_sysfs_add_devices()
1928 static struct async_scan_data *scsi_prep_async_scan(struct Scsi_Host *shost) in scsi_prep_async_scan() argument
1936 mutex_lock(&shost->scan_mutex); in scsi_prep_async_scan()
1937 if (shost->async_scan) { in scsi_prep_async_scan()
1938 shost_printk(KERN_DEBUG, shost, "%s called twice\n", __func__); in scsi_prep_async_scan()
1945 data->shost = scsi_host_get(shost); in scsi_prep_async_scan()
1946 if (!data->shost) in scsi_prep_async_scan()
1950 spin_lock_irqsave(shost->host_lock, flags); in scsi_prep_async_scan()
1951 shost->async_scan = 1; in scsi_prep_async_scan()
1952 spin_unlock_irqrestore(shost->host_lock, flags); in scsi_prep_async_scan()
1953 mutex_unlock(&shost->scan_mutex); in scsi_prep_async_scan()
1964 mutex_unlock(&shost->scan_mutex); in scsi_prep_async_scan()
1979 struct Scsi_Host *shost; in scsi_finish_async_scan() local
1985 shost = data->shost; in scsi_finish_async_scan()
1987 mutex_lock(&shost->scan_mutex); in scsi_finish_async_scan()
1989 if (!shost->async_scan) { in scsi_finish_async_scan()
1990 shost_printk(KERN_INFO, shost, "%s called twice\n", __func__); in scsi_finish_async_scan()
1992 mutex_unlock(&shost->scan_mutex); in scsi_finish_async_scan()
1998 scsi_sysfs_add_devices(shost); in scsi_finish_async_scan()
2000 spin_lock_irqsave(shost->host_lock, flags); in scsi_finish_async_scan()
2001 shost->async_scan = 0; in scsi_finish_async_scan()
2002 spin_unlock_irqrestore(shost->host_lock, flags); in scsi_finish_async_scan()
2004 mutex_unlock(&shost->scan_mutex); in scsi_finish_async_scan()
2015 scsi_autopm_put_host(shost); in scsi_finish_async_scan()
2016 scsi_host_put(shost); in scsi_finish_async_scan()
2020 static void do_scsi_scan_host(struct Scsi_Host *shost) in do_scsi_scan_host() argument
2022 if (shost->hostt->scan_finished) { in do_scsi_scan_host()
2024 if (shost->hostt->scan_start) in do_scsi_scan_host()
2025 shost->hostt->scan_start(shost); in do_scsi_scan_host()
2027 while (!shost->hostt->scan_finished(shost, jiffies - start)) in do_scsi_scan_host()
2030 scsi_scan_host_selected(shost, SCAN_WILD_CARD, SCAN_WILD_CARD, in do_scsi_scan_host()
2038 struct Scsi_Host *shost = data->shost; in do_scan_async() local
2040 do_scsi_scan_host(shost); in do_scan_async()
2050 void scsi_scan_host(struct Scsi_Host *shost) in scsi_scan_host() argument
2057 if (scsi_autopm_get_host(shost) < 0) in scsi_scan_host()
2060 data = scsi_prep_async_scan(shost); in scsi_scan_host()
2062 do_scsi_scan_host(shost); in scsi_scan_host()
2063 scsi_autopm_put_host(shost); in scsi_scan_host()
2076 void scsi_forget_host(struct Scsi_Host *shost) in scsi_forget_host() argument
2082 spin_lock_irqsave(shost->host_lock, flags); in scsi_forget_host()
2083 list_for_each_entry(sdev, &shost->__devices, siblings) { in scsi_forget_host()
2086 spin_unlock_irqrestore(shost->host_lock, flags); in scsi_forget_host()
2090 spin_unlock_irqrestore(shost->host_lock, flags); in scsi_forget_host()