staging: rtl8188eu: Introduce monitor interface for IEEE 802.11 frames
[cascardo/linux.git] / drivers / staging / rtl8188eu / core / rtw_recv.c
index 44eeb03..cb90ad5 100644 (file)
@@ -25,6 +25,7 @@
 #include <drv_types.h>
 #include <recv_osdep.h>
 #include <mlme_osdep.h>
+#include <mon.h>
 #include <wifi.h>
 #include <linux/vmalloc.h>
 
@@ -1329,6 +1330,19 @@ static int validate_recv_frame(struct adapter *adapter,
                break;
        }
 
+       /*
+        * This is the last moment before management and control frames get
+        * discarded. So we need to forward them to the monitor now or never.
+        *
+        * At the same time data frames can still be encrypted if software
+        * decryption is in use. However, decryption can occur not until later
+        * (see recv_func()).
+        *
+        * Hence forward the frame to the monitor anyway to preserve the order
+        * in which frames were received.
+        */
+       rtl88eu_mon_recv_hook(adapter->pmondev, precv_frame);
+
 exit:
 
        return retval;