if (instance->poll_delay < MAX_POLL_DELAY) instance->poll_delay *= 2; 
instance->poll_delay = min(2 * instance->poll_delay, MAX_POLL_DELAY); 
static void speedtch_check_status(struct speedtch_instance_data *instance){	struct usbatm_data *usbatm = instance->usbatm;	struct atm_dev *atm_dev = usbatm->atm_dev;	unsigned char *buf = instance->scratch_buffer;	int ret;	atm_dbg(usbatm, "%s entered\n", __func__);	ret = speedtch_read_status(instance);	if (ret < 0) {		atm_warn(usbatm, "error %d fetching device status\n", ret);		if (instance->poll_delay < MAX_POLL_DELAY)			instance->poll_delay *= 2;		return;	}	if (instance->poll_delay > MIN_POLL_DELAY)		instance->poll_delay /= 2;	atm_dbg(usbatm, "%s: line state %02x\n", __func__, buf[OFFSET_7]);	switch (buf[OFFSET_7]) {	case 0:		if (atm_dev->signal != ATM_PHY_SIG_LOST) {			atm_dev->signal = ATM_PHY_SIG_LOST;			atm_info(usbatm, "ADSL line is down\n");			/* It'll never resync again unless we ask it to... */			ret = speedtch_start_synchro(instance);		}		break;	case 0x08:		if (atm_dev->signal != ATM_PHY_SIG_UNKNOWN) {			atm_dev->signal = ATM_PHY_SIG_UNKNOWN;			atm_info(usbatm, "ADSL line is blocked?\n");		}		break;	case 0x10:		if (atm_dev->signal != ATM_PHY_SIG_LOST) {			atm_dev->signal = ATM_PHY_SIG_LOST;			atm_info(usbatm, "ADSL line is synchronising\n");		}		break;	case 0x20:		if (atm_dev->signal != ATM_PHY_SIG_FOUND) {			int down_speed = buf[OFFSET_b] | (buf[OFFSET_b + 1] << 8)				| (buf[OFFSET_b + 2] << 16) | (buf[OFFSET_b + 3] << 24);			int up_speed = buf[OFFSET_b + 4] | (buf[OFFSET_b + 5] << 8)				| (buf[OFFSET_b + 6] << 16) | (buf[OFFSET_b + 7] << 24);			if (!(down_speed & 0x0000ffff) && !(up_speed & 0x0000ffff)) {				down_speed >>= 16;				up_speed >>= 16;			}			atm_dev->link_rate = down_speed * 1000 / 424;			atm_dev->signal = ATM_PHY_SIG_FOUND;			atm_info(usbatm,				 "ADSL line is up (%d kb/s down | %d kb/s up)\n",				 down_speed, up_speed);		}		break;	default:		if (atm_dev->signal != ATM_PHY_SIG_UNKNOWN) {			atm_dev->signal = ATM_PHY_SIG_UNKNOWN;			atm_info(usbatm, "Unknown line state %02x\n", buf[OFFSET_7]);		}		break;	}}
4520	/local/tlutelli/issta_data/temp/c/2005_temp/2005/4520/cd5c08fb7b0d960b7cd48bc977feee7b3bd8b046/speedtch.c/clean/drivers/usb/atm/speedtch.c