From patchwork Wed Oct 13 22:10:17 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paul Stewart X-Patchwork-Id: 251531 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 o9DMmtvt023576 for ; Wed, 13 Oct 2010 22:49:11 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753648Ab0JMWs7 (ORCPT ); Wed, 13 Oct 2010 18:48:59 -0400 Received: from smtp-out.google.com ([216.239.44.51]:38220 "EHLO smtp-out.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753628Ab0JMWsy (ORCPT ); Wed, 13 Oct 2010 18:48:54 -0400 Received: from hpaq6.eem.corp.google.com (hpaq6.eem.corp.google.com [172.25.149.6]) by smtp-out.google.com with ESMTP id o9DMmrag030357 for ; Wed, 13 Oct 2010 15:48:53 -0700 DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d=google.com; s=beta; t=1287010134; bh=R/EBuat7M1lalA39CcDPyoWj5lM=; h=From:Date:Subject:To:Message-Id; b=a4315GjNRpXKNreKsedMOsFioMzvR8C+OejajMn5FR8o6s7dB/wBzoYfLhsVVe4SD +ruesLhv+JfOwJSensM6A== DomainKey-Signature: a=rsa-sha1; s=beta; d=google.com; c=nofws; q=dns; h=from:date:subject:to:message-id:x-system-of-record; b=RkuQFeD2iBtVEN0kCLZusDq4ynTKpeSMJSraFIqHvDBFqU9dLwX1R5ZOaZDHTmSlF Jgqz2vkWkvMYhWzH0yNmA== Received: from glenhelen.mtv.corp.google.com (glenhelen.mtv.corp.google.com [172.22.72.223]) by hpaq6.eem.corp.google.com with ESMTP id o9DMmqnk025364 for ; Wed, 13 Oct 2010 15:48:52 -0700 Received: by glenhelen.mtv.corp.google.com (Postfix, from userid 110058) id 9C46820418; Wed, 13 Oct 2010 15:48:51 -0700 (PDT) From: Paul Stewart Date: Wed, 13 Oct 2010 15:10:17 -0700 Subject: [PATCH 2/6] Ad cfg80211 call for threshold notifications To: linux-wireless@vger.kernel.org Message-Id: <20101013224851.9C46820418@glenhelen.mtv.corp.google.com> X-System-Of-Record: true 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]); Wed, 13 Oct 2010 22:49:11 +0000 (UTC) diff --git a/include/net/cfg80211.h b/include/net/cfg80211.h index 2a7936d..e7f044e 100644 --- a/include/net/cfg80211.h +++ b/include/net/cfg80211.h @@ -1146,6 +1146,7 @@ struct cfg80211_pmksa { * @set_power_mgmt: Configure WLAN power management. A timeout value of -1 * allows the driver to adjust the dynamic ps timeout value. * @set_cqm_rssi_config: Configure connection quality monitor RSSI threshold. + * @set_cqm_bitrate_config: Config connection quality monitor bitrate threshold. * * @mgmt_frame_register: Notify driver that a management frame type was * registered. Note that this callback may not sleep, and cannot run @@ -1301,6 +1302,10 @@ struct cfg80211_ops { struct net_device *dev, s32 rssi_thold, u32 rssi_hyst); + int (*set_cqm_bitrate_config)(struct wiphy *wiphy, + struct net_device *dev, + u32 bitrate_thold); + void (*mgmt_frame_register)(struct wiphy *wiphy, struct net_device *dev, u16 frame_type, bool reg); @@ -2595,6 +2600,19 @@ void cfg80211_cqm_rssi_notify(struct net_device *dev, enum nl80211_cqm_rssi_threshold_event rssi_event, gfp_t gfp); +/** + * cfg80211_cqm_bitrate_notify - connection quality monitoring bitrate event + * @dev: network device + * @rate: the new transmit rate + * @gfp: context flags + * + * This function is called when a the transmit bitrate changes, and + * connection quality monitoring is configured to capture these events. + */ +void cfg80211_cqm_bitrate_notify(struct net_device *dev, + u32 bitrate, + gfp_t gfp); + /* Logging, debugging and troubleshooting/diagnostic helpers. */ /* wiphy_printk helpers, similar to dev_printk */ diff --git a/net/wireless/mlme.c b/net/wireless/mlme.c index 26838d9..ebb4e3a 100644 --- a/net/wireless/mlme.c +++ b/net/wireless/mlme.c @@ -1028,3 +1028,16 @@ void cfg80211_cqm_rssi_notify(struct net_device *dev, nl80211_send_cqm_rssi_notify(rdev, dev, rssi_event, gfp); } EXPORT_SYMBOL(cfg80211_cqm_rssi_notify); + +void cfg80211_cqm_bitrate_notify(struct net_device *dev, + u32 bitrate, + gfp_t gfp) +{ + struct wireless_dev *wdev = dev->ieee80211_ptr; + struct wiphy *wiphy = wdev->wiphy; + struct cfg80211_registered_device *rdev = wiphy_to_dev(wiphy); + + /* Indicate roaming trigger event to user space */ + nl80211_send_cqm_bitrate_notify(rdev, dev, bitrate, gfp); +} +EXPORT_SYMBOL(cfg80211_cqm_bitrate_notify);