taglinefilesource code
scc110drivers/char/scc.cstatic void scc_change_speed(struct scc_channel *scc);
scc111drivers/char/scc.cstatic void init_channel(struct scc_channel *scc);
scc112drivers/char/scc.cstatic void scc_key_trx (struct scc_channel *scc, char tx);
scc113drivers/char/scc.cstatic void scc_txint(register struct scc_channel *scc);
scc114drivers/char/scc.cstatic void scc_exint(register struct scc_channel *scc);
scc115drivers/char/scc.cstatic void scc_rxint(register struct scc_channel *scc);
scc116drivers/char/scc.cstatic void scc_spint(register struct scc_channel *scc);
scc119drivers/char/scc.cstatic void scc_init_timer(struct scc_channel *scc);
scc185drivers/char/scc.cwr(register struct scc_channel *scc, register unsigned char reg, register unsigned char val)
scc187drivers/char/scc.cOutReg(scc->ctrl, reg, (scc->wreg[reg] = val));
scc191drivers/char/scc.cor(register struct scc_channel *scc, register unsigned char reg, register unsigned char val)
scc193drivers/char/scc.cOutReg(scc->ctrl, reg, (scc->wreg[reg] |= val));
scc197drivers/char/scc.ccl(register struct scc_channel *scc, register unsigned char reg, register unsigned char val)
scc199drivers/char/scc.cOutReg(scc->ctrl, reg, (scc->wreg[reg] &= ~val));
scc480drivers/char/scc.cscc_isr_dispatch(register struct scc_channel *scc, register int vector)
scc484drivers/char/scc.ccase TXINT: scc_txint(scc); break;
scc485drivers/char/scc.ccase EXINT: scc_exint(scc); break;
scc486drivers/char/scc.ccase RXINT: scc_rxint(scc); break;
scc487drivers/char/scc.ccase SPINT: scc_spint(scc); break;
scc488drivers/char/scc.cdefault    : printk("scc_isr(): unknown interrupt status (addr %4.4x, state %2.2x)\n",scc->ctrl,vector);
scc505drivers/char/scc.cregister struct scc_channel *scc;
scc529drivers/char/scc.cscc=&SCC_Info[(((vector>>1)&0x7c)^0x04) >> 2];
scc531drivers/char/scc.cif (!scc->tty) break;
scc533drivers/char/scc.cscc_isr_dispatch(scc, vector);
scc535drivers/char/scc.cOutb(scc->ctrl,0x38);              /* Reset Highest IUS" opcode to WR0 */
scc570drivers/char/scc.cscc = &SCC_Info[(((vector >> 1) & 0x7c) ^ 0x04) >> 2];
scc572drivers/char/scc.cif (!scc->tty) break;
scc576drivers/char/scc.cscc_isr_dispatch(scc, vector);
scc593drivers/char/scc.cstatic inline void prepare_next_txframe(register struct scc_channel *scc)
scc595drivers/char/scc.cif ((scc->tbp = scc->sndq))
scc597drivers/char/scc.cscc->sndq = scc->sndq->anext;
scc598drivers/char/scc.cscc->stat.tx_state = TXS_NEWFRAME;
scc601drivers/char/scc.cscc->stat.tx_state = TXS_BUSY;
scc602drivers/char/scc.cscc->t_tail = scc->kiss.tailtime;
scc609drivers/char/scc.cscc_txint(register struct scc_channel *scc)
scc613drivers/char/scc.cscc->stat.txints++;
scc615drivers/char/scc.cbp = scc->tbp;
scc622drivers/char/scc.cif (--scc->stat.tx_queued < 0)
scc623drivers/char/scc.cscc->stat.tx_queued = 0;
scc625drivers/char/scc.cOutb(scc->ctrl,RES_Tx_P);       /* reset pending int */          
scc626drivers/char/scc.ccl(scc,R10,ABUNDER);            /* frame complete, allow CRC transmit */ 
scc627drivers/char/scc.cprepare_next_txframe(scc);
scc631drivers/char/scc.cif (scc->stat.tx_state == TXS_NEWFRAME)
scc633drivers/char/scc.cOutb(scc->ctrl, RES_Tx_CRC);  /* reset CRC generator */
scc634drivers/char/scc.cor(scc,R10,ABUNDER);    /* re-install underrun protection */
scc635drivers/char/scc.cOutb(scc->data,bp->data[bp->in_use++]);
scc637drivers/char/scc.cif (!scc->enhanced)    /* reset EOM latch */
scc638drivers/char/scc.cOutb(scc->ctrl, RES_EOM_L);
scc640drivers/char/scc.cscc->stat.tx_state = TXS_ACTIVE;/* next byte... */
scc642drivers/char/scc.cOutb(scc->data,bp->data[bp->in_use++]);
scc646drivers/char/scc.cscc->tbp=bp;      /* store buffer address */
scc653drivers/char/scc.cflush_FIFO(register struct scc_channel *scc)
scc658drivers/char/scc.cInb(scc->data);
scc660drivers/char/scc.cif(scc->rxbufcnt > 0)
scc662drivers/char/scc.cscc->stat.rxerrs++;
scc663drivers/char/scc.cscc->rxbufcnt = 0;         /* throw away frame */
scc669drivers/char/scc.cscc_exint(register struct scc_channel *scc)
scc673drivers/char/scc.cscc->stat.exints++;
scc675drivers/char/scc.cstatus = InReg(scc->ctrl,R0);
scc676drivers/char/scc.cchanges = status ^ scc->status;
scc682drivers/char/scc.cflush_FIFO(scc);
scc692drivers/char/scc.cif (scc->modem.clocksrc != CLK_EXTERNAL)
scc693drivers/char/scc.cOutReg(scc->ctrl,R14,SEARCH|scc->wreg[R14]); /* DPLL: enter search mode */
scc695drivers/char/scc.cor(scc,R3,ENT_HM|RxENABLE); /* enable the receiver, hunt mode */
scc697drivers/char/scc.ccl(scc,R3,ENT_HM|RxENABLE); /* disable the receiver */
scc698drivers/char/scc.cflush_FIFO(scc);
scc707drivers/char/scc.cif (!Running(t_txdel) && scc->kiss.txdelay == 0) /* zero TXDELAY = wait for CTS */
scc708drivers/char/scc.cscc->t_txdel = 0;  /* kick it! */    
scc712drivers/char/scc.cif ((scc->stat.tx_state == TXS_ACTIVE) && (status & TxEOM))
scc714drivers/char/scc.cscc->stat.tx_under++;    /* oops, an underrun! count 'em */
scc715drivers/char/scc.cOutb(scc->ctrl, RES_Tx_P);
scc716drivers/char/scc.cOutb(scc->ctrl, RES_EXT_INT);  /* reset ext/status interrupts */
scc717drivers/char/scc.cscc->t_maxk = 1;
scc718drivers/char/scc.cscc->tbp = scc_free_chain(scc->tbp, BT_TRANSMIT);
scc720drivers/char/scc.cif (--scc->stat.tx_queued < 0) scc->stat.tx_queued = 0;
scc721drivers/char/scc.cor(scc,R10,ABUNDER);
scc726drivers/char/scc.cscc->stat.tx_under = 9999;  /* errr... yes. */
scc727drivers/char/scc.cOutb(scc->ctrl, RES_Tx_P); /* just to be sure */
scc728drivers/char/scc.cscc->t_maxk = 1;
scc729drivers/char/scc.cscc->tbp = scc_free_chain(scc->tbp, BT_TRANSMIT);
scc730drivers/char/scc.cif (--scc->stat.tx_queued < 0) scc->stat.tx_queued = 0;
scc731drivers/char/scc.cscc->kiss.tx_inhibit = 1;  /* don't try it again! */
scc735drivers/char/scc.cscc->status = status;
scc736drivers/char/scc.cOutb(scc->ctrl,RES_EXT_INT);
scc742drivers/char/scc.cscc_rxint(register struct scc_channel *scc)
scc746drivers/char/scc.cscc->stat.rxints++;
scc748drivers/char/scc.cif( Running(t_maxk) && !(scc->kiss.fulldup))
scc750drivers/char/scc.cInb(scc->data);    /* discard char */
scc751drivers/char/scc.cor(scc,R3,ENT_HM);  /* enter hunt mode for next flag */
scc755drivers/char/scc.cif (scc->rxbufcnt > 2044)    /* no buffer available? */
scc757drivers/char/scc.cInb(scc->data);    /* discard character */
scc758drivers/char/scc.cor(scc,R3,ENT_HM);      /* enter hunt mode */
scc759drivers/char/scc.cscc->rxbufcnt = 0;  /* throw away frame */
scc760drivers/char/scc.cscc->stat.nospace++;    /* and count this error */
scc764drivers/char/scc.cif(scc->rxbufcnt == 0) /* make begin of kissframe */
scc766drivers/char/scc.cscc->rxbuf[scc->rxbufcnt++] = FEND;
scc767drivers/char/scc.cif (scc->kiss.not_slip)
scc768drivers/char/scc.cscc->rxbuf[scc->rxbufcnt++] = 0;
scc771drivers/char/scc.cswitch( ch = Inb(scc->data) )
scc774drivers/char/scc.cscc->rxbuf[scc->rxbufcnt++] = FESC;
scc775drivers/char/scc.cscc->rxbuf[scc->rxbufcnt++] = TFEND;
scc778drivers/char/scc.cscc->rxbuf[scc->rxbufcnt++] = FESC;
scc779drivers/char/scc.cscc->rxbuf[scc->rxbufcnt++] = TFESC;
scc782drivers/char/scc.cscc->rxbuf[scc->rxbufcnt++] = ch;
scc790drivers/char/scc.cscc_spint(register struct scc_channel *scc)
scc799drivers/char/scc.cscc->stat.spints++;
scc801drivers/char/scc.cstatus = InReg(scc->ctrl,R1);    /* read Special Receive Condition status */
scc803drivers/char/scc.cInb(scc->data);        /* read byte */
scc807drivers/char/scc.cscc->stat.rx_over++;
scc808drivers/char/scc.cor(scc,R3,ENT_HM);              /* enter hunt mode */
scc809drivers/char/scc.cscc->rxbufcnt = 0;              /* rewind the buffer */
scc812drivers/char/scc.cif(status & END_FR && scc->rxbufcnt != 0)  /* END of FRame */
scc814drivers/char/scc.cif (!(status & CRC_ERR) && (status & 0xe) == RES8 && scc->rxbufcnt > 0)
scc816drivers/char/scc.cscc->rxbufcnt--;  /*strip the CRC */
scc817drivers/char/scc.cscc->rxbuf[scc->rxbufcnt++] = FEND;
scc819drivers/char/scc.cfor(i = 0 ; i < scc->rxbufcnt ; i++)
scc821drivers/char/scc.cif((scc->tty->flip.count + 1) < TTY_FLIPBUF_SIZE)
scc822drivers/char/scc.ctty_insert_flip_char(scc->tty, scc->rxbuf[i], 0);
scc824drivers/char/scc.cif (scc->tty->flip.buf_num) {
scc825drivers/char/scc.ccp = scc->tty->flip.char_buf + TTY_FLIPBUF_SIZE;
scc826drivers/char/scc.cfp = scc->tty->flip.flag_buf + TTY_FLIPBUF_SIZE;
scc827drivers/char/scc.cscc->tty->flip.buf_num = 0;
scc828drivers/char/scc.cscc->tty->flip.char_buf_ptr = scc->tty->flip.char_buf;
scc829drivers/char/scc.cscc->tty->flip.flag_buf_ptr = scc->tty->flip.flag_buf;
scc831drivers/char/scc.ccp = scc->tty->flip.char_buf;
scc832drivers/char/scc.cfp = scc->tty->flip.flag_buf;
scc833drivers/char/scc.cscc->tty->flip.buf_num = 1;
scc834drivers/char/scc.cscc->tty->flip.char_buf_ptr = scc->tty->flip.char_buf + TTY_FLIPBUF_SIZE;
scc835drivers/char/scc.cscc->tty->flip.flag_buf_ptr = scc->tty->flip.flag_buf + TTY_FLIPBUF_SIZE;
scc837drivers/char/scc.ccount = scc->tty->flip.count;
scc838drivers/char/scc.cscc->tty->flip.count = 0;
scc839drivers/char/scc.cscc->tty->ldisc.receive_buf(scc->tty, cp, fp, count);
scc840drivers/char/scc.ctty_insert_flip_char(scc->tty, scc->rxbuf[i], 0);
scc844drivers/char/scc.cif (scc->tty->flip.buf_num) {
scc845drivers/char/scc.ccp = scc->tty->flip.char_buf + TTY_FLIPBUF_SIZE;
scc846drivers/char/scc.cfp = scc->tty->flip.flag_buf + TTY_FLIPBUF_SIZE;
scc847drivers/char/scc.cscc->tty->flip.buf_num = 0;
scc848drivers/char/scc.cscc->tty->flip.char_buf_ptr = scc->tty->flip.char_buf;
scc849drivers/char/scc.cscc->tty->flip.flag_buf_ptr = scc->tty->flip.flag_buf;
scc851drivers/char/scc.ccp = scc->tty->flip.char_buf;
scc852drivers/char/scc.cfp = scc->tty->flip.flag_buf;
scc853drivers/char/scc.cscc->tty->flip.buf_num = 1;
scc854drivers/char/scc.cscc->tty->flip.char_buf_ptr = scc->tty->flip.char_buf + TTY_FLIPBUF_SIZE;
scc855drivers/char/scc.cscc->tty->flip.flag_buf_ptr = scc->tty->flip.flag_buf + TTY_FLIPBUF_SIZE;
scc857drivers/char/scc.ccount = scc->tty->flip.count;
scc858drivers/char/scc.cscc->tty->flip.count = 0;
scc859drivers/char/scc.cscc->tty->ldisc.receive_buf(scc->tty, cp, fp, count);
scc860drivers/char/scc.cscc->stat.rxframes++;
scc862drivers/char/scc.cscc->rxbufcnt = 0;
scc865drivers/char/scc.cscc->rxbufcnt = 0;    /* frame is not good */
scc866drivers/char/scc.cscc->stat.rxerrs++;
scc869drivers/char/scc.cOutb(scc->ctrl,ERR_RES);
scc880drivers/char/scc.cstatic inline void set_brg(register struct scc_channel *scc, unsigned int tc)
scc886drivers/char/scc.ccl(scc,R14,BRENABL);    /* disable baudrate generator */
scc887drivers/char/scc.cwr(scc,R12,tc & 255);    /* brg rate LOW */
scc888drivers/char/scc.cwr(scc,R13,tc >> 8);       /* brg rate HIGH */
scc889drivers/char/scc.cor(scc,R14,BRENABL);    /* enable baudrate generator */
scc894drivers/char/scc.cstatic inline void set_speed(register struct scc_channel *scc)
scc896drivers/char/scc.cset_brg(scc, (unsigned) (Clock / (scc->modem.speed * 64)) - 2);
scc902drivers/char/scc.cstatic inline void init_brg(register struct scc_channel *scc)
scc904drivers/char/scc.cwr(scc, R14, BRSRC);        /* BRG source = PCLK */
scc905drivers/char/scc.cOutReg(scc->ctrl, R14, SSBR|scc->wreg[R14]);  /* DPLL source = BRG */
scc906drivers/char/scc.cOutReg(scc->ctrl, R14, SNRZI|scc->wreg[R14]);  /* DPLL NRZI mode */
scc910drivers/char/scc.cinit_channel(register struct scc_channel *scc)
scc916drivers/char/scc.cwr(scc,R1,0);      /* no W/REQ operation */
scc917drivers/char/scc.cwr(scc,R3,Rx8|RxCRC_ENAB);  /* RX 8 bits/char, CRC, disabled */  
scc918drivers/char/scc.cwr(scc,R4,X1CLK|SDLC);    /* *1 clock, SDLC mode */
scc919drivers/char/scc.cwr(scc,R5,Tx8|DTR|TxCRC_ENAB);  /* TX 8 bits/char, disabled, DTR */
scc920drivers/char/scc.cwr(scc,R6,0);      /* SDLC address zero (not used) */
scc921drivers/char/scc.cwr(scc,R7,FLAG);    /* SDLC flag value */
scc922drivers/char/scc.cwr(scc,R9,VIS);      /* vector includes status */
scc923drivers/char/scc.cwr(scc,R10,(scc->modem.nrz? NRZ : NRZI)|CRCPS|ABUNDER); /* abort on underrun, preset CRC generator, NRZ(I) */
scc924drivers/char/scc.cwr(scc,R14, 0);
scc953drivers/char/scc.cswitch(scc->modem.clocksrc)
scc956drivers/char/scc.cwr(scc, R11, RCDPLL|TCDPLL|TRxCOI|TRxCDP);
scc957drivers/char/scc.cinit_brg(scc);
scc961drivers/char/scc.cwr(scc, R11, ((Board & BAYCOM)? TRxCDP : TRxCBR) | RCDPLL|TCRTxCP|TRxCOI);
scc962drivers/char/scc.cinit_brg(scc);
scc966drivers/char/scc.cwr(scc, R11, (Board & BAYCOM)? RCTRxCP|TCRTxCP : RCRTxCP|TCTRxCP);
scc967drivers/char/scc.cOutReg(scc->ctrl, R14, DISDPLL);
scc973drivers/char/scc.cwr(scc,R15,((Board & BAYCOM) ? 0 : CTSIE)|BRKIE|DCDIE|TxUIE);
scc975drivers/char/scc.cif(scc->enhanced)
scc977drivers/char/scc.cor(scc,R15,SHDLCE|FIFOE);  /* enable FIFO, SDLC/HDLC Enhancements (From now R7 is R7') */
scc978drivers/char/scc.cwr(scc,R7,AUTOEOM);
scc981drivers/char/scc.cif((InReg(scc->ctrl,R0)) & DCD)    /* DCD is now ON */
scc983drivers/char/scc.cif (scc->modem.clocksrc != CLK_EXTERNAL)
scc984drivers/char/scc.cor(scc,R14, SEARCH);
scc986drivers/char/scc.cor(scc,R3,ENT_HM|RxENABLE);  /* enable the receiver, hunt mode */
scc989drivers/char/scc.cOutb(scc->ctrl,RES_EXT_INT);  /* reset ext/status interrupts */
scc990drivers/char/scc.cOutb(scc->ctrl,RES_EXT_INT);  /* must be done twice */
scc992drivers/char/scc.cscc->status = InReg(scc->ctrl,R0);  /* read initial status */
scc993drivers/char/scc.cscc->rxbufcnt = 0;
scc994drivers/char/scc.cor(scc,R1,INT_ALL_Rx|TxINT_ENAB|EXT_INT_ENAB); /* enable interrupts */
scc995drivers/char/scc.cor(scc,R9,MIE);      /* master interrupt enable */
scc999drivers/char/scc.cset_speed(scc); 
scc1014drivers/char/scc.cscc_key_trx(struct scc_channel *scc, char tx)
scc1018drivers/char/scc.cif (scc->modem.speed < baud_table[1]) 
scc1019drivers/char/scc.cscc->modem.speed = 1200;
scc1022drivers/char/scc.cOutb(scc->ctrl + 4, Option | (tx? 0x80 : 0));
scc1024drivers/char/scc.ctime_const = (unsigned) (Clock / (scc->modem.speed * (tx? 2:64))) - 2;
scc1026drivers/char/scc.cif (scc->modem.clocksrc == CLK_DPLL)
scc1030drivers/char/scc.ccl(scc,R3,RxENABLE|ENT_HM);  /* then switch off receiver */
scc1032drivers/char/scc.cset_brg(scc, time_const);  /* reprogram baudrate generator */
scc1035drivers/char/scc.cwr(scc, R11, RCDPLL|TCBR|TRxCOI|TRxCBR);
scc1037drivers/char/scc.cor(scc,R5,RTS|TxENAB);    /* set the RTS line and enable TX */
scc1039drivers/char/scc.ccl(scc,R5,RTS|TxENAB);
scc1041drivers/char/scc.cset_brg(scc, time_const);  /* reprogram baudrate generator */
scc1044drivers/char/scc.cwr(scc, R11, RCDPLL|TCDPLL|TRxCOI|TRxCDP);
scc1046drivers/char/scc.cor(scc,R3,RxENABLE|ENT_HM);
scc1050drivers/char/scc.cor(scc,R5,RTS|TxENAB);    /* enable tx */
scc1052drivers/char/scc.ccl(scc,R5,RTS|TxENAB);    /* disable tx */
scc1061drivers/char/scc.cstatic inline int is_grouped(register struct scc_channel *scc)
scc1067drivers/char/scc.cgrp1 = scc->kiss.group;
scc1074drivers/char/scc.cif (scc2 == scc || !(scc2->tty && grp2)) 
scc1090drivers/char/scc.cstatic inline void dw_slot_timeout(register struct scc_channel *scc)
scc1092drivers/char/scc.cscc->t_dwait = TIMER_STOPPED;
scc1093drivers/char/scc.cscc->t_slot = TIMER_STOPPED;
scc1095drivers/char/scc.cif (!scc->kiss.fulldup)
scc1099drivers/char/scc.cif ( (scc->kiss.softdcd? !(scc->status & SYNC_HUNT):(scc->status & DCD))  || (scc->kiss.persist) < Rand || (scc->kiss.group && is_grouped(scc)) )
scc1101drivers/char/scc.cif (scc->t_mbusy == TIMER_STOPPED)
scc1102drivers/char/scc.cscc->t_mbusy = TPS * scc->kiss.maxdefer;
scc1104drivers/char/scc.cscc->t_slot = scc->kiss.slottime;
scc1110drivers/char/scc.cif ( !(scc->wreg[R5] & RTS) )
scc1112drivers/char/scc.cscc->t_txdel = scc->kiss.txdelay;
scc1113drivers/char/scc.cscc_key_trx(scc, TX_ON);
scc1115drivers/char/scc.cscc->t_txdel = 0;
scc1122drivers/char/scc.cstatic inline void txdel_timeout(register struct scc_channel *scc)
scc1124drivers/char/scc.cscc->t_txdel = TIMER_STOPPED;
scc1126drivers/char/scc.cscc->t_maxk = TPS * scc->kiss.maxkeyup;
scc1127drivers/char/scc.cprepare_next_txframe(scc);
scc1129drivers/char/scc.cif (scc->stat.tx_state != TXS_BUSY)
scc1130drivers/char/scc.cscc_txint(scc);    
scc1135drivers/char/scc.cstatic inline void tail_timeout(register struct scc_channel *scc)
scc1137drivers/char/scc.cscc->t_tail = TIMER_STOPPED;
scc1147drivers/char/scc.cif (scc->kiss.fulldup < 2)
scc1149drivers/char/scc.cif (scc->sndq)    /* we had a timeout? */
scc1151drivers/char/scc.cscc->stat.tx_state = TXS_BUSY;
scc1152drivers/char/scc.cscc->t_dwait = TPS * scc->kiss.mintime; /* try again */
scc1155drivers/char/scc.cscc->stat.tx_state = TXS_IDLE;
scc1156drivers/char/scc.cscc->t_maxk = TIMER_STOPPED;
scc1157drivers/char/scc.cscc_key_trx(scc, TX_OFF);
scc1161drivers/char/scc.cif (scc->sndq)      /* maxkeyup expired */ /* ?! */
scc1163drivers/char/scc.cscc->stat.tx_state = TXS_BUSY;
scc1164drivers/char/scc.cscc->t_txdel = TPS * scc->kiss.waittime;
scc1168drivers/char/scc.cscc->t_idle = TPS * scc->kiss.idletime;
scc1172drivers/char/scc.cstatic inline void busy_timeout(register struct scc_channel *scc)
scc1177drivers/char/scc.cbp = scc->sndq;
scc1181drivers/char/scc.cscc->sndq = NULLBUF;
scc1182drivers/char/scc.cscc->stat.tx_state = TXS_IDLE;
scc1185drivers/char/scc.cscc->t_txdel = scc->kiss.txdelay;  /* brute force ... */
scc1187drivers/char/scc.cscc->t_mbusy = TIMER_STOPPED;
scc1192drivers/char/scc.cstatic inline void maxk_idle_timeout(register struct scc_channel *scc)
scc1194drivers/char/scc.cscc->t_maxk = TIMER_STOPPED;
scc1195drivers/char/scc.cscc->t_idle = TIMER_STOPPED;
scc1197drivers/char/scc.cscc->stat.tx_state = TXS_BUSY;
scc1198drivers/char/scc.cscc->t_tail = scc->kiss.tailtime;
scc1204drivers/char/scc.cregister struct scc_channel *scc;
scc1212drivers/char/scc.cscc = &SCC_Info[chan];
scc1214drivers/char/scc.cif (scc->tty && scc->init)
scc1217drivers/char/scc.cif (Expired(t_dwait)) dw_slot_timeout(scc)  ; else
scc1218drivers/char/scc.cif (Expired(t_slot))  dw_slot_timeout(scc)  ; else
scc1219drivers/char/scc.cif (Expired(t_txdel)) txdel_timeout(scc)     ; else
scc1220drivers/char/scc.cif (Expired(t_tail))  tail_timeout(scc)       ;
scc1224drivers/char/scc.cif (Expired(t_mbusy)) busy_timeout(scc);
scc1225drivers/char/scc.cif (Expired(t_maxk))  maxk_idle_timeout(scc);
scc1226drivers/char/scc.cif (Expired(t_idle))  maxk_idle_timeout(scc);
scc1241drivers/char/scc.cscc_init_timer(struct scc_channel *scc)
scc1254drivers/char/scc.cscc->stat.tx_state = TXS_IDLE;
scc1271drivers/char/scc.ckiss_set_param(struct scc_channel *scc,char cmd, unsigned int val)
scc1279drivers/char/scc.cscc->kiss.txdelay = VAL; break;
scc1281drivers/char/scc.cscc->kiss.persist = val; break;
scc1283drivers/char/scc.cscc->kiss.slottime = VAL; break;
scc1285drivers/char/scc.cscc->kiss.tailtime = VAL; break;
scc1287drivers/char/scc.cscc->kiss.fulldup = val; break; 
scc1289drivers/char/scc.cscc->kiss.waittime = VAL; break;
scc1291drivers/char/scc.cscc->kiss.maxkeyup = SVAL; break;
scc1293drivers/char/scc.cscc->kiss.mintime = SVAL; break;
scc1295drivers/char/scc.cscc->kiss.idletime = val; break;
scc1297drivers/char/scc.cscc->kiss.maxdefer = SVAL; break;
scc1299drivers/char/scc.cscc->kiss.group = val;  break;
scc1301drivers/char/scc.cscc->kiss.tx_inhibit = val;
scc1303drivers/char/scc.cscc->kiss.softdcd = val;
scc1314drivers/char/scc.cstatic void kiss_interpret_frame(struct scc_channel * scc)
scc1319drivers/char/scc.cif (scc->sndq1->cnt < 2)
scc1321drivers/char/scc.cif (scc->sndq1) 
scc1322drivers/char/scc.cscc_free_chain(scc->sndq1, BT_TRANSMIT);
scc1324drivers/char/scc.cscc->sndq1 = NULLBUF;
scc1326drivers/char/scc.cscc->sndq2 = NULLBUF;
scc1332drivers/char/scc.cif (scc->kiss.not_slip)
scc1334drivers/char/scc.ckisscmd = scc->sndq1->data[scc->sndq1->in_use++];
scc1335drivers/char/scc.cscc->sndq1->cnt--;
scc1342drivers/char/scc.cif (scc->sndq1->cnt > 2)
scc1343drivers/char/scc.cscc->sndq1->cnt -= 2;
scc1346drivers/char/scc.cscc_free_chain(scc->sndq1, BT_TRANSMIT);
scc1347drivers/char/scc.cscc->sndq2 = NULLBUF;
scc1358drivers/char/scc.ckiss_set_param(scc, kisscmd, scc->sndq1->data[scc->sndq1->in_use]);
scc1359drivers/char/scc.cscc->sndq1->cnt=0;
scc1360drivers/char/scc.cscc->sndq1->in_use=0;
scc1362drivers/char/scc.cscc_free_chain(scc->sndq1, BT_TRANSMIT);
scc1363drivers/char/scc.cscc->sndq2 = NULLBUF;
scc1367drivers/char/scc.cscc_enqueue(&scc->sndq,scc->sndq1); /* scc_enqueue packet */
scc1368drivers/char/scc.cscc->stat.txframes++;
scc1369drivers/char/scc.cscc->stat.tx_queued++;
scc1370drivers/char/scc.cscc->sndq2 = NULLBUF;    /* acquire a new buffer next time */
scc1374drivers/char/scc.cif(scc->stat.tx_state == TXS_IDLE)
scc1376drivers/char/scc.cscc_init_timer(scc);
scc1377drivers/char/scc.cscc->stat.tx_state = TXS_BUSY;
scc1378drivers/char/scc.cscc->t_dwait = (scc->kiss.fulldup? 0:scc->kiss.waittime);
scc1384drivers/char/scc.cstatic void kiss_store_byte(struct scc_channel *scc, unsigned char ch)
scc1386drivers/char/scc.cif (scc->sndq2 == NULLBUF) return;
scc1388drivers/char/scc.cif(scc->sndq2->cnt == scc->sndq2->size)    /* buffer full? */
scc1390drivers/char/scc.cif((scc->sndq2 = scc_get_buffer(BT_TRANSMIT)) == NULLBUF)
scc1395drivers/char/scc.cscc_append_to_chain(&scc->sndq1,scc->sndq2);         /* add buffer */
scc1398drivers/char/scc.cscc->sndq2->data[scc->sndq2->cnt++] = ch;
scc1401drivers/char/scc.cstatic inline int kiss_decode(struct scc_channel *scc, unsigned char ch)
scc1403drivers/char/scc.cswitch (scc->stat.tx_kiss_state) 
scc1408drivers/char/scc.cif (!(scc->sndq2 = scc->sndq1 = scc_get_buffer(BT_TRANSMIT)))
scc1411drivers/char/scc.cscc->stat.tx_kiss_state = KISS_DATA;
scc1412drivers/char/scc.c} else scc->stat.txerrs++;
scc1417drivers/char/scc.cscc->stat.tx_kiss_state = KISS_ESCAPE;
scc1420drivers/char/scc.ckiss_interpret_frame(scc);  
scc1421drivers/char/scc.cscc->stat.tx_kiss_state = KISS_IDLE;
scc1423drivers/char/scc.celse kiss_store_byte(scc, ch);
scc1429drivers/char/scc.ckiss_store_byte(scc, FEND);
scc1430drivers/char/scc.cscc->stat.tx_kiss_state = KISS_DATA;
scc1434drivers/char/scc.ckiss_store_byte(scc, FESC);
scc1435drivers/char/scc.cscc->stat.tx_kiss_state = KISS_DATA;
scc1439drivers/char/scc.cscc_free_chain(scc->sndq1, BT_TRANSMIT);
scc1440drivers/char/scc.cscc->sndq2 = NULLBUF;
scc1441drivers/char/scc.cscc->stat.txerrs++;
scc1442drivers/char/scc.cscc->stat.tx_kiss_state = KISS_IDLE;
scc1459drivers/char/scc.cstruct scc_channel *scc;
scc1474drivers/char/scc.cscc=&SCC_Info[2*chip];
scc1475drivers/char/scc.cif (!scc->ctrl) continue;
scc1479drivers/char/scc.cOutReg(scc->ctrl,R9,FHWRES);  /* force hardware reset */
scc1480drivers/char/scc.cOutReg(scc->ctrl,R9,0);    /* end hardware reset */
scc1481drivers/char/scc.cOutReg(scc->ctrl,R9,CHRA);  /* reset channel A */
scc1482drivers/char/scc.cOutReg(scc->ctrl,R9,CHRB);  /* reset channel B */
scc1483drivers/char/scc.cOutReg(scc->ctrl,R1, 0);  /* No Rx irq from channel A */
scc1484drivers/char/scc.cscc=&SCC_Info[2*chip+1];
scc1485drivers/char/scc.cOutReg(scc->ctrl,R1, 0);  /* No Rx irq from channel B */
scc1486drivers/char/scc.cscc=&SCC_Info[2*chip];
scc1487drivers/char/scc.cOutReg(scc->ctrl,R2, chip*16);  /* Set Interrupt vector */
scc1507drivers/char/scc.cstatic inline int scc_paranoia_check(struct scc_channel *scc, dev_t device, const char *routine)
scc1515drivers/char/scc.cif (!scc->init) 
scc1520drivers/char/scc.cif (scc->magic != SCC_MAGIC) {
scc1534drivers/char/scc.cstruct scc_channel *scc;
scc1541drivers/char/scc.cscc = &SCC_Info[chan];
scc1543drivers/char/scc.ctty->driver_data = scc;
scc1552drivers/char/scc.cif (scc->magic != SCC_MAGIC)
scc1558drivers/char/scc.cif(scc->tty != NULL)
scc1560drivers/char/scc.cscc->tty_opened++;
scc1564drivers/char/scc.cif(!scc->init) return 0;
scc1566drivers/char/scc.cscc->tty = tty;
scc1567drivers/char/scc.cinit_channel(scc);
scc1569drivers/char/scc.cscc->stat.tx_kiss_state = KISS_IDLE;  /* don't change this... */
scc1570drivers/char/scc.cscc->stat.rx_kiss_state = KISS_IDLE;  /* ...or this */
scc1572drivers/char/scc.cscc_init_timer(scc);
scc1608drivers/char/scc.cstruct scc_channel *scc = tty->driver_data;
scc1611drivers/char/scc.cif (!scc || (scc->magic != SCC_MAGIC))
scc1614drivers/char/scc.cif(scc->tty_opened)
scc1616drivers/char/scc.cscc->tty_opened--;
scc1624drivers/char/scc.cOutb(scc->ctrl,0);    /* Make sure pointer is written */
scc1625drivers/char/scc.cwr(scc,R1,0);      /* disable interrupts */
scc1626drivers/char/scc.cwr(scc,R3,0);
scc1628drivers/char/scc.cscc->tty = NULL;
scc1642drivers/char/scc.cscc_change_speed(struct scc_channel * scc)
scc1644drivers/char/scc.cif (scc->tty == NULL)
scc1647drivers/char/scc.cscc->modem.speed = baud_table[scc->tty->termios->c_cflag & CBAUD];
scc1649drivers/char/scc.cif (scc->stat.tx_state == 0)  /* only switch baudrate on rx... ;-) */
scc1650drivers/char/scc.cset_speed(scc);
scc1675drivers/char/scc.cstruct scc_channel * scc = tty->driver_data;
scc1682drivers/char/scc.cif (scc->magic != SCC_MAGIC) 
scc1707drivers/char/scc.cif (!scc->init)
scc1718drivers/char/scc.cmemcpy_fromfs(&scc->modem, (void *) arg, sizeof(struct scc_modem));
scc1722drivers/char/scc.cif (scc->modem.speed < 4800)
scc1724drivers/char/scc.cscc->kiss.txdelay = 36*TPS/100;    /* 360 ms */
scc1725drivers/char/scc.cscc->kiss.persist = 42;            /* 25% persistence */      /* was 25 */
scc1726drivers/char/scc.cscc->kiss.slottime = 16*TPS/100;   /* 160 ms */
scc1727drivers/char/scc.cscc->kiss.tailtime = 4;            /* minimal reasonable value */
scc1728drivers/char/scc.cscc->kiss.fulldup = 0;             /* CSMA */
scc1729drivers/char/scc.cscc->kiss.waittime = 50*TPS/100;   /* 500 ms */
scc1730drivers/char/scc.cscc->kiss.maxkeyup = 10;           /* 10 s */
scc1731drivers/char/scc.cscc->kiss.mintime = 3;             /* 3 s */
scc1732drivers/char/scc.cscc->kiss.idletime = 30;           /* 30 s */
scc1733drivers/char/scc.cscc->kiss.maxdefer = 120;     /* 2 min */
scc1734drivers/char/scc.cscc->kiss.not_slip = 1;       /* KISS mode */
scc1735drivers/char/scc.cscc->kiss.softdcd = 0;       /* hardware dcd */
scc1737drivers/char/scc.cscc->kiss.txdelay = 10*TPS/100;    /* 100 ms */
scc1738drivers/char/scc.cscc->kiss.persist = 64;            /* 25% persistence */      /* was 25 */
scc1739drivers/char/scc.cscc->kiss.slottime = 8*TPS/100;    /* 160 ms */
scc1740drivers/char/scc.cscc->kiss.tailtime = 1;            /* minimal reasonable value */
scc1741drivers/char/scc.cscc->kiss.fulldup = 0;             /* CSMA */
scc1742drivers/char/scc.cscc->kiss.waittime = 50*TPS/100;   /* 500 ms */
scc1743drivers/char/scc.cscc->kiss.maxkeyup = 7;            /* 7 s */
scc1744drivers/char/scc.cscc->kiss.mintime = 3;             /* 3 s */
scc1745drivers/char/scc.cscc->kiss.idletime = 30;           /* 30 s */
scc1746drivers/char/scc.cscc->kiss.maxdefer = 120;     /* 2 min */
scc1747drivers/char/scc.cscc->kiss.not_slip = 1;       /* KISS mode */
scc1748drivers/char/scc.cscc->kiss.softdcd = 0;       /* hardware dcd */
scc1751drivers/char/scc.cscc->init = 1;
scc1769drivers/char/scc.cresult =  ((scc->wreg[R5] & RTS) ? TIOCM_RTS : 0)
scc1770drivers/char/scc.c| ((scc->wreg[R5] & DTR) ? TIOCM_DTR : 0)
scc1771drivers/char/scc.c| ((InReg(scc->ctrl,R0) & DCD)  ? TIOCM_CAR : 0)
scc1772drivers/char/scc.c| ((InReg(scc->ctrl,R0) & CTS)  ? TIOCM_CTS : 0);
scc1783drivers/char/scc.cscc->wreg[R5] |= DTR;
scc1784drivers/char/scc.cscc->wreg[R5] |= RTS;
scc1787drivers/char/scc.cscc->wreg[R5] &= ~DTR;
scc1788drivers/char/scc.cscc->wreg[R5] &= ~RTS;
scc1794drivers/char/scc.cscc->wreg[R5] |= DTR;
scc1796drivers/char/scc.cscc->wreg[R5] &= ~DTR;
scc1798drivers/char/scc.cscc->wreg[R5] |= RTS;
scc1800drivers/char/scc.cscc->wreg[R5] &= ~RTS;
scc1806drivers/char/scc.cif(scc->stat.tx_state == TXS_IDLE && !Running(t_idle))
scc1807drivers/char/scc.cmaxk_idle_timeout(scc);
scc1820drivers/char/scc.cmemcpy_tofs((void *) arg, scc->tty->termios, sizeof(struct termios));
scc1831drivers/char/scc.cmemcpy_fromfs(scc->tty->termios, (void *) arg, sizeof(struct termios));
scc1832drivers/char/scc.cscc_change_speed(scc);
scc1844drivers/char/scc.cscc->stat.used_buf = scc_count_used_buffers(&scc->stat.rx_alloc, 
scc1845drivers/char/scc.c&scc->stat.tx_alloc);
scc1847drivers/char/scc.cmemcpy_tofs((void *) arg, &scc->stat, sizeof(struct scc_stat));
scc1868drivers/char/scc.ccase PARAM_TXDELAY:  r = CAST(scc->kiss.txdelay*TICKS);  break;
scc1869drivers/char/scc.ccase PARAM_PERSIST:  r = CAST(scc->kiss.persist);     break;
scc1870drivers/char/scc.ccase PARAM_SLOTTIME:  r = CAST(scc->kiss.slottime*TICKS);  break;
scc1871drivers/char/scc.ccase PARAM_TXTAIL:  r = CAST(scc->kiss.tailtime*TICKS);  break;
scc1872drivers/char/scc.ccase PARAM_FULLDUP:  r = CAST(scc->kiss.fulldup);     break;
scc1873drivers/char/scc.ccase PARAM_SOFTDCD:  r = CAST(scc->kiss.softdcd);    break;
scc1874drivers/char/scc.ccase PARAM_DTR:    r = CAST((scc->wreg[R5] & DTR)? 1:0); break;
scc1875drivers/char/scc.ccase PARAM_RTS:    r = CAST((scc->wreg[R5] & RTS)? 1:0); break;
scc1876drivers/char/scc.ccase PARAM_SPEED:  r = CAST(scc->modem.speed);  break;
scc1877drivers/char/scc.ccase PARAM_GROUP:  r = CAST(scc->kiss.group);     break;
scc1878drivers/char/scc.ccase PARAM_IDLE:  r = CAST(scc->kiss.idletime);    break;
scc1879drivers/char/scc.ccase PARAM_MIN:    r = CAST(scc->kiss.mintime);    break;
scc1880drivers/char/scc.ccase PARAM_MAXKEY:  r = CAST(scc->kiss.maxkeyup);    break;
scc1881drivers/char/scc.ccase PARAM_WAIT:  r = CAST(scc->kiss.waittime);    break;
scc1882drivers/char/scc.ccase PARAM_MAXDEFER:  r = CAST(scc->kiss.maxdefer);    break;
scc1883drivers/char/scc.ccase PARAM_TX:    r = CAST(scc->kiss.tx_inhibit);  break;
scc1884drivers/char/scc.ccase PARAM_SLIP:  r = CAST(!scc->kiss.not_slip);    break;
scc1905drivers/char/scc.ccase PARAM_TXDELAY:  scc->kiss.txdelay=VAL;    break;
scc1906drivers/char/scc.ccase PARAM_PERSIST:  scc->kiss.persist=Val;    break;
scc1907drivers/char/scc.ccase PARAM_SLOTTIME:  scc->kiss.slottime=VAL;    break;
scc1908drivers/char/scc.ccase PARAM_TXTAIL:  scc->kiss.tailtime=VAL;    break;
scc1909drivers/char/scc.ccase PARAM_FULLDUP:  scc->kiss.fulldup=Val;    break;
scc1910drivers/char/scc.ccase PARAM_SOFTDCD:  scc->kiss.softdcd=Val;    break;
scc1913drivers/char/scc.ccase PARAM_SPEED:  scc->modem.speed=Val;    break;
scc1914drivers/char/scc.ccase PARAM_GROUP:  scc->kiss.group=Val;    break;
scc1915drivers/char/scc.ccase PARAM_IDLE:  scc->kiss.idletime=Val;    break;
scc1916drivers/char/scc.ccase PARAM_MIN:    scc->kiss.mintime=SVAL;    break;
scc1917drivers/char/scc.ccase PARAM_MAXKEY:  scc->kiss.maxkeyup=SVAL;  break;
scc1918drivers/char/scc.ccase PARAM_WAIT:  scc->kiss.waittime=Val;    break;
scc1919drivers/char/scc.ccase PARAM_MAXDEFER:  scc->kiss.maxdefer=SVAL;  break;
scc1920drivers/char/scc.ccase PARAM_TX:    scc->kiss.tx_inhibit=Val;  break;
scc1921drivers/char/scc.ccase PARAM_SLIP:  scc->kiss.not_slip=!Val;  break;
scc1950drivers/char/scc.cstatic inline void check_tx_queue(register struct scc_channel *scc)
scc1954drivers/char/scc.cif (scc->stat.tx_queued > QUEUE_THRES)
scc1956drivers/char/scc.cif (scc->sndq1 == NULLBUF)
scc1959drivers/char/scc.c" (%d) but queue is empty\n", scc->stat.tx_queued);
scc1961drivers/char/scc.cscc->stat.tx_queued = 0;  /* correct it */
scc1962drivers/char/scc.cscc->stat.nospace = 54321;  /* draw attention to it */
scc1966drivers/char/scc.cbp = scc->sndq1->anext;  /* don't use the one we currently use */
scc1968drivers/char/scc.cwhile (bp && (scc->stat.tx_queued > QUEUE_HYST))
scc1971drivers/char/scc.cscc->stat.tx_queued--;
scc1972drivers/char/scc.cscc->stat.nospace++;
scc1975drivers/char/scc.cscc->sndq1->anext = bp;
scc1989drivers/char/scc.cstruct scc_channel * scc = tty->driver_data;
scc1995drivers/char/scc.cif (scc_paranoia_check(scc, tty->device, "scc_write"))
scc1998drivers/char/scc.cif (scc->kiss.tx_inhibit) return count;
scc2000drivers/char/scc.ccheck_tx_queue(scc);
scc2025drivers/char/scc.cif (kiss_decode(scc, *p++))
scc2027drivers/char/scc.cscc->stat.nospace++;
scc2034drivers/char/scc.cif ((scc->tty->flags & (1 << TTY_DO_WRITE_WAKEUP)) 
scc2035drivers/char/scc.c&& scc->tty->ldisc.write_wakeup)
scc2036drivers/char/scc.c(scc->tty->ldisc.write_wakeup)(scc->tty);
scc2047drivers/char/scc.cstruct scc_channel *scc = tty->driver_data;
scc2050drivers/char/scc.cif (scc_paranoia_check(scc, tty->device, "scc_put_char"))
scc2059drivers/char/scc.cstruct scc_channel *scc = tty->driver_data;
scc2061drivers/char/scc.cscc_paranoia_check(scc, tty->device, "scc_flush_chars"); /* just to annoy the user... */
scc2070drivers/char/scc.cstruct scc_channel *scc = tty->driver_data;
scc2072drivers/char/scc.cif (scc_paranoia_check(scc, tty->device, "scc_write_room"))
scc2075drivers/char/scc.cif (scc->stat.tx_alloc >= QUEUE_THRES)
scc2086drivers/char/scc.cstruct scc_channel *scc = tty->driver_data;
scc2088drivers/char/scc.cif (scc && scc->sndq2)
scc2089drivers/char/scc.creturn scc->sndq2->cnt;
scc2096drivers/char/scc.cstruct scc_channel *scc = tty->driver_data;
scc2098drivers/char/scc.cif (scc_paranoia_check(scc, tty->device, "scc_flush_buffer"))
scc2101drivers/char/scc.cscc->stat.tx_kiss_state = KISS_IDLE;
scc2107drivers/char/scc.cstruct scc_channel *scc = tty->driver_data;
scc2109drivers/char/scc.cif (scc_paranoia_check(scc, tty->device, "scc_throttle"))
scc2119drivers/char/scc.cstruct scc_channel *scc = tty->driver_data;
scc2121drivers/char/scc.cif (scc_paranoia_check(scc, tty->device, "scc_unthrottle"))
scc2130drivers/char/scc.cstruct scc_channel *scc = tty->driver_data;
scc2132drivers/char/scc.cif (scc_paranoia_check(scc, tty->device, "scc_start"))
scc2141drivers/char/scc.cstruct scc_channel *scc = tty->driver_data;
scc2143drivers/char/scc.cif (scc_paranoia_check(scc, tty->device, "scc_stop"))
scc2151drivers/char/scc.cstruct scc_channel *scc = tty->driver_data;
scc2153drivers/char/scc.cif (scc_paranoia_check(scc, tty->device, "scc_hangup"))
scc129include/linux/scc.h#define Running(k) (scc->k != TIMER_STOPPED)
scc130include/linux/scc.h#define Expired(k) (scc->k != TIMER_STOPPED) && (!(scc->k) || (--(scc->k) == 0))
scc131include/linux/scc.h#define Stop_Timer(k) scc->k = TIMER_STOPPED