aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net
diff options
context:
space:
mode:
authorDavid S. Miller <davem@davemloft.net>2009-04-20 18:33:46 -0400
committerDavid S. Miller <davem@davemloft.net>2009-04-20 18:33:46 -0400
commit775d8d931581764a1ec982ebe5a927b12762fb6d (patch)
tree574580bc6a4d625f0a50327ec68261d6bfbf0a12 /drivers/net
parent62cedd11f63c99efd2962fb69763a09e2778f6e6 (diff)
parent7e0986c17f695952ce5d61ed793ce048ba90a661 (diff)
Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/linville/wireless-2.6
Diffstat (limited to 'drivers/net')
-rw-r--r--drivers/net/wireless/ar9170/usb.c110
-rw-r--r--drivers/net/wireless/iwlwifi/iwl3945-base.c2
-rw-r--r--drivers/net/wireless/mwl8k.c4
-rw-r--r--drivers/net/wireless/p54/p54common.c2
-rw-r--r--drivers/net/wireless/rt2x00/rt2x00pci.c18
-rw-r--r--drivers/net/wireless/rt2x00/rt2x00usb.c18
6 files changed, 95 insertions, 59 deletions
diff --git a/drivers/net/wireless/ar9170/usb.c b/drivers/net/wireless/ar9170/usb.c
index c9e422ead925..fddda477095c 100644
--- a/drivers/net/wireless/ar9170/usb.c
+++ b/drivers/net/wireless/ar9170/usb.c
@@ -623,6 +623,39 @@ static int ar9170_usb_open(struct ar9170 *ar)
623 return 0; 623 return 0;
624} 624}
625 625
626static int ar9170_usb_init_device(struct ar9170_usb *aru)
627{
628 int err;
629
630 err = ar9170_usb_alloc_rx_irq_urb(aru);
631 if (err)
632 goto err_out;
633
634 err = ar9170_usb_alloc_rx_bulk_urbs(aru);
635 if (err)
636 goto err_unrx;
637
638 err = ar9170_usb_upload_firmware(aru);
639 if (err) {
640 err = ar9170_echo_test(&aru->common, 0x60d43110);
641 if (err) {
642 /* force user invention, by disabling the device */
643 err = usb_driver_set_configuration(aru->udev, -1);
644 dev_err(&aru->udev->dev, "device is in a bad state. "
645 "please reconnect it!\n");
646 goto err_unrx;
647 }
648 }
649
650 return 0;
651
652err_unrx:
653 ar9170_usb_cancel_urbs(aru);
654
655err_out:
656 return err;
657}
658
626static int ar9170_usb_probe(struct usb_interface *intf, 659static int ar9170_usb_probe(struct usb_interface *intf,
627 const struct usb_device_id *id) 660 const struct usb_device_id *id)
628{ 661{
@@ -658,32 +691,16 @@ static int ar9170_usb_probe(struct usb_interface *intf,
658 691
659 err = ar9170_usb_reset(aru); 692 err = ar9170_usb_reset(aru);
660 if (err) 693 if (err)
661 goto err_unlock; 694 goto err_freehw;
662 695
663 err = ar9170_usb_request_firmware(aru); 696 err = ar9170_usb_request_firmware(aru);
664 if (err) 697 if (err)
665 goto err_unlock; 698 goto err_freehw;
666 699
667 err = ar9170_usb_alloc_rx_irq_urb(aru); 700 err = ar9170_usb_init_device(aru);
668 if (err) 701 if (err)
669 goto err_freefw; 702 goto err_freefw;
670 703
671 err = ar9170_usb_alloc_rx_bulk_urbs(aru);
672 if (err)
673 goto err_unrx;
674
675 err = ar9170_usb_upload_firmware(aru);
676 if (err) {
677 err = ar9170_echo_test(&aru->common, 0x60d43110);
678 if (err) {
679 /* force user invention, by disabling the device */
680 err = usb_driver_set_configuration(aru->udev, -1);
681 dev_err(&aru->udev->dev, "device is in a bad state. "
682 "please reconnect it!\n");
683 goto err_unrx;
684 }
685 }
686
687 err = ar9170_usb_open(ar); 704 err = ar9170_usb_open(ar);
688 if (err) 705 if (err)
689 goto err_unrx; 706 goto err_unrx;
@@ -703,7 +720,7 @@ err_freefw:
703 release_firmware(aru->init_values); 720 release_firmware(aru->init_values);
704 release_firmware(aru->firmware); 721 release_firmware(aru->firmware);
705 722
706err_unlock: 723err_freehw:
707 usb_set_intfdata(intf, NULL); 724 usb_set_intfdata(intf, NULL);
708 usb_put_dev(udev); 725 usb_put_dev(udev);
709 ieee80211_free_hw(ar->hw); 726 ieee80211_free_hw(ar->hw);
@@ -730,12 +747,65 @@ static void ar9170_usb_disconnect(struct usb_interface *intf)
730 ieee80211_free_hw(aru->common.hw); 747 ieee80211_free_hw(aru->common.hw);
731} 748}
732 749
750#ifdef CONFIG_PM
751static int ar9170_suspend(struct usb_interface *intf,
752 pm_message_t message)
753{
754 struct ar9170_usb *aru = usb_get_intfdata(intf);
755
756 if (!aru)
757 return -ENODEV;
758
759 aru->common.state = AR9170_IDLE;
760 ar9170_usb_cancel_urbs(aru);
761
762 return 0;
763}
764
765static int ar9170_resume(struct usb_interface *intf)
766{
767 struct ar9170_usb *aru = usb_get_intfdata(intf);
768 int err;
769
770 if (!aru)
771 return -ENODEV;
772
773 usb_unpoison_anchored_urbs(&aru->rx_submitted);
774 usb_unpoison_anchored_urbs(&aru->tx_submitted);
775
776 /*
777 * FIXME: firmware upload will fail on resume.
778 * but this is better than a hang!
779 */
780
781 err = ar9170_usb_init_device(aru);
782 if (err)
783 goto err_unrx;
784
785 err = ar9170_usb_open(&aru->common);
786 if (err)
787 goto err_unrx;
788
789 return 0;
790
791err_unrx:
792 aru->common.state = AR9170_IDLE;
793 ar9170_usb_cancel_urbs(aru);
794
795 return err;
796}
797#endif /* CONFIG_PM */
798
733static struct usb_driver ar9170_driver = { 799static struct usb_driver ar9170_driver = {
734 .name = "ar9170usb", 800 .name = "ar9170usb",
735 .probe = ar9170_usb_probe, 801 .probe = ar9170_usb_probe,
736 .disconnect = ar9170_usb_disconnect, 802 .disconnect = ar9170_usb_disconnect,
737 .id_table = ar9170_usb_ids, 803 .id_table = ar9170_usb_ids,
738 .soft_unbind = 1, 804 .soft_unbind = 1,
805#ifdef CONFIG_PM
806 .suspend = ar9170_suspend,
807 .resume = ar9170_resume,
808#endif /* CONFIG_PM */
739}; 809};
740 810
741static int __init ar9170_init(void) 811static int __init ar9170_init(void)
diff --git a/drivers/net/wireless/iwlwifi/iwl3945-base.c b/drivers/net/wireless/iwlwifi/iwl3945-base.c
index 8d738d752487..da61ecd62882 100644
--- a/drivers/net/wireless/iwlwifi/iwl3945-base.c
+++ b/drivers/net/wireless/iwlwifi/iwl3945-base.c
@@ -4075,7 +4075,7 @@ static int iwl3945_mac_set_key(struct ieee80211_hw *hw, enum set_key_cmd cmd,
4075 if (!static_key) { 4075 if (!static_key) {
4076 sta_id = iwl3945_hw_find_station(priv, addr); 4076 sta_id = iwl3945_hw_find_station(priv, addr);
4077 if (sta_id == IWL_INVALID_STATION) { 4077 if (sta_id == IWL_INVALID_STATION) {
4078 IWL_DEBUG_MAC80211(priv, "leave - %pMnot in station map.\n", 4078 IWL_DEBUG_MAC80211(priv, "leave - %pM not in station map.\n",
4079 addr); 4079 addr);
4080 return -EINVAL; 4080 return -EINVAL;
4081 } 4081 }
diff --git a/drivers/net/wireless/mwl8k.c b/drivers/net/wireless/mwl8k.c
index 57a0268d1bae..b5dbf6d9e517 100644
--- a/drivers/net/wireless/mwl8k.c
+++ b/drivers/net/wireless/mwl8k.c
@@ -3720,12 +3720,12 @@ err_free_reg:
3720 return rc; 3720 return rc;
3721} 3721}
3722 3722
3723static void __devexit mwl8k_remove(struct pci_dev *pdev) 3723static void __devexit mwl8k_shutdown(struct pci_dev *pdev)
3724{ 3724{
3725 printk(KERN_ERR "===>%s(%u)\n", __func__, __LINE__); 3725 printk(KERN_ERR "===>%s(%u)\n", __func__, __LINE__);
3726} 3726}
3727 3727
3728static void __devexit mwl8k_shutdown(struct pci_dev *pdev) 3728static void __devexit mwl8k_remove(struct pci_dev *pdev)
3729{ 3729{
3730 struct ieee80211_hw *hw = pci_get_drvdata(pdev); 3730 struct ieee80211_hw *hw = pci_get_drvdata(pdev);
3731 struct mwl8k_priv *priv; 3731 struct mwl8k_priv *priv;
diff --git a/drivers/net/wireless/p54/p54common.c b/drivers/net/wireless/p54/p54common.c
index 0c1b0577d4ee..c8f0232ee5e0 100644
--- a/drivers/net/wireless/p54/p54common.c
+++ b/drivers/net/wireless/p54/p54common.c
@@ -2543,8 +2543,6 @@ struct ieee80211_hw *p54_init_common(size_t priv_data_len)
2543 priv->basic_rate_mask = 0x15f; 2543 priv->basic_rate_mask = 0x15f;
2544 skb_queue_head_init(&priv->tx_queue); 2544 skb_queue_head_init(&priv->tx_queue);
2545 dev->flags = IEEE80211_HW_RX_INCLUDES_FCS | 2545 dev->flags = IEEE80211_HW_RX_INCLUDES_FCS |
2546 IEEE80211_HW_SUPPORTS_PS |
2547 IEEE80211_HW_PS_NULLFUNC_STACK |
2548 IEEE80211_HW_SIGNAL_DBM | 2546 IEEE80211_HW_SIGNAL_DBM |
2549 IEEE80211_HW_NOISE_DBM; 2547 IEEE80211_HW_NOISE_DBM;
2550 2548
diff --git a/drivers/net/wireless/rt2x00/rt2x00pci.c b/drivers/net/wireless/rt2x00/rt2x00pci.c
index 43fa0f849003..9730b4f8fd26 100644
--- a/drivers/net/wireless/rt2x00/rt2x00pci.c
+++ b/drivers/net/wireless/rt2x00/rt2x00pci.c
@@ -369,8 +369,6 @@ int rt2x00pci_suspend(struct pci_dev *pci_dev, pm_message_t state)
369 if (retval) 369 if (retval)
370 return retval; 370 return retval;
371 371
372 rt2x00pci_free_reg(rt2x00dev);
373
374 pci_save_state(pci_dev); 372 pci_save_state(pci_dev);
375 pci_disable_device(pci_dev); 373 pci_disable_device(pci_dev);
376 return pci_set_power_state(pci_dev, pci_choose_state(pci_dev, state)); 374 return pci_set_power_state(pci_dev, pci_choose_state(pci_dev, state));
@@ -381,7 +379,6 @@ int rt2x00pci_resume(struct pci_dev *pci_dev)
381{ 379{
382 struct ieee80211_hw *hw = pci_get_drvdata(pci_dev); 380 struct ieee80211_hw *hw = pci_get_drvdata(pci_dev);
383 struct rt2x00_dev *rt2x00dev = hw->priv; 381 struct rt2x00_dev *rt2x00dev = hw->priv;
384 int retval;
385 382
386 if (pci_set_power_state(pci_dev, PCI_D0) || 383 if (pci_set_power_state(pci_dev, PCI_D0) ||
387 pci_enable_device(pci_dev) || 384 pci_enable_device(pci_dev) ||
@@ -390,20 +387,7 @@ int rt2x00pci_resume(struct pci_dev *pci_dev)
390 return -EIO; 387 return -EIO;
391 } 388 }
392 389
393 retval = rt2x00pci_alloc_reg(rt2x00dev); 390 return rt2x00lib_resume(rt2x00dev);
394 if (retval)
395 return retval;
396
397 retval = rt2x00lib_resume(rt2x00dev);
398 if (retval)
399 goto exit_free_reg;
400
401 return 0;
402
403exit_free_reg:
404 rt2x00pci_free_reg(rt2x00dev);
405
406 return retval;
407} 391}
408EXPORT_SYMBOL_GPL(rt2x00pci_resume); 392EXPORT_SYMBOL_GPL(rt2x00pci_resume);
409#endif /* CONFIG_PM */ 393#endif /* CONFIG_PM */
diff --git a/drivers/net/wireless/rt2x00/rt2x00usb.c b/drivers/net/wireless/rt2x00/rt2x00usb.c
index 7d50ca82375e..501544882c2c 100644
--- a/drivers/net/wireless/rt2x00/rt2x00usb.c
+++ b/drivers/net/wireless/rt2x00/rt2x00usb.c
@@ -702,8 +702,6 @@ int rt2x00usb_suspend(struct usb_interface *usb_intf, pm_message_t state)
702 if (retval) 702 if (retval)
703 return retval; 703 return retval;
704 704
705 rt2x00usb_free_reg(rt2x00dev);
706
707 /* 705 /*
708 * Decrease usbdev refcount. 706 * Decrease usbdev refcount.
709 */ 707 */
@@ -717,24 +715,10 @@ int rt2x00usb_resume(struct usb_interface *usb_intf)
717{ 715{
718 struct ieee80211_hw *hw = usb_get_intfdata(usb_intf); 716 struct ieee80211_hw *hw = usb_get_intfdata(usb_intf);
719 struct rt2x00_dev *rt2x00dev = hw->priv; 717 struct rt2x00_dev *rt2x00dev = hw->priv;
720 int retval;
721 718
722 usb_get_dev(interface_to_usbdev(usb_intf)); 719 usb_get_dev(interface_to_usbdev(usb_intf));
723 720
724 retval = rt2x00usb_alloc_reg(rt2x00dev); 721 return rt2x00lib_resume(rt2x00dev);
725 if (retval)
726 return retval;
727
728 retval = rt2x00lib_resume(rt2x00dev);
729 if (retval)
730 goto exit_free_reg;
731
732 return 0;
733
734exit_free_reg:
735 rt2x00usb_free_reg(rt2x00dev);
736
737 return retval;
738} 722}
739EXPORT_SYMBOL_GPL(rt2x00usb_resume); 723EXPORT_SYMBOL_GPL(rt2x00usb_resume);
740#endif /* CONFIG_PM */ 724#endif /* CONFIG_PM */