diff --git a/include/uapi/linux/nl80211.h b/include/uapi/linux/nl80211.h index be9e2842a736..75d4c5d6a7a3 100644 --- a/include/uapi/linux/nl80211.h +++ b/include/uapi/linux/nl80211.h @@ -1406,10 +1406,12 @@ * be provided. * Each peer channel must be compatible with at least one local channel * set by %NL80211_CMD_SET_LOCAL_NAN_SCHED. Different maps must not - * contain compatible channels. - * For single-radio devices (n_radio <= 1), different maps must not - * schedule the same time slot, as the device cannot operate on multiple - * channels simultaneously. + * contain compatible channels. Two maps may schedule the same time slot. + * The device decides at runtime which of the channels to follow. + * For example, the local schedule may place slot S on channel c1 while + * the peer advertises slot S on both c1 and c2. If the device is anyway + * on c2 during slot S (e.g. via the ULW mechanism for non-NAN activity), + * it may use slot S on c2 to communicate with the peer. * When updating an existing peer schedule, the full new schedule must be * provided - partial updates are not supported. The new schedule will * completely replace the previous one. diff --git a/net/wireless/nl80211.c b/net/wireless/nl80211.c index 58d336498125..16c63383923b 100644 --- a/net/wireless/nl80211.c +++ b/net/wireless/nl80211.c @@ -17566,8 +17566,7 @@ nl80211_parse_nan_peer_map(struct genl_info *info, struct nlattr *map_attr, map->schedule, n_channels); } -static int nl80211_nan_validate_map_pair(struct wiphy *wiphy, - struct genl_info *info, +static int nl80211_nan_validate_map_pair(struct genl_info *info, const struct cfg80211_nan_peer_map *map1, const struct cfg80211_nan_peer_map *map2, struct cfg80211_nan_channel *nan_channels) @@ -17602,24 +17601,6 @@ static int nl80211_nan_validate_map_pair(struct wiphy *wiphy, } } - /* - * Check for conflicting time slots between maps. - * Only check for single-radio devices (n_radio <= 1) which cannot - * operate on multiple channels simultaneously. - */ - if (wiphy->n_radio > 1) - return 0; - - for (int i = 0; i < ARRAY_SIZE(map1->schedule); i++) { - if (map1->schedule[i] != NL80211_NAN_SCHED_NOT_AVAIL_SLOT && - map2->schedule[i] != NL80211_NAN_SCHED_NOT_AVAIL_SLOT) { - NL_SET_ERR_MSG_FMT(info->extack, - "Maps %u and %u both schedule slot %d", - map1->map_id, map2->map_id, i); - return -EINVAL; - } - } - return 0; } @@ -17736,7 +17717,7 @@ static int nl80211_nan_set_peer_sched(struct sk_buff *skb, /* Validate against previous maps */ for (int j = 0; j < n_maps; j++) { - ret = nl80211_nan_validate_map_pair(&rdev->wiphy, info, + ret = nl80211_nan_validate_map_pair(info, &sched.maps[j], &sched.maps[n_maps], nan_channels);