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
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 *****************************************************************************/
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
);
37 rtlpriv
->dbg
.global_debuglevel
= DBG_DMESG
;
39 rtlpriv
->dbg
.global_debugcomponents
=
63 COMP_EASY_CONCURRENT
|
65 COMP_QOS
| COMP_MAC80211
| COMP_REGD
|
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
);
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
)));
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
,
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
);
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
)));
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
,
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
);
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
)));
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
,
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
);
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
)));
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
,
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
);
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
)));
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
,
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
);
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
)));
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
,
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
);
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
)));
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
,
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
);
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
)));
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
,
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;
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));
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
,
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;
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));
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
,
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;
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));
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
,
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;
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));
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
,
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;
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));
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
,
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;
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));
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
,
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;
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));
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
,
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;
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));
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
,
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;
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));
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
,
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;
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
,
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
,
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
);
618 /* This dump the current register page */
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 */
631 ulstatus
= rtl_read_dword(rtlpriv
,
632 rtlpriv
->cfg
->maps
[RWCAM
]);
633 if (ulstatus
& BIT(31))
639 rtl_write_dword(rtlpriv
, rtlpriv
->cfg
->maps
[RWCAM
],
641 target_val
= rtl_read_dword(rtlpriv
,
642 rtlpriv
->cfg
->maps
[RCAMO
]);
643 seq_printf(m
, "%8.8x ", target_val
);
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
,
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
);
673 /* This dump the current register page */
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);
684 ulstatus
= rtl_read_dword(rtlpriv
,
685 rtlpriv
->cfg
->maps
[RWCAM
]);
686 if (ulstatus
& BIT(31))
692 rtl_write_dword(rtlpriv
, rtlpriv
->cfg
->maps
[RWCAM
],
694 target_val
= rtl_read_dword(rtlpriv
,
695 rtlpriv
->cfg
->maps
[RCAMO
]);
696 seq_printf(m
, "%8.8x ", target_val
);
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
,
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
);
726 /* This dump the current register page */
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);
737 ulstatus
= rtl_read_dword(rtlpriv
, rtlpriv
->cfg
->maps
[RWCAM
]);
738 if (ulstatus
& BIT(31))
744 rtl_write_dword(rtlpriv
, rtlpriv
->cfg
->maps
[RWCAM
],
746 target_val
= rtl_read_dword(rtlpriv
,
747 rtlpriv
->cfg
->maps
[RCAMO
]);
748 seq_printf(m
, "%8.8x ", target_val
);
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
,
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",
784 rtlpriv
->dbg
.proc_name
));
788 entry
= proc_create_data("mac-0", S_IFREG
| S_IRUGO
,
789 rtlpriv
->dbg
.proc_dir
, &file_ops_mac_0
, hw
);
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
);
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
);
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
);
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
);
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
);
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
);
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
);
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
);
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
);
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
);
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
);
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
);
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
);
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
);
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
);
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
);
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
);
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
);
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
);
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
);
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)
977 remove_proc_entry("rtlwifi", init_net
.proc_net
);