From f85b8b834b7ff85c80503faa73f237040330087b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rg=20Frings-F=C3=BCrst?= Date: Tue, 3 Jan 2017 02:33:44 +0100 Subject: New upstream version 3.0.1 --- util/ipmidir.c | 31 ++++++++++++++++++------------- 1 file changed, 18 insertions(+), 13 deletions(-) (limited to 'util/ipmidir.c') diff --git a/util/ipmidir.c b/util/ipmidir.c index 2aeb6f3..12b379c 100644 --- a/util/ipmidir.c +++ b/util/ipmidir.c @@ -415,13 +415,13 @@ int ipmi_open_direct(int fdebugcmd) g_DriverType = DRV_SMB; mBMC_baseAddr = mybase; } else { /*0x01==KCS*/ - g_DriverType = DRV_KCS; + g_DriverType = DRV_KCS; + BMC_base = mybase; if (sa == 0x20 && mybase != 0) { /*valid*/ kcsBaseAddress = mybase; kcs_inc = inc; } } - BMC_base = mybase; DBGP("smbios: Driver=%d(%s), sa=%02x, Base=0x%04x, Spacing=%d\n", g_DriverType,BmcDesc(g_DriverType),sa,mybase,inc); } else { @@ -1207,7 +1207,7 @@ int ImbInit_dir(void) uchar iftype, iver, sa, inc; int mybase, status; char *ifstr; - status = get_IpmiStruct(&iftype,&iver,&sa,&mybase,&inc); + status = get_IpmiStruct(&iftype,&iver,&sa,&mybase,&inc); if (status == 0) { if (iftype == 0x04) { g_DriverType = DRV_SMB; @@ -1215,13 +1215,13 @@ int ImbInit_dir(void) mBMC_baseAddr = mybase; } else /*0x01==KCS*/ { g_DriverType = DRV_KCS; + BMC_base = mybase; ifstr = "KCS"; if (sa == BMC_SA && mybase != 0) { /*valid*/ kcsBaseAddress = mybase; kcs_inc = inc; } } - BMC_base = mybase; DBGP("SMBIOS IPMI Record found: type=%s sa=%02x base=0x%04x spacing=%d\n", ifstr, sa, mybase, inc); } @@ -1230,9 +1230,14 @@ int ImbInit_dir(void) /* Use KCS here. There are no known SMBus implementations on 64-bit */ if (BMC_base == 0) { DBGP("No IPMI Data Structure Found in SMBIOS Table,\n"); +#ifdef TRY_KCS g_DriverType = DRV_KCS; - BMC_base = kcsBaseAddress; + BMC_base = kcsBaseAddress; DBGP("Continuing with KCS on Default Port 0x%04x\n",kcsBaseAddress); +#else + printf("No IPMI interface detected...Exiting\n"); + return ERR_NO_DRV; +#endif } #if defined(BSD) || defined(MACOS) || defined(HPUX) iofd = open("/dev/io",O_RDWR); @@ -1242,14 +1247,14 @@ int ImbInit_dir(void) } #endif if (g_DriverType == DRV_SMB) { - /* Perhaps add controller type in ipmi_if.txt (?)*/ - /* Intel SSIF: 0x0540=SJR, 0x0400=STP */ - if (mBMC_baseAddr == 0x540 || mBMC_baseAddr == 0x400) - SMBChar.Controller = INTEL_SMBC; - else /*else try ServerWorks*/ - SMBChar.Controller = SW_SMBC; - SMBChar.baseAddr = mBMC_baseAddr; - DBGP("BMC SSIF/SMBus Interface at i2c=%02x base=0x%04x\n", + /* Perhaps add controller type in ipmi_if.txt (?)*/ + /* Intel SSIF: 0x0540=SJR, 0x0400=STP */ + if (mBMC_baseAddr == 0x540 || mBMC_baseAddr == 0x400) + SMBChar.Controller = INTEL_SMBC; + else /*else try ServerWorks*/ + SMBChar.Controller = SW_SMBC; + SMBChar.baseAddr = mBMC_baseAddr; + DBGP("BMC SSIF/SMBus Interface at i2c=%02x base=0x%04x\n", mBMCADDR,mBMC_baseAddr); } if (g_DriverType == DRV_KCS) { -- cgit v1.2.3