From owner-freebsd-current Sun Feb 14 08:08:05 1999 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id IAA08646 for freebsd-current-outgoing; Sun, 14 Feb 1999 08:08:05 -0800 (PST) (envelope-from owner-freebsd-current@FreeBSD.ORG) Received: from reliam.teaser.fr (reliam.teaser.fr [194.51.80.12]) by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id IAA08603; Sun, 14 Feb 1999 08:08:00 -0800 (PST) (envelope-from son@teaser.fr) Received: from teaser.fr (ppp1087-ft.teaser.fr [194.206.156.40]) by reliam.teaser.fr (8.9.1a/8.9.1a) with ESMTP id RAA16800; Sun, 14 Feb 1999 17:07:51 +0100 (MET) Received: (from son@localhost) by teaser.fr (8.9.2/8.9.1) id PAA02961; Sun, 14 Feb 1999 15:52:32 +0100 (CET) (envelope-from son) Message-ID: <19990214155232.61732@breizh.prism.uvsq.fr> Date: Sun, 14 Feb 1999 15:52:32 +0100 From: Nicolas Souchu To: Brian Feldman Cc: hardware@FreeBSD.ORG, current@FreeBSD.ORG Subject: Re: Aladdin chipset SMBus support available! References: <19990214095845.56909@breizh.prism.uvsq.fr> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="Mm9M+Fa2AknHoGS/" X-Mailer: Mutt 0.81e In-Reply-To: ; from Brian Feldman on Sun, Feb 14, 1999 at 08:40:11AM -0500 X-Operating-System: FreeBSD breizh 4.0-CURRENT FreeBSD 4.0-CURRENT Sender: owner-freebsd-current@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG --Mm9M+Fa2AknHoGS/ Content-Type: text/plain; charset=us-ascii On Sun, Feb 14, 1999 at 08:40:11AM -0500, Brian Feldman wrote: > >On Sun, 14 Feb 1999, Nicolas Souchu wrote: > >> On Sat, Feb 13, 1999 at 05:22:00PM -0500, Brian Feldman wrote: >> > >> >On Sat, 13 Feb 1999, Nicolas Souchu wrote: >> > >> >> Example program to fetch temperature or voltages is available at >> >> http://www.planet.sci.kobe-u.ac.jp/~takawata/smbus/examples/ >> >> There's also an example program to fetch SDRAM info over the smbus. >> >> I attach you the detect.c program. It's very simple and may help us >> in knowing what I2C hardware you have on your mobo. > >Where's my detect.c? I think you forgot to attach it :) :) here it is! > >> >I tried them, and there's the problem: all the ioctl()s they perform return >> >EINTR! Has this driver been tested on many motherboards? Why should I expect >> >an EINTR? Just wondering :) >> >> EINTR is odd. It just mean that the device at the address requested on the >> I2C bus do not respond. I have to translate SMBus errors to the appropriate >> unix ones. > >Hmm... wouldn't the appropriate error for something not responding be an >ENXIO or ETIMEDOUT? EINTR seems more than a little wrong for this purpouse. Fix committed. BTW, as outlined by -pkh all this is just a first step in a huge monitoring adventure where all still need to be _defined_ (architecture and interfaces) and implemented. Any proposition for doing the job is wellcome, since I just have enough time to do the hardware SMBus support. Nicholas -- nsouch@teaser.fr / nsouch@freebsd.org FreeBSD - Turning PCs into workstations - http://www.FreeBSD.org --Mm9M+Fa2AknHoGS/ Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename="detect.c" /*- * Copyright (c) 1999 Nicolas Souchu * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * * [id for your version control system, if any] */ /*This program is prototype version. I'll write better one*/ #include #include #include const double vfactor[]={1,1,1,1.67,4,-4,-1.67}; const char *Inpname[]={ "Vcore","Vit","VIO","+5V","+12V","-12V","-5V" }; int doioctl(int alias, int cmd, caddr_t param) { int error = 1; int retry = 3; while (error && retry--) { usleep(200); error = ioctl(alias, cmd, param); } return (error); } int main (int argc,char argv[]) { int alias, i; unsigned char byte=0; struct smbcmd cmd; bzero(&cmd, sizeof(cmd)); cmd.data.byte_ptr = &byte; alias = open("/dev/smb0", O_RDWR); for (i=2; i<254; i+=2) { cmd.slave=(u_char)i; if(doioctl(alias, SMB_RECVB, (caddr_t)&cmd)!=-1){ printf("%x found.\n",i); } } close(alias); return 0; } --Mm9M+Fa2AknHoGS/-- To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-current" in the body of the message