Messages in this thread Patches in this message | | | Subject | Patch to mcdx.c to reload disk information | From | Geoff Hoff <> | Date | Sat, 15 Nov 1997 14:47:23 -0500 |
| |
Konrad <htw6966@htw-dresden.de> mentioned recently on this list that the mcdx driver does not properly update information when a disk is changed. For example, workman doesn't get new information when a disc is changed. Here is a patch I threw together that seems to fix this. It works for Konrad and for myself, but I'm not sure that what I have done is the best way to do it. If you try this patch, please let me know your results. Also if you have any suggestions to make this patch better, let me know. This should work in 2.0 and 2.1 series kernels.
The second patch fixes a bug in pause. I posted it before and it's already in the 2.1 series, but I thought I'd repost it in case someone running 2.0 missed it the first time.
--- linux/drivers/cdrom/mcdx.c.orig Tue May 20 20:52:37 1997 +++ linux/drivers/cdrom/mcdx.c Sun Nov 9 22:52:18 1997 @@ -302,4 +302,26 @@ if (!ip) return -EINVAL; + if (stuffp->xxx) + { + if(-1 == mcdx_requesttocdata(stuffp, &stuffp->di, 1)) + { + stuffp->lastsector = -1; + } + else + { + stuffp->lastsector = (CD_FRAMESIZE / 512) + * msf2log(&stuffp->di.msf_leadout) - 1; + } + + if (stuffp->toc) + { + kfree(stuffp->toc); + stuffp->toc = NULL; + if (-1 == mcdx_readtoc(stuffp)) return -1; + } + + stuffp->xxx=0; + } + switch (cmd) { case CDROMSTART: {--- linux/drivers/cdrom/mcdx.c.orig Tue May 20 21:00:18 1997 +++ linux/drivers/cdrom/mcdx.c Tue May 20 21:06:01 1997 @@ -356,6 +356,10 @@ msf.cdmsf_sec1 = uint2bcd(msf.cdmsf_sec1); msf.cdmsf_frame1 = uint2bcd(msf.cdmsf_frame1); + stuffp->stop.dt.minute = msf.cdmsf_min1; + stuffp->stop.dt.second = msf.cdmsf_sec1; + stuffp->stop.dt.frame = msf.cdmsf_frame1; + return mcdx_playmsf(stuffp, &msf); } --- Geoff Hoff <ghoff@math.utk.edu> Assistant Systems Administrator Department of Mathematics, University of Tennessee Knoxville
| |