From patchwork Thu Sep 19 13:52:37 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: 1164663 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="GS70Lrw4"; dkim-atps=neutral Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 46Yyyj2mwHz9sQw for ; Thu, 19 Sep 2019 23:54:53 +1000 (AEST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2390729AbfISNyt (ORCPT ); Thu, 19 Sep 2019 09:54:49 -0400 Received: from mail-eopbgr800072.outbound.protection.outlook.com ([40.107.80.72]:49376 "EHLO NAM03-DM3-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S2388145AbfISNwm (ORCPT ); Thu, 19 Sep 2019 09:52:42 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=eKo+9y3BFtwY7cBtY4Z+48u7UbWuhnWECJwPjQyCEseKzqzIr876JUFn97u341cEkU6KtKIFNMFZgFJNnkDRVkzhLbo3Tz81PXXCAg0iUFpc+vqiwiC85+GSke75mdCH93hlq/dc/9NYR9CI+ytmXpUVDBkTaP1fFEMxiRRSBs2OpcPig0rX4v4sOxZSYmKsFwUJUKyz3vyzRYXVJWwjVgN5aXxZ1VNnhqExI1+YnSOkxPb9pA7h8LyXfN16m/I5Q/J3i82ZQECkYjDSbc6hvA6K9E8sEx6oWhjuxCULTctBTe/v/rJRV+4Tf6KO4GxLWwbNQJgnj3Rp746RVn57Dg== 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=C16t5u2fKbZMsb1XpkROFbJsoHmvNiTqn1575XyqEhE=; b=Hs0mf/KNXxqaz0GLKoZkPn7xhBAvJtVJRXPXto/QemXIJSuPfo0cRzPEk4xIUyXe/8ZyjMN6jbFMbd7ODLvdMEhVErGhI0ylsFCu+sL+B6q1bkcAJnAQWuLwiwn55N3WJFjTC5mSumkqTm1zOaIZMcS7fI6ieEcDpM9KGsvOlDvncn0PCPF7mBl00my+DvAHznLD3yd6JzvHhs/1pHeuzvTZhinxbsCvzvvms1Us82v/iaFyr6c2b+R0g6r9OcjgcLECe+KVxlWn7pCI7Ou1a6nwBf2hTBrbB2OY/5NN9/PFqFyRnwgrDf2cfi1JAyMCEAbTls2Z3Kxy1/I/TDSsEA== 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=C16t5u2fKbZMsb1XpkROFbJsoHmvNiTqn1575XyqEhE=; b=GS70Lrw4i23jpntnl3YsRlsFBMVgEPyNOTo7D/+ybvnULt/gvlnfKnS+cAlJHGpuuAxQ4AigLXUnOOY/Nafl6TWpPWpWppN6gy17JEDiPFcSZUwN6KqV2TQGNRf6UNjEIom7A5xvic5wI04WBOA1oXvicVPtIzGx7QxiL47j6wQ= Received: from MN2PR11MB4063.namprd11.prod.outlook.com (20.179.149.217) by MN2PR11MB3871.namprd11.prod.outlook.com (10.255.180.204) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2284.18; Thu, 19 Sep 2019 13:52:38 +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:38 +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 13/20] staging: wfx: introduce "secure link" Thread-Topic: [PATCH v2 13/20] staging: wfx: introduce "secure link" Thread-Index: AQHVbvF/kzK8o0pDA0+pOYQ5zuPr3A== Date: Thu, 19 Sep 2019 13:52:37 +0000 Message-ID: <20190919135220.30663-14-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: e65793fe-30a2-42fc-2352-08d73d08a229 x-microsoft-antispam: BCL:0; PCL:0; RULEID:(2390118)(7020095)(4652040)(8989299)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(5600167)(711020)(4605104)(1401327)(2017052603328)(7193020); SRVR:MN2PR11MB3871; x-ms-traffictypediagnostic: MN2PR11MB3871: x-ms-exchange-purlcount: 1 x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:1284; x-forefront-prvs: 016572D96D x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(136003)(396003)(376002)(366004)(346002)(39850400004)(52314003)(199004)(189003)(305945005)(2906002)(71190400001)(186003)(71200400001)(7736002)(91956017)(1076003)(66574012)(25786009)(66476007)(86362001)(66446008)(64756008)(66556008)(6506007)(3846002)(36756003)(2501003)(14444005)(486006)(11346002)(256004)(2616005)(476003)(76116006)(26005)(66946007)(446003)(76176011)(14454004)(8936002)(99286004)(66066001)(478600001)(81166006)(107886003)(5660300002)(102836004)(6116002)(81156014)(8676002)(316002)(966005)(4326008)(54906003)(6486002)(6306002)(110136005)(6512007)(6436002)(30864003); DIR:OUT; SFP:1101; SCL:1; SRVR:MN2PR11MB3871; H:MN2PR11MB4063.namprd11.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; A:1; MX: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: 3/ctiK5zcXsotIEHDShF+dOGZ0zSNkBFYrlpd/7egplvsRP3nzzH74rLw7rF+9hAIWl/L0Trgd6GaOstzZuT5DgWViq/K91ceoVtW2lG6/Gs5a5lFWBMu6hH0Ti6JCKPHkmsDd10EY5ph00/Ircrd2rbWQF5IW0CYtsYFQIOJgdYI/3p9jpKlPt8h+M38JRoeiMUM5uoFw5V9yGflkpAj2vz+Ggo1MUeRSNWcemnZ1SUYyZyKYoJgRuWToYQOcOCiVPxuUQ/PXpLL8zocXIVgrf+7LMkQud38eBZO79AgRFwm1XeXSYBRsV3vYwy869wPC4KOLEJun8M2GqhYEfqDr44qmnLc02GOHo1g3G5uCi0sxzGU28apTgGeTlK5i3ESaE0t0mHzkwtbSiU3AuqzFJgnIxHOAtRSoR9dFf2dLg= Content-ID: <774168FB1577BC46835BD019EA7D8D61@namprd11.prod.outlook.com> MIME-Version: 1.0 X-OriginatorOrg: silabs.com X-MS-Exchange-CrossTenant-Network-Message-Id: e65793fe-30a2-42fc-2352-08d73d08a229 X-MS-Exchange-CrossTenant-originalarrivaltime: 19 Sep 2019 13:52:37.5118 (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: q2Zq6CElWkZMxXvQljiXVs01o0Ld9i+Mj2HMRomQahZtQwLbTfQLuRGduzm8OUgK7PlHUBhpnLhu/suy6cv5kg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN2PR11MB3871 Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org From: Jérôme Pouiller Chip support encryption of the link between host and chip. This feature is called "secure link". Driver code on github[1] support it. However, it relies on mbedtls for cryptographic functions. So, I decided to not import this feature in current patch. However, in order to keep code synchronized between github and kernel, I imported all code related to this feature, even if most of it is just no-op. [1]: https://github.com/SiliconLabs/wfx-linux-driver/ Signed-off-by: Jérôme Pouiller --- drivers/staging/wfx/bh.c | 31 +++++++++++++++++++-- drivers/staging/wfx/debug.c | 17 ++++++++++++ drivers/staging/wfx/hif_rx.c | 17 ++++++++++++ drivers/staging/wfx/hif_tx.c | 6 ++++ drivers/staging/wfx/hif_tx.h | 1 + drivers/staging/wfx/main.c | 36 ++++++++++++++++++++++++ drivers/staging/wfx/main.h | 2 ++ drivers/staging/wfx/secure_link.h | 46 +++++++++++++++++++++++++++++++ drivers/staging/wfx/wfx.h | 2 ++ 9 files changed, 156 insertions(+), 2 deletions(-) create mode 100644 drivers/staging/wfx/secure_link.h diff --git a/drivers/staging/wfx/bh.c b/drivers/staging/wfx/bh.c index c94c9c401a69..d321fd312d55 100644 --- a/drivers/staging/wfx/bh.c +++ b/drivers/staging/wfx/bh.c @@ -12,6 +12,7 @@ #include "wfx.h" #include "hwio.h" #include "traces.h" +#include "secure_link.h" #include "hif_rx.h" #include "hif_api_cmd.h" @@ -74,7 +75,18 @@ static int rx_helper(struct wfx_dev *wdev, size_t read_len, int *is_cnf) hif = (struct hif_msg *) skb->data; WARN(hif->encrypted & 0x1, "unsupported encryption type"); if (hif->encrypted == 0x2) { - BUG(); // Not yet implemented + if (wfx_sl_decode(wdev, (void *) hif)) { + dev_kfree_skb(skb); + // If frame was a confirmation, expect trouble in next + // exchange. However, it is harmless to fail to decode + // an indication frame, so try to continue. Anyway, + // piggyback is probably correct. + return piggyback; + } + le16_to_cpus(hif->len); + computed_len = round_up(hif->len - sizeof(hif->len), 16) + + sizeof(struct hif_sl_msg) + + sizeof(struct hif_sl_tag); } else { le16_to_cpus(hif->len); computed_len = round_up(hif->len, 2); @@ -166,7 +178,22 @@ static void tx_helper(struct wfx_dev *wdev, struct hif_msg *hif) hif->seqnum = wdev->hif.tx_seqnum; wdev->hif.tx_seqnum = (wdev->hif.tx_seqnum + 1) % (HIF_COUNTER_MAX + 1); - data = hif; + if (wfx_is_secure_command(wdev, hif->id)) { + len = round_up(len - sizeof(hif->len), 16) + sizeof(hif->len) + + sizeof(struct hif_sl_msg_hdr) + sizeof(struct hif_sl_tag); + // AES support encryption in-place. However, mac80211 access to + // 802.11 header after frame was sent (to get MAC addresses). + // So, keep origin buffer clear. + data = kmalloc(len, GFP_KERNEL); + if (!data) + goto end; + is_encrypted = true; + ret = wfx_sl_encode(wdev, hif, data); + if (ret) + goto end; + } else { + data = hif; + } WARN(len > wdev->hw_caps.size_inp_ch_buf, "%s: request exceed WFx capability: %zu > %d\n", __func__, len, wdev->hw_caps.size_inp_ch_buf); diff --git a/drivers/staging/wfx/debug.c b/drivers/staging/wfx/debug.c index 0a328c96eaa0..f79693a4be7f 100644 --- a/drivers/staging/wfx/debug.c +++ b/drivers/staging/wfx/debug.c @@ -6,6 +6,7 @@ * Copyright (c) 2010, ST-Ericsson */ #include +#include #include "debug.h" #include "wfx.h" @@ -53,6 +54,21 @@ const char *get_reg_name(unsigned long id) return get_symbol(id, wfx_reg_print_map); } +static ssize_t wfx_burn_slk_key_write(struct file *file, + const char __user *user_buf, + size_t count, loff_t *ppos) +{ + struct wfx_dev *wdev = file->private_data; + + dev_info(wdev->dev, "this driver does not support secure link\n"); + return -EINVAL; +} + +static const struct file_operations wfx_burn_slk_key_fops = { + .open = simple_open, + .write = wfx_burn_slk_key_write, +}; + struct dbgfs_hif_msg { struct wfx_dev *wdev; struct completion complete; @@ -146,6 +162,7 @@ int wfx_debug_init(struct wfx_dev *wdev) struct dentry *d; d = debugfs_create_dir("wfx", wdev->hw->wiphy->debugfsdir); + debugfs_create_file("burn_slk_key", 0200, d, wdev, &wfx_burn_slk_key_fops); debugfs_create_file("send_hif_msg", 0600, d, wdev, &wfx_send_hif_msg_fops); return 0; diff --git a/drivers/staging/wfx/hif_rx.c b/drivers/staging/wfx/hif_rx.c index ba8ea4f3c91b..dd5f1dea4e85 100644 --- a/drivers/staging/wfx/hif_rx.c +++ b/drivers/staging/wfx/hif_rx.c @@ -11,6 +11,7 @@ #include "hif_rx.h" #include "wfx.h" +#include "secure_link.h" #include "hif_api_cmd.h" static int hif_generic_confirm(struct wfx_dev *wdev, struct hif_msg *hif, void *buf) @@ -46,6 +47,8 @@ static int hif_generic_confirm(struct wfx_dev *wdev, struct hif_msg *hif, void * } else { wdev->hif_cmd.buf_send = NULL; mutex_unlock(&wdev->hif_cmd.lock); + if (cmd != HIF_REQ_ID_SL_EXCHANGE_PUB_KEYS) + mutex_unlock(&wdev->hif_cmd.key_renew_lock); } return status; } @@ -68,11 +71,25 @@ static int hif_startup_indication(struct wfx_dev *wdev, struct hif_msg *hif, voi return 0; } +static int hif_keys_indication(struct wfx_dev *wdev, struct hif_msg *hif, void *buf) +{ + struct hif_ind_sl_exchange_pub_keys *body = buf; + + // Compatibility with legacy secure link + if (body->status == SL_PUB_KEY_EXCHANGE_STATUS_SUCCESS) + body->status = 0; + if (body->status) + dev_warn(wdev->dev, "secure link negociation error\n"); + wfx_sl_check_pubkey(wdev, body->ncp_pub_key, body->ncp_pub_key_mac); + return 0; +} + static const struct { int msg_id; int (*handler)(struct wfx_dev *wdev, struct hif_msg *hif, void *buf); } hif_handlers[] = { { HIF_IND_ID_STARTUP, hif_startup_indication }, + { HIF_IND_ID_SL_EXCHANGE_PUB_KEYS, hif_keys_indication }, }; void wfx_handle_rx(struct wfx_dev *wdev, struct sk_buff *skb) diff --git a/drivers/staging/wfx/hif_tx.c b/drivers/staging/wfx/hif_tx.c index 781a6e28dbad..f8ab871aa188 100644 --- a/drivers/staging/wfx/hif_tx.c +++ b/drivers/staging/wfx/hif_tx.c @@ -20,6 +20,7 @@ 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); + mutex_init(&hif_cmd->key_renew_lock); } static void wfx_fill_header(struct hif_msg *hif, int if_id, unsigned int cmd, size_t size) @@ -59,6 +60,9 @@ int wfx_cmd_send(struct wfx_dev *wdev, struct hif_msg *request, void *reply, siz if (wdev->chip_frozen) return -ETIMEDOUT; + if (cmd != HIF_REQ_ID_SL_EXCHANGE_PUB_KEYS) + mutex_lock(&wdev->hif_cmd.key_renew_lock); + mutex_lock(&wdev->hif_cmd.lock); WARN(wdev->hif_cmd.buf_send, "data locking error"); @@ -107,6 +111,8 @@ int wfx_cmd_send(struct wfx_dev *wdev, struct hif_msg *request, void *reply, siz "WSM request %s%s%s (%#.2x) on vif %d returned status %d\n", get_hif_name(cmd), mib_sep, mib_name, cmd, vif, ret); + if (cmd != HIF_REQ_ID_SL_EXCHANGE_PUB_KEYS) + mutex_unlock(&wdev->hif_cmd.key_renew_lock); return ret; } diff --git a/drivers/staging/wfx/hif_tx.h b/drivers/staging/wfx/hif_tx.h index 31f2a02c8466..6f2ea2f3a77d 100644 --- a/drivers/staging/wfx/hif_tx.h +++ b/drivers/staging/wfx/hif_tx.h @@ -23,6 +23,7 @@ struct wfx_scan_params { struct wfx_hif_cmd { struct mutex lock; + struct mutex key_renew_lock; struct completion ready; struct completion done; bool async; diff --git a/drivers/staging/wfx/main.c b/drivers/staging/wfx/main.c index 8973eeb60eb8..0cfd6b2ec8d1 100644 --- a/drivers/staging/wfx/main.c +++ b/drivers/staging/wfx/main.c @@ -27,6 +27,7 @@ #include "bh.h" #include "sta.h" #include "debug.h" +#include "secure_link.h" #include "hif_api_cmd.h" #include "wfx_version.h" @@ -39,6 +40,10 @@ static int gpio_wakeup = -2; module_param(gpio_wakeup, int, 0644); MODULE_PARM_DESC(gpio_wakeup, "gpio number for wakeup. -1 for none."); +static char *slk_key; +module_param(slk_key, charp, 0600); +MODULE_PARM_DESC(slk_key, "secret key for secure link (expect 64 hexdecimal digits)."); + static const struct ieee80211_ops wfx_ops = { .start = wfx_start, .stop = wfx_stop, @@ -84,6 +89,29 @@ struct gpio_desc *wfx_get_gpio(struct device *dev, int override, const char *lab return ret; } +static void wfx_fill_sl_key(struct device *dev, struct wfx_platform_data *pdata) +{ + const char *ascii_key = NULL; + int ret = 0; + + if (slk_key) + ascii_key = slk_key; + if (!ascii_key) + ret = of_property_read_string(dev->of_node, "slk_key", &ascii_key); + if (ret == -EILSEQ || ret == -ENODATA) + dev_err(dev, "ignoring malformatted key from DT\n"); + if (!ascii_key) + return; + + ret = hex2bin(pdata->slk_key, ascii_key, sizeof(pdata->slk_key)); + if (ret) { + dev_err(dev, "ignoring malformatted key: %s\n", ascii_key); + memset(pdata->slk_key, 0, sizeof(pdata->slk_key)); + return; + } + dev_err(dev, "secure link is not supported by this driver, ignoring provided key\n"); +} + struct wfx_dev *wfx_init_common(struct device *dev, const struct wfx_platform_data *pdata, const struct hwbus_ops *hwbus_ops, @@ -113,6 +141,7 @@ struct wfx_dev *wfx_init_common(struct device *dev, wdev->hwbus_ops = hwbus_ops; wdev->hwbus_priv = hwbus_priv; memcpy(&wdev->pdata, pdata, sizeof(*pdata)); + wfx_fill_sl_key(dev, &wdev->pdata); init_completion(&wdev->firmware_ready); wfx_init_hif_cmd(&wdev->hif_cmd); @@ -167,6 +196,12 @@ int wfx_probe(struct wfx_dev *wdev) goto err1; } + err = wfx_sl_init(wdev); + if (err && wdev->hw_caps.capabilities.link_mode == SEC_LINK_ENFORCED) { + dev_err(wdev->dev, "chip require secure_link, but can't negociate it\n"); + goto err1; + } + for (i = 0; i < ARRAY_SIZE(wdev->addresses); i++) { eth_zero_addr(wdev->addresses[i].addr); macaddr = of_get_mac_address(wdev->dev->of_node); @@ -198,6 +233,7 @@ int wfx_probe(struct wfx_dev *wdev) void wfx_release(struct wfx_dev *wdev) { wfx_bh_unregister(wdev); + wfx_sl_deinit(wdev); } static int __init wfx_core_init(void) diff --git a/drivers/staging/wfx/main.h b/drivers/staging/wfx/main.h index f7c65999a493..2c9c215455ce 100644 --- a/drivers/staging/wfx/main.h +++ b/drivers/staging/wfx/main.h @@ -14,12 +14,14 @@ #include #include "bus.h" +#include "hif_api_general.h" struct wfx_dev; struct wfx_platform_data { /* Keyset and ".sec" extention will appended to this string */ const char *file_fw; + unsigned char slk_key[API_KEY_VALUE_SIZE]; struct gpio_desc *gpio_wakeup; /* * if true HIF D_out is sampled on the rising edge of the clock diff --git a/drivers/staging/wfx/secure_link.h b/drivers/staging/wfx/secure_link.h new file mode 100644 index 000000000000..e2da1c73c760 --- /dev/null +++ b/drivers/staging/wfx/secure_link.h @@ -0,0 +1,46 @@ +/* SPDX-License-Identifier: GPL-2.0-only */ +/* + * Copyright (c) 2019, Silicon Laboratories, Inc. + */ +#ifndef WFX_SECURE_LINK_H +#define WFX_SECURE_LINK_H + +#include "hif_api_general.h" + +struct wfx_dev; + + +struct sl_context { +}; + +static inline bool wfx_is_secure_command(struct wfx_dev *wdev, int cmd_id) +{ + return false; +} + +static inline int wfx_sl_decode(struct wfx_dev *wdev, struct hif_sl_msg *m) +{ + return -EIO; +} + +static inline int wfx_sl_encode(struct wfx_dev *wdev, struct hif_msg *input, struct hif_sl_msg *output) +{ + return -EIO; +} + +static inline int wfx_sl_check_pubkey(struct wfx_dev *wdev, uint8_t *ncp_pubkey, uint8_t *ncp_pubmac) +{ + return -EIO; +} + +static inline int wfx_sl_init(struct wfx_dev *wdev) +{ + return -EIO; +} + +static inline void wfx_sl_deinit(struct wfx_dev *wdev) +{ +} + + +#endif diff --git a/drivers/staging/wfx/wfx.h b/drivers/staging/wfx/wfx.h index bf9de11f8896..7adb5bf67e90 100644 --- a/drivers/staging/wfx/wfx.h +++ b/drivers/staging/wfx/wfx.h @@ -15,6 +15,7 @@ #include "bh.h" #include "main.h" +#include "secure_link.h" #include "hif_tx.h" #include "hif_api_general.h" @@ -33,6 +34,7 @@ struct wfx_dev { struct completion firmware_ready; struct hif_ind_startup hw_caps; struct wfx_hif hif; + struct sl_context sl; int chip_frozen; struct wfx_hif_cmd hif_cmd;