Search Linux Wireless

Re: [RFC] cfg80211: Make NL80211_CMD_SET_REG synchronous

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Am Dienstag, 7. Dezember 2010 schrieb Johannes Berg:
> On Tue, 2010-12-07 at 10:45 +0100, Helmut Schaa wrote:
> > A user space caller of NL80211_CMD_SET_REG previously had no chance to
> > verify if the regulatory domain change it requested already happened.
> > Listening to NL80211_CMD_REG_CHANGE is not enough since it won't be
> > triggered when the regulatory domain didn't change (for example because
> > it was already the same before).
> > 
> > Fix this by making NL80211_CMD_SET_REG synchronous by adding a
> > completion struct to the regulatory_hint_user function and wait for the
> > completion of the regulatory request before returning.
> 
> Way too complicated. regulatory_hint_user() is called in a context that
> can sleep, obviously, so you can just make it call something like
> run_regulatory_request() that will cancel_work_sync(reg_work) and call
> reg_todo() after queueing, instead of schedule_work(reg_work)  -- that
> way when it returns all things have been processed.

Sounds good, but that would also change the other calls to regulatory_hint_user
(regulatory_init & restore_regulatory_settings), not just the netlink command
from user space. Not sure if it is reasoable to wait for these callers as well?

Second, since reg_process_pending_hints and reg_process_pending_hints are mutex
protected we wouldn't even have to to call cancel_work_sync to ensure
serialization.

Helmut
--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Host AP]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [Linux Kernel]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Samba]     [Device Mapper]
  Powered by Linux