| .. | .. |
|---|
| 1 | | -/****************************************************************************** |
|---|
| 2 | | - * |
|---|
| 3 | | - * Copyright(c) 2009-2014 Realtek Corporation. |
|---|
| 4 | | - * |
|---|
| 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. |
|---|
| 8 | | - * |
|---|
| 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 |
|---|
| 12 | | - * more details. |
|---|
| 13 | | - * |
|---|
| 14 | | - * The full GNU General Public License is included in this distribution in the |
|---|
| 15 | | - * file called LICENSE. |
|---|
| 16 | | - * |
|---|
| 17 | | - * Contact Information: |
|---|
| 18 | | - * wlanfae <wlanfae@realtek.com> |
|---|
| 19 | | - * Realtek Corporation, No. 2, Innovation Road II, Hsinchu Science Park, |
|---|
| 20 | | - * Hsinchu 300, Taiwan. |
|---|
| 21 | | - * |
|---|
| 22 | | - * Larry Finger <Larry.Finger@lwfinger.net> |
|---|
| 23 | | - * |
|---|
| 24 | | - *****************************************************************************/ |
|---|
| 1 | +// SPDX-License-Identifier: GPL-2.0 |
|---|
| 2 | +/* Copyright(c) 2009-2014 Realtek Corporation.*/ |
|---|
| 25 | 3 | |
|---|
| 26 | 4 | #include "../wifi.h" |
|---|
| 27 | 5 | #include "../pci.h" |
|---|
| .. | .. |
|---|
| 63 | 41 | unsigned long flag; |
|---|
| 64 | 42 | u8 idx; |
|---|
| 65 | 43 | |
|---|
| 66 | | - RT_TRACE(rtlpriv, COMP_CMD, DBG_LOUD, "come in\n"); |
|---|
| 44 | + rtl_dbg(rtlpriv, COMP_CMD, DBG_LOUD, "come in\n"); |
|---|
| 67 | 45 | |
|---|
| 68 | 46 | while (true) { |
|---|
| 69 | 47 | spin_lock_irqsave(&rtlpriv->locks.h2c_lock, flag); |
|---|
| 70 | 48 | if (rtlhal->h2c_setinprogress) { |
|---|
| 71 | | - RT_TRACE(rtlpriv, COMP_CMD, DBG_LOUD, |
|---|
| 72 | | - "H2C set in progress! Wait to set..element_id(%d).\n", |
|---|
| 73 | | - element_id); |
|---|
| 49 | + rtl_dbg(rtlpriv, COMP_CMD, DBG_LOUD, |
|---|
| 50 | + "H2C set in progress! Wait to set..element_id(%d).\n", |
|---|
| 51 | + element_id); |
|---|
| 74 | 52 | |
|---|
| 75 | 53 | while (rtlhal->h2c_setinprogress) { |
|---|
| 76 | 54 | spin_unlock_irqrestore(&rtlpriv->locks.h2c_lock, |
|---|
| 77 | 55 | flag); |
|---|
| 78 | 56 | h2c_waitcounter++; |
|---|
| 79 | | - RT_TRACE(rtlpriv, COMP_CMD, DBG_LOUD, |
|---|
| 80 | | - "Wait 100 us (%d times)...\n", |
|---|
| 81 | | - h2c_waitcounter); |
|---|
| 57 | + rtl_dbg(rtlpriv, COMP_CMD, DBG_LOUD, |
|---|
| 58 | + "Wait 100 us (%d times)...\n", |
|---|
| 59 | + h2c_waitcounter); |
|---|
| 82 | 60 | udelay(100); |
|---|
| 83 | 61 | |
|---|
| 84 | 62 | if (h2c_waitcounter > 1000) |
|---|
| .. | .. |
|---|
| 129 | 107 | while (!isfw_read) { |
|---|
| 130 | 108 | wait_h2c_limmit--; |
|---|
| 131 | 109 | if (wait_h2c_limmit == 0) { |
|---|
| 132 | | - RT_TRACE(rtlpriv, COMP_CMD, DBG_LOUD, |
|---|
| 133 | | - "Waiting too long for FW read clear HMEBox(%d)!\n", |
|---|
| 134 | | - boxnum); |
|---|
| 110 | + rtl_dbg(rtlpriv, COMP_CMD, DBG_LOUD, |
|---|
| 111 | + "Waiting too long for FW read clear HMEBox(%d)!\n", |
|---|
| 112 | + boxnum); |
|---|
| 135 | 113 | break; |
|---|
| 136 | 114 | } |
|---|
| 137 | 115 | |
|---|
| .. | .. |
|---|
| 140 | 118 | isfw_read = _rtl8723be_check_fw_read_last_h2c(hw, |
|---|
| 141 | 119 | boxnum); |
|---|
| 142 | 120 | u1b_tmp = rtl_read_byte(rtlpriv, 0x130); |
|---|
| 143 | | - RT_TRACE(rtlpriv, COMP_CMD, DBG_LOUD, |
|---|
| 144 | | - "Waiting for FW read clear HMEBox(%d)!!! 0x130 = %2x\n", |
|---|
| 145 | | - boxnum, u1b_tmp); |
|---|
| 121 | + rtl_dbg(rtlpriv, COMP_CMD, DBG_LOUD, |
|---|
| 122 | + "Waiting for FW read clear HMEBox(%d)!!! 0x130 = %2x\n", |
|---|
| 123 | + boxnum, u1b_tmp); |
|---|
| 146 | 124 | } |
|---|
| 147 | 125 | |
|---|
| 148 | 126 | if (!isfw_read) { |
|---|
| 149 | | - RT_TRACE(rtlpriv, COMP_CMD, DBG_LOUD, |
|---|
| 150 | | - "Write H2C register BOX[%d] fail!!!!! Fw do not read.\n", |
|---|
| 151 | | - boxnum); |
|---|
| 127 | + rtl_dbg(rtlpriv, COMP_CMD, DBG_LOUD, |
|---|
| 128 | + "Write H2C register BOX[%d] fail!!!!! Fw do not read.\n", |
|---|
| 129 | + boxnum); |
|---|
| 152 | 130 | break; |
|---|
| 153 | 131 | } |
|---|
| 154 | 132 | |
|---|
| 155 | 133 | memset(boxcontent, 0, sizeof(boxcontent)); |
|---|
| 156 | 134 | memset(boxextcontent, 0, sizeof(boxextcontent)); |
|---|
| 157 | 135 | boxcontent[0] = element_id; |
|---|
| 158 | | - RT_TRACE(rtlpriv, COMP_CMD, DBG_LOUD, |
|---|
| 159 | | - "Write element_id box_reg(%4x) = %2x\n", |
|---|
| 160 | | - box_reg, element_id); |
|---|
| 136 | + rtl_dbg(rtlpriv, COMP_CMD, DBG_LOUD, |
|---|
| 137 | + "Write element_id box_reg(%4x) = %2x\n", |
|---|
| 138 | + box_reg, element_id); |
|---|
| 161 | 139 | |
|---|
| 162 | 140 | switch (cmd_len) { |
|---|
| 163 | 141 | case 1: |
|---|
| .. | .. |
|---|
| 204 | 182 | if (rtlhal->last_hmeboxnum == 4) |
|---|
| 205 | 183 | rtlhal->last_hmeboxnum = 0; |
|---|
| 206 | 184 | |
|---|
| 207 | | - RT_TRACE(rtlpriv, COMP_CMD, DBG_LOUD, |
|---|
| 208 | | - "pHalData->last_hmeboxnum = %d\n", |
|---|
| 209 | | - rtlhal->last_hmeboxnum); |
|---|
| 185 | + rtl_dbg(rtlpriv, COMP_CMD, DBG_LOUD, |
|---|
| 186 | + "pHalData->last_hmeboxnum = %d\n", |
|---|
| 187 | + rtlhal->last_hmeboxnum); |
|---|
| 210 | 188 | } |
|---|
| 211 | 189 | |
|---|
| 212 | 190 | spin_lock_irqsave(&rtlpriv->locks.h2c_lock, flag); |
|---|
| 213 | 191 | rtlhal->h2c_setinprogress = false; |
|---|
| 214 | 192 | spin_unlock_irqrestore(&rtlpriv->locks.h2c_lock, flag); |
|---|
| 215 | 193 | |
|---|
| 216 | | - RT_TRACE(rtlpriv, COMP_CMD, DBG_LOUD, "go out\n"); |
|---|
| 194 | + rtl_dbg(rtlpriv, COMP_CMD, DBG_LOUD, "go out\n"); |
|---|
| 217 | 195 | } |
|---|
| 218 | 196 | |
|---|
| 219 | 197 | void rtl8723be_fill_h2c_cmd(struct ieee80211_hw *hw, u8 element_id, |
|---|
| .. | .. |
|---|
| 251 | 229 | if (bt_ctrl_lps) |
|---|
| 252 | 230 | mode = (bt_lps_on ? FW_PS_MIN_MODE : FW_PS_ACTIVE_MODE); |
|---|
| 253 | 231 | |
|---|
| 254 | | - RT_TRACE(rtlpriv, COMP_POWER, DBG_DMESG, "FW LPS mode = %d (coex:%d)\n", |
|---|
| 255 | | - mode, bt_ctrl_lps); |
|---|
| 232 | + rtl_dbg(rtlpriv, COMP_POWER, DBG_DMESG, "FW LPS mode = %d (coex:%d)\n", |
|---|
| 233 | + mode, bt_ctrl_lps); |
|---|
| 256 | 234 | |
|---|
| 257 | 235 | switch (mode) { |
|---|
| 258 | 236 | case FW_PS_MIN_MODE: |
|---|
| .. | .. |
|---|
| 594 | 572 | b_dlok = true; |
|---|
| 595 | 573 | |
|---|
| 596 | 574 | if (b_dlok) { |
|---|
| 597 | | - RT_TRACE(rtlpriv, COMP_POWER, DBG_LOUD, |
|---|
| 598 | | - "Set RSVD page location to Fw.\n"); |
|---|
| 575 | + rtl_dbg(rtlpriv, COMP_POWER, DBG_LOUD, |
|---|
| 576 | + "Set RSVD page location to Fw.\n"); |
|---|
| 599 | 577 | RT_PRINT_DATA(rtlpriv, COMP_CMD, DBG_DMESG, "H2C_RSVDPAGE:\n", |
|---|
| 600 | 578 | u1rsvdpageloc, sizeof(u1rsvdpageloc)); |
|---|
| 601 | 579 | rtl8723be_fill_h2c_cmd(hw, H2C_8723B_RSVDPAGE, |
|---|
| 602 | 580 | sizeof(u1rsvdpageloc), u1rsvdpageloc); |
|---|
| 603 | 581 | } else |
|---|
| 604 | | - RT_TRACE(rtlpriv, COMP_ERR, DBG_WARNING, |
|---|
| 605 | | - "Set RSVD page location to Fw FAIL!!!!!!.\n"); |
|---|
| 582 | + rtl_dbg(rtlpriv, COMP_ERR, DBG_WARNING, |
|---|
| 583 | + "Set RSVD page location to Fw FAIL!!!!!!.\n"); |
|---|
| 606 | 584 | } |
|---|
| 607 | 585 | |
|---|
| 608 | 586 | /*Should check FW support p2p or not.*/ |
|---|
| .. | .. |
|---|
| 629 | 607 | |
|---|
| 630 | 608 | switch (p2p_ps_state) { |
|---|
| 631 | 609 | case P2P_PS_DISABLE: |
|---|
| 632 | | - RT_TRACE(rtlpriv, COMP_FW, DBG_LOUD, "P2P_PS_DISABLE\n"); |
|---|
| 610 | + rtl_dbg(rtlpriv, COMP_FW, DBG_LOUD, "P2P_PS_DISABLE\n"); |
|---|
| 633 | 611 | memset(p2p_ps_offload, 0, sizeof(*p2p_ps_offload)); |
|---|
| 634 | 612 | break; |
|---|
| 635 | 613 | case P2P_PS_ENABLE: |
|---|
| 636 | | - RT_TRACE(rtlpriv, COMP_FW, DBG_LOUD, "P2P_PS_ENABLE\n"); |
|---|
| 614 | + rtl_dbg(rtlpriv, COMP_FW, DBG_LOUD, "P2P_PS_ENABLE\n"); |
|---|
| 637 | 615 | /* update CTWindow value. */ |
|---|
| 638 | 616 | if (p2pinfo->ctwindow > 0) { |
|---|
| 639 | 617 | p2p_ps_offload->ctwindow_en = 1; |
|---|
| .. | .. |
|---|
| 690 | 668 | } |
|---|
| 691 | 669 | break; |
|---|
| 692 | 670 | case P2P_PS_SCAN: |
|---|
| 693 | | - RT_TRACE(rtlpriv, COMP_FW, DBG_LOUD, "P2P_PS_SCAN\n"); |
|---|
| 671 | + rtl_dbg(rtlpriv, COMP_FW, DBG_LOUD, "P2P_PS_SCAN\n"); |
|---|
| 694 | 672 | p2p_ps_offload->discovery = 1; |
|---|
| 695 | 673 | break; |
|---|
| 696 | 674 | case P2P_PS_SCAN_DONE: |
|---|
| 697 | | - RT_TRACE(rtlpriv, COMP_FW, DBG_LOUD, "P2P_PS_SCAN_DONE\n"); |
|---|
| 675 | + rtl_dbg(rtlpriv, COMP_FW, DBG_LOUD, "P2P_PS_SCAN_DONE\n"); |
|---|
| 698 | 676 | p2p_ps_offload->discovery = 0; |
|---|
| 699 | 677 | p2pinfo->p2p_ps_state = P2P_PS_ENABLE; |
|---|
| 700 | 678 | break; |
|---|