nl80211 notification when scanning is finished?
Hi all,
I'm writing a fake wifi driver (basically a proxy between two devices) which uses nl80211 to talk to a real wifi device, and it mostly works, but I have a problem with the scanning interface.
From userland, after sending the NL80211_CMD_GET_SCAN the results come in as a single netlink read (split up and the handler gets called once for each) and I know it is finished after that read, but I'm triggering the scan from a different kernel driver (so driverA -> driverB -> genl to userland -> nl80211 -> userland -> driverB -> driverA). I don't want to modify the nl80211 message (with the theory that i could go driverB -> nl80211 directly later) but I have no way to know when scanning results have been fully sent. (Or even how many results to expect so I can finally call cfg80211_scan_done() in driverA when that many stations have been reported from nl80211).
Is there any way to do what I want? Is it possible to know when we get the NLMSG_DONE type from the post_doit? Is it possible to figure it out using a combination of the pre_doit() and post_doit() callbacks?
The really nasty hack I'm using currently is having a timeout of 1s after I receive a NL80211_CMD_GET_SCAN (resetting the timeout for each one) but I'm praying there is a nicer way?
Thanks.
Jonathan Gordon
P.S yes, the design is convoluted, but there is no other way to do what we want. :)