diff options
author | Pavel Hofman <pavel.hofman@ivitera.com> | 2022-01-27 12:43:31 +0100 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2022-01-31 14:26:18 +0100 |
commit | 554237f2bb62c4fcf01372e4c63d3e0062f27bac (patch) | |
tree | c0973c1ebba07b0ef12a45055135596e9177c605 | |
parent | 355a05dc8367d7533e5925e08dadfc8604961bbc (diff) | |
download | linux-554237f2bb62c4fcf01372e4c63d3e0062f27bac.tar.bz2 |
usb: gadget: f_uac2: Add speed names to bInterval dbg/warn
Add speed names for better clarity of dgb/warn messages from max packet
size/bInterval checks.
Signed-off-by: Pavel Hofman <pavel.hofman@ivitera.com>
Link: https://lore.kernel.org/r/20220127114331.41367-5-pavel.hofman@ivitera.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r-- | drivers/usb/gadget/function/f_uac2.c | 18 |
1 files changed, 14 insertions, 4 deletions
diff --git a/drivers/usb/gadget/function/f_uac2.c b/drivers/usb/gadget/function/f_uac2.c index 48d6fb26bb19..ce3ca7e62e2a 100644 --- a/drivers/usb/gadget/function/f_uac2.c +++ b/drivers/usb/gadget/function/f_uac2.c @@ -124,6 +124,16 @@ static struct usb_string strings_fn[] = { { }, }; +static const char *const speed_names[] = { + [USB_SPEED_UNKNOWN] = "UNKNOWN", + [USB_SPEED_LOW] = "LS", + [USB_SPEED_FULL] = "FS", + [USB_SPEED_HIGH] = "HS", + [USB_SPEED_WIRELESS] = "W", + [USB_SPEED_SUPER] = "SS", + [USB_SPEED_SUPER_PLUS] = "SS+", +}; + static struct usb_gadget_strings str_fn = { .language = 0x0409, /* en-us */ .strings = strings_fn, @@ -745,12 +755,12 @@ static int set_ep_max_packet_size_bint(struct device *dev, const struct f_uac2_o if (max_size_bw <= max_size_ep) dev_dbg(dev, - "%s: Will use maxpctksize %d and bInterval %d\n", - dir, max_size_bw, bint); + "%s %s: Would use maxpctksize %d and bInterval %d\n", + speed_names[speed], dir, max_size_bw, bint); else { dev_warn(dev, - "%s: Req. maxpcktsize %d at bInterval %d > max ISOC %d, may drop data!\n", - dir, max_size_bw, bint, max_size_ep); + "%s %s: Req. maxpcktsize %d at bInterval %d > max ISOC %d, may drop data!\n", + speed_names[speed], dir, max_size_bw, bint, max_size_ep); max_size_bw = max_size_ep; } |