[PATCH v2 03/10] wifi: ath12k: implement handling of P2P NoA event
Jeff Johnson
quic_jjohnson at quicinc.com
Fri Jan 12 17:22:35 PST 2024
On 1/12/2024 1:28 AM, Kang Yang wrote:
> The NoA(Notice of Absence) attribute is used by the P2P Group Owner to
> signal its absence due to power save timing, concurrent operation, or
> off-channel scanning. It is also used in the P2P Presence Request-Response
> mechanism.
>
> The NoA attribute shall be present in the P2P IE in the beacon frames
> transmitted by a P2P Group Owner when a NoA schedule is being advertised,
> or when the CTWindow is non-zero.
>
> So add support to update P2P information after P2P GO is up through
> event WMI_P2P_NOA_EVENTID, and always put it in probe resp.
>
> Create p2p.c and p2p.h for P2P related functions and definitions.
>
> Tested-on: WCN7850 hw2.0 PCI WLAN.HMT.1.0.c5-00481-QCAHMTSWPL_V1.0_V2.0_SILICONZ-3
> Tested-on: QCN9274 hw2.0 PCI WLAN.WBE.1.0.1-00029-QCAHKSWPL_SILICONZ-1
>
> Signed-off-by: Kang Yang <quic_kangyang at quicinc.com>
> ---
>
> v2: add Tested-on tag of QCN9274.
>
> ---
> drivers/net/wireless/ath/ath12k/Makefile | 3 +-
> drivers/net/wireless/ath/ath12k/mac.c | 25 +++-
> drivers/net/wireless/ath/ath12k/p2p.c | 142 +++++++++++++++++++++++
> drivers/net/wireless/ath/ath12k/p2p.h | 23 ++++
> drivers/net/wireless/ath/ath12k/wmi.c | 51 +++++++-
> drivers/net/wireless/ath/ath12k/wmi.h | 31 +++++
> 6 files changed, 272 insertions(+), 3 deletions(-)
> create mode 100644 drivers/net/wireless/ath/ath12k/p2p.c
> create mode 100644 drivers/net/wireless/ath/ath12k/p2p.h
>
...
> @@ -6667,6 +6672,47 @@ static void ath12k_probe_resp_tx_status_event(struct ath12k_base *ab,
> kfree(tb);
> }
>
> +static int ath12k_wmi_p2p_noa_event(struct ath12k_base *ab,
> + struct sk_buff *skb)
> +{
> + const void **tb;
> + const struct wmi_p2p_noa_event *ev;
> + const struct ath12k_wmi_p2p_noa_info *noa;
> + struct ath12k *ar;
> + int ret, vdev_id;
> +
> + tb = ath12k_wmi_tlv_parse_alloc(ab, skb, GFP_ATOMIC);
> + if (IS_ERR(tb)) {
> + ret = PTR_ERR(tb);
> + ath12k_warn(ab, "failed to parse tlv: %d\n", ret);
> + return ret;
> + }
> +
> + ev = tb[WMI_TAG_P2P_NOA_EVENT];
> + noa = tb[WMI_TAG_P2P_NOA_INFO];
> +
> + if (!ev || !noa) {
> + kfree(tb);
> + return -EPROTO;
> + }
> +
> + vdev_id = __le32_to_cpu(ev->vdev_id);
> +
> + ath12k_dbg(ab, ATH12K_DBG_WMI,
> + "wmi tlv p2p noa vdev_id %i descriptors %u\n",
> + vdev_id, le32_get_bits(noa->noa_attr, WMI_P2P_NOA_INFO_DESC_NUM));
> + ar = ath12k_mac_get_ar_by_vdev_id(ab, vdev_id);
> + if (!ar) {
missing kfree(tb);
> + ath12k_warn(ab, "invalid vdev id %d in P2P NoA event\n",
> + vdev_id);
> + return -EINVAL;
> + }
> +
> + ath12k_p2p_noa_update_by_vdev_id(ar, vdev_id, noa);
> + kfree(tb);
> + return 0;
> +}
> +
> static void ath12k_rfkill_state_change_event(struct ath12k_base *ab,
> struct sk_buff *skb)
> {
More information about the ath12k
mailing list