summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeff Johnson <jjohnson@qca.qualcomm.com>2015-08-17 19:09:24 -0700
committerAnjaneedevi Kapparapu <akappa@codeaurora.org>2015-08-24 17:55:25 +0530
commit57357d211e7d67d449f8a9ad697474da1691908c (patch)
treee52fc920f15788f3363f749a9e8e85e167b7880c
parent3eb157613aa8cd29b046de7fc36fb7d0ac24fd86 (diff)
qcacld-2.0: SSR-protect iw_get_tx_power()
Currently iw_get_tx_power() does not use the SSR protection wrapper. This can lead to unexpected behavior if the function is executing concurrently with SSR, so add the SSR protection wrapper. Change-Id: I20e5c442484399631553d7495d4bb594447ffc15 CRs-Fixed: 891029
-rw-r--r--CORE/HDD/src/wlan_hdd_wext.c37
1 files changed, 34 insertions, 3 deletions
diff --git a/CORE/HDD/src/wlan_hdd_wext.c b/CORE/HDD/src/wlan_hdd_wext.c
index dd30915e6488..1cd8b532692f 100644
--- a/CORE/HDD/src/wlan_hdd_wext.c
+++ b/CORE/HDD/src/wlan_hdd_wext.c
@@ -2193,9 +2193,18 @@ static int iw_get_freq(struct net_device *dev, struct iw_request_info *info,
return ret;
}
-static int iw_get_tx_power(struct net_device *dev,
- struct iw_request_info *info,
- union iwreq_data *wrqu, char *extra)
+/**
+ * __iw_get_tx_power() - SIOCGIWTXPOW ioctl handler
+ * @dev: device upon which the ioctl was received
+ * @info: ioctl request information
+ * @wrqu: ioctl request data
+ * @extra: ioctl extra data
+ *
+ * Return: 0 on success, non-zero on error
+ */
+static int __iw_get_tx_power(struct net_device *dev,
+ struct iw_request_info *info,
+ union iwreq_data *wrqu, char *extra)
{
hdd_adapter_t *pAdapter = WLAN_HDD_GET_PRIV_PTR(dev);
@@ -2221,6 +2230,28 @@ static int iw_get_tx_power(struct net_device *dev,
}
/**
+ * iw_get_tx_power() - SSR wrapper for __iw_get_tx_power()
+ * @dev: pointer to net_device
+ * @info: pointer to iw_request_info
+ * @wrqu: pointer to iwreq_data
+ * @extra: pointer to extra ioctl payload
+ *
+ * Return: 0 on success, error number otherwise
+ */
+static int iw_get_tx_power(struct net_device *dev,
+ struct iw_request_info *info,
+ union iwreq_data *wrqu, char *extra)
+{
+ int ret;
+
+ vos_ssr_protect(__func__);
+ ret = __iw_get_tx_power(dev, info, wrqu, extra);
+ vos_ssr_unprotect(__func__);
+
+ return ret;
+}
+
+/**
* __iw_set_tx_power() - SIOCSIWTXPOW ioctl handler
* @dev: device upon which the ioctl was received
* @info: ioctl request information