Browse Source

qcacld-3.0: Fix to propagate key-receiver-sequence-counter to WMA

SME module propagates KeyRSC to MAC/PE module but MAC/PE doesn't
pass this counter to WMA and due to which WMA is not able pass to
next module.

Add a fix to propagate KeyRSC field from MAC to WMA module and further
down in stack.

CRs-Fixed: 2130761
Change-Id: I157a44610e184b5e10d838fbc5d6b810e3efd6db
Krunal Soni 7 years ago
parent
commit
8afae9b62d
3 changed files with 17 additions and 5 deletions
  1. 1 0
      core/mac/inc/sir_mac_prot_def.h
  2. 1 0
      core/wma/inc/wma.h
  3. 15 5
      core/wma/src/wma_mgmt.c

+ 1 - 0
core/mac/inc/sir_mac_prot_def.h

@@ -575,6 +575,7 @@
 
 /* / MAX key length when ULA is used */
 #define SIR_MAC_MAX_KEY_LENGTH               32
+#define SIR_MAC_MAX_KEY_RSC_LEN              16
 
 /* / Macro definitions for get/set on FC fields */
 #define SIR_MAC_GET_PROT_VERSION(x)      ((((uint16_t) x) & 0x0300) >> 8)

+ 1 - 0
core/wma/inc/wma.h

@@ -1780,6 +1780,7 @@ struct wma_set_key_params {
 	uint32_t key_idx;
 	bool unicast;
 	uint8_t key_data[SIR_MAC_MAX_KEY_LENGTH];
+	uint8_t key_rsc[SIR_MAC_MAX_KEY_RSC_LEN];
 };
 
 /**

+ 15 - 5
core/wma/src/wma_mgmt.c

@@ -1654,7 +1654,13 @@ static QDF_STATUS wma_setup_install_key_cmd(tp_wma_handle wma_handle,
 #endif
 	params.key_txmic_len = 0;
 	params.key_rxmic_len = 0;
-
+	params.key_rsc_counter = qdf_mem_malloc(sizeof(uint64_t));
+	if (!params.key_rsc_counter) {
+		WMA_LOGE(FL("can't allocate memory for key_rsc_counter"));
+		return QDF_STATUS_E_NOMEM;
+	}
+	qdf_mem_copy(params.key_rsc_counter,
+		     &key_params->key_rsc[0], sizeof(uint64_t));
 	params.key_flags = 0;
 	if (key_params->unicast)
 		params.key_flags |= PAIRWISE_USAGE;
@@ -1736,7 +1742,8 @@ static QDF_STATUS wma_setup_install_key_cmd(tp_wma_handle wma_handle,
 		/* TODO: MFP ? */
 		WMA_LOGE("%s:Invalid encryption type:%d", __func__,
 			 key_params->key_type);
-		return QDF_STATUS_E_NOMEM;
+		status = QDF_STATUS_E_NOMEM;
+		goto end;
 	}
 
 #ifdef BIG_ENDIAN_HOST
@@ -1789,17 +1796,17 @@ static QDF_STATUS wma_setup_install_key_cmd(tp_wma_handle wma_handle,
 	WMA_LOGD("unicast %d peer_mac %pM def_key_idx %d",
 		 key_params->unicast, key_params->peer_mac,
 		 key_params->def_key_idx);
+	WMA_LOGD("keyrsc param %llu", *(params.key_rsc_counter));
 
 	status = wmi_unified_setup_install_key_cmd(wma_handle->wmi_handle,
 								&params);
-
-
 	if (!key_params->unicast) {
 		/* Its GTK release the wake lock */
 		WMA_LOGD("Release set key wake lock");
 		wma_release_wakelock(&iface->vdev_set_key_wakelock);
 	}
-
+end:
+	qdf_mem_free(params.key_rsc_counter);
 	return status;
 }
 
@@ -1891,6 +1898,9 @@ void wma_set_bsskey(tp_wma_handle wma_handle, tpSetBssKeyParams key_info)
 			key_params.key_idx = key_info->key[i].keyId;
 
 		key_params.key_len = key_info->key[i].keyLength;
+		qdf_mem_copy(key_params.key_rsc,
+				key_info->key[i].keyRsc,
+				SIR_MAC_MAX_KEY_RSC_LEN);
 		if (key_info->encType == eSIR_ED_TKIP) {
 			qdf_mem_copy(key_params.key_data,
 				     key_info->key[i].key, 16);