All Classes Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
HardwareConfig.h
Go to the documentation of this file.
1 /*
2  * HardwareConfig.h
3  *
4  * Created on: Apr 23, 2015
5  * Author: root
6  */
7 
8 #pragma once
9 
10 #include "coremask.h"
11 
13 {
14 
15 
16 public:
17 
19  {
26  };
27 
28  static const char* PoolExtraToString (int iPool)
29  {
30  switch (iPool)
31  {
32  case 0: return "PacketBufsExtra";
33  case 1: return "WqeBufsExtra";
34  case 2: return "PkoBufsExtra";
35  default: return "UnknownPool";
36  }
37  }
38 
39  static const char* EnvironmentToString (enum EEnvironment eEnvironment)
40  {
41  switch (eEnvironment)
42  {
43  case ENV_SIMPLE_EXECUTIVE: return "Simple Executive";
44  case ENV_LINUX_NO_ETHERNET_DRIVER: return "No Ethernet Driver";
45  case ENV_LINUX_OCTEON_ETHERNET_DRIVER: return "Octeon Ethernet Driver";
46  case ENV_LINUX_VSN_TAP_DRIVER: return "VSN TAP Driver";
47  case ENV_LINUX_PHACT_TAP_DRIVER: return "PHACT TAP Driver";
48  case ENV_UNKOWN_ENVIRONMENT: return "Unknown Environment";
49  default: return "Unknown Environment Type";
50  }
51  }
52 
53  bool Open (int iPacketBuffers=0, int iWqeBuffers=0, int iPkoBuffers=0, int iTimBuffers=0, int iDFABuffers=0);
54  void Close (void);
55 
56  static bool IsLinux (void);
57  static bool IsVsnTapDriverActive (void);
58  static bool IsPhactTapDriverActive (void);
59  static bool IsOcteonEthernetDriverActive(void);
60  static EEnvironment GetEnvironment (void);
61  static void Ipd (bool bEnable);
62 
63  void BackupConfig (void);
64  void RestoreConfig (void);
65 
66 
67 private:
68  bool OpenSdk2 (int iPacketBuffers, int iWqeBuffers, int iPkoBuffers, int iTimBuffers, int iDFABuffers);
69  bool OpenSdk3 (int iPacketBuffers, int iWqeBuffers, int iPkoBuffers, int iTimBuffers, int iDFABuffers);
70 
71  EEnvironment m_eEnvironment;
72  cvmx_sysinfo_t* m_ptSysInfo;
73  CCoremask m_cCoreMask;
74 
75 
76 };
static const char * EnvironmentToString(enum EEnvironment eEnvironment)
static const char * PoolExtraToString(int iPool)
static bool IsPhactTapDriverActive(void)
void RestoreConfig(void)
static EEnvironment GetEnvironment(void)
static void Ipd(bool bEnable)
bool Open(int iPacketBuffers=0, int iWqeBuffers=0, int iPkoBuffers=0, int iTimBuffers=0, int iDFABuffers=0)
static bool IsOcteonEthernetDriverActive(void)
static bool IsVsnTapDriverActive(void)
void Close(void)
void BackupConfig(void)
static bool IsLinux(void)