aboutsummaryrefslogtreecommitdiffstats
path: root/net/wireless/nl80211.c
diff options
context:
space:
mode:
Diffstat (limited to 'net/wireless/nl80211.c')
-rw-r--r--net/wireless/nl80211.c43
1 files changed, 38 insertions, 5 deletions
diff --git a/net/wireless/nl80211.c b/net/wireless/nl80211.c
index 19dc796bb0b8..909ebd6ec78b 100644
--- a/net/wireless/nl80211.c
+++ b/net/wireless/nl80211.c
@@ -3563,11 +3563,43 @@ void nl80211_notify_dev_rename(struct cfg80211_registered_device *rdev)
3563 genlmsg_multicast(msg, 0, nl80211_config_mcgrp.id, GFP_KERNEL); 3563 genlmsg_multicast(msg, 0, nl80211_config_mcgrp.id, GFP_KERNEL);
3564} 3564}
3565 3565
3566static int nl80211_add_scan_req(struct sk_buff *msg,
3567 struct cfg80211_registered_device *rdev)
3568{
3569 struct cfg80211_scan_request *req = rdev->scan_req;
3570 struct nlattr *nest;
3571 int i;
3572
3573 if (WARN_ON(!req))
3574 return 0;
3575
3576 nest = nla_nest_start(msg, NL80211_ATTR_SCAN_SSIDS);
3577 if (!nest)
3578 goto nla_put_failure;
3579 for (i = 0; i < req->n_ssids; i++)
3580 NLA_PUT(msg, i, req->ssids[i].ssid_len, req->ssids[i].ssid);
3581 nla_nest_end(msg, nest);
3582
3583 nest = nla_nest_start(msg, NL80211_ATTR_SCAN_FREQUENCIES);
3584 if (!nest)
3585 goto nla_put_failure;
3586 for (i = 0; i < req->n_channels; i++)
3587 NLA_PUT_U32(msg, i, req->channels[i]->center_freq);
3588 nla_nest_end(msg, nest);
3589
3590 if (req->ie)
3591 NLA_PUT(msg, NL80211_ATTR_IE, req->ie_len, req->ie);
3592
3593 return 0;
3594 nla_put_failure:
3595 return -ENOBUFS;
3596}
3597
3566static int nl80211_send_scan_donemsg(struct sk_buff *msg, 3598static int nl80211_send_scan_donemsg(struct sk_buff *msg,
3567 struct cfg80211_registered_device *rdev, 3599 struct cfg80211_registered_device *rdev,
3568 struct net_device *netdev, 3600 struct net_device *netdev,
3569 u32 pid, u32 seq, int flags, 3601 u32 pid, u32 seq, int flags,
3570 u32 cmd) 3602 u32 cmd)
3571{ 3603{
3572 void *hdr; 3604 void *hdr;
3573 3605
@@ -3578,7 +3610,8 @@ static int nl80211_send_scan_donemsg(struct sk_buff *msg,
3578 NLA_PUT_U32(msg, NL80211_ATTR_WIPHY, rdev->wiphy_idx); 3610 NLA_PUT_U32(msg, NL80211_ATTR_WIPHY, rdev->wiphy_idx);
3579 NLA_PUT_U32(msg, NL80211_ATTR_IFINDEX, netdev->ifindex); 3611 NLA_PUT_U32(msg, NL80211_ATTR_IFINDEX, netdev->ifindex);
3580 3612
3581 /* XXX: we should probably bounce back the request? */ 3613 /* ignore errors and send incomplete event anyway */
3614 nl80211_add_scan_req(msg, rdev);
3582 3615
3583 return genlmsg_end(msg, hdr); 3616 return genlmsg_end(msg, hdr);
3584 3617