For Programmers: Free Programming Magazines  


Home > Archive > Unix Programming > December 2004 > SMBus find devices









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author SMBus find devices
RedLion

2004-09-29, 5:00 am

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????

[code sample]
#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);
[/code sample]

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
Ian Zimmerman

2004-12-21, 3:56 am


Charl> Hi, What I would like to do is to read all kind of sensor data
Charl> out of the BMC (Baseboard Management Controller), lets take for
Charl> example the processor temperature.

<plug>
http://savannah.gnu.org/projects/freeipmi
</plug>

--
"It's not true or not." A reality show producer (real quote)
Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com