From patchwork Sat Nov 15 19:05:41 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: 5312101 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 1F0139FD71 for ; Sat, 15 Nov 2014 19:06:45 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 5828920176 for ; Sat, 15 Nov 2014 19:06:44 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 7629C2011B for ; Sat, 15 Nov 2014 19:06:43 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754468AbaKOTGj (ORCPT ); Sat, 15 Nov 2014 14:06:39 -0500 Received: from mail-pd0-f169.google.com ([209.85.192.169]:46210 "EHLO mail-pd0-f169.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754395AbaKOTGi (ORCPT ); Sat, 15 Nov 2014 14:06:38 -0500 Received: by mail-pd0-f169.google.com with SMTP id fp1so1374763pdb.0 for ; Sat, 15 Nov 2014 11:06:37 -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; bh=xus9t6kmoBVn9FEvfA84JGCfxor9cOm3Pyjti/REIEY=; b=ciQD098xFDwfIFpX+q+Fe9lrJFTpp2+lUgAEEFKJ3OLuHyL4jr5ma9OerE5ErerqL5 j+Ma04uahxz6ZAfmY17X2/Qnwo8r9fCe5/oE1HW8292RLXvKRo1JxThVk/jjtWacxFVY 85Vkl+S6SKPOTs0Xrx6dgtw6t0xYvKPM4zfhgAhzD4HmXIOGGsLk64Bgr9ZCm7fE8Tk5 nIuKcQmfHEYgMCnxyxUzXhn3QWLeYVwtbfhWtVpgAI5zj1NkCaJ5jVxAlRv2ZRWKVIaR rn8PLvwdcRhFJ2AGuRdhRWb6irYTMHa23PO7Kw55KXhN0kjyHX5IwJVerBrnbr8FMyHu B1qw== X-Received: by 10.70.60.198 with SMTP id j6mr18765416pdr.94.1416078397894; Sat, 15 Nov 2014 11:06:37 -0800 (PST) Received: from nga.lan ([175.142.194.173]) by mx.google.com with ESMTPSA id p12sm7663656pdn.47.2014.11.15.11.06.36 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Sat, 15 Nov 2014 11:06:37 -0800 (PST) From: Chun-Yeow Yeoh To: linville@tuxdriver.com Cc: linux-wireless@vger.kernel.org, ath9k-devel@lists.ath9k.org, Chun-Yeow Yeoh Subject: [PATCH 2/2] ath9k_htc: Enable software crypto for mgmt frame in Tx for USB devices Date: Sun, 16 Nov 2014 03:05:41 +0800 Message-Id: <1416078341-4411-3-git-send-email-yeohchunyeow@gmail.com> X-Mailer: git-send-email 2.1.1 In-Reply-To: <1416078341-4411-1-git-send-email-yeohchunyeow@gmail.com> References: <1416078341-4411-1-git-send-email-yeohchunyeow@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=-6.8 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, T_DKIM_INVALID, T_RP_MATCHES_RCVD, 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 In secured mesh, the unicast mgmt frame is encrypted using the same key that used for encrypting the unicast data frame. This patch "ath9k_htc_firmware: fix the offset of CCMP header for mesh data frame" applied to open-ath9k-htc-firmware allows the ath9k_htc to be loaded without "nohwcrypt=1". Unfortunately, this is not working and we still need CCMP encryption of transmitted management frames to be done in software. So this patch allows the software encryption for transmitted management frame to be done in software but remain the hardware decryption for received management frame. This patch is tested with the following hardwares: - TP-Link TL-WN821N v3 802.11n [Atheros AR7010+AR9287] - AR9271 802.11n and managed to work with peer mesh STA equipped with ath9k. Signed-off-by: Chun-Yeow Yeoh --- drivers/net/wireless/ath/ath9k/hw.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/drivers/net/wireless/ath/ath9k/hw.c b/drivers/net/wireless/ath/ath9k/hw.c index a53d304..99d5dcf4 100644 --- a/drivers/net/wireless/ath/ath9k/hw.c +++ b/drivers/net/wireless/ath/ath9k/hw.c @@ -1585,7 +1585,10 @@ static void ath9k_hw_init_mfp(struct ath_hw *ah) * frames when constructing CCMP AAD. */ REG_RMW_FIELD(ah, AR_AES_MUTE_MASK1, AR_AES_MUTE_MASK1_FC_MGMT, 0xc7ff); - ah->sw_mgmt_crypto_tx = false; + if (AR_SREV_9271(ah) || AR_DEVID_7010(ah)) + ah->sw_mgmt_crypto_tx = true; + else + ah->sw_mgmt_crypto_tx = false; ah->sw_mgmt_crypto_rx = false; } else if (AR_SREV_9160_10_OR_LATER(ah)) { /* Disable hardware crypto for management frames */