I've been trying to wrap my head around how the wpa_supplicant interacts with the 80211 stack.
One of the things I see in the wpa_supplicant code are calls to ioctls like:
Here global->sock is assigned by simply doing a:
Additionally, the ioctl call seems to land in net80211/ieee80211_ioctl.c in a function called ieee80211_ioctl.
What I can't figure out is how do we go from the ioctl() call and end up in ieee80211_ioctl().
My hunch is that there is either some dispatch code that does a table lookup somewhere and then jumps to the appropriate function, or there's a linker set somewhere that somehow allows the ioctl call to directly land where it needs to (wild guess).
I'd be really interested in learning how this mechanism works, so any links to documentation or perhaps source files I should be looking at would be greatly welcomed.
Thank you.
One of the things I see in the wpa_supplicant code are calls to ioctls like:
Code:
ioctl(drv->global->sock, SIOCGIFMEDIA, &ifmr)
Here global->sock is assigned by simply doing a:
Code:
global->sock = socket(PF_INET, SOCK_DGRAM, 0);
Additionally, the ioctl call seems to land in net80211/ieee80211_ioctl.c in a function called ieee80211_ioctl.
What I can't figure out is how do we go from the ioctl() call and end up in ieee80211_ioctl().
My hunch is that there is either some dispatch code that does a table lookup somewhere and then jumps to the appropriate function, or there's a linker set somewhere that somehow allows the ioctl call to directly land where it needs to (wild guess).
I'd be really interested in learning how this mechanism works, so any links to documentation or perhaps source files I should be looking at would be greatly welcomed.
Thank you.