1 /**************************************************************************/
2 /* File: boardslist.c - list to translate hardware option to board struct */
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> */
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. */
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: */
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 /**************************************************************************/
35 #include "../include/can.h"
36 #include "../include/can_sysdep.h"
37 #include "../include/main.h"
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 extern int mpc5200_midam_register(struct hwspecops_t *hwspecops);
83 const struct boardtype_t can_boardtypes[]={
84 #ifdef CONFIG_OC_LINCAN_CARD_template
85 {"template", template_register, 1},
87 #ifdef CONFIG_OC_LINCAN_CARD_virtual
88 {"virtual", virtual_register, 0},
90 #ifdef CONFIG_OC_LINCAN_CARD_oscar
91 {"oscar", oscar_register, 1},
93 #ifdef CONFIG_OC_LINCAN_CARD_pip
94 {"pip5", pip_register, 1},
95 {"pip6", pip_register, 1},
96 {"pip7", pip_register, 1},
97 {"pip8", pip_register, 1},
99 #ifdef CONFIG_OC_LINCAN_CARD_smartcan
100 {"smartcan", smartcan_register, 1},
102 #ifdef CONFIG_OC_LINCAN_CARD_nsi
103 {"nsican", nsi_register, 1},
105 #ifdef CONFIG_OC_LINCAN_CARD_cc_can104
106 {"cc104", cc104_register, 1},
108 #ifdef CONFIG_OC_LINCAN_CARD_aim104
109 {"aim104", aim104_register, 1},
111 #ifdef CONFIG_OC_LINCAN_CARD_pc_i03
112 {"pc-i03", pci03_register, 1},
114 #ifdef CONFIG_OC_LINCAN_CARD_pcm3680
115 {"pcm3680", pcm3680_register, 2},
117 #ifdef CONFIG_OC_LINCAN_CARD_pccan
118 {"pccan-f", pccanf_register, 1},
119 {"pccan-s", pccanf_register, 1},
120 {"pccan-d", pccand_register, 2},
121 {"pccan-q", pccanq_register, 4},
123 #if defined(CONFIG_OC_LINCAN_CARD_kv_pcican)&&defined(CAN_ENABLE_PCI_SUPPORT)
124 {"pcican-s", kv_pcican_register, 0},
125 {"pcican-d", kv_pcican_register, 0},
126 {"pcican-q", kv_pcican_register, 0},
128 #if defined(CONFIG_OC_LINCAN_CARD_ems_cpcpci)&&defined(CAN_ENABLE_PCI_SUPPORT)
129 {"ems_cpcpci", ems_cpcpci_register, 0},
131 #ifdef CONFIG_OC_LINCAN_CARD_m437
132 {"m437", m437_register, 1},
134 #ifdef CONFIG_OC_LINCAN_CARD_pcccan
135 {"pcccan", pcccan_register, 1},
137 #ifdef CONFIG_OC_LINCAN_CARD_ssv
138 {"ssv", ssv_register, 2},
140 #ifdef CONFIG_OC_LINCAN_CARD_bfadcan
141 {"bfadcan", bfadcan_register, 1},
143 #ifdef CONFIG_OC_LINCAN_CARD_gensja1000mm
144 {"gensja1000mm", gensja1000mm_register, 1},
146 #ifdef CONFIG_OC_LINCAN_CARD_gensja1000io
147 {"gensja1000io", gensja1000io_register, 1},
149 #ifdef CONFIG_OC_LINCAN_CARD_pimx1
150 {"pimx1", pimx1_register, 0},
152 #ifdef CONFIG_OC_LINCAN_CARD_msmcan
153 {"msmcan", msmcan_register, 1},
155 #ifdef CONFIG_OC_LINCAN_CARD_unican
156 {"unican", unican_register, 1},
158 #ifdef CONFIG_OC_LINCAN_CARD_ipci165
159 {"ipci165", ipci165_register, 0},
161 #if defined(CONFIG_OC_LINCAN_CARD_unican)&&defined(CAN_ENABLE_PCI_SUPPORT)
162 {"unican-pci", unican_pci_register, 0},
164 #if defined(CONFIG_OC_LINCAN_CARD_unican)&&defined(CAN_ENABLE_VME_SUPPORT)
165 {"unican-vme", unican_vme_register, 1},
167 #if defined(CONFIG_OC_LINCAN_CARD_pcan_dongle)
168 {"pcan_dongle", pcan_dongle_register, 1},
170 #if defined(CONFIG_OC_LINCAN_CARD_eb8245)
171 {"eb8245", eb8245_register, 1},
173 #if defined(CONFIG_OC_LINCAN_CARD_adlink7841)
174 {"adlink7841", adlink7841_register, 0},
176 #if defined(CONFIG_OC_LINCAN_CARD_esdpci200)
177 {"esdpci200", esdpci200_register, 0},
179 #if defined(CONFIG_OC_LINCAN_CARD_esdpci266)
180 {"esdpci266", esdpci200_register, 0},
182 #if defined(CONFIG_OC_LINCAN_CARD_tscan1)
183 {"tscan1", tscan1_register, 1},
184 {"tscan1mmio", tscan1mmio_register, 1},
186 #if defined(CONFIG_OC_LINCAN_CARD_ts7kv)
187 {"ts7kv", ts7kv_register, 1},
189 #if defined(CONFIG_OC_LINCAN_CARD_ns_dev_can)
190 {"ns_dev", ns_dev_register, 1},
192 #if defined(CONFIG_OC_LINCAN_CARD_sh7760)
193 {"sh7760", sh7760_register, 2},
195 #if defined(CONFIG_OC_LINCAN_CARD_hms30c7202_can)
196 {"hms30c7202", hms30c7202_register, 1},
198 #if defined(CONFIG_OC_LINCAN_CARD_nsi_canpci)&&defined(CAN_ENABLE_PCI_SUPPORT)
199 {"nsicanpci", nsi_canpci_register, 1},
201 #if defined(CONFIG_OC_LINCAN_CARD_pcan_pci)&&defined(CAN_ENABLE_PCI_SUPPORT)
202 {"pcan_pci", pcan_pci_register, 0},
204 #if defined(CONFIG_OC_LINCAN_CARD_usbcan)
205 {"usbcan", usbcan_register, 0},
207 #if defined(CONFIG_OC_LINCAN_CARD_mpc5200)
208 {"mpc5200", mpc5200_register, 0},
209 {"mpc5200_midam", mpc5200_midam_register, 0},
214 const struct boardtype_t* boardtype_find(const char *str)
216 const struct boardtype_t *brp;
218 for(brp=can_boardtypes;brp->boardtype;brp++) {
219 if(!strcmp(str,brp->boardtype))