UPSTREAM: wifi: nl80211: add MLO link ID to the NL80211_CMD_FRAME TX API

Allow optionally specifying the link ID to transmit on,
which can be done instead of the link frequency, on an
MLD addressed frame. Both can also be omitted in which
case the frame must be MLD addressed and link selection
(and address translation) will be done on lower layers.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>

Bug: 253289327
Change-Id: I9031c721b41e4ad2723c3b6fb171e760035f4321
(cherry picked from commit 95f498bb49f7030c1f40236107e5241e50f79ade)
Signed-off-by: Kiran Kumar Lokere <quic_klokere@quicinc.com>
Signed-off-by: Veerendranath Jakkam <quic_vjakkam@quicinc.com>
This commit is contained in:
Johannes Berg
2022-07-18 12:13:46 +02:00
committed by Todd Kjos
parent 483086ceca
commit 3ae950a584
3 changed files with 20 additions and 0 deletions

View File

@@ -3600,6 +3600,9 @@ struct cfg80211_update_ft_ies_params {
* @dont_wait_for_ack: tells the low level not to wait for an ack
* @n_csa_offsets: length of csa_offsets array
* @csa_offsets: array of all the csa offsets in the frame
* @link_id: for MLO, the link ID to transmit on, -1 if not given; note
* that the link ID isn't validated (much), it's in range but the
* link might not exist (or be used by the receiver STA)
*/
struct cfg80211_mgmt_tx_params {
struct ieee80211_channel *chan;
@@ -3611,6 +3614,7 @@ struct cfg80211_mgmt_tx_params {
bool dont_wait_for_ack;
int n_csa_offsets;
const u16 *csa_offsets;
int link_id;
ANDROID_BACKPORT_RESERVED(1);
ANDROID_BACKPORT_RESERVED(2);

View File

@@ -772,6 +772,10 @@
* %NL80211_ATTR_CSA_C_OFFSETS_TX is an array of offsets to CSA
* counters which will be updated to the current value. This attribute
* is used during CSA period.
* For TX on an MLD, the frequency can be omitted and the link ID be
* specified, or if transmitting to a known peer MLD (with MLD addresses
* in the frame) both can be omitted and the link will be selected by
* lower layers.
* @NL80211_CMD_FRAME_WAIT_CANCEL: When an off-channel TX was requested, this
* command may be used with the corresponding cookie to cancel the wait
* time if it is known that it is no longer necessary. This command is

View File

@@ -12313,6 +12313,18 @@ static int nl80211_tx_mgmt(struct sk_buff *skb, struct genl_info *info)
wdev_unlock(wdev);
return -EBUSY;
}
params.link_id = nl80211_link_id_or_invalid(info->attrs);
/*
* This now races due to the unlock, but we cannot check
* the valid links for the _station_ anyway, so that's up
* to the driver.
*/
if (params.link_id >= 0 &&
!(wdev->valid_links & BIT(params.link_id))) {
wdev_unlock(wdev);
return -EINVAL;
}
wdev_unlock(wdev);
params.buf = nla_data(info->attrs[NL80211_ATTR_FRAME]);