patch-2.4.0-test11 linux/net/irda/timer.c

Next file: linux/net/irda/wrapper.c
Previous file: linux/net/irda/qos.c
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.4.0-test10/linux/net/irda/timer.c linux/net/irda/timer.c
@@ -24,6 +24,7 @@
  ********************************************************************/
 
 #include <asm/system.h>
+#include <linux/config.h>
 #include <linux/delay.h>
 
 #include <net/irda/timer.h>
@@ -99,6 +100,25 @@
 			 (void *) self, irlap_media_busy_expired);
 }
 
+void irlap_stop_mbusy_timer(struct irlap_cb *self)
+{
+	/* If timer is activated, kill it! */
+	if(timer_pending(&self->media_busy_timer))
+		del_timer(&self->media_busy_timer);
+
+#ifdef CONFIG_IRDA_ULTRA
+	/* Send any pending Ultra frames if any */
+	if (!skb_queue_empty(&self->txq_ultra))
+		/* Note : we don't send the frame, just post an event.
+		 * Frames will be sent only if we are in NDM mode (see
+		 * irlap_event.c).
+		 * Also, moved this code from irlap_media_busy_expired()
+		 * to here to catch properly all cases...
+		 * Jean II */
+		irlap_do_event(self, SEND_UI_FRAME, NULL, NULL);
+#endif /* CONFIG_IRDA_ULTRA */
+}
+
 void irlmp_start_watchdog_timer(struct lsap_cb *self, int timeout) 
 {
 	irda_start_timer(&self->watchdog_timer, timeout, (void *) self,
@@ -117,6 +137,13 @@
 			 irlmp_idle_timer_expired);
 }
 
+void irlmp_stop_idle_timer(struct lap_cb *self) 
+{
+	/* If timer is activated, kill it! */
+	if(timer_pending(&self->idle_timer))
+		del_timer(&self->idle_timer);
+}
+
 /*
  * Function irlap_slot_timer_expired (data)
  *
@@ -210,8 +237,5 @@
 	ASSERT(self != NULL, return;);
 
 	irda_device_set_media_busy(self->netdev, FALSE);
-
-	/* Send any pending Ultra frames if any */
-	if (!skb_queue_empty(&self->txq_ultra))
-		irlap_do_event(self, SEND_UI_FRAME, NULL, NULL);
+	/* Note : will deal with Ultra frames */
 }

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