]> err.no Git - linux-2.6/blobdiff - drivers/infiniband/hw/mlx4/main.c
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/ieee1394...
[linux-2.6] / drivers / infiniband / hw / mlx4 / main.c
index d8287d9db41e5a8eb0bb3167db75635c266b4960..136c76c7b4e78ac394ebc73442d6ba587200427a 100644 (file)
 #include "user.h"
 
 #define DRV_NAME       "mlx4_ib"
-#define DRV_VERSION    "0.01"
-#define DRV_RELDATE    "May 1, 2006"
+#define DRV_VERSION    "1.0"
+#define DRV_RELDATE    "April 4, 2008"
 
 MODULE_AUTHOR("Roland Dreier");
 MODULE_DESCRIPTION("Mellanox ConnectX HCA InfiniBand driver");
 MODULE_LICENSE("Dual BSD/GPL");
 MODULE_VERSION(DRV_VERSION);
 
-static const char mlx4_ib_version[] __devinitdata =
+static const char mlx4_ib_version[] =
        DRV_NAME ": Mellanox ConnectX InfiniBand driver v"
        DRV_VERSION " (" DRV_RELDATE ")\n";
 
@@ -99,6 +99,10 @@ static int mlx4_ib_query_device(struct ib_device *ibdev,
                props->device_cap_flags |= IB_DEVICE_AUTO_PATH_MIG;
        if (dev->dev->caps.flags & MLX4_DEV_CAP_FLAG_UD_AV_PORT)
                props->device_cap_flags |= IB_DEVICE_UD_AV_PORT_ENFORCE;
+       if (dev->dev->caps.flags & MLX4_DEV_CAP_FLAG_IPOIB_CSUM)
+               props->device_cap_flags |= IB_DEVICE_UD_IP_CSUM;
+       if (dev->dev->caps.max_gso_sz)
+               props->device_cap_flags |= IB_DEVICE_UD_TSO;
 
        props->vendor_id           = be32_to_cpup((__be32 *) (out_mad->data + 36)) &
                0xffffff;
@@ -468,6 +472,7 @@ static int init_node_data(struct mlx4_ib_dev *dev)
        if (err)
                goto out;
 
+       dev->dev->rev_id = be32_to_cpup((__be32 *) (out_mad->data + 32));
        memcpy(&dev->ib_dev.node_guid, out_mad->data + 12, 8);
 
 out:
@@ -516,9 +521,16 @@ static struct class_device_attribute *mlx4_class_attributes[] = {
 
 static void *mlx4_ib_add(struct mlx4_dev *dev)
 {
+       static int mlx4_ib_version_printed;
        struct mlx4_ib_dev *ibdev;
        int i;
 
+
+       if (!mlx4_ib_version_printed) {
+               printk(KERN_INFO "%s", mlx4_ib_version);
+               ++mlx4_ib_version_printed;
+       }
+
        ibdev = (struct mlx4_ib_dev *) ib_alloc_device(sizeof *ibdev);
        if (!ibdev) {
                dev_err(&dev->pdev->dev, "Device struct alloc failed\n");
@@ -559,6 +571,7 @@ static void *mlx4_ib_add(struct mlx4_dev *dev)
                (1ull << IB_USER_VERBS_CMD_DEREG_MR)            |
                (1ull << IB_USER_VERBS_CMD_CREATE_COMP_CHANNEL) |
                (1ull << IB_USER_VERBS_CMD_CREATE_CQ)           |
+               (1ull << IB_USER_VERBS_CMD_RESIZE_CQ)           |
                (1ull << IB_USER_VERBS_CMD_DESTROY_CQ)          |
                (1ull << IB_USER_VERBS_CMD_CREATE_QP)           |
                (1ull << IB_USER_VERBS_CMD_MODIFY_QP)           |
@@ -597,6 +610,8 @@ static void *mlx4_ib_add(struct mlx4_dev *dev)
        ibdev->ib_dev.post_send         = mlx4_ib_post_send;
        ibdev->ib_dev.post_recv         = mlx4_ib_post_recv;
        ibdev->ib_dev.create_cq         = mlx4_ib_create_cq;
+       ibdev->ib_dev.modify_cq         = mlx4_ib_modify_cq;
+       ibdev->ib_dev.resize_cq         = mlx4_ib_resize_cq;
        ibdev->ib_dev.destroy_cq        = mlx4_ib_destroy_cq;
        ibdev->ib_dev.poll_cq           = mlx4_ib_poll_cq;
        ibdev->ib_dev.req_notify_cq     = mlx4_ib_arm_cq;
@@ -667,18 +682,20 @@ static void mlx4_ib_remove(struct mlx4_dev *dev, void *ibdev_ptr)
 }
 
 static void mlx4_ib_event(struct mlx4_dev *dev, void *ibdev_ptr,
-                         enum mlx4_dev_event event, int subtype,
-                         int port)
+                         enum mlx4_dev_event event, int port)
 {
        struct ib_event ibev;
 
        switch (event) {
-       case MLX4_EVENT_TYPE_PORT_CHANGE:
-               ibev.event = subtype == MLX4_PORT_CHANGE_SUBTYPE_ACTIVE ?
-                       IB_EVENT_PORT_ACTIVE : IB_EVENT_PORT_ERR;
+       case MLX4_DEV_EVENT_PORT_UP:
+               ibev.event = IB_EVENT_PORT_ACTIVE;
+               break;
+
+       case MLX4_DEV_EVENT_PORT_DOWN:
+               ibev.event = IB_EVENT_PORT_ERR;
                break;
 
-       case MLX4_EVENT_TYPE_LOCAL_CATAS_ERROR:
+       case MLX4_DEV_EVENT_CATASTROPHIC_ERROR:
                ibev.event = IB_EVENT_DEVICE_FATAL;
                break;