From patchwork Mon Mar 30 16:37:54 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Joe Perches X-Patchwork-Id: 6122641 X-Patchwork-Delegate: johannes@sipsolutions.net 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 7163A9F2EC for ; Mon, 30 Mar 2015 16:38:23 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 9234220364 for ; Mon, 30 Mar 2015 16:38:22 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id AA460202FE for ; Mon, 30 Mar 2015 16:38:21 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752858AbbC3QiA (ORCPT ); Mon, 30 Mar 2015 12:38:00 -0400 Received: from smtprelay0118.hostedemail.com ([216.40.44.118]:38776 "EHLO smtprelay.hostedemail.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1752587AbbC3Qh6 (ORCPT ); Mon, 30 Mar 2015 12:37:58 -0400 Received: from filter.hostedemail.com (unknown [216.40.38.60]) by smtprelay04.hostedemail.com (Postfix) with ESMTP id 2F201351F04; Mon, 30 Mar 2015 16:37:57 +0000 (UTC) X-Session-Marker: 6A6F6540706572636865732E636F6D X-Spam-Summary: 2, 0, 0, , d41d8cd98f00b204, joe@perches.com, :::::::::, RULES_HIT:41:355:379:541:800:960:973:988:989:1260:1277:1311:1313:1314:1345:1373:1437:1515:1516:1518:1534:1542:1593:1594:1711:1730:1747:1777:1792:2194:2198:2199:2200:2393:2559:2562:2828:2915:3138:3139:3140:3141:3142:3353:3865:3866:3867:3868:3870:3874:4225:4250:4605:5007:6117:6261:8603:9592:10004:10400:10848:11026:11473:11658:11914:12043:12438:12517:12519:12555:12679:14394:21080, 0, RBL:none, CacheIP:none, Bayesian:0.5, 0.5, 0.5, Netcheck:none, DomainCache:0, MSF:not bulk, SPF:fn, MSBL:0, DNSBL:none, Custom_rules:0:0:0 X-HE-Tag: end51_453b9babef514 X-Filterd-Recvd-Size: 2802 Received: from joe-X200MA.home (pool-71-119-66-80.lsanca.fios.verizon.net [71.119.66.80]) (Authenticated sender: joe@perches.com) by omf01.hostedemail.com (Postfix) with ESMTPA; Mon, 30 Mar 2015 16:37:55 +0000 (UTC) Message-ID: <1427733474.14276.11.camel@perches.com> Subject: [PATCH -next] mac80211: Use #define IEEE80211_CCMP_PN_LEN and bool From: Joe Perches To: Johannes Berg Cc: "David S. Miller" , linux-wireless@vger.kernel.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org Date: Mon, 30 Mar 2015 09:37:54 -0700 X-Mailer: Evolution 3.12.10-0ubuntu1~14.10.1 Mime-Version: 1.0 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.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable 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 Use a #define constant instead of a hardcoded value and use bool for an int used as a bool to reduce structure size. Miscellanea: Neaten comments in structure definition. Add #include of ieee80211.h Signed-off-by: Joe Perches --- net/mac80211/ieee80211_i.h | 7 ++++--- net/mac80211/rx.c | 4 ++-- 2 files changed, 6 insertions(+), 5 deletions(-) -- 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/net/mac80211/ieee80211_i.h b/net/mac80211/ieee80211_i.h index 8d53d65..08f994d 100644 --- a/net/mac80211/ieee80211_i.h +++ b/net/mac80211/ieee80211_i.h @@ -26,6 +26,7 @@ #include #include #include +#include #include #include #include @@ -89,11 +90,11 @@ struct ieee80211_fragment_entry { unsigned int last_frag; unsigned int extra_len; struct sk_buff_head skb_list; - int ccmp; /* Whether fragments were encrypted with CCMP */ - u8 last_pn[6]; /* PN of the last fragment if CCMP was used */ + /* for CCMP fragments */ + bool ccmp; /* encrypted with CCMP */ + u8 last_pn[IEEE80211_CCMP_PN_LEN]; /* PN of the last fragment */ }; - struct ieee80211_bss { u32 device_ts_beacon, device_ts_presp; diff --git a/net/mac80211/rx.c b/net/mac80211/rx.c index 944bdc0..367ed9c 100644 --- a/net/mac80211/rx.c +++ b/net/mac80211/rx.c @@ -1711,7 +1711,7 @@ ieee80211_reassemble_add(struct ieee80211_sub_if_data *sdata, entry->seq = seq; entry->rx_queue = rx_queue; entry->last_frag = frag; - entry->ccmp = 0; + entry->ccmp = false; entry->extra_len = 0; return entry; @@ -1812,7 +1812,7 @@ ieee80211_rx_h_defragment(struct ieee80211_rx_data *rx) int queue = rx->security_idx; /* Store CCMP PN so that we can verify that the next * fragment has a sequential PN value. */ - entry->ccmp = 1; + entry->ccmp = true; memcpy(entry->last_pn, rx->key->u.ccmp.rx_pn[queue], IEEE80211_CCMP_PN_LEN);