chiark / gitweb /
Revert "cdrom_id: Try reading the medium if all MMC commands fail"
[elogind.git] / extras / cdrom_id / cdrom_id.c
index f9d6e0bc24fe574aef4cc86189b516e553892567..0153af66330aeccc7be0248ca6a3656585b4274c 100644 (file)
@@ -297,14 +297,9 @@ static int feature_profiles(struct udev *udev, const unsigned char *profiles, si
                        cd_dvd_ram = 1;
                        break;
                case 0x13:
-                       info(udev, "profile 0x%02x media_dvd_rw\n", profile);
-                       cd_media_dvd_rw = 1;
-                       cd_media_dvd_rw_ro = 1;
-                       break;
                case 0x14:
                        info(udev, "profile 0x%02x dvd_rw\n", profile);
                        cd_dvd_rw = 1;
-                       cd_media_dvd_rw_seq = 1;
                        break;
                case 0x1B:
                        info(udev, "profile 0x%02x dvd_plus_r\n", profile);
@@ -486,10 +481,16 @@ static int cd_profiles(struct udev *udev, int fd)
                cd_media_dvd_ram = 1;
                break;
        case 0x13:
+               info(udev, "profile 0x%02x media_dvd_rw_ro\n", cur_profile);
+               cd_media = 1;
+               cd_media_dvd_rw = 1;
+               cd_media_dvd_rw_ro = 1;
+               break;
        case 0x14:
-               info(udev, "profile 0x%02x media_dvd_rw\n", cur_profile);
+               info(udev, "profile 0x%02x media_dvd_rw_seq\n", cur_profile);
                cd_media = 1;
                cd_media_dvd_rw = 1;
+               cd_media_dvd_rw_seq = 1;
                break;
        case 0x1B:
                info(udev, "profile 0x%02x media_dvd_plus_r\n", cur_profile);
@@ -589,7 +590,7 @@ static int cd_media_info(struct udev *udev, int fd)
         * always "complete", DVD-RAM are "other" or "complete" if the disc is
         * write protected; we need to check the contents if it is blank */
        if ((cd_media_dvd_rw_ro || cd_media_dvd_plus_rw || cd_media_dvd_plus_rw_dl || cd_media_dvd_ram) && (header[2] & 3) > 1) {
-               unsigned char buffer[17 * 2048];
+               unsigned char buffer[32 * 2048];
                unsigned char result, len;
                int block, offset;
 
@@ -660,7 +661,7 @@ static int cd_media_info(struct udev *udev, int fd)
                scsi_cmd_init(udev, &sc, buffer, sizeof(buffer));
                scsi_cmd_set(udev, &sc, 0, 0x28);
                scsi_cmd_set(udev, &sc, 5, 0);
-               scsi_cmd_set(udev, &sc, 8, 17);
+               scsi_cmd_set(udev, &sc, 8, 32);
                scsi_cmd_set(udev, &sc, 9, 0);
                err = scsi_cmd_run(udev, &sc, fd, buffer, sizeof(buffer));
                if ((err != 0)) {