kernels/linux-2.4.0/drivers/net/wan/sdla_fr.c
/*============================================================================
 * Update device status & statistics.
 */
Update device status & statistics.
Update device status & statistics .
static int update (wan_device_t* wandev)
{
	volatile sdla_t* card;
	unsigned long timeout;
	fr508_flags_t* flags;
	if ((wandev == NULL) || (wandev->private == NULL))
		return -EFAULT;
	if (wandev->state == WAN_UNCONFIGURED)
		return -ENODEV;
	if (test_bit(1, (void*)&wandev->critical))
		return -EAGAIN;
	card = wandev->private;
	flags = card->flags;
	card->u.f.update_comms_stats = 1;
	card->u.f.timer_int_enabled |= TMR_INT_ENABLED_UPDATE;
	flags->imask |= FR_INTR_TIMER;
       	timeout = jiffies;
       	for(;;) {
		if(card->u.f.update_comms_stats == 0)
			break;
                if ((jiffies - timeout) > (1 * HZ)){
    			card->u.f.update_comms_stats = 0;
 			return -EAGAIN;
		}
        }
	return 0;
}
static int update ( wan_device_t * wandev ) { volatile sdla_t * card ; unsigned long timeout ; fr508_flags_t * flags ; if ( ( wandev == NULL ) || ( wandev -> private == NULL ) ) return - EFAULT ; if ( wandev -> state == WAN_UNCONFIGURED ) return - ENODEV ; if ( test_bit ( 1 , ( void * ) & wandev -> critical ) ) return - EAGAIN ; card = wandev -> private ; flags = card -> flags ; card -> u . f . update_comms_stats = 1 ; card -> u . f . timer_int_enabled |= TMR_INT_ENABLED_UPDATE ; flags -> imask |= FR_INTR_TIMER ; timeout = jiffies ; for ( ; ; ) { if ( card -> u . f . update_comms_stats == 0 ) break ; if ( ( jiffies - timeout ) > ( 1 * HZ ) ) { card -> u . f . update_comms_stats = 0 ; return - EAGAIN ; } } return 0 ; }
Update device status & statistics.
Update device status & statistics .
/* sanity checks */