Commit dd3e4fc7 authored by Avraham Stern's avatar Avraham Stern Committed by Johannes Berg

nl80211/cfg80211: add BSS color to NDP ranging parameters

In NDP ranging, the initiator need to set the BSS color in the NDP
to the BSS color of the responder. Add the BSS color as a parameter
for NDP ranging.
Signed-off-by: default avatarAvraham Stern <avraham.stern@intel.com>
Signed-off-by: default avatarLuca Coelho <luciano.coelho@intel.com>
Link: https://lore.kernel.org/r/iwlwifi.20210618133832.f097a6144b59.I27dec8b994df52e691925ea61be4dd4fa6d396c0@changeidSigned-off-by: default avatarJohannes Berg <johannes.berg@intel.com>
parent d8b26154
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
* Copyright 2006-2010 Johannes Berg <johannes@sipsolutions.net> * Copyright 2006-2010 Johannes Berg <johannes@sipsolutions.net>
* Copyright 2013-2014 Intel Mobile Communications GmbH * Copyright 2013-2014 Intel Mobile Communications GmbH
* Copyright 2015-2017 Intel Deutschland GmbH * Copyright 2015-2017 Intel Deutschland GmbH
* Copyright (C) 2018-2020 Intel Corporation * Copyright (C) 2018-2021 Intel Corporation
*/ */
#include <linux/ethtool.h> #include <linux/ethtool.h>
...@@ -3521,7 +3521,10 @@ struct cfg80211_pmsr_result { ...@@ -3521,7 +3521,10 @@ struct cfg80211_pmsr_result {
* If neither @trigger_based nor @non_trigger_based is set, * If neither @trigger_based nor @non_trigger_based is set,
* EDCA based ranging will be used. * EDCA based ranging will be used.
* @lmr_feedback: negotiate for I2R LMR feedback. Only valid if either * @lmr_feedback: negotiate for I2R LMR feedback. Only valid if either
* @trigger_based or @non_trigger_based is set. * @trigger_based or @non_trigger_based is set.
* @bss_color: the bss color of the responder. Optional. Set to zero to
* indicate the driver should set the BSS color. Only valid if
* @non_trigger_based or @trigger_based is set.
* *
* See also nl80211 for the respective attribute documentation. * See also nl80211 for the respective attribute documentation.
*/ */
...@@ -3539,6 +3542,7 @@ struct cfg80211_pmsr_ftm_request_peer { ...@@ -3539,6 +3542,7 @@ struct cfg80211_pmsr_ftm_request_peer {
u8 burst_duration; u8 burst_duration;
u8 ftms_per_burst; u8 ftms_per_burst;
u8 ftmr_retries; u8 ftmr_retries;
u8 bss_color;
}; };
/** /**
......
...@@ -11,7 +11,7 @@ ...@@ -11,7 +11,7 @@
* Copyright 2008 Jouni Malinen <jouni.malinen@atheros.com> * Copyright 2008 Jouni Malinen <jouni.malinen@atheros.com>
* Copyright 2008 Colin McCabe <colin@cozybit.com> * Copyright 2008 Colin McCabe <colin@cozybit.com>
* Copyright 2015-2017 Intel Deutschland GmbH * Copyright 2015-2017 Intel Deutschland GmbH
* Copyright (C) 2018-2020 Intel Corporation * Copyright (C) 2018-2021 Intel Corporation
* *
* Permission to use, copy, modify, and/or distribute this software for any * Permission to use, copy, modify, and/or distribute this software for any
* purpose with or without fee is hereby granted, provided that the above * purpose with or without fee is hereby granted, provided that the above
...@@ -6912,6 +6912,9 @@ enum nl80211_peer_measurement_ftm_capa { ...@@ -6912,6 +6912,9 @@ enum nl80211_peer_measurement_ftm_capa {
* @NL80211_PMSR_FTM_REQ_ATTR_LMR_FEEDBACK: negotiate for LMR feedback. Only * @NL80211_PMSR_FTM_REQ_ATTR_LMR_FEEDBACK: negotiate for LMR feedback. Only
* valid if either %NL80211_PMSR_FTM_REQ_ATTR_TRIGGER_BASED or * valid if either %NL80211_PMSR_FTM_REQ_ATTR_TRIGGER_BASED or
* %NL80211_PMSR_FTM_REQ_ATTR_NON_TRIGGER_BASED is set. * %NL80211_PMSR_FTM_REQ_ATTR_NON_TRIGGER_BASED is set.
* @NL80211_PMSR_FTM_REQ_ATTR_BSS_COLOR: optional. The BSS color of the
* responder. Only valid if %NL80211_PMSR_FTM_REQ_ATTR_NON_TRIGGER_BASED
* or %NL80211_PMSR_FTM_REQ_ATTR_TRIGGER_BASED is set.
* *
* @NUM_NL80211_PMSR_FTM_REQ_ATTR: internal * @NUM_NL80211_PMSR_FTM_REQ_ATTR: internal
* @NL80211_PMSR_FTM_REQ_ATTR_MAX: highest attribute number * @NL80211_PMSR_FTM_REQ_ATTR_MAX: highest attribute number
...@@ -6931,6 +6934,7 @@ enum nl80211_peer_measurement_ftm_req { ...@@ -6931,6 +6934,7 @@ enum nl80211_peer_measurement_ftm_req {
NL80211_PMSR_FTM_REQ_ATTR_TRIGGER_BASED, NL80211_PMSR_FTM_REQ_ATTR_TRIGGER_BASED,
NL80211_PMSR_FTM_REQ_ATTR_NON_TRIGGER_BASED, NL80211_PMSR_FTM_REQ_ATTR_NON_TRIGGER_BASED,
NL80211_PMSR_FTM_REQ_ATTR_LMR_FEEDBACK, NL80211_PMSR_FTM_REQ_ATTR_LMR_FEEDBACK,
NL80211_PMSR_FTM_REQ_ATTR_BSS_COLOR,
/* keep last */ /* keep last */
NUM_NL80211_PMSR_FTM_REQ_ATTR, NUM_NL80211_PMSR_FTM_REQ_ATTR,
......
...@@ -168,6 +168,18 @@ static int pmsr_parse_ftm(struct cfg80211_registered_device *rdev, ...@@ -168,6 +168,18 @@ static int pmsr_parse_ftm(struct cfg80211_registered_device *rdev,
return -EINVAL; return -EINVAL;
} }
if (tb[NL80211_PMSR_FTM_REQ_ATTR_BSS_COLOR]) {
if (!out->ftm.non_trigger_based && !out->ftm.trigger_based) {
NL_SET_ERR_MSG_ATTR(info->extack,
tb[NL80211_PMSR_FTM_REQ_ATTR_BSS_COLOR],
"FTM: BSS color set for EDCA based ranging");
return -EINVAL;
}
out->ftm.bss_color =
nla_get_u8(tb[NL80211_PMSR_FTM_REQ_ATTR_BSS_COLOR]);
}
return 0; return 0;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment