Index: uspace/drv/bus/isa/i8237.c
===================================================================
--- uspace/drv/bus/isa/i8237.c	(revision f3fb83a6c71b3d6adb5e181dd5b7807c2ca5d6a9)
+++ uspace/drv/bus/isa/i8237.c	(revision 3869c596514bee286166c5bb5cee3ebc8fa326b3)
@@ -38,8 +38,8 @@
 #include <bool.h>
 #include <errno.h>
+#include <ddi.h>
+#include <ddf/log.h>
 #include <fibril_synch.h>
-#include <ddi.h>
 #include <libarch/ddi.h>
-#include <ddf/log.h>
 #include "i8237.h"
 
@@ -454,5 +454,5 @@
  * @return Error code.
  */
-int dma_channel_remain(unsigned channel, uint16_t *size)
+int dma_channel_remain(unsigned channel, size_t *size)
 {
 	assert(size);
@@ -484,7 +484,11 @@
 	fibril_mutex_unlock(&guard);
 
-	const int remain = (value_high << 8 | value_low) + 1;
-	/* 16 bit DMA size is in words */
-	*size =  is_dma16(channel) ? remain << 1 : remain;
+	uint16_t remain = (value_high << 8 | value_low) ;
+	/* 16 bit DMA size is in words,
+	 * the upper bits are bogus for 16bit transfers so we need to get
+	 * rid of them. Using limited type works well.*/
+	if (is_dma16(channel))
+		remain <<= 1;
+	*size =  is_dma16(channel) ? remain + 2: remain + 1;
 	return EOK;
 }
Index: uspace/drv/bus/isa/i8237.h
===================================================================
--- uspace/drv/bus/isa/i8237.h	(revision f3fb83a6c71b3d6adb5e181dd5b7807c2ca5d6a9)
+++ uspace/drv/bus/isa/i8237.h	(revision 3869c596514bee286166c5bb5cee3ebc8fa326b3)
@@ -39,5 +39,5 @@
 
 extern int dma_channel_setup(unsigned, uint32_t, uint16_t, uint8_t);
-extern int dma_channel_remain(unsigned, uint16_t *);
+extern int dma_channel_remain(unsigned, size_t *);
 
 #endif
Index: uspace/drv/bus/isa/isa.c
===================================================================
--- uspace/drv/bus/isa/isa.c	(revision f3fb83a6c71b3d6adb5e181dd5b7807c2ca5d6a9)
+++ uspace/drv/bus/isa/isa.c	(revision 3869c596514bee286166c5bb5cee3ebc8fa326b3)
@@ -170,5 +170,5 @@
 
 static int isa_fun_remain_dma(ddf_fun_t *fnode,
-    unsigned channel, uint16_t *size)
+    unsigned channel, size_t *size)
 {
 	assert(size);
Index: uspace/lib/drv/generic/remote_hw_res.c
===================================================================
--- uspace/lib/drv/generic/remote_hw_res.c	(revision f3fb83a6c71b3d6adb5e181dd5b7807c2ca5d6a9)
+++ uspace/lib/drv/generic/remote_hw_res.c	(revision 3869c596514bee286166c5bb5cee3ebc8fa326b3)
@@ -130,5 +130,5 @@
 	}
 	const unsigned channel = DEV_IPC_GET_ARG1(*call);
-	uint16_t remain = 0;
+	size_t remain = 0;
 	const int ret = hw_res_ops->dma_channel_remain(fun, channel, &remain);
 	async_answer_1(callid, ret, remain);
Index: uspace/lib/drv/include/ops/hw_res.h
===================================================================
--- uspace/lib/drv/include/ops/hw_res.h	(revision f3fb83a6c71b3d6adb5e181dd5b7807c2ca5d6a9)
+++ uspace/lib/drv/include/ops/hw_res.h	(revision 3869c596514bee286166c5bb5cee3ebc8fa326b3)
@@ -45,5 +45,5 @@
 	bool (*enable_interrupt)(ddf_fun_t *);
 	int (*dma_channel_setup)(ddf_fun_t *, unsigned, uint32_t, uint16_t, uint8_t);
-	int (*dma_channel_remain)(ddf_fun_t *, unsigned, uint16_t *);
+	int (*dma_channel_remain)(ddf_fun_t *, unsigned, size_t *);
 } hw_res_ops_t;
 
