Hi,
What I would like to do is to read all kind of sensor data out of the BMC (Baseboard Management Controller), lets take for example the processor temperature.
I'm developing with C on a FreeBSD kernel. It's an Intel SE7210TP1-E TPS motherboard. It supports IPMI 2.0. And the mBMC chip on the motherboard is from National Semiconductor PC87431 interated management controller.
As far as I've found in the documentation the BMC can be accessed through two interfaces on this motherboard:
- SMBus
- LOM (Lan On Motherboard)
I would like to accomplish this using the SMBus, and can be found on /dev/smb0. This is working, but then find the BMC. So I scan through the addresses 0x20 till 0x4f and send the command 0x03 (Get UDID = get Unique Device Identifier) for this I take an SMB frame as in the machine/smb.h is defined. Looking in the documentation it explains that the Device capabilitities field within the UDID frame which is returned in the smb frame should have the value 38(dec). When trying this with the folowing code I don't get an result that make any sense????
I just got 4 responses from devices, and from the data returned I can't make up what devices they are?
It looks more if the data returned is incorrect, and have nothing to do with the request.
And now I got really stuck, any help or ideas will be appreciated!
Thanks,
Charl
What I would like to do is to read all kind of sensor data out of the BMC (Baseboard Management Controller), lets take for example the processor temperature.
I'm developing with C on a FreeBSD kernel. It's an Intel SE7210TP1-E TPS motherboard. It supports IPMI 2.0. And the mBMC chip on the motherboard is from National Semiconductor PC87431 interated management controller.
As far as I've found in the documentation the BMC can be accessed through two interfaces on this motherboard:
- SMBus
- LOM (Lan On Motherboard)
I would like to accomplish this using the SMBus, and can be found on /dev/smb0. This is working, but then find the BMC. So I scan through the addresses 0x20 till 0x4f and send the command 0x03 (Get UDID = get Unique Device Identifier) for this I take an SMB frame as in the machine/smb.h is defined. Looking in the documentation it explains that the Device capabilitities field within the UDID frame which is returned in the smb frame should have the value 38(dec). When trying this with the folowing code I don't get an result that make any sense????
Code:
#include <unistd.h>
#include <stdio.h>
#include <string.h>
#include <fcntl.h>
#include <machine/smb.h>
#include <stdlib.h>
#include <err.h>
/* scan */
int fd;
struct smbcmd s;
int i;
short n;
char data[32];
if ((fd = open("/dev/smb0", O_RDWR)) < 0)
warn("unable to open smb");
for (n = 0x20; n < 0x4f; n++) {
s.slave = n;
s.cmd = 3;
s.count = 17;
s.data.byte_ptr = data;
memset(s.data.byte_ptr, 0, s.count);
if (ioctl(fd, SMB_BREAD, &s) < 0)
continue;
printf("slave = 0x%02X data = ", n);
for (i = 0; i < s.count; i++) {
printf("%02X ",
((unsigned int)s.data.byte_ptr[i] & 0x00ff));
}
putchar('\n');
}
close(fd);
I just got 4 responses from devices, and from the data returned I can't make up what devices they are?
It looks more if the data returned is incorrect, and have nothing to do with the request.
And now I got really stuck, any help or ideas will be appreciated!
Thanks,
Charl