Hi guys!
Small update. I (finally!) managed how to provide scan results to 80211 stack of MacOS. Here's screenshot:
View attachment 339244
View attachment 339246
Name of the network here is the one from my router. I just grabbed all the information from beacon via Wireshark.
It took me quite a long time to figure out why I don't see any results while I was providing it correctly. A couple of days ago I found out that it's possible to enable airport logging that's very useful and showed me that during scan, no matter what result I return, it was thinking that device is busy. This comes from the fact that if you implement some of IOCTL calls to return valid result, airport will be thinking that you're trying to associate with the network.
So, the next step I'll take is merging part of black80211 codebase into IntelWifi. Since IntelWifi is able to receive beacon frames from outside world, the result should be quite interesting: it will be possible to see the networks that you have nearby in Network preferences.
P.S. Previously I was going to implement KDP for Realtek8111 for easier debugging of my kexts, but finally I realised that it will take a lot of time because I need to understand in details how Realtek Ethernet devices work. Since KDP activates only when kernel is in panic, I'm absolutely blind, because in kernel panic system is absolutely unresponsive and the only way to check that you're succeeded in implementation is to try to connect to machine with debugger. Connected - you've done everything right. Not connected - something is wrong, what's wrong? - something somewhere. So, for now I decided to postpone this work till better times.