1/*
2 * Copyright (c) 2007-2008 by Michael Lotz
3 * Heavily based on the original usb_serial driver which is:
4 *
5 * Copyright (c) 2003-2004 by Siarzhuk Zharski <imker@gmx.li>
6 * Distributed under the terms of the MIT License.
7 *
8 * Authors:
9 *		Alexander von Gluck IV, kallisti5@unixzen.com
10 */
11#ifndef _USB_PROLIFIC_H_
12#define _USB_PROLIFIC_H_
13
14
15#include "ACM.h"
16
17
18/* supported vendor and product ids */
19#define VENDOR_PROLIFIC		0x067b
20#define VENDOR_ATEN			0x0557
21#define VENDOR_ELECOM		0x056e
22#define VENDOR_HAL			0x0b41
23#define VENDOR_IODATA		0x04bb
24#define VENDOR_RATOC		0x0584
25#define VENDOR_SOURCENEXT	0x0833
26#define VENDOR_TDK			0x04bf
27
28const usb_serial_device kProlificDevices[] = {
29	{VENDOR_PROLIFIC,	0x04bb, "PL2303 Serial adapter (IODATA USB-RSAQ2)"},
30	{VENDOR_PROLIFIC,	0x2303, "PL2303 Serial adapter (ATEN/IOGEAR UC232A)"},
31	{VENDOR_ATEN,		0x2008, "Aten Serial adapter"},
32	{VENDOR_ELECOM,		0x5003, "Elecom UC-SGT"},
33	{VENDOR_HAL,		0x0011, "HAL Corporation Crossam2+USB"},
34	{VENDOR_IODATA,		0x0a03, "I/O Data USB serial adapter USB-RSAQ1"},
35	{VENDOR_RATOC,		0xb000, "Ratoc USB serial adapter REX-USB60"},
36	{VENDOR_SOURCENEXT,	0x039f, "SOURCENEXT KeikaiDenwa 8"},
37	{VENDOR_SOURCENEXT,	0x039f, "SOURCENEXT KeikaiDenwa 8 with charger"},
38	{VENDOR_TDK,		0x0117, "TDK USB-PHS Adapter UHA6400"}
39};
40
41
42/* protocol defines */
43#define PROLIFIC_SET_REQUEST	0x01
44#define PROLIFIC_BUF_SIZE		256
45
46struct request_item;
47
48
49class ProlificDevice : public ACMDevice {
50public:
51								ProlificDevice(usb_device device,
52									uint16 vendorID, uint16 productID,
53									const char *description);
54
55virtual	status_t				AddDevice(const usb_configuration_info *config);
56
57virtual	status_t				ResetDevice();
58
59private:
60		status_t				SendRequestList(request_item *list, size_t length);
61
62		bool					fIsHX;
63};
64
65
66#endif //_USB_PROLIFIC_H_
67