diff options
| author | Mahesh Kumar Kalikot Veetil <mkalikot@codeaurora.org> | 2018-03-26 14:46:59 -0700 |
|---|---|---|
| committer | Dundi Raviteja <dundi@codeaurora.org> | 2018-07-17 12:37:42 +0530 |
| commit | 6accff6c4a70c16e6b449033d7705f6224efb800 (patch) | |
| tree | fa66d67e427a8fae24b58819cc7156470cbc63e0 | |
| parent | e2902dffbb601cf6564724e817fd973511237181 (diff) | |
qcacld-3.0: Use in_compat_syscall() to check compatness
Use in_compat_syscall() to query the syscall type, so it works properly
on all architectures. Also maintain backward compatibility with older
kernel.
Change-Id: Ife19c9874dcacc18c5d19c1175988bee66ea1cdd
CRs-Fixed: 2215566
| -rw-r--r-- | core/hdd/inc/wlan_hdd_main.h | 10 | ||||
| -rw-r--r-- | core/hdd/src/wlan_hdd_ftm.c | 4 | ||||
| -rw-r--r-- | core/hdd/src/wlan_hdd_ioctl.c | 2 | ||||
| -rw-r--r-- | core/hdd/src/wlan_hdd_wext.c | 4 |
4 files changed, 15 insertions, 5 deletions
diff --git a/core/hdd/inc/wlan_hdd_main.h b/core/hdd/inc/wlan_hdd_main.h index 665b60a6e497..d389dd9cdcb4 100644 --- a/core/hdd/inc/wlan_hdd_main.h +++ b/core/hdd/inc/wlan_hdd_main.h @@ -61,6 +61,16 @@ #define NUM_TX_QUEUES 4 #endif +/* + * API in_compat_syscall() is introduced in 4.6 kernel to check whether we're + * in a compat syscall or not. It is a new way to query the syscall type, which + * works properly on all architectures. + * + */ +#if (LINUX_VERSION_CODE < KERNEL_VERSION(4, 6, 0)) +static inline bool in_compat_syscall(void) { return is_compat_task(); } +#endif + #if (LINUX_VERSION_CODE >= KERNEL_VERSION(4, 7, 0)) || \ defined(CFG80211_REMOVE_IEEE80211_BACKPORT) #define HDD_NL80211_BAND_2GHZ NL80211_BAND_2GHZ diff --git a/core/hdd/src/wlan_hdd_ftm.c b/core/hdd/src/wlan_hdd_ftm.c index f87bc4029ed6..8d29a448c42b 100644 --- a/core/hdd/src/wlan_hdd_ftm.c +++ b/core/hdd/src/wlan_hdd_ftm.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012-2017 The Linux Foundation. All rights reserved. + * Copyright (c) 2012-2018 The Linux Foundation. All rights reserved. * * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the @@ -304,7 +304,7 @@ int wlan_hdd_qcmbr_unified_ioctl(hdd_adapter_t *adapter, struct ifreq *ifr) { int ret = 0; - if (is_compat_task()) + if (in_compat_syscall()) ret = wlan_hdd_qcmbr_compat_ioctl(adapter, ifr); else ret = wlan_hdd_qcmbr_ioctl(adapter, ifr); diff --git a/core/hdd/src/wlan_hdd_ioctl.c b/core/hdd/src/wlan_hdd_ioctl.c index e12354cff781..e27c24d7c544 100644 --- a/core/hdd/src/wlan_hdd_ioctl.c +++ b/core/hdd/src/wlan_hdd_ioctl.c @@ -7724,7 +7724,7 @@ static int __hdd_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd) switch (cmd) { case (SIOCDEVPRIVATE + 1): - if (is_compat_task()) + if (in_compat_syscall()) ret = hdd_driver_compat_ioctl(adapter, ifr); else ret = hdd_driver_ioctl(adapter, ifr); diff --git a/core/hdd/src/wlan_hdd_wext.c b/core/hdd/src/wlan_hdd_wext.c index d50e7e8f467a..641253827e5c 100644 --- a/core/hdd/src/wlan_hdd_wext.c +++ b/core/hdd/src/wlan_hdd_wext.c @@ -2703,7 +2703,7 @@ int hdd_priv_get_data(struct iw_point *p_priv_data, union iwreq_data *wrqu) return -EINVAL; #ifdef CONFIG_COMPAT - if (is_compat_task()) { + if (in_compat_syscall()) { struct compat_iw_point *p_compat_priv_data; /* Compat task: @@ -9880,7 +9880,7 @@ static int __iw_setnone_getnone(struct net_device *dev, * compat support in the kernel does not handle this case. so we * need to explicitly handle it here. */ - if (is_compat_task()) { + if (in_compat_syscall()) { struct compat_iw_point *compat_iw_point = (struct compat_iw_point *)&wrqu->data; sub_cmd = compat_iw_point->flags; |
