|
@@ -1263,10 +1263,13 @@ int cfg80211_validate_beacon_int(struct cfg80211_registered_device *rdev,
|
|
|
return res;
|
|
|
}
|
|
|
|
|
|
-int cfg80211_check_combinations(struct wiphy *wiphy,
|
|
|
- const int num_different_channels,
|
|
|
- const u8 radar_detect,
|
|
|
- const int iftype_num[NUM_NL80211_IFTYPES])
|
|
|
+int cfg80211_iter_combinations(struct wiphy *wiphy,
|
|
|
+ const int num_different_channels,
|
|
|
+ const u8 radar_detect,
|
|
|
+ const int iftype_num[NUM_NL80211_IFTYPES],
|
|
|
+ void (*iter)(const struct ieee80211_iface_combination *c,
|
|
|
+ void *data),
|
|
|
+ void *data)
|
|
|
{
|
|
|
int i, j, iftype;
|
|
|
int num_interfaces = 0;
|
|
@@ -1323,13 +1326,40 @@ int cfg80211_check_combinations(struct wiphy *wiphy,
|
|
|
/* This combination covered all interface types and
|
|
|
* supported the requested numbers, so we're good.
|
|
|
*/
|
|
|
- kfree(limits);
|
|
|
- return 0;
|
|
|
+
|
|
|
+ (*iter)(c, data);
|
|
|
cont:
|
|
|
kfree(limits);
|
|
|
}
|
|
|
|
|
|
- return -EBUSY;
|
|
|
+ return 0;
|
|
|
+}
|
|
|
+EXPORT_SYMBOL(cfg80211_iter_combinations);
|
|
|
+
|
|
|
+static void
|
|
|
+cfg80211_iter_sum_ifcombs(const struct ieee80211_iface_combination *c,
|
|
|
+ void *data)
|
|
|
+{
|
|
|
+ int *num = data;
|
|
|
+ (*num)++;
|
|
|
+}
|
|
|
+
|
|
|
+int cfg80211_check_combinations(struct wiphy *wiphy,
|
|
|
+ const int num_different_channels,
|
|
|
+ const u8 radar_detect,
|
|
|
+ const int iftype_num[NUM_NL80211_IFTYPES])
|
|
|
+{
|
|
|
+ int err, num = 0;
|
|
|
+
|
|
|
+ err = cfg80211_iter_combinations(wiphy, num_different_channels,
|
|
|
+ radar_detect, iftype_num,
|
|
|
+ cfg80211_iter_sum_ifcombs, &num);
|
|
|
+ if (err)
|
|
|
+ return err;
|
|
|
+ if (num == 0)
|
|
|
+ return -EBUSY;
|
|
|
+
|
|
|
+ return 0;
|
|
|
}
|
|
|
EXPORT_SYMBOL(cfg80211_check_combinations);
|
|
|
|