qcacld-3.0: Derive HT and VHT caps from given per PHY cap

loop through each mac's cap per hw mode and derive final
ht cap and vht cap by either taking MIN or MAX value based
on the engineering requirement.

For backward compatibility reasons, if firmware doesn't
give any TLV for extended caps then use legay HT and VHT cap
values.

CRs-Fixed: 1029145
Change-Id: I3ad9b474c281f3dd371eb2b88b71e8af59fcd66d
diff --git a/core/wma/src/wma_utils.c b/core/wma/src/wma_utils.c
index d5cb5c1..dc6475e 100644
--- a/core/wma/src/wma_utils.c
+++ b/core/wma/src/wma_utils.c
@@ -3383,6 +3383,25 @@
 }
 
 /**
+ * wma_get_num_of_setbits_from_bitmask() - to get num of setbits from bitmask
+ * @mask: given bitmask
+ *
+ * This helper function should return number of setbits from bitmask
+ *
+ * Return: number of setbits from bitmask
+ */
+uint32_t wma_get_num_of_setbits_from_bitmask(uint32_t mask)
+{
+	uint32_t num_of_setbits = 0;
+
+	while (mask) {
+		mask &= (mask - 1);
+		num_of_setbits++;
+	}
+	return num_of_setbits;
+}
+
+/**
  * wma_config_debug_module_cmd - set debug log config
  * @wmi_handle: wmi layer handle
  * @param: debug log parameter