Use max_packet_size

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Use max_packet_size

Uwe Bonnes

ftdi->max_packet_size is the best value we can get, mostly taken from the
descriptor and so right even after a 1.0 Hub
--
Uwe Bonnes                [hidden email]

Institut fuer Kernphysik  Schlossgartenstrasse 9  64289 Darmstadt
--------- Tel. 06151 162516 -------- Fax. 06151 164321 ----------
diff --git a/src/ftdi.c b/src/ftdi.c
index 22e746d..5326b14 100644
--- a/src/ftdi.c
+++ b/src/ftdi.c
@@ -1163,11 +1163,7 @@ static void ftdi_read_data_cb(struct libusb_transfer *transfer)
     struct ftdi_context *ftdi = tc->ftdi;
     int packet_size, actual_length, num_of_chunks, chunk_remains, i, ret;
 
-    // New hi-speed devices from FTDI use a packet size of 512 bytes
-    if (ftdi->type == TYPE_2232H || ftdi->type == TYPE_4232H)
-        packet_size = 512;
-    else
-        packet_size = 64;
+    packet_size = ftdi->max_packet_size;
 
     actual_length = transfer->actual_length;
 

--
libftdi - see http://www.intra2net.com/en/developer/libftdi for details.
To unsubscribe send a mail to [hidden email]  

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Use max_packet_size

Jie Zhang-2
On Wed, Feb 3, 2010 at 12:52 AM, Uwe Bonnes
<[hidden email]> wrote:
>
> ftdi->max_packet_size is the best value we can get, mostly taken from the
> descriptor and so right even after a 1.0 Hub

Installed. Thanks.


Jie

--
libftdi - see http://www.intra2net.com/en/developer/libftdi for details.
To unsubscribe send a mail to [hidden email]  

Loading...