mirror of
https://github.com/Fishwaldo/linux-bl808.git
synced 2025-06-17 20:25:19 +00:00
cfg80211: add generic helper to check interface is running
Add a helper using wdev to check if interface is running. This deals with both non-netdev and netdev interfaces. In struct wireless_dev replace 'p2p_started' and 'nan_started' by 'is_running' as those are mutually exclusive anyway, and unify all the code to use wdev_running(). Signed-off-by: Arend van Spriel <arend.vanspriel@broadcom.com> Signed-off-by: Johannes Berg <johannes.berg@intel.com>
This commit is contained in:
parent
8f20542386
commit
73c7da3dae
3 changed files with 31 additions and 45 deletions
|
@ -210,11 +210,11 @@ void cfg80211_stop_p2p_device(struct cfg80211_registered_device *rdev,
|
|||
if (WARN_ON(wdev->iftype != NL80211_IFTYPE_P2P_DEVICE))
|
||||
return;
|
||||
|
||||
if (!wdev->p2p_started)
|
||||
if (!wdev_running(wdev))
|
||||
return;
|
||||
|
||||
rdev_stop_p2p_device(rdev, wdev);
|
||||
wdev->p2p_started = false;
|
||||
wdev->is_running = false;
|
||||
|
||||
rdev->opencount--;
|
||||
|
||||
|
@ -233,11 +233,11 @@ void cfg80211_stop_nan(struct cfg80211_registered_device *rdev,
|
|||
if (WARN_ON(wdev->iftype != NL80211_IFTYPE_NAN))
|
||||
return;
|
||||
|
||||
if (!wdev->nan_started)
|
||||
if (!wdev_running(wdev))
|
||||
return;
|
||||
|
||||
rdev_stop_nan(rdev, wdev);
|
||||
wdev->nan_started = false;
|
||||
wdev->is_running = false;
|
||||
|
||||
rdev->opencount--;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue