Browse Source

qcacmn: Remove CONFIG_MCL for send_scan_chan_list_cmd_tlv

Currently we have same function name/different implementation when set
wmi scan channel list for WIN and MCL, the implementation for WIN side
send_scan_chan_list_cmd_tlv looks more intuitive which will remain with
minor change.

Remove definition of struct scan_chan_list_params and wmi_channel_param
which is no longer needed. Change HT flag set independent on VHT flag.
Add WMI DFS flag set if channel_param.dfs_set set.

Change-Id: I131ca09c12687bda5eb3eb03b7bcca1d62ac7aa9
CRs-Fixed: 2363675
Will Huang 6 years ago
parent
commit
5a453d8d40
2 changed files with 16 additions and 125 deletions
  1. 0 31
      wmi/inc/wmi_unified_param.h
  2. 16 94
      wmi/src/wmi_unified_tlv.c

+ 0 - 31
wmi/inc/wmi_unified_param.h

@@ -1332,36 +1332,6 @@ struct ap_ps_params {
 
 #define WMI_HOST_MAX_CHANS_PER_WMI_CMD  58
 
-/**
- * struct scan_chan_list_params  - scan channel list cmd parameter
- * @num_scan_chans: no of scan channels
- * @chan_info: pointer to wmi channel info
- */
-#ifdef CONFIG_MCL
-/* TODO: This needs clean-up based on how its processed. */
-typedef struct {
-	/* TLV tag and len; tag equals WMITLV_TAG_STRUC_wmi_channel */
-	uint32_t tlv_header;
-	/** primary 20 MHz channel frequency in mhz */
-	uint32_t mhz;
-	/** Center frequency 1 in MHz*/
-	uint32_t band_center_freq1;
-	/** Center frequency 2 in MHz - valid only for 11acvht 80plus80 mode*/
-	uint32_t band_center_freq2;
-	/** channel info described below */
-	uint32_t info;
-	/** contains min power, max power, reg power and reg class id.  */
-	uint32_t reg_info_1;
-	/** contains antennamax */
-	uint32_t reg_info_2;
-} wmi_channel_param;
-
-struct scan_chan_list_params {
-	uint32_t pdev_id;
-	uint8_t num_scan_chans;
-	wmi_channel_param *chan_info;
-};
-#else
 /**
  * struct scan_chan_list_params  - scan channel list cmd parameter
  * @pdev_id: pdev_id
@@ -1376,7 +1346,6 @@ struct scan_chan_list_params {
 	bool append;
 	struct channel_param ch_param[1];
 };
-#endif
 
 /**
  * struct multiple_vdev_restart_params - Multiple vdev restart cmd parameter

+ 16 - 94
wmi/src/wmi_unified_tlv.c

@@ -2712,86 +2712,6 @@ error:
 	return ret;
 }
 
-#ifdef CONFIG_MCL
-/**
- *  send_scan_chan_list_cmd_tlv() - WMI scan channel list function
- *  @param wmi_handle      : handle to WMI.
- *  @param param    : pointer to hold scan channel list parameter
- *
- *  Return: 0  on success and -ve on failure.
- */
-static QDF_STATUS send_scan_chan_list_cmd_tlv(wmi_unified_t wmi_handle,
-				struct scan_chan_list_params *chan_list)
-{
-	wmi_buf_t buf;
-	QDF_STATUS qdf_status;
-	wmi_scan_chan_list_cmd_fixed_param *cmd;
-	int i;
-	uint8_t *buf_ptr;
-	wmi_channel_param *chan_info, *tchan_info;
-	uint16_t len = sizeof(*cmd) + WMI_TLV_HDR_SIZE;
-
-	len += sizeof(wmi_channel) * chan_list->num_scan_chans;
-	buf = wmi_buf_alloc(wmi_handle, len);
-	if (!buf) {
-		WMI_LOGE("Failed to allocate memory");
-		qdf_status = QDF_STATUS_E_NOMEM;
-		goto end;
-	}
-
-	buf_ptr = (uint8_t *) wmi_buf_data(buf);
-	cmd = (wmi_scan_chan_list_cmd_fixed_param *) buf_ptr;
-	WMITLV_SET_HDR(&cmd->tlv_header,
-		       WMITLV_TAG_STRUC_wmi_scan_chan_list_cmd_fixed_param,
-		       WMITLV_GET_STRUCT_TLVLEN
-			       (wmi_scan_chan_list_cmd_fixed_param));
-
-	WMI_LOGD("no of channels = %d, len = %d", chan_list->num_scan_chans, len);
-
-	cmd->num_scan_chans = chan_list->num_scan_chans;
-	WMITLV_SET_HDR((buf_ptr + sizeof(wmi_scan_chan_list_cmd_fixed_param)),
-		       WMITLV_TAG_ARRAY_STRUC,
-		       sizeof(wmi_channel) * chan_list->num_scan_chans);
-	chan_info = (wmi_channel_param *)
-			(buf_ptr + sizeof(*cmd) + WMI_TLV_HDR_SIZE);
-	tchan_info = chan_list->chan_info;
-
-	for (i = 0; i < chan_list->num_scan_chans; ++i) {
-		WMITLV_SET_HDR(&chan_info->tlv_header,
-			       WMITLV_TAG_STRUC_wmi_channel,
-			       WMITLV_GET_STRUCT_TLVLEN(wmi_channel));
-		chan_info->mhz = tchan_info->mhz;
-		chan_info->band_center_freq1 =
-				 tchan_info->band_center_freq1;
-		chan_info->band_center_freq2 =
-				tchan_info->band_center_freq2;
-		chan_info->info = tchan_info->info;
-		chan_info->reg_info_1 = tchan_info->reg_info_1;
-		chan_info->reg_info_2 = tchan_info->reg_info_2;
-		WMI_LOGD("chan[%d] = %u", i, chan_info->mhz);
-
-		/*TODO: Set WMI_SET_CHANNEL_MIN_POWER */
-		/*TODO: Set WMI_SET_CHANNEL_ANTENNA_MAX */
-		/*TODO: WMI_SET_CHANNEL_REG_CLASSID */
-		tchan_info++;
-		chan_info++;
-	}
-	cmd->pdev_id = wmi_handle->ops->convert_pdev_id_host_to_target(
-							chan_list->pdev_id);
-
-	wmi_mtrace(WMI_SCAN_CHAN_LIST_CMDID, NO_SESSION, 0);
-	qdf_status = wmi_unified_cmd_send(wmi_handle,
-			buf, len, WMI_SCAN_CHAN_LIST_CMDID);
-
-	if (QDF_IS_STATUS_ERROR(qdf_status)) {
-		WMI_LOGE("Failed to send WMI_SCAN_CHAN_LIST_CMDID");
-		wmi_buf_free(buf);
-	}
-
-end:
-	return qdf_status;
-}
-#else
 static QDF_STATUS send_scan_chan_list_cmd_tlv(wmi_unified_t wmi_handle,
 				struct scan_chan_list_params *chan_list)
 {
@@ -2845,38 +2765,41 @@ static QDF_STATUS send_scan_chan_list_cmd_tlv(wmi_unified_t wmi_handle,
 
 		if (tchan_info->is_chan_passive)
 			WMI_SET_CHANNEL_FLAG(chan_info,
-					WMI_CHAN_FLAG_PASSIVE);
+					     WMI_CHAN_FLAG_PASSIVE);
+		if (tchan_info->dfs_set)
+			WMI_SET_CHANNEL_FLAG(chan_info,
+					     WMI_CHAN_FLAG_DFS);
 
 		if (tchan_info->allow_vht)
 			WMI_SET_CHANNEL_FLAG(chan_info,
-					WMI_CHAN_FLAG_ALLOW_VHT);
-		else  if (tchan_info->allow_ht)
+					     WMI_CHAN_FLAG_ALLOW_VHT);
+		if (tchan_info->allow_ht)
 			WMI_SET_CHANNEL_FLAG(chan_info,
-					WMI_CHAN_FLAG_ALLOW_HT);
+					     WMI_CHAN_FLAG_ALLOW_HT);
 		WMI_SET_CHANNEL_MODE(chan_info,
-				tchan_info->phy_mode);
+				     tchan_info->phy_mode);
 
 		if (tchan_info->half_rate)
 			WMI_SET_CHANNEL_FLAG(chan_info,
-					WMI_CHAN_FLAG_HALF_RATE);
+					     WMI_CHAN_FLAG_HALF_RATE);
 
 		if (tchan_info->quarter_rate)
 			WMI_SET_CHANNEL_FLAG(chan_info,
-					WMI_CHAN_FLAG_QUARTER_RATE);
+					     WMI_CHAN_FLAG_QUARTER_RATE);
 
 		/* also fill in power information */
 		WMI_SET_CHANNEL_MIN_POWER(chan_info,
-				tchan_info->minpower);
+					  tchan_info->minpower);
 		WMI_SET_CHANNEL_MAX_POWER(chan_info,
-				tchan_info->maxpower);
+					  tchan_info->maxpower);
 		WMI_SET_CHANNEL_REG_POWER(chan_info,
-				tchan_info->maxregpower);
+					  tchan_info->maxregpower);
 		WMI_SET_CHANNEL_ANTENNA_MAX(chan_info,
-				tchan_info->antennamax);
+					    tchan_info->antennamax);
 		WMI_SET_CHANNEL_REG_CLASSID(chan_info,
-				tchan_info->reg_class_id);
+					    tchan_info->reg_class_id);
 		WMI_SET_CHANNEL_MAX_TX_POWER(chan_info,
-				tchan_info->maxregpower);
+					     tchan_info->maxregpower);
 
 		WMI_LOGD("chan[%d] = %u", i, chan_info->mhz);
 
@@ -2899,7 +2822,6 @@ static QDF_STATUS send_scan_chan_list_cmd_tlv(wmi_unified_t wmi_handle,
 end:
 	return qdf_status;
 }
-#endif
 
 /**
  * populate_tx_send_params - Populate TX param TLV for mgmt and offchan tx