nl80211 is the interface between user space software (iw, wpa_supplicant, etc.) and the kernel (cfg80211 and mac80211 kernel modules, and specific drivers)
nl80211 is a sub-module of cfg80211 in kernel, which is in charge of:
Register a generic netlink(nl) family “nl80211”
Hande the message for “nl80211” generic nl family from userpace via libnl
Send message to userspace program which is participate in monitoring the generic nl family “nl80211”
libnl is a library that provide many APIs for userspace program to communicate with the kernel throught nl
libnl - provide fundamental functions for constructing nl connection, message, ...
libnl-genl - provide functions to communicate with generic nl family in kernel