static void dissect_UDPR1(tvbuff_t *tvb, packet_info *pinfo, proto_tree *adwin_tree, proto_tree *adwin_debug_tree, gchar** info_string) { const gchar *status_string; guint32 seq_num, status; status = tvb_get_letohl(tvb, 0); status_string = match_strval_ext(status, &error_code_mapping_ext); if (status_string) { *info_string = ep_strdup_printf("UDPR1 Status: %s", status_string); } else { *info_string = ep_strdup_printf("UDPR1 Undefined error code %d", status); } /* Get the transaction identifier */ seq_num = tvb_get_letohl(tvb, 4); adwin_request_response_handling(tvb, pinfo, adwin_tree, seq_num, ADWIN_RESPONSE); if (! adwin_tree) return; SET_PACKET_TYPE(adwin_tree, APT_UDPR1); ADWIN_ADD_LE(adwin_tree, status, 0, 4); ADWIN_ADD_LE(adwin_tree, packet_index, 4, 4); ADWIN_ADD_LE(adwin_tree, val1, 8, 4); ADWIN_ADD_LE(adwin_tree, val1f, 8, 4); ADWIN_ADD_LE(adwin_tree, val2, 12, 4); ADWIN_ADD_LE(adwin_tree, val3, 16, 4); ADWIN_ADD_LE(adwin_tree, val4, 20, 4); ADWIN_ADD_LE(adwin_debug_tree, unused, 24, 8); }
int PMC_Usr::encode (char *packet, int &packet_length) { if (Options::get_opt (Options::DEBUGGING) != 0) ACE_DEBUG ((LM_DEBUG, "in PMC_Usr::encode")); ACE_NEW_RETURN (this->ss, SL_Client (this->usr_name), -1); SET_PACKET_TYPE (packet, Options::PROTO_USR); char *buf_ptr = SKIP_PACKET_TYPE (packet); buf_ptr = ACE_OS::strecpy (buf_ptr, this->get_next_friend ()->get_login ()); packet_length = buf_ptr - packet; if (Options::get_opt (Options::DEBUGGING) != 0) { ACE_DEBUG ((LM_DEBUG, "packet_length = %d\n", packet_length)); ACE_OS::write (ACE_STDERR, packet, packet_length); ACE_DEBUG ((LM_DEBUG, "\n")); } return 1; }
static void dissect_UDPR2(tvbuff_t *tvb, packet_info *pinfo, proto_tree *adwin_tree, proto_tree *adwin_debug_tree, gchar** info_string) { const gchar *status_string; guint32 i, status, seq_num; status = tvb_get_letohl(tvb, 0); status_string = match_strval_ext(status, &error_code_mapping_ext); if (status_string) { *info_string = ep_strdup_printf("UDPR2 Status: %s", status_string); } else { *info_string = ep_strdup_printf("UDPR2 Undefined error code %d", status); } /* Get the transaction identifier */ seq_num = tvb_get_letohl(tvb, 4); adwin_request_response_handling(tvb, pinfo, adwin_tree, seq_num, ADWIN_RESPONSE); if (! adwin_tree) return; SET_PACKET_TYPE(adwin_tree, APT_UDPR2); ADWIN_ADD_LE(adwin_tree, status, 0, 4); ADWIN_ADD_LE(adwin_tree, packet_index, 4, 4); if (! global_adwin_dissect_data) { proto_tree_add_text(adwin_debug_tree, tvb, 8, 250 * 4, "Data"); return; } for (i = 0; i < 250; i++) { proto_item *item; guint32 offset = 8 + i * sizeof(guint32); gint32 value = tvb_get_letohl(tvb, offset); void * fvalue = &value; proto_tree_add_text(adwin_debug_tree, tvb, offset, 4, "Data[%3d]: %10d - %10f - 0x%08x", i, value, *(float*)fvalue, value); item = ADWIN_ADD_LE(adwin_debug_tree, data_int, offset, 4); PROTO_ITEM_SET_HIDDEN(item); item = ADWIN_ADD_LE(adwin_debug_tree, data_float, offset, 4); PROTO_ITEM_SET_HIDDEN(item); item = ADWIN_ADD_LE(adwin_debug_tree, data_hex, offset, 4); PROTO_ITEM_SET_HIDDEN(item); } }
int PMC_All::encode (char *packet, int &packet_length) { if (Options::get_opt (Options::DEBUGGING) != 0) ACE_DEBUG ((LM_DEBUG, "in PMC_All::encode\n")); ACE_NEW_RETURN (this->ss, HT_Client, -1); SET_PACKET_TYPE (packet, Options::PROTO_ALL); char *buf_ptr = SKIP_PACKET_TYPE (packet); packet_length = buf_ptr - packet; return 1; }
static void dissect_GDSHR(tvbuff_t *tvb, packet_info *pinfo, proto_tree *adwin_tree, proto_tree *adwin_debug_tree) { guint32 is_range, packet_start, packet_end, seq_num; /* Get the transaction identifier */ seq_num = tvb_get_ntohl(tvb, 0); adwin_request_response_handling(tvb, pinfo, adwin_tree, seq_num, ADWIN_RESPONSE); if (! adwin_tree) return; SET_PACKET_TYPE(adwin_tree, APT_GDSHR); ADWIN_ADD_BE(adwin_tree, packet_index, 0, 4); ADWIN_ADD_BE(adwin_tree, request_no, 4, 4); ADWIN_ADD_BE(adwin_tree, complete_packets, 8, 4); ADWIN_ADD_BE(adwin_debug_tree, is_range, 12, 4); ADWIN_ADD_BE(adwin_debug_tree, packet_start, 16, 4); ADWIN_ADD_BE(adwin_debug_tree, packet_end, 20, 4); is_range = tvb_get_ntohl(tvb, 12); packet_start = tvb_get_ntohl(tvb, 16); switch(is_range) { case 0: proto_tree_add_text(adwin_tree, tvb, 12, 12, "GDSH status: get single packet no %d", packet_start); break; case 1: packet_end = tvb_get_ntohl(tvb, 20); proto_tree_add_text(adwin_tree, tvb, 12, 12, "GDSH status: get packets %d - %d", packet_start, packet_end); break; case 2: proto_tree_add_text(adwin_tree, tvb, 12, 12, "GDSH status: finished"); break; default: /* should not happen */ proto_tree_add_text(adwin_tree, tvb, 12, 12, "GDSH status: unknown code %d", is_range); } ADWIN_ADD_BE(adwin_debug_tree, unused, 24, 40); }
int PMC_Ruser::encode (char *packet, int &packet_length) { if (Options::get_opt (Options::DEBUG) != 0) ACE_DEBUG ((LM_DEBUG, "in PMC_Ruser::encode\n")); ACE_NEW_RETURN (this->ss, HT_Client, -1); SET_PACKET_TYPE (packet, Options::PROTO_RUSER); char *buf_ptr = SKIP_PACKET_TYPE (packet); *buf_ptr++ = char (Options::get_opt (Options::PRINT_LOGIN_NAME)); packet_length = buf_ptr - packet; return 1; }
int PMC_Flo::encode (char *packet, int &packet_length) { if (Options::get_opt (Options::DEBUG) != 0) ACE_DEBUG ((LM_DEBUG, "in PMC_Flo::encode")); ACE_NEW_RETURN (this->ss, BS_Client, -1); SET_PACKET_TYPE (packet, Options::PROTO_FLO); char *buf_ptr = SKIP_PACKET_TYPE (packet); sprintf (buf_ptr, "%d", this->friend_count ()); buf_ptr += MAXUSERIDNAMELEN; // Iterate through all the friends, copying them into the packet // buffer. for (Protocol_Record *prp; (prp = this->get_next_friend ()) != 0; ) buf_ptr = ACE_OS::strecpy (buf_ptr, prp->get_login ()); packet_length = buf_ptr - packet; if (Options::get_opt (Options::DEBUG) != 0) { ACE_DEBUG ((LM_DEBUG, "packet_length = %d\n", packet_length)); ACE_OS::write (ACE_STDERR, packet, packet_length); ACE_DEBUG ((LM_DEBUG, "\n")); } return 1; }
static void dissect_GDSHP(tvbuff_t *tvb, packet_info *pinfo, proto_tree *adwin_tree, proto_tree *adwin_debug_tree) { guint32 i, seq_num; /* Get the transaction identifier */ seq_num = tvb_get_ntohl(tvb, 0); adwin_request_response_handling(tvb, pinfo, adwin_tree, seq_num, ADWIN_RESPONSE); if (! adwin_tree) return; SET_PACKET_TYPE(adwin_tree, APT_GDSHP); ADWIN_ADD_BE(adwin_tree, packet_index, 0, 4); ADWIN_ADD_BE(adwin_tree, packet_no, 4, 4); ADWIN_ADD_BE(adwin_tree, unused, 8, 4); if (! global_adwin_dissect_data) { proto_tree_add_text(adwin_debug_tree, tvb, 12, 336 * 4, "Data"); return; } for (i = 0; i < 336; i++) { proto_item *item; guint32 offset = 12 + i * sizeof(guint32); gint32 value = tvb_get_letohl(tvb, offset); void * fvalue = &value; proto_tree_add_text(adwin_debug_tree, tvb, offset, 4, "Data[%3d]: %10d - %10f - 0x%08x", i, value, *(float*)fvalue, value); item = ADWIN_ADD_LE(adwin_debug_tree, data_int, offset, 4); PROTO_ITEM_SET_HIDDEN(item); item = ADWIN_ADD_LE(adwin_debug_tree, data_float, offset, 4); PROTO_ITEM_SET_HIDDEN(item); item = ADWIN_ADD_LE(adwin_debug_tree, data_hex, offset, 4); PROTO_ITEM_SET_HIDDEN(item); } }
static void dissect_UDPH1_new(tvbuff_t *tvb, packet_info *pinfo, proto_tree *adwin_tree, proto_tree *adwin_debug_tree, gchar** info_string) { gchar* dll_version_s; gint32 dll_i; dissect_UDPH1_generic(tvb, pinfo, adwin_tree, adwin_debug_tree, info_string, "UDPH1 (new)"); if (! adwin_tree) return; SET_PACKET_TYPE(adwin_tree, APT_UDPH1_new); dll_i = tvb_get_letohl(tvb, 52); dll_version_s = ep_strdup_printf("%d.%d.%d", dll_i / 1000000, (dll_i - dll_i / 1000000 * 1000000) / 1000, dll_i % 1000); proto_tree_add_string(adwin_debug_tree, hf_adwin_dll_version, tvb, 52, 4, dll_version_s); }
void gateway_task () { uint8_t i, len; int8_t rssi, val; uint8_t *local_rx_tx_buf; uint16_t batt; nrk_time_t check_period, wait_time; uint16_t buf; int8_t fd; uint8_t j, cnt, level; nrk_sig_t tx_done_signal; nrk_sig_mask_t ret; nrk_time_t next_transmit_time; nrk_time_t current_time; nrk_time_t prev_time; char tmp[4]; printf ("gateway_task PID=%d\r\n", nrk_get_pid ()); next_transmit_time.secs = 0; next_transmit_time.nano_secs = 0; // init bmac on channel 25 bmac_init (26); // By default the RX check rate is 100ms // below shows how to change that check_period.secs=0; check_period.nano_secs=100*NANOS_PER_MS; val=bmac_set_rx_check_rate(check_period); // The default Clear Channel Assement RSSI threshold is -32 // Setting this value higher means that you will only trigger // receive with a very strong signal. Setting this lower means // bmac will try to receive fainter packets. If the value is set // too high or too low performance will suffer greatly. // bmac_set_cca_thresh(-36); if(val==NRK_ERROR) nrk_kprintf( PSTR("ERROR setting bmac rate\r\n" )); // This sets the next RX buffer. // This can be called at anytime before releaseing the packet // if you wish to do a zero-copy buffer switch bmac_rx_pkt_set_buffer (rx_buf, RF_MAX_PAYLOAD_SIZE); // Get and register the tx_done_signal if you want to // do non-blocking transmits tx_done_signal = bmac_get_tx_done_signal (); nrk_signal_register (tx_done_signal); nrk_time_set(0, 0); cnt = 0; // Initially clear all the data buffers for(i=0; i<(MAX_NODES);i++) { for(j=0; j<(WORDS_PER_NODE); j++) { data_pkt.node_specific_data[i][j] = 0; } } while (1) { nrk_time_get(¤t_time); // If it is time to flood the network, send the control packets if(current_time.secs%FLOOD_RATE == 0 && prev_time.secs != current_time.secs || cnt == 0) { prev_time = current_time; cnt ++; SET_PACKET_COUNT(pkt_buf.pkt_type_cnt, cnt); #if MODE==DATA_MODE SET_PACKET_TYPE(pkt_buf.pkt_type_cnt, PKT_TYPE_CONTROL); #else SET_PACKET_TYPE(pkt_buf.pkt_type_cnt, PKT_TYPE_DIAG_CONTROL); #endif pkt_buf.hop_number = 0; pkt_buf.time_to_flood = TIME_TO_FLOOD_IN_SECS; pkt_buf.bmac_check_rate = BMAC_CHECK_RATE_IN_MS; pkt_buf.maximum_depth = MAXIMUM_DEPTH; pkt_buf.delay_at_each_level = DELAY_AT_EACH_LEVEL_IN_SECS; pkt_buf.next_control_time = NEXT_CONTROL_TIME; pkt_buf.data_push_rate = 0; for(i=0; i<(MAX_NODES);i++) { for(j=0; j<(WORDS_PER_NODE); j++) { #if MODE==DATA_MODE pkt_buf.node_specific_data[i][j] = SENSOR; #else pkt_buf.node_specific_data[i][j] = 0; #endif } } memcpy(tx_buf, &pkt_buf, sizeof(pkt_buf)); // Non-blocking send nrk_led_set (BLUE_LED); val = bmac_tx_pkt_nonblocking (tx_buf, sizeof(struct message_packet)); nrk_kprintf (PSTR ("Tx packet enqueued\r\n")); ret = nrk_event_wait (SIG(tx_done_signal)); if(ret & SIG(tx_done_signal) == 0 ) nrk_kprintf (PSTR ("TX done signal error\r\n")); nrk_led_clr (BLUE_LED); } // If a new packet has been received, then update the information if(bmac_rx_pkt_ready()) { // Wait until an RX packet is received nrk_led_set (ORANGE_LED); // Get the RX packet local_rx_tx_buf = bmac_rx_pkt_get (&len, &rssi); for (i = 0; i < len; i++) printf ("%d", rx_buf[i]); printf ("\r\n"); memcpy(&pkt_buf, rx_buf, sizeof(pkt_buf)); nrk_led_clr (ORANGE_LED); // Release the RX buffer so future packets can arrive bmac_rx_pkt_release (); // If the received packet is a data packet then update the information, gateway just ignores the control packets if(GET_PACKET_TYPE(pkt_buf.pkt_type_cnt) == PKT_TYPE_DIAG_DATA || GET_PACKET_TYPE(pkt_buf.pkt_type_cnt) == PKT_TYPE_DATA) { printf("Type = %d\n\r", GET_PACKET_TYPE(pkt_buf.pkt_type_cnt)); printf("Count = %d\n\r", GET_PACKET_COUNT(pkt_buf.pkt_type_cnt)); printf("Hop # = %d\n\r", pkt_buf.hop_number); printf("TTF = %d\n\r", pkt_buf.time_to_flood); printf("BCR = %d\n\r", pkt_buf.bmac_check_rate); printf("Nmax = %d\n\r", pkt_buf.maximum_depth); printf("Dlev = %d\n\r", pkt_buf.delay_at_each_level); printf("Nxt = %d\n\r", pkt_buf.next_control_time); printf("Prate = %d\n\r", pkt_buf.data_push_rate); for(i=0; i<(MAX_NODES);i++) { for(j=0; j<(WORDS_PER_NODE); j++) { if(pkt_buf.node_specific_data[i][j] != 0) data_pkt.node_specific_data[i][j] = pkt_buf.node_specific_data[i][j]; } } for(i=0; i<(MAX_NODES);i++) { printf("Value @ Node %d is %d (cnt is %d)", i, ((int16_t)data_pkt.node_specific_data[i][1]<<4), (data_pkt.node_specific_data[i][0]&0x3F)); printf("\n\r"); } } } } }
static void dissect_UDPR4(tvbuff_t *tvb, packet_info *pinfo, proto_tree *adwin_tree, proto_tree *adwin_debug_tree, gchar** info_string) { const gchar *status_string; guint32 data_type, i, status, seq_num; status = tvb_get_letohl(tvb, 0); status_string = match_strval_ext(status, &error_code_mapping_ext); if (status_string) { *info_string = ep_strdup_printf("UDPR4 Status: %s", status_string); } else { *info_string = ep_strdup_printf("UDPR4 Undefined error code %d", status); } /* Get the transaction identifier */ seq_num = tvb_get_letohl(tvb, 4); adwin_request_response_handling(tvb, pinfo, adwin_tree, seq_num, ADWIN_RESPONSE); if (! adwin_tree) return; SET_PACKET_TYPE(adwin_tree, APT_UDPR4); ADWIN_ADD_LE(adwin_tree, status, 0, 4); ADWIN_ADD_LE(adwin_tree, packet_index, 4, 4); ADWIN_ADD_LE(adwin_tree, packet_no, 1408, 4); ADWIN_ADD_LE(adwin_tree, data_type, 1412, 4); data_type = tvb_get_letohl(tvb, 1412); if (! global_adwin_dissect_data) { proto_tree_add_text(adwin_debug_tree, tvb, 8, 350 * 4, "Data"); return; } for (i = 0; i < 350; i++) { proto_item *item; guint32 offset = 8 + i * sizeof(guint32); gint32 value = tvb_get_letohl(tvb, offset); void * fvalue = &value; switch (data_type) { case 2: case 3: case 4: /* some kind of int, usually int/long */ proto_tree_add_text(adwin_debug_tree, tvb, offset, 4, "Data[%3d]: %10d - 0x%08x", i, value, value); item = ADWIN_ADD_LE(adwin_debug_tree, data_int, offset, 4); PROTO_ITEM_SET_HIDDEN(item); item = ADWIN_ADD_LE(adwin_debug_tree, data_hex, offset, 4); PROTO_ITEM_SET_HIDDEN(item); break; case 5: /* float */ proto_tree_add_text(adwin_debug_tree, tvb, offset, 4, "Data[%3d]: %10f - 0x%08x", i, *(float*)fvalue, value); item = ADWIN_ADD_LE(adwin_debug_tree, data_float, offset, 4); PROTO_ITEM_SET_HIDDEN(item); item = ADWIN_ADD_LE(adwin_debug_tree, data_hex, offset, 4); PROTO_ITEM_SET_HIDDEN(item); break; default: /* string, double, variant, something funny... */ proto_tree_add_text(adwin_debug_tree, tvb, offset, 4, "Data[%3d]: 0x%08x", i, value); item = ADWIN_ADD_LE(adwin_debug_tree, data_hex, offset, 4); PROTO_ITEM_SET_HIDDEN(item); } } }
static void dissect_UDPH1_generic(tvbuff_t *tvb, packet_info *pinfo, proto_tree *adwin_tree, proto_tree *adwin_debug_tree, gchar** info_string, const gchar* packet_name) { guint32 i3plus1code = 0, instructionID, seq_num; instructionID = tvb_get_letohl(tvb, 0); *info_string = ep_strdup_printf("%s: %s", packet_name, val_to_str_ext(instructionID, &instruction_mapping_ext, "unknown instruction: %d")); if (instructionID == I_3PLUS1) { gchar *tmp = *info_string; i3plus1code = tvb_get_letohl(tvb, 20); *info_string = ep_strdup_printf("%s: %s", tmp, val_to_str_ext(i3plus1code, &instruction_3plus1_mapping_ext, "unknown 3+1 code: %d")); } /* Get the transaction identifier */ seq_num = tvb_get_letohl(tvb, 4); adwin_request_response_handling(tvb, pinfo, adwin_tree, seq_num, ADWIN_REQUEST); if (! adwin_tree) return; SET_PACKET_TYPE(adwin_tree, APT_UDPH1_old); ADWIN_ADD_LE(adwin_tree, instruction, 0, 4); ADWIN_ADD_LE(adwin_tree, packet_index, 4, 4); ADWIN_ADD_BE(adwin_tree, password, 8, 10); ADWIN_ADD_LE(adwin_debug_tree, unused, 18, 2); switch(instructionID) { case I_3PLUS1: ADWIN_ADD_LE(adwin_tree, i3plus1, 20, 4); switch (i3plus1code) { case I_3P1_SET_PAR: ADWIN_ADD_LE(adwin_tree, parameter, 24, 4); ADWIN_ADD_LE(adwin_tree, val1, 28, 4); ADWIN_ADD_LE(adwin_tree, val1f, 28, 4); ADWIN_ADD_LE(adwin_debug_tree, unused, 32, 4); break; case I_3P1_GET_PAR: ADWIN_ADD_LE(adwin_tree, parameter, 24, 4); ADWIN_ADD_LE(adwin_debug_tree, unused, 28, 8); break; case I_3P1_GET_MEMORY_INFO: case I_3P1_GET_DETAILED_MEM_INFO: ADWIN_ADD_LE(adwin_tree, mem_type, 24, 4); ADWIN_ADD_LE(adwin_debug_tree, unused, 28, 8); break; case I_3P1_START: case I_3P1_STOP: case I_3P1_CLEAR_PROCESS: ADWIN_ADD_LE(adwin_tree, process_no, 24, 4); ADWIN_ADD_LE(adwin_debug_tree, unused, 28, 8); break; case I_3P1_GET_DATA_LENGTH: ADWIN_ADD_LE(adwin_tree, data_no32, 24, 4); ADWIN_ADD_LE(adwin_debug_tree, unused, 28, 8); break; case I_3P1_CLEAR_FIFO: case I_3P1_GET_FIFO_EMPTY: case I_3P1_GET_FIFO_COUNT: ADWIN_ADD_LE(adwin_tree, fifo_no32, 24, 4); ADWIN_ADD_LE(adwin_debug_tree, unused, 28, 8); break; default: ; /* should not happen */ /* illegal values should be displayed properly by 3plus1_mapping */ } break; case I_BOOT: ADWIN_ADD_LE(adwin_tree, memsize, 20, 4); ADWIN_ADD_LE(adwin_tree, blocksize, 24, 2); ADWIN_ADD_LE(adwin_debug_tree, unused, 26, 2); ADWIN_ADD_LE(adwin_tree, processor, 28, 4); ADWIN_ADD_LE(adwin_tree, binfilesize, 32, 4); break; case I_LOAD_BIN_FILE: ADWIN_ADD_LE(adwin_debug_tree, unused, 20, 6); ADWIN_ADD_LE(adwin_tree, blocksize, 26, 2); ADWIN_ADD_LE(adwin_tree, processor, 28, 4); ADWIN_ADD_LE(adwin_tree, binfilesize, 32, 4); break; case I_GET_WORKLOAD: ADWIN_ADD_LE(adwin_tree, instruction, 20, 4); ADWIN_ADD_LE(adwin_debug_tree, unused, 24, 12); break; case I_GET_DATA_TYPE: ADWIN_ADD_LE(adwin_debug_tree, unused, 20, 4); ADWIN_ADD_LE(adwin_tree, data_no32, 24, 4); ADWIN_ADD_LE(adwin_tree, start_index, 28, 4); ADWIN_ADD_LE(adwin_debug_tree, unused, 32, 4); break; case I_GET_DATA: case I_SET_DATA: ADWIN_ADD_LE(adwin_tree, data_type, 20, 4); ADWIN_ADD_LE(adwin_tree, data_no16, 24, 2); ADWIN_ADD_LE(adwin_tree, blocksize, 26, 2); ADWIN_ADD_LE(adwin_tree, start_index, 28, 4); ADWIN_ADD_LE(adwin_tree, count, 32, 4); break; case I_GET_DATA_SHIFTED_HANDSHAKE: ADWIN_ADD_BE(adwin_tree, data_no16, 20, 2); ADWIN_ADD_BE(adwin_tree, blocksize, 22, 2); ADWIN_ADD_BE(adwin_tree, start_index, 24, 4); ADWIN_ADD_BE(adwin_tree, count, 28, 4); ADWIN_ADD_BE(adwin_debug_tree, unused, 32, 4); break; case I_GET_DATA_SMALL: ADWIN_ADD_LE(adwin_debug_tree, unused, 20, 4); ADWIN_ADD_LE(adwin_tree, data_no16, 24, 2); ADWIN_ADD_LE(adwin_debug_tree, unused, 26, 2); ADWIN_ADD_LE(adwin_tree, start_index, 28, 4); ADWIN_ADD_LE(adwin_tree, count, 32, 4); break; case I_GET_PAR_ALL: ADWIN_ADD_LE(adwin_tree, start_index, 20, 4); ADWIN_ADD_LE(adwin_tree, count, 24, 4); ADWIN_ADD_LE(adwin_debug_tree, unused, 28, 8); break; case I_SET_DATA_LAST_STATUS: ADWIN_ADD_LE(adwin_tree, data_packet_index, 20, 4); ADWIN_ADD_LE(adwin_debug_tree, unused, 24, 12); break; case I_GET_ARM_VERSION: ADWIN_ADD_LE(adwin_tree, armVersion, 20, 4); ADWIN_ADD_LE(adwin_debug_tree, unused,24, 12); break; case I_GET_FIFO: case I_SET_FIFO: ADWIN_ADD_LE(adwin_tree, data_type, 20, 4); ADWIN_ADD_LE(adwin_tree, fifo_no16, 24, 2); ADWIN_ADD_LE(adwin_debug_tree, unused, 26, 6); ADWIN_ADD_LE(adwin_tree, count, 32, 4); break; case I_GET_FIFO_RETRY: case I_SET_FIFO_RETRY: ADWIN_ADD_LE(adwin_tree, data_type, 20, 4); ADWIN_ADD_LE(adwin_tree, fifo_no16, 24, 2); ADWIN_ADD_LE(adwin_debug_tree, unused, 26, 2); ADWIN_ADD_LE(adwin_tree, retry_packet_index, 28, 4); ADWIN_ADD_LE(adwin_tree, count, 32, 4); break; case I_TEST_VERSION: ADWIN_ADD_LE(adwin_debug_tree, unused, 20, 16); break; case I_GET_MEMORY: ADWIN_ADD_LE(adwin_tree, address, 20, 4); ADWIN_ADD_LE(adwin_tree, count, 24, 4); ADWIN_ADD_LE(adwin_debug_tree, unused, 28, 8); break; default: ; /* should not happen */ /* illegal values should be displayed properly by instruction_mapping */ } ADWIN_ADD_LE(adwin_debug_tree, link_addr,36, 4); ADWIN_ADD_LE(adwin_tree, timeout, 40, 4); ADWIN_ADD_LE(adwin_debug_tree, osys, 44, 4); ADWIN_ADD_LE(adwin_debug_tree, unused, 48, 4); }