ath lor
Adrian Chadd
adrian.chadd at gmail.com
Tue Jul 31 01:22:44 UTC 2012
Yeah, That's what I had in mind.
Trouble is, the AID isn't fixed at that value:
vap->iv_max_aid = IEEE80211_AID_DEF;
So likely we should malloc (M_NOWAIT | M_ZERO) a temporary array of
size iv_max_aid.
Have you seen the scan/node LORs? Are you able to verify that your
change fixes that?
Adrian
On 30 July 2012 18:17, PseudoCylon <moonlightakkiy at yahoo.ca> wrote:
> On Mon, Jul 30, 2012 at 3:16 AM, PseudoCylon <moonlightakkiy at yahoo.ca> wrote:
>>> ------------------------------
>>>
>>> Message: 3
>>> Date: Sat, 28 Jul 2012 19:36:38 -0700
>>> From: Adrian Chadd <adrian.chadd at gmail.com>
>>> Subject: Re: ath lor
>>> To: Kim Culhan <w8hdkim at gmail.com>
>>> Cc: freebsd-wireless at freebsd.org
>>> Message-ID:
>>> <CAJ-VmonVdu8QEETKeBF6HOY5DTzxT4OH6z8xJecUGZgmQ58grw at mail.gmail.com>
>>> Content-Type: text/plain; charset=ISO-8859-1
>>>
>>> Hm, if someone's up for a bit of coding, here's my suggestIon:
>>>
>>> * create an iterator struct which just contains an array of
>>> ieee80211_node entries;
>>> * write an iterator function that _just_ populates that iterator
>>> struct with ieee80211 node entries, but after having locked them;
>>> * then, once the call to ieee80211_iterate_node() is done, the
>>> iterator struct will have a list of nodes to iterate over;
>>> * then just call the original callback over each member of that
>>> iterator struct node array, derefing nodes as you go along.
>>>
>>
>
> [RFC]
> I guess this what you want. ieee80211_timeout_stations() needs a
> special attention, though.
>
> ieee80211_iterate_nt(struct node_table *nt, struct ieee80211_node *ni_arr,
> u_int *gen)
> {
> struct ieee80211_node *ni;
> int i = 0;
>
> IEEE80211_NODE_ITERATE_LOCK(nt);
> *gen = ++nt->nt_scangen;
>
> TAILQ_FOREACH(ni, &nt->nt_node, ni_list)
> (ni_arr + i++) = ieee80211_ref_node(ni);
>
> IEEE80211_NODE_ITERATE_UNLOCK(nt);
> }
>
> /*
> * Just a wrapper, so we don't have to change every ieee80211_iterate_nodes()
> * reference in the source.
> *
> * A caller may directly call ieee80211_iterate_nt() and do customized stuff.
> * Only requirement is to decrement each node's ref count.
> */
> ieee80211_iterate_nodes(struct ieee80211_node_table *nt,
> ieee80211_iter_func *f, void *arg)
> {
> /*
> * Any driver should allocate array with own max aid
> * when directly calling ieee80211_iterate_nt().
> */
> struct ieee80211_node *ni_arr[IEEE80211_AID_DEF];
> u_int gen;
> int i;
>
> memset(ni_arr, 0, sizeof(ni_arr));
> ieee80211_iterate_nt(nt, ni_arr, &gen);
>
> IEEE80211_NODE_LOCK(nt);
>
> for (i = 0; i < IEEE80211_AID_DEF; i++) {
> if (ni == NULL) /* end of the list */
> break;
> if (ni->ni_scangen == gen)
> continue;
>
> ni->ni_scangen = gen;
>
> IEEE80211_NODE_UNLOCK(nt);
> (*f)(arg, ni_arr + i);
> /* ieee80211_free_node() locks by itself */
> ieee80211_free_node(ni);
> IEEE80211_NODE_LOCK(nt);
>
> i = 0;
> }
>
> IEEE80211_NODE_UNLOCK(nt);
> }
More information about the freebsd-wireless
mailing list