aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/ath/ar9170/usb.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net/wireless/ath/ar9170/usb.c')
-rw-r--r--drivers/net/wireless/ath/ar9170/usb.c25
1 files changed, 25 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