From: "Grumbach, Emmanuel" <emmanuel.grumbach@intel.com>
To: Eliad Peller <eliad@wizery.com>
Cc: Johannes Berg <johannes@sipsolutions.net>,
Emmanuel Grumbach <egrumbach@gmail.com>,
linux-wireless <linux-wireless@vger.kernel.org>,
"Peller, EliadX" <eliadx.peller@intel.com>
Subject: Re: [PATCH 2/3] iwlwifi: mvm: move TX PN assignment for TKIP to the driver
Date: Mon, 15 Feb 2016 09:16:48 +0000 [thread overview]
Message-ID: <0BA3FCBA62E2DC44AF3030971E174FB32EA1331F@hasmsx107.ger.corp.intel.com> (raw)
In-Reply-To: CAB3XZEdXC1jG5FXOPu-seT2pVzKa6Sg15s_YTeMnULi7vBgL5A@mail.gmail.com
On 02/15/2016 11:06 AM, Eliad Peller wrote:
> On Sun, Feb 14, 2016 at 9:37 PM, Grumbach, Emmanuel
> <emmanuel.grumbach@intel.com> 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:
>
> 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));
>
> /* 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.
>
Want to send that patch to Greg? :)
next prev parent reply other threads:[~2016-02-15 9:16 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-02-14 11:56 [PATCH 1/3] mac80211: move TKIP TX IVs to public part of key struct Emmanuel Grumbach
2016-02-14 11:56 ` [PATCH 2/3] iwlwifi: mvm: move TX PN assignment for TKIP to the driver Emmanuel Grumbach
2016-02-14 17:34 ` Emmanuel Grumbach
2016-02-14 19:24 ` Johannes Berg
2016-02-14 19:37 ` Grumbach, Emmanuel
2016-02-15 9:06 ` Eliad Peller
2016-02-15 9:16 ` Grumbach, Emmanuel [this message]
2016-02-15 9:19 ` Eliad Peller
2016-02-15 9:24 ` Grumbach, Emmanuel
2016-02-15 10:14 ` Johannes Berg
2016-02-14 11:56 ` [PATCH 3/3] mac80211: remove ieee80211_get_key_tx_seq/ieee80211_set_key_tx_seq Emmanuel Grumbach
2016-02-14 13:03 ` kbuild test robot
2016-02-14 14:00 ` kbuild test robot
2016-02-23 10:07 ` [PATCH 1/3] mac80211: move TKIP TX IVs to public part of key struct Johannes Berg
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=0BA3FCBA62E2DC44AF3030971E174FB32EA1331F@hasmsx107.ger.corp.intel.com \
--to=emmanuel.grumbach@intel.com \
--cc=egrumbach@gmail.com \
--cc=eliad@wizery.com \
--cc=eliadx.peller@intel.com \
--cc=johannes@sipsolutions.net \
--cc=linux-wireless@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).