2 * WiMax MAC Management DL-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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
34 #include <epan/packet.h>
36 #include "wimax_bits.h"
38 extern gint proto_wimax;
39 extern gboolean include_cor2_changes;
41 #define MAC_MGMT_MSG_DLMAP 2
43 #define XBIT(var, bits, desc) \
45 var = BIT_BITS(bit, bufptr, bits); \
46 proto_tree_add_text(tree, tvb, BITHI(bit, bits), desc ": %d", var); \
50 #define VBIT(var, bits, hf) \
52 var = BIT_BITS(bit, bufptr, bits); \
53 proto_tree_add_uint(tree, hf, tvb, BITHI(bit,bits), var); \
57 #define XNIB(var, nibs, desc) \
59 var = NIB_NIBS(nib, bufptr, nibs); \
60 proto_tree_add_text(tree, tvb, NIBHI(nib, nibs), desc ": %d", var); \
64 gint harq = 0; /* 1 if HARQ enabled (TODO) */
65 gint fusc = 0; /* 1 if current zone permutation is FUSC or optional FUSC (TODO) */
66 gint tusc = 0; /* 1 if current zone permutation is AMC, TUSC1 or TUSC2 (TODO) */
67 gint ir_type = 0; /* reduced AAS map (TODO) */
70 gint STC_Zone_Dedicated_Pilots = 0;
71 gint STC_Zone_Matrix = 0;
73 gint sub_dl_ul_map = 0;
76 extern gint man_ofdma;
78 gint proto_mac_mgmt_msg_dlmap_decoder = -1;
80 static gint ett_dlmap = -1;
81 static gint ett_dlmap_ie = -1;
82 /* static gint ett_dlmap_c_ie = -1; */
83 static gint ett_109x = -1; /* SUB-DL-UL-MAP */
84 static gint ett_109x_dl = -1;
85 static gint ett_109x_ul = -1;
86 static gint ett_275_phy = -1;
87 static gint ett_275_1 = -1;
88 static gint ett_277 = -1;
89 static gint ett_277b = -1;
90 static gint ett_278 = -1;
91 static gint ett_279 = -1;
92 static gint ett_280 = -1;
93 static gint ett_281 = -1;
94 static gint ett_282 = -1;
95 static gint ett_283 = -1;
96 static gint ett_284 = -1;
97 static gint ett_285 = -1;
98 static gint ett_286 = -1;
99 static gint ett_286a = -1;
100 static gint ett_286b = -1;
101 static gint ett_286c = -1;
102 static gint ett_286d = -1;
103 static gint ett_286e = -1;
104 static gint ett_286f = -1;
105 static gint ett_286g = -1;
106 static gint ett_286h = -1;
107 static gint ett_286i = -1;
108 static gint ett_286j = -1;
109 static gint ett_286k = -1;
110 static gint ett_286l = -1;
111 static gint ett_286m = -1;
112 static gint ett_286n = -1;
113 static gint ett_286o = -1;
114 static gint ett_286p = -1;
115 static gint ett_286q = -1;
116 static gint ett_286r = -1;
117 static gint ett_286s = -1;
118 static gint ett_286t = -1;
119 static gint ett_286u = -1;
120 static gint ett_286v = -1;
121 static gint ett_286w = -1;
122 static gint ett_286x = -1;
123 static gint ett_286y = -1;
124 static gint ett_286z = -1;
125 static gint ett_305 = -1;
126 /* static gint ett_305_dl = -1; */
127 static gint ett_308a = -1;
129 #define DCD_DOWNLINK_BURST_PROFILE 1
130 #define DCD_BS_EIRP 2
131 #define DCD_FRAME_DURATION 3
132 #define DCD_PHY_TYPE 4
133 #define DCD_POWER_ADJUSTMENT 5
134 #define DCD_CHANNEL_NR 6
138 #define DCD_CHANNEL_SWITCH_FRAME_NR 10
139 #define DCD_FREQUENCY 12
141 #define DCD_FRAME_DURATION_CODE 14
142 #define DCD_FRAME_NR 15
143 #define DCD_SIZE_CQICH_ID 16
144 #define DCD_H_ARQ_ACK_DELAY 17
145 #define DCD_MAC_VERSION 148
146 #define DCD_RESTART_COUNT 154
148 #define DCD_BURST_FREQUENCY 1
149 #define DCD_BURST_FEC_CODE_TYPE 150
150 #define DCD_BURST_DIUC_EXIT_THRESHOLD 151
151 #define DCD_BURST_DIUC_ENTRY_THRESHOLD 152
152 #define DCD_BURST_TCS_ENABLE 153
154 #define DCD_TLV_T_541_TYPE_FUNCTION_ACTION 1
155 #define DCD_TLV_T542_TRIGGER_VALUE 2
156 #define DCD_TLV_T_543_TRIGGER_AVERAGING_DURATION 3
157 #define DCD_TLV_T_19_PERMUTATION_TYPE_FOR_BROADCAST_REGION_IN_HARQ_ZONE 19
158 #define DCD_TLV_T_20_MAXIMUM_RETRANSMISSION 20
159 #define DCD_TLV_T_21_DEFAULT_RSSI_AND_CINR_AVERAGING_PARAMETER 21
160 #define DCD_TLV_T_22_DL_AMC_ALLOCATED_PHYSICAL_BANDS_BITMAP 22
161 #define DCD_TLV_T_31_H_ADD_THRESHOLD 31
162 #define DCD_TLV_T_32_H_DELETE_THRESHOLD 32
163 #define DCD_TLV_T_33_ASR 33
164 #define DCD_TLV_T_34_DL_REGION_DEFINITION 34
165 #define DCD_TLV_T_35_PAGING_GROUP_ID 35
166 #define DCD_TLV_T_36_TUSC1_PERMUTATION_ACTIVE_SUBCHANNELS_BITMAP 36
167 #define DCD_TLV_T_37_TUSC2_PERMUTATION_ACTIVE_SUBCHANNELS_BITMAP 37
168 #define DCD_TLV_T_45_PAGING_INTERVAL_LENGTH 45
169 #define DCD_TLV_T_50_HO_TYPE_SUPPORT 50
170 #define DCD_TLV_T_51_HYSTERSIS_MARGIN 51
171 #define DCD_TLV_T_52_TIME_TO_TRIGGER_DURATION 52
172 #define DCD_TLV_T_54_TRIGGER 54
173 #define DCD_TLV_T_153_DOWNLINK_BURST_PROFILE_FOR_MULTIPLE_FEC_TYPES 153
175 #define DL_MAP_NCT_PMP 0
176 #define DL_MAP_NCT_DM 1
177 #define DL_MAP_NCT_PTP 2
180 static const value_string nct_msgs[] =
182 { DL_MAP_NCT_PMP, "PMP" },
183 { DL_MAP_NCT_PMP, "DM" },
184 { DL_MAP_NCT_PMP, "PTP" },
188 /* Repetition Coding Indications */
189 static const value_string rep_msgs[] =
191 { 0, "No Repetition Coding" },
192 { 1, "Repetition Coding of 2 Used" },
193 { 2, "Repetition Coding of 4 Used" },
194 { 3, "Repetition Coding of 6 Used" },
198 /* DL Frame Prefix Coding Indications */
199 static const value_string boost_msgs[] =
201 { 0, "Normal (not boosted)" },
212 /* OFDMA frame duration ms (Table 320)*/
213 static const value_string frame_duration[] =
227 /* OFDMA frames per second (Table 320)*/
228 static const value_string frames_per_second[] =
243 static gint hf_dlmap_message_type = -1;
245 static gint hf_dlmap_phy_fdur = -1;
246 static gint hf_dlmap_phy_fdur_ms = -1;
247 static gint hf_dlmap_phy_fdur_per_sec = -1;
248 static gint hf_dlmap_phy_fnum = -1;
249 static gint hf_dlmap_fch_expected = -1;
250 static gint hf_dlmap_dcd = -1;
251 static gint hf_dlmap_bsid = -1;
252 static gint hf_dlmap_ofdma_sym = -1;
253 static gint hf_dlmap_ie = -1;
254 static gint hf_dlmap_ie_diuc = -1;
255 static gint hf_dlmap_ie_ncid = -1;
256 static gint hf_dlmap_ie_cid = -1;
257 static gint hf_dlmap_ie_offsym = -1;
258 static gint hf_dlmap_ie_offsub = -1;
259 static gint hf_dlmap_ie_boosting = -1;
260 static gint hf_dlmap_ie_numsym = -1;
261 static gint hf_dlmap_ie_numsub = -1;
262 static gint hf_dlmap_ie_rep = -1;
263 static gint hf_dlmap_ie_offsym2 = -1;
264 static gint hf_dlmap_ie_offsub2 = -1;
265 static gint hf_dlmap_ie_boosting2 = -1;
266 static gint hf_dlmap_ie_numsym2 = -1;
267 static gint hf_dlmap_ie_numsub2 = -1;
268 static gint hf_dlmap_ie_rep2 = -1;
270 static gint hf_dlmap_xie_diuc = -1;
271 static gint hf_dlmap_xie_len = -1;
273 static gint hf_dlmapc_compr = -1;
274 static gint hf_dlmapc_ulmap = -1;
275 static gint hf_dlmapc_rsv = -1;
276 static gint hf_dlmapc_len = -1;
277 static gint hf_dlmapc_sync = -1;
278 static gint hf_dlmapc_opid = -1;
279 static gint hf_dlmapc_secid = -1;
280 static gint hf_dlmapc_count = -1;
282 static gint hf_109x_cmi = -1;
283 static gint hf_109x_len = -1;
284 static gint hf_109x_rcid = -1;
285 static gint hf_109x_haoi = -1;
286 static gint hf_109x_dl = -1;
287 static gint hf_109x_ul = -1;
288 static gint hf_109x_dlie = -1;
289 static gint hf_109x_symofs = -1;
290 static gint hf_109x_subofs = -1;
291 static gint hf_109x_rsv = -1;
293 static gint hf_308a_cmi = -1;
294 static gint hf_308a_ulmap = -1;
295 static gint hf_308a_type = -1;
296 static gint hf_308a_mult = -1;
297 static gint hf_308a_rsv = -1;
298 static gint hf_mac_header_compress_dlmap_crc = -1;
300 /********************************************************************
301 * DL-MAP Miscellaneous IEs and TLVs
302 *******************************************************************/
304 gint RCID_IE(proto_tree *diuc_tree, const guint8 *bufptr, gint offset, gint length, tvbuff_t *tvb, gint RCID_Type_lcl)
306 /* RCID_IE 8.4.5.3 and 8.4.5.3.20.1 */
307 /* offset of IE in bits, length is variable */
309 proto_item *ti = NULL;
310 proto_tree *tree = NULL;
314 if (RCID_Type_lcl == 0)
317 Prefix = BIT_BIT(bit, bufptr);
318 if (Prefix == 1) length = 12;
319 else if (RCID_Type_lcl == 1) length = 12;
320 else if (RCID_Type_lcl == 2) length = 8;
321 else if (RCID_Type_lcl == 3) length = 4;
324 ti = proto_tree_add_text(diuc_tree, tvb, BITHI(bit, length), "RCID_IE");
325 tree = proto_item_add_subtree(ti, ett_286j);
327 if (RCID_Type_lcl == 0) {
328 XBIT(cid, 16, "CID");
330 proto_tree_add_text(tree, tvb, BITHI(bit,1), "Prefix: %d", Prefix);
335 XBIT(cid, 11, "CID11");
337 if (RCID_Type_lcl == 1) {
339 XBIT(cid, 11, "CID11");
340 } else if (RCID_Type_lcl == 2) {
342 XBIT(cid, 7, "CID7");
343 } else if (RCID_Type_lcl == 3) {
345 XBIT(cid, 3, "CID3");
350 proto_item_append_text(ti, " (CID = %d)", cid);
352 return length; /* return length in bits */
355 /********************************************************************
356 * DL-MAP Extended-2 HARQ sub-burst IEs (8.4.5.3.21)
357 *******************************************************************/
359 gint Dedicated_DL_Control_IE(proto_tree *diuc_tree, const guint8 *bufptr, gint offset, gint length, tvbuff_t *tvb)
362 /* offset of IE in nibbles, length is variable */
365 proto_item *ti = NULL;
366 proto_tree *tree = NULL;
371 length = NIB_NIBBLE(nib, bufptr); /* length in nibbles */
373 ti = proto_tree_add_text(diuc_tree, tvb, NIBHI(nib, length+1), "Dedicated_DL_Control_IE");
374 tree = proto_item_add_subtree(ti, ett_286i);
376 proto_tree_add_text(tree, tvb, NIBHI(nib,1), "Length: %d", length);
378 nibble = NIB_NIBBLE(nib, bufptr);
379 proto_tree_add_text(tree, tvb, NIBHI(nib,1), "Control Header: %d", nibble);
381 if ((nibble & 1) == 1) {
382 nibble = NIB_NIBBLE(nib, bufptr);
383 proto_tree_add_text(tree, tvb, NIBHI(nib,1), "Num SDMA Layers: %d", (nibble >> 2) & 0x3);
385 if ((nib*4)+2 < (offset+length)*4) {
386 len = ((offset + length - nib) * 4) - 2;
387 proto_tree_add_text(tree, tvb, BITHI(nib*4, len), "Reserved bits");
391 if (nib < offset+length) {
392 len = (offset + length) - nib;
393 proto_tree_add_text(tree, tvb, NIBHI(nib,len), "Reserved bits");
399 gint Dedicated_MIMO_DL_Control_IE(proto_tree *diuc_tree, const guint8 *bufptr, gint offset, gint length, tvbuff_t *tvb)
401 /* offset of IE in bits, length is variable */
404 proto_item *ti = NULL;
405 proto_tree *tree = NULL;
406 gint mci, cqi, cmi, matrix = 0, pad, CQICH_num, mimo_mode;
411 /* 8.4.5.3.21 table 286t */
412 ti = proto_tree_add_text(diuc_tree, tvb, BITHI(bit, 1), "Dedicated MIMO DL Control IE");
413 tree = proto_item_add_subtree(ti, ett_286t);
415 XBIT(length, 5, "Length (nibbles)");
416 XBIT(mci, 1, "Control Header (MIMO Control Info)");
417 XBIT(cqi, 1, "Control Header (CQI Control Info)");
418 XBIT(cmi, 1, "Control Header (Closed MIMO Control Info)");
419 XBIT(N_layer, 2, "N_layer");
421 /* MIMO Control Info */
423 XBIT(matrix, 2, "Matrix");
424 if (STC_Zone_Dedicated_Pilots == 1) {
425 XBIT(data, 2, "Num_Beamformed_Streams");
429 /* CQICH Control Info */
431 XBIT(data, 3, "Period");
432 XBIT(data, 3, "Frame Offset");
433 XBIT(data, 4, "Duration");
434 for (j = 0; j < N_layer; j++) {
435 XBIT(data, 6, "Allocation Index");
437 XBIT(CQICH_num, 2, "CQICH_Num");
438 for (j = 0; j < CQICH_num; j++) {
439 XBIT(data, 3, "Feedback type");
440 XBIT(data, 6, "Allocation index");
444 /* Closed MIMO Control Info */
449 mimo_mode = STC_Zone_Matrix;
451 if (mimo_mode == 0 || mimo_mode == 1) {
452 XBIT(data, 3, "Antenna Grouping Index");
453 } else if (mimo_mode == 2) {
454 XBIT(data, 2, "Num_stream");
455 XBIT(data, 3, "Antenna Selection Index");
456 } else if (mimo_mode == 3) {
457 XBIT(data, 2, "Num_stream");
458 XBIT(data, 6, "Codebook Precoding Index");
462 /* padding to nibble */
463 pad = BIT_PADDING(bit,4);
465 proto_tree_add_text(tree, tvb, BITHI(bit,pad), "Padding: %d bits", pad);
469 return (bit - offset);
472 gint DL_HARQ_Chase_sub_burst_IE(proto_tree *diuc_tree, const guint8 *bufptr, gint offset, gint length, tvbuff_t *tvb)
474 /* 8.4.5.3.21 DL_HARQ_Chase_sub_burst_IE */
475 /* offset of IE in nibbles, length is variable */
478 proto_item *ti = NULL;
479 proto_tree *tree = NULL;
480 gint nsub, ddci, dur, sbi, res, diuc, rci, ind, per, ofs;
483 bit = NIB_TO_BIT(offset);
485 /* 8.4.5.3.21 table 286m */
486 ti = proto_tree_add_text(diuc_tree, tvb, BITHI(bit, length), "DL_HARQ_Chase_sub_burst_IE");
487 tree = proto_item_add_subtree(ti, ett_286m);
489 XBIT(nsub, 4, "N sub burst[ISI]");
490 XBIT(data, 4, "N ACK channel");
493 for (j = 0; j < nsub; j++) {
494 bit += RCID_IE(tree, bufptr, bit, length, tvb, RCID_Type);
495 XBIT(dur, 10, "Duration");
496 XBIT(sbi, 1, "Sub-Burst DIUC Indicator");
497 XBIT(res, 1, "Reserved");
500 XBIT(diuc, 4, "DIUC");
501 XBIT(rci, 2, "Repetition Coding Indication");
502 XBIT(res, 2, "Reserved");
505 XBIT(data, 4, "ACID");
506 XBIT(data, 1, "AI_SN");
507 XBIT(data, 1, "ACK disable");
508 XBIT(ddci, 2, "Dedicated DL Control Indicator");
510 if ((ddci & 1) == 1) {
511 XBIT(dur, 4, "Duration (d)");
513 XBIT(ind, 6, "Allocation Index");
514 XBIT(per, 3, "Period (p)");
515 XBIT(ofs, 3, "Frame offset");
519 if ((ddci & 2) == 2) {
520 bit += Dedicated_DL_Control_IE(tree, bufptr, BIT_TO_NIB(bit), length, tvb) * 4;
524 /* proto_tree_add_text(tree, tvb, BITHI(bit,4), "(DL HARQ Chase sub-burst IE)"); */
525 return (BIT_TO_NIB(bit) - offset);
528 gint DL_HARQ_IR_CTC_sub_burst_IE(proto_tree *diuc_tree, const guint8 *bufptr, gint offset, gint length, tvbuff_t *tvb)
530 /* offset of IE in nibbles, length is variable */
533 proto_item *ti = NULL;
534 proto_tree *tree = NULL;
535 proto_item *generic_item = NULL;
536 gint nsub, ddci, dur, ind, per, ofs;
538 guint32 calculated_crc;
540 bit = NIB_TO_BIT(offset);
542 /* 8.4.5.3.21 table 286n */
543 ti = proto_tree_add_text(diuc_tree, tvb, BITHI(bit, 4), "DL HARQ IR CTC sub-burst IE");
544 tree = proto_item_add_subtree(ti, ett_286n);
546 XBIT(nsub, 4, "N sub burst[ISI]");
547 XBIT(data, 4, "N ACK channel");
550 for (j = 0; j < nsub; j++) {
551 bit += RCID_IE(tree, bufptr, bit, length, tvb, RCID_Type);
553 XBIT(data, 4, "N(EP)");
554 XBIT(data, 4, "N(SCH)");
555 XBIT(data, 2, "SPID");
556 XBIT(data, 4, "ACID");
557 XBIT(data, 1, "AI_SN");
558 XBIT(data, 1, "ACK disable");
559 XBIT(data, 2, "Reserved");
560 XBIT(ddci, 2, "Dedicated DL Control Indicator");
562 if ((ddci & 1) == 1) {
563 XBIT(dur, 4, "Duration (d)");
566 XBIT(ind, 6, "Allocation Index");
567 XBIT(per, 3, "Period (p)");
568 XBIT(ofs, 3, "Frame offset");
571 if ((ddci & 2) == 2) {
572 bit += Dedicated_DL_Control_IE(tree, bufptr, BIT_TO_NIB(bit), length, tvb);
576 if (include_cor2_changes)
578 /* CRC-16 is always appended */
579 data = BIT_BITS(bit, bufptr, 16);
580 generic_item = proto_tree_add_text(tree, tvb, BITHI(bit,16), "CRC-16: 0x%04x",data);
581 /* calculate the CRC */
582 calculated_crc = wimax_mac_calc_crc16(tvb_get_ptr(tvb, 0, BIT_TO_BYTE(bit)), BIT_TO_BYTE(bit));
583 if (data != calculated_crc)
585 proto_item_append_text(generic_item, " - incorrect! (should be: 0x%x)", calculated_crc);
590 return (BIT_TO_NIB(bit) - offset);
593 gint DL_HARQ_IR_CC_sub_burst_IE(proto_tree *diuc_tree, const guint8 *bufptr, gint offset, gint length, tvbuff_t *tvb)
595 /* offset of IE in nibbles, length is variable */
598 proto_item *ti = NULL;
599 proto_tree *tree = NULL;
600 proto_item *generic_item = NULL;
601 gint nsub, sbdi, ddci, dur, ind, per, ofs;
603 guint16 calculated_crc;
605 bit = NIB_TO_BIT(offset);
607 /* 8.4.5.3.21 table 286o */
608 ti = proto_tree_add_text(diuc_tree, tvb, BITHI(bit, 4), "DL HARQ IR CC sub-burst IE");
609 tree = proto_item_add_subtree(ti, ett_286o);
611 XBIT(nsub, 4, "N sub burst[ISI]");
612 XBIT(data, 4, "N ACK channel");
615 for (j = 0; j < nsub; j++) {
616 bit += RCID_IE(tree, bufptr, bit, length, tvb, RCID_Type) / 4;
618 XBIT(data, 10, "Duration");
619 XBIT(sbdi, 1, "Sub-Burst DIUC Indicator");
620 XBIT(data, 1, "Reserved");
623 XBIT(data, 4, "DIUC");
624 XBIT(data, 2, "Repetition Coding Indication");
625 XBIT(data, 2, "Reserved");
628 XBIT(data, 4, "ACID");
629 XBIT(data, 1, "AI_SN");
630 XBIT(data, 2, "SPID");
631 XBIT(data, 1, "ACK disable");
632 XBIT(ddci, 2, "Dedicated DL Control Indicator");
633 XBIT(data, 2, "Reserved");
636 XBIT(dur, 4, "Duration (d)");
639 XBIT(ind, 6, "Allocation Index");
640 XBIT(per, 3, "Period (p)");
641 XBIT(ofs, 3, "Frame offset");
644 if ((ddci & 2) == 2) {
645 bit += Dedicated_DL_Control_IE(tree, bufptr, BIT_TO_NIB(bit), length, tvb);
649 if (include_cor2_changes)
651 /* CRC-16 is always appended */
652 data = BIT_BITS(bit, bufptr, 16);
653 generic_item = proto_tree_add_text(tree, tvb, BITHI(bit,16), "CRC-16: 0x%04x",data);
654 /* calculate the CRC */
655 calculated_crc = wimax_mac_calc_crc16(tvb_get_ptr(tvb, 0, BIT_TO_BYTE(bit)), BIT_TO_BYTE(bit));
656 if (data != calculated_crc)
658 proto_item_append_text(generic_item, " - incorrect! (should be: 0x%x)", calculated_crc);
663 return (BIT_TO_NIB(bit) - offset);
666 gint MIMO_DL_Chase_HARQ_sub_burst_IE(proto_tree *diuc_tree, const guint8 *bufptr, gint offset, gint length, tvbuff_t *tvb)
668 /* offset of IE in nibbles, length is variable */
671 proto_item *ti = NULL;
672 proto_tree *tree = NULL;
673 proto_item *generic_item = NULL;
674 gint nsub, mui, dci, akd;
676 guint16 calculated_crc;
678 bit = NIB_TO_BIT(offset);
680 /* 8.4.5.3.21 table 286p */
681 ti = proto_tree_add_text(diuc_tree, tvb, BITHI(bit, 1), "MIMO DL Chase HARQ sub-burst IE");
682 tree = proto_item_add_subtree(ti, ett_286p);
684 XBIT(nsub, 4, "N sub burst[ISI]");
685 XBIT(data, 6, "N ACK channel");
688 for (j = 0; j < nsub; j++) {
689 XBIT(mui, 1, "MU Indicator");
690 XBIT(dci, 1, "Dedicated MIMO DL Control Indicator");
691 XBIT(akd, 1, "ACK Disable");
693 bit += RCID_IE(tree, bufptr, bit, length, tvb, RCID_Type);
696 bit += Dedicated_MIMO_DL_Control_IE(tree, bufptr, bit, length, tvb);
698 XBIT(data, 10, "Duration");
699 for (i = 0; i < N_layer; i++) {
701 bit += RCID_IE(tree, bufptr, bit, length, tvb, RCID_Type);
703 XBIT(data, 4, "DIUC");
704 XBIT(data, 2, "Repetition Coding Indication");
706 XBIT(data, 4, "ACID");
707 XBIT(data, 1, "AI_SN");
711 /* Padding to nibble */
712 data = BIT_PADDING(bit, 4);
714 proto_tree_add_text(tree, tvb, BITHI(bit,data), "Padding: %d bits", data);
718 if (include_cor2_changes)
720 /* CRC-16 is always appended */
721 data = BIT_BITS(bit, bufptr, 16);
722 generic_item = proto_tree_add_text(tree, tvb, BITHI(bit,16), "CRC-16: 0x%04x",data);
723 /* calculate the CRC */
724 calculated_crc = wimax_mac_calc_crc16(tvb_get_ptr(tvb, 0, BIT_TO_BYTE(bit)), BIT_TO_BYTE(bit));
725 if (data != calculated_crc)
727 proto_item_append_text(generic_item, " - incorrect! (should be: 0x%x)", calculated_crc);
732 return (BIT_TO_NIB(bit) - offset);
735 gint MIMO_DL_IR_HARQ_sub_burst_IE(proto_tree *diuc_tree, const guint8 *bufptr, gint offset, gint length, tvbuff_t *tvb)
737 /* offset of IE in nibbles, length is variable */
740 proto_item *ti = NULL;
741 proto_tree *tree = NULL;
742 proto_item *generic_item = NULL;
743 gint nsub, mui, dci, akd;
745 guint16 calculated_crc;
747 bit = NIB_TO_BIT(offset);
749 /* 8.4.5.3.21 table 286q */
750 ti = proto_tree_add_text(diuc_tree, tvb, BITHI(bit, 4), "MIMO DL IR HARQ sub-burst IE");
751 tree = proto_item_add_subtree(ti, ett_286q);
753 XBIT(nsub, 4, "N sub burst[ISI]");
754 XBIT(data, 6, "N ACK channel");
757 for (j = 0; j < nsub; j++) {
758 XBIT(mui, 1, "MU Indicator");
759 XBIT(dci, 1, "Dedicated MIMO DL Control Indicator");
760 XBIT(akd, 1, "ACK Disable");
762 bit += RCID_IE(tree, bufptr, bit, length, tvb, RCID_Type);
765 bit += Dedicated_MIMO_DL_Control_IE(tree, bufptr, bit, length, tvb);
767 XBIT(data, 4, "N(SCH)");
768 for (i = 0; i < N_layer; i++) {
770 bit += RCID_IE(tree, bufptr, bit, length, tvb, RCID_Type);
772 XBIT(data, 4, "N(EP)");
774 XBIT(data, 2, "SPID");
775 XBIT(data, 4, "ACID");
776 XBIT(data, 1, "AI_SN");
781 if (include_cor2_changes)
783 /* CRC-16 is always appended */
784 data = BIT_BITS(bit, bufptr, 16);
785 generic_item = proto_tree_add_text(tree, tvb, BITHI(bit,16), "CRC-16: 0x%04x",data);
786 /* calculate the CRC */
787 calculated_crc = wimax_mac_calc_crc16(tvb_get_ptr(tvb, 0, BIT_TO_BYTE(bit)), BIT_TO_BYTE(bit));
788 if (data != calculated_crc)
790 proto_item_append_text(generic_item, " - incorrect! (should be: 0x%x)", calculated_crc);
795 return (BIT_TO_NIB(bit) - offset);
798 gint MIMO_DL_IR_HARQ_for_CC_sub_burst_IE(proto_tree *diuc_tree, const guint8 *bufptr, gint offset, gint length, tvbuff_t *tvb)
800 /* offset of IE in nibbles, length is variable */
803 proto_item *ti = NULL;
804 proto_tree *tree = NULL;
805 proto_item *generic_item = NULL;
806 gint nsub, mui, dci, akd;
808 guint16 calculated_crc;
810 bit = NIB_TO_BIT(offset);
812 /* 8.4.5.3.21 table 286r */
813 ti = proto_tree_add_text(diuc_tree, tvb, BITHI(bit, 1), "MIMO DL IR HARQ for CC sub-burst IE");
814 tree = proto_item_add_subtree(ti, ett_286r);
816 XBIT(nsub, 4, "N sub burst[ISI]");
817 XBIT(data, 6, "N ACK channel");
820 for (j = 0; j < nsub; j++) {
821 XBIT(mui, 1, "MU Indicator");
822 XBIT(dci, 1, "Dedicated MIMO DL Control Indicator");
823 XBIT(akd, 1, "ACK Disable");
825 bit += RCID_IE(tree, bufptr, bit, length, tvb, RCID_Type);
828 bit += Dedicated_MIMO_DL_Control_IE(tree, bufptr, bit, length, tvb);
830 XBIT(data, 10, "Duration");
831 for (i = 0; i < N_layer; i++) {
833 bit += RCID_IE(tree, bufptr, bit, length, tvb, RCID_Type);
835 XBIT(data, 4, "DIUC");
836 XBIT(data, 2, "Repetition Coding Indication");
838 XBIT(data, 4, "ACID");
839 XBIT(data, 1, "AI_SN");
840 XBIT(data, 2, "SPID");
845 if (include_cor2_changes)
847 /* CRC-16 is always appended */
848 data = BIT_BITS(bit, bufptr, 16);
849 generic_item = proto_tree_add_text(tree, tvb, BITHI(bit,16), "CRC-16: 0x%04x",data);
850 /* calculate the CRC */
851 calculated_crc = wimax_mac_calc_crc16(tvb_get_ptr(tvb, 0, BIT_TO_BYTE(bit)), BIT_TO_BYTE(bit));
852 if (data != calculated_crc)
854 proto_item_append_text(generic_item, " - incorrect! (should be: 0x%x)", calculated_crc);
859 return (BIT_TO_NIB(bit) - offset);
862 gint MIMO_DL_STC_HARQ_sub_burst_IE(proto_tree *diuc_tree, const guint8 *bufptr, gint offset, gint length, tvbuff_t *tvb)
864 /* offset of IE in nibbles, length is variable */
867 proto_item *ti = NULL;
868 proto_tree *tree = NULL;
869 proto_item *generic_item = NULL;
870 gint nsub, sbi, txc, akd, dmci;
872 guint16 calculated_crc;
874 bit = NIB_TO_BIT(offset);
876 /* 8.4.5.3.21 table 286s */
877 ti = proto_tree_add_text(diuc_tree, tvb, BITHI(bit, 1), "MIMO DL STC HARQ sub-burst IE");
878 tree = proto_item_add_subtree(ti, ett_286s);
880 XBIT(nsub, 4, "N sub burst[ISI]");
881 XBIT(data, 6, "N ACK channel");
884 for (j = 0; j < nsub; j++) {
885 XBIT(txc, 2, "TX Count");
886 XBIT(data, 10, "Duration");
887 XBIT(sbi, 1, "Sub-burst offset indication");
888 XBIT(data, 3, "Reserved");
890 XBIT(data, 8, "Sub-burst offset");
892 bit += RCID_IE(tree, bufptr, bit, length, tvb, RCID_Type);
893 XBIT(akd, 1, "ACK Disable");
895 XBIT(dmci, 1, "Dedicated MIMO DL Control Indicator");
897 bit += Dedicated_MIMO_DL_Control_IE(tree, bufptr, bit, length, tvb);
899 XBIT(data, 4, "DIUC");
900 XBIT(data, 2, "Repetition coding Indication");
903 XBIT(data, 4, "ACID");
907 if (include_cor2_changes)
909 /* CRC-16 is always appended */
910 data = BIT_BITS(bit, bufptr, 16);
911 generic_item = proto_tree_add_text(tree, tvb, BITHI(bit,16), "CRC-16: 0x%04x",data);
912 /* calculate the CRC */
913 calculated_crc = wimax_mac_calc_crc16(tvb_get_ptr(tvb, 0, BIT_TO_BYTE(bit)), BIT_TO_BYTE(bit));
914 if (data != calculated_crc)
916 proto_item_append_text(generic_item, " - incorrect! (should be: 0x%x)", calculated_crc);
921 return (BIT_TO_NIB(bit) - offset);
924 /********************************************************************
925 * DL-MAP Extended-2 IEs
926 *******************************************************************/
928 gint MBS_MAP_IE(proto_tree *diuc_tree, const guint8 *bufptr, gint offset, gint length, tvbuff_t *tvb)
930 /* DL-MAP Extended-2 IE = 0 */
931 /* 8.4.5.3.12 MBS_MAP_IE */
932 /* offset of TLV in nibbles, length of TLV in nibbles */
935 proto_item *ti = NULL;
936 proto_tree *tree = NULL;
939 bit = NIB_TO_BIT(offset);
941 ti = proto_tree_add_text(diuc_tree, tvb, NIBHI(offset, length), "MBS_MAP_IE");
942 tree = proto_item_add_subtree(ti, ett_286a);
944 XBIT(data, 4, "Extended-2 DIUC");
945 XBIT(data, 8, "Length");
947 XBIT(data, 7, "MBS Zone identifier");
948 XBIT(mde, 1, "Macro diversity enhanced");
951 XBIT(data, 2, "Permutation");
952 XBIT(data, 5, "DL_PermBase");
953 XBIT(data, 2, "PRBS_ID");
954 XBIT(data, 7, "OFDMA_Symbol_Offset");
955 XBIT(dci, 1, "DIUC_change_indication");
956 XBIT(data, 3, "Reserved");
958 XBIT(data, 3, "Reserved");
959 XBIT(data, 3, "Boosting");
960 XBIT(data, 4, "DIUC");
961 XBIT(data, 6, "No. Subchannels");
962 XBIT(data, 6, "No. OFDMA Symbols");
963 XBIT(data, 2, "Repetition Coding Indication");
966 XBIT(data, 4, "DIUC");
967 XBIT(data, 16, "CID");
968 XBIT(data, 8, "OFDMA Symbols Offset");
969 XBIT(data, 6, "Subchannel offset");
970 XBIT(data, 3, "Boosting");
971 XBIT(s3i, 1, "SLC_3_indication");
972 XBIT(data, 6, "No. OFDMA Symbols");
973 XBIT(data, 6, "No. Subchannels");
974 XBIT(data, 2, "Repetition Coding Indication");
976 XBIT(data, 8, "Next MBS_MAP_IE frame offset");
979 data = BIT_PADDING(bit, 4);
981 proto_tree_add_text(tree, tvb, BITHI(bit,data), "Padding: %d bits", data);
984 return BIT_TO_NIB(bit);
987 gint HO_Anchor_Active_DL_MAP_IE(proto_tree *diuc_tree, const guint8 *bufptr, gint offset, gint length, tvbuff_t *tvb)
989 /* DL-MAP Extended-2 IE = 1 */
990 /* 8.4.5.3.14 [2] HO_Anchor_Active_DL-MAP_IE TODO 1.1 */
991 /* offset of TLV in nibbles, length of TLV in nibbles */
994 proto_item *ti = NULL;
995 proto_tree *tree = NULL;
999 ti = proto_tree_add_text(diuc_tree, tvb, NIBHI(offset, length), "HO_Anchor_Active_DL_MAP_IE");
1000 tree = proto_item_add_subtree(ti, ett_286c);
1002 XNIB(data, 1, "Extended-2 DIUC");
1003 XNIB(data, 2, "Length");
1004 proto_tree_add_text(diuc_tree, tvb, NIBHI(nib, length-3), "(not implemented)");
1008 gint HO_Active_Anchor_DL_MAP_IE(proto_tree *diuc_tree, const guint8 *bufptr, gint offset, gint length, tvbuff_t *tvb)
1010 /* DL-MAP Extended-2 IE = 2 */
1011 /* 8.4.5.3.15 HO_Active_Anchor_DL_MAP_IE TODO 1.1 */
1012 /* offset of TLV in nibbles, length of TLV in nibbles */
1015 proto_item *ti = NULL;
1016 proto_tree *tree = NULL;
1020 ti = proto_tree_add_text(diuc_tree, tvb, NIBHI(offset, length), "HO_Active_Anchor_DL_MAP_IE");
1021 tree = proto_item_add_subtree(ti, ett_286d);
1023 XNIB(data, 1, "Extended-2 DIUC");
1024 XNIB(data, 2, "Length");
1025 proto_tree_add_text(diuc_tree, tvb, NIBHI(nib, length-3), "(not implemented)");
1029 gint HO_CID_Translation_MAP_IE(proto_tree *diuc_tree, const guint8 *bufptr, gint offset, gint length, tvbuff_t *tvb)
1031 /* DL-MAP Extended-2 IE = 3 */
1032 /* 8.4.5.3.16 HO_CID_Translation_MAP_IE TODO 1.1 */
1033 /* offset of TLV in nibbles, length of TLV in nibbles */
1036 proto_item *ti = NULL;
1037 proto_tree *tree = NULL;
1041 ti = proto_tree_add_text(diuc_tree, tvb, NIBHI(offset, length), "CID_Translation_MAP_IE");
1042 tree = proto_item_add_subtree(ti, ett_286e);
1044 XNIB(data, 1, "Extended-2 DIUC");
1045 XNIB(data, 2, "Length");
1046 proto_tree_add_text(diuc_tree, tvb, NIBHI(nib, length-3), "(not implemented)");
1050 gint MIMO_in_another_BS_IE(proto_tree *diuc_tree, const guint8 *bufptr, gint offset, gint length, tvbuff_t *tvb)
1052 /* DL-MAP Extended-2 IE = 4 */
1053 /* 8.4.5.3.17 [2] MIMO_in_another_BS_IE (not implemented)*/
1054 /* offset of TLV in nibbles, length of TLV in nibbles */
1057 proto_item *ti = NULL;
1058 proto_tree *tree = NULL;
1062 ti = proto_tree_add_text(diuc_tree, tvb, NIBHI(offset, length), "MIMO_in_another_BS_IE");
1063 tree = proto_item_add_subtree(ti, ett_286f);
1065 XNIB(data, 1, "Extended-2 DIUC");
1066 XNIB(data, 2, "Length");
1067 proto_tree_add_text(diuc_tree, tvb, NIBHI(nib, length-3), "(not implemented)");
1071 gint Macro_MIMO_DL_Basic_IE(proto_tree *diuc_tree, const guint8 *bufptr, gint offset, gint length, tvbuff_t *tvb)
1073 /* dl-map extended-2 ie = 5 */
1074 /* 8.4.5.3.18 [2] Macro-MIMO_DL_Basic_IE (not implemented) */
1075 /* offset of tlv in nibbles, length of tlv in nibbles */
1078 proto_item *ti = NULL;
1079 proto_tree *tree = NULL;
1083 ti = proto_tree_add_text(diuc_tree, tvb, NIBHI(offset, length), "Macro_MIMO_DL_Basic_IE");
1084 tree = proto_item_add_subtree(ti, ett_286g);
1086 XNIB(data, 1, "Extended-2 DIUC");
1087 XNIB(data, 2, "Length");
1088 proto_tree_add_text(diuc_tree, tvb, NIBHI(nib, length-3), "(not implemented)");
1092 gint Skip_IE(proto_tree *diuc_tree, const guint8 *bufptr, gint offset, gint length, tvbuff_t *tvb)
1094 /* DL-MAP Extended-2 IE = 6 */
1095 /* 8.4.5.3.20.2 Skip_IE */
1096 /* offset of TLV in nibbles, length of TLV in nibbles */
1099 proto_item *ti = NULL;
1100 proto_tree *tree = NULL;
1102 bit = NIB_TO_BIT(offset);
1104 ti = proto_tree_add_text(diuc_tree, tvb, NIBHI(offset, length), "Skip_IE");
1105 tree = proto_item_add_subtree(ti, ett_286k);
1107 XBIT(data, 4, "Extended-2 DIUC");
1108 XBIT(data, 8, "Length");
1110 XBIT(data, 1, "Mode");
1111 XBIT(data, 7, "Reserved");
1113 return BIT_TO_NIB(bit);
1116 gint HARQ_DL_MAP_IE(proto_tree *diuc_tree, const guint8 *bufptr, gint offset, gint length, tvbuff_t *tvb)
1118 /* DL-MAP Extended-2 IE = 7 */
1119 /* 8.4.5.3.21 [2] HARQ_DL_MAP_IE */
1120 /* offset of TLV in nibbles, length of TLV in nibbles */
1123 proto_item *ti = NULL;
1124 proto_tree *tree = NULL;
1125 gint len, lastbit, rui, mode, sub_len, pad;
1127 bit = NIB_TO_BIT(offset);
1129 ti = proto_tree_add_text(diuc_tree, tvb, NIBHI(offset, length), "HARQ_DL_MAP_IE");
1130 tree = proto_item_add_subtree(ti, ett_286l);
1132 XBIT(data, 4, "Extended-2 DIUC");
1133 XBIT(len, 8, "Length");
1135 XBIT(RCID_Type, 2, "RCID_Type");
1136 XBIT(data, 2, "Reserved");
1138 /* while data remains */
1139 length = NIB_TO_BIT(length);
1140 /* Subtract extra nibble to be sure to stop in time. */
1141 lastbit = bit + BYTE_TO_BIT(len) - 14 - 4;
1142 while (bit < lastbit) {
1143 XBIT(data, 3, "Boosting");
1144 XBIT(rui, 1, "Region_ID use indicator");
1147 XBIT(data, 8, "OFDMA symbol offset");
1148 XBIT(data, 7, "Subchannel offset");
1149 XBIT(data, 7, "Number of OFDMA symbols");
1150 XBIT(data, 7, "Number of subchannels");
1151 if (include_cor2_changes)
1153 XBIT(data, 1, "Rectangular Sub-Burst Indicator"); /* Implemented: "Rectangular Sub-Burst Indicator" field added */
1154 XBIT(data, 2, "Reserved"); /* and "Reserved" field resized from 3 bits to 2 bits */
1158 XBIT(data, 3, "Reserved");
1161 XBIT(data, 8, "Region_ID");
1163 XBIT(mode, 4, "Mode");
1164 XBIT(sub_len, 8, "Sub-burst IE Length");
1167 /* length of these are variable, each returns length in nibbles */
1169 DL_HARQ_Chase_sub_burst_IE(tree, bufptr, BIT_TO_NIB(bit), length, tvb);
1170 } else if (mode == 1) {
1171 DL_HARQ_IR_CTC_sub_burst_IE(tree, bufptr, BIT_TO_NIB(bit), length, tvb);
1172 } else if (mode == 2) {
1173 DL_HARQ_IR_CC_sub_burst_IE(tree, bufptr, BIT_TO_NIB(bit), length, tvb);
1174 } else if (mode == 3) {
1175 MIMO_DL_Chase_HARQ_sub_burst_IE(tree, bufptr, BIT_TO_NIB(bit), length, tvb);
1176 } else if (mode == 4) {
1177 MIMO_DL_IR_HARQ_sub_burst_IE(tree, bufptr, BIT_TO_NIB(bit), length, tvb);
1178 } else if (mode == 5) {
1179 MIMO_DL_IR_HARQ_for_CC_sub_burst_IE(tree, bufptr, BIT_TO_NIB(bit), length, tvb);
1180 } else if (mode == 6) {
1181 MIMO_DL_STC_HARQ_sub_burst_IE(tree, bufptr, BIT_TO_NIB(bit), length, tvb);
1183 proto_tree_add_text(tree, tvb, BITHI(bit,1), "(reserved Mode)");
1184 break; /* cannot continue */
1186 bit += NIB_TO_BIT(sub_len);
1189 pad = NIB_TO_BIT(offset) + length - bit;
1191 proto_tree_add_text(tree, tvb, BITHI(bit,pad), "Padding: %d bits",pad);
1195 return BIT_TO_NIB(bit);
1198 gint HARQ_ACK_IE(proto_tree *diuc_tree, const guint8 *bufptr, gint offset, gint length, tvbuff_t *tvb)
1200 /* DL-MAP Extended-2 IE = 8 */
1201 /* 8.4.5.3.22 HARQ_ACK IE */
1202 /* offset of TLV in nibbles, length of TLV in nibbles */
1205 proto_item *ti = NULL;
1206 proto_tree *tree = NULL;
1210 ti = proto_tree_add_text(diuc_tree, tvb, NIBHI(offset, length), "HARQ_ACK_IE");
1211 tree = proto_item_add_subtree(ti, ett_286u);
1213 XNIB(data, 1, "Extended-2 DIUC");
1214 XNIB(data, 2, "Length");
1216 proto_tree_add_text(diuc_tree, tvb, NIBHI(nib,length-3), "(bitmap data)");
1221 gint Enhanced_DL_MAP_IE(proto_tree *diuc_tree, const guint8 *bufptr, gint offset, gint length, tvbuff_t *tvb)
1223 /* DL-MAP Extended-2 IE = 9 */
1224 /* 8.4.5.3.23 Enhanced DL MAP IE */
1225 /* offset of TLV in nibbles, length of TLV in nibbles */
1228 proto_item *ti = NULL;
1229 proto_tree *tree = NULL;
1233 bit = NIB_TO_BIT(offset);
1235 ti = proto_tree_add_text(diuc_tree, tvb, NIBHI(offset, length), "Enhanced_DL-MAP_IE");
1236 tree = proto_item_add_subtree(ti, ett_286v);
1238 XBIT(data, 4, "Extended-2 DIUC");
1239 XBIT(data, 8, "Length");
1241 XBIT(numass, 4, "Num_Assignment");
1242 for (i = 0; i < numass; i++) {
1244 XBIT(n_cid, 8, "N_CID");
1245 for (n = 0; n < n_cid; n++) {
1246 XBIT(data, 16, "CID");
1249 XBIT(data, 4, "DIUC");
1250 XBIT(data, 3, "Boosting");
1251 XBIT(data, 2, "Repetition Coding Indication");
1252 XBIT(data, 8, "Region_ID");
1253 XBIT(data, 3, "Reserved");
1255 return BIT_TO_NIB(bit);
1258 gint Closed_loop_MIMO_DL_Enhanced_IE(proto_tree *diuc_tree, const guint8 *bufptr, gint offset, gint length, tvbuff_t *tvb)
1260 /* DL-MAP Extended-2 IE = 0xA */
1261 /* 8.4.5.3.24 Closed-loop MIMO DL Enhanced IE (not implemented) */
1262 /* offset of TLV in nibbles, length of TLV in nibbles */
1265 proto_item *ti = NULL;
1266 proto_tree *tree = NULL;
1270 ti = proto_tree_add_text(diuc_tree, tvb, NIBHI(offset, length), "CL_MIMO_DL_Enhanced_IE");
1271 tree = proto_item_add_subtree(ti, ett_286w);
1273 XNIB(data, 1, "Extended-2 DIUC");
1274 XNIB(data, 2, "Length");
1275 proto_tree_add_text(diuc_tree, tvb, NIBHI(nib, length-3), "(not implemented)");
1279 gint AAS_SDMA_DL_IE(proto_tree *diuc_tree, const guint8 *bufptr, gint offset, gint length, tvbuff_t *tvb)
1281 /* DL-MAP Extended-2 IE = 0xE */
1282 /* 8.4.5.3.26 AAS_SDMA_DL_IE */
1283 /* offset of TLV in nibbles, length of TLV in nibbles */
1286 proto_item *ti = NULL;
1287 proto_tree *tree = NULL;
1288 gint num_region, num_users, pilot_pattern, encoding_mode, ackch_alloc, cqich_alloc;
1289 gint aas_preamble = 1;
1290 gint zone_permut = 0; /* TODO */
1293 bit = NIB_TO_BIT(offset);
1295 ti = proto_tree_add_text(diuc_tree, tvb, NIBHI(offset, length), "AAS_SDMA_DL_IE");
1296 tree = proto_item_add_subtree(ti, ett_286y);
1298 XBIT(data, 4, "Extended-2 DIUC");
1299 XBIT(data, 8, "Length");
1301 XBIT(RCID_Type, 2, "RCID_Type");
1302 XBIT(num_region, 4, "Num_Burst_Region");
1303 XBIT(data, 2, "Reserved");
1304 for (i = 0; i < num_region; i++) {
1305 XBIT(data, 8, "OFDMA Symbol Offset");
1306 if (zone_permut == 0) {
1307 XBIT(data, 8, "Subchannel offset");
1308 XBIT(data, 5, "No. OFDMA triple symbols");
1309 XBIT(data, 6, "No. subchannels");
1311 XBIT(data, 6, "Subchannel offset");
1312 XBIT(data, 7, "No. OFDMA triple symbols");
1313 XBIT(data, 6, "No. subchannels");
1315 XBIT(num_users, 3, "Number of Users");
1316 XBIT(data, 2, "Reserved");
1317 for (j = 0; j < num_users; j++) {
1318 bit += RCID_IE(tree, bufptr, bit, length, tvb, RCID_Type);
1319 XBIT(encoding_mode, 2, "Encoding Mode");
1320 XBIT(cqich_alloc, 1, "CQICH Allocation");
1321 XBIT(ackch_alloc, 1, "ACKCH Allocation");
1322 XBIT(pilot_pattern, 1, "Pilot Pattern Modifier");
1324 XBIT(data, 4, "Preamble Modifier Index");
1326 if (pilot_pattern) {
1327 XBIT(data, 2, "Pilot Pattern");
1328 XBIT(data, 1, "Reserved");
1330 XBIT(data, 3, "Reserved");
1332 if (encoding_mode == 0x0) {
1333 XBIT(data, 4, "DIUC");
1334 XBIT(data, 2, "Repetition Coding Indication");
1335 XBIT(data, 2, "Reserved");
1337 if (encoding_mode == 0x1) {
1339 XBIT(data, 5, "ACK CH Index");
1341 XBIT(data, 1, "Reserved");
1343 XBIT(data, 4, "DIUC");
1344 XBIT(data, 2, "Repetition Coding Indication");
1345 XBIT(data, 4, "ACID");
1346 XBIT(data, 1, "AI_SN");
1348 if (encoding_mode == 0x2) {
1350 XBIT(data, 5, "ACK CH Index");
1352 XBIT(data, 1, "Reserved");
1354 XBIT(data, 4, "N(EP)");
1355 XBIT(data, 4, "N(SCH)");
1356 XBIT(data, 2, "SPID");
1357 XBIT(data, 4, "ACID");
1358 XBIT(data, 1, "AI_SN");
1360 if (encoding_mode == 0x3) {
1362 XBIT(data, 5, "ACK CH Index");
1363 XBIT(data, 2, "Reserved");
1365 XBIT(data, 3, "Reserved");
1367 XBIT(data, 4, "DIUC");
1368 XBIT(data, 2, "Repetition Coding Indication");
1369 XBIT(data, 2, "SPID");
1370 XBIT(data, 4, "ACID");
1371 XBIT(data, 1, "AI_SN");
1374 XBIT(data, 6, "Allocation Index");
1375 XBIT(data, 3, "Period (p)");
1376 XBIT(data, 3, "Frame offset");
1377 XBIT(data, 4, "Duration (d)");
1381 data = BIT_PADDING(bit,4);
1382 /* Should this be an optional field? Or do we want it, even if it has a length of zero? */
1383 proto_tree_add_text(tree, tvb, BITHI(bit,data), "Padding: %d bits", data);
1386 return BIT_TO_NIB(bit);
1391 /********************************************************************
1392 * DL-MAP Extended IEs
1393 *******************************************************************/
1395 gint Channel_Measurement_IE(proto_tree *diuc_tree, const guint8 *bufptr, gint offset, gint length, tvbuff_t *tvb)
1397 /* DL-MAP Extended IE = 0 */
1398 /* 8.4.5.3.5 [1] Channel_Measurement_IE */
1399 /* offset of TLV in nibbles, length of TLV in nibbles */
1402 proto_item *ti = NULL;
1403 proto_tree *tree = NULL;
1407 ti = proto_tree_add_text(diuc_tree, tvb, NIBHI(offset, length), "Channel_Measurement_IE");
1408 tree = proto_item_add_subtree(ti, ett_280);
1410 XNIB(data, 1, "Extended DIUC");
1411 XNIB(data, 1, "Length");
1413 XNIB(data, 2, "Channel Nr");
1414 XNIB(data, 2, "OFDMA Symbol Offset");
1415 data = NIB_WORD(nib, bufptr);
1416 proto_tree_add_text(tree, tvb, NIBHI(nib,4), "CID: %d", data);
1421 gint STC_Zone_IE(proto_tree *diuc_tree, const guint8 *bufptr, gint offset, gint length, tvbuff_t *tvb)
1423 /* DL-MAP Extended IE = 1 */
1424 /* 8.4.5.3.4 STC_Zone_IE */
1425 /* offset of TLV in nibbles, length of TLV in nibbles */
1426 /* set globals: STC_Zone_Dedicated_Pilots, STC_Zone_Matrix
1427 * used in 8.4.5.3.21.1 Dedicated MIMO Control IE 286t */
1430 proto_item *ti = NULL;
1431 proto_tree *tree = NULL;
1433 bit = NIB_TO_BIT(offset);
1435 ti = proto_tree_add_text(diuc_tree, tvb, NIBHI(offset, length), "STC_Zone_IE");
1436 tree = proto_item_add_subtree(ti, ett_279);
1438 XBIT(data, 4, "Extended DIUC");
1439 XBIT(data, 4, "Length");
1441 XBIT(data, 8, "OFDMA Symbol Offset");
1442 XBIT(data, 2, "Permutations");
1443 XBIT(data, 1, "Use All SC indicator");
1444 XBIT(data, 2, "STC");
1445 XBIT(STC_Zone_Matrix, 2, "Matrix indicator");
1446 XBIT(data, 5, "DL_PermBase");
1447 XBIT(data, 2, "PRBS_ID");
1448 XBIT(data, 2, "AMC type");
1449 XBIT(data, 1, "Midamble Presence");
1450 XBIT(data, 1, "Midamble Boosting");
1451 XBIT(data, 1, "2/3 antenna select");
1452 XBIT(STC_Zone_Dedicated_Pilots, 1, "Dedicated Pilots");
1453 XBIT(data, 4, "Reserved");
1455 return BIT_TO_NIB(bit);
1458 gint AAS_DL_IE(proto_tree *diuc_tree, const guint8 *bufptr, gint offset, gint length, tvbuff_t *tvb)
1460 /* DL-MAP Extended IE = 2 */
1461 /* 8.4.5.3.3 AAS_DL_IE */
1462 /* offset of TLV in nibbles, length of TLV in nibbles */
1465 proto_item *ti = NULL;
1466 proto_tree *tree = NULL;
1468 bit = NIB_TO_BIT(offset);
1470 ti = proto_tree_add_text(diuc_tree, tvb, NIBHI(offset, length), "AAS_DL_IE");
1471 tree = proto_item_add_subtree(ti, ett_278);
1473 XBIT(data, 4, "Extended DIUC");
1474 XBIT(data, 4, "Length");
1476 XBIT(data, 8, "OFDMA Symbol Offset");
1477 XBIT(data, 3, "Permutation");
1478 XBIT(data, 6, "DL_PermBase");
1479 XBIT(data, 2, "Downlink_preamble_config");
1480 XBIT(data, 1, "Preamble type");
1481 XBIT(data, 2, "PRBS_ID");
1482 XBIT(data, 1, "Diversity Map");
1483 XBIT(data, 1, "Reserved");
1485 return BIT_TO_NIB(bit);
1488 gint Data_location_in_another_BS_IE(proto_tree *diuc_tree, const guint8 *bufptr, gint offset, gint length, tvbuff_t *tvb)
1490 /* DL-MAP Extended IE = 3 */
1491 /* 8.4.5.3.6 Data_location_in_another_BS_IE */
1492 /* offset of TLV in nibbles, length of TLV in nibbles */
1495 proto_item *ti = NULL;
1496 proto_tree *tree = NULL;
1498 bit = NIB_TO_BIT(offset);
1500 ti = proto_tree_add_text(diuc_tree, tvb, NIBHI(offset, length), "Data location in another BS IE");
1501 tree = proto_item_add_subtree(ti, ett_281);
1503 XBIT(data, 4, "Extended DIUC");
1504 XBIT(data, 4, "Length");
1506 XBIT(data, 2, "Segment");
1507 XBIT(data, 6, "Used subchannels");
1508 XBIT(data, 4, "DIUC");
1509 XBIT(data, 3, "Frame Advance");
1510 XBIT(data, 1, "Reserved");
1511 XBIT(data, 8, "OFDMA Symbol Offset");
1512 XBIT(data, 6, "Subchannel Offset");
1513 XBIT(data, 3, "Boosting");
1514 XBIT(data, 7, "Preamble Index");
1515 XBIT(data, 8, "No. OFDMA Symbols");
1516 XBIT(data, 6, "No. Subchannels");
1517 XBIT(data, 2, "Repetition Coding Indication");
1518 XBIT(data, 16, "CID");
1520 return BIT_TO_NIB(bit);
1523 gint CID_Switch_IE(proto_tree *diuc_tree, const guint8 *bufptr, gint offset, gint length, tvbuff_t *tvb)
1525 /* DL-MAP Extended IE = 4 */
1526 /* 8.4.5.3.7 [1] CID_Switch_IE */
1527 /* offset of TLV in nibbles, length of TLV in nibbles */
1530 proto_item *ti = NULL;
1531 proto_tree *tree = NULL;
1535 INC_CID = INC_CID ? 0 : 1;
1537 ti = proto_tree_add_text(diuc_tree, tvb, NIBHI(offset, length), "CID_Switch_IE");
1538 proto_item_append_text(ti, " (INC_CID = %d)",INC_CID);
1539 tree = proto_item_add_subtree(ti, ett_282);
1541 XNIB(data, 1, "Extended DIUC");
1542 XNIB(data, 1, "Length");
1547 gint MIMO_DL_Basic_IE(proto_tree *diuc_tree, const guint8 *bufptr, gint offset, gint length, tvbuff_t *tvb)
1549 /* DL-MAP Extended IE = 5 */
1550 /* 8.4.5.3.8 MIMO_DL_Basic_IE (not implemented) */
1551 /* offset of TLV in nibbles, length of TLV in nibbles */
1554 proto_item *ti = NULL;
1555 proto_tree *tree = NULL;
1559 ti = proto_tree_add_text(diuc_tree, tvb, NIBHI(offset, length), "MIMO_DL_Basic_IE");
1560 tree = proto_item_add_subtree(ti, ett_283);
1562 XNIB(data, 1, "Extended-2 DIUC");
1563 XNIB(data, 2, "Length");
1564 proto_tree_add_text(diuc_tree, tvb, NIBHI(nib, length-2), "(not implemented)");
1568 gint MIMO_DL_Enhanced_IE(proto_tree *diuc_tree, const guint8 *bufptr, gint offset, gint length, tvbuff_t *tvb)
1570 /* DL-MAP Extended IE = 6 */
1571 /* 8.4.5.3.9 MIMO_DL_Enhanced_IE (not implemented) */
1572 /* offset of TLV in nibbles, length of TLV in nibbles */
1575 proto_item *ti = NULL;
1576 proto_tree *tree = NULL;
1580 ti = proto_tree_add_text(diuc_tree, tvb, NIBHI(offset, length), "MIMO_DL_Enhanced_IE");
1581 tree = proto_item_add_subtree(ti, ett_284);
1583 XNIB(data, 1, "Extended-2 DIUC");
1584 XNIB(data, 2, "Length");
1585 proto_tree_add_text(diuc_tree, tvb, NIBHI(nib, length-2), "(not implemented)");
1589 gint HARQ_Map_Pointer_IE(proto_tree *diuc_tree, const guint8 *bufptr, gint offset, gint length, tvbuff_t *tvb)
1591 /* DL-MAP Extended IE = 7 */
1592 /* 8.4.5.3.10 [2] HARQ_Map_Pointer_IE */
1593 /* offset of TLV in nibbles, length of TLV in nibbles */
1596 proto_item *ti = NULL;
1597 proto_tree *tree = NULL;
1598 gint length_in_bits, rep, map, diuc, slots, idle, sleep, mask_len;
1600 bit = NIB_TO_BIT(offset);
1602 ti = proto_tree_add_text(diuc_tree, tvb, NIBHI(offset, length), "HARQ_Map_Pointer_IE");
1603 tree = proto_item_add_subtree(ti, ett_285);
1605 XBIT(data, 4, "Extended DIUC");
1606 XBIT(data, 4, "Length");
1608 length_in_bits = NIB_TO_BIT(length-1);
1609 while (bit < length_in_bits) {
1610 XBIT(diuc, 4, "DIUC");
1611 XBIT(slots, 8, "No. Slots");
1612 XBIT(rep, 2, "Repetition Coding Indication");
1613 XBIT(map, 2, "Map Version");
1615 XBIT(idle, 1, "Idle users");
1616 XBIT(sleep, 1, "Sleep users");
1617 XBIT(mask_len, 2, "CID Mask Length");
1618 if (mask_len == 0) {
1620 proto_tree_add_text(diuc_tree, tvb, BITHI(bit,12), "CID Mask: 12 bits");
1622 } else if (mask_len == 1) {
1624 proto_tree_add_text(diuc_tree, tvb, BITHI(bit,20), "CID Mask: 20 bits");
1626 } else if (mask_len == 2) {
1628 proto_tree_add_text(diuc_tree, tvb, BITHI(bit,36), "CID Mask: 36 bits");
1630 } else if (mask_len == 3) {
1632 proto_tree_add_text(diuc_tree, tvb, BITHI(bit,52), "CID Mask: 52 bits");
1637 return BIT_TO_NIB(bit);
1640 gint PHYMOD_DL_IE(proto_tree *diuc_tree, const guint8 *bufptr, gint offset, gint length, tvbuff_t *tvb)
1642 /* DL-MAP Extended IE = 8 */
1643 /* 8.4.5.3.11 PHYMOD_DL_IE */
1644 /* offset of TLV in nibbles, length of TLV in nibbles */
1647 proto_item *ti = NULL;
1648 proto_tree *tree = NULL;
1651 bit = NIB_TO_BIT(offset);
1653 ti = proto_tree_add_text(diuc_tree, tvb, NIBHI(offset, length), "PHYMOD_DL_IE");
1654 tree = proto_item_add_subtree(ti, ett_286);
1656 XBIT(data, 4, "Extended DIUC");
1657 XBIT(data, 4, "Length");
1659 XBIT(pmt, 1, "Preamble Modifier Type");
1661 XBIT(data, 4, "Preamble frequency shift index");
1663 XBIT(data, 4, "Preamble Time Shift Index");
1665 XBIT(data, 1, "Pilot Pattern Modifier");
1666 XBIT(data, 2, "Pilot Pattern Index");
1668 return BIT_TO_NIB(bit);
1671 gint Broadcast_Control_Pointer_IE(proto_tree *diuc_tree, const guint8 *bufptr, gint offset, gint length, tvbuff_t *tvb)
1673 /* DL-MAP Extended IE = 0xA */
1674 /* 8.4.5.3.25 Broadcast Control Pointer IE */
1675 /* offset of TLV in nibbles, length of TLV in nibbles */
1678 proto_item *ti = NULL;
1679 proto_tree *tree = NULL;
1682 bit = NIB_TO_BIT(offset);
1684 ti = proto_tree_add_text(diuc_tree, tvb, NIBHI(offset, length), "Broadcast Control Pointer IE");
1685 tree = proto_item_add_subtree(ti, ett_286x);
1687 XBIT(data, 4, "Extended DIUC");
1688 XBIT(data, 4, "Length");
1690 XBIT(data, 7, "DCD_UCD Transmission Frame");
1691 XBIT(skip, 1, "Skip Broadcast_System_Update");
1693 XBIT(data, 1, "Broadcast_System_Update_Type");
1694 XBIT(data, 7, "Broadcast_System_Update_Transmission_Frame");
1696 return BIT_TO_NIB(bit);
1699 gint DL_PUSC_Burst_Allocation_in_Other_Segment_IE(proto_tree *diuc_tree, const guint8 *bufptr, gint offset, gint length, tvbuff_t *tvb)
1701 /* DL-MAP Extended IE = 0xB */
1702 /* 8.4.5.3.13 DL PUSC Burst Allocation in Other Segment IE */
1703 /* offset of TLV in nibbles, length of TLV in nibbles */
1706 proto_item *ti = NULL;
1707 proto_tree *tree = NULL;
1709 bit = NIB_TO_BIT(offset);
1711 ti = proto_tree_add_text(diuc_tree, tvb, NIBHI(offset, length), "DL_PUSC_Burst_Allocation_in_Other_Segment_IE");
1712 tree = proto_item_add_subtree(ti, ett_286b);
1714 XBIT(data, 4, "Extended DIUC");
1715 XBIT(data, 4, "Length");
1717 XBIT(data, 16, "CID");
1718 XBIT(data, 4, "DIUC");
1719 XBIT(data, 2, "Segment");
1720 XBIT(data, 3, "Boosting");
1721 XBIT(data, 5, "IDcell");
1722 XBIT(data, 5, "DL_PermBase");
1723 XBIT(data, 2, "PRBS_ID");
1724 XBIT(data, 2, "Repetition coding indication");
1725 XBIT(data, 6, "Used Subchannels");
1726 XBIT(data, 8, "OFDMA symbol offset");
1727 XBIT(data, 1, "Reserved");
1728 XBIT(data, 7, "# OFDMA symbols");
1729 XBIT(data, 6, "Subchannel offset");
1730 XBIT(data, 6, "# subchannels");
1731 XBIT(data, 7, "Reserved");
1732 return BIT_TO_NIB(bit);
1735 gint PUSC_ASCA_Alloc_IE(proto_tree *diuc_tree, const guint8 *bufptr, gint offset, gint length, tvbuff_t *tvb)
1737 /* DL-MAP Extended IE = 0xC */
1738 /* 8.4.5.3.27 PUSC_ASCA_Alloc_IE */
1739 /* offset of TLV in nibbles, length of TLV in nibbles */
1742 proto_item *ti = NULL;
1743 proto_tree *tree = NULL;
1745 bit = NIB_TO_BIT(offset);
1747 ti = proto_tree_add_text(diuc_tree, tvb, NIBHI(offset, length), "PUSC_ASCA_Alloc_IE");
1748 tree = proto_item_add_subtree(ti, ett_286z);
1750 XBIT(data, 4, "Extended DIUC");
1751 XBIT(data, 4, "Length");
1752 XBIT(data, 4, "DIUC");
1753 XBIT(data, 12, "Short Basic CID");
1754 XBIT(data, 8, "OFDMA Symbol offset");
1755 XBIT(data, 6, "Subchannel offset");
1756 XBIT(data, 7, "# OFDMA Symbols");
1757 XBIT(data, 6, "# Symbols");
1758 XBIT(data, 2, "Repetition Coding Information");
1759 XBIT(data, 4, "Permutation ID");
1760 XBIT(data, 7, "Reserved");
1762 return BIT_TO_NIB(bit);
1765 gint UL_interference_and_noise_level_IE(proto_tree *diuc_tree, const guint8 *bufptr, gint offset, gint length, tvbuff_t *tvb)
1767 /* DL-MAP Extended IE = 0xF */
1768 /* 8.4.5.3.19 UL_interference_and_noise_level_IE */
1769 /* offset of TLV in nibbles, length of TLV in nibbles */
1772 proto_item *ti = NULL;
1773 proto_tree *tree = NULL;
1778 ti = proto_tree_add_text(diuc_tree, tvb, NIBHI(offset, length), "UL_interference_and_noise_level_IE");
1779 tree = proto_item_add_subtree(ti, ett_286h);
1781 XNIB(data, 1, "Extended DIUC");
1782 XNIB(data, 1, "Length");
1784 XNIB(bitmap, 2, "Bitmap");
1786 if (bitmap & 0x01) {
1787 XNIB(data, 2, "CQI/ACK/Periodic Ranging region NI");
1789 if (bitmap & 0x02) {
1790 XNIB(data, 2, "PUSC region NI");
1792 if (bitmap & 0x04) {
1793 XNIB(data, 2, "Optional PUSC region NI");
1795 if (bitmap & 0x08) {
1796 XNIB(data, 2, "AMC region NI");
1798 if (bitmap & 0x10) {
1799 XNIB(data, 2, "AAS region NI");
1801 if (bitmap & 0x20) {
1802 XNIB(data, 2, "Periodic Ranging region NI");
1804 if (bitmap & 0x40) {
1805 XNIB(data, 2, "Sounding region NI");
1807 if (bitmap & 0x80) {
1808 XNIB(data, 2, "MIMO region NI");
1814 /********************************************************************
1816 *******************************************************************/
1818 extern gint wimax_decode_ulmapc(proto_tree *base_tree, const guint8 *bufptr, gint offset, gint length, tvbuff_t *tvb);
1821 gint dissect_dlmap_ie(proto_tree *ie_tree, const guint8 *bufptr, gint offset, gint length, tvbuff_t *tvb)
1823 /* decode a single DL-MAP IE and return the
1824 * length of the IE in nibbles
1825 * offset = start of IE (nibbles)
1826 * length = total length of bufptr (nibbles) */
1827 proto_item *ti = NULL;
1828 proto_tree *tree = NULL;
1830 gint nibble = offset;
1836 gint alt_format = 0;
1844 /* 8.4.5.3 DL-MAP IE format - table 275 */
1845 diuc = NIB_NIBBLE(nibble, bufptr);
1848 /* 8.4.5.3.2.2 [2] Extended-2 DIUC dependent IE table 277b */
1849 ext2_diuc = NIB_NIBBLE(1+nibble, bufptr);
1850 len = NIB_BYTE(1+nibble+1, bufptr);
1852 ti = proto_tree_add_uint(ie_tree, hf_dlmap_ie_diuc, tvb, NIBHI(nibble, 1+3+len*2), diuc);
1853 proto_item_append_text(ti, " (Extended-2)");
1854 tree = proto_item_add_subtree(ti, ett_277b);
1857 len = 3 + BYTE_TO_NIB(len);
1859 /* table 277c [2] */
1863 /* 8.4.5.3.12 MBS_MAP_IE */
1864 nibble = MBS_MAP_IE(tree, bufptr, nibble, len, tvb);
1867 /* 8.4.5.3.14 HO_Anchor_Active_DL-MAP_IE */
1868 nibble = HO_Anchor_Active_DL_MAP_IE(tree, bufptr, nibble, len, tvb);
1871 /* 8.4.5.3.15 HO_Active_Anchor_DL_MAP_IE */
1872 nibble = HO_Active_Anchor_DL_MAP_IE(tree, bufptr, nibble, len, tvb);
1875 /* 8.4.5.3.16 HO_CID_Translation_MAP_IE */
1876 nibble = HO_CID_Translation_MAP_IE(tree, bufptr, nibble, len, tvb);
1879 /* 8.4.5.3.17 MIMO_in_another_BS_IE */
1880 nibble = MIMO_in_another_BS_IE(tree, bufptr, nibble, len, tvb);
1883 /* 8.4.5.3.18 Macro-MIMO_DL_Basic_IE */
1884 nibble = Macro_MIMO_DL_Basic_IE(tree, bufptr, nibble, len, tvb);
1887 /* 8.4.5.3.20.2 Skip_IE */
1888 nibble = Skip_IE(tree, bufptr, nibble, len, tvb);
1891 /* 8.4.5.3.21 HARQ_DL_MAP_IE */
1892 nibble = HARQ_DL_MAP_IE(tree, bufptr, nibble, len, tvb);
1895 /* 8.4.5.3.22 HARQ_ACK IE */
1896 nibble = HARQ_ACK_IE(tree, bufptr, nibble, len, tvb);
1899 /* 8.4.5.3.23 Enhanced DL MAP IE */
1900 nibble = Enhanced_DL_MAP_IE(tree, bufptr, nibble, len, tvb);
1903 /* 8.4.5.3.24 Closed-loop MIMO DL Enhanced IE */
1904 nibble = Closed_loop_MIMO_DL_Enhanced_IE(tree, bufptr, nibble, len, tvb);
1907 nibble = MIMO_DL_Basic_IE(tree, bufptr, nibble, len, tvb);
1910 nibble = MIMO_DL_Enhanced_IE(tree, bufptr, nibble, len, tvb);
1914 nibble = AAS_SDMA_DL_IE(tree, bufptr, nibble, len, tvb);
1918 proto_tree_add_text(tree, tvb, NIBHI(nibble,len), "(reserved Extended-2 DIUC: %d)", ext2_diuc);
1924 else if (diuc == 15)
1926 /* 8.4.5.3.2.1 [1] Extended DIUC dependent IE - table 277 */
1927 ext_diuc = NIB_NIBBLE(1+nibble, bufptr);
1928 len = NIB_NIBBLE(1+nibble+1, bufptr);
1930 ti = proto_tree_add_uint(ie_tree, hf_dlmap_ie_diuc, tvb, NIBHI(nibble, 1+2+len*2), diuc);
1931 proto_item_append_text(ti, " (Extended)");
1932 tree = proto_item_add_subtree(ti, ett_277);
1935 len = 2 + BYTE_TO_NIB(len);
1937 /* TODO 8.4.5.3.27 PUSC_ASCA_IE -- unspecified ExtDIUC? */
1939 /* 8.4.5.3.2.1 table 277a */
1943 /* 8.4.5.3.? Channel_Measurement_IE */
1944 nibble = Channel_Measurement_IE(tree, bufptr, nibble, len, tvb);
1947 /* 8.4.5.3.4 STC_Zone_IE */
1948 nibble = STC_Zone_IE(tree, bufptr, nibble, len, tvb);
1951 /* 8.4.5.3.3 AAS_DL_IE */
1952 nibble = AAS_DL_IE(tree, bufptr, nibble, len, tvb);
1955 /* 8.4.5.3.6 Data_location_in_another_BS_IE */
1956 nibble = Data_location_in_another_BS_IE(tree, bufptr, nibble, len, tvb);
1959 /* 8.4.5.3.7 CID_Switch_IE */
1960 nibble = CID_Switch_IE(tree, bufptr, nibble, len, tvb);
1963 /* 8.4.5.3.10 HARQ_Map_Pointer_IE */
1964 nibble = HARQ_Map_Pointer_IE(tree, bufptr, nibble, len, tvb);
1967 /* 8.4.5.3.11 PHYMOD_DL_IE */
1968 nibble = PHYMOD_DL_IE(tree, bufptr, nibble, len, tvb);
1972 /* 8.4.5.3.13 DL PUSC Burst Allocation in Other Segment IE */
1973 nibble = DL_PUSC_Burst_Allocation_in_Other_Segment_IE(tree, bufptr, nibble, len, tvb);
1976 nibble = PUSC_ASCA_Alloc_IE(tree, bufptr, nibble, len, tvb);
1980 /* 8.4.5.3.19 UL_interference_and_noise_level_IE */
1981 nibble = UL_interference_and_noise_level_IE(tree, bufptr, nibble, len, tvb);
1985 proto_tree_add_text(tree, tvb, NIBHI(nibble,len), "(reserved Extended DIUC: %d)", ext_diuc);
1994 /*papr = 0; XX: not used ? */
1997 /* TODO: alt_format = 1 if (Permutation == 0x11) and (AMC type is 2x3 or 1x6) */
1999 /* precalculate IE len for correct highlighting */
2000 if (INC_CID && !sub_dl_ul_map) {
2001 ie_len += 2 + (NIB_BYTE(nibble+1, bufptr) * 4);
2005 ti = proto_tree_add_uint(ie_tree, hf_dlmap_ie_diuc, tvb, NIBHI(nibble, ie_len), diuc);
2006 tree = proto_item_add_subtree(ti, ett_275_1);
2010 /* 8.4.5.3.1 [1] Gap/PAPR Reduction */
2011 /*papr = 1; XX: not used ? */
2012 proto_item_append_text(ti, " (Gap/PAPR Reduction)");
2018 n_cid = NIB_BYTE(nibble, bufptr);
2019 proto_tree_add_uint(tree, hf_dlmap_ie_ncid, tvb, NIBHI(nibble, 2), n_cid);
2022 for (i = 0; i < n_cid; i++)
2024 if (sub_dl_ul_map) {
2025 /* RCID_IE 8.4.5.3 and 8.4.5.3.20.1, only part of SUB-DL-UL-MAP */
2026 /* RCID_Type comes from 6.3.2.3.43.2 [2] Format_configuration_IE in Compact_DL-MAP_IE */
2027 nibble += RCID_IE(tree, bufptr, nibble*4, length, tvb, RCID_Type) / 4;
2029 data = NIB_WORD(nibble, bufptr);
2030 proto_tree_add_uint(tree, hf_dlmap_ie_cid, tvb, NIBHI(nibble, 4), data);
2036 data = NIB_LONG(nibble, bufptr);
2038 proto_tree_add_uint(tree, hf_dlmap_ie_offsym2, tvb, NIBHI(nibble, 8), data);
2039 proto_tree_add_uint(tree, hf_dlmap_ie_offsub2, tvb, NIBHI(nibble, 8), data);
2040 proto_tree_add_uint(tree, hf_dlmap_ie_boosting2, tvb, NIBHI(nibble, 8), data);
2041 proto_tree_add_uint(tree, hf_dlmap_ie_numsym2, tvb, NIBHI(nibble, 8), data);
2042 proto_tree_add_uint(tree, hf_dlmap_ie_numsub2, tvb, NIBHI(nibble, 8), data);
2043 proto_tree_add_uint(tree, hf_dlmap_ie_rep2, tvb, NIBHI(nibble, 8), data);
2045 proto_tree_add_uint(tree, hf_dlmap_ie_offsym, tvb, NIBHI(nibble, 8), data);
2046 proto_tree_add_uint(tree, hf_dlmap_ie_offsub, tvb, NIBHI(nibble, 8), data);
2047 proto_tree_add_uint(tree, hf_dlmap_ie_boosting, tvb, NIBHI(nibble, 8), data);
2048 proto_tree_add_uint(tree, hf_dlmap_ie_numsym, tvb, NIBHI(nibble, 8), data);
2049 proto_tree_add_uint(tree, hf_dlmap_ie_numsub, tvb, NIBHI(nibble, 8), data);
2050 proto_tree_add_uint(tree, hf_dlmap_ie_rep, tvb, NIBHI(nibble, 8), data);
2055 /* length in nibbles */
2056 return (nibble - offset);
2060 void dissect_mac_mgmt_msg_dlmap_decoder(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *base_tree)
2062 /* 6.3.2.3.2 [2] DL-MAP table 16 */
2064 gint length, nib, pad;
2065 proto_item *ti = NULL;
2066 proto_tree *dlmap_tree = NULL;
2067 proto_tree *ie_tree = NULL;
2068 proto_tree *phy_tree = NULL;
2069 gint tvb_len = tvb_reported_length(tvb);
2070 /* XXX This should be removed, and regular tvb accessors should be used instead. */
2071 const guint8 *bufptr = tvb_get_ptr(tvb, offset, tvb_len);
2076 ti = proto_tree_add_protocol_format(base_tree, proto_mac_mgmt_msg_dlmap_decoder, tvb, offset, tvb_len, "DL-MAP (%u bytes)", tvb_len);
2077 dlmap_tree = proto_item_add_subtree(ti, ett_dlmap);
2079 /* Decode and display the DL-MAP */
2080 proto_tree_add_item(dlmap_tree, hf_dlmap_message_type, tvb, offset, 1, ENC_BIG_ENDIAN);
2082 /* PHY Synchronization Field 8.4.5.1 */
2084 ti = proto_tree_add_text(dlmap_tree, tvb, offset, 4, "Phy Synchronization Field");
2085 phy_tree = proto_item_add_subtree(ti, ett_275_phy);
2086 proto_tree_add_item(phy_tree, hf_dlmap_phy_fdur_ms, tvb, offset, 1, ENC_BIG_ENDIAN);
2087 proto_tree_add_item(phy_tree, hf_dlmap_phy_fdur_per_sec, tvb, offset, 1, ENC_BIG_ENDIAN);
2088 proto_tree_add_item(phy_tree, hf_dlmap_phy_fdur, tvb, offset, 1, ENC_BIG_ENDIAN);
2090 proto_tree_add_item(phy_tree, hf_dlmap_phy_fnum, tvb, offset, 3, ENC_BIG_ENDIAN);
2093 proto_tree_add_item(dlmap_tree, hf_dlmap_dcd, tvb, offset, 1, ENC_BIG_ENDIAN);
2095 proto_tree_add_item(dlmap_tree, hf_dlmap_bsid, tvb, offset, 6, ENC_NA);
2097 proto_tree_add_item(dlmap_tree, hf_dlmap_ofdma_sym, tvb, offset, 1, ENC_BIG_ENDIAN);
2101 length = tvb_len - offset; /* remaining length in bytes */
2102 ti = proto_tree_add_text(dlmap_tree, tvb, offset, length, "DL-MAP IEs (%d bytes)", length);
2103 ie_tree = proto_item_add_subtree(ti, ett_dlmap_ie);
2105 /* length = BYTE_TO_NIB(length); */ /* convert length to nibbles */
2107 nib = BYTE_TO_NIB(offset);
2108 while (nib < ((tvb_len*2)-1)) {
2109 nib += dissect_dlmap_ie(ie_tree, bufptr, nib, tvb_len * 2, tvb);
2111 pad = NIB_PADDING(nib);
2113 proto_tree_add_text(dlmap_tree, tvb, NIBHI(nib,1), "Padding nibble");
2118 gint wimax_decode_dlmapc(tvbuff_t *tvb, packet_info *pinfo, proto_tree *base_tree)
2120 /* 8.4.5.6.1 [2] Compressed DL-MAP */
2121 /* decode a compressed dl-map and return the length in bytes; */
2122 /* if there is a compressed ul-map, also decode that and include in the length */
2124 proto_item *ti = NULL;
2125 proto_item *ti_phy = NULL;
2126 proto_item *ti_dlmap_ies = NULL;
2127 proto_item *generic_item = NULL;
2128 proto_tree *tree = NULL;
2129 proto_tree *ie_tree = NULL;
2130 proto_tree *phy_tree = NULL;
2131 gint ulmap_appended;
2132 guint length, lennib, pad;
2133 guint mac_len, dl_ie_count;
2134 guint tvb_len = tvb_reported_length(tvb);
2135 /* XXX This should be removed, and regular tvb accessors should be used instead. */
2136 const guint8 * bufptr = tvb_get_ptr(tvb, offset, tvb_len);
2138 guint32 mac_crc, calculated_crc;
2140 /* update the info column */
2141 col_append_sep_str(pinfo->cinfo, COL_INFO, NULL, "Compressed DL-MAP");
2145 length = tvb_get_ntohs(tvb, offset) & 0x07FF; /* compressed map length is 11 bits */
2147 lennib = BYTE_TO_NIB(length);
2149 ulmap_appended = (tvb_get_guint8(tvb, offset) >> 4) & 1; /* UL MAP appended? */
2151 /* display MAC Compressed DL-MAP and create subtree */
2152 ti = proto_tree_add_protocol_format(base_tree, proto_mac_mgmt_msg_dlmap_decoder, tvb, offset, length, "Compressed DL-MAP (%u bytes)", length);
2153 tree = proto_item_add_subtree(ti, ett_305);
2155 /* decode dlmap fields */
2156 proto_tree_add_item(tree, hf_dlmapc_compr, tvb, offset, 2, ENC_BIG_ENDIAN);
2157 proto_tree_add_item(tree, hf_dlmapc_ulmap, tvb, offset, 2, ENC_BIG_ENDIAN);
2158 proto_tree_add_item(tree, hf_dlmapc_rsv, tvb, offset, 2, ENC_BIG_ENDIAN);
2159 proto_tree_add_item(tree, hf_dlmapc_len, tvb, offset, 2, ENC_BIG_ENDIAN);
2160 /* PHY Synchronization Field 8.4.5.1 */
2162 ti_phy = proto_tree_add_text(tree, tvb, offset+2, 4, "Phy Synchronization Field");
2163 phy_tree = proto_item_add_subtree(ti_phy, ett_275_phy);
2164 proto_tree_add_item(phy_tree, hf_dlmap_phy_fdur_ms, tvb, offset+2, 1, ENC_BIG_ENDIAN);
2165 proto_tree_add_item(phy_tree, hf_dlmap_phy_fdur_per_sec, tvb, offset+2, 1, ENC_BIG_ENDIAN);
2166 proto_tree_add_item(phy_tree, hf_dlmap_phy_fnum, tvb, offset+3, 3, ENC_BIG_ENDIAN);
2168 proto_tree_add_item(tree, hf_dlmap_dcd, tvb, offset+6, 1, ENC_BIG_ENDIAN);
2169 proto_tree_add_item(tree, hf_dlmapc_opid, tvb, offset+7, 1, ENC_BIG_ENDIAN);
2170 proto_tree_add_item(tree, hf_dlmapc_secid, tvb, offset+8, 1, ENC_BIG_ENDIAN);
2171 proto_tree_add_item(tree, hf_dlmap_ofdma_sym, tvb, offset+9, 1, ENC_BIG_ENDIAN); /* 2005 */
2172 proto_tree_add_item(tree, hf_dlmapc_count, tvb, offset+10,1, ENC_BIG_ENDIAN);
2173 dl_ie_count = tvb_get_guint8(tvb, offset + 10);
2175 nib = BYTE_TO_NIB(offset);
2178 length -= 15; /* remaining length in bytes (11 bytes above + CRC at end) */
2180 ti_dlmap_ies = proto_tree_add_text(tree, tvb, offset, length, "DL-MAP IEs (%d bytes)", length);
2181 ie_tree = proto_item_add_subtree(ti_dlmap_ies, ett_dlmap_ie);
2183 /* length = BYTE_TO_NIB(mac_len - sizeof(mac_crc) - 1); */ /* convert length to nibbles */
2185 while (dl_ie_count--) {
2186 nib += dissect_dlmap_ie(ie_tree, bufptr, nib, tvb_len * 2, tvb);
2188 pad = NIB_PADDING(nib);
2190 proto_tree_add_text(tree, tvb, NIBHI(nib,1), "Padding nibble");
2195 if (ulmap_appended) {
2196 /* Replace the text of items to set the correct length in bytes.*/
2197 proto_item_set_text(ti, "Compressed DL-MAP (%u bytes)", NIB_ADDR(nib));
2198 proto_item_set_text(ti_dlmap_ies, "DL-MAP IEs (%u bytes)",NIB_ADDR(nib)- offset);
2200 /* set the length of items */
2201 proto_item_set_end(ti_dlmap_ies, tvb, NIB_ADDR(nib));
2202 proto_item_set_end(ti, tvb, NIB_ADDR(nib));
2204 /* update the info column */
2205 col_append_sep_str(pinfo->cinfo, COL_INFO, NULL, "Compressed UL-MAP");
2207 /* subtract 8 from lennib (CRC) */
2208 wimax_decode_ulmapc(base_tree, bufptr, nib, lennib - 8, tvb);
2211 /* CRC is always appended */
2212 /* check the length */
2213 if (MIN(tvb_len, tvb_reported_length(tvb)) >= mac_len)
2215 mac_crc = tvb_get_ntohl(tvb, mac_len - sizeof(mac_crc));
2216 /* calculate the CRC */
2217 calculated_crc = wimax_mac_calc_crc32(tvb_get_ptr(tvb, 0, mac_len - sizeof(mac_crc)), mac_len - sizeof(mac_crc));
2218 /* display the CRC */
2219 generic_item = proto_tree_add_item(base_tree, hf_mac_header_compress_dlmap_crc, tvb, mac_len - sizeof(mac_crc), sizeof(mac_crc), ENC_BIG_ENDIAN);
2220 if (mac_crc != calculated_crc)
2222 proto_item_append_text(generic_item, " - incorrect! (should be: 0x%x)", calculated_crc);
2226 { /* display error message */
2227 proto_tree_add_protocol_format(base_tree, proto_mac_mgmt_msg_dlmap_decoder, tvb, 0, tvb_len, "CRC missing - the frame is too short (%u bytes)", tvb_len);
2233 extern gint dissect_ulmap_ie(proto_tree *ie_tree,
2234 const guint8 *bufptr, gint offset, gint length, tvbuff_t *tvb);
2235 extern gint wimax_decode_ulmap_reduced_aas(proto_tree *ie_tree,
2236 const guint8 *bufptr, gint offset, gint length, tvbuff_t *tvb);
2238 gint wimax_decode_sub_dl_ul_map(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *base_tree)
2240 /* decode a SUB-DL-UL-MAP message 6.3.2.3.60 and return the length in bytes */
2241 /* first three bits are 0x7, which following a compressed DL map indicates this message */
2243 proto_item *ti = NULL;
2244 proto_tree *tree = NULL;
2245 proto_tree *ie_tree = NULL;
2246 proto_item *generic_item = NULL;
2249 guint16 calculated_crc;
2251 gint length = tvb_reported_length(tvb);
2252 /* XXX This should be removed, and regular tvb accessors should be used instead. */
2253 const guint8 * bufptr = tvb_get_ptr(tvb, offset, length);
2255 gint lennib = BYTE_TO_NIB(length);
2257 sub_dl_ul_map = 1; /* set flag */
2259 ti = proto_tree_add_text(base_tree, tvb, NIBHI(nib,lennib-nib), "SUB-DL-UL-MAP");
2260 tree = proto_item_add_subtree(ti, ett_109x);
2262 data = NIB_WORD(nib,bufptr);
2263 proto_tree_add_uint(tree, hf_109x_cmi, tvb, NIBHI(nib,4), data);
2264 proto_tree_add_uint(tree, hf_109x_len, tvb, NIBHI(nib,4), data);
2265 proto_tree_add_uint(tree, hf_109x_rcid, tvb, NIBHI(nib,4), data);
2266 proto_tree_add_uint(tree, hf_109x_haoi, tvb, NIBHI(nib,4), data);
2269 /* HARQ ACK offset indicator */
2271 data = NIB_BYTE(nib,bufptr);
2272 proto_tree_add_uint(tree, hf_109x_dl, tvb, NIBHI(nib,2), data);
2274 data = NIB_BYTE(nib,bufptr);
2275 proto_tree_add_uint(tree, hf_109x_ul, tvb, NIBHI(nib,2), data);
2279 numie = NIB_BYTE(nib,bufptr);
2280 proto_tree_add_uint(tree, hf_109x_dlie, tvb, NIBHI(nib,2), numie);
2284 ti = proto_tree_add_text(tree, tvb, NIBHI(nib,1), "DL-MAP IEs");
2285 ie_tree = proto_item_add_subtree(ti, ett_109x_dl);
2286 for (i = 0; i < numie; i++) {
2287 nib += dissect_dlmap_ie(ie_tree, bufptr, nib, lennib - nib, tvb);
2290 data = NIB_BYTE(nib,bufptr);
2291 proto_tree_add_uint(tree, hf_109x_symofs, tvb, NIBHI(nib,2), data);
2293 data = NIB_BYTE(nib,bufptr);
2294 proto_tree_add_uint(tree, hf_109x_subofs, tvb, NIBHI(nib,2), data);
2295 proto_tree_add_uint(tree, hf_109x_rsv, tvb, NIBHI(nib,2), data);
2299 ti = proto_tree_add_text(tree, tvb, NIBHI(nib,lennib-nib), "UL-MAP IEs");
2300 ie_tree = proto_item_add_subtree(ti, ett_109x_ul);
2301 for ( ; nib < lennib - 1; ) {
2302 nib += dissect_ulmap_ie(ie_tree, bufptr, nib, lennib - nib, tvb);
2307 proto_tree_add_text(tree, tvb, NIBHI(nib,1), "Padding Nibble");
2311 /* CRC-16 is always appended */
2312 data = NIB_WORD(nib, bufptr);
2313 generic_item = proto_tree_add_text(tree, tvb, NIBHI(nib,4), "CRC-16: 0x%04x",data);
2314 /* calculate the CRC */
2315 calculated_crc = wimax_mac_calc_crc16(tvb_get_ptr(tvb, 0, NIB_TO_BYTE(nib)), NIB_TO_BYTE(nib));
2316 if (data != calculated_crc)
2318 proto_item_append_text(generic_item, " - incorrect! (should be: 0x%x)", calculated_crc);
2322 sub_dl_ul_map = 0; /* clear flag */
2327 gint wimax_decode_dlmap_reduced_aas(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *base_tree)
2329 /* 8.4.5.8.1 [2] Reduced AAS private DL-MAP */
2330 /* if there is an appended UL-MAP, also decode that */
2332 proto_item *ti = NULL;
2333 proto_tree *tree = NULL;
2334 proto_item *generic_item = NULL;
2335 gint ulmap_appended;
2337 gint tvb_len = tvb_reported_length(tvb);
2338 /* XXX This should be removed, and regular tvb accessors should be used instead. */
2339 const guint8 * bufptr = tvb_get_ptr(tvb, offset, tvb_len);
2341 guint data, pad, mult;
2344 guint16 calculated_crc;
2345 gint smcs,cidi,dcdi,phyi,cqci;
2349 /* display MAC Reduced_AAS_Private_DL-MAP and create subtree */
2350 ti = proto_tree_add_protocol_format(base_tree, proto_mac_mgmt_msg_dlmap_decoder, tvb, offset, length, "Reduced_AAS_Private_DL-MAP");
2351 tree = proto_item_add_subtree(ti, ett_308a);
2353 VBIT(data, 3, hf_308a_cmi);
2354 VBIT(ulmap_appended, 1, hf_308a_ulmap);
2355 VBIT(data, 2, hf_308a_type);
2356 VBIT(mult, 1, hf_308a_mult);
2357 VBIT(data, 1, hf_308a_rsv);
2360 XBIT(numie, 8, "NUM IE");
2363 for (i = 0; i < numie; i++) {
2364 XBIT(data, 2, "Periodicity");
2365 XBIT(cidi, 1, "CID Included");
2366 XBIT(dcdi, 1, "DCD Count Included");
2367 XBIT(phyi, 1, "PHY modification included");
2368 XBIT(cqci, 1, "CQICH control indicator");
2369 XBIT(data, 2, "Encoding Mode");
2370 XBIT(smcs, 1, "Separate MCS Enabled");
2373 XBIT(data,10, "Duration");
2374 XBIT(data, 4, "DIUC");
2375 XBIT(data, 2, "Repetition Coding Indication");
2378 XBIT(data,16, "CID");
2381 XBIT(data, 6, "Allocation Index");
2382 XBIT(data, 3, "Report Period");
2383 XBIT(data, 3, "Frame Offset");
2384 XBIT(data, 4, "Report Duration");
2385 XBIT(data, 2, "CQI Measurement Type");
2386 XBIT(data, 2, "Reserved");
2389 XBIT(data, 8, "DCD Count");
2392 XBIT(data, 1, "Preamble Select");
2393 XBIT(data, 4, "Preamble Shift Index");
2394 XBIT(data, 1, "Pilot Pattern Modifier");
2395 XBIT(data, 2, "Pilot Pattern Index");
2397 XBIT(data, 3, "DL Frame Offset");
2399 XBIT(data, 8, "Zone Symbol Offset");
2401 XBIT(data, 8, "OFDMA Symbol Offset");
2403 XBIT(data, 8, "Subchannel Offset");
2404 XBIT(data, 5, "No. OFDMA triple symbol");
2405 XBIT(data, 6, "No. subchannels");
2407 XBIT(data, 6, "Subchannel Offset");
2408 XBIT(data, 7, "No. OFDMA symbols");
2409 XBIT(data, 6, "No. subchannels");
2411 XBIT(data, 4, "DIUC/N(EP)");
2413 XBIT(data, 1, "DL HARQ ACK bitmap");
2414 XBIT(data, 6, "ACK Allocation Index");
2415 XBIT(data, 4, "ACID");
2416 XBIT(data, 1, "AI_SN");
2418 XBIT(data, 4, "N(SCH)");
2419 XBIT(data, 2, "SPID");
2420 XBIT(data, 2, "Reserved");
2423 XBIT(data, 2, "Repetition Coding Indication");
2424 if (ulmap_appended) {
2425 /* offset and length are in bits */
2426 bit += wimax_decode_ulmap_reduced_aas(tree, bufptr, offset, length*8, tvb);
2428 XBIT(data, 3, "Reserved");
2432 pad = BIT_PADDING(bit,8);
2434 proto_tree_add_text(tree, tvb, BITHI(bit,pad), "Padding: %d bits",pad);
2438 /* CRC-16 is always appended */
2439 data = BIT_BITS(bit, bufptr, 16);
2440 generic_item = proto_tree_add_text(tree, tvb, BITHI(bit,16), "CRC-16: 0x%04x",data);
2441 /* calculate the CRC */
2442 calculated_crc = wimax_mac_calc_crc16(tvb_get_ptr(tvb, 0, BIT_TO_BYTE(bit)), BIT_TO_BYTE(bit));
2443 if (data != calculated_crc)
2445 proto_item_append_text(generic_item, " - incorrect! (should be: 0x%x)", calculated_crc);
2449 return BIT_TO_BYTE(bit) - offset;
2452 /* Register Wimax Mac Payload Protocol and Dissector */
2453 void proto_register_mac_mgmt_msg_dlmap(void)
2455 /* DL-MAP fields display */
2456 static hf_register_info hf[] =
2459 &hf_dlmap_message_type,
2461 "MAC Management Message Type", "wmx.macmgtmsgtype.dlmap",
2462 FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL
2468 "Base Station ID", "wmx.dlmap.bsid",
2469 FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL
2475 "DCD Count", "wmx.dlmap.dcd",
2476 FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL
2480 &hf_dlmap_fch_expected,
2482 "FCH Expected", "wmx.dlmap.fch_expected",
2483 FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL
2489 "DL-MAP IE", "wmx.dlmap.ie",
2490 FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL
2494 &hf_dlmap_ie_boosting,
2496 "Boosting", "wmx.dlmap.ie.boosting",
2497 FT_UINT32, BASE_DEC, VALS(boost_msgs), 0x00038000, NULL, HFILL
2501 &hf_dlmap_ie_boosting2,
2503 "Boosting", "wmx.dlmap.ie.boosting",
2504 FT_UINT32, BASE_DEC, VALS(boost_msgs), 0x0000E000, NULL, HFILL
2510 "CID", "wmx.dlmap.ie.cid",
2511 FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL
2517 "DIUC", "wmx.dlmap.ie.diuc",
2518 FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL
2524 "N_CID", "wmx.dlmap.ie.ncid",
2525 FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL
2529 &hf_dlmap_ie_numsub,
2531 "Number of Subchannels", "wmx.dlmap.ie.numsub",
2532 FT_UINT32, BASE_DEC, NULL, 0x000000FC, NULL, HFILL
2536 &hf_dlmap_ie_numsym,
2538 "Number of OFDMA Symbols", "wmx.dlmap.ie.numsym",
2539 FT_UINT32, BASE_DEC, NULL, 0x00007F00, NULL, HFILL
2543 &hf_dlmap_ie_numsub2,
2545 "Number of Subchannels", "wmx.dlmap.ie.numsub",
2546 FT_UINT32, BASE_DEC, NULL, 0x000000FC, NULL, HFILL
2550 &hf_dlmap_ie_numsym2,
2552 "Number of OFDMA Symbols", "wmx.dlmap.ie.numsym",
2553 FT_UINT32, BASE_DEC, NULL, 0x00001F00, NULL, HFILL
2557 &hf_dlmap_ie_offsub,
2559 "Subchannel Offset", "wmx.dlmap.ie.offsub",
2560 FT_UINT32, BASE_DEC, NULL, 0x00FC0000, NULL, HFILL
2564 &hf_dlmap_ie_offsym,
2566 "OFDMA Symbol Offset", "wmx.dlmap.ie.offsym",
2567 FT_UINT32, BASE_DEC, NULL, 0xFF000000, NULL, HFILL
2572 &hf_dlmap_ie_offsub2,
2574 "Subchannel Offset", "wmx.dlmap.ie.offsub",
2575 FT_UINT32, BASE_DEC, NULL, 0x00FF0000, NULL, HFILL
2579 &hf_dlmap_ie_offsym2,
2581 "OFDMA Symbol Offset", "wmx.dlmap.ie.offsym",
2582 FT_UINT32, BASE_DEC, NULL, 0xFF000000, NULL, HFILL
2588 "Repetition Coding Indication", "wmx.dlmap.ie.rep",
2589 FT_UINT32, BASE_DEC, VALS(rep_msgs), 0x00000003, NULL, HFILL
2595 "Repetition Coding Indication", "wmx.dlmap.ie.rep",
2596 FT_UINT32, BASE_DEC, VALS(rep_msgs), 0x00000003, NULL, HFILL
2600 &hf_dlmap_ofdma_sym,
2602 "Num OFDMA Symbols", "wmx.dlmap.ofdma_sym",
2603 FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL
2609 "Frame Duration Code", "wmx.dlmap.phy_fdur",
2610 FT_UINT8, BASE_HEX, NULL, 0x00, NULL, HFILL
2614 &hf_dlmap_phy_fdur_ms,
2616 "Frame Duration", "wmx.dlmap.phy_fdur",
2617 FT_UINT8, BASE_HEX, VALS(frame_duration), 0x00, NULL, HFILL
2621 &hf_dlmap_phy_fdur_per_sec,
2623 "Frames per second", "wmx.dlmap.phy_fdur",
2624 FT_UINT8, BASE_HEX, VALS(frames_per_second), 0x00, NULL, HFILL
2630 "Frame Number", "wmx.dlmap.phy_fnum",
2631 FT_UINT24, BASE_DEC, NULL, 0x0, NULL, HFILL
2637 "Compressed map indicator", "wmx.dlmapc.compr",
2638 FT_UINT16, BASE_DEC, NULL, 0xe000, NULL, HFILL
2644 "DL IE Count", "wmx.dlmapc.count",
2645 FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL
2651 "Map message length", "wmx.dlmapc.len",
2652 FT_UINT16, BASE_DEC, NULL, 0x07FF, NULL, HFILL
2658 "Operator ID", "wmx.dlmapc.opid",
2659 FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL
2665 "Reserved", "wmx.dlmapc.rsv",
2666 FT_UINT16, BASE_DEC, NULL, 0x0800, NULL, HFILL
2672 "Sector ID", "wmx.dlmapc.secid",
2673 FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL
2679 "PHY Synchronization Field", "wmx.dlmapc.sync",
2680 FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL
2686 "UL-MAP appended", "wmx.dlmapc.ulmap",
2687 FT_UINT16, BASE_DEC, NULL, 0x1000, NULL, HFILL
2693 "Extended DIUC", "wmx.dlmapc.xie_diuc",
2694 FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL
2700 "Length", "wmx.dlmapc.xie_len",
2701 FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL
2707 "SUB-DL-UL-MAP map indicator", "wmx.dlul.cmi",
2708 FT_UINT16, BASE_DEC, NULL, 0xE000, NULL, HFILL
2714 "DL HARQ ACK offset", "wmx.dlul.dl",
2715 FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL
2721 "DL IE Count", "wmx.dlul.dlie",
2722 FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL
2728 "HARQ ACK offset indicator", "wmx.dlul.haoi",
2729 FT_UINT16, BASE_DEC, NULL, 0x0001, NULL, HFILL
2735 "Map message length - The length is limited to 735 bytes at most", "wmx.dlul.len",
2736 FT_UINT16, BASE_DEC, NULL, 0x1FF8, NULL, HFILL
2742 "RCID_Type", "wmx.dlul.rcid",
2743 FT_UINT16, BASE_DEC, NULL, 0x0006, NULL, HFILL
2749 "Subchannel offset", "wmx.dlul.subofs",
2750 FT_UINT8, BASE_DEC, NULL, 0xFE, NULL, HFILL
2756 "OFDMA Symbol offset of subsequent sub-bursts "
2757 "in this Sub-DL-UL-MAP message with reference to "
2758 "the start of UL sub-frame.", "wmx.dlul.symofs",
2759 FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL
2765 "Reserved", "wmx.dlul.rsv",
2766 FT_UINT8, BASE_DEC, NULL, 0x01, NULL, HFILL
2772 "UL HARQ ACK offset", "wmx.dlul.ul",
2773 FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL
2779 "Compressed map indicator", "wmx.dlmap.reduced_aas_private.cmi",
2780 FT_UINT8, BASE_DEC, NULL, 0xe0, NULL, HFILL
2786 "Multiple IE", "wmx.dlmap.reduced_aas_private.mult",
2787 FT_UINT8, BASE_DEC, NULL, 0x02, NULL, HFILL
2793 "Reserved", "wmx.dlmap.reduced_aas_private.rsv",
2794 FT_UINT8, BASE_DEC, NULL, 0x01, NULL, HFILL
2800 "Compressed Map Type", "wmx.dlmap.reduced_aas_private.type",
2801 FT_UINT8, BASE_DEC, NULL, 0x0d, NULL, HFILL
2807 "UL-MAP appended", "wmx.dlmap.reduced_aas_private.ulmap",
2808 FT_UINT8, BASE_DEC, NULL, 0x10, NULL, HFILL
2812 &hf_mac_header_compress_dlmap_crc,
2814 "CRC", "wmx.compress_dlmap_crc",
2815 FT_UINT32, BASE_HEX, NULL, 0x0, NULL, HFILL
2820 /* Setup protocol subtree array */
2821 static gint *ett[] =
2825 /* &ett_dlmap_c_ie, */
2873 proto_mac_mgmt_msg_dlmap_decoder = proto_register_protocol (
2874 "WiMax DLMAP/ULMAP Messages", /* name */
2875 "WiMax DLMAP/ULMAP (map)", /* short name */
2876 "wmx.map" /* abbrev */
2879 proto_register_field_array(proto_mac_mgmt_msg_dlmap_decoder, hf, array_length(hf));
2880 proto_register_subtree_array(ett, array_length(ett));