1 /*****************************************************************************\
3 pp.h - parallel port support for multi-point transport driver
5 (c) 2004-2007 Copyright Hewlett-Packard Development Company, LP
7 Permission is hereby granted, free of charge, to any person obtaining a copy
8 of this software and associated documentation files (the "Software"), to deal
9 in the Software without restriction, including without limitation the rights
10 to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
11 of the Software, and to permit persons to whom the Software is furnished to do
12 so, subject to the following conditions:
14 The above copyright notice and this permission notice shall be included in all
15 copies or substantial portions of the Software.
17 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
18 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
19 FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
20 COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
21 IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
22 WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
24 \*****************************************************************************/
29 #include <sys/ioctl.h>
30 #include <linux/parport.h>
31 #include <linux/ppdev.h>
36 * PC-style parallel port bit definitions.
42 * 5 - PError (PARPORT_STATUS_PAPEROUT)
45 * 3 - NFault (PARPORT_STATUS_ERROR)
65 * For ECP mode use low-level parport ioctl instead of high-level parport read/writes because its more reliable. High-level support
66 * for Compatible and Nibble modes are probably ok, but for consistency low-level parport ioctl is used.
70 #define PP_DEVICE_TIMEOUT 30000000 /* device timeout (us) */
71 //#define PP_SIGNAL_TIMEOUT 1000000 /* signal timeout (us), too long for 1ms timeout, DES 8/18/08 */
72 //#define PP_SIGNAL_TIMEOUT 1000 /* signal timeout (us), too short for DJ540, DES 8/18/08 */
73 #define PP_SIGNAL_TIMEOUT 100000 /* signal timeout (us), DES 8/18/08 */
74 #define PP_SETUP_TIMEOUT 10 /* setup timeout (us) */
79 extern struct _mud_device_vf __attribute__ ((visibility ("hidden"))) pp_mud_device_vf;
81 int __attribute__ ((visibility ("hidden"))) pp_write(int fd, const void *buf, int size, int usec);
82 int __attribute__ ((visibility ("hidden"))) pp_read(int fd, void *buf, int size, int usec);
83 enum HPMUD_RESULT __attribute__ ((visibility ("hidden"))) pp_open(struct _mud_device *pd);
84 enum HPMUD_RESULT __attribute__ ((visibility ("hidden"))) pp_close(struct _mud_device *pd);
85 enum HPMUD_RESULT __attribute__ ((visibility ("hidden"))) pp_get_device_id(struct _mud_device *pd, char *buf, int size, int *len);
86 enum HPMUD_RESULT __attribute__ ((visibility ("hidden"))) pp_get_device_status(struct _mud_device *pd, unsigned int *status);
87 enum HPMUD_RESULT __attribute__ ((visibility ("hidden"))) pp_channel_open(struct _mud_device *pd, const char *sn, HPMUD_CHANNEL *cd);
88 enum HPMUD_RESULT __attribute__ ((visibility ("hidden"))) pp_channel_close(struct _mud_device *pd, struct _mud_channel *pc);
90 enum HPMUD_RESULT __attribute__ ((visibility ("hidden"))) pp_raw_channel_open(struct _mud_channel *pc);
91 enum HPMUD_RESULT __attribute__ ((visibility ("hidden"))) pp_raw_channel_close(struct _mud_channel *pc);
92 enum HPMUD_RESULT __attribute__ ((visibility ("hidden"))) pp_mlc_channel_open(struct _mud_channel *pc);
93 enum HPMUD_RESULT __attribute__ ((visibility ("hidden"))) pp_mlc_channel_close(struct _mud_channel *pc);
94 enum HPMUD_RESULT __attribute__ ((visibility ("hidden"))) pp_dot4_channel_open(struct _mud_channel *pc);
95 enum HPMUD_RESULT __attribute__ ((visibility ("hidden"))) pp_dot4_channel_close(struct _mud_channel *pc);
97 int __attribute__ ((visibility ("hidden"))) pp_probe_devices(char *lst, int lst_size, int *cnt);