qcacmn: cdp: Implement API cdp_set_key_sec_type

Peer key security type is set in cdp_set_pn_check,
this API is called in key install step, but only
update Ucast field even if in Mcast key install.
This may be set wrongly if Ucast and Mcast security
modes are different. Add a new API to set security
modes of differ key types separately.

Change-Id: Icaa63139d117de75633ca1f81eb618c6b9294b53
CRs-Fixed: 2617461
这个提交包含在:
Yu Tian
2020-02-10 12:54:10 +08:00
提交者 nshrivas
父节点 09815803eb
当前提交 0c6d94dd3e
修改 6 个文件,包含 92 行新增0 行删除

查看文件

@@ -3097,6 +3097,52 @@ fail:
}
/**
* dp_set_key_sec_type_wifi3() - set security mode of key
* @soc: Datapath soc handle
* @peer_mac: Datapath peer mac address
* @vdev_id: id of atapath vdev
* @vdev: Datapath vdev
* @pdev - data path device instance
* @sec_type - security type
* #is_unicast - key type
*
*/
QDF_STATUS
dp_set_key_sec_type_wifi3(struct cdp_soc_t *soc, uint8_t vdev_id,
uint8_t *peer_mac, enum cdp_sec_type sec_type,
bool is_unicast)
{
struct dp_peer *peer = dp_peer_find_hash_find((struct dp_soc *)soc,
peer_mac, 0, vdev_id);
QDF_STATUS status = QDF_STATUS_SUCCESS;
int sec_index;
if (!peer || peer->delete_in_progress) {
QDF_TRACE(QDF_MODULE_ID_DP, QDF_TRACE_LEVEL_DEBUG,
"%s: Peer is NULL!\n", __func__);
status = QDF_STATUS_E_FAILURE;
goto fail;
}
QDF_TRACE(QDF_MODULE_ID_DP, QDF_TRACE_LEVEL_INFO_HIGH,
"key sec spec for peer %pK %pM: %s key of type %d",
peer,
peer->mac_addr.raw,
is_unicast ? "ucast" : "mcast",
sec_type);
sec_index = is_unicast ? dp_sec_ucast : dp_sec_mcast;
peer->security[sec_index].sec_type = sec_type;
fail:
if (peer)
dp_peer_unref_delete(peer);
return status;
}
void
dp_rx_sec_ind_handler(struct dp_soc *soc, uint16_t peer_id,
enum cdp_sec_type sec_type, int is_unicast,