Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit e0e1903e authored by qctecmdr Service's avatar qctecmdr Service Committed by Gerrit - the friendly Code Review server
Browse files

Merge "cfg80211: Scan results to also report the per chain signal strength"

parents 7d6f5d44 733cb264
Loading
Loading
Loading
Loading
+8 −0
Original line number Original line Diff line number Diff line
@@ -1781,6 +1781,8 @@ enum cfg80211_signal_type {
 *	by %parent_bssid.
 *	by %parent_bssid.
 * @parent_bssid: the BSS according to which %parent_tsf is set. This is set to
 * @parent_bssid: the BSS according to which %parent_tsf is set. This is set to
 *	the BSS that requested the scan in which the beacon/probe was received.
 *	the BSS that requested the scan in which the beacon/probe was received.
 * @chains: bitmask for filled values in @chain_signal.
 * @chain_signal: per-chain signal strength of last received BSS in dBm.
 */
 */
struct cfg80211_inform_bss {
struct cfg80211_inform_bss {
	struct ieee80211_channel *chan;
	struct ieee80211_channel *chan;
@@ -1789,6 +1791,8 @@ struct cfg80211_inform_bss {
	u64 boottime_ns;
	u64 boottime_ns;
	u64 parent_tsf;
	u64 parent_tsf;
	u8 parent_bssid[ETH_ALEN] __aligned(2);
	u8 parent_bssid[ETH_ALEN] __aligned(2);
	u8 chains;
	s8 chain_signal[IEEE80211_MAX_CHAINS];
};
};


/**
/**
@@ -1832,6 +1836,8 @@ struct cfg80211_bss_ies {
 *	that holds the beacon data. @beacon_ies is still valid, of course, and
 *	that holds the beacon data. @beacon_ies is still valid, of course, and
 *	points to the same data as hidden_beacon_bss->beacon_ies in that case.
 *	points to the same data as hidden_beacon_bss->beacon_ies in that case.
 * @signal: signal strength value (type depends on the wiphy's signal_type)
 * @signal: signal strength value (type depends on the wiphy's signal_type)
 * @chains: bitmask for filled values in @chain_signal.
 * @chain_signal: per-chain signal strength of last received BSS in dBm.
 * @priv: private area for driver use, has at least wiphy->bss_priv_size bytes
 * @priv: private area for driver use, has at least wiphy->bss_priv_size bytes
 */
 */
struct cfg80211_bss {
struct cfg80211_bss {
@@ -1850,6 +1856,8 @@ struct cfg80211_bss {
	u16 capability;
	u16 capability;


	u8 bssid[ETH_ALEN];
	u8 bssid[ETH_ALEN];
	u8 chains;
	s8 chain_signal[IEEE80211_MAX_CHAINS];


	u8 priv[0] __aligned(sizeof(void *));
	u8 priv[0] __aligned(sizeof(void *));
};
};
+4 −0
Original line number Original line Diff line number Diff line
@@ -3903,6 +3903,9 @@ enum nl80211_bss_scan_width {
 *	@NL80211_BSS_PARENT_BSSID. (u64).
 *	@NL80211_BSS_PARENT_BSSID. (u64).
 * @NL80211_BSS_PARENT_BSSID: the BSS according to which @NL80211_BSS_PARENT_TSF
 * @NL80211_BSS_PARENT_BSSID: the BSS according to which @NL80211_BSS_PARENT_TSF
 *	is set.
 *	is set.
 * @NL80211_BSS_CHAIN_SIGNAL: per-chain signal strength of last BSS update.
 *	Contains a nested array of signal strength attributes (u8, dBm),
 *	using the nesting index as the antenna number.
 * @__NL80211_BSS_AFTER_LAST: internal
 * @__NL80211_BSS_AFTER_LAST: internal
 * @NL80211_BSS_MAX: highest BSS attribute
 * @NL80211_BSS_MAX: highest BSS attribute
 */
 */
@@ -3926,6 +3929,7 @@ enum nl80211_bss {
	NL80211_BSS_PAD,
	NL80211_BSS_PAD,
	NL80211_BSS_PARENT_TSF,
	NL80211_BSS_PARENT_TSF,
	NL80211_BSS_PARENT_BSSID,
	NL80211_BSS_PARENT_BSSID,
	NL80211_BSS_CHAIN_SIGNAL,


	/* keep last */
	/* keep last */
	__NL80211_BSS_AFTER_LAST,
	__NL80211_BSS_AFTER_LAST,
+5 −0
Original line number Original line Diff line number Diff line
@@ -7797,6 +7797,11 @@ static int nl80211_send_bss(struct sk_buff *msg, struct netlink_callback *cb,
			      intbss->ts_boottime, NL80211_BSS_PAD))
			      intbss->ts_boottime, NL80211_BSS_PAD))
		goto nla_put_failure;
		goto nla_put_failure;


	if (!nl80211_put_signal(msg, intbss->pub.chains,
				intbss->pub.chain_signal,
				NL80211_BSS_CHAIN_SIGNAL))
		goto nla_put_failure;

	switch (rdev->wiphy.signal_type) {
	switch (rdev->wiphy.signal_type) {
	case CFG80211_SIGNAL_TYPE_MBM:
	case CFG80211_SIGNAL_TYPE_MBM:
		if (nla_put_u32(msg, NL80211_BSS_SIGNAL_MBM, res->signal))
		if (nla_put_u32(msg, NL80211_BSS_SIGNAL_MBM, res->signal))
+5 −0
Original line number Original line Diff line number Diff line
@@ -981,6 +981,9 @@ cfg80211_bss_update(struct cfg80211_registered_device *rdev,
		found->ts = tmp->ts;
		found->ts = tmp->ts;
		found->ts_boottime = tmp->ts_boottime;
		found->ts_boottime = tmp->ts_boottime;
		found->parent_tsf = tmp->parent_tsf;
		found->parent_tsf = tmp->parent_tsf;
		found->pub.chains = tmp->pub.chains;
		memcpy(found->pub.chain_signal, tmp->pub.chain_signal,
		       IEEE80211_MAX_CHAINS);
		ether_addr_copy(found->parent_bssid, tmp->parent_bssid);
		ether_addr_copy(found->parent_bssid, tmp->parent_bssid);
	} else {
	} else {
		struct cfg80211_internal_bss *new;
		struct cfg80211_internal_bss *new;
@@ -1233,6 +1236,8 @@ cfg80211_inform_bss_frame_data(struct wiphy *wiphy,
	tmp.pub.capability = le16_to_cpu(mgmt->u.probe_resp.capab_info);
	tmp.pub.capability = le16_to_cpu(mgmt->u.probe_resp.capab_info);
	tmp.ts_boottime = data->boottime_ns;
	tmp.ts_boottime = data->boottime_ns;
	tmp.parent_tsf = data->parent_tsf;
	tmp.parent_tsf = data->parent_tsf;
	tmp.pub.chains = data->chains;
	memcpy(tmp.pub.chain_signal, data->chain_signal, IEEE80211_MAX_CHAINS);
	ether_addr_copy(tmp.parent_bssid, data->parent_bssid);
	ether_addr_copy(tmp.parent_bssid, data->parent_bssid);


	signal_valid = abs(data->chan->center_freq - channel->center_freq) <=
	signal_valid = abs(data->chan->center_freq - channel->center_freq) <=