Merge branch 'new_eth' of http://gnuradio.org/git/matt into new_eth
authorEric Blossom <eb@comsec.com>
Fri, 4 Sep 2009 22:51:52 +0000 (15:51 -0700)
committerEric Blossom <eb@comsec.com>
Fri, 4 Sep 2009 22:51:52 +0000 (15:51 -0700)
* 'new_eth' of http://gnuradio.org/git/matt:
  properly set the address filter
  stop sending short ethernet command packets.
  Fix problem with commands timing out (specifically stop_rx_streaming)
  Fix race condition that caused commands such as stop_rx_streaming to fail.
  Fixing a line in the clock recovery algorithm. This works with a bit larger error than there proably should be.
  Better fix for broken AC_PROG_F77 macro
  Fix Python header check failure due to invalid cached state
  waterfall and fft use a common autoscale function
  Fix so that the waterfall texture is initialized with a buffer of the same size.
  Modifications to usrp2 source and sink so that set center freq is called afer set lo offset.
  Modifications to the usrp blocks and wrapper so that the lo offset is set with the lo frequency.
  Removed subversion related configuration info.
  Expand frequency ranges to match hardware capability.
  Modified log power fft block so ref scale is peak to peak.
  Adding clock sync algorithm using PFB. This works, but needs a bit more work.

13 files changed:
usrp2/firmware/apps/app_common_v2.c
usrp2/firmware/apps/app_passthru_v2.c
usrp2/firmware/apps/factory_test.c
usrp2/firmware/apps/gen_eth_packets.c
usrp2/firmware/apps/gen_pause_frames.c
usrp2/firmware/apps/mimo_app_common_v2.c
usrp2/firmware/apps/mimo_tx.c
usrp2/firmware/apps/mimo_tx_slave.c
usrp2/firmware/apps/rcv_eth_packets.c
usrp2/firmware/apps/serdes_txrx.c
usrp2/firmware/apps/tx_standalone.c
usrp2/firmware/apps/txrx.c
usrp2/firmware/lib/dbsm.c

index 6d9606d45e980f9eafebb2d1b3bd6ad1debb629f..67cccd53b43131bc0ef6acad563963634231cef9 100644 (file)
@@ -70,6 +70,7 @@ void
 set_reply_hdr(u2_eth_packet_t *reply_pkt, u2_eth_packet_t const *cmd_pkt)
 {
   reply_pkt->ehdr.dst = cmd_pkt->ehdr.src;
+  reply_pkt->ehdr.src = *ethernet_mac_addr();
   reply_pkt->ehdr.ethertype = U2_ETHERTYPE;
   reply_pkt->thdr.flags = 0;
   reply_pkt->thdr.fifo_status = 0;     // written by protocol engine
@@ -599,7 +600,7 @@ bool
 eth_pkt_inspector(dbsm_t *sm, int bufno)
 {
   u2_eth_packet_t *pkt = (u2_eth_packet_t *) buffer_ram(bufno);
-  size_t byte_len = (buffer_pool_status->last_line[bufno] - 3) * 4;
+  size_t byte_len = (buffer_pool_status->last_line[bufno] - 1) * 4;
 
   //static size_t last_len = 0;
 
index 660bcd774fafeb4a6992386c21f12b047cb6a607..406c56b3b8f460d38f1d88937f43485e1a5669b6 100644 (file)
@@ -42,6 +42,7 @@ void
 set_reply_hdr(u2_eth_packet_t *reply_pkt, u2_eth_packet_t const *cmd_pkt)
 {
   reply_pkt->ehdr.dst = cmd_pkt->ehdr.src;
+  reply_pkt->ehdr.src = *ethernet_mac_addr();
   reply_pkt->ehdr.ethertype = U2_ETHERTYPE;
   reply_pkt->thdr.flags = 0;
   reply_pkt->thdr.fifo_status = 0;     // written by protocol engine
index b4b44dbdb99fef34c44c67eb15262cef8cf7aa48..a4bc06d58cf5cc523e4c3b171ca314dc5f635998 100644 (file)
@@ -170,6 +170,7 @@ start_rx_streaming_cmd(const u2_mac_addr_t *host, op_start_rx_streaming_t *p)
   u2_eth_packet_t      pkt;
   memset(&pkt, 0, sizeof(pkt));
   pkt.ehdr.dst = *host;
+  pkt.ehdr.src = *ethernet_mac_addr();
   pkt.ehdr.ethertype = U2_ETHERTYPE;
   u2p_set_word0(&pkt.fixed, 0, 0);
   // DSP RX will fill in timestamp
index dd29967524fb3a54411527f9172644fbb9ca8af2..5cda5bb8eca67f9d0f632c0c1a3b177316da8116 100644 (file)
@@ -104,8 +104,7 @@ init_packets(void)
   memset(&pkt, 0, sizeof(pkt));
 
   pkt.ehdr.dst = dst_mac_addr;
-  // src address filled in by mac
-
+  pkt.ehdr.src = *ethernet_mac_addr();
   pkt.ehdr.ethertype = U2_ETHERTYPE;
   pkt.fixed.word0 = 0x01234567;
   pkt.fixed.timestamp = 0xffffffff;
@@ -148,8 +147,6 @@ main(void)
   }
   */
 
-  link_is_up = true;           /* FIXME tell s/w link is up */
-
   // fire off a receive from the ethernet
   bp_receive_to_buf(CPU_RX_BUF, PORT_ETH, 1, 0, BP_LAST_LINE);
 
index 4eaebcc4aa3a0b6cd5de7ee9aaad0be37933f67d..8f2b2df0389ee964192a2e1090d1b8a649ce948f 100644 (file)
@@ -132,9 +132,9 @@ init_packets(void)
   u2_eth_packet_t      pkt __attribute__((aligned (4)));
 
   for (i = 0; i < 6; i++){
-    pkt.ehdr.dst_addr[i] = dst_mac_addr[i];
-    pkt.ehdr.src_addr[i] = 0;                  // filled in by mac
+    pkt.ehdr.dst.addr[i] = dst_mac_addr[i];
   }
+  pkt.ehdr.src = *ethernet_mac_addr();
   pkt.ehdr.ethertype = U2_ETHERTYPE;
 
   // fill ALL buffers for debugging
index e5ab55fac6513e50c387f7399d840ce7aad13e2a..5dbecb0d0112ae900868038ae8668b40084b6e13 100644 (file)
@@ -67,6 +67,7 @@ void
 set_reply_hdr(u2_eth_packet_t *reply_pkt, u2_eth_packet_t const *cmd_pkt)
 {
   reply_pkt->ehdr.dst = cmd_pkt->ehdr.src;
+  reply_pkt->ehdr.src = *ethernet_mac_addr();
   reply_pkt->ehdr.ethertype = U2_ETHERTYPE;
   reply_pkt->thdr.flags = 0;
   reply_pkt->thdr.fifo_status = 0;     // written by protocol engine
index 730433bf4ff5982febb5e679edea19e18788c1b0..7fc7b486f8ef7b5850c1c02e32a7170e52eace75 100644 (file)
@@ -179,6 +179,7 @@ start_rx_streaming_cmd(const u2_mac_addr_t *host, op_start_rx_streaming_t *p)
   u2_eth_packet_t      pkt;
   memset(&pkt, 0, sizeof(pkt));
   pkt.ehdr.dst = *host;
+  pkt.ehdr.src = *ethernet_mac_addr();
   pkt.ehdr.ethertype = U2_ETHERTYPE;
   u2p_set_word0(&pkt.fixed, 0, 0);
   // DSP RX will fill in timestamp
index df7ddf9c43c4177d2308ec067c29e4c5c088c4dc..e7da984c5e2d1218a1c7ed319faa15b212a986af 100644 (file)
@@ -176,6 +176,7 @@ start_rx_streaming_cmd(const u2_mac_addr_t *host, op_start_rx_streaming_t *p)
   u2_eth_packet_t      pkt;
   memset(&pkt, 0, sizeof(pkt));
   pkt.ehdr.dst = *host;
+  pkt.ehdr.src = *ethernet_mac_addr();
   pkt.ehdr.ethertype = U2_ETHERTYPE;
   u2p_set_word0(&pkt.fixed, 0, 0);
   // DSP RX will fill in timestamp
index 92e41d92b8c381b0dd5172cbbfb4b2adf3122ff6..ec772ca753d847e643c12828b13944b60396be27 100644 (file)
@@ -135,7 +135,7 @@ init_packets(void)
   u2_eth_packet_t      pkt __attribute__((aligned (4)));
 
   pkt.ehdr.dst = dst_mac_addr;
-  // src filled in by mac
+  pkt.ehdr.src = *ethernet_mac_addr();
   pkt.ehdr.ethertype = U2_ETHERTYPE;
 
   // fill ALL buffers for debugging
index 1becc205ec52809ad604fa9502c73230936b69af..7816f7a653e5fc28a071a8e128d0ba527748a214 100644 (file)
@@ -168,6 +168,7 @@ start_rx_streaming_cmd(const u2_mac_addr_t *host, op_start_rx_streaming_t *p)
   u2_eth_packet_t      pkt;
   memset(&pkt, 0, sizeof(pkt));
   pkt.ehdr.dst = *host;
+  pkt.ehdr.src = *ethernet_mac_addr();
   pkt.ehdr.ethertype = U2_ETHERTYPE;
   u2p_set_word0(&pkt.fixed, 0, 0);
   // DSP RX will fill in timestamp
index 25ba8fd40aed8cba2b3ea0d0f5f9570f8afaac2d..6350a69566cd06f68eff6465f9dd3b16edee2796 100644 (file)
@@ -195,6 +195,7 @@ start_tx_transfers(void)
   u2_eth_packet_t      pkt;
   memset(&pkt, 0, sizeof(pkt));
   //pkt.ehdr.dst = *host;
+  pkt.ehdr.src = *ethernet_mac_addr();
   pkt.ehdr.ethertype = U2_ETHERTYPE;
   u2p_set_word0(&pkt.fixed,
                U2P_TX_IMMEDIATE | U2P_TX_START_OF_BURST, 0);
index 935e62a729910a0378b63281e0122f35af789948..fc2f8a49eb50a8c52f058f3fd07016ce91f9bf33 100644 (file)
@@ -168,6 +168,7 @@ start_rx_streaming_cmd(const u2_mac_addr_t *host, op_start_rx_streaming_t *p)
   u2_eth_packet_t      pkt;
   memset(&pkt, 0, sizeof(pkt));
   pkt.ehdr.dst = *host;
+  pkt.ehdr.src = *ethernet_mac_addr();
   pkt.ehdr.ethertype = U2_ETHERTYPE;
   u2p_set_word0(&pkt.fixed, 0, 0);
   // DSP RX will fill in timestamp
index 8f774d9162bfe090b6ceaf380b76d35fb2c9268b..96484d577bd36a901dfb8a5a1a08d7e6dfc26c0b 100644 (file)
@@ -62,7 +62,8 @@ dbsm_init(dbsm_t *sm, int buf0,
 
   // How much to adjust the last_line register.
   // It's 1 for everything but the ethernet.
-  sm->last_line_adj = recv->port == PORT_ETH ? 3 : 1;
+  //sm->last_line_adj = recv->port == PORT_ETH ? 3 : 1;
+  sm->last_line_adj = 1;
 
   buffer_state[sm->buf0] = BS_EMPTY;
   buffer_state[sm->buf0 ^ 1] = BS_EMPTY;