[MLX4] added events for Registry handling error flow. [mlnx: 5058]
authorleonidk <leonidk@ad392aa1-c5ef-ae45-8dd8-e69d62a5ef86>
Tue, 17 Nov 2009 14:37:35 +0000 (14:37 +0000)
committerleonidk <leonidk@ad392aa1-c5ef-ae45-8dd8-e69d62a5ef86>
Tue, 17 Nov 2009 14:37:35 +0000 (14:37 +0000)
git-svn-id: svn://openib.tc.cornell.edu/gen1/trunk@2584 ad392aa1-c5ef-ae45-8dd8-e69d62a5ef86

hw/mlx4/kernel/bus/core/ev_log.mc
hw/mlx4/kernel/bus/drv/drv.c

index ae6a692..c7d8c2f 100644 (file)
@@ -76,6 +76,10 @@ The device parameters are:%n
    FW version     %t%7.%8.%9%n\r
    HCA guid       %t%10%11%n\r
    HCA location   %t'%12'\r
+   HCA location   %t'%12'%n\r
+   port number    %t%13%n\r
+   port1 type     %t%14%n\r
+   port2 type     %t%15.\r
 .\r
 \r
 MessageId=0x0007 Facility=MLX4 Severity=Error SymbolicName=EVENT_MLX4_ERROR_MAP_FA\r
@@ -142,9 +146,19 @@ Language=English
 HCA restart finished. Notifying the clients ...\r
 .\r
 \r
+MessageId=0x0010 Facility=MLX4 Severity=Warning SymbolicName=EVENT_MLX4_WARN_REG_ACTION\r
+Language=English\r
+%2 failed on %3 with status %4.\r
+.\r
+\r
+MessageId=0x0011 Facility=MLX4 Severity=Warning SymbolicName=EVENT_MLX4_WARN_REG_OPEN_DEV_KEY\r
+Language=English\r
+WdfDeviceOpenRegistryKey failed on opening SW (=driver) key for mlx4_bus with status %2.\r
+.\r
 \r
 MessageId=0x0012 Facility=MLX4 Severity=Warning SymbolicName=EVENT_MLX4_WARN_INVALID_PORT_TYPE_VALUE\r
 Language=English\r
 PortType registry parameter contains invalid value, PortType = %2.\r
 .\r
 \r
+\r
index 06a6086..2a8ff92 100644 (file)
@@ -275,7 +275,7 @@ end:
        return status;\r
 }\r
 \r
-BOOLEAN __read_setup_params(PUNICODE_STRING puvalue)\r
+BOOLEAN __read_setup_params(struct pci_dev *pdev, PUNICODE_STRING puvalue)\r
 {\r
        NTSTATUS    status;    \r
        WDFKEY hParamsKey = NULL;\r
@@ -287,6 +287,8 @@ BOOLEAN __read_setup_params(PUNICODE_STRING puvalue)
        {\r
                MLX4_PRINT( TRACE_LEVEL_WARNING  ,MLX4_DBG_DEV  ,\r
                        ("WdfRegistryOpenKey(\\Registry\\Machine\\SOFTWARE\\Mellanox) Failed status = 0x%x\n", status));\r
+               WriteEventLogEntryData( pdev->p_self_do, (ULONG)EVENT_MLX4_WARN_REG_ACTION, 0, 0, 3,\r
+                       L"%s", L"WdfRegistryOpenKey", L"%s", KeyName.Buffer, L"%#x", status );\r
                return FALSE;\r
        }\r
 \r
@@ -295,6 +297,8 @@ BOOLEAN __read_setup_params(PUNICODE_STRING puvalue)
        {\r
                MLX4_PRINT( TRACE_LEVEL_ERROR  ,MLX4_DBG_DEV  ,\r
                        ("WdfRegistryQueryUnicodeString(PortType) Failed status = 0x%x\n", status));\r
+               WriteEventLogEntryData( pdev->p_self_do, (ULONG)EVENT_MLX4_WARN_REG_ACTION, 0, 0, 3,\r
+                       L"%s", L"WdfRegistryQueryUnicodeString", L"%s", PortType.Buffer, L"%#x", status );\r
                WdfRegistryClose(hParamsKey);\r
                return FALSE;\r
        }\r
@@ -310,6 +314,8 @@ __read_dev_params(IN WDFDEVICE  Device, struct mlx4_dev_params *dev_params)
        WDFKEY hKey = NULL;\r
        WDFKEY hParamsKey = NULL;\r
        BOOLEAN bRet = FALSE;\r
+       PFDO_DEVICE_DATA p_fdo  = FdoGetData(Device);\r
+       struct pci_dev *pdev = &p_fdo->pci_dev;\r
        DECLARE_CONST_UNICODE_STRING(Parameters, L"Parameters");\r
        DECLARE_CONST_UNICODE_STRING(PortType, L"PortType");\r
 \r
@@ -329,21 +335,27 @@ __read_dev_params(IN WDFDEVICE  Device, struct mlx4_dev_params *dev_params)
        if( !NT_SUCCESS( status ) ) {\r
                MLX4_PRINT( TRACE_LEVEL_ERROR  ,MLX4_DBG_DEV  ,\r
                        ("WdfDeviceOpenRegistryKey(\\Registry\\Machine\\Control\\Class\\...) Failed status = 0x%x\n", status));\r
+               WriteEventLogEntryData( pdev->p_self_do, (ULONG)EVENT_MLX4_WARN_REG_OPEN_DEV_KEY, 0, 0, 1,\r
+                       L"%#x", status );\r
                goto err;\r
        }\r
 \r
        status = WdfRegistryOpenKey(hKey, &Parameters, STANDARD_RIGHTS_ALL, WDF_NO_OBJECT_ATTRIBUTES, &hParamsKey);\r
        if( !NT_SUCCESS( status ) ) {\r
                MLX4_PRINT( TRACE_LEVEL_ERROR  ,MLX4_DBG_DEV  ,("WdfRegistryOpenKey(Prameters) Failed status = 0x%x\n", status));\r
+               WriteEventLogEntryData( pdev->p_self_do, (ULONG)EVENT_MLX4_WARN_REG_ACTION, 0, 0, 3,\r
+                       L"%s", L"WdfRegistryOpenKey", L"%s", Parameters.Buffer, L"%#x", status );\r
                goto err;\r
        }\r
 \r
-       bRet = __read_setup_params(&uvalue);\r
+       bRet = __read_setup_params(pdev, &uvalue);\r
        if (bRet == TRUE)\r
        {\r
                status = WdfRegistryAssignValue(hParamsKey, &PortType, REG_SZ,uvalue.Length,uvalue.Buffer);        \r
                if( !NT_SUCCESS( status ) ) {\r
                        MLX4_PRINT( TRACE_LEVEL_ERROR  ,MLX4_DBG_DEV  ,("WdfRegistryAssignValue(PortType) Failed status = 0x%x\n", status));\r
+                       WriteEventLogEntryData( pdev->p_self_do, (ULONG)EVENT_MLX4_WARN_REG_ACTION, 0, 0, 3,\r
+                               L"%s", L"WdfRegistryAssignValue", L"%s", PortType.Buffer, L"%#x", status );\r
                        goto err;\r
                }\r
                uvalue.Length = 0;\r
@@ -374,6 +386,10 @@ __read_dev_params(IN WDFDEVICE  Device, struct mlx4_dev_params *dev_params)
                 L"%s",uvalue_data);                \r
                }\r
        }\r
+       else {\r
+               WriteEventLogEntryData( pdev->p_self_do, (ULONG)EVENT_MLX4_WARN_REG_ACTION, 0, 0, 3,\r
+                       L"%s", L"WdfRegistryQueryUnicodeString", L"%s", PortType.Buffer, L"%#x", status );\r
+       }\r
 \r
 err:\r
        if (hKey != NULL) \r
@@ -529,7 +545,7 @@ EvtDeviceD0Entry(
                memset ( &props, 0, sizeof( props) );\r
                p_ibdev = pdev->ib_dev;\r
                (p_ibdev->query_device)( p_ibdev, &props );\r
-               WriteEventLogEntryData( pdev->p_self_do, (ULONG)EVENT_MLX4_INFO_DEV_STARTED, 0, 0, 11,\r
+               WriteEventLogEntryData( pdev->p_self_do, (ULONG)EVENT_MLX4_INFO_DEV_STARTED, 0, 0, 14,\r
                        L"%04x", (ULONG)pdev->ven_id, \r
                        L"%04x", (ULONG)pdev->dev_id,\r
                        L"%04x", (ULONG)pdev->sub_vendor_id,\r
@@ -540,7 +556,10 @@ EvtDeviceD0Entry(
                        L"%d", (int) (mdev->caps.fw_ver & 0xffff),\r
                        L"%08x", *(PULONG)((PUCHAR)&p_ibdev->node_guid + 0), \r
                        L"%08x", *(PULONG)((PUCHAR)&p_ibdev->node_guid + 4), \r
-                       L"%s", pdev->location\r
+                       L"%s", pdev->location,\r
+                       L"%d", mdev->caps.num_ports,\r
+                       L"%s", mdev->caps.port_type[1] == MLX4_PORT_TYPE_IB ? L"IB" : L"ETH",\r
+                       L"%s", mdev->caps.port_type[2] == MLX4_PORT_TYPE_IB ? L"IB" : L"ETH"\r
                        ); \r
        }\r
 \r