staging: r8188eu: remove GetPSDData()
authorMichael Straube <straube.linux@gmail.com>
Fri, 15 Oct 2021 16:35:03 +0000 (18:35 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 18 Oct 2021 14:38:17 +0000 (16:38 +0200)
Function GetPSDData() is not used, remove it. It is the only user of
ConvertTo_dB() and ODM_StallExecution(), remove these two functions
and the now unused dB_Invert_Table as well.

Acked-by: Martin Kaiser <martin@kaiser.cx>
Acked-by: Phillip Potter <phil@philpotter.co.uk>
Signed-off-by: Michael Straube <straube.linux@gmail.com>
Link: https://lore.kernel.org/r/20211015163507.9091-4-straube.linux@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/r8188eu/hal/odm.c
drivers/staging/r8188eu/hal/odm_interface.c
drivers/staging/r8188eu/include/odm.h
drivers/staging/r8188eu/include/odm_interface.h

index 030bc7bd99059f260f23ef952e32cc7ca4e9be58..28bd6f36cddd23069d81c34c45a3033abb221b99 100644 (file)
@@ -5,17 +5,6 @@
 
 #include "../include/odm_precomp.h"
 
-static const u16 dB_Invert_Table[8][12] = {
-       {1, 1, 1, 2, 2, 2, 2, 3, 3, 3, 4, 4},
-       {4, 5, 6, 6, 7, 8, 9, 10, 11, 13, 14, 16},
-       {18, 20, 22, 25, 28, 32, 35, 40, 45, 50, 56, 63},
-       {71, 79, 89, 100, 112, 126, 141, 158, 178, 200, 224, 251},
-       {282, 316, 355, 398, 447, 501, 562, 631, 708, 794, 891, 1000},
-       {1122, 1259, 1413, 1585, 1778, 1995, 2239, 2512, 2818, 3162, 3548, 3981},
-       {4467, 5012, 5623, 6310, 7079, 7943, 8913, 10000, 11220, 12589, 14125, 15849},
-       {17783, 19953, 22387, 25119, 28184, 31623, 35481, 39811, 44668, 50119, 56234, 65535}
-};
-
 /* avoid to warn in FreeBSD ==> To DO modify */
 static u32 EDCAParam[HT_IOT_PEER_MAX][3] = {
        /*  UL                  DL */
@@ -1142,51 +1131,3 @@ dm_CheckEdcaTurbo_EXIT:
        pxmitpriv->last_tx_bytes = pxmitpriv->tx_bytes;
        precvpriv->last_rx_bytes = precvpriv->rx_bytes;
 }
-
-/*  need to ODM CE Platform */
-/* move to here for ANT detection mechanism using */
-
-u32 GetPSDData(struct odm_dm_struct *pDM_Odm, unsigned int point, u8 initial_gain_psd)
-{
-       u32 psd_report;
-
-       /* Set DCO frequency index, offset=(40MHz/SamplePts)*point */
-       ODM_SetBBReg(pDM_Odm, 0x808, 0x3FF, point);
-
-       /* Start PSD calculation, Reg808[22]=0->1 */
-       ODM_SetBBReg(pDM_Odm, 0x808, BIT(22), 1);
-       /* Need to wait for HW PSD report */
-       ODM_StallExecution(30);
-       ODM_SetBBReg(pDM_Odm, 0x808, BIT(22), 0);
-       /* Read PSD report, Reg8B4[15:0] */
-       psd_report = ODM_GetBBReg(pDM_Odm, 0x8B4, bMaskDWord) & 0x0000FFFF;
-
-       psd_report = (u32)(ConvertTo_dB(psd_report)) + (u32)(initial_gain_psd - 0x1c);
-
-       return psd_report;
-}
-
-u32 ConvertTo_dB(u32 Value)
-{
-       u8 i;
-       u8 j;
-       u32 dB;
-
-       Value = Value & 0xFFFF;
-       for (i = 0; i < 8; i++) {
-               if (Value <= dB_Invert_Table[i][11])
-                       break;
-       }
-
-       if (i >= 8)
-               return 96;      /*  maximum 96 dB */
-
-       for (j = 0; j < 12; j++) {
-               if (Value <= dB_Invert_Table[i][j])
-                       break;
-       }
-
-       dB = i * 12 + j + 1;
-
-       return dB;
-}
index c97104c3682f01450d15a6569a1c9d4219c6da06..7ddba39a0f4b8ee0cb4e37b9cf38b76b62d86162 100644 (file)
@@ -77,11 +77,6 @@ s32 ODM_CompareMemory(struct odm_dm_struct *pDM_Odm, void *pBuf1, void *pBuf2, u
 }
 
 /*  ODM Timer relative API. */
-void ODM_StallExecution(u32 usDelay)
-{
-       udelay(usDelay);
-}
-
 void ODM_delay_ms(u32 ms)
 {
        mdelay(ms);
index 21e08a9f8bf80955bfb2c52fd1cca8cb5895fefc..db24678eb0bc5766aff66c173488c6a3d8a090aa 100644 (file)
@@ -880,11 +880,6 @@ void ODM_TXPowerTrackingCheck(struct odm_dm_struct *pDM_Odm);
 bool ODM_RAStateCheck(struct odm_dm_struct *pDM_Odm, s32 RSSI,
                      bool bForceUpdate, u8 *pRATRState);
 
-u32 ConvertTo_dB(u32 Value);
-
-u32 GetPSDData(struct odm_dm_struct *pDM_Odm, unsigned int point,
-              u8 initial_gain_psd);
-
 u32 ODM_Get_Rate_Bitmap(struct odm_dm_struct *pDM_Odm, u32 macid,
                        u32 ra_mask, u8 rssi_level);
 
index 3af58e8538285fee717c4f1e7966a6b38f152b81..17a315d19a5049d62cc0d5ce536ea6b20fe97252 100644 (file)
@@ -50,8 +50,6 @@ s32 ODM_CompareMemory(struct odm_dm_struct *pDM_Odm, void *pBuf1, void *pBuf2,
                      u32 length);
 
 /*  ODM Timer relative API. */
-void ODM_StallExecution(u32 usDelay);
-
 void ODM_delay_ms(u32 ms);
 
 void ODM_delay_us(u32 us);