Index: ShellPkg/Library/UefiShellDriver1CommandsLib/Devices.c
===================================================================
--- ShellPkg/Library/UefiShellDriver1CommandsLib/Devices.c	(revision 15883)
+++ ShellPkg/Library/UefiShellDriver1CommandsLib/Devices.c	(working copy)
@@ -1,6 +1,7 @@
 /** @file
   Main file for devices shell Driver1 function.
 
+  (C) Copyright 2012-2014, Hewlett-Packard Development Company, L.P.
   Copyright (c) 2010 - 2014, Intel Corporation. All rights reserved.<BR>
   This program and the accompanying materials
   are licensed and made available under the terms and conditions of the BSD License
@@ -114,6 +115,7 @@
 }
 
 STATIC CONST SHELL_PARAM_ITEM ParamList[] = {
+  {L"-sfo", TypeFlag},
   {L"-l", TypeValue},
   {NULL, TypeMax}
   };
@@ -146,9 +148,11 @@
   UINTN               Children;
   CHAR16              *Name;
   CONST CHAR16        *Lang;
+  BOOLEAN             SfoFlag;
 
   ShellStatus         = SHELL_SUCCESS;
   Language            = NULL;
+  SfoFlag             = FALSE;
 
   //
   // initialize the shell lib (we must be in non-auto-init...)
@@ -203,10 +207,13 @@
 
       //
       // Print Header
-      // only in non SFO mode.
+
       //
-      if (!ShellCommandLineGetFlag(Package, L"-sfo")){
-        ShellPrintHiiEx(-1, -1, Language, STRING_TOKEN (STR_DEVICES_HEADER_LINES), gShellDriver1HiiHandle);
+      if (ShellCommandLineGetFlag (Package, L"-sfo")) {
+        ShellPrintHiiEx (-1, -1, Language, STRING_TOKEN (STR_GEN_SFO_HEADER), gShellDriver1HiiHandle, L"devices");
+        SfoFlag = TRUE;
+      } else {
+        ShellPrintHiiEx (-1, -1, Language, STRING_TOKEN (STR_DEVICES_HEADER_LINES), gShellDriver1HiiHandle);
       }
 
       //
@@ -225,37 +232,20 @@
         Name = NULL;
         Status = GetDeviceHandleInfo(*HandleListWalker, &Type, &Cfg, &Diag, &Parents, &Devices, &Children, &Name, Language);
         if (Name != NULL && (Parents != 0 || Devices != 0 || Children != 0)) {
-          if (!ShellCommandLineGetFlag(Package, L"-sfo")){
-            ShellPrintHiiEx(
-              -1,
-              -1,
-              Language,
-              STRING_TOKEN(STR_DEVICES_ITEM_LINE),
-              gShellDriver1HiiHandle,
-              ConvertHandleToHandleIndex(*HandleListWalker),
-              Type,
-              Cfg?L'X':L'-',
-              Diag?L'X':L'-',
-              Parents,
-              Devices,
-              Children,
-              Name != NULL ? Name : L"<UNKNOWN>");
-          } else {
-            ShellPrintHiiEx(
-              -1,
-              -1,
-              Language,
-              STRING_TOKEN(STR_DEVICES_ITEM_LINE_SFO),
-              gShellDriver1HiiHandle,
-              ConvertHandleToHandleIndex(*HandleListWalker),
-              Type,
-              Cfg?L'Y':L'N',
-              Diag?L'Y':L'N',
-              Parents,
-              Devices,
-              Children,
-              Name != NULL ? Name : L"<UNKNOWN>");
-          }
+          ShellPrintHiiEx (
+            -1,
+            -1,
+            Language,
+            SfoFlag?STRING_TOKEN (STR_DEVICES_ITEM_LINE_SFO):STRING_TOKEN (STR_DEVICES_ITEM_LINE),
+            gShellDriver1HiiHandle,
+            ConvertHandleToHandleIndex (*HandleListWalker),
+            Type,
+            Cfg?(SfoFlag?L'Y':L'X'):(SfoFlag?L'N':L'-'),
+            Diag?(SfoFlag?L'Y':L'X'):(SfoFlag?L'N':L'-'),
+            Parents,
+            Devices,
+            Children,
+            Name!=NULL?Name:L"<UNKNOWN>");
         }
         if (Name != NULL) {
           FreePool(Name);
Index: ShellPkg/Library/UefiShellDriver1CommandsLib/UefiShellDriver1CommandsLib.uni
===================================================================
--- ShellPkg/Library/UefiShellDriver1CommandsLib/UefiShellDriver1CommandsLib.uni	(revision 15883)
+++ ShellPkg/Library/UefiShellDriver1CommandsLib/UefiShellDriver1CommandsLib.uni	(working copy)
@@ -156,12 +156,22 @@
  
    
- # s t r i n g   S T R _ D E V I C E S _ H E A D E R _ L I N E S     # l a n g u a g e   e n - U S   " % N     C     T       D \ r \ n     T     Y   C   I \ r \ n     R     P   F   A \ r \ n     L     E   G   G   # P   # D   # C   D e v i c e   N a m e % N \ r \ n     = =   =   =   =   = =   = =   = =   = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = \ r \ n " + # s t r i n g   S T R _ D E V I C E S _ H E A D E R _ L I N E S     # l a n g u a g e   e n - U S   " % N "   
- # s t r i n g   S T R _ D E V I C E S _ I T E M _ L I N E           # l a n g u a g e   e n - U S   "   % H % 0 2 x % N   % 1 c   % 1 c   % 1 c   %   2 d   %   2 d   %   2 d   % s \ r \ n " + "           T       D \ r \ n "   
- # s t r i n g   S T R _ D E V I C E S _ I T E M _ L I N E _ S F O   # l a n g u a g e   e n - U S   " D e v i c e s I n f o ,   % H % 0 2 x % N ,   % 1 c ,   % 1 c ,   % 1 c ,   % 2 d ,   % 2 d ,   % 2 d ,   % s \ r \ n " + "           Y   C   I \ r \ n "   
+ "           P   F   A \ r \ n " + 
+ " C T R L   E   G   G   # P   # D   # C     D e v i c e   N a m e \ r \ n " + 
+ " = = = =   =   =   =   = =   = =   = = =   = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = \ r \ n " + 
+ # s t r i n g   S T R _ D E V I C E S _ I T E M _ L I N E           # l a n g u a g e   e n - U S   " % H % 4 x % N   % 1 c   % 1 c   % 1 c   % 2 d   % 2 d   % 3 d   % s \ r \ n " + 
+ # s t r i n g   S T R _ D E V I C E S _ I T E M _ L I N E _ S F O   # l a n g u a g e   e n - U S   " D e v i c e s I n f o , " % x " , " % c " , " % c " , " % c " , " % d " , " % d " , " % d " , " % s " \ r \ n " + 
    
  # s t r i n g   S T R _ D R I V E R S _ H E A D E R _ L I N E S     # l a n g u a g e   e n - U S   " % N " @@ -828,10 +838,12 @@
  
  "               C F G                     -   A   m a n a g i n g   d r i v e r   s u p p o r t s   t h e   D r i v e r   C o n f i g u r a t i o n \ r \ n "   
- "                                             P r o t o c o l \ r \ n " + "                                             P r o t o c o l .     Y e s   i f   ' Y '   o r   ' X ' ;   N o   i f   ' N '   o r   ' - ' . \ r \ n "   
- "               D I A G                   -   A   m a n a g i n g   d r i v e r   s u p p o r t s   t h e   D r i v e r   D i a g n o s t i c s   P r o t o c o l \ r \ n " + "               D I A G                   -   A   m a n a g i n g   d r i v e r   s u p p o r t s   t h e   D r i v e r   D i a g n o s t i c s \ r \ n "   
+ "                                             P r o t o c o l .     Y e s   i f   ' Y '   o r   ' X ' ;   N o   i f   ' N '   o r   ' - ' . \ r \ n " + 
  "               # P                       -   T h e   n u m b e r   o f   p a r e n t   c o n t r o l l e r s   f o r   t h i s   d e v i c e \ r \ n "   
  "               # D                       -   T h e   n u m b e r   o f   d r i v e r s   m a n a g i n g   t h e   d e v i c e \ r \ n " 