mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-12 07:37:31 -04:00
Merge "qcacmn: For STA mode, set ucast key for bsspeer macaddr in crypto setkey"
This commit is contained in:
commit
cc203fd391
4 changed files with 51 additions and 0 deletions
|
|
@ -91,11 +91,20 @@ static inline qdf_time_t qdf_get_system_uptime(void)
|
|||
* Return:
|
||||
* The time since system booted in nanoseconds
|
||||
*/
|
||||
|
||||
#if (LINUX_VERSION_CODE > KERNEL_VERSION(3, 10, 0))
|
||||
static inline s64 qdf_get_bootbased_boottime_ns(void)
|
||||
{
|
||||
return ktime_get_boot_ns();
|
||||
}
|
||||
|
||||
#else
|
||||
static inline s64 qdf_get_bootbased_boottime_ns(void)
|
||||
{
|
||||
return ktime_to_ns(ktime_get_boottime());
|
||||
}
|
||||
#endif
|
||||
|
||||
/**
|
||||
* qdf_get_system_timestamp - Return current timestamp
|
||||
*
|
||||
|
|
|
|||
|
|
@ -602,6 +602,19 @@ int qdf_set_dma_coherent_mask(struct device *dev, uint8_t addr_bits)
|
|||
return __qdf_set_dma_coherent_mask(dev, addr_bits);
|
||||
}
|
||||
|
||||
/**
|
||||
* qdf_do_div() - wrapper function for kernel macro(do_div).
|
||||
* @dividend: Dividend value
|
||||
* @divisor : Divisor value
|
||||
*
|
||||
* Return: Quotient
|
||||
*/
|
||||
static inline
|
||||
uint64_t qdf_do_div(uint64_t dividend, uint32_t divisor)
|
||||
{
|
||||
return __qdf_do_div(dividend, divisor);
|
||||
}
|
||||
|
||||
/**
|
||||
* qdf_get_random_bytes() - returns nbytes bytes of random
|
||||
* data
|
||||
|
|
|
|||
|
|
@ -422,4 +422,19 @@ void __qdf_get_random_bytes(void *buf, int nbytes)
|
|||
return get_random_bytes(buf, nbytes);
|
||||
}
|
||||
|
||||
/**
|
||||
* __qdf_do_div() - wrapper function for kernel macro(do_div).
|
||||
* @dividend: Dividend value
|
||||
* @divisor : Divisor value
|
||||
*
|
||||
* Return: Quotient
|
||||
*/
|
||||
static inline
|
||||
uint64_t __qdf_do_div(uint64_t dividend, uint32_t divisor)
|
||||
{
|
||||
do_div(dividend, divisor);
|
||||
/*do_div macro updates dividend with Quotient of dividend/divisor */
|
||||
return dividend;
|
||||
}
|
||||
|
||||
#endif /*_I_QDF_UTIL_H*/
|
||||
|
|
|
|||
|
|
@ -382,6 +382,20 @@ QDF_STATUS wlan_crypto_setkey(struct wlan_objmgr_vdev *vdev,
|
|||
}
|
||||
key = crypto_priv->key[req_key->keyix];
|
||||
}
|
||||
if (vdev_mode == QDF_STA_MODE) {
|
||||
peer = wlan_vdev_get_bsspeer(vdev);
|
||||
if (!peer) {
|
||||
qdf_print("%s[%d] peer is null\n",
|
||||
__func__, __LINE__);
|
||||
return QDF_STATUS_E_INVAL;
|
||||
}
|
||||
wlan_objmgr_peer_try_get_ref(peer, WLAN_CRYPTO_ID);
|
||||
wlan_peer_obj_lock(peer);
|
||||
qdf_mem_copy(macaddr, wlan_peer_get_macaddr(peer),
|
||||
WLAN_ALEN);
|
||||
wlan_peer_obj_unlock(peer);
|
||||
wlan_objmgr_peer_release_ref(peer, WLAN_CRYPTO_ID);
|
||||
}
|
||||
} else {
|
||||
peer = wlan_objmgr_get_peer_by_mac_n_vdev(
|
||||
psoc,
|
||||
|
|
|
|||
Loading…
Reference in a new issue