Bug 260783

Summary: uchcom: Add ID for CH341K
Product: Base System Reporter: Daniel O'Connor <darius>
Component: usbAssignee: freebsd-usb (Nobody) <usb>
Status: Closed FIXED    
Severity: Affects Only Me CC: hselasky
Priority: ---    
Version: Unspecified   
Hardware: Any   
OS: Any   
Attachments:
Description Flags
Add ID for CH341K
none
Add ID for CH340K none

Description Daniel O'Connor 2021-12-29 06:56:33 UTC
Created attachment 230525 [details]
Add ID for CH341K

Add ID for CH341K.
I tested this on a Lilygo relay board with their programming tool and it ran esptool to program the device find.
Comment 1 Hans Petter Selasky freebsd_committer freebsd_triage 2021-12-29 18:00:14 UTC
Patch looks good. Do you have someone to commit it?
Comment 2 Daniel O'Connor 2021-12-30 00:04:49 UTC
(In reply to Hans Petter Selasky from comment #1)

No, would you be able to?
Otherwise I can probably find someone on IRC who can do it.
Comment 3 Andriy Gapon freebsd_committer freebsd_triage 2021-12-30 07:46:22 UTC
(In reply to Daniel O'Connor from comment #0)
Is CH341K a real product name?
My internet search did not turn up anything for it.

Perhaps it's just another CH341 variant that does not need a distinguished name?
Then it could be added as CH341SER_3 or something...

Also, in that case it probably does not deserve a distinct device_printf either.
I mean, why distinguish it from other variants if the driver does not have any special cases for it.

P.S.
based on more research it seems that the chip is actually CH340K.
Comment 4 Daniel O'Connor 2021-12-30 07:53:55 UTC
(In reply to Andriy Gapon from comment #3)
Yes I agree - it is the CH340K, I misread it when I started writing the patch and everything flowed from there..

Also agreed WRT the device ID & printf - do you want another patch?
Comment 5 Daniel O'Connor 2021-12-30 07:56:59 UTC
Relatedly I am not sure why that case statement exists that prints 340 vs 341 exists at all anyway since it doesn't affect the behaviour that I can see..
Comment 6 Daniel O'Connor 2022-01-05 12:33:10 UTC
Created attachment 230728 [details]
Add ID for CH340K
Comment 7 commit-hook freebsd_committer freebsd_triage 2022-01-07 13:03:27 UTC
A commit in branch main references this bug:

URL: https://cgit.FreeBSD.org/src/commit/?id=34bedcee3c5a8640f3e344218b47c2d970df78ed

commit 34bedcee3c5a8640f3e344218b47c2d970df78ed
Author:     Hans Petter Selasky <hselasky@FreeBSD.org>
AuthorDate: 2022-01-07 12:56:47 +0000
Commit:     Hans Petter Selasky <hselasky@FreeBSD.org>
CommitDate: 2022-01-07 13:02:30 +0000

    uchcom(4): Add new USB ID.

    Submitted by:   darius@dons.net.au
    PR:             260783
    MFC after:      1 week
    Sponsored by:   NVIDIA Networking

 sys/dev/usb/serial/uchcom.c | 1 +
 sys/dev/usb/usbdevs         | 1 +
 2 files changed, 2 insertions(+)
Comment 8 Andriy Gapon freebsd_committer freebsd_triage 2022-01-08 09:50:13 UTC
My only comment is wouldn't it be better to report USB_PRODUCT_WCH2_CH341SER_3 as "CH340 detected"?  Given that it's CH340K.  Or simply combine or remove those two device_printf-s...
Comment 9 Daniel O'Connor 2022-01-09 12:15:58 UTC
(In reply to Andriy Gapon from comment #8)
I agree, I'm not sure why it's in there, it was added in r333997 but I don't see much utility.
Comment 10 commit-hook freebsd_committer freebsd_triage 2022-02-10 15:17:57 UTC
A commit in branch stable/13 references this bug:

URL: https://cgit.FreeBSD.org/src/commit/?id=3752e6771b08b5a13ffb3ef8c1247b7ec8dade3a

commit 3752e6771b08b5a13ffb3ef8c1247b7ec8dade3a
Author:     Hans Petter Selasky <hselasky@FreeBSD.org>
AuthorDate: 2022-01-07 12:56:47 +0000
Commit:     Hans Petter Selasky <hselasky@FreeBSD.org>
CommitDate: 2022-02-10 15:11:01 +0000

    uchcom(4): Add new USB ID.

    Submitted by:   darius@dons.net.au
    PR:             260783
    Sponsored by:   NVIDIA Networking

    (cherry picked from commit 34bedcee3c5a8640f3e344218b47c2d970df78ed)

 sys/dev/usb/serial/uchcom.c | 1 +
 sys/dev/usb/usbdevs         | 1 +
 2 files changed, 2 insertions(+)
Comment 11 commit-hook freebsd_committer freebsd_triage 2022-06-12 14:43:53 UTC
A commit in branch main references this bug:

URL: https://cgit.FreeBSD.org/src/commit/?id=f25a0a0f21183a52eeb4a860a88114aebec5f249

commit f25a0a0f21183a52eeb4a860a88114aebec5f249
Author:     Hans Petter Selasky <hselasky@FreeBSD.org>
AuthorDate: 2022-06-12 14:40:36 +0000
Commit:     Hans Petter Selasky <hselasky@FreeBSD.org>
CommitDate: 2022-06-12 14:42:03 +0000

    uchcom(4): Add new USB ID.

    PR:             260783
    PR:             264634
    MFC after:      1 week
    Sponsored by:   NVIDIA Networking

 sys/dev/usb/serial/uchcom.c | 1 +
 1 file changed, 1 insertion(+)
Comment 12 commit-hook freebsd_committer freebsd_triage 2022-06-20 11:13:24 UTC
A commit in branch stable/13 references this bug:

URL: https://cgit.FreeBSD.org/src/commit/?id=0b5f08439d27ecbfa4b4c20acef64fbad66e978a

commit 0b5f08439d27ecbfa4b4c20acef64fbad66e978a
Author:     Hans Petter Selasky <hselasky@FreeBSD.org>
AuthorDate: 2022-06-12 14:40:36 +0000
Commit:     Hans Petter Selasky <hselasky@FreeBSD.org>
CommitDate: 2022-06-20 11:08:39 +0000

    uchcom(4): Add new USB ID.

    PR:             260783
    PR:             264634
    Sponsored by:   NVIDIA Networking

    (cherry picked from commit f25a0a0f21183a52eeb4a860a88114aebec5f249)

 sys/dev/usb/serial/uchcom.c | 1 +
 1 file changed, 1 insertion(+)