wtap(4): support hostap/sta mode and WPA/WPA2
Wtap originally only supported mesh/ad-hoc mode, and cannot be combined with wpa_supplicant(8) and hostapd(8).
Now I have supported hostap and sta mode by simply ORing IEEE80211_C_HOSTAP and IEEE80211_C_STA in ic->caps,and hostapd(8) since it's unaware of encryption/decryption. Now I have supported hostap and sta mode
and making hostap vap can send beacon frame. The beacon frame-sending mechanism is already done in
mesh/ad-hoc modewith WPA/WPA2, so simplythus now wtap(4) can be use itd with hostapd(8) and wpa_supplicant(8).
There is a problem when combining wtap(4) with wpa_supplicant(8):
A race is introduced bybetween net80211's scan request and wpa_supplicant's scan request, which
and if ic->parent inall of the net80211(4) drivers (yes,will face. all of 802.11 drivers) finished too quickly,D38753 introduces the problem, and D38807 fixes the problem with
wpa_supplicant's scan request wonly real world NIC, wtap(4) still lose net80211's scan request and leads tofails because ic->ic_parent() finish too quick (more details
a connection-fail problem. D38753 introduces the problem, and D38807 fix the problem with
real world NIC (ic->parent takes time), but wtap(4) (ic->parent finishes too quick).
I have solved this problem by making wtap(4) sleeping for a while in ic->parentcan be found in D38508). NowI have solved this problem by making wtap(4) supportsleep for a while in
ic->ic_parent(). Now wtap(4) supports wpa_supplicant(8) and hostapd(8) well.
This patch depends on D37973 and D38807.