[PATCH] P2P return a successful response for p2p presence request if driver has return noa_len greater than 0
Johannes Berg
johannes
Mon Nov 21 01:10:04 PST 2011
Hi Neeraj,
> Thanks for your comments. I agree that this area needs a lot of work
> but I think it is safe to return P2P_SC_SUCCESS if curr_noa_len > 0.
> Once nl gives support to these cmds like (get_noa/set_noa), we can
> always revisit the code once it is properly implemented.
I disagree, see below.
> May I ask what is the purpose of returning
> P2P_SC_FAIL_UNABLE_TO_ACCOMMODATE if driver returned noa_len > 0?
If the driver returned noa_len > 0, that means that a NoA schedule is in
effect. That means that we don't know, without parsing the NoA schedule,
whether or not the presence request can be fulfilled. Therefore, we must
return UNABLE_TO_ACCOMODATE.
With nl80211, unfortunately this logic is broken because the driver
doesn't return a NoA schedule, so noa_len is always == 0 (I think?) and
we shouldn't be returning SUCCESS even in that case because the driver
or device might internally have a NoA schedule in effect.
I'm not convinced that get_noa/set_noa is the right answer to this.
get_noa is virtually impossible to implement in a race-free manner at
least as far as presence requests are confirmed, and set_noa is really
only a testing hook.
I think the right answer may be to ask the driver for each presence
request and return UNABLE_TO_ACCOMODATE if the driver doesn't implement
the function.
johannes
More information about the Hostap
mailing list