On Fri, 2008-02-29 at 17:31 -0800, Luis Carlos Cobo wrote: > On Mon, 2008-02-25 at 17:03 +0100, Johannes Berg wrote: > > Can you do that in both nl80211 and mac80211 for both STAs and paths? > > Look at net/netlink/genetlink.c ctrl_dumpfamily() for an example. > > I'm not sure I completely get what changes are necessary. > > What I understand is that I should acquire (if idx == 0) and release > (just before returning -ENOENT) the rtnl_lock() from within (mac80211 or > equivalent) dump_station function instead of from nl80211_dump_station. > Is this the whole idea? I think it's a bit more complicated because nl80211's dump_station() can also be invoked multiple times. To guarantee the cfg80211 rtnl_lock() promise, dump_station() should acquire the rtnl and all locks it needs when it first enters the function (oh. that's actually a bug in the other functions too, they should acquire the mutex conditionally, will fix). mac80211 also needs to acquire the sta_lock because otherwise stations can be added or removed while dumping. I suppose the struct netlink_callback needs to be passed through to mac80211's dump function with the limitation that the first two entries are already used by nl80211... johannes
Attachment:
signature.asc
Description: This is a digitally signed message part