wifi: cfg80211: convert tx_control_port cookie to input parameter

The tx_control_port op was excluded from the previous commit because
a NULL cookie was affecting different behavior, ie. signalling that
no TX status is wanted.

Since cfg80211_assign_cookie() guarantees a non-zero value, cookie value
0 can be used instead. So pass 0 when dont_wait_for_ack is set, otherwise
pass value returned from cfg80211_assign_cookie() call.

Assisted-by: Claude:claude-sonnet-4-6
Signed-off-by: Arend van Spriel <arend.vanspriel@broadcom.com>
Link: https://patch.msgid.link/20260731123509.1975281-13-arend.vanspriel@broadcom.com
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
This commit is contained in:
Arend van Spriel
2026-07-31 14:35:08 +02:00
committed by Johannes Berg
parent 914781c728
commit 51ba92052e
6 changed files with 24 additions and 26 deletions

View File

@@ -5220,8 +5220,8 @@ struct mgmt_frame_regs {
* user space
*
* @tx_control_port: TX a control port frame (EAPoL). The noencrypt parameter
* tells the driver that the frame should not be encrypted. When @cookie
* is non-NULL it is pre-assigned by cfg80211; drivers must not modify it.
* tells the driver that the frame should not be encrypted. A @cookie
* value of 0 means the caller does not want TX status reporting.
*
* @get_ftm_responder_stats: Retrieve FTM responder statistics, if available.
* Statistics should be cumulative, currently no way to reset is provided.
@@ -5610,7 +5610,7 @@ struct cfg80211_ops {
const u8 *buf, size_t len,
const u8 *dest, const __be16 proto,
const bool noencrypt, int link_id,
u64 *cookie);
u64 cookie);
int (*get_ftm_responder_stats)(struct wiphy *wiphy,
struct net_device *dev,

View File

@@ -2234,7 +2234,7 @@ void __ieee80211_subif_start_xmit(struct sk_buff *skb,
struct net_device *dev,
u32 info_flags,
u32 ctrl_flags,
u64 *cookie);
u64 cookie);
struct sk_buff *
ieee80211_build_data_template(struct ieee80211_sub_if_data *sdata,
struct sk_buff *skb, u32 info_flags);
@@ -2248,7 +2248,7 @@ void ieee80211_clear_fast_xmit(struct sta_info *sta);
int ieee80211_tx_control_port(struct wiphy *wiphy, struct net_device *dev,
const u8 *buf, size_t len,
const u8 *dest, __be16 proto, bool unencrypted,
int link_id, u64 *cookie);
int link_id, u64 cookie);
int ieee80211_probe_mesh_link(struct wiphy *wiphy, struct net_device *dev,
const u8 *buf, size_t len);
void __ieee80211_xmit_fast(struct ieee80211_sub_if_data *sdata,

View File

@@ -1121,7 +1121,7 @@ ieee80211_tdls_prep_mgmt_packet(struct wiphy *wiphy, struct net_device *dev,
/* disable bottom halves when entering the Tx path */
local_bh_disable();
__ieee80211_subif_start_xmit(skb, dev, flags,
IEEE80211_TX_CTRL_MLO_LINK_UNSPEC, NULL);
IEEE80211_TX_CTRL_MLO_LINK_UNSPEC, 0);
local_bh_enable();
return ret;

View File

@@ -2580,7 +2580,7 @@ int ieee80211_lookup_ra_sta(struct ieee80211_sub_if_data *sdata,
static u16 ieee80211_store_ack_skb(struct ieee80211_local *local,
struct sk_buff *skb,
u32 *info_flags,
u64 *cookie)
u64 cookie)
{
struct sk_buff *ack_skb;
u16 info_id = 0;
@@ -2603,7 +2603,7 @@ static u16 ieee80211_store_ack_skb(struct ieee80211_local *local,
info_id = id;
*info_flags |= IEEE80211_TX_CTL_REQ_TX_STATUS;
if (cookie)
IEEE80211_SKB_CB(ack_skb)->ack.cookie = *cookie;
IEEE80211_SKB_CB(ack_skb)->ack.cookie = cookie;
} else {
kfree_skb(ack_skb);
}
@@ -2648,7 +2648,7 @@ static void ieee80211_remove_ack_skb(struct ieee80211_local *local, u16 info_id)
static struct sk_buff *ieee80211_build_hdr(struct ieee80211_sub_if_data *sdata,
struct sk_buff *skb, u32 info_flags,
struct sta_info *sta, u32 ctrl_flags,
u64 *cookie)
u64 cookie)
{
struct ieee80211_local *local = sdata->local;
struct ieee80211_tx_info *info;
@@ -4369,7 +4369,7 @@ void __ieee80211_subif_start_xmit(struct sk_buff *skb,
struct net_device *dev,
u32 info_flags,
u32 ctrl_flags,
u64 *cookie)
u64 cookie)
{
struct ieee80211_sub_if_data *sdata = IEEE80211_DEV_TO_SUB_IF(dev);
struct ieee80211_local *local = sdata->local;
@@ -4564,7 +4564,7 @@ static void ieee80211_mlo_multicast_tx_one(struct ieee80211_sub_if_data *sdata,
return;
ctrl_flags |= u32_encode_bits(link_id, IEEE80211_TX_CTRL_MLO_LINK);
__ieee80211_subif_start_xmit(out, sdata->dev, 0, ctrl_flags, NULL);
__ieee80211_subif_start_xmit(out, sdata->dev, 0, ctrl_flags, 0);
}
static void ieee80211_mlo_multicast_tx(struct net_device *dev,
@@ -4579,8 +4579,7 @@ static void ieee80211_mlo_multicast_tx(struct net_device *dev,
ctrl_flags |= u32_encode_bits(__ffs(links),
IEEE80211_TX_CTRL_MLO_LINK);
__ieee80211_subif_start_xmit(skb, sdata->dev, 0, ctrl_flags,
NULL);
__ieee80211_subif_start_xmit(skb, sdata->dev, 0, ctrl_flags, 0);
return;
}
@@ -4622,7 +4621,7 @@ netdev_tx_t ieee80211_subif_start_xmit(struct sk_buff *skb,
while ((skb = __skb_dequeue(&queue)))
__ieee80211_subif_start_xmit(skb, dev, 0,
IEEE80211_TX_CTRL_MLO_LINK_UNSPEC,
NULL);
0);
} else if (ieee80211_vif_is_mld(&sdata->vif) &&
((sdata->vif.type == NL80211_IFTYPE_AP &&
!ieee80211_hw_check(&sdata->local->hw, MLO_MCAST_MULTI_LINK_TX)) ||
@@ -4633,7 +4632,7 @@ netdev_tx_t ieee80211_subif_start_xmit(struct sk_buff *skb,
normal:
__ieee80211_subif_start_xmit(skb, dev, 0,
IEEE80211_TX_CTRL_MLO_LINK_UNSPEC,
NULL);
0);
}
return NETDEV_TX_OK;
@@ -4732,7 +4731,7 @@ static void ieee80211_8023_xmit(struct ieee80211_sub_if_data *sdata,
/* fall back to non-offload slow path */
__ieee80211_subif_start_xmit(skb, dev, 0,
IEEE80211_TX_CTRL_MLO_LINK_UNSPEC,
NULL);
0);
return;
}
@@ -4768,7 +4767,7 @@ static void ieee80211_8023_xmit(struct ieee80211_sub_if_data *sdata,
if (unlikely(sk_requests_wifi_status(skb->sk))) {
info->status_data = ieee80211_store_ack_skb(local, skb,
&info->flags, NULL);
&info->flags, 0);
if (info->status_data)
info->status_data_idr = 1;
}
@@ -4911,7 +4910,7 @@ ieee80211_build_data_template(struct ieee80211_sub_if_data *sdata,
}
skb = ieee80211_build_hdr(sdata, skb, info_flags, sta,
IEEE80211_TX_CTRL_MLO_LINK_UNSPEC, NULL);
IEEE80211_TX_CTRL_MLO_LINK_UNSPEC, 0);
if (IS_ERR(skb))
goto out;
@@ -6526,7 +6525,7 @@ void ieee80211_tx_skb_tid(struct ieee80211_sub_if_data *sdata,
int ieee80211_tx_control_port(struct wiphy *wiphy, struct net_device *dev,
const u8 *buf, size_t len,
const u8 *dest, __be16 proto, bool unencrypted,
int link_id, u64 *cookie)
int link_id, u64 cookie)
{
struct ieee80211_sub_if_data *sdata = IEEE80211_DEV_TO_SUB_IF(dev);
struct ieee80211_local *local = sdata->local;
@@ -6661,7 +6660,7 @@ int ieee80211_probe_mesh_link(struct wiphy *wiphy, struct net_device *dev,
local_bh_disable();
__ieee80211_subif_start_xmit(skb, skb->dev, 0,
IEEE80211_TX_CTRL_SKIP_MPATH_LOOKUP,
NULL);
0);
local_bh_enable();
return 0;

View File

@@ -18589,12 +18589,11 @@ static int nl80211_tx_control_port(struct sk_buff *skb, struct genl_info *info)
link_id = nl80211_link_id_or_invalid(info->attrs);
if (!dont_wait_for_ack)
cookie = cfg80211_assign_cookie(rdev);
cookie = dont_wait_for_ack ? 0 : cfg80211_assign_cookie(rdev);
err = rdev_tx_control_port(rdev, dev, buf, len,
dest, cpu_to_be16(proto), noencrypt, link_id,
dont_wait_for_ack ? NULL : &cookie);
if (!err && !dont_wait_for_ack)
cookie);
if (!err && cookie)
nl_set_extack_cookie_u64(info->extack, cookie);
return err;
}

View File

@@ -775,7 +775,7 @@ static inline int rdev_tx_control_port(struct cfg80211_registered_device *rdev,
const void *buf, size_t len,
const u8 *dest, __be16 proto,
const bool noencrypt, int link,
u64 *cookie)
u64 cookie)
{
int ret;
trace_rdev_tx_control_port(&rdev->wiphy, dev, buf, len,
@@ -783,7 +783,7 @@ static inline int rdev_tx_control_port(struct cfg80211_registered_device *rdev,
ret = rdev->ops->tx_control_port(&rdev->wiphy, dev, buf, len,
dest, proto, noencrypt, link, cookie);
if (cookie)
trace_rdev_return_int_cookie(&rdev->wiphy, ret, *cookie);
trace_rdev_return_int_cookie(&rdev->wiphy, ret, cookie);
else
trace_rdev_return_int(&rdev->wiphy, ret);
return ret;