commit-gnuradio
[Top][All Lists]
Advanced

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

[Commit-gnuradio] r6870 - gnuradio/branches/developers/matt/u2f/firmware


From: eb
Subject: [Commit-gnuradio] r6870 - gnuradio/branches/developers/matt/u2f/firmware
Date: Mon, 12 Nov 2007 16:38:39 -0700 (MST)

Author: eb
Date: 2007-11-12 16:38:39 -0700 (Mon, 12 Nov 2007)
New Revision: 6870

Modified:
   gnuradio/branches/developers/matt/u2f/firmware/gen_eth_packets.c
   gnuradio/branches/developers/matt/u2f/firmware/rcv_eth_packets.c
Log:
init all buffers

Modified: gnuradio/branches/developers/matt/u2f/firmware/gen_eth_packets.c
===================================================================
--- gnuradio/branches/developers/matt/u2f/firmware/gen_eth_packets.c    
2007-11-12 18:08:38 UTC (rev 6869)
+++ gnuradio/branches/developers/matt/u2f/firmware/gen_eth_packets.c    
2007-11-12 23:38:39 UTC (rev 6870)
@@ -134,27 +134,18 @@
 
 
 static void
-init_packet(int *buf, const ethernet_packet_t *pkt)
+init_packet(int *buf, const ethernet_packet_t *pkt, int bufnum)
 {
-  // copy header into buffer
-  memcpy_wordaligned(buf, pkt, sizeof(*pkt));
-
-  union {
-    int         i;
-    char c[4];
-  } u;
-
-  int *p = (int *)((char *) buf + sizeof(*pkt));
-  int *end = buf + BUFFER_POOL_BUFFER_SIZE;
-
   int i = 0;
-  for (; p < end; p++, i += 4){
-    u.c[0] = i;
-    u.c[1] = i+1;
-    u.c[2] = i+2;
-    u.c[3] = i+3;
-    *p = u.i;
+  int mark = ((bufnum & 0xff) << 24) | 0x005A0000;
+
+  for (i = 0; i < BUFFER_POOL_BUFFER_SIZE; i++){
+    buf[i] = mark | i;
+    mark ^= 0x00FF00000;
   }
+
+  // copy header into buffer
+  memcpy_wordaligned(buf, pkt, sizeof(*pkt));
 }
 
 static void
@@ -170,8 +161,9 @@
   }
   pkt.ehdr.ethertype = U2_ETHERTYPE;
 
-  init_packet((void *)buffer_ram(0), &pkt);
-  init_packet((void *)buffer_ram(1), &pkt);
+  // fill ALL buffers for debugging
+  for (i = 0; i < 8; i++)
+    init_packet((void *)buffer_ram(i), &pkt, i);
 }
 
 static int led_counter = 0;
@@ -201,9 +193,8 @@
   eth_mac_init();
   eth_driver_init();
 
-  eth_mac->speed = 4;  // FIXME hardcode mac speed to 1000
+  // eth_mac->speed = 4;       // FIXME hardcode mac speed to 1000
 
-
   while(1){
     if (link_is_up && send_packet_now){
       send_packet_now = false;

Modified: gnuradio/branches/developers/matt/u2f/firmware/rcv_eth_packets.c
===================================================================
--- gnuradio/branches/developers/matt/u2f/firmware/rcv_eth_packets.c    
2007-11-12 18:08:38 UTC (rev 6869)
+++ gnuradio/branches/developers/matt/u2f/firmware/rcv_eth_packets.c    
2007-11-12 23:38:39 UTC (rev 6870)
@@ -220,8 +220,8 @@
 
   eth_mac_init();
   eth_driver_init();
-  eth_mac->speed = 4;  // FIXME hardcode mac speed to 1000
 
+  //eth_mac->speed = 4;        // FIXME hardcode mac speed to 1000
 
   // kick off a receive
   bp_receive_to_buf(2, PORT_ETH, 1, 0, 511);





reply via email to

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