From patchwork Mon Nov 22 04:09:24 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Aaron Ma X-Patchwork-Id: 1557874 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: bilbo.ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=canonical.com header.i=@canonical.com header.a=rsa-sha256 header.s=20210705 header.b=RjP1WY6G; dkim-atps=neutral Authentication-Results: ozlabs.org; spf=none (no SPF record) smtp.mailfrom=lists.ubuntu.com (client-ip=91.189.94.19; helo=huckleberry.canonical.com; envelope-from=kernel-team-bounces@lists.ubuntu.com; receiver=) Received: from huckleberry.canonical.com (huckleberry.canonical.com [91.189.94.19]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by bilbo.ozlabs.org (Postfix) with ESMTPS id 4HyDLr16jnz9sf8 for ; Mon, 22 Nov 2021 15:09:54 +1100 (AEDT) Received: from localhost ([127.0.0.1] helo=huckleberry.canonical.com) by huckleberry.canonical.com with esmtp (Exim 4.86_2) (envelope-from ) id 1mp0eD-0005ew-5f; Mon, 22 Nov 2021 04:09:41 +0000 Received: from smtp-relay-canonical-1.internal ([10.131.114.174] helo=smtp-relay-canonical-1.canonical.com) by huckleberry.canonical.com with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.86_2) (envelope-from ) id 1mp0eB-0005eh-J5 for kernel-team@lists.ubuntu.com; Mon, 22 Nov 2021 04:09:39 +0000 Received: from localhost.localdomain (unknown [222.129.35.96]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by smtp-relay-canonical-1.canonical.com (Postfix) with ESMTPSA id ABD7D40001 for ; Mon, 22 Nov 2021 04:09:37 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=canonical.com; s=20210705; t=1637554179; bh=dGOw3rRZwxza0y4s4u+j/29kqCD/B1LvQz1scw9JthE=; h=From:To:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=RjP1WY6G2WgJZLVShOErfj/qrLOjWb7Pg+RddeY2+N36tkXSNiIKSaXwxWNbeyI5Q lKtdYCA3T9po8ZysM+EG7O7aPsqr+gqthrnWC/jQx6owhxkAIj7LaVIehZVlsLCLSX 4woDMphidZAJYQJ6qwq42xopnp1tU6B9t9/SXh+WnZeprIbwEcwYXVc0nQD5EoWUFB /PSRrDjAT4HjbrWHMwBcvGTddr8M48TFBhAQxD1q8VPoCcludZQweLc94P1nXkZj/i dAq5SGhn21MxLkGXOnKlCsRN4NATuIHuLKtY+HHQ9iQ5ZT8r2KeKxqoJmwLcXiqZPF POluDiytLNxpQ== From: Aaron Ma To: kernel-team@lists.ubuntu.com Subject: [SRU][I/J/OEM-5.13/OEM-5.14][PATCH 1/1] net: usb: r8152: Add MAC passthrough support for more Lenovo Docks Date: Mon, 22 Nov 2021 12:09:24 +0800 Message-Id: <20211122040924.29123-2-aaron.ma@canonical.com> X-Mailer: git-send-email 2.34.0 In-Reply-To: <20211122040924.29123-1-aaron.ma@canonical.com> References: <20211122040924.29123-1-aaron.ma@canonical.com> MIME-Version: 1.0 X-BeenThere: kernel-team@lists.ubuntu.com X-Mailman-Version: 2.1.20 Precedence: list List-Id: Kernel team discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: kernel-team-bounces@lists.ubuntu.com Sender: "kernel-team" BugLink: https://bugs.launchpad.net/bugs/1951767 Like ThinkaPad Thunderbolt 4 Dock, more Lenovo docks start to use the original Realtek USB ethernet chip ID 0bda:8153. Lenovo Docks always use their own IDs for usb hub, even for older Docks. If parent hub is from Lenovo, then r8152 should try MAC passthrough. Verified on Lenovo TBT3 dock too. Signed-off-by: Aaron Ma Signed-off-by: David S. Miller (cherry picked from commit f77b83b5bbab53d2be339184838b19ed2c62c0a5) Signed-off-by: Aaron Ma --- drivers/net/usb/r8152.c | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/drivers/net/usb/r8152.c b/drivers/net/usb/r8152.c index 92fca5e9ed03..65320bdcbd25 100644 --- a/drivers/net/usb/r8152.c +++ b/drivers/net/usb/r8152.c @@ -9599,12 +9599,9 @@ static int rtl8152_probe(struct usb_interface *intf, netdev->hw_features &= ~NETIF_F_RXCSUM; } - if (le16_to_cpu(udev->descriptor.idVendor) == VENDOR_ID_LENOVO) { - switch (le16_to_cpu(udev->descriptor.idProduct)) { - case DEVICE_ID_THINKPAD_THUNDERBOLT3_DOCK_GEN2: - case DEVICE_ID_THINKPAD_USB_C_DOCK_GEN2: - tp->lenovo_macpassthru = 1; - } + if (udev->parent && + le16_to_cpu(udev->parent->descriptor.idVendor) == VENDOR_ID_LENOVO) { + tp->lenovo_macpassthru = 1; } if (le16_to_cpu(udev->descriptor.bcdDevice) == 0x3011 && udev->serial &&