aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLuis R. Rodriguez <lrodriguez@atheros.com>2009-05-28 17:36:05 -0400
committerJohn W. Linville <linville@tuxdriver.com>2009-06-03 14:05:11 -0400
commitbdf6d32f933bf28dfdca325281ee5266c753dc67 (patch)
tree8c57bc49bc8c72c59e9d796465d71b390d06d578
parentc768b58d62d3106f0f670d35d1e7820c14ba769a (diff)
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: Luis R. Rodriguez <lrodriguez@atheros.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
-rw-r--r--drivers/net/wireless/ath/ar9170/usb.c25
-rw-r--r--drivers/net/wireless/ath/ar9170/usb.h2
2 files changed, 27 insertions, 0 deletions
diff --git a/drivers/net/wireless/ath/ar9170/usb.c b/drivers/net/wireless/ath/ar9170/usb.c
index 3c97c0985e2a..71579e4d2fce 100644
--- a/drivers/net/wireless/ath/ar9170/usb.c
+++ b/drivers/net/wireless/ath/ar9170/usb.c
@@ -55,6 +55,10 @@ MODULE_FIRMWARE("ar9170.fw");
55MODULE_FIRMWARE("ar9170-1.fw"); 55MODULE_FIRMWARE("ar9170-1.fw");
56MODULE_FIRMWARE("ar9170-2.fw"); 56MODULE_FIRMWARE("ar9170-2.fw");
57 57
58enum ar9170_requirements {
59 AR9170_REQ_FW1_ONLY = 1,
60};
61
58static struct usb_device_id ar9170_usb_ids[] = { 62static struct usb_device_id ar9170_usb_ids[] = {
59 /* Atheros 9170 */ 63 /* Atheros 9170 */
60 { USB_DEVICE(0x0cf3, 0x9170) }, 64 { USB_DEVICE(0x0cf3, 0x9170) },
@@ -82,6 +86,10 @@ static struct usb_device_id ar9170_usb_ids[] = {
82 { USB_DEVICE(0x2019, 0x5304) }, 86 { USB_DEVICE(0x2019, 0x5304) },
83 /* IO-Data WNGDNUS2 */ 87 /* IO-Data WNGDNUS2 */
84 { USB_DEVICE(0x04bb, 0x093f) }, 88 { USB_DEVICE(0x04bb, 0x093f) },
89 /* AVM FRITZ!WLAN USB Stick N */
90 { USB_DEVICE(0x057C, 0x8401) },
91 /* AVM FRITZ!WLAN USB Stick N 2.4 */
92 { USB_DEVICE(0x057C, 0x8402), .driver_info = AR9170_REQ_FW1_ONLY },
85 93
86 /* terminate */ 94 /* terminate */
87 {} 95 {}
@@ -512,6 +520,12 @@ static int ar9170_usb_request_firmware(struct ar9170_usb *aru)
512 return 0; 520 return 0;
513 } 521 }
514 522
523 if (aru->req_one_stage_fw) {
524 dev_err(&aru->udev->dev, "ar9170.fw firmware file "
525 "not found and is required for this device\n");
526 return -EINVAL;
527 }
528
515 dev_err(&aru->udev->dev, "ar9170.fw firmware file " 529 dev_err(&aru->udev->dev, "ar9170.fw firmware file "
516 "not found, trying old firmware...\n"); 530 "not found, trying old firmware...\n");
517 531
@@ -668,6 +682,15 @@ err_out:
668 return err; 682 return err;
669} 683}
670 684
685static bool ar9170_requires_one_stage(const struct usb_device_id *id)
686{
687 if (!id->driver_info)
688 return false;
689 if (id->driver_info == AR9170_REQ_FW1_ONLY)
690 return true;
691 return false;
692}
693
671static int ar9170_usb_probe(struct usb_interface *intf, 694static int ar9170_usb_probe(struct usb_interface *intf,
672 const struct usb_device_id *id) 695 const struct usb_device_id *id)
673{ 696{
@@ -688,6 +711,8 @@ static int ar9170_usb_probe(struct usb_interface *intf,
688 aru->intf = intf; 711 aru->intf = intf;
689 ar = &aru->common; 712 ar = &aru->common;
690 713
714 aru->req_one_stage_fw = ar9170_requires_one_stage(id);
715
691 usb_set_intfdata(intf, aru); 716 usb_set_intfdata(intf, aru);
692 SET_IEEE80211_DEV(ar->hw, &udev->dev); 717 SET_IEEE80211_DEV(ar->hw, &udev->dev);
693 718
diff --git a/drivers/net/wireless/ath/ar9170/usb.h b/drivers/net/wireless/ath/ar9170/usb.h
index ac42586495d8..69f4bceb0af3 100644
--- a/drivers/net/wireless/ath/ar9170/usb.h
+++ b/drivers/net/wireless/ath/ar9170/usb.h
@@ -62,6 +62,8 @@ struct ar9170_usb {
62 struct usb_anchor rx_submitted; 62 struct usb_anchor rx_submitted;
63 struct usb_anchor tx_submitted; 63 struct usb_anchor tx_submitted;
64 64
65 bool req_one_stage_fw;
66
65 spinlock_t cmdlock; 67 spinlock_t cmdlock;
66 struct completion cmd_wait; 68 struct completion cmd_wait;
67 int readlen; 69 int readlen;