sys/dev/atm/hfa/fore_intr.c
void
fore_intr(void *arg)
{
	Fore_unit	*fup = arg;
	Aali	*aap;

	/*
	 * Try to prevent stuff happening after we've paniced
	 */
	if (panicstr)
		return;

	/*
	 * Get to the microcode shared memory interface
	 */
	if ((aap = fup->fu_aali) == NULL)
		return;

	/*
	 * Has this card issued an interrupt??
	 */
	if (*fup->fu_psr) {
		/*
		 * Clear the device interrupt
		 */
		switch (fup->fu_config.ac_device) {

		case DEV_FORE_PCA200E:
			PCA200E_HCR_SET(*fup->fu_ctlreg, PCA200E_CLR_HBUS_INT);
			break;
		default:
			panic("fore_intr: unknown device type");
		}
		aap->aali_intr_sent = CP_WRITE(0);

		/*
		 * Reset the watchdog timer
		 */
		fup->fu_timer = FORE_WATCHDOG;

		/*
		 * Device initialization handled separately
		 */
		if ((fup->fu_flags & CUF_INITED) == 0) {

			/*
			 * We're just initializing device now, so see if
			 * the initialization command has completed
			 */
			if (CP_READ(aap->aali_init.init_status) & 
						QSTAT_COMPLETED)
				fore_initialize_complete(fup);

			/*
			 * If we're still not inited, none of the host
			 * queues are setup yet
			 */
			if ((fup->fu_flags & CUF_INITED) == 0)
				return;
		}

		/*
		 * Drain the queues of completed work
		 */
		fore_cmd_drain(fup);
		fore_recv_drain(fup);
		fore_xmit_drain(fup);

		/*
		 * Supply more buffers to the CP
		 */
		fore_buf_supply(fup);
	}
}
/*
 * Device interrupt routine
 * 
 * Called at interrupt level.
 *
 * Arguments:
 *	arg		pointer to device unit structure
 *
 * Returns:
 *	1 		device interrupt was serviced
 *	0		no interrupts serviced
 *
 */
Device interrupt routine

Called at interrupt level.

arg             pointer to device unit structure

1               device interrupt was serviced
0               no interrupts serviced
Device interrupt routine Called at interrupt level . arg pointer to device unit structure 1 device interrupt was serviced 0 no interrupts serviced
void
fore_intr(void *arg)
{
	Fore_unit	*fup = arg;
	Aali	*aap;
	if (panicstr)
		return;
	if ((aap = fup->fu_aali) == NULL)
		return;
	if (*fup->fu_psr) {
		switch (fup->fu_config.ac_device) {
		case DEV_FORE_PCA200E:
			PCA200E_HCR_SET(*fup->fu_ctlreg, PCA200E_CLR_HBUS_INT);
			break;
		default:
			panic("fore_intr: unknown device type");
		}
		aap->aali_intr_sent = CP_WRITE(0);
		fup->fu_timer = FORE_WATCHDOG;
		if ((fup->fu_flags & CUF_INITED) == 0) {
			if (CP_READ(aap->aali_init.init_status) & 
						QSTAT_COMPLETED)
				fore_initialize_complete(fup);
			if ((fup->fu_flags & CUF_INITED) == 0)
				return;
		}
		fore_cmd_drain(fup);
		fore_recv_drain(fup);
		fore_xmit_drain(fup);
		fore_buf_supply(fup);
	}
}
void fore_intr ( void * arg ) { Fore_unit * fup = arg ; Aali * aap ; if ( panicstr ) return ; if ( ( aap = fup -> fu_aali ) == NULL ) return ; if ( * fup -> fu_psr ) { switch ( fup -> fu_config . ac_device ) { case DEV_FORE_PCA200E : PCA200E_HCR_SET ( * fup -> fu_ctlreg , PCA200E_CLR_HBUS_INT ) ; break ; default : panic ( " " ) ; } aap -> aali_intr_sent = CP_WRITE ( 0 ) ; fup -> fu_timer = FORE_WATCHDOG ; if ( ( fup -> fu_flags & CUF_INITED ) == 0 ) { if ( CP_READ ( aap -> aali_init . init_status ) & QSTAT_COMPLETED ) fore_initialize_complete ( fup ) ; if ( ( fup -> fu_flags & CUF_INITED ) == 0 ) return ; } fore_cmd_drain ( fup ) ; fore_recv_drain ( fup ) ; fore_xmit_drain ( fup ) ; fore_buf_supply ( fup ) ; } }
Device interrupt routine
Device interrupt routine
/*
	 * Try to prevent stuff happening after we've paniced
	 */ /*
	 * Get to the microcode shared memory interface
	 */ /*
	 * Has this card issued an interrupt??
	 */ /*
		 * Clear the device interrupt
		 */ /*
		 * Reset the watchdog timer
		 */ /*
		 * Device initialization handled separately
		 */ /*
			 * We're just initializing device now, so see if
			 * the initialization command has completed
			 */ /*
			 * If we're still not inited, none of the host
			 * queues are setup yet
			 */ /*
		 * Drain the queues of completed work
		 */ /*
		 * Supply more buffers to the CP
		 */