diff mbox

[2/6] Ad cfg80211 call for threshold notifications

Message ID 20101013224851.9C46820418@glenhelen.mtv.corp.google.com (mailing list archive)
State Not Applicable, archived
Headers show

Commit Message

Paul Stewart Oct. 13, 2010, 10:10 p.m. UTC
None
diff mbox

Patch

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);