From e6de7e02fb9c516eb24f5f4a8e6c893bb5651032 Mon Sep 17 00:00:00 2001 From: Kai Chen Date: Fri, 15 Dec 2017 14:06:06 -0800 Subject: [PATCH] qcacmn: Add min, max, reg max, antenna gain and max tx power Add min, max, reg max, antenna gain and max tx power to channel field of WMI command for scan, vdev start. Max tx power is set to reg max power. It is set to TPC on IE for MCL STA case. Change-Id: I416b94f68a9c5db925a9ef8c731350ba27caa7a1 --- wmi/src/wmi_unified_tlv.c | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/wmi/src/wmi_unified_tlv.c b/wmi/src/wmi_unified_tlv.c index 6d440182285f..30829b6ad875 100644 --- a/wmi/src/wmi_unified_tlv.c +++ b/wmi/src/wmi_unified_tlv.c @@ -305,9 +305,16 @@ static inline void copy_channel_info( if (req->channel.dfs_set_cfreq2) WMI_SET_CHANNEL_FLAG(chan, WMI_CHAN_FLAG_DFS_CFREQ2); - /* FIXME: Find out min, max and regulatory power levels */ + /* According to firmware both reg power and max tx power + * on set channel power is used and set it to max reg + * power from regulatory. + */ + WMI_SET_CHANNEL_MIN_POWER(chan, req->channel.minpower); + WMI_SET_CHANNEL_MAX_POWER(chan, req->channel.maxpower); WMI_SET_CHANNEL_REG_POWER(chan, req->channel.maxregpower); - WMI_SET_CHANNEL_MAX_TX_POWER(chan, req->channel.maxpower); + WMI_SET_CHANNEL_ANTENNA_MAX(chan, req->channel.antennamax); + WMI_SET_CHANNEL_REG_CLASSID(chan, req->channel.reg_class_id); + WMI_SET_CHANNEL_MAX_TX_POWER(chan, req->channel.maxregpower); } #endif @@ -2876,6 +2883,8 @@ static QDF_STATUS send_scan_chan_list_cmd_tlv(wmi_unified_t wmi_handle, tchan_info->antennamax); WMI_SET_CHANNEL_REG_CLASSID(chan_info, tchan_info->reg_class_id); + WMI_SET_CHANNEL_MAX_TX_POWER(chan_info, + tchan_info->maxregpower); WMI_LOGD("chan[%d] = %u", i, chan_info->mhz); @@ -16527,6 +16536,7 @@ static QDF_STATUS send_multiple_vdev_restart_req_cmd_tlv( WMI_SET_CHANNEL_REG_POWER(chan_info, tchan_info->maxregpower); WMI_SET_CHANNEL_ANTENNA_MAX(chan_info, tchan_info->antennamax); WMI_SET_CHANNEL_REG_CLASSID(chan_info, tchan_info->reg_class_id); + WMI_SET_CHANNEL_MAX_TX_POWER(chan_info, tchan_info->maxregpower); qdf_status = wmi_unified_cmd_send(wmi_handle, buf, len, WMI_PDEV_MULTIPLE_VDEV_RESTART_REQUEST_CMDID);