From 4ced33261f0bf4045ff6486e011ffea12edc3671 Mon Sep 17 00:00:00 2001 From: Yojiro Uo Date: Wed, 25 Mar 2009 15:02:14 +0000 Subject: add new umsm(4) device, Emobile D21LC (longcheer's OEM product) ok jsg@ fgsch@ --- sys/dev/usb/umsm.c | 24 ++++++++++++++++++++---- 1 file changed, 20 insertions(+), 4 deletions(-) diff --git a/sys/dev/usb/umsm.c b/sys/dev/usb/umsm.c index 254b2a35096..156fa515a94 100644 --- a/sys/dev/usb/umsm.c +++ b/sys/dev/usb/umsm.c @@ -1,4 +1,4 @@ -/* $OpenBSD: umsm.c,v 1.44 2009/02/24 13:23:03 yuo Exp $ */ +/* $OpenBSD: umsm.c,v 1.45 2009/03/25 15:02:13 yuo Exp $ */ /* * Copyright (c) 2008 Yojiro UO @@ -107,7 +107,8 @@ struct umsm_type { #define DEV_HUAWEI 0x0001 #define DEV_UMASS1 0x0010 #define DEV_UMASS2 0x0020 -#define DEV_UMASS (DEV_UMASS1 | DEV_UMASS2) +#define DEV_UMASS3 0x0040 +#define DEV_UMASS (DEV_UMASS1 | DEV_UMASS2 | DEV_UMASS3) }; static const struct umsm_type umsm_devs[] = { @@ -124,6 +125,9 @@ static const struct umsm_type umsm_devs[] = { {{ USB_VENDOR_HUAWEI, USB_PRODUCT_HUAWEI_E510 }, DEV_HUAWEI}, {{ USB_VENDOR_HUAWEI, USB_PRODUCT_HUAWEI_E618 }, DEV_HUAWEI}, + {{ USB_VENDOR_LONGCHEER, USB_PRODUCT_LONGCHEER_D21LCMASS }, DEV_UMASS3}, + {{ USB_VENDOR_LONGCHEER, USB_PRODUCT_LONGCHEER_D21LC }, 0}, + {{ USB_VENDOR_KYOCERA2, USB_PRODUCT_KYOCERA2_KPC650 }, 0}, /* XXX Some qualcomm devices are missing */ @@ -588,17 +592,29 @@ umsm_umass_changemode(struct umsm_softc *sc) cbw.bCBWLUN = 0; cbw.bCDBLength= 6; bzero(cbw.CBWCDB, sizeof(cbw.CBWCDB)); - cbw.CBWCDB[0] = UMASS_CMD_REZERO_UNIT; - cbw.CBWCDB[1] = 0x0; /* target LUN: 0 */ switch (sc->sc_flag) { case DEV_UMASS1: USETDW(cbw.dCBWDataTransferLength, 0x0); cbw.bCBWFlags = CBWFLAGS_OUT; + cbw.CBWCDB[0] = UMASS_CMD_REZERO_UNIT; + cbw.CBWCDB[1] = 0x0; /* target LUN: 0 */ break; case DEV_UMASS2: USETDW(cbw.dCBWDataTransferLength, 0x1); cbw.bCBWFlags = CBWFLAGS_IN; + cbw.CBWCDB[0] = UMASS_CMD_REZERO_UNIT; + cbw.CBWCDB[1] = 0x0; /* target LUN: 0 */ + break; + case DEV_UMASS3: /* longcheer */ + USETDW(cbw.dCBWDataTransferLength, 0x80); + cbw.bCBWFlags = CBWFLAGS_IN; + cbw.CBWCDB[0] = 0x06; + cbw.CBWCDB[1] = 0xf5; + cbw.CBWCDB[2] = 0x04; + cbw.CBWCDB[3] = 0x02; + cbw.CBWCDB[4] = 0x52; + cbw.CBWCDB[5] = 0x70; break; default: DPRINTF(("%s: unknown device type.\n", sc->sc_dev.dv_xname)); -- cgit v1.2.3