[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
RE: [Freeipmi-devel] Return code of ipmi_lan_cmd()
From: |
Cress, Andrew R |
Subject: |
RE: [Freeipmi-devel] Return code of ipmi_lan_cmd() |
Date: |
Wed, 10 Nov 2004 12:25:10 -0500 |
Al,
Which method did you choose? Is that Method B below?
Andy
Method A:
Since the _cmd routine already knows the completion code, my original
proposal was:
-1 is for failure (can't send/recv the command for some reason)
0 is for success
!0 is for completion code errors (command delivered, but BMC has an
issue with it)
All 3 cases have unique return values. 0xFF is not a valid completion
code, so no overlap. the disadvantage is that the return value is a
signed 8-bit value, not an int, so completion codes like 0xc0 could be
ambiguous wrt sign.
Method B:
One alternative, used by some IPMI drivers, would be:
-1 is for failure
0 is for success, and completion code errors
This isn't as clean, but is workable, since on 0 return, we are assured
that the completion code has at least been set to something (0 or
non-zero). It can be misleading for applications that don't pay
attention to the completion code, though, and assume that 0 return means
that the rest of the response data is good.
Method C:
The previous code had this:
-1 for failure, and completion code errors
0 for success
This doesn't work because the completion code may or may not be
initialized, so the caller can't tell the difference between these
cases.
Method D:
-2 is for completion code errors
-1 is for general failure
0 is for success
Has the advantage that 0 is only for success, but requires the
application to retrieve the completion code if -2 is returned.
---
Andy Cress 803-216-2356 fax:803-216-2178
Senior Software Engineer address@hidden
Intel Corporation, Columbia Design Center, CBA1
100 Center Point Cir., Suite 200, Columbia, SC 29210
http://ipmiutil.sf.net http://scsirastools.sf.net
BTW, I speak for myself, not for Intel Corp.
"Do not merely look out for your own personal interests, but also for
the interests of others." Phil 2:4
-----Original Message-----
From: address@hidden
[mailto:address@hidden On
Behalf Of Albert Chu
Sent: Wednesday, November 10, 2004 11:32 AM
To: address@hidden
Subject: [Freeipmi-devel] Return code of ipmi_lan_cmd()
The ipmi_lan_cmd() return code has been modified to reflect the same
return code style in ipmi_kcs_cmd().
Al
--
Albert Chu
address@hidden
Lawrence Livermore National Laboratory
_______________________________________________
Freeipmi-devel mailing list
address@hidden
http://lists.gnu.org/mailman/listinfo/freeipmi-devel