2022-11-06 01:57:35

by Jacob Bai

[permalink] [raw]
Subject: [PATCH v2 0/3] staging: rtl8192e: trivial code cleanup patches

Rename few variables and source files to make it align with other
rtlwifi drivers.
The patches are required to be applied in sequence.

Changes in v2:
1. Patch 2: modify r8192E_firmware.c to include table.h instead of
r8192E_hwimg.h.

Jacob Bai (3):
staging: rtl8192e: rename tables in r8192e_hwimg.c
staging: rtl8192e: rename r8192E_hwimg.c/h to table.c/h
staging: rtl8192e: remove unnecesscary macro defines

drivers/staging/rtl8192e/rtl8192e/Makefile | 2 +-
.../rtl8192e/rtl8192e/r8192E_firmware.c | 2 +-
.../staging/rtl8192e/rtl8192e/r8192E_hwimg.h | 33 ------------
.../staging/rtl8192e/rtl8192e/r8192E_phy.c | 54 +++++++++----------
.../staging/rtl8192e/rtl8192e/r8192E_phy.h | 20 -------
.../rtl8192e/{r8192E_hwimg.c => table.c} | 20 +++----
drivers/staging/rtl8192e/rtl8192e/table.h | 33 ++++++++++++
7 files changed, 72 insertions(+), 92 deletions(-)
delete mode 100644 drivers/staging/rtl8192e/rtl8192e/r8192E_hwimg.h
rename drivers/staging/rtl8192e/rtl8192e/{r8192E_hwimg.c => table.c} (95%)
create mode 100644 drivers/staging/rtl8192e/rtl8192e/table.h

--
2.34.1



2022-11-06 02:19:14

by Jacob Bai

[permalink] [raw]
Subject: [PATCH v2 2/3] staging: rtl8192e: rename r8192E_hwimg.c/h to table.c/h

Same as other rtlwifi drivers, use table.c/h.

Signed-off-by: Jacob Bai <[email protected]>
---
drivers/staging/rtl8192e/rtl8192e/Makefile | 2 +-
drivers/staging/rtl8192e/rtl8192e/r8192E_firmware.c | 2 +-
drivers/staging/rtl8192e/rtl8192e/r8192E_phy.c | 2 +-
drivers/staging/rtl8192e/rtl8192e/{r8192E_hwimg.c => table.c} | 2 +-
drivers/staging/rtl8192e/rtl8192e/{r8192E_hwimg.h => table.h} | 4 ++--
5 files changed, 6 insertions(+), 6 deletions(-)
rename drivers/staging/rtl8192e/rtl8192e/{r8192E_hwimg.c => table.c} (99%)
rename drivers/staging/rtl8192e/rtl8192e/{r8192E_hwimg.h => table.h} (94%)

diff --git a/drivers/staging/rtl8192e/rtl8192e/Makefile b/drivers/staging/rtl8192e/rtl8192e/Makefile
index 75e6ec510555..334d92efd4ba 100644
--- a/drivers/staging/rtl8192e/rtl8192e/Makefile
+++ b/drivers/staging/rtl8192e/rtl8192e/Makefile
@@ -4,7 +4,7 @@ r8192e_pci-objs := \
r8192E_phy.o \
r8192E_firmware.o \
r8192E_cmdpkt.o \
- r8192E_hwimg.o \
+ table.o \
r8190P_rtl8256.o \
rtl_cam.o \
rtl_core.o \
diff --git a/drivers/staging/rtl8192e/rtl8192e/r8192E_firmware.c b/drivers/staging/rtl8192e/rtl8192e/r8192E_firmware.c
index 789d288d7503..45819f2f2a37 100644
--- a/drivers/staging/rtl8192e/rtl8192e/r8192E_firmware.c
+++ b/drivers/staging/rtl8192e/rtl8192e/r8192E_firmware.c
@@ -6,7 +6,7 @@
*/
#include "rtl_core.h"
#include "r8192E_hw.h"
-#include "r8192E_hwimg.h"
+#include "table.h"
#include "r8192E_firmware.h"
#include "r8192E_cmdpkt.h"
#include <linux/firmware.h>
diff --git a/drivers/staging/rtl8192e/rtl8192e/r8192E_phy.c b/drivers/staging/rtl8192e/rtl8192e/r8192E_phy.c
index 58da2dab55bd..eabb4187d907 100644
--- a/drivers/staging/rtl8192e/rtl8192e/r8192E_phy.c
+++ b/drivers/staging/rtl8192e/rtl8192e/r8192E_phy.c
@@ -12,7 +12,7 @@
#include "r8192E_phy.h"
#include "rtl_dm.h"

-#include "r8192E_hwimg.h"
+#include "table.h"

static u32 RF_CHANNEL_TABLE_ZEBRA[] = {
0,
diff --git a/drivers/staging/rtl8192e/rtl8192e/r8192E_hwimg.c b/drivers/staging/rtl8192e/rtl8192e/table.c
similarity index 99%
rename from drivers/staging/rtl8192e/rtl8192e/r8192E_hwimg.c
rename to drivers/staging/rtl8192e/rtl8192e/table.c
index 8920283f340e..2e75f40db874 100644
--- a/drivers/staging/rtl8192e/rtl8192e/r8192E_hwimg.c
+++ b/drivers/staging/rtl8192e/rtl8192e/table.c
@@ -4,7 +4,7 @@
*
* Contact Information: wlanfae <[email protected]>
*/
-#include "r8192E_hwimg.h"
+#include "table.h"

u32 RTL8192E_PHY_REG_ARRAY[RTL8192E_PHY_REG_ARRAY_LEN] = {0x0,};

diff --git a/drivers/staging/rtl8192e/rtl8192e/r8192E_hwimg.h b/drivers/staging/rtl8192e/rtl8192e/table.h
similarity index 94%
rename from drivers/staging/rtl8192e/rtl8192e/r8192E_hwimg.h
rename to drivers/staging/rtl8192e/rtl8192e/table.h
index a436c089a779..a80176c47127 100644
--- a/drivers/staging/rtl8192e/rtl8192e/r8192E_hwimg.h
+++ b/drivers/staging/rtl8192e/rtl8192e/table.h
@@ -4,8 +4,8 @@
*
* Contact Information: wlanfae <[email protected]>
*/
-#ifndef __INC_HAL8192PciE_FW_IMG_H
-#define __INC_HAL8192PciE_FW_IMG_H
+#ifndef __RTL8192E_TABLE__H_
+#define __RTL8192E_TABLE__H_

/*Created on 2008/11/18, 3: 7*/

--
2.34.1


2022-11-06 03:09:10

by Jacob Bai

[permalink] [raw]
Subject: [PATCH v2 3/3] staging: rtl8192e: remove unnecesscary macro defines

remove useless macro defines

Signed-off-by: Jacob Bai <[email protected]>
---
.../staging/rtl8192e/rtl8192e/r8192E_phy.c | 52 +++++++++----------
.../staging/rtl8192e/rtl8192e/r8192E_phy.h | 20 -------
2 files changed, 26 insertions(+), 46 deletions(-)

diff --git a/drivers/staging/rtl8192e/rtl8192e/r8192E_phy.c b/drivers/staging/rtl8192e/rtl8192e/r8192E_phy.c
index eabb4187d907..aad1842857c0 100644
--- a/drivers/staging/rtl8192e/rtl8192e/r8192E_phy.c
+++ b/drivers/staging/rtl8192e/rtl8192e/r8192E_phy.c
@@ -307,12 +307,12 @@ void rtl92e_config_mac(struct net_device *dev)
struct r8192_priv *priv = rtllib_priv(dev);

if (priv->bTXPowerDataReadFromEEPORM) {
- dwArrayLen = MACPHY_Array_PGLength;
- pdwArray = Rtl819XMACPHY_Array_PG;
+ dwArrayLen = RTL8192E_MAC_ARRAY_PG_LEN;
+ pdwArray = RTL8192E_MAC_ARRAY_PG;

} else {
- dwArrayLen = MACPHY_ArrayLength;
- pdwArray = Rtl819XMACPHY_Array;
+ dwArrayLen = RTL8192E_MAC_ARRAY_LEN;
+ pdwArray = RTL8192E_MAC_ARRAY;
}
for (i = 0; i < dwArrayLen; i += 3) {
if (pdwArray[i] == 0x318)
@@ -332,14 +332,14 @@ static void _rtl92e_phy_config_bb(struct net_device *dev, u8 ConfigType)
u16 AGCTAB_ArrayLen, PHY_REGArrayLen = 0;
struct r8192_priv *priv = rtllib_priv(dev);

- AGCTAB_ArrayLen = AGCTAB_ArrayLength;
- Rtl819XAGCTAB_Array_Table = Rtl819XAGCTAB_Array;
+ AGCTAB_ArrayLen = RTL8192E_AGC_TAB_ARRAY_LEN;
+ Rtl819XAGCTAB_Array_Table = RTL8192E_AGC_TAB_ARRAY;
if (priv->rf_type == RF_2T4R) {
- PHY_REGArrayLen = PHY_REGArrayLength;
- Rtl819XPHY_REGArray_Table = Rtl819XPHY_REGArray;
+ PHY_REGArrayLen = RTL8192E_PHY_REG_ARRAY_LEN;
+ Rtl819XPHY_REGArray_Table = RTL8192E_PHY_REG_ARRAY;
} else if (priv->rf_type == RF_1T2R) {
- PHY_REGArrayLen = PHY_REG_1T2RArrayLength;
- Rtl819XPHY_REGArray_Table = Rtl819XPHY_REG_1T2RArray;
+ PHY_REGArrayLen = RTL8192E_PHY_REG_1T2R_ARRAY_LEN;
+ Rtl819XPHY_REGArray_Table = RTL8192E_PHY_REG_1T2R_ARRAY;
}

if (ConfigType == BaseBand_Config_PHY_REG) {
@@ -668,50 +668,50 @@ u8 rtl92e_config_rf_path(struct net_device *dev, enum rf90_radio_path eRFPath)

switch (eRFPath) {
case RF90_PATH_A:
- for (i = 0; i < RadioA_ArrayLength; i += 2) {
- if (Rtl819XRadioA_Array[i] == 0xfe) {
+ for (i = 0; i < RTL8192E_RADIOA_ARRAY_LEN; i += 2) {
+ if (RTL8192E_RADIOA_ARRAY[i] == 0xfe) {
msleep(100);
continue;
}
- rtl92e_set_rf_reg(dev, eRFPath, Rtl819XRadioA_Array[i],
+ rtl92e_set_rf_reg(dev, eRFPath, RTL8192E_RADIOA_ARRAY[i],
bMask12Bits,
- Rtl819XRadioA_Array[i+1]);
+ RTL8192E_RADIOA_ARRAY[i+1]);

}
break;
case RF90_PATH_B:
- for (i = 0; i < RadioB_ArrayLength; i += 2) {
- if (Rtl819XRadioB_Array[i] == 0xfe) {
+ for (i = 0; i < RTL8192E_RADIOB_ARRAY_LEN; i += 2) {
+ if (RTL8192E_RADIOB_ARRAY[i] == 0xfe) {
msleep(100);
continue;
}
- rtl92e_set_rf_reg(dev, eRFPath, Rtl819XRadioB_Array[i],
+ rtl92e_set_rf_reg(dev, eRFPath, RTL8192E_RADIOB_ARRAY[i],
bMask12Bits,
- Rtl819XRadioB_Array[i+1]);
+ RTL8192E_RADIOB_ARRAY[i+1]);

}
break;
case RF90_PATH_C:
- for (i = 0; i < RadioC_ArrayLength; i += 2) {
- if (Rtl819XRadioC_Array[i] == 0xfe) {
+ for (i = 0; i < RTL8192E_RADIOC_ARRAY_LEN; i += 2) {
+ if (RTL8192E_RADIOC_ARRAY[i] == 0xfe) {
msleep(100);
continue;
}
- rtl92e_set_rf_reg(dev, eRFPath, Rtl819XRadioC_Array[i],
+ rtl92e_set_rf_reg(dev, eRFPath, RTL8192E_RADIOC_ARRAY[i],
bMask12Bits,
- Rtl819XRadioC_Array[i+1]);
+ RTL8192E_RADIOC_ARRAY[i+1]);

}
break;
case RF90_PATH_D:
- for (i = 0; i < RadioD_ArrayLength; i += 2) {
- if (Rtl819XRadioD_Array[i] == 0xfe) {
+ for (i = 0; i < RTL8192E_RADIOD_ARRAY_LEN; i += 2) {
+ if (RTL8192E_RADIOD_ARRAY[i] == 0xfe) {
msleep(100);
continue;
}
- rtl92e_set_rf_reg(dev, eRFPath, Rtl819XRadioD_Array[i],
+ rtl92e_set_rf_reg(dev, eRFPath, RTL8192E_RADIOD_ARRAY[i],
bMask12Bits,
- Rtl819XRadioD_Array[i+1]);
+ RTL8192E_RADIOD_ARRAY[i+1]);

}
break;
diff --git a/drivers/staging/rtl8192e/rtl8192e/r8192E_phy.h b/drivers/staging/rtl8192e/rtl8192e/r8192E_phy.h
index e1c1f19b71a3..5e6527e835db 100644
--- a/drivers/staging/rtl8192e/rtl8192e/r8192E_phy.h
+++ b/drivers/staging/rtl8192e/rtl8192e/r8192E_phy.h
@@ -9,26 +9,6 @@

#define MAX_DOZE_WAITING_TIMES_9x 64

-#define AGCTAB_ArrayLength RTL8192E_AGC_TAB_ARRAY_LEN
-#define MACPHY_ArrayLength RTL8192E_MAC_ARRAY_LEN
-#define RadioA_ArrayLength RTL8192E_RADIOA_ARRAY_LEN
-#define RadioB_ArrayLength RTL8192E_RADIOB_ARRAY_LEN
-#define MACPHY_Array_PGLength RTL8192E_MAC_ARRAY_PG_LEN
-#define RadioC_ArrayLength RTL8192E_RADIOC_ARRAY_LEN
-#define RadioD_ArrayLength RTL8192E_RADIOD_ARRAY_LEN
-#define PHY_REGArrayLength RTL8192E_PHY_REG_ARRAY_LEN
-#define PHY_REG_1T2RArrayLength RTL8192E_PHY_REG_1T2R_ARRAY_LEN
-
-#define Rtl819XMACPHY_Array_PG RTL8192E_MAC_ARRAY_PG
-#define Rtl819XMACPHY_Array RTL8192E_MAC_ARRAY
-#define Rtl819XRadioA_Array RTL8192E_RADIOA_ARRAY
-#define Rtl819XRadioB_Array RTL8192E_RADIOB_ARRAY
-#define Rtl819XRadioC_Array RTL8192E_RADIOC_ARRAY
-#define Rtl819XRadioD_Array RTL8192E_RADIOD_ARRAY
-#define Rtl819XAGCTAB_Array RTL8192E_AGC_TAB_ARRAY
-#define Rtl819XPHY_REGArray RTL8192E_PHY_REG_ARRAY
-#define Rtl819XPHY_REG_1T2RArray RTL8192E_PHY_REG_1T2R_ARRAY
-
extern u32 rtl819XAGCTAB_Array[];

enum hw90_block {
--
2.34.1