Remove include/odm_debug.h in its entirety. To do this, first:
(1) Remove DebugLevel and DebugComponents members from the struct
    odm_dm_struct definition, and any uses of these elsewhere in
    the driver.
(2) Remove the function ODM_InitDebugSetting from hal/odm_debug.c
    whilst leaving the file in place for now as it contains a global
    which is still used and will be removed by further cleanup code.
    Also remove all of its callers. All the function does is set the
    members mentioned above.
(3) Remove the now redundant constants and their usages:
    ODM_CMNINFO_DBG_LEVEL
    ODM_CMNINFO_DBG_COMP
    HW_DEF_ODM_DBG_FLAG
    HW_DEF_FA_CNT_DUMP
    This includes usage within a few hexadecimal ioctl switch cases
    in os_dep/ioctl_linux.c (although only the call itself within
    0x11 as it contains additional code currently).
(4) Finally, remove the file itself and its inclusion within
    include/odm_precomp.h, as none of the remaining content is used
    from anywhere else in the driver.
Signed-off-by: Phillip Potter <phil@philpotter.co.uk>
Link: https://lore.kernel.org/r/20210731003937.68615-15-phil@philpotter.co.uk
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
 
        case    ODM_CMNINFO_RSSI_MIN:
                pDM_Odm->RSSI_Min = (u8)Value;
                break;
-       case    ODM_CMNINFO_DBG_COMP:
-               pDM_Odm->DebugComponents = Value;
-               break;
-       case    ODM_CMNINFO_DBG_LEVEL:
-               pDM_Odm->DebugLevel = (u32)Value;
-               break;
        case    ODM_CMNINFO_RA_THRESHOLD_HIGH:
                pDM_Odm->RateAdaptive.HighRSSIThresh = (u8)Value;
                break;
                pDM_Odm->AntDivType = CG_TRX_HW_ANTDIV;
        if (pDM_Odm->SupportICType & (ODM_RTL8723A))
                pDM_Odm->AntDivType = CGCS_RX_SW_ANTDIV;
-
-       ODM_InitDebugSetting(pDM_Odm);
 }
 
 void odm_CommonInfoSelfUpdate(struct odm_dm_struct *pDM_Odm)
 
 
 #include "../include/odm_precomp.h"
 
-void ODM_InitDebugSetting(struct odm_dm_struct *pDM_Odm)
-{
-       pDM_Odm->DebugLevel = ODM_DBG_TRACE;
-
-       pDM_Odm->DebugComponents = 0;
-}
-
 u32 GlobalDebugLevel;
 
 
        memset(pdmpriv, 0, sizeof(struct dm_priv));
        Init_ODM_ComInfo_88E(Adapter);
-       ODM_InitDebugSetting(podmpriv);
 }
 
 void rtl8188e_deinit_dm_priv(struct adapter *Adapter)
 
                        }
                }
                break;
-       case HW_DEF_ODM_DBG_FLAG:
-               {
-                       struct odm_dm_struct *dm_ocm = &(haldata->odmpriv);
-                       pr_info("dm_ocm->DebugComponents = 0x%llx\n", dm_ocm->DebugComponents);
-               }
-               break;
        case HAL_DEF_DBG_DUMP_RXPKT:
                *((u8 *)pValue) = haldata->bDumpRxPkt;
                break;
        case HAL_DEF_DBG_DUMP_TXPKT:
                haldata->bDumpTxPkt = *((u8 *)pValue);
                break;
-       case HW_DEF_FA_CNT_DUMP:
-               {
-                       u8 bRSSIDump = *((u8 *)pValue);
-                       struct odm_dm_struct *dm_ocm = &(haldata->odmpriv);
-                       if (bRSSIDump)
-                               dm_ocm->DebugComponents =       ODM_COMP_DIG|ODM_COMP_FA_CNT    ;
-                       else
-                               dm_ocm->DebugComponents = 0;
-               }
-               break;
-       case HW_DEF_ODM_DBG_FLAG:
-               {
-                       u64     DebugComponents = *((u64 *)pValue);
-                       struct odm_dm_struct *dm_ocm = &(haldata->odmpriv);
-                       dm_ocm->DebugComponents = DebugComponents;
-               }
-               break;
        default:
                bResult = _FAIL;
                break;
 
        HW_VAR_MAX_RX_AMPDU_FACTOR,
        HW_DEF_RA_INFO_DUMP,
        HAL_DEF_DBG_DUMP_TXPKT,
-       HW_DEF_FA_CNT_DUMP,
-       HW_DEF_ODM_DBG_FLAG,
 };
 
 enum hal_odm_variable {
 
        ODM_CMNINFO_WIFI_DISPLAY,
        ODM_CMNINFO_LINK,
        ODM_CMNINFO_RSSI_MIN,
-       ODM_CMNINFO_DBG_COMP,                   /*  u64 */
-       ODM_CMNINFO_DBG_LEVEL,                  /*  u32 */
        ODM_CMNINFO_RA_THRESHOLD_HIGH,          /*  u8 */
        ODM_CMNINFO_RA_THRESHOLD_LOW,           /*  u8 */
        ODM_CMNINFO_RF_ANTENNA_TYPE,            /*  u8 */
        bool    odm_ready;
 
        struct rtl8192cd_priv *fake_priv;
-       u64     DebugComponents;
-       u32     DebugLevel;
 
 /*  ODM HANDLE, DRIVER NEEDS NOT TO HOOK------ */
        bool    bCckHighPower;
 
+++ /dev/null
-/* SPDX-License-Identifier: GPL-2.0 OR BSD-3-Clause */
-/* Copyright(c) 2007 - 2011 Realtek Corporation. */
-
-#ifndef        __ODM_DBG_H__
-#define __ODM_DBG_H__
-
-/*  */
-/*     Define the debug levels */
-/*  */
-/*     1. DBG_TRACE and DBG_LOUD are used for normal cases. */
-/*     They can help SW engineer to develop or trace states changed */
-/*     and also help HW enginner to trace every operation to and from HW, */
-/*     e.g IO, Tx, Rx. */
-/*  */
-/*     2. DBG_WARNNING and DBG_SERIOUS are used for unusual or error cases, */
-/*     which help us to debug SW or HW. */
-
-/*     Never used in a call to ODM_RT_TRACE()! */
-#define ODM_DBG_OFF                            1
-
-/*     Fatal bug. */
-/*     For example, Tx/Rx/IO locked up, OS hangs, memory access violation, */
-/*     resource allocation failed, unexpected HW behavior, HW BUG and so on. */
-#define ODM_DBG_SERIOUS                                2
-
-/*     Abnormal, rare, or unexpeted cases. */
-/*     For example, IRP/Packet/OID canceled, device suprisely unremoved and so on. */
-#define ODM_DBG_WARNING                                3
-
-/*     Normal case with useful information about current SW or HW state. */
-/*     For example, Tx/Rx descriptor to fill, Tx/Rx descr. completed status, */
-/*     SW protocol state change, dynamic mechanism state change and so on. */
-/*  */
-#define ODM_DBG_LOUD                                   4
-
-/*     Normal case with detail execution flow or information. */
-#define ODM_DBG_TRACE                                  5
-
-/*  Define the tracing components */
-/* BB Functions */
-#define ODM_COMP_DIG                                   BIT0
-#define ODM_COMP_RA_MASK                               BIT1
-#define ODM_COMP_DYNAMIC_TXPWR                         BIT2
-#define ODM_COMP_FA_CNT                                        BIT3
-#define ODM_COMP_RSSI_MONITOR                          BIT4
-#define ODM_COMP_CCK_PD                                        BIT5
-#define ODM_COMP_ANT_DIV                               BIT6
-#define ODM_COMP_PWR_SAVE                              BIT7
-#define ODM_COMP_PWR_TRA                               BIT8
-#define ODM_COMP_RATE_ADAPTIVE                         BIT9
-#define ODM_COMP_PATH_DIV                              BIT10
-#define ODM_COMP_PSD                                   BIT11
-#define ODM_COMP_DYNAMIC_PRICCA                                BIT12
-#define ODM_COMP_RXHP                                  BIT13
-/* MAC Functions */
-#define ODM_COMP_EDCA_TURBO                            BIT16
-#define ODM_COMP_EARLY_MODE                            BIT17
-/* RF Functions */
-#define ODM_COMP_TX_PWR_TRACK                          BIT24
-#define ODM_COMP_RX_GAIN_TRACK                         BIT25
-#define ODM_COMP_CALIBRATION                           BIT26
-/* Common Functions */
-#define ODM_COMP_COMMON                                        BIT30
-#define ODM_COMP_INIT                                  BIT31
-
-/*------------------------Export Marco Definition---------------------------*/
-void ODM_InitDebugSetting(struct odm_dm_struct *pDM_Odm);
-
-#endif /*  __ODM_DBG_H__ */
 
 
 #include "odm.h"
 #include "odm_HWConfig.h"
-#include "odm_debug.h"
 #include "odm_RegDefine11AC.h"
 #include "odm_RegDefine11N.h"
 
 
                case 0x11:
                        DBG_88E("turn %s Rx RSSI display function\n", (extra_arg == 1) ? "on" : "off");
                        padapter->bRxRSSIDisplay = extra_arg;
-                       rtw_hal_set_def_var(padapter, HW_DEF_FA_CNT_DUMP, &extra_arg);
                        break;
                case 0x12: /* set rx_stbc */
                {
                        DBG_88E("get wifi_spec =%d\n", pregpriv->wifi_spec);
                }
                        break;
-               case 0x16:
-                       if (arg == 0xff) {
-                               pr_info("ODM_COMP_DIG\t\tBIT0\n");
-                               pr_info("ODM_COMP_RA_MASK\t\tBIT1\n");
-                               pr_info("ODM_COMP_DYNAMIC_TXPWR\tBIT2\n");
-                               pr_info("ODM_COMP_FA_CNT\t\tBIT3\n");
-                               pr_info("ODM_COMP_RSSI_MONITOR\tBIT4\n");
-                               pr_info("ODM_COMP_CCK_PD\t\tBIT5\n");
-                               pr_info("ODM_COMP_ANT_DIV\t\tBIT6\n");
-                               pr_info("ODM_COMP_PWR_SAVE\t\tBIT7\n");
-                               pr_info("ODM_COMP_PWR_TRAIN\tBIT8\n");
-                               pr_info("ODM_COMP_RATE_ADAPTIVE\tBIT9\n");
-                               pr_info("ODM_COMP_PATH_DIV\t\tBIT10\n");
-                               pr_info("ODM_COMP_PSD   \tBIT11\n");
-                               pr_info("ODM_COMP_DYNAMIC_PRICCA\tBIT12\n");
-                               pr_info("ODM_COMP_RXHP\t\tBIT13\n");
-                               pr_info("ODM_COMP_EDCA_TURBO\tBIT16\n");
-                               pr_info("ODM_COMP_EARLY_MODE\tBIT17\n");
-                               pr_info("ODM_COMP_TX_PWR_TRACK\tBIT24\n");
-                               pr_info("ODM_COMP_RX_GAIN_TRACK\tBIT25\n");
-                               pr_info("ODM_COMP_CALIBRATION\tBIT26\n");
-                               rtw_hal_get_def_var(padapter, HW_DEF_ODM_DBG_FLAG, &extra_arg);
-                       } else {
-                               rtw_hal_set_def_var(padapter, HW_DEF_ODM_DBG_FLAG, &extra_arg);
-                       }
-                       break;
                case 0x23:
                        DBG_88E("turn %s the bNotifyChannelChange Variable\n", (extra_arg == 1) ? "on" : "off");
                        padapter->bNotifyChannelChange = extra_arg;