scsi_scan.c (d5469119f0098881ab7f991990ef4f81ef13a194) scsi_scan.c (086fa5ff0854c676ec333760f4c0154b3b242616)
1/*
2 * scsi_scan.c
3 *
4 * Copyright (C) 2000 Eric Youngdale,
5 * Copyright (C) 2002 Patrick Mansfield
6 *
7 * The general scanning/probing algorithm is as follows, exceptions are
8 * made to it depending on device specific flags, compilation options, and

--- 865 unchanged lines hidden (view full) ---

874 if (*bflags & BLIST_SELECT_NO_ATN)
875 sdev->select_no_atn = 1;
876
877 /*
878 * Maximum 512 sector transfer length
879 * broken RA4x00 Compaq Disk Array
880 */
881 if (*bflags & BLIST_MAX_512)
1/*
2 * scsi_scan.c
3 *
4 * Copyright (C) 2000 Eric Youngdale,
5 * Copyright (C) 2002 Patrick Mansfield
6 *
7 * The general scanning/probing algorithm is as follows, exceptions are
8 * made to it depending on device specific flags, compilation options, and

--- 865 unchanged lines hidden (view full) ---

874 if (*bflags & BLIST_SELECT_NO_ATN)
875 sdev->select_no_atn = 1;
876
877 /*
878 * Maximum 512 sector transfer length
879 * broken RA4x00 Compaq Disk Array
880 */
881 if (*bflags & BLIST_MAX_512)
882 blk_queue_max_sectors(sdev->request_queue, 512);
882 blk_queue_max_hw_sectors(sdev->request_queue, 512);
883
884 /*
885 * Some devices may not want to have a start command automatically
886 * issued when a device is added.
887 */
888 if (*bflags & BLIST_NOSTARTONADD)
889 sdev->no_start_on_add = 1;
890

--- 443 unchanged lines hidden (view full) ---

1334 return 1;
1335 if (bflags & BLIST_NOLUN)
1336 return 0;
1337
1338 if (!(sdev = scsi_device_lookup_by_target(starget, 0))) {
1339 sdev = scsi_alloc_sdev(starget, 0, NULL);
1340 if (!sdev)
1341 return 0;
883
884 /*
885 * Some devices may not want to have a start command automatically
886 * issued when a device is added.
887 */
888 if (*bflags & BLIST_NOSTARTONADD)
889 sdev->no_start_on_add = 1;
890

--- 443 unchanged lines hidden (view full) ---

1334 return 1;
1335 if (bflags & BLIST_NOLUN)
1336 return 0;
1337
1338 if (!(sdev = scsi_device_lookup_by_target(starget, 0))) {
1339 sdev = scsi_alloc_sdev(starget, 0, NULL);
1340 if (!sdev)
1341 return 0;
1342 if (scsi_device_get(sdev)) {
1343 __scsi_remove_device(sdev);
1342 if (scsi_device_get(sdev))
1344 return 0;
1343 return 0;
1345 }
1346 }
1347
1348 sprintf(devname, "host %d channel %d id %d",
1349 shost->host_no, sdev->channel, sdev->id);
1350
1351 /*
1352 * Allocate enough to hold the header (the same size as one scsi_lun)
1353 * plus the max number of luns we are requesting.

--- 550 unchanged lines hidden (view full) ---

1904 mutex_lock(&shost->scan_mutex);
1905 if (!scsi_host_scan_allowed(shost))
1906 goto out;
1907 starget = scsi_alloc_target(&shost->shost_gendev, 0, shost->this_id);
1908 if (!starget)
1909 goto out;
1910
1911 sdev = scsi_alloc_sdev(starget, 0, NULL);
1344 }
1345
1346 sprintf(devname, "host %d channel %d id %d",
1347 shost->host_no, sdev->channel, sdev->id);
1348
1349 /*
1350 * Allocate enough to hold the header (the same size as one scsi_lun)
1351 * plus the max number of luns we are requesting.

--- 550 unchanged lines hidden (view full) ---

1902 mutex_lock(&shost->scan_mutex);
1903 if (!scsi_host_scan_allowed(shost))
1904 goto out;
1905 starget = scsi_alloc_target(&shost->shost_gendev, 0, shost->this_id);
1906 if (!starget)
1907 goto out;
1908
1909 sdev = scsi_alloc_sdev(starget, 0, NULL);
1912 if (sdev)
1910 if (sdev) {
1911 sdev->sdev_gendev.parent = get_device(&starget->dev);
1913 sdev->borken = 0;
1912 sdev->borken = 0;
1914 else
1913 } else
1915 scsi_target_reap(starget);
1916 put_device(&starget->dev);
1917 out:
1918 mutex_unlock(&shost->scan_mutex);
1919 return sdev;
1920}
1921EXPORT_SYMBOL(scsi_get_host_dev);
1922

--- 21 unchanged lines hidden ---
1914 scsi_target_reap(starget);
1915 put_device(&starget->dev);
1916 out:
1917 mutex_unlock(&shost->scan_mutex);
1918 return sdev;
1919}
1920EXPORT_SYMBOL(scsi_get_host_dev);
1921

--- 21 unchanged lines hidden ---