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 * This 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 * this program; if not, write to the Free Software Foundation, Inc.,
16 * 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA
18 * The full GNU General Public License is included in this distribution in the
19 * file called LICENSE.
21 * Contact Information:
23 * Realtek Corporation, No. 2, Innovation Road II, Hsinchu Science Park,
24 * Hsinchu 300, Taiwan.
28 *****************************************************************************/
33 #define GET_INODE_DATA(__node) PDE_DATA(__node)
35 void rtl_dbgp_flag_init(struct ieee80211_hw *hw)
37 struct rtl_priv *rtlpriv = rtl_priv(hw);
40 rtlpriv->dbg.global_debuglevel = DBG_DMESG;
42 rtlpriv->dbg.global_debugcomponents =
66 COMP_EASY_CONCURRENT |
68 COMP_QOS | COMP_MAC80211 | COMP_REGD |
74 for (i = 0; i < DBGP_TYPE_MAX; i++)
75 rtlpriv->dbg.dbgp_type[i] = 0;
77 /*Init Debug flag enable condition */
80 struct proc_dir_entry *proc_topdir;
81 static int rtl_proc_get_mac_0(struct seq_file *m, void *v)
83 struct ieee80211_hw *hw = m->private;
84 struct rtl_priv *rtlpriv = rtl_priv(hw);
89 for (n = 0; n <= max; ) {
90 seq_printf(m, "\n%8.8x ", n + page);
91 for (i = 0; i < 4 && n <= max; i++, n += 4)
92 seq_printf(m, "%8.8x ",
93 rtl_read_dword(rtlpriv, (page | n)));
99 static int dl_proc_open_mac_0(struct inode *inode, struct file *file)
101 return single_open(file, rtl_proc_get_mac_0, GET_INODE_DATA(inode));
104 static const struct file_operations file_ops_mac_0 = {
105 .open = dl_proc_open_mac_0,
108 .release = seq_release,
111 static int rtl_proc_get_mac_1(struct seq_file *m, void *v)
113 struct ieee80211_hw *hw = m->private;
114 struct rtl_priv *rtlpriv = rtl_priv(hw);
119 for (n = 0; n <= max; ) {
120 seq_printf(m, "\n%8.8x ", n + page);
121 for (i = 0; i < 4 && n <= max; i++, n += 4)
122 seq_printf(m, "%8.8x ",
123 rtl_read_dword(rtlpriv, (page | n)));
129 static int dl_proc_open_mac_1(struct inode *inode, struct file *file)
131 return single_open(file, rtl_proc_get_mac_1, GET_INODE_DATA(inode));
134 static const struct file_operations file_ops_mac_1 = {
135 .open = dl_proc_open_mac_1,
138 .release = seq_release,
141 static int rtl_proc_get_mac_2(struct seq_file *m, void *v)
143 struct ieee80211_hw *hw = m->private;
144 struct rtl_priv *rtlpriv = rtl_priv(hw);
149 for (n = 0; n <= max; ) {
150 seq_printf(m, "\n%8.8x ", n + page);
151 for (i = 0; i < 4 && n <= max; i++, n += 4)
152 seq_printf(m, "%8.8x ",
153 rtl_read_dword(rtlpriv, (page | n)));
159 static int dl_proc_open_mac_2(struct inode *inode, struct file *file)
161 return single_open(file, rtl_proc_get_mac_2, GET_INODE_DATA(inode));
164 static const struct file_operations file_ops_mac_2 = {
165 .open = dl_proc_open_mac_2,
168 .release = seq_release,
171 static int rtl_proc_get_mac_3(struct seq_file *m, void *v)
173 struct ieee80211_hw *hw = m->private;
174 struct rtl_priv *rtlpriv = rtl_priv(hw);
179 for (n = 0; n <= max; ) {
180 seq_printf(m, "\n%8.8x ", n + page);
181 for (i = 0; i < 4 && n <= max; i++, n += 4)
182 seq_printf(m, "%8.8x ",
183 rtl_read_dword(rtlpriv, (page | n)));
189 static int dl_proc_open_mac_3(struct inode *inode, struct file *file)
191 return single_open(file, rtl_proc_get_mac_3, GET_INODE_DATA(inode));
194 static const struct file_operations file_ops_mac_3 = {
195 .open = dl_proc_open_mac_3,
198 .release = seq_release,
201 static int rtl_proc_get_mac_4(struct seq_file *m, void *v)
203 struct ieee80211_hw *hw = m->private;
204 struct rtl_priv *rtlpriv = rtl_priv(hw);
209 for (n = 0; n <= max; ) {
210 seq_printf(m, "\n%8.8x ", n + page);
211 for (i = 0; i < 4 && n <= max; i++, n += 4)
212 seq_printf(m, "%8.8x ",
213 rtl_read_dword(rtlpriv, (page | n)));
219 static int dl_proc_open_mac_4(struct inode *inode, struct file *file)
221 return single_open(file, rtl_proc_get_mac_4, GET_INODE_DATA(inode));
224 static const struct file_operations file_ops_mac_4 = {
225 .open = dl_proc_open_mac_4,
228 .release = seq_release,
231 static int rtl_proc_get_mac_5(struct seq_file *m, void *v)
233 struct ieee80211_hw *hw = m->private;
234 struct rtl_priv *rtlpriv = rtl_priv(hw);
239 for (n = 0; n <= max; ) {
240 seq_printf(m, "\n%8.8x ", n + page);
241 for (i = 0; i < 4 && n <= max; i++, n += 4)
242 seq_printf(m, "%8.8x ",
243 rtl_read_dword(rtlpriv, (page | n)));
249 static int dl_proc_open_mac_5(struct inode *inode, struct file *file)
251 return single_open(file, rtl_proc_get_mac_5, GET_INODE_DATA(inode));
254 static const struct file_operations file_ops_mac_5 = {
255 .open = dl_proc_open_mac_5,
258 .release = seq_release,
261 static int rtl_proc_get_mac_6(struct seq_file *m, void *v)
263 struct ieee80211_hw *hw = m->private;
264 struct rtl_priv *rtlpriv = rtl_priv(hw);
269 for (n = 0; n <= max; ) {
270 seq_printf(m, "\n%8.8x ", n + page);
271 for (i = 0; i < 4 && n <= max; i++, n += 4)
272 seq_printf(m, "%8.8x ",
273 rtl_read_dword(rtlpriv, (page | n)));
279 static int dl_proc_open_mac_6(struct inode *inode, struct file *file)
281 return single_open(file, rtl_proc_get_mac_6, GET_INODE_DATA(inode));
284 static const struct file_operations file_ops_mac_6 = {
285 .open = dl_proc_open_mac_6,
288 .release = seq_release,
291 static int rtl_proc_get_mac_7(struct seq_file *m, void *v)
293 struct ieee80211_hw *hw = m->private;
294 struct rtl_priv *rtlpriv = rtl_priv(hw);
299 for (n = 0; n <= max; ) {
300 seq_printf(m, "\n%8.8x ", n + page);
301 for (i = 0; i < 4 && n <= max; i++, n += 4)
302 seq_printf(m, "%8.8x ",
303 rtl_read_dword(rtlpriv, (page | n)));
309 static int dl_proc_open_mac_7(struct inode *inode, struct file *file)
311 return single_open(file, rtl_proc_get_mac_7, GET_INODE_DATA(inode));
314 static const struct file_operations file_ops_mac_7 = {
315 .open = dl_proc_open_mac_7,
318 .release = seq_release,
321 static int rtl_proc_get_bb_8(struct seq_file *m, void *v)
323 struct ieee80211_hw *hw = m->private;
328 for (n = 0; n <= max; ) {
329 seq_printf(m, "\n%8.8x ", n + page);
330 for (i = 0; i < 4 && n <= max; i++, n += 4)
331 seq_printf(m, "%8.8x ",
332 rtl_get_bbreg(hw, (page | n), 0xffffffff));
338 static int dl_proc_open_bb_8(struct inode *inode, struct file *file)
340 return single_open(file, rtl_proc_get_bb_8, GET_INODE_DATA(inode));
343 static const struct file_operations file_ops_bb_8 = {
344 .open = dl_proc_open_bb_8,
347 .release = seq_release,
350 static int rtl_proc_get_bb_9(struct seq_file *m, void *v)
352 struct ieee80211_hw *hw = m->private;
357 for (n = 0; n <= max; ) {
358 seq_printf(m, "\n%8.8x ", n + page);
359 for (i = 0; i < 4 && n <= max; i++, n += 4)
360 seq_printf(m, "%8.8x ",
361 rtl_get_bbreg(hw, (page | n), 0xffffffff));
367 static int dl_proc_open_bb_9(struct inode *inode, struct file *file)
369 return single_open(file, rtl_proc_get_bb_9, GET_INODE_DATA(inode));
372 static const struct file_operations file_ops_bb_9 = {
373 .open = dl_proc_open_bb_9,
376 .release = seq_release,
379 static int rtl_proc_get_bb_a(struct seq_file *m, void *v)
381 struct ieee80211_hw *hw = m->private;
386 for (n = 0; n <= max; ) {
387 seq_printf(m, "\n%8.8x ", n + page);
388 for (i = 0; i < 4 && n <= max; i++, n += 4)
389 seq_printf(m, "%8.8x ",
390 rtl_get_bbreg(hw, (page | n), 0xffffffff));
396 static int dl_proc_open_bb_a(struct inode *inode, struct file *file)
398 return single_open(file, rtl_proc_get_bb_a, GET_INODE_DATA(inode));
401 static const struct file_operations file_ops_bb_a = {
402 .open = dl_proc_open_bb_a,
405 .release = seq_release,
408 static int rtl_proc_get_bb_b(struct seq_file *m, void *v)
410 struct ieee80211_hw *hw = m->private;
415 for (n = 0; n <= max; ) {
416 seq_printf(m, "\n%8.8x ", n + page);
417 for (i = 0; i < 4 && n <= max; i++, n += 4)
418 seq_printf(m, "%8.8x ",
419 rtl_get_bbreg(hw, (page | n), 0xffffffff));
425 static int dl_proc_open_bb_b(struct inode *inode, struct file *file)
427 return single_open(file, rtl_proc_get_bb_b, GET_INODE_DATA(inode));
430 static const struct file_operations file_ops_bb_b = {
431 .open = dl_proc_open_bb_b,
434 .release = seq_release,
437 static int rtl_proc_get_bb_c(struct seq_file *m, void *v)
439 struct ieee80211_hw *hw = m->private;
444 for (n = 0; n <= max; ) {
445 seq_printf(m, "\n%8.8x ", n + page);
446 for (i = 0; i < 4 && n <= max; i++, n += 4)
447 seq_printf(m, "%8.8x ",
448 rtl_get_bbreg(hw, (page | n), 0xffffffff));
454 static int dl_proc_open_bb_c(struct inode *inode, struct file *file)
456 return single_open(file, rtl_proc_get_bb_c, GET_INODE_DATA(inode));
459 static const struct file_operations file_ops_bb_c = {
460 .open = dl_proc_open_bb_c,
463 .release = seq_release,
466 static int rtl_proc_get_bb_d(struct seq_file *m, void *v)
468 struct ieee80211_hw *hw = m->private;
473 for (n = 0; n <= max; ) {
474 seq_printf(m, "\n%8.8x ", n + page);
475 for (i = 0; i < 4 && n <= max; i++, n += 4)
476 seq_printf(m, "%8.8x ",
477 rtl_get_bbreg(hw, (page | n), 0xffffffff));
483 static int dl_proc_open_bb_d(struct inode *inode, struct file *file)
485 return single_open(file, rtl_proc_get_bb_d, GET_INODE_DATA(inode));
488 static const struct file_operations file_ops_bb_d = {
489 .open = dl_proc_open_bb_d,
492 .release = seq_release,
495 static int rtl_proc_get_bb_e(struct seq_file *m, void *v)
497 struct ieee80211_hw *hw = m->private;
502 for (n = 0; n <= max; ) {
503 seq_printf(m, "\n%8.8x ", n + page);
504 for (i = 0; i < 4 && n <= max; i++, n += 4)
505 seq_printf(m, "%8.8x ",
506 rtl_get_bbreg(hw, (page | n), 0xffffffff));
512 static int dl_proc_open_bb_e(struct inode *inode, struct file *file)
514 return single_open(file, rtl_proc_get_bb_e, GET_INODE_DATA(inode));
517 static const struct file_operations file_ops_bb_e = {
518 .open = dl_proc_open_bb_e,
521 .release = seq_release,
524 static int rtl_proc_get_bb_f(struct seq_file *m, void *v)
526 struct ieee80211_hw *hw = m->private;
531 for (n = 0; n <= max; ) {
532 seq_printf(m, "\n%8.8x ", n + page);
533 for (i = 0; i < 4 && n <= max; i++, n += 4)
534 seq_printf(m, "%8.8x ",
535 rtl_get_bbreg(hw, (page | n), 0xffffffff));
541 static int dl_proc_open_bb_f(struct inode *inode, struct file *file)
543 return single_open(file, rtl_proc_get_bb_f, GET_INODE_DATA(inode));
546 static const struct file_operations file_ops_bb_f = {
547 .open = dl_proc_open_bb_f,
550 .release = seq_release,
553 static int rtl_proc_get_reg_rf_a(struct seq_file *m, void *v)
555 struct ieee80211_hw *hw = m->private;
559 for (n = 0; n <= max; ) {
560 seq_printf(m, "\n%8.8x ", n);
561 for (i = 0; i < 4 && n <= max; n += 1, i++)
562 seq_printf(m, "%8.8x ",
563 rtl_get_rfreg(hw, RF90_PATH_A, n, 0xffffffff));
569 static int dl_proc_open_rf_a(struct inode *inode, struct file *file)
571 return single_open(file, rtl_proc_get_reg_rf_a, GET_INODE_DATA(inode));
574 static const struct file_operations file_ops_rf_a = {
575 .open = dl_proc_open_rf_a,
578 .release = seq_release,
581 static int rtl_proc_get_reg_rf_b(struct seq_file *m, void *v)
583 struct ieee80211_hw *hw = m->private;
587 for (n = 0; n <= max; ) {
588 seq_printf(m, "\n%8.8x ", n);
589 for (i = 0; i < 4 && n <= max; n += 1, i++)
590 seq_printf(m, "%8.8x ",
591 rtl_get_rfreg(hw, RF90_PATH_B, n,
598 static int dl_proc_open_rf_b(struct inode *inode, struct file *file)
600 return single_open(file, rtl_proc_get_reg_rf_b, GET_INODE_DATA(inode));
603 static const struct file_operations file_ops_rf_b = {
604 .open = dl_proc_open_rf_b,
607 .release = seq_release,
610 static int rtl_proc_get_cam_register_1(struct seq_file *m, void *v)
612 struct ieee80211_hw *hw = m->private;
613 struct rtl_priv *rtlpriv = rtl_priv(hw);
620 /* This dump the current register page */
622 "\n#################### SECURITY CAM (0-10) ##################\n ");
624 for (j = 0; j < 11; j++) {
625 seq_printf(m, "\nD: %2x > ", j);
626 for (entry_i = 0; entry_i < CAM_CONTENT_COUNT; entry_i++) {
627 /* polling bit, and No Write enable, and address */
628 target_cmd = entry_i + CAM_CONTENT_COUNT * j;
629 target_cmd = target_cmd | BIT(31);
631 /* Check polling bit is clear */
633 ulstatus = rtl_read_dword(rtlpriv,
634 rtlpriv->cfg->maps[RWCAM]);
635 if (ulstatus & BIT(31)) {
642 rtl_write_dword(rtlpriv, rtlpriv->cfg->maps[RWCAM],
644 target_val = rtl_read_dword(rtlpriv,
645 rtlpriv->cfg->maps[RCAMO]);
646 seq_printf(m, "%8.8x ", target_val);
653 static int dl_proc_open_cam_1(struct inode *inode, struct file *file)
655 return single_open(file, rtl_proc_get_cam_register_1,
656 GET_INODE_DATA(inode));
659 static const struct file_operations file_ops_cam_1 = {
660 .open = dl_proc_open_cam_1,
663 .release = seq_release,
666 static int rtl_proc_get_cam_register_2(struct seq_file *m, void *v)
668 struct ieee80211_hw *hw = m->private;
669 struct rtl_priv *rtlpriv = rtl_priv(hw);
676 /* This dump the current register page */
678 "\n################### SECURITY CAM (11-21) ##################\n ");
680 for (j = 11; j < 22; j++) {
681 seq_printf(m, "\nD: %2x > ", j);
682 for (entry_i = 0; entry_i < CAM_CONTENT_COUNT; entry_i++) {
683 target_cmd = entry_i + CAM_CONTENT_COUNT * j;
684 target_cmd = target_cmd | BIT(31);
687 ulstatus = rtl_read_dword(rtlpriv,
688 rtlpriv->cfg->maps[RWCAM]);
689 if (ulstatus & BIT(31)) {
696 rtl_write_dword(rtlpriv, rtlpriv->cfg->maps[RWCAM],
698 target_val = rtl_read_dword(rtlpriv,
699 rtlpriv->cfg->maps[RCAMO]);
700 seq_printf(m, "%8.8x ", target_val);
707 static int dl_proc_open_cam_2(struct inode *inode, struct file *file)
709 return single_open(file, rtl_proc_get_cam_register_2,
710 GET_INODE_DATA(inode));
713 static const struct file_operations file_ops_cam_2 = {
714 .open = dl_proc_open_cam_2,
717 .release = seq_release,
720 static int rtl_proc_get_cam_register_3(struct seq_file *m, void *v)
722 struct ieee80211_hw *hw = m->private;
723 struct rtl_priv *rtlpriv = rtl_priv(hw);
730 /* This dump the current register page */
732 "\n################### SECURITY CAM (22-31) ##################\n ");
734 for (j = 22; j < TOTAL_CAM_ENTRY; j++) {
735 seq_printf(m, "\nD: %2x > ", j);
736 for (entry_i = 0; entry_i < CAM_CONTENT_COUNT; entry_i++) {
737 target_cmd = entry_i+CAM_CONTENT_COUNT*j;
738 target_cmd = target_cmd | BIT(31);
741 ulstatus = rtl_read_dword(rtlpriv,
742 rtlpriv->cfg->maps[RWCAM]);
743 if (ulstatus & BIT(31)) {
750 rtl_write_dword(rtlpriv, rtlpriv->cfg->maps[RWCAM],
752 target_val = rtl_read_dword(rtlpriv,
753 rtlpriv->cfg->maps[RCAMO]);
754 seq_printf(m, "%8.8x ", target_val);
761 static int dl_proc_open_cam_3(struct inode *inode, struct file *file)
763 return single_open(file, rtl_proc_get_cam_register_3,
764 GET_INODE_DATA(inode));
767 static const struct file_operations file_ops_cam_3 = {
768 .open = dl_proc_open_cam_3,
771 .release = seq_release,
774 void rtl_proc_add_one(struct ieee80211_hw *hw)
776 struct rtl_priv *rtlpriv = rtl_priv(hw);
777 struct rtl_efuse *rtlefuse = rtl_efuse(rtl_priv(hw));
778 struct proc_dir_entry *entry;
780 snprintf(rtlpriv->dbg.proc_name, 18, "%x-%x-%x-%x-%x-%x",
781 rtlefuse->dev_addr[0], rtlefuse->dev_addr[1],
782 rtlefuse->dev_addr[2], rtlefuse->dev_addr[3],
783 rtlefuse->dev_addr[4], rtlefuse->dev_addr[5]);
785 rtlpriv->dbg.proc_dir = proc_mkdir(rtlpriv->dbg.proc_name, proc_topdir);
786 if (!rtlpriv->dbg.proc_dir) {
787 RT_TRACE(COMP_INIT, DBG_EMERG, ("Unable to init "
788 "/proc/net/%s/%s\n", rtlpriv->cfg->name,
789 rtlpriv->dbg.proc_name));
793 entry = proc_create_data("mac-0", S_IFREG | S_IRUGO,
794 rtlpriv->dbg.proc_dir, &file_ops_mac_0, hw);
796 RT_TRACE(COMP_INIT, DBG_EMERG,
797 ("Unable to initialize /proc/net/%s/%s/mac-0\n",
798 rtlpriv->cfg->name, rtlpriv->dbg.proc_name));
800 entry = proc_create_data("mac-1", S_IFREG | S_IRUGO,
801 rtlpriv->dbg.proc_dir, &file_ops_mac_1, hw);
803 RT_TRACE(COMP_INIT, COMP_ERR,
804 ("Unable to initialize /proc/net/%s/%s/mac-1\n",
805 rtlpriv->cfg->name, rtlpriv->dbg.proc_name));
807 entry = proc_create_data("mac-2", S_IFREG | S_IRUGO,
808 rtlpriv->dbg.proc_dir, &file_ops_mac_2, hw);
810 RT_TRACE(COMP_INIT, COMP_ERR,
811 ("Unable to initialize /proc/net/%s/%s/mac-2\n",
812 rtlpriv->cfg->name, rtlpriv->dbg.proc_name));
814 entry = proc_create_data("mac-3", S_IFREG | S_IRUGO,
815 rtlpriv->dbg.proc_dir, &file_ops_mac_3, hw);
817 RT_TRACE(COMP_INIT, COMP_ERR,
818 ("Unable to initialize /proc/net/%s/%s/mac-3\n",
819 rtlpriv->cfg->name, rtlpriv->dbg.proc_name));
821 entry = proc_create_data("mac-4", S_IFREG | S_IRUGO,
822 rtlpriv->dbg.proc_dir, &file_ops_mac_4, hw);
824 RT_TRACE(COMP_INIT, COMP_ERR,
825 ("Unable to initialize /proc/net/%s/%s/mac-4\n",
826 rtlpriv->cfg->name, rtlpriv->dbg.proc_name));
828 entry = proc_create_data("mac-5", S_IFREG | S_IRUGO,
829 rtlpriv->dbg.proc_dir, &file_ops_mac_5, hw);
831 RT_TRACE(COMP_INIT, COMP_ERR,
832 ("Unable to initialize /proc/net/%s/%s/mac-5\n",
833 rtlpriv->cfg->name, rtlpriv->dbg.proc_name));
835 entry = proc_create_data("mac-6", S_IFREG | S_IRUGO,
836 rtlpriv->dbg.proc_dir, &file_ops_mac_6, hw);
838 RT_TRACE(COMP_INIT, COMP_ERR,
839 ("Unable to initialize /proc/net/%s/%s/mac-6\n",
840 rtlpriv->cfg->name, rtlpriv->dbg.proc_name));
842 entry = proc_create_data("mac-7", S_IFREG | S_IRUGO,
843 rtlpriv->dbg.proc_dir, &file_ops_mac_7, hw);
845 RT_TRACE(COMP_INIT, COMP_ERR,
846 ("Unable to initialize /proc/net/%s/%s/mac-7\n",
847 rtlpriv->cfg->name, rtlpriv->dbg.proc_name));
849 entry = proc_create_data("bb-8", S_IFREG | S_IRUGO,
850 rtlpriv->dbg.proc_dir, &file_ops_bb_8, hw);
852 RT_TRACE(COMP_INIT, COMP_ERR,
853 ("Unable to initialize /proc/net/%s/%s/bb-8\n",
854 rtlpriv->cfg->name, rtlpriv->dbg.proc_name));
856 entry = proc_create_data("bb-9", S_IFREG | S_IRUGO,
857 rtlpriv->dbg.proc_dir, &file_ops_bb_9, hw);
859 RT_TRACE(COMP_INIT, COMP_ERR,
860 ("Unable to initialize /proc/net/%s/%s/bb-9\n",
861 rtlpriv->cfg->name, rtlpriv->dbg.proc_name));
863 entry = proc_create_data("bb-a", S_IFREG | S_IRUGO,
864 rtlpriv->dbg.proc_dir, &file_ops_bb_a, hw);
866 RT_TRACE(COMP_INIT, COMP_ERR,
867 ("Unable to initialize /proc/net/%s/%s/bb-a\n",
868 rtlpriv->cfg->name, rtlpriv->dbg.proc_name));
870 entry = proc_create_data("bb-b", S_IFREG | S_IRUGO,
871 rtlpriv->dbg.proc_dir, &file_ops_bb_b, hw);
873 RT_TRACE(COMP_INIT, COMP_ERR,
874 ("Unable to initialize /proc/net/%s/%s/bb-b\n",
875 rtlpriv->cfg->name, rtlpriv->dbg.proc_name));
877 entry = proc_create_data("bb-c", S_IFREG | S_IRUGO,
878 rtlpriv->dbg.proc_dir, &file_ops_bb_c, hw);
880 RT_TRACE(COMP_INIT, COMP_ERR,
881 ("Unable to initialize /proc/net/%s/%s/bb-c\n",
882 rtlpriv->cfg->name, rtlpriv->dbg.proc_name));
884 entry = proc_create_data("bb-d", S_IFREG | S_IRUGO,
885 rtlpriv->dbg.proc_dir, &file_ops_bb_d, hw);
887 RT_TRACE(COMP_INIT, COMP_ERR,
888 ("Unable to initialize /proc/net/%s/%s/bb-d\n",
889 rtlpriv->cfg->name, rtlpriv->dbg.proc_name));
891 entry = proc_create_data("bb-e", S_IFREG | S_IRUGO,
892 rtlpriv->dbg.proc_dir, &file_ops_bb_e, hw);
894 RT_TRACE(COMP_INIT, COMP_ERR,
895 ("Unable to initialize /proc/net/%s/%s/bb-e\n",
896 rtlpriv->cfg->name, rtlpriv->dbg.proc_name));
898 entry = proc_create_data("bb-f", S_IFREG | S_IRUGO,
899 rtlpriv->dbg.proc_dir, &file_ops_bb_f, hw);
901 RT_TRACE(COMP_INIT, COMP_ERR,
902 ("Unable to initialize /proc/net/%s/%s/bb-f\n",
903 rtlpriv->cfg->name, rtlpriv->dbg.proc_name));
905 entry = proc_create_data("rf-a", S_IFREG | S_IRUGO,
906 rtlpriv->dbg.proc_dir, &file_ops_rf_a, hw);
908 RT_TRACE(COMP_INIT, COMP_ERR,
909 ("Unable to initialize /proc/net/%s/%s/rf-a\n",
910 rtlpriv->cfg->name, rtlpriv->dbg.proc_name));
912 entry = proc_create_data("rf-b", S_IFREG | S_IRUGO,
913 rtlpriv->dbg.proc_dir, &file_ops_rf_b, hw);
915 RT_TRACE(COMP_INIT, COMP_ERR,
916 ("Unable to initialize /proc/net/%s/%s/rf-b\n",
917 rtlpriv->cfg->name, rtlpriv->dbg.proc_name));
919 entry = proc_create_data("cam-1", S_IFREG | S_IRUGO,
920 rtlpriv->dbg.proc_dir, &file_ops_cam_1, hw);
922 RT_TRACE(COMP_INIT, COMP_ERR,
923 ("Unable to initialize /proc/net/%s/%s/cam-1\n",
924 rtlpriv->cfg->name, rtlpriv->dbg.proc_name));
926 entry = proc_create_data("cam-2", S_IFREG | S_IRUGO,
927 rtlpriv->dbg.proc_dir, &file_ops_cam_2, hw);
929 RT_TRACE(COMP_INIT, COMP_ERR,
930 ("Unable to initialize /proc/net/%s/%s/cam-2\n",
931 rtlpriv->cfg->name, rtlpriv->dbg.proc_name));
933 entry = proc_create_data("cam-3", S_IFREG | S_IRUGO,
934 rtlpriv->dbg.proc_dir, &file_ops_cam_3, hw);
936 RT_TRACE(COMP_INIT, COMP_ERR,
937 ("Unable to initialize /proc/net/%s/%s/cam-3\n",
938 rtlpriv->cfg->name, rtlpriv->dbg.proc_name));
941 void rtl_proc_remove_one(struct ieee80211_hw *hw)
943 struct rtl_priv *rtlpriv = rtl_priv(hw);
945 if (rtlpriv->dbg.proc_dir) {
946 remove_proc_entry("mac-0", rtlpriv->dbg.proc_dir);
947 remove_proc_entry("mac-1", rtlpriv->dbg.proc_dir);
948 remove_proc_entry("mac-2", rtlpriv->dbg.proc_dir);
949 remove_proc_entry("mac-3", rtlpriv->dbg.proc_dir);
950 remove_proc_entry("mac-4", rtlpriv->dbg.proc_dir);
951 remove_proc_entry("mac-5", rtlpriv->dbg.proc_dir);
952 remove_proc_entry("mac-6", rtlpriv->dbg.proc_dir);
953 remove_proc_entry("mac-7", rtlpriv->dbg.proc_dir);
954 remove_proc_entry("bb-8", rtlpriv->dbg.proc_dir);
955 remove_proc_entry("bb-9", rtlpriv->dbg.proc_dir);
956 remove_proc_entry("bb-a", rtlpriv->dbg.proc_dir);
957 remove_proc_entry("bb-b", rtlpriv->dbg.proc_dir);
958 remove_proc_entry("bb-c", rtlpriv->dbg.proc_dir);
959 remove_proc_entry("bb-d", rtlpriv->dbg.proc_dir);
960 remove_proc_entry("bb-e", rtlpriv->dbg.proc_dir);
961 remove_proc_entry("bb-f", rtlpriv->dbg.proc_dir);
962 remove_proc_entry("rf-a", rtlpriv->dbg.proc_dir);
963 remove_proc_entry("rf-b", rtlpriv->dbg.proc_dir);
964 remove_proc_entry("cam-1", rtlpriv->dbg.proc_dir);
965 remove_proc_entry("cam-2", rtlpriv->dbg.proc_dir);
966 remove_proc_entry("cam-3", rtlpriv->dbg.proc_dir);
968 remove_proc_entry(rtlpriv->dbg.proc_name, proc_topdir);
970 rtlpriv->dbg.proc_dir = NULL;
974 void rtl_proc_add_topdir(void)
976 proc_topdir = proc_mkdir("rtlwifi", init_net.proc_net);
979 void rtl_proc_remove_topdir(void)
982 remove_proc_entry("rtlwifi", init_net.proc_net);