yld->ctl_data->offset	= htons(ix); 
yld->ctl_data->offset	= cpu_to_be16(ix); 
static int yealink_do_idle_tasks(struct yealink_dev *yld){	u8 val;	int i, ix, len;	ix = yld->stat_ix;	memset(yld->ctl_data, 0, sizeof(*(yld->ctl_data)));	yld->ctl_data->cmd  = CMD_KEYPRESS;	yld->ctl_data->size = 1;	yld->ctl_data->sum  = 0xff - CMD_KEYPRESS;	/* If state update pointer wraps do a KEYPRESS first. */	if (ix >= sizeof(yld->master)) {		yld->stat_ix = 0;		return 0;	}	/* find update candidates: copy != master */	do {		val = yld->master.b[ix];		if (val != yld->copy.b[ix])			goto send_update;	} while (++ix < sizeof(yld->master));	/* nothing todo, wait a bit and poll for a KEYPRESS */	yld->stat_ix = 0;	/* TODO how can we wait abit. ??	 * msleep_interruptible(1000 / YEALINK_POLLING_FREQUENCY);	 */	return 0;send_update:	/* Setup an appropriate update request */	yld->copy.b[ix] = val;	yld->ctl_data->data[0] = val;	switch(ix) {	case offsetof(struct yld_status, led):		yld->ctl_data->cmd	= CMD_LED;		yld->ctl_data->sum	= -1 - CMD_LED - val;		break;	case offsetof(struct yld_status, dialtone):		yld->ctl_data->cmd	= CMD_DIALTONE;		yld->ctl_data->sum	= -1 - CMD_DIALTONE - val;		break;	case offsetof(struct yld_status, ringtone):		yld->ctl_data->cmd	= CMD_RINGTONE;		yld->ctl_data->sum	= -1 - CMD_RINGTONE - val;		break;	case offsetof(struct yld_status, keynum):		val--;		val &= 0x1f;		yld->ctl_data->cmd	= CMD_SCANCODE;		yld->ctl_data->offset	= htons(val);		yld->ctl_data->data[0]	= 0;		yld->ctl_data->sum	= -1 - CMD_SCANCODE - val;		break;	default:		len = sizeof(yld->master.s.lcd) - ix;		if (len > sizeof(yld->ctl_data->data))			len = sizeof(yld->ctl_data->data);		/* Combine up to <len> consecutive LCD bytes in a singe request		 */		yld->ctl_data->cmd	= CMD_LCD;		yld->ctl_data->offset	= htons(ix);		yld->ctl_data->size	= len;		yld->ctl_data->sum	= -CMD_LCD - ix - val - len;		for(i=1; i<len; i++) {			ix++;			val = yld->master.b[ix];			yld->copy.b[ix]		= val;			yld->ctl_data->data[i]	= val;			yld->ctl_data->sum     -= val;		}	}	yld->stat_ix = ix + 1;	return 1;}
10457	/local/tlutelli/issta_data/temp/c/2005_temp/2005/10457/b71e318cdb1dc301d734fdd4983dfc6dc167235a/yealink.c/buggy/drivers/usb/input/yealink.c