From patchwork Tue Aug 18 16:58:46 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Lorenzo Colitti X-Patchwork-Id: 11721997 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id ED324138C for ; Tue, 18 Aug 2020 16:59:24 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id D5E0A208E4 for ; Tue, 18 Aug 2020 16:59:24 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="erPbZV0G" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728475AbgHRQ7V (ORCPT ); Tue, 18 Aug 2020 12:59:21 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47348 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728622AbgHRQ7E (ORCPT ); Tue, 18 Aug 2020 12:59:04 -0400 Received: from mail-yb1-xb4a.google.com (mail-yb1-xb4a.google.com [IPv6:2607:f8b0:4864:20::b4a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id AFB77C061389 for ; Tue, 18 Aug 2020 09:59:00 -0700 (PDT) Received: by mail-yb1-xb4a.google.com with SMTP id e196so22797839ybh.6 for ; Tue, 18 Aug 2020 09:59:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=date:message-id:mime-version:subject:from:to:cc; bh=o9JIR5P3YJ8yGWm9bzlQRfs81LouvpWibUbieKx2QVI=; b=erPbZV0GF/QmzAGkM2ZLKrh5OqgkEH9MKapp+ZOn0UurUQueV4xibTy9lqklSs2SqG L4Hb/6e0hAxKCYhDT4IyjvXGtQdI1RpK9GSzSAoBV7yCC5GsJFYHBfO++TOed8V0/jd0 jW9MnKhEdRQ2ue4Qy/edAo7ttGw4boC8dUKZXXQqv0CWdZ4rV+uweEAQMSpv52JXN4UX fhp/dkLnhgskJr2wLN6eZifKTrFkrl9DYqFBn/qdqoIh2/pZOOQm7ewha2EpTaI9xxvd yJlwgYbNik+t+8UDxaO/veRQ6qXb5dre1CWy3LSK/b6rKigz6fnCtA25qP9meqtWqpFm CCpA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:message-id:mime-version:subject:from:to:cc; bh=o9JIR5P3YJ8yGWm9bzlQRfs81LouvpWibUbieKx2QVI=; b=NalQqg2WCidd8CxmbkRum4Iqx56HsmK5s80mTF+AnnsxL5+9xaZ6WHeRCwwSR3VenJ KQE1DgoI7B8Y+s5mnpI0kPdzvsJGgKi1Ey0UVc1bcKzD9xyC8T5CEE+OAtS2SUZqgc8h WpYGTpEXvIV6eJB8bJMCASXo5cnqlVZ7G3inPmPotwGNRO8uzjf7uLAKUnnNWw0r4yu9 jdgjC0mlD37/dzP/O9Sd6hbNI8ufXr6DLWF1cKvaYPlTTbrWvGJ0+BBMw+T/E7C8C5uy PqDoaaFMCdy9y058opYyzevpxvTpDutOZQcIiFmt5MKJ4ba1zghoVB1o5IwRBF56LQ2M dXYA== X-Gm-Message-State: AOAM533NwHfnZTj7qbzbJnOESQ64ABfxpdlJWL+83xxfSEp58X/37EiZ q766CggNppMWcauYTT5kQHuzI1e8Z+U647I4lDbVMkRwGpF75BaK7amtt+m1lBoLgtOXwrJUoTM 3H/7ixjnwZhwyXYzWtgzFT9qGE8sxc6toL35USRkajde5+Y2eNfO0ACexeidnXau2oOin X-Google-Smtp-Source: ABdhPJyfitNCesM5cOHJkJpKWrV6GNClGCzG9qsfZ1py5ry9HqzrpEZw+xNGOwERl1NSKRRGq38TK1+AmXlU X-Received: by 2002:a25:5755:: with SMTP id l82mr30677619ybb.175.1597769939743; Tue, 18 Aug 2020 09:58:59 -0700 (PDT) Date: Wed, 19 Aug 2020 01:58:46 +0900 Message-Id: <20200818165848.4117493-1-lorenzo@google.com> Mime-Version: 1.0 X-Mailer: git-send-email 2.28.0.220.ged08abb693-goog Subject: [PATCH v2 1/3] usb: gadget: f_ncm: fix ncm_bitrate for SuperSpeed and above. From: Lorenzo Colitti To: linux-usb@vger.kernel.org Cc: balbi@kernel.org, gregkh@linuxfoundation.org, zenczykowski@gmail.com, Lorenzo Colitti Sender: linux-usb-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-usb@vger.kernel.org Currently, SuperSpeed NCM gadgets report a speed of 851 Mbps in USB_CDC_NOTIFY_SPEED_CHANGE. But the calculation appears to assume 16 packets per microframe, and USB 3 and above no longer use microframes. Maximum speed is actually much higher. On a direct connection, theoretical throughput is about 3.86 Gbps for gen1x1 and 9.35 Gbps for gen2x1, and I have seen gadget->host speeds >2 Gbps for gen1x1 and >4 Gbps for gen2x1. Unfortunately the ConnectionSpeedChange defined in the CDC spec only uses 32-bit values, so we can't report accurate numbers for 10Gbps and above. So always report a speed of 4 Gbps, which is close enough to the technical maximum of a 5 Gbps link. This results in: [96033.958723] cdc_ncm 8-2:1.0 enx4643f5db6f40: renamed from usb0 [96033.997136] cdc_ncm 8-2:1.0 enx4643f5db6f40: 4000 mbit/s downlink 4000 mbit/s uplink Fixes: 1650113888fe ("usb: gadget: f_ncm: add SuperSpeed descriptors for CDC NCM") Signed-off-by: Lorenzo Colitti Reviewed-by: Maciej Żenczykowski Reported-by: kernel test robot --- drivers/usb/gadget/function/f_ncm.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/usb/gadget/function/f_ncm.c b/drivers/usb/gadget/function/f_ncm.c index 1d900081b1..0c073df225 100644 --- a/drivers/usb/gadget/function/f_ncm.c +++ b/drivers/usb/gadget/function/f_ncm.c @@ -85,8 +85,8 @@ static inline struct f_ncm *func_to_ncm(struct usb_function *f) /* peak (theoretical) bulk transfer rate in bits-per-second */ static inline unsigned ncm_bitrate(struct usb_gadget *g) { - if (gadget_is_superspeed(g) && g->speed == USB_SPEED_SUPER) - return 13 * 1024 * 8 * 1000 * 8; + if (gadget_is_superspeed(g) && g->speed >= USB_SPEED_SUPER) + return 4000000000; else if (gadget_is_dualspeed(g) && g->speed == USB_SPEED_HIGH) return 13 * 512 * 8 * 1000 * 8; else From patchwork Tue Aug 18 16:58:47 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Lorenzo Colitti X-Patchwork-Id: 11721999 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 929E51392 for ; Tue, 18 Aug 2020 16:59:30 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 7975F20786 for ; Tue, 18 Aug 2020 16:59:30 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="HcYnvq2G" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728630AbgHRQ7Q (ORCPT ); Tue, 18 Aug 2020 12:59:16 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47364 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728619AbgHRQ7I (ORCPT ); Tue, 18 Aug 2020 12:59:08 -0400 Received: from mail-yb1-xb4a.google.com (mail-yb1-xb4a.google.com [IPv6:2607:f8b0:4864:20::b4a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0DD7FC061343 for ; Tue, 18 Aug 2020 09:59:08 -0700 (PDT) Received: by mail-yb1-xb4a.google.com with SMTP id g127so22753680ybf.11 for ; Tue, 18 Aug 2020 09:59:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=date:in-reply-to:message-id:mime-version:references:subject:from:to :cc; bh=4TNVRkUNpf58TBKmVZYhNfFRkuTY8ErhDLTbq/+6hn0=; b=HcYnvq2GokDgKc0+3PZZ5eU9OA01Q4KV/8pd5sIq76IGFHPn66c2TdAA9JDUBTLbMV SPHNusvk82GSewYMFfTWW6L75oBGi31v9e5lAoZk2JuYMpS/xwfu2MS+X6xeXpDarzPc 48m3yG4Pou73rAD0uXGCY8jjTNDmXnJDCpUNtEAopHRT3fJx2Z2RMOabAab8OKqs8E6W fq/GntjrhV7vAfoY2egy+Z9jnUr3b1wPRVCkOAjJ4GKLyIuLs9S2X9kJ76hdxt1ZiYSG fuamdFcewmS2sPRPq2oC87GhNRuhd48CqnGdZmsY+4jFmjJE/RkbYYwF/Pl6grmnbCo6 +DrQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:in-reply-to:message-id:mime-version :references:subject:from:to:cc; bh=4TNVRkUNpf58TBKmVZYhNfFRkuTY8ErhDLTbq/+6hn0=; b=LxPh+h27Kbu5UuHX3S3vcS3dsDYSAAsUQz3fQITCqiBoaop/qL7N53wgNqR7jDlb/U zJX33GdAvew9iLIq5b7+zKgO5tMdbR4zBZUtTjxNBLxvITJ9P15xgRG21anlG6XUd/z8 vmxec7lW3J6t3mrVFn6414hRWiGfU7voWmUNPiuWDv6ulJdzUZUuhSsPxCC0bIqT/FBA KeapLKwUxQvEOZ0BVdHSytlSLqpgzaEUBU6Huqh3dsw0sgzm9R56JPQsNJmbg/70/iJj WDbQs6Y849huJp4G8Yk7M82pEhDFMENKpMIlX/OE6uqk9dyvVgY/fD3nf70jtVSyQkWE 2Q1Q== X-Gm-Message-State: AOAM531xCezECG2mVsUmOiFRDwtXxOJb2HUIkzg/Jffx9jiBfs0EVaJT /jQU0BDYbzt5JJc+nNk4v5yJBJWmMHIaZ525WGeqW0RCXz2xc9Vj16ZIqU5YedygDE28oRwWUMp ZS9sKTZuElMArZcJbHaco5LUWrHG8ORf7vzgq5P0g4mZ2CvqAwZtrRNeoDXx+82l3j90v X-Google-Smtp-Source: ABdhPJydyJZlrJJ3njpf3gLvZql1zqcFyw0O968Ki/+fTJZdIZpBvwOtkYuDXnztzckwpivUVcDhDjf0ywNs X-Received: by 2002:a25:870a:: with SMTP id a10mr29775609ybl.257.1597769947110; Tue, 18 Aug 2020 09:59:07 -0700 (PDT) Date: Wed, 19 Aug 2020 01:58:47 +0900 In-Reply-To: <20200818165848.4117493-1-lorenzo@google.com> Message-Id: <20200818165848.4117493-2-lorenzo@google.com> Mime-Version: 1.0 References: <20200818165848.4117493-1-lorenzo@google.com> X-Mailer: git-send-email 2.28.0.220.ged08abb693-goog Subject: [PATCH v2 2/3] usb: gadget: f_ncm: set SuperSpeed bulk descriptor bMaxBurst to 15 From: Lorenzo Colitti To: linux-usb@vger.kernel.org Cc: balbi@kernel.org, gregkh@linuxfoundation.org, zenczykowski@gmail.com, Lorenzo Colitti Sender: linux-usb-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-usb@vger.kernel.org This improves performance on fast connections. When directly connecting to a Linux laptop running 5.6, single-stream iperf3 goes from ~1.7Gbps to ~2.3Gbps out, and from ~620Mbps to ~720Mbps in. Signed-off-by: Lorenzo Colitti Reviewed-by: Maciej Żenczykowski --- drivers/usb/gadget/function/f_ncm.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/usb/gadget/function/f_ncm.c b/drivers/usb/gadget/function/f_ncm.c index 0c073df225..57ccf30c6c 100644 --- a/drivers/usb/gadget/function/f_ncm.c +++ b/drivers/usb/gadget/function/f_ncm.c @@ -348,7 +348,7 @@ static struct usb_ss_ep_comp_descriptor ss_ncm_notify_comp_desc = { .bDescriptorType = USB_DT_SS_ENDPOINT_COMP, /* the following 3 values can be tweaked if necessary */ - /* .bMaxBurst = 0, */ + .bMaxBurst = 15, /* .bmAttributes = 0, */ .wBytesPerInterval = cpu_to_le16(NCM_STATUS_BYTECOUNT), }; @@ -376,7 +376,7 @@ static struct usb_ss_ep_comp_descriptor ss_ncm_bulk_comp_desc = { .bDescriptorType = USB_DT_SS_ENDPOINT_COMP, /* the following 2 values can be tweaked if necessary */ - /* .bMaxBurst = 0, */ + .bMaxBurst = 15, /* .bmAttributes = 0, */ }; From patchwork Tue Aug 18 16:58:48 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lorenzo Colitti X-Patchwork-Id: 11722001 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id C98C1138C for ; Tue, 18 Aug 2020 16:59:34 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id AFFA720825 for ; Tue, 18 Aug 2020 16:59:34 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="iO909+Aa" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728455AbgHRQ7d (ORCPT ); Tue, 18 Aug 2020 12:59:33 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47382 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728499AbgHRQ7N (ORCPT ); Tue, 18 Aug 2020 12:59:13 -0400 Received: from mail-yb1-xb49.google.com (mail-yb1-xb49.google.com [IPv6:2607:f8b0:4864:20::b49]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4F894C061389 for ; Tue, 18 Aug 2020 09:59:13 -0700 (PDT) Received: by mail-yb1-xb49.google.com with SMTP id e12so22833175ybc.18 for ; Tue, 18 Aug 2020 09:59:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=date:in-reply-to:message-id:mime-version:references:subject:from:to :cc; bh=EiNkwXFQd8W0SM8sGlIRg+d9K0YGA9xsh5Oi70MoV+M=; b=iO909+AaxNZpovJge1m6hGCQdysVAjP3/zsY0ehxNX2NPbEitJvwzfgl6D6Upxz6ST v+NQwVUDYz9V3xJ9SZH7sczSGsEoJjSgXHH2W54I5aVpC/Jmtaa6TsTFehhtCzX4jjbv poCPm2p7jHGAd1DYFzhpf/huZ3lfq6XtOsuVHyzdCamRuFBkMGaFfDR5LZxtRo0T0TmA 6QONCqjMtLXKkMuCcNhOVtFhgcPNKTWahCu1a6ff5q9pK6SHQL0Fnyktqc7X39JS2sLz Yh5A4lrW3DMQyWkKpq/kz+9c7ZhjHV7TCJQEwU7it9o4wJdVJqHwzL2DraQeQAihtCJG BokA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:in-reply-to:message-id:mime-version :references:subject:from:to:cc; bh=EiNkwXFQd8W0SM8sGlIRg+d9K0YGA9xsh5Oi70MoV+M=; b=tGY0cY5L8N/mwL1NP3/Rp8GWjrrHwhc7Zwm8jJD6H8vStW0opGw9vkAXl2z+2II7Nk g5n5xhCi0b1nHoUK5YPLIu/UVOci0e3nRA+PirArnFGu/G33wPyKdyT16awjNilAI7yn A2yp1jr5aMBQCR1T7fxCVtb2AznTNV+sWe/LolEe2SG9hrg2hPe9amzRL64MUr4XAMsP eQyZbMVICFrnNBUybwaJTu189tAfYOKHQ0IzlBeY9hoeiwV9iUkaKgptl7l2BIUepJhz kkOzzPeCVlCeLurWcWCKQYX6B2F0IPpqvw9h+mKfXkpMPC0VrOgm1nJL8FEUwVhVmSSR yuWQ== X-Gm-Message-State: AOAM531N56Er2L3fm09aDlUaaT3TucdpVGYXUCFj3QX84IxSf8pX48eE yWtFTppWfRGrXzH9imeZxDi+lgTSCTPRHKRBOEpkAXsQqEv6Es4GyX91d0/708t0cIGEm23yv+u HrEtocxZmLVIzSU1TGahveVnqtePJhz5kqupXzcsDY3ksJ44Z1g46lah5ZDLQzIVqxLIS X-Google-Smtp-Source: ABdhPJxa74SXayCeF9XV1NNm3IZfx8p0zeDnfk5gS/7wmNGliCcFFjGiZ/bnMA71tHadP74Cjv+/bZksiOCE X-Received: by 2002:a25:f20d:: with SMTP id i13mr28048244ybe.152.1597769952499; Tue, 18 Aug 2020 09:59:12 -0700 (PDT) Date: Wed, 19 Aug 2020 01:58:48 +0900 In-Reply-To: <20200818165848.4117493-1-lorenzo@google.com> Message-Id: <20200818165848.4117493-3-lorenzo@google.com> Mime-Version: 1.0 References: <20200818165848.4117493-1-lorenzo@google.com> X-Mailer: git-send-email 2.28.0.220.ged08abb693-goog Subject: [PATCH v2 3/3] usb: gadget: f_ncm: allow using NCM in SuperSpeed Plus gadgets. From: Lorenzo Colitti To: linux-usb@vger.kernel.org Cc: balbi@kernel.org, gregkh@linuxfoundation.org, zenczykowski@gmail.com, Lorenzo Colitti Sender: linux-usb-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-usb@vger.kernel.org Currently, using f_ncm in a SuperSpeed Plus gadget results in an oops in config_ep_by_speed because ncm_set_alt passes in NULL ssp_descriptors. Fix this by defining new descriptors for SuperSpeed Plus. (We cannot re-use the existing definitions for the SuperSpeed descriptors, even though they are mostly the same, because they are not fixed initializers). Tested: enabled f_ncm on a dwc3 gadget and 10Gbps link, ran iperf Signed-off-by: Lorenzo Colitti --- drivers/usb/gadget/function/f_ncm.c | 76 ++++++++++++++++++++++++++++- 1 file changed, 75 insertions(+), 1 deletion(-) diff --git a/drivers/usb/gadget/function/f_ncm.c b/drivers/usb/gadget/function/f_ncm.c index 57ccf30c6c..01242454d5 100644 --- a/drivers/usb/gadget/function/f_ncm.c +++ b/drivers/usb/gadget/function/f_ncm.c @@ -400,6 +400,75 @@ static struct usb_descriptor_header *ncm_ss_function[] = { NULL, }; +/* super speed plus support: */ + +static struct usb_endpoint_descriptor ssp_ncm_notify_desc = { + .bLength = USB_DT_ENDPOINT_SIZE, + .bDescriptorType = USB_DT_ENDPOINT, + + .bEndpointAddress = USB_DIR_IN, + .bmAttributes = USB_ENDPOINT_XFER_INT, + .wMaxPacketSize = cpu_to_le16(NCM_STATUS_BYTECOUNT), + .bInterval = USB_MS_TO_HS_INTERVAL(NCM_STATUS_INTERVAL_MS) +}; + +static struct usb_ss_ep_comp_descriptor ssp_ncm_notify_comp_desc = { + .bLength = sizeof(ssp_ncm_notify_comp_desc), + .bDescriptorType = USB_DT_SS_ENDPOINT_COMP, + + /* the following 3 values can be tweaked if necessary */ + .bMaxBurst = 15, + /* .bmAttributes = 0, */ + .wBytesPerInterval = cpu_to_le16(NCM_STATUS_BYTECOUNT), +}; + +static struct usb_endpoint_descriptor ssp_ncm_in_desc = { + .bLength = USB_DT_ENDPOINT_SIZE, + .bDescriptorType = USB_DT_ENDPOINT, + + .bEndpointAddress = USB_DIR_IN, + .bmAttributes = USB_ENDPOINT_XFER_BULK, + .wMaxPacketSize = cpu_to_le16(1024), +}; + +static struct usb_endpoint_descriptor ssp_ncm_out_desc = { + .bLength = USB_DT_ENDPOINT_SIZE, + .bDescriptorType = USB_DT_ENDPOINT, + + .bEndpointAddress = USB_DIR_OUT, + .bmAttributes = USB_ENDPOINT_XFER_BULK, + .wMaxPacketSize = cpu_to_le16(1024), +}; + +static struct usb_ss_ep_comp_descriptor ssp_ncm_bulk_comp_desc = { + .bLength = sizeof(ssp_ncm_bulk_comp_desc), + .bDescriptorType = USB_DT_SS_ENDPOINT_COMP, + + /* the following 2 values can be tweaked if necessary */ + .bMaxBurst = 15, + /* .bmAttributes = 0, */ +}; + +static struct usb_descriptor_header *ncm_ssp_function[] = { + (struct usb_descriptor_header *) &ncm_iad_desc, + /* CDC NCM control descriptors */ + (struct usb_descriptor_header *) &ncm_control_intf, + (struct usb_descriptor_header *) &ncm_header_desc, + (struct usb_descriptor_header *) &ncm_union_desc, + (struct usb_descriptor_header *) &ecm_desc, + (struct usb_descriptor_header *) &ncm_desc, + (struct usb_descriptor_header *) &ssp_ncm_notify_desc, + (struct usb_descriptor_header *) &ssp_ncm_notify_comp_desc, + /* data interface, altsettings 0 and 1 */ + (struct usb_descriptor_header *) &ncm_data_nop_intf, + (struct usb_descriptor_header *) &ncm_data_intf, + (struct usb_descriptor_header *) &ssp_ncm_in_desc, + (struct usb_descriptor_header *) &ssp_ncm_bulk_comp_desc, + (struct usb_descriptor_header *) &ssp_ncm_out_desc, + (struct usb_descriptor_header *) &ssp_ncm_bulk_comp_desc, + NULL, +}; + /* string descriptors: */ #define STRING_CTRL_IDX 0 @@ -1502,8 +1571,13 @@ static int ncm_bind(struct usb_configuration *c, struct usb_function *f) ss_ncm_notify_desc.bEndpointAddress = fs_ncm_notify_desc.bEndpointAddress; + ssp_ncm_in_desc.bEndpointAddress = fs_ncm_in_desc.bEndpointAddress; + ssp_ncm_out_desc.bEndpointAddress = fs_ncm_out_desc.bEndpointAddress; + ssp_ncm_notify_desc.bEndpointAddress = + fs_ncm_notify_desc.bEndpointAddress; + status = usb_assign_descriptors(f, ncm_fs_function, ncm_hs_function, - ncm_ss_function, NULL); + ncm_ss_function, ncm_ssp_function); if (status) goto fail;