Skip to contentSkip to conversation

rtl8192{ce,cu,de,se}: avoid problems because of possible ERFOFF -> ERFSLEEP -> .. transition

PATCH New Larry Finger 1 participant 1 message Dec 7, 2011 Networking drivers (wireless)

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 rtl8192{ce,cu,de,se}: avoid problems because of possible ERFOFF -> ERFSLEEP -> .. transition

From: Philipp Dreimann <[email protected]>

In drivers rtl8192ce, rtl8192cu, rtl8192se, and rtl8192de, missing break statements would allow ppsc->rfpwr_state to be changed to ERFSLEEP even though the device is actually in ERFOFF.

---

John,

I have not heard anything from Chaoming, but this code certainly looks wrong. Please apply to 3.2 if possible.

Larry

---
 drivers/net/wireless/rtlwifi/rtl8192ce/phy.c |    3 ++-
 drivers/net/wireless/rtlwifi/rtl8192cu/phy.c |    3 ++-
 drivers/net/wireless/rtlwifi/rtl8192de/phy.c |    2 +-
 drivers/net/wireless/rtlwifi/rtl8192se/phy.c |    3 ++-
 4 files changed, 7 insertions(+), 4 deletions(-)
drivers/net/wireless/rtlwifi/rtl8192ce/phy.c +2 -1
index 592a10a..7f6b933 100644
@@ -569,7 +569,8 @@ static bool _rtl92ce_phy_set_rf_power_state(struct ieee80211_hw *hw,
 		}
 	case ERFSLEEP:{
 			if (ppsc->rfpwr_state == ERFOFF)
-				break;
+				return false;
+				
 			for (queue_id = 0, i = 0;
 			     queue_id < RTL_PCI_MAX_TX_QUEUE_COUNT;) {
 				ring = &pcipriv->dev.tx_ring[queue_id];
drivers/net/wireless/rtlwifi/rtl8192cu/phy.c +2 -1
index 7285290..33ada66 100644
@@ -548,7 +548,8 @@ static bool _rtl92cu_phy_set_rf_power_state(struct ieee80211_hw *hw,
 		break;
 	case ERFSLEEP:
 		if (ppsc->rfpwr_state == ERFOFF)
-			break;
+			return false;
+			
 		for (queue_id = 0, i = 0;
 		     queue_id < RTL_PCI_MAX_TX_QUEUE_COUNT;) {
 			ring = &pcipriv->dev.tx_ring[queue_id];
drivers/net/wireless/rtlwifi/rtl8192de/phy.c +1 -1
index 3ac7af1..0883349 100644
@@ -3374,7 +3374,7 @@ bool rtl92d_phy_set_rf_power_state(struct ieee80211_hw *hw,
 		break;
 	case ERFSLEEP:
 		if (ppsc->rfpwr_state == ERFOFF)
-			break;
+			return false;
  		for (queue_id = 0, i = 0;
 		     queue_id < RTL_PCI_MAX_TX_QUEUE_COUNT;) {
drivers/net/wireless/rtlwifi/rtl8192se/phy.c +2 -1
index f27171a..539172e 100644
@@ -602,7 +602,8 @@ bool rtl92s_phy_set_rf_power_state(struct ieee80211_hw *hw,
 		}
 	case ERFSLEEP:
 			if (ppsc->rfpwr_state == ERFOFF)
-				break;
+				return false;
+				
  			for (queue_id = 0, i = 0;
 			     queue_id < RTL_PCI_MAX_TX_QUEUE_COUNT;) {
Signature · 1 line
1.7.7.3