From patchwork Mon Sep 7 10:15:11 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: 11760453 X-Patchwork-Delegate: johannes@sipsolutions.net Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id E8694746 for ; Mon, 7 Sep 2020 10:24:13 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id C54B921473 for ; Mon, 7 Sep 2020 10:24:13 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=silabs.onmicrosoft.com header.i=@silabs.onmicrosoft.com header.b="XuUxLlz+" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728844AbgIGKVD (ORCPT ); Mon, 7 Sep 2020 06:21:03 -0400 Received: from mail-mw2nam10on2056.outbound.protection.outlook.com ([40.107.94.56]:42336 "EHLO NAM10-MW2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1728745AbgIGKRM (ORCPT ); Mon, 7 Sep 2020 06:17:12 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=ZiR+qrwRuPv61q96qYRHOZtGN5p3PkmYokYqKn9+S1wbxbvqXPfLmSYrdNdfO93lfz7cgbljI9q3+5hJiS8q5rRTkh9t7k7aTRmOXgQtUmcIHPb7iT9vEVntW4eFoEiWLlVvgMb1ZHxC/1dVK2eUTydBCZ/8H1AiyD69LKcqvPFnosxGy4bnPZK4PKMgda+HqmUGOsBJBHEVqysKhckr3iW2PioThHYRvLiZvjGvkVsOmwlCet/u8I85awxTAyBwyfg2tCImiM9cyVqGxJVUI4kyVE98nzImjfwGHeTiq/zTYCk8gs3HTXKG7UEL4kOXj1mdcCwD6daE56Y7eZRrHg== 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=S88uLDlFTB5T8xAtqkryG6651zwk2ZJeueih/rYLPM0=; b=iSlmSgQRiz1Kxrfa6G46swXpELRkBO/axVZAdy8YYn0oyiCyRsopWsEBJ+DMR67kbqeghUucBs9KU0QMMe9+fJZdbq9jm+QmFV5zp2tsYVB2kAAgdifsb3e5Km78zc433bV/ORxr0nhhkCOBwObXxV9Bw7iGSlEZOvJsW95EZk0vbOarWyXiE8lLblw+/if4OdHxrlMvn2hy4sh456HzGG0FOh5uMgMnkd2r46Dr4GyMnEg9XHxa8SDpNmI6apRqenFaMZ0X45ntVMEFfdigIURpx9Wk/BwLR2t4BirWSsIlquCrukOBhUn2bVNDhg6rEQzHGxKfX15uknND7hibUA== 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=S88uLDlFTB5T8xAtqkryG6651zwk2ZJeueih/rYLPM0=; b=XuUxLlz+5HgLfAG32w5wblaKvQojYiDPJ6kHONGaI/ENbrXmq3jU89Wk7WnPQ6FYGPT8d5uf/wK3kCZrUl52FE98zpElhuvWEVCavUtOyK1uAzuksvIgiwP8+API7OPXghUYlM8WvNpgrh7bUHENjg+Mzd8QLQOrvxH1SEassv4= 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 SN6PR11MB2720.namprd11.prod.outlook.com (2603:10b6:805:56::27) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3348.15; Mon, 7 Sep 2020 10:16:19 +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.3348.019; Mon, 7 Sep 2020 10:16:19 +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 21/31] staging: wfx: drop useless structs only used in hif_ind_startup Date: Mon, 7 Sep 2020 12:15:11 +0200 Message-Id: <20200907101521.66082-22-Jerome.Pouiller@silabs.com> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20200907101521.66082-1-Jerome.Pouiller@silabs.com> References: <20200907101521.66082-1-Jerome.Pouiller@silabs.com> X-ClientProxiedBy: PR0P264CA0109.FRAP264.PROD.OUTLOOK.COM (2603:10a6:100:19::25) To SN6PR11MB2718.namprd11.prod.outlook.com (2603:10b6:805:63::18) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from pc-42.silabs.com (37.71.187.125) by PR0P264CA0109.FRAP264.PROD.OUTLOOK.COM (2603:10a6:100:19::25) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3348.16 via Frontend Transport; Mon, 7 Sep 2020 10:16:17 +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: ac3de66f-4be9-465c-a871-08d853170fe8 X-MS-TrafficTypeDiagnostic: SN6PR11MB2720: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:5236; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: Qaghc2mhWi68i/I5dtnzBsBE6tBoyar523ncFG+95BZvjxHH0qwoxZHFw7AOuoErEpJt7jo3lCa6PYC7R6oUVAKCQnXxJkuvb49ZeG+HBh65yKTwfpi0R86bBKxzEbSZ2wQtphw1zyZQleb3+xydeR4hbH93avpWx2uCjjn6ztWHclofOKmJPRPsIcgfrraTwQQP+B6a0btLSzpIoSco+EFuTCSl5nY57ccD2IFDUiZ9cusI3rlWNXMz5uq2ceq0OqrVssL/CE5+wO9F8S6FEORaHrrOLKRUviXv3iPiSKViHeTPnMjBD53lKIAIF/NZB3XwRzcyZPmu6RX87ohcDw== 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)(366004)(39850400004)(136003)(346002)(396003)(66946007)(66556008)(66476007)(54906003)(26005)(186003)(16526019)(66574015)(83380400001)(107886003)(6486002)(8676002)(956004)(2616005)(2906002)(316002)(86362001)(8936002)(478600001)(4326008)(7696005)(36756003)(52116002)(6666004)(1076003)(5660300002);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData: 2e3gCXv3NTw2fNbYGmCw/0OFBvzZcm1dVYqwAbOCrhU3k0i6s2/D4fPUXD2Smsn6qJtz5QelDM/MJVSsNZ94X5Ve56NrhNc/ltdDhsZHvN+Ki1IvdlkoQyDk01aRcd7lTd79JB5v8naM8tCH0GoPl2K23sIapABJgmWyG20O8z0+u/TtY5h6x5hmKOlLkptsYJY2BREgSqDIbGav0PDVnjUEXjAtQ4jpKWNS3PdomijJl4gQ6D3vmVnsgQY9QUZEtR75HDG8mOTkbQbJTddel0x44DQmvdV3HXndgK+0Dtfup/8fasvAcXIo+23CLIXBwZQlSwu9lLKZXYimZGs4RDqmYUBTf+IQ/pDj6m8cthPMTC4+TXsGJFnfX53HZW6MfD0bcj5+URFV0OfAgNpa9HivSr4NwGk+vR88jPyyUASTZe+kQIR1MVt9UX5AiEMsiEFq23B6GRDMUnJc+jJIJELNMFTmVn1ZicL4EUwGuR96DEqjoD17770PCWccipe4vt/s0JdeH09O/bPlokifnpz/0wEOH1vnsCCZJPHHaET6L+2uQMZeW+SEPgDunjQAf3yeF+Zsr2Ctz84WooNZx5h67Yhz0m2EL+zOCfcUEbBFZ5ELJ4cTqX1BkM9S8XESK2T6cxVNzqqx74UPdkLTcg== X-OriginatorOrg: silabs.com X-MS-Exchange-CrossTenant-Network-Message-Id: ac3de66f-4be9-465c-a871-08d853170fe8 X-MS-Exchange-CrossTenant-AuthSource: SN6PR11MB2718.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 07 Sep 2020 10:16:19.0963 (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: QsV8WiqSojZecDGpegT8lllzYbldg298EazgjlYDwlcBniVufsczfgy94QMD83obmzOWYdi5XJjMIBM2DY8yHA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN6PR11MB2720 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 structs hif_capabilities, hif_otp_regul_sel_mode_info and hif_otp_phy_info have no real reasons to exist. Drop them and simplify access to fields of struct hif_ind_startup. Signed-off-by: Jérôme Pouiller --- drivers/staging/wfx/hif_api_general.h | 32 +++++++++------------------ drivers/staging/wfx/main.c | 9 ++++---- 2 files changed, 14 insertions(+), 27 deletions(-) diff --git a/drivers/staging/wfx/hif_api_general.h b/drivers/staging/wfx/hif_api_general.h index 0dc13176a05e..4058016ec664 100644 --- a/drivers/staging/wfx/hif_api_general.h +++ b/drivers/staging/wfx/hif_api_general.h @@ -122,25 +122,6 @@ enum hif_fw_type { HIF_FW_TYPE_WSM = 0x2 }; -struct hif_capabilities { - u8 link_mode:2; - u8 reserved1:6; - u8 reserved2; - u8 reserved3; - u8 reserved4; -} __packed; - -struct hif_otp_regul_sel_mode_info { - u8 region_sel_mode:4; - u8 reserved:4; -} __packed; - -struct hif_otp_phy_info { - u8 phy1_region:3; - u8 phy0_region:3; - u8 otp_phy_ver:2; -} __packed; - struct hif_ind_startup { // As the others, this struct is interpreted as little endian by the // device. However, this struct is also used by the driver. We prefer to @@ -156,14 +137,21 @@ struct hif_ind_startup { u8 mac_addr[2][ETH_ALEN]; u8 api_version_minor; u8 api_version_major; - struct hif_capabilities capabilities; + u8 link_mode:2; + u8 reserved1:6; + u8 reserved2; + u8 reserved3; + u8 reserved4; u8 firmware_build; u8 firmware_minor; u8 firmware_major; u8 firmware_type; u8 disabled_channel_list[2]; - struct hif_otp_regul_sel_mode_info regul_sel_mode_info; - struct hif_otp_phy_info otp_phy_info; + u8 region_sel_mode:4; + u8 reserved5:4; + u8 phy1_region:3; + u8 phy0_region:3; + u8 otp_phy_ver:2; u32 supported_rate_mask; u8 firmware_label[128]; } __packed; diff --git a/drivers/staging/wfx/main.c b/drivers/staging/wfx/main.c index 1017a2290f08..2a9098bad1f5 100644 --- a/drivers/staging/wfx/main.c +++ b/drivers/staging/wfx/main.c @@ -359,9 +359,8 @@ int wfx_probe(struct wfx_dev *wdev) dev_info(wdev->dev, "started firmware %d.%d.%d \"%s\" (API: %d.%d, keyset: %02X, caps: 0x%.8X)\n", wdev->hw_caps.firmware_major, wdev->hw_caps.firmware_minor, wdev->hw_caps.firmware_build, wdev->hw_caps.firmware_label, - wdev->hw_caps.api_version_major, - wdev->hw_caps.api_version_minor, - wdev->keyset, *((u32 *)&wdev->hw_caps.capabilities)); + wdev->hw_caps.api_version_major, wdev->hw_caps.api_version_minor, + wdev->keyset, wdev->hw_caps.link_mode); snprintf(wdev->hw->wiphy->fw_version, sizeof(wdev->hw->wiphy->fw_version), "%d.%d.%d", @@ -377,13 +376,13 @@ int wfx_probe(struct wfx_dev *wdev) goto err0; } - if (wdev->hw_caps.capabilities.link_mode == SEC_LINK_ENFORCED) { + if (wdev->hw_caps.link_mode == SEC_LINK_ENFORCED) { dev_err(wdev->dev, "chip require secure_link, but can't negotiate it\n"); goto err0; } - if (wdev->hw_caps.regul_sel_mode_info.region_sel_mode) { + if (wdev->hw_caps.region_sel_mode) { wdev->hw->wiphy->bands[NL80211_BAND_2GHZ]->channels[11].flags |= IEEE80211_CHAN_NO_IR; wdev->hw->wiphy->bands[NL80211_BAND_2GHZ]->channels[12].flags |= IEEE80211_CHAN_NO_IR; wdev->hw->wiphy->bands[NL80211_BAND_2GHZ]->channels[13].flags |= IEEE80211_CHAN_DISABLED;