src/dpdk/drivers/net/e1000/base/e1000_manage.c
s32 e1000_mng_enable_host_if_generic(struct e1000_hw *hw)
{
	u32 hicr;
	u8 i;

	DEBUGFUNC("e1000_mng_enable_host_if_generic");

	if (!hw->mac.arc_subsystem_valid) {
		DEBUGOUT("ARC subsystem not valid.\n");
		return -E1000_ERR_HOST_INTERFACE_COMMAND;
	}

	/* Check that the host interface is enabled. */
	hicr = E1000_READ_REG(hw, E1000_HICR);
	if (!(hicr & E1000_HICR_EN)) {
		DEBUGOUT("E1000_HOST_EN bit disabled.\n");
		return -E1000_ERR_HOST_INTERFACE_COMMAND;
	}
	/* check the previous command is completed */
	for (i = 0; i < E1000_MNG_DHCP_COMMAND_TIMEOUT; i++) {
		hicr = E1000_READ_REG(hw, E1000_HICR);
		if (!(hicr & E1000_HICR_C))
			break;
		msec_delay_irq(1);
	}

	if (i == E1000_MNG_DHCP_COMMAND_TIMEOUT) {
		DEBUGOUT("Previous command timeout failed .\n");
		return -E1000_ERR_HOST_INTERFACE_COMMAND;
	}

	return E1000_SUCCESS;
}
/**
 *  e1000_mng_enable_host_if_generic - Checks host interface is enabled
 *  @hw: pointer to the HW structure
 *
 *  Returns E1000_success upon success, else E1000_ERR_HOST_INTERFACE_COMMAND
 *
 *  This function checks whether the HOST IF is enabled for command operation
 *  and also checks whether the previous command is completed.  It busy waits
 *  in case of previous command is not completed.
 **/
Checks host interface is enabled
@hw: pointer to the HW structure



This function checks whether the HOST IF is enabled for command operation
and also checks whether the previous command is completed.  It busy waits
in case of previous command is not completed.
Checks host interface is enabled @hw : pointer to the HW structure This function checks whether the HOST IF is enabled for command operation and also checks whether the previous command is completed . It busy waits in case of previous command is not completed .
s32 e1000_mng_enable_host_if_generic(struct e1000_hw *hw)
{
	u32 hicr;
	u8 i;
	DEBUGFUNC("e1000_mng_enable_host_if_generic");
	if (!hw->mac.arc_subsystem_valid) {
		DEBUGOUT("ARC subsystem not valid.\n");
		return -E1000_ERR_HOST_INTERFACE_COMMAND;
	}
	hicr = E1000_READ_REG(hw, E1000_HICR);
	if (!(hicr & E1000_HICR_EN)) {
		DEBUGOUT("E1000_HOST_EN bit disabled.\n");
		return -E1000_ERR_HOST_INTERFACE_COMMAND;
	}
	for (i = 0; i < E1000_MNG_DHCP_COMMAND_TIMEOUT; i++) {
		hicr = E1000_READ_REG(hw, E1000_HICR);
		if (!(hicr & E1000_HICR_C))
			break;
		msec_delay_irq(1);
	}
	if (i == E1000_MNG_DHCP_COMMAND_TIMEOUT) {
		DEBUGOUT("Previous command timeout failed .\n");
		return -E1000_ERR_HOST_INTERFACE_COMMAND;
	}
	return E1000_SUCCESS;
}
s32 e1000_mng_enable_host_if_generic ( struct e1000_hw * hw ) { u32 hicr ; u8 i ; DEBUGFUNC ( " " ) ; if ( ! hw -> mac . arc_subsystem_valid ) { DEBUGOUT ( " \n " ) ; return - E1000_ERR_HOST_INTERFACE_COMMAND ; } hicr = E1000_READ_REG ( hw , E1000_HICR ) ; if ( ! ( hicr & E1000_HICR_EN ) ) { DEBUGOUT ( " \n " ) ; return - E1000_ERR_HOST_INTERFACE_COMMAND ; } for ( i = 0 ; i < E1000_MNG_DHCP_COMMAND_TIMEOUT ; i ++ ) { hicr = E1000_READ_REG ( hw , E1000_HICR ) ; if ( ! ( hicr & E1000_HICR_C ) ) break ; msec_delay_irq ( 1 ) ; } if ( i == E1000_MNG_DHCP_COMMAND_TIMEOUT ) { DEBUGOUT ( " \n " ) ; return - E1000_ERR_HOST_INTERFACE_COMMAND ; } return E1000_SUCCESS ; }
e1000_mng_enable_host_if_generic - Checks host interface is enabled
  @hw: pointer to the HW structure
e1000_mng_enable_host_if_generic - Checks host interface is enabled @hw : pointer to the HW structure
/* Check that the host interface is enabled. */ /* check the previous command is completed */