aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPeter Osterlund <petero2@telia.com>2006-02-20 21:28:04 -0500
committerLinus Torvalds <torvalds@g5.osdl.org>2006-02-20 23:00:10 -0500
commitab863ec342cf148d02ed180b8ecf3a71a024e4be (patch)
treee13f614947329b305c32f9dddb99bda164440e70
parent3b4828047d4ebe3703dedbfc739958c319ff0b24 (diff)
[PATCH] pktcdvd: Fix the logic in the pkt_writable_track function
Fix the pkt_writable_track() function to make it work correctly for all types of CD/DVD discs. Signed-off-by: Peter Osterlund <petero2@telia.com> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
-rw-r--r--drivers/block/pktcdvd.c28
1 files changed, 15 insertions, 13 deletions
diff --git a/drivers/block/pktcdvd.c b/drivers/block/pktcdvd.c
index fb08ae6de403..eb83197cc36c 100644
--- a/drivers/block/pktcdvd.c
+++ b/drivers/block/pktcdvd.c
@@ -1499,28 +1499,30 @@ static int pkt_set_write_settings(struct pktcdvd_device *pd)
1499/* 1499/*
1500 * 1 -- we can write to this track, 0 -- we can't 1500 * 1 -- we can write to this track, 0 -- we can't
1501 */ 1501 */
1502static int pkt_writable_track(track_information *ti) 1502static int pkt_writable_track(struct pktcdvd_device *pd, track_information *ti)
1503{ 1503{
1504 /* 1504 switch (pd->mmc3_profile) {
1505 * only good for CD-RW at the moment, not DVD-RW 1505 case 0x1a: /* DVD+RW */
1506 */ 1506 case 0x12: /* DVD-RAM */
1507 /* The track is always writable on DVD+RW/DVD-RAM */
1508 return 1;
1509 default:
1510 break;
1511 }
1507 1512
1508 /* 1513 if (!ti->packet || !ti->fp)
1509 * FIXME: only for FP 1514 return 0;
1510 */
1511 if (ti->fp == 0)
1512 return 1;
1513 1515
1514 /* 1516 /*
1515 * "good" settings as per Mt Fuji. 1517 * "good" settings as per Mt Fuji.
1516 */ 1518 */
1517 if (ti->rt == 0 && ti->blank == 0 && ti->packet == 1) 1519 if (ti->rt == 0 && ti->blank == 0)
1518 return 1; 1520 return 1;
1519 1521
1520 if (ti->rt == 0 && ti->blank == 1 && ti->packet == 1) 1522 if (ti->rt == 0 && ti->blank == 1)
1521 return 1; 1523 return 1;
1522 1524
1523 if (ti->rt == 1 && ti->blank == 0 && ti->packet == 1) 1525 if (ti->rt == 1 && ti->blank == 0)
1524 return 1; 1526 return 1;
1525 1527
1526 printk("pktcdvd: bad state %d-%d-%d\n", ti->rt, ti->blank, ti->packet); 1528 printk("pktcdvd: bad state %d-%d-%d\n", ti->rt, ti->blank, ti->packet);
@@ -1605,7 +1607,7 @@ static int pkt_probe_settings(struct pktcdvd_device *pd)
1605 return ret; 1607 return ret;
1606 } 1608 }
1607 1609
1608 if (!pkt_writable_track(&ti)) { 1610 if (!pkt_writable_track(pd, &ti)) {
1609 printk("pktcdvd: can't write to this track\n"); 1611 printk("pktcdvd: can't write to this track\n");
1610 return -ENXIO; 1612 return -ENXIO;
1611 } 1613 }