]> www.infradead.org Git - users/hch/misc.git/commitdiff
usb: gadget: f_tcm: Use extra number of commands
authorThinh Nguyen <Thinh.Nguyen@synopsys.com>
Wed, 11 Dec 2024 00:32:55 +0000 (00:32 +0000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 24 Dec 2024 07:56:07 +0000 (08:56 +0100)
To properly respond to host sending more commands than the number of
streams the device advertises, the device needs to be able to reject the
command with a response. Allocate an extra request to handle 1 more
command than the number of streams.

Signed-off-by: Thinh Nguyen <Thinh.Nguyen@synopsys.com>
Link: https://lore.kernel.org/r/256f2ec8f5e042ab692d9593144fa75f3d3ce94b.1733876548.git.Thinh.Nguyen@synopsys.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/usb/gadget/function/tcm.h

index cd8d06419d5fed5ffc02ab793298abe30f5ac587..9d614a7f2ac0d9533e9285cd7daea6a3701de1e0 100644 (file)
@@ -16,7 +16,7 @@
 #define UASP_SS_EP_COMP_LOG_STREAMS 5
 #define UASP_SS_EP_COMP_NUM_STREAMS (1 << UASP_SS_EP_COMP_LOG_STREAMS)
 
-#define USBG_NUM_CMDS          UASP_SS_EP_COMP_NUM_STREAMS
+#define USBG_NUM_CMDS          (UASP_SS_EP_COMP_NUM_STREAMS + 1)
 
 enum {
        USB_G_STR_INT_UAS = 0,