Add NL80211_CMD_NAN_NDP_RESPOND so userspace can accept or reject an incoming NDP request when the device offloads NDP management. Require a local responder NDI only when accepting; the initiator NDI belongs to the peer and is not validated as a local interface. Restrict rejection requests to the reason and optional SSI, and enforce the NAN security requirements when accepting. Pass PMK material by pointer, clear the request skb, and trace request parameters without recording key bytes. Allow the responder to provide transport port and protocol information when accepting an NDP request. Accept the NDL QoS requirements on accepted responses, and reject them when rejecting an NDP. Signed-off-by: Shivani Baranwal --- include/net/cfg80211.h | 63 ++++++++++++ include/uapi/linux/nl80211.h | 40 ++++++-- net/wireless/nl80211.c | 179 +++++++++++++++++++++++++++++++++++ net/wireless/rdev-ops.h | 16 ++++ net/wireless/trace.h | 92 ++++++++++++++++++ 5 files changed, 384 insertions(+), 6 deletions(-) diff --git a/include/net/cfg80211.h b/include/net/cfg80211.h index a337f10c660b..57b8e6402a0e 100644 --- a/include/net/cfg80211.h +++ b/include/net/cfg80211.h @@ -4441,6 +4441,60 @@ struct cfg80211_nan_ndp_initiate { u16 qos_max_latency; }; +/** + * struct cfg80211_nan_ndp_respond - NAN NDP respond parameters + * + * @peer_nmi: peer NMI address + * @ndp_id: NDP ID from the received NDP Request + * @init_ndi: initiator NDI MAC from the received NDP Request + * @resp_ndi: responder NDI MAC. The corresponding + * %NL80211_IFTYPE_NAN_DATA interface must exist when accepting. + * @accept: if true, accept the NDP; if false, reject it + * @reason: Wi-Fi Aware reason code for rejection (valid when @accept is false) + * @ssi: response service-specific info (may be NULL) + * @ssi_len: length of @ssi + * @cipher_suite: NAN cipher suite ID (must match the initiator's) + * @pmk: ND-PMK used to derive the PTK; NULL if absent. Its length depends on + * the cipher suite and is given by @pmk_len. Requires non-zero + * @cipher_suite and %NL80211_EXT_FEATURE_SECURE_NAN. + * @pmk_len: length of @pmk in bytes + * @gtk_required: if true, GTK protection is required for group-addressed data + * frames + * @gtk_cipher: GTK cipher suite ID, valid when @gtk_required is true + * @ipv6_intf_id: IPv6 link-local interface identifier, or NULL if absent + * @transport_info: if true, convey @transport_port and @transport_protocol to + * the peer in the NDPE Service Info TLV (Generic Service Protocol). These + * values are not conveyed if the peer does not support NDPE. + * @transport_port: transport port to convey when @transport_info is true + * @transport_protocol: IANA protocol number to convey when @transport_info is + * true + * @qos_min_slots: minimum number of NAN time slots required for this NDP; 0 + * means no preference. Used only when accepting the NDP. + * @qos_max_latency: maximum number of NAN slots between two non-contiguous + * NDL CRBs; 0xffff means no preference. Used only when accepting the NDP. + */ +struct cfg80211_nan_ndp_respond { + const u8 *peer_nmi; + u8 ndp_id; + const u8 *init_ndi; + const u8 *resp_ndi; + bool accept; + u8 reason; + const u8 *ssi; + u8 ssi_len; + u32 cipher_suite; + const u8 *pmk; + u8 pmk_len; + bool gtk_required; + u32 gtk_cipher; + const u8 *ipv6_intf_id; + bool transport_info; + u16 transport_port; + u8 transport_protocol; + u8 qos_min_slots; + u16 qos_max_latency; +}; + /** * enum cfg80211_nan_conf_changes - indicates changed fields in NAN * configuration @@ -5436,6 +5490,12 @@ struct mgmt_frame_regs { * notification, including on failure or timeout. If the device cannot meet * the QoS requirements in @params, it reports setup failure with the Wi-Fi * Aware reason QoS_UNACCEPTABLE. + * @nan_ndp_respond: Respond to an incoming NDP request as the responder. Only + * valid if the driver has set %WIPHY_NAN_FLAGS_OFFLOAD_NDP. Returning + * success acknowledges the response command only; setup outcome is + * reported asynchronously after the handshake. If the accepted response's + * QoS requirements cannot be met, the driver reports setup failure with + * the Wi-Fi Aware reason QoS_UNACCEPTABLE. * * @set_multicast_to_unicast: configure multicast to unicast conversion for BSS * @@ -5854,6 +5914,9 @@ struct cfg80211_ops { int (*nan_ndp_initiate)(struct wiphy *wiphy, struct wireless_dev *wdev, struct cfg80211_nan_ndp_initiate *params); + int (*nan_ndp_respond)(struct wiphy *wiphy, + struct wireless_dev *wdev, + struct cfg80211_nan_ndp_respond *params); int (*set_multicast_to_unicast)(struct wiphy *wiphy, struct net_device *dev, const bool enabled); diff --git a/include/uapi/linux/nl80211.h b/include/uapi/linux/nl80211.h index 7b888b416d59..c2470d107206 100644 --- a/include/uapi/linux/nl80211.h +++ b/include/uapi/linux/nl80211.h @@ -1589,6 +1589,18 @@ * Aware reason QoS_UNACCEPTABLE. Each accepted setup attempt completes * asynchronously with exactly one %NL80211_CMD_NAN_NDP_STATUS * notification, including on failure or timeout. + * @NL80211_CMD_NAN_NDP_RESPOND: Respond to a received NDP request as the + * responder. Requires %NL80211_NAN_CAPA_OFFLOAD_NDP. The NDI interface + * specified in %NL80211_NAN_NDP_ATTR_RESP_NDI must already exist as a + * %NL80211_IFTYPE_NAN_DATA interface. Carries %NL80211_ATTR_NAN_NDP nested + * with %NL80211_NAN_NDP_ATTR_* fields. The command reply only acknowledges + * that the response was accepted for processing; setup outcome is reported + * asynchronously by %NL80211_CMD_NAN_NDP_STATUS. Transport port and + * protocol may be supplied together only when accepting. NDL QoS + * attributes may also be supplied only when accepting. If the device + * cannot meet the QoS requirements in an accepted response, setup fails + * and the status notification reports the Wi-Fi Aware reason + * QoS_UNACCEPTABLE. * * @NL80211_CMD_MAX: highest used command number * @__NL80211_CMD_AFTER_LAST: internal use @@ -1878,6 +1890,7 @@ enum nl80211_commands { NL80211_CMD_COMPLETED_SMD_TRANSITION, NL80211_CMD_NAN_NDP_INITIATE, + NL80211_CMD_NAN_NDP_RESPOND, /* add new commands above here */ @@ -8159,7 +8172,9 @@ enum nl80211_nan_conf_attributes { * @NL80211_NAN_NDP_ATTR_INIT_NDI: ETH_ALEN-byte initiator NDI MAC address. For * locally initiated NDPs, the corresponding %NL80211_IFTYPE_NAN_DATA * interface must exist. - * @NL80211_NAN_NDP_ATTR_RESP_NDI: ETH_ALEN-byte responder NDI MAC address. + * @NL80211_NAN_NDP_ATTR_RESP_NDI: ETH_ALEN-byte responder NDI MAC address. When + * accepting with %NL80211_CMD_NAN_NDP_RESPOND, this must identify an + * existing local %NL80211_IFTYPE_NAN_DATA interface. * @NL80211_NAN_NDP_ATTR_SSI: binary. Service-specific info carried in * the NDP setup frames. * @NL80211_NAN_NDP_ATTR_CIPHER_SUITE: u32 NAN cipher suite ID; 0 for open NDP. @@ -8181,18 +8196,29 @@ enum nl80211_nan_conf_attributes { * it in the NDPE attribute and selects NDP or NDPE based on peer * capabilities. * @NL80211_NAN_NDP_ATTR_TRANSPORT_PORT: u16 transport port. Must be supplied - * with @NL80211_NAN_NDP_ATTR_TRANSPORT_PROTOCOL. The driver carries the - * pair in the NDPE Service Info TLV (Generic Service Protocol). If the - * peer does not support NDPE, the values are not conveyed. + * with @NL80211_NAN_NDP_ATTR_TRANSPORT_PROTOCOL. The pair may be used in + * %NL80211_CMD_NAN_NDP_INITIATE and in an accepting + * %NL80211_CMD_NAN_NDP_RESPOND. The driver carries these values in the + * NDPE Service Info TLV (Generic Service Protocol). If the peer does not + * support NDPE, these values are not conveyed. * @NL80211_NAN_NDP_ATTR_TRANSPORT_PROTOCOL: u8 IANA protocol number. Must be * supplied with @NL80211_NAN_NDP_ATTR_TRANSPORT_PORT. * @NL80211_NAN_NDP_ATTR_QOS_MIN_SLOTS: optional u8 Minimum Time Slots field of * the NDL QoS attribute, specifying the minimum number of NAN time slots - * required for this NDP. Absent or 0 means no preference. + * required for this NDP. Absent or 0 means no preference. Used with + * %NL80211_CMD_NAN_NDP_INITIATE and an accepting + * %NL80211_CMD_NAN_NDP_RESPOND. * @NL80211_NAN_NDP_ATTR_QOS_MAX_LATENCY: optional u16 Maximum Latency field of * the NDL QoS attribute, specifying the maximum number of NAN slots * between two non-contiguous NDL CRBs. Absent or 0xffff means no - * preference. + * preference. Used with %NL80211_CMD_NAN_NDP_INITIATE and an accepting + * %NL80211_CMD_NAN_NDP_RESPOND. + * @NL80211_NAN_NDP_ATTR_ACCEPT: flag. If present in + * %NL80211_CMD_NAN_NDP_RESPOND, it accepts the request; if absent, it is + * rejected. + * @NL80211_NAN_NDP_ATTR_REASON: u8 Wi-Fi Aware reason code, not an IEEE 802.11 + * reason code (%NL80211_ATTR_REASON_CODE). Used for rejection with + * %NL80211_CMD_NAN_NDP_RESPOND. * @__NL80211_NAN_NDP_ATTR_LAST: Internal. * @NL80211_NAN_NDP_ATTR_MAX: Highest NDP attribute. */ @@ -8215,6 +8241,8 @@ enum nl80211_nan_ndp_attributes { NL80211_NAN_NDP_ATTR_TRANSPORT_PROTOCOL, NL80211_NAN_NDP_ATTR_QOS_MIN_SLOTS, NL80211_NAN_NDP_ATTR_QOS_MAX_LATENCY, + NL80211_NAN_NDP_ATTR_ACCEPT, + NL80211_NAN_NDP_ATTR_REASON, /* keep last */ __NL80211_NAN_NDP_ATTR_LAST, diff --git a/net/wireless/nl80211.c b/net/wireless/nl80211.c index 164ed61cb036..d444e5279ada 100644 --- a/net/wireless/nl80211.c +++ b/net/wireless/nl80211.c @@ -845,6 +845,8 @@ nl80211_nan_ndp_policy[NL80211_NAN_NDP_ATTR_MAX + 1] = { [NL80211_NAN_NDP_ATTR_TRANSPORT_PROTOCOL] = { .type = NLA_U8 }, [NL80211_NAN_NDP_ATTR_QOS_MIN_SLOTS] = { .type = NLA_U8 }, [NL80211_NAN_NDP_ATTR_QOS_MAX_LATENCY] = { .type = NLA_U16 }, + [NL80211_NAN_NDP_ATTR_ACCEPT] = { .type = NLA_FLAG }, + [NL80211_NAN_NDP_ATTR_REASON] = { .type = NLA_U8 }, }; static const struct nla_policy @@ -18743,6 +18745,176 @@ static int nl80211_nan_ndp_initiate(struct sk_buff *skb, return genlmsg_reply(msg, info); } +static int nl80211_nan_ndp_respond(struct sk_buff *skb, + struct genl_info *info) +{ + struct cfg80211_registered_device *rdev = info->user_ptr[0]; + struct wireless_dev *wdev = info->user_ptr[1]; + struct nlattr *tb[NL80211_NAN_NDP_ATTR_MAX + 1]; + struct cfg80211_nan_ndp_respond params = {}; + bool secure_nan; + int err; + + if (wdev->iftype != NL80211_IFTYPE_NAN) { + NL_SET_ERR_MSG(info->extack, + "NDP respond requires NAN interface"); + return -EOPNOTSUPP; + } + + if (!(rdev->wiphy.nan_capa.flags & WIPHY_NAN_FLAGS_OFFLOAD_NDP)) { + NL_SET_ERR_MSG(info->extack, + "NAN NDP offload not supported by driver"); + return -EOPNOTSUPP; + } + + if (!info->attrs[NL80211_ATTR_MAC] || + !info->attrs[NL80211_ATTR_NAN_NDP]) { + NL_SET_ERR_MSG(info->extack, + "NDP respond requires peer NMI and NDP params"); + return -EINVAL; + } + + err = nla_parse_nested(tb, NL80211_NAN_NDP_ATTR_MAX, + info->attrs[NL80211_ATTR_NAN_NDP], + nl80211_nan_ndp_policy, + info->extack); + if (err) + return err; + + if (!!tb[NL80211_NAN_NDP_ATTR_TRANSPORT_PORT] != + !!tb[NL80211_NAN_NDP_ATTR_TRANSPORT_PROTOCOL]) { + NL_SET_ERR_MSG(info->extack, + "Transport port and protocol must be supplied together"); + return -EINVAL; + } + + if (!tb[NL80211_NAN_NDP_ATTR_ID] || + !tb[NL80211_NAN_NDP_ATTR_INIT_NDI]) { + NL_SET_ERR_MSG(info->extack, + "NDP respond requires NDP ID and INIT_NDI"); + return -EINVAL; + } + + params.peer_nmi = nla_data(info->attrs[NL80211_ATTR_MAC]); + params.ndp_id = nla_get_u8(tb[NL80211_NAN_NDP_ATTR_ID]); + params.init_ndi = nla_data(tb[NL80211_NAN_NDP_ATTR_INIT_NDI]); + params.accept = nla_get_flag(tb[NL80211_NAN_NDP_ATTR_ACCEPT]); + params.qos_max_latency = U16_MAX; + + if (params.accept) { + if (tb[NL80211_NAN_NDP_ATTR_REASON]) { + NL_SET_ERR_MSG_ATTR(info->extack, + tb[NL80211_NAN_NDP_ATTR_REASON], + "REASON is only valid when rejecting"); + return -EINVAL; + } + + if (!tb[NL80211_NAN_NDP_ATTR_RESP_NDI]) { + NL_SET_ERR_MSG(info->extack, + "NDP accept requires RESP_NDI"); + return -EINVAL; + } + params.resp_ndi = nla_data(tb[NL80211_NAN_NDP_ATTR_RESP_NDI]); + if (!nl80211_nan_ndi_exists(rdev, + params.resp_ndi)) { + NL_SET_ERR_MSG_ATTR(info->extack, + tb[NL80211_NAN_NDP_ATTR_RESP_NDI], + "RESP_NDI must identify an existing NAN Data interface"); + return -ENODEV; + } + + if (tb[NL80211_NAN_NDP_ATTR_TRANSPORT_PORT]) { + params.transport_info = true; + params.transport_port = + nla_get_u16(tb[NL80211_NAN_NDP_ATTR_TRANSPORT_PORT]); + params.transport_protocol = + nla_get_u8(tb[NL80211_NAN_NDP_ATTR_TRANSPORT_PROTOCOL]); + } + + if (tb[NL80211_NAN_NDP_ATTR_QOS_MIN_SLOTS]) + params.qos_min_slots = + nla_get_u8(tb[NL80211_NAN_NDP_ATTR_QOS_MIN_SLOTS]); + + if (tb[NL80211_NAN_NDP_ATTR_QOS_MAX_LATENCY]) + params.qos_max_latency = + nla_get_u16(tb[NL80211_NAN_NDP_ATTR_QOS_MAX_LATENCY]); + } else { + if (tb[NL80211_NAN_NDP_ATTR_RESP_NDI] || + tb[NL80211_NAN_NDP_ATTR_CIPHER_SUITE] || + tb[NL80211_NAN_NDP_ATTR_PMK] || + tb[NL80211_NAN_NDP_ATTR_GTK_REQUIRED] || + tb[NL80211_NAN_NDP_ATTR_GTK_CIPHER] || + tb[NL80211_NAN_NDP_ATTR_IPV6_INTF_ID] || + tb[NL80211_NAN_NDP_ATTR_TRANSPORT_PORT] || + tb[NL80211_NAN_NDP_ATTR_TRANSPORT_PROTOCOL] || + tb[NL80211_NAN_NDP_ATTR_QOS_MIN_SLOTS] || + tb[NL80211_NAN_NDP_ATTR_QOS_MAX_LATENCY]) { + NL_SET_ERR_MSG(info->extack, + "RESP_NDI, cipher, PMK, GTK, IPv6 IID, transport info and QoS are only valid when accepting"); + return -EINVAL; + } + + if (tb[NL80211_NAN_NDP_ATTR_REASON]) + params.reason = + nla_get_u8(tb[NL80211_NAN_NDP_ATTR_REASON]); + } + + if (tb[NL80211_NAN_NDP_ATTR_SSI]) { + params.ssi = nla_data(tb[NL80211_NAN_NDP_ATTR_SSI]); + params.ssi_len = nla_len(tb[NL80211_NAN_NDP_ATTR_SSI]); + } + + if (tb[NL80211_NAN_NDP_ATTR_CIPHER_SUITE]) + params.cipher_suite = + nla_get_u32(tb[NL80211_NAN_NDP_ATTR_CIPHER_SUITE]); + + secure_nan = wiphy_ext_feature_isset(&rdev->wiphy, + NL80211_EXT_FEATURE_SECURE_NAN); + if (params.cipher_suite && !secure_nan) { + NL_SET_ERR_MSG_ATTR(info->extack, + tb[NL80211_NAN_NDP_ATTR_CIPHER_SUITE], + "NDP cipher suite requires SECURE_NAN"); + return -EOPNOTSUPP; + } + + if ((tb[NL80211_NAN_NDP_ATTR_PMK] || + tb[NL80211_NAN_NDP_ATTR_GTK_REQUIRED]) && + (!secure_nan || !params.cipher_suite)) { + NL_SET_ERR_MSG(info->extack, + "PMK and GTK require SECURE_NAN and a non-zero cipher suite"); + return -EINVAL; + } + + if (tb[NL80211_NAN_NDP_ATTR_PMK]) { + params.pmk = nla_data(tb[NL80211_NAN_NDP_ATTR_PMK]); + params.pmk_len = nla_len(tb[NL80211_NAN_NDP_ATTR_PMK]); + } + + if (tb[NL80211_NAN_NDP_ATTR_GTK_REQUIRED]) { + if (!tb[NL80211_NAN_NDP_ATTR_GTK_CIPHER]) { + NL_SET_ERR_MSG_ATTR(info->extack, + tb[NL80211_NAN_NDP_ATTR_GTK_REQUIRED], + "GTK_CIPHER is required when GTK_REQUIRED is set"); + return -EINVAL; + } + + params.gtk_required = true; + params.gtk_cipher = + nla_get_u32(tb[NL80211_NAN_NDP_ATTR_GTK_CIPHER]); + } else if (tb[NL80211_NAN_NDP_ATTR_GTK_CIPHER]) { + NL_SET_ERR_MSG_ATTR(info->extack, + tb[NL80211_NAN_NDP_ATTR_GTK_CIPHER], + "GTK_CIPHER requires GTK_REQUIRED"); + return -EINVAL; + } + + if (tb[NL80211_NAN_NDP_ATTR_IPV6_INTF_ID]) + params.ipv6_intf_id = + nla_data(tb[NL80211_NAN_NDP_ATTR_IPV6_INTF_ID]); + + return rdev_nan_ndp_respond(rdev, wdev, ¶ms); +} + static bool nl80211_nan_is_sched_empty(struct cfg80211_nan_local_sched *sched) { if (!sched->n_channels) @@ -22060,6 +22232,13 @@ static const struct genl_small_ops nl80211_small_ops[] = { .internal_flags = IFLAGS(NL80211_FLAG_NEED_WDEV_UP | NL80211_FLAG_CLEAR_SKB), }, + { + .cmd = NL80211_CMD_NAN_NDP_RESPOND, + .doit = nl80211_nan_ndp_respond, + .flags = GENL_ADMIN_PERM, + .internal_flags = IFLAGS(NL80211_FLAG_NEED_WDEV_UP | + NL80211_FLAG_CLEAR_SKB), + }, }; static struct genl_family nl80211_fam __ro_after_init = { diff --git a/net/wireless/rdev-ops.h b/net/wireless/rdev-ops.h index e60478a25a31..c58b83210d60 100644 --- a/net/wireless/rdev-ops.h +++ b/net/wireless/rdev-ops.h @@ -1205,6 +1205,22 @@ rdev_nan_ndp_initiate(struct cfg80211_registered_device *rdev, return ret; } +static inline int +rdev_nan_ndp_respond(struct cfg80211_registered_device *rdev, + struct wireless_dev *wdev, + struct cfg80211_nan_ndp_respond *params) +{ + int ret; + + if (!rdev->ops->nan_ndp_respond) + return -EOPNOTSUPP; + + trace_rdev_nan_ndp_respond(&rdev->wiphy, wdev, params); + ret = rdev->ops->nan_ndp_respond(&rdev->wiphy, wdev, params); + trace_rdev_return_int(&rdev->wiphy, ret); + return ret; +} + static inline int rdev_set_mac_acl(struct cfg80211_registered_device *rdev, struct net_device *dev, struct cfg80211_acl_data *params) diff --git a/net/wireless/trace.h b/net/wireless/trace.h index 2374f90521f1..88eb34a6cf4a 100644 --- a/net/wireless/trace.h +++ b/net/wireless/trace.h @@ -2645,6 +2645,98 @@ TRACE_EVENT(rdev_nan_ndp_initiate, #undef RDEV_NAN_NDP_INITIATE_FMT_4 #undef RDEV_NAN_NDP_INITIATE_FMT_5 +#define NDP_RESP_FMT_1 \ + ", peer_nmi: %pM, ndp_id: %u, init_ndi: %pM, " +#define NDP_RESP_FMT_2 \ + "resp_ndi: %pM, accept: %d, reason: %u, ssi_len: %u, ssi: %s, " +#define NDP_RESP_FMT_3 \ + "cipher_suite: %u, pmk_len: %u, gtk_required: %d, gtk_cipher: %u, " +#define NDP_RESP_FMT_4 \ + "ipv6_intf_id_present: %d, ipv6_intf_id: %s, " \ + "qos_min_slots: %u, qos_max_latency: %u" + +TRACE_EVENT(rdev_nan_ndp_respond, + TP_PROTO(struct wiphy *wiphy, struct wireless_dev *wdev, + struct cfg80211_nan_ndp_respond *params), + TP_ARGS(wiphy, wdev, params), + TP_STRUCT__entry( + WIPHY_ENTRY + WDEV_ENTRY + __array(u8, peer_nmi, ETH_ALEN) + __field(u8, ndp_id) + __array(u8, init_ndi, ETH_ALEN) + __array(u8, resp_ndi, ETH_ALEN) + __field(bool, accept) + __field(u8, reason) + __field(u8, ssi_len) + __dynamic_array(u8, ssi, params->ssi_len) + __field(u32, cipher_suite) + __field(u8, pmk_len) + __field(bool, gtk_required) + __field(u32, gtk_cipher) + __field(bool, transport_info) + __field(u16, transport_port) + __field(u8, transport_protocol) + __field(bool, ipv6_intf_id_present) + __array(u8, ipv6_intf_id, NL80211_NAN_NDP_IPV6_INTF_ID_LEN) + __field(u8, qos_min_slots) + __field(u16, qos_max_latency) + ), + TP_fast_assign( + WIPHY_ASSIGN; + WDEV_ASSIGN; + memcpy(__entry->peer_nmi, params->peer_nmi, ETH_ALEN); + __entry->ndp_id = params->ndp_id; + memcpy(__entry->init_ndi, params->init_ndi, ETH_ALEN); + if (params->resp_ndi) + memcpy(__entry->resp_ndi, params->resp_ndi, ETH_ALEN); + else + memset(__entry->resp_ndi, 0, ETH_ALEN); + __entry->accept = params->accept; + __entry->reason = params->reason; + __entry->ssi_len = params->ssi_len; + if (params->ssi && params->ssi_len) + memcpy(__get_dynamic_array(ssi), params->ssi, + params->ssi_len); + __entry->cipher_suite = params->cipher_suite; + __entry->pmk_len = params->pmk ? params->pmk_len : 0; + __entry->gtk_required = params->gtk_required; + __entry->gtk_cipher = params->gtk_cipher; + __entry->transport_info = params->transport_info; + __entry->transport_port = params->transport_port; + __entry->transport_protocol = params->transport_protocol; + __entry->ipv6_intf_id_present = !!params->ipv6_intf_id; + if (params->ipv6_intf_id) + memcpy(__entry->ipv6_intf_id, params->ipv6_intf_id, + NL80211_NAN_NDP_IPV6_INTF_ID_LEN); + else + memset(__entry->ipv6_intf_id, 0, + NL80211_NAN_NDP_IPV6_INTF_ID_LEN); + __entry->qos_min_slots = params->qos_min_slots; + __entry->qos_max_latency = params->qos_max_latency; + ), + TP_printk(WIPHY_PR_FMT ", " WDEV_PR_FMT + NDP_RESP_FMT_1 NDP_RESP_FMT_2 NDP_RESP_FMT_3 NDP_RESP_FMT_4 + ", transport_info: %d, transport_port: %u, transport_protocol: %u", + WIPHY_PR_ARG, WDEV_PR_ARG, __entry->peer_nmi, __entry->ndp_id, + __entry->init_ndi, __entry->resp_ndi, __entry->accept, + __entry->reason, __entry->ssi_len, + __print_array(__get_dynamic_array(ssi), __entry->ssi_len, + sizeof(u8)), + __entry->cipher_suite, __entry->pmk_len, + __entry->gtk_required, __entry->gtk_cipher, + __entry->ipv6_intf_id_present, + __print_array(__entry->ipv6_intf_id, + NL80211_NAN_NDP_IPV6_INTF_ID_LEN, sizeof(u8)), + __entry->qos_min_slots, __entry->qos_max_latency, + __entry->transport_info, __entry->transport_port, + __entry->transport_protocol) +); +#undef NDP_RESP_FMT_1 +#undef NDP_RESP_FMT_2 +#undef NDP_RESP_FMT_3 +#undef NDP_RESP_FMT_4 + TRACE_EVENT(rdev_set_mac_acl, TP_PROTO(struct wiphy *wiphy, struct net_device *netdev, struct cfg80211_acl_data *params), -- 2.34.1