aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSamuel Ortiz <samuel@sortiz.org>2007-07-03 01:55:31 -0400
committerDavid S. Miller <davem@sunset.davemloft.net>2007-07-11 01:16:44 -0400
commit411725280bd0058ebb83c0e32133b7a94902c3a6 (patch)
tree7fc21a6c4b07ad80cf426c466400ed4679834e98
parent89da1ecf5483e6aa29b456a15ad6d05a6797c5a5 (diff)
[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@sortiz.org> Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r--include/linux/irda.h1
-rw-r--r--net/irda/irlap_frame.c7
2 files changed, 8 insertions, 0 deletions
diff --git a/include/linux/irda.h b/include/linux/irda.h
index 35911bd4dbe8..8e3735714c1c 100644
--- a/include/linux/irda.h
+++ b/include/linux/irda.h
@@ -242,6 +242,7 @@ enum nl80211_attrs {
242/* IrDA modes */ 242/* IrDA modes */
243#define IRDA_MODE_PRIMARY 0x1 243#define IRDA_MODE_PRIMARY 0x1
244#define IRDA_MODE_SECONDARY 0x2 244#define IRDA_MODE_SECONDARY 0x2
245#define IRDA_MODE_MONITOR 0x4
245 246
246#endif /* KERNEL_IRDA_H */ 247#endif /* KERNEL_IRDA_H */
247 248
diff --git a/net/irda/irlap_frame.c b/net/irda/irlap_frame.c
index 3013c49ab975..25a3444a9234 100644
--- a/net/irda/irlap_frame.c
+++ b/net/irda/irlap_frame.c
@@ -101,6 +101,13 @@ void irlap_queue_xmit(struct irlap_cb *self, struct sk_buff *skb)
101 101
102 irlap_insert_info(self, skb); 102 irlap_insert_info(self, skb);
103 103
104 if (unlikely(self->mode & IRDA_MODE_MONITOR)) {
105 IRDA_DEBUG(3, "%s(): %s is in monitor mode\n", __FUNCTION__,
106 self->netdev->name);
107 dev_kfree_skb(skb);
108 return;
109 }
110
104 dev_queue_xmit(skb); 111 dev_queue_xmit(skb);
105} 112}
106 113