tag | line | file | source code |
scc | 110 | drivers/char/scc.c | static void scc_change_speed(struct scc_channel *scc); |
scc | 111 | drivers/char/scc.c | static void init_channel(struct scc_channel *scc); |
scc | 112 | drivers/char/scc.c | static void scc_key_trx (struct scc_channel *scc, char tx); |
scc | 113 | drivers/char/scc.c | static void scc_txint(register struct scc_channel *scc); |
scc | 114 | drivers/char/scc.c | static void scc_exint(register struct scc_channel *scc); |
scc | 115 | drivers/char/scc.c | static void scc_rxint(register struct scc_channel *scc); |
scc | 116 | drivers/char/scc.c | static void scc_spint(register struct scc_channel *scc); |
scc | 119 | drivers/char/scc.c | static void scc_init_timer(struct scc_channel *scc); |
scc | 185 | drivers/char/scc.c | wr(register struct scc_channel *scc, register unsigned char reg, register unsigned char val) |
scc | 187 | drivers/char/scc.c | OutReg(scc->ctrl, reg, (scc->wreg[reg] = val)); |
scc | 191 | drivers/char/scc.c | or(register struct scc_channel *scc, register unsigned char reg, register unsigned char val) |
scc | 193 | drivers/char/scc.c | OutReg(scc->ctrl, reg, (scc->wreg[reg] |= val)); |
scc | 197 | drivers/char/scc.c | cl(register struct scc_channel *scc, register unsigned char reg, register unsigned char val) |
scc | 199 | drivers/char/scc.c | OutReg(scc->ctrl, reg, (scc->wreg[reg] &= ~val)); |
scc | 480 | drivers/char/scc.c | scc_isr_dispatch(register struct scc_channel *scc, register int vector) |
scc | 484 | drivers/char/scc.c | case TXINT: scc_txint(scc); break; |
scc | 485 | drivers/char/scc.c | case EXINT: scc_exint(scc); break; |
scc | 486 | drivers/char/scc.c | case RXINT: scc_rxint(scc); break; |
scc | 487 | drivers/char/scc.c | case SPINT: scc_spint(scc); break; |
scc | 488 | drivers/char/scc.c | default : printk("scc_isr(): unknown interrupt status (addr %4.4x, state %2.2x)\n",scc->ctrl,vector); |
scc | 505 | drivers/char/scc.c | register struct scc_channel *scc; |
scc | 529 | drivers/char/scc.c | scc=&SCC_Info[(((vector>>1)&0x7c)^0x04) >> 2]; |
scc | 531 | drivers/char/scc.c | if (!scc->tty) break; |
scc | 533 | drivers/char/scc.c | scc_isr_dispatch(scc, vector); |
scc | 535 | drivers/char/scc.c | Outb(scc->ctrl,0x38); /* Reset Highest IUS" opcode to WR0 */ |
scc | 570 | drivers/char/scc.c | scc = &SCC_Info[(((vector >> 1) & 0x7c) ^ 0x04) >> 2]; |
scc | 572 | drivers/char/scc.c | if (!scc->tty) break; |
scc | 576 | drivers/char/scc.c | scc_isr_dispatch(scc, vector); |
scc | 593 | drivers/char/scc.c | static inline void prepare_next_txframe(register struct scc_channel *scc) |
scc | 595 | drivers/char/scc.c | if ((scc->tbp = scc->sndq)) |
scc | 597 | drivers/char/scc.c | scc->sndq = scc->sndq->anext; |
scc | 598 | drivers/char/scc.c | scc->stat.tx_state = TXS_NEWFRAME; |
scc | 601 | drivers/char/scc.c | scc->stat.tx_state = TXS_BUSY; |
scc | 602 | drivers/char/scc.c | scc->t_tail = scc->kiss.tailtime; |
scc | 609 | drivers/char/scc.c | scc_txint(register struct scc_channel *scc) |
scc | 613 | drivers/char/scc.c | scc->stat.txints++; |
scc | 615 | drivers/char/scc.c | bp = scc->tbp; |
scc | 622 | drivers/char/scc.c | if (--scc->stat.tx_queued < 0) |
scc | 623 | drivers/char/scc.c | scc->stat.tx_queued = 0; |
scc | 625 | drivers/char/scc.c | Outb(scc->ctrl,RES_Tx_P); /* reset pending int */ |
scc | 626 | drivers/char/scc.c | cl(scc,R10,ABUNDER); /* frame complete, allow CRC transmit */ |
scc | 627 | drivers/char/scc.c | prepare_next_txframe(scc); |
scc | 631 | drivers/char/scc.c | if (scc->stat.tx_state == TXS_NEWFRAME) |
scc | 633 | drivers/char/scc.c | Outb(scc->ctrl, RES_Tx_CRC); /* reset CRC generator */ |
scc | 634 | drivers/char/scc.c | or(scc,R10,ABUNDER); /* re-install underrun protection */ |
scc | 635 | drivers/char/scc.c | Outb(scc->data,bp->data[bp->in_use++]); |
scc | 637 | drivers/char/scc.c | if (!scc->enhanced) /* reset EOM latch */ |
scc | 638 | drivers/char/scc.c | Outb(scc->ctrl, RES_EOM_L); |
scc | 640 | drivers/char/scc.c | scc->stat.tx_state = TXS_ACTIVE;/* next byte... */ |
scc | 642 | drivers/char/scc.c | Outb(scc->data,bp->data[bp->in_use++]); |
scc | 646 | drivers/char/scc.c | scc->tbp=bp; /* store buffer address */ |
scc | 653 | drivers/char/scc.c | flush_FIFO(register struct scc_channel *scc) |
scc | 658 | drivers/char/scc.c | Inb(scc->data); |
scc | 660 | drivers/char/scc.c | if(scc->rxbufcnt > 0) |
scc | 662 | drivers/char/scc.c | scc->stat.rxerrs++; |
scc | 663 | drivers/char/scc.c | scc->rxbufcnt = 0; /* throw away frame */ |
scc | 669 | drivers/char/scc.c | scc_exint(register struct scc_channel *scc) |
scc | 673 | drivers/char/scc.c | scc->stat.exints++; |
scc | 675 | drivers/char/scc.c | status = InReg(scc->ctrl,R0); |
scc | 676 | drivers/char/scc.c | changes = status ^ scc->status; |
scc | 682 | drivers/char/scc.c | flush_FIFO(scc); |
scc | 692 | drivers/char/scc.c | if (scc->modem.clocksrc != CLK_EXTERNAL) |
scc | 693 | drivers/char/scc.c | OutReg(scc->ctrl,R14,SEARCH|scc->wreg[R14]); /* DPLL: enter search mode */ |
scc | 695 | drivers/char/scc.c | or(scc,R3,ENT_HM|RxENABLE); /* enable the receiver, hunt mode */ |
scc | 697 | drivers/char/scc.c | cl(scc,R3,ENT_HM|RxENABLE); /* disable the receiver */ |
scc | 698 | drivers/char/scc.c | flush_FIFO(scc); |
scc | 707 | drivers/char/scc.c | if (!Running(t_txdel) && scc->kiss.txdelay == 0) /* zero TXDELAY = wait for CTS */ |
scc | 708 | drivers/char/scc.c | scc->t_txdel = 0; /* kick it! */ |
scc | 712 | drivers/char/scc.c | if ((scc->stat.tx_state == TXS_ACTIVE) && (status & TxEOM)) |
scc | 714 | drivers/char/scc.c | scc->stat.tx_under++; /* oops, an underrun! count 'em */ |
scc | 715 | drivers/char/scc.c | Outb(scc->ctrl, RES_Tx_P); |
scc | 716 | drivers/char/scc.c | Outb(scc->ctrl, RES_EXT_INT); /* reset ext/status interrupts */ |
scc | 717 | drivers/char/scc.c | scc->t_maxk = 1; |
scc | 718 | drivers/char/scc.c | scc->tbp = scc_free_chain(scc->tbp, BT_TRANSMIT); |
scc | 720 | drivers/char/scc.c | if (--scc->stat.tx_queued < 0) scc->stat.tx_queued = 0; |
scc | 721 | drivers/char/scc.c | or(scc,R10,ABUNDER); |
scc | 726 | drivers/char/scc.c | scc->stat.tx_under = 9999; /* errr... yes. */ |
scc | 727 | drivers/char/scc.c | Outb(scc->ctrl, RES_Tx_P); /* just to be sure */ |
scc | 728 | drivers/char/scc.c | scc->t_maxk = 1; |
scc | 729 | drivers/char/scc.c | scc->tbp = scc_free_chain(scc->tbp, BT_TRANSMIT); |
scc | 730 | drivers/char/scc.c | if (--scc->stat.tx_queued < 0) scc->stat.tx_queued = 0; |
scc | 731 | drivers/char/scc.c | scc->kiss.tx_inhibit = 1; /* don't try it again! */ |
scc | 735 | drivers/char/scc.c | scc->status = status; |
scc | 736 | drivers/char/scc.c | Outb(scc->ctrl,RES_EXT_INT); |
scc | 742 | drivers/char/scc.c | scc_rxint(register struct scc_channel *scc) |
scc | 746 | drivers/char/scc.c | scc->stat.rxints++; |
scc | 748 | drivers/char/scc.c | if( Running(t_maxk) && !(scc->kiss.fulldup)) |
scc | 750 | drivers/char/scc.c | Inb(scc->data); /* discard char */ |
scc | 751 | drivers/char/scc.c | or(scc,R3,ENT_HM); /* enter hunt mode for next flag */ |
scc | 755 | drivers/char/scc.c | if (scc->rxbufcnt > 2044) /* no buffer available? */ |
scc | 757 | drivers/char/scc.c | Inb(scc->data); /* discard character */ |
scc | 758 | drivers/char/scc.c | or(scc,R3,ENT_HM); /* enter hunt mode */ |
scc | 759 | drivers/char/scc.c | scc->rxbufcnt = 0; /* throw away frame */ |
scc | 760 | drivers/char/scc.c | scc->stat.nospace++; /* and count this error */ |
scc | 764 | drivers/char/scc.c | if(scc->rxbufcnt == 0) /* make begin of kissframe */ |
scc | 766 | drivers/char/scc.c | scc->rxbuf[scc->rxbufcnt++] = FEND; |
scc | 767 | drivers/char/scc.c | if (scc->kiss.not_slip) |
scc | 768 | drivers/char/scc.c | scc->rxbuf[scc->rxbufcnt++] = 0; |
scc | 771 | drivers/char/scc.c | switch( ch = Inb(scc->data) ) |
scc | 774 | drivers/char/scc.c | scc->rxbuf[scc->rxbufcnt++] = FESC; |
scc | 775 | drivers/char/scc.c | scc->rxbuf[scc->rxbufcnt++] = TFEND; |
scc | 778 | drivers/char/scc.c | scc->rxbuf[scc->rxbufcnt++] = FESC; |
scc | 779 | drivers/char/scc.c | scc->rxbuf[scc->rxbufcnt++] = TFESC; |
scc | 782 | drivers/char/scc.c | scc->rxbuf[scc->rxbufcnt++] = ch; |
scc | 790 | drivers/char/scc.c | scc_spint(register struct scc_channel *scc) |
scc | 799 | drivers/char/scc.c | scc->stat.spints++; |
scc | 801 | drivers/char/scc.c | status = InReg(scc->ctrl,R1); /* read Special Receive Condition status */ |
scc | 803 | drivers/char/scc.c | Inb(scc->data); /* read byte */ |
scc | 807 | drivers/char/scc.c | scc->stat.rx_over++; |
scc | 808 | drivers/char/scc.c | or(scc,R3,ENT_HM); /* enter hunt mode */ |
scc | 809 | drivers/char/scc.c | scc->rxbufcnt = 0; /* rewind the buffer */ |
scc | 812 | drivers/char/scc.c | if(status & END_FR && scc->rxbufcnt != 0) /* END of FRame */ |
scc | 814 | drivers/char/scc.c | if (!(status & CRC_ERR) && (status & 0xe) == RES8 && scc->rxbufcnt > 0) |
scc | 816 | drivers/char/scc.c | scc->rxbufcnt--; /*strip the CRC */ |
scc | 817 | drivers/char/scc.c | scc->rxbuf[scc->rxbufcnt++] = FEND; |
scc | 819 | drivers/char/scc.c | for(i = 0 ; i < scc->rxbufcnt ; i++) |
scc | 821 | drivers/char/scc.c | if((scc->tty->flip.count + 1) < TTY_FLIPBUF_SIZE) |
scc | 822 | drivers/char/scc.c | tty_insert_flip_char(scc->tty, scc->rxbuf[i], 0); |
scc | 824 | drivers/char/scc.c | if (scc->tty->flip.buf_num) { |
scc | 825 | drivers/char/scc.c | cp = scc->tty->flip.char_buf + TTY_FLIPBUF_SIZE; |
scc | 826 | drivers/char/scc.c | fp = scc->tty->flip.flag_buf + TTY_FLIPBUF_SIZE; |
scc | 827 | drivers/char/scc.c | scc->tty->flip.buf_num = 0; |
scc | 828 | drivers/char/scc.c | scc->tty->flip.char_buf_ptr = scc->tty->flip.char_buf; |
scc | 829 | drivers/char/scc.c | scc->tty->flip.flag_buf_ptr = scc->tty->flip.flag_buf; |
scc | 831 | drivers/char/scc.c | cp = scc->tty->flip.char_buf; |
scc | 832 | drivers/char/scc.c | fp = scc->tty->flip.flag_buf; |
scc | 833 | drivers/char/scc.c | scc->tty->flip.buf_num = 1; |
scc | 834 | drivers/char/scc.c | scc->tty->flip.char_buf_ptr = scc->tty->flip.char_buf + TTY_FLIPBUF_SIZE; |
scc | 835 | drivers/char/scc.c | scc->tty->flip.flag_buf_ptr = scc->tty->flip.flag_buf + TTY_FLIPBUF_SIZE; |
scc | 837 | drivers/char/scc.c | count = scc->tty->flip.count; |
scc | 838 | drivers/char/scc.c | scc->tty->flip.count = 0; |
scc | 839 | drivers/char/scc.c | scc->tty->ldisc.receive_buf(scc->tty, cp, fp, count); |
scc | 840 | drivers/char/scc.c | tty_insert_flip_char(scc->tty, scc->rxbuf[i], 0); |
scc | 844 | drivers/char/scc.c | if (scc->tty->flip.buf_num) { |
scc | 845 | drivers/char/scc.c | cp = scc->tty->flip.char_buf + TTY_FLIPBUF_SIZE; |
scc | 846 | drivers/char/scc.c | fp = scc->tty->flip.flag_buf + TTY_FLIPBUF_SIZE; |
scc | 847 | drivers/char/scc.c | scc->tty->flip.buf_num = 0; |
scc | 848 | drivers/char/scc.c | scc->tty->flip.char_buf_ptr = scc->tty->flip.char_buf; |
scc | 849 | drivers/char/scc.c | scc->tty->flip.flag_buf_ptr = scc->tty->flip.flag_buf; |
scc | 851 | drivers/char/scc.c | cp = scc->tty->flip.char_buf; |
scc | 852 | drivers/char/scc.c | fp = scc->tty->flip.flag_buf; |
scc | 853 | drivers/char/scc.c | scc->tty->flip.buf_num = 1; |
scc | 854 | drivers/char/scc.c | scc->tty->flip.char_buf_ptr = scc->tty->flip.char_buf + TTY_FLIPBUF_SIZE; |
scc | 855 | drivers/char/scc.c | scc->tty->flip.flag_buf_ptr = scc->tty->flip.flag_buf + TTY_FLIPBUF_SIZE; |
scc | 857 | drivers/char/scc.c | count = scc->tty->flip.count; |
scc | 858 | drivers/char/scc.c | scc->tty->flip.count = 0; |
scc | 859 | drivers/char/scc.c | scc->tty->ldisc.receive_buf(scc->tty, cp, fp, count); |
scc | 860 | drivers/char/scc.c | scc->stat.rxframes++; |
scc | 862 | drivers/char/scc.c | scc->rxbufcnt = 0; |
scc | 865 | drivers/char/scc.c | scc->rxbufcnt = 0; /* frame is not good */ |
scc | 866 | drivers/char/scc.c | scc->stat.rxerrs++; |
scc | 869 | drivers/char/scc.c | Outb(scc->ctrl,ERR_RES); |
scc | 880 | drivers/char/scc.c | static inline void set_brg(register struct scc_channel *scc, unsigned int tc) |
scc | 886 | drivers/char/scc.c | cl(scc,R14,BRENABL); /* disable baudrate generator */ |
scc | 887 | drivers/char/scc.c | wr(scc,R12,tc & 255); /* brg rate LOW */ |
scc | 888 | drivers/char/scc.c | wr(scc,R13,tc >> 8); /* brg rate HIGH */ |
scc | 889 | drivers/char/scc.c | or(scc,R14,BRENABL); /* enable baudrate generator */ |
scc | 894 | drivers/char/scc.c | static inline void set_speed(register struct scc_channel *scc) |
scc | 896 | drivers/char/scc.c | set_brg(scc, (unsigned) (Clock / (scc->modem.speed * 64)) - 2); |
scc | 902 | drivers/char/scc.c | static inline void init_brg(register struct scc_channel *scc) |
scc | 904 | drivers/char/scc.c | wr(scc, R14, BRSRC); /* BRG source = PCLK */ |
scc | 905 | drivers/char/scc.c | OutReg(scc->ctrl, R14, SSBR|scc->wreg[R14]); /* DPLL source = BRG */ |
scc | 906 | drivers/char/scc.c | OutReg(scc->ctrl, R14, SNRZI|scc->wreg[R14]); /* DPLL NRZI mode */ |
scc | 910 | drivers/char/scc.c | init_channel(register struct scc_channel *scc) |
scc | 916 | drivers/char/scc.c | wr(scc,R1,0); /* no W/REQ operation */ |
scc | 917 | drivers/char/scc.c | wr(scc,R3,Rx8|RxCRC_ENAB); /* RX 8 bits/char, CRC, disabled */ |
scc | 918 | drivers/char/scc.c | wr(scc,R4,X1CLK|SDLC); /* *1 clock, SDLC mode */ |
scc | 919 | drivers/char/scc.c | wr(scc,R5,Tx8|DTR|TxCRC_ENAB); /* TX 8 bits/char, disabled, DTR */ |
scc | 920 | drivers/char/scc.c | wr(scc,R6,0); /* SDLC address zero (not used) */ |
scc | 921 | drivers/char/scc.c | wr(scc,R7,FLAG); /* SDLC flag value */ |
scc | 922 | drivers/char/scc.c | wr(scc,R9,VIS); /* vector includes status */ |
scc | 923 | drivers/char/scc.c | wr(scc,R10,(scc->modem.nrz? NRZ : NRZI)|CRCPS|ABUNDER); /* abort on underrun, preset CRC generator, NRZ(I) */ |
scc | 924 | drivers/char/scc.c | wr(scc,R14, 0); |
scc | 953 | drivers/char/scc.c | switch(scc->modem.clocksrc) |
scc | 956 | drivers/char/scc.c | wr(scc, R11, RCDPLL|TCDPLL|TRxCOI|TRxCDP); |
scc | 957 | drivers/char/scc.c | init_brg(scc); |
scc | 961 | drivers/char/scc.c | wr(scc, R11, ((Board & BAYCOM)? TRxCDP : TRxCBR) | RCDPLL|TCRTxCP|TRxCOI); |
scc | 962 | drivers/char/scc.c | init_brg(scc); |
scc | 966 | drivers/char/scc.c | wr(scc, R11, (Board & BAYCOM)? RCTRxCP|TCRTxCP : RCRTxCP|TCTRxCP); |
scc | 967 | drivers/char/scc.c | OutReg(scc->ctrl, R14, DISDPLL); |
scc | 973 | drivers/char/scc.c | wr(scc,R15,((Board & BAYCOM) ? 0 : CTSIE)|BRKIE|DCDIE|TxUIE); |
scc | 975 | drivers/char/scc.c | if(scc->enhanced) |
scc | 977 | drivers/char/scc.c | or(scc,R15,SHDLCE|FIFOE); /* enable FIFO, SDLC/HDLC Enhancements (From now R7 is R7') */ |
scc | 978 | drivers/char/scc.c | wr(scc,R7,AUTOEOM); |
scc | 981 | drivers/char/scc.c | if((InReg(scc->ctrl,R0)) & DCD) /* DCD is now ON */ |
scc | 983 | drivers/char/scc.c | if (scc->modem.clocksrc != CLK_EXTERNAL) |
scc | 984 | drivers/char/scc.c | or(scc,R14, SEARCH); |
scc | 986 | drivers/char/scc.c | or(scc,R3,ENT_HM|RxENABLE); /* enable the receiver, hunt mode */ |
scc | 989 | drivers/char/scc.c | Outb(scc->ctrl,RES_EXT_INT); /* reset ext/status interrupts */ |
scc | 990 | drivers/char/scc.c | Outb(scc->ctrl,RES_EXT_INT); /* must be done twice */ |
scc | 992 | drivers/char/scc.c | scc->status = InReg(scc->ctrl,R0); /* read initial status */ |
scc | 993 | drivers/char/scc.c | scc->rxbufcnt = 0; |
scc | 994 | drivers/char/scc.c | or(scc,R1,INT_ALL_Rx|TxINT_ENAB|EXT_INT_ENAB); /* enable interrupts */ |
scc | 995 | drivers/char/scc.c | or(scc,R9,MIE); /* master interrupt enable */ |
scc | 999 | drivers/char/scc.c | set_speed(scc); |
scc | 1014 | drivers/char/scc.c | scc_key_trx(struct scc_channel *scc, char tx) |
scc | 1018 | drivers/char/scc.c | if (scc->modem.speed < baud_table[1]) |
scc | 1019 | drivers/char/scc.c | scc->modem.speed = 1200; |
scc | 1022 | drivers/char/scc.c | Outb(scc->ctrl + 4, Option | (tx? 0x80 : 0)); |
scc | 1024 | drivers/char/scc.c | time_const = (unsigned) (Clock / (scc->modem.speed * (tx? 2:64))) - 2; |
scc | 1026 | drivers/char/scc.c | if (scc->modem.clocksrc == CLK_DPLL) |
scc | 1030 | drivers/char/scc.c | cl(scc,R3,RxENABLE|ENT_HM); /* then switch off receiver */ |
scc | 1032 | drivers/char/scc.c | set_brg(scc, time_const); /* reprogram baudrate generator */ |
scc | 1035 | drivers/char/scc.c | wr(scc, R11, RCDPLL|TCBR|TRxCOI|TRxCBR); |
scc | 1037 | drivers/char/scc.c | or(scc,R5,RTS|TxENAB); /* set the RTS line and enable TX */ |
scc | 1039 | drivers/char/scc.c | cl(scc,R5,RTS|TxENAB); |
scc | 1041 | drivers/char/scc.c | set_brg(scc, time_const); /* reprogram baudrate generator */ |
scc | 1044 | drivers/char/scc.c | wr(scc, R11, RCDPLL|TCDPLL|TRxCOI|TRxCDP); |
scc | 1046 | drivers/char/scc.c | or(scc,R3,RxENABLE|ENT_HM); |
scc | 1050 | drivers/char/scc.c | or(scc,R5,RTS|TxENAB); /* enable tx */ |
scc | 1052 | drivers/char/scc.c | cl(scc,R5,RTS|TxENAB); /* disable tx */ |
scc | 1061 | drivers/char/scc.c | static inline int is_grouped(register struct scc_channel *scc) |
scc | 1067 | drivers/char/scc.c | grp1 = scc->kiss.group; |
scc | 1074 | drivers/char/scc.c | if (scc2 == scc || !(scc2->tty && grp2)) |
scc | 1090 | drivers/char/scc.c | static inline void dw_slot_timeout(register struct scc_channel *scc) |
scc | 1092 | drivers/char/scc.c | scc->t_dwait = TIMER_STOPPED; |
scc | 1093 | drivers/char/scc.c | scc->t_slot = TIMER_STOPPED; |
scc | 1095 | drivers/char/scc.c | if (!scc->kiss.fulldup) |
scc | 1099 | drivers/char/scc.c | if ( (scc->kiss.softdcd? !(scc->status & SYNC_HUNT):(scc->status & DCD)) || (scc->kiss.persist) < Rand || (scc->kiss.group && is_grouped(scc)) ) |
scc | 1101 | drivers/char/scc.c | if (scc->t_mbusy == TIMER_STOPPED) |
scc | 1102 | drivers/char/scc.c | scc->t_mbusy = TPS * scc->kiss.maxdefer; |
scc | 1104 | drivers/char/scc.c | scc->t_slot = scc->kiss.slottime; |
scc | 1110 | drivers/char/scc.c | if ( !(scc->wreg[R5] & RTS) ) |
scc | 1112 | drivers/char/scc.c | scc->t_txdel = scc->kiss.txdelay; |
scc | 1113 | drivers/char/scc.c | scc_key_trx(scc, TX_ON); |
scc | 1115 | drivers/char/scc.c | scc->t_txdel = 0; |
scc | 1122 | drivers/char/scc.c | static inline void txdel_timeout(register struct scc_channel *scc) |
scc | 1124 | drivers/char/scc.c | scc->t_txdel = TIMER_STOPPED; |
scc | 1126 | drivers/char/scc.c | scc->t_maxk = TPS * scc->kiss.maxkeyup; |
scc | 1127 | drivers/char/scc.c | prepare_next_txframe(scc); |
scc | 1129 | drivers/char/scc.c | if (scc->stat.tx_state != TXS_BUSY) |
scc | 1130 | drivers/char/scc.c | scc_txint(scc); |
scc | 1135 | drivers/char/scc.c | static inline void tail_timeout(register struct scc_channel *scc) |
scc | 1137 | drivers/char/scc.c | scc->t_tail = TIMER_STOPPED; |
scc | 1147 | drivers/char/scc.c | if (scc->kiss.fulldup < 2) |
scc | 1149 | drivers/char/scc.c | if (scc->sndq) /* we had a timeout? */ |
scc | 1151 | drivers/char/scc.c | scc->stat.tx_state = TXS_BUSY; |
scc | 1152 | drivers/char/scc.c | scc->t_dwait = TPS * scc->kiss.mintime; /* try again */ |
scc | 1155 | drivers/char/scc.c | scc->stat.tx_state = TXS_IDLE; |
scc | 1156 | drivers/char/scc.c | scc->t_maxk = TIMER_STOPPED; |
scc | 1157 | drivers/char/scc.c | scc_key_trx(scc, TX_OFF); |
scc | 1161 | drivers/char/scc.c | if (scc->sndq) /* maxkeyup expired */ /* ?! */ |
scc | 1163 | drivers/char/scc.c | scc->stat.tx_state = TXS_BUSY; |
scc | 1164 | drivers/char/scc.c | scc->t_txdel = TPS * scc->kiss.waittime; |
scc | 1168 | drivers/char/scc.c | scc->t_idle = TPS * scc->kiss.idletime; |
scc | 1172 | drivers/char/scc.c | static inline void busy_timeout(register struct scc_channel *scc) |
scc | 1177 | drivers/char/scc.c | bp = scc->sndq; |
scc | 1181 | drivers/char/scc.c | scc->sndq = NULLBUF; |
scc | 1182 | drivers/char/scc.c | scc->stat.tx_state = TXS_IDLE; |
scc | 1185 | drivers/char/scc.c | scc->t_txdel = scc->kiss.txdelay; /* brute force ... */ |
scc | 1187 | drivers/char/scc.c | scc->t_mbusy = TIMER_STOPPED; |
scc | 1192 | drivers/char/scc.c | static inline void maxk_idle_timeout(register struct scc_channel *scc) |
scc | 1194 | drivers/char/scc.c | scc->t_maxk = TIMER_STOPPED; |
scc | 1195 | drivers/char/scc.c | scc->t_idle = TIMER_STOPPED; |
scc | 1197 | drivers/char/scc.c | scc->stat.tx_state = TXS_BUSY; |
scc | 1198 | drivers/char/scc.c | scc->t_tail = scc->kiss.tailtime; |
scc | 1204 | drivers/char/scc.c | register struct scc_channel *scc; |
scc | 1212 | drivers/char/scc.c | scc = &SCC_Info[chan]; |
scc | 1214 | drivers/char/scc.c | if (scc->tty && scc->init) |
scc | 1217 | drivers/char/scc.c | if (Expired(t_dwait)) dw_slot_timeout(scc) ; else |
scc | 1218 | drivers/char/scc.c | if (Expired(t_slot)) dw_slot_timeout(scc) ; else |
scc | 1219 | drivers/char/scc.c | if (Expired(t_txdel)) txdel_timeout(scc) ; else |
scc | 1220 | drivers/char/scc.c | if (Expired(t_tail)) tail_timeout(scc) ; |
scc | 1224 | drivers/char/scc.c | if (Expired(t_mbusy)) busy_timeout(scc); |
scc | 1225 | drivers/char/scc.c | if (Expired(t_maxk)) maxk_idle_timeout(scc); |
scc | 1226 | drivers/char/scc.c | if (Expired(t_idle)) maxk_idle_timeout(scc); |
scc | 1241 | drivers/char/scc.c | scc_init_timer(struct scc_channel *scc) |
scc | 1254 | drivers/char/scc.c | scc->stat.tx_state = TXS_IDLE; |
scc | 1271 | drivers/char/scc.c | kiss_set_param(struct scc_channel *scc,char cmd, unsigned int val) |
scc | 1279 | drivers/char/scc.c | scc->kiss.txdelay = VAL; break; |
scc | 1281 | drivers/char/scc.c | scc->kiss.persist = val; break; |
scc | 1283 | drivers/char/scc.c | scc->kiss.slottime = VAL; break; |
scc | 1285 | drivers/char/scc.c | scc->kiss.tailtime = VAL; break; |
scc | 1287 | drivers/char/scc.c | scc->kiss.fulldup = val; break; |
scc | 1289 | drivers/char/scc.c | scc->kiss.waittime = VAL; break; |
scc | 1291 | drivers/char/scc.c | scc->kiss.maxkeyup = SVAL; break; |
scc | 1293 | drivers/char/scc.c | scc->kiss.mintime = SVAL; break; |
scc | 1295 | drivers/char/scc.c | scc->kiss.idletime = val; break; |
scc | 1297 | drivers/char/scc.c | scc->kiss.maxdefer = SVAL; break; |
scc | 1299 | drivers/char/scc.c | scc->kiss.group = val; break; |
scc | 1301 | drivers/char/scc.c | scc->kiss.tx_inhibit = val; |
scc | 1303 | drivers/char/scc.c | scc->kiss.softdcd = val; |
scc | 1314 | drivers/char/scc.c | static void kiss_interpret_frame(struct scc_channel * scc) |
scc | 1319 | drivers/char/scc.c | if (scc->sndq1->cnt < 2) |
scc | 1321 | drivers/char/scc.c | if (scc->sndq1) |
scc | 1322 | drivers/char/scc.c | scc_free_chain(scc->sndq1, BT_TRANSMIT); |
scc | 1324 | drivers/char/scc.c | scc->sndq1 = NULLBUF; |
scc | 1326 | drivers/char/scc.c | scc->sndq2 = NULLBUF; |
scc | 1332 | drivers/char/scc.c | if (scc->kiss.not_slip) |
scc | 1334 | drivers/char/scc.c | kisscmd = scc->sndq1->data[scc->sndq1->in_use++]; |
scc | 1335 | drivers/char/scc.c | scc->sndq1->cnt--; |
scc | 1342 | drivers/char/scc.c | if (scc->sndq1->cnt > 2) |
scc | 1343 | drivers/char/scc.c | scc->sndq1->cnt -= 2; |
scc | 1346 | drivers/char/scc.c | scc_free_chain(scc->sndq1, BT_TRANSMIT); |
scc | 1347 | drivers/char/scc.c | scc->sndq2 = NULLBUF; |
scc | 1358 | drivers/char/scc.c | kiss_set_param(scc, kisscmd, scc->sndq1->data[scc->sndq1->in_use]); |
scc | 1359 | drivers/char/scc.c | scc->sndq1->cnt=0; |
scc | 1360 | drivers/char/scc.c | scc->sndq1->in_use=0; |
scc | 1362 | drivers/char/scc.c | scc_free_chain(scc->sndq1, BT_TRANSMIT); |
scc | 1363 | drivers/char/scc.c | scc->sndq2 = NULLBUF; |
scc | 1367 | drivers/char/scc.c | scc_enqueue(&scc->sndq,scc->sndq1); /* scc_enqueue packet */ |
scc | 1368 | drivers/char/scc.c | scc->stat.txframes++; |
scc | 1369 | drivers/char/scc.c | scc->stat.tx_queued++; |
scc | 1370 | drivers/char/scc.c | scc->sndq2 = NULLBUF; /* acquire a new buffer next time */ |
scc | 1374 | drivers/char/scc.c | if(scc->stat.tx_state == TXS_IDLE) |
scc | 1376 | drivers/char/scc.c | scc_init_timer(scc); |
scc | 1377 | drivers/char/scc.c | scc->stat.tx_state = TXS_BUSY; |
scc | 1378 | drivers/char/scc.c | scc->t_dwait = (scc->kiss.fulldup? 0:scc->kiss.waittime); |
scc | 1384 | drivers/char/scc.c | static void kiss_store_byte(struct scc_channel *scc, unsigned char ch) |
scc | 1386 | drivers/char/scc.c | if (scc->sndq2 == NULLBUF) return; |
scc | 1388 | drivers/char/scc.c | if(scc->sndq2->cnt == scc->sndq2->size) /* buffer full? */ |
scc | 1390 | drivers/char/scc.c | if((scc->sndq2 = scc_get_buffer(BT_TRANSMIT)) == NULLBUF) |
scc | 1395 | drivers/char/scc.c | scc_append_to_chain(&scc->sndq1,scc->sndq2); /* add buffer */ |
scc | 1398 | drivers/char/scc.c | scc->sndq2->data[scc->sndq2->cnt++] = ch; |
scc | 1401 | drivers/char/scc.c | static inline int kiss_decode(struct scc_channel *scc, unsigned char ch) |
scc | 1403 | drivers/char/scc.c | switch (scc->stat.tx_kiss_state) |
scc | 1408 | drivers/char/scc.c | if (!(scc->sndq2 = scc->sndq1 = scc_get_buffer(BT_TRANSMIT))) |
scc | 1411 | drivers/char/scc.c | scc->stat.tx_kiss_state = KISS_DATA; |
scc | 1412 | drivers/char/scc.c | } else scc->stat.txerrs++; |
scc | 1417 | drivers/char/scc.c | scc->stat.tx_kiss_state = KISS_ESCAPE; |
scc | 1420 | drivers/char/scc.c | kiss_interpret_frame(scc); |
scc | 1421 | drivers/char/scc.c | scc->stat.tx_kiss_state = KISS_IDLE; |
scc | 1423 | drivers/char/scc.c | else kiss_store_byte(scc, ch); |
scc | 1429 | drivers/char/scc.c | kiss_store_byte(scc, FEND); |
scc | 1430 | drivers/char/scc.c | scc->stat.tx_kiss_state = KISS_DATA; |
scc | 1434 | drivers/char/scc.c | kiss_store_byte(scc, FESC); |
scc | 1435 | drivers/char/scc.c | scc->stat.tx_kiss_state = KISS_DATA; |
scc | 1439 | drivers/char/scc.c | scc_free_chain(scc->sndq1, BT_TRANSMIT); |
scc | 1440 | drivers/char/scc.c | scc->sndq2 = NULLBUF; |
scc | 1441 | drivers/char/scc.c | scc->stat.txerrs++; |
scc | 1442 | drivers/char/scc.c | scc->stat.tx_kiss_state = KISS_IDLE; |
scc | 1459 | drivers/char/scc.c | struct scc_channel *scc; |
scc | 1474 | drivers/char/scc.c | scc=&SCC_Info[2*chip]; |
scc | 1475 | drivers/char/scc.c | if (!scc->ctrl) continue; |
scc | 1479 | drivers/char/scc.c | OutReg(scc->ctrl,R9,FHWRES); /* force hardware reset */ |
scc | 1480 | drivers/char/scc.c | OutReg(scc->ctrl,R9,0); /* end hardware reset */ |
scc | 1481 | drivers/char/scc.c | OutReg(scc->ctrl,R9,CHRA); /* reset channel A */ |
scc | 1482 | drivers/char/scc.c | OutReg(scc->ctrl,R9,CHRB); /* reset channel B */ |
scc | 1483 | drivers/char/scc.c | OutReg(scc->ctrl,R1, 0); /* No Rx irq from channel A */ |
scc | 1484 | drivers/char/scc.c | scc=&SCC_Info[2*chip+1]; |
scc | 1485 | drivers/char/scc.c | OutReg(scc->ctrl,R1, 0); /* No Rx irq from channel B */ |
scc | 1486 | drivers/char/scc.c | scc=&SCC_Info[2*chip]; |
scc | 1487 | drivers/char/scc.c | OutReg(scc->ctrl,R2, chip*16); /* Set Interrupt vector */ |
scc | 1507 | drivers/char/scc.c | static inline int scc_paranoia_check(struct scc_channel *scc, dev_t device, const char *routine) |
scc | 1515 | drivers/char/scc.c | if (!scc->init) |
scc | 1520 | drivers/char/scc.c | if (scc->magic != SCC_MAGIC) { |
scc | 1534 | drivers/char/scc.c | struct scc_channel *scc; |
scc | 1541 | drivers/char/scc.c | scc = &SCC_Info[chan]; |
scc | 1543 | drivers/char/scc.c | tty->driver_data = scc; |
scc | 1552 | drivers/char/scc.c | if (scc->magic != SCC_MAGIC) |
scc | 1558 | drivers/char/scc.c | if(scc->tty != NULL) |
scc | 1560 | drivers/char/scc.c | scc->tty_opened++; |
scc | 1564 | drivers/char/scc.c | if(!scc->init) return 0; |
scc | 1566 | drivers/char/scc.c | scc->tty = tty; |
scc | 1567 | drivers/char/scc.c | init_channel(scc); |
scc | 1569 | drivers/char/scc.c | scc->stat.tx_kiss_state = KISS_IDLE; /* don't change this... */ |
scc | 1570 | drivers/char/scc.c | scc->stat.rx_kiss_state = KISS_IDLE; /* ...or this */ |
scc | 1572 | drivers/char/scc.c | scc_init_timer(scc); |
scc | 1608 | drivers/char/scc.c | struct scc_channel *scc = tty->driver_data; |
scc | 1611 | drivers/char/scc.c | if (!scc || (scc->magic != SCC_MAGIC)) |
scc | 1614 | drivers/char/scc.c | if(scc->tty_opened) |
scc | 1616 | drivers/char/scc.c | scc->tty_opened--; |
scc | 1624 | drivers/char/scc.c | Outb(scc->ctrl,0); /* Make sure pointer is written */ |
scc | 1625 | drivers/char/scc.c | wr(scc,R1,0); /* disable interrupts */ |
scc | 1626 | drivers/char/scc.c | wr(scc,R3,0); |
scc | 1628 | drivers/char/scc.c | scc->tty = NULL; |
scc | 1642 | drivers/char/scc.c | scc_change_speed(struct scc_channel * scc) |
scc | 1644 | drivers/char/scc.c | if (scc->tty == NULL) |
scc | 1647 | drivers/char/scc.c | scc->modem.speed = baud_table[scc->tty->termios->c_cflag & CBAUD]; |
scc | 1649 | drivers/char/scc.c | if (scc->stat.tx_state == 0) /* only switch baudrate on rx... ;-) */ |
scc | 1650 | drivers/char/scc.c | set_speed(scc); |
scc | 1675 | drivers/char/scc.c | struct scc_channel * scc = tty->driver_data; |
scc | 1682 | drivers/char/scc.c | if (scc->magic != SCC_MAGIC) |
scc | 1707 | drivers/char/scc.c | if (!scc->init) |
scc | 1718 | drivers/char/scc.c | memcpy_fromfs(&scc->modem, (void *) arg, sizeof(struct scc_modem)); |
scc | 1722 | drivers/char/scc.c | if (scc->modem.speed < 4800) |
scc | 1724 | drivers/char/scc.c | scc->kiss.txdelay = 36*TPS/100; /* 360 ms */ |
scc | 1725 | drivers/char/scc.c | scc->kiss.persist = 42; /* 25% persistence */ /* was 25 */ |
scc | 1726 | drivers/char/scc.c | scc->kiss.slottime = 16*TPS/100; /* 160 ms */ |
scc | 1727 | drivers/char/scc.c | scc->kiss.tailtime = 4; /* minimal reasonable value */ |
scc | 1728 | drivers/char/scc.c | scc->kiss.fulldup = 0; /* CSMA */ |
scc | 1729 | drivers/char/scc.c | scc->kiss.waittime = 50*TPS/100; /* 500 ms */ |
scc | 1730 | drivers/char/scc.c | scc->kiss.maxkeyup = 10; /* 10 s */ |
scc | 1731 | drivers/char/scc.c | scc->kiss.mintime = 3; /* 3 s */ |
scc | 1732 | drivers/char/scc.c | scc->kiss.idletime = 30; /* 30 s */ |
scc | 1733 | drivers/char/scc.c | scc->kiss.maxdefer = 120; /* 2 min */ |
scc | 1734 | drivers/char/scc.c | scc->kiss.not_slip = 1; /* KISS mode */ |
scc | 1735 | drivers/char/scc.c | scc->kiss.softdcd = 0; /* hardware dcd */ |
scc | 1737 | drivers/char/scc.c | scc->kiss.txdelay = 10*TPS/100; /* 100 ms */ |
scc | 1738 | drivers/char/scc.c | scc->kiss.persist = 64; /* 25% persistence */ /* was 25 */ |
scc | 1739 | drivers/char/scc.c | scc->kiss.slottime = 8*TPS/100; /* 160 ms */ |
scc | 1740 | drivers/char/scc.c | scc->kiss.tailtime = 1; /* minimal reasonable value */ |
scc | 1741 | drivers/char/scc.c | scc->kiss.fulldup = 0; /* CSMA */ |
scc | 1742 | drivers/char/scc.c | scc->kiss.waittime = 50*TPS/100; /* 500 ms */ |
scc | 1743 | drivers/char/scc.c | scc->kiss.maxkeyup = 7; /* 7 s */ |
scc | 1744 | drivers/char/scc.c | scc->kiss.mintime = 3; /* 3 s */ |
scc | 1745 | drivers/char/scc.c | scc->kiss.idletime = 30; /* 30 s */ |
scc | 1746 | drivers/char/scc.c | scc->kiss.maxdefer = 120; /* 2 min */ |
scc | 1747 | drivers/char/scc.c | scc->kiss.not_slip = 1; /* KISS mode */ |
scc | 1748 | drivers/char/scc.c | scc->kiss.softdcd = 0; /* hardware dcd */ |
scc | 1751 | drivers/char/scc.c | scc->init = 1; |
scc | 1769 | drivers/char/scc.c | result = ((scc->wreg[R5] & RTS) ? TIOCM_RTS : 0) |
scc | 1770 | drivers/char/scc.c | | ((scc->wreg[R5] & DTR) ? TIOCM_DTR : 0) |
scc | 1771 | drivers/char/scc.c | | ((InReg(scc->ctrl,R0) & DCD) ? TIOCM_CAR : 0) |
scc | 1772 | drivers/char/scc.c | | ((InReg(scc->ctrl,R0) & CTS) ? TIOCM_CTS : 0); |
scc | 1783 | drivers/char/scc.c | scc->wreg[R5] |= DTR; |
scc | 1784 | drivers/char/scc.c | scc->wreg[R5] |= RTS; |
scc | 1787 | drivers/char/scc.c | scc->wreg[R5] &= ~DTR; |
scc | 1788 | drivers/char/scc.c | scc->wreg[R5] &= ~RTS; |
scc | 1794 | drivers/char/scc.c | scc->wreg[R5] |= DTR; |
scc | 1796 | drivers/char/scc.c | scc->wreg[R5] &= ~DTR; |
scc | 1798 | drivers/char/scc.c | scc->wreg[R5] |= RTS; |
scc | 1800 | drivers/char/scc.c | scc->wreg[R5] &= ~RTS; |
scc | 1806 | drivers/char/scc.c | if(scc->stat.tx_state == TXS_IDLE && !Running(t_idle)) |
scc | 1807 | drivers/char/scc.c | maxk_idle_timeout(scc); |
scc | 1820 | drivers/char/scc.c | memcpy_tofs((void *) arg, scc->tty->termios, sizeof(struct termios)); |
scc | 1831 | drivers/char/scc.c | memcpy_fromfs(scc->tty->termios, (void *) arg, sizeof(struct termios)); |
scc | 1832 | drivers/char/scc.c | scc_change_speed(scc); |
scc | 1844 | drivers/char/scc.c | scc->stat.used_buf = scc_count_used_buffers(&scc->stat.rx_alloc, |
scc | 1845 | drivers/char/scc.c | &scc->stat.tx_alloc); |
scc | 1847 | drivers/char/scc.c | memcpy_tofs((void *) arg, &scc->stat, sizeof(struct scc_stat)); |
scc | 1868 | drivers/char/scc.c | case PARAM_TXDELAY: r = CAST(scc->kiss.txdelay*TICKS); break; |
scc | 1869 | drivers/char/scc.c | case PARAM_PERSIST: r = CAST(scc->kiss.persist); break; |
scc | 1870 | drivers/char/scc.c | case PARAM_SLOTTIME: r = CAST(scc->kiss.slottime*TICKS); break; |
scc | 1871 | drivers/char/scc.c | case PARAM_TXTAIL: r = CAST(scc->kiss.tailtime*TICKS); break; |
scc | 1872 | drivers/char/scc.c | case PARAM_FULLDUP: r = CAST(scc->kiss.fulldup); break; |
scc | 1873 | drivers/char/scc.c | case PARAM_SOFTDCD: r = CAST(scc->kiss.softdcd); break; |
scc | 1874 | drivers/char/scc.c | case PARAM_DTR: r = CAST((scc->wreg[R5] & DTR)? 1:0); break; |
scc | 1875 | drivers/char/scc.c | case PARAM_RTS: r = CAST((scc->wreg[R5] & RTS)? 1:0); break; |
scc | 1876 | drivers/char/scc.c | case PARAM_SPEED: r = CAST(scc->modem.speed); break; |
scc | 1877 | drivers/char/scc.c | case PARAM_GROUP: r = CAST(scc->kiss.group); break; |
scc | 1878 | drivers/char/scc.c | case PARAM_IDLE: r = CAST(scc->kiss.idletime); break; |
scc | 1879 | drivers/char/scc.c | case PARAM_MIN: r = CAST(scc->kiss.mintime); break; |
scc | 1880 | drivers/char/scc.c | case PARAM_MAXKEY: r = CAST(scc->kiss.maxkeyup); break; |
scc | 1881 | drivers/char/scc.c | case PARAM_WAIT: r = CAST(scc->kiss.waittime); break; |
scc | 1882 | drivers/char/scc.c | case PARAM_MAXDEFER: r = CAST(scc->kiss.maxdefer); break; |
scc | 1883 | drivers/char/scc.c | case PARAM_TX: r = CAST(scc->kiss.tx_inhibit); break; |
scc | 1884 | drivers/char/scc.c | case PARAM_SLIP: r = CAST(!scc->kiss.not_slip); break; |
scc | 1905 | drivers/char/scc.c | case PARAM_TXDELAY: scc->kiss.txdelay=VAL; break; |
scc | 1906 | drivers/char/scc.c | case PARAM_PERSIST: scc->kiss.persist=Val; break; |
scc | 1907 | drivers/char/scc.c | case PARAM_SLOTTIME: scc->kiss.slottime=VAL; break; |
scc | 1908 | drivers/char/scc.c | case PARAM_TXTAIL: scc->kiss.tailtime=VAL; break; |
scc | 1909 | drivers/char/scc.c | case PARAM_FULLDUP: scc->kiss.fulldup=Val; break; |
scc | 1910 | drivers/char/scc.c | case PARAM_SOFTDCD: scc->kiss.softdcd=Val; break; |
scc | 1913 | drivers/char/scc.c | case PARAM_SPEED: scc->modem.speed=Val; break; |
scc | 1914 | drivers/char/scc.c | case PARAM_GROUP: scc->kiss.group=Val; break; |
scc | 1915 | drivers/char/scc.c | case PARAM_IDLE: scc->kiss.idletime=Val; break; |
scc | 1916 | drivers/char/scc.c | case PARAM_MIN: scc->kiss.mintime=SVAL; break; |
scc | 1917 | drivers/char/scc.c | case PARAM_MAXKEY: scc->kiss.maxkeyup=SVAL; break; |
scc | 1918 | drivers/char/scc.c | case PARAM_WAIT: scc->kiss.waittime=Val; break; |
scc | 1919 | drivers/char/scc.c | case PARAM_MAXDEFER: scc->kiss.maxdefer=SVAL; break; |
scc | 1920 | drivers/char/scc.c | case PARAM_TX: scc->kiss.tx_inhibit=Val; break; |
scc | 1921 | drivers/char/scc.c | case PARAM_SLIP: scc->kiss.not_slip=!Val; break; |
scc | 1950 | drivers/char/scc.c | static inline void check_tx_queue(register struct scc_channel *scc) |
scc | 1954 | drivers/char/scc.c | if (scc->stat.tx_queued > QUEUE_THRES) |
scc | 1956 | drivers/char/scc.c | if (scc->sndq1 == NULLBUF) |
scc | 1959 | drivers/char/scc.c | " (%d) but queue is empty\n", scc->stat.tx_queued); |
scc | 1961 | drivers/char/scc.c | scc->stat.tx_queued = 0; /* correct it */ |
scc | 1962 | drivers/char/scc.c | scc->stat.nospace = 54321; /* draw attention to it */ |
scc | 1966 | drivers/char/scc.c | bp = scc->sndq1->anext; /* don't use the one we currently use */ |
scc | 1968 | drivers/char/scc.c | while (bp && (scc->stat.tx_queued > QUEUE_HYST)) |
scc | 1971 | drivers/char/scc.c | scc->stat.tx_queued--; |
scc | 1972 | drivers/char/scc.c | scc->stat.nospace++; |
scc | 1975 | drivers/char/scc.c | scc->sndq1->anext = bp; |
scc | 1989 | drivers/char/scc.c | struct scc_channel * scc = tty->driver_data; |
scc | 1995 | drivers/char/scc.c | if (scc_paranoia_check(scc, tty->device, "scc_write")) |
scc | 1998 | drivers/char/scc.c | if (scc->kiss.tx_inhibit) return count; |
scc | 2000 | drivers/char/scc.c | check_tx_queue(scc); |
scc | 2025 | drivers/char/scc.c | if (kiss_decode(scc, *p++)) |
scc | 2027 | drivers/char/scc.c | scc->stat.nospace++; |
scc | 2034 | drivers/char/scc.c | if ((scc->tty->flags & (1 << TTY_DO_WRITE_WAKEUP)) |
scc | 2035 | drivers/char/scc.c | && scc->tty->ldisc.write_wakeup) |
scc | 2036 | drivers/char/scc.c | (scc->tty->ldisc.write_wakeup)(scc->tty); |
scc | 2047 | drivers/char/scc.c | struct scc_channel *scc = tty->driver_data; |
scc | 2050 | drivers/char/scc.c | if (scc_paranoia_check(scc, tty->device, "scc_put_char")) |
scc | 2059 | drivers/char/scc.c | struct scc_channel *scc = tty->driver_data; |
scc | 2061 | drivers/char/scc.c | scc_paranoia_check(scc, tty->device, "scc_flush_chars"); /* just to annoy the user... */ |
scc | 2070 | drivers/char/scc.c | struct scc_channel *scc = tty->driver_data; |
scc | 2072 | drivers/char/scc.c | if (scc_paranoia_check(scc, tty->device, "scc_write_room")) |
scc | 2075 | drivers/char/scc.c | if (scc->stat.tx_alloc >= QUEUE_THRES) |
scc | 2086 | drivers/char/scc.c | struct scc_channel *scc = tty->driver_data; |
scc | 2088 | drivers/char/scc.c | if (scc && scc->sndq2) |
scc | 2089 | drivers/char/scc.c | return scc->sndq2->cnt; |
scc | 2096 | drivers/char/scc.c | struct scc_channel *scc = tty->driver_data; |
scc | 2098 | drivers/char/scc.c | if (scc_paranoia_check(scc, tty->device, "scc_flush_buffer")) |
scc | 2101 | drivers/char/scc.c | scc->stat.tx_kiss_state = KISS_IDLE; |
scc | 2107 | drivers/char/scc.c | struct scc_channel *scc = tty->driver_data; |
scc | 2109 | drivers/char/scc.c | if (scc_paranoia_check(scc, tty->device, "scc_throttle")) |
scc | 2119 | drivers/char/scc.c | struct scc_channel *scc = tty->driver_data; |
scc | 2121 | drivers/char/scc.c | if (scc_paranoia_check(scc, tty->device, "scc_unthrottle")) |
scc | 2130 | drivers/char/scc.c | struct scc_channel *scc = tty->driver_data; |
scc | 2132 | drivers/char/scc.c | if (scc_paranoia_check(scc, tty->device, "scc_start")) |
scc | 2141 | drivers/char/scc.c | struct scc_channel *scc = tty->driver_data; |
scc | 2143 | drivers/char/scc.c | if (scc_paranoia_check(scc, tty->device, "scc_stop")) |
scc | 2151 | drivers/char/scc.c | struct scc_channel *scc = tty->driver_data; |
scc | 2153 | drivers/char/scc.c | if (scc_paranoia_check(scc, tty->device, "scc_hangup")) |
scc | 129 | include/linux/scc.h | #define Running(k) (scc->k != TIMER_STOPPED) |
scc | 130 | include/linux/scc.h | #define Expired(k) (scc->k != TIMER_STOPPED) && (!(scc->k) || (--(scc->k) == 0)) |
scc | 131 | include/linux/scc.h | #define Stop_Timer(k) scc->k = TIMER_STOPPED |