cfg80211/mac80211: cqm rssi config for AP mode
v2 cover cfg80211/mac80211: cqm rssi config for AP mode
From: Tamizh chelvam <[email protected]>
Currently station mode has the support of rssi based cqm. This patchsets extended the support for AP mode as well. Already netlink accepts mac address in cqm notification event. We can use that to pass mac address of the station to specify its rssi change event. This patchsets introduce new api cfg80211_ap_sta_cqm_notify and multicast group to notify the event.
Pradeep Kumar Chitrapu (1):
mac80211: enable setting cqm rssi c onfig for AP mode
Tamizh chelvam (2):
cfg80211: enable setting cqm rssi config for AP mode
mac80211: implement cqm rssi check using rx data signal
V2:
* Removed changing existing ieee80211_cqm_rssi_notify api changes.
* Introduced new ext feature bit and multicast group id to support this feature.
include/net/cfg80211.h | 15 ++++++++++ include/net/mac80211.h | 7 +++++ include/uapi/linux/nl80211.h | 6 ++++ net/mac80211/cfg.c | 31 ++++++++++++------- net/mac80211/rx.c | 46 +++++++++++++++++++++++++++- net/mac80211/sta_info.h | 3 ++ net/wireless/nl80211.c | 68 +++++++++++++++++++++++++++++++++++------- 7 files changed, 155 insertions(+), 21 deletions(-)
Signature · 1 line
1.7.9.5
PATCH v2 1/3 cfg80211: enable setting cqm rssi config for AP mode
From: Tamizh chelvam <[email protected]>
This patch extend cqm rssi config and notifier feature to AP mode by introducing NL80211_EXT_FEATURE_AP_STA_CQM_RSSI_CONFIG ext feature bit. And this patch introduces NL80211_MCGRP_AP_STA_CQM for notifying station's low/high rssi event to userspace application.
--- include/net/cfg80211.h | 15 ++++++++++ include/uapi/linux/nl80211.h | 6 ++++ net/wireless/nl80211.c | 68 +++++++++++++++++++++++++++++++++++------- 3 files changed, 79 insertions(+), 10 deletions(-)
include/net/cfg80211.h +15 -0
@@ -5704,6 +5704,21 @@ void cfg80211_cqm_rssi_notify(struct net_device *dev, s32 rssi_level, gfp_t gfp);/** +* cfg80211_ap_sta_cqm_rssi_notify - CQM rssi event for connected stations +* @dev: network device +* @mac: peer's MAC address +* @rssi_event: the triggered RSSI event +* @rssi_level: new RSSI level value or 0 if not available +* @gfp: context flags +* +* This function is called when a configured connection quality monitoring +* rssi threshold reached event occurs for a station. +*/ +void cfg80211_ap_sta_cqm_rssi_notify (struct net_device *dev,const u8 *mac, +enum nl80211_cqm_rssi_threshold_event rssi_event, +s32 rssi_level,gfp_t gfp); + +/** * cfg80211_cqm_pktloss_notify - notify userspace about packetloss to peer * @dev: network device * @peer: peer's MAC address
include/uapi/linux/nl80211.h +6 -0
@@ -49,6 +49,7 @@#define NL80211_MULTICAST_GROUP_MLME "mlme"#define NL80211_MULTICAST_GROUP_VENDOR "vendor"#define NL80211_MULTICAST_GROUP_NAN "nan" +#define NL80211_MULTICAST_GROUP_AP_STA_CQM "apstacqm"#define NL80211_MULTICAST_GROUP_TESTMODE "testmode"/**
@@ -4996,6 +4997,10 @@ enum nl80211_feature_flags {* @NL80211_EXT_FEATURE_LOW_SPAN_SCAN: Driver supports low span scan. * @NL80211_EXT_FEATURE_LOW_POWER_SCAN: Driver supports low power scan. * @NL80211_EXT_FEATURE_HIGH_ACCURACY_SCAN: Driver supports high accuracy scan. +* @NL80211_EXT_FEATURE_AP_STA_CQM_RSSI_CONFIG: With this driver the +* non P2P/STA interface accept %NL80211_ATTR_CQM_RSSI_THOLD and +* %NL80211_ATTR_CQM_RSSI_HYST attributes to monitor connected clients +* rssi values. * * @NUM_NL80211_EXT_FEATURES: number of extended features. * @MAX_NL80211_EXT_FEATURES: highest extended feature index.
@@ -5026,6 +5031,7 @@ enum nl80211_ext_feature_index {NL80211_EXT_FEATURE_LOW_SPAN_SCAN ,NL80211_EXT_FEATURE_LOW_POWER_SCAN ,NL80211_EXT_FEATURE_HIGH_ACCURACY_SCAN , +NL80211_EXT_FEATURE_AP_STA_CQM_RSSI_CONFIG ,/* add new features before the definition below */ NUM_NL80211_EXT_FEATURES,
net/wireless/nl80211.c +58 -10
116 lines not on this page · raw message
Signature · 1 line
1.7.9.5
Johannes Berg
maintainerRe: [PATCHv2 1/3] cfg80211: enable setting cqm rssi config for AP mode
net/wireless/nl80211.c static int nl80211_set_cqm_rssi(struct genl_info *info, · line 9913
Quoted 12 lines · Tamizh chelvam
net/wireless/nl80211.c +4
-2@@ -9903,8 +9906,10 @@ static int nl80211_set_cqm_rssi(struct genl_info *info, prev = thresholds[i]; } -if (wdev->iftype !=NL80211_IFTYPE_STATION && - wdev->iftype !=NL80211_IFTYPE_P2P_CLIENT ) +if ((wdev->iftype !=NL80211_IFTYPE_STATION && + wdev->iftype !=NL80211_IFTYPE_P2P_CLIENT && + !wiphy_ext_feature_isset (&rdev->wiphy, +NL80211_EXT_FEATURE_AP_STA_CQM_RSSI_CONFIG )))return -EOPNOTSUPP ;
This enables for everything though - not sure we want that?
johannes
Re: [PATCHv2 1/3] cfg80211: enable setting cqm rssi config for AP mode
Quoted 7 lines · Johannes Berg
Quoted 6 lines · Tamizh chelvam
net/wireless/nl80211.c +0
-0@@ -9903,8 +9906,10 @@ static int nl80211_set_cqm_rssi(structgenl_info *info, prev = thresholds[i]; }
Quoted 9 lines
net/wireless/nl80211.c static int nl80211_set_cqm_rssi(struct genl_info *info, · line 9913
Quoted 7 lines
net/wireless/nl80211.c +4
-2-if (wdev->iftype !=NL80211_IFTYPE_STATION && - wdev->iftype !=NL80211_IFTYPE_P2P_CLIENT ) +if ((wdev->iftype !=NL80211_IFTYPE_STATION && + wdev->iftype !=NL80211_IFTYPE_P2P_CLIENT && + !wiphy_ext_feature_isset (&rdev->wiphy, +NL80211_EXT_FEATURE_AP_STA_CQM_RSSI_CONFIG )))return -EOPNOTSUPP ;This enables for everything though - not sure we want that?
I'll add vif type(AP, AP_VLAN and P2P_GO) check in the next version to avoid enable this for all.