Commit 3700b62b authored by Daniel Walker's avatar Daniel Walker Committed by Jeff Garzik

ps3: gelic: scan_lock semaphore to mutex

Signed-off-by: default avatarDaniel Walker <dwalker@mvista.com>
Signed-off-by: default avatarJeff Garzik <jgarzik@redhat.com>
parent d8b35fac
...@@ -695,7 +695,7 @@ static int gelic_wl_get_scan(struct net_device *netdev, ...@@ -695,7 +695,7 @@ static int gelic_wl_get_scan(struct net_device *netdev,
unsigned long this_time = jiffies; unsigned long this_time = jiffies;
pr_debug("%s: <-\n", __func__); pr_debug("%s: <-\n", __func__);
if (down_interruptible(&wl->scan_lock)) if (mutex_lock_interruptible(&wl->scan_lock))
return -EAGAIN; return -EAGAIN;
switch (wl->scan_stat) { switch (wl->scan_stat) {
...@@ -733,7 +733,7 @@ static int gelic_wl_get_scan(struct net_device *netdev, ...@@ -733,7 +733,7 @@ static int gelic_wl_get_scan(struct net_device *netdev,
wrqu->data.length = ev - extra; wrqu->data.length = ev - extra;
wrqu->data.flags = 0; wrqu->data.flags = 0;
out: out:
up(&wl->scan_lock); mutex_unlock(&wl->scan_lock);
pr_debug("%s: -> %d %d\n", __func__, ret, wrqu->data.length); pr_debug("%s: -> %d %d\n", __func__, ret, wrqu->data.length);
return ret; return ret;
} }
...@@ -1554,7 +1554,7 @@ static int gelic_wl_start_scan(struct gelic_wl_info *wl, int always_scan) ...@@ -1554,7 +1554,7 @@ static int gelic_wl_start_scan(struct gelic_wl_info *wl, int always_scan)
int ret = 0; int ret = 0;
pr_debug("%s: <- always=%d\n", __func__, always_scan); pr_debug("%s: <- always=%d\n", __func__, always_scan);
if (down_interruptible(&wl->scan_lock)) if (mutex_lock_interruptible(&wl->scan_lock))
return -ERESTARTSYS; return -ERESTARTSYS;
/* /*
...@@ -1588,7 +1588,7 @@ static int gelic_wl_start_scan(struct gelic_wl_info *wl, int always_scan) ...@@ -1588,7 +1588,7 @@ static int gelic_wl_start_scan(struct gelic_wl_info *wl, int always_scan)
} }
kfree(cmd); kfree(cmd);
out: out:
up(&wl->scan_lock); mutex_unlock(&wl->scan_lock);
pr_debug("%s: ->\n", __func__); pr_debug("%s: ->\n", __func__);
return ret; return ret;
} }
...@@ -1610,7 +1610,7 @@ static void gelic_wl_scan_complete_event(struct gelic_wl_info *wl) ...@@ -1610,7 +1610,7 @@ static void gelic_wl_scan_complete_event(struct gelic_wl_info *wl)
DECLARE_MAC_BUF(mac); DECLARE_MAC_BUF(mac);
pr_debug("%s:start\n", __func__); pr_debug("%s:start\n", __func__);
down(&wl->scan_lock); mutex_lock(&wl->scan_lock);
if (wl->scan_stat != GELIC_WL_SCAN_STAT_SCANNING) { if (wl->scan_stat != GELIC_WL_SCAN_STAT_SCANNING) {
/* /*
...@@ -1727,7 +1727,7 @@ static void gelic_wl_scan_complete_event(struct gelic_wl_info *wl) ...@@ -1727,7 +1727,7 @@ static void gelic_wl_scan_complete_event(struct gelic_wl_info *wl)
NULL); NULL);
out: out:
complete(&wl->scan_done); complete(&wl->scan_done);
up(&wl->scan_lock); mutex_unlock(&wl->scan_lock);
pr_debug("%s:end\n", __func__); pr_debug("%s:end\n", __func__);
} }
...@@ -2282,7 +2282,7 @@ static void gelic_wl_assoc_worker(struct work_struct *work) ...@@ -2282,7 +2282,7 @@ static void gelic_wl_assoc_worker(struct work_struct *work)
wait_for_completion(&wl->scan_done); wait_for_completion(&wl->scan_done);
pr_debug("%s: scan done\n", __func__); pr_debug("%s: scan done\n", __func__);
down(&wl->scan_lock); mutex_lock(&wl->scan_lock);
if (wl->scan_stat != GELIC_WL_SCAN_STAT_GOT_LIST) { if (wl->scan_stat != GELIC_WL_SCAN_STAT_GOT_LIST) {
gelic_wl_send_iwap_event(wl, NULL); gelic_wl_send_iwap_event(wl, NULL);
pr_info("%s: no scan list. association failed\n", __func__); pr_info("%s: no scan list. association failed\n", __func__);
...@@ -2302,7 +2302,7 @@ static void gelic_wl_assoc_worker(struct work_struct *work) ...@@ -2302,7 +2302,7 @@ static void gelic_wl_assoc_worker(struct work_struct *work)
if (ret) if (ret)
pr_info("%s: association failed %d\n", __func__, ret); pr_info("%s: association failed %d\n", __func__, ret);
scan_lock_out: scan_lock_out:
up(&wl->scan_lock); mutex_unlock(&wl->scan_lock);
out: out:
up(&wl->assoc_stat_lock); up(&wl->assoc_stat_lock);
} }
...@@ -2431,7 +2431,7 @@ static struct net_device *gelic_wl_alloc(struct gelic_card *card) ...@@ -2431,7 +2431,7 @@ static struct net_device *gelic_wl_alloc(struct gelic_card *card)
INIT_DELAYED_WORK(&wl->event_work, gelic_wl_event_worker); INIT_DELAYED_WORK(&wl->event_work, gelic_wl_event_worker);
INIT_DELAYED_WORK(&wl->assoc_work, gelic_wl_assoc_worker); INIT_DELAYED_WORK(&wl->assoc_work, gelic_wl_assoc_worker);
init_MUTEX(&wl->scan_lock); mutex_init(&wl->scan_lock);
init_MUTEX(&wl->assoc_stat_lock); init_MUTEX(&wl->assoc_stat_lock);
init_completion(&wl->scan_done); init_completion(&wl->scan_done);
......
...@@ -241,7 +241,7 @@ enum gelic_wl_assoc_state { ...@@ -241,7 +241,7 @@ enum gelic_wl_assoc_state {
#define GELIC_WEP_KEYS 4 #define GELIC_WEP_KEYS 4
struct gelic_wl_info { struct gelic_wl_info {
/* bss list */ /* bss list */
struct semaphore scan_lock; struct mutex scan_lock;
struct list_head network_list; struct list_head network_list;
struct list_head network_free_list; struct list_head network_free_list;
struct gelic_wl_scan_info *networks; struct gelic_wl_scan_info *networks;
......
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