1 /******************************************************************************
3 * Copyright(c) 2009-2010 Realtek Corporation.
5 * Tmis 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 * You should have received a copy of the GNU General Public License along with
15 * tmis program; if not, write to the Free Software Foundation, Inc.,
16 * 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA
18 * Tme full GNU General Public License is included in this distribution in the
19 * file called LICENSE.
21 * Contact Information:
22 * wlanfae <wlanfae@realtek.com>
23 * Realtek Corporation, No. 2, Innovation Road II, Hsinchu Science Park,
24 * Hsinchu 300, Taiwan.
26 * Larry Finger <Larry.Finger@lwfinger.net>
28 *****************************************************************************/
33 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,10,0))
34 #define GET_INODE_DATA(__node) PDE_DATA(__node)
36 #define GET_INODE_DATA(__node) PDE(__node)->data
40 void rtl_dbgp_flag_init(struct ieee80211_hw
*hw
)
42 struct rtl_priv
*rtlpriv
= rtl_priv(hw
);
45 rtlpriv
->dbg
.global_debuglevel
= DBG_DMESG
;
47 rtlpriv
->dbg
.global_debugcomponents
=
71 COMP_EASY_CONCURRENT
|
73 COMP_QOS
| COMP_MAC80211
| COMP_REGD
|
79 for (i
= 0; i
< DBGP_TYPE_MAX
; i
++)
80 rtlpriv
->dbg
.dbgp_type
[i
] = 0;
82 /*Init Debug flag enable condition */
85 struct proc_dir_entry
*proc_topdir
;
86 static int rtl_proc_get_mac_0(struct seq_file
*m
, void *v
)
88 struct ieee80211_hw
*hw
= m
->private;
89 struct rtl_priv
*rtlpriv
= rtl_priv(hw
);
94 for (n
= 0; n
<= max
; ) {
95 seq_printf(m
, "\n%8.8x ", n
+ page
);
96 for (i
= 0; i
< 4 && n
<= max
; i
++, n
+= 4)
97 seq_printf(m
, "%8.8x ",
98 rtl_read_dword(rtlpriv
, (page
| n
)));
104 static int dl_proc_open_mac_0(struct inode
*inode
, struct file
*file
)
106 return single_open(file
, rtl_proc_get_mac_0
, GET_INODE_DATA(inode
));
109 static const struct file_operations file_ops_mac_0
= {
110 .open
= dl_proc_open_mac_0
,
113 .release
= seq_release
,
116 static int rtl_proc_get_mac_1(struct seq_file
*m
, void *v
)
118 struct ieee80211_hw
*hw
= m
->private;
119 struct rtl_priv
*rtlpriv
= rtl_priv(hw
);
124 for (n
= 0; n
<= max
; ) {
125 seq_printf(m
, "\n%8.8x ", n
+ page
);
126 for (i
= 0; i
< 4 && n
<= max
; i
++, n
+= 4)
127 seq_printf(m
, "%8.8x ",
128 rtl_read_dword(rtlpriv
, (page
| n
)));
134 static int dl_proc_open_mac_1(struct inode
*inode
, struct file
*file
)
136 return single_open(file
, rtl_proc_get_mac_1
, GET_INODE_DATA(inode
));
139 static const struct file_operations file_ops_mac_1
= {
140 .open
= dl_proc_open_mac_1
,
143 .release
= seq_release
,
146 static int rtl_proc_get_mac_2(struct seq_file
*m
, void *v
)
148 struct ieee80211_hw
*hw
= m
->private;
149 struct rtl_priv
*rtlpriv
= rtl_priv(hw
);
154 for (n
= 0; n
<= max
; ) {
155 seq_printf(m
, "\n%8.8x ", n
+ page
);
156 for (i
= 0; i
< 4 && n
<= max
; i
++, n
+= 4)
157 seq_printf(m
, "%8.8x ",
158 rtl_read_dword(rtlpriv
, (page
| n
)));
164 static int dl_proc_open_mac_2(struct inode
*inode
, struct file
*file
)
166 return single_open(file
, rtl_proc_get_mac_2
, GET_INODE_DATA(inode
));
169 static const struct file_operations file_ops_mac_2
= {
170 .open
= dl_proc_open_mac_2
,
173 .release
= seq_release
,
176 static int rtl_proc_get_mac_3(struct seq_file
*m
, void *v
)
178 struct ieee80211_hw
*hw
= m
->private;
179 struct rtl_priv
*rtlpriv
= rtl_priv(hw
);
184 for (n
= 0; n
<= max
; ) {
185 seq_printf(m
, "\n%8.8x ", n
+ page
);
186 for (i
= 0; i
< 4 && n
<= max
; i
++, n
+= 4)
187 seq_printf(m
, "%8.8x ",
188 rtl_read_dword(rtlpriv
, (page
| n
)));
194 static int dl_proc_open_mac_3(struct inode
*inode
, struct file
*file
)
196 return single_open(file
, rtl_proc_get_mac_3
, GET_INODE_DATA(inode
));
199 static const struct file_operations file_ops_mac_3
= {
200 .open
= dl_proc_open_mac_3
,
203 .release
= seq_release
,
206 static int rtl_proc_get_mac_4(struct seq_file
*m
, void *v
)
208 struct ieee80211_hw
*hw
= m
->private;
209 struct rtl_priv
*rtlpriv
= rtl_priv(hw
);
214 for (n
= 0; n
<= max
; ) {
215 seq_printf(m
, "\n%8.8x ", n
+ page
);
216 for (i
= 0; i
< 4 && n
<= max
; i
++, n
+= 4)
217 seq_printf(m
, "%8.8x ",
218 rtl_read_dword(rtlpriv
, (page
| n
)));
224 static int dl_proc_open_mac_4(struct inode
*inode
, struct file
*file
)
226 return single_open(file
, rtl_proc_get_mac_4
, GET_INODE_DATA(inode
));
229 static const struct file_operations file_ops_mac_4
= {
230 .open
= dl_proc_open_mac_4
,
233 .release
= seq_release
,
236 static int rtl_proc_get_mac_5(struct seq_file
*m
, void *v
)
238 struct ieee80211_hw
*hw
= m
->private;
239 struct rtl_priv
*rtlpriv
= rtl_priv(hw
);
244 for (n
= 0; n
<= max
; ) {
245 seq_printf(m
, "\n%8.8x ", n
+ page
);
246 for (i
= 0; i
< 4 && n
<= max
; i
++, n
+= 4)
247 seq_printf(m
, "%8.8x ",
248 rtl_read_dword(rtlpriv
, (page
| n
)));
254 static int dl_proc_open_mac_5(struct inode
*inode
, struct file
*file
)
256 return single_open(file
, rtl_proc_get_mac_5
, GET_INODE_DATA(inode
));
259 static const struct file_operations file_ops_mac_5
= {
260 .open
= dl_proc_open_mac_5
,
263 .release
= seq_release
,
266 static int rtl_proc_get_mac_6(struct seq_file
*m
, void *v
)
268 struct ieee80211_hw
*hw
= m
->private;
269 struct rtl_priv
*rtlpriv
= rtl_priv(hw
);
274 for (n
= 0; n
<= max
; ) {
275 seq_printf(m
, "\n%8.8x ", n
+ page
);
276 for (i
= 0; i
< 4 && n
<= max
; i
++, n
+= 4)
277 seq_printf(m
, "%8.8x ",
278 rtl_read_dword(rtlpriv
, (page
| n
)));
284 static int dl_proc_open_mac_6(struct inode
*inode
, struct file
*file
)
286 return single_open(file
, rtl_proc_get_mac_6
, GET_INODE_DATA(inode
));
289 static const struct file_operations file_ops_mac_6
= {
290 .open
= dl_proc_open_mac_6
,
293 .release
= seq_release
,
296 static int rtl_proc_get_mac_7(struct seq_file
*m
, void *v
)
298 struct ieee80211_hw
*hw
= m
->private;
299 struct rtl_priv
*rtlpriv
= rtl_priv(hw
);
304 for (n
= 0; n
<= max
; ) {
305 seq_printf(m
, "\n%8.8x ", n
+ page
);
306 for (i
= 0; i
< 4 && n
<= max
; i
++, n
+= 4)
307 seq_printf(m
, "%8.8x ",
308 rtl_read_dword(rtlpriv
, (page
| n
)));
314 static int dl_proc_open_mac_7(struct inode
*inode
, struct file
*file
)
316 return single_open(file
, rtl_proc_get_mac_7
, GET_INODE_DATA(inode
));
319 static const struct file_operations file_ops_mac_7
= {
320 .open
= dl_proc_open_mac_7
,
323 .release
= seq_release
,
326 static int rtl_proc_get_bb_8(struct seq_file
*m
, void *v
)
328 struct ieee80211_hw
*hw
= m
->private;
333 for (n
= 0; n
<= max
; ) {
334 seq_printf(m
, "\n%8.8x ", n
+ page
);
335 for (i
= 0; i
< 4 && n
<= max
; i
++, n
+= 4)
336 seq_printf(m
, "%8.8x ",
337 rtl_get_bbreg(hw
, (page
| n
), 0xffffffff));
343 static int dl_proc_open_bb_8(struct inode
*inode
, struct file
*file
)
345 return single_open(file
, rtl_proc_get_bb_8
, GET_INODE_DATA(inode
));
348 static const struct file_operations file_ops_bb_8
= {
349 .open
= dl_proc_open_bb_8
,
352 .release
= seq_release
,
355 static int rtl_proc_get_bb_9(struct seq_file
*m
, void *v
)
357 struct ieee80211_hw
*hw
= m
->private;
362 for (n
= 0; n
<= max
; ) {
363 seq_printf(m
, "\n%8.8x ", n
+ page
);
364 for (i
= 0; i
< 4 && n
<= max
; i
++, n
+= 4)
365 seq_printf(m
, "%8.8x ",
366 rtl_get_bbreg(hw
, (page
| n
), 0xffffffff));
372 static int dl_proc_open_bb_9(struct inode
*inode
, struct file
*file
)
374 return single_open(file
, rtl_proc_get_bb_9
, GET_INODE_DATA(inode
));
377 static const struct file_operations file_ops_bb_9
= {
378 .open
= dl_proc_open_bb_9
,
381 .release
= seq_release
,
384 static int rtl_proc_get_bb_a(struct seq_file
*m
, void *v
)
386 struct ieee80211_hw
*hw
= m
->private;
391 for (n
= 0; n
<= max
; ) {
392 seq_printf(m
, "\n%8.8x ", n
+ page
);
393 for (i
= 0; i
< 4 && n
<= max
; i
++, n
+= 4)
394 seq_printf(m
, "%8.8x ",
395 rtl_get_bbreg(hw
, (page
| n
), 0xffffffff));
401 static int dl_proc_open_bb_a(struct inode
*inode
, struct file
*file
)
403 return single_open(file
, rtl_proc_get_bb_a
, GET_INODE_DATA(inode
));
406 static const struct file_operations file_ops_bb_a
= {
407 .open
= dl_proc_open_bb_a
,
410 .release
= seq_release
,
413 static int rtl_proc_get_bb_b(struct seq_file
*m
, void *v
)
415 struct ieee80211_hw
*hw
= m
->private;
420 for (n
= 0; n
<= max
; ) {
421 seq_printf(m
, "\n%8.8x ", n
+ page
);
422 for (i
= 0; i
< 4 && n
<= max
; i
++, n
+= 4)
423 seq_printf(m
, "%8.8x ",
424 rtl_get_bbreg(hw
, (page
| n
), 0xffffffff));
430 static int dl_proc_open_bb_b(struct inode
*inode
, struct file
*file
)
432 return single_open(file
, rtl_proc_get_bb_b
, GET_INODE_DATA(inode
));
435 static const struct file_operations file_ops_bb_b
= {
436 .open
= dl_proc_open_bb_b
,
439 .release
= seq_release
,
442 static int rtl_proc_get_bb_c(struct seq_file
*m
, void *v
)
444 struct ieee80211_hw
*hw
= m
->private;
449 for (n
= 0; n
<= max
; ) {
450 seq_printf(m
, "\n%8.8x ", n
+ page
);
451 for (i
= 0; i
< 4 && n
<= max
; i
++, n
+= 4)
452 seq_printf(m
, "%8.8x ",
453 rtl_get_bbreg(hw
, (page
| n
), 0xffffffff));
459 static int dl_proc_open_bb_c(struct inode
*inode
, struct file
*file
)
461 return single_open(file
, rtl_proc_get_bb_c
, GET_INODE_DATA(inode
));
464 static const struct file_operations file_ops_bb_c
= {
465 .open
= dl_proc_open_bb_c
,
468 .release
= seq_release
,
471 static int rtl_proc_get_bb_d(struct seq_file
*m
, void *v
)
473 struct ieee80211_hw
*hw
= m
->private;
478 for (n
= 0; n
<= max
; ) {
479 seq_printf(m
, "\n%8.8x ", n
+ page
);
480 for (i
= 0; i
< 4 && n
<= max
; i
++, n
+= 4)
481 seq_printf(m
, "%8.8x ",
482 rtl_get_bbreg(hw
, (page
| n
), 0xffffffff));
488 static int dl_proc_open_bb_d(struct inode
*inode
, struct file
*file
)
490 return single_open(file
, rtl_proc_get_bb_d
, GET_INODE_DATA(inode
));
493 static const struct file_operations file_ops_bb_d
= {
494 .open
= dl_proc_open_bb_d
,
497 .release
= seq_release
,
500 static int rtl_proc_get_bb_e(struct seq_file
*m
, void *v
)
502 struct ieee80211_hw
*hw
= m
->private;
507 for (n
= 0; n
<= max
; ) {
508 seq_printf(m
, "\n%8.8x ", n
+ page
);
509 for (i
= 0; i
< 4 && n
<= max
; i
++, n
+= 4)
510 seq_printf(m
, "%8.8x ",
511 rtl_get_bbreg(hw
, (page
| n
), 0xffffffff));
517 static int dl_proc_open_bb_e(struct inode
*inode
, struct file
*file
)
519 return single_open(file
, rtl_proc_get_bb_e
, GET_INODE_DATA(inode
));
522 static const struct file_operations file_ops_bb_e
= {
523 .open
= dl_proc_open_bb_e
,
526 .release
= seq_release
,
529 static int rtl_proc_get_bb_f(struct seq_file
*m
, void *v
)
531 struct ieee80211_hw
*hw
= m
->private;
536 for (n
= 0; n
<= max
; ) {
537 seq_printf(m
, "\n%8.8x ", n
+ page
);
538 for (i
= 0; i
< 4 && n
<= max
; i
++, n
+= 4)
539 seq_printf(m
, "%8.8x ",
540 rtl_get_bbreg(hw
, (page
| n
), 0xffffffff));
546 static int dl_proc_open_bb_f(struct inode
*inode
, struct file
*file
)
548 return single_open(file
, rtl_proc_get_bb_f
, GET_INODE_DATA(inode
));
551 static const struct file_operations file_ops_bb_f
= {
552 .open
= dl_proc_open_bb_f
,
555 .release
= seq_release
,
558 static int rtl_proc_get_reg_rf_a(struct seq_file
*m
, void *v
)
560 struct ieee80211_hw
*hw
= m
->private;
564 for (n
= 0; n
<= max
; ) {
565 seq_printf(m
, "\n%8.8x ", n
);
566 for (i
= 0; i
< 4 && n
<= max
; n
+= 1, i
++)
567 seq_printf(m
, "%8.8x ",
568 rtl_get_rfreg(hw
, RF90_PATH_A
, n
, 0xffffffff));
574 static int dl_proc_open_rf_a(struct inode
*inode
, struct file
*file
)
576 return single_open(file
, rtl_proc_get_reg_rf_a
, GET_INODE_DATA(inode
));
579 static const struct file_operations file_ops_rf_a
= {
580 .open
= dl_proc_open_rf_a
,
583 .release
= seq_release
,
586 static int rtl_proc_get_reg_rf_b(struct seq_file
*m
, void *v
)
588 struct ieee80211_hw
*hw
= m
->private;
592 for (n
= 0; n
<= max
; ) {
593 seq_printf(m
, "\n%8.8x ", n
);
594 for (i
= 0; i
< 4 && n
<= max
; n
+= 1, i
++)
595 seq_printf(m
, "%8.8x ",
596 rtl_get_rfreg(hw
, RF90_PATH_B
, n
,
603 static int dl_proc_open_rf_b(struct inode
*inode
, struct file
*file
)
605 return single_open(file
, rtl_proc_get_reg_rf_b
, GET_INODE_DATA(inode
));
608 static const struct file_operations file_ops_rf_b
= {
609 .open
= dl_proc_open_rf_b
,
612 .release
= seq_release
,
615 static int rtl_proc_get_cam_register_1(struct seq_file
*m
, void *v
)
617 struct ieee80211_hw
*hw
= m
->private;
618 struct rtl_priv
*rtlpriv
= rtl_priv(hw
);
625 /* This dump the current register page */
627 "\n#################### SECURITY CAM (0-10) ##################\n ");
629 for (j
= 0; j
< 11; j
++) {
630 seq_printf(m
, "\nD: %2x > ", j
);
631 for (entry_i
= 0; entry_i
< CAM_CONTENT_COUNT
; entry_i
++) {
632 /* polling bit, and No Write enable, and address */
633 target_cmd
= entry_i
+ CAM_CONTENT_COUNT
* j
;
634 target_cmd
= target_cmd
| BIT(31);
636 /* Check polling bit is clear */
638 ulstatus
= rtl_read_dword(rtlpriv
,
639 rtlpriv
->cfg
->maps
[RWCAM
]);
640 if (ulstatus
& BIT(31)) {
647 rtl_write_dword(rtlpriv
, rtlpriv
->cfg
->maps
[RWCAM
],
649 target_val
= rtl_read_dword(rtlpriv
,
650 rtlpriv
->cfg
->maps
[RCAMO
]);
651 seq_printf(m
, "%8.8x ", target_val
);
658 static int dl_proc_open_cam_1(struct inode
*inode
, struct file
*file
)
660 return single_open(file
, rtl_proc_get_cam_register_1
,
661 GET_INODE_DATA(inode
));
664 static const struct file_operations file_ops_cam_1
= {
665 .open
= dl_proc_open_cam_1
,
668 .release
= seq_release
,
671 static int rtl_proc_get_cam_register_2(struct seq_file
*m
, void *v
)
673 struct ieee80211_hw
*hw
= m
->private;
674 struct rtl_priv
*rtlpriv
= rtl_priv(hw
);
681 /* This dump the current register page */
683 "\n################### SECURITY CAM (11-21) ##################\n ");
685 for (j
= 11; j
< 22; j
++) {
686 seq_printf(m
, "\nD: %2x > ", j
);
687 for (entry_i
= 0; entry_i
< CAM_CONTENT_COUNT
; entry_i
++) {
688 target_cmd
= entry_i
+ CAM_CONTENT_COUNT
* j
;
689 target_cmd
= target_cmd
| BIT(31);
692 ulstatus
= rtl_read_dword(rtlpriv
,
693 rtlpriv
->cfg
->maps
[RWCAM
]);
694 if (ulstatus
& BIT(31)) {
701 rtl_write_dword(rtlpriv
, rtlpriv
->cfg
->maps
[RWCAM
],
703 target_val
= rtl_read_dword(rtlpriv
,
704 rtlpriv
->cfg
->maps
[RCAMO
]);
705 seq_printf(m
, "%8.8x ", target_val
);
712 static int dl_proc_open_cam_2(struct inode
*inode
, struct file
*file
)
714 return single_open(file
, rtl_proc_get_cam_register_2
,
715 GET_INODE_DATA(inode
));
718 static const struct file_operations file_ops_cam_2
= {
719 .open
= dl_proc_open_cam_2
,
722 .release
= seq_release
,
725 static int rtl_proc_get_cam_register_3(struct seq_file
*m
, void *v
)
727 struct ieee80211_hw
*hw
= m
->private;
728 struct rtl_priv
*rtlpriv
= rtl_priv(hw
);
735 /* This dump the current register page */
737 "\n################### SECURITY CAM (22-31) ##################\n ");
739 for (j
= 22; j
< TOTAL_CAM_ENTRY
; j
++) {
740 seq_printf(m
, "\nD: %2x > ", j
);
741 for (entry_i
= 0; entry_i
< CAM_CONTENT_COUNT
; entry_i
++) {
742 target_cmd
= entry_i
+CAM_CONTENT_COUNT
*j
;
743 target_cmd
= target_cmd
| BIT(31);
746 ulstatus
= rtl_read_dword(rtlpriv
,
747 rtlpriv
->cfg
->maps
[RWCAM
]);
748 if (ulstatus
& BIT(31)) {
755 rtl_write_dword(rtlpriv
, rtlpriv
->cfg
->maps
[RWCAM
],
757 target_val
= rtl_read_dword(rtlpriv
,
758 rtlpriv
->cfg
->maps
[RCAMO
]);
759 seq_printf(m
, "%8.8x ", target_val
);
766 static int dl_proc_open_cam_3(struct inode
*inode
, struct file
*file
)
768 return single_open(file
, rtl_proc_get_cam_register_3
,
769 GET_INODE_DATA(inode
));
772 static const struct file_operations file_ops_cam_3
= {
773 .open
= dl_proc_open_cam_3
,
776 .release
= seq_release
,
779 void rtl_proc_add_one(struct ieee80211_hw
*hw
)
781 struct rtl_priv
*rtlpriv
= rtl_priv(hw
);
782 struct rtl_efuse
*rtlefuse
= rtl_efuse(rtl_priv(hw
));
783 struct proc_dir_entry
*entry
;
785 snprintf(rtlpriv
->dbg
.proc_name
, 18, "%x-%x-%x-%x-%x-%x",
786 rtlefuse
->dev_addr
[0], rtlefuse
->dev_addr
[1],
787 rtlefuse
->dev_addr
[2], rtlefuse
->dev_addr
[3],
788 rtlefuse
->dev_addr
[4], rtlefuse
->dev_addr
[5]);
790 rtlpriv
->dbg
.proc_dir
= proc_mkdir(rtlpriv
->dbg
.proc_name
, proc_topdir
);
791 if (!rtlpriv
->dbg
.proc_dir
) {
792 RT_TRACE(COMP_INIT
, DBG_EMERG
, ("Unable to init "
793 "/proc/net/%s/%s\n", rtlpriv
->cfg
->name
,
794 rtlpriv
->dbg
.proc_name
));
798 entry
= proc_create_data("mac-0", S_IFREG
| S_IRUGO
,
799 rtlpriv
->dbg
.proc_dir
, &file_ops_mac_0
, hw
);
801 RT_TRACE(COMP_INIT
, DBG_EMERG
,
802 ("Unable to initialize /proc/net/%s/%s/mac-0\n",
803 rtlpriv
->cfg
->name
, rtlpriv
->dbg
.proc_name
));
805 entry
= proc_create_data("mac-1", S_IFREG
| S_IRUGO
,
806 rtlpriv
->dbg
.proc_dir
, &file_ops_mac_1
, hw
);
808 RT_TRACE(COMP_INIT
, COMP_ERR
,
809 ("Unable to initialize /proc/net/%s/%s/mac-1\n",
810 rtlpriv
->cfg
->name
, rtlpriv
->dbg
.proc_name
));
812 entry
= proc_create_data("mac-2", S_IFREG
| S_IRUGO
,
813 rtlpriv
->dbg
.proc_dir
, &file_ops_mac_2
, hw
);
815 RT_TRACE(COMP_INIT
, COMP_ERR
,
816 ("Unable to initialize /proc/net/%s/%s/mac-2\n",
817 rtlpriv
->cfg
->name
, rtlpriv
->dbg
.proc_name
));
819 entry
= proc_create_data("mac-3", S_IFREG
| S_IRUGO
,
820 rtlpriv
->dbg
.proc_dir
, &file_ops_mac_3
, hw
);
822 RT_TRACE(COMP_INIT
, COMP_ERR
,
823 ("Unable to initialize /proc/net/%s/%s/mac-3\n",
824 rtlpriv
->cfg
->name
, rtlpriv
->dbg
.proc_name
));
826 entry
= proc_create_data("mac-4", S_IFREG
| S_IRUGO
,
827 rtlpriv
->dbg
.proc_dir
, &file_ops_mac_4
, hw
);
829 RT_TRACE(COMP_INIT
, COMP_ERR
,
830 ("Unable to initialize /proc/net/%s/%s/mac-4\n",
831 rtlpriv
->cfg
->name
, rtlpriv
->dbg
.proc_name
));
833 entry
= proc_create_data("mac-5", S_IFREG
| S_IRUGO
,
834 rtlpriv
->dbg
.proc_dir
, &file_ops_mac_5
, hw
);
836 RT_TRACE(COMP_INIT
, COMP_ERR
,
837 ("Unable to initialize /proc/net/%s/%s/mac-5\n",
838 rtlpriv
->cfg
->name
, rtlpriv
->dbg
.proc_name
));
840 entry
= proc_create_data("mac-6", S_IFREG
| S_IRUGO
,
841 rtlpriv
->dbg
.proc_dir
, &file_ops_mac_6
, hw
);
843 RT_TRACE(COMP_INIT
, COMP_ERR
,
844 ("Unable to initialize /proc/net/%s/%s/mac-6\n",
845 rtlpriv
->cfg
->name
, rtlpriv
->dbg
.proc_name
));
847 entry
= proc_create_data("mac-7", S_IFREG
| S_IRUGO
,
848 rtlpriv
->dbg
.proc_dir
, &file_ops_mac_7
, hw
);
850 RT_TRACE(COMP_INIT
, COMP_ERR
,
851 ("Unable to initialize /proc/net/%s/%s/mac-7\n",
852 rtlpriv
->cfg
->name
, rtlpriv
->dbg
.proc_name
));
854 entry
= proc_create_data("bb-8", S_IFREG
| S_IRUGO
,
855 rtlpriv
->dbg
.proc_dir
, &file_ops_bb_8
, hw
);
857 RT_TRACE(COMP_INIT
, COMP_ERR
,
858 ("Unable to initialize /proc/net/%s/%s/bb-8\n",
859 rtlpriv
->cfg
->name
, rtlpriv
->dbg
.proc_name
));
861 entry
= proc_create_data("bb-9", S_IFREG
| S_IRUGO
,
862 rtlpriv
->dbg
.proc_dir
, &file_ops_bb_9
, hw
);
864 RT_TRACE(COMP_INIT
, COMP_ERR
,
865 ("Unable to initialize /proc/net/%s/%s/bb-9\n",
866 rtlpriv
->cfg
->name
, rtlpriv
->dbg
.proc_name
));
868 entry
= proc_create_data("bb-a", S_IFREG
| S_IRUGO
,
869 rtlpriv
->dbg
.proc_dir
, &file_ops_bb_a
, hw
);
871 RT_TRACE(COMP_INIT
, COMP_ERR
,
872 ("Unable to initialize /proc/net/%s/%s/bb-a\n",
873 rtlpriv
->cfg
->name
, rtlpriv
->dbg
.proc_name
));
875 entry
= proc_create_data("bb-b", S_IFREG
| S_IRUGO
,
876 rtlpriv
->dbg
.proc_dir
, &file_ops_bb_b
, hw
);
878 RT_TRACE(COMP_INIT
, COMP_ERR
,
879 ("Unable to initialize /proc/net/%s/%s/bb-b\n",
880 rtlpriv
->cfg
->name
, rtlpriv
->dbg
.proc_name
));
882 entry
= proc_create_data("bb-c", S_IFREG
| S_IRUGO
,
883 rtlpriv
->dbg
.proc_dir
, &file_ops_bb_c
, hw
);
885 RT_TRACE(COMP_INIT
, COMP_ERR
,
886 ("Unable to initialize /proc/net/%s/%s/bb-c\n",
887 rtlpriv
->cfg
->name
, rtlpriv
->dbg
.proc_name
));
889 entry
= proc_create_data("bb-d", S_IFREG
| S_IRUGO
,
890 rtlpriv
->dbg
.proc_dir
, &file_ops_bb_d
, hw
);
892 RT_TRACE(COMP_INIT
, COMP_ERR
,
893 ("Unable to initialize /proc/net/%s/%s/bb-d\n",
894 rtlpriv
->cfg
->name
, rtlpriv
->dbg
.proc_name
));
896 entry
= proc_create_data("bb-e", S_IFREG
| S_IRUGO
,
897 rtlpriv
->dbg
.proc_dir
, &file_ops_bb_e
, hw
);
899 RT_TRACE(COMP_INIT
, COMP_ERR
,
900 ("Unable to initialize /proc/net/%s/%s/bb-e\n",
901 rtlpriv
->cfg
->name
, rtlpriv
->dbg
.proc_name
));
903 entry
= proc_create_data("bb-f", S_IFREG
| S_IRUGO
,
904 rtlpriv
->dbg
.proc_dir
, &file_ops_bb_f
, hw
);
906 RT_TRACE(COMP_INIT
, COMP_ERR
,
907 ("Unable to initialize /proc/net/%s/%s/bb-f\n",
908 rtlpriv
->cfg
->name
, rtlpriv
->dbg
.proc_name
));
910 entry
= proc_create_data("rf-a", S_IFREG
| S_IRUGO
,
911 rtlpriv
->dbg
.proc_dir
, &file_ops_rf_a
, hw
);
913 RT_TRACE(COMP_INIT
, COMP_ERR
,
914 ("Unable to initialize /proc/net/%s/%s/rf-a\n",
915 rtlpriv
->cfg
->name
, rtlpriv
->dbg
.proc_name
));
917 entry
= proc_create_data("rf-b", S_IFREG
| S_IRUGO
,
918 rtlpriv
->dbg
.proc_dir
, &file_ops_rf_b
, hw
);
920 RT_TRACE(COMP_INIT
, COMP_ERR
,
921 ("Unable to initialize /proc/net/%s/%s/rf-b\n",
922 rtlpriv
->cfg
->name
, rtlpriv
->dbg
.proc_name
));
924 entry
= proc_create_data("cam-1", S_IFREG
| S_IRUGO
,
925 rtlpriv
->dbg
.proc_dir
, &file_ops_cam_1
, hw
);
927 RT_TRACE(COMP_INIT
, COMP_ERR
,
928 ("Unable to initialize /proc/net/%s/%s/cam-1\n",
929 rtlpriv
->cfg
->name
, rtlpriv
->dbg
.proc_name
));
931 entry
= proc_create_data("cam-2", S_IFREG
| S_IRUGO
,
932 rtlpriv
->dbg
.proc_dir
, &file_ops_cam_2
, hw
);
934 RT_TRACE(COMP_INIT
, COMP_ERR
,
935 ("Unable to initialize /proc/net/%s/%s/cam-2\n",
936 rtlpriv
->cfg
->name
, rtlpriv
->dbg
.proc_name
));
938 entry
= proc_create_data("cam-3", S_IFREG
| S_IRUGO
,
939 rtlpriv
->dbg
.proc_dir
, &file_ops_cam_3
, hw
);
941 RT_TRACE(COMP_INIT
, COMP_ERR
,
942 ("Unable to initialize /proc/net/%s/%s/cam-3\n",
943 rtlpriv
->cfg
->name
, rtlpriv
->dbg
.proc_name
));
946 void rtl_proc_remove_one(struct ieee80211_hw
*hw
)
948 struct rtl_priv
*rtlpriv
= rtl_priv(hw
);
950 if (rtlpriv
->dbg
.proc_dir
) {
951 remove_proc_entry("mac-0", rtlpriv
->dbg
.proc_dir
);
952 remove_proc_entry("mac-1", rtlpriv
->dbg
.proc_dir
);
953 remove_proc_entry("mac-2", rtlpriv
->dbg
.proc_dir
);
954 remove_proc_entry("mac-3", rtlpriv
->dbg
.proc_dir
);
955 remove_proc_entry("mac-4", rtlpriv
->dbg
.proc_dir
);
956 remove_proc_entry("mac-5", rtlpriv
->dbg
.proc_dir
);
957 remove_proc_entry("mac-6", rtlpriv
->dbg
.proc_dir
);
958 remove_proc_entry("mac-7", rtlpriv
->dbg
.proc_dir
);
959 remove_proc_entry("bb-8", rtlpriv
->dbg
.proc_dir
);
960 remove_proc_entry("bb-9", rtlpriv
->dbg
.proc_dir
);
961 remove_proc_entry("bb-a", rtlpriv
->dbg
.proc_dir
);
962 remove_proc_entry("bb-b", rtlpriv
->dbg
.proc_dir
);
963 remove_proc_entry("bb-c", rtlpriv
->dbg
.proc_dir
);
964 remove_proc_entry("bb-d", rtlpriv
->dbg
.proc_dir
);
965 remove_proc_entry("bb-e", rtlpriv
->dbg
.proc_dir
);
966 remove_proc_entry("bb-f", rtlpriv
->dbg
.proc_dir
);
967 remove_proc_entry("rf-a", rtlpriv
->dbg
.proc_dir
);
968 remove_proc_entry("rf-b", rtlpriv
->dbg
.proc_dir
);
969 remove_proc_entry("cam-1", rtlpriv
->dbg
.proc_dir
);
970 remove_proc_entry("cam-2", rtlpriv
->dbg
.proc_dir
);
971 remove_proc_entry("cam-3", rtlpriv
->dbg
.proc_dir
);
973 remove_proc_entry(rtlpriv
->dbg
.proc_name
, proc_topdir
);
975 rtlpriv
->dbg
.proc_dir
= NULL
;
979 void rtl_proc_add_topdir(void)
981 proc_topdir
= proc_mkdir("rtlwifi", init_net
.proc_net
);
984 void rtl_proc_remove_topdir(void)
987 remove_proc_entry("rtlwifi", init_net
.proc_net
);