2 * WiMax MAC Management UL-MAP Message decoder
4 * Copyright (c) 2007 by Intel Corporation.
6 * Author: Mike Harvey <michael.harvey@intel.com>
10 * Wireshark - Network traffic analyzer
11 * By Gerald Combs <gerald@wireshark.org>
12 * Copyright 1999 Gerald Combs
14 * This program is free software; you can redistribute it and/or
15 * modify it under the terms of the GNU General Public License
16 * as published by the Free Software Foundation; either version 2
17 * of the License, or (at your option) any later version.
19 * This program is distributed in the hope that it will be useful,
20 * but WITHOUT ANY WARRANTY; without even the implied warranty of
21 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
22 * GNU General Public License for more details.
24 * You should have received a copy of the GNU General Public License
25 * along with this program; if not, write to the Free Software
26 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
36 #include <epan/packet.h>
38 #include "wimax_bits.h"
40 extern gint proto_mac_mgmt_msg_dlmap_decoder;
41 extern gboolean include_cor2_changes;
43 #define MAC_MGMT_MSG_ULMAP 3
45 #define XBIT(var, bits, desc) \
47 var = BIT_BITS(bit, bufptr, bits); \
48 proto_tree_add_text(tree, tvb, BITHI(bit, bits), desc ": %d", var); \
52 #define XNIB(var, nibs, desc) \
54 var = NIB_NIBS(nib, bufptr, nibs); \
55 proto_tree_add_text(tree, tvb, NIBHI(nib, nibs), desc ": %d", var); \
59 extern gint man_ofdma;
62 extern guint cqich_id_size; /* Set for CQICH_Alloc_IE */
64 /* from msg_dlmap.c */
68 extern gint RCID_Type;
69 extern gint RCID_IE(proto_tree *diuc_tree, const guint8 *bufptr, gint offset, gint length, tvbuff_t *tvb, gint RCID_Type);
71 static gint proto_mac_mgmt_msg_ulmap_decoder = -1;
73 static gint ett_ulmap = -1;
74 static gint ett_ulmap_ie = -1;
75 static gint ett_ulmap_ffb = -1;
76 /* static gint ett_ulmap_c = -1; */
77 /* static gint ett_ulmap_c_ie = -1; */
78 /* static gint ett_ulmap_s = -1; */
79 /* static gint ett_ulmap_s_ie = -1; */
80 static gint ett_287_1 = -1;
81 static gint ett_287_2 = -1;
82 static gint ett_289 = -1;
83 static gint ett_290 = -1;
84 static gint ett_290b = -1;
85 static gint ett_291 = -1;
86 static gint ett_292 = -1;
87 static gint ett_293 = -1;
88 static gint ett_294 = -1;
89 static gint ett_295 = -1;
90 static gint ett_299 = -1;
91 static gint ett_300 = -1;
92 static gint ett_302 = -1;
93 static gint ett_302a = -1;
94 static gint ett_302b = -1;
95 static gint ett_302c = -1;
96 static gint ett_302d = -1;
97 static gint ett_302e = -1;
98 static gint ett_302f = -1;
99 static gint ett_302g = -1;
100 static gint ett_302h = -1;
101 static gint ett_302i = -1;
102 static gint ett_302j = -1;
103 static gint ett_302k = -1;
104 static gint ett_302l = -1;
105 static gint ett_302m = -1;
106 static gint ett_302n = -1;
107 static gint ett_302o = -1;
108 static gint ett_302p = -1;
109 static gint ett_302q = -1;
110 static gint ett_302r = -1;
111 static gint ett_302s = -1;
112 static gint ett_302t = -1;
113 static gint ett_302u = -1;
114 static gint ett_302v = -1;
115 static gint ett_306 = -1;
116 static gint ett_306_ul = -1;
117 static gint ett_308b = -1;
118 static gint ett_315d = -1;
120 #define DCD_DOWNLINK_BURST_PROFILE 1
121 #define DCD_BS_EIRP 2
122 #define DCD_FRAME_DURATION 3
123 #define DCD_PHY_TYPE 4
124 #define DCD_POWER_ADJUSTMENT 5
125 #define DCD_CHANNEL_NR 6
129 #define DCD_CHANNEL_SWITCH_FRAME_NR 10
130 #define DCD_FREQUENCY 12
132 #define DCD_FRAME_DURATION_CODE 14
133 #define DCD_FRAME_NR 15
134 #define DCD_SIZE_CQICH_ID 16
135 #define DCD_H_ARQ_ACK_DELAY 17
136 #define DCD_MAC_VERSION 148
137 #define DCD_RESTART_COUNT 154
139 #define DCD_BURST_FREQUENCY 1
140 #define DCD_BURST_FEC_CODE_TYPE 150
141 #define DCD_BURST_DIUC_EXIT_THRESHOLD 151
142 #define DCD_BURST_DIUC_ENTRY_THRESHOLD 152
143 #define DCD_BURST_TCS_ENABLE 153
145 #define DCD_TLV_T_541_TYPE_FUNCTION_ACTION 1
146 #define DCD_TLV_T542_TRIGGER_VALUE 2
147 #define DCD_TLV_T_543_TRIGGER_AVERAGING_DURATION 3
148 #define DCD_TLV_T_19_PERMUTATION_TYPE_FOR_BROADCAST_REGION_IN_HARQ_ZONE 19
149 #define DCD_TLV_T_20_MAXIMUM_RETRANSMISSION 20
150 #define DCD_TLV_T_21_DEFAULT_RSSI_AND_CINR_AVERAGING_PARAMETER 21
151 #define DCD_TLV_T_22_DL_AMC_ALLOCATED_PHYSICAL_BANDS_BITMAP 22
152 #define DCD_TLV_T_31_H_ADD_THRESHOLD 31
153 #define DCD_TLV_T_32_H_DELETE_THRESHOLD 32
154 #define DCD_TLV_T_33_ASR 33
155 #define DCD_TLV_T_34_DL_REGION_DEFINITION 34
156 #define DCD_TLV_T_35_PAGING_GROUP_ID 35
157 #define DCD_TLV_T_36_TUSC1_PERMUTATION_ACTIVE_SUBCHANNELS_BITMAP 36
158 #define DCD_TLV_T_37_TUSC2_PERMUTATION_ACTIVE_SUBCHANNELS_BITMAP 37
159 #define DCD_TLV_T_45_PAGING_INTERVAL_LENGTH 45
160 #define DCD_TLV_T_50_HO_TYPE_SUPPORT 50
161 #define DCD_TLV_T_51_HYSTERSIS_MARGIN 51
162 #define DCD_TLV_T_52_TIME_TO_TRIGGER_DURATION 52
163 #define DCD_TLV_T_54_TRIGGER 54
164 #define DCD_TLV_T_153_DOWNLINK_BURST_PROFILE_FOR_MULTIPLE_FEC_TYPES 153
166 #define UL_MAP_NCT_PMP 0
167 #define UL_MAP_NCT_DM 1
168 #define UL_MAP_NCT_PTP 2
171 static const value_string nct_msgs[] =
173 { UL_MAP_NCT_PMP, "PMP" },
174 { UL_MAP_NCT_PMP, "DM" },
175 { UL_MAP_NCT_PMP, "PTP" },
179 /* Repetition Coding Indications */
180 static const value_string rep_msgs[] =
182 { 0, "No Repetition Coding" },
183 { 1, "Repetition Coding of 2 Used" },
184 { 2, "Repetition Coding of 4 Used" },
185 { 3, "Repetition Coding of 6 Used" },
189 /* DL Frame Prefix Coding Indications */
190 static const value_string boost_msgs[] =
192 { 0, "Normal (not boosted)" },
204 static gint hf_ulmap_message_type = -1;
205 static gint hf_ulmap_reserved = -1;
206 static gint hf_ulmap_ucd_count = -1;
207 static gint hf_ulmap_alloc_start_time = -1;
208 static gint hf_ulmap_ofdma_sym = -1;
209 static gint hf_ulmap_fch_expected = -1;
211 static gint hf_ulmap_ie = -1;
213 static gint hf_ulmap_ie_cid = -1;
214 static gint hf_ulmap_ie_uiuc = -1;
215 static gint hf_ulmap_uiuc12_symofs = -1;
216 static gint hf_ulmap_uiuc12_subofs = -1;
217 static gint hf_ulmap_uiuc12_numsym = -1;
218 static gint hf_ulmap_uiuc12_numsub = -1;
219 static gint hf_ulmap_uiuc12_method = -1;
220 static gint hf_ulmap_uiuc12_dri = -1;
221 static gint hf_ulmap_uiuc10_dur = -1;
222 static gint hf_ulmap_uiuc10_rep = -1;
224 static gint hf_ulmap_uiuc14_dur = -1;
225 static gint hf_ulmap_uiuc14_uiuc = -1;
226 static gint hf_ulmap_uiuc14_rep = -1;
227 static gint hf_ulmap_uiuc14_idx = -1;
228 static gint hf_ulmap_uiuc14_code = -1;
229 static gint hf_ulmap_uiuc14_sym = -1;
230 static gint hf_ulmap_uiuc14_sub = -1;
231 static gint hf_ulmap_uiuc14_bwr = -1;
233 static gint hf_ulmap_uiuc11_ext = -1;
234 static gint hf_ulmap_uiuc11_len = -1;
235 static gint hf_ulmap_uiuc11_data = -1;
236 static gint hf_ulmap_uiuc15_ext = -1;
237 static gint hf_ulmap_uiuc15_len = -1;
238 static gint hf_ulmap_uiuc15_data = -1;
240 static gint hf_ulmap_uiuc0_symofs = -1;
241 static gint hf_ulmap_uiuc0_subofs = -1;
242 static gint hf_ulmap_uiuc0_numsym = -1;
243 static gint hf_ulmap_uiuc0_numsub = -1;
244 static gint hf_ulmap_uiuc0_rsv = -1;
246 static gint hf_ulmap_uiuc13_symofs = -1;
247 static gint hf_ulmap_uiuc13_subofs = -1;
248 static gint hf_ulmap_uiuc13_numsym = -1;
249 static gint hf_ulmap_uiuc13_numsub = -1;
250 static gint hf_ulmap_uiuc13_papr = -1;
251 static gint hf_ulmap_uiuc13_zone = -1;
252 static gint hf_ulmap_uiuc13_rsv = -1;
254 /* This gets called each time a capture file is loaded. */
255 void init_wimax_globals(void)
264 /********************************************************************
265 * UL-MAP HARQ Sub-Burst IEs
266 * 8.4.5.4.24 table 302j
267 * these functions take offset/length in bits
268 *******************************************************************/
270 gint Dedicated_UL_Control_IE(proto_tree *uiuc_tree, const guint8 *bufptr, gint offset, gint length, tvbuff_t *tvb)
272 /* 8.4.5.4.24.1 Dedicated_UL_Control_IE -- table 302r */
273 /* UL-MAP HARQ Sub-Burst IE * offset/length are in bits */
276 proto_item *ti = NULL;
277 proto_item *tree = NULL;
282 ti = proto_tree_add_text(uiuc_tree, tvb, NIBHI(offset, length), "Dedicated_UL_Control_IE");
283 tree = proto_item_add_subtree(ti, ett_302r);
285 XBIT(data, 4, "Length");
286 XBIT(sdma, 4, "Control Header");
287 if ((sdma & 1) == 1) {
288 XBIT(data, 2, "Num SDMA layers");
289 XBIT(data, 2, "Pilot Pattern");
291 return (bit - offset); /* length in bits */
294 gint Dedicated_MIMO_UL_Control_IE(proto_tree *uiuc_tree, const guint8 *bufptr, gint offset, gint length, tvbuff_t *tvb)
296 /* 8.4.5.4.24.2 Dedicated_MIMO_UL_Control_IE -- table 302s */
297 /* UL-MAP HARQ Sub-Burst IE * offset/length are in bits */
300 proto_item *ti = NULL;
301 proto_item *tree = NULL;
305 ti = proto_tree_add_text(uiuc_tree, tvb, NIBHI(offset, length), "Dedicated_MIMO_UL_Control_IE");
306 tree = proto_item_add_subtree(ti, ett_302s);
308 XBIT(data, 2, "Matrix");
309 XBIT(N_layer, 2, "N_layer");
311 return (bit - offset); /* length in bits */
314 /* begin Sub-Burst IEs */
316 gint UL_HARQ_Chase_Sub_Burst_IE(proto_tree *uiuc_tree, const guint8 *bufptr, gint offset, gint length, tvbuff_t *tvb)
318 /* 8.4.5.4.24 UL_HARQ_Chase_sub_burst_IE -- table 302k */
319 /* UL-MAP HARQ Sub-Burst IE * offset/length are in bits */
322 proto_item *ti = NULL;
323 proto_item *tree = NULL;
324 /*proto_item *generic_item = NULL;*/
326 /*guint16 calculated_crc;*/
330 ti = proto_tree_add_text(uiuc_tree, tvb, BITHI(offset,length), "UL_HARQ_Chase_Sub_Burst_IE");
331 tree = proto_item_add_subtree(ti, ett_302k);
333 bit += RCID_IE(tree, bufptr, bit, length, tvb, RCID_Type);
334 XBIT(duci, 1, "Dedicated UL Control Indicator");
336 bit += Dedicated_UL_Control_IE(tree, bufptr, bit, length, tvb);
338 XBIT(data, 4, "UIUC");
339 XBIT(data, 2, "Repetition Coding Indication");
340 XBIT(data,10, "Duration");
341 XBIT(data, 4, "ACID");
342 XBIT(data, 1, "AI_SN");
343 XBIT(data, 1, "ACK_disable");
344 XBIT(data, 1, "Reserved");
347 if (include_cor2_changes)
349 /* CRC-16 is always appended */
350 data = BIT_BITS(bit, bufptr, 16);
351 generic_item = proto_tree_add_text(tree, tvb, BITHI(bit,16), "CRC-16: 0x%04x",data);
352 /* calculate the CRC */
353 calculated_crc = wimax_mac_calc_crc16((guint8 *)tvb_get_ptr(tvb, 0, BIT_TO_BYTE(bit)), BIT_TO_BYTE(bit));
354 if (data != calculated_crc)
356 proto_item_append_text(generic_item, " - incorrect! (should be: 0x%x)", calculated_crc);
362 return (bit - offset); /* length in bits */
365 gint UL_HARQ_IR_CTC_Sub_Burst_IE(proto_tree *uiuc_tree, const guint8 *bufptr, gint offset, gint length, tvbuff_t *tvb)
367 /* 8.4.5.4.24 UL_HARQ_IR_CTC_sub_burst_IE -- table 302l */
368 /* UL-MAP HARQ Sub-Burst IE * offset/length are in bits */
371 proto_item *ti = NULL;
372 proto_item *tree = NULL;
373 /*proto_item *generic_item = NULL;*/
375 /*guint16 calculated_crc;*/
379 ti = proto_tree_add_text(uiuc_tree, tvb, NIBHI(offset, length), "UL_HARQ_IR_CTC_Sub_Burst_IE");
380 tree = proto_item_add_subtree(ti, ett_302l);
382 bit += RCID_IE(tree, bufptr, bit, length, tvb, RCID_Type);
383 XBIT(duci, 1, "Dedicated UL Control Indicator");
385 bit += Dedicated_UL_Control_IE(tree, bufptr, bit, length, tvb);
387 XBIT(data, 4, "N(EP)");
388 XBIT(data, 4, "N(SCH)");
389 XBIT(data, 2, "SPID");
390 XBIT(data, 4, "ACIN");
391 XBIT(data, 1, "AI_SN");
392 XBIT(data, 1, "ACK_disable");
393 XBIT(data, 3, "Reserved");
396 if (include_cor2_changes)
398 /* CRC-16 is always appended */
399 data = BIT_BITS(bit, bufptr, 16);
400 generic_item = proto_tree_add_text(tree, tvb, BITHI(bit,16), "CRC-16: 0x%04x",data);
401 /* calculate the CRC */
402 calculated_crc = wimax_mac_calc_crc16((guint8 *)tvb_get_ptr(tvb, 0, BIT_TO_BYTE(bit)), BIT_TO_BYTE(bit));
403 if (data != calculated_crc)
405 proto_item_append_text(generic_item, " - incorrect! (should be: 0x%x)", calculated_crc);
411 return (bit - offset); /* length in bits */
414 gint UL_HARQ_IR_CC_Sub_Burst_IE(proto_tree *uiuc_tree, const guint8 *bufptr, gint offset, gint length, tvbuff_t *tvb)
416 /* 8.4.5.4.24 UL_HARQ_IR_CC_sub_burst_IE -- table 302m */
417 /* UL-MAP HARQ Sub-Burst IE * offset/length are in bits */
420 proto_item *ti = NULL;
421 proto_item *tree = NULL;
422 /*proto_item *generic_item = NULL;*/
424 /*guint16 calculated_crc;*/
428 ti = proto_tree_add_text(uiuc_tree, tvb, NIBHI(offset, length), "UL_HARQ_IR_CC_Sub_Burst_IE");
429 tree = proto_item_add_subtree(ti, ett_302m);
431 bit += RCID_IE(tree, bufptr, bit, length, tvb, RCID_Type);
432 XBIT(duci, 1, "Dedicated UL Control Indicator");
434 bit += Dedicated_UL_Control_IE(tree, bufptr, bit, length, tvb);
436 XBIT(data, 4, "UIUC");
437 XBIT(data, 2, "Repetition Coding Indication");
438 XBIT(data,10, "Duration");
439 XBIT(data, 2, "SPID");
440 XBIT(data, 4, "ACID");
441 XBIT(data, 1, "AI_SN");
442 XBIT(data, 1, "ACK_disable");
443 XBIT(data, 3, "Reserved");
446 if (include_cor2_changes)
448 /* CRC-16 is always appended */
449 data = BIT_BITS(bit, bufptr, 16);
450 generic_item = proto_tree_add_text(tree, tvb, BITHI(bit,16), "CRC-16: 0x%04x",data);
451 /* calculate the CRC */
452 calculated_crc = wimax_mac_calc_crc16((guint8 *)tvb_get_ptr(tvb, 0, BIT_TO_BYTE(bit)), BIT_TO_BYTE(bit));
453 if (data != calculated_crc)
455 proto_item_append_text(generic_item, " - incorrect! (should be: 0x%x)", calculated_crc);
461 return (bit - offset); /* length in bits */
464 gint MIMO_UL_Chase_HARQ_Sub_Burst_IE(proto_tree *uiuc_tree, const guint8 *bufptr, gint offset, gint length, tvbuff_t *tvb)
466 /* 8.4.5.4.24 MIMO_UL_Chase_HARQ_Sub_Burst_IE -- table 302n */
467 /* UL-MAP HARQ Sub-Burst IE * offset/length are in bits */
470 proto_item *ti = NULL;
471 proto_item *tree = NULL;
472 /*proto_item *generic_item = NULL;*/
473 gint muin,dmci,ackd,i;
474 /*guint16 calculated_crc;*/
478 ti = proto_tree_add_text(uiuc_tree, tvb, NIBHI(offset, length), "MIMO_UL_Chase_HARQ_Sub_Burst_IE");
479 tree = proto_item_add_subtree(ti, ett_302n);
481 XBIT(muin, 1, "MU indicator");
482 XBIT(dmci, 1, "Dedicated MIMO ULControl Indicator");
483 XBIT(ackd, 1, "ACK Disable");
485 bit += RCID_IE(tree, bufptr, bit, length, tvb, RCID_Type);
487 bit += Dedicated_MIMO_UL_Control_IE(tree, bufptr, bit, length, tvb);
490 XBIT(data, 1, "Matrix");
492 XBIT(data, 10, "Duration");
493 for (i = 0; i < N_layer; i++) {
495 bit += RCID_IE(tree, bufptr, bit, length, tvb, RCID_Type);
497 XBIT(data, 4, "UIUC");
498 XBIT(data, 2, "Repetition Coding Indication");
500 XBIT(data, 4, "ACID");
501 XBIT(data, 1, "AI_SN");
506 if (include_cor2_changes)
508 /* CRC-16 is always appended */
509 data = BIT_BITS(bit, bufptr, 16);
510 generic_item = proto_tree_add_text(tree, tvb, BITHI(bit,16), "CRC-16: 0x%04x",data);
511 /* calculate the CRC */
512 calculated_crc = wimax_mac_calc_crc16((guint8 *)tvb_get_ptr(tvb, 0, BIT_TO_BYTE(bit)), BIT_TO_BYTE(bit));
513 if (data != calculated_crc)
515 proto_item_append_text(generic_item, " - incorrect! (should be: 0x%x)", calculated_crc);
521 return (bit - offset); /* length in bits */
524 gint MIMO_UL_IR_HARQ__Sub_Burst_IE(proto_tree *uiuc_tree, const guint8 *bufptr, gint offset, gint length, tvbuff_t *tvb)
526 /* 8.4.5.4.24 MIMO_UL_IR_HARQ__Sub_Burst_IE -- table 302o */
527 /* UL-MAP HARQ Sub-Burst IE * offset/length are in bits */
530 proto_item *ti = NULL;
531 proto_item *tree = NULL;
532 /*proto_item *generic_item = NULL;*/
533 gint muin,dmci,ackd,i;
534 /*guint16 calculated_crc;*/
538 ti = proto_tree_add_text(uiuc_tree, tvb, NIBHI(offset, length), "MIMO_UL_IR_HARQ__Sub_Burst_IE");
539 tree = proto_item_add_subtree(ti, ett_302o);
541 XBIT(muin, 1, "MU indicator");
542 XBIT(dmci, 1, "Dedicated MIMO UL Control Indicator");
543 XBIT(ackd, 1, "ACK Disable");
545 bit += RCID_IE(tree, bufptr, bit, length, tvb, RCID_Type);
547 bit += Dedicated_MIMO_UL_Control_IE(tree, bufptr, bit, length, tvb);
550 XBIT(data, 1, "Matrix");
552 XBIT(data, 4, "N(SCH)");
553 for (i = 0; i < N_layer; i++) {
555 bit += RCID_IE(tree, bufptr, bit, length, tvb, RCID_Type);
557 XBIT(data, 4, "N(EP)");
559 XBIT(data, 2, "SPID");
560 XBIT(data, 4, "ACID");
561 XBIT(data, 1, "AI_SN");
566 if (include_cor2_changes)
568 /* CRC-16 is always appended */
569 data = BIT_BITS(bit, bufptr, 16);
570 generic_item = proto_tree_add_text(tree, tvb, BITHI(bit,16), "CRC-16: 0x%04x",data);
571 /* calculate the CRC */
572 calculated_crc = wimax_mac_calc_crc16((guint8 *)tvb_get_ptr(tvb, 0, BIT_TO_BYTE(bit)), BIT_TO_BYTE(bit));
573 if (data != calculated_crc)
575 proto_item_append_text(generic_item, " - incorrect! (should be: 0x%x)", calculated_crc);
581 return (bit - offset); /* length in bits */
584 gint MIMO_UL_IR_HARQ_for_CC_Sub_Burst_UIE(proto_tree *uiuc_tree, const guint8 *bufptr, gint offset, gint length, tvbuff_t *tvb)
586 /* 8.4.5.4.24 MIMO_UL_IR_HARQ_for_CC_Sub_Burst_UIE -- table 302p */
587 /* UL-MAP HARQ Sub-Burst IE * offset/length are in bits */
590 proto_item *ti = NULL;
591 proto_item *tree = NULL;
592 /*proto_item *generic_item = NULL;*/
593 gint muin,dmci,ackd,i;
594 /*guint16 calculated_crc;*/
598 ti = proto_tree_add_text(uiuc_tree, tvb, NIBHI(offset, length), "MIMO_UL_IR_HARQ_for_CC_Sub_Burst_UIE");
599 tree = proto_item_add_subtree(ti, ett_302p);
601 XBIT(muin, 1, "MU indicator");
602 XBIT(dmci, 1, "Dedicated MIMO UL Control Indicator");
603 XBIT(ackd, 1, "ACK Disable");
605 bit += RCID_IE(tree, bufptr, bit, length, tvb, RCID_Type);
607 bit += Dedicated_MIMO_UL_Control_IE(tree, bufptr, bit, length, tvb);
610 XBIT(data, 1, "Matrix");
612 XBIT(data, 10, "Duration");
613 for (i = 0; i < N_layer; i++) {
615 bit += RCID_IE(tree, bufptr, bit, length, tvb, RCID_Type);
617 XBIT(data, 4, "UIUC");
618 XBIT(data, 2, "Repetition Coding Indication");
620 XBIT(data, 4, "ACID");
621 XBIT(data, 1, "AI_SN");
622 XBIT(data, 2, "SPID");
627 if (include_cor2_changes)
629 /* CRC-16 is always appended */
630 data = BIT_BITS(bit, bufptr, 16);
631 generic_item = proto_tree_add_text(tree, tvb, BITHI(bit,16), "CRC-16: 0x%04x",data);
632 /* calculate the CRC */
633 calculated_crc = wimax_mac_calc_crc16((guint8 *)tvb_get_ptr(tvb, 0, BIT_TO_BYTE(bit)), BIT_TO_BYTE(bit));
634 if (data != calculated_crc)
636 proto_item_append_text(generic_item, " - incorrect! (should be: 0x%x)", calculated_crc);
642 return (bit - offset); /* length in bits */
645 gint MIMO_UL_STC_HARQ_Sub_Burst_IE(proto_tree *uiuc_tree, const guint8 *bufptr, gint offset, gint length, tvbuff_t *tvb)
647 /* 8.4.5.4.24 MIMO_UL_STC_HARQ_Sub_Burst_IE -- table 302q */
648 /* UL-MAP HARQ Sub-Burst IE * offset/length are in bits */
651 proto_item *ti = NULL;
652 proto_item *tree = NULL;
653 /*proto_item *generic_item = NULL;*/
655 /*guint16 calculated_crc;*/
659 ti = proto_tree_add_text(uiuc_tree, tvb, NIBHI(offset, length), "MIMO_UL_STC_HARQ_Sub_Burst_IE");
660 tree = proto_item_add_subtree(ti, ett_302q);
662 XBIT(txct, 2, "Tx count");
663 XBIT(data, 10, "Duration");
664 XBIT(sboi, 1, "Sub-burst offset indication");
665 /*XBIT(muin, 1, "Reserved");*/
667 XBIT(data, 8, "Sub-burst offset");
669 bit += RCID_IE(tree, bufptr, bit, length, tvb, RCID_Type);
670 XBIT(ackd, 1, "ACK Disable");
672 XBIT(data, 4, "UIUC");
673 XBIT(data, 2, "Repetition Coding Indication");
676 XBIT(data, 4, "ACID");
680 if (include_cor2_changes)
682 /* CRC-16 is always appended */
683 data = BIT_BITS(bit, bufptr, 16);
684 generic_item = proto_tree_add_text(tree, tvb, BITHI(bit,16), "CRC-16: 0x%04x",data);
685 /* calculate the CRC */
686 calculated_crc = wimax_mac_calc_crc16((guint8 *)tvb_get_ptr(tvb, 0, BIT_TO_BYTE(bit)), BIT_TO_BYTE(bit));
687 if (data != calculated_crc)
689 proto_item_append_text(generic_item, " - incorrect! (should be: 0x%x)", calculated_crc);
695 return (bit - offset); /* length in bits */
698 /********************************************************************
699 * UL-MAP Extended IEs
701 *******************************************************************/
703 gint Power_Control_IE(proto_tree *uiuc_tree, const guint8 *bufptr, gint offset, gint length, tvbuff_t *tvb)
705 /* UL-MAP Extended IE = 0 */
706 /* 8.4.5.4.5 Power_Control_IE */
707 /* offset of TLV in nibbles, length of TLV in nibbles */
710 proto_item *ti = NULL;
711 proto_item *tree = NULL;
715 ti = proto_tree_add_text(uiuc_tree, tvb, NIBHI(offset, length), "Power_Control_IE");
716 tree = proto_item_add_subtree(ti, ett_292);
718 XNIB(data, 1, "Extended UIUC");
719 XNIB(data, 1, "Length");
721 XNIB(data, 2, "Power Control");
722 XNIB(data, 2, "Power measurement frame");
726 gint Mini_Subchannel_allocation_IE(proto_tree *uiuc_tree, const guint8 *bufptr, gint offset, gint length, tvbuff_t *tvb)
728 /* UL-MAP Extended IE = 1 */
729 /* 8.4.5.4.8 [2] Mini-Subchannel_allocation_IE */
730 /* offset of TLV in nibbles, length of TLV in nibbles */
733 proto_item *ti = NULL;
734 proto_item *tree = NULL;
736 const gint m_table[4] = { 2, 2, 3, 6 };
738 bit = NIB_TO_BIT(offset);
740 ti = proto_tree_add_text(uiuc_tree, tvb, NIBHI(offset, length), "Mini_subchannel_allocation_IE");
741 tree = proto_item_add_subtree(ti, ett_295);
743 XBIT(data, 4, "Extended-2 UIUC");
744 XBIT(data, 8, "Length");
746 XBIT(data, 2, "Ctype");
748 XBIT(data, 6, "Duration");
750 for (j = 0; j < M; j++) {
751 data = BIT_BITS(bit, bufptr, 16);
752 proto_tree_add_text(tree, tvb, BITHI(bit, 16), "CID(%d): %d", j, data);
754 data = BIT_BITS(bit, bufptr, 4);
755 proto_tree_add_text(tree, tvb, BITHI(bit, 4), "UIUC(%d): %d", j, data);
757 data = BIT_BITS(bit, bufptr, 2);
758 proto_tree_add_text(tree, tvb, BITHI(bit, 2), "Repetition(%d): %d", j, data);
762 XBIT(data, 4, "Padding");
764 return BIT_TO_NIB(bit);
767 gint AAS_UL_IE(proto_tree *uiuc_tree, const guint8 *bufptr, gint offset, gint length, tvbuff_t *tvb)
769 /* UL-MAP Extended IE = 2 */
770 /* 8.4.5.4.6 [2] AAS_UL_IE*/
771 /* offset of TLV in nibbles, length of TLV in nibbles */
774 proto_item *ti = NULL;
775 proto_item *tree = NULL;
777 bit = NIB_TO_BIT(offset);
779 ti = proto_tree_add_text(uiuc_tree, tvb, NIBHI(offset, length), "AAS_UL_IE");
780 tree = proto_item_add_subtree(ti, ett_293);
782 XBIT(data, 4, "Extended UIUC");
783 XBIT(data, 4, "Length");
785 XBIT(data, 2, "Permutation");
786 XBIT(data, 7, "UL_PermBase");
787 XBIT(data, 8, "OFDMA symbol offset");
788 XBIT(data, 8, "AAS zone length");
789 XBIT(data, 2, "Uplink preamble config");
790 XBIT(data, 1, "Preamble type");
791 XBIT(data, 4, "Reserved");
792 return BIT_TO_NIB(bit);
795 gint CQICH_Alloc_IE(proto_tree *uiuc_tree, const guint8 *bufptr, gint offset, gint length, tvbuff_t *tvb)
797 /* UL-MAP Extended IE = 3 */
798 /* 8.4.5.4.12 [2] CQICH_Alloc_IE */
799 /* offset of TLV in nibbles, length of TLV in nibbles */
803 proto_item *ti = NULL;
804 proto_item *tree = NULL;
805 gint rci, rtype, ftype, zperm, mgi, api, pad;
807 bit = NIB_TO_BIT(offset);
809 ti = proto_tree_add_text(uiuc_tree, tvb, NIBHI(offset, length), "CQICH_Alloc_IE");
810 tree = proto_item_add_subtree(ti, ett_300);
812 XBIT(data, 4, "Extended UIUC");
813 XBIT(data, 4, "Length");
814 target = bit + BYTE_TO_BIT(data);
816 if (cqich_id_size == 0) {
817 proto_tree_add_text(tree, tvb, BITHI(bit, 1), "CQICH_ID: n/a (size == 0 bits)");
819 /* variable from 0-9 bits */
820 data = BIT_BITS16(bit, bufptr, cqich_id_size);
821 proto_tree_add_text(tree, tvb, BITHI(bit, cqich_id_size), "CQICH_ID: %d (%d bits)", data, cqich_id_size);
822 bit += cqich_id_size;
825 XBIT(data, 6, "Allocation offset");
826 XBIT(data, 2, "Period (p)");
827 XBIT(data, 3, "Frame offset");
828 XBIT(data, 3, "Duration (d)");
829 XBIT(rci, 1, "Report configuration included");
832 XBIT(ftype, 2, "Feedback Type");
833 XBIT(rtype, 1, "Report type");
835 XBIT(data, 1, "CINR preamble report type");
838 XBIT(zperm, 3, "Zone permutation");
839 XBIT(data, 2, "Zone type");
840 XBIT(data, 2, "Zone PRBS_ID");
841 if (zperm == 0 || zperm == 1) {
842 XBIT(mgi, 1, "Major group indication");
844 /* PUSC major group bitmap*/
845 XBIT(data, 6, "PUSC Major group bitmap");
848 XBIT(data, 1, "CINR zone measurement type");
851 XBIT(api, 1, "Averaging parameter included");
853 XBIT(data, 4, "Averaging parameter");
857 XBIT(data, 2, "MIMO_permutation_feedback_cycle");
861 proto_tree_add_text(tree, tvb, BITHI(bit, pad), "Padding: %d bits", pad);
864 return BIT_TO_NIB(bit); /* Return position in nibbles. */
867 gint UL_Zone_IE(proto_tree *uiuc_tree, const guint8 *bufptr, gint offset, gint length, tvbuff_t *tvb)
869 /* UL-MAP Extended IE = 4 */
870 /* 8.4.5.4.7 [2] UL_Zone_IE */
871 /* offset of TLV in nibbles, length of TLV in nibbles */
874 proto_item *ti = NULL;
875 proto_item *tree = NULL;
877 bit = NIB_TO_BIT(offset);
879 ti = proto_tree_add_text(uiuc_tree, tvb, NIBHI(offset, length), "UL_Zone_IE");
880 tree = proto_item_add_subtree(ti, ett_294);
882 XBIT(data, 4, "Extended UIUC");
883 XBIT(data, 4, "Length");
885 XBIT(data, 7, "OFDMA symbol offset");
886 XBIT(data, 2, "Permutation");
887 XBIT(data, 7, "UL_PermBase");
888 XBIT(data, 2, "AMC type");
889 XBIT(data, 1, "Use All SC indicator");
890 XBIT(data, 1, "Disable subchannel rotation");
891 XBIT(data, 4, "Reserved");
892 return BIT_TO_NIB(bit);
895 gint PHYMOD_UL_IE(proto_tree *uiuc_tree, const guint8 *bufptr, gint offset, gint length, tvbuff_t *tvb)
897 /* UL-MAP Extended IE = 5 */
898 /* 8.4.5.4.14 [2] PHYMOD_UL_IE */
899 /* offset of TLV in nibbles, length of TLV in nibbles */
902 proto_item *ti = NULL;
903 proto_item *tree = NULL;
906 bit = NIB_TO_BIT(offset);
908 ti = proto_tree_add_text(uiuc_tree, tvb, NIBHI(offset, length), "PHYMOD_UL_IE");
909 tree = proto_item_add_subtree(ti, ett_302);
911 XBIT(data, 4, "Extended UIUC");
912 XBIT(data, 4, "Length");
914 XBIT(pmt, 1, "Preamble Modifier Type");
916 XBIT(data, 4, "Preamble frequency shift index");
918 XBIT(data, 4, "Preamble Time Shift index");
920 XBIT(data, 1, "Pilot Pattern Modifier");
921 XBIT(data, 2, "Pilot Pattern Index");
922 return BIT_TO_NIB(bit);
925 gint MIMO_UL_IE(proto_tree *uiuc_tree, const guint8 *bufptr, gint offset, gint length, tvbuff_t *tvb)
927 /* UL-MAP Extended IE = 6 */
928 /* 8.4.5.4.11 MIMO_UL_Basic_IE (not implemented) */
929 /* offset of TLV in nibbles, length of TLV in nibbles */
932 proto_item *ti = NULL;
933 proto_item *tree = NULL;
937 ti = proto_tree_add_text(uiuc_tree, tvb, NIBHI(offset, length), "MIMO_UL_Basic_IE");
938 tree = proto_item_add_subtree(ti, ett_299);
940 XNIB(data, 1, "Extended UIUC");
941 XNIB(data, 1, "Length");
942 proto_tree_add_text(tree, tvb, NIBHI(nib,length-2), "(not implemented)");
946 gint ULMAP_Fast_Tracking_IE(proto_tree *uiuc_tree, const guint8 *bufptr, gint offset, gint length, tvbuff_t *tvb)
948 /* UL-MAP Extended IE = 7 */
949 /* 8.4.5.4.22 [2] ULMAP_Fast_Tracking_IE */
950 /* offset of TLV in nibbles, length of TLV in nibbles */
953 proto_item *ti = NULL;
954 proto_item *tree = NULL;
956 bit = NIB_TO_BIT(offset);
958 ti = proto_tree_add_text(uiuc_tree, tvb, NIBHI(offset, length), "Fast_Tracking_IE");
959 tree = proto_item_add_subtree(ti, ett_302h);
961 length = NIB_TO_BIT(length);
963 XBIT(data, 4, "Extended UIUC");
964 XBIT(data, 4, "Length");
966 XBIT(data, 2, "Map Index");
967 XBIT(data, 6, "Reserved");
968 while (bit < (length-7)) {
969 XBIT(data, 3, "Power correction");
970 XBIT(data, 3, "Frequency correction");
971 XBIT(data, 2, "Time correction");
973 return BIT_TO_NIB(bit);
976 gint UL_PUSC_Burst_Allocation_in_other_segment_IE(proto_tree *uiuc_tree, const guint8 *bufptr, gint offset, gint length, tvbuff_t *tvb)
978 /* UL-MAP Extended IE = 8 */
979 /* 8.4.5.4.17 [2] UL_PUSC_Burst_Allocation_in_other_segment_IE */
980 /* offset of TLV in nibbles, length of TLV in nibbles */
983 proto_item *ti = NULL;
984 proto_item *tree = NULL;
986 bit = NIB_TO_BIT(offset);
988 ti = proto_tree_add_text(uiuc_tree, tvb, NIBHI(offset, length), "UL_PUSC_Burst_Allocation_in_Other_Segment_IE");
989 tree = proto_item_add_subtree(ti, ett_302c);
991 XBIT(data, 4, "Extended UIUC");
992 XBIT(data, 4, "Length");
994 XBIT(data, 4, "UIUC");
995 XBIT(data, 2, "Segment");
996 XBIT(data, 7, "UL_PermBase");
997 XBIT(data, 8, "OFDMA symbol offset");
998 XBIT(data, 6, "Subchannel offset");
999 XBIT(data,10, "Duration");
1000 XBIT(data, 2, "Repetition coding indication");
1001 XBIT(data, 1, "Reserved");
1002 return BIT_TO_NIB(bit);
1005 gint Fast_Ranging_IE(proto_tree *uiuc_tree, const guint8 *bufptr, gint offset, gint length, tvbuff_t *tvb)
1007 /* UL-MAP Extended IE = 9 */
1008 /* 8.4.5.4.21 [2] Fast_Ranging_IE */
1009 /* offset of TLV in nibbles, length of TLV in nibbles */
1012 proto_item *ti = NULL;
1013 proto_item *tree = NULL;
1016 bit = NIB_TO_BIT(offset);
1018 ti = proto_tree_add_text(uiuc_tree, tvb, NIBHI(offset, length), "Fast_Ranging_IE");
1019 tree = proto_item_add_subtree(ti, ett_302g);
1021 XBIT(data, 4, "Extended UIUC");
1022 XBIT(data, 4, "Length");
1024 XBIT(hidi, 1, "HO_ID indicator");
1025 XBIT(data, 7, "Reserved");
1027 XBIT(data, 8, "HO_ID");
1028 /* XBIT(data, 40, "Reserved"); TODO */
1030 /* XBIT(data, 48, "MAC address"); TODO */
1031 proto_tree_add_text(tree, tvb, BITHI(bit, 48), "MAC address");
1034 XBIT(data, 4, "UIUC");
1035 XBIT(data,10, "Duration");
1036 XBIT(data, 2, "Repetition coding indication");
1037 return BIT_TO_NIB(bit);
1040 gint UL_Allocation_Start_IE(proto_tree *uiuc_tree, const guint8 *bufptr, gint offset, gint length, tvbuff_t *tvb)
1042 /* UL-MAP Extended IE = 0xA */
1043 /* 8.4.5.4.15 [2] UL_Allocation_Start_IE */
1044 /* offset of TLV in nibbles, length of TLV in nibbles */
1047 proto_item *ti = NULL;
1048 proto_item *tree = NULL;
1050 bit = NIB_TO_BIT(offset);
1052 ti = proto_tree_add_text(uiuc_tree, tvb, NIBHI(offset, length), "UL_Allocation_start_IE");
1053 tree = proto_item_add_subtree(ti, ett_302a);
1055 XBIT(data, 4, "Extended UIUC");
1056 XBIT(data, 4, "Length");
1058 XBIT(data, 8, "OFDMA symbol offset");
1059 XBIT(data, 7, "Subchannel offset");
1060 XBIT(data, 1, "Reserved");
1061 return BIT_TO_NIB(bit);
1065 /********************************************************************
1066 * UL-MAP Extended-2 IEs
1068 *******************************************************************/
1070 gint CQICH_Enhanced_Allocation_IE(proto_tree *uiuc_tree, const guint8 *bufptr, gint offset, gint length, tvbuff_t *tvb)
1072 /* UL-MAP Extended-2 IE = 0 */
1073 /* 8.4.5.4.16 [2] CQICH_Enhanced_Allocation_IE */
1074 /* offset of TLV in nibbles, length of TLV in nibbles */
1077 proto_item *ti = NULL;
1078 proto_item *tree = NULL;
1082 bit = NIB_TO_BIT(offset);
1084 ti = proto_tree_add_text(uiuc_tree, tvb, NIBHI(offset, length), "CQICH_Enhanced_Alloc_IE");
1085 tree = proto_item_add_subtree(ti, ett_302b);
1087 XBIT(data, 4, "Extended-2 UIUC");
1088 XBIT(data, 8, "Length");
1090 if (cqich_id_size == 0) {
1091 proto_tree_add_text(tree, tvb, BITHI(bit, 1), "CQICH_ID: n/a (size == 0 bits)");
1093 /* variable from 0-9 bits */
1094 data = BIT_BITS16(bit, bufptr, cqich_id_size);
1095 proto_tree_add_text(tree, tvb, BITHI(bit, cqich_id_size), "CQICH_ID: %d (%d bits)", data, cqich_id_size);
1096 bit += cqich_id_size;
1099 XBIT(data, 3, "Period (p)");
1100 XBIT(data, 3, "Frame offset");
1101 XBIT(data, 3, "Duration (d)");
1102 XBIT(cnum, 4, "CQICH_Num");
1104 for (i = 0; i < cnum; i++) {
1105 XBIT(data, 3, "Feedback Type");
1106 XBIT(data, 6, "Allocation Index");
1107 XBIT(data, 3, "CQICH Type");
1108 XBIT(data, 1, "STTD indication");
1110 XBIT(bapm, 1, "Band_AMC_Precoding_Mode");
1112 XBIT(data, 3, "Nr_Precoders_Feedback (=N)");
1115 pad = BIT_PADDING(bit,8);
1117 proto_tree_add_text(tree, tvb, BITHI(bit, pad), "Padding: %d bits", pad);
1120 return BIT_TO_NIB(bit);
1123 gint HO_Anchor_Active_UL_MAP_IE(proto_tree *uiuc_tree, const guint8 *bufptr, gint offset, gint length, tvbuff_t *tvb)
1125 /* UL-MAP Extended-2 IE = 1 */
1126 /* 8.4.5.4.18 [2] HO_Anchor_Active_UL_MAP_IE (not implemented) */
1127 /* offset of TLV in nibbles, length of TLV in nibbles */
1130 proto_item *ti = NULL;
1131 proto_item *tree = NULL;
1135 ti = proto_tree_add_text(uiuc_tree, tvb, NIBHI(offset, length), "HO_Anchor_Active_UL_MAP_IE");
1136 tree = proto_item_add_subtree(ti, ett_302d);
1138 XNIB(data, 1, "Extended-2 UIUC");
1139 XNIB(data, 2, "Length");
1140 proto_tree_add_text(tree, tvb, NIBHI(nib,length-3), "(not implemented)");
1144 gint HO_Active_Anchor_UL_MAP_IE(proto_tree *uiuc_tree, const guint8 *bufptr, gint offset, gint length, tvbuff_t *tvb)
1146 /* UL-MAP Extended-2 IE = 2 */
1147 /* 8.4.5.4.19 [2] HO_Active_Anchor_UL_MAP_IE (not implemented) */
1148 /* offset of TLV in nibbles, length of TLV in nibbles */
1151 proto_item *ti = NULL;
1152 proto_item *tree = NULL;
1156 ti = proto_tree_add_text(uiuc_tree, tvb, NIBHI(offset, length), "HO_Active_Anchor_UL_MAP_IE");
1157 tree = proto_item_add_subtree(ti, ett_302e);
1159 XNIB(data, 1, "Extended-2 UIUC");
1160 XNIB(data, 2, "Length");
1161 proto_tree_add_text(tree, tvb, NIBHI(nib,length-3), "(not implemented)");
1165 gint Anchor_BS_switch_IE(proto_tree *uiuc_tree, const guint8 *bufptr, gint offset, gint length, tvbuff_t *tvb)
1167 /* UL-MAP Extended-2 IE = 3 */
1168 /* 8.4.5.4.23 [2] Anchor_BS_switch_IE */
1169 /* offset of TLV in nibbles, length of TLV in nibbles */
1172 proto_item *ti = NULL;
1173 proto_item *tree = NULL;
1174 gint nbss, acod, cqai, pad;
1177 bit = NIB_TO_BIT(offset);
1179 ti = proto_tree_add_text(uiuc_tree, tvb, NIBHI(offset, length), "Anchor_BS_switch_IE");
1180 tree = proto_item_add_subtree(ti, ett_302i);
1182 XBIT(data, 4, "Extended-2 UIUC");
1183 XBIT(data, 8, "Length");
1185 XBIT(nbss, 4, "N_Anchor_BS_switch");
1186 for (i = 0; i < nbss; i++) {
1187 XBIT(data,12, "Reduced CID");
1188 XBIT(acod, 2, "Action Code");
1190 XBIT(data, 3, "Action Time (A)");
1191 XBIT(data, 3, "TEMP_BS_ID");
1192 XBIT(data, 2, "Reserved");
1194 if (acod == 0 || acod == 1) {
1195 XBIT(data, 1, "AK Change Indicator");
1196 XBIT(cqai, 1, "CQICH Allocation Indicator");
1198 /* variable bits from 0-9 */
1199 if (cqich_id_size == 0) {
1200 proto_tree_add_text(tree, tvb, BITHI(bit, 1), "CQICH_ID: n/a (size == 0 bits)");
1202 data = BIT_BITS16(bit, bufptr, cqich_id_size);
1203 proto_tree_add_text(tree, tvb, BITHI(bit, cqich_id_size),
1204 "CQICH_ID: %d (%d bits)", data, cqich_id_size);
1205 bit += cqich_id_size;
1207 XBIT(data, 6, "Feedback channel offset");
1208 XBIT(data, 2, "Period (=p)");
1209 XBIT(data, 3, "Frame offset");
1210 XBIT(data, 3, "Duration (=d)");
1211 XBIT(data, 2, "MIMO_permutation_feedback_code");
1212 pad = BIT_PADDING(bit,8);
1214 proto_tree_add_text(tree, tvb, BITHI(bit,pad), "Reserved: %d bits", pad);
1218 XBIT(data, 2, "Reserved");
1221 XBIT(data, 4, "Reserved");
1222 return BIT_TO_NIB(bit);
1225 gint UL_sounding_command_IE(proto_tree *uiuc_tree, const guint8 *bufptr, gint offset, gint length, tvbuff_t *tvb)
1227 /* UL-MAP Extended-2 IE = 4 */
1228 /* 8.4.5.4.26 [2] UL_sounding_command_IE */
1229 /* see 8.4.6.2.7.1 */
1230 /* offset of TLV in nibbles, length of TLV in nibbles */
1233 proto_item *ti = NULL;
1234 proto_item *tree = NULL;
1235 gint stype, ssrf, srlf, iafb, pad, sept, nssym, ncid, amod;
1238 bit = NIB_TO_BIT(offset);
1240 ti = proto_tree_add_text(uiuc_tree, tvb, NIBHI(offset, length), "UL_Sounding_Command_IE");
1241 tree = proto_item_add_subtree(ti, ett_315d);
1243 XBIT(data, 4, "Extended-2 UIUC");
1244 XBIT(data, 8, "Length");
1246 XBIT(stype, 1, "Sounding_Type");
1247 XBIT(ssrf, 1, "Send Sounding Report Flag");
1248 XBIT(srlf, 1, "Sounding Relevance Flag");
1250 XBIT(data, 1, "Sounding_Relevance");
1251 XBIT(data, 2, "Reserved");
1253 XBIT(data, 3, "Reserved");
1255 XBIT(iafb, 2, "Include additional feedback");
1257 XBIT(nssym, 3, "Num_Sounding_Symbols");
1258 XBIT(data, 1, "Reserved");
1259 for (i = 0; i < nssym; i++) {
1260 XBIT(sept, 1, "Separability Type");
1262 XBIT(data, 3, "Max Cyclic Shift Index P");
1263 XBIT(data, 1, "Reserved");
1265 XBIT(data, 3, "Decimation Value D");
1266 XBIT(data, 1, "Decimation offset randomization");
1268 XBIT(data, 3, "Sounding symbol index");
1269 XBIT(ncid, 7, "Number of CIDs");
1270 XBIT(data, 1, "Reserved");
1271 for (j = 0; j < ncid; j++) {
1272 XBIT(data,12, "Shorted Basic CID");
1273 XBIT(data, 2, "Power Assignment Method");
1274 XBIT(data, 1, "Power boost");
1275 XBIT(data, 1, "Multi-Antenna Flag");
1276 XBIT(amod, 1, "Allocation Mode");
1278 XBIT(data,12, "Band bit map");
1279 XBIT(data, 2, "Reserved");
1281 XBIT(data, 7, "Starting frequency band");
1282 XBIT(data, 7, "Number of frequency bands");
1285 XBIT(data, 1, "Sounding_Relevance");
1287 XBIT(data, 1, "Reserved");
1290 XBIT(data, 5, "Cyclic time shift index m");
1292 XBIT(data, 6, "Decimation offset d");
1294 XBIT(data, 1, "Use same symbol for additional feedback");
1295 XBIT(data, 2, "Reserved");
1297 XBIT(data, 3, "Reserved");
1300 XBIT(data, 3, "Periodicity");
1304 XBIT(data, 3, "Permutation");
1305 XBIT(data, 6, "DL_PermBase");
1306 XBIT(nssym, 3, "Num_Sounding_symbols");
1307 for (i = 0; i < nssym; i++) {
1308 XBIT(ncid, 7, "Number of CIDs");
1309 XBIT(data, 1, "Reserved");
1310 for (j = 0; j < ncid; j++) {
1311 XBIT(data, 12, "Shortened basic CID");
1313 XBIT(data, 1, "Sounding_Relevance");
1314 XBIT(data, 3, "Reserved");
1316 XBIT(data, 7, "Subchannel offset");
1317 XBIT(data, 1, "Power boost");
1318 XBIT(data, 3, "Number of subchannels");
1319 XBIT(data, 3, "Periodicity");
1320 XBIT(data, 2, "Power assignment method");
1324 pad = BIT_PADDING(bit,8);
1326 proto_tree_add_text(tree, tvb, BITHI(bit,pad), "Padding: %d bits",pad);
1329 return BIT_TO_NIB(bit);
1332 gint MIMO_UL_Enhanced_IE(proto_tree *uiuc_tree, const guint8 *bufptr, gint offset, gint length, tvbuff_t *tvb)
1334 /* UL-MAP Extended-2 IE = 6 */
1335 /* 8.4.5.4.20 [2] MIMO_UL_Enhanced_IE (not implemented) */
1336 /* offset of TLV in nibbles, length of TLV in nibbles */
1339 proto_item *ti = NULL;
1340 proto_item *tree = NULL;
1344 ti = proto_tree_add_text(uiuc_tree, tvb, NIBHI(offset, length), "MIMO_UL_Enhanced_IE");
1345 tree = proto_item_add_subtree(ti, ett_302f);
1347 XNIB(data, 1, "Extended-2 UIUC");
1348 XNIB(data, 2, "Length");
1349 proto_tree_add_text(tree, tvb, NIBHI(nib,length-3), "(not implemented)");
1353 gint HARQ_ULMAP_IE(proto_tree *uiuc_tree, const guint8 *bufptr, gint offset, gint length, tvbuff_t *tvb)
1355 /* UL-MAP Extended-2 IE = 7 */
1356 /* 8.4.5.4.24 HARQ_ULMAP_IE */
1357 /* offset of TLV in nibbles, length of TLV in nibbles */
1360 proto_item *ti = NULL;
1361 proto_item *tree = NULL;
1364 gint pad, mode, alsi, nsub;
1367 bit = NIB_TO_BIT(offset);
1368 bitlength = NIB_TO_BIT(length);
1370 ti = proto_tree_add_text(uiuc_tree, tvb, NIBHI(offset, length), "HARQ_ULMAP_IE");
1371 tree = proto_item_add_subtree(ti, ett_302j);
1373 XBIT(data, 4, "Extended-2 UIUC");
1374 XBIT(data, 8, "Length");
1376 XBIT(RCID_Type, 2, "RCID_Type");
1377 XBIT(data, 2, "Reserved");
1378 lastbit = bit + bitlength -16 - 4;
1379 while (bit < lastbit) {
1380 XBIT(mode, 3, "Mode");
1381 XBIT(alsi, 1, "Allocation Start Indication");
1383 XBIT(data, 8, "OFDMA Symbol offset");
1384 XBIT(data, 7, "Subchannel offset");
1385 XBIT(data, 1, "Reserved");
1387 XBIT(nsub, 4, "N sub Burst");
1389 for (i = 0; i < nsub; i++) {
1391 bit += UL_HARQ_Chase_Sub_Burst_IE(tree, bufptr, bit, bitlength, tvb);
1392 } else if (mode == 1) {
1393 bit += UL_HARQ_IR_CTC_Sub_Burst_IE(tree, bufptr, bit, bitlength, tvb);
1394 } else if (mode == 2) {
1395 bit += UL_HARQ_IR_CC_Sub_Burst_IE(tree, bufptr, bit, bitlength, tvb);
1396 } else if (mode == 3) {
1397 bit += MIMO_UL_Chase_HARQ_Sub_Burst_IE(tree, bufptr, bit, bitlength, tvb);
1398 } else if (mode == 4) {
1399 bit += MIMO_UL_IR_HARQ__Sub_Burst_IE(tree, bufptr, bit, bitlength, tvb);
1400 } else if (mode == 5) {
1401 bit += MIMO_UL_IR_HARQ_for_CC_Sub_Burst_UIE(tree, bufptr, bit, bitlength, tvb);
1402 } else if (mode == 6) {
1403 bit += MIMO_UL_STC_HARQ_Sub_Burst_IE(tree, bufptr, bit, bitlength, tvb);
1408 pad = NIB_TO_BIT(offset) + bitlength - bit;
1410 proto_tree_add_text(tree, tvb, BITHI(bit,pad), "Padding: %d bits",pad);
1413 return BIT_TO_NIB(bit);
1416 gint HARQ_ACKCH_Region_Allocation_IE(proto_tree *uiuc_tree, const guint8 *bufptr, gint offset, gint length, tvbuff_t *tvb)
1418 /* UL-MAP Extended-2 IE = 8 */
1419 /* 8.4.5.4.25 [2] HARQ_ACKCH_Region_Allocation_IE */
1420 /* offset of TLV in nibbles, length of TLV in nibbles */
1423 proto_item *ti = NULL;
1424 proto_item *tree = NULL;
1426 bit = NIB_TO_BIT(offset);
1428 ti = proto_tree_add_text(uiuc_tree, tvb, NIBHI(offset, length), "HARQ_ACKCH_Region_IE");
1429 tree = proto_item_add_subtree(ti, ett_302t);
1431 XBIT(data, 4, "Extended-2 UIUC");
1432 XBIT(data, 8, "Length");
1434 XBIT(data, 8, "OFDMA Symbol Offset");
1435 XBIT(data, 7, "Subchannel Offset");
1436 XBIT(data, 5, "No. OFDMA Symbols");
1437 XBIT(data, 4, "No. Subchannels");
1438 return BIT_TO_NIB(bit);
1441 gint AAS_SDMA_UL_IE(proto_tree *uiuc_tree, const guint8 *bufptr, gint offset, gint length, tvbuff_t *tvb)
1443 /* UL-MAP Extended-2 IE = 0xE */
1444 /* 8.4.5.4.27 [2] AAS_SDMA_UL_IE */
1445 /* offset of TLV in nibbles, length of TLV in nibbles */
1448 proto_item *ti = NULL;
1449 proto_item *tree = NULL;
1450 gint nreg, pad, user, encm, ppmd, padj;
1451 gint aasp = 0; /* TODO AAS UL preamble used */
1454 bit = NIB_TO_BIT(offset);
1456 ti = proto_tree_add_text(uiuc_tree, tvb, NIBHI(offset, length), "AAS_SDMA_UL_IE");
1457 tree = proto_item_add_subtree(ti, ett_302u);
1459 XBIT(data, 4, "Extended-2 UIUC");
1460 XBIT(data, 8, "Length");
1462 XBIT(RCID_Type, 2, "RCID_Type");
1463 XBIT(nreg, 4, "Num Burst Region");
1464 XBIT(data, 2, "Reserved");
1465 for (ii = 0; ii < nreg; ii++) {
1466 XBIT(data,12, "Slot offset");
1467 XBIT(data,10, "Slot duration");
1468 XBIT(user, 3, "Number of users");
1469 XBIT(data, 3, "Reserved");
1470 for (jj = 0; jj < user; jj++) {
1471 bit += RCID_IE(tree, bufptr, bit, length, tvb, RCID_Type);
1472 XBIT(encm, 2, "Encoding Mode");
1473 XBIT(padj, 1, "Power Adjust");
1474 XBIT(ppmd, 1, "Pilot Pattern Modifier");
1476 XBIT(data, 4, "Preamble Modifier Index");
1479 XBIT(data, 2, "Pilot Pattern");
1480 XBIT(data, 2, "Reserved");
1483 XBIT(data, 4, "DIUC");
1484 XBIT(data, 2, "Repetition Coding Indication");
1485 XBIT(data, 2, "Reserved");
1488 XBIT(data, 4, "DIUC");
1489 XBIT(data, 2, "Repetition Coding Indication");
1490 XBIT(data, 4, "ACID");
1491 XBIT(data, 1, "AI_SN");
1492 XBIT(data, 1, "Reserved");
1495 XBIT(data, 4, "N(EP)");
1496 XBIT(data, 4, "N(SCH)");
1497 XBIT(data, 2, "SPID");
1498 XBIT(data, 4, "ACID");
1499 XBIT(data, 1, "AI_SN");
1500 XBIT(data, 1, "Reserved");
1503 XBIT(data, 4, "DIUC");
1504 XBIT(data, 2, "Repetition Coding Indication");
1505 XBIT(data, 2, "SPID");
1506 XBIT(data, 4, "ACID");
1507 XBIT(data, 1, "AI_SN");
1508 XBIT(data, 3, "Reserved");
1511 XBIT(data, 8, "Power Adjustment");
1517 pad = BIT_PADDING(bit,8);
1519 proto_tree_add_text(tree, tvb, BITHI(bit, pad), "Padding: %d bits", pad);
1522 return BIT_TO_NIB(bit);
1525 gint Feedback_Polling_IE(proto_tree *uiuc_tree, const guint8 *bufptr, gint offset, gint length, tvbuff_t *tvb)
1527 /* UL-MAP Extended-2 IE = 0xF */
1528 /* 8.4.5.4.28 [2] Feedback_Polling_IE */
1529 /* offset of TLV in nibbles, length of TLV in nibbles */
1532 proto_item *ti = NULL;
1533 proto_item *tree = NULL;
1534 gint nalloc, dula, pad, adur;
1537 bit = NIB_TO_BIT(offset);
1539 ti = proto_tree_add_text(uiuc_tree, tvb, NIBHI(offset, length), "Feedback_Polling_IE");
1540 tree = proto_item_add_subtree(ti, ett_302v);
1542 XBIT(data, 4, "Extended-2 UIUC");
1543 XBIT(data, 8, "Length");
1545 XBIT(nalloc, 4, "Num_Allocation");
1546 XBIT(dula, 1, "Dedicated UL Allocation included");
1547 XBIT(data, 3, "Reserved");
1548 for (i = 0; i < nalloc; i++) {
1549 XBIT(data,16, "Basic CID");
1550 XBIT(adur, 3, "Allocation Duration (d)");
1552 XBIT(data, 4, "Feedback type");
1553 XBIT(data, 3, "Frame Offset");
1554 XBIT(data, 2, "Period (p)");
1556 XBIT(data, 4, "UIUC");
1557 XBIT(data, 8, "OFDMA Symbol Offset");
1558 XBIT(data, 7, "Subchannel offset");
1559 XBIT(data, 3, "Duration");
1560 XBIT(data, 2, "Repetition coding indication");
1564 pad = BIT_PADDING(bit,8);
1566 proto_tree_add_text(tree, tvb, BITHI(bit, pad), "Padding: %d bits", pad);
1569 return BIT_TO_NIB(bit);
1573 /********************************************************************
1575 *******************************************************************/
1578 void lshift_bits(guint8 *buffer, gint bytes, gint bits)
1580 /* left shift a buffer by specified number of bits */
1581 /* used for ULMAP ExtIE CQICH alloc IE */
1586 for (i=1; i<bytes; i++)
1587 buffer[i-1] = buffer[i];
1594 for (i = 0; i < (bytes-1); i++) {
1596 buffer[i] |= (buffer[i+1] >> xbits);
1598 buffer[bytes-1] <<= bits;
1604 gint dissect_ulmap_ie( proto_tree *ie_tree, const guint8 *bufptr, gint offset, gint length _U_, tvbuff_t *tvb)
1606 /* decode a single UL-MAP IE and return the
1607 * length of the IE in nibbles
1608 * offset = start of IE (nibbles)
1609 * length = total length of bufptr (nibbles) */
1610 proto_item *ti = NULL;
1611 proto_tree *tree = NULL;
1613 gint uiuc, ext_uiuc, ext2_uiuc, len, aas_or_amc;
1620 /* 8.4.5.4 UL-MAP IE format - table 287 */
1621 cid = NIB_WORD(nibble, bufptr);
1622 uiuc = NIB_NIBBLE(nibble + 4, bufptr);
1626 /* 8.4.5.4.9 FAST-FEEDBACK channel */
1627 ti = proto_tree_add_text(ie_tree, tvb, NIBHI(nibble, 5+8), "FAST FEEDBACK Allocation IE");
1628 tree = proto_item_add_subtree(ti, ett_ulmap_ffb);
1630 proto_tree_add_uint(tree, hf_ulmap_ie_cid, tvb, NIBHI(nibble, 4), cid);
1632 proto_tree_add_uint(tree, hf_ulmap_ie_uiuc, tvb, NIBHI(nibble, 1), uiuc);
1635 data = NIB_LONG(nibble, bufptr);
1636 proto_tree_add_uint(tree, hf_ulmap_uiuc0_symofs, tvb, NIBHI(nibble, 8), data);
1637 proto_tree_add_uint(tree, hf_ulmap_uiuc0_subofs, tvb, NIBHI(nibble, 8), data);
1638 proto_tree_add_uint(tree, hf_ulmap_uiuc0_numsym, tvb, NIBHI(nibble, 8), data);
1639 proto_tree_add_uint(tree, hf_ulmap_uiuc0_numsub, tvb, NIBHI(nibble, 8), data);
1640 proto_tree_add_uint(tree, hf_ulmap_uiuc0_rsv, tvb, NIBHI(nibble, 8), data);
1643 else if (uiuc == 11)
1645 /* 8.4.5.4.4.2 [2] extended-2 UIUC IE table 290b */
1646 ext2_uiuc = NIB_NIBBLE(5+nibble, bufptr);
1647 len = NIB_BYTE(5+nibble+1, bufptr);
1649 ti = proto_tree_add_text(ie_tree, tvb, NIBHI(nibble, 5+3+len*2), "UIUC: %d (Extended-2 IE)", uiuc);
1650 tree = proto_item_add_subtree(ti, ett_290b);
1652 proto_tree_add_uint(tree, hf_ulmap_ie_cid, tvb, NIBHI(nibble, 4), cid);
1654 proto_tree_add_uint(tree, hf_ulmap_ie_uiuc, tvb, NIBHI(nibble, 1), uiuc);
1658 proto_tree_add_uint(tree, hf_ulmap_uiuc11_ext, tvb, NIBHI(nibble, 1), ext2_uiuc);
1660 proto_tree_add_uint(tree, hf_ulmap_uiuc11_len, tvb, NIBHI(nibble, 2), len);
1664 len = 3 + BYTE_TO_NIB(len); /* length in nibbles */
1666 /* data table 290c 8.4.5.4.4.2 */
1667 switch (ext2_uiuc) {
1669 /* 8.4.5.4.16 CQICH_Enhanced_Allocation_IE */
1670 nibble = CQICH_Enhanced_Allocation_IE(tree, bufptr, nibble, len, tvb);
1673 /* 8.4.5.4.18 HO_Anchor_Active_UL_MAP_IE */
1674 nibble = HO_Anchor_Active_UL_MAP_IE(tree, bufptr, nibble, len, tvb);
1677 /* 8.4.5.4.19 HO_Active_Anchor_UL_MAP_IE */
1678 nibble = HO_Active_Anchor_UL_MAP_IE(tree, bufptr, nibble, len, tvb);
1681 /* 8.4.5.4.23 Anchor_BS_switch_IE */
1682 nibble = Anchor_BS_switch_IE(tree, bufptr, nibble, len, tvb);
1685 /* 8.4.5.4.26 UL_sounding_command_IE */
1686 nibble = UL_sounding_command_IE(tree, bufptr, nibble, len, tvb);
1689 /* 8.4.5.4.20 MIMO_UL_Enhanced_IE */
1690 nibble = MIMO_UL_Enhanced_IE(tree, bufptr, nibble, len, tvb);
1693 /* 8.4.5.4.24 HARQ_ULMAP_IE */
1694 nibble = HARQ_ULMAP_IE(tree, bufptr, nibble, len, tvb);
1697 /* 8.4.5.4.25 HARQ_ACKCH_Region_Allocation_IE */
1698 nibble = HARQ_ACKCH_Region_Allocation_IE(tree, bufptr, nibble, len, tvb);
1701 /* 8.4.5.4.27 AAS_SDMA_UL_IE */
1702 nibble = AAS_SDMA_UL_IE(tree, bufptr, nibble, len, tvb);
1705 /* 8.4.5.4.28 Feedback_Polling_IE */
1706 nibble = Feedback_Polling_IE(tree, bufptr, nibble, len, tvb);
1710 proto_tree_add_text(tree, tvb, NIBHI(nibble, len), "(reserved Extended-2 UIUC: %d)", ext2_uiuc);
1716 else if (uiuc == 12)
1718 /* 8.4.5.4 [2] CDMA bandwidth request, CDMA ranging */
1719 ti = proto_tree_add_text(ie_tree, tvb, NIBHI(nibble, 5+8), "CDMA Bandwidth/Ranging Request IE");
1720 tree = proto_item_add_subtree(ti, ett_287_1);
1722 proto_tree_add_uint(tree, hf_ulmap_ie_cid, tvb, NIBHI(nibble, 4), cid);
1724 proto_tree_add_uint(tree, hf_ulmap_ie_uiuc, tvb, NIBHI(nibble, 1), uiuc);
1727 data32 = NIB_LONG(nibble, bufptr);
1728 proto_tree_add_uint(tree, hf_ulmap_uiuc12_symofs, tvb, NIBHI(nibble,8), data32);
1729 proto_tree_add_uint(tree, hf_ulmap_uiuc12_subofs, tvb, NIBHI(nibble,8), data32);
1730 proto_tree_add_uint(tree, hf_ulmap_uiuc12_numsym, tvb, NIBHI(nibble,8), data32);
1731 proto_tree_add_uint(tree, hf_ulmap_uiuc12_numsub, tvb, NIBHI(nibble,8), data32);
1732 proto_tree_add_uint(tree, hf_ulmap_uiuc12_method, tvb, NIBHI(nibble,8), data32);
1733 proto_tree_add_uint(tree, hf_ulmap_uiuc12_dri, tvb, NIBHI(nibble,8), data32);
1736 else if (uiuc == 13)
1738 /* 8.4.5.4.2 [2] PAPR reduction allocation, safety zone - table 289 */
1739 ti = proto_tree_add_text(ie_tree, tvb, NIBHI(nibble,5+8), "PAPR/Safety/Sounding Zone IE");
1740 tree = proto_item_add_subtree(ti, ett_289);
1743 proto_tree_add_uint(tree, hf_ulmap_ie_cid, tvb, NIBHI(nibble, 4), cid);
1745 proto_tree_add_uint(tree, hf_ulmap_ie_uiuc, tvb, NIBHI(nibble, 1), uiuc);
1748 data = NIB_LONG(nibble, bufptr);
1749 proto_tree_add_uint(tree, hf_ulmap_uiuc13_symofs, tvb, NIBHI(nibble,8), data);
1750 proto_tree_add_uint(tree, hf_ulmap_uiuc13_subofs, tvb, NIBHI(nibble,8), data);
1751 proto_tree_add_uint(tree, hf_ulmap_uiuc13_numsym, tvb, NIBHI(nibble,8), data);
1752 proto_tree_add_uint(tree, hf_ulmap_uiuc13_numsub, tvb, NIBHI(nibble,8), data);
1753 proto_tree_add_uint(tree, hf_ulmap_uiuc13_papr, tvb, NIBHI(nibble,8), data);
1754 proto_tree_add_uint(tree, hf_ulmap_uiuc13_zone, tvb, NIBHI(nibble,8), data);
1755 proto_tree_add_uint(tree, hf_ulmap_uiuc13_rsv, tvb, NIBHI(nibble,8), data);
1758 else if (uiuc == 14)
1760 /* 8.4.5.4.3 [2] CDMA allocation IE */
1761 ti = proto_tree_add_text(ie_tree, tvb, NIBHI(nibble,5+10), "CDMA allocation IE");
1762 tree = proto_item_add_subtree(ti, ett_290);
1764 proto_tree_add_uint(tree, hf_ulmap_ie_cid, tvb, NIBHI(nibble, 4), cid);
1766 proto_tree_add_uint(tree, hf_ulmap_ie_uiuc, tvb, NIBHI(nibble, 1), uiuc);
1769 data = NIB_WORD(nibble, bufptr);
1770 proto_tree_add_uint(tree, hf_ulmap_uiuc14_dur, tvb, NIBHI(nibble,2), data);
1771 proto_tree_add_uint(tree, hf_ulmap_uiuc14_uiuc, tvb, NIBHI(nibble+1,2), data);
1772 proto_tree_add_uint(tree, hf_ulmap_uiuc14_rep, tvb, NIBHI(nibble+2,1), data);
1773 proto_tree_add_uint(tree, hf_ulmap_uiuc14_idx, tvb, NIBHI(nibble+3,1), data);
1776 data = NIB_BYTE(nibble, bufptr);
1777 proto_tree_add_uint(tree, hf_ulmap_uiuc14_code, tvb, NIBHI(nibble,2), data);
1778 proto_item_append_text(ti, " (0x%02x)", data);
1781 data = NIB_BYTE(nibble, bufptr);
1782 proto_tree_add_uint(tree, hf_ulmap_uiuc14_sym, tvb, NIBHI(nibble,2), data);
1783 proto_item_append_text(ti, " (0x%02x)", data);
1786 data = NIB_BYTE(nibble, bufptr);
1787 proto_tree_add_uint(tree, hf_ulmap_uiuc14_sub, tvb, NIBHI(nibble,2), data);
1788 proto_item_append_text(ti, " (0x%02x)", data >> 1);
1789 proto_tree_add_uint(tree, hf_ulmap_uiuc14_bwr, tvb, NIBHI(nibble+1,1), data);
1792 else if (uiuc == 15)
1794 /* 8.4.5.4.4 [1] Extended UIUC dependent IE table 291 */
1795 ext_uiuc = NIB_NIBBLE(5+nibble, bufptr);
1796 len = NIB_NIBBLE(5+nibble+1, bufptr);
1798 ti = proto_tree_add_text(ie_tree, tvb, NIBHI(nibble, 5+2+len*2), "UIUC: %d (Extended IE)", uiuc);
1799 tree = proto_item_add_subtree(ti, ett_291);
1801 proto_tree_add_uint(tree, hf_ulmap_ie_cid, tvb, NIBHI(nibble,4), cid);
1803 proto_tree_add_uint(tree, hf_ulmap_ie_uiuc, tvb, NIBHI(nibble,1), uiuc);
1807 ti = proto_tree_add_uint(tree, hf_ulmap_uiuc11_ext, tvb, NIBHI(nibble,1), ext_uiuc);
1809 proto_tree_add_uint(tree, hf_ulmap_uiuc11_len, tvb, NIBHI(nibble,1), len);
1813 len = 2 + BYTE_TO_NIB(len); /* length in nibbles */
1815 /* data table 290a 8.4.5.4.4.1 */
1818 /* 8.4.5.4.5 Power_Control_IE */
1819 nibble = Power_Control_IE(tree, bufptr, nibble, len, tvb);
1822 /* 8.4.5.4.8 Mini-Subchannel_allocation_IE*/
1823 nibble = Mini_Subchannel_allocation_IE(tree, bufptr, nibble, len, tvb);
1826 /* 8.4.5.4.6 AAS_UL_IE*/
1827 nibble = AAS_UL_IE(tree, bufptr, nibble, len, tvb);
1830 /* 8.4.5.4.12 CQICH_Alloc_IE */
1831 nibble = CQICH_Alloc_IE(tree, bufptr, nibble, len, tvb);
1834 /* 8.4.5.4.7 UL_Zone_IE */
1835 nibble = UL_Zone_IE(tree, bufptr, nibble, len, tvb);
1838 /* 8.4.5.4.14 PHYMOD_UL_IE */
1839 nibble = PHYMOD_UL_IE(tree, bufptr, nibble, len, tvb);
1842 /* 8.4.5.4.11 MIMO_UL_IE */
1843 nibble = MIMO_UL_IE(tree, bufptr, nibble, len, tvb);
1846 /* 8.4.5.4.22 ULMAP_Fast_Tracking_IE */
1847 nibble = ULMAP_Fast_Tracking_IE(tree, bufptr, nibble, len, tvb);
1850 /* 8.4.5.4.17 UL_PUSC_Burst_Allocation_in_other_segment_IE */
1851 nibble = UL_PUSC_Burst_Allocation_in_other_segment_IE(tree, bufptr, nibble, len, tvb);
1854 /* 8.4.5.4.21 Fast_Ranging_IE */
1855 nibble = Fast_Ranging_IE(tree, bufptr, nibble, len, tvb);
1858 /* 8.4.5.4.15 UL_Allocation_Start_IE */
1859 nibble = UL_Allocation_Start_IE(tree, bufptr, nibble, len, tvb);
1862 proto_tree_add_text(tree, tvb, NIBHI(nibble,len), "(reserved Extended UIUC: %d)", ext_uiuc);
1869 /* 8.4.5.4 [2] regular IE 1-10, data grant burst type */
1870 aas_or_amc = 0; /* TODO */
1873 if (aas_or_amc) len += 3;
1875 ti = proto_tree_add_text(ie_tree, tvb, NIBHI(nibble, 5+len), "Data Grant Burst Profile");
1876 tree = proto_item_add_subtree(ti, ett_287_2);
1878 proto_tree_add_uint(tree, hf_ulmap_ie_cid, tvb, NIBHI(nibble, 4), cid);
1880 proto_tree_add_uint(tree, hf_ulmap_ie_uiuc, tvb, NIBHI(nibble, 1), uiuc);
1883 data = NIB_WORD(nibble, bufptr);
1884 proto_tree_add_uint(tree, hf_ulmap_uiuc10_dur, tvb, NIBHI(nibble,3), data);
1885 proto_tree_add_uint(tree, hf_ulmap_uiuc10_rep, tvb, NIBHI(nibble+2,1), data);
1889 data = NIB_BITS12(nibble, bufptr);
1890 proto_tree_add_text(tree, tvb, NIBHI(nibble,3), "Slot offset: %d", data);
1895 /* length in nibbles */
1896 return (nibble - offset);
1899 void dissect_mac_mgmt_msg_ulmap_decoder(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree)
1901 /* 6.3.2.3.4 [2] UL-MAP table 18 */
1905 proto_item *ti = NULL;
1906 proto_tree *ulmap_tree = NULL;
1907 proto_tree *ie_tree = NULL;
1909 const guint8 *bufptr;
1911 tvb_len = tvb_reported_length(tvb);
1912 /* XXX This should be removed, and regular tvb accessors should be used instead. */
1913 bufptr = tvb_get_ptr(tvb, offset, tvb_len);
1915 /* display MAC UL-MAP */
1916 ti = proto_tree_add_protocol_format(tree, proto_mac_mgmt_msg_ulmap_decoder, tvb, offset, tvb_len, "UL-MAP (%u bytes)", tvb_len);
1917 ulmap_tree = proto_item_add_subtree(ti, ett_ulmap);
1919 /* Decode and display the UL-MAP */
1920 proto_tree_add_item(ulmap_tree, hf_ulmap_message_type, tvb, offset, 1, FALSE);
1923 proto_tree_add_item(ulmap_tree, hf_ulmap_reserved, tvb, offset, 1, FALSE);
1925 proto_tree_add_item(ulmap_tree, hf_ulmap_ucd_count, tvb, offset, 1, FALSE);
1927 proto_tree_add_item(ulmap_tree, hf_ulmap_alloc_start_time, tvb, offset, 4, FALSE);
1929 proto_tree_add_item(ulmap_tree, hf_ulmap_ofdma_sym, tvb, offset, 1, FALSE);
1933 length = tvb_len - offset; /* remaining length in bytes */
1934 ti = proto_tree_add_text(ulmap_tree, tvb, offset, length, "UL-MAP IEs (%u bytes)", length);
1935 ie_tree = proto_item_add_subtree(ti, ett_ulmap_ie);
1937 length = BYTE_TO_NIB(length); /* convert length to nibbles */
1938 nib = BYTE_TO_NIB(offset);
1939 while (nib < ((tvb_len*2)-1)) {
1940 nib += dissect_ulmap_ie(ie_tree, bufptr, nib, tvb_len*2, tvb);
1942 pad = NIB_PADDING(nib);
1944 proto_tree_add_text(ulmap_tree, tvb, NIBHI(nib,1), "Padding nibble");
1949 /*gint wimax_decode_ulmapc(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)*/
1950 gint wimax_decode_ulmapc(proto_tree *base_tree, const guint8 *bufptr, gint offset, gint length, tvbuff_t *tvb)
1952 /* 8.4.5.6.2 [2] Compressed UL-MAP */
1953 /* returns length in nibbles */
1956 proto_item *ti = NULL;
1957 proto_tree *tree = NULL;
1958 proto_tree *ie_tree = NULL;
1962 /* display MAC UL-MAP */
1963 ti = proto_tree_add_protocol_format(base_tree, proto_mac_mgmt_msg_ulmap_decoder, tvb, NIBHI(offset,length-offset), "Compressed UL-MAP (%u bytes)", NIB_ADDR(length-offset));
1964 tree = proto_item_add_subtree(ti, ett_306);
1966 /* Decode and display the UL-MAP */
1967 data = NIB_BYTE(nib, bufptr);
1968 proto_tree_add_uint(tree, hf_ulmap_ucd_count, tvb, NIBHI(nib,2), data);
1970 data = NIB_LONG(nib, bufptr);
1971 proto_tree_add_uint(tree, hf_ulmap_alloc_start_time, tvb, NIBHI(nib,8), data);
1973 data = NIB_BYTE(nib, bufptr);
1974 proto_tree_add_uint(tree, hf_ulmap_ofdma_sym, tvb, NIBHI(nib,2), data); /* added 2005 */
1977 ti = proto_tree_add_text(tree, tvb, NIBHI(nib,length-nib), "UL-MAP IEs (%u bytes)", NIB_ADDR(length-nib));
1978 ie_tree = proto_item_add_subtree(ti, ett_306_ul);
1979 while (nib < length-1) {
1980 nib += dissect_ulmap_ie(ie_tree, bufptr, nib, length-nib, tvb);
1985 proto_tree_add_text(tree, tvb, NIBHI(nib,1), "Padding Nibble");
1994 gint wimax_decode_ulmap_reduced_aas(proto_tree *base_tree, const guint8 *bufptr, gint offset, gint length, tvbuff_t *tvb)
1996 /* 8.4.5.8.2 Reduced AAS private UL-MAP */
1997 /* offset and length are in bits since this is called from within
1998 * the Reduced AAS private DL-MAP
1999 * return length in bits */
2002 proto_item *ti = NULL;
2003 proto_tree *tree = NULL;
2004 gint azci, azpi, umii, phmi, powi, fbck;
2008 ti = proto_tree_add_text(base_tree, tvb, BITHI(bit,length), "Reduced_AAS_Private_UL_MAP");
2009 tree = proto_item_add_subtree(ti, ett_308b);
2011 /* Decode and display the Reduced AAS private UL-MAP */
2012 XBIT(azci, 1, "AAS zone configuration included");
2013 XBIT(azpi, 1, "AAS zone position included");
2014 XBIT(umii, 1, "UL-MAP information included");
2015 XBIT(phmi, 1, "PHY modification included");
2016 XBIT(powi, 1, "Power Control included");
2017 XBIT(fbck, 2, "Include Feedback Header");
2018 XBIT(data, 2, "Encoding Mode");
2021 XBIT(data, 2, "Permutation");
2022 XBIT(data, 7, "UL_PermBase");
2023 XBIT(data, 2, "Preamble Indication");
2024 XBIT(data, 5, "Padding");
2027 XBIT(data, 8, "Zone Symbol Offset");
2028 XBIT(data, 8, "Zone Length");
2031 XBIT(data, 8, "UCD Count");
2032 data = BIT_BITS64(bit,bufptr,32);
2033 proto_tree_add_text(tree, tvb, BITHI(bit,32), "Private Map Allocation Start Time: %u",data);
2037 XBIT(data, 1, "Preamble Select");
2038 XBIT(data, 4, "Preamble Shift Index");
2039 XBIT(data, 1, "Pilot Pattern Modifier");
2040 data = BIT_BITS32(bit,bufptr,22);
2041 proto_tree_add_text(tree, tvb, BITHI(bit,22), "Pilot Pattern Index: %u",data);
2045 XBIT(data, 8, "Power Control");
2047 XBIT(data, 3, "UL Frame Offset");
2048 XBIT(data,12, "Slot Offset");
2049 XBIT(data,10, "Slot Duration");
2050 XBIT(data, 4, "UIUC / N(EP)");
2052 XBIT(data, 4, "ACID");
2053 XBIT(data, 1, "AI_SN");
2054 XBIT(data, 3, "Reserved");
2056 XBIT(data, 4, "N(SCH)");
2057 XBIT(data, 2, "SPID");
2058 XBIT(data, 2, "Reserved");
2061 XBIT(data, 2, "Repetition Coding Indication");
2063 return (bit - offset); /* length in bits */
2067 /* Register Wimax Mac Payload Protocol and Dissector */
2068 void proto_register_mac_mgmt_msg_ulmap(void)
2070 /* UL-MAP fields display */
2071 static hf_register_info hf[] =
2074 &hf_ulmap_message_type,
2076 "MAC Management Message Type", "wmx.macmgtmsgtype.ulmap",
2077 FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL
2081 &hf_ulmap_fch_expected,
2083 "FCH Expected", "wmx.ulmap.fch.expected",
2084 FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL
2090 "UL-MAP IE", "wmx.ulmap.ie",
2091 FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL
2097 "CID", "wmx.ulmap.ie.cid",
2098 FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL
2104 "UIUC", "wmx.ulmap.ie.uiuc",
2105 FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL
2109 &hf_ulmap_ofdma_sym,
2111 "Num OFDMA Symbols", "wmx.ulmap.ofdma.sym",
2112 FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL
2118 "Reserved", "wmx.ulmap.rsv",
2119 FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL
2123 &hf_ulmap_alloc_start_time,
2125 "Uplink Channel ID", "wmx.ulmap.start",
2126 FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL
2130 &hf_ulmap_ucd_count,
2132 "UCD Count", "wmx.ulmap.ucd",
2133 FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL
2137 &hf_ulmap_uiuc0_numsub,
2139 "No. subchannels", "wmx.ulmap.uiuc0.numsub",
2140 FT_UINT32, BASE_DEC, NULL, 0x000003f8, NULL, HFILL
2144 &hf_ulmap_uiuc0_numsym,
2146 "No. OFDMA symbols", "wmx.ulmap.uiuc0.numsym",
2147 FT_UINT32, BASE_DEC, NULL, 0x0001fc00, NULL, HFILL
2151 &hf_ulmap_uiuc0_rsv,
2153 "Reserved", "wmx.ulmap.uiuc0.rsv",
2154 FT_UINT32, BASE_DEC, NULL, 0x00000007, NULL, HFILL
2158 &hf_ulmap_uiuc0_subofs,
2160 "Subchannel offset", "wmx.ulmap.uiuc0.subofs",
2161 FT_UINT32, BASE_DEC, NULL, 0x00fe0000, NULL, HFILL
2165 &hf_ulmap_uiuc0_symofs,
2167 "OFDMA symbol offset", "wmx.ulmap.uiuc0.symofs",
2168 FT_UINT32, BASE_DEC, NULL, 0xff000000, NULL, HFILL
2172 &hf_ulmap_uiuc11_data,
2174 "Data", "wmx.ulmap.uiuc11.data",
2175 FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL
2179 &hf_ulmap_uiuc11_ext,
2181 "Extended 2 UIUC", "wmx.ulmap.uiuc11.ext",
2182 FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL
2186 &hf_ulmap_uiuc11_len,
2188 "Length", "wmx.ulmap.uiuc11.len",
2189 FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL
2193 &hf_ulmap_uiuc12_dri,
2195 "Dedicated ranging indicator", "wmx.ulmap.uiuc12.dri",
2196 FT_UINT32, BASE_DEC, NULL, 0x00000001, NULL, HFILL
2200 &hf_ulmap_uiuc10_dur,
2202 "Duration", "wmx.ulmap.uiuc12.dur",
2203 FT_UINT16, BASE_DEC, NULL, 0xFFc0, NULL, HFILL
2207 &hf_ulmap_uiuc12_method,
2209 "Ranging Method", "wmx.ulmap.uiuc12.method",
2210 FT_UINT32, BASE_DEC, NULL, 0x00000006, NULL, HFILL
2214 &hf_ulmap_uiuc12_numsub,
2216 "No. Subchannels", "wmx.ulmap.uiuc12.numsub",
2217 FT_UINT32, BASE_DEC, NULL, 0x000003F8, NULL, HFILL
2221 &hf_ulmap_uiuc12_numsym,
2223 "No. OFDMA Symbols", "wmx.ulmap.uiuc12.numsym",
2224 FT_UINT32, BASE_DEC, NULL, 0x0001Fc00, NULL, HFILL
2228 &hf_ulmap_uiuc10_rep,
2230 "Repetition Coding indication", "wmx.ulmap.uiuc12.rep",
2231 FT_UINT16, BASE_DEC, NULL, 0x0030, NULL, HFILL
2235 &hf_ulmap_uiuc12_subofs,
2237 "Subchannel Offset", "wmx.ulmap.uiuc12.subofs",
2238 FT_UINT32, BASE_DEC, NULL, 0x00Fe0000, NULL, HFILL
2242 &hf_ulmap_uiuc12_symofs,
2244 "OFDMA Symbol Offset", "wmx.ulmap.uiuc12.symofs",
2245 FT_UINT32, BASE_DEC, NULL, 0xFF000000, NULL, HFILL
2249 &hf_ulmap_uiuc13_numsub,
2251 "No. Subchannels/SZ Shift Value", "wmx.ulmap.uiuc13.numsub",
2252 FT_UINT32, BASE_DEC, NULL, 0x000003f8, NULL, HFILL
2256 &hf_ulmap_uiuc13_numsym,
2258 "No. OFDMA symbols", "wmx.ulmap.uiuc13.numsym",
2259 FT_UINT32, BASE_DEC, NULL, 0x0001fc00, NULL, HFILL
2263 &hf_ulmap_uiuc13_papr,
2265 "PAPR Reduction/Safety Zone", "wmx.ulmap.uiuc13.papr",
2266 FT_UINT32, BASE_DEC, NULL, 0x00000004, NULL, HFILL
2270 &hf_ulmap_uiuc13_rsv,
2272 "Reserved", "wmx.ulmap.uiuc13.rsv",
2273 FT_UINT32, BASE_DEC, NULL, 0x00000001, NULL, HFILL
2277 &hf_ulmap_uiuc13_subofs,
2279 "Subchannel offset", "wmx.ulmap.uiuc13.subofs",
2280 FT_UINT32, BASE_DEC, NULL, 0x00fe0000, NULL, HFILL
2284 &hf_ulmap_uiuc13_symofs,
2286 "OFDMA symbol offset", "wmx.ulmap.uiuc13.symofs",
2287 FT_UINT32, BASE_DEC, NULL, 0xff000000, NULL, HFILL
2291 &hf_ulmap_uiuc13_zone,
2293 "Sounding Zone", "wmx.ulmap.uiuc13.zone",
2294 FT_UINT32, BASE_DEC, NULL, 0x00000002, NULL, HFILL
2298 &hf_ulmap_uiuc14_bwr,
2300 "BW request mandatory", "wmx.ulmap.uiuc14.bwr",
2301 FT_UINT8, BASE_DEC, NULL, 0x01, NULL, HFILL
2305 &hf_ulmap_uiuc14_code,
2307 "Ranging code", "wmx.ulmap.uiuc14.code",
2308 FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL
2312 &hf_ulmap_uiuc14_dur,
2314 "Duration", "wmx.ulmap.uiuc14.dur",
2315 FT_UINT16, BASE_DEC, NULL, 0xfc00, NULL, HFILL
2319 &hf_ulmap_uiuc14_idx,
2321 "Frame Number Index", "wmx.ulmap.uiuc14.idx",
2322 FT_UINT16, BASE_DEC, NULL, 0x000F, NULL, HFILL
2326 &hf_ulmap_uiuc14_rep,
2328 "Repetition Coding Indication", "wmx.ulmap.uiuc14.rep",
2329 FT_UINT16, BASE_DEC, NULL, 0x0030, NULL, HFILL
2333 &hf_ulmap_uiuc14_sub,
2335 "Ranging subchannel", "wmx.ulmap.uiuc14.sub",
2336 FT_UINT8, BASE_DEC, NULL, 0xfe, NULL, HFILL
2340 &hf_ulmap_uiuc14_sym,
2342 "Ranging symbol", "wmx.ulmap.uiuc14.sym",
2343 FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL
2347 &hf_ulmap_uiuc14_uiuc,
2349 "UIUC", "wmx.ulmap.uiuc14.uiuc",
2350 FT_UINT16, BASE_DEC, NULL, 0x03c0, NULL, HFILL
2354 &hf_ulmap_uiuc15_data,
2356 "Data", "wmx.ulmap.uiuc15.data",
2357 FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL
2361 &hf_ulmap_uiuc15_ext,
2363 "Extended UIUC", "wmx.ulmap.uiuc15.ext",
2364 FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL
2368 &hf_ulmap_uiuc15_len,
2370 "Length", "wmx.ulmap.uiuc15.len",
2371 FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL
2376 /* Setup protocol subtree array */
2377 static gint *ett[] =
2383 /* &ett_ulmap_c_ie, */
2385 /* &ett_ulmap_s_ie, */
2427 proto_mac_mgmt_msg_ulmap_decoder = proto_mac_mgmt_msg_dlmap_decoder;
2429 proto_register_field_array(proto_mac_mgmt_msg_ulmap_decoder, hf, array_length(hf));
2430 proto_register_subtree_array(ett, array_length(ett));