aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/iwlegacy
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net/wireless/iwlegacy')
-rw-r--r--drivers/net/wireless/iwlegacy/iwl-3945.c2
-rw-r--r--drivers/net/wireless/iwlegacy/iwl-4965.c2
-rw-r--r--drivers/net/wireless/iwlegacy/iwl-core.c1
-rw-r--r--drivers/net/wireless/iwlegacy/iwl-core.h7
-rw-r--r--drivers/net/wireless/iwlegacy/iwl-debugfs.c97
-rw-r--r--drivers/net/wireless/iwlegacy/iwl-dev.h29
-rw-r--r--drivers/net/wireless/iwlegacy/iwl-devtrace.c3
-rw-r--r--drivers/net/wireless/iwlegacy/iwl-devtrace.h60
-rw-r--r--drivers/net/wireless/iwlegacy/iwl3945-base.c206
-rw-r--r--drivers/net/wireless/iwlegacy/iwl4965-base.c336
10 files changed, 1 insertions, 742 deletions
diff --git a/drivers/net/wireless/iwlegacy/iwl-3945.c b/drivers/net/wireless/iwlegacy/iwl-3945.c
index 8aa018dfa461..dab67a12d73b 100644
--- a/drivers/net/wireless/iwlegacy/iwl-3945.c
+++ b/drivers/net/wireless/iwlegacy/iwl-3945.c
@@ -2639,7 +2639,6 @@ static struct iwl_lib_ops iwl3945_lib = {
2639 .txq_free_tfd = iwl3945_hw_txq_free_tfd, 2639 .txq_free_tfd = iwl3945_hw_txq_free_tfd,
2640 .txq_init = iwl3945_hw_tx_queue_init, 2640 .txq_init = iwl3945_hw_tx_queue_init,
2641 .load_ucode = iwl3945_load_bsm, 2641 .load_ucode = iwl3945_load_bsm,
2642 .dump_nic_event_log = iwl3945_dump_nic_event_log,
2643 .dump_nic_error_log = iwl3945_dump_nic_error_log, 2642 .dump_nic_error_log = iwl3945_dump_nic_error_log,
2644 .apm_ops = { 2643 .apm_ops = {
2645 .init = iwl3945_apm_init, 2644 .init = iwl3945_apm_init,
@@ -2698,7 +2697,6 @@ static struct iwl_base_params iwl3945_base_params = {
2698 .use_bsm = true, 2697 .use_bsm = true,
2699 .led_compensation = 64, 2698 .led_compensation = 64,
2700 .wd_timeout = IWL_DEF_WD_TIMEOUT, 2699 .wd_timeout = IWL_DEF_WD_TIMEOUT,
2701 .max_event_log_size = 512,
2702}; 2700};
2703 2701
2704static struct iwl_cfg iwl3945_bg_cfg = { 2702static struct iwl_cfg iwl3945_bg_cfg = {
diff --git a/drivers/net/wireless/iwlegacy/iwl-4965.c b/drivers/net/wireless/iwlegacy/iwl-4965.c
index 59a4b53218ea..bd4b000733f7 100644
--- a/drivers/net/wireless/iwlegacy/iwl-4965.c
+++ b/drivers/net/wireless/iwlegacy/iwl-4965.c
@@ -2069,7 +2069,6 @@ static struct iwl_lib_ops iwl4965_lib = {
2069 .is_valid_rtc_data_addr = iwl4965_hw_valid_rtc_data_addr, 2069 .is_valid_rtc_data_addr = iwl4965_hw_valid_rtc_data_addr,
2070 .init_alive_start = iwl4965_init_alive_start, 2070 .init_alive_start = iwl4965_init_alive_start,
2071 .load_ucode = iwl4965_load_bsm, 2071 .load_ucode = iwl4965_load_bsm,
2072 .dump_nic_event_log = iwl4965_dump_nic_event_log,
2073 .dump_nic_error_log = iwl4965_dump_nic_error_log, 2072 .dump_nic_error_log = iwl4965_dump_nic_error_log,
2074 .dump_fh = iwl4965_dump_fh, 2073 .dump_fh = iwl4965_dump_fh,
2075 .set_channel_switch = iwl4965_hw_channel_switch, 2074 .set_channel_switch = iwl4965_hw_channel_switch,
@@ -2151,7 +2150,6 @@ static struct iwl_base_params iwl4965_base_params = {
2151 .chain_noise_num_beacons = IWL4965_CAL_NUM_BEACONS, 2150 .chain_noise_num_beacons = IWL4965_CAL_NUM_BEACONS,
2152 .wd_timeout = IWL_DEF_WD_TIMEOUT, 2151 .wd_timeout = IWL_DEF_WD_TIMEOUT,
2153 .temperature_kelvin = true, 2152 .temperature_kelvin = true,
2154 .max_event_log_size = 512,
2155 .ucode_tracing = true, 2153 .ucode_tracing = true,
2156 .sensitivity_calib_by_driver = true, 2154 .sensitivity_calib_by_driver = true,
2157 .chain_noise_calib_by_driver = true, 2155 .chain_noise_calib_by_driver = true,
diff --git a/drivers/net/wireless/iwlegacy/iwl-core.c b/drivers/net/wireless/iwlegacy/iwl-core.c
index 240d3a80c7bc..35cd2537e7fd 100644
--- a/drivers/net/wireless/iwlegacy/iwl-core.c
+++ b/drivers/net/wireless/iwlegacy/iwl-core.c
@@ -931,7 +931,6 @@ void iwl_legacy_irq_handle_error(struct iwl_priv *priv)
931 priv->cfg->ops->lib->dump_nic_error_log(priv); 931 priv->cfg->ops->lib->dump_nic_error_log(priv);
932 if (priv->cfg->ops->lib->dump_fh) 932 if (priv->cfg->ops->lib->dump_fh)
933 priv->cfg->ops->lib->dump_fh(priv, NULL, false); 933 priv->cfg->ops->lib->dump_fh(priv, NULL, false);
934 priv->cfg->ops->lib->dump_nic_event_log(priv, false, NULL, false);
935#ifdef CONFIG_IWLWIFI_LEGACY_DEBUG 934#ifdef CONFIG_IWLWIFI_LEGACY_DEBUG
936 if (iwl_legacy_get_debug_level(priv) & IWL_DL_FW_ERRORS) 935 if (iwl_legacy_get_debug_level(priv) & IWL_DL_FW_ERRORS)
937 iwl_legacy_print_rx_config_cmd(priv, 936 iwl_legacy_print_rx_config_cmd(priv,
diff --git a/drivers/net/wireless/iwlegacy/iwl-core.h b/drivers/net/wireless/iwlegacy/iwl-core.h
index 8f766e94881c..a2de7e991706 100644
--- a/drivers/net/wireless/iwlegacy/iwl-core.h
+++ b/drivers/net/wireless/iwlegacy/iwl-core.h
@@ -143,8 +143,7 @@ struct iwl_lib_ops {
143 int (*is_valid_rtc_data_addr)(u32 addr); 143 int (*is_valid_rtc_data_addr)(u32 addr);
144 /* 1st ucode load */ 144 /* 1st ucode load */
145 int (*load_ucode)(struct iwl_priv *priv); 145 int (*load_ucode)(struct iwl_priv *priv);
146 int (*dump_nic_event_log)(struct iwl_priv *priv, 146
147 bool full_log, char **buf, bool display);
148 void (*dump_nic_error_log)(struct iwl_priv *priv); 147 void (*dump_nic_error_log)(struct iwl_priv *priv);
149 int (*dump_fh)(struct iwl_priv *priv, char **buf, bool display); 148 int (*dump_fh)(struct iwl_priv *priv, char **buf, bool display);
150 int (*set_channel_switch)(struct iwl_priv *priv, 149 int (*set_channel_switch)(struct iwl_priv *priv,
@@ -206,7 +205,6 @@ struct iwl_mod_params {
206 * @chain_noise_num_beacons: number of beacons used to compute chain noise 205 * @chain_noise_num_beacons: number of beacons used to compute chain noise
207 * @wd_timeout: TX queues watchdog timeout 206 * @wd_timeout: TX queues watchdog timeout
208 * @temperature_kelvin: temperature report by uCode in kelvin 207 * @temperature_kelvin: temperature report by uCode in kelvin
209 * @max_event_log_size: size of event log buffer size for ucode event logging
210 * @ucode_tracing: support ucode continuous tracing 208 * @ucode_tracing: support ucode continuous tracing
211 * @sensitivity_calib_by_driver: driver has the capability to perform 209 * @sensitivity_calib_by_driver: driver has the capability to perform
212 * sensitivity calibration operation 210 * sensitivity calibration operation
@@ -226,7 +224,6 @@ struct iwl_base_params {
226 int chain_noise_num_beacons; 224 int chain_noise_num_beacons;
227 unsigned int wd_timeout; 225 unsigned int wd_timeout;
228 bool temperature_kelvin; 226 bool temperature_kelvin;
229 u32 max_event_log_size;
230 const bool ucode_tracing; 227 const bool ucode_tracing;
231 const bool sensitivity_calib_by_driver; 228 const bool sensitivity_calib_by_driver;
232 const bool chain_noise_calib_by_driver; 229 const bool chain_noise_calib_by_driver;
@@ -515,8 +512,6 @@ extern const struct dev_pm_ops iwl_legacy_pm_ops;
515* Error Handling Debugging 512* Error Handling Debugging
516******************************************************/ 513******************************************************/
517void iwl4965_dump_nic_error_log(struct iwl_priv *priv); 514void iwl4965_dump_nic_error_log(struct iwl_priv *priv);
518int iwl4965_dump_nic_event_log(struct iwl_priv *priv,
519 bool full_log, char **buf, bool display);
520#ifdef CONFIG_IWLWIFI_LEGACY_DEBUG 515#ifdef CONFIG_IWLWIFI_LEGACY_DEBUG
521void iwl_legacy_print_rx_config_cmd(struct iwl_priv *priv, 516void iwl_legacy_print_rx_config_cmd(struct iwl_priv *priv,
522 struct iwl_rxon_context *ctx); 517 struct iwl_rxon_context *ctx);
diff --git a/drivers/net/wireless/iwlegacy/iwl-debugfs.c b/drivers/net/wireless/iwlegacy/iwl-debugfs.c
index 88ffc92ef0b0..996996a71657 100644
--- a/drivers/net/wireless/iwlegacy/iwl-debugfs.c
+++ b/drivers/net/wireless/iwlegacy/iwl-debugfs.c
@@ -391,48 +391,6 @@ static ssize_t iwl_legacy_dbgfs_nvm_read(struct file *file,
391 return ret; 391 return ret;
392} 392}
393 393
394static ssize_t iwl_legacy_dbgfs_log_event_read(struct file *file,
395 char __user *user_buf,
396 size_t count, loff_t *ppos)
397{
398 struct iwl_priv *priv = file->private_data;
399 char *buf;
400 int pos = 0;
401 ssize_t ret = -ENOMEM;
402
403 ret = pos = priv->cfg->ops->lib->dump_nic_event_log(
404 priv, true, &buf, true);
405 if (buf) {
406 ret = simple_read_from_buffer(user_buf, count, ppos, buf, pos);
407 kfree(buf);
408 }
409 return ret;
410}
411
412static ssize_t iwl_legacy_dbgfs_log_event_write(struct file *file,
413 const char __user *user_buf,
414 size_t count, loff_t *ppos)
415{
416 struct iwl_priv *priv = file->private_data;
417 u32 event_log_flag;
418 char buf[8];
419 int buf_size;
420
421 memset(buf, 0, sizeof(buf));
422 buf_size = min(count, sizeof(buf) - 1);
423 if (copy_from_user(buf, user_buf, buf_size))
424 return -EFAULT;
425 if (sscanf(buf, "%d", &event_log_flag) != 1)
426 return -EFAULT;
427 if (event_log_flag == 1)
428 priv->cfg->ops->lib->dump_nic_event_log(priv, true,
429 NULL, false);
430
431 return count;
432}
433
434
435
436static ssize_t 394static ssize_t
437iwl_legacy_dbgfs_channels_read(struct file *file, char __user *user_buf, 395iwl_legacy_dbgfs_channels_read(struct file *file, char __user *user_buf,
438 size_t count, loff_t *ppos) 396 size_t count, loff_t *ppos)
@@ -706,7 +664,6 @@ static ssize_t iwl_legacy_dbgfs_disable_ht40_read(struct file *file,
706} 664}
707 665
708DEBUGFS_READ_WRITE_FILE_OPS(sram); 666DEBUGFS_READ_WRITE_FILE_OPS(sram);
709DEBUGFS_READ_WRITE_FILE_OPS(log_event);
710DEBUGFS_READ_FILE_OPS(nvm); 667DEBUGFS_READ_FILE_OPS(nvm);
711DEBUGFS_READ_FILE_OPS(stations); 668DEBUGFS_READ_FILE_OPS(stations);
712DEBUGFS_READ_FILE_OPS(channels); 669DEBUGFS_READ_FILE_OPS(channels);
@@ -1098,56 +1055,6 @@ static ssize_t iwl_legacy_dbgfs_clear_ucode_statistics_write(struct file *file,
1098 return count; 1055 return count;
1099} 1056}
1100 1057
1101static ssize_t iwl_legacy_dbgfs_ucode_tracing_read(struct file *file,
1102 char __user *user_buf,
1103 size_t count, loff_t *ppos) {
1104
1105 struct iwl_priv *priv = file->private_data;
1106 int pos = 0;
1107 char buf[128];
1108 const size_t bufsz = sizeof(buf);
1109
1110 pos += scnprintf(buf + pos, bufsz - pos, "ucode trace timer is %s\n",
1111 priv->event_log.ucode_trace ? "On" : "Off");
1112 pos += scnprintf(buf + pos, bufsz - pos, "non_wraps_count:\t\t %u\n",
1113 priv->event_log.non_wraps_count);
1114 pos += scnprintf(buf + pos, bufsz - pos, "wraps_once_count:\t\t %u\n",
1115 priv->event_log.wraps_once_count);
1116 pos += scnprintf(buf + pos, bufsz - pos, "wraps_more_count:\t\t %u\n",
1117 priv->event_log.wraps_more_count);
1118
1119 return simple_read_from_buffer(user_buf, count, ppos, buf, pos);
1120}
1121
1122static ssize_t iwl_legacy_dbgfs_ucode_tracing_write(struct file *file,
1123 const char __user *user_buf,
1124 size_t count, loff_t *ppos)
1125{
1126 struct iwl_priv *priv = file->private_data;
1127 char buf[8];
1128 int buf_size;
1129 int trace;
1130
1131 memset(buf, 0, sizeof(buf));
1132 buf_size = min(count, sizeof(buf) - 1);
1133 if (copy_from_user(buf, user_buf, buf_size))
1134 return -EFAULT;
1135 if (sscanf(buf, "%d", &trace) != 1)
1136 return -EFAULT;
1137
1138 if (trace) {
1139 priv->event_log.ucode_trace = true;
1140 /* schedule the ucode timer to occur in UCODE_TRACE_PERIOD */
1141 mod_timer(&priv->ucode_trace,
1142 jiffies + msecs_to_jiffies(UCODE_TRACE_PERIOD));
1143 } else {
1144 priv->event_log.ucode_trace = false;
1145 del_timer_sync(&priv->ucode_trace);
1146 }
1147
1148 return count;
1149}
1150
1151static ssize_t iwl_legacy_dbgfs_rxon_flags_read(struct file *file, 1058static ssize_t iwl_legacy_dbgfs_rxon_flags_read(struct file *file,
1152 char __user *user_buf, 1059 char __user *user_buf,
1153 size_t count, loff_t *ppos) { 1060 size_t count, loff_t *ppos) {
@@ -1312,7 +1219,6 @@ DEBUGFS_READ_FILE_OPS(chain_noise);
1312DEBUGFS_READ_FILE_OPS(power_save_status); 1219DEBUGFS_READ_FILE_OPS(power_save_status);
1313DEBUGFS_WRITE_FILE_OPS(clear_ucode_statistics); 1220DEBUGFS_WRITE_FILE_OPS(clear_ucode_statistics);
1314DEBUGFS_WRITE_FILE_OPS(clear_traffic_statistics); 1221DEBUGFS_WRITE_FILE_OPS(clear_traffic_statistics);
1315DEBUGFS_READ_WRITE_FILE_OPS(ucode_tracing);
1316DEBUGFS_READ_FILE_OPS(fh_reg); 1222DEBUGFS_READ_FILE_OPS(fh_reg);
1317DEBUGFS_READ_WRITE_FILE_OPS(missed_beacon); 1223DEBUGFS_READ_WRITE_FILE_OPS(missed_beacon);
1318DEBUGFS_READ_WRITE_FILE_OPS(force_reset); 1224DEBUGFS_READ_WRITE_FILE_OPS(force_reset);
@@ -1347,7 +1253,6 @@ int iwl_legacy_dbgfs_register(struct iwl_priv *priv, const char *name)
1347 1253
1348 DEBUGFS_ADD_FILE(nvm, dir_data, S_IRUSR); 1254 DEBUGFS_ADD_FILE(nvm, dir_data, S_IRUSR);
1349 DEBUGFS_ADD_FILE(sram, dir_data, S_IWUSR | S_IRUSR); 1255 DEBUGFS_ADD_FILE(sram, dir_data, S_IWUSR | S_IRUSR);
1350 DEBUGFS_ADD_FILE(log_event, dir_data, S_IWUSR | S_IRUSR);
1351 DEBUGFS_ADD_FILE(stations, dir_data, S_IRUSR); 1256 DEBUGFS_ADD_FILE(stations, dir_data, S_IRUSR);
1352 DEBUGFS_ADD_FILE(channels, dir_data, S_IRUSR); 1257 DEBUGFS_ADD_FILE(channels, dir_data, S_IRUSR);
1353 DEBUGFS_ADD_FILE(status, dir_data, S_IRUSR); 1258 DEBUGFS_ADD_FILE(status, dir_data, S_IRUSR);
@@ -1373,8 +1278,6 @@ int iwl_legacy_dbgfs_register(struct iwl_priv *priv, const char *name)
1373 DEBUGFS_ADD_FILE(sensitivity, dir_debug, S_IRUSR); 1278 DEBUGFS_ADD_FILE(sensitivity, dir_debug, S_IRUSR);
1374 if (priv->cfg->base_params->chain_noise_calib_by_driver) 1279 if (priv->cfg->base_params->chain_noise_calib_by_driver)
1375 DEBUGFS_ADD_FILE(chain_noise, dir_debug, S_IRUSR); 1280 DEBUGFS_ADD_FILE(chain_noise, dir_debug, S_IRUSR);
1376 if (priv->cfg->base_params->ucode_tracing)
1377 DEBUGFS_ADD_FILE(ucode_tracing, dir_debug, S_IWUSR | S_IRUSR);
1378 DEBUGFS_ADD_FILE(rxon_flags, dir_debug, S_IWUSR); 1281 DEBUGFS_ADD_FILE(rxon_flags, dir_debug, S_IWUSR);
1379 DEBUGFS_ADD_FILE(rxon_filter_flags, dir_debug, S_IWUSR); 1282 DEBUGFS_ADD_FILE(rxon_filter_flags, dir_debug, S_IWUSR);
1380 DEBUGFS_ADD_FILE(wd_timeout, dir_debug, S_IWUSR); 1283 DEBUGFS_ADD_FILE(wd_timeout, dir_debug, S_IWUSR);
diff --git a/drivers/net/wireless/iwlegacy/iwl-dev.h b/drivers/net/wireless/iwlegacy/iwl-dev.h
index c5a135a71312..fd792e15fab6 100644
--- a/drivers/net/wireless/iwlegacy/iwl-dev.h
+++ b/drivers/net/wireless/iwlegacy/iwl-dev.h
@@ -855,32 +855,6 @@ struct traffic_stats {
855}; 855};
856 856
857/* 857/*
858 * schedule the timer to wake up every UCODE_TRACE_PERIOD milliseconds
859 * to perform continuous uCode event logging operation if enabled
860 */
861#define UCODE_TRACE_PERIOD (100)
862
863/*
864 * iwl_event_log: current uCode event log position
865 *
866 * @ucode_trace: enable/disable ucode continuous trace timer
867 * @num_wraps: how many times the event buffer wraps
868 * @next_entry: the entry just before the next one that uCode would fill
869 * @non_wraps_count: counter for no wrap detected when dump ucode events
870 * @wraps_once_count: counter for wrap once detected when dump ucode events
871 * @wraps_more_count: counter for wrap more than once detected
872 * when dump ucode events
873 */
874struct iwl_event_log {
875 bool ucode_trace;
876 u32 num_wraps;
877 u32 next_entry;
878 int non_wraps_count;
879 int wraps_once_count;
880 int wraps_more_count;
881};
882
883/*
884 * host interrupt timeout value 858 * host interrupt timeout value
885 * used with setting interrupt coalescing timer 859 * used with setting interrupt coalescing timer
886 * the CSR_INT_COALESCING is an 8 bit register in 32-usec unit 860 * the CSR_INT_COALESCING is an 8 bit register in 32-usec unit
@@ -1270,12 +1244,9 @@ struct iwl_priv {
1270 u32 disable_tx_power_cal; 1244 u32 disable_tx_power_cal;
1271 struct work_struct run_time_calib_work; 1245 struct work_struct run_time_calib_work;
1272 struct timer_list statistics_periodic; 1246 struct timer_list statistics_periodic;
1273 struct timer_list ucode_trace;
1274 struct timer_list watchdog; 1247 struct timer_list watchdog;
1275 bool hw_ready; 1248 bool hw_ready;
1276 1249
1277 struct iwl_event_log event_log;
1278
1279 struct led_classdev led; 1250 struct led_classdev led;
1280 unsigned long blink_on, blink_off; 1251 unsigned long blink_on, blink_off;
1281 bool led_registered; 1252 bool led_registered;
diff --git a/drivers/net/wireless/iwlegacy/iwl-devtrace.c b/drivers/net/wireless/iwlegacy/iwl-devtrace.c
index 080b852b33bd..acec99197ce0 100644
--- a/drivers/net/wireless/iwlegacy/iwl-devtrace.c
+++ b/drivers/net/wireless/iwlegacy/iwl-devtrace.c
@@ -38,8 +38,5 @@ EXPORT_TRACEPOINT_SYMBOL(iwlwifi_legacy_dev_ioread32);
38EXPORT_TRACEPOINT_SYMBOL(iwlwifi_legacy_dev_iowrite32); 38EXPORT_TRACEPOINT_SYMBOL(iwlwifi_legacy_dev_iowrite32);
39EXPORT_TRACEPOINT_SYMBOL(iwlwifi_legacy_dev_rx); 39EXPORT_TRACEPOINT_SYMBOL(iwlwifi_legacy_dev_rx);
40EXPORT_TRACEPOINT_SYMBOL(iwlwifi_legacy_dev_tx); 40EXPORT_TRACEPOINT_SYMBOL(iwlwifi_legacy_dev_tx);
41EXPORT_TRACEPOINT_SYMBOL(iwlwifi_legacy_dev_ucode_event);
42EXPORT_TRACEPOINT_SYMBOL(iwlwifi_legacy_dev_ucode_error); 41EXPORT_TRACEPOINT_SYMBOL(iwlwifi_legacy_dev_ucode_error);
43EXPORT_TRACEPOINT_SYMBOL(iwlwifi_legacy_dev_ucode_cont_event);
44EXPORT_TRACEPOINT_SYMBOL(iwlwifi_legacy_dev_ucode_wrap_event);
45#endif 42#endif
diff --git a/drivers/net/wireless/iwlegacy/iwl-devtrace.h b/drivers/net/wireless/iwlegacy/iwl-devtrace.h
index 9612aa0f6ec4..a443725ba6be 100644
--- a/drivers/net/wireless/iwlegacy/iwl-devtrace.h
+++ b/drivers/net/wireless/iwlegacy/iwl-devtrace.h
@@ -96,47 +96,6 @@ TRACE_EVENT(iwlwifi_legacy_dev_iowrite32,
96#undef TRACE_SYSTEM 96#undef TRACE_SYSTEM
97#define TRACE_SYSTEM iwlwifi_legacy_ucode 97#define TRACE_SYSTEM iwlwifi_legacy_ucode
98 98
99TRACE_EVENT(iwlwifi_legacy_dev_ucode_cont_event,
100 TP_PROTO(struct iwl_priv *priv, u32 time, u32 data, u32 ev),
101 TP_ARGS(priv, time, data, ev),
102 TP_STRUCT__entry(
103 PRIV_ENTRY
104
105 __field(u32, time)
106 __field(u32, data)
107 __field(u32, ev)
108 ),
109 TP_fast_assign(
110 PRIV_ASSIGN;
111 __entry->time = time;
112 __entry->data = data;
113 __entry->ev = ev;
114 ),
115 TP_printk("[%p] EVT_LOGT:%010u:0x%08x:%04u",
116 __entry->priv, __entry->time, __entry->data, __entry->ev)
117);
118
119TRACE_EVENT(iwlwifi_legacy_dev_ucode_wrap_event,
120 TP_PROTO(struct iwl_priv *priv, u32 wraps, u32 n_entry, u32 p_entry),
121 TP_ARGS(priv, wraps, n_entry, p_entry),
122 TP_STRUCT__entry(
123 PRIV_ENTRY
124
125 __field(u32, wraps)
126 __field(u32, n_entry)
127 __field(u32, p_entry)
128 ),
129 TP_fast_assign(
130 PRIV_ASSIGN;
131 __entry->wraps = wraps;
132 __entry->n_entry = n_entry;
133 __entry->p_entry = p_entry;
134 ),
135 TP_printk("[%p] wraps=#%02d n=0x%X p=0x%X",
136 __entry->priv, __entry->wraps, __entry->n_entry,
137 __entry->p_entry)
138);
139
140#undef TRACE_SYSTEM 99#undef TRACE_SYSTEM
141#define TRACE_SYSTEM iwlwifi 100#define TRACE_SYSTEM iwlwifi
142 101
@@ -242,25 +201,6 @@ TRACE_EVENT(iwlwifi_legacy_dev_ucode_error,
242 __entry->blink2, __entry->ilink1, __entry->ilink2) 201 __entry->blink2, __entry->ilink1, __entry->ilink2)
243); 202);
244 203
245TRACE_EVENT(iwlwifi_legacy_dev_ucode_event,
246 TP_PROTO(struct iwl_priv *priv, u32 time, u32 data, u32 ev),
247 TP_ARGS(priv, time, data, ev),
248 TP_STRUCT__entry(
249 PRIV_ENTRY
250
251 __field(u32, time)
252 __field(u32, data)
253 __field(u32, ev)
254 ),
255 TP_fast_assign(
256 PRIV_ASSIGN;
257 __entry->time = time;
258 __entry->data = data;
259 __entry->ev = ev;
260 ),
261 TP_printk("[%p] EVT_LOGT:%010u:0x%08x:%04u",
262 __entry->priv, __entry->time, __entry->data, __entry->ev)
263);
264#endif /* __IWLWIFI_DEVICE_TRACE */ 204#endif /* __IWLWIFI_DEVICE_TRACE */
265 205
266#undef TRACE_INCLUDE_PATH 206#undef TRACE_INCLUDE_PATH
diff --git a/drivers/net/wireless/iwlegacy/iwl3945-base.c b/drivers/net/wireless/iwlegacy/iwl3945-base.c
index da42442106c9..795826a014ed 100644
--- a/drivers/net/wireless/iwlegacy/iwl3945-base.c
+++ b/drivers/net/wireless/iwlegacy/iwl3945-base.c
@@ -1409,212 +1409,6 @@ void iwl3945_dump_nic_error_log(struct iwl_priv *priv)
1409 } 1409 }
1410} 1410}
1411 1411
1412#define EVENT_START_OFFSET (6 * sizeof(u32))
1413
1414/**
1415 * iwl3945_print_event_log - Dump error event log to syslog
1416 *
1417 */
1418static int iwl3945_print_event_log(struct iwl_priv *priv, u32 start_idx,
1419 u32 num_events, u32 mode,
1420 int pos, char **buf, size_t bufsz)
1421{
1422 u32 i;
1423 u32 base; /* SRAM byte address of event log header */
1424 u32 event_size; /* 2 u32s, or 3 u32s if timestamp recorded */
1425 u32 ptr; /* SRAM byte address of log data */
1426 u32 ev, time, data; /* event log data */
1427 unsigned long reg_flags;
1428
1429 if (num_events == 0)
1430 return pos;
1431
1432 base = le32_to_cpu(priv->card_alive.log_event_table_ptr);
1433
1434 if (mode == 0)
1435 event_size = 2 * sizeof(u32);
1436 else
1437 event_size = 3 * sizeof(u32);
1438
1439 ptr = base + EVENT_START_OFFSET + (start_idx * event_size);
1440
1441 /* Make sure device is powered up for SRAM reads */
1442 spin_lock_irqsave(&priv->reg_lock, reg_flags);
1443 iwl_grab_nic_access(priv);
1444
1445 /* Set starting address; reads will auto-increment */
1446 _iwl_legacy_write_direct32(priv, HBUS_TARG_MEM_RADDR, ptr);
1447 rmb();
1448
1449 /* "time" is actually "data" for mode 0 (no timestamp).
1450 * place event id # at far right for easier visual parsing. */
1451 for (i = 0; i < num_events; i++) {
1452 ev = _iwl_legacy_read_direct32(priv, HBUS_TARG_MEM_RDAT);
1453 time = _iwl_legacy_read_direct32(priv, HBUS_TARG_MEM_RDAT);
1454 if (mode == 0) {
1455 /* data, ev */
1456 if (bufsz) {
1457 pos += scnprintf(*buf + pos, bufsz - pos,
1458 "0x%08x:%04u\n",
1459 time, ev);
1460 } else {
1461 IWL_ERR(priv, "0x%08x\t%04u\n", time, ev);
1462 trace_iwlwifi_legacy_dev_ucode_event(priv, 0,
1463 time, ev);
1464 }
1465 } else {
1466 data = _iwl_legacy_read_direct32(priv,
1467 HBUS_TARG_MEM_RDAT);
1468 if (bufsz) {
1469 pos += scnprintf(*buf + pos, bufsz - pos,
1470 "%010u:0x%08x:%04u\n",
1471 time, data, ev);
1472 } else {
1473 IWL_ERR(priv, "%010u\t0x%08x\t%04u\n",
1474 time, data, ev);
1475 trace_iwlwifi_legacy_dev_ucode_event(priv, time,
1476 data, ev);
1477 }
1478 }
1479 }
1480
1481 /* Allow device to power down */
1482 iwl_release_nic_access(priv);
1483 spin_unlock_irqrestore(&priv->reg_lock, reg_flags);
1484 return pos;
1485}
1486
1487/**
1488 * iwl3945_print_last_event_logs - Dump the newest # of event log to syslog
1489 */
1490static int iwl3945_print_last_event_logs(struct iwl_priv *priv, u32 capacity,
1491 u32 num_wraps, u32 next_entry,
1492 u32 size, u32 mode,
1493 int pos, char **buf, size_t bufsz)
1494{
1495 /*
1496 * display the newest DEFAULT_LOG_ENTRIES entries
1497 * i.e the entries just before the next ont that uCode would fill.
1498 */
1499 if (num_wraps) {
1500 if (next_entry < size) {
1501 pos = iwl3945_print_event_log(priv,
1502 capacity - (size - next_entry),
1503 size - next_entry, mode,
1504 pos, buf, bufsz);
1505 pos = iwl3945_print_event_log(priv, 0,
1506 next_entry, mode,
1507 pos, buf, bufsz);
1508 } else
1509 pos = iwl3945_print_event_log(priv, next_entry - size,
1510 size, mode,
1511 pos, buf, bufsz);
1512 } else {
1513 if (next_entry < size)
1514 pos = iwl3945_print_event_log(priv, 0,
1515 next_entry, mode,
1516 pos, buf, bufsz);
1517 else
1518 pos = iwl3945_print_event_log(priv, next_entry - size,
1519 size, mode,
1520 pos, buf, bufsz);
1521 }
1522 return pos;
1523}
1524
1525#define DEFAULT_IWL3945_DUMP_EVENT_LOG_ENTRIES (20)
1526
1527int iwl3945_dump_nic_event_log(struct iwl_priv *priv, bool full_log,
1528 char **buf, bool display)
1529{
1530 u32 base; /* SRAM byte address of event log header */
1531 u32 capacity; /* event log capacity in # entries */
1532 u32 mode; /* 0 - no timestamp, 1 - timestamp recorded */
1533 u32 num_wraps; /* # times uCode wrapped to top of log */
1534 u32 next_entry; /* index of next entry to be written by uCode */
1535 u32 size; /* # entries that we'll print */
1536 int pos = 0;
1537 size_t bufsz = 0;
1538
1539 base = le32_to_cpu(priv->card_alive.log_event_table_ptr);
1540 if (!iwl3945_hw_valid_rtc_data_addr(base)) {
1541 IWL_ERR(priv, "Invalid event log pointer 0x%08X\n", base);
1542 return -EINVAL;
1543 }
1544
1545 /* event log header */
1546 capacity = iwl_legacy_read_targ_mem(priv, base);
1547 mode = iwl_legacy_read_targ_mem(priv, base + (1 * sizeof(u32)));
1548 num_wraps = iwl_legacy_read_targ_mem(priv, base + (2 * sizeof(u32)));
1549 next_entry = iwl_legacy_read_targ_mem(priv, base + (3 * sizeof(u32)));
1550
1551 if (capacity > priv->cfg->base_params->max_event_log_size) {
1552 IWL_ERR(priv, "Log capacity %d is bogus, limit to %d entries\n",
1553 capacity, priv->cfg->base_params->max_event_log_size);
1554 capacity = priv->cfg->base_params->max_event_log_size;
1555 }
1556
1557 if (next_entry > priv->cfg->base_params->max_event_log_size) {
1558 IWL_ERR(priv, "Log write index %d is bogus, limit to %d\n",
1559 next_entry, priv->cfg->base_params->max_event_log_size);
1560 next_entry = priv->cfg->base_params->max_event_log_size;
1561 }
1562
1563 size = num_wraps ? capacity : next_entry;
1564
1565 /* bail out if nothing in log */
1566 if (size == 0) {
1567 IWL_ERR(priv, "Start IWL Event Log Dump: nothing in log\n");
1568 return pos;
1569 }
1570
1571#ifdef CONFIG_IWLWIFI_LEGACY_DEBUG
1572 if (!(iwl_legacy_get_debug_level(priv) & IWL_DL_FW_ERRORS) && !full_log)
1573 size = (size > DEFAULT_IWL3945_DUMP_EVENT_LOG_ENTRIES)
1574 ? DEFAULT_IWL3945_DUMP_EVENT_LOG_ENTRIES : size;
1575#else
1576 size = (size > DEFAULT_IWL3945_DUMP_EVENT_LOG_ENTRIES)
1577 ? DEFAULT_IWL3945_DUMP_EVENT_LOG_ENTRIES : size;
1578#endif
1579
1580 IWL_ERR(priv, "Start IWL Event Log Dump: display last %d count\n",
1581 size);
1582
1583#ifdef CONFIG_IWLWIFI_LEGACY_DEBUG
1584 if (display) {
1585 if (full_log)
1586 bufsz = capacity * 48;
1587 else
1588 bufsz = size * 48;
1589 *buf = kmalloc(bufsz, GFP_KERNEL);
1590 if (!*buf)
1591 return -ENOMEM;
1592 }
1593 if ((iwl_legacy_get_debug_level(priv) & IWL_DL_FW_ERRORS) || full_log) {
1594 /* if uCode has wrapped back to top of log,
1595 * start at the oldest entry,
1596 * i.e the next one that uCode would fill.
1597 */
1598 if (num_wraps)
1599 pos = iwl3945_print_event_log(priv, next_entry,
1600 capacity - next_entry, mode,
1601 pos, buf, bufsz);
1602
1603 /* (then/else) start at top of log */
1604 pos = iwl3945_print_event_log(priv, 0, next_entry, mode,
1605 pos, buf, bufsz);
1606 } else
1607 pos = iwl3945_print_last_event_logs(priv, capacity, num_wraps,
1608 next_entry, size, mode,
1609 pos, buf, bufsz);
1610#else
1611 pos = iwl3945_print_last_event_logs(priv, capacity, num_wraps,
1612 next_entry, size, mode,
1613 pos, buf, bufsz);
1614#endif
1615 return pos;
1616}
1617
1618static void iwl3945_irq_tasklet(struct iwl_priv *priv) 1412static void iwl3945_irq_tasklet(struct iwl_priv *priv)
1619{ 1413{
1620 u32 inta, handled = 0; 1414 u32 inta, handled = 0;
diff --git a/drivers/net/wireless/iwlegacy/iwl4965-base.c b/drivers/net/wireless/iwlegacy/iwl4965-base.c
index ed86b221d067..98e42a11b71f 100644
--- a/drivers/net/wireless/iwlegacy/iwl4965-base.c
+++ b/drivers/net/wireless/iwlegacy/iwl4965-base.c
@@ -488,134 +488,6 @@ static void iwl4965_bg_statistics_periodic(unsigned long data)
488 iwl_legacy_send_statistics_request(priv, CMD_ASYNC, false); 488 iwl_legacy_send_statistics_request(priv, CMD_ASYNC, false);
489} 489}
490 490
491
492static void iwl4965_print_cont_event_trace(struct iwl_priv *priv, u32 base,
493 u32 start_idx, u32 num_events,
494 u32 mode)
495{
496 u32 i;
497 u32 ptr; /* SRAM byte address of log data */
498 u32 ev, time, data; /* event log data */
499 unsigned long reg_flags;
500
501 if (mode == 0)
502 ptr = base + (4 * sizeof(u32)) + (start_idx * 2 * sizeof(u32));
503 else
504 ptr = base + (4 * sizeof(u32)) + (start_idx * 3 * sizeof(u32));
505
506 /* Make sure device is powered up for SRAM reads */
507 spin_lock_irqsave(&priv->reg_lock, reg_flags);
508 if (iwl_grab_nic_access(priv)) {
509 spin_unlock_irqrestore(&priv->reg_lock, reg_flags);
510 return;
511 }
512
513 /* Set starting address; reads will auto-increment */
514 _iwl_legacy_write_direct32(priv, HBUS_TARG_MEM_RADDR, ptr);
515 rmb();
516
517 /*
518 * "time" is actually "data" for mode 0 (no timestamp).
519 * place event id # at far right for easier visual parsing.
520 */
521 for (i = 0; i < num_events; i++) {
522 ev = _iwl_legacy_read_direct32(priv, HBUS_TARG_MEM_RDAT);
523 time = _iwl_legacy_read_direct32(priv, HBUS_TARG_MEM_RDAT);
524 if (mode == 0) {
525 trace_iwlwifi_legacy_dev_ucode_cont_event(priv,
526 0, time, ev);
527 } else {
528 data = _iwl_legacy_read_direct32(priv,
529 HBUS_TARG_MEM_RDAT);
530 trace_iwlwifi_legacy_dev_ucode_cont_event(priv,
531 time, data, ev);
532 }
533 }
534 /* Allow device to power down */
535 iwl_release_nic_access(priv);
536 spin_unlock_irqrestore(&priv->reg_lock, reg_flags);
537}
538
539static void iwl4965_continuous_event_trace(struct iwl_priv *priv)
540{
541 u32 capacity; /* event log capacity in # entries */
542 u32 base; /* SRAM byte address of event log header */
543 u32 mode; /* 0 - no timestamp, 1 - timestamp recorded */
544 u32 num_wraps; /* # times uCode wrapped to top of log */
545 u32 next_entry; /* index of next entry to be written by uCode */
546
547 if (priv->ucode_type == UCODE_INIT)
548 base = le32_to_cpu(priv->card_alive_init.error_event_table_ptr);
549 else
550 base = le32_to_cpu(priv->card_alive.log_event_table_ptr);
551 if (priv->cfg->ops->lib->is_valid_rtc_data_addr(base)) {
552 capacity = iwl_legacy_read_targ_mem(priv, base);
553 num_wraps = iwl_legacy_read_targ_mem(priv,
554 base + (2 * sizeof(u32)));
555 mode = iwl_legacy_read_targ_mem(priv, base + (1 * sizeof(u32)));
556 next_entry = iwl_legacy_read_targ_mem(priv,
557 base + (3 * sizeof(u32)));
558 } else
559 return;
560
561 if (num_wraps == priv->event_log.num_wraps) {
562 iwl4965_print_cont_event_trace(priv,
563 base, priv->event_log.next_entry,
564 next_entry - priv->event_log.next_entry,
565 mode);
566 priv->event_log.non_wraps_count++;
567 } else {
568 if ((num_wraps - priv->event_log.num_wraps) > 1)
569 priv->event_log.wraps_more_count++;
570 else
571 priv->event_log.wraps_once_count++;
572 trace_iwlwifi_legacy_dev_ucode_wrap_event(priv,
573 num_wraps - priv->event_log.num_wraps,
574 next_entry, priv->event_log.next_entry);
575 if (next_entry < priv->event_log.next_entry) {
576 iwl4965_print_cont_event_trace(priv, base,
577 priv->event_log.next_entry,
578 capacity - priv->event_log.next_entry,
579 mode);
580
581 iwl4965_print_cont_event_trace(priv, base, 0,
582 next_entry, mode);
583 } else {
584 iwl4965_print_cont_event_trace(priv, base,
585 next_entry, capacity - next_entry,
586 mode);
587
588 iwl4965_print_cont_event_trace(priv, base, 0,
589 next_entry, mode);
590 }
591 }
592 priv->event_log.num_wraps = num_wraps;
593 priv->event_log.next_entry = next_entry;
594}
595
596/**
597 * iwl4965_bg_ucode_trace - Timer callback to log ucode event
598 *
599 * The timer is continually set to execute every
600 * UCODE_TRACE_PERIOD milliseconds after the last timer expired
601 * this function is to perform continuous uCode event logging operation
602 * if enabled
603 */
604static void iwl4965_bg_ucode_trace(unsigned long data)
605{
606 struct iwl_priv *priv = (struct iwl_priv *)data;
607
608 if (test_bit(STATUS_EXIT_PENDING, &priv->status))
609 return;
610
611 if (priv->event_log.ucode_trace) {
612 iwl4965_continuous_event_trace(priv);
613 /* Reschedule the timer to occur in UCODE_TRACE_PERIOD */
614 mod_timer(&priv->ucode_trace,
615 jiffies + msecs_to_jiffies(UCODE_TRACE_PERIOD));
616 }
617}
618
619static void iwl4965_rx_beacon_notif(struct iwl_priv *priv, 491static void iwl4965_rx_beacon_notif(struct iwl_priv *priv,
620 struct iwl_rx_mem_buffer *rxb) 492 struct iwl_rx_mem_buffer *rxb)
621{ 493{
@@ -1711,209 +1583,6 @@ void iwl4965_dump_nic_error_log(struct iwl_priv *priv)
1711 pc, blink1, blink2, ilink1, ilink2, hcmd); 1583 pc, blink1, blink2, ilink1, ilink2, hcmd);
1712} 1584}
1713 1585
1714#define EVENT_START_OFFSET (4 * sizeof(u32))
1715
1716/**
1717 * iwl4965_print_event_log - Dump error event log to syslog
1718 *
1719 */
1720static int iwl4965_print_event_log(struct iwl_priv *priv, u32 start_idx,
1721 u32 num_events, u32 mode,
1722 int pos, char **buf, size_t bufsz)
1723{
1724 u32 i;
1725 u32 base; /* SRAM byte address of event log header */
1726 u32 event_size; /* 2 u32s, or 3 u32s if timestamp recorded */
1727 u32 ptr; /* SRAM byte address of log data */
1728 u32 ev, time, data; /* event log data */
1729 unsigned long reg_flags;
1730
1731 if (num_events == 0)
1732 return pos;
1733
1734 if (priv->ucode_type == UCODE_INIT) {
1735 base = le32_to_cpu(priv->card_alive_init.log_event_table_ptr);
1736 } else {
1737 base = le32_to_cpu(priv->card_alive.log_event_table_ptr);
1738 }
1739
1740 if (mode == 0)
1741 event_size = 2 * sizeof(u32);
1742 else
1743 event_size = 3 * sizeof(u32);
1744
1745 ptr = base + EVENT_START_OFFSET + (start_idx * event_size);
1746
1747 /* Make sure device is powered up for SRAM reads */
1748 spin_lock_irqsave(&priv->reg_lock, reg_flags);
1749 iwl_grab_nic_access(priv);
1750
1751 /* Set starting address; reads will auto-increment */
1752 _iwl_legacy_write_direct32(priv, HBUS_TARG_MEM_RADDR, ptr);
1753 rmb();
1754
1755 /* "time" is actually "data" for mode 0 (no timestamp).
1756 * place event id # at far right for easier visual parsing. */
1757 for (i = 0; i < num_events; i++) {
1758 ev = _iwl_legacy_read_direct32(priv, HBUS_TARG_MEM_RDAT);
1759 time = _iwl_legacy_read_direct32(priv, HBUS_TARG_MEM_RDAT);
1760 if (mode == 0) {
1761 /* data, ev */
1762 if (bufsz) {
1763 pos += scnprintf(*buf + pos, bufsz - pos,
1764 "EVT_LOG:0x%08x:%04u\n",
1765 time, ev);
1766 } else {
1767 trace_iwlwifi_legacy_dev_ucode_event(priv, 0,
1768 time, ev);
1769 IWL_ERR(priv, "EVT_LOG:0x%08x:%04u\n",
1770 time, ev);
1771 }
1772 } else {
1773 data = _iwl_legacy_read_direct32(priv,
1774 HBUS_TARG_MEM_RDAT);
1775 if (bufsz) {
1776 pos += scnprintf(*buf + pos, bufsz - pos,
1777 "EVT_LOGT:%010u:0x%08x:%04u\n",
1778 time, data, ev);
1779 } else {
1780 IWL_ERR(priv, "EVT_LOGT:%010u:0x%08x:%04u\n",
1781 time, data, ev);
1782 trace_iwlwifi_legacy_dev_ucode_event(priv, time,
1783 data, ev);
1784 }
1785 }
1786 }
1787
1788 /* Allow device to power down */
1789 iwl_release_nic_access(priv);
1790 spin_unlock_irqrestore(&priv->reg_lock, reg_flags);
1791 return pos;
1792}
1793
1794/**
1795 * iwl4965_print_last_event_logs - Dump the newest # of event log to syslog
1796 */
1797static int iwl4965_print_last_event_logs(struct iwl_priv *priv, u32 capacity,
1798 u32 num_wraps, u32 next_entry,
1799 u32 size, u32 mode,
1800 int pos, char **buf, size_t bufsz)
1801{
1802 /*
1803 * display the newest DEFAULT_LOG_ENTRIES entries
1804 * i.e the entries just before the next ont that uCode would fill.
1805 */
1806 if (num_wraps) {
1807 if (next_entry < size) {
1808 pos = iwl4965_print_event_log(priv,
1809 capacity - (size - next_entry),
1810 size - next_entry, mode,
1811 pos, buf, bufsz);
1812 pos = iwl4965_print_event_log(priv, 0,
1813 next_entry, mode,
1814 pos, buf, bufsz);
1815 } else
1816 pos = iwl4965_print_event_log(priv, next_entry - size,
1817 size, mode, pos, buf, bufsz);
1818 } else {
1819 if (next_entry < size) {
1820 pos = iwl4965_print_event_log(priv, 0, next_entry,
1821 mode, pos, buf, bufsz);
1822 } else {
1823 pos = iwl4965_print_event_log(priv, next_entry - size,
1824 size, mode, pos, buf, bufsz);
1825 }
1826 }
1827 return pos;
1828}
1829
1830#define DEFAULT_DUMP_EVENT_LOG_ENTRIES (20)
1831
1832int iwl4965_dump_nic_event_log(struct iwl_priv *priv, bool full_log,
1833 char **buf, bool display)
1834{
1835 u32 base; /* SRAM byte address of event log header */
1836 u32 capacity; /* event log capacity in # entries */
1837 u32 mode; /* 0 - no timestamp, 1 - timestamp recorded */
1838 u32 num_wraps; /* # times uCode wrapped to top of log */
1839 u32 next_entry; /* index of next entry to be written by uCode */
1840 u32 size; /* # entries that we'll print */
1841 int pos = 0;
1842 size_t bufsz = 0;
1843
1844 if (priv->ucode_type == UCODE_INIT) {
1845 base = le32_to_cpu(priv->card_alive_init.log_event_table_ptr);
1846 } else {
1847 base = le32_to_cpu(priv->card_alive.log_event_table_ptr);
1848 }
1849
1850 if (!priv->cfg->ops->lib->is_valid_rtc_data_addr(base)) {
1851 IWL_ERR(priv,
1852 "Invalid event log pointer 0x%08X for %s uCode\n",
1853 base, (priv->ucode_type == UCODE_INIT) ? "Init" : "RT");
1854 return -EINVAL;
1855 }
1856
1857 /* event log header */
1858 capacity = iwl_legacy_read_targ_mem(priv, base);
1859 mode = iwl_legacy_read_targ_mem(priv, base + (1 * sizeof(u32)));
1860 num_wraps = iwl_legacy_read_targ_mem(priv, base + (2 * sizeof(u32)));
1861 next_entry = iwl_legacy_read_targ_mem(priv, base + (3 * sizeof(u32)));
1862
1863 size = num_wraps ? capacity : next_entry;
1864
1865 /* bail out if nothing in log */
1866 if (size == 0) {
1867 IWL_ERR(priv, "Start IWL Event Log Dump: nothing in log\n");
1868 return pos;
1869 }
1870
1871#ifdef CONFIG_IWLWIFI_LEGACY_DEBUG
1872 if (!(iwl_legacy_get_debug_level(priv) & IWL_DL_FW_ERRORS) && !full_log)
1873 size = (size > DEFAULT_DUMP_EVENT_LOG_ENTRIES)
1874 ? DEFAULT_DUMP_EVENT_LOG_ENTRIES : size;
1875#else
1876 size = (size > DEFAULT_DUMP_EVENT_LOG_ENTRIES)
1877 ? DEFAULT_DUMP_EVENT_LOG_ENTRIES : size;
1878#endif
1879 IWL_ERR(priv, "Start IWL Event Log Dump: display last %u entries\n",
1880 size);
1881
1882#ifdef CONFIG_IWLWIFI_LEGACY_DEBUG
1883 if (display) {
1884 if (full_log)
1885 bufsz = capacity * 48;
1886 else
1887 bufsz = size * 48;
1888 *buf = kmalloc(bufsz, GFP_KERNEL);
1889 if (!*buf)
1890 return -ENOMEM;
1891 }
1892 if ((iwl_legacy_get_debug_level(priv) & IWL_DL_FW_ERRORS) || full_log) {
1893 /*
1894 * if uCode has wrapped back to top of log,
1895 * start at the oldest entry,
1896 * i.e the next one that uCode would fill.
1897 */
1898 if (num_wraps)
1899 pos = iwl4965_print_event_log(priv, next_entry,
1900 capacity - next_entry, mode,
1901 pos, buf, bufsz);
1902 /* (then/else) start at top of log */
1903 pos = iwl4965_print_event_log(priv, 0,
1904 next_entry, mode, pos, buf, bufsz);
1905 } else
1906 pos = iwl4965_print_last_event_logs(priv, capacity, num_wraps,
1907 next_entry, size, mode,
1908 pos, buf, bufsz);
1909#else
1910 pos = iwl4965_print_last_event_logs(priv, capacity, num_wraps,
1911 next_entry, size, mode,
1912 pos, buf, bufsz);
1913#endif
1914 return pos;
1915}
1916
1917static void iwl4965_rf_kill_ct_config(struct iwl_priv *priv) 1586static void iwl4965_rf_kill_ct_config(struct iwl_priv *priv)
1918{ 1587{
1919 struct iwl_ct_kill_config cmd; 1588 struct iwl_ct_kill_config cmd;
@@ -3034,10 +2703,6 @@ static void iwl4965_setup_deferred_work(struct iwl_priv *priv)
3034 priv->statistics_periodic.data = (unsigned long)priv; 2703 priv->statistics_periodic.data = (unsigned long)priv;
3035 priv->statistics_periodic.function = iwl4965_bg_statistics_periodic; 2704 priv->statistics_periodic.function = iwl4965_bg_statistics_periodic;
3036 2705
3037 init_timer(&priv->ucode_trace);
3038 priv->ucode_trace.data = (unsigned long)priv;
3039 priv->ucode_trace.function = iwl4965_bg_ucode_trace;
3040
3041 init_timer(&priv->watchdog); 2706 init_timer(&priv->watchdog);
3042 priv->watchdog.data = (unsigned long)priv; 2707 priv->watchdog.data = (unsigned long)priv;
3043 priv->watchdog.function = iwl_legacy_bg_watchdog; 2708 priv->watchdog.function = iwl_legacy_bg_watchdog;
@@ -3056,7 +2721,6 @@ static void iwl4965_cancel_deferred_work(struct iwl_priv *priv)
3056 iwl_legacy_cancel_scan_deferred_work(priv); 2721 iwl_legacy_cancel_scan_deferred_work(priv);
3057 2722
3058 del_timer_sync(&priv->statistics_periodic); 2723 del_timer_sync(&priv->statistics_periodic);
3059 del_timer_sync(&priv->ucode_trace);
3060} 2724}
3061 2725
3062static void iwl4965_init_hw_rates(struct iwl_priv *priv, 2726static void iwl4965_init_hw_rates(struct iwl_priv *priv,