/usr/src/redhat/BUILD/libsmbios-2.2.26/src/include/smbios/RbuLowLevel.h

Go to the documentation of this file.
00001 /* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
00002  * vim:expandtab:autoindent:tabstop=4:shiftwidth=4:filetype=c:cindent:textwidth=0:
00003  *
00004  * Copyright (C) 2005 Dell Inc.
00005  *  by Michael Brown <Michael_E_Brown@dell.com>
00006  * Licensed under the Open Software License version 2.1
00007  *
00008  * Alternatively, you can redistribute it and/or modify
00009  * it under the terms of the GNU General Public License as published
00010  * by the Free Software Foundation; either version 2 of the License,
00011  * or (at your option) any later version.
00012 
00013  * This program is distributed in the hope that it will be useful, but
00014  * WITHOUT ANY WARRANTY; without even the implied warranty of
00015  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
00016  * See the GNU General Public License for more details.
00017  */
00018 
00019 #ifndef RBULOWLEVEL_H
00020 #define RBULOWLEVEL_H
00021 
00022 // compat header should always be first header if including system headers
00023 #include "smbios/compat.h"
00024 
00025 #   define RBU_SMBIOS_STRUCT (0xDE)
00026 #   define RBU_ACTIVATE (0x005c)
00027 #   define RBU_CANCEL   (0x005d)
00028 
00029 // WARNING WARNING WARNING
00030 //
00031 // This file is not guaranteed to be API/ABI stable. Include it at your own risk.
00032 //
00033 // WARNING WARNING WARNING
00034 
00035 namespace rbu
00036 {
00037 #   if defined(_MSC_VER)
00038 #       pragma pack(push,1)
00039 #   endif
00040 
00041     /* RBU packets are 4 KB-aligned and consist of a header and data. The packet header contains the necessary information for BIOS to find the packets in memory, and assemble them in proper order. */
00042 
00043     struct  rbu_packet
00044     {
00045         u32 pktId;      // must be '$RPK'
00046         u16 pktSize;    // size of packet in KB
00047         u16 reserved1;  //
00048         u16 hdrSize;    // size of packet header in paragraphs (16 byte chunks)
00049         u16  reserved2; //
00050         u32 pktSetId;   // unique id for packet set, can be anything
00051         u16 pktNum;     // sequential pkt number (only thing that changes)
00052         u16 totPkts;    // total number of packets
00053         u8  pktVer;     // version == 1 for now
00054         u8  reserved[9];
00055         u16 pktChksum;  // sum all bytes in pkt must be zero
00056         u8  pktData;  // Start of packet data.
00057     }
00058     LIBSMBIOS_PACKED_ATTR;
00059 
00060 
00061     /* RBU Packet Requirements
00062 
00063     1.All values in the packet header except PktNum must be the same for all packets in a set with the following exception:
00064             -- Packet 0 may have a different packet size (PktSize).
00065             -- checksums
00066     2.Packet 0 data does not contain RBU data. Packet 1 contains the first chunk of RBU data.
00067     3.Packet data begins immediately after the header. Packet data size and offset can be calculated from PktSize and HdrSize.
00068     4.Reserved fields are 0.
00069     5.If multiple packets sets are written to memory, all packet sets must be identical.
00070     6.All packets must start on 4 KB boundaries.
00071     7.All packets must be placed in non-paged memory.
00072     8.The maximum size of a packet is 64 MB.
00073     9.The maximum size of a packet header is 4 KB.
00074     10.The maximum number of packets is 64 KB - 1.
00075     11.CPU INIT# must be immediately asserted (e.g. via OS shutdown/restart) after the RBU packet set is placed in memory.
00076     12.PktChk is the value resulting in a zero sum of all packet words (header and data).
00077     13.PktSetId uniquely identifies a packet set. BIOS aborts the packet search if all packets do not have the same PkSetId. Example identifiers: a 4-character ASCII ID string (e.g. “_A00”), a 4-byte hash value (e.g. CRC).
00078         */
00079 
00080     /*  RBU Packet 0 */
00081 
00082     struct  rbu_packet_0
00083     {
00084         rbu_packet  header;
00085         u8  passwordCheckInfo;  // bit 7: passwordCheck is present   bits 0-6: reserved
00086         u32 passwordCheck;      // crc-32 of admin/setup password
00087         // the rest is reserved for future expansion.
00088     }
00089     LIBSMBIOS_PACKED_ATTR;
00090 
00091     /* RBU Packet 0 Definition
00092 
00093     Packet 0 is reserved for packet set information. Packet 0 data consists of data items -- each item consists of an info byte followed by the actual data item. If bit 0 of the info byte is 1, the actual data starting at the next byte is present. If bit 0 is 0, the data is not present.
00094 
00095     The system flash password is currently defined as the admin or setup password.
00096 
00097     BIOS reject the packet set when:
00098     1.The packet set flash password CRC and the system flash password CRC do not match.
00099     2.The packet set flash password CRC is not present but the system flash password is present.
00100 
00101     */
00102 
00103 
00104     /*
00105        RBU BIOS UPDATE HEADER FILE (.HDR) structure
00106        */
00107 
00108     const int NUM_SYS_ID_IN_HDR = 12;
00109 
00110     struct rbu_hdr_file_header
00111     {
00112         char headerId[4];
00113         u8  headerLength;
00114         u8  headerMajorVer;
00115         u8  headerMinorVer;
00116         u8  numSystems;
00117         char quickCheck[40];
00118         char biosVersion[3];
00119         u8  miscFlags;
00120         u8  biosInternalUse;
00121         u8  reserved[5];
00122         u16 compatFlags;
00123         u16 systemIdList[NUM_SYS_ID_IN_HDR]; /*
00124             Contains the list of NumSystems Dell System ID and Hardware Revision
00125             ID pairs for which the Image Data is valid, in the following format:
00126             Bit Range  Description
00127             15:11      Dell System ID, bits 12:8.
00128                         This range is set to 00000b if the Dell System ID
00129                         is a 1-byte value.
00130             10:8       Hardware Revision ID
00131             7:0        Dell System ID, bits 7:0. */
00132     }
00133     LIBSMBIOS_PACKED_ATTR;
00134 
00135 #   if defined(_MSC_VER)
00136 #       pragma pack(pop)
00137 #   endif
00138 
00139 }
00140 
00141 #endif /* RBUIMPL_H */

Generated on Wed Oct 6 08:02:39 2010 for libsmbios_c library by  doxygen 1.4.7