From patchwork Fri Nov 14 05:07:11 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: 5303111 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.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id EC50EC11AC for ; Fri, 14 Nov 2014 05:07:31 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 1E0AC20149 for ; Fri, 14 Nov 2014 05:07:31 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id A49C520148 for ; Fri, 14 Nov 2014 05:07:29 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751148AbaKNFH1 (ORCPT ); Fri, 14 Nov 2014 00:07:27 -0500 Received: from mail-pd0-f172.google.com ([209.85.192.172]:40128 "EHLO mail-pd0-f172.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750800AbaKNFH1 (ORCPT ); Fri, 14 Nov 2014 00:07:27 -0500 Received: by mail-pd0-f172.google.com with SMTP id r10so16066237pdi.3 for ; Thu, 13 Nov 2014 21:07: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; bh=rmBOJ/oPtCx9GiCa80+fthGACL2miwKt0W+/9ie8e8k=; b=sRiTWLqqPTGqcz5gjgbEuNUB1/NZN367MHH2SZjtCVJSjzXRTroDX8RrJOnp/ZljWl kx/4oLaRraG983dpJtyt0aOqCOLVV/M6qh0p+SwJ9D35NtCTZQJKh3rM2E554rvkUMpg 5q3nE10DXvn9K5/pFfUElR61fMu4+A08pK2cQRPXQtG+9abKmbxxWtBhedxZmyWCmSNN eFZpgnbTngBFNMnfi+kG2JY5YDDubYkW9ulUdfAXLY38kls9lVVA32QVpTKDr0dTVJ4W F806DtvViw3pwnQXXSQil4L95nOFeoN4qKCgsZB9tPBrIrWeYDnfirm0U+grBgcw3hlk jZXA== X-Received: by 10.66.235.225 with SMTP id up1mr7469750pac.137.1415941646495; Thu, 13 Nov 2014 21:07:26 -0800 (PST) Received: from localhost.localdomain ([58.26.233.145]) by mx.google.com with ESMTPSA id c4sm26293459pdh.53.2014.11.13.21.07.24 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 13 Nov 2014 21:07:25 -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] ath9k_htc: turn on software mgmt crypto for secured mesh Date: Fri, 14 Nov 2014 13:07:11 +0800 Message-Id: <1415941631-24140-1-git-send-email-yeohchunyeow@gmail.com> X-Mailer: git-send-email 2.1.1 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 Secured mesh encrypts the unicast mgmt frame using the same key that used for encrypting the unicast data frame. The 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 management frames to be done in software. Fix this. 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/htc_drv_main.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/net/wireless/ath/ath9k/htc_drv_main.c b/drivers/net/wireless/ath/ath9k/htc_drv_main.c index 689ac99..d3f65a2 100644 --- a/drivers/net/wireless/ath/ath9k/htc_drv_main.c +++ b/drivers/net/wireless/ath/ath9k/htc_drv_main.c @@ -1447,7 +1447,8 @@ static int ath9k_htc_set_key(struct ieee80211_hw *hw, key->flags |= IEEE80211_KEY_FLAG_GENERATE_IV; if (key->cipher == WLAN_CIPHER_SUITE_TKIP) key->flags |= IEEE80211_KEY_FLAG_GENERATE_MMIC; - if (priv->ah->sw_mgmt_crypto && + if ((vif->type == NL80211_IFTYPE_MESH_POINT || + priv->ah->sw_mgmt_crypto) && key->cipher == WLAN_CIPHER_SUITE_CCMP) key->flags |= IEEE80211_KEY_FLAG_SW_MGMT_TX; ret = 0;