tag | line | file | source code |
stuffp | 270 | drivers/cdrom/mcdx.c | struct s_drive_stuff *stuffp = mcdx_stuffp[MINOR(ip->i_rdev)]; |
stuffp | 272 | drivers/cdrom/mcdx.c | if (!stuffp->present) return -ENXIO; |
stuffp | 283 | drivers/cdrom/mcdx.c | stuffp->audiostatus = CDROM_AUDIO_INVALID; |
stuffp | 284 | drivers/cdrom/mcdx.c | if (-1 == mcdx_stop(stuffp, 1)) |
stuffp | 297 | drivers/cdrom/mcdx.c | if ((ti.cdti_trk0 < stuffp->di.n_first) |
stuffp | 298 | drivers/cdrom/mcdx.c | || (ti.cdti_trk0 > stuffp->di.n_last) |
stuffp | 299 | drivers/cdrom/mcdx.c | || (ti.cdti_trk1 < stuffp->di.n_first)) |
stuffp | 301 | drivers/cdrom/mcdx.c | if (ti.cdti_trk1 > stuffp->di.n_last) ti.cdti_trk1 = stuffp->di.n_last; |
stuffp | 304 | drivers/cdrom/mcdx.c | return mcdx_playtrk(stuffp, &ti); |
stuffp | 313 | drivers/cdrom/mcdx.c | if ((stuffp->audiostatus == CDROM_AUDIO_PLAY) |
stuffp | 314 | drivers/cdrom/mcdx.c | && (-1 == mcdx_hold(stuffp, 1))) return -EIO; |
stuffp | 330 | drivers/cdrom/mcdx.c | return mcdx_playmsf(stuffp, &msf); |
stuffp | 335 | drivers/cdrom/mcdx.c | return mcdx_playtrk(stuffp, NULL); |
stuffp | 345 | drivers/cdrom/mcdx.c | if (-1 == mcdx_readtoc(stuffp)) return -1; |
stuffp | 351 | drivers/cdrom/mcdx.c | tp = &stuffp->toc[stuffp->di.n_last - stuffp->di.n_first + 1]; |
stuffp | 352 | drivers/cdrom/mcdx.c | else if (entry.cdte_track > stuffp->di.n_last |
stuffp | 353 | drivers/cdrom/mcdx.c | || entry.cdte_track < stuffp->di.n_first) return -EINVAL; |
stuffp | 354 | drivers/cdrom/mcdx.c | else tp = &stuffp->toc[entry.cdte_track - stuffp->di.n_first]; |
stuffp | 387 | drivers/cdrom/mcdx.c | if (-1 == mcdx_requestsubqcode(stuffp, &q, 2)) return -EIO; |
stuffp | 389 | drivers/cdrom/mcdx.c | TRACE((SUBCHNL, "audiostatus: %x\n", stuffp->audiostatus)); |
stuffp | 390 | drivers/cdrom/mcdx.c | sub.cdsc_audiostatus = stuffp->audiostatus; |
stuffp | 436 | drivers/cdrom/mcdx.c | toc.cdth_trk0 = stuffp->di.n_first; |
stuffp | 437 | drivers/cdrom/mcdx.c | toc.cdth_trk1 = stuffp->di.n_last; |
stuffp | 440 | drivers/cdrom/mcdx.c | stuffp->di.n_first, stuffp->di.n_last)); |
stuffp | 446 | drivers/cdrom/mcdx.c | if (stuffp->audiostatus != CDROM_AUDIO_PLAY) return -EINVAL; |
stuffp | 447 | drivers/cdrom/mcdx.c | if (-1 == mcdx_stop(stuffp, 1)) return -EIO; |
stuffp | 448 | drivers/cdrom/mcdx.c | stuffp->audiostatus = CDROM_AUDIO_PAUSED; |
stuffp | 449 | drivers/cdrom/mcdx.c | if (-1 == mcdx_requestsubqcode(stuffp, &stuffp->start, 1)) |
stuffp | 464 | drivers/cdrom/mcdx.c | ms.addr.msf.minute = bcd2uint(stuffp->multi.msf_last.minute); |
stuffp | 465 | drivers/cdrom/mcdx.c | ms.addr.msf.second = bcd2uint(stuffp->multi.msf_last.second); |
stuffp | 466 | drivers/cdrom/mcdx.c | ms.addr.msf.frame = bcd2uint(stuffp->multi.msf_last.frame); |
stuffp | 468 | drivers/cdrom/mcdx.c | ms.addr.lba = msf2log(&stuffp->multi.msf_last); |
stuffp | 471 | drivers/cdrom/mcdx.c | ms.xa_flag = stuffp->xa; |
stuffp | 485 | drivers/cdrom/mcdx.c | stuffp->multi.msf_last.minute, |
stuffp | 486 | drivers/cdrom/mcdx.c | stuffp->multi.msf_last.second, |
stuffp | 487 | drivers/cdrom/mcdx.c | stuffp->multi.msf_last.frame)); |
stuffp | 494 | drivers/cdrom/mcdx.c | stuffp->multi.msf_last.minute, |
stuffp | 495 | drivers/cdrom/mcdx.c | stuffp->multi.msf_last.second, |
stuffp | 496 | drivers/cdrom/mcdx.c | stuffp->multi.msf_last.frame)); |
stuffp | 503 | drivers/cdrom/mcdx.c | if (stuffp->users > 1) return -EBUSY; |
stuffp | 504 | drivers/cdrom/mcdx.c | if (-1 == mcdx_eject(stuffp, 1)) return -EIO; |
stuffp | 509 | drivers/cdrom/mcdx.c | stuffp->eject_sw = arg; |
stuffp | 525 | drivers/cdrom/mcdx.c | return mcdx_setattentuator(stuffp, &volctrl, 1); |
stuffp | 537 | drivers/cdrom/mcdx.c | struct s_drive_stuff *stuffp; |
stuffp | 548 | drivers/cdrom/mcdx.c | stuffp = mcdx_stuffp[MINOR(CURRENT->rq_dev)]; |
stuffp | 549 | drivers/cdrom/mcdx.c | TRACE((REQUEST, "do_request() stuffp = %p\n", stuffp)); |
stuffp | 554 | drivers/cdrom/mcdx.c | if ((dev < 0) || (dev >= MCDX_NDRIVES) || (!stuffp->present)) { |
stuffp | 561 | drivers/cdrom/mcdx.c | if (stuffp->audio) { |
stuffp | 574 | drivers/cdrom/mcdx.c | stuffp->errno = 0; |
stuffp | 579 | drivers/cdrom/mcdx.c | stuffp, |
stuffp | 584 | drivers/cdrom/mcdx.c | if (stuffp->errno == MCDX_EOM) { |
stuffp | 613 | drivers/cdrom/mcdx.c | struct s_drive_stuff *stuffp; |
stuffp | 616 | drivers/cdrom/mcdx.c | stuffp = mcdx_stuffp[MINOR(ip->i_rdev)]; |
stuffp | 617 | drivers/cdrom/mcdx.c | if (!stuffp->present) return -ENXIO; |
stuffp | 620 | drivers/cdrom/mcdx.c | if (-1 == mcdx_getstatus(stuffp, 1)) return -EIO; |
stuffp | 627 | drivers/cdrom/mcdx.c | if (inb((unsigned int) stuffp->rreg_status) & MCDX_RBIT_DOOR) { |
stuffp | 628 | drivers/cdrom/mcdx.c | if (jiffies - stuffp->ejected < ACLOSE_INHIBIT) return -EIO; |
stuffp | 629 | drivers/cdrom/mcdx.c | if (stuffp->autoclose) mcdx_closedoor(stuffp, 1); |
stuffp | 634 | drivers/cdrom/mcdx.c | if (stuffp->xxx < stuffp->changed) { |
stuffp | 642 | drivers/cdrom/mcdx.c | stuffp->audiostatus = CDROM_AUDIO_INVALID; |
stuffp | 649 | drivers/cdrom/mcdx.c | ans = mcdx_requestmultidiskinfo(stuffp, &stuffp->multi, 6); |
stuffp | 651 | drivers/cdrom/mcdx.c | stuffp->autoclose = 0; |
stuffp | 652 | drivers/cdrom/mcdx.c | mcdx_eject(stuffp, 1); |
stuffp | 658 | drivers/cdrom/mcdx.c | stuffp->autoclose = 1; |
stuffp | 660 | drivers/cdrom/mcdx.c | if (stuffp->multi.multi > 2) |
stuffp | 661 | drivers/cdrom/mcdx.c | WARN(("open() unknown multisession value (%d)\n", stuffp->multi.multi)); |
stuffp | 664 | drivers/cdrom/mcdx.c | if (!stuffp->multi.multi) |
stuffp | 665 | drivers/cdrom/mcdx.c | stuffp->multi.msf_last.second = 2; |
stuffp | 668 | drivers/cdrom/mcdx.c | stuffp->multi.multi, |
stuffp | 669 | drivers/cdrom/mcdx.c | stuffp->multi.msf_last.minute, |
stuffp | 670 | drivers/cdrom/mcdx.c | stuffp->multi.msf_last.second, |
stuffp | 671 | drivers/cdrom/mcdx.c | stuffp->multi.msf_last.frame)); |
stuffp | 675 | drivers/cdrom/mcdx.c | if (-1 == mcdx_requesttocdata(stuffp, &stuffp->di, 1)) return -EIO; |
stuffp | 677 | drivers/cdrom/mcdx.c | stuffp->lastsector = (CD_FRAMESIZE / 512) |
stuffp | 678 | drivers/cdrom/mcdx.c | * msf2log(&stuffp->di.msf_leadout) - 1; |
stuffp | 681 | drivers/cdrom/mcdx.c | stuffp->di.n_first, |
stuffp | 682 | drivers/cdrom/mcdx.c | stuffp->di.msf_first.minute, |
stuffp | 683 | drivers/cdrom/mcdx.c | stuffp->di.msf_first.second, |
stuffp | 684 | drivers/cdrom/mcdx.c | stuffp->di.msf_first.frame, |
stuffp | 685 | drivers/cdrom/mcdx.c | msf2log(&stuffp->di.msf_first))); |
stuffp | 687 | drivers/cdrom/mcdx.c | stuffp->di.n_last, |
stuffp | 688 | drivers/cdrom/mcdx.c | stuffp->di.msf_leadout.minute, |
stuffp | 689 | drivers/cdrom/mcdx.c | stuffp->di.msf_leadout.second, |
stuffp | 690 | drivers/cdrom/mcdx.c | stuffp->di.msf_leadout.frame, |
stuffp | 691 | drivers/cdrom/mcdx.c | msf2log(&stuffp->di.msf_leadout))); |
stuffp | 693 | drivers/cdrom/mcdx.c | if (stuffp->toc) { |
stuffp | 694 | drivers/cdrom/mcdx.c | TRACE((MALLOC, "open() free toc @ %p\n", stuffp->toc)); |
stuffp | 695 | drivers/cdrom/mcdx.c | kfree(stuffp->toc); |
stuffp | 697 | drivers/cdrom/mcdx.c | stuffp->toc = NULL; |
stuffp | 700 | drivers/cdrom/mcdx.c | if (-1 == mcdx_config(stuffp, 1)) return -EIO; |
stuffp | 708 | drivers/cdrom/mcdx.c | stuffp->xa = 0; |
stuffp | 709 | drivers/cdrom/mcdx.c | stuffp->audio = 0; |
stuffp | 713 | drivers/cdrom/mcdx.c | stuffp->xa ? "XA" : "normal")); |
stuffp | 716 | drivers/cdrom/mcdx.c | if (-1 == (ans = mcdx_setdatamode(stuffp, |
stuffp | 717 | drivers/cdrom/mcdx.c | stuffp->xa ? MODE2 : MODE1, 1))) |
stuffp | 720 | drivers/cdrom/mcdx.c | if ((stuffp->audio = e_audio(ans))) break; |
stuffp | 722 | drivers/cdrom/mcdx.c | while (0 == (ans = mcdx_transfer(stuffp, buf, 0, 1))) |
stuffp | 726 | drivers/cdrom/mcdx.c | stuffp->xa = !stuffp->xa; |
stuffp | 732 | drivers/cdrom/mcdx.c | if (-1 == mcdx_setdrivemode(stuffp, |
stuffp | 733 | drivers/cdrom/mcdx.c | stuffp->xa ? RAW : COOKED, 1)) |
stuffp | 736 | drivers/cdrom/mcdx.c | if (stuffp->audio) { |
stuffp | 740 | drivers/cdrom/mcdx.c | stuffp->xa ? "XA / " : "", |
stuffp | 741 | drivers/cdrom/mcdx.c | stuffp->multi.multi ? "Multi Session" : "Single Session")); |
stuffp | 744 | drivers/cdrom/mcdx.c | stuffp->xxx = jiffies; |
stuffp | 748 | drivers/cdrom/mcdx.c | if (0 == stuffp->users && (-1 == mcdx_lockdoor(stuffp, 1, 1))) |
stuffp | 751 | drivers/cdrom/mcdx.c | stuffp->users++; |
stuffp | 759 | drivers/cdrom/mcdx.c | struct s_drive_stuff *stuffp; |
stuffp | 763 | drivers/cdrom/mcdx.c | stuffp = mcdx_stuffp[MINOR(ip->i_rdev)]; |
stuffp | 765 | drivers/cdrom/mcdx.c | if (0 == --stuffp->users) { |
stuffp | 771 | drivers/cdrom/mcdx.c | if (-1 == mcdx_lockdoor(stuffp, 0, 3)) |
stuffp | 775 | drivers/cdrom/mcdx.c | if (stuffp->eject_sw) mcdx_eject(stuffp, 1); |
stuffp | 840 | drivers/cdrom/mcdx.c | struct s_drive_stuff *stuffp; |
stuffp | 843 | drivers/cdrom/mcdx.c | stuffp = mcdx_irq_map[irq]; |
stuffp | 845 | drivers/cdrom/mcdx.c | if (stuffp == NULL || !stuffp->busy) { |
stuffp | 851 | drivers/cdrom/mcdx.c | if (0 == (stuffp->introk = |
stuffp | 852 | drivers/cdrom/mcdx.c | (~(x = inb((unsigned int) stuffp->rreg_status)) & MCDX_RBIT_DTEN))) |
stuffp | 854 | drivers/cdrom/mcdx.c | irq, x, inb((unsigned int) stuffp->rreg_data))); |
stuffp | 860 | drivers/cdrom/mcdx.c | stuffp->busy = 0; |
stuffp | 861 | drivers/cdrom/mcdx.c | wake_up_interruptible(&stuffp->busyq); |
stuffp | 867 | drivers/cdrom/mcdx.c | struct s_drive_stuff *stuffp, |
stuffp | 884 | drivers/cdrom/mcdx.c | while (stuffp->lock) |
stuffp | 885 | drivers/cdrom/mcdx.c | interruptible_sleep_on(&stuffp->lockq); |
stuffp | 892 | drivers/cdrom/mcdx.c | stuffp->lock = 1; |
stuffp | 893 | drivers/cdrom/mcdx.c | stuffp->valid = 0; |
stuffp | 912 | drivers/cdrom/mcdx.c | outsb((unsigned int) stuffp->wreg_data, cmd, cmdlen); |
stuffp | 916 | drivers/cdrom/mcdx.c | if (-1 == mcdx_getval(stuffp, timeout, 0, bp)) { |
stuffp | 936 | drivers/cdrom/mcdx.c | if (stuffp->audiostatus == CDROM_AUDIO_INVALID) |
stuffp | 937 | drivers/cdrom/mcdx.c | stuffp->audiostatus = |
stuffp | 939 | drivers/cdrom/mcdx.c | else if (stuffp->audiostatus == CDROM_AUDIO_PLAY |
stuffp | 941 | drivers/cdrom/mcdx.c | stuffp->audiostatus = CDROM_AUDIO_COMPLETED; |
stuffp | 946 | drivers/cdrom/mcdx.c | stuffp->changed = jiffies; |
stuffp | 951 | drivers/cdrom/mcdx.c | if (-1 == mcdx_getval(stuffp, timeout, -1, bp)) { |
stuffp | 963 | drivers/cdrom/mcdx.c | stuffp->lock = 0; |
stuffp | 964 | drivers/cdrom/mcdx.c | wake_up_interruptible(&stuffp->lockq); |
stuffp | 1001 | drivers/cdrom/mcdx.c | struct s_drive_stuff *stuffp; |
stuffp | 1002 | drivers/cdrom/mcdx.c | stuffp = mcdx_stuffp[i]; |
stuffp | 1003 | drivers/cdrom/mcdx.c | if (!stuffp) continue; |
stuffp | 1004 | drivers/cdrom/mcdx.c | release_region((unsigned long) stuffp->wreg_data, MCDX_IO_SIZE); |
stuffp | 1005 | drivers/cdrom/mcdx.c | free_irq(stuffp->irq); |
stuffp | 1006 | drivers/cdrom/mcdx.c | if (stuffp->toc) { |
stuffp | 1007 | drivers/cdrom/mcdx.c | TRACE((MALLOC, "cleanup_module() free toc @ %p\n", stuffp->toc)); |
stuffp | 1008 | drivers/cdrom/mcdx.c | kfree(stuffp->toc); |
stuffp | 1010 | drivers/cdrom/mcdx.c | TRACE((MALLOC, "cleanup_module() free stuffp @ %p\n", stuffp)); |
stuffp | 1012 | drivers/cdrom/mcdx.c | kfree(stuffp); |
stuffp | 1066 | drivers/cdrom/mcdx.c | struct s_drive_stuff* stuffp; |
stuffp | 1069 | drivers/cdrom/mcdx.c | size = sizeof(*stuffp); |
stuffp | 1075 | drivers/cdrom/mcdx.c | if (!(stuffp = kmalloc(size, GFP_KERNEL))) { |
stuffp | 1080 | drivers/cdrom/mcdx.c | TRACE((INIT, "init() got %d bytes for drive stuff @ %p\n", sizeof(*stuffp), stuffp)); |
stuffp | 1083 | drivers/cdrom/mcdx.c | memset(stuffp, 0, sizeof(*stuffp)); |
stuffp | 1084 | drivers/cdrom/mcdx.c | stuffp->autoclose = 1; /* close the door on open(2) */ |
stuffp | 1086 | drivers/cdrom/mcdx.c | stuffp->present = 0; /* this should be 0 already */ |
stuffp | 1087 | drivers/cdrom/mcdx.c | stuffp->toc = NULL; /* this should be NULL already */ |
stuffp | 1088 | drivers/cdrom/mcdx.c | stuffp->changed = jiffies; |
stuffp | 1091 | drivers/cdrom/mcdx.c | stuffp->irq = irq(mcdx_drive_map[drive]); |
stuffp | 1092 | drivers/cdrom/mcdx.c | stuffp->wreg_data = stuffp->rreg_data = port(mcdx_drive_map[drive]); |
stuffp | 1093 | drivers/cdrom/mcdx.c | stuffp->wreg_reset = stuffp->rreg_status = stuffp->wreg_data + 1; |
stuffp | 1094 | drivers/cdrom/mcdx.c | stuffp->wreg_hcon = stuffp->wreg_reset + 1; |
stuffp | 1095 | drivers/cdrom/mcdx.c | stuffp->wreg_chn = stuffp->wreg_hcon + 1; |
stuffp | 1098 | drivers/cdrom/mcdx.c | if (0 != check_region((unsigned int) stuffp->wreg_data, MCDX_IO_SIZE)) { |
stuffp | 1102 | drivers/cdrom/mcdx.c | stuffp->wreg_data, stuffp->irq, |
stuffp | 1103 | drivers/cdrom/mcdx.c | stuffp->wreg_data, |
stuffp | 1104 | drivers/cdrom/mcdx.c | stuffp->wreg_data + MCDX_IO_SIZE - 1)); |
stuffp | 1105 | drivers/cdrom/mcdx.c | TRACE((MALLOC, "init() free stuffp @ %p\n", stuffp)); |
stuffp | 1106 | drivers/cdrom/mcdx.c | kfree(stuffp); |
stuffp | 1111 | drivers/cdrom/mcdx.c | TRACE((INIT, "init() i/o port is available at 0x%3p\n", stuffp->wreg_data)); |
stuffp | 1114 | drivers/cdrom/mcdx.c | mcdx_reset(stuffp, HARD, 1); |
stuffp | 1117 | drivers/cdrom/mcdx.c | if (-1 == mcdx_requestversion(stuffp, &version, 4)) { |
stuffp | 1121 | drivers/cdrom/mcdx.c | stuffp->wreg_data, stuffp->irq)); |
stuffp | 1122 | drivers/cdrom/mcdx.c | TRACE((MALLOC, "init() free stuffp @ %p\n", stuffp)); |
stuffp | 1123 | drivers/cdrom/mcdx.c | kfree(stuffp); |
stuffp | 1130 | drivers/cdrom/mcdx.c | stuffp->readcmd = READDSPEED; |
stuffp | 1131 | drivers/cdrom/mcdx.c | stuffp->present = DOUBLE | DOOR | MULTI; |
stuffp | 1134 | drivers/cdrom/mcdx.c | stuffp->readcmd = READSSPEED; |
stuffp | 1135 | drivers/cdrom/mcdx.c | stuffp->present = SINGLE | DOOR | MULTI; |
stuffp | 1138 | drivers/cdrom/mcdx.c | stuffp->readcmd = READSSPEED; |
stuffp | 1139 | drivers/cdrom/mcdx.c | stuffp->present = SINGLE; |
stuffp | 1142 | drivers/cdrom/mcdx.c | stuffp->present = 0; break; |
stuffp | 1145 | drivers/cdrom/mcdx.c | stuffp->playcmd = READSSPEED; |
stuffp | 1148 | drivers/cdrom/mcdx.c | if (!stuffp->present) { |
stuffp | 1150 | drivers/cdrom/mcdx.c | MCDX, stuffp->wreg_data, stuffp->irq)); |
stuffp | 1151 | drivers/cdrom/mcdx.c | kfree(stuffp); |
stuffp | 1159 | drivers/cdrom/mcdx.c | stuffp->wreg_data, stuffp->irq, MAJOR_NR)); |
stuffp | 1160 | drivers/cdrom/mcdx.c | kfree(stuffp); |
stuffp | 1172 | drivers/cdrom/mcdx.c | mcdx_irq_map[stuffp->irq] = stuffp; |
stuffp | 1173 | drivers/cdrom/mcdx.c | if (request_irq(stuffp->irq, mcdx_intr, SA_INTERRUPT, DEVICE_NAME)) { |
stuffp | 1176 | drivers/cdrom/mcdx.c | stuffp->wreg_data, stuffp->irq, stuffp->irq)); |
stuffp | 1177 | drivers/cdrom/mcdx.c | stuffp->irq = 0; |
stuffp | 1178 | drivers/cdrom/mcdx.c | kfree(stuffp); |
stuffp | 1181 | drivers/cdrom/mcdx.c | request_region((unsigned int) stuffp->wreg_data, |
stuffp | 1188 | drivers/cdrom/mcdx.c | mcdx_delay(stuffp, HZ/2); |
stuffp | 1189 | drivers/cdrom/mcdx.c | for (i = 100; i; i--) (void) inb((unsigned int) stuffp->rreg_status); |
stuffp | 1194 | drivers/cdrom/mcdx.c | outb(0x50, (unsigned int) stuffp->wreg_chn); /* irq 11 -> channel register */ |
stuffp | 1198 | drivers/cdrom/mcdx.c | mcdx_config(stuffp, 1); |
stuffp | 1200 | drivers/cdrom/mcdx.c | stuffp->minor = drive; |
stuffp | 1204 | drivers/cdrom/mcdx.c | stuffp->wreg_data, stuffp->irq, version.code, |
stuffp | 1206 | drivers/cdrom/mcdx.c | mcdx_stuffp[drive] = stuffp; |
stuffp | 1207 | drivers/cdrom/mcdx.c | TRACE((INIT, "init() mcdx_stuffp[%d] = %p\n", drive, stuffp)); |
stuffp | 1214 | drivers/cdrom/mcdx.c | static int mcdx_transfer(struct s_drive_stuff *stuffp, |
stuffp | 1226 | drivers/cdrom/mcdx.c | if (stuffp->audio) { |
stuffp | 1231 | drivers/cdrom/mcdx.c | while (stuffp->lock) |
stuffp | 1232 | drivers/cdrom/mcdx.c | interruptible_sleep_on(&stuffp->lockq); |
stuffp | 1237 | drivers/cdrom/mcdx.c | if (stuffp->valid |
stuffp | 1238 | drivers/cdrom/mcdx.c | && (sector >= stuffp->pending) |
stuffp | 1239 | drivers/cdrom/mcdx.c | && (sector < stuffp->off_direct)) { |
stuffp | 1242 | drivers/cdrom/mcdx.c | off = stuffp->off_requested < (off = sector + nr_sectors) |
stuffp | 1243 | drivers/cdrom/mcdx.c | ? stuffp->off_requested : off; |
stuffp | 1245 | drivers/cdrom/mcdx.c | stuffp->lock = current->pid; |
stuffp | 1253 | drivers/cdrom/mcdx.c | while (stuffp->busy) { |
stuffp | 1254 | drivers/cdrom/mcdx.c | interruptible_sleep_on(&stuffp->busyq); |
stuffp | 1260 | drivers/cdrom/mcdx.c | if (((stuffp->busy == 0) && !stuffp->introk) |
stuffp | 1262 | drivers/cdrom/mcdx.c | if ((stuffp->busy == 0) && !stuffp->introk) |
stuffp | 1266 | drivers/cdrom/mcdx.c | stuffp->lock = 0; |
stuffp | 1267 | drivers/cdrom/mcdx.c | stuffp->busy = 0; |
stuffp | 1268 | drivers/cdrom/mcdx.c | wake_up_interruptible(&stuffp->lockq); |
stuffp | 1269 | drivers/cdrom/mcdx.c | wake_up_interruptible(&stuffp->busyq); |
stuffp | 1270 | drivers/cdrom/mcdx.c | stuffp->errno = MCDX_E; |
stuffp | 1277 | drivers/cdrom/mcdx.c | if (stuffp->xa && (0 == (stuffp->pending & 3))) { |
stuffp | 1280 | drivers/cdrom/mcdx.c | stuffp->pending, HEAD)); |
stuffp | 1281 | drivers/cdrom/mcdx.c | insb((unsigned int) stuffp->rreg_data, p, HEAD); |
stuffp | 1286 | drivers/cdrom/mcdx.c | TRACE((TRANSFER, "transfer() read sector %d\n", stuffp->pending)); |
stuffp | 1287 | drivers/cdrom/mcdx.c | insb((unsigned int) stuffp->rreg_data, p, 512); |
stuffp | 1292 | drivers/cdrom/mcdx.c | if ((stuffp->busy = (3 == (stuffp->pending & 3))) && stuffp->xa) { |
stuffp | 1295 | drivers/cdrom/mcdx.c | stuffp->pending, CD_XA_TAIL)); |
stuffp | 1296 | drivers/cdrom/mcdx.c | insb((unsigned int) stuffp->rreg_data, &dummy[0], CD_XA_TAIL); |
stuffp | 1299 | drivers/cdrom/mcdx.c | if (stuffp->pending == sector) { |
stuffp | 1305 | drivers/cdrom/mcdx.c | while (++(stuffp->pending) < off); |
stuffp | 1307 | drivers/cdrom/mcdx.c | stuffp->lock = 0; |
stuffp | 1308 | drivers/cdrom/mcdx.c | wake_up_interruptible(&stuffp->lockq); |
stuffp | 1318 | drivers/cdrom/mcdx.c | cmd[0] = stuffp->readcmd; |
stuffp | 1320 | drivers/cdrom/mcdx.c | stuffp->valid = 1; |
stuffp | 1321 | drivers/cdrom/mcdx.c | stuffp->pending = sector & ~3; |
stuffp | 1324 | drivers/cdrom/mcdx.c | TRACE((TRANSFER, "transfer() request sector %d\n", stuffp->pending)); |
stuffp | 1325 | drivers/cdrom/mcdx.c | if (stuffp->pending > stuffp->lastsector) { |
stuffp | 1327 | drivers/cdrom/mcdx.c | stuffp->pending)); |
stuffp | 1328 | drivers/cdrom/mcdx.c | stuffp->errno = MCDX_EOM; |
stuffp | 1333 | drivers/cdrom/mcdx.c | if ((stuffp->off_direct = stuffp->pending + DIRECT_SIZE) |
stuffp | 1334 | drivers/cdrom/mcdx.c | > stuffp->lastsector + 1) |
stuffp | 1335 | drivers/cdrom/mcdx.c | stuffp->off_direct = stuffp->lastsector + 1; |
stuffp | 1336 | drivers/cdrom/mcdx.c | if ((stuffp->off_requested = stuffp->pending + REQUEST_SIZE) |
stuffp | 1337 | drivers/cdrom/mcdx.c | > stuffp->lastsector + 1) |
stuffp | 1338 | drivers/cdrom/mcdx.c | stuffp->off_requested = stuffp->lastsector + 1; |
stuffp | 1340 | drivers/cdrom/mcdx.c | TRACE((TRANSFER, "transfer() pending %d\n", stuffp->pending)); |
stuffp | 1341 | drivers/cdrom/mcdx.c | TRACE((TRANSFER, "transfer() off_dir %d\n", stuffp->off_direct)); |
stuffp | 1342 | drivers/cdrom/mcdx.c | TRACE((TRANSFER, "transfer() off_req %d\n", stuffp->off_requested)); |
stuffp | 1346 | drivers/cdrom/mcdx.c | log2msf(stuffp->pending / 4, &pending); |
stuffp | 1352 | drivers/cdrom/mcdx.c | stuffp->busy = 1; |
stuffp | 1353 | drivers/cdrom/mcdx.c | cmd[6] = (unsigned char) (stuffp->off_requested - stuffp->pending) / 4; |
stuffp | 1355 | drivers/cdrom/mcdx.c | outsb((unsigned int) stuffp->wreg_data, cmd, sizeof cmd); |
stuffp | 1359 | drivers/cdrom/mcdx.c | stuffp->off_direct = (stuffp->off_direct += done) < stuffp->off_requested |
stuffp | 1360 | drivers/cdrom/mcdx.c | ? stuffp->off_direct : stuffp->off_requested; |
stuffp | 1396 | drivers/cdrom/mcdx.c | int mcdx_readtoc(struct s_drive_stuff* stuffp) |
stuffp | 1401 | drivers/cdrom/mcdx.c | if (stuffp->toc) { |
stuffp | 1407 | drivers/cdrom/mcdx.c | stuffp->di.n_last - stuffp->di.n_first + 1)); |
stuffp | 1409 | drivers/cdrom/mcdx.c | if (-1 == mcdx_hold(stuffp, 1)) return -1; |
stuffp | 1412 | drivers/cdrom/mcdx.c | if (-1 == mcdx_setdrivemode(stuffp, TOC, 1)) return -EIO; |
stuffp | 1417 | drivers/cdrom/mcdx.c | size = sizeof(struct s_subqcode) * (stuffp->di.n_last - stuffp->di.n_first + 2); |
stuffp | 1420 | drivers/cdrom/mcdx.c | stuffp->toc = kmalloc(size, GFP_KERNEL); |
stuffp | 1421 | drivers/cdrom/mcdx.c | if (!stuffp->toc) { |
stuffp | 1423 | drivers/cdrom/mcdx.c | mcdx_setdrivemode(stuffp, DATA, 1); |
stuffp | 1434 | drivers/cdrom/mcdx.c | trk < (stuffp->di.n_last - stuffp->di.n_first + 1); |
stuffp | 1436 | drivers/cdrom/mcdx.c | stuffp->toc[trk].index = 0; |
stuffp | 1442 | drivers/cdrom/mcdx.c | if (-1 == mcdx_requestsubqcode(stuffp, &q, 1)) { |
stuffp | 1443 | drivers/cdrom/mcdx.c | mcdx_setdrivemode(stuffp, DATA, 1); |
stuffp | 1450 | drivers/cdrom/mcdx.c | && (idx <= stuffp->di.n_last) |
stuffp | 1452 | drivers/cdrom/mcdx.c | && (stuffp->toc[idx - stuffp->di.n_first].index == 0)) { |
stuffp | 1453 | drivers/cdrom/mcdx.c | stuffp->toc[idx - stuffp->di.n_first] = q; |
stuffp | 1459 | drivers/cdrom/mcdx.c | memset(&stuffp->toc[stuffp->di.n_last - stuffp->di.n_first + 1], |
stuffp | 1460 | drivers/cdrom/mcdx.c | 0, sizeof(stuffp->toc[0])); |
stuffp | 1461 | drivers/cdrom/mcdx.c | stuffp->toc[stuffp->di.n_last - stuffp->di.n_first + 1].dt |
stuffp | 1462 | drivers/cdrom/mcdx.c | = stuffp->di.msf_leadout; |
stuffp | 1467 | drivers/cdrom/mcdx.c | if (-1 == mcdx_setdrivemode(stuffp, DATA, 2)) |
stuffp | 1473 | drivers/cdrom/mcdx.c | trk < (stuffp->di.n_last - stuffp->di.n_first + 2); |
stuffp | 1477 | drivers/cdrom/mcdx.c | trk + stuffp->di.n_first, |
stuffp | 1478 | drivers/cdrom/mcdx.c | stuffp->toc[trk].control, stuffp->toc[trk].tno, stuffp->toc[trk].index, |
stuffp | 1479 | drivers/cdrom/mcdx.c | stuffp->toc[trk].tt.minute, stuffp->toc[trk].tt.second, stuffp->toc[trk].tt.frame, |
stuffp | 1480 | drivers/cdrom/mcdx.c | stuffp->toc[trk].dt.minute, stuffp->toc[trk].dt.second, stuffp->toc[trk].dt.frame)); |
stuffp | 1488 | drivers/cdrom/mcdx.c | mcdx_playmsf(struct s_drive_stuff* stuffp, const struct cdrom_msf* msf) |
stuffp | 1494 | drivers/cdrom/mcdx.c | cmd[0] = stuffp->playcmd; |
stuffp | 1508 | drivers/cdrom/mcdx.c | outsb((unsigned int) stuffp->wreg_data, cmd, sizeof cmd); |
stuffp | 1510 | drivers/cdrom/mcdx.c | if (-1 == mcdx_getval(stuffp, 3*HZ, 0, NULL)) { |
stuffp | 1515 | drivers/cdrom/mcdx.c | stuffp->audiostatus = CDROM_AUDIO_PLAY; |
stuffp | 1520 | drivers/cdrom/mcdx.c | mcdx_playtrk(struct s_drive_stuff* stuffp, const struct cdrom_ti* ti) |
stuffp | 1525 | drivers/cdrom/mcdx.c | if (-1 == mcdx_readtoc(stuffp)) return -1; |
stuffp | 1527 | drivers/cdrom/mcdx.c | if (ti) p = &stuffp->toc[ti->cdti_trk0 - stuffp->di.n_first]; |
stuffp | 1528 | drivers/cdrom/mcdx.c | else p = &stuffp->start; |
stuffp | 1535 | drivers/cdrom/mcdx.c | p = &stuffp->toc[ti->cdti_trk1 - stuffp->di.n_first + 1]; |
stuffp | 1536 | drivers/cdrom/mcdx.c | stuffp->stop = *p; |
stuffp | 1537 | drivers/cdrom/mcdx.c | } else p = &stuffp->stop; |
stuffp | 1543 | drivers/cdrom/mcdx.c | return mcdx_playmsf(stuffp, &msf); |
stuffp | 1550 | drivers/cdrom/mcdx.c | mcdx_closedoor(struct s_drive_stuff *stuffp, int tries) |
stuffp | 1552 | drivers/cdrom/mcdx.c | if (stuffp->present & DOOR) |
stuffp | 1553 | drivers/cdrom/mcdx.c | return mcdx_talk(stuffp, "\xf8", 1, NULL, 1, 5*HZ, tries); |
stuffp | 1559 | drivers/cdrom/mcdx.c | mcdx_stop(struct s_drive_stuff *stuffp, int tries) |
stuffp | 1560 | drivers/cdrom/mcdx.c | { return mcdx_talk(stuffp, "\xf0", 1, NULL, 1, 2*HZ, tries); } |
stuffp | 1563 | drivers/cdrom/mcdx.c | mcdx_hold(struct s_drive_stuff *stuffp, int tries) |
stuffp | 1564 | drivers/cdrom/mcdx.c | { return mcdx_talk(stuffp, "\x70", 1, NULL, 1, 2*HZ, tries); } |
stuffp | 1567 | drivers/cdrom/mcdx.c | mcdx_eject(struct s_drive_stuff *stuffp, int tries) |
stuffp | 1569 | drivers/cdrom/mcdx.c | if (stuffp->present & DOOR) { |
stuffp | 1570 | drivers/cdrom/mcdx.c | stuffp->ejected = jiffies; |
stuffp | 1571 | drivers/cdrom/mcdx.c | return mcdx_talk(stuffp, "\xf6", 1, NULL, 1, 5*HZ, tries); |
stuffp | 1576 | drivers/cdrom/mcdx.c | mcdx_requestsubqcode(struct s_drive_stuff *stuffp, |
stuffp | 1584 | drivers/cdrom/mcdx.c | stuffp, "\x20", 1, buf, sizeof(buf), |
stuffp | 1601 | drivers/cdrom/mcdx.c | mcdx_requestmultidiskinfo(struct s_drive_stuff *stuffp, struct s_multi *multi, int tries) |
stuffp | 1606 | drivers/cdrom/mcdx.c | if (stuffp->present & MULTI) { |
stuffp | 1607 | drivers/cdrom/mcdx.c | ans = mcdx_talk(stuffp, "\x11", 1, buf, sizeof(buf), 2*HZ, tries); |
stuffp | 1620 | drivers/cdrom/mcdx.c | mcdx_requesttocdata(struct s_drive_stuff *stuffp, struct s_diskinfo *info, int tries) |
stuffp | 1624 | drivers/cdrom/mcdx.c | ans = mcdx_talk(stuffp, "\x10", 1, buf, sizeof(buf), 2*HZ, tries); |
stuffp | 1637 | drivers/cdrom/mcdx.c | mcdx_setdrivemode(struct s_drive_stuff *stuffp, enum drivemodes mode, int tries) |
stuffp | 1644 | drivers/cdrom/mcdx.c | if (-1 == (ans = mcdx_talk(stuffp, "\xc2", 1, cmd, sizeof(cmd), 5*HZ, tries))) |
stuffp | 1655 | drivers/cdrom/mcdx.c | return mcdx_talk(stuffp, cmd, 2, NULL, 1, 5*HZ, tries); |
stuffp | 1660 | drivers/cdrom/mcdx.c | mcdx_setdatamode(struct s_drive_stuff *stuffp, enum datamodes mode, int tries) |
stuffp | 1670 | drivers/cdrom/mcdx.c | return mcdx_talk(stuffp, cmd, 2, NULL, 1, 5*HZ, tries); |
stuffp | 1674 | drivers/cdrom/mcdx.c | mcdx_config(struct s_drive_stuff *stuffp, int tries) |
stuffp | 1685 | drivers/cdrom/mcdx.c | if (-1 == mcdx_talk(stuffp, cmd, 3, NULL, 1, 1*HZ, tries)) |
stuffp | 1691 | drivers/cdrom/mcdx.c | return mcdx_talk(stuffp, cmd, 3, NULL, 1, 1*HZ, tries); |
stuffp | 1695 | drivers/cdrom/mcdx.c | mcdx_requestversion(struct s_drive_stuff *stuffp, struct s_version *ver, int tries) |
stuffp | 1700 | drivers/cdrom/mcdx.c | if (-1 == (ans = mcdx_talk(stuffp, "\xdc", 1, buf, sizeof(buf), 2*HZ, tries))) |
stuffp | 1710 | drivers/cdrom/mcdx.c | mcdx_reset(struct s_drive_stuff *stuffp, enum resetmodes mode, int tries) |
stuffp | 1713 | drivers/cdrom/mcdx.c | outb(0, (unsigned int) stuffp->wreg_chn); /* no dma, no irq -> hardware */ |
stuffp | 1714 | drivers/cdrom/mcdx.c | outb(0, (unsigned int) stuffp->wreg_reset); /* hw reset */ |
stuffp | 1716 | drivers/cdrom/mcdx.c | } else return mcdx_talk(stuffp, "\x60", 1, NULL, 1, 5*HZ, tries); |
stuffp | 1720 | drivers/cdrom/mcdx.c | mcdx_lockdoor(struct s_drive_stuff *stuffp, int lock, int tries) |
stuffp | 1723 | drivers/cdrom/mcdx.c | if (stuffp->present & DOOR) { |
stuffp | 1725 | drivers/cdrom/mcdx.c | return mcdx_talk(stuffp, cmd, sizeof(cmd), NULL, 1, 5*HZ, tries); |
stuffp | 1731 | drivers/cdrom/mcdx.c | mcdx_getstatus(struct s_drive_stuff *stuffp, int tries) |
stuffp | 1732 | drivers/cdrom/mcdx.c | { return mcdx_talk(stuffp, "\x40", 1, NULL, 1, 5*HZ, tries); } |
stuffp | 1735 | drivers/cdrom/mcdx.c | mcdx_getval(struct s_drive_stuff *stuffp, int to, int delay, char* buf) |
stuffp | 1742 | drivers/cdrom/mcdx.c | while (inb((unsigned int) stuffp->rreg_status) & MCDX_RBIT_STEN) { |
stuffp | 1744 | drivers/cdrom/mcdx.c | mcdx_delay(stuffp, delay); |
stuffp | 1747 | drivers/cdrom/mcdx.c | *buf = (unsigned char) inb((unsigned int) stuffp->rreg_data) & 0xff; |
stuffp | 1754 | drivers/cdrom/mcdx.c | struct s_drive_stuff* stuffp, |
stuffp | 1765 | drivers/cdrom/mcdx.c | return mcdx_talk(stuffp, cmd, sizeof(cmd), NULL, 5, 200, tries); |