Received: by 2002:a25:824b:0:0:0:0:0 with SMTP id d11csp77878ybn; Thu, 3 Oct 2019 01:44:48 -0700 (PDT) X-Google-Smtp-Source: APXvYqy+/7pHsFeE1ZM902/E8nwP6BE2M7lVq90O7Nh4oE9LNRCahpkl6qecRj9V1j1GfvEDv8bP X-Received: by 2002:a17:906:6848:: with SMTP id a8mr6822438ejs.104.1570092288162; Thu, 03 Oct 2019 01:44:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1570092288; cv=none; d=google.com; s=arc-20160816; b=pGOfptxq2G6h7TehVaf8KF8C+FpM0i9IdwRPzN1sBlt73ebe5Lt8Q6CVoCKQMpSNpo KDfCaQC/juMlowQJtPYqRr0QzSpLeoRN7oZeUMUOz4FjM+0oOBKDM8Ar4IneWKVaXSlF 5AsoanownckS5s6hLVCT4W23N4q57pzJdpGgjv69o1KCriFJYJXo13ZuotB7EgyDIAWI xYPXtslopjfDdRW2eJ8abJ8EEBNoVXDk97eR+A9CZ9mo5j3fQL+YEGT8oA2NysGgxlb9 6nO9RdNQbwXLUxBbRacUx68iA+etBaTttkwTJgsHcz5Tevh42MQ2ylt89L2ZfroDK4H7 I0Ag== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:date:cc:to:from:subject:message-id; bh=7Kw/VgAaGnuBNhETp6wXd26VTjzMtwYp8j6yDRmzK0M=; b=C+IAXnZMyme5RE7o7ilyMjT9z19i6OZJpBm81mH7MPLOBXZhGH3TCG+72k4AKu8hEs fDU1qHpFOz3vWZd18Ikz1bNAEHli0sa9Kk9oL6NS7hkRvyDzkp4wgq6RFQGVpg9dunRu EGzQwPMFNAJsxqhggfCGPXzxvuJL4dOx3zWGkb3PU8/iN9621VkhpR7cc2kCc20lLl3Q wNoj49PTqjkeQg8ZoTKxlM/15LCzClC6Do7bCnZ42se0cQ1fFwMbDAuPvMz6GHURtFLT KqdsIGf08MVqaXUH0ulipJXODeOfcebguzt93lzSRVeSdcmbQhhTtPb3TDLUH4KENz8N qk0w== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id i3si992046edq.163.2019.10.03.01.44.23; Thu, 03 Oct 2019 01:44:48 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729041AbfJCInB (ORCPT + 99 others); Thu, 3 Oct 2019 04:43:01 -0400 Received: from mx2.suse.de ([195.135.220.15]:40182 "EHLO mx1.suse.de" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1728322AbfJCInB (ORCPT ); Thu, 3 Oct 2019 04:43:01 -0400 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.220.254]) by mx1.suse.de (Postfix) with ESMTP id 23F59B14B; Thu, 3 Oct 2019 08:42:59 +0000 (UTC) Message-ID: <1570092176.18913.7.camel@suse.com> Subject: Re: [RFC PATCH 20/22] thunderbolt: Add support for USB tunnels From: Oliver Neukum To: Mika Westerberg , linux-usb@vger.kernel.org Cc: Anthony Wong , Mario.Limonciello@dell.com, Andreas Noever , Yehezkel Bernat , Michael Jamet , Rajmohan Mani , Greg Kroah-Hartman , Nicholas Johnson , Alan Stern , linux-kernel@vger.kernel.org, Lukas Wunner Date: Thu, 03 Oct 2019 10:42:56 +0200 In-Reply-To: <20191001113830.13028-21-mika.westerberg@linux.intel.com> References: <20191001113830.13028-1-mika.westerberg@linux.intel.com> <20191001113830.13028-21-mika.westerberg@linux.intel.com> Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.26.6 Mime-Version: 1.0 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Am Dienstag, den 01.10.2019, 14:38 +0300 schrieb Mika Westerberg: > From: Rajmohan Mani > > USB4 added a capability to tunnel USB 3.x protocol over the USB4 > fabric. USB4 device routers may include integrated SuperSpeed HUB or a > function or both. USB tunneling follows PCIe so that the tunnel is > created between the parent and the child router from USB downstream > adapter port to USB upstream adapter port over a single USB4 link. > > This adds support for USB tunneling and also capability to discover > existing USB tunnels (for example created by connection manager in boot > firmware). > > Signed-off-by: Rajmohan Mani > Co-developed-by: Mika Westerberg > Signed-off-by: Mika Westerberg > --- > drivers/thunderbolt/switch.c | 35 ++++++++ > drivers/thunderbolt/tb.c | 153 ++++++++++++++++++++++++++------ > drivers/thunderbolt/tb.h | 15 ++++ > drivers/thunderbolt/tb_regs.h | 9 +- > drivers/thunderbolt/tunnel.c | 158 +++++++++++++++++++++++++++++++++- > drivers/thunderbolt/tunnel.h | 9 ++ > drivers/thunderbolt/usb4.c | 41 ++++++++- > 7 files changed, 393 insertions(+), 27 deletions(-) > > diff --git a/drivers/thunderbolt/switch.c b/drivers/thunderbolt/switch.c > index 58e3f54ddbb9..5a3236fefb76 100644 > --- a/drivers/thunderbolt/switch.c > +++ b/drivers/thunderbolt/switch.c > @@ -1025,11 +1025,46 @@ bool tb_port_is_enabled(struct tb_port *port) > case TB_TYPE_DP_HDMI_OUT: > return tb_dp_port_is_enabled(port); > > + case TB_TYPE_USB_UP: > + case TB_TYPE_USB_DOWN: > + return tb_usb_port_is_enabled(port); > + > default: > return false; > } > } > > +/** > + * tb_usb_port_is_enabled() - Is the USB adapter port enabled > + * @port: USB port to check > + */ > +bool tb_usb_port_is_enabled(struct tb_port *port) Should these functions be called tb_usb3_port... ? This looks like all USB would need this. > -static const char * const tb_tunnel_names[] = { "PCI", "DP", "DMA" }; > +static const char * const tb_tunnel_names[] = { "PCI", "DP", "DMA", "USB"}; USB3 ? Regards Oliver