diff options
author | Taehee Yoo <ap420073@gmail.com> | 2015-02-10 11:40:30 -0500 |
---|---|---|
committer | Kalle Valo <kvalo@codeaurora.org> | 2015-02-27 03:05:26 -0500 |
commit | 851639fdaeacbf8c0ff73f73da7bc67b525f5ce9 (patch) | |
tree | e320e88fdf8cf7057494250bea4aa329807a0037 /drivers/net/wireless/rtlwifi/usb.c | |
parent | 0088d27b78f2c0118aee82923269518616481ea0 (diff) |
rtlwifi: Modify some USB de-initialize code.
Delete SET_USB_STOP macro and rtl_usb_deinit because
those are called twice in USB de-initialize routine.
Add some de-initialize workqueue function in USB disconnect routine.
Signed-off-by: Taehee Yoo <ap420073@gmail.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
Diffstat (limited to 'drivers/net/wireless/rtlwifi/usb.c')
-rw-r--r-- | drivers/net/wireless/rtlwifi/usb.c | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/drivers/net/wireless/rtlwifi/usb.c b/drivers/net/wireless/rtlwifi/usb.c index 46ee956d0235..f0188c83c79f 100644 --- a/drivers/net/wireless/rtlwifi/usb.c +++ b/drivers/net/wireless/rtlwifi/usb.c | |||
@@ -701,12 +701,18 @@ free: | |||
701 | 701 | ||
702 | static void _rtl_usb_cleanup_rx(struct ieee80211_hw *hw) | 702 | static void _rtl_usb_cleanup_rx(struct ieee80211_hw *hw) |
703 | { | 703 | { |
704 | struct rtl_priv *rtlpriv = rtl_priv(hw); | ||
704 | struct rtl_usb *rtlusb = rtl_usbdev(rtl_usbpriv(hw)); | 705 | struct rtl_usb *rtlusb = rtl_usbdev(rtl_usbpriv(hw)); |
705 | struct urb *urb; | 706 | struct urb *urb; |
706 | 707 | ||
707 | usb_kill_anchored_urbs(&rtlusb->rx_submitted); | 708 | usb_kill_anchored_urbs(&rtlusb->rx_submitted); |
708 | 709 | ||
709 | tasklet_kill(&rtlusb->rx_work_tasklet); | 710 | tasklet_kill(&rtlusb->rx_work_tasklet); |
711 | cancel_work_sync(&rtlpriv->works.lps_change_work); | ||
712 | |||
713 | flush_workqueue(rtlpriv->works.rtl_wq); | ||
714 | destroy_workqueue(rtlpriv->works.rtl_wq); | ||
715 | |||
710 | skb_queue_purge(&rtlusb->rx_queue); | 716 | skb_queue_purge(&rtlusb->rx_queue); |
711 | 717 | ||
712 | while ((urb = usb_get_from_anchor(&rtlusb->rx_cleanup_urbs))) { | 718 | while ((urb = usb_get_from_anchor(&rtlusb->rx_cleanup_urbs))) { |
@@ -794,8 +800,6 @@ static void rtl_usb_cleanup(struct ieee80211_hw *hw) | |||
794 | struct rtl_usb *rtlusb = rtl_usbdev(rtl_usbpriv(hw)); | 800 | struct rtl_usb *rtlusb = rtl_usbdev(rtl_usbpriv(hw)); |
795 | struct ieee80211_tx_info *txinfo; | 801 | struct ieee80211_tx_info *txinfo; |
796 | 802 | ||
797 | SET_USB_STOP(rtlusb); | ||
798 | |||
799 | /* clean up rx stuff. */ | 803 | /* clean up rx stuff. */ |
800 | _rtl_usb_cleanup_rx(hw); | 804 | _rtl_usb_cleanup_rx(hw); |
801 | 805 | ||
@@ -834,7 +838,6 @@ static void rtl_usb_stop(struct ieee80211_hw *hw) | |||
834 | cancel_work_sync(&rtlpriv->works.fill_h2c_cmd); | 838 | cancel_work_sync(&rtlpriv->works.fill_h2c_cmd); |
835 | /* Enable software */ | 839 | /* Enable software */ |
836 | SET_USB_STOP(rtlusb); | 840 | SET_USB_STOP(rtlusb); |
837 | rtl_usb_deinit(hw); | ||
838 | rtlpriv->cfg->ops->hw_disable(hw); | 841 | rtlpriv->cfg->ops->hw_disable(hw); |
839 | } | 842 | } |
840 | 843 | ||
@@ -1147,9 +1150,9 @@ void rtl_usb_disconnect(struct usb_interface *intf) | |||
1147 | 1150 | ||
1148 | if (unlikely(!rtlpriv)) | 1151 | if (unlikely(!rtlpriv)) |
1149 | return; | 1152 | return; |
1150 | |||
1151 | /* just in case driver is removed before firmware callback */ | 1153 | /* just in case driver is removed before firmware callback */ |
1152 | wait_for_completion(&rtlpriv->firmware_loading_complete); | 1154 | wait_for_completion(&rtlpriv->firmware_loading_complete); |
1155 | clear_bit(RTL_STATUS_INTERFACE_START, &rtlpriv->status); | ||
1153 | /*ieee80211_unregister_hw will call ops_stop */ | 1156 | /*ieee80211_unregister_hw will call ops_stop */ |
1154 | if (rtlmac->mac80211_registered == 1) { | 1157 | if (rtlmac->mac80211_registered == 1) { |
1155 | ieee80211_unregister_hw(hw); | 1158 | ieee80211_unregister_hw(hw); |