diff --git a/target_if/crypto/src/target_if_crypto.c b/target_if/crypto/src/target_if_crypto.c index 737e0be0a9cc..95cd3a320acf 100644 --- a/target_if/crypto/src/target_if_crypto.c +++ b/target_if/crypto/src/target_if_crypto.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019 The Linux Foundation. All rights reserved. + * Copyright (c) 2019-2020 The Linux Foundation. All rights reserved. * * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the @@ -195,16 +195,14 @@ QDF_STATUS target_if_crypto_set_key(struct wlan_objmgr_vdev *vdev, &req->keyval[0], req->keylen); params.key_len = req->keylen; - if (peer) { - /* Set PN check & security type in data path */ - qdf_mem_copy(&pn[0], ¶ms.key_rsc_ctr, sizeof(pn)); - cdp_set_pn_check(soc, vdev->vdev_objmgr.vdev_id, req->macaddr, - sec_type, pn); - cdp_set_key(soc, peer, pairwise, (uint32_t *)(req->keyval + - WLAN_CRYPTO_IV_SIZE + WLAN_CRYPTO_MIC_LEN)); - } else { - target_if_info("peer not found"); - } + + /* Set PN check & security type in data path */ + qdf_mem_copy(&pn[0], ¶ms.key_rsc_ctr, sizeof(pn)); + cdp_set_pn_check(soc, vdev->vdev_objmgr.vdev_id, req->macaddr, + sec_type, pn); + cdp_set_key(soc, vdev->vdev_objmgr.vdev_id, req->macaddr, pairwise, + (uint32_t *)(req->keyval + WLAN_CRYPTO_IV_SIZE + + WLAN_CRYPTO_MIC_LEN)); target_if_debug("vdev_id:%d, key: idx:%d,len:%d", params.vdev_id, params.key_idx, params.key_len); diff --git a/target_if/mlme/vdev_mgr/src/target_if_vdev_mgr_tx_ops.c b/target_if/mlme/vdev_mgr/src/target_if_vdev_mgr_tx_ops.c index 8c617d72ad17..39a074d8db30 100644 --- a/target_if/mlme/vdev_mgr/src/target_if_vdev_mgr_tx_ops.c +++ b/target_if/mlme/vdev_mgr/src/target_if_vdev_mgr_tx_ops.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019 The Linux Foundation. All rights reserved. + * Copyright (c) 2019-2020 The Linux Foundation. All rights reserved. * * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the @@ -308,24 +308,27 @@ QDF_STATUS target_if_vdev_set_tx_rx_decap_type(struct wlan_objmgr_vdev *vdev, uint32_t value) { ol_txrx_soc_handle soc_txrx_handle; - struct cdp_vdev *vdev_txrx_handle; struct wlan_objmgr_psoc *psoc; + uint8_t vdev_id = wlan_vdev_get_id(vdev); + cdp_config_param_type val = {0}; psoc = wlan_vdev_get_psoc(vdev); soc_txrx_handle = wlan_psoc_get_dp_handle(psoc); - vdev_txrx_handle = wlan_vdev_get_dp_handle(vdev); - if (!soc_txrx_handle || !vdev_txrx_handle) + if (!soc_txrx_handle) return QDF_STATUS_E_INVAL; - if (param_id == WLAN_MLME_CFG_TX_ENCAP_TYPE) - cdp_set_tx_encap_type(soc_txrx_handle, - (struct cdp_vdev *)vdev_txrx_handle, - value); - else if (param_id == WLAN_MLME_CFG_RX_DECAP_TYPE) - cdp_set_vdev_rx_decap_type(soc_txrx_handle, - (struct cdp_vdev *)vdev_txrx_handle, - value); + if (param_id == WLAN_MLME_CFG_TX_ENCAP_TYPE) { + val.cdp_vdev_param_tx_encap = value; + return cdp_txrx_set_vdev_param(soc_txrx_handle, + vdev_id, CDP_TX_ENCAP_TYPE, + val); + } else if (param_id == WLAN_MLME_CFG_RX_DECAP_TYPE) { + val.cdp_vdev_param_rx_decap = value; + return cdp_txrx_set_vdev_param(soc_txrx_handle, + vdev_id, CDP_RX_DECAP_TYPE, + val); + } return QDF_STATUS_SUCCESS; }