From patchwork Mon Sep 7 10:15:16 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: 259378 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=-12.7 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, MSGID_FROM_MTA_HEADER, 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 0B4B3C43461 for ; Mon, 7 Sep 2020 10:19:59 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id C3505207C3 for ; Mon, 7 Sep 2020 10:19:58 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=silabs.onmicrosoft.com header.i=@silabs.onmicrosoft.com header.b="bcItqjYd" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728877AbgIGKTy (ORCPT ); Mon, 7 Sep 2020 06:19:54 -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 S1728810AbgIGKRb (ORCPT ); Mon, 7 Sep 2020 06:17:31 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=EyARK1iV6h1BfrVt/OslR1YuAMJWe1VIEsM/vFjmOfwOp3zUd9jRLIPiIMIw+tYmmGFIVXsS+uE1YDbV2EG/fM9S/aYG67r19u7zxWmnHBDPaNFSBBPozQVApL7rYX1dKE+rkcarBaQHfwEsSwNxAH4/4UoXnobobbiZCMv3E69qTDbxlQIddZdRuisiQz/5b1HPPwncNdekZuvWvRFtXWSz0o9l/y7ZTJ4m+FB3K6yS8KWKxJ1XduX/12UnbK7duymuMYeoJLav7MkC2oMbEvLDcQAYCfSEbwE3/Rkt0EahReYolXIZotkfI2+tS6yeeaaDj+CYoVWeYuwzftYwHw== 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=+k+GleFu0J19YsGZFLjhCsk1dC2X1vLIC78Wjtzf3hM=; b=eOBGPmg5E1yRGN0S4bZourW8Rt2lkq8Si5WApQJk6PdhRRJFHI9d7pKM5bZI5x5BDRPoH/9PNW/9x9WbXlCXuS9K1vedKBKOd9KOLokESVTh0+Q9wf3qohDhlS1QHwU+m1XCE4d7iIAPiS9acO+vLLnW2GND8r9UEtU9T47Qn3Di4ZF6JTu0e2dHZsS2ICh6mveVzv09DLUgA0jKH+18ZiwZgyCxSbInHZc1VenpD8EjVZwFvvNXlMlU7Ny9FX6g4NtviBp5zm1OoxNOBJGW7M+3i21pVNtpBSp4to8ChkKHeNhTMLYjQRoduQyiTqTOFxSSpjKM4jjM6aDYAcBQoQ== 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=+k+GleFu0J19YsGZFLjhCsk1dC2X1vLIC78Wjtzf3hM=; b=bcItqjYd9+uioGEW6NUQMe/XA1O/QHNVYHmjJhtnmgmYbWBiIJ/dSvM9bEY+Ke3xlV6YDiecgMkJYyf9rhjrxFc4097vk9Cuid4LvLfTMfXnnCCPFJDvc0KiSXjsGpH1l41qDC/73OzpBvk/i7ZAsnNC7PrJgz6JhLmOtMX/VD0= 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:27 +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:27 +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 26/31] staging: wfx: drop macro API_SSID_SIZE Date: Mon, 7 Sep 2020 12:15:16 +0200 Message-Id: <20200907101521.66082-27-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:26 +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: 6cd601d4-1f14-4980-966e-08d8531714df X-MS-TrafficTypeDiagnostic: SN6PR11MB2720: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:403; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 7bs+Nfw/wKZablRzXN38jKv6/NeKWBuaihGr/HkFSKwx/uXyHOLYiyiV9ZJ+GJe7n9JDnhkh17NNdAeEoDphiazJXsU38VrDoQOfhI9rAUhdHkxY4FnwOPR3FtE1NBnlTpkCgfbBDFY1Giw4WN1k3CTFF65MJ1lFI8mqkMu9SQf+ydSYfq6jggwFb1XHA+WtMfEM/McPOHNwLEUcVsupWaJPtLqKnxPhV2TCZMTmw0CkpKr4kg6ZOPK6frZ2XUS6EBZ4E7YwkCgi3fBu64haPIy0aks6iTJ2zHZZZ9fyQX+BlFaiqMey6doeihnGIXtB0Xy3vd7DkOf5aNU72gOkXA== 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: STTfU3/IN0a0X6I1kt1W9nx4+bFwl1U3r8256Q0bEgH37hQAcRJRn61KvdmgS3qNUUIfoL7m7BilR5qyBtKV1X9VGK07eTUKG9kXr/7EOHguhUM5cGeP/jn9bONXfP6PyMNUeEo8z/ud7Pg7NyGfXaXdTeROE/LA/utTUyVWZafVM4lNbsjf9YfJL+HL0b8CbS2IAjIvpH9a8BZwzFSbaxK79L6dAQvwV62wV2dNrQT0u6Pl52qcFV5I3D915BjWKfHT1hoB1bdAoxtx2lbLLOyPNW3gC+9Phx3wBJP0kGFgwFJ4KOnRT/ES3gkQBZ9yd3kyvZsD3sPBogMEOH6A96f/2Ebo1d9MZfWyrBhJfYyGj7Dm+oZvVInBpxE1lTMHSXReXlKL/slOrmOpndPoUTzc/63ec4oIplcVePo2WtwGPDUCZ7KUKi89l98Dwz+Kthu9X30p2eKFZTjEFZUXkQ82DN1itsxE4PfheCVHdLAPJyOvO7T0gRu0uPaiO93ILb4wCWCGXdjOfzrH+JpsYnHp2IOaw+paFxifS/7pBCFQ/rg3JyMD9K51Ly9t9mEzPYOlCV9o4BcKOOPKdYXWrOQzk8Rweu0+LgcDQVFN2OMqavv4blDOyIcQwfrfXhvpuZFKV858JjwfQErAvY6VTw== X-OriginatorOrg: silabs.com X-MS-Exchange-CrossTenant-Network-Message-Id: 6cd601d4-1f14-4980-966e-08d8531714df 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:27.4094 (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: uAHL6GicdwvM8sVsVonh6bA4PC3Lro9fvvmOowS6g/jVJsKPuL5Stsqvd6+4qDU3e6khc+fOgXZ/+1AR7n8P1g== 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 maximum length of a SSID is defined by 802.11 specification. It is already defined in mac80211: IEEE80211_MAX_SSID_LEN. Therefore, use this generic definition. Signed-off-by: Jérôme Pouiller --- drivers/staging/wfx/hif_api_cmd.h | 8 +++----- drivers/staging/wfx/hif_api_general.h | 2 -- drivers/staging/wfx/hif_tx.c | 2 -- 3 files changed, 3 insertions(+), 9 deletions(-) diff --git a/drivers/staging/wfx/hif_api_cmd.h b/drivers/staging/wfx/hif_api_cmd.h index ef5483609dcb..7b365bd01b81 100644 --- a/drivers/staging/wfx/hif_api_cmd.h +++ b/drivers/staging/wfx/hif_api_cmd.h @@ -12,8 +12,6 @@ #include "hif_api_general.h" -#define HIF_API_SSID_SIZE API_SSID_SIZE - enum hif_requests_ids { HIF_REQ_ID_RESET = 0x0a, HIF_REQ_ID_READ_MIB = 0x05, @@ -111,7 +109,7 @@ struct hif_cnf_update_ie { struct hif_ssid_def { __le32 ssid_length; - u8 ssid[HIF_API_SSID_SIZE]; + u8 ssid[IEEE80211_MAX_SSID_LEN]; } __packed; #define HIF_API_MAX_NB_SSIDS 2 @@ -307,7 +305,7 @@ struct hif_req_join { u8 force_with_ind:1; u8 reserved6:4; __le32 ssid_length; - u8 ssid[HIF_API_SSID_SIZE]; + u8 ssid[IEEE80211_MAX_SSID_LEN]; __le32 beacon_interval; __le32 basic_rate_set; } __packed; @@ -364,7 +362,7 @@ struct hif_req_start { u8 reserved3:7; u8 reserved4; u8 ssid_length; - u8 ssid[HIF_API_SSID_SIZE]; + u8 ssid[IEEE80211_MAX_SSID_LEN]; __le32 basic_rate_set; } __packed; diff --git a/drivers/staging/wfx/hif_api_general.h b/drivers/staging/wfx/hif_api_general.h index da63ba6f5148..c9e3c0f758c8 100644 --- a/drivers/staging/wfx/hif_api_general.h +++ b/drivers/staging/wfx/hif_api_general.h @@ -17,8 +17,6 @@ #define __packed __attribute__((__packed__)) #endif -#define API_SSID_SIZE 32 - #define HIF_ID_IS_INDICATION 0x80 #define HIF_COUNTER_MAX 7 diff --git a/drivers/staging/wfx/hif_tx.c b/drivers/staging/wfx/hif_tx.c index 0553e79595a6..a75c6b9804ba 100644 --- a/drivers/staging/wfx/hif_tx.c +++ b/drivers/staging/wfx/hif_tx.c @@ -245,8 +245,6 @@ int hif_scan(struct wfx_vif *wvif, struct cfg80211_scan_request *req, WARN(chan_num > HIF_API_MAX_NB_CHANNELS, "invalid params"); WARN(req->n_ssids > HIF_API_MAX_NB_SSIDS, "invalid params"); - compiletime_assert(IEEE80211_MAX_SSID_LEN == HIF_API_SSID_SIZE, - "API inconsistency"); if (!hif) return -ENOMEM; for (i = 0; i < req->n_ssids; i++) {