[MLX4] 1) added support for sending large multi-parameter messages to System Event...
[mirror/winof/.git] / hw / mlx4 / kernel / bus / net / main.c
index f8782fe..61215ee 100644 (file)
@@ -239,6 +239,7 @@ static int mlx4_dev_cap(struct mlx4_dev *dev, struct mlx4_dev_cap *dev_cap)
        dev->caps.log_num_vlans = ilog2(roundup_pow_of_two
                                        (g.mod_num_vlan + 2));
        dev->caps.log_num_prios = (g.mod_use_prio)? 3: 0;
+       dev->caps.num_fc_exch = g.mod_num_fc_exch;
 
        err = mlx4_check_port_params(dev, port_type);
        if (err)
@@ -292,7 +293,7 @@ static int mlx4_dev_cap(struct mlx4_dev *dev, struct mlx4_dev_cap *dev_cap)
                (1 << dev->caps.log_num_vlans)*
                (1 << dev->caps.log_num_prios)*
                num_eth_ports;
-       dev->caps.reserved_qps_cnt[MLX4_QP_REGION_FC_EXCH] = MLX4_NUM_FEXCH;
+       dev->caps.reserved_qps_cnt[MLX4_QP_REGION_FC_EXCH] = dev->caps.num_fc_exch;
 
        return 0;
 }
@@ -311,13 +312,17 @@ static int __devinit mlx4_load_fw(struct mlx4_dev *dev)
 
        err = mlx4_MAP_FA(dev, priv->fw.fw_icm);
        if (err) {
-               mlx4_err(dev, "MAP_FA command failed, aborting.\n");
+               mlx4_dbg(dev, "MAP_FA command failed, aborting.\n");
+               WriteEventLogEntryData( dev->pdev->p_self_do, (ULONG)EVENT_MLX4_ERROR_MAP_FA, 0, 0, 1,
+                       L"%d", err );
                goto err_free;
        }
 
        err = mlx4_RUN_FW(dev);
        if (err) {
-               mlx4_err(dev, "RUN_FW command failed, aborting.\n");
+               mlx4_dbg(dev, "RUN_FW command failed, aborting.\n");
+               WriteEventLogEntryData( dev->pdev->p_self_do, (ULONG)EVENT_MLX4_ERROR_RUN_FW, 0, 0, 1,
+                       L"%d", err );
                goto err_unmap_fa;
        }
 
@@ -638,23 +643,30 @@ static int mlx4_init_hca(struct mlx4_dev *dev)
        if (err) {
                if (err == -EACCES) {
                        static int print_it = 1;
-                       if (print_it-- > 0)
-                               mlx4_warn(dev, "Function disabled, please upgrade to multi function driver.\n");
+                       if (print_it-- > 0) {
+                               mlx4_info(dev, "Function disabled, please upgrade to multi function driver.\n");
+                               WriteEventLogEntryData( dev->pdev->p_self_do, (ULONG)EVENT_MLX4_WARN_QUERY_FW, 0, 0, 0 );
+                       }
+               }
+               else {
+                       mlx4_dbg(dev, "QUERY_FW command failed, aborting.\n");
+                       WriteEventLogEntryData( dev->pdev->p_self_do, (ULONG)EVENT_MLX4_ERROR_QUERY_FW, 0, 0, 1,
+                               L"%d", err );
                }
-               else
-                       mlx4_err(dev, "QUERY_FW command failed, aborting.\n");
                return err;
        }
 
        err = mlx4_load_fw(dev);
        if (err) {
-               mlx4_err(dev, "Failed to start FW, aborting.\n");
+               mlx4_dbg(dev, "Failed to start FW, aborting.\n");
                return err;
        }
 
        err = mlx4_dev_cap(dev, &dev_cap);
        if (err) {
-               mlx4_err(dev, "QUERY_DEV_CAP command failed, aborting.\n");
+               mlx4_dbg(dev, "QUERY_DEV_CAP command failed, aborting.\n");
+               WriteEventLogEntryData( dev->pdev->p_self_do, (ULONG)EVENT_MLX4_ERROR_QUERY_DEV_CAP, 0, 0, 1,
+                       L"%d", err );
                goto err_stop_fw;
        }
 
@@ -682,6 +694,8 @@ static int mlx4_init_hca(struct mlx4_dev *dev)
        err = mlx4_QUERY_ADAPTER(dev, &adapter);
        if (err) {
                mlx4_err(dev, "QUERY_ADAPTER command failed, aborting.\n");
+               WriteEventLogEntryData( dev->pdev->p_self_do, (ULONG)EVENT_MLX4_ERROR_QUERY_ADAPTER, 0, 0, 1,
+                       L"%d", err );
                goto err_close;
        }
 
@@ -964,12 +978,16 @@ run_as_livefish:
                if (err) {
                        MLX4_PRINT(TRACE_LEVEL_INFORMATION ,MLX4_DBG_LOW ,
                                ("mlx4_register_device for livefish failed, return with error.\n"));
+                       WriteEventLogEntryData( pdev->p_self_do, (ULONG)EVENT_MLX4_ERROR_LIFEFISH_FAIL, 
+                               0, errno_to_ntstatus(err), 0 ); 
                        pdev->dev = NULL;
                        kfree(priv);
                } 
                else {
                MLX4_PRINT(TRACE_LEVEL_ERROR ,MLX4_DBG_LOW ,
                        ("MLX4_BUS started in \"livefish\" mode !!!.\n"));
+                       WriteEventLogEntryData( pdev->p_self_do, (ULONG)EVENT_MLX4_ERROR_LIFEFISH_OK, 
+                               0, errno_to_ntstatus(err), 0 ); 
                }
                goto end;
        }