[IPoIB NDIS 6.0 CM]
authortzachid <tzachid@ad392aa1-c5ef-ae45-8dd8-e69d62a5ef86>
Thu, 25 Jun 2009 15:36:56 +0000 (15:36 +0000)
committertzachid <tzachid@ad392aa1-c5ef-ae45-8dd8-e69d62a5ef86>
Thu, 25 Jun 2009 15:36:56 +0000 (15:36 +0000)
Files renamed to .cpp
Code cleaning (MLNX: 4521)

git-svn-id: svn://openib.tc.cornell.edu/gen1/trunk@2270 ad392aa1-c5ef-ae45-8dd8-e69d62a5ef86

ulp/ipoib_NDIS6_CM/kernel/SOURCES
ulp/ipoib_NDIS6_CM/kernel/ipoib_adapter.cpp [moved from ulp/ipoib_NDIS6_CM/kernel/ipoib_adapter.c with 95% similarity]
ulp/ipoib_NDIS6_CM/kernel/ipoib_adapter.h
ulp/ipoib_NDIS6_CM/kernel/ipoib_driver.cpp [moved from ulp/ipoib_NDIS6_CM/kernel/ipoib_driver.c with 92% similarity]
ulp/ipoib_NDIS6_CM/kernel/ipoib_endpoint.cpp [moved from ulp/ipoib_NDIS6_CM/kernel/ipoib_endpoint.c with 96% similarity]
ulp/ipoib_NDIS6_CM/kernel/ipoib_ibat.cpp [moved from ulp/ipoib_NDIS6_CM/kernel/ipoib_ibat.c with 92% similarity]
ulp/ipoib_NDIS6_CM/kernel/ipoib_port.cpp [moved from ulp/ipoib_NDIS6_CM/kernel/ipoib_port.c with 95% similarity]
ulp/ipoib_NDIS6_CM/kernel/ipoib_port.h
ulp/ipoib_NDIS6_CM/kernel/ipoib_xfr_mgr.cpp [moved from ulp/ipoib_NDIS6_CM/kernel/ipoib_xfr_mgr.c with 100% similarity]

index a528904..774f114 100644 (file)
@@ -19,13 +19,13 @@ ENABLE_EVENT_TRACING=1
 \r
 SOURCES=       ipoib_log.mc \\r
                ipoib.rc \\r
-               ipoib_driver.c \\r
-               ipoib_adapter.c \\r
-               ipoib_endpoint.c \\r
-               ipoib_port.c \\r
-               ipoib_ibat.c \\r
-#              ipoib_cm.c      \\r
-               ipoib_xfr_mgr.c\r
+               ipoib_driver.cpp \\r
+               ipoib_adapter.cpp \\r
+               ipoib_endpoint.cpp \\r
+               ipoib_port.cpp \\r
+               ipoib_ibat.cpp \\r
+#              ipoib_cm.cpp    \\r
+               ipoib_xfr_mgr.cpp\r
 \r
 INCLUDES=..;..\..\..\inc;..\..\..\inc\kernel;\r
 \r
@@ -50,7 +50,7 @@ TARGETLIBS= \
 \r
 C_DEFINES = $(C_DEFINES) -DEVENT_TRACING\r
 \r
-RUN_WPP = $(SOURCES) -km -ext: .c .h .C .H \\r
+RUN_WPP = $(SOURCES) -km -ext: .c .cpp .h .C .CPP .H\\r
        -scan:ipoib_debug.h \\r
        -func:IPOIB_PRINT(LEVEL,FLAGS,(MSG,...)) \\r
        -func:IPOIB_PRINT_EXIT(LEVEL,FLAGS,(MSG,...))\r
similarity index 95%
rename from ulp/ipoib_NDIS6_CM/kernel/ipoib_adapter.c
rename to ulp/ipoib_NDIS6_CM/kernel/ipoib_adapter.cpp
index 9274709..6733a38 100644 (file)
@@ -115,7 +115,6 @@ ipoib_get_adapter_guids(
 \r
 NDIS_STATUS\r
 ipoib_get_adapter_params(\r
-       IN                              NDIS_HANDLE* const                      wrapper_config_context,\r
        IN      OUT                     ipoib_adapter_t                         *p_adapter,\r
        OUT                             PUCHAR                                          *p_mac,\r
        OUT                             UINT                                            *p_len);\r
@@ -124,19 +123,19 @@ ipoib_get_adapter_params(
 /* Implementation */\r
 ib_api_status_t\r
 ipoib_create_adapter(\r
-       IN                              NDIS_HANDLE                                     wrapper_config_context,\r
        IN                              void* const                                     h_adapter,\r
                OUT                     ipoib_adapter_t** const         pp_adapter )\r
 {\r
        ipoib_adapter_t         *p_adapter;\r
-       ib_api_status_t         status;\r
+       NDIS_STATUS                     status;\r
+       ib_api_status_t         ib_status;\r
        cl_status_t                     cl_status;\r
        PUCHAR                          mac;\r
        UINT                            len;\r
 \r
        IPOIB_ENTER( IPOIB_DBG_INIT );\r
 \r
-       p_adapter = cl_zalloc( sizeof(ipoib_adapter_t) );\r
+       p_adapter = (ipoib_adapter_t *) cl_zalloc( sizeof(ipoib_adapter_t) );\r
        if( !p_adapter )\r
        {\r
                IPOIB_PRINT_EXIT( TRACE_LEVEL_ERROR, IPOIB_DBG_ERROR,\r
@@ -149,7 +148,7 @@ ipoib_create_adapter(
 \r
        p_adapter->h_adapter = h_adapter;\r
 \r
-       p_adapter->p_ifc = cl_zalloc( sizeof(ib_al_ifc_t) );\r
+       p_adapter->p_ifc = (ib_al_ifc_t *) cl_zalloc( sizeof(ib_al_ifc_t) );\r
        if( !p_adapter->p_ifc )\r
        {\r
                __adapter_free( &p_adapter->obj );\r
@@ -160,15 +159,14 @@ ipoib_create_adapter(
        }\r
 \r
        /* Get the CA and port GUID from the bus driver. */\r
-       status = ipoib_get_adapter_guids( h_adapter,  p_adapter );\r
+       status = ipoib_get_adapter_guids( (NDIS_HANDLE *const) h_adapter,  p_adapter );\r
        if( status != NDIS_STATUS_SUCCESS )\r
        {\r
-ASSERT(FALSE);\r
-//return NDIS_STATUS_SUCCESS;\r
+               ASSERT(FALSE);\r
                __adapter_free( &p_adapter->obj );\r
                IPOIB_PRINT_EXIT( TRACE_LEVEL_ERROR, IPOIB_DBG_ERROR,\r
                        ("ipoib_get_adapter_guids returned 0x%.8X.\n", status) );\r
-               return status;\r
+               return IB_ERROR;\r
        }\r
 \r
        IPOIB_PRINT( TRACE_LEVEL_INFORMATION, IPOIB_DBG_INIT,\r
@@ -187,24 +185,23 @@ ASSERT(FALSE);
        }\r
 \r
        /* Read configuration parameters. */\r
-       status = ipoib_get_adapter_params( wrapper_config_context,\r
-               p_adapter , &mac, &len);\r
+       status = ipoib_get_adapter_params( p_adapter , &mac, &len );\r
        if( status != NDIS_STATUS_SUCCESS )\r
        {\r
                cl_obj_destroy( &p_adapter->obj );\r
                IPOIB_PRINT_EXIT( TRACE_LEVEL_ERROR, IPOIB_DBG_ERROR,\r
                        ("ipoib_get_adapter_params returned 0x%.8x.\n", status) );\r
-               return status;\r
+               return IB_ERROR;\r
        }\r
                \r
-       status = adapter_init( p_adapter );\r
-       if( status != IB_SUCCESS )\r
+       ib_status = adapter_init( p_adapter );\r
+       if( ib_status != IB_SUCCESS )\r
        {\r
                cl_obj_destroy( &p_adapter->obj );\r
                IPOIB_PRINT_EXIT( TRACE_LEVEL_ERROR, IPOIB_DBG_ERROR,\r
                        ("adapter_init returned %s.\n", \r
-                       p_adapter->p_ifc->get_err_str( status )) );\r
-               return status;\r
+                       p_adapter->p_ifc->get_err_str( ib_status )) );\r
+               return ib_status;\r
        }\r
 \r
        ETH_COPY_NETWORK_ADDRESS( p_adapter->params.conf_mac.addr, p_adapter->mac.addr );\r
@@ -229,7 +226,7 @@ ASSERT(FALSE);
        *pp_adapter = p_adapter;\r
 \r
        IPOIB_EXIT( IPOIB_DBG_INIT );\r
-       return status;\r
+       return IB_SUCCESS;\r
 }\r
 \r
 \r
@@ -458,7 +455,7 @@ __adapter_destroying(
         */\r
        if( p_adapter->h_pnp )\r
        {\r
-               p_adapter->p_ifc->dereg_pnp( p_adapter->h_pnp, cl_obj_deref );\r
+               p_adapter->p_ifc->dereg_pnp( p_adapter->h_pnp, (ib_pfn_destroy_cb_t) cl_obj_deref );\r
                p_adapter->h_pnp = NULL;\r
        }\r
 \r
index 2254f39..0d3c106 100644 (file)
@@ -372,7 +372,6 @@ typedef struct _net_address_item
 \r
 ib_api_status_t\r
 ipoib_create_adapter(\r
-       IN              NDIS_HANDLE                     wrapper_config_context,\r
        IN              void* const                     h_adapter,\r
        OUT             ipoib_adapter_t**  const        pp_adapter );\r
 \r
similarity index 92%
rename from ulp/ipoib_NDIS6_CM/kernel/ipoib_driver.c
rename to ulp/ipoib_NDIS6_CM/kernel/ipoib_driver.cpp
index 0bc3ebd..236a81f 100644 (file)
@@ -405,7 +405,7 @@ ipoib_create_log(
 }\r
 \r
 \r
-\r
+extern "C"\r
 NTSTATUS\r
 DriverEntry(\r
        IN                              PDRIVER_OBJECT                          p_drv_obj,\r
@@ -561,6 +561,7 @@ IRQL = PASSIVE_LEVEL
 @return STATUS_SUCCESS, NDIS_STATUS_BAD_CHARACTERISTICS, NDIS_STATUS_BAD_VERSION,\r
 NDIS_STATUS_RESOURCES, or NDIS_STATUS_FAILURE\r
 */\r
+extern "C" \r
 NTSTATUS\r
 DriverEntry(\r
        IN                              PDRIVER_OBJECT                          p_drv_obj,\r
@@ -664,7 +665,7 @@ __ipoib_read_registry(
        RtlInitUnicodeString( &param_path, NULL );\r
        param_path.MaximumLength = p_registry_path->Length + \r
                sizeof(L"\\Parameters");\r
-       param_path.Buffer = cl_zalloc( param_path.MaximumLength );\r
+       param_path.Buffer = (PWCH) cl_zalloc( param_path.MaximumLength );\r
        if( !param_path.Buffer )\r
        {\r
                IPOIB_PRINT_EXIT( TRACE_LEVEL_ERROR, IPOIB_DBG_ERROR, \r
@@ -743,7 +744,6 @@ ipoib_unload(
 \r
 NDIS_STATUS\r
 ipoib_get_adapter_params(\r
-       IN                              NDIS_HANDLE* const                      wrapper_config_context,\r
        IN      OUT                     ipoib_adapter_t                         *p_adapter,\r
        OUT                             PUCHAR                                          *p_mac,\r
        OUT                             UINT                                            *p_len)\r
@@ -759,7 +759,6 @@ ipoib_get_adapter_params(
        \r
        int sq_depth_step = 128;\r
 \r
-       UNUSED_PARAM(wrapper_config_context);\r
        IPOIB_ENTER( IPOIB_DBG_INIT );\r
 \r
     config_obj.Header.Type = NDIS_OBJECT_TYPE_CONFIGURATION_OBJECT;\r
@@ -886,7 +885,7 @@ ipoib_get_adapter_params(
                p_adapter->params.xfer_block_size = \r
                        (sizeof(eth_hdr_t) + p_adapter->params.payload_mtu);\r
 \r
-       NdisReadNetworkAddress( &status, p_mac, p_len, h_config );\r
+       NdisReadNetworkAddress( &status, (PVOID *) p_mac, p_len, h_config );\r
 \r
        NdisCloseConfiguration( h_config );\r
 \r
@@ -1692,7 +1691,7 @@ Return Value:
 \r
     {\r
 \r
-               ib_status = ipoib_create_adapter(MiniportDriverContext, MiniportAdapterHandle, &p_adapter );\r
+               ib_status = ipoib_create_adapter( MiniportAdapterHandle, &p_adapter );\r
                if( ib_status != IB_SUCCESS )\r
                {\r
                        ASSERT(FALSE);\r
@@ -2081,11 +2080,7 @@ ipoib_initialize_ex(
                NDIS_STATUS             status;\r
                ib_api_status_t         ib_status;\r
                ipoib_adapter_t         *p_adapter;\r
-               //NDIS_MINIPORT_ADAPTER_REGISTRATION_ATTRIBUTES RegistrationAttributes;\r
-               //NDIS_MINIPORT_ADAPTER_GENERAL_ATTRIBUTES              GeneralAttributes;\r
-#if IPOIB_USE_DMA\r
-               //NDIS_SG_DMA_DESCRIPTION       DmaDescription;\r
-#endif\r
+\r
                IPOIB_ENTER( IPOIB_DBG_INIT );\r
        \r
 #ifdef _DEBUG_\r
@@ -2095,9 +2090,8 @@ ipoib_initialize_ex(
                UNUSED_PARAM( config_context );\r
                UNUSED_PARAM( MiniportInitParameters );\r
                \r
-               //foo1(100);\r
                /* Create the adapter adapter */\r
-               ib_status = ipoib_create_adapter(config_context, h_adapter, &p_adapter );\r
+               ib_status = ipoib_create_adapter( h_adapter, &p_adapter );\r
                if( ib_status != IB_SUCCESS )\r
                {\r
                        ASSERT(FALSE);\r
@@ -2110,143 +2104,11 @@ ipoib_initialize_ex(
                if (status != NDIS_STATUS_SUCCESS) {\r
                        ASSERT(FALSE);\r
                }\r
-#if 0\r
-               NdisZeroMemory(&RegistrationAttributes, sizeof(NDIS_MINIPORT_ADAPTER_REGISTRATION_ATTRIBUTES));\r
-               NdisZeroMemory(&GeneralAttributes, sizeof(NDIS_MINIPORT_ADAPTER_GENERAL_ATTRIBUTES));\r
-       \r
-               /* setting registration attributes */\r
-               RegistrationAttributes.Header.Type = NDIS_OBJECT_TYPE_MINIPORT_ADAPTER_REGISTRATION_ATTRIBUTES;\r
-               RegistrationAttributes.Header.Revision = NDIS_MINIPORT_ADAPTER_REGISTRATION_ATTRIBUTES_REVISION_1;\r
-               RegistrationAttributes.Header.Size = NDIS_SIZEOF_MINIPORT_ADAPTER_REGISTRATION_ATTRIBUTES_REVISION_1;\r
-       \r
-               RegistrationAttributes.MiniportAdapterContext = (NDIS_HANDLE)p_adapter;\r
-               RegistrationAttributes.AttributeFlags = NDIS_MINIPORT_ATTRIBUTES_BUS_MASTER;\r
-                                                                                                               \r
-               RegistrationAttributes.CheckForHangTimeInSeconds = 10;\r
-               RegistrationAttributes.InterfaceType = NdisInterfacePNPBus;\r
-       \r
-               status = NdisMSetMiniportAttributes(h_adapter,\r
-                                                                                  (PNDIS_MINIPORT_ADAPTER_ATTRIBUTES)&RegistrationAttributes);\r
-       \r
-               if (status != NDIS_STATUS_SUCCESS)\r
-               {\r
-                       ipoib_destroy_adapter( p_adapter );\r
-                       IPOIB_PRINT_EXIT( TRACE_LEVEL_ERROR, IPOIB_DBG_ERROR,\r
-                               ("NdisMSetMiniportAttributes returned 0x%.8x.\n", status) );\r
-                       return status;\r
-               }\r
-       \r
-               /* set up generic attributes */\r
-       \r
-                GeneralAttributes.Header.Type = NDIS_OBJECT_TYPE_MINIPORT_ADAPTER_GENERAL_ATTRIBUTES;\r
-                GeneralAttributes.Header.Revision = NDIS_MINIPORT_ADAPTER_GENERAL_ATTRIBUTES_REVISION_1;\r
-                GeneralAttributes.Header.Size = sizeof(NDIS_MINIPORT_ADAPTER_GENERAL_ATTRIBUTES);\r
-       \r
-                GeneralAttributes.MediaType = NdisMedium802_3;\r
-               //TODO\r
-                GeneralAttributes.MtuSize = MAX_IB_MTU;\r
-                GeneralAttributes.MaxXmitLinkSpeed = IPOIB_MEDIA_MAX_SPEED;\r
-                GeneralAttributes.MaxRcvLinkSpeed = IPOIB_MEDIA_MAX_SPEED;\r
-                GeneralAttributes.XmitLinkSpeed = NDIS_LINK_SPEED_UNKNOWN;\r
-                GeneralAttributes.RcvLinkSpeed = NDIS_LINK_SPEED_UNKNOWN;\r
-                GeneralAttributes.MediaConnectState = MediaConnectStateUnknown;\r
-                GeneralAttributes.MediaDuplexState = MediaDuplexStateUnknown;\r
-                GeneralAttributes.LookaheadSize = MAX_XFER_BLOCK_SIZE;\r
-       \r
-                GeneralAttributes.PowerManagementCapabilities = NULL;\r
-       \r
-                GeneralAttributes.MacOptions = NDIS_MAC_OPTION_COPY_LOOKAHEAD_DATA |\r
-                                                                               NDIS_MAC_OPTION_TRANSFERS_NOT_PEND |\r
-                                                                               NDIS_MAC_OPTION_NO_LOOPBACK |\r
-                                                                               NDIS_MAC_OPTION_FULL_DUPLEX;\r
-       \r
-                GeneralAttributes.SupportedPacketFilters = NDIS_PACKET_TYPE_DIRECTED |\r
-                                                                                                       NDIS_PACKET_TYPE_MULTICAST |\r
-                                                                                                       NDIS_PACKET_TYPE_ALL_MULTICAST |\r
-                                                                                                       NDIS_PACKET_TYPE_BROADCAST;\r
-                       \r
-                GeneralAttributes.MaxMulticastListSize = MAX_MCAST;\r
-                GeneralAttributes.MacAddressLength = HW_ADDR_LEN;\r
-       \r
-                NdisMoveMemory(GeneralAttributes.PermanentMacAddress,\r
-                                               p_adapter->mac.addr,\r
-                                               HW_ADDR_LEN);\r
-       \r
-                NdisMoveMemory(GeneralAttributes.CurrentMacAddress,\r
-                                               p_adapter->params.conf_mac.addr,\r
-                                               HW_ADDR_LEN);\r
-       \r
-                       \r
-                GeneralAttributes.PhysicalMediumType = NdisPhysicalMediumUnspecified;\r
-                GeneralAttributes.RecvScaleCapabilities = NULL;\r
-                GeneralAttributes.AccessType = NET_IF_ACCESS_BROADCAST; // NET_IF_ACCESS_BROADCAST for a typical ethernet adapter\r
-                GeneralAttributes.DirectionType = NET_IF_DIRECTION_SENDRECEIVE; // NET_IF_DIRECTION_SENDRECEIVE for a typical ethernet adapter\r
-                GeneralAttributes.ConnectionType = NET_IF_CONNECTION_DEDICATED;  // NET_IF_CONNECTION_DEDICATED for a typical ethernet adapter\r
-                GeneralAttributes.IfType = IF_TYPE_ETHERNET_CSMACD; // IF_TYPE_ETHERNET_CSMACD for a typical ethernet adapter (regardless of speed)\r
-                GeneralAttributes.IfConnectorPresent = TRUE; // RFC 2665 TRUE if physical adapter\r
-       \r
-                GeneralAttributes.SupportedStatistics = NDIS_STATISTICS_XMIT_OK_SUPPORTED |\r
-                                                                                                NDIS_STATISTICS_RCV_OK_SUPPORTED |\r
-                                                                                                NDIS_STATISTICS_XMIT_ERROR_SUPPORTED |\r
-                                                                                                NDIS_STATISTICS_RCV_ERROR_SUPPORTED |\r
-                                                                                                NDIS_STATISTICS_RCV_CRC_ERROR_SUPPORTED |\r
-                                                                                                NDIS_STATISTICS_RCV_NO_BUFFER_SUPPORTED |\r
-                                                                                                NDIS_STATISTICS_TRANSMIT_QUEUE_LENGTH_SUPPORTED |\r
-                                                                                                NDIS_STATISTICS_GEN_STATISTICS_SUPPORTED;\r
-                                                 \r
-                GeneralAttributes.SupportedOidList = (PNDIS_OID)SUPPORTED_OIDS;\r
-                GeneralAttributes.SupportedOidListLength = sizeof(SUPPORTED_OIDS);\r
-       \r
-                status = NdisMSetMiniportAttributes(h_adapter,\r
-                                                                                       (PNDIS_MINIPORT_ADAPTER_ATTRIBUTES)&GeneralAttributes);\r
-       \r
-                if (status != NDIS_STATUS_SUCCESS)\r
-                {\r
-                        IPOIB_PRINT_EXIT( TRACE_LEVEL_ERROR, IPOIB_DBG_ERROR,\r
-                                ("NdisMSetMiniportAttributes returned 0x%.8x.\n", status) );\r
-                }\r
-       \r
-#if IPOIB_USE_DMA\r
-       \r
-                NdisZeroMemory(&DmaDescription, sizeof(DmaDescription));\r
-       \r
-                DmaDescription.Header.Type = NDIS_OBJECT_TYPE_SG_DMA_DESCRIPTION;\r
-                DmaDescription.Header.Revision = NDIS_SG_DMA_DESCRIPTION_REVISION_1;\r
-                DmaDescription.Header.Size = sizeof(NDIS_SG_DMA_DESCRIPTION);//NDIS_SIZEOF_SG_DMA_DESCRIPTION_REVISION_1;\r
-       \r
-                DmaDescription.Flags = NDIS_SG_DMA_64_BIT_ADDRESS;\r
-                DmaDescription.MaximumPhysicalMapping = p_adapter->params.xfer_block_size;\r
-               \r
-                DmaDescription.ProcessSGListHandler = ipoib_process_sg_list;\r
-                DmaDescription.SharedMemAllocateCompleteHandler = NULL;\r
-       \r
-                status = NdisMRegisterScatterGatherDma(\r
-                                               p_adapter->h_adapter,\r
-                                               &DmaDescription,\r
-                                               &p_adapter->NdisMiniportDmaHandle);\r
-                                               \r
-                if( status != NDIS_STATUS_SUCCESS )\r
-                {\r
-                        ipoib_destroy_adapter( p_adapter );\r
-                        IPOIB_PRINT_EXIT( TRACE_LEVEL_ERROR, IPOIB_DBG_ERROR,\r
-                                                        ("NdisMRegisterScatterGatherDma returned 0x%.8x.\n", status) );\r
-                        return status;\r
-                }\r
-\r
-               \r
-               \r
-#endif\r
-#endif //if 0\r
-\r
-\r
 \r
 #if IPOIB_USE_DMA\r
-\r
                InitNdisScatterGatherDma(p_adapter, h_adapter);\r
-\r
-\r
-\r
 #endif\r
+\r
                /* Create the adapter adapter */\r
                ib_status = ipoib_start_adapter( p_adapter );\r
                if( ib_status != IB_SUCCESS )\r
@@ -4261,7 +4123,7 @@ __ipoib_set_net_addr(
                if( cl_vector_get_size( &p_adapter->ip_vector ) <= idx )\r
                        cl_vector_set_size( &p_adapter->ip_vector, idx + 1 );\r
 \r
-               p_addr_item = cl_vector_get_ptr( &p_adapter->ip_vector, idx );\r
+               p_addr_item = (net_address_item_t *) cl_vector_get_ptr( &p_adapter->ip_vector, idx );\r
                if( !cl_memcmp( &p_ip_addr->in_addr, &p_addr_item->address.as_ulong,\r
                        sizeof(ULONG) ) )\r
                {\r
@@ -4410,7 +4272,7 @@ ipoib_reg_addrs(
                if( p_addr_item->p_reg )\r
                        continue;\r
 \r
-               p_addr_item->p_reg = cl_zalloc( sizeof(ats_reg_t) );\r
+               p_addr_item->p_reg = (ats_reg_t *) cl_zalloc( sizeof(ats_reg_t) );\r
                if( !p_addr_item->p_reg )\r
                        break;\r
 \r
@@ -4568,7 +4430,7 @@ __ipoib_ats_reg_cb(
                                          p_reg_svc_rec->svc_rec.service_data8[ATS_IPV4_OFFSET+1],\r
                                          p_reg_svc_rec->svc_rec.service_data8[ATS_IPV4_OFFSET+2],\r
                                          p_reg_svc_rec->svc_rec.service_data8[ATS_IPV4_OFFSET+3],\r
-                                         p_reg->p_adapter->p_ifc->get_err_str( p_reg_svc_rec->resp_status )) );\r
+                                         p_reg->p_adapter->p_ifc->get_err_str((ib_api_status_t) p_reg_svc_rec->resp_status )) );\r
                p_reg->p_adapter->hung = TRUE;\r
                p_reg->h_reg_svc = NULL;\r
        }\r
similarity index 96%
rename from ulp/ipoib_NDIS6_CM/kernel/ipoib_endpoint.c
rename to ulp/ipoib_NDIS6_CM/kernel/ipoib_endpoint.cpp
index 1e82e5a..58a2b5c 100644 (file)
@@ -157,7 +157,7 @@ ipoib_endpt_create(
 \r
        IPOIB_ENTER( IPOIB_DBG_ENDPT );\r
 \r
-       p_endpt = cl_zalloc( sizeof(ipoib_endpt_t) );\r
+       p_endpt = (ipoib_endpt_t *) cl_zalloc( sizeof(ipoib_endpt_t) );\r
        if( !p_endpt )\r
        {\r
                IPOIB_PRINT_EXIT( TRACE_LEVEL_ERROR, IPOIB_DBG_ERROR,\r
similarity index 92%
rename from ulp/ipoib_NDIS6_CM/kernel/ipoib_ibat.c
rename to ulp/ipoib_NDIS6_CM/kernel/ipoib_ibat.cpp
index a770366..1e207bc 100644 (file)
@@ -97,8 +97,8 @@ __ibat_get_ports(
                return STATUS_INVALID_PARAMETER;\r
        }\r
 \r
-       pIn = pIrp->AssociatedIrp.SystemBuffer;\r
-       pOut = pIrp->AssociatedIrp.SystemBuffer;\r
+       pIn = (IOCTL_IBAT_PORTS_IN *) pIrp->AssociatedIrp.SystemBuffer;\r
+       pOut = (IOCTL_IBAT_PORTS_OUT *) pIrp->AssociatedIrp.SystemBuffer;\r
 \r
        if( pIn->Version != IBAT_IOCTL_VERSION )\r
        {\r
@@ -189,8 +189,8 @@ __ibat_get_ips(
                return STATUS_INVALID_PARAMETER;\r
        }\r
 \r
-       pIn = pIrp->AssociatedIrp.SystemBuffer;\r
-       pOut = pIrp->AssociatedIrp.SystemBuffer;\r
+       pIn = (IOCTL_IBAT_IP_ADDRESSES_IN *) pIrp->AssociatedIrp.SystemBuffer;\r
+       pOut = (IOCTL_IBAT_IP_ADDRESSES_OUT *) pIrp->AssociatedIrp.SystemBuffer;\r
 \r
        if( pIn->Version != IBAT_IOCTL_VERSION )\r
        {\r
@@ -286,8 +286,8 @@ __ibat_mac_to_gid(
                return STATUS_INVALID_PARAMETER;\r
        }\r
 \r
-       pIn = pIrp->AssociatedIrp.SystemBuffer;\r
-       pOut = pIrp->AssociatedIrp.SystemBuffer;\r
+       pIn = (IOCTL_IBAT_MAC_TO_GID_IN *) pIrp->AssociatedIrp.SystemBuffer;\r
+       pOut = (IOCTL_IBAT_MAC_TO_GID_OUT *) pIrp->AssociatedIrp.SystemBuffer;\r
 \r
        if( pIn->Version != IBAT_IOCTL_VERSION )\r
        {\r
@@ -359,8 +359,8 @@ __ibat_mac_to_path(
                return STATUS_INVALID_PARAMETER;\r
        }\r
 \r
-       pIn = pIrp->AssociatedIrp.SystemBuffer;\r
-       pOut = pIrp->AssociatedIrp.SystemBuffer;\r
+       pIn = (IOCTL_IBAT_MAC_TO_PATH_IN *) pIrp->AssociatedIrp.SystemBuffer;\r
+       pOut = (IOCTL_IBAT_MAC_TO_PATH_OUT *) pIrp->AssociatedIrp.SystemBuffer;\r
 \r
        if( pIn->Version != IBAT_IOCTL_VERSION )\r
        {\r
@@ -435,8 +435,8 @@ __ibat_ip_to_port(
                return STATUS_INVALID_PARAMETER;\r
        }\r
 \r
-       pIn = pIrp->AssociatedIrp.SystemBuffer;\r
-       pOut = pIrp->AssociatedIrp.SystemBuffer;\r
+       pIn = (IOCTL_IBAT_IP_TO_PORT_IN *) pIrp->AssociatedIrp.SystemBuffer;\r
+       pOut = (IOCTL_IBAT_IP_TO_PORT_OUT *) pIrp->AssociatedIrp.SystemBuffer;\r
 \r
        if( pIn->Version != IBAT_IOCTL_VERSION )\r
        {\r
similarity index 95%
rename from ulp/ipoib_NDIS6_CM/kernel/ipoib_port.c
rename to ulp/ipoib_NDIS6_CM/kernel/ipoib_port.cpp
index 89e1a0c..f6d7a25 100644 (file)
@@ -216,7 +216,7 @@ __recv_mgr_destroy(
        IN                              ipoib_port_t* const                     p_port );\r
 \r
 /* Posts receive buffers to the receive queue. */\r
-static ib_api_status_t\r
+int32_t\r
 __recv_mgr_repost(\r
        IN                              ipoib_port_t* const                     p_port );\r
 \r
@@ -393,6 +393,8 @@ __send_fragments(
        IN              uint32_t                                                        buf_len,\r
        IN              NDIS_BUFFER*                                            p_ndis_buf );\r
 \r
+//TODO CM Restore\r
+#if 0\r
 static void\r
 __update_fragment_ip_hdr(\r
 IN             ip_hdr_t* const         p_ip_hdr,\r
@@ -406,6 +408,7 @@ IN          uint8_t*                        p_buf,
 IN             uint8_t*                        p_options,\r
 IN             uint32_t                        options_len,\r
 IN             BOOLEAN                         copy_all );\r
+#endif\r
 /******************************************************************************\r
 *\r
 * Endpoint manager operations\r
@@ -597,7 +600,7 @@ ipoib_create_port(
 \r
        CL_ASSERT( !p_adapter->p_port );\r
 \r
-       p_port = cl_zalloc( sizeof(ipoib_port_t) +\r
+       p_port = (ipoib_port_t *) cl_zalloc( sizeof(ipoib_port_t) +\r
                (sizeof(ipoib_hdr_t) * (p_adapter->params.sq_depth - 1)) );\r
        if( !p_port )\r
        {\r
@@ -1230,7 +1233,7 @@ __port_query_ca_attrs(
        }\r
        CL_ASSERT( attr_size );\r
 \r
-       p_ca_attrs = cl_zalloc( attr_size );\r
+       p_ca_attrs = (ib_ca_attr_t *) cl_zalloc( attr_size );\r
        if ( p_ca_attrs == NULL )\r
        {\r
                IPOIB_PRINT( TRACE_LEVEL_ERROR, IPOIB_DBG_ERROR,\r
@@ -1689,7 +1692,7 @@ __recv_mgr_init(
        IPOIB_ENTER( IPOIB_DBG_INIT );\r
 \r
        /* Allocate the NDIS_PACKET pointer array for indicating receives. */\r
-       p_port->recv_mgr.recv_pkt_array = cl_malloc(\r
+       p_port->recv_mgr.recv_pkt_array = (NET_BUFFER_LIST **)cl_malloc(\r
                sizeof(NET_BUFFER_LIST*) * p_port->p_adapter->params.rq_depth );\r
        if( !p_port->recv_mgr.recv_pkt_array )\r
        {\r
@@ -1727,7 +1730,7 @@ __recv_mgr_destroy(
  * that the value is signed, and can go negative.  All tests must\r
  * be for > 0.\r
  */\r
-static int32_t\r
+int32_t\r
 __recv_mgr_repost(\r
        IN                              ipoib_port_t* const                     p_port )\r
 {\r
@@ -1939,7 +1942,7 @@ ipoib_return_net_buffer_list(
 static void __recv_cb_dpc(KDPC *p_gc_dpc,void *context,void * s_arg1 , void * s_arg2)\r
 {\r
 \r
-       ipoib_port_t *p_port = context;\r
+       ipoib_port_t *p_port = (ipoib_port_t *) context;\r
 \r
        UNREFERENCED_PARAMETER(p_gc_dpc);\r
        UNREFERENCED_PARAMETER(s_arg1);\r
@@ -3302,7 +3305,7 @@ __send_copy(
        UNREFERENCED_PARAMETER(p_desc);\r
 \r
        p_desc->p_buf = \r
-               NdisAllocateFromNPagedLookasideList( &p_port->buf_mgr.send_buf_list );\r
+               (send_buf_t *) NdisAllocateFromNPagedLookasideList( &p_port->buf_mgr.send_buf_list );\r
        if( !p_desc->p_buf )\r
        {\r
                IPOIB_PRINT_EXIT( TRACE_LEVEL_ERROR, IPOIB_DBG_ERROR,\r
@@ -3608,7 +3611,8 @@ ipoib_process_sg_list(
        cl_spinlock_acquire( &p_port->send_lock );\r
        if (p_desc == NULL) {\r
                IPOIB_PRINT( TRACE_LEVEL_ERROR, IPOIB_DBG_SEND, ("Allocating send_desc First Time\n") );\r
-               p_desc = ExAllocatePoolWithTag(NonPagedPool ,sizeof (ipoib_send_desc_t), 'XMXA');\r
+               p_desc = \r
+                       (ipoib_send_desc_t *)ExAllocatePoolWithTag(NonPagedPool ,sizeof (ipoib_send_desc_t), 'XMXA');\r
        }\r
        ASSERT(p_desc);\r
        p_desc->p_netbuf_list = p_net_buffer_list;\r
@@ -3799,7 +3803,7 @@ __send_gen(
        IN                              INT                                                     lso_data_index\r
         )\r
 {\r
-       ib_api_status_t                 status;\r
+       NDIS_STATUS                             status;\r
        uint32_t                                i, j = 1;\r
        uint32_t                                offset = sizeof(eth_hdr_t);\r
        PERF_DECLARE( SendCopy );\r
@@ -4073,7 +4077,7 @@ __send_mgr_filter_igmp_v2(
        else\r
        {\r
                /* assuming ip header and options are in the same packet */\r
-               p_igmp_v2_hdr = GetIpPayloadPtr(p_ip_hdr);\r
+               p_igmp_v2_hdr = (igmp_v2_hdr_t *) GetIpPayloadPtr(p_ip_hdr);\r
        }\r
        /* Get the IGMP header length. */\r
        if( buf_len < sizeof(igmp_v2_hdr_t) )\r
@@ -4152,7 +4156,7 @@ __send_mgr_filter_udp(
        IN                              SCATTER_GATHER_LIST                     *p_sgl,\r
        IN      OUT                     ipoib_send_desc_t* const        p_desc )\r
 {\r
-       ib_api_status_t         status;\r
+       NDIS_STATUS                     status;\r
        udp_hdr_t                       *p_udp_hdr;\r
        PERF_DECLARE( QueryUdp );\r
        PERF_DECLARE( SendUdp );\r
@@ -4670,8 +4674,8 @@ __build_send_desc(
 {\r
        NDIS_STATUS                     status;\r
        int32_t                         hdr_idx;\r
-       uint32_t                        mss;\r
-       //PVOID*                                pp_tmp;\r
+       uint32_t                        mss = 0;\r
+\r
        PNDIS_TCP_IP_CHECKSUM_NET_BUFFER_LIST_INFO                      p_checksum_list_info;\r
        PNDIS_TCP_LARGE_SEND_OFFLOAD_NET_BUFFER_LIST_INFO       p_lso_info;\r
        PERF_DECLARE( SendMgrFilter );\r
@@ -4679,11 +4683,20 @@ __build_send_desc(
        IPOIB_ENTER( IPOIB_DBG_SEND );\r
 \r
        /* Format the send descriptor. */\r
-       p_checksum_list_info = NET_BUFFER_LIST_INFO( p_desc->p_netbuf_list,TcpIpChecksumNetBufferListInfo);\r
-       //pp_tmp = &NET_BUFFER_LIST_INFO(p_desc->p_netbuf_list, TcpIpChecksumNetBufferListInfo);\r
-       //p_checksum_list_info =                (   ) ((PULONG)pp_tmp);\r
-       p_lso_info = NET_BUFFER_LIST_INFO( p_desc->p_netbuf_list, TcpLargeSendNetBufferListInfo );\r
-               \r
+       p_checksum_list_info =\r
+               (PNDIS_TCP_IP_CHECKSUM_NET_BUFFER_LIST_INFO) NET_BUFFER_LIST_INFO( p_desc->p_netbuf_list,TcpIpChecksumNetBufferListInfo);\r
+\r
+       // Calculate LSO\r
+       if( p_port->p_adapter->params.lso ) {\r
+               p_lso_info = \r
+                       (PNDIS_TCP_LARGE_SEND_OFFLOAD_NET_BUFFER_LIST_INFO) \r
+                       NET_BUFFER_LIST_INFO( p_desc->p_netbuf_list, TcpLargeSendNetBufferListInfo );\r
+               ASSERT(p_lso_info);\r
+               if (p_lso_info) {\r
+                       mss = (p_lso_info->LsoV1Transmit.MSS | p_lso_info->LsoV2Transmit.MSS);\r
+               }\r
+       }\r
+                       \r
        /* Format the send descriptor. */\r
        hdr_idx = cl_atomic_inc( &p_port->hdr_idx );\r
        hdr_idx &= (p_port->p_adapter->params.sq_depth - 1);\r
@@ -4696,12 +4709,9 @@ __build_send_desc(
        p_desc->send_wr[0].local_ds[0].lkey = p_port->ib_mgr.lkey;\r
        p_desc->send_wr[0].wr.send_opt = 0;\r
 \r
-       mss = (p_lso_info->LsoV1Transmit.MSS | p_lso_info->LsoV2Transmit.MSS);\r
-       //TODO: first check params.lso, and thereafter calculate LSO\r
-       if( p_port->p_adapter->params.lso && mss )\r
-\r
-\r
-       {\r
+       \r
+               \r
+       if (mss) { //We have LSO packet\r
                ASSERT( mss == (p_lso_info->LsoV1Transmit.MSS & p_lso_info->LsoV2Transmit.MSS));\r
                ASSERT ( (mss & (1<<20)) == mss);\r
                status = __build_lso_desc( p_port, p_desc, mss, p_sgl, hdr_idx, p_lso_info );\r
@@ -4712,6 +4722,7 @@ __build_send_desc(
                        return status;\r
                }\r
        }\r
+       \r
        else\r
        {\r
                uint32_t        i;\r
@@ -4742,7 +4753,7 @@ __build_send_desc(
                                        ( p_checksum_list_info->Transmit.IsIPv4  || \r
                                        p_checksum_list_info->Transmit.IsIPv6  ))\r
                                {\r
-                                       // Set transimition checksum offloading \r
+                                       // Set transimition checksum offloading\r
                                        if( p_checksum_list_info->Transmit.IpHeaderChecksum )\r
                                        {\r
                                                p_desc->send_wr[i].wr.send_opt |= IB_SEND_OPT_TX_IP_CSUM;\r
@@ -5146,18 +5157,18 @@ ipoib_port_send(
                } else {\r
 \r
 //#if 0\r
-                       CHAR *pTemp = ExAllocatePoolWithTag(NonPagedPool , p_port->p_adapter->sg_list_size, 'abcd');\r
+                       CHAR *pTemp = (CHAR *) ExAllocatePoolWithTag(NonPagedPool , p_port->p_adapter->sg_list_size, 'abcd');\r
                        CL_ASSERT(pTemp != NULL);\r
                        status = NDIS_STATUS_SUCCESS;\r
                        p_sgl = pTemp;\r
-                       CreateFragList(NdisQueryNetBufferPhysicalCount(p_netbuf), p_netbuf, NET_BUFFER_DATA_LENGTH(p_netbuf), p_sgl);\r
+                       CreateFragList(NdisQueryNetBufferPhysicalCount(p_netbuf), p_netbuf, NET_BUFFER_DATA_LENGTH(p_netbuf), (PMP_FRAG_LIST) p_sgl);\r
                        IPOIB_FROM_QUEUE(p_netbuf) = NULL;\r
                        /*IPOIB_PRINT( TRACE_LEVEL_ERROR, IPOIB_DBG_ERROR,\r
                                                ("[%d] Allocation from scratch: Netbuf = %x, found SGL = %x, PhysBufCnt=%ld, NB LEN = %ld, sg_list_size=%ld\n",\r
                                                buf_cnt, p_netbuf, p_sgl,NdisQueryNetBufferPhysicalCount(p_netbuf) ,\r
                                                NET_BUFFER_DATA_LENGTH(p_netbuf),p_port->p_adapter->sg_list_size) );\r
                                                */\r
-                       ipoib_process_sg_list(NULL, NULL, p_sgl, p_netbuf);\r
+                       ipoib_process_sg_list(NULL, NULL, (PSCATTER_GATHER_LIST)p_sgl, p_netbuf);\r
                        status = NDIS_STATUS_SUCCESS;\r
 //#endif\r
 #if 0          \r
@@ -5187,28 +5198,6 @@ ipoib_port_send(
                IPOIB_GET_NET_BUFFER_LIST_REF_COUNT(p_net_buffer_list) = (PVOID)(ULONG_PTR)buf_cnt;\r
        }\r
        \r
-               /* Post the WR. *\r
-               cl_perf_start( PostSend );\r
-               ib_status =     p_port->p_adapter->p_ifc->post_send( p_desc->send_qp, &p_desc->send_wr[0].wr, &p_wr_failed );\r
-               cl_perf_stop( &p_port->p_adapter->perf, PostSend );\r
-               if( ib_status != IB_SUCCESS )\r
-               {\r
-                       IPOIB_PRINT( TRACE_LEVEL_ERROR, IPOIB_DBG_ERROR,\r
-                               ("ib_post_send returned %s\n", \r
-                               p_port->p_adapter->p_ifc->get_err_str( ib_status )) );\r
-                       cl_perf_start( ProcessFailedSends );\r
-                       __process_failed_send( p_port, p_desc, NDIS_STATUS_FAILURE );\r
-                       cl_perf_stop( &p_port->p_adapter->perf, ProcessFailedSends );\r
-                       * Flag the adapter as hung since posting is busted. *\r
-                       p_port->p_adapter->hung = TRUE;\r
-                       continue;\r
-               }\r
-\r
-               cl_atomic_inc( &p_port->send_mgr.depth );\r
-       }\r
-       cl_spinlock_release( &p_port->send_lock );\r
-\r
-       IPOIB_EXIT( IPOIB_DBG_SEND );*/\r
 }\r
 \r
 \r
@@ -5302,7 +5291,7 @@ ipoib_port_resume(
        //                      ("[%d] Netbuf = %x, p_sgl = %x\n",buf_cnt, p_net_buffer, p_sgl) );\r
                        ASSERT(p_sgl);\r
                        if (p_sgl != (void*) 1) {\r
-                               ipoib_process_sg_list(NULL, NULL, p_sgl, p_net_buffer);\r
+                               ipoib_process_sg_list(NULL, NULL, (PSCATTER_GATHER_LIST) p_sgl, p_net_buffer);\r
                                status = NDIS_STATUS_SUCCESS;\r
                        }\r
                        else {\r
@@ -5311,7 +5300,7 @@ ipoib_port_resume(
                                ("Getting strange flow\n") );\r
                                NdisMFreeNetBufferSGList(\r
                                                                        p_port->p_adapter->NdisMiniportDmaHandle,\r
-                                                                       p_sgl,\r
+                                                                       (PSCATTER_GATHER_LIST)p_sgl,\r
                                                                        p_net_buffer );\r
                                status = NdisMAllocateNetBufferSGList(\r
                                                                        p_port->p_adapter->NdisMiniportDmaHandle,\r
@@ -5370,7 +5359,7 @@ __send_cb(
        PERF_DECLARE( FreeSendBuf );\r
        PERF_DECLARE( RearmSend );\r
        PERF_DECLARE( PortResume );\r
-//return;//???????????\r
\r
        IPOIB_ENTER( IPOIB_DBG_SEND );\r
 \r
        cl_perf_clr( SendCompBundle );\r
@@ -5526,9 +5515,12 @@ __endpt_mgr_construct(
        IPOIB_EXIT( IPOIB_DBG_INIT );\r
 }\r
 \r
+//TODO Restore CM\r
+#if 0\r
 static void\r
 __endpt_cm_mgr_thread(\r
 IN             void*           p_context );\r
+#endif\r
 \r
 static ib_api_status_t\r
 __endpt_mgr_init(\r
@@ -5558,6 +5550,8 @@ __endpt_mgr_init(
        return IB_SUCCESS;\r
 }\r
 \r
+//TODO CM Restore\r
+#if 0\r
 static void\r
 __endpt_cm_mgr_thread(\r
 IN             void*           p_context )\r
@@ -5646,6 +5640,7 @@ IN                void*           p_context )
        IPOIB_PRINT_EXIT( TRACE_LEVEL_INFORMATION, IPOIB_DBG_INIT, \r
                (" Port [%d] Endpt thread is done\n", p_port->port_num ) );\r
 }\r
+#endif\r
 \r
 static void\r
 __endpt_mgr_destroy(\r
@@ -6448,14 +6443,14 @@ ipoib_port_up(
 \r
        KeResetEvent( &p_port->sa_event );\r
 \r
-       mad_out = (ib_mad_t*)cl_zalloc(256);\r
+       mad_out = (ib_mad_t *) (ib_mad_t*)cl_zalloc(256);\r
        if(! mad_out)\r
        {\r
                IPOIB_PRINT_EXIT( TRACE_LEVEL_ERROR, IPOIB_DBG_ERROR,\r
                        ("failed to allocate mad mad_out\n")); \r
                goto up_done;\r
        }\r
-       mad_in = (ib_mad_t*)cl_zalloc(256);\r
+       mad_in = (ib_mad_t *) cl_zalloc(256);\r
        if(! mad_in)\r
        {\r
                IPOIB_PRINT_EXIT( TRACE_LEVEL_ERROR, IPOIB_DBG_ERROR,\r
@@ -7723,7 +7718,7 @@ static void __port_do_mcast_garbage(ipoib_port_t* const   p_port)
 \r
 static void __port_mcast_garbage_dpc(KDPC *p_gc_dpc,void *context,void *s_arg1, void *s_arg2)\r
 {\r
-       ipoib_port_t *p_port = context;\r
+       ipoib_port_t *p_port = (ipoib_port_t *) context;\r
 \r
        UNREFERENCED_PARAMETER(p_gc_dpc);\r
        UNREFERENCED_PARAMETER(s_arg1);\r
@@ -8030,7 +8025,7 @@ IN                NDIS_BUFFER*                            p_ndis_buf )
        IPOIB_EXIT( IPOIB_DBG_SEND );\r
        return NDIS_STATUS_SUCCESS;\r
 }\r
-#endif\r
+\r
 \r
 static void\r
 __update_fragment_ip_hdr(\r
@@ -8121,3 +8116,4 @@ IN                BOOLEAN         copy_all )
        }\r
        return;\r
 }\r
+#endif\r
index 602389b..30090dc 100644 (file)
@@ -86,8 +86,8 @@
        (((send_buf_t**)NET_BUFFER_MINIPORT_RESERVED(P))[2])\r
 \r
 \r
-#define IPOIB_GET_NET_BUFFER_LIST_REF_COUNT(_NetBufferList)    ((_NetBufferList->FirstNetBuffer)->MiniportReserved[3])\r
-#define IPOIB_DEC_NET_BUFFER_LIST_REF_COUNT(_NetBufferList)    (*(PULONG)&(_NetBufferList->FirstNetBuffer)->MiniportReserved[3])--\r
+#define IPOIB_GET_NET_BUFFER_LIST_REF_COUNT(_NetBufferList)    ((NET_BUFFER_LIST_FIRST_NB(_NetBufferList))->MiniportReserved[3])\r
+#define IPOIB_DEC_NET_BUFFER_LIST_REF_COUNT(_NetBufferList)    (*(PULONG)&(NET_BUFFER_LIST_FIRST_NB(_NetBufferList))->MiniportReserved[3])--\r
 \r
 \r
 typedef struct _ipoib_ib_mgr\r
@@ -523,7 +523,7 @@ typedef struct _ipoib_endpt_mgr
 *              Map of connected endpts, keyed by remote gid.\r
 *********/\r
 \r
-\r
+#pragma warning(disable:4324)   // structure padded due to align()\r
 typedef struct _ipoib_port\r
 {\r
        cl_obj_t                                obj;\r
@@ -573,6 +573,8 @@ typedef struct _ipoib_port
        ipoib_hdr_t                             hdr[1]; /* Must be last! */\r
 \r
 }      ipoib_port_t;\r
+#pragma warning(default:4324)\r
+\r
 /*\r
 * FIELDS\r
 *      obj\r