From patchwork Mon May 11 15:49:18 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: 215649 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, 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 94D8BC47255 for ; Mon, 11 May 2020 15:51:42 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 6FAD6206DB for ; Mon, 11 May 2020 15:51:42 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=silabs.onmicrosoft.com header.i=@silabs.onmicrosoft.com header.b="XbKHY8+J" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730795AbgEKPvh (ORCPT ); Mon, 11 May 2020 11:51:37 -0400 Received: from mail-mw2nam12on2062.outbound.protection.outlook.com ([40.107.244.62]:10442 "EHLO NAM12-MW2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726687AbgEKPuB (ORCPT ); Mon, 11 May 2020 11:50:01 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=fpmAOMO7aTGca2MXgrBjUHg7x/ffmIDGbGPB++NEuqu3jNxOlVK5sbzOYkI5Ev0n9P92Zz6uMzLHnyMSsCriFTDQbx8fUS41GTyfcqx8GUXOIqan+8ORupQsaQpdtf5OKUuXHkDRyNOfwyI1AXlWZ98zE3849ZXtNin5pLqVgIwQddQg8uYA/WWF+NzqHyheWtXxpDNQDHfH7PFhUcatPB3JV4w+ECz4HExLLwS4jPwLOkBRTT9Zj+piO0vzHkw4u9pU0cp0tQfeOKRbpW5ftVKwp94nwxYK1wV+lt0IG4lYHoCTSkbgbez83DF1tIK5JQjRuk2Mk2gRmz00eEeJfg== 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=epBE1kciHwXmym6xGqAbE5i2fdsuqZXm9PItDfpAM4BLXF1OWbL7Tmc3i63XlF6cY/wtN5AgTiLuV2M8y7KDedklbd6Dqp4MgarRU4P6u7w/E/0fMr8wLQFG4BYB2HmTEAUPcWQ2YTtjsRoe/ALO6HeciHj8N0l+WvStYyixtc5No9i5nySjXrM1rFoq8WQnhOM/kTk4j0TgerFeUN5dYoWnWJj7l/NeOEfauSwOkrpFUtwXvoqUY0lzg4apgDpU2ppbtc4UXdDBPpsqWyh6AjKENbqvT1pI39qWnHZCCkRV3RqfDbmjZYDUcWVB4jwKFvhy494aMIxH4BAPJtztyA== 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=XbKHY8+JaIv3QCUpsbwo7Z/CVXk5UPSyYKIh/jQkmqL9wwc01rhLZEe5honf1A/KERizKuM2BClA//YBQZ6I8XpKNbbWhWVKks9Ty4PaaajbXnc7RYo8xKW6q6DUPH1QuNKwV8ArCvLZG5Xtpi5CiPFn7IFA/W7cOax/VbaAWa8= 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 MWHPR11MB1968.namprd11.prod.outlook.com (2603:10b6:300:113::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2979.26; Mon, 11 May 2020 15:49:55 +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; Mon, 11 May 2020 15:49:55 +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 05/17] staging: wfx: fix output of rx_stats on big endian hosts Date: Mon, 11 May 2020 17:49:18 +0200 Message-Id: <20200511154930.190212-6-Jerome.Pouiller@silabs.com> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20200511154930.190212-1-Jerome.Pouiller@silabs.com> References: <20200511154930.190212-1-Jerome.Pouiller@silabs.com> X-ClientProxiedBy: SN6PR2101CA0026.namprd21.prod.outlook.com (2603:10b6:805:106::36) 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 SN6PR2101CA0026.namprd21.prod.outlook.com (2603:10b6:805:106::36) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3021.2 via Frontend Transport; Mon, 11 May 2020 15:49:53 +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: 19d212c8-81cf-4553-db22-08d7f5c2f332 X-MS-TrafficTypeDiagnostic: MWHPR11MB1968: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:339; X-Forefront-PRVS: 04004D94E2 X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 5a3JDhFbB53BHdIi+W/XdJbJ77PWNSBqf3jN9r6lHWd26gLd8maZf5F9HjP/yI3+eiAVIXjxmVAxvtEnGvHaAJC7aDdpITwS+kyh14pgDylhxdKZv84nYqGC6hgJAP+EnnHvVcyAVQvTVP649+Z34h2hxY5Wnk9IeLdHM6kyTz9VujFhzHVoGdffY7hAgCTYqNhpM/mb6zkjVG4Z00eU9XGxh2dEu3aVUdOyR6ZnDyxghVlUtp9fMTmFRrxzcXf2+FmgUrhh6UC2KZH5hsRNtRZ5+DKNTuKNL3913n1rJzI444DVPxAoATYvlfaR+ee0j/4IigZaNrPfHllSpDZ7AHZrawnOTqJOAW9OT0HbbWaf0LIcfM3pRRaoGkfm4uXAeiAwXx0xzm+8BXPShcsbIgARkD5/pNoGHNfkoZmbRbt4PiP9cmQnxpi2fpDJYf3zpVaQpy9J/fd6fBWDGJKCiK4o746JoCdyow1aO8kxNPzQPYJFwSgva23+DlJvJXE6f43YFpdDwVBubaskRJ8oVQ== 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:(39850400004)(346002)(136003)(396003)(376002)(366004)(33430700001)(186003)(52116002)(86362001)(316002)(5660300002)(7696005)(6486002)(33440700001)(478600001)(54906003)(6666004)(4326008)(107886003)(66574014)(36756003)(16526019)(26005)(8936002)(956004)(2616005)(8676002)(1076003)(66476007)(66946007)(66556008)(2906002); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData: pAcGrC/zLoRa7wiJ4cPea55oy1sa2w94inHy5LmamKfwO42J5bhQXysjkf6LmK0lZrke3OACrAw0q+HvNPbGpBgrIjGUmnubPJRLpduQ+hqITSeDLjHVavOKGvsKHde69BKzM/Fr7dYxuV/GtLkEAJJ77XmJ0vnHSBTVE7cQ6uqlakiOnYsrjnvDciZLK8a6kye5bPj+SOyr4m27whOQ0XKzYx2SMf22M1fGst9iNepCpSIjjM16pR/29QCUzF0TIE392Yoy5ONQcBwifFVX+E6TneIXEcFvUjM39A8Ut6V3vsC9IlmAYx/GkNnFqC0daO58SbfWmDZNPIbgdxuPzctc2TpzC+HSHxljteKAqnnDqkIES1iHynvUuSzEqFdZ5WMEdXWmhkqVFBnUdWqVrQ8CGBV/P4ltDAT0GHDGrrnm5ZrKfDyRJyvXkExVQi37rFiStzNyweHfNgs0kSKdvVLI8293fUpHhlMZX4Zmr6M= X-OriginatorOrg: silabs.com X-MS-Exchange-CrossTenant-Network-Message-Id: 19d212c8-81cf-4553-db22-08d7f5c2f332 X-MS-Exchange-CrossTenant-OriginalArrivalTime: 11 May 2020 15:49:55.1740 (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: XqSy2d1Fa8hekHvoJsrV3wwQL51xm4ZZlJdvNTBJK/46sbxGeLwA7IzMf0BZ6K7FXyZvqZ8yYw2Km7wZFcU2EA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: MWHPR11MB1968 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);