Thread (30 messages) 30 messages, 2 authors, 2018-08-28

Re: [PATCH 2/7] cfg80211: Add new NL command to configure peer specific rssi threshold

From: Tamizh chelvam <hidden>
Date: 2018-07-04 06:09:38

On 2018-06-29 14:59, Johannes Berg wrote:
On Wed, 2018-06-13 at 16:15 +0530, Tamizh chelvam wrote:
quoted
+ * @NL80211_ATTR_STA_MON: Station's connection monitor configuration 
in a
+ *	nested attribute with %NL80211_ATTR_STA_MON_* sub-attributes.
Can't we reuse the existing attributes in this nesting?
This new attributes introduced as per the previous discussion.
https://patchwork.kernel.org/patch/10240697/
Is my understanding correct ?
quoted
+/**
+ * enum nl80211_sta_mon_rssi_threshold_event - RSSI threshold event
+ * @NL80211_STA_MON_RSSI_THRESHOLD_EVENT_LOW: The RSSI level is lower 
than the
+ *	configured threshold
+ * @NL80211_STA_MON_RSSI_THRESHOLD_EVENT_HIGH: The RSSI is higher 
than the
+ *	configured threshold
+ */
+enum nl80211_sta_mon_rssi_threshold_event {
+	NL80211_STA_MON_RSSI_THRESHOLD_EVENT_LOW,
+	NL80211_STA_MON_RSSI_THRESHOLD_EVENT_HIGH,
+};
It seems like this should already exist also for the CQM? Can we not
reuse it?
quoted
+static int nl80211_set_sta_mon_rssi(struct genl_info *info,
+				    const u8 *peer, s32 threshold,
+				    u32 hysteresis)
+{
+	struct cfg80211_registered_device *rdev = info->user_ptr[0];
+	struct net_device *dev = info->user_ptr[1];
+	struct wireless_dev *wdev = dev->ieee80211_ptr;
+
+	if (threshold > 0)
+		return -EINVAL;
+
+	if (threshold == 0)
+		hysteresis = 0;
+
+	if (!rdev->ops->set_sta_mon_rssi_config)
+		return -EOPNOTSUPP;
+
+	if ((wdev->iftype != NL80211_IFTYPE_AP &&
+	     wdev->iftype != NL80211_IFTYPE_P2P_GO &&
+	     wdev->iftype != NL80211_IFTYPE_AP_VLAN) ||
+	    !wiphy_ext_feature_isset(&rdev->wiphy,
+				NL80211_EXT_FEATURE_STA_MON_RSSI_CONFIG))
+		return -EOPNOTSUPP;
+
+	return rdev_set_sta_mon_rssi_config(rdev, dev, peer,
+					    threshold, hysteresis);
+}
Wait, you went to all this effort in the first patch and now you don't
add this to the list?
No, the list and the rssi_config structure is for multi threshold value 
and not for single threshold.

Thanks,
Tamizh.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help