[PATCH 16/17] rtl8192e: Rewrite macro as inline function

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Signed-off-by: Mike McCormack <mikem@xxxxxxxxxx>
---
 drivers/staging/rtl8192e/ieee80211/ieee80211.h |    3 ---
 drivers/staging/rtl8192e/r8192E.h              |   13 +++++++++++++
 drivers/staging/rtl8192e/r8192E_core.c         |    2 +-
 drivers/staging/rtl8192e/r8192E_dm.c           |    2 +-
 4 files changed, 15 insertions(+), 5 deletions(-)

diff --git a/drivers/staging/rtl8192e/ieee80211/ieee80211.h b/drivers/staging/rtl8192e/ieee80211/ieee80211.h
index 6bae711..66b897a 100644
--- a/drivers/staging/rtl8192e/ieee80211/ieee80211.h
+++ b/drivers/staging/rtl8192e/ieee80211/ieee80211.h
@@ -213,9 +213,6 @@ enum	_ReasonCode{
 };
 
 
-
-#define aSifsTime	 (((priv->ieee80211->current_network.mode == IEEE_A)||(priv->ieee80211->current_network.mode == IEEE_N_24G)||(priv->ieee80211->current_network.mode == IEEE_N_5G))? 16 : 10)
-
 #define MGMT_QUEUE_NUM 5
 
 #define IEEE_CMD_SET_WPA_PARAM			1
diff --git a/drivers/staging/rtl8192e/r8192E.h b/drivers/staging/rtl8192e/r8192E.h
index 30a0b8a..9ec1fc4 100644
--- a/drivers/staging/rtl8192e/r8192E.h
+++ b/drivers/staging/rtl8192e/r8192E.h
@@ -1083,6 +1083,19 @@ typedef struct r8192_priv
 	struct workqueue_struct *priv_wq;
 }r8192_priv;
 
+static inline u8 rtl8192e_get_sifs_time(struct r8192_priv *priv)
+{
+	switch (priv->ieee80211->current_network.mode)
+	{
+	case IEEE_A:
+	case IEEE_N_24G:
+	case IEEE_N_5G:
+		return 16;
+	default:
+		return 10;
+	}
+}
+
 bool init_firmware(struct r8192_priv *priv);
 u32 read_cam(struct r8192_priv *priv, u8 addr);
 void write_cam(struct r8192_priv *priv, u8 addr, u32 data);
diff --git a/drivers/staging/rtl8192e/r8192E_core.c b/drivers/staging/rtl8192e/r8192E_core.c
index 6942cb2..ad1c3c4 100644
--- a/drivers/staging/rtl8192e/r8192E_core.c
+++ b/drivers/staging/rtl8192e/r8192E_core.c
@@ -1547,7 +1547,7 @@ static void rtl8192_qos_activate(struct work_struct * work)
 	/* update the ac parameter to related registers */
 	for(i = 0; i <  QOS_QUEUE_NUM; i++) {
 		//Mode G/A: slotTimeTimer = 9; Mode B: 20
-		u1bAIFS = qos_parameters->aifs[i] * ((mode&(IEEE_G|IEEE_N_24G)) ?9:20) + aSifsTime;
+		u1bAIFS = qos_parameters->aifs[i] * ((mode&(IEEE_G|IEEE_N_24G)) ?9:20) + rtl8192e_get_sifs_time(priv);
 		u4bAcParam = ((((u32)(qos_parameters->tx_op_limit[i]))<< AC_PARAM_TXOP_LIMIT_OFFSET)|
 				(((u32)(qos_parameters->cw_max[i]))<< AC_PARAM_ECW_MAX_OFFSET)|
 				(((u32)(qos_parameters->cw_min[i]))<< AC_PARAM_ECW_MIN_OFFSET)|
diff --git a/drivers/staging/rtl8192e/r8192E_dm.c b/drivers/staging/rtl8192e/r8192E_dm.c
index 688d29b..fec1a02 100644
--- a/drivers/staging/rtl8192e/r8192E_dm.c
+++ b/drivers/staging/rtl8192e/r8192E_dm.c
@@ -1665,7 +1665,7 @@ static void dm_check_edca_turbo(struct r8192_priv *priv)
 
 			// For Each time updating EDCA parameter, reset EDCA turbo mode status.
 				dm_init_edca_turbo(priv);
-				u1bAIFS = qos_parameters->aifs[0] * ((mode&(IEEE_G|IEEE_N_24G)) ?9:20) + aSifsTime;
+				u1bAIFS = qos_parameters->aifs[0] * ((mode&(IEEE_G|IEEE_N_24G)) ?9:20) + rtl8192e_get_sifs_time(priv);
 				u4bAcParam = ((((u32)(qos_parameters->tx_op_limit[0]))<< AC_PARAM_TXOP_LIMIT_OFFSET)|
 					(((u32)(qos_parameters->cw_max[0]))<< AC_PARAM_ECW_MAX_OFFSET)|
 					(((u32)(qos_parameters->cw_min[0]))<< AC_PARAM_ECW_MIN_OFFSET)|
-- 
1.7.0.4


_______________________________________________
devel mailing list
devel@xxxxxxxxxxxxxxxxxxxxxx
http://driverdev.linuxdriverproject.org/mailman/listinfo/devel


[Index of Archives]     [Linux Driver Backports]     [DMA Engine]     [Linux GPIO]     [Linux SPI]     [Video for Linux]     [Linux USB Devel]     [Linux Coverity]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]
  Powered by Linux