]> err.no Git - linux-2.6/commitdiff
[PATCH] libertas: pull current channel from firmware on mesh autostart
authorLuis Carlos Cobo Rus <luisca@cozybit.com>
Wed, 30 May 2007 16:14:34 +0000 (12:14 -0400)
committerJohn W. Linville <linville@tuxdriver.com>
Tue, 12 Jun 2007 18:02:23 +0000 (14:02 -0400)
Signed-off-by: Luis Carlos Cobo Rus <luisca@cozybit.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
drivers/net/wireless/libertas/assoc.c
drivers/net/wireless/libertas/assoc.h
drivers/net/wireless/libertas/cmdresp.c
drivers/net/wireless/libertas/dev.h
drivers/net/wireless/libertas/main.c

index ee82413b426d2ee2a64d034a675b65a4911e25c7..06a90b42a451b93380a3b082be545157d7e38f57 100644 (file)
@@ -200,6 +200,14 @@ static int update_channel(wlan_private * priv)
                                    cmd_option_waitforrsp, 0, NULL);
 }
 
+void libertas_sync_channel(struct work_struct *work)
+{
+       wlan_private *priv = container_of(work, wlan_private, sync_channel);
+
+       if (update_channel(priv) != 0)
+               lbs_pr_info("Channel synchronization failed.");
+}
+
 static int assoc_helper_channel(wlan_private *priv,
                                 struct assoc_request * assoc_req)
 {
index b5eddf8d3b3980aa6cb96efdec9f069556847fe9..5e9c31f0932b1d64377184c5fa038c16dbbdd19f 100644 (file)
@@ -9,6 +9,8 @@ void libertas_association_worker(struct work_struct *work);
 
 struct assoc_request * wlan_get_association_request(wlan_adapter *adapter);
 
+void libertas_sync_channel(struct work_struct *work);
+
 #define ASSOC_DELAY (HZ / 2)
 static inline void wlan_postpone_association_work(wlan_private *priv)
 {
index ebedd630d72e36dacb3c396ad1be8f4f8daac5df..0c3b9a583d83cab84b4d44eb5e0d625a59b3f9d5 100644 (file)
@@ -987,6 +987,7 @@ int libertas_process_event(wlan_private * priv)
                        netif_carrier_on(priv->mesh_dev) ;
                }
                adapter->mode = IW_MODE_ADHOC ;
+               schedule_work(&priv->sync_channel);
                break;
 
        default:
index d6c340aef681f5e93700af8f2858245d182c2d25..785192b884bc27c1419d7aff773c8d477b1fb21a 100644 (file)
@@ -150,6 +150,7 @@ struct _wlan_private {
 
        struct delayed_work assoc_work;
        struct workqueue_struct *assoc_thread;
+       struct work_struct sync_channel;
 
        /** Hardware access */
        int (*hw_register_dev) (wlan_private * priv);
index ec9be0c51c698dbb13688fc127ea6cbbd03dba08..20ac7e1cec54330c365a486ea1c8c90cee80e110 100644 (file)
@@ -847,6 +847,7 @@ int libertas_activate_card(wlan_private *priv, char *fw_name)
        priv->assoc_thread =
                create_singlethread_workqueue("libertas_assoc");
        INIT_DELAYED_WORK(&priv->assoc_work, libertas_association_worker);
+       INIT_WORK(&priv->sync_channel, libertas_sync_channel);
 
        /*
         * Register the device. Fillup the private data structure with