[ofw] [PATCH 4/4] nd2: convert ND MR flags to WV flags

Hefty, Sean sean.hefty at intel.com
Tue Jul 27 16:53:06 PDT 2010


Provide conversions for missing ND MR flags.

Signed-off-by: Sean Hefty <sean.hefty at intel.com>
---
 trunk/ulp/netdirect2/user/nd_mw.cpp |   18 ++++++++++++------
 trunk/ulp/netdirect2/user/nd_mw.h   |    2 --
 2 files changed, 12 insertions(+), 8 deletions(-)

diff --git a/trunk/ulp/netdirect2/user/nd_mw.cpp b/trunk/ulp/netdirect2/user/nd_mw.cpp
index 7e5a27c..c2a53b5 100644
--- a/trunk/ulp/netdirect2/user/nd_mw.cpp
+++ b/trunk/ulp/netdirect2/user/nd_mw.cpp
@@ -94,17 +94,23 @@ GetOverlappedResult(OVERLAPPED *pOverlapped, BOOL bWait)
 	return hr;
 }
 
-DWORD ConvertAccessFlags(DWORD Flags)
+static DWORD ConvertAccessFlags(DWORD Flags)
 {
 	DWORD opts = 0;
 
-	//other flags to convert???
-	if (!(Flags & ND_OP_FLAG_ALLOW_READ)) {
-		opts |= WV_ACCESS_REMOTE_READ;
+	if (Flags & ND_MR_FLAG_ALLOW_LOCAL_WRITE) {
+		opts |= WV_ACCESS_LOCAL_WRITE;
 	}
-	if (Flags & ND_OP_FLAG_ALLOW_WRITE) {
-		opts |= WV_ACCESS_REMOTE_WRITE;
+	if (Flags & ND_MR_FLAG_ALLOW_REMOTE_READ) {
+		opts |= WV_ACCESS_REMOTE_READ | WV_ACCESS_MW_BIND;
 	}
+	if (Flags & ND_MR_FLAG_ALLOW_REMOTE_WRITE) {
+		opts |= WV_ACCESS_REMOTE_WRITE | WV_ACCESS_MW_BIND;
+	}
+	if (!(Flags & ND_MR_FLAG_DO_NOT_SECURE_VM)) {
+		opts |= WV_ACCESS_CACHABLE;
+	}
+
 	return opts;
 }
 
diff --git a/trunk/ulp/netdirect2/user/nd_mw.h b/trunk/ulp/netdirect2/user/nd_mw.h
index de8431a..660c06c 100644
--- a/trunk/ulp/netdirect2/user/nd_mw.h
+++ b/trunk/ulp/netdirect2/user/nd_mw.h
@@ -128,6 +128,4 @@ protected:
 	CNDAdapter			*m_pAdapter;
 };
 
-DWORD ConvertAccessFlags(DWORD Flags);
-
 #endif // _ND_MW_H_




More information about the ofw mailing list