lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Wed, 26 Oct 2022 15:15:31 +0200
From:   Matthias Schiffer <matthias.schiffer@...tq-group.com>
To:     Arnd Bergmann <arnd@...db.de>,
        Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
        Rob Herring <robh+dt@...nel.org>,
        Krzysztof Kozlowski <krzysztof.kozlowski+dt@...aro.org>
Cc:     Marcel Holtmann <marcel@...tmann.org>,
        Johan Hedberg <johan.hedberg@...il.com>,
        Luiz Augusto von Dentz <luiz.dentz@...il.com>,
        Amitkumar Karwar <amitkarwar@...il.com>,
        Ganapathi Bhat <ganapathi017@...il.com>,
        Sharvari Harisangam <sharvari.harisangam@....com>,
        Xinming Hu <huxinming820@...il.com>,
        Kalle Valo <kvalo@...nel.org>,
        "David S. Miller" <davem@...emloft.net>,
        Eric Dumazet <edumazet@...gle.com>,
        Jakub Kicinski <kuba@...nel.org>,
        Paolo Abeni <pabeni@...hat.com>, linux-kernel@...r.kernel.org,
        linux-bluetooth@...r.kernel.org, linux-wireless@...r.kernel.org,
        netdev@...r.kernel.org, devicetree@...r.kernel.org,
        linux@...tq-group.com,
        Matthias Schiffer <matthias.schiffer@...tq-group.com>
Subject: [RFC 2/5] wireless: mwifiex: signal firmware readiness using notify-device

Signed-off-by: Matthias Schiffer <matthias.schiffer@...tq-group.com>
---
 drivers/net/wireless/marvell/mwifiex/main.c | 14 ++++++++++++++
 drivers/net/wireless/marvell/mwifiex/main.h |  1 +
 2 files changed, 15 insertions(+)

diff --git a/drivers/net/wireless/marvell/mwifiex/main.c b/drivers/net/wireless/marvell/mwifiex/main.c
index da2e6557e684..92176e90b11e 100644
--- a/drivers/net/wireless/marvell/mwifiex/main.c
+++ b/drivers/net/wireless/marvell/mwifiex/main.c
@@ -5,6 +5,7 @@
  * Copyright 2011-2020 NXP
  */
 
+#include <linux/notify-device.h>
 #include <linux/suspend.h>
 
 #include "main.h"
@@ -661,6 +662,16 @@ static int _mwifiex_fw_dpc(const struct firmware *firmware, void *context)
 	mwifiex_drv_get_driver_version(adapter, fmt, sizeof(fmt) - 1);
 	mwifiex_dbg(adapter, MSG, "driver_version = %s\n", fmt);
 	adapter->is_up = true;
+
+	adapter->notify_dev = notify_device_create(adapter->dev, "firmware-notifier");
+	if (IS_ERR(adapter->notify_dev)) {
+		/* This error is not fatal */
+		mwifiex_dbg(adapter, ERROR,
+			    "cannot create firmware notify device: %d\n",
+			    PTR_ERR(adapter->notify_dev));
+		adapter->notify_dev = NULL;
+	}
+
 	goto done;
 
 err_add_intf:
@@ -1482,6 +1493,9 @@ static void mwifiex_uninit_sw(struct mwifiex_adapter *adapter)
 		rtnl_unlock();
 	}
 
+	notify_device_destroy(adapter->notify_dev);
+	adapter->notify_dev = NULL;
+
 	wiphy_unregister(adapter->wiphy);
 	wiphy_free(adapter->wiphy);
 	adapter->wiphy = NULL;
diff --git a/drivers/net/wireless/marvell/mwifiex/main.h b/drivers/net/wireless/marvell/mwifiex/main.h
index 63f861e6b28a..b28e90db3128 100644
--- a/drivers/net/wireless/marvell/mwifiex/main.h
+++ b/drivers/net/wireless/marvell/mwifiex/main.h
@@ -870,6 +870,7 @@ struct mwifiex_adapter {
 	int winner;
 	struct device *dev;
 	struct wiphy *wiphy;
+	struct device *notify_dev;
 	u8 perm_addr[ETH_ALEN];
 	unsigned long work_flags;
 	u32 fw_release_number;
-- 
2.25.1

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ