aboutsummaryrefslogtreecommitdiff
path: root/libmpio
diff options
context:
space:
mode:
authorgermeier <germeier>2003-04-04 22:03:05 +0000
committergermeier <germeier>2003-04-04 22:03:05 +0000
commitd989a4d17fc77800aaf0f77797443e8774870492 (patch)
tree4a8aef688e9b8563365e3b09a085e9ec2daaa509 /libmpio
parentd4d11b88543f0384b0980d7d2a2d638d0160f216 (diff)
downloadmpiosh-d989a4d17fc77800aaf0f77797443e8774870492.tar.gz
mpiosh-d989a4d17fc77800aaf0f77797443e8774870492.tar.bz2
mpiosh-d989a4d17fc77800aaf0f77797443e8774870492.zip
some necessary fixes to internal mem "size" handling
Diffstat (limited to 'libmpio')
-rw-r--r--libmpio/io.c9
-rw-r--r--libmpio/io.h6
2 files changed, 8 insertions, 7 deletions
diff --git a/libmpio/io.c b/libmpio/io.c
index 3022103..1d1f213 100644
--- a/libmpio/io.c
+++ b/libmpio/io.c
@@ -2,7 +2,7 @@
/*
*
- * $Id: io.c,v 1.23 2003/03/15 14:34:44 germeier Exp $
+ * $Id: io.c,v 1.24 2003/04/04 22:03:05 germeier Exp $
*
* Library for USB MPIO-*
*
@@ -473,7 +473,7 @@ mpio_zone_block_get_logical(mpio_t *m, mpio_cmd_t mem, DWORD pblock)
int
mpio_io_set_cmdpacket(mpio_t *m, mpio_cmd_t cmd, mpio_mem_t mem, DWORD index,
- BYTE size, BYTE wsize, BYTE *buffer)
+ WORD size, BYTE wsize, BYTE *buffer)
{
BYTE memory;
@@ -963,7 +963,7 @@ mpio_io_block_read(mpio_t *m, mpio_mem_t mem, mpio_fatentry_t *f, BYTE *output)
*/
int
-mpio_io_spare_read(mpio_t *m, BYTE mem, DWORD index, BYTE size,
+mpio_io_spare_read(mpio_t *m, BYTE mem, DWORD index, WORD size,
BYTE wsize, BYTE *output, int toread,
mpio_callback_init_t progress_callback)
{
@@ -983,7 +983,8 @@ mpio_io_spare_read(mpio_t *m, BYTE mem, DWORD index, BYTE size,
{
if (mem == MPIO_INTERNAL_MEM)
mpio_io_set_cmdpacket(m, GET_SPARE_AREA, (1 << (chip-1)),
- index, size, wsize, cmdpacket);
+ index, (size / sm->chips),
+ wsize, cmdpacket);
if (mem == MPIO_EXTERNAL_MEM)
mpio_io_set_cmdpacket(m, GET_SPARE_AREA, mem, index, size,
wsize, cmdpacket);
diff --git a/libmpio/io.h b/libmpio/io.h
index 8c41144..1c2baf9 100644
--- a/libmpio/io.h
+++ b/libmpio/io.h
@@ -2,7 +2,7 @@
/*
*
- * $Id: io.h,v 1.12 2002/10/26 13:07:43 germeier Exp $
+ * $Id: io.h,v 1.13 2003/04/04 22:03:05 germeier Exp $
*
* Library for USB MPIO-*
*
@@ -65,7 +65,7 @@ WORD mpio_zone_block_get_logical(mpio_t *, mpio_cmd_t, DWORD);
/* real I/O */
int mpio_io_set_cmdpacket(mpio_t *, mpio_cmd_t, mpio_mem_t,
- DWORD, BYTE, BYTE, BYTE *);
+ DWORD, WORD, BYTE, BYTE *);
int mpio_io_bulk_read (int, BYTE *, int);
int mpio_io_bulk_write(int, BYTE *, int);
@@ -85,7 +85,7 @@ int mpio_io_block_delete(mpio_t *, mpio_mem_t, mpio_fatentry_t *);
int mpio_io_block_delete_phys(mpio_t *, BYTE, DWORD);
/* */
-int mpio_io_spare_read (mpio_t *, BYTE, DWORD, BYTE, BYTE, BYTE *, int,
+int mpio_io_spare_read (mpio_t *, BYTE, DWORD, WORD, BYTE, BYTE *, int,
mpio_callback_init_t);
#ifdef __cplusplus