From patchwork Mon Apr 27 13:40:30 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: 220497 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.8 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 D753BCAB361 for ; Mon, 27 Apr 2020 13:42:01 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id AD826206B6 for ; Mon, 27 Apr 2020 13:42:01 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=silabs.onmicrosoft.com header.i=@silabs.onmicrosoft.com header.b="jYxyC/OA" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728217AbgD0Nl7 (ORCPT ); Mon, 27 Apr 2020 09:41:59 -0400 Received: from mail-mw2nam12on2078.outbound.protection.outlook.com ([40.107.244.78]:6167 "EHLO NAM12-MW2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1728181AbgD0Nlr (ORCPT ); Mon, 27 Apr 2020 09:41:47 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Q+m8A4dkt537S3/+e0Yhi6kWCWCNBlzSx4OyA5+s4UoKGCxvOGFUFsocOc42lHWt79wBYkivluKtwsT1SS69y1MAWZwqusiwProb2egybPXU0Fip0V1yXUJNufUMHNgd08TN8sSwZIu+lbzTtc8IfKtP6GfgopgWF81XuuEQ9gW+7HG/f8zHdeLXNCkaEXIysvTV50BMC3xjoHzUsDaACuwNwOmPmJ6f93+669c6JAtcbu1DPBChKM9i5Nm0Lblbo03+5HABnCEqtpVk65duCvWknMNJs9Y55Ez/di8+acWzwqZRpjk9PVUw4dl+sJ37vNxC3hVv6K9Z2u4qMMPpNA== 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=U4Qf85QInMmItIH52jEcdSx4hflv5Asj3HUCTAdM1jU=; b=UZd0Z97EnilVKjt6MqDEZ5/1uN4az8WdeM9ZfqSEMsNkCmX4Ha8mmTinKHKCvuokJ/TDfN7q6IM1yoDR56c0bwsDeMpaqWWOKV07eBVVVpPMhMIjrmnpTAQgGCmwZ9gbjfWr1O3U2zl30Obiji0to0Bb4bYCff6vQXT9P5cLK89HVVTDXBrohJRSGwS2xsKEsKyamulOqCl5WYA0ycBuMjcWdzZoYL90Xe+Hx2/c1HM/a05P67AgkndO4aXFA9KILlYWRl/NHXQCq5q6CBh4KddaUeOp5+Um04QL6IwhUg/VvZ3Ic/JRDehh3krA2tqFsLMJHHOXX2JZuVWgW7mGRA== 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=U4Qf85QInMmItIH52jEcdSx4hflv5Asj3HUCTAdM1jU=; b=jYxyC/OAyvoD3iX17p7QvSisTkTj13bnCgIo1oXn6rQC3j5C4om5j3SdpmGRAGZjmyJY+A893YBZRMh/kGydtNWaeuMgN4tm65RSimoRzI+wrhO1tQNWbKa8sZlwCadb7LGr7lRHml6lxceBGnW5vp/4VhaFM94JbqGEQONBu+c= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=Jerome.Pouiller@silabs.com; Received: from MWHPR11MB1775.namprd11.prod.outlook.com (2603:10b6:300:10e::14) by MWHPR11MB1424.namprd11.prod.outlook.com (2603:10b6:300:26::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2937.22; Mon, 27 Apr 2020 13:41:45 +0000 Received: from MWHPR11MB1775.namprd11.prod.outlook.com ([fe80::81d5:b62b:3770:ffbe]) by MWHPR11MB1775.namprd11.prod.outlook.com ([fe80::81d5:b62b:3770:ffbe%10]) with mapi id 15.20.2937.023; Mon, 27 Apr 2020 13:41:45 +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 16/17] staging: wfx: fix display of exception indication Date: Mon, 27 Apr 2020 15:40:30 +0200 Message-Id: <20200427134031.323403-17-Jerome.Pouiller@silabs.com> X-Mailer: git-send-email 2.26.1 In-Reply-To: <20200427134031.323403-1-Jerome.Pouiller@silabs.com> References: <20200427134031.323403-1-Jerome.Pouiller@silabs.com> X-ClientProxiedBy: PR0P264CA0232.FRAP264.PROD.OUTLOOK.COM (2603:10a6:100:1e::28) To MWHPR11MB1775.namprd11.prod.outlook.com (2603:10b6:300:10e::14) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from pc-42.home (2a01:e35:2435:66a0:544b:f17b:7ae8:fb7) by PR0P264CA0232.FRAP264.PROD.OUTLOOK.COM (2603:10a6:100:1e::28) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2937.13 via Frontend Transport; Mon, 27 Apr 2020 13:41:42 +0000 X-Mailer: git-send-email 2.26.1 X-Originating-IP: [2a01:e35:2435:66a0:544b:f17b:7ae8:fb7] X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: ca74b27a-f279-4da2-a0fa-08d7eab0b9ba X-MS-TrafficTypeDiagnostic: MWHPR11MB1424: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:7691; X-Forefront-PRVS: 0386B406AA 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:(136003)(39850400004)(376002)(346002)(396003)(366004)(8886007)(66476007)(66556008)(4326008)(81156014)(86362001)(8936002)(6486002)(52116002)(6666004)(6506007)(5660300002)(16526019)(6512007)(1076003)(478600001)(8676002)(36756003)(186003)(2616005)(54906003)(107886003)(2906002)(316002)(66946007); DIR:OUT; SFP:1101; Received-SPF: None (protection.outlook.com: silabs.com does not designate permitted sender hosts) X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 5xis6d1uaPVeI6VEx1aEabKBIGp1o17Acq+U8LrhdMuKiEWuOjlXTsL/Fjod7KAxp6KjyAIn+VJw2MdYTe9JWderKZRteIKGm9B2PKkcPTeaA0xu9Fxizfna4WBsEaWVj0l5dAYAX1+kJaYjHeyx1dOzsewCHMipZjFS9thGdDLp+A5fSL4RAJPIVUNvVtIewgyZHcaDZE5HU7altJmQODnG1gLqI8t7vFcjrKAK377fGMKFTAjAi+WYFeBJYMTr4s1+nb9Z45R82egNqp8tmSGaZQt7+k+WphaM9ydoImB+kFJso+cUkqaQKvgy2+7XlcQgCc0FD4RsZ7cQQDE0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-a0fa-08d7eab0b9ba X-MS-Exchange-CrossTenant-OriginalArrivalTime: 27 Apr 2020 13:41:44.9663 (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: +HPJC8v9Ilapq407cIMrFpD6Ze1uJYMSdekVnQE7J8bQN+BdYAdWM1tGCqAMu2Biuf+zDOc/yCWFksdDFUYW3Q== X-MS-Exchange-Transport-CrossTenantHeadersStamped: MWHPR11MB1424 Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org From: Jérôme Pouiller Until now, the exception received from the chip was only displayed if driver was compiled with DEBUG enabled. It was not very convenient to help users. We prefer to show the exception unconditionally. In add, this patch provides the semantic of the first bytes of the struct. Signed-off-by: Jérôme Pouiller --- drivers/staging/wfx/hif_api_general.h | 11 +++++------ drivers/staging/wfx/hif_rx.c | 12 +++++++++--- 2 files changed, 14 insertions(+), 9 deletions(-) diff --git a/drivers/staging/wfx/hif_api_general.h b/drivers/staging/wfx/hif_api_general.h index 275354eb6b6a..1c010f15c6d0 100644 --- a/drivers/staging/wfx/hif_api_general.h +++ b/drivers/staging/wfx/hif_api_general.h @@ -223,12 +223,6 @@ struct hif_ind_generic { union hif_indication_data indication_data; } __packed; - -struct hif_ind_exception { - u8 data[124]; -} __packed; - - enum hif_error { HIF_ERROR_FIRMWARE_ROLLBACK = 0x0, HIF_ERROR_FIRMWARE_DEBUG_ENABLED = 0x1, @@ -248,6 +242,11 @@ struct hif_ind_error { u8 data[]; } __packed; +struct hif_ind_exception { + __le32 type; + u8 data[]; +} __packed; + enum hif_secure_link_state { SEC_LINK_UNAVAILABLE = 0x0, SEC_LINK_RESERVED = 0x1, diff --git a/drivers/staging/wfx/hif_rx.c b/drivers/staging/wfx/hif_rx.c index e6daac36f5c8..783f301d58a8 100644 --- a/drivers/staging/wfx/hif_rx.c +++ b/drivers/staging/wfx/hif_rx.c @@ -331,10 +331,16 @@ static int hif_generic_indication(struct wfx_dev *wdev, static int hif_exception_indication(struct wfx_dev *wdev, const struct hif_msg *hif, const void *buf) { - size_t len = hif->len - 4; // drop header + const struct hif_ind_exception *body = buf; + int type = le32_to_cpu(body->type); - dev_err(wdev->dev, "firmware exception\n"); - print_hex_dump_bytes("Dump: ", DUMP_PREFIX_NONE, buf, len); + if (type == 4) + dev_err(wdev->dev, "firmware assert %d\n", + le32_to_cpup((__le32 *)body->data)); + else + dev_err(wdev->dev, "firmware exception\n"); + print_hex_dump(KERN_INFO, "hif: ", DUMP_PREFIX_OFFSET, + 16, 1, hif, hif->len, false); wdev->chip_frozen = true; return -1;