Module Name: src
Committed By: pgoyette
Date: Sat May 9 07:13:57 UTC 2009
Modified Files:
src/sys/dev/pci: nfsmb.c
Log Message:
For multi-byte transfers, the bytes need to be written to or read from
consecutive data registers. Discovered while debugging sdtemp(4) driver
which does _only_ 16-bit transfers!
To generate a diff of this commit:
cvs rdiff -u -r1.19 -r1.20 src/sys/dev/pci/nfsmb.c
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/sys/dev/pci/nfsmb.c
diff -u src/sys/dev/pci/nfsmb.c:1.19 src/sys/dev/pci/nfsmb.c:1.20
--- src/sys/dev/pci/nfsmb.c:1.19 Sat May 9 04:56:39 2009
+++ src/sys/dev/pci/nfsmb.c Sat May 9 07:13:57 2009
@@ -1,4 +1,4 @@
-/* $NetBSD: nfsmb.c,v 1.19 2009/05/09 04:56:39 pgoyette Exp $ */
+/* $NetBSD: nfsmb.c,v 1.20 2009/05/09 07:13:57 pgoyette Exp $ */
/*
* Copyright (c) 2007 KIYOHARA Takashi
* All rights reserved.
@@ -26,7 +26,7 @@
*
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: nfsmb.c,v 1.19 2009/05/09 04:56:39 pgoyette Exp $");
+__KERNEL_RCSID(0, "$NetBSD: nfsmb.c,v 1.20 2009/05/09 07:13:57 pgoyette Exp $");
#include <sys/param.h>
#include <sys/device.h>
@@ -422,7 +422,7 @@
low = val;
bus_space_write_1(sc->sc_iot, sc->sc_ioh, NFORCE_SMB_DATA, low);
high = val >> 8;
- bus_space_write_1(sc->sc_iot, sc->sc_ioh, NFORCE_SMB_DATA, high);
+ bus_space_write_1(sc->sc_iot, sc->sc_ioh, NFORCE_SMB_DATA + 1, high);
/* write smbus slave address to register */
data = addr << 1;
@@ -510,6 +510,6 @@
/* read data */
low = bus_space_read_1(sc->sc_iot, sc->sc_ioh, NFORCE_SMB_DATA);
- high = bus_space_read_1(sc->sc_iot, sc->sc_ioh, NFORCE_SMB_DATA);
+ high = bus_space_read_1(sc->sc_iot, sc->sc_ioh, NFORCE_SMB_DATA + 1);
return low | high << 8;
}