uslcom(4): fix for CP2110 USB HID-UART misdetection

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

uslcom(4): fix for CP2110 USB HID-UART misdetection

SASANO Takayoshi
Hi all,

I bought Silicon Labs CP2110-EK USB HID-to-UART evaluation kit
and connected to OpenBSD box.

uslcom(4) tries to use CP2110, but the device is different from
CP210x series.

How about to fix usbdevs and uslcom.c like this?

----
Index: usbdevs
===================================================================
RCS file: /cvs/src/sys/dev/usb/usbdevs,v
retrieving revision 1.639
diff -u -p -r1.639 usbdevs
--- usbdevs 31 Oct 2014 21:17:42 -0000 1.639
+++ usbdevs 17 Nov 2014 20:04:44 -0000
@@ -3812,7 +3812,7 @@ product SILABS3 GPRS_MODEM 0xea61 GPRS M
 product SILABS4 100EU_MODEM 0xea61 GPRS Modem 100EU
 product SILABS CP210X_3 0xea70 CP210x Serial
 product SILABS INFINITY_MIC 0xea71 Infinity GPS-MIC-1
-product SILABS CP210X_4 0xea80 CP210x Serial
+product SILABS CP2110 0xea80 CP2110 USB HID Serial
 product SILABS USBSCOPE50 0xf001 USBscope50
 product SILABS USBWAVE12 0xf002 USBwave12
 product SILABS USBPULSE100 0xf003 USBpulse100
Index: uslcom.c
===================================================================
RCS file: /cvs/src/sys/dev/usb/uslcom.c,v
retrieving revision 1.31
diff -u -p -r1.31 uslcom.c
--- uslcom.c 12 Jul 2014 21:24:33 -0000 1.31
+++ uslcom.c 17 Nov 2014 20:04:46 -0000
@@ -165,7 +165,6 @@ static const struct usb_devno uslcom_dev
  { USB_VENDOR_SILABS, USB_PRODUCT_SILABS_CP210X_1 },
  { USB_VENDOR_SILABS, USB_PRODUCT_SILABS_CP210X_2 },
  { USB_VENDOR_SILABS, USB_PRODUCT_SILABS_CP210X_3 },
- { USB_VENDOR_SILABS, USB_PRODUCT_SILABS_CP210X_4 },
  { USB_VENDOR_SILABS, USB_PRODUCT_SILABS_CRUMB128 },
  { USB_VENDOR_SILABS, USB_PRODUCT_SILABS_CYGNAL },
  { USB_VENDOR_SILABS, USB_PRODUCT_SILABS_CYGNAL_DEBUG },
----

Here is the dmesg when connected CP2110EK before/after fix.

(before)
uslcom0 at uhub3 port 3 "Silicon Laboratories CP2110 HID USB-to-UART Bridge" rev 2.00/1.00 addr 2
uslcom0: missing endpoint

(after)
uhidev0 at uhub1 port 2 configuration 1 interface 0 "Silicon Laboratories CP2110 HID USB-to-UART Bridge" rev 2.00/1.00 addr 2
uhidev0: iclass 3/0, 102 report ids
uhid0 at uhidev0 reportid 1: input=1, output=1, feature=0
uhid1 at uhidev0 reportid 2: input=2, output=2, feature=0
uhid2 at uhidev0 reportid 3: input=3, output=3, feature=0
uhid3 at uhidev0 reportid 4: input=4, output=4, feature=0
uhid4 at uhidev0 reportid 5: input=5, output=5, feature=0
uhid5 at uhidev0 reportid 6: input=6, output=6, feature=0
uhid6 at uhidev0 reportid 7: input=7, output=7, feature=0
uhid7 at uhidev0 reportid 8: input=8, output=8, feature=0
uhid8 at uhidev0 reportid 9: input=9, output=9, feature=0
uhid9 at uhidev0 reportid 10: input=10, output=10, feature=0
uhid10 at uhidev0 reportid 11: input=11, output=11, feature=0
uhid11 at uhidev0 reportid 12: input=12, output=12, feature=0
uhid12 at uhidev0 reportid 13: input=13, output=13, feature=0
uhid13 at uhidev0 reportid 14: input=14, output=14, feature=0
uhid14 at uhidev0 reportid 15: input=15, output=15, feature=0
uhid15 at uhidev0 reportid 16: input=16, output=16, feature=0
uhid16 at uhidev0 reportid 17: input=17, output=17, feature=0
uhid17 at uhidev0 reportid 18: input=18, output=18, feature=0
uhid18 at uhidev0 reportid 19: input=19, output=19, feature=0
uhid19 at uhidev0 reportid 20: input=20, output=20, feature=0
uhid20 at uhidev0 reportid 21: input=21, output=21, feature=0
uhid21 at uhidev0 reportid 22: input=22, output=22, feature=0
uhid22 at uhidev0 reportid 23: input=23, output=23, feature=0
uhid23 at uhidev0 reportid 24: input=24, output=24, feature=0
uhid24 at uhidev0 reportid 25: input=25, output=25, feature=0
uhid25 at uhidev0 reportid 26: input=26, output=26, feature=0
uhid26 at uhidev0 reportid 27: input=27, output=27, feature=0
uhid27 at uhidev0 reportid 28: input=28, output=28, feature=0
uhid28 at uhidev0 reportid 29: input=29, output=29, feature=0
uhid29 at uhidev0 reportid 30: input=30, output=30, feature=0
uhid30 at uhidev0 reportid 31: input=31, output=31, feature=0
uhid31 at uhidev0 reportid 32: input=32, output=32, feature=0
uhid32 at uhidev0 reportid 33: input=33, output=33, feature=0
uhid33 at uhidev0 reportid 34: input=34, output=34, feature=0
uhid34 at uhidev0 reportid 35: input=35, output=35, feature=0
uhid35 at uhidev0 reportid 36: input=36, output=36, feature=0
uhid36 at uhidev0 reportid 37: input=37, output=37, feature=0
uhid37 at uhidev0 reportid 38: input=38, output=38, feature=0
uhid38 at uhidev0 reportid 39: input=39, output=39, feature=0
uhid39 at uhidev0 reportid 40: input=40, output=40, feature=0
uhid40 at uhidev0 reportid 41: input=41, output=41, feature=0
uhid41 at uhidev0 reportid 42: input=42, output=42, feature=0
uhid42 at uhidev0 reportid 43: input=43, output=43, feature=0
uhid43 at uhidev0 reportid 44: input=44, output=44, feature=0
uhid44 at uhidev0 reportid 45: input=45, output=45, feature=0
uhid45 at uhidev0 reportid 46: input=46, output=46, feature=0
uhid46 at uhidev0 reportid 47: input=47, output=47, feature=0
uhid47 at uhidev0 reportid 48: input=48, output=48, feature=0
uhid48 at uhidev0 reportid 49: input=49, output=49, feature=0
uhid49 at uhidev0 reportid 50: input=50, output=50, feature=0
uhid50 at uhidev0 reportid 51: input=51, output=51, feature=0
uhid51 at uhidev0 reportid 52: input=52, output=52, feature=0
uhid52 at uhidev0 reportid 53: input=53, output=53, feature=0
uhid53 at uhidev0 reportid 54: input=54, output=54, feature=0
uhid54 at uhidev0 reportid 55: input=55, output=55, feature=0
uhid55 at uhidev0 reportid 56: input=56, output=56, feature=0
uhid56 at uhidev0 reportid 57: input=57, output=57, feature=0
uhid57 at uhidev0 reportid 58: input=58, output=58, feature=0
uhid58 at uhidev0 reportid 59: input=59, output=59, feature=0
uhid59 at uhidev0 reportid 60: input=60, output=60, feature=0
uhid60 at uhidev0 reportid 61: input=61, output=61, feature=0
uhid61 at uhidev0 reportid 62: input=62, output=62, feature=0
uhid62 at uhidev0 reportid 63: input=63, output=63, feature=0
uhid63 at uhidev0 reportid 64: input=0, output=0, feature=1
uhid64 at uhidev0 reportid 65: input=0, output=0, feature=1
uhid65 at uhidev0 reportid 66: input=0, output=0, feature=6
uhid66 at uhidev0 reportid 67: input=0, output=0, feature=1
uhid67 at uhidev0 reportid 68: input=0, output=0, feature=2
uhid68 at uhidev0 reportid 69: input=0, output=0, feature=4
uhid69 at uhidev0 reportid 70: input=0, output=0, feature=2
uhid70 at uhidev0 reportid 71: input=0, output=0, feature=2
uhid71 at uhidev0 reportid 80: input=0, output=0, feature=8
uhid72 at uhidev0 reportid 81: input=0, output=0, feature=1
uhid73 at uhidev0 reportid 82: input=0, output=0, feature=1
uhid74 at uhidev0 reportid 96: input=0, output=0, feature=10
uhid75 at uhidev0 reportid 97: input=0, output=0, feature=63
uhid76 at uhidev0 reportid 98: input=0, output=0, feature=63
uhid77 at uhidev0 reportid 99: input=0, output=0, feature=63
uhid78 at uhidev0 reportid 100: input=0, output=0, feature=63
uhid79 at uhidev0 reportid 101: input=0, output=0, feature=62
uhid80 at uhidev0 reportid 102: input=0, output=0, feature=19

Regards,
--
SASANO Takayoshi <[hidden email]>

Reply | Threaded
Open this post in threaded view
|

Re: uslcom(4): fix for CP2110 USB HID-UART misdetection

Martin Pieuchot-2
On 18/11/14(Tue) 05:25, SASANO Takayoshi wrote:
> Hi all,
>
> I bought Silicon Labs CP2110-EK USB HID-to-UART evaluation kit
> and connected to OpenBSD box.
>
> uslcom(4) tries to use CP2110, but the device is different from
> CP210x series.

I agree this is a totally different device are you working on a kernel
driver?  The AN434 document should be enough, right?  By the way, this
device is another example that the model "1 driver" per  reportID is no
longer valid.

> How about to fix usbdevs and uslcom.c like this?

ok mpi@

>
> ----
> Index: usbdevs
> ===================================================================
> RCS file: /cvs/src/sys/dev/usb/usbdevs,v
> retrieving revision 1.639
> diff -u -p -r1.639 usbdevs
> --- usbdevs 31 Oct 2014 21:17:42 -0000 1.639
> +++ usbdevs 17 Nov 2014 20:04:44 -0000
> @@ -3812,7 +3812,7 @@ product SILABS3 GPRS_MODEM 0xea61 GPRS M
>  product SILABS4 100EU_MODEM 0xea61 GPRS Modem 100EU
>  product SILABS CP210X_3 0xea70 CP210x Serial
>  product SILABS INFINITY_MIC 0xea71 Infinity GPS-MIC-1
> -product SILABS CP210X_4 0xea80 CP210x Serial
> +product SILABS CP2110 0xea80 CP2110 USB HID Serial
>  product SILABS USBSCOPE50 0xf001 USBscope50
>  product SILABS USBWAVE12 0xf002 USBwave12
>  product SILABS USBPULSE100 0xf003 USBpulse100
> Index: uslcom.c
> ===================================================================
> RCS file: /cvs/src/sys/dev/usb/uslcom.c,v
> retrieving revision 1.31
> diff -u -p -r1.31 uslcom.c
> --- uslcom.c 12 Jul 2014 21:24:33 -0000 1.31
> +++ uslcom.c 17 Nov 2014 20:04:46 -0000
> @@ -165,7 +165,6 @@ static const struct usb_devno uslcom_dev
>   { USB_VENDOR_SILABS, USB_PRODUCT_SILABS_CP210X_1 },
>   { USB_VENDOR_SILABS, USB_PRODUCT_SILABS_CP210X_2 },
>   { USB_VENDOR_SILABS, USB_PRODUCT_SILABS_CP210X_3 },
> - { USB_VENDOR_SILABS, USB_PRODUCT_SILABS_CP210X_4 },
>   { USB_VENDOR_SILABS, USB_PRODUCT_SILABS_CRUMB128 },
>   { USB_VENDOR_SILABS, USB_PRODUCT_SILABS_CYGNAL },
>   { USB_VENDOR_SILABS, USB_PRODUCT_SILABS_CYGNAL_DEBUG },
> ----
>
> Here is the dmesg when connected CP2110EK before/after fix.
>
> (before)
> uslcom0 at uhub3 port 3 "Silicon Laboratories CP2110 HID USB-to-UART Bridge" rev 2.00/1.00 addr 2
> uslcom0: missing endpoint
>
> (after)
> uhidev0 at uhub1 port 2 configuration 1 interface 0 "Silicon Laboratories CP2110 HID USB-to-UART Bridge" rev 2.00/1.00 addr 2
> uhidev0: iclass 3/0, 102 report ids
> uhid0 at uhidev0 reportid 1: input=1, output=1, feature=0
> uhid1 at uhidev0 reportid 2: input=2, output=2, feature=0
> uhid2 at uhidev0 reportid 3: input=3, output=3, feature=0
> uhid3 at uhidev0 reportid 4: input=4, output=4, feature=0
> uhid4 at uhidev0 reportid 5: input=5, output=5, feature=0
> uhid5 at uhidev0 reportid 6: input=6, output=6, feature=0
> uhid6 at uhidev0 reportid 7: input=7, output=7, feature=0
> uhid7 at uhidev0 reportid 8: input=8, output=8, feature=0
> uhid8 at uhidev0 reportid 9: input=9, output=9, feature=0
> uhid9 at uhidev0 reportid 10: input=10, output=10, feature=0
> uhid10 at uhidev0 reportid 11: input=11, output=11, feature=0
> uhid11 at uhidev0 reportid 12: input=12, output=12, feature=0
> uhid12 at uhidev0 reportid 13: input=13, output=13, feature=0
> uhid13 at uhidev0 reportid 14: input=14, output=14, feature=0
> uhid14 at uhidev0 reportid 15: input=15, output=15, feature=0
> uhid15 at uhidev0 reportid 16: input=16, output=16, feature=0
> uhid16 at uhidev0 reportid 17: input=17, output=17, feature=0
> uhid17 at uhidev0 reportid 18: input=18, output=18, feature=0
> uhid18 at uhidev0 reportid 19: input=19, output=19, feature=0
> uhid19 at uhidev0 reportid 20: input=20, output=20, feature=0
> uhid20 at uhidev0 reportid 21: input=21, output=21, feature=0
> uhid21 at uhidev0 reportid 22: input=22, output=22, feature=0
> uhid22 at uhidev0 reportid 23: input=23, output=23, feature=0
> uhid23 at uhidev0 reportid 24: input=24, output=24, feature=0
> uhid24 at uhidev0 reportid 25: input=25, output=25, feature=0
> uhid25 at uhidev0 reportid 26: input=26, output=26, feature=0
> uhid26 at uhidev0 reportid 27: input=27, output=27, feature=0
> uhid27 at uhidev0 reportid 28: input=28, output=28, feature=0
> uhid28 at uhidev0 reportid 29: input=29, output=29, feature=0
> uhid29 at uhidev0 reportid 30: input=30, output=30, feature=0
> uhid30 at uhidev0 reportid 31: input=31, output=31, feature=0
> uhid31 at uhidev0 reportid 32: input=32, output=32, feature=0
> uhid32 at uhidev0 reportid 33: input=33, output=33, feature=0
> uhid33 at uhidev0 reportid 34: input=34, output=34, feature=0
> uhid34 at uhidev0 reportid 35: input=35, output=35, feature=0
> uhid35 at uhidev0 reportid 36: input=36, output=36, feature=0
> uhid36 at uhidev0 reportid 37: input=37, output=37, feature=0
> uhid37 at uhidev0 reportid 38: input=38, output=38, feature=0
> uhid38 at uhidev0 reportid 39: input=39, output=39, feature=0
> uhid39 at uhidev0 reportid 40: input=40, output=40, feature=0
> uhid40 at uhidev0 reportid 41: input=41, output=41, feature=0
> uhid41 at uhidev0 reportid 42: input=42, output=42, feature=0
> uhid42 at uhidev0 reportid 43: input=43, output=43, feature=0
> uhid43 at uhidev0 reportid 44: input=44, output=44, feature=0
> uhid44 at uhidev0 reportid 45: input=45, output=45, feature=0
> uhid45 at uhidev0 reportid 46: input=46, output=46, feature=0
> uhid46 at uhidev0 reportid 47: input=47, output=47, feature=0
> uhid47 at uhidev0 reportid 48: input=48, output=48, feature=0
> uhid48 at uhidev0 reportid 49: input=49, output=49, feature=0
> uhid49 at uhidev0 reportid 50: input=50, output=50, feature=0
> uhid50 at uhidev0 reportid 51: input=51, output=51, feature=0
> uhid51 at uhidev0 reportid 52: input=52, output=52, feature=0
> uhid52 at uhidev0 reportid 53: input=53, output=53, feature=0
> uhid53 at uhidev0 reportid 54: input=54, output=54, feature=0
> uhid54 at uhidev0 reportid 55: input=55, output=55, feature=0
> uhid55 at uhidev0 reportid 56: input=56, output=56, feature=0
> uhid56 at uhidev0 reportid 57: input=57, output=57, feature=0
> uhid57 at uhidev0 reportid 58: input=58, output=58, feature=0
> uhid58 at uhidev0 reportid 59: input=59, output=59, feature=0
> uhid59 at uhidev0 reportid 60: input=60, output=60, feature=0
> uhid60 at uhidev0 reportid 61: input=61, output=61, feature=0
> uhid61 at uhidev0 reportid 62: input=62, output=62, feature=0
> uhid62 at uhidev0 reportid 63: input=63, output=63, feature=0
> uhid63 at uhidev0 reportid 64: input=0, output=0, feature=1
> uhid64 at uhidev0 reportid 65: input=0, output=0, feature=1
> uhid65 at uhidev0 reportid 66: input=0, output=0, feature=6
> uhid66 at uhidev0 reportid 67: input=0, output=0, feature=1
> uhid67 at uhidev0 reportid 68: input=0, output=0, feature=2
> uhid68 at uhidev0 reportid 69: input=0, output=0, feature=4
> uhid69 at uhidev0 reportid 70: input=0, output=0, feature=2
> uhid70 at uhidev0 reportid 71: input=0, output=0, feature=2
> uhid71 at uhidev0 reportid 80: input=0, output=0, feature=8
> uhid72 at uhidev0 reportid 81: input=0, output=0, feature=1
> uhid73 at uhidev0 reportid 82: input=0, output=0, feature=1
> uhid74 at uhidev0 reportid 96: input=0, output=0, feature=10
> uhid75 at uhidev0 reportid 97: input=0, output=0, feature=63
> uhid76 at uhidev0 reportid 98: input=0, output=0, feature=63
> uhid77 at uhidev0 reportid 99: input=0, output=0, feature=63
> uhid78 at uhidev0 reportid 100: input=0, output=0, feature=63
> uhid79 at uhidev0 reportid 101: input=0, output=0, feature=62
> uhid80 at uhidev0 reportid 102: input=0, output=0, feature=19
>
> Regards,
> --
> SASANO Takayoshi <[hidden email]>
>

Reply | Threaded
Open this post in threaded view
|

Re: uslcom(4): fix for CP2110 USB HID-UART misdetection

SASANO Takayoshi
Hi,

At Wed, 19 Nov 2014 10:56:15 +0100,
Martin Pieuchot wrote:

>
> On 18/11/14(Tue) 05:25, SASANO Takayoshi wrote:
> > Hi all,
> >
> > I bought Silicon Labs CP2110-EK USB HID-to-UART evaluation kit
> > and connected to OpenBSD box.
> >
> > uslcom(4) tries to use CP2110, but the device is different from
> > CP210x series.
>
> I agree this is a totally different device are you working on a kernel
> driver?  The AN434 document should be enough, right?  By the way, this
> device is another example that the model "1 driver" per  reportID is no
> longer valid.

Yes, I am trying to write CP2110 kernel driver, and it requires handling
all report ID. I think upd_match() of upd(4) will be a hint.

I have read AN434 and found something unclear. I need to check how device
works by USB analyzer.

> > How about to fix usbdevs and uslcom.c like this?
>
> ok mpi@

Thanks, committed.
Regards,

--
SASANO Takayoshi <[hidden email]>