ffs: Fix to send response for RESET request. 07/280107/2 accepted/tizen_7.0_unified_hotfix accepted/tizen_8.0_unified tizen_7.0_hotfix tizen_8.0 accepted/tizen/7.0/unified/20221110.060214 accepted/tizen/7.0/unified/hotfix/20221116.105204 accepted/tizen/8.0/unified/20231005.093224 accepted/tizen/unified/20220905.124713 submit/tizen/20220901.075652 tizen_7.0_m2_release tizen_8.0_m2_release
authorDongwoo Lee <dwoo08.lee@samsung.com>
Mon, 22 Aug 2022 08:23:23 +0000 (17:23 +0900)
committerJihoon Jung <jh8801.jung@samsung.com>
Thu, 1 Sep 2022 07:55:04 +0000 (07:55 +0000)
Currently RESET handler calls read() for control endpoint after mtp
reset. However, as comparing with legacy slp handler, send reponse by
calling write() is the right way for sending response for RESET. Thus,
this fixes to send response instead of waiting additional request.

Change-Id: I79e42c40ac30015883db85b42c0cd941bbbbfb39
Signed-off-by: Dongwoo Lee <dwoo08.lee@samsung.com>
src/mtp_usb_driver_ffs.c

index a7cea9e572e0b59b10f9114b95b1a1a5ac7b589d..9efbdcb2f9c3b2c60e853265e8850e81f189d2e6 100644 (file)
@@ -546,9 +546,9 @@ static void __handle_control_request(mtp_int32 request)
                if (kernel_reset == FALSE) {
                        kernel_reset = TRUE;
                }
-               status = read(g_usb_ep0, NULL, 0);
+               status = write(g_usb_ep0, NULL, 0);
                if (status < 0) {
-                       ERR("IOCTL MTP_SEND_RESET_ACK Failed [%d]\n",
+                       ERR("Failed to write RESET ACK [%d]\n",
                                status);
                }
                break;