Main Page | Namespace List | Class Hierarchy | Class List | File List | Namespace Members | Class Members | File Members | Related Pages

StdWorkarounds.h

Go to the documentation of this file.
00001 // vim:expandtab:autoindent:tabstop=4:shiftwidth=4:filetype=c:cindent:
00002 /*
00003  * Copyright (C) 2005 Dell Inc.
00004  *  by Michael Brown <Michael_E_Brown@dell.com>
00005  * Licensed under the Open Software License version 2.1
00006  *
00007  * Alternatively, you can redistribute it and/or modify
00008  * it under the terms of the GNU General Public License as published
00009  * by the Free Software Foundation; either version 2 of the License,
00010  * or (at your option) any later version.
00011 
00012  * This program is distributed in the hope that it will be useful, but
00013  * WITHOUT ANY WARRANTY; without even the implied warranty of
00014  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
00015  * See the GNU General Public License for more details.
00016  */
00017 
00018 
00019 #ifndef STDWORKAROUNDS_H_
00020 #define STDWORKAROUNDS_H_
00021 
00022 // This file will eventually be generated automatically from an XML file.
00023 // for now, hand edit.
00024 //
00025 // This file contains a list of all the BIOS cock-ups that we can work around in
00026 // software.
00027 
00028 namespace smbios
00029 {
00030     const WorkaroundSmbiosItem InvalidCheckTypeSymptoms[] =
00031         {
00032             // Item Type,  Offset,  Data Type, Data to check(*)
00033             { 0xD4, 0x08, TYPE_U8 , { {0x03, 0} } },
00034             //                         ^-- wrong checksum type of 0x3
00035             //               ^------------ checkType is a single u8
00036             //        ^------------------- offset 0x8 is the checkType field.
00037             //
00038             { 0xD4, 0x02, TYPE_U16, { {0x02, 0xd4, 0} } },
00039             //                        ^--- Check the handle as well, only
00040             //                              the third 0xD4 entry is flawed.
00041             //                              Third 0xD4 is handle 0xD402
00042             //                              note little endian notation.
00043             //                ^----------- The Handle is a U16
00044             //       ^-------------------- Check the handle at offset 0x2
00045             //
00046             { 0, 0, 0, { {0} } },
00047             //
00048             // * -- Data to check is a _union_. initializer syntax for unions
00049             //      sucks. You can only initialize the first member of a union
00050             //      in a statically allocated variable.
00051             //      I have made the first member a (u8 data[8]) so that we can
00052             //      (messily) initialize any possible combination.
00053         };
00054 
00055     const WorkaroundSmbiosItem InvalidCheckTypeFixup[] =
00056         {
00057             // Item Type, Offset, Data Type, Data to Change
00058             { 0xD4, 0x08, TYPE_U8, {{0x00}} },  //caution here. see datatron def.
00059             { 0, 0, 0, {{0}} },
00060         };
00061 
00062     // PE1300 has same bug, but fixup is different
00063     const WorkaroundSmbiosItem PE1300_InvalidCheckTypeFixup[] =
00064         {
00065             // Item Type, Offset, Data Type, Data to Change
00066             { 0xD4, 0x08, TYPE_U8, {{0x01}} },  //caution here. see datatron def.
00067             { 0, 0, 0, {{0}} },
00068         };
00069 
00070     const Workaround InvalidCheckType =
00071         { "Invalid Checksum Type", InvalidCheckTypeSymptoms, InvalidCheckTypeFixup };
00072     // PE1300 has same symptoms as above, but different fix.
00073     const Workaround PE1300_InvalidCheckType =
00074         { "PE1300 Invalid Checksum Type", InvalidCheckTypeSymptoms, PE1300_InvalidCheckTypeFixup };
00075 
00076     // System Definitions...
00077 
00078     const SystemAffected PE0600 = { 0x0134, "A00", "A05" };  // TODO: code to check BIOS
00079     const SystemAffected PE0650 = { 0x0141, "A00", "A00" };  // TODO: code to check BIOS
00080     const SystemAffected PE1300 = { 0x8E,   "A00", "A--" };  // TODO: code to check BIOS
00081     const SystemAffected PE1600 = { 0x0135, "A00", "A00" };  // TODO: code to check BIOS
00082     const SystemAffected PE1650 = { 0x011B, "A00", "A09" };  // TODO: code to check BIOS
00083     const SystemAffected IDS4235 = { 0x8012, "A--", "A--" };  // TODO: code to check BIOS
00084     const SystemAffected PE1655 = { 0x0124, "A00", "A00" };  // TODO: code to check BIOS
00085     const SystemAffected PE1750 = { 0x014a, "A00", "A00" };  // TODO: code to check BIOS
00086     const SystemAffected PE2600 = { 0x0123, "A00", "A03" };  // TODO: code to check BIOS
00087     const SystemAffected PE2650 = { 0x0121, "A00", "A10" };  // TODO: code to check BIOS
00088     const SystemAffected PE4600 = { 0x0106, "A00", "A08" };  // TODO: code to check BIOS
00089     const SystemAffected PE6600 = { 0x0109, "A00", "A08" };  // TODO: code to check BIOS // what about 6650?
00090 
00091     // Workaround lists for each system listed.
00092     const Workaround *PE0600_Workarounds[] = { &InvalidCheckType, 0 };
00093     const Workaround *PE0650_Workarounds[] = { &InvalidCheckType, 0 };
00094     const Workaround *PE1300_Workarounds[] = { &PE1300_InvalidCheckType, 0 };
00095     const Workaround *PE1600_Workarounds[] = { &InvalidCheckType, 0 };
00096     const Workaround *PE1650_Workarounds[] = { &InvalidCheckType, 0 };
00097     const Workaround *IDS4235_Workarounds[] = { &InvalidCheckType, 0 };
00098     const Workaround *PE1655_Workarounds[] = { &InvalidCheckType, 0 };
00099     const Workaround *PE1750_Workarounds[] = { &InvalidCheckType, 0 };
00100     const Workaround *PE2600_Workarounds[] = { &InvalidCheckType, 0 };
00101     const Workaround *PE2650_Workarounds[] = { &InvalidCheckType, 0 };
00102     const Workaround *PE4600_Workarounds[] = { &InvalidCheckType, 0 };
00103     const Workaround *PE6600_Workarounds[] = { &InvalidCheckType, 0 };
00104 
00105     // now, put everything together.
00106     //   not NULL terminated, see numSystemWorkarounds below...
00107     const SystemWorkaround  workaroundMasterList[] =
00108         {
00109             { &PE0600, PE0600_Workarounds },
00110             { &PE0650, PE0650_Workarounds },
00111             { &PE1300, PE1300_Workarounds },  // Unit tested
00112             { &PE1600, PE1600_Workarounds },
00113             { &PE1650, PE1650_Workarounds },  // Unit tested
00114             { &IDS4235, IDS4235_Workarounds },  // Unit tested
00115             { &PE1655, PE1655_Workarounds },  // Unit tested
00116             { &PE1750, PE1750_Workarounds },
00117             { &PE2600, PE2600_Workarounds },
00118             { &PE2650, PE2650_Workarounds },
00119             { &PE4600, PE4600_Workarounds },
00120             { &PE6600, PE6600_Workarounds },  // Unit tested
00121         };
00122 
00123     // works because list is statically allocated.
00124     const int numSystemWorkarounds = (sizeof(workaroundMasterList) / sizeof(workaroundMasterList[0]));
00125 
00126 }
00127 
00128 #endif /* STDWORKAROUNDS_H_ */

Generated on Wed Apr 11 16:25:10 2007 for SMBIOS Library by doxygen 1.3.5