* It reads ICR and gets interrupt causes, check it and set a bit flag * to update link status. * * @param dev * Pointer to struct rte_eth_dev. * * @return * - On success, zero. * - On failure, a negative value. */
| 2844 | * - On failure, a negative value. |
| 2845 | */ |
| 2846 | static int |
| 2847 | eth_igb_interrupt_get_status(struct rte_eth_dev *dev) |
| 2848 | { |
| 2849 | uint32_t icr; |
| 2850 | struct e1000_hw *hw = |
| 2851 | E1000_DEV_PRIVATE_TO_HW(dev->data->dev_private); |
| 2852 | struct e1000_interrupt *intr = |
| 2853 | E1000_DEV_PRIVATE_TO_INTR(dev->data->dev_private); |
| 2854 | |
| 2855 | igb_intr_disable(dev); |
| 2856 | |
| 2857 | /* read-on-clear nic registers here */ |
| 2858 | icr = E1000_READ_REG(hw, E1000_ICR); |
| 2859 | |
| 2860 | intr->flags = 0; |
| 2861 | if (icr & E1000_ICR_LSC) { |
| 2862 | intr->flags |= E1000_FLAG_NEED_LINK_UPDATE; |
| 2863 | } |
| 2864 | |
| 2865 | if (icr & E1000_ICR_VMMB) |
| 2866 | intr->flags |= E1000_FLAG_MAILBOX; |
| 2867 | |
| 2868 | return 0; |
| 2869 | } |
| 2870 | |
| 2871 | /* |
| 2872 | * It executes link_update after knowing an interrupt is present. |
no test coverage detected