linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Holger Schurig <holgerschurig@googlemail.com>
To: John Linville <linville@tuxdriver.com>,
	linux-wireless@vger.kernel.org, Dan Williams <dcbw@redhat.com>
Subject: [PATCH 04/10] libertas: decouple mesh and rtap
Date: Wed, 02 Dec 2009 15:25:59 +0100	[thread overview]
Message-ID: <20091202142934.837587096@gmail.com> (raw)
In-Reply-To: 20091202142555.654873300@gmail.com

While it's might be technically true that only MESH-enabled firmwares
are also RTAP-enabled, I like to have this decoupled. 

Signed-off-by: Holger Schurig <holgerschurig@gmail.com>


--- linux-wl.orig/drivers/net/wireless/libertas/main.c
+++ linux-wl/drivers/net/wireless/libertas/main.c
@@ -1075,6 +1075,17 @@ void lbs_remove_card(struct lbs_private 
 EXPORT_SYMBOL_GPL(lbs_remove_card);
 
 
+static int lbs_rtap_supported(struct lbs_private *priv)
+{
+	if (MRVL_FW_MAJOR_REV(priv->fwrelease) == MRVL_FW_V5)
+		return 1;
+
+	/* newer firmware use a capability mask */
+	return ((MRVL_FW_MAJOR_REV(priv->fwrelease) >= MRVL_FW_V10) &&
+		(priv->fwcapinfo & MESH_CAPINFO_ENABLE_MASK));
+}
+
+
 int lbs_start_card(struct lbs_private *priv)
 {
 	struct net_device *dev = priv->dev;
@@ -1094,12 +1105,14 @@ int lbs_start_card(struct lbs_private *p
 
 	lbs_update_channel(priv);
 
+	lbs_init_mesh(priv);
+
 	/*
 	 * While rtap isn't related to mesh, only mesh-enabled
 	 * firmware implements the rtap functionality via
 	 * CMD_802_11_MONITOR_MODE.
 	 */
-	if (lbs_init_mesh(priv)) {
+	if (lbs_rtap_supported(priv)) {
 		if (device_create_file(&dev->dev, &dev_attr_lbs_rtap))
 			lbs_pr_err("cannot register lbs_rtap attribute\n");
 	}
@@ -1133,7 +1146,9 @@ void lbs_stop_card(struct lbs_private *p
 	netif_carrier_off(dev);
 
 	lbs_debugfs_remove_one(priv);
-	if (lbs_deinit_mesh(priv))
+	lbs_deinit_mesh(priv);
+
+	if (lbs_rtap_supported(priv))
 		device_remove_file(&dev->dev, &dev_attr_lbs_rtap);
 
 	/* Delete the timeout of the currently processing command */

-- 

  parent reply	other threads:[~2009-12-02 14:30 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-12-02 14:25 [PATCH 00/10] [PATCH] libertas: remove WEXT, add CFG80211 Holger Schurig
2009-12-02 14:25 ` [PATCH 01/10] libertas: use priv->mesh_tlv instead of priv->mesh_fw_ver Holger Schurig
2009-12-02 14:25 ` [PATCH 02/10] libertas: remove mesh_autostart_enabled and sync_channel Holger Schurig
2009-12-02 14:25 ` [PATCH 03/10] libertas: move mesh-related definitions into mesh.h Holger Schurig
2009-12-02 14:25 ` Holger Schurig [this message]
2009-12-02 14:26 ` [PATCH 05/10] libertas: move mesh SSID initialization into mesh.c Holger Schurig
2009-12-02 14:26 ` [PATCH 06/10] libertas: add access functions for mesh open/connect status Holger Schurig
2009-12-02 14:26 ` [PATCH 07/10] libertas: make mesh configurable Holger Schurig
2009-12-02 14:26 ` [PATCH 08/10] libertas: remove priv->capability Holger Schurig
2009-12-02 14:26 ` [PATCH 09/10] libertas: remove priv->ratebitmap Holger Schurig
2009-12-02 14:26 ` [PATCH 10/10] [RFC, v4] libertas: cfg80211 support Holger Schurig
2010-01-25 15:20   ` Samuel Ortiz
2010-01-26 13:20     ` Holger Schurig
2009-12-02 20:45 ` [PATCH 00/10] [PATCH] libertas: remove WEXT, add CFG80211 Dan Williams
2009-12-03 10:02   ` Holger Schurig

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20091202142934.837587096@gmail.com \
    --to=holgerschurig@googlemail.com \
    --cc=dcbw@redhat.com \
    --cc=linux-wireless@vger.kernel.org \
    --cc=linville@tuxdriver.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).