[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[win-pv-devel] [PATCH 2/9] Simplify StorPort entry points



Remove a lot of debug logging from storport entry points and remove
HwAdapterControl from the Fdo code. HwAdapterControl accepts all operations
and ignores all but QuerySupportedControlTypes

Signed-off-by: Owen Smith <owen.smith@xxxxxxxxxx>
---
 src/xenvbd/driver.c | 97 ++++++++++++++++++++++-------------------------------
 src/xenvbd/fdo.c    | 39 ---------------------
 src/xenvbd/fdo.h    |  7 ----
 3 files changed, 40 insertions(+), 103 deletions(-)

diff --git a/src/xenvbd/driver.c b/src/xenvbd/driver.c
index eb17475..cff6034 100644
--- a/src/xenvbd/driver.c
+++ b/src/xenvbd/driver.c
@@ -431,35 +431,6 @@ DriverFormatFree(
         __FreePoolWithTag(Buffer, XENVBD_POOL_TAG);
 }
 
-//=============================================================================
-// StorPort redirections
-static FORCEINLINE PCHAR
-__ScsiAdapterControlTypeName(
-    __in SCSI_ADAPTER_CONTROL_TYPE   ControlType
-    )
-{
-    switch (ControlType) {
-    case ScsiQuerySupportedControlTypes:    return 
"QuerySupportedControlTypes";
-    case ScsiStopAdapter:                   return "StopAdapter";
-    case ScsiRestartAdapter:                return "RestartAdapter";
-    case ScsiSetBootConfig:                 return "SetBootConfig";
-    case ScsiSetRunningConfig:              return "SetRunningConfig";
-    default:                                return "UNKNOWN";
-    }
-}
-
-static FORCEINLINE PCHAR
-__ScsiAdapterControlStatus(
-    __in SCSI_ADAPTER_CONTROL_STATUS Status
-    )
-{
-    switch (Status) {
-    case ScsiAdapterControlSuccess:         return "Success";
-    case ScsiAdapterControlUnsuccessful:    return "Unsuccessful";
-    default:                                return "UNKNOWN";
-    }
-}
-
 HW_INITIALIZE       HwInitialize;
 
 BOOLEAN 
@@ -467,7 +438,7 @@ HwInitialize(
     __in PVOID   HwDeviceExtension
     )
 {
-    Trace("(0x%p) @%d <---> TRUE\n", HwDeviceExtension, KeGetCurrentIrql());
+    UNREFERENCED_PARAMETER(HwDeviceExtension);
     return TRUE;
 }
 
@@ -482,21 +453,6 @@ HwInterrupt(
     return TRUE;
 }
 
-HW_RESET_BUS        HwResetBus;
-
-BOOLEAN 
-HwResetBus(
-    __in PVOID   HwDeviceExtension,
-    __in ULONG   PathId
-    )
-{
-    BOOLEAN RetVal;
-    Trace("(0x%p, %d) @%d --->\n", HwDeviceExtension, PathId, 
KeGetCurrentIrql());
-    RetVal = FdoResetBus((PXENVBD_FDO)HwDeviceExtension);
-    Trace("(0x%p, %d) @%d <--- %s\n", HwDeviceExtension, PathId, 
KeGetCurrentIrql(), RetVal ? "TRUE" : "FALSE");
-    return RetVal;
-}
-
 HW_ADAPTER_CONTROL  HwAdapterControl;
 
 SCSI_ADAPTER_CONTROL_STATUS
@@ -506,11 +462,39 @@ HwAdapterControl(
     __in PVOID                       Parameters
     )
 {
-    SCSI_ADAPTER_CONTROL_STATUS RetVal;
-    Trace("(0x%p, %s, 0x%p) @%d --->\n", HwDeviceExtension, 
__ScsiAdapterControlTypeName(ControlType), Parameters, KeGetCurrentIrql());
-    RetVal = FdoAdapterControl((PXENVBD_FDO)HwDeviceExtension, ControlType, 
Parameters);
-    Trace("(0x%p, %s, 0x%p) @%d <--- %s\n", HwDeviceExtension, 
__ScsiAdapterControlTypeName(ControlType), Parameters, KeGetCurrentIrql(), 
__ScsiAdapterControlStatus(RetVal));
-    return RetVal;
+    PSCSI_SUPPORTED_CONTROL_TYPE_LIST   List;
+    ULONG                               Index;
+
+    UNREFERENCED_PARAMETER(HwDeviceExtension);
+
+    switch (ControlType) {
+    case ScsiQuerySupportedControlTypes:
+        List = Parameters;
+        for (Index = 0; Index < List->MaxControlType; ++Index)
+            List->SupportedTypeList[Index] = TRUE;
+        break;
+
+    case ScsiStopAdapter:
+    case ScsiRestartAdapter:
+    case ScsiSetBootConfig:
+    case ScsiSetRunningConfig:
+    default:
+        break;
+    }
+    return ScsiAdapterControlSuccess;
+}
+
+HW_RESET_BUS        HwResetBus;
+
+BOOLEAN 
+HwResetBus(
+    __in PVOID   HwDeviceExtension,
+    __in ULONG   PathId
+    )
+{
+    UNREFERENCED_PARAMETER(PathId);
+
+    return FdoResetBus((PXENVBD_FDO)HwDeviceExtension);
 }
 
 HW_FIND_ADAPTER     HwFindAdapter;
@@ -525,13 +509,12 @@ HwFindAdapter(
     OUT PBOOLEAN                           Again
     )
 {
-    ULONG RetVal;
-    Trace("(0x%p, 0x%p, 0x%p, %s, 0x%p, 0x%p) @%d --->\n", HwDeviceExtension, 
-                Context, BusInformation, ArgumentString, ConfigInfo, Again, 
KeGetCurrentIrql());
-    RetVal = FdoFindAdapter((PXENVBD_FDO)HwDeviceExtension, ConfigInfo);
-    Trace("(0x%p, 0x%p, 0x%p, %s, 0x%p, 0x%p) @%d <--- %d\n", 
HwDeviceExtension, 
-                Context, BusInformation, ArgumentString, ConfigInfo, Again, 
KeGetCurrentIrql(), RetVal);
-    return RetVal;
+    UNREFERENCED_PARAMETER(Context);
+    UNREFERENCED_PARAMETER(BusInformation);
+    UNREFERENCED_PARAMETER(ArgumentString);
+    UNREFERENCED_PARAMETER(Again);
+
+    return FdoFindAdapter((PXENVBD_FDO)HwDeviceExtension, ConfigInfo);
 }
 
 static FORCEINLINE BOOLEAN
diff --git a/src/xenvbd/fdo.c b/src/xenvbd/fdo.c
index 406e49c..247ef51 100644
--- a/src/xenvbd/fdo.c
+++ b/src/xenvbd/fdo.c
@@ -1759,45 +1759,6 @@ FdoResetBus(
     return TRUE;
 }
 
-SCSI_ADAPTER_CONTROL_STATUS
-FdoAdapterControl(
-    __in PXENVBD_FDO                 Fdo,
-    __in SCSI_ADAPTER_CONTROL_TYPE   ControlType,
-    __in PVOID                       Parameters
-    )
-{
-    UNREFERENCED_PARAMETER(Fdo);
-
-    switch (ControlType) {
-    case ScsiQuerySupportedControlTypes:
-        {
-            PSCSI_SUPPORTED_CONTROL_TYPE_LIST List = Parameters;
-
-#define SET_SUPPORTED(_l, _i, _v)           \
-    if (_l->MaxControlType > _i)    _l->SupportedTypeList[_i] = _v;
-
-            SET_SUPPORTED(List, 0, TRUE);   // ScsiQuerySupportedControlTypes
-            SET_SUPPORTED(List, 1, FALSE);  // ScsiStopAdapter
-            SET_SUPPORTED(List, 2, FALSE);  // ScsiRestartAdapter
-            SET_SUPPORTED(List, 3, FALSE);  // ScsiSetBootConfig
-            SET_SUPPORTED(List, 4, FALSE);  // ScsiSetRunningConfig
-
-#undef SET_SUPPORTED
-
-        } break;
-    case ScsiStopAdapter:
-    case ScsiRestartAdapter:
-    case ScsiSetBootConfig:
-    case ScsiSetRunningConfig:
-        {
-            Trace("<----> %s (%d)\n", ScsiAdapterControlTypeName(ControlType), 
KeGetCurrentIrql());
-        } break;
-    default:
-        break;
-    }
-    return ScsiAdapterControlSuccess;
-}
-
 static VOID
 FdoUnplugRequest(
     IN  PXENVBD_FDO Fdo,
diff --git a/src/xenvbd/fdo.h b/src/xenvbd/fdo.h
index c1974ec..a9e36c2 100644
--- a/src/xenvbd/fdo.h
+++ b/src/xenvbd/fdo.h
@@ -109,13 +109,6 @@ FdoResetBus(
     __in PXENVBD_FDO                 Fdo
     );
 
-extern SCSI_ADAPTER_CONTROL_STATUS
-FdoAdapterControl(
-    __in PXENVBD_FDO                 Fdo,
-    __in SCSI_ADAPTER_CONTROL_TYPE   ControlType,
-    __in PVOID                       Parameters
-    );
-
 extern ULONG
 FdoFindAdapter(
     __in PXENVBD_FDO                 Fdo,
-- 
1.9.4.msysgit.1


_______________________________________________
win-pv-devel mailing list
win-pv-devel@xxxxxxxxxxxxxxxxxxxx
http://lists.xenproject.org/cgi-bin/mailman/listinfo/win-pv-devel

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.