From patchwork Sat Oct 26 20:34:12 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?q?Pali_Roh=C3=A1r?= X-Patchwork-Id: 3098731 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 6DFC89F461 for ; Sat, 26 Oct 2013 20:40:44 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id AAA7A20250 for ; Sat, 26 Oct 2013 20:40:43 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id B9B22202FF for ; Sat, 26 Oct 2013 20:40:42 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753988Ab3JZUkl (ORCPT ); Sat, 26 Oct 2013 16:40:41 -0400 Received: from mail-ee0-f41.google.com ([74.125.83.41]:51314 "EHLO mail-ee0-f41.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753930Ab3JZUki (ORCPT ); Sat, 26 Oct 2013 16:40:38 -0400 Received: by mail-ee0-f41.google.com with SMTP id d49so2718939eek.0 for ; Sat, 26 Oct 2013 13:40:37 -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:in-reply-to:references; bh=beML/rXjrbLqhbCtKxengsamPKgTKHPbeR0ys3Hzf18=; b=mPHJUkfoAf4XE2umfJen5Ri95iH/r+EXLOyWPBm0o9iFD9uDBqZrSd3U37FYPq0Sg4 b9zZqudgMgOe1cb8wPq0l1F+Y0zkfwJYzuhhtjdV3Zq0S3VxDQOkrTHWvXYsx2YozOXj Myrne0lxpxkjlG9hjDerJlXWjjCNhJ8hzd3cVUo9E3n1WHUGv8eJimg0tZDhJjGubE/D 1qyeq1x8wLfyKexcMHP51gWfPjZI1Sr+UWihHW65LTr29KzubUFn3alw0fyuOBdJhYff rhh1ocdniv7uhoSLgqMhmoPZS9QwbRqxYGO4W3+G9+fBYYi8gchX0UZ9xDOR15q3k3nf E1Fw== X-Received: by 10.15.54.199 with SMTP id t47mr14110335eew.46.1382820036994; Sat, 26 Oct 2013 13:40:36 -0700 (PDT) Received: from Pali-EliteBook.kolej.mff.cuni.cz (pali.kolej.mff.cuni.cz. [78.128.193.202]) by mx.google.com with ESMTPSA id i1sm35327553eeg.0.2013.10.26.13.40.36 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Sat, 26 Oct 2013 13:40:36 -0700 (PDT) From: =?UTF-8?q?Pali=20Roh=C3=A1r?= To: Luciano Coelho , "John W. Linville" , Johannes Berg , "David S. Miller" 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, pali.rohar@gmail.com, David Gnedt Subject: [PATCH 13/16] wl1251: enforce changed hw encryption support on monitor state change Date: Sat, 26 Oct 2013 22:34:12 +0200 Message-Id: <1382819655-30430-14-git-send-email-pali.rohar@gmail.com> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <1382819655-30430-1-git-send-email-pali.rohar@gmail.com> References: <1382819655-30430-1-git-send-email-pali.rohar@gmail.com> 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.2 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 completly 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 --- 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 174f403..f054741 100644 --- a/drivers/net/wireless/ti/wl1251/main.c +++ b/drivers/net/wireless/ti/wl1251/main.c @@ -685,6 +685,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. + * XXX This requires temporary enabling 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); @@ -1116,6 +1126,9 @@ static void wl1251_op_bss_info_changed(struct ieee80211_hw *hw, } if (changed & BSS_CHANGED_ASSOC) { + /* XXX 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;