From patchwork Mon Feb 15 09:06:12 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eliad Peller X-Patchwork-Id: 8311901 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 DE403C02AA for ; Mon, 15 Feb 2016 09:06:24 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 0797C204AD for ; Mon, 15 Feb 2016 09:06:24 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id E01A620462 for ; Mon, 15 Feb 2016 09:06:21 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752627AbcBOJGS (ORCPT ); Mon, 15 Feb 2016 04:06:18 -0500 Received: from mail-ig0-f193.google.com ([209.85.213.193]:32982 "EHLO mail-ig0-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752424AbcBOJGM (ORCPT ); Mon, 15 Feb 2016 04:06:12 -0500 Received: by mail-ig0-f193.google.com with SMTP id hb3so5927408igb.0 for ; Mon, 15 Feb 2016 01:06:12 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date:message-id:subject :from:to:cc:content-type; bh=/B8Fr9NMTdpFiQOXQ+y0u4452VesJTBA61n9bMoldfQ=; b=O2G/n8rR0+O/K7RVvppxGwtUL67SJ5s49Fk88YBLsf3OZMaU5bDtPoqsPNX7uLKBUs StcT48t6lxJiIZR38JIIarhGCzgpj8F2mx4KG814r2lcKbUNePTz7mV4SQxQ8gJfRDNJ QIaiZZ0YSPDWiLj0LDd5AaaHksYxSPbrPgg3IBFmKhmyKdYotSVqnxUNDfaS4whwzera T2THqtNC1tEHO5uOAousn/pRmoseyB11+1Yd3xZlLphcoJibodlJOKUILyuYWq4khoFH YRGbPVcvY0tF9hbbbm3USzA5ZjQ3AFx1hIJAhxm0Q73gIZ+pL/ne2wGmBU9UmBFhuaZ+ HQgQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=wizery-com.20150623.gappssmtp.com; s=20150623; h=mime-version:sender:in-reply-to:references:date:message-id:subject :from:to:cc:content-type; bh=/B8Fr9NMTdpFiQOXQ+y0u4452VesJTBA61n9bMoldfQ=; b=NMHUcMeebEfqOum1hkaKqkexuG9pPksBXjn69ieL4zniNfdNhTocDK2gzpL5usXI1H gP5wVCy099twjMAcvS3S+Zgyo3YSQ6HUba1Xghr58spLvlGvw4EK4aPaG2XCorQ+ItzR WvVwOJbij8o6u1gf3EbnIFqCakGCBQasbdL8tsc/kww8SwY5piR0B6SeDaB7nBBztdPF Kbf6BIHtklcv+j9Ww56Mw5rfRJbbgnLTf6o1+VZPJM3uXYVnnr0SVD7UrF8EelluKkVa VEeB94qf4oA8ypQ4Qk1kw5UP7ASGwuUWdDNk1NP5FjROaEtLQRUeZmZm9vf+Hb6CYhPj 9/5w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:sender:in-reply-to:references:date :message-id:subject:from:to:cc:content-type; bh=/B8Fr9NMTdpFiQOXQ+y0u4452VesJTBA61n9bMoldfQ=; b=Kzrs4aGVyQCHwse/Dht5UL6pVOqqP/RgpNKwgqe9DDMs7Bh6/hWk6Dmhnk2+eCA3rS qGEMKfEDeQJWID0gjomaqmVz3KvSTtrQJ+I69C2Neam2IrmQSemc/yN2ezh7+4y+t5lu RkuwtN3MQEZSaBQo87HV/chR65/6ThkIR5w8KfF9cSH/4d9OZfy6eqh2PBh/S9phj4fW 0FyY7PrvxwYg68Wq02FqNBWrCcYfaFoDYXQ6Gbvu47bS25MTTo4Rn70TMeu7A/sKSBr/ rUeuVTpWI4XhKYcSzmFOgMG2UNiog2wSBhZ4CeLzcF1FndLsKd4Vsa+H+SOAPDGYetyN Bm5g== X-Gm-Message-State: AG10YOTDTEAEuOeWA6m8E6/PEIshk+p+XRpVB9khsHAJ8jDBVr0H97V68GfN9zTcZm9/8Tpi2f9bsnYXY0ONlQ== MIME-Version: 1.0 X-Received: by 10.50.143.102 with SMTP id sd6mr7557125igb.3.1455527172196; Mon, 15 Feb 2016 01:06:12 -0800 (PST) Received: by 10.50.138.162 with HTTP; Mon, 15 Feb 2016 01:06:12 -0800 (PST) In-Reply-To: <0BA3FCBA62E2DC44AF3030971E174FB32EA122F3@hasmsx107.ger.corp.intel.com> References: <1455450997-15409-1-git-send-email-emmanuel.grumbach@intel.com> <1455450997-15409-2-git-send-email-emmanuel.grumbach@intel.com> <1455477875.2564.0.camel@sipsolutions.net> <0BA3FCBA62E2DC44AF3030971E174FB32EA122F3@hasmsx107.ger.corp.intel.com> Date: Mon, 15 Feb 2016 11:06:12 +0200 X-Google-Sender-Auth: n8fYRC5qqXxMBMyFn_uJMcFjZd8 Message-ID: Subject: Re: [PATCH 2/3] iwlwifi: mvm: move TX PN assignment for TKIP to the driver From: Eliad Peller To: "Grumbach, Emmanuel" Cc: Johannes Berg , Emmanuel Grumbach , linux-wireless , "Peller, EliadX" 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_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 On Sun, Feb 14, 2016 at 9:37 PM, Grumbach, Emmanuel wrote: > > > On 02/14/2016 09:33 PM, Johannes Berg wrote: >> On Sun, 2016-02-14 at 19:34 +0200, Emmanuel Grumbach wrote: >>> >>> Since the 3rd patch needs to be dropped anyway, let's route this one >>> through my tree as usual. >> It doesn't really have to be dropped, why? We can just make the same >> adjustment as for dvm in the patch. >> > > But I am not sure I really want to play with drivers/staging/vt6656/rxtx.c here you go: /* strip header and icv len from payload */ @@ -752,9 +752,13 @@ static void vnt_fill_txkey(struct vnt_usb_send_context *tx_context, mic_hdr->payload_len = cpu_to_be16(payload_len); ether_addr_copy(mic_hdr->mic_addr2, hdr->addr2); - ieee80211_get_key_tx_seq(tx_key, &seq); - - memcpy(mic_hdr->ccmp_pn, seq.ccmp.pn, IEEE80211_CCMP_PN_LEN); + pn64 = atomic64_read(&tx_key->tx_pn); + mic_hdr->ccmp_pn[5] = pn64; + mic_hdr->ccmp_pn[4] = pn64 >> 8; + mic_hdr->ccmp_pn[3] = pn64 >> 16; + mic_hdr->ccmp_pn[2] = pn64 >> 24; + mic_hdr->ccmp_pn[1] = pn64 >> 32; + mic_hdr->ccmp_pn[0] = pn64 >> 40; if (ieee80211_has_a4(hdr->frame_control)) mic_hdr->hlen = cpu_to_be16(28); Eliad. --- 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/staging/vt6655/rxtx.c b/drivers/staging/vt6655/rxtx.c index b668db6..1a2dda0 100644 --- a/drivers/staging/vt6655/rxtx.c +++ b/drivers/staging/vt6655/rxtx.c @@ -1210,7 +1210,7 @@ static void vnt_fill_txkey(struct ieee80211_hdr *hdr, u8 *key_buffer, struct sk_buff *skb, u16 payload_len, struct vnt_mic_hdr *mic_hdr) { - struct ieee80211_key_seq seq; + u64 pn64; u8 *iv = ((u8 *)hdr + ieee80211_get_hdrlen_from_skb(skb)); /* strip header and icv len from payload */ @@ -1243,9 +1243,13 @@ static void vnt_fill_txkey(struct ieee80211_hdr *hdr, u8 *key_buffer, mic_hdr->payload_len = cpu_to_be16(payload_len); ether_addr_copy(mic_hdr->mic_addr2, hdr->addr2); - ieee80211_get_key_tx_seq(tx_key, &seq); - - memcpy(mic_hdr->ccmp_pn, seq.ccmp.pn, IEEE80211_CCMP_PN_LEN); + pn64 = atomic64_read(&tx_key->tx_pn); + mic_hdr->ccmp_pn[5] = pn64; + mic_hdr->ccmp_pn[4] = pn64 >> 8; + mic_hdr->ccmp_pn[3] = pn64 >> 16; + mic_hdr->ccmp_pn[2] = pn64 >> 24; + mic_hdr->ccmp_pn[1] = pn64 >> 32; + mic_hdr->ccmp_pn[0] = pn64 >> 40; if (ieee80211_has_a4(hdr->frame_control)) mic_hdr->hlen = cpu_to_be16(28); diff --git a/drivers/staging/vt6656/rxtx.c b/drivers/staging/vt6656/rxtx.c index efb54f5..76378d2 100644 --- a/drivers/staging/vt6656/rxtx.c +++ b/drivers/staging/vt6656/rxtx.c @@ -719,7 +719,7 @@ static void vnt_fill_txkey(struct vnt_usb_send_context *tx_context, u16 payload_len, struct vnt_mic_hdr *mic_hdr) { struct ieee80211_hdr *hdr = tx_context->hdr; - struct ieee80211_key_seq seq; + u64 pn64; u8 *iv = ((u8 *)hdr + ieee80211_get_hdrlen_from_skb(skb));