diff --git a/umac/cmn_services/crypto/inc/wlan_crypto_global_def.h b/umac/cmn_services/crypto/inc/wlan_crypto_global_def.h index 34bea3450e89..607cc781d300 100644 --- a/umac/cmn_services/crypto/inc/wlan_crypto_global_def.h +++ b/umac/cmn_services/crypto/inc/wlan_crypto_global_def.h @@ -94,6 +94,8 @@ #define WLAN_CRYPTO_KEY_SWDECRYPT (0x100) /* host-based demic */ #define WLAN_CRYPTO_KEY_SWDEMIC (0x200) +/* get pn from fw for key */ +#define WLAN_CRYPTO_KEY_GET_PN (0x400) #define WLAN_CRYPTO_KEY_SWCRYPT (WLAN_CRYPTO_KEY_SWENCRYPT \ | WLAN_CRYPTO_KEY_SWDECRYPT) @@ -352,6 +354,7 @@ struct wlan_crypto_req_key { * @delkey: function pointer to delkey in hw * @defaultkey: function pointer to set default key * @set_key: converged function pointer to set key in hw + * @getpn: function pointer to get current pn value of peer */ struct wlan_lmac_if_crypto_tx_ops { @@ -369,6 +372,8 @@ struct wlan_lmac_if_crypto_tx_ops { QDF_STATUS (*set_key)(struct wlan_objmgr_vdev *vdev, struct wlan_crypto_key *key, enum wlan_crypto_key_type key_type); + QDF_STATUS(*getpn)(struct wlan_objmgr_vdev *vdev, + uint8_t *macaddr, uint32_t key_type); }; /** diff --git a/umac/cmn_services/crypto/src/wlan_crypto_def_i.h b/umac/cmn_services/crypto/src/wlan_crypto_def_i.h index adfdb5f29270..e08968bd99ad 100644 --- a/umac/cmn_services/crypto/src/wlan_crypto_def_i.h +++ b/umac/cmn_services/crypto/src/wlan_crypto_def_i.h @@ -171,6 +171,8 @@ static inline void wlan_crypto_put_be64(u8 *a, u64 val) (psoc->soc_cb.tx_ops.crypto_tx_ops.defaultkey) #define WLAN_CRYPTO_TX_OPS_SET_KEY(psoc) \ ((psoc)->soc_cb.tx_ops.crypto_tx_ops.set_key) +#define WLAN_CRYPTO_TX_OPS_GETPN(psoc) \ + ((psoc)->soc_cb.tx_ops.crypto_tx_ops.getpn) /* unalligned little endian access */ #ifndef LE_READ_2 diff --git a/umac/cmn_services/crypto/src/wlan_crypto_global_api.c b/umac/cmn_services/crypto/src/wlan_crypto_global_api.c index 4087c4cfd2ef..22793fd0ce4b 100644 --- a/umac/cmn_services/crypto/src/wlan_crypto_global_api.c +++ b/umac/cmn_services/crypto/src/wlan_crypto_global_api.c @@ -968,6 +968,10 @@ QDF_STATUS wlan_crypto_getkey(struct wlan_objmgr_vdev *vdev, return QDF_STATUS_E_NOENT; } key = wlan_crypto_peer_getkey(peer, req_key->keyix); + if (WLAN_CRYPTO_TX_OPS_GETPN(psoc) && + (req_key->flags & WLAN_CRYPTO_KEY_GET_PN)) + WLAN_CRYPTO_TX_OPS_GETPN(psoc)(vdev, mac_addr, + req_key->type); wlan_objmgr_peer_release_ref(peer, WLAN_CRYPTO_ID); if (!key) return QDF_STATUS_E_INVAL;