00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
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;
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
00070 virtual bool CreateRdr( SaHpiRptEntryT &resource, SaHpiRdrT &rdr );
00071 };
00072
00073
00074 #endif