Skip to content

Commit

Permalink
Merge tag 'v6.1.67' into 6.1-main
Browse files Browse the repository at this point in the history
This is the 6.1.67 stable release

# -----BEGIN PGP SIGNATURE-----
#
# iQIzBAABCAAdFiEEZH8oZUiU471FcZm+ONu9yGCSaT4FAmV22W8ACgkQONu9yGCS
# aT5HpA/9ERmr3FdaUGvVm0sIcWiOoZQ6ozQPOAhyzvypvaoUNtUtg+bvLbnS64V7
# GEWO4/y0D7cAEDOU+cVyNfHI1kEsOOhZPNMhx69z7i92yfiRxwagt7i2Glupxe0c
# rSk6pPSSzw0VWyz6A7Hgr7KMPVrBX9hVWufN/f2tfsWoBCnzzwIrVH5LhOMPnvis
# fTVxNMgiAVqnGWgQ9ZQzSQtxHoNqqqkW7VD6zqPGei6p131qfUqYigeD9K0L3qVf
# aL1pjJeT6zshDbv5qzXNxfJxWrAreGicT7bL7hSjZhfr2tHBo2q5YB0MwXLIVf5O
# 0jmW/i9GolLmHIbsRuzA+jrok+GgyKAfoYmGl7rh7ktiai2K82MBP/l6kA6Mb+FB
# QixCYdVLCFw8cGc75w/qoIxku8BqAF9UoXVehOENQQ7VWBmLxVIL7h7Ab5X4nm9w
# CRnIH/GTvqycvUSRo1n/AKoqaVjH7xOSsC85jb9Kznqh64ItfkN5HI6aPDkhlokR
# PP3fjdkG2FbWjL6RgEKFFAsCbpsVPtrj2rdvHPeAUilT96TNmnNccVfblHkVUKXF
# uNucPJiLJvp+A76G5UeBbW7ImyRUGtbLe6xVRt+4OgraNdKEG/zlttweJ80l6H9W
# 4YGrOov0KnK6wF89tuSvsImJG2zLE1yVd/0rcA3nMTOj6lyDjpQ=
# =9UF8
# -----END PGP SIGNATURE-----
# gpg: Signature made Mon Dec 11 10:42:07 2023 CET
# gpg:                using RSA key 647F28654894E3BD457199BE38DBBDC86092693E
# gpg: Can't check signature: No public key
  • Loading branch information
frank-w committed Jan 14, 2024
2 parents 8fbaadf + e7cddbb commit d68ffeb
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 33 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# SPDX-License-Identifier: GPL-2.0
VERSION = 6
PATCHLEVEL = 1
SUBLEVEL = 66
SUBLEVEL = 67
EXTRAVERSION =
NAME = Curry Ramen

Expand Down
1 change: 0 additions & 1 deletion net/wireless/core.h
Original file line number Diff line number Diff line change
Expand Up @@ -297,7 +297,6 @@ struct cfg80211_cqm_config {
u32 rssi_hyst;
s32 last_rssi_event_value;
enum nl80211_cqm_rssi_threshold_event last_rssi_event_type;
bool use_range_api;
int n_rssi_thresholds;
s32 rssi_thresholds[];
};
Expand Down
50 changes: 19 additions & 31 deletions net/wireless/nl80211.c
Original file line number Diff line number Diff line change
Expand Up @@ -12574,6 +12574,10 @@ static int cfg80211_cqm_rssi_update(struct cfg80211_registered_device *rdev,
int i, n, low_index;
int err;

/* RSSI reporting disabled? */
if (!cqm_config)
return rdev_set_cqm_rssi_range_config(rdev, dev, 0, 0);

/*
* Obtain current RSSI value if possible, if not and no RSSI threshold
* event has been received yet, we should receive an event after a
Expand Down Expand Up @@ -12648,27 +12652,25 @@ static int nl80211_set_cqm_rssi(struct genl_info *info,
wdev->iftype != NL80211_IFTYPE_P2P_CLIENT)
return -EOPNOTSUPP;

if (n_thresholds <= 1 && rdev->ops->set_cqm_rssi_config) {
if (n_thresholds == 0 || thresholds[0] == 0) /* Disabling */
return rdev_set_cqm_rssi_config(rdev, dev, 0, 0);

return rdev_set_cqm_rssi_config(rdev, dev,
thresholds[0], hysteresis);
}

if (!wiphy_ext_feature_isset(&rdev->wiphy,
NL80211_EXT_FEATURE_CQM_RSSI_LIST))
return -EOPNOTSUPP;

if (n_thresholds == 1 && thresholds[0] == 0) /* Disabling */
n_thresholds = 0;

wdev_lock(wdev);
old = rcu_dereference_protected(wdev->cqm_config,
lockdep_is_held(&wdev->mtx));

/* if already disabled just succeed */
if (!n_thresholds && !old)
return 0;

if (n_thresholds > 1) {
if (!wiphy_ext_feature_isset(&rdev->wiphy,
NL80211_EXT_FEATURE_CQM_RSSI_LIST) ||
!rdev->ops->set_cqm_rssi_range_config)
return -EOPNOTSUPP;
} else {
if (!rdev->ops->set_cqm_rssi_config)
return -EOPNOTSUPP;
}

if (n_thresholds) {
cqm_config = kzalloc(struct_size(cqm_config, rssi_thresholds,
n_thresholds),
Expand All @@ -12683,26 +12685,13 @@ static int nl80211_set_cqm_rssi(struct genl_info *info,
memcpy(cqm_config->rssi_thresholds, thresholds,
flex_array_size(cqm_config, rssi_thresholds,
n_thresholds));
cqm_config->use_range_api = n_thresholds > 1 ||
!rdev->ops->set_cqm_rssi_config;

rcu_assign_pointer(wdev->cqm_config, cqm_config);

if (cqm_config->use_range_api)
err = cfg80211_cqm_rssi_update(rdev, dev, cqm_config);
else
err = rdev_set_cqm_rssi_config(rdev, dev,
thresholds[0],
hysteresis);
} else {
RCU_INIT_POINTER(wdev->cqm_config, NULL);
/* if enabled as range also disable via range */
if (old->use_range_api)
err = rdev_set_cqm_rssi_range_config(rdev, dev, 0, 0);
else
err = rdev_set_cqm_rssi_config(rdev, dev, 0, 0);
}

err = cfg80211_cqm_rssi_update(rdev, dev, cqm_config);
if (err) {
rcu_assign_pointer(wdev->cqm_config, old);
kfree_rcu(cqm_config, rcu_head);
Expand Down Expand Up @@ -18769,11 +18758,10 @@ void cfg80211_cqm_rssi_notify_work(struct wiphy *wiphy, struct wiphy_work *work)
wdev_lock(wdev);
cqm_config = rcu_dereference_protected(wdev->cqm_config,
lockdep_is_held(&wdev->mtx));
if (!cqm_config)
if (!wdev->cqm_config)
goto unlock;

if (cqm_config->use_range_api)
cfg80211_cqm_rssi_update(rdev, wdev->netdev, cqm_config);
cfg80211_cqm_rssi_update(rdev, wdev->netdev, cqm_config);

rssi_level = cqm_config->last_rssi_event_value;
rssi_event = cqm_config->last_rssi_event_type;
Expand Down

0 comments on commit d68ffeb

Please sign in to comment.