staging: rtl8192e: Pass ieee80211_device to callbacks
authorMike McCormack <mikem@ring3k.org>
Thu, 10 Mar 2011 13:33:47 +0000 (22:33 +0900)
committerGreg Kroah-Hartman <gregkh@suse.de>
Mon, 14 Mar 2011 19:24:45 +0000 (12:24 -0700)
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_rx.c
drivers/staging/rtl8192e/ieee80211/ieee80211_softmac.c
drivers/staging/rtl8192e/ieee80211/ieee80211_softmac_wx.c
drivers/staging/rtl8192e/ieee80211/ieee80211_tx.c
drivers/staging/rtl8192e/ieee80211/ieee80211_wx.c
drivers/staging/rtl8192e/r8192E.h
drivers/staging/rtl8192e/r8192E_core.c
drivers/staging/rtl8192e/r8192E_wx.c

index 57ff8e55bd637b4850c1824c120339fa65c1d037..8bbf79d29300f4205e22559fec14843c8aa71966 100644 (file)
@@ -1803,7 +1803,7 @@ struct ieee80211_device {
        u8  LPSDelayCnt;
        bool bIsAggregateFrame;
        bool polling;
-       void (*LeisurePSLeave)(struct net_device *dev);
+       void (*LeisurePSLeave)(struct ieee80211_device *ieee);
 #endif
 
 #ifdef ENABLE_IPS
@@ -1811,10 +1811,10 @@ struct ieee80211_device {
        bool wx_set_enc;
        struct semaphore ips_sem;
        struct work_struct ips_leave_wq;
-        void (*ieee80211_ips_leave_wq) (struct net_device *dev);
-        void (*ieee80211_ips_leave)(struct net_device *dev);
+        void (*ieee80211_ips_leave_wq) (struct ieee80211_device *ieee);
+        void (*ieee80211_ips_leave)(struct ieee80211_device *ieee);
 #endif
-       void (*SetHwRegHandler)(struct net_device *dev,u8 variable,u8* val);
+       void (*SetHwRegHandler)(struct ieee80211_device *ieee, u8 variable, u8 *val);
        u8   (*rtllib_ap_sec_type)(struct ieee80211_device *ieee);
 
        //hw security related
@@ -2099,7 +2099,7 @@ struct ieee80211_device {
         struct workqueue_struct *wq;
 
        /* Callback functions */
-       void (*set_security)(struct net_device *dev,
+       void (*set_security)(struct ieee80211_device *ieee,
                             struct ieee80211_security *sec);
 
        /* Used to TX data frame by using txb structs.
@@ -2107,7 +2107,7 @@ struct ieee80211_device {
         * is set the flag IEEE_SOFTMAC_TX_QUEUE
         */
        int (*hard_start_xmit)(struct ieee80211_txb *txb,
-                              struct net_device *dev);
+                              struct ieee80211_device *ieee);
 
        int (*reset_port)(struct net_device *dev);
         int (*is_queue_full) (struct net_device * dev, int pri);
index 57acb3f21adf2a83c19ff2df5cde0a97d34cb25c..c57a90e41058305755382cf062b44792156ce61f 100644 (file)
@@ -1341,7 +1341,7 @@ int ieee80211_rtl_rx(struct ieee80211_device *ieee, struct sk_buff *skb,
                                                (ieee->LinkDetectInfo.NumRxUnicastOkInPeriod > 2) )
                                        {
                                                if(ieee->LeisurePSLeave)
-                                                       ieee->LeisurePSLeave(dev);
+                                                       ieee->LeisurePSLeave(ieee);
                                        }
                                }
                        }
index b4fea6f7509efb9b1b5898263df173d4d6cc9cbc..d75c731157bac9ced0cd85443d2ae3f6b55fef12 100644 (file)
@@ -609,7 +609,7 @@ void ieee80211_rtl_start_scan(struct ieee80211_device *ieee)
 {
 #ifdef ENABLE_IPS
        if(ieee->ieee80211_ips_leave_wq != NULL)
-               ieee->ieee80211_ips_leave_wq(ieee->dev);
+               ieee->ieee80211_ips_leave_wq(ieee);
 #endif
 
 #ifdef ENABLE_DOT11D
@@ -1408,7 +1408,7 @@ void ieee80211_associate_procedure_wq(struct work_struct *work)
        ieee->sync_scan_hurryup = 1;
 #ifdef ENABLE_IPS
        if(ieee->ieee80211_ips_leave != NULL)
-               ieee->ieee80211_ips_leave(ieee->dev);
+               ieee->ieee80211_ips_leave(ieee);
 #endif
 
        down(&ieee->wx_sem);
@@ -2522,7 +2522,7 @@ void ieee80211_start_bss(struct ieee80211_device *ieee)
        if (ieee->state == IEEE80211_NOLINK){
 #ifdef ENABLE_IPS
                if(ieee->ieee80211_ips_leave_wq != NULL)
-                       ieee->ieee80211_ips_leave_wq(ieee->dev);
+                       ieee->ieee80211_ips_leave_wq(ieee);
 #endif
                ieee->actscanning = true;
                ieee80211_rtl_start_scan(ieee);
@@ -2933,7 +2933,7 @@ static int ieee80211_wpa_set_auth_algs(struct ieee80211_device *ieee, int value)
 
 
        if (ieee->set_security)
-               ieee->set_security(ieee->dev, &sec);
+               ieee->set_security(ieee, &sec);
 
        return ret;
 }
@@ -2981,7 +2981,7 @@ static int ieee80211_wpa_set_param(struct ieee80211_device *ieee, u8 name, u32 v
                        sec.level = SEC_LEVEL_1;
                }
                if (ieee->set_security)
-                       ieee->set_security(ieee->dev, &sec);
+                       ieee->set_security(ieee, &sec);
                break;
        }
 
@@ -3147,7 +3147,7 @@ static int ieee80211_wpa_set_encryption(struct ieee80211_device *ieee,
        }
  done:
        if (ieee->set_security)
-               ieee->set_security(ieee->dev, &sec);
+               ieee->set_security(ieee, &sec);
 
        /* Do not reset port if card is in Managed mode since resetting will
         * generate new IEEE 802.11 authentication which may end up in looping
index 427dfc1d0ffa9b304c7eccd10402759bfd14c0b0..f82bb7d6203d37621501a366ffff025b14cd76be 100644 (file)
@@ -70,7 +70,7 @@ int ieee80211_wx_set_freq(struct ieee80211_device *ieee, struct iw_request_info
                }
 #endif
                ieee->current_network.channel = fwrq->m;
-               ieee->set_chan(ieee->dev, ieee->current_network.channel);
+               ieee->set_chan(ieee, ieee->current_network.channel);
 
                if(ieee->iw_mode == IW_MODE_ADHOC || ieee->iw_mode == IW_MODE_MASTER)
                        if(ieee->state == IEEE80211_LINKED){
@@ -307,7 +307,7 @@ void ieee80211_wx_sync_scan_wq(struct work_struct *work)
 
 #ifdef ENABLE_LPS
        if (ieee->LeisurePSLeave) {
-               ieee->LeisurePSLeave(ieee->dev);
+               ieee->LeisurePSLeave(ieee);
        }
 
        /* notify AP to be in PS mode */
@@ -334,14 +334,14 @@ void ieee80211_wx_sync_scan_wq(struct work_struct *work)
        if (b40M) {
                printk("Scan in 20M, back to 40M\n");
                if (chan_offset == HT_EXTCHNL_OFFSET_UPPER)
-                       ieee->set_chan(ieee->dev, chan + 2);
+                       ieee->set_chan(ieee, chan + 2);
                else if (chan_offset == HT_EXTCHNL_OFFSET_LOWER)
-                       ieee->set_chan(ieee->dev, chan - 2);
+                       ieee->set_chan(ieee, chan - 2);
                else
-                       ieee->set_chan(ieee->dev, chan);
+                       ieee->set_chan(ieee, chan);
                ieee->SetBWModeHandler(ieee->dev, bandwidth, chan_offset);
        } else {
-               ieee->set_chan(ieee->dev, chan);
+               ieee->set_chan(ieee, chan);
        }
 
        ieee->InitialGainHandler(ieee->dev,IG_Restore);
index 17535a23c57bd3450ea525e66f8a4fc65c10db4f..ea715a2d4dc3ce004dab332405114c9a364036e2 100644 (file)
@@ -935,7 +935,7 @@ int ieee80211_rtl_xmit(struct sk_buff *skb, struct net_device *dev)
                if (ieee->softmac_features & IEEE_SOFTMAC_TX_QUEUE){
                        ieee80211_softmac_xmit(txb, ieee);
                }else{
-                       if ((*ieee->hard_start_xmit)(txb, dev) == 0) {
+                       if ((*ieee->hard_start_xmit)(txb, ieee) == 0) {
                                stats->tx_packets++;
                                stats->tx_bytes += txb->payload_size;
                                return 0;
index bb0ff26bd8430909a1adeb6c4e736d12e101d9b7..ef3a9b202d421a0d2dddb07c5f073404d20001e7 100644 (file)
@@ -463,7 +463,7 @@ int ieee80211_wx_set_encode(struct ieee80211_device *ieee,
        sec.level = SEC_LEVEL_1; /* 40 and 104 bit WEP */
 
        if (ieee->set_security)
-               ieee->set_security(dev, &sec);
+               ieee->set_security(ieee, &sec);
 
        /* Do not reset port if card is in Managed mode since resetting will
         * generate new IEEE 802.11 authentication which may end up in looping
@@ -696,7 +696,7 @@ int ieee80211_wx_set_encode_ext(struct ieee80211_device *ieee,
 #endif
 done:
         if (ieee->set_security)
-                ieee->set_security(ieee->dev, &sec);
+               ieee->set_security(ieee, &sec);
 
         if (ieee->reset_on_keychange &&
             ieee->iw_mode != IW_MODE_INFRA &&
index 9ff0548f188e09462b77221a77abb5c238907e23..8052d0cf9fb90c8dad5397989b4373ee9f76edf0 100644 (file)
@@ -1133,12 +1133,12 @@ RT_STATUS cmpk_message_handle_tx(struct net_device *dev, u8* codevirtualaddress,
 void IPSEnter(struct r8192_priv *priv);
 void IPSLeave(struct r8192_priv *priv);
 void IPSLeave_wq(struct work_struct *work);
-void ieee80211_ips_leave_wq(struct net_device *dev);
-void ieee80211_ips_leave(struct net_device *dev);
+void ieee80211_ips_leave_wq(struct ieee80211_device *ieee80211);
+void ieee80211_ips_leave(struct ieee80211_device *ieee80211);
 #endif
 #ifdef ENABLE_LPS
-void LeisurePSEnter(struct net_device *dev);
-void LeisurePSLeave(struct net_device *dev);
+void LeisurePSEnter(struct ieee80211_device *ieee80211);
+void LeisurePSLeave(struct ieee80211_device *ieee80211);
 #endif
 
 bool NicIFEnableNIC(struct r8192_priv *priv);
index c392f19b0bdbfb43dc3d9fceb3c4613db83ac2f2..efd7e7f0a4f09e68921bf18a68d6ee1143fabaa7 100644 (file)
@@ -271,10 +271,9 @@ u8 rtl8192e_ap_sec_type(struct ieee80211_device *ieee)
        }
 }
 
-void
-rtl8192e_SetHwReg(struct net_device *dev,u8 variable,u8* val)
+void rtl8192e_SetHwReg(struct ieee80211_device *ieee80211, u8 variable, u8 *val)
 {
-       struct r8192_priv* priv = ieee80211_priv(dev);
+       struct r8192_priv *priv = ieee80211_priv(ieee80211->dev);
 
        switch(variable)
        {
@@ -748,13 +747,12 @@ void PHY_SetRtl8192eRfOff(struct r8192_priv *priv)
 
 static void rtl8192_halt_adapter(struct r8192_priv *priv, bool reset)
 {
-       struct net_device *dev = priv->ieee80211->dev;
        int i;
        u8 OpMode;
        u32 ulRegRead;
 
        OpMode = RT_OP_MODE_NO_LINK;
-       priv->ieee80211->SetHwRegHandler(dev, HW_VAR_MEDIA_STATUS, &OpMode);
+       priv->ieee80211->SetHwRegHandler(priv->ieee80211, HW_VAR_MEDIA_STATUS, &OpMode);
 
        if (!priv->ieee80211->bSupportRemoteWakeUp) {
                /*
@@ -3071,9 +3069,9 @@ bool MgntActSet_802_11_PowerSaveMode(struct r8192_priv *priv, u8 rtPsMode)
 }
 
 /* Enter the leisure power save mode. */
-void LeisurePSEnter(struct net_device *dev)
+void LeisurePSEnter(struct ieee80211_device *ieee80211)
 {
-       struct r8192_priv *priv = ieee80211_priv(dev);
+       struct r8192_priv *priv = ieee80211_priv(ieee80211->dev);
        PRT_POWER_SAVE_CONTROL pPSC = &priv->PowerSaveControl;
 
        if(!((priv->ieee80211->iw_mode == IW_MODE_INFRA) &&
@@ -3101,9 +3099,9 @@ void LeisurePSEnter(struct net_device *dev)
 
 
 /* Leave leisure power save mode. */
-void LeisurePSLeave(struct net_device *dev)
+void LeisurePSLeave(struct ieee80211_device *ieee80211)
 {
-       struct r8192_priv *priv = ieee80211_priv(dev);
+       struct r8192_priv *priv = ieee80211_priv(ieee80211->dev);
        PRT_POWER_SAVE_CONTROL pPSC = &priv->PowerSaveControl;
 
        if (pPSC->bLeisurePs)
@@ -3181,9 +3179,9 @@ void IPSLeave_wq(struct work_struct *work)
        up(&priv->ieee80211->ips_sem);
 }
 
-void ieee80211_ips_leave_wq(struct net_device *dev)
+void ieee80211_ips_leave_wq(struct ieee80211_device *ieee80211)
 {
-       struct r8192_priv *priv = (struct r8192_priv *)ieee80211_priv(dev);
+       struct r8192_priv *priv = ieee80211_priv(ieee80211->dev);
        RT_RF_POWER_STATE       rtState;
        rtState = priv->eRFPowerState;
 
@@ -3202,12 +3200,12 @@ void ieee80211_ips_leave_wq(struct net_device *dev)
        }
 }
 //added by amy 090331 end
-void ieee80211_ips_leave(struct net_device *dev)
+void ieee80211_ips_leave(struct ieee80211_device *ieee80211)
 {
-       struct r8192_priv *priv = (struct r8192_priv *)ieee80211_priv(dev);
-       down(&priv->ieee80211->ips_sem);
+       struct r8192_priv *priv = ieee80211_priv(ieee80211->dev);
+       down(&ieee80211->ips_sem);
        IPSLeave(priv);
-       up(&priv->ieee80211->ips_sem);
+       up(&ieee80211->ips_sem);
 }
 #endif
 
@@ -3283,11 +3281,11 @@ static void rtl819x_watchdog_wqcallback(struct work_struct *work)
                        // LeisurePS only work in infra mode.
                        if(bEnterPS)
                        {
-                               LeisurePSEnter(dev);
+                               LeisurePSEnter(priv->ieee80211);
                        }
                        else
                        {
-                               LeisurePSLeave(dev);
+                               LeisurePSLeave(priv->ieee80211);
                        }
 #endif
 
@@ -3295,7 +3293,7 @@ static void rtl819x_watchdog_wqcallback(struct work_struct *work)
                else
                {
 #ifdef ENABLE_LPS
-                       LeisurePSLeave(dev);
+                       LeisurePSLeave(priv->ieee80211);
 #endif
                }
 
@@ -3449,7 +3447,7 @@ int rtl8192_down(struct net_device *dev)
 #ifdef ENABLE_LPS
        //LZM for PS-Poll AID issue. 090429
        if(priv->ieee80211->state == IEEE80211_LINKED)
-               LeisurePSLeave(dev);
+               LeisurePSLeave(priv->ieee80211);
 #endif
 
        priv->up=0;
index f76377602da60aa0240a7fd30402e3a4b682a249..adad91b0b6b105f3b81a1823c9f35959b3cbe65e 100644 (file)
@@ -1006,7 +1006,7 @@ static int r8192_wx_adapter_power_status(struct net_device *dev,
        } else {
                //LZM for PS-Poll AID issue. 090429
                if(priv->ieee80211->state == IEEE80211_LINKED)
-                       LeisurePSLeave(dev);
+                       LeisurePSLeave(priv->ieee80211);
 
                priv->ps_force = true;
                pPSC->bLeisurePs = false;