taglinefilesource code
cd129drivers/cdrom/cm206.c#define stats(i) ++cd->stats[st_ ## i]; \
cd130drivers/cdrom/cm206.ccd->last_stat[st_ ## i] = cd->stat_counter++;
cd179drivers/cdrom/cm206.c#define DISC_STATUS cd->disc_status[0]
cd180drivers/cdrom/cm206.c#define FIRST_TRACK cd->disc_status[1]
cd181drivers/cdrom/cm206.c#define LAST_TRACK cd->disc_status[2]
cd182drivers/cdrom/cm206.c#define PAUSED cd->audio_status[0] /* misuse this memory byte! */
cd183drivers/cdrom/cm206.c#define PLAY_TO cd->toc[0]  /* toc[0] records end-time in play */
cd185drivers/cdrom/cm206.cstatic struct cm206_struct * cd;
cd227drivers/cdrom/cm206.ccd->intr_ds = inw(r_data_status); /* resets data_ready, data_error,
cd230drivers/cdrom/cm206.ccd->intr_ls = inw(r_line_status); /* resets overrun bit */
cd232drivers/cdrom/cm206.cif (cd->intr_ls & ls_receive_buffer_full) {  
cd233drivers/cdrom/cm206.ccd->intr_ur = inb(r_uart_receive); /* get order right! */
cd234drivers/cdrom/cm206.ccd->intr_ls = inw(r_line_status); /* resets rbf interrupt */
cd235drivers/cdrom/cm206.cif (!cd->background && cd->uart) wake_up_interruptible(&cd->uart);
cd238drivers/cdrom/cm206.celse if (cd->intr_ds & ds_data_ready) { 
cd239drivers/cdrom/cm206.cif (cd->background) ++cd->adapter_last;
cd240drivers/cdrom/cm206.cif ((cd->wait_back || !cd->background) && cd->data) 
cd241drivers/cdrom/cm206.cwake_up_interruptible(&cd->data);
cd245drivers/cdrom/cm206.celse if (cd->command && cd->intr_ls & ls_transmitter_buffer_empty) {
cd247drivers/cdrom/cm206.coutw(cd->command, r_uart_transmit);
cd248drivers/cdrom/cm206.ccd->command=0;
cd249drivers/cdrom/cm206.cif (!cd->background) wake_up_interruptible(&cd->uart);
cd252drivers/cdrom/cm206.celse if (cd->intr_ds & ds_fifo_overflow) {
cd253drivers/cdrom/cm206.cdebug(("Fifo overflow at sectors 0x%x\n", cd->sector_first));
cd255drivers/cdrom/cm206.ccd->fifo_overflowed=1;  /* signal one word less should be read */
cd258drivers/cdrom/cm206.celse if (cd->intr_ds & ds_data_error) {
cd259drivers/cdrom/cm206.cdebug(("Data error at sector 0x%x\n", cd->sector_first));
cd262drivers/cdrom/cm206.celse if (cd->intr_ds & ds_crc_error) {
cd263drivers/cdrom/cm206.cdebug(("CRC error at sector 0x%x\n", cd->sector_first));
cd266drivers/cdrom/cm206.celse if (cd->intr_ds & ds_sync_error) {
cd267drivers/cdrom/cm206.cdebug(("Sync at sector 0x%x\n", cd->sector_first));
cd270drivers/cdrom/cm206.celse if (cd->intr_ds & ds_toc_ready) {
cd278drivers/cdrom/cm206.cif (cd->background && (cd->adapter_last-cd->adapter_first == cd->max_sectors
cd279drivers/cdrom/cm206.c|| cd->fifo_overflowed))
cd287drivers/cdrom/cm206.ccd->timed_out = 1;
cd295drivers/cdrom/cm206.ccd->timer.data=(unsigned long) wait;
cd296drivers/cdrom/cm206.ccd->timer.expires = jiffies + timeout;
cd297drivers/cdrom/cm206.cadd_timer(&cd->timer);
cd299drivers/cdrom/cm206.cdel_timer(&cd->timer);
cd300drivers/cdrom/cm206.cif (cd->timed_out) {
cd301drivers/cdrom/cm206.ccd->timed_out = 0;
cd316drivers/cdrom/cm206.ccd->command = command;
cd321drivers/cdrom/cm206.cif (sleep_or_timeout(&cd->uart, UART_TIMEOUT)) {
cd333drivers/cdrom/cm206.csleep_or_timeout(&cd->uart, UART_TIMEOUT)) {
cd338drivers/cdrom/cm206.creturn cd->intr_ur;
cd350drivers/cdrom/cm206.csleep_or_timeout(&cd->uart, DSB_TIMEOUT)) {
cd355drivers/cdrom/cm206.creturn cd->intr_ur;
cd367drivers/cdrom/cm206.ccd->dsb = wait_dsb();  /* wait for command to finish */
cd441drivers/cdrom/cm206.cif (cd->background) return -1; /* can't do twice */
cd444drivers/cdrom/cm206.ccd->adapter_first = cd->adapter_last = start; 
cd445drivers/cdrom/cm206.ccd->background = 1;    /* flag a read is going on */
cd451drivers/cdrom/cm206.cif (cd->background) {
cd452drivers/cdrom/cm206.ccd->background=0;
cd453drivers/cdrom/cm206.ccd->adapter_last = -1;  /* invalidate adapter memory */
cd456drivers/cdrom/cm206.ccd->fifo_overflowed=0;
cd459drivers/cdrom/cm206.cif (sleep_or_timeout(&cd->data, DATA_TIMEOUT)) {
cd465drivers/cdrom/cm206.cinsw(r_fifo_output_buffer, cd->sector, READ_AHEAD*RAW_SECTOR_SIZE/2);
cd467drivers/cdrom/cm206.ccd->sector_first = start; cd->sector_last = start+READ_AHEAD;
cd484drivers/cdrom/cm206.cdebug(("bh: %d\n", cd->background));
cd485drivers/cdrom/cm206.cswitch (cd->background) {
cd488drivers/cdrom/cm206.cif (!(cd->intr_ls & ls_transmitter_buffer_empty)) {
cd489drivers/cdrom/cm206.ccd->command = c_stop;
cd492drivers/cdrom/cm206.ccd->background=2;
cd499drivers/cdrom/cm206.ccd->background=3;
cd502drivers/cdrom/cm206.cif (cd->intr_ur != c_stop) {
cd503drivers/cdrom/cm206.cdebug(("cm206_bh: c_stop echoed 0x%x\n", cd->intr_ur));
cd506drivers/cdrom/cm206.ccd->background++;
cd509drivers/cdrom/cm206.cif (cd->intr_ur != 0xff) {
cd510drivers/cdrom/cm206.cdebug(("cm206_bh: c_stop reacted with 0x%x\n", cd->intr_ur));
cd513drivers/cdrom/cm206.ccd->background=0;
cd521drivers/cdrom/cm206.ccd->dsb=status[0];
cd522drivers/cdrom/cm206.ccd->cc=status[1];
cd527drivers/cdrom/cm206.cif (type_1_command(c_disc_status, 7, cd->disc_status)) {
cd534drivers/cdrom/cm206.cif (!cd->openfiles) {
cd535drivers/cdrom/cm206.ccd->background=0;
cd537drivers/cdrom/cm206.ccd->adapter_last = -1;  /* invalidate adapter memory */
cd538drivers/cdrom/cm206.ccd->sector_last = -1;
cd540drivers/cdrom/cm206.cif (cd->dsb & dsb_tray_not_closed) {
cd543drivers/cdrom/cm206.cwhile (i++<10 && cd->dsb & dsb_drive_not_ready) {
cd548drivers/cdrom/cm206.cif (cd->dsb & (dsb_not_useful)) return -EIO;
cd549drivers/cdrom/cm206.cif (!(cd->dsb & dsb_disc_present)) return -ENODATA;
cd550drivers/cdrom/cm206.cif (cd->dsb & dsb_possible_media_change) {
cd551drivers/cdrom/cm206.cmemset(cd->toc, 0, sizeof(cd->toc));
cd552drivers/cdrom/cm206.cmemset(cd->audio_status, 0, sizeof(cd->audio_status));
cd556drivers/cdrom/cm206.cif (!(cd->dsb & dsb_tray_locked)) {
cd564drivers/cdrom/cm206.c++cd->openfiles; MOD_INC_USE_COUNT;
cd571drivers/cdrom/cm206.cif (cd->openfiles==1) {
cd572drivers/cdrom/cm206.cif (cd->background) {
cd573drivers/cdrom/cm206.ccd->background=0;
cd577drivers/cdrom/cm206.ccd->sector_last = -1;  /* Make our internal buffer invalid */
cd582drivers/cdrom/cm206.c--cd->openfiles; MOD_DEC_USE_COUNT;
cd590drivers/cdrom/cm206.cinsw(r_fifo_output_buffer, cd->sector + cd->fifo_overflowed, 
cd591drivers/cdrom/cm206.cRAW_SECTOR_SIZE/2 - cd->fifo_overflowed);
cd593drivers/cdrom/cm206.c++cd->adapter_first;  /* update the current adapter sector */
cd594drivers/cdrom/cm206.ccd->fifo_overflowed=0;  /* reset overflow bit */
cd597drivers/cdrom/cm206.ccd->sector_first=cd->adapter_first-1;
cd598drivers/cdrom/cm206.ccd->sector_last=cd->adapter_first; /* update the buffer sector */
cd606drivers/cdrom/cm206.cif (cd->adapter_first <= sector && sector < cd->adapter_last) { 
cd608drivers/cdrom/cm206.cempty_buffer(sector - cd->adapter_first);
cd611drivers/cdrom/cm206.celse if (cd->background==1 && cd->adapter_first <= sector
cd612drivers/cdrom/cm206.c&& sector < cd->adapter_first+cd->max_sectors) {
cd614drivers/cdrom/cm206.ccd->wait_back=1;
cd615drivers/cdrom/cm206.cwhile (sector >= cd->adapter_last) {
cd616drivers/cdrom/cm206.cif (sleep_or_timeout(&cd->data, DATA_TIMEOUT)) {
cd618drivers/cdrom/cm206.ccd->adapter_last, cd->adapter_first, cd->background));
cd620drivers/cdrom/cm206.ccd->wait_back=0;
cd624drivers/cdrom/cm206.ccd->wait_back=0;
cd625drivers/cdrom/cm206.cempty_buffer(sector - cd->adapter_first);
cd655drivers/cdrom/cm206.cif (cd->sector_first <= cd_sec_no && cd_sec_no < cd->sector_last) {
cd656drivers/cdrom/cm206.csource = ((uch *) cd->sector) + 16 + 
cd657drivers/cdrom/cm206.cquarter*512 + (cd_sec_no-cd->sector_first)*RAW_SECTOR_SIZE;
cd661drivers/cdrom/cm206.csource =  ((uch *) cd->sector)+16+quarter*512;
cd678drivers/cdrom/cm206.cmssp->addr.lba = fsm2lba(&cd->disc_status[3]);
cd680drivers/cdrom/cm206.cmssp->addr.msf.frame = cd->disc_status[3];
cd681drivers/cdrom/cm206.cmssp->addr.msf.second = cd->disc_status[4];
cd682drivers/cdrom/cm206.cmssp->addr.msf.minute = cd->disc_status[5];
cd714drivers/cdrom/cm206.ccd->dsb = wait_dsb();
cd736drivers/cdrom/cm206.cuch * q = cd->q;
cd741drivers/cdrom/cm206.cfor (i=track; i>0; i--) if (cd->toc[i].track) {
cd742drivers/cdrom/cm206.cmin = fsm2lba(cd->toc[i].fsm);
cd750drivers/cdrom/cm206.cif (!cd->toc[ct].track) {
cd753drivers/cdrom/cm206.ccd->toc[ct].track=q[1];  /* lead out still 0xaa */
cd754drivers/cdrom/cm206.cfsm(l, cd->toc[ct].fsm);
cd755drivers/cdrom/cm206.ccd->toc[ct].q0 = q[0];  /* contains adr and ctrl info */
cd782drivers/cdrom/cm206.cif (!cd->toc[track].track) get_toc_lba(track);
cd792drivers/cdrom/cm206.ccd->toc[1].track=1;    /* fill in first track position */
cd793drivers/cdrom/cm206.cfor (i=0; i<3; i++) cd->toc[1].fsm[i] = cd->disc_status[3+i];
cd810drivers/cdrom/cm206.ccd->dsb = wait_dsb();
cd820drivers/cdrom/cm206.cplay_command[i+1] = cd->audio_status[i+2];
cd826drivers/cdrom/cm206.cplay_command[i+1] = cd->toc[from].fsm[i];
cd827drivers/cdrom/cm206.cPLAY_TO.fsm[i] = play_command[i+4] = cd->toc[to+1].fsm[i];
cd833drivers/cdrom/cm206.ccd->dsb = wait_dsb();
cd839drivers/cdrom/cm206.cuch * q = cd->q;
cd857drivers/cdrom/cm206.cif (cd->dsb & dsb_play_in_progress) 
cd870drivers/cdrom/cm206.cep->cdte_addr.msf.frame = cd->toc[track].fsm[0];
cd871drivers/cdrom/cm206.cep->cdte_addr.msf.second = cd->toc[track].fsm[1];
cd872drivers/cdrom/cm206.cep->cdte_addr.msf.minute = cd->toc[track].fsm[2];
cd874drivers/cdrom/cm206.celse ep->cdte_addr.lba = fsm2lba(cd->toc[track].fsm);
cd875drivers/cdrom/cm206.cep->cdte_adr = cd->toc[track].q0 & 0xf; 
cd876drivers/cdrom/cm206.cep->cdte_ctrl = cd->toc[track].q0 >> 4;
cd892drivers/cdrom/cm206.celse return cd->stats[arg];
cd895drivers/cdrom/cm206.celse return cd->last_stat[arg];
cd918drivers/cdrom/cm206.ccd->sector_last = -1;  /* flag no data buffered */
cd919drivers/cdrom/cm206.ccd->adapter_last = -1;    
cd924drivers/cdrom/cm206.cif (cd->dsb & (dsb_drive_not_ready | dsb_tray_not_closed) )
cd973drivers/cdrom/cm206.cif (cd->dsb & dsb_play_in_progress) return type_0_command(c_stop, 1);
cd976drivers/cdrom/cm206.cif (cd->dsb & dsb_play_in_progress) {
cd978drivers/cdrom/cm206.ctype_1_command(c_audio_status, 5, cd->audio_status);
cd988drivers/cdrom/cm206.cif (cd->openfiles == 1) {  /* Must do an open before an eject! */
cd990drivers/cdrom/cm206.cmemset(cd->toc, 0, sizeof(cd->toc));
cd991drivers/cdrom/cm206.cmemset(cd->disc_status, 0, sizeof(cd->disc_status));
cd1058drivers/cdrom/cm206.ckfree(cd);
cd1130drivers/cdrom/cm206.ccd = (struct cm206_struct *) kmalloc(size, GFP_KERNEL);
cd1131drivers/cdrom/cm206.cif (!cd) return -EIO;
cd1174drivers/cdrom/cm206.cmemset(cd, 0, sizeof(*cd));  /* give'm some reasonable value */
cd1175drivers/cdrom/cm206.ccd->sector_last = -1;    /* flag no data buffered */
cd1176drivers/cdrom/cm206.ccd->adapter_last = -1;
cd1177drivers/cdrom/cm206.ccd->timer.function = cm206_timeout;
cd1178drivers/cdrom/cm206.ccd->max_sectors = (inw(r_data_status) & ds_ram_size) ? 24 : 97;
cd1180drivers/cdrom/cm206.c" %ld bytes kernel memory used.\n", cd->max_sectors*2, size);