aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTodd Previte <toddX.a.previte@intel.com>2011-11-10 09:55:02 -0500
committerJohn W. Linville <linville@tuxdriver.com>2011-11-11 12:32:52 -0500
commitb36b110c577a12157112faa1ec41b12924232af4 (patch)
tree39fee352f115ba403284a68cf0b3cfaf28a4a4d5
parent79d3eef89190ee0a7ee585e3949873241bc382e3 (diff)
iwlwifi: Suppress noisy syslog messages when RF_KILL switch engaged
When a station is associated with an AP and the RF_KILL switch is engaged, numerous error messages were sent to the system log. The error messages were the result of the failure(s) of the various submodules to perform their tasks after the radios were disabled. To resolve this situation, the messages were modified to use a new macro, IWL_DEBUG_QUIET_RFKILL. This macro allows for the RF_KILL error messages to be sent to the log provided that IWL_DEBUG is true and IWL_DL_RADIO is '1'. For all other cases, the error messages resulting from an RFKILL event will not be sent to the system log. Messages logged because of an RFKILL will be tagged with the prefix '(RFKILL)' to clarify the cause of the error. Signed-off-by: Todd Previte <toddX.a.previte@intel.com> Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-agn-rxon.c5
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-agn-sta.c2
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-debug.h15
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-trans-pcie-tx.c10
4 files changed, 25 insertions, 7 deletions
diff --git a/drivers/net/wireless/iwlwifi/iwl-agn-rxon.c b/drivers/net/wireless/iwlwifi/iwl-agn-rxon.c
index 58a381c01c8..4c52bee6812 100644
--- a/drivers/net/wireless/iwlwifi/iwl-agn-rxon.c
+++ b/drivers/net/wireless/iwlwifi/iwl-agn-rxon.c
@@ -45,7 +45,8 @@ static int iwlagn_disable_bss(struct iwl_priv *priv,
45 send->filter_flags = old_filter; 45 send->filter_flags = old_filter;
46 46
47 if (ret) 47 if (ret)
48 IWL_ERR(priv, "Error clearing ASSOC_MSK on BSS (%d)\n", ret); 48 IWL_DEBUG_QUIET_RFKILL(priv,
49 "Error clearing ASSOC_MSK on BSS (%d)\n", ret);
49 50
50 return ret; 51 return ret;
51} 52}
@@ -124,7 +125,7 @@ static void iwlagn_update_qos(struct iwl_priv *priv,
124 sizeof(struct iwl_qosparam_cmd), 125 sizeof(struct iwl_qosparam_cmd),
125 &ctx->qos_data.def_qos_parm); 126 &ctx->qos_data.def_qos_parm);
126 if (ret) 127 if (ret)
127 IWL_ERR(priv, "Failed to update QoS\n"); 128 IWL_DEBUG_QUIET_RFKILL(priv, "Failed to update QoS\n");
128} 129}
129 130
130static int iwlagn_update_beacon(struct iwl_priv *priv, 131static int iwlagn_update_beacon(struct iwl_priv *priv,
diff --git a/drivers/net/wireless/iwlwifi/iwl-agn-sta.c b/drivers/net/wireless/iwlwifi/iwl-agn-sta.c
index ed628362393..93067686218 100644
--- a/drivers/net/wireless/iwlwifi/iwl-agn-sta.c
+++ b/drivers/net/wireless/iwlwifi/iwl-agn-sta.c
@@ -840,7 +840,7 @@ int iwlagn_mac_sta_remove(struct ieee80211_hw *hw,
840 sta->addr); 840 sta->addr);
841 ret = iwl_remove_station(priv, sta_priv->sta_id, sta->addr); 841 ret = iwl_remove_station(priv, sta_priv->sta_id, sta->addr);
842 if (ret) 842 if (ret)
843 IWL_ERR(priv, "Error removing station %pM\n", 843 IWL_DEBUG_QUIET_RFKILL(priv, "Error removing station %pM\n",
844 sta->addr); 844 sta->addr);
845 mutex_unlock(&priv->shrd->mutex); 845 mutex_unlock(&priv->shrd->mutex);
846 IWL_DEBUG_MAC80211(priv, "leave\n"); 846 IWL_DEBUG_MAC80211(priv, "leave\n");
diff --git a/drivers/net/wireless/iwlwifi/iwl-debug.h b/drivers/net/wireless/iwlwifi/iwl-debug.h
index 69a77e24d22..1dddf9be390 100644
--- a/drivers/net/wireless/iwlwifi/iwl-debug.h
+++ b/drivers/net/wireless/iwlwifi/iwl-debug.h
@@ -70,10 +70,25 @@ do { \
70 DUMP_PREFIX_OFFSET, 16, 1, p, len, 1); \ 70 DUMP_PREFIX_OFFSET, 16, 1, p, len, 1); \
71} while (0) 71} while (0)
72 72
73#define IWL_DEBUG_QUIET_RFKILL(p, fmt, args...) \
74do { \
75 if (!iwl_is_rfkill(p->shrd)) \
76 dev_printk(KERN_ERR, bus(p)->dev, "%c %s " fmt, \
77 (in_interrupt() ? 'I' : 'U'), __func__ , ##args); \
78 else if (iwl_get_debug_level(p->shrd) & IWL_DL_RADIO) \
79 dev_printk(KERN_ERR, bus(p)->dev, "(RFKILL) %c %s " fmt, \
80 (in_interrupt() ? 'I' : 'U'), __func__ , ##args); \
81} while (0)
82
73#else 83#else
74#define IWL_DEBUG(m, level, fmt, args...) 84#define IWL_DEBUG(m, level, fmt, args...)
75#define IWL_DEBUG_LIMIT(m, level, fmt, args...) 85#define IWL_DEBUG_LIMIT(m, level, fmt, args...)
76#define iwl_print_hex_dump(m, level, p, len) 86#define iwl_print_hex_dump(m, level, p, len)
87#define IWL_DEBUG_QUIET_RFKILL(p, fmt, args...) \
88do { \
89 if (!iwl_is_rfkill(p->shrd)) \
90 IWL_ERR(p, fmt, ##args); \
91} while (0)
77#endif /* CONFIG_IWLWIFI_DEBUG */ 92#endif /* CONFIG_IWLWIFI_DEBUG */
78 93
79#ifdef CONFIG_IWLWIFI_DEBUGFS 94#ifdef CONFIG_IWLWIFI_DEBUGFS
diff --git a/drivers/net/wireless/iwlwifi/iwl-trans-pcie-tx.c b/drivers/net/wireless/iwlwifi/iwl-trans-pcie-tx.c
index 4a0c95302a7..461e1ae38e5 100644
--- a/drivers/net/wireless/iwlwifi/iwl-trans-pcie-tx.c
+++ b/drivers/net/wireless/iwlwifi/iwl-trans-pcie-tx.c
@@ -982,7 +982,8 @@ static int iwl_send_cmd_async(struct iwl_trans *trans, struct iwl_host_cmd *cmd)
982 982
983 ret = iwl_enqueue_hcmd(trans, cmd); 983 ret = iwl_enqueue_hcmd(trans, cmd);
984 if (ret < 0) { 984 if (ret < 0) {
985 IWL_ERR(trans, "Error sending %s: enqueue_hcmd failed: %d\n", 985 IWL_DEBUG_QUIET_RFKILL(trans,
986 "Error sending %s: enqueue_hcmd failed: %d\n",
986 get_cmd_string(cmd->id), ret); 987 get_cmd_string(cmd->id), ret);
987 return ret; 988 return ret;
988 } 989 }
@@ -1008,7 +1009,8 @@ static int iwl_send_cmd_sync(struct iwl_trans *trans, struct iwl_host_cmd *cmd)
1008 if (cmd_idx < 0) { 1009 if (cmd_idx < 0) {
1009 ret = cmd_idx; 1010 ret = cmd_idx;
1010 clear_bit(STATUS_HCMD_ACTIVE, &trans->shrd->status); 1011 clear_bit(STATUS_HCMD_ACTIVE, &trans->shrd->status);
1011 IWL_ERR(trans, "Error sending %s: enqueue_hcmd failed: %d\n", 1012 IWL_DEBUG_QUIET_RFKILL(trans,
1013 "Error sending %s: enqueue_hcmd failed: %d\n",
1012 get_cmd_string(cmd->id), ret); 1014 get_cmd_string(cmd->id), ret);
1013 return ret; 1015 return ret;
1014 } 1016 }
@@ -1022,12 +1024,12 @@ static int iwl_send_cmd_sync(struct iwl_trans *trans, struct iwl_host_cmd *cmd)
1022 &trans_pcie->txq[trans->shrd->cmd_queue]; 1024 &trans_pcie->txq[trans->shrd->cmd_queue];
1023 struct iwl_queue *q = &txq->q; 1025 struct iwl_queue *q = &txq->q;
1024 1026
1025 IWL_ERR(trans, 1027 IWL_DEBUG_QUIET_RFKILL(trans,
1026 "Error sending %s: time out after %dms.\n", 1028 "Error sending %s: time out after %dms.\n",
1027 get_cmd_string(cmd->id), 1029 get_cmd_string(cmd->id),
1028 jiffies_to_msecs(HOST_COMPLETE_TIMEOUT)); 1030 jiffies_to_msecs(HOST_COMPLETE_TIMEOUT));
1029 1031
1030 IWL_ERR(trans, 1032 IWL_DEBUG_QUIET_RFKILL(trans,
1031 "Current CMD queue read_ptr %d write_ptr %d\n", 1033 "Current CMD queue read_ptr %d write_ptr %d\n",
1032 q->read_ptr, q->write_ptr); 1034 q->read_ptr, q->write_ptr);
1033 1035