aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLuis Carlos Cobo Rus <luisca@cozybit.com>2007-05-30 12:14:34 -0400
committerJohn W. Linville <linville@tuxdriver.com>2007-06-12 14:02:23 -0400
commitb8bedefd8fe589ff87a681e20583c8317030491d (patch)
tree2ec517d95cc034d35290c9fb29230224e93fcae6
parent717c9339202a42ae7bec7d3c4b84deecdcae9f81 (diff)
[PATCH] libertas: pull current channel from firmware on mesh autostart
Signed-off-by: Luis Carlos Cobo Rus <luisca@cozybit.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
-rw-r--r--drivers/net/wireless/libertas/assoc.c8
-rw-r--r--drivers/net/wireless/libertas/assoc.h2
-rw-r--r--drivers/net/wireless/libertas/cmdresp.c1
-rw-r--r--drivers/net/wireless/libertas/dev.h1
-rw-r--r--drivers/net/wireless/libertas/main.c1
5 files changed, 13 insertions, 0 deletions
diff --git a/drivers/net/wireless/libertas/assoc.c b/drivers/net/wireless/libertas/assoc.c
index ee82413b426d..06a90b42a451 100644
--- a/drivers/net/wireless/libertas/assoc.c
+++ b/drivers/net/wireless/libertas/assoc.c
@@ -200,6 +200,14 @@ static int update_channel(wlan_private * priv)
200 cmd_option_waitforrsp, 0, NULL); 200 cmd_option_waitforrsp, 0, NULL);
201} 201}
202 202
203void libertas_sync_channel(struct work_struct *work)
204{
205 wlan_private *priv = container_of(work, wlan_private, sync_channel);
206
207 if (update_channel(priv) != 0)
208 lbs_pr_info("Channel synchronization failed.");
209}
210
203static int assoc_helper_channel(wlan_private *priv, 211static int assoc_helper_channel(wlan_private *priv,
204 struct assoc_request * assoc_req) 212 struct assoc_request * assoc_req)
205{ 213{
diff --git a/drivers/net/wireless/libertas/assoc.h b/drivers/net/wireless/libertas/assoc.h
index b5eddf8d3b39..5e9c31f0932b 100644
--- a/drivers/net/wireless/libertas/assoc.h
+++ b/drivers/net/wireless/libertas/assoc.h
@@ -9,6 +9,8 @@ void libertas_association_worker(struct work_struct *work);
9 9
10struct assoc_request * wlan_get_association_request(wlan_adapter *adapter); 10struct assoc_request * wlan_get_association_request(wlan_adapter *adapter);
11 11
12void libertas_sync_channel(struct work_struct *work);
13
12#define ASSOC_DELAY (HZ / 2) 14#define ASSOC_DELAY (HZ / 2)
13static inline void wlan_postpone_association_work(wlan_private *priv) 15static inline void wlan_postpone_association_work(wlan_private *priv)
14{ 16{
diff --git a/drivers/net/wireless/libertas/cmdresp.c b/drivers/net/wireless/libertas/cmdresp.c
index ebedd630d72e..0c3b9a583d83 100644
--- a/drivers/net/wireless/libertas/cmdresp.c
+++ b/drivers/net/wireless/libertas/cmdresp.c
@@ -987,6 +987,7 @@ int libertas_process_event(wlan_private * priv)
987 netif_carrier_on(priv->mesh_dev) ; 987 netif_carrier_on(priv->mesh_dev) ;
988 } 988 }
989 adapter->mode = IW_MODE_ADHOC ; 989 adapter->mode = IW_MODE_ADHOC ;
990 schedule_work(&priv->sync_channel);
990 break; 991 break;
991 992
992 default: 993 default:
diff --git a/drivers/net/wireless/libertas/dev.h b/drivers/net/wireless/libertas/dev.h
index d6c340aef681..785192b884bc 100644
--- a/drivers/net/wireless/libertas/dev.h
+++ b/drivers/net/wireless/libertas/dev.h
@@ -150,6 +150,7 @@ struct _wlan_private {
150 150
151 struct delayed_work assoc_work; 151 struct delayed_work assoc_work;
152 struct workqueue_struct *assoc_thread; 152 struct workqueue_struct *assoc_thread;
153 struct work_struct sync_channel;
153 154
154 /** Hardware access */ 155 /** Hardware access */
155 int (*hw_register_dev) (wlan_private * priv); 156 int (*hw_register_dev) (wlan_private * priv);
diff --git a/drivers/net/wireless/libertas/main.c b/drivers/net/wireless/libertas/main.c
index ec9be0c51c69..20ac7e1cec54 100644
--- a/drivers/net/wireless/libertas/main.c
+++ b/drivers/net/wireless/libertas/main.c
@@ -847,6 +847,7 @@ int libertas_activate_card(wlan_private *priv, char *fw_name)
847 priv->assoc_thread = 847 priv->assoc_thread =
848 create_singlethread_workqueue("libertas_assoc"); 848 create_singlethread_workqueue("libertas_assoc");
849 INIT_DELAYED_WORK(&priv->assoc_work, libertas_association_worker); 849 INIT_DELAYED_WORK(&priv->assoc_work, libertas_association_worker);
850 INIT_WORK(&priv->sync_channel, libertas_sync_channel);
850 851
851 /* 852 /*
852 * Register the device. Fillup the private data structure with 853 * Register the device. Fillup the private data structure with