Availability:
     Level 1    , 'N'

  Quick Help:
     SMART Control, N[SubCmd],[SubCmdParm0],[SubCmdParm1]

  Description:
    Performs several diagnostic SMART functions.

  Input Parameters:

    0 - Serial Port Command.
    
        This parameter defines which command will be used on the SMART Serial Port.  The
        following are the allowable commands (red indicates that the command is unsupported).
    
          0x00: TOGGLE_SMART - toggles SMART on/off.
          0x01: INITIALIZE_SMART_DATA - initializes SMART statistics data (both in RAM and SMART
          sectors).  Also initializes Fast Flush and Media Cache on the disk and clears the SMART
          Serial Number Sector.
          0x02: UPDATE_SMART_ATTRIBUTES - updates SMART's attributes.
          0x03: SET_CLEAR_PREFAILURE_BIT - sets/clears specified pre-failure warranty bit.
          0x04: INITIALIZE_SMART - is the same as INITIALIZE_SMART_DATA.
          0x05: DUMP_SMART_ATTRIBUTES - retrieves SMART's attributes.
          0x06: DUMP_SMART_THRESHOLDS - retrieves SMART's thresholds.
          0x07: DUMP_SMART_GLIST - retrieves the G-List.
          0x08: DUMP_CE_LOG - retrieves the critical event log.
          0x09: DUMP_PENDING_LIST - retrieves the pending list.
          0x0B: START_SHORT_DST - start the short DST after next power up or ^T.
          0x0C: START_LONG_DST - start the long DST after next power up or ^T.
          0x10: DUMP_2_HR_LOG - retrieves the 2 hr log.
          0x18: DUMP_RLIST_COUNT - display number of events in the R list.
          0x23: CLEAR_PERSISTENT_INFO - clears persistent information.
          0xFF: NO_COMMAND
    
          Type:    Unsigned 8-bit value
    
          Range:   0x00 to 0x23
    
          Default: None
    
    1 - Unused.
    
        This parameter is not used by any currently supported SMART Control commands.
    
          Type:    Unsigned 16-bit value
    
          Range:   0 to 0xFFFF
    
          Default: None
    
    2 - Unused.
    
        This parameter is not used by any currently supported SMART Control commands.
    
          Type:    Boolean value
    
          Range:   0 to 0x1
    
          Default: None
    
  Output Data:

    If an error occurred, the following information will be displayed.
    
          "DiagError aaaaaaaa"
    
       where
    
          aaaaaaaa is the Diagnostic Error Code
    
    If no error occurs, the output will be as follows, depending on what
    data is requested by paramter 0:

    If Clear SMART Data (N1) is requested, the following information will be
    displayed.
    
          "Clear SMART is completed."
    
    If Display Attribute Values (N5) is requested, the following information will be
    displayed.
    
          "Att"
          "Num  Flgs normlzd worst raw"
          "aa   bbbb   cc     dd   eeeeeeeeeeeeee"
       
       where
    
          aa is the number of the attribute.
    
          bbbb is additional attribute dependent information. Bit 0 when set indicates that
               this attribute is a warranty attribute.
    
          cc is the attribute current value normalized from 0xFF to 0, sometimes 0x64 to 0.
             For most parameters, 0x64 is the best value and 0 is the worst.
    
          dd is the normalized worst (usually lowest) value seen for this attribute.
    
          eeeeeeeeeeeeee is the raw value of the attribute.
    
    If Display Threshold Values (N6) is requested, the following information will be
    displayed.
    
          "Att  Thresh"
          "aa     bb"
    
       where
    
          aa is the number of the attribute.
    
          bb is the attribute's threshold.
    
    If Display R-List Event Counts (N18) is requested, the following information will
    be displayed.
    
          "Sectors = aa"
          "Wedges  = bb"
    
       where
    
          aa is the number of sector ALT events in the R-List.
    
          bb is the number of wedge ALT events in the R-List.
    

    If Dump Critical Event Log (N8) is requested, the following information will be
    displayed.
    
          "                                              DERP"
          "  dec                                         error  DERP"
          " Hours -    LBA       R  Theta Z EC       Cmd type  retry temp count  type "
          "   aaa -    bbbbb     cc dddd  e     ffff  gg  hh     ii   jj    kk  lllllllllllllll"
    
       where
    
          aaa is the decimal number of power on hours at the time of the event.
    
          bbbbb is the LBA of the event.
    
          cc is the radius of the LBA expressed (in hex) as a percentage of the user
          area stroke from the OD.
    
          dddd is the sector number of the LBA normalized 0 to 0x10000.
    
          e is the head number.
    
          ffff is the error code of the event.
    
          gg is the last interface command received before the event.
    
          hh is the DERP error type.  Currently only 0xFF is supported.
    
          ii is the DERP retry.  Currently only 0xFF is supported.
    
          jj is the temperature of the drive at the time of the event in degrees Celsius.
    
          kk is the number of times the event occured in the hour.
 
    If SMART Drive Self Test (Nb or Nc) is requested, no data is displayed.

    If the SMART Clear Persistent Information Command (N23) is requested, no data is
    displayed.

  Revision History:

    0001.0000   Initial revision.
    0002.0000   Added display of raw data to the SMART data display.
    0011.0000   Combined the PSG Diagnostic Error Codes (PSGDEC) and the Diagnostic External
                Test Service Error Codes (DETSEC) into a single set of Diagnostic Error Codes
                (DiagError).
    0011.0001   Added support for SMART Clear Persistent Information (23)
    0012.0000   Added display of 'count' field, add ability to start long or short Drive
                Self Test.
    0013.0000   Change output of VendorInfo Rlist field.
    0014.0000   SMART initialization (N1) now also zeros the SMART Serial Number Sector.
    0015.0000   Added an additional byte of LBA Entry for LBA_WIDER_THAN_32_BITS.