Преглед изворни кода

Merge "qcacmn: Restrict max/min pktlog buffer size using pktlogconf tool"

Linux Build Service Account пре 7 година
родитељ
комит
23f475ea31

+ 3 - 0
dp/inc/cdp_txrx_stats_struct.h

@@ -498,6 +498,9 @@ enum _ol_ath_param_t {
 	OL_ATH_PARAM_EXT_NSS_CAPABLE = 354,
 	OL_ATH_PARAM_MGMT_PDEV_STATS_TIMER = 355,
 	OL_ATH_PARAM_TXACKTIMEOUT = 356,
+	OL_ATH_PARAM_ICM_ACTIVE = 357,
+	OL_ATH_PARAM_NOMINAL_NOISEFLOOR = 358,
+	OL_ATH_PARAM_CHAN_INFO = 359,
 };
 
 /* Enumeration of PDEV Configuration parameter */

+ 0 - 7
umac/global_umac_dispatcher/lmac_if/inc/wlan_lmac_if_def.h

@@ -308,16 +308,9 @@ struct wlan_lmac_if_sptrl_tx_ops {
 	void (*sptrlto_stop_spectral_scan)(struct wlan_objmgr_pdev *pdev);
 	bool (*sptrlto_is_spectral_active)(struct wlan_objmgr_pdev *pdev);
 	bool (*sptrlto_is_spectral_enabled)(struct wlan_objmgr_pdev *pdev);
-	int (*sptrlto_set_icm_active)(struct wlan_objmgr_pdev *pdev,
-				      bool isactive);
-	bool (*sptrlto_get_icm_active)(struct wlan_objmgr_pdev *pdev);
-	int16_t (*sptrlto_get_nominal_nf)(struct wlan_objmgr_pdev *pdev);
 	int (*sptrlto_set_debug_level)(struct wlan_objmgr_pdev *pdev,
 				       u_int32_t debug_level);
 	u_int32_t (*sptrlto_get_debug_level)(struct wlan_objmgr_pdev *pdev);
-	void (*sptrlto_get_chaninfo)(struct wlan_objmgr_pdev *pdev,
-				     void *outdata);
-	void (*sptrlto_clear_chaninfo)(struct wlan_objmgr_pdev *pdev);
 	void (*sptrlto_get_spectral_capinfo)(struct wlan_objmgr_pdev *pdev,
 					     void *outdata);
 	void (*sptrlto_get_spectral_diagstats)(struct wlan_objmgr_pdev *pdev,

+ 17 - 1
umac/scan/dispatcher/src/wlan_scan_ucfg_api.c

@@ -365,6 +365,7 @@ ucfg_scan_update_dbs_scan_ctrl_ext_flag(struct scan_start_request *req)
 	uint32_t num_chan;
 	struct wlan_objmgr_psoc *psoc;
 	uint32_t scan_dbs_policy = SCAN_DBS_POLICY_FORCE_NONDBS;
+	uint32_t conn_cnt;
 
 	psoc = wlan_vdev_get_psoc(req->vdev);
 
@@ -372,8 +373,23 @@ ucfg_scan_update_dbs_scan_ctrl_ext_flag(struct scan_start_request *req)
 			wlan_objmgr_psoc_get_dual_mac_disable(psoc))
 		goto end;
 
-	if (!qdf_is_macaddr_zero(&req->scan_req.bssid_list[0]))
+	conn_cnt = policy_mgr_get_connection_count(psoc);
+	if (conn_cnt > 0) {
+		scm_debug("%d active connections, go for DBS scan",
+				conn_cnt);
+		scan_dbs_policy = SCAN_DBS_POLICY_DEFAULT;
+		goto end;
+	}
+
+	if (req->scan_req.num_ssids) {
+		scm_debug("directed SSID");
 		goto end;
+	}
+
+	if (req->scan_req.num_bssid) {
+		scm_debug("directed BSSID");
+		goto end;
+	}
 
 	num_chan = req->scan_req.num_chan;
 

+ 20 - 5
utils/fwlog/dbglog_host.c

@@ -1847,7 +1847,7 @@ static int diag_fw_handler(ol_scn_t scn, uint8_t *data, uint32_t datalen)
 {
 
 	tp_wma_handle wma = (tp_wma_handle) scn;
-	wmitlv_cmd_param_info *param_buf;
+	WMI_DIAG_EVENTID_param_tlvs *param_buf;
 	uint8_t *datap;
 	uint32_t len = 0;
 	uint32_t *buffer;
@@ -1862,22 +1862,37 @@ static int diag_fw_handler(ol_scn_t scn, uint8_t *data, uint32_t datalen)
 		len = datalen;
 		wma->is_fw_assert = 0;
 	} else {
-		param_buf = (wmitlv_cmd_param_info *) data;
+		param_buf = (WMI_DIAG_EVENTID_param_tlvs *) data;
 		if (!param_buf) {
 			AR_DEBUG_PRINTF(ATH_DEBUG_ERR,
 					("Get NULL point message from FW\n"));
 			return A_ERROR;
 		}
 
-		param_buf = (wmitlv_cmd_param_info *) data;
-		datap = param_buf->tlv_ptr;
-		len = param_buf->num_elements;
+		datap = param_buf->bufp;
+		len = param_buf->num_bufp;
+
 		if (!get_version) {
+			if (len < 2*(sizeof(uint32_t))) {
+				AR_DEBUG_PRINTF(ATH_DEBUG_ERR,
+						("len is less than expected\n"));
+				return A_ERROR;
+			}
 			buffer = (uint32_t *) datap;
 			buffer++;       /* skip offset */
 			if (WLAN_DIAG_TYPE_CONFIG == DIAG_GET_TYPE(*buffer)) {
+				if (len < 3*(sizeof(uint32_t))) {
+					AR_DEBUG_PRINTF(ATH_DEBUG_ERR,
+							("len is less than expected\n"));
+					return A_ERROR;
+				}
 				buffer++;       /* skip  */
 				if (DIAG_VERSION_INFO == DIAG_GET_ID(*buffer)) {
+					if (len < 4*(sizeof(uint32_t))) {
+						AR_DEBUG_PRINTF(ATH_DEBUG_ERR,
+								("len is less than expected\n"));
+						return A_ERROR;
+					}
 					buffer++;       /* skip  */
 					/* get payload */
 					get_version = *buffer;

+ 8 - 1
utils/pktlog/pktlog_ac.c

@@ -548,6 +548,9 @@ int pktlog_enable(struct hif_opaque_softc *scn, int32_t log_state,
 	return error;
 }
 
+#define ONE_MEGABYTE (1024 * 1024)
+#define MAX_ALLOWED_PKTLOG_SIZE (16 * ONE_MEGABYTE)
+
 static int __pktlog_setsize(struct hif_opaque_softc *scn, int32_t size)
 {
 	ol_txrx_pdev_handle pdev_txrx_handle =
@@ -568,7 +571,11 @@ static int __pktlog_setsize(struct hif_opaque_softc *scn, int32_t size)
 
 	pl_info->curr_pkt_state = PKTLOG_OPR_IN_PROGRESS;
 
-	if (size < 0) {
+	if (size < ONE_MEGABYTE || size > MAX_ALLOWED_PKTLOG_SIZE) {
+		qdf_print("%s: Cannot Set Pktlog Buffer size of %d bytes."
+			"Min required is %d MB and Max allowed is %d MB.\n",
+			__func__, size, (ONE_MEGABYTE/ONE_MEGABYTE),
+			(MAX_ALLOWED_PKTLOG_SIZE/ONE_MEGABYTE));
 		pl_info->curr_pkt_state = PKTLOG_OPR_NOT_IN_PROGRESS;
 		return -EINVAL;
 	}

+ 1 - 0
wmi/inc/wmi_unified_param.h

@@ -5661,6 +5661,7 @@ typedef enum {
 	wmi_vdev_param_he_range_ext_enable,
 	wmi_vdev_param_set_hemu_mode,
 	wmi_vdev_param_set_he_ltf,
+	wmi_vdev_param_set_heop,
 
 	wmi_vdev_param_max,
 } wmi_conv_vdev_param_id;

+ 1 - 0
wmi/src/wmi_unified_tlv.c

@@ -20654,6 +20654,7 @@ static void populate_vdev_param_tlv(uint32_t *vdev_param)
 				 WMI_VDEV_PARAM_HE_RANGE_EXT;
 	vdev_param[wmi_vdev_param_he_bss_color] = WMI_VDEV_PARAM_BSS_COLOR;
 	vdev_param[wmi_vdev_param_set_hemu_mode] = WMI_VDEV_PARAM_SET_HEMU_MODE;
+	vdev_param[wmi_vdev_param_set_heop]      = WMI_VDEV_PARAM_HEOPS_0_31;
 	vdev_param[wmi_vdev_param_sensor_ap] = WMI_VDEV_PARAM_SENSOR_AP;
 	vdev_param[wmi_vdev_param_dtim_enable_cts] =
 					WMI_VDEV_PARAM_DTIM_ENABLE_CTS;