Skip to contentSkip to conversation

cfg80211 warnings

DISCUSSION Johannes Berg 1 participant 1 message Dec 29, 2010 1 message not in the archive

lore
Share & tools
lore
#1 lore raw
In reply to a message not in the archive
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 to nl80211_trigger_scan.
4) A call to cfg80211_netdev_notifier_call() with the state NETDEV_GOING_DOWN while the previous scan operation is pending.
5) A call to cfg80211_netdev_notifier_call() with the state NETDEV_DOWN while 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