diff options
author | Alison Schofield <amsfield22@gmail.com> | 2016-03-14 10:34:39 -0700 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2016-03-28 07:30:36 -0700 |
commit | 7c8a3dcac82f11681e3e6ad61fb2e5802a136c24 (patch) | |
tree | bea949c6d215174d3bead99af0bf6296e808a367 /drivers/staging/wilc1000 | |
parent | e0c1496fcf6a1bbc9b827e763f58535585b249d5 (diff) | |
download | op-kernel-dev-7c8a3dcac82f11681e3e6ad61fb2e5802a136c24.zip op-kernel-dev-7c8a3dcac82f11681e3e6ad61fb2e5802a136c24.tar.gz |
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: Alison Schofield <amsfield22@gmail.com>
Reviewed-by: Arnd Bergmann <arnd@arndb.de>
Tested-by: Leo Kim <leo.kim@atmel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/staging/wilc1000')
-rw-r--r-- | drivers/staging/wilc1000/host_interface.c | 6 | ||||
-rw-r--r-- | drivers/staging/wilc1000/host_interface.h | 2 |
2 files changed, 4 insertions, 4 deletions
diff --git a/drivers/staging/wilc1000/host_interface.c b/drivers/staging/wilc1000/host_interface.c index 2f14370..697491e 100644 --- a/drivers/staging/wilc1000/host_interface.c +++ b/drivers/staging/wilc1000/host_interface.c @@ -1886,7 +1886,7 @@ static void Handle_GetRssi(struct wilc_vif *vif) result = -EFAULT; } - up(&vif->hif_drv->sem_get_rssi); + complete(&vif->hif_drv->comp_get_rssi); } static s32 Handle_GetStatistics(struct wilc_vif *vif, @@ -3244,7 +3244,7 @@ int wilc_get_rssi(struct wilc_vif *vif, s8 *rssi_level) return -EFAULT; } - down(&hif_drv->sem_get_rssi); + wait_for_completion(&hif_drv->comp_get_rssi); if (!rssi_level) { 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) sema_init(&hif_drv->sem_test_key_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); if (clients_count == 0) { diff --git a/drivers/staging/wilc1000/host_interface.h b/drivers/staging/wilc1000/host_interface.h index 68852b3..085adee 100644 --- a/drivers/staging/wilc1000/host_interface.h +++ b/drivers/staging/wilc1000/host_interface.h @@ -277,7 +277,7 @@ struct host_if_drv { struct mutex cfg_values_lock; struct semaphore sem_test_key_block; struct semaphore sem_test_disconn_block; - struct semaphore sem_get_rssi; + struct completion comp_get_rssi; struct completion comp_inactive_time; struct timer_list scan_timer; |