staging: rtl8192e: Move variables to ieee80211 struct
authorMike McCormack <mikem@ring3k.org>
Thu, 3 Mar 2011 13:44:37 +0000 (22:44 +0900)
committerGreg Kroah-Hartman <gregkh@suse.de>
Mon, 7 Mar 2011 21:31:42 +0000 (13:31 -0800)
Move variables only accessed by the RTL ieee80211 library into its
private struct.

Signed-off-by: Mike McCormack <mikem@ring3k.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
drivers/staging/rtl8192e/ieee80211/ieee80211.h
drivers/staging/rtl8192e/ieee80211/ieee80211_softmac.c
drivers/staging/rtl8192e/r8192E_core.c

index 8ebedd0be7757d0dc910920c7178601f3f5ae0ac..2c5750bfe98eb7c8f78b733603ed3bd0ec2ba15a 100644 (file)
@@ -1811,8 +1811,6 @@ typedef struct _RT_POWER_SAVE_CONTROL
        bool                            bLeisurePs;
        u32                             PowerProfile;
        u8                              LpsIdleCount;
-       u8                              RegMaxLPSAwakeIntvl;
-       u8                              LPSAwakeIntvl;
 
        u32                             CurPsLevel;
        u32                             RegRfPsLevel;
@@ -2200,6 +2198,8 @@ struct ieee80211_device {
 
        /* for PS mode */
        unsigned long last_rx_ps_time;
+       u8 LPSAwakeIntvl;
+       u8 RegMaxLPSAwakeIntvl;
 
        /* used if IEEE_SOFTMAC_SINGLE_QUEUE is set */
        struct sk_buff *mgmt_queue_ring[MGMT_QUEUE_NUM];
index 012256c0fc5244ce1aef6369c017d9d3df5d78f3..88a9cd1958a88b085b420df1961977a6479b69b8 100644 (file)
@@ -1738,7 +1738,6 @@ short ieee80211_sta_ps_sleep(struct ieee80211_device *ieee, u32 *time_h, u32 *ti
 {
        int timeout = ieee->ps_timeout;
        u8 dtim;
-       PRT_POWER_SAVE_CONTROL  pPSC = (PRT_POWER_SAVE_CONTROL)(&(ieee->PowerSaveControl));
 
        if(ieee->LPSDelayCnt)
        {
@@ -1767,35 +1766,35 @@ short ieee80211_sta_ps_sleep(struct ieee80211_device *ieee, u32 *time_h, u32 *ti
 
        if(time_l){
                if(ieee->bAwakePktSent == true) {
-                       pPSC->LPSAwakeIntvl = 1;//tx wake one beacon
+                       ieee->LPSAwakeIntvl = 1;//tx wake one beacon
                } else {
                        u8              MaxPeriod = 1;
 
-                       if(pPSC->LPSAwakeIntvl == 0)
-                               pPSC->LPSAwakeIntvl = 1;
-                       if(pPSC->RegMaxLPSAwakeIntvl == 0) // Default (0x0 - eFastPs, 0xFF -DTIM, 0xNN - 0xNN * BeaconIntvl)
+                       if(ieee->LPSAwakeIntvl == 0)
+                               ieee->LPSAwakeIntvl = 1;
+                       if(ieee->RegMaxLPSAwakeIntvl == 0) // Default (0x0 - eFastPs, 0xFF -DTIM, 0xNN - 0xNN * BeaconIntvl)
                                MaxPeriod = 1; // 1 Beacon interval
-                       else if(pPSC->RegMaxLPSAwakeIntvl == 0xFF) // DTIM
+                       else if(ieee->RegMaxLPSAwakeIntvl == 0xFF) // DTIM
                                MaxPeriod = ieee->current_network.dtim_period;
                        else
-                               MaxPeriod = pPSC->RegMaxLPSAwakeIntvl;
-                       pPSC->LPSAwakeIntvl = (pPSC->LPSAwakeIntvl >= MaxPeriod) ? MaxPeriod : (pPSC->LPSAwakeIntvl + 1);
+                               MaxPeriod = ieee->RegMaxLPSAwakeIntvl;
+                       ieee->LPSAwakeIntvl = (ieee->LPSAwakeIntvl >= MaxPeriod) ? MaxPeriod : (ieee->LPSAwakeIntvl + 1);
                }
                {
                        u8 LPSAwakeIntvl_tmp = 0;
                        u8 period = ieee->current_network.dtim_period;
                        u8 count = ieee->current_network.tim.tim_count;
                        if(count == 0 ) {
-                               if(pPSC->LPSAwakeIntvl > period)
-                                       LPSAwakeIntvl_tmp = period + (pPSC->LPSAwakeIntvl - period) -((pPSC->LPSAwakeIntvl-period)%period);
+                               if(ieee->LPSAwakeIntvl > period)
+                                       LPSAwakeIntvl_tmp = period + (ieee->LPSAwakeIntvl - period) -((ieee->LPSAwakeIntvl-period)%period);
                                else
-                                       LPSAwakeIntvl_tmp = pPSC->LPSAwakeIntvl;
+                                       LPSAwakeIntvl_tmp = ieee->LPSAwakeIntvl;
 
                        } else {
-                               if(pPSC->LPSAwakeIntvl > ieee->current_network.tim.tim_count)
-                                       LPSAwakeIntvl_tmp = count + (pPSC->LPSAwakeIntvl - count) -((pPSC->LPSAwakeIntvl-count)%period);
+                               if(ieee->LPSAwakeIntvl > ieee->current_network.tim.tim_count)
+                                       LPSAwakeIntvl_tmp = count + (ieee->LPSAwakeIntvl - count) -((ieee->LPSAwakeIntvl-count)%period);
                                else
-                                       LPSAwakeIntvl_tmp = pPSC->LPSAwakeIntvl;
+                                       LPSAwakeIntvl_tmp = ieee->LPSAwakeIntvl;
                        }
 
                *time_l = ieee->current_network.last_dtim_sta_time[0]
index 9b40168cd2dd75b3a5879e490df1d820f2c5b4a7..fbdb5c1a8df63b54d8cfcbdddae07f3305bed0be 100644 (file)
@@ -1915,7 +1915,7 @@ static void rtl8192_init_priv_variable(struct net_device* dev)
        pPSC->RegRfPsLevel |= RT_RF_OFF_LEVL_ASPM;
        pPSC->RegRfPsLevel |= RT_RF_LPS_LEVEL_ASPM;
        pPSC->bLeisurePs = true;
-       pPSC->RegMaxLPSAwakeIntvl = 5;
+       priv->ieee80211->RegMaxLPSAwakeIntvl = 5;
        priv->bHwRadioOff = false;
 
        priv->being_init_adapter = false;