aboutsummaryrefslogtreecommitdiffstats
path: root/firmware/zpu/apps/txrx_uhd.c
diff options
context:
space:
mode:
authorJosh Blum <josh@joshknows.com>2011-03-03 19:26:32 -0800
committerJosh Blum <josh@joshknows.com>2011-03-03 19:26:32 -0800
commitd93a2cf7c904964ba7f41f4d654b18e099df7451 (patch)
treea55f8d56904a8a4f8fe96dbf7c38177b4c662c5c /firmware/zpu/apps/txrx_uhd.c
parent942c69b710510e6143a6f3c22bbe3ff0687f4bc6 (diff)
downloaduhd-d93a2cf7c904964ba7f41f4d654b18e099df7451.tar.gz
uhd-d93a2cf7c904964ba7f41f4d654b18e099df7451.tar.bz2
uhd-d93a2cf7c904964ba7f41f4d654b18e099df7451.zip
usrp2: work on mtu discovery
added echo routine to the firmware and discovery routine to host the implementation is integrated into the factory function and appears to work on linux
Diffstat (limited to 'firmware/zpu/apps/txrx_uhd.c')
-rw-r--r--firmware/zpu/apps/txrx_uhd.c17
1 files changed, 13 insertions, 4 deletions
diff --git a/firmware/zpu/apps/txrx_uhd.c b/firmware/zpu/apps/txrx_uhd.c
index 0c93d2352..68c24e872 100644
--- a/firmware/zpu/apps/txrx_uhd.c
+++ b/firmware/zpu/apps/txrx_uhd.c
@@ -203,10 +203,7 @@ static void handle_udp_ctrl_packet(
* Peek and Poke Register
******************************************************************/
case USRP2_CTRL_ID_POKE_THIS_REGISTER_FOR_ME_BRO:
- if (0){//ctrl_data_in->data.poke_args.addr < 0xC000){
- printf("error! tried to poke into 0x%x\n", ctrl_data_in->data.poke_args.addr);
- }
- else switch(ctrl_data_in->data.poke_args.num_bytes){
+ switch(ctrl_data_in->data.poke_args.num_bytes){
case sizeof(uint32_t):
*((uint32_t *) ctrl_data_in->data.poke_args.addr) = (uint32_t)ctrl_data_in->data.poke_args.data;
break;
@@ -241,6 +238,9 @@ static void handle_udp_ctrl_packet(
ctrl_data_out.id = USRP2_CTRL_ID_WOAH_I_DEFINITELY_PEEKED_IT_DUDE;
break;
+ /*******************************************************************
+ * UART Control
+ ******************************************************************/
case USRP2_CTRL_ID_SO_LIKE_CAN_YOU_READ_THIS_UART_BRO:{
//executes a readline()-style read, up to num_bytes long, up to and including newline
int num_bytes = ctrl_data_in->data.uart_args.bytes;
@@ -263,6 +263,15 @@ static void handle_udp_ctrl_packet(
break;
}
+ /*******************************************************************
+ * Echo test
+ ******************************************************************/
+ case USRP2_CTRL_ID_HOLLER_AT_ME_BRO:
+ ctrl_data_out.data.echo_args.len = payload_len;
+ ctrl_data_out.id = USRP2_CTRL_ID_HOLLER_BACK_DUDE;
+ send_udp_pkt(USRP2_UDP_CTRL_PORT, src, &ctrl_data_out, ctrl_data_in->data.echo_args.len);
+ return;
+
default:
ctrl_data_out.id = USRP2_CTRL_ID_HUH_WHAT;
}