linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/2] nl80211: allow sending CMD_FRAME without specifying any frequency
@ 2013-06-03  6:39 Antonio Quartulli
  2013-06-03  6:39 ` [PATCH 2/2] mac80211: in mgmt_tx use the current channel if none has been specified Antonio Quartulli
                   ` (3 more replies)
  0 siblings, 4 replies; 19+ messages in thread
From: Antonio Quartulli @ 2013-06-03  6:39 UTC (permalink / raw)
  To: Johannes Berg; +Cc: linux-wireless, Antonio Quartulli

From: Antonio Quartulli <antonio@open-mesh.com>

Users may want to send a frame on the current channel
without specifying it.

Make mgmt_tx pass a NULL channel to mac80211 if none has
been specified by the user.

Signed-off-by: Antonio Quartulli <antonio@open-mesh.com>
---
 net/wireless/nl80211.c | 17 +++++++++++++----
 1 file changed, 13 insertions(+), 4 deletions(-)

diff --git a/net/wireless/nl80211.c b/net/wireless/nl80211.c
index 31d265f..c2376c7 100644
--- a/net/wireless/nl80211.c
+++ b/net/wireless/nl80211.c
@@ -7142,6 +7142,9 @@ static int nl80211_tx_mgmt(struct sk_buff *skb, struct genl_info *info)
 		return -EOPNOTSUPP;
 
 	switch (wdev->iftype) {
+	case NL80211_IFTYPE_P2P_DEVICE:
+		if (!info->attrs[NL80211_ATTR_WIPHY_FREQ])
+			return -EINVAL;
 	case NL80211_IFTYPE_STATION:
 	case NL80211_IFTYPE_ADHOC:
 	case NL80211_IFTYPE_P2P_CLIENT:
@@ -7149,7 +7152,6 @@ static int nl80211_tx_mgmt(struct sk_buff *skb, struct genl_info *info)
 	case NL80211_IFTYPE_AP_VLAN:
 	case NL80211_IFTYPE_MESH_POINT:
 	case NL80211_IFTYPE_P2P_GO:
-	case NL80211_IFTYPE_P2P_DEVICE:
 		break;
 	default:
 		return -EOPNOTSUPP;
@@ -7177,9 +7179,16 @@ static int nl80211_tx_mgmt(struct sk_buff *skb, struct genl_info *info)
 
 	no_cck = nla_get_flag(info->attrs[NL80211_ATTR_TX_NO_CCK_RATE]);
 
-	err = nl80211_parse_chandef(rdev, info, &chandef);
-	if (err)
-		return err;
+	/*
+	 * get the channel if any has been specified, otherwise pass NULL to
+	 * mac80211. The latter will use the current one
+	 */
+	chandef.chan = NULL;
+	if (info->attrs[NL80211_ATTR_WIPHY_FREQ]) {
+		err = nl80211_parse_chandef(rdev, info, &chandef);
+		if (err)
+			return err;
+	}
 
 	if (!dont_wait_for_ack) {
 		msg = nlmsg_new(NLMSG_DEFAULT_SIZE, GFP_KERNEL);
-- 
1.8.1.5


^ permalink raw reply related	[flat|nested] 19+ messages in thread

end of thread, other threads:[~2013-06-05 11:01 UTC | newest]

Thread overview: 19+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-06-03  6:39 [PATCH 1/2] nl80211: allow sending CMD_FRAME without specifying any frequency Antonio Quartulli
2013-06-03  6:39 ` [PATCH 2/2] mac80211: in mgmt_tx use the current channel if none has been specified Antonio Quartulli
2013-06-03 15:01   ` Johannes Berg
2013-06-03 18:03     ` Antonio Quartulli
2013-06-03 18:16       ` Johannes Berg
2013-06-03 18:26         ` Antonio Quartulli
2013-06-03 14:07 ` [PATCH 1/2] nl80211: allow sending CMD_FRAME without specifying any frequency Nicolas Cavallari
2013-06-03 14:25   ` Antonio Quartulli
2013-06-03 14:59 ` Johannes Berg
2013-06-03 15:04   ` Nicolas Cavallari
2013-06-03 17:14     ` ath6kl_mgmt_tx with NULL chan (was Re: [PATCH 1/2] nl80211: allow sending CMD_FRAME without specifying any frequency) Antonio Quartulli
2013-06-05  9:57       ` ath6kl_mgmt_tx with NULL chan Kalle Valo
2013-06-05 10:03         ` Antonio Quartulli
2013-06-05 10:15           ` Kalle Valo
2013-06-05 11:00             ` Antonio Quartulli
2013-06-05  9:47 ` [PATCH 1/2] nl80211: allow sending CMD_FRAME without specifying any frequency Kalle Valo
2013-06-05  9:53   ` Antonio Quartulli
2013-06-05 10:05     ` Kalle Valo
2013-06-05 10:08       ` Antonio Quartulli

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).