aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorRoland Dreier <rolandd@cisco.com>2008-04-17 00:01:08 -0400
committerRoland Dreier <rolandd@cisco.com>2008-04-17 00:01:08 -0400
commit37608eea86a358ac6a18df0af55d4f77d08a1f30 (patch)
treebb0d7c9a93763e6b3fda744a08b2a0c6ed80dfec /drivers
parent26c4fc26d0af9b16a6a234318d15ee0b3896a63d (diff)
mlx4_core: Fix confusion between mlx4_event and mlx4_dev_event enums
The struct mlx4_interface.event() method was supposed to get an enum mlx4_dev_event, but the driver code was actually passing in the hardware enum mlx4_event values. Fix up the callers of mlx4_dispatch_event() so that they pass in the right type of value, and fix up the event method in mlx4_ib so that it can handle the enum mlx4_dev_event values. This eliminates the need for the subtype parameter to the event method, so remove it. This also fixes the sparse warning drivers/net/mlx4/intf.c:127:48: warning: mixing different enum types drivers/net/mlx4/intf.c:127:48: int enum mlx4_event versus drivers/net/mlx4/intf.c:127:48: int enum mlx4_dev_event Signed-off-by: Roland Dreier <rolandd@cisco.com>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/infiniband/hw/mlx4/main.c14
-rw-r--r--drivers/net/mlx4/catas.c2
-rw-r--r--drivers/net/mlx4/eq.c5
-rw-r--r--drivers/net/mlx4/intf.c8
-rw-r--r--drivers/net/mlx4/mlx4.h4
5 files changed, 17 insertions, 16 deletions
diff --git a/drivers/infiniband/hw/mlx4/main.c b/drivers/infiniband/hw/mlx4/main.c
index 96a39b5c9254..d5512011999c 100644
--- a/drivers/infiniband/hw/mlx4/main.c
+++ b/drivers/infiniband/hw/mlx4/main.c
@@ -675,18 +675,20 @@ static void mlx4_ib_remove(struct mlx4_dev *dev, void *ibdev_ptr)
675} 675}
676 676
677static void mlx4_ib_event(struct mlx4_dev *dev, void *ibdev_ptr, 677static void mlx4_ib_event(struct mlx4_dev *dev, void *ibdev_ptr,
678 enum mlx4_dev_event event, int subtype, 678 enum mlx4_dev_event event, int port)
679 int port)
680{ 679{
681 struct ib_event ibev; 680 struct ib_event ibev;
682 681
683 switch (event) { 682 switch (event) {
684 case MLX4_EVENT_TYPE_PORT_CHANGE: 683 case MLX4_DEV_EVENT_PORT_UP:
685 ibev.event = subtype == MLX4_PORT_CHANGE_SUBTYPE_ACTIVE ? 684 ibev.event = IB_EVENT_PORT_ACTIVE;
686 IB_EVENT_PORT_ACTIVE : IB_EVENT_PORT_ERR;
687 break; 685 break;
688 686
689 case MLX4_EVENT_TYPE_LOCAL_CATAS_ERROR: 687 case MLX4_DEV_EVENT_PORT_DOWN:
688 ibev.event = IB_EVENT_PORT_ERR;
689 break;
690
691 case MLX4_DEV_EVENT_CATASTROPHIC_ERROR:
690 ibev.event = IB_EVENT_DEVICE_FATAL; 692 ibev.event = IB_EVENT_DEVICE_FATAL;
691 break; 693 break;
692 694
diff --git a/drivers/net/mlx4/catas.c b/drivers/net/mlx4/catas.c
index 6b32ec94b3a8..aa9528779044 100644
--- a/drivers/net/mlx4/catas.c
+++ b/drivers/net/mlx4/catas.c
@@ -69,7 +69,7 @@ static void poll_catas(unsigned long dev_ptr)
69 if (readl(priv->catas_err.map)) { 69 if (readl(priv->catas_err.map)) {
70 dump_err_buf(dev); 70 dump_err_buf(dev);
71 71
72 mlx4_dispatch_event(dev, MLX4_EVENT_TYPE_LOCAL_CATAS_ERROR, 0, 0); 72 mlx4_dispatch_event(dev, MLX4_DEV_EVENT_CATASTROPHIC_ERROR, 0);
73 73
74 if (internal_err_reset) { 74 if (internal_err_reset) {
75 spin_lock(&catas_lock); 75 spin_lock(&catas_lock);
diff --git a/drivers/net/mlx4/eq.c b/drivers/net/mlx4/eq.c
index 9c36c2034030..e141a1513f07 100644
--- a/drivers/net/mlx4/eq.c
+++ b/drivers/net/mlx4/eq.c
@@ -202,7 +202,10 @@ static int mlx4_eq_int(struct mlx4_dev *dev, struct mlx4_eq *eq)
202 break; 202 break;
203 203
204 case MLX4_EVENT_TYPE_PORT_CHANGE: 204 case MLX4_EVENT_TYPE_PORT_CHANGE:
205 mlx4_dispatch_event(dev, eqe->type, eqe->subtype, 205 mlx4_dispatch_event(dev,
206 eqe->subtype == MLX4_PORT_CHANGE_SUBTYPE_ACTIVE ?
207 MLX4_DEV_EVENT_PORT_UP :
208 MLX4_DEV_EVENT_PORT_DOWN,
206 be32_to_cpu(eqe->event.port_change.port) >> 28); 209 be32_to_cpu(eqe->event.port_change.port) >> 28);
207 break; 210 break;
208 211
diff --git a/drivers/net/mlx4/intf.c b/drivers/net/mlx4/intf.c
index be5d9e90ccf2..4a6c4d526f1b 100644
--- a/drivers/net/mlx4/intf.c
+++ b/drivers/net/mlx4/intf.c
@@ -30,8 +30,6 @@
30 * SOFTWARE. 30 * SOFTWARE.
31 */ 31 */
32 32
33#include <linux/mlx4/driver.h>
34
35#include "mlx4.h" 33#include "mlx4.h"
36 34
37struct mlx4_device_context { 35struct mlx4_device_context {
@@ -113,8 +111,7 @@ void mlx4_unregister_interface(struct mlx4_interface *intf)
113} 111}
114EXPORT_SYMBOL_GPL(mlx4_unregister_interface); 112EXPORT_SYMBOL_GPL(mlx4_unregister_interface);
115 113
116void mlx4_dispatch_event(struct mlx4_dev *dev, enum mlx4_event type, 114void mlx4_dispatch_event(struct mlx4_dev *dev, enum mlx4_dev_event type, int port)
117 int subtype, int port)
118{ 115{
119 struct mlx4_priv *priv = mlx4_priv(dev); 116 struct mlx4_priv *priv = mlx4_priv(dev);
120 struct mlx4_device_context *dev_ctx; 117 struct mlx4_device_context *dev_ctx;
@@ -124,8 +121,7 @@ void mlx4_dispatch_event(struct mlx4_dev *dev, enum mlx4_event type,
124 121
125 list_for_each_entry(dev_ctx, &priv->ctx_list, list) 122 list_for_each_entry(dev_ctx, &priv->ctx_list, list)
126 if (dev_ctx->intf->event) 123 if (dev_ctx->intf->event)
127 dev_ctx->intf->event(dev, dev_ctx->context, type, 124 dev_ctx->intf->event(dev, dev_ctx->context, type, port);
128 subtype, port);
129 125
130 spin_unlock_irqrestore(&priv->ctx_lock, flags); 126 spin_unlock_irqrestore(&priv->ctx_lock, flags);
131} 127}
diff --git a/drivers/net/mlx4/mlx4.h b/drivers/net/mlx4/mlx4.h
index 53a1cdddfc13..73336810e652 100644
--- a/drivers/net/mlx4/mlx4.h
+++ b/drivers/net/mlx4/mlx4.h
@@ -42,6 +42,7 @@
42#include <linux/timer.h> 42#include <linux/timer.h>
43 43
44#include <linux/mlx4/device.h> 44#include <linux/mlx4/device.h>
45#include <linux/mlx4/driver.h>
45#include <linux/mlx4/doorbell.h> 46#include <linux/mlx4/doorbell.h>
46 47
47#define DRV_NAME "mlx4_core" 48#define DRV_NAME "mlx4_core"
@@ -313,8 +314,7 @@ void mlx4_catas_cleanup(void);
313int mlx4_restart_one(struct pci_dev *pdev); 314int mlx4_restart_one(struct pci_dev *pdev);
314int mlx4_register_device(struct mlx4_dev *dev); 315int mlx4_register_device(struct mlx4_dev *dev);
315void mlx4_unregister_device(struct mlx4_dev *dev); 316void mlx4_unregister_device(struct mlx4_dev *dev);
316void mlx4_dispatch_event(struct mlx4_dev *dev, enum mlx4_event type, 317void mlx4_dispatch_event(struct mlx4_dev *dev, enum mlx4_dev_event type, int port);
317 int subtype, int port);
318 318
319struct mlx4_dev_cap; 319struct mlx4_dev_cap;
320struct mlx4_init_hca_param; 320struct mlx4_init_hca_param;