// 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
\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
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;
}
}
-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)
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;