tag | line | file | source code |
scc | 142 | arch/mips/kernel/signal.c | struct sigcontext_struct scc; |
scc | 144 | arch/mips/kernel/signal.c | #define scc_offset ((size_t)&((struct sc *)0)->scc) |
scc | 185 | arch/mips/kernel/signal.c | frame->scc.sc_at = regs->reg1; /* Assembler temporary */ |
scc | 186 | arch/mips/kernel/signal.c | frame->scc.sc_v0 = regs->reg2; /* Result registers */ |
scc | 187 | arch/mips/kernel/signal.c | frame->scc.sc_v1 = regs->reg3; |
scc | 188 | arch/mips/kernel/signal.c | frame->scc.sc_a0 = regs->reg4; /* Argument registers */ |
scc | 189 | arch/mips/kernel/signal.c | frame->scc.sc_a1 = regs->reg5; |
scc | 190 | arch/mips/kernel/signal.c | frame->scc.sc_a2 = regs->reg6; |
scc | 191 | arch/mips/kernel/signal.c | frame->scc.sc_a3 = regs->reg7; |
scc | 193 | arch/mips/kernel/signal.c | frame->scc.sc_t0 = regs->reg8; /* Caller saved */ |
scc | 194 | arch/mips/kernel/signal.c | frame->scc.sc_t1 = regs->reg9; |
scc | 195 | arch/mips/kernel/signal.c | frame->scc.sc_t2 = regs->reg10; |
scc | 196 | arch/mips/kernel/signal.c | frame->scc.sc_t3 = regs->reg11; |
scc | 197 | arch/mips/kernel/signal.c | frame->scc.sc_t4 = regs->reg12; |
scc | 198 | arch/mips/kernel/signal.c | frame->scc.sc_t5 = regs->reg13; |
scc | 199 | arch/mips/kernel/signal.c | frame->scc.sc_t6 = regs->reg14; |
scc | 200 | arch/mips/kernel/signal.c | frame->scc.sc_t7 = regs->reg15; |
scc | 202 | arch/mips/kernel/signal.c | frame->scc.sc_s0 = regs->reg16; /* Callee saved */ |
scc | 203 | arch/mips/kernel/signal.c | frame->scc.sc_s1 = regs->reg17; |
scc | 204 | arch/mips/kernel/signal.c | frame->scc.sc_s2 = regs->reg18; |
scc | 205 | arch/mips/kernel/signal.c | frame->scc.sc_s3 = regs->reg19; |
scc | 206 | arch/mips/kernel/signal.c | frame->scc.sc_s4 = regs->reg20; |
scc | 207 | arch/mips/kernel/signal.c | frame->scc.sc_s5 = regs->reg21; |
scc | 208 | arch/mips/kernel/signal.c | frame->scc.sc_s6 = regs->reg22; |
scc | 209 | arch/mips/kernel/signal.c | frame->scc.sc_s7 = regs->reg23; |
scc | 211 | arch/mips/kernel/signal.c | frame->scc.sc_t8 = regs->reg24; /* Caller saved */ |
scc | 212 | arch/mips/kernel/signal.c | frame->scc.sc_t9 = regs->reg25; |
scc | 217 | arch/mips/kernel/signal.c | frame->scc.sc_gp = regs->reg28; /* global pointer / s8 */ |
scc | 218 | arch/mips/kernel/signal.c | frame->scc.sc_sp = regs->reg29; /* old stack pointer */ |
scc | 219 | arch/mips/kernel/signal.c | frame->scc.sc_fp = regs->reg30; /* old frame pointer */ |
scc | 220 | arch/mips/kernel/signal.c | frame->scc.sc_ra = regs->reg31; /* old return address */ |
scc | 222 | arch/mips/kernel/signal.c | frame->scc.sc_epc = regs->cp0_epc; /* Program counter */ |
scc | 223 | arch/mips/kernel/signal.c | frame->scc.sc_cause = regs->cp0_cause; /* c0_epc register */ |
scc | 225 | arch/mips/kernel/signal.c | frame->scc.sc_oldmask = oldmask; |
scc | 210 | drivers/char/scc.c | static void alloc_buffer_pool(struct scc_channel *scc); |
scc | 211 | drivers/char/scc.c | static void free_buffer_pool(struct scc_channel *scc); |
scc | 212 | drivers/char/scc.c | static struct mbuf * scc_get_buffer(struct scc_channel *scc, char type); |
scc | 232 | drivers/char/scc.c | static void scc_change_speed(struct scc_channel *scc); |
scc | 233 | drivers/char/scc.c | static void kiss_encode(struct scc_channel *scc); |
scc | 235 | drivers/char/scc.c | static void init_channel(struct scc_channel *scc); |
scc | 236 | drivers/char/scc.c | static void scc_key_trx (struct scc_channel *scc, char tx); |
scc | 237 | drivers/char/scc.c | static void scc_txint(register struct scc_channel *scc); |
scc | 238 | drivers/char/scc.c | static void scc_exint(register struct scc_channel *scc); |
scc | 239 | drivers/char/scc.c | static void scc_rxint(register struct scc_channel *scc); |
scc | 240 | drivers/char/scc.c | static void scc_spint(register struct scc_channel *scc); |
scc | 244 | drivers/char/scc.c | static void scc_init_timer(struct scc_channel *scc); |
scc | 307 | drivers/char/scc.c | wr(register struct scc_channel *scc, register unsigned char reg, register unsigned char val) |
scc | 309 | drivers/char/scc.c | OutReg(scc->ctrl, reg, (scc->wreg[reg] = val)); |
scc | 313 | drivers/char/scc.c | or(register struct scc_channel *scc, register unsigned char reg, register unsigned char val) |
scc | 315 | drivers/char/scc.c | OutReg(scc->ctrl, reg, (scc->wreg[reg] |= val)); |
scc | 319 | drivers/char/scc.c | cl(register struct scc_channel *scc, register unsigned char reg, register unsigned char val) |
scc | 321 | drivers/char/scc.c | OutReg(scc->ctrl, reg, (scc->wreg[reg] &= ~val)); |
scc | 473 | drivers/char/scc.c | alloc_buffer_pool(struct scc_channel *scc) |
scc | 479 | drivers/char/scc.c | buflen = sizeof(struct mbuf) + scc->stat.bufsize; |
scc | 481 | drivers/char/scc.c | if (scc->stat.bufsize < 336) scc->stat.bufsize = 336; |
scc | 484 | drivers/char/scc.c | scc->stat.bufsize = 4096-sizeof(struct mbuf); |
scc | 488 | drivers/char/scc.c | if (scc->stat.rxbuffers < 4) scc->stat.rxbuffers = 4; |
scc | 489 | drivers/char/scc.c | if (scc->stat.txbuffers < 4) scc->stat.txbuffers = 4; |
scc | 495 | drivers/char/scc.c | for (k = 0; k < scc->stat.rxbuffers ; k++) |
scc | 505 | drivers/char/scc.c | printk("z8530drv: %s: can't allocate memory for rx buffer pool", kdevname(scc->tty->device)); |
scc | 519 | drivers/char/scc.c | scc_enqueue_buffer(&scc->rx_buffer_pool, bptr); |
scc | 524 | drivers/char/scc.c | for (k = 0; k < scc->stat.txbuffers ; k++) |
scc | 530 | drivers/char/scc.c | printk("z8530drv: %s: can't allocate memory for tx buffer pool", kdevname(scc->tty->device)); |
scc | 538 | drivers/char/scc.c | scc_enqueue_buffer(&scc->tx_buffer_pool, bptr); |
scc | 546 | drivers/char/scc.c | free_buffer_pool(struct scc_channel *scc) |
scc | 558 | drivers/char/scc.c | bptr = scc->rx_bp; |
scc | 561 | drivers/char/scc.c | scc->rx_bp = NULLBUF; |
scc | 562 | drivers/char/scc.c | scc_enqueue_buffer(&scc->rx_buffer_pool, bptr); |
scc | 565 | drivers/char/scc.c | bptr = scc->tx_bp; |
scc | 568 | drivers/char/scc.c | scc->tx_bp = NULLBUF; |
scc | 569 | drivers/char/scc.c | scc_enqueue_buffer(&scc->tx_buffer_pool, bptr); |
scc | 572 | drivers/char/scc.c | bptr = scc->kiss_decode_bp; |
scc | 575 | drivers/char/scc.c | scc->kiss_decode_bp = NULLBUF; |
scc | 576 | drivers/char/scc.c | scc_enqueue_buffer(&scc->tx_buffer_pool, bptr); |
scc | 579 | drivers/char/scc.c | bptr = scc->kiss_encode_bp; |
scc | 582 | drivers/char/scc.c | scc->kiss_encode_bp = NULLBUF; |
scc | 583 | drivers/char/scc.c | scc_enqueue_buffer(&scc->rx_buffer_pool, bptr); |
scc | 589 | drivers/char/scc.c | while (scc->rx_queue != NULLBUF) |
scc | 591 | drivers/char/scc.c | bptr = scc_dequeue_buffer(&scc->rx_queue); |
scc | 592 | drivers/char/scc.c | scc_enqueue_buffer(&scc->rx_buffer_pool, bptr); |
scc | 595 | drivers/char/scc.c | while (scc->tx_queue != NULLBUF) |
scc | 597 | drivers/char/scc.c | bptr = scc_dequeue_buffer(&scc->tx_queue); |
scc | 598 | drivers/char/scc.c | scc_enqueue_buffer(&scc->tx_buffer_pool, bptr); |
scc | 611 | drivers/char/scc.c | while (scc->rx_buffer_pool != NULLBUF) |
scc | 613 | drivers/char/scc.c | bptr = scc_dequeue_buffer(&scc->rx_buffer_pool); |
scc | 622 | drivers/char/scc.c | if (cnt < scc->stat.rxbuffers) /* hmm... hmm... :-( */ |
scc | 623 | drivers/char/scc.c | printk("z8530drv: oops, deallocated only %d of %d rx buffers\n", cnt, scc->stat.rxbuffers); |
scc | 624 | drivers/char/scc.c | if (cnt > scc->stat.rxbuffers) /* WHAT?!! */ |
scc | 625 | drivers/char/scc.c | printk("z8530drv: oops, deallocated %d instead of %d rx buffers. Very strange.\n", cnt, scc->stat.rxbuffers); |
scc | 629 | drivers/char/scc.c | while (scc->tx_buffer_pool != NULLBUF) |
scc | 631 | drivers/char/scc.c | bptr = scc_dequeue_buffer(&scc->tx_buffer_pool); |
scc | 640 | drivers/char/scc.c | if (cnt < scc->stat.txbuffers) |
scc | 641 | drivers/char/scc.c | printk("z8530drv: oops, deallocated only %d of %d tx buffers\n", cnt, scc->stat.txbuffers); |
scc | 642 | drivers/char/scc.c | if (cnt > scc->stat.txbuffers) |
scc | 643 | drivers/char/scc.c | printk("z8530drv: oops, deallocated %d instead of %d tx buffers. Very strange.\n", cnt, scc->stat.txbuffers); |
scc | 657 | drivers/char/scc.c | scc_get_buffer(struct scc_channel *scc, char type) |
scc | 663 | drivers/char/scc.c | bptr = scc_dequeue_buffer(&scc->tx_buffer_pool); |
scc | 669 | drivers/char/scc.c | printk("z8530drv: scc_get_buffer(%s): tx buffer pool empty\n", kdevname(scc->tty->device)); |
scc | 673 | drivers/char/scc.c | bptr = scc_dequeue_buffer(&scc->tx_queue); |
scc | 681 | drivers/char/scc.c | bptr = scc_dequeue_buffer(&scc->rx_buffer_pool); |
scc | 685 | drivers/char/scc.c | printk("z8530drv: scc_get_buffer(%s): rx buffer pool empty\n", kdevname(scc->tty->device)); |
scc | 687 | drivers/char/scc.c | bptr = scc_dequeue_buffer(&scc->rx_queue); |
scc | 713 | drivers/char/scc.c | scc_isr_dispatch(register struct scc_channel *scc, register int vector) |
scc | 717 | drivers/char/scc.c | case TXINT: scc_txint(scc); break; |
scc | 718 | drivers/char/scc.c | case EXINT: scc_exint(scc); break; |
scc | 719 | drivers/char/scc.c | case RXINT: scc_rxint(scc); break; |
scc | 720 | drivers/char/scc.c | case SPINT: scc_spint(scc); break; |
scc | 721 | drivers/char/scc.c | default : printk("scc_isr(): unknown interrupt status (addr %4.4x, state %2.2x)\n",scc->ctrl,vector); |
scc | 738 | drivers/char/scc.c | register struct scc_channel *scc; |
scc | 762 | drivers/char/scc.c | scc=&SCC_Info[(((vector>>1)&0x7c)^0x04) >> 2]; |
scc | 764 | drivers/char/scc.c | if (!scc->tty) break; |
scc | 766 | drivers/char/scc.c | scc_isr_dispatch(scc, vector); |
scc | 768 | drivers/char/scc.c | Outb(scc->ctrl,0x38); /* Reset Highest IUS" opcode to WR0 */ |
scc | 803 | drivers/char/scc.c | scc = &SCC_Info[(((vector >> 1) & 0x7c) ^ 0x04) >> 2]; |
scc | 805 | drivers/char/scc.c | if (!scc->tty) break; |
scc | 809 | drivers/char/scc.c | scc_isr_dispatch(scc, vector); |
scc | 828 | drivers/char/scc.c | scc_txint(register struct scc_channel *scc) |
scc | 832 | drivers/char/scc.c | scc->stat.txints++; |
scc | 834 | drivers/char/scc.c | bp = scc->tx_bp; |
scc | 841 | drivers/char/scc.c | scc_enqueue_buffer(&scc->tx_buffer_pool, bp); |
scc | 843 | drivers/char/scc.c | bp = scc_dequeue_buffer(&scc->tx_queue); |
scc | 847 | drivers/char/scc.c | scc->stat.tx_state = TXS_BUSY; |
scc | 848 | drivers/char/scc.c | scc->t_tail = scc->kiss.tailtime; |
scc | 850 | drivers/char/scc.c | Outb(scc->ctrl, RES_Tx_P); /* clear int */ |
scc | 854 | drivers/char/scc.c | if ( scc->kiss.not_slip && (bp->cnt > 0) ) |
scc | 863 | drivers/char/scc.c | Outb(scc->ctrl, RES_Tx_CRC); /* reset CRC generator */ |
scc | 864 | drivers/char/scc.c | or(scc,R10,ABUNDER); /* re-install underrun protection */ |
scc | 865 | drivers/char/scc.c | Outb(scc->data,*bp->rw_ptr); /* send byte */ |
scc | 866 | drivers/char/scc.c | if (!scc->enhanced) /* reset EOM latch */ |
scc | 867 | drivers/char/scc.c | Outb(scc->ctrl, RES_EOM_L); |
scc | 869 | drivers/char/scc.c | scc->tx_bp = bp; |
scc | 870 | drivers/char/scc.c | scc->stat.tx_state = TXS_ACTIVE; /* next byte... */ |
scc | 874 | drivers/char/scc.c | if (--scc->stat.tx_queued < 0) scc->stat.tx_queued = 0; |
scc | 876 | drivers/char/scc.c | Outb(scc->ctrl, RES_Tx_P); /* reset pending int */ |
scc | 877 | drivers/char/scc.c | cl(scc, R10, ABUNDER); /* send CRC */ |
scc | 878 | drivers/char/scc.c | scc_enqueue_buffer(&scc->tx_buffer_pool, bp); |
scc | 879 | drivers/char/scc.c | scc->tx_bp = NULLBUF; |
scc | 880 | drivers/char/scc.c | scc->stat.tx_state = TXS_NEWFRAME; /* next frame... */ |
scc | 883 | drivers/char/scc.c | Outb(scc->data,*bp->rw_ptr); |
scc | 891 | drivers/char/scc.c | flush_FIFO(register struct scc_channel *scc) |
scc | 896 | drivers/char/scc.c | Inb(scc->data); |
scc | 898 | drivers/char/scc.c | if(scc->rx_bp != NULLBUF) /* did we receive something? */ |
scc | 900 | drivers/char/scc.c | scc->stat.rxerrs++; /* then count it as an error */ |
scc | 901 | drivers/char/scc.c | scc_enqueue_buffer(&scc->rx_buffer_pool, scc->rx_bp); |
scc | 903 | drivers/char/scc.c | scc->rx_bp = NULLBUF; |
scc | 910 | drivers/char/scc.c | scc_exint(register struct scc_channel *scc) |
scc | 914 | drivers/char/scc.c | scc->stat.exints++; |
scc | 916 | drivers/char/scc.c | status = InReg(scc->ctrl,R0); |
scc | 917 | drivers/char/scc.c | changes = status ^ scc->status; |
scc | 923 | drivers/char/scc.c | flush_FIFO(scc); |
scc | 933 | drivers/char/scc.c | if (scc->modem.clocksrc != CLK_EXTERNAL) |
scc | 934 | drivers/char/scc.c | OutReg(scc->ctrl,R14,SEARCH|scc->wreg[R14]); /* DPLL: enter search mode */ |
scc | 936 | drivers/char/scc.c | or(scc,R3,ENT_HM|RxENABLE); /* enable the receiver, hunt mode */ |
scc | 938 | drivers/char/scc.c | cl(scc,R3,ENT_HM|RxENABLE); /* disable the receiver */ |
scc | 939 | drivers/char/scc.c | flush_FIFO(scc); |
scc | 948 | drivers/char/scc.c | if (!Running(t_txdel) && scc->kiss.txdelay == 0) /* zero TXDELAY = wait for CTS */ |
scc | 949 | drivers/char/scc.c | scc->t_txdel = 0; /* kick it! */ |
scc | 954 | drivers/char/scc.c | if ( (status & TxEOM) && (scc->stat.tx_state == TXS_ACTIVE) ) |
scc | 956 | drivers/char/scc.c | scc->stat.tx_under++; /* oops, an underrun! count 'em */ |
scc | 957 | drivers/char/scc.c | Outb(scc->ctrl, RES_Tx_P); |
scc | 958 | drivers/char/scc.c | Outb(scc->ctrl, RES_EXT_INT); /* reset ext/status interrupts */ |
scc | 959 | drivers/char/scc.c | scc->t_maxk = 1; |
scc | 961 | drivers/char/scc.c | if (scc->tx_bp != NULLBUF) |
scc | 963 | drivers/char/scc.c | scc_enqueue_buffer(&scc->tx_buffer_pool, scc->tx_bp); |
scc | 964 | drivers/char/scc.c | scc->tx_bp = NULLBUF; |
scc | 967 | drivers/char/scc.c | if (--scc->stat.tx_queued < 0) scc->stat.tx_queued = 0; |
scc | 968 | drivers/char/scc.c | or(scc,R10,ABUNDER); |
scc | 973 | drivers/char/scc.c | scc->stat.tx_under = 9999; /* errr... yes. */ |
scc | 974 | drivers/char/scc.c | Outb(scc->ctrl, RES_Tx_P); /* just to be sure */ |
scc | 975 | drivers/char/scc.c | scc->t_maxk = 1; |
scc | 977 | drivers/char/scc.c | if (scc->tx_bp != NULLBUF) |
scc | 979 | drivers/char/scc.c | scc_enqueue_buffer(&scc->tx_buffer_pool, scc->tx_bp); |
scc | 980 | drivers/char/scc.c | scc->tx_bp = NULLBUF; |
scc | 983 | drivers/char/scc.c | if (--scc->stat.tx_queued < 0) scc->stat.tx_queued = 0; |
scc | 984 | drivers/char/scc.c | scc->kiss.tx_inhibit = 1; /* don't try it again! */ |
scc | 988 | drivers/char/scc.c | scc->status = status; |
scc | 989 | drivers/char/scc.c | Outb(scc->ctrl,RES_EXT_INT); |
scc | 995 | drivers/char/scc.c | scc_rxint(register struct scc_channel *scc) |
scc | 999 | drivers/char/scc.c | scc->stat.rxints++; |
scc | 1001 | drivers/char/scc.c | if( Running(t_maxk) && !(scc->kiss.fulldup)) |
scc | 1003 | drivers/char/scc.c | Inb(scc->data); /* discard char */ |
scc | 1004 | drivers/char/scc.c | or(scc,R3,ENT_HM); /* enter hunt mode for next flag */ |
scc | 1008 | drivers/char/scc.c | bp = scc->rx_bp; |
scc | 1012 | drivers/char/scc.c | bp = scc_get_buffer(scc, BT_RECEIVE); |
scc | 1016 | drivers/char/scc.c | Inb(scc->data); |
scc | 1017 | drivers/char/scc.c | or(scc, R3, ENT_HM); |
scc | 1018 | drivers/char/scc.c | scc->stat.nospace++; |
scc | 1022 | drivers/char/scc.c | scc->rx_bp = bp; |
scc | 1025 | drivers/char/scc.c | if (bp->cnt > scc->stat.bufsize) |
scc | 1030 | drivers/char/scc.c | scc_enqueue_buffer(&scc->rx_buffer_pool, bp); |
scc | 1031 | drivers/char/scc.c | scc->rx_bp = NULLBUF; |
scc | 1032 | drivers/char/scc.c | Inb(scc->data); |
scc | 1033 | drivers/char/scc.c | or(scc, R3, ENT_HM); |
scc | 1038 | drivers/char/scc.c | *bp->rw_ptr = Inb(scc->data); |
scc | 1053 | drivers/char/scc.c | kick_rx_timer(register struct scc_channel *scc) |
scc | 1055 | drivers/char/scc.c | if (scc->rx_t.next) |
scc | 1056 | drivers/char/scc.c | del_timer(&(scc->rx_t)); |
scc | 1058 | drivers/char/scc.c | scc->rx_t.expires = jiffies + 1; |
scc | 1059 | drivers/char/scc.c | scc->rx_t.function = scc_rx_timer; |
scc | 1060 | drivers/char/scc.c | scc->rx_t.data = (unsigned long) scc; |
scc | 1061 | drivers/char/scc.c | add_timer(&scc->rx_t); |
scc | 1066 | drivers/char/scc.c | scc_spint(register struct scc_channel *scc) |
scc | 1071 | drivers/char/scc.c | scc->stat.spints++; |
scc | 1073 | drivers/char/scc.c | status = InReg(scc->ctrl,R1); /* read receiver status */ |
scc | 1075 | drivers/char/scc.c | Inb(scc->data); /* throw away Rx byte */ |
scc | 1076 | drivers/char/scc.c | bp = scc->rx_bp; |
scc | 1080 | drivers/char/scc.c | scc->stat.rx_over++; /* count them */ |
scc | 1081 | drivers/char/scc.c | or(scc,R3,ENT_HM); /* enter hunt mode for next flag */ |
scc | 1083 | drivers/char/scc.c | if (bp) scc_enqueue_buffer(&scc->rx_buffer_pool, bp); |
scc | 1084 | drivers/char/scc.c | scc->rx_bp = NULLBUF; |
scc | 1096 | drivers/char/scc.c | scc_enqueue_buffer(&scc->rx_queue, bp); |
scc | 1097 | drivers/char/scc.c | scc->rx_bp = NULLBUF; |
scc | 1098 | drivers/char/scc.c | scc->stat.rxframes++; |
scc | 1099 | drivers/char/scc.c | scc->stat.rx_queued++; |
scc | 1100 | drivers/char/scc.c | kick_rx_timer(scc); |
scc | 1102 | drivers/char/scc.c | scc_enqueue_buffer(&scc->rx_buffer_pool, bp); |
scc | 1103 | drivers/char/scc.c | scc->rx_bp = NULLBUF; |
scc | 1104 | drivers/char/scc.c | scc->stat.rxerrs++; |
scc | 1108 | drivers/char/scc.c | Outb(scc->ctrl,ERR_RES); |
scc | 1119 | drivers/char/scc.c | static inline void set_brg(register struct scc_channel *scc, unsigned int tc) |
scc | 1125 | drivers/char/scc.c | cl(scc,R14,BRENABL); /* disable baudrate generator */ |
scc | 1126 | drivers/char/scc.c | wr(scc,R12,tc & 255); /* brg rate LOW */ |
scc | 1127 | drivers/char/scc.c | wr(scc,R13,tc >> 8); /* brg rate HIGH */ |
scc | 1128 | drivers/char/scc.c | or(scc,R14,BRENABL); /* enable baudrate generator */ |
scc | 1133 | drivers/char/scc.c | static inline void set_speed(register struct scc_channel *scc) |
scc | 1135 | drivers/char/scc.c | if (scc->modem.speed > 0) /* paranoia... */ |
scc | 1136 | drivers/char/scc.c | set_brg(scc, (unsigned) (scc->clock / (scc->modem.speed * 64)) - 2); |
scc | 1142 | drivers/char/scc.c | static inline void init_brg(register struct scc_channel *scc) |
scc | 1144 | drivers/char/scc.c | wr(scc, R14, BRSRC); /* BRG source = PCLK */ |
scc | 1145 | drivers/char/scc.c | OutReg(scc->ctrl, R14, SSBR|scc->wreg[R14]); /* DPLL source = BRG */ |
scc | 1146 | drivers/char/scc.c | OutReg(scc->ctrl, R14, SNRZI|scc->wreg[R14]); /* DPLL NRZI mode */ |
scc | 1195 | drivers/char/scc.c | init_channel(register struct scc_channel *scc) |
scc | 1199 | drivers/char/scc.c | if (scc->rx_t.next) del_timer(&(scc->rx_t)); |
scc | 1200 | drivers/char/scc.c | if (scc->tx_t.next) del_timer(&(scc->tx_t)); |
scc | 1204 | drivers/char/scc.c | wr(scc,R4,X1CLK|SDLC); /* *1 clock, SDLC mode */ |
scc | 1205 | drivers/char/scc.c | wr(scc,R1,0); /* no W/REQ operation */ |
scc | 1206 | drivers/char/scc.c | wr(scc,R3,Rx8|RxCRC_ENAB); /* RX 8 bits/char, CRC, disabled */ |
scc | 1207 | drivers/char/scc.c | wr(scc,R5,Tx8|DTR|TxCRC_ENAB); /* TX 8 bits/char, disabled, DTR */ |
scc | 1208 | drivers/char/scc.c | wr(scc,R6,0); /* SDLC address zero (not used) */ |
scc | 1209 | drivers/char/scc.c | wr(scc,R7,FLAG); /* SDLC flag value */ |
scc | 1210 | drivers/char/scc.c | wr(scc,R9,VIS); /* vector includes status */ |
scc | 1211 | drivers/char/scc.c | wr(scc,R10,(scc->modem.nrz? NRZ : NRZI)|CRCPS|ABUNDER); /* abort on underrun, preset CRC generator, NRZ(I) */ |
scc | 1212 | drivers/char/scc.c | wr(scc,R14, 0); |
scc | 1241 | drivers/char/scc.c | switch(scc->modem.clocksrc) |
scc | 1244 | drivers/char/scc.c | wr(scc, R11, RCDPLL|TCDPLL|TRxCOI|TRxCDP); |
scc | 1245 | drivers/char/scc.c | init_brg(scc); |
scc | 1249 | drivers/char/scc.c | wr(scc, R11, ((scc->brand & BAYCOM)? TRxCDP : TRxCBR) | RCDPLL|TCRTxCP|TRxCOI); |
scc | 1250 | drivers/char/scc.c | init_brg(scc); |
scc | 1254 | drivers/char/scc.c | wr(scc, R11, (scc->brand & BAYCOM)? RCTRxCP|TCRTxCP : RCRTxCP|TCTRxCP); |
scc | 1255 | drivers/char/scc.c | OutReg(scc->ctrl, R14, DISDPLL); |
scc | 1260 | drivers/char/scc.c | set_speed(scc); /* set baudrate */ |
scc | 1262 | drivers/char/scc.c | if(scc->enhanced) |
scc | 1264 | drivers/char/scc.c | or(scc,R15,SHDLCE|FIFOE); /* enable FIFO, SDLC/HDLC Enhancements (From now R7 is R7') */ |
scc | 1265 | drivers/char/scc.c | wr(scc,R7,AUTOEOM); |
scc | 1268 | drivers/char/scc.c | if((InReg(scc->ctrl,R0)) & DCD) /* DCD is now ON */ |
scc | 1270 | drivers/char/scc.c | if (scc->modem.clocksrc != CLK_EXTERNAL) |
scc | 1271 | drivers/char/scc.c | or(scc,R14, SEARCH); |
scc | 1273 | drivers/char/scc.c | or(scc,R3,ENT_HM|RxENABLE); /* enable the receiver, hunt mode */ |
scc | 1277 | drivers/char/scc.c | wr(scc,R15,((scc->brand & BAYCOM) ? 0 : CTSIE)|BRKIE|DCDIE|TxUIE); |
scc | 1279 | drivers/char/scc.c | Outb(scc->ctrl,RES_EXT_INT); /* reset ext/status interrupts */ |
scc | 1280 | drivers/char/scc.c | Outb(scc->ctrl,RES_EXT_INT); /* must be done twice */ |
scc | 1282 | drivers/char/scc.c | or(scc,R1,INT_ALL_Rx|TxINT_ENAB|EXT_INT_ENAB); /* enable interrupts */ |
scc | 1284 | drivers/char/scc.c | scc->status = InReg(scc->ctrl,R0); /* read initial status */ |
scc | 1286 | drivers/char/scc.c | or(scc,R9,MIE); /* master interrupt enable */ |
scc | 1288 | drivers/char/scc.c | scc_init_timer(scc); |
scc | 1305 | drivers/char/scc.c | scc_key_trx(struct scc_channel *scc, char tx) |
scc | 1309 | drivers/char/scc.c | if (scc->modem.speed < baud_table[1]) |
scc | 1310 | drivers/char/scc.c | scc->modem.speed = 1200; |
scc | 1312 | drivers/char/scc.c | if (scc->brand & PRIMUS) |
scc | 1313 | drivers/char/scc.c | Outb(scc->ctrl + 4, scc->option | (tx? 0x80 : 0)); |
scc | 1315 | drivers/char/scc.c | time_const = (unsigned) (scc->clock / (scc->modem.speed * (tx? 2:64))) - 2; |
scc | 1317 | drivers/char/scc.c | if (scc->modem.clocksrc == CLK_DPLL) |
scc | 1321 | drivers/char/scc.c | cl(scc,R3,RxENABLE|ENT_HM); /* then switch off receiver */ |
scc | 1323 | drivers/char/scc.c | set_brg(scc, time_const); /* reprogram baudrate generator */ |
scc | 1326 | drivers/char/scc.c | wr(scc, R11, RCDPLL|TCBR|TRxCOI|TRxCBR); |
scc | 1328 | drivers/char/scc.c | or(scc,R5,RTS|TxENAB); /* set the RTS line and enable TX */ |
scc | 1330 | drivers/char/scc.c | cl(scc,R5,RTS|TxENAB); |
scc | 1332 | drivers/char/scc.c | set_brg(scc, time_const); /* reprogram baudrate generator */ |
scc | 1335 | drivers/char/scc.c | wr(scc, R11, RCDPLL|TCDPLL|TRxCOI|TRxCDP); |
scc | 1337 | drivers/char/scc.c | or(scc,R3,RxENABLE|ENT_HM); |
scc | 1341 | drivers/char/scc.c | or(scc,R5,RTS|TxENAB); /* enable tx */ |
scc | 1343 | drivers/char/scc.c | cl(scc,R5,RTS|TxENAB); /* disable tx */ |
scc | 1352 | drivers/char/scc.c | static inline int is_grouped(register struct scc_channel *scc) |
scc | 1358 | drivers/char/scc.c | grp1 = scc->kiss.group; |
scc | 1365 | drivers/char/scc.c | if (scc2 == scc || !(scc2->tty && grp2)) |
scc | 1381 | drivers/char/scc.c | static inline void dw_slot_timeout(register struct scc_channel *scc) |
scc | 1383 | drivers/char/scc.c | scc->t_dwait = TIMER_STOPPED; |
scc | 1384 | drivers/char/scc.c | scc->t_slot = TIMER_STOPPED; |
scc | 1386 | drivers/char/scc.c | if (!scc->kiss.fulldup) |
scc | 1390 | 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 | 1392 | drivers/char/scc.c | if (scc->t_mbusy == TIMER_STOPPED) |
scc | 1393 | drivers/char/scc.c | scc->t_mbusy = TPS * scc->kiss.maxdefer; |
scc | 1395 | drivers/char/scc.c | scc->t_slot = scc->kiss.slottime; |
scc | 1401 | drivers/char/scc.c | if ( !(scc->wreg[R5] & RTS) ) |
scc | 1403 | drivers/char/scc.c | scc->t_txdel = scc->kiss.txdelay; |
scc | 1404 | drivers/char/scc.c | scc_key_trx(scc, TX_ON); |
scc | 1406 | drivers/char/scc.c | scc->t_txdel = 0; |
scc | 1413 | drivers/char/scc.c | static inline void txdel_timeout(register struct scc_channel *scc) |
scc | 1415 | drivers/char/scc.c | scc->t_txdel = TIMER_STOPPED; |
scc | 1417 | drivers/char/scc.c | scc->t_maxk = TPS * scc->kiss.maxkeyup; |
scc | 1419 | drivers/char/scc.c | if (scc->tx_bp == NULLBUF) |
scc | 1420 | drivers/char/scc.c | scc_txint(scc); |
scc | 1425 | drivers/char/scc.c | static inline void tail_timeout(register struct scc_channel *scc) |
scc | 1427 | drivers/char/scc.c | scc->t_tail = TIMER_STOPPED; |
scc | 1437 | drivers/char/scc.c | if (scc->kiss.fulldup < 2) |
scc | 1439 | drivers/char/scc.c | if (scc->tx_bp) /* we had a timeout? */ |
scc | 1441 | drivers/char/scc.c | scc->stat.tx_state = TXS_BUSY; |
scc | 1442 | drivers/char/scc.c | scc->t_dwait = TPS * scc->kiss.mintime; /* try again */ |
scc | 1445 | drivers/char/scc.c | scc->stat.tx_state = TXS_IDLE; |
scc | 1446 | drivers/char/scc.c | scc->t_maxk = TIMER_STOPPED; |
scc | 1447 | drivers/char/scc.c | scc_key_trx(scc, TX_OFF); |
scc | 1451 | drivers/char/scc.c | if (scc->tx_bp) /* maxkeyup expired */ /* ?! */ |
scc | 1453 | drivers/char/scc.c | scc->stat.tx_state = TXS_BUSY; |
scc | 1454 | drivers/char/scc.c | scc->t_txdel = TPS * scc->kiss.waittime; |
scc | 1458 | drivers/char/scc.c | scc->t_idle = TPS * scc->kiss.idletime; |
scc | 1462 | drivers/char/scc.c | static inline void busy_timeout(register struct scc_channel *scc) |
scc | 1467 | drivers/char/scc.c | while (bp = scc_dequeue_buffer(&scc->tx_queue)) |
scc | 1468 | drivers/char/scc.c | scc_enqueue_buffer(&scc->tx_buffer_pool, bp); |
scc | 1470 | drivers/char/scc.c | scc->tx_queue = NULLBUF; |
scc | 1471 | drivers/char/scc.c | scc->stat.tx_state = TXS_IDLE; |
scc | 1474 | drivers/char/scc.c | scc->t_txdel = scc->kiss.txdelay; /* brute force ... */ |
scc | 1476 | drivers/char/scc.c | scc->t_mbusy = TIMER_STOPPED; |
scc | 1481 | drivers/char/scc.c | static inline void maxk_idle_timeout(register struct scc_channel *scc) |
scc | 1483 | drivers/char/scc.c | scc->t_maxk = TIMER_STOPPED; |
scc | 1484 | drivers/char/scc.c | scc->t_idle = TIMER_STOPPED; |
scc | 1486 | drivers/char/scc.c | scc->stat.tx_state = TXS_BUSY; |
scc | 1487 | drivers/char/scc.c | scc->t_tail = scc->kiss.tailtime; |
scc | 1493 | drivers/char/scc.c | register struct scc_channel *scc; |
scc | 1497 | drivers/char/scc.c | scc = (struct scc_channel *) channel; |
scc | 1499 | drivers/char/scc.c | if (scc->tty && scc->init) |
scc | 1505 | drivers/char/scc.c | if (Expired(t_dwait)) dw_slot_timeout(scc) ; else |
scc | 1506 | drivers/char/scc.c | if (Expired(t_slot)) dw_slot_timeout(scc) ; else |
scc | 1507 | drivers/char/scc.c | if (Expired(t_txdel)) txdel_timeout(scc) ; else |
scc | 1508 | drivers/char/scc.c | if (Expired(t_tail)) tail_timeout(scc) ; |
scc | 1512 | drivers/char/scc.c | if (Expired(t_mbusy)) busy_timeout(scc); |
scc | 1513 | drivers/char/scc.c | if (Expired(t_maxk)) maxk_idle_timeout(scc); |
scc | 1514 | drivers/char/scc.c | if (Expired(t_idle)) maxk_idle_timeout(scc); |
scc | 1519 | drivers/char/scc.c | scc->tx_t.expires = jiffies + HZ/TPS; |
scc | 1520 | drivers/char/scc.c | add_timer(&scc->tx_t); |
scc | 1527 | drivers/char/scc.c | register struct scc_channel *scc; |
scc | 1529 | drivers/char/scc.c | scc = (struct scc_channel *) channel; |
scc | 1531 | drivers/char/scc.c | if (scc->rx_queue && scc->throttled) |
scc | 1533 | drivers/char/scc.c | scc->rx_t.expires = jiffies + HZ/TPS; |
scc | 1534 | drivers/char/scc.c | add_timer(&scc->rx_t); |
scc | 1538 | drivers/char/scc.c | kiss_encode(scc); |
scc | 1540 | drivers/char/scc.c | if (scc->rx_queue && !scc->throttled) |
scc | 1544 | drivers/char/scc.c | kdevname(scc->tty->device)); |
scc | 1546 | drivers/char/scc.c | scc->rx_t.expires = jiffies + HZ/TPS; |
scc | 1547 | drivers/char/scc.c | add_timer(&scc->rx_t); |
scc | 1552 | drivers/char/scc.c | scc_init_timer(struct scc_channel *scc) |
scc | 1566 | drivers/char/scc.c | scc->stat.tx_state = TXS_IDLE; |
scc | 1568 | drivers/char/scc.c | if (scc->tx_t.next) |
scc | 1569 | drivers/char/scc.c | del_timer(&scc->tx_t); |
scc | 1571 | drivers/char/scc.c | scc->tx_t.data = (unsigned long) scc; |
scc | 1572 | drivers/char/scc.c | scc->tx_t.function = scc_tx_timer; |
scc | 1573 | drivers/char/scc.c | scc->tx_t.expires = jiffies + HZ/TPS; |
scc | 1574 | drivers/char/scc.c | add_timer(&scc->tx_t); |
scc | 1576 | drivers/char/scc.c | scc->rx_t.data = (unsigned long) scc; |
scc | 1577 | drivers/char/scc.c | scc->rx_t.function = scc_rx_timer; |
scc | 1593 | drivers/char/scc.c | kiss_set_param(struct scc_channel *scc,char cmd, unsigned int val) |
scc | 1601 | drivers/char/scc.c | scc->kiss.txdelay = VAL; break; |
scc | 1603 | drivers/char/scc.c | scc->kiss.persist = val; break; |
scc | 1605 | drivers/char/scc.c | scc->kiss.slottime = VAL; break; |
scc | 1607 | drivers/char/scc.c | scc->kiss.tailtime = VAL; break; |
scc | 1609 | drivers/char/scc.c | scc->kiss.fulldup = val; break; |
scc | 1611 | drivers/char/scc.c | scc->kiss.waittime = VAL; break; |
scc | 1613 | drivers/char/scc.c | scc->kiss.maxkeyup = SVAL; break; |
scc | 1615 | drivers/char/scc.c | scc->kiss.mintime = SVAL; break; |
scc | 1617 | drivers/char/scc.c | scc->kiss.idletime = val; break; |
scc | 1619 | drivers/char/scc.c | scc->kiss.maxdefer = SVAL; break; |
scc | 1621 | drivers/char/scc.c | scc->kiss.group = val; break; |
scc | 1623 | drivers/char/scc.c | scc->kiss.tx_inhibit = val; |
scc | 1625 | drivers/char/scc.c | scc->kiss.softdcd = val; |
scc | 1636 | drivers/char/scc.c | static void kiss_interpret_frame(struct scc_channel * scc) |
scc | 1642 | drivers/char/scc.c | bp = scc->kiss_decode_bp; |
scc | 1655 | drivers/char/scc.c | scc_enqueue_buffer(&scc->tx_buffer_pool, bp); |
scc | 1656 | drivers/char/scc.c | scc->kiss_decode_bp = NULLBUF; |
scc | 1662 | drivers/char/scc.c | if (scc->kiss.not_slip) |
scc | 1676 | drivers/char/scc.c | scc_enqueue_buffer(&scc->tx_buffer_pool, bp); |
scc | 1677 | drivers/char/scc.c | scc->kiss_decode_bp = NULLBUF; |
scc | 1688 | drivers/char/scc.c | kiss_set_param(scc, kisscmd, *bp->rw_ptr); |
scc | 1689 | drivers/char/scc.c | scc_enqueue_buffer(&scc->tx_buffer_pool, bp); |
scc | 1690 | drivers/char/scc.c | scc->kiss_decode_bp = NULLBUF; |
scc | 1694 | drivers/char/scc.c | scc_enqueue_buffer(&scc->tx_queue, bp); /* enqueue frame */ |
scc | 1696 | drivers/char/scc.c | scc->stat.txframes++; |
scc | 1697 | drivers/char/scc.c | scc->stat.tx_queued++; |
scc | 1698 | drivers/char/scc.c | scc->kiss_decode_bp = NULLBUF; |
scc | 1702 | drivers/char/scc.c | if(scc->stat.tx_state == TXS_IDLE) |
scc | 1704 | drivers/char/scc.c | scc->stat.tx_state = TXS_BUSY; |
scc | 1705 | drivers/char/scc.c | scc->t_dwait = (scc->kiss.fulldup? 0:scc->kiss.waittime); |
scc | 1711 | drivers/char/scc.c | static inline void kiss_store_byte(struct scc_channel *scc, unsigned char ch) |
scc | 1713 | drivers/char/scc.c | register struct mbuf *bp = scc->kiss_decode_bp; |
scc | 1717 | drivers/char/scc.c | if (bp->cnt > scc->stat.bufsize) |
scc | 1728 | drivers/char/scc.c | static inline int kiss_decode(struct scc_channel *scc, unsigned char ch) |
scc | 1730 | drivers/char/scc.c | switch (scc->stat.tx_kiss_state) |
scc | 1735 | drivers/char/scc.c | scc->kiss_decode_bp = scc_get_buffer(scc, BT_TRANSMIT); |
scc | 1736 | drivers/char/scc.c | if (scc->kiss_decode_bp == NULLBUF) |
scc | 1739 | drivers/char/scc.c | scc->stat.tx_kiss_state = KISS_DATA; |
scc | 1740 | drivers/char/scc.c | } else scc->stat.txerrs++; |
scc | 1745 | drivers/char/scc.c | scc->stat.tx_kiss_state = KISS_ESCAPE; |
scc | 1748 | drivers/char/scc.c | kiss_interpret_frame(scc); |
scc | 1749 | drivers/char/scc.c | scc->stat.tx_kiss_state = KISS_IDLE; |
scc | 1751 | drivers/char/scc.c | else kiss_store_byte(scc, ch); |
scc | 1757 | drivers/char/scc.c | kiss_store_byte(scc, FEND); |
scc | 1758 | drivers/char/scc.c | scc->stat.tx_kiss_state = KISS_DATA; |
scc | 1762 | drivers/char/scc.c | kiss_store_byte(scc, FESC); |
scc | 1763 | drivers/char/scc.c | scc->stat.tx_kiss_state = KISS_DATA; |
scc | 1767 | drivers/char/scc.c | scc_enqueue_buffer(&scc->tx_buffer_pool, scc->kiss_decode_bp); |
scc | 1768 | drivers/char/scc.c | scc->kiss_decode_bp = NULLBUF; |
scc | 1769 | drivers/char/scc.c | scc->stat.txerrs++; |
scc | 1770 | drivers/char/scc.c | scc->stat.tx_kiss_state = KISS_IDLE; |
scc | 1782 | drivers/char/scc.c | kiss_encode(register struct scc_channel *scc) |
scc | 1785 | drivers/char/scc.c | struct tty_struct * tty = scc->tty; |
scc | 1788 | drivers/char/scc.c | bp = scc->kiss_encode_bp; |
scc | 1796 | drivers/char/scc.c | bp = scc_dequeue_buffer(&scc->rx_queue); |
scc | 1797 | drivers/char/scc.c | scc->kiss_encode_bp = bp; |
scc | 1801 | drivers/char/scc.c | scc->stat.rx_kiss_state = KISS_IDLE; |
scc | 1809 | drivers/char/scc.c | if (--scc->stat.rx_queued < 0) |
scc | 1810 | drivers/char/scc.c | scc->stat.rx_queued = 0; |
scc | 1812 | drivers/char/scc.c | if (scc->stat.rx_kiss_state == KISS_RXFRAME) /* new packet? */ |
scc | 1815 | drivers/char/scc.c | scc->stat.rx_kiss_state = KISS_IDLE; /* generate FEND for new frame */ |
scc | 1818 | drivers/char/scc.c | scc_enqueue_buffer(&scc->rx_buffer_pool, bp); |
scc | 1820 | drivers/char/scc.c | bp = scc->kiss_encode_bp = NULLBUF; |
scc | 1825 | drivers/char/scc.c | if (scc->stat.rx_kiss_state == KISS_IDLE) |
scc | 1829 | drivers/char/scc.c | if (scc->kiss.not_slip) |
scc | 1832 | drivers/char/scc.c | scc->stat.rx_kiss_state = KISS_RXFRAME; |
scc | 1865 | drivers/char/scc.c | struct scc_channel *scc; |
scc | 1886 | drivers/char/scc.c | scc=&SCC_Info[2*chip]; |
scc | 1887 | drivers/char/scc.c | if (!scc->ctrl) continue; |
scc | 1893 | drivers/char/scc.c | if(scc->brand & EAGLE) /* this is an EAGLE card */ |
scc | 1894 | drivers/char/scc.c | Outb(scc->special,0x08); /* enable interrupt on the board */ |
scc | 1896 | drivers/char/scc.c | if(scc->brand & (PC100 | PRIMUS)) /* this is a PC100/EAGLE card */ |
scc | 1897 | drivers/char/scc.c | Outb(scc->special,scc->option); /* set the MODEM mode (0x22) */ |
scc | 1904 | drivers/char/scc.c | Outb(scc->ctrl, 0); |
scc | 1905 | drivers/char/scc.c | OutReg(scc->ctrl,R9,FHWRES); /* force hardware reset */ |
scc | 1907 | drivers/char/scc.c | wr(scc, R2, chip*16); /* interrupt vector */ |
scc | 1908 | drivers/char/scc.c | wr(scc, R9, VIS); /* vector includes status */ |
scc | 1926 | drivers/char/scc.c | static inline int scc_paranoia_check(struct scc_channel *scc, kdev_t device, |
scc | 1936 | drivers/char/scc.c | if (!scc->init) |
scc | 1942 | drivers/char/scc.c | if (scc->magic != SCC_MAGIC) |
scc | 1957 | drivers/char/scc.c | struct scc_channel *scc; |
scc | 1972 | drivers/char/scc.c | scc = &SCC_Info[chan]; |
scc | 1974 | drivers/char/scc.c | tty->driver_data = scc; |
scc | 1977 | drivers/char/scc.c | if (scc->magic != SCC_MAGIC) |
scc | 1986 | drivers/char/scc.c | if(scc->tty != NULL) |
scc | 1988 | drivers/char/scc.c | scc->tty_opened++; |
scc | 1992 | drivers/char/scc.c | scc->tty = tty; |
scc | 1993 | drivers/char/scc.c | alloc_buffer_pool(scc); |
scc | 1995 | drivers/char/scc.c | if(!scc->init) return 0; |
scc | 1997 | drivers/char/scc.c | scc->throttled = 0; |
scc | 1999 | drivers/char/scc.c | scc->stat.tx_kiss_state = KISS_IDLE; /* don't change this... */ |
scc | 2000 | drivers/char/scc.c | scc->stat.rx_kiss_state = KISS_IDLE; /* ...or this */ |
scc | 2002 | drivers/char/scc.c | init_channel(scc); |
scc | 2012 | drivers/char/scc.c | struct scc_channel *scc = tty->driver_data; |
scc | 2015 | drivers/char/scc.c | if (!scc || (scc->magic != SCC_MAGIC)) |
scc | 2020 | drivers/char/scc.c | if(scc->tty_opened) |
scc | 2022 | drivers/char/scc.c | scc->tty_opened--; |
scc | 2033 | drivers/char/scc.c | Outb(scc->ctrl,0); /* Make sure pointer is written */ |
scc | 2034 | drivers/char/scc.c | wr(scc,R1,0); /* disable interrupts */ |
scc | 2035 | drivers/char/scc.c | wr(scc,R3,0); |
scc | 2037 | drivers/char/scc.c | scc->tty = NULL; |
scc | 2039 | drivers/char/scc.c | del_timer(&scc->tx_t); |
scc | 2040 | drivers/char/scc.c | del_timer(&scc->rx_t); |
scc | 2042 | drivers/char/scc.c | free_buffer_pool(scc); |
scc | 2046 | drivers/char/scc.c | scc->throttled = 0; |
scc | 2056 | drivers/char/scc.c | scc_change_speed(struct scc_channel * scc) |
scc | 2060 | drivers/char/scc.c | if (scc->tty == NULL) |
scc | 2064 | drivers/char/scc.c | speed = baud_table[scc->tty->termios->c_cflag & CBAUD]; |
scc | 2066 | drivers/char/scc.c | if (speed > 0) scc->modem.speed = speed; |
scc | 2068 | drivers/char/scc.c | if (scc->stat.tx_state == 0) /* only switch baudrate on rx... ;-) */ |
scc | 2069 | drivers/char/scc.c | set_speed(scc); |
scc | 2094 | drivers/char/scc.c | struct scc_channel * scc = tty->driver_data; |
scc | 2103 | drivers/char/scc.c | if (scc->magic != SCC_MAGIC) |
scc | 2146 | drivers/char/scc.c | check_region(scc->ctrl, 1); |
scc | 2213 | drivers/char/scc.c | scc->tty=tty; |
scc | 2214 | drivers/char/scc.c | alloc_buffer_pool(scc); |
scc | 2221 | drivers/char/scc.c | if (!scc->init) |
scc | 2231 | drivers/char/scc.c | memcpy_fromfs(&scc->modem, (void *) arg, sizeof(struct scc_modem)); |
scc | 2235 | drivers/char/scc.c | if (scc->modem.speed < 4800) |
scc | 2237 | drivers/char/scc.c | scc->kiss.txdelay = 36*TPS/100; /* 360 ms */ |
scc | 2238 | drivers/char/scc.c | scc->kiss.persist = 42; /* 25% persistence */ /* was 25 */ |
scc | 2239 | drivers/char/scc.c | scc->kiss.slottime = 16*TPS/100; /* 160 ms */ |
scc | 2240 | drivers/char/scc.c | scc->kiss.tailtime = 4; /* minimal reasonable value */ |
scc | 2241 | drivers/char/scc.c | scc->kiss.fulldup = 0; /* CSMA */ |
scc | 2242 | drivers/char/scc.c | scc->kiss.waittime = 50*TPS/100; /* 500 ms */ |
scc | 2243 | drivers/char/scc.c | scc->kiss.maxkeyup = 10; /* 10 s */ |
scc | 2244 | drivers/char/scc.c | scc->kiss.mintime = 3; /* 3 s */ |
scc | 2245 | drivers/char/scc.c | scc->kiss.idletime = 30; /* 30 s */ |
scc | 2246 | drivers/char/scc.c | scc->kiss.maxdefer = 120; /* 2 min */ |
scc | 2247 | drivers/char/scc.c | scc->kiss.not_slip = 1; /* KISS mode */ |
scc | 2248 | drivers/char/scc.c | scc->kiss.softdcd = 0; /* hardware dcd */ |
scc | 2250 | drivers/char/scc.c | scc->kiss.txdelay = 10*TPS/100; /* 100 ms */ |
scc | 2251 | drivers/char/scc.c | scc->kiss.persist = 64; /* 25% persistence */ /* was 25 */ |
scc | 2252 | drivers/char/scc.c | scc->kiss.slottime = 8*TPS/100; /* 160 ms */ |
scc | 2253 | drivers/char/scc.c | scc->kiss.tailtime = 1; /* minimal reasonable value */ |
scc | 2254 | drivers/char/scc.c | scc->kiss.fulldup = 0; /* CSMA */ |
scc | 2255 | drivers/char/scc.c | scc->kiss.waittime = 50*TPS/100; /* 500 ms */ |
scc | 2256 | drivers/char/scc.c | scc->kiss.maxkeyup = 7; /* 7 s */ |
scc | 2257 | drivers/char/scc.c | scc->kiss.mintime = 3; /* 3 s */ |
scc | 2258 | drivers/char/scc.c | scc->kiss.idletime = 30; /* 30 s */ |
scc | 2259 | drivers/char/scc.c | scc->kiss.maxdefer = 120; /* 2 min */ |
scc | 2260 | drivers/char/scc.c | scc->kiss.not_slip = 1; /* KISS mode */ |
scc | 2261 | drivers/char/scc.c | scc->kiss.softdcd = 0; /* hardware dcd */ |
scc | 2264 | drivers/char/scc.c | scc->init = 1; |
scc | 2282 | drivers/char/scc.c | result = ((scc->wreg[R5] & RTS) ? TIOCM_RTS : 0) |
scc | 2283 | drivers/char/scc.c | | ((scc->wreg[R5] & DTR) ? TIOCM_DTR : 0) |
scc | 2284 | drivers/char/scc.c | | ((InReg(scc->ctrl,R0) & DCD) ? TIOCM_CAR : 0) |
scc | 2285 | drivers/char/scc.c | | ((InReg(scc->ctrl,R0) & CTS) ? TIOCM_CTS : 0); |
scc | 2296 | drivers/char/scc.c | scc->wreg[R5] |= DTR; |
scc | 2297 | drivers/char/scc.c | scc->wreg[R5] |= RTS; |
scc | 2300 | drivers/char/scc.c | scc->wreg[R5] &= ~DTR; |
scc | 2301 | drivers/char/scc.c | scc->wreg[R5] &= ~RTS; |
scc | 2307 | drivers/char/scc.c | scc->wreg[R5] |= DTR; |
scc | 2309 | drivers/char/scc.c | scc->wreg[R5] &= ~DTR; |
scc | 2311 | drivers/char/scc.c | scc->wreg[R5] |= RTS; |
scc | 2313 | drivers/char/scc.c | scc->wreg[R5] &= ~RTS; |
scc | 2319 | drivers/char/scc.c | if(scc->stat.tx_state == TXS_IDLE && !Running(t_idle)) |
scc | 2320 | drivers/char/scc.c | maxk_idle_timeout(scc); |
scc | 2333 | drivers/char/scc.c | memcpy_tofs((void *) arg, scc->tty->termios, sizeof(struct termios)); |
scc | 2342 | drivers/char/scc.c | memcpy_fromfs(scc->tty->termios, (void *) arg, sizeof(struct termios)); |
scc | 2343 | drivers/char/scc.c | scc_change_speed(scc); |
scc | 2354 | drivers/char/scc.c | free_buffer_pool(scc); |
scc | 2355 | drivers/char/scc.c | scc->stat.rxbuffers = memcfg.rxbuffers; |
scc | 2356 | drivers/char/scc.c | scc->stat.txbuffers = memcfg.txbuffers; |
scc | 2357 | drivers/char/scc.c | scc->stat.bufsize = memcfg.bufsize; |
scc | 2358 | drivers/char/scc.c | alloc_buffer_pool(scc); |
scc | 2372 | drivers/char/scc.c | memcpy_tofs((void *) arg, &scc->stat, sizeof(struct scc_stat)); |
scc | 2393 | drivers/char/scc.c | case PARAM_TXDELAY: r = CAST(scc->kiss.txdelay*TICKS); break; |
scc | 2394 | drivers/char/scc.c | case PARAM_PERSIST: r = CAST(scc->kiss.persist); break; |
scc | 2395 | drivers/char/scc.c | case PARAM_SLOTTIME: r = CAST(scc->kiss.slottime*TICKS); break; |
scc | 2396 | drivers/char/scc.c | case PARAM_TXTAIL: r = CAST(scc->kiss.tailtime*TICKS); break; |
scc | 2397 | drivers/char/scc.c | case PARAM_FULLDUP: r = CAST(scc->kiss.fulldup); break; |
scc | 2398 | drivers/char/scc.c | case PARAM_SOFTDCD: r = CAST(scc->kiss.softdcd); break; |
scc | 2399 | drivers/char/scc.c | case PARAM_DTR: r = CAST((scc->wreg[R5] & DTR)? 1:0); break; |
scc | 2400 | drivers/char/scc.c | case PARAM_RTS: r = CAST((scc->wreg[R5] & RTS)? 1:0); break; |
scc | 2401 | drivers/char/scc.c | case PARAM_SPEED: r = CAST(scc->modem.speed); break; |
scc | 2402 | drivers/char/scc.c | case PARAM_GROUP: r = CAST(scc->kiss.group); break; |
scc | 2403 | drivers/char/scc.c | case PARAM_IDLE: r = CAST(scc->kiss.idletime); break; |
scc | 2404 | drivers/char/scc.c | case PARAM_MIN: r = CAST(scc->kiss.mintime); break; |
scc | 2405 | drivers/char/scc.c | case PARAM_MAXKEY: r = CAST(scc->kiss.maxkeyup); break; |
scc | 2406 | drivers/char/scc.c | case PARAM_WAIT: r = CAST(scc->kiss.waittime); break; |
scc | 2407 | drivers/char/scc.c | case PARAM_MAXDEFER: r = CAST(scc->kiss.maxdefer); break; |
scc | 2408 | drivers/char/scc.c | case PARAM_TX: r = CAST(scc->kiss.tx_inhibit); break; |
scc | 2409 | drivers/char/scc.c | case PARAM_SLIP: r = CAST(!scc->kiss.not_slip); break; |
scc | 2427 | drivers/char/scc.c | case PARAM_TXDELAY: scc->kiss.txdelay=VAL; break; |
scc | 2428 | drivers/char/scc.c | case PARAM_PERSIST: scc->kiss.persist=Val; break; |
scc | 2429 | drivers/char/scc.c | case PARAM_SLOTTIME: scc->kiss.slottime=VAL; break; |
scc | 2430 | drivers/char/scc.c | case PARAM_TXTAIL: scc->kiss.tailtime=VAL; break; |
scc | 2431 | drivers/char/scc.c | case PARAM_FULLDUP: scc->kiss.fulldup=Val; break; |
scc | 2432 | drivers/char/scc.c | case PARAM_SOFTDCD: scc->kiss.softdcd=Val; break; |
scc | 2435 | drivers/char/scc.c | case PARAM_SPEED: scc->modem.speed=Val; break; |
scc | 2436 | drivers/char/scc.c | case PARAM_GROUP: scc->kiss.group=Val; break; |
scc | 2437 | drivers/char/scc.c | case PARAM_IDLE: scc->kiss.idletime=Val; break; |
scc | 2438 | drivers/char/scc.c | case PARAM_MIN: scc->kiss.mintime=SVAL; break; |
scc | 2439 | drivers/char/scc.c | case PARAM_MAXKEY: scc->kiss.maxkeyup=SVAL; break; |
scc | 2440 | drivers/char/scc.c | case PARAM_WAIT: scc->kiss.waittime=Val; break; |
scc | 2441 | drivers/char/scc.c | case PARAM_MAXDEFER: scc->kiss.maxdefer=SVAL; break; |
scc | 2442 | drivers/char/scc.c | case PARAM_TX: scc->kiss.tx_inhibit=Val; break; |
scc | 2443 | drivers/char/scc.c | case PARAM_SLIP: scc->kiss.not_slip=!Val; break; |
scc | 2466 | drivers/char/scc.c | struct scc_channel * scc = tty->driver_data; |
scc | 2473 | drivers/char/scc.c | if (scc_paranoia_check(scc, tty->device, "scc_write")) |
scc | 2476 | drivers/char/scc.c | if (scc->kiss.tx_inhibit) return count; |
scc | 2512 | drivers/char/scc.c | if (kiss_decode(scc, *p++)) |
scc | 2514 | drivers/char/scc.c | scc->stat.nospace++; |
scc | 2530 | drivers/char/scc.c | struct scc_channel *scc = tty->driver_data; |
scc | 2533 | drivers/char/scc.c | if (scc_paranoia_check(scc, tty->device, "scc_put_char")) |
scc | 2542 | drivers/char/scc.c | struct scc_channel *scc = tty->driver_data; |
scc | 2544 | drivers/char/scc.c | scc_paranoia_check(scc, tty->device, "scc_flush_chars"); /* just to annoy the user... */ |
scc | 2552 | drivers/char/scc.c | struct scc_channel *scc = tty->driver_data; |
scc | 2554 | drivers/char/scc.c | if (scc_paranoia_check(scc, tty->device, "scc_write_room")) |
scc | 2562 | drivers/char/scc.c | struct scc_channel *scc = tty->driver_data; |
scc | 2564 | drivers/char/scc.c | if (scc && scc->kiss_decode_bp) |
scc | 2565 | drivers/char/scc.c | return scc->kiss_decode_bp->cnt; |
scc | 2572 | drivers/char/scc.c | struct scc_channel *scc = tty->driver_data; |
scc | 2574 | drivers/char/scc.c | if (scc_paranoia_check(scc, tty->device, "scc_flush_buffer")) |
scc | 2584 | drivers/char/scc.c | struct scc_channel *scc = tty->driver_data; |
scc | 2586 | drivers/char/scc.c | if (scc_paranoia_check(scc, tty->device, "scc_throttle")) |
scc | 2592 | drivers/char/scc.c | scc->throttled = 1; |
scc | 2594 | drivers/char/scc.c | del_timer(&(scc->rx_t)); |
scc | 2595 | drivers/char/scc.c | scc->rx_t.expires = jiffies + HZ/TPS; |
scc | 2596 | drivers/char/scc.c | add_timer(&scc->rx_t); |
scc | 2601 | drivers/char/scc.c | struct scc_channel *scc = tty->driver_data; |
scc | 2603 | drivers/char/scc.c | if (scc_paranoia_check(scc, tty->device, "scc_unthrottle")) |
scc | 2609 | drivers/char/scc.c | scc->throttled = 0; |
scc | 2610 | drivers/char/scc.c | del_timer(&(scc->rx_t)); |
scc | 2611 | drivers/char/scc.c | scc_tx_timer(scc->rx_t.data); |
scc | 2618 | drivers/char/scc.c | struct scc_channel *scc = tty->driver_data; |
scc | 2620 | drivers/char/scc.c | if (scc_paranoia_check(scc, tty->device, "scc_start")) |
scc | 2628 | drivers/char/scc.c | struct scc_channel *scc = tty->driver_data; |
scc | 2630 | drivers/char/scc.c | if (scc_paranoia_check(scc, tty->device, "scc_stop")) |
scc | 2639 | drivers/char/scc.c | struct scc_channel *scc = tty->driver_data; |
scc | 2641 | drivers/char/scc.c | if (scc_paranoia_check(scc, tty->device, "scc_set_termios")) |
scc | 2647 | drivers/char/scc.c | scc_change_speed(scc); |
scc | 2653 | drivers/char/scc.c | struct scc_channel *scc = tty->driver_data; |
scc | 2655 | drivers/char/scc.c | if (scc_paranoia_check(scc, tty->device, "scc_set_ldisc")) |
scc | 2658 | drivers/char/scc.c | scc_change_speed(scc); |
scc | 2758 | drivers/char/scc.c | struct scc_channel *scc; |
scc | 2778 | drivers/char/scc.c | scc = &SCC_Info[k]; |
scc | 2779 | drivers/char/scc.c | if (scc) |
scc | 2781 | drivers/char/scc.c | release_region(scc->ctrl, 1); |
scc | 2782 | drivers/char/scc.c | release_region(scc->data, 1); |
scc | 121 | include/linux/scc.h | #define Running(k) (scc->k != TIMER_STOPPED) |
scc | 122 | include/linux/scc.h | #define Expired(k) (scc->k != TIMER_STOPPED) && (!(scc->k) || (--(scc->k) == 0)) |
scc | 123 | include/linux/scc.h | #define Stop_Timer(k) scc->k = TIMER_STOPPED |