Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 150664
b: refs/heads/master
c: bdf6d32
h: refs/heads/master
v: v3
  • Loading branch information
Luis R. Rodriguez authored and John W. Linville committed Jun 3, 2009
1 parent f371af8 commit 91eeaa0
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: c768b58d62d3106f0f670d35d1e7820c14ba769a
refs/heads/master: bdf6d32f933bf28dfdca325281ee5266c753dc67
25 changes: 25 additions & 0 deletions trunk/drivers/net/wireless/ath/ar9170/usb.c
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,10 @@ MODULE_FIRMWARE("ar9170.fw");
MODULE_FIRMWARE("ar9170-1.fw");
MODULE_FIRMWARE("ar9170-2.fw");

enum ar9170_requirements {
AR9170_REQ_FW1_ONLY = 1,
};

static struct usb_device_id ar9170_usb_ids[] = {
/* Atheros 9170 */
{ USB_DEVICE(0x0cf3, 0x9170) },
Expand Down Expand Up @@ -82,6 +86,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), .driver_info = AR9170_REQ_FW1_ONLY },

/* terminate */
{}
Expand Down Expand Up @@ -512,6 +520,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");

Expand Down Expand Up @@ -668,6 +682,15 @@ static int ar9170_usb_init_device(struct ar9170_usb *aru)
return err;
}

static bool ar9170_requires_one_stage(const struct usb_device_id *id)
{
if (!id->driver_info)
return false;
if (id->driver_info == AR9170_REQ_FW1_ONLY)
return true;
return false;
}

static int ar9170_usb_probe(struct usb_interface *intf,
const struct usb_device_id *id)
{
Expand All @@ -688,6 +711,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);

Expand Down
2 changes: 2 additions & 0 deletions trunk/drivers/net/wireless/ath/ar9170/usb.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 91eeaa0

Please sign in to comment.