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

Commit 252aa631 authored by Johannes Berg's avatar Johannes Berg Committed by John W. Linville
Browse files

cfg80211: make action channel type optional



When sending action frames, we want to verify
that we do that on the correct channel. However,
checking the channel type in addition can get in
the way, since the channel type could change on
the fly during an association, and it's not
useful to have the channel type anyway since it
has no effect on the transmission. Therefore,
make it optional to specify so that if wanted,
it can still be checked, but is not required.

Signed-off-by: default avatarJohannes Berg <johannes@sipsolutions.net>
Signed-off-by: default avatarJohn W. Linville <linville@tuxdriver.com>
parent 4f424867
Loading
Loading
Loading
Loading
+1 −0
Original line number Original line Diff line number Diff line
@@ -1168,6 +1168,7 @@ struct cfg80211_ops {
	int	(*action)(struct wiphy *wiphy, struct net_device *dev,
	int	(*action)(struct wiphy *wiphy, struct net_device *dev,
			  struct ieee80211_channel *chan,
			  struct ieee80211_channel *chan,
			  enum nl80211_channel_type channel_type,
			  enum nl80211_channel_type channel_type,
			  bool channel_type_valid,
			  const u8 *buf, size_t len, u64 *cookie);
			  const u8 *buf, size_t len, u64 *cookie);


	int	(*set_power_mgmt)(struct wiphy *wiphy, struct net_device *dev,
	int	(*set_power_mgmt)(struct wiphy *wiphy, struct net_device *dev,
+3 −1
Original line number Original line Diff line number Diff line
@@ -1554,10 +1554,12 @@ static int ieee80211_cancel_remain_on_channel(struct wiphy *wiphy,
static int ieee80211_action(struct wiphy *wiphy, struct net_device *dev,
static int ieee80211_action(struct wiphy *wiphy, struct net_device *dev,
			    struct ieee80211_channel *chan,
			    struct ieee80211_channel *chan,
			    enum nl80211_channel_type channel_type,
			    enum nl80211_channel_type channel_type,
			    bool channel_type_valid,
			    const u8 *buf, size_t len, u64 *cookie)
			    const u8 *buf, size_t len, u64 *cookie)
{
{
	return ieee80211_mgd_action(IEEE80211_DEV_TO_SUB_IF(dev), chan,
	return ieee80211_mgd_action(IEEE80211_DEV_TO_SUB_IF(dev), chan,
				    channel_type, buf, len, cookie);
				    channel_type, channel_type_valid,
				    buf, len, cookie);
}
}


struct cfg80211_ops mac80211_config_ops = {
struct cfg80211_ops mac80211_config_ops = {
+1 −0
Original line number Original line Diff line number Diff line
@@ -988,6 +988,7 @@ int ieee80211_mgd_disassoc(struct ieee80211_sub_if_data *sdata,
int ieee80211_mgd_action(struct ieee80211_sub_if_data *sdata,
int ieee80211_mgd_action(struct ieee80211_sub_if_data *sdata,
			 struct ieee80211_channel *chan,
			 struct ieee80211_channel *chan,
			 enum nl80211_channel_type channel_type,
			 enum nl80211_channel_type channel_type,
			 bool channel_type_valid,
			 const u8 *buf, size_t len, u64 *cookie);
			 const u8 *buf, size_t len, u64 *cookie);
ieee80211_rx_result ieee80211_sta_rx_mgmt(struct ieee80211_sub_if_data *sdata,
ieee80211_rx_result ieee80211_sta_rx_mgmt(struct ieee80211_sub_if_data *sdata,
					  struct sk_buff *skb);
					  struct sk_buff *skb);
+6 −3
Original line number Original line Diff line number Diff line
@@ -2308,6 +2308,7 @@ int ieee80211_mgd_disassoc(struct ieee80211_sub_if_data *sdata,
int ieee80211_mgd_action(struct ieee80211_sub_if_data *sdata,
int ieee80211_mgd_action(struct ieee80211_sub_if_data *sdata,
			 struct ieee80211_channel *chan,
			 struct ieee80211_channel *chan,
			 enum nl80211_channel_type channel_type,
			 enum nl80211_channel_type channel_type,
			 bool channel_type_valid,
			 const u8 *buf, size_t len, u64 *cookie)
			 const u8 *buf, size_t len, u64 *cookie)
{
{
	struct ieee80211_local *local = sdata->local;
	struct ieee80211_local *local = sdata->local;
@@ -2315,9 +2316,11 @@ int ieee80211_mgd_action(struct ieee80211_sub_if_data *sdata,
	struct sk_buff *skb;
	struct sk_buff *skb;


	/* Check that we are on the requested channel for transmission */
	/* Check that we are on the requested channel for transmission */
	if ((chan != local->tmp_channel ||
	if (chan != local->tmp_channel &&
	     channel_type != local->tmp_channel_type) &&
	    chan != local->oper_channel)
	    (chan != local->oper_channel ||
		return -EBUSY;
	if (channel_type_valid &&
	    (channel_type != local->tmp_channel_type &&
	     channel_type != local->_oper_channel_type))
	     channel_type != local->_oper_channel_type))
		return -EBUSY;
		return -EBUSY;


+1 −0
Original line number Original line Diff line number Diff line
@@ -339,6 +339,7 @@ int cfg80211_mlme_action(struct cfg80211_registered_device *rdev,
			 struct net_device *dev,
			 struct net_device *dev,
			 struct ieee80211_channel *chan,
			 struct ieee80211_channel *chan,
			 enum nl80211_channel_type channel_type,
			 enum nl80211_channel_type channel_type,
			 bool channel_type_valid,
			 const u8 *buf, size_t len, u64 *cookie);
			 const u8 *buf, size_t len, u64 *cookie);


/* SME */
/* SME */
Loading