tag | line | file | source code |
stuffp | 272 | drivers/cdrom/mcdx.c | struct s_drive_stuff *stuffp = mcdx_stuffp[MINOR(ip->i_rdev)]; |
stuffp | 274 | drivers/cdrom/mcdx.c | if (!stuffp->present) return -ENXIO; |
stuffp | 285 | drivers/cdrom/mcdx.c | stuffp->audiostatus = CDROM_AUDIO_INVALID; |
stuffp | 286 | drivers/cdrom/mcdx.c | if (-1 == mcdx_stop(stuffp, 1)) |
stuffp | 299 | drivers/cdrom/mcdx.c | if ((ti.cdti_trk0 < stuffp->di.n_first) |
stuffp | 300 | drivers/cdrom/mcdx.c | || (ti.cdti_trk0 > stuffp->di.n_last) |
stuffp | 301 | drivers/cdrom/mcdx.c | || (ti.cdti_trk1 < stuffp->di.n_first)) |
stuffp | 303 | drivers/cdrom/mcdx.c | if (ti.cdti_trk1 > stuffp->di.n_last) ti.cdti_trk1 = stuffp->di.n_last; |
stuffp | 306 | drivers/cdrom/mcdx.c | return mcdx_playtrk(stuffp, &ti); |
stuffp | 315 | drivers/cdrom/mcdx.c | if ((stuffp->audiostatus == CDROM_AUDIO_PLAY) |
stuffp | 316 | drivers/cdrom/mcdx.c | && (-1 == mcdx_hold(stuffp, 1))) return -EIO; |
stuffp | 332 | drivers/cdrom/mcdx.c | return mcdx_playmsf(stuffp, &msf); |
stuffp | 337 | drivers/cdrom/mcdx.c | return mcdx_playtrk(stuffp, NULL); |
stuffp | 347 | drivers/cdrom/mcdx.c | if (-1 == mcdx_readtoc(stuffp)) return -1; |
stuffp | 353 | drivers/cdrom/mcdx.c | tp = &stuffp->toc[stuffp->di.n_last - stuffp->di.n_first + 1]; |
stuffp | 354 | drivers/cdrom/mcdx.c | else if (entry.cdte_track > stuffp->di.n_last |
stuffp | 355 | drivers/cdrom/mcdx.c | || entry.cdte_track < stuffp->di.n_first) return -EINVAL; |
stuffp | 356 | drivers/cdrom/mcdx.c | else tp = &stuffp->toc[entry.cdte_track - stuffp->di.n_first]; |
stuffp | 389 | drivers/cdrom/mcdx.c | if (-1 == mcdx_requestsubqcode(stuffp, &q, 2)) return -EIO; |
stuffp | 391 | drivers/cdrom/mcdx.c | TRACE((SUBCHNL, "audiostatus: %x\n", stuffp->audiostatus)); |
stuffp | 392 | drivers/cdrom/mcdx.c | sub.cdsc_audiostatus = stuffp->audiostatus; |
stuffp | 438 | drivers/cdrom/mcdx.c | toc.cdth_trk0 = stuffp->di.n_first; |
stuffp | 439 | drivers/cdrom/mcdx.c | toc.cdth_trk1 = stuffp->di.n_last; |
stuffp | 442 | drivers/cdrom/mcdx.c | stuffp->di.n_first, stuffp->di.n_last)); |
stuffp | 448 | drivers/cdrom/mcdx.c | if (stuffp->audiostatus != CDROM_AUDIO_PLAY) return -EINVAL; |
stuffp | 449 | drivers/cdrom/mcdx.c | if (-1 == mcdx_stop(stuffp, 1)) return -EIO; |
stuffp | 450 | drivers/cdrom/mcdx.c | stuffp->audiostatus = CDROM_AUDIO_PAUSED; |
stuffp | 451 | drivers/cdrom/mcdx.c | if (-1 == mcdx_requestsubqcode(stuffp, &stuffp->start, 1)) |
stuffp | 466 | drivers/cdrom/mcdx.c | ms.addr.msf.minute = bcd2uint(stuffp->multi.msf_last.minute); |
stuffp | 467 | drivers/cdrom/mcdx.c | ms.addr.msf.second = bcd2uint(stuffp->multi.msf_last.second); |
stuffp | 468 | drivers/cdrom/mcdx.c | ms.addr.msf.frame = bcd2uint(stuffp->multi.msf_last.frame); |
stuffp | 470 | drivers/cdrom/mcdx.c | ms.addr.lba = msf2log(&stuffp->multi.msf_last); |
stuffp | 473 | drivers/cdrom/mcdx.c | ms.xa_flag = !!stuffp->multi.multi; |
stuffp | 487 | drivers/cdrom/mcdx.c | stuffp->multi.msf_last.minute, |
stuffp | 488 | drivers/cdrom/mcdx.c | stuffp->multi.msf_last.second, |
stuffp | 489 | drivers/cdrom/mcdx.c | stuffp->multi.msf_last.frame)); |
stuffp | 496 | drivers/cdrom/mcdx.c | stuffp->multi.msf_last.minute, |
stuffp | 497 | drivers/cdrom/mcdx.c | stuffp->multi.msf_last.second, |
stuffp | 498 | drivers/cdrom/mcdx.c | stuffp->multi.msf_last.frame)); |
stuffp | 505 | drivers/cdrom/mcdx.c | if (stuffp->users > 1) return -EBUSY; |
stuffp | 506 | drivers/cdrom/mcdx.c | if (-1 == mcdx_eject(stuffp, 1)) return -EIO; |
stuffp | 511 | drivers/cdrom/mcdx.c | stuffp->eject_sw = arg; |
stuffp | 527 | drivers/cdrom/mcdx.c | return mcdx_setattentuator(stuffp, &volctrl, 1); |
stuffp | 539 | drivers/cdrom/mcdx.c | struct s_drive_stuff *stuffp; |
stuffp | 550 | drivers/cdrom/mcdx.c | stuffp = mcdx_stuffp[MINOR(CURRENT->rq_dev)]; |
stuffp | 551 | drivers/cdrom/mcdx.c | TRACE((REQUEST, "do_request() stuffp = %p\n", stuffp)); |
stuffp | 556 | drivers/cdrom/mcdx.c | if ((dev < 0) || (dev >= MCDX_NDRIVES) || (!stuffp->present)) { |
stuffp | 563 | drivers/cdrom/mcdx.c | if (stuffp->audio) { |
stuffp | 576 | drivers/cdrom/mcdx.c | stuffp->status = 0; |
stuffp | 581 | drivers/cdrom/mcdx.c | stuffp, |
stuffp | 586 | drivers/cdrom/mcdx.c | if (stuffp->status & MCDX_ST_EOM) { |
stuffp | 616 | drivers/cdrom/mcdx.c | struct s_drive_stuff *stuffp; |
stuffp | 619 | drivers/cdrom/mcdx.c | stuffp = mcdx_stuffp[MINOR(ip->i_rdev)]; |
stuffp | 620 | drivers/cdrom/mcdx.c | if (!stuffp->present) return -ENXIO; |
stuffp | 623 | drivers/cdrom/mcdx.c | if (-1 == mcdx_getstatus(stuffp, 1)) return -EIO; |
stuffp | 630 | drivers/cdrom/mcdx.c | if (inb((unsigned int) stuffp->rreg_status) & MCDX_RBIT_DOOR) { |
stuffp | 631 | drivers/cdrom/mcdx.c | if (jiffies - stuffp->ejected < ACLOSE_INHIBIT) return -EIO; |
stuffp | 632 | drivers/cdrom/mcdx.c | if (stuffp->autoclose) mcdx_closedoor(stuffp, 1); |
stuffp | 637 | drivers/cdrom/mcdx.c | if (stuffp->xxx) { |
stuffp | 645 | drivers/cdrom/mcdx.c | stuffp->audiostatus = CDROM_AUDIO_INVALID; |
stuffp | 650 | drivers/cdrom/mcdx.c | stuffp, &stuffp->multi, 6)) { |
stuffp | 652 | drivers/cdrom/mcdx.c | stuffp->autoclose = 0; |
stuffp | 656 | drivers/cdrom/mcdx.c | stuffp->autoclose = 1; |
stuffp | 659 | drivers/cdrom/mcdx.c | if (stuffp->multi.multi > 2) |
stuffp | 661 | drivers/cdrom/mcdx.c | stuffp->multi.multi)); |
stuffp | 665 | drivers/cdrom/mcdx.c | if (!stuffp->multi.multi) |
stuffp | 666 | drivers/cdrom/mcdx.c | stuffp->multi.msf_last.second = 2; |
stuffp | 669 | drivers/cdrom/mcdx.c | stuffp->multi.multi, |
stuffp | 670 | drivers/cdrom/mcdx.c | stuffp->multi.msf_last.minute, |
stuffp | 671 | drivers/cdrom/mcdx.c | stuffp->multi.msf_last.second, |
stuffp | 672 | drivers/cdrom/mcdx.c | stuffp->multi.msf_last.frame)); |
stuffp | 677 | drivers/cdrom/mcdx.c | if (-1 == mcdx_requesttocdata(stuffp, &stuffp->di, 1)) { |
stuffp | 679 | drivers/cdrom/mcdx.c | stuffp->lastsector = -1; |
stuffp | 683 | drivers/cdrom/mcdx.c | stuffp->lastsector = (CD_FRAMESIZE / 512) |
stuffp | 684 | drivers/cdrom/mcdx.c | * msf2log(&stuffp->di.msf_leadout) - 1; |
stuffp | 687 | drivers/cdrom/mcdx.c | stuffp->di.n_first, |
stuffp | 688 | drivers/cdrom/mcdx.c | stuffp->di.msf_first.minute, |
stuffp | 689 | drivers/cdrom/mcdx.c | stuffp->di.msf_first.second, |
stuffp | 690 | drivers/cdrom/mcdx.c | stuffp->di.msf_first.frame, |
stuffp | 691 | drivers/cdrom/mcdx.c | msf2log(&stuffp->di.msf_first))); |
stuffp | 693 | drivers/cdrom/mcdx.c | stuffp->di.n_last, |
stuffp | 694 | drivers/cdrom/mcdx.c | stuffp->di.msf_leadout.minute, |
stuffp | 695 | drivers/cdrom/mcdx.c | stuffp->di.msf_leadout.second, |
stuffp | 696 | drivers/cdrom/mcdx.c | stuffp->di.msf_leadout.frame, |
stuffp | 697 | drivers/cdrom/mcdx.c | msf2log(&stuffp->di.msf_leadout))); |
stuffp | 700 | drivers/cdrom/mcdx.c | if (stuffp->toc) { |
stuffp | 701 | drivers/cdrom/mcdx.c | TRACE((MALLOC, "open() free old toc @ %p\n", stuffp->toc)); |
stuffp | 702 | drivers/cdrom/mcdx.c | kfree(stuffp->toc); |
stuffp | 704 | drivers/cdrom/mcdx.c | stuffp->toc = NULL; |
stuffp | 708 | drivers/cdrom/mcdx.c | if (-1 == mcdx_config(stuffp, 1)) return -EIO; |
stuffp | 712 | drivers/cdrom/mcdx.c | WARN(("AAA %x AAA\n", stuffp->readcmd)); |
stuffp | 713 | drivers/cdrom/mcdx.c | if (stuffp->readerrs) stuffp->readcmd = READ1X; |
stuffp | 714 | drivers/cdrom/mcdx.c | else stuffp->readcmd = |
stuffp | 715 | drivers/cdrom/mcdx.c | stuffp->present | SINGLE ? READ1X : READ2X; |
stuffp | 716 | drivers/cdrom/mcdx.c | WARN(("XXX %x XXX\n", stuffp->readcmd)); |
stuffp | 720 | drivers/cdrom/mcdx.c | if (stuffp->lastsector >= 0) { |
stuffp | 725 | drivers/cdrom/mcdx.c | stuffp->xa = 0; |
stuffp | 726 | drivers/cdrom/mcdx.c | stuffp->audio = 0; |
stuffp | 730 | drivers/cdrom/mcdx.c | stuffp->introk = 1; |
stuffp | 733 | drivers/cdrom/mcdx.c | stuffp->xa ? "XA" : "normal")); |
stuffp | 736 | drivers/cdrom/mcdx.c | if (-1 == (ans = mcdx_setdatamode(stuffp, |
stuffp | 737 | drivers/cdrom/mcdx.c | stuffp->xa ? MODE2 : MODE1, 1))) { |
stuffp | 739 | drivers/cdrom/mcdx.c | stuffp->xa = 0; |
stuffp | 743 | drivers/cdrom/mcdx.c | if ((stuffp->audio = e_audio(ans))) break; |
stuffp | 745 | drivers/cdrom/mcdx.c | while (0 == (ans = mcdx_transfer(stuffp, buf, 0, 1))) |
stuffp | 749 | drivers/cdrom/mcdx.c | stuffp->xa = !stuffp->xa; |
stuffp | 755 | drivers/cdrom/mcdx.c | if (-1 == mcdx_setdrivemode(stuffp, |
stuffp | 756 | drivers/cdrom/mcdx.c | stuffp->xa ? RAW : COOKED, 1)) |
stuffp | 759 | drivers/cdrom/mcdx.c | if (stuffp->audio) { |
stuffp | 761 | drivers/cdrom/mcdx.c | } else if (stuffp->lastsector >= 0) { |
stuffp | 763 | drivers/cdrom/mcdx.c | stuffp->xa ? "XA / " : "", |
stuffp | 764 | drivers/cdrom/mcdx.c | stuffp->multi.multi ? "Multi Session" : "Single Session")); |
stuffp | 767 | drivers/cdrom/mcdx.c | stuffp->xxx = 0; |
stuffp | 771 | drivers/cdrom/mcdx.c | if (0 == stuffp->users && (-1 == mcdx_lockdoor(stuffp, 1, 1))) |
stuffp | 774 | drivers/cdrom/mcdx.c | stuffp->users++; |
stuffp | 782 | drivers/cdrom/mcdx.c | struct s_drive_stuff *stuffp; |
stuffp | 786 | drivers/cdrom/mcdx.c | stuffp = mcdx_stuffp[MINOR(ip->i_rdev)]; |
stuffp | 788 | drivers/cdrom/mcdx.c | if (0 == --stuffp->users) { |
stuffp | 796 | drivers/cdrom/mcdx.c | if (-1 == mcdx_lockdoor(stuffp, 0, 3)) |
stuffp | 799 | drivers/cdrom/mcdx.c | mcdx_lockdoor(stuffp, 0, 3); |
stuffp | 803 | drivers/cdrom/mcdx.c | if (stuffp->eject_sw) mcdx_eject(stuffp, 1); |
stuffp | 815 | drivers/cdrom/mcdx.c | struct s_drive_stuff *stuffp; |
stuffp | 820 | drivers/cdrom/mcdx.c | stuffp = mcdx_stuffp[MINOR(full_dev)]; |
stuffp | 821 | drivers/cdrom/mcdx.c | mcdx_getstatus(stuffp, 1); |
stuffp | 823 | drivers/cdrom/mcdx.c | if (stuffp->yyy == 0) { |
stuffp | 829 | drivers/cdrom/mcdx.c | stuffp->yyy = 0; |
stuffp | 870 | drivers/cdrom/mcdx.c | struct s_drive_stuff *stuffp; |
stuffp | 873 | drivers/cdrom/mcdx.c | stuffp = mcdx_irq_map[irq]; |
stuffp | 875 | drivers/cdrom/mcdx.c | if (stuffp == NULL ) { |
stuffp | 881 | drivers/cdrom/mcdx.c | b = inb((unsigned int) stuffp->rreg_status); |
stuffp | 882 | drivers/cdrom/mcdx.c | stuffp->introk = ~b & MCDX_RBIT_DTEN; |
stuffp | 890 | drivers/cdrom/mcdx.c | if (!stuffp->introk) { |
stuffp | 894 | drivers/cdrom/mcdx.c | irq, inb((unsigned int) stuffp->rreg_data))); |
stuffp | 902 | drivers/cdrom/mcdx.c | stuffp->busy = 0; |
stuffp | 903 | drivers/cdrom/mcdx.c | wake_up_interruptible(&stuffp->busyq); |
stuffp | 909 | drivers/cdrom/mcdx.c | struct s_drive_stuff *stuffp, |
stuffp | 926 | drivers/cdrom/mcdx.c | while (stuffp->lock) { |
stuffp | 927 | drivers/cdrom/mcdx.c | interruptible_sleep_on(&stuffp->lockq); |
stuffp | 929 | drivers/cdrom/mcdx.c | stuffp->lock)); |
stuffp | 932 | drivers/cdrom/mcdx.c | stuffp->lock = 1; |
stuffp | 933 | drivers/cdrom/mcdx.c | stuffp->valid = 0; |
stuffp | 952 | drivers/cdrom/mcdx.c | outsb((unsigned int) stuffp->wreg_data, cmd, cmdlen); |
stuffp | 956 | drivers/cdrom/mcdx.c | if (-1 == mcdx_getval(stuffp, timeout, 0, bp)) { |
stuffp | 976 | drivers/cdrom/mcdx.c | if (stuffp->audiostatus == CDROM_AUDIO_INVALID) |
stuffp | 977 | drivers/cdrom/mcdx.c | stuffp->audiostatus = |
stuffp | 979 | drivers/cdrom/mcdx.c | else if (stuffp->audiostatus == CDROM_AUDIO_PLAY |
stuffp | 981 | drivers/cdrom/mcdx.c | stuffp->audiostatus = CDROM_AUDIO_COMPLETED; |
stuffp | 986 | drivers/cdrom/mcdx.c | stuffp->xxx = stuffp->yyy = 1; |
stuffp | 991 | drivers/cdrom/mcdx.c | if (-1 == mcdx_getval(stuffp, timeout, -1, bp)) { |
stuffp | 1005 | drivers/cdrom/mcdx.c | stuffp->lock = 0; |
stuffp | 1006 | drivers/cdrom/mcdx.c | wake_up_interruptible(&stuffp->lockq); |
stuffp | 1043 | drivers/cdrom/mcdx.c | struct s_drive_stuff *stuffp; |
stuffp | 1044 | drivers/cdrom/mcdx.c | stuffp = mcdx_stuffp[i]; |
stuffp | 1045 | drivers/cdrom/mcdx.c | if (!stuffp) continue; |
stuffp | 1046 | drivers/cdrom/mcdx.c | release_region((unsigned long) stuffp->wreg_data, MCDX_IO_SIZE); |
stuffp | 1047 | drivers/cdrom/mcdx.c | free_irq(stuffp->irq, NULL); |
stuffp | 1048 | drivers/cdrom/mcdx.c | if (stuffp->toc) { |
stuffp | 1049 | drivers/cdrom/mcdx.c | TRACE((MALLOC, "cleanup_module() free toc @ %p\n", stuffp->toc)); |
stuffp | 1050 | drivers/cdrom/mcdx.c | kfree(stuffp->toc); |
stuffp | 1052 | drivers/cdrom/mcdx.c | TRACE((MALLOC, "cleanup_module() free stuffp @ %p\n", stuffp)); |
stuffp | 1054 | drivers/cdrom/mcdx.c | kfree(stuffp); |
stuffp | 1108 | drivers/cdrom/mcdx.c | struct s_drive_stuff* stuffp; |
stuffp | 1113 | drivers/cdrom/mcdx.c | size = sizeof(*stuffp); |
stuffp | 1119 | drivers/cdrom/mcdx.c | if (!(stuffp = kmalloc(size, GFP_KERNEL))) { |
stuffp | 1124 | drivers/cdrom/mcdx.c | TRACE((INIT, "init() got %d bytes for drive stuff @ %p\n", sizeof(*stuffp), stuffp)); |
stuffp | 1127 | drivers/cdrom/mcdx.c | memset(stuffp, 0, sizeof(*stuffp)); |
stuffp | 1128 | drivers/cdrom/mcdx.c | stuffp->autoclose = 1; /* close the door on open(2) */ |
stuffp | 1130 | drivers/cdrom/mcdx.c | stuffp->present = 0; /* this should be 0 already */ |
stuffp | 1131 | drivers/cdrom/mcdx.c | stuffp->toc = NULL; /* this should be NULL already */ |
stuffp | 1134 | drivers/cdrom/mcdx.c | stuffp->irq = irq(mcdx_drive_map[drive]); |
stuffp | 1135 | drivers/cdrom/mcdx.c | stuffp->wreg_data = stuffp->rreg_data = port(mcdx_drive_map[drive]); |
stuffp | 1136 | drivers/cdrom/mcdx.c | stuffp->wreg_reset = stuffp->rreg_status = stuffp->wreg_data + 1; |
stuffp | 1137 | drivers/cdrom/mcdx.c | stuffp->wreg_hcon = stuffp->wreg_reset + 1; |
stuffp | 1138 | drivers/cdrom/mcdx.c | stuffp->wreg_chn = stuffp->wreg_hcon + 1; |
stuffp | 1141 | drivers/cdrom/mcdx.c | if (0 != check_region((unsigned int) stuffp->wreg_data, MCDX_IO_SIZE)) { |
stuffp | 1144 | drivers/cdrom/mcdx.c | stuffp->wreg_data, stuffp->irq, |
stuffp | 1145 | drivers/cdrom/mcdx.c | stuffp->wreg_data, |
stuffp | 1146 | drivers/cdrom/mcdx.c | stuffp->wreg_data + MCDX_IO_SIZE - 1)); |
stuffp | 1147 | drivers/cdrom/mcdx.c | TRACE((MALLOC, "init() free stuffp @ %p\n", stuffp)); |
stuffp | 1148 | drivers/cdrom/mcdx.c | kfree(stuffp); |
stuffp | 1153 | drivers/cdrom/mcdx.c | TRACE((INIT, "init() i/o port is available at 0x%3p\n", stuffp->wreg_data)); |
stuffp | 1156 | drivers/cdrom/mcdx.c | mcdx_reset(stuffp, HARD, 1); |
stuffp | 1159 | drivers/cdrom/mcdx.c | if (-1 == mcdx_requestversion(stuffp, &version, 4)) { |
stuffp | 1163 | drivers/cdrom/mcdx.c | stuffp->wreg_data, stuffp->irq)); |
stuffp | 1164 | drivers/cdrom/mcdx.c | TRACE((MALLOC, "init() free stuffp @ %p\n", stuffp)); |
stuffp | 1165 | drivers/cdrom/mcdx.c | kfree(stuffp); |
stuffp | 1172 | drivers/cdrom/mcdx.c | stuffp->readcmd = READ2X; |
stuffp | 1173 | drivers/cdrom/mcdx.c | stuffp->present = DOUBLE | DOOR | MULTI; |
stuffp | 1176 | drivers/cdrom/mcdx.c | stuffp->readcmd = READ1X; |
stuffp | 1177 | drivers/cdrom/mcdx.c | stuffp->present = SINGLE | DOOR | MULTI; |
stuffp | 1180 | drivers/cdrom/mcdx.c | stuffp->readcmd = READ1X; |
stuffp | 1181 | drivers/cdrom/mcdx.c | stuffp->present = SINGLE; |
stuffp | 1184 | drivers/cdrom/mcdx.c | stuffp->present = 0; break; |
stuffp | 1187 | drivers/cdrom/mcdx.c | stuffp->playcmd = READ1X; |
stuffp | 1190 | drivers/cdrom/mcdx.c | if (!stuffp->present) { |
stuffp | 1192 | drivers/cdrom/mcdx.c | MCDX, stuffp->wreg_data, stuffp->irq)); |
stuffp | 1193 | drivers/cdrom/mcdx.c | kfree(stuffp); |
stuffp | 1201 | drivers/cdrom/mcdx.c | stuffp->wreg_data, stuffp->irq, MAJOR_NR)); |
stuffp | 1202 | drivers/cdrom/mcdx.c | kfree(stuffp); |
stuffp | 1212 | drivers/cdrom/mcdx.c | mcdx_irq_map[stuffp->irq] = stuffp; |
stuffp | 1213 | drivers/cdrom/mcdx.c | if (request_irq(stuffp->irq, mcdx_intr, SA_INTERRUPT, DEVICE_NAME, NULL)) { |
stuffp | 1216 | drivers/cdrom/mcdx.c | stuffp->wreg_data, stuffp->irq, stuffp->irq)); |
stuffp | 1217 | drivers/cdrom/mcdx.c | stuffp->irq = 0; |
stuffp | 1218 | drivers/cdrom/mcdx.c | kfree(stuffp); |
stuffp | 1221 | drivers/cdrom/mcdx.c | request_region((unsigned int) stuffp->wreg_data, |
stuffp | 1228 | drivers/cdrom/mcdx.c | mcdx_delay(stuffp, HZ/2); |
stuffp | 1229 | drivers/cdrom/mcdx.c | for (i = 100; i; i--) (void) inb((unsigned int) stuffp->rreg_status); |
stuffp | 1234 | drivers/cdrom/mcdx.c | outb(0x50, (unsigned int) stuffp->wreg_chn); /* irq 11 -> channel register */ |
stuffp | 1238 | drivers/cdrom/mcdx.c | mcdx_config(stuffp, 1); |
stuffp | 1240 | drivers/cdrom/mcdx.c | stuffp->minor = drive; |
stuffp | 1244 | drivers/cdrom/mcdx.c | stuffp->wreg_data, stuffp->irq, version.code, |
stuffp | 1246 | drivers/cdrom/mcdx.c | mcdx_stuffp[drive] = stuffp; |
stuffp | 1247 | drivers/cdrom/mcdx.c | TRACE((INIT, "init() mcdx_stuffp[%d] = %p\n", drive, stuffp)); |
stuffp | 1254 | drivers/cdrom/mcdx.c | mcdx_transfer(struct s_drive_stuff *stuffp, |
stuffp | 1264 | drivers/cdrom/mcdx.c | ans = mcdx_xfer(stuffp, p, sector, nr_sectors); |
stuffp | 1267 | drivers/cdrom/mcdx.c | if (-1 == ans) stuffp->readerrs++; |
stuffp | 1270 | drivers/cdrom/mcdx.c | if (stuffp->readerrs && stuffp->readcmd == READ1X) { |
stuffp | 1277 | drivers/cdrom/mcdx.c | stuffp->readcmd = READ1X; |
stuffp | 1278 | drivers/cdrom/mcdx.c | return mcdx_transfer(stuffp, p, sector, nr_sectors); |
stuffp | 1284 | drivers/cdrom/mcdx.c | static int mcdx_xfer(struct s_drive_stuff *stuffp, |
stuffp | 1296 | drivers/cdrom/mcdx.c | if (stuffp->audio) { |
stuffp | 1301 | drivers/cdrom/mcdx.c | while (stuffp->lock) { |
stuffp | 1302 | drivers/cdrom/mcdx.c | interruptible_sleep_on(&stuffp->lockq); |
stuffp | 1304 | drivers/cdrom/mcdx.c | stuffp->lock)); |
stuffp | 1307 | drivers/cdrom/mcdx.c | if (stuffp->valid |
stuffp | 1308 | drivers/cdrom/mcdx.c | && (sector >= stuffp->pending) |
stuffp | 1309 | drivers/cdrom/mcdx.c | && (sector < stuffp->off_direct)) { |
stuffp | 1312 | drivers/cdrom/mcdx.c | off = stuffp->off_requested < (off = sector + nr_sectors) |
stuffp | 1313 | drivers/cdrom/mcdx.c | ? stuffp->off_requested : off; |
stuffp | 1315 | drivers/cdrom/mcdx.c | stuffp->lock = current->pid; |
stuffp | 1323 | drivers/cdrom/mcdx.c | while (stuffp->introk && stuffp->busy && current->timeout) { |
stuffp | 1324 | drivers/cdrom/mcdx.c | interruptible_sleep_on(&stuffp->busyq); |
stuffp | 1326 | drivers/cdrom/mcdx.c | stuffp->busy, current->timeout)); |
stuffp | 1330 | drivers/cdrom/mcdx.c | if (current->timeout == 0 || !stuffp->introk) { |
stuffp | 1333 | drivers/cdrom/mcdx.c | } else if (!stuffp->introk) { |
stuffp | 1339 | drivers/cdrom/mcdx.c | stuffp->lock = 0; |
stuffp | 1340 | drivers/cdrom/mcdx.c | stuffp->busy = 0; |
stuffp | 1341 | drivers/cdrom/mcdx.c | stuffp->valid = 0; |
stuffp | 1343 | drivers/cdrom/mcdx.c | wake_up_interruptible(&stuffp->lockq); |
stuffp | 1350 | drivers/cdrom/mcdx.c | if (stuffp->xa && (0 == (stuffp->pending & 3))) { |
stuffp | 1353 | drivers/cdrom/mcdx.c | stuffp->pending, HEAD)); |
stuffp | 1354 | drivers/cdrom/mcdx.c | insb((unsigned int) stuffp->rreg_data, p, HEAD); |
stuffp | 1359 | drivers/cdrom/mcdx.c | TRACE((TRANSFER, "transfer() read sector %d\n", stuffp->pending)); |
stuffp | 1360 | drivers/cdrom/mcdx.c | insb((unsigned int) stuffp->rreg_data, p, 512); |
stuffp | 1365 | drivers/cdrom/mcdx.c | if ((stuffp->busy = (3 == (stuffp->pending & 3))) && stuffp->xa) { |
stuffp | 1368 | drivers/cdrom/mcdx.c | stuffp->pending, CD_XA_TAIL)); |
stuffp | 1369 | drivers/cdrom/mcdx.c | insb((unsigned int) stuffp->rreg_data, &dummy[0], CD_XA_TAIL); |
stuffp | 1372 | drivers/cdrom/mcdx.c | if (stuffp->pending == sector) { |
stuffp | 1377 | drivers/cdrom/mcdx.c | } while (++(stuffp->pending) < off); |
stuffp | 1379 | drivers/cdrom/mcdx.c | stuffp->lock = 0; |
stuffp | 1380 | drivers/cdrom/mcdx.c | wake_up_interruptible(&stuffp->lockq); |
stuffp | 1390 | drivers/cdrom/mcdx.c | cmd[0] = stuffp->readcmd; |
stuffp | 1392 | drivers/cdrom/mcdx.c | stuffp->valid = 1; |
stuffp | 1393 | drivers/cdrom/mcdx.c | stuffp->pending = sector & ~3; |
stuffp | 1396 | drivers/cdrom/mcdx.c | TRACE((TRANSFER, "transfer() request sector %d\n", stuffp->pending)); |
stuffp | 1397 | drivers/cdrom/mcdx.c | if (stuffp->pending > stuffp->lastsector) { |
stuffp | 1399 | drivers/cdrom/mcdx.c | stuffp->pending)); |
stuffp | 1400 | drivers/cdrom/mcdx.c | stuffp->status = MCDX_ST_EOM; |
stuffp | 1401 | drivers/cdrom/mcdx.c | stuffp->valid = 0; |
stuffp | 1406 | drivers/cdrom/mcdx.c | if ((stuffp->off_direct = stuffp->pending + DIRECT_SIZE) |
stuffp | 1407 | drivers/cdrom/mcdx.c | > stuffp->lastsector + 1) |
stuffp | 1408 | drivers/cdrom/mcdx.c | stuffp->off_direct = stuffp->lastsector + 1; |
stuffp | 1409 | drivers/cdrom/mcdx.c | if ((stuffp->off_requested = stuffp->pending + REQUEST_SIZE) |
stuffp | 1410 | drivers/cdrom/mcdx.c | > stuffp->lastsector + 1) |
stuffp | 1411 | drivers/cdrom/mcdx.c | stuffp->off_requested = stuffp->lastsector + 1; |
stuffp | 1413 | drivers/cdrom/mcdx.c | TRACE((TRANSFER, "transfer() pending %d\n", stuffp->pending)); |
stuffp | 1414 | drivers/cdrom/mcdx.c | TRACE((TRANSFER, "transfer() off_dir %d\n", stuffp->off_direct)); |
stuffp | 1415 | drivers/cdrom/mcdx.c | TRACE((TRANSFER, "transfer() off_req %d\n", stuffp->off_requested)); |
stuffp | 1419 | drivers/cdrom/mcdx.c | log2msf(stuffp->pending / 4, &pending); |
stuffp | 1425 | drivers/cdrom/mcdx.c | stuffp->busy = 1; |
stuffp | 1426 | drivers/cdrom/mcdx.c | cmd[6] = (unsigned char) (stuffp->off_requested - stuffp->pending) / 4; |
stuffp | 1428 | drivers/cdrom/mcdx.c | outsb((unsigned int) stuffp->wreg_data, cmd, sizeof cmd); |
stuffp | 1432 | drivers/cdrom/mcdx.c | stuffp->off_direct = (stuffp->off_direct += done) < stuffp->off_requested |
stuffp | 1433 | drivers/cdrom/mcdx.c | ? stuffp->off_direct : stuffp->off_requested; |
stuffp | 1469 | drivers/cdrom/mcdx.c | int mcdx_readtoc(struct s_drive_stuff* stuffp) |
stuffp | 1474 | drivers/cdrom/mcdx.c | if (stuffp->toc) { |
stuffp | 1480 | drivers/cdrom/mcdx.c | stuffp->di.n_last - stuffp->di.n_first + 1)); |
stuffp | 1482 | drivers/cdrom/mcdx.c | if (-1 == mcdx_hold(stuffp, 1)) return -1; |
stuffp | 1485 | drivers/cdrom/mcdx.c | if (-1 == mcdx_setdrivemode(stuffp, TOC, 1)) return -EIO; |
stuffp | 1490 | drivers/cdrom/mcdx.c | size = sizeof(struct s_subqcode) * (stuffp->di.n_last - stuffp->di.n_first + 2); |
stuffp | 1493 | drivers/cdrom/mcdx.c | stuffp->toc = kmalloc(size, GFP_KERNEL); |
stuffp | 1494 | drivers/cdrom/mcdx.c | if (!stuffp->toc) { |
stuffp | 1496 | drivers/cdrom/mcdx.c | mcdx_setdrivemode(stuffp, DATA, 1); |
stuffp | 1507 | drivers/cdrom/mcdx.c | trk < (stuffp->di.n_last - stuffp->di.n_first + 1); |
stuffp | 1509 | drivers/cdrom/mcdx.c | stuffp->toc[trk].index = 0; |
stuffp | 1515 | drivers/cdrom/mcdx.c | if (-1 == mcdx_requestsubqcode(stuffp, &q, 1)) { |
stuffp | 1516 | drivers/cdrom/mcdx.c | mcdx_setdrivemode(stuffp, DATA, 1); |
stuffp | 1523 | drivers/cdrom/mcdx.c | && (idx <= stuffp->di.n_last) |
stuffp | 1525 | drivers/cdrom/mcdx.c | && (stuffp->toc[idx - stuffp->di.n_first].index == 0)) { |
stuffp | 1526 | drivers/cdrom/mcdx.c | stuffp->toc[idx - stuffp->di.n_first] = q; |
stuffp | 1532 | drivers/cdrom/mcdx.c | memset(&stuffp->toc[stuffp->di.n_last - stuffp->di.n_first + 1], |
stuffp | 1533 | drivers/cdrom/mcdx.c | 0, sizeof(stuffp->toc[0])); |
stuffp | 1534 | drivers/cdrom/mcdx.c | stuffp->toc[stuffp->di.n_last - stuffp->di.n_first + 1].dt |
stuffp | 1535 | drivers/cdrom/mcdx.c | = stuffp->di.msf_leadout; |
stuffp | 1540 | drivers/cdrom/mcdx.c | if (-1 == mcdx_setdrivemode(stuffp, DATA, 2)) |
stuffp | 1546 | drivers/cdrom/mcdx.c | trk < (stuffp->di.n_last - stuffp->di.n_first + 2); |
stuffp | 1550 | drivers/cdrom/mcdx.c | trk + stuffp->di.n_first, |
stuffp | 1551 | drivers/cdrom/mcdx.c | stuffp->toc[trk].control, stuffp->toc[trk].tno, stuffp->toc[trk].index, |
stuffp | 1552 | drivers/cdrom/mcdx.c | stuffp->toc[trk].tt.minute, stuffp->toc[trk].tt.second, stuffp->toc[trk].tt.frame, |
stuffp | 1553 | drivers/cdrom/mcdx.c | stuffp->toc[trk].dt.minute, stuffp->toc[trk].dt.second, stuffp->toc[trk].dt.frame)); |
stuffp | 1561 | drivers/cdrom/mcdx.c | mcdx_playmsf(struct s_drive_stuff* stuffp, const struct cdrom_msf* msf) |
stuffp | 1567 | drivers/cdrom/mcdx.c | cmd[0] = stuffp->playcmd; |
stuffp | 1581 | drivers/cdrom/mcdx.c | outsb((unsigned int) stuffp->wreg_data, cmd, sizeof cmd); |
stuffp | 1583 | drivers/cdrom/mcdx.c | if (-1 == mcdx_getval(stuffp, 3 * HZ, 0, NULL)) { |
stuffp | 1588 | drivers/cdrom/mcdx.c | stuffp->audiostatus = CDROM_AUDIO_PLAY; |
stuffp | 1593 | drivers/cdrom/mcdx.c | mcdx_playtrk(struct s_drive_stuff* stuffp, const struct cdrom_ti* ti) |
stuffp | 1598 | drivers/cdrom/mcdx.c | if (-1 == mcdx_readtoc(stuffp)) return -1; |
stuffp | 1600 | drivers/cdrom/mcdx.c | if (ti) p = &stuffp->toc[ti->cdti_trk0 - stuffp->di.n_first]; |
stuffp | 1601 | drivers/cdrom/mcdx.c | else p = &stuffp->start; |
stuffp | 1608 | drivers/cdrom/mcdx.c | p = &stuffp->toc[ti->cdti_trk1 - stuffp->di.n_first + 1]; |
stuffp | 1609 | drivers/cdrom/mcdx.c | stuffp->stop = *p; |
stuffp | 1610 | drivers/cdrom/mcdx.c | } else p = &stuffp->stop; |
stuffp | 1616 | drivers/cdrom/mcdx.c | return mcdx_playmsf(stuffp, &msf); |
stuffp | 1623 | drivers/cdrom/mcdx.c | mcdx_closedoor(struct s_drive_stuff *stuffp, int tries) |
stuffp | 1625 | drivers/cdrom/mcdx.c | if (stuffp->present & DOOR) |
stuffp | 1626 | drivers/cdrom/mcdx.c | return mcdx_talk(stuffp, "\xf8", 1, NULL, 1, 5 * HZ, tries); |
stuffp | 1632 | drivers/cdrom/mcdx.c | mcdx_stop(struct s_drive_stuff *stuffp, int tries) |
stuffp | 1633 | drivers/cdrom/mcdx.c | { return mcdx_talk(stuffp, "\xf0", 1, NULL, 1, 2 * HZ, tries); } |
stuffp | 1636 | drivers/cdrom/mcdx.c | mcdx_hold(struct s_drive_stuff *stuffp, int tries) |
stuffp | 1637 | drivers/cdrom/mcdx.c | { return mcdx_talk(stuffp, "\x70", 1, NULL, 1, 2 * HZ, tries); } |
stuffp | 1640 | drivers/cdrom/mcdx.c | mcdx_eject(struct s_drive_stuff *stuffp, int tries) |
stuffp | 1642 | drivers/cdrom/mcdx.c | if (stuffp->present & DOOR) { |
stuffp | 1643 | drivers/cdrom/mcdx.c | stuffp->ejected = jiffies; |
stuffp | 1644 | drivers/cdrom/mcdx.c | return mcdx_talk(stuffp, "\xf6", 1, NULL, 1, 5 * HZ, tries); |
stuffp | 1649 | drivers/cdrom/mcdx.c | mcdx_requestsubqcode(struct s_drive_stuff *stuffp, |
stuffp | 1657 | drivers/cdrom/mcdx.c | stuffp, "\x20", 1, buf, sizeof(buf), |
stuffp | 1674 | drivers/cdrom/mcdx.c | mcdx_requestmultidiskinfo(struct s_drive_stuff *stuffp, struct s_multi *multi, int tries) |
stuffp | 1679 | drivers/cdrom/mcdx.c | if (stuffp->present & MULTI) { |
stuffp | 1680 | drivers/cdrom/mcdx.c | ans = mcdx_talk(stuffp, "\x11", 1, buf, sizeof(buf), 1 * HZ, tries); |
stuffp | 1693 | drivers/cdrom/mcdx.c | mcdx_requesttocdata(struct s_drive_stuff *stuffp, struct s_diskinfo *info, int tries) |
stuffp | 1697 | drivers/cdrom/mcdx.c | ans = mcdx_talk(stuffp, "\x10", 1, buf, sizeof(buf), 1 * HZ, tries); |
stuffp | 1715 | drivers/cdrom/mcdx.c | mcdx_setdrivemode(struct s_drive_stuff *stuffp, enum drivemodes mode, int tries) |
stuffp | 1722 | drivers/cdrom/mcdx.c | if (-1 == (ans = mcdx_talk(stuffp, "\xc2", 1, cmd, sizeof(cmd), 5 * HZ, tries))) |
stuffp | 1733 | drivers/cdrom/mcdx.c | return mcdx_talk(stuffp, cmd, 2, NULL, 1, 5 * HZ, tries); |
stuffp | 1737 | drivers/cdrom/mcdx.c | mcdx_setdatamode(struct s_drive_stuff *stuffp, enum datamodes mode, int tries) |
stuffp | 1747 | drivers/cdrom/mcdx.c | return mcdx_talk(stuffp, cmd, 2, NULL, 1, 5 * HZ, tries); |
stuffp | 1751 | drivers/cdrom/mcdx.c | mcdx_config(struct s_drive_stuff *stuffp, int tries) |
stuffp | 1762 | drivers/cdrom/mcdx.c | if (-1 == mcdx_talk(stuffp, cmd, 3, NULL, 1, 1 * HZ, tries)) |
stuffp | 1768 | drivers/cdrom/mcdx.c | return mcdx_talk(stuffp, cmd, 3, NULL, 1, 1 * HZ, tries); |
stuffp | 1772 | drivers/cdrom/mcdx.c | mcdx_requestversion(struct s_drive_stuff *stuffp, struct s_version *ver, int tries) |
stuffp | 1777 | drivers/cdrom/mcdx.c | if (-1 == (ans = mcdx_talk(stuffp, "\xdc", |
stuffp | 1788 | drivers/cdrom/mcdx.c | mcdx_reset(struct s_drive_stuff *stuffp, enum resetmodes mode, int tries) |
stuffp | 1791 | drivers/cdrom/mcdx.c | outb(0, (unsigned int) stuffp->wreg_chn); /* no dma, no irq -> hardware */ |
stuffp | 1792 | drivers/cdrom/mcdx.c | outb(0, (unsigned int) stuffp->wreg_reset); /* hw reset */ |
stuffp | 1794 | drivers/cdrom/mcdx.c | } else return mcdx_talk(stuffp, "\x60", 1, NULL, 1, 5 * HZ, tries); |
stuffp | 1798 | drivers/cdrom/mcdx.c | mcdx_lockdoor(struct s_drive_stuff *stuffp, int lock, int tries) |
stuffp | 1801 | drivers/cdrom/mcdx.c | if (stuffp->present & DOOR) { |
stuffp | 1803 | drivers/cdrom/mcdx.c | return mcdx_talk(stuffp, cmd, sizeof(cmd), NULL, 1, 5 * HZ, tries); |
stuffp | 1808 | drivers/cdrom/mcdx.c | mcdx_getstatus(struct s_drive_stuff *stuffp, int tries) |
stuffp | 1809 | drivers/cdrom/mcdx.c | { return mcdx_talk(stuffp, "\x40", 1, NULL, 1, 5 * HZ, tries); } |
stuffp | 1812 | drivers/cdrom/mcdx.c | mcdx_getval(struct s_drive_stuff *stuffp, int to, int delay, char* buf) |
stuffp | 1819 | drivers/cdrom/mcdx.c | while (inb((unsigned int) stuffp->rreg_status) & MCDX_RBIT_STEN) { |
stuffp | 1821 | drivers/cdrom/mcdx.c | mcdx_delay(stuffp, delay); |
stuffp | 1824 | drivers/cdrom/mcdx.c | *buf = (unsigned char) inb((unsigned int) stuffp->rreg_data) & 0xff; |
stuffp | 1831 | drivers/cdrom/mcdx.c | struct s_drive_stuff* stuffp, |
stuffp | 1842 | drivers/cdrom/mcdx.c | return mcdx_talk(stuffp, cmd, sizeof(cmd), NULL, 5, 200, tries); |