Lines Matching refs:ChP

222 static int sInitChan(CONTROLLER_T * CtlP, CHANNEL_T * ChP, int AiopNum,
224 static void sSetInterfaceMode(CHANNEL_T * ChP, Byte_t mode);
225 static void sFlushRxFIFO(CHANNEL_T * ChP);
226 static void sFlushTxFIFO(CHANNEL_T * ChP);
227 static void sEnInterrupts(CHANNEL_T * ChP, Word_t Flags);
228 static void sDisInterrupts(CHANNEL_T * ChP, Word_t Flags);
231 static int sWriteTxPrioByte(CHANNEL_T * ChP, Byte_t Data);
1105 static int sGetChanRI(CHANNEL_T * ChP) in sGetChanRI() argument
1107 CONTROLLER_t *CtlP = ChP->CtlP; in sGetChanRI()
1108 int ChanNum = ChP->ChanNum; in sGetChanRI()
1114 RingInd = sInB((ByteIO_t) (ChP->ChanStat + 8)) & DSR_ACT; in sGetChanRI()
2691 static int sInitChan(CONTROLLER_T * CtlP, CHANNEL_T * ChP, int AiopNum, in sInitChan() argument
2706 ChP->CtlP = CtlP; in sInitChan()
2707 ChP->ChanID = CtlP->AiopID[AiopNum]; in sInitChan()
2708 ChP->AiopNum = AiopNum; in sInitChan()
2709 ChP->ChanNum = ChanNum; in sInitChan()
2713 ChP->Cmd = (ByteIO_t) AiopIO + _CMD_REG; in sInitChan()
2714 ChP->IntChan = (ByteIO_t) AiopIO + _INT_CHAN; in sInitChan()
2715 ChP->IntMask = (ByteIO_t) AiopIO + _INT_MASK; in sInitChan()
2716 ChP->IndexAddr = (DWordIO_t) AiopIO + _INDX_ADDR; in sInitChan()
2717 ChP->IndexData = AiopIO + _INDX_DATA; in sInitChan()
2720 ChIOOff = AiopIO + ChP->ChanNum * 2; in sInitChan()
2721 ChP->TxRxData = ChIOOff + _TD0; in sInitChan()
2722 ChP->ChanStat = ChIOOff + _CHN_STAT0; in sInitChan()
2723 ChP->TxRxCount = ChIOOff + _FIFO_CNT0; in sInitChan()
2724 ChP->IntID = (ByteIO_t) AiopIO + ChP->ChanNum + _INT_ID0; in sInitChan()
2732 out32(ChP->IndexAddr, R); in sInitChan()
2735 ChR = ChP->R; in sInitChan()
2751 ChP->BaudDiv[0] = (Byte_t) (ChOff + _BAUD); in sInitChan()
2752 ChP->BaudDiv[1] = (Byte_t) ((ChOff + _BAUD) >> 8); in sInitChan()
2753 ChP->BaudDiv[2] = (Byte_t) brd9600; in sInitChan()
2754 ChP->BaudDiv[3] = (Byte_t) (brd9600 >> 8); in sInitChan()
2755 out32(ChP->IndexAddr, ChP->BaudDiv); in sInitChan()
2757 ChP->TxControl[0] = (Byte_t) (ChOff + _TX_CTRL); in sInitChan()
2758 ChP->TxControl[1] = (Byte_t) ((ChOff + _TX_CTRL) >> 8); in sInitChan()
2759 ChP->TxControl[2] = 0; in sInitChan()
2760 ChP->TxControl[3] = 0; in sInitChan()
2761 out32(ChP->IndexAddr, ChP->TxControl); in sInitChan()
2763 ChP->RxControl[0] = (Byte_t) (ChOff + _RX_CTRL); in sInitChan()
2764 ChP->RxControl[1] = (Byte_t) ((ChOff + _RX_CTRL) >> 8); in sInitChan()
2765 ChP->RxControl[2] = 0; in sInitChan()
2766 ChP->RxControl[3] = 0; in sInitChan()
2767 out32(ChP->IndexAddr, ChP->RxControl); in sInitChan()
2769 ChP->TxEnables[0] = (Byte_t) (ChOff + _TX_ENBLS); in sInitChan()
2770 ChP->TxEnables[1] = (Byte_t) ((ChOff + _TX_ENBLS) >> 8); in sInitChan()
2771 ChP->TxEnables[2] = 0; in sInitChan()
2772 ChP->TxEnables[3] = 0; in sInitChan()
2773 out32(ChP->IndexAddr, ChP->TxEnables); in sInitChan()
2775 ChP->TxCompare[0] = (Byte_t) (ChOff + _TXCMP1); in sInitChan()
2776 ChP->TxCompare[1] = (Byte_t) ((ChOff + _TXCMP1) >> 8); in sInitChan()
2777 ChP->TxCompare[2] = 0; in sInitChan()
2778 ChP->TxCompare[3] = 0; in sInitChan()
2779 out32(ChP->IndexAddr, ChP->TxCompare); in sInitChan()
2781 ChP->TxReplace1[0] = (Byte_t) (ChOff + _TXREP1B1); in sInitChan()
2782 ChP->TxReplace1[1] = (Byte_t) ((ChOff + _TXREP1B1) >> 8); in sInitChan()
2783 ChP->TxReplace1[2] = 0; in sInitChan()
2784 ChP->TxReplace1[3] = 0; in sInitChan()
2785 out32(ChP->IndexAddr, ChP->TxReplace1); in sInitChan()
2787 ChP->TxReplace2[0] = (Byte_t) (ChOff + _TXREP2); in sInitChan()
2788 ChP->TxReplace2[1] = (Byte_t) ((ChOff + _TXREP2) >> 8); in sInitChan()
2789 ChP->TxReplace2[2] = 0; in sInitChan()
2790 ChP->TxReplace2[3] = 0; in sInitChan()
2791 out32(ChP->IndexAddr, ChP->TxReplace2); in sInitChan()
2793 ChP->TxFIFOPtrs = ChOff + _TXF_OUTP; in sInitChan()
2794 ChP->TxFIFO = ChOff + _TX_FIFO; in sInitChan()
2796 sOutB(ChP->Cmd, (Byte_t) ChanNum | RESTXFCNT); /* apply reset Tx FIFO count */ in sInitChan()
2797 sOutB(ChP->Cmd, (Byte_t) ChanNum); /* remove reset Tx FIFO count */ in sInitChan()
2798 sOutW((WordIO_t) ChP->IndexAddr, ChP->TxFIFOPtrs); /* clear Tx in/out ptrs */ in sInitChan()
2799 sOutW(ChP->IndexData, 0); in sInitChan()
2800 ChP->RxFIFOPtrs = ChOff + _RXF_OUTP; in sInitChan()
2801 ChP->RxFIFO = ChOff + _RX_FIFO; in sInitChan()
2803 sOutB(ChP->Cmd, (Byte_t) ChanNum | RESRXFCNT); /* apply reset Rx FIFO count */ in sInitChan()
2804 sOutB(ChP->Cmd, (Byte_t) ChanNum); /* remove reset Rx FIFO count */ in sInitChan()
2805 sOutW((WordIO_t) ChP->IndexAddr, ChP->RxFIFOPtrs); /* clear Rx out ptr */ in sInitChan()
2806 sOutW(ChP->IndexData, 0); in sInitChan()
2807 sOutW((WordIO_t) ChP->IndexAddr, ChP->RxFIFOPtrs + 2); /* clear Rx in ptr */ in sInitChan()
2808 sOutW(ChP->IndexData, 0); in sInitChan()
2809 ChP->TxPrioCnt = ChOff + _TXP_CNT; in sInitChan()
2810 sOutW((WordIO_t) ChP->IndexAddr, ChP->TxPrioCnt); in sInitChan()
2811 sOutB(ChP->IndexData, 0); in sInitChan()
2812 ChP->TxPrioPtr = ChOff + _TXP_PNTR; in sInitChan()
2813 sOutW((WordIO_t) ChP->IndexAddr, ChP->TxPrioPtr); in sInitChan()
2814 sOutB(ChP->IndexData, 0); in sInitChan()
2815 ChP->TxPrioBuf = ChOff + _TXP_BUF; in sInitChan()
2816 sEnRxProcessor(ChP); /* start the Rx processor */ in sInitChan()
2839 static void sStopRxProcessor(CHANNEL_T * ChP) in sStopRxProcessor() argument
2843 R[0] = ChP->R[0]; in sStopRxProcessor()
2844 R[1] = ChP->R[1]; in sStopRxProcessor()
2846 R[3] = ChP->R[3]; in sStopRxProcessor()
2847 out32(ChP->IndexAddr, R); in sStopRxProcessor()
2864 static void sFlushRxFIFO(CHANNEL_T * ChP) in sFlushRxFIFO() argument
2870 if (sGetRxCnt(ChP) == 0) /* Rx FIFO empty */ in sFlushRxFIFO()
2874 if (ChP->R[0x32] == 0x08) { /* Rx FIFO is enabled */ in sFlushRxFIFO()
2876 sDisRxFIFO(ChP); /* disable it */ in sFlushRxFIFO()
2878 sInB(ChP->IntChan); /* depends on bus i/o timing */ in sFlushRxFIFO()
2880 sGetChanStatus(ChP); /* clear any pending Rx errors in chan stat */ in sFlushRxFIFO()
2881 Ch = (Byte_t) sGetChanNum(ChP); in sFlushRxFIFO()
2882 sOutB(ChP->Cmd, Ch | RESRXFCNT); /* apply reset Rx FIFO count */ in sFlushRxFIFO()
2883 sOutB(ChP->Cmd, Ch); /* remove reset Rx FIFO count */ in sFlushRxFIFO()
2884 sOutW((WordIO_t) ChP->IndexAddr, ChP->RxFIFOPtrs); /* clear Rx out ptr */ in sFlushRxFIFO()
2885 sOutW(ChP->IndexData, 0); in sFlushRxFIFO()
2886 sOutW((WordIO_t) ChP->IndexAddr, ChP->RxFIFOPtrs + 2); /* clear Rx in ptr */ in sFlushRxFIFO()
2887 sOutW(ChP->IndexData, 0); in sFlushRxFIFO()
2889 sEnRxFIFO(ChP); /* enable Rx FIFO */ in sFlushRxFIFO()
2906 static void sFlushTxFIFO(CHANNEL_T * ChP) in sFlushTxFIFO() argument
2912 if (sGetTxCnt(ChP) == 0) /* Tx FIFO empty */ in sFlushTxFIFO()
2916 if (ChP->TxControl[3] & TX_ENABLE) { in sFlushTxFIFO()
2918 sDisTransmit(ChP); /* disable transmitter */ in sFlushTxFIFO()
2920 sStopRxProcessor(ChP); /* stop Rx processor */ in sFlushTxFIFO()
2922 sInB(ChP->IntChan); /* depends on bus i/o timing */ in sFlushTxFIFO()
2923 Ch = (Byte_t) sGetChanNum(ChP); in sFlushTxFIFO()
2924 sOutB(ChP->Cmd, Ch | RESTXFCNT); /* apply reset Tx FIFO count */ in sFlushTxFIFO()
2925 sOutB(ChP->Cmd, Ch); /* remove reset Tx FIFO count */ in sFlushTxFIFO()
2926 sOutW((WordIO_t) ChP->IndexAddr, ChP->TxFIFOPtrs); /* clear Tx in/out ptrs */ in sFlushTxFIFO()
2927 sOutW(ChP->IndexData, 0); in sFlushTxFIFO()
2929 sEnTransmit(ChP); /* enable transmitter */ in sFlushTxFIFO()
2930 sStartRxProcessor(ChP); /* restart Rx processor */ in sFlushTxFIFO()
2946 static int sWriteTxPrioByte(CHANNEL_T * ChP, Byte_t Data) in sWriteTxPrioByte() argument
2952 if (sGetTxCnt(ChP) > 1) { /* write it to Tx priority buffer */ in sWriteTxPrioByte()
2953 IndexAddr = ChP->IndexAddr; in sWriteTxPrioByte()
2954 sOutW((WordIO_t) IndexAddr, ChP->TxPrioCnt); /* get priority buffer status */ in sWriteTxPrioByte()
2955 if (sInB((ByteIO_t) ChP->IndexData) & PRI_PEND) /* priority buffer busy */ in sWriteTxPrioByte()
2959 *WordPtr = ChP->TxPrioBuf; /* data byte address */ in sWriteTxPrioByte()
2964 *WordPtr = ChP->TxPrioCnt; /* Tx priority count address */ in sWriteTxPrioByte()
2971 sWriteTxByte(sGetTxRxDataIO(ChP), Data); in sWriteTxPrioByte()
3008 static void sEnInterrupts(CHANNEL_T * ChP, Word_t Flags) in sEnInterrupts() argument
3012 ChP->RxControl[2] |= in sEnInterrupts()
3015 out32(ChP->IndexAddr, ChP->RxControl); in sEnInterrupts()
3017 ChP->TxControl[2] |= ((Byte_t) Flags & TXINT_EN); in sEnInterrupts()
3019 out32(ChP->IndexAddr, ChP->TxControl); in sEnInterrupts()
3022 Mask = sInB(ChP->IntMask) | sBitMapSetTbl[ChP->ChanNum]; in sEnInterrupts()
3023 sOutB(ChP->IntMask, Mask); in sEnInterrupts()
3052 static void sDisInterrupts(CHANNEL_T * ChP, Word_t Flags) in sDisInterrupts() argument
3056 ChP->RxControl[2] &= in sDisInterrupts()
3058 out32(ChP->IndexAddr, ChP->RxControl); in sDisInterrupts()
3059 ChP->TxControl[2] &= ~((Byte_t) Flags & TXINT_EN); in sDisInterrupts()
3060 out32(ChP->IndexAddr, ChP->TxControl); in sDisInterrupts()
3063 Mask = sInB(ChP->IntMask) & sBitMapClrTbl[ChP->ChanNum]; in sDisInterrupts()
3064 sOutB(ChP->IntMask, Mask); in sDisInterrupts()
3068 static void sSetInterfaceMode(CHANNEL_T * ChP, Byte_t mode) in sSetInterfaceMode() argument
3070 sOutB(ChP->CtlP->AiopIO[2], (mode & 0x18) | ChP->ChanNum); in sSetInterfaceMode()