From patchwork Tue May 12 15:04:02 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: 215632 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=-9.7 required=3.0 tests=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=ham 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 718B1C54E4A for ; Tue, 12 May 2020 15:04:52 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 47C212082E for ; Tue, 12 May 2020 15:04:52 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=silabs.onmicrosoft.com header.i=@silabs.onmicrosoft.com header.b="jnUZVjAJ" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726055AbgELPEv (ORCPT ); Tue, 12 May 2020 11:04:51 -0400 Received: from mail-bn8nam12on2076.outbound.protection.outlook.com ([40.107.237.76]:45896 "EHLO NAM12-BN8-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726168AbgELPEs (ORCPT ); Tue, 12 May 2020 11:04:48 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=aSdsgPOWEvufnSyxNmR8KkInYndb8xWZllP7sBz0Bjvb48NOCGMwO/QQhGn0LIHIxYTsZ6JZN4xT1cSwlHGd6u4uYqB5Zrkko4dkiPlfMMDQf3/HCO73BJppB9Y0bhzIoy2P6XyiP8c2Qj15Y/I04w/LHSmrxGj8VFAY6X4bOgjmJZvo7PakXP+yiSdVEnRAUdXmX5sO7afstdPW1C5o3B6ZI8SiVK2w3EqR5mmBnksLAAXlHbk6DqjZ3c3M+k+ZgTdDPlL35fIgB/ZoaIgpje5jmaYSmsL4/fxGVAJ91mRjMmjNI+3C05FD1RyajvHGZD5QE2HQ9Fr1xJMKY0WsfA== 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=Q94uY3wIDAIJbStr9gu9gHlUoS5rWPgP9Bsj/iZkXP4=; b=AEXy55pmjEp6LuWI/5Y8hfjIGMAA70jo5RF8VvTo5Rx1UaYaDQNJNBDxIk2FUnyyfQ9Z0krRmd9gpRwtXabujmgUdC3g4GpKlZI8S1WRESloDC5/+iLgXRat8Vn5kdwDzSO4LeHpOjIMfC4HjVdPXS0k6eRIR4+19cTe2I51SiMaZ6ymqxgSJSuT5CMXXClw+YGCscXlgInRb/m0BkE8u16c0fQmBrqQNxXjJZQg3dzz/5wlQ+NWDEoEVDi3k66HFfemLaWiXBbdxUXE6/3wJix3X7QvE5WGqjJd9+z/GaZqCrO3DMzpfE+X8h3s4YbDbb2xAoE+1UNaO+zFt4YOzQ== 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=Q94uY3wIDAIJbStr9gu9gHlUoS5rWPgP9Bsj/iZkXP4=; b=jnUZVjAJ9L8I6wRekqiptSLmQEihFhp9jZBxXgUP7IrQdmf1Kd9/eQPNThTbpJ/KUUUs0GYUEZ31JV7B2gzxgqT+nkui9TYR0G5qQYuQ0rnXW3XFYcbDFGwTgsHurDHTSRIIgE1ZkoUW8Z+NxRuzrnm2VH2KGsc9Xr1Cfdq+rrw= 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 MWHPR11MB1775.namprd11.prod.outlook.com (2603:10b6:300:10e::14) by MWHPR11MB1741.namprd11.prod.outlook.com (2603:10b6:300:10d::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2979.34; Tue, 12 May 2020 15:04:40 +0000 Received: from MWHPR11MB1775.namprd11.prod.outlook.com ([fe80::e055:3e6d:ff4:56da]) by MWHPR11MB1775.namprd11.prod.outlook.com ([fe80::e055:3e6d:ff4:56da%5]) with mapi id 15.20.2979.033; Tue, 12 May 2020 15:04:40 +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 v2 05/17] staging: wfx: fix output of rx_stats on big endian hosts Date: Tue, 12 May 2020 17:04:02 +0200 Message-Id: <20200512150414.267198-6-Jerome.Pouiller@silabs.com> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20200512150414.267198-1-Jerome.Pouiller@silabs.com> References: <20200512150414.267198-1-Jerome.Pouiller@silabs.com> X-ClientProxiedBy: DM5PR1101CA0003.namprd11.prod.outlook.com (2603:10b6:4:4c::13) To MWHPR11MB1775.namprd11.prod.outlook.com (2603:10b6:300:10e::14) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from pc-42.silabs.com (82.67.86.106) by DM5PR1101CA0003.namprd11.prod.outlook.com (2603:10b6:4:4c::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3000.20 via Frontend Transport; Tue, 12 May 2020 15:04:38 +0000 X-Mailer: git-send-email 2.26.2 X-Originating-IP: [82.67.86.106] X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: d29f5e09-9661-4cd7-bb0b-08d7f685cb36 X-MS-TrafficTypeDiagnostic: MWHPR11MB1741: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:339; X-Forefront-PRVS: 0401647B7F X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 8Sj7ehGfJwg1deZiPSLBLQqHPmkeVDIq99Fy2HXmoXTjN7U2R4+47HmOCEfLsWDO2i+qBKk4yLu3wDkIrfwq6jb3Ft2csPR7Jq8TN/u3Q9lXAv2gFMN2aUagLgFOzj9nk5EqCG7CmOx2mYW1Ep8UkCNE2qA4XizpzuUPyjH1vFCbFmSmdtbRWmg6uSqFGjUpPu5CLOKeF9Z9bVDNMa30PZsRnLoaWXdUAazLquklpNKW9b3nEQl9y3YRUt/6j+nWvEY86nj0Suj6fuxaG7kksanqysoYSSxMWKQihJGAMP+ygS79/2rGdyVv/VWfVFqDgU+Y+5Ef1iJ6GH2J28kdsNPXJIh7FR8tTIZpW6HCmAzvkV6DrRT2SS4QGp9jeZcuOFWdPfB5nb0QLe0eEBxpzwfMnQkstbboJpHwoal4AhpmjC6cbNIUWIsdfcxk1e3pY2mRt71JI4yB+wVb94KkVP5rLeBHrVMbWhbq0mRyKgeHw2XZB2Ke+GLskTC7LIdD3x1knom996y/buNxHaTXww== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:MWHPR11MB1775.namprd11.prod.outlook.com; PTR:; CAT:NONE; SFTY:; SFS:(396003)(366004)(376002)(39860400002)(346002)(136003)(33430700001)(54906003)(107886003)(478600001)(8676002)(5660300002)(316002)(1076003)(956004)(8936002)(2616005)(186003)(2906002)(7696005)(86362001)(4326008)(52116002)(6666004)(6486002)(66476007)(66574014)(26005)(66946007)(66556008)(33440700001)(16526019)(36756003); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData: 6ojtYiK/oD/v5MoaUzGYcTxON6cFloKwHwa+LbJPpFqNWHtCd/wVGf91RZwCo9LJa9KuvfbCAI8lmko/O3fTztSjJFkyik6PkjRPJ3Dkct1GMMX3Gwtr0YIZ19IHcOhSJHpnP3g2pyOkfi0nLVWKL7cOFQ3U6DkDeDA0L9esZJhW+t66EHyJFeDKET6srP62cdg51+Yeht5X0sIuPoF9Cc/oWpayKSMzmMx3/fuwJ0E+BCdLFNDkYV3/3oUUoLcKOfr3ACYzVDFs8Kb5YYiOukaVn/svRv8BlHTEfCiqwFn+230lKIuzaLSVNtpyJEmhE89fq3nJO15GFjUeN1KNIx7KO0kMZ4nJytTNWH0Rbahl/bWQd45pxLROpHJG2RDqKuto+9XU2KQ4fnJG2bjweoGLYDC+UyqBnDNXftMMFaGW90rWArmXXILzlVl1zbXTWo7zphCPKOnfoZfrB/zcXqZAEb9DnztZ7dA8F7pr2SM= X-OriginatorOrg: silabs.com X-MS-Exchange-CrossTenant-Network-Message-Id: d29f5e09-9661-4cd7-bb0b-08d7f685cb36 X-MS-Exchange-CrossTenant-OriginalArrivalTime: 12 May 2020 15:04:39.8978 (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: ivdpbbHyLD4Brp5wqjyrN0veiql6iSk71NrQAg5BZYFVK1oNMZT96U+vKTRuzRQ9atSSbOrFvVCtfTCqXaqcCA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: MWHPR11MB1741 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 struct hif_rx_stats contains only little endian values. Thus, it is necessary to fix byte ordering before to use them. Signed-off-by: Jérôme Pouiller --- drivers/staging/wfx/debug.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/drivers/staging/wfx/debug.c b/drivers/staging/wfx/debug.c index 2fae6c913b01..846a0b29f8c9 100644 --- a/drivers/staging/wfx/debug.c +++ b/drivers/staging/wfx/debug.c @@ -155,7 +155,7 @@ static int wfx_rx_stats_show(struct seq_file *seq, void *v) mutex_lock(&wdev->rx_stats_lock); seq_printf(seq, "Timestamp: %dus\n", st->date); seq_printf(seq, "Low power clock: frequency %uHz, external %s\n", - st->pwr_clk_freq, + le32_to_cpu(st->pwr_clk_freq), st->is_ext_pwr_clk ? "yes" : "no"); seq_printf(seq, "Num. of frames: %d, PER (x10e4): %d, Throughput: %dKbps/s\n", @@ -165,9 +165,12 @@ static int wfx_rx_stats_show(struct seq_file *seq, void *v) for (i = 0; i < ARRAY_SIZE(channel_names); i++) { if (channel_names[i]) seq_printf(seq, "%5s %8d %8d %8d %8d %8d\n", - channel_names[i], st->nb_rx_by_rate[i], - st->per[i], st->rssi[i] / 100, - st->snr[i] / 100, st->cfo[i]); + channel_names[i], + le32_to_cpu(st->nb_rx_by_rate[i]), + le16_to_cpu(st->per[i]), + (s16)le16_to_cpu(st->rssi[i]) / 100, + (s16)le16_to_cpu(st->snr[i]) / 100, + (s16)le16_to_cpu(st->cfo[i])); } mutex_unlock(&wdev->rx_stats_lock);