s = map_status(info->serial_signals); 
s = info->serial_signals; 
static int wait_mgsl_event(SLMP_INFO * info, int __user *mask_ptr){ 	unsigned long flags;	int s;	int rc=0;	struct mgsl_icount cprev, cnow;	int events;	int mask;	struct	_input_signal_events oldsigs, newsigs;	DECLARE_WAITQUEUE(wait, current);	COPY_FROM_USER(rc,&mask, mask_ptr, sizeof(int));	if (rc) {		return  -EFAULT;	}	if (debug_level >= DEBUG_LEVEL_INFO)		printk("%s(%d):%s wait_mgsl_event(%d)\n",			__FILE__,__LINE__,info->device_name,mask);	spin_lock_irqsave(&info->lock,flags);	/* return immediately if state matches requested events */	get_signals(info);	s = map_status(info->serial_signals);	events = mask &		( ((s & SerialSignal_DSR) ? MgslEvent_DsrActive:MgslEvent_DsrInactive) + 		  ((s & SerialSignal_DCD) ? MgslEvent_DcdActive:MgslEvent_DcdInactive) +		  ((s & SerialSignal_CTS) ? MgslEvent_CtsActive:MgslEvent_CtsInactive) +		  ((s & SerialSignal_RI)  ? MgslEvent_RiActive :MgslEvent_RiInactive) );	if (events) {		spin_unlock_irqrestore(&info->lock,flags);		goto exit;	}	/* save current irq counts */	cprev = info->icount;	oldsigs = info->input_signal_events;	/* enable hunt and idle irqs if needed */	if (mask & (MgslEvent_ExitHuntMode+MgslEvent_IdleReceived)) {		unsigned char oldval = info->ie1_value;		unsigned char newval = oldval +			 (mask & MgslEvent_ExitHuntMode ? FLGD:0) +			 (mask & MgslEvent_IdleReceived ? IDLD:0);		if ( oldval != newval ) {			info->ie1_value = newval;			write_reg(info, IE1, info->ie1_value);		}	}	set_current_state(TASK_INTERRUPTIBLE);	add_wait_queue(&info->event_wait_q, &wait);	spin_unlock_irqrestore(&info->lock,flags);	for(;;) {		schedule();		if (signal_pending(current)) {			rc = -ERESTARTSYS;			break;		}		/* get current irq counts */		spin_lock_irqsave(&info->lock,flags);		cnow = info->icount;		newsigs = info->input_signal_events;		set_current_state(TASK_INTERRUPTIBLE);		spin_unlock_irqrestore(&info->lock,flags);		/* if no change, wait aborted for some reason */		if (newsigs.dsr_up   == oldsigs.dsr_up   &&		    newsigs.dsr_down == oldsigs.dsr_down &&		    newsigs.dcd_up   == oldsigs.dcd_up   &&		    newsigs.dcd_down == oldsigs.dcd_down &&		    newsigs.cts_up   == oldsigs.cts_up   &&		    newsigs.cts_down == oldsigs.cts_down &&		    newsigs.ri_up    == oldsigs.ri_up    &&		    newsigs.ri_down  == oldsigs.ri_down  &&		    cnow.exithunt    == cprev.exithunt   &&		    cnow.rxidle      == cprev.rxidle) {			rc = -EIO;			break;		}		events = mask &			( (newsigs.dsr_up   != oldsigs.dsr_up   ? MgslEvent_DsrActive:0)   +			  (newsigs.dsr_down != oldsigs.dsr_down ? MgslEvent_DsrInactive:0) +			  (newsigs.dcd_up   != oldsigs.dcd_up   ? MgslEvent_DcdActive:0)   +			  (newsigs.dcd_down != oldsigs.dcd_down ? MgslEvent_DcdInactive:0) +			  (newsigs.cts_up   != oldsigs.cts_up   ? MgslEvent_CtsActive:0)   +			  (newsigs.cts_down != oldsigs.cts_down ? MgslEvent_CtsInactive:0) +			  (newsigs.ri_up    != oldsigs.ri_up    ? MgslEvent_RiActive:0)    +			  (newsigs.ri_down  != oldsigs.ri_down  ? MgslEvent_RiInactive:0)  +			  (cnow.exithunt    != cprev.exithunt   ? MgslEvent_ExitHuntMode:0) +			  (cnow.rxidle      != cprev.rxidle     ? MgslEvent_IdleReceived:0) );		if (events)			break;		cprev = cnow;		oldsigs = newsigs;	}	remove_wait_queue(&info->event_wait_q, &wait);	set_current_state(TASK_RUNNING);	if (mask & (MgslEvent_ExitHuntMode + MgslEvent_IdleReceived)) {		spin_lock_irqsave(&info->lock,flags);		if (!waitqueue_active(&info->event_wait_q)) {			/* disable enable exit hunt mode/idle rcvd IRQs */			info->ie1_value &= ~(FLGD|IDLD);			write_reg(info, IE1, info->ie1_value);		}		spin_unlock_irqrestore(&info->lock,flags);	}exit:	if ( rc == 0 )		PUT_USER(rc, events, mask_ptr);	return rc;}
10457	/local/tlutelli/issta_data/temp/c/2005_temp/2005/10457/7f3edb94564d319cd58cc11c2c986b7ec25643d8/synclinkmp.c/buggy/drivers/char/synclinkmp.c