Main Page | Class Hierarchy | Class List | File List | Class Members | File Members

ipmi_inventory.h

00001 /*
00002  *
00003  * Copyright (c) 2004 by FORCE Computers.
00004  * Copyright (c) 2005 by ESO Technologies.
00005  *
00006  * This program is distributed in the hope that it will be useful,
00007  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00008  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  This
00009  * file and program are licensed under a BSD style license.  See
00010  * the Copying file included with the OpenHPI distribution for
00011  * full licensing terms.
00012  *
00013  * Authors:
00014  *     Thomas Kanngieser <thomas.kanngieser@fci.com>
00015  *     Pierre Sangouard  <psangouard@eso-tech.com>
00016  */
00017 
00018 #ifndef dIpmiInventory_h
00019 #define dIpmiInventory_h
00020 
00021 
00022 #ifndef dIpmiRdr_h
00023 #include "ipmi_rdr.h"
00024 #endif
00025 
00026 
00027 #ifndef dIpmiInventoryParser_h
00028 #include "ipmi_inventory_parser.h"
00029 #endif
00030 
00031 #ifndef dIpmiAddr_h
00032 #include "ipmi_addr.h"
00033 #endif
00034 
00035 enum tInventoryAccessMode
00036 {
00037   eInventoryAccessModeByte = 0,
00038   eInventoryAccessModeWord = 1
00039 };
00040 
00041 
00042 #define dMaxFruFetchBytes 20
00043 
00044 
00045 class cIpmiInventory : public cIpmiRdr, public cIpmiInventoryParser
00046 {
00047 protected:
00048   unsigned char  m_fru_device_id; // fru device id
00049   tInventoryAccessMode m_access;
00050   unsigned int   m_size;
00051   bool           m_fetched;
00052 
00053   unsigned int   m_oem;
00054   cIpmiAddr      m_addr;
00055 
00056   SaErrorT GetFruInventoryAreaInfo( unsigned int &size, tInventoryAccessMode &byte_access );
00057   SaErrorT ReadFruData( unsigned short offset, unsigned int num, unsigned int &n, unsigned char *data );
00058 
00059 public:
00060   cIpmiInventory( cIpmiMc *mc, unsigned int fru_device_id );
00061   ~cIpmiInventory();
00062 
00063   SaErrorT Fetch();
00064 
00065   bool SetAddr( cIpmiAddr addr );
00066   virtual unsigned int Num() const { return m_fru_device_id; }
00067   unsigned int &Oem() { return m_oem; }
00068 
00069   // create an RDR inventory record
00070   virtual bool CreateRdr( SaHpiRptEntryT &resource, SaHpiRdrT &rdr );
00071 };
00072 
00073 
00074 #endif

Generated on Thu Mar 4 19:33:14 2010 for New Simulator by  doxygen 1.4.4