diff options
author | Josh Blum <josh@joshknows.com> | 2010-11-05 19:55:19 -0700 |
---|---|---|
committer | Josh Blum <josh@joshknows.com> | 2010-11-05 19:55:19 -0700 |
commit | 13d735c65e40af23f978f96b5b418712976ab5f2 (patch) | |
tree | 020be6fd66df9a9d8ed9f328fa7c50713b6daa71 /firmware/microblaze/apps | |
parent | 9d50dea1c2f884835b606ccaa1444e5de96926cb (diff) | |
parent | f740a51cc0737b07fd4906f8ca80683ec6e87faa (diff) | |
download | uhd-13d735c65e40af23f978f96b5b418712976ab5f2.tar.gz uhd-13d735c65e40af23f978f96b5b418712976ab5f2.tar.bz2 uhd-13d735c65e40af23f978f96b5b418712976ab5f2.zip |
Merge branch 'mb_eeprom'
Diffstat (limited to 'firmware/microblaze/apps')
-rw-r--r-- | firmware/microblaze/apps/txrx_uhd.c | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/firmware/microblaze/apps/txrx_uhd.c b/firmware/microblaze/apps/txrx_uhd.c index 1dd6e80ac..b7837f207 100644 --- a/firmware/microblaze/apps/txrx_uhd.c +++ b/firmware/microblaze/apps/txrx_uhd.c @@ -422,6 +422,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){ @@ -479,15 +480,18 @@ 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); + //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, @@ -536,7 +540,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. |