Skip to contentSkip to conversation

IrDA updates for net-2.6.24

PATCH New Samuel Ortiz 2 participants 4 messages Aug 26, 2007

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

cover IrDA updates for net-2.6.24

Hi Dave,

Here go 3 IrDA patches for net-2.6.24 inclusion.

Cheers,
Samuel.

-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems? Stop. Now Search log events and configuration files using AJAX and a browser. Download your FREE copy of Splunk now >> http://get.splunk.com/

#1 lore raw

PATCH 3/3 Kingsun KS-959 IrDA USB driver

This dongle does not follow the usb-irda specification, so it needs its own special driver. First, it uses control URBs for data transfer, instead of bulk or interrupt transfers; the only interrupt endpoint exposed seems to be a dummy to prevent the interface from being rejected. Second, it uses obfuscation and padding at the USB traffic level, for no apparent reason other than to make reverse engineering harder (full details on obfuscation in comments at beginning of source). Although it is advertised as a "4 Mbps FIR dongle", it apparently loses packets at speeds greater than 57600 bps.

On plugin, this dongle reports vendor and device IDs: 0x07d0:0x4959 .

The Windows driver that is used normally to control this dongle has a filename of KS-959.SYS .

---
 drivers/net/irda/Kconfig     |   14 
 drivers/net/irda/Makefile    |    1 
 drivers/net/irda/ks959-sir.c |  939 +++++++++++++++++++++++++++++++++++++++++++
 3 files changed, 954 insertions(+)
drivers/net/irda/Kconfig +14 -0
Index: net-2.6.24-quilt/drivers/net/irda/Kconfig
===================================================================
@@ -176,6 +176,20 @@
 	  To compile it as a module, choose M here: the module will be called
 	  ksdazzle-sir.
 
+config KS959_DONGLE
+	tristate "KingSun KS-959 IrDA-USB dongle (EXPERIMENTAL)"
+	depends on IRDA && USB && EXPERIMENTAL
+	help
+	  Say Y or M here if you want to build support for the KingSun KS-959
+	  IrDA-USB bridge device driver.
+
+	  This USB bridge does not conform to the IrDA-USB device class
+	  specification, and therefore needs its own specific driver. This
+	  dongle supports SIR speeds only (9600 through 57600 bps).
+
+	  To compile it as a module, choose M here: the module will be called
+	  ks959-sir.
+
 comment "Old SIR device drivers"
 
 config IRPORT_SIR
drivers/net/irda/ks959-sir.c new file +939 -0

939 lines not on this page · raw message

drivers/net/irda/Makefile +1 -0
Index: net-2.6.24-quilt/drivers/net/irda/Makefile
===================================================================
@@ -48,6 +48,7 @@
 obj-$(CONFIG_EP7211_DONGLE)	+= ep7211-sir.o
 obj-$(CONFIG_KINGSUN_DONGLE)	+= kingsun-sir.o
 obj-$(CONFIG_KSDAZZLE_DONGLE)	+= ksdazzle-sir.o
+obj-$(CONFIG_KS959_DONGLE)    	+= ks959-sir.o
 
 # The SIR helper module
 sir-dev-objs := sir_dev.o sir_dongle.o

-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems? Stop. Now Search log events and configuration files using AJAX and a browser. Download your FREE copy of Splunk now >> http://get.splunk.com/

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

#2 lore raw

PATCH 1/3 MSG_NOSIGNAL support for IrDA sockets

In reply to Samuel Ortiz
---
 net/irda/af_irda.c |   21 ++++++++++++---------
 1 file changed, 12 insertions(+), 9 deletions(-)
net/irda/af_irda.c +12 -9
Index: net-2.6.24-quilt/net/irda/af_irda.c
===================================================================
@@ -1245,18 +1245,17 @@
 	struct sock *sk = sock->sk;
 	struct irda_sock *self;
 	struct sk_buff *skb;
-	int err;
+	int err = -EPIPE;
 
 	IRDA_DEBUG(4, "%s(), len=%zd\n", __FUNCTION__, len);
 
 	/* Note : socket.c set MSG_EOR on SEQPACKET sockets */
-	if (msg->msg_flags & ~(MSG_DONTWAIT|MSG_EOR|MSG_CMSG_COMPAT))
+	if (msg->msg_flags & ~(MSG_DONTWAIT | MSG_EOR | MSG_CMSG_COMPAT |
+			       MSG_NOSIGNAL))
 		return -EINVAL;
 
-	if (sk->sk_shutdown & SEND_SHUTDOWN) {
-		send_sig(SIGPIPE, current, 0);
-		return -EPIPE;
-	}
+	if (sk->sk_shutdown & SEND_SHUTDOWN)
+		goto out_err;
 
 	if (sk->sk_state != TCP_ESTABLISHED)
 		return -ENOTCONN;
@@ -1283,7 +1282,7 @@
 	skb = sock_alloc_send_skb(sk, len + self->max_header_size + 16,
 				  msg->msg_flags & MSG_DONTWAIT, &err);
 	if (!skb)
-		return -ENOBUFS;
+		goto out_err;
 
 	skb_reserve(skb, self->max_header_size + 16);
 	skb_reset_transport_header(skb);
@@ -1291,7 +1290,7 @@
 	err = memcpy_fromiovec(skb_transport_header(skb), msg->msg_iov, len);
 	if (err) {
 		kfree_skb(skb);
-		return err;
+		goto out_err;
 	}
 
 	/*
@@ -1301,10 +1300,14 @@
 	err = irttp_data_request(self->tsap, skb);
 	if (err) {
 		IRDA_DEBUG(0, "%s(), err=%d\n", __FUNCTION__, err);
-		return err;
+		goto out_err;
 	}
 	/* Tell client how much data we actually sent */
 	return len;
+
+ out_err:
+	return sk_stream_error(sk, msg->msg_flags, err);
+
 }
 
 /*
#3 lore raw

PATCH 2/3 Kingsun Dazzle IrDA USB driver

In reply to Samuel Ortiz

This dongle does not follow the usb-irda specification, so it needs its own special driver. Just like the Kingsun/Donshine dongle, it exposes two interrupt endpoints. Reception is performed through direct reads from the input endpoint. Transmission requires splitting the IrDA frames into 8-byte segments, in which the first byte encodes how many of the remaining 7 bytes are used as data. Speed change is made with a control URB just like the one in cypress_m8, and it seems to support up to 115200 bps.

On plugin, this dongle reports vendor and device IDs: 0x07d0:0x4100

---
 drivers/net/irda/Kconfig        |   12 
 drivers/net/irda/Makefile       |    1 
 drivers/net/irda/ksdazzle-sir.c |  823 ++++++++++++++++++++++++++++++++++++++++
 3 files changed, 836 insertions(+)
drivers/net/irda/Kconfig +12 -0
Index: net-2.6.24-quilt/drivers/net/irda/Kconfig
===================================================================
@@ -162,7 +162,19 @@
 	  Say Y here if you want to build support for the Cirrus logic
 	  EP7211 chipset's infrared module.
 
+config KSDAZZLE_DONGLE
+	tristate "KingSun Dazzle IrDA-USB dongle (EXPERIMENTAL)"
+	depends on IRDA && USB && EXPERIMENTAL
+	help
+	  Say Y or M here if you want to build support for the KingSun Dazzle
+	  IrDA-USB bridge device driver.
 
+	  This USB bridge does not conform to the IrDA-USB device class
+	  specification, and therefore needs its own specific driver. This
+	  dongle supports SIR speeds only (9600 through 115200 bps).
+
+	  To compile it as a module, choose M here: the module will be called
+	  ksdazzle-sir.
 
 comment "Old SIR device drivers"
 
drivers/net/irda/ksdazzle-sir.c new file +823 -0

823 lines not on this page · raw message

drivers/net/irda/Makefile +1 -0
Index: net-2.6.24-quilt/drivers/net/irda/Makefile
===================================================================
@@ -47,6 +47,7 @@
 obj-$(CONFIG_TOIM3232_DONGLE)	+= toim3232-sir.o
 obj-$(CONFIG_EP7211_DONGLE)	+= ep7211-sir.o
 obj-$(CONFIG_KINGSUN_DONGLE)	+= kingsun-sir.o
+obj-$(CONFIG_KSDAZZLE_DONGLE)	+= ksdazzle-sir.o
 
 # The SIR helper module
 sir-dev-objs := sir_dev.o sir_dongle.o