lkml.org 
[lkml]   [2004]   [Jan]   [13]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH] IRDA device driver API 2.6 -> 2.4 backport
Date
Hi Jeff, all,

don' t know excactly where to send this to.
I had a little spare time this week as my doctor grounded me, so to
relax I did a bit of kernel hacking and get my notebook working. 8-)

This patch adds the "alloc_irdadev" primitive to Linux-2.4 . Modeled
after and code stolen from Linux-2.6 .
This enables practically drop-in addition of Linux-2.6 IRDA drivers
to Linux-2.4.

This patch is prerequisite for another patch from me which adds
via-ircc to the IRDA driver modules.

Patch against linux-2.4.24-0pre2.1mdk from current Mandrake Cooker.
Should apply to vanilla Linux-2.4.24 as well.

-- Jens



--
Jens David, DG1KJD
Email: dg1kjd@afthd.tu-darmstadt.de
http://www.afthd.tu-darmstadt.de/~dg1kjd
Work: +49 351 80800 527 --- Home/Mobile: +49 173 6394993




--- linux-2.4.24-0.pre2.1mdk.orig/include/net/irda/irda_device.h 2001-06-20 02:08:05.000000000 +0200
+++ linux-2.4.24-0.pre2.1mdk.copy/include/net/irda/irda_device.h 2004-01-13 12:12:44.000000000 +0100
@@ -169,6 +169,7 @@ int irda_device_set_raw_mode(struct net
int irda_device_set_dtr_rts(struct net_device *dev, int dtr, int rts);
int irda_device_change_speed(struct net_device *dev, __u32 speed);
int irda_device_setup(struct net_device *dev);
+struct net_device *alloc_irdadev(int sizeof_priv);

/* Dongle interface */
void irda_device_unregister_dongle(struct dongle_reg *dongle);
--- linux-2.4.24-0.pre2.1mdk.orig/net/irda/irda_device.c 2003-11-28 19:26:21.000000000 +0100
+++ linux-2.4.24-0.pre2.1mdk.copy/net/irda/irda_device.c 2004-01-11 00:25:09.000000000 +0100
@@ -461,6 +461,17 @@ int irda_device_setup(struct net_device
}

/*
+ * Funciton alloc_irdadev
+ * Allocates and sets up an IRDA device in a manner similar to
+ * alloc_etherdev.
+ */
+struct net_device *alloc_irdadev(int sizeof_priv)
+{
+ return alloc_netdev(sizeof_priv, "irda%d", irda_device_setup);
+}
+
+
+/*
* Function irda_device_txqueue_empty (dev)
*
* Check if there is still some frames in the transmit queue for this
--- linux-2.4.24-0.pre2.1mdk.orig/net/irda/irsyms.c 2003-08-25 13:44:44.000000000 +0200
+++ linux-2.4.24-0.pre2.1mdk.copy/net/irda/irsyms.c 2004-01-11 00:26:47.000000000 +0100
@@ -145,6 +145,7 @@ EXPORT_SYMBOL(irlap_close);
EXPORT_SYMBOL(irda_init_max_qos_capabilies);
EXPORT_SYMBOL(irda_qos_bits_to_value);
EXPORT_SYMBOL(irda_device_setup);
+EXPORT_SYMBOL(alloc_irdadev);
EXPORT_SYMBOL(irda_device_set_media_busy);
EXPORT_SYMBOL(irda_device_txqueue_empty);
\
 
 \ /
  Last update: 2005-03-22 14:00    [W:1.970 / U:1.072 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site