1 #ifndef __PCAN_DONGLE_H__
2 #define __PCAN_DONGLE_H__
4 /****************************************************************************/
5 // Ingenieria Almudi (www.almudi.com)
6 // Ported to LinCAN by Jose Pascual RamÃrez (josepascual@almudi.com)
9 // Copyright (C) 2001,2002,2003,2004 PEAK System-Technik GmbH
11 // linux@peak-system.com
12 // www.peak-system.com
14 // This program is free software; you can redistribute it and/or modify
15 // it under the terms of the GNU General Public License as published by
16 // the Free Software Foundation; either version 2 of the License, or
17 // (at your option) any later version.
19 // This program is distributed in the hope that it will be useful,
20 // but WITHOUT ANY WARRANTY; without even the implied warranty of
21 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
22 // GNU General Public License for more details.
24 // You should have received a copy of the GNU General Public License
25 // along with this program; if not, write to the Free Software
26 // Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
28 // Maintainer(s): Klaus Hitschler (klaus.hitschler@gmx.de)
29 /****************************************************************************/
31 /****************************************************************************/
33 // all parts to handle device interface specific parts of pcan-dongle
35 // Revision 1.13 2004/04/11 22:03:29 klaus
38 // Revision 1.12 2003/03/02 10:58:07 klaus
39 // merged USB thread into main path
41 // Revision 1.11 2003/03/02 10:58:07 klaus
42 // merged USB thread into main path
44 // Revision 1.10.2.3 2003/01/29 20:34:20 klaus
45 // release_20030129_a and release_20030129_u released
47 // Revision 1.10.2.2 2003/01/29 20:34:19 klaus
48 // release_20030129_a and release_20030129_u released
50 // Revision 1.10.2.1 2003/01/28 23:28:26 klaus
51 // reorderd pcan_usb.c and pcan_usb_kernel.c, tidied up
53 // Revision 1.10 2002/01/30 20:54:27 klaus
54 // simple source file header change
56 /****************************************************************************/
58 /****************************************************************************/
59 // parameter wHardwareType, used by open
60 #define HW_ISA 1 // not supported with LINUX, 82C200 chip
61 #define HW_DONGLE_SJA 5
62 #define HW_DONGLE_SJA_EPP 6
63 #define HW_DONGLE_PRO 7 // not yet supported with LINUX
64 #define HW_DONGLE_PRO_EPP 8 // not yet supported with LINUX
65 #define HW_ISA_SJA 9 // use this also for PC/104
66 #define HW_PCI 10 // PCI carries always SJA1000 chips
67 #define HW_USB 11 // don't know if this is common over peak products
72 u32 dwPort; // the port of the transport layer
73 u16 wIrq; // the associated irq
74 struct pardevice *pardev; // points to the associated parallel port (PARPORT subsytem)
75 u16 wEcr; // ECR register in case of EPP
76 u8 ucOldDataContent; // the overwritten contents of the port registers
77 u8 ucOldControlContent;
81 u16 wInitStep; // device specific init state
82 u16 wType; // (number type) to distinguish sp and epp
83 int nMinor; // the associated minor
84 char *type; // the literal type of the device, info only
86 struct canchip_t *chip;
90 /****************************************************************************/
93 int pcan_dongle_request_io(struct candevice_t *candev);
94 int pcan_dongle_release_io(struct candevice_t *candev);
95 int pcan_dongle_reset(struct candevice_t *candev);
96 int pcan_dongle_init_hw_data(struct candevice_t *candev);
97 int pcan_dongle_init_chip_data(struct candevice_t *candev, int chipnr);
98 int pcan_dongle_init_obj_data(struct canchip_t *chip, int objnr);
99 void pcan_dongle_write_register(unsigned data, unsigned long address);
100 unsigned pcan_dongle_read_register(unsigned long address);
101 int pcan_dongle_program_irq(struct candevice_t *candev);
103 #endif // __PCAN_DONGLE_H__