wifi: cfg80211: Extend cfg80211_update_owe_info_event() for MLD AP
authorVeerendranath Jakkam <quic_vjakkam@quicinc.com>
Thu, 26 Jan 2023 14:32:56 +0000 (20:02 +0530)
committerJohannes Berg <johannes.berg@intel.com>
Tue, 14 Feb 2023 11:00:25 +0000 (12:00 +0100)
Add support to offload OWE processing to user space for MLD AP when
driver's SME in use.

Add new parameters in struct cfg80211_update_owe_info to provide below
information in cfg80211_update_owe_info_event() call:
- MLO link ID of the AP, with which station requested (re)association.
  This is applicable for both MLO and non-MLO station connections when
  the AP affiliated with an MLD.
- Station's MLD address if the connection is MLO capable.

Signed-off-by: Veerendranath Jakkam <quic_vjakkam@quicinc.com>
Link: https://lore.kernel.org/r/20230126143256.960563-3-quic_vjakkam@quicinc.com
[reformat the trace event macro]
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
drivers/net/wireless/quantenna/qtnfmac/event.c
include/net/cfg80211.h
net/wireless/nl80211.c
net/wireless/trace.h

index 4fafe370101a22aaa360ed19d5296582eef2d9cf..f0158737aed62f10d1b08b2811e20c13f6ce120e 100644 (file)
@@ -662,6 +662,7 @@ qtnf_event_handle_update_owe(struct qtnf_vif *vif,
        memcpy(ie, owe_ev->ies, ie_len);
        owe_info.ie_len = ie_len;
        owe_info.ie = ie;
+       owe_info.assoc_link_id = -1;
 
        pr_info("%s: external OWE processing: peer=%pM\n",
                vif->netdev->name, owe_ev->peer);
index 28529194eb895c80304347cff3fb65424ba27d5b..70f01ea5ba5c6cd469246fd476a5c4ba293acc22 100644 (file)
@@ -3898,12 +3898,22 @@ struct cfg80211_pmsr_request {
  *     the IEs of the remote peer in the event from the host driver and
  *     the constructed IEs by the user space in the request interface.
  * @ie_len: Length of IEs in octets.
+ * @assoc_link_id: MLO link ID of the AP, with which (re)association requested
+ *     by peer. This will be filled by driver for both MLO and non-MLO station
+ *     connections when the AP affiliated with an MLD. For non-MLD AP mode, it
+ *     will be -1. Used only with OWE update event (driver to user space).
+ * @peer_mld_addr: For MLO connection, MLD address of the peer. For non-MLO
+ *     connection, it will be all zeros. This is applicable only when
+ *     @assoc_link_id is not -1, i.e., the AP affiliated with an MLD. Used only
+ *     with OWE update event (driver to user space).
  */
 struct cfg80211_update_owe_info {
        u8 peer[ETH_ALEN] __aligned(2);
        u16 status;
        const u8 *ie;
        size_t ie_len;
+       int assoc_link_id;
+       u8 peer_mld_addr[ETH_ALEN] __aligned(2);
 };
 
 /**
index caf716c3afafd3c47a783b90eb1c089467a603d0..f9e6e65bc02967933628994665b8f5b46bcfcfed 100644 (file)
@@ -19780,6 +19780,17 @@ void cfg80211_update_owe_info_event(struct net_device *netdev,
            nla_put(msg, NL80211_ATTR_IE, owe_info->ie_len, owe_info->ie))
                goto nla_put_failure;
 
+       if (owe_info->assoc_link_id != -1) {
+               if (nla_put_u8(msg, NL80211_ATTR_MLO_LINK_ID,
+                              owe_info->assoc_link_id))
+                       goto nla_put_failure;
+
+               if (!is_zero_ether_addr(owe_info->peer_mld_addr) &&
+                   nla_put(msg, NL80211_ATTR_MLD_ADDR, ETH_ALEN,
+                           owe_info->peer_mld_addr))
+                       goto nla_put_failure;
+       }
+
        genlmsg_end(msg, hdr);
 
        genlmsg_multicast_netns(&nl80211_fam, wiphy_net(&rdev->wiphy), msg, 0,
index 044b3c5a88ef0a6dd52cfee159da23afcd74b369..0e688696fc60103e4964024056c9709254bab870 100644 (file)
@@ -3748,20 +3748,30 @@ TRACE_EVENT(cfg80211_pmsr_complete,
 );
 
 TRACE_EVENT(cfg80211_update_owe_info_event,
-           TP_PROTO(struct wiphy *wiphy, struct net_device *netdev,
-                    struct cfg80211_update_owe_info *owe_info),
-           TP_ARGS(wiphy, netdev, owe_info),
-           TP_STRUCT__entry(WIPHY_ENTRY
-                            NETDEV_ENTRY
-                            MAC_ENTRY(peer)
-                            __dynamic_array(u8, ie, owe_info->ie_len)),
-           TP_fast_assign(WIPHY_ASSIGN;
-                          NETDEV_ASSIGN;
-                          MAC_ASSIGN(peer, owe_info->peer);
-                          memcpy(__get_dynamic_array(ie), owe_info->ie,
-                                 owe_info->ie_len);),
-           TP_printk(WIPHY_PR_FMT ", " NETDEV_PR_FMT ", peer: %pM",
-                     WIPHY_PR_ARG, NETDEV_PR_ARG, __entry->peer)
+       TP_PROTO(struct wiphy *wiphy, struct net_device *netdev,
+                struct cfg80211_update_owe_info *owe_info),
+       TP_ARGS(wiphy, netdev, owe_info),
+       TP_STRUCT__entry(
+               WIPHY_ENTRY
+               NETDEV_ENTRY
+               MAC_ENTRY(peer)
+               __dynamic_array(u8, ie, owe_info->ie_len)
+               __field(int, assoc_link_id)
+               MAC_ENTRY(peer_mld_addr)
+       ),
+       TP_fast_assign(
+               WIPHY_ASSIGN;
+               NETDEV_ASSIGN;
+               MAC_ASSIGN(peer, owe_info->peer);
+               memcpy(__get_dynamic_array(ie), owe_info->ie,
+                      owe_info->ie_len);
+               __entry->assoc_link_id = owe_info->assoc_link_id;
+               MAC_ASSIGN(peer_mld_addr, owe_info->peer_mld_addr);
+       ),
+       TP_printk(WIPHY_PR_FMT ", " NETDEV_PR_FMT ", peer: %pM,"
+                 " assoc_link_id: %d, peer_mld_addr: %pM",
+                 WIPHY_PR_ARG, NETDEV_PR_ARG, __entry->peer,
+                 __entry->assoc_link_id, __entry->peer_mld_addr)
 );
 
 TRACE_EVENT(cfg80211_bss_color_notify,