zhangbo 3 роки тому
батько
коміт
98dc4132af

+ 6 - 2
app/bmc/msghndlr/Storlead/Storlead.c

@@ -456,6 +456,8 @@ int Storlead_getAllBladeStatus(uint8_t *pReq, uint8_t ReqLen, uint8_t *pRes)
             memcpy(gBladeStatus[g_BMCInfo.IndexInChassis].bladeName, g_BMCInfo.BladeName, 31);
             gBladeStatus[g_BMCInfo.IndexInChassis].slotID = g_BMCInfo.SlotID;
             gBladeStatus[g_BMCInfo.IndexInChassis].pwrStatus = g_BMCInfo.PowerGoodFlag;
+            gBladeStatus[g_BMCInfo.IndexInChassis].isChMC = 1;  //从模块不能管理机箱,网页内显示机箱的默认选中刀片。
+
         }
     }
     else
@@ -468,6 +470,7 @@ int Storlead_getAllBladeStatus(uint8_t *pReq, uint8_t ReqLen, uint8_t *pRes)
                 memcpy(gBladeStatus[index].bladeName, g_BMCInfo.BladeName, 31);
                 gBladeStatus[index].slotID = g_BMCInfo.SlotID;
                 gBladeStatus[index].pwrStatus = g_BMCInfo.PowerGoodFlag;
+                gBladeStatus[index].isChMC = 1;
                 continue;
             }
 
@@ -488,6 +491,7 @@ int Storlead_getAllBladeStatus(uint8_t *pReq, uint8_t ReqLen, uint8_t *pRes)
                     memcpy(gBladeStatus[index].bladeName, &ResPkt.Data[2], 31);
                     gBladeStatus[index].slotID = ResPkt.Data[33];
                     gBladeStatus[index].pwrStatus = ResPkt.Data[34];
+                    gBladeStatus[index].isChMC = 0;
                 }
                 else
                 {
@@ -495,6 +499,7 @@ int Storlead_getAllBladeStatus(uint8_t *pReq, uint8_t ReqLen, uint8_t *pRes)
                     sprintf(gBladeStatus[index].bladeName, "---");
                     gBladeStatus[index].slotID = 0;
                     gBladeStatus[index].pwrStatus = 0;
+                    gBladeStatus[index].isChMC = 0;
                 }
             }
             else
@@ -503,9 +508,8 @@ int Storlead_getAllBladeStatus(uint8_t *pReq, uint8_t ReqLen, uint8_t *pRes)
                 sprintf(gBladeStatus[index].bladeName, "---");
                 gBladeStatus[index].slotID = 0;
                 gBladeStatus[index].pwrStatus = 0;
+                gBladeStatus[index].isChMC = 0;
             }
-
-            
         }
 
     }

+ 1 - 0
app/common_include/com_BmcType.h

@@ -317,6 +317,7 @@ typedef struct{
     uint8_t bladeName[31];  //10个汉字或30个字符
     uint8_t slotID;         
     uint8_t pwrStatus;      //0:未上电(灰色)     1:已上电(绿色)
+    uint8_t isChMC;         //是否是主模块,网页默认显示主模块的内容。
 } BladeStatus_T;
 
 

+ 4 - 3
app/goahead-3.6.5/src/web_interface/src/dashboard.c

@@ -35,7 +35,7 @@ void getDeviceInfo(Webs *wp){
     //Create session
     LIBIPMI_CreateSession(&UDSSession, DEFAULT_TIMEOUT);
 
-    wp->index = TEST_INDEX;
+ //   wp->index = TEST_INDEX;
     target_addr = gIPMBAddr[wp->index];
     if(target_addr == 0x20)
     {
@@ -161,7 +161,7 @@ void getSysInfo(Webs *wp){
     //Create session
     LIBIPMI_CreateSession(&UDSSession, DEFAULT_TIMEOUT);
     
-    wp->index = TEST_INDEX;
+//    wp->index = TEST_INDEX;
     target_addr = gIPMBAddr[wp->index];
     if(target_addr == 0x20)
     {
@@ -242,7 +242,7 @@ void getSensorInfo(Webs *wp){
     //Create session
     LIBIPMI_CreateSession(&UDSSession, 10000);
      
-    wp->index = TEST_INDEX;
+//    wp->index = TEST_INDEX;
     target_addr = gIPMBAddr[wp->index];
     if(target_addr == 0x20)
     {
@@ -492,6 +492,7 @@ void getAllBladeInfo(Webs *wp){
         cJSON_AddNumberToObject(pJsonsub, "slot", pBladeStatus[i].slotID); 
         cJSON_AddNumberToObject(pJsonsub, "power", pBladeStatus[i].pwrStatus); 
         cJSON_AddStringToObject(pJsonsub, "name", pBladeStatus[i].bladeName); 
+        cJSON_AddNumberToObject(pJsonsub, "isChMC", pBladeStatus[i].isChMC); 
     }
   
     pStr = cJSON_PrintUnformatted(root);

+ 2 - 2
app/goahead-3.6.5/src/web_interface/src/fan.c

@@ -30,7 +30,7 @@ void getAllFanInfo(Webs *wp){
 	//Create session
     LIBIPMI_CreateSession(&UDSSession, DEFAULT_TIMEOUT);
 
-    wp->index = TEST_INDEX;
+//    wp->index = TEST_INDEX;
     target_addr = gIPMBAddr[wp->index];
     if(target_addr == 0x20)
     {
@@ -118,7 +118,7 @@ void setFanInfo(Webs *wp){
 	//Create session
     LIBIPMI_CreateSession(&UDSSession, DEFAULT_TIMEOUT);
 
-    wp->index = TEST_INDEX;
+//    wp->index = TEST_INDEX;
     target_addr = gIPMBAddr[wp->index];
     if(target_addr == 0x20)
     {

+ 3 - 3
app/goahead-3.6.5/src/web_interface/src/fru.c

@@ -37,7 +37,7 @@ void getFruChassisInfo(Webs *wp)
 
 	//Create session
 	LIBIPMI_CreateSession(&UDSSession, DEFAULT_TIMEOUT);
-	wp->index = TEST_INDEX;
+//	wp->index = TEST_INDEX;
     target_addr = gIPMBAddr[wp->index];
     if(target_addr == 0x20)
     {
@@ -218,7 +218,7 @@ void getFruBoardInfo(Webs *wp)
 	//Create session
 	LIBIPMI_CreateSession(&UDSSession, DEFAULT_TIMEOUT);
 
-	wp->index = TEST_INDEX;
+//	wp->index = TEST_INDEX;
     target_addr = gIPMBAddr[wp->index];
     if(target_addr == 0x20)
     {
@@ -353,7 +353,7 @@ void getFruProductInfo(Webs *wp)
 
 	//Create session
 	LIBIPMI_CreateSession(&UDSSession, DEFAULT_TIMEOUT);
-	wp->index = TEST_INDEX;
+//	wp->index = TEST_INDEX;
     target_addr = gIPMBAddr[wp->index];
     if(target_addr == 0x20)
     {

+ 6 - 6
app/goahead-3.6.5/src/web_interface/src/fw_update.c

@@ -27,7 +27,7 @@ static uint8_t target_addr;
 */
 void prepareDevice(Webs *wp)
 {
-    wp->index = TEST_INDEX;
+//    wp->index = TEST_INDEX;
     target_addr = gIPMBAddr[wp->index];
     if(target_addr == 0x20)
     {
@@ -79,7 +79,7 @@ void uploadFirmware(Webs *wp)
     WebsUpload      *up;
     char            *upfile;
 
-    wp->index = TEST_INDEX;
+//    wp->index = TEST_INDEX;
     target_addr = gIPMBAddr[wp->index];
     if(target_addr == 0x20)
     {
@@ -134,7 +134,7 @@ void updateFlash(Webs *wp)
     uint8_t cmd[50] = {0};
     progress = 0;
 
-    wp->index = TEST_INDEX;
+//    wp->index = TEST_INDEX;
     target_addr = gIPMBAddr[wp->index];
     if(target_addr == 0x20)
     {
@@ -182,7 +182,7 @@ void getUpdateProgress(Webs *wp)
     uint8_t progressStr[10] = {0};
     FILE *fp;
 
-    wp->index = TEST_INDEX;
+//    wp->index = TEST_INDEX;
     target_addr = gIPMBAddr[wp->index];
     if(target_addr == 0x20)
     {
@@ -243,7 +243,7 @@ void getVerifyStatus(Webs *wp)
     uint8_t verigyStr[13] = {0};
     FILE *fp;
 
-    wp->index = TEST_INDEX;
+//    wp->index = TEST_INDEX;
     target_addr = gIPMBAddr[wp->index];
     if(target_addr == 0x20)
     {
@@ -309,7 +309,7 @@ void resetBmc(Webs *wp)
     websWriteEndHeaders(wp);
     websDone(wp);
 
-    wp->index = TEST_INDEX;
+//    wp->index = TEST_INDEX;
     target_addr = gIPMBAddr[wp->index];
     if(target_addr == 0x20)
     {

+ 4 - 4
app/goahead-3.6.5/src/web_interface/src/sel.c

@@ -22,7 +22,7 @@ void Web_ClearSEL(Webs *wp)
     //Create session
     LIBIPMI_CreateSession(&UDSSession, DEFAULT_TIMEOUT);
 
-    wp->index = TEST_INDEX;
+//    wp->index = TEST_INDEX;
     target_addr = gIPMBAddr[wp->index];
     if(target_addr == 0x20)
     {
@@ -104,7 +104,7 @@ void GetAllSELEntriesSorted(Webs *wp)
     //Create session
     LIBIPMI_CreateSession(&UDSSession, DEFAULT_TIMEOUT);
 
-    wp->index = TEST_INDEX;
+//    wp->index = TEST_INDEX;
     target_addr = gIPMBAddr[wp->index];
     if(target_addr == 0x20)
     {
@@ -327,7 +327,7 @@ void SetTime(Webs *wp)
     //Create session
     LIBIPMI_CreateSession(&UDSSession, DEFAULT_TIMEOUT);
     
-    wp->index = TEST_INDEX;
+//    wp->index = TEST_INDEX;
     target_addr = gIPMBAddr[wp->index];
     if(target_addr == 0x20)
     {
@@ -400,7 +400,7 @@ void GetTime(Webs *wp)
     //Create session
     LIBIPMI_CreateSession(&UDSSession, DEFAULT_TIMEOUT);
 
-    wp->index = TEST_INDEX;
+//    wp->index = TEST_INDEX;
     target_addr = gIPMBAddr[wp->index];
     if(target_addr == 0x20)
     {