]> rtime.felk.cvut.cz Git - lincan.git/blob - lincan/src/boardlist.c
a52f2d4e3edad19c9be5fb0d3cdb494a6d362e59
[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 extern int mpc5200_register(struct hwspecops_t *hwspecops);
81
82 const struct boardtype_t can_boardtypes[]={
83     #ifdef CONFIG_OC_LINCAN_CARD_template
84         {"template", template_register, 1},
85     #endif
86     #ifdef CONFIG_OC_LINCAN_CARD_virtual
87         {"virtual", virtual_register, 0},
88     #endif
89     #ifdef CONFIG_OC_LINCAN_CARD_oscar
90         {"oscar", oscar_register, 1},
91     #endif
92     #ifdef CONFIG_OC_LINCAN_CARD_pip
93         {"pip5", pip_register, 1},
94         {"pip6", pip_register, 1},
95         {"pip7", pip_register, 1},
96         {"pip8", pip_register, 1},
97     #endif
98     #ifdef CONFIG_OC_LINCAN_CARD_smartcan
99         {"smartcan", smartcan_register, 1},
100     #endif
101     #ifdef CONFIG_OC_LINCAN_CARD_nsi
102         {"nsican", nsi_register, 1},
103     #endif
104     #ifdef CONFIG_OC_LINCAN_CARD_cc_can104
105         {"cc104", cc104_register, 1},
106     #endif
107     #ifdef CONFIG_OC_LINCAN_CARD_aim104
108         {"aim104", aim104_register, 1},
109     #endif
110     #ifdef CONFIG_OC_LINCAN_CARD_pc_i03
111         {"pc-i03", pci03_register, 1},
112     #endif
113     #ifdef CONFIG_OC_LINCAN_CARD_pcm3680
114         {"pcm3680", pcm3680_register, 2},
115     #endif
116     #ifdef CONFIG_OC_LINCAN_CARD_pccan
117         {"pccan-f", pccanf_register, 1},
118         {"pccan-s", pccanf_register, 1},
119         {"pccan-d", pccand_register, 2},
120         {"pccan-q", pccanq_register, 4},
121     #endif
122     #if defined(CONFIG_OC_LINCAN_CARD_kv_pcican)&&defined(CAN_ENABLE_PCI_SUPPORT)
123         {"pcican-s", kv_pcican_register, 0},
124         {"pcican-d", kv_pcican_register, 0},
125         {"pcican-q", kv_pcican_register, 0},
126     #endif
127     #if defined(CONFIG_OC_LINCAN_CARD_ems_cpcpci)&&defined(CAN_ENABLE_PCI_SUPPORT)
128         {"ems_cpcpci", ems_cpcpci_register, 0},
129     #endif
130     #ifdef CONFIG_OC_LINCAN_CARD_m437
131         {"m437", m437_register, 1},
132     #endif
133     #ifdef CONFIG_OC_LINCAN_CARD_pcccan
134         {"pcccan", pcccan_register, 1},
135     #endif
136     #ifdef CONFIG_OC_LINCAN_CARD_ssv
137         {"ssv", ssv_register, 2},
138     #endif
139     #ifdef CONFIG_OC_LINCAN_CARD_bfadcan
140         {"bfadcan", bfadcan_register, 1},
141     #endif
142     #ifdef CONFIG_OC_LINCAN_CARD_gensja1000mm
143         {"gensja1000mm", gensja1000mm_register, 1},
144     #endif
145     #ifdef CONFIG_OC_LINCAN_CARD_gensja1000io
146         {"gensja1000io", gensja1000io_register, 1},
147     #endif
148     #ifdef CONFIG_OC_LINCAN_CARD_pimx1
149         {"pimx1", pimx1_register, 0},
150     #endif
151     #ifdef CONFIG_OC_LINCAN_CARD_msmcan
152         {"msmcan", msmcan_register, 1},
153     #endif
154     #ifdef CONFIG_OC_LINCAN_CARD_unican
155         {"unican", unican_register, 1},
156     #endif
157     #ifdef CONFIG_OC_LINCAN_CARD_ipci165
158         {"ipci165", ipci165_register, 0},
159     #endif
160     #if defined(CONFIG_OC_LINCAN_CARD_unican)&&defined(CAN_ENABLE_PCI_SUPPORT)
161         {"unican-pci", unican_pci_register, 0},
162     #endif
163     #if defined(CONFIG_OC_LINCAN_CARD_unican)&&defined(CAN_ENABLE_VME_SUPPORT)
164         {"unican-vme", unican_vme_register, 1},
165     #endif
166     #if defined(CONFIG_OC_LINCAN_CARD_pcan_dongle)
167         {"pcan_dongle", pcan_dongle_register, 1},
168     #endif
169     #if defined(CONFIG_OC_LINCAN_CARD_eb8245)
170         {"eb8245", eb8245_register, 1},
171     #endif
172     #if defined(CONFIG_OC_LINCAN_CARD_adlink7841)
173         {"adlink7841", adlink7841_register, 0},
174     #endif
175     #if defined(CONFIG_OC_LINCAN_CARD_esdpci200)
176         {"esdpci200", esdpci200_register, 0},
177     #endif
178     #if defined(CONFIG_OC_LINCAN_CARD_esdpci266)
179         {"esdpci266", esdpci200_register, 0},
180     #endif
181     #if defined(CONFIG_OC_LINCAN_CARD_tscan1)
182         {"tscan1", tscan1_register, 1},
183         {"tscan1mmio", tscan1mmio_register, 1},
184     #endif
185     #if defined(CONFIG_OC_LINCAN_CARD_ts7kv)
186         {"ts7kv",  ts7kv_register, 1},
187     #endif
188     #if defined(CONFIG_OC_LINCAN_CARD_ns_dev_can)
189         {"ns_dev", ns_dev_register, 1},
190     #endif
191     #if defined(CONFIG_OC_LINCAN_CARD_sh7760)
192         {"sh7760", sh7760_register, 2},
193     #endif
194     #if defined(CONFIG_OC_LINCAN_CARD_hms30c7202_can)
195         {"hms30c7202", hms30c7202_register, 1},
196     #endif
197     #if defined(CONFIG_OC_LINCAN_CARD_nsi_canpci)&&defined(CAN_ENABLE_PCI_SUPPORT)
198         {"nsicanpci", nsi_canpci_register, 1},
199     #endif
200     #if defined(CONFIG_OC_LINCAN_CARD_pcan_pci)&&defined(CAN_ENABLE_PCI_SUPPORT)
201         {"pcan_pci", pcan_pci_register, 0},
202     #endif
203     #if defined(CONFIG_OC_LINCAN_CARD_usbcan)
204         {"usbcan", usbcan_register, 0},
205     #endif
206     #if defined(CONFIG_OC_LINCAN_CARD_mpc5200)
207         {"mpc5200", mpc5200_register, 0},
208     #else
209         #if defined(CONFIG_OC_LINCAN_CARD_mpc5200_midam)
210             {"mpc5200", mpc5200_register, 0},
211         #endif
212     #endif
213         {NULL}
214 };
215
216 const struct boardtype_t* boardtype_find(const char *str)
217 {
218         const struct boardtype_t *brp;
219
220         for(brp=can_boardtypes;brp->boardtype;brp++) {
221                 if(!strcmp(str,brp->boardtype))
222                         return brp;
223         }
224
225         return NULL;
226 }