From patchwork Thu Jun 18 08:06:20 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Janusz.Dziedzic@tieto.com X-Patchwork-Id: 6634051 X-Patchwork-Delegate: kvalo@adurom.com 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.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id B065E9F326 for ; Thu, 18 Jun 2015 08:06:38 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id C9E44206AD for ; Thu, 18 Jun 2015 08:06:37 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 192DB2065E for ; Thu, 18 Jun 2015 08:06:36 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753132AbbFRIGd (ORCPT ); Thu, 18 Jun 2015 04:06:33 -0400 Received: from mail-wi0-f169.google.com ([209.85.212.169]:34764 "EHLO mail-wi0-f169.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753369AbbFRIGW (ORCPT ); Thu, 18 Jun 2015 04:06:22 -0400 Received: by wicnd19 with SMTP id nd19so14486419wic.1 for ; Thu, 18 Jun 2015 01:06:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=tieto.com; s=google; h=mime-version:date:message-id:subject:from:to:cc:content-type; bh=4+NqAyXnJsdW21e9fz8LzFYOIATv256X1xixBJTABjw=; b=WprJAs8CQJPvj2cte78f0pDhscT5su+3xazk7qK/nQcoOH9CpM3ul4nLxX0rXCzIMD //+qjWmBDkEDzIAU9rU0UakSCiKUIjHpiSlfzId2t74QLHn/IiPyS8WZZx5osb0nOm19 CpPUEWzHOYrPybwKp1JiA7ur9u3F2V9x9xH1c= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:date:message-id:subject:from:to:cc :content-type; bh=4+NqAyXnJsdW21e9fz8LzFYOIATv256X1xixBJTABjw=; b=D1ASpXQna5aLZods9ZSIaXNMPAHeduemBEjqclqBbBUMgwaTwcI+uPsVEBZSi9GK6t pWuejHZrUXcMNMwaXd99081qJsjbTLHU+D762jBhlKt7i/1+poPx1Tdv1GbIZSr0yiS+ ULctIDHs98zxB2ewPfD6yoYruiq7GkM1qGi+o+Wpy4r4foscNR0/6W5GyavhyL5D8CqS 3C5EM2pFcrJrfFUG09GnQh4zhHVZDb/DZNCqlrsIfA9S+mtwB4fS6kDw/7wSHEbMGm/s OOZZW3ciVBJc5OcLfR3wLSD9FFIAvO8uC9cDTumYbsnb5JelJMEg+CSCTflUq+kIeszr 7fpQ== X-Gm-Message-State: ALoCoQkK77gesh4ou2gRWHkECTMMT+ovSorC1ToRFteS0vWI/DAozyHwWnmjXEM+DFwGENaxZWzu3oFlWwfzO9ZqU9HgkHsp0HlUmH1ALrcH+TaHICE84ZoEgK6f0Dww2FuwB8xs1V7n MIME-Version: 1.0 X-Received: by 10.194.61.212 with SMTP id s20mr13137267wjr.18.1434614780865; Thu, 18 Jun 2015 01:06:20 -0700 (PDT) Received: by 10.27.171.143 with HTTP; Thu, 18 Jun 2015 01:06:20 -0700 (PDT) Date: Thu, 18 Jun 2015 10:06:20 +0200 Message-ID: Subject: ath9k: multicast don't work when: two STA (sta + p2p_client) + hwcrypt From: Janusz Dziedzic To: linux-wireless@vger.kernel.org Cc: Felix Fietkau , Sujith Manoharan X-DomainID: tieto.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.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, 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 STA iface: ath: phy0: Set HW Key 0 (pairwise) vif: 2c:d0:5a:d3:f1:e9 sta: f4:b7:e2:38:83:f3 - idx: 4 ath: phy0: Set HW Key 0 (group) vif: 2c:d0:5a:d3:f1:e9 sta: (null) - idx: 1 P2P_CLIENT iface: ath: phy0: Set HW Key 0 (pairwise) vif: 2e:d0:5a:d3:f1:e9 sta: 0c:8b:fd:1e:58:9f - idx: 68 ath: phy0: Set HW Key 0 (group) vif: 2e:d0:5a:d3:f1:e9 sta: (null) - idx: 1 Seems we overwrite multicast hw key - both idx = 1 1) First patch I made: gmac[0] |= 0x01; Multicast works fine for STA/P2P_CLIENT but multicast rekeying don't work correctly, while we have 2 multicast keys installed for the same bssid (eg. idx 6, 68) after rekey. Seem hw choose always key with lowest idx - hw decrypt mcast packects correctly every second rekey :-) BTW, this needs attention to be sure hw decrypt frames correctly - I am checking RX_FLAG_DECRYPTED flag, while often HW send crypted packets and mac80211 decrypt them correctly (every second rekey for example). So, some mixture of hwcrypt and swcrypt is seen :) 2) works perfectly when ath9k loaded with nohwcrypt=1 Any ideas how to solve this correctly (is it possible with hwcrypt at all)? BR Janusz --- To unsubscribe from this list: send the line "unsubscribe linux-wireless" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/drivers/net/wireless/ath/key.c b/drivers/net/wireless/ath/key.c index 1816b4e..b15873b 100644 --- a/drivers/net/wireless/ath/key.c +++ b/drivers/net/wireless/ath/key.c @@ -507,6 +507,15 @@ int ath_key_config(struct ath_common *common, if (!(key->flags & IEEE80211_KEY_FLAG_PAIRWISE)) { switch (vif->type) { + case NL80211_IFTYPE_STATION: + idx = key->keyidx; + if (vif->bss_conf.bssid) { + ether_addr_copy(gmac, bssid); + gmac[0] |= 0x01; + mac = gmac; + idx = ath_reserve_key_cache_slot(common, key->cipher); + } + break; case NL80211_IFTYPE_AP: memcpy(gmac, vif->addr, ETH_ALEN);