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.
35 #include "moduleinfo.h"
38 #include <epan/packet.h>
39 #include <epan/prefs.h>
41 #include "wimax_bits.h"
43 extern gint proto_mac_mgmt_msg_dlmap_decoder;
44 extern gboolean include_cor2_changes;
46 #define MAC_MGMT_MSG_ULMAP 3
48 #define XBIT(var, bits, desc) \
50 var = BIT_BITS(bit, bufptr, bits); \
51 proto_tree_add_text(tree, tvb, BITHI(bit, bits), desc ": %d", var); \
55 #define XNIB(var, nibs, desc) \
57 var = NIB_NIBS(nib, bufptr, nibs); \
58 proto_tree_add_text(tree, tvb, NIBHI(nib, nibs), desc ": %d", var); \
62 extern gint man_ofdma;
65 extern guint cqich_id_size; /* Set for CQICH_Alloc_IE */
67 /* from msg_dlmap.c */
71 extern gint RCID_Type;
72 extern gint RCID_IE(proto_tree *diuc_tree, const guint8 *bufptr, gint offset, gint length, tvbuff_t *tvb, gint RCID_Type);
75 /* forward reference */
76 void dissect_mac_mgmt_msg_ulmap_decoder(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree);
78 static gint proto_mac_mgmt_msg_ulmap_decoder = -1;
80 static gint ett_ulmap = -1;
81 static gint ett_ulmap_ie = -1;
82 static gint ett_ulmap_ffb = -1;
83 static gint ett_ulmap_c = -1;
84 static gint ett_ulmap_c_ie = -1;
85 static gint ett_ulmap_s = -1;
86 static gint ett_ulmap_s_ie = -1;
87 static gint ett_287_1 = -1;
88 static gint ett_287_2 = -1;
89 static gint ett_289 = -1;
90 static gint ett_290 = -1;
91 static gint ett_290b = -1;
92 static gint ett_291 = -1;
93 static gint ett_292 = -1;
94 static gint ett_293 = -1;
95 static gint ett_294 = -1;
96 static gint ett_295 = -1;
97 static gint ett_299 = -1;
98 static gint ett_300 = -1;
99 static gint ett_302 = -1;
100 static gint ett_302a = -1;
101 static gint ett_302b = -1;
102 static gint ett_302c = -1;
103 static gint ett_302d = -1;
104 static gint ett_302e = -1;
105 static gint ett_302f = -1;
106 static gint ett_302g = -1;
107 static gint ett_302h = -1;
108 static gint ett_302i = -1;
109 static gint ett_302j = -1;
110 static gint ett_302k = -1;
111 static gint ett_302l = -1;
112 static gint ett_302m = -1;
113 static gint ett_302n = -1;
114 static gint ett_302o = -1;
115 static gint ett_302p = -1;
116 static gint ett_302q = -1;
117 static gint ett_302r = -1;
118 static gint ett_302s = -1;
119 static gint ett_302t = -1;
120 static gint ett_302u = -1;
121 static gint ett_302v = -1;
122 static gint ett_306 = -1;
123 static gint ett_306_ul = -1;
124 static gint ett_308b = -1;
125 static gint ett_315d = -1;
127 /* Setup protocol subtree array */
178 #define DCD_DOWNLINK_BURST_PROFILE 1
179 #define DCD_BS_EIRP 2
180 #define DCD_FRAME_DURATION 3
181 #define DCD_PHY_TYPE 4
182 #define DCD_POWER_ADJUSTMENT 5
183 #define DCD_CHANNEL_NR 6
187 #define DCD_CHANNEL_SWITCH_FRAME_NR 10
188 #define DCD_FREQUENCY 12
190 #define DCD_FRAME_DURATION_CODE 14
191 #define DCD_FRAME_NR 15
192 #define DCD_SIZE_CQICH_ID 16
193 #define DCD_H_ARQ_ACK_DELAY 17
194 #define DCD_MAC_VERSION 148
195 #define DCD_RESTART_COUNT 154
197 #define DCD_BURST_FREQUENCY 1
198 #define DCD_BURST_FEC_CODE_TYPE 150
199 #define DCD_BURST_DIUC_EXIT_THRESHOLD 151
200 #define DCD_BURST_DIUC_ENTRY_THRESHOLD 152
201 #define DCD_BURST_TCS_ENABLE 153
203 #define DCD_TLV_T_541_TYPE_FUNCTION_ACTION 1
204 #define DCD_TLV_T542_TRIGGER_VALUE 2
205 #define DCD_TLV_T_543_TRIGGER_AVERAGING_DURATION 3
206 #define DCD_TLV_T_19_PERMUTATION_TYPE_FOR_BROADCAST_REGION_IN_HARQ_ZONE 19
207 #define DCD_TLV_T_20_MAXIMUM_RETRANSMISSION 20
208 #define DCD_TLV_T_21_DEFAULT_RSSI_AND_CINR_AVERAGING_PARAMETER 21
209 #define DCD_TLV_T_22_DL_AMC_ALLOCATED_PHYSICAL_BANDS_BITMAP 22
210 #define DCD_TLV_T_31_H_ADD_THRESHOLD 31
211 #define DCD_TLV_T_32_H_DELETE_THRESHOLD 32
212 #define DCD_TLV_T_33_ASR 33
213 #define DCD_TLV_T_34_DL_REGION_DEFINITION 34
214 #define DCD_TLV_T_35_PAGING_GROUP_ID 35
215 #define DCD_TLV_T_36_TUSC1_PERMUTATION_ACTIVE_SUBCHANNELS_BITMAP 36
216 #define DCD_TLV_T_37_TUSC2_PERMUTATION_ACTIVE_SUBCHANNELS_BITMAP 37
217 #define DCD_TLV_T_45_PAGING_INTERVAL_LENGTH 45
218 #define DCD_TLV_T_50_HO_TYPE_SUPPORT 50
219 #define DCD_TLV_T_51_HYSTERSIS_MARGIN 51
220 #define DCD_TLV_T_52_TIME_TO_TRIGGER_DURATION 52
221 #define DCD_TLV_T_54_TRIGGER 54
222 #define DCD_TLV_T_153_DOWNLINK_BURST_PROFILE_FOR_MULTIPLE_FEC_TYPES 153
224 #define UL_MAP_NCT_PMP 0
225 #define UL_MAP_NCT_DM 1
226 #define UL_MAP_NCT_PTP 2
229 static const value_string nct_msgs[] =
231 { UL_MAP_NCT_PMP, "PMP" },
232 { UL_MAP_NCT_PMP, "DM" },
233 { UL_MAP_NCT_PMP, "PTP" },
237 /* Repetition Coding Indications */
238 static const value_string rep_msgs[] =
240 { 0, "No Repetition Coding" },
241 { 1, "Repetition Coding of 2 Used" },
242 { 2, "Repetition Coding of 4 Used" },
243 { 3, "Repetition Coding of 6 Used" },
247 /* DL Frame Prefix Coding Indications */
248 static const value_string boost_msgs[] =
250 { 0, "Normal (not boosted)" },
262 static gint hf_ulmap_message_type = -1;
263 static gint hf_ulmap_reserved = -1;
264 static gint hf_ulmap_ucd_count = -1;
265 static gint hf_ulmap_alloc_start_time = -1;
266 static gint hf_ulmap_ofdma_sym = -1;
267 static gint hf_ulmap_fch_expected = -1;
269 static gint hf_ulmap_ie = -1;
271 static gint hf_ulmap_ie_cid = -1;
272 static gint hf_ulmap_ie_uiuc = -1;
273 static gint hf_ulmap_uiuc12_symofs = -1;
274 static gint hf_ulmap_uiuc12_subofs = -1;
275 static gint hf_ulmap_uiuc12_numsym = -1;
276 static gint hf_ulmap_uiuc12_numsub = -1;
277 static gint hf_ulmap_uiuc12_method = -1;
278 static gint hf_ulmap_uiuc12_dri = -1;
279 static gint hf_ulmap_uiuc10_dur = -1;
280 static gint hf_ulmap_uiuc10_rep = -1;
282 static gint hf_ulmap_uiuc14_dur = -1;
283 static gint hf_ulmap_uiuc14_uiuc = -1;
284 static gint hf_ulmap_uiuc14_rep = -1;
285 static gint hf_ulmap_uiuc14_idx = -1;
286 static gint hf_ulmap_uiuc14_code = -1;
287 static gint hf_ulmap_uiuc14_sym = -1;
288 static gint hf_ulmap_uiuc14_sub = -1;
289 static gint hf_ulmap_uiuc14_bwr = -1;
291 static gint hf_ulmap_uiuc11_ext = -1;
292 static gint hf_ulmap_uiuc11_len = -1;
293 static gint hf_ulmap_uiuc11_data = -1;
294 static gint hf_ulmap_uiuc15_ext = -1;
295 static gint hf_ulmap_uiuc15_len = -1;
296 static gint hf_ulmap_uiuc15_data = -1;
298 static gint hf_ulmap_uiuc0_symofs = -1;
299 static gint hf_ulmap_uiuc0_subofs = -1;
300 static gint hf_ulmap_uiuc0_numsym = -1;
301 static gint hf_ulmap_uiuc0_numsub = -1;
302 static gint hf_ulmap_uiuc0_rsv = -1;
304 static gint hf_ulmap_uiuc13_symofs = -1;
305 static gint hf_ulmap_uiuc13_subofs = -1;
306 static gint hf_ulmap_uiuc13_numsym = -1;
307 static gint hf_ulmap_uiuc13_numsub = -1;
308 static gint hf_ulmap_uiuc13_papr = -1;
309 static gint hf_ulmap_uiuc13_zone = -1;
310 static gint hf_ulmap_uiuc13_rsv = -1;
312 /* UL-MAP fields display */
313 static hf_register_info hf[] =
316 &hf_ulmap_message_type,
318 "MAC Management Message Type", "wmx.macmgtmsgtype.ulmap",
319 FT_UINT8, BASE_DEC, NULL, 0x0, "", HFILL
323 &hf_ulmap_fch_expected,
325 "FCH Expected", "wmx.ulmap.fch.expected",
326 FT_UINT16, BASE_DEC, NULL, 0x0, "", HFILL
332 "UL-MAP IE", "wmx.ulmap.ie",
333 FT_UINT8, BASE_DEC, NULL, 0x0, "", HFILL
339 "CID", "wmx.ulmap.ie.cid",
340 FT_UINT32, BASE_DEC, NULL, 0x0, "", HFILL
346 "UIUC", "wmx.ulmap.ie.uiuc",
347 FT_UINT8, BASE_DEC, NULL, 0x0, "", HFILL
353 "Num OFDMA Symbols", "wmx.ulmap.ofdma.sym",
354 FT_UINT8, BASE_DEC, NULL, 0x0, "", HFILL
360 "Reserved", "wmx.ulmap.rsv",
361 FT_UINT8, BASE_DEC, NULL, 0x0, "", HFILL
365 &hf_ulmap_alloc_start_time,
367 "Uplink Channel ID", "wmx.ulmap.start",
368 FT_UINT32, BASE_DEC, NULL, 0x0, "", HFILL
374 "UCD Count", "wmx.ulmap.ucd",
375 FT_UINT8, BASE_DEC, NULL, 0x0, "", HFILL
379 &hf_ulmap_uiuc0_numsub,
381 "No. subchannels", "wmx.ulmap.uiuc0.numsub",
382 FT_UINT32, BASE_DEC, NULL, 0x000003f8, "", HFILL
386 &hf_ulmap_uiuc0_numsym,
388 "No. OFDMA symbols", "wmx.ulmap.uiuc0.numsym",
389 FT_UINT32, BASE_DEC, NULL, 0x0001fc00, "", HFILL
395 "Reserved", "wmx.ulmap.uiuc0.rsv",
396 FT_UINT32, BASE_DEC, NULL, 0x00000007, "", HFILL
400 &hf_ulmap_uiuc0_subofs,
402 "Subchannel offset", "wmx.ulmap.uiuc0.subofs",
403 FT_UINT32, BASE_DEC, NULL, 0x00fe0000, "", HFILL
407 &hf_ulmap_uiuc0_symofs,
409 "OFDMA symbol offset", "wmx.ulmap.uiuc0.symofs",
410 FT_UINT32, BASE_DEC, NULL, 0xff000000, "", HFILL
414 &hf_ulmap_uiuc11_data,
416 "Data", "wmx.ulmap.uiuc11.data",
417 FT_BYTES, BASE_HEX, NULL, 0x0, "", HFILL
421 &hf_ulmap_uiuc11_ext,
423 "Extended 2 UIUC", "wmx.ulmap.uiuc11.ext",
424 FT_UINT8, BASE_DEC, NULL, 0x0, "", HFILL
428 &hf_ulmap_uiuc11_len,
430 "Length", "wmx.ulmap.uiuc11.len",
431 FT_UINT8, BASE_DEC, NULL, 0x0, "", HFILL
435 &hf_ulmap_uiuc12_dri,
437 "Dedicated ranging indicator", "wmx.ulmap.uiuc12.dri",
438 FT_UINT32, BASE_DEC, NULL, 0x00000001, "", HFILL
442 &hf_ulmap_uiuc10_dur,
444 "Duration", "wmx.ulmap.uiuc12.dur",
445 FT_UINT16, BASE_DEC, NULL, 0xFFc0, "", HFILL
449 &hf_ulmap_uiuc12_method,
451 "Ranging Method", "wmx.ulmap.uiuc12.method",
452 FT_UINT32, BASE_DEC, NULL, 0x00000006, "", HFILL
456 &hf_ulmap_uiuc12_numsub,
458 "No. Subchannels", "wmx.ulmap.uiuc12.numsub",
459 FT_UINT32, BASE_DEC, NULL, 0x000003F8, "", HFILL
463 &hf_ulmap_uiuc12_numsym,
465 "No. OFDMA Symbols", "wmx.ulmap.uiuc12.numsym",
466 FT_UINT32, BASE_DEC, NULL, 0x0001Fc00, "", HFILL
470 &hf_ulmap_uiuc10_rep,
472 "Repetition Coding indication", "wmx.ulmap.uiuc12.rep",
473 FT_UINT16, BASE_DEC, NULL, 0x0030, "", HFILL
477 &hf_ulmap_uiuc12_subofs,
479 "Subchannel Offset", "wmx.ulmap.uiuc12.subofs",
480 FT_UINT32, BASE_DEC, NULL, 0x00Fe0000, "", HFILL
484 &hf_ulmap_uiuc12_symofs,
486 "OFDMA Symbol Offset", "wmx.ulmap.uiuc12.symofs",
487 FT_UINT32, BASE_DEC, NULL, 0xFF000000, "", HFILL
491 &hf_ulmap_uiuc13_numsub,
493 "No. Subchannels/SZ Shift Value", "wmx.ulmap.uiuc13.numsub",
494 FT_UINT32, BASE_DEC, NULL, 0x000003f8, "", HFILL
498 &hf_ulmap_uiuc13_numsym,
500 "No. OFDMA symbols", "wmx.ulmap.uiuc13.numsym",
501 FT_UINT32, BASE_DEC, NULL, 0x0001fc00, "", HFILL
505 &hf_ulmap_uiuc13_papr,
507 "PAPR Reduction/Safety Zone", "wmx.ulmap.uiuc13.papr",
508 FT_UINT32, BASE_DEC, NULL, 0x00000004, "", HFILL
512 &hf_ulmap_uiuc13_rsv,
514 "Reserved", "wmx.ulmap.uiuc13.rsv",
515 FT_UINT32, BASE_DEC, NULL, 0x00000001, "", HFILL
519 &hf_ulmap_uiuc13_subofs,
521 "Subchannel offset", "wmx.ulmap.uiuc13.subofs",
522 FT_UINT32, BASE_DEC, NULL, 0x00fe0000, "", HFILL
526 &hf_ulmap_uiuc13_symofs,
528 "OFDMA symbol offset", "wmx.ulmap.uiuc13.symofs",
529 FT_UINT32, BASE_DEC, NULL, 0xff000000, "", HFILL
533 &hf_ulmap_uiuc13_zone,
535 "Sounding Zone", "wmx.ulmap.uiuc13.zone",
536 FT_UINT32, BASE_DEC, NULL, 0x00000002, "", HFILL
540 &hf_ulmap_uiuc14_bwr,
542 "BW request mandatory", "wmx.ulmap.uiuc14.bwr",
543 FT_UINT8, BASE_DEC, NULL, 0x01, "", HFILL
547 &hf_ulmap_uiuc14_code,
549 "Ranging code", "wmx.ulmap.uiuc14.code",
550 FT_UINT8, BASE_DEC, NULL, 0x0, "", HFILL
554 &hf_ulmap_uiuc14_dur,
556 "Duration", "wmx.ulmap.uiuc14.dur",
557 FT_UINT16, BASE_DEC, NULL, 0xfc00, "", HFILL
561 &hf_ulmap_uiuc14_idx,
563 "Frame Number Index", "wmx.ulmap.uiuc14.idx",
564 FT_UINT16, BASE_DEC, NULL, 0x000F, "", HFILL
568 &hf_ulmap_uiuc14_rep,
570 "Repetition Coding Indication", "wmx.ulmap.uiuc14.rep",
571 FT_UINT16, BASE_DEC, NULL, 0x0030, "", HFILL
575 &hf_ulmap_uiuc14_sub,
577 "Ranging subchannel", "wmx.ulmap.uiuc14.sub",
578 FT_UINT8, BASE_DEC, NULL, 0xfe, "", HFILL
582 &hf_ulmap_uiuc14_sym,
584 "Ranging symbol", "wmx.ulmap.uiuc14.sym",
585 FT_UINT8, BASE_DEC, NULL, 0x0, "", HFILL
589 &hf_ulmap_uiuc14_uiuc,
591 "UIUC", "wmx.ulmap.uiuc14.uiuc",
592 FT_UINT16, BASE_DEC, NULL, 0x03c0, "", HFILL
596 &hf_ulmap_uiuc15_data,
598 "Data", "wmx.ulmap.uiuc15.data",
599 FT_BYTES, BASE_HEX, NULL, 0x0, "", HFILL
603 &hf_ulmap_uiuc15_ext,
605 "Extended UIUC", "wmx.ulmap.uiuc15.ext",
606 FT_UINT8, BASE_DEC, NULL, 0x0, "", HFILL
610 &hf_ulmap_uiuc15_len,
612 "Length", "wmx.ulmap.uiuc15.len",
613 FT_UINT8, BASE_DEC, NULL, 0x0, "", HFILL
618 /* This gets called each time a capture file is loaded. */
619 void init_wimax_globals(void)
628 /********************************************************************
629 * UL-MAP HARQ Sub-Burst IEs
630 * 8.4.5.4.24 table 302j
631 * these functions take offset/length in bits
632 *******************************************************************/
634 gint Dedicated_UL_Control_IE(proto_tree *uiuc_tree, const guint8 *bufptr, gint offset, gint length, tvbuff_t *tvb)
636 /* 8.4.5.4.24.1 Dedicated_UL_Control_IE -- table 302r */
637 /* UL-MAP HARQ Sub-Burst IE * offset/length are in bits */
640 proto_item *ti = NULL;
641 proto_item *tree = NULL;
646 ti = proto_tree_add_text(uiuc_tree, tvb, NIBHI(offset, length), "Dedicated_UL_Control_IE");
647 tree = proto_item_add_subtree(ti, ett_302r);
649 XBIT(data, 4, "Length");
650 XBIT(sdma, 4, "Control Header");
651 if ((sdma & 1) == 1) {
652 XBIT(data, 2, "Num SDMA layers");
653 XBIT(data, 2, "Pilot Pattern");
655 return (bit - offset); /* length in bits */
658 gint Dedicated_MIMO_UL_Control_IE(proto_tree *uiuc_tree, const guint8 *bufptr, gint offset, gint length, tvbuff_t *tvb)
660 /* 8.4.5.4.24.2 Dedicated_MIMO_UL_Control_IE -- table 302s */
661 /* UL-MAP HARQ Sub-Burst IE * offset/length are in bits */
664 proto_item *ti = NULL;
665 proto_item *tree = NULL;
669 ti = proto_tree_add_text(uiuc_tree, tvb, NIBHI(offset, length), "Dedicated_MIMO_UL_Control_IE");
670 tree = proto_item_add_subtree(ti, ett_302s);
672 XBIT(data, 2, "Matrix");
673 XBIT(N_layer, 2, "N_layer");
675 return (bit - offset); /* length in bits */
678 /* begin Sub-Burst IEs */
680 gint UL_HARQ_Chase_Sub_Burst_IE(proto_tree *uiuc_tree, const guint8 *bufptr, gint offset, gint length, tvbuff_t *tvb)
682 /* 8.4.5.4.24 UL_HARQ_Chase_sub_burst_IE -- table 302k */
683 /* UL-MAP HARQ Sub-Burst IE * offset/length are in bits */
686 proto_item *ti = NULL;
687 proto_item *tree = NULL;
688 proto_item *generic_item = NULL;
690 guint16 calculated_crc;
694 ti = proto_tree_add_text(uiuc_tree, tvb, BITHI(offset,length), "UL_HARQ_Chase_Sub_Burst_IE");
695 tree = proto_item_add_subtree(ti, ett_302k);
697 bit += RCID_IE(tree, bufptr, bit, length, tvb, RCID_Type);
698 XBIT(duci, 1, "Dedicated UL Control Indicator");
700 bit += Dedicated_UL_Control_IE(tree, bufptr, bit, length, tvb);
702 XBIT(data, 4, "UIUC");
703 XBIT(data, 2, "Repetition Coding Indication");
704 XBIT(data,10, "Duration");
705 XBIT(data, 4, "ACID");
706 XBIT(data, 1, "AI_SN");
707 XBIT(data, 1, "ACK_disable");
708 XBIT(data, 1, "Reserved");
710 if (include_cor2_changes)
712 /* CRC-16 is always appended */
713 data = BIT_BITS(bit, bufptr, 16);
714 generic_item = proto_tree_add_text(tree, tvb, BITHI(bit,16), "CRC-16: 0x%04x",data);
715 /* calculate the CRC */
716 calculated_crc = wimax_mac_calc_crc16((guint8 *)tvb_get_ptr(tvb, 0, BIT_TO_BYTE(bit)), BIT_TO_BYTE(bit));
717 if (data != calculated_crc)
719 proto_item_append_text(generic_item, " - incorrect! (should be: 0x%x)", calculated_crc);
724 return (bit - offset); /* length in bits */
727 gint UL_HARQ_IR_CTC_Sub_Burst_IE(proto_tree *uiuc_tree, const guint8 *bufptr, gint offset, gint length, tvbuff_t *tvb)
729 /* 8.4.5.4.24 UL_HARQ_IR_CTC_sub_burst_IE -- table 302l */
730 /* UL-MAP HARQ Sub-Burst IE * offset/length are in bits */
733 proto_item *ti = NULL;
734 proto_item *tree = NULL;
735 proto_item *generic_item = NULL;
737 guint16 calculated_crc;
741 ti = proto_tree_add_text(uiuc_tree, tvb, NIBHI(offset, length), "UL_HARQ_IR_CTC_Sub_Burst_IE");
742 tree = proto_item_add_subtree(ti, ett_302l);
744 bit += RCID_IE(tree, bufptr, bit, length, tvb, RCID_Type);
745 XBIT(duci, 1, "Dedicated UL Control Indicator");
747 bit += Dedicated_UL_Control_IE(tree, bufptr, bit, length, tvb);
749 XBIT(data, 4, "N(EP)");
750 XBIT(data, 4, "N(SCH)");
751 XBIT(data, 2, "SPID");
752 XBIT(data, 4, "ACIN");
753 XBIT(data, 1, "AI_SN");
754 XBIT(data, 1, "ACK_disable");
755 XBIT(data, 3, "Reserved");
757 if (include_cor2_changes)
759 /* CRC-16 is always appended */
760 data = BIT_BITS(bit, bufptr, 16);
761 generic_item = proto_tree_add_text(tree, tvb, BITHI(bit,16), "CRC-16: 0x%04x",data);
762 /* calculate the CRC */
763 calculated_crc = wimax_mac_calc_crc16((guint8 *)tvb_get_ptr(tvb, 0, BIT_TO_BYTE(bit)), BIT_TO_BYTE(bit));
764 if (data != calculated_crc)
766 proto_item_append_text(generic_item, " - incorrect! (should be: 0x%x)", calculated_crc);
771 return (bit - offset); /* length in bits */
774 gint UL_HARQ_IR_CC_Sub_Burst_IE(proto_tree *uiuc_tree, const guint8 *bufptr, gint offset, gint length, tvbuff_t *tvb)
776 /* 8.4.5.4.24 UL_HARQ_IR_CC_sub_burst_IE -- table 302m */
777 /* UL-MAP HARQ Sub-Burst IE * offset/length are in bits */
780 proto_item *ti = NULL;
781 proto_item *tree = NULL;
782 proto_item *generic_item = NULL;
784 guint16 calculated_crc;
788 ti = proto_tree_add_text(uiuc_tree, tvb, NIBHI(offset, length), "UL_HARQ_IR_CC_Sub_Burst_IE");
789 tree = proto_item_add_subtree(ti, ett_302m);
791 bit += RCID_IE(tree, bufptr, bit, length, tvb, RCID_Type);
792 XBIT(duci, 1, "Dedicated UL Control Indicator");
794 bit += Dedicated_UL_Control_IE(tree, bufptr, bit, length, tvb);
796 XBIT(data, 4, "UIUC");
797 XBIT(data, 2, "Repetition Coding Indication");
798 XBIT(data,10, "Duration");
799 XBIT(data, 2, "SPID");
800 XBIT(data, 4, "ACID");
801 XBIT(data, 1, "AI_SN");
802 XBIT(data, 1, "ACK_disable");
803 XBIT(data, 3, "Reserved");
805 if (include_cor2_changes)
807 /* CRC-16 is always appended */
808 data = BIT_BITS(bit, bufptr, 16);
809 generic_item = proto_tree_add_text(tree, tvb, BITHI(bit,16), "CRC-16: 0x%04x",data);
810 /* calculate the CRC */
811 calculated_crc = wimax_mac_calc_crc16((guint8 *)tvb_get_ptr(tvb, 0, BIT_TO_BYTE(bit)), BIT_TO_BYTE(bit));
812 if (data != calculated_crc)
814 proto_item_append_text(generic_item, " - incorrect! (should be: 0x%x)", calculated_crc);
819 return (bit - offset); /* length in bits */
822 gint MIMO_UL_Chase_HARQ_Sub_Burst_IE(proto_tree *uiuc_tree, const guint8 *bufptr, gint offset, gint length, tvbuff_t *tvb)
824 /* 8.4.5.4.24 MIMO_UL_Chase_HARQ_Sub_Burst_IE -- table 302n */
825 /* UL-MAP HARQ Sub-Burst IE * offset/length are in bits */
828 proto_item *ti = NULL;
829 proto_item *tree = NULL;
830 proto_item *generic_item = NULL;
831 gint muin,dmci,ackd,i;
832 guint16 calculated_crc;
836 ti = proto_tree_add_text(uiuc_tree, tvb, NIBHI(offset, length), "MIMO_UL_Chase_HARQ_Sub_Burst_IE");
837 tree = proto_item_add_subtree(ti, ett_302n);
839 XBIT(muin, 1, "MU indicator");
840 XBIT(dmci, 1, "Dedicated MIMO ULControl Indicator");
841 XBIT(ackd, 1, "ACK Disable");
843 bit += RCID_IE(tree, bufptr, bit, length, tvb, RCID_Type);
845 bit += Dedicated_MIMO_UL_Control_IE(tree, bufptr, bit, length, tvb);
848 XBIT(data, 1, "Matrix");
850 XBIT(data, 10, "Duration");
851 for (i = 0; i < N_layer; i++) {
853 bit += RCID_IE(tree, bufptr, bit, length, tvb, RCID_Type);
855 XBIT(data, 4, "UIUC");
856 XBIT(data, 2, "Repetition Coding Indication");
858 XBIT(data, 4, "ACID");
859 XBIT(data, 1, "AI_SN");
863 if (include_cor2_changes)
865 /* CRC-16 is always appended */
866 data = BIT_BITS(bit, bufptr, 16);
867 generic_item = proto_tree_add_text(tree, tvb, BITHI(bit,16), "CRC-16: 0x%04x",data);
868 /* calculate the CRC */
869 calculated_crc = wimax_mac_calc_crc16((guint8 *)tvb_get_ptr(tvb, 0, BIT_TO_BYTE(bit)), BIT_TO_BYTE(bit));
870 if (data != calculated_crc)
872 proto_item_append_text(generic_item, " - incorrect! (should be: 0x%x)", calculated_crc);
877 return (bit - offset); /* length in bits */
880 gint MIMO_UL_IR_HARQ__Sub_Burst_IE(proto_tree *uiuc_tree, const guint8 *bufptr, gint offset, gint length, tvbuff_t *tvb)
882 /* 8.4.5.4.24 MIMO_UL_IR_HARQ__Sub_Burst_IE -- table 302o */
883 /* UL-MAP HARQ Sub-Burst IE * offset/length are in bits */
886 proto_item *ti = NULL;
887 proto_item *tree = NULL;
888 proto_item *generic_item = NULL;
889 gint muin,dmci,ackd,i;
890 guint16 calculated_crc;
894 ti = proto_tree_add_text(uiuc_tree, tvb, NIBHI(offset, length), "MIMO_UL_IR_HARQ__Sub_Burst_IE");
895 tree = proto_item_add_subtree(ti, ett_302o);
897 XBIT(muin, 1, "MU indicator");
898 XBIT(dmci, 1, "Dedicated MIMO UL Control Indicator");
899 XBIT(ackd, 1, "ACK Disable");
901 bit += RCID_IE(tree, bufptr, bit, length, tvb, RCID_Type);
903 bit += Dedicated_MIMO_UL_Control_IE(tree, bufptr, bit, length, tvb);
906 XBIT(data, 1, "Matrix");
908 XBIT(data, 4, "N(SCH)");
909 for (i = 0; i < N_layer; i++) {
911 bit += RCID_IE(tree, bufptr, bit, length, tvb, RCID_Type);
913 XBIT(data, 4, "N(EP)");
915 XBIT(data, 2, "SPID");
916 XBIT(data, 4, "ACID");
917 XBIT(data, 1, "AI_SN");
921 if (include_cor2_changes)
923 /* CRC-16 is always appended */
924 data = BIT_BITS(bit, bufptr, 16);
925 generic_item = proto_tree_add_text(tree, tvb, BITHI(bit,16), "CRC-16: 0x%04x",data);
926 /* calculate the CRC */
927 calculated_crc = wimax_mac_calc_crc16((guint8 *)tvb_get_ptr(tvb, 0, BIT_TO_BYTE(bit)), BIT_TO_BYTE(bit));
928 if (data != calculated_crc)
930 proto_item_append_text(generic_item, " - incorrect! (should be: 0x%x)", calculated_crc);
935 return (bit - offset); /* length in bits */
938 gint MIMO_UL_IR_HARQ_for_CC_Sub_Burst_UIE(proto_tree *uiuc_tree, const guint8 *bufptr, gint offset, gint length, tvbuff_t *tvb)
940 /* 8.4.5.4.24 MIMO_UL_IR_HARQ_for_CC_Sub_Burst_UIE -- table 302p */
941 /* UL-MAP HARQ Sub-Burst IE * offset/length are in bits */
944 proto_item *ti = NULL;
945 proto_item *tree = NULL;
946 proto_item *generic_item = NULL;
947 gint muin,dmci,ackd,i;
948 guint16 calculated_crc;
952 ti = proto_tree_add_text(uiuc_tree, tvb, NIBHI(offset, length), "MIMO_UL_IR_HARQ_for_CC_Sub_Burst_UIE");
953 tree = proto_item_add_subtree(ti, ett_302p);
955 XBIT(muin, 1, "MU indicator");
956 XBIT(dmci, 1, "Dedicated MIMO UL Control Indicator");
957 XBIT(ackd, 1, "ACK Disable");
959 bit += RCID_IE(tree, bufptr, bit, length, tvb, RCID_Type);
961 bit += Dedicated_MIMO_UL_Control_IE(tree, bufptr, bit, length, tvb);
964 XBIT(data, 1, "Matrix");
966 XBIT(data, 10, "Duration");
967 for (i = 0; i < N_layer; i++) {
969 bit += RCID_IE(tree, bufptr, bit, length, tvb, RCID_Type);
971 XBIT(data, 4, "UIUC");
972 XBIT(data, 2, "Repetition Coding Indication");
974 XBIT(data, 4, "ACID");
975 XBIT(data, 1, "AI_SN");
976 XBIT(data, 2, "SPID");
980 if (include_cor2_changes)
982 /* CRC-16 is always appended */
983 data = BIT_BITS(bit, bufptr, 16);
984 generic_item = proto_tree_add_text(tree, tvb, BITHI(bit,16), "CRC-16: 0x%04x",data);
985 /* calculate the CRC */
986 calculated_crc = wimax_mac_calc_crc16((guint8 *)tvb_get_ptr(tvb, 0, BIT_TO_BYTE(bit)), BIT_TO_BYTE(bit));
987 if (data != calculated_crc)
989 proto_item_append_text(generic_item, " - incorrect! (should be: 0x%x)", calculated_crc);
994 return (bit - offset); /* length in bits */
997 gint MIMO_UL_STC_HARQ_Sub_Burst_IE(proto_tree *uiuc_tree, const guint8 *bufptr, gint offset, gint length, tvbuff_t *tvb)
999 /* 8.4.5.4.24 MIMO_UL_STC_HARQ_Sub_Burst_IE -- table 302q */
1000 /* UL-MAP HARQ Sub-Burst IE * offset/length are in bits */
1003 proto_item *ti = NULL;
1004 proto_item *tree = NULL;
1005 proto_item *generic_item = NULL;
1006 gint ackd,txct,sboi;
1007 guint16 calculated_crc;
1011 ti = proto_tree_add_text(uiuc_tree, tvb, NIBHI(offset, length), "MIMO_UL_STC_HARQ_Sub_Burst_IE");
1012 tree = proto_item_add_subtree(ti, ett_302q);
1014 XBIT(txct, 2, "Tx count");
1015 XBIT(data, 10, "Duration");
1016 XBIT(sboi, 1, "Sub-burst offset indication");
1017 /*XBIT(muin, 1, "Reserved");*/
1019 XBIT(data, 8, "Sub-burst offset");
1021 bit += RCID_IE(tree, bufptr, bit, length, tvb, RCID_Type);
1022 XBIT(ackd, 1, "ACK Disable");
1024 XBIT(data, 4, "UIUC");
1025 XBIT(data, 2, "Repetition Coding Indication");
1028 XBIT(data, 4, "ACID");
1031 if (include_cor2_changes)
1033 /* CRC-16 is always appended */
1034 data = BIT_BITS(bit, bufptr, 16);
1035 generic_item = proto_tree_add_text(tree, tvb, BITHI(bit,16), "CRC-16: 0x%04x",data);
1036 /* calculate the CRC */
1037 calculated_crc = wimax_mac_calc_crc16((guint8 *)tvb_get_ptr(tvb, 0, BIT_TO_BYTE(bit)), BIT_TO_BYTE(bit));
1038 if (data != calculated_crc)
1040 proto_item_append_text(generic_item, " - incorrect! (should be: 0x%x)", calculated_crc);
1045 return (bit - offset); /* length in bits */
1048 /********************************************************************
1049 * UL-MAP Extended IEs
1051 *******************************************************************/
1053 gint Power_Control_IE(proto_tree *uiuc_tree, const guint8 *bufptr, gint offset, gint length, tvbuff_t *tvb)
1055 /* UL-MAP Extended IE = 0 */
1056 /* 8.4.5.4.5 Power_Control_IE */
1057 /* offset of TLV in nibbles, length of TLV in nibbles */
1060 proto_item *ti = NULL;
1061 proto_item *tree = NULL;
1065 ti = proto_tree_add_text(uiuc_tree, tvb, NIBHI(offset, length), "Power_Control_IE");
1066 tree = proto_item_add_subtree(ti, ett_292);
1068 XNIB(data, 1, "Extended UIUC");
1069 XNIB(data, 1, "Length");
1071 XNIB(data, 2, "Power Control");
1072 XNIB(data, 2, "Power measurement frame");
1076 gint Mini_Subchannel_allocation_IE(proto_tree *uiuc_tree, const guint8 *bufptr, gint offset, gint length, tvbuff_t *tvb)
1078 /* UL-MAP Extended IE = 1 */
1079 /* 8.4.5.4.8 [2] Mini-Subchannel_allocation_IE */
1080 /* offset of TLV in nibbles, length of TLV in nibbles */
1083 proto_item *ti = NULL;
1084 proto_item *tree = NULL;
1086 const gint m_table[4] = { 2, 2, 3, 6 };
1088 bit = NIB_TO_BIT(offset);
1090 ti = proto_tree_add_text(uiuc_tree, tvb, NIBHI(offset, length), "Mini_subchannel_allocation_IE");
1091 tree = proto_item_add_subtree(ti, ett_295);
1093 XBIT(data, 4, "Extended-2 UIUC");
1094 XBIT(data, 8, "Length");
1096 XBIT(data, 2, "Ctype");
1098 XBIT(data, 6, "Duration");
1100 for (j = 0; j < M; j++) {
1101 data = BIT_BITS(bit, bufptr, 16);
1102 proto_tree_add_text(tree, tvb, BITHI(bit, 16), "CID(%d): %d", j, data);
1104 data = BIT_BITS(bit, bufptr, 4);
1105 proto_tree_add_text(tree, tvb, BITHI(bit, 4), "UIUC(%d): %d", j, data);
1107 data = BIT_BITS(bit, bufptr, 2);
1108 proto_tree_add_text(tree, tvb, BITHI(bit, 2), "Repetition(%d): %d", j, data);
1112 XBIT(data, 4, "Padding");
1114 return BIT_TO_NIB(bit);
1117 gint AAS_UL_IE(proto_tree *uiuc_tree, const guint8 *bufptr, gint offset, gint length, tvbuff_t *tvb)
1119 /* UL-MAP Extended IE = 2 */
1120 /* 8.4.5.4.6 [2] AAS_UL_IE*/
1121 /* offset of TLV in nibbles, length of TLV in nibbles */
1124 proto_item *ti = NULL;
1125 proto_item *tree = NULL;
1127 bit = NIB_TO_BIT(offset);
1129 ti = proto_tree_add_text(uiuc_tree, tvb, NIBHI(offset, length), "AAS_UL_IE");
1130 tree = proto_item_add_subtree(ti, ett_293);
1132 XBIT(data, 4, "Extended UIUC");
1133 XBIT(data, 4, "Length");
1135 XBIT(data, 2, "Permutation");
1136 XBIT(data, 7, "UL_PermBase");
1137 XBIT(data, 8, "OFDMA symbol offset");
1138 XBIT(data, 8, "AAS zone length");
1139 XBIT(data, 2, "Uplink peramble config");
1140 XBIT(data, 1, "Preamble type");
1141 XBIT(data, 4, "Reserved");
1142 return BIT_TO_NIB(bit);
1145 gint CQICH_Alloc_IE(proto_tree *uiuc_tree, const guint8 *bufptr, gint offset, gint length, tvbuff_t *tvb)
1147 /* UL-MAP Extended IE = 3 */
1148 /* 8.4.5.4.12 [2] CQICH_Alloc_IE */
1149 /* offset of TLV in nibbles, length of TLV in nibbles */
1152 proto_item *ti = NULL;
1153 proto_item *tree = NULL;
1154 gint rci, rtype, ftype, zperm, mgi, api, pad;
1156 bit = NIB_TO_BIT(offset);
1158 ti = proto_tree_add_text(uiuc_tree, tvb, NIBHI(offset, length), "UL_ZONE_IE");
1159 tree = proto_item_add_subtree(ti, ett_300);
1161 XBIT(data, 4, "Extended UIUC");
1162 XBIT(data, 4, "Length");
1164 if (cqich_id_size == 0) {
1165 proto_tree_add_text(tree, tvb, BITHI(bit, 1), "CQICH_ID: n/a (size == 0 bits)");
1167 /* variable from 0-9 bits */
1168 data = BIT_BITS16(bit, bufptr, cqich_id_size);
1169 proto_tree_add_text(tree, tvb, BITHI(bit, cqich_id_size), "CQICH_ID: %d (%d bits)", data, cqich_id_size);
1170 bit += cqich_id_size;
1173 XBIT(data, 6, "Allocation offset");
1174 XBIT(data, 2, "Period (p)");
1175 XBIT(data, 3, "Frame offset");
1176 XBIT(data, 3, "Duration (d)");
1177 XBIT(rci, 1, "Report configuration included");
1180 XBIT(ftype, 2, "Feedback Type");
1181 XBIT(rtype, 1, "Report type");
1183 XBIT(data, 1, "CINR preamble report type");
1186 XBIT(zperm, 3, "Zone permutation");
1187 XBIT(data, 2, "Zone type");
1188 XBIT(data, 2, "Zone PRBS_ID");
1189 if (zperm == 0 || zperm == 1) {
1190 XBIT(mgi, 1, "Major group indicatioon");
1192 /* PUSC major group bitmap*/
1193 XBIT(data, 6, "PUSC Major group bitmap");
1196 XBIT(data, 1, "CINR zone measurement type");
1199 XBIT(api, 1, "Averaging parameter included");
1201 XBIT(data, 4, "Averaging parameter");
1205 XBIT(data, 2, "MIMO_permutation_feedback_cycle");
1207 pad = BIT_PADDING(bit,8);
1209 proto_tree_add_text(tree, tvb, BITHI(bit, pad), "Padding: %d bits", pad);
1212 return BIT_TO_NIB(bit); /* Return position in nibbles. */
1215 gint UL_Zone_IE(proto_tree *uiuc_tree, const guint8 *bufptr, gint offset, gint length, tvbuff_t *tvb)
1217 /* UL-MAP Extended IE = 4 */
1218 /* 8.4.5.4.7 [2] UL_Zone_IE */
1219 /* offset of TLV in nibbles, length of TLV in nibbles */
1222 proto_item *ti = NULL;
1223 proto_item *tree = NULL;
1225 bit = NIB_TO_BIT(offset);
1227 ti = proto_tree_add_text(uiuc_tree, tvb, NIBHI(offset, length), "UL_ZONE_IE");
1228 tree = proto_item_add_subtree(ti, ett_294);
1230 XBIT(data, 4, "Extended UIUC");
1231 XBIT(data, 4, "Length");
1233 XBIT(data, 7, "OFDMA symbol offset");
1234 XBIT(data, 2, "Permutation");
1235 XBIT(data, 7, "UL_PermBase");
1236 XBIT(data, 2, "AMC type");
1237 XBIT(data, 1, "Use All SC indicator");
1238 XBIT(data, 1, "Disable subchannel rotation");
1239 XBIT(data, 4, "Reserved");
1240 return BIT_TO_NIB(bit);
1243 gint PHYMOD_UL_IE(proto_tree *uiuc_tree, const guint8 *bufptr, gint offset, gint length, tvbuff_t *tvb)
1245 /* UL-MAP Extended IE = 5 */
1246 /* 8.4.5.4.14 [2] PHYMOD_UL_IE */
1247 /* offset of TLV in nibbles, length of TLV in nibbles */
1250 proto_item *ti = NULL;
1251 proto_item *tree = NULL;
1254 bit = NIB_TO_BIT(offset);
1256 ti = proto_tree_add_text(uiuc_tree, tvb, NIBHI(offset, length), "PHYMOD_UL_IE");
1257 tree = proto_item_add_subtree(ti, ett_302);
1259 XBIT(data, 4, "Extended UIUC");
1260 XBIT(data, 4, "Length");
1262 XBIT(pmt, 1, "Preamble Modifier Type");
1264 XBIT(data, 4, "Preamble frequency shift index");
1266 XBIT(data, 4, "Preamble Time Shift index");
1268 XBIT(data, 1, "Pilot Pattern Modifier");
1269 XBIT(data, 2, "Pilot Pattern Index");
1270 return BIT_TO_NIB(bit);
1273 gint MIMO_UL_IE(proto_tree *uiuc_tree, const guint8 *bufptr, gint offset, gint length, tvbuff_t *tvb)
1275 /* UL-MAP Extended IE = 6 */
1276 /* 8.4.5.4.11 MIMO_UL_Basic_IE (not implemented) */
1277 /* offset of TLV in nibbles, length of TLV in nibbles */
1280 proto_item *ti = NULL;
1281 proto_item *tree = NULL;
1285 ti = proto_tree_add_text(uiuc_tree, tvb, NIBHI(offset, length), "MIMO_UL_Basic_IE");
1286 tree = proto_item_add_subtree(ti, ett_299);
1288 XNIB(data, 1, "Extended UIUC");
1289 XNIB(data, 1, "Length");
1290 proto_tree_add_text(tree, tvb, NIBHI(nib,length-2), "(not implemented)");
1294 gint ULMAP_Fast_Tracking_IE(proto_tree *uiuc_tree, const guint8 *bufptr, gint offset, gint length, tvbuff_t *tvb)
1296 /* UL-MAP Extended IE = 7 */
1297 /* 8.4.5.4.22 [2] ULMAP_Fast_Tracking_IE */
1298 /* offset of TLV in nibbles, length of TLV in nibbles */
1301 proto_item *ti = NULL;
1302 proto_item *tree = NULL;
1304 bit = NIB_TO_BIT(offset);
1306 ti = proto_tree_add_text(uiuc_tree, tvb, NIBHI(offset, length), "Fast_Tracking_IE");
1307 tree = proto_item_add_subtree(ti, ett_302h);
1309 length = NIB_TO_BIT(length);
1311 XBIT(data, 4, "Extended UIUC");
1312 XBIT(data, 4, "Length");
1314 XBIT(data, 2, "Map Index");
1315 XBIT(data, 6, "Reserved");
1316 while (bit < (length-7)) {
1317 XBIT(data, 3, "Power correction");
1318 XBIT(data, 3, "Frequency correction");
1319 XBIT(data, 2, "Time correction");
1321 return BIT_TO_NIB(bit);
1324 gint UL_PUSC_Burst_Allocation_in_other_segment_IE(proto_tree *uiuc_tree, const guint8 *bufptr, gint offset, gint length, tvbuff_t *tvb)
1326 /* UL-MAP Extended IE = 8 */
1327 /* 8.4.5.4.17 [2] UL_PUSC_Burst_Allocation_in_other_segment_IE */
1328 /* offset of TLV in nibbles, length of TLV in nibbles */
1331 proto_item *ti = NULL;
1332 proto_item *tree = NULL;
1334 bit = NIB_TO_BIT(offset);
1336 ti = proto_tree_add_text(uiuc_tree, tvb, NIBHI(offset, length), "UL_PUSC_Burst_Allocation_in_Other_Segment_IE");
1337 tree = proto_item_add_subtree(ti, ett_302c);
1339 XBIT(data, 4, "Extended UIUC");
1340 XBIT(data, 4, "Length");
1342 XBIT(data, 4, "UIUC");
1343 XBIT(data, 2, "Segment");
1344 XBIT(data, 7, "UL_PermBase");
1345 XBIT(data, 8, "OFDMA symbol offset");
1346 XBIT(data, 6, "Subchannel offset");
1347 XBIT(data,10, "Duration");
1348 XBIT(data, 2, "Repetition coding indication");
1349 XBIT(data, 1, "Reserved");
1350 return BIT_TO_NIB(bit);
1353 gint Fast_Ranging_IE(proto_tree *uiuc_tree, const guint8 *bufptr, gint offset, gint length, tvbuff_t *tvb)
1355 /* UL-MAP Extended IE = 9 */
1356 /* 8.4.5.4.21 [2] Fast_Ranging_IE */
1357 /* offset of TLV in nibbles, length of TLV in nibbles */
1360 proto_item *ti = NULL;
1361 proto_item *tree = NULL;
1364 bit = NIB_TO_BIT(offset);
1366 ti = proto_tree_add_text(uiuc_tree, tvb, NIBHI(offset, length), "Fast_Ranging_IE");
1367 tree = proto_item_add_subtree(ti, ett_302g);
1369 XBIT(data, 4, "Extended UIUC");
1370 XBIT(data, 4, "Length");
1372 XBIT(hidi, 1, "HO_ID indicator");
1373 XBIT(data, 7, "Reserved");
1375 XBIT(data, 8, "HO_ID");
1376 /* XBIT(data, 40, "Reserved"); TODO */
1378 /* XBIT(data, 48, "MAC address"); TODO */
1379 proto_tree_add_text(tree, tvb, BITHI(bit, 48), "MAC address");
1382 XBIT(data, 4, "UIUC");
1383 XBIT(data,10, "Duration");
1384 XBIT(data, 2, "Repetition coding indication");
1385 return BIT_TO_NIB(bit);
1388 gint UL_Allocation_Start_IE(proto_tree *uiuc_tree, const guint8 *bufptr, gint offset, gint length, tvbuff_t *tvb)
1390 /* UL-MAP Extended IE = 0xA */
1391 /* 8.4.5.4.15 [2] UL_Allocation_Start_IE */
1392 /* offset of TLV in nibbles, length of TLV in nibbles */
1395 proto_item *ti = NULL;
1396 proto_item *tree = NULL;
1398 bit = NIB_TO_BIT(offset);
1400 ti = proto_tree_add_text(uiuc_tree, tvb, NIBHI(offset, length), "UL_Allocation_start_IE");
1401 tree = proto_item_add_subtree(ti, ett_302a);
1403 XBIT(data, 4, "Extended UIUC");
1404 XBIT(data, 4, "Length");
1406 XBIT(data, 8, "OFDMA symbol offset");
1407 XBIT(data, 7, "Subchannel offset");
1408 XBIT(data, 1, "Reserved");
1409 return BIT_TO_NIB(bit);
1413 /********************************************************************
1414 * UL-MAP Extended-2 IEs
1416 *******************************************************************/
1418 gint CQICH_Enhanced_Allocation_IE(proto_tree *uiuc_tree, const guint8 *bufptr, gint offset, gint length, tvbuff_t *tvb)
1420 /* UL-MAP Extended-2 IE = 0 */
1421 /* 8.4.5.4.16 [2] CQICH_Enhanced_Allocation_IE */
1422 /* offset of TLV in nibbles, length of TLV in nibbles */
1425 proto_item *ti = NULL;
1426 proto_item *tree = NULL;
1430 bit = NIB_TO_BIT(offset);
1432 ti = proto_tree_add_text(uiuc_tree, tvb, NIBHI(offset, length), "CQICH_Enhanced_Alloc_IE");
1433 tree = proto_item_add_subtree(ti, ett_302b);
1435 XBIT(data, 4, "Extended-2 UIUC");
1436 XBIT(data, 8, "Length");
1438 if (cqich_id_size == 0) {
1439 proto_tree_add_text(tree, tvb, BITHI(bit, 1), "CQICH_ID: n/a (size == 0 bits)");
1441 /* variable from 0-9 bits */
1442 data = BIT_BITS16(bit, bufptr, cqich_id_size);
1443 proto_tree_add_text(tree, tvb, BITHI(bit, cqich_id_size), "CQICH_ID: %d (%d bits)", data, cqich_id_size);
1444 bit += cqich_id_size;
1447 XBIT(data, 3, "Period (p)");
1448 XBIT(data, 3, "Frame offset");
1449 XBIT(data, 3, "Duration (d)");
1450 XBIT(cnum, 4, "CQICH_Num");
1452 for (i = 0; i < cnum; i++) {
1453 XBIT(data, 3, "Feedback Type");
1454 XBIT(data, 6, "Allocation Index");
1455 XBIT(data, 3, "CQICH Type");
1456 XBIT(data, 1, "STTD indication");
1458 XBIT(bapm, 1, "Band_AMC_Precoding_Mode");
1460 XBIT(data, 3, "Nr_Precoders_Feedback (=N)");
1463 pad = BIT_PADDING(bit,8);
1465 proto_tree_add_text(tree, tvb, BITHI(bit, pad), "Padding: %d bits", pad);
1468 return BIT_TO_NIB(bit);
1471 gint HO_Anchor_Active_UL_MAP_IE(proto_tree *uiuc_tree, const guint8 *bufptr, gint offset, gint length, tvbuff_t *tvb)
1473 /* UL-MAP Extended-2 IE = 1 */
1474 /* 8.4.5.4.18 [2] HO_Anchor_Active_UL_MAP_IE (not implemented) */
1475 /* offset of TLV in nibbles, length of TLV in nibbles */
1478 proto_item *ti = NULL;
1479 proto_item *tree = NULL;
1483 ti = proto_tree_add_text(uiuc_tree, tvb, NIBHI(offset, length), "HO_Anchor_Active_UL_MAP_IE");
1484 tree = proto_item_add_subtree(ti, ett_302d);
1486 XNIB(data, 1, "Extended-2 UIUC");
1487 XNIB(data, 2, "Length");
1488 proto_tree_add_text(tree, tvb, NIBHI(nib,length-3), "(not implemented)");
1492 gint HO_Active_Anchor_UL_MAP_IE(proto_tree *uiuc_tree, const guint8 *bufptr, gint offset, gint length, tvbuff_t *tvb)
1494 /* UL-MAP Extended-2 IE = 2 */
1495 /* 8.4.5.4.19 [2] HO_Active_Anchor_UL_MAP_IE (not implemented) */
1496 /* offset of TLV in nibbles, length of TLV in nibbles */
1499 proto_item *ti = NULL;
1500 proto_item *tree = NULL;
1504 ti = proto_tree_add_text(uiuc_tree, tvb, NIBHI(offset, length), "HO_Active_Anchor_UL_MAP_IE");
1505 tree = proto_item_add_subtree(ti, ett_302e);
1507 XNIB(data, 1, "Extended-2 UIUC");
1508 XNIB(data, 2, "Length");
1509 proto_tree_add_text(tree, tvb, NIBHI(nib,length-3), "(not implemented)");
1513 gint Anchor_BS_switch_IE(proto_tree *uiuc_tree, const guint8 *bufptr, gint offset, gint length, tvbuff_t *tvb)
1515 /* UL-MAP Extended-2 IE = 3 */
1516 /* 8.4.5.4.23 [2] Anchor_BS_switch_IE */
1517 /* offset of TLV in nibbles, length of TLV in nibbles */
1520 proto_item *ti = NULL;
1521 proto_item *tree = NULL;
1522 gint nbss, acod, cqai, pad;
1525 bit = NIB_TO_BIT(offset);
1527 ti = proto_tree_add_text(uiuc_tree, tvb, NIBHI(offset, length), "Anchor_BS_switch_IE");
1528 tree = proto_item_add_subtree(ti, ett_302i);
1530 XBIT(data, 4, "Extended-2 UIUC");
1531 XBIT(data, 8, "Length");
1533 XBIT(nbss, 4, "N_Anchor_BS_switch");
1534 for (i = 0; i < nbss; i++) {
1535 XBIT(data,12, "Reduced CID");
1536 XBIT(acod, 2, "Action Code");
1538 XBIT(data, 3, "Action Time (A)");
1539 XBIT(data, 3, "TEMP_BS_ID");
1540 XBIT(data, 2, "Reserved");
1542 if (acod == 0 || acod == 1) {
1543 XBIT(data, 1, "AK Change Indicator");
1544 XBIT(cqai, 1, "CQICH Allocation Indicator");
1546 /* variable bits from 0-9 */
1547 if (cqich_id_size == 0) {
1548 proto_tree_add_text(tree, tvb, BITHI(bit, 1), "CQICH_ID: n/a (size == 0 bits)");
1550 data = BIT_BITS16(bit, bufptr, cqich_id_size);
1551 proto_tree_add_text(tree, tvb, BITHI(bit, cqich_id_size),
1552 "CQICH_ID: %d (%d bits)", data, cqich_id_size);
1553 bit += cqich_id_size;
1555 XBIT(data, 6, "Feedback channel offset");
1556 XBIT(data, 2, "Period (=p)");
1557 XBIT(data, 3, "Frame offset");
1558 XBIT(data, 3, "Duration (=d)");
1559 XBIT(data, 2, "MIMO_permutation_feedback_code");
1560 pad = BIT_PADDING(bit,8);
1562 proto_tree_add_text(tree, tvb, BITHI(bit,pad), "Reserved: %d bits", pad);
1566 XBIT(data, 2, "Reserved");
1569 XBIT(data, 4, "Reserved");
1570 return BIT_TO_NIB(bit);
1573 gint UL_sounding_command_IE(proto_tree *uiuc_tree, const guint8 *bufptr, gint offset, gint length, tvbuff_t *tvb)
1575 /* UL-MAP Extended-2 IE = 4 */
1576 /* 8.4.5.4.26 [2] UL_sounding_command_IE */
1577 /* see 8.4.6.2.7.1 */
1578 /* offset of TLV in nibbles, length of TLV in nibbles */
1581 proto_item *ti = NULL;
1582 proto_item *tree = NULL;
1583 gint stype, ssrf, srlf, iafb, pad, sept, nssym, ncid, amod;
1586 bit = NIB_TO_BIT(offset);
1588 ti = proto_tree_add_text(uiuc_tree, tvb, NIBHI(offset, length), "UL_Sounding_Command_IE");
1589 tree = proto_item_add_subtree(ti, ett_315d);
1591 XBIT(data, 4, "Extended-2 UIUC");
1592 XBIT(data, 8, "Length");
1594 XBIT(stype, 1, "Sounding_Type");
1595 XBIT(ssrf, 1, "Send Sounding Report Flag");
1596 XBIT(srlf, 1, "Sounding Relevance Flag");
1598 XBIT(data, 1, "Sounding_Relevance");
1599 XBIT(data, 2, "Reserved");
1601 XBIT(data, 3, "Reserved");
1603 XBIT(iafb, 2, "Include additional feedback");
1605 XBIT(nssym, 3, "Num_Sounding_Symbols");
1606 XBIT(data, 1, "Reserved");
1607 for (i = 0; i < nssym; i++) {
1608 XBIT(sept, 1, "Separability Type");
1610 XBIT(data, 3, "Max Cyclic Shift Index P");
1611 XBIT(data, 1, "Reserved");
1613 XBIT(data, 3, "Decimation Value D");
1614 XBIT(data, 1, "Decimation offset randomization");
1616 XBIT(data, 3, "Sounding symbol index");
1617 XBIT(ncid, 7, "Number of CIDs");
1618 XBIT(data, 1, "Reserved");
1619 for (j = 0; j < ncid; j++) {
1620 XBIT(data,12, "Shorted Basic CID");
1621 XBIT(data, 2, "Power Assignment Method");
1622 XBIT(data, 1, "Power boost");
1623 XBIT(data, 1, "Multi-Antenna Flag");
1624 XBIT(amod, 1, "Allocation Mode");
1626 XBIT(data,12, "Band bit map");
1627 XBIT(data, 2, "Reserved");
1629 XBIT(data, 7, "Starting frequency band");
1630 XBIT(data, 7, "Number of frequency bands");
1633 XBIT(data, 1, "Sounding_Relevance");
1635 XBIT(data, 1, "Reserved");
1638 XBIT(data, 5, "Cyclic time shift index m");
1640 XBIT(data, 6, "Decimation offset d");
1642 XBIT(data, 1, "Use same symbol for additional feedback");
1643 XBIT(data, 2, "Reserved");
1645 XBIT(data, 3, "Reserved");
1648 XBIT(data, 3, "Periodicity");
1652 XBIT(data, 3, "Permutation");
1653 XBIT(data, 6, "DL_PermBase");
1654 XBIT(nssym, 3, "Num_Sounding_symbols");
1655 for (i = 0; i < nssym; i++) {
1656 XBIT(ncid, 7, "Number of CIDs");
1657 XBIT(data, 1, "Reserved");
1658 for (j = 0; j < ncid; j++) {
1659 XBIT(data, 12, "Shortened basic CID");
1661 XBIT(data, 1, "Sounding_Relevance");
1662 XBIT(data, 3, "Reserved");
1664 XBIT(data, 7, "Subchannel offset");
1665 XBIT(data, 1, "Power boost");
1666 XBIT(data, 3, "Number of subchannels");
1667 XBIT(data, 3, "Periodicity");
1668 XBIT(data, 2, "Power assignment method");
1672 pad = BIT_PADDING(bit,8);
1674 proto_tree_add_text(tree, tvb, BITHI(bit,pad), "Padding: %d bits",pad);
1677 return BIT_TO_NIB(bit);
1680 gint MIMO_UL_Enhanced_IE(proto_tree *uiuc_tree, const guint8 *bufptr, gint offset, gint length, tvbuff_t *tvb)
1682 /* UL-MAP Extended-2 IE = 6 */
1683 /* 8.4.5.4.20 [2] MIMO_UL_Enhanced_IE (not implemented) */
1684 /* offset of TLV in nibbles, length of TLV in nibbles */
1687 proto_item *ti = NULL;
1688 proto_item *tree = NULL;
1692 ti = proto_tree_add_text(uiuc_tree, tvb, NIBHI(offset, length), "MIMO_UL_Enhanced_IE");
1693 tree = proto_item_add_subtree(ti, ett_302f);
1695 XNIB(data, 1, "Extended-2 UIUC");
1696 XNIB(data, 2, "Length");
1697 proto_tree_add_text(tree, tvb, NIBHI(nib,length-3), "(not implemented)");
1701 gint HARQ_ULMAP_IE(proto_tree *uiuc_tree, const guint8 *bufptr, gint offset, gint length, tvbuff_t *tvb)
1703 /* UL-MAP Extended-2 IE = 7 */
1704 /* 8.4.5.4.24 HARQ_ULMAP_IE */
1705 /* offset of TLV in nibbles, length of TLV in nibbles */
1708 proto_item *ti = NULL;
1709 proto_item *tree = NULL;
1712 gint pad, mode, alsi, nsub;
1715 bit = NIB_TO_BIT(offset);
1716 bitlength = NIB_TO_BIT(length);
1718 ti = proto_tree_add_text(uiuc_tree, tvb, NIBHI(offset, length), "HARQ_ULMAP_IE");
1719 tree = proto_item_add_subtree(ti, ett_302j);
1721 XBIT(data, 4, "Extended-2 UIUC");
1722 XBIT(data, 8, "Length");
1724 XBIT(RCID_Type, 2, "RCID_Type");
1725 XBIT(data, 2, "Reserved");
1726 lastbit = bit + bitlength -16 - 4;
1727 while (bit < lastbit) {
1728 XBIT(mode, 3, "Mode");
1729 XBIT(alsi, 1, "Allocation Start Indication");
1731 XBIT(data, 8, "OFDMA Symbol offset");
1732 XBIT(data, 7, "Subchannel offset");
1733 XBIT(data, 1, "Reserved");
1735 XBIT(nsub, 4, "N sub Burst");
1736 for (i = 0; i < nsub; i++) {
1738 bit += UL_HARQ_Chase_Sub_Burst_IE(tree, bufptr, bit, bitlength, tvb);
1739 } else if (mode == 1) {
1740 bit += UL_HARQ_IR_CTC_Sub_Burst_IE(tree, bufptr, bit, bitlength, tvb);
1741 } else if (mode == 2) {
1742 bit += UL_HARQ_IR_CC_Sub_Burst_IE(tree, bufptr, bit, bitlength, tvb);
1743 } else if (mode == 3) {
1744 bit += MIMO_UL_Chase_HARQ_Sub_Burst_IE(tree, bufptr, bit, bitlength, tvb);
1745 } else if (mode == 4) {
1746 bit += MIMO_UL_IR_HARQ__Sub_Burst_IE(tree, bufptr, bit, bitlength, tvb);
1747 } else if (mode == 5) {
1748 bit += MIMO_UL_IR_HARQ_for_CC_Sub_Burst_UIE(tree, bufptr, bit, bitlength, tvb);
1749 } else if (mode == 6) {
1750 bit += MIMO_UL_STC_HARQ_Sub_Burst_IE(tree, bufptr, bit, bitlength, tvb);
1755 pad = NIB_TO_BIT(offset) + bitlength - bit;
1757 proto_tree_add_text(tree, tvb, BITHI(bit,pad), "Padding: %d bits",pad);
1760 return BIT_TO_NIB(bit);
1763 gint HARQ_ACKCH_Region_Allocation_IE(proto_tree *uiuc_tree, const guint8 *bufptr, gint offset, gint length, tvbuff_t *tvb)
1765 /* UL-MAP Extended-2 IE = 8 */
1766 /* 8.4.5.4.25 [2] HARQ_ACKCH_Region_Allocation_IE */
1767 /* offset of TLV in nibbles, length of TLV in nibbles */
1770 proto_item *ti = NULL;
1771 proto_item *tree = NULL;
1773 bit = NIB_TO_BIT(offset);
1775 ti = proto_tree_add_text(uiuc_tree, tvb, NIBHI(offset, length), "HARQ_ACKCH_Region_IE");
1776 tree = proto_item_add_subtree(ti, ett_302t);
1778 XBIT(data, 4, "Extended-2 UIUC");
1779 XBIT(data, 8, "Length");
1781 XBIT(data, 8, "OFDMA Symbol Offset");
1782 XBIT(data, 7, "Subchannel Offset");
1783 XBIT(data, 5, "No. OFDMA Symbols");
1784 XBIT(data, 4, "No. Subchannels");
1785 return BIT_TO_NIB(bit);
1788 gint AAS_SDMA_UL_IE(proto_tree *uiuc_tree, const guint8 *bufptr, gint offset, gint length, tvbuff_t *tvb)
1790 /* UL-MAP Extended-2 IE = 0xE */
1791 /* 8.4.5.4.27 [2] AAS_SDMA_UL_IE */
1792 /* offset of TLV in nibbles, length of TLV in nibbles */
1795 proto_item *ti = NULL;
1796 proto_item *tree = NULL;
1797 gint nreg, pad, user, encm, ppmd, padj;
1798 gint aasp = 0; /* TODO AAS UL preamble used */
1801 bit = NIB_TO_BIT(offset);
1803 ti = proto_tree_add_text(uiuc_tree, tvb, NIBHI(offset, length), "AAS_SDMA_UL_IE");
1804 tree = proto_item_add_subtree(ti, ett_302u);
1806 XBIT(data, 4, "Extended-2 UIUC");
1807 XBIT(data, 8, "Length");
1809 XBIT(RCID_Type, 2, "RCID_Type");
1810 XBIT(nreg, 4, "Num Burst Region");
1811 XBIT(data, 2, "Reserved");
1812 for (ii = 0; ii < nreg; ii++) {
1813 XBIT(data,12, "Slot offset");
1814 XBIT(data,10, "Slot duration");
1815 XBIT(user, 3, "Number of users");
1816 XBIT(data, 3, "Reserved");
1817 for (jj = 0; jj < user; jj++) {
1818 bit += RCID_IE(tree, bufptr, bit, length, tvb, RCID_Type);
1819 XBIT(encm, 2, "Encoding Mode");
1820 XBIT(padj, 1, "Power Adjust");
1821 XBIT(ppmd, 1, "Pilot Pattern Modifier");
1823 XBIT(data, 4, "Preamble Modifier Index");
1826 XBIT(data, 2, "Pilot Pattern");
1827 XBIT(data, 2, "Reserved");
1830 XBIT(data, 4, "DIUC");
1831 XBIT(data, 2, "Repetition Coding Indication");
1832 XBIT(data, 2, "Reserved");
1835 XBIT(data, 4, "DIUC");
1836 XBIT(data, 2, "Repetition Coding Indication");
1837 XBIT(data, 4, "ACID");
1838 XBIT(data, 1, "AI_SN");
1839 XBIT(data, 1, "Reserved");
1842 XBIT(data, 4, "N(EP)");
1843 XBIT(data, 4, "N(SCH)");
1844 XBIT(data, 2, "SPID");
1845 XBIT(data, 4, "ACID");
1846 XBIT(data, 1, "AI_SN");
1847 XBIT(data, 1, "Reserved");
1850 XBIT(data, 4, "DIUC");
1851 XBIT(data, 2, "Repetition Coding Indication");
1852 XBIT(data, 2, "SPID");
1853 XBIT(data, 4, "ACID");
1854 XBIT(data, 1, "AI_SN");
1855 XBIT(data, 3, "Reserved");
1858 XBIT(data, 8, "Power Adjustment");
1864 pad = BIT_PADDING(bit,8);
1866 proto_tree_add_text(tree, tvb, BITHI(bit, pad), "Padding: %d bits", pad);
1869 return BIT_TO_NIB(bit);
1872 gint Feedback_Polling_IE(proto_tree *uiuc_tree, const guint8 *bufptr, gint offset, gint length, tvbuff_t *tvb)
1874 /* UL-MAP Extended-2 IE = 0xF */
1875 /* 8.4.5.4.28 [2] Feedback_Polling_IE */
1876 /* offset of TLV in nibbles, length of TLV in nibbles */
1879 proto_item *ti = NULL;
1880 proto_item *tree = NULL;
1881 gint nalloc, dula, pad, adur;
1884 bit = NIB_TO_BIT(offset);
1886 ti = proto_tree_add_text(uiuc_tree, tvb, NIBHI(offset, length), "Feedback_Polling_IE");
1887 tree = proto_item_add_subtree(ti, ett_302v);
1889 XBIT(data, 4, "Extended-2 UIUC");
1890 XBIT(data, 8, "Length");
1892 XBIT(nalloc, 4, "Num_Allocation");
1893 XBIT(dula, 1, "Dedicated UL Allocation included");
1894 XBIT(data, 3, "Reserved");
1895 for (i = 0; i < nalloc; i++) {
1896 XBIT(data,16, "Basic CID");
1897 XBIT(adur, 3, "Allocation Duration (d)");
1899 XBIT(data, 4, "Feedback type");
1900 XBIT(data, 3, "Frame Offset");
1901 XBIT(data, 2, "Period (p)");
1903 XBIT(data, 4, "UIUC");
1904 XBIT(data, 8, "OFDMA Symbol Offset");
1905 XBIT(data, 7, "Subchannel offset");
1906 XBIT(data, 3, "Duration");
1907 XBIT(data, 2, "Repetition coding indication");
1911 pad = BIT_PADDING(bit,8);
1913 proto_tree_add_text(tree, tvb, BITHI(bit, pad), "Padding: %d bits", pad);
1916 return BIT_TO_NIB(bit);
1920 /********************************************************************
1922 *******************************************************************/
1925 void lshift_bits(guint8 *buffer, gint bytes, gint bits)
1927 /* left shift a buffer by specified number of bits */
1928 /* used for ULMAP ExtIE CQICH alloc IE */
1933 for (i=1; i<bytes; i++)
1934 buffer[i-1] = buffer[i];
1941 for (i = 0; i < (bytes-1); i++) {
1943 buffer[i] |= (buffer[i+1] >> xbits);
1945 buffer[bytes-1] <<= bits;
1950 /* Register Wimax Mac Payload Protocol and Dissector */
1951 void proto_register_mac_mgmt_msg_ulmap(void)
1953 if (proto_mac_mgmt_msg_ulmap_decoder == -1)
1955 proto_mac_mgmt_msg_ulmap_decoder = proto_mac_mgmt_msg_dlmap_decoder;
1957 proto_register_field_array(proto_mac_mgmt_msg_ulmap_decoder, hf, array_length(hf));
1958 proto_register_subtree_array(ett, array_length(ett));
1963 gint dissect_ulmap_ie( proto_tree *ie_tree, const guint8 *bufptr, gint offset, gint length, tvbuff_t *tvb)
1965 /* decode a single UL-MAP IE and return the
1966 * length of the IE in nibbles
1967 * offset = start of IE (nibbles)
1968 * length = total length of bufptr (nibbles) */
1969 proto_item *ti = NULL;
1970 proto_tree *tree = NULL;
1972 gint uiuc, ext_uiuc, ext2_uiuc, len, aas_or_amc;
1979 UNREFERENCED_PARAMETER(length);
1981 /* 8.4.5.4 UL-MAP IE format - table 287 */
1982 cid = NIB_WORD(nibble, bufptr);
1983 uiuc = NIB_NIBBLE(nibble + 4, bufptr);
1987 /* 8.4.5.4.9 FAST-FEEDBACK channel */
1988 ti = proto_tree_add_text(ie_tree, tvb, NIBHI(nibble, 5+8), "FAST FEEDBACK Allocation IE");
1989 tree = proto_item_add_subtree(ti, ett_ulmap_ffb);
1991 proto_tree_add_uint(tree, hf_ulmap_ie_cid, tvb, NIBHI(nibble, 4), cid);
1993 proto_tree_add_uint(tree, hf_ulmap_ie_uiuc, tvb, NIBHI(nibble, 1), uiuc);
1996 data = NIB_LONG(nibble, bufptr);
1997 proto_tree_add_uint(tree, hf_ulmap_uiuc0_symofs, tvb, NIBHI(nibble, 8), data);
1998 proto_tree_add_uint(tree, hf_ulmap_uiuc0_subofs, tvb, NIBHI(nibble, 8), data);
1999 proto_tree_add_uint(tree, hf_ulmap_uiuc0_numsym, tvb, NIBHI(nibble, 8), data);
2000 proto_tree_add_uint(tree, hf_ulmap_uiuc0_numsub, tvb, NIBHI(nibble, 8), data);
2001 proto_tree_add_uint(tree, hf_ulmap_uiuc0_rsv, tvb, NIBHI(nibble, 8), data);
2004 else if (uiuc == 11)
2006 /* 8.4.5.4.4.2 [2] extended-2 UIUC IE table 290b */
2007 ext2_uiuc = NIB_NIBBLE(5+nibble, bufptr);
2008 len = NIB_BYTE(5+nibble+1, bufptr);
2010 ti = proto_tree_add_text(ie_tree, tvb, NIBHI(nibble, 5+3+len*2), "UIUC: %d (Extended-2 IE)", uiuc);
2011 tree = proto_item_add_subtree(ti, ett_290b);
2013 proto_tree_add_uint(tree, hf_ulmap_ie_cid, tvb, NIBHI(nibble, 4), cid);
2015 proto_tree_add_uint(tree, hf_ulmap_ie_uiuc, tvb, NIBHI(nibble, 1), uiuc);
2019 proto_tree_add_uint(tree, hf_ulmap_uiuc11_ext, tvb, NIBHI(nibble, 1), ext2_uiuc);
2021 proto_tree_add_uint(tree, hf_ulmap_uiuc11_len, tvb, NIBHI(nibble, 2), len);
2025 len = 4 + BYTE_TO_NIB(len); /* length in nibbles */
2027 /* data table 290c 8.4.5.4.4.2 */
2028 switch (ext2_uiuc) {
2030 /* 8.4.5.4.16 CQICH_Enhanced_Allocation_IE */
2031 nibble = CQICH_Enhanced_Allocation_IE(tree, bufptr, nibble, len, tvb);
2034 /* 8.4.5.4.18 HO_Anchor_Active_UL_MAP_IE */
2035 nibble = HO_Anchor_Active_UL_MAP_IE(tree, bufptr, nibble, len, tvb);
2038 /* 8.4.5.4.19 HO_Active_Anchor_UL_MAP_IE */
2039 nibble = HO_Active_Anchor_UL_MAP_IE(tree, bufptr, nibble, len, tvb);
2042 /* 8.4.5.4.23 Anchor_BS_switch_IE */
2043 nibble = Anchor_BS_switch_IE(tree, bufptr, nibble, len, tvb);
2046 /* 8.4.5.4.26 UL_sounding_command_IE */
2047 nibble = UL_sounding_command_IE(tree, bufptr, nibble, len, tvb);
2050 /* 8.4.5.4.20 MIMO_UL_Enhanced_IE */
2051 nibble = MIMO_UL_Enhanced_IE(tree, bufptr, nibble, len, tvb);
2054 /* 8.4.5.4.24 HARQ_ULMAP_IE */
2055 nibble = HARQ_ULMAP_IE(tree, bufptr, nibble, len, tvb);
2058 /* 8.4.5.4.25 HARQ_ACKCH_Region_Allocation_IE */
2059 nibble = HARQ_ACKCH_Region_Allocation_IE(tree, bufptr, nibble, len, tvb);
2062 /* 8.4.5.4.27 AAS_SDMA_UL_IE */
2063 nibble = AAS_SDMA_UL_IE(tree, bufptr, nibble, len, tvb);
2066 /* 8.4.5.4.28 Feedback_Polling_IE */
2067 nibble = Feedback_Polling_IE(tree, bufptr, nibble, len, tvb);
2071 proto_tree_add_text(tree, tvb, NIBHI(nibble, len), "(reserved Extended-2 UIUC: %d)", ext2_uiuc);
2077 else if (uiuc == 12)
2079 /* 8.4.5.4 [2] CDMA bandwidth request, CDMA ranging */
2080 ti = proto_tree_add_text(ie_tree, tvb, NIBHI(nibble, 5+8), "CDMA Bandwidth/Ranging Request IE");
2081 tree = proto_item_add_subtree(ti, ett_287_1);
2083 proto_tree_add_uint(tree, hf_ulmap_ie_cid, tvb, NIBHI(nibble, 4), cid);
2085 proto_tree_add_uint(tree, hf_ulmap_ie_uiuc, tvb, NIBHI(nibble, 1), uiuc);
2088 data32 = NIB_LONG(nibble, bufptr);
2089 proto_tree_add_uint(tree, hf_ulmap_uiuc12_symofs, tvb, NIBHI(nibble,8), data32);
2090 proto_tree_add_uint(tree, hf_ulmap_uiuc12_subofs, tvb, NIBHI(nibble,8), data32);
2091 proto_tree_add_uint(tree, hf_ulmap_uiuc12_numsym, tvb, NIBHI(nibble,8), data32);
2092 proto_tree_add_uint(tree, hf_ulmap_uiuc12_numsub, tvb, NIBHI(nibble,8), data32);
2093 proto_tree_add_uint(tree, hf_ulmap_uiuc12_method, tvb, NIBHI(nibble,8), data32);
2094 proto_tree_add_uint(tree, hf_ulmap_uiuc12_dri, tvb, NIBHI(nibble,8), data32);
2097 else if (uiuc == 13)
2099 /* 8.4.5.4.2 [2] PAPR reduction allocation, safety zone - table 289 */
2100 ti = proto_tree_add_text(ie_tree, tvb, NIBHI(nibble,5+8), "PAPR/Safety/Sounding Zone IE");
2101 tree = proto_item_add_subtree(ti, ett_289);
2104 proto_tree_add_uint(tree, hf_ulmap_ie_cid, tvb, NIBHI(nibble, 4), cid);
2106 proto_tree_add_uint(tree, hf_ulmap_ie_uiuc, tvb, NIBHI(nibble, 1), uiuc);
2109 data = NIB_LONG(nibble, bufptr);
2110 proto_tree_add_uint(tree, hf_ulmap_uiuc13_symofs, tvb, NIBHI(nibble,8), data);
2111 proto_tree_add_uint(tree, hf_ulmap_uiuc13_subofs, tvb, NIBHI(nibble,8), data);
2112 proto_tree_add_uint(tree, hf_ulmap_uiuc13_numsym, tvb, NIBHI(nibble,8), data);
2113 proto_tree_add_uint(tree, hf_ulmap_uiuc13_numsub, tvb, NIBHI(nibble,8), data);
2114 proto_tree_add_uint(tree, hf_ulmap_uiuc13_papr, tvb, NIBHI(nibble,8), data);
2115 proto_tree_add_uint(tree, hf_ulmap_uiuc13_zone, tvb, NIBHI(nibble,8), data);
2116 proto_tree_add_uint(tree, hf_ulmap_uiuc13_rsv, tvb, NIBHI(nibble,8), data);
2119 else if (uiuc == 14)
2121 /* 8.4.5.4.3 [2] CDMA allocation IE */
2122 ti = proto_tree_add_text(ie_tree, tvb, NIBHI(nibble,5+10), "CDMA allocation IE");
2123 tree = proto_item_add_subtree(ti, ett_290);
2125 proto_tree_add_uint(tree, hf_ulmap_ie_cid, tvb, NIBHI(nibble, 4), cid);
2127 proto_tree_add_uint(tree, hf_ulmap_ie_uiuc, tvb, NIBHI(nibble, 1), uiuc);
2130 data = NIB_WORD(nibble, bufptr);
2131 proto_tree_add_uint(tree, hf_ulmap_uiuc14_dur, tvb, NIBHI(nibble,2), data);
2132 proto_tree_add_uint(tree, hf_ulmap_uiuc14_uiuc, tvb, NIBHI(nibble+1,2), data);
2133 proto_tree_add_uint(tree, hf_ulmap_uiuc14_rep, tvb, NIBHI(nibble+2,1), data);
2134 proto_tree_add_uint(tree, hf_ulmap_uiuc14_idx, tvb, NIBHI(nibble+3,1), data);
2137 data = NIB_BYTE(nibble, bufptr);
2138 proto_tree_add_uint(tree, hf_ulmap_uiuc14_code, tvb, NIBHI(nibble,2), data);
2139 proto_item_append_text(ti, " (0x%02x)", data);
2142 data = NIB_BYTE(nibble, bufptr);
2143 proto_tree_add_uint(tree, hf_ulmap_uiuc14_sym, tvb, NIBHI(nibble,2), data);
2144 proto_item_append_text(ti, " (0x%02x)", data);
2147 data = NIB_BYTE(nibble, bufptr);
2148 proto_tree_add_uint(tree, hf_ulmap_uiuc14_sub, tvb, NIBHI(nibble,2), data);
2149 proto_item_append_text(ti, " (0x%02x)", data >> 1);
2150 proto_tree_add_uint(tree, hf_ulmap_uiuc14_bwr, tvb, NIBHI(nibble+1,1), data);
2153 else if (uiuc == 15)
2155 /* 8.4.5.4.4 [1] Extended UIUC dependent IE table 291 */
2156 ext_uiuc = NIB_NIBBLE(5+nibble, bufptr);
2157 len = NIB_NIBBLE(5+nibble+1, bufptr);
2159 ti = proto_tree_add_text(ie_tree, tvb, NIBHI(nibble, 5+2+len*2), "UIUC: %d (Extended IE)", uiuc);
2160 tree = proto_item_add_subtree(ti, ett_291);
2162 proto_tree_add_uint(tree, hf_ulmap_ie_cid, tvb, NIBHI(nibble,4), cid);
2164 proto_tree_add_uint(tree, hf_ulmap_ie_uiuc, tvb, NIBHI(nibble,1), uiuc);
2168 ti = proto_tree_add_uint(tree, hf_ulmap_uiuc11_ext, tvb, NIBHI(nibble,1), ext_uiuc);
2170 proto_tree_add_uint(tree, hf_ulmap_uiuc11_len, tvb, NIBHI(nibble,1), len);
2174 len = 2 + BYTE_TO_NIB(len); /* length in nibbles */
2176 /* data table 290a 8.4.5.4.4.1 */
2179 /* 8.4.5.4.5 Power_Control_IE */
2180 nibble = Power_Control_IE(tree, bufptr, nibble, len, tvb);
2183 /* 8.4.5.4.8 Mini-Subchannel_allocation_IE*/
2184 nibble = Mini_Subchannel_allocation_IE(tree, bufptr, nibble, len, tvb);
2187 /* 8.4.5.4.6 AAS_UL_IE*/
2188 nibble = AAS_UL_IE(tree, bufptr, nibble, len, tvb);
2191 /* 8.4.5.4.12 CQICH_Alloc_IE */
2192 nibble = CQICH_Alloc_IE(tree, bufptr, nibble, len, tvb);
2195 /* 8.4.5.4.7 UL_Zone_IE */
2196 nibble = UL_Zone_IE(tree, bufptr, nibble, len, tvb);
2199 /* 8.4.5.4.14 PHYMOD_UL_IE */
2200 nibble = PHYMOD_UL_IE(tree, bufptr, nibble, len, tvb);
2203 /* 8.4.5.4.11 MIMO_UL_IE */
2204 nibble = MIMO_UL_IE(tree, bufptr, nibble, len, tvb);
2207 /* 8.4.5.4.22 ULMAP_Fast_Tracking_IE */
2208 nibble = ULMAP_Fast_Tracking_IE(tree, bufptr, nibble, len, tvb);
2211 /* 8.4.5.4.17 UL_PUSC_Burst_Allocation_in_other_segment_IE */
2212 nibble = UL_PUSC_Burst_Allocation_in_other_segment_IE(tree, bufptr, nibble, len, tvb);
2215 /* 8.4.5.4.21 Fast_Ranging_IE */
2216 nibble = Fast_Ranging_IE(tree, bufptr, nibble, len, tvb);
2219 /* 8.4.5.4.15 UL_Allocation_Start_IE */
2220 nibble = UL_Allocation_Start_IE(tree, bufptr, nibble, len, tvb);
2223 proto_tree_add_text(tree, tvb, NIBHI(nibble,len), "(reserved Extended UIUC: %d)", ext_uiuc);
2230 /* 8.4.5.4 [2] regular IE 1-10, data grant burst type */
2231 aas_or_amc = 0; /* TODO */
2234 if (aas_or_amc) len += 3;
2236 ti = proto_tree_add_text(ie_tree, tvb, NIBHI(nibble, 5+len), "Data Grant Burst Profile");
2237 tree = proto_item_add_subtree(ti, ett_287_2);
2239 proto_tree_add_uint(tree, hf_ulmap_ie_cid, tvb, NIBHI(nibble, 4), cid);
2241 proto_tree_add_uint(tree, hf_ulmap_ie_uiuc, tvb, NIBHI(nibble, 1), uiuc);
2244 data = NIB_WORD(nibble, bufptr);
2245 proto_tree_add_uint(tree, hf_ulmap_uiuc10_dur, tvb, NIBHI(nibble,3), data);
2246 proto_tree_add_uint(tree, hf_ulmap_uiuc10_rep, tvb, NIBHI(nibble+2,1), data);
2250 data = NIB_BITS12(nibble, bufptr);
2251 proto_tree_add_text(tree, tvb, NIBHI(nibble,3), "Slot offset: %d", data);
2256 /* length in nibbles */
2257 return (nibble - offset);
2260 void dissect_mac_mgmt_msg_ulmap_decoder(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
2262 /* 6.3.2.3.4 [2] UL-MAP table 18 */
2266 proto_item *ti = NULL;
2267 proto_tree *ulmap_tree = NULL;
2268 proto_tree *ie_tree = NULL;
2270 const guint8 *bufptr;
2272 tvb_len = tvb_reported_length(tvb);
2273 /* XXX This should be removed, and regular tvb accessors should be used instead. */
2274 bufptr = tvb_get_ptr(tvb, offset, tvb_len);
2276 UNREFERENCED_PARAMETER(pinfo);
2278 /* display MAC UL-MAP */
2279 ti = proto_tree_add_protocol_format(tree, proto_mac_mgmt_msg_ulmap_decoder, tvb, offset, tvb_len, "UL-MAP (%u bytes)", tvb_len);
2280 ulmap_tree = proto_item_add_subtree(ti, ett_ulmap);
2282 /* Decode and display the UL-MAP */
2283 proto_tree_add_item(ulmap_tree, hf_ulmap_message_type, tvb, offset, 1, FALSE);
2286 proto_tree_add_item(ulmap_tree, hf_ulmap_reserved, tvb, offset, 1, FALSE);
2288 proto_tree_add_item(ulmap_tree, hf_ulmap_ucd_count, tvb, offset, 1, FALSE);
2290 proto_tree_add_item(ulmap_tree, hf_ulmap_alloc_start_time, tvb, offset, 4, FALSE);
2292 proto_tree_add_item(ulmap_tree, hf_ulmap_ofdma_sym, tvb, offset, 1, FALSE);
2296 length = tvb_len - offset; /* remaining length in bytes */
2297 ti = proto_tree_add_text(ulmap_tree, tvb, offset, length, "UL-MAP IEs (%u bytes)", length);
2298 ie_tree = proto_item_add_subtree(ti, ett_ulmap_ie);
2300 length = BYTE_TO_NIB(length); /* convert length to nibbles */
2301 nib = BYTE_TO_NIB(offset);
2302 while (nib < ((tvb_len*2)-1)) {
2303 nib += dissect_ulmap_ie(ie_tree, bufptr, nib, tvb_len*2, tvb);
2305 pad = NIB_PADDING(nib);
2307 proto_tree_add_text(ulmap_tree, tvb, NIBHI(nib,1), "Padding nibble");
2312 /*gint wimax_decode_ulmapc(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)*/
2313 gint wimax_decode_ulmapc(proto_tree *base_tree, const guint8 *bufptr, gint offset, gint length, tvbuff_t *tvb)
2315 /* 8.4.5.6.2 [2] Compressed UL-MAP */
2316 /* returns length in nibbles */
2319 proto_item *ti = NULL;
2320 proto_tree *tree = NULL;
2321 proto_tree *ie_tree = NULL;
2325 /* display MAC UL-MAP */
2326 ti = proto_tree_add_protocol_format(base_tree, proto_mac_mgmt_msg_ulmap_decoder, tvb, NIBHI(offset,length), "Compressed UL-MAP");
2327 tree = proto_item_add_subtree(ti, ett_306);
2329 /* Decode and display the UL-MAP */
2330 data = NIB_BYTE(nib, bufptr);
2331 proto_tree_add_uint(tree, hf_ulmap_ucd_count, tvb, NIBHI(nib,2), data);
2333 data = NIB_LONG(nib, bufptr);
2334 proto_tree_add_uint(tree, hf_ulmap_alloc_start_time, tvb, NIBHI(nib,8), data);
2336 data = NIB_BYTE(nib, bufptr);
2337 proto_tree_add_uint(tree, hf_ulmap_ofdma_sym, tvb, NIBHI(nib,2), data); /* added 2005 */
2340 ti = proto_tree_add_text(tree, tvb, NIBHI(nib,length-nib), "UL-MAP IEs");
2341 ie_tree = proto_item_add_subtree(ti, ett_306_ul);
2342 while (nib < length-1) {
2343 nib += dissect_ulmap_ie(ie_tree, bufptr, nib, length-nib, tvb);
2348 proto_tree_add_text(tree, tvb, NIBHI(nib,1), "Padding Nibble");
2357 gint wimax_decode_ulmap_reduced_aas(proto_tree *base_tree, const guint8 *bufptr, gint offset, gint length, tvbuff_t *tvb)
2359 /* 8.4.5.8.2 Reduced AAS private UL-MAP */
2360 /* offset and length are in bits since this is called from within
2361 * the Reduced AAS private DL-MAP
2362 * return length in bits */
2365 proto_item *ti = NULL;
2366 proto_tree *tree = NULL;
2367 gint azci, azpi, umii, phmi, powi, fbck;
2371 ti = proto_tree_add_text(base_tree, tvb, BITHI(bit,length), "Reduced_AAS_Private_UL_MAP");
2372 tree = proto_item_add_subtree(ti, ett_308b);
2374 /* Decode and display the Reduced AAS private UL-MAP */
2375 XBIT(azci, 1, "AAS zone configuration included");
2376 XBIT(azpi, 1, "AAS zone position included");
2377 XBIT(umii, 1, "UL-MAP information included");
2378 XBIT(phmi, 1, "PHY modification included");
2379 XBIT(powi, 1, "Power Control included");
2380 XBIT(fbck, 2, "Include Feedback Header");
2381 XBIT(data, 2, "Encoding Mode");
2384 XBIT(data, 2, "Permutation");
2385 XBIT(data, 7, "UL_PermBase");
2386 XBIT(data, 2, "Preamble Indication");
2387 XBIT(data, 5, "Padding");
2390 XBIT(data, 8, "Zone Symbol Offset");
2391 XBIT(data, 8, "Zone Length");
2394 XBIT(data, 8, "UCD Count");
2395 data = BIT_BITS64(bit,bufptr,32);
2396 proto_tree_add_text(tree, tvb, BITHI(bit,32), "Private Map Allocation Start Time: %u",data);
2400 XBIT(data, 1, "Preamble Select");
2401 XBIT(data, 4, "Preamble Shift Index");
2402 XBIT(data, 1, "Pilot Pattern Modifier");
2403 data = BIT_BITS32(bit,bufptr,22);
2404 proto_tree_add_text(tree, tvb, BITHI(bit,22), "Pilot Pattern Index: %u",data);
2408 XBIT(data, 8, "Power Control");
2410 XBIT(data, 3, "UL Frame Offset");
2411 XBIT(data,12, "Slot Offset");
2412 XBIT(data,10, "Slot Duration");
2413 XBIT(data, 4, "UIUC / N(EP)");
2415 XBIT(data, 4, "ACID");
2416 XBIT(data, 1, "AI_SN");
2417 XBIT(data, 3, "Reserved");
2419 XBIT(data, 4, "N(SCH)");
2420 XBIT(data, 2, "SPID");
2421 XBIT(data, 2, "Reserved");
2424 XBIT(data, 2, "Repetition Coding Indication");
2426 return (bit - offset); /* length in bits */