[<prev] [next>] [<thread-prev] [thread-next>] [month] [year] [list]
Date: Mon, 02 Jul 2007 01:14:29 +0300
From: samuel@...tiz.org
To: davem@...emloft.net
Subject: [PATCH 2/4] [IrDA] Monitor mode
Through the IrDA netlink set mode command, we switch to IrDA monitor mode,
where one IrLAP instance receives all the packets on the media, without ever
responding to them.
Signed-off-by: Samuel Ortiz <samuel@...tiz.org>
Index: net-2.6-quilt/include/linux/irda.h
===================================================================
--- net-2.6-quilt.orig/include/linux/irda.h 2007-05-12 03:04:09.000000000 +0300
+++ net-2.6-quilt/include/linux/irda.h 2007-05-12 03:07:41.000000000 +0300
@@ -242,6 +242,7 @@
/* IrDA modes */
#define IRDA_MODE_PRIMARY 0x1
#define IRDA_MODE_SECONDARY 0x2
+#define IRDA_MODE_MONITOR 0x4
#endif /* KERNEL_IRDA_H */
Index: net-2.6-quilt/net/irda/irlap_frame.c
===================================================================
--- net-2.6-quilt.orig/net/irda/irlap_frame.c 2007-05-12 03:02:16.000000000 +0300
+++ net-2.6-quilt/net/irda/irlap_frame.c 2007-05-12 03:07:41.000000000 +0300
@@ -101,6 +101,13 @@
irlap_insert_info(self, skb);
+ if (unlikely(self->mode & IRDA_MODE_MONITOR)) {
+ IRDA_DEBUG(3, "%s(): %s is in monitor mode\n", __FUNCTION__,
+ self->netdev->name);
+ dev_kfree_skb(skb);
+ return;
+ }
+
dev_queue_xmit(skb);
}
--
-
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Hosted by DataForce ISP -
Powered by Openwall GNU/*/Linux