patch-2.4.14 linux/drivers/char/ip2/i2ellis.c

Next file: linux/drivers/char/ip2/i2ellis.h
Previous file: linux/drivers/char/ip2/i2cmd.c
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.4.13/linux/drivers/char/ip2/i2ellis.c linux/drivers/char/ip2/i2ellis.c
@@ -552,6 +552,9 @@
 
 	pB->i2eStartMail = iiGetMail(pB);
 
+	// Throw it away and clear the mailbox structure element
+	pB->i2eStartMail = NO_MAIL_HERE;
+
 	// Everything is ok now, return with good status/
 
 	pB->i2eValid = I2E_MAGIC;
@@ -592,14 +595,27 @@
 static void
 ii2DelayTimer(unsigned int mseconds)
 {
+	wait_queue_t wait;
+
+	init_waitqueue_entry(&wait, current);
+
 	init_timer ( pDelayTimer );
 
+	add_wait_queue(&pDelayWait, &wait);
+
+	set_current_state( TASK_INTERRUPTIBLE );
+
 	pDelayTimer->expires  = jiffies + ( mseconds + 9 ) / 10;
 	pDelayTimer->function = ii2DelayWakeup;
 	pDelayTimer->data     = 0;
 
 	add_timer ( pDelayTimer );
-	interruptible_sleep_on ( &pDelayWait );
+
+	schedule();
+
+	set_current_state( TASK_RUNNING );
+	remove_wait_queue(&pDelayWait, &wait);
+
 	del_timer ( pDelayTimer );
 }
 

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen (who was at: slshen@lbl.gov)