aboutsummaryrefslogtreecommitdiffstats
path: root/net/wireless
diff options
context:
space:
mode:
authorDavid S. Miller <davem@davemloft.net>2010-04-07 02:53:30 -0400
committerDavid S. Miller <davem@davemloft.net>2010-04-07 02:53:30 -0400
commit4a35ecf8bf1c4b039503fa554100fe85c761de76 (patch)
tree9b75f5d5636004d9a9aa496924377379be09aa1f /net/wireless
parentb4d562e3c3553ac58c7120555c4e4aefbb090a2a (diff)
parentfb9e2d887243499b8d28efcf80821c4f6a092395 (diff)
Merge branch 'master' of master.kernel.org:/pub/scm/linux/kernel/git/davem/net-2.6
Conflicts: drivers/net/bonding/bond_main.c drivers/net/via-velocity.c drivers/net/wireless/iwlwifi/iwl-agn.c
Diffstat (limited to 'net/wireless')
-rw-r--r--net/wireless/reg.c12
1 files changed, 5 insertions, 7 deletions
diff --git a/net/wireless/reg.c b/net/wireless/reg.c
index ed89c59bb431..81fcafc60150 100644
--- a/net/wireless/reg.c
+++ b/net/wireless/reg.c
@@ -324,7 +324,7 @@ struct reg_regdb_search_request {
324}; 324};
325 325
326static LIST_HEAD(reg_regdb_search_list); 326static LIST_HEAD(reg_regdb_search_list);
327static DEFINE_SPINLOCK(reg_regdb_search_lock); 327static DEFINE_MUTEX(reg_regdb_search_mutex);
328 328
329static void reg_regdb_search(struct work_struct *work) 329static void reg_regdb_search(struct work_struct *work)
330{ 330{
@@ -332,7 +332,7 @@ static void reg_regdb_search(struct work_struct *work)
332 const struct ieee80211_regdomain *curdom, *regdom; 332 const struct ieee80211_regdomain *curdom, *regdom;
333 int i, r; 333 int i, r;
334 334
335 spin_lock(&reg_regdb_search_lock); 335 mutex_lock(&reg_regdb_search_mutex);
336 while (!list_empty(&reg_regdb_search_list)) { 336 while (!list_empty(&reg_regdb_search_list)) {
337 request = list_first_entry(&reg_regdb_search_list, 337 request = list_first_entry(&reg_regdb_search_list,
338 struct reg_regdb_search_request, 338 struct reg_regdb_search_request,
@@ -346,18 +346,16 @@ static void reg_regdb_search(struct work_struct *work)
346 r = reg_copy_regd(&regdom, curdom); 346 r = reg_copy_regd(&regdom, curdom);
347 if (r) 347 if (r)
348 break; 348 break;
349 spin_unlock(&reg_regdb_search_lock);
350 mutex_lock(&cfg80211_mutex); 349 mutex_lock(&cfg80211_mutex);
351 set_regdom(regdom); 350 set_regdom(regdom);
352 mutex_unlock(&cfg80211_mutex); 351 mutex_unlock(&cfg80211_mutex);
353 spin_lock(&reg_regdb_search_lock);
354 break; 352 break;
355 } 353 }
356 } 354 }
357 355
358 kfree(request); 356 kfree(request);
359 } 357 }
360 spin_unlock(&reg_regdb_search_lock); 358 mutex_unlock(&reg_regdb_search_mutex);
361} 359}
362 360
363static DECLARE_WORK(reg_regdb_work, reg_regdb_search); 361static DECLARE_WORK(reg_regdb_work, reg_regdb_search);
@@ -375,9 +373,9 @@ static void reg_regdb_query(const char *alpha2)
375 373
376 memcpy(request->alpha2, alpha2, 2); 374 memcpy(request->alpha2, alpha2, 2);
377 375
378 spin_lock(&reg_regdb_search_lock); 376 mutex_lock(&reg_regdb_search_mutex);
379 list_add_tail(&request->list, &reg_regdb_search_list); 377 list_add_tail(&request->list, &reg_regdb_search_list);
380 spin_unlock(&reg_regdb_search_lock); 378 mutex_unlock(&reg_regdb_search_mutex);
381 379
382 schedule_work(&reg_regdb_work); 380 schedule_work(&reg_regdb_work);
383} 381}