aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/net/ps3_gelic_wireless.c22
-rw-r--r--drivers/net/ps3_gelic_wireless.h2
2 files changed, 12 insertions, 12 deletions
diff --git a/drivers/net/ps3_gelic_wireless.c b/drivers/net/ps3_gelic_wireless.c
index b338093a01e1..e5e02339a5cc 100644
--- a/drivers/net/ps3_gelic_wireless.c
+++ b/drivers/net/ps3_gelic_wireless.c
@@ -240,12 +240,12 @@ static u32 gelic_wl_get_link(struct net_device *netdev)
240 u32 ret; 240 u32 ret;
241 241
242 pr_debug("%s: <-\n", __func__); 242 pr_debug("%s: <-\n", __func__);
243 down(&wl->assoc_stat_lock); 243 mutex_lock(&wl->assoc_stat_lock);
244 if (wl->assoc_stat == GELIC_WL_ASSOC_STAT_ASSOCIATED) 244 if (wl->assoc_stat == GELIC_WL_ASSOC_STAT_ASSOCIATED)
245 ret = 1; 245 ret = 1;
246 else 246 else
247 ret = 0; 247 ret = 0;
248 up(&wl->assoc_stat_lock); 248 mutex_unlock(&wl->assoc_stat_lock);
249 pr_debug("%s: ->\n", __func__); 249 pr_debug("%s: ->\n", __func__);
250 return ret; 250 return ret;
251} 251}
@@ -979,7 +979,7 @@ static int gelic_wl_get_essid(struct net_device *netdev,
979 unsigned long irqflag; 979 unsigned long irqflag;
980 980
981 pr_debug("%s: <- \n", __func__); 981 pr_debug("%s: <- \n", __func__);
982 down(&wl->assoc_stat_lock); 982 mutex_lock(&wl->assoc_stat_lock);
983 spin_lock_irqsave(&wl->lock, irqflag); 983 spin_lock_irqsave(&wl->lock, irqflag);
984 if (test_bit(GELIC_WL_STAT_ESSID_SET, &wl->stat) || 984 if (test_bit(GELIC_WL_STAT_ESSID_SET, &wl->stat) ||
985 wl->assoc_stat == GELIC_WL_ASSOC_STAT_ASSOCIATED) { 985 wl->assoc_stat == GELIC_WL_ASSOC_STAT_ASSOCIATED) {
@@ -989,7 +989,7 @@ static int gelic_wl_get_essid(struct net_device *netdev,
989 } else 989 } else
990 data->essid.flags = 0; 990 data->essid.flags = 0;
991 991
992 up(&wl->assoc_stat_lock); 992 mutex_unlock(&wl->assoc_stat_lock);
993 spin_unlock_irqrestore(&wl->lock, irqflag); 993 spin_unlock_irqrestore(&wl->lock, irqflag);
994 pr_debug("%s: -> len=%d \n", __func__, data->essid.length); 994 pr_debug("%s: -> len=%d \n", __func__, data->essid.length);
995 995
@@ -1170,7 +1170,7 @@ static int gelic_wl_get_ap(struct net_device *netdev,
1170 unsigned long irqflag; 1170 unsigned long irqflag;
1171 1171
1172 pr_debug("%s: <-\n", __func__); 1172 pr_debug("%s: <-\n", __func__);
1173 down(&wl->assoc_stat_lock); 1173 mutex_lock(&wl->assoc_stat_lock);
1174 spin_lock_irqsave(&wl->lock, irqflag); 1174 spin_lock_irqsave(&wl->lock, irqflag);
1175 if (wl->assoc_stat == GELIC_WL_ASSOC_STAT_ASSOCIATED) { 1175 if (wl->assoc_stat == GELIC_WL_ASSOC_STAT_ASSOCIATED) {
1176 data->ap_addr.sa_family = ARPHRD_ETHER; 1176 data->ap_addr.sa_family = ARPHRD_ETHER;
@@ -1180,7 +1180,7 @@ static int gelic_wl_get_ap(struct net_device *netdev,
1180 memset(data->ap_addr.sa_data, 0, ETH_ALEN); 1180 memset(data->ap_addr.sa_data, 0, ETH_ALEN);
1181 1181
1182 spin_unlock_irqrestore(&wl->lock, irqflag); 1182 spin_unlock_irqrestore(&wl->lock, irqflag);
1183 up(&wl->assoc_stat_lock); 1183 mutex_unlock(&wl->assoc_stat_lock);
1184 pr_debug("%s: ->\n", __func__); 1184 pr_debug("%s: ->\n", __func__);
1185 return 0; 1185 return 0;
1186} 1186}
@@ -2151,7 +2151,7 @@ static void gelic_wl_disconnect_event(struct gelic_wl_info *wl,
2151 * As it waits with timeout, just leave assoc_done 2151 * As it waits with timeout, just leave assoc_done
2152 * uncompleted, then it terminates with timeout 2152 * uncompleted, then it terminates with timeout
2153 */ 2153 */
2154 if (down_trylock(&wl->assoc_stat_lock)) { 2154 if (!mutex_trylock(&wl->assoc_stat_lock)) {
2155 pr_debug("%s: already locked\n", __func__); 2155 pr_debug("%s: already locked\n", __func__);
2156 lock = 0; 2156 lock = 0;
2157 } else { 2157 } else {
@@ -2170,7 +2170,7 @@ static void gelic_wl_disconnect_event(struct gelic_wl_info *wl,
2170 netif_carrier_off(port_to_netdev(wl_port(wl))); 2170 netif_carrier_off(port_to_netdev(wl_port(wl)));
2171 2171
2172 if (lock) 2172 if (lock)
2173 up(&wl->assoc_stat_lock); 2173 mutex_unlock(&wl->assoc_stat_lock);
2174} 2174}
2175/* 2175/*
2176 * event worker 2176 * event worker
@@ -2258,7 +2258,7 @@ static void gelic_wl_assoc_worker(struct work_struct *work)
2258 2258
2259 wl = container_of(work, struct gelic_wl_info, assoc_work.work); 2259 wl = container_of(work, struct gelic_wl_info, assoc_work.work);
2260 2260
2261 down(&wl->assoc_stat_lock); 2261 mutex_lock(&wl->assoc_stat_lock);
2262 2262
2263 if (wl->assoc_stat != GELIC_WL_ASSOC_STAT_DISCONN) 2263 if (wl->assoc_stat != GELIC_WL_ASSOC_STAT_DISCONN)
2264 goto out; 2264 goto out;
@@ -2304,7 +2304,7 @@ static void gelic_wl_assoc_worker(struct work_struct *work)
2304scan_lock_out: 2304scan_lock_out:
2305 mutex_unlock(&wl->scan_lock); 2305 mutex_unlock(&wl->scan_lock);
2306out: 2306out:
2307 up(&wl->assoc_stat_lock); 2307 mutex_unlock(&wl->assoc_stat_lock);
2308} 2308}
2309/* 2309/*
2310 * Interrupt handler 2310 * Interrupt handler
@@ -2432,7 +2432,7 @@ static struct net_device *gelic_wl_alloc(struct gelic_card *card)
2432 INIT_DELAYED_WORK(&wl->event_work, gelic_wl_event_worker); 2432 INIT_DELAYED_WORK(&wl->event_work, gelic_wl_event_worker);
2433 INIT_DELAYED_WORK(&wl->assoc_work, gelic_wl_assoc_worker); 2433 INIT_DELAYED_WORK(&wl->assoc_work, gelic_wl_assoc_worker);
2434 mutex_init(&wl->scan_lock); 2434 mutex_init(&wl->scan_lock);
2435 init_MUTEX(&wl->assoc_stat_lock); 2435 mutex_init(&wl->assoc_stat_lock);
2436 2436
2437 init_completion(&wl->scan_done); 2437 init_completion(&wl->scan_done);
2438 /* for the case that no scan request is issued and stop() is called */ 2438 /* for the case that no scan request is issued and stop() is called */
diff --git a/drivers/net/ps3_gelic_wireless.h b/drivers/net/ps3_gelic_wireless.h
index fb3222e8d3bb..bc730632da5b 100644
--- a/drivers/net/ps3_gelic_wireless.h
+++ b/drivers/net/ps3_gelic_wireless.h
@@ -266,7 +266,7 @@ struct gelic_wl_info {
266 enum gelic_wl_wpa_level wpa_level; /* wpa/wpa2 */ 266 enum gelic_wl_wpa_level wpa_level; /* wpa/wpa2 */
267 267
268 /* association handling */ 268 /* association handling */
269 struct semaphore assoc_stat_lock; 269 struct mutex assoc_stat_lock;
270 struct delayed_work assoc_work; 270 struct delayed_work assoc_work;
271 enum gelic_wl_assoc_state assoc_stat; 271 enum gelic_wl_assoc_state assoc_stat;
272 struct completion assoc_done; 272 struct completion assoc_done;