Index: uspace/drv/bus/isa/i8237.c
===================================================================
--- uspace/drv/bus/isa/i8237.c	(revision ed54cbf0d362d153952ab297bf6cce629fa4712b)
+++ 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 ed54cbf0d362d153952ab297bf6cce629fa4712b)
+++ 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 ed54cbf0d362d153952ab297bf6cce629fa4712b)
+++ 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);
