Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 41172528 authored by Samuel Ortiz's avatar Samuel Ortiz Committed by David S. Miller
Browse files

[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: default avatarSamuel Ortiz <samuel@sortiz.org>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 89da1ecf
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -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 */

+7 −0
Original line number Diff line number Diff line
@@ -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);
}