rem: bool restart = false; int32 i = 0;   if (read32(cfgAddress) & (WB_NETCFG_TX_ON|WB_NETCFG_RX_ON)) { restart = true; WB_CLRBIT(cfgAddress, (WB_NETCFG_TX_ON|WB_NETCFG_RX_ON));  for (i = 0; i < WB_TIMEOUT; i++) { if ((read32(info->reg_base + WB_ISR) & WB_ISR_TX_IDLE) && (read32(info->reg_base + WB_ISR) & WB_ISR_RX_IDLE)) break; }  if (i == WB_TIMEOUT) dprintf(DEVICE_NAME" Failed to put RX and TX in idle state\n"); }
add: status = wb_stop(info);
context: wb_set_mode(wb_device *info, int mode){	uint32 cfgAddress = (uint32)info->reg_base + WB_NETCFG;	int32 speed = mode & LINK_SPEED_MASK;	uint32 configFlags = 0;		bool restart = false;	int32 i = 0;		// Stop TX and RX queue.	if (read32(cfgAddress) & (WB_NETCFG_TX_ON|WB_NETCFG_RX_ON)) {		restart = true;		WB_CLRBIT(cfgAddress, (WB_NETCFG_TX_ON|WB_NETCFG_RX_ON));		for (i = 0; i < WB_TIMEOUT; i++) {			if ((read32(info->reg_base + WB_ISR) & WB_ISR_TX_IDLE) &&				(read32(info->reg_base + WB_ISR) & WB_ISR_RX_IDLE))				break;		}		if (i == WB_TIMEOUT)			dprintf(DEVICE_NAME" Failed to put RX and TX in idle state\n");				}		if ((mode & LINK_DUPLEX_MASK) == LINK_FULL_DUPLEX)		configFlags |= WB_NETCFG_FULLDUPLEX;					if (speed == LINK_SPEED_100_MBIT)		configFlags |= WB_NETCFG_100MBPS;	write32(cfgAddress, configFlags);		if (restart)		WB_SETBIT(cfgAddress, WB_NETCFG_TX_ON|WB_NETCFG_RX_ON);	}