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

Commit 49884568 authored by Eliad Peller's avatar Eliad Peller Committed by Johannes Berg
Browse files

mac80211: make remain_on_channel() op pass vif param



Drivers (e.g. wl12xx) might need to know the vif
to roc on (mainly in order to configure the
rx filters correctly).

Add the vif to the op params, and update the current
users (iwlwifi) to use the new api.

Signed-off-by: default avatarEliad Peller <eliad@wizery.com>
[fix hwsim]
Signed-off-by: default avatarJohannes Berg <johannes.berg@intel.com>
parent 3475b094
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -1032,6 +1032,7 @@ static void iwlagn_mac_flush(struct ieee80211_hw *hw, bool drop)
}

static int iwlagn_mac_remain_on_channel(struct ieee80211_hw *hw,
				     struct ieee80211_vif *vif,
				     struct ieee80211_channel *channel,
				     enum nl80211_channel_type channel_type,
				     int duration)
+1 −0
Original line number Diff line number Diff line
@@ -1453,6 +1453,7 @@ static void hw_roc_done(struct work_struct *work)
}

static int mac80211_hwsim_roc(struct ieee80211_hw *hw,
			      struct ieee80211_vif *vif,
			      struct ieee80211_channel *chan,
			      enum nl80211_channel_type channel_type,
			      int duration)
+1 −0
Original line number Diff line number Diff line
@@ -2530,6 +2530,7 @@ struct ieee80211_ops {
	int (*get_antenna)(struct ieee80211_hw *hw, u32 *tx_ant, u32 *rx_ant);

	int (*remain_on_channel)(struct ieee80211_hw *hw,
				 struct ieee80211_vif *vif,
				 struct ieee80211_channel *chan,
				 enum nl80211_channel_type channel_type,
				 int duration);
+4 −2
Original line number Diff line number Diff line
@@ -2287,7 +2287,8 @@ static int ieee80211_start_roc_work(struct ieee80211_local *local,
	if (!duration)
		duration = 10;

	ret = drv_remain_on_channel(local, channel, channel_type, duration);
	ret = drv_remain_on_channel(local, sdata, channel, channel_type,
				    duration);
	if (ret) {
		kfree(roc);
		return ret;
@@ -2298,7 +2299,8 @@ static int ieee80211_start_roc_work(struct ieee80211_local *local,

 out_check_combine:
	list_for_each_entry(tmp, &local->roc_list, list) {
		if (tmp->chan != channel || tmp->chan_type != channel_type)
		if (tmp->chan != channel || tmp->chan_type != channel_type ||
		    tmp->sdata != sdata)
			continue;

		/*
+4 −3
Original line number Diff line number Diff line
@@ -704,6 +704,7 @@ static inline int drv_get_antenna(struct ieee80211_local *local,
}

static inline int drv_remain_on_channel(struct ieee80211_local *local,
					struct ieee80211_sub_if_data *sdata,
					struct ieee80211_channel *chan,
					enum nl80211_channel_type chantype,
					unsigned int duration)
@@ -712,9 +713,9 @@ static inline int drv_remain_on_channel(struct ieee80211_local *local,

	might_sleep();

	trace_drv_remain_on_channel(local, chan, chantype, duration);
	ret = local->ops->remain_on_channel(&local->hw, chan, chantype,
					    duration);
	trace_drv_remain_on_channel(local, sdata, chan, chantype, duration);
	ret = local->ops->remain_on_channel(&local->hw, &sdata->vif,
					    chan, chantype, duration);
	trace_drv_return_int(local, ret);

	return ret;
Loading