Re: Packet writing problems

Julien Oster
2004-08-17T23:24:37Z

Peter Osterlund <petero2@telia.com> writes:

Hello Peter,

> That shouldn't cause any real problems, but since it's quite
> confusing, here is a patch to fix it. With this change, both DVD+RW
> and DVD-RW media is correctly identified in the kernel log, and DVD
> speeds are printed in kB/s.

The following patch on top of your patch adds all commonly used media
types to the output and changes CD-R and CD-RW to be detected by
profile type. It also reports unconforming non-standard profiles as
well as profiles which have a MMC profile definition but are unknown
as of the current MMC3 revision.

Please review.

--- fuzzy-2.6.8.1-orig/drivers/block/pktcdvd.c 2004-08-18 01:22:53.540198893 +0200
+++ fuzzy-2.6.8.1/drivers/block/pktcdvd.c 2004-08-18 01:24:25.983297748 +0200
@@ -1628,14 +1628,38 @@ static int pkt_probe_settings(struct pkt
return -ENXIO;

switch (pd->mmc3_profile) {
+ case 0x08: /* CD-ROM */
+ printk("pktcdvd: inserted media is CD-ROM\n");
+ break;
+ case 0x09: /* CD-R */
+ printk("pktcdvd: inserted media is CD-R\n");
+ break;
+ case 0x0a: /* CD-RW */
+ printk("pktcdvd: inserted media is CD-RW\n");
+ break;
+ case 0x10: /* DVD-ROM */
+ printk("pktcdvd: inserted media is DVD-ROM\n");
+ break;
+ case 0x11: /* DVD-R */
+ printk("pktcdvd: inserted media is DVD-R\n");
+ break;
+ case 0x12: /* DVD-RAM */
+ printk("pktcdvd: inserted media is DVD-RAM\n");
+ break;
+ case 0x13: /* DVD-RW restricted overwrite */
+ printk("pktcdvd: inserted media is DVD-RW with restricted overwrite\n");
+ break;
+ case 0x14: /* DVD-RW sequential recording */
+ printk("pktcdvd: inserted media is DVD-RW with sequential recording\n");
+ break;
case 0x1a: /* DVD+RW */
printk("pktcdvd: inserted media is DVD+RW\n");
break;
- case 0x13: /* DVD-RW */
- printk("pktcdvd: inserted media is DVD-RW\n");
+ case 0xffff: /* unconforming */
+ printk("pktcdvd: inserted media does not conform to a known standard\n");
break;
default:
- printk("pktcdvd: inserted media is CD-R%s\n", di.erasable ? "W" : "");
+ printk("pktcdvd: inserted media is yet UNKNOWN by pktcdvd\n");
break;
}
pd->type = di.erasable ? PACKET_CDRW : PACKET_CDR;

Regards,
Julien