aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/ehea
diff options
context:
space:
mode:
authorDaniel Walker <dwalker@mvista.com>2008-03-28 17:41:28 -0400
committerJeff Garzik <jeff@garzik.org>2008-03-28 22:14:43 -0400
commita5af6ad3a0d4f5c6d0a3535d46fc1b26eeff0816 (patch)
treef0061a0f91d202dac06225b724d5d4820f67e75d /drivers/net/ehea
parentda59cde4825bd42f305efb8e6335f1b58ab8d88c (diff)
netdev: ehea: port_lock semaphore to mutex
Convert the port_lock to a mutex. There is also some additional cleanup. The line length inside the ehea_rereg_mrs was getting long so I made some adjustments to shorten them. [akpm@linux-foundation.org: dec99ification] Signed-off-by: Daniel Walker <dwalker@mvista.com> Cc: Christoph Raisch <raisch@de.ibm.com> Cc: Jan-Bernd Themann <themann@de.ibm.com> Cc: Thomas Klein <tklein@de.ibm.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Jeff Garzik <jeff@garzik.org>
Diffstat (limited to 'drivers/net/ehea')
-rw-r--r--drivers/net/ehea/ehea.h2
-rw-r--r--drivers/net/ehea/ehea_main.c44
2 files changed, 24 insertions, 22 deletions
diff --git a/drivers/net/ehea/ehea.h b/drivers/net/ehea/ehea.h
index b5c8eb96bd26..26acd05c80b5 100644
--- a/drivers/net/ehea/ehea.h
+++ b/drivers/net/ehea/ehea.h
@@ -452,7 +452,7 @@ struct ehea_port {
452 struct vlan_group *vgrp; 452 struct vlan_group *vgrp;
453 struct ehea_eq *qp_eq; 453 struct ehea_eq *qp_eq;
454 struct work_struct reset_task; 454 struct work_struct reset_task;
455 struct semaphore port_lock; 455 struct mutex port_lock;
456 char int_aff_name[EHEA_IRQ_NAME_SIZE]; 456 char int_aff_name[EHEA_IRQ_NAME_SIZE];
457 int allmulti; /* Indicates IFF_ALLMULTI state */ 457 int allmulti; /* Indicates IFF_ALLMULTI state */
458 int promisc; /* Indicates IFF_PROMISC state */ 458 int promisc; /* Indicates IFF_PROMISC state */
diff --git a/drivers/net/ehea/ehea_main.c b/drivers/net/ehea/ehea_main.c
index 73dd6f9dfbbe..0c1c360a85ca 100644
--- a/drivers/net/ehea/ehea_main.c
+++ b/drivers/net/ehea/ehea_main.c
@@ -2543,7 +2543,7 @@ static int ehea_open(struct net_device *dev)
2543 int ret; 2543 int ret;
2544 struct ehea_port *port = netdev_priv(dev); 2544 struct ehea_port *port = netdev_priv(dev);
2545 2545
2546 down(&port->port_lock); 2546 mutex_lock(&port->port_lock);
2547 2547
2548 if (netif_msg_ifup(port)) 2548 if (netif_msg_ifup(port))
2549 ehea_info("enabling port %s", dev->name); 2549 ehea_info("enabling port %s", dev->name);
@@ -2554,7 +2554,7 @@ static int ehea_open(struct net_device *dev)
2554 netif_start_queue(dev); 2554 netif_start_queue(dev);
2555 } 2555 }
2556 2556
2557 up(&port->port_lock); 2557 mutex_unlock(&port->port_lock);
2558 2558
2559 return ret; 2559 return ret;
2560} 2560}
@@ -2600,11 +2600,11 @@ static int ehea_stop(struct net_device *dev)
2600 ehea_info("disabling port %s", dev->name); 2600 ehea_info("disabling port %s", dev->name);
2601 2601
2602 flush_scheduled_work(); 2602 flush_scheduled_work();
2603 down(&port->port_lock); 2603 mutex_lock(&port->port_lock);
2604 netif_stop_queue(dev); 2604 netif_stop_queue(dev);
2605 port_napi_disable(port); 2605 port_napi_disable(port);
2606 ret = ehea_down(dev); 2606 ret = ehea_down(dev);
2607 up(&port->port_lock); 2607 mutex_unlock(&port->port_lock);
2608 return ret; 2608 return ret;
2609} 2609}
2610 2610
@@ -2802,7 +2802,7 @@ static void ehea_reset_port(struct work_struct *work)
2802 struct net_device *dev = port->netdev; 2802 struct net_device *dev = port->netdev;
2803 2803
2804 port->resets++; 2804 port->resets++;
2805 down(&port->port_lock); 2805 mutex_lock(&port->port_lock);
2806 netif_stop_queue(dev); 2806 netif_stop_queue(dev);
2807 2807
2808 port_napi_disable(port); 2808 port_napi_disable(port);
@@ -2822,7 +2822,7 @@ static void ehea_reset_port(struct work_struct *work)
2822 2822
2823 netif_wake_queue(dev); 2823 netif_wake_queue(dev);
2824out: 2824out:
2825 up(&port->port_lock); 2825 mutex_unlock(&port->port_lock);
2826 return; 2826 return;
2827} 2827}
2828 2828
@@ -2839,21 +2839,23 @@ static void ehea_rereg_mrs(struct work_struct *work)
2839 /* Shutdown all ports */ 2839 /* Shutdown all ports */
2840 for (i = 0; i < EHEA_MAX_PORTS; i++) { 2840 for (i = 0; i < EHEA_MAX_PORTS; i++) {
2841 struct ehea_port *port = adapter->port[i]; 2841 struct ehea_port *port = adapter->port[i];
2842 struct net_device *dev;
2842 2843
2843 if (port) { 2844 if (!port)
2844 struct net_device *dev = port->netdev; 2845 continue;
2845 2846
2846 if (dev->flags & IFF_UP) { 2847 dev = port->netdev;
2847 down(&port->port_lock); 2848
2848 netif_stop_queue(dev); 2849 if (dev->flags & IFF_UP) {
2849 ret = ehea_stop_qps(dev); 2850 mutex_lock(&port->port_lock);
2850 if (ret) { 2851 netif_stop_queue(dev);
2851 up(&port->port_lock); 2852 ret = ehea_stop_qps(dev);
2852 goto out; 2853 if (ret) {
2853 } 2854 mutex_unlock(&port->port_lock);
2854 port_napi_disable(port); 2855 goto out;
2855 up(&port->port_lock);
2856 } 2856 }
2857 port_napi_disable(port);
2858 mutex_unlock(&port->port_lock);
2857 } 2859 }
2858 } 2860 }
2859 2861
@@ -2893,12 +2895,12 @@ static void ehea_rereg_mrs(struct work_struct *work)
2893 struct net_device *dev = port->netdev; 2895 struct net_device *dev = port->netdev;
2894 2896
2895 if (dev->flags & IFF_UP) { 2897 if (dev->flags & IFF_UP) {
2896 down(&port->port_lock); 2898 mutex_lock(&port->port_lock);
2897 port_napi_enable(port); 2899 port_napi_enable(port);
2898 ret = ehea_restart_qps(dev); 2900 ret = ehea_restart_qps(dev);
2899 if (!ret) 2901 if (!ret)
2900 netif_wake_queue(dev); 2902 netif_wake_queue(dev);
2901 up(&port->port_lock); 2903 mutex_unlock(&port->port_lock);
2902 } 2904 }
2903 } 2905 }
2904 } 2906 }
@@ -3064,7 +3066,7 @@ struct ehea_port *ehea_setup_single_port(struct ehea_adapter *adapter,
3064 3066
3065 port = netdev_priv(dev); 3067 port = netdev_priv(dev);
3066 3068
3067 sema_init(&port->port_lock, 1); 3069 mutex_init(&port->port_lock);
3068 port->state = EHEA_PORT_DOWN; 3070 port->state = EHEA_PORT_DOWN;
3069 port->sig_comp_iv = sq_entries / 10; 3071 port->sig_comp_iv = sq_entries / 10;
3070 3072