Lines Matching refs:shost
121 struct Scsi_Host *shost; member
165 data->shost = NULL; in scsi_complete_async_scans()
285 struct Scsi_Host *shost = dev_to_shost(starget->dev.parent); in scsi_alloc_sdev() local
287 sdev = kzalloc(sizeof(*sdev) + shost->transportt->device_size, in scsi_alloc_sdev()
295 sdev->host = shost; in scsi_alloc_sdev()
366 if (shost->hostt->slave_alloc) { in scsi_alloc_sdev()
367 ret = shost->hostt->slave_alloc(sdev); in scsi_alloc_sdev()
392 struct Scsi_Host *shost = dev_to_shost(dev->parent); in scsi_target_destroy() local
398 spin_lock_irqsave(shost->host_lock, flags); in scsi_target_destroy()
399 if (shost->hostt->target_destroy) in scsi_target_destroy()
400 shost->hostt->target_destroy(starget); in scsi_target_destroy()
402 spin_unlock_irqrestore(shost->host_lock, flags); in scsi_target_destroy()
430 struct Scsi_Host *shost = dev_to_shost(parent); in __scsi_find_target() local
434 list_for_each_entry(starget, &shost->__targets, siblings) { in __scsi_find_target()
494 struct Scsi_Host *shost = dev_to_shost(parent); in scsi_alloc_target() local
498 + shost->transportt->target_size; in scsi_alloc_target()
512 dev_set_name(dev, "target%d:%d:%d", shost->host_no, channel, id); in scsi_alloc_target()
525 spin_lock_irqsave(shost->host_lock, flags); in scsi_alloc_target()
531 list_add_tail(&starget->siblings, &shost->__targets); in scsi_alloc_target()
532 spin_unlock_irqrestore(shost->host_lock, flags); in scsi_alloc_target()
535 if (shost->hostt->target_alloc) { in scsi_alloc_target()
536 error = shost->hostt->target_alloc(starget); in scsi_alloc_target()
559 spin_unlock_irqrestore(shost->host_lock, flags); in scsi_alloc_target()
1164 struct Scsi_Host *shost = dev_to_shost(starget->dev.parent); in scsi_probe_and_add_lun() local
1266 res = scsi_add_lun(sdev, result, &bflags, shost->async_scan); in scsi_probe_and_add_lun()
1312 struct Scsi_Host *shost = dev_to_shost(starget->dev.parent); in scsi_sequential_lun_scan() local
1317 max_dev_lun = min(max_scsi_luns, shost->max_lun); in scsi_sequential_lun_scan()
1324 max_dev_lun = shost->max_lun; in scsi_sequential_lun_scan()
1351 max_dev_lun = shost->max_lun; in scsi_sequential_lun_scan()
1410 struct Scsi_Host *shost = dev_to_shost(&starget->dev); in scsi_report_lun_scan() local
1428 (!(bflags & BLIST_REPORTLUN2) || shost->max_lun <= 8)) in scsi_report_lun_scan()
1572 struct scsi_device *__scsi_add_device(struct Scsi_Host *shost, uint channel, in __scsi_add_device() argument
1576 struct device *parent = &shost->shost_gendev; in __scsi_add_device()
1587 mutex_lock(&shost->scan_mutex); in __scsi_add_device()
1588 if (!shost->async_scan) in __scsi_add_device()
1591 if (scsi_host_scan_allowed(shost) && scsi_autopm_get_host(shost) == 0) { in __scsi_add_device()
1594 scsi_autopm_put_host(shost); in __scsi_add_device()
1596 mutex_unlock(&shost->scan_mutex); in __scsi_add_device()
1665 struct Scsi_Host *shost = dev_to_shost(parent); in __scsi_scan_target() local
1670 if (shost->this_id == id) in __scsi_scan_target()
1736 struct Scsi_Host *shost = dev_to_shost(parent); in scsi_scan_target() local
1745 mutex_lock(&shost->scan_mutex); in scsi_scan_target()
1746 if (!shost->async_scan) in scsi_scan_target()
1749 if (scsi_host_scan_allowed(shost) && scsi_autopm_get_host(shost) == 0) { in scsi_scan_target()
1751 scsi_autopm_put_host(shost); in scsi_scan_target()
1753 mutex_unlock(&shost->scan_mutex); in scsi_scan_target()
1757 static void scsi_scan_channel(struct Scsi_Host *shost, unsigned int channel, in scsi_scan_channel() argument
1764 for (id = 0; id < shost->max_id; ++id) { in scsi_scan_channel()
1774 if (shost->reverse_ordering) in scsi_scan_channel()
1778 order_id = shost->max_id - id - 1; in scsi_scan_channel()
1781 __scsi_scan_target(&shost->shost_gendev, channel, in scsi_scan_channel()
1785 __scsi_scan_target(&shost->shost_gendev, channel, in scsi_scan_channel()
1789 int scsi_scan_host_selected(struct Scsi_Host *shost, unsigned int channel, in scsi_scan_host_selected() argument
1793 SCSI_LOG_SCAN_BUS(3, shost_printk (KERN_INFO, shost, in scsi_scan_host_selected()
1797 if (((channel != SCAN_WILD_CARD) && (channel > shost->max_channel)) || in scsi_scan_host_selected()
1798 ((id != SCAN_WILD_CARD) && (id >= shost->max_id)) || in scsi_scan_host_selected()
1799 ((lun != SCAN_WILD_CARD) && (lun >= shost->max_lun))) in scsi_scan_host_selected()
1802 mutex_lock(&shost->scan_mutex); in scsi_scan_host_selected()
1803 if (!shost->async_scan) in scsi_scan_host_selected()
1806 if (scsi_host_scan_allowed(shost) && scsi_autopm_get_host(shost) == 0) { in scsi_scan_host_selected()
1808 for (channel = 0; channel <= shost->max_channel; in scsi_scan_host_selected()
1810 scsi_scan_channel(shost, channel, id, lun, in scsi_scan_host_selected()
1813 scsi_scan_channel(shost, channel, id, lun, rescan); in scsi_scan_host_selected()
1814 scsi_autopm_put_host(shost); in scsi_scan_host_selected()
1816 mutex_unlock(&shost->scan_mutex); in scsi_scan_host_selected()
1821 static void scsi_sysfs_add_devices(struct Scsi_Host *shost) in scsi_sysfs_add_devices() argument
1824 shost_for_each_device(sdev, shost) { in scsi_sysfs_add_devices()
1831 if (!scsi_host_scan_allowed(shost) || in scsi_sysfs_add_devices()
1847 static struct async_scan_data *scsi_prep_async_scan(struct Scsi_Host *shost) in scsi_prep_async_scan() argument
1855 mutex_lock(&shost->scan_mutex); in scsi_prep_async_scan()
1856 if (shost->async_scan) { in scsi_prep_async_scan()
1857 shost_printk(KERN_DEBUG, shost, "%s called twice\n", __func__); in scsi_prep_async_scan()
1864 data->shost = scsi_host_get(shost); in scsi_prep_async_scan()
1865 if (!data->shost) in scsi_prep_async_scan()
1869 spin_lock_irqsave(shost->host_lock, flags); in scsi_prep_async_scan()
1870 shost->async_scan = 1; in scsi_prep_async_scan()
1871 spin_unlock_irqrestore(shost->host_lock, flags); in scsi_prep_async_scan()
1872 mutex_unlock(&shost->scan_mutex); in scsi_prep_async_scan()
1883 mutex_unlock(&shost->scan_mutex); in scsi_prep_async_scan()
1898 struct Scsi_Host *shost; in scsi_finish_async_scan() local
1904 shost = data->shost; in scsi_finish_async_scan()
1906 mutex_lock(&shost->scan_mutex); in scsi_finish_async_scan()
1908 if (!shost->async_scan) { in scsi_finish_async_scan()
1909 shost_printk(KERN_INFO, shost, "%s called twice\n", __func__); in scsi_finish_async_scan()
1911 mutex_unlock(&shost->scan_mutex); in scsi_finish_async_scan()
1917 scsi_sysfs_add_devices(shost); in scsi_finish_async_scan()
1919 spin_lock_irqsave(shost->host_lock, flags); in scsi_finish_async_scan()
1920 shost->async_scan = 0; in scsi_finish_async_scan()
1921 spin_unlock_irqrestore(shost->host_lock, flags); in scsi_finish_async_scan()
1923 mutex_unlock(&shost->scan_mutex); in scsi_finish_async_scan()
1934 scsi_autopm_put_host(shost); in scsi_finish_async_scan()
1935 scsi_host_put(shost); in scsi_finish_async_scan()
1939 static void do_scsi_scan_host(struct Scsi_Host *shost) in do_scsi_scan_host() argument
1941 if (shost->hostt->scan_finished) { in do_scsi_scan_host()
1943 if (shost->hostt->scan_start) in do_scsi_scan_host()
1944 shost->hostt->scan_start(shost); in do_scsi_scan_host()
1946 while (!shost->hostt->scan_finished(shost, jiffies - start)) in do_scsi_scan_host()
1949 scsi_scan_host_selected(shost, SCAN_WILD_CARD, SCAN_WILD_CARD, in do_scsi_scan_host()
1957 struct Scsi_Host *shost = data->shost; in do_scan_async() local
1959 do_scsi_scan_host(shost); in do_scan_async()
1967 void scsi_scan_host(struct Scsi_Host *shost) in scsi_scan_host() argument
1974 if (scsi_autopm_get_host(shost) < 0) in scsi_scan_host()
1977 data = scsi_prep_async_scan(shost); in scsi_scan_host()
1979 do_scsi_scan_host(shost); in scsi_scan_host()
1980 scsi_autopm_put_host(shost); in scsi_scan_host()
1993 void scsi_forget_host(struct Scsi_Host *shost) in scsi_forget_host() argument
1999 spin_lock_irqsave(shost->host_lock, flags); in scsi_forget_host()
2000 list_for_each_entry(sdev, &shost->__devices, siblings) { in scsi_forget_host()
2003 spin_unlock_irqrestore(shost->host_lock, flags); in scsi_forget_host()
2007 spin_unlock_irqrestore(shost->host_lock, flags); in scsi_forget_host()