Index: uspace/lib/c/generic/device/hw_res.c
===================================================================
--- uspace/lib/c/generic/device/hw_res.c	(revision 1bebadeef8c0e20e4858c16afc1cb5411a16aeaa)
+++ uspace/lib/c/generic/device/hw_res.c	(revision 86fe9d11bb24da4ce5f5aee7b0de493478065508)
@@ -115,4 +115,23 @@
 }
 
+/**
+ * Query remaining bytes in the buffer.
+ * @param channel DMA Channel 1,2,3 for 8 bit transfers, 5,6,7 for 16 bit.
+ * @return Number of bytes remaining in the buffer(>=0) or error code(<0).
+ */
+int hw_res_dma_channel_remain(async_sess_t *sess, unsigned channel)
+{
+	async_exch_t *exch = async_exchange_begin(sess);
+	if (exch == NULL)
+		return ENOMEM;
+	sysarg_t remain;
+	const int ret = async_req_2_1(exch, DEV_IFACE_ID(HW_RES_DEV_IFACE),
+	    HW_RES_DMA_CHANNEL_REMAIN, channel, &remain);
+	async_exchange_end(exch);
+	if (ret == EOK)
+		return remain;
+	return ret;
+}
+
 /** @}
  */
Index: uspace/lib/c/include/device/hw_res.h
===================================================================
--- uspace/lib/c/include/device/hw_res.h	(revision 1bebadeef8c0e20e4858c16afc1cb5411a16aeaa)
+++ uspace/lib/c/include/device/hw_res.h	(revision 86fe9d11bb24da4ce5f5aee7b0de493478065508)
@@ -53,4 +53,5 @@
 	HW_RES_ENABLE_INTERRUPT,
 	HW_RES_DMA_CHANNEL_SETUP,
+	HW_RES_DMA_CHANNEL_REMAIN,
 } hw_res_method_t;
 
@@ -116,4 +117,5 @@
 extern int hw_res_dma_channel_setup(async_sess_t *, unsigned int, uint32_t,
     uint16_t, uint8_t);
+extern int hw_res_dma_channel_remain(async_sess_t *, unsigned);
 
 #endif
