Commit b52b331a authored by Ajay Singh's avatar Ajay Singh Committed by Kalle Valo

wilc1000: use API version number info along with firmware filename

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: default avatarAjay Singh <ajay.kathat@microchip.com>
Signed-off-by: default avatarKalle Valo <kvalo@codeaurora.org>
Link: https://lore.kernel.org/r/20200710051826.3267-6-ajay.kathat@microchip.com
parent 0b3dd675
# SPDX-License-Identifier: GPL-2.0 # SPDX-License-Identifier: GPL-2.0
obj-$(CONFIG_WILC1000) += wilc1000.o obj-$(CONFIG_WILC1000) += wilc1000.o
ccflags-y += -DFIRMWARE_WILC1000=\"atmel/wilc1000_wifi_firmware.bin\"
wilc1000-objs := cfg80211.o netdev.o mon.o \ wilc1000-objs := cfg80211.o netdev.o mon.o \
hif.o wlan_cfg.o wlan.o hif.o wlan_cfg.o wlan.o
......
...@@ -15,6 +15,13 @@ ...@@ -15,6 +15,13 @@
#define WILC_MULTICAST_TABLE_SIZE 8 #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) static irqreturn_t isr_uh_routine(int irq, void *user_data)
{ {
struct net_device *dev = user_data; struct net_device *dev = user_data;
...@@ -177,15 +184,18 @@ static int wilc_wlan_get_firmware(struct net_device *dev) ...@@ -177,15 +184,18 @@ static int wilc_wlan_get_firmware(struct net_device *dev)
struct wilc *wilc = vif->wilc; struct wilc *wilc = vif->wilc;
int chip_id; int chip_id;
const struct firmware *wilc_fw; const struct firmware *wilc_fw;
int ret;
chip_id = wilc_get_chipid(wilc, false); chip_id = wilc_get_chipid(wilc, false);
netdev_info(dev, "ChipID [%x] loading firmware [%s]\n", chip_id, 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", netdev_err(dev, "%s - firmware not available\n",
FIRMWARE_WILC1000); WILC1000_FW(WILC1000_API_VER));
return -EINVAL; return -EINVAL;
} }
wilc->firmware = wilc_fw; wilc->firmware = wilc_fw;
...@@ -925,3 +935,4 @@ struct wilc_vif *wilc_netdev_ifc_init(struct wilc *wl, const char *name, ...@@ -925,3 +935,4 @@ struct wilc_vif *wilc_netdev_ifc_init(struct wilc *wl, const char *name,
} }
MODULE_LICENSE("GPL"); MODULE_LICENSE("GPL");
MODULE_FIRMWARE(WILC1000_FW(WILC1000_API_VER));
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment