aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/iwmc3200wifi/rx.c
diff options
context:
space:
mode:
authorSamuel Ortiz <sameo@linux.intel.com>2009-10-16 01:18:48 -0400
committerJohn W. Linville <linville@tuxdriver.com>2009-10-27 16:48:24 -0400
commite85498b21d0372a00f31ab9f7c0d215c32c9fad5 (patch)
tree1721f68239a613b4d10d63513d71163ca78a1c4d /drivers/net/wireless/iwmc3200wifi/rx.c
parenta82aedbf1b043f7a7474aa9b6d223104ac51827a (diff)
iwmc3200wifi: CT kill support
We set the initial CT (Temperature control) value to 110 degrees. If the chip goes over that threshold, we hard block the device which will turn it down. At the same time we schedule a 30 seconds delayed work that unblock the device (and userspace is supposed to bring it back up), hoping that the chip will have cooled down by then... Signed-off-by: Samuel Ortiz <sameo@linux.intel.com> Signed-off-by: Zhu Yi <yi.zhu@intel.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/iwmc3200wifi/rx.c')
-rw-r--r--drivers/net/wireless/iwmc3200wifi/rx.c16
1 files changed, 15 insertions, 1 deletions
diff --git a/drivers/net/wireless/iwmc3200wifi/rx.c b/drivers/net/wireless/iwmc3200wifi/rx.c
index 40dbcbc16593..14a2a0b3d614 100644
--- a/drivers/net/wireless/iwmc3200wifi/rx.c
+++ b/drivers/net/wireless/iwmc3200wifi/rx.c
@@ -1078,6 +1078,7 @@ static int iwm_ntf_wifi_if_wrapper(struct iwm_priv *iwm, u8 *buf,
1078 return 0; 1078 return 0;
1079} 1079}
1080 1080
1081#define CT_KILL_DELAY (30 * HZ)
1081static int iwm_ntf_card_state(struct iwm_priv *iwm, u8 *buf, 1082static int iwm_ntf_card_state(struct iwm_priv *iwm, u8 *buf,
1082 unsigned long buf_size, struct iwm_wifi_cmd *cmd) 1083 unsigned long buf_size, struct iwm_wifi_cmd *cmd)
1083{ 1084{
@@ -1090,7 +1091,20 @@ static int iwm_ntf_card_state(struct iwm_priv *iwm, u8 *buf,
1090 flags & IWM_CARD_STATE_HW_DISABLED ? "ON" : "OFF", 1091 flags & IWM_CARD_STATE_HW_DISABLED ? "ON" : "OFF",
1091 flags & IWM_CARD_STATE_CTKILL_DISABLED ? "ON" : "OFF"); 1092 flags & IWM_CARD_STATE_CTKILL_DISABLED ? "ON" : "OFF");
1092 1093
1093 wiphy_rfkill_set_hw_state(wiphy, flags & IWM_CARD_STATE_HW_DISABLED); 1094 if (flags & IWM_CARD_STATE_CTKILL_DISABLED) {
1095 /*
1096 * We got a CTKILL event: We bring the interface down in
1097 * oder to cool the device down, and try to bring it up
1098 * 30 seconds later. If it's still too hot, we'll go through
1099 * this code path again.
1100 */
1101 cancel_delayed_work_sync(&iwm->ct_kill_delay);
1102 schedule_delayed_work(&iwm->ct_kill_delay, CT_KILL_DELAY);
1103 }
1104
1105 wiphy_rfkill_set_hw_state(wiphy, flags &
1106 (IWM_CARD_STATE_HW_DISABLED |
1107 IWM_CARD_STATE_CTKILL_DISABLED));
1094 1108
1095 return 0; 1109 return 0;
1096} 1110}