aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/net/wireless/ti/wl18xx/event.c4
-rw-r--r--include/net/cfg80211.h14
-rw-r--r--net/wireless/nl80211.c19
3 files changed, 27 insertions, 10 deletions
diff --git a/drivers/net/wireless/ti/wl18xx/event.c b/drivers/net/wireless/ti/wl18xx/event.c
index c28f06854195..548bb9e7e91e 100644
--- a/drivers/net/wireless/ti/wl18xx/event.c
+++ b/drivers/net/wireless/ti/wl18xx/event.c
@@ -77,7 +77,7 @@ static int wlcore_smart_config_sync_event(struct wl1271 *wl, u8 sync_channel,
77 wl1271_debug(DEBUG_EVENT, 77 wl1271_debug(DEBUG_EVENT,
78 "SMART_CONFIG_SYNC_EVENT_ID, freq: %d (chan: %d band %d)", 78 "SMART_CONFIG_SYNC_EVENT_ID, freq: %d (chan: %d band %d)",
79 freq, sync_channel, sync_band); 79 freq, sync_channel, sync_band);
80 skb = cfg80211_vendor_event_alloc(wl->hw->wiphy, 20, 80 skb = cfg80211_vendor_event_alloc(wl->hw->wiphy, NULL, 20,
81 WLCORE_VENDOR_EVENT_SC_SYNC, 81 WLCORE_VENDOR_EVENT_SC_SYNC,
82 GFP_KERNEL); 82 GFP_KERNEL);
83 83
@@ -98,7 +98,7 @@ static int wlcore_smart_config_decode_event(struct wl1271 *wl,
98 wl1271_debug(DEBUG_EVENT, "SMART_CONFIG_DECODE_EVENT_ID"); 98 wl1271_debug(DEBUG_EVENT, "SMART_CONFIG_DECODE_EVENT_ID");
99 wl1271_dump_ascii(DEBUG_EVENT, "SSID:", ssid, ssid_len); 99 wl1271_dump_ascii(DEBUG_EVENT, "SSID:", ssid, ssid_len);
100 100
101 skb = cfg80211_vendor_event_alloc(wl->hw->wiphy, 101 skb = cfg80211_vendor_event_alloc(wl->hw->wiphy, NULL,
102 ssid_len + pwd_len + 20, 102 ssid_len + pwd_len + 20,
103 WLCORE_VENDOR_EVENT_SC_DECODE, 103 WLCORE_VENDOR_EVENT_SC_DECODE,
104 GFP_KERNEL); 104 GFP_KERNEL);
diff --git a/include/net/cfg80211.h b/include/net/cfg80211.h
index 28fff56f5606..12a6121ea76e 100644
--- a/include/net/cfg80211.h
+++ b/include/net/cfg80211.h
@@ -4295,6 +4295,7 @@ struct sk_buff *__cfg80211_alloc_reply_skb(struct wiphy *wiphy,
4295 int approxlen); 4295 int approxlen);
4296 4296
4297struct sk_buff *__cfg80211_alloc_event_skb(struct wiphy *wiphy, 4297struct sk_buff *__cfg80211_alloc_event_skb(struct wiphy *wiphy,
4298 struct wireless_dev *wdev,
4298 enum nl80211_commands cmd, 4299 enum nl80211_commands cmd,
4299 enum nl80211_attrs attr, 4300 enum nl80211_attrs attr,
4300 int vendor_event_idx, 4301 int vendor_event_idx,
@@ -4349,6 +4350,7 @@ int cfg80211_vendor_cmd_reply(struct sk_buff *skb);
4349/** 4350/**
4350 * cfg80211_vendor_event_alloc - allocate vendor-specific event skb 4351 * cfg80211_vendor_event_alloc - allocate vendor-specific event skb
4351 * @wiphy: the wiphy 4352 * @wiphy: the wiphy
4353 * @wdev: the wireless device
4352 * @event_idx: index of the vendor event in the wiphy's vendor_events 4354 * @event_idx: index of the vendor event in the wiphy's vendor_events
4353 * @approxlen: an upper bound of the length of the data that will 4355 * @approxlen: an upper bound of the length of the data that will
4354 * be put into the skb 4356 * be put into the skb
@@ -4357,16 +4359,20 @@ int cfg80211_vendor_cmd_reply(struct sk_buff *skb);
4357 * This function allocates and pre-fills an skb for an event on the 4359 * This function allocates and pre-fills an skb for an event on the
4358 * vendor-specific multicast group. 4360 * vendor-specific multicast group.
4359 * 4361 *
4362 * If wdev != NULL, both the ifindex and identifier of the specified
4363 * wireless device are added to the event message before the vendor data
4364 * attribute.
4365 *
4360 * When done filling the skb, call cfg80211_vendor_event() with the 4366 * When done filling the skb, call cfg80211_vendor_event() with the
4361 * skb to send the event. 4367 * skb to send the event.
4362 * 4368 *
4363 * Return: An allocated and pre-filled skb. %NULL if any errors happen. 4369 * Return: An allocated and pre-filled skb. %NULL if any errors happen.
4364 */ 4370 */
4365static inline struct sk_buff * 4371static inline struct sk_buff *
4366cfg80211_vendor_event_alloc(struct wiphy *wiphy, int approxlen, 4372cfg80211_vendor_event_alloc(struct wiphy *wiphy, struct wireless_dev *wdev,
4367 int event_idx, gfp_t gfp) 4373 int approxlen, int event_idx, gfp_t gfp)
4368{ 4374{
4369 return __cfg80211_alloc_event_skb(wiphy, NL80211_CMD_VENDOR, 4375 return __cfg80211_alloc_event_skb(wiphy, wdev, NL80211_CMD_VENDOR,
4370 NL80211_ATTR_VENDOR_DATA, 4376 NL80211_ATTR_VENDOR_DATA,
4371 event_idx, approxlen, gfp); 4377 event_idx, approxlen, gfp);
4372} 4378}
@@ -4467,7 +4473,7 @@ static inline int cfg80211_testmode_reply(struct sk_buff *skb)
4467static inline struct sk_buff * 4473static inline struct sk_buff *
4468cfg80211_testmode_alloc_event_skb(struct wiphy *wiphy, int approxlen, gfp_t gfp) 4474cfg80211_testmode_alloc_event_skb(struct wiphy *wiphy, int approxlen, gfp_t gfp)
4469{ 4475{
4470 return __cfg80211_alloc_event_skb(wiphy, NL80211_CMD_TESTMODE, 4476 return __cfg80211_alloc_event_skb(wiphy, NULL, NL80211_CMD_TESTMODE,
4471 NL80211_ATTR_TESTDATA, -1, 4477 NL80211_ATTR_TESTDATA, -1,
4472 approxlen, gfp); 4478 approxlen, gfp);
4473} 4479}
diff --git a/net/wireless/nl80211.c b/net/wireless/nl80211.c
index 66666fdf1c8d..01874628ae00 100644
--- a/net/wireless/nl80211.c
+++ b/net/wireless/nl80211.c
@@ -7389,8 +7389,8 @@ static int nl80211_set_mcast_rate(struct sk_buff *skb, struct genl_info *info)
7389 7389
7390static struct sk_buff * 7390static struct sk_buff *
7391__cfg80211_alloc_vendor_skb(struct cfg80211_registered_device *rdev, 7391__cfg80211_alloc_vendor_skb(struct cfg80211_registered_device *rdev,
7392 int approxlen, u32 portid, u32 seq, 7392 struct wireless_dev *wdev, int approxlen,
7393 enum nl80211_commands cmd, 7393 u32 portid, u32 seq, enum nl80211_commands cmd,
7394 enum nl80211_attrs attr, 7394 enum nl80211_attrs attr,
7395 const struct nl80211_vendor_cmd_info *info, 7395 const struct nl80211_vendor_cmd_info *info,
7396 gfp_t gfp) 7396 gfp_t gfp)
@@ -7421,6 +7421,16 @@ __cfg80211_alloc_vendor_skb(struct cfg80211_registered_device *rdev,
7421 goto nla_put_failure; 7421 goto nla_put_failure;
7422 } 7422 }
7423 7423
7424 if (wdev) {
7425 if (nla_put_u64(skb, NL80211_ATTR_WDEV,
7426 wdev_id(wdev)))
7427 goto nla_put_failure;
7428 if (wdev->netdev &&
7429 nla_put_u32(skb, NL80211_ATTR_IFINDEX,
7430 wdev->netdev->ifindex))
7431 goto nla_put_failure;
7432 }
7433
7424 data = nla_nest_start(skb, attr); 7434 data = nla_nest_start(skb, attr);
7425 7435
7426 ((void **)skb->cb)[0] = rdev; 7436 ((void **)skb->cb)[0] = rdev;
@@ -7435,6 +7445,7 @@ __cfg80211_alloc_vendor_skb(struct cfg80211_registered_device *rdev,
7435} 7445}
7436 7446
7437struct sk_buff *__cfg80211_alloc_event_skb(struct wiphy *wiphy, 7447struct sk_buff *__cfg80211_alloc_event_skb(struct wiphy *wiphy,
7448 struct wireless_dev *wdev,
7438 enum nl80211_commands cmd, 7449 enum nl80211_commands cmd,
7439 enum nl80211_attrs attr, 7450 enum nl80211_attrs attr,
7440 int vendor_event_idx, 7451 int vendor_event_idx,
@@ -7460,7 +7471,7 @@ struct sk_buff *__cfg80211_alloc_event_skb(struct wiphy *wiphy,
7460 return NULL; 7471 return NULL;
7461 } 7472 }
7462 7473
7463 return __cfg80211_alloc_vendor_skb(rdev, approxlen, 0, 0, 7474 return __cfg80211_alloc_vendor_skb(rdev, wdev, approxlen, 0, 0,
7464 cmd, attr, info, gfp); 7475 cmd, attr, info, gfp);
7465} 7476}
7466EXPORT_SYMBOL(__cfg80211_alloc_event_skb); 7477EXPORT_SYMBOL(__cfg80211_alloc_event_skb);
@@ -9906,7 +9917,7 @@ struct sk_buff *__cfg80211_alloc_reply_skb(struct wiphy *wiphy,
9906 if (WARN_ON(!rdev->cur_cmd_info)) 9917 if (WARN_ON(!rdev->cur_cmd_info))
9907 return NULL; 9918 return NULL;
9908 9919
9909 return __cfg80211_alloc_vendor_skb(rdev, approxlen, 9920 return __cfg80211_alloc_vendor_skb(rdev, NULL, approxlen,
9910 rdev->cur_cmd_info->snd_portid, 9921 rdev->cur_cmd_info->snd_portid,
9911 rdev->cur_cmd_info->snd_seq, 9922 rdev->cur_cmd_info->snd_seq,
9912 cmd, attr, NULL, GFP_KERNEL); 9923 cmd, attr, NULL, GFP_KERNEL);