00001 /*************************************************************************** 00002 l1394businfo.h - description 00003 ------------------- 00004 begin : Fri Oct 27 2000 00005 copyright : (C) 2000-2004 by Michael Repplinger 00006 email : repplinger@cs.uni-sb.de 00007 ***************************************************************************/ 00008 00009 /*************************************************************************** 00010 * * 00011 * This program is free software; you can redistribute it and/or modify * 00012 * it under the terms of the GNU General Public License as published by * 00013 * the Free Software Foundation; either version 2 of the License, or * 00014 * (at your option) any later version. * 00015 * * 00016 ***************************************************************************/ 00017 00018 #ifndef L1394BUSINFO_H 00019 #define L1394BUSINFO_H 00020 00021 #include "l1394_qarray.h" 00022 #include <iostream> 00023 namespace L1394{ 00024 namespace internal{ 00025 /*! \class BusInfo 00026 * \ingroup Internal 00027 * \brief This class stores the BusInfo block of the control and status register(CSR) 00028 * defined in IEEE 1212. 00029 * 00030 * Every Node has a BusInfo object that stores its capabilities. 00031 * For more information see IEEE 1212 specification. 00032 * 00033 * @author Michael Repplinger 00034 */ 00035 00036 class BusInfo{ 00037 00038 public: 00039 00040 /*! \fn BusInfo(QArray *) 00041 * \brief Constructor 00042 * \param QArray* pointer to the bus information block 00043 */ 00044 BusInfo(QArray *); 00045 00046 00047 /*! \fn ~BusInfo() 00048 * \brief Destructor 00049 */ 00050 ~BusInfo(); 00051 00052 /*! \fn getNodeInfo() const 00053 * \brief return the complete node information Quadlet 00054 */ 00055 Quadlet getNodeInfo() const {return node_info;} 00056 00057 /*! \fn getIrmc() const 00058 * \brief return 1 if node is Iso Resource Manager Capable, else 0 00059 */ 00060 int getIrmc() const {return node_info.getBit(31);} 00061 00062 /*! \fn getCmc() const 00063 * \brief return 1 if node is Cycle Master Capable, else 0 00064 */ 00065 int getCmc() const {return node_info.getBit(30);} 00066 00067 /*! \fn getIsc() const 00068 * \brief return 1 if node Iso Capable, else 0 00069 */ 00070 int getIsc() const {return node_info.getBit(29);} 00071 00072 /*! \fn getBmc() const 00073 * \brief return 1 if node is Bus Master Capable, else 0 00074 */ 00075 int getBmc() const {return node_info.getBit(28);} 00076 00077 //check if correct bit will be returned 00078 00079 /*! \fn getCykClk() const 00080 * \brief return the Cycle Clock 00081 */ 00082 int getCykClk() const {return node_info.getBitRange(16,23);} 00083 00084 /*! \fn getMaxRec() const 00085 * \brief return maximum record 00086 */ 00087 int getMaxRec() const {return node_info.getBitRange(12,15);} 00088 00089 /*! \fn getChipIdLow() const 00090 * \brief return the ChipIdLow (last 32 Bit of GUID) 00091 */ 00092 int getChipIdLow() const {return chip_id_low.toInt();} 00093 00094 /*! \fn getChipIdHi() const 00095 * \brief return the chipIdHi (the last 8Bit from the first 32 Bit part of GUID) 00096 */ 00097 int getChipIdHi() const {return node_info.getBitRange(24,31);} 00098 00099 /*! \fn getNodeVendorId() const 00100 * \brief return the node vendor id (the first 24 Bit of GUID) 00101 */ 00102 int getNodeVendorId() const {return node_vendor_id.getBitRange(0,23);} 00103 00104 /*! \fn getBusName() const 00105 * \brief return the bus name (should be "1394") 00106 */ 00107 const char* getBusName() const {return bus_name;} 00108 00109 00110 friend ostream& operator<<(ostream& o, const BusInfo&); 00111 00112 private: 00113 BusInfo(const BusInfo&); 00114 int romInfoBlockLength; 00115 char* bus_name; 00116 00117 Quadlet node_info, node_vendor_id, chip_id_low; 00118 }; 00119 } 00120 } 00121 #endif