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

Commit ab60633c authored by Narayanraddi Masti's avatar Narayanraddi Masti Committed by Johannes Berg
Browse files

mac80211: Add support for NL80211_STA_INFO_AIRTIME_LINK_METRIC



Add support for mesh airtime link metric attribute
NL80211_STA_INFO_AIRTIME_LINK_METRIC.

Signed-off-by: default avatarNarayanraddi Masti <team.nmasti@gmail.com>
Signed-off-by: default avatarJohannes Berg <johannes.berg@intel.com>
parent 1e1b11b6
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -1327,6 +1327,7 @@ struct cfg80211_tid_stats {
 * @fcs_err_count: number of packets (MPDUs) received from this station with
 *	an FCS error. This counter should be incremented only when TA of the
 *	received packet with an FCS error matches the peer MAC address.
 * @airtime_link_metric: mesh airtime link metric.
 */
struct station_info {
	u64 filled;
@@ -1381,6 +1382,8 @@ struct station_info {

	u32 rx_mpdu_count;
	u32 fcs_err_count;

	u32 airtime_link_metric;
};

#if IS_ENABLED(CONFIG_CFG80211)
+2 −0
Original line number Diff line number Diff line
@@ -3139,6 +3139,7 @@ enum nl80211_sta_bss_param {
 * @NL80211_STA_INFO_TX_DURATION: aggregate PPDU duration for all frames
 *	sent to the station (u64, usec)
 * @NL80211_STA_INFO_AIRTIME_WEIGHT: current airtime weight for station (u16)
 * @NL80211_STA_INFO_AIRTIME_LINK_METRIC: airtime link metric for mesh station
 * @__NL80211_STA_INFO_AFTER_LAST: internal
 * @NL80211_STA_INFO_MAX: highest possible station info attribute
 */
@@ -3184,6 +3185,7 @@ enum nl80211_sta_info {
	NL80211_STA_INFO_CONNECTED_TO_GATE,
	NL80211_STA_INFO_TX_DURATION,
	NL80211_STA_INFO_AIRTIME_WEIGHT,
	NL80211_STA_INFO_AIRTIME_LINK_METRIC,

	/* keep last */
	__NL80211_STA_INFO_AFTER_LAST,
+2 −0
Original line number Diff line number Diff line
@@ -278,6 +278,8 @@ mesh_path_add(struct ieee80211_sub_if_data *sdata, const u8 *dst);
int mesh_path_add_gate(struct mesh_path *mpath);
int mesh_path_send_to_gates(struct mesh_path *mpath);
int mesh_gate_num(struct ieee80211_sub_if_data *sdata);
u32 airtime_link_metric_get(struct ieee80211_local *local,
			    struct sta_info *sta);

/* Mesh plinks */
void mesh_neighbour_update(struct ieee80211_sub_if_data *sdata,
+2 −2
Original line number Diff line number Diff line
@@ -318,7 +318,7 @@ void ieee80211s_update_metric(struct ieee80211_local *local,
				  cfg80211_calculate_bitrate(&rinfo));
}

static u32 airtime_link_metric_get(struct ieee80211_local *local,
u32 airtime_link_metric_get(struct ieee80211_local *local,
			    struct sta_info *sta)
{
	/* This should be adjusted for each device */
+6 −0
Original line number Diff line number Diff line
@@ -2373,6 +2373,12 @@ void sta_set_sinfo(struct sta_info *sta, struct station_info *sinfo,
		sinfo->filled |=
			BIT_ULL(NL80211_STA_INFO_ACK_SIGNAL_AVG);
	}

	if (ieee80211_vif_is_mesh(&sdata->vif)) {
		sinfo->filled |= BIT_ULL(NL80211_STA_INFO_AIRTIME_LINK_METRIC);
		sinfo->airtime_link_metric =
			airtime_link_metric_get(local, sta);
	}
}

u32 sta_get_expected_throughput(struct sta_info *sta)
Loading