From mboxrd@z Thu Jan 1 00:00:00 1970 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 10d4db,4883613dcfd7732b,start X-Google-Attributes: gid10d4db,public From: Corey Minyard Subject: Fix for CDU31A driver in 2.0.23 and 2.1.5 Date: 1996/10/30 Message-ID: #1/1 X-Deja-AN: 193488162 organization: ? x-auth: PGPMoose V1.1 PGP comp.os.linux.announce followup-to: comp.os.linux.development.system newsgroups: comp.os.linux.announce -----BEGIN PGP SIGNED MESSAGE----- Well, I managed to screw up the CDU31A driver. I couldn't test the patch I sent Linus because my interface board is broken; it looked right (my daughter has been waking me up at 5:00 every morning and everything looks right when you are tired :-), so I applied it. Well, it was wrong. The following fix has been tested and does seem to work. Sorry for the problem. - -- Corey Minyard Internet: minyard@metronet.com Work: minyard@nortel.ca UUCP: minyard@wf-rch.cirr.com - --- linux/drivers/cdrom/cdu31a.c.old Sun Oct 20 22:25:06 1996 +++ linux/drivers/cdrom/cdu31a.c Sun Oct 20 22:30:31 1996 @@ -1915,7 +1915,9 @@ int num_tracks; - - num_tracks = sony_toc.last_track_num - sony_toc.first_track_num + 1; + num_tracks = ( bcd_to_int(sony_toc.last_track_num) + - bcd_to_int(sony_toc.first_track_num) + + 1); for (i = 0; i < num_tracks; i++) { if (sony_toc.tracks[i].track == track) @@ -2486,8 +2488,8 @@ i=verify_area(VERIFY_WRITE, hdr, sizeof(*hdr)); if(i<0) return i; - - loc_hdr.cdth_trk0 = sony_toc.first_track_num; - - loc_hdr.cdth_trk1 = sony_toc.last_track_num; + loc_hdr.cdth_trk0 = bcd_to_int(sony_toc.first_track_num); + loc_hdr.cdth_trk1 = bcd_to_int(sony_toc.last_track_num); memcpy_tofs(hdr, &loc_hdr, sizeof(*hdr)); } return 0; @@ -2567,8 +2569,8 @@ return i; memcpy_fromfs(&ti, (char *) arg, sizeof(ti)); - - if ( (ti.cdti_trk0 < sony_toc.first_track_num) - - || (ti.cdti_trk0 > sony_toc.last_track_num) + if ( (ti.cdti_trk0 < bcd_to_int(sony_toc.first_track_num)) + || (ti.cdti_trk0 > bcd_to_int(sony_toc.last_track_num)) || (ti.cdti_trk1 < ti.cdti_trk0)) { return -EINVAL; @@ -2587,7 +2589,7 @@ * If we want to stop after the last track, use the lead-out * MSF to do that. */ - - if (ti.cdti_trk1 >= sony_toc.last_track_num) + if (ti.cdti_trk1 >= bcd_to_int(sony_toc.last_track_num)) { log_to_msf(msf_to_log(sony_toc.lead_out_start_msf)-1, &(params[4])); -----BEGIN PGP SIGNATURE----- Version: 2.6.3i Charset: noconv iQCVAwUBMnc5vYQRll5MupLRAQFuWwQA0yV7RepUXhf+NibP/b1BrALkA+okYjkx VLXA5IaldTC4yu0otZijXnNdVm7PuVyCrBrcNtHzDJPYzB6cJ62ded/bDaRY6fkg DN1UGTrhm2raZAfJNU3aWT7ErFrplRLScdmV66sw8WR0uHCZiuioDgnu/yPhZi6I VRz9zk9EtH0= =T8EF -----END PGP SIGNATURE----- -- This article has been digitally signed by the moderator, using PGP. http://www.iki.fi/liw/lars-public-key.asc has PGP key for validating signature. Send submissions for comp.os.linux.announce to: linux-announce@news.ornl.gov PLEASE remember a short description of the software and the LOCATION. This group is archived at http://www.iki.fi/liw/linux/cola.html