From b8bedefd8fe589ff87a681e20583c8317030491d Mon Sep 17 00:00:00 2001 From: Luis Carlos Cobo Rus Date: Wed, 30 May 2007 12:14:34 -0400 Subject: [PATCH] [PATCH] libertas: pull current channel from firmware on mesh autostart Signed-off-by: Luis Carlos Cobo Rus Signed-off-by: John W. Linville --- drivers/net/wireless/libertas/assoc.c | 8 ++++++++ drivers/net/wireless/libertas/assoc.h | 2 ++ drivers/net/wireless/libertas/cmdresp.c | 1 + drivers/net/wireless/libertas/dev.h | 1 + drivers/net/wireless/libertas/main.c | 1 + 5 files changed, 13 insertions(+) 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) 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) { 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); 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) { 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) netif_carrier_on(priv->mesh_dev) ; } adapter->mode = IW_MODE_ADHOC ; + schedule_work(&priv->sync_channel); break; 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 { struct delayed_work assoc_work; struct workqueue_struct *assoc_thread; + struct work_struct sync_channel; /** Hardware access */ 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) 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 -- 2.34.1