From patchwork Sun Dec 8 09:25:07 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Pali_Roh=C3=A1r?= X-Patchwork-Id: 298775 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 401172C00D2 for ; Sun, 8 Dec 2013 20:33:43 +1100 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756944Ab3LHJ2V (ORCPT ); Sun, 8 Dec 2013 04:28:21 -0500 Received: from mail-ee0-f41.google.com ([74.125.83.41]:44405 "EHLO mail-ee0-f41.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754574Ab3LHJ12 (ORCPT ); Sun, 8 Dec 2013 04:27:28 -0500 Received: by mail-ee0-f41.google.com with SMTP id t10so1016732eei.0 for ; Sun, 08 Dec 2013 01:27:26 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-type:content-transfer-encoding; bh=XBbq2LfrR1FTEBl5t22Yb8HPmm4QpohEDHXImRcveRs=; b=WC6qAQ1EiF3IlERQBWzJ2Xw3W60dfXPGQlZcU/Rph6YPtpSmvz/yDDufDLF+Brd6tF 35YXOSC+bsQAKT7/bQ2yrN4DYBKn25m+5Ua+9wY6FYEFSlV7sfNu9SsAQeLT0IDl+jE1 E0o7ixiK1FDCB8iD/AoJLIf1r+adnBdT3P6qxCIl7gmjDPi27gUQckVVulT3/eWgaNjh Lp++LW90cbsyj5A4ByF2MOojWMfcjk2AJrHnLe33mKWJSWthRIc7/K1fTV8hoiq56RsK vbWbyMUqoDSMpRZJvw/SMmZLWezluaAhhbgkSvfL60NriT1BvvF1tFPyRE5A4Cur0qCr oNww== X-Received: by 10.15.95.72 with SMTP id bc48mr8742970eeb.49.1386494846588; Sun, 08 Dec 2013 01:27:26 -0800 (PST) Received: from Pali-EliteBook.kolej.mff.cuni.cz (pali.kolej.mff.cuni.cz. [78.128.193.202]) by mx.google.com with ESMTPSA id m1sm15397623eeg.0.2013.12.08.01.27.25 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Sun, 08 Dec 2013 01:27:25 -0800 (PST) From: =?UTF-8?q?Pali=20Roh=C3=A1r?= To: Luciano Coelho , "John W. Linville" Cc: linux-wireless@vger.kernel.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, freemangordon@abv.bg, aaro.koskinen@iki.fi, pavel@ucw.cz, sre@ring0.de, joni.lapilainen@gmail.com, Johannes Berg , Felipe Contreras , David Gnedt , =?UTF-8?q?Pali=20Roh=C3=A1r?= Subject: [PATCH v2 09/16] wl1251: fix channel switching in monitor mode Date: Sun, 8 Dec 2013 10:25:07 +0100 Message-Id: <1386494714-21070-10-git-send-email-pali.rohar@gmail.com> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1386494714-21070-1-git-send-email-pali.rohar@gmail.com> References: <1382819655-30430-1-git-send-email-pali.rohar@gmail.com> <1386494714-21070-1-git-send-email-pali.rohar@gmail.com> MIME-Version: 1.0 Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org From: David Gnedt Use the ENABLE_RX command for channel switching when no interface is present (monitor mode only). The advantage of ENABLE_RX is that it leaves the tx data path disabled in firmware, whereas the usual JOIN command seems to transmit some frames at firmware level. Signed-off-by: David Gnedt Signed-off-by: Pali Rohár Reviewed-by: Pavel Machek --- drivers/net/wireless/ti/wl1251/main.c | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/drivers/net/wireless/ti/wl1251/main.c b/drivers/net/wireless/ti/wl1251/main.c index 1223bc6..b6f11b8 100644 --- a/drivers/net/wireless/ti/wl1251/main.c +++ b/drivers/net/wireless/ti/wl1251/main.c @@ -616,8 +616,19 @@ static int wl1251_op_config(struct ieee80211_hw *hw, u32 changed) if (channel != wl->channel) { wl->channel = channel; - ret = wl1251_join(wl, wl->bss_type, wl->channel, - wl->beacon_int, wl->dtim_period); + /* + * Use ENABLE_RX command for channel switching when no + * interface is present (monitor mode only). + * This leaves the tx path disabled in firmware, whereas + * the usual JOIN command seems to transmit some frames + * at firmware level. + */ + if (wl->vif == NULL) { + ret = wl1251_cmd_data_path_rx(wl, wl->channel, 1); + } else { + ret = wl1251_join(wl, wl->bss_type, wl->channel, + wl->beacon_int, wl->dtim_period); + } if (ret < 0) goto out_sleep; }