[ipoib] Add Missing files.
authortzachid <tzachid@ad392aa1-c5ef-ae45-8dd8-e69d62a5ef86>
Sun, 25 Oct 2009 12:41:52 +0000 (12:41 +0000)
committertzachid <tzachid@ad392aa1-c5ef-ae45-8dd8-e69d62a5ef86>
Sun, 25 Oct 2009 12:41:52 +0000 (12:41 +0000)
git-svn-id: svn://openib.tc.cornell.edu/gen1/trunk@2504 ad392aa1-c5ef-ae45-8dd8-e69d62a5ef86

ulp/ipoib_NDIS6_CM/kernel/ipoib_adapter.cpp
ulp/ipoib_NDIS6_CM/kernel/ipoib_stat.cpp [new file with mode: 0644]
ulp/ipoib_NDIS6_CM/kernel/ipoib_stat.h [new file with mode: 0644]
ulp/ipoib_NDIS6_CM/kernel/precompile.h [new file with mode: 0644]

index eeedeab..7ab212a 100644 (file)
@@ -691,9 +691,10 @@ __ipoib_pnp_cb(
                        link_state.Header.Type = NDIS_OBJECT_TYPE_DEFAULT;\r
                        link_state.Header.Size = sizeof(NDIS_LINK_STATE);\r
                        link_state.MediaConnectState = MediaConnectStateDisconnected;\r
-                       //link_state.MediaConnectState = MediaConnectStateConnected;\r
                        link_state.MediaDuplexState = MediaDuplexStateFull;\r
-                       link_state.XmitLinkSpeed = link_state.RcvLinkSpeed = IPOIB_MEDIA_MAX_SPEED;\r
+                       link_state.XmitLinkSpeed = \r
+                       link_state.RcvLinkSpeed = IPOIB_MEDIA_MAX_SPEED;\r
+                       link_state.PauseFunctions = NdisPauseFunctionsSendAndReceive;\r
 \r
                        IPOIB_INIT_NDIS_STATUS_INDICATION(&status_indication,\r
                                    p_adapter->h_adapter,\r
@@ -726,9 +727,10 @@ __ipoib_pnp_cb(
                                link_state.Header.Type = NDIS_OBJECT_TYPE_DEFAULT;\r
                                link_state.Header.Size = sizeof(NDIS_LINK_STATE);\r
                                link_state.MediaConnectState = MediaConnectStateDisconnected;\r
-                               //link_state.MediaConnectState = MediaConnectStateConnected;\r
                                link_state.MediaDuplexState = MediaDuplexStateFull;\r
-                               link_state.XmitLinkSpeed = link_state.RcvLinkSpeed = IPOIB_MEDIA_MAX_SPEED;\r
+                               link_state.XmitLinkSpeed = \r
+                               link_state.RcvLinkSpeed = IPOIB_MEDIA_MAX_SPEED;\r
+                               link_state.PauseFunctions = NdisPauseFunctionsSendAndReceive;\r
 \r
                                IPOIB_INIT_NDIS_STATUS_INDICATION(&status_indication,\r
                                                                           p_adapter->h_adapter,\r
@@ -803,9 +805,10 @@ __ipoib_pnp_cb(
                        link_state.Header.Type = NDIS_OBJECT_TYPE_DEFAULT;\r
                        link_state.Header.Size = sizeof(NDIS_LINK_STATE);\r
                        link_state.MediaConnectState = MediaConnectStateDisconnected;\r
-                       //link_state.MediaConnectState = MediaConnectStateConnected;\r
                        link_state.MediaDuplexState = MediaDuplexStateFull;\r
-                       link_state.XmitLinkSpeed = link_state.RcvLinkSpeed = IPOIB_MEDIA_MAX_SPEED;\r
+                       link_state.XmitLinkSpeed = \r
+                       link_state.RcvLinkSpeed = IPOIB_MEDIA_MAX_SPEED;\r
+                       link_state.PauseFunctions = NdisPauseFunctionsSendAndReceive;\r
 \r
                        IPOIB_INIT_NDIS_STATUS_INDICATION(&status_indication,\r
                                                                   p_adapter->h_adapter,\r
@@ -1235,10 +1238,10 @@ ipoib_set_inactive(
                link_state.Header.Type = NDIS_OBJECT_TYPE_DEFAULT;\r
                link_state.Header.Size = sizeof(NDIS_LINK_STATE);\r
                link_state.MediaConnectState = MediaConnectStateDisconnected;\r
-               //link_state.MediaConnectState = MediaConnectStateConnected;\r
-               \r
                link_state.MediaDuplexState = MediaDuplexStateFull;\r
-               link_state.XmitLinkSpeed = link_state.RcvLinkSpeed = IPOIB_MEDIA_MAX_SPEED;\r
+               link_state.XmitLinkSpeed = \r
+               link_state.RcvLinkSpeed = IPOIB_MEDIA_MAX_SPEED;\r
+               link_state.PauseFunctions = NdisPauseFunctionsSendAndReceive;\r
 \r
                IPOIB_INIT_NDIS_STATUS_INDICATION(&status_indication,\r
                                                           p_adapter->h_adapter,\r
diff --git a/ulp/ipoib_NDIS6_CM/kernel/ipoib_stat.cpp b/ulp/ipoib_NDIS6_CM/kernel/ipoib_stat.cpp
new file mode 100644 (file)
index 0000000..d38934b
--- /dev/null
@@ -0,0 +1,36 @@
+#include "precompile.h"
+
+#if defined (EVENT_TRACING)
+#ifdef offsetof
+#undef offsetof
+#endif
+#include "ipoib_stat.tmh"
+#endif 
+
+IPOIB_ST_STAT g_stat;
+
+void ipoib_st_dev_rmv( PIPOIB_ST_DEVICE p_stat )
+{
+       if ( p_stat )
+               p_stat->valid = FALSE;
+}
+
+PIPOIB_ST_DEVICE ipoib_st_dev_add()
+{
+       int i;
+
+       for ( i = 0; i < IPOIB_ST_MAX_DEVICES; ++i ) {
+               if ( g_stat.dev[i].valid == FALSE ) {
+                       g_stat.dev[i].valid = TRUE;
+                       return &g_stat.dev[i];
+               }
+       }
+
+       return NULL;
+}
+
+void ipoib_st_init()
+{
+       memset( &g_stat, 0, sizeof(g_stat) );
+}
+
diff --git a/ulp/ipoib_NDIS6_CM/kernel/ipoib_stat.h b/ulp/ipoib_NDIS6_CM/kernel/ipoib_stat.h
new file mode 100644 (file)
index 0000000..1613a7d
--- /dev/null
@@ -0,0 +1,76 @@
+/*++\r
+\r
+Copyright (c) 2005-2009 Mellanox Technologies. All rights reserved.\r
+\r
+Module Name:\r
+       ipoib_stat.h\r
+\r
+Abstract:\r
+       Statistics Collector header file\r
+\r
+Revision History:\r
+\r
+Notes:\r
+\r
+--*/\r
+\r
+#pragma once\r
+\r
+#include <ntddk.h>\r
+\r
+//\r
+// restrictions\r
+//\r
+\r
+#define IPOIB_ST_MAX_DEVICES                   8\r
+\r
+//\r
+// enums\r
+// \r
+\r
+//\r
+// structures\r
+//\r
+\r
+// device\r
+typedef struct _ipoib_adapter ipoib_adapter_t;\r
+\r
+typedef struct _IPOIB_ST_DEVICE\r
+{\r
+       boolean_t                       valid;\r
+       ipoib_adapter_t         *p_adapter;\r
+       int                                     n_power_irps;   // NdisDevicePnPEventPowerProfileChanged \r
+       int                                     n_pnp_irps;             // NdisDevicePnPEventSurpriseRemoved \r
+       \r
+} IPOIB_ST_DEVICE, *PIPOIB_ST_DEVICE;\r
+\r
+// driver\r
+typedef struct _IPOIB_ST_DRIVER\r
+{\r
+       PDRIVER_OBJECT          obj;\r
+       \r
+} IPOIB_ST_DRIVER, *PIPOIB_ST_DRIVER;\r
+\r
+// driver stack\r
+\r
+typedef struct _IPOIB_ST_STAT\r
+{\r
+       IPOIB_ST_DRIVER         drv;\r
+       IPOIB_ST_DEVICE         dev[IPOIB_ST_MAX_DEVICES];\r
+       \r
+} IPOIB_ST_STAT, *PIPOIB_ST_STAT;\r
+\r
+extern IPOIB_ST_STAT g_stat;\r
+\r
+//\r
+// functions \r
+//\r
+\r
+void ipoib_st_dev_rmv( PIPOIB_ST_DEVICE p_stat );\r
+\r
+PIPOIB_ST_DEVICE ipoib_st_dev_add();\r
+\r
+void ipoib_st_init();\r
+\r
+\r
+\r
diff --git a/ulp/ipoib_NDIS6_CM/kernel/precompile.h b/ulp/ipoib_NDIS6_CM/kernel/precompile.h
new file mode 100644 (file)
index 0000000..b331ad0
--- /dev/null
@@ -0,0 +1,26 @@
+\r
+#ifndef __precomp_h\r
+#define __precomp_h\r
+\r
+#include "ipoib_xfr_mgr.h"\r
+#include "limits.h"\r
+\r
+\r
+#include "ipoib_log.h"\r
+#include "ipoib_adapter.h"\r
+#include <complib/cl_spinlock.h>\r
+#include <complib/cl_qlist.h>\r
+#include "ipoib_debug.h"\r
+\r
+\r
+#include "ipoib_driver.h"\r
+#include "ipoib_debug.h"\r
+\r
+#include "ipoib_endpoint.h"\r
+#include "ipoib_port.h"\r
+\r
+\r
+#include "ipoib_adapter.h"\r
+\r
+\r
+#endif __precomp_h
\ No newline at end of file