From patchwork Mon Nov 1 11:52:09 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Luciano Coelho X-Patchwork-Id: 294382 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter1.kernel.org (8.14.4/8.14.3) with ESMTP id oA1CQNAe000565 for ; Mon, 1 Nov 2010 12:26:23 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757458Ab0KAM0Q (ORCPT ); Mon, 1 Nov 2010 08:26:16 -0400 Received: from mgw-da01.nokia.com ([147.243.128.24]:26102 "EHLO mgw-da01.nokia.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1757412Ab0KAMZ7 (ORCPT ); Mon, 1 Nov 2010 08:25:59 -0400 Received: from localhost.localdomain (chilepepper.research.nokia.com [172.21.50.167]) by mgw-da01.nokia.com (Switch-3.4.3/Switch-3.4.3) with ESMTP id oA1BqGcK020116 for ; Mon, 1 Nov 2010 13:52:24 +0200 From: Luciano Coelho To: linux-wireless@vger.kernel.org Subject: [RFC 08/15] nl80211: report periodic scan results Date: Mon, 1 Nov 2010 13:52:09 +0200 Message-Id: <1288612336-2830-9-git-send-email-luciano.coelho@nokia.com> X-Mailer: git-send-email 1.7.0.4 In-Reply-To: <1288612336-2830-1-git-send-email-luciano.coelho@nokia.com> References: <1288612336-2830-1-git-send-email-luciano.coelho@nokia.com> X-Nokia-AV: Clean Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.3 (demeter1.kernel.org [140.211.167.41]); Mon, 01 Nov 2010 12:26:23 +0000 (UTC) diff --git a/include/linux/nl80211.h b/include/linux/nl80211.h index b3d1306..3206b8f 100644 --- a/include/linux/nl80211.h +++ b/include/linux/nl80211.h @@ -201,6 +201,7 @@ * * @NL80211_CMD_START_PERIODIC_SCAN: start a periodic scan * @NL80211_CMD_STOP_PERIODIC_SCAN: stop a periodic scan + * @NL80211_CMD_PERIODIC_RESULTS: there are periodic scan results available. * * @NL80211_CMD_GET_SURVEY: get survey resuls, e.g. channel occupation * or noise level @@ -448,6 +449,7 @@ enum nl80211_commands { NL80211_CMD_START_PERIODIC_SCAN, NL80211_CMD_STOP_PERIODIC_SCAN, + NL80211_CMD_PERIODIC_RESULTS, NL80211_CMD_REG_CHANGE, diff --git a/net/wireless/nl80211.c b/net/wireless/nl80211.c index fd50186..e1d7ab2 100644 --- a/net/wireless/nl80211.c +++ b/net/wireless/nl80211.c @@ -5151,6 +5151,25 @@ void nl80211_send_scan_aborted(struct cfg80211_registered_device *rdev, nl80211_scan_mcgrp.id, GFP_KERNEL); } +void nl80211_send_periodic_results(struct cfg80211_registered_device *rdev, + struct net_device *netdev) +{ + struct sk_buff *msg; + + msg = nlmsg_new(NLMSG_DEFAULT_SIZE, GFP_KERNEL); + if (!msg) + return; + + if (nl80211_send_periodic_msg(msg, rdev, netdev, 0, 0, 0, + NL80211_CMD_PERIODIC_RESULTS) < 0) { + nlmsg_free(msg); + return; + } + + genlmsg_multicast_netns(wiphy_net(&rdev->wiphy), msg, 0, + nl80211_scan_mcgrp.id, GFP_KERNEL); +} + void nl80211_send_periodic(struct cfg80211_registered_device *rdev, struct net_device *netdev, u32 cmd) { diff --git a/net/wireless/nl80211.h b/net/wireless/nl80211.h index 435d452..586fd1f 100644 --- a/net/wireless/nl80211.h +++ b/net/wireless/nl80211.h @@ -14,6 +14,8 @@ void nl80211_send_scan_aborted(struct cfg80211_registered_device *rdev, struct net_device *netdev); void nl80211_send_periodic(struct cfg80211_registered_device *rdev, struct net_device *netdev, u32 cmd); +void nl80211_send_periodic_results(struct cfg80211_registered_device *rdev, + struct net_device *netdev); void nl80211_send_reg_change_event(struct regulatory_request *request); void nl80211_send_rx_auth(struct cfg80211_registered_device *rdev, struct net_device *netdev, diff --git a/net/wireless/scan.c b/net/wireless/scan.c index 300876b..925bdfb 100644 --- a/net/wireless/scan.c +++ b/net/wireless/scan.c @@ -101,7 +101,7 @@ void __cfg80211_periodic_results(struct work_struct *wk) periodic_wk); cfg80211_lock_rdev(rdev); - nl80211_send_scan_done(rdev, rdev->periodic_req->dev); + nl80211_send_periodic_results(rdev, rdev->periodic_req->dev); cfg80211_unlock_rdev(rdev); }