1 /*********************************************************************
5 * Description: Driver for the Extended Systems JetEye PC dongle
6 * Status: Experimental.
7 * Author: Thomas Davis, <ratbert@radiks.net>
8 * Created at: Sat Feb 21 18:54:38 1998
9 * Modified at: Sun May 16 14:35:21 1999
10 * Modified by: Dag Brattli <dagb@cs.uit.no>
13 * Copyright (c) 1998-1999, Dag Brattli, <dagb@cs.uit.no>
14 * Copyright (c) 1998, Thomas Davis, <ratbert@radiks.net>,
15 * All Rights Reserved.
17 * This program is free software; you can redistribute it and/or
18 * modify it under the terms of the GNU General Public License as
19 * published by the Free Software Foundation; either version 2 of
20 * the License, or (at your option) any later version.
22 * I, Thomas Davis, provide no warranty for any of this software.
23 * This material is provided "AS-IS" and at no charge.
25 ********************************************************************/
27 #include <linux/module.h>
29 #include <linux/delay.h>
30 #include <linux/tty.h>
31 #include <linux/sched.h>
32 #include <linux/init.h>
34 #include <net/irda/irda.h>
35 #include <net/irda/irmod.h>
36 #include <net/irda/irda_device.h>
37 #include <net/irda/irtty.h>
38 #include <net/irda/dongle.h>
40 static void esi_open(struct irda_device
*idev
, int type
);
41 static void esi_close(struct irda_device
*driver
);
42 static void esi_change_speed(struct irda_device
*idev
, int baud
);
43 static void esi_reset(struct irda_device
*idev
);
44 static void esi_qos_init(struct irda_device
*idev
, struct qos_info
*qos
);
46 static struct dongle dongle
= {
55 int __init
esi_init(void)
57 return irda_device_register_dongle(&dongle
);
60 void esi_cleanup(void)
62 irda_device_unregister_dongle(&dongle
);
65 static void esi_open(struct irda_device
*idev
, int type
)
67 strcat(idev
->description
, " <-> esi");
69 idev
->io
.dongle_id
= type
;
70 idev
->flags
|= IFF_DONGLE
;
75 static void esi_close(struct irda_device
*idev
)
77 /* Power off dongle */
78 irda_device_set_dtr_rts(idev
, FALSE
, FALSE
);
84 * Function esi_change_speed (tty, baud)
86 * Set the speed for the Extended Systems JetEye PC ESI-9680 type dongle
89 static void esi_change_speed(struct irda_device
*idev
, int baud
)
93 ASSERT(idev
!= NULL
, return;);
94 ASSERT(idev
->magic
== IRDA_DEVICE_MAGIC
, return;);
111 /* Change speed of dongle */
112 irda_device_set_dtr_rts(idev
, dtr
, rts
);
115 static void esi_reset( struct irda_device
*idev
)
121 * Function esi_qos_init (qos)
123 * Init QoS capabilities for the dongle
126 static void esi_qos_init(struct irda_device
*idev
, struct qos_info
*qos
)
128 qos
->baud_rate
.bits
&= IR_9600
|IR_19200
|IR_115200
;
129 qos
->min_turn_time
.bits
&= 0x01; /* Needs at least 10 ms */
134 MODULE_AUTHOR("Dag Brattli <dagb@cs.uit.no>");
135 MODULE_DESCRIPTION("Extended Systems JetEye PC dongle driver");
138 * Function init_module (void)
140 * Initialize ESI module
143 int init_module(void)
149 * Function cleanup_module (void)
154 void cleanup_module(void)