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

Commit d339d5ca authored by Ilan Peer's avatar Ilan Peer Committed by Johannes Berg
Browse files

mac80211: Allow drivers to differentiate between ROC types



Some devices can handle remain on channel requests differently
based on the request type/priority. Add support to
differentiate between different ROC types, i.e., indicate that
the ROC is required for sending managment frames.

Signed-off-by: default avatarIlan Peer <ilan.peer@intel.com>
Reviewed-by: default avatarEmmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: default avatarJohannes Berg <johannes.berg@intel.com>
parent f62fab73
Loading
Loading
Loading
Loading
+2 −1
Original line number Original line Diff line number Diff line
@@ -1137,7 +1137,8 @@ static void iwlagn_mac_flush(struct ieee80211_hw *hw, bool drop)
static int iwlagn_mac_remain_on_channel(struct ieee80211_hw *hw,
static int iwlagn_mac_remain_on_channel(struct ieee80211_hw *hw,
				     struct ieee80211_vif *vif,
				     struct ieee80211_vif *vif,
				     struct ieee80211_channel *channel,
				     struct ieee80211_channel *channel,
				     int duration)
				     int duration,
				     enum ieee80211_roc_type type)
{
{
	struct iwl_priv *priv = IWL_MAC80211_GET_DVM(hw);
	struct iwl_priv *priv = IWL_MAC80211_GET_DVM(hw);
	struct iwl_rxon_context *ctx = &priv->contexts[IWL_RXON_CTX_PAN];
	struct iwl_rxon_context *ctx = &priv->contexts[IWL_RXON_CTX_PAN];
+4 −3
Original line number Original line Diff line number Diff line
@@ -1081,7 +1081,8 @@ static void iwl_mvm_mac_update_tkip_key(struct ieee80211_hw *hw,
static int iwl_mvm_roc(struct ieee80211_hw *hw,
static int iwl_mvm_roc(struct ieee80211_hw *hw,
		       struct ieee80211_vif *vif,
		       struct ieee80211_vif *vif,
		       struct ieee80211_channel *channel,
		       struct ieee80211_channel *channel,
		       int duration)
		       int duration,
		       enum ieee80211_roc_type type)
{
{
	struct iwl_mvm *mvm = IWL_MAC80211_GET_MVM(hw);
	struct iwl_mvm *mvm = IWL_MAC80211_GET_MVM(hw);
	struct cfg80211_chan_def chandef;
	struct cfg80211_chan_def chandef;
@@ -1092,8 +1093,8 @@ static int iwl_mvm_roc(struct ieee80211_hw *hw,
		return -EINVAL;
		return -EINVAL;
	}
	}


	IWL_DEBUG_MAC80211(mvm, "enter (%d, %d)\n", channel->hw_value,
	IWL_DEBUG_MAC80211(mvm, "enter (%d, %d, %d)\n", channel->hw_value,
			   duration);
			   duration, type);


	mutex_lock(&mvm->mutex);
	mutex_lock(&mvm->mutex);


+2 −1
Original line number Original line Diff line number Diff line
@@ -1535,7 +1535,8 @@ static void hw_roc_done(struct work_struct *work)
static int mac80211_hwsim_roc(struct ieee80211_hw *hw,
static int mac80211_hwsim_roc(struct ieee80211_hw *hw,
			      struct ieee80211_vif *vif,
			      struct ieee80211_vif *vif,
			      struct ieee80211_channel *chan,
			      struct ieee80211_channel *chan,
			      int duration)
			      int duration,
			      enum ieee80211_roc_type type)
{
{
	struct mac80211_hwsim_data *hwsim = hw->priv;
	struct mac80211_hwsim_data *hwsim = hw->priv;


+2 −1
Original line number Original line Diff line number Diff line
@@ -4956,7 +4956,8 @@ static void wlcore_op_flush(struct ieee80211_hw *hw, bool drop)
static int wlcore_op_remain_on_channel(struct ieee80211_hw *hw,
static int wlcore_op_remain_on_channel(struct ieee80211_hw *hw,
				       struct ieee80211_vif *vif,
				       struct ieee80211_vif *vif,
				       struct ieee80211_channel *chan,
				       struct ieee80211_channel *chan,
				       int duration)
				       int duration,
				       enum ieee80211_roc_type type)
{
{
	struct wl12xx_vif *wlvif = wl12xx_vif_to_data(vif);
	struct wl12xx_vif *wlvif = wl12xx_vif_to_data(vif);
	struct wl1271 *wl = hw->priv;
	struct wl1271 *wl = hw->priv;
+20 −1
Original line number Original line Diff line number Diff line
@@ -2134,6 +2134,24 @@ enum ieee80211_rate_control_changed {
	IEEE80211_RC_NSS_CHANGED	= BIT(3),
	IEEE80211_RC_NSS_CHANGED	= BIT(3),
};
};


/**
 * enum ieee80211_roc_type - remain on channel type
 *
 * With the support for multi channel contexts and multi channel operations,
 * remain on channel operations might be limited/deferred/aborted by other
 * flows/operations which have higher priority (and vise versa).
 * Specifying the ROC type can be used by devices to prioritize the ROC
 * operations compared to other operations/flows.
 *
 * @IEEE80211_ROC_TYPE_NORMAL: There are no special requirements for this ROC.
 * @IEEE80211_ROC_TYPE_MGMT_TX: The remain on channel request is required
 *	for sending managment frames offchannel.
 */
enum ieee80211_roc_type {
	IEEE80211_ROC_TYPE_NORMAL = 0,
	IEEE80211_ROC_TYPE_MGMT_TX,
};

/**
/**
 * struct ieee80211_ops - callbacks from mac80211 to the driver
 * struct ieee80211_ops - callbacks from mac80211 to the driver
 *
 *
@@ -2687,7 +2705,8 @@ struct ieee80211_ops {
	int (*remain_on_channel)(struct ieee80211_hw *hw,
	int (*remain_on_channel)(struct ieee80211_hw *hw,
				 struct ieee80211_vif *vif,
				 struct ieee80211_vif *vif,
				 struct ieee80211_channel *chan,
				 struct ieee80211_channel *chan,
				 int duration);
				 int duration,
				 enum ieee80211_roc_type type);
	int (*cancel_remain_on_channel)(struct ieee80211_hw *hw);
	int (*cancel_remain_on_channel)(struct ieee80211_hw *hw);
	int (*set_ringparam)(struct ieee80211_hw *hw, u32 tx, u32 rx);
	int (*set_ringparam)(struct ieee80211_hw *hw, u32 tx, u32 rx);
	void (*get_ringparam)(struct ieee80211_hw *hw,
	void (*get_ringparam)(struct ieee80211_hw *hw,
Loading