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 DB6F0C4167E for ; Tue, 11 Jan 2022 17:16:55 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1344170AbiAKRQy (ORCPT ); Tue, 11 Jan 2022 12:16:54 -0500 Received: from mail-co1nam11on2074.outbound.protection.outlook.com ([40.107.220.74]:39233 "EHLO NAM11-CO1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S240026AbiAKRQC (ORCPT ); Tue, 11 Jan 2022 12:16:02 -0500 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=LzOSCTFu+1puLNK0J2uIEtrvktuYe0MeECe2kfiJuQJlW3nOkV5ap16dInvg61UnSsFmwcPqzwLYQYf+luJgaBb8CPi8JHD5/ZQ3NE+5umfMHbhoxyqSCRIGXn+/mSyBXZj/FIMYice78TL3BkZBKOG7mQdwofnygUmCiPwiHsCce+OzM5ac/msznobAkLLrZPswZLgUBS6LRkqFFGuhAgqGwkrHgjbqPR99xic5baonrG6ZnItIqSSvzmBwCXtJ18pGHzKVkuKyXxYcctYKDF9RwJ2CFwXttNa7eizfU1nfIMywvwVaxiYzSiEM5CP8aM+vEdP4FHuD/odM+bCR2Q== 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=0B9o9LpLBOM8DiiwWYOHksQDZ7PKy4BMdRm2lgbWfZ0=; b=b9aCZxdKCDXBVPBBvMYuexsHHIiYYeB6D7z2O7nrD+Fl1HQ0KuGZkIqm72BtTmLbV2Rjjk0HYHLjKDfDCG1I5H0rr7QirA7AbbTzSHqciiWwkrNVKC/N4qUJ8DATZzjT3mWP9Swej7FXPl74jKjtwx3rIUxqRClop+p1obMkMR6fEHxQ9KH/d78r/KXZNnOjYhDPtSMlcN1KH4oYgL8EzUnQq0eUvvc2VJp6O5137ekNjIN/DGIXLZspt7AZdUkkoKG75zshbQTUJ7V9ohjk45uwqstFxb0Igu4z+5PRRUTtTkVrkBCYiBhwvAp1+xSPZe7JUCFq8GIAAxMb8PyvAA== 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=0B9o9LpLBOM8DiiwWYOHksQDZ7PKy4BMdRm2lgbWfZ0=; b=fC+jvvDlJfiex8ZGdVYLoEn3Z2JRaeZRlNbswfSWJ1d3BDAW74skWga3RuPzzEIfbIsAZjEJsPKr6FIr4qSTFFCQCiuiots0KBD97Ut+KRp8x3SbgdhsaIHyICISPioESaY6QJcQIINa1+KFZ+wAevSYwLlMqObAn15+Qp8MjyI= 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 PH0PR11MB5657.namprd11.prod.outlook.com (2603:10b6:510:ee::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4867.11; Tue, 11 Jan 2022 17:15:33 +0000 Received: from PH0PR11MB5657.namprd11.prod.outlook.com ([fe80::d031:da9e:71a:73e4]) by PH0PR11MB5657.namprd11.prod.outlook.com ([fe80::d031:da9e:71a:73e4%6]) with mapi id 15.20.4867.012; Tue, 11 Jan 2022 17:15:33 +0000 From: Jerome Pouiller To: linux-wireless@vger.kernel.org, netdev@vger.kernel.org, Kalle Valo Cc: devel@driverdev.osuosl.org, linux-kernel@vger.kernel.org, Greg Kroah-Hartman , "David S . Miller" , devicetree@vger.kernel.org, Rob Herring , linux-mmc@vger.kernel.org, =?UTF-8?q?Pali=20Roh=C3=A1r?= , Ulf Hansson , =?UTF-8?q?J=C3=A9r=C3=B4me=20Pouiller?= Subject: [PATCH v9 18/24] wfx: add data_tx.c/data_tx.h Date: Tue, 11 Jan 2022 18:14:18 +0100 Message-Id: <20220111171424.862764-19-Jerome.Pouiller@silabs.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220111171424.862764-1-Jerome.Pouiller@silabs.com> References: <20220111171424.862764-1-Jerome.Pouiller@silabs.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: base64 X-ClientProxiedBy: SN1PR12CA0099.namprd12.prod.outlook.com (2603:10b6:802:21::34) 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: 3b10a0a0-6f15-4e3b-c0d6-08d9d525f9c7 X-MS-TrafficTypeDiagnostic: PH0PR11MB5657:EE_ X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:5516; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: bF5jULtywjaNqn31fx8HcfUQGtmUNvu5eL9TByh6HRJ0ZK2E+fnDDQPDSgtjUTd4EMHeHqMfdkY5+w0ROdyu89T4D65ZgEiZMsTpuf2dVod1367FBJZpc/8MDjGd5O/APhvz+y8sAwSR/OVfWFxAoJSYtds0sR4DpTmamazs8CA+p9WM7NJLcZCAUUuqGOuVTk7URwhq69k6vqwQ2jn4s64oPPQb0mVV3K32pD8G9IdgrhO/4/uSNbKoP38vVZzEHSp2L7yCXTqhAyCDUfrukCq/JbGG9vjzVNIiGHOd1ZpOm1ojmY3wExelvDkLKNWBPgBBSpgkLaoAMJgzZinahRJrUCquFRDHOLH5SaXI8QRn5nrJ6xFs6YvNmsmzpJaRjRKSz+rqxKrjJokfFHYgyR117s+L1iA3u3KgotZc8QbyCen978teiF0JHlAIzJkndb6tQogdN1Xt78Co85pOkuYFBWuNJUo7x1fVfQ32lFAr7XbpsTDUzOnLswNILV2TngaDgceWlC/0menRvvdetHpUy4tYImrN8ckcHSmSDKHB2WkibF0Vwues0dEbyToHcYoaa+ZMwoh+La5THqZ1rcN5wI5Y7ovmXW2pbyOYVvH5g+nq548sD4jhZp74SiSnyaTR1glx/VSm+hPLU5zQZg== 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:(366004)(6506007)(66574015)(86362001)(5660300002)(8936002)(7416002)(6916009)(8676002)(83380400001)(1076003)(6486002)(36756003)(38100700002)(186003)(66946007)(6666004)(2616005)(4326008)(2906002)(316002)(107886003)(66556008)(66476007)(54906003)(6512007)(508600001)(30864003)(52116002);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?QmFUK3FONFNnWjZPWklZSVI4Zm9NNDJHaUZFTkRmK1B4cURwaUw4bnd4Q0tk?= =?utf-8?B?TVpzbFkxcHhzS08reldxSmE4aWorcXFVUXZ6SWh2VGNvWlJhQVovRldqTXZm?= =?utf-8?B?Wms1QitvSElsSkNkZGtBQWNud3ZWcmJqSXdJRkt2T2Y5ZUpMVU4yRGxoOHFw?= =?utf-8?B?WjBzWEhqUVRCNzR6anRnQVBudmd2OTJVaHozUm5ERW1BQlZSR0FjSHVZamJ6?= =?utf-8?B?ZzdYdTNQN2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B?ZGJpdktXREpZWFhXZlFldUZsR05UWEc4MEFKU2o1R2NWTVRwY2JsUG9sK2RL?= =?utf-8?B?ZHR6UWJsb2hrM3FtMHVnaVdNYmRhVkp2NVRrblRrWit3ZVc3YlJhMG0vU0Ns?= =?utf-8?B?VG9mQ1phcmZCTHR2eDZqVzhwRDNOclpoWDVxdmplWUhYZUJCdEsxaWpSdTZY?= =?utf-8?Q?hEMuXJpPXpNnn9SL722HoExuAcAIXHQy+goXRbkC7M=3D?= X-OriginatorOrg: silabs.com X-MS-Exchange-CrossTenant-Network-Message-Id: 3b10a0a0-6f15-4e3b-c0d6-08d9d525f9c7 X-MS-Exchange-CrossTenant-AuthSource: PH0PR11MB5657.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 11 Jan 2022 17:15:33.4352 (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: qUbbF7MSFJXzvlWvSjNMN78wVxoStrbkTZCT2GAk+1c+CNBZmJlWQ/Y2V2PIdLxei0J8dUilNA4K+AAXvElx7A== X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH0PR11MB5657 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org RnJvbTogSsOpcsO0bWUgUG91aWxsZXIgPGplcm9tZS5wb3VpbGxlckBzaWxhYnMuY29tPgoKU2ln bmVkLW9mZi1ieTogSsOpcsO0bWUgUG91aWxsZXIgPGplcm9tZS5wb3VpbGxlckBzaWxhYnMuY29t PgotLS0KIGRyaXZlcnMvbmV0L3dpcmVsZXNzL3NpbGFicy93ZngvZGF0YV90eC5jIHwgNTcyICsr KysrKysrKysrKysrKysrKysrKysKIGRyaXZlcnMvbmV0L3dpcmVsZXNzL3NpbGFicy93ZngvZGF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