On Tue, Oct 8, 2013 at 11:53 AM, Johannes Berg <johannes@xxxxxxxxxxxxxxxx> wrote: > From: Johannes Berg <johannes.berg@xxxxxxxxx> > > Add support for vendor-specific commands to nl80211. This is > intended to be used for really vendor-specific functionality > that can't be implemented in a generic fashion for any reason. > It's *NOT* intended to be used for any normal/generic feature > or any optimisations that could be implemented across drivers. > > Currently, only vendor commands (with replies) are supported, > no dump operations or vendor-specific notifications. > > Signed-off-by: Johannes Berg <johannes.berg@xxxxxxxxx> > --- [...] > > #ifdef CONFIG_NL80211_TESTMODE > static struct genl_multicast_group nl80211_testmode_mcgrp = { > @@ -6633,11 +6686,11 @@ static int nl80211_testmode_do(struct sk_buff *skb, struct genl_info *info) > if (!info->attrs[NL80211_ATTR_TESTDATA]) > return -EINVAL; > > - rdev->testmode_info = info; > + rdev->cur_cmd_info = info; > err = rdev_testmode_cmd(rdev, wdev, > nla_data(info->attrs[NL80211_ATTR_TESTDATA]), > nla_len(info->attrs[NL80211_ATTR_TESTDATA])); > - rdev->testmode_info = NULL; > + rdev->cur_cmd_info = NULL; > > return err; > } [...] > + > +int cfg80211_vendor_cmd_reply(struct sk_buff *skb) > +{ > + struct cfg80211_registered_device *rdev = ((void **)skb->cb)[0]; > + void *hdr = ((void **)skb->cb)[1]; > + struct nlattr *data = ((void **)skb->cb)[2]; > + > + if (WARN_ON(!rdev->cur_cmd_info)) { > + kfree_skb(skb); > + return -EINVAL; > + } > + > + nla_nest_end(skb, data); > + genlmsg_end(skb, hdr); > + return genlmsg_reply(skb, rdev->cur_cmd_info); > +} don't you miss the rdev->cur_cmd_info initialization in case of vendor_cmd (like it's being done in testmode)? Eliad. -- 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