Skip to contentSkip to conversation

Update for net-2.6.23

PATCH Applied [email protected] 3 participants 9 messages Jul 1, 2007 – Jul 3, 2007 1 message not in the archive

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

cover Update for net-2.6.23

Hi Dave,

Here goes an IrDA update for net-2.6.23.

Cheers,
Samuel.

-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/

#1 lore raw

PATCH 1/4 Netlink layer

First IrDA configuration netlink layer implementation. Currently, we only support the set/get mode commands.

---
 include/linux/irda.h     |   20 ++++++
 include/net/irda/irda.h  |    3 +
 include/net/irda/irlap.h |    2 +
 net/irda/Makefile        |    2 +-
 net/irda/irmod.c         |   46 ++++++++++++-
 net/irda/irnetlink.c     |  162 ++++++++++++++++++++++++++++++++++++++++++++++
 6 files changed, 230 insertions(+), 5 deletions(-)
 create mode 100644 net/irda/irnetlink.c
include/linux/irda.h +27 -0
Index: net-2.6-quilt/include/linux/irda.h
===================================================================
@@ -216,6 +216,33 @@
 #define ifr_dtr       ifr_ifru.ifru_line.dtr
 #define ifr_rts       ifr_ifru.ifru_line.rts
 
+
+/* IrDA netlink definitions */
+#define IRDA_NL_NAME "irda"
+#define IRDA_NL_VERSION 1
+
+enum irda_nl_commands {
+	IRDA_NL_CMD_UNSPEC,
+	IRDA_NL_CMD_SET_MODE,
+	IRDA_NL_CMD_GET_MODE,
+
+	__IRDA_NL_CMD_AFTER_LAST
+};
+#define IRDA_NL_CMD_MAX (__IRDA_NL_CMD_AFTER_LAST - 1)
+
+enum nl80211_attrs {
+	IRDA_NL_ATTR_UNSPEC,
+	IRDA_NL_ATTR_IFNAME,
+	IRDA_NL_ATTR_MODE,
+
+	__IRDA_NL_ATTR_AFTER_LAST
+};
+#define IRDA_NL_ATTR_MAX (__IRDA_NL_ATTR_AFTER_LAST - 1)
+
+/* IrDA modes */
+#define IRDA_MODE_PRIMARY   0x1
+#define IRDA_MODE_SECONDARY 0x2
+
 #endif /* KERNEL_IRDA_H */
 
 
include/net/irda/irda.h +3 -0
Index: net-2.6-quilt/include/net/irda/irda.h
===================================================================
@@ -125,6 +125,9 @@
 extern int irsock_init(void);
 extern void irsock_cleanup(void);
 
+extern int irda_nl_register(void);
+extern void irda_nl_unregister(void);
+
 extern int irlap_driver_rcv(struct sk_buff *skb, struct net_device *dev,
 			    struct packet_type *ptype,
 			    struct net_device *orig_dev);
include/net/irda/irlap.h +2 -0
Index: net-2.6-quilt/include/net/irda/irlap.h
===================================================================
@@ -208,6 +208,8 @@
 	int    xbofs_delay;   /* Nr of XBOF's used to MTT */
 	int    bofs_count;    /* Negotiated extra BOFs */
 	int    next_bofs;     /* Negotiated extra BOFs after next frame */
+
+	int    mode;     /* IrLAP mode (primary, secondary or monitor) */
 };
 
 /* 
net/irda/Makefile +1 -1
Index: net-2.6-quilt/net/irda/Makefile
===================================================================
@@ -10,6 +10,6 @@
 irda-y := iriap.o iriap_event.o irlmp.o irlmp_event.o irlmp_frame.o \
           irlap.o irlap_event.o irlap_frame.o timer.o qos.o irqueue.o \
           irttp.o irda_device.o irias_object.o wrapper.o af_irda.o \
-	  discovery.o parameters.o irmod.o
+	  discovery.o parameters.o irnetlink.o irmod.o
 irda-$(CONFIG_PROC_FS) += irproc.o
 irda-$(CONFIG_SYSCTL) += irsysctl.o
net/irda/irmod.c +44 -4

79 lines not on this page · raw message

net/irda/irnetlink.c new file +170 -0

170 lines not on this page · raw message

Signature · 5 lines
-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
#3 lore raw

PATCH 2/4 Monitor mode

In reply to [email protected]

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.

include/linux/irda.h +1 -0
Index: net-2.6-quilt/include/linux/irda.h
===================================================================
@@ -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 */
 
net/irda/irlap_frame.c +7 -0
Index: net-2.6-quilt/net/irda/irlap_frame.c
===================================================================
@@ -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);
 }
 
Signature · 5 lines
-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
maintainer Applied
#4 lore raw

Re: [PATCH 2/4] [IrDA] Monitor mode

From: [email protected]
Date: Mon, 02 Jul 2007 01:14:29 +0300

Quoted 5 lines

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.

Applied, thanks.

#5 lore raw

PATCH 3/4 kingsun-sir.c charset fix

In reply to [email protected]
Cc Alex Villacís Lasso <[email protected]>
---
 drivers/net/irda/kingsun-sir.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/net/irda/kingsun-sir.c +2 -2
Index: net-2.6-quilt/drivers/net/irda/kingsun-sir.c
===================================================================
@@ -4,7 +4,7 @@
 * Version:       0.1.1
 * Description:   Irda KingSun/DonShine USB Dongle
 * Status:        Experimental
-* Author:        Alex Villac�s Lasso <[email protected]>
+* Author:        Alex Villacís Lasso <[email protected]>
 *
 *  	Based on stir4200 and mcs7780 drivers, with (strange?) differences
 *
@@ -652,6 +652,6 @@
 }
 module_exit(kingsun_cleanup);
 
-MODULE_AUTHOR("Alex Villac�s Lasso <[email protected]>");
+MODULE_AUTHOR("Alex Villacís Lasso <[email protected]>");
 MODULE_DESCRIPTION("IrDA-USB Dongle Driver for KingSun/DonShine");
 MODULE_LICENSE("GPL");

-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/

_______________________________________________
irda-users mailing list [email protected]
http://lists.sourceforge.net/lists/listinfo/irda-users

A message that is not in the archive (sent off-list or not yet received): [email protected]

Applied
#7 lore raw

Re: [PATCH 3/4] [IrDA] kingsun-sir.c charset fix

From: [email protected]
Date: Mon, 02 Jul 2007 01:14:30 +0300

Quoted 2 lines
Cc Alex Villacís Lasso <[email protected]>

Applied.

-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/

#8 lore raw

PATCH 4/4 tsap init routine factorisation

In reply to [email protected]

This patch extracts common code from irttp_open_tsap() and irttp_dup() into a new function to 1) avoid code duplication, 2) help avoid forgetting object initialization in the tsap duplication path in the future.

net/irda/irttp.c +19 -10
@@ -369,6 +369,20 @@ static int irttp_param_max_sdu_size(void
 /* Everything is happily mixed up. Waiting for next clean up - Jean II */
 
 /*
+ * Initialization, that has to be done on new tsap
+ * instance allocation and on duplication
+ */
+static void irttp_init_tsap(struct tsap_cb *tsap)
+{
+	spin_lock_init(&tsap->lock);
+	init_timer(&tsap->todo_timer);
+
+	skb_queue_head_init(&tsap->rx_queue);
+	skb_queue_head_init(&tsap->tx_queue);
+	skb_queue_head_init(&tsap->rx_fragments);
+}
+
+/*
  * Function irttp_open_tsap (stsap, notify)
  *
  *    Create TSAP connection endpoint,
@@ -395,10 +409,11 @@ struct tsap_cb *irttp_open_tsap(__u8 sts
 		IRDA_DEBUG(0, "%s(), unable to kmalloc!\n", __FUNCTION__);
 		return NULL;
 	}
-	spin_lock_init(&self->lock);
+
+	/* Initialize internal objects */
+	irttp_init_tsap(self);
 
 	/* Initialise todo timer */
-	init_timer(&self->todo_timer);
 	self->todo_timer.data     = (unsigned long) self;
 	self->todo_timer.function = &irttp_todo_expired;
 
@@ -418,9 +433,6 @@ struct tsap_cb *irttp_open_tsap(__u8 sts
 	self->magic = TTP_TSAP_MAGIC;
 	self->connected = FALSE;
 
-	skb_queue_head_init(&self->rx_queue);
-	skb_queue_head_init(&self->tx_queue);
-	skb_queue_head_init(&self->rx_fragments);
 	/*
 	 *  Create LSAP at IrLMP layer
 	 */
@@ -1455,12 +1467,9 @@ struct tsap_cb *irttp_dup(struct tsap_cb
 
 	/* Not everything should be copied */
 	new->notify.instance = instance;
-	spin_lock_init(&new->lock);
-	init_timer(&new->todo_timer);
 
-	skb_queue_head_init(&new->rx_queue);
-	skb_queue_head_init(&new->tx_queue);
-	skb_queue_head_init(&new->rx_fragments);
+	/* Initialize internal objects */
+	irttp_init_tsap(new);
 
 	/* This is locked */
 	hashbin_insert(irttp->tsaps, (irda_queue_t *) new, (long) new, NULL);
Signature · 5 lines
-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
maintainer
#9 lore raw

Re: [PATCH 4/4] [IrDA] tsap init routine factorisation

From: [email protected]
Date: Mon, 02 Jul 2007 01:14:31 +0300

Quoted 6 lines

This patch extracts common code from irttp_open_tsap() and irttp_dup() into a new function to 1) avoid code duplication, 2) help avoid forgetting object initialization in the tsap duplication path in the future.

Also applied, thanks.