Re: [PATCH wireless-next v4 09/21] wifi: nl80211/cfg80211: add support for SMD context programming

From: Johannes Berg

Date: Mon Nov 16 2026 - 06:26:11 EST


On Fri, 2026-11-13 at 23:24 +0530, Pooventhiran G wrote:
>
> There were similar changes done for array of values for
> NL80211_ATTR_CNTDWN_OFFS_BEACON, NL80211_ATTR_SCAN_FREQUENCIES, etc., So, this
> approach was done here to make sure that each SN in the array was u16 as
> expected. If there _is_ a way to add policies for the iterator-based nesting
> of such values that you could point me to, I will change accordingly.
>
> [1] =>
>
> struct nla_policy sn_policy[8] = {
> [0] = { .type = NLA_U16 },
> [1] = { .type = NLA_U16 },
> ...
> [7] = { .type = NLA_U16 },
> }
>

Wait, I thought you _had_ a policy for this? Sorry! I also thought we
had a macro for such policies, but ... I guess not?

There's a preference for using a single attribute multiple times to get
an array, in part for this reason, but we've never done that really in
nl80211. Maybe see how that'd be?

johannes