[PATCH v2 03/10] wifi: ath12k: implement handling of P2P NoA event
Kalle Valo
kvalo at kernel.org
Wed Jan 17 05:22:33 PST 2024
Kang Yang <quic_kangyang at quicinc.com> writes:
> 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>
[...]
> +static void ath12k_mac_add_p2p_noa_ie(struct ath12k *ar,
> + struct ieee80211_vif *vif,
> + struct sk_buff *skb,
> + bool is_prb_rsp)
> +{
> + struct ath12k_vif *arvif = ath12k_vif_to_arvif(vif);
> +
> + if (likely(!is_prb_rsp))
> + return;
> +
> + spin_lock_bh(&ar->data_lock);
> + if (arvif->u.ap.noa_data)
> + if (!pskb_expand_head(skb, 0, arvif->u.ap.noa_len,
> + GFP_ATOMIC))
> + skb_put_data(skb, arvif->u.ap.noa_data,
> + arvif->u.ap.noa_len);
> + spin_unlock_bh(&ar->data_lock);
> +}
The if checks can be simplified and please add empty lines:
spin_lock_bh(&ar->data_lock);
if (arvif->u.ap.noa_data &&
!pskb_expand_head(skb, 0, arvif->u.ap.noa_len, GFP_ATOMIC))
skb_put_data(skb, arvif->u.ap.noa_data,
arvif->u.ap.noa_len);
spin_unlock_bh(&ar->data_lock);
Though I'm not really fond of the idea having pskb_expand_head() call
within the if check but I guess it's the cleanest option here.
--
https://patchwork.kernel.org/project/linux-wireless/list/
https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches
More information about the ath12k
mailing list