On Thu, Apr 15, 2010 at 1:15 PM, Kay Sievers <kay.sievers@xxxxxxxx> wrote: > We retrieve a list of features, and only feature 0 is the list of > profiles. I reworked the logic to use two loops to iterate over the > lists, and use the variable length field of the "profiles" feature to > find the correct number of profiles. Hope that fixes the problem you > are seeing. Looks good and much cleaner. One thing though, the feature_profiles function is missing profiles 0x8, 0x9, and 0xA. I have attached a patch that fixes that. Otherwise the variable "cd_cd_rom" never gets set! Mike
From 2acfa2a68a1cac0c3d9aaed419e3035b2ac1e8d1 Mon Sep 17 00:00:00 2001 From: Mike Brudevold <mike@xxxxxxxxxxxxx> Date: Thu, 15 Apr 2010 19:55:50 -0500 Subject: [PATCH] cdrom_id: add missing profiles to feature_profiles Signed-off-by: Mike Brudevold <mike@xxxxxxxxxxxxx> --- extras/cdrom_id/cdrom_id.c | 12 ++++++++++++ 1 files changed, 12 insertions(+), 0 deletions(-) diff --git a/extras/cdrom_id/cdrom_id.c b/extras/cdrom_id/cdrom_id.c index 722b8f8..da2785e 100644 --- a/extras/cdrom_id/cdrom_id.c +++ b/extras/cdrom_id/cdrom_id.c @@ -274,6 +274,18 @@ static int feature_profiles(struct udev *udev, const unsigned char *profiles, si info(udev, "profile 0x%02x mo\n", profile); cd_mo = 1; break; + case 0x08: + info(udev, "profile 0x%02x cd_rom\n", profile); + cd_cd_rom = 1; + break; + case 0x09: + info(udev, "profile 0x%02x cd_r\n", profile); + cd_cd_r = 1; + break; + case 0x0A: + info(udev, "profile 0x%02x cd_rw\n", profile); + cd_cd_rw = 1; + break; case 0x10: info(udev, "profile 0x%02x dvd_rom\n", profile); cd_dvd_rom = 1; -- 1.7.0.4