|
@@ -5997,6 +5997,24 @@ static int nl80211_trigger_scan(struct sk_buff *skb, struct genl_info *info)
|
|
|
return err;
|
|
|
}
|
|
|
|
|
|
+static int nl80211_abort_scan(struct sk_buff *skb, struct genl_info *info)
|
|
|
+{
|
|
|
+ struct cfg80211_registered_device *rdev = info->user_ptr[0];
|
|
|
+ struct wireless_dev *wdev = info->user_ptr[1];
|
|
|
+
|
|
|
+ if (!rdev->ops->abort_scan)
|
|
|
+ return -EOPNOTSUPP;
|
|
|
+
|
|
|
+ if (rdev->scan_msg)
|
|
|
+ return 0;
|
|
|
+
|
|
|
+ if (!rdev->scan_req)
|
|
|
+ return -ENOENT;
|
|
|
+
|
|
|
+ rdev_abort_scan(rdev, wdev);
|
|
|
+ return 0;
|
|
|
+}
|
|
|
+
|
|
|
static int
|
|
|
nl80211_parse_sched_scan_plans(struct wiphy *wiphy, int n_plans,
|
|
|
struct cfg80211_sched_scan_request *request,
|
|
@@ -10944,6 +10962,14 @@ static const struct genl_ops nl80211_ops[] = {
|
|
|
.internal_flags = NL80211_FLAG_NEED_WDEV_UP |
|
|
|
NL80211_FLAG_NEED_RTNL,
|
|
|
},
|
|
|
+ {
|
|
|
+ .cmd = NL80211_CMD_ABORT_SCAN,
|
|
|
+ .doit = nl80211_abort_scan,
|
|
|
+ .policy = nl80211_policy,
|
|
|
+ .flags = GENL_ADMIN_PERM,
|
|
|
+ .internal_flags = NL80211_FLAG_NEED_WDEV_UP |
|
|
|
+ NL80211_FLAG_NEED_RTNL,
|
|
|
+ },
|
|
|
{
|
|
|
.cmd = NL80211_CMD_GET_SCAN,
|
|
|
.policy = nl80211_policy,
|