From patchwork Thu Sep 19 13:52:36 2019 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: 1164656 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: patchwork-incoming-netdev@ozlabs.org Delivered-To: patchwork-incoming-netdev@ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=vger.kernel.org (client-ip=209.132.180.67; helo=vger.kernel.org; envelope-from=netdev-owner@vger.kernel.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=silabs.com Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=silabs.onmicrosoft.com header.i=@silabs.onmicrosoft.com header.b="II4FiMa3"; dkim-atps=neutral Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 46Yyxv4YXfz9sPq for ; Thu, 19 Sep 2019 23:54:11 +1000 (AEST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2390618AbfISNxp (ORCPT ); Thu, 19 Sep 2019 09:53:45 -0400 Received: from mail-eopbgr790080.outbound.protection.outlook.com ([40.107.79.80]:37760 "EHLO NAM03-CO1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S2403827AbfISNwu (ORCPT ); Thu, 19 Sep 2019 09:52:50 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=EikDuzOqHSsbXUZt8DyT364k75Njg2Q8wt0752FegdgNhaAAA4luVGqljag5ScXelDzrZd6Hc7S2u5x4WX4U/P8BlB/fJtnNhcVDlZ3PJ3vKyd9570ikKKIhCUG97eM6knvmN/P9l/DU+Pj24g1nJ3jGGW8J1O+srTOhoEIF0eyifBjt6Dh8COloDPZ7a5L9CVnA62vcJnCKLYPvnEA3ZmlFoE17gKwIVZKMdpOrnD/wztY1CCUktekF7PonZ75Dj6gDj97oTrmv0tvJuG3wBadsNibFUbtZg/Ai/JAPpnlCmNOCS0rzm1dRUz9dEsjjzF+vWmFZT6WIqZtm1/gDeQ== 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=vdL9KYE7hw1kkZQvNbREpyU5YHnYZt0e/MRBKP+5NrA=; b=CQ5kf4qcrfvBgoMy5obzFF5gjOS9uls8P8OlsmwIMyD8p7GAsDvKHlMNikHLi6U89IAiWDoS3/nWIoJUnNNL8uPAIWAe4cvZUNwcceXcoCn/46NNpcsuAlQz9mkhQ40zmUqqSV3fn7GThKiQHEtCxKIj/W3P8EzPopGfXtJ6qD8BJ/u7nUSF6K6ch4sOU8d0NkPWZtJSzyXdZ31ZfL16kQ5jJi5R5JdEUsMtOjvlR8EeAxAr216gRcOUX3Gkcvb/0svsU24Rd/A6f7Ilj6p13TFHndncYXxHg4y+9CZcLevEd8BfHW+D8zIqz9sjzb7slnsnKFyk9fAgvlM2HUFfHg== 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=vdL9KYE7hw1kkZQvNbREpyU5YHnYZt0e/MRBKP+5NrA=; b=II4FiMa388qudPQ6Og/5ZPclyxsndjNHVoZZgEI/QSuV291oRFLVb6lmN+E2xtrIC/8dVUrmgwr6FAOaqWMMzVFm/CrWFglaDP1wLmr38J6A+yG4kbKoBFVuuGMyle4WbZc0l09X5CLxwFi3Un0x23thE6oC7dQZgdToj/vIa2g= Received: from MN2PR11MB4063.namprd11.prod.outlook.com (20.179.149.217) by MN2PR11MB4400.namprd11.prod.outlook.com (52.135.37.204) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2263.20; Thu, 19 Sep 2019 13:52:37 +0000 Received: from MN2PR11MB4063.namprd11.prod.outlook.com ([fe80::45dc:e073:4446:4bf8]) by MN2PR11MB4063.namprd11.prod.outlook.com ([fe80::45dc:e073:4446:4bf8%3]) with mapi id 15.20.2263.023; Thu, 19 Sep 2019 13:52:37 +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" , David Le Goff , Jerome Pouiller Subject: [PATCH v2 11/20] staging: wfx: allow to send commands to chip Thread-Topic: [PATCH v2 11/20] staging: wfx: allow to send commands to chip Thread-Index: AQHVbvF+KYrGFmVZ8k+on9y/ZhtAIQ== Date: Thu, 19 Sep 2019 13:52:36 +0000 Message-ID: <20190919135220.30663-12-Jerome.Pouiller@silabs.com> References: <20190919135220.30663-1-Jerome.Pouiller@silabs.com> In-Reply-To: <20190919135220.30663-1-Jerome.Pouiller@silabs.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: spf=none (sender IP is ) smtp.mailfrom=Jerome.Pouiller@silabs.com; x-originating-ip: [37.71.187.125] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: a6830ef2-fca3-4fed-eaac-08d73d08a170 x-microsoft-antispam: BCL:0; PCL:0; RULEID:(2390118)(7020095)(4652040)(8989299)(5600167)(711020)(4605104)(1401327)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(2017052603328)(7193020); SRVR:MN2PR11MB4400; x-ms-traffictypediagnostic: MN2PR11MB4400: x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:39; x-forefront-prvs: 016572D96D x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(1496009)(376002)(39850400004)(136003)(366004)(396003)(346002)(189003)(199004)(3846002)(76176011)(8676002)(76116006)(476003)(25786009)(2616005)(6116002)(54906003)(71190400001)(6436002)(102836004)(6486002)(36756003)(186003)(71200400001)(26005)(305945005)(6512007)(99286004)(6506007)(91956017)(7736002)(446003)(8936002)(256004)(81156014)(14444005)(2906002)(66066001)(30864003)(107886003)(4326008)(86362001)(14454004)(478600001)(64756008)(81166006)(2501003)(486006)(66574012)(316002)(66946007)(66446008)(66556008)(5660300002)(11346002)(66476007)(1076003)(110136005); DIR:OUT; SFP:1101; SCL:1; SRVR:MN2PR11MB4400; H:MN2PR11MB4063.namprd11.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; MX:1; A:1; received-spf: None (protection.outlook.com: silabs.com does not designate permitted sender hosts) x-ms-exchange-senderadcheck: 1 x-microsoft-antispam-message-info: SfytsjDv3xX6hifMXGHsVzKrzSpv7Z663z8yJWT29nhp8B5n84yvrEVSZ/AOq2JZPEdYC0SIvPVEPnDayp/MKYA8GU3j0ory0nNxyW7eGKoJg1KiScYOMbWFxz42gid1gscgWlPwc5RtaDYjUlxZDjfRjy0EDZ3CPlwj/ZIrZZGSI6dKBrEB94mSgyrk9wVyngzQftaYJEeddShosnfjO6CSTy12wYfboWGopL5sq6n8gWfEI65Uu2TRbkuuxPyVoUiwEpYZMGsEDJu27i7z/tWt/M/i+Shb1VefXofELWK5pr+iQymw8TOIp5HaqwZCYteSRZPvkOtP2KMKkzGwKrVmuA+UMDRbHvqYZ1J7ArZp3sSK44ewfu8533e3/+qk3JPZdEHA7MEHJYzCS9sd6IufXsqbKkGdIDzUOLAQM28= Content-ID: <412A5FAA72A8F140B515B0F3A2A41B36@namprd11.prod.outlook.com> MIME-Version: 1.0 X-OriginatorOrg: silabs.com X-MS-Exchange-CrossTenant-Network-Message-Id: a6830ef2-fca3-4fed-eaac-08d73d08a170 X-MS-Exchange-CrossTenant-originalarrivaltime: 19 Sep 2019 13:52:36.1466 (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: sUIPzviKnedD95BRtRZKpSWzgTNtS4GUZ2G2j0yr9lpgvPChPBO2T458MOJIYZ5ZgGFv0IU/F3EjUVAzGF7tqg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN2PR11MB4400 Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org From: Jérôme Pouiller Chip has multiple input buffers and can handle multiple 802.11 frames in parallel. However, other HIF command must be sent sequentially. wsm_send_cmd() handles these requests. This commit also add send_hif_cmd in debugfs. This file allows to send arbitrary commands to chip. It can be used for debug and testing. Signed-off-by: Jérôme Pouiller --- drivers/staging/wfx/Makefile | 1 + drivers/staging/wfx/bh.c | 5 +- drivers/staging/wfx/debug.c | 130 +++++++++++++++++++++++++++++++++++ drivers/staging/wfx/debug.h | 4 ++ drivers/staging/wfx/hif_rx.c | 45 ++++++++++++ drivers/staging/wfx/hif_tx.c | 87 +++++++++++++++++++++++ drivers/staging/wfx/hif_tx.h | 33 +++++++++ drivers/staging/wfx/main.c | 1 + drivers/staging/wfx/wfx.h | 4 ++ 9 files changed, 309 insertions(+), 1 deletion(-) create mode 100644 drivers/staging/wfx/hif_tx.c create mode 100644 drivers/staging/wfx/hif_tx.h diff --git a/drivers/staging/wfx/Makefile b/drivers/staging/wfx/Makefile index 2896a2127c88..e158589468a3 100644 --- a/drivers/staging/wfx/Makefile +++ b/drivers/staging/wfx/Makefile @@ -7,6 +7,7 @@ wfx-y := \ bh.o \ hwio.o \ fwio.o \ + hif_tx.o \ hif_rx.o \ main.o \ sta.o \ diff --git a/drivers/staging/wfx/bh.c b/drivers/staging/wfx/bh.c index c40da3f1f25d..c94c9c401a69 100644 --- a/drivers/staging/wfx/bh.c +++ b/drivers/staging/wfx/bh.c @@ -190,7 +190,10 @@ static int bh_work_tx(struct wfx_dev *wdev, int max_msg) for (i = 0; i < max_msg; i++) { hif = NULL; if (wdev->hif.tx_buffers_used < wdev->hw_caps.num_inp_ch_bufs) { - /* FIXME: get queued data */ + if (try_wait_for_completion(&wdev->hif_cmd.ready)) { + WARN(!mutex_is_locked(&wdev->hif_cmd.lock), "data locking error"); + hif = wdev->hif_cmd.buf_send; + } } if (!hif) return i; diff --git a/drivers/staging/wfx/debug.c b/drivers/staging/wfx/debug.c index f28c94d8de89..0a328c96eaa0 100644 --- a/drivers/staging/wfx/debug.c +++ b/drivers/staging/wfx/debug.c @@ -7,16 +7,146 @@ */ #include +#include "debug.h" #include "wfx.h" #define CREATE_TRACE_POINTS #include "traces.h" +static const struct trace_print_flags hif_msg_print_map[] = { + hif_msg_list, +}; + +static const struct trace_print_flags hif_mib_print_map[] = { + hif_mib_list, +}; + +static const struct trace_print_flags wfx_reg_print_map[] = { + wfx_reg_list, +}; + +static const char *get_symbol(unsigned long val, + const struct trace_print_flags *symbol_array) +{ + int i; + + for (i = 0; symbol_array[i].mask != -1; i++) { + if (val == symbol_array[i].mask) + return symbol_array[i].name; + } + + return "unknown"; +} + +const char *get_hif_name(unsigned long id) +{ + return get_symbol(id, hif_msg_print_map); +} + +const char *get_mib_name(unsigned long id) +{ + return get_symbol(id, hif_mib_print_map); +} + +const char *get_reg_name(unsigned long id) +{ + return get_symbol(id, wfx_reg_print_map); +} + +struct dbgfs_hif_msg { + struct wfx_dev *wdev; + struct completion complete; + u8 reply[1024]; + int ret; +}; + +static ssize_t wfx_send_hif_msg_write(struct file *file, const char __user *user_buf, + size_t count, loff_t *ppos) +{ + struct dbgfs_hif_msg *context = file->private_data; + struct wfx_dev *wdev = context->wdev; + struct hif_msg *request; + + if (completion_done(&context->complete)) { + dev_dbg(wdev->dev, "read previous result before start a new one\n"); + return -EBUSY; + } + if (count < sizeof(struct hif_msg)) + return -EINVAL; + + // wfx_cmd_send() chekc that reply buffer is wide enough, but do not + // return precise length read. User have to know how many bytes should + // be read. Filling reply buffer with a memory pattern may help user. + memset(context->reply, sizeof(context->reply), 0xFF); + request = memdup_user(user_buf, count); + if (IS_ERR(request)) + return PTR_ERR(request); + if (request->len != count) { + kfree(request); + return -EINVAL; + } + context->ret = wfx_cmd_send(wdev, request, context->reply, sizeof(context->reply), false); + + kfree(request); + complete(&context->complete); + return count; +} + +static ssize_t wfx_send_hif_msg_read(struct file *file, char __user *user_buf, + size_t count, loff_t *ppos) +{ + struct dbgfs_hif_msg *context = file->private_data; + int ret; + + if (count > sizeof(context->reply)) + return -EINVAL; + ret = wait_for_completion_interruptible(&context->complete); + if (ret) + return ret; + if (context->ret < 0) + return context->ret; + // Be carefull, write() is waiting for a full message while read() + // only return a payload + ret = copy_to_user(user_buf, context->reply, count); + if (ret) + return ret; + + return count; +} + +static int wfx_send_hif_msg_open(struct inode *inode, struct file *file) +{ + struct dbgfs_hif_msg *context = kzalloc(sizeof(*context), GFP_KERNEL); + + if (!context) + return -ENOMEM; + context->wdev = inode->i_private; + init_completion(&context->complete); + file->private_data = context; + return 0; +} + +static int wfx_send_hif_msg_release(struct inode *inode, struct file *file) +{ + struct dbgfs_hif_msg *context = file->private_data; + + kfree(context); + return 0; +} + +static const struct file_operations wfx_send_hif_msg_fops = { + .open = wfx_send_hif_msg_open, + .release = wfx_send_hif_msg_release, + .write = wfx_send_hif_msg_write, + .read = wfx_send_hif_msg_read, +}; + int wfx_debug_init(struct wfx_dev *wdev) { struct dentry *d; d = debugfs_create_dir("wfx", wdev->hw->wiphy->debugfsdir); + debugfs_create_file("send_hif_msg", 0600, d, wdev, &wfx_send_hif_msg_fops); return 0; } diff --git a/drivers/staging/wfx/debug.h b/drivers/staging/wfx/debug.h index 8bfba1a9fa20..6f2f84d64c9e 100644 --- a/drivers/staging/wfx/debug.h +++ b/drivers/staging/wfx/debug.h @@ -12,4 +12,8 @@ struct wfx_dev; int wfx_debug_init(struct wfx_dev *wdev); +const char *get_hif_name(unsigned long id); +const char *get_mib_name(unsigned long id); +const char *get_reg_name(unsigned long id); + #endif /* WFX_DEBUG_H */ diff --git a/drivers/staging/wfx/hif_rx.c b/drivers/staging/wfx/hif_rx.c index 5c207e6d4348..ba8ea4f3c91b 100644 --- a/drivers/staging/wfx/hif_rx.c +++ b/drivers/staging/wfx/hif_rx.c @@ -13,6 +13,43 @@ #include "wfx.h" #include "hif_api_cmd.h" +static int hif_generic_confirm(struct wfx_dev *wdev, struct hif_msg *hif, void *buf) +{ + // All confirm messages start with status + int status = le32_to_cpu(*((__le32 *) buf)); + int cmd = hif->id; + int len = hif->len - 4; // drop header + + WARN(!mutex_is_locked(&wdev->hif_cmd.lock), "data locking error"); + + if (!wdev->hif_cmd.buf_send) { + dev_warn(wdev->dev, "unexpected confirmation: 0x%.2x\n", cmd); + return -EINVAL; + } + + if (cmd != wdev->hif_cmd.buf_send->id) { + dev_warn(wdev->dev, "chip response mismatch request: 0x%.2x vs 0x%.2x\n", + cmd, wdev->hif_cmd.buf_send->id); + return -EINVAL; + } + + if (wdev->hif_cmd.buf_recv) { + if (wdev->hif_cmd.len_recv >= len) + memcpy(wdev->hif_cmd.buf_recv, buf, len); + else + status = -ENOMEM; + } + wdev->hif_cmd.ret = status; + + if (!wdev->hif_cmd.async) { + complete(&wdev->hif_cmd.done); + } else { + wdev->hif_cmd.buf_send = NULL; + mutex_unlock(&wdev->hif_cmd.lock); + } + return status; +} + static int hif_startup_indication(struct wfx_dev *wdev, struct hif_msg *hif, void *buf) { struct hif_ind_startup *body = buf; @@ -44,6 +81,14 @@ void wfx_handle_rx(struct wfx_dev *wdev, struct sk_buff *skb) struct hif_msg *hif = (struct hif_msg *) skb->data; int hif_id = hif->id; + // Note: mutex_is_lock cause an implicit memory barrier that protect + // buf_send + if (mutex_is_locked(&wdev->hif_cmd.lock) + && wdev->hif_cmd.buf_send + && wdev->hif_cmd.buf_send->id == hif_id) { + hif_generic_confirm(wdev, hif, hif->body); + goto free; + } for (i = 0; i < ARRAY_SIZE(hif_handlers); i++) { if (hif_handlers[i].msg_id == hif_id) { if (hif_handlers[i].handler) diff --git a/drivers/staging/wfx/hif_tx.c b/drivers/staging/wfx/hif_tx.c new file mode 100644 index 000000000000..f81a19089db4 --- /dev/null +++ b/drivers/staging/wfx/hif_tx.c @@ -0,0 +1,87 @@ +// SPDX-License-Identifier: GPL-2.0-only +/* + * Implementation of host-to-chip commands (aka request/confirmation) of WFxxx + * Split Mac (WSM) API. + * + * Copyright (c) 2017-2019, Silicon Laboratories, Inc. + * Copyright (c) 2010, ST-Ericsson + */ +#include +#include + +#include "hif_tx.h" +#include "wfx.h" +#include "bh.h" +#include "debug.h" + +void wfx_init_hif_cmd(struct wfx_hif_cmd *hif_cmd) +{ + init_completion(&hif_cmd->ready); + init_completion(&hif_cmd->done); + mutex_init(&hif_cmd->lock); +} + +int wfx_cmd_send(struct wfx_dev *wdev, struct hif_msg *request, void *reply, size_t reply_len, bool async) +{ + const char *mib_name = ""; + const char *mib_sep = ""; + int cmd = request->id; + int vif = request->interface; + int ret; + + WARN(wdev->hif_cmd.buf_recv && wdev->hif_cmd.async, "API usage error"); + + // Do not wait for any reply if chip is frozen + if (wdev->chip_frozen) + return -ETIMEDOUT; + + mutex_lock(&wdev->hif_cmd.lock); + WARN(wdev->hif_cmd.buf_send, "data locking error"); + + // Note: call to complete() below has an implicit memory barrier that + // hopefully protect buf_send + wdev->hif_cmd.buf_send = request; + wdev->hif_cmd.buf_recv = reply; + wdev->hif_cmd.len_recv = reply_len; + wdev->hif_cmd.async = async; + complete(&wdev->hif_cmd.ready); + + wfx_bh_request_tx(wdev); + + // NOTE: no timeout is catched async is enabled + if (async) + return 0; + + ret = wait_for_completion_timeout(&wdev->hif_cmd.done, 1 * HZ); + if (!ret) { + dev_err(wdev->dev, "chip is abnormally long to answer\n"); + reinit_completion(&wdev->hif_cmd.ready); + ret = wait_for_completion_timeout(&wdev->hif_cmd.done, 3 * HZ); + } + if (!ret) { + dev_err(wdev->dev, "chip did not answer\n"); + wdev->chip_frozen = 1; + reinit_completion(&wdev->hif_cmd.done); + ret = -ETIMEDOUT; + } else { + ret = wdev->hif_cmd.ret; + } + + wdev->hif_cmd.buf_send = NULL; + mutex_unlock(&wdev->hif_cmd.lock); + + if (ret && (cmd == HIF_REQ_ID_READ_MIB || cmd == HIF_REQ_ID_WRITE_MIB)) { + mib_name = get_mib_name(((u16 *) request)[2]); + mib_sep = "/"; + } + if (ret < 0) + dev_err(wdev->dev, + "WSM request %s%s%s (%#.2x) on vif %d returned error %d\n", + get_hif_name(cmd), mib_sep, mib_name, cmd, vif, ret); + if (ret > 0) + dev_warn(wdev->dev, + "WSM request %s%s%s (%#.2x) on vif %d returned status %d\n", + get_hif_name(cmd), mib_sep, mib_name, cmd, vif, ret); + + return ret; +} diff --git a/drivers/staging/wfx/hif_tx.h b/drivers/staging/wfx/hif_tx.h new file mode 100644 index 000000000000..ccf2b7e5e851 --- /dev/null +++ b/drivers/staging/wfx/hif_tx.h @@ -0,0 +1,33 @@ +/* SPDX-License-Identifier: GPL-2.0-only */ +/* + * Implementation of host-to-chip commands (aka request/confirmation) of WFxxx + * Split Mac (WSM) API. + * + * Copyright (c) 2017-2019, Silicon Laboratories, Inc. + * Copyright (c) 2010, ST-Ericsson + * Copyright (C) 2010, ST-Ericsson SA + */ +#ifndef WFX_HIF_TX_H +#define WFX_HIF_TX_H + +#include "hif_api_cmd.h" + +struct wfx_dev; +struct wfx_vif; + +struct wfx_hif_cmd { + struct mutex lock; + struct completion ready; + struct completion done; + bool async; + struct hif_msg *buf_send; + void *buf_recv; + size_t len_recv; + int ret; +}; + +void wfx_init_hif_cmd(struct wfx_hif_cmd *wfx_hif_cmd); +int wfx_cmd_send(struct wfx_dev *wdev, struct hif_msg *request, + void *reply, size_t reply_len, bool async); + +#endif diff --git a/drivers/staging/wfx/main.c b/drivers/staging/wfx/main.c index ca0ca873bd7d..8973eeb60eb8 100644 --- a/drivers/staging/wfx/main.c +++ b/drivers/staging/wfx/main.c @@ -115,6 +115,7 @@ struct wfx_dev *wfx_init_common(struct device *dev, memcpy(&wdev->pdata, pdata, sizeof(*pdata)); init_completion(&wdev->firmware_ready); + wfx_init_hif_cmd(&wdev->hif_cmd); return wdev; } diff --git a/drivers/staging/wfx/wfx.h b/drivers/staging/wfx/wfx.h index a7e571e0da30..bf9de11f8896 100644 --- a/drivers/staging/wfx/wfx.h +++ b/drivers/staging/wfx/wfx.h @@ -15,6 +15,7 @@ #include "bh.h" #include "main.h" +#include "hif_tx.h" #include "hif_api_general.h" struct hwbus_ops; @@ -32,6 +33,9 @@ struct wfx_dev { struct completion firmware_ready; struct hif_ind_startup hw_caps; struct wfx_hif hif; + int chip_frozen; + + struct wfx_hif_cmd hif_cmd; }; struct wfx_vif {