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

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 <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 c768b58d
...@@ -55,6 +55,10 @@ MODULE_FIRMWARE("ar9170.fw"); ...@@ -55,6 +55,10 @@ MODULE_FIRMWARE("ar9170.fw");
MODULE_FIRMWARE("ar9170-1.fw"); MODULE_FIRMWARE("ar9170-1.fw");
MODULE_FIRMWARE("ar9170-2.fw"); MODULE_FIRMWARE("ar9170-2.fw");
enum ar9170_requirements {
AR9170_REQ_FW1_ONLY = 1,
};
static struct usb_device_id ar9170_usb_ids[] = { static struct usb_device_id ar9170_usb_ids[] = {
/* Atheros 9170 */ /* Atheros 9170 */
{ USB_DEVICE(0x0cf3, 0x9170) }, { USB_DEVICE(0x0cf3, 0x9170) },
...@@ -82,6 +86,10 @@ static struct usb_device_id ar9170_usb_ids[] = { ...@@ -82,6 +86,10 @@ static struct usb_device_id ar9170_usb_ids[] = {
{ USB_DEVICE(0x2019, 0x5304) }, { USB_DEVICE(0x2019, 0x5304) },
/* IO-Data WNGDNUS2 */ /* IO-Data WNGDNUS2 */
{ USB_DEVICE(0x04bb, 0x093f) }, { 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 */ /* terminate */
{} {}
...@@ -512,6 +520,12 @@ static int ar9170_usb_request_firmware(struct ar9170_usb *aru) ...@@ -512,6 +520,12 @@ static int ar9170_usb_request_firmware(struct ar9170_usb *aru)
return 0; 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 " dev_err(&aru->udev->dev, "ar9170.fw firmware file "
"not found, trying old firmware...\n"); "not found, trying old firmware...\n");
...@@ -668,6 +682,15 @@ static int ar9170_usb_init_device(struct ar9170_usb *aru) ...@@ -668,6 +682,15 @@ static int ar9170_usb_init_device(struct ar9170_usb *aru)
return err; 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, static int ar9170_usb_probe(struct usb_interface *intf,
const struct usb_device_id *id) const struct usb_device_id *id)
{ {
...@@ -688,6 +711,8 @@ static int ar9170_usb_probe(struct usb_interface *intf, ...@@ -688,6 +711,8 @@ static int ar9170_usb_probe(struct usb_interface *intf,
aru->intf = intf; aru->intf = intf;
ar = &aru->common; ar = &aru->common;
aru->req_one_stage_fw = ar9170_requires_one_stage(id);
usb_set_intfdata(intf, aru); usb_set_intfdata(intf, aru);
SET_IEEE80211_DEV(ar->hw, &udev->dev); SET_IEEE80211_DEV(ar->hw, &udev->dev);
......
...@@ -62,6 +62,8 @@ struct ar9170_usb { ...@@ -62,6 +62,8 @@ struct ar9170_usb {
struct usb_anchor rx_submitted; struct usb_anchor rx_submitted;
struct usb_anchor tx_submitted; struct usb_anchor tx_submitted;
bool req_one_stage_fw;
spinlock_t cmdlock; spinlock_t cmdlock;
struct completion cmd_wait; struct completion cmd_wait;
int readlen; int readlen;
......
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