From patchwork Wed Apr 20 16:41:34 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chun-Yeow Yeoh X-Patchwork-Id: 8892891 X-Patchwork-Delegate: kvalo@adurom.com 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.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 75FCBBF29F for ; Wed, 20 Apr 2016 16:41:57 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id A158E20211 for ; Wed, 20 Apr 2016 16:41:56 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 631B420263 for ; Wed, 20 Apr 2016 16:41:54 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751899AbcDTQlu (ORCPT ); Wed, 20 Apr 2016 12:41:50 -0400 Received: from mail-pf0-f176.google.com ([209.85.192.176]:36738 "EHLO mail-pf0-f176.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750804AbcDTQlt (ORCPT ); Wed, 20 Apr 2016 12:41:49 -0400 Received: by mail-pf0-f176.google.com with SMTP id e128so19849113pfe.3 for ; Wed, 20 Apr 2016 09:41:49 -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=gbtapCSpUBbmn8ek7wrKhd58DaIbzgm8NluYOZNPYSU=; b=tK33ddy5icXLZPUNOKX/zAoOLAs8p1WHSqEj7mcWiJZ18MfFWLGkA78uRhhBD9P856 LRyrozQrKjIg7BKeJwfQeiShUcXJgT3qYK3qDpWZMQDaNr6ZR7m0wCu7dZNdotMqpwzz slNlRkKuFU77smmTXs61/yrfT6rVYCkGc6EwxWH3KB26Z6v3Y6Tk3aIGtbzOIyOGv5B4 IZ76VKj8VsRq9ZN1q1WIM4/J2fhPITvHWJdjdZ6xYF0/5+P+qf4qR1A/rDw8jZlc6bAH i4jw1oBE8YvJiIUVm3H7GSO597sCb9nFoMbHOjOZ1T/pcfEuwaIFnhoxdvP362gZY3Ts OaqA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=gbtapCSpUBbmn8ek7wrKhd58DaIbzgm8NluYOZNPYSU=; b=jJLx61gjJxx5HQBvKUnylTkdYhWpujuI5RrcV2ZeciilC8okYeaMDljYhPjOetOWhU 9jqbOcC+KIvpSLYe1IPGt6Fcg/5F43XpaW+ae0ZyGtHpSrtM01lpOX0fSWIercm1FuwI pT2dLZSGHEAwaApTMzZxg24Lo21TiDNi4WiBBlk8f3trovbB54FMg5pPbsJ5QDnjP+8J /HDp3a4yKDB4yOeBEzzHLFIGd9RQnCbEzs053UCAIpZA5ruLrEwWXt1LZYYD7jORNuj/ /Hr+98/VLHJcQXKUK6eBYrX9WN1rpLuoHkmwDy3XV0MS+6kwnrNxScW2QDJfPUYLyNZi zpIQ== X-Gm-Message-State: AOPr4FWsSIsU2HuEEbZ361CeLZJPP3+PVnwQ8qF3S88ngtW26FjQiC+d9AMBEzeDThxVRA== X-Received: by 10.98.102.195 with SMTP id s64mr13761698pfj.89.1461170508835; Wed, 20 Apr 2016 09:41:48 -0700 (PDT) Received: from nga.lan (ria-193-88.tm.net.my. [219.92.193.88]) by smtp.gmail.com with ESMTPSA id w1sm41569120paa.6.2016.04.20.09.41.45 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 20 Apr 2016 09:41:46 -0700 (PDT) From: Chun-Yeow Yeoh To: linux-wireless@vger.kernel.org Cc: sgruszka@redhat.com, helmut.schaa@googlemail.com, kvalo@qca.qualcomm.com, Chun-Yeow Yeoh Subject: [PATCH v2] rt2800lib: enable MFP if hw crypt is disabled Date: Thu, 21 Apr 2016 00:41:34 +0800 Message-Id: <1461170494-576-1-git-send-email-yeohchunyeow@gmail.com> X-Mailer: git-send-email 2.3.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=-7.8 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 If rt2800usb is loaded with nohwcrypt=1, mac80211 takes care of the crypto with software encryption/decryption and thus, MFP can be used. Tested for secured mesh using ath9k_htc and ath9k. Signed-off-by: Chun-Yeow Yeoh v2: set MFP correctly (Stanislaw Gruszka) Acked-by: Stanislaw Gruszka --- drivers/net/wireless/ralink/rt2x00/rt2800lib.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/drivers/net/wireless/ralink/rt2x00/rt2800lib.c b/drivers/net/wireless/ralink/rt2x00/rt2800lib.c index 7fa0128..716468a 100644 --- a/drivers/net/wireless/ralink/rt2x00/rt2800lib.c +++ b/drivers/net/wireless/ralink/rt2x00/rt2800lib.c @@ -7492,6 +7492,10 @@ static int rt2800_probe_hw_mode(struct rt2x00_dev *rt2x00dev) if (!rt2x00_is_usb(rt2x00dev)) ieee80211_hw_set(rt2x00dev->hw, HOST_BROADCAST_PS_BUFFERING); + /* Set MFP if HW crypto is disabled. */ + if (rt2800_hwcrypt_disabled(rt2x00dev)) + ieee80211_hw_set(rt2x00dev->hw, MFP_CAPABLE); + SET_IEEE80211_DEV(rt2x00dev->hw, rt2x00dev->dev); SET_IEEE80211_PERM_ADDR(rt2x00dev->hw, rt2800_eeprom_addr(rt2x00dev,