[PATCH 15/19] rtl8192e: Pass rtl8192_priv to dm functions

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

 



Signed-off-by: Mike McCormack <mikem@xxxxxxxxxx>
---
 drivers/staging/rtl8192e/r8192E_core.c |    9 ++++-----
 drivers/staging/rtl8192e/r8192E_dm.c   |   19 ++++++-------------
 drivers/staging/rtl8192e/r8192E_dm.h   |    8 ++++----
 3 files changed, 14 insertions(+), 22 deletions(-)

diff --git a/drivers/staging/rtl8192e/r8192E_core.c b/drivers/staging/rtl8192e/r8192E_core.c
index d1cb528..332b203 100644
--- a/drivers/staging/rtl8192e/r8192E_core.c
+++ b/drivers/staging/rtl8192e/r8192E_core.c
@@ -2292,7 +2292,7 @@ static void rtl8192_read_eeprom_info(struct r8192_priv *priv)
 
 	// 2008/01/16 MH We can only know RF type in the function. So we have to init
 	// DIG RATR table again.
-	init_rate_adaptive(dev);
+	init_rate_adaptive(priv);
 
 	//1 Make a copy for following variables and we can change them if we want
 
@@ -2408,7 +2408,7 @@ static short rtl8192_init(struct r8192_priv *priv)
 	rtl8192_get_eeprom_size(priv);
 	rtl8192_read_eeprom_info(priv);
 	rtl8192_get_channel_map(priv);
-	init_hal_dm(dev);
+	init_hal_dm(priv);
 	init_timer(&priv->watch_dog_timer);
 	priv->watch_dog_timer.data = (unsigned long)priv;
 	priv->watch_dog_timer.function = watch_dog_timer_callback;
@@ -3228,7 +3228,6 @@ static void rtl819x_watchdog_wqcallback(struct work_struct *work)
 {
 	struct delayed_work *dwork = container_of(work,struct delayed_work,work);
        struct r8192_priv *priv = container_of(dwork,struct r8192_priv,watch_dog_wq);
-	struct net_device *dev = priv->ieee80211->dev;
 	struct ieee80211_device* ieee = priv->ieee80211;
 	RESET_TYPE	ResetType = RESET_TYPE_NORESET;
 	bool bBusyTraffic = false;
@@ -3239,7 +3238,7 @@ static void rtl819x_watchdog_wqcallback(struct work_struct *work)
 
 	if(!priv->up)
 		return;
-	hal_dm_watchdog(dev);
+	hal_dm_watchdog(priv);
 #ifdef ENABLE_IPS
 	if(ieee->actscanning == false){
 		if((ieee->iw_mode == IW_MODE_INFRA) && (ieee->state == IEEE80211_NOLINK) &&
@@ -3452,7 +3451,7 @@ int rtl8192_down(struct net_device *dev)
 
 	rtl8192_irq_disable(priv);
 	rtl8192_cancel_deferred_work(priv);
-	deinit_hal_dm(dev);
+	deinit_hal_dm(priv);
 	del_timer_sync(&priv->watch_dog_timer);
 
 	ieee80211_softmac_stop_protocol(priv->ieee80211,true);
diff --git a/drivers/staging/rtl8192e/r8192E_dm.c b/drivers/staging/rtl8192e/r8192E_dm.c
index 68ac73e..4ea50b8 100644
--- a/drivers/staging/rtl8192e/r8192E_dm.c
+++ b/drivers/staging/rtl8192e/r8192E_dm.c
@@ -95,16 +95,14 @@ static void dm_fsync_timer_callback(unsigned long data);
  * Prepare SW resource for HW dynamic mechanism.
  * This function is only invoked at driver intialization once.
  */
-void init_hal_dm(struct net_device *dev)
+void init_hal_dm(struct r8192_priv *priv)
 {
-	struct r8192_priv *priv = ieee80211_priv(dev);
-
 	// Undecorated Smoothed Signal Strength, it can utilized to dynamic mechanism.
 	priv->undecorated_smoothed_pwdb = -1;
 
 	//Initial TX Power Control for near/far range , add by amy 2008/05/15, porting from windows code.
 	dm_init_dynamic_txpower(priv);
-	init_rate_adaptive(dev);
+	init_rate_adaptive(priv);
 	//dm_initialize_txpower_tracking(dev);
 	dm_dig_init(priv);
 	dm_init_edca_turbo(priv);
@@ -116,16 +114,13 @@ void init_hal_dm(struct net_device *dev)
 
 }
 
-void deinit_hal_dm(struct net_device *dev)
+void deinit_hal_dm(struct r8192_priv *priv)
 {
-	struct r8192_priv *priv = ieee80211_priv(dev);
-
 	dm_deInit_fsync(priv);
 }
 
-void hal_dm_watchdog(struct net_device *dev)
+void hal_dm_watchdog(struct r8192_priv *priv)
 {
-	struct r8192_priv *priv = ieee80211_priv(dev);
 
 	/*Add by amy 2008/05/15 ,porting from windows code.*/
 	dm_check_rate_adaptive(priv);
@@ -154,11 +149,9 @@ void hal_dm_watchdog(struct net_device *dev)
   *	01/16/2008	MHC		RF_Type is assigned in ReadAdapterInfo(). We must call
   *						the function after making sure RF_Type.
   */
-void init_rate_adaptive(struct net_device * dev)
+void init_rate_adaptive(struct r8192_priv *priv)
 {
-
-	struct r8192_priv *priv = ieee80211_priv(dev);
-	prate_adaptive			pra = (prate_adaptive)&priv->rate_adaptive;
+	prate_adaptive pra = &priv->rate_adaptive;
 
 	pra->ratr_state = DM_RATR_STA_MAX;
 	pra->high2low_rssi_thresh_for_ra = RateAdaptiveTH_High;
diff --git a/drivers/staging/rtl8192e/r8192E_dm.h b/drivers/staging/rtl8192e/r8192E_dm.h
index 306dc36..b5b34ea 100644
--- a/drivers/staging/rtl8192e/r8192E_dm.h
+++ b/drivers/staging/rtl8192e/r8192E_dm.h
@@ -212,12 +212,12 @@ typedef struct tag_Tx_Config_Cmd_Format
 extern dig_t dm_digtable;
 extern DRxPathSel DM_RxPathSelTable;
 
-void init_hal_dm(struct net_device *dev);
-void deinit_hal_dm(struct net_device *dev);
+void init_hal_dm(struct r8192_priv *priv);
+void deinit_hal_dm(struct r8192_priv *priv);
 
-void hal_dm_watchdog(struct net_device *dev);
+void hal_dm_watchdog(struct r8192_priv *priv);
 
-void init_rate_adaptive(struct net_device *dev);
+void init_rate_adaptive(struct r8192_priv *priv);
 void dm_txpower_trackingcallback(struct work_struct *work);
 void dm_rf_pathcheck_workitemcallback(struct work_struct *work);
 void dm_initialize_txpower_tracking(struct r8192_priv *priv);
-- 
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