Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 150663
b: refs/heads/master
c: c768b58
h: refs/heads/master
i:
  150661: 40cebbd
  150659: 3d25bc5
  150655: f5eb9eb
v: v3
  • Loading branch information
Luis R. Rodriguez authored and John W. Linville committed Jun 3, 2009
1 parent 64850ec commit f371af8
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 6 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 546256fbd06d70a87381020ea8553fb78c9abf43
refs/heads/master: c768b58d62d3106f0f670d35d1e7820c14ba769a
22 changes: 17 additions & 5 deletions trunk/drivers/net/wireless/ath/ar9170/usb.c
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ MODULE_AUTHOR("Johannes Berg <johannes@sipsolutions.net>");
MODULE_AUTHOR("Christian Lamparter <chunkeey@web.de>");
MODULE_LICENSE("GPL");
MODULE_DESCRIPTION("Atheros AR9170 802.11n USB wireless");
MODULE_FIRMWARE("ar9170.fw");
MODULE_FIRMWARE("ar9170-1.fw");
MODULE_FIRMWARE("ar9170-2.fw");

Expand Down Expand Up @@ -504,17 +505,23 @@ static int ar9170_usb_request_firmware(struct ar9170_usb *aru)
{
int err = 0;

err = request_firmware(&aru->init_values, "ar9170-1.fw",
err = request_firmware(&aru->firmware, "ar9170.fw",
&aru->udev->dev);
if (err) {
dev_err(&aru->udev->dev, "file with init values not found.\n");
return err;
if (!err) {
aru->init_values = NULL;
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);
if (err) {
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;
}

Expand Down Expand Up @@ -548,6 +555,9 @@ static int ar9170_usb_upload_firmware(struct ar9170_usb *aru)
{
int err;

if (!aru->init_values)
goto upload_fw_start;

/* First, upload initial values to device RAM */
err = ar9170_usb_upload(aru, aru->init_values->data,
aru->init_values->size, 0x102800, false);
Expand All @@ -557,6 +567,8 @@ static int ar9170_usb_upload_firmware(struct ar9170_usb *aru)
return err;
}

upload_fw_start:

/* Then, upload the firmware itself and start it */
return ar9170_usb_upload(aru, aru->firmware->data, aru->firmware->size,
0x200000, true);
Expand Down

0 comments on commit f371af8

Please sign in to comment.