41 GHashTable* hostIf_DeviceProcessorInterface::ifHash = NULL;
42 GMutex* hostIf_DeviceProcessorInterface::m_mutex = NULL;
47 if(dev_id > getNumOfProcessorEntries())
49 RDK_LOG(RDK_LOG_ERROR,LOG_TR69HOSTIF,
"Processor interface instace doesnot exist..\n");
59 ifHash = g_hash_table_new(NULL,NULL);
68 RDK_LOG(RDK_LOG_WARN,LOG_TR69HOSTIF,
"Caught exception, not able create Ethernet Interface instance..\n");
70 g_hash_table_insert(ifHash, (gpointer)dev_id, pRet);
75 GList* hostIf_DeviceProcessorInterface::getAllInstances()
78 return g_hash_table_get_keys(ifHash);
86 g_hash_table_remove(ifHash, (gconstpointer)pDev->dev_id);
91 void hostIf_DeviceProcessorInterface::closeAllInstances()
95 GList* tmp_list = g_hash_table_get_values (ifHash);
100 tmp_list = tmp_list->next;
106 void hostIf_DeviceProcessorInterface::getLock()
110 m_mutex = g_mutex_new();
112 g_mutex_lock(m_mutex);
115 void hostIf_DeviceProcessorInterface::releaseLock()
117 g_mutex_unlock(m_mutex);
130 bCalledArchitecture =
false;
131 backupArchitecture[0]=
'\0';
136 unsigned int hostIf_DeviceProcessorInterface::getNumOfProcessorEntries(
void) {
139 char resultBuff[BUF_LEN] = {
'\0'};
140 char cmd[BUF_LEN] =
"/bin/cat /proc/cpuinfo | /bin/grep processor | /usr/bin/wc -l";
141 int noOfProcessorEntries = 0;
146 RDK_LOG(RDK_LOG_ERROR,LOG_TR69HOSTIF,
"%s(): Error popen\n", __FUNCTION__);
150 if(fgets(resultBuff, BUF_LEN,fp)!=NULL) {
151 sscanf(resultBuff,
"%d",&noOfProcessorEntries);
156 RDK_LOG(RDK_LOG_INFO,LOG_TR69HOSTIF,
"%s(): Processors Count: [%d]\n", __FUNCTION__, noOfProcessorEntries);
158 return noOfProcessorEntries;
175 struct utsname utsName;
178 RDK_LOG(RDK_LOG_INFO,LOG_TR69HOSTIF,
"Get Architecture value: '%s'\n", utsName.machine);
179 strncpy(stMsgData->
paramValue, utsName.machine, strlen(utsName.machine));
180 if(pChanged && bCalledArchitecture && strncpy(stMsgData->
paramValue,backupArchitecture,strlen(stMsgData->
paramValue)))
185 bCalledArchitecture =
true;
186 strncpy(backupArchitecture,stMsgData->
paramValue,
sizeof(backupArchitecture) -1);
187 backupArchitecture[
sizeof(backupArchitecture)-1] =
'\0';