summaryrefslogtreecommitdiff
path: root/usrp2/firmware/apps
diff options
context:
space:
mode:
authorJohnathan Corgan2009-10-01 11:00:25 -0700
committerJohnathan Corgan2009-10-01 11:07:59 -0700
commitbf76534044a1bbcc665f0400a53d1070cae8caf0 (patch)
treee8405125fed84c239967b1fc9692d5931a25376d /usrp2/firmware/apps
parente5b76a1b9239f560b3aad21d56a7b417f3c8b0b5 (diff)
parent4743bf771fed8405b08194d8c7fb72bf8110eab3 (diff)
downloadgnuradio-bf76534044a1bbcc665f0400a53d1070cae8caf0.tar.gz
gnuradio-bf76534044a1bbcc665f0400a53d1070cae8caf0.tar.bz2
gnuradio-bf76534044a1bbcc665f0400a53d1070cae8caf0.zip
Merge branch 'new_eth' of http://gnuradio.org/git/matt into master
* 'new_eth' of http://gnuradio.org/git/matt: (42 commits) Fix warnings, mostly from implicitly defined wires or unspecified widths fullchip sim now compiles again, after moving eth and models over to new simple_gemac remove unused opencores remove debugging code no idea where this came from, it shouldn't be here Copied wb_1master back from quad radio Remove old mac. Good riddance. remove unused port More xilinx fifos, more clean up of our fifos might as well use a cascade fifo to help timing and give a little more capacity fix a typo which caused tx glitches Untested fixes for getting serdes onto the new fifo system. Compiles, at least Implement Eth flow control using pause frames parameterized fifo sizes, some reformatting remove unused old style fifo allow control of whether or not to honor flow control, adds some debug lines debug the rx side no longer used, replaced by newfifo version remove special last_line adjustment from ethernet port Firmware now inserts mac source address value in each frame. ...
Diffstat (limited to 'usrp2/firmware/apps')
-rw-r--r--usrp2/firmware/apps/app_common_v2.c3
-rw-r--r--usrp2/firmware/apps/app_passthru_v2.c1
-rw-r--r--usrp2/firmware/apps/factory_test.c1
-rw-r--r--usrp2/firmware/apps/gen_eth_packets.c14
-rw-r--r--usrp2/firmware/apps/gen_pause_frames.c4
-rw-r--r--usrp2/firmware/apps/mimo_app_common_v2.c1
-rw-r--r--usrp2/firmware/apps/mimo_tx.c1
-rw-r--r--usrp2/firmware/apps/mimo_tx_slave.c1
-rw-r--r--usrp2/firmware/apps/rcv_eth_packets.c2
-rw-r--r--usrp2/firmware/apps/serdes_txrx.c1
-rw-r--r--usrp2/firmware/apps/tx_standalone.c1
-rw-r--r--usrp2/firmware/apps/txrx.c4
12 files changed, 24 insertions, 10 deletions
diff --git a/usrp2/firmware/apps/app_common_v2.c b/usrp2/firmware/apps/app_common_v2.c
index 6d9606d45..67cccd53b 100644
--- a/usrp2/firmware/apps/app_common_v2.c
+++ b/usrp2/firmware/apps/app_common_v2.c
@@ -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;
diff --git a/usrp2/firmware/apps/app_passthru_v2.c b/usrp2/firmware/apps/app_passthru_v2.c
index 660bcd774..406c56b3b 100644
--- a/usrp2/firmware/apps/app_passthru_v2.c
+++ b/usrp2/firmware/apps/app_passthru_v2.c
@@ -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
diff --git a/usrp2/firmware/apps/factory_test.c b/usrp2/firmware/apps/factory_test.c
index b4b44dbdb..a4bc06d58 100644
--- a/usrp2/firmware/apps/factory_test.c
+++ b/usrp2/firmware/apps/factory_test.c
@@ -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
diff --git a/usrp2/firmware/apps/gen_eth_packets.c b/usrp2/firmware/apps/gen_eth_packets.c
index ce1e8160b..5cda5bb8e 100644
--- a/usrp2/firmware/apps/gen_eth_packets.c
+++ b/usrp2/firmware/apps/gen_eth_packets.c
@@ -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;
@@ -141,10 +140,12 @@ main(void)
ethernet_register_link_changed_callback(link_changed_callback);
ethernet_init();
+ /*
if (hwconfig_simulation_p()){
eth_mac->speed = 4; // hardcode mac speed to 1000
link_is_up = true;
}
+ */
// fire off a receive from the ethernet
bp_receive_to_buf(CPU_RX_BUF, PORT_ETH, 1, 0, BP_LAST_LINE);
@@ -159,10 +160,15 @@ main(void)
}
if (status & (BPS_DONE(CPU_TX_BUF) | BPS_ERROR(CPU_TX_BUF))){
+ if (status & BPS_ERROR(CPU_TX_BUF)){
+ putchar('E');
+ }
bp_clear_buf(CPU_TX_BUF);
npackets_sent++;
- if ((npackets_sent & 0xF) == 0) // print after every 16 packets
- print_rmon_regs();
+ if ((npackets_sent & 0xF) == 0){ // print after every 16 packets
+ //print_rmon_regs();
+ putchar('.');
+ }
}
if (link_is_up && send_packet_now && (status & BPS_IDLE(CPU_TX_BUF))){
diff --git a/usrp2/firmware/apps/gen_pause_frames.c b/usrp2/firmware/apps/gen_pause_frames.c
index 4eaebcc4a..8f2b2df03 100644
--- a/usrp2/firmware/apps/gen_pause_frames.c
+++ b/usrp2/firmware/apps/gen_pause_frames.c
@@ -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
diff --git a/usrp2/firmware/apps/mimo_app_common_v2.c b/usrp2/firmware/apps/mimo_app_common_v2.c
index e5ab55fac..5dbecb0d0 100644
--- a/usrp2/firmware/apps/mimo_app_common_v2.c
+++ b/usrp2/firmware/apps/mimo_app_common_v2.c
@@ -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
diff --git a/usrp2/firmware/apps/mimo_tx.c b/usrp2/firmware/apps/mimo_tx.c
index 730433bf4..7fc7b486f 100644
--- a/usrp2/firmware/apps/mimo_tx.c
+++ b/usrp2/firmware/apps/mimo_tx.c
@@ -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
diff --git a/usrp2/firmware/apps/mimo_tx_slave.c b/usrp2/firmware/apps/mimo_tx_slave.c
index df7ddf9c4..e7da984c5 100644
--- a/usrp2/firmware/apps/mimo_tx_slave.c
+++ b/usrp2/firmware/apps/mimo_tx_slave.c
@@ -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
diff --git a/usrp2/firmware/apps/rcv_eth_packets.c b/usrp2/firmware/apps/rcv_eth_packets.c
index 92e41d92b..ec772ca75 100644
--- a/usrp2/firmware/apps/rcv_eth_packets.c
+++ b/usrp2/firmware/apps/rcv_eth_packets.c
@@ -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
diff --git a/usrp2/firmware/apps/serdes_txrx.c b/usrp2/firmware/apps/serdes_txrx.c
index 1becc205e..7816f7a65 100644
--- a/usrp2/firmware/apps/serdes_txrx.c
+++ b/usrp2/firmware/apps/serdes_txrx.c
@@ -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
diff --git a/usrp2/firmware/apps/tx_standalone.c b/usrp2/firmware/apps/tx_standalone.c
index 25ba8fd40..6350a6956 100644
--- a/usrp2/firmware/apps/tx_standalone.c
+++ b/usrp2/firmware/apps/tx_standalone.c
@@ -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);
diff --git a/usrp2/firmware/apps/txrx.c b/usrp2/firmware/apps/txrx.c
index 730ee66c5..b2487ed89 100644
--- a/usrp2/firmware/apps/txrx.c
+++ b/usrp2/firmware/apps/txrx.c
@@ -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
@@ -257,14 +258,13 @@ main(void)
{
u2_init();
- putstr("\nTxRx\n");
+ putstr("\nTxRx-NEWETH\n");
print_mac_addr(ethernet_mac_addr()->addr);
newline();
ethernet_register_link_changed_callback(link_changed_callback);
ethernet_init();
-
#if 0
// make bit 15 of Tx gpio's be a s/w output
hal_gpio_set_sel(GPIO_TX_BANK, 15, 's');