Commit ca0298c0 authored by Philipp Hortmann's avatar Philipp Hortmann Committed by Greg Kroah-Hartman
Browse files

staging: rtl8192e: Rename pPSC

parent ca25401e
Loading
Loading
Loading
Loading
+7 −7
Original line number Diff line number Diff line
@@ -1303,7 +1303,7 @@ static bool _rtl92e_set_rf_power_state(struct net_device *dev,
				       enum rt_rf_power_state rf_power_state)
{
	struct r8192_priv *priv = rtllib_priv(dev);
	struct rt_pwr_save_ctrl *pPSC = (struct rt_pwr_save_ctrl *)
	struct rt_pwr_save_ctrl *psc = (struct rt_pwr_save_ctrl *)
					(&priv->rtllib->pwr_save_ctrl);
	bool bResult = true;
	u8	i = 0, QueueID = 0;
@@ -1318,7 +1318,7 @@ static bool _rtl92e_set_rf_power_state(struct net_device *dev,
		switch (rf_power_state) {
		case rf_on:
			if ((priv->rtllib->rf_power_state == rf_off) &&
			     RT_IN_PS_LEVEL(pPSC, RT_RF_OFF_LEVL_HALT_NIC)) {
			     RT_IN_PS_LEVEL(psc, RT_RF_OFF_LEVL_HALT_NIC)) {
				bool rtstatus;
				u32 InitilizeCount = 3;

@@ -1335,7 +1335,7 @@ static bool _rtl92e_set_rf_power_state(struct net_device *dev,
					return false;
				}

				RT_CLEAR_PS_LEVEL(pPSC,
				RT_CLEAR_PS_LEVEL(psc,
						  RT_RF_OFF_LEVL_HALT_NIC);
			} else {
				rtl92e_writeb(dev, ANAPAR, 0x37);
@@ -1399,11 +1399,11 @@ static bool _rtl92e_set_rf_power_state(struct net_device *dev,
					break;
			}

			if (pPSC->RegRfPsLevel & RT_RF_OFF_LEVL_HALT_NIC &&
			    !RT_IN_PS_LEVEL(pPSC, RT_RF_OFF_LEVL_HALT_NIC)) {
			if (psc->RegRfPsLevel & RT_RF_OFF_LEVL_HALT_NIC &&
			    !RT_IN_PS_LEVEL(psc, RT_RF_OFF_LEVL_HALT_NIC)) {
				rtl92e_disable_nic(dev);
				RT_SET_PS_LEVEL(pPSC, RT_RF_OFF_LEVL_HALT_NIC);
			} else if (!(pPSC->RegRfPsLevel &
				RT_SET_PS_LEVEL(psc, RT_RF_OFF_LEVL_HALT_NIC);
			} else if (!(psc->RegRfPsLevel &
				   RT_RF_OFF_LEVL_HALT_NIC)) {
				rtl92e_set_rf_off(dev);
			}
+8 −8
Original line number Diff line number Diff line
@@ -682,7 +682,7 @@ void rtl92e_set_wireless_mode(struct net_device *dev, u8 wireless_mode)
static int _rtl92e_sta_up(struct net_device *dev, bool is_silent_reset)
{
	struct r8192_priv *priv = rtllib_priv(dev);
	struct rt_pwr_save_ctrl *pPSC = (struct rt_pwr_save_ctrl *)
	struct rt_pwr_save_ctrl *psc = (struct rt_pwr_save_ctrl *)
					(&priv->rtllib->pwr_save_ctrl);
	bool init_status;

@@ -700,7 +700,7 @@ static int _rtl92e_sta_up(struct net_device *dev, bool is_silent_reset)
		return -1;
	}

	RT_CLEAR_PS_LEVEL(pPSC, RT_RF_OFF_LEVL_HALT_NIC);
	RT_CLEAR_PS_LEVEL(psc, RT_RF_OFF_LEVL_HALT_NIC);
	priv->bfirst_init = false;

	if (priv->polling_timer_on == 0)
@@ -819,10 +819,10 @@ static void _rtl92e_init_priv_handler(struct net_device *dev)
static void _rtl92e_init_priv_constant(struct net_device *dev)
{
	struct r8192_priv *priv = rtllib_priv(dev);
	struct rt_pwr_save_ctrl *pPSC = (struct rt_pwr_save_ctrl *)
	struct rt_pwr_save_ctrl *psc = (struct rt_pwr_save_ctrl *)
					&priv->rtllib->pwr_save_ctrl;

	pPSC->reg_max_lps_awake_intvl = 5;
	psc->reg_max_lps_awake_intvl = 5;
}

static void _rtl92e_init_priv_variable(struct net_device *dev)
@@ -1271,7 +1271,7 @@ static void _rtl92e_watchdog_wq_cb(void *data)
	enum reset_type ResetType = RESET_TYPE_NORESET;
	static u8 check_reset_cnt;
	unsigned long flags;
	struct rt_pwr_save_ctrl *pPSC = (struct rt_pwr_save_ctrl *)
	struct rt_pwr_save_ctrl *psc = (struct rt_pwr_save_ctrl *)
					(&priv->rtllib->pwr_save_ctrl);
	bool bBusyTraffic = false;
	bool	bHigherBusyTraffic = false;
@@ -1389,7 +1389,7 @@ static void _rtl92e_watchdog_wq_cb(void *data)

	spin_lock_irqsave(&priv->tx_lock, flags);
	if ((check_reset_cnt++ >= 3) && (!ieee->is_roaming) &&
	    (!priv->rf_change_in_progress) && (!pPSC->bSwRfProcessing)) {
	    (!priv->rf_change_in_progress) && (!psc->bSwRfProcessing)) {
		ResetType = _rtl92e_if_check_reset(dev);
		check_reset_cnt = 3;
	}
@@ -2421,7 +2421,7 @@ bool rtl92e_enable_nic(struct net_device *dev)
{
	bool init_status = true;
	struct r8192_priv *priv = rtllib_priv(dev);
	struct rt_pwr_save_ctrl *pPSC = (struct rt_pwr_save_ctrl *)
	struct rt_pwr_save_ctrl *psc = (struct rt_pwr_save_ctrl *)
					(&priv->rtllib->pwr_save_ctrl);

	if (!priv->up) {
@@ -2437,7 +2437,7 @@ bool rtl92e_enable_nic(struct net_device *dev)
		priv->bdisable_nic = false;
		return false;
	}
	RT_CLEAR_PS_LEVEL(pPSC, RT_RF_OFF_LEVL_HALT_NIC);
	RT_CLEAR_PS_LEVEL(psc, RT_RF_OFF_LEVL_HALT_NIC);
	priv->bfirst_init = false;

	rtl92e_irq_enable(dev);
+16 −16
Original line number Diff line number Diff line
@@ -100,27 +100,27 @@ void rtl92e_enter_sleep(struct net_device *dev, u64 time)
static void _rtl92e_ps_update_rf_state(struct net_device *dev)
{
	struct r8192_priv *priv = rtllib_priv(dev);
	struct rt_pwr_save_ctrl *pPSC = (struct rt_pwr_save_ctrl *)
	struct rt_pwr_save_ctrl *psc = (struct rt_pwr_save_ctrl *)
					&priv->rtllib->pwr_save_ctrl;

	pPSC->bSwRfProcessing = true;
	rtl92e_set_rf_state(dev, pPSC->eInactivePowerState, RF_CHANGE_BY_IPS);
	psc->bSwRfProcessing = true;
	rtl92e_set_rf_state(dev, psc->eInactivePowerState, RF_CHANGE_BY_IPS);

	pPSC->bSwRfProcessing = false;
	psc->bSwRfProcessing = false;
}

void rtl92e_ips_enter(struct net_device *dev)
{
	struct r8192_priv *priv = rtllib_priv(dev);
	struct rt_pwr_save_ctrl *pPSC = (struct rt_pwr_save_ctrl *)
	struct rt_pwr_save_ctrl *psc = (struct rt_pwr_save_ctrl *)
					&priv->rtllib->pwr_save_ctrl;
	enum rt_rf_power_state rt_state;

	rt_state = priv->rtllib->rf_power_state;
	if (rt_state == rf_on && !pPSC->bSwRfProcessing &&
	if (rt_state == rf_on && !psc->bSwRfProcessing &&
		(priv->rtllib->state != RTLLIB_LINKED) &&
		(priv->rtllib->iw_mode != IW_MODE_MASTER)) {
		pPSC->eInactivePowerState = rf_off;
		psc->eInactivePowerState = rf_off;
		_rtl92e_ps_update_rf_state(dev);
	}
}
@@ -128,14 +128,14 @@ void rtl92e_ips_enter(struct net_device *dev)
void rtl92e_ips_leave(struct net_device *dev)
{
	struct r8192_priv *priv = rtllib_priv(dev);
	struct rt_pwr_save_ctrl *pPSC = (struct rt_pwr_save_ctrl *)
	struct rt_pwr_save_ctrl *psc = (struct rt_pwr_save_ctrl *)
					&priv->rtllib->pwr_save_ctrl;
	enum rt_rf_power_state rt_state;

	rt_state = priv->rtllib->rf_power_state;
	if (rt_state != rf_on  && !pPSC->bSwRfProcessing &&
	if (rt_state != rf_on  && !psc->bSwRfProcessing &&
	    priv->rtllib->rf_off_reason <= RF_CHANGE_BY_IPS) {
		pPSC->eInactivePowerState = rf_on;
		psc->eInactivePowerState = rf_on;
		_rtl92e_ps_update_rf_state(dev);
	}
}
@@ -206,7 +206,7 @@ static bool _rtl92e_ps_set_mode(struct net_device *dev, u8 rtPsMode)
void rtl92e_leisure_ps_enter(struct net_device *dev)
{
	struct r8192_priv *priv = rtllib_priv(dev);
	struct rt_pwr_save_ctrl *pPSC = (struct rt_pwr_save_ctrl *)
	struct rt_pwr_save_ctrl *psc = (struct rt_pwr_save_ctrl *)
					&priv->rtllib->pwr_save_ctrl;

	if (!((priv->rtllib->iw_mode == IW_MODE_INFRA) &&
@@ -215,8 +215,8 @@ void rtl92e_leisure_ps_enter(struct net_device *dev)
	    (priv->rtllib->iw_mode == IW_MODE_MASTER))
		return;

	if (pPSC->bLeisurePs) {
		if (pPSC->LpsIdleCount >= RT_CHECK_FOR_HANG_PERIOD) {
	if (psc->bLeisurePs) {
		if (psc->LpsIdleCount >= RT_CHECK_FOR_HANG_PERIOD) {

			if (priv->rtllib->ps == RTLLIB_PS_DISABLED) {
				if (priv->rtllib->SetFwCmdHandler)
@@ -225,17 +225,17 @@ void rtl92e_leisure_ps_enter(struct net_device *dev)
							 RTLLIB_PS_UNICAST);
			}
		} else
			pPSC->LpsIdleCount++;
			psc->LpsIdleCount++;
	}
}

void rtl92e_leisure_ps_leave(struct net_device *dev)
{
	struct r8192_priv *priv = rtllib_priv(dev);
	struct rt_pwr_save_ctrl *pPSC = (struct rt_pwr_save_ctrl *)
	struct rt_pwr_save_ctrl *psc = (struct rt_pwr_save_ctrl *)
					&priv->rtllib->pwr_save_ctrl;

	if (pPSC->bLeisurePs) {
	if (psc->bLeisurePs) {
		if (priv->rtllib->ps != RTLLIB_PS_DISABLED) {
			_rtl92e_ps_set_mode(dev, RTLLIB_PS_DISABLED);
			if (priv->rtllib->SetFwCmdHandler)
+5 −5
Original line number Diff line number Diff line
@@ -159,7 +159,7 @@ static int _rtl92e_wx_adapter_power_status(struct net_device *dev,
					   union iwreq_data *wrqu, char *extra)
{
	struct r8192_priv *priv = rtllib_priv(dev);
	struct rt_pwr_save_ctrl *pPSC = (struct rt_pwr_save_ctrl *)
	struct rt_pwr_save_ctrl *psc = (struct rt_pwr_save_ctrl *)
					(&priv->rtllib->pwr_save_ctrl);
	struct rtllib_device *ieee = priv->rtllib;

@@ -167,13 +167,13 @@ static int _rtl92e_wx_adapter_power_status(struct net_device *dev,

	if (*extra || priv->force_lps) {
		priv->ps_force = false;
		pPSC->bLeisurePs = true;
		psc->bLeisurePs = true;
	} else {
		if (priv->rtllib->state == RTLLIB_LINKED)
			rtl92e_leisure_ps_leave(dev);

		priv->ps_force = true;
		pPSC->bLeisurePs = false;
		psc->bLeisurePs = false;
		ieee->ps = *extra;
	}

@@ -188,7 +188,7 @@ static int _rtl92e_wx_set_lps_awake_interval(struct net_device *dev,
					     char *extra)
{
	struct r8192_priv *priv = rtllib_priv(dev);
	struct rt_pwr_save_ctrl *pPSC = (struct rt_pwr_save_ctrl *)
	struct rt_pwr_save_ctrl *psc = (struct rt_pwr_save_ctrl *)
					(&priv->rtllib->pwr_save_ctrl);

	mutex_lock(&priv->wx_mutex);
@@ -196,7 +196,7 @@ static int _rtl92e_wx_set_lps_awake_interval(struct net_device *dev,
	netdev_info(dev, "%s(): set lps awake interval ! extra is %d\n",
		    __func__, *extra);

	pPSC->reg_max_lps_awake_intvl = *extra;
	psc->reg_max_lps_awake_intvl = *extra;
	mutex_unlock(&priv->wx_mutex);
	return 0;
}
+5 −5
Original line number Diff line number Diff line
@@ -111,11 +111,11 @@ static inline void *netdev_priv_rsl(struct net_device *dev)
#define SUPPORT_CKIP_MIC			0x08
#define SUPPORT_CKIP_PK			0x10
#define	RT_RF_OFF_LEVL_HALT_NIC		BIT3
#define	RT_IN_PS_LEVEL(pPSC, _PS_FLAG)		\
	((pPSC->CurPsLevel & _PS_FLAG) ? true : false)
#define	RT_CLEAR_PS_LEVEL(pPSC, _PS_FLAG)	\
	(pPSC->CurPsLevel &= (~(_PS_FLAG)))
#define	RT_SET_PS_LEVEL(pPSC, _PS_FLAG)	(pPSC->CurPsLevel |= _PS_FLAG)
#define	RT_IN_PS_LEVEL(psc, _PS_FLAG)		\
	((psc->CurPsLevel & _PS_FLAG) ? true : false)
#define	RT_CLEAR_PS_LEVEL(psc, _PS_FLAG)	\
	(psc->CurPsLevel &= (~(_PS_FLAG)))
#define	RT_SET_PS_LEVEL(psc, _PS_FLAG)	(psc->CurPsLevel |= _PS_FLAG)

/* defined for skb cb field */
/* At most 28 byte */
Loading