qcacld-3.0: Implement a generic API to set session param from HDD
Currently, in host driver, ssid hide which is a session specific
parameter is set on reception of corresponding iwpriv command. Driver
would need to handle similar cases of setting session specific parameter
from HDD[ need this for setting ignore assoc disallowed parameter
for MBO].
Modify the ssid hide API's to generic so that the same API can be
used for setting any session specific paramater in future.
Change-Id: I29c62ff4a6f6d9ed1ff4a0f31a82727eb623bfd4
CRs-Fixed: 1072081
diff --git a/core/mac/src/pe/lim/lim_process_sme_req_messages.c b/core/mac/src/pe/lim/lim_process_sme_req_messages.c
index 9aea67e..131ce42 100644
--- a/core/mac/src/pe/lim/lim_process_sme_req_messages.c
+++ b/core/mac/src/pe/lim/lim_process_sme_req_messages.c
@@ -4193,46 +4193,76 @@
}
}
-static void __lim_process_sme_hide_ssid(tpAniSirGlobal pMac, uint32_t *pMsgBuf)
+/*
+ * lim_handle_update_ssid_hidden() - Processes SSID hidden update
+ * @mac_ctx: Pointer to global mac context
+ * @session: Pointer to PE session
+ * @ssid_hidden: SSID hidden value to set; 0 - Broadcast SSID,
+ * 1 - Disable broadcast SSID
+ *
+ * Return: None
+ */
+static void lim_handle_update_ssid_hidden(tpAniSirGlobal mac_ctx,
+ tpPESession session, uint8_t ssid_hidden)
{
- tpSirUpdateParams pUpdateParams;
- tpPESession psessionEntry;
-
- PELOG1(lim_log(pMac, LOG1, FL("received HIDE_SSID message")););
-
- if (pMsgBuf == NULL) {
- lim_log(pMac, LOGE, FL("Buffer is Pointing to NULL"));
- return;
- }
-
- pUpdateParams = (tpSirUpdateParams) pMsgBuf;
-
- psessionEntry = pe_find_session_by_sme_session_id(pMac,
- pUpdateParams->sessionId);
- if (psessionEntry == NULL) {
- lim_log(pMac, LOGW,
- "Session does not exist for given sessionId %d",
- pUpdateParams->sessionId);
- return;
- }
-
- if (psessionEntry->ssidHidden != pUpdateParams->ssidHidden) {
- /* Update the session entry */
- psessionEntry->ssidHidden = pUpdateParams->ssidHidden;
- } else {
- lim_log(pMac, LOG1, FL("Same config already present!"));
+ lim_log(mac_ctx, LOG1, FL("received HIDE_SSID message"));
+ if (ssid_hidden != session->ssidHidden)
+ session->ssidHidden = ssid_hidden;
+ else {
+ lim_log(mac_ctx, LOG1, FL("Same config already present!"));
return;
}
/* Send vdev restart */
- lim_send_vdev_restart(pMac, psessionEntry, pUpdateParams->sessionId);
+ lim_send_vdev_restart(mac_ctx, session, session->smeSessionId);
/* Update beacon */
- sch_set_fixed_beacon_fields(pMac, psessionEntry);
- lim_send_beacon_ind(pMac, psessionEntry);
+ sch_set_fixed_beacon_fields(mac_ctx, session);
+ lim_send_beacon_ind(mac_ctx, session);
return;
-} /*** end __lim_process_sme_hide_ssid(tpAniSirGlobal pMac, uint32_t *pMsgBuf) ***/
+}
+
+/**
+ * __lim_process_sme_session_update - process SME session update msg
+ *
+ * @mac_ctx: Pointer to global mac context
+ * @msg_buf: Pointer to the received message buffer
+ *
+ * Return: None
+ */
+static void __lim_process_sme_session_update(tpAniSirGlobal mac_ctx,
+ uint32_t *msg_buf)
+{
+ struct sir_update_session_param *msg;
+ tpPESession session;
+
+ if (!msg_buf) {
+ lim_log(mac_ctx, LOGE, FL("Buffer is Pointing to NULL"));
+ return;
+ }
+
+ msg = (struct sir_update_session_param *) msg_buf;
+
+ session = pe_find_session_by_sme_session_id(mac_ctx, msg->session_id);
+ if (!session) {
+ lim_log(mac_ctx, LOGW,
+ "Session does not exist for given sessionId %d",
+ msg->session_id);
+ return;
+ }
+
+ lim_log(mac_ctx, LOG1, FL("received SME Session update for %d val %d"),
+ msg->param_type, msg->param_val);
+ switch (msg->param_type) {
+ case SIR_PARAM_SSID_HIDDEN:
+ lim_handle_update_ssid_hidden(mac_ctx, session, msg->param_val);
+ break;
+ default:
+ lim_log(mac_ctx, LOGE, FL("Unknown session param"));
+ break;
+ }
+}
static void __lim_process_sme_set_wparsni_es(tpAniSirGlobal pMac, uint32_t *pMsgBuf)
{
@@ -5259,8 +5289,8 @@
lim_process_tkip_counter_measures(pMac, pMsgBuf);
break;
- case eWNI_SME_HIDE_SSID_REQ:
- __lim_process_sme_hide_ssid(pMac, pMsgBuf);
+ case eWNI_SME_SESSION_UPDATE_PARAM:
+ __lim_process_sme_session_update(pMac, pMsgBuf);
break;
case eWNI_SME_ROAM_SCAN_OFFLOAD_REQ:
__lim_process_roam_scan_offload_req(pMac, pMsgBuf);