Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp730991pxu; Thu, 26 Nov 2020 10:11:43 -0800 (PST) X-Google-Smtp-Source: ABdhPJyKOD4gsebohvF33oHIrH+S5LjrTkCRrHFTEFD2GXn+4VXc9z9frEItF3yyVUIZF6bwGW1k X-Received: by 2002:a17:906:60d4:: with SMTP id f20mr3969243ejk.156.1606414302985; Thu, 26 Nov 2020 10:11:42 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1606414302; cv=none; d=google.com; s=arc-20160816; b=GVPZ8/nbIhp1RYK7VfRf7MyqHxDa0HF33CfyMPjqLsXGe2eOC+w9mVUhlaA4wB4Ttd 4rbZBRxrs/BOxFcrHt8oOU6/shXZ09MjsESEs9MF5CAnCIPLJ5MTi28DSMOIjPEd9mlV wyvRQoL81T+gc47yoT2XdW23Z79Sb3pkuFKuGYlUylsSFHVvVxuUS/purfvSQ0C5uYT0 G6X/Ie1Itafmt+JAPF22Zae9MMos47FAgoN/Uh6nO1IhE0IzjULae/acvxKQIiEMssbq 7a6mQWK4qnw0mNlBKc3P8czCKro3/cVI/jm+tCWmXdEFTww6+ZLdVudY8c36Y6/AYa9i g0mw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=2Is2mbdj2e7cjnh1CBAo72fHpjHYzHh+dNnmFQbudQw=; b=USXJLWHYyBmBHx/7VQ77U897z6ITq5kgKBpXXUVMg8Hd6FLKGXZ+p7X1PWzyzcKRUd 7xyv5dUP5YLpyMidjSR9s2GwtjTdQty83UbE/n6xMKxNZC9vew7dPK1t4gPW4bX9qDdV 9IKlg7VI31CLh5emnqr11/qp3m051TAXFxZiz/NwWZa7zGgBC6Zrhm9ClNSC1UbknyPs zsCa1adVRE6YkiArEXK2Ew9e6x124svTw8+q1RzmWf+8ftSF+yvqlJJaMPV9FQ+FiNmM SO4uLMe7XBxOVua6i5hPkVTWJkNUHSjSoxifMynvLxpV8WzmjafYqS+2P5K9W0cewaZD z1Ew== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=1oLvVZNG; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id z41si3757122ede.411.2020.11.26.10.11.19; Thu, 26 Nov 2020 10:11:42 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=1oLvVZNG; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2404714AbgKZSJr (ORCPT + 99 others); Thu, 26 Nov 2020 13:09:47 -0500 Received: from mail.kernel.org ([198.145.29.99]:54822 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2404676AbgKZSJq (ORCPT ); Thu, 26 Nov 2020 13:09:46 -0500 Received: from localhost (82-217-20-185.cable.dynamic.v4.ziggo.nl [82.217.20.185]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id B2ACA21D7E; Thu, 26 Nov 2020 18:09:45 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1606414186; bh=l+ML/gM0MaklgpBNcmLG6VwzDWRbhWmTWpVYK6fwplg=; h=From:To:Cc:Subject:Date:From; b=1oLvVZNGn6vg5KA4LpCnv8hntPsx6unDPfbOTwuRVEraMElsghoNchm709t0+zOb9 NKvc+Lm7yCwlC3iipbKVjnFp3CNzo9zvSxyOnehffcjzM/boiNIoKco4EwaNi4K9pa A4vq0tvdpfJeetarcVuLH4seuSl57aT4XAQolQh0= From: Greg Kroah-Hartman To: balbi@kernel.org Cc: linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org, Will McVicker , EJ Hsu , Peter Chen , stable , Greg Kroah-Hartman Subject: [PATCH 1/4] USB: gadget: f_rndis: fix bitrate for SuperSpeed and above Date: Thu, 26 Nov 2020 19:09:34 +0100 Message-Id: <20201126180937.255892-1-gregkh@linuxfoundation.org> X-Mailer: git-send-email 2.29.2 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Will McVicker Align the SuperSpeed Plus bitrate for f_rndis to match f_ncm's ncm_bitrate defined by commit 1650113888fe ("usb: gadget: f_ncm: add SuperSpeed descriptors for CDC NCM"). Cc: Felipe Balbi Cc: EJ Hsu Cc: Peter Chen Cc: stable Signed-off-by: Will McVicker Signed-off-by: Greg Kroah-Hartman --- drivers/usb/gadget/function/f_rndis.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/usb/gadget/function/f_rndis.c b/drivers/usb/gadget/function/f_rndis.c index 9534c8ab62a8..0739b05a0ef7 100644 --- a/drivers/usb/gadget/function/f_rndis.c +++ b/drivers/usb/gadget/function/f_rndis.c @@ -87,8 +87,10 @@ static inline struct f_rndis *func_to_rndis(struct usb_function *f) /* peak (theoretical) bulk transfer rate in bits-per-second */ static unsigned int bitrate(struct usb_gadget *g) { + if (gadget_is_superspeed(g) && g->speed >= USB_SPEED_SUPER_PLUS) + return 4250000000U; if (gadget_is_superspeed(g) && g->speed == USB_SPEED_SUPER) - return 13 * 1024 * 8 * 1000 * 8; + return 3750000000U; else if (gadget_is_dualspeed(g) && g->speed == USB_SPEED_HIGH) return 13 * 512 * 8 * 1000 * 8; else -- 2.29.2