summaryrefslogtreecommitdiffstats
path: root/firmware/microblaze/apps
diff options
context:
space:
mode:
authorNick Foster <nick@nerdnetworks.org>2010-11-10 12:15:35 -0800
committerNick Foster <nick@nerdnetworks.org>2010-11-10 12:15:35 -0800
commitfb0cdbc553d288402ee7939dc72f4368eb9e8e1b (patch)
treee20003155af08428448a7834a82d259f3b68717d /firmware/microblaze/apps
parent8fe1e7b29aacce7f75ae36e81706bbde02749b97 (diff)
parent8c434f7d63aca25b55d6d13dffcc1d7037261d4f (diff)
downloaduhd-fb0cdbc553d288402ee7939dc72f4368eb9e8e1b.tar.gz
uhd-fb0cdbc553d288402ee7939dc72f4368eb9e8e1b.tar.bz2
uhd-fb0cdbc553d288402ee7939dc72f4368eb9e8e1b.zip
Merge branch 'master' of ettus.sourcerepo.com:ettus/uhdpriv into usrp2p-next
Conflicts: firmware/microblaze/lib/u2_init.c host/lib/usrp/usrp2/clock_ctrl.cpp host/lib/usrp/usrp2/fw_common.h host/lib/usrp/usrp2/mboard_impl.cpp host/lib/usrp/usrp2/usrp2_iface.cpp host/lib/usrp/usrp2/usrp2_iface.hpp
Diffstat (limited to 'firmware/microblaze/apps')
-rw-r--r--firmware/microblaze/apps/txrx_uhd.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/firmware/microblaze/apps/txrx_uhd.c b/firmware/microblaze/apps/txrx_uhd.c
index 482332f7c..d00f2bc1f 100644
--- a/firmware/microblaze/apps/txrx_uhd.c
+++ b/firmware/microblaze/apps/txrx_uhd.c
@@ -446,6 +446,7 @@ link_changed_callback(int speed)
link_is_up = speed != 0;
hal_set_leds(link_is_up ? LED_RJ45 : 0x0, LED_RJ45);
printf("\neth link changed: speed = %d\n", speed);
+ if (link_is_up) send_gratuitous_arp();
}
static void setup_network(void){
@@ -503,16 +504,19 @@ main(void)
printf("FPGA compatibility number: %d\n", USRP2_FPGA_COMPAT_NUM);
printf("Firmware compatibility number: %d\n", USRP2_FW_COMPAT_NUM);
- ethernet_register_link_changed_callback(link_changed_callback);
- ethernet_init();
-
+ //1) register the addresses into the network stack
register_mac_addr(ethernet_mac_addr());
register_ip_addr(get_ip_addr());
+ //2) register callbacks for udp ports we service
register_udp_listener(USRP2_UDP_CTRL_PORT, handle_udp_ctrl_packet);
register_udp_listener(USRP2_UDP_DATA_PORT, handle_udp_data_packet);
register_udp_listener(USRP2_UDP_UPDATE_PORT, handle_udp_fw_update_packet);
+ //3) setup ethernet hardware to bring the link up
+ ethernet_register_link_changed_callback(link_changed_callback);
+ ethernet_init();
+
// initialize double buffering state machine for ethernet -> DSP Tx
dbsm_init(&dsp_tx_sm, DSP_TX_BUF_0,
@@ -561,7 +565,7 @@ main(void)
}
if (pending & PIC_OVERRUN_INT){
- dbsm_handle_rx_overrun(&dsp_rx_sm);
+ //dbsm_handle_rx_overrun(&dsp_rx_sm);
pic_regs->pending = PIC_OVERRUN_INT; // clear pending interrupt
// FIXME Figure out how to handle this robustly.