1141cc406Sopenharmony_ci/* sane - Scanner Access Now Easy.
2141cc406Sopenharmony_ci
3141cc406Sopenharmony_ci   pieusb.h
4141cc406Sopenharmony_ci
5141cc406Sopenharmony_ci   Copyright (C) 2012-2015 Jan Vleeshouwers, Michael Rickmann, Klaus Kaempf
6141cc406Sopenharmony_ci
7141cc406Sopenharmony_ci   This file is part of the SANE package.
8141cc406Sopenharmony_ci
9141cc406Sopenharmony_ci   This program is free software; you can redistribute it and/or
10141cc406Sopenharmony_ci   modify it under the terms of the GNU General Public License as
11141cc406Sopenharmony_ci   published by the Free Software Foundation; either version 2 of the
12141cc406Sopenharmony_ci   License, or (at your option) any later version.
13141cc406Sopenharmony_ci
14141cc406Sopenharmony_ci   This program is distributed in the hope that it will be useful, but
15141cc406Sopenharmony_ci   WITHOUT ANY WARRANTY; without even the implied warranty of
16141cc406Sopenharmony_ci   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
17141cc406Sopenharmony_ci   General Public License for more details.
18141cc406Sopenharmony_ci
19141cc406Sopenharmony_ci   You should have received a copy of the GNU General Public License
20141cc406Sopenharmony_ci   along with this program.  If not, see <https://www.gnu.org/licenses/>.
21141cc406Sopenharmony_ci
22141cc406Sopenharmony_ci   As a special exception, the authors of SANE give permission for
23141cc406Sopenharmony_ci   additional uses of the libraries contained in this release of SANE.
24141cc406Sopenharmony_ci
25141cc406Sopenharmony_ci   The exception is that, if you link a SANE library with other files
26141cc406Sopenharmony_ci   to produce an executable, this does not by itself cause the
27141cc406Sopenharmony_ci   resulting executable to be covered by the GNU General Public
28141cc406Sopenharmony_ci   License.  Your use of that executable is in no way restricted on
29141cc406Sopenharmony_ci   account of linking the SANE library code into it.
30141cc406Sopenharmony_ci
31141cc406Sopenharmony_ci   This exception does not, however, invalidate any other reasons why
32141cc406Sopenharmony_ci   the executable file might be covered by the GNU General Public
33141cc406Sopenharmony_ci   License.
34141cc406Sopenharmony_ci
35141cc406Sopenharmony_ci   If you submit changes to SANE to the maintainers to be included in
36141cc406Sopenharmony_ci   a subsequent release, you agree by submitting the changes that
37141cc406Sopenharmony_ci   those changes may be distributed with this exception intact.
38141cc406Sopenharmony_ci
39141cc406Sopenharmony_ci   If you write modifications of your own for SANE, it is your choice
40141cc406Sopenharmony_ci   whether to permit this exception to apply to your modifications.
41141cc406Sopenharmony_ci   If you do not wish that, delete this exception notice.  */
42141cc406Sopenharmony_ci
43141cc406Sopenharmony_ci#ifndef PIEUSB_H
44141cc406Sopenharmony_ci#define	PIEUSB_H
45141cc406Sopenharmony_ci
46141cc406Sopenharmony_ci#include "../include/sane/config.h"
47141cc406Sopenharmony_ci#include <stdio.h>
48141cc406Sopenharmony_ci#include <stdlib.h>
49141cc406Sopenharmony_ci#include <string.h>
50141cc406Sopenharmony_ci#ifdef HAVE_UNISTD_H
51141cc406Sopenharmony_ci#include <unistd.h>
52141cc406Sopenharmony_ci#endif
53141cc406Sopenharmony_ci
54141cc406Sopenharmony_ci#define BACKEND_NAME pieusb
55141cc406Sopenharmony_ci
56141cc406Sopenharmony_ci#include "../include/sane/sane.h"
57141cc406Sopenharmony_ci#include "../include/sane/sanei_usb.h"
58141cc406Sopenharmony_ci#include "../include/sane/sanei_debug.h"
59141cc406Sopenharmony_ci
60141cc406Sopenharmony_ci
61141cc406Sopenharmony_ci#include "pieusb_scancmd.h"
62141cc406Sopenharmony_ci#include "pieusb_usb.h"
63141cc406Sopenharmony_ci
64141cc406Sopenharmony_ci
65141cc406Sopenharmony_ci/* --------------------------------------------------------------------------
66141cc406Sopenharmony_ci *
67141cc406Sopenharmony_ci * SUPPORTED DEVICES SPECIFICS
68141cc406Sopenharmony_ci *
69141cc406Sopenharmony_ci * --------------------------------------------------------------------------*/
70141cc406Sopenharmony_ci
71141cc406Sopenharmony_ci/* List of default supported scanners by vendor-id, product-id and model number.
72141cc406Sopenharmony_ci * A default list will be created in sane_init(), and entries in the config file
73141cc406Sopenharmony_ci *  will be added to it. */
74141cc406Sopenharmony_ci
75141cc406Sopenharmony_cistruct Pieusb_USB_Device_Entry
76141cc406Sopenharmony_ci{
77141cc406Sopenharmony_ci    SANE_Word vendor;		/* USB vendor identifier */
78141cc406Sopenharmony_ci    SANE_Word product;		/* USB product identifier */
79141cc406Sopenharmony_ci    SANE_Word model;		/* USB model number */
80141cc406Sopenharmony_ci    SANE_Int device_number;     /* USB device number if the device is present */
81141cc406Sopenharmony_ci    SANE_Int flags;             /* flags */
82141cc406Sopenharmony_ci};
83141cc406Sopenharmony_ci
84141cc406Sopenharmony_ciextern struct Pieusb_USB_Device_Entry* pieusb_supported_usb_device_list;
85141cc406Sopenharmony_ciextern struct Pieusb_USB_Device_Entry pieusb_supported_usb_device; /* for searching */
86141cc406Sopenharmony_ci
87141cc406Sopenharmony_cistruct Pieusb_Device_Definition;
88141cc406Sopenharmony_ciextern struct Pieusb_Device_Definition *pieusb_definition_list_head;
89141cc406Sopenharmony_ci
90141cc406Sopenharmony_ci/* Debug error levels */
91141cc406Sopenharmony_ci#define DBG_error        1      /* errors */
92141cc406Sopenharmony_ci#define DBG_warning      3      /* warnings */
93141cc406Sopenharmony_ci#define DBG_info         5      /* information */
94141cc406Sopenharmony_ci#define DBG_info_sane    7      /* information sane interface level */
95141cc406Sopenharmony_ci#define DBG_inquiry      8      /* inquiry data */
96141cc406Sopenharmony_ci#define DBG_info_proc    9      /* information pieusb backend functions */
97141cc406Sopenharmony_ci#define DBG_info_scan   11      /* information scanner commands */
98141cc406Sopenharmony_ci#define DBG_info_usb    13      /* information usb level functions */
99141cc406Sopenharmony_ci#define DBG_info_buffer 15      /* information buffer functions */
100141cc406Sopenharmony_ci
101141cc406Sopenharmony_ci/* R G B I */
102141cc406Sopenharmony_ci#define PLANES 4
103141cc406Sopenharmony_ci
104141cc406Sopenharmony_ci#endif	/* PIEUSB_H */
105