taglinefilesource code
scc180drivers/char/scc.cstatic void scc_change_speed(struct scc_channel *scc);
scc181drivers/char/scc.cstatic void kiss_encode(struct scc_channel *scc);
scc183drivers/char/scc.cstatic void init_channel(struct scc_channel *scc);
scc184drivers/char/scc.cstatic void scc_key_trx (struct scc_channel *scc, char tx);
scc185drivers/char/scc.cstatic void scc_txint(register struct scc_channel *scc);
scc186drivers/char/scc.cstatic void scc_exint(register struct scc_channel *scc);
scc187drivers/char/scc.cstatic void scc_rxint(register struct scc_channel *scc);
scc188drivers/char/scc.cstatic void scc_spint(register struct scc_channel *scc);
scc191drivers/char/scc.cstatic void scc_init_timer(struct scc_channel *scc);
scc249drivers/char/scc.cwr(register struct scc_channel *scc, register unsigned char reg, register unsigned char val)
scc251drivers/char/scc.cOutReg(scc->ctrl, reg, (scc->wreg[reg] = val));
scc255drivers/char/scc.cor(register struct scc_channel *scc, register unsigned char reg, register unsigned char val)
scc257drivers/char/scc.cOutReg(scc->ctrl, reg, (scc->wreg[reg] |= val));
scc261drivers/char/scc.ccl(register struct scc_channel *scc, register unsigned char reg, register unsigned char val)
scc263drivers/char/scc.cOutReg(scc->ctrl, reg, (scc->wreg[reg] &= ~val));
scc519drivers/char/scc.cscc_isr_dispatch(register struct scc_channel *scc, register int vector)
scc523drivers/char/scc.ccase TXINT: scc_txint(scc); break;
scc524drivers/char/scc.ccase EXINT: scc_exint(scc); break;
scc525drivers/char/scc.ccase RXINT: scc_rxint(scc); break;
scc526drivers/char/scc.ccase SPINT: scc_spint(scc); break;
scc527drivers/char/scc.cdefault    : printk("scc_isr(): unknown interrupt status (addr %4.4x, state %2.2x)\n",scc->ctrl,vector);
scc544drivers/char/scc.cregister struct scc_channel *scc;
scc568drivers/char/scc.cscc=&SCC_Info[(((vector>>1)&0x7c)^0x04) >> 2];
scc570drivers/char/scc.cif (!scc->tty) break;
scc572drivers/char/scc.cscc_isr_dispatch(scc, vector);
scc574drivers/char/scc.cOutb(scc->ctrl,0x38);              /* Reset Highest IUS" opcode to WR0 */
scc609drivers/char/scc.cscc = &SCC_Info[(((vector >> 1) & 0x7c) ^ 0x04) >> 2];
scc611drivers/char/scc.cif (!scc->tty) break;
scc615drivers/char/scc.cscc_isr_dispatch(scc, vector);
scc632drivers/char/scc.cstatic inline void prepare_next_txframe(register struct scc_channel *scc)
scc634drivers/char/scc.cif ((scc->tbp = scc->sndq))
scc636drivers/char/scc.cscc->sndq = scc->sndq->anext;
scc637drivers/char/scc.cscc->stat.tx_state = TXS_NEWFRAME;
scc640drivers/char/scc.cscc->stat.tx_state = TXS_BUSY;
scc641drivers/char/scc.cscc->t_tail = scc->kiss.tailtime;
scc648drivers/char/scc.cscc_txint(register struct scc_channel *scc)
scc652drivers/char/scc.cscc->stat.txints++;
scc654drivers/char/scc.cbp = scc->tbp;
scc661drivers/char/scc.cif (--scc->stat.tx_queued < 0)
scc662drivers/char/scc.cscc->stat.tx_queued = 0;
scc664drivers/char/scc.cOutb(scc->ctrl,RES_Tx_P);       /* reset pending int */          
scc665drivers/char/scc.ccl(scc,R10,ABUNDER);            /* frame complete, allow CRC transmit */ 
scc666drivers/char/scc.cprepare_next_txframe(scc);
scc670drivers/char/scc.cif (scc->stat.tx_state == TXS_NEWFRAME)
scc672drivers/char/scc.cOutb(scc->ctrl, RES_Tx_CRC);  /* reset CRC generator */
scc673drivers/char/scc.cor(scc,R10,ABUNDER);    /* re-install underrun protection */
scc674drivers/char/scc.cOutb(scc->data,bp->data[bp->in_use++]);
scc676drivers/char/scc.cif (!scc->enhanced)    /* reset EOM latch */
scc677drivers/char/scc.cOutb(scc->ctrl, RES_EOM_L);
scc679drivers/char/scc.cscc->stat.tx_state = TXS_ACTIVE;/* next byte... */
scc681drivers/char/scc.cOutb(scc->data,bp->data[bp->in_use++]);
scc685drivers/char/scc.cscc->tbp=bp;      /* store buffer address */
scc692drivers/char/scc.cscc_toss_buffer(register struct scc_channel *scc)
scc696drivers/char/scc.cif((bp = scc->rbp) != NULLBUF)
scc700drivers/char/scc.cscc->rbp1 = bp;         /* Don't throw this one away */
scc707drivers/char/scc.cflush_FIFO(register struct scc_channel *scc)
scc712drivers/char/scc.cInb(scc->data);
scc714drivers/char/scc.cif(scc->rbp != NULLBUF)  /* did we receive something? */
scc716drivers/char/scc.cif(scc->rbp->next != NULLBUF || scc->rbp->cnt > 0)
scc717drivers/char/scc.cscc->stat.rxerrs++;  /* then count it as an error */
scc719drivers/char/scc.cscc_toss_buffer(scc);         /* throw away buffer */
scc727drivers/char/scc.cscc_exint(register struct scc_channel *scc)
scc731drivers/char/scc.cscc->stat.exints++;
scc733drivers/char/scc.cstatus = InReg(scc->ctrl,R0);
scc734drivers/char/scc.cchanges = status ^ scc->status;
scc740drivers/char/scc.cflush_FIFO(scc);
scc750drivers/char/scc.cif (scc->modem.clocksrc != CLK_EXTERNAL)
scc751drivers/char/scc.cOutReg(scc->ctrl,R14,SEARCH|scc->wreg[R14]); /* DPLL: enter search mode */
scc753drivers/char/scc.cor(scc,R3,ENT_HM|RxENABLE); /* enable the receiver, hunt mode */
scc755drivers/char/scc.ccl(scc,R3,ENT_HM|RxENABLE); /* disable the receiver */
scc756drivers/char/scc.cflush_FIFO(scc);
scc765drivers/char/scc.cif (!Running(t_txdel) && scc->kiss.txdelay == 0) /* zero TXDELAY = wait for CTS */
scc766drivers/char/scc.cscc->t_txdel = 0;  /* kick it! */    
scc770drivers/char/scc.cif ((scc->stat.tx_state == TXS_ACTIVE) && (status & TxEOM))
scc772drivers/char/scc.cscc->stat.tx_under++;    /* oops, an underrun! count 'em */
scc773drivers/char/scc.cOutb(scc->ctrl, RES_Tx_P);
scc774drivers/char/scc.cOutb(scc->ctrl, RES_EXT_INT);  /* reset ext/status interrupts */
scc775drivers/char/scc.cscc->t_maxk = 1;
scc776drivers/char/scc.cscc->tbp = scc_free_chain(scc->tbp, BT_TRANSMIT);
scc778drivers/char/scc.cif (--scc->stat.tx_queued < 0) scc->stat.tx_queued = 0;
scc779drivers/char/scc.cor(scc,R10,ABUNDER);
scc784drivers/char/scc.cscc->stat.tx_under = 9999;  /* errr... yes. */
scc785drivers/char/scc.cOutb(scc->ctrl, RES_Tx_P); /* just to be sure */
scc786drivers/char/scc.cscc->t_maxk = 1;
scc787drivers/char/scc.cscc->tbp = scc_free_chain(scc->tbp, BT_TRANSMIT);
scc788drivers/char/scc.cif (--scc->stat.tx_queued < 0) scc->stat.tx_queued = 0;
scc789drivers/char/scc.cscc->kiss.tx_inhibit = 1;  /* don't try it again! */
scc793drivers/char/scc.cscc->status = status;
scc794drivers/char/scc.cOutb(scc->ctrl,RES_EXT_INT);
scc800drivers/char/scc.cscc_rxint(register struct scc_channel *scc)
scc804drivers/char/scc.cscc->stat.rxints++;
scc806drivers/char/scc.cif( Running(t_maxk) && !(scc->kiss.fulldup))
scc808drivers/char/scc.cInb(scc->data);    /* discard char */
scc809drivers/char/scc.cor(scc,R3,ENT_HM);  /* enter hunt mode for next flag */
scc813drivers/char/scc.cif ((bp = scc->rbp1) == NULLBUF || bp->cnt >= bp->size)  
scc815drivers/char/scc.cif (scc->rbp == NULLBUF)
scc818drivers/char/scc.cscc->rbp = scc->rbp1 = bp;
scc823drivers/char/scc.cscc_append_to_chain(&scc->rbp, bp);
scc824drivers/char/scc.cscc->rbp1 = bp;
scc829drivers/char/scc.cInb(scc->data);    /* discard character */
scc830drivers/char/scc.cor(scc,R3,ENT_HM);      /* enter hunt mode */
scc831drivers/char/scc.cscc_toss_buffer(scc);  /* throw away buffers */
scc832drivers/char/scc.cscc->stat.nospace++;    /* and count this error */
scc838drivers/char/scc.cbp->data[bp->cnt++] = Inb(scc->data);
scc845drivers/char/scc.ckick_rx_timer(register struct scc_channel *scc)
scc854drivers/char/scc.crx_timer_cb.scc = scc;
scc865drivers/char/scc.cscc_spint(register struct scc_channel *scc)
scc870drivers/char/scc.cscc->stat.spints++;
scc872drivers/char/scc.cstatus = InReg(scc->ctrl,R1);    /* read receiver status */
scc874drivers/char/scc.cInb(scc->data);        /* throw away Rx byte */
scc878drivers/char/scc.cscc->stat.rx_over++;                /* count them */
scc879drivers/char/scc.cor(scc,R3,ENT_HM);              /* enter hunt mode for next flag */
scc880drivers/char/scc.cscc_toss_buffer(scc);                 /* rewind the buffer and toss */
scc883drivers/char/scc.cif(status & END_FR && scc->rbp != NULLBUF)  /* end of frame */
scc887drivers/char/scc.cif (!(status & CRC_ERR) && (status & 0xe) == RES8 && scc->rbp->cnt)
scc891drivers/char/scc.cfor (bp = scc->rbp; bp->next != NULLBUF; bp = bp->next) ;
scc894drivers/char/scc.cscc_enqueue(&scc->rcvq,scc->rbp);
scc895drivers/char/scc.cscc->rbp = scc->rbp1 = NULLBUF;
scc896drivers/char/scc.cscc->stat.rxframes++;
scc897drivers/char/scc.cscc->stat.rx_queued++;
scc898drivers/char/scc.ckick_rx_timer(scc);
scc900drivers/char/scc.cscc_toss_buffer(scc);    /* throw away frame */
scc901drivers/char/scc.cscc->stat.rxerrs++;
scc905drivers/char/scc.cOutb(scc->ctrl,ERR_RES);
scc916drivers/char/scc.cstatic inline void set_brg(register struct scc_channel *scc, unsigned int tc)
scc922drivers/char/scc.ccl(scc,R14,BRENABL);    /* disable baudrate generator */
scc923drivers/char/scc.cwr(scc,R12,tc & 255);    /* brg rate LOW */
scc924drivers/char/scc.cwr(scc,R13,tc >> 8);       /* brg rate HIGH */
scc925drivers/char/scc.cor(scc,R14,BRENABL);    /* enable baudrate generator */
scc930drivers/char/scc.cstatic inline void set_speed(register struct scc_channel *scc)
scc932drivers/char/scc.cset_brg(scc, (unsigned) (Clock / (scc->modem.speed * 64)) - 2);
scc938drivers/char/scc.cstatic inline void init_brg(register struct scc_channel *scc)
scc940drivers/char/scc.cwr(scc, R14, BRSRC);        /* BRG source = PCLK */
scc941drivers/char/scc.cOutReg(scc->ctrl, R14, SSBR|scc->wreg[R14]);  /* DPLL source = BRG */
scc942drivers/char/scc.cOutReg(scc->ctrl, R14, SNRZI|scc->wreg[R14]);  /* DPLL NRZI mode */
scc946drivers/char/scc.cinit_channel(register struct scc_channel *scc)
scc952drivers/char/scc.cwr(scc,R1,0);      /* no W/REQ operation */
scc953drivers/char/scc.cwr(scc,R3,Rx8|RxCRC_ENAB);  /* RX 8 bits/char, CRC, disabled */  
scc954drivers/char/scc.cwr(scc,R4,X1CLK|SDLC);    /* *1 clock, SDLC mode */
scc955drivers/char/scc.cwr(scc,R5,Tx8|DTR|TxCRC_ENAB);  /* TX 8 bits/char, disabled, DTR */
scc956drivers/char/scc.cwr(scc,R6,0);      /* SDLC address zero (not used) */
scc957drivers/char/scc.cwr(scc,R7,FLAG);    /* SDLC flag value */
scc958drivers/char/scc.cwr(scc,R10,(scc->modem.nrz? NRZ : NRZI)|CRCPS|ABUNDER); /* abort on underrun, preset CRC generator, NRZ(I) */
scc959drivers/char/scc.cwr(scc,R14, 0);
scc988drivers/char/scc.cswitch(scc->modem.clocksrc)
scc991drivers/char/scc.cwr(scc, R11, RCDPLL|TCDPLL|TRxCOI|TRxCDP);
scc992drivers/char/scc.cinit_brg(scc);
scc996drivers/char/scc.cwr(scc, R11, ((Board & BAYCOM)? TRxCDP : TRxCBR) | RCDPLL|TCRTxCP|TRxCOI);
scc997drivers/char/scc.cinit_brg(scc);
scc1001drivers/char/scc.cwr(scc, R11, (Board & BAYCOM)? RCTRxCP|TCRTxCP : RCRTxCP|TCTRxCP);
scc1002drivers/char/scc.cOutReg(scc->ctrl, R14, DISDPLL);
scc1008drivers/char/scc.cwr(scc,R15,((Board & BAYCOM) ? 0 : CTSIE)|BRKIE|DCDIE|TxUIE);
scc1010drivers/char/scc.cif(scc->enhanced)
scc1012drivers/char/scc.cor(scc,R15,SHDLCE|FIFOE);  /* enable FIFO, SDLC/HDLC Enhancements (From now R7 is R7') */
scc1013drivers/char/scc.cwr(scc,R7,AUTOEOM);
scc1016drivers/char/scc.cif((InReg(scc->ctrl,R0)) & DCD)    /* DCD is now ON */
scc1018drivers/char/scc.cif (scc->modem.clocksrc != CLK_EXTERNAL)
scc1019drivers/char/scc.cor(scc,R14, SEARCH);
scc1021drivers/char/scc.cor(scc,R3,ENT_HM|RxENABLE);  /* enable the receiver, hunt mode */
scc1024drivers/char/scc.cOutb(scc->ctrl,RES_EXT_INT);  /* reset ext/status interrupts */
scc1025drivers/char/scc.cOutb(scc->ctrl,RES_EXT_INT);  /* must be done twice */
scc1027drivers/char/scc.cscc->status = InReg(scc->ctrl,R0);  /* read initial status */
scc1029drivers/char/scc.cor(scc,R1,INT_ALL_Rx|TxINT_ENAB|EXT_INT_ENAB); /* enable interrupts */
scc1030drivers/char/scc.cor(scc,R9,MIE);      /* master interrupt enable */
scc1034drivers/char/scc.cset_speed(scc); 
scc1049drivers/char/scc.cscc_key_trx(struct scc_channel *scc, char tx)
scc1053drivers/char/scc.cif (scc->modem.speed < baud_table[1]) 
scc1054drivers/char/scc.cscc->modem.speed = 1200;
scc1057drivers/char/scc.cOutb(scc->ctrl + 4, Option | (tx? 0x80 : 0));
scc1059drivers/char/scc.ctime_const = (unsigned) (Clock / (scc->modem.speed * (tx? 2:64))) - 2;
scc1061drivers/char/scc.cif (scc->modem.clocksrc == CLK_DPLL)
scc1065drivers/char/scc.ccl(scc,R3,RxENABLE|ENT_HM);  /* then switch off receiver */
scc1067drivers/char/scc.cset_brg(scc, time_const);  /* reprogram baudrate generator */
scc1070drivers/char/scc.cwr(scc, R11, RCDPLL|TCBR|TRxCOI|TRxCBR);
scc1072drivers/char/scc.cor(scc,R5,RTS|TxENAB);    /* set the RTS line and enable TX */
scc1074drivers/char/scc.ccl(scc,R5,RTS|TxENAB);
scc1076drivers/char/scc.cset_brg(scc, time_const);  /* reprogram baudrate generator */
scc1079drivers/char/scc.cwr(scc, R11, RCDPLL|TCDPLL|TRxCOI|TRxCDP);
scc1081drivers/char/scc.cor(scc,R3,RxENABLE|ENT_HM);
scc1085drivers/char/scc.cor(scc,R5,RTS|TxENAB);    /* enable tx */
scc1087drivers/char/scc.ccl(scc,R5,RTS|TxENAB);    /* disable tx */
scc1096drivers/char/scc.cstatic inline int is_grouped(register struct scc_channel *scc)
scc1102drivers/char/scc.cgrp1 = scc->kiss.group;
scc1109drivers/char/scc.cif (scc2 == scc || !(scc2->tty && grp2)) 
scc1125drivers/char/scc.cstatic inline void dw_slot_timeout(register struct scc_channel *scc)
scc1127drivers/char/scc.cscc->t_dwait = TIMER_STOPPED;
scc1128drivers/char/scc.cscc->t_slot = TIMER_STOPPED;
scc1130drivers/char/scc.cif (!scc->kiss.fulldup)
scc1134drivers/char/scc.cif ( (scc->kiss.softdcd? !(scc->status & SYNC_HUNT):(scc->status & DCD))  || (scc->kiss.persist) < Rand || (scc->kiss.group && is_grouped(scc)) )
scc1136drivers/char/scc.cif (scc->t_mbusy == TIMER_STOPPED)
scc1137drivers/char/scc.cscc->t_mbusy = TPS * scc->kiss.maxdefer;
scc1139drivers/char/scc.cscc->t_slot = scc->kiss.slottime;
scc1145drivers/char/scc.cif ( !(scc->wreg[R5] & RTS) )
scc1147drivers/char/scc.cscc->t_txdel = scc->kiss.txdelay;
scc1148drivers/char/scc.cscc_key_trx(scc, TX_ON);
scc1150drivers/char/scc.cscc->t_txdel = 0;
scc1157drivers/char/scc.cstatic inline void txdel_timeout(register struct scc_channel *scc)
scc1159drivers/char/scc.cscc->t_txdel = TIMER_STOPPED;
scc1161drivers/char/scc.cscc->t_maxk = TPS * scc->kiss.maxkeyup;
scc1162drivers/char/scc.cprepare_next_txframe(scc);
scc1164drivers/char/scc.cif (scc->stat.tx_state != TXS_BUSY)
scc1165drivers/char/scc.cscc_txint(scc);    
scc1170drivers/char/scc.cstatic inline void tail_timeout(register struct scc_channel *scc)
scc1172drivers/char/scc.cscc->t_tail = TIMER_STOPPED;
scc1182drivers/char/scc.cif (scc->kiss.fulldup < 2)
scc1184drivers/char/scc.cif (scc->sndq)    /* we had a timeout? */
scc1186drivers/char/scc.cscc->stat.tx_state = TXS_BUSY;
scc1187drivers/char/scc.cscc->t_dwait = TPS * scc->kiss.mintime; /* try again */
scc1190drivers/char/scc.cscc->stat.tx_state = TXS_IDLE;
scc1191drivers/char/scc.cscc->t_maxk = TIMER_STOPPED;
scc1192drivers/char/scc.cscc_key_trx(scc, TX_OFF);
scc1196drivers/char/scc.cif (scc->sndq)      /* maxkeyup expired */ /* ?! */
scc1198drivers/char/scc.cscc->stat.tx_state = TXS_BUSY;
scc1199drivers/char/scc.cscc->t_txdel = TPS * scc->kiss.waittime;
scc1203drivers/char/scc.cscc->t_idle = TPS * scc->kiss.idletime;
scc1207drivers/char/scc.cstatic inline void busy_timeout(register struct scc_channel *scc)
scc1212drivers/char/scc.cbp = scc->sndq;
scc1216drivers/char/scc.cscc->sndq = NULLBUF;
scc1217drivers/char/scc.cscc->stat.tx_state = TXS_IDLE;
scc1220drivers/char/scc.cscc->t_txdel = scc->kiss.txdelay;  /* brute force ... */
scc1222drivers/char/scc.cscc->t_mbusy = TIMER_STOPPED;
scc1227drivers/char/scc.cstatic inline void maxk_idle_timeout(register struct scc_channel *scc)
scc1229drivers/char/scc.cscc->t_maxk = TIMER_STOPPED;
scc1230drivers/char/scc.cscc->t_idle = TIMER_STOPPED;
scc1232drivers/char/scc.cscc->stat.tx_state = TXS_BUSY;
scc1233drivers/char/scc.cscc->t_tail = scc->kiss.tailtime;
scc1236drivers/char/scc.cstatic inline void check_rcv_queue(register struct scc_channel *scc)
scc1240drivers/char/scc.cif (scc->stat.rx_queued > QUEUE_THRES)
scc1242drivers/char/scc.cif (scc->rcvq == NULLBUF)
scc1245drivers/char/scc.c" (%d) but queue is empty\n", scc->stat.rx_queued);
scc1247drivers/char/scc.cscc->stat.rx_queued = 0;  /* correct it */
scc1248drivers/char/scc.cscc->stat.nospace = 12345;  /* draw attention to it */
scc1252drivers/char/scc.cbp = scc->rcvq->anext;  /* don't use the one we currently use */
scc1254drivers/char/scc.cwhile (bp && (scc->stat.rx_queued > QUEUE_HYST))
scc1257drivers/char/scc.cscc->stat.rx_queued--;
scc1258drivers/char/scc.cscc->stat.nospace++;
scc1261drivers/char/scc.cscc->rcvq->anext = bp;
scc1268drivers/char/scc.cregister struct scc_channel *scc;
scc1275drivers/char/scc.cscc = &SCC_Info[chan];
scc1277drivers/char/scc.cif (scc->tty && scc->init)
scc1279drivers/char/scc.ckiss_encode(scc);
scc1283drivers/char/scc.ccheck_rcv_queue(scc);
scc1287drivers/char/scc.cif (Expired(t_dwait)) dw_slot_timeout(scc)  ; else
scc1288drivers/char/scc.cif (Expired(t_slot))  dw_slot_timeout(scc)  ; else
scc1289drivers/char/scc.cif (Expired(t_txdel)) txdel_timeout(scc)     ; else
scc1290drivers/char/scc.cif (Expired(t_tail))  tail_timeout(scc)       ;
scc1294drivers/char/scc.cif (Expired(t_mbusy)) busy_timeout(scc);
scc1295drivers/char/scc.cif (Expired(t_maxk))  maxk_idle_timeout(scc);
scc1296drivers/char/scc.cif (Expired(t_idle))  maxk_idle_timeout(scc);
scc1313drivers/char/scc.cscc_init_timer(struct scc_channel *scc)
scc1326drivers/char/scc.cscc->stat.tx_state = TXS_IDLE;
scc1337drivers/char/scc.ckiss_encode(rx_timer_cb.scc);
scc1361drivers/char/scc.ckiss_set_param(struct scc_channel *scc,char cmd, unsigned int val)
scc1369drivers/char/scc.cscc->kiss.txdelay = VAL; break;
scc1371drivers/char/scc.cscc->kiss.persist = val; break;
scc1373drivers/char/scc.cscc->kiss.slottime = VAL; break;
scc1375drivers/char/scc.cscc->kiss.tailtime = VAL; break;
scc1377drivers/char/scc.cscc->kiss.fulldup = val; break;
scc1379drivers/char/scc.cscc->kiss.waittime = VAL; break;
scc1381drivers/char/scc.cscc->kiss.maxkeyup = SVAL; break;
scc1383drivers/char/scc.cscc->kiss.mintime = SVAL; break;
scc1385drivers/char/scc.cscc->kiss.idletime = val; break;
scc1387drivers/char/scc.cscc->kiss.maxdefer = SVAL; break;
scc1389drivers/char/scc.cscc->kiss.group = val;  break;
scc1391drivers/char/scc.cscc->kiss.tx_inhibit = val;
scc1393drivers/char/scc.cscc->kiss.softdcd = val;
scc1404drivers/char/scc.cstatic void kiss_interpret_frame(struct scc_channel * scc)
scc1409drivers/char/scc.cif (scc->sndq1->cnt < 2)
scc1411drivers/char/scc.cif (scc->sndq1) 
scc1412drivers/char/scc.cscc_free_chain(scc->sndq1, BT_TRANSMIT);
scc1414drivers/char/scc.cscc->sndq1 = NULLBUF;
scc1416drivers/char/scc.cscc->sndq2 = NULLBUF;
scc1422drivers/char/scc.cif (scc->kiss.not_slip)
scc1424drivers/char/scc.ckisscmd = scc->sndq1->data[scc->sndq1->in_use++];
scc1425drivers/char/scc.cscc->sndq1->cnt--;
scc1432drivers/char/scc.cif (scc->sndq1->cnt > 2)
scc1433drivers/char/scc.cscc->sndq1->cnt -= 2;
scc1436drivers/char/scc.cscc_free_chain(scc->sndq1, BT_TRANSMIT);
scc1437drivers/char/scc.cscc->sndq2 = NULLBUF;
scc1448drivers/char/scc.ckiss_set_param(scc, kisscmd, scc->sndq1->data[scc->sndq1->in_use]);
scc1449drivers/char/scc.cscc->sndq1->cnt=0;
scc1450drivers/char/scc.cscc->sndq1->in_use=0;
scc1452drivers/char/scc.cscc_free_chain(scc->sndq1, BT_TRANSMIT);
scc1453drivers/char/scc.cscc->sndq2 = NULLBUF;
scc1457drivers/char/scc.cscc_enqueue(&scc->sndq,scc->sndq1); /* scc_enqueue packet */
scc1458drivers/char/scc.cscc->stat.txframes++;
scc1459drivers/char/scc.cscc->stat.tx_queued++;
scc1460drivers/char/scc.cscc->sndq2 = NULLBUF;    /* acquire a new buffer next time */
scc1464drivers/char/scc.cif(scc->stat.tx_state == TXS_IDLE)
scc1466drivers/char/scc.cscc_init_timer(scc);
scc1467drivers/char/scc.cscc->stat.tx_state = TXS_BUSY;
scc1468drivers/char/scc.cscc->t_dwait = (scc->kiss.fulldup? 0:scc->kiss.waittime);
scc1474drivers/char/scc.cstatic void kiss_store_byte(struct scc_channel *scc, unsigned char ch)
scc1476drivers/char/scc.cif (scc->sndq2 == NULLBUF) return;
scc1478drivers/char/scc.cif(scc->sndq2->cnt == scc->sndq2->size)    /* buffer full? */
scc1480drivers/char/scc.cif((scc->sndq2 = scc_get_buffer(BT_TRANSMIT)) == NULLBUF)
scc1485drivers/char/scc.cscc_append_to_chain(&scc->sndq1,scc->sndq2);         /* add buffer */
scc1488drivers/char/scc.cscc->sndq2->data[scc->sndq2->cnt++] = ch;
scc1491drivers/char/scc.cstatic inline int kiss_decode(struct scc_channel *scc, unsigned char ch)
scc1493drivers/char/scc.cswitch (scc->stat.tx_kiss_state) 
scc1498drivers/char/scc.cif (!(scc->sndq2 = scc->sndq1 = scc_get_buffer(BT_TRANSMIT)))
scc1501drivers/char/scc.cscc->stat.tx_kiss_state = KISS_DATA;
scc1502drivers/char/scc.c} else scc->stat.txerrs++;
scc1507drivers/char/scc.cscc->stat.tx_kiss_state = KISS_ESCAPE;
scc1510drivers/char/scc.ckiss_interpret_frame(scc);  
scc1511drivers/char/scc.cscc->stat.tx_kiss_state = KISS_IDLE;
scc1513drivers/char/scc.celse kiss_store_byte(scc, ch);
scc1519drivers/char/scc.ckiss_store_byte(scc, FEND);
scc1520drivers/char/scc.cscc->stat.tx_kiss_state = KISS_DATA;
scc1524drivers/char/scc.ckiss_store_byte(scc, FESC);
scc1525drivers/char/scc.cscc->stat.tx_kiss_state = KISS_DATA;
scc1529drivers/char/scc.cscc_free_chain(scc->sndq1, BT_TRANSMIT);
scc1530drivers/char/scc.cscc->sndq2 = NULLBUF;
scc1531drivers/char/scc.cscc->stat.txerrs++;
scc1532drivers/char/scc.cscc->stat.tx_kiss_state = KISS_IDLE;
scc1545drivers/char/scc.ckiss_encode(register struct scc_channel *scc)
scc1548drivers/char/scc.cstruct tty_struct * tty = scc->tty;
scc1552drivers/char/scc.cif(!scc->rcvq)
scc1554drivers/char/scc.cscc->stat.rx_kiss_state = KISS_IDLE;
scc1562drivers/char/scc.cif (scc->rcvq->cnt)
scc1564drivers/char/scc.cbp = scc->rcvq;
scc1566drivers/char/scc.cif (scc->stat.rx_kiss_state == KISS_IDLE)
scc1570drivers/char/scc.cif (scc->kiss.not_slip)
scc1573drivers/char/scc.cscc->stat.rx_kiss_state = KISS_RXFRAME;
scc1595drivers/char/scc.cwhile (!scc->rcvq->cnt)
scc1597drivers/char/scc.cbp  = scc->rcvq->next;  /* next buffer */
scc1598drivers/char/scc.cbp2 = scc->rcvq->anext; /* next packet */
scc1601drivers/char/scc.cscc_return_buffer(scc->rcvq, BT_RECEIVE);
scc1605drivers/char/scc.cscc->rcvq = bp2;
scc1607drivers/char/scc.cif (--scc->stat.rx_queued < 0)
scc1608drivers/char/scc.cscc->stat.rx_queued = 0;
scc1610drivers/char/scc.cif (scc->stat.rx_kiss_state == KISS_RXFRAME)  /* new packet? */
scc1613drivers/char/scc.cscc->stat.rx_kiss_state = KISS_IDLE; /* generate FEND for new frame */
scc1620drivers/char/scc.c} else scc->rcvq = bp; /* next buffer */
scc1640drivers/char/scc.cstruct scc_channel *scc;
scc1657drivers/char/scc.cscc=&SCC_Info[2*chip];
scc1658drivers/char/scc.cif (!scc->ctrl) continue;
scc1664drivers/char/scc.cOutb(scc->ctrl, 0);
scc1665drivers/char/scc.cOutReg(scc->ctrl,R9,FHWRES);    /* force hardware reset */
scc1667drivers/char/scc.cwr(scc, R2, chip*16);      /* interrupt vector */
scc1668drivers/char/scc.cwr(scc, R9, VIS);      /* vector includes status */
scc1688drivers/char/scc.cstatic inline int scc_paranoia_check(struct scc_channel *scc, dev_t device, const char *routine)
scc1696drivers/char/scc.cif (!scc->init) 
scc1701drivers/char/scc.cif (scc->magic != SCC_MAGIC) {
scc1715drivers/char/scc.cstruct scc_channel *scc;
scc1722drivers/char/scc.cscc = &SCC_Info[chan];
scc1724drivers/char/scc.ctty->driver_data = scc;
scc1730drivers/char/scc.cif (scc->magic != SCC_MAGIC)
scc1736drivers/char/scc.cif(scc->tty != NULL)
scc1738drivers/char/scc.cscc->tty_opened++;
scc1742drivers/char/scc.cif(!scc->init) return 0;
scc1744drivers/char/scc.cscc->tty = tty;
scc1745drivers/char/scc.cinit_channel(scc);
scc1747drivers/char/scc.cscc->stat.tx_kiss_state = KISS_IDLE;  /* don't change this... */
scc1748drivers/char/scc.cscc->stat.rx_kiss_state = KISS_IDLE;  /* ...or this */
scc1750drivers/char/scc.cscc_init_timer(scc);
scc1765drivers/char/scc.cstruct scc_channel *scc = tty->driver_data;
scc1768drivers/char/scc.cif (!scc || (scc->magic != SCC_MAGIC))
scc1771drivers/char/scc.cif(scc->tty_opened)
scc1773drivers/char/scc.cscc->tty_opened--;
scc1781drivers/char/scc.cOutb(scc->ctrl,0);    /* Make sure pointer is written */
scc1782drivers/char/scc.cwr(scc,R1,0);      /* disable interrupts */
scc1783drivers/char/scc.cwr(scc,R3,0);
scc1785drivers/char/scc.cscc->tty = NULL;
scc1799drivers/char/scc.cscc_change_speed(struct scc_channel * scc)
scc1801drivers/char/scc.cif (scc->tty == NULL)
scc1804drivers/char/scc.cscc->modem.speed = baud_table[scc->tty->termios->c_cflag & CBAUD];
scc1806drivers/char/scc.cif (scc->stat.tx_state == 0)  /* only switch baudrate on rx... ;-) */
scc1807drivers/char/scc.cset_speed(scc);
scc1832drivers/char/scc.cstruct scc_channel * scc = tty->driver_data;
scc1839drivers/char/scc.cif (scc->magic != SCC_MAGIC) 
scc1864drivers/char/scc.cif (!scc->init)
scc1875drivers/char/scc.cmemcpy_fromfs(&scc->modem, (void *) arg, sizeof(struct scc_modem));
scc1879drivers/char/scc.cif (scc->modem.speed < 4800)
scc1881drivers/char/scc.cscc->kiss.txdelay = 36*TPS/100;    /* 360 ms */
scc1882drivers/char/scc.cscc->kiss.persist = 42;            /* 25% persistence */      /* was 25 */
scc1883drivers/char/scc.cscc->kiss.slottime = 16*TPS/100;   /* 160 ms */
scc1884drivers/char/scc.cscc->kiss.tailtime = 4;            /* minimal reasonable value */
scc1885drivers/char/scc.cscc->kiss.fulldup = 0;             /* CSMA */
scc1886drivers/char/scc.cscc->kiss.waittime = 50*TPS/100;   /* 500 ms */
scc1887drivers/char/scc.cscc->kiss.maxkeyup = 10;           /* 10 s */
scc1888drivers/char/scc.cscc->kiss.mintime = 3;             /* 3 s */
scc1889drivers/char/scc.cscc->kiss.idletime = 30;           /* 30 s */
scc1890drivers/char/scc.cscc->kiss.maxdefer = 120;     /* 2 min */
scc1891drivers/char/scc.cscc->kiss.not_slip = 1;       /* KISS mode */
scc1892drivers/char/scc.cscc->kiss.softdcd = 0;       /* hardware dcd */
scc1894drivers/char/scc.cscc->kiss.txdelay = 10*TPS/100;    /* 100 ms */
scc1895drivers/char/scc.cscc->kiss.persist = 64;            /* 25% persistence */      /* was 25 */
scc1896drivers/char/scc.cscc->kiss.slottime = 8*TPS/100;    /* 160 ms */
scc1897drivers/char/scc.cscc->kiss.tailtime = 1;            /* minimal reasonable value */
scc1898drivers/char/scc.cscc->kiss.fulldup = 0;             /* CSMA */
scc1899drivers/char/scc.cscc->kiss.waittime = 50*TPS/100;   /* 500 ms */
scc1900drivers/char/scc.cscc->kiss.maxkeyup = 7;            /* 7 s */
scc1901drivers/char/scc.cscc->kiss.mintime = 3;             /* 3 s */
scc1902drivers/char/scc.cscc->kiss.idletime = 30;           /* 30 s */
scc1903drivers/char/scc.cscc->kiss.maxdefer = 120;     /* 2 min */
scc1904drivers/char/scc.cscc->kiss.not_slip = 1;       /* KISS mode */
scc1905drivers/char/scc.cscc->kiss.softdcd = 0;       /* hardware dcd */
scc1908drivers/char/scc.cscc->init = 1;      
scc1926drivers/char/scc.cresult =  ((scc->wreg[R5] & RTS) ? TIOCM_RTS : 0)
scc1927drivers/char/scc.c| ((scc->wreg[R5] & DTR) ? TIOCM_DTR : 0)
scc1928drivers/char/scc.c| ((InReg(scc->ctrl,R0) & DCD)  ? TIOCM_CAR : 0)
scc1929drivers/char/scc.c| ((InReg(scc->ctrl,R0) & CTS)  ? TIOCM_CTS : 0);
scc1940drivers/char/scc.cscc->wreg[R5] |= DTR;
scc1941drivers/char/scc.cscc->wreg[R5] |= RTS;
scc1944drivers/char/scc.cscc->wreg[R5] &= ~DTR;
scc1945drivers/char/scc.cscc->wreg[R5] &= ~RTS;
scc1951drivers/char/scc.cscc->wreg[R5] |= DTR;
scc1953drivers/char/scc.cscc->wreg[R5] &= ~DTR;
scc1955drivers/char/scc.cscc->wreg[R5] |= RTS;
scc1957drivers/char/scc.cscc->wreg[R5] &= ~RTS;
scc1963drivers/char/scc.cif(scc->stat.tx_state == TXS_IDLE && !Running(t_idle))
scc1964drivers/char/scc.cmaxk_idle_timeout(scc);
scc1977drivers/char/scc.cmemcpy_tofs((void *) arg, scc->tty->termios, sizeof(struct termios));
scc1988drivers/char/scc.cmemcpy_fromfs(scc->tty->termios, (void *) arg, sizeof(struct termios));
scc1989drivers/char/scc.cscc_change_speed(scc);
scc2001drivers/char/scc.cscc->stat.used_buf = scc_count_used_buffers(&scc->stat.rx_alloc, 
scc2002drivers/char/scc.c&scc->stat.tx_alloc);
scc2004drivers/char/scc.cmemcpy_tofs((void *) arg, &scc->stat, sizeof(struct scc_stat));
scc2025drivers/char/scc.ccase PARAM_TXDELAY:  r = CAST(scc->kiss.txdelay*TICKS);  break;
scc2026drivers/char/scc.ccase PARAM_PERSIST:  r = CAST(scc->kiss.persist);     break;
scc2027drivers/char/scc.ccase PARAM_SLOTTIME:  r = CAST(scc->kiss.slottime*TICKS);  break;
scc2028drivers/char/scc.ccase PARAM_TXTAIL:  r = CAST(scc->kiss.tailtime*TICKS);  break;
scc2029drivers/char/scc.ccase PARAM_FULLDUP:  r = CAST(scc->kiss.fulldup);     break;
scc2030drivers/char/scc.ccase PARAM_SOFTDCD:  r = CAST(scc->kiss.softdcd);    break;
scc2031drivers/char/scc.ccase PARAM_DTR:    r = CAST((scc->wreg[R5] & DTR)? 1:0); break;
scc2032drivers/char/scc.ccase PARAM_RTS:    r = CAST((scc->wreg[R5] & RTS)? 1:0); break;
scc2033drivers/char/scc.ccase PARAM_SPEED:  r = CAST(scc->modem.speed);  break;
scc2034drivers/char/scc.ccase PARAM_GROUP:  r = CAST(scc->kiss.group);     break;
scc2035drivers/char/scc.ccase PARAM_IDLE:  r = CAST(scc->kiss.idletime);    break;
scc2036drivers/char/scc.ccase PARAM_MIN:    r = CAST(scc->kiss.mintime);    break;
scc2037drivers/char/scc.ccase PARAM_MAXKEY:  r = CAST(scc->kiss.maxkeyup);    break;
scc2038drivers/char/scc.ccase PARAM_WAIT:  r = CAST(scc->kiss.waittime);    break;
scc2039drivers/char/scc.ccase PARAM_MAXDEFER:  r = CAST(scc->kiss.maxdefer);    break;
scc2040drivers/char/scc.ccase PARAM_TX:    r = CAST(scc->kiss.tx_inhibit);  break;
scc2041drivers/char/scc.ccase PARAM_SLIP:  r = CAST(!scc->kiss.not_slip);    break;
scc2062drivers/char/scc.ccase PARAM_TXDELAY:  scc->kiss.txdelay=VAL;    break;
scc2063drivers/char/scc.ccase PARAM_PERSIST:  scc->kiss.persist=Val;    break;
scc2064drivers/char/scc.ccase PARAM_SLOTTIME:  scc->kiss.slottime=VAL;    break;
scc2065drivers/char/scc.ccase PARAM_TXTAIL:  scc->kiss.tailtime=VAL;    break;
scc2066drivers/char/scc.ccase PARAM_FULLDUP:  scc->kiss.fulldup=Val;    break;
scc2067drivers/char/scc.ccase PARAM_SOFTDCD:  scc->kiss.softdcd=Val;    break;
scc2070drivers/char/scc.ccase PARAM_SPEED:  scc->modem.speed=Val;    break;
scc2071drivers/char/scc.ccase PARAM_GROUP:  scc->kiss.group=Val;    break;
scc2072drivers/char/scc.ccase PARAM_IDLE:  scc->kiss.idletime=Val;    break;
scc2073drivers/char/scc.ccase PARAM_MIN:    scc->kiss.mintime=SVAL;    break;
scc2074drivers/char/scc.ccase PARAM_MAXKEY:  scc->kiss.maxkeyup=SVAL;  break;
scc2075drivers/char/scc.ccase PARAM_WAIT:  scc->kiss.waittime=Val;    break;
scc2076drivers/char/scc.ccase PARAM_MAXDEFER:  scc->kiss.maxdefer=SVAL;  break;
scc2077drivers/char/scc.ccase PARAM_TX:    scc->kiss.tx_inhibit=Val;  break;
scc2078drivers/char/scc.ccase PARAM_SLIP:  scc->kiss.not_slip=!Val;  break;
scc2107drivers/char/scc.cstatic inline void check_tx_queue(register struct scc_channel *scc)
scc2111drivers/char/scc.cif (scc->stat.tx_queued > QUEUE_THRES)
scc2113drivers/char/scc.cif (scc->sndq1 == NULLBUF)
scc2116drivers/char/scc.c" (%d) but queue is empty\n", scc->stat.tx_queued);
scc2118drivers/char/scc.cscc->stat.tx_queued = 0;  /* correct it */
scc2119drivers/char/scc.cscc->stat.nospace = 54321;  /* draw attention to it */
scc2123drivers/char/scc.cbp = scc->sndq1->anext;  /* don't use the one we currently use */
scc2125drivers/char/scc.cwhile (bp && (scc->stat.tx_queued > QUEUE_HYST))
scc2128drivers/char/scc.cscc->stat.tx_queued--;
scc2129drivers/char/scc.cscc->stat.nospace++;
scc2132drivers/char/scc.cscc->sndq1->anext = bp;
scc2143drivers/char/scc.cstruct scc_channel * scc = tty->driver_data;
scc2149drivers/char/scc.cif (scc_paranoia_check(scc, tty->device, "scc_write"))
scc2152drivers/char/scc.cif (scc->kiss.tx_inhibit) return count;
scc2154drivers/char/scc.ccheck_tx_queue(scc);
scc2173drivers/char/scc.cif (kiss_decode(scc, *p++))
scc2175drivers/char/scc.cscc->stat.nospace++;
scc2189drivers/char/scc.cstruct scc_channel *scc = tty->driver_data;
scc2192drivers/char/scc.cif (scc_paranoia_check(scc, tty->device, "scc_put_char"))
scc2201drivers/char/scc.cstruct scc_channel *scc = tty->driver_data;
scc2203drivers/char/scc.cscc_paranoia_check(scc, tty->device, "scc_flush_chars"); /* just to annoy the user... */
scc2212drivers/char/scc.cstruct scc_channel *scc = tty->driver_data;
scc2214drivers/char/scc.cif (scc_paranoia_check(scc, tty->device, "scc_write_room"))
scc2217drivers/char/scc.cif (scc->stat.tx_alloc >= QUEUE_THRES)
scc2228drivers/char/scc.cstruct scc_channel *scc = tty->driver_data;
scc2230drivers/char/scc.cif (scc && scc->sndq2)
scc2231drivers/char/scc.creturn scc->sndq2->cnt;
scc2238drivers/char/scc.cstruct scc_channel *scc = tty->driver_data;
scc2240drivers/char/scc.cif (scc_paranoia_check(scc, tty->device, "scc_flush_buffer"))
scc2243drivers/char/scc.cscc->stat.tx_kiss_state = KISS_IDLE;
scc2253drivers/char/scc.cstruct scc_channel *scc = tty->driver_data;
scc2255drivers/char/scc.cif (scc_paranoia_check(scc, tty->device, "scc_throttle"))
scc2264drivers/char/scc.cstruct scc_channel *scc = tty->driver_data;
scc2266drivers/char/scc.cif (scc_paranoia_check(scc, tty->device, "scc_unthrottle"))
scc2274drivers/char/scc.cstruct scc_channel *scc = tty->driver_data;
scc2276drivers/char/scc.cif (scc_paranoia_check(scc, tty->device, "scc_start"))
scc2285drivers/char/scc.cstruct scc_channel *scc = tty->driver_data;
scc2287drivers/char/scc.cif (scc_paranoia_check(scc, tty->device, "scc_stop"))
scc130include/linux/scc.h#define Running(k) (scc->k != TIMER_STOPPED)
scc131include/linux/scc.h#define Expired(k) (scc->k != TIMER_STOPPED) && (!(scc->k) || (--(scc->k) == 0))
scc132include/linux/scc.h#define Stop_Timer(k) scc->k = TIMER_STOPPED
scc271include/linux/scc.hstruct scc_channel *scc;