diff options
author | Mike McCormack <mikem@ring3k.org> | 2011-03-10 08:40:06 -0500 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2011-03-14 15:24:47 -0400 |
commit | eea7205027cdeaafe97ccf3c6df10b7f253af7c3 (patch) | |
tree | 24f029c4c1678f06f8c69c7180d3fea9d3edd958 | |
parent | 1e04ca7adf56e90c3dd3cbbf94936edb94f44d72 (diff) |
staging: rtl8192e: Pass rtl8192_priv to dm functions
Signed-off-by: Mike McCormack <mikem@ring3k.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
-rw-r--r-- | drivers/staging/rtl8192e/r8192E_core.c | 9 | ||||
-rw-r--r-- | drivers/staging/rtl8192e/r8192E_dm.c | 19 | ||||
-rw-r--r-- | 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 d1cb5283c9da..332b2030518e 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) | |||
2292 | 2292 | ||
2293 | // 2008/01/16 MH We can only know RF type in the function. So we have to init | 2293 | // 2008/01/16 MH We can only know RF type in the function. So we have to init |
2294 | // DIG RATR table again. | 2294 | // DIG RATR table again. |
2295 | init_rate_adaptive(dev); | 2295 | init_rate_adaptive(priv); |
2296 | 2296 | ||
2297 | //1 Make a copy for following variables and we can change them if we want | 2297 | //1 Make a copy for following variables and we can change them if we want |
2298 | 2298 | ||
@@ -2408,7 +2408,7 @@ static short rtl8192_init(struct r8192_priv *priv) | |||
2408 | rtl8192_get_eeprom_size(priv); | 2408 | rtl8192_get_eeprom_size(priv); |
2409 | rtl8192_read_eeprom_info(priv); | 2409 | rtl8192_read_eeprom_info(priv); |
2410 | rtl8192_get_channel_map(priv); | 2410 | rtl8192_get_channel_map(priv); |
2411 | init_hal_dm(dev); | 2411 | init_hal_dm(priv); |
2412 | init_timer(&priv->watch_dog_timer); | 2412 | init_timer(&priv->watch_dog_timer); |
2413 | priv->watch_dog_timer.data = (unsigned long)priv; | 2413 | priv->watch_dog_timer.data = (unsigned long)priv; |
2414 | priv->watch_dog_timer.function = watch_dog_timer_callback; | 2414 | priv->watch_dog_timer.function = watch_dog_timer_callback; |
@@ -3228,7 +3228,6 @@ static void rtl819x_watchdog_wqcallback(struct work_struct *work) | |||
3228 | { | 3228 | { |
3229 | struct delayed_work *dwork = container_of(work,struct delayed_work,work); | 3229 | struct delayed_work *dwork = container_of(work,struct delayed_work,work); |
3230 | struct r8192_priv *priv = container_of(dwork,struct r8192_priv,watch_dog_wq); | 3230 | struct r8192_priv *priv = container_of(dwork,struct r8192_priv,watch_dog_wq); |
3231 | struct net_device *dev = priv->ieee80211->dev; | ||
3232 | struct ieee80211_device* ieee = priv->ieee80211; | 3231 | struct ieee80211_device* ieee = priv->ieee80211; |
3233 | RESET_TYPE ResetType = RESET_TYPE_NORESET; | 3232 | RESET_TYPE ResetType = RESET_TYPE_NORESET; |
3234 | bool bBusyTraffic = false; | 3233 | bool bBusyTraffic = false; |
@@ -3239,7 +3238,7 @@ static void rtl819x_watchdog_wqcallback(struct work_struct *work) | |||
3239 | 3238 | ||
3240 | if(!priv->up) | 3239 | if(!priv->up) |
3241 | return; | 3240 | return; |
3242 | hal_dm_watchdog(dev); | 3241 | hal_dm_watchdog(priv); |
3243 | #ifdef ENABLE_IPS | 3242 | #ifdef ENABLE_IPS |
3244 | if(ieee->actscanning == false){ | 3243 | if(ieee->actscanning == false){ |
3245 | if((ieee->iw_mode == IW_MODE_INFRA) && (ieee->state == IEEE80211_NOLINK) && | 3244 | if((ieee->iw_mode == IW_MODE_INFRA) && (ieee->state == IEEE80211_NOLINK) && |
@@ -3452,7 +3451,7 @@ int rtl8192_down(struct net_device *dev) | |||
3452 | 3451 | ||
3453 | rtl8192_irq_disable(priv); | 3452 | rtl8192_irq_disable(priv); |
3454 | rtl8192_cancel_deferred_work(priv); | 3453 | rtl8192_cancel_deferred_work(priv); |
3455 | deinit_hal_dm(dev); | 3454 | deinit_hal_dm(priv); |
3456 | del_timer_sync(&priv->watch_dog_timer); | 3455 | del_timer_sync(&priv->watch_dog_timer); |
3457 | 3456 | ||
3458 | ieee80211_softmac_stop_protocol(priv->ieee80211,true); | 3457 | ieee80211_softmac_stop_protocol(priv->ieee80211,true); |
diff --git a/drivers/staging/rtl8192e/r8192E_dm.c b/drivers/staging/rtl8192e/r8192E_dm.c index 68ac73e4c7f0..4ea50b8c57ca 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); | |||
95 | * Prepare SW resource for HW dynamic mechanism. | 95 | * Prepare SW resource for HW dynamic mechanism. |
96 | * This function is only invoked at driver intialization once. | 96 | * This function is only invoked at driver intialization once. |
97 | */ | 97 | */ |
98 | void init_hal_dm(struct net_device *dev) | 98 | void init_hal_dm(struct r8192_priv *priv) |
99 | { | 99 | { |
100 | struct r8192_priv *priv = ieee80211_priv(dev); | ||
101 | |||
102 | // Undecorated Smoothed Signal Strength, it can utilized to dynamic mechanism. | 100 | // Undecorated Smoothed Signal Strength, it can utilized to dynamic mechanism. |
103 | priv->undecorated_smoothed_pwdb = -1; | 101 | priv->undecorated_smoothed_pwdb = -1; |
104 | 102 | ||
105 | //Initial TX Power Control for near/far range , add by amy 2008/05/15, porting from windows code. | 103 | //Initial TX Power Control for near/far range , add by amy 2008/05/15, porting from windows code. |
106 | dm_init_dynamic_txpower(priv); | 104 | dm_init_dynamic_txpower(priv); |
107 | init_rate_adaptive(dev); | 105 | init_rate_adaptive(priv); |
108 | //dm_initialize_txpower_tracking(dev); | 106 | //dm_initialize_txpower_tracking(dev); |
109 | dm_dig_init(priv); | 107 | dm_dig_init(priv); |
110 | dm_init_edca_turbo(priv); | 108 | dm_init_edca_turbo(priv); |
@@ -116,16 +114,13 @@ void init_hal_dm(struct net_device *dev) | |||
116 | 114 | ||
117 | } | 115 | } |
118 | 116 | ||
119 | void deinit_hal_dm(struct net_device *dev) | 117 | void deinit_hal_dm(struct r8192_priv *priv) |
120 | { | 118 | { |
121 | struct r8192_priv *priv = ieee80211_priv(dev); | ||
122 | |||
123 | dm_deInit_fsync(priv); | 119 | dm_deInit_fsync(priv); |
124 | } | 120 | } |
125 | 121 | ||
126 | void hal_dm_watchdog(struct net_device *dev) | 122 | void hal_dm_watchdog(struct r8192_priv *priv) |
127 | { | 123 | { |
128 | struct r8192_priv *priv = ieee80211_priv(dev); | ||
129 | 124 | ||
130 | /*Add by amy 2008/05/15 ,porting from windows code.*/ | 125 | /*Add by amy 2008/05/15 ,porting from windows code.*/ |
131 | dm_check_rate_adaptive(priv); | 126 | dm_check_rate_adaptive(priv); |
@@ -154,11 +149,9 @@ void hal_dm_watchdog(struct net_device *dev) | |||
154 | * 01/16/2008 MHC RF_Type is assigned in ReadAdapterInfo(). We must call | 149 | * 01/16/2008 MHC RF_Type is assigned in ReadAdapterInfo(). We must call |
155 | * the function after making sure RF_Type. | 150 | * the function after making sure RF_Type. |
156 | */ | 151 | */ |
157 | void init_rate_adaptive(struct net_device * dev) | 152 | void init_rate_adaptive(struct r8192_priv *priv) |
158 | { | 153 | { |
159 | 154 | prate_adaptive pra = &priv->rate_adaptive; | |
160 | struct r8192_priv *priv = ieee80211_priv(dev); | ||
161 | prate_adaptive pra = (prate_adaptive)&priv->rate_adaptive; | ||
162 | 155 | ||
163 | pra->ratr_state = DM_RATR_STA_MAX; | 156 | pra->ratr_state = DM_RATR_STA_MAX; |
164 | pra->high2low_rssi_thresh_for_ra = RateAdaptiveTH_High; | 157 | 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 306dc367d93c..b5b34eaaee93 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 | |||
212 | extern dig_t dm_digtable; | 212 | extern dig_t dm_digtable; |
213 | extern DRxPathSel DM_RxPathSelTable; | 213 | extern DRxPathSel DM_RxPathSelTable; |
214 | 214 | ||
215 | void init_hal_dm(struct net_device *dev); | 215 | void init_hal_dm(struct r8192_priv *priv); |
216 | void deinit_hal_dm(struct net_device *dev); | 216 | void deinit_hal_dm(struct r8192_priv *priv); |
217 | 217 | ||
218 | void hal_dm_watchdog(struct net_device *dev); | 218 | void hal_dm_watchdog(struct r8192_priv *priv); |
219 | 219 | ||
220 | void init_rate_adaptive(struct net_device *dev); | 220 | void init_rate_adaptive(struct r8192_priv *priv); |
221 | void dm_txpower_trackingcallback(struct work_struct *work); | 221 | void dm_txpower_trackingcallback(struct work_struct *work); |
222 | void dm_rf_pathcheck_workitemcallback(struct work_struct *work); | 222 | void dm_rf_pathcheck_workitemcallback(struct work_struct *work); |
223 | void dm_initialize_txpower_tracking(struct r8192_priv *priv); | 223 | void dm_initialize_txpower_tracking(struct r8192_priv *priv); |