Hardware/LPC/LPCIO.cs
author moel.mich
Sat, 23 Jun 2012 22:14:28 +0000
changeset 353 b4e37f5b2669
parent 352 0899f651d5cf
child 355 17dbf781401e
permissions -rw-r--r--
Added support for IT8705F super I/O chips.
moel@110
     1
/*
moel@110
     2
 
moel@344
     3
  This Source Code Form is subject to the terms of the Mozilla Public
moel@344
     4
  License, v. 2.0. If a copy of the MPL was not distributed with this
moel@344
     5
  file, You can obtain one at http://mozilla.org/MPL/2.0/.
moel@110
     6
 
moel@344
     7
  Copyright (C) 2009-2012 Michael Möller <mmoeller@openhardwaremonitor.org>
moel@344
     8
	
moel@110
     9
*/
moel@110
    10
moel@110
    11
using System;
moel@110
    12
using System.Collections.Generic;
moel@166
    13
using System.Globalization;
moel@110
    14
using System.Text;
moel@110
    15
using System.Threading;
moel@110
    16
moel@110
    17
namespace OpenHardwareMonitor.Hardware.LPC {
moel@165
    18
  internal class LPCIO {
moel@110
    19
moel@195
    20
    private readonly List<ISuperIO> superIOs = new List<ISuperIO>();
moel@195
    21
    private readonly StringBuilder report = new StringBuilder();
moel@110
    22
moel@110
    23
    // I/O Ports
moel@195
    24
    private readonly ushort[] REGISTER_PORTS = new ushort[] { 0x2E, 0x4E };
moel@195
    25
    private readonly ushort[] VALUE_PORTS = new ushort[] { 0x2F, 0x4F };
moel@110
    26
moel@110
    27
    private ushort registerPort;
moel@110
    28
    private ushort valuePort;
moel@110
    29
moel@110
    30
    // Registers
moel@110
    31
    private const byte CONFIGURATION_CONTROL_REGISTER = 0x02;
moel@110
    32
    private const byte DEVCIE_SELECT_REGISTER = 0x07;
moel@110
    33
    private const byte CHIP_ID_REGISTER = 0x20;
moel@110
    34
    private const byte CHIP_REVISION_REGISTER = 0x21;
moel@110
    35
    private const byte BASE_ADDRESS_REGISTER = 0x60;
moel@110
    36
moel@110
    37
    private byte ReadByte(byte register) {
moel@236
    38
      Ring0.WriteIoPort(registerPort, register);
moel@236
    39
      return Ring0.ReadIoPort(valuePort);
moel@228
    40
    }
moel@110
    41
moel@110
    42
    private ushort ReadWord(byte register) {
moel@228
    43
      return (ushort)((ReadByte(register) << 8) |
moel@110
    44
        ReadByte((byte)(register + 1)));
moel@110
    45
    }
moel@110
    46
moel@110
    47
    private void Select(byte logicalDeviceNumber) {
moel@236
    48
      Ring0.WriteIoPort(registerPort, DEVCIE_SELECT_REGISTER);
moel@236
    49
      Ring0.WriteIoPort(valuePort, logicalDeviceNumber);
moel@110
    50
    }
moel@110
    51
moel@169
    52
    private void ReportUnknownChip(string type, int chip) {
moel@169
    53
      report.Append("Chip ID: Unknown ");
moel@169
    54
      report.Append(type);
moel@169
    55
      report.Append(" with ID 0x");
moel@169
    56
      report.Append(chip.ToString("X", CultureInfo.InvariantCulture));
moel@169
    57
      report.Append(" at 0x");
moel@169
    58
      report.Append(registerPort.ToString("X", CultureInfo.InvariantCulture));
moel@169
    59
      report.Append("/0x");
moel@169
    60
      report.AppendLine(valuePort.ToString("X", CultureInfo.InvariantCulture));
moel@169
    61
      report.AppendLine();
moel@110
    62
    }
moel@110
    63
moel@245
    64
    #region Winbond, Nuvoton, Fintek
moel@110
    65
moel@110
    66
    private const byte FINTEK_VENDOR_ID_REGISTER = 0x23;
moel@110
    67
    private const ushort FINTEK_VENDOR_ID = 0x1934;
moel@110
    68
moel@245
    69
    private const byte WINBOND_NUVOTON_HARDWARE_MONITOR_LDN = 0x0B;
moel@110
    70
moel@110
    71
    private const byte F71858_HARDWARE_MONITOR_LDN = 0x02;
moel@110
    72
    private const byte FINTEK_HARDWARE_MONITOR_LDN = 0x04;
moel@110
    73
moel@245
    74
    private void WinbondNuvotonFintekEnter() {
moel@236
    75
      Ring0.WriteIoPort(registerPort, 0x87);
moel@236
    76
      Ring0.WriteIoPort(registerPort, 0x87);
moel@110
    77
    }
moel@110
    78
moel@245
    79
    private void WinbondNuvotonFintekExit() {
moel@236
    80
      Ring0.WriteIoPort(registerPort, 0xAA);
moel@110
    81
    }
moel@110
    82
moel@167
    83
    private bool DetectWinbondFintek() {
moel@245
    84
      WinbondNuvotonFintekEnter();
moel@167
    85
moel@195
    86
      byte logicalDeviceNumber = 0;
moel@167
    87
      byte id = ReadByte(CHIP_ID_REGISTER);
moel@167
    88
      byte revision = ReadByte(CHIP_REVISION_REGISTER);
moel@167
    89
      Chip chip = Chip.Unknown;
moel@167
    90
      switch (id) {
moel@167
    91
        case 0x05:
moel@167
    92
          switch (revision) {
moel@167
    93
            case 0x07:
moel@167
    94
              chip = Chip.F71858;
moel@167
    95
              logicalDeviceNumber = F71858_HARDWARE_MONITOR_LDN;
moel@167
    96
              break;
moel@167
    97
            case 0x41:
moel@167
    98
              chip = Chip.F71882;
moel@167
    99
              logicalDeviceNumber = FINTEK_HARDWARE_MONITOR_LDN;
moel@167
   100
              break;
moel@167
   101
          } break;
moel@167
   102
        case 0x06:
moel@167
   103
          switch (revision) {
moel@167
   104
            case 0x01:
moel@167
   105
              chip = Chip.F71862;
moel@167
   106
              logicalDeviceNumber = FINTEK_HARDWARE_MONITOR_LDN;
moel@167
   107
              break;
moel@167
   108
          } break;
moel@167
   109
        case 0x07:
moel@167
   110
          switch (revision) {
moel@167
   111
            case 0x23:
moel@167
   112
              chip = Chip.F71889F;
moel@167
   113
              logicalDeviceNumber = FINTEK_HARDWARE_MONITOR_LDN;
moel@167
   114
              break;
moel@167
   115
          } break;
moel@167
   116
        case 0x08:
moel@167
   117
          switch (revision) {
moel@167
   118
            case 0x14:
moel@167
   119
              chip = Chip.F71869;
moel@167
   120
              logicalDeviceNumber = FINTEK_HARDWARE_MONITOR_LDN;
moel@167
   121
              break;
moel@167
   122
          } break;
moel@167
   123
        case 0x09:
moel@167
   124
          switch (revision) {
moel@352
   125
            case 0x01:
moel@352
   126
              chip = Chip.F71808E;
moel@352
   127
              logicalDeviceNumber = FINTEK_HARDWARE_MONITOR_LDN;
moel@352
   128
              break;
moel@167
   129
            case 0x09:
moel@167
   130
              chip = Chip.F71889ED;
moel@167
   131
              logicalDeviceNumber = FINTEK_HARDWARE_MONITOR_LDN;
moel@167
   132
              break;
moel@167
   133
          } break;
moel@296
   134
        case 0x10:
moel@296
   135
          switch (revision) {
moel@296
   136
            case 0x05:
moel@296
   137
              chip = Chip.F71889AD;
moel@296
   138
              logicalDeviceNumber = FINTEK_HARDWARE_MONITOR_LDN;
moel@296
   139
              break;
moel@296
   140
          } break;
moel@167
   141
        case 0x52:
moel@167
   142
          switch (revision) {
moel@167
   143
            case 0x17:
moel@167
   144
            case 0x3A:
moel@167
   145
            case 0x41:
moel@167
   146
              chip = Chip.W83627HF;
moel@245
   147
              logicalDeviceNumber = WINBOND_NUVOTON_HARDWARE_MONITOR_LDN;
moel@167
   148
              break;
moel@167
   149
          } break;
moel@167
   150
        case 0x82:
moel@167
   151
          switch (revision & 0xF0) {
moel@167
   152
            case 0x80:
moel@167
   153
              chip = Chip.W83627THF;
moel@245
   154
              logicalDeviceNumber = WINBOND_NUVOTON_HARDWARE_MONITOR_LDN;
moel@167
   155
              break;
moel@167
   156
          } break;
moel@167
   157
        case 0x85:
moel@167
   158
          switch (revision) {
moel@167
   159
            case 0x41:
moel@167
   160
              chip = Chip.W83687THF;
moel@245
   161
              logicalDeviceNumber = WINBOND_NUVOTON_HARDWARE_MONITOR_LDN;
moel@167
   162
              break;
moel@167
   163
          } break;
moel@167
   164
        case 0x88:
moel@167
   165
          switch (revision & 0xF0) {
moel@167
   166
            case 0x50:
moel@167
   167
            case 0x60:
moel@167
   168
              chip = Chip.W83627EHF;
moel@245
   169
              logicalDeviceNumber = WINBOND_NUVOTON_HARDWARE_MONITOR_LDN;
moel@167
   170
              break;
moel@167
   171
          } break;
moel@167
   172
        case 0xA0:
moel@167
   173
          switch (revision & 0xF0) {
moel@167
   174
            case 0x20:
moel@167
   175
              chip = Chip.W83627DHG;
moel@245
   176
              logicalDeviceNumber = WINBOND_NUVOTON_HARDWARE_MONITOR_LDN;
moel@167
   177
              break;
moel@167
   178
          } break;
moel@167
   179
        case 0xA5:
moel@167
   180
          switch (revision & 0xF0) {
moel@167
   181
            case 0x10:
moel@167
   182
              chip = Chip.W83667HG;
moel@245
   183
              logicalDeviceNumber = WINBOND_NUVOTON_HARDWARE_MONITOR_LDN;
moel@167
   184
              break;
moel@167
   185
          } break;
moel@167
   186
        case 0xB0:
moel@167
   187
          switch (revision & 0xF0) {
moel@167
   188
            case 0x70:
moel@167
   189
              chip = Chip.W83627DHGP;
moel@245
   190
              logicalDeviceNumber = WINBOND_NUVOTON_HARDWARE_MONITOR_LDN;
moel@167
   191
              break;
moel@167
   192
          } break;
moel@167
   193
        case 0xB3:
moel@167
   194
          switch (revision & 0xF0) {
moel@167
   195
            case 0x50:
moel@167
   196
              chip = Chip.W83667HGB;
moel@245
   197
              logicalDeviceNumber = WINBOND_NUVOTON_HARDWARE_MONITOR_LDN;
moel@245
   198
              break;
moel@245
   199
          } break;
moel@245
   200
        case 0xB4:
moel@245
   201
          switch (revision & 0xF0) {
moel@245
   202
            case 0x70:
moel@245
   203
              chip = Chip.NCT6771F;
moel@245
   204
              logicalDeviceNumber = WINBOND_NUVOTON_HARDWARE_MONITOR_LDN;
moel@167
   205
              break;
moel@167
   206
          } break;
moel@265
   207
        case 0xC3:
moel@265
   208
          switch (revision & 0xF0) {
moel@265
   209
            case 0x30:
moel@265
   210
              chip = Chip.NCT6776F;
moel@265
   211
              logicalDeviceNumber = WINBOND_NUVOTON_HARDWARE_MONITOR_LDN;
moel@265
   212
              break;
moel@265
   213
          } break;
moel@167
   214
      }
moel@167
   215
      if (chip == Chip.Unknown) {
moel@167
   216
        if (id != 0 && id != 0xff) {
moel@245
   217
          WinbondNuvotonFintekExit();
moel@167
   218
moel@245
   219
          ReportUnknownChip("Winbond / Nuvoton / Fintek", 
moel@245
   220
            ((id << 8) | revision));
moel@167
   221
        }
moel@167
   222
      } else {
moel@167
   223
moel@167
   224
        Select(logicalDeviceNumber);
moel@167
   225
        ushort address = ReadWord(BASE_ADDRESS_REGISTER);
moel@167
   226
        Thread.Sleep(1);
moel@167
   227
        ushort verify = ReadWord(BASE_ADDRESS_REGISTER);
moel@167
   228
moel@167
   229
        ushort vendorID = ReadWord(FINTEK_VENDOR_ID_REGISTER);
moel@167
   230
moel@245
   231
        WinbondNuvotonFintekExit();
moel@167
   232
moel@167
   233
        if (address != verify) {
moel@167
   234
          report.Append("Chip ID: 0x");
moel@167
   235
          report.AppendLine(chip.ToString("X"));
moel@167
   236
          report.Append("Chip revision: 0x");
moel@228
   237
          report.AppendLine(revision.ToString("X",
moel@167
   238
            CultureInfo.InvariantCulture));
moel@167
   239
          report.AppendLine("Error: Address verification failed");
moel@167
   240
          report.AppendLine();
moel@167
   241
          return false;
moel@167
   242
        }
moel@167
   243
moel@167
   244
        // some Fintek chips have address register offset 0x05 added already
moel@167
   245
        if ((address & 0x07) == 0x05)
moel@167
   246
          address &= 0xFFF8;
moel@167
   247
moel@167
   248
        if (address < 0x100 || (address & 0xF007) != 0) {
moel@167
   249
          report.Append("Chip ID: 0x");
moel@167
   250
          report.AppendLine(chip.ToString("X"));
moel@167
   251
          report.Append("Chip revision: 0x");
moel@228
   252
          report.AppendLine(revision.ToString("X",
moel@167
   253
            CultureInfo.InvariantCulture));
moel@167
   254
          report.Append("Error: Invalid address 0x");
moel@228
   255
          report.AppendLine(address.ToString("X",
moel@167
   256
            CultureInfo.InvariantCulture));
moel@167
   257
          report.AppendLine();
moel@167
   258
          return false;
moel@167
   259
        }
moel@167
   260
moel@167
   261
        switch (chip) {
moel@167
   262
          case Chip.W83627DHG:
moel@167
   263
          case Chip.W83627DHGP:
moel@167
   264
          case Chip.W83627EHF:
moel@167
   265
          case Chip.W83627HF:
moel@167
   266
          case Chip.W83627THF:
moel@167
   267
          case Chip.W83667HG:
moel@167
   268
          case Chip.W83667HGB:
moel@167
   269
          case Chip.W83687THF:
moel@167
   270
            superIOs.Add(new W836XX(chip, revision, address));
moel@167
   271
            break;
moel@245
   272
          case Chip.NCT6771F:
moel@265
   273
          case Chip.NCT6776F:
moel@245
   274
            superIOs.Add(new NCT677X(chip, revision, address));
moel@245
   275
            break;
moel@167
   276
          case Chip.F71858:
moel@167
   277
          case Chip.F71862:
moel@167
   278
          case Chip.F71869:
moel@167
   279
          case Chip.F71882:
moel@296
   280
          case Chip.F71889AD:
moel@167
   281
          case Chip.F71889ED:
moel@167
   282
          case Chip.F71889F:
moel@352
   283
          case Chip.F71808E:
moel@167
   284
            if (vendorID != FINTEK_VENDOR_ID) {
moel@167
   285
              report.Append("Chip ID: 0x");
moel@167
   286
              report.AppendLine(chip.ToString("X"));
moel@167
   287
              report.Append("Chip revision: 0x");
moel@228
   288
              report.AppendLine(revision.ToString("X",
moel@167
   289
                CultureInfo.InvariantCulture));
moel@167
   290
              report.Append("Error: Invalid vendor ID 0x");
moel@228
   291
              report.AppendLine(vendorID.ToString("X",
moel@167
   292
                CultureInfo.InvariantCulture));
moel@167
   293
              report.AppendLine();
moel@167
   294
              return false;
moel@167
   295
            }
moel@167
   296
            superIOs.Add(new F718XX(chip, address));
moel@167
   297
            break;
moel@167
   298
          default: break;
moel@167
   299
        }
moel@167
   300
moel@167
   301
        return true;
moel@167
   302
      }
moel@167
   303
moel@167
   304
      return false;
moel@167
   305
    }
moel@167
   306
moel@169
   307
    #endregion
moel@169
   308
moel@169
   309
    #region ITE
moel@169
   310
moel@169
   311
    private const byte IT87_ENVIRONMENT_CONTROLLER_LDN = 0x04;
moel@353
   312
    private const byte IT8705_GPIO_LDN = 0x05;
moel@353
   313
    private const byte IT87XX_GPIO_LDN = 0x07;
moel@169
   314
    private const byte IT87_CHIP_VERSION_REGISTER = 0x22;
moel@169
   315
moel@169
   316
    private void IT87Enter() {
moel@236
   317
      Ring0.WriteIoPort(registerPort, 0x87);
moel@236
   318
      Ring0.WriteIoPort(registerPort, 0x01);
moel@236
   319
      Ring0.WriteIoPort(registerPort, 0x55);
moel@236
   320
      Ring0.WriteIoPort(registerPort, 0x55);
moel@169
   321
    }
moel@169
   322
moel@169
   323
    private void IT87Exit() {
moel@236
   324
      Ring0.WriteIoPort(registerPort, CONFIGURATION_CONTROL_REGISTER);
moel@236
   325
      Ring0.WriteIoPort(valuePort, 0x02);
moel@169
   326
    }
moel@169
   327
moel@167
   328
    private bool DetectIT87() {
moel@169
   329
moel@169
   330
      // IT87XX can enter only on port 0x2E
moel@169
   331
      if (registerPort != 0x2E)
moel@169
   332
        return false;
moel@169
   333
moel@167
   334
      IT87Enter();
moel@167
   335
moel@167
   336
      ushort chipID = ReadWord(CHIP_ID_REGISTER);
moel@167
   337
      Chip chip;
moel@167
   338
      switch (chipID) {
moel@353
   339
        case 0x8705: chip = Chip.IT8705F; break;
moel@167
   340
        case 0x8712: chip = Chip.IT8712F; break;
moel@167
   341
        case 0x8716: chip = Chip.IT8716F; break;
moel@167
   342
        case 0x8718: chip = Chip.IT8718F; break;
moel@167
   343
        case 0x8720: chip = Chip.IT8720F; break;
moel@170
   344
        case 0x8721: chip = Chip.IT8721F; break;
moel@167
   345
        case 0x8726: chip = Chip.IT8726F; break;
moel@277
   346
        case 0x8728: chip = Chip.IT8728F; break;
moel@341
   347
        case 0x8771: chip = Chip.IT8771E; break;
moel@319
   348
        case 0x8772: chip = Chip.IT8772E; break;
moel@167
   349
        default: chip = Chip.Unknown; break;
moel@167
   350
      }
moel@167
   351
      if (chip == Chip.Unknown) {
moel@167
   352
        if (chipID != 0 && chipID != 0xffff) {
moel@167
   353
          IT87Exit();
moel@167
   354
moel@167
   355
          ReportUnknownChip("ITE", chipID);
moel@167
   356
        }
moel@167
   357
      } else {
moel@167
   358
        Select(IT87_ENVIRONMENT_CONTROLLER_LDN);
moel@167
   359
        ushort address = ReadWord(BASE_ADDRESS_REGISTER);
moel@167
   360
        Thread.Sleep(1);
moel@167
   361
        ushort verify = ReadWord(BASE_ADDRESS_REGISTER);
moel@167
   362
moel@167
   363
        byte version = (byte)(ReadByte(IT87_CHIP_VERSION_REGISTER) & 0x0F);
moel@167
   364
moel@353
   365
        ushort gpioAddress;
moel@353
   366
        ushort gpioVerify;
moel@353
   367
        if (chip == Chip.IT8705F) {
moel@353
   368
          Select(IT8705_GPIO_LDN);
moel@353
   369
          gpioAddress = ReadWord(BASE_ADDRESS_REGISTER);
moel@353
   370
          Thread.Sleep(1);
moel@353
   371
          gpioVerify = ReadWord(BASE_ADDRESS_REGISTER);
moel@353
   372
        } else {
moel@353
   373
          Select(IT87XX_GPIO_LDN);
moel@353
   374
          gpioAddress = ReadWord(BASE_ADDRESS_REGISTER + 2);
moel@353
   375
          Thread.Sleep(1);
moel@353
   376
          gpioVerify = ReadWord(BASE_ADDRESS_REGISTER + 2);
moel@353
   377
        }
moel@353
   378
        
moel@167
   379
        IT87Exit();
moel@167
   380
moel@167
   381
        if (address != verify || address < 0x100 || (address & 0xF007) != 0) {
moel@167
   382
          report.Append("Chip ID: 0x");
moel@167
   383
          report.AppendLine(chip.ToString("X"));
moel@167
   384
          report.Append("Error: Invalid address 0x");
moel@167
   385
          report.AppendLine(address.ToString("X",
moel@167
   386
            CultureInfo.InvariantCulture));
moel@167
   387
          report.AppendLine();
moel@167
   388
          return false;
moel@167
   389
        }
moel@167
   390
moel@228
   391
        if (gpioAddress != gpioVerify || gpioAddress < 0x100 ||
moel@228
   392
          (gpioAddress & 0xF007) != 0) {
moel@228
   393
          report.Append("Chip ID: 0x");
moel@228
   394
          report.AppendLine(chip.ToString("X"));
moel@228
   395
          report.Append("Error: Invalid GPIO address 0x");
moel@228
   396
          report.AppendLine(gpioAddress.ToString("X",
moel@228
   397
            CultureInfo.InvariantCulture));
moel@228
   398
          report.AppendLine();
moel@228
   399
          return false;
moel@228
   400
        }
moel@228
   401
moel@228
   402
        superIOs.Add(new IT87XX(chip, address, gpioAddress, version));
moel@167
   403
        return true;
moel@167
   404
      }
moel@167
   405
moel@167
   406
      return false;
moel@167
   407
    }
moel@167
   408
moel@169
   409
    #endregion
moel@169
   410
moel@169
   411
    #region SMSC
moel@169
   412
moel@169
   413
    private void SMSCEnter() {
moel@236
   414
      Ring0.WriteIoPort(registerPort, 0x55);
moel@169
   415
    }
moel@169
   416
moel@169
   417
    private void SMSCExit() {
moel@236
   418
      Ring0.WriteIoPort(registerPort, 0xAA);
moel@169
   419
    }
moel@169
   420
moel@167
   421
    private bool DetectSMSC() {
moel@167
   422
      SMSCEnter();
moel@167
   423
moel@167
   424
      ushort chipID = ReadWord(CHIP_ID_REGISTER);
moel@167
   425
      Chip chip;
moel@167
   426
      switch (chipID) {
moel@167
   427
        default: chip = Chip.Unknown; break;
moel@167
   428
      }
moel@167
   429
      if (chip == Chip.Unknown) {
moel@167
   430
        if (chipID != 0 && chipID != 0xffff) {
moel@167
   431
          SMSCExit();
moel@167
   432
moel@167
   433
          ReportUnknownChip("SMSC", chipID);
moel@167
   434
        }
moel@167
   435
      } else {
moel@167
   436
        SMSCExit();
moel@167
   437
        return true;
moel@167
   438
      }
moel@167
   439
moel@167
   440
      return false;
moel@167
   441
    }
moel@167
   442
moel@169
   443
    #endregion
moel@169
   444
moel@163
   445
    private void Detect() {
moel@110
   446
moel@110
   447
      for (int i = 0; i < REGISTER_PORTS.Length; i++) {
moel@110
   448
        registerPort = REGISTER_PORTS[i];
moel@110
   449
        valuePort = VALUE_PORTS[i];
moel@110
   450
moel@167
   451
        if (DetectWinbondFintek()) continue;
moel@110
   452
moel@167
   453
        if (DetectIT87()) continue;
moel@110
   454
moel@167
   455
        if (DetectSMSC()) continue;
moel@228
   456
      }
moel@163
   457
    }
moel@163
   458
moel@163
   459
    public LPCIO() {
moel@236
   460
      if (!Ring0.IsOpen)
moel@163
   461
        return;
moel@163
   462
moel@236
   463
      if (!Ring0.WaitIsaBusMutex(100))
moel@163
   464
        return;
moel@163
   465
moel@163
   466
      Detect();
moel@163
   467
moel@236
   468
      Ring0.ReleaseIsaBusMutex();
moel@110
   469
    }
moel@110
   470
moel@130
   471
    public ISuperIO[] SuperIO {
moel@110
   472
      get {
moel@130
   473
        return superIOs.ToArray();
moel@110
   474
      }
moel@110
   475
    }
moel@110
   476
moel@110
   477
    public string GetReport() {
moel@110
   478
      if (report.Length > 0) {
moel@195
   479
        return "LPCIO" + Environment.NewLine + Environment.NewLine + report;
moel@110
   480
      } else
moel@110
   481
        return null;
moel@110
   482
    }
moel@110
   483
  }
moel@110
   484
}