소스 검색

getSysInfo LSB first

zhangbo 3 년 전
부모
커밋
156020572e

+ 1 - 0
app/bmc/msghndlr/App/AppDevice/AppDevice.c

@@ -34,6 +34,7 @@
 #include "PMConfig.h"
 #include "main.h"
 #include <string.h>
+#include "Api.h"
 
 #define USER_ID_ENABLED 	0x01
 #define USER_ID_DISABLED 	0x02

+ 2 - 0
app/bmc/msghndlr/OemSMMCmds/OemSMMCmds.c

@@ -24,6 +24,8 @@
 #include "com_BmcType.h"
 #include "main.h"
 
+extern sensor_tbl_t *getSensorDev(uint8_t sensorNum);
+
 int  SMMExample_0h(uint8_t* pReq, uint8_t ReqLen,  uint8_t* pRes)
 {
 	*pRes= CC_NORMAL;

+ 1 - 1
app/bmc/sensor_sdr.c

@@ -611,7 +611,7 @@ const FullSensorRec_T full_sdr_tbl[] = {
 		*/
 		((0x0>>2)&0xC0)+(0x0&0x3F),	//B,Accuracy
 		((0x0>>2)&0xF0)+(0x0&0x0C)+0x0,	//Accuracy,Accuracy exponent
-		(0xfc<<4)+(0x0&0x0F),		//R exponent,B exponent 	=== !!!!!!!! ===
+		(0xc<<4)+(0x0&0x0F),		//R exponent,B exponent 	=== !!!!!!!! ===
 		0x0,	//Analog Characteristics Flags
 		0x7f,	//Nominal Reading
 		0xff,	//Normal Maximum

+ 1 - 1
app/goahead-3.6.5/src/auth.c

@@ -397,7 +397,7 @@ static void computeUserAbilities(WebsUser *user)
             printf("%s ", key->name.value.string);
             ability = key->name.value.string;
         }
-        printf("");
+        printf("\n");
     }
 #endif
     wfree(roles);

+ 4 - 19
app/goahead-3.6.5/src/goahead-mbedtls/goahead-mbedtls.c

@@ -50,7 +50,6 @@ static int  mbedHandshake(Webs *wp);
 static int  parseCert(mbedtls_x509_crt *cert, char *file);
 static int  parseCrl(mbedtls_x509_crl *crl, char *path);
 static int  parseKey(mbedtls_pk_context *key, char *path);
-static void merror(int rc, char *fmt, ...);
 static char *replaceHyphen(char *cipher, char from, char to);
 static void traceMbed(void *context, int level, cchar *file, int line, cchar *str);
 
@@ -79,7 +78,6 @@ PUBLIC int sslOpen()
     mbedtls_ssl_ticket_init(&cfg.tickets);
 
     if ((rc = mbedtls_ctr_drbg_seed(&cfg.ctr, mbedtls_entropy_func, &cfg.entropy, (cuchar*) ME_NAME, slen(ME_NAME))) < 0) {
-        merror(rc, "Cannot seed rng");
         return -1;
     }
 
@@ -121,7 +119,6 @@ PUBLIC int sslOpen()
 
     if ((rc = mbedtls_ssl_config_defaults(conf, MBEDTLS_SSL_IS_SERVER, MBEDTLS_SSL_TRANSPORT_STREAM, 
             MBEDTLS_SSL_PRESET_DEFAULT)) < 0) {
-        merror(rc, "Cannot set mbedtls defaults");
         return -1;
     }
     mbedtls_ssl_conf_rng(conf, mbedtls_ctr_drbg_random, &cfg.ctr);
@@ -130,7 +127,7 @@ PUBLIC int sslOpen()
         Configure larger DH parameters
      */
     if ((rc = mbedtls_ssl_conf_dh_param(conf, MBEDTLS_DHM_RFC5114_MODP_2048_P, MBEDTLS_DHM_RFC5114_MODP_2048_G)) < 0) {
-        merror(rc, "Cannot set DH params");
+
         return -1;
     }
 
@@ -145,7 +142,7 @@ PUBLIC int sslOpen()
     if (ME_GOAHEAD_SSL_TICKET) {
         if ((rc = mbedtls_ssl_ticket_setup(&cfg.tickets, mbedtls_ctr_drbg_random, &cfg.ctr,
                 MBEDTLS_CIPHER_AES_256_GCM, ME_GOAHEAD_SSL_TIMEOUT)) < 0) {
-            merror(rc, "Cannot setup ticketing sessions");
+
             return -1;
         }
         mbedtls_ssl_conf_session_tickets_cb(conf, mbedtls_ssl_ticket_write, mbedtls_ssl_ticket_parse, &cfg.tickets);
@@ -177,7 +174,7 @@ PUBLIC int sslOpen()
      */
     if (ME_GOAHEAD_SSL_KEY[0] != '\0' && ME_GOAHEAD_SSL_CERTIFICATE[0] != '\0') {
         if ((rc = mbedtls_ssl_conf_own_cert(conf, &cfg.cert, &cfg.pkey)) < 0) {
-            merror(rc, "Cannot define certificate and private key");
+
             return -1;
         }
     }
@@ -380,7 +377,7 @@ PUBLIC ssize sslRead(Webs *wp, void *buf, ssize len)
                 sp->flags |= SOCKET_EOF;
                 return -1;
             } else {
-                printf( "mbedtls: read error -0x%", -rc);
+                printf( "mbedtls: read error %d", rc);
                 sp->flags |= SOCKET_EOF;
                 return -1; 
             }
@@ -558,18 +555,6 @@ static void traceMbed(void *context, int level, cchar *file, int line, cchar *st
 }
 
 
-static void merror(int rc, char *fmt, ...)
-{
-    va_list     ap;
-    char        ebuf[ME_MAX_BUFFER];
-
-    va_start(ap, fmt);
-    mbedtls_strerror(-rc, ebuf, sizeof(ebuf));
-    printf("mbedtls", "mbedtls error: 0x%x %s %s", rc, sfmtv(fmt, ap), ebuf);
-    va_end(ap);
-}
-
-
 static char *replaceHyphen(char *cipher, char from, char to)
 {
     char    *cp;

+ 8 - 8
app/goahead-3.6.5/src/libipmi/src/libipmi_storlead_OEM.c

@@ -147,8 +147,8 @@ uint16_t IPMC_GetSysInfo( IPMI20_UDS_SESSION_T *pUDSSession, uint8_t IpmbAddr, S
 	Req[7] = 0;
 	Req[8] = 0;
 	Req[9] = 0;
-	Req[10] = (MAX_TITLE_LEN>>8)&0xff;	//max title len
-	Req[11] = MAX_TITLE_LEN&0xff;
+	Req[10] = MAX_TITLE_LEN&0xff;
+	Req[11] = (MAX_TITLE_LEN>>8)&0xff;	//max title len
 	Req[12] = 0x100 - (Req[4] + Req[5] + Req[6] + Req[7] + Req[8] + Req[9] + Req[10] + Req[11])&0xff;
 
 	//dwResLen = sizeof(GetDevIDRes_T);
@@ -163,8 +163,8 @@ uint16_t IPMC_GetSysInfo( IPMI20_UDS_SESSION_T *pUDSSession, uint8_t IpmbAddr, S
 		printf("---> get Title error\n");
 		return -1;
 	}
-	strLen = (Res[7]<<8) | Res[8];
-	remainLen = (Res[9]<<8) | Res[10];
+	strLen = (Res[8]<<8) | Res[7];
+	remainLen = (Res[10]<<8) | Res[9];
 	memcpy(pSysInfo->title,&Res[11],strLen);
 
 	//get text
@@ -178,8 +178,8 @@ uint16_t IPMC_GetSysInfo( IPMI20_UDS_SESSION_T *pUDSSession, uint8_t IpmbAddr, S
 	Req[7] = 1;
 	Req[8] = 0;
 	Req[9] = 0;
-	Req[10] = (MAX_TEXT_LEN>>8)&0xff;	//max text len
-	Req[11] = MAX_TEXT_LEN&0xff;
+	Req[10] = MAX_TEXT_LEN&0xff;
+	Req[11] = (MAX_TEXT_LEN>>8)&0xff;	//max text len
 	Req[12] = 0x100 - (Req[4] + Req[5] + Req[6] + Req[7] + Req[8] + Req[9] + Req[10] + Req[11])&0xff;
 
 	//dwResLen = sizeof(GetDevIDRes_T);
@@ -193,8 +193,8 @@ uint16_t IPMC_GetSysInfo( IPMI20_UDS_SESSION_T *pUDSSession, uint8_t IpmbAddr, S
 		printf("---> get Text error\n");
 		return -1;
 	}
-	strLen = (Res[7]<<8) | Res[8];
-	remainLen = (Res[9]<<8) | Res[10];
+	strLen = (Res[8]<<8) | Res[7];
+	remainLen = (Res[10]<<8) | Res[9];
 	memcpy(pSysInfo->text,&Res[11],strLen);
 	
 	return 0;