On 02/02/2010 07:40 AM, Arnim Läuger wrote:
I sent this patch in last July, but got no response yet. So let me try
it again. The below description the patch are same as my last July post.

Sorry I missed this one.

No problem.

Is it OK?

Looks ok from my point of view.
It might flush redundantly for an empty send buffer if len is larger
than URJ_USBCONN_FTDX_MAXSEND. But that's tolerated anyway in
usbconn_ftdi_flush().

Could you please add the same in libftd2xx.c?

Yes. Attached is what I have committed.


Jie
2010-02-02  Jie Zhang  <[email protected]>

  * src/tap/usbconn/libftdi.c (usbconn_ftdi_write): Make sure
    scheduled send bytes be less than URJ_USBCONN_FTDX_MAXSEND.
  * src/tap/usbconn/libftd2xx.c (usbconn_ftd2xx_write): Likewise.


Index: src/tap/usbconn/libftd2xx.c
===================================================================
--- src/tap/usbconn/libftd2xx.c	(revision 1752)
+++ src/tap/usbconn/libftd2xx.c	(working copy)
@@ -249,7 +249,7 @@ usbconn_ftd2xx_write (urj_usbconn_t *con
        with this write
        Case B: max number of scheduled send bytes has been reached */
     if ((p->to_recv + recv > URJ_USBCONN_FTD2XX_MAXRECV)
-        || ((p->send_buffered > URJ_USBCONN_FTDX_MAXSEND)
+        || ((p->send_buffered + len > URJ_USBCONN_FTDX_MAXSEND)
             && (p->to_recv == 0)))
         xferred = usbconn_ftd2xx_flush (p);
 
Index: src/tap/usbconn/libftdi.c
===================================================================
--- src/tap/usbconn/libftdi.c	(revision 1752)
+++ src/tap/usbconn/libftdi.c	(working copy)
@@ -193,7 +193,7 @@ usbconn_ftdi_write (urj_usbconn_t *conn,
        with this write
        Case B: max number of scheduled send bytes has been reached */
     if ((p->to_recv + recv > URJ_USBCONN_FTDI_MAXRECV)
-        || ((p->send_buffered > URJ_USBCONN_FTDX_MAXSEND)
+        || ((p->send_buffered + len > URJ_USBCONN_FTDX_MAXSEND)
             && (p->to_recv == 0)))
         xferred = usbconn_ftdi_flush (p);
 
------------------------------------------------------------------------------
The Planet: dedicated and managed hosting, cloud storage, colocation
Stay online with enterprise data centers and the best network in the business
Choose flexible plans and management services without long-term contracts
Personal 24x7 support from experience hosting pros just a phone call away.
http://p.sf.net/sfu/theplanet-com
_______________________________________________
UrJTAG-development mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/urjtag-development

Reply via email to