usb: dwc3: keystone: drop dma_mask configuration
[linux/fpc-iii.git] / drivers / staging / rtl8192ee / debug.c
blobfeec3948585d93268c96b60c6ca742d8781c5170
1 /******************************************************************************
3 * Copyright(c) 2009-2010 Realtek Corporation.
5 * This program is free software; you can redistribute it and/or modify it
6 * under the terms of version 2 of the GNU General Public License as
7 * published by the Free Software Foundation.
9 * Tmis program is distributed in the hope that it will be useful, but WITHOUT
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
12 * more details.
14 * The full GNU General Public License is included in this distribution in the
15 * file called LICENSE.
17 * Contact Information:
18 * wlanfae <wlanfae@realtek.com>
19 * Realtek Corporation, No. 2, Innovation Road II, Hsinchu Science Park,
20 * Hsinchu 300, Taiwan.
22 * Larry Finger <Larry.Finger@lwfinger.net>
24 *****************************************************************************/
26 #include "wifi.h"
27 #include "cam.h"
29 #define GET_INODE_DATA(__node) PDE_DATA(__node)
32 void rtl92e_dbgp_flag_init(struct ieee80211_hw *hw)
34 struct rtl_priv *rtlpriv = rtl_priv(hw);
35 u8 i;
37 rtlpriv->dbg.global_debuglevel = DBG_DMESG;
39 rtlpriv->dbg.global_debugcomponents =
40 COMP_ERR |
41 COMP_FW |
42 COMP_INIT |
43 COMP_RECV |
44 COMP_SEND |
45 COMP_MLME |
46 COMP_SCAN |
47 COMP_INTR |
48 COMP_LED |
49 COMP_SEC |
50 COMP_BEACON |
51 COMP_RATE |
52 COMP_RXDESC |
53 COMP_DIG |
54 COMP_TXAGC |
55 COMP_POWER |
56 COMP_POWER_TRACKING |
57 COMP_BB_POWERSAVING |
58 COMP_SWAS |
59 COMP_RF |
60 COMP_TURBO |
61 COMP_RATR |
62 COMP_CMD |
63 COMP_EASY_CONCURRENT |
64 COMP_EFUSE |
65 COMP_QOS | COMP_MAC80211 | COMP_REGD |
66 COMP_CHAN |
67 COMP_BT_COEXIST |
68 COMP_IQK |
71 for (i = 0; i < DBGP_TYPE_MAX; i++)
72 rtlpriv->dbg.dbgp_type[i] = 0;
74 /*Init Debug flag enable condition */
77 static struct proc_dir_entry *proc_topdir;
79 static int rtl_proc_get_mac_0(struct seq_file *m, void *v)
81 struct ieee80211_hw *hw = m->private;
82 struct rtl_priv *rtlpriv = rtl_priv(hw);
83 int i, n, page;
84 int max = 0xff;
85 page = 0x000;
87 for (n = 0; n <= max; ) {
88 seq_printf(m, "\n%8.8x ", n + page);
89 for (i = 0; i < 4 && n <= max; i++, n += 4)
90 seq_printf(m, "%8.8x ",
91 rtl_read_dword(rtlpriv, (page | n)));
93 seq_puts(m, "\n");
94 return 0;
97 static int dl_proc_open_mac_0(struct inode *inode, struct file *file)
99 return single_open(file, rtl_proc_get_mac_0, GET_INODE_DATA(inode));
102 static const struct file_operations file_ops_mac_0 = {
103 .open = dl_proc_open_mac_0,
104 .read = seq_read,
105 .llseek = seq_lseek,
106 .release = seq_release,
109 static int rtl_proc_get_mac_1(struct seq_file *m, void *v)
111 struct ieee80211_hw *hw = m->private;
112 struct rtl_priv *rtlpriv = rtl_priv(hw);
113 int i, n, page;
114 int max = 0xff;
115 page = 0x100;
117 for (n = 0; n <= max; ) {
118 seq_printf(m, "\n%8.8x ", n + page);
119 for (i = 0; i < 4 && n <= max; i++, n += 4)
120 seq_printf(m, "%8.8x ",
121 rtl_read_dword(rtlpriv, (page | n)));
123 seq_puts(m, "\n");
124 return 0;
127 static int dl_proc_open_mac_1(struct inode *inode, struct file *file)
129 return single_open(file, rtl_proc_get_mac_1, GET_INODE_DATA(inode));
132 static const struct file_operations file_ops_mac_1 = {
133 .open = dl_proc_open_mac_1,
134 .read = seq_read,
135 .llseek = seq_lseek,
136 .release = seq_release,
139 static int rtl_proc_get_mac_2(struct seq_file *m, void *v)
141 struct ieee80211_hw *hw = m->private;
142 struct rtl_priv *rtlpriv = rtl_priv(hw);
143 int i, n, page;
144 int max = 0xff;
145 page = 0x200;
147 for (n = 0; n <= max; ) {
148 seq_printf(m, "\n%8.8x ", n + page);
149 for (i = 0; i < 4 && n <= max; i++, n += 4)
150 seq_printf(m, "%8.8x ",
151 rtl_read_dword(rtlpriv, (page | n)));
153 seq_puts(m, "\n");
154 return 0;
157 static int dl_proc_open_mac_2(struct inode *inode, struct file *file)
159 return single_open(file, rtl_proc_get_mac_2, GET_INODE_DATA(inode));
162 static const struct file_operations file_ops_mac_2 = {
163 .open = dl_proc_open_mac_2,
164 .read = seq_read,
165 .llseek = seq_lseek,
166 .release = seq_release,
169 static int rtl_proc_get_mac_3(struct seq_file *m, void *v)
171 struct ieee80211_hw *hw = m->private;
172 struct rtl_priv *rtlpriv = rtl_priv(hw);
173 int i, n, page;
174 int max = 0xff;
175 page = 0x300;
177 for (n = 0; n <= max; ) {
178 seq_printf(m, "\n%8.8x ", n + page);
179 for (i = 0; i < 4 && n <= max; i++, n += 4)
180 seq_printf(m, "%8.8x ",
181 rtl_read_dword(rtlpriv, (page | n)));
183 seq_puts(m, "\n");
184 return 0;
187 static int dl_proc_open_mac_3(struct inode *inode, struct file *file)
189 return single_open(file, rtl_proc_get_mac_3, GET_INODE_DATA(inode));
192 static const struct file_operations file_ops_mac_3 = {
193 .open = dl_proc_open_mac_3,
194 .read = seq_read,
195 .llseek = seq_lseek,
196 .release = seq_release,
199 static int rtl_proc_get_mac_4(struct seq_file *m, void *v)
201 struct ieee80211_hw *hw = m->private;
202 struct rtl_priv *rtlpriv = rtl_priv(hw);
203 int i, n, page;
204 int max = 0xff;
205 page = 0x400;
207 for (n = 0; n <= max; ) {
208 seq_printf(m, "\n%8.8x ", n + page);
209 for (i = 0; i < 4 && n <= max; i++, n += 4)
210 seq_printf(m, "%8.8x ",
211 rtl_read_dword(rtlpriv, (page | n)));
213 seq_puts(m, "\n");
214 return 0;
217 static int dl_proc_open_mac_4(struct inode *inode, struct file *file)
219 return single_open(file, rtl_proc_get_mac_4, GET_INODE_DATA(inode));
222 static const struct file_operations file_ops_mac_4 = {
223 .open = dl_proc_open_mac_4,
224 .read = seq_read,
225 .llseek = seq_lseek,
226 .release = seq_release,
229 static int rtl_proc_get_mac_5(struct seq_file *m, void *v)
231 struct ieee80211_hw *hw = m->private;
232 struct rtl_priv *rtlpriv = rtl_priv(hw);
233 int i, n, page;
234 int max = 0xff;
235 page = 0x500;
237 for (n = 0; n <= max; ) {
238 seq_printf(m, "\n%8.8x ", n + page);
239 for (i = 0; i < 4 && n <= max; i++, n += 4)
240 seq_printf(m, "%8.8x ",
241 rtl_read_dword(rtlpriv, (page | n)));
243 seq_puts(m, "\n");
244 return 0;
247 static int dl_proc_open_mac_5(struct inode *inode, struct file *file)
249 return single_open(file, rtl_proc_get_mac_5, GET_INODE_DATA(inode));
252 static const struct file_operations file_ops_mac_5 = {
253 .open = dl_proc_open_mac_5,
254 .read = seq_read,
255 .llseek = seq_lseek,
256 .release = seq_release,
259 static int rtl_proc_get_mac_6(struct seq_file *m, void *v)
261 struct ieee80211_hw *hw = m->private;
262 struct rtl_priv *rtlpriv = rtl_priv(hw);
263 int i, n, page;
264 int max = 0xff;
265 page = 0x600;
267 for (n = 0; n <= max; ) {
268 seq_printf(m, "\n%8.8x ", n + page);
269 for (i = 0; i < 4 && n <= max; i++, n += 4)
270 seq_printf(m, "%8.8x ",
271 rtl_read_dword(rtlpriv, (page | n)));
273 seq_puts(m, "\n");
274 return 0;
277 static int dl_proc_open_mac_6(struct inode *inode, struct file *file)
279 return single_open(file, rtl_proc_get_mac_6, GET_INODE_DATA(inode));
282 static const struct file_operations file_ops_mac_6 = {
283 .open = dl_proc_open_mac_6,
284 .read = seq_read,
285 .llseek = seq_lseek,
286 .release = seq_release,
289 static int rtl_proc_get_mac_7(struct seq_file *m, void *v)
291 struct ieee80211_hw *hw = m->private;
292 struct rtl_priv *rtlpriv = rtl_priv(hw);
293 int i, n, page;
294 int max = 0xff;
295 page = 0x700;
297 for (n = 0; n <= max; ) {
298 seq_printf(m, "\n%8.8x ", n + page);
299 for (i = 0; i < 4 && n <= max; i++, n += 4)
300 seq_printf(m, "%8.8x ",
301 rtl_read_dword(rtlpriv, (page | n)));
303 seq_puts(m, "\n");
304 return 0;
307 static int dl_proc_open_mac_7(struct inode *inode, struct file *file)
309 return single_open(file, rtl_proc_get_mac_7, GET_INODE_DATA(inode));
312 static const struct file_operations file_ops_mac_7 = {
313 .open = dl_proc_open_mac_7,
314 .read = seq_read,
315 .llseek = seq_lseek,
316 .release = seq_release,
319 static int rtl_proc_get_bb_8(struct seq_file *m, void *v)
321 struct ieee80211_hw *hw = m->private;
322 int i, n, page;
323 int max = 0xff;
324 page = 0x800;
326 for (n = 0; n <= max; ) {
327 seq_printf(m, "\n%8.8x ", n + page);
328 for (i = 0; i < 4 && n <= max; i++, n += 4)
329 seq_printf(m, "%8.8x ",
330 rtl_get_bbreg(hw, (page | n), 0xffffffff));
332 seq_puts(m, "\n");
333 return 0;
336 static int dl_proc_open_bb_8(struct inode *inode, struct file *file)
338 return single_open(file, rtl_proc_get_bb_8, GET_INODE_DATA(inode));
341 static const struct file_operations file_ops_bb_8 = {
342 .open = dl_proc_open_bb_8,
343 .read = seq_read,
344 .llseek = seq_lseek,
345 .release = seq_release,
348 static int rtl_proc_get_bb_9(struct seq_file *m, void *v)
350 struct ieee80211_hw *hw = m->private;
351 int i, n, page;
352 int max = 0xff;
353 page = 0x900;
355 for (n = 0; n <= max; ) {
356 seq_printf(m, "\n%8.8x ", n + page);
357 for (i = 0; i < 4 && n <= max; i++, n += 4)
358 seq_printf(m, "%8.8x ",
359 rtl_get_bbreg(hw, (page | n), 0xffffffff));
361 seq_puts(m, "\n");
362 return 0;
365 static int dl_proc_open_bb_9(struct inode *inode, struct file *file)
367 return single_open(file, rtl_proc_get_bb_9, GET_INODE_DATA(inode));
370 static const struct file_operations file_ops_bb_9 = {
371 .open = dl_proc_open_bb_9,
372 .read = seq_read,
373 .llseek = seq_lseek,
374 .release = seq_release,
377 static int rtl_proc_get_bb_a(struct seq_file *m, void *v)
379 struct ieee80211_hw *hw = m->private;
380 int i, n, page;
381 int max = 0xff;
382 page = 0xa00;
384 for (n = 0; n <= max; ) {
385 seq_printf(m, "\n%8.8x ", n + page);
386 for (i = 0; i < 4 && n <= max; i++, n += 4)
387 seq_printf(m, "%8.8x ",
388 rtl_get_bbreg(hw, (page | n), 0xffffffff));
390 seq_puts(m, "\n");
391 return 0;
394 static int dl_proc_open_bb_a(struct inode *inode, struct file *file)
396 return single_open(file, rtl_proc_get_bb_a, GET_INODE_DATA(inode));
399 static const struct file_operations file_ops_bb_a = {
400 .open = dl_proc_open_bb_a,
401 .read = seq_read,
402 .llseek = seq_lseek,
403 .release = seq_release,
406 static int rtl_proc_get_bb_b(struct seq_file *m, void *v)
408 struct ieee80211_hw *hw = m->private;
409 int i, n, page;
410 int max = 0xff;
411 page = 0xb00;
413 for (n = 0; n <= max; ) {
414 seq_printf(m, "\n%8.8x ", n + page);
415 for (i = 0; i < 4 && n <= max; i++, n += 4)
416 seq_printf(m, "%8.8x ",
417 rtl_get_bbreg(hw, (page | n), 0xffffffff));
419 seq_puts(m, "\n");
420 return 0;
423 static int dl_proc_open_bb_b(struct inode *inode, struct file *file)
425 return single_open(file, rtl_proc_get_bb_b, GET_INODE_DATA(inode));
428 static const struct file_operations file_ops_bb_b = {
429 .open = dl_proc_open_bb_b,
430 .read = seq_read,
431 .llseek = seq_lseek,
432 .release = seq_release,
435 static int rtl_proc_get_bb_c(struct seq_file *m, void *v)
437 struct ieee80211_hw *hw = m->private;
438 int i, n, page;
439 int max = 0xff;
440 page = 0xc00;
442 for (n = 0; n <= max; ) {
443 seq_printf(m, "\n%8.8x ", n + page);
444 for (i = 0; i < 4 && n <= max; i++, n += 4)
445 seq_printf(m, "%8.8x ",
446 rtl_get_bbreg(hw, (page | n), 0xffffffff));
448 seq_puts(m, "\n");
449 return 0;
452 static int dl_proc_open_bb_c(struct inode *inode, struct file *file)
454 return single_open(file, rtl_proc_get_bb_c, GET_INODE_DATA(inode));
457 static const struct file_operations file_ops_bb_c = {
458 .open = dl_proc_open_bb_c,
459 .read = seq_read,
460 .llseek = seq_lseek,
461 .release = seq_release,
464 static int rtl_proc_get_bb_d(struct seq_file *m, void *v)
466 struct ieee80211_hw *hw = m->private;
467 int i, n, page;
468 int max = 0xff;
469 page = 0xd00;
471 for (n = 0; n <= max; ) {
472 seq_printf(m, "\n%8.8x ", n + page);
473 for (i = 0; i < 4 && n <= max; i++, n += 4)
474 seq_printf(m, "%8.8x ",
475 rtl_get_bbreg(hw, (page | n), 0xffffffff));
477 seq_puts(m, "\n");
478 return 0;
481 static int dl_proc_open_bb_d(struct inode *inode, struct file *file)
483 return single_open(file, rtl_proc_get_bb_d, GET_INODE_DATA(inode));
486 static const struct file_operations file_ops_bb_d = {
487 .open = dl_proc_open_bb_d,
488 .read = seq_read,
489 .llseek = seq_lseek,
490 .release = seq_release,
493 static int rtl_proc_get_bb_e(struct seq_file *m, void *v)
495 struct ieee80211_hw *hw = m->private;
496 int i, n, page;
497 int max = 0xff;
498 page = 0xe00;
500 for (n = 0; n <= max; ) {
501 seq_printf(m, "\n%8.8x ", n + page);
502 for (i = 0; i < 4 && n <= max; i++, n += 4)
503 seq_printf(m, "%8.8x ",
504 rtl_get_bbreg(hw, (page | n), 0xffffffff));
506 seq_puts(m, "\n");
507 return 0;
510 static int dl_proc_open_bb_e(struct inode *inode, struct file *file)
512 return single_open(file, rtl_proc_get_bb_e, GET_INODE_DATA(inode));
515 static const struct file_operations file_ops_bb_e = {
516 .open = dl_proc_open_bb_e,
517 .read = seq_read,
518 .llseek = seq_lseek,
519 .release = seq_release,
522 static int rtl_proc_get_bb_f(struct seq_file *m, void *v)
524 struct ieee80211_hw *hw = m->private;
525 int i, n, page;
526 int max = 0xff;
527 page = 0xf00;
529 for (n = 0; n <= max; ) {
530 seq_printf(m, "\n%8.8x ", n + page);
531 for (i = 0; i < 4 && n <= max; i++, n += 4)
532 seq_printf(m, "%8.8x ",
533 rtl_get_bbreg(hw, (page | n), 0xffffffff));
535 seq_puts(m, "\n");
536 return 0;
539 static int dl_proc_open_bb_f(struct inode *inode, struct file *file)
541 return single_open(file, rtl_proc_get_bb_f, GET_INODE_DATA(inode));
544 static const struct file_operations file_ops_bb_f = {
545 .open = dl_proc_open_bb_f,
546 .read = seq_read,
547 .llseek = seq_lseek,
548 .release = seq_release,
551 static int rtl_proc_get_reg_rf_a(struct seq_file *m, void *v)
553 struct ieee80211_hw *hw = m->private;
554 int i, n;
555 int max = 0x40;
557 for (n = 0; n <= max; ) {
558 seq_printf(m, "\n%8.8x ", n);
559 for (i = 0; i < 4 && n <= max; n += 1, i++)
560 seq_printf(m, "%8.8x ",
561 rtl_get_rfreg(hw, RF90_PATH_A, n, 0xffffffff));
563 seq_puts(m, "\n");
564 return 0;
567 static int dl_proc_open_rf_a(struct inode *inode, struct file *file)
569 return single_open(file, rtl_proc_get_reg_rf_a, GET_INODE_DATA(inode));
572 static const struct file_operations file_ops_rf_a = {
573 .open = dl_proc_open_rf_a,
574 .read = seq_read,
575 .llseek = seq_lseek,
576 .release = seq_release,
579 static int rtl_proc_get_reg_rf_b(struct seq_file *m, void *v)
581 struct ieee80211_hw *hw = m->private;
582 int i, n;
583 int max = 0x40;
585 for (n = 0; n <= max; ) {
586 seq_printf(m, "\n%8.8x ", n);
587 for (i = 0; i < 4 && n <= max; n += 1, i++)
588 seq_printf(m, "%8.8x ",
589 rtl_get_rfreg(hw, RF90_PATH_B, n,
590 0xffffffff));
592 seq_puts(m, "\n");
593 return 0;
596 static int dl_proc_open_rf_b(struct inode *inode, struct file *file)
598 return single_open(file, rtl_proc_get_reg_rf_b, GET_INODE_DATA(inode));
601 static const struct file_operations file_ops_rf_b = {
602 .open = dl_proc_open_rf_b,
603 .read = seq_read,
604 .llseek = seq_lseek,
605 .release = seq_release,
608 static int rtl_proc_get_cam_register_1(struct seq_file *m, void *v)
610 struct ieee80211_hw *hw = m->private;
611 struct rtl_priv *rtlpriv = rtl_priv(hw);
612 u32 target_cmd = 0;
613 u32 target_val = 0;
614 u8 entry_i = 0;
615 u32 ulstatus;
616 int i = 100, j = 0;
618 /* This dump the current register page */
619 seq_puts(m,
620 "\n#################### SECURITY CAM (0-10) ##################\n ");
622 for (j = 0; j < 11; j++) {
623 seq_printf(m, "\nD: %2x > ", j);
624 for (entry_i = 0; entry_i < CAM_CONTENT_COUNT; entry_i++) {
625 /* polling bit, and No Write enable, and address */
626 target_cmd = entry_i + CAM_CONTENT_COUNT * j;
627 target_cmd = target_cmd | BIT(31);
629 /* Check polling bit is clear */
630 while ((i--) >= 0) {
631 ulstatus = rtl_read_dword(rtlpriv,
632 rtlpriv->cfg->maps[RWCAM]);
633 if (ulstatus & BIT(31))
634 continue;
635 else
636 break;
639 rtl_write_dword(rtlpriv, rtlpriv->cfg->maps[RWCAM],
640 target_cmd);
641 target_val = rtl_read_dword(rtlpriv,
642 rtlpriv->cfg->maps[RCAMO]);
643 seq_printf(m, "%8.8x ", target_val);
646 seq_puts(m, "\n");
647 return 0;
650 static int dl_proc_open_cam_1(struct inode *inode, struct file *file)
652 return single_open(file, rtl_proc_get_cam_register_1,
653 GET_INODE_DATA(inode));
656 static const struct file_operations file_ops_cam_1 = {
657 .open = dl_proc_open_cam_1,
658 .read = seq_read,
659 .llseek = seq_lseek,
660 .release = seq_release,
663 static int rtl_proc_get_cam_register_2(struct seq_file *m, void *v)
665 struct ieee80211_hw *hw = m->private;
666 struct rtl_priv *rtlpriv = rtl_priv(hw);
667 u32 target_cmd = 0;
668 u32 target_val = 0;
669 u8 entry_i = 0;
670 u32 ulstatus;
671 int i = 100, j = 0;
673 /* This dump the current register page */
674 seq_puts(m,
675 "\n################### SECURITY CAM (11-21) ##################\n ");
677 for (j = 11; j < 22; j++) {
678 seq_printf(m, "\nD: %2x > ", j);
679 for (entry_i = 0; entry_i < CAM_CONTENT_COUNT; entry_i++) {
680 target_cmd = entry_i + CAM_CONTENT_COUNT * j;
681 target_cmd = target_cmd | BIT(31);
683 while ((i--) >= 0) {
684 ulstatus = rtl_read_dword(rtlpriv,
685 rtlpriv->cfg->maps[RWCAM]);
686 if (ulstatus & BIT(31))
687 continue;
688 else
689 break;
692 rtl_write_dword(rtlpriv, rtlpriv->cfg->maps[RWCAM],
693 target_cmd);
694 target_val = rtl_read_dword(rtlpriv,
695 rtlpriv->cfg->maps[RCAMO]);
696 seq_printf(m, "%8.8x ", target_val);
699 seq_puts(m, "\n");
700 return 0;
703 static int dl_proc_open_cam_2(struct inode *inode, struct file *file)
705 return single_open(file, rtl_proc_get_cam_register_2,
706 GET_INODE_DATA(inode));
709 static const struct file_operations file_ops_cam_2 = {
710 .open = dl_proc_open_cam_2,
711 .read = seq_read,
712 .llseek = seq_lseek,
713 .release = seq_release,
716 static int rtl_proc_get_cam_register_3(struct seq_file *m, void *v)
718 struct ieee80211_hw *hw = m->private;
719 struct rtl_priv *rtlpriv = rtl_priv(hw);
720 u32 target_cmd = 0;
721 u32 target_val = 0;
722 u8 entry_i = 0;
723 u32 ulstatus;
724 int i = 100, j = 0;
726 /* This dump the current register page */
727 seq_puts(m,
728 "\n################### SECURITY CAM (22-31) ##################\n ");
730 for (j = 22; j < TOTAL_CAM_ENTRY; j++) {
731 seq_printf(m, "\nD: %2x > ", j);
732 for (entry_i = 0; entry_i < CAM_CONTENT_COUNT; entry_i++) {
733 target_cmd = entry_i+CAM_CONTENT_COUNT*j;
734 target_cmd = target_cmd | BIT(31);
736 while ((i--) >= 0) {
737 ulstatus = rtl_read_dword(rtlpriv, rtlpriv->cfg->maps[RWCAM]);
738 if (ulstatus & BIT(31))
739 continue;
740 else
741 break;
744 rtl_write_dword(rtlpriv, rtlpriv->cfg->maps[RWCAM],
745 target_cmd);
746 target_val = rtl_read_dword(rtlpriv,
747 rtlpriv->cfg->maps[RCAMO]);
748 seq_printf(m, "%8.8x ", target_val);
751 seq_puts(m, "\n");
752 return 0;
755 static int dl_proc_open_cam_3(struct inode *inode, struct file *file)
757 return single_open(file, rtl_proc_get_cam_register_3,
758 GET_INODE_DATA(inode));
761 static const struct file_operations file_ops_cam_3 = {
762 .open = dl_proc_open_cam_3,
763 .read = seq_read,
764 .llseek = seq_lseek,
765 .release = seq_release,
768 void rtl_proc_add_one(struct ieee80211_hw *hw)
770 struct rtl_priv *rtlpriv = rtl_priv(hw);
771 struct rtl_efuse *rtlefuse = rtl_efuse(rtl_priv(hw));
772 struct proc_dir_entry *entry;
774 snprintf(rtlpriv->dbg.proc_name, 18, "%x-%x-%x-%x-%x-%x",
775 rtlefuse->dev_addr[0], rtlefuse->dev_addr[1],
776 rtlefuse->dev_addr[2], rtlefuse->dev_addr[3],
777 rtlefuse->dev_addr[4], rtlefuse->dev_addr[5]);
779 rtlpriv->dbg.proc_dir = proc_mkdir(rtlpriv->dbg.proc_name, proc_topdir);
780 if (!rtlpriv->dbg.proc_dir) {
781 RT_TRACE(COMP_INIT, DBG_EMERG,
782 ("Unable to init /proc/net/%s/%s\n",
783 rtlpriv->cfg->name,
784 rtlpriv->dbg.proc_name));
785 return;
788 entry = proc_create_data("mac-0", S_IFREG | S_IRUGO,
789 rtlpriv->dbg.proc_dir, &file_ops_mac_0, hw);
790 if (!entry)
791 RT_TRACE(COMP_INIT, DBG_EMERG,
792 ("Unable to initialize /proc/net/%s/%s/mac-0\n",
793 rtlpriv->cfg->name, rtlpriv->dbg.proc_name));
795 entry = proc_create_data("mac-1", S_IFREG | S_IRUGO,
796 rtlpriv->dbg.proc_dir, &file_ops_mac_1, hw);
797 if (!entry)
798 RT_TRACE(COMP_INIT, COMP_ERR,
799 ("Unable to initialize /proc/net/%s/%s/mac-1\n",
800 rtlpriv->cfg->name, rtlpriv->dbg.proc_name));
802 entry = proc_create_data("mac-2", S_IFREG | S_IRUGO,
803 rtlpriv->dbg.proc_dir, &file_ops_mac_2, hw);
804 if (!entry)
805 RT_TRACE(COMP_INIT, COMP_ERR,
806 ("Unable to initialize /proc/net/%s/%s/mac-2\n",
807 rtlpriv->cfg->name, rtlpriv->dbg.proc_name));
809 entry = proc_create_data("mac-3", S_IFREG | S_IRUGO,
810 rtlpriv->dbg.proc_dir, &file_ops_mac_3, hw);
811 if (!entry)
812 RT_TRACE(COMP_INIT, COMP_ERR,
813 ("Unable to initialize /proc/net/%s/%s/mac-3\n",
814 rtlpriv->cfg->name, rtlpriv->dbg.proc_name));
816 entry = proc_create_data("mac-4", S_IFREG | S_IRUGO,
817 rtlpriv->dbg.proc_dir, &file_ops_mac_4, hw);
818 if (!entry)
819 RT_TRACE(COMP_INIT, COMP_ERR,
820 ("Unable to initialize /proc/net/%s/%s/mac-4\n",
821 rtlpriv->cfg->name, rtlpriv->dbg.proc_name));
823 entry = proc_create_data("mac-5", S_IFREG | S_IRUGO,
824 rtlpriv->dbg.proc_dir, &file_ops_mac_5, hw);
825 if (!entry)
826 RT_TRACE(COMP_INIT, COMP_ERR,
827 ("Unable to initialize /proc/net/%s/%s/mac-5\n",
828 rtlpriv->cfg->name, rtlpriv->dbg.proc_name));
830 entry = proc_create_data("mac-6", S_IFREG | S_IRUGO,
831 rtlpriv->dbg.proc_dir, &file_ops_mac_6, hw);
832 if (!entry)
833 RT_TRACE(COMP_INIT, COMP_ERR,
834 ("Unable to initialize /proc/net/%s/%s/mac-6\n",
835 rtlpriv->cfg->name, rtlpriv->dbg.proc_name));
837 entry = proc_create_data("mac-7", S_IFREG | S_IRUGO,
838 rtlpriv->dbg.proc_dir, &file_ops_mac_7, hw);
839 if (!entry)
840 RT_TRACE(COMP_INIT, COMP_ERR,
841 ("Unable to initialize /proc/net/%s/%s/mac-7\n",
842 rtlpriv->cfg->name, rtlpriv->dbg.proc_name));
844 entry = proc_create_data("bb-8", S_IFREG | S_IRUGO,
845 rtlpriv->dbg.proc_dir, &file_ops_bb_8, hw);
846 if (!entry)
847 RT_TRACE(COMP_INIT, COMP_ERR,
848 ("Unable to initialize /proc/net/%s/%s/bb-8\n",
849 rtlpriv->cfg->name, rtlpriv->dbg.proc_name));
851 entry = proc_create_data("bb-9", S_IFREG | S_IRUGO,
852 rtlpriv->dbg.proc_dir, &file_ops_bb_9, hw);
853 if (!entry)
854 RT_TRACE(COMP_INIT, COMP_ERR,
855 ("Unable to initialize /proc/net/%s/%s/bb-9\n",
856 rtlpriv->cfg->name, rtlpriv->dbg.proc_name));
858 entry = proc_create_data("bb-a", S_IFREG | S_IRUGO,
859 rtlpriv->dbg.proc_dir, &file_ops_bb_a, hw);
860 if (!entry)
861 RT_TRACE(COMP_INIT, COMP_ERR,
862 ("Unable to initialize /proc/net/%s/%s/bb-a\n",
863 rtlpriv->cfg->name, rtlpriv->dbg.proc_name));
865 entry = proc_create_data("bb-b", S_IFREG | S_IRUGO,
866 rtlpriv->dbg.proc_dir, &file_ops_bb_b, hw);
867 if (!entry)
868 RT_TRACE(COMP_INIT, COMP_ERR,
869 ("Unable to initialize /proc/net/%s/%s/bb-b\n",
870 rtlpriv->cfg->name, rtlpriv->dbg.proc_name));
872 entry = proc_create_data("bb-c", S_IFREG | S_IRUGO,
873 rtlpriv->dbg.proc_dir, &file_ops_bb_c, hw);
874 if (!entry)
875 RT_TRACE(COMP_INIT, COMP_ERR,
876 ("Unable to initialize /proc/net/%s/%s/bb-c\n",
877 rtlpriv->cfg->name, rtlpriv->dbg.proc_name));
879 entry = proc_create_data("bb-d", S_IFREG | S_IRUGO,
880 rtlpriv->dbg.proc_dir, &file_ops_bb_d, hw);
881 if (!entry)
882 RT_TRACE(COMP_INIT, COMP_ERR,
883 ("Unable to initialize /proc/net/%s/%s/bb-d\n",
884 rtlpriv->cfg->name, rtlpriv->dbg.proc_name));
886 entry = proc_create_data("bb-e", S_IFREG | S_IRUGO,
887 rtlpriv->dbg.proc_dir, &file_ops_bb_e, hw);
888 if (!entry)
889 RT_TRACE(COMP_INIT, COMP_ERR,
890 ("Unable to initialize /proc/net/%s/%s/bb-e\n",
891 rtlpriv->cfg->name, rtlpriv->dbg.proc_name));
893 entry = proc_create_data("bb-f", S_IFREG | S_IRUGO,
894 rtlpriv->dbg.proc_dir, &file_ops_bb_f, hw);
895 if (!entry)
896 RT_TRACE(COMP_INIT, COMP_ERR,
897 ("Unable to initialize /proc/net/%s/%s/bb-f\n",
898 rtlpriv->cfg->name, rtlpriv->dbg.proc_name));
900 entry = proc_create_data("rf-a", S_IFREG | S_IRUGO,
901 rtlpriv->dbg.proc_dir, &file_ops_rf_a, hw);
902 if (!entry)
903 RT_TRACE(COMP_INIT, COMP_ERR,
904 ("Unable to initialize /proc/net/%s/%s/rf-a\n",
905 rtlpriv->cfg->name, rtlpriv->dbg.proc_name));
907 entry = proc_create_data("rf-b", S_IFREG | S_IRUGO,
908 rtlpriv->dbg.proc_dir, &file_ops_rf_b, hw);
909 if (!entry)
910 RT_TRACE(COMP_INIT, COMP_ERR,
911 ("Unable to initialize /proc/net/%s/%s/rf-b\n",
912 rtlpriv->cfg->name, rtlpriv->dbg.proc_name));
914 entry = proc_create_data("cam-1", S_IFREG | S_IRUGO,
915 rtlpriv->dbg.proc_dir, &file_ops_cam_1, hw);
916 if (!entry)
917 RT_TRACE(COMP_INIT, COMP_ERR,
918 ("Unable to initialize /proc/net/%s/%s/cam-1\n",
919 rtlpriv->cfg->name, rtlpriv->dbg.proc_name));
921 entry = proc_create_data("cam-2", S_IFREG | S_IRUGO,
922 rtlpriv->dbg.proc_dir, &file_ops_cam_2, hw);
923 if (!entry)
924 RT_TRACE(COMP_INIT, COMP_ERR,
925 ("Unable to initialize /proc/net/%s/%s/cam-2\n",
926 rtlpriv->cfg->name, rtlpriv->dbg.proc_name));
928 entry = proc_create_data("cam-3", S_IFREG | S_IRUGO,
929 rtlpriv->dbg.proc_dir, &file_ops_cam_3, hw);
930 if (!entry)
931 RT_TRACE(COMP_INIT, COMP_ERR,
932 ("Unable to initialize /proc/net/%s/%s/cam-3\n",
933 rtlpriv->cfg->name, rtlpriv->dbg.proc_name));
936 void rtl_proc_remove_one(struct ieee80211_hw *hw)
938 struct rtl_priv *rtlpriv = rtl_priv(hw);
940 if (rtlpriv->dbg.proc_dir) {
941 remove_proc_entry("mac-0", rtlpriv->dbg.proc_dir);
942 remove_proc_entry("mac-1", rtlpriv->dbg.proc_dir);
943 remove_proc_entry("mac-2", rtlpriv->dbg.proc_dir);
944 remove_proc_entry("mac-3", rtlpriv->dbg.proc_dir);
945 remove_proc_entry("mac-4", rtlpriv->dbg.proc_dir);
946 remove_proc_entry("mac-5", rtlpriv->dbg.proc_dir);
947 remove_proc_entry("mac-6", rtlpriv->dbg.proc_dir);
948 remove_proc_entry("mac-7", rtlpriv->dbg.proc_dir);
949 remove_proc_entry("bb-8", rtlpriv->dbg.proc_dir);
950 remove_proc_entry("bb-9", rtlpriv->dbg.proc_dir);
951 remove_proc_entry("bb-a", rtlpriv->dbg.proc_dir);
952 remove_proc_entry("bb-b", rtlpriv->dbg.proc_dir);
953 remove_proc_entry("bb-c", rtlpriv->dbg.proc_dir);
954 remove_proc_entry("bb-d", rtlpriv->dbg.proc_dir);
955 remove_proc_entry("bb-e", rtlpriv->dbg.proc_dir);
956 remove_proc_entry("bb-f", rtlpriv->dbg.proc_dir);
957 remove_proc_entry("rf-a", rtlpriv->dbg.proc_dir);
958 remove_proc_entry("rf-b", rtlpriv->dbg.proc_dir);
959 remove_proc_entry("cam-1", rtlpriv->dbg.proc_dir);
960 remove_proc_entry("cam-2", rtlpriv->dbg.proc_dir);
961 remove_proc_entry("cam-3", rtlpriv->dbg.proc_dir);
963 remove_proc_entry(rtlpriv->dbg.proc_name, proc_topdir);
965 rtlpriv->dbg.proc_dir = NULL;
969 void rtl_proc_add_topdir(void)
971 proc_topdir = proc_mkdir("rtlwifi", init_net.proc_net);
974 void rtl_proc_remove_topdir(void)
976 if (proc_topdir)
977 remove_proc_entry("rtlwifi", init_net.proc_net);