]> git.openfabrics.org - ~shefty/rdma-win.git/commitdiff
[MLX4] fix in calculating of the number of HCA physical ports. [mlnx: 3277,3279]
authorleonidk <leonidk@ad392aa1-c5ef-ae45-8dd8-e69d62a5ef86>
Sun, 5 Oct 2008 19:17:22 +0000 (19:17 +0000)
committerleonidk <leonidk@ad392aa1-c5ef-ae45-8dd8-e69d62a5ef86>
Sun, 5 Oct 2008 19:17:22 +0000 (19:17 +0000)
git-svn-id: svn://openib.tc.cornell.edu/gen1@1629 ad392aa1-c5ef-ae45-8dd8-e69d62a5ef86

trunk/hw/mlx4/kernel/bus/drv/drv.c
trunk/hw/mlx4/kernel/bus/ib/main.c
trunk/hw/mlx4/kernel/bus/net/main.c
trunk/hw/mlx4/kernel/bus/net/mlx4.h

index 1f240c582a8f17427ad0cda897b5c9e19a92293d..23b9ef750f96e290e5e42557c043d157cea844b8 100644 (file)
@@ -236,7 +236,7 @@ Routine Description:
        // eventually we'll have all information about children in Registry\r
        // DriverEntry will read it into a Global storage and\r
        // this routine will create all the children on base on this info\r
-       number_of_ib_ports = mlx4_count_ib_ports();\r
+       number_of_ib_ports = mlx4_count_ib_ports(mdev);\r
        ASSERT(number_of_ib_ports >=0 && number_of_ib_ports <=2);\r
        \r
        if(number_of_ib_ports > 0) {\r
@@ -248,7 +248,7 @@ Routine Description:
 \r
        // Create ethernet ports if needed\r
        for (i = 0; i < MLX4_MAX_PORTS; i++) {\r
-               if(mlx4_is_eth_port(i)) {\r
+               if(mlx4_is_eth_port(mdev, i)) {\r
                        status = __create_child(Device, ETH_HARDWARE_IDS, ETH_HARDWARE_DESCRIPTION, i+1 );\r
                        if (!NT_SUCCESS(status)) {\r
                                 MLX4_PRINT_EV(TRACE_LEVEL_ERROR, MLX4_DBG_DRV, ("__create_child (eth) failed with 0x%x\n", status));\r
index 447c80ae9d25b386683cd28c8320e3eead969887..d7f3861e6548b2eefebd837774089b08acb8c256 100644 (file)
@@ -511,7 +511,7 @@ static void *mlx4_ib_add(struct mlx4_dev *dev)
 
        strlcpy(ibdev->ib_dev.name, "mlx4_%d", IB_DEVICE_NAME_MAX);
        ibdev->ib_dev.node_type         = RDMA_NODE_IB_CA;
-       ibdev->ib_dev.phys_port_cnt     = (u8)mlx4_count_ib_ports();
+       ibdev->ib_dev.phys_port_cnt     = (u8)mlx4_count_ib_ports(dev);
        ibdev->ib_dev.num_comp_vectors  = 1;
        ibdev->ib_dev.dma_device        = dev->pdev->dev;
 
index 2c8554bd79b1c28416b6ad42a2c872f1ae4d274b..3a1d92e550f62ef3082b075917ca713067193ccb 100644 (file)
@@ -121,25 +121,25 @@ static void mlx4_str2port_type(WCHAR **port_str,
        }
 }
 
-int mlx4_count_ib_ports()
+int mlx4_count_ib_ports(struct mlx4_dev *dev)
 {
        int i;
        int count = 0;
 
        for (i = 0; i < MLX4_MAX_PORTS; i++) {
-               if (g.mod_port_type[i] == MLX4_PORT_TYPE_IB) {
+               if (dev->caps.port_type[i+1] == MLX4_PORT_TYPE_IB) {
                        count++;
                }
        }
        return count;
 }
 
-BOOLEAN mlx4_is_eth_port(int port_number)
+BOOLEAN mlx4_is_eth_port(struct mlx4_dev *dev, int port_number)
 {
-       if (g.mod_port_type[port_number] == MLX4_PORT_TYPE_IB) {
-               return FALSE;
+       if (dev->caps.port_type[port_number+1] == MLX4_PORT_TYPE_ETH) {
+               return TRUE;
        }
-       return TRUE;
+       return FALSE;
 }
 
 static int mlx4_dev_cap(struct mlx4_dev *dev, struct mlx4_dev_cap *dev_cap)
index 244cc015368e6bd9d95ba1e929f26308c9f81b89..092c4abd5714caab25fc46c55415c40f202e26ea 100644 (file)
@@ -377,8 +377,8 @@ void mlx4_dispatch_event(struct mlx4_dev *dev, enum mlx4_event type,
 void mlx4_intf_init();
 void mlx4_net_init();
 
-BOOLEAN mlx4_is_eth_port(int port_number);
-int mlx4_count_ib_ports();
+BOOLEAN mlx4_is_eth_port(struct mlx4_dev *dev, int port_number);
+int mlx4_count_ib_ports(struct mlx4_dev *dev);
 
 struct mlx4_dev_cap;
 struct mlx4_init_hca_param;