diff options
author | Antonio Quartulli <antonio@open-mesh.com> | 2013-06-11 08:20:03 -0400 |
---|---|---|
committer | Johannes Berg <johannes.berg@intel.com> | 2013-06-11 09:01:36 -0400 |
commit | ea141b75ae29636b5c9e9d2e2e77b3dd1ab4c934 (patch) | |
tree | a3cb688eece88443a72f5716f0375fb4eb603666 /net/wireless | |
parent | bfd634d01e02071404e3e36e3946728009ed023f (diff) |
nl80211: allow sending CMD_FRAME without specifying any frequency
Users may want to send a frame on the current channel
without specifying it.
This is particularly useful for the correct implementation
of the IBSS/RSN support in wpa_supplicant which requires to
receive and send AUTH frames.
Make mgmt_tx pass a NULL channel to the driver if none has
been specified by the user.
Signed-off-by: Antonio Quartulli <antonio@open-mesh.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Diffstat (limited to 'net/wireless')
-rw-r--r-- | net/wireless/nl80211.c | 19 |
1 files changed, 15 insertions, 4 deletions
diff --git a/net/wireless/nl80211.c b/net/wireless/nl80211.c index 7183410fcd41..398ce2c59686 100644 --- a/net/wireless/nl80211.c +++ b/net/wireless/nl80211.c | |||
@@ -7147,6 +7147,9 @@ static int nl80211_tx_mgmt(struct sk_buff *skb, struct genl_info *info) | |||
7147 | return -EOPNOTSUPP; | 7147 | return -EOPNOTSUPP; |
7148 | 7148 | ||
7149 | switch (wdev->iftype) { | 7149 | switch (wdev->iftype) { |
7150 | case NL80211_IFTYPE_P2P_DEVICE: | ||
7151 | if (!info->attrs[NL80211_ATTR_WIPHY_FREQ]) | ||
7152 | return -EINVAL; | ||
7150 | case NL80211_IFTYPE_STATION: | 7153 | case NL80211_IFTYPE_STATION: |
7151 | case NL80211_IFTYPE_ADHOC: | 7154 | case NL80211_IFTYPE_ADHOC: |
7152 | case NL80211_IFTYPE_P2P_CLIENT: | 7155 | case NL80211_IFTYPE_P2P_CLIENT: |
@@ -7154,7 +7157,6 @@ static int nl80211_tx_mgmt(struct sk_buff *skb, struct genl_info *info) | |||
7154 | case NL80211_IFTYPE_AP_VLAN: | 7157 | case NL80211_IFTYPE_AP_VLAN: |
7155 | case NL80211_IFTYPE_MESH_POINT: | 7158 | case NL80211_IFTYPE_MESH_POINT: |
7156 | case NL80211_IFTYPE_P2P_GO: | 7159 | case NL80211_IFTYPE_P2P_GO: |
7157 | case NL80211_IFTYPE_P2P_DEVICE: | ||
7158 | break; | 7160 | break; |
7159 | default: | 7161 | default: |
7160 | return -EOPNOTSUPP; | 7162 | return -EOPNOTSUPP; |
@@ -7182,9 +7184,18 @@ static int nl80211_tx_mgmt(struct sk_buff *skb, struct genl_info *info) | |||
7182 | 7184 | ||
7183 | no_cck = nla_get_flag(info->attrs[NL80211_ATTR_TX_NO_CCK_RATE]); | 7185 | no_cck = nla_get_flag(info->attrs[NL80211_ATTR_TX_NO_CCK_RATE]); |
7184 | 7186 | ||
7185 | err = nl80211_parse_chandef(rdev, info, &chandef); | 7187 | /* get the channel if any has been specified, otherwise pass NULL to |
7186 | if (err) | 7188 | * the driver. The latter will use the current one |
7187 | return err; | 7189 | */ |
7190 | chandef.chan = NULL; | ||
7191 | if (info->attrs[NL80211_ATTR_WIPHY_FREQ]) { | ||
7192 | err = nl80211_parse_chandef(rdev, info, &chandef); | ||
7193 | if (err) | ||
7194 | return err; | ||
7195 | } | ||
7196 | |||
7197 | if (!chandef.chan && offchan) | ||
7198 | return -EINVAL; | ||
7188 | 7199 | ||
7189 | if (!dont_wait_for_ack) { | 7200 | if (!dont_wait_for_ack) { |
7190 | msg = nlmsg_new(NLMSG_DEFAULT_SIZE, GFP_KERNEL); | 7201 | msg = nlmsg_new(NLMSG_DEFAULT_SIZE, GFP_KERNEL); |