diff --git a/core/hdd/src/wlan_hdd_memdump.c b/core/hdd/src/wlan_hdd_memdump.c index ea01caa6a7..a208821f14 100644 --- a/core/hdd/src/wlan_hdd_memdump.c +++ b/core/hdd/src/wlan_hdd_memdump.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016-2018 The Linux Foundation. All rights reserved. + * Copyright (c) 2016-2019 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 @@ -23,14 +23,14 @@ * */ -#include -#include #include #include #include #include /* Necessary because we use the proc fs */ #include /* for copy_to_user */ - +#include "osif_sync.h" +#include +#include #ifdef MULTI_IF_NAME #define PROCFS_DRIVER_DUMP_DIR "debugdriver" MULTI_IF_NAME @@ -118,20 +118,21 @@ static ssize_t __hdd_driver_memdump_read(struct file *file, char __user *buf, hdd_err("Invalid start offset for memdump read"); mutex_unlock(&hdd_ctx->memdump_lock); return -EINVAL; - } else if (!count || (hdd_ctx->driver_dump_size && - (*pos >= hdd_ctx->driver_dump_size))) { + } + + if (!count || + (hdd_ctx->driver_dump_size && *pos >= hdd_ctx->driver_dump_size)) { mutex_unlock(&hdd_ctx->memdump_lock); hdd_debug("No more data to copy"); return 0; - } else if ((*pos == 0) || (hdd_ctx->driver_dump_mem == NULL)) { - /* - * Allocate memory for Driver memory dump. - */ + } + + if (*pos == 0 || !hdd_ctx->driver_dump_mem) { + /* Allocate memory for Driver memory dump */ if (!hdd_ctx->driver_dump_mem) { hdd_ctx->driver_dump_mem = qdf_mem_malloc(DRIVER_MEM_DUMP_SIZE); if (!hdd_ctx->driver_dump_mem) { - hdd_err("qdf_mem_malloc failed"); mutex_unlock(&hdd_ctx->memdump_lock); return -ENOMEM; } @@ -149,8 +150,7 @@ static ssize_t __hdd_driver_memdump_read(struct file *file, char __user *buf, if (qdf_status != QDF_STATUS_SUCCESS) hdd_err("Error in dump driver information, status %d", qdf_status); - hdd_debug("driver_dump_size: %d", - hdd_ctx->driver_dump_size); + hdd_debug("driver_dump_size: %d", hdd_ctx->driver_dump_size); } if (count > hdd_ctx->driver_dump_size - *pos) @@ -194,13 +194,18 @@ static ssize_t __hdd_driver_memdump_read(struct file *file, char __user *buf, static ssize_t hdd_driver_memdump_read(struct file *file, char __user *buf, size_t count, loff_t *pos) { - ssize_t len; + struct osif_driver_sync *driver_sync; + ssize_t err_size; - cds_ssr_protect(__func__); - len = __hdd_driver_memdump_read(file, buf, count, pos); - cds_ssr_unprotect(__func__); + err_size = osif_driver_sync_op_start(&driver_sync); + if (err_size) + return err_size; - return len; + err_size = __hdd_driver_memdump_read(file, buf, count, pos); + + osif_driver_sync_op_stop(driver_sync); + + return err_size; } /** @@ -211,7 +216,7 @@ static ssize_t hdd_driver_memdump_read(struct file *file, char __user *buf, * dump feature */ static const struct file_operations driver_dump_fops = { -read: hdd_driver_memdump_read + .read = hdd_driver_memdump_read, }; /** diff --git a/core/hdd/src/wlan_hdd_nud_tracking.c b/core/hdd/src/wlan_hdd_nud_tracking.c index cc87f83607..d9ea853d60 100644 --- a/core/hdd/src/wlan_hdd_nud_tracking.c +++ b/core/hdd/src/wlan_hdd_nud_tracking.c @@ -20,6 +20,7 @@ * DOC: contains nud event tracking main function definitions */ +#include "osif_sync.h" #include "wlan_hdd_main.h" void hdd_nud_set_gateway_addr(struct hdd_adapter *adapter, @@ -206,24 +207,18 @@ static void hdd_nud_set_tracking(struct hdd_adapter *adapter, /** * __hdd_nud_failure_work() - work for nud event - * @data: Pointer to hdd_adapter + * @adapter: Pointer to hdd_adapter * * Return: None */ -static void __hdd_nud_failure_work(void *data) +static void __hdd_nud_failure_work(struct hdd_adapter *adapter) { - struct hdd_adapter *adapter; struct hdd_context *hdd_ctx; eConnectionState conn_state; int status; hdd_enter(); - if (!data) - return; - - adapter = (struct hdd_adapter *)data; - status = hdd_validate_adapter(adapter); if (status) return; @@ -274,9 +269,15 @@ static void __hdd_nud_failure_work(void *data) */ static void hdd_nud_failure_work(void *data) { - cds_ssr_protect(__func__); - __hdd_nud_failure_work(data); - cds_ssr_unprotect(__func__); + struct hdd_adapter *adapter = data; + struct osif_vdev_sync *vdev_sync; + + if (osif_vdev_sync_op_start(adapter->dev, &vdev_sync)) + return; + + __hdd_nud_failure_work(adapter); + + osif_vdev_sync_op_stop(vdev_sync); } void hdd_nud_init_tracking(struct hdd_adapter *adapter) @@ -300,8 +301,7 @@ void hdd_nud_init_tracking(struct hdd_adapter *adapter) qdf_atomic_init(&adapter ->nud_tracking.tx_rx_stats.gw_rx_packets); qdf_create_work(0, &adapter->nud_tracking.nud_event_work, - hdd_nud_failure_work, - (void *)adapter); + hdd_nud_failure_work, adapter); } } @@ -412,20 +412,14 @@ static void hdd_nud_filter_netevent(struct neighbour *neigh) /** * __hdd_nud_netevent_cb() - netevent callback - * @nb: Pointer to notifier block - * @event: Net Event triggered - * @data: Pointer to neighbour struct - * - * Callback for netevent + * @neighbor: neighbor used in the nud event * * Return: None */ -static void __hdd_nud_netevent_cb(struct notifier_block *nb, - unsigned long event, - void *data) +static void __hdd_nud_netevent_cb(struct neighbour *neighbor) { hdd_enter(); - hdd_nud_filter_netevent(data); + hdd_nud_filter_netevent(neighbor); hdd_exit(); } @@ -442,16 +436,24 @@ static void __hdd_nud_netevent_cb(struct notifier_block *nb, static int hdd_nud_netevent_cb(struct notifier_block *nb, unsigned long event, void *data) { + struct neighbour *neighbor = data; + struct osif_vdev_sync *vdev_sync; + int errno; + + errno = osif_vdev_sync_op_start(neighbor->dev, &vdev_sync); + if (errno) + return errno; + switch (event) { case NETEVENT_NEIGH_UPDATE: - cds_ssr_protect(__func__); - __hdd_nud_netevent_cb(nb, event, data); - cds_ssr_unprotect(__func__); + __hdd_nud_netevent_cb(neighbor); break; - case NETEVENT_REDIRECT: default: break; } + + osif_vdev_sync_op_stop(vdev_sync); + return 0; } diff --git a/core/hdd/src/wlan_hdd_oemdata.c b/core/hdd/src/wlan_hdd_oemdata.c index 3b29106c82..409cb50bf6 100644 --- a/core/hdd/src/wlan_hdd_oemdata.c +++ b/core/hdd/src/wlan_hdd_oemdata.c @@ -30,6 +30,7 @@ #include #include #include +#include "osif_sync.h" #include #include #include "qwlan_version.h" @@ -1094,13 +1095,23 @@ static int oem_msg_callback(struct sk_buff *skb) static int __oem_msg_callback(struct sk_buff *skb) { - int ret; + struct hdd_context *hdd_ctx = p_hdd_ctx; + struct osif_psoc_sync *psoc_sync; + int errno; - cds_ssr_protect(__func__); - ret = oem_msg_callback(skb); - cds_ssr_unprotect(__func__); + errno = wlan_hdd_validate_context(hdd_ctx); + if (errno) + return errno; - return ret; + errno = osif_psoc_sync_op_start(hdd_ctx->parent_dev, &psoc_sync); + if (errno) + return errno; + + errno = oem_msg_callback(skb); + + osif_psoc_sync_op_stop(psoc_sync); + + return errno; } int oem_activate_service(struct hdd_context *hdd_ctx) diff --git a/core/hdd/src/wlan_hdd_sysfs.c b/core/hdd/src/wlan_hdd_sysfs.c index 185d715b62..d66e52e027 100644 --- a/core/hdd/src/wlan_hdd_sysfs.c +++ b/core/hdd/src/wlan_hdd_sysfs.c @@ -305,11 +305,10 @@ static void hdd_beacon_debugstats_cb(struct bcn_reception_stats_rsp hdd_exit(); } -static ssize_t __show_beacon_reception_stats(struct device *dev, char *buf) +static ssize_t __show_beacon_reception_stats(struct net_device *net_dev, + char *buf) { - struct net_device *netdev = - qdf_container_of(dev, struct net_device, dev); - struct hdd_adapter *adapter = (netdev_priv(netdev)); + struct hdd_adapter *adapter = netdev_priv(net_dev); struct bcn_reception_stats_rsp *beacon_stats; int ret_val, j; void *cookie; @@ -410,13 +409,19 @@ static ssize_t show_beacon_reception_stats(struct device *dev, struct device_attribute *attr, char *buf) { - ssize_t ret_val; + struct net_device *net_dev = container_of(dev, struct net_device, dev); + struct osif_vdev_sync *vdev_sync; + ssize_t err_size; - cds_ssr_protect(__func__); - ret_val = __show_beacon_reception_stats(dev, buf); - cds_ssr_unprotect(__func__); + err_size = osif_vdev_sync_op_start(net_dev, &vdev_sync); + if (err_size) + return err_size; - return ret_val; + err_size = __show_beacon_reception_stats(net_dev, buf); + + osif_vdev_sync_op_stop(vdev_sync); + + return err_size; } static DEVICE_ATTR(beacon_stats, 0444, diff --git a/core/hdd/src/wlan_hdd_wmm.c b/core/hdd/src/wlan_hdd_wmm.c index c07eff9622..1aae43ed83 100644 --- a/core/hdd/src/wlan_hdd_wmm.c +++ b/core/hdd/src/wlan_hdd_wmm.c @@ -46,6 +46,7 @@ #include #include #include +#include "osif_sync.h" #include #include #include @@ -1001,16 +1002,13 @@ int hdd_wmmps_helper(struct hdd_adapter *adapter, uint8_t *ptr) /** * __hdd_wmm_do_implicit_qos() - Function which will attempt to setup - * QoS for any AC requiring it. - * @work: [in] pointer to work structure. + * QoS for any AC requiring it. + * @qos_context: the QoS context to operate against * * Return: none */ -static void __hdd_wmm_do_implicit_qos(struct work_struct *work) +static void __hdd_wmm_do_implicit_qos(struct hdd_wmm_qos_context *qos_context) { - struct hdd_wmm_qos_context *qos_context = - container_of(work, struct hdd_wmm_qos_context, - wmmAcSetupImplicitQos); struct hdd_adapter *adapter; sme_ac_enum_type acType; struct hdd_wmm_ac_status *pAc; @@ -1031,11 +1029,6 @@ static void __hdd_wmm_do_implicit_qos(struct work_struct *work) hdd_debug("Entered, context %pK", qos_context); - if (unlikely(HDD_WMM_CTX_MAGIC != qos_context->magic)) { - hdd_err("Invalid QoS Context"); - return; - } - adapter = qos_context->adapter; hdd_ctx = WLAN_HDD_GET_CTX(adapter); @@ -1452,9 +1445,22 @@ static void __hdd_wmm_do_implicit_qos(struct work_struct *work) */ static void hdd_wmm_do_implicit_qos(struct work_struct *work) { - cds_ssr_protect(__func__); - __hdd_wmm_do_implicit_qos(work); - cds_ssr_unprotect(__func__); + struct hdd_wmm_qos_context *qos_ctx = + container_of(work, struct hdd_wmm_qos_context, + wmmAcSetupImplicitQos); + struct osif_vdev_sync *vdev_sync; + + if (qos_ctx->magic != HDD_WMM_CTX_MAGIC) { + hdd_err("Invalid QoS Context"); + return; + } + + if (osif_vdev_sync_op_start(qos_ctx->adapter->dev, &vdev_sync)) + return; + + __hdd_wmm_do_implicit_qos(qos_ctx); + + osif_vdev_sync_op_stop(vdev_sync); } /**