summaryrefslogtreecommitdiffstats
path: root/sys/cam
diff options
context:
space:
mode:
authormav <mav@FreeBSD.org>2015-09-29 10:44:37 +0000
committermav <mav@FreeBSD.org>2015-09-29 10:44:37 +0000
commit9aafc688111d1aefcafb08dbf77d4fc5f17b33d7 (patch)
tree4ff18d7df3fe95e54b2c96c20974faa0f29980d8 /sys/cam
parenta9dd74ee84294c89e91fc3a7c80de3664b21186c (diff)
downloadFreeBSD-src-9aafc688111d1aefcafb08dbf77d4fc5f17b33d7.zip
FreeBSD-src-9aafc688111d1aefcafb08dbf77d4fc5f17b33d7.tar.gz
Report that we can read all flavours of DVD. Why not?
Diffstat (limited to 'sys/cam')
-rw-r--r--sys/cam/ctl/ctl.c56
1 files changed, 55 insertions, 1 deletions
diff --git a/sys/cam/ctl/ctl.c b/sys/cam/ctl/ctl.c
index 9181d3e..a050534 100644
--- a/sys/cam/ctl/ctl.c
+++ b/sys/cam/ctl/ctl.c
@@ -10271,6 +10271,10 @@ ctl_get_config(struct ctl_scsiio *ctsio)
sizeof(struct scsi_get_config_feature) + 8 +
sizeof(struct scsi_get_config_feature) +
sizeof(struct scsi_get_config_feature) + 4 +
+ sizeof(struct scsi_get_config_feature) + 4 +
+ sizeof(struct scsi_get_config_feature) + 4 +
+ sizeof(struct scsi_get_config_feature) + 4 +
+ sizeof(struct scsi_get_config_feature) + 4 +
sizeof(struct scsi_get_config_feature) + 4;
ctsio->kern_data_ptr = malloc(data_len, M_CTL, M_WAITOK | M_ZERO);
ctsio->kern_sg_entries = 0;
@@ -10284,8 +10288,16 @@ ctl_get_config(struct ctl_scsiio *ctsio)
scsi_ulto2b(0x0010, hdr->current_profile);
feature = (struct scsi_get_config_feature *)(hdr + 1);
- if (starting > 0x001f)
+ if (starting > 0x003b)
goto done;
+ if (starting > 0x003a)
+ goto f3b;
+ if (starting > 0x002b)
+ goto f3a;
+ if (starting > 0x002a)
+ goto f2b;
+ if (starting > 0x001f)
+ goto f2a;
if (starting > 0x001e)
goto f1f;
if (starting > 0x001d)
@@ -10382,6 +10394,48 @@ f1f: /* DVD Read */
feature = (struct scsi_get_config_feature *)
&feature->feature_data[feature->add_length];
+f2a: /* DVD+RW */
+ scsi_ulto2b(0x002A, feature->feature_code);
+ feature->flags = 0x04;
+ if ((lun->flags & CTL_LUN_NO_MEDIA) == 0)
+ feature->flags |= SGC_F_CURRENT;
+ feature->add_length = 4;
+ feature->feature_data[0] = 0x00;
+ feature->feature_data[1] = 0x00;
+ feature = (struct scsi_get_config_feature *)
+ &feature->feature_data[feature->add_length];
+
+f2b: /* DVD+R */
+ scsi_ulto2b(0x002B, feature->feature_code);
+ feature->flags = 0x00;
+ if ((lun->flags & CTL_LUN_NO_MEDIA) == 0)
+ feature->flags |= SGC_F_CURRENT;
+ feature->add_length = 4;
+ feature->feature_data[0] = 0x00;
+ feature = (struct scsi_get_config_feature *)
+ &feature->feature_data[feature->add_length];
+
+f3a: /* DVD+RW Dual Layer */
+ scsi_ulto2b(0x003A, feature->feature_code);
+ feature->flags = 0x00;
+ if ((lun->flags & CTL_LUN_NO_MEDIA) == 0)
+ feature->flags |= SGC_F_CURRENT;
+ feature->add_length = 4;
+ feature->feature_data[0] = 0x00;
+ feature->feature_data[1] = 0x00;
+ feature = (struct scsi_get_config_feature *)
+ &feature->feature_data[feature->add_length];
+
+f3b: /* DVD+R Dual Layer */
+ scsi_ulto2b(0x003B, feature->feature_code);
+ feature->flags = 0x00;
+ if ((lun->flags & CTL_LUN_NO_MEDIA) == 0)
+ feature->flags |= SGC_F_CURRENT;
+ feature->add_length = 4;
+ feature->feature_data[0] = 0x00;
+ feature = (struct scsi_get_config_feature *)
+ &feature->feature_data[feature->add_length];
+
done:
data_len = (uint8_t *)feature - (uint8_t *)hdr;
if (rt == SGC_RT_SPECIFIC && data_len > 4) {
OpenPOWER on IntegriCloud