From patchwork Thu Aug 20 15:58:52 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?b?SsOpcsO0bWUgUG91aWxsZXI=?= X-Patchwork-Id: 259556 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-11.4 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, MSGID_FROM_MTA_HEADER, RCVD_ILLEGAL_IP, SIGNED_OFF_BY, SPF_HELO_NONE, SPF_PASS, URIBL_BLOCKED, USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 63509C433DF for ; Thu, 20 Aug 2020 16:03:23 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 2B6E2208A9 for ; Thu, 20 Aug 2020 16:03:23 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=silabs.onmicrosoft.com header.i=@silabs.onmicrosoft.com header.b="ctIY+Mbc" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729552AbgHTQDI (ORCPT ); Thu, 20 Aug 2020 12:03:08 -0400 Received: from mail-bn7nam10on2087.outbound.protection.outlook.com ([40.107.92.87]:47585 "EHLO NAM10-BN7-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1729490AbgHTP7x (ORCPT ); Thu, 20 Aug 2020 11:59:53 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=aoc9pRgP0NEJM5qymmy5T5cvr+U4pNmZsLA8xPsAAgul794M0KSeMn719ARQFmVUwQQXFdSwQzQxwFZK3UIJyj5Cg3N5cywVqNHkuDsoTyQig0GNkCPyGL7i69zXbr1Gw5TbaW5f2W8SFoHhHn6+pRxQPdP+I7cMELMi7cM3OUqBPKRRfhRIjF2AMLTip5S2E6xh/WmYOS9a5NhyhiTekfWGSdR1FuB3MhULQQ044utMDvCru0uwcbbskIxLZLkLq0bK1onz18zZZnh+eCtMpPARviiGBJYxykyuTIdkYvPBnACZpTxo/1cIo2AXEaCIlH1UZcvmqQ9l5M0HjQ8CFg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=wQXvApKjr0cY61ggIb8gLuomgp6b/xpqnIfJVhA+1WE=; b=T70bEuyduMel4f8jVZ30v7NEpDYbQjxv8mwMUhJ+qZpYCbuJ0V0AESFptXHHplAwZzp70q/k4acn6nDxeQGGCMxNwrQrVe/U5ly8YhyNpnK4RbapJHhnMIobWTdRnCzwSx2GPmSg9fZ6bKVc8AGt7aDqmkCwQvnTH6yNchkn9EIgWxsg8bAul4ofBv7mIe6TXDt34a1zU6Fk7irPTSHj/X+5oaGRj42dpLmVZzP6A86FHIfQC78YxwYplnKKo9AQ6GPpcAhwpRW24Eo7PZMxJC4xC0LRS8rnOpaVxwhcg89tKCAlEveUluO/RPWTweBre7PFv7Zn0oubnvLbMCBEdw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=silabs.com; dmarc=pass action=none header.from=silabs.com; dkim=pass header.d=silabs.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=silabs.onmicrosoft.com; s=selector2-silabs-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=wQXvApKjr0cY61ggIb8gLuomgp6b/xpqnIfJVhA+1WE=; b=ctIY+MbcqMnUp7vJDTjzU/+76oqw8yS7tQ9GE9BBq4bNr8IEWNGUHoB33l7LjEDozQtHDVLGiZHueP+lLtJq6geo8xWQdYDmvXcj8v0tu/9n2Fq9QInERxbBpUgoG01K1CIIS/ub2ihakyZnM7zmzXRZZ1Fi50kobyDk1E92ims= Authentication-Results: driverdev.osuosl.org; dkim=none (message not signed) header.d=none; driverdev.osuosl.org; dmarc=none action=none header.from=silabs.com; Received: from SN6PR11MB2718.namprd11.prod.outlook.com (2603:10b6:805:63::18) by SA0PR11MB4541.namprd11.prod.outlook.com (2603:10b6:806:94::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3305.25; Thu, 20 Aug 2020 15:59:32 +0000 Received: from SN6PR11MB2718.namprd11.prod.outlook.com ([fe80::85c9:1aa9:aeab:3fa6]) by SN6PR11MB2718.namprd11.prod.outlook.com ([fe80::85c9:1aa9:aeab:3fa6%4]) with mapi id 15.20.3305.026; Thu, 20 Aug 2020 15:59:32 +0000 From: Jerome Pouiller To: devel@driverdev.osuosl.org, linux-wireless@vger.kernel.org Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org, Greg Kroah-Hartman , Kalle Valo , "David S . Miller" , =?utf-8?b?SsOpcsO0bWUgUG91aWxsZXI=?= Subject: [PATCH 06/12] staging: wfx: drop useless field from struct wfx_tx_priv Date: Thu, 20 Aug 2020 17:58:52 +0200 Message-Id: <20200820155858.351292-6-Jerome.Pouiller@silabs.com> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20200820155858.351292-1-Jerome.Pouiller@silabs.com> References: <20200820155858.351292-1-Jerome.Pouiller@silabs.com> X-ClientProxiedBy: PR0P264CA0122.FRAP264.PROD.OUTLOOK.COM (2603:10a6:100:1a::14) To SN6PR11MB2718.namprd11.prod.outlook.com (2603:10b6:805:63::18) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from 255.255.255.255 (255.255.255.255) by PR0P264CA0122.FRAP264.PROD.OUTLOOK.COM (2603:10a6:100:1a::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3305.24 via Frontend Transport; Thu, 20 Aug 2020 15:59:30 +0000 X-Mailer: git-send-email 2.28.0 X-Originating-IP: [37.71.187.125] X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 0f78d5e2-afb3-42db-465c-08d8452206bf X-MS-TrafficTypeDiagnostic: SA0PR11MB4541: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:5797; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: tE92PA3TroTkEvHJweLnlPGr2NFzOzpvP/TRo6X1Tw5DFckFc0lmX2o+zilVHBW1PbigBRgKM11PPEcNYzvSo3egjPpK6yc6dhwH9ZqRlaboSYcTNXp+JtpqBDw2aE8kpj4nEVXS09cPkm35aFgZVlIUOayogefgTLGVbTNM4WITAtSGVRYAvttQ5kqzl6Xg82Pf/FP8PBFZtIt4RhCLZWtOyhmirbIBF6rwnpc+IVSGWm8uqE8K0QJmMZJGshqGiWMuZrmvlDt12elH4eFgByfAnuVz88MVParfa6C6nT8JX7Ls2ytJk9JIF8hicOsS92DN2aLO5eWdtr3hFK2N1LlpbswvpszMsYHPFVWztrs3BeOXg02mn84zA7GGMq4P X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:SN6PR11MB2718.namprd11.prod.outlook.com; PTR:; CAT:NONE; SFS:(376002)(396003)(39850400004)(366004)(346002)(136003)(186003)(6666004)(2906002)(8676002)(316002)(16576012)(54906003)(956004)(26005)(66574015)(8936002)(2616005)(110011004)(52116002)(83380400001)(107886003)(1076003)(5660300002)(478600001)(36756003)(4326008)(66476007)(66556008)(66946007)(86362001)(6486002); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData: ucKawbgDHIaSxcLH9b1t+jgU04mY1QymNo0hkREhg3T3ziSFJxMmi98DjgPwa+5v7yWvLCtG+ZztukUNdTQe6G9US9fGXW4gFa9RdSOwB5HHJVi/Ew7XGCBINPPXlhsWeUDEJbv+MgLgeuc73AWwJ6WxW62FfXQfNfaz04aJWDLBdnm6DipO2pnyc3y3xnAo2K+r4yKL1SJ2pwf2YNS+zffyJYmnVIlG3T5lWSkv8CN5ol3V3bzUwlpgIAoXs0f6G/sCFW1kYx9KcyuSkAK9E4L1VmB26vyuGpEGDUIXGSp+SOccbh7sv8psVwYLRDMHd6tzQpSFrxPctX4PQtd4qkf1eySeUdycaiH7X2mpVodfuDPxTc4AwD45myGD8j+qZPd+mo5Q4dC2TNWaX8Zh+Wp6BF5lyIwvowk4M+DOOIB1sVQ1UENe1wJKlUmP6P83RFa6RCNR8jjSR0/b45eEXdrUNB6n/FfF0HcyEYH+u/DpDftCVXLmvguA/+5hyxR4tGxQa2Qo1PyvaYamMmNZUadGroZFPrw8aO05shQxcMBkz3jSZTrclTYSTcTug9rVlp8oOyb3ESKYL5HGT4hBDsG5sn+UF3lh7c+k7+fgyzlwI0Z1nFyG3DriqhA7GGH0WlAcGBml4NZnso+rJL92kQ== X-OriginatorOrg: silabs.com X-MS-Exchange-CrossTenant-Network-Message-Id: 0f78d5e2-afb3-42db-465c-08d8452206bf X-MS-Exchange-CrossTenant-AuthSource: SN6PR11MB2718.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 20 Aug 2020 15:59:31.8747 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 54dbd822-5231-4b20-944d-6f4abcd541fb X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: c1l8LP/OjNVDKIhV+kDXE15T1BwsUPVwsKupNX37DApeNk6/ZqegPNX/0w4jkr1i3fy0MXdesm+U/SwsIhhnlw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: SA0PR11MB4541 Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org From: Jérôme Pouiller The device need to receive a skb with necessary space for the ICV. So, the driver adds this space before to send the frame. Currently, once the frame is sent, the driver restore the original content of the skb. However, this step is useless. Mac80211 don't do it when software encryption is enabled. Once we have removed this step, it appears that it is no more necessary to keep hw_key in tx_priv. Then, it is possible to simplify a bunch of code in the Tx path. Signed-off-by: Jérôme Pouiller --- drivers/staging/wfx/data_tx.c | 16 ++++------------ drivers/staging/wfx/data_tx.h | 3 +-- 2 files changed, 5 insertions(+), 14 deletions(-) diff --git a/drivers/staging/wfx/data_tx.c b/drivers/staging/wfx/data_tx.c index d16b516ad7cf..485907b0faa2 100644 --- a/drivers/staging/wfx/data_tx.c +++ b/drivers/staging/wfx/data_tx.c @@ -336,7 +336,6 @@ static int wfx_tx_inner(struct wfx_vif *wvif, struct ieee80211_sta *sta, { struct hif_msg *hif_msg; struct hif_req_tx *req; - struct wfx_tx_priv *tx_priv; struct ieee80211_tx_info *tx_info = IEEE80211_SKB_CB(skb); struct ieee80211_key_conf *hw_key = tx_info->control.hw_key; struct ieee80211_hdr *hdr = (struct ieee80211_hdr *)skb->data; @@ -350,14 +349,11 @@ static int wfx_tx_inner(struct wfx_vif *wvif, struct ieee80211_sta *sta, // From now tx_info->control is unusable memset(tx_info->rate_driver_data, 0, sizeof(struct wfx_tx_priv)); - // Fill tx_priv - tx_priv = (struct wfx_tx_priv *)tx_info->rate_driver_data; - tx_priv->hw_key = hw_key; // Fill hif_msg WARN(skb_headroom(skb) < wmsg_len, "not enough space in skb"); WARN(offset & 1, "attempt to transmit an unaligned frame"); - skb_put(skb, wfx_tx_get_icv_len(tx_priv->hw_key)); + skb_put(skb, wfx_tx_get_icv_len(hw_key)); skb_push(skb, wmsg_len); memset(skb->data, 0, wmsg_len); hif_msg = (struct hif_msg *)skb->data; @@ -489,7 +485,6 @@ static void wfx_tx_fill_rates(struct wfx_dev *wdev, void wfx_tx_confirm_cb(struct wfx_dev *wdev, const struct hif_cnf_tx *arg) { struct ieee80211_tx_info *tx_info; - const struct wfx_tx_priv *tx_priv; struct wfx_vif *wvif; struct sk_buff *skb; @@ -499,18 +494,15 @@ void wfx_tx_confirm_cb(struct wfx_dev *wdev, const struct hif_cnf_tx *arg) arg->packet_id); return; } + tx_info = IEEE80211_SKB_CB(skb); wvif = wdev_to_wvif(wdev, ((struct hif_msg *)skb->data)->interface); WARN_ON(!wvif); if (!wvif) return; - tx_info = IEEE80211_SKB_CB(skb); - tx_priv = wfx_skb_tx_priv(skb); + + // Note that wfx_pending_get_pkt_us_delay() get data from tx_info _trace_tx_stats(arg, skb, wfx_pending_get_pkt_us_delay(wdev, skb)); - - // You can touch to tx_priv, but don't touch to tx_info->status. wfx_tx_fill_rates(wdev, tx_info, arg); - skb_trim(skb, skb->len - wfx_tx_get_icv_len(tx_priv->hw_key)); - // From now, you can touch to tx_info->status, but do not touch to // tx_priv anymore // FIXME: use ieee80211_tx_info_clear_status() diff --git a/drivers/staging/wfx/data_tx.h b/drivers/staging/wfx/data_tx.h index cff7b9ff99a9..87e1b9b62dbb 100644 --- a/drivers/staging/wfx/data_tx.h +++ b/drivers/staging/wfx/data_tx.h @@ -35,8 +35,7 @@ struct tx_policy_cache { struct wfx_tx_priv { ktime_t xmit_timestamp; - struct ieee80211_key_conf *hw_key; -} __packed; +}; void wfx_tx_policy_init(struct wfx_vif *wvif); void wfx_tx_policy_upload_work(struct work_struct *work);