On Thu, 2009-07-16 at 15:55 -0700, Luis R. Rodriguez wrote: > + * NL80211_WOW_TRIGGER_DISABLE_ALL: Disables all WoW triggers on > + * the device. I don't understand the need for this. How is that different from userspace passing a 0 value for the attribute? > + triggers_requested = > + nla_get_u32(info->attrs[NL80211_ATTR_WOW_TRIGGERS_ENABLED]); > + > + if (triggers_requested & NL80211_WOW_TRIGGER_DISABLE_ALL) { > + rdev->wow.triggers_enabled = 0; > + goto out; > + } I mean, what do these extra lines of code buy us? > + /* We only support magic packet right now */ > + if (!triggers_requested || > + !(triggers_requested & NL80211_WOW_TRIGGER_MAGIC_PACKET)) { > + err = -EOPNOTSUPP; > + goto out; > + } Oi that seems like a roundabout way of saying if (triggers_requested & ~NL80211_WOW_TRIGGER_MAGIC_PACKET) ... > + mutex_lock(&rdev->devlist_mtx); > + /* > + * It only makes sense to enable WoW if we're associated as a STA, > + * the AP should be buffering frames for us. We'll discard all frames > + * and only process the frames which will trigger us on in hardware. > + */ > + list_for_each_entry(wdev, &rdev->netdev_list, list) { I don't understand. You already have a netdev pointer from get_rdev_dev_by_info_ifindex(info->attrs, &rdev, &dev); why not just check the corresponding wdev for that netdev? I would store this netdev in the cfg80211_wow struct too, so you know on __cfg80211_disconnected() whether it was this netdev. And reject wow configuration if a wow configuration is already active for a different netdev? That way you can configure wow 'per netdev' but it's really only for one at a time. johannes
Attachment:
signature.asc
Description: This is a digitally signed message part