• Home
  • Raw
  • Download

Lines Matching refs:shost

132 	struct Scsi_Host *shost;  member
160 data->shost = NULL; in scsi_complete_async_scans()
231 struct Scsi_Host *shost = dev_to_shost(starget->dev.parent); in scsi_alloc_sdev() local
235 sdev = kzalloc(sizeof(*sdev) + shost->transportt->device_size, in scsi_alloc_sdev()
243 sdev->host = shost; in scsi_alloc_sdev()
294 if (shost->hostt->slave_alloc) { in scsi_alloc_sdev()
295 ret = shost->hostt->slave_alloc(sdev); in scsi_alloc_sdev()
320 struct Scsi_Host *shost = dev_to_shost(dev->parent); in scsi_target_destroy() local
324 spin_lock_irqsave(shost->host_lock, flags); in scsi_target_destroy()
325 if (shost->hostt->target_destroy) in scsi_target_destroy()
326 shost->hostt->target_destroy(starget); in scsi_target_destroy()
328 spin_unlock_irqrestore(shost->host_lock, flags); in scsi_target_destroy()
356 struct Scsi_Host *shost = dev_to_shost(parent); in __scsi_find_target() local
360 list_for_each_entry(starget, &shost->__targets, siblings) { in __scsi_find_target()
388 struct Scsi_Host *shost = dev_to_shost(parent); in scsi_alloc_target() local
392 + shost->transportt->target_size; in scsi_alloc_target()
406 dev_set_name(dev, "target%d:%d:%d", shost->host_no, channel, id); in scsi_alloc_target()
418 spin_lock_irqsave(shost->host_lock, flags); in scsi_alloc_target()
424 list_add_tail(&starget->siblings, &shost->__targets); in scsi_alloc_target()
425 spin_unlock_irqrestore(shost->host_lock, flags); in scsi_alloc_target()
428 if (shost->hostt->target_alloc) { in scsi_alloc_target()
429 error = shost->hostt->target_alloc(starget); in scsi_alloc_target()
445 spin_unlock_irqrestore(shost->host_lock, flags); in scsi_alloc_target()
477 struct Scsi_Host *shost = dev_to_shost(starget->dev.parent); in scsi_target_reap() local
482 spin_lock_irqsave(shost->host_lock, flags); in scsi_target_reap()
488 spin_unlock_irqrestore(shost->host_lock, flags); in scsi_target_reap()
1010 struct Scsi_Host *shost = dev_to_shost(starget->dev.parent); in scsi_probe_and_add_lun() local
1040 ((shost->unchecked_isa_dma) ? __GFP_DMA : 0)); in scsi_probe_and_add_lun()
1113 res = scsi_add_lun(sdev, result, &bflags, shost->async_scan); in scsi_probe_and_add_lun()
1157 struct Scsi_Host *shost = dev_to_shost(starget->dev.parent); in scsi_sequential_lun_scan() local
1162 max_dev_lun = min(max_scsi_luns, shost->max_lun); in scsi_sequential_lun_scan()
1169 max_dev_lun = shost->max_lun; in scsi_sequential_lun_scan()
1196 max_dev_lun = shost->max_lun; in scsi_sequential_lun_scan()
1319 struct Scsi_Host *shost = dev_to_shost(&starget->dev); in scsi_report_lun_scan() local
1334 (!(bflags & BLIST_REPORTLUN2) || shost->max_lun <= 8)) in scsi_report_lun_scan()
1352 shost->host_no, sdev->channel, sdev->id); in scsi_report_lun_scan()
1505 struct scsi_device *__scsi_add_device(struct Scsi_Host *shost, uint channel, in __scsi_add_device() argument
1509 struct device *parent = &shost->shost_gendev; in __scsi_add_device()
1520 mutex_lock(&shost->scan_mutex); in __scsi_add_device()
1521 if (!shost->async_scan) in __scsi_add_device()
1524 if (scsi_host_scan_allowed(shost) && scsi_autopm_get_host(shost) == 0) { in __scsi_add_device()
1526 scsi_autopm_put_host(shost); in __scsi_add_device()
1528 mutex_unlock(&shost->scan_mutex); in __scsi_add_device()
1569 struct Scsi_Host *shost = dev_to_shost(parent); in __scsi_scan_target() local
1574 if (shost->this_id == id) in __scsi_scan_target()
1635 struct Scsi_Host *shost = dev_to_shost(parent); in scsi_scan_target() local
1640 mutex_lock(&shost->scan_mutex); in scsi_scan_target()
1641 if (!shost->async_scan) in scsi_scan_target()
1644 if (scsi_host_scan_allowed(shost) && scsi_autopm_get_host(shost) == 0) { in scsi_scan_target()
1646 scsi_autopm_put_host(shost); in scsi_scan_target()
1648 mutex_unlock(&shost->scan_mutex); in scsi_scan_target()
1652 static void scsi_scan_channel(struct Scsi_Host *shost, unsigned int channel, in scsi_scan_channel() argument
1658 for (id = 0; id < shost->max_id; ++id) { in scsi_scan_channel()
1668 if (shost->reverse_ordering) in scsi_scan_channel()
1672 order_id = shost->max_id - id - 1; in scsi_scan_channel()
1675 __scsi_scan_target(&shost->shost_gendev, channel, in scsi_scan_channel()
1679 __scsi_scan_target(&shost->shost_gendev, channel, in scsi_scan_channel()
1683 int scsi_scan_host_selected(struct Scsi_Host *shost, unsigned int channel, in scsi_scan_host_selected() argument
1686 SCSI_LOG_SCAN_BUS(3, shost_printk (KERN_INFO, shost, in scsi_scan_host_selected()
1690 if (((channel != SCAN_WILD_CARD) && (channel > shost->max_channel)) || in scsi_scan_host_selected()
1691 ((id != SCAN_WILD_CARD) && (id >= shost->max_id)) || in scsi_scan_host_selected()
1692 ((lun != SCAN_WILD_CARD) && (lun > shost->max_lun))) in scsi_scan_host_selected()
1695 mutex_lock(&shost->scan_mutex); in scsi_scan_host_selected()
1696 if (!shost->async_scan) in scsi_scan_host_selected()
1699 if (scsi_host_scan_allowed(shost) && scsi_autopm_get_host(shost) == 0) { in scsi_scan_host_selected()
1701 for (channel = 0; channel <= shost->max_channel; in scsi_scan_host_selected()
1703 scsi_scan_channel(shost, channel, id, lun, in scsi_scan_host_selected()
1706 scsi_scan_channel(shost, channel, id, lun, rescan); in scsi_scan_host_selected()
1707 scsi_autopm_put_host(shost); in scsi_scan_host_selected()
1709 mutex_unlock(&shost->scan_mutex); in scsi_scan_host_selected()
1714 static void scsi_sysfs_add_devices(struct Scsi_Host *shost) in scsi_sysfs_add_devices() argument
1717 shost_for_each_device(sdev, shost) { in scsi_sysfs_add_devices()
1721 if (!scsi_host_scan_allowed(shost) || in scsi_sysfs_add_devices()
1737 static struct async_scan_data *scsi_prep_async_scan(struct Scsi_Host *shost) in scsi_prep_async_scan() argument
1745 if (shost->async_scan) { in scsi_prep_async_scan()
1747 shost->host_no); in scsi_prep_async_scan()
1755 data->shost = scsi_host_get(shost); in scsi_prep_async_scan()
1756 if (!data->shost) in scsi_prep_async_scan()
1760 mutex_lock(&shost->scan_mutex); in scsi_prep_async_scan()
1761 spin_lock_irqsave(shost->host_lock, flags); in scsi_prep_async_scan()
1762 shost->async_scan = 1; in scsi_prep_async_scan()
1763 spin_unlock_irqrestore(shost->host_lock, flags); in scsi_prep_async_scan()
1764 mutex_unlock(&shost->scan_mutex); in scsi_prep_async_scan()
1789 struct Scsi_Host *shost; in scsi_finish_async_scan() local
1795 shost = data->shost; in scsi_finish_async_scan()
1797 mutex_lock(&shost->scan_mutex); in scsi_finish_async_scan()
1799 if (!shost->async_scan) { in scsi_finish_async_scan()
1801 shost->host_no); in scsi_finish_async_scan()
1803 mutex_unlock(&shost->scan_mutex); in scsi_finish_async_scan()
1809 scsi_sysfs_add_devices(shost); in scsi_finish_async_scan()
1811 spin_lock_irqsave(shost->host_lock, flags); in scsi_finish_async_scan()
1812 shost->async_scan = 0; in scsi_finish_async_scan()
1813 spin_unlock_irqrestore(shost->host_lock, flags); in scsi_finish_async_scan()
1815 mutex_unlock(&shost->scan_mutex); in scsi_finish_async_scan()
1826 scsi_autopm_put_host(shost); in scsi_finish_async_scan()
1827 scsi_host_put(shost); in scsi_finish_async_scan()
1831 static void do_scsi_scan_host(struct Scsi_Host *shost) in do_scsi_scan_host() argument
1833 if (shost->hostt->scan_finished) { in do_scsi_scan_host()
1835 if (shost->hostt->scan_start) in do_scsi_scan_host()
1836 shost->hostt->scan_start(shost); in do_scsi_scan_host()
1838 while (!shost->hostt->scan_finished(shost, jiffies - start)) in do_scsi_scan_host()
1841 scsi_scan_host_selected(shost, SCAN_WILD_CARD, SCAN_WILD_CARD, in do_scsi_scan_host()
1849 struct Scsi_Host *shost = data->shost; in do_scan_async() local
1851 do_scsi_scan_host(shost); in do_scan_async()
1859 void scsi_scan_host(struct Scsi_Host *shost) in scsi_scan_host() argument
1865 if (scsi_autopm_get_host(shost) < 0) in scsi_scan_host()
1868 data = scsi_prep_async_scan(shost); in scsi_scan_host()
1870 do_scsi_scan_host(shost); in scsi_scan_host()
1871 scsi_autopm_put_host(shost); in scsi_scan_host()
1884 void scsi_forget_host(struct Scsi_Host *shost) in scsi_forget_host() argument
1890 spin_lock_irqsave(shost->host_lock, flags); in scsi_forget_host()
1891 list_for_each_entry(sdev, &shost->__devices, siblings) { in scsi_forget_host()
1894 spin_unlock_irqrestore(shost->host_lock, flags); in scsi_forget_host()
1898 spin_unlock_irqrestore(shost->host_lock, flags); in scsi_forget_host()
1918 struct scsi_device *scsi_get_host_dev(struct Scsi_Host *shost) in scsi_get_host_dev() argument
1923 mutex_lock(&shost->scan_mutex); in scsi_get_host_dev()
1924 if (!scsi_host_scan_allowed(shost)) in scsi_get_host_dev()
1926 starget = scsi_alloc_target(&shost->shost_gendev, 0, shost->this_id); in scsi_get_host_dev()
1937 mutex_unlock(&shost->scan_mutex); in scsi_get_host_dev()