@@ -19,10 +19,13 @@
/* latest API version supported */
#define WILC1000_API_VER 1
-#define WILC1000_FW_PREFIX "atmel/wilc1000_wifi_firmware-"
+#define WILC1000_FW_PREFIX "wilc1000_wifi_firmware-"
#define __WILC1000_FW(api) WILC1000_FW_PREFIX #api ".bin"
#define WILC1000_FW(api) __WILC1000_FW(api)
+#define WILC1000_ATMEL_FW(api) "atmel/" WILC1000_FW(api)
+#define WILC1000_MICROCHIP_FW(api) "microchip/wilc/" WILC1000_FW(api)
+
static irqreturn_t isr_uh_routine(int irq, void *user_data)
{
struct wilc *wilc = user_data;
@@ -187,14 +190,27 @@ static int wilc_wlan_get_firmware(struct net_device *dev)
chip_id = wilc_get_chipid(wilc, false);
netdev_info(dev, "ChipID [%x] loading firmware [%s]\n", chip_id,
- WILC1000_FW(WILC1000_API_VER));
+ WILC1000_MICROCHIP_FW(WILC1000_API_VER));
- ret = request_firmware(&wilc_fw, WILC1000_FW(WILC1000_API_VER),
+ ret = request_firmware(&wilc_fw,
+ WILC1000_MICROCHIP_FW(WILC1000_API_VER),
wilc->dev);
- if (ret != 0) {
- netdev_err(dev, "%s - firmware not available\n",
- WILC1000_FW(WILC1000_API_VER));
- return -EINVAL;
+ if (ret == -ENOENT) {
+ netdev_info(dev, "firmware not found at[%s], try [%s]\n",
+ WILC1000_MICROCHIP_FW(WILC1000_API_VER),
+ WILC1000_ATMEL_FW(WILC1000_API_VER));
+ ret = request_firmware(&wilc_fw,
+ WILC1000_ATMEL_FW(WILC1000_API_VER),
+ wilc->dev);
+ if (ret) {
+ netdev_err(dev, "[%s] - request firmware failed %d\n",
+ WILC1000_ATMEL_FW(WILC1000_API_VER), ret);
+ return ret;
+ }
+ } else if (ret) {
+ netdev_err(dev, "[%s] - request firmware failed %d\n",
+ WILC1000_MICROCHIP_FW(WILC1000_API_VER), ret);
+ return ret;
}
wilc->firmware = wilc_fw;
@@ -1007,4 +1023,5 @@ struct wilc_vif *wilc_netdev_ifc_init(struct wilc *wl, const char *name,
}
MODULE_LICENSE("GPL");
-MODULE_FIRMWARE(WILC1000_FW(WILC1000_API_VER));
+MODULE_FIRMWARE(WILC1000_ATMEL_FW(WILC1000_API_VER));
+MODULE_FIRMWARE(WILC1000_MICROCHIP_FW(WILC1000_API_VER));