diff options
author | Stanislaw Gruszka <sgruszka@redhat.com> | 2011-10-24 09:41:30 -0400 |
---|---|---|
committer | Stanislaw Gruszka <sgruszka@redhat.com> | 2011-11-15 05:16:58 -0500 |
commit | e2ebc8337d116acdc25469ec8547ae665f50a4c1 (patch) | |
tree | cf4401fdbf6dabbd2731d90e3105c1ebbf60f87d /drivers/net/wireless/iwlegacy/iwl-debugfs.c | |
parent | fee005e5dd82a43546c1b1beb187e82415360940 (diff) |
iwlegacy: rename iwl to il
iwl_legacy prefix result in long function names, what cause that we
have frequent line split and not readable code. Also iwl_foo symbols
are duplicated in iwlwifi driver, what is annoying when editing
kernel tree with cscope.
Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com>
Diffstat (limited to 'drivers/net/wireless/iwlegacy/iwl-debugfs.c')
-rw-r--r-- | drivers/net/wireless/iwlegacy/iwl-debugfs.c | 284 |
1 files changed, 142 insertions, 142 deletions
diff --git a/drivers/net/wireless/iwlegacy/iwl-debugfs.c b/drivers/net/wireless/iwlegacy/iwl-debugfs.c index 996996a7165..057dec5b178 100644 --- a/drivers/net/wireless/iwlegacy/iwl-debugfs.c +++ b/drivers/net/wireless/iwlegacy/iwl-debugfs.c | |||
@@ -37,7 +37,7 @@ | |||
37 | /* create and remove of files */ | 37 | /* create and remove of files */ |
38 | #define DEBUGFS_ADD_FILE(name, parent, mode) do { \ | 38 | #define DEBUGFS_ADD_FILE(name, parent, mode) do { \ |
39 | if (!debugfs_create_file(#name, mode, parent, priv, \ | 39 | if (!debugfs_create_file(#name, mode, parent, priv, \ |
40 | &iwl_legacy_dbgfs_##name##_ops)) \ | 40 | &il_dbgfs_##name##_ops)) \ |
41 | goto err; \ | 41 | goto err; \ |
42 | } while (0) | 42 | } while (0) |
43 | 43 | ||
@@ -59,18 +59,18 @@ | |||
59 | 59 | ||
60 | /* file operation */ | 60 | /* file operation */ |
61 | #define DEBUGFS_READ_FUNC(name) \ | 61 | #define DEBUGFS_READ_FUNC(name) \ |
62 | static ssize_t iwl_legacy_dbgfs_##name##_read(struct file *file, \ | 62 | static ssize_t il_dbgfs_##name##_read(struct file *file, \ |
63 | char __user *user_buf, \ | 63 | char __user *user_buf, \ |
64 | size_t count, loff_t *ppos); | 64 | size_t count, loff_t *ppos); |
65 | 65 | ||
66 | #define DEBUGFS_WRITE_FUNC(name) \ | 66 | #define DEBUGFS_WRITE_FUNC(name) \ |
67 | static ssize_t iwl_legacy_dbgfs_##name##_write(struct file *file, \ | 67 | static ssize_t il_dbgfs_##name##_write(struct file *file, \ |
68 | const char __user *user_buf, \ | 68 | const char __user *user_buf, \ |
69 | size_t count, loff_t *ppos); | 69 | size_t count, loff_t *ppos); |
70 | 70 | ||
71 | 71 | ||
72 | static int | 72 | static int |
73 | iwl_legacy_dbgfs_open_file_generic(struct inode *inode, struct file *file) | 73 | il_dbgfs_open_file_generic(struct inode *inode, struct file *file) |
74 | { | 74 | { |
75 | file->private_data = inode->i_private; | 75 | file->private_data = inode->i_private; |
76 | return 0; | 76 | return 0; |
@@ -78,35 +78,35 @@ iwl_legacy_dbgfs_open_file_generic(struct inode *inode, struct file *file) | |||
78 | 78 | ||
79 | #define DEBUGFS_READ_FILE_OPS(name) \ | 79 | #define DEBUGFS_READ_FILE_OPS(name) \ |
80 | DEBUGFS_READ_FUNC(name); \ | 80 | DEBUGFS_READ_FUNC(name); \ |
81 | static const struct file_operations iwl_legacy_dbgfs_##name##_ops = { \ | 81 | static const struct file_operations il_dbgfs_##name##_ops = { \ |
82 | .read = iwl_legacy_dbgfs_##name##_read, \ | 82 | .read = il_dbgfs_##name##_read, \ |
83 | .open = iwl_legacy_dbgfs_open_file_generic, \ | 83 | .open = il_dbgfs_open_file_generic, \ |
84 | .llseek = generic_file_llseek, \ | 84 | .llseek = generic_file_llseek, \ |
85 | }; | 85 | }; |
86 | 86 | ||
87 | #define DEBUGFS_WRITE_FILE_OPS(name) \ | 87 | #define DEBUGFS_WRITE_FILE_OPS(name) \ |
88 | DEBUGFS_WRITE_FUNC(name); \ | 88 | DEBUGFS_WRITE_FUNC(name); \ |
89 | static const struct file_operations iwl_legacy_dbgfs_##name##_ops = { \ | 89 | static const struct file_operations il_dbgfs_##name##_ops = { \ |
90 | .write = iwl_legacy_dbgfs_##name##_write, \ | 90 | .write = il_dbgfs_##name##_write, \ |
91 | .open = iwl_legacy_dbgfs_open_file_generic, \ | 91 | .open = il_dbgfs_open_file_generic, \ |
92 | .llseek = generic_file_llseek, \ | 92 | .llseek = generic_file_llseek, \ |
93 | }; | 93 | }; |
94 | 94 | ||
95 | #define DEBUGFS_READ_WRITE_FILE_OPS(name) \ | 95 | #define DEBUGFS_READ_WRITE_FILE_OPS(name) \ |
96 | DEBUGFS_READ_FUNC(name); \ | 96 | DEBUGFS_READ_FUNC(name); \ |
97 | DEBUGFS_WRITE_FUNC(name); \ | 97 | DEBUGFS_WRITE_FUNC(name); \ |
98 | static const struct file_operations iwl_legacy_dbgfs_##name##_ops = { \ | 98 | static const struct file_operations il_dbgfs_##name##_ops = { \ |
99 | .write = iwl_legacy_dbgfs_##name##_write, \ | 99 | .write = il_dbgfs_##name##_write, \ |
100 | .read = iwl_legacy_dbgfs_##name##_read, \ | 100 | .read = il_dbgfs_##name##_read, \ |
101 | .open = iwl_legacy_dbgfs_open_file_generic, \ | 101 | .open = il_dbgfs_open_file_generic, \ |
102 | .llseek = generic_file_llseek, \ | 102 | .llseek = generic_file_llseek, \ |
103 | }; | 103 | }; |
104 | 104 | ||
105 | static ssize_t iwl_legacy_dbgfs_tx_statistics_read(struct file *file, | 105 | static ssize_t il_dbgfs_tx_statistics_read(struct file *file, |
106 | char __user *user_buf, | 106 | char __user *user_buf, |
107 | size_t count, loff_t *ppos) { | 107 | size_t count, loff_t *ppos) { |
108 | 108 | ||
109 | struct iwl_priv *priv = file->private_data; | 109 | struct il_priv *priv = file->private_data; |
110 | char *buf; | 110 | char *buf; |
111 | int pos = 0; | 111 | int pos = 0; |
112 | 112 | ||
@@ -121,14 +121,14 @@ static ssize_t iwl_legacy_dbgfs_tx_statistics_read(struct file *file, | |||
121 | for (cnt = 0; cnt < MANAGEMENT_MAX; cnt++) { | 121 | for (cnt = 0; cnt < MANAGEMENT_MAX; cnt++) { |
122 | pos += scnprintf(buf + pos, bufsz - pos, | 122 | pos += scnprintf(buf + pos, bufsz - pos, |
123 | "\t%25s\t\t: %u\n", | 123 | "\t%25s\t\t: %u\n", |
124 | iwl_legacy_get_mgmt_string(cnt), | 124 | il_get_mgmt_string(cnt), |
125 | priv->tx_stats.mgmt[cnt]); | 125 | priv->tx_stats.mgmt[cnt]); |
126 | } | 126 | } |
127 | pos += scnprintf(buf + pos, bufsz - pos, "Control\n"); | 127 | pos += scnprintf(buf + pos, bufsz - pos, "Control\n"); |
128 | for (cnt = 0; cnt < CONTROL_MAX; cnt++) { | 128 | for (cnt = 0; cnt < CONTROL_MAX; cnt++) { |
129 | pos += scnprintf(buf + pos, bufsz - pos, | 129 | pos += scnprintf(buf + pos, bufsz - pos, |
130 | "\t%25s\t\t: %u\n", | 130 | "\t%25s\t\t: %u\n", |
131 | iwl_legacy_get_ctrl_string(cnt), | 131 | il_get_ctrl_string(cnt), |
132 | priv->tx_stats.ctrl[cnt]); | 132 | priv->tx_stats.ctrl[cnt]); |
133 | } | 133 | } |
134 | pos += scnprintf(buf + pos, bufsz - pos, "Data:\n"); | 134 | pos += scnprintf(buf + pos, bufsz - pos, "Data:\n"); |
@@ -142,11 +142,11 @@ static ssize_t iwl_legacy_dbgfs_tx_statistics_read(struct file *file, | |||
142 | } | 142 | } |
143 | 143 | ||
144 | static ssize_t | 144 | static ssize_t |
145 | iwl_legacy_dbgfs_clear_traffic_statistics_write(struct file *file, | 145 | il_dbgfs_clear_traffic_statistics_write(struct file *file, |
146 | const char __user *user_buf, | 146 | const char __user *user_buf, |
147 | size_t count, loff_t *ppos) | 147 | size_t count, loff_t *ppos) |
148 | { | 148 | { |
149 | struct iwl_priv *priv = file->private_data; | 149 | struct il_priv *priv = file->private_data; |
150 | u32 clear_flag; | 150 | u32 clear_flag; |
151 | char buf[8]; | 151 | char buf[8]; |
152 | int buf_size; | 152 | int buf_size; |
@@ -157,16 +157,16 @@ iwl_legacy_dbgfs_clear_traffic_statistics_write(struct file *file, | |||
157 | return -EFAULT; | 157 | return -EFAULT; |
158 | if (sscanf(buf, "%x", &clear_flag) != 1) | 158 | if (sscanf(buf, "%x", &clear_flag) != 1) |
159 | return -EFAULT; | 159 | return -EFAULT; |
160 | iwl_legacy_clear_traffic_stats(priv); | 160 | il_clear_traffic_stats(priv); |
161 | 161 | ||
162 | return count; | 162 | return count; |
163 | } | 163 | } |
164 | 164 | ||
165 | static ssize_t iwl_legacy_dbgfs_rx_statistics_read(struct file *file, | 165 | static ssize_t il_dbgfs_rx_statistics_read(struct file *file, |
166 | char __user *user_buf, | 166 | char __user *user_buf, |
167 | size_t count, loff_t *ppos) { | 167 | size_t count, loff_t *ppos) { |
168 | 168 | ||
169 | struct iwl_priv *priv = file->private_data; | 169 | struct il_priv *priv = file->private_data; |
170 | char *buf; | 170 | char *buf; |
171 | int pos = 0; | 171 | int pos = 0; |
172 | int cnt; | 172 | int cnt; |
@@ -181,14 +181,14 @@ static ssize_t iwl_legacy_dbgfs_rx_statistics_read(struct file *file, | |||
181 | for (cnt = 0; cnt < MANAGEMENT_MAX; cnt++) { | 181 | for (cnt = 0; cnt < MANAGEMENT_MAX; cnt++) { |
182 | pos += scnprintf(buf + pos, bufsz - pos, | 182 | pos += scnprintf(buf + pos, bufsz - pos, |
183 | "\t%25s\t\t: %u\n", | 183 | "\t%25s\t\t: %u\n", |
184 | iwl_legacy_get_mgmt_string(cnt), | 184 | il_get_mgmt_string(cnt), |
185 | priv->rx_stats.mgmt[cnt]); | 185 | priv->rx_stats.mgmt[cnt]); |
186 | } | 186 | } |
187 | pos += scnprintf(buf + pos, bufsz - pos, "Control:\n"); | 187 | pos += scnprintf(buf + pos, bufsz - pos, "Control:\n"); |
188 | for (cnt = 0; cnt < CONTROL_MAX; cnt++) { | 188 | for (cnt = 0; cnt < CONTROL_MAX; cnt++) { |
189 | pos += scnprintf(buf + pos, bufsz - pos, | 189 | pos += scnprintf(buf + pos, bufsz - pos, |
190 | "\t%25s\t\t: %u\n", | 190 | "\t%25s\t\t: %u\n", |
191 | iwl_legacy_get_ctrl_string(cnt), | 191 | il_get_ctrl_string(cnt), |
192 | priv->rx_stats.ctrl[cnt]); | 192 | priv->rx_stats.ctrl[cnt]); |
193 | } | 193 | } |
194 | pos += scnprintf(buf + pos, bufsz - pos, "Data:\n"); | 194 | pos += scnprintf(buf + pos, bufsz - pos, "Data:\n"); |
@@ -205,7 +205,7 @@ static ssize_t iwl_legacy_dbgfs_rx_statistics_read(struct file *file, | |||
205 | #define BYTE1_MASK 0x000000ff; | 205 | #define BYTE1_MASK 0x000000ff; |
206 | #define BYTE2_MASK 0x0000ffff; | 206 | #define BYTE2_MASK 0x0000ffff; |
207 | #define BYTE3_MASK 0x00ffffff; | 207 | #define BYTE3_MASK 0x00ffffff; |
208 | static ssize_t iwl_legacy_dbgfs_sram_read(struct file *file, | 208 | static ssize_t il_dbgfs_sram_read(struct file *file, |
209 | char __user *user_buf, | 209 | char __user *user_buf, |
210 | size_t count, loff_t *ppos) | 210 | size_t count, loff_t *ppos) |
211 | { | 211 | { |
@@ -214,7 +214,7 @@ static ssize_t iwl_legacy_dbgfs_sram_read(struct file *file, | |||
214 | ssize_t ret; | 214 | ssize_t ret; |
215 | int i; | 215 | int i; |
216 | int pos = 0; | 216 | int pos = 0; |
217 | struct iwl_priv *priv = file->private_data; | 217 | struct il_priv *priv = file->private_data; |
218 | size_t bufsz; | 218 | size_t bufsz; |
219 | 219 | ||
220 | /* default is to dump the entire data segment */ | 220 | /* default is to dump the entire data segment */ |
@@ -234,7 +234,7 @@ static ssize_t iwl_legacy_dbgfs_sram_read(struct file *file, | |||
234 | pos += scnprintf(buf + pos, bufsz - pos, "sram_offset: 0x%x\n", | 234 | pos += scnprintf(buf + pos, bufsz - pos, "sram_offset: 0x%x\n", |
235 | priv->dbgfs_sram_offset); | 235 | priv->dbgfs_sram_offset); |
236 | for (i = priv->dbgfs_sram_len; i > 0; i -= 4) { | 236 | for (i = priv->dbgfs_sram_len; i > 0; i -= 4) { |
237 | val = iwl_legacy_read_targ_mem(priv, priv->dbgfs_sram_offset + \ | 237 | val = il_read_targ_mem(priv, priv->dbgfs_sram_offset + \ |
238 | priv->dbgfs_sram_len - i); | 238 | priv->dbgfs_sram_len - i); |
239 | if (i < 4) { | 239 | if (i < 4) { |
240 | switch (i) { | 240 | switch (i) { |
@@ -260,11 +260,11 @@ static ssize_t iwl_legacy_dbgfs_sram_read(struct file *file, | |||
260 | return ret; | 260 | return ret; |
261 | } | 261 | } |
262 | 262 | ||
263 | static ssize_t iwl_legacy_dbgfs_sram_write(struct file *file, | 263 | static ssize_t il_dbgfs_sram_write(struct file *file, |
264 | const char __user *user_buf, | 264 | const char __user *user_buf, |
265 | size_t count, loff_t *ppos) | 265 | size_t count, loff_t *ppos) |
266 | { | 266 | { |
267 | struct iwl_priv *priv = file->private_data; | 267 | struct il_priv *priv = file->private_data; |
268 | char buf[64]; | 268 | char buf[64]; |
269 | int buf_size; | 269 | int buf_size; |
270 | u32 offset, len; | 270 | u32 offset, len; |
@@ -286,11 +286,11 @@ static ssize_t iwl_legacy_dbgfs_sram_write(struct file *file, | |||
286 | } | 286 | } |
287 | 287 | ||
288 | static ssize_t | 288 | static ssize_t |
289 | iwl_legacy_dbgfs_stations_read(struct file *file, char __user *user_buf, | 289 | il_dbgfs_stations_read(struct file *file, char __user *user_buf, |
290 | size_t count, loff_t *ppos) | 290 | size_t count, loff_t *ppos) |
291 | { | 291 | { |
292 | struct iwl_priv *priv = file->private_data; | 292 | struct il_priv *priv = file->private_data; |
293 | struct iwl_station_entry *station; | 293 | struct il_station_entry *station; |
294 | int max_sta = priv->hw_params.max_stations; | 294 | int max_sta = priv->hw_params.max_stations; |
295 | char *buf; | 295 | char *buf; |
296 | int i, j, pos = 0; | 296 | int i, j, pos = 0; |
@@ -343,13 +343,13 @@ iwl_legacy_dbgfs_stations_read(struct file *file, char __user *user_buf, | |||
343 | return ret; | 343 | return ret; |
344 | } | 344 | } |
345 | 345 | ||
346 | static ssize_t iwl_legacy_dbgfs_nvm_read(struct file *file, | 346 | static ssize_t il_dbgfs_nvm_read(struct file *file, |
347 | char __user *user_buf, | 347 | char __user *user_buf, |
348 | size_t count, | 348 | size_t count, |
349 | loff_t *ppos) | 349 | loff_t *ppos) |
350 | { | 350 | { |
351 | ssize_t ret; | 351 | ssize_t ret; |
352 | struct iwl_priv *priv = file->private_data; | 352 | struct il_priv *priv = file->private_data; |
353 | int pos = 0, ofs = 0, buf_size = 0; | 353 | int pos = 0, ofs = 0, buf_size = 0; |
354 | const u8 *ptr; | 354 | const u8 *ptr; |
355 | char *buf; | 355 | char *buf; |
@@ -358,23 +358,23 @@ static ssize_t iwl_legacy_dbgfs_nvm_read(struct file *file, | |||
358 | buf_size = 4 * eeprom_len + 256; | 358 | buf_size = 4 * eeprom_len + 256; |
359 | 359 | ||
360 | if (eeprom_len % 16) { | 360 | if (eeprom_len % 16) { |
361 | IWL_ERR(priv, "NVM size is not multiple of 16.\n"); | 361 | IL_ERR(priv, "NVM size is not multiple of 16.\n"); |
362 | return -ENODATA; | 362 | return -ENODATA; |
363 | } | 363 | } |
364 | 364 | ||
365 | ptr = priv->eeprom; | 365 | ptr = priv->eeprom; |
366 | if (!ptr) { | 366 | if (!ptr) { |
367 | IWL_ERR(priv, "Invalid EEPROM memory\n"); | 367 | IL_ERR(priv, "Invalid EEPROM memory\n"); |
368 | return -ENOMEM; | 368 | return -ENOMEM; |
369 | } | 369 | } |
370 | 370 | ||
371 | /* 4 characters for byte 0xYY */ | 371 | /* 4 characters for byte 0xYY */ |
372 | buf = kzalloc(buf_size, GFP_KERNEL); | 372 | buf = kzalloc(buf_size, GFP_KERNEL); |
373 | if (!buf) { | 373 | if (!buf) { |
374 | IWL_ERR(priv, "Can not allocate Buffer\n"); | 374 | IL_ERR(priv, "Can not allocate Buffer\n"); |
375 | return -ENOMEM; | 375 | return -ENOMEM; |
376 | } | 376 | } |
377 | eeprom_ver = iwl_legacy_eeprom_query16(priv, EEPROM_VERSION); | 377 | eeprom_ver = il_eeprom_query16(priv, EEPROM_VERSION); |
378 | pos += scnprintf(buf + pos, buf_size - pos, "EEPROM " | 378 | pos += scnprintf(buf + pos, buf_size - pos, "EEPROM " |
379 | "version: 0x%x\n", eeprom_ver); | 379 | "version: 0x%x\n", eeprom_ver); |
380 | for (ofs = 0 ; ofs < eeprom_len ; ofs += 16) { | 380 | for (ofs = 0 ; ofs < eeprom_len ; ofs += 16) { |
@@ -392,10 +392,10 @@ static ssize_t iwl_legacy_dbgfs_nvm_read(struct file *file, | |||
392 | } | 392 | } |
393 | 393 | ||
394 | static ssize_t | 394 | static ssize_t |
395 | iwl_legacy_dbgfs_channels_read(struct file *file, char __user *user_buf, | 395 | il_dbgfs_channels_read(struct file *file, char __user *user_buf, |
396 | size_t count, loff_t *ppos) | 396 | size_t count, loff_t *ppos) |
397 | { | 397 | { |
398 | struct iwl_priv *priv = file->private_data; | 398 | struct il_priv *priv = file->private_data; |
399 | struct ieee80211_channel *channels = NULL; | 399 | struct ieee80211_channel *channels = NULL; |
400 | const struct ieee80211_supported_band *supp_band = NULL; | 400 | const struct ieee80211_supported_band *supp_band = NULL; |
401 | int pos = 0, i, bufsz = PAGE_SIZE; | 401 | int pos = 0, i, bufsz = PAGE_SIZE; |
@@ -407,11 +407,11 @@ iwl_legacy_dbgfs_channels_read(struct file *file, char __user *user_buf, | |||
407 | 407 | ||
408 | buf = kzalloc(bufsz, GFP_KERNEL); | 408 | buf = kzalloc(bufsz, GFP_KERNEL); |
409 | if (!buf) { | 409 | if (!buf) { |
410 | IWL_ERR(priv, "Can not allocate Buffer\n"); | 410 | IL_ERR(priv, "Can not allocate Buffer\n"); |
411 | return -ENOMEM; | 411 | return -ENOMEM; |
412 | } | 412 | } |
413 | 413 | ||
414 | supp_band = iwl_get_hw_mode(priv, IEEE80211_BAND_2GHZ); | 414 | supp_band = il_get_hw_mode(priv, IEEE80211_BAND_2GHZ); |
415 | if (supp_band) { | 415 | if (supp_band) { |
416 | channels = supp_band->channels; | 416 | channels = supp_band->channels; |
417 | 417 | ||
@@ -434,7 +434,7 @@ iwl_legacy_dbgfs_channels_read(struct file *file, char __user *user_buf, | |||
434 | IEEE80211_CHAN_PASSIVE_SCAN ? | 434 | IEEE80211_CHAN_PASSIVE_SCAN ? |
435 | "passive only" : "active/passive"); | 435 | "passive only" : "active/passive"); |
436 | } | 436 | } |
437 | supp_band = iwl_get_hw_mode(priv, IEEE80211_BAND_5GHZ); | 437 | supp_band = il_get_hw_mode(priv, IEEE80211_BAND_5GHZ); |
438 | if (supp_band) { | 438 | if (supp_band) { |
439 | channels = supp_band->channels; | 439 | channels = supp_band->channels; |
440 | 440 | ||
@@ -462,11 +462,11 @@ iwl_legacy_dbgfs_channels_read(struct file *file, char __user *user_buf, | |||
462 | return ret; | 462 | return ret; |
463 | } | 463 | } |
464 | 464 | ||
465 | static ssize_t iwl_legacy_dbgfs_status_read(struct file *file, | 465 | static ssize_t il_dbgfs_status_read(struct file *file, |
466 | char __user *user_buf, | 466 | char __user *user_buf, |
467 | size_t count, loff_t *ppos) { | 467 | size_t count, loff_t *ppos) { |
468 | 468 | ||
469 | struct iwl_priv *priv = file->private_data; | 469 | struct il_priv *priv = file->private_data; |
470 | char buf[512]; | 470 | char buf[512]; |
471 | int pos = 0; | 471 | int pos = 0; |
472 | const size_t bufsz = sizeof(buf); | 472 | const size_t bufsz = sizeof(buf); |
@@ -506,11 +506,11 @@ static ssize_t iwl_legacy_dbgfs_status_read(struct file *file, | |||
506 | return simple_read_from_buffer(user_buf, count, ppos, buf, pos); | 506 | return simple_read_from_buffer(user_buf, count, ppos, buf, pos); |
507 | } | 507 | } |
508 | 508 | ||
509 | static ssize_t iwl_legacy_dbgfs_interrupt_read(struct file *file, | 509 | static ssize_t il_dbgfs_interrupt_read(struct file *file, |
510 | char __user *user_buf, | 510 | char __user *user_buf, |
511 | size_t count, loff_t *ppos) { | 511 | size_t count, loff_t *ppos) { |
512 | 512 | ||
513 | struct iwl_priv *priv = file->private_data; | 513 | struct il_priv *priv = file->private_data; |
514 | int pos = 0; | 514 | int pos = 0; |
515 | int cnt = 0; | 515 | int cnt = 0; |
516 | char *buf; | 516 | char *buf; |
@@ -519,7 +519,7 @@ static ssize_t iwl_legacy_dbgfs_interrupt_read(struct file *file, | |||
519 | 519 | ||
520 | buf = kzalloc(bufsz, GFP_KERNEL); | 520 | buf = kzalloc(bufsz, GFP_KERNEL); |
521 | if (!buf) { | 521 | if (!buf) { |
522 | IWL_ERR(priv, "Can not allocate Buffer\n"); | 522 | IL_ERR(priv, "Can not allocate Buffer\n"); |
523 | return -ENOMEM; | 523 | return -ENOMEM; |
524 | } | 524 | } |
525 | 525 | ||
@@ -558,7 +558,7 @@ static ssize_t iwl_legacy_dbgfs_interrupt_read(struct file *file, | |||
558 | if (priv->isr_stats.rx_handlers[cnt] > 0) | 558 | if (priv->isr_stats.rx_handlers[cnt] > 0) |
559 | pos += scnprintf(buf + pos, bufsz - pos, | 559 | pos += scnprintf(buf + pos, bufsz - pos, |
560 | "\tRx handler[%36s]:\t\t %u\n", | 560 | "\tRx handler[%36s]:\t\t %u\n", |
561 | iwl_legacy_get_cmd_string(cnt), | 561 | il_get_cmd_string(cnt), |
562 | priv->isr_stats.rx_handlers[cnt]); | 562 | priv->isr_stats.rx_handlers[cnt]); |
563 | } | 563 | } |
564 | 564 | ||
@@ -573,11 +573,11 @@ static ssize_t iwl_legacy_dbgfs_interrupt_read(struct file *file, | |||
573 | return ret; | 573 | return ret; |
574 | } | 574 | } |
575 | 575 | ||
576 | static ssize_t iwl_legacy_dbgfs_interrupt_write(struct file *file, | 576 | static ssize_t il_dbgfs_interrupt_write(struct file *file, |
577 | const char __user *user_buf, | 577 | const char __user *user_buf, |
578 | size_t count, loff_t *ppos) | 578 | size_t count, loff_t *ppos) |
579 | { | 579 | { |
580 | struct iwl_priv *priv = file->private_data; | 580 | struct il_priv *priv = file->private_data; |
581 | char buf[8]; | 581 | char buf[8]; |
582 | int buf_size; | 582 | int buf_size; |
583 | u32 reset_flag; | 583 | u32 reset_flag; |
@@ -589,19 +589,19 @@ static ssize_t iwl_legacy_dbgfs_interrupt_write(struct file *file, | |||
589 | if (sscanf(buf, "%x", &reset_flag) != 1) | 589 | if (sscanf(buf, "%x", &reset_flag) != 1) |
590 | return -EFAULT; | 590 | return -EFAULT; |
591 | if (reset_flag == 0) | 591 | if (reset_flag == 0) |
592 | iwl_legacy_clear_isr_stats(priv); | 592 | il_clear_isr_stats(priv); |
593 | 593 | ||
594 | return count; | 594 | return count; |
595 | } | 595 | } |
596 | 596 | ||
597 | static ssize_t | 597 | static ssize_t |
598 | iwl_legacy_dbgfs_qos_read(struct file *file, char __user *user_buf, | 598 | il_dbgfs_qos_read(struct file *file, char __user *user_buf, |
599 | size_t count, loff_t *ppos) | 599 | size_t count, loff_t *ppos) |
600 | { | 600 | { |
601 | struct iwl_priv *priv = file->private_data; | 601 | struct il_priv *priv = file->private_data; |
602 | struct iwl_rxon_context *ctx; | 602 | struct il_rxon_context *ctx; |
603 | int pos = 0, i; | 603 | int pos = 0, i; |
604 | char buf[256 * NUM_IWL_RXON_CTX]; | 604 | char buf[256 * NUM_IL_RXON_CTX]; |
605 | const size_t bufsz = sizeof(buf); | 605 | const size_t bufsz = sizeof(buf); |
606 | 606 | ||
607 | for_each_context(priv, ctx) { | 607 | for_each_context(priv, ctx) { |
@@ -622,11 +622,11 @@ iwl_legacy_dbgfs_qos_read(struct file *file, char __user *user_buf, | |||
622 | return simple_read_from_buffer(user_buf, count, ppos, buf, pos); | 622 | return simple_read_from_buffer(user_buf, count, ppos, buf, pos); |
623 | } | 623 | } |
624 | 624 | ||
625 | static ssize_t iwl_legacy_dbgfs_disable_ht40_write(struct file *file, | 625 | static ssize_t il_dbgfs_disable_ht40_write(struct file *file, |
626 | const char __user *user_buf, | 626 | const char __user *user_buf, |
627 | size_t count, loff_t *ppos) | 627 | size_t count, loff_t *ppos) |
628 | { | 628 | { |
629 | struct iwl_priv *priv = file->private_data; | 629 | struct il_priv *priv = file->private_data; |
630 | char buf[8]; | 630 | char buf[8]; |
631 | int buf_size; | 631 | int buf_size; |
632 | int ht40; | 632 | int ht40; |
@@ -637,10 +637,10 @@ static ssize_t iwl_legacy_dbgfs_disable_ht40_write(struct file *file, | |||
637 | return -EFAULT; | 637 | return -EFAULT; |
638 | if (sscanf(buf, "%d", &ht40) != 1) | 638 | if (sscanf(buf, "%d", &ht40) != 1) |
639 | return -EFAULT; | 639 | return -EFAULT; |
640 | if (!iwl_legacy_is_any_associated(priv)) | 640 | if (!il_is_any_associated(priv)) |
641 | priv->disable_ht40 = ht40 ? true : false; | 641 | priv->disable_ht40 = ht40 ? true : false; |
642 | else { | 642 | else { |
643 | IWL_ERR(priv, "Sta associated with AP - " | 643 | IL_ERR(priv, "Sta associated with AP - " |
644 | "Change to 40MHz channel support is not allowed\n"); | 644 | "Change to 40MHz channel support is not allowed\n"); |
645 | return -EINVAL; | 645 | return -EINVAL; |
646 | } | 646 | } |
@@ -648,11 +648,11 @@ static ssize_t iwl_legacy_dbgfs_disable_ht40_write(struct file *file, | |||
648 | return count; | 648 | return count; |
649 | } | 649 | } |
650 | 650 | ||
651 | static ssize_t iwl_legacy_dbgfs_disable_ht40_read(struct file *file, | 651 | static ssize_t il_dbgfs_disable_ht40_read(struct file *file, |
652 | char __user *user_buf, | 652 | char __user *user_buf, |
653 | size_t count, loff_t *ppos) | 653 | size_t count, loff_t *ppos) |
654 | { | 654 | { |
655 | struct iwl_priv *priv = file->private_data; | 655 | struct il_priv *priv = file->private_data; |
656 | char buf[100]; | 656 | char buf[100]; |
657 | int pos = 0; | 657 | int pos = 0; |
658 | const size_t bufsz = sizeof(buf); | 658 | const size_t bufsz = sizeof(buf); |
@@ -672,29 +672,29 @@ DEBUGFS_READ_WRITE_FILE_OPS(interrupt); | |||
672 | DEBUGFS_READ_FILE_OPS(qos); | 672 | DEBUGFS_READ_FILE_OPS(qos); |
673 | DEBUGFS_READ_WRITE_FILE_OPS(disable_ht40); | 673 | DEBUGFS_READ_WRITE_FILE_OPS(disable_ht40); |
674 | 674 | ||
675 | static ssize_t iwl_legacy_dbgfs_traffic_log_read(struct file *file, | 675 | static ssize_t il_dbgfs_traffic_log_read(struct file *file, |
676 | char __user *user_buf, | 676 | char __user *user_buf, |
677 | size_t count, loff_t *ppos) | 677 | size_t count, loff_t *ppos) |
678 | { | 678 | { |
679 | struct iwl_priv *priv = file->private_data; | 679 | struct il_priv *priv = file->private_data; |
680 | int pos = 0, ofs = 0; | 680 | int pos = 0, ofs = 0; |
681 | int cnt = 0, entry; | 681 | int cnt = 0, entry; |
682 | struct iwl_tx_queue *txq; | 682 | struct il_tx_queue *txq; |
683 | struct iwl_queue *q; | 683 | struct il_queue *q; |
684 | struct iwl_rx_queue *rxq = &priv->rxq; | 684 | struct il_rx_queue *rxq = &priv->rxq; |
685 | char *buf; | 685 | char *buf; |
686 | int bufsz = ((IWL_TRAFFIC_ENTRIES * IWL_TRAFFIC_ENTRY_SIZE * 64) * 2) + | 686 | int bufsz = ((IL_TRAFFIC_ENTRIES * IL_TRAFFIC_ENTRY_SIZE * 64) * 2) + |
687 | (priv->cfg->base_params->num_of_queues * 32 * 8) + 400; | 687 | (priv->cfg->base_params->num_of_queues * 32 * 8) + 400; |
688 | const u8 *ptr; | 688 | const u8 *ptr; |
689 | ssize_t ret; | 689 | ssize_t ret; |
690 | 690 | ||
691 | if (!priv->txq) { | 691 | if (!priv->txq) { |
692 | IWL_ERR(priv, "txq not ready\n"); | 692 | IL_ERR(priv, "txq not ready\n"); |
693 | return -EAGAIN; | 693 | return -EAGAIN; |
694 | } | 694 | } |
695 | buf = kzalloc(bufsz, GFP_KERNEL); | 695 | buf = kzalloc(bufsz, GFP_KERNEL); |
696 | if (!buf) { | 696 | if (!buf) { |
697 | IWL_ERR(priv, "Can not allocate buffer\n"); | 697 | IL_ERR(priv, "Can not allocate buffer\n"); |
698 | return -ENOMEM; | 698 | return -ENOMEM; |
699 | } | 699 | } |
700 | pos += scnprintf(buf + pos, bufsz - pos, "Tx Queue\n"); | 700 | pos += scnprintf(buf + pos, bufsz - pos, "Tx Queue\n"); |
@@ -705,12 +705,12 @@ static ssize_t iwl_legacy_dbgfs_traffic_log_read(struct file *file, | |||
705 | "q[%d]: read_ptr: %u, write_ptr: %u\n", | 705 | "q[%d]: read_ptr: %u, write_ptr: %u\n", |
706 | cnt, q->read_ptr, q->write_ptr); | 706 | cnt, q->read_ptr, q->write_ptr); |
707 | } | 707 | } |
708 | if (priv->tx_traffic && (iwlegacy_debug_level & IWL_DL_TX)) { | 708 | if (priv->tx_traffic && (iwlegacy_debug_level & IL_DL_TX)) { |
709 | ptr = priv->tx_traffic; | 709 | ptr = priv->tx_traffic; |
710 | pos += scnprintf(buf + pos, bufsz - pos, | 710 | pos += scnprintf(buf + pos, bufsz - pos, |
711 | "Tx Traffic idx: %u\n", priv->tx_traffic_idx); | 711 | "Tx Traffic idx: %u\n", priv->tx_traffic_idx); |
712 | for (cnt = 0, ofs = 0; cnt < IWL_TRAFFIC_ENTRIES; cnt++) { | 712 | for (cnt = 0, ofs = 0; cnt < IL_TRAFFIC_ENTRIES; cnt++) { |
713 | for (entry = 0; entry < IWL_TRAFFIC_ENTRY_SIZE / 16; | 713 | for (entry = 0; entry < IL_TRAFFIC_ENTRY_SIZE / 16; |
714 | entry++, ofs += 16) { | 714 | entry++, ofs += 16) { |
715 | pos += scnprintf(buf + pos, bufsz - pos, | 715 | pos += scnprintf(buf + pos, bufsz - pos, |
716 | "0x%.4x ", ofs); | 716 | "0x%.4x ", ofs); |
@@ -728,12 +728,12 @@ static ssize_t iwl_legacy_dbgfs_traffic_log_read(struct file *file, | |||
728 | "read: %u, write: %u\n", | 728 | "read: %u, write: %u\n", |
729 | rxq->read, rxq->write); | 729 | rxq->read, rxq->write); |
730 | 730 | ||
731 | if (priv->rx_traffic && (iwlegacy_debug_level & IWL_DL_RX)) { | 731 | if (priv->rx_traffic && (iwlegacy_debug_level & IL_DL_RX)) { |
732 | ptr = priv->rx_traffic; | 732 | ptr = priv->rx_traffic; |
733 | pos += scnprintf(buf + pos, bufsz - pos, | 733 | pos += scnprintf(buf + pos, bufsz - pos, |
734 | "Rx Traffic idx: %u\n", priv->rx_traffic_idx); | 734 | "Rx Traffic idx: %u\n", priv->rx_traffic_idx); |
735 | for (cnt = 0, ofs = 0; cnt < IWL_TRAFFIC_ENTRIES; cnt++) { | 735 | for (cnt = 0, ofs = 0; cnt < IL_TRAFFIC_ENTRIES; cnt++) { |
736 | for (entry = 0; entry < IWL_TRAFFIC_ENTRY_SIZE / 16; | 736 | for (entry = 0; entry < IL_TRAFFIC_ENTRY_SIZE / 16; |
737 | entry++, ofs += 16) { | 737 | entry++, ofs += 16) { |
738 | pos += scnprintf(buf + pos, bufsz - pos, | 738 | pos += scnprintf(buf + pos, bufsz - pos, |
739 | "0x%.4x ", ofs); | 739 | "0x%.4x ", ofs); |
@@ -751,11 +751,11 @@ static ssize_t iwl_legacy_dbgfs_traffic_log_read(struct file *file, | |||
751 | return ret; | 751 | return ret; |
752 | } | 752 | } |
753 | 753 | ||
754 | static ssize_t iwl_legacy_dbgfs_traffic_log_write(struct file *file, | 754 | static ssize_t il_dbgfs_traffic_log_write(struct file *file, |
755 | const char __user *user_buf, | 755 | const char __user *user_buf, |
756 | size_t count, loff_t *ppos) | 756 | size_t count, loff_t *ppos) |
757 | { | 757 | { |
758 | struct iwl_priv *priv = file->private_data; | 758 | struct il_priv *priv = file->private_data; |
759 | char buf[8]; | 759 | char buf[8]; |
760 | int buf_size; | 760 | int buf_size; |
761 | int traffic_log; | 761 | int traffic_log; |
@@ -767,18 +767,18 @@ static ssize_t iwl_legacy_dbgfs_traffic_log_write(struct file *file, | |||
767 | if (sscanf(buf, "%d", &traffic_log) != 1) | 767 | if (sscanf(buf, "%d", &traffic_log) != 1) |
768 | return -EFAULT; | 768 | return -EFAULT; |
769 | if (traffic_log == 0) | 769 | if (traffic_log == 0) |
770 | iwl_legacy_reset_traffic_log(priv); | 770 | il_reset_traffic_log(priv); |
771 | 771 | ||
772 | return count; | 772 | return count; |
773 | } | 773 | } |
774 | 774 | ||
775 | static ssize_t iwl_legacy_dbgfs_tx_queue_read(struct file *file, | 775 | static ssize_t il_dbgfs_tx_queue_read(struct file *file, |
776 | char __user *user_buf, | 776 | char __user *user_buf, |
777 | size_t count, loff_t *ppos) { | 777 | size_t count, loff_t *ppos) { |
778 | 778 | ||
779 | struct iwl_priv *priv = file->private_data; | 779 | struct il_priv *priv = file->private_data; |
780 | struct iwl_tx_queue *txq; | 780 | struct il_tx_queue *txq; |
781 | struct iwl_queue *q; | 781 | struct il_queue *q; |
782 | char *buf; | 782 | char *buf; |
783 | int pos = 0; | 783 | int pos = 0; |
784 | int cnt; | 784 | int cnt; |
@@ -787,7 +787,7 @@ static ssize_t iwl_legacy_dbgfs_tx_queue_read(struct file *file, | |||
787 | priv->cfg->base_params->num_of_queues; | 787 | priv->cfg->base_params->num_of_queues; |
788 | 788 | ||
789 | if (!priv->txq) { | 789 | if (!priv->txq) { |
790 | IWL_ERR(priv, "txq not ready\n"); | 790 | IL_ERR(priv, "txq not ready\n"); |
791 | return -EAGAIN; | 791 | return -EAGAIN; |
792 | } | 792 | } |
793 | buf = kzalloc(bufsz, GFP_KERNEL); | 793 | buf = kzalloc(bufsz, GFP_KERNEL); |
@@ -816,12 +816,12 @@ static ssize_t iwl_legacy_dbgfs_tx_queue_read(struct file *file, | |||
816 | return ret; | 816 | return ret; |
817 | } | 817 | } |
818 | 818 | ||
819 | static ssize_t iwl_legacy_dbgfs_rx_queue_read(struct file *file, | 819 | static ssize_t il_dbgfs_rx_queue_read(struct file *file, |
820 | char __user *user_buf, | 820 | char __user *user_buf, |
821 | size_t count, loff_t *ppos) { | 821 | size_t count, loff_t *ppos) { |
822 | 822 | ||
823 | struct iwl_priv *priv = file->private_data; | 823 | struct il_priv *priv = file->private_data; |
824 | struct iwl_rx_queue *rxq = &priv->rxq; | 824 | struct il_rx_queue *rxq = &priv->rxq; |
825 | char buf[256]; | 825 | char buf[256]; |
826 | int pos = 0; | 826 | int pos = 0; |
827 | const size_t bufsz = sizeof(buf); | 827 | const size_t bufsz = sizeof(buf); |
@@ -842,49 +842,49 @@ static ssize_t iwl_legacy_dbgfs_rx_queue_read(struct file *file, | |||
842 | return simple_read_from_buffer(user_buf, count, ppos, buf, pos); | 842 | return simple_read_from_buffer(user_buf, count, ppos, buf, pos); |
843 | } | 843 | } |
844 | 844 | ||
845 | static ssize_t iwl_legacy_dbgfs_ucode_rx_stats_read(struct file *file, | 845 | static ssize_t il_dbgfs_ucode_rx_stats_read(struct file *file, |
846 | char __user *user_buf, | 846 | char __user *user_buf, |
847 | size_t count, loff_t *ppos) | 847 | size_t count, loff_t *ppos) |
848 | { | 848 | { |
849 | struct iwl_priv *priv = file->private_data; | 849 | struct il_priv *priv = file->private_data; |
850 | return priv->cfg->ops->lib->debugfs_ops.rx_stats_read(file, | 850 | return priv->cfg->ops->lib->debugfs_ops.rx_stats_read(file, |
851 | user_buf, count, ppos); | 851 | user_buf, count, ppos); |
852 | } | 852 | } |
853 | 853 | ||
854 | static ssize_t iwl_legacy_dbgfs_ucode_tx_stats_read(struct file *file, | 854 | static ssize_t il_dbgfs_ucode_tx_stats_read(struct file *file, |
855 | char __user *user_buf, | 855 | char __user *user_buf, |
856 | size_t count, loff_t *ppos) | 856 | size_t count, loff_t *ppos) |
857 | { | 857 | { |
858 | struct iwl_priv *priv = file->private_data; | 858 | struct il_priv *priv = file->private_data; |
859 | return priv->cfg->ops->lib->debugfs_ops.tx_stats_read(file, | 859 | return priv->cfg->ops->lib->debugfs_ops.tx_stats_read(file, |
860 | user_buf, count, ppos); | 860 | user_buf, count, ppos); |
861 | } | 861 | } |
862 | 862 | ||
863 | static ssize_t iwl_legacy_dbgfs_ucode_general_stats_read(struct file *file, | 863 | static ssize_t il_dbgfs_ucode_general_stats_read(struct file *file, |
864 | char __user *user_buf, | 864 | char __user *user_buf, |
865 | size_t count, loff_t *ppos) | 865 | size_t count, loff_t *ppos) |
866 | { | 866 | { |
867 | struct iwl_priv *priv = file->private_data; | 867 | struct il_priv *priv = file->private_data; |
868 | return priv->cfg->ops->lib->debugfs_ops.general_stats_read(file, | 868 | return priv->cfg->ops->lib->debugfs_ops.general_stats_read(file, |
869 | user_buf, count, ppos); | 869 | user_buf, count, ppos); |
870 | } | 870 | } |
871 | 871 | ||
872 | static ssize_t iwl_legacy_dbgfs_sensitivity_read(struct file *file, | 872 | static ssize_t il_dbgfs_sensitivity_read(struct file *file, |
873 | char __user *user_buf, | 873 | char __user *user_buf, |
874 | size_t count, loff_t *ppos) { | 874 | size_t count, loff_t *ppos) { |
875 | 875 | ||
876 | struct iwl_priv *priv = file->private_data; | 876 | struct il_priv *priv = file->private_data; |
877 | int pos = 0; | 877 | int pos = 0; |
878 | int cnt = 0; | 878 | int cnt = 0; |
879 | char *buf; | 879 | char *buf; |
880 | int bufsz = sizeof(struct iwl_sensitivity_data) * 4 + 100; | 880 | int bufsz = sizeof(struct il_sensitivity_data) * 4 + 100; |
881 | ssize_t ret; | 881 | ssize_t ret; |
882 | struct iwl_sensitivity_data *data; | 882 | struct il_sensitivity_data *data; |
883 | 883 | ||
884 | data = &priv->sensitivity_data; | 884 | data = &priv->sensitivity_data; |
885 | buf = kzalloc(bufsz, GFP_KERNEL); | 885 | buf = kzalloc(bufsz, GFP_KERNEL); |
886 | if (!buf) { | 886 | if (!buf) { |
887 | IWL_ERR(priv, "Can not allocate Buffer\n"); | 887 | IL_ERR(priv, "Can not allocate Buffer\n"); |
888 | return -ENOMEM; | 888 | return -ENOMEM; |
889 | } | 889 | } |
890 | 890 | ||
@@ -950,22 +950,22 @@ static ssize_t iwl_legacy_dbgfs_sensitivity_read(struct file *file, | |||
950 | } | 950 | } |
951 | 951 | ||
952 | 952 | ||
953 | static ssize_t iwl_legacy_dbgfs_chain_noise_read(struct file *file, | 953 | static ssize_t il_dbgfs_chain_noise_read(struct file *file, |
954 | char __user *user_buf, | 954 | char __user *user_buf, |
955 | size_t count, loff_t *ppos) { | 955 | size_t count, loff_t *ppos) { |
956 | 956 | ||
957 | struct iwl_priv *priv = file->private_data; | 957 | struct il_priv *priv = file->private_data; |
958 | int pos = 0; | 958 | int pos = 0; |
959 | int cnt = 0; | 959 | int cnt = 0; |
960 | char *buf; | 960 | char *buf; |
961 | int bufsz = sizeof(struct iwl_chain_noise_data) * 4 + 100; | 961 | int bufsz = sizeof(struct il_chain_noise_data) * 4 + 100; |
962 | ssize_t ret; | 962 | ssize_t ret; |
963 | struct iwl_chain_noise_data *data; | 963 | struct il_chain_noise_data *data; |
964 | 964 | ||
965 | data = &priv->chain_noise_data; | 965 | data = &priv->chain_noise_data; |
966 | buf = kzalloc(bufsz, GFP_KERNEL); | 966 | buf = kzalloc(bufsz, GFP_KERNEL); |
967 | if (!buf) { | 967 | if (!buf) { |
968 | IWL_ERR(priv, "Can not allocate Buffer\n"); | 968 | IL_ERR(priv, "Can not allocate Buffer\n"); |
969 | return -ENOMEM; | 969 | return -ENOMEM; |
970 | } | 970 | } |
971 | 971 | ||
@@ -1008,17 +1008,17 @@ static ssize_t iwl_legacy_dbgfs_chain_noise_read(struct file *file, | |||
1008 | return ret; | 1008 | return ret; |
1009 | } | 1009 | } |
1010 | 1010 | ||
1011 | static ssize_t iwl_legacy_dbgfs_power_save_status_read(struct file *file, | 1011 | static ssize_t il_dbgfs_power_save_status_read(struct file *file, |
1012 | char __user *user_buf, | 1012 | char __user *user_buf, |
1013 | size_t count, loff_t *ppos) | 1013 | size_t count, loff_t *ppos) |
1014 | { | 1014 | { |
1015 | struct iwl_priv *priv = file->private_data; | 1015 | struct il_priv *priv = file->private_data; |
1016 | char buf[60]; | 1016 | char buf[60]; |
1017 | int pos = 0; | 1017 | int pos = 0; |
1018 | const size_t bufsz = sizeof(buf); | 1018 | const size_t bufsz = sizeof(buf); |
1019 | u32 pwrsave_status; | 1019 | u32 pwrsave_status; |
1020 | 1020 | ||
1021 | pwrsave_status = iwl_read32(priv, CSR_GP_CNTRL) & | 1021 | pwrsave_status = il_read32(priv, CSR_GP_CNTRL) & |
1022 | CSR_GP_REG_POWER_SAVE_STATUS_MSK; | 1022 | CSR_GP_REG_POWER_SAVE_STATUS_MSK; |
1023 | 1023 | ||
1024 | pos += scnprintf(buf + pos, bufsz - pos, "Power Save Status: "); | 1024 | pos += scnprintf(buf + pos, bufsz - pos, "Power Save Status: "); |
@@ -1031,11 +1031,11 @@ static ssize_t iwl_legacy_dbgfs_power_save_status_read(struct file *file, | |||
1031 | return simple_read_from_buffer(user_buf, count, ppos, buf, pos); | 1031 | return simple_read_from_buffer(user_buf, count, ppos, buf, pos); |
1032 | } | 1032 | } |
1033 | 1033 | ||
1034 | static ssize_t iwl_legacy_dbgfs_clear_ucode_statistics_write(struct file *file, | 1034 | static ssize_t il_dbgfs_clear_ucode_statistics_write(struct file *file, |
1035 | const char __user *user_buf, | 1035 | const char __user *user_buf, |
1036 | size_t count, loff_t *ppos) | 1036 | size_t count, loff_t *ppos) |
1037 | { | 1037 | { |
1038 | struct iwl_priv *priv = file->private_data; | 1038 | struct il_priv *priv = file->private_data; |
1039 | char buf[8]; | 1039 | char buf[8]; |
1040 | int buf_size; | 1040 | int buf_size; |
1041 | int clear; | 1041 | int clear; |
@@ -1049,43 +1049,43 @@ static ssize_t iwl_legacy_dbgfs_clear_ucode_statistics_write(struct file *file, | |||
1049 | 1049 | ||
1050 | /* make request to uCode to retrieve statistics information */ | 1050 | /* make request to uCode to retrieve statistics information */ |
1051 | mutex_lock(&priv->mutex); | 1051 | mutex_lock(&priv->mutex); |
1052 | iwl_legacy_send_statistics_request(priv, CMD_SYNC, true); | 1052 | il_send_statistics_request(priv, CMD_SYNC, true); |
1053 | mutex_unlock(&priv->mutex); | 1053 | mutex_unlock(&priv->mutex); |
1054 | 1054 | ||
1055 | return count; | 1055 | return count; |
1056 | } | 1056 | } |
1057 | 1057 | ||
1058 | static ssize_t iwl_legacy_dbgfs_rxon_flags_read(struct file *file, | 1058 | static ssize_t il_dbgfs_rxon_flags_read(struct file *file, |
1059 | char __user *user_buf, | 1059 | char __user *user_buf, |
1060 | size_t count, loff_t *ppos) { | 1060 | size_t count, loff_t *ppos) { |
1061 | 1061 | ||
1062 | struct iwl_priv *priv = file->private_data; | 1062 | struct il_priv *priv = file->private_data; |
1063 | int len = 0; | 1063 | int len = 0; |
1064 | char buf[20]; | 1064 | char buf[20]; |
1065 | 1065 | ||
1066 | len = sprintf(buf, "0x%04X\n", | 1066 | len = sprintf(buf, "0x%04X\n", |
1067 | le32_to_cpu(priv->contexts[IWL_RXON_CTX_BSS].active.flags)); | 1067 | le32_to_cpu(priv->contexts[IL_RXON_CTX_BSS].active.flags)); |
1068 | return simple_read_from_buffer(user_buf, count, ppos, buf, len); | 1068 | return simple_read_from_buffer(user_buf, count, ppos, buf, len); |
1069 | } | 1069 | } |
1070 | 1070 | ||
1071 | static ssize_t iwl_legacy_dbgfs_rxon_filter_flags_read(struct file *file, | 1071 | static ssize_t il_dbgfs_rxon_filter_flags_read(struct file *file, |
1072 | char __user *user_buf, | 1072 | char __user *user_buf, |
1073 | size_t count, loff_t *ppos) { | 1073 | size_t count, loff_t *ppos) { |
1074 | 1074 | ||
1075 | struct iwl_priv *priv = file->private_data; | 1075 | struct il_priv *priv = file->private_data; |
1076 | int len = 0; | 1076 | int len = 0; |
1077 | char buf[20]; | 1077 | char buf[20]; |
1078 | 1078 | ||
1079 | len = sprintf(buf, "0x%04X\n", | 1079 | len = sprintf(buf, "0x%04X\n", |
1080 | le32_to_cpu(priv->contexts[IWL_RXON_CTX_BSS].active.filter_flags)); | 1080 | le32_to_cpu(priv->contexts[IL_RXON_CTX_BSS].active.filter_flags)); |
1081 | return simple_read_from_buffer(user_buf, count, ppos, buf, len); | 1081 | return simple_read_from_buffer(user_buf, count, ppos, buf, len); |
1082 | } | 1082 | } |
1083 | 1083 | ||
1084 | static ssize_t iwl_legacy_dbgfs_fh_reg_read(struct file *file, | 1084 | static ssize_t il_dbgfs_fh_reg_read(struct file *file, |
1085 | char __user *user_buf, | 1085 | char __user *user_buf, |
1086 | size_t count, loff_t *ppos) | 1086 | size_t count, loff_t *ppos) |
1087 | { | 1087 | { |
1088 | struct iwl_priv *priv = file->private_data; | 1088 | struct il_priv *priv = file->private_data; |
1089 | char *buf; | 1089 | char *buf; |
1090 | int pos = 0; | 1090 | int pos = 0; |
1091 | ssize_t ret = -EFAULT; | 1091 | ssize_t ret = -EFAULT; |
@@ -1102,11 +1102,11 @@ static ssize_t iwl_legacy_dbgfs_fh_reg_read(struct file *file, | |||
1102 | return ret; | 1102 | return ret; |
1103 | } | 1103 | } |
1104 | 1104 | ||
1105 | static ssize_t iwl_legacy_dbgfs_missed_beacon_read(struct file *file, | 1105 | static ssize_t il_dbgfs_missed_beacon_read(struct file *file, |
1106 | char __user *user_buf, | 1106 | char __user *user_buf, |
1107 | size_t count, loff_t *ppos) { | 1107 | size_t count, loff_t *ppos) { |
1108 | 1108 | ||
1109 | struct iwl_priv *priv = file->private_data; | 1109 | struct il_priv *priv = file->private_data; |
1110 | int pos = 0; | 1110 | int pos = 0; |
1111 | char buf[12]; | 1111 | char buf[12]; |
1112 | const size_t bufsz = sizeof(buf); | 1112 | const size_t bufsz = sizeof(buf); |
@@ -1117,11 +1117,11 @@ static ssize_t iwl_legacy_dbgfs_missed_beacon_read(struct file *file, | |||
1117 | return simple_read_from_buffer(user_buf, count, ppos, buf, pos); | 1117 | return simple_read_from_buffer(user_buf, count, ppos, buf, pos); |
1118 | } | 1118 | } |
1119 | 1119 | ||
1120 | static ssize_t iwl_legacy_dbgfs_missed_beacon_write(struct file *file, | 1120 | static ssize_t il_dbgfs_missed_beacon_write(struct file *file, |
1121 | const char __user *user_buf, | 1121 | const char __user *user_buf, |
1122 | size_t count, loff_t *ppos) | 1122 | size_t count, loff_t *ppos) |
1123 | { | 1123 | { |
1124 | struct iwl_priv *priv = file->private_data; | 1124 | struct il_priv *priv = file->private_data; |
1125 | char buf[8]; | 1125 | char buf[8]; |
1126 | int buf_size; | 1126 | int buf_size; |
1127 | int missed; | 1127 | int missed; |
@@ -1133,25 +1133,25 @@ static ssize_t iwl_legacy_dbgfs_missed_beacon_write(struct file *file, | |||
1133 | if (sscanf(buf, "%d", &missed) != 1) | 1133 | if (sscanf(buf, "%d", &missed) != 1) |
1134 | return -EINVAL; | 1134 | return -EINVAL; |
1135 | 1135 | ||
1136 | if (missed < IWL_MISSED_BEACON_THRESHOLD_MIN || | 1136 | if (missed < IL_MISSED_BEACON_THRESHOLD_MIN || |
1137 | missed > IWL_MISSED_BEACON_THRESHOLD_MAX) | 1137 | missed > IL_MISSED_BEACON_THRESHOLD_MAX) |
1138 | priv->missed_beacon_threshold = | 1138 | priv->missed_beacon_threshold = |
1139 | IWL_MISSED_BEACON_THRESHOLD_DEF; | 1139 | IL_MISSED_BEACON_THRESHOLD_DEF; |
1140 | else | 1140 | else |
1141 | priv->missed_beacon_threshold = missed; | 1141 | priv->missed_beacon_threshold = missed; |
1142 | 1142 | ||
1143 | return count; | 1143 | return count; |
1144 | } | 1144 | } |
1145 | 1145 | ||
1146 | static ssize_t iwl_legacy_dbgfs_force_reset_read(struct file *file, | 1146 | static ssize_t il_dbgfs_force_reset_read(struct file *file, |
1147 | char __user *user_buf, | 1147 | char __user *user_buf, |
1148 | size_t count, loff_t *ppos) { | 1148 | size_t count, loff_t *ppos) { |
1149 | 1149 | ||
1150 | struct iwl_priv *priv = file->private_data; | 1150 | struct il_priv *priv = file->private_data; |
1151 | int pos = 0; | 1151 | int pos = 0; |
1152 | char buf[300]; | 1152 | char buf[300]; |
1153 | const size_t bufsz = sizeof(buf); | 1153 | const size_t bufsz = sizeof(buf); |
1154 | struct iwl_force_reset *force_reset; | 1154 | struct il_force_reset *force_reset; |
1155 | 1155 | ||
1156 | force_reset = &priv->force_reset; | 1156 | force_reset = &priv->force_reset; |
1157 | 1157 | ||
@@ -1171,23 +1171,23 @@ static ssize_t iwl_legacy_dbgfs_force_reset_read(struct file *file, | |||
1171 | return simple_read_from_buffer(user_buf, count, ppos, buf, pos); | 1171 | return simple_read_from_buffer(user_buf, count, ppos, buf, pos); |
1172 | } | 1172 | } |
1173 | 1173 | ||
1174 | static ssize_t iwl_legacy_dbgfs_force_reset_write(struct file *file, | 1174 | static ssize_t il_dbgfs_force_reset_write(struct file *file, |
1175 | const char __user *user_buf, | 1175 | const char __user *user_buf, |
1176 | size_t count, loff_t *ppos) { | 1176 | size_t count, loff_t *ppos) { |
1177 | 1177 | ||
1178 | int ret; | 1178 | int ret; |
1179 | struct iwl_priv *priv = file->private_data; | 1179 | struct il_priv *priv = file->private_data; |
1180 | 1180 | ||
1181 | ret = iwl_legacy_force_reset(priv, true); | 1181 | ret = il_force_reset(priv, true); |
1182 | 1182 | ||
1183 | return ret ? ret : count; | 1183 | return ret ? ret : count; |
1184 | } | 1184 | } |
1185 | 1185 | ||
1186 | static ssize_t iwl_legacy_dbgfs_wd_timeout_write(struct file *file, | 1186 | static ssize_t il_dbgfs_wd_timeout_write(struct file *file, |
1187 | const char __user *user_buf, | 1187 | const char __user *user_buf, |
1188 | size_t count, loff_t *ppos) { | 1188 | size_t count, loff_t *ppos) { |
1189 | 1189 | ||
1190 | struct iwl_priv *priv = file->private_data; | 1190 | struct il_priv *priv = file->private_data; |
1191 | char buf[8]; | 1191 | char buf[8]; |
1192 | int buf_size; | 1192 | int buf_size; |
1193 | int timeout; | 1193 | int timeout; |
@@ -1198,11 +1198,11 @@ static ssize_t iwl_legacy_dbgfs_wd_timeout_write(struct file *file, | |||
1198 | return -EFAULT; | 1198 | return -EFAULT; |
1199 | if (sscanf(buf, "%d", &timeout) != 1) | 1199 | if (sscanf(buf, "%d", &timeout) != 1) |
1200 | return -EINVAL; | 1200 | return -EINVAL; |
1201 | if (timeout < 0 || timeout > IWL_MAX_WD_TIMEOUT) | 1201 | if (timeout < 0 || timeout > IL_MAX_WD_TIMEOUT) |
1202 | timeout = IWL_DEF_WD_TIMEOUT; | 1202 | timeout = IL_DEF_WD_TIMEOUT; |
1203 | 1203 | ||
1204 | priv->cfg->base_params->wd_timeout = timeout; | 1204 | priv->cfg->base_params->wd_timeout = timeout; |
1205 | iwl_legacy_setup_watchdog(priv); | 1205 | il_setup_watchdog(priv); |
1206 | return count; | 1206 | return count; |
1207 | } | 1207 | } |
1208 | 1208 | ||
@@ -1230,7 +1230,7 @@ DEBUGFS_WRITE_FILE_OPS(wd_timeout); | |||
1230 | * Create the debugfs files and directories | 1230 | * Create the debugfs files and directories |
1231 | * | 1231 | * |
1232 | */ | 1232 | */ |
1233 | int iwl_legacy_dbgfs_register(struct iwl_priv *priv, const char *name) | 1233 | int il_dbgfs_register(struct il_priv *priv, const char *name) |
1234 | { | 1234 | { |
1235 | struct dentry *phyd = priv->hw->wiphy->debugfsdir; | 1235 | struct dentry *phyd = priv->hw->wiphy->debugfsdir; |
1236 | struct dentry *dir_drv, *dir_data, *dir_rf, *dir_debug; | 1236 | struct dentry *dir_drv, *dir_data, *dir_rf, *dir_debug; |
@@ -1292,17 +1292,17 @@ int iwl_legacy_dbgfs_register(struct iwl_priv *priv, const char *name) | |||
1292 | return 0; | 1292 | return 0; |
1293 | 1293 | ||
1294 | err: | 1294 | err: |
1295 | IWL_ERR(priv, "Can't create the debugfs directory\n"); | 1295 | IL_ERR(priv, "Can't create the debugfs directory\n"); |
1296 | iwl_legacy_dbgfs_unregister(priv); | 1296 | il_dbgfs_unregister(priv); |
1297 | return -ENOMEM; | 1297 | return -ENOMEM; |
1298 | } | 1298 | } |
1299 | EXPORT_SYMBOL(iwl_legacy_dbgfs_register); | 1299 | EXPORT_SYMBOL(il_dbgfs_register); |
1300 | 1300 | ||
1301 | /** | 1301 | /** |
1302 | * Remove the debugfs files and directories | 1302 | * Remove the debugfs files and directories |
1303 | * | 1303 | * |
1304 | */ | 1304 | */ |
1305 | void iwl_legacy_dbgfs_unregister(struct iwl_priv *priv) | 1305 | void il_dbgfs_unregister(struct il_priv *priv) |
1306 | { | 1306 | { |
1307 | if (!priv->debugfs_dir) | 1307 | if (!priv->debugfs_dir) |
1308 | return; | 1308 | return; |
@@ -1310,4 +1310,4 @@ void iwl_legacy_dbgfs_unregister(struct iwl_priv *priv) | |||
1310 | debugfs_remove_recursive(priv->debugfs_dir); | 1310 | debugfs_remove_recursive(priv->debugfs_dir); |
1311 | priv->debugfs_dir = NULL; | 1311 | priv->debugfs_dir = NULL; |
1312 | } | 1312 | } |
1313 | EXPORT_SYMBOL(iwl_legacy_dbgfs_unregister); | 1313 | EXPORT_SYMBOL(il_dbgfs_unregister); |