Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 965540c3 authored by Linux Build Service Account's avatar Linux Build Service Account Committed by Gerrit - the friendly Code Review server
Browse files

Merge "scsi: force well-known logical unit type"

parents a8917413 5d0b9e82
Loading
Loading
Loading
Loading
+9 −0
Original line number Diff line number Diff line
@@ -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) {
@@ -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:
+1 −0
Original line number Diff line number Diff line
@@ -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 */