From patchwork Sun Dec 8 09:25:10 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: 3306151 Return-Path: X-Original-To: patchwork-linux-wireless@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 563A99F37A for ; Sun, 8 Dec 2013 09:33:39 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id B3A942035C for ; Sun, 8 Dec 2013 09:33:34 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 2124B20348 for ; Sun, 8 Dec 2013 09:33:30 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1758852Ab3LHJ20 (ORCPT ); Sun, 8 Dec 2013 04:28:26 -0500 Received: from mail-ea0-f181.google.com ([209.85.215.181]:60911 "EHLO mail-ea0-f181.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754640Ab3LHJ1c (ORCPT ); Sun, 8 Dec 2013 04:27:32 -0500 Received: by mail-ea0-f181.google.com with SMTP id m10so1017973eaj.12 for ; Sun, 08 Dec 2013 01:27:30 -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=QIqM0Hn/f4Jex4A37LJxbWSjfCmNj3CJ1ocIbAgMWpI=; b=EYzHS3ZVwIt/lSNL3XiVqUVShio/BOz27zUMfepQslLi1HBtIikcze0zEm50lnrBLG NyKFDeQxfcnqbqbQL19JpgvRI0jHYYtefWS6MWFokb93OYGj6LrQ3awea+22qFrN/0+g gTHIi8MzhtZZ4lcPPrPMdpb1+BHLB1PzbIS8+mtiEjQTpm7+Ue7SJYg6rOhPhJ+ZLiqZ LQad9kaWRLcqh5xTNBP/2InAmqMAvdZop2U+8NN0S0QiJVdwCm1zdWxyj48RY8pvbxGN 6XND6ELj8wEYJ+amETdowdGY+SVPJxOkYT208yJ7X+TOQ9LaZdH/QzgRd8Ng//kMiNRE aSlQ== X-Received: by 10.14.184.66 with SMTP id r42mr2164842eem.86.1386494850739; Sun, 08 Dec 2013 01:27:30 -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.29 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Sun, 08 Dec 2013 01:27:30 -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 12/16] wl1251: enforce changed hw encryption support on monitor state change Date: Sun, 8 Dec 2013 10:25:10 +0100 Message-Id: <1386494714-21070-13-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: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org X-Spam-Status: No, score=-6.9 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 From: David Gnedt The firmware doesn't support per packet encryption selection, so disable hw encryption support completely while a monitor interface is present to support injection of packets (which shouldn't get encrypted by hw). To enforce the changed hw encryption support force a disassociation on non-monitor interfaces. For disassociation a workaround using hw connection monitor is employed, which temporary enables hw connection manager flag. Signed-off-by: David Gnedt Signed-off-by: Pali Rohár Reviewed-by: Pavel Machek --- drivers/net/wireless/ti/wl1251/main.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/drivers/net/wireless/ti/wl1251/main.c b/drivers/net/wireless/ti/wl1251/main.c index bb6e873..1ef264c 100644 --- a/drivers/net/wireless/ti/wl1251/main.c +++ b/drivers/net/wireless/ti/wl1251/main.c @@ -688,6 +688,16 @@ static int wl1251_op_config(struct ieee80211_hw *hw, u32 changed) wl->power_level = conf->power_level; } + /* + * Tell stack that connection is lost because hw encryption isn't + * supported in monitor mode. + * This requires temporary enabling of the hw connection monitor flag + */ + if ((changed & IEEE80211_CONF_CHANGE_MONITOR) && wl->vif) { + wl->hw->flags |= IEEE80211_HW_CONNECTION_MONITOR; + ieee80211_connection_loss(wl->vif); + } + out_sleep: wl1251_ps_elp_sleep(wl); @@ -1120,6 +1130,9 @@ static void wl1251_op_bss_info_changed(struct ieee80211_hw *hw, } if (changed & BSS_CHANGED_ASSOC) { + /* Disable temporary enabled hw connection monitor flag */ + wl->hw->flags &= ~IEEE80211_HW_CONNECTION_MONITOR; + if (bss_conf->assoc) { wl->beacon_int = bss_conf->beacon_int;