| 485 | } |
| 486 | |
| 487 | static int |
| 488 | ice_dcf_check_reset_done(struct ice_dcf_hw *hw) |
| 489 | { |
| 490 | #define ICE_DCF_RESET_WAIT_CNT 50 |
| 491 | struct iavf_hw *avf = &hw->avf; |
| 492 | int i, reset; |
| 493 | |
| 494 | for (i = 0; i < ICE_DCF_RESET_WAIT_CNT; i++) { |
| 495 | reset = IAVF_READ_REG(avf, IAVF_VFGEN_RSTAT) & |
| 496 | IAVF_VFGEN_RSTAT_VFR_STATE_MASK; |
| 497 | reset = reset >> IAVF_VFGEN_RSTAT_VFR_STATE_SHIFT; |
| 498 | |
| 499 | if (reset == VIRTCHNL_VFR_VFACTIVE || |
| 500 | reset == VIRTCHNL_VFR_COMPLETED) |
| 501 | break; |
| 502 | |
| 503 | rte_delay_ms(20); |
| 504 | } |
| 505 | |
| 506 | if (i >= ICE_DCF_RESET_WAIT_CNT) |
| 507 | return -1; |
| 508 | |
| 509 | return 0; |
| 510 | } |
| 511 | |
| 512 | static inline void |
| 513 | ice_dcf_enable_irq0(struct ice_dcf_hw *hw) |
no test coverage detected