cfg80211 warnings
Quoted 28 lines · Vipin Mehta
I was testing a cfg80211 driver when I encountered the following
warning in the function core.c:wdev_cleanup_work().if (WARN_ON(rdev->scan_req && rdev->scan_req->dev == wdev->netdev)) { rdev->scan_req->aborted = true; ___cfg80211_scan_done(rdev, true); }Soon enough it leads to another warning in the function scan.c:cfg80211_scan_done() when the pending scan operation completes.
WARN_ON(request != wiphy_to_dev(request->wiphy)->scan_req);The sequence of operation is:
1) Connect to an open access point.
2) Disconnect.
3) Scan via a call tonl80211_trigger_scan.
4) A call tocfg80211_netdev_notifier_call()with the stateNETDEV_GOING_DOWNwhile the previous scan operation is pending.
5) A call tocfg80211_netdev_notifier_call()with the stateNETDEV_DOWNwhile the previous scan operation is pending.The first warning is observed after step 5) because of a pending scan request. The second warning is seen when the driver returns the scan results once the pending scan operation is completed. This is because cfg80211 had already freed up the pending scan request in the context of
NETDEV_DOWN.
Quoted 6 lines
Unfortunately, I dont see a way for the cfg80211 driver to get notified when the interface is going down since the driver could have aborted the pending scan in that case.
Is the above sequence of operations valid and is cfg80211 expected to handle it without the warnings? Is the driver missing some hooks?
The driver is expected to abort scans when interfaces go down, and it can know that from the mac80211 stop() callback, or the netdev's ndo_stop() callback (for pure cfg80211 drivers).
johannes