hal/hald/linux2/probing linux_dvd_rw_utils.c, 1.1,
1.2 probe-storage.c, 1.10, 1.11
David Zeuthen
david at freedesktop.org
Fri Jul 15 12:54:33 PDT 2005
Update of /cvs/hal/hal/hald/linux2/probing
In directory gabe:/tmp/cvs-serv25645/hald/linux2/probing
Modified Files:
linux_dvd_rw_utils.c probe-storage.c
Log Message:
2005-07-15 David Zeuthen <davidz at redhat.com>
I added support for detection of DVD+R Dual-Layer write
support (new key: storage.cdrom.dvdplusrdl). Here a fix for DVD+R
DL media in libhal_volume_policy_compute_display_name(). Patches
from Danny Kukawka <danny.kukawka at web.de>.
* libhal-storage/libhal-storage.h:
* libhal-storage/libhal-storage.c (libhal_drive_policy_compute_display_name)
(libhal_volume_policy_compute_display_name):
* hald/linux2/probing/probe-storage.c (main):
* hald/linux2/probing/linux_dvd_rw_utils.c (get_dvd_r_rw_profile):
* doc/spec/hal-spec.xml.in:
Index: linux_dvd_rw_utils.c
===================================================================
RCS file: /cvs/hal/hal/hald/linux2/probing/linux_dvd_rw_utils.c,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- linux_dvd_rw_utils.c 10 Feb 2005 17:03:57 -0000 1.1
+++ linux_dvd_rw_utils.c 15 Jul 2005 19:54:30 -0000 1.2
@@ -180,6 +180,7 @@
{
ScsiCommand *cmd;
int retval = -1;
+ int dvd_plusr_dl = -1;
unsigned char page[20];
unsigned char *list;
int i, len;
@@ -220,8 +221,9 @@
for (i = 12; i < list[11]; i += 4) {
int profile = (list[i] << 8 | list[i + 1]);
- /* 0x1B: DVD+R
- * 0x1A: DVD+RW */
+ /* 0x1B: DVD+R == 0
+ * 0x1A: DVD+RW == 1
+ * 0x2B: DVD+R DL == 3 */
if (profile == 0x1B) {
if (retval == 1)
retval = 2;
@@ -232,13 +234,27 @@
retval = 2;
else
retval = 1;
+ } else if (profile == 0x2B) {
+ /* DVD+R DL*/
+ dvd_plusr_dl = 1;
}
}
scsi_command_free (cmd);
free (list);
-
+
+ /* to do:
+ * - check if DVD+R DL always implied also DVD+R and DVD+RW.
+ * If so, we don't need this code. */
+ if (dvd_plusr_dl == 1) {
+ if(retval == 2 || retval == 1 )
+ retval = 4;
+ else
+ retval = 3;
+ }
+
return retval;
+
}
static unsigned char *
Index: probe-storage.c
===================================================================
RCS file: /cvs/hal/hal/hald/linux2/probing/probe-storage.c,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -d -r1.10 -r1.11
--- probe-storage.c 2 Jul 2005 11:20:41 -0000 1.10
+++ probe-storage.c 15 Jul 2005 19:54:31 -0000 1.11
@@ -237,6 +237,7 @@
libhal_device_set_property_bool (ctx, udi, "storage.cdrom.dvdram", FALSE, &error);
libhal_device_set_property_bool (ctx, udi, "storage.cdrom.dvdplusr", FALSE, &error);
libhal_device_set_property_bool (ctx, udi, "storage.cdrom.dvdplusrw", FALSE, &error);
+ libhal_device_set_property_bool (ctx, udi, "storage.cdrom.dvdplusrdl", FALSE, &error);
if (capabilities & CDC_CD_R) {
libhal_device_set_property_bool (ctx, udi, "storage.cdrom.cdr", TRUE, &error);
@@ -262,6 +263,13 @@
libhal_device_set_property_bool(ctx, udi, "storage.cdrom.dvdplusr", TRUE, &error);
} else if (profile == 1) {
libhal_device_set_property_bool (ctx, udi, "storage.cdrom.dvdplusrw", TRUE, &error);
+ } else if (profile == 3) {
+ libhal_device_set_property_bool (ctx, udi, "storage.cdrom.dvdplusr", TRUE, &error);
+ libhal_device_set_property_bool (ctx, udi, "storage.cdrom.dvdplusrdl", TRUE, &error);
+ } else if (profile == 4) {
+ libhal_device_set_property_bool (ctx, udi, "storage.cdrom.dvdplusr", TRUE, &error);
+ libhal_device_set_property_bool (ctx, udi, "storage.cdrom.dvdplusrw", TRUE, &error);
+ libhal_device_set_property_bool (ctx, udi, "storage.cdrom.dvdplusrdl", TRUE, &error);
}
}
if (capabilities & CDC_DVD_R) {
More information about the hal-commit
mailing list