2015-07-14 20:04:37

by Mateusz Kulikowski

[permalink] [raw]
Subject: [PATCH v2 00/23] staging: rtl8192e: Various cleanups

This series does some more cleanup for driver.

Changes in V2:
- Added patch 6/23 (Remove rtllib_stats structure as suggested by Dan)
- Updated patch 22/23 (remove whitespace - hint by Sudip)
- Rebased into current staging next (6fdb302c)
- Retested

Notes from V1:

Patches 1-13 just remove features that are not used.
Remaining patches make some functions static (where possible);

If making function static required something more than moving
fw declaration and removing it from header - it is a separate patch.
Otherwise - statification is done on per-file basis.

Series was target-tested (802.11N/2.4G/WPA2 network, DHCP,
1MB download, ping).

Mateusz Kulikowski (23):
staging: rtl8192e: Remove ToLegalChannel()
staging: rtl8192e: Remove unused defines
staging: rtl8192e: Remove undefs
staging: rtl8192e: Remove unused enums
staging: rtl8192e: Remove unused fields from rtllib_stats
staging: rtl8192e: Remove rtllib_stats structure
staging: rtl8192e: Remove unused ether_header structure
staging: rtl8192e: Remove unused rtllib_device::freq_band
staging: rtl8192e: Remove DOT11D_GetMaxTxPwrInDbm()
staging: rtl8192e: Remove read|write_nic_io_(d)word|byte()
staging: rtl8192e: Remove DMESG macro
staging: rtl8192e: Remove rtl819x_process_cck_rxpathsel()
staging: rtl8192e: probe: Remove bdma64 check
staging: rtl8192e: Remove rtl8192_rx_cmd()
staging: rtl8192e: rtl_dm: Make functions static
staging: rtl8192e: rtllib_HTProc: Make functions static
staging: rtl8192e: Make phy_RF8256_Config_ParaFile() static
staging: rtl8192e: rtl_core: Make functions static
staging: rtl8192e: r8192e_phy: Make functions static
staging: rtl8192e: Make rtl8192_QueryIsShort() static
staging: rtl8192e: rtllib_tx: Make functions static
staging: rtl8192e: Make rtllib_rx_mgt() static
staging: rtl8192e: rtllib_softmac: Make functions static

drivers/staging/rtl8192e/dot11d.c | 39 ---
drivers/staging/rtl8192e/dot11d.h | 6 -
drivers/staging/rtl8192e/rtl8192e/r8190P_def.h | 46 ----
drivers/staging/rtl8192e/rtl8192e/r8190P_rtl8256.c | 18 +-
drivers/staging/rtl8192e/rtl8192e/r8190P_rtl8256.h | 1 -
drivers/staging/rtl8192e/rtl8192e/r8192E_dev.c | 27 +--
drivers/staging/rtl8192e/rtl8192e/r8192E_dev.h | 1 -
.../staging/rtl8192e/rtl8192e/r8192E_firmware.h | 2 -
drivers/staging/rtl8192e/rtl8192e/r8192E_phy.c | 6 +-
drivers/staging/rtl8192e/rtl8192e/r8192E_phy.h | 3 -
drivers/staging/rtl8192e/rtl8192e/rtl_core.c | 261 +++------------------
drivers/staging/rtl8192e/rtl8192e/rtl_core.h | 33 ---
drivers/staging/rtl8192e/rtl8192e/rtl_dm.c | 12 +-
drivers/staging/rtl8192e/rtl8192e/rtl_dm.h | 22 --
drivers/staging/rtl8192e/rtl8192e/rtl_ps.h | 1 -
drivers/staging/rtl8192e/rtl8192e/rtl_wx.c | 7 -
drivers/staging/rtl8192e/rtl819x_BA.h | 5 -
drivers/staging/rtl8192e/rtl819x_HT.h | 2 -
drivers/staging/rtl8192e/rtl819x_HTProc.c | 5 +-
drivers/staging/rtl8192e/rtl819x_Qos.h | 5 -
drivers/staging/rtl8192e/rtl819x_TS.h | 2 -
drivers/staging/rtl8192e/rtllib.h | 92 --------
drivers/staging/rtl8192e/rtllib_debug.h | 8 -
drivers/staging/rtl8192e/rtllib_rx.c | 11 +-
drivers/staging/rtl8192e/rtllib_softmac.c | 28 ++-
drivers/staging/rtl8192e/rtllib_tx.c | 9 +-
26 files changed, 97 insertions(+), 555 deletions(-)

--
1.8.4.1


2015-07-14 20:04:39

by Mateusz Kulikowski

[permalink] [raw]
Subject: [PATCH v2 01/23] staging: rtl8192e: Remove ToLegalChannel()

Function is not used.

Signed-off-by: Mateusz Kulikowski <[email protected]>
---
drivers/staging/rtl8192e/dot11d.c | 24 ------------------------
drivers/staging/rtl8192e/dot11d.h | 1 -
2 files changed, 25 deletions(-)

diff --git a/drivers/staging/rtl8192e/dot11d.c b/drivers/staging/rtl8192e/dot11d.c
index ef9da86..7f48845 100644
--- a/drivers/staging/rtl8192e/dot11d.c
+++ b/drivers/staging/rtl8192e/dot11d.c
@@ -190,27 +190,3 @@ void DOT11D_ScanComplete(struct rtllib_device *dev)
break;
}
}
-
-int ToLegalChannel(struct rtllib_device *dev, u8 channel)
-{
- struct rt_dot11d_info *pDot11dInfo = GET_DOT11D_INFO(dev);
- u8 default_chn = 0;
- u32 i;
-
- for (i = 1; i <= MAX_CHANNEL_NUMBER; i++) {
- if (pDot11dInfo->channel_map[i] > 0) {
- default_chn = i;
- break;
- }
- }
-
- if (MAX_CHANNEL_NUMBER < channel) {
- netdev_err(dev->dev, "%s(): Invalid Channel\n", __func__);
- return default_chn;
- }
-
- if (pDot11dInfo->channel_map[channel] > 0)
- return channel;
-
- return default_chn;
-}
diff --git a/drivers/staging/rtl8192e/dot11d.h b/drivers/staging/rtl8192e/dot11d.h
index 69e0f8f..e1c1888 100644
--- a/drivers/staging/rtl8192e/dot11d.h
+++ b/drivers/staging/rtl8192e/dot11d.h
@@ -98,6 +98,5 @@ void Dot11d_UpdateCountryIe(struct rtllib_device *dev, u8 *pTaddr,
u16 CoutryIeLen, u8 *pCoutryIe);
u8 DOT11D_GetMaxTxPwrInDbm(struct rtllib_device *dev, u8 Channel);
void DOT11D_ScanComplete(struct rtllib_device *dev);
-int ToLegalChannel(struct rtllib_device *dev, u8 channel);

#endif
--
1.8.4.1

2015-07-14 20:04:44

by Mateusz Kulikowski

[permalink] [raw]
Subject: [PATCH v2 02/23] staging: rtl8192e: Remove unused defines

Remove most of unused defines (excluding phyreg/hw registers).

Signed-off-by: Mateusz Kulikowski <[email protected]>
---
drivers/staging/rtl8192e/dot11d.h | 4 --
drivers/staging/rtl8192e/rtl8192e/r8190P_def.h | 46 ----------------------
.../staging/rtl8192e/rtl8192e/r8192E_firmware.h | 2 -
drivers/staging/rtl8192e/rtl8192e/rtl_dm.c | 3 --
drivers/staging/rtl8192e/rtl8192e/rtl_dm.h | 19 ---------
drivers/staging/rtl8192e/rtl8192e/rtl_ps.h | 1 -
drivers/staging/rtl8192e/rtl8192e/rtl_wx.c | 3 --
drivers/staging/rtl8192e/rtl819x_BA.h | 5 ---
drivers/staging/rtl8192e/rtl819x_HT.h | 2 -
drivers/staging/rtl8192e/rtl819x_TS.h | 2 -
drivers/staging/rtl8192e/rtllib.h | 40 -------------------
drivers/staging/rtl8192e/rtllib_softmac.c | 1 -
12 files changed, 128 deletions(-)

diff --git a/drivers/staging/rtl8192e/dot11d.h b/drivers/staging/rtl8192e/dot11d.h
index e1c1888..127af82 100644
--- a/drivers/staging/rtl8192e/dot11d.h
+++ b/drivers/staging/rtl8192e/dot11d.h
@@ -79,7 +79,6 @@ static inline void cpMacAddr(unsigned char *des, unsigned char *src)
#define UPDATE_CIE_SRC(__pIeeeDev, __pTa) \
cpMacAddr(GET_DOT11D_INFO(__pIeeeDev)->CountryIeSrcAddr, __pTa)

-#define CIE_WATCHDOG_TH 1
#define GET_CIE_WATCHDOG(__pIeeeDev) \
(GET_DOT11D_INFO(__pIeeeDev)->CountryIeWatchdog)
static inline void RESET_CIE_WATCHDOG(struct rtllib_device *__pIeeeDev)
@@ -88,9 +87,6 @@ static inline void RESET_CIE_WATCHDOG(struct rtllib_device *__pIeeeDev)
}
#define UPDATE_CIE_WATCHDOG(__pIeeeDev) (++GET_CIE_WATCHDOG(__pIeeeDev))

-#define IS_DOT11D_STATE_DONE(__pIeeeDev) \
- (GET_DOT11D_INFO(__pIeeeDev)->State == DOT11D_STATE_DONE)
-
void dot11d_init(struct rtllib_device *dev);
void Dot11d_Channelmap(u8 channel_plan, struct rtllib_device *ieee);
void Dot11d_Reset(struct rtllib_device *dev);
diff --git a/drivers/staging/rtl8192e/rtl8192e/r8190P_def.h b/drivers/staging/rtl8192e/rtl8192e/r8190P_def.h
index d0b0830..dba4584 100644
--- a/drivers/staging/rtl8192e/rtl8192e/r8190P_def.h
+++ b/drivers/staging/rtl8192e/rtl8192e/r8190P_def.h
@@ -26,8 +26,6 @@
#define MAX_SILENT_RESET_RX_SLOT_NUM 10

#define RX_MPDU_QUEUE 0
-#define RX_CMD_QUEUE 1
-

enum rtl819x_loopback {
RTL819X_NO_LOOPBACK = 0,
@@ -36,11 +34,6 @@ enum rtl819x_loopback {
RTL819X_CCK_LOOPBACK = 3,
};

-
-#define RESET_DELAY_8185 20
-
-#define RT_IBSS_INT_MASKS (IMR_BcnInt | IMR_BcnInt | IMR_TBDOK | IMR_TBDER)
-
#define DESC90_RATE1M 0x00
#define DESC90_RATE2M 0x01
#define DESC90_RATE5_5M 0x02
@@ -74,17 +67,6 @@ enum rtl819x_loopback {
#define SHORT_SLOT_TIME 9
#define NON_SHORT_SLOT_TIME 20

-
-#define MAX_LINES_HWCONFIG_TXT 1000
-#define MAX_BYTES_LINE_HWCONFIG_TXT 128
-
-#define SW_THREE_WIRE 0
-#define HW_THREE_WIRE 2
-
-#define BT_DEMO_BOARD 0
-#define BT_QA_BOARD 1
-#define BT_FPGA 2
-
#define RX_SMOOTH 20

#define QSLT_BK 0x1
@@ -96,25 +78,14 @@ enum rtl819x_loopback {
#define QSLT_MGNT 0x12
#define QSLT_CMD 0x13

-#define NUM_OF_FIRMWARE_QUEUE 10
-#define NUM_OF_PAGES_IN_FW 0x100
#define NUM_OF_PAGE_IN_FW_QUEUE_BK 0x007
#define NUM_OF_PAGE_IN_FW_QUEUE_BE 0x0aa
#define NUM_OF_PAGE_IN_FW_QUEUE_VI 0x024
#define NUM_OF_PAGE_IN_FW_QUEUE_VO 0x007
-#define NUM_OF_PAGE_IN_FW_QUEUE_HCCA 0
-#define NUM_OF_PAGE_IN_FW_QUEUE_CMD 0x2
#define NUM_OF_PAGE_IN_FW_QUEUE_MGNT 0x10
-#define NUM_OF_PAGE_IN_FW_QUEUE_HIGH 0
#define NUM_OF_PAGE_IN_FW_QUEUE_BCN 0x4
#define NUM_OF_PAGE_IN_FW_QUEUE_PUB 0xd

-#define NUM_OF_PAGE_IN_FW_QUEUE_BK_DTM 0x026
-#define NUM_OF_PAGE_IN_FW_QUEUE_BE_DTM 0x048
-#define NUM_OF_PAGE_IN_FW_QUEUE_VI_DTM 0x048
-#define NUM_OF_PAGE_IN_FW_QUEUE_VO_DTM 0x026
-#define NUM_OF_PAGE_IN_FW_QUEUE_PUB_DTM 0x00
-
#define APPLIED_RESERVED_QUEUE_IN_FW 0x80000000
#define RSVD_FW_QUEUE_PAGE_BK_SHIFT 0x00
#define RSVD_FW_QUEUE_PAGE_BE_SHIFT 0x08
@@ -197,23 +168,6 @@ struct tx_fwinfo_8190pci {

};

-
-#define TX_DESC_SIZE 32
-
-#define TX_DESC_CMD_SIZE 32
-
-
-#define TX_STATUS_DESC_SIZE 32
-
-#define TX_FWINFO_SIZE 8
-
-
-#define RX_DESC_SIZE 16
-
-#define RX_STATUS_DESC_SIZE 16
-
-#define RX_DRIVER_INFO_SIZE 8
-
struct log_int_8190 {
u32 nIMR_COMDOK;
u32 nIMR_MGNTDOK;
diff --git a/drivers/staging/rtl8192e/rtl8192e/r8192E_firmware.h b/drivers/staging/rtl8192e/rtl8192e/r8192E_firmware.h
index d79e542..ef232d2 100644
--- a/drivers/staging/rtl8192e/rtl8192e/r8192E_firmware.h
+++ b/drivers/staging/rtl8192e/rtl8192e/r8192E_firmware.h
@@ -19,8 +19,6 @@
#ifndef __INC_FIRMWARE_H
#define __INC_FIRMWARE_H

-#define RTL8190_CPU_START_OFFSET 0x80
-
#define GET_COMMAND_PACKET_FRAG_THRESHOLD(v) (4*(v/4) - 8)

#define RTL8192E_BOOT_IMG_FW "RTL8192E/boot.img"
diff --git a/drivers/staging/rtl8192e/rtl8192e/rtl_dm.c b/drivers/staging/rtl8192e/rtl8192e/rtl_dm.c
index 3de7cc5..bce960d 100644
--- a/drivers/staging/rtl8192e/rtl8192e/rtl_dm.c
+++ b/drivers/staging/rtl8192e/rtl8192e/rtl_dm.c
@@ -58,9 +58,6 @@ static u32 edca_setting_UL[HT_IOT_PEER_MAX] = {
0x5e4332
};

-#define RTK_UL_EDCA 0xa44f
-#define RTK_DL_EDCA 0x5e4322
-
const u32 dm_tx_bb_gain[TxBBGainTableLength] = {
0x7f8001fe, /* 12 dB */
0x788001e2, /* 11 dB */
diff --git a/drivers/staging/rtl8192e/rtl8192e/rtl_dm.h b/drivers/staging/rtl8192e/rtl8192e/rtl_dm.h
index b037451..ac95d8f 100644
--- a/drivers/staging/rtl8192e/rtl8192e/rtl_dm.h
+++ b/drivers/staging/rtl8192e/rtl8192e/rtl_dm.h
@@ -27,26 +27,17 @@
#define DM_DIG_THRESH_HIGH 40
#define DM_DIG_THRESH_LOW 35

-#define DM_FALSEALARM_THRESH_LOW 40
-#define DM_FALSEALARM_THRESH_HIGH 1000
-
#define DM_DIG_HIGH_PWR_THRESH_HIGH 75
#define DM_DIG_HIGH_PWR_THRESH_LOW 70

#define BW_AUTO_SWITCH_HIGH_LOW 25
#define BW_AUTO_SWITCH_LOW_HIGH 30

-#define DM_check_fsync_time_interval 500
-
-
#define DM_DIG_BACKOFF 12
#define DM_DIG_MAX 0x36
#define DM_DIG_MIN 0x1c
#define DM_DIG_MIN_Netcore 0x12

-#define DM_DIG_BACKOFF_MAX 12
-#define DM_DIG_BACKOFF_MIN -4
-
#define RxPathSelection_SS_TH_low 30
#define RxPathSelection_diff_TH 18

@@ -55,8 +46,6 @@
#define RateAdaptiveTH_Low_40M 10
#define VeryLowRSSI 15

-#define CTSToSelfTHVal 35
-
#define WAIotTHVal 25

#define E_FOR_TX_POWER_TRACK 300
@@ -70,14 +59,6 @@
#define Tx_Retry_Count_Reg 0x1ac
#define RegC38_TH 20

-#define TX_POWER_NEAR_FIELD_THRESH_LVL2 74
-#define TX_POWER_NEAR_FIELD_THRESH_LVL1 67
-
-#define TxHighPwrLevel_Normal 0
-#define TxHighPwrLevel_Level1 1
-#define TxHighPwrLevel_Level2 2
-
-#define DM_Type_ByFW 0
#define DM_Type_ByDriver 1

/*--------------------------Define Parameters-------------------------------*/
diff --git a/drivers/staging/rtl8192e/rtl8192e/rtl_ps.h b/drivers/staging/rtl8192e/rtl8192e/rtl_ps.h
index 962f2e5..d23c0f1 100644
--- a/drivers/staging/rtl8192e/rtl8192e/rtl_ps.h
+++ b/drivers/staging/rtl8192e/rtl8192e/rtl_ps.h
@@ -30,7 +30,6 @@
struct net_device;

#define RT_CHECK_FOR_HANG_PERIOD 2
-#define INIT_DEFAULT_CHAN 1

void rtl8192_hw_wakeup(struct net_device *dev);
void rtl8192_hw_to_sleep(struct net_device *dev, u64 time);
diff --git a/drivers/staging/rtl8192e/rtl8192e/rtl_wx.c b/drivers/staging/rtl8192e/rtl8192e/rtl_wx.c
index f5e4961..3d77585 100644
--- a/drivers/staging/rtl8192e/rtl8192e/rtl_wx.c
+++ b/drivers/staging/rtl8192e/rtl8192e/rtl_wx.c
@@ -729,9 +729,6 @@ static int r8192_wx_set_enc(struct net_device *dev,
hwkey[i] |= (key[4 * i + 3] & mask) << 24;
}

- #define CONF_WEP40 0x4
- #define CONF_WEP104 0x14
-
switch (wrqu->encoding.flags & IW_ENCODE_INDEX) {
case 0:
key_idx = ieee->crypt_info.tx_keyidx;
diff --git a/drivers/staging/rtl8192e/rtl819x_BA.h b/drivers/staging/rtl8192e/rtl819x_BA.h
index 613e14c..8946664 100644
--- a/drivers/staging/rtl8192e/rtl819x_BA.h
+++ b/drivers/staging/rtl8192e/rtl819x_BA.h
@@ -19,11 +19,7 @@
#ifndef _BATYPE_H_
#define _BATYPE_H_

-#define TOTAL_TXBA_NUM 16
-#define TOTAL_RXBA_NUM 16
-
#define BA_SETUP_TIMEOUT 200
-#define BA_INACT_TIMEOUT 60000

#define BA_POLICY_DELAYED 0
#define BA_POLICY_IMMEDIATE 1
@@ -32,7 +28,6 @@
#define ADDBA_STATUS_REFUSED 37
#define ADDBA_STATUS_INVALID_PARAM 38

-#define DELBA_REASON_QSTA_LEAVING 36
#define DELBA_REASON_END_BA 37
#define DELBA_REASON_UNKNOWN_BA 38
#define DELBA_REASON_TIMEOUT 39
diff --git a/drivers/staging/rtl8192e/rtl819x_HT.h b/drivers/staging/rtl8192e/rtl819x_HT.h
index 0c263d9..51711dc 100644
--- a/drivers/staging/rtl8192e/rtl819x_HT.h
+++ b/drivers/staging/rtl8192e/rtl819x_HT.h
@@ -20,8 +20,6 @@
#define _RTL819XU_HTTYPE_H_

#define MIMO_PS_STATIC 0
-#define MIMO_PS_DYNAMIC 1
-#define MIMO_PS_NOLIMIT 3

#define sHTCLng 4

diff --git a/drivers/staging/rtl8192e/rtl819x_TS.h b/drivers/staging/rtl8192e/rtl819x_TS.h
index b8fed55..a93348c 100644
--- a/drivers/staging/rtl8192e/rtl819x_TS.h
+++ b/drivers/staging/rtl8192e/rtl819x_TS.h
@@ -19,8 +19,6 @@
#ifndef _TSTYPE_H_
#define _TSTYPE_H_
#include "rtl819x_Qos.h"
-#define TS_SETUP_TIMEOUT 60
-#define TS_INACT_TIMEOUT 60
#define TS_ADDBA_DELAY 60

#define TOTAL_TS_NUM 16
diff --git a/drivers/staging/rtl8192e/rtllib.h b/drivers/staging/rtl8192e/rtllib.h
index fd38c6d..8ba92ed 100644
--- a/drivers/staging/rtl8192e/rtllib.h
+++ b/drivers/staging/rtl8192e/rtllib.h
@@ -84,9 +84,6 @@
#define iwe_stream_add_point_rsl(info, start, stop, iwe, p) \
iwe_stream_add_point(info, start, stop, iwe, p)

-#define usb_alloc_urb_rsl(x, y) usb_alloc_urb(x, y)
-#define usb_submit_urb_rsl(x, y) usb_submit_urb(x, y)
-
static inline void *netdev_priv_rsl(struct net_device *dev)
{
return netdev_priv(dev);
@@ -110,27 +107,14 @@ static inline void *netdev_priv_rsl(struct net_device *dev)
#define HIGH_QUEUE 7
#define BEACON_QUEUE 8

-#define LOW_QUEUE BE_QUEUE
-#define NORMAL_QUEUE MGNT_QUEUE
-
#ifndef IW_MODE_MESH
#define IW_MODE_MESH 7
#endif
-#define AMSDU_SUBHEADER_LEN 14
-#define SWRF_TIMEOUT 50

#define IE_CISCO_FLAG_POSITION 0x08
#define SUPPORT_CKIP_MIC 0x08
#define SUPPORT_CKIP_PK 0x10
-#define RT_RF_OFF_LEVL_ASPM BIT0
-#define RT_RF_OFF_LEVL_CLK_REQ BIT1
-#define RT_RF_OFF_LEVL_PCI_D3 BIT2
#define RT_RF_OFF_LEVL_HALT_NIC BIT3
-#define RT_RF_OFF_LEVL_FREE_FW BIT4
-#define RT_RF_OFF_LEVL_FW_32K BIT5
-#define RT_RF_PS_LEVEL_ALWAYS_ASPM BIT6
-#define RT_RF_LPS_DISALBE_2R BIT30
-#define RT_RF_LPS_LEVEL_ASPM BIT31
#define RT_IN_PS_LEVEL(pPSC, _PS_FLAG) \
((pPSC->CurPsLevel & _PS_FLAG) ? true : false)
#define RT_CLEAR_PS_LEVEL(pPSC, _PS_FLAG) \
@@ -244,22 +228,6 @@ struct sw_chnl_cmd {
#define MGN_MCS13 0x8d
#define MGN_MCS14 0x8e
#define MGN_MCS15 0x8f
-#define MGN_MCS0_SG 0x90
-#define MGN_MCS1_SG 0x91
-#define MGN_MCS2_SG 0x92
-#define MGN_MCS3_SG 0x93
-#define MGN_MCS4_SG 0x94
-#define MGN_MCS5_SG 0x95
-#define MGN_MCS6_SG 0x96
-#define MGN_MCS7_SG 0x97
-#define MGN_MCS8_SG 0x98
-#define MGN_MCS9_SG 0x99
-#define MGN_MCS10_SG 0x9a
-#define MGN_MCS11_SG 0x9b
-#define MGN_MCS12_SG 0x9c
-#define MGN_MCS13_SG 0x9d
-#define MGN_MCS14_SG 0x9e
-#define MGN_MCS15_SG 0x9f

enum hw_variables {
HW_VAR_ETHER_ADDR,
@@ -748,16 +716,11 @@ struct rtllib_stats {

struct rtllib_device;

-#define SEC_KEY_1 (1<<0)
-#define SEC_KEY_2 (1<<1)
-#define SEC_KEY_3 (1<<2)
-#define SEC_KEY_4 (1<<3)
#define SEC_ACTIVE_KEY (1<<4)
#define SEC_AUTH_MODE (1<<5)
#define SEC_UNICAST_GROUP (1<<6)
#define SEC_LEVEL (1<<7)
#define SEC_ENABLED (1<<8)
-#define SEC_ENCRYPT (1<<9)

#define SEC_LEVEL_0 0 /* None */
#define SEC_LEVEL_1 1 /* WEP 40 and 104 bit */
@@ -772,7 +735,6 @@ struct rtllib_device;

#define WEP_KEY_LEN 13
#define SCM_KEY_LEN 32
-#define SCM_TEMPORAL_KEY_LENGTH 16

struct rtllib_security {
u16 active_key:2,
@@ -1187,8 +1149,6 @@ enum {WMM_all_frame, WMM_two_frame, WMM_four_frame, WMM_six_frame};
#define WME_AC_BE 0x01
#define WME_AC_VI 0x02
#define WME_AC_VO 0x03
-#define WME_ACI_MASK 0x03
-#define WME_AIFSN_MASK 0x03
#define WME_AC_PRAM_LEN 16

#define MAX_RECEIVE_BUFFER_SIZE 9100
diff --git a/drivers/staging/rtl8192e/rtllib_softmac.c b/drivers/staging/rtl8192e/rtllib_softmac.c
index d320c31..eac7f28 100644
--- a/drivers/staging/rtl8192e/rtllib_softmac.c
+++ b/drivers/staging/rtl8192e/rtllib_softmac.c
@@ -1511,7 +1511,6 @@ static void rtllib_associate_step2(struct rtllib_device *ieee)
}
}

-#define CANCELLED 2
static void rtllib_associate_complete_wq(void *data)
{
struct rtllib_device *ieee = (struct rtllib_device *)
--
1.8.4.1

2015-07-14 20:04:42

by Mateusz Kulikowski

[permalink] [raw]
Subject: [PATCH v2 03/23] staging: rtl8192e: Remove undefs

They relate to macros that are not used in the driver.

Signed-off-by: Mateusz Kulikowski <[email protected]>
---
drivers/staging/rtl8192e/rtl8192e/rtl_core.c | 19 -------------------
1 file changed, 19 deletions(-)

diff --git a/drivers/staging/rtl8192e/rtl8192e/rtl_core.c b/drivers/staging/rtl8192e/rtl8192e/rtl_core.c
index c6cdb43..32bf475 100644
--- a/drivers/staging/rtl8192e/rtl8192e/rtl_core.c
+++ b/drivers/staging/rtl8192e/rtl8192e/rtl_core.c
@@ -22,25 +22,6 @@
* Contact Information:
* wlanfae <[email protected]>
******************************************************************************/
-#undef RX_DONT_PASS_UL
-#undef DEBUG_EPROM
-#undef DEBUG_RX_VERBOSE
-#undef DUMMY_RX
-#undef DEBUG_ZERO_RX
-#undef DEBUG_RX_SKB
-#undef DEBUG_TX_FRAG
-#undef DEBUG_RX_FRAG
-#undef DEBUG_TX_FILLDESC
-#undef DEBUG_TX
-#undef DEBUG_IRQ
-#undef DEBUG_RX
-#undef DEBUG_RXALLOC
-#undef DEBUG_REGISTERS
-#undef DEBUG_RING
-#undef DEBUG_IRQ_TASKLET
-#undef DEBUG_TX_ALLOC
-#undef DEBUG_TX_DESC
-
#include <linux/uaccess.h>
#include <linux/pci.h>
#include <linux/vmalloc.h>
--
1.8.4.1

2015-07-14 20:11:34

by Mateusz Kulikowski

[permalink] [raw]
Subject: [PATCH v2 04/23] staging: rtl8192e: Remove unused enums

Remove ack_policy enum and some unused RTL_DEBUG enums.

Signed-off-by: Mateusz Kulikowski <[email protected]>
---
drivers/staging/rtl8192e/rtl819x_Qos.h | 5 -----
drivers/staging/rtl8192e/rtllib_debug.h | 6 ------
2 files changed, 11 deletions(-)

diff --git a/drivers/staging/rtl8192e/rtl819x_Qos.h b/drivers/staging/rtl8192e/rtl819x_Qos.h
index 3aa35ce..fcc8fab 100644
--- a/drivers/staging/rtl8192e/rtl819x_Qos.h
+++ b/drivers/staging/rtl8192e/rtl819x_Qos.h
@@ -96,11 +96,6 @@ struct octet_string {
u16 Length;
};

-enum ack_policy {
- eAckPlc0_ACK = 0x00,
- eAckPlc1_NoACK = 0x01,
-};
-
#define AC0_BE 0
#define AC1_BK 1
#define AC2_VI 2
diff --git a/drivers/staging/rtl8192e/rtllib_debug.h b/drivers/staging/rtl8192e/rtllib_debug.h
index 42e88d6..2f47a7c 100644
--- a/drivers/staging/rtl8192e/rtllib_debug.h
+++ b/drivers/staging/rtl8192e/rtllib_debug.h
@@ -40,10 +40,7 @@ enum RTL_DEBUG {
COMP_DBG = (1 << 1),
COMP_INIT = (1 << 2),
COMP_RECV = (1 << 3),
- COMP_SEND = (1 << 4),
- COMP_CMD = (1 << 5),
COMP_POWER = (1 << 6),
- COMP_EPROM = (1 << 7),
COMP_SWBW = (1 << 8),
COMP_SEC = (1 << 9),
COMP_LPS = (1 << 10),
@@ -58,15 +55,12 @@ enum RTL_DEBUG {
COMP_CH = (1 << 19),
COMP_RF = (1 << 20),
COMP_FIRMWARE = (1 << 21),
- COMP_HT = (1 << 22),
COMP_RESET = (1 << 23),
COMP_CMDPKT = (1 << 24),
COMP_SCAN = (1 << 25),
COMP_PS = (1 << 26),
COMP_DOWN = (1 << 27),
COMP_INTR = (1 << 28),
- COMP_LED = (1 << 29),
- COMP_MLME = (1 << 30),
COMP_ERR = (1 << 31)
};

--
1.8.4.1

2015-07-14 20:10:38

by Mateusz Kulikowski

[permalink] [raw]
Subject: [PATCH v2 05/23] staging: rtl8192e: Remove unused fields from rtllib_stats

None of them are used in the driver.

Signed-off-by: Mateusz Kulikowski <[email protected]>
---
drivers/staging/rtl8192e/rtllib.h | 19 -------------------
1 file changed, 19 deletions(-)

diff --git a/drivers/staging/rtl8192e/rtllib.h b/drivers/staging/rtl8192e/rtllib.h
index 8ba92ed..dc0653a 100644
--- a/drivers/staging/rtl8192e/rtllib.h
+++ b/drivers/staging/rtl8192e/rtllib.h
@@ -691,27 +691,8 @@ struct rtllib_frag_entry {
};

struct rtllib_stats {
- unsigned int tx_unicast_frames;
- unsigned int tx_multicast_frames;
- unsigned int tx_fragments;
- unsigned int tx_unicast_octets;
- unsigned int tx_multicast_octets;
- unsigned int tx_deferred_transmissions;
- unsigned int tx_single_retry_frames;
- unsigned int tx_multiple_retry_frames;
- unsigned int tx_retry_limit_exceeded;
unsigned int tx_discards;
- unsigned int rx_unicast_frames;
- unsigned int rx_multicast_frames;
- unsigned int rx_fragments;
- unsigned int rx_unicast_octets;
- unsigned int rx_multicast_octets;
- unsigned int rx_fcs_errors;
- unsigned int rx_discards_no_buffer;
- unsigned int tx_discards_wrong_sa;
unsigned int rx_discards_undecryptable;
- unsigned int rx_message_in_msg_fragments;
- unsigned int rx_message_in_bad_msg_fragments;
};

struct rtllib_device;
--
1.8.4.1

2015-07-14 20:04:46

by Mateusz Kulikowski

[permalink] [raw]
Subject: [PATCH v2 06/23] staging: rtl8192e: Remove rtllib_stats structure

Two remaining fields of rtllib_stats are only incremented, but
never read.

Signed-off-by: Mateusz Kulikowski <[email protected]>
---
drivers/staging/rtl8192e/rtllib.h | 6 ------
drivers/staging/rtl8192e/rtllib_rx.c | 2 --
drivers/staging/rtl8192e/rtllib_tx.c | 1 -
3 files changed, 9 deletions(-)

diff --git a/drivers/staging/rtl8192e/rtllib.h b/drivers/staging/rtl8192e/rtllib.h
index dc0653a..c44c868 100644
--- a/drivers/staging/rtl8192e/rtllib.h
+++ b/drivers/staging/rtl8192e/rtllib.h
@@ -690,11 +690,6 @@ struct rtllib_frag_entry {
u8 dst_addr[ETH_ALEN];
};

-struct rtllib_stats {
- unsigned int tx_discards;
- unsigned int rx_discards_undecryptable;
-};
-
struct rtllib_device;

#define SEC_ACTIVE_KEY (1<<4)
@@ -1532,7 +1527,6 @@ struct rtllib_device {

/* Bookkeeping structures */
struct net_device_stats stats;
- struct rtllib_stats ieee_stats;
struct rtllib_softmac_stats softmac_stats;

/* Probe / Beacon management */
diff --git a/drivers/staging/rtl8192e/rtllib_rx.c b/drivers/staging/rtl8192e/rtllib_rx.c
index da862c3..0698a0d 100644
--- a/drivers/staging/rtl8192e/rtllib_rx.c
+++ b/drivers/staging/rtl8192e/rtllib_rx.c
@@ -317,7 +317,6 @@ rtllib_rx_frame_decrypt(struct rtllib_device *ieee, struct sk_buff *skb,
netdev_dbg(ieee->dev,
"Decryption failed ICV mismatch (key %d)\n",
skb->data[hdrlen + 3] >> 6);
- ieee->ieee_stats.rx_discards_undecryptable++;
return -1;
}

@@ -1077,7 +1076,6 @@ static int rtllib_rx_get_crypt(struct rtllib_device *ieee, struct sk_buff *skb,
netdev_dbg(ieee->dev,
"Decryption failed (not set) (SA= %pM)\n",
hdr->addr2);
- ieee->ieee_stats.rx_discards_undecryptable++;
return -1;
}
}
diff --git a/drivers/staging/rtl8192e/rtllib_tx.c b/drivers/staging/rtl8192e/rtllib_tx.c
index e99ea5e..517500c 100644
--- a/drivers/staging/rtl8192e/rtllib_tx.c
+++ b/drivers/staging/rtl8192e/rtllib_tx.c
@@ -205,7 +205,6 @@ int rtllib_encrypt_fragment(struct rtllib_device *ieee, struct sk_buff *frag,
if (res < 0) {
netdev_info(ieee->dev, "%s: Encryption failed: len=%d.\n",
ieee->dev->name, frag->len);
- ieee->ieee_stats.tx_discards++;
return -1;
}

--
1.8.4.1

2015-07-14 20:09:56

by Mateusz Kulikowski

[permalink] [raw]
Subject: [PATCH v2 07/23] staging: rtl8192e: Remove unused ether_header structure

Structure is not used in the driver.

Signed-off-by: Mateusz Kulikowski <[email protected]>
---
drivers/staging/rtl8192e/rtllib.h | 6 ------
1 file changed, 6 deletions(-)

diff --git a/drivers/staging/rtl8192e/rtllib.h b/drivers/staging/rtl8192e/rtllib.h
index c44c868..81a3b93 100644
--- a/drivers/staging/rtl8192e/rtllib.h
+++ b/drivers/staging/rtl8192e/rtllib.h
@@ -1140,12 +1140,6 @@ enum {WMM_all_frame, WMM_two_frame, WMM_four_frame, WMM_six_frame};
#define ETHERNET_HEADER_SIZE 14 /* length of two Ethernet address
* plus ether type*/

-struct ether_header {
- u8 ether_dhost[ETHER_ADDR_LEN];
- u8 ether_shost[ETHER_ADDR_LEN];
- u16 ether_type;
-} __packed;
-
enum erp_t {
ERP_NonERPpresent = 0x01,
ERP_UseProtection = 0x02,
--
1.8.4.1

2015-07-14 20:04:49

by Mateusz Kulikowski

[permalink] [raw]
Subject: [PATCH v2 08/23] staging: rtl8192e: Remove unused rtllib_device::freq_band

Member is never referenced.

Signed-off-by: Mateusz Kulikowski <[email protected]>
---
drivers/staging/rtl8192e/rtllib.h | 1 -
1 file changed, 1 deletion(-)

diff --git a/drivers/staging/rtl8192e/rtllib.h b/drivers/staging/rtl8192e/rtllib.h
index 81a3b93..65c22db 100644
--- a/drivers/staging/rtl8192e/rtllib.h
+++ b/drivers/staging/rtl8192e/rtllib.h
@@ -1602,7 +1602,6 @@ struct rtllib_device {
int short_slot;
int mode; /* A, B, G */
int modulation; /* CCK, OFDM */
- int freq_band; /* 2.4Ghz, 5.2Ghz, Mixed */

/* used for forcing the ibss workqueue to terminate
* without wait for the syncro scan to terminate
--
1.8.4.1

2015-07-14 20:09:20

by Mateusz Kulikowski

[permalink] [raw]
Subject: [PATCH v2 09/23] staging: rtl8192e: Remove DOT11D_GetMaxTxPwrInDbm()

Function is not used.

Signed-off-by: Mateusz Kulikowski <[email protected]>
---
drivers/staging/rtl8192e/dot11d.c | 15 ---------------
drivers/staging/rtl8192e/dot11d.h | 1 -
2 files changed, 16 deletions(-)

diff --git a/drivers/staging/rtl8192e/dot11d.c b/drivers/staging/rtl8192e/dot11d.c
index 7f48845..fcf9b3b 100644
--- a/drivers/staging/rtl8192e/dot11d.c
+++ b/drivers/staging/rtl8192e/dot11d.c
@@ -160,21 +160,6 @@ void Dot11d_UpdateCountryIe(struct rtllib_device *dev, u8 *pTaddr,
pDot11dInfo->State = DOT11D_STATE_LEARNED;
}

-u8 DOT11D_GetMaxTxPwrInDbm(struct rtllib_device *dev, u8 Channel)
-{
- struct rt_dot11d_info *pDot11dInfo = GET_DOT11D_INFO(dev);
- u8 MaxTxPwrInDbm = 255;
-
- if (MAX_CHANNEL_NUMBER < Channel) {
- netdev_info(dev->dev, "DOT11D_GetMaxTxPwrInDbm(): Invalid Channel\n");
- return MaxTxPwrInDbm;
- }
- if (pDot11dInfo->channel_map[Channel])
- MaxTxPwrInDbm = pDot11dInfo->MaxTxPwrDbmList[Channel];
-
- return MaxTxPwrInDbm;
-}
-
void DOT11D_ScanComplete(struct rtllib_device *dev)
{
struct rt_dot11d_info *pDot11dInfo = GET_DOT11D_INFO(dev);
diff --git a/drivers/staging/rtl8192e/dot11d.h b/drivers/staging/rtl8192e/dot11d.h
index 127af82..129ebed 100644
--- a/drivers/staging/rtl8192e/dot11d.h
+++ b/drivers/staging/rtl8192e/dot11d.h
@@ -92,7 +92,6 @@ void Dot11d_Channelmap(u8 channel_plan, struct rtllib_device *ieee);
void Dot11d_Reset(struct rtllib_device *dev);
void Dot11d_UpdateCountryIe(struct rtllib_device *dev, u8 *pTaddr,
u16 CoutryIeLen, u8 *pCoutryIe);
-u8 DOT11D_GetMaxTxPwrInDbm(struct rtllib_device *dev, u8 Channel);
void DOT11D_ScanComplete(struct rtllib_device *dev);

#endif
--
1.8.4.1

2015-07-14 20:04:53

by Mateusz Kulikowski

[permalink] [raw]
Subject: [PATCH v2 10/23] staging: rtl8192e: Remove read|write_nic_io_(d)word|byte()

None of this functions was used.
Also remove PlatformIOCheckPageLegalAndGetRegMask() used by them.

Signed-off-by: Mateusz Kulikowski <[email protected]>
---
drivers/staging/rtl8192e/rtl8192e/rtl_core.c | 158 ---------------------------
drivers/staging/rtl8192e/rtl8192e/rtl_core.h | 7 --
2 files changed, 165 deletions(-)

diff --git a/drivers/staging/rtl8192e/rtl8192e/rtl_core.c b/drivers/staging/rtl8192e/rtl8192e/rtl_core.c
index 32bf475..8134359 100644
--- a/drivers/staging/rtl8192e/rtl8192e/rtl_core.c
+++ b/drivers/staging/rtl8192e/rtl8192e/rtl_core.c
@@ -90,164 +90,6 @@ static struct pci_driver rtl8192_pci_driver = {
/****************************************************************************
-----------------------------IO STUFF-------------------------
*****************************************************************************/
-static bool PlatformIOCheckPageLegalAndGetRegMask(u32 u4bPage, u8 *pu1bPageMask)
-{
- bool bReturn = false;
-
- *pu1bPageMask = 0xfe;
-
- switch (u4bPage) {
- case 1: case 2: case 3: case 4:
- case 8: case 9: case 10: case 12: case 13:
- bReturn = true;
- *pu1bPageMask = 0xf0;
- break;
-
- default:
- bReturn = false;
- break;
- }
-
- return bReturn;
-}
-
-void write_nic_io_byte(struct net_device *dev, int x, u8 y)
-{
- u32 u4bPage = x >> 8;
- u8 u1PageMask = 0;
- bool bIsLegalPage = false;
-
- if (u4bPage == 0) {
- outb(y&0xff, dev->base_addr + x);
-
- } else {
- bIsLegalPage = PlatformIOCheckPageLegalAndGetRegMask(u4bPage,
- &u1PageMask);
- if (bIsLegalPage) {
- u8 u1bPsr = read_nic_io_byte(dev, PSR);
-
- write_nic_io_byte(dev, PSR, ((u1bPsr & u1PageMask) |
- (u8)u4bPage));
- write_nic_io_byte(dev, (x & 0xff), y);
- write_nic_io_byte(dev, PSR, (u1bPsr & u1PageMask));
- }
- }
-}
-
-void write_nic_io_word(struct net_device *dev, int x, u16 y)
-{
- u32 u4bPage = x >> 8;
- u8 u1PageMask = 0;
- bool bIsLegalPage = false;
-
- if (u4bPage == 0) {
- outw(y, dev->base_addr + x);
- } else {
- bIsLegalPage = PlatformIOCheckPageLegalAndGetRegMask(u4bPage,
- &u1PageMask);
- if (bIsLegalPage) {
- u8 u1bPsr = read_nic_io_byte(dev, PSR);
-
- write_nic_io_byte(dev, PSR, ((u1bPsr & u1PageMask) |
- (u8)u4bPage));
- write_nic_io_word(dev, (x & 0xff), y);
- write_nic_io_byte(dev, PSR, (u1bPsr & u1PageMask));
-
- }
- }
-}
-
-void write_nic_io_dword(struct net_device *dev, int x, u32 y)
-{
- u32 u4bPage = x >> 8;
- u8 u1PageMask = 0;
- bool bIsLegalPage = false;
-
- if (u4bPage == 0) {
- outl(y, dev->base_addr + x);
- } else {
- bIsLegalPage = PlatformIOCheckPageLegalAndGetRegMask(u4bPage,
- &u1PageMask);
- if (bIsLegalPage) {
- u8 u1bPsr = read_nic_io_byte(dev, PSR);
-
- write_nic_io_byte(dev, PSR, ((u1bPsr & u1PageMask) |
- (u8)u4bPage));
- write_nic_io_dword(dev, (x & 0xff), y);
- write_nic_io_byte(dev, PSR, (u1bPsr & u1PageMask));
- }
- }
-}
-
-u8 read_nic_io_byte(struct net_device *dev, int x)
-{
- u32 u4bPage = x >> 8;
- u8 u1PageMask = 0;
- bool bIsLegalPage = false;
- u8 Data = 0;
-
- if (u4bPage == 0)
- return 0xff&inb(dev->base_addr + x);
-
- bIsLegalPage = PlatformIOCheckPageLegalAndGetRegMask(u4bPage,
- &u1PageMask);
- if (bIsLegalPage) {
- u8 u1bPsr = read_nic_io_byte(dev, PSR);
-
- write_nic_io_byte(dev, PSR, ((u1bPsr & u1PageMask) |
- (u8)u4bPage));
- Data = read_nic_io_byte(dev, (x & 0xff));
- write_nic_io_byte(dev, PSR, (u1bPsr & u1PageMask));
- }
-
- return Data;
-}
-
-u16 read_nic_io_word(struct net_device *dev, int x)
-{
- u32 u4bPage = x >> 8;
- u8 u1PageMask = 0;
- bool bIsLegalPage = false;
- u16 Data = 0;
-
- if (u4bPage == 0)
- return inw(dev->base_addr + x);
- bIsLegalPage = PlatformIOCheckPageLegalAndGetRegMask(u4bPage,
- &u1PageMask);
- if (bIsLegalPage) {
- u8 u1bPsr = read_nic_io_byte(dev, PSR);
-
- write_nic_io_byte(dev, PSR, ((u1bPsr & u1PageMask) |
- (u8)u4bPage));
- Data = read_nic_io_word(dev, (x & 0xff));
- write_nic_io_byte(dev, PSR, (u1bPsr & u1PageMask));
- }
-
- return Data;
-}
-
-u32 read_nic_io_dword(struct net_device *dev, int x)
-{
- u32 u4bPage = x >> 8;
- u8 u1PageMask = 0;
- bool bIsLegalPage = false;
- u32 Data = 0;
-
- if (u4bPage == 0)
- return inl(dev->base_addr + x);
- bIsLegalPage = PlatformIOCheckPageLegalAndGetRegMask(u4bPage,
- &u1PageMask);
- if (bIsLegalPage) {
- u8 u1bPsr = read_nic_io_byte(dev, PSR);
-
- write_nic_io_byte(dev, PSR, ((u1bPsr & u1PageMask) |
- (u8)u4bPage));
- Data = read_nic_io_dword(dev, (x & 0xff));
- write_nic_io_byte(dev, PSR, (u1bPsr & u1PageMask));
- }
-
- return Data;
-}

u8 read_nic_byte(struct net_device *dev, int x)
{
diff --git a/drivers/staging/rtl8192e/rtl8192e/rtl_core.h b/drivers/staging/rtl8192e/rtl8192e/rtl_core.h
index 776d950..cb7af04 100644
--- a/drivers/staging/rtl8192e/rtl8192e/rtl_core.h
+++ b/drivers/staging/rtl8192e/rtl8192e/rtl_core.h
@@ -581,13 +581,6 @@ extern const struct ethtool_ops rtl819x_ethtool_ops;
void rtl8192_tx_cmd(struct net_device *dev, struct sk_buff *skb);
short rtl8192_tx(struct net_device *dev, struct sk_buff *skb);

-u8 read_nic_io_byte(struct net_device *dev, int x);
-u32 read_nic_io_dword(struct net_device *dev, int x);
-u16 read_nic_io_word(struct net_device *dev, int x);
-void write_nic_io_byte(struct net_device *dev, int x, u8 y);
-void write_nic_io_word(struct net_device *dev, int x, u16 y);
-void write_nic_io_dword(struct net_device *dev, int x, u32 y);
-
u8 read_nic_byte(struct net_device *dev, int x);
u32 read_nic_dword(struct net_device *dev, int x);
u16 read_nic_word(struct net_device *dev, int x);
--
1.8.4.1

2015-07-14 20:09:19

by Mateusz Kulikowski

[permalink] [raw]
Subject: [PATCH v2 11/23] staging: rtl8192e: Remove DMESG macro

It is used in several places, but expands to nothing.

Signed-off-by: Mateusz Kulikowski <[email protected]>
---
drivers/staging/rtl8192e/rtl8192e/r8192E_dev.c | 1 -
drivers/staging/rtl8192e/rtl8192e/rtl_core.c | 3 ---
drivers/staging/rtl8192e/rtl8192e/rtl_wx.c | 4 ----
drivers/staging/rtl8192e/rtllib_debug.h | 2 --
4 files changed, 10 deletions(-)

diff --git a/drivers/staging/rtl8192e/rtl8192e/r8192E_dev.c b/drivers/staging/rtl8192e/rtl8192e/r8192E_dev.c
index f6661bb..459ce65 100644
--- a/drivers/staging/rtl8192e/rtl8192e/r8192E_dev.c
+++ b/drivers/staging/rtl8192e/rtl8192e/r8192E_dev.c
@@ -41,7 +41,6 @@ void rtl8192e_start_beacon(struct net_device *dev)
u16 BcnCW = 6;
u16 BcnIFS = 0xf;

- DMESG("Enabling beacon TX");
rtl8192_irq_disable(dev);

write_nic_word(dev, ATIMWND, 2);
diff --git a/drivers/staging/rtl8192e/rtl8192e/rtl_core.c b/drivers/staging/rtl8192e/rtl8192e/rtl_core.c
index 8134359..1652da6 100644
--- a/drivers/staging/rtl8192e/rtl8192e/rtl_core.c
+++ b/drivers/staging/rtl8192e/rtl8192e/rtl_core.c
@@ -2723,8 +2723,6 @@ err_rel_mem:
release_mem_region(pmem_start, pmem_len);
err_rel_rtllib:
free_rtllib(dev);
-
- DMESG("wlan driver load failed\n");
err_pci_disable:
pci_disable_device(pdev);
return err;
@@ -2830,7 +2828,6 @@ static int __init rtl8192_pci_module_init(void)
pr_info("Copyright (c) 2007-2008, Realsil Wlan Driver\n");

if (0 != pci_register_driver(&rtl8192_pci_driver)) {
- DMESG("No device found");
/*pci_unregister_driver (&rtl8192_pci_driver);*/
return -ENODEV;
}
diff --git a/drivers/staging/rtl8192e/rtl8192e/rtl_wx.c b/drivers/staging/rtl8192e/rtl8192e/rtl_wx.c
index 3d77585..15fc484 100644
--- a/drivers/staging/rtl8192e/rtl8192e/rtl_wx.c
+++ b/drivers/staging/rtl8192e/rtl8192e/rtl_wx.c
@@ -818,13 +818,9 @@ static int r8192_wx_set_retry(struct net_device *dev,
}
if (wrqu->retry.flags & IW_RETRY_MAX) {
priv->retry_rts = wrqu->retry.value;
- DMESG("Setting retry for RTS/CTS data to %d",
- wrqu->retry.value);

} else {
priv->retry_data = wrqu->retry.value;
- DMESG("Setting retry for non RTS/CTS data to %d",
- wrqu->retry.value);
}


diff --git a/drivers/staging/rtl8192e/rtllib_debug.h b/drivers/staging/rtl8192e/rtllib_debug.h
index 2f47a7c..17c276d 100644
--- a/drivers/staging/rtl8192e/rtllib_debug.h
+++ b/drivers/staging/rtl8192e/rtllib_debug.h
@@ -30,8 +30,6 @@
#define DRV_NAME "rtllib_92e"
#endif

-#define DMESG(x, a...)
-
extern u32 rt_global_debug_component;

/* These are the defines for rt_global_debug_component */
--
1.8.4.1

2015-07-14 20:04:56

by Mateusz Kulikowski

[permalink] [raw]
Subject: [PATCH v2 12/23] staging: rtl8192e: Remove rtl819x_process_cck_rxpathsel()

Function is empty.

Signed-off-by: Mateusz Kulikowski <[email protected]>
---
drivers/staging/rtl8192e/rtl8192e/r8192E_dev.c | 2 --
drivers/staging/rtl8192e/rtl8192e/rtl_core.c | 6 ------
drivers/staging/rtl8192e/rtl8192e/rtl_core.h | 2 --
3 files changed, 10 deletions(-)

diff --git a/drivers/staging/rtl8192e/rtl8192e/r8192E_dev.c b/drivers/staging/rtl8192e/rtl8192e/r8192E_dev.c
index 459ce65..f28676b 100644
--- a/drivers/staging/rtl8192e/rtl8192e/r8192E_dev.c
+++ b/drivers/staging/rtl8192e/rtl8192e/r8192E_dev.c
@@ -1731,8 +1731,6 @@ static void rtl8192_process_phyinfo(struct r8192_priv *priv, u8 *buffer,
if (!bcheck)
return;

- rtl819x_process_cck_rxpathsel(priv, prev_st);
-
priv->stats.num_process_phyinfo++;
if (!prev_st->bIsCCK && prev_st->bPacketToSelf) {
for (rfpath = RF90_PATH_A; rfpath < RF90_PATH_C; rfpath++) {
diff --git a/drivers/staging/rtl8192e/rtl8192e/rtl_core.c b/drivers/staging/rtl8192e/rtl8192e/rtl_core.c
index 1652da6..57eb43e 100644
--- a/drivers/staging/rtl8192e/rtl8192e/rtl_core.c
+++ b/drivers/staging/rtl8192e/rtl8192e/rtl_core.c
@@ -2012,12 +2012,6 @@ rtl819x_update_rxsignalstatistics8190pci(
weighting) / 6;
}

-void rtl819x_process_cck_rxpathsel(struct r8192_priv *priv,
- struct rtllib_rx_stats *pprevious_stats)
-{
-}
-
-
u8 rtl819x_query_rxpwrpercentage(char antpower)
{
if ((antpower <= -100) || (antpower >= 20))
diff --git a/drivers/staging/rtl8192e/rtl8192e/rtl_core.h b/drivers/staging/rtl8192e/rtl8192e/rtl_core.h
index cb7af04..6497918 100644
--- a/drivers/staging/rtl8192e/rtl8192e/rtl_core.h
+++ b/drivers/staging/rtl8192e/rtl8192e/rtl_core.h
@@ -635,8 +635,6 @@ long rtl819x_translate_todbm(struct r8192_priv *priv, u8 signal_strength_index);
void rtl819x_update_rxsignalstatistics8190pci(struct r8192_priv *priv,
struct rtllib_rx_stats *pprevious_stats);
u8 rtl819x_evm_dbtopercentage(char value);
-void rtl819x_process_cck_rxpathsel(struct r8192_priv *priv,
- struct rtllib_rx_stats *pprevious_stats);
u8 rtl819x_query_rxpwrpercentage(char antpower);
void rtl8192_record_rxdesc_forlateruse(struct rtllib_rx_stats *psrc_stats,
struct rtllib_rx_stats *ptarget_stats);
--
1.8.4.1

2015-07-14 20:08:51

by Mateusz Kulikowski

[permalink] [raw]
Subject: [PATCH v2 13/23] staging: rtl8192e: probe: Remove bdma64 check

It is always false.

Signed-off-by: Mateusz Kulikowski <[email protected]>
---
drivers/staging/rtl8192e/rtl8192e/rtl_core.c | 3 ---
1 file changed, 3 deletions(-)

diff --git a/drivers/staging/rtl8192e/rtl8192e/rtl_core.c b/drivers/staging/rtl8192e/rtl8192e/rtl_core.c
index 57eb43e..1dc119ea 100644
--- a/drivers/staging/rtl8192e/rtl8192e/rtl_core.c
+++ b/drivers/staging/rtl8192e/rtl8192e/rtl_core.c
@@ -2599,7 +2599,6 @@ static int rtl8192_pci_probe(struct pci_dev *pdev,
struct rtl819x_ops *ops = (struct rtl819x_ops *)(id->driver_data);
unsigned long pmem_start, pmem_len, pmem_flags;
int err = -ENOMEM;
- bool bdma64 = false;
u8 revision_id;

RT_TRACE(COMP_INIT, "Configuring chip resources");
@@ -2623,8 +2622,6 @@ static int rtl8192_pci_probe(struct pci_dev *pdev,
goto err_pci_disable;

err = -ENODEV;
- if (bdma64)
- dev->features |= NETIF_F_HIGHDMA;

pci_set_drvdata(pdev, dev);
SET_NETDEV_DEV(dev, &pdev->dev);
--
1.8.4.1

2015-07-14 20:08:36

by Mateusz Kulikowski

[permalink] [raw]
Subject: [PATCH v2 14/23] staging: rtl8192e: Remove rtl8192_rx_cmd()

Function is empty.

Signed-off-by: Mateusz Kulikowski <[email protected]>
---
drivers/staging/rtl8192e/rtl8192e/rtl_core.c | 8 --------
1 file changed, 8 deletions(-)

diff --git a/drivers/staging/rtl8192e/rtl8192e/rtl_core.c b/drivers/staging/rtl8192e/rtl8192e/rtl_core.c
index 1dc119ea..a550634 100644
--- a/drivers/staging/rtl8192e/rtl8192e/rtl_core.c
+++ b/drivers/staging/rtl8192e/rtl8192e/rtl_core.c
@@ -2161,11 +2161,6 @@ done:

}

-static void rtl8192_rx_cmd(struct net_device *dev)
-{
-}
-
-
static void rtl8192_tx_resume(struct net_device *dev)
{
struct r8192_priv *priv = (struct r8192_priv *)rtllib_priv(dev);
@@ -2192,9 +2187,6 @@ void rtl8192_irq_rx_tasklet(struct r8192_priv *priv)
{
rtl8192_rx_normal(priv->rtllib->dev);

- if (MAX_RX_QUEUE > 1)
- rtl8192_rx_cmd(priv->rtllib->dev);
-
write_nic_dword(priv->rtllib->dev, INTA_MASK,
read_nic_dword(priv->rtllib->dev, INTA_MASK) | IMR_RDU);
}
--
1.8.4.1

2015-07-14 20:05:08

by Mateusz Kulikowski

[permalink] [raw]
Subject: [PATCH v2 15/23] staging: rtl8192e: rtl_dm: Make functions static

Make as many functions as possible static in rtllib_dm.c.

The following functions were affected:
- dm_check_fsync
- dm_CheckRfCtrlGPIO
- dm_fsync_timer_callback

Signed-off-by: Mateusz Kulikowski <[email protected]>
---
drivers/staging/rtl8192e/rtl8192e/rtl_dm.c | 9 ++++++---
drivers/staging/rtl8192e/rtl8192e/rtl_dm.h | 3 ---
2 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/drivers/staging/rtl8192e/rtl8192e/rtl_dm.c b/drivers/staging/rtl8192e/rtl8192e/rtl_dm.c
index bce960d..c236712 100644
--- a/drivers/staging/rtl8192e/rtl8192e/rtl_dm.c
+++ b/drivers/staging/rtl8192e/rtl8192e/rtl_dm.c
@@ -210,6 +210,9 @@ static void dm_deInit_fsync(struct net_device *dev);

static void dm_check_txrateandretrycount(struct net_device *dev);
static void dm_check_ac_dc_power(struct net_device *dev);
+static void dm_check_fsync(struct net_device *dev);
+static void dm_CheckRfCtrlGPIO(void *data);
+static void dm_fsync_timer_callback(unsigned long data);

/*---------------------Define local function prototype-----------------------*/

@@ -1851,7 +1854,7 @@ static void dm_check_pbc_gpio(struct net_device *dev)
{
}

-void dm_CheckRfCtrlGPIO(void *data)
+static void dm_CheckRfCtrlGPIO(void *data)
{
struct r8192_priv *priv = container_of_dwork_rsl(data,
struct r8192_priv, gpio_change_rf_wq);
@@ -2188,7 +2191,7 @@ static void dm_deInit_fsync(struct net_device *dev)
del_timer_sync(&priv->fsync_timer);
}

-void dm_fsync_timer_callback(unsigned long data)
+static void dm_fsync_timer_callback(unsigned long data)
{
struct net_device *dev = (struct net_device *)data;
struct r8192_priv *priv = rtllib_priv((struct net_device *)data);
@@ -2372,7 +2375,7 @@ static void dm_StartSWFsync(struct net_device *dev)

}

-void dm_check_fsync(struct net_device *dev)
+static void dm_check_fsync(struct net_device *dev)
{
#define RegC38_Default 0
#define RegC38_NonFsync_Other_AP 1
diff --git a/drivers/staging/rtl8192e/rtl8192e/rtl_dm.h b/drivers/staging/rtl8192e/rtl8192e/rtl_dm.h
index ac95d8f..95b8a8f 100644
--- a/drivers/staging/rtl8192e/rtl8192e/rtl_dm.h
+++ b/drivers/staging/rtl8192e/rtl8192e/rtl_dm.h
@@ -203,8 +203,5 @@ extern void dm_restore_dynamic_mechanism_state(struct net_device *dev);
extern void dm_backup_dynamic_mechanism_state(struct net_device *dev);
extern void dm_init_edca_turbo(struct net_device *dev);
extern void dm_rf_pathcheck_workitemcallback(void *data);
-extern void dm_fsync_timer_callback(unsigned long data);
-extern void dm_check_fsync(struct net_device *dev);
extern void dm_initialize_txpower_tracking(struct net_device *dev);
-extern void dm_CheckRfCtrlGPIO(void *data);
#endif /*__R8192UDM_H__ */
--
1.8.4.1

2015-07-14 20:05:05

by Mateusz Kulikowski

[permalink] [raw]
Subject: [PATCH v2 16/23] staging: rtl8192e: rtllib_HTProc: Make functions static

Make as many functions as possible static in rtllib_HTProc.c.

The following functions were affected:
- HTMcsToDataRate
- HTFilterMCSRate

Signed-off-by: Mateusz Kulikowski <[email protected]>
---
drivers/staging/rtl8192e/rtl819x_HTProc.c | 5 +++--
drivers/staging/rtl8192e/rtllib.h | 3 ---
2 files changed, 3 insertions(+), 5 deletions(-)

diff --git a/drivers/staging/rtl8192e/rtl819x_HTProc.c b/drivers/staging/rtl8192e/rtl819x_HTProc.c
index b5c3647..555745b 100644
--- a/drivers/staging/rtl8192e/rtl819x_HTProc.c
+++ b/drivers/staging/rtl8192e/rtl819x_HTProc.c
@@ -117,7 +117,7 @@ void HTUpdateDefaultSetting(struct rtllib_device *ieee)
pHTInfo->RxReorderPendingTime = 30;
}

-u16 HTMcsToDataRate(struct rtllib_device *ieee, u8 nMcsRate)
+static u16 HTMcsToDataRate(struct rtllib_device *ieee, u8 nMcsRate)
{
struct rt_hi_throughput *pHTInfo = ieee->pHTInfo;

@@ -502,7 +502,8 @@ u8 HTGetHighestMCSRate(struct rtllib_device *ieee, u8 *pMCSRateSet,
return mcsRate | 0x80;
}

-u8 HTFilterMCSRate(struct rtllib_device *ieee, u8 *pSupportMCS, u8 *pOperateMCS)
+static u8 HTFilterMCSRate(struct rtllib_device *ieee, u8 *pSupportMCS,
+ u8 *pOperateMCS)
{

u8 i;
diff --git a/drivers/staging/rtl8192e/rtllib.h b/drivers/staging/rtl8192e/rtllib.h
index 65c22db..98f7db0 100644
--- a/drivers/staging/rtl8192e/rtllib.h
+++ b/drivers/staging/rtl8192e/rtllib.h
@@ -2194,7 +2194,6 @@ extern u16 MCS_DATA_RATE[2][2][77];
extern u8 HTCCheck(struct rtllib_device *ieee, u8 *pFrame);
extern void HTResetIOTSetting(struct rt_hi_throughput *pHTInfo);
extern bool IsHTHalfNmodeAPs(struct rtllib_device *ieee);
-extern u16 HTMcsToDataRate(struct rtllib_device *ieee, u8 nMcsRate);
extern u16 TxCountToDataRate(struct rtllib_device *ieee, u8 nDataRate);
extern int rtllib_rx_ADDBAReq(struct rtllib_device *ieee, struct sk_buff *skb);
extern int rtllib_rx_ADDBARsp(struct rtllib_device *ieee, struct sk_buff *skb);
@@ -2256,8 +2255,6 @@ extern int rtllib_parse_info_param(struct rtllib_device *ieee,

void rtllib_indicate_packets(struct rtllib_device *ieee,
struct rtllib_rxb **prxbIndicateArray, u8 index);
-extern u8 HTFilterMCSRate(struct rtllib_device *ieee, u8 *pSupportMCS,
- u8 *pOperateMCS);
extern void HTUseDefaultSetting(struct rtllib_device *ieee);
#define RT_ASOC_RETRY_LIMIT 5
u8 MgntQuery_TxRateExcludeCCKRates(struct rtllib_device *ieee);
--
1.8.4.1

2015-07-14 20:05:03

by Mateusz Kulikowski

[permalink] [raw]
Subject: [PATCH v2 17/23] staging: rtl8192e: Make phy_RF8256_Config_ParaFile() static

Relocate function in driver to avoid adding unnecessary fw decl.

Signed-off-by: Mateusz Kulikowski <[email protected]>
---
drivers/staging/rtl8192e/rtl8192e/r8190P_rtl8256.c | 18 +++++++++---------
drivers/staging/rtl8192e/rtl8192e/r8190P_rtl8256.h | 1 -
2 files changed, 9 insertions(+), 10 deletions(-)

diff --git a/drivers/staging/rtl8192e/rtl8192e/r8190P_rtl8256.c b/drivers/staging/rtl8192e/rtl8192e/r8190P_rtl8256.c
index facc6f1..f3eb1dc 100644
--- a/drivers/staging/rtl8192e/rtl8192e/r8190P_rtl8256.c
+++ b/drivers/staging/rtl8192e/rtl8192e/r8190P_rtl8256.c
@@ -81,15 +81,7 @@ void PHY_SetRF8256Bandwidth(struct net_device *dev,
}
}

-bool PHY_RF8256_Config(struct net_device *dev)
-{
- struct r8192_priv *priv = rtllib_priv(dev);
-
- priv->NumTotalRFPath = RTL819X_TOTAL_RF_PATH;
- return phy_RF8256_Config_ParaFile(dev);
-}
-
-bool phy_RF8256_Config_ParaFile(struct net_device *dev)
+static bool phy_RF8256_Config_ParaFile(struct net_device *dev)
{
u32 u4RegValue = 0;
u8 eRFPath;
@@ -240,6 +232,14 @@ phy_RF8256_Config_ParaFile_Fail:
return false;
}

+bool PHY_RF8256_Config(struct net_device *dev)
+{
+ struct r8192_priv *priv = rtllib_priv(dev);
+
+ priv->NumTotalRFPath = RTL819X_TOTAL_RF_PATH;
+ return phy_RF8256_Config_ParaFile(dev);
+}
+
void PHY_SetRF8256CCKTxPower(struct net_device *dev, u8 powerlevel)
{
u32 TxAGC = 0;
diff --git a/drivers/staging/rtl8192e/rtl8192e/r8190P_rtl8256.h b/drivers/staging/rtl8192e/rtl8192e/r8190P_rtl8256.h
index 64e831d..d9348d9 100644
--- a/drivers/staging/rtl8192e/rtl8192e/r8190P_rtl8256.h
+++ b/drivers/staging/rtl8192e/rtl8192e/r8190P_rtl8256.h
@@ -24,7 +24,6 @@
extern void PHY_SetRF8256Bandwidth(struct net_device *dev,
enum ht_channel_width Bandwidth);
extern bool PHY_RF8256_Config(struct net_device *dev);
-extern bool phy_RF8256_Config_ParaFile(struct net_device *dev);
extern void PHY_SetRF8256CCKTxPower(struct net_device *dev, u8 powerlevel);
extern void PHY_SetRF8256OFDMTxPower(struct net_device *dev, u8 powerlevel);

--
1.8.4.1

2015-07-14 20:08:07

by Mateusz Kulikowski

[permalink] [raw]
Subject: [PATCH v2 18/23] staging: rtl8192e: rtl_core: Make functions static

Make as many functions as possible static in rtl_core.c.
If needed - move fw declaration from header.

The following functions were affected:
- rtl8192_is_tx_queue_empty
- rtl819x_watchdog_wqcallback
- watch_dog_timer_callback
- rtl8192_data_hard_stop
- rtl8192_data_hard_resume
- rtl8192_hard_data_xmit
- rtl8192_hard_start_xmit
- rtl8192_tx_cmd
- rtl8192_tx
- rtl8192_pci_initdescring
- rtl8192_irq_tx_tasklet
- rtl8192_irq_rx_tasklet
- rtl8192_cancel_deferred_work
- _rtl8192_up
- rtl8192_up
- rtl8192_down
- rtl8192_restart
- rtl8192_update_cap

Signed-off-by: Mateusz Kulikowski <[email protected]>
---
drivers/staging/rtl8192e/rtl8192e/rtl_core.c | 64 +++++++++++++++++-----------
drivers/staging/rtl8192e/rtl8192e/rtl_core.h | 24 -----------
2 files changed, 39 insertions(+), 49 deletions(-)

diff --git a/drivers/staging/rtl8192e/rtl8192e/rtl_core.c b/drivers/staging/rtl8192e/rtl8192e/rtl_core.c
index a550634..ca8406b 100644
--- a/drivers/staging/rtl8192e/rtl8192e/rtl_core.c
+++ b/drivers/staging/rtl8192e/rtl8192e/rtl_core.c
@@ -87,6 +87,25 @@ static struct pci_driver rtl8192_pci_driver = {
.resume = rtl8192E_resume, /* PM resume fn */
};

+static short rtl8192_is_tx_queue_empty(struct net_device *dev);
+static void rtl819x_watchdog_wqcallback(void *data);
+static void watch_dog_timer_callback(unsigned long data);
+static void rtl8192_data_hard_stop(struct net_device *dev);
+static void rtl8192_data_hard_resume(struct net_device *dev);
+static void rtl8192_hard_data_xmit(struct sk_buff *skb, struct net_device *dev,
+ int rate);
+static int rtl8192_hard_start_xmit(struct sk_buff *skb, struct net_device *dev);
+static void rtl8192_tx_cmd(struct net_device *dev, struct sk_buff *skb);
+static short rtl8192_tx(struct net_device *dev, struct sk_buff *skb);
+static short rtl8192_pci_initdescring(struct net_device *dev);
+static void rtl8192_irq_tx_tasklet(struct r8192_priv *priv);
+static void rtl8192_irq_rx_tasklet(struct r8192_priv *priv);
+static void rtl8192_cancel_deferred_work(struct r8192_priv *priv);
+static int _rtl8192_up(struct net_device *dev, bool is_silent_reset);
+static int rtl8192_up(struct net_device *dev);
+static int rtl8192_down(struct net_device *dev, bool shutdownrf);
+static void rtl8192_restart(void *data);
+
/****************************************************************************
-----------------------------IO STUFF-------------------------
*****************************************************************************/
@@ -273,7 +292,7 @@ static short rtl8192_check_nic_enough_desc(struct net_device *dev, int prio)
return 0;
}

-void rtl8192_tx_timeout(struct net_device *dev)
+static void rtl8192_tx_timeout(struct net_device *dev)
{
struct r8192_priv *priv = rtllib_priv(dev);

@@ -299,7 +318,7 @@ void rtl8192_irq_disable(struct net_device *dev)
priv->irq_enabled = 0;
}

-void rtl8192_set_chan(struct net_device *dev, short ch)
+static void rtl8192_set_chan(struct net_device *dev, short ch)
{
struct r8192_priv *priv = (struct r8192_priv *)rtllib_priv(dev);

@@ -313,7 +332,7 @@ void rtl8192_set_chan(struct net_device *dev, short ch)
priv->rf_set_chan(dev, priv->chan);
}

-void rtl8192_update_cap(struct net_device *dev, u16 cap)
+static void rtl8192_update_cap(struct net_device *dev, u16 cap)
{
struct r8192_priv *priv = rtllib_priv(dev);
struct rtllib_network *net = &priv->rtllib->current_network;
@@ -1105,7 +1124,7 @@ static short rtl8192_init(struct net_device *dev)
/***************************************************************************
-------------------------------WATCHDOG STUFF---------------------------
***************************************************************************/
-short rtl8192_is_tx_queue_empty(struct net_device *dev)
+static short rtl8192_is_tx_queue_empty(struct net_device *dev)
{
int i = 0;
struct r8192_priv *priv = rtllib_priv(dev);
@@ -1393,8 +1412,7 @@ static void rtl819x_update_rxcounts(struct r8192_priv *priv, u32 *TotalRxBcnNum,
}
}

-
-void rtl819x_watchdog_wqcallback(void *data)
+static void rtl819x_watchdog_wqcallback(void *data)
{
struct r8192_priv *priv = container_of_dwork_rsl(data,
struct r8192_priv, watch_dog_wq);
@@ -1548,7 +1566,7 @@ void rtl819x_watchdog_wqcallback(void *data)
RT_TRACE(COMP_TRACE, " <==RtUsbCheckForHangWorkItemCallback()\n");
}

-void watch_dog_timer_callback(unsigned long data)
+static void watch_dog_timer_callback(unsigned long data)
{
struct r8192_priv *priv = rtllib_priv((struct net_device *)data);

@@ -1625,16 +1643,15 @@ static void rtl8192_free_tx_ring(struct net_device *dev, unsigned int prio)
ring->desc = NULL;
}

-void rtl8192_data_hard_stop(struct net_device *dev)
+static void rtl8192_data_hard_stop(struct net_device *dev)
{
}

-
-void rtl8192_data_hard_resume(struct net_device *dev)
+static void rtl8192_data_hard_resume(struct net_device *dev)
{
}

-void rtl8192_hard_data_xmit(struct sk_buff *skb, struct net_device *dev,
+static void rtl8192_hard_data_xmit(struct sk_buff *skb, struct net_device *dev,
int rate)
{
struct r8192_priv *priv = (struct r8192_priv *)rtllib_priv(dev);
@@ -1666,7 +1683,7 @@ void rtl8192_hard_data_xmit(struct sk_buff *skb, struct net_device *dev,
}
}

-int rtl8192_hard_start_xmit(struct sk_buff *skb, struct net_device *dev)
+static int rtl8192_hard_start_xmit(struct sk_buff *skb, struct net_device *dev)
{
struct r8192_priv *priv = (struct r8192_priv *)rtllib_priv(dev);
int ret;
@@ -1725,7 +1742,7 @@ static void rtl8192_tx_isr(struct net_device *dev, int prio)
tasklet_schedule(&priv->irq_tx_tasklet);
}

-void rtl8192_tx_cmd(struct net_device *dev, struct sk_buff *skb)
+static void rtl8192_tx_cmd(struct net_device *dev, struct sk_buff *skb)
{
struct r8192_priv *priv = rtllib_priv(dev);
struct rtl8192_tx_ring *ring;
@@ -1748,7 +1765,7 @@ void rtl8192_tx_cmd(struct net_device *dev, struct sk_buff *skb)
spin_unlock_irqrestore(&priv->irq_th_lock, flags);
}

-short rtl8192_tx(struct net_device *dev, struct sk_buff *skb)
+static short rtl8192_tx(struct net_device *dev, struct sk_buff *skb)
{
struct r8192_priv *priv = rtllib_priv(dev);
struct rtl8192_tx_ring *ring;
@@ -1900,8 +1917,7 @@ static int rtl8192_alloc_tx_desc_ring(struct net_device *dev,
return 0;
}

-
-short rtl8192_pci_initdescring(struct net_device *dev)
+static short rtl8192_pci_initdescring(struct net_device *dev)
{
u32 ret;
int i;
@@ -2178,12 +2194,12 @@ static void rtl8192_tx_resume(struct net_device *dev)
}
}

-void rtl8192_irq_tx_tasklet(struct r8192_priv *priv)
+static void rtl8192_irq_tx_tasklet(struct r8192_priv *priv)
{
rtl8192_tx_resume(priv->rtllib->dev);
}

-void rtl8192_irq_rx_tasklet(struct r8192_priv *priv)
+static void rtl8192_irq_rx_tasklet(struct r8192_priv *priv)
{
rtl8192_rx_normal(priv->rtllib->dev);

@@ -2194,7 +2210,7 @@ void rtl8192_irq_rx_tasklet(struct r8192_priv *priv)
/****************************************************************************
---------------------------- NIC START/CLOSE STUFF---------------------------
*****************************************************************************/
-void rtl8192_cancel_deferred_work(struct r8192_priv *priv)
+static void rtl8192_cancel_deferred_work(struct r8192_priv *priv)
{
cancel_delayed_work(&priv->watch_dog_wq);
cancel_delayed_work(&priv->update_beacon_wq);
@@ -2203,14 +2219,13 @@ void rtl8192_cancel_deferred_work(struct r8192_priv *priv)
cancel_work_sync(&priv->qos_activate);
}

-int _rtl8192_up(struct net_device *dev, bool is_silent_reset)
+static int _rtl8192_up(struct net_device *dev, bool is_silent_reset)
{
if (_rtl8192_sta_up(dev, is_silent_reset) == -1)
return -1;
return 0;
}

-
static int rtl8192_open(struct net_device *dev)
{
struct r8192_priv *priv = rtllib_priv(dev);
@@ -2223,8 +2238,7 @@ static int rtl8192_open(struct net_device *dev)

}

-
-int rtl8192_up(struct net_device *dev)
+static int rtl8192_up(struct net_device *dev)
{
struct r8192_priv *priv = rtllib_priv(dev);

@@ -2254,7 +2268,7 @@ static int rtl8192_close(struct net_device *dev)

}

-int rtl8192_down(struct net_device *dev, bool shutdownrf)
+static int rtl8192_down(struct net_device *dev, bool shutdownrf)
{
if (rtl8192_sta_down(dev, shutdownrf) == -1)
return -1;
@@ -2274,7 +2288,7 @@ void rtl8192_commit(struct net_device *dev)
_rtl8192_up(dev, false);
}

-void rtl8192_restart(void *data)
+static void rtl8192_restart(void *data)
{
struct r8192_priv *priv = container_of_work_rsl(data, struct r8192_priv,
reset_wq);
diff --git a/drivers/staging/rtl8192e/rtl8192e/rtl_core.h b/drivers/staging/rtl8192e/rtl8192e/rtl_core.h
index 6497918..26e54e4 100644
--- a/drivers/staging/rtl8192e/rtl8192e/rtl_core.h
+++ b/drivers/staging/rtl8192e/rtl8192e/rtl_core.h
@@ -578,9 +578,6 @@ struct r8192_priv {

extern const struct ethtool_ops rtl819x_ethtool_ops;

-void rtl8192_tx_cmd(struct net_device *dev, struct sk_buff *skb);
-short rtl8192_tx(struct net_device *dev, struct sk_buff *skb);
-
u8 read_nic_byte(struct net_device *dev, int x);
u32 read_nic_dword(struct net_device *dev, int x);
u16 read_nic_word(struct net_device *dev, int x);
@@ -593,40 +590,19 @@ void force_pci_posting(struct net_device *dev);
void rtl8192_rx_enable(struct net_device *);
void rtl8192_tx_enable(struct net_device *);

-int rtl8192_hard_start_xmit(struct sk_buff *skb, struct net_device *dev);
-void rtl8192_hard_data_xmit(struct sk_buff *skb, struct net_device *dev,
- int rate);
-void rtl8192_data_hard_stop(struct net_device *dev);
-void rtl8192_data_hard_resume(struct net_device *dev);
-void rtl8192_restart(void *data);
-void rtl819x_watchdog_wqcallback(void *data);
void rtl8192_hw_sleep_wq(void *data);
-void watch_dog_timer_callback(unsigned long data);
-void rtl8192_irq_rx_tasklet(struct r8192_priv *priv);
-void rtl8192_irq_tx_tasklet(struct r8192_priv *priv);
-int rtl8192_down(struct net_device *dev, bool shutdownrf);
-int rtl8192_up(struct net_device *dev);
void rtl8192_commit(struct net_device *dev);
-void rtl8192_set_chan(struct net_device *dev, short ch);

void check_rfctrl_gpio_timer(unsigned long data);

void rtl8192_hw_wakeup_wq(void *data);
-short rtl8192_pci_initdescring(struct net_device *dev);
-
-void rtl8192_cancel_deferred_work(struct r8192_priv *priv);
-
-int _rtl8192_up(struct net_device *dev, bool is_silent_reset);

-short rtl8192_is_tx_queue_empty(struct net_device *dev);
void rtl8192_irq_disable(struct net_device *dev);

-void rtl8192_tx_timeout(struct net_device *dev);
void rtl8192_pci_resetdescring(struct net_device *dev);
void rtl8192_SetWirelessMode(struct net_device *dev, u8 wireless_mode);
void rtl8192_irq_enable(struct net_device *dev);
void rtl8192_config_rate(struct net_device *dev, u16 *rate_config);
-void rtl8192_update_cap(struct net_device *dev, u16 cap);
void rtl8192_irq_disable(struct net_device *dev);

void rtl819x_UpdateRxPktTimeStamp(struct net_device *dev,
--
1.8.4.1

2015-07-14 20:07:47

by Mateusz Kulikowski

[permalink] [raw]
Subject: [PATCH v2 19/23] staging: rtl8192e: r8192e_phy: Make functions static

Make as many functions as possible static in r8192E_phy.c.

The following functions were affected:
- rtl8192_phyConfigBB
- rtl8192_SwChnl_WorkItem
- rtl8192_SetBWModeWorkItem

Signed-off-by: Mateusz Kulikowski <[email protected]>
---
drivers/staging/rtl8192e/rtl8192e/r8192E_phy.c | 6 +++---
drivers/staging/rtl8192e/rtl8192e/r8192E_phy.h | 3 ---
2 files changed, 3 insertions(+), 6 deletions(-)

diff --git a/drivers/staging/rtl8192e/rtl8192e/r8192E_phy.c b/drivers/staging/rtl8192e/rtl8192e/r8192E_phy.c
index fba7654..3213523 100644
--- a/drivers/staging/rtl8192e/rtl8192e/r8192E_phy.c
+++ b/drivers/staging/rtl8192e/rtl8192e/r8192E_phy.c
@@ -357,7 +357,7 @@ void rtl8192_phy_configmac(struct net_device *dev)

}

-void rtl8192_phyConfigBB(struct net_device *dev, u8 ConfigType)
+static void rtl8192_phyConfigBB(struct net_device *dev, u8 ConfigType)
{
int i;
u32 *Rtl819XPHY_REGArray_Table = NULL;
@@ -986,7 +986,7 @@ static void rtl8192_phy_FinishSwChnlNow(struct net_device *dev, u8 channel)
break;
}
}
-void rtl8192_SwChnl_WorkItem(struct net_device *dev)
+static void rtl8192_SwChnl_WorkItem(struct net_device *dev)
{

struct r8192_priv *priv = rtllib_priv(dev);
@@ -1163,7 +1163,7 @@ static void CCK_Tx_Power_Track_BW_Switch(struct net_device *dev)
CCK_Tx_Power_Track_BW_Switch_ThermalMeter(dev);
}

-void rtl8192_SetBWModeWorkItem(struct net_device *dev)
+static void rtl8192_SetBWModeWorkItem(struct net_device *dev)
{

struct r8192_priv *priv = rtllib_priv(dev);
diff --git a/drivers/staging/rtl8192e/rtl8192e/r8192E_phy.h b/drivers/staging/rtl8192e/rtl8192e/r8192E_phy.h
index 18bc582..ef85587 100644
--- a/drivers/staging/rtl8192e/rtl8192e/r8192E_phy.h
+++ b/drivers/staging/rtl8192e/rtl8192e/r8192E_phy.h
@@ -80,7 +80,6 @@ extern u32 rtl8192_phy_QueryRFReg(struct net_device *dev,
enum rf90_radio_path eRFPath,
u32 RegAddr, u32 BitMask);
extern void rtl8192_phy_configmac(struct net_device *dev);
-extern void rtl8192_phyConfigBB(struct net_device *dev, u8 ConfigType);
extern bool rtl8192_phy_checkBBAndRF(struct net_device *dev,
enum hw90_block CheckBlock,
enum rf90_radio_path eRFPath);
@@ -96,8 +95,6 @@ extern u8 rtl8192_phy_SwChnl(struct net_device *dev, u8 channel);
extern void rtl8192_SetBWMode(struct net_device *dev,
enum ht_channel_width Bandwidth,
enum ht_extchnl_offset Offset);
-extern void rtl8192_SwChnl_WorkItem(struct net_device *dev);
-extern void rtl8192_SetBWModeWorkItem(struct net_device *dev);
extern void InitialGain819xPci(struct net_device *dev, u8 Operation);

extern void PHY_SetRtl8192eRfOff(struct net_device *dev);
--
1.8.4.1

2015-07-14 20:05:11

by Mateusz Kulikowski

[permalink] [raw]
Subject: [PATCH v2 20/23] staging: rtl8192e: Make rtl8192_QueryIsShort() static

Relocate function within file to avoid unnecessary fw decl.

Signed-off-by: Mateusz Kulikowski <[email protected]>
---
drivers/staging/rtl8192e/rtl8192e/r8192E_dev.c | 24 ++++++++++++------------
drivers/staging/rtl8192e/rtl8192e/r8192E_dev.h | 1 -
2 files changed, 12 insertions(+), 13 deletions(-)

diff --git a/drivers/staging/rtl8192e/rtl8192e/r8192E_dev.c b/drivers/staging/rtl8192e/rtl8192e/r8192E_dev.c
index f28676b..eb919b6 100644
--- a/drivers/staging/rtl8192e/rtl8192e/r8192E_dev.c
+++ b/drivers/staging/rtl8192e/rtl8192e/r8192E_dev.c
@@ -1176,6 +1176,18 @@ static u8 rtl8192_MapHwQueueToFirmwareQueue(struct net_device *dev, u8 QueueID,
return QueueSelect;
}

+static u8 rtl8192_QueryIsShort(u8 TxHT, u8 TxRate, struct cb_desc *tcb_desc)
+{
+ u8 tmp_Short;
+
+ tmp_Short = (TxHT == 1) ? ((tcb_desc->bUseShortGI) ? 1 : 0) :
+ ((tcb_desc->bUseShortPreamble) ? 1 : 0);
+ if (TxHT == 1 && TxRate != DESC90_RATEMCS15)
+ tmp_Short = 0;
+
+ return tmp_Short;
+}
+
void rtl8192_tx_fill_desc(struct net_device *dev, struct tx_desc *pdesc,
struct cb_desc *cb_desc, struct sk_buff *skb)
{
@@ -2380,18 +2392,6 @@ bool rtl8192_GetHalfNmodeSupportByAPs(struct net_device *dev)
return Reval;
}

-u8 rtl8192_QueryIsShort(u8 TxHT, u8 TxRate, struct cb_desc *tcb_desc)
-{
- u8 tmp_Short;
-
- tmp_Short = (TxHT == 1) ? ((tcb_desc->bUseShortGI) ? 1 : 0) :
- ((tcb_desc->bUseShortPreamble) ? 1 : 0);
- if (TxHT == 1 && TxRate != DESC90_RATEMCS15)
- tmp_Short = 0;
-
- return tmp_Short;
-}
-
void ActUpdateChannelAccessSetting(struct net_device *dev,
enum wireless_mode WirelessMode,
struct channel_access_setting *ChnlAccessSetting)
diff --git a/drivers/staging/rtl8192e/rtl8192e/r8192E_dev.h b/drivers/staging/rtl8192e/rtl8192e/r8192E_dev.h
index dbe0e1c..4f1b312 100644
--- a/drivers/staging/rtl8192e/rtl8192e/r8192E_dev.h
+++ b/drivers/staging/rtl8192e/rtl8192e/r8192E_dev.h
@@ -27,7 +27,6 @@

#include "r8190P_def.h"

-u8 rtl8192_QueryIsShort(u8 TxHT, u8 TxRate, struct cb_desc *tcb_desc);
bool rtl8192_GetHalfNmodeSupportByAPs(struct net_device *dev);
bool rtl8192_GetNmodeSupportBySecCfg(struct net_device *dev);
bool rtl8192_HalTxCheckStuck(struct net_device *dev);
--
1.8.4.1

2015-07-14 20:07:16

by Mateusz Kulikowski

[permalink] [raw]
Subject: [PATCH v2 21/23] staging: rtl8192e: rtllib_tx: Make functions static

Make as many functions as possible static in rtllib_tx.c.

The following functions were affected:
- rtllib_xmit_inter
- rtllib_query_seqnum
- rtllib_put_snap

Signed-off-by: Mateusz Kulikowski <[email protected]>
---
drivers/staging/rtl8192e/rtllib.h | 3 ---
drivers/staging/rtl8192e/rtllib_tx.c | 8 ++++----
2 files changed, 4 insertions(+), 7 deletions(-)

diff --git a/drivers/staging/rtl8192e/rtllib.h b/drivers/staging/rtl8192e/rtllib.h
index 98f7db0..965ae16 100644
--- a/drivers/staging/rtl8192e/rtllib.h
+++ b/drivers/staging/rtl8192e/rtllib.h
@@ -1995,7 +1995,6 @@ extern int rtllib_encrypt_fragment(
int hdr_len);

extern int rtllib_xmit(struct sk_buff *skb, struct net_device *dev);
-extern int rtllib_xmit_inter(struct sk_buff *skb, struct net_device *dev);
extern void rtllib_txb_free(struct rtllib_txb *);

/* rtllib_rx.c */
@@ -2092,8 +2091,6 @@ extern void rtllib_ps_tx_ack(struct rtllib_device *ieee, short success);

extern void softmac_mgmt_xmit(struct sk_buff *skb,
struct rtllib_device *ieee);
-extern u16 rtllib_query_seqnum(struct rtllib_device *ieee,
- struct sk_buff *skb, u8 *dst);
extern u8 rtllib_ap_sec_type(struct rtllib_device *ieee);

/* rtllib_softmac_wx.c */
diff --git a/drivers/staging/rtl8192e/rtllib_tx.c b/drivers/staging/rtl8192e/rtllib_tx.c
index 517500c..b992e46 100644
--- a/drivers/staging/rtl8192e/rtllib_tx.c
+++ b/drivers/staging/rtl8192e/rtllib_tx.c
@@ -151,7 +151,7 @@
static u8 P802_1H_OUI[P80211_OUI_LEN] = { 0x00, 0x00, 0xf8 };
static u8 RFC1042_OUI[P80211_OUI_LEN] = { 0x00, 0x00, 0x00 };

-inline int rtllib_put_snap(u8 *data, u16 h_proto)
+static int rtllib_put_snap(u8 *data, u16 h_proto)
{
struct rtllib_snap_hdr *snap;
u8 *oui;
@@ -514,8 +514,8 @@ static void rtllib_txrate_selectmode(struct rtllib_device *ieee,
}
}

-u16 rtllib_query_seqnum(struct rtllib_device *ieee, struct sk_buff *skb,
- u8 *dst)
+static u16 rtllib_query_seqnum(struct rtllib_device *ieee, struct sk_buff *skb,
+ u8 *dst)
{
u16 seqnum = 0;

@@ -565,7 +565,7 @@ static u8 rtllib_current_rate(struct rtllib_device *ieee)
return ieee->rate & 0x7F;
}

-int rtllib_xmit_inter(struct sk_buff *skb, struct net_device *dev)
+static int rtllib_xmit_inter(struct sk_buff *skb, struct net_device *dev)
{
struct rtllib_device *ieee = (struct rtllib_device *)
netdev_priv_rsl(dev);
--
1.8.4.1

2015-07-14 20:06:49

by Mateusz Kulikowski

[permalink] [raw]
Subject: [PATCH v2 22/23] staging: rtl8192e: Make rtllib_rx_mgt() static

Function is not referenced outside of rtllib_rx.c

Signed-off-by: Mateusz Kulikowski <[email protected]>
---
drivers/staging/rtl8192e/rtllib.h | 3 ---
drivers/staging/rtl8192e/rtllib_rx.c | 9 ++++++---
2 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/drivers/staging/rtl8192e/rtllib.h b/drivers/staging/rtl8192e/rtllib.h
index 965ae16..57341a1 100644
--- a/drivers/staging/rtl8192e/rtllib.h
+++ b/drivers/staging/rtl8192e/rtllib.h
@@ -2000,9 +2000,6 @@ extern void rtllib_txb_free(struct rtllib_txb *);
/* rtllib_rx.c */
extern int rtllib_rx(struct rtllib_device *ieee, struct sk_buff *skb,
struct rtllib_rx_stats *rx_stats);
-extern void rtllib_rx_mgt(struct rtllib_device *ieee,
- struct sk_buff *skb,
- struct rtllib_rx_stats *stats);
extern void rtllib_rx_probe_rq(struct rtllib_device *ieee,
struct sk_buff *skb);
extern int rtllib_legal_channel(struct rtllib_device *rtllib, u8 channel);
diff --git a/drivers/staging/rtl8192e/rtllib_rx.c b/drivers/staging/rtl8192e/rtllib_rx.c
index 0698a0d..54dfff6 100644
--- a/drivers/staging/rtl8192e/rtllib_rx.c
+++ b/drivers/staging/rtl8192e/rtllib_rx.c
@@ -44,6 +44,9 @@
#include "rtllib.h"
#include "dot11d.h"

+static void rtllib_rx_mgt(struct rtllib_device *ieee, struct sk_buff *skb,
+ struct rtllib_rx_stats *stats);
+
static inline void rtllib_monitor_rx(struct rtllib_device *ieee,
struct sk_buff *skb,
struct rtllib_rx_stats *rx_status,
@@ -2715,9 +2718,9 @@ free_network:
kfree(network);
}

-void rtllib_rx_mgt(struct rtllib_device *ieee,
- struct sk_buff *skb,
- struct rtllib_rx_stats *stats)
+static void rtllib_rx_mgt(struct rtllib_device *ieee,
+ struct sk_buff *skb,
+ struct rtllib_rx_stats *stats)
{
struct rtllib_hdr_4addr *header = (struct rtllib_hdr_4addr *)skb->data;

--
1.8.4.1

2015-07-14 20:05:54

by Mateusz Kulikowski

[permalink] [raw]
Subject: [PATCH v2 23/23] staging: rtl8192e: rtllib_softmac: Make functions static

Make as many functions as possible static in rtllib_softmac.c.

The following functions were affected:
- rtllib_sta_wakeup
- rtllib_TURBO_Info
- rtllib_get_beacon_
- rtllib_send_probe_requests
- rtllib_update_active_chan_map
- rtllib_softmac_scan_syncro

Signed-off-by: Mateusz Kulikowski <[email protected]>
---
drivers/staging/rtl8192e/rtllib.h | 11 -----------
drivers/staging/rtl8192e/rtllib_softmac.c | 27 +++++++++++++++------------
2 files changed, 15 insertions(+), 23 deletions(-)

diff --git a/drivers/staging/rtl8192e/rtllib.h b/drivers/staging/rtl8192e/rtllib.h
index 57341a1..617f79e 100644
--- a/drivers/staging/rtl8192e/rtllib.h
+++ b/drivers/staging/rtl8192e/rtllib.h
@@ -2026,7 +2026,6 @@ extern int rtllib_wx_set_mlme(struct rtllib_device *ieee,
extern int rtllib_wx_set_gen_ie(struct rtllib_device *ieee, u8 *ie, size_t len);

/* rtllib_softmac.c */
-extern short rtllib_is_54g(struct rtllib_network *net);
extern int rtllib_rx_frame_softmac(struct rtllib_device *ieee,
struct sk_buff *skb,
struct rtllib_rx_stats *rx_stats, u16 type,
@@ -2040,13 +2039,9 @@ extern void rtllib_softmac_xmit(struct rtllib_txb *txb,

extern void rtllib_stop_send_beacons(struct rtllib_device *ieee);
extern void notify_wx_assoc_event(struct rtllib_device *ieee);
-extern void rtllib_softmac_check_all_nets(struct rtllib_device *ieee);
-extern void rtllib_start_bss(struct rtllib_device *ieee);
-extern void rtllib_start_master_bss(struct rtllib_device *ieee);
extern void rtllib_start_ibss(struct rtllib_device *ieee);
extern void rtllib_softmac_init(struct rtllib_device *ieee);
extern void rtllib_softmac_free(struct rtllib_device *ieee);
-extern void rtllib_associate_abort(struct rtllib_device *ieee);
extern void rtllib_disassociate(struct rtllib_device *ieee);
extern void rtllib_stop_scan(struct rtllib_device *ieee);
extern bool rtllib_act_scanning(struct rtllib_device *ieee, bool sync_scan);
@@ -2054,7 +2049,6 @@ extern void rtllib_stop_scan_syncro(struct rtllib_device *ieee);
extern void rtllib_start_scan_syncro(struct rtllib_device *ieee, u8 is_mesh);
extern void rtllib_sta_ps_send_null_frame(struct rtllib_device *ieee,
short pwr);
-extern void rtllib_sta_wakeup(struct rtllib_device *ieee, short nl);
extern void rtllib_sta_ps_send_pspoll_frame(struct rtllib_device *ieee);
extern void rtllib_start_protocol(struct rtllib_device *ieee);
extern void rtllib_stop_protocol(struct rtllib_device *ieee, u8 shutdown);
@@ -2067,8 +2061,6 @@ extern void rtllib_EnableIntelPromiscuousMode(struct net_device *dev,
bool bInitState);
extern void rtllib_DisableIntelPromiscuousMode(struct net_device *dev,
bool bInitState);
-extern void rtllib_send_probe_requests(struct rtllib_device *ieee, u8 is_mesh);
-
extern void rtllib_softmac_stop_protocol(struct rtllib_device *ieee,
u8 mesh_flag, u8 shutdown);
extern void rtllib_softmac_start_protocol(struct rtllib_device *ieee,
@@ -2214,7 +2206,6 @@ extern void TsStartAddBaProcess(struct rtllib_device *ieee,
struct tx_ts_record *pTxTS);
extern void RemovePeerTS(struct rtllib_device *ieee, u8 *Addr);
extern void RemoveAllTS(struct rtllib_device *ieee);
-void rtllib_softmac_scan_syncro(struct rtllib_device *ieee, u8 is_mesh);

extern const long rtllib_wlan_frequencies[];

@@ -2238,7 +2229,6 @@ bool rtllib_MgntDisconnect(struct rtllib_device *rtllib, u8 asRsn);
/* For the function is more related to hardware setting, it's better to use the
* ieee handler to refer to it.
*/
-extern void rtllib_update_active_chan_map(struct rtllib_device *ieee);
extern void rtllib_FlushRxTsPendingPkts(struct rtllib_device *ieee,
struct rx_ts_record *pTS);
extern int rtllib_parse_info_param(struct rtllib_device *ieee,
@@ -2252,7 +2242,6 @@ void rtllib_indicate_packets(struct rtllib_device *ieee,
extern void HTUseDefaultSetting(struct rtllib_device *ieee);
#define RT_ASOC_RETRY_LIMIT 5
u8 MgntQuery_TxRateExcludeCCKRates(struct rtllib_device *ieee);
-extern void rtllib_TURBO_Info(struct rtllib_device *ieee, u8 **tag_p);
#define SEM_DOWN_IEEE_WX(psem) down(psem)
#define SEM_UP_IEEE_WX(psem) up(psem)

diff --git a/drivers/staging/rtl8192e/rtllib_softmac.c b/drivers/staging/rtl8192e/rtllib_softmac.c
index eac7f28..635a1c4 100644
--- a/drivers/staging/rtl8192e/rtllib_softmac.c
+++ b/drivers/staging/rtl8192e/rtllib_softmac.c
@@ -23,7 +23,10 @@
#include <linux/ieee80211.h>
#include "dot11d.h"

-short rtllib_is_54g(struct rtllib_network *net)
+static void rtllib_sta_wakeup(struct rtllib_device *ieee, short nl);
+
+
+static short rtllib_is_54g(struct rtllib_network *net)
{
return (net->rates_ex_len > 0) || (net->rates_len > 4);
}
@@ -107,7 +110,7 @@ static void rtllib_WMM_Info(struct rtllib_device *ieee, u8 **tag_p)
*tag_p = tag;
}

-void rtllib_TURBO_Info(struct rtllib_device *ieee, u8 **tag_p)
+static void rtllib_TURBO_Info(struct rtllib_device *ieee, u8 **tag_p)
{
u8 *tag = *tag_p;

@@ -369,7 +372,7 @@ static inline struct sk_buff *rtllib_probe_req(struct rtllib_device *ieee)
return skb;
}

-struct sk_buff *rtllib_get_beacon_(struct rtllib_device *ieee);
+static struct sk_buff *rtllib_get_beacon_(struct rtllib_device *ieee);

static void rtllib_send_beacon(struct rtllib_device *ieee)
{
@@ -483,7 +486,7 @@ static void rtllib_send_probe(struct rtllib_device *ieee, u8 is_mesh)
}


-void rtllib_send_probe_requests(struct rtllib_device *ieee, u8 is_mesh)
+static void rtllib_send_probe_requests(struct rtllib_device *ieee, u8 is_mesh)
{
if (ieee->active_scan && (ieee->softmac_features &
IEEE_SOFTMAC_PROBERQ)) {
@@ -492,7 +495,7 @@ void rtllib_send_probe_requests(struct rtllib_device *ieee, u8 is_mesh)
}
}

-void rtllib_update_active_chan_map(struct rtllib_device *ieee)
+static void rtllib_update_active_chan_map(struct rtllib_device *ieee)
{
memcpy(ieee->active_channel_map, GET_DOT11D_INFO(ieee)->channel_map,
MAX_CHANNEL_NUMBER+1);
@@ -501,7 +504,7 @@ void rtllib_update_active_chan_map(struct rtllib_device *ieee)
/* this performs syncro scan blocking the caller until all channels
* in the allowed channel map has been checked.
*/
-void rtllib_softmac_scan_syncro(struct rtllib_device *ieee, u8 is_mesh)
+static void rtllib_softmac_scan_syncro(struct rtllib_device *ieee, u8 is_mesh)
{
union iwreq_data wrqu;
short ch = 0;
@@ -1401,7 +1404,7 @@ inline struct sk_buff *rtllib_association_req(struct rtllib_network *beacon,
return skb;
}

-void rtllib_associate_abort(struct rtllib_device *ieee)
+static void rtllib_associate_abort(struct rtllib_device *ieee)
{
unsigned long flags;

@@ -1752,7 +1755,7 @@ inline void rtllib_softmac_new_net(struct rtllib_device *ieee,
}
}

-void rtllib_softmac_check_all_nets(struct rtllib_device *ieee)
+static void rtllib_softmac_check_all_nets(struct rtllib_device *ieee)
{
unsigned long flags;
struct rtllib_network *target;
@@ -2108,7 +2111,7 @@ out:

}

-void rtllib_sta_wakeup(struct rtllib_device *ieee, short nl)
+static void rtllib_sta_wakeup(struct rtllib_device *ieee, short nl)
{
if (ieee->sta_sleep == LPS_IS_WAKE) {
if (nl) {
@@ -2544,7 +2547,7 @@ inline void rtllib_randomize_cell(struct rtllib_device *ieee)
}

/* called in user context only */
-void rtllib_start_master_bss(struct rtllib_device *ieee)
+static void rtllib_start_master_bss(struct rtllib_device *ieee)
{
ieee->assoc_id = 1;

@@ -2719,7 +2722,7 @@ inline void rtllib_start_ibss(struct rtllib_device *ieee)
}

/* this is called only in user context, with wx_sem held */
-void rtllib_start_bss(struct rtllib_device *ieee)
+static void rtllib_start_bss(struct rtllib_device *ieee)
{
unsigned long flags;

@@ -2816,7 +2819,7 @@ exit:
up(&ieee->wx_sem);
}

-struct sk_buff *rtllib_get_beacon_(struct rtllib_device *ieee)
+static struct sk_buff *rtllib_get_beacon_(struct rtllib_device *ieee)
{
const u8 broadcast_addr[] = {0xff, 0xff, 0xff, 0xff, 0xff, 0xff};

--
1.8.4.1

2015-07-15 04:57:27

by Sudip Mukherjee

[permalink] [raw]
Subject: Re: [PATCH v2 05/23] staging: rtl8192e: Remove unused fields from rtllib_stats

On Tue, Jul 14, 2015 at 10:04:08PM +0200, Mateusz Kulikowski wrote:
> None of them are used in the driver.
>
> Signed-off-by: Mateusz Kulikowski <[email protected]>
> ---
> drivers/staging/rtl8192e/rtllib.h | 19 -------------------
> 1 file changed, 19 deletions(-)
>
> diff --git a/drivers/staging/rtl8192e/rtllib.h b/drivers/staging/rtl8192e/rtllib.h
> index 8ba92ed..dc0653a 100644
> --- a/drivers/staging/rtl8192e/rtllib.h
> +++ b/drivers/staging/rtl8192e/rtllib.h
> @@ -691,27 +691,8 @@ struct rtllib_frag_entry {
> };
>
> struct rtllib_stats {
> - unsigned int tx_unicast_frames;
> - unsigned int tx_multicast_frames;
> - unsigned int tx_fragments;
> - unsigned int tx_unicast_octets;
> - unsigned int tx_multicast_octets;
> - unsigned int tx_deferred_transmissions;
> - unsigned int tx_single_retry_frames;
> - unsigned int tx_multiple_retry_frames;
> - unsigned int tx_retry_limit_exceeded;
> unsigned int tx_discards;
> - unsigned int rx_unicast_frames;
> - unsigned int rx_multicast_frames;
> - unsigned int rx_fragments;
> - unsigned int rx_unicast_octets;
> - unsigned int rx_multicast_octets;
> - unsigned int rx_fcs_errors;
> - unsigned int rx_discards_no_buffer;
> - unsigned int tx_discards_wrong_sa;
> unsigned int rx_discards_undecryptable;
Dan had commented before that tx_discards and rx_discards_undecryptable
are also not used. Their only uses are:
ieee->ieee_stats.rx_discards_undecryptable++ and
ieee->ieee_stats.tx_discards++

regards
sudip

2015-07-15 04:58:35

by Sudip Mukherjee

[permalink] [raw]
Subject: Re: [PATCH v2 05/23] staging: rtl8192e: Remove unused fields from rtllib_stats

On Wed, Jul 15, 2015 at 10:27:20AM +0530, Sudip Mukherjee wrote:
> On Tue, Jul 14, 2015 at 10:04:08PM +0200, Mateusz Kulikowski wrote:
> > None of them are used in the driver.
> >
> > Signed-off-by: Mateusz Kulikowski <[email protected]>
> > ---
> > drivers/staging/rtl8192e/rtllib.h | 19 -------------------
> > 1 file changed, 19 deletions(-)
> >
> > diff --git a/drivers/staging/rtl8192e/rtllib.h b/drivers/staging/rtl8192e/rtllib.h
> > index 8ba92ed..dc0653a 100644
> > --- a/drivers/staging/rtl8192e/rtllib.h
> > +++ b/drivers/staging/rtl8192e/rtllib.h
> > @@ -691,27 +691,8 @@ struct rtllib_frag_entry {
> > };
> >
> > struct rtllib_stats {
> > - unsigned int tx_unicast_frames;
> > - unsigned int tx_multicast_frames;
> > - unsigned int tx_fragments;
> > - unsigned int tx_unicast_octets;
> > - unsigned int tx_multicast_octets;
> > - unsigned int tx_deferred_transmissions;
> > - unsigned int tx_single_retry_frames;
> > - unsigned int tx_multiple_retry_frames;
> > - unsigned int tx_retry_limit_exceeded;
> > unsigned int tx_discards;
> > - unsigned int rx_unicast_frames;
> > - unsigned int rx_multicast_frames;
> > - unsigned int rx_fragments;
> > - unsigned int rx_unicast_octets;
> > - unsigned int rx_multicast_octets;
> > - unsigned int rx_fcs_errors;
> > - unsigned int rx_discards_no_buffer;
> > - unsigned int tx_discards_wrong_sa;
> > unsigned int rx_discards_undecryptable;
> Dan had commented before that tx_discards and rx_discards_undecryptable
> are also not used. Their only uses are:
> ieee->ieee_stats.rx_discards_undecryptable++ and
> ieee->ieee_stats.tx_discards++

Ok, next patch does that. Sorry for the noise.

regards
sudip

2015-07-15 06:50:59

by Jakub Sitnicki

[permalink] [raw]
Subject: Re: [PATCH v2 04/23] staging: rtl8192e: Remove unused enums

On Tue, Jul 14, 2015 at 10:04 PM CEST, Mateusz Kulikowski <[email protected]> wrote:
> Remove ack_policy enum and some unused RTL_DEBUG enums.
>
> Signed-off-by: Mateusz Kulikowski <[email protected]>
> ---

[snip]

> diff --git a/drivers/staging/rtl8192e/rtllib_debug.h b/drivers/staging/rtl8192e/rtllib_debug.h
> index 42e88d6..2f47a7c 100644
> --- a/drivers/staging/rtl8192e/rtllib_debug.h
> +++ b/drivers/staging/rtl8192e/rtllib_debug.h
> @@ -40,10 +40,7 @@ enum RTL_DEBUG {
> COMP_DBG = (1 << 1),
> COMP_INIT = (1 << 2),
> COMP_RECV = (1 << 3),
> - COMP_SEND = (1 << 4),
> - COMP_CMD = (1 << 5),
> COMP_POWER = (1 << 6),
> - COMP_EPROM = (1 << 7),
> COMP_SWBW = (1 << 8),
> COMP_SEC = (1 << 9),
> COMP_LPS = (1 << 10),
> @@ -58,15 +55,12 @@ enum RTL_DEBUG {
> COMP_CH = (1 << 19),
> COMP_RF = (1 << 20),
> COMP_FIRMWARE = (1 << 21),
> - COMP_HT = (1 << 22),
> COMP_RESET = (1 << 23),
> COMP_CMDPKT = (1 << 24),
> COMP_SCAN = (1 << 25),
> COMP_PS = (1 << 26),
> COMP_DOWN = (1 << 27),
> COMP_INTR = (1 << 28),
> - COMP_LED = (1 << 29),
> - COMP_MLME = (1 << 30),
> COMP_ERR = (1 << 31)
> };

Is it possible that this change will make future readers wonder why
there are holes in the enum values, and hence hurts readability?

Cheers,
Jakub

2015-07-15 07:05:32

by Mateusz Kulikowski

[permalink] [raw]
Subject: Re: [PATCH v2 04/23] staging: rtl8192e: Remove unused enums



On July 15, 2015 8:34:02 AM GMT+02:00, Jakub Sitnicki <[email protected]> wrote:
>On Tue, Jul 14, 2015 at 10:04 PM CEST, Mateusz Kulikowski
><[email protected]> wrote:
>> Remove ack_policy enum and some unused RTL_DEBUG enums.
>>
>> Signed-off-by: Mateusz Kulikowski <[email protected]>
>> ---
>
>[snip]
>
>> diff --git a/drivers/staging/rtl8192e/rtllib_debug.h
>b/drivers/staging/rtl8192e/rtllib_debug.h
>> index 42e88d6..2f47a7c 100644
>> --- a/drivers/staging/rtl8192e/rtllib_debug.h
>> +++ b/drivers/staging/rtl8192e/rtllib_debug.h
>> @@ -40,10 +40,7 @@ enum RTL_DEBUG {
>> COMP_DBG = (1 << 1),
>> COMP_INIT = (1 << 2),
>> COMP_RECV = (1 << 3),
>> - COMP_SEND = (1 << 4),
>> - COMP_CMD = (1 << 5),
>> COMP_POWER = (1 << 6),
>> - COMP_EPROM = (1 << 7),
>> COMP_SWBW = (1 << 8),
>> COMP_SEC = (1 << 9),
>> COMP_LPS = (1 << 10),
>> @@ -58,15 +55,12 @@ enum RTL_DEBUG {
>> COMP_CH = (1 << 19),
>> COMP_RF = (1 << 20),
>> COMP_FIRMWARE = (1 << 21),
>> - COMP_HT = (1 << 22),
>> COMP_RESET = (1 << 23),
>> COMP_CMDPKT = (1 << 24),
>> COMP_SCAN = (1 << 25),
>> COMP_PS = (1 << 26),
>> COMP_DOWN = (1 << 27),
>> COMP_INTR = (1 << 28),
>> - COMP_LED = (1 << 29),
>> - COMP_MLME = (1 << 30),
>> COMP_ERR = (1 << 31)
>> };
>
>Is it possible that this change will make future readers wonder why
>there are holes in the enum values, and hence hurts readability?

It should not. This enum is used as log categories for various parts of the driver.
Some of them were just never used.

IMO once driver is ready for unstagimg this enum should be removed and replaced wih dyn debug where it makes sense.

Regards,
Mateusz

2015-07-16 09:58:14

by Dan Carpenter

[permalink] [raw]
Subject: Re: [PATCH v2 00/23] staging: rtl8192e: Various cleanups

On Tue, Jul 14, 2015 at 10:04:03PM +0200, Mateusz Kulikowski wrote:
> This series does some more cleanup for driver.
>
> Changes in V2:
> - Added patch 6/23 (Remove rtllib_stats structure as suggested by Dan)
> - Updated patch 22/23 (remove whitespace - hint by Sudip)
> - Rebased into current staging next (6fdb302c)
> - Retested

Was there really a need to redo this patch? The things that Sudip and I
mentioned could have been done in follow on patches.

It's slightly easier for me to just review the follow on patches instead
of looking at a whole patchset.

regards,
dan carpenter

2015-07-17 19:52:15

by Mateusz Kulikowski

[permalink] [raw]
Subject: Re: [PATCH v2 00/23] staging: rtl8192e: Various cleanups

On 16.07.2015 11:58, Dan Carpenter wrote:
> On Tue, Jul 14, 2015 at 10:04:03PM +0200, Mateusz Kulikowski wrote:
>> This series does some more cleanup for driver.
>>
>> Changes in V2:
>> - Added patch 6/23 (Remove rtllib_stats structure as suggested by Dan)
>> - Updated patch 22/23 (remove whitespace - hint by Sudip)
>> - Rebased into current staging next (6fdb302c)
>> - Retested
>
> Was there really a need to redo this patch? The things that Sudip and I
> mentioned could have been done in follow on patches.
>
> It's slightly easier for me to just review the follow on patches instead
> of looking at a whole patchset.

Ok, I'll keep that in mind for next patches.

Regards,
Mateusz