]> rtime.felk.cvut.cz Git - lincan.git/blob - lincan/src/boardlist.c
The LinCAN driver license unified according to DCE FEE CTU head and superiors request.
[lincan.git] / lincan / src / boardlist.c
1 /**************************************************************************/
2 /* File: boardslist.c - list to translate hardware option to board struct*/
3 /*                                                                        */
4 /* LinCAN - (Not only) Linux CAN bus driver                               */
5 /* Copyright (C) 2002-2009 DCE FEE CTU Prague <http://dce.felk.cvut.cz>   */
6 /* Copyright (C) 2002-2009 Pavel Pisa <pisa@cmp.felk.cvut.cz>             */
7 /* Funded by OCERA and FRESCOR IST projects                               */
8 /* Based on CAN driver code by Arnaud Westenberg <arnaud@wanadoo.nl>      */
9 /*                                                                        */
10 /* LinCAN is free software; you can redistribute it and/or modify it      */
11 /* under terms of the GNU General Public License as published by the      */
12 /* Free Software Foundation; either version 2, or (at your option) any    */
13 /* later version.  LinCAN is distributed in the hope that it will be      */
14 /* useful, but WITHOUT ANY WARRANTY; without even the implied warranty    */
15 /* of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU    */
16 /* General Public License for more details. You should have received a    */
17 /* copy of the GNU General Public License along with LinCAN; see file     */
18 /* COPYING. If not, write to the Free Software Foundation, 675 Mass Ave,  */
19 /* Cambridge, MA 02139, USA.                                              */
20 /*                                                                        */
21 /* To allow use of LinCAN in the compact embedded systems firmware        */
22 /* and RT-executives (RTEMS for example), main authors agree with next    */
23 /* special exception:                                                     */
24 /*                                                                        */
25 /* Including LinCAN header files in a file, instantiating LinCAN generics */
26 /* or templates, or linking other files with LinCAN objects to produce    */
27 /* an application image/executable, does not by itself cause the          */
28 /* resulting application image/executable to be covered by                */
29 /* the GNU General Public License.                                        */
30 /* This exception does not however invalidate any other reasons           */
31 /* why the executable file might be covered by the GNU Public License.    */
32 /* Publication of enhanced or derived LinCAN files is required although.  */
33 /**************************************************************************/
34
35 #include "../include/can.h"
36 #include "../include/can_sysdep.h"
37 #include "../include/main.h"
38
39 extern int template_register(struct hwspecops_t *hwspecops);
40 extern int virtual_register(struct hwspecops_t *hwspecops);
41 extern int oscar_register(struct hwspecops_t *hwspecops);
42 extern int pip_register(struct hwspecops_t *hwspecops);
43 extern int m437_register(struct hwspecops_t *hwspecops);
44 extern int smartcan_register(struct hwspecops_t *hwspecops);
45 extern int pccanf_register(struct hwspecops_t *hwspecops);
46 extern int pccand_register(struct hwspecops_t *hwspecops);
47 extern int pccanq_register(struct hwspecops_t *hwspecops);
48 extern int kv_pcican_register(struct hwspecops_t *hwspecops);
49 extern int ems_cpcpci_register(struct hwspecops_t *hwspecops);
50 extern int nsi_register(struct hwspecops_t *hwspecops);
51 extern int cc104_register(struct hwspecops_t *hwspecops);
52 extern int pci03_register(struct hwspecops_t *hwspecops);
53 extern int pcm3680_register(struct hwspecops_t *hwspecops);
54 extern int aim104_register(struct hwspecops_t *hwspecops);
55 extern int pcccan_register(struct hwspecops_t *hwspecops);
56 extern int ssv_register(struct hwspecops_t *hwspecops);
57 extern int bfadcan_register(struct hwspecops_t *hwspecops);
58 extern int gensja1000mm_register(struct hwspecops_t *hwspecops);
59 extern int gensja1000io_register(struct hwspecops_t *hwspecops);
60 extern int pimx1_register(struct hwspecops_t *hwspecops);
61 extern int msmcan_register(struct hwspecops_t *hwspecops);
62 extern int unican_register(struct hwspecops_t *hwspecops);
63 extern int unican_pci_register(struct hwspecops_t *hwspecops);
64 extern int unican_vme_register(struct hwspecops_t *hwspecops);
65 extern int ipci165_register(struct hwspecops_t *hwspecops);
66 extern int pcan_dongle_register(struct hwspecops_t *hwspecops);
67 extern int eb8245_register(struct hwspecops_t *hwspecops);
68 extern int adlink7841_register(struct hwspecops_t *hwspecops);
69 extern int tscan1_register(struct hwspecops_t *hwspecops);
70 extern int tscan1mmio_register(struct hwspecops_t *hwspecops);
71 extern int ts7kv_register(struct hwspecops_t *hwspecops);
72 extern int ns_dev_register(struct hwspecops_t *hwspecops);
73 extern int hms30c7202_register(struct hwspecops_t *hwspecops);
74 extern int nsi_canpci_register(struct hwspecops_t *hwspecops);
75 extern int usbcan_register(struct hwspecops_t *hwspecops);
76 extern int pcan_pci_register(struct hwspecops_t *hwspecops);
77 extern int esdpci200_register(struct hwspecops_t *hwspecops);
78 extern int esdpci266_register(struct hwspecops_t *hwspecops);
79 extern int sh7760_register(struct hwspecops_t *hwspecops);
80
81 const struct boardtype_t can_boardtypes[]={
82     #ifdef CONFIG_OC_LINCAN_CARD_template
83         {"template", template_register, 1},
84     #endif
85     #ifdef CONFIG_OC_LINCAN_CARD_virtual
86         {"virtual", virtual_register, 0},
87     #endif
88     #ifdef CONFIG_OC_LINCAN_CARD_oscar
89         {"oscar", oscar_register, 1},
90     #endif
91     #ifdef CONFIG_OC_LINCAN_CARD_pip
92         {"pip5", pip_register, 1},
93         {"pip6", pip_register, 1},
94         {"pip7", pip_register, 1},
95         {"pip8", pip_register, 1},
96     #endif
97     #ifdef CONFIG_OC_LINCAN_CARD_smartcan
98         {"smartcan", smartcan_register, 1},
99     #endif
100     #ifdef CONFIG_OC_LINCAN_CARD_nsi
101         {"nsican", nsi_register, 1},
102     #endif
103     #ifdef CONFIG_OC_LINCAN_CARD_cc_can104
104         {"cc104", cc104_register, 1},
105     #endif
106     #ifdef CONFIG_OC_LINCAN_CARD_aim104
107         {"aim104", aim104_register, 1},
108     #endif
109     #ifdef CONFIG_OC_LINCAN_CARD_pc_i03
110         {"pc-i03", pci03_register, 1},
111     #endif
112     #ifdef CONFIG_OC_LINCAN_CARD_pcm3680
113         {"pcm3680", pcm3680_register, 2},
114     #endif
115     #ifdef CONFIG_OC_LINCAN_CARD_pccan
116         {"pccan-f", pccanf_register, 1},
117         {"pccan-s", pccanf_register, 1},
118         {"pccan-d", pccand_register, 2},
119         {"pccan-q", pccanq_register, 4},
120     #endif
121     #if defined(CONFIG_OC_LINCAN_CARD_kv_pcican)&&defined(CAN_ENABLE_PCI_SUPPORT)
122         {"pcican-s", kv_pcican_register, 0},
123         {"pcican-d", kv_pcican_register, 0},
124         {"pcican-q", kv_pcican_register, 0},
125     #endif
126     #if defined(CONFIG_OC_LINCAN_CARD_ems_cpcpci)&&defined(CAN_ENABLE_PCI_SUPPORT)
127         {"ems_cpcpci", ems_cpcpci_register, 0},
128     #endif
129     #ifdef CONFIG_OC_LINCAN_CARD_m437
130         {"m437", m437_register, 1},
131     #endif
132     #ifdef CONFIG_OC_LINCAN_CARD_pcccan
133         {"pcccan", pcccan_register, 1},
134     #endif
135     #ifdef CONFIG_OC_LINCAN_CARD_ssv
136         {"ssv", ssv_register, 2},
137     #endif
138     #ifdef CONFIG_OC_LINCAN_CARD_bfadcan
139         {"bfadcan", bfadcan_register, 1},
140     #endif
141     #ifdef CONFIG_OC_LINCAN_CARD_gensja1000mm
142         {"gensja1000mm", gensja1000mm_register, 1},
143     #endif
144     #ifdef CONFIG_OC_LINCAN_CARD_gensja1000io
145         {"gensja1000io", gensja1000io_register, 1},
146     #endif
147     #ifdef CONFIG_OC_LINCAN_CARD_pimx1
148         {"pimx1", pimx1_register, 0},
149     #endif
150     #ifdef CONFIG_OC_LINCAN_CARD_msmcan
151         {"msmcan", msmcan_register, 1},
152     #endif
153     #ifdef CONFIG_OC_LINCAN_CARD_unican
154         {"unican", unican_register, 1},
155     #endif
156     #ifdef CONFIG_OC_LINCAN_CARD_ipci165
157         {"ipci165", ipci165_register, 0},
158     #endif
159     #if defined(CONFIG_OC_LINCAN_CARD_unican)&&defined(CAN_ENABLE_PCI_SUPPORT)
160         {"unican-pci", unican_pci_register, 0},
161     #endif
162     #if defined(CONFIG_OC_LINCAN_CARD_unican)&&defined(CAN_ENABLE_VME_SUPPORT)
163         {"unican-vme", unican_vme_register, 1},
164     #endif
165     #if defined(CONFIG_OC_LINCAN_CARD_pcan_dongle)
166         {"pcan_dongle", pcan_dongle_register, 1},
167     #endif
168     #if defined(CONFIG_OC_LINCAN_CARD_eb8245)
169         {"eb8245", eb8245_register, 1},
170     #endif
171     #if defined(CONFIG_OC_LINCAN_CARD_adlink7841)
172         {"adlink7841", adlink7841_register, 0},
173     #endif
174     #if defined(CONFIG_OC_LINCAN_CARD_esdpci200)
175         {"esdpci200", esdpci200_register, 0},
176     #endif
177     #if defined(CONFIG_OC_LINCAN_CARD_esdpci266)
178         {"esdpci266", esdpci200_register, 0},
179     #endif
180     #if defined(CONFIG_OC_LINCAN_CARD_tscan1)
181         {"tscan1", tscan1_register, 1},
182         {"tscan1mmio", tscan1mmio_register, 1},
183     #endif
184     #if defined(CONFIG_OC_LINCAN_CARD_ts7kv)
185         {"ts7kv",  ts7kv_register, 1},
186     #endif
187     #if defined(CONFIG_OC_LINCAN_CARD_ns_dev_can)
188         {"ns_dev", ns_dev_register, 1},
189     #endif
190     #if defined(CONFIG_OC_LINCAN_CARD_sh7760)
191         {"sh7760", sh7760_register, 2},
192     #endif
193     #if defined(CONFIG_OC_LINCAN_CARD_hms30c7202_can)
194         {"hms30c7202", hms30c7202_register, 1},
195     #endif
196     #if defined(CONFIG_OC_LINCAN_CARD_nsi_canpci)&&defined(CAN_ENABLE_PCI_SUPPORT)
197         {"nsicanpci", nsi_canpci_register, 1},
198     #endif
199     #if defined(CONFIG_OC_LINCAN_CARD_pcan_pci)&&defined(CAN_ENABLE_PCI_SUPPORT)
200         {"pcan_pci", pcan_pci_register, 0},
201     #endif
202     #if defined(CONFIG_OC_LINCAN_CARD_usbcan)
203         {"usbcan", usbcan_register, 0},
204     #endif
205         {NULL}
206 };
207
208 const struct boardtype_t* boardtype_find(const char *str)
209 {
210         const struct boardtype_t *brp;
211
212         for(brp=can_boardtypes;brp->boardtype;brp++) {
213                 if(!strcmp(str,brp->boardtype))
214                         return brp;
215         }
216
217         return NULL;
218 }