ps3: gelic: scan_lock semaphore to mutex
Subsystems (4)
PATCH 1/3 ps3: gelic: scan_lock semaphore to mutex
Signed-off-by Daniel Walker <[email protected]>
--- drivers/net/ps3_gelic_wireless.c | 18 +++++++++--------- drivers/net/ps3_gelic_wireless.h | 2 +- 2 files changed, 10 insertions(+), 10 deletions(-)
drivers/net/ps3_gelic_wireless.c +9 -9
@@ -695,7 +695,7 @@ static int gelic_wl_get_scan(struct net_unsigned long this_time = jiffies;pr_debug ("%s: <-\n" , __func__); -if (down_interruptible (&wl->scan_lock)) +if (mutex_lock_interruptible (&wl->scan_lock))return -EAGAIN ;switch (wl->scan_stat) {
@@ -733,7 +733,7 @@ static int gelic_wl_get_scan(struct net_ wrqu->data.length = ev - extra; wrqu->data.flags =0 ; out: -up (&wl->scan_lock); +mutex_unlock (&wl->scan_lock);pr_debug ("%s: -> %d %d\n" , __func__, ret, wrqu->data.length);return ret; }
@@ -1554,7 +1554,7 @@ static int gelic_wl_start_scan(struct geint ret =0 ;pr_debug ("%s: <- always=%d\n" , __func__, always_scan); -if (down_interruptible (&wl->scan_lock)) +if (mutex_lock_interruptible (&wl->scan_lock))return -ERESTARTSYS ;/*
@@ -1588,7 +1588,7 @@ static int gelic_wl_start_scan(struct ge }kfree (cmd); out: -up (&wl->scan_lock); +mutex_unlock (&wl->scan_lock);pr_debug ("%s: ->\n" , __func__);return ret; }
@@ -1610,7 +1610,7 @@ static void gelic_wl_scan_complete_eventDECLARE_MAC_BUF (mac);pr_debug ("%s:start\n" , __func__); -down (&wl->scan_lock); +mutex_lock (&wl->scan_lock);if (wl->scan_stat !=GELIC_WL_SCAN_STAT_SCANNING ) {/*
@@ -1727,7 +1727,7 @@ static void gelic_wl_scan_complete_event NULL); out:complete (&wl->scan_done); -up (&wl->scan_lock); +mutex_unlock (&wl->scan_lock);pr_debug ("%s:end\n" , __func__); }
@@ -2282,7 +2282,7 @@ static void gelic_wl_assoc_worker(structwait_for_completion (&wl->scan_done);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 ) {gelic_wl_send_iwap_event (wl,NULL );pr_info ("%s: no scan list. association failed\n" , __func__);
@@ -2302,7 +2302,7 @@ static void gelic_wl_assoc_worker(structif (ret)pr_info ("%s: association failed %d\n" , __func__, ret); scan_lock_out: -up (&wl->scan_lock); +mutex_unlock (&wl->scan_lock); out:up (&wl->assoc_stat_lock); }
@@ -2431,7 +2431,7 @@ static struct net_device *gelic_wl_allocINIT_DELAYED_WORK (&wl->event_work, gelic_wl_event_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_completion (&wl->scan_done);
drivers/net/ps3_gelic_wireless.h +1 -1
@@ -241,7 +241,7 @@ enum gelic_wl_assoc_state {#define GELIC_WEP_KEYS 4struct gelic_wl_info {/* bss list */ -struct semaphore scan_lock; +struct mutex scan_lock;struct list_head network_list;struct list_head network_free_list;struct gelic_wl_scan_info *networks;
PATCH 2/3 ps3: gelic: assoc_stat_lock semaphore to mutex
Signed-off-by Daniel Walker <[email protected]>
--- drivers/net/ps3_gelic_wireless.c | 22 +++++++++++----------- drivers/net/ps3_gelic_wireless.h | 2 +- 2 files changed, 12 insertions(+), 12 deletions(-)
drivers/net/ps3_gelic_wireless.c +11 -11
@@ -240,12 +240,12 @@ static u32 gelic_wl_get_link(struct net_u32 ret;pr_debug ("%s: <-\n" , __func__); -down (&wl->assoc_stat_lock); +mutex_lock (&wl->assoc_stat_lock);if (wl->assoc_stat ==GELIC_WL_ASSOC_STAT_ASSOCIATED ) ret =1 ;else ret =0 ; -up (&wl->assoc_stat_lock); +mutex_unlock (&wl->assoc_stat_lock);pr_debug ("%s: ->\n" , __func__);return ret; }
@@ -979,7 +979,7 @@ static int gelic_wl_get_essid(struct netunsigned long irqflag;pr_debug ("%s: <- \n" , __func__); -down (&wl->assoc_stat_lock); +mutex_lock (&wl->assoc_stat_lock);spin_lock_irqsave (&wl->lock, irqflag);if (test_bit (GELIC_WL_STAT_ESSID_SET , &wl->stat) || wl->assoc_stat ==GELIC_WL_ASSOC_STAT_ASSOCIATED ) {
@@ -989,7 +989,7 @@ static int gelic_wl_get_essid(struct net }else data->essid.flags =0 ; -up (&wl->assoc_stat_lock); +mutex_unlock (&wl->assoc_stat_lock);spin_unlock_irqrestore (&wl->lock, irqflag);pr_debug ("%s: -> len=%d \n" , __func__, data->essid.length);
@@ -1170,7 +1170,7 @@ static int gelic_wl_get_ap(struct net_deunsigned long irqflag;pr_debug ("%s: <-\n" , __func__); -down (&wl->assoc_stat_lock); +mutex_lock (&wl->assoc_stat_lock);spin_lock_irqsave (&wl->lock, irqflag);if (wl->assoc_stat ==GELIC_WL_ASSOC_STAT_ASSOCIATED ) { data->ap_addr.sa_family =ARPHRD_ETHER ;
@@ -1180,7 +1180,7 @@ static int gelic_wl_get_ap(struct net_dememset (data->ap_addr.sa_data,0 ,ETH_ALEN );spin_unlock_irqrestore (&wl->lock, irqflag); -up (&wl->assoc_stat_lock); +mutex_unlock (&wl->assoc_stat_lock);pr_debug ("%s: ->\n" , __func__);return 0 ; }
@@ -2151,7 +2151,7 @@ static void gelic_wl_disconnect_event(st* As it waits with timeout, just leave assoc_done * uncompleted, then it terminates with timeout */ -if (down_trylock (&wl->assoc_stat_lock)) { +if (!mutex_trylock (&wl->assoc_stat_lock)) {pr_debug ("%s: already locked\n" , __func__); lock =0 ; }else {
@@ -2170,7 +2170,7 @@ static void gelic_wl_disconnect_event(stnetif_carrier_off (port_to_netdev (wl_port (wl)));if (lock) -up (&wl->assoc_stat_lock); +mutex_unlock (&wl->assoc_stat_lock); }/* * event worker
@@ -2258,7 +2258,7 @@ static void gelic_wl_assoc_worker(struct wl = container_of(work, struct gelic_wl_info, assoc_work.work); -down (&wl->assoc_stat_lock); +mutex_lock (&wl->assoc_stat_lock);if (wl->assoc_stat !=GELIC_WL_ASSOC_STAT_DISCONN ) goto out;
@@ -2304,7 +2304,7 @@ static void gelic_wl_assoc_worker(struct scan_lock_out:mutex_unlock (&wl->scan_lock); out: -up (&wl->assoc_stat_lock); +mutex_unlock (&wl->assoc_stat_lock); }/* * Interrupt handler
@@ -2432,7 +2432,7 @@ static struct net_device *gelic_wl_allocINIT_DELAYED_WORK (&wl->event_work, gelic_wl_event_worker);INIT_DELAYED_WORK (&wl->assoc_work, gelic_wl_assoc_worker);mutex_init (&wl->scan_lock); -init_MUTEX (&wl->assoc_stat_lock); +mutex_init (&wl->assoc_stat_lock);init_completion (&wl->scan_done);/* for the case that no scan request is issued and stop() is called */
drivers/net/ps3_gelic_wireless.h +1 -1
@@ -266,7 +266,7 @@ struct gelic_wl_info {enum gelic_wl_wpa_level wpa_level;/* wpa/wpa2 */ /* association handling */ -struct semaphore assoc_stat_lock; +struct mutex assoc_stat_lock;struct delayed_work assoc_work;enum gelic_wl_assoc_state assoc_stat;struct completion assoc_done;
PATCH 3/3 ps3: gelic: updown_lock semaphore to mutex
In reply to Daniel WalkerSigned-off-by Daniel Walker <[email protected]>
--- drivers/net/ps3_gelic_net.c | 10 +++++----- drivers/net/ps3_gelic_net.h | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-)
drivers/net/ps3_gelic_net.c +5 -5
@@ -110,7 +110,7 @@ static void gelic_card_get_ether_port_stvoid gelic_card_up (struct gelic_card *card) {pr_debug ("%s: called\n" , __func__); -down (&card->updown_lock); +mutex_lock (&card->updown_lock);if (atomic_inc_return (&card->users) ==1 ) {pr_debug ("%s: real do\n" , __func__);/* enable irq */
@@ -120,7 +120,7 @@ void gelic_card_up(struct gelic_card *canapi_enable (&card->napi); } -up (&card->updown_lock); +mutex_unlock (&card->updown_lock);pr_debug ("%s: done\n" , __func__); }
@@ -128,7 +128,7 @@ void gelic_card_down(struct gelic_card * {u64 mask;pr_debug ("%s: called\n" , __func__); -down (&card->updown_lock); +mutex_lock (&card->updown_lock);if (atomic_dec_if_positive (&card->users) ==0 ) {pr_debug ("%s: real do\n" , __func__);napi_disable (&card->napi);
@@ -146,7 +146,7 @@ void gelic_card_down(struct gelic_card */* stop tx */ gelic_card_disable_txdmac (card); } -up (&card->updown_lock); +mutex_unlock (&card->updown_lock);pr_debug ("%s: done\n" , __func__); }
@@ -1534,7 +1534,7 @@ static struct gelic_card *gelic_alloc_caINIT_WORK (&card->tx_timeout_task, gelic_net_tx_timeout_task);init_waitqueue_head (&card->waitq);atomic_set (&card->tx_timeout_task_counter,0 ); -init_MUTEX (&card->updown_lock); +mutex_init (&card->updown_lock);atomic_set (&card->users,0 );return card;
drivers/net/ps3_gelic_net.h +1 -1
@@ -298,7 +298,7 @@ struct gelic_card {wait_queue_head_t waitq;/* only first user should up the card */ -struct semaphore updown_lock; +struct mutex updown_lock;atomic_t users;u64 ether_port_status;
Re: [PATCH 3/3] ps3: gelic: updown_lock semaphore to mutex
applied 1-3
Added CC: linux-wireless
Quoted 2 lines · On Thu, 22 May 2008 00:00:01 -0700 Daniel Walker…
Signed-off-by Daniel Walker <[email protected]>
patches #1 - #3:
Acked-by Masakazu Mokuno <[email protected]>
Quoted 110 lines
--- drivers/net/ps3_gelic_wireless.c | 18 +++++++++--------- drivers/net/ps3_gelic_wireless.h | 2 +- 2 files changed, 10 insertions(+), 10 deletions(-)Index:
linux-2.6.25/drivers/net/ps3_gelic_wireless.c
===================================================================drivers/net/ps3_gelic_wireless.c +9
-9@@ -695,7 +695,7 @@ static int gelic_wl_get_scan(struct net_unsigned long this_time = jiffies;pr_debug ("%s: <-\n" , __func__); -if (down_interruptible (&wl->scan_lock)) +if (mutex_lock_interruptible (&wl->scan_lock))return -EAGAIN ;switch (wl->scan_stat) {@@ -733,7 +733,7 @@ static int gelic_wl_get_scan(struct net_ wrqu->data.length = ev - extra; wrqu->data.flags =0 ; out: -up (&wl->scan_lock); +mutex_unlock (&wl->scan_lock);pr_debug ("%s: -> %d %d\n" , __func__, ret, wrqu->data.length);return ret; }@@ -1554,7 +1554,7 @@ static int gelic_wl_start_scan(struct geint ret =0 ;pr_debug ("%s: <- always=%d\n" , __func__, always_scan); -if (down_interruptible (&wl->scan_lock)) +if (mutex_lock_interruptible (&wl->scan_lock))return -ERESTARTSYS ;/* @@ -1588,7 +1588,7 @@ static int gelic_wl_start_scan(struct ge }kfree (cmd); out: -up (&wl->scan_lock); +mutex_unlock (&wl->scan_lock);pr_debug ("%s: ->\n" , __func__);return ret; }@@ -1610,7 +1610,7 @@ static void gelic_wl_scan_complete_eventDECLARE_MAC_BUF (mac);pr_debug ("%s:start\n" , __func__); -down (&wl->scan_lock); +mutex_lock (&wl->scan_lock);if (wl->scan_stat !=GELIC_WL_SCAN_STAT_SCANNING ) {/* @@ -1727,7 +1727,7 @@ static void gelic_wl_scan_complete_event NULL); out:complete (&wl->scan_done); -up (&wl->scan_lock); +mutex_unlock (&wl->scan_lock);pr_debug ("%s:end\n" , __func__); }@@ -2282,7 +2282,7 @@ static void gelic_wl_assoc_worker(structwait_for_completion (&wl->scan_done);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 ) {gelic_wl_send_iwap_event (wl,NULL );pr_info ("%s: no scan list. association failed\n" , __func__);@@ -2302,7 +2302,7 @@ static void gelic_wl_assoc_worker(structif (ret)pr_info ("%s: association failed %d\n" , __func__, ret); scan_lock_out: -up (&wl->scan_lock); +mutex_unlock (&wl->scan_lock); out:up (&wl->assoc_stat_lock); }@@ -2431,7 +2431,7 @@ static struct net_device *gelic_wl_allocINIT_DELAYED_WORK (&wl->event_work, gelic_wl_event_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_completion (&wl->scan_done);Index:
linux-2.6.25/drivers/net/ps3_gelic_wireless.h
===================================================================drivers/net/ps3_gelic_wireless.h +1
-1@@ -241,7 +241,7 @@ enum gelic_wl_assoc_state {#define GELIC_WEP_KEYS 4struct gelic_wl_info {/* bss list */ -struct semaphore scan_lock; +struct mutex scan_lock;struct list_head network_list;struct list_head network_free_list;struct gelic_wl_scan_info *networks;Signature · 5 lines
-- -- To unsubscribe from this list: send the line "unsubscribe netdev" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
Signature · 6 lines
Masakazu Mokuno -- To unsubscribe from this list: send the line "unsubscribe linux-wireless" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html