]> git.kernelconcepts.de Git - karo-tx-redboot.git/blob - packages/io/usb/serial/slave/v2_0/host/linux/ecos_usbserial.c
Initial revision
[karo-tx-redboot.git] / packages / io / usb / serial / slave / v2_0 / host / linux / ecos_usbserial.c
1 //==========================================================================
2 //
3 //      ecos_usbserial.c
4 //
5 //      Kernel driver for the eCos USB serial driver
6 //
7 //==========================================================================
8 //####ECOSGPLCOPYRIGHTBEGIN####
9 // -------------------------------------------
10 // This file is part of eCos, the Embedded Configurable Operating System.
11 //
12 // eCos is free software; you can redistribute it and/or modify it under
13 // the terms of the GNU General Public License as published by the Free
14 // Software Foundation; either version 2 or (at your option) any later version.
15 //
16 // eCos is distributed in the hope that it will be useful, but WITHOUT ANY
17 // WARRANTY; without even the implied warranty of MERCHANTABILITY or
18 // FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
19 // for more details.
20 //
21 // You should have received a copy of the GNU General Public License along
22 // with eCos; if not, write to the Free Software Foundation, Inc.,
23 // 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
24 //
25 // As a special exception, if other files instantiate templates or use macros
26 // or inline functions from this file, or you compile this file and link it
27 // with other works to produce a work based on this file, this file does not
28 // by itself cause the resulting work to be covered by the GNU General Public
29 // License. However the source code for this file must still be made available
30 // in accordance with section (3) of the GNU General Public License.
31 //
32 // This exception does not invalidate any other reasons why a work based on
33 // this file might be covered by the GNU General Public License.
34 //
35 // -------------------------------------------
36 //####ECOSGPLCOPYRIGHTEND####
37 //===========================================================================
38 //#####DESCRIPTIONBEGIN####
39 //
40 // Author(s):    Frank M. Pagliughi (fmp), SoRo Systems, Inc.
41 // Contributors: 
42 // Date:         2008-06-02
43 // Description:  Kernel driver for the eCos USB serial driver
44 //
45 //####DESCRIPTIONEND####
46 //===========================================================================
47
48 #include <linux/kernel.h>
49 #include <linux/init.h>
50 #include <linux/tty.h>
51 #include <linux/module.h>
52 #include <linux/usb.h>
53 #include <linux/usb/serial.h>
54
55 #define VENDOR_ID       0xFFFF
56 #define PRODUCT_ID      1
57
58 static struct usb_device_id id_table[] = {
59         { USB_DEVICE(VENDOR_ID, PRODUCT_ID) },
60         { }
61 };
62
63 MODULE_DEVICE_TABLE(usb, id_table);
64
65 static struct usb_driver ecos_usbserial_driver = {
66         .name           = "ecos_usbserial",
67         .probe          = usb_serial_probe,
68         .disconnect     = usb_serial_disconnect,
69         .id_table       = id_table
70 };
71
72 static struct usb_serial_driver ecos_usbserial_device = {
73         .driver = {
74                 .owner                  = THIS_MODULE,
75                 .name                   = "ecos_usbserial",
76         },
77         .id_table                       = id_table, 
78         .num_interrupt_in       = NUM_DONT_CARE,
79         .num_bulk_in            = NUM_DONT_CARE,
80         .num_bulk_out           = NUM_DONT_CARE,
81         .num_ports                      = 1
82 };
83
84 static int __init ecos_usbserial_init(void)
85 {
86         int retval;
87
88         retval = usb_serial_register(&ecos_usbserial_device);
89         if (retval)
90                 return retval;
91
92         retval = usb_register(&ecos_usbserial_driver);
93         if (retval) {
94                 usb_serial_deregister(&ecos_usbserial_device);
95                 return retval;
96         }
97
98         return 0;
99 }
100
101 static void __exit ecos_usbserial_exit(void)
102 {
103         usb_deregister(&ecos_usbserial_driver);
104         usb_serial_deregister(&ecos_usbserial_device);
105 }
106
107 module_init(ecos_usbserial_init);
108 module_exit(ecos_usbserial_exit);
109
110 MODULE_LICENSE("GPL");
111