diff options
Diffstat (limited to 'drivers/net/wireless/rtlwifi/rtl8188ee/phy.c')
| -rw-r--r-- | drivers/net/wireless/rtlwifi/rtl8188ee/phy.c | 91 | 
1 files changed, 8 insertions, 83 deletions
diff --git a/drivers/net/wireless/rtlwifi/rtl8188ee/phy.c b/drivers/net/wireless/rtlwifi/rtl8188ee/phy.c index e655c047322..1cd6c16d597 100644 --- a/drivers/net/wireless/rtlwifi/rtl8188ee/phy.c +++ b/drivers/net/wireless/rtlwifi/rtl8188ee/phy.c @@ -29,6 +29,7 @@  #include "../wifi.h"  #include "../pci.h" +#include "../core.h"  #include "../ps.h"  #include "reg.h"  #include "def.h" @@ -151,18 +152,7 @@ static bool config_bb_with_pgheader(struct ieee80211_hw *hw,  			v2 = table_pg[i + 1];  			if (v1 < 0xcdcdcdcd) { -				if (table_pg[i] == 0xfe) -					mdelay(50); -				else if (table_pg[i] == 0xfd) -					mdelay(5); -				else if (table_pg[i] == 0xfc) -					mdelay(1); -				else if (table_pg[i] == 0xfb) -					udelay(50); -				else if (table_pg[i] == 0xfa) -					udelay(5); -				else if (table_pg[i] == 0xf9) -					udelay(1); +				rtl_addr_delay(table_pg[i]);  				store_pwrindex_offset(hw, table_pg[i],  						      table_pg[i + 1], @@ -672,24 +662,9 @@ static void _rtl8188e_config_rf_reg(struct ieee80211_hw *hw,  				    u32 addr, u32 data, enum radio_path rfpath,  				    u32 regaddr)  { -	if (addr == 0xffe) { -		mdelay(50); -	} else if (addr == 0xfd) { -		mdelay(5); -	} else if (addr == 0xfc) { -		mdelay(1); -	} else if (addr == 0xfb) { -		udelay(50); -	} else if (addr == 0xfa) { -		udelay(5); -	} else if (addr == 0xf9) { -		udelay(1); -	} else { -		rtl_set_rfreg(hw, rfpath, regaddr, -			      RFREG_OFFSET_MASK, -			      data); -		udelay(1); -	} +	rtl_rfreg_delay(hw, rfpath, regaddr, +			RFREG_OFFSET_MASK, +			data);  }  static void rtl88_config_s(struct ieee80211_hw *hw, @@ -702,28 +677,6 @@ static void rtl88_config_s(struct ieee80211_hw *hw,  				addr | maskforphyset);  } -static void _rtl8188e_config_bb_reg(struct ieee80211_hw *hw, -				    u32 addr, u32 data) -{ -	if (addr == 0xfe) { -		mdelay(50); -	} else if (addr == 0xfd) { -		mdelay(5); -	} else if (addr == 0xfc) { -		mdelay(1); -	} else if (addr == 0xfb) { -		udelay(50); -	} else if (addr == 0xfa) { -		udelay(5); -	} else if (addr == 0xf9) { -		udelay(1); -	} else { -		rtl_set_bbreg(hw, addr, MASKDWORD, data); -		udelay(1); -	} -} - -  #define NEXT_PAIR(v1, v2, i)				\  	do {						\  		i += 2; v1 = array_table[i];		\ @@ -795,7 +748,7 @@ static void set_baseband_phy_config(struct ieee80211_hw *hw)  		v1 = array_table[i];  		v2 = array_table[i + 1];  		if (v1 < 0xcdcdcdcd) { -			_rtl8188e_config_bb_reg(hw, v1, v2); +			rtl_bb_delay(hw, v1, v2);  		} else {/*This line is the start line of branch.*/  			if (!check_cond(hw, array_table[i])) {  				/*Discard the following (offset, data) pairs*/ @@ -811,7 +764,7 @@ static void set_baseband_phy_config(struct ieee80211_hw *hw)  				while (v2 != 0xDEAD &&  				       v2 != 0xCDEF &&  				       v2 != 0xCDCD && i < arraylen - 2) { -					_rtl8188e_config_bb_reg(hw, v1, v2); +					rtl_bb_delay(hw, v1, v2);  					NEXT_PAIR(v1, v2, i);  				} @@ -1002,7 +955,7 @@ bool rtl88e_phy_config_rf_with_headerfile(struct ieee80211_hw *hw,  			}  		} -		if (rtlhal->oem_id == RT_CID_819x_HP) +		if (rtlhal->oem_id == RT_CID_819X_HP)  			rtl88_config_s(hw, 0x52, 0x7E4BD);  		break; @@ -1136,34 +1089,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);  | 
