17aa661d4SMichael Lotz /* 27aa661d4SMichael Lotz * Copyright (c) 2007-2008 by Michael Lotz 37aa661d4SMichael Lotz * Heavily based on the original usb_serial driver which is: 47aa661d4SMichael Lotz * 57aa661d4SMichael Lotz * Copyright (c) 2003-2004 by Siarzhuk Zharski <imker@gmx.li> 67aa661d4SMichael Lotz * Distributed under the terms of the MIT License. 7*5ba5e31fSAlexander von Gluck IV * 8*5ba5e31fSAlexander von Gluck IV * Authors: 9*5ba5e31fSAlexander von Gluck IV * Alexander von Gluck IV, kallisti5@unixzen.com 107aa661d4SMichael Lotz */ 117aa661d4SMichael Lotz #ifndef _USB_PROLIFIC_H_ 127aa661d4SMichael Lotz #define _USB_PROLIFIC_H_ 137aa661d4SMichael Lotz 14*5ba5e31fSAlexander von Gluck IV 157aa661d4SMichael Lotz #include "ACM.h" 167aa661d4SMichael Lotz 17*5ba5e31fSAlexander von Gluck IV 187aa661d4SMichael Lotz /* supported vendor and product ids */ 197aa661d4SMichael Lotz #define VENDOR_PROLIFIC 0x067b 207aa661d4SMichael Lotz #define VENDOR_ATEN 0x0557 217aa661d4SMichael Lotz #define VENDOR_ELECOM 0x056e 227aa661d4SMichael Lotz #define VENDOR_HAL 0x0b41 23*5ba5e31fSAlexander von Gluck IV #define VENDOR_IODATA 0x04bb 24*5ba5e31fSAlexander von Gluck IV #define VENDOR_RATOC 0x0584 25*5ba5e31fSAlexander von Gluck IV #define VENDOR_SOURCENEXT 0x0833 26*5ba5e31fSAlexander von Gluck IV #define VENDOR_TDK 0x04bf 277aa661d4SMichael Lotz 28*5ba5e31fSAlexander von Gluck IV const usb_serial_device kProlificDevices[] = { 29*5ba5e31fSAlexander von Gluck IV {VENDOR_PROLIFIC, 0x04bb, "PL2303 Serial adapter (IODATA USB-RSAQ2)"}, 30*5ba5e31fSAlexander von Gluck IV {VENDOR_PROLIFIC, 0x2303, "PL2303 Serial adapter (ATEN/IOGEAR UC232A)"}, 31*5ba5e31fSAlexander von Gluck IV {VENDOR_ATEN, 0x2008, "Aten Serial adapter"}, 32*5ba5e31fSAlexander von Gluck IV {VENDOR_ELECOM, 0x5003, "Elecom UC-SGT"}, 33*5ba5e31fSAlexander von Gluck IV {VENDOR_HAL, 0x0011, "HAL Corporation Crossam2+USB"}, 34*5ba5e31fSAlexander von Gluck IV {VENDOR_IODATA, 0x0a03, "I/O Data USB serial adapter USB-RSAQ1"}, 35*5ba5e31fSAlexander von Gluck IV {VENDOR_RATOC, 0xb000, "Ratoc USB serial adapter REX-USB60"}, 36*5ba5e31fSAlexander von Gluck IV {VENDOR_SOURCENEXT, 0x039f, "SOURCENEXT KeikaiDenwa 8"}, 37*5ba5e31fSAlexander von Gluck IV {VENDOR_SOURCENEXT, 0x039f, "SOURCENEXT KeikaiDenwa 8 with charger"}, 38*5ba5e31fSAlexander von Gluck IV {VENDOR_TDK, 0x0117, "TDK USB-PHS Adapter UHA6400"} 39*5ba5e31fSAlexander von Gluck IV }; 40*5ba5e31fSAlexander von Gluck IV 417aa661d4SMichael Lotz 427aa661d4SMichael Lotz /* protocol defines */ 437aa661d4SMichael Lotz #define PROLIFIC_SET_REQUEST 0x01 447aa661d4SMichael Lotz #define PROLIFIC_BUF_SIZE 256 457aa661d4SMichael Lotz 467aa661d4SMichael Lotz struct request_item; 477aa661d4SMichael Lotz 487aa661d4SMichael Lotz 497aa661d4SMichael Lotz class ProlificDevice : public ACMDevice { 507aa661d4SMichael Lotz public: 517aa661d4SMichael Lotz ProlificDevice(usb_device device, 527aa661d4SMichael Lotz uint16 vendorID, uint16 productID, 537aa661d4SMichael Lotz const char *description); 547aa661d4SMichael Lotz 557aa661d4SMichael Lotz virtual status_t AddDevice(const usb_configuration_info *config); 567aa661d4SMichael Lotz 577aa661d4SMichael Lotz virtual status_t ResetDevice(); 587aa661d4SMichael Lotz 597aa661d4SMichael Lotz private: 607aa661d4SMichael Lotz status_t SendRequestList(request_item *list, size_t length); 617aa661d4SMichael Lotz 627aa661d4SMichael Lotz bool fIsHX; 637aa661d4SMichael Lotz }; 647aa661d4SMichael Lotz 65*5ba5e31fSAlexander von Gluck IV 667aa661d4SMichael Lotz #endif //_USB_PROLIFIC_H_ 67