From patchwork Fri Feb 11 16:26:59 2022 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: 542502 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id D3FEAC433EF for ; Fri, 11 Feb 2022 16:27:34 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1351480AbiBKQ1e (ORCPT ); Fri, 11 Feb 2022 11:27:34 -0500 Received: from mxb-00190b01.gslb.pphosted.com ([23.128.96.19]:55058 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S244754AbiBKQ1b (ORCPT ); Fri, 11 Feb 2022 11:27:31 -0500 Received: from NAM10-DM6-obe.outbound.protection.outlook.com (mail-dm6nam10on2061.outbound.protection.outlook.com [40.107.93.61]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E81673AD; Fri, 11 Feb 2022 08:27:29 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=XuWw+/G/4GRpJqsdnzqDYNq/8Xtb5VV6/KbBccK4Fo/UwaJPWmSDNtYSoN2MQDcEb9cdu8WO9hf/lOn+6X2vFNIvgyXkvpC1BYEZphp6Gu0fzNu2feuDYAcPydwDARP9je2r86xXkB6BWTTs5pXm4lf58ISS+iuwBwdb+GpCPizz6sk4xL785IjQ2lsniCVclJIrQMcJh1ct7Q3F+GjprRdzDrPKB6NaR/qD9zUZO8KHVrmVCwCwnKp7ToILC/kgr04MbM9TgVZ0cRJW3dCNAkQ1d6f+dhCIeDhJbdV4XuD7ghWXaYb/v5PaTDnCxL6kEkdYj2pQ0RZq4RHO81T5xQ== 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-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=ibk/kM2hv1xuMO3ECky+UxpNOgQUtmLFvrvHG3f0dCg=; b=OHhKuCenpvoqsqzttOpL6zmdYbrVfhCjxG82oECW7+5f5QJK2kF2oa32z3mhjhYNDdDYPqrCb246/3Ttm1mXPTgIEzYnWg+edFkxJuVW42Juey85WmoUD0QOnpjSN4slkcViZ5u8D78KrsAIGvulS7yuAK7jdiL7yAOm5wgpAoJrwIItvxZbUDK7+NtOOaG2aDJMOhs+v+b+mA1S3kUXNuyvA6kakANvltuHNNPsa+hjtlAr+Hl9ILhNAmgZvCVUcD4m9JZGPcaJeY/1On6aa9XncVhnm2uWEdDrFMLAS/FPDCJT3cOiwwnVIqIogGgZgfB0xOqc/+fZR0YDlItrAg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=none; dmarc=none; dkim=none; 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=ibk/kM2hv1xuMO3ECky+UxpNOgQUtmLFvrvHG3f0dCg=; b=fw4R1OMoPJn/2m4XCidfRhzAcgq2l+eEnsbLiGOctJxZVANrTSiBRkc8G2u2ZhzUN/cu1OEg5Ul4tKoVglqa+B7Tr7vrXDDQ0C8yw9ZzCKYnxC/ZyaMrBFakAeJsWMBx1g9VI2Ki4mQGJU89ego6+SEWTZXEyZJmeilHbyYvwf8= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=silabs.com; Received: from PH0PR11MB5657.namprd11.prod.outlook.com (2603:10b6:510:ee::19) by BN6PR1101MB2196.namprd11.prod.outlook.com (2603:10b6:405:52::8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4975.11; Fri, 11 Feb 2022 16:27:28 +0000 Received: from PH0PR11MB5657.namprd11.prod.outlook.com ([fe80::1b3:e483:7396:1f98]) by PH0PR11MB5657.namprd11.prod.outlook.com ([fe80::1b3:e483:7396:1f98%3]) with mapi id 15.20.4975.014; Fri, 11 Feb 2022 16:27:28 +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 2/2] staging: wfx: remove support for legacy PDS format Date: Fri, 11 Feb 2022 17:26:59 +0100 Message-Id: <20220211162659.528333-3-Jerome.Pouiller@silabs.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220211162659.528333-1-Jerome.Pouiller@silabs.com> References: <20220211162659.528333-1-Jerome.Pouiller@silabs.com> X-ClientProxiedBy: PR1P264CA0011.FRAP264.PROD.OUTLOOK.COM (2603:10a6:102:19e::16) To PH0PR11MB5657.namprd11.prod.outlook.com (2603:10b6:510:ee::19) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 9038d393-6fb5-46a9-6538-08d9ed7b6525 X-MS-TrafficTypeDiagnostic: BN6PR1101MB2196:EE_ X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:7691; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: xwuPgnub1sbs/eSyF2/8lPk1N0GARHJwAxpQaWk32uU0T19WHU6thjFxO2nmd6ZAq4Th4Onq4yYYrnEfwgBZ6vUMUzByCJ8tx6VSMzai6lz1Dt2hTEKqmzXi6Ysd/8WyYzDQ5H5kBu+PEyoBDquPSicTTlTuRPg8xswytnhIe3bbCOfsvdYCts4ucXaQSqU9dOymehvb5up5qYprZac62KCzdJMSTCl+hieansbt0xhctkRDXN8vaqliEup+0a0ZCMe8Ejeor7ph4SRdu8d37BYHmrWO4nSINX/WKb+YRxyeYBQzb82OjsaF4BveODAt2YTy9qR7/mUoiZbHSDH+MWOyMMeb4aVN0YIhlTb8SZGC9QSuqqjXqGCSsZlUFpGmCJH4YnzOH372w+NrLR4RE4FN23C/a/ntoCTgbgT7i9MKp8m9KhUho6XXRU+544uodaq8Y2pCVN0YIvFQIVUgqn37EsH4D0XeXZdb84ifsADo1x4ruKsj61MFU64UWt36n7qVGTJ4Wp3ahGDU6ywWODREy9m3quYVeUKRI4WKAeEdrDhKZwNB4AqZDk83siNDFFLELyrgawrWBxjennUxN8vhIZHWqq+cBL2F9Hmu8aRr0/ryrSEzTzdQkox2PkMKxtZaGJmLtTLVqdEgiKtBvGVY7Nov1dcDBVUGTyzkXdrJlBqoR7tEOPaYcjkQj62sVNOCaeoy+09NzxMnsJdseA== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:PH0PR11MB5657.namprd11.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230001)(366004)(186003)(26005)(86362001)(4326008)(36756003)(66476007)(83380400001)(508600001)(8936002)(66946007)(8676002)(66556008)(1076003)(2616005)(38100700002)(54906003)(38350700002)(6512007)(316002)(5660300002)(66574015)(52116002)(2906002)(6666004)(6506007)(6486002)(107886003); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?q?00g4PBPJD/BFSA48L98AasshszNV?= =?utf-8?q?cldM4KjhFj8g+9/hnRnvszbmoTfmy13pX+tSNl31QY8SYsEGcdo54bih4dmCbdb9i?= =?utf-8?q?dmiO2O1XJy2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MIM5+sdCzQ9RPlHg94mmQN47wJtvJ2ZnsnXZOIf50KsQIuJzXpjkAcMlV?= =?utf-8?q?AoMP4DoGe5u9LJ41NYXmkzNm66zuOcoPdokk6pgQjeAqkFSwoYPXUxxNZ8s9ae8wv?= =?utf-8?q?/gwxCTddURKCIR4hl+3e4+eQl0MbqRVnhhb8F5tthKF7b5KDNXtoP7U4y+evZulRZ?= =?utf-8?q?bLgkEg9Hj16LjXHY1bsbTUEvqacRDZ49PSBiJfVvTHmEx5Hktwvp6phYVMMG/ibG9?= =?utf-8?q?yjBG1a4n3GbsGYcyP7DqjXKCGsO5aFe13VXOck+VnTbe/AdTySdGFalOnT+9+8Y9G?= =?utf-8?q?xZsuhrwg7LSogfL4Gcp6Aq+9yVHX/qL+LF9pPDqEv/g8XyPPtJ9gPNAuYoF88NXD7?= =?utf-8?q?39DHF/bt0f5lQqndUZ8f92q/xlFpjPjKHM2zFM9uNp0Fm8ad5RrG2YBL/ScsjxK/m?= =?utf-8?q?Vq5KTcaDOH6ZqZfql/IgvHao2o1Ww7MX7PT83dKgsi0QddY5WWyuZoVZjhsVEgK7z?= =?utf-8?q?w/zjQkUg2kDboAvbmK5x7OiCg5y9RyLNAYObwPrwiDSoVLjk7a1K307HwoBOzw7HG?= =?utf-8?q?O3zInlsca26ivQ2PR2fc8UeGWugP1aj7DXEfvjE4KXzmzMtIyaKvN6o=3D?= X-OriginatorOrg: silabs.com X-MS-Exchange-CrossTenant-Network-Message-Id: 9038d393-6fb5-46a9-6538-08d9ed7b6525 X-MS-Exchange-CrossTenant-AuthSource: PH0PR11MB5657.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 11 Feb 2022 16:27:28.4751 (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: gKhEV0/cV+66CfpABHmU1cGhzInqhpzZrAMVEaUspZVzJ/Hr+UfMBpoBscH4qe5DsQxD0Ckjzgsa1cq81Esscg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN6PR1101MB2196 Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org From: Jérôme Pouiller We don't want to support legacy PDS format. Signed-off-by: Jérôme Pouiller --- drivers/staging/wfx/main.c | 55 +++----------------------------------- 1 file changed, 4 insertions(+), 51 deletions(-) diff --git a/drivers/staging/wfx/main.c b/drivers/staging/wfx/main.c index a0f5e09c3c3f..0ddc67b56589 100644 --- a/drivers/staging/wfx/main.c +++ b/drivers/staging/wfx/main.c @@ -163,55 +163,6 @@ bool wfx_api_older_than(struct wfx_dev *wdev, int major, int minor) return false; } -/* In legacy format, the PDS file is often bigger than Rx buffers of the chip, so it has to be sent - * in multiple parts. - * - * In add, the PDS data cannot be split anywhere. The PDS files contains tree structures. Braces are - * used to enter/leave a level of the tree (in a JSON fashion). PDS files can only been split - * between root nodes. - */ -int wfx_send_pds_legacy(struct wfx_dev *wdev, u8 *buf, size_t len) -{ - int ret; - int start = 0, brace_level = 0, i; - - for (i = 1; i < len - 1; i++) { - if (buf[i] == '{') - brace_level++; - if (buf[i] == '}') - brace_level--; - if (buf[i] == '}' && !brace_level) { - i++; - if (i - start + 1 > WFX_PDS_MAX_CHUNK_SIZE) - return -EFBIG; - buf[start] = '{'; - buf[i] = 0; - dev_dbg(wdev->dev, "send PDS '%s}'\n", buf + start); - buf[i] = '}'; - ret = wfx_hif_configuration(wdev, buf + start, - i - start + 1); - if (ret > 0) { - dev_err(wdev->dev, "PDS bytes %d to %d: invalid data (unsupported options?)\n", - start, i); - return -EINVAL; - } - if (ret == -ETIMEDOUT) { - dev_err(wdev->dev, "PDS bytes %d to %d: chip didn't reply (corrupted file?)\n", - start, i); - return ret; - } - if (ret) { - dev_err(wdev->dev, "PDS bytes %d to %d: chip returned an unknown error\n", - start, i); - return -EIO; - } - buf[i] = ','; - start = i; - } - } - return 0; -} - /* The device needs data about the antenna configuration. This information in provided by PDS * (Platform Data Set, this is the wording used in WF200 documentation) files. For hardware * integrators, the full process to create PDS files is described here: @@ -223,8 +174,10 @@ int wfx_send_pds_legacy(struct wfx_dev *wdev, u8 *buf, size_t len) { int ret, chunk_type, chunk_len, chunk_num = 0; - if (*buf == '{') - return wfx_send_pds_legacy(wdev, buf, len); + if (*buf == '{') { + dev_err(wdev->dev, "PDS: malformed file (legacy format?)\n"); + return -EINVAL; + } while (len > 0) { chunk_type = get_unaligned_le16(buf + 0); chunk_len = get_unaligned_le16(buf + 2);