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

Commit 887da917 authored by Emmanuel Grumbach's avatar Emmanuel Grumbach Committed by Johannes Berg
Browse files

mac80211: provide the vif in rssi_callback



Since drivers can support several BSS / P2P Client
interfaces, the rssi callback needs to inform the driver
about the interface teh rssi event relates to.

Signed-off-by: default avatarEmmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: default avatarJohannes Berg <johannes.berg@intel.com>
parent a65240c1
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -1156,6 +1156,7 @@ static int iwlagn_mac_cancel_remain_on_channel(struct ieee80211_hw *hw)
}

static void iwlagn_mac_rssi_callback(struct ieee80211_hw *hw,
				     struct ieee80211_vif *vif,
				     enum ieee80211_rssi_event rssi_event)
{
	struct iwl_priv *priv = IWL_MAC80211_GET_DVM(hw);
+1 −0
Original line number Diff line number Diff line
@@ -2633,6 +2633,7 @@ struct ieee80211_ops {
	int (*set_bitrate_mask)(struct ieee80211_hw *hw, struct ieee80211_vif *vif,
				const struct cfg80211_bitrate_mask *mask);
	void (*rssi_callback)(struct ieee80211_hw *hw,
			      struct ieee80211_vif *vif,
			      enum ieee80211_rssi_event rssi_event);

	void (*allow_buffered_frames)(struct ieee80211_hw *hw,
+3 −2
Original line number Diff line number Diff line
@@ -845,11 +845,12 @@ static inline void drv_set_rekey_data(struct ieee80211_local *local,
}

static inline void drv_rssi_callback(struct ieee80211_local *local,
				     struct ieee80211_sub_if_data *sdata,
				     const enum ieee80211_rssi_event event)
{
	trace_drv_rssi_callback(local, event);
	trace_drv_rssi_callback(local, sdata, event);
	if (local->ops->rssi_callback)
		local->ops->rssi_callback(&local->hw, event);
		local->ops->rssi_callback(&local->hw, &sdata->vif, event);
	trace_drv_return_void(local);
}

+2 −2
Original line number Diff line number Diff line
@@ -2604,12 +2604,12 @@ static void ieee80211_rx_mgmt_beacon(struct ieee80211_sub_if_data *sdata,
		if (sig > ifmgd->rssi_max_thold &&
		    (last_sig <= ifmgd->rssi_min_thold || last_sig == 0)) {
			ifmgd->last_ave_beacon_signal = sig;
			drv_rssi_callback(local, RSSI_EVENT_HIGH);
			drv_rssi_callback(local, sdata, RSSI_EVENT_HIGH);
		} else if (sig < ifmgd->rssi_min_thold &&
			   (last_sig >= ifmgd->rssi_max_thold ||
			   last_sig == 0)) {
			ifmgd->last_ave_beacon_signal = sig;
			drv_rssi_callback(local, RSSI_EVENT_LOW);
			drv_rssi_callback(local, sdata, RSSI_EVENT_LOW);
		}
	}

+6 −3
Original line number Diff line number Diff line
@@ -1189,23 +1189,26 @@ TRACE_EVENT(drv_set_rekey_data,

TRACE_EVENT(drv_rssi_callback,
	TP_PROTO(struct ieee80211_local *local,
		 struct ieee80211_sub_if_data *sdata,
		 enum ieee80211_rssi_event rssi_event),

	TP_ARGS(local, rssi_event),
	TP_ARGS(local, sdata, rssi_event),

	TP_STRUCT__entry(
		LOCAL_ENTRY
		VIF_ENTRY
		__field(u32, rssi_event)
	),

	TP_fast_assign(
		LOCAL_ASSIGN;
		VIF_ASSIGN;
		__entry->rssi_event = rssi_event;
	),

	TP_printk(
		LOCAL_PR_FMT " rssi_event:%d",
		LOCAL_PR_ARG, __entry->rssi_event
		LOCAL_PR_FMT VIF_PR_FMT " rssi_event:%d",
		LOCAL_PR_ARG, VIF_PR_ARG, __entry->rssi_event
	)
);