usb: common: add function to get interval expressed in us unit

[ Upstream commit fb95c7cf5600b7b74412f27dfb39a1e13fd8a90d ]

Add a new function to convert bInterval into the time expressed
in 1us unit.

Signed-off-by: Chunfeng Yun <chunfeng.yun@mediatek.com>
Link: https://lore.kernel.org/r/25c8a09b055f716c1e5bf11fea72c3418f844482.1615170625.git.chunfeng.yun@mediatek.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Stable-dep-of: b6155eaf6b05 ("usb: common: debug: Check non-standard control requests")
Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:
Chunfeng Yun
2021-03-08 10:52:05 +08:00
committed by Greg Kroah-Hartman
parent c1ef8c66a3
commit 20b63631a3
4 changed files with 52 additions and 48 deletions

View File

@@ -90,6 +90,9 @@ extern enum usb_ssp_rate usb_get_maximum_ssp_rate(struct device *dev);
*/
extern const char *usb_state_string(enum usb_device_state state);
unsigned int usb_decode_interval(const struct usb_endpoint_descriptor *epd,
enum usb_device_speed speed);
#ifdef CONFIG_TRACING
/**
* usb_decode_ctrl - Returns human readable representation of control request.