usb_serial: Add new Option driver

* Option devices are generally WWAN serial
  devices for 3G or lower.
* Picks up my CMOTECH Sprint 3G adaptor, need
  to wire up endpoints so disabled for now.
This commit is contained in:
Alexander von Gluck IV
2012-07-22 11:06:48 -05:00
parent 1236c746af
commit b3b04af940
4 changed files with 121 additions and 0 deletions
@@ -14,6 +14,7 @@ KernelAddon usb_serial :
ACM.cpp
FTDI.cpp
KLSI.cpp
Option.cpp
Prolific.cpp
Silicon.cpp
;
@@ -0,0 +1,37 @@
/*
* Copyright 2011-2012 Haiku, Inc. All rights reserved.
* Distributed under the terms of the MIT License.
*
* Authors:
* Alexander von Gluck IV, [email protected]
*/
#include "Option.h"
OptionDevice::OptionDevice(usb_device device, uint16 vendorID,
uint16 productID, const char *description)
:
ACMDevice(device, vendorID, productID, description)
{
TRACE_FUNCALLS("> OptionDevice found: %s\n", description);
}
status_t
OptionDevice::AddDevice(const usb_configuration_info *config)
{
TRACE_FUNCALLS("> OptionDevice::AddDevice(%08x, %08x)\n", this, config);
status_t status = B_OK;
return status;
}
status_t
OptionDevice::ResetDevice()
{
TRACE_FUNCALLS("> OptionDevice::ResetDevice(%08x)\n", this);
return B_OK;
}
@@ -0,0 +1,68 @@
/*
* Copyright 2011-2012 Haiku, Inc. All rights reserved.
* Distributed under the terms of the MIT License.
*
* Authors:
* Alexander von Gluck IV, [email protected]
*/
#ifndef _USB_OPTION_H_
#define _USB_OPTION_H_
#include "ACM.h"
/* supported vendor and product ids */
#define VENDOR_AIRPLUS 0x1011
#define VENDOR_ALCATEL 0x1bbb
#define VENDOR_ALINK 0x1e0e
#define VENDOR_AMOI 0x1614
#define VENDOR_ANYDATA 0x16d5
#define VENDOR_AXESSTEL 0x1726
#define VENDOR_BANDRICH 0x1A8D
#define VENDOR_BENQ 0x04a5
#define VENDOR_CELOT 0x211f
#define VENDOR_CMOTECH 0x16d8
#define VENDOR_DELL 0x413C
#define VENDOR_DLINK 0x1186
#define VENDOR_HAIER 0x201e
#define VENDOR_HUAWEI 0x12D1
#define VENDOR_KYOCERA 0x0c88
#define VENDOR_LG 0x1004
#define VENDOR_LONGCHEER 0x1c9e
#define VENDOR_MEDIATEK 0x0e8d
#define VENDOR_NOVATEL 0x1410
#define VENDOR_OLIVETTI 0x0b3c
#define VENDOR_ONDA 0x1ee8
#define VENDOR_OPTION 0x0AF0
#define VENDOR_QISDA 0x1da5
#define VENDOR_QUALCOMM 0x05C6
#define VENDOR_SAMSUNG 0x04e8
#define VENDOR_TELIT 0x1bc7
#define VENDOR_TLAYTECH 0x20B9
#define VENDOR_TOSHIBA 0x0930
#define VENDOR_VIETTEL 0x2262
#define VENDOR_YISO 0x0EAB
#define VENDOR_YUGA 0x257A
#define VENDOR_ZD 0x0685
#define VENDOR_ZTE 0x19d2
const usb_serial_device kOptionDevices[] = {
{VENDOR_CMOTECH, 0x6008, "CMOTECH CDMA Modem"},
{VENDOR_CMOTECH, 0x5553, "CMOTECH CDU550"},
{VENDOR_CMOTECH, 0x6512, "CMOTECH CDX650"}
};
class OptionDevice : public ACMDevice {
public:
OptionDevice(usb_device device,
uint16 vendorID, uint16 productID,
const char *description);
virtual status_t AddDevice(const usb_configuration_info *config);
virtual status_t ResetDevice();
};
#endif /*_USB_OPTION_H_ */
@@ -18,6 +18,7 @@
#include "ACM.h"
#include "FTDI.h"
#include "KLSI.h"
#include "Option.h"
#include "Prolific.h"
#include "Silicon.h"
@@ -759,6 +760,20 @@ SerialDevice::MakeDevice(usb_device device, uint16 vendorID,
}
}
#if 0
// Not yet working
// Option Serial Device
for (uint32 i = 0; i < sizeof(kOptionDevices)
/ sizeof(kOptionDevices[0]); i++) {
if (vendorID == kOptionDevices[i].vendorID
&& productID == kOptionDevices[i].productID) {
return new(std::nothrow) OptionDevice(device, vendorID, productID,
kOptionDevices[i].deviceName);
}
}
#endif
// Otherwise, return standard ACM device
return new(std::nothrow) ACMDevice(device, vendorID, productID,
"CDC ACM compatible device");