]> err.no Git - linux-2.6/commitdiff
[IrDA]: Monitor mode.
authorSamuel Ortiz <samuel@sortiz.org>
Tue, 3 Jul 2007 05:55:31 +0000 (22:55 -0700)
committerDavid S. Miller <davem@sunset.davemloft.net>
Wed, 11 Jul 2007 05:16:44 +0000 (22:16 -0700)
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>
include/linux/irda.h
net/irda/irlap_frame.c

index 35911bd4dbe83b82420d7deec70a705de41d3296..8e3735714c1c42e1c61145b59f95e40fee23821e 100644 (file)
@@ -242,6 +242,7 @@ enum nl80211_attrs {
 /* IrDA modes */
 #define IRDA_MODE_PRIMARY   0x1
 #define IRDA_MODE_SECONDARY 0x2
+#define IRDA_MODE_MONITOR   0x4
 
 #endif /* KERNEL_IRDA_H */
 
index 3013c49ab975e865b593746911f0d88f2921c8b0..25a3444a9234f1faba7ba2e2e88b18e452d1f44f 100644 (file)
@@ -101,6 +101,13 @@ void irlap_queue_xmit(struct irlap_cb *self, struct sk_buff *skb)
 
        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);
 }