summaryrefslogtreecommitdiffstats
path: root/firmware/microblaze
diff options
context:
space:
mode:
Diffstat (limited to 'firmware/microblaze')
-rw-r--r--firmware/microblaze/apps/txrx_uhd.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/firmware/microblaze/apps/txrx_uhd.c b/firmware/microblaze/apps/txrx_uhd.c
index 7ad4ab110..21803b199 100644
--- a/firmware/microblaze/apps/txrx_uhd.c
+++ b/firmware/microblaze/apps/txrx_uhd.c
@@ -100,7 +100,7 @@ typedef struct{
#define MK_RX_CTRL_WORD(num_words) (((num_words)*sizeof(uint32_t)) | (1 << 16))
// DSP Rx writes ethernet header words
-#define DSP_RX_FIRST_LINE 1 //1 = number of control words (see above)
+#define DSP_RX_FIRST_LINE ((offsetof(rx_dsp_buff_t, vrt_header))/sizeof(uint32_t))
// receive from DSP
buf_cmd_args_t dsp_rx_recv_args = {
@@ -177,7 +177,7 @@ void handle_udp_ctrl_packet(
unsigned char *payload, int payload_len
){
//printf("Got ctrl packet #words: %d\n", (int)payload_len);
- usrp2_ctrl_data_t *ctrl_data_in = (usrp2_ctrl_data_t *)payload;
+ const usrp2_ctrl_data_t *ctrl_data_in = (usrp2_ctrl_data_t *)payload;
uint32_t ctrl_data_in_id = ctrl_data_in->id;
//ensure that the protocol versions match
@@ -288,15 +288,15 @@ void handle_udp_ctrl_packet(
case USRP2_CTRL_ID_PEEK_AT_THIS_REGISTER_FOR_ME_BRO:
switch(ctrl_data_in->data.poke_args.num_bytes){
case sizeof(uint32_t):
- ctrl_data_in->data.poke_args.data = *((uint32_t *) ctrl_data_in->data.poke_args.addr);
+ ctrl_data_out.data.poke_args.data = *((uint32_t *) ctrl_data_in->data.poke_args.addr);
break;
case sizeof(uint16_t):
- ctrl_data_in->data.poke_args.data = *((uint16_t *) ctrl_data_in->data.poke_args.addr);
+ ctrl_data_out.data.poke_args.data = *((uint16_t *) ctrl_data_in->data.poke_args.addr);
break;
case sizeof(uint8_t):
- ctrl_data_in->data.poke_args.data = *((uint8_t *) ctrl_data_in->data.poke_args.addr);
+ ctrl_data_out.data.poke_args.data = *((uint8_t *) ctrl_data_in->data.poke_args.addr);
break;
}
@@ -423,7 +423,7 @@ fw_sets_seqno_inspector(dbsm_t *sm, int buf_this) // returns false
{
// insert the correct length into the control word and vrt header
rx_dsp_buff_t *buff = (rx_dsp_buff_t*)buffer_ram(buf_this);
- size_t vrt_len = buffer_pool_status->last_line[buf_this]-1;
+ size_t vrt_len = buffer_pool_status->last_line[buf_this]-DSP_RX_FIRST_LINE;
buff->control_word = MK_RX_CTRL_WORD(vrt_len);
buff->vrt_header[0] = (buff->vrt_header[0] & ~VRTH_PKT_SIZE_MASK) | (vrt_len & VRTH_PKT_SIZE_MASK);