2016-10-22 19:13:10

by Arend Van Spriel

[permalink] [raw]
Subject: cookie_counter in wiphy object

Hi Johannes,

Since commit a442b761b24b ("cfg80211: add add_nan_func / del_nan_func")
there is a cookie_counter in the wiphy object. It is only used by the
add_nan_func now, but do we want to consolidate all cookie returning
functions to use this cookie counter, eg. in .remain_on_channel callback.

Regards,
Arend


2016-10-22 20:26:29

by Johannes Berg

[permalink] [raw]
Subject: Re: cookie_counter in wiphy object


> Since commit a442b761b24b ("cfg80211: add add_nan_func /
> del_nan_func")
> there is a cookie_counter in the wiphy object. It is only used by the
> add_nan_func now, but do we want to consolidate all cookie returning
> functions to use this cookie counter, eg. in .remain_on_channel
> callback.

We probably could now. We used to use pointers and various other kinds
of crappy things for the cookies, but the counters are much safer,
reliable, and easier to debug. Naturally, it fell out that then the
cookies would be assigned in the drivers (well, mac80211), but here I
asked that be changed - I wouldn't mind changing it for other things as
well.

johannes