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

staging: wilc1000: replace semaphore sem_get_rssi with a completion

Semaphore sem_get_rssi 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 e0c1496f
...@@ -1886,7 +1886,7 @@ static void Handle_GetRssi(struct wilc_vif *vif) ...@@ -1886,7 +1886,7 @@ static void Handle_GetRssi(struct wilc_vif *vif)
result = -EFAULT; result = -EFAULT;
} }
up(&vif->hif_drv->sem_get_rssi); complete(&vif->hif_drv->comp_get_rssi);
} }
static s32 Handle_GetStatistics(struct wilc_vif *vif, static s32 Handle_GetStatistics(struct wilc_vif *vif,
...@@ -3244,7 +3244,7 @@ int wilc_get_rssi(struct wilc_vif *vif, s8 *rssi_level) ...@@ -3244,7 +3244,7 @@ int wilc_get_rssi(struct wilc_vif *vif, s8 *rssi_level)
return -EFAULT; return -EFAULT;
} }
down(&hif_drv->sem_get_rssi); wait_for_completion(&hif_drv->comp_get_rssi);
if (!rssi_level) { if (!rssi_level) {
netdev_err(vif->ndev, "RSS pointer value is null\n"); netdev_err(vif->ndev, "RSS pointer value is null\n");
...@@ -3407,7 +3407,7 @@ int wilc_init(struct net_device *dev, struct host_if_drv **hif_drv_handler) ...@@ -3407,7 +3407,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); init_completion(&hif_drv->comp_get_rssi);
init_completion(&hif_drv->comp_inactive_time); init_completion(&hif_drv->comp_inactive_time);
if (clients_count == 0) { if (clients_count == 0) {
......
...@@ -277,7 +277,7 @@ struct host_if_drv { ...@@ -277,7 +277,7 @@ struct host_if_drv {
struct mutex cfg_values_lock; struct mutex cfg_values_lock;
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 completion comp_get_rssi;
struct completion comp_inactive_time; struct completion comp_inactive_time;
struct timer_list scan_timer; struct timer_list scan_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