staging: r8188eu: remove read_rfreg from struct hal_ops
authorMichael Straube <straube.linux@gmail.com>
Fri, 10 Sep 2021 20:50:31 +0000 (22:50 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 13 Sep 2021 06:49:58 +0000 (08:49 +0200)
Remove read_rfreg from struct hal_ops and its wrapper
rtw_hal_read_rfreg(). Call rtl8188e_PHY_QueryRFReg() directly instead.

Acked-by: Fabio M. De Francesco <fmdefrancesco@gmail.com>
Signed-off-by: Michael Straube <straube.linux@gmail.com>
Link: https://lore.kernel.org/r/20210910205033.3778-6-straube.linux@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/r8188eu/core/rtw_debug.c
drivers/staging/r8188eu/core/rtw_mp.c
drivers/staging/r8188eu/hal/hal_intf.c
drivers/staging/r8188eu/hal/rtl8188e_hal_init.c
drivers/staging/r8188eu/include/hal_intf.h
drivers/staging/r8188eu/os_dep/ioctl_linux.c

index 65daf67..3d613d9 100644 (file)
@@ -428,7 +428,7 @@ int proc_get_rf_reg_dump1(char *page, char **start,
        path = 1;
        len += snprintf(page + len, count - len, "\nRF_Path(%x)\n", path);
        for (i = 0; i < 0xC0; i++) {
-               value = rtw_hal_read_rfreg(padapter, path, i, 0xffffffff);
+               value = rtl8188e_PHY_QueryRFReg(padapter, path, i, 0xffffffff);
                if (j % 4 == 1)
                        len += snprintf(page + len, count - len, "0x%02x ", i);
                len += snprintf(page + len, count - len, " 0x%08x ", value);
@@ -453,7 +453,7 @@ int proc_get_rf_reg_dump2(char *page, char **start,
        path = 1;
        len += snprintf(page + len, count - len, "\nRF_Path(%x)\n", path);
        for (i = 0xC0; i < 0x100; i++) {
-               value = rtw_hal_read_rfreg(padapter, path, i, 0xffffffff);
+               value = rtl8188e_PHY_QueryRFReg(padapter, path, i, 0xffffffff);
                if (j % 4 == 1)
                        len += snprintf(page + len, count - len, "0x%02x ", i);
                len += snprintf(page + len, count - len, " 0x%08x ", value);
@@ -478,7 +478,7 @@ int proc_get_rf_reg_dump3(char *page, char **start,
        path = 2;
        len += snprintf(page + len, count - len, "\nRF_Path(%x)\n", path);
        for (i = 0; i < 0xC0; i++) {
-               value = rtw_hal_read_rfreg(padapter, path, i, 0xffffffff);
+               value = rtl8188e_PHY_QueryRFReg(padapter, path, i, 0xffffffff);
                if (j % 4 == 1)
                        len += snprintf(page + len, count - len, "0x%02x ", i);
                len += snprintf(page + len, count - len, " 0x%08x ", value);
@@ -504,7 +504,7 @@ int proc_get_rf_reg_dump4(char *page, char **start,
        path = 2;
        len += snprintf(page + len, count - len, "\nRF_Path(%x)\n", path);
        for (i = 0xC0; i < 0x100; i++) {
-               value = rtw_hal_read_rfreg(padapter, path, i, 0xffffffff);
+               value = rtl8188e_PHY_QueryRFReg(padapter, path, i, 0xffffffff);
                if (j % 4 == 1)
                        len += snprintf(page + len, count - len, "0x%02x ", i);
                len += snprintf(page + len, count - len, " 0x%08x ", value);
index 2d71b3a..85821ee 100644 (file)
@@ -19,7 +19,7 @@ void write_bbreg(struct adapter *padapter, u32 addr, u32 bitmask, u32 val)
 
 u32 _read_rfreg(struct adapter *padapter, u8 rfpath, u32 addr, u32 bitmask)
 {
-       return rtw_hal_read_rfreg(padapter, (enum rf_radio_path)rfpath, addr, bitmask);
+       return rtl8188e_PHY_QueryRFReg(padapter, (enum rf_radio_path)rfpath, addr, bitmask);
 }
 
 void _write_rfreg(struct adapter *padapter, u8 rfpath, u32 addr, u32 bitmask, u32 val)
index 155b2f5..72e4b17 100644 (file)
@@ -125,17 +125,6 @@ void rtw_hal_update_ra_mask(struct adapter *adapt, u32 mac_id, u8 rssi_level)
        }
 }
 
-u32 rtw_hal_read_rfreg(struct adapter *adapt, enum rf_radio_path rfpath,
-                      u32 regaddr, u32 bitmask)
-{
-       u32 data = 0;
-
-       if (adapt->HalFunc.read_rfreg)
-               data = adapt->HalFunc.read_rfreg(adapt, rfpath, regaddr,
-                                                   bitmask);
-       return data;
-}
-
 void rtw_hal_write_rfreg(struct adapter *adapt, enum rf_radio_path rfpath,
                         u32 regaddr, u32 bitmask, u32 data)
 {
index 739f176..9ddd63a 100644 (file)
@@ -1750,7 +1750,6 @@ void hal_notch_filter_8188e(struct adapter *adapter, bool enable)
 }
 void rtl8188e_set_hal_ops(struct hal_ops *pHalFunc)
 {
-       pHalFunc->read_rfreg = &rtl8188e_PHY_QueryRFReg;
        pHalFunc->write_rfreg = &rtl8188e_PHY_SetRFReg;
 }
 
index 11b0871..0aebf40 100644 (file)
@@ -147,9 +147,6 @@ struct hal_ops {
                                       enum hal_def_variable eVariable,
                                       void *pValue);
 
-       u32     (*read_rfreg)(struct adapter *padapter,
-                             enum rf_radio_path eRFPath, u32 RegAddr,
-                             u32 BitMask);
        void    (*write_rfreg)(struct adapter *padapter,
                               enum rf_radio_path eRFPath, u32 RegAddr,
                               u32 BitMask, u32 Data);
@@ -217,8 +214,6 @@ void rtw_hal_update_ra_mask(struct adapter *padapter, u32 mac_id, u8 level);
 void   rtw_hal_clone_data(struct adapter *dst_adapt,
                           struct adapter *src_adapt);
 
-u32    rtw_hal_read_rfreg(struct adapter *padapter, enum rf_radio_path eRFPath,
-                          u32 RegAddr, u32 BitMask);
 void   rtw_hal_write_rfreg(struct adapter *padapter,
                            enum rf_radio_path eRFPath, u32 RegAddr,
                            u32 BitMask, u32 Data);
index cc03be3..21a5d7c 100644 (file)
@@ -2122,7 +2122,7 @@ static int rtw_wx_read_rf(struct net_device *dev,
 
        path = *(u32 *)extra;
        addr = *((u32 *)extra + 1);
-       data32 = rtw_hal_read_rfreg(padapter, path, addr, 0xFFFFF);
+       data32 = rtl8188e_PHY_QueryRFReg(padapter, path, addr, 0xFFFFF);
        /*
         * IMPORTANT!!
         * Only when wireless private ioctl is at odd order,
@@ -2262,7 +2262,7 @@ static void rtw_dbg_mode_hdl(struct adapter *padapter, u32 id, u8 *pdata, u32 le
                path = (u8)prfreg->path;
                offset = (u8)prfreg->offset;
 
-               value = rtw_hal_read_rfreg(padapter, path, offset, 0xffffffff);
+               value = rtl8188e_PHY_QueryRFReg(padapter, path, offset, 0xffffffff);
 
                prfreg->value = value;
 
@@ -3890,7 +3890,7 @@ static void rf_reg_dump(struct adapter *padapter)
        for (path = 0; path < path_nums; path++) {
                pr_info("\nRF_Path(%x)\n", path);
                for (i = 0; i < 0x100; i++) {
-                       value = rtw_hal_read_rfreg(padapter, path, i, 0xffffffff);
+                       value = rtl8188e_PHY_QueryRFReg(padapter, path, i, 0xffffffff);
                        if (j % 4 == 1)
                                pr_info("0x%02x ", i);
                        pr_info(" 0x%08x ", value);
@@ -3965,11 +3965,11 @@ static int rtw_dbg_port(struct net_device *dev,
                DBG_88E("write_bbreg(0x%x) = 0x%x\n", arg, rtl8188e_PHY_QueryBBReg(padapter, arg, 0xffffffff));
                break;
        case 0x74:/* read_rf */
-               DBG_88E("read RF_reg path(0x%02x), offset(0x%x), value(0x%08x)\n", minor_cmd, arg, rtw_hal_read_rfreg(padapter, minor_cmd, arg, 0xffffffff));
+               DBG_88E("read RF_reg path(0x%02x), offset(0x%x), value(0x%08x)\n", minor_cmd, arg, rtl8188e_PHY_QueryRFReg(padapter, minor_cmd, arg, 0xffffffff));
                break;
        case 0x75:/* write_rf */
                rtw_hal_write_rfreg(padapter, minor_cmd, arg, 0xffffffff, extra_arg);
-               DBG_88E("write RF_reg path(0x%02x), offset(0x%x), value(0x%08x)\n", minor_cmd, arg, rtw_hal_read_rfreg(padapter, minor_cmd, arg, 0xffffffff));
+               DBG_88E("write RF_reg path(0x%02x), offset(0x%x), value(0x%08x)\n", minor_cmd, arg, rtl8188e_PHY_QueryRFReg(padapter, minor_cmd, arg, 0xffffffff));
                break;
 
        case 0x76:
@@ -6069,7 +6069,7 @@ static int rtw_mp_dump(struct net_device *dev,
 
                for (path = 0; path < path_nums; path++) {
                        for (i = 0; i < 0x34; i++) {
-                               value = rtw_hal_read_rfreg(padapter, path, i, 0xffffffff);
+                               value = rtl8188e_PHY_QueryRFReg(padapter, path, i, 0xffffffff);
                                if (j % 4 == 1)
                                        DBG_88E("0x%02x ", i);
                                DBG_88E(" 0x%08x ", value);