From patchwork Thu Apr 24 08:14:10 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chun-Yeow Yeoh X-Patchwork-Id: 4046011 Return-Path: X-Original-To: patchwork-linux-wireless@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 78376BFF02 for ; Thu, 24 Apr 2014 08:14:42 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id B01E52022D for ; Thu, 24 Apr 2014 08:14:41 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id D83F120219 for ; Thu, 24 Apr 2014 08:14:40 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752652AbaDXIOe (ORCPT ); Thu, 24 Apr 2014 04:14:34 -0400 Received: from mail-pa0-f52.google.com ([209.85.220.52]:42033 "EHLO mail-pa0-f52.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752563AbaDXIO1 (ORCPT ); Thu, 24 Apr 2014 04:14:27 -0400 Received: by mail-pa0-f52.google.com with SMTP id kx10so1674776pab.39 for ; Thu, 24 Apr 2014 01:14:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id; bh=0k893MwLc1pznxNvOytgiXadCaQ593IgwO+QUvlM9WE=; b=CxazNlwK+ROh+tu2NUxUYmZiRr19k23evEnZ7eiq0hnKWLoIrAbN8rEXlZPu40YDca EHUo2+UIR5xInHjRfCW/whtK4T66IqtzxdBJMrNiuHjPbqKZoNApCjDPD64E8rbRxyF6 C0rfMnEMtGFBKfbkJqMqlGnxoni3XlALtK2K/zh0A4VOvYrsmU227N6MsxJJGSIBzLm8 IavnFk7A5uX8wI9q2K5816GS/t0ojoKxMk2YSwdX5zYlvVh8/DQC5Xc9BZzg2jcVUNij zO6gORPhsvD3Uxz35IeHJj25q6FUSepaPwEoNTZiv1kK9YYuOLMzEcf1GENjYBZrzgKl rC7g== X-Received: by 10.68.113.68 with SMTP id iw4mr28316164pbb.119.1398327266747; Thu, 24 Apr 2014 01:14:26 -0700 (PDT) Received: from localhost.localdomain ([58.26.233.145]) by mx.google.com with ESMTPSA id gn3sm7425490pbc.32.2014.04.24.01.14.24 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 24 Apr 2014 01:14:26 -0700 (PDT) From: Chun-Yeow Yeoh To: linux-wireless@vger.kernel.org Cc: ath10k@lists.infradead.org, kvalo@qca.qualcomm.com, Chun-Yeow Yeoh Subject: [PATCH] ath10k: don't allow stand alone monitor mode for non-AP firmware Date: Thu, 24 Apr 2014 16:14:10 +0800 Message-Id: <1398327250-12923-1-git-send-email-yeohchunyeow@gmail.com> X-Mailer: git-send-email 1.9.2 Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org X-Spam-Status: No, score=-7.4 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, T_DKIM_INVALID, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Firmware 999.999.0.636 does not allow stand alone monitor mode. This means that bridging the STA mode and put it into promiscuous mode will also cause the firmware to crash. Avoid this. Signed-off-by: Chun-Yeow Yeoh --- drivers/net/wireless/ath/ath10k/mac.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/drivers/net/wireless/ath/ath10k/mac.c b/drivers/net/wireless/ath/ath10k/mac.c index e2c01dc..f640328 100644 --- a/drivers/net/wireless/ath/ath10k/mac.c +++ b/drivers/net/wireless/ath/ath10k/mac.c @@ -647,10 +647,15 @@ static int ath10k_monitor_vdev_delete(struct ath10k *ar) static int ath10k_monitor_start(struct ath10k *ar) { - int ret; + int ret = -1; lockdep_assert_held(&ar->conf_mutex); + if (ar->fw_version_build == 636) { + ath10k_warn("stand alone monitor mode is not supported\n"); + return ret; + } + if (!ath10k_monitor_is_enabled(ar)) { ath10k_warn("trying to start monitor with no references\n"); return 0;