rocket_int.h

来自「Linux Kernel 2.6.9 for OMAP1710」· C头文件 代码 · 共 1,297 行 · 第 1/3 页

H
1,297
字号
   sOutB((ChP)->Cmd,(Byte_t)(ChP)->ChanNum); \} while (0)/***************************************************************************Function: sCtlNumToCtlPtrPurpose:  Convert a controller number to controller structure pointerCall:     sCtlNumToCtlPtr(CtlNum)          int CtlNum; Controller numberReturn:   CONTROLLER_T *: Ptr to controller structure*/#define sCtlNumToCtlPtr(CTLNUM) &sController[CTLNUM]/***************************************************************************Function: sControllerEOIPurpose:  Strobe the MUDBAC's End Of Interrupt bit.Call:     sControllerEOI(CtlP)          CONTROLLER_T *CtlP; Ptr to controller structure*/#define sControllerEOI(CTLP) sOutB((CTLP)->MReg2IO,(CTLP)->MReg2 | INT_STROB)/***************************************************************************Function: sPCIControllerEOIPurpose:  Strobe the PCI End Of Interrupt bit.          For the UPCI boards, toggle the AIOP interrupt enable bit	  (this was taken from the Windows driver).Call:     sPCIControllerEOI(CtlP)          CONTROLLER_T *CtlP; Ptr to controller structure*/#define sPCIControllerEOI(CTLP) \do { \    if ((CTLP)->isUPCI) { \	Word_t w = sInW((CTLP)->PCIIO); \	sOutW((CTLP)->PCIIO, (w ^ PCI_INT_CTRL_AIOP)); \	sOutW((CTLP)->PCIIO, w); \    } \    else { \	sOutW((CTLP)->PCIIO, PCI_STROB); \    } \} while (0)/***************************************************************************Function: sDisAiopPurpose:  Disable I/O access to an AIOPCall:     sDisAiop(CltP)          CONTROLLER_T *CtlP; Ptr to controller structure          int AiopNum; Number of AIOP on controller*/#define sDisAiop(CTLP,AIOPNUM) \do { \   (CTLP)->MReg3 &= sBitMapClrTbl[AIOPNUM]; \   sOutB((CTLP)->MReg3IO,(CTLP)->MReg3); \} while (0)/***************************************************************************Function: sDisCTSFlowCtlPurpose:  Disable output flow control using CTSCall:     sDisCTSFlowCtl(ChP)          CHANNEL_T *ChP; Ptr to channel structure*/#define sDisCTSFlowCtl(ChP) \do { \   (ChP)->TxControl[2] &= ~CTSFC_EN; \   sOutDW((ChP)->IndexAddr,*(DWord_t *)&(ChP)->TxControl[0]); \} while (0)/***************************************************************************Function: sDisIXANYPurpose:  Disable IXANY Software Flow ControlCall:     sDisIXANY(ChP)          CHANNEL_T *ChP; Ptr to channel structure*/#define sDisIXANY(ChP) \do { \   (ChP)->R[0x0e] = 0x86; \   sOutDW((ChP)->IndexAddr,*(DWord_t *)&(ChP)->R[0x0c]); \} while (0)/***************************************************************************Function: DisParityPurpose:  Disable parityCall:     sDisParity(ChP)          CHANNEL_T *ChP; Ptr to channel structureComments: Function sSetParity() can be used in place of functions sEnParity(),          sDisParity(), sSetOddParity(), and sSetEvenParity().*/#define sDisParity(ChP) \do { \   (ChP)->TxControl[2] &= ~PARITY_EN; \   sOutDW((ChP)->IndexAddr,*(DWord_t *)&(ChP)->TxControl[0]); \} while (0)/***************************************************************************Function: sDisRTSTogglePurpose:  Disable RTS toggleCall:     sDisRTSToggle(ChP)          CHANNEL_T *ChP; Ptr to channel structure*/#define sDisRTSToggle(ChP) \do { \   (ChP)->TxControl[2] &= ~RTSTOG_EN; \   sOutDW((ChP)->IndexAddr,*(DWord_t *)&(ChP)->TxControl[0]); \   (ChP)->rtsToggle = 0; \} while (0)/***************************************************************************Function: sDisRxFIFOPurpose:  Disable Rx FIFOCall:     sDisRxFIFO(ChP)          CHANNEL_T *ChP; Ptr to channel structure*/#define sDisRxFIFO(ChP) \do { \   (ChP)->R[0x32] = 0x0a; \   sOutDW((ChP)->IndexAddr,*(DWord_t *)&(ChP)->R[0x30]); \} while (0)/***************************************************************************Function: sDisRxStatusModePurpose:  Disable the Rx status modeCall:     sDisRxStatusMode(ChP)          CHANNEL_T *ChP; Ptr to channel structureComments: This takes the channel out of the receive status mode.  All          subsequent reads of receive data using sReadRxWord() will return          two data bytes.*/#define sDisRxStatusMode(ChP) sOutW((ChP)->ChanStat,0)/***************************************************************************Function: sDisTransmitPurpose:  Disable transmitCall:     sDisTransmit(ChP)          CHANNEL_T *ChP; Ptr to channel structure          This disables movement of Tx data from the Tx FIFO into the 1 byte          Tx buffer.  Therefore there could be up to a 2 byte latency          between the time sDisTransmit() is called and the transmit buffer          and transmit shift register going completely empty.*/#define sDisTransmit(ChP) \do { \   (ChP)->TxControl[3] &= ~TX_ENABLE; \   sOutDW((ChP)->IndexAddr,*(DWord_t *)&(ChP)->TxControl[0]); \} while (0)/***************************************************************************Function: sDisTxSoftFlowCtlPurpose:  Disable Tx Software Flow ControlCall:     sDisTxSoftFlowCtl(ChP)          CHANNEL_T *ChP; Ptr to channel structure*/#define sDisTxSoftFlowCtl(ChP) \do { \   (ChP)->R[0x06] = 0x8a; \   sOutDW((ChP)->IndexAddr,*(DWord_t *)&(ChP)->R[0x04]); \} while (0)/***************************************************************************Function: sEnAiopPurpose:  Enable I/O access to an AIOPCall:     sEnAiop(CltP)          CONTROLLER_T *CtlP; Ptr to controller structure          int AiopNum; Number of AIOP on controller*/#define sEnAiop(CTLP,AIOPNUM) \do { \   (CTLP)->MReg3 |= sBitMapSetTbl[AIOPNUM]; \   sOutB((CTLP)->MReg3IO,(CTLP)->MReg3); \} while (0)/***************************************************************************Function: sEnCTSFlowCtlPurpose:  Enable output flow control using CTSCall:     sEnCTSFlowCtl(ChP)          CHANNEL_T *ChP; Ptr to channel structure*/#define sEnCTSFlowCtl(ChP) \do { \   (ChP)->TxControl[2] |= CTSFC_EN; \   sOutDW((ChP)->IndexAddr,*(DWord_t *)&(ChP)->TxControl[0]); \} while (0)/***************************************************************************Function: sEnIXANYPurpose:  Enable IXANY Software Flow ControlCall:     sEnIXANY(ChP)          CHANNEL_T *ChP; Ptr to channel structure*/#define sEnIXANY(ChP) \do { \   (ChP)->R[0x0e] = 0x21; \   sOutDW((ChP)->IndexAddr,*(DWord_t *)&(ChP)->R[0x0c]); \} while (0)/***************************************************************************Function: EnParityPurpose:  Enable parityCall:     sEnParity(ChP)          CHANNEL_T *ChP; Ptr to channel structureComments: Function sSetParity() can be used in place of functions sEnParity(),          sDisParity(), sSetOddParity(), and sSetEvenParity().Warnings: Before enabling parity odd or even parity should be chosen using          functions sSetOddParity() or sSetEvenParity().*/#define sEnParity(ChP) \do { \   (ChP)->TxControl[2] |= PARITY_EN; \   sOutDW((ChP)->IndexAddr,*(DWord_t *)&(ChP)->TxControl[0]); \} while (0)/***************************************************************************Function: sEnRTSTogglePurpose:  Enable RTS toggleCall:     sEnRTSToggle(ChP)          CHANNEL_T *ChP; Ptr to channel structureComments: This function will disable RTS flow control and clear the RTS          line to allow operation of RTS toggle.*/#define sEnRTSToggle(ChP) \do { \   (ChP)->RxControl[2] &= ~RTSFC_EN; \   sOutDW((ChP)->IndexAddr,*(DWord_t *)&(ChP)->RxControl[0]); \   (ChP)->TxControl[2] |= RTSTOG_EN; \   (ChP)->TxControl[3] &= ~SET_RTS; \   sOutDW((ChP)->IndexAddr,*(DWord_t *)&(ChP)->TxControl[0]); \   (ChP)->rtsToggle = 1; \} while (0)/***************************************************************************Function: sEnRxFIFOPurpose:  Enable Rx FIFOCall:     sEnRxFIFO(ChP)          CHANNEL_T *ChP; Ptr to channel structure*/#define sEnRxFIFO(ChP) \do { \   (ChP)->R[0x32] = 0x08; \   sOutDW((ChP)->IndexAddr,*(DWord_t *)&(ChP)->R[0x30]); \} while (0)/***************************************************************************Function: sEnRxProcessorPurpose:  Enable the receive processorCall:     sEnRxProcessor(ChP)          CHANNEL_T *ChP; Ptr to channel structureComments: This function is used to start the receive processor.  When          the channel is in the reset state the receive processor is not          running.  This is done to prevent the receive processor from          executing invalid microcode instructions prior to the          downloading of the microcode.Warnings: This function must be called after valid microcode has been          downloaded to the AIOP, and it must not be called before the          microcode has been downloaded.*/#define sEnRxProcessor(ChP) \do { \   (ChP)->RxControl[2] |= RXPROC_EN; \   sOutDW((ChP)->IndexAddr,*(DWord_t *)&(ChP)->RxControl[0]); \} while (0)/***************************************************************************Function: sEnRxStatusModePurpose:  Enable the Rx status modeCall:     sEnRxStatusMode(ChP)          CHANNEL_T *ChP; Ptr to channel structureComments: This places the channel in the receive status mode.  All subsequent          reads of receive data using sReadRxWord() will return a data byte          in the low word and a status byte in the high word.*/#define sEnRxStatusMode(ChP) sOutW((ChP)->ChanStat,STATMODE)/***************************************************************************Function: sEnTransmitPurpose:  Enable transmitCall:     sEnTransmit(ChP)          CHANNEL_T *ChP; Ptr to channel structure*/#define sEnTransmit(ChP) \do { \   (ChP)->TxControl[3] |= TX_ENABLE; \   sOutDW((ChP)->IndexAddr,*(DWord_t *)&(ChP)->TxControl[0]); \} while (0)/***************************************************************************Function: sEnTxSoftFlowCtlPurpose:  Enable Tx Software Flow ControlCall:     sEnTxSoftFlowCtl(ChP)          CHANNEL_T *ChP; Ptr to channel structure*/#define sEnTxSoftFlowCtl(ChP) \do { \   (ChP)->R[0x06] = 0xc5; \   sOutDW((ChP)->IndexAddr,*(DWord_t *)&(ChP)->R[0x04]); \} while (0)/***************************************************************************Function: sGetAiopIntStatusPurpose:  Get the AIOP interrupt statusCall:     sGetAiopIntStatus(CtlP,AiopNum)          CONTROLLER_T *CtlP; Ptr to controller structure          int AiopNum; AIOP numberReturn:   Byte_t: The AIOP interrupt status.  Bits 0 through 7                         represent channels 0 through 7 respectively.  If a                         bit is set that channel is interrupting.*/#define sGetAiopIntStatus(CTLP,AIOPNUM) sInB((CTLP)->AiopIntChanIO[AIOPNUM])/***************************************************************************Function: sGetAiopNumChanPurpose:  Get the number of channels supported by an AIOPCall:     sGetAiopNumChan(CtlP,AiopNum)          CONTROLLER_T *CtlP; Ptr to controller structure          int AiopNum; AIOP numberReturn:   int: The number of channels supported by the AIOP*/#define sGetAiopNumChan(CTLP,AIOPNUM) (CTLP)->AiopNumChan[AIOPNUM]/***************************************************************************Function: sGetChanIntIDPurpose:  Get a channel's interrupt identification byteCall:     sGetChanIntID(ChP)          CHANNEL_T *ChP; Ptr to channel structureReturn:   Byte_t: The channel interrupt ID.  Can be any             combination of the following flags:                RXF_TRIG:     Rx FIFO trigger level interrupt                TXFIFO_MT:    Tx FIFO empty interrupt                SRC_INT:      Special receive condition interrupt                DELTA_CD:     CD change interrupt                DELTA_CTS:    CTS change interrupt                DELTA_DSR:    DSR change interrupt*/#define sGetChanIntID(ChP) (sInB((ChP)->IntID) & (RXF_TRIG | TXFIFO_MT | SRC_INT | DELTA_CD | DELTA_CTS | DELTA_DSR))/***************************************************************************Function: sGetChanNumPurpose:  Get the number of a channel within an AIOPCall:     sGetChanNum(ChP)          CHANNEL_T *ChP; Ptr to channel structureReturn:   int: Channel number within AIOP, or NULLCHAN if channel does               not exist.*/#define sGetChanNum(ChP) (ChP)->ChanNum/***************************************************************************Function: sGetChanStatusPurpose:  Get the channel statusCall:     sGetChanStatus(ChP)          CHANNEL_T *ChP; Ptr to channel structureReturn:   Word_t: The channel status.  Can be any combination of             the following flags:                LOW BYTE FLAGS                CTS_ACT:      CTS input asserted                DSR_ACT:      DSR input asserted                CD_ACT:       CD input asserted                TXFIFOMT:     Tx FIFO is empty                TXSHRMT:      Tx shift register is empty                RDA:          Rx data available                HIGH BYTE FLAGS                STATMODE:     status mode enable bit                RXFOVERFL:    receive FIFO overflow                RX2MATCH:     receive compare byte 2 match                RX1MATCH:     receive compare byte 1 match                RXBREAK:      received BREAK                RXFRAME:      received framing error                RXPARITY:     received parity errorWarnings: This function will clear the high byte flags in the Channel          Status Register.*/#define sGetChanStatus(ChP) sInW((ChP)->ChanStat)/***************************************************************************Function: sGetChanStatusLoPurpose:  Get the low byte only of the channel statusCall:     sGetChanStatusLo(ChP)          CHANNEL_T *ChP; Ptr to channel structureReturn:   Byte_t: The channel status low byte.  Can be any combination             of the following flags:                CTS_ACT:      CTS input asserted                DSR_ACT:      DSR input asserted                CD_ACT:       CD input asserted                TXFIFOMT:     Tx FIFO is empty                TXSHRMT:      Tx shift register is empty                RDA:          Rx data available*/#define sGetChanStatusLo(ChP) sInB((ByteIO_t)(ChP)->ChanStat)/********************************************************************** * Get RI status of channel * Defined as a function in rocket.c   -aes */#if 0#define sGetChanRI(ChP) ((ChP)->CtlP->AltChanRingIndicator ? \                          (sInB((ByteIO_t)((ChP)->ChanStat+8)) & DSR_ACT) : \                            (((ChP)->CtlP->boardType == ROCKET_TYPE_PC104) ? \                               (!(sInB((ChP)->CtlP->AiopIO[3]) & sBitMapSetTbl[(ChP)->ChanNum])) : \                             0))#endif/***************************************************************************Function: sGetControllerIntStatusPurpose:  Get the controller interrupt statusCall:     sGetControllerIntStatus(CtlP)          CONTROLLER_T *CtlP; Ptr to controller structureReturn:   Byte_t: The controller interrupt status in the lower 4                         bits.  Bits 0 through 3 represent AIOP's 0                         through 3 respectively.  If a bit is set that                         AIOP is interrupting.  Bits 4 through 7 will                         always be cleared.*/#define sGetControllerIntStatus(CTLP) (sInB((CTLP)->MReg1IO) & 0x0f)/***************************************************************************Function: sPCIGetControllerIntStatusPurpose:  Get the controller interrupt statusCall:     sPCIGetControllerIntStatus(CtlP)          CONTROLLER_T *CtlP; Ptr to controller structureReturn:   unsigned char: The controller interrupt status in the lower 4                         bits and bit 4.  Bits 0 through 3 represent AIOP's 0                         through 3 respectively. Bit 4 is set if the int 			 was generated from periodic. If a bit is set the			 AIOP is interrupting.*/#define sPCIGetControllerIntStatus(CTLP) \	((CTLP)->isUPCI ? \	  (sInW((CTLP)->PCIIO2) & UPCI_AIOP_INTR_BITS) : \	  ((sInW((CTLP)->PCIIO) >> 8) & AIOP_INTR_BITS))/***************************************************************************Function: sGetRxCntPurpose:  Get the number of data bytes in the Rx FIFO

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?