qcacmn: Obtain current PN number for a peer

On rekey, the STA resets it’s PN to 0 but, the
AP sends out pending traffic with old PN values
before it resets the PN as well.
This causes traffic to stall and hence, TSC (transmit
sequence counter) should not be set to zero during rekey.

Instead, obtain last PN number for a non-bss peer while
configuring new key and pass the values to hostap.

Change-Id: I4a604f23944c941c6ade2f57ab03781bc78f7b40
Cette révision appartient à :
Disha Das
2019-12-10 10:21:16 +05:30
révisé par nshrivas
Parent 7628a42ab1
révision cde63cdd01
3 fichiers modifiés avec 11 ajouts et 0 suppressions

Voir le fichier

@@ -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);
};
/**

Voir le fichier

@@ -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

Voir le fichier

@@ -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;