[PATCH 2/6] ath11k: Add WoW net-detect functionality
Kalle Valo
kvalo at kernel.org
Thu Dec 9 07:03:59 PST 2021
Carl Huang <cjhuang at codeaurora.org> writes:
> Implement net-detect feature by setting flag
> WIPHY_WOWLAN_NET_DETECT if firmware supports this
> feature. Driver sets the related PNO configuration
> to firmware before entering WoW and firmware then
> scans periodically and wakes up host if a specific
> SSID is found.
>
> Tested-on: QCA6390 hw2.0 PCI WLAN.HST.1.0.1-01740-QCAHSTSWPLZ_V2_TO_X86-1
>
> Signed-off-by: Carl Huang <cjhuang at codeaurora.org>
[...]
> +static int ath11k_wmi_pno_check_and_convert(struct ath11k *ar, u32 vdev_id,
> + struct cfg80211_sched_scan_request *nd_config,
> + struct wmi_pno_scan_req *pno)
> +{
> + int i, j;
> + u8 ssid_len;
> +
> + pno->enable = 1;
> + pno->vdev_id = vdev_id;
> + pno->uc_networks_count = nd_config->n_match_sets;
> +
> + if (!pno->uc_networks_count ||
> + pno->uc_networks_count > WMI_PNO_MAX_SUPP_NETWORKS)
> + return -EINVAL;
> +
> + if (nd_config->n_channels > WMI_PNO_MAX_NETW_CHANNELS_EX)
> + return -EINVAL;
> +
> + /* Filling per profile params */
> + for (i = 0; i < pno->uc_networks_count; i++) {
> + ssid_len = nd_config->match_sets[i].ssid.ssid_len;
> +
> + if (ssid_len == 0 || ssid_len > 32)
> + return -EINVAL;
A define for 32 would be nice, WMI_MAC_MAX_SSID_LENGTH has a bad name
but I couldn't find anything better from wmi.h. sizeof(struct
wmi_ssid.ssid) might be other alternative.
But length from cfg80211 should be trustworthy anyway, so I'm not sure
if the check is even needed?
--
https://patchwork.kernel.org/project/linux-wireless/list/
https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches
More information about the ath11k
mailing list