summaryrefslogtreecommitdiffstats
path: root/sys/dev/ipmi
diff options
context:
space:
mode:
authorjhb <jhb@FreeBSD.org>2006-10-05 15:38:59 +0000
committerjhb <jhb@FreeBSD.org>2006-10-05 15:38:59 +0000
commit88140f6436fa0f8b0fc6cca06c4a353d4b9ecf3c (patch)
treead8e2b461d8a3c7770e78da1b0ed10b692e619a4 /sys/dev/ipmi
parent4131837d351ce66f9a070dec90a1e0578a04695b (diff)
downloadFreeBSD-src-88140f6436fa0f8b0fc6cca06c4a353d4b9ecf3c.zip
FreeBSD-src-88140f6436fa0f8b0fc6cca06c4a353d4b9ecf3c.tar.gz
The IPMI spec is ambiguous (or rather, it contradicts itself) about whether
or not the OS has to wait for RX_RDY or TX_RDY to be set before the OS sets the control code in the control/status register. Looking at the interface design, it seems that RX_RDY and TX_RDY are probably there to protect access to the data register and have nothing to do with the control/status register. Nevertheless, try to take what I think is the more conservative approach and always wait for the appropriate [TR]X_RDY flag to be set before writing any of the WR_NEXT, WR_END, RD_START, or RD_NEXT control codes to the control/status register.
Diffstat (limited to 'sys/dev/ipmi')
-rw-r--r--sys/dev/ipmi/ipmi_smic.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/sys/dev/ipmi/ipmi_smic.c b/sys/dev/ipmi/ipmi_smic.c
index facb8b3..c1c69b3 100644
--- a/sys/dev/ipmi/ipmi_smic.c
+++ b/sys/dev/ipmi/ipmi_smic.c
@@ -127,8 +127,8 @@ smic_write_next(struct ipmi_softc *sc, u_char data)
{
u_char error, status;
- OUTB(sc, SMIC_CTL_STS, SMIC_CC_SMS_WR_NEXT);
smic_wait_for_tx_okay(sc);
+ OUTB(sc, SMIC_CTL_STS, SMIC_CC_SMS_WR_NEXT);
OUTB(sc, SMIC_DATA, data);
smic_set_busy(sc);
smic_wait_for_not_busy(sc);
@@ -151,8 +151,8 @@ smic_write_last(struct ipmi_softc *sc, u_char data)
{
u_char error, status;
- OUTB(sc, SMIC_CTL_STS, SMIC_CC_SMS_WR_END);
smic_wait_for_tx_okay(sc);
+ OUTB(sc, SMIC_CTL_STS, SMIC_CC_SMS_WR_END);
OUTB(sc, SMIC_DATA, data);
smic_set_busy(sc);
smic_wait_for_not_busy(sc);
@@ -176,8 +176,8 @@ smic_start_read(struct ipmi_softc *sc, u_char *data)
smic_wait_for_not_busy(sc);
- OUTB(sc, SMIC_CTL_STS, SMIC_CC_SMS_RD_START);
smic_wait_for_rx_okay(sc);
+ OUTB(sc, SMIC_CTL_STS, SMIC_CC_SMS_RD_START);
smic_set_busy(sc);
smic_wait_for_not_busy(sc);
status = INB(sc, SMIC_CTL_STS);
@@ -200,8 +200,8 @@ smic_read_byte(struct ipmi_softc *sc, u_char *data)
{
u_char error, status;
- OUTB(sc, SMIC_CTL_STS, SMIC_SC_SMS_RD_NEXT);
smic_wait_for_rx_okay(sc);
+ OUTB(sc, SMIC_CTL_STS, SMIC_SC_SMS_RD_NEXT);
smic_set_busy(sc);
smic_wait_for_not_busy(sc);
status = INB(sc, SMIC_CTL_STS);
OpenPOWER on IntegriCloud