aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLarry Finger <Larry.Finger@lwfinger.net>2013-06-28 10:12:53 -0400
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2013-08-04 04:51:14 -0400
commit758057d66f667d17034b6080d06a2c6b5b498544 (patch)
tree92e456e24107748ab35a8d6d159630998cdf76f4
parent6f8bbaf568c7f2c497558bfd04654c0b9841ad57 (diff)
rtlwifi: Initialize power-setting callback for USB devices
commit bcfb879432094c267c35a7ff75d953d3a66c193a upstream. Commit a269913c5 entitled "rtlwifi: Rework rtl_lps_leave() and rtl_lps_enter() to use work queue" has two bugs for USB drivers. Firstly, the work queue in question was not initialized. Secondly, the callback routine used by this queue is contained within the file used for PCI devices. As a result, it is not available for architectures without PCI hardware. Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net> Reported-by: Richard Genoud <richard.genoud@gmail.com> Tested-by: Richard Genoud <richard.genoud@gmail.com> Cc: Richard Genoud <richard.genoud@gmail.com> Signed-off-by: John W. Linville <linville@tuxdriver.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r--drivers/net/wireless/rtlwifi/pci.c13
-rw-r--r--drivers/net/wireless/rtlwifi/ps.c12
-rw-r--r--drivers/net/wireless/rtlwifi/ps.h1
-rw-r--r--drivers/net/wireless/rtlwifi/usb.c2
4 files changed, 15 insertions, 13 deletions
diff --git a/drivers/net/wireless/rtlwifi/pci.c b/drivers/net/wireless/rtlwifi/pci.c
index c97e9d327331..e70b4ffaf97f 100644
--- a/drivers/net/wireless/rtlwifi/pci.c
+++ b/drivers/net/wireless/rtlwifi/pci.c
@@ -1008,19 +1008,6 @@ static void _rtl_pci_prepare_bcn_tasklet(struct ieee80211_hw *hw)
1008 return; 1008 return;
1009} 1009}
1010 1010
1011static void rtl_lps_change_work_callback(struct work_struct *work)
1012{
1013 struct rtl_works *rtlworks =
1014 container_of(work, struct rtl_works, lps_change_work);
1015 struct ieee80211_hw *hw = rtlworks->hw;
1016 struct rtl_priv *rtlpriv = rtl_priv(hw);
1017
1018 if (rtlpriv->enter_ps)
1019 rtl_lps_enter(hw);
1020 else
1021 rtl_lps_leave(hw);
1022}
1023
1024static void _rtl_pci_init_trx_var(struct ieee80211_hw *hw) 1011static void _rtl_pci_init_trx_var(struct ieee80211_hw *hw)
1025{ 1012{
1026 struct rtl_pci *rtlpci = rtl_pcidev(rtl_pcipriv(hw)); 1013 struct rtl_pci *rtlpci = rtl_pcidev(rtl_pcipriv(hw));
diff --git a/drivers/net/wireless/rtlwifi/ps.c b/drivers/net/wireless/rtlwifi/ps.c
index 884bceae38a9..71e917db8338 100644
--- a/drivers/net/wireless/rtlwifi/ps.c
+++ b/drivers/net/wireless/rtlwifi/ps.c
@@ -611,6 +611,18 @@ void rtl_swlps_rf_sleep(struct ieee80211_hw *hw)
611 MSECS(sleep_intv * mac->vif->bss_conf.beacon_int - 40)); 611 MSECS(sleep_intv * mac->vif->bss_conf.beacon_int - 40));
612} 612}
613 613
614void rtl_lps_change_work_callback(struct work_struct *work)
615{
616 struct rtl_works *rtlworks =
617 container_of(work, struct rtl_works, lps_change_work);
618 struct ieee80211_hw *hw = rtlworks->hw;
619 struct rtl_priv *rtlpriv = rtl_priv(hw);
620
621 if (rtlpriv->enter_ps)
622 rtl_lps_enter(hw);
623 else
624 rtl_lps_leave(hw);
625}
614 626
615void rtl_swlps_wq_callback(void *data) 627void rtl_swlps_wq_callback(void *data)
616{ 628{
diff --git a/drivers/net/wireless/rtlwifi/ps.h b/drivers/net/wireless/rtlwifi/ps.h
index 4d682b753f50..88bd76ea88f7 100644
--- a/drivers/net/wireless/rtlwifi/ps.h
+++ b/drivers/net/wireless/rtlwifi/ps.h
@@ -49,5 +49,6 @@ void rtl_swlps_rf_awake(struct ieee80211_hw *hw);
49void rtl_swlps_rf_sleep(struct ieee80211_hw *hw); 49void rtl_swlps_rf_sleep(struct ieee80211_hw *hw);
50void rtl_p2p_ps_cmd(struct ieee80211_hw *hw, u8 p2p_ps_state); 50void rtl_p2p_ps_cmd(struct ieee80211_hw *hw, u8 p2p_ps_state);
51void rtl_p2p_info(struct ieee80211_hw *hw, void *data, unsigned int len); 51void rtl_p2p_info(struct ieee80211_hw *hw, void *data, unsigned int len);
52void rtl_lps_change_work_callback(struct work_struct *work);
52 53
53#endif 54#endif
diff --git a/drivers/net/wireless/rtlwifi/usb.c b/drivers/net/wireless/rtlwifi/usb.c
index a3532e077871..1feebdc92f41 100644
--- a/drivers/net/wireless/rtlwifi/usb.c
+++ b/drivers/net/wireless/rtlwifi/usb.c
@@ -1070,6 +1070,8 @@ int rtl_usb_probe(struct usb_interface *intf,
1070 spin_lock_init(&rtlpriv->locks.usb_lock); 1070 spin_lock_init(&rtlpriv->locks.usb_lock);
1071 INIT_WORK(&rtlpriv->works.fill_h2c_cmd, 1071 INIT_WORK(&rtlpriv->works.fill_h2c_cmd,
1072 rtl_fill_h2c_cmd_work_callback); 1072 rtl_fill_h2c_cmd_work_callback);
1073 INIT_WORK(&rtlpriv->works.lps_change_work,
1074 rtl_lps_change_work_callback);
1073 1075
1074 rtlpriv->usb_data_index = 0; 1076 rtlpriv->usb_data_index = 0;
1075 init_completion(&rtlpriv->firmware_loading_complete); 1077 init_completion(&rtlpriv->firmware_loading_complete);