/* 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.  */
static s32 e1000_mng_enable_host_if(struct e1000_hw *hw)
/* 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.  */
static s32 e1000_mng_enable_host_if(struct e1000_hw *hw)
{
	u32 hicr;
	u8 i;
	hicr = er32(HICR);
	if ((hicr & E1000_HICR_EN) == 0) {
		e_dbg("E1000_HOST_EN bit disabled.\n");
		return -E1000_ERR_HOST_INTERFACE_COMMAND;
	}
	for (i = 0; i < E1000_MNG_DHCP_COMMAND_TIMEOUT; i++) {
		hicr = er32(HICR);
		if (!(hicr & E1000_HICR_C))
			break;
		mdelay(1);
	}
	if (i == E1000_MNG_DHCP_COMMAND_TIMEOUT) {
		e_dbg("Previous command timeout failed .\n");
		return -E1000_ERR_HOST_INTERFACE_COMMAND;
	}
	return 0;
}