FreeBSD/sys/dev/cxgb/common/cxgb_t3_hw.c
/*
 * Interrupt handler for PHY events.
 */
Interrupt handler for PHY events.
Interrupt handler for PHY events .
static int phy_intr_handler(adapter_t *adapter)
{
	u32 i, cause = t3_read_reg(adapter, A_T3DBG_INT_CAUSE);
	for_each_port(adapter, i) {
		struct port_info *p = adap2pinfo(adapter, i);
		if (!(p->phy.caps & SUPPORTED_IRQ))
			continue;
		if (cause & (1 << adapter_info(adapter)->gpio_intr[i])) {
			int phy_cause = p->phy.ops->intr_handler(&p->phy);
			if (phy_cause & cphy_cause_link_change)
				t3_os_link_intr(p);
			if (phy_cause & cphy_cause_fifo_error)
				p->phy.fifo_errors++;
			if (phy_cause & cphy_cause_module_change)
				t3_os_phymod_changed(adapter, i);
			if (phy_cause & cphy_cause_alarm)
				CH_WARN(adapter, "Operation affected due to "
				    "adverse environment.  Check the spec "
				    "sheet for corrective action.");
		}
	}
	t3_write_reg(adapter, A_T3DBG_INT_CAUSE, cause);
	return 0;
}
static int phy_intr_handler ( adapter_t * adapter ) { u32 i , cause = t3_read_reg ( adapter , A_T3DBG_INT_CAUSE ) ; for_each_port ( adapter , i ) { struct port_info * p = adap2pinfo ( adapter , i ) ; if ( ! ( p -> phy . caps & SUPPORTED_IRQ ) ) continue ; if ( cause & ( 1 << adapter_info ( adapter ) -> gpio_intr [ i ] ) ) { int phy_cause = p -> phy . ops -> intr_handler ( & p -> phy ) ; if ( phy_cause & cphy_cause_link_change ) t3_os_link_intr ( p ) ; if ( phy_cause & cphy_cause_fifo_error ) p -> phy . fifo_errors ++ ; if ( phy_cause & cphy_cause_module_change ) t3_os_phymod_changed ( adapter , i ) ; if ( phy_cause & cphy_cause_alarm ) CH_WARN ( adapter , " " " " " " ) ; } } t3_write_reg ( adapter , A_T3DBG_INT_CAUSE , cause ) ; return 0 ; }
Interrupt handler for PHY events.
Interrupt handler for PHY events .