[HCA] Distinguish between Tavor and Arbel HCAs, report correct device ID
authorftillier <ftillier@ad392aa1-c5ef-ae45-8dd8-e69d62a5ef86>
Wed, 2 Nov 2005 22:19:43 +0000 (22:19 +0000)
committerftillier <ftillier@ad392aa1-c5ef-ae45-8dd8-e69d62a5ef86>
Wed, 2 Nov 2005 22:19:43 +0000 (22:19 +0000)
in CA attributes.

Signed-off-by: Yossi Leybovich (sleybo@mellanox.co.il)
git-svn-id: svn://openib.tc.cornell.edu/gen1/trunk@138 ad392aa1-c5ef-ae45-8dd8-e69d62a5ef86

hw/mt23108/vapi/mlxsys/os_dep/win/tdriver/MdCard.h
hw/mt23108/vapi/mlxsys/os_dep/win/tdriver/MdConf.c
hw/mt23108/vapi/mlxsys/os_dep/win/tdriver/MdIoctl.c
hw/mt23108/vapi/mlxsys/os_dep/win/tdriver/MdPnp.c
hw/mt23108/vapi/mlxsys/os_dep/win/tdriver/MdRdWr.c
hw/mt23108/vapi/mlxsys/os_dep/win/tdriver/MdUtil.c

index ce7f2e3..f4bda55 100644 (file)
@@ -497,7 +497,7 @@ typedef struct MD_DEV_CONTEXT_S {
                /* for TAVOR_SD */\r
                { L"5A5A", "mt%d_pci%d", "mt%d_pci%d",  MD_DEV_ID_TAVOR_SD, MD_DEV_IX_TAVOR_SD, TRUE,   0x00100000, 0x01000000, 0x00000000, 167000000,  4, 0 },\r
                /* for TAVOR_SD */\r
-               { L"6278", "InfiniHost%d", "InfiniHosA%d",      MD_DEV_ID_ARBEL_TM, MD_DEV_IX_ARBEL_TM, TRUE,   0x00100000, 0x01000000, 0x00000000, 167000000,  4, 0 },\r
+               { L"6278", "InfiniHostEx%d", "InfiniHosEx%d",   MD_DEV_ID_ARBEL_TM, MD_DEV_IX_ARBEL_TM, TRUE,   0x00100000, 0x01000000, 0x00000000, 167000000,  4, 0 },\r
        };\r
 \r
 #else\r
index d9cf0b6..12b8db2 100644 (file)
@@ -586,7 +586,8 @@ PciFixCmdReg(
 \r
        } /* fix HCA command register from SHRIMP */\r
 \r
-       if (pi_pMdDevContext->m_eDevType == MD_DEV_IX_TAVOR     ) \r
+       if (pi_pMdDevContext->m_eDevType == MD_DEV_IX_TAVOR \r
+               || pi_pMdDevContext->m_eDevType ==MD_DEV_IX_ARBEL_TM) \r
        { /* fix command register for TAVOR */\r
 \r
                l_pInterface = &pi_pMdDevContext->m_Interface;\r
@@ -680,7 +681,8 @@ PciHdrWrite(
                        return l_Status;\r
                }       \r
                else\r
-               if (pi_pMdDevContext->m_eDevType == MD_DEV_IX_TAVOR) {\r
+               if (pi_pMdDevContext->m_eDevType == MD_DEV_IX_TAVOR || \r
+                       pi_pMdDevContext->m_eDevType == MD_DEV_IX_ARBEL_TM) {\r
 \r
                        /* protect */\r
                        KSEM_ACQ(&pi_pMdDevContext->m_Sem);\r
@@ -849,7 +851,8 @@ PciHdrSave(
 \r
        }\r
        else\r
-       if (pi_pMdDevContext->m_eDevType == MD_DEV_IX_TAVOR     ) {\r
+       if (pi_pMdDevContext->m_eDevType == MD_DEV_IX_TAVOR ||\r
+               pi_pMdDevContext->m_eDevType == MD_DEV_IX_ARBEL_TM) {\r
        \r
                /* \r
                 * HCA device\r
@@ -936,7 +939,8 @@ PciHdrRestore(
                }\r
        }\r
        else\r
-       if (pi_pMdDevContext->m_eDevType == MD_DEV_IX_TAVOR     ) {\r
+       if (pi_pMdDevContext->m_eDevType == MD_DEV_IX_TAVOR ||\r
+               pi_pMdDevContext->m_eDevType == MD_DEV_IX_ARBEL_TM) {\r
        \r
                /* \r
                 * Bridge device\r
@@ -987,7 +991,8 @@ PciReset(
                        l_Status );\r
        }\r
        else \r
-       if (pi_pMdDevContext->m_eDevType == MD_DEV_IX_TAVOR) { /* we are Tavor device */\r
+       if (pi_pMdDevContext->m_eDevType == MD_DEV_IX_TAVOR ||\r
+               pi_pMdDevContext->m_eDevType == MD_DEV_IX_ARBEL_TM) { /* we are Tavor device */\r
                l_Status = PciDevReset(pi_pMdDevContext, l_ResetOffset, l_ResetValue );\r
        }\r
        else\r
index e3b022e..ea967bd 100644 (file)
@@ -140,6 +140,7 @@ Return Value:
                                \r
                case MD_DEV_IX_TAVOR_SD:\r
                case MD_DEV_IX_TAVOR:\r
+               case MD_DEV_IX_ARBEL_TM:\r
                        l_Status = PciIoctl( l_pMdDevContext, l_pPcs, l_nIoControlCode, l_pInBuffer, \r
                                l_nInBufLength, l_pOutBuffer, l_nOutBufLength, (PULONG)&pi_pIrp->IoStatus.Information );\r
                        break;\r
index 1e04bd1..1c73e03 100644 (file)
@@ -932,7 +932,9 @@ Return Value:
         * add device to TAVOR\r
         */ \r
 \r
-       if (l_pMdDevContext->m_eDevType == MD_DEV_IX_TAVOR      && g_pDrvContext->m_fSupportTavor)\r
+       if ((l_pMdDevContext->m_eDevType == MD_DEV_IX_TAVOR     || \r
+               l_pMdDevContext->m_eDevType == MD_DEV_IX_ARBEL_TM)\r
+               && g_pDrvContext->m_fSupportTavor)\r
        { /* add HCA to Tavor functional DLLs */\r
        \r
                unsigned char                           l_RevId = 0;\r
@@ -1128,7 +1130,8 @@ Return Value:
        // stop the card by sending some commands to it or suspend all new requests and wait for the end of in-progress ones\r
        //\r
 \r
-       if (l_pMdDevContext->m_eDevType == MD_DEV_IX_TAVOR      && g_pDrvContext->m_fSupportTavor)\r
+       if ((l_pMdDevContext->m_eDevType == MD_DEV_IX_TAVOR     ||\r
+               l_pMdDevContext->m_eDevType == MD_DEV_IX_ARBEL_TM)&& g_pDrvContext->m_fSupportTavor)\r
        { /* remove HCA from Tavor functional DLLs */\r
        \r
                HH_ret_t                                        l_HhRet;\r
index 8398471..ea85c7b 100644 (file)
@@ -103,8 +103,9 @@ Return Value:
                                break;\r
                                \r
                        case MD_DEV_IX_TAVOR:\r
+                       case MD_DEV_IX_ARBEL_TM:\r
                          // MDCTL\r
-            PciRelease( l_pMdDevContext, l_pPcs );\r
+                               PciRelease( l_pMdDevContext, l_pPcs );\r
                                break;\r
                                \r
                        case MD_DEV_IX_TAVOR_BD:\r
index 927d0b5..ec7839f 100644 (file)
@@ -447,6 +447,7 @@ Return Value:
                        break;\r
 \r
                case MD_DEV_IX_TAVOR:\r
+               case MD_DEV_IX_ARBEL_TM:\r
                        GetRegistryDword( L"DdrMapOffset",      MD_DFLT_CONF_DATA, &l_pMdDevContext->m_ulDdrMapOffset );\r
                        GetRegistryDword( L"DdrMapSize",        MD_DFLT_CONF_DATA, &l_pMdDevContext->m_ulDdrMapSize );\r
                        GetRegistryDword( L"ResetCard",         MD_DFLT_CONF_DATA, &l_pMdDevContext->m_PerformReset );\r
@@ -1415,8 +1416,9 @@ NTSTATUS CreateOneDevice(
 \r
        /* create Control Device names */\r
        /* !!! from now on work with ARBEL_TM as with TAVOR */\r
-       l_pDevInfo = (pi_DevIx == (int)MD_DEV_IX_ARBEL_TM) ? &g_DevParams[MD_DEV_IX_TAVOR] : &g_DevParams[pi_DevIx];\r
-       if (l_pDevInfo->m_DevId == MD_DEV_ID_TAVOR)\r
+       //l_pDevInfo = (pi_DevIx == (int)MD_DEV_IX_ARBEL_TM) ? &g_DevParams[MD_DEV_IX_TAVOR] : &g_DevParams[pi_DevIx];\r
+       l_pDevInfo =   &g_DevParams[pi_DevIx];\r
+       if (l_pDevInfo->m_DevId == MD_DEV_ID_TAVOR || l_pDevInfo->m_DevId == MD_DEV_ID_ARBEL_TM)\r
                sprintf( l_DevName, l_pDevInfo->m_Format, g_pDrvContext->m_uCardNo );\r
        else\r
                sprintf( l_DevName, l_pDevInfo->m_Format, l_pDevInfo->m_DevId, g_pDrvContext->m_uCardNo );\r