From: <Ajay.Kathat@microchip.com>
To: <linux-wireless@vger.kernel.org>
Cc: <Claudiu.Beznea@microchip.com>, <Nicolas.Ferre@microchip.com>,
<Sripad.Balwadgi@microchip.com>, <Ajay.Kathat@microchip.com>
Subject: [PATCH wireless-drivers-next 5/5] wilc1000: use API version number info along with firmware filename
Date: Fri, 10 Jul 2020 05:18:31 +0000 [thread overview]
Message-ID: <20200710051826.3267-6-ajay.kathat@microchip.com> (raw)
In-Reply-To: <20200710051826.3267-1-ajay.kathat@microchip.com>
From: Ajay Singh <ajay.kathat@microchip.com>
Added version number info along with firmware name so driver can pick
the correct revision of FW file. Moved FW filename macro as part of
driver code & added MODULE_FIRMWARE to specify FW needed by module.
Signed-off-by: Ajay Singh <ajay.kathat@microchip.com>
---
.../net/wireless/microchip/wilc1000/Makefile | 2 --
.../net/wireless/microchip/wilc1000/netdev.c | 17 ++++++++++++++---
2 files changed, 14 insertions(+), 5 deletions(-)
diff --git a/drivers/net/wireless/microchip/wilc1000/Makefile b/drivers/net/wireless/microchip/wilc1000/Makefile
index 7d1ed5f40cbb..c3c9e34c1eaa 100644
--- a/drivers/net/wireless/microchip/wilc1000/Makefile
+++ b/drivers/net/wireless/microchip/wilc1000/Makefile
@@ -1,8 +1,6 @@
# SPDX-License-Identifier: GPL-2.0
obj-$(CONFIG_WILC1000) += wilc1000.o
-ccflags-y += -DFIRMWARE_WILC1000=\"atmel/wilc1000_wifi_firmware.bin\"
-
wilc1000-objs := cfg80211.o netdev.o mon.o \
hif.o wlan_cfg.o wlan.o
diff --git a/drivers/net/wireless/microchip/wilc1000/netdev.c b/drivers/net/wireless/microchip/wilc1000/netdev.c
index 1005526ae896..198354670fe1 100644
--- a/drivers/net/wireless/microchip/wilc1000/netdev.c
+++ b/drivers/net/wireless/microchip/wilc1000/netdev.c
@@ -15,6 +15,13 @@
#define WILC_MULTICAST_TABLE_SIZE 8
+/* latest API version supported */
+#define WILC1000_API_VER 1
+
+#define WILC1000_FW_PREFIX "atmel/wilc1000_wifi_firmware-"
+#define __WILC1000_FW(api) WILC1000_FW_PREFIX #api ".bin"
+#define WILC1000_FW(api) __WILC1000_FW(api)
+
static irqreturn_t isr_uh_routine(int irq, void *user_data)
{
struct net_device *dev = user_data;
@@ -177,15 +184,18 @@ static int wilc_wlan_get_firmware(struct net_device *dev)
struct wilc *wilc = vif->wilc;
int chip_id;
const struct firmware *wilc_fw;
+ int ret;
chip_id = wilc_get_chipid(wilc, false);
netdev_info(dev, "ChipID [%x] loading firmware [%s]\n", chip_id,
- FIRMWARE_WILC1000);
+ WILC1000_FW(WILC1000_API_VER));
- if (request_firmware(&wilc_fw, FIRMWARE_WILC1000, wilc->dev) != 0) {
+ ret = request_firmware(&wilc_fw, WILC1000_FW(WILC1000_API_VER),
+ wilc->dev);
+ if (ret != 0) {
netdev_err(dev, "%s - firmware not available\n",
- FIRMWARE_WILC1000);
+ WILC1000_FW(WILC1000_API_VER));
return -EINVAL;
}
wilc->firmware = wilc_fw;
@@ -925,3 +935,4 @@ struct wilc_vif *wilc_netdev_ifc_init(struct wilc *wl, const char *name,
}
MODULE_LICENSE("GPL");
+MODULE_FIRMWARE(WILC1000_FW(WILC1000_API_VER));
--
2.24.0
next prev parent reply other threads:[~2020-07-10 5:22 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-07-10 5:18 [PATCH wireless-drivers-next 0/5] wilc1000: udpated MAINTAINERS & minor pending patches Ajay.Kathat
2020-07-10 5:18 ` [PATCH wireless-drivers-next 1/5] MAINTAINERS: net: wilc1000: Update entry Ajay.Kathat
2020-07-14 17:53 ` Kalle Valo
2020-07-10 5:18 ` [PATCH wireless-drivers-next 3/5] wilc1000: fix compiler warning for 'wowlan_support' unused variable Ajay.Kathat
2020-07-10 5:18 ` [PATCH wireless-drivers-next 2/5] wilc1000: use strlcpy to avoid 'stringop-truncation' warning Ajay.Kathat
2020-07-10 5:18 ` Ajay.Kathat [this message]
2020-07-10 5:18 ` [PATCH wireless-drivers-next 4/5] wilc1000: use unified single wilc1000 FW binary Ajay.Kathat
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20200710051826.3267-6-ajay.kathat@microchip.com \
--to=ajay.kathat@microchip.com \
--cc=Claudiu.Beznea@microchip.com \
--cc=Nicolas.Ferre@microchip.com \
--cc=Sripad.Balwadgi@microchip.com \
--cc=linux-wireless@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).