Commit c768b58d authored by Luis R. Rodriguez's avatar Luis R. Rodriguez Committed by John W. Linville

ar9170: add support for 1-stage firmware

You can get the stage 1 firmware from here:

http://www.kernel.org/pub/linux/kernel/people/mcgrof/firmware/ar9170/ar9170.fw

md5sum: 34feec4ec0eae3bb92c7c1ea2dfb4530
sha1sum: 6e5250498b815c2940d97242de31e054ae44e079

Its license:

http://www.kernel.org/pub/linux/kernel/people/mcgrof/firmware/ar9170/LICENSE

This is a new firmware, tested with WNDA3100.

Cc: Peter Grabienski <Peter.Grabienski@Atheros.com>
Cc: Stephen Chen <Stephen.Chen@Atheros.com>
Cc: Michael Fortin <Michael.Fortin@Atheros.com>
Cc: Johnny Cheng <Johnny.Cheng@Atheros.com>
Cc: Yuan-Gu Wei <Yuan-Gu.Wei@atheros.com>
Cc: Joerg Albert <jal2@gmx.de>
Signed-off-by: default avatarLuis R. Rodriguez <lrodriguez@atheros.com>
Signed-off-by: default avatarJohn W. Linville <linville@tuxdriver.com>
parent 546256fb
...@@ -51,6 +51,7 @@ MODULE_AUTHOR("Johannes Berg <johannes@sipsolutions.net>"); ...@@ -51,6 +51,7 @@ MODULE_AUTHOR("Johannes Berg <johannes@sipsolutions.net>");
MODULE_AUTHOR("Christian Lamparter <chunkeey@web.de>"); MODULE_AUTHOR("Christian Lamparter <chunkeey@web.de>");
MODULE_LICENSE("GPL"); MODULE_LICENSE("GPL");
MODULE_DESCRIPTION("Atheros AR9170 802.11n USB wireless"); MODULE_DESCRIPTION("Atheros AR9170 802.11n USB wireless");
MODULE_FIRMWARE("ar9170.fw");
MODULE_FIRMWARE("ar9170-1.fw"); MODULE_FIRMWARE("ar9170-1.fw");
MODULE_FIRMWARE("ar9170-2.fw"); MODULE_FIRMWARE("ar9170-2.fw");
...@@ -504,17 +505,23 @@ static int ar9170_usb_request_firmware(struct ar9170_usb *aru) ...@@ -504,17 +505,23 @@ static int ar9170_usb_request_firmware(struct ar9170_usb *aru)
{ {
int err = 0; int err = 0;
err = request_firmware(&aru->init_values, "ar9170-1.fw", err = request_firmware(&aru->firmware, "ar9170.fw",
&aru->udev->dev); &aru->udev->dev);
if (err) { if (!err) {
dev_err(&aru->udev->dev, "file with init values not found.\n"); aru->init_values = NULL;
return err; return 0;
} }
dev_err(&aru->udev->dev, "ar9170.fw firmware file "
"not found, trying old firmware...\n");
err = request_firmware(&aru->init_values, "ar9170-1.fw",
&aru->udev->dev);
err = request_firmware(&aru->firmware, "ar9170-2.fw", &aru->udev->dev); err = request_firmware(&aru->firmware, "ar9170-2.fw", &aru->udev->dev);
if (err) { if (err) {
release_firmware(aru->init_values); release_firmware(aru->init_values);
dev_err(&aru->udev->dev, "firmware file not found.\n"); dev_err(&aru->udev->dev, "file with init values not found.\n");
return err; return err;
} }
...@@ -548,6 +555,9 @@ static int ar9170_usb_upload_firmware(struct ar9170_usb *aru) ...@@ -548,6 +555,9 @@ static int ar9170_usb_upload_firmware(struct ar9170_usb *aru)
{ {
int err; int err;
if (!aru->init_values)
goto upload_fw_start;
/* First, upload initial values to device RAM */ /* First, upload initial values to device RAM */
err = ar9170_usb_upload(aru, aru->init_values->data, err = ar9170_usb_upload(aru, aru->init_values->data,
aru->init_values->size, 0x102800, false); aru->init_values->size, 0x102800, false);
...@@ -557,6 +567,8 @@ static int ar9170_usb_upload_firmware(struct ar9170_usb *aru) ...@@ -557,6 +567,8 @@ static int ar9170_usb_upload_firmware(struct ar9170_usb *aru)
return err; return err;
} }
upload_fw_start:
/* Then, upload the firmware itself and start it */ /* Then, upload the firmware itself and start it */
return ar9170_usb_upload(aru, aru->firmware->data, aru->firmware->size, return ar9170_usb_upload(aru, aru->firmware->data, aru->firmware->size,
0x200000, true); 0x200000, true);
......
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