Convert drivers to a common rtl_phy_scan_operation_backup() routine
Subsystems (3)
cover Convert drivers to a common rtl_phy_scan_operation_backup() routine
Several of the driver implement this routine using the same code. This set of patches creates a common routine in driver rtlwifi, converts each of the drivers to use the new routine, and then deletes the now unused old code.
These patches rely on two prerequisite patches:
[PATCH 11/11] rtlwifi: Remove extern from function prototypes by Joe Perches TCH] rtlwifi: remove duplicate declarations and macros in headers by Catalin Iacob
None of these patches fix any bugs. They merely reduce the size of the source code, thus they need no particular priority.
---
Larry Finger (7):
rtlwifi: Implement a common rtl_phy_scan_operation_backup() routine
rtlwifi: rtl8192cu: Convert to use new rtl_phy_scan_operation_backup()
routine
rtlwifi: rtl8192ce: Convert driver to use new
rtl_phy_scan_operation_backup() routine
rtlwifi: rtl8192c: Remove rtl8192c_phy_scan_operation_backup()
rtlwifi: rtl8192ce: Convert driver to use new
rtl_phy_scan_operation_backup() routine
rtlwifi: rtl8723ae: Convert driver to use new
rtl_phy_scan_operation_backup() routine
rtlwifi: rtl8188ee: Convert driver to use new
rtl_phy_scan_operation_backup() routine
drivers/net/wireless/rtlwifi/base.c | 29 +++++++++++++++++++++ drivers/net/wireless/rtlwifi/base.h | 1 + drivers/net/wireless/rtlwifi/rtl8188ee/phy.c | 28 -------------------- drivers/net/wireless/rtlwifi/rtl8188ee/phy.h | 1 - drivers/net/wireless/rtlwifi/rtl8188ee/sw.c | 3 ++- drivers/net/wireless/rtlwifi/rtl8192c/phy_common.c | 30 ---------------------- drivers/net/wireless/rtlwifi/rtl8192c/phy_common.h | 2 -- drivers/net/wireless/rtlwifi/rtl8192ce/phy.h | 1 - drivers/net/wireless/rtlwifi/rtl8192ce/sw.c | 3 ++- drivers/net/wireless/rtlwifi/rtl8192cu/sw.c | 3 ++- drivers/net/wireless/rtlwifi/rtl8192de/phy.c | 28 -------------------- drivers/net/wireless/rtlwifi/rtl8192de/phy.h | 1 - drivers/net/wireless/rtlwifi/rtl8192de/sw.c | 3 ++- drivers/net/wireless/rtlwifi/rtl8723ae/phy.c | 29 --------------------- drivers/net/wireless/rtlwifi/rtl8723ae/phy.h | 1 - drivers/net/wireless/rtlwifi/rtl8723ae/sw.c | 3 ++- 16 files changed, 40 insertions(+), 126 deletions(-)
Signature · 1 line
1.8.1.4
A message that is not in the archive (sent off-list or not yet received): 1380219933-16784-1-git-send-email-Larry.Finger-tQ5ms3gMjBLk1uMJSBkQmQ@public.gmane.org
PATCH 3/7 rtlwifi: rtl8192ce: Convert driver to use new rtl_phy_scan_operation_backup() routine
Now that rtl_phy_scan_operation_backup() exists, convert rtl8192ce to use it.
--- drivers/net/wireless/rtlwifi/rtl8192ce/phy.h | 1 - drivers/net/wireless/rtlwifi/rtl8192ce/sw.c | 3 ++- 2 files changed, 2 insertions(+), 2 deletions(-)
drivers/net/wireless/rtlwifi/rtl8192ce/phy.h +0 -1
@@ -202,7 +202,6 @@ void rtl92c_phy_get_hw_reg_originalvalue(struct ieee80211_hw *hw);void rtl92c_phy_get_txpower_level (struct ieee80211_hw *hw,long *powerlevel);void rtl92c_phy_set_txpower_level (struct ieee80211_hw *hw,u8 channel);bool rtl92c_phy_update_txpower_dbm (struct ieee80211_hw *hw,long power_indbm); -void rtl92c_phy_scan_operation_backup (struct ieee80211_hw *hw,u8 operation);void rtl92c_phy_set_bw_mode (struct ieee80211_hw *hw,enum nl80211_channel_type ch_type);void rtl92c_phy_sw_chnl_callback (struct ieee80211_hw *hw);
drivers/net/wireless/rtlwifi/rtl8192ce/sw.c +2 -1
@@ -30,6 +30,7 @@#include "../wifi.h" #include "../core.h" #include "../pci.h" +#include "../base.h" #include "reg.h" #include "def.h" #include "phy.h"
@@ -219,7 +220,7 @@ static struct rtl_hal_ops rtl8192ce_hal_ops = { .set_bw_mode = rtl92c_phy_set_bw_mode, .switch_channel = rtl92c_phy_sw_chnl, .dm_watchdog = rtl92c_dm_watchdog, - .scan_operation_backup = rtl92c_phy_scan_operation_backup, + .scan_operation_backup = rtl_phy_scan_operation_backup, .set_rf_power_state = rtl92c_phy_set_rf_power_state, .led_control = rtl92ce_led_control, .set_desc = rtl92ce_set_desc,
Signature · 6 lines
1.8.1.4 -- To unsubscribe from this list: send the line "unsubscribe linux-wireless" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
PATCH 1/7 rtlwifi: Implement a common rtl_phy_scan_operation_backup() routine
In reply to Larry FingerSeveral of the drivers supported by rtlwifi individually implement the same routine that supports scans. As a first step, create this routine in driver rtlwifi.
--- drivers/net/wireless/rtlwifi/base.c | 29 +++++++++++++++++++++++++++++ drivers/net/wireless/rtlwifi/base.h | 1 + 2 files changed, 30 insertions(+)
drivers/net/wireless/rtlwifi/base.c +29 -0
@@ -1613,6 +1613,35 @@ err_free: }EXPORT_SYMBOL (rtl_send_smps_action); +void rtl_phy_scan_operation_backup (struct ieee80211_hw *hw,u8 operation) +{ +struct rtl_priv *rtlpriv =rtl_priv (hw); +struct rtl_hal *rtlhal =rtl_hal (rtl_priv (hw)); +enum io_type iotype; + +if (!is_hal_stop (rtlhal)) { +switch (operation) { +case SCAN_OPT_BACKUP : + iotype =IO_CMD_PAUSE_DM_BY_SCAN ; + rtlpriv->cfg->ops->set_hw_reg (hw, +HW_VAR_IO_CMD , + (u8 *)&iotype); +break ; +case SCAN_OPT_RESTORE : + iotype =IO_CMD_RESUME_DM_BY_SCAN ; + rtlpriv->cfg->ops->set_hw_reg (hw, +HW_VAR_IO_CMD , + (u8 *)&iotype); +break ; +default : +RT_TRACE (rtlpriv,COMP_ERR ,DBG_EMERG , +"Unknown Scan Backup operation.\n" ); +break ; + } + } +} +EXPORT_SYMBOL (rtl_phy_scan_operation_backup); +/* There seem to be issues in mac80211 regarding when del ba frames can be * received. As a work around, we make a fake del_ba if we receive a ba_req; * however, rx_agg was opened to let mac80211 release some ba related
drivers/net/wireless/rtlwifi/base.h +1 -0
@@ -152,5 +152,6 @@ int rtlwifi_rate_mapping(struct ieee80211_hw *hw,bool rtl_tx_mgmt_proc (struct ieee80211_hw *hw,struct sk_buff *skb);struct sk_buff *rtl_make_del_ba (struct ieee80211_hw *hw,u8 *sa,u8 *bssid,u16 tid); +void rtl_phy_scan_operation_backup (struct ieee80211_hw *hw,u8 operation);#endif
Signature · 1 line
1.8.1.4
PATCH 2/7 rtlwifi: rtl8192cu: Convert to use new rtl_phy_scan_operation_backup() routine
In reply to Larry FingerNow that the routine exists in driver rtlwifi, convert rtl8192cu to use it.
--- drivers/net/wireless/rtlwifi/rtl8192cu/sw.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/net/wireless/rtlwifi/rtl8192cu/sw.c +2 -1
@@ -31,6 +31,7 @@#include "../core.h" #include "../usb.h" #include "../efuse.h" +#include "../base.h" #include "reg.h" #include "def.h" #include "phy.h"
@@ -117,7 +118,7 @@ static struct rtl_hal_ops rtl8192cu_hal_ops = { .set_bw_mode = rtl92c_phy_set_bw_mode, .switch_channel = rtl92c_phy_sw_chnl, .dm_watchdog = rtl92c_dm_watchdog, - .scan_operation_backup = rtl92c_phy_scan_operation_backup, + .scan_operation_backup = rtl_phy_scan_operation_backup, .set_rf_power_state = rtl92cu_phy_set_rf_power_state, .led_control = rtl92cu_led_control, .enable_hw_sec = rtl92cu_enable_hw_security_config,
Signature · 1 line
1.8.1.4
PATCH 4/7 rtlwifi: rtl8192c: Remove rtl8192c_phy_scan_operation_backup()
In reply to Larry FingerDrivers rtl8192ce and rtl8192cu no longer rely on this routine. It is removed.
--- drivers/net/wireless/rtlwifi/rtl8192c/phy_common.c | 30 ---------------------- drivers/net/wireless/rtlwifi/rtl8192c/phy_common.h | 2 -- 2 files changed, 32 deletions(-)
drivers/net/wireless/rtlwifi/rtl8192c/phy_common.c +0 -30
@@ -592,36 +592,6 @@ long _rtl92c_phy_txpwr_idx_to_dbm(struct ieee80211_hw *hw, }EXPORT_SYMBOL (_rtl92c_phy_txpwr_idx_to_dbm); -void rtl92c_phy_scan_operation_backup (struct ieee80211_hw *hw,u8 operation) -{ -struct rtl_priv *rtlpriv =rtl_priv (hw); -struct rtl_hal *rtlhal =rtl_hal (rtl_priv (hw)); -enum io_type iotype; - -if (!is_hal_stop (rtlhal)) { -switch (operation) { -case SCAN_OPT_BACKUP : - iotype =IO_CMD_PAUSE_DM_BY_SCAN ; - rtlpriv->cfg->ops->set_hw_reg (hw, -HW_VAR_IO_CMD , - (u8 *)&iotype); - -break ; -case SCAN_OPT_RESTORE : - iotype =IO_CMD_RESUME_DM_BY_SCAN ; - rtlpriv->cfg->ops->set_hw_reg (hw, -HW_VAR_IO_CMD , - (u8 *)&iotype); -break ; -default : -RT_TRACE (rtlpriv,COMP_ERR ,DBG_EMERG , -"Unknown Scan Backup operation\n" ); -break ; - } - } -} -EXPORT_SYMBOL (rtl92c_phy_scan_operation_backup); -void rtl92c_phy_set_bw_mode (struct ieee80211_hw *hw,enum nl80211_channel_type ch_type) {
drivers/net/wireless/rtlwifi/rtl8192c/phy_common.h +0 -2
@@ -203,8 +203,6 @@ void rtl92c_phy_get_txpower_level(struct ieee80211_hw *hw,void rtl92c_phy_set_txpower_level (struct ieee80211_hw *hw,u8 channel);bool rtl92c_phy_update_txpower_dbm (struct ieee80211_hw *hw,long power_indbm); -void rtl92c_phy_scan_operation_backup (struct ieee80211_hw *hw, -u8 operation);void rtl92c_phy_set_bw_mode (struct ieee80211_hw *hw,enum nl80211_channel_type ch_type);void rtl92c_phy_sw_chnl_callback (struct ieee80211_hw *hw);
Signature · 1 line
1.8.1.4
PATCH 5/7 rtlwifi: rtl8192ce: Convert driver to use new rtl_phy_scan_operation_backup() routine
In reply to Larry FingerNow that rtl_phy_scan_operation_backup() exists, convert rtl8192de to use it. Routine rtl92d_phy_scan_operation_backup() is no longer used and is removed.
--- drivers/net/wireless/rtlwifi/rtl8192de/phy.c | 28 ---------------------------- drivers/net/wireless/rtlwifi/rtl8192de/phy.h | 1 - drivers/net/wireless/rtlwifi/rtl8192de/sw.c | 3 ++- 3 files changed, 2 insertions(+), 30 deletions(-)
drivers/net/wireless/rtlwifi/rtl8192de/phy.c +0 -28
@@ -1022,34 +1022,6 @@ void rtl92d_phy_set_txpower_level(struct ieee80211_hw *hw, u8 channel)rtl92d_phy_rf6052_set_ofdm_txpower (hw, &ofdmpowerlevel[0 ], channel); } -void rtl92d_phy_scan_operation_backup (struct ieee80211_hw *hw,u8 operation) -{ -struct rtl_priv *rtlpriv =rtl_priv (hw); -struct rtl_hal *rtlhal =rtl_hal (rtl_priv (hw)); -enum io_type iotype; - -if (!is_hal_stop (rtlhal)) { -switch (operation) { -case SCAN_OPT_BACKUP : - rtlhal->current_bandtypebackup = - rtlhal->current_bandtype; - iotype =IO_CMD_PAUSE_DM_BY_SCAN ; - rtlpriv->cfg->ops->set_hw_reg (hw,HW_VAR_IO_CMD , - (u8 *)&iotype); -break ; -case SCAN_OPT_RESTORE : - iotype =IO_CMD_RESUME_DM_BY_SCAN ; - rtlpriv->cfg->ops->set_hw_reg (hw,HW_VAR_IO_CMD , - (u8 *)&iotype); -break ; -default : -RT_TRACE (rtlpriv,COMP_ERR ,DBG_EMERG , -"Unknown Scan Backup operation\n" ); -break ; - } - } -} -void rtl92d_phy_set_bw_mode (struct ieee80211_hw *hw,enum nl80211_channel_type ch_type) {
drivers/net/wireless/rtlwifi/rtl8192de/phy.h +0 -1
@@ -139,7 +139,6 @@ bool rtl92c_phy_config_rf_with_feaderfile(struct ieee80211_hw *hw, enum radio_path rfpath);void rtl92d_phy_get_hw_reg_originalvalue (struct ieee80211_hw *hw);void rtl92d_phy_set_txpower_level (struct ieee80211_hw *hw,u8 channel); -void rtl92d_phy_scan_operation_backup (struct ieee80211_hw *hw,u8 operation);void rtl92d_phy_set_bw_mode (struct ieee80211_hw *hw,enum nl80211_channel_type ch_type);u8 rtl92d_phy_sw_chnl (struct ieee80211_hw *hw);
drivers/net/wireless/rtlwifi/rtl8192de/sw.c +2 -1
@@ -30,6 +30,7 @@#include "../wifi.h" #include "../core.h" #include "../pci.h" +#include "../base.h" #include "reg.h" #include "def.h" #include "phy.h"
@@ -236,7 +237,7 @@ static struct rtl_hal_ops rtl8192de_hal_ops = { .set_bw_mode = rtl92d_phy_set_bw_mode, .switch_channel = rtl92d_phy_sw_chnl, .dm_watchdog = rtl92d_dm_watchdog, - .scan_operation_backup = rtl92d_phy_scan_operation_backup, + .scan_operation_backup = rtl_phy_scan_operation_backup, .set_rf_power_state = rtl92d_phy_set_rf_power_state, .led_control = rtl92de_led_control, .set_desc = rtl92de_set_desc,
Signature · 1 line
1.8.1.4
PATCH 6/7 rtlwifi: rtl8723ae: Convert driver to use new rtl_phy_scan_operation_backup() routine
In reply to Larry FingerNow that rtl_phy_scan_operation_backup() exists, convert rtl8723ae to use it. Routine rtl8723ae_phy_scan_operation_backup() is no longer used and is removed.
--- drivers/net/wireless/rtlwifi/rtl8723ae/phy.c | 29 ---------------------------- drivers/net/wireless/rtlwifi/rtl8723ae/phy.h | 1 - drivers/net/wireless/rtlwifi/rtl8723ae/sw.c | 3 ++- 3 files changed, 2 insertions(+), 31 deletions(-)
drivers/net/wireless/rtlwifi/rtl8723ae/phy.c +0 -29
@@ -934,35 +934,6 @@ static long _phy_txpwr_idx_to_dbm(struct ieee80211_hw *hw,return pwrout_dbm; } -void rtl8723ae_phy_scan_operation_backup (struct ieee80211_hw *hw,u8 operation) -{ -struct rtl_priv *rtlpriv =rtl_priv (hw); -struct rtl_hal *rtlhal =rtl_hal (rtl_priv (hw)); -enum io_type iotype; - -if (!is_hal_stop (rtlhal)) { -switch (operation) { -case SCAN_OPT_BACKUP : - iotype =IO_CMD_PAUSE_DM_BY_SCAN ; - rtlpriv->cfg->ops->set_hw_reg (hw, -HW_VAR_IO_CMD , - (u8 *)&iotype); - -break ; -case SCAN_OPT_RESTORE : - iotype =IO_CMD_RESUME_DM_BY_SCAN ; - rtlpriv->cfg->ops->set_hw_reg (hw, -HW_VAR_IO_CMD , - (u8 *)&iotype); -break ; -default : -RT_TRACE (rtlpriv,COMP_ERR ,DBG_EMERG , -"Unknown Scan Backup operation.\n" ); -break ; - } - } -} -void rtl8723ae_phy_set_bw_mode_callback (struct ieee80211_hw *hw) {struct rtl_priv *rtlpriv =rtl_priv (hw);
drivers/net/wireless/rtlwifi/rtl8723ae/phy.h +0 -1
@@ -203,7 +203,6 @@ void rtl8723ae_phy_get_txpower_level(struct ieee80211_hw *hw, long *powerlevel);void rtl8723ae_phy_set_txpower_level (struct ieee80211_hw *hw,u8 channel);bool rtl8723ae_phy_update_txpower_dbm (struct ieee80211_hw *hw,long power_indbm); -void rtl8723ae_phy_scan_operation_backup (struct ieee80211_hw *hw,u8 operation);void rtl8723ae_phy_set_bw_mode_callback (struct ieee80211_hw *hw);void rtl8723ae_phy_set_bw_mode (struct ieee80211_hw *hw,enum nl80211_channel_type ch_type);
drivers/net/wireless/rtlwifi/rtl8723ae/sw.c +2 -1
@@ -33,6 +33,7 @@#include "../core.h" #include "../pci.h" +#include "../base.h" #include "reg.h" #include "def.h" #include "phy.h"
@@ -220,7 +221,7 @@ static struct rtl_hal_ops rtl8723ae_hal_ops = { .set_bw_mode = rtl8723ae_phy_set_bw_mode, .switch_channel = rtl8723ae_phy_sw_chnl, .dm_watchdog = rtl8723ae_dm_watchdog, - .scan_operation_backup = rtl8723ae_phy_scan_operation_backup, + .scan_operation_backup = rtl_phy_scan_operation_backup, .set_rf_power_state = rtl8723ae_phy_set_rf_power_state, .led_control = rtl8723ae_led_control, .set_desc = rtl8723ae_set_desc,
Signature · 1 line
1.8.1.4
PATCH 7/7 rtlwifi: rtl8188ee: Convert driver to use new rtl_phy_scan_operation_backup() routine
In reply to Larry FingerNow that rtl_phy_scan_operation_backup() exists, convert rtl8188ee to use it. Routine rtl88e_phy_scan_operation_backup() is no longer used and is removed.
--- drivers/net/wireless/rtlwifi/rtl8188ee/phy.c | 28 ---------------------------- drivers/net/wireless/rtlwifi/rtl8188ee/phy.h | 1 - drivers/net/wireless/rtlwifi/rtl8188ee/sw.c | 3 ++- 3 files changed, 2 insertions(+), 30 deletions(-)
drivers/net/wireless/rtlwifi/rtl8188ee/phy.c +0 -28
@@ -1136,34 +1136,6 @@ void rtl88e_phy_set_txpower_level(struct ieee80211_hw *hw, u8 channel) &bw40_pwr[0], channel); } -void rtl88e_phy_scan_operation_backup (struct ieee80211_hw *hw,u8 operation) -{ -struct rtl_priv *rtlpriv =rtl_priv (hw); -struct rtl_hal *rtlhal =rtl_hal (rtl_priv (hw)); -enum io_type iotype; - -if (!is_hal_stop (rtlhal)) { -switch (operation) { -case SCAN_OPT_BACKUP : - iotype =IO_CMD_PAUSE_DM_BY_SCAN ; - rtlpriv->cfg->ops->set_hw_reg (hw, -HW_VAR_IO_CMD , - (u8 *)&iotype); -break ; -case SCAN_OPT_RESTORE : - iotype =IO_CMD_RESUME_DM_BY_SCAN ; - rtlpriv->cfg->ops->set_hw_reg (hw, -HW_VAR_IO_CMD , - (u8 *)&iotype); -break ; -default : -RT_TRACE (rtlpriv,COMP_ERR ,DBG_EMERG , -"Unknown Scan Backup operation.\n" ); -break ; - } - } -} -void rtl88e_phy_set_bw_mode_callback (struct ieee80211_hw *hw) {struct rtl_priv *rtlpriv =rtl_priv (hw);
drivers/net/wireless/rtlwifi/rtl8188ee/phy.h +0 -1
@@ -213,7 +213,6 @@ bool rtl88e_phy_rf_config(struct ieee80211_hw *hw);void rtl88e_phy_get_hw_reg_originalvalue (struct ieee80211_hw *hw);void rtl88e_phy_get_txpower_level (struct ieee80211_hw *hw,long *powerlevel);void rtl88e_phy_set_txpower_level (struct ieee80211_hw *hw,u8 channel); -void rtl88e_phy_scan_operation_backup (struct ieee80211_hw *hw,u8 operation);void rtl88e_phy_set_bw_mode_callback (struct ieee80211_hw *hw);void rtl88e_phy_set_bw_mode (struct ieee80211_hw *hw,enum nl80211_channel_type ch_type);
drivers/net/wireless/rtlwifi/rtl8188ee/sw.c +2 -1
@@ -30,6 +30,7 @@#include "../wifi.h" #include "../core.h" #include "../pci.h" +#include "../base.h" #include "reg.h" #include "def.h" #include "phy.h"
@@ -244,7 +245,7 @@ static struct rtl_hal_ops rtl8188ee_hal_ops = { .set_bw_mode = rtl88e_phy_set_bw_mode, .switch_channel = rtl88e_phy_sw_chnl, .dm_watchdog = rtl88e_dm_watchdog, - .scan_operation_backup = rtl88e_phy_scan_operation_backup, + .scan_operation_backup = rtl_phy_scan_operation_backup, .set_rf_power_state = rtl88e_phy_set_rf_power_state, .led_control = rtl88ee_led_control, .set_desc = rtl88ee_set_desc,
Signature · 1 line
1.8.1.4