summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMukul Sharma <mukul@codeaurora.org>2016-10-03 15:04:20 +0530
committerqcabuildsw <qcabuildsw@localhost>2016-10-13 11:47:01 -0700
commit84d83c17181c00da5fd9e852d91bd295492bc123 (patch)
treec65b8769222e15c7bc632557218c17debcf8b7ae
parent83570218c850b0e1f0a6530b17606776c5678871 (diff)
qcacmn: Enhance EPNO feature
qcacld-2.0 to qcacmn propagation Make the following enhancements to the EPNO feature: 1) Implement the reset EPNO command handler 2) Add new parameters for candidate score calculation. Change-Id: Iad1ff9c2b003c9e3ddbc3373366686040ccb55ca CRs-Fixed: 1075380
-rw-r--r--wmi/inc/wmi_unified_param.h19
-rw-r--r--wmi/src/wmi_unified_tlv.c144
2 files changed, 110 insertions, 53 deletions
diff --git a/wmi/inc/wmi_unified_param.h b/wmi/inc/wmi_unified_param.h
index 8c2428a2ca45..b00e273f6c54 100644
--- a/wmi/inc/wmi_unified_param.h
+++ b/wmi/inc/wmi_unified_param.h
@@ -1803,12 +1803,29 @@ struct wifi_epno_network_params {
/**
* struct wifi_enhanched_pno_params - enhanced pno network params
+ * @request_id: request id number
+ * @session_id: session_id number
+ * @min_5ghz_rssi: minimum 5GHz RSSI for a BSSID to be considered
+ * @min_24ghz_rssi: minimum 2.4GHz RSSI for a BSSID to be considered
+ * @initial_score_max: maximum score that a network can have before bonuses
+ * @current_connection_bonus: only report when there is a network's score this
+ * much higher than the current connection
+ * @same_network_bonus: score bonus for all n/w with the same network flag
+ * @secure_bonus: score bonus for networks that are not open
+ * @band_5ghz_bonus: 5GHz RSSI score bonus (applied to all 5GHz networks)
* @num_networks: number of ssids
- * @networks: PNO networks
+ * @networks: EPNO networks
*/
struct wifi_enhanched_pno_params {
uint32_t request_id;
uint32_t session_id;
+ uint32_t min_5ghz_rssi;
+ uint32_t min_24ghz_rssi;
+ uint32_t initial_score_max;
+ uint32_t current_connection_bonus;
+ uint32_t same_network_bonus;
+ uint32_t secure_bonus;
+ uint32_t band_5ghz_bonus;
uint32_t num_networks;
struct wifi_epno_network_params networks[];
};
diff --git a/wmi/src/wmi_unified_tlv.c b/wmi/src/wmi_unified_tlv.c
index e623baaaf671..049c11ca3efc 100644
--- a/wmi/src/wmi_unified_tlv.c
+++ b/wmi/src/wmi_unified_tlv.c
@@ -4774,18 +4774,28 @@ QDF_STATUS send_set_epno_network_list_cmd_tlv(wmi_unified_t wmi_handle,
{
wmi_nlo_config_cmd_fixed_param *cmd;
nlo_configured_parameters *nlo_list;
+ enlo_candidate_score_params *cand_score_params;
u_int8_t i, *buf_ptr;
wmi_buf_t buf;
uint32_t len;
QDF_STATUS ret;
- /* TLV place holder for array of structures
- * nlo_configured_parameters(nlo_list) */
- len = sizeof(*cmd) + WMI_TLV_HDR_SIZE;
- len += sizeof(nlo_configured_parameters) *
- QDF_MIN(req->num_networks, WMI_NLO_MAX_SSIDS);
- len += WMI_TLV_HDR_SIZE; /* TLV for channel_list */
- len += WMI_TLV_HDR_SIZE; /* TLV for channel prediction cfg*/
+ /* Fixed Params */
+ len = sizeof(*cmd);
+ if (req->num_networks) {
+ /* TLV place holder for array of structures
+ * then each nlo_configured_parameters(nlo_list) TLV.
+ */
+ len += WMI_TLV_HDR_SIZE;
+ len += (sizeof(nlo_configured_parameters)
+ * QDF_MIN(req->num_networks, WMI_NLO_MAX_SSIDS));
+ /* TLV for array of uint32 channel_list */
+ len += WMI_TLV_HDR_SIZE;
+ /* TLV for nlo_channel_prediction_cfg */
+ len += WMI_TLV_HDR_SIZE;
+ /* TLV for candidate score params */
+ len += sizeof(enlo_candidate_score_params);
+ }
buf = wmi_buf_alloc(wmi_handle, len);
if (!buf) {
@@ -4801,65 +4811,94 @@ QDF_STATUS send_set_epno_network_list_cmd_tlv(wmi_unified_t wmi_handle,
WMITLV_GET_STRUCT_TLVLEN(
wmi_nlo_config_cmd_fixed_param));
cmd->vdev_id = req->session_id;
- cmd->flags = WMI_NLO_CONFIG_ENLO;
+
+ /* set flag to reset if num of networks are 0 */
+ cmd->flags = (req->num_networks == 0 ?
+ WMI_NLO_CONFIG_ENLO_RESET : WMI_NLO_CONFIG_ENLO);
buf_ptr += sizeof(wmi_nlo_config_cmd_fixed_param);
cmd->no_of_ssids = QDF_MIN(req->num_networks, WMI_NLO_MAX_SSIDS);
- WMI_LOGD("SSID count: %d", cmd->no_of_ssids);
- WMITLV_SET_HDR(buf_ptr, WMITLV_TAG_ARRAY_STRUC,
- cmd->no_of_ssids * sizeof(nlo_configured_parameters));
- buf_ptr += WMI_TLV_HDR_SIZE;
-
- nlo_list = (nlo_configured_parameters *) buf_ptr;
- for (i = 0; i < cmd->no_of_ssids; i++) {
- WMITLV_SET_HDR(&nlo_list[i].tlv_header,
- WMITLV_TAG_ARRAY_BYTE,
- WMITLV_GET_STRUCT_TLVLEN(nlo_configured_parameters));
- /* Copy ssid and it's length */
- nlo_list[i].ssid.valid = true;
- nlo_list[i].ssid.ssid.ssid_len = req->networks[i].ssid.length;
- qdf_mem_copy(nlo_list[i].ssid.ssid.ssid,
- req->networks[i].ssid.mac_ssid,
- nlo_list[i].ssid.ssid.ssid_len);
- WMI_LOGD("index: %d ssid: %.*s len: %d", i,
- nlo_list[i].ssid.ssid.ssid_len,
- (char *) nlo_list[i].ssid.ssid.ssid,
- nlo_list[i].ssid.ssid.ssid_len);
+ WMI_LOGD("SSID count: %d flags: %d",
+ cmd->no_of_ssids, cmd->flags);
- /* Copy rssi threshold */
- nlo_list[i].rssi_cond.valid = true;
- nlo_list[i].rssi_cond.rssi =
- req->networks[i].rssi_threshold;
- WMI_LOGD("RSSI threshold : %d dBm",
- nlo_list[i].rssi_cond.rssi);
+ /* Fill nlo_config only when num_networks are non zero */
+ if (cmd->no_of_ssids) {
+ /* Fill networks */
+ WMITLV_SET_HDR(buf_ptr, WMITLV_TAG_ARRAY_STRUC,
+ cmd->no_of_ssids * sizeof(nlo_configured_parameters));
+ buf_ptr += WMI_TLV_HDR_SIZE;
- /* Copy pno flags */
- nlo_list[i].bcast_nw_type.valid = true;
- nlo_list[i].bcast_nw_type.bcast_nw_type =
- req->networks[i].flags;
- WMI_LOGD("PNO flags (%u)",
+ nlo_list = (nlo_configured_parameters *) buf_ptr;
+ for (i = 0; i < cmd->no_of_ssids; i++) {
+ WMITLV_SET_HDR(&nlo_list[i].tlv_header,
+ WMITLV_TAG_ARRAY_BYTE,
+ WMITLV_GET_STRUCT_TLVLEN(
+ nlo_configured_parameters));
+ /* Copy ssid and it's length */
+ nlo_list[i].ssid.valid = true;
+ nlo_list[i].ssid.ssid.ssid_len =
+ req->networks[i].ssid.length;
+ qdf_mem_copy(nlo_list[i].ssid.ssid.ssid,
+ req->networks[i].ssid.mac_ssid,
+ nlo_list[i].ssid.ssid.ssid_len);
+ WMI_LOGD("index: %d ssid: %.*s len: %d", i,
+ nlo_list[i].ssid.ssid.ssid_len,
+ (char *) nlo_list[i].ssid.ssid.ssid,
+ nlo_list[i].ssid.ssid.ssid_len);
+
+ /* Copy pno flags */
+ nlo_list[i].bcast_nw_type.valid = true;
+ nlo_list[i].bcast_nw_type.bcast_nw_type =
+ req->networks[i].flags;
+ WMI_LOGD("PNO flags (%u)",
nlo_list[i].bcast_nw_type.bcast_nw_type);
- /* Copy auth bit field */
- nlo_list[i].auth_type.valid = true;
- nlo_list[i].auth_type.auth_type =
- req->networks[i].auth_bit_field;
- WMI_LOGD("Auth bit field (%u)",
- nlo_list[i].auth_type.auth_type);
- }
+ /* Copy auth bit field */
+ nlo_list[i].auth_type.valid = true;
+ nlo_list[i].auth_type.auth_type =
+ req->networks[i].auth_bit_field;
+ WMI_LOGD("Auth bit field (%u)",
+ nlo_list[i].auth_type.auth_type);
+ }
- buf_ptr += cmd->no_of_ssids * sizeof(nlo_configured_parameters);
- WMITLV_SET_HDR(buf_ptr, WMITLV_TAG_ARRAY_UINT32, 0);
- buf_ptr += WMI_TLV_HDR_SIZE;
+ buf_ptr += cmd->no_of_ssids * sizeof(nlo_configured_parameters);
+ /* Fill the channel list */
+ WMITLV_SET_HDR(buf_ptr, WMITLV_TAG_ARRAY_UINT32, 0);
+ buf_ptr += WMI_TLV_HDR_SIZE;
+
+ /* Fill prediction_param */
+ WMITLV_SET_HDR(buf_ptr, WMITLV_TAG_ARRAY_STRUC, 0);
+ buf_ptr += WMI_TLV_HDR_SIZE;
+
+ /* Fill epno candidate score params */
+ cand_score_params = (enlo_candidate_score_params *) buf_ptr;
+ WMITLV_SET_HDR(buf_ptr,
+ WMITLV_TAG_STRUC_enlo_candidate_score_param,
+ WMITLV_GET_STRUCT_TLVLEN(enlo_candidate_score_params));
+ cand_score_params->min5GHz_rssi =
+ req->min_5ghz_rssi;
+ cand_score_params->min24GHz_rssi =
+ req->min_24ghz_rssi;
+ cand_score_params->initial_score_max =
+ req->initial_score_max;
+ cand_score_params->current_connection_bonus =
+ req->current_connection_bonus;
+ cand_score_params->same_network_bonus =
+ req->same_network_bonus;
+ cand_score_params->secure_bonus =
+ req->secure_bonus;
+ cand_score_params->band5GHz_bonus =
+ req->band_5ghz_bonus;
+ buf_ptr += sizeof(enlo_candidate_score_params);
+ }
- WMITLV_SET_HDR(buf_ptr, WMITLV_TAG_ARRAY_STRUC, 0);
- buf_ptr += WMI_TLV_HDR_SIZE;
ret = wmi_unified_cmd_send(wmi_handle, buf, len,
- WMI_NETWORK_LIST_OFFLOAD_CONFIG_CMDID);
+ WMI_NETWORK_LIST_OFFLOAD_CONFIG_CMDID);
if (QDF_IS_STATUS_ERROR(ret)) {
WMI_LOGE("%s: Failed to send nlo wmi cmd", __func__);
wmi_buf_free(buf);
+ return QDF_STATUS_E_INVAL;
}
WMI_LOGD("set ePNO list request sent successfully for vdev %d",
@@ -4868,6 +4907,7 @@ QDF_STATUS send_set_epno_network_list_cmd_tlv(wmi_unified_t wmi_handle,
return ret;
}
+
/** send_ipa_offload_control_cmd_tlv() - ipa offload control parameter
* @wmi_handle: wmi handle
* @ipa_offload: ipa offload control parameter