Revert "usb: gadget: mtp: increase MTP buffers"
Alvin Park [Fri, 11 Oct 2013 04:58:37 +0000 (13:58 +0900)]
This reverts commit b64b3f926455e9cfdff90291525f3d5264b97dd4.

Bug 1374649

Change-Id: Iae160042efef5512ab001cf56aaae54b957e9132
Signed-off-by: Alvin Park <apark@nvidia.com>
Reviewed-on: http://git-master/r/289520
GVS: Gerrit_Virtual_Submit
Reviewed-by: Peter Kim <pekim@nvidia.com>
(cherry picked from commit 0d86d69ce00e6b93335cf56943a4237e5c7594ec)
Reviewed-on: http://git-master/r/299255
Reviewed-by: Jake Park <jakep@nvidia.com>

drivers/usb/gadget/f_mtp.c

index e778d19..1638977 100644 (file)
@@ -2,8 +2,6 @@
  * Gadget Function Driver for MTP
  *
  * Copyright (C) 2010 Google, Inc.
- * Copyright (c) 2013, NVIDIA CORPORATION.  All rights reserved.
- *
  * Author: Mike Lockwood <lockwood@android.com>
  *
  * This software is licensed under the terms of the GNU General Public
@@ -38,7 +36,7 @@
 #include <linux/usb/ch9.h>
 #include <linux/usb/f_mtp.h>
 
-#define MTP_BULK_BUFFER_SIZE       32768
+#define MTP_BULK_BUFFER_SIZE       16384
 #define INTR_BUFFER_SIZE           28
 
 /* String IDs */
@@ -743,7 +741,6 @@ static void receive_file_work(struct work_struct *data)
        int64_t count;
        int ret, cur_buf = 0;
        int r = 0;
-       int first_packet = 0;
 
        /* read our parameters */
        smp_rmb();
@@ -759,14 +756,8 @@ static void receive_file_work(struct work_struct *data)
                        read_req = dev->rx_req[cur_buf];
                        cur_buf = (cur_buf + 1) % RX_REQ_MAX;
 
-                       if (first_packet == 0) {
-                               read_req->length = 16384;
-                               first_packet = 1;
-                       } else {
-                               read_req->length = (count > MTP_BULK_BUFFER_SIZE
+                       read_req->length = (count > MTP_BULK_BUFFER_SIZE
                                        ? MTP_BULK_BUFFER_SIZE : count);
-                       }
-
                        dev->rx_done = 0;
                        ret = usb_ep_queue(dev->ep_out, read_req, GFP_KERNEL);
                        if (ret < 0) {