[MLX4] add 2 new functions to Eth interface: mlx4_register_vlan/mlx4_unregister_vlan...
[mirror/winof/.git] / hw / mlx4 / kernel / bus / drv / pdo.c
index 096a324..61c2da4 100644 (file)
@@ -46,7 +46,8 @@ create_pdo(
        __in WDFDEVICE  Device,\r
        __in PWCHAR     HardwareIds,\r
        __in PWCHAR     DeviceDescription,\r
-       __in ULONG      SerialNo\r
+       __in ULONG      SerialNo,\r
+       __in PWCHAR     Location\r
 )\r
 /*++\r
 \r
@@ -71,9 +72,9 @@ Return Value:
        WDF_DEVICE_PNP_CAPABILITIES pnpCaps;\r
        WDF_DEVICE_POWER_CAPABILITIES powerCaps;\r
        UNICODE_STRING compatId;\r
-       DECLARE_CONST_UNICODE_STRING(deviceLocation, L"MLX4 Bus 0");\r
        UNICODE_STRING deviceId;\r
        DECLARE_UNICODE_STRING_SIZE(buffer, MAX_ID_LEN);\r
+       DECLARE_UNICODE_STRING_SIZE(deviceLocation, MAX_ID_LEN);\r
 \r
        MLX4_PRINT(TRACE_LEVEL_INFORMATION, MLX4_DBG_DRV, ("Entered CreatePdo\n"));\r
 \r
@@ -152,6 +153,11 @@ Return Value:
        // The driver can specify the driver's default locale by calling\r
        // WdfPdoInitSetDefaultLocale.\r
        //\r
+       status =  RtlUnicodeStringPrintf(&deviceLocation, L"MLX4 %s", Location+4);\r
+       if (!NT_SUCCESS(status)) {\r
+               goto Cleanup;\r
+       }\r
+\r
        status = WdfPdoInitAddDeviceText(pDeviceInit,\r
                &buffer, &deviceLocation, 0x409);\r
        if (!NT_SUCCESS(status)) {\r
@@ -189,10 +195,6 @@ Return Value:
        // Set PnP properties for the child device.\r
        //\r
        WDF_DEVICE_PNP_CAPABILITIES_INIT(&pnpCaps);\r
-       pnpCaps.Removable         = WdfTrue;\r
-       pnpCaps.EjectSupported    = WdfTrue;\r
-       pnpCaps.SurpriseRemovalOK = WdfTrue;\r
-\r
        pnpCaps.Address  = SerialNo;\r
        pnpCaps.UINumber = SerialNo;\r
 \r
@@ -265,6 +267,8 @@ Return Value:
        p_fdo->bus_ib_ifc.mlx4_interface.mlx4_reset_request = mlx4_reset_request;\r
        p_fdo->bus_ib_ifc.mlx4_interface.mlx4_reset_execute = mlx4_reset_execute;\r
        p_fdo->bus_ib_ifc.mlx4_interface.mlx4_reset_ready = mlx4_reset_ready;\r
+       p_fdo->bus_ib_ifc.mlx4_interface.mlx4_register_vlan = mlx4_register_vlan;\r
+       p_fdo->bus_ib_ifc.mlx4_interface.mlx4_unregister_vlan = mlx4_unregister_vlan;\r
        \r
        //\r
        // Create a custom interface so that other drivers can\r