Commit e0c1496f authored by Alison Schofield's avatar Alison Schofield Committed by Greg Kroah-Hartman

staging: wilc1000: replace semaphore sem_inactive_time with a completion

Semaphore sem_inactive_time is used to signal completion of its host
interface message. Since the thread locking this semaphore will have
to wait, completions are the preferred mechanism and will offer a
performance improvement.
Signed-off-by: default avatarAlison Schofield <amsfield22@gmail.com>
Reviewed-by: default avatarArnd Bergmann <arnd@arndb.de>
Tested-by: default avatarLeo Kim <leo.kim@atmel.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 1b7c69e8
...@@ -2,6 +2,7 @@ ...@@ -2,6 +2,7 @@
#include <linux/time.h> #include <linux/time.h>
#include <linux/kthread.h> #include <linux/kthread.h>
#include <linux/delay.h> #include <linux/delay.h>
#include <linux/completion.h>
#include "host_interface.h" #include "host_interface.h"
#include "coreconfigurator.h" #include "coreconfigurator.h"
#include "wilc_wlan.h" #include "wilc_wlan.h"
...@@ -1979,7 +1980,7 @@ static s32 Handle_Get_InActiveTime(struct wilc_vif *vif, ...@@ -1979,7 +1980,7 @@ static s32 Handle_Get_InActiveTime(struct wilc_vif *vif,
return -EFAULT; return -EFAULT;
} }
up(&hif_drv->sem_inactive_time); complete(&hif_drv->comp_inactive_time);
return result; return result;
} }
...@@ -3220,7 +3221,7 @@ s32 wilc_get_inactive_time(struct wilc_vif *vif, const u8 *mac, ...@@ -3220,7 +3221,7 @@ s32 wilc_get_inactive_time(struct wilc_vif *vif, const u8 *mac,
if (result) if (result)
netdev_err(vif->ndev, "Failed to send get host ch param\n"); netdev_err(vif->ndev, "Failed to send get host ch param\n");
down(&hif_drv->sem_inactive_time); wait_for_completion(&hif_drv->comp_inactive_time);
*pu32InactiveTime = inactive_time; *pu32InactiveTime = inactive_time;
...@@ -3407,7 +3408,7 @@ int wilc_init(struct net_device *dev, struct host_if_drv **hif_drv_handler) ...@@ -3407,7 +3408,7 @@ int wilc_init(struct net_device *dev, struct host_if_drv **hif_drv_handler)
sema_init(&hif_drv->sem_test_key_block, 0); sema_init(&hif_drv->sem_test_key_block, 0);
sema_init(&hif_drv->sem_test_disconn_block, 0); sema_init(&hif_drv->sem_test_disconn_block, 0);
sema_init(&hif_drv->sem_get_rssi, 0); sema_init(&hif_drv->sem_get_rssi, 0);
sema_init(&hif_drv->sem_inactive_time, 0); init_completion(&hif_drv->comp_inactive_time);
if (clients_count == 0) { if (clients_count == 0) {
result = wilc_mq_create(&hif_msg_q); result = wilc_mq_create(&hif_msg_q);
......
...@@ -278,7 +278,7 @@ struct host_if_drv { ...@@ -278,7 +278,7 @@ struct host_if_drv {
struct semaphore sem_test_key_block; struct semaphore sem_test_key_block;
struct semaphore sem_test_disconn_block; struct semaphore sem_test_disconn_block;
struct semaphore sem_get_rssi; struct semaphore sem_get_rssi;
struct semaphore sem_inactive_time; struct completion comp_inactive_time;
struct timer_list scan_timer; struct timer_list scan_timer;
struct timer_list connect_timer; struct timer_list connect_timer;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment