tag | line | file | source code |
stuffp | 281 | drivers/cdrom/mcdx.c | struct s_drive_stuff *stuffp = mcdx_stuffp[MINOR(ip->i_rdev)]; |
stuffp | 283 | drivers/cdrom/mcdx.c | if (!stuffp->present) return -ENXIO; |
stuffp | 294 | drivers/cdrom/mcdx.c | stuffp->audiostatus = CDROM_AUDIO_INVALID; |
stuffp | 295 | drivers/cdrom/mcdx.c | if (-1 == mcdx_stop(stuffp, 1)) |
stuffp | 308 | drivers/cdrom/mcdx.c | if ((ti.cdti_trk0 < stuffp->di.n_first) |
stuffp | 309 | drivers/cdrom/mcdx.c | || (ti.cdti_trk0 > stuffp->di.n_last) |
stuffp | 310 | drivers/cdrom/mcdx.c | || (ti.cdti_trk1 < stuffp->di.n_first)) |
stuffp | 312 | drivers/cdrom/mcdx.c | if (ti.cdti_trk1 > stuffp->di.n_last) ti.cdti_trk1 = stuffp->di.n_last; |
stuffp | 315 | drivers/cdrom/mcdx.c | return mcdx_playtrk(stuffp, &ti); |
stuffp | 324 | drivers/cdrom/mcdx.c | if ((stuffp->audiostatus == CDROM_AUDIO_PLAY) |
stuffp | 325 | drivers/cdrom/mcdx.c | && (-1 == mcdx_hold(stuffp, 1))) return -EIO; |
stuffp | 341 | drivers/cdrom/mcdx.c | return mcdx_playmsf(stuffp, &msf); |
stuffp | 346 | drivers/cdrom/mcdx.c | return mcdx_playtrk(stuffp, NULL); |
stuffp | 356 | drivers/cdrom/mcdx.c | if (-1 == mcdx_readtoc(stuffp)) return -1; |
stuffp | 362 | drivers/cdrom/mcdx.c | tp = &stuffp->toc[stuffp->di.n_last - stuffp->di.n_first + 1]; |
stuffp | 363 | drivers/cdrom/mcdx.c | else if (entry.cdte_track > stuffp->di.n_last |
stuffp | 364 | drivers/cdrom/mcdx.c | || entry.cdte_track < stuffp->di.n_first) return -EINVAL; |
stuffp | 365 | drivers/cdrom/mcdx.c | else tp = &stuffp->toc[entry.cdte_track - stuffp->di.n_first]; |
stuffp | 398 | drivers/cdrom/mcdx.c | if (-1 == mcdx_requestsubqcode(stuffp, &q, 2)) return -EIO; |
stuffp | 400 | drivers/cdrom/mcdx.c | TRACE((SUBCHNL, "audiostatus: %x\n", stuffp->audiostatus)); |
stuffp | 401 | drivers/cdrom/mcdx.c | sub.cdsc_audiostatus = stuffp->audiostatus; |
stuffp | 447 | drivers/cdrom/mcdx.c | toc.cdth_trk0 = stuffp->di.n_first; |
stuffp | 448 | drivers/cdrom/mcdx.c | toc.cdth_trk1 = stuffp->di.n_last; |
stuffp | 451 | drivers/cdrom/mcdx.c | stuffp->di.n_first, stuffp->di.n_last)); |
stuffp | 457 | drivers/cdrom/mcdx.c | if (stuffp->audiostatus != CDROM_AUDIO_PLAY) return -EINVAL; |
stuffp | 458 | drivers/cdrom/mcdx.c | if (-1 == mcdx_stop(stuffp, 1)) return -EIO; |
stuffp | 459 | drivers/cdrom/mcdx.c | stuffp->audiostatus = CDROM_AUDIO_PAUSED; |
stuffp | 460 | drivers/cdrom/mcdx.c | if (-1 == mcdx_requestsubqcode(stuffp, &stuffp->start, 1)) |
stuffp | 475 | drivers/cdrom/mcdx.c | ms.addr.msf.minute = bcd2uint(stuffp->multi.msf_last.minute); |
stuffp | 476 | drivers/cdrom/mcdx.c | ms.addr.msf.second = bcd2uint(stuffp->multi.msf_last.second); |
stuffp | 477 | drivers/cdrom/mcdx.c | ms.addr.msf.frame = bcd2uint(stuffp->multi.msf_last.frame); |
stuffp | 479 | drivers/cdrom/mcdx.c | ms.addr.lba = msf2log(&stuffp->multi.msf_last); |
stuffp | 482 | drivers/cdrom/mcdx.c | ms.xa_flag = !!stuffp->multi.multi; |
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 | stuffp->multi.msf_last.minute, |
stuffp | 506 | drivers/cdrom/mcdx.c | stuffp->multi.msf_last.second, |
stuffp | 507 | drivers/cdrom/mcdx.c | stuffp->multi.msf_last.frame)); |
stuffp | 514 | drivers/cdrom/mcdx.c | if (stuffp->users > 1) return -EBUSY; |
stuffp | 515 | drivers/cdrom/mcdx.c | if (-1 == mcdx_eject(stuffp, 1)) return -EIO; |
stuffp | 520 | drivers/cdrom/mcdx.c | stuffp->eject_sw = arg; |
stuffp | 536 | drivers/cdrom/mcdx.c | return mcdx_setattentuator(stuffp, &volctrl, 1); |
stuffp | 548 | drivers/cdrom/mcdx.c | struct s_drive_stuff *stuffp; |
stuffp | 559 | drivers/cdrom/mcdx.c | stuffp = mcdx_stuffp[MINOR(CURRENT->rq_dev)]; |
stuffp | 560 | drivers/cdrom/mcdx.c | TRACE((REQUEST, "do_request() stuffp = %p\n", stuffp)); |
stuffp | 565 | drivers/cdrom/mcdx.c | if ((dev < 0) || (dev >= MCDX_NDRIVES) || (!stuffp->present)) { |
stuffp | 572 | drivers/cdrom/mcdx.c | if (stuffp->audio) { |
stuffp | 585 | drivers/cdrom/mcdx.c | stuffp->status = 0; |
stuffp | 590 | drivers/cdrom/mcdx.c | stuffp, |
stuffp | 596 | drivers/cdrom/mcdx.c | if (stuffp->status & MCDX_ST_EOM) { |
stuffp | 626 | drivers/cdrom/mcdx.c | struct s_drive_stuff *stuffp; |
stuffp | 629 | drivers/cdrom/mcdx.c | stuffp = mcdx_stuffp[MINOR(ip->i_rdev)]; |
stuffp | 630 | drivers/cdrom/mcdx.c | if (!stuffp->present) return -ENXIO; |
stuffp | 633 | drivers/cdrom/mcdx.c | if (-1 == mcdx_getstatus(stuffp, 1)) return -EIO; |
stuffp | 640 | drivers/cdrom/mcdx.c | if (inb((unsigned int) stuffp->rreg_status) & MCDX_RBIT_DOOR) { |
stuffp | 641 | drivers/cdrom/mcdx.c | if (jiffies - stuffp->ejected < ACLOSE_INHIBIT) return -EIO; |
stuffp | 642 | drivers/cdrom/mcdx.c | if (stuffp->autoclose) mcdx_closedoor(stuffp, 1); |
stuffp | 647 | drivers/cdrom/mcdx.c | if (stuffp->xxx) { |
stuffp | 655 | drivers/cdrom/mcdx.c | stuffp->audiostatus = CDROM_AUDIO_INVALID; |
stuffp | 660 | drivers/cdrom/mcdx.c | stuffp, &stuffp->multi, 6)) { |
stuffp | 662 | drivers/cdrom/mcdx.c | stuffp->autoclose = 0; |
stuffp | 666 | drivers/cdrom/mcdx.c | stuffp->autoclose = 1; |
stuffp | 669 | drivers/cdrom/mcdx.c | if (stuffp->multi.multi > 2) |
stuffp | 671 | drivers/cdrom/mcdx.c | stuffp->multi.multi)); |
stuffp | 675 | drivers/cdrom/mcdx.c | if (!stuffp->multi.multi) |
stuffp | 676 | drivers/cdrom/mcdx.c | stuffp->multi.msf_last.second = 2; |
stuffp | 679 | drivers/cdrom/mcdx.c | stuffp->multi.multi, |
stuffp | 680 | drivers/cdrom/mcdx.c | stuffp->multi.msf_last.minute, |
stuffp | 681 | drivers/cdrom/mcdx.c | stuffp->multi.msf_last.second, |
stuffp | 682 | drivers/cdrom/mcdx.c | stuffp->multi.msf_last.frame)); |
stuffp | 687 | drivers/cdrom/mcdx.c | if (-1 == mcdx_requesttocdata(stuffp, &stuffp->di, 1)) { |
stuffp | 689 | drivers/cdrom/mcdx.c | stuffp->lastsector = -1; |
stuffp | 693 | drivers/cdrom/mcdx.c | stuffp->lastsector = (CD_FRAMESIZE / 512) |
stuffp | 694 | drivers/cdrom/mcdx.c | * msf2log(&stuffp->di.msf_leadout) - 1; |
stuffp | 697 | drivers/cdrom/mcdx.c | stuffp->di.n_first, |
stuffp | 698 | drivers/cdrom/mcdx.c | stuffp->di.msf_first.minute, |
stuffp | 699 | drivers/cdrom/mcdx.c | stuffp->di.msf_first.second, |
stuffp | 700 | drivers/cdrom/mcdx.c | stuffp->di.msf_first.frame, |
stuffp | 701 | drivers/cdrom/mcdx.c | msf2log(&stuffp->di.msf_first))); |
stuffp | 703 | drivers/cdrom/mcdx.c | stuffp->di.n_last, |
stuffp | 704 | drivers/cdrom/mcdx.c | stuffp->di.msf_leadout.minute, |
stuffp | 705 | drivers/cdrom/mcdx.c | stuffp->di.msf_leadout.second, |
stuffp | 706 | drivers/cdrom/mcdx.c | stuffp->di.msf_leadout.frame, |
stuffp | 707 | drivers/cdrom/mcdx.c | msf2log(&stuffp->di.msf_leadout))); |
stuffp | 710 | drivers/cdrom/mcdx.c | if (stuffp->toc) { |
stuffp | 711 | drivers/cdrom/mcdx.c | TRACE((MALLOC, "open() free old toc @ %p\n", stuffp->toc)); |
stuffp | 712 | drivers/cdrom/mcdx.c | kfree(stuffp->toc); |
stuffp | 714 | drivers/cdrom/mcdx.c | stuffp->toc = NULL; |
stuffp | 718 | drivers/cdrom/mcdx.c | if (-1 == mcdx_config(stuffp, 1)) return -EIO; |
stuffp | 722 | drivers/cdrom/mcdx.c | WARN(("AAA %x AAA\n", stuffp->readcmd)); |
stuffp | 723 | drivers/cdrom/mcdx.c | if (stuffp->readerrs) stuffp->readcmd = READ1X; |
stuffp | 724 | drivers/cdrom/mcdx.c | else stuffp->readcmd = |
stuffp | 725 | drivers/cdrom/mcdx.c | stuffp->present | SINGLE ? READ1X : READ2X; |
stuffp | 726 | drivers/cdrom/mcdx.c | WARN(("XXX %x XXX\n", stuffp->readcmd)); |
stuffp | 730 | drivers/cdrom/mcdx.c | if (stuffp->lastsector >= 0) { |
stuffp | 735 | drivers/cdrom/mcdx.c | stuffp->xa = 0; |
stuffp | 736 | drivers/cdrom/mcdx.c | stuffp->audio = 0; |
stuffp | 740 | drivers/cdrom/mcdx.c | stuffp->introk = 1; |
stuffp | 743 | drivers/cdrom/mcdx.c | stuffp->xa ? "XA" : "normal")); |
stuffp | 746 | drivers/cdrom/mcdx.c | if (-1 == (ans = mcdx_setdatamode(stuffp, |
stuffp | 747 | drivers/cdrom/mcdx.c | stuffp->xa ? MODE2 : MODE1, 1))) { |
stuffp | 749 | drivers/cdrom/mcdx.c | stuffp->xa = 0; |
stuffp | 753 | drivers/cdrom/mcdx.c | if ((stuffp->audio = e_audio(ans))) break; |
stuffp | 755 | drivers/cdrom/mcdx.c | while (0 == (ans = mcdx_transfer(stuffp, buf, 0, 1))) |
stuffp | 759 | drivers/cdrom/mcdx.c | stuffp->xa = !stuffp->xa; |
stuffp | 765 | drivers/cdrom/mcdx.c | if (-1 == mcdx_setdrivemode(stuffp, |
stuffp | 766 | drivers/cdrom/mcdx.c | stuffp->xa ? RAW : COOKED, 1)) |
stuffp | 769 | drivers/cdrom/mcdx.c | if (stuffp->audio) { |
stuffp | 771 | drivers/cdrom/mcdx.c | } else if (stuffp->lastsector >= 0) { |
stuffp | 773 | drivers/cdrom/mcdx.c | stuffp->xa ? "XA / " : "", |
stuffp | 774 | drivers/cdrom/mcdx.c | stuffp->multi.multi ? "Multi Session" : "Single Session")); |
stuffp | 777 | drivers/cdrom/mcdx.c | stuffp->xxx = 0; |
stuffp | 781 | drivers/cdrom/mcdx.c | if (0 == stuffp->users && (-1 == mcdx_lockdoor(stuffp, 1, 1))) |
stuffp | 784 | drivers/cdrom/mcdx.c | stuffp->users++; |
stuffp | 792 | drivers/cdrom/mcdx.c | struct s_drive_stuff *stuffp; |
stuffp | 796 | drivers/cdrom/mcdx.c | stuffp = mcdx_stuffp[MINOR(ip->i_rdev)]; |
stuffp | 798 | drivers/cdrom/mcdx.c | if (0 == --stuffp->users) { |
stuffp | 806 | drivers/cdrom/mcdx.c | if (-1 == mcdx_lockdoor(stuffp, 0, 3)) |
stuffp | 809 | drivers/cdrom/mcdx.c | mcdx_lockdoor(stuffp, 0, 3); |
stuffp | 813 | drivers/cdrom/mcdx.c | if (stuffp->eject_sw) mcdx_eject(stuffp, 1); |
stuffp | 825 | drivers/cdrom/mcdx.c | struct s_drive_stuff *stuffp; |
stuffp | 830 | drivers/cdrom/mcdx.c | stuffp = mcdx_stuffp[MINOR(full_dev)]; |
stuffp | 831 | drivers/cdrom/mcdx.c | mcdx_getstatus(stuffp, 1); |
stuffp | 833 | drivers/cdrom/mcdx.c | if (stuffp->yyy == 0) return 0; |
stuffp | 835 | drivers/cdrom/mcdx.c | stuffp->yyy = 0; |
stuffp | 876 | drivers/cdrom/mcdx.c | struct s_drive_stuff *stuffp; |
stuffp | 879 | drivers/cdrom/mcdx.c | stuffp = mcdx_irq_map[irq]; |
stuffp | 881 | drivers/cdrom/mcdx.c | if (stuffp == NULL ) { |
stuffp | 887 | drivers/cdrom/mcdx.c | b = inb((unsigned int) stuffp->rreg_status); |
stuffp | 888 | drivers/cdrom/mcdx.c | stuffp->introk = ~b & MCDX_RBIT_DTEN; |
stuffp | 896 | drivers/cdrom/mcdx.c | if (!stuffp->introk) { |
stuffp | 900 | drivers/cdrom/mcdx.c | irq, inb((unsigned int) stuffp->rreg_data)); |
stuffp | 908 | drivers/cdrom/mcdx.c | stuffp->busy = 0; |
stuffp | 909 | drivers/cdrom/mcdx.c | wake_up_interruptible(&stuffp->busyq); |
stuffp | 915 | drivers/cdrom/mcdx.c | struct s_drive_stuff *stuffp, |
stuffp | 932 | drivers/cdrom/mcdx.c | while (stuffp->lock) { |
stuffp | 933 | drivers/cdrom/mcdx.c | interruptible_sleep_on(&stuffp->lockq); |
stuffp | 935 | drivers/cdrom/mcdx.c | stuffp->lock)); |
stuffp | 938 | drivers/cdrom/mcdx.c | stuffp->lock = 1; |
stuffp | 939 | drivers/cdrom/mcdx.c | stuffp->valid = 0; |
stuffp | 958 | drivers/cdrom/mcdx.c | outsb((unsigned int) stuffp->wreg_data, cmd, cmdlen); |
stuffp | 962 | drivers/cdrom/mcdx.c | if (-1 == mcdx_getval(stuffp, timeout, 0, bp)) { |
stuffp | 982 | drivers/cdrom/mcdx.c | if (stuffp->audiostatus == CDROM_AUDIO_INVALID) |
stuffp | 983 | drivers/cdrom/mcdx.c | stuffp->audiostatus = |
stuffp | 985 | drivers/cdrom/mcdx.c | else if (stuffp->audiostatus == CDROM_AUDIO_PLAY |
stuffp | 987 | drivers/cdrom/mcdx.c | stuffp->audiostatus = CDROM_AUDIO_COMPLETED; |
stuffp | 992 | drivers/cdrom/mcdx.c | stuffp->xxx = stuffp->yyy = 1; |
stuffp | 997 | drivers/cdrom/mcdx.c | if (-1 == mcdx_getval(stuffp, timeout, 0, bp)) { |
stuffp | 1011 | drivers/cdrom/mcdx.c | stuffp->lock = 0; |
stuffp | 1012 | drivers/cdrom/mcdx.c | wake_up_interruptible(&stuffp->lockq); |
stuffp | 1049 | drivers/cdrom/mcdx.c | struct s_drive_stuff *stuffp; |
stuffp | 1050 | drivers/cdrom/mcdx.c | stuffp = mcdx_stuffp[i]; |
stuffp | 1051 | drivers/cdrom/mcdx.c | if (!stuffp) continue; |
stuffp | 1052 | drivers/cdrom/mcdx.c | release_region((unsigned long) stuffp->wreg_data, MCDX_IO_SIZE); |
stuffp | 1053 | drivers/cdrom/mcdx.c | free_irq(stuffp->irq, NULL); |
stuffp | 1054 | drivers/cdrom/mcdx.c | if (stuffp->toc) { |
stuffp | 1055 | drivers/cdrom/mcdx.c | TRACE((MALLOC, "cleanup_module() free toc @ %p\n", stuffp->toc)); |
stuffp | 1056 | drivers/cdrom/mcdx.c | kfree(stuffp->toc); |
stuffp | 1058 | drivers/cdrom/mcdx.c | TRACE((MALLOC, "cleanup_module() free stuffp @ %p\n", stuffp)); |
stuffp | 1060 | drivers/cdrom/mcdx.c | kfree(stuffp); |
stuffp | 1119 | drivers/cdrom/mcdx.c | struct s_drive_stuff* stuffp; |
stuffp | 1124 | drivers/cdrom/mcdx.c | size = sizeof(*stuffp); |
stuffp | 1130 | drivers/cdrom/mcdx.c | if (!(stuffp = kmalloc(size, GFP_KERNEL))) { |
stuffp | 1135 | drivers/cdrom/mcdx.c | TRACE((INIT, "init() got %d bytes for drive stuff @ %p\n", sizeof(*stuffp), stuffp)); |
stuffp | 1138 | drivers/cdrom/mcdx.c | memset(stuffp, 0, sizeof(*stuffp)); |
stuffp | 1139 | drivers/cdrom/mcdx.c | stuffp->autoclose = 1; /* close the door on open(2) */ |
stuffp | 1141 | drivers/cdrom/mcdx.c | stuffp->present = 0; /* this should be 0 already */ |
stuffp | 1142 | drivers/cdrom/mcdx.c | stuffp->toc = NULL; /* this should be NULL already */ |
stuffp | 1145 | drivers/cdrom/mcdx.c | stuffp->irq = irq(mcdx_drive_map[drive]); |
stuffp | 1146 | drivers/cdrom/mcdx.c | stuffp->wreg_data = stuffp->rreg_data = port(mcdx_drive_map[drive]); |
stuffp | 1147 | drivers/cdrom/mcdx.c | stuffp->wreg_reset = stuffp->rreg_status = stuffp->wreg_data + 1; |
stuffp | 1148 | drivers/cdrom/mcdx.c | stuffp->wreg_hcon = stuffp->wreg_reset + 1; |
stuffp | 1149 | drivers/cdrom/mcdx.c | stuffp->wreg_chn = stuffp->wreg_hcon + 1; |
stuffp | 1152 | drivers/cdrom/mcdx.c | if (0 != check_region((unsigned int) stuffp->wreg_data, MCDX_IO_SIZE)) { |
stuffp | 1155 | drivers/cdrom/mcdx.c | stuffp->wreg_data, stuffp->irq, |
stuffp | 1156 | drivers/cdrom/mcdx.c | stuffp->wreg_data, |
stuffp | 1157 | drivers/cdrom/mcdx.c | stuffp->wreg_data + MCDX_IO_SIZE - 1)); |
stuffp | 1158 | drivers/cdrom/mcdx.c | TRACE((MALLOC, "init() free stuffp @ %p\n", stuffp)); |
stuffp | 1159 | drivers/cdrom/mcdx.c | kfree(stuffp); |
stuffp | 1164 | drivers/cdrom/mcdx.c | TRACE((INIT, "init() i/o port is available at 0x%3p\n", stuffp->wreg_data)); |
stuffp | 1167 | drivers/cdrom/mcdx.c | mcdx_reset(stuffp, HARD, 1); |
stuffp | 1170 | drivers/cdrom/mcdx.c | if (-1 == mcdx_requestversion(stuffp, &version, 4)) { |
stuffp | 1174 | drivers/cdrom/mcdx.c | stuffp->wreg_data, stuffp->irq)); |
stuffp | 1175 | drivers/cdrom/mcdx.c | TRACE((MALLOC, "init() free stuffp @ %p\n", stuffp)); |
stuffp | 1176 | drivers/cdrom/mcdx.c | kfree(stuffp); |
stuffp | 1183 | drivers/cdrom/mcdx.c | stuffp->readcmd = READ2X; |
stuffp | 1184 | drivers/cdrom/mcdx.c | stuffp->present = DOUBLE | DOOR | MULTI; |
stuffp | 1187 | drivers/cdrom/mcdx.c | stuffp->readcmd = READ1X; |
stuffp | 1188 | drivers/cdrom/mcdx.c | stuffp->present = SINGLE | DOOR | MULTI; |
stuffp | 1191 | drivers/cdrom/mcdx.c | stuffp->readcmd = READ1X; |
stuffp | 1192 | drivers/cdrom/mcdx.c | stuffp->present = SINGLE; |
stuffp | 1195 | drivers/cdrom/mcdx.c | stuffp->present = 0; break; |
stuffp | 1198 | drivers/cdrom/mcdx.c | stuffp->playcmd = READ1X; |
stuffp | 1201 | drivers/cdrom/mcdx.c | if (!stuffp->present) { |
stuffp | 1203 | drivers/cdrom/mcdx.c | MCDX, stuffp->wreg_data, stuffp->irq)); |
stuffp | 1204 | drivers/cdrom/mcdx.c | kfree(stuffp); |
stuffp | 1212 | drivers/cdrom/mcdx.c | stuffp->wreg_data, stuffp->irq, MAJOR_NR)); |
stuffp | 1213 | drivers/cdrom/mcdx.c | kfree(stuffp); |
stuffp | 1223 | drivers/cdrom/mcdx.c | mcdx_irq_map[stuffp->irq] = stuffp; |
stuffp | 1224 | drivers/cdrom/mcdx.c | if (request_irq(stuffp->irq, mcdx_intr, SA_INTERRUPT, DEVICE_NAME, NULL)) { |
stuffp | 1227 | drivers/cdrom/mcdx.c | stuffp->wreg_data, stuffp->irq, stuffp->irq)); |
stuffp | 1228 | drivers/cdrom/mcdx.c | stuffp->irq = 0; |
stuffp | 1229 | drivers/cdrom/mcdx.c | kfree(stuffp); |
stuffp | 1232 | drivers/cdrom/mcdx.c | request_region((unsigned int) stuffp->wreg_data, |
stuffp | 1239 | drivers/cdrom/mcdx.c | mcdx_delay(stuffp, HZ/2); |
stuffp | 1240 | drivers/cdrom/mcdx.c | for (i = 100; i; i--) (void) inb((unsigned int) stuffp->rreg_status); |
stuffp | 1245 | drivers/cdrom/mcdx.c | outb(0x50, (unsigned int) stuffp->wreg_chn); /* irq 11 -> channel register */ |
stuffp | 1249 | drivers/cdrom/mcdx.c | mcdx_config(stuffp, 1); |
stuffp | 1251 | drivers/cdrom/mcdx.c | stuffp->minor = drive; |
stuffp | 1255 | drivers/cdrom/mcdx.c | stuffp->wreg_data, stuffp->irq, version.code, |
stuffp | 1257 | drivers/cdrom/mcdx.c | mcdx_stuffp[drive] = stuffp; |
stuffp | 1258 | drivers/cdrom/mcdx.c | TRACE((INIT, "init() mcdx_stuffp[%d] = %p\n", drive, stuffp)); |
stuffp | 1265 | drivers/cdrom/mcdx.c | mcdx_transfer(struct s_drive_stuff *stuffp, |
stuffp | 1275 | drivers/cdrom/mcdx.c | ans = mcdx_xfer(stuffp, p, sector, nr_sectors); |
stuffp | 1278 | drivers/cdrom/mcdx.c | if (-1 == ans) stuffp->readerrs++; |
stuffp | 1281 | drivers/cdrom/mcdx.c | if (stuffp->readerrs && stuffp->readcmd == READ1X) { |
stuffp | 1288 | drivers/cdrom/mcdx.c | stuffp->readcmd = READ1X; |
stuffp | 1289 | drivers/cdrom/mcdx.c | return mcdx_transfer(stuffp, p, sector, nr_sectors); |
stuffp | 1295 | drivers/cdrom/mcdx.c | static int mcdx_xfer(struct s_drive_stuff *stuffp, |
stuffp | 1307 | drivers/cdrom/mcdx.c | if (stuffp->audio) { |
stuffp | 1312 | drivers/cdrom/mcdx.c | while (stuffp->lock) { |
stuffp | 1313 | drivers/cdrom/mcdx.c | interruptible_sleep_on(&stuffp->lockq); |
stuffp | 1315 | drivers/cdrom/mcdx.c | stuffp->lock)); |
stuffp | 1318 | drivers/cdrom/mcdx.c | if (stuffp->valid |
stuffp | 1319 | drivers/cdrom/mcdx.c | && (sector >= stuffp->pending) |
stuffp | 1320 | drivers/cdrom/mcdx.c | && (sector < stuffp->off_direct)) { |
stuffp | 1323 | drivers/cdrom/mcdx.c | off = stuffp->off_requested < (off = sector + nr_sectors) |
stuffp | 1324 | drivers/cdrom/mcdx.c | ? stuffp->off_requested : off; |
stuffp | 1326 | drivers/cdrom/mcdx.c | stuffp->lock = current->pid; |
stuffp | 1334 | drivers/cdrom/mcdx.c | while (stuffp->introk && stuffp->busy && current->timeout) { |
stuffp | 1335 | drivers/cdrom/mcdx.c | interruptible_sleep_on(&stuffp->busyq); |
stuffp | 1337 | drivers/cdrom/mcdx.c | stuffp->busy, current->timeout)); |
stuffp | 1341 | drivers/cdrom/mcdx.c | if (current->timeout == 0 || !stuffp->introk) { |
stuffp | 1344 | drivers/cdrom/mcdx.c | } else if (!stuffp->introk) { |
stuffp | 1350 | drivers/cdrom/mcdx.c | stuffp->lock = 0; |
stuffp | 1351 | drivers/cdrom/mcdx.c | stuffp->busy = 0; |
stuffp | 1352 | drivers/cdrom/mcdx.c | stuffp->valid = 0; |
stuffp | 1354 | drivers/cdrom/mcdx.c | wake_up_interruptible(&stuffp->lockq); |
stuffp | 1361 | drivers/cdrom/mcdx.c | if (stuffp->xa && (0 == (stuffp->pending & 3))) { |
stuffp | 1364 | drivers/cdrom/mcdx.c | stuffp->pending, HEAD)); |
stuffp | 1365 | drivers/cdrom/mcdx.c | insb((unsigned int) stuffp->rreg_data, p, HEAD); |
stuffp | 1370 | drivers/cdrom/mcdx.c | TRACE((TRANSFER, "transfer() read sector %d\n", stuffp->pending)); |
stuffp | 1371 | drivers/cdrom/mcdx.c | insb((unsigned int) stuffp->rreg_data, p, 512); |
stuffp | 1376 | drivers/cdrom/mcdx.c | if ((stuffp->busy = (3 == (stuffp->pending & 3))) && stuffp->xa) { |
stuffp | 1379 | drivers/cdrom/mcdx.c | stuffp->pending, CD_XA_TAIL)); |
stuffp | 1380 | drivers/cdrom/mcdx.c | insb((unsigned int) stuffp->rreg_data, &dummy[0], CD_XA_TAIL); |
stuffp | 1383 | drivers/cdrom/mcdx.c | if (stuffp->pending == sector) { |
stuffp | 1388 | drivers/cdrom/mcdx.c | } while (++(stuffp->pending) < off); |
stuffp | 1390 | drivers/cdrom/mcdx.c | stuffp->lock = 0; |
stuffp | 1391 | drivers/cdrom/mcdx.c | wake_up_interruptible(&stuffp->lockq); |
stuffp | 1401 | drivers/cdrom/mcdx.c | cmd[0] = stuffp->readcmd; |
stuffp | 1403 | drivers/cdrom/mcdx.c | stuffp->valid = 1; |
stuffp | 1404 | drivers/cdrom/mcdx.c | stuffp->pending = sector & ~3; |
stuffp | 1407 | drivers/cdrom/mcdx.c | TRACE((TRANSFER, "transfer() request sector %d\n", stuffp->pending)); |
stuffp | 1408 | drivers/cdrom/mcdx.c | if (stuffp->pending > stuffp->lastsector) { |
stuffp | 1410 | drivers/cdrom/mcdx.c | stuffp->pending)); |
stuffp | 1411 | drivers/cdrom/mcdx.c | stuffp->status = MCDX_ST_EOM; |
stuffp | 1412 | drivers/cdrom/mcdx.c | stuffp->valid = 0; |
stuffp | 1417 | drivers/cdrom/mcdx.c | if ((stuffp->off_direct = stuffp->pending + DIRECT_SIZE) |
stuffp | 1418 | drivers/cdrom/mcdx.c | > stuffp->lastsector + 1) |
stuffp | 1419 | drivers/cdrom/mcdx.c | stuffp->off_direct = stuffp->lastsector + 1; |
stuffp | 1420 | drivers/cdrom/mcdx.c | if ((stuffp->off_requested = stuffp->pending + REQUEST_SIZE) |
stuffp | 1421 | drivers/cdrom/mcdx.c | > stuffp->lastsector + 1) |
stuffp | 1422 | drivers/cdrom/mcdx.c | stuffp->off_requested = stuffp->lastsector + 1; |
stuffp | 1424 | drivers/cdrom/mcdx.c | TRACE((TRANSFER, "transfer() pending %d\n", stuffp->pending)); |
stuffp | 1425 | drivers/cdrom/mcdx.c | TRACE((TRANSFER, "transfer() off_dir %d\n", stuffp->off_direct)); |
stuffp | 1426 | drivers/cdrom/mcdx.c | TRACE((TRANSFER, "transfer() off_req %d\n", stuffp->off_requested)); |
stuffp | 1430 | drivers/cdrom/mcdx.c | log2msf(stuffp->pending / 4, &pending); |
stuffp | 1436 | drivers/cdrom/mcdx.c | stuffp->busy = 1; |
stuffp | 1437 | drivers/cdrom/mcdx.c | cmd[6] = (unsigned char) (stuffp->off_requested - stuffp->pending) / 4; |
stuffp | 1439 | drivers/cdrom/mcdx.c | outsb((unsigned int) stuffp->wreg_data, cmd, sizeof cmd); |
stuffp | 1443 | drivers/cdrom/mcdx.c | stuffp->off_direct = (stuffp->off_direct += done) < stuffp->off_requested |
stuffp | 1444 | drivers/cdrom/mcdx.c | ? stuffp->off_direct : stuffp->off_requested; |
stuffp | 1480 | drivers/cdrom/mcdx.c | int mcdx_readtoc(struct s_drive_stuff* stuffp) |
stuffp | 1485 | drivers/cdrom/mcdx.c | if (stuffp->toc) { |
stuffp | 1491 | drivers/cdrom/mcdx.c | stuffp->di.n_last - stuffp->di.n_first + 1)); |
stuffp | 1493 | drivers/cdrom/mcdx.c | if (-1 == mcdx_hold(stuffp, 1)) return -1; |
stuffp | 1496 | drivers/cdrom/mcdx.c | if (-1 == mcdx_setdrivemode(stuffp, TOC, 1)) return -EIO; |
stuffp | 1501 | drivers/cdrom/mcdx.c | size = sizeof(struct s_subqcode) * (stuffp->di.n_last - stuffp->di.n_first + 2); |
stuffp | 1504 | drivers/cdrom/mcdx.c | stuffp->toc = kmalloc(size, GFP_KERNEL); |
stuffp | 1505 | drivers/cdrom/mcdx.c | if (!stuffp->toc) { |
stuffp | 1507 | drivers/cdrom/mcdx.c | mcdx_setdrivemode(stuffp, DATA, 1); |
stuffp | 1518 | drivers/cdrom/mcdx.c | trk < (stuffp->di.n_last - stuffp->di.n_first + 1); |
stuffp | 1520 | drivers/cdrom/mcdx.c | stuffp->toc[trk].index = 0; |
stuffp | 1526 | drivers/cdrom/mcdx.c | if (-1 == mcdx_requestsubqcode(stuffp, &q, 1)) { |
stuffp | 1527 | drivers/cdrom/mcdx.c | mcdx_setdrivemode(stuffp, DATA, 1); |
stuffp | 1534 | drivers/cdrom/mcdx.c | && (idx <= stuffp->di.n_last) |
stuffp | 1536 | drivers/cdrom/mcdx.c | && (stuffp->toc[idx - stuffp->di.n_first].index == 0)) { |
stuffp | 1537 | drivers/cdrom/mcdx.c | stuffp->toc[idx - stuffp->di.n_first] = q; |
stuffp | 1543 | drivers/cdrom/mcdx.c | memset(&stuffp->toc[stuffp->di.n_last - stuffp->di.n_first + 1], |
stuffp | 1544 | drivers/cdrom/mcdx.c | 0, sizeof(stuffp->toc[0])); |
stuffp | 1545 | drivers/cdrom/mcdx.c | stuffp->toc[stuffp->di.n_last - stuffp->di.n_first + 1].dt |
stuffp | 1546 | drivers/cdrom/mcdx.c | = stuffp->di.msf_leadout; |
stuffp | 1551 | drivers/cdrom/mcdx.c | if (-1 == mcdx_setdrivemode(stuffp, DATA, 2)) |
stuffp | 1557 | drivers/cdrom/mcdx.c | trk < (stuffp->di.n_last - stuffp->di.n_first + 2); |
stuffp | 1561 | drivers/cdrom/mcdx.c | trk + stuffp->di.n_first, |
stuffp | 1562 | drivers/cdrom/mcdx.c | stuffp->toc[trk].control, stuffp->toc[trk].tno, stuffp->toc[trk].index, |
stuffp | 1563 | drivers/cdrom/mcdx.c | stuffp->toc[trk].tt.minute, stuffp->toc[trk].tt.second, stuffp->toc[trk].tt.frame, |
stuffp | 1564 | drivers/cdrom/mcdx.c | stuffp->toc[trk].dt.minute, stuffp->toc[trk].dt.second, stuffp->toc[trk].dt.frame)); |
stuffp | 1572 | drivers/cdrom/mcdx.c | mcdx_playmsf(struct s_drive_stuff* stuffp, const struct cdrom_msf* msf) |
stuffp | 1578 | drivers/cdrom/mcdx.c | cmd[0] = stuffp->playcmd; |
stuffp | 1592 | drivers/cdrom/mcdx.c | outsb((unsigned int) stuffp->wreg_data, cmd, sizeof cmd); |
stuffp | 1594 | drivers/cdrom/mcdx.c | if (-1 == mcdx_getval(stuffp, 3 * HZ, 0, NULL)) { |
stuffp | 1599 | drivers/cdrom/mcdx.c | stuffp->audiostatus = CDROM_AUDIO_PLAY; |
stuffp | 1604 | drivers/cdrom/mcdx.c | mcdx_playtrk(struct s_drive_stuff* stuffp, const struct cdrom_ti* ti) |
stuffp | 1609 | drivers/cdrom/mcdx.c | if (-1 == mcdx_readtoc(stuffp)) return -1; |
stuffp | 1611 | drivers/cdrom/mcdx.c | if (ti) p = &stuffp->toc[ti->cdti_trk0 - stuffp->di.n_first]; |
stuffp | 1612 | drivers/cdrom/mcdx.c | else p = &stuffp->start; |
stuffp | 1619 | drivers/cdrom/mcdx.c | p = &stuffp->toc[ti->cdti_trk1 - stuffp->di.n_first + 1]; |
stuffp | 1620 | drivers/cdrom/mcdx.c | stuffp->stop = *p; |
stuffp | 1621 | drivers/cdrom/mcdx.c | } else p = &stuffp->stop; |
stuffp | 1627 | drivers/cdrom/mcdx.c | return mcdx_playmsf(stuffp, &msf); |
stuffp | 1634 | drivers/cdrom/mcdx.c | mcdx_closedoor(struct s_drive_stuff *stuffp, int tries) |
stuffp | 1636 | drivers/cdrom/mcdx.c | if (stuffp->present & DOOR) |
stuffp | 1637 | drivers/cdrom/mcdx.c | return mcdx_talk(stuffp, "\xf8", 1, NULL, 1, 5 * HZ, tries); |
stuffp | 1643 | drivers/cdrom/mcdx.c | mcdx_stop(struct s_drive_stuff *stuffp, int tries) |
stuffp | 1644 | drivers/cdrom/mcdx.c | { return mcdx_talk(stuffp, "\xf0", 1, NULL, 1, 2 * HZ, tries); } |
stuffp | 1647 | drivers/cdrom/mcdx.c | mcdx_hold(struct s_drive_stuff *stuffp, int tries) |
stuffp | 1648 | drivers/cdrom/mcdx.c | { return mcdx_talk(stuffp, "\x70", 1, NULL, 1, 2 * HZ, tries); } |
stuffp | 1651 | drivers/cdrom/mcdx.c | mcdx_eject(struct s_drive_stuff *stuffp, int tries) |
stuffp | 1653 | drivers/cdrom/mcdx.c | if (stuffp->present & DOOR) { |
stuffp | 1654 | drivers/cdrom/mcdx.c | stuffp->ejected = jiffies; |
stuffp | 1655 | drivers/cdrom/mcdx.c | return mcdx_talk(stuffp, "\xf6", 1, NULL, 1, 5 * HZ, tries); |
stuffp | 1660 | drivers/cdrom/mcdx.c | mcdx_requestsubqcode(struct s_drive_stuff *stuffp, |
stuffp | 1668 | drivers/cdrom/mcdx.c | stuffp, "\x20", 1, buf, sizeof(buf), |
stuffp | 1685 | drivers/cdrom/mcdx.c | mcdx_requestmultidiskinfo(struct s_drive_stuff *stuffp, struct s_multi *multi, int tries) |
stuffp | 1690 | drivers/cdrom/mcdx.c | if (stuffp->present & MULTI) { |
stuffp | 1691 | drivers/cdrom/mcdx.c | ans = mcdx_talk(stuffp, "\x11", 1, buf, sizeof(buf), 2 * HZ, tries); |
stuffp | 1704 | drivers/cdrom/mcdx.c | mcdx_requesttocdata(struct s_drive_stuff *stuffp, struct s_diskinfo *info, int tries) |
stuffp | 1708 | drivers/cdrom/mcdx.c | ans = mcdx_talk(stuffp, "\x10", 1, buf, sizeof(buf), 2 * HZ, tries); |
stuffp | 1726 | drivers/cdrom/mcdx.c | mcdx_setdrivemode(struct s_drive_stuff *stuffp, enum drivemodes mode, int tries) |
stuffp | 1733 | drivers/cdrom/mcdx.c | if (-1 == (ans = mcdx_talk(stuffp, "\xc2", 1, cmd, sizeof(cmd), 5 * HZ, tries))) |
stuffp | 1744 | drivers/cdrom/mcdx.c | return mcdx_talk(stuffp, cmd, 2, NULL, 1, 5 * HZ, tries); |
stuffp | 1748 | drivers/cdrom/mcdx.c | mcdx_setdatamode(struct s_drive_stuff *stuffp, enum datamodes mode, int tries) |
stuffp | 1758 | drivers/cdrom/mcdx.c | return mcdx_talk(stuffp, cmd, 2, NULL, 1, 5 * HZ, tries); |
stuffp | 1762 | drivers/cdrom/mcdx.c | mcdx_config(struct s_drive_stuff *stuffp, int tries) |
stuffp | 1773 | drivers/cdrom/mcdx.c | if (-1 == mcdx_talk(stuffp, cmd, 3, NULL, 1, 1 * HZ, tries)) |
stuffp | 1779 | drivers/cdrom/mcdx.c | return mcdx_talk(stuffp, cmd, 3, NULL, 1, 1 * HZ, tries); |
stuffp | 1783 | drivers/cdrom/mcdx.c | mcdx_requestversion(struct s_drive_stuff *stuffp, struct s_version *ver, int tries) |
stuffp | 1788 | drivers/cdrom/mcdx.c | if (-1 == (ans = mcdx_talk(stuffp, "\xdc", |
stuffp | 1799 | drivers/cdrom/mcdx.c | mcdx_reset(struct s_drive_stuff *stuffp, enum resetmodes mode, int tries) |
stuffp | 1802 | drivers/cdrom/mcdx.c | outb(0, (unsigned int) stuffp->wreg_chn); /* no dma, no irq -> hardware */ |
stuffp | 1803 | drivers/cdrom/mcdx.c | outb(0, (unsigned int) stuffp->wreg_reset); /* hw reset */ |
stuffp | 1805 | drivers/cdrom/mcdx.c | } else return mcdx_talk(stuffp, "\x60", 1, NULL, 1, 5 * HZ, tries); |
stuffp | 1809 | drivers/cdrom/mcdx.c | mcdx_lockdoor(struct s_drive_stuff *stuffp, int lock, int tries) |
stuffp | 1812 | drivers/cdrom/mcdx.c | if (stuffp->present & DOOR) { |
stuffp | 1814 | drivers/cdrom/mcdx.c | return mcdx_talk(stuffp, cmd, sizeof(cmd), NULL, 1, 5 * HZ, tries); |
stuffp | 1819 | drivers/cdrom/mcdx.c | mcdx_getstatus(struct s_drive_stuff *stuffp, int tries) |
stuffp | 1820 | drivers/cdrom/mcdx.c | { return mcdx_talk(stuffp, "\x40", 1, NULL, 1, 5 * HZ, tries); } |
stuffp | 1823 | drivers/cdrom/mcdx.c | mcdx_getval(struct s_drive_stuff *stuffp, int to, int delay, char* buf) |
stuffp | 1830 | drivers/cdrom/mcdx.c | while (inb((unsigned int) stuffp->rreg_status) & MCDX_RBIT_STEN) { |
stuffp | 1832 | drivers/cdrom/mcdx.c | mcdx_delay(stuffp, delay); |
stuffp | 1835 | drivers/cdrom/mcdx.c | *buf = (unsigned char) inb((unsigned int) stuffp->rreg_data) & 0xff; |
stuffp | 1842 | drivers/cdrom/mcdx.c | struct s_drive_stuff* stuffp, |
stuffp | 1853 | drivers/cdrom/mcdx.c | return mcdx_talk(stuffp, cmd, sizeof(cmd), NULL, 5, 200, tries); |