aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi/osd/osd_uld.c
diff options
context:
space:
mode:
authorBoaz Harrosh <bharrosh@panasas.com>2009-01-25 10:13:38 -0500
committerJames Bottomley <James.Bottomley@HansenPartnership.com>2009-03-12 13:58:08 -0400
commit1b9dce94c8a24a3f1a01fcdf688f2d903b32acdf (patch)
treec0e17494a5eb8f8701d3674afff26b91ccf593b3 /drivers/scsi/osd/osd_uld.c
parentc6572c983726fe3f3bb5f07e9afe3a9b8e402d1b (diff)
[SCSI] libosd: OSDv2 auto detection
Auto detect an OSDv2 or OSDv1 target at run time. Note how none of the OSD API calls change. The tests do not know what device version it is. This test now passes against both the IBM-OSD-SIM OSD1 target as well as OSC's OSD2 target. Signed-off-by: Boaz Harrosh <bharrosh@panasas.com> Reviewed-by: Benny Halevy <bhalevy@panasas.com> Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
Diffstat (limited to 'drivers/scsi/osd/osd_uld.c')
-rw-r--r--drivers/scsi/osd/osd_uld.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/drivers/scsi/osd/osd_uld.c b/drivers/scsi/osd/osd_uld.c
index cd4ca7cd9f75..f8b1a749958b 100644
--- a/drivers/scsi/osd/osd_uld.c
+++ b/drivers/scsi/osd/osd_uld.c
@@ -243,6 +243,7 @@ EXPORT_SYMBOL(osduld_put_device);
243static int __detect_osd(struct osd_uld_device *oud) 243static int __detect_osd(struct osd_uld_device *oud)
244{ 244{
245 struct scsi_device *scsi_device = oud->od.scsi_device; 245 struct scsi_device *scsi_device = oud->od.scsi_device;
246 char caps[OSD_CAP_LEN];
246 int error; 247 int error;
247 248
248 /* sending a test_unit_ready as first command seems to be needed 249 /* sending a test_unit_ready as first command seems to be needed
@@ -254,6 +255,10 @@ static int __detect_osd(struct osd_uld_device *oud)
254 if (error) 255 if (error)
255 OSD_ERR("warning: scsi_test_unit_ready failed\n"); 256 OSD_ERR("warning: scsi_test_unit_ready failed\n");
256 257
258 osd_sec_init_nosec_doall_caps(caps, &osd_root_object, false, true);
259 if (osd_auto_detect_ver(&oud->od, caps))
260 return -ENODEV;
261
257 return 0; 262 return 0;
258} 263}
259 264