while (rdebi(av7110, DEBINOSWAP, HANDSHAKE_REG, 0, 2 )) { if (time_after(jiffies, start + ARM_WAIT_SHAKE)) { 
while (1) { err = time_after(jiffies, start + ARM_WAIT_SHAKE); if (rdebi(av7110, DEBINOSWAP, HANDSHAKE_REG, 0, 2) == 0) break; if (err) { 
int av7110_fw_request(struct av7110 *av7110, u16 *request_buf,		      int request_buf_len, u16 *reply_buf, int reply_buf_len){	int err;	s16 i;	unsigned long start;#ifdef COM_DEBUG	u32 stat;#endif	dprintk(4, "%p\n", av7110);	if (!av7110->arm_ready) {		dprintk(1, "arm not ready.\n");		return -1;	}	if (down_interruptible(&av7110->dcomlock))		return -ERESTARTSYS;	if ((err = __av7110_send_fw_cmd(av7110, request_buf, request_buf_len)) < 0) {		up(&av7110->dcomlock);		printk(KERN_ERR "dvb-ttpci: av7110_fw_request error %d\n", err);		return err;	}	start = jiffies;	while (rdebi(av7110, DEBINOSWAP, COMMAND, 0, 2)) {		if (time_after(jiffies, start + ARM_WAIT_FREE)) {			printk(KERN_ERR "%s: timeout waiting for COMMAND to complete\n", __FUNCTION__);			up(&av7110->dcomlock);			return -ETIMEDOUT;		}#ifdef _NOHANDSHAKE		msleep(1);#endif	}#ifndef _NOHANDSHAKE	start = jiffies;	while (rdebi(av7110, DEBINOSWAP, HANDSHAKE_REG, 0, 2 )) {		if (time_after(jiffies, start + ARM_WAIT_SHAKE)) {			printk(KERN_ERR "%s: timeout waiting for HANDSHAKE_REG\n", __FUNCTION__);			up(&av7110->dcomlock);			return -ETIMEDOUT;		}		msleep(1);	}#endif#ifdef COM_DEBUG	stat = rdebi(av7110, DEBINOSWAP, MSGSTATE, 0, 2);	if (stat & GPMQOver) {		printk(KERN_ERR "%s: GPMQOver\n", __FUNCTION__);		up(&av7110->dcomlock);		return -1;	}	else if (stat & OSDQOver) {		printk(KERN_ERR "%s: OSDQOver\n", __FUNCTION__);		up(&av7110->dcomlock);		return -1;	}#endif	for (i = 0; i < reply_buf_len; i++)		reply_buf[i] = rdebi(av7110, DEBINOSWAP, COM_BUFF + 2 * i, 0, 2);	up(&av7110->dcomlock);	return 0;}
10457	/local/tlutelli/issta_data/temp/c/2005_temp/2005/10457/25de192660627e1e8dc8ee6a120ff8b54d108593/av7110_hw.c/clean/drivers/media/dvb/ttpci/av7110_hw.c