Loading drivers/scsi/scsi_scan.c +9 −0 Original line number Diff line number Diff line Loading @@ -780,6 +780,14 @@ static int scsi_add_lun(struct scsi_device *sdev, unsigned char *inq_result, } else { sdev->type = (inq_result[0] & 0x1f); sdev->removable = (inq_result[1] & 0x80) >> 7; /* * some devices may respond with wrong type for * well-known logical units. Force well-known type * to enumerate them correctly. */ if (scsi_is_wlun(sdev->lun) && (sdev->type != TYPE_WLUN)) sdev->type = TYPE_WLUN; } switch (sdev->type) { Loading @@ -795,6 +803,7 @@ static int scsi_add_lun(struct scsi_device *sdev, unsigned char *inq_result, case TYPE_COMM: case TYPE_RAID: case TYPE_OSD: case TYPE_WLUN: sdev->writeable = 1; break; case TYPE_ROM: Loading include/scsi/scsi.h +1 −0 Original line number Diff line number Diff line Loading @@ -326,6 +326,7 @@ static inline int scsi_status_is_good(int status) #define TYPE_ENCLOSURE 0x0d /* Enclosure Services Device */ #define TYPE_RBC 0x0e #define TYPE_OSD 0x11 #define TYPE_WLUN 0x1e /* well-known logical unit */ #define TYPE_NO_LUN 0x7f /* SCSI protocols; these are taken from SPC-3 section 7.5 */ Loading Loading
drivers/scsi/scsi_scan.c +9 −0 Original line number Diff line number Diff line Loading @@ -780,6 +780,14 @@ static int scsi_add_lun(struct scsi_device *sdev, unsigned char *inq_result, } else { sdev->type = (inq_result[0] & 0x1f); sdev->removable = (inq_result[1] & 0x80) >> 7; /* * some devices may respond with wrong type for * well-known logical units. Force well-known type * to enumerate them correctly. */ if (scsi_is_wlun(sdev->lun) && (sdev->type != TYPE_WLUN)) sdev->type = TYPE_WLUN; } switch (sdev->type) { Loading @@ -795,6 +803,7 @@ static int scsi_add_lun(struct scsi_device *sdev, unsigned char *inq_result, case TYPE_COMM: case TYPE_RAID: case TYPE_OSD: case TYPE_WLUN: sdev->writeable = 1; break; case TYPE_ROM: Loading
include/scsi/scsi.h +1 −0 Original line number Diff line number Diff line Loading @@ -326,6 +326,7 @@ static inline int scsi_status_is_good(int status) #define TYPE_ENCLOSURE 0x0d /* Enclosure Services Device */ #define TYPE_RBC 0x0e #define TYPE_OSD 0x11 #define TYPE_WLUN 0x1e /* well-known logical unit */ #define TYPE_NO_LUN 0x7f /* SCSI protocols; these are taken from SPC-3 section 7.5 */ Loading