Merge "[ipq806x][qca-nss-drv] Added bridge src mac addr"
diff --git a/exports/nss_wifi.h b/exports/nss_wifi.h
index f26b24e..c0e1c1f 100644
--- a/exports/nss_wifi.h
+++ b/exports/nss_wifi.h
@@ -46,6 +46,7 @@
 	NSS_WIFI_SEND_PEER_MEMORY_REQUEST_MSG,
 	NSS_WIFI_SEND_RRA_MEMORY_REQUEST_MSG,
 	NSS_WIFI_FW_STATS_MSG,
+	NSS_WIFI_MONITOR_FILTER_SET_MSG,
 	NSS_WIFI_MAX_MSG
 };
 
@@ -164,6 +165,13 @@
 };
 
 /**
+ *  wifi monitor mode set filter message structure
+ */
+struct nss_wifi_monitor_set_filter_msg {
+	uint32_t filter_type;			/**< filter type */
+};
+
+/**
  * wifi pdev wds peer specific messages
  */
 struct nss_wifi_wds_peer_msg {
@@ -240,6 +248,7 @@
 		struct nss_wifi_peer_freelist_append_msg peer_freelist_append;
 		struct nss_wifi_rx_reorder_array_freelist_append_msg rx_reorder_array_freelist_append;
 		struct nss_wifi_fw_stats_msg fwstatsmsg;
+		struct nss_wifi_monitor_set_filter_msg monitor_filter_msg;
 	} msg;
 };
 
diff --git a/nss_hal/ipq806x/nss_hal_pvt.c b/nss_hal/ipq806x/nss_hal_pvt.c
index b45150f..a85266b 100644
--- a/nss_hal/ipq806x/nss_hal_pvt.c
+++ b/nss_hal/ipq806x/nss_hal_pvt.c
@@ -822,6 +822,13 @@
 		goto out;
 	}
 
+	/*
+	 * Read frequencies. If failure, load default values.
+	 */
+	of_property_read_u32(np, "qcom,low_frequency", &nss_runtime_samples.freq_scale[NSS_FREQ_LOW_SCALE].frequency);
+	of_property_read_u32(np, "qcom,mid_frequency", &nss_runtime_samples.freq_scale[NSS_FREQ_MID_SCALE].frequency);
+	of_property_read_u32(np, "qcom,max_frequency", &nss_runtime_samples.freq_scale[NSS_FREQ_HIGH_SCALE].frequency);
+
 	nss_ctx = &nss_top->nss[npd->id];
 	nss_ctx->id = npd->id;
 
@@ -1116,9 +1123,15 @@
 			printk("nss_driver - Turbo No Support %d\n", npd->turbo_frequency);
 		}
 
-		nss_runtime_samples.freq_scale[NSS_FREQ_LOW_SCALE].frequency = 0;
-		nss_runtime_samples.freq_scale[NSS_FREQ_MID_SCALE].frequency = 0;
-		nss_runtime_samples.freq_scale[NSS_FREQ_HIGH_SCALE].frequency = 0;
+		/*
+		 * If valid entries - from dtsi - then just init clks.
+		 * Otherwise query for clocks.
+		 */
+		if ((nss_runtime_samples.freq_scale[NSS_FREQ_LOW_SCALE].frequency != 0) &&
+			(nss_runtime_samples.freq_scale[NSS_FREQ_MID_SCALE].frequency != 0) &&
+			(nss_runtime_samples.freq_scale[NSS_FREQ_HIGH_SCALE].frequency != 0)) {
+			goto clk_complete;
+		}
 
 		/*
 		 * Load default scales, then query for higher.
@@ -1128,10 +1141,7 @@
 		if (clk_set_rate(nss_core0_clk, NSS_FREQ_110) != 0) {
 			goto err_init_0;
 		}
-
 		nss_runtime_samples.freq_scale[NSS_FREQ_LOW_SCALE].frequency = NSS_FREQ_110;
-		nss_runtime_samples.freq_scale[NSS_FREQ_LOW_SCALE].minimum = NSS_FREQ_110_MIN;
-		nss_runtime_samples.freq_scale[NSS_FREQ_LOW_SCALE].maximum = NSS_FREQ_110_MAX;
 
 		if (npd->turbo_frequency) {
 			/*
@@ -1139,12 +1149,8 @@
 			 */
 			if (clk_set_rate(nss_core0_clk, NSS_FREQ_600) == 0) {
 				nss_runtime_samples.freq_scale[NSS_FREQ_MID_SCALE].frequency = NSS_FREQ_600;
-				nss_runtime_samples.freq_scale[NSS_FREQ_MID_SCALE].minimum = NSS_FREQ_600_MIN;
-				nss_runtime_samples.freq_scale[NSS_FREQ_MID_SCALE].maximum = NSS_FREQ_600_MAX;
 			} else if (clk_set_rate(nss_core0_clk, NSS_FREQ_550) == 0) {
 				nss_runtime_samples.freq_scale[NSS_FREQ_MID_SCALE].frequency = NSS_FREQ_550;
-				nss_runtime_samples.freq_scale[NSS_FREQ_MID_SCALE].minimum = NSS_FREQ_550_MIN;
-				nss_runtime_samples.freq_scale[NSS_FREQ_MID_SCALE].maximum = NSS_FREQ_550_MAX;
 			} else {
 				goto err_init_0;
 			}
@@ -1154,12 +1160,8 @@
 			 */
 			if (clk_set_rate(nss_core0_clk, NSS_FREQ_800) == 0) {
 				nss_runtime_samples.freq_scale[NSS_FREQ_HIGH_SCALE].frequency = NSS_FREQ_800;
-				nss_runtime_samples.freq_scale[NSS_FREQ_HIGH_SCALE].minimum = NSS_FREQ_800_MIN;
-				nss_runtime_samples.freq_scale[NSS_FREQ_HIGH_SCALE].maximum = NSS_FREQ_800_MAX;
 			} else if (clk_set_rate(nss_core0_clk, NSS_FREQ_733) == 0) {
 				nss_runtime_samples.freq_scale[NSS_FREQ_HIGH_SCALE].frequency = NSS_FREQ_733;
-				nss_runtime_samples.freq_scale[NSS_FREQ_HIGH_SCALE].minimum = NSS_FREQ_733_MIN;
-				nss_runtime_samples.freq_scale[NSS_FREQ_HIGH_SCALE].maximum = NSS_FREQ_733_MAX;
 			} else {
 				goto err_init_0;
 			}
@@ -1169,15 +1171,43 @@
 				goto err_init_0;
 			}
 			nss_runtime_samples.freq_scale[NSS_FREQ_MID_SCALE].frequency = NSS_FREQ_275;
-			nss_runtime_samples.freq_scale[NSS_FREQ_MID_SCALE].minimum = NSS_FREQ_275_MIN;
-			nss_runtime_samples.freq_scale[NSS_FREQ_MID_SCALE].maximum = NSS_FREQ_275_MAX;
 
 			if (clk_set_rate(nss_core0_clk, NSS_FREQ_550) != 0) {
 				goto err_init_0;
 			}
 			nss_runtime_samples.freq_scale[NSS_FREQ_HIGH_SCALE].frequency = NSS_FREQ_550;
-			nss_runtime_samples.freq_scale[NSS_FREQ_HIGH_SCALE].minimum = NSS_FREQ_550_MIN;
-			nss_runtime_samples.freq_scale[NSS_FREQ_HIGH_SCALE].maximum = NSS_FREQ_550_MAX;
+		}
+
+clk_complete:
+
+		/*
+		 * Setup Ranges
+		 */
+		for (i = 0; i < NSS_FREQ_MAX_SCALE; i++) {
+			if (nss_runtime_samples.freq_scale[i].frequency == NSS_FREQ_110) {
+				nss_runtime_samples.freq_scale[i].minimum = NSS_FREQ_110_MIN;
+				nss_runtime_samples.freq_scale[i].maximum = NSS_FREQ_110_MAX;
+			}
+			if (nss_runtime_samples.freq_scale[i].frequency == NSS_FREQ_275) {
+				nss_runtime_samples.freq_scale[i].minimum = NSS_FREQ_275_MIN;
+				nss_runtime_samples.freq_scale[i].maximum = NSS_FREQ_275_MAX;
+			}
+			if (nss_runtime_samples.freq_scale[i].frequency == NSS_FREQ_550) {
+				nss_runtime_samples.freq_scale[i].minimum = NSS_FREQ_550_MIN;
+				nss_runtime_samples.freq_scale[i].maximum = NSS_FREQ_550_MAX;
+			}
+			if (nss_runtime_samples.freq_scale[i].frequency == NSS_FREQ_600) {
+				nss_runtime_samples.freq_scale[i].minimum = NSS_FREQ_600_MIN;
+				nss_runtime_samples.freq_scale[i].maximum = NSS_FREQ_600_MAX;
+			}
+			if (nss_runtime_samples.freq_scale[i].frequency == NSS_FREQ_733) {
+				nss_runtime_samples.freq_scale[i].minimum = NSS_FREQ_733_MIN;
+				nss_runtime_samples.freq_scale[i].maximum = NSS_FREQ_733_MAX;
+			}
+			if (nss_runtime_samples.freq_scale[i].frequency == NSS_FREQ_800) {
+				nss_runtime_samples.freq_scale[i].minimum = NSS_FREQ_800_MIN;
+				nss_runtime_samples.freq_scale[i].maximum = NSS_FREQ_800_MAX;
+			}
 		}
 
 		printk("Supported Frequencies - ");