More bitfield fixes.
[metze/wireshark/wip.git] / epan / dissectors / packet-ieee80211.c
index 2d5c22f2d1a608925acf0c967aefdfd74cc2916b..449ce07646eb91fb7ba63c5dd708334b625f9327 100644 (file)
@@ -4639,6 +4639,11 @@ static int hf_ieee80211_vs_extreme_unknown = -1;
 static int hf_ieee80211_vs_extreme_ap_length = -1;
 static int hf_ieee80211_vs_extreme_ap_name = -1;
 
+static int hf_ieee80211_vs_aerohive_unknown = -1;
+static int hf_ieee80211_vs_aerohive_hostname_length = -1;
+static int hf_ieee80211_vs_aerohive_hostname = -1;
+static int hf_ieee80211_vs_aerohive_data = -1;
+
 static int hf_ieee80211_rsn_ie_pmkid = -1;
 static int hf_ieee80211_rsn_ie_unknown = -1;
 
@@ -5792,6 +5797,8 @@ is_broadcast_bssid(const address *bssid) {
   return addresses_equal(&bssid_broadcast, bssid);
 }
 
+static heur_dissector_list_t heur_subdissector_list;
+
 static dissector_handle_t ieee80211_handle;
 static dissector_handle_t wlan_withoutfcs_handle;
 static dissector_handle_t llc_handle;
@@ -12748,6 +12755,53 @@ dissect_vendor_ie_mikrotik(proto_item *item _U_, proto_tree *ietree,
   }
 }
 
+#define AEROHIVE_HOSTNAME 33
+static const value_string ieee80211_vs_aerohive_type_vals[] = {
+  { AEROHIVE_HOSTNAME, "Host Name"},
+  { 0,                 NULL }
+};
+static void
+dissect_vendor_ie_aerohive(proto_item *item _U_, proto_tree *ietree,
+                          tvbuff_t *tvb, int offset, guint32 tag_len, packet_info *pinfo)
+{
+  guint32 type, length;
+  const guint8* hostname;
+  proto_item *ti_len;
+
+  /* VS OUI Type */
+  type = tvb_get_guint8(tvb, offset);
+  offset += 1;
+  tag_len -= 1;
+
+  switch(type){
+    case AEROHIVE_HOSTNAME: /* Unknown (2 bytes) + Host Name Length (1 byte) + Host Name */
+
+      proto_item_append_text(item, ": %s", val_to_str_const(type, ieee80211_vs_aerohive_type_vals, "Unknown"));
+
+      proto_tree_add_item(ietree, hf_ieee80211_vs_aerohive_unknown, tvb, offset, 2, ENC_NA);
+      offset += 2;
+      tag_len -= 2;
+
+      ti_len = proto_tree_add_item_ret_uint(ietree, hf_ieee80211_vs_aerohive_hostname_length, tvb, offset, 1, ENC_NA, &length);
+      offset += 1;
+      tag_len -= 1;
+
+      if (tag_len < length) {
+        expert_add_info_format(pinfo, ti_len, &ei_ieee80211_tag_length, "Tag length < Host Name Length");
+        length = tag_len;
+      }
+
+      proto_tree_add_item_ret_string(ietree, hf_ieee80211_vs_aerohive_hostname, tvb, offset, length, ENC_ASCII|ENC_NA, wmem_packet_scope(), &hostname);
+      proto_item_append_text(item, " (%s)", hostname);
+
+    break;
+
+    default:
+      proto_tree_add_item(ietree, hf_ieee80211_vs_aerohive_data, tvb, offset, tag_len, ENC_NA);
+    break;
+  }
+}
+
 enum vs_nintendo_type {
   NINTENDO_SERVICES = 0x11,
   NINTENDO_CONSOLEID = 0xF0
@@ -15484,19 +15538,19 @@ dissect_a_control_umrs(proto_tree *tree, tvbuff_t *tvb, int offset,
    */
   umrs_tree = proto_tree_add_subtree_format(tree, tvb, offset, 4,
                                 ett_ieee80211_umrs_control,
-                                NULL, "UMRS Control: 0x%0x", the_bits);
+                                NULL, "UMRS Control: 0x%08x", the_bits);
 
-  proto_tree_add_bits_item(umrs_tree, hf_ieee80211_he_umrs_he_tb_ppdu_len, tvb,
+  proto_tree_add_uint(umrs_tree, hf_ieee80211_he_umrs_he_tb_ppdu_len, tvb,
                         offset, 4, the_bits);
-  proto_tree_add_bits_item(umrs_tree, hf_ieee80211_he_umrs_ru_allocation, tvb,
+  proto_tree_add_uint(umrs_tree, hf_ieee80211_he_umrs_ru_allocation, tvb,
                         offset, 4, the_bits);
-  proto_tree_add_bits_item(umrs_tree, hf_ieee80211_he_dl_tx_power, tvb,
+  proto_tree_add_uint(umrs_tree, hf_ieee80211_he_dl_tx_power, tvb,
                         offset, 4, the_bits);
-  proto_tree_add_bits_item(umrs_tree, hf_ieee80211_he_ul_target_rssi, tvb,
+  proto_tree_add_uint(umrs_tree, hf_ieee80211_he_ul_target_rssi, tvb,
                         offset, 4, the_bits);
-  proto_tree_add_bits_item(umrs_tree, hf_ieee80211_he_ul_mcs, tvb,
+  proto_tree_add_uint(umrs_tree, hf_ieee80211_he_ul_mcs, tvb,
                         offset, 4, the_bits);
-  proto_tree_add_bits_item(umrs_tree, hf_ieee80211_he_ul_reserved, tvb,
+  proto_tree_add_uint(umrs_tree, hf_ieee80211_he_ul_reserved, tvb,
                         offset, 4, the_bits);
 }
 
@@ -15505,24 +15559,24 @@ dissect_a_control_om(proto_tree *tree, tvbuff_t *tvb, int offset,
   guint32 bits _U_, guint32 start_bit)
 {
   proto_tree *om_tree = NULL;
-  guint the_bits = (tvb_get_letohl(tvb, offset) >> start_bit) & 0x0000003FF;
+  guint the_bits = (tvb_get_letohl(tvb, offset) >> start_bit) & 0x000000FFF;
 
   /*
    * We isolated the bits and moved them to the bottom ... so display them
    */
   om_tree = proto_tree_add_subtree_format(tree, tvb, offset, 4,
                                 ett_ieee80211_om_control,
-                                NULL, "OM Control: 0x%0x", the_bits);
+                                NULL, "OM Control: 0x%04x", the_bits);
 
-  proto_tree_add_bits_item(om_tree, hf_ieee80211_he_om_rx_nss, tvb,
+  proto_tree_add_uint(om_tree, hf_ieee80211_he_om_rx_nss, tvb,
                         offset, 4, the_bits);
-  proto_tree_add_bits_item(om_tree, hf_ieee80211_he_om_channel_width, tvb,
+  proto_tree_add_uint(om_tree, hf_ieee80211_he_om_channel_width, tvb,
                         offset, 4, the_bits);
-  proto_tree_add_bits_item(om_tree, hf_ieee80211_he_om_ul_mu_disable, tvb,
+  proto_tree_add_boolean(om_tree, hf_ieee80211_he_om_ul_mu_disable, tvb,
                         offset, 4, the_bits);
-  proto_tree_add_bits_item(om_tree, hf_ieee80211_he_om_tx_nsts, tvb,
+  proto_tree_add_uint(om_tree, hf_ieee80211_he_om_tx_nsts, tvb,
                         offset, 4, the_bits);
-  proto_tree_add_bits_item(om_tree, hf_ieee80211_he_om_reserved, tvb,
+  proto_tree_add_uint(om_tree, hf_ieee80211_he_om_reserved, tvb,
                         offset, 4, the_bits);
 }
 
@@ -15538,27 +15592,27 @@ dissect_a_control_hla(proto_tree *tree, tvbuff_t *tvb, int offset,
    */
   hla_tree = proto_tree_add_subtree_format(tree, tvb, offset, 4,
                                 ett_ieee80211_hla_control,
-                                NULL, "HLA Control: 0x%0x", the_bits);
+                                NULL, "HLA Control: 0x%08x", the_bits);
 
-  proto_tree_add_bits_item(hla_tree, hf_ieee80211_he_hla_unsolicited_mfb, tvb,
+  proto_tree_add_boolean(hla_tree, hf_ieee80211_he_hla_unsolicited_mfb, tvb,
                         offset, 4, the_bits);
-  proto_tree_add_bits_item(hla_tree, hf_ieee80211_he_hla_mrq, tvb,
+  proto_tree_add_boolean(hla_tree, hf_ieee80211_he_hla_mrq, tvb,
                         offset, 4, the_bits);
-  proto_tree_add_bits_item(hla_tree, hf_ieee80211_he_hla_nss, tvb,
+  proto_tree_add_uint(hla_tree, hf_ieee80211_he_hla_nss, tvb,
                         offset, 4, the_bits);
-  proto_tree_add_bits_item(hla_tree, hf_ieee80211_he_hla_he_mcs, tvb,
+  proto_tree_add_uint(hla_tree, hf_ieee80211_he_hla_he_mcs, tvb,
                         offset, 4, the_bits);
-  proto_tree_add_bits_item(hla_tree, hf_ieee80211_he_hla_dcm, tvb,
+  proto_tree_add_boolean(hla_tree, hf_ieee80211_he_hla_dcm, tvb,
                         offset, 4, the_bits);
-  proto_tree_add_bits_item(hla_tree, hf_ieee80211_he_hla_ru, tvb,
+  proto_tree_add_uint(hla_tree, hf_ieee80211_he_hla_ru, tvb,
                         offset, 4, the_bits);
-  proto_tree_add_bits_item(hla_tree, hf_ieee80211_he_hla_bw, tvb,
+  proto_tree_add_uint(hla_tree, hf_ieee80211_he_hla_bw, tvb,
                         offset, 4, the_bits);
-  proto_tree_add_bits_item(hla_tree, hf_ieee80211_he_hla_msi_ppdu_type, tvb,
+  proto_tree_add_uint(hla_tree, hf_ieee80211_he_hla_msi_ppdu_type, tvb,
                         offset, 4, the_bits);
-  proto_tree_add_bits_item(hla_tree, hf_ieee80211_he_hla_tx_bf, tvb,
+  proto_tree_add_boolean(hla_tree, hf_ieee80211_he_hla_tx_bf, tvb,
                         offset, 4, the_bits);
-  proto_tree_add_bits_item(hla_tree, hf_ieee80211_he_hla_reserved, tvb,
+  proto_tree_add_uint(hla_tree, hf_ieee80211_he_hla_reserved, tvb,
                         offset, 4, the_bits);
 }
 
@@ -15574,7 +15628,7 @@ dissect_a_control_bsr(proto_tree *tree, tvbuff_t *tvb, int offset,
    */
   bsr_tree = proto_tree_add_subtree_format(tree, tvb, offset, 4,
                                 ett_ieee80211_buffer_status_report,
-                                NULL, "Buffer Status Report: 0x%0x", the_bits);
+                                NULL, "Buffer Status Report: 0x%08x", the_bits);
 
   proto_tree_add_uint(bsr_tree, hf_ieee80211_he_bsr_aci_bitmap, tvb,
                         offset, 4, the_bits);
@@ -15595,20 +15649,20 @@ dissect_a_control_uph(proto_tree *tree, tvbuff_t *tvb, int offset,
   guint32 bits _U_, guint32 start_bit)
 {
   proto_tree *uph_tree = NULL;
-  guint the_bits = (tvb_get_letohl(tvb, offset) >> start_bit) & 0x03FFFFFF;
+  guint the_bits = (tvb_get_letohl(tvb, offset) >> start_bit) & 0x000000FF;
 
   /*
    * We isolated the bits and moved them to the bottom ... so display them
    */
   uph_tree = proto_tree_add_subtree_format(tree, tvb, offset, 4,
                                 ett_ieee80211_control_uph,
-                                NULL, "UPH Control: 0x%0x", the_bits);
+                                NULL, "UPH Control: 0x%02x", the_bits);
 
-  proto_tree_add_bits_item(uph_tree, hf_ieee80211_he_uph_ul_power_headroom, tvb,
+  proto_tree_add_uint(uph_tree, hf_ieee80211_he_uph_ul_power_headroom, tvb,
                         offset, 4, the_bits);
-  proto_tree_add_bits_item(uph_tree, hf_ieee80211_he_uph_ul_min_transmit_power_flag,
+  proto_tree_add_boolean(uph_tree, hf_ieee80211_he_uph_ul_min_transmit_power_flag,
                         tvb, offset, 4, the_bits);
-  proto_tree_add_bits_item(uph_tree, hf_ieee80211_he_uph_reserved,
+  proto_tree_add_uint(uph_tree, hf_ieee80211_he_uph_reserved,
                         tvb, offset, 4, the_bits);
 }
 
@@ -15617,18 +15671,18 @@ dissect_a_control_bqr(proto_tree *tree, tvbuff_t *tvb, int offset,
   guint32 bits _U_, guint32 start_bit)
 {
   proto_tree *bqr_tree = NULL;
-  guint the_bits = (tvb_get_letohl(tvb, offset) >> start_bit) & 0x03FFFFFF;
+  guint the_bits = (tvb_get_letohl(tvb, offset) >> start_bit) & 0x000003FF;
 
   /*
    * We isolated the bits and moved them to the bottom ... so display them
    */
   bqr_tree = proto_tree_add_subtree_format(tree, tvb, offset, 4,
                                 ett_ieee80211_bqr_control,
-                                NULL, "BQR Control: 0x%0x", the_bits);
+                                NULL, "BQR Control: 0x%04x", the_bits);
 
-  proto_tree_add_bits_item(bqr_tree, hf_ieee80211_he_btc_avail_chan, tvb,
+  proto_tree_add_uint(bqr_tree, hf_ieee80211_he_btc_avail_chan, tvb,
                         offset, 4, the_bits);
-  proto_tree_add_bits_item(bqr_tree, hf_ieee80211_he_btc_reserved, tvb,
+  proto_tree_add_uint(bqr_tree, hf_ieee80211_he_btc_reserved, tvb,
                         offset, 4, the_bits);
 }
 
@@ -15637,20 +15691,20 @@ dissect_a_control_cci(proto_tree *tree, tvbuff_t *tvb, int offset,
   guint32 bits _U_, guint32 start_bit)
 {
   proto_tree *cci_tree = NULL;
-  guint the_bits = (tvb_get_letohl(tvb, offset) >> start_bit) & 0x03FFFFFF;
+  guint the_bits = (tvb_get_letohl(tvb, offset) >> start_bit) & 0x000000FF;
 
   /*
    * We isolated the bits and moved them to the bottom ... so display them
    */
   cci_tree = proto_tree_add_subtree_format(tree, tvb, offset, 4,
                                 ett_ieee80211_control_cci,
-                                NULL, "Command Control Indication: 0x%0x", the_bits);
+                                NULL, "Command Control Indication: 0x%02x", the_bits);
 
-  proto_tree_add_uint(cci_tree, hf_ieee80211_he_cci_ac_constraint, tvb,
+  proto_tree_add_boolean(cci_tree, hf_ieee80211_he_cci_ac_constraint, tvb,
                         offset, 4, the_bits);
-  proto_tree_add_uint(cci_tree, hf_ieee80211_he_cci_rdg_more_ppdu, tvb,
+  proto_tree_add_boolean(cci_tree, hf_ieee80211_he_cci_rdg_more_ppdu, tvb,
                         offset, 4, the_bits);
-  proto_tree_add_uint(cci_tree, hf_ieee80211_he_cci_sr_ppdu_indic, tvb,
+  proto_tree_add_boolean(cci_tree, hf_ieee80211_he_cci_sr_ppdu_indic, tvb,
                         offset, 4, the_bits);
   proto_tree_add_uint(cci_tree, hf_ieee80211_he_cci_reserved, tvb,
                         offset, 4, the_bits);
@@ -15994,7 +16048,7 @@ dissect_qos_map_set(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* d
   left = tag_len - 16;
   while (left >= 2) {
     dscp_item = proto_tree_add_item(tree, hf_ieee80211_tag_qos_map_set_dscp_exc,
-                                    tvb, offset, 2, ENC_NA);
+                                    tvb, offset, 2, ENC_LITTLE_ENDIAN);
     dscp_tree = proto_item_add_subtree(dscp_item, ett_qos_map_set_exception);
 
     item = proto_tree_add_item(dscp_tree,
@@ -18136,6 +18190,9 @@ ieee80211_tag_vendor_specific_ie(tvbuff_t *tvb, packet_info *pinfo, proto_tree *
     case OUI_ZEBRA_EXTREME:
       dissect_vendor_ie_extreme(field_data->item_tag, tree, tvb, offset, tag_vs_len, pinfo);
       break;
+    case OUI_AEROHIVE:
+      dissect_vendor_ie_aerohive(field_data->item_tag, tree, tvb, offset, tag_vs_len, pinfo);
+      break;
     default:
       proto_tree_add_item(tree, hf_ieee80211_tag_vendor_data, tvb, offset, tag_vs_len, ENC_NA);
       break;
@@ -19415,9 +19472,13 @@ ieee80211_tag_dmg_capabilities(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tr
     NULL
   };
 
-  if (tag_len != 22)
+  /*
+   * Plenty of devices still do not conform to the older version of this
+   * field. So, it must be at least 17 bytes in length.
+   */
+  if (tag_len < 17)
   {
-    expert_add_info_format(pinfo, field_data->item_tag_length, &ei_ieee80211_tag_length, "Tag Length %u wrong, must be = 22", tag_len);
+    expert_add_info_format(pinfo, field_data->item_tag_length, &ei_ieee80211_tag_length, "Tag Length %u wrong, must contain at least 17 bytes", tag_len);
     return tvb_captured_length(tvb);
   }
 
@@ -19433,6 +19494,18 @@ ieee80211_tag_dmg_capabilities(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tr
   offset += 2;
   proto_tree_add_bitmask_list(tree, tvb, offset, 2, ieee80211_tag_dmg_cap4, ENC_LITTLE_ENDIAN);
   offset += 2;
+
+  /*
+   * There are many captures out there that do not conform to the 2016
+   * version, so give them a malformed IE message now after we have dissected
+   * the above
+   */
+  if (tag_len != 22)
+  {
+    expert_add_info_format(pinfo, field_data->item_tag_length, &ei_ieee80211_tag_length, "Tag Length %u does not conform to IEEE802.11-2016, should contain 22 bytes", tag_len);
+    return tvb_captured_length(tvb);
+  }
+
   proto_tree_add_item(tree, hf_ieee80211_tag_sta_beam_track, tvb, offset, 2, ENC_NA);
   offset += 2;
   proto_tree_add_bitmask_list(tree, tvb, offset, 1, ieee80211_tag_dmg_cap5, ENC_LITTLE_ENDIAN);
@@ -19440,7 +19513,6 @@ ieee80211_tag_dmg_capabilities(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tr
   proto_tree_add_item(tree, hf_ieee80211_tag_max_basic_sf_amsdu, tvb, offset, 1, ENC_NA);
   offset += 1;
   proto_tree_add_item(tree, hf_ieee80211_tag_max_short_sf_amsdu, tvb, offset, 1, ENC_NA);
-  offset += 1;
 
   return tvb_captured_length(tvb);
 }
@@ -22704,6 +22776,11 @@ dissect_ieee80211_common(tvbuff_t *tvb, packet_info *pinfo,
            packet starts with 0x00 0x00 and, if so, treat it as an OLPC
            frame, or check the packet starts with the repetition of the
            sequence control field and, if so, treat it as an Atheros frame. */
+      heur_dtbl_entry_t  *hdtbl_entry;
+      if (dissector_try_heuristic(heur_subdissector_list, next_tvb, pinfo, tree, &hdtbl_entry, NULL)) {
+        pinfo->fragmented = save_fragmented;
+        goto end_of_wlan; /* heuristics dissector handled it. */
+      }
       encap_type = ENCAP_802_2;
       if (tvb_bytes_exist(next_tvb, 0, 2)) {
         octet1 = tvb_get_guint8(next_tvb, 0);
@@ -24723,8 +24800,8 @@ proto_register_ieee80211(void)
       NULL, HFILL }},
 
     {&hf_ieee80211_tag_ext_sc_mcs_tx_code_7_8, /* DMG STA Ext SC MCS Capa: Tx code rate 7/8*/
-     {"Extended SC Tx MCS code rate 7/8 supported", "wlan.dmg_capa.ext_sc_mcs_tx_code_7_8",
-      FT_BOOLEAN, 8, NULL, GENMASK(3, 3),
+     {"Extended SC Tx MCS code rate 7/8", "wlan.dmg_capa.ext_sc_mcs_tx_code_7_8",
+      FT_BOOLEAN, 8, TFS(&tfs_supported_not_supported), GENMASK(3, 3),
       NULL, HFILL }},
 
     {&hf_ieee80211_tag_ext_sc_mcs_max_rx, /* DMG STA Ext SC MCS Capa: Max RX*/
@@ -24733,8 +24810,8 @@ proto_register_ieee80211(void)
       NULL, HFILL }},
 
     {&hf_ieee80211_tag_ext_sc_mcs_rx_code_7_8, /* DMG STA Ext SC MCS Capa: Rx code rate 7/8*/
-     {"Extended SC Rx MCS code rate 7/8 suported", "wlan.dmg_capa.ext_sc_mcs_rx_code_7_8",
-      FT_BOOLEAN, 8, NULL, GENMASK(7, 7),
+     {"Extended SC Rx MCS code rate 7/8", "wlan.dmg_capa.ext_sc_mcs_rx_code_7_8",
+      FT_BOOLEAN, 8, TFS(&tfs_supported_not_supported), GENMASK(7, 7),
       NULL, HFILL }},
 
     {&hf_ieee80211_tag_max_basic_sf_amsdu, /* DMG Max Number of Basic Subframes in an A-MSDU*/
@@ -31038,6 +31115,27 @@ proto_register_ieee80211(void)
       FT_STRING, BASE_NONE, NULL, 0,
       NULL, HFILL }},
 
+    /* Vendor Specific : Aerohive */
+    {&hf_ieee80211_vs_aerohive_unknown,
+     {"Unknown", "wlan.vs.aerohive.unknown",
+      FT_BYTES, BASE_NONE, NULL, 0,
+      NULL, HFILL }},
+
+    {&hf_ieee80211_vs_aerohive_hostname_length,
+     {"Host Name Length", "wlan.vs.aerohive.hostname_length",
+      FT_UINT8, BASE_DEC, NULL, 0,
+      NULL, HFILL }},
+
+    {&hf_ieee80211_vs_aerohive_hostname,
+     {"Host Name", "wlan.vs.aerohive.hostname",
+      FT_STRING, BASE_NONE, NULL, 0,
+      NULL, HFILL }},
+
+    {&hf_ieee80211_vs_aerohive_data,
+     {"Data", "wlan.vs.aerohive.data",
+      FT_BYTES, BASE_NONE, NULL, 0,
+      NULL, HFILL }},
+
     {&hf_ieee80211_tsinfo,
      {"Traffic Stream (TS) Info", "wlan.ts_info",
       FT_UINT24, BASE_HEX, NULL, 0,
@@ -31260,24 +31358,24 @@ proto_register_ieee80211(void)
 
     {&hf_ieee80211_he_umrs_he_tb_ppdu_len,
      {"HE TB PPDU Length", "wlan.htc.he.a_control.umrs.he_tb_ppdu_len",
-      FT_UINT8, BASE_DEC, NULL, 0x0000001f, NULL, HFILL }},
+      FT_UINT32, BASE_DEC, NULL, 0x0000001f, NULL, HFILL }},
 
     {&hf_ieee80211_he_umrs_ru_allocation,
      {"RU Allocation", "wlan.htc.he.a_control.umrs.ru_allocation",
-      FT_UINT8, BASE_HEX, NULL, 0x00001fe0, NULL, HFILL }},
+      FT_UINT32, BASE_HEX, NULL, 0x00001fe0, NULL, HFILL }},
 
     {&hf_ieee80211_he_dl_tx_power,
      {"DL Tx Power", "wlan.htc.he.a_control.umrs.dl_tx_power",
-      FT_UINT8, BASE_HEX, NULL, 0x0003e000, NULL, HFILL }},
+      FT_UINT32, BASE_HEX, NULL, 0x0003e000, NULL, HFILL }},
 
     {&hf_ieee80211_he_ul_target_rssi,
      {"UL Target RSSI", "wlan.htc.he.a_control.umrs.ul_target_rssi",
-      FT_UINT8, BASE_CUSTOM, CF_FUNC(ul_target_rssi_base_custom),
+      FT_UINT32, BASE_CUSTOM, CF_FUNC(ul_target_rssi_base_custom),
       0x007c0000, NULL, HFILL }},
 
     {&hf_ieee80211_he_ul_mcs,
      {"UL MCS", "wlan.htc.he.a_control.umrs.ul_mcs",
-      FT_UINT8, BASE_HEX, NULL, 0x018000000, NULL, HFILL }},
+      FT_UINT32, BASE_HEX, NULL, 0x01800000, NULL, HFILL }},
 
     {&hf_ieee80211_he_ul_reserved,
      {"reserved", "wlan.htc.he.a_control.umrs.reserved",
@@ -31285,23 +31383,23 @@ proto_register_ieee80211(void)
 
     {&hf_ieee80211_he_om_rx_nss,
      {"Rx NSS", "wlan.htc.he.a_control.om.rx_nss",
-      FT_UINT32, BASE_DEC, NULL, 0x00000007, NULL, HFILL }},
+      FT_UINT16, BASE_DEC, NULL, 0x0007, NULL, HFILL }},
 
     {&hf_ieee80211_he_om_channel_width,
      {"Channel Width", "wlan.htc.he.a_control.om.channel_width",
-      FT_UINT32, BASE_DEC, NULL, 0x00000018, NULL, HFILL }},
+      FT_UINT16, BASE_DEC, NULL, 0x0018, NULL, HFILL }},
 
     {&hf_ieee80211_he_om_ul_mu_disable,
      {"UL MU Disable", "wlan.htc.he.a_control.om.ul_mu_disable",
-      FT_BOOLEAN, 32, NULL, 0x00000020, NULL, HFILL }},
+      FT_BOOLEAN, 16, NULL, 0x0020, NULL, HFILL }},
 
     {&hf_ieee80211_he_om_tx_nsts,
      {"Tx NSTS", "wlan.htc.he.a_control.om.tx_nsts",
-      FT_UINT32, BASE_DEC, NULL, 0x000001c0, NULL, HFILL }},
+      FT_UINT16, BASE_DEC, NULL, 0x01c0, NULL, HFILL }},
 
     {&hf_ieee80211_he_om_reserved,
      {"Reserved", "wlan.htc.he.a_control.om.reserved",
-      FT_UINT32, BASE_HEX, NULL, 0x000002c0, NULL, HFILL }},
+      FT_UINT16, BASE_HEX, NULL, 0x0e00, NULL, HFILL }},
 
     {&hf_ieee80211_he_hla_unsolicited_mfb,
      {"Unsolicited MFB", "wlan.htc.he.a_control.hla.unsolicited_mfb",
@@ -31345,23 +31443,23 @@ proto_register_ieee80211(void)
 
     {&hf_ieee80211_he_bsr_aci_bitmap,
      {"ACI Bitmap", "wlan.htc.he.a_control.bsr.aci_bitmap",
-      FT_UINT32, BASE_HEX, NULL, 0x00000f, NULL, HFILL }},
+      FT_UINT32, BASE_HEX, NULL, 0x0000000f, NULL, HFILL }},
 
     {&hf_ieee80211_he_bsr_delta_tid,
      {"Delta TID", "wlan.htc.he.a_control.bsr.delta_tid",
-      FT_UINT32, BASE_HEX, NULL, 0x000030, NULL, HFILL }},
+      FT_UINT32, BASE_HEX, NULL, 0x00000030, NULL, HFILL }},
 
     {&hf_ieee80211_he_bsr_aci_high,
      {"ACI High", "wlan.htc.he.a_control.bsr.aci_high",
-      FT_UINT32, BASE_HEX, NULL, 0x0000c0, NULL, HFILL }},
+      FT_UINT32, BASE_HEX, NULL, 0x000000c0, NULL, HFILL }},
 
     {&hf_ieee80211_he_bsr_scaling_factor,
      {"Scaling Factor", "wlan.htc.he.a_control.bsr.scaling_factor",
-      FT_UINT32, BASE_HEX, NULL, 0x000300, NULL, HFILL }},
+      FT_UINT32, BASE_HEX, NULL, 0x00000300, NULL, HFILL }},
 
     {&hf_ieee80211_he_bsr_queue_size_high,
      {"Queue Size High", "wlan.htc.he.a_control.bsr.queue_size_high",
-      FT_UINT32, BASE_HEX, NULL, 0x03fc00, NULL, HFILL }},
+      FT_UINT32, BASE_HEX, NULL, 0x0003fc00, NULL, HFILL }},
 
     {&hf_ieee80211_he_bsr_queue_size_all,
      {"Queue Size All", "wlan.htc.he.a_control.bsr.queue_size_all",
@@ -31369,23 +31467,23 @@ proto_register_ieee80211(void)
 
     {&hf_ieee80211_he_uph_ul_power_headroom,
      {"UL Power Headroom", "wlan.htc.he.a_control.uph.ul_power_headroom",
-      FT_UINT32, BASE_DEC, NULL, 0x00000001f, NULL, HFILL }},
+      FT_UINT8, BASE_DEC, NULL, 0x00000001f, NULL, HFILL }},
 
     {&hf_ieee80211_he_uph_ul_min_transmit_power_flag,
      {"Minimum Transmit Power Flag", "wlan.htc.he.a_control.uph.min_transmit_power_flag",
-      FT_BOOLEAN, 32, NULL, 0x00000020, NULL, HFILL }},
+      FT_BOOLEAN, 8, NULL, 0x00000020, NULL, HFILL }},
 
     {&hf_ieee80211_he_uph_reserved,
      {"Reserved", "wlan.htc.he.a_control.uph.reserved",
-      FT_UINT32, BASE_HEX, NULL, 0x000000c000, NULL, HFILL }},
+      FT_UINT8, BASE_HEX, NULL, 0x000000c0, NULL, HFILL }},
 
     {&hf_ieee80211_he_btc_avail_chan,
      {"Available Channel Bitmap", "wlan.htc.he.a_control.bqr.avail_chan_bitmap",
-      FT_UINT8, BASE_HEX, NULL, 0, NULL, HFILL }},
+      FT_UINT16, BASE_HEX, NULL, 0, NULL, HFILL }},
 
     {&hf_ieee80211_he_btc_reserved,
      {"Reserved", "wlan.htc.he.a_control.bqr.reserved",
-      FT_UINT8, BASE_HEX, NULL, 0, NULL, HFILL }},
+      FT_UINT16, BASE_HEX, NULL, 0, NULL, HFILL }},
 
     {&hf_ieee80211_he_cci_ac_constraint,
      {"AC Constraint", "wlan.htc.he.a_control.cci.ac_constraint",
@@ -31393,7 +31491,7 @@ proto_register_ieee80211(void)
 
     {&hf_ieee80211_he_cci_rdg_more_ppdu,
      {"RDG/More PPDU", "wlan.htc.he.a_control.cci.rdg_more_ppdu",
-      FT_BOOLEAN,32, NULL, 0x02, NULL, HFILL }},
+      FT_BOOLEAN, 32, NULL, 0x02, NULL, HFILL }},
 
     {&hf_ieee80211_he_cci_sr_ppdu_indic,
      {"SR PPDU Indication", "wlan.htc.he.a_control.cci.sr_ppdu_indic",
@@ -32370,7 +32468,7 @@ proto_register_ieee80211(void)
     /* QoS Map Set element */
     {&hf_ieee80211_tag_qos_map_set_dscp_exc,
      {"DSCP Exception", "wlan.qos_map_set.dscp_exception",
-      FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }},
+      FT_UINT16, BASE_HEX, NULL, 0, NULL, HFILL }},
 
     {&hf_ieee80211_tag_qos_map_set_dscp_exc_val,
      {"DSCP Value", "wlan.qos_map_set.dscp_value",
@@ -32384,7 +32482,7 @@ proto_register_ieee80211(void)
 
     {&hf_ieee80211_tag_qos_map_set_range,
      {"DSCP Range description", "wlan.qos_map_set.range",
-      FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }},
+      FT_UINT16, BASE_HEX, NULL, 0, NULL, HFILL }},
 
     {&hf_ieee80211_tag_qos_map_set_low,
      {"DSCP Low Value", "wlan.qos_map_set.dscp_low_value",
@@ -33965,6 +34063,9 @@ proto_register_ieee80211(void)
   proto_register_field_array(proto_aggregate, aggregate_fields, array_length(aggregate_fields));
 
   proto_wlan = proto_register_protocol("IEEE 802.11 wireless LAN", "IEEE 802.11", "wlan");
+
+  heur_subdissector_list = register_heur_dissector_list("wlan_data", proto_wlan);
+
   /* Created to remove Decode As confusion */
   proto_centrino = proto_register_protocol("IEEE 802.11 wireless LAN (Centrino)", "IEEE 802.11 (Centrino)", "wlan_centrino");
   proto_register_field_array(proto_wlan, hf, array_length(hf));