/** * Poll for completed and received packets * * @v netdev Network device */ static void intelxvf_poll ( struct net_device *netdev ) { struct intel_nic *intel = netdev->priv; uint32_t eicr; int rc; /* Check for and acknowledge interrupts */ eicr = readl ( intel->regs + INTELXVF_EICR ); if ( ! eicr ) return; /* Poll for TX completions, if applicable */ if ( eicr & INTELXVF_EIRQ_TX0 ) intel_poll_tx ( netdev ); /* Poll for RX completions, if applicable */ if ( eicr & INTELXVF_EIRQ_RX0 ) intel_poll_rx ( netdev ); /* Poll for mailbox messages, if applicable */ if ( eicr & INTELXVF_EIRQ_MBOX ) { /* Poll mailbox */ if ( ( rc = intelvf_mbox_poll ( intel ) ) != 0 ) { DBGC ( intel, "INTEL %p mailbox poll failed!\n", intel ); netdev_rx_err ( netdev, NULL, rc ); } /* Update link state */ intelxvf_check_link ( netdev ); } /* Refill RX ring */ intel_refill_rx ( intel ); }
/** * Poll for completed and received packets * * @v netdev Network device */ static void intelx_poll ( struct net_device *netdev ) { struct intel_nic *intel = netdev->priv; uint32_t eicr; /* Check for and acknowledge interrupts */ eicr = readl ( intel->regs + INTELX_EICR ); if ( ! eicr ) return; /* Poll for TX completions, if applicable */ if ( eicr & INTELX_EIRQ_TX0 ) intel_poll_tx ( netdev ); /* Poll for RX completions, if applicable */ if ( eicr & ( INTELX_EIRQ_RX0 | INTELX_EIRQ_RXO ) ) intel_poll_rx ( netdev ); /* Report receive overruns */ if ( eicr & INTELX_EIRQ_RXO ) netdev_rx_err ( netdev, NULL, -ENOBUFS ); /* Check link state, if applicable */ if ( eicr & INTELX_EIRQ_LSC ) intelx_check_link ( netdev ); /* Refill RX ring */ intel_refill_rx ( intel ); }