/* Stop the mac, transmit and receive units hw - Struct containing variables accessed by shared code return : 0 or idle status (if error)  */
static int atl1c_stop_mac(struct atl1c_hw *hw)
/* Stop the mac, transmit and receive units hw - Struct containing variables accessed by shared code return : 0 or idle status (if error)  */
static int atl1c_stop_mac(struct atl1c_hw *hw)
{
	u32 data;
	AT_READ_REG(hw, REG_RXQ_CTRL, &data);
	data &= ~(RXQ1_CTRL_EN | RXQ2_CTRL_EN |
		  RXQ3_CTRL_EN | RXQ_CTRL_EN);
	AT_WRITE_REG(hw, REG_RXQ_CTRL, data);
	AT_READ_REG(hw, REG_TXQ_CTRL, &data);
	data &= ~TXQ_CTRL_EN;
	AT_WRITE_REG(hw, REG_TWSI_CTRL, data);
	atl1c_wait_until_idle(hw);
	AT_READ_REG(hw, REG_MAC_CTRL, &data);
	data &= ~(MAC_CTRL_TX_EN | MAC_CTRL_RX_EN);
	AT_WRITE_REG(hw, REG_MAC_CTRL, data);
	return (int)atl1c_wait_until_idle(hw);
}