From nobody Wed Jan 25 07:48:29 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4P1wv22fzRz3byRY; Wed, 25 Jan 2023 07:48:30 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4P1wv20wTzz3N5V; Wed, 25 Jan 2023 07:48:30 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1674632910; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=s+hhl9dwVqbUJPqVyxC4pgDdSKtddoA5iM3nXOzTLHQ=; b=GgovM2y3UpJ/7gUIqlpeBQBxp5EXHpG5F9FAx7RMO8HDF0QQcPgAabRNUnPg19Ic2bKqUH D1y4Q10J3yN4S2Q49sdWzPFYY83vCTAQMb89We8UxF39XCSg54Pn/TI3jGofMcTwl/JDjl G54VvimEouflddjkNGPNJP+vfef6ko7XsSrEOX+mEUxXdMzQA4kkcTH+xVUhGIHarjfzDL AmRoGgn4KLirvDiG0b1FFR7jmGJ6ZeI+723ayz+g/rKWvRs8nz5Y+mV8isxUFkiMw9znGc 35SnE+RjL3BWd/B7mL8/tq85tbqhEVjzfNChiqJerSv4N0KxGh2hLhL9rR+5og== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1674632910; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=s+hhl9dwVqbUJPqVyxC4pgDdSKtddoA5iM3nXOzTLHQ=; b=EOCumgFnp2er4vnRXueEmjephMV/xDwlGUQ8wfU7xVC9U/BvI7adXWlYOnhzsJKvonbnev O4BO/QWCl53f8PhMKWLeNyXrmna9m/IkfBbbxraxIWKhgtL9S1FdmmmrhG/CZwEdx/c8Bv N/rvzjxsNq+GSTdnz5a5G/RyKkTsLmvQNXb/beejjbytRH8lsGcIMs703GhUe6UY3s6InT XmO3ez1hYGDj7PPZ+OfK9Hi55PBVbw3WRaAeHkXRxszdu7qGh1WypqY6Tadv+TLZcj8J4e Qb6yTrjePVH4u4xGKRWWthHJL3jbdSofPkO6Ih+6N6SqoeZWOQSLNRzqLzy+EQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1674632910; a=rsa-sha256; cv=none; b=VakrZkIJh0a92RYn6CAkOWQ/Yeo46TYoaa9JCwyVd6XCHqH/R2/8YiId2acuNv0kEQKBlu Jz8DIW5Q4VoMV2MEc3EoXQPdiLxG53KvrsutY6E8CSlph7J6XSIooJ39mrXJWGLIQMbhfG qmVzOwWv8cxfWZJor1HHlRagE1uss9K6Sak2s6oEPBxmlXNWKT+NkCwv0ro4FRbhIwthqX TmPalJSSDjxzOaaD8AFKzdsKB92PgrcKc7cs4Bf3+5QD/7E9q/z9BebFGPiQCQgyQbDCF/ Ac/XkteTZHg4LXjvK5s5RuEBwoBz6QstA8lTH3Ag6oBIRzT7fAniY7wuM42efQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4P1wv2005xzhDH; Wed, 25 Jan 2023 07:48:29 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 30P7mTZs013170; Wed, 25 Jan 2023 07:48:29 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 30P7mT58013169; Wed, 25 Jan 2023 07:48:29 GMT (envelope-from git) Date: Wed, 25 Jan 2023 07:48:29 GMT Message-Id: <202301250748.30P7mT58013169@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: =?utf-8?Q?Corvin=20K=C3=B6hne?= Subject: git: d1cf19c70a6a - stable/13 - umodem: add quirk to ignore CDC_CM descriptor List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: corvink X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: d1cf19c70a6a1d34c1aa79eb584fb78bdfdb7a27 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by corvink: URL: https://cgit.FreeBSD.org/src/commit/?id=d1cf19c70a6a1d34c1aa79eb584fb78bdfdb7a27 commit d1cf19c70a6a1d34c1aa79eb584fb78bdfdb7a27 Author: Steffen Dirkwinkel AuthorDate: 2023-01-17 07:58:46 +0000 Commit: Corvin Köhne CommitDate: 2023-01-25 06:55:12 +0000 umodem: add quirk to ignore CDC_CM descriptor Some devices have CDC_CM descriptors that would point us to the wrong interfaces. Add a quirk to ignore those (prefering the CDC_UNION descriptor effectively) Reviewed by: manu MFC after: 1 week Sponsored by: Beckhoff Automation GmbH & Co. KG Differential Revision: https://reviews.freebsd.org/D37942 (cherry picked from commit 73c3e8b1dee6cd42de32287ea8a57762b961d8ee) --- share/man/man4/usb_quirk.4 | 2 ++ sys/dev/usb/quirk/usb_quirk.c | 1 + sys/dev/usb/quirk/usb_quirk.h | 1 + sys/dev/usb/serial/umodem.c | 4 +++- 4 files changed, 7 insertions(+), 1 deletion(-) diff --git a/share/man/man4/usb_quirk.4 b/share/man/man4/usb_quirk.4 index c176993bdbc3..892c85aa6fba 100644 --- a/share/man/man4/usb_quirk.4 +++ b/share/man/man4/usb_quirk.4 @@ -100,6 +100,8 @@ select configuration index 4 by default select configuration index 0 by default .It UQ_ASSUME_CM_OVER_DATA assume cm over data feature +.It UQ_IGNORE_CDC_CM +ignore cm descriptor .It UQ_WMT_IGNORE device should be ignored by wmt driver .El diff --git a/sys/dev/usb/quirk/usb_quirk.c b/sys/dev/usb/quirk/usb_quirk.c index f0133e3e4b9b..e35297b2340c 100644 --- a/sys/dev/usb/quirk/usb_quirk.c +++ b/sys/dev/usb/quirk/usb_quirk.c @@ -660,6 +660,7 @@ static const char *usb_quirk_str[USB_QUIRK_MAX] = { [UQ_CFG_INDEX_4] = "UQ_CFG_INDEX_4", [UQ_CFG_INDEX_0] = "UQ_CFG_INDEX_0", [UQ_ASSUME_CM_OVER_DATA] = "UQ_ASSUME_CM_OVER_DATA", + [UQ_IGNORE_CDC_CM] = "UQ_IGNORE_CDC_CM", [UQ_MSC_NO_TEST_UNIT_READY] = "UQ_MSC_NO_TEST_UNIT_READY", [UQ_MSC_NO_RS_CLEAR_UA] = "UQ_MSC_NO_RS_CLEAR_UA", [UQ_MSC_NO_START_STOP] = "UQ_MSC_NO_START_STOP", diff --git a/sys/dev/usb/quirk/usb_quirk.h b/sys/dev/usb/quirk/usb_quirk.h index 85bec036f84d..755465576684 100644 --- a/sys/dev/usb/quirk/usb_quirk.h +++ b/sys/dev/usb/quirk/usb_quirk.h @@ -66,6 +66,7 @@ enum { UQ_CFG_INDEX_4, /* select configuration index 4 by default */ UQ_CFG_INDEX_0, /* select configuration index 0 by default */ UQ_ASSUME_CM_OVER_DATA, /* assume cm over data feature */ + UQ_IGNORE_CDC_CM, /* ignore cm descriptor */ /* * USB Mass Storage Quirks. See "storage/umass.c" for a diff --git a/sys/dev/usb/serial/umodem.c b/sys/dev/usb/serial/umodem.c index c4aba1bdd3e2..ec7e3f21662d 100644 --- a/sys/dev/usb/serial/umodem.c +++ b/sys/dev/usb/serial/umodem.c @@ -361,7 +361,9 @@ umodem_attach(device_t dev) /* get the data interface number */ - cmd = umodem_get_desc(uaa, UDESC_CS_INTERFACE, UDESCSUB_CDC_CM); + cmd = NULL; + if (!usb_test_quirk(uaa, UQ_IGNORE_CDC_CM)) + cmd = umodem_get_desc(uaa, UDESC_CS_INTERFACE, UDESCSUB_CDC_CM); if ((cmd == NULL) || (cmd->bLength < sizeof(*cmd))) { cud = usbd_find_descriptor(uaa->device, NULL,