commit-gnuradio
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Commit-gnuradio] r10683 - in gnuradio/branches/developers/eb/t378/usrp2


From: eb
Subject: [Commit-gnuradio] r10683 - in gnuradio/branches/developers/eb/t378/usrp2: firmware/include host/lib
Date: Wed, 25 Mar 2009 13:44:05 -0600 (MDT)

Author: eb
Date: 2009-03-25 13:44:05 -0600 (Wed, 25 Mar 2009)
New Revision: 10683

Modified:
   
gnuradio/branches/developers/eb/t378/usrp2/firmware/include/usrp2_eth_packet.h
   gnuradio/branches/developers/eb/t378/usrp2/host/lib/usrp2_impl.cc
Log:
Trial partial fix for ticket:378.


Modified: 
gnuradio/branches/developers/eb/t378/usrp2/firmware/include/usrp2_eth_packet.h
===================================================================
--- 
gnuradio/branches/developers/eb/t378/usrp2/firmware/include/usrp2_eth_packet.h  
    2009-03-25 19:14:52 UTC (rev 10682)
+++ 
gnuradio/branches/developers/eb/t378/usrp2/firmware/include/usrp2_eth_packet.h  
    2009-03-25 19:44:05 UTC (rev 10683)
@@ -150,6 +150,7 @@
  */
 
 #define U2_MAX_SAMPLES 371
+#define        U2_MIN_SAMPLES    9
 
 typedef struct {
   u2_eth_packet_t      hdrs;

Modified: gnuradio/branches/developers/eb/t378/usrp2/host/lib/usrp2_impl.cc
===================================================================
--- gnuradio/branches/developers/eb/t378/usrp2/host/lib/usrp2_impl.cc   
2009-03-25 19:14:52 UTC (rev 10682)
+++ gnuradio/branches/developers/eb/t378/usrp2/host/lib/usrp2_impl.cc   
2009-03-25 19:44:05 UTC (rev 10683)
@@ -932,10 +932,8 @@
     if (nitems == 0)
       return true;
 
-    // FIXME there's the possibility that we send fewer than 9 items in a 
frame.
-    // That would end up glitching the transmitter, since the ethernet will 
pad to
-    // 64-bytes total (9 items).  We really need some part of the stack to
-    // carry the real length (thdr?).
+    // FIXME can't deal with nitems < U2_MIN_SAMPLES (will be fixed in VRT)
+    // FIXME need to check the MTU instead of assuming 1500 bytes
 
     // fragment as necessary then fire away
 
@@ -965,7 +963,12 @@
 
       init_etf_hdrs(&hdrs, d_addr, flags, channel, timestamp);
 
-      size_t i = std::min((size_t) U2_MAX_SAMPLES, nitems - n);
+      // Avoid short packet by splitting last two packets if reqd
+      size_t i;
+      if ((nitems - n) > U2_MAX_SAMPLES && (nitems - n) < (U2_MAX_SAMPLES + 
U2_MIN_SAMPLES))
+       i = (nitems - n) / 2;
+      else
+       i = std::min((size_t) U2_MAX_SAMPLES, nitems - n);
 
       eth_iovec iov[2];
       iov[0].iov_base = &hdrs;





reply via email to

[Prev in Thread] Current Thread [Next in Thread]