libertas: move SIOCGIWAP calls to wext.c
authorHolger Schurig <hs4233@mail.mn-solutions.de>
Thu, 22 Oct 2009 13:30:56 +0000 (15:30 +0200)
committerJohn W. Linville <linville@tuxdriver.com>
Tue, 27 Oct 2009 20:48:39 +0000 (16:48 -0400)
Signed-off-by: Holger Schurig <hs4233@mail.mn-solutions.de>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
drivers/net/wireless/libertas/cmdresp.c
drivers/net/wireless/libertas/main.c
drivers/net/wireless/libertas/wext.c
drivers/net/wireless/libertas/wext.h

index e3b854cce69c6b7302e544896d36d64a30684c35..abd20ea92553a384d6a9256e35a960d42b88dec7 100644 (file)
  */
 void lbs_mac_event_disconnected(struct lbs_private *priv)
 {
-       union iwreq_data wrqu;
-
        if (priv->connect_status != LBS_CONNECTED)
                return;
 
        lbs_deb_enter(LBS_DEB_ASSOC);
 
-       memset(wrqu.ap_addr.sa_data, 0x00, ETH_ALEN);
-       wrqu.ap_addr.sa_family = ARPHRD_ETHER;
-
        /*
         * Cisco AP sends EAP failure and de-auth in less than 0.5 ms.
         * It causes problem in the Supplicant
         */
-
        msleep_interruptible(1000);
-       wireless_send_event(priv->dev, SIOCGIWAP, &wrqu, NULL);
+       lbs_send_disconnect_notification(priv);
 
        /* report disconnect to upper layer */
        netif_stop_queue(priv->dev);
index eb61f6955e9ed5c708514a0fab3db26bb6e34252..01f46cf288d7f244407229cb5026e2d967e78102 100644 (file)
@@ -1227,7 +1227,6 @@ EXPORT_SYMBOL_GPL(lbs_add_card);
 void lbs_remove_card(struct lbs_private *priv)
 {
        struct net_device *dev = priv->dev;
-       union iwreq_data wrqu;
 
        lbs_deb_enter(LBS_DEB_MAIN);
 
@@ -1252,9 +1251,7 @@ void lbs_remove_card(struct lbs_private *priv)
                lbs_ps_wakeup(priv, CMD_OPTION_WAITFORRSP);
        }
 
-       memset(wrqu.ap_addr.sa_data, 0xaa, ETH_ALEN);
-       wrqu.ap_addr.sa_family = ARPHRD_ETHER;
-       wireless_send_event(priv->dev, SIOCGIWAP, &wrqu, NULL);
+       lbs_send_disconnect_notification(priv);
 
        if (priv->is_deep_sleep) {
                priv->is_deep_sleep = 0;
index 18c045bcc947ab4b0938debbc6efeb964e8d4d6e..dc63b33b01f0c2628b066b197da29cf12e427d44 100644 (file)
@@ -45,6 +45,15 @@ static inline void lbs_cancel_association_work(struct lbs_private *priv)
        priv->pending_assoc_req = NULL;
 }
 
+void lbs_send_disconnect_notification(struct lbs_private *priv)
+{
+       union iwreq_data wrqu;
+
+       memset(wrqu.ap_addr.sa_data, 0x00, ETH_ALEN);
+       wrqu.ap_addr.sa_family = ARPHRD_ETHER;
+       wireless_send_event(priv->dev, SIOCGIWAP, &wrqu, NULL);
+}
+
 void lbs_send_iwevcustom_event(struct lbs_private *priv, s8 *str)
 {
        union iwreq_data iwrq;
index 607d0ffefddb1234f5ffe82bdd3c62868a365e75..50558262ecc3b04dc776785ef32fd70cfaf96a94 100644 (file)
@@ -4,6 +4,7 @@
 #ifndef        _LBS_WEXT_H_
 #define        _LBS_WEXT_H_
 
+void lbs_send_disconnect_notification(struct lbs_private *priv);
 void lbs_send_iwevcustom_event(struct lbs_private *priv, s8 *str);
 
 extern struct iw_handler_def lbs_handler_def;