Currently, the P2P GO (Group Owner) prefers the PCL (Preferred Channel
List) from the driver to select the operating channel for group
formation. However, wpa_supplicant is limiting the maximum allowed
channels to "num_pref_freq", even though the driver may return a longer
list.
To fix this, update the logic in p2p_check_pref_chan() to use
ARRAY_SIZE(p2p->pref_freq_list) when passing the size to
get_pref_freq_list(), and update p2p->num_pref_freq based on the value
returned by the driver function. This ensures the preferred frequency
list is sized correctly according to the driver response.
Signed-off-by: Veerendranath Jakkam <vjakkam@qti.qualcomm.com>
Signed-off-by: Kavita Kavita <kkavita@qti.qualcomm.com>
return;
/* Obtain our preferred frequency list from driver based on P2P role. */
- size = P2P_MAX_PREF_CHANNELS;
+ size = ARRAY_SIZE(p2p->pref_freq_list);
if (p2p->cfg->get_pref_freq_list(p2p->cfg->cb_ctx, go,
- &p2p->num_pref_freq,
+ &size,
p2p->pref_freq_list))
return;
- size = p2p->num_pref_freq;
+ p2p->num_pref_freq = size;
if (!size)
return;
/* Filter out frequencies that are not acceptable for P2P use */