mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/herbert/cryptodev-2.6.git
synced 2026-04-23 05:56:14 -04:00
[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>
This commit is contained in:
committed by
James Bottomley
parent
c6572c9837
commit
1b9dce94c8
@@ -243,6 +243,7 @@ EXPORT_SYMBOL(osduld_put_device);
|
||||
static int __detect_osd(struct osd_uld_device *oud)
|
||||
{
|
||||
struct scsi_device *scsi_device = oud->od.scsi_device;
|
||||
char caps[OSD_CAP_LEN];
|
||||
int error;
|
||||
|
||||
/* 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)
|
||||
if (error)
|
||||
OSD_ERR("warning: scsi_test_unit_ready failed\n");
|
||||
|
||||
osd_sec_init_nosec_doall_caps(caps, &osd_root_object, false, true);
|
||||
if (osd_auto_detect_ver(&oud->od, caps))
|
||||
return -ENODEV;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user