2009-05-28 01:48:46

by Luis R. Rodriguez

[permalink] [raw]
Subject: [RFT 0/2] ar9170: initial stage 1 firmware support / AVM fritz

Please give this a shot with the AVM Fritz device.
At least for me I can only scan, I cannot associate to an AP
yet with the 1 stage firmware but I've been told it does seem
to work with some devices..

If you can even at least scan with the AVM fritz devices then this means
we just need to finish the 1 stage firmware support in order for them to work.
I cannot work on this more though so if someone has time and you want to pick
up the work please refer the Otus code (in staging/otus/ and ensure that the
code #ifdef'd around ZM_OTUS_LINUX_PHASE_2 is _not_ used. ar9170 and otus
are very different (which is good) but unfortunately for this exercise this
means its very difficult to find the exact calls #ifdef'd on the ar9170 port.
I may have missed one or two more.

Luis R. Rodriguez (2):
ar9170: add initial support for 1-stage firmware
ar9170: add AVM FRITZ devices

drivers/net/wireless/ath/ar9170/phy.c | 13 ++++++--
drivers/net/wireless/ath/ar9170/usb.c | 50 +++++++++++++++++++++++++++++---
drivers/net/wireless/ath/ar9170/usb.h | 2 +
3 files changed, 57 insertions(+), 8 deletions(-)



2009-05-28 21:16:46

by Luis R. Rodriguez

[permalink] [raw]
Subject: Re: [otus-devel] [RFT 1/2] ar9170: add initial support for 1-stage firmware

On Thu, May 28, 2009 at 12:26 PM, Luis R. Rodriguez
<[email protected]> wrote:
> On Thu, May 28, 2009 at 09:03:43AM -0700, Christian Lamparter wrote:

>> --> #if_N_def ZM_OTUS_LINUX_PHASE_2 <--
>> zfDelayWriteInternalReg(dev, 0x1c3694, ((hpPriv->tPow2x2g[0]&0x3f) << 20) | (0x5<<26));
>> zfDelayWriteInternalReg(dev, 0x1c3bb4, ((hpPriv->tPow2x2g[0]&0x3f) << 5 ) | (0x5<<11) |
>>                                            ((hpPriv->tPow2x2g[0]&0x3f) << 21) | (0x5<<27)  );
>> #endif
>> so, the current ar9170 code is actually _wrong_ (but works!)...
>> and we should not touch these fields with the 2-stage firmware.
>
> Oh, hm, yeah good catch, but to match would actually need to call it
> when stage-1 firmware is used.
>
>> OT: since the firmware will (inevitably end up in the firmware-git-tree)
>> we should convert it to ihex, so it can be downloaded with the git-web.
>> (this can be done by: objcopy -I binary -O ihex ar9170.fw ar9170.fw.ihex )
>
> Sure, whatever works best. If you download it from gitweb you then
> have to do the conversion back though.

I noticed some difference in performance wit this removed so I think
for now its best to leave it in for both -- it seems this sets the ACK
power.

Luis

2009-05-28 19:25:53

by Luis R. Rodriguez

[permalink] [raw]
Subject: Re: [RFT 1/2] ar9170: add initial support for 1-stage firmware

On Thu, May 28, 2009 at 09:03:43AM -0700, Christian Lamparter wrote:
> On Thursday 28 May 2009 03:48:45 Luis R. Rodriguez wrote:
> > You can get the stage 1 firmware from here:
> >
> > http://www.kernel.org/pub/linux/kernel/people/mcgrof/firmware/ar9170/ar9170.fw
> >
> > Its license:
> >
> > http://www.kernel.org/pub/linux/kernel/people/mcgrof/firmware/ar9170/LICENSE
> >
> > It seems with some devices this works, with some others
> > I see only scan working. We shall not push this firmware
> > into the linux-firmware tree until these issues have been
> > resolved.
> >
> > Cc: Peter Grabienski <[email protected]>
> > Cc: Stephen Chen <[email protected]>
> > Cc: Michael Fortin <[email protected]>
> > Cc: Johnny Cheng <[email protected]>
> > Cc: Yuan-Gu Wei <[email protected]>
> > Cc: Joerg Albert <[email protected]>
> > Signed-off-by: Luis R. Rodriguez <[email protected]>
> > ---
> > drivers/net/wireless/ath/ar9170/phy.c | 13 ++++++++++---
> > drivers/net/wireless/ath/ar9170/usb.c | 22 +++++++++++++++++-----
> > 2 files changed, 27 insertions(+), 8 deletions(-)
> >
> > diff --git a/drivers/net/wireless/ath/ar9170/phy.c b/drivers/net/wireless/ath/ar9170/phy.c
> > index 6ce2075..0675dc8 100644
> > --- a/drivers/net/wireless/ath/ar9170/phy.c
> > +++ b/drivers/net/wireless/ath/ar9170/phy.c
> > @@ -39,6 +39,7 @@
> > #include <linux/bitrev.h>
> > #include "ar9170.h"
> > #include "cmd.h"
> > +#include "usb.h"
> >
> > static int ar9170_init_power_cal(struct ar9170 *ar)
> > {
> > @@ -996,6 +997,10 @@ static int ar9170_set_power_cal(struct ar9170 *ar, u32 freq, enum ar9170_bw bw)
> > int idx, i, n;
> > u8 ackpower, ackchains, f;
> > u8 pwr_freqs[AR5416_MAX_NUM_TGT_PWRS];
> > + struct ar9170_usb *aru;
> > +
> > + /* All ar9170 devices are USB */
> > + aru = container_of(ar, struct ar9170_usb, common);
> >
> > if (freq < 3000)
> > f = freq - 2300;
> > @@ -1102,9 +1107,11 @@ static int ar9170_set_power_cal(struct ar9170 *ar, u32 freq, enum ar9170_bw bw)
> > else
> > ackpower = ar->power_5G_leg[0] & 0x3f;
> >
> > - ar9170_regwrite(0x1c3694, ackpower << 20 | ackchains << 26);
> > - ar9170_regwrite(0x1c3bb4, ackpower << 5 | ackchains << 11 |
> > - ackpower << 21 | ackchains << 27);
> > + if (aru->init_values) {
> > + ar9170_regwrite(0x1c3694, ackpower << 20 | ackchains << 26);
> > + ar9170_regwrite(0x1c3bb4, ackpower << 5 | ackchains << 11 |
> > + ackpower << 21 | ackchains << 27);
> > + }
> >
> > ar9170_regwrite_finish();
> > return ar9170_regwrite_result();
> I guess you can drop this changes. see hpmain.c line 4039, 4061, 4069
>
> --> #if_N_def ZM_OTUS_LINUX_PHASE_2 <--
> zfDelayWriteInternalReg(dev, 0x1c3694, ((hpPriv->tPow2x2g[0]&0x3f) << 20) | (0x5<<26));
> zfDelayWriteInternalReg(dev, 0x1c3bb4, ((hpPriv->tPow2x2g[0]&0x3f) << 5 ) | (0x5<<11) |
> ((hpPriv->tPow2x2g[0]&0x3f) << 21) | (0x5<<27) );
> #endif
> so, the current ar9170 code is actually _wrong_ (but works!)...
> and we should not touch these fields with the 2-stage firmware.

Oh, hm, yeah good catch, but to match would actually need to call it
when stage-1 firmware is used.

> OT: since the firmware will (inevitably end up in the firmware-git-tree)
> we should convert it to ihex, so it can be downloaded with the git-web.
> (this can be done by: objcopy -I binary -O ihex ar9170.fw ar9170.fw.ihex )

Sure, whatever works best. If you download it from gitweb you then
have to do the conversion back though.

> And for future: it might be a good idea to add a little header/tail on the
> firmware files. e.g.:
> - firmware version and variant (e.g. 1-stage or 2-stage firmware)
> - supported hardware variants/interfaces
> - maybe API revision / feature bitmap
> - maybe more: e.g: vendor string / build / build-date / build no. etc.

I think some version strings exist, but yeah you're right.

Luis

2009-05-28 01:48:46

by Luis R. Rodriguez

[permalink] [raw]
Subject: [RFT 2/2] ar9170: add AVM FRITZ devices

This adds:

USB 0x057C:0x8401 AVM FRITZ!WLAN USB Stick N
USB 0x057C:0x8402 AVM FRITZ!WLAN USB Stick N 2.4

These devices require the 1-stage firmware, if not present we
don't continue.

Cc: Peter Grabienski <[email protected]>
Cc: Stephen Chen <[email protected]>
Cc: Michael Fortin <[email protected]>
Cc: Johnny Cheng <[email protected]>
Cc: Yuan-Gu Wei <[email protected]>
Cc: Joerg Albert <[email protected]>
Signed-off-by: Luis R. Rodriguez <[email protected]>
---
drivers/net/wireless/ath/ar9170/usb.c | 28 ++++++++++++++++++++++++++++
drivers/net/wireless/ath/ar9170/usb.h | 2 ++
2 files changed, 30 insertions(+), 0 deletions(-)

diff --git a/drivers/net/wireless/ath/ar9170/usb.c b/drivers/net/wireless/ath/ar9170/usb.c
index 3c97c09..45b5291 100644
--- a/drivers/net/wireless/ath/ar9170/usb.c
+++ b/drivers/net/wireless/ath/ar9170/usb.c
@@ -82,6 +82,10 @@ static struct usb_device_id ar9170_usb_ids[] = {
{ USB_DEVICE(0x2019, 0x5304) },
/* IO-Data WNGDNUS2 */
{ USB_DEVICE(0x04bb, 0x093f) },
+ /* AVM FRITZ!WLAN USB Stick N */
+ { USB_DEVICE(0x057C, 0x8401) },
+ /* AVM FRITZ!WLAN USB Stick N 2.4 */
+ { USB_DEVICE(0x057C, 0x8402) },

/* terminate */
{}
@@ -512,6 +516,12 @@ static int ar9170_usb_request_firmware(struct ar9170_usb *aru)
return 0;
}

+ if (aru->req_one_stage_fw) {
+ dev_err(&aru->udev->dev, "ar9170.fw firmware file "
+ "not found and is required for this device\n");
+ return -EINVAL;
+ }
+
dev_err(&aru->udev->dev, "ar9170.fw firmware file "
"not found, trying old firmware...\n");

@@ -668,6 +678,22 @@ err_out:
return err;
}

+static bool ar9170_requires_one_stage(const struct usb_device_id *id)
+{
+ /* AVM FRITZ only */
+ if (id->idVendor != 0x057C)
+ return false;
+
+ switch (id->idProduct) {
+ case 0x8401: /* AVM FRITZ!WLAN USB Stick N */
+ case 0x8402: /* AVM FRITZ!WLAN USB Stick N 2.4 */
+ return true;
+ default:
+ return false;
+ }
+ return false;
+}
+
static int ar9170_usb_probe(struct usb_interface *intf,
const struct usb_device_id *id)
{
@@ -688,6 +714,8 @@ static int ar9170_usb_probe(struct usb_interface *intf,
aru->intf = intf;
ar = &aru->common;

+ aru->req_one_stage_fw = ar9170_requires_one_stage(id);
+
usb_set_intfdata(intf, aru);
SET_IEEE80211_DEV(ar->hw, &udev->dev);

diff --git a/drivers/net/wireless/ath/ar9170/usb.h b/drivers/net/wireless/ath/ar9170/usb.h
index ac42586..69f4bce 100644
--- a/drivers/net/wireless/ath/ar9170/usb.h
+++ b/drivers/net/wireless/ath/ar9170/usb.h
@@ -62,6 +62,8 @@ struct ar9170_usb {
struct usb_anchor rx_submitted;
struct usb_anchor tx_submitted;

+ bool req_one_stage_fw;
+
spinlock_t cmdlock;
struct completion cmd_wait;
int readlen;
--
1.6.0.6


2009-05-28 19:28:59

by Luis R. Rodriguez

[permalink] [raw]
Subject: Re: [RFT 2/2] ar9170: add AVM FRITZ devices

On Thu, May 28, 2009 at 08:22:38AM -0700, Pavel Roskin wrote:
> On Thu, 2009-05-28 at 09:17 +0200, Marcel Holtmann wrote:
>
> > can't you make this part of use_device_id table? Syncing up with product
> > ids in two places is not a good idea.

I take it you mean usb_device_id, and sure driver_info.

> It would be even better to use an internal chip ID, an equivalent to the
> SREV register in ath5k and ath9k, if it exists in ar9170.

Not sure if such things exists.

Luis

2009-05-28 15:22:54

by Pavel Roskin

[permalink] [raw]
Subject: Re: [RFT 2/2] ar9170: add AVM FRITZ devices

On Thu, 2009-05-28 at 09:17 +0200, Marcel Holtmann wrote:

> can't you make this part of use_device_id table? Syncing up with product
> ids in two places is not a good idea.

It would be even better to use an internal chip ID, an equivalent to the
SREV register in ath5k and ath9k, if it exists in ar9170.

--
Regards,
Pavel Roskin

2009-05-28 16:03:44

by Christian Lamparter

[permalink] [raw]
Subject: Re: [RFT 1/2] ar9170: add initial support for 1-stage firmware

On Thursday 28 May 2009 03:48:45 Luis R. Rodriguez wrote:
> You can get the stage 1 firmware from here:
>
> http://www.kernel.org/pub/linux/kernel/people/mcgrof/firmware/ar9170/ar9170.fw
>
> Its license:
>
> http://www.kernel.org/pub/linux/kernel/people/mcgrof/firmware/ar9170/LICENSE
>
> It seems with some devices this works, with some others
> I see only scan working. We shall not push this firmware
> into the linux-firmware tree until these issues have been
> resolved.
>
> Cc: Peter Grabienski <[email protected]>
> Cc: Stephen Chen <[email protected]>
> Cc: Michael Fortin <[email protected]>
> Cc: Johnny Cheng <[email protected]>
> Cc: Yuan-Gu Wei <[email protected]>
> Cc: Joerg Albert <[email protected]>
> Signed-off-by: Luis R. Rodriguez <[email protected]>
> ---
> drivers/net/wireless/ath/ar9170/phy.c | 13 ++++++++++---
> drivers/net/wireless/ath/ar9170/usb.c | 22 +++++++++++++++++-----
> 2 files changed, 27 insertions(+), 8 deletions(-)
>
> diff --git a/drivers/net/wireless/ath/ar9170/phy.c b/drivers/net/wireless/ath/ar9170/phy.c
> index 6ce2075..0675dc8 100644
> --- a/drivers/net/wireless/ath/ar9170/phy.c
> +++ b/drivers/net/wireless/ath/ar9170/phy.c
> @@ -39,6 +39,7 @@
> #include <linux/bitrev.h>
> #include "ar9170.h"
> #include "cmd.h"
> +#include "usb.h"
>
> static int ar9170_init_power_cal(struct ar9170 *ar)
> {
> @@ -996,6 +997,10 @@ static int ar9170_set_power_cal(struct ar9170 *ar, u32 freq, enum ar9170_bw bw)
> int idx, i, n;
> u8 ackpower, ackchains, f;
> u8 pwr_freqs[AR5416_MAX_NUM_TGT_PWRS];
> + struct ar9170_usb *aru;
> +
> + /* All ar9170 devices are USB */
> + aru = container_of(ar, struct ar9170_usb, common);
>
> if (freq < 3000)
> f = freq - 2300;
> @@ -1102,9 +1107,11 @@ static int ar9170_set_power_cal(struct ar9170 *ar, u32 freq, enum ar9170_bw bw)
> else
> ackpower = ar->power_5G_leg[0] & 0x3f;
>
> - ar9170_regwrite(0x1c3694, ackpower << 20 | ackchains << 26);
> - ar9170_regwrite(0x1c3bb4, ackpower << 5 | ackchains << 11 |
> - ackpower << 21 | ackchains << 27);
> + if (aru->init_values) {
> + ar9170_regwrite(0x1c3694, ackpower << 20 | ackchains << 26);
> + ar9170_regwrite(0x1c3bb4, ackpower << 5 | ackchains << 11 |
> + ackpower << 21 | ackchains << 27);
> + }
>
> ar9170_regwrite_finish();
> return ar9170_regwrite_result();
I guess you can drop this changes. see hpmain.c line 4039, 4061, 4069

--> #if_N_def ZM_OTUS_LINUX_PHASE_2 <--
zfDelayWriteInternalReg(dev, 0x1c3694, ((hpPriv->tPow2x2g[0]&0x3f) << 20) | (0x5<<26));
zfDelayWriteInternalReg(dev, 0x1c3bb4, ((hpPriv->tPow2x2g[0]&0x3f) << 5 ) | (0x5<<11) |
((hpPriv->tPow2x2g[0]&0x3f) << 21) | (0x5<<27) );
#endif

so, the current ar9170 code is actually _wrong_ (but works!)...
and we should not touch these fields with the 2-stage firmware.

OT: since the firmware will (inevitably end up in the firmware-git-tree)
we should convert it to ihex, so it can be downloaded with the git-web.
(this can be done by: objcopy -I binary -O ihex ar9170.fw ar9170.fw.ihex )

And for future: it might be a good idea to add a little header/tail on the
firmware files. e.g.:
- firmware version and variant (e.g. 1-stage or 2-stage firmware)
- supported hardware variants/interfaces
- maybe API revision / feature bitmap
- maybe more: e.g: vendor string / build / build-date / build no. etc.

Regards,
Chr

2009-05-28 07:18:11

by Marcel Holtmann

[permalink] [raw]
Subject: Re: [RFT 2/2] ar9170: add AVM FRITZ devices

Hi Luis,

> This adds:
>
> USB 0x057C:0x8401 AVM FRITZ!WLAN USB Stick N
> USB 0x057C:0x8402 AVM FRITZ!WLAN USB Stick N 2.4
>
> These devices require the 1-stage firmware, if not present we
> don't continue.
>
> Cc: Peter Grabienski <[email protected]>
> Cc: Stephen Chen <[email protected]>
> Cc: Michael Fortin <[email protected]>
> Cc: Johnny Cheng <[email protected]>
> Cc: Yuan-Gu Wei <[email protected]>
> Cc: Joerg Albert <[email protected]>
> Signed-off-by: Luis R. Rodriguez <[email protected]>
> ---
> drivers/net/wireless/ath/ar9170/usb.c | 28 ++++++++++++++++++++++++++++
> drivers/net/wireless/ath/ar9170/usb.h | 2 ++
> 2 files changed, 30 insertions(+), 0 deletions(-)
>
> diff --git a/drivers/net/wireless/ath/ar9170/usb.c b/drivers/net/wireless/ath/ar9170/usb.c
> index 3c97c09..45b5291 100644
> --- a/drivers/net/wireless/ath/ar9170/usb.c
> +++ b/drivers/net/wireless/ath/ar9170/usb.c
> @@ -82,6 +82,10 @@ static struct usb_device_id ar9170_usb_ids[] = {
> { USB_DEVICE(0x2019, 0x5304) },
> /* IO-Data WNGDNUS2 */
> { USB_DEVICE(0x04bb, 0x093f) },
> + /* AVM FRITZ!WLAN USB Stick N */
> + { USB_DEVICE(0x057C, 0x8401) },
> + /* AVM FRITZ!WLAN USB Stick N 2.4 */
> + { USB_DEVICE(0x057C, 0x8402) },
>
> /* terminate */
> {}
> @@ -512,6 +516,12 @@ static int ar9170_usb_request_firmware(struct ar9170_usb *aru)
> return 0;
> }
>
> + if (aru->req_one_stage_fw) {
> + dev_err(&aru->udev->dev, "ar9170.fw firmware file "
> + "not found and is required for this device\n");
> + return -EINVAL;
> + }
> +
> dev_err(&aru->udev->dev, "ar9170.fw firmware file "
> "not found, trying old firmware...\n");
>
> @@ -668,6 +678,22 @@ err_out:
> return err;
> }
>
> +static bool ar9170_requires_one_stage(const struct usb_device_id *id)
> +{
> + /* AVM FRITZ only */
> + if (id->idVendor != 0x057C)
> + return false;
> +
> + switch (id->idProduct) {
> + case 0x8401: /* AVM FRITZ!WLAN USB Stick N */
> + case 0x8402: /* AVM FRITZ!WLAN USB Stick N 2.4 */
> + return true;
> + default:
> + return false;
> + }
> + return false;
> +}
> +

can't you make this part of use_device_id table? Syncing up with product
ids in two places is not a good idea.

Regards

Marcel



2009-05-28 01:48:46

by Luis R. Rodriguez

[permalink] [raw]
Subject: [RFT 1/2] ar9170: add initial 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

Its license:

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

It seems with some devices this works, with some others
I see only scan working. We shall not push this firmware
into the linux-firmware tree until these issues have been
resolved.

Cc: Peter Grabienski <[email protected]>
Cc: Stephen Chen <[email protected]>
Cc: Michael Fortin <[email protected]>
Cc: Johnny Cheng <[email protected]>
Cc: Yuan-Gu Wei <[email protected]>
Cc: Joerg Albert <[email protected]>
Signed-off-by: Luis R. Rodriguez <[email protected]>
---
drivers/net/wireless/ath/ar9170/phy.c | 13 ++++++++++---
drivers/net/wireless/ath/ar9170/usb.c | 22 +++++++++++++++++-----
2 files changed, 27 insertions(+), 8 deletions(-)

diff --git a/drivers/net/wireless/ath/ar9170/phy.c b/drivers/net/wireless/ath/ar9170/phy.c
index 6ce2075..0675dc8 100644
--- a/drivers/net/wireless/ath/ar9170/phy.c
+++ b/drivers/net/wireless/ath/ar9170/phy.c
@@ -39,6 +39,7 @@
#include <linux/bitrev.h>
#include "ar9170.h"
#include "cmd.h"
+#include "usb.h"

static int ar9170_init_power_cal(struct ar9170 *ar)
{
@@ -996,6 +997,10 @@ static int ar9170_set_power_cal(struct ar9170 *ar, u32 freq, enum ar9170_bw bw)
int idx, i, n;
u8 ackpower, ackchains, f;
u8 pwr_freqs[AR5416_MAX_NUM_TGT_PWRS];
+ struct ar9170_usb *aru;
+
+ /* All ar9170 devices are USB */
+ aru = container_of(ar, struct ar9170_usb, common);

if (freq < 3000)
f = freq - 2300;
@@ -1102,9 +1107,11 @@ static int ar9170_set_power_cal(struct ar9170 *ar, u32 freq, enum ar9170_bw bw)
else
ackpower = ar->power_5G_leg[0] & 0x3f;

- ar9170_regwrite(0x1c3694, ackpower << 20 | ackchains << 26);
- ar9170_regwrite(0x1c3bb4, ackpower << 5 | ackchains << 11 |
- ackpower << 21 | ackchains << 27);
+ if (aru->init_values) {
+ ar9170_regwrite(0x1c3694, ackpower << 20 | ackchains << 26);
+ ar9170_regwrite(0x1c3bb4, ackpower << 5 | ackchains << 11 |
+ ackpower << 21 | ackchains << 27);
+ }

ar9170_regwrite_finish();
return ar9170_regwrite_result();
diff --git a/drivers/net/wireless/ath/ar9170/usb.c b/drivers/net/wireless/ath/ar9170/usb.c
index d7c13c0..3c97c09 100644
--- a/drivers/net/wireless/ath/ar9170/usb.c
+++ b/drivers/net/wireless/ath/ar9170/usb.c
@@ -51,6 +51,7 @@ MODULE_AUTHOR("Johannes Berg <[email protected]>");
MODULE_AUTHOR("Christian Lamparter <[email protected]>");
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");

@@ -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;
}

@@ -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);
@@ -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);
--
1.6.0.6