From patchwork Wed Dec 2 14:25:59 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Holger Schurig X-Patchwork-Id: 64280 Received: from vger.kernel.org (vger.kernel.org [209.132.176.167]) by demeter.kernel.org (8.14.2/8.14.2) with ESMTP id nB2EUB37007939 for ; Wed, 2 Dec 2009 14:30:11 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753045AbZLBOaD (ORCPT ); Wed, 2 Dec 2009 09:30:03 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1754584AbZLBOaD (ORCPT ); Wed, 2 Dec 2009 09:30:03 -0500 Received: from mail-bw0-f227.google.com ([209.85.218.227]:65310 "EHLO mail-bw0-f227.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752402AbZLBOaC (ORCPT ); Wed, 2 Dec 2009 09:30:02 -0500 Received: by mail-bw0-f227.google.com with SMTP id 27so217224bwz.21 for ; Wed, 02 Dec 2009 06:30:08 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=gamma; h=domainkey-signature:received:received:received:message-id :references:user-agent:date:from:to:subject:content-disposition; bh=4KKCB+ypS/1wjQ1UP0ZxQwb/5sHWj8P7f0Mr9bmHE6c=; b=Bn74jI/ZORWQl/6paZ8M9GMq2tt1TOZtcyme5/47dB6aV3R0C0ppB+taq2oIbMyikt LDXAdabTdcM7nE+1uo8ymSa01c9whJ09ON2YCD5ntvaXDg1KVbi9KA+cT6v/dlCku1O8 YfE3jr/FGmTFT9nY2slyNoYXvgiX3TyAdI8Wk= DomainKey-Signature: a=rsa-sha1; c=nofws; d=googlemail.com; s=gamma; h=message-id:references:user-agent:date:from:to:subject :content-disposition; b=gRGp9VxXl27lq1YnKhLcX4I53l58WRR2YAGa8jLIfEPD3LMKjFYy5SsXmthrJ0ft3i krQFkJak47VDViqq+qjTZbPNaywqFBLL1OHK4k/1YEVLr4AhmT/8SHD/YkT/olvUBsWr WR2sRn2qIOQwus+u+W91cIrb2AevoYL+lDNi8= Received: by 10.204.3.220 with SMTP id 28mr227827bko.4.1259764208405; Wed, 02 Dec 2009 06:30:08 -0800 (PST) Received: from holgerschurig@gmail.com (pD95FA93E.dip0.t-ipconnect.de [217.95.169.62]) by mx.google.com with ESMTPS id 16sm335953bwz.7.2009.12.02.06.30.06 (version=TLSv1/SSLv3 cipher=RC4-MD5); Wed, 02 Dec 2009 06:30:07 -0800 (PST) Received: by holgerschurig@gmail.com (sSMTP sendmail emulation); Wed, 02 Dec 2009 15:29:34 +0100 Message-Id: <20091202142934.837587096@gmail.com> References: <20091202142555.654873300@gmail.com> User-Agent: quilt/0.46-1 Date: Wed, 02 Dec 2009 15:25:59 +0100 From: Holger Schurig To: John Linville , linux-wireless@vger.kernel.org, Dan Williams Subject: [PATCH 04/10] libertas: decouple mesh and rtap Content-Disposition: inline; filename=lbs-mesh-decouple-rtap.patch Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org --- 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 */