[PATCH 01/10] wifi: nl80211: split helper function from nl80211_put_iface_combinations
Johannes Berg
johannes at sipsolutions.net
Fri Jun 28 01:01:39 PDT 2024
On Thu, 2024-06-20 at 13:11 +0200, Felix Fietkau wrote:
>
> +static int nl80211_put_ifcomb_data(struct sk_buff *msg, bool large, int idx,
> + const struct ieee80211_iface_combination *c)
> {
> - struct nlattr *nl_combis;
> - int i, j;
> + struct nlattr *nl_combi, *nl_limits;
> + int i;
>
> - nl_combis = nla_nest_start_noflag(msg,
> - NL80211_ATTR_INTERFACE_COMBINATIONS);
> - if (!nl_combis)
> + nl_combi = nla_nest_start_noflag(msg, idx);
> + if (!nl_combi)
> goto nla_put_failure;
Not sure why the diff looks so much different here between my git and
yours, but anyway ...
Even if it's ugly here, I do think you should add an argument to the
function
..., u16 nested
pass 0 for the existing user, and NLA_F_NESTED for the later new users,
and use
nla_nest_start_noflag(msg, idx | nested);
etc. for all the nla_nest_start_noflag() calls in this function. I
really don't want to propagate the _noflag() API further.
(The above was the simplest I could come up with, maybe you can find a
better solution, but callikng nla_nest_start() conditionally seemed
worse)
johannes
More information about the ath12k
mailing list