Index: uspace/lib/nic/src/nic_ev.c
===================================================================
--- uspace/lib/nic/src/nic_ev.c	(revision 8d7ec69d8e6ebbc57c70b70b6ed09ed1b8ceba0c)
+++ uspace/lib/nic/src/nic_ev.c	(revision 2df6f6fe4f21b8f1ebefce19a6d94cd3137976f0)
@@ -38,4 +38,5 @@
 #include <async.h>
 #include <device/nic.h>
+#include <errno.h>
 #include "nic_ev.h"
 
Index: uspace/lib/nic/src/nic_impl.c
===================================================================
--- uspace/lib/nic/src/nic_impl.c	(revision 8d7ec69d8e6ebbc57c70b70b6ed09ed1b8ceba0c)
+++ uspace/lib/nic/src/nic_impl.c	(revision 2df6f6fe4f21b8f1ebefce19a6d94cd3137976f0)
@@ -36,4 +36,5 @@
  */
 
+#include <errno.h>
 #include <str_error.h>
 #include <ipc/services.h>
Index: uspace/lib/nic/src/nic_rx_control.c
===================================================================
--- uspace/lib/nic/src/nic_rx_control.c	(revision 8d7ec69d8e6ebbc57c70b70b6ed09ed1b8ceba0c)
+++ uspace/lib/nic/src/nic_rx_control.c	(revision 2df6f6fe4f21b8f1ebefce19a6d94cd3137976f0)
@@ -40,7 +40,6 @@
 #include <bool.h>
 #include <errno.h>
-#include <net/device.h>
-#include <net_checksum.h>
-#include <packet_client.h>
+#include <mem.h>
+#include <nic/nic.h>
 #include "nic_rx_control.h"
 
@@ -488,4 +487,43 @@
 }
 
+/** Polynomial used in multicast address hashing */
+#define CRC_MCAST_POLYNOMIAL  0x04c11db6
+
+/** Compute the standard hash from MAC
+ *
+ * Hashing MAC into 64 possible values and using the value as index to
+ * 64bit number.
+ *
+ * The code is copied from qemu-0.13's implementation of ne2000 and rt8139
+ * drivers, but according to documentation there it originates in FreeBSD.
+ *
+ * @param[in] addr The 6-byte MAC address to be hashed
+ *
+ * @return 64-bit number with only single bit set to 1
+ *
+ */
+static uint64_t multicast_hash(const uint8_t addr[6])
+{
+	uint32_t crc;
+    int carry, i, j;
+    uint8_t b;
+
+    crc = 0xffffffff;
+    for (i = 0; i < 6; i++) {
+        b = addr[i];
+        for (j = 0; j < 8; j++) {
+            carry = ((crc & 0x80000000L) ? 1 : 0) ^ (b & 0x01);
+            crc <<= 1;
+            b >>= 1;
+            if (carry)
+                crc = ((crc ^ CRC_MCAST_POLYNOMIAL) | carry);
+        }
+    }
+	
+    uint64_t one64 = 1;
+    return one64 << (crc >> 26);
+}
+
+
 /**
  * Computes hash for the address list based on standard multicast address
Index: uspace/lib/nic/src/nic_wol_virtues.c
===================================================================
--- uspace/lib/nic/src/nic_wol_virtues.c	(revision 8d7ec69d8e6ebbc57c70b70b6ed09ed1b8ceba0c)
+++ uspace/lib/nic/src/nic_wol_virtues.c	(revision 2df6f6fe4f21b8f1ebefce19a6d94cd3137976f0)
@@ -38,4 +38,5 @@
 #include "nic_wol_virtues.h"
 #include <assert.h>
+#include <errno.h>
 
 #define NIC_WV_HASH_COUNT 32
