diff options
author | Linyu Yuan <quic_linyyuan@quicinc.com> | 2023-08-03 17:10:48 +0800 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2023-08-22 14:48:33 +0200 |
commit | 8165763f82bd87d742b91ffef2874e7c8d1f6d2b (patch) | |
tree | 3f74dd8d84e869ae8809c21dd8ad40376260aacf /drivers/usb/gadget/function/f_rndis.c | |
parent | 98102ae1549e3af33359ec3a8e57adafa57b1b01 (diff) |
usb: gadget: add a inline function gether_bitrate()
In function ecm_bitrate(), it is not support report bit rate for super
speed plus mode, but it can use same bit rate value defined in ncm and
rndis.
Add a common inline function gether_bitrate() which report different for
all possible speeds, it can be used by ecm, ncm and rndis, also remove
old function from them.
Signed-off-by: Linyu Yuan <quic_linyyuan@quicinc.com>
Link: https://lore.kernel.org/r/20230803091053.9714-3-quic_linyyuan@quicinc.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/usb/gadget/function/f_rndis.c')
-rw-r--r-- | drivers/usb/gadget/function/f_rndis.c | 15 |
1 files changed, 1 insertions, 14 deletions
diff --git a/drivers/usb/gadget/function/f_rndis.c b/drivers/usb/gadget/function/f_rndis.c index eff5d7cbce00..ed1c3eb91d3b 100644 --- a/drivers/usb/gadget/function/f_rndis.c +++ b/drivers/usb/gadget/function/f_rndis.c @@ -84,19 +84,6 @@ static inline struct f_rndis *func_to_rndis(struct usb_function *f) return container_of(f, struct f_rndis, port.func); } -/* peak (theoretical) bulk transfer rate in bits-per-second */ -static unsigned int bitrate(struct usb_gadget *g) -{ - if (g->speed >= USB_SPEED_SUPER_PLUS) - return 4250000000U; - if (g->speed == USB_SPEED_SUPER) - return 3750000000U; - else if (g->speed == USB_SPEED_HIGH) - return 13 * 512 * 8 * 1000 * 8; - else - return 19 * 64 * 1 * 1000 * 8; -} - /*-------------------------------------------------------------------------*/ /* @@ -640,7 +627,7 @@ static void rndis_open(struct gether *geth) DBG(cdev, "%s\n", __func__); rndis_set_param_medium(rndis->params, RNDIS_MEDIUM_802_3, - bitrate(cdev->gadget) / 100); + gether_bitrate(cdev->gadget) / 100); rndis_signal_connect(rndis->params); } |