FreeBSD/sys/dev/rp/rp.c
/***************************************************************************
Function: sEnInterrupts
Purpose:  Enable one or more interrupts for a channel
Call:	  sEnInterrupts(ChP,Flags)
	  CHANNEL_T *ChP; Ptr to channel structure
	  Word_t Flags: Interrupt enable flags, can be any combination
	     of the following flags:
		TXINT_EN:   Interrupt on Tx FIFO empty
		RXINT_EN:   Interrupt on Rx FIFO at trigger level (see
			    sSetRxTrigger())
		SRCINT_EN:  Interrupt on SRC (Special Rx Condition)
		MCINT_EN:   Interrupt on modem input change
		CHANINT_EN: Allow channel interrupt signal to the AIOP's
			    Interrupt Channel Register.
Return:   void
Comments: If an interrupt enable flag is set in Flags, that interrupt will be
	  enabled.  If an interrupt enable flag is not set in Flags, that
	  interrupt will not be changed.  Interrupts can be disabled with
	  function sDisInterrupts().

	  This function sets the appropriate bit for the channel in the AIOP's
	  Interrupt Mask Register if the CHANINT_EN flag is set.  This allows
	  this channel's bit to be set in the AIOP's Interrupt Channel Register.

	  Interrupts must also be globally enabled before channel interrupts
	  will be passed on to the host.  This is done with function
	  sEnGlobalInt().

	  In some cases it may be desirable to disable interrupts globally but
	  enable channel interrupts.  This would allow the global interrupt
	  status register to be used to determine which AIOPs need service.
*/


This function sets the appropriate bit for the channel in the AIOP's
Interrupt Mask Register if the CHANINT_EN flag is set.  This allows
this channel's bit to be set in the AIOP's Interrupt Channel Register.

Interrupts must also be globally enabled before channel interrupts
will be passed on to the host.  This is done with function
sEnGlobalInt().

In some cases it may be desirable to disable interrupts globally but
enable channel interrupts.  This would allow the global interrupt
status register to be used to determine which AIOPs need service.
This function sets the appropriate bit for the channel in the AIOP ' s Interrupt Mask Register if the CHANINT_EN flag is set . This allows this channel ' s bit to be set in the AIOP ' s Interrupt Channel Register . Interrupts must also be globally enabled before channel interrupts will be passed on to the host . This is done with function sEnGlobalInt () . In some cases it may be desirable to disable interrupts globally but enable channel interrupts . This would allow the global interrupt status register to be used to determine which AIOPs need service .
void sEnInterrupts(CHANNEL_T *ChP,Word_t Flags)
{
   Byte_t Mask; 		
   ChP->RxControl[2] |=
      ((Byte_t)Flags & (RXINT_EN | SRCINT_EN | MCINT_EN));
   rp_writech4(ChP,_INDX_ADDR,le32dec(ChP->RxControl));
   ChP->TxControl[2] |= ((Byte_t)Flags & TXINT_EN);
   rp_writech4(ChP,_INDX_ADDR,le32dec(ChP->TxControl));
   if(Flags & CHANINT_EN)
   {
      Mask = rp_readch1(ChP,_INT_MASK) | rp_sBitMapSetTbl[ChP->ChanNum];
      rp_writech1(ChP,_INT_MASK,Mask);
   }
}
void sEnInterrupts ( CHANNEL_T * ChP , Word_t Flags ) { Byte_t Mask ; ChP -> RxControl [ 2 ] |= ( ( Byte_t ) Flags & ( RXINT_EN | SRCINT_EN | MCINT_EN ) ) ; rp_writech4 ( ChP , _INDX_ADDR , le32dec ( ChP -> RxControl ) ) ; ChP -> TxControl [ 2 ] |= ( ( Byte_t ) Flags & TXINT_EN ) ; rp_writech4 ( ChP , _INDX_ADDR , le32dec ( ChP -> TxControl ) ) ; if ( Flags & CHANINT_EN ) { Mask = rp_readch1 ( ChP , _INT_MASK ) | rp_sBitMapSetTbl [ ChP -> ChanNum ] ; rp_writech1 ( ChP , _INT_MASK , Mask ) ; } }
Function: sEnInterrupts
Purpose:  Enable one or more interrupts for a channel
Call:     sEnInterrupts(ChP,Flags)
CHANNEL_T *ChP; Ptr to channel structure
Word_t Flags: Interrupt enable flags, can be any combination
of the following flags:
TXINT_EN:   Interrupt on Tx FIFO empty
RXINT_EN:   Interrupt on Rx FIFO at trigger level (see
sSetRxTrigger())
SRCINT_EN:  Interrupt on SRC (Special Rx Condition)
MCINT_EN:   Interrupt on modem input change
CHANINT_EN: Allow channel interrupt signal to the AIOP's
Interrupt Channel Register.
Function : sEnInterrupts Purpose : Enable one or more interrupts for a channel Call : sEnInterrupts ( ChP Flags ) CHANNEL_T * ChP ; Ptr to channel structure Word_t Flags : Interrupt enable flags can be any combination of the following flags : TXINT_EN : Interrupt on Tx FIFO empty RXINT_EN : Interrupt on Rx FIFO at trigger level ( see sSetRxTrigger () ) SRCINT_EN : Interrupt on SRC ( Special Rx Condition ) MCINT_EN : Interrupt on modem input change CHANINT_EN : Allow channel interrupt signal to the AIOP ' s Interrupt Channel Register .
/* Interrupt Mask Register */