From 1c5d90287652535b3fd518ab4e3cb1d5cb56368a Mon Sep 17 00:00:00 2001 From: Ashish Kumar Dhanotiya Date: Fri, 14 Jul 2017 12:27:15 +0530 Subject: [PATCH 1/3] qcacmn: Add proper api for ktime_get_boot_ns for kernel 3.10 Kernel api ktime_get_boot_ns is not supported in kernel version 3.10 so add correct api for kernel 3.10. Change-Id: Id78d50d759db90a9c6edf4114f8af1a925dfb9bb CRs-Fixed: 2076538 --- qdf/inc/qdf_time.h | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/qdf/inc/qdf_time.h b/qdf/inc/qdf_time.h index 97cc43d5dc13..50cec4673a5d 100644 --- a/qdf/inc/qdf_time.h +++ b/qdf/inc/qdf_time.h @@ -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 * From 96b8cea9be12e75622775b99ded5cd8cc4be6c8f Mon Sep 17 00:00:00 2001 From: Yingying Tang Date: Mon, 6 Mar 2017 18:14:14 +0800 Subject: [PATCH 2/3] qcacmn: Fix "__aeabi_uldivmod" symbol error There is an unknown symbol error "__aeabi_uldivmod" due to a division operation between uint64 value in wlan driver. Add qdf API to use do_div to avoid "__aeabi_uldivmod" symbol error. Change-Id: I24e51990ff9e0ecea327ad9c71266fd768d62a6c CRs-Fixed: 2013952 --- qdf/inc/qdf_util.h | 13 +++++++++++++ qdf/linux/src/i_qdf_util.h | 15 +++++++++++++++ 2 files changed, 28 insertions(+) diff --git a/qdf/inc/qdf_util.h b/qdf/inc/qdf_util.h index b5b19f22cda1..c2c4823d1eaa 100644 --- a/qdf/inc/qdf_util.h +++ b/qdf/inc/qdf_util.h @@ -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 diff --git a/qdf/linux/src/i_qdf_util.h b/qdf/linux/src/i_qdf_util.h index e419dd6498d9..6068291823ef 100644 --- a/qdf/linux/src/i_qdf_util.h +++ b/qdf/linux/src/i_qdf_util.h @@ -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*/ From e9f8070cee1cc7c05e4227ae8cf2d8e061567c3b Mon Sep 17 00:00:00 2001 From: Nandha Kishore Easwaran Date: Fri, 21 Jul 2017 18:00:56 +0530 Subject: [PATCH 3/3] qcacmn: For STA mode, set ucast key for bsspeer macaddr in crypto setkey Change-Id: Idffa8bce38bb73d35c23678267a08f3b20be0e56 --- .../crypto/src/wlan_crypto_global_api.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) 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 66016e59cb89..bbe047c80d88 100644 --- a/umac/cmn_services/crypto/src/wlan_crypto_global_api.c +++ b/umac/cmn_services/crypto/src/wlan_crypto_global_api.c @@ -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,