diff options
author | Jörg Frings-Fürst <debian@jff-webhosting.net> | 2017-01-03 02:33:44 +0100 |
---|---|---|
committer | Jörg Frings-Fürst <debian@jff-webhosting.net> | 2017-01-03 02:33:44 +0100 |
commit | f85b8b834b7ff85c80503faa73f237040330087b (patch) | |
tree | 595cb1ac38c0a8222c9a768b3c0523e36c063be4 /util/ipmidir.c | |
parent | db5e8f26947114f06480dd22b9db7e22e50ee133 (diff) |
New upstream version 3.0.1upstream/3.0.1
Diffstat (limited to 'util/ipmidir.c')
-rw-r--r-- | util/ipmidir.c | 31 |
1 files changed, 18 insertions, 13 deletions
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) { |