提交 70ffe6e1 编写于 作者: A Alan Stern 提交者: Greg Kroah-Hartman

[PATCH] USB: g_file_storage: Set short_not_ok for bulk-out transfers

I'm told that some UDC hardware may work better if it knows that
receiving a short packet should always cause an error.  Accordingly,
this patch (as663) sets the short_not_ok flag for bulk-out transfers in
g_file_storage.  Oddly enough, there are no circumstances where that
driver can legally receive a shorter-than-expected bulk-out packet.
Signed-off-by: NAlan Stern <stern@rowland.harvard.edu>
Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
上级 7e1c0b86
...@@ -1795,6 +1795,7 @@ static int do_write(struct fsg_dev *fsg) ...@@ -1795,6 +1795,7 @@ static int do_write(struct fsg_dev *fsg)
* the bulk-out maxpacket size */ * the bulk-out maxpacket size */
bh->outreq->length = bh->bulk_out_intended_length = bh->outreq->length = bh->bulk_out_intended_length =
amount; amount;
bh->outreq->short_not_ok = 1;
start_transfer(fsg, fsg->bulk_out, bh->outreq, start_transfer(fsg, fsg->bulk_out, bh->outreq,
&bh->outreq_busy, &bh->state); &bh->outreq_busy, &bh->state);
fsg->next_buffhd_to_fill = bh->next; fsg->next_buffhd_to_fill = bh->next;
...@@ -2398,6 +2399,7 @@ static int throw_away_data(struct fsg_dev *fsg) ...@@ -2398,6 +2399,7 @@ static int throw_away_data(struct fsg_dev *fsg)
* the bulk-out maxpacket size */ * the bulk-out maxpacket size */
bh->outreq->length = bh->bulk_out_intended_length = bh->outreq->length = bh->bulk_out_intended_length =
amount; amount;
bh->outreq->short_not_ok = 1;
start_transfer(fsg, fsg->bulk_out, bh->outreq, start_transfer(fsg, fsg->bulk_out, bh->outreq,
&bh->outreq_busy, &bh->state); &bh->outreq_busy, &bh->state);
fsg->next_buffhd_to_fill = bh->next; fsg->next_buffhd_to_fill = bh->next;
...@@ -3029,6 +3031,7 @@ static int get_next_command(struct fsg_dev *fsg) ...@@ -3029,6 +3031,7 @@ static int get_next_command(struct fsg_dev *fsg)
/* Queue a request to read a Bulk-only CBW */ /* Queue a request to read a Bulk-only CBW */
set_bulk_out_req_length(fsg, bh, USB_BULK_CB_WRAP_LEN); set_bulk_out_req_length(fsg, bh, USB_BULK_CB_WRAP_LEN);
bh->outreq->short_not_ok = 1;
start_transfer(fsg, fsg->bulk_out, bh->outreq, start_transfer(fsg, fsg->bulk_out, bh->outreq,
&bh->outreq_busy, &bh->state); &bh->outreq_busy, &bh->state);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册